function createFlashNotification(e,t,n){Intellum.flashnotice.show(e,t,n)}function trim(e){return e.replace(/^\s*|\s*$/g,"")}function getQueryStringFromKeys(e){var t=getJsonFromUrl(),n="";return e.forEach(function(i){e.indexOf(i)>-1&&"undefined"!=typeof t[i]&&(n+="&"+i+"="+t[i])}),n}function getJsonFromUrl(){var e=location.search.substr(1),t={};return e.split("&").forEach(function(e){var n=e.split("=");t[n[0]]=n[1]}),t}function getDataLayerValueOf(e){return result="",window.dataLayer&&window.dataLayer.forEach(function(t){t[e]!=undefined&&(result=t[e])}),result}function time_from_seconds(e){0===e.length&&(e=0);var t=Math.floor(e/3600);e-=60*t*60;var n=Math.floor(e/60);e-=60*n;var i=e,r=[];return r.push(t<10?"0"+t:t),r.push(n<10?"0"+n:n),r.push(i<10?"0"+i:i),r.join(":")}function updateAssessmentTime(e){var t=parseInt($("#question_time").val());t+=e,$("#question_time").val(t);var n=parseInt($("#time").val());n+=e,$("#time").val(n),$("#time_header").text(time_from_seconds(n))}function updateSinglePageAssessmentSubmitLink(){var e=document.getElementById("single_page_submit_link"),t=document.getElementById("time");if(e&&t){var n=e.getAttribute("data-href");n&&e.setAttribute("href",n+"&time="+t.value)}}function updateTextAreaCharactersLeft(){$(".studentform__textarea").each(function(){var e=$(this),t=256-e.val().length;e.siblings(".question__charcount").first().find("span").html(t)})}function markAssessmentTimeExpired(){return $("form#time-limit-expired").submit(),$("#timed_assessment_time_ran_out")[0].dispatchEvent(new window.CustomEvent("show.dialog")),!0}function redirectToActivityURL(){var e=$("#time-remaining-display").data("activity-url");window.location=e}function leaveTimedAssessmentEarly(){$("form#leave-early").submit()}function startAssessmentTimer(e,t){function n(){var n,o,a,s,l,u,c;n=e-((Date.now()-r)/1e3|0),o=n/3600|0,a=n/60-60*o|0,s=n%60|0,s<0&&(s=0),0==o&&0==a&&s<=20?$(t).addClass("course__time-warning"):$(t).removeClass("course__time-warning"),l=o<10?"0"+o:o,u=a<10?"0"+a:a,c=s<10?"0"+s:s,t.textContent=l+":"+u+":"+c,0==o&&0==a&&0==s&&(clearInterval(i),markAssessmentTimeExpired())}var i,r=Date.now();n(),i=setInterval(n,1e3)}function getCurrentTextValues(){var e={};return $("[data-unsaved-answer-or-grading] textarea, [data-unsaved-answer-or-grading] input[type='text']").each(function(){e[this.name]=this.value}),e}function submitQuestionFormIfTextHasChanged(){var e=getCurrentTextValues();jQuery.each(e,function(e,t){t!=window.textValuesSinceTheirLastSave[e]&&($("[name='"+e+"']").parents("form").submit(),window.textValuesSinceTheirLastSave[e]=t)})}function submitQuestionFormOnUserInteraction(){$(document).on("change sortableStop","[data-unsaved-answer-or-grading] input[type=radio],[data-unsaved-answer-or-grading] input[type=checkbox], [data-unsaved-answer-or-grading] .sequence__list--enabled",function(){$(this).parents("form").submit()}),$(document).on("ajax:success","form[data-unsaved-answer-or-grading]",function(){$(this).find($("[data-error-message]")).hide(),$(this).attr("data-unsaved-answer-or-grading",!1)}),$(document).on("ajax:error","form[data-unsaved-answer-or-grading]",function(){$(this).find($("[data-error-message]")).show()}),window.textValuesSinceTheirLastSave=getCurrentTextValues(),setInterval(submitQuestionFormIfTextHasChanged,5e3)}function createSortables(){jQuery.each($(".sequence__list--enabled"),function(){createSortable($(this))})}function createSortable(e){var t=!1,n=function(){t||$(this).addClass("sequence__listitem--hover")},i=function(){$(this).removeClass("sequence__listitem--hover")};e.children().hover(n,i),e.sortable({axis:"y",placeholder:"sequence__listitem sequence__listitem--placeholder",forcePlaceholderSize:!0,tolerance:"pointer",revert:200,start:function(e,n){n.item.addClass("sequence__listitem--moving"),t=!0},stop:function(n,i){i.item.removeClass("sequence__listitem--moving"),t=!1,e.trigger("sortableStop")}})}function handleSectionNavigation(){$("[data-move-to-assessment-section]").on("click keyup",function(e){return e.preventDefault(),e.stopPropagation(),(!e.key||"Enter"==e.key)&&("true"!=$(this).attr("data-already-clicked")&&($(this).attr("data-already-clicked",!0),$(this).text($(this).attr("data-clicked-text")),handleAssessmentSubmitOrSectionMove($(this)),!1))})}function handleAssessmentSubmitOrSectionMove(e){0!==$(document).find("[data-unsaved-answer-or-grading=true]").length?setTimeout(handleAssessmentSubmitOrSectionMove,100,e):$.ajax({url:e.attr("href")||e.data("url"),data:{time:$("#time").val()},type:e.data("http-method"),success:function(e){if($("#confirm-single-page-assessment-submit").trigger("hide.dialog"),$("#confirm-single-page-grading-submit").trigger("hide.dialog"),e.html){if($(document).find("[data-assessment-single-page]").replaceWith(e.html),$(document).find("[data-question-text-area]").each(function(){$(this).val()===$(this).attr("placeholder")&&$(this).val("")}),!0===e.scroll_to_first_error){$(document).find(".question__errors:visible").not("[data-main-error-message]").first().parents(".question")[0].scrollIntoView()}else{var t=$(document).find("[data-assessment-single-page]");t&&t[0]&&t[0].scrollIntoView()}createSortables(),window.textValuesSinceTheirLastSave=getCurrentTextValues(),$("a[data-assessment-single-page-submit]").text($("a[data-assessment-single-page-submit]").attr("data-unclicked-text")),$("a[data-assessment-single-page-submit]").attr("data-already-clicked",!1),$(document).find("[data-assessment-sections-list]").replaceWith(e.sections_list_html),handleSectionNavigation(),window.Intellum.util.reinitialize.trigger()}else e.assessment_redirect_url?window.location.replace(e.assessment_redirect_url):window.location.reload()}})}!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t,n){var i,r,o=(n=n||de).createElement("script");if(o.text=e,t)for(i in fe)(r=t[i]||t.getAttribute&&t.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function i(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ie[re.call(e)]||"object":typeof e}function r(e){var t=!!e&&"length"in e&&e.length,n=i(e);return!ue(e)&&!ce(e)&&("array"===n||0===t||"number"==typeof t&&0_.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function i(e){return e[P]=!0,e}function r(e){var t=L.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),i=n.length;i--;)_.attrHandle[n[i]]=t}function a(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ke(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function c(e){return i(function(t){return t=+t,i(function(n,i){for(var r,o=e([],n.length,t),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))})})}function d(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function p(e){for(var t=0,n=e.length,i="";t+~]|"+te+")"+te+"*"),ue=new RegExp(te+"|>"),ce=new RegExp(re),de=new RegExp("^"+ne+"$"),fe={ID:new RegExp("^#("+ne+")"),CLASS:new RegExp("^\\.("+ne+")"),TAG:new RegExp("^("+ne+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+re),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+te+"*(even|odd|(([+-]|)(\\d*)n|)"+te+"*(?:([+-]|)"+te+"*(\\d+)|))"+te+"*\\)|)","i"),bool:new RegExp("^(?:"+ee+")$","i"),needsContext:new RegExp("^"+te+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+te+"*((?:-\\d)?\\d*)"+te+"*\\)|)(?=[^-]|$)","i")},pe=/HTML$/i,he=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=new RegExp("\\\\[\\da-fA-F]{1,6}"+te+"?|\\\\([^\\r\\n\\f])","g"),we=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},_e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Ee=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},xe=function(){D()},ke=h(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{J.apply(Y=G.call(H.childNodes),H.childNodes),Y[H.childNodes.length].nodeType}catch(b){J={apply:Y.length?function(e,t){K.apply(e,G.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}for(b in w=t.support={},x=t.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!pe.test(t||n&&n.nodeName||"HTML")},D=t.setDocument=function(e){var t,n,i=e?e.ownerDocument||e:H;return i!=L&&9===i.nodeType&&i.documentElement&&(N=(L=i).documentElement,q=!x(L),H!=L&&(n=L.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",xe,!1):n.attachEvent&&n.attachEvent("onunload",xe)),w.scope=r(function(e){return N.appendChild(e).appendChild(L.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),w.attributes=r(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=r(function(e){return e.appendChild(L.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=ge.test(L.getElementsByClassName),w.getById=r(function(e){return N.appendChild(e).id=P,!L.getElementsByName||!L.getElementsByName(P).length}),w.getById?(_.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}},_.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&q){var n=t.getElementById(e);return n?[n]:[]}}):(_.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},_.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&q){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),_.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},_.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&q)return t.getElementsByClassName(e)},j=[],M=[],(w.qsa=ge.test(L.querySelectorAll))&&(r(function(e){var t;N.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+te+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+te+"*(?:value|"+ee+")"),e.querySelectorAll("[id~="+P+"-]").length||M.push("~="),(t=L.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||M.push("\\["+te+"*name"+te+"*="+te+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+P+"+*").length||M.push(".#.+[+~]"),e.querySelectorAll("\\\f"),M.push("[\\r\\n\\f]")}),r(function(e){e.innerHTML="";var t=L.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+te+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&M.push(":enabled",":disabled"),N.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(w.matchesSelector=ge.test(O=N.matches||N.webkitMatchesSelector||N.mozMatchesSelector||N.oMatchesSelector||N.msMatchesSelector))&&r(function(e){w.disconnectedMatch=O.call(e,"*"),O.call(e,"[s!='']:x"),j.push("!=",re)}),M=M.length&&new RegExp(M.join("|")),j=j.length&&new RegExp(j.join("|")),t=ge.test(N.compareDocumentPosition),R=t||ge.test(N.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},X=t?function(e,t){if(e===t)return T=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!w.sortDetached&&t.compareDocumentPosition(e)===n?e==L||e.ownerDocument==H&&R(H,e)?-1:t==L||t.ownerDocument==H&&R(H,t)?1:C?Z(C,e)-Z(C,t):0:4&n?-1:1)}:function(e,t){if(e===t)return T=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,s=[e],l=[t];if(!r||!o)return e==L?-1:t==L?1:r?-1:o?1:C?Z(C,e)-Z(C,t):0;if(r===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[i]===l[i];)i++;return i?a(s[i],l[i]):s[i]==H?-1:l[i]==H?1:0}),L},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if(D(e),w.matchesSelector&&q&&!U[n+" "]&&(!j||!j.test(n))&&(!M||!M.test(n)))try{var i=O.call(e,n);if(i||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){U(n,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])), e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ce.test(n)&&(t=k(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+te+")"+e+"("+te+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,i){return function(r){var o=t.attr(r,e);return null==o?"!="===n:!n||(o+="","="===n?o===i:"!="===n?o!==i:"^="===n?i&&0===o.indexOf(i):"*="===n?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;he.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?he.find.matchesSelector(i,e)?[i]:[]:he.find.matches(e,he.grep(t,function(e){return 1===e.nodeType}))},he.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(he(e).filter(function(){for(t=0;t)[^>]*|#([\w-]+))$/;(he.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||we,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:_e.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof he?t[0]:t,he.merge(this,he.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:de,!0)),be.test(i[1])&&he.isPlainObject(t))for(i in t)ue(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=de.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ue(e)?void 0!==n.ready?n.ready(e):e(he):he.makeArray(e,this)}).prototype=he.fn,we=he(de);var Ee=/^(?:parents|prev(?:Until|All))/,xe={children:!0,contents:!0,next:!0,prev:!0};he.fn.extend({has:function(e){var t=he(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Qe=/^$|^module$|\/(?:java|ecma)script/i;ze=de.createDocumentFragment().appendChild(de.createElement("div")),(We=de.createElement("input")).setAttribute("type","radio"),We.setAttribute("checked","checked"),We.setAttribute("name","t"),ze.appendChild(We),le.checkClone=ze.cloneNode(!0).cloneNode(!0).lastChild.checked,ze.innerHTML="",le.noCloneChecked=!!ze.cloneNode(!0).lastChild.defaultValue,ze.innerHTML="",le.option=!!ze.lastChild;var Ye={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Ye.tbody=Ye.tfoot=Ye.colgroup=Ye.caption=Ye.thead,Ye.th=Ye.td,le.option||(Ye.optgroup=Ye.option=[1,""]);var Ve=/<|&#?\w+;/,Ke=/^([^.]*)(?:\.(.+)|)/;he.event={global:{},add:function(e,t,n,i,r){var o,a,s,l,u,c,d,f,p,h,m,g=Le.get(e);if(De(e))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&he.find.matchesSelector(Pe,r),n.guid||(n.guid=he.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==he&&he.event.triggered!==t.type?he.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(ke)||[""]).length;u--;)p=m=(s=Ke.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(d=he.event.special[p]||{},p=(r?d.delegateType:d.bindType)||p,d=he.event.special[p]||{},c=he.extend({type:p,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&he.expr.match.needsContext.test(r),namespace:h.join(".")},o),(f=l[p])||((f=l[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,i,h,a)||e.addEventListener&&e.addEventListener(p,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,c):f.push(c),he.event.global[p]=!0)},remove:function(e,t,n,i,r){var o,a,s,l,u,c,d,f,p,h,m,g=Le.hasData(e)&&Le.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(ke)||[""]).length;u--;)if(p=m=(s=Ke.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),p){for(d=he.event.special[p]||{},f=l[p=(i?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)c=f[o],!r&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));a&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,h,g.handle)||he.removeEvent(e,p,g.handle),delete l[p])}else for(p in l)he.event.remove(e,p+t[u],n,i,!0);he.isEmptyObject(l)&&Le.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,a,s=new Array(arguments.length),l=he.event.fix(e),u=(Le.get(this,"events")||Object.create(null))[l.type]||[],c=he.event.special[l.type]||{};for(s[0]=l,t=1;t\s*$/g;he.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var i,r,o,a,s,l,u,c=e.cloneNode(!0),d=He(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||he.isXMLDoc(e)))for(a=y(c),i=0,r=(o=y(e)).length;i").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),de.head.appendChild(t[0])},abort:function(){n&&n()}}});var zt,Wt=[],Ut=/(=)\?(?=&|$)|\?\?/;he.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Wt.pop()||he.expando+"_"+At.guid++;return this[e]=!0,e}}),he.ajaxPrefilter("json jsonp",function(t,n,i){var r,o,a,s=!1!==t.jsonp&&(Ut.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=ue(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Ut,"$1"+r):!1!==t.jsonp&&(t.url+=(It.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return a||he.error(r+" was not called"),a[0]},t.dataTypes[0]="json",o=e[r],e[r]=function(){a=arguments},i.always(function(){void 0===o?he(e).removeProp(r):e[r]=o,t[r]&&(t.jsonpCallback=n.jsonpCallback,Wt.push(r)),a&&ue(o)&&o(a[0]),a=o=void 0}),"script"}),le.createHTMLDocument=((zt=de.implementation.createHTMLDocument("").body).innerHTML="
",2===zt.childNodes.length),he.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((i=(t=de.implementation.createHTMLDocument("")).createElement("base")).href=de.location.href,t.head.appendChild(i)):t=de),o=!n&&[],(r=be.exec(e))?[t.createElement(r[1])]:(r=w([e],t,o),o&&o.length&&he(o).remove(),he.merge([],r.childNodes)));var i,r,o},he.fn.load=function(e,t,n){var i,r,o,a=this,s=e.indexOf(" ");return-1").append(he.parseHTML(e)).find(i):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},he.expr.pseudos.animated=function(e){return he.grep(he.timers,function(t){return e===t.elem}).length},he.offset={setOffset:function(e,t,n){var i,r,o,a,s,l,u=he.css(e,"position"),c=he(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=he.css(e,"top"),l=he.css(e,"left"),("absolute"===u||"fixed"===u)&&-1<(o+l).indexOf("auto")?(a=(i=c.position()).top,r=i.left):(a=parseFloat(o)||0,r=parseFloat(l)||0),ue(t)&&(t=t.call(e,n,he.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+r),"using"in t?t.using.call(e,d):c.css(d)}},he.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){he.offset.setOffset(this,e,t)});var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],r={top:0,left:0};if("fixed"===he.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===he.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((r=he(e).offset()).top+=he.css(e,"borderTopWidth",!0),r.left+=he.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-he.css(i,"marginTop",!0),left:t.left-r.left-he.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===he.css(e,"position");)e=e.offsetParent;return e||Pe})}}),he.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;he.fn[e]=function(i){return Se(this,function(e,i,r){var o;if(ce(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===r)return o?o[t]:e[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):e[i]=r},e,i,arguments.length)}}),he.each(["top","left"],function(e,t){he.cssHooks[t]=q(le.pixelPosition,function(e,n){if(n)return n=N(e,t),et.test(n)?he(e).position()[t]+"px":n})}),he.each({Height:"height",Width:"width"},function(e,t){he.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,i){he.fn[i]=function(r,o){var a=arguments.length&&(n||"boolean"!=typeof r),s=n||(!0===r||!0===o?"margin":"border");return Se(this,function(t,n,r){var o;return ce(t)?0===i.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===r?he.css(t,n,s):he.style(t,n,r,s)},t,a?r:void 0,a)}})}),he.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){he.fn[t]=function(e){return this.on(t,e)}}),he.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),he.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){he.fn[t]=function(e,n){return 0").attr("src",t.preloadImages[n])}),this.each(function(){e(this).bind("submit",function(){var n="";for(i=0;i<32;i++)n+=Math.floor(16*Math.random()).toString(16);if(t.uuid=n,t.start(),old_id=/X-Progress-ID=([^&]+)/.exec(e(this).attr("action"))){var r=e(this).attr("action").replace(old_id[1],n);e(this).attr("action",r)}else{var r=jQuery(this).attr("action"),o=-1!=r.lastIndexOf("?")?"&":"?";e(this).attr("action",r+o+"X-Progress-ID="+n)}var a=jQuery.uploadProgress;t.timer=window.setInterval(function(){a(this,t)},t.interval)})})},jQuery.uploadProgress=function(t,n){jQuery.ajax({type:"GET",url:n.progressUrl+"?X-Progress-ID="+n.uuid,dataType:n.dataType,success:function(t){if(t){switch(t.state){case"uploading":t.percents=Math.floor(t.received/t.size*1e3)/10;e(n.progressBar).css({width:t.percents+"%"}),n.uploading(t);break;case"done":n.success(t);case"error":window.clearTimeout(n.timer),n.complete(t)}"error"==t.state&&n.error(t)}else n.success(t)}})}}(jQuery),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){var t=0,n=Array.prototype.slice;e.cleanData=function(t){return function(n){var i,r,o;for(o=0;null!=(r=n[o]);o++)try{i=e._data(r,"events"),i&&i.remove&&e(r).triggerHandler("remove")}catch(e){}t(n)}}(e.cleanData),e.widget=function(t,n,i){var r,o,a,s,l={},u=t.split(".")[0];return t=t.split(".")[1],r=u+"-"+t,i||(i=n,n=e.Widget),e.expr[":"][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[u]=e[u]||{},o=e[u][t],a=e[u][t]=function(e,t){if(!this._createWidget)return new a(e,t);arguments.length&&this._createWidget(e,t)},e.extend(a,o,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),s=new n,s.options=e.widget.extend({},s.options),e.each(i,function(t,i){if(!e.isFunction(i))return void(l[t]=i);l[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t,n=this._super,o=this._superApply;return this._super=e,this._superApply=r,t=i.apply(this,arguments),this._super=n,this._superApply=o,t}}()}),a.prototype=e.widget.extend(s,{widgetEventPrefix:o?s.widgetEventPrefix||t:t},l,{constructor:a,namespace:u,widgetName:t,widgetFullName:r}), o?(e.each(o._childConstructors,function(t,n){var i=n.prototype;e.widget(i.namespace+"."+i.widgetName,a,n._proto)}),delete o._childConstructors):n._childConstructors.push(a),e.widget.bridge(t,a),a},e.widget.extend=function(t){for(var i,r,o=n.call(arguments,1),a=0,s=o.length;a",options:{disabled:!1,create:null},_createWidget:function(n,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var i,r,o,a=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(a={},i=t.split("."),t=i.shift(),i.length){for(r=a[t]=e.widget.extend({},this.options[t]),o=0;o'),i.attr("accept-charset",n.formAcceptCharset),o=/\?/.test(n.url)?"&":"?","DELETE"===n.type?(n.url=n.url+o+"_method=DELETE",n.type="POST"):"PUT"===n.type?(n.url=n.url+o+"_method=PUT",n.type="POST"):"PATCH"===n.type&&(n.url=n.url+o+"_method=PATCH",n.type="POST"),t+=1,r=e('').bind("load",function(){var t,o=e.isArray(n.paramName)?n.paramName:[n.paramName];r.unbind("load").bind("load",function(){var t;try{if(t=r.contents(),!t.length||!t[0].firstChild)throw new Error}catch(e){t=undefined}l(200,"success",{iframe:t}),e('').appendTo(i),window.setTimeout(function(){i.remove()},0)}),i.prop("target",r.prop("name")).prop("action",n.url).prop("method",n.type),n.formData&&e.each(n.formData,function(t,n){e('').prop("name",n.name).val(n.value).appendTo(i)}),n.fileInput&&n.fileInput.length&&"POST"===n.type&&(t=n.fileInput.clone(),n.fileInput.after(function(e){return t[e]}),n.paramName&&n.fileInput.each(function(t){e(this).prop("name",o[t]||n.paramName)}),i.append(n.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),n.fileInput.removeAttr("form")),i.submit(),t&&t.length&&n.fileInput.each(function(n,i){var r=e(t[n]);e(i).prop("name",r.prop("name")).attr("form",r.attr("form")),r.replaceWith(i)})}),i.append(r).appendTo(document.body)},abort:function(){r&&r.unbind("load").prop("src",a),i&&i.remove()}}}}),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&e.parseJSON(e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var n=t&&t[0];return n&&e.isXMLDoc(n)?n:e.parseXML(n.XMLDocument&&n.XMLDocument.xml||e(n.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery.ui.widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}(function(e){"use strict";function t(t){var n="dragover"===t;return function(i){i.dataTransfer=i.originalEvent&&i.originalEvent.dataTransfer;var r=i.dataTransfer;r&&-1!==e.inArray("Files",r.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:i}))&&(i.preventDefault(),n&&(r.dropEffect="copy"))}}e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:undefined,fileInput:undefined,replaceFileInput:!0,paramName:undefined,singleFileUploads:!0,limitMultiFileUploads:undefined,limitMultiFileUploadSize:undefined,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:undefined,forceIframeTransport:!1,redirect:undefined,redirectParamName:undefined,postMessage:undefined,multipart:!0,maxChunkSize:undefined,uploadedBytes:undefined,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,n){return t=this.messages[t]||t.toString(),n&&e.each(n,function(e,n){t=t.replace("{"+e+"}",n)}),t},formData:function(e){return e.serializeArray()},add:function(t,n){if(t.isDefaultPrevented())return!1;(n.autoUpload||!1!==n.autoUpload&&e(this).fileupload("option","autoUpload"))&&n.process().done(function(){n.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,n){var i=e-this.timestamp;return(!this.bitrate||!n||i>n)&&(this.bitrate=(t-this.loaded)*(1e3/i)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var n;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(n=[],e.each(t.formData,function(e,t){n.push({name:e,value:t})}),n):[]},_getTotal:function(t){var n=0;return e.each(t,function(e,t){n+=t.size||1}),n},_initProgressObject:function(t){var n={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,n):t._progress=n},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)e._response.hasOwnProperty(t)&&delete e._response[t];else e._response={}},_onProgress:function(t,n){if(t.lengthComputable){var i,r=Date.now?Date.now():(new Date).getTime();if(n._time&&n.progressInterval&&r-n._time").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&n&&n!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var n=e(t.fileInput),i=t.paramName;return i?e.isArray(i)||(i=[i]):(i=[],n.each(function(){for(var t=e(this),n=t.prop("name")||"files[]",r=(t.prop("files")||[1]).length;r;)i.push(n),r-=1}),i.length||(i=[n.prop("name")||"files[]"])),i},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var n=e.extend({},this.options,t);return this._initFormSettings(n),this._initDataSettings(n),n},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,n,i){var r=e.Deferred(),o=r.promise();return n=n||this.options.context||o,!0===t?r.resolveWith(n,i):!1===t&&r.rejectWith(n,i),o.abort=r.promise,this._enhancePromise(o)},_addConvenienceMethods:function(t,n){var i=this,r=function(t){return e.Deferred().resolveWith(i,t).promise()};n.process=function(t,o){return(t||o)&&(n._processQueue=this._processQueue=(this._processQueue||r([this])).then(function(){return n.errorThrown?e.Deferred().rejectWith(i,[n]).promise():r(arguments)}).then(t,o)),this._processQueue||r([this])},n.submit=function(){return"pending"!==this.state()&&(n.jqXHR=this.jqXHR=!1!==i._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&i._onSend(t,this)),this.jqXHR||i._getXHRPromise()},n.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",i._trigger("fail",null,this),i._getXHRPromise(!1))},n.state=function(){return this.jqXHR?i._getDeferredState(this.jqXHR):this._processQueue?i._getDeferredState(this._processQueue):void 0},n.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===i._getDeferredState(this._processQueue)},n.progress=function(){return this._progress},n.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),n=t&&t.split("-"),i=n&&n.length>1&&parseInt(n[1],10);return i&&i+1},_chunkedUpload:function(t,n){t.uploadedBytes=t.uploadedBytes||0;var i,r,o=this,a=t.files[0],s=a.size,l=t.uploadedBytes,u=t.maxChunkSize||s,c=this._blobSlice,d=e.Deferred(),f=d.promise();return!(!(this._isXHRUpload(t)&&c&&(l||u=s?(a.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",a.error])):(r=function(){var n=e.extend({},t),f=n._progress.loaded;n.blob=c.call(a,l,l+u,a.type),n.chunkSize=n.blob.size,n.contentRange="bytes "+l+"-"+(l+n.chunkSize-1)+"/"+s,o._initXHRData(n),o._initProgressListener(n),i=(!1!==o._trigger("chunksend",null,n)&&e.ajax(n)||o._getXHRPromise(!1,n.context)).done(function(i,a,u){l=o._getUploadedBytes(u)||l+n.chunkSize,f+n.chunkSize-n._progress.loaded&&o._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-n.uploadedBytes,total:l-n.uploadedBytes}),n),t.uploadedBytes=n.uploadedBytes=l,n.result=i,n.textStatus=a,n.jqXHR=u,o._trigger("chunkdone",null,n),o._trigger("chunkalways",null,n),ls._sending)for(var i=s._slots.shift();i;){if("pending"===s._getDeferredState(i)){i.resolve();break}i=s._slots.shift()}0===s._active&&s._trigger("stop")})};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(o=e.Deferred(),this._slots.push(o),a=o.then(u)):(this._sequence=this._sequence.then(u,u),a=this._sequence),a.abort=function(){return r=[undefined,"abort","abort"],i?i.abort():(o&&o.rejectWith(l.context,r),u())},this._enhancePromise(a)):u()},_onAdd:function(t,n){var i,r,o,a,s=this,l=!0,u=e.extend({},this.options,n),c=n.files,d=c.length,f=u.limitMultiFileUploads,p=u.limitMultiFileUploadSize,h=u.limitMultiFileUploadSizeOverhead,m=0,g=this._getParamName(u),v=0;if(!d)return!1;if(p&&c[0].size===undefined&&(p=undefined),(u.singleFileUploads||f||p)&&this._isXHRUpload(u))if(u.singleFileUploads||p||!f)if(!u.singleFileUploads&&p)for(o=[],i=[],a=0;ap||f&&a+1-v>=f)&&(o.push(c.slice(v,a+1)),r=g.slice(v,a+1),r.length||(r=g),i.push(r),v=a+1,m=0);else i=g;else for(o=[],i=[],a=0;a").append(i)[0].reset(),n.after(i).detach(),r&&i.focus(),e.cleanData(n.unbind("remove")),this.options.fileInput=this.options.fileInput.map(function(e,t){return t===n[0]?i[0]:t}),n[0]===this.element[0]&&(this.element=i)},_handleFileTreeEntry:function(t,n){var i,r=this,o=e.Deferred(),a=function(e){e&&!e.entry&&(e.entry=t),o.resolve([e])},s=function(e){r._handleFileTreeEntries(e,n+t.name+"/").done(function(e){o.resolve(e)}).fail(a)},l=function(){i.readEntries(function(e){e.length?(u=u.concat(e),l()):s(u)},a)},u=[];return n=n||"",t.isFile?t._file?(t._file.relativePath=n,o.resolve(t._file)):t.file(function(e){e.relativePath=n,o.resolve(e)},a):t.isDirectory?(i=t.createReader(),l()):o.resolve([]),o.promise()},_handleFileTreeEntries:function(t,n){var i=this;return e.when.apply(e,e.map(t,function(e){return i._handleFileTreeEntry(e,n)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(t){t=t||{};var n=t.items;return n&&n.length&&(n[0].webkitGetAsEntry||n[0].getAsEntry)?this._handleFileTreeEntries(e.map(n,function(e){var t;return e.webkitGetAsEntry?(t=e.webkitGetAsEntry(),t&&(t._file=e.getAsFile()),t):e.getAsEntry()})):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){t=e(t);var n,i,r=t.prop("webkitEntries")||t.prop("entries");if(r&&r.length)return this._handleFileTreeEntries(r);if(n=e.makeArray(t.prop("files")),n.length)n[0].name===undefined&&n[0].fileName&&e.each(n,function(e,t){t.name=t.fileName,t.size=t.fileSize});else{if(!(i=t.prop("value")))return e.Deferred().resolve([]).promise();n=[{name:i.replace(/^.*\\/,"")}]}return e.Deferred().resolve(n).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(t)},_onChange:function(t){var n=this,i={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(i.fileInput).always(function(r){i.files=r,n.options.replaceFileInput&&n._replaceFileInput(i),!1!==n._trigger("change",e.Event("change",{delegatedEvent:t}),i)&&n._onAdd(t,i)})},_onPaste:function(t){var n=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,i={files:[]};n&&n.length&&(e.each(n,function(e,t){var n=t.getAsFile&&t.getAsFile();n&&i.files.push(n)}),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),i)&&this._onAdd(t,i))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var n=this,i=t.dataTransfer,r={};i&&i.files&&i.files.length&&(t.preventDefault(),this._getDroppedFiles(i).always(function(i){r.files=i,!1!==n._trigger("drop",e.Event("drop",{delegatedEvent:t}),r)&&n._onAdd(t,r)}))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_setOption:function(t,n){var i=-1!==e.inArray(t,this._specialOptions);i&&this._destroyEventHandlers(),this._super(t,n),i&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;t.fileInput===undefined?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),n=t.pop();return t.shift(),new RegExp(t.join("/"),n)},_isRegExpOption:function(t,n){return"url"!==t&&"string"===e.type(n)&&/^\/.*\/[igm]{0,3}$/.test(n)},_initDataAttributes:function(){var t=this,n=this.options,i=this.element.data();e.each(this.element[0].attributes,function(e,r){var o,a=r.name.toLowerCase();/^data-/.test(a)&&(a=a.slice(5).replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()}),o=i[a],t._isRegExpOption(a,o)&&(o=t._getRegExp(o)),n[a]=o)})},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var n=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always(function(e){t.files=e,n._onAdd(null,t)}):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var n,i,r=this,o=e.Deferred(),a=o.promise();return a.abort=function(){return i=!0,n?n.abort():(o.reject(null,"abort","abort"),a)},this._getFileInputFiles(t.fileInput).always(function(e){if(!i){if(!e.length)return void o.reject();t.files=e,n=r._onSend(null,t),n.then(function(e,t,n){o.resolve(e,t,n)},function(e,t,n){o.reject(e,t,n)})}}),this._enhancePromise(a)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})}),function(e,t){e.rails!==t&&e.error("jquery-ujs has already been loaded!");var n,i=e(document);e.rails=n={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not(form button), button[data-confirm]:not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input[type=file]",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",CSRFProtection:function(t){var n=e('meta[name="csrf-token"]').attr("content");n&&t.setRequestHeader("X-CSRF-Token",n)},refreshCSRFTokens:function(){var t=e("meta[name=csrf-token]").attr("content"),n=e("meta[name=csrf-param]").attr("content");e('form input[name="'+n+'"]').val(t)},fire:function(t,n,i){var r=e.Event(n);return t.trigger(r,i),!1!==r.result},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e.attr("href")},handleRemote:function(i){var r,o,a,s,l,u,c,d;if(n.fire(i,"ajax:before")){if(s=i.data("cross-domain"),l=s===t?null:s,u=i.data("with-credentials")||null,c=i.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType,i.is("form")){r=i.attr("method"),o=i.attr("action"),a=i.serializeArray();var f=i.data("ujs:submit-button");f&&(a.push(f),i.data("ujs:submit-button",null))}else i.is(n.inputChangeSelector)?(r=i.data("method"),o=i.data("url"),a=i.serialize(),i.data("params")&&(a=a+"&"+i.data("params"))):i.is(n.buttonClickSelector)?(r=i.data("method")||"get",o=i.data("url"),a=i.serialize(),i.data("params")&&(a=a+"&"+i.data("params"))):(r=i.data("method"),o=n.href(i),a=i.data("params")||null);return d={type:r||"GET",data:a,dataType:c,beforeSend:function(e,r){if(r.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+r.accepts.script),!n.fire(i,"ajax:beforeSend",[e,r]))return!1;i.trigger("ajax:send",e)},success:function(e,t,n){i.trigger("ajax:success",[e,t,n])},complete:function(e,t){i.trigger("ajax:complete",[e,t])},error:function(e,t,n){i.trigger("ajax:error",[e,t,n])},crossDomain:l},u&&(d.xhrFields={withCredentials:u}),o&&(d.url=o),n.ajax(d)}return!1},handleMethod:function(i){var r=n.href(i),o=i.data("method"),a=i.attr("target"),s=e("meta[name=csrf-token]").attr("content"),l=e("meta[name=csrf-param]").attr("content"),u=e('
'),c='';l!==t&&s!==t&&(c+=''),a&&u.attr("target",a),u.hide().append(c).appendTo("body"),u.submit()},formElements:function(t,n){return t.is("form")?e(t[0].elements).filter(n):t.find(n)},disableFormElements:function(t){n.formElements(t,n.disableSelector).each(function(){n.disableFormElement(e(this))})},disableFormElement:function(e){var n,i;n=e.is("button")?"html":"val",i=e.data("disable-with"),e.data("ujs:enable-with",e[n]()),i!==t&&e[n](i),e.prop("disabled",!0)},enableFormElements:function(t){n.formElements(t,n.enableSelector).each(function(){n.enableFormElement(e(this))})},enableFormElement:function(e){var t=e.is("button")?"html":"val";e.data("ujs:enable-with")&&e[t](e.data("ujs:enable-with")),e.prop("disabled",!1)},allowAction:function(e){var t,i=e.data("confirm"),r=!1;return!i||(n.fire(e,"confirm")&&(r=n.confirm(i),t=n.fire(e,"confirm:complete",[r])),r&&t)},blankInputs:function(t,n,i){var r,o,a=e(),s=n||"input,textarea",l=t.find(s);return l.each(function(){if(r=e(this),!(o=r.is("input[type=checkbox],input[type=radio]")?r.is(":checked"):r.val())==!i){if(r.is("input[type=radio]")&&l.filter('input[type=radio]:checked[name="'+r.attr("name")+'"]').length)return!0;a=a.add(r)}}),!!a.length&&a},nonBlankInputs:function(e,t){return n.blankInputs(e,t,!0)},stopEverything:function(t){return e(t.target).trigger("ujs:everythingStopped"),t.stopImmediatePropagation(),!1},disableElement:function(e){var i=e.data("disable-with");e.data("ujs:enable-with",e.html()),i!==t&&e.html(i),e.bind("click.railsDisable",function(e){return n.stopEverything(e)})},enableElement:function(e){e.data("ujs:enable-with")!==t&&(e.html(e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.unbind("click.railsDisable")}},n.fire(i,"rails:attachBindings")&&(e.ajaxPrefilter(function(e,t,i){e.crossDomain||n.CSRFProtection(i)}),e(window).on("pageshow.rails",function(){e(e.rails.enableSelector).each(function(){var t=e(this);t.data("ujs:enable-with")&&e.rails.enableFormElement(t)}),e(e.rails.linkDisableSelector).each(function(){var t=e(this);t.data("ujs:enable-with")&&e.rails.enableElement(t)})}),i.delegate(n.linkDisableSelector,"ajax:complete",function(){n.enableElement(e(this))}),i.delegate(n.buttonDisableSelector,"ajax:complete",function(){n.enableFormElement(e(this))}),i.delegate(n.linkClickSelector,"click.rails",function(i){var r=e(this),o=r.data("method"),a=r.data("params"),s=i.metaKey||i.ctrlKey;if(!n.allowAction(r))return n.stopEverything(i);if(!s&&r.is(n.linkDisableSelector)&&n.disableElement(r),r.data("remote")!==t){if(s&&(!o||"GET"===o)&&!a)return!0;var l=n.handleRemote(r);return!1===l?n.enableElement(r):l.fail(function(){n.enableElement(r)}),!1}return o?(n.handleMethod(r),!1):void 0}),i.delegate(n.buttonClickSelector,"click.rails",function(t){var i=e(this);if(!n.allowAction(i))return n.stopEverything(t);i.is(n.buttonDisableSelector)&&n.disableFormElement(i);var r=n.handleRemote(i);return!1===r?n.enableFormElement(i):r.fail(function(){n.enableFormElement(i)}),!1}),i.delegate(n.inputChangeSelector,"change.rails",function(t){var i=e(this);return n.allowAction(i)?(n.handleRemote(i),!1):n.stopEverything(t)}),i.delegate(n.formSubmitSelector,"submit.rails",function(i){var r,o,a=e(this),s=a.data("remote")!==t;if(!n.allowAction(a))return n.stopEverything(i);if(a.attr("novalidate")==t&&(r=n.blankInputs(a,n.requiredInputSelector))&&n.fire(a,"ajax:aborted:required",[r]))return n.stopEverything(i);if(s){if(o=n.nonBlankInputs(a,n.fileInputSelector)){setTimeout(function(){n.disableFormElements(a)},13);var l=n.fire(a,"ajax:aborted:file",[o]);return l||setTimeout(function(){n.enableFormElements(a)},13),l}return n.handleRemote(a),!1}setTimeout(function(){n.disableFormElements(a)},13)}), i.delegate(n.formInputClickSelector,"click.rails",function(t){var i=e(this);if(!n.allowAction(i))return n.stopEverything(t);var r=i.attr("name"),o=r?{name:r,value:i.val()}:null;i.closest("form").data("ujs:submit-button",o)}),i.delegate(n.formSubmitSelector,"ajax:send.rails",function(t){this==t.target&&n.disableFormElements(e(this))}),i.delegate(n.formSubmitSelector,"ajax:complete.rails",function(t){this==t.target&&n.enableFormElements(e(this))}),e(function(){n.refreshCSRFTokens()}))}(jQuery),function(e){"use strict";"function"==typeof define&&define.amd?define(e):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=e():window.Sortable=e()}(function(){"use strict";function e(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(e);this.el=e,this.options=t=b({},t),e[U]=this;var n={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(e.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0}};for(var i in n)!(i in t)&&(t[i]=n[i]);ae(t);for(var r in this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!t.forceFallback&&G,o(e,"mousedown",this._onTapStart),o(e,"touchstart",this._onTapStart),o(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(o(e,"dragover",this),o(e,"dragenter",this)),re.push(this._onDragOver),t.store&&this.sort(t.store.get(this))}function t(e,t){"clone"!==e.lastPullMode&&(t=!0),A&&A.state!==t&&(l(A,"display",t?"none":""),t||A.state&&(e.options.group.revertClone?(I.insertBefore(A,S),e._animate(E,A)):I.insertBefore(A,E)),A.state=t)}function n(e,t,n){if(e){n=n||Q;do{if(">*"===t&&e.parentNode===n||v(e,t))return e}while(e=i(e))}return null}function i(e){var t=e.host;return t&&t.nodeType?t:e.parentNode}function r(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.preventDefault()}function o(e,t,n){e.addEventListener(t,n,J)}function a(e,t,n){e.removeEventListener(t,n,J)}function s(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(z," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(z," ")}}function l(e,t,n){var i=e&&e.style;if(i){if(void 0===n)return Q.defaultView&&Q.defaultView.getComputedStyle?n=Q.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in i||(t="-webkit-"+t),i[t]=n+("string"==typeof n?"":"px")}}function u(e,t,n){if(e){var i=e.getElementsByTagName(t),r=0,o=i.length;if(n)for(;r5||t.clientX-(i.left+i.width)>5}function m(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,i=0;n--;)i+=t.charCodeAt(n);return i.toString(36)}function g(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e&&(e=e.previousElementSibling);)"TEMPLATE"===e.nodeName.toUpperCase()||">*"!==t&&!v(e,t)||n++;return n}function v(e,t){if(e){t=t.split(".");var n=t.shift().toUpperCase(),i=new RegExp("\\s("+t.join("|")+")(?=\\s)","g");return!(""!==n&&e.nodeName.toUpperCase()!=n||t.length&&((" "+e.className+" ").match(i)||[]).length!=t.length)}return!1}function y(e,t){var n,i;return function(){void 0===n&&(n=arguments,i=this,setTimeout(function(){1===n.length?e.call(i,n[0]):e.apply(i,n),n=void 0},t))}}function b(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function w(e){return V?V(e).clone(!0)[0]:K&&K.dom?K.dom(e).cloneNode(!0):e.cloneNode(!0)}function _(e){for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var i=t[n];i.checked&&ie.push(i)}}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var E,x,k,A,I,S,C,T,D,L,N,q,M,j,O,R,P,H,F,B,$={},z=/\s+/g,W=/left|right|inline/,U="Sortable"+(new Date).getTime(),X=window,Q=X.document,Y=X.parseInt,V=X.jQuery||X.Zepto,K=X.Polymer,J=!1,G=!!("draggable"in Q.createElement("div")),Z=function(e){return!navigator.userAgent.match(/Trident.*rv[ :]?11\./)&&(e=Q.createElement("x"),e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents)}(),ee=!1,te=Math.abs,ne=Math.min,ie=[],re=[],oe=y(function(e,t,n){if(n&&t.scroll){var i,r,o,a,s,l,u=n[U],c=t.scrollSensitivity,d=t.scrollSpeed,f=e.clientX,p=e.clientY,h=window.innerWidth,m=window.innerHeight;if(D!==n&&(T=t.scroll,D=n,L=t.scrollFn,!0===T)){T=n;do{if(T.offsetWidth-1:r==e)}}var n={},i=e.group;i&&"object"==typeof i||(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n};e.prototype={constructor:e,_onTapStart:function(e){var t,i=this,r=this.el,o=this.options,a=o.preventOnFilter,s=e.type,l=e.touches&&e.touches[0],u=(l||e).target,d=e.target.shadowRoot&&e.path&&e.path[0]||u,f=o.filter;if(_(r),!E&&!(/mousedown|pointerdown/.test(s)&&0!==e.button||o.disabled)&&(u=n(u,o.draggable,r))&&C!==u){if(t=g(u,o.draggable),"function"==typeof f){if(f.call(this,e,u,this))return c(i,d,"filter",u,r,r,t),void(a&&e.preventDefault())}else if(f&&(f=f.split(",").some(function(e){if(e=n(d,e.trim(),r))return c(i,e,"filter",u,r,r,t),!0})))return void(a&&e.preventDefault());o.handle&&!n(d,o.handle,r)||this._prepareDragStart(e,l,u,t)}},_prepareDragStart:function(e,t,n,i){var r,a=this,l=a.el,d=a.options,p=l.ownerDocument;n&&!E&&n.parentNode===l&&(H=e,I=l,E=n,x=E.parentNode,S=E.nextSibling,C=n,R=d.group,j=i,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,E.style["will-change"]="transform",r=function(){a._disableDelayedDrag(),E.draggable=a.nativeDraggable,s(E,d.chosenClass,!0),a._triggerDragStart(e,t),c(a,I,"choose",E,I,I,j)},d.ignore.split(",").forEach(function(e){u(E,e.trim(),f)}),o(p,"mouseup",a._onDrop),o(p,"touchend",a._onDrop),o(p,"touchcancel",a._onDrop),o(p,"pointercancel",a._onDrop),o(p,"selectstart",a),d.delay?(o(p,"mouseup",a._disableDelayedDrag),o(p,"touchend",a._disableDelayedDrag),o(p,"touchcancel",a._disableDelayedDrag),o(p,"mousemove",a._disableDelayedDrag),o(p,"touchmove",a._disableDelayedDrag),o(p,"pointermove",a._disableDelayedDrag),a._dragStartTimer=setTimeout(r,d.delay)):r())},_disableDelayedDrag:function(){var e=this.el.ownerDocument;clearTimeout(this._dragStartTimer),a(e,"mouseup",this._disableDelayedDrag),a(e,"touchend",this._disableDelayedDrag),a(e,"touchcancel",this._disableDelayedDrag),a(e,"mousemove",this._disableDelayedDrag),a(e,"touchmove",this._disableDelayedDrag),a(e,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(e,t){t=t||("touch"==e.pointerType?e:null),t?(H={target:E,clientX:t.clientX,clientY:t.clientY},this._onDragStart(H,"touch")):this.nativeDraggable?(o(E,"dragend",this),o(I,"dragstart",this._onDragStart)):this._onDragStart(H,!0);try{Q.selection?setTimeout(function(){Q.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(){if(I&&E){var t=this.options;s(E,t.ghostClass,!0),s(E,t.dragClass,!1),e.active=this,c(this,I,"start",E,I,I,j)}else this._nulling()},_emulateDragOver:function(){if(F){if(this._lastX===F.clientX&&this._lastY===F.clientY)return;this._lastX=F.clientX,this._lastY=F.clientY,Z||l(k,"display","none");var e=Q.elementFromPoint(F.clientX,F.clientY),t=e,n=re.length;if(t)do{if(t[U]){for(;n--;)re[n]({clientX:F.clientX,clientY:F.clientY,target:e,rootEl:t});break}e=t}while(t=t.parentNode);Z||l(k,"display","")}},_onTouchMove:function(t){if(H){var n=this.options,i=n.fallbackTolerance,r=n.fallbackOffset,o=t.touches?t.touches[0]:t,a=o.clientX-H.clientX+r.x,s=o.clientY-H.clientY+r.y,u=t.touches?"translate3d("+a+"px,"+s+"px,0)":"translate("+a+"px,"+s+"px)";if(!e.active){if(i&&ne(te(o.clientX-this._lastX),te(o.clientY-this._lastY))E.offsetWidth,T=r.offsetHeight>E.offsetHeight,D=(_?(i.clientX-a.left)/b:(i.clientY-a.top)/w)>.5,L=r.nextElementSibling,j=!1;if(_){var O=E.offsetTop,H=r.offsetTop;j=O===H?r.previousElementSibling===E&&!C||D&&C:r.previousElementSibling===E||E.previousElementSibling===r?(i.clientY-a.top)/w>.5:H>O}else v||(j=L!==E&&!T||D&&T);var F=d(I,u,E,o,r,a,i,j);!1!==F&&(1!==F&&-1!==F||(j=1===F),ee=!0,setTimeout(p,30),t(m,g),E.contains(u)||(j&&!L?u.appendChild(E):r.parentNode.insertBefore(E,j?L:r)),x=E.parentNode,this._animate(o,E),this._animate(a,r))}}},_animate:function(e,t){var n=this.options.animation;if(n){var i=t.getBoundingClientRect();1===e.nodeType&&(e=e.getBoundingClientRect()),l(t,"transition","none"),l(t,"transform","translate3d("+(e.left-i.left)+"px,"+(e.top-i.top)+"px,0)"),t.offsetWidth,l(t,"transition","all "+n+"ms"),l(t,"transform","translate3d(0,0,0)"),clearTimeout(t.animated),t.animated=setTimeout(function(){l(t,"transition",""),l(t,"transform",""),t.animated=!1},n)}},_offUpEvents:function(){var e=this.el.ownerDocument;a(Q,"touchmove",this._onTouchMove),a(Q,"pointermove",this._onTouchMove),a(e,"mouseup",this._onDrop),a(e,"touchend",this._onDrop),a(e,"pointerup",this._onDrop),a(e,"touchcancel",this._onDrop),a(e,"pointercancel",this._onDrop),a(e,"selectstart",this)},_onDrop:function(t){var n=this.el,i=this.options;clearInterval(this._loopId),clearInterval($.pid),clearTimeout(this._dragStartTimer),a(Q,"mousemove",this._onTouchMove),this.nativeDraggable&&(a(Q,"drop",this),a(n,"dragstart",this._onDragStart)),this._offUpEvents(),t&&(B&&(t.preventDefault(),!i.dropBubble&&t.stopPropagation()),k&&k.parentNode&&k.parentNode.removeChild(k),I!==x&&"clone"===e.active.lastPullMode||A&&A.parentNode&&A.parentNode.removeChild(A),E&&(this.nativeDraggable&&a(E,"dragend",this),f(E),E.style["will-change"]="",s(E,this.options.ghostClass,!1),s(E,this.options.chosenClass,!1),c(this,I,"unchoose",E,x,I,j),I!==x?(O=g(E,i.draggable))>=0&&(c(null,x,"add",E,x,I,j,O),c(this,I,"remove",E,x,I,j,O),c(null,x,"sort",E,x,I,j,O),c(this,I,"sort",E,x,I,j,O)):E.nextSibling!==S&&(O=g(E,i.draggable))>=0&&(c(this,I,"update",E,x,I,j,O),c(this,I,"sort",E,x,I,j,O)),e.active&&(null!=O&&-1!==O||(O=j),c(this,I,"end",E,x,I,j,O),this.save()))),this._nulling()},_nulling:function(){I=E=x=k=S=A=C=T=D=H=F=B=O=N=q=P=R=e.active=null,ie.forEach(function(e){e.checked=!0}),ie.length=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragover":case"dragenter":E&&(this._onDragOver(e),r(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],i=this.el.children,r=0,o=i.length,a=this.options;r1&&arguments[1]!==undefined?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=I(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null===e||void 0===e?void 0:e.type)?n=I(e.value,t):(n=x()(e),i("copy")),n},C=S,T=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,i=e.container,r=e.target,a=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(r!==undefined){if(!r||"object"!==o(r)||1!==r.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return a?C(a,{container:i}):r?"cut"===n?A(r):C(r,{container:i}):void 0},D=T,L=function(e){function t(e,i){var r;return s(this,t),r=n.call(this),r.resolveOptions(i),r.listenClick(e),r}c(t,e);var n=f(t);return u(t,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===a(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=_()(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",i=D({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(i?"success":"error",{action:n,text:i,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return v("action",e)}},{key:"defaultTarget",value:function(e){var t=v("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return v("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{container:document.body};return C(e,t)}},{key:"cut",value:function(e){return A(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}]),t}(b()),N=L},828:function(e){function t(e,t){for(;e&&e.nodeType!==n;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}var n=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}e.exports=t},438:function(e,t,n){function i(e,t,n,i,r){var a=o.apply(this,arguments);return e.addEventListener(n,a,r),{destroy:function(){e.removeEventListener(n,a,r)}}}function r(e,t,n,r,o){return"function"==typeof e.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return i(e,t,n,r,o)}))}function o(e,t,n,i){return function(n){n.delegateTarget=a(n.target,t),n.delegateTarget&&i.call(e,n)}}var a=n(828);e.exports=r},879:function(e,t){t.node=function(e){return e!==undefined&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return e!==undefined&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){function i(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!s.string(t))throw new TypeError("Second argument must be a String");if(!s.fn(n))throw new TypeError("Third argument must be a Function");if(s.node(e))return r(e,t,n);if(s.nodeList(e))return o(e,t,n);if(s.string(e))return a(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}function o(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}function a(e,t,n){return l(document.body,e,t,n)}var s=n(879),l=n(438);e.exports=i},817:function(e){function t(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(e),i.removeAllRanges(),i.addRange(r),t=i.toString()}return t}e.exports=t},279:function(e){function t(){}t.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){r.off(e,i),t.apply(n,arguments)}var r=this;return i._=t,this.on(e,i,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;for(i;ie._pfLastSize)&&(e._pfLastSize=e.offsetWidth,i=e.sizes,e.sizes+=",100vw",setTimeout(function(){e.sizes=i}))},r=function(){var e,t=document.querySelectorAll("picture > img, img[srcset][sizes]");for(e=0;e2.7?s=n+1:(o=t-n,r=Math.pow(e-.6,1.5),a=o*r,i&&(a+=.1*r),s=e+a):s=n>1?Math.sqrt(e*t):e,s>n}function s(e){var t,n=v.getSet(e),i=!1;"pending"!==n&&(i=g,n&&(t=v.setRes(n),v.applySetCandidate(t,e))),e[v.ns].evaled=i}function l(e,t){return e.res-t.res}function u(e,t,n){var i;return!n&&t&&(n=e[v.ns].sets,n=n&&n[n.length-1]),i=c(t,n),i&&(t=v.makeUrl(t),e[v.ns].curSrc=t,e[v.ns].curCan=i,i.res||G(i,i.set.sizes)),i}function c(e,t){var n,i,r;if(e&&t)for(r=v.parseSet(t),e=v.makeUrl(e),n=0;n=d)return p;a=n(U),s=[],","===a.slice(-1)?(a=a.replace(X,""),r()):o()}}function p(e){function t(e){function t(){o&&(a.push(o),o="")}function n(){a[0]&&(s.push(a),a=[])}for(var r,o="",a=[],s=[],l=0,u=0,c=!1;;){if(""===(r=e.charAt(u)))return t(),n(),s;if(c){if("*"===r&&"/"===e[u+1]){c=!1,u+=2,t();continue}u+=1}else{if(i(r)){if(e.charAt(u-1)&&i(e.charAt(u-1))||!o){u+=1;continue}if(0===l){t(),u+=1;continue}r=" "}else if("("===r)l+=1;else if(")"===r)l-=1;else{if(","===r){t(),n(),u+=1;continue}if("/"===r&&"*"===e.charAt(u+1)){c=!0,u+=2;continue}}o+=r,u+=1}}}function n(e){return!!(c.test(e)&&parseFloat(e)>=0)||(!!d.test(e)||("0"===e||"-0"===e||"+0"===e))}var r,o,a,s,l,u,c=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,d=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for(o=t(e),a=o.length,r=0;r35,L="currentSrc",N=/\s+\+?\d+(e\d+)?w/,q=/(\([^)]+\))?\s*(.+)/,M=e.picturefillCFG,j="font-size:100%!important;",O=!0,R={},P={},H=e.devicePixelRatio,F={px:1,"in":96},B=t.createElement("a"),$=!1,z=/^[ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/,U=/^[^ \t\n\r\u000c]+/,X=/[,]+$/,Q=/^\d+$/,Y=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,V=function(e,t,n,i){e.addEventListener?e.addEventListener(t,n,i||!1):e.attachEvent&&e.attachEvent("on"+t,n)},K=function(e){var t={};return function(n){return n in t||(t[n]=e(n)),t[n]}},J=function(){var e=/^([\d\.]+)(em|vw|px)$/,t=function(){for(var e=arguments,t=0,n=e[0];++t in e;)n=n.replace(e[t],e[++t]);return n},n=K(function(e){return"return "+t((e||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")+";"});return function(t,i){var r;if(!(t in R))if(R[t]=!1,i&&(r=t.match(e)))R[t]=r[1]*F[r[2]];else try{R[t]=new Function("e",n(t))(F)}catch(e){}return R[t]}}(),G=function(e,t){return e.w?(e.cWidth=v.calcListLength(t||"100vw"),e.res=e.w/e.cWidth):e.res=e.d,e},Z=function(e){if(y){var n,i,r,o=e||{};if(o.elements&&1===o.elements.nodeType&&("IMG"===o.elements.nodeName.toUpperCase()?o.elements=[o.elements]:(o.context=o.elements,o.elements=null)),n=o.elements||v.qsa(o.context||t,o.reevaluate||o.reselect?v.sel:v.selShort),r=n.length){for(v.setupRun(o),$=!0,i=0;iimg,img[srcset]",v.sel=v.selShort,v.cfg=I,v.DPR=H||1,v.u=F,v.types=A,v.setSize=b,v.makeUrl=K(function(e){return B.href=e,B.href}),v.qsa=function(e,t){return"querySelector"in e?e.querySelectorAll(t):[]},v.matchesMedia=function(){return e.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?v.matchesMedia=function(e){return!e||matchMedia(e).matches}:v.matchesMedia=v.mMQ,v.matchesMedia.apply(this,arguments)}, v.mMQ=function(e){return!e||J(e)},v.calcLength=function(e){var t=J(e,!0)||!1;return t<0&&(t=!1),t},v.supportsType=function(e){return!e||A[e]},v.parseSize=K(function(e){var t=(e||"").match(q);return{media:t&&t[1],length:t&&t[2]}}),v.parseSet=function(e){return e.cands||(e.cands=f(e.srcset,e)),e.cands},v.getEmValue=function(){var e;if(!h&&(e=t.body)){var n=t.createElement("div"),i=k.style.cssText,r=e.style.cssText;n.style.cssText="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",k.style.cssText=j,e.style.cssText=j,e.appendChild(n),h=n.offsetWidth,e.removeChild(n),h=parseFloat(h,10),k.style.cssText=i,e.style.cssText=r}return h||16},v.calcListLength=function(e){if(!(e in P)||I.uT){var t=v.calcLength(p(e));P[e]=t||F.width}return P[e]},v.setRes=function(e){var t;if(e){t=v.parseSet(e);for(var n=0,i=t.length;nm)||(d.cached=!0,d.res>=m&&(s=d))),!s)for(e.sort(l),o=e.length,s=e[o-1],i=0;i=m){r=i-1,s=e[r]&&(p||c!==v.makeUrl(n.url))&&a(e[r].res,n.res,m,e[r].cached)?e[r]:n;break}s&&(f=v.makeUrl(s.url),h.curSrc=f,h.curCan=s,f!==c&&v.setSrc(t,s),v.setSize(t))}},v.setSrc=function(e,t){var n;e.src=t.url,"image/svg+xml"===t.set.type&&(n=e.style.width,e.style.width=e.offsetWidth+1+"px",e.offsetWidth+1&&(e.style.width=n))},v.getSet=function(e){var t,n,i,r=!1,o=e[v.ns].sets;for(t=0;t-1},get:function(n){return t[e.indexOf(n)]},set:function(n,i){-1===e.indexOf(n)&&(e.push(n),t.push(i))},"delete":function(n){var i=e.indexOf(n);i>-1&&(e.splice(i,1),t.splice(i,1))}}}(),a=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){a=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var s=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(s=function(e){return e},s.destroy=function(e){return e},s.update=function(e){return e}):(s=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e,t)}),e},s.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},s.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e}),t.exports=s}),function(e){"object"==typeof exports&&exports&&"object"==typeof module&&module&&module.exports===exports?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){function t(e){var t=e[0];return t.offsetWidth>0&&t.offsetHeight>0}function n(t){if(t.minTime&&(t.minTime=b(t.minTime)),t.maxTime&&(t.maxTime=b(t.maxTime)),t.durationTime&&"function"!=typeof t.durationTime&&(t.durationTime=b(t.durationTime)),"now"==t.scrollDefault)t.scrollDefault=function(){return t.roundingFunction(b(new Date),t)};else if(t.scrollDefault&&"function"!=typeof t.scrollDefault){var n=t.scrollDefault;t.scrollDefault=function(){return t.roundingFunction(b(n),t)}}else t.minTime&&(t.scrollDefault=function(){return t.roundingFunction(t.minTime,t)});if("string"===e.type(t.timeFormat)&&t.timeFormat.match(/[gh]/)&&(t._twelveHourTime=!0),!1===t.showOnFocus&&-1!=t.showOn.indexOf("focus")&&t.showOn.splice(t.showOn.indexOf("focus"),1),t.disableTimeRanges.length>0){for(var i in t.disableTimeRanges)t.disableTimeRanges[i]=[b(t.disableTimeRanges[i][0]),b(t.disableTimeRanges[i][1])];t.disableTimeRanges=t.disableTimeRanges.sort(function(e,t){return e[0]-t[0]});for(var i=t.disableTimeRanges.length-1;i>0;i--)t.disableTimeRanges[i][0]<=t.disableTimeRanges[i-1][1]&&(t.disableTimeRanges[i-1]=[Math.min(t.disableTimeRanges[i][0],t.disableTimeRanges[i-1][0]),Math.max(t.disableTimeRanges[i][1],t.disableTimeRanges[i-1][1])],t.disableTimeRanges.splice(i,1))}return t}function i(t){var n=t.data("timepicker-settings"),i=t.data("timepicker-list");if(i&&i.length&&(i.remove(),t.data("timepicker-list",!1)),n.useSelect){i=e("'+l.join("")+"",d(f.yearRange)?(a=f.yearRange[0],s=f.yearRange[1]+1):(a=n-f.yearRange,s=1+n+f.yearRange),l=[];a=f.minYear&&l.push('");return c='
'+n+f.yearSuffix+'
",f.showMonthAfterYear?m+=c+u:m+=u+c,p&&(0===i||f.minMonth>=i)&&(g=!1),h&&(11===i||f.maxMonth<=i)&&(v=!1),0===t&&(m+='"),t===e._o.numberOfMonths-1&&(m+='"),m+=""},T=function(e,t,n){return''+S(e)+I(t)+"
"},D=function(a){var s=this,u=s.config(a);s._onMouseDown=function(e){if(s._v){e=e||window.event;var t=e.target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?s.prevMonth():l(t,"pika-next")&&s.nextMonth():(s.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&r(function(){s.hide(),u.blurFieldOnSelect&&u.field&&u.field.blur()},100))),l(t,"pika-select"))s._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},s._onChange=function(e){e=e||window.event;var t=e.target||e.srcElement;t&&(l(t,"pika-select-month")?s.gotoMonth(t.value):l(t,"pika-select-year")&&s.gotoYear(t.value))},s._onKeyChange=function(e){if(e=e||window.event,s.isVisible())switch(e.keyCode){case 13:case 27:u.field&&u.field.blur();break;case 37:e.preventDefault(),s.adjustDate("subtract",1);break;case 38:s.adjustDate("subtract",7);break;case 39:s.adjustDate("add",1);break;case 40:s.adjustDate("add",7)}},s._onInputChange=function(n){var i;n.firedBy!==s&&(u.parse?i=u.parse(u.field.value,u.format):t?(i=e(u.field.value,u.format,u.formatStrict),i=i&&i.isValid()?i.toDate():null):i=new Date(Date.parse(u.field.value)),f(i)&&s.setDate(i),s._v||s.show())},s._onInputFocus=function(){s.show()},s._onInputClick=function(){s.show()},s._onInputBlur=function(){var e=i.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);s._c||(s._b=r(function(){s.hide()},50)),s._c=!1},s._onClick=function(e){e=e||window.event;var t=e.target||e.srcElement,i=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),o(t,"change",s._onChange)));do{if(l(i,"pika-single")||i===u.trigger)return}while(i=i.parentNode);s._v&&t!==u.trigger&&i!==u.trigger&&s.hide()}},s.el=i.createElement("div"),s.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),o(s.el,"mousedown",s._onMouseDown,!0),o(s.el,"touchend",s._onMouseDown,!0),o(s.el,"change",s._onChange),u.keyboardInput&&o(i,"keydown",s._onKeyChange),u.field&&(u.container?u.container.appendChild(s.el):u.bound?i.body.appendChild(s.el):u.field.parentNode.insertBefore(s.el,u.field.nextSibling),o(u.field,"change",s._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var c=u.defaultDate;f(c)?u.setDefaultDate?s.setDate(c,!0):s.gotoDate(c):s.gotoDate(new Date),u.bound?(this.hide(),s.el.className+=" is-bound",o(u.trigger,"click",s._onInputClick),o(u.trigger,"focus",s._onInputFocus),o(u.trigger,"blur",s._onInputBlur)):this.show()};return D.prototype={config:function(e){this._o||(this._o=y({},_,!0));var t=y(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(t.bound!==undefined?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(n){return n=n||this._o.format,f(this._d)?this._o.toString?this._o.toString(this._d,n):t?e(this._d).format(n):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,i){t&&e.isMoment(n)&&this.setDate(n.toDate(),i)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null, this._o.field&&(this._o.field.value="",b(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,i=this._o.maxDate;f(n)&&ei&&(e=i),this._d=new Date(e.getTime()),g(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),b(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=e.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),t=r=o&&(this._y=o,!isNaN(s)&&this._m>s&&(this._m=s)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u'+C(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&r(function(){n.trigger.focus()},1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label",n.ariaLabel)}},adjustPosition:function(){var e,t,n,r,o,a,s,l,d,f,p,h;if(!this._o.container){if(this.el.style.position="absolute",e=this._o.trigger,t=e,n=this.el.offsetWidth,r=this.el.offsetHeight,o=window.innerWidth||i.documentElement.clientWidth,a=window.innerHeight||i.documentElement.clientHeight,s=window.pageYOffset||i.body.scrollTop||i.documentElement.scrollTop,p=!0,h=!0,"function"==typeof e.getBoundingClientRect)f=e.getBoundingClientRect(),l=f.left+window.pageXOffset,d=f.bottom+window.pageYOffset;else for(l=t.offsetLeft,d=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,d+=t.offsetTop;(this._o.reposition&&l+n>o||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth,p=!1),(this._o.reposition&&d+r>a+s||this._o.position.indexOf("top")>-1&&d-r-e.offsetHeight>0)&&(d=d-r-e.offsetHeight,h=!1),this.el.style.left=l+"px",this.el.style.top=d+"px",u(this.el,p?"left-aligned":"right-aligned"),u(this.el,h?"bottom-aligned":"top-aligned"),c(this.el,p?"right-aligned":"left-aligned"),c(this.el,h?"top-aligned":"bottom-aligned")}},render:function(e,t,n){var i=this._o,r=new Date,o=m(e,t),a=new Date(e,t,1).getDay(),s=[],l=[];g(r),i.firstDay>0&&(a-=i.firstDay)<0&&(a+=7);for(var u=0===t?11:t-1,c=11===t?0:t+1,d=0===t?e-1:e,h=11===t?e+1:e,y=m(d,u),b=o+a,w=b;w>7;)w-=7;b+=7-w;for(var _=!1,E=0,I=0;E=o+a,q=E-a+1,M=t,j=e,O=i.startRange&&v(i.startRange,S),R=i.endRange&&v(i.endRange,S),P=i.startRange&&i.endRange&&i.startRangei.maxDate||i.disableWeekends&&p(S)||i.disableDayFn&&i.disableDayFn(S);N&&(E=0&&s>=0&&{top:n,bottom:i,left:r,right:o,width:a,height:s}}function u(e){var t;try{t=e.getBoundingClientRect()}catch(e){}return t?(t.width&&t.height||(t={top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.right-t.left,height:t.bottom-t.top}),t):c()}function c(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function d(e,t){for(var n=t;n;){if(n==e)return!0;n=f(n)}return!1}function f(e){var t=e.parentNode;return t&&11==t.nodeType&&t.host?t.host:t}if("IntersectionObserver"in e&&"IntersectionObserverEntry"in e&&"intersectionRatio"in e.IntersectionObserverEntry.prototype)return void("isIntersecting"in e.IntersectionObserverEntry.prototype||Object.defineProperty(e.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}));var p=[];i.prototype.THROTTLE_TIMEOUT=100,i.prototype.POLL_INTERVAL=null,i.prototype.observe=function(e){if(!this._observationTargets.some(function(t){return t.element==e})){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},i.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter(function(t){return t.element!=e}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},i.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},i.prototype.takeRecords=function(){var e=this._queuedEntries.slice();return this._queuedEntries=[],e},i.prototype._initThresholds=function(e){var t=e||[0];return Array.isArray(t)||(t=[t]),t.sort().filter(function(e,t,n){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return e!==n[t-1]})},i.prototype._parseRootMargin=function(e){var t=e||"0px",n=t.split(/\s+/).map(function(e){var t=/^(-?\d*\.?\d+)(px|%)$/.exec(e);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}});return n[1]=n[1]||n[0],n[2]=n[2]||n[0],n[3]=n[3]||n[1],n},i.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(a(e,"resize",this._checkForIntersections,!0),a(t,"scroll",this._checkForIntersections,!0),"MutationObserver"in e&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},i.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,s(e,"resize",this._checkForIntersections,!0),s(t,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},i.prototype._checkForIntersections=function(){var e=this._rootIsInDom(),t=e?this._getRootRect():c();this._observationTargets.forEach(function(i){var o=i.element,a=u(o),s=this._rootContainsTarget(o),l=i.entry,c=e&&s&&this._computeTargetAndRootIntersection(o,t),d=i.entry=new n({time:r(),target:o,boundingClientRect:a,rootBounds:t,intersectionRect:c});l?e&&s?this._hasCrossedThreshold(l,d)&&this._queuedEntries.push(d):l&&l.isIntersecting&&this._queuedEntries.push(d):this._queuedEntries.push(d)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},i.prototype._computeTargetAndRootIntersection=function(n,i){if("none"!=e.getComputedStyle(n).display){for(var r=u(n),o=r,a=f(n),s=!1;!s;){var c=null,d=1==a.nodeType?e.getComputedStyle(a):{};if("none"==d.display)return;if(a==this.root||a==t?(s=!0,c=i):a!=t.body&&a!=t.documentElement&&"visible"!=d.overflow&&(c=u(a)),c&&!(o=l(c,o)))break;a=f(a)}return o}},i.prototype._getRootRect=function(){var e;if(this.root)e=u(this.root);else{var n=t.documentElement,i=t.body;e={top:0,left:0,right:n.clientWidth||i.clientWidth,width:n.clientWidth||i.clientWidth,bottom:n.clientHeight||i.clientHeight,height:n.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(e)},i.prototype._expandRectByRootMargin=function(e){var t=this._rootMarginValues.map(function(t,n){return"px"==t.unit?t.value:t.value*(n%2?e.width:e.height)/100}),n={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},i.prototype._hasCrossedThreshold=function(e,t){var n=e&&e.isIntersecting?e.intersectionRatio||0:-1,i=t.isIntersecting?t.intersectionRatio||0:-1;if(n!==i)for(var r=0;r0&&(r.unobserve(n.target),i(n.target)||(t(n.target),e(n.target)))})}};return function(){var o=arguments.length>0&&arguments[0]!==undefined?arguments[0]:".lozad",a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},s=t({},n,a),l=s.rootMargin,u=s.threshold,c=s.load,d=void 0;return window.IntersectionObserver&&(d=new IntersectionObserver(r(c),{rootMargin:l,threshold:u})),{observe:function(){for(var t=document.querySelectorAll(o),n=0;nw)&&(g*=-1),o+=h,(o>v||o<0)&&(h*=-1),l+=m,u+=p,u>1&&(u=1,p*=-1),(u<0||l>y)&&(t?_&&(e.body.removeChild(_),_=null,a--):k()),E()}}},c=function(){o.forEach(function(e){e.step(!r)}),a>0&&l(c)};return{start:function(){if(!r){o=[];for(var e=0;e1){if(o=e({path:"/"},i.defaults,o),"number"==typeof o.expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*o.expires),o.expires=s}try{a=JSON.stringify(r),/^[\{\[]/.test(a)&&(r=a)}catch(e){}return r=n.write?n.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",r,o.expires&&"; expires="+o.expires.toUTCString(),o.path&&"; path="+o.path,o.domain&&"; domain="+o.domain,o.secure?"; secure":""].join("")}t||(a={});for(var l=document.cookie?document.cookie.split("; "):[],u=/(%[0-9A-Z]{2})+/g,c=0;c0&&!n(i,e.activeElement)?f[0].focus():r.shiftKey?0===o&&(f[f.length-1].focus(),r.preventDefault()):o===f.length-1&&(f[0].focus(),r.preventDefault())}else!t||"function"!=typeof t||"Escape"!==event.key&&"Esc"!==event.key||t()}function r(t){return t===undefined&&(t=e.body),Array.isArray(t)||(t=t.length?Array.prototype.slice.call(t):[t]),t}function o(e){return r(e).reduce(function(e,t){return e.concat(t.matches(h)?[t]:[],Array.prototype.slice.call(t.querySelectorAll(h)))},[])}function a(e){o(r(e)).forEach(function(e){e.prevTabindex=e.getAttribute("tabindex"),e.setAttribute("tabindex","-1")})}function s(e){o(r(e)).forEach(function(e){"-1"===e.getAttribute("tabindex")&&(e.prevTabindex?e.setAttribute("tabindex",e.prevTabindex):e.removeAttribute("tabindex"))})}function l(a,s,l){function u(){h.removeEventListener("transitionend",u),s.focus()}d=a=r(a),p=e.activeElement,f=o(a),s=s||n(a,e.activeElement)&&e.activeElement||f.length>0&&f[0];var h;a.some(function(e){var n=t.getComputedStyle(e),i=n.getPropertyValue("transition-duration"),r=i&&i.split(",").some(function(e){return e&&0!==t.parseInt(e)}),o=n.getPropertyValue("transition-delay"),a=o&&o.split(",").some(function(e){return e&&0!==t.parseInt(e)});if(r||a)return h=e,!0}),s&&(h&&"undefined"!==e.body.style.transition?h.addEventListener("transitionend",u):s.focus()),f.length>0&&(c=i.bind(this,l,a),e.addEventListener("keydown",c))}function u(){e.removeEventListener("keydown",c),p&&p.focus&&p.focus(),d=null,f=null,p=null}var c,d=null,f=null,p=null,h=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not(.hidden)',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.hidden)","iframe","object","embed",'*[tabindex="0"]',"*[contenteditable]"].join(", ");return{excludeFocus:a,includeFocus:s,releaseFocus:u,trapFocus:l}}(),t.Intellum.util.ready(n)}(window.document,window),function(e,t){"use strict";if("function"!=typeof Element.prototype.matches&&(Element.prototype.matches=Element.prototype.msMatchesSelector),"function"!=typeof Element.prototype.closest&&(Element.prototype.closest=function(e){for(var t=this;t;){if(t.matches(e))return t;t=t.parentElement}}),"function"!=typeof t.CustomEvent){var n=function(t,n){n=n||{bubbles:!1,cancelable:!1,detail:undefined};var i=e.createEvent("CustomEvent");return i.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),i};n.prototype=t.Event.prototype,t.CustomEvent=n}"undefined"==typeof global&&(t.global=t)}(window.document,window),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.util=t.Intellum.util||{},t.Intellum.util.resized=function(){function e(){c=t.innerWidth,d=t.innerHeight,n()}function n(){a||(t.requestAnimationFrame?t.requestAnimationFrame(i):t.setTimeout(i,250),a=!0)}function i(){c===l&&d===u||(l=c,u=d,s.forEach(function(e){e()})),a=!1}function r(e){s.push(e)}function o(e){var t=s.indexOf(e);-1!==t&&s.splice(t,1)}var a=!1,s=[],l=t.innerWidth,u=t.innerHeight,c=l,d=u;return t.addEventListener("resize",e),{addHandler:r,removeHandler:o}}()}(window.document,window),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.util=t.Intellum.util||{},t.Intellum.util.scroll=function(){function e(e,n){var i=!1;return function(){i||(e.call(),i=!0,t.setTimeout(function(){i=!1},n))}}function n(e){o.push(e)}function i(e){var t=o.indexOf(e);-1!==t&&o.splice(t,1)}function r(){o.forEach(function(e){e()})}var o=[];return t.addEventListener("scroll",e(r,100)),t.addEventListener("wheel",e(r,100)),{addHandler:n,removeHandler:i}}()}(window.document,window),function(e,t){"use strict";function n(){"function"==typeof t.svg4everybody&&t.svg4everybody()}t.Intellum.util.ready(n)}(window.document,window),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.util=t.Intellum.util||{};var n=0;t.Intellum.util.uniqueid=function(){return"intellum-id-"+Date.now()+"-"+n++}}(window.document,window),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.util=t.Intellum.util||{},t.Intellum.util.throttle=function(e,n){var i=!1;return function(){i||(e.call(),i=!0,t.setTimeout(function(){i=!1},n))}}}(window.document,window),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.util=t.Intellum.util||{},t.Intellum.util.now=Date.now||function(){return(new Date).getTime()},t.Intellum.util.debounce=function(e,n,i){var r,o,a,s,l,u=function(){var c=t.Intellum.util.now()-s;c=0?r=setTimeout(u,n-c):(r=null,i||(l=e.apply(a,o),r||(a=o=null)))};return function(){a=this,o=arguments,s=t.Intellum.util.now();var c=i&&!r;return r||(r=setTimeout(u,n)),c&&(l=e.apply(a,o),a=o=null),l}}}(window.document,window),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll(".comment")).forEach(function(e){new t.Intellum.comment(e)})}t.Intellum=t.Intellum||{},t.Intellum.comment=function(n){function i(){-1===n.className.indexOf("comment--editing")&&(n.className+=" comment--editing"),n.className=n.className.replace(" comment--replying","")}function r(){n.className=n.className.replace(" comment--editing","")}function o(){-1===n.className.indexOf("comment--editing")?n.dispatchEvent(new t.CustomEvent("startedit.comment")):n.dispatchEvent(new t.CustomEvent("stopedit.comment"))}function a(e){if(t.FormData){e.preventDefault();var n=new XMLHttpRequest,i=new t.FormData(b),r=b.getAttribute("action");n.open("POST",r),n.setRequestHeader("Accept","application/json"),n.onload=function(){if(n.status>=200&&n.status<400){var e=JSON.parse(n.responseText);e.success&&s(e.html),e.message&&t.Intellum.flashnotice.show(e.message)}},n.send(i)}}function s(e){k&&(k.innerHTML=e.trim(),w&&(w.value=Array.prototype.slice.call(k.querySelectorAll("p")).map(function(e){return e.textContent}).join("\r\n\r\n")),n.dispatchEvent(new t.CustomEvent("stopedit.comment")))}function l(){-1===n.className.indexOf("comment--replying")&&(n.className+=" comment--replying"),n.className=n.className.replace(" comment--editing",""),E&&E.focus()}function u(){n.className=n.className.replace(" comment--replying","")}function c(){-1===n.className.indexOf("comment--replying")?n.dispatchEvent(new t.CustomEvent("startreply.comment")):n.dispatchEvent(new t.CustomEvent("stopreply.comment"))}function d(e){if(t.FormData){e.preventDefault();var n=new XMLHttpRequest,i=new t.FormData(_),r=_.getAttribute("action");n.open("POST",r),n.setRequestHeader("Accept","application/json"),n.onload=function(){if(n.status>=200&&n.status<400){var e=JSON.parse(n.responseText);e.success&&f(e.html),e.message&&t.Intellum.flashnotice.show(e.message)}},n.send(i)}}function f(i){if(x){var r=e.createElement("div");r.innerHTML=i.trim();var o=r.firstChild;x.insertBefore(o,x.firstChild),new t.Intellum.comment(o),n.dispatchEvent(new t.CustomEvent("stopreply.comment",{detail:{reply:o}}))}}function p(e){if(A){A.setAttribute("data-like-count",e);var t=A.getAttribute("data-likes-template");0===e&&A.hasAttribute("data-likes-0-template")?t=A.getAttribute("data-likes-0-template"):1===e&&A.hasAttribute("data-likes-1-template")&&(t=A.getAttribute("data-likes-1-template")),A.textContent=t.replace("${likes}",e)}}function h(e){if(A){p((A.hasAttribute("data-like-count")?parseInt(A.getAttribute("data-like-count")):0)+e)}}function m(e){if(e.detail&&e.detail.trigger&&e.detail.trigger.hasAttribute("data-like-url")){var t=new XMLHttpRequest;t.open("POST",e.detail.trigger.getAttribute("data-like-url"),!0),t.onload=function(){if(t.status>=200&&t.status<400){var e=t.responseText;-1===n.className.indexOf("comment--liked")&&(n.className+=" comment--liked"),p(JSON.parse(e).likes_count||0)}},t.send()}else-1===n.className.indexOf("comment--liked")&&(n.className+=" comment--liked"),h(1)}function g(e){if(e.detail&&e.detail.trigger&&e.detail.trigger.hasAttribute("data-like-url")){var t=new XMLHttpRequest;t.open("DELETE",e.detail.trigger.getAttribute("data-like-url"),!0),t.onload=function(){if(t.status>=200&&t.status<400){var e=t.responseText;n.className=n.className.replace(" comment--liked",""),p(JSON.parse(e).likes_count||0)}},t.send()}else n.className=n.className.replace(" comment--liked",""),h(-1)}function v(){for(var t=n.querySelector(".comment__content");t.firstChild;)t.removeChild(t.firstChild);var i=e.createElement("p");i.className="comment__paragraph",i.textContent=t.getAttribute("data-deleted-content"),t.appendChild(i),Array.prototype.slice.call(n.querySelectorAll(".comment__editaction, .comment__responseaction")).forEach(function(e){e.closest(".comment")===n&&e.parentNode.removeChild(e)})}function y(){n.addEventListener("startedit.comment",i),n.addEventListener("stopedit.comment",r),n.addEventListener("toggleedit.comment",o),n.addEventListener("startreply.comment",l),n.addEventListener("stopreply.comment",u),n.addEventListener("togglereply.comment",c),n.addEventListener("like.comment",m),n.addEventListener("unlike.comment",g),n.addEventListener("clear.comment",v),n.onstartedit=i,n.onstopedit=r,n.ontoggleedit=o,n.onstartreply=l,n.onstopreply=u,n.ontogglereply=c,n.onlike=m,n.onunlike=g,n.clear=v,b&&b.addEventListener("submit",a),_&&_.addEventListener("submit",d), Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="startedit"], [data-behavior~="startedit.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("startedit.comment"))})}),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="stopedit"], [data-behavior~="stopedit.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("stopedit.comment"))})}),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="toggleedit"], [data-behavior~="toggleedit.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("toggleedit.comment"))})}),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="startreply"], [data-behavior~="startreply.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("startreply.comment"))})}),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="stopreply"], [data-behavior~="stopreply.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("stopreply.comment"))})}),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="togglereply"], [data-behavior~="togglereply.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("togglereply.comment"))})}),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="like"], [data-behavior~="like.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("like.comment",{detail:{trigger:e}}))})}),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="unlike"], [data-behavior~="unlike.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("unlike.comment",{detail:{trigger:e}}))})}),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="delete"], [data-behavior~="delete.comment"]')).forEach(function(e){e.closest(".comment")===n&&e.addEventListener("click",function(){n.dispatchEvent(new t.CustomEvent("delete.comment"))})})}var b=n.querySelector('form.comment__edit[data-behavior~="submit.form"]'),w=n.querySelector("textarea.comment__edittext"),_=n.querySelector('form.comment__reply[data-behavior~="submit.form"]'),E=n.querySelector("textarea.comment__replytext"),x=n.querySelector(".comment__replies"),k=n.querySelector(".comment__content"),A=n.querySelector(".comment__likecount");y()},t.Intellum.util.ready(n)}(window.document,window),function(e,t){"use strict";function n(){t.Intellum.forums={},Array.prototype.slice.call(e.querySelectorAll(".comments")).forEach(function(e){e.hasAttribute("id")?t.Intellum.forums[e.id]=new t.Intellum.comments(e):new t.Intellum.updatedrawer(updatedrawerEl)})}t.Intellum=t.Intellum||{},t.Intellum.comments=function(n){function i(e){var n=e.target;q?t.Intellum.confirm.show(q,function(e){e&&r(n)}):r(n)}function r(n){var i=n.getAttribute("data-delete-url");if(i){var r=e.querySelector("meta[name=csrf-token]"),a=r&&r.getAttribute("content"),s=new XMLHttpRequest;s.open("DELETE",i,!0),s.setRequestHeader("X-CSRF-Token",a),s.setRequestHeader("Accept","application/json"),s.onload=function(){s.status>=200&&s.status<400&&o(n);var e=JSON.parse(s.responseText);e.message&&t.Intellum.flashnotice.show(e.message)},s.send()}}function o(e){0===e.querySelectorAll(".comment").length?e.parentNode.removeChild(e):e.dispatchEvent(new t.CustomEvent("clear.comment")),a(-1)}function a(e){A.length>0&&Array.prototype.slice.call(A).forEach(function(t){var i=t.hasAttribute("data-comments-count")?parseInt(t.getAttribute("data-comments-count")):0;i+=e,t.setAttribute("data-comments-count",i);var r=t.getAttribute("data-comments-template");0===i&&t.hasAttribute("data-comments-0-template")?r=t.getAttribute("data-comments-0-template"):1===i&&t.hasAttribute("data-comments-1-template")&&(r=t.getAttribute("data-comments-1-template")),t.textContent=r.replace("${comments}",i),0===i?-1===n.className.indexOf("comments--empty")&&(n.className+=" comments--empty"):i>0&&(n.className=n.className.replace(" comments--empty","")),m(i)})}function s(e){if(t.FormData){e.preventDefault();var n,i=new XMLHttpRequest,r=new t.FormData(E),o=E.getAttribute("action");i.open("POST",o),i.setRequestHeader("Accept","application/json"),i.onload=function(){if(i.status>=200&&i.status<400){var e=JSON.parse(i.responseText);e.success&&n==undefined&&(n=e.html,l(n),D=e.lastupdate),e.message&&t.Intellum.flashnotice.show(e.message)}},i.send(r)}}function l(n){if(I){var i=e.createElement("div");i.innerHTML=n.trim();var r=i.firstChild;I.insertBefore(r,I.firstChild),new t.Intellum.comment(r),a(1),u(),c(r)}}function u(){x&&(x.value="")}function c(e){e.addEventListener("delete.comment",i),e.addEventListener("stopreply.comment",d)}function d(e){e.detail&&e.detail.reply&&(c(e.detail.reply),a(1))}function f(){var t=e.querySelector("meta[name=csrf-token]"),i=t&&t.getAttribute("content"),r=new XMLHttpRequest,o=n.getAttribute("data-status-url");o+="&random="+Math.random(),r.open("GET",o,!0),r.setRequestHeader("X-CSRF-Token",i),r.setRequestHeader("Accept","application/json"),r.setRequestHeader("IF_MODIFIED_SINCE",new Date(D).toUTCString()),r.onload=function(){if(r.status>=200&&r.status<300){var e=JSON.parse(r.responseText);if(e.success){var t=e.lastupdate;D&&t!==D&&-1===n.className.indexOf("comments--outdated")&&(n.className+=" comments--outdated"),D=t}}},r.send()}function p(i){for(var r=i.target;r&&r!==t.document&&r!==t.document.body&&!1===r.hasAttribute("data-refresh-url");)r=r.parentNode;if(r&&r.hasAttribute("data-refresh-url")){var o=e.querySelector("meta[name=csrf-token]"),a=o&&o.getAttribute("content"),s=new XMLHttpRequest,l=r.getAttribute("data-refresh-url");return l=l+"&per_page="+L*N,s.open("GET",l,!0),s.setRequestHeader("X-CSRF-Token",a),s.setRequestHeader("Accept","application/json"),s.onload=function(){if(s.status>=200&&s.status<400){var e=JSON.parse(s.responseText);if(e.success){if(h(e.html,e.count),S&&(l=e.refresh_url||l,S.setAttribute("data-refresh-url",l)),T&&(l=e.refresh_url||l,T.setAttribute("data-refresh-url",l)),i.target.hasAttribute("data-sort-label")){var t=i.target.getAttribute("data-sort-label"),r=n.querySelector("[data-sort]");r&&(r.textContent=t,r.focus());var o=i.target.closest("#comments-select-content");o&&Array.prototype.slice.call(o.querySelectorAll('[role="option"')).forEach(function(e){e==i.target?e.setAttribute("aria-selected","true"):e.setAttribute("aria-selected","false")})}v(e.first_level_comments_count-e.visible_count),b(e.visible_count)}e.lastupdate&&(D=e.lastupdate)}},s.send(),i.preventDefault(),!1}}function h(i,r){var o=e.createElement("div");if(o.innerHTML=i.trim(),I.parentNode.replaceChild(o.firstChild,I),I=n.querySelector(".comments__list"),Array.prototype.slice.call(I.querySelectorAll(".comment")).forEach(function(e){new t.Intellum.comment(e),c(e)}),A.length>0){a(r-(A[0].hasAttribute("data-comments-count")?parseInt(A[0].getAttribute("data-comments-count")):0))}n.className=n.className.replace(" comments--outdated","")}function m(e){e>0?"placeholderComments"in x.dataset&&x.setAttribute("placeholder",x.dataset.placeholderComments):"placeholderNocomments"in x.dataset&&x.setAttribute("placeholder",x.dataset.placeholderNocomments)}function g(e){L+=1,p(e)}function v(e){T&&(e<1?T.parentNode.removeChild(T):(T.querySelector("#comments_count").innerHTML=e,C.focus()))}function y(){E&&E.addEventListener("submit",s),x&&k&&k.addEventListener("mousedown",u),Array.prototype.slice.call(n.querySelectorAll('[data-behavior~="refresh.comments"][data-refresh-url]')).forEach(function(e){e.addEventListener("click",function(e){var t=e;setTimeout(function(){p(t)},250)}),e.addEventListener("keydown",function(e){if("Enter"===e.key){var t=e;setTimeout(function(){p(t)},250)}})}),Array.prototype.slice.call(n.querySelectorAll(".comment")).forEach(function(e){c(e)}),n.hasAttribute("data-status-url")&&!n.hasAttribute("hidden")&&f()}function b(e){var t=n.querySelector("#live_announcement_comments");t.innerHTML=t.innerHTML.replace(/\d+/g,e)}function w(){var e=C.parentNode;e.removeChild(C),e.classList.add("course__commentscontainer--expanded"),n.removeAttribute("hidden"),y(),b(10)}function _(){C.addEventListener("click",function(e){e.preventDefault(),w()}),"true"==n.getAttribute("data-scroll-into-view")&&(w(),n.scrollIntoView()),T&&T.addEventListener("click",function(e){g(e)})}var E=n.querySelector('form.comments__newcomment[data-behavior~="submit.form"]'),x=n.querySelector(".comments__newtext"),k=(n.querySelector(".comments__newsubmit"),n.querySelector(".comments__newcancel")),A=e.querySelectorAll("[data-comments-count]"),I=n.querySelector(".comments__list"),S=n.querySelector('[data-behavior~="masterrefresh.comments"]'),C=e.querySelector(".course__comments__showbutton"),T=e.querySelector(".course__comments__morebutton"),D=0,L=1,N=10,q=n.querySelector("#comments-confirm-delete");return _(),{checkForUpdates:f}},t.Intellum.util.ready(n)}(window.document,window),window.fireworks=function(){function e(e){l=e,u=l.getContext("2d"),c=(new Date).getTime(),l.width=p,l.height=m,p=l.width=window.innerWidth,m=l.height=document.body.offsetHeight,g=m/2,v=p/2}function t(){this.reset()}function n(e,t,n,i){this.x=e,this.y=t,this.z=n,this.startX=this.x,this.startY=this.y,this.startZ=this.z,this.ox=this.x,this.oy=this.y,this.oz=this.z,this.xPos=0,this.yPos=0,this.vx=10*Math.random()-5,this.vy=10*Math.random()-5,this.vz=10*Math.random()-5,this.color=[i.r,i.g,i.b],this.render=!0,this.size=Math.round(1+1*Math.random())}function r(){o(),_=Math.sin(x+=.01),b=Math.sin(x),E=Math.sin(x);for(var e=u.createImageData(p,m),t=0;t<30;t++)d[t]&&(d[t].update(),d[t].render(e));u.putImageData(e,0,0),requestAnimationFrame(r)}function o(){k+=.6,k>100&&(k=0),A.r=~~(127*Math.sin(.3*k+0)+128),A.g=~~(127*Math.sin(.3*k+2)+128),A.b=~~(127*Math.sin(.3*k+4)+128)}function a(){d=[];for(var e=0;e<30;e++)o(),d.push(new t);r()}function s(){f=!0,requestAnimationFrame(function(){if(u.clearRect(0,0,l.width,l.height),d.length)for(var e=0;e<30;e++)d[e]&&(d[e].particles=[],d[e]=null)})}var l,u,c,d,f,p=0,m=0,g=0,v=0,y=300,b=180,_=180,E=180,x=0,k=0,A={r:255,g:0,b:0};return t.prototype.reset=function(){var e=200,t=400*Math.random()-200,i=400*Math.random()-200,r=800*Math.random()-200;this.x=t||0,this.y=i||0,this.z=r||0;Math.random(),Math.random(),Math.random();this.particles=[];for(var o=0;o255&&(n.render=!1,this.particles.splice(i,1),this.particles.length--),n.render&&n.xPos0&&n.yPos>0&&n.yPos0&&n.yPos+h>0&&n.yPos+h-y){var e=y/(y+this.z);this.size=2*e,this.xPos=v+this.x*e,this.yPos=g+this.y*e,this.render=!0}},{initialise:e,start:a,stop:s}}(),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.fireworks=function(){function n(){var n=e.getElementById("fireworksCanvas");t.fireworks&&n&&(t.fireworks.initialise(n),t.fireworks.start())}function i(){t.fireworks&&t.fireworks.stop()}return{start:n,stop:i}}()}(window.document,window),function(e,t){"use strict";function n(){e.body.style.overflow="hidden"}function i(){e.body.style.overflow=""}function r(){i(),Array.prototype.slice.call(s).forEach(function(e){e.dispatchEvent(new t.CustomEvent("collapse.sidemenu"))})}function o(){if(a=e.querySelector(".header"),s=e.querySelectorAll(".sidemenu"),a&&s.length){var o=e.querySelector(".header__btn--mobile"),l=!0;o&&"none"==t.getComputedStyle(o).getPropertyValue("display")&&(l=!1),l&&a.addEventListener("showsearch.header",r)}Array.prototype.slice.call(s).forEach(function(e){e.addEventListener("scrollstart.sidemenu",n),e.addEventListener("scrollend.sidemenu",i)})}var a,s;t.Intellum.util.ready(o)}(window.document,window),function(e,t){function n(e,n){function i(e){s=e-a,t.scrollTo(0,r(s,l,u,c)),s",i+='
',t.forEach(function(e){i+=''+e[1]+""}),i+="
"):i+=e("#add-activity-to-existing-path-no-results").html(),n.html(i)})})},o=function(){n.on("click",".tagbutton",function(){var r=e(this);t.val(r.text()),i.val(r.data("path-id")),n.html("")})},a=function(){n.on("click","[data-create-new-path-trigger]",function(){e("[data-add-activity-to-new-path-dialog-trigger]").first().click()})};return{init:function(){t=e("#curation-add-activity-to-path-search"),n=e("#curation-add-activity-to-path-results"),i=e("#curation-selected-path-id"),t.length&&(r(),o(),a())}}}();Intellum.util.ready(t.init)}(jQuery),function(e){var t=function(){var t,n,i=function(t){t.on("ajax:success",function(n,i){var r,o,a,s=t.parents(".dialog__content").find("[data-success-message]"),l=e("[data-path-added-link]",s);if(i.course?(r=i.course.id,o=i.course.name):(r=i.id,o=i.name),a="/student/path/"+r,l.length)l.attr("href",a),l.text(o);else{var u="'+o+"";s.html(s.html().replace("{{PATHNAME}}",u))}s.show(),t.hide(),t.parents(".dialog")[0].addEventListener("hide.dialog",function(){e("[data-reset-on-dialog-show]",t).val(""),e("#curation-add-activity-to-path-results").html(""),t.show(),s.hide()})}),t.on("ajax:error",function(){Intellum.flashnotice.show(t.data("error-msg"),"warning")})};return{init:function(){t=e("#new-path-from-public-activity-form"),n=e("#add-public-activity-to-path-form"),[t,n].forEach(function(e){e.length&&i(e)})}}}();Intellum.util.ready(t.init)}(jQuery),$(document).ready(function(){var e=document.querySelector("#user_picture_attributes_target"),t=document.querySelector("#selected-avatar");null!=e&&null!=t&&e.addEventListener("change",function(e){document.querySelector("#selected-avatar").setAttribute("src",e.target.value)})}),$(function(){if(!(0==$(".video-wrapper").length||$('[data-video-events-enabled="false"]').length>0)){var e=$("#vimeo-player"),t=$("#youtube-player"),n=$("#facebook-player"),i=$(".video-wrapper").data("enrollment-id"),r=$(".video-wrapper").data("enrollment-started").length>0,o=function(){return $("#course-completed").length>0};if(i&&e.length>0&&!o()){var a=$f(e[0]),s=function(){a.removeEvent("playProgress")};a.addEvent("ready",function(){a.addEvent("playProgress",function(t){var n=t.duration,i=t.seconds,o=n-i,a=1==e.data().videoAutoCompletes?30:0;r||p(),n<=60&&(a=1==e.data().videoAutoCompletes?6:0),a>0&&o0&&!o()){var l=document.createElement("script");l.src="https://www.youtube.com/iframe_api";var u=document.getElementsByTagName("script")[0];u.parentNode.insertBefore(l,u);var c=null,d=function(){clearInterval(c)};window.onYouTubeIframeAPIReady=function(){a=new YT.Player("youtube-player",{events:{onReady:function(){c=setInterval(function(){var e=a.getDuration(),n=a.getCurrentTime(),i=e-n,o=1==t.data().videoAutoCompletes?30:0;r||p(),0!=e&&e<=60&&(o=1==t.data().videoAutoCompletes?6:0),0!=e&&o>0&&i0&&!o()&&(window.fbCompletionChecker=function(){return{init:function(e){var t=e.detail,i=null;t.subscribe("startedPlaying",function(){i=setInterval(function(){var i=t.getDuration(),o=t.getCurrentPosition(),a=i-o,s=0;r||p(),n.data().videoAutoCompletes&&(s=i>60?30:6),s>0&&a0)return;t=document.querySelectorAll(".pgcomponent[data-completion-url]"),e(t)}}}}(),Intellum.util.ready(Intellum.pageActivityCompletionTracker.init)}(),function(){"use strict";window.Neeman=window.Neeman||{},window.Neeman.util=window.Neeman.util||{};var e=!1,t=[];window.Neeman.util.ready=function(n){function i(){document.removeEventListener("DOMContentLoaded",i),window.removeEventListener("load",i),e=!1,null!==document.querySelector(".neeman")&&(t.forEach(function(e){e()}),t=[])}"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?null!==document.querySelector("html.neeman")&&window.setTimeout(n,0):(t.push(n),e||(e=!0,document.addEventListener("DOMContentLoaded",i),window.addEventListener("load",i)))},window.Neeman.util.sendMessage=function(e,t){if("undefined"!=typeof webkit&&null!==webkit){var n=webkit.messageHandlers[e];void 0!==n&&n.postMessage(t)}},window.Neeman.util.toggleClass=function(e,t){var n=document.querySelectorAll(e),i=document.querySelectorAll(e+"."+t).length;Array.prototype.slice.call(n).forEach(function(e){i?e.classList.remove(t):e.classList.add(t)})}}(window.document,window),function(e,t){"use strict";t.Neeman.util.ready(function(){var t=e.querySelectorAll("a[data-activity-type]");Array.prototype.slice.call(t).forEach(function(e){-1==e.href.indexOf("#")&&(e.search+=(e.search.match(/\?.*/)?"&":"?")+"neeman-activity-type="+e.dataset.activityType)})})}(window.document,window),function(e,t){"use strict";t.Neeman.showPathNav=function(){var t=e.querySelector('[data-neeman-class="pathdrawer"]');t&&(t.classList.add("pathdrawer--expanded"),t.setAttribute("aria-expanded","true"))},t.Neeman.hidePathNav=function(){var t=e.querySelector('[data-neeman-class="pathdrawer"]');t&&(t.classList.remove("pathdrawer--expanded"),t.setAttribute("aria-expanded","false"))}}(window.document,window),$(document).ready(function(){$("body.body--logged-out .authentication-required-smart-link").on("click",function(e){var t=$(this).attr("href");null!=t&&(e.preventDefault(),$.ajax({url:"/student/authentication/set_unauthenticated_post_authentication_destination",type:"POST",data:{authenticity_token:$("meta[name='csrf-token']").attr("content"),destination_url:t}}).done(function(){$("button.button--appheader").trigger("click")}))})}),function(){function e(){return window.location!==window.parent.location}function t(){"true"!=Cookies.get("is_exceed_embedded_widget")&&e()&&(Cookies.set("is_exceed_embedded_widget","true"),"true"==Cookies.get("is_exceed_embedded_widget")&&location.reload())}function n(){t()}n()}(),function(e,t,n){"use strict";n.intellum=n.intellum||{},n.intellum.radioswitch=function(e,t){var i=this,r={};i.settings=n.extend({},r,t);var o=n(e),a=null,s=function(e){null!==a&&u(a),l(n(e.target))},l=function(e){var t=n(e.data("reveal-selector")),i=t.find("input");a=e,i.each(function(e,t){n(t).attr("name",n(t).data("name"))}),t.show()},u=function(e){var t=n(e.data("reveal-selector")),i=t.find("input");t.hide(),i.each(function(e,t){n(t).data("name",n(t).attr("name")),n(t).attr("name",null)})};i.init=function(){o.find("input[type=radio]").each(function(e,t){var i=n(t);i.is(":checked")?l(i):u(i)}).on("click",s)},i.init()},n.fn.intellum_radioswitch=function(e){return this.each(function(){undefined===n(this).data("intellum.radioswitch")&&n(this).data("intellum.radioswitch",new n.intellum.radioswitch(this,e))})},n(function(){n(".radioswitch").intellum_radioswitch()})}(document,window,jQuery),function(e,t,n){var i=function(){function i(){h.length&&h.attr("disabled","disabled").addClass("button--disabled")}function r(){h.removeAttr("disabled").removeClass("button--disabled")}function o(){var i,r=h.attr("data-confirm-dialog-id");h.length&&h.text(h.attr("data-completed-text")),t.dispatchEvent(new CustomEvent("course.complete")),n('[data-rewardtype="certificate"]').length?t.location.reload(!0):(a(),u(),y&&(y.classList.contains("activitynotification--avoidCompleted")||c()),f(),p(),v=!0,r&&(i=e.getElementById(r))&&i.dispatchEvent(new t.CustomEvent("hide.dialog")))}function a(){var e=n("#pathdrawer");if(!e.length)return!1;var t,i,r,o,a=e.data("current-enrollment-id"),u=n('li[data-enrollment-id="'+a+'"]',e),c=u.find(".pathmenu__itemmarker").first(),d=c.parent().parent().data("shape"),f=d!=undefined?"_"+d:"",p=u.closest("section.pathmenu__section").next("section.pathmenu__section");if("facilitator"!=u.attr("data-userrole")&&(c.empty(),c.append(n("#mark_as_complete_icon"+f)),u.attr("data-status","completed")),t=u.next(".pathmenu__sectionitem"),0==t.length&&(t=p.find(".pathmenu__sectionitem").first()),t.length){if(o=t.data("activity-url"),i=t.data("isLocked"),r=t.data("isLockedByDate"),i&&!r){t.html(''+t.html()+""),s(),t.removeData("status"),t.removeAttr("data-status");var h=t.data("shape");h!=undefined?t.find(".pathmenu__markericon").replaceWith(n("#"+h+"_icon")):t.find(".pathmenu__markericon").remove()}}else l()}function s(){var e=n(".coursepage__navlink--next");nextItemUrl=e.data("activity-url"),e.find(".coursepage__navicon--locked").first().remove(),e.find(".coursepage__navicon--hidden").first().show(),e.replaceWith(n.parseHTML(''+e.html()+""))}function l(){var e=n(".coursepage__navlink--next"),t=e.data("rerender-url");if(!t)return!1;n.get(t,function(t){e.parent().replaceWith(t)})}function u(){var t=e.getElementById("activity-rating");t&&t.dispatchEvent(new CustomEvent("enable.rating"))}function c(){y&&(y.classList.add("activitynotification--active"),y.setAttribute("role","alert"),y.setAttribute("aria-hidden","false")),t.Neeman.util.sendMessage("didUpdateCompletedState",!0),d()}function d(){setTimeout(function(){y.classList.remove("activitynotification--active"),y.setAttribute("aria-hidden","true")},6e3),b.addEventListener("click",function(){y.classList.remove("activitynotification--active"),y.setAttribute("aria-hidden","true")})}function f(){var e=n("#drop_session_btn");e.length&&e.remove()}function p(){var e=n("#find_another_time_btn");e.length&&e.remove()}var h=n("#mark_as_complete"),m=n(".course"),g=n(".page"),v=!1,y=e.getElementById("activitynotification"),b=e.querySelector(".activitynotification__close");m.on("course_autocomplete",function(){var e=function(){var e=t.IntellumDataLayer.enrollment.id,i="/enrollments/autocomplete_video_message/"+e;e&&n.get(i).done(function(e){if(e&&"passed"==e.enrollment_status){var t=n("header.page__header, header.course__headercontainer");t&&e.enrollment_msg&&t.prepend(n(e.enrollment_msg))}})};i(),o(),t.dispatchEvent(new CustomEvent("course.complete")),e()}),m.on("course_complete",function(){i(),o()}),g.on("course_complete",function(){o()}),h.length&&h.on("click",function(a){var s,l,u=h.attr("data-confirm-dialog-id"),c=h.attr("data-confirm-accept");i();var d=function(){c?n.post(c).done(function(e){if(e&&"passed"==e.enrollment_status){var t=n("header.page__header, header.course__headercontainer");t&&e.enrollment_msg&&t.prepend(n(e.enrollment_msg))}o()}):o()};u&&(s=e.getElementById(u))?(a.preventDefault(),l=n("#confirm_activity_completion_button"),s.dispatchEvent(new t.CustomEvent("show.dialog",{detail:{target:null}})),l.off("click").on("click",function(){l.removeClass("button--primary").addClass("button--disabled").attr("disabled","true"),d()}),s.addEventListener("hide.dialog",function(){v||r()})):h.is("button")&&d()}),y&&y.classList.contains("activitynotification--completed")&&(t.dispatchEvent(new CustomEvent("course.complete")),c())};Intellum.util.ready(i)}(document,window,jQuery),function(e,t,n){n(function(){n(".librarylist__item[data-href]").on("click",function(e){e.stopPropagation(),n(this).find("a").first()[0].click()}).find("a, button").on("click",function(e){e.stopPropagation()})})}(document,window,jQuery),function(e,t,n){n(function(){var e=n("#search-input"),i=n(".filterbar__filtergroup"),r=function(){var r=e.data("search-path")+"?search="+encodeURIComponent(e.val().trim());$filters=i.find("[data-filter]"),$filters.each(function(){r+="&"+n(this).attr("data-filter")+"=",filterValue=n(this).find(".dropdown__listitem--selected").first().attr("data-value"),r+=filterValue});var o=/locale=[^&]*/;return!o.test(r)&&location.search&&o.test(location.search)&&(r+="&"+o.exec(location.search)[0]),-1==r.indexOf("content_type=")&&(r+=getQueryStringFromKeys(["content_type"])),-1==r.indexOf("course_type=")&&(r+=getQueryStringFromKeys(["course_type"])),r+=getQueryStringFromKeys(["category_ids"]),t.location=r,!1};e.on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),n(this).prop("disabled",!0),r())}),i.find(".dropdown__listitem[data-value]").on("click",function(){n(this).parents(".dropdown__content--filter").find(".dropdown__listitem[data-value]").each(function(){n(this).removeClass("dropdown__listitem--selected")}),n(this).addClass("dropdown__listitem--selected"),n(this).parents(".dropdown").trigger("hide"),r()})})}(document,window,jQuery),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(e){var t,n,i,r,o,a,s="Close",l="BeforeClose",u="AfterClose",c="BeforeAppend",d="MarkupParse",f="Open",p="Change",h="mfp",m="."+h,g="mfp-ready",v="mfp-removing",y="mfp-prevent-close",b=function(){},w=!!window.jQuery,_=e(window),E=function(e,n){t.ev.on(h+e+m,n)},x=function(t,n,i,r){var o=document.createElement("div");return o.className="mfp-"+t,i&&(o.innerHTML=i),r?n&&n.appendChild(o):(o=e(o),n&&o.appendTo(n)),o},k=function(n,i){t.ev.triggerHandler(h+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},A=function(n){return n===a&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),a=n),t.currTemplate.closeBtn},I=function(){e.magnificPopup.instance||(t=new b,t.init(),e.magnificPopup.instance=t)},S=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(e.transition!==undefined)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};b.prototype={constructor:b,init:function(){var n=navigator.appVersion;t.isLowIE=t.isIE8=document.all&&!document.addEventListener,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=S(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),i=e(document),t.popupsCache={}},open:function(n){var r;if(!1===n.isObj){t.items=n.items.toArray(),t.index=0;var a,s=n.items;for(r=0;r(e||_.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){if(n.target!==t.wrap[0]&&!e.contains(t.wrap[0],n.target))return t._setFocus(),!1},_parseMarkup:function(t,n,i){var r;i.data&&(n=e.extend(i.data,n)),k(d,[t,n,i]),e.each(n,function(n,i){if(i===undefined||!1===i)return!0;if(r=n.split("_"),r.length>1){var o=t.find(m+"-"+r[0]);if(o.length>0){var a=r[1];"replaceWith"===a?o[0]!==i[0]&&o.replaceWith(i):"img"===a?o.is("img")?o.attr("src",i):o.replaceWith(e("").attr("src",i).attr("class",o.attr("class"))):o.attr(r[1],i)}}else t.find(m+"-"+n).html(i)})},_getScrollbarSize:function(){if(t.scrollbarSize===undefined){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:b.prototype,modules:[],open:function(t,n){return I(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},e.fn.magnificPopup=function(n){I();var i=e(this);if("string"==typeof n)if("open"===n){var r,o=w?i.data("magnificPopup"):i[0].magnificPopup,a=parseInt(arguments[1],10)||0;o.items?r=o.items[a]:(r=i,o.delegate&&(r=r.find(o.delegate)),r=r.eq(a)),t._openClick({mfpEl:r},i,o)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),w?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var C,T,D,L="inline",N=function(){D&&(T.after(D.addClass(C)).detach(),D=null)};e.magnificPopup.registerModule(L,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(L),E(s+"."+L,function(){N()})},getInline:function(n,i){if(N(),n.src){var r=t.st.inline,o=e(n.src);if(o.length){var a=o[0].parentNode;a&&a.tagName&&(T||(C=r.hiddenClass,T=x(C),C="mfp-"+C),D=o.after(T).detach().removeClass(C)),t.updateStatus("ready")}else t.updateStatus("error",r.tNotFound),o=e("
");return n.inlineElement=o,o}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var q,M="ajax",j=function(){q&&e(document.body).removeClass(q)},O=function(){j(),t.req&&t.req.abort()};e.magnificPopup.registerModule(M,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){t.types.push(M),q=t.st.ajax.cursor,E(s+"."+M,O),E("BeforeChange."+M,O)},getAjax:function(n){q&&e(document.body).addClass(q),t.updateStatus("loading");var i=e.extend({url:n.src,success:function(i,r,o){var a={data:i,xhr:o};k("ParseAjax",a),t.appendContent(e(a.data),M),n.finished=!0,j(),t._setFocus(),setTimeout(function(){t.wrap.addClass(g)},16),t.updateStatus("ready"),k("AjaxContentAdded")},error:function(){j(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(i),""}}});var R,P=function(n){if(n.data&&n.data.title!==undefined)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var n=t.st.image,i=".image";t.types.push("image"),E(f+i,function(){"image"===t.currItem.type&&n.cursor&&e(document.body).addClass(n.cursor)}),E(s+i,function(){n.cursor&&e(document.body).removeClass(n.cursor),_.off("resize"+m)}),E("Resize"+i,t.resizeImage),t.isLowIE&&E("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,R&&clearInterval(R),e.isCheckingImgSize=!1,k("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],r=function(o){R&&clearInterval(R),R=setInterval(function(){if(i.naturalWidth>0)return void t._onImageHasSize(e);n>200&&clearInterval(R),n++,3===n?r(10):40===n?r(50):100===n&&r(500)},o)};r(1)},getImage:function(n,i){var r=0,o=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,k("ImageLoadComplete")):(r++,r<200?setTimeout(o,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var u=document.createElement("img");u.className="mfp-img",n.el&&n.el.find("img").length&&(u.alt=n.el.find("img").attr("alt")),n.img=e(u).on("load.mfploader",o).on("error.mfploader",a),u.src=n.src,l.is("img")&&(n.img=n.img.clone()),u=n.img[0],u.naturalWidth>0?n.hasSize=!0:u.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:P(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(R&&clearInterval(R),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var H,F=function(){return H===undefined&&(H=document.createElement("p").style.MozTransform!==undefined),H};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var r,o,a=n.duration,u=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,r={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},o="transition";return r["-webkit-"+o]=r["-moz-"+o]=r["-o-"+o]=r[o]=i,t.css(r),t},c=function(){t.content.css("visibility","visible")};E("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(r),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return void c();o=u(e),o.css(t._getOffset()),t.wrap.append(o),r=setTimeout(function(){o.css(t._getOffset(!0)),r=setTimeout(function(){c(),setTimeout(function(){o.remove(),e=o=null,k("ZoomAnimationEnded")},16)},a)},16)}}),E(l+i,function(){if(t._allowZoom()){if(clearTimeout(r),t.st.removalDelay=a,!e){if(!(e=t._getItemToZoom()))return;o=u(e)}o.css(t._getOffset(!0)),t.wrap.append(o),t.content.css("visibility","hidden"),setTimeout(function(){o.css(t._getOffset())},16)}}),E(s+i,function(){t._allowZoom()&&(c(),o&&o.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var r=i.offset(),o=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);r.top-=e(window).scrollTop()-o;var s={width:i.width(),height:(w?i.innerHeight():i[0].offsetHeight)-a-o};return F()?s["-moz-transform"]=s.transform="translate("+r.left+"px,"+r.top+"px)":(s.left=r.left,s.top=r.top),s}}});var B="iframe",$="//about:blank",z=function(e){if(t.currTemplate[B]){var n=t.currTemplate[B].find("iframe");n.length&&(e||(n[0].src=$),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(B,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(B),E("BeforeChange",function(e,t,n){t!==n&&(t===B?z():n===B&&z(!0))}),E(s+"."+B,function(){z()})},getIframe:function(n,i){var r=n.src,o=t.st.iframe;e.each(o.patterns,function(){if(r.indexOf(this.index)>-1)return this.id&&(r="string"==typeof this.id?r.substr(r.lastIndexOf(this.id)+this.id.length,r.length):this.id.call(this,r)),r=this.src.replace("%id%",r),!1});var a={};return o.srcAction&&(a[o.srcAction]=r),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var W=function(e){var n=t.items.length;return e>n-1?e-n:e<0?n+e:e},U=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,r=".mfp-gallery";if(t.direction=!0,!n||!n.enabled)return!1;o+=" mfp-gallery",E(f+r,function(){n.navigateByImgClick&&t.wrap.on("click"+r,".mfp-img",function(){if(t.items.length>1)return t.next(),!1}),i.on("keydown"+r,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),E("UpdateStatus"+r,function(e,n){n.text&&(n.text=U(n.text,t.currItem.index,t.items.length))}),E(d+r,function(e,i,r,o){var a=t.items.length;r.counter=a>1?U(n.tCounter,o.index,a):""}),E("BuildControls"+r,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,r=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(y),o=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(y);r.click(function(){t.prev()}),o.click(function(){t.next()}),t.container.append(r.add(o))}}),E(p+r,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),E(s+r,function(){i.off(r),t.wrap.off("click"+r),t.arrowRight=t.arrowLeft=null})},next:function(){t.direction=!0,t.index=W(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=W(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),r=Math.min(n[1],t.items.length);for(e=1;e<=(t.direction?r:i);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?i:r);e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=W(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),k("LazyLoad",i),"image"===i.type&&(i.img=e('').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,k("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var X="retina";e.magnificPopup.registerModule(X,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;(n=isNaN(n)?n():n)>1&&(E("ImageHasSize."+X,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),E("ElementParse."+X,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),I()}),function(e){"use strict";var t=function(){e.Intellum=e.Intellum||{},e.Intellum.util=e.Intellum.util||{},e.Intellum.util.templateStrings={loading:''}};e.Intellum.util.ready(t)}(window),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll(".actionbar")).forEach(function(e){new t.Intellum.actionbar(e)})}t.Intellum=t.Intellum||{},t.Intellum.actionbar=function(n){function i(){var i=e.getElementById("main").offsetTop,r=n.offsetTop,o=e.getElementById("main").clientHeight+i,a=n.clientHeight,s="actionbar--stuck",l=function(){var e=n.parentElement,r=e.offsetLeft,o=t.innerWidth-r-e.offsetWidth;n.style.left=r+"px",n.style.right=o+"px",n.style.top=i+"px",a=n.clientHeight},u=function(){var e=t.scrollY,a=o-e>t.innerHeight;e>=r-i&&a?n.classList.add(s):n.classList.remove(s)};l(),Intellum.util.resized.addHandler(l),t.addEventListener("scroll",u),u()}function r(e){Array.prototype.slice.call(e).forEach(function(e){e.setAttribute("aria-live","polite")})}function o(e,t,n){Array.prototype.slice.call(t).forEach(function(e){var t=e.dataset.actionbarActionProperty,i=e.dataset.actionbarActionTemplate;1===n.length?(e.setAttribute(t,i.replace(encodeURIComponent("{CHECKED_ITEM_ID_PLACEHOLDER}"),n[0].value)),e.classList.remove("button--disabled")):(e.removeAttribute(t),e.classList.add("button--disabled"))})}function a(e,t,n){Array.prototype.slice.call(t).forEach(function(e){n.length?e.style.display="block":e.style.display="none"})}function s(e,t,n){e.addEventListener("click",function(i){var r=i.target.getAttribute("type");"checkbox"!==r&&"radio"!==r||setTimeout(function(){var i=e.querySelectorAll("input:checked");a(e,t,i),o(e,n,i)})})}function l(e){var t=n.querySelectorAll('[data-actionbar-section="toggle"]'),i=n.querySelectorAll("[data-actionbar-action-property][data-actionbar-action-template]"),l=e.querySelectorAll("input:checked");r(t),a(e,t,l),o(e,i,l),s(e,t,i)}function u(){var t=e.getElementById(n.dataset.actionbarFor);t&&l(t),n.classList.contains("actionbar--sticky")&&i()}u()},t.Intellum.util.ready(n)}(window.document,window,$),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll(".button[data-behavior]")).forEach(function(e){new t.Intellum.button(e)})}t.Intellum=t.Intellum||{},t.Intellum.button=function(t){function n(){var n=e.getElementById(t.dataset.formFor),i=n.querySelectorAll("input:not([type=hidden]), textarea, input[type=hidden][required]"),r=n.querySelectorAll("*[required]"),o=function(e){var t;return"radio"===e.getAttribute("type")?(t=n.querySelectorAll('[name="'+e.getAttribute("name")+'"]'),Array.prototype.slice.call(t).some(function(e){return e.checked})):"checkbox"===e.getAttribute("type")?e.checked:!!e.value},a=function(){var e;r&&r.length?(e=!0,Array.prototype.slice.call(r).some(function(t){if(!o(t))return void(e=!1)})):(e=!1,Array.prototype.slice.call(i).some(function(t){if(o(t))return void(e=!0)})),e?t.removeAttribute("disabled"):t.setAttribute("disabled","true")};n&&(a(),Array.prototype.slice.call(i).forEach(function(e){"checkbox"===e.getAttribute("type")||"radio"===e.getAttribute("type")||"hidden"===e.getAttribute("type")?e.addEventListener("change",function(){a()}):e.addEventListener("input",function(){a()})}))}function i(){"button.enable"===t.dataset.behavior&&n()}i()},t.Intellum.util.ready(n)}(window.document,window,$),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll("*[data-behavior=checkall]")).forEach(function(e){new t.Intellum.checkall(e)})}t.Intellum=t.Intellum||{},t.Intellum.checkall=function(t){function n(){t.addEventListener("change",function(){var n=e.querySelectorAll("input[name="+i+"]");Array.prototype.slice.call(n).forEach(function(e){e.checked=t.checked})})}var i=t.dataset.checkallName.replace("[","\\[").replace("]","\\]");n()},t.Intellum.util.ready(n)}(window.document,window,$),function(){var e=function(){var e=document.querySelectorAll("[data-copy-to-clipboard]");new ClipboardJS(e).on("success",function(e){Intellum.flashnotice.show(e.trigger.getAttribute("data-clipboard-success-message")),e.clearSelection()})};window.Intellum.util&&(window.Intellum.util.ready(e),window.Intellum.util.reinitialize&&window.Intellum.util.reinitialize.register(e))}(),function(e,t){"use strict";var n="collapsible--collapsed",i="data-collapsed";t.Intellum=t.Intellum||{},t.Intellum.collapsible=function(){var t=function(e){var t=e.scrollHeight,i=e.style.transition;e.style.transition="",requestAnimationFrame(function(){e.style.height=t+"px",e.style.transition=i,requestAnimationFrame(function(){e.style.height="0px",e.classList.add(n),e.setAttribute("aria-hidden","true")})})},r=function(e){var t=e.scrollHeight,i=function(e){e.currentTarget.removeEventListener("transitionend",i),e.currentTarget.style.height=null};e.style.height=t+"px",e.classList.remove(n),e.removeAttribute("aria-hidden"),e.addEventListener("transitionend",i)},o=function(e,t){var n="exceed_collapsed",i=Cookies.getJSON(n)||{},t=t?1:0;i[e]=t,Cookies.set(n,i,{expires:365})},a=function(a){var s=a.currentTarget,l=e.getElementById(s.getAttribute("data-collapse-target")),u=s.getAttribute("data-collapse-save-key");a.preventDefault(),l&&(l.classList.contains(n)?(s.removeAttribute(i),s.setAttribute("aria-expanded","true"),r(l)):(s.setAttribute(i,"true"),s.setAttribute("aria-expanded","false"),t(l)),u&&o(u,s.hasAttribute(i)))};return{init:function(){Array.prototype.slice.call(e.querySelectorAll('[data-behavior="toggle.collapsible"][data-collapse-target]:not([data-intelluminitialized])')).forEach(function(e){e.addEventListener("click",a),e.setAttribute("data-intelluminitialized","true")})},expand:r,collapse:t}}(),t.Intellum.util.ready(t.Intellum.collapsible.init),t.Intellum.util.reinitialize.register(t.Intellum.collapsible.init)}(window.document,window),function(e,t,n){"use strict";t.Intellum=t.Intellum||{},t.Intellum.coursepictureupdater=function(i){var r,o=i.querySelector(".uploadfile"),a=i.querySelector(".coursepictureupdater__filepathinput"),s=e.getElementById(i.getAttribute("data-dialog-id")),l=i.querySelectorAll(".updateableimage"),u=e.querySelectorAll('[data-updater-id="'+i.getAttribute("id")+'"]'),c=e.getElementById(i.getAttribute("data-dependent-updater-id")),d=i.getAttribute("data-course-id"),f=i.getAttribute("data-art-type"),p=i.getAttribute("data-art-format"),h=function(e,n,i){e.length&&Array.prototype.forEach.call(e,function(e){e.dispatchEvent(new t.CustomEvent("update",{detail:{status:n,imagePath:i}}))})},m=function(e){h(u,"removing","");var t={course:{}};t.course[r.requestPictureKey]={_destroy:1,id:i.getAttribute("data-resource-id")},n.ajax({url:"/public_courses/"+d,type:"PUT",dataType:"json",data:t,success:function(){y(!0),h(u,"none",""),e&&location.reload()}})},g=function(){h(u,"saving",a.value);var t={course:{}};t.course[r.requestPictureKey]={},t.course[r.requestPictureKey][r.targetKey]=a.value,"mobile_target"===r.targetKey&&(t.course.hero_picture_attributes.target=e.getElementById("public_course_curriculum_desktop_hero_path").value),n.ajax({url:"/public_courses/"+d,type:"PUT",dataType:"json",data:t,success:function(){h(u,"saved"),y(!1)},error:function(){h(u,"none",""),o.dispatchEvent(new CustomEvent("error"))}})},v=function(){o.addEventListener("uploadfile.start",function(){h(l,"uploading","")}),o.addEventListener("uploadfile.removed",function(){m()}),o.addEventListener("uploadfile.complete",function(){g()})},y=function(e){c&&c.dispatchEvent(new t.CustomEvent("coursepictureupdater.setdisabled",{detail:{isDisabled:e}}))},b=function(e){var t=o.querySelector(".uploadfile__choosebtn"),n=o.querySelector(".uploadfile__input");e?(t.setAttribute("disabled","true"),n.setAttribute("disabled","true"),i.setAttribute("data-disabled","true")):(t.removeAttribute("disabled"),n.removeAttribute("disabled"),i.removeAttribute("data-disabled"))};"coverart"===f?r={requestPictureKey:"picture_attributes",responsePictureKey:"picture",destinationFolder:"resource_course_pictures",targetKey:"target",targetSize:"full_size",fileNameKey:"target_file_name"}:"hero"===f&&(r={requestPictureKey:"hero_picture_attributes",responsePictureKey:"hero_picture",destinationFolder:"resource_hero_pictures",targetKey:"target",targetSize:"google_full",fileNameKey:"target_file_name"},"mobile"===p&&(r.targetKey="mobile_target",r.targetSize="full",r.fileNameKey="mobile_target_file_name")),r&&v(),i.getAttribute("data-disabled")&&b(!0),i.addEventListener("coursepictureupdater.setdisabled",function(e){b(e.detail.isDisabled)}),s&&s.addEventListener("hide.dialog",function(){o.dispatchEvent(new CustomEvent("reset"))}),i.querySelector(".coursepictureupdater__deleteallbutton")&&i.querySelector(".coursepictureupdater__deleteallbutton").addEventListener("click",function(e){e.preventDefault(),h(s.querySelectorAll(".updateableimage"),"removing",""),m(!0)})};var i=function(){Array.prototype.slice.call(e.querySelectorAll(".coursepictureupdater")).forEach(function(e){new t.Intellum.coursepictureupdater(e)})};t.Intellum.util.ready(i)}(window.document,window,jQuery),function(e,t){"use strict";function n(e){return e<10?"0"+e:e}function i(e){return e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())}function r(e){var t=+e.substring(5,7)-1;return new Date(+e.substring(0,4),t,+e.substring(8,10))}function o(){function n(n){var i=n.hasAttribute("id")?"datepicker-instructions-"+n.id:"datepicker-instructions",r=t.Intellum.i18nStrings&&t.Intellum.i18nStrings.when_datepicket_widget_appears?t.Intellum.i18nStrings.when_datepicket_widget_appears:"When the datepicker widget appears, use arrow keys to navigate dates and select a date.",o=e.createElement("p");o.setAttribute("class","a11y-atonly"),o.setAttribute("id",i),o.innerText=r,n.parentNode.insertBefore(o,n),n.setAttribute("aria-describedby",o.id)}a=e.getElementsByTagName("html")[0].getAttribute("lang")||t.navigator.language||"en",t.Pikaday&&(t.Pikaday.prototype.toString=function(){return i(this._d)}),Array.prototype.slice.call(e.querySelectorAll('input[data-behavior~="show.datepicker"]:not([data-intelluminitialized])')).forEach(function(e){new t.Intellum.datepicker(e),n(e)})}var a,s={previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};t.Intellum=t.Intellum||{},t.Intellum.datepicker=function(n){function o(){var t=d.getDate();if(n.getAttribute("data-datepicker-use-locale")?n.value=t.toLocaleDateString(a):n.value=i(t),n.dispatchEvent(new CustomEvent("input")),n.getAttribute("data-datepicker-range-start-for")){var r=e.getElementById(n.getAttribute("data-datepicker-range-start-for"));r&&r.dispatchEvent(new CustomEvent("setMinDate",{detail:{minDate:t}}))}}function l(){var t=350,i=e.body.scrollHeight-n.offsetTop,r=e.getElementById("main");i=0&&(h=n.parentElement),d=new t.Pikaday({defaultDate:p,setDefaultDate:!0,field:n,i18n:t.Intellum.datepickerI18n||JSON.parse(n.getAttribute("data-datepicker-i18n"))||s,theme:"datepicker",container:h,onSelect:o,onOpen:u,onDraw:c,parse:function(e){var t,n=/^\d{4}-\d{2}-\d{2}$/;if(e.match(n)){var i=e.split("-");t=new Date(i[0],i[1]-1,i[2])}return t}}),n.addEventListener("setMinDate",function(e){e.detail&&e.detail.minDate&&(d.setDate(0,!1),d.gotoMonth(e.detail.minDate.getMonth()),d.setMinDate(e.detail.minDate))}),l(),n.setAttribute("autocomplete","off"),n.setAttribute("data-intelluminitialized",!0)}},t.Intellum.util.ready(o),t.Intellum.util.reinitialize.register(o)}(window.document,window),function(e,t){"use strict";function n(){function n(n){var i=n.currentTarget,r=i.getAttribute("data-dialog-id"),o=e.getElementById(r);o&&o.dispatchEvent(new t.CustomEvent("show.dialog",{detail:{url:i.getAttribute("data-dialog-url"),trigger:i}}))}Array.prototype.slice.call(e.querySelectorAll(".dialog:not([data-intelluminitialized])")).forEach(function(e){e.setAttribute("data-intelluminitialized",!0),new t.Intellum.dialog(e)}),Array.prototype.slice.call(e.querySelectorAll('[data-behavior~="show.dialog"][data-dialog-id]:not([data-intelluminitialized])')).forEach(function(e){e.setAttribute("data-intelluminitialized",!0),e.addEventListener("click",n),e.addEventListener("keydown",function(e){"Enter"===e.key&&n(e)})})}t.Intellum=t.Intellum||{},t.Intellum.dialog=function(n){function i(e){if(e&&e.detail&&e.detail.url&&(n.getAttribute("data-ignore-cache")||!n.hasAttribute("data-current-content")||n.getAttribute("data-current-content")!=e.detail.url))if(n.hasAttribute("data-current-content")&&f&&(f.innerHtml=p),n.hasAttribute("data-no-jquery")){var t=new XMLHttpRequest;t.open("GET",e.detail.url,!0),t.onload=function(){t.status>=200&&t.status<400&&(f&&(f.innerHTML=t.response),n.setAttribute("data-current-content",e.detail.url),o())},t.send()}else f&&"object"!=typeof Prototype&&$(f).load(e.detail.url,function(){n.setAttribute("data-current-content",e.detail.url),o(e.detail)});else e&&e.detail&&e.detail.content?(f.innerHTML=e.detail.content,o(e.detail)):e&&e.detail&&(r(),o(e.detail));r(),s(!0),Intellum.util.resized.addHandler(s)}function r(){-1===n.className.indexOf("dialog--visible")&&(e.body.classList.add("dialog__documentbody--noscroll"),n.classList.add("dialog--previsible"),n.offsetWidth,n.classList.add("dialog--visible")),n.setAttribute("aria-hidden","false")}function o(e){e=e||{},s(),e.dialogElement=n;var i=new t.CustomEvent("rendered.dialog",{detail:e});n.dispatchEvent(i),t.dispatchEvent(i),t.Intellum.a11y.trapFocus(n,null,a)}function a(){n.hasAttribute("data-dialog-noesc")||n.dispatchEvent(new CustomEvent("hide.dialog"))}function s(e){var i=n.querySelector(".dialog__contentbody--fixedheight");i?i.style.maxHeight=t.innerHeight-200+"px":t.innerHeightt.innerWidth&&(i.classList.contains("hint--top")?i.classList.add("hint--top-left"):i.classList.contains("hint--bottom")&&i.classList.add("hint--bottom-left"));var d=function(e){if(27===(e.which||e.keyCode))return p(e),e.preventDefault(),e.stopPropagation(),!1},f=function(){r.addEventListener("keydown",d)},p=function(e){e&&("blur"==e.type?r.classList.remove("hint--hide"):"keydown"==e.type&&r.classList.add("hint--hide")),r.removeEventListener("keydown",d)},h=function(){r.hasAttribute("data-hide-hint-on-click")&&("_blank"==r.getAttribute("target")?r.blur():r.getAttribute("href")&&!r.getAttribute("href").length||(r.classList.add("hint--hide"),r.addEventListener("mouseleave",function(){r.classList.remove("hint--hide")})))};r.addEventListener("focus",f),r.addEventListener("mouseenter",f),r.addEventListener("blur",p),r.addEventListener("mouseleave",p),r.addEventListener("show.hint",f),r.addEventListener("click",h)}};var i=function(){Array.prototype.slice.call(e.querySelectorAll("[data-hint]")).forEach(function(e){new t.Intellum.hint(e)})};t.Intellum.util&&(t.Intellum.util.ready(i),t.Intellum.util.reinitialize&&t.Intellum.util.reinitialize.register(i))}(window.document,window),function(e,t,n){"use strict";function i(){Array.prototype.slice.call(e.querySelectorAll("*[data-behavior=infinitescroll]")).forEach(function(e){new t.Intellum.infinitescroll(e)})}t.Intellum=t.Intellum||{},t.Intellum.infinitescroll=function(i){function r(){var e=p.hasAttribute("href")?p.getAttribute("href"):p.querySelector("[href]").getAttribute("href");v||(v=!0,o(),n.get(e,function(e){a(e),s(),c(),l(),Intellum.util&&Intellum.util.reinitialize&&Intellum.util.reinitialize.trigger(),v=!1}))}function o(){var e=p.getAttribute("data-infinitescroll-loading-text")||t.Intellum.i18nStrings.loading||"Loading";p.innerHTML=e+' ',p.setAttribute("role","alert")}function a(t){var t=e.createRange().createContextualFragment(t),n=t.querySelector(g),r=t.querySelector(m);r?r.hasAttribute("data-append-dependent-nodes")?h.insertAdjacentHTML("beforeEnd",r.innerHTML):(t=e.createRange().createContextualFragment(r.innerHTML),h.appendChild(t)):h.appendChild(t),n&&h.parentNode.appendChild(n),i.getAttribute("data-infinitescroll-lazy-loaded-images")&&Intellum.lazyload&&Intellum.lazyload.observe()}function s(){f.unobserve(p),p.parentNode.removeChild(p)}function l(){i.dispatchEvent(new CustomEvent("infinitescroll.loadednext"))}function u(e){e.forEach(function(e){e.isIntersecting&&r()})}function c(){(p=i.querySelector(g))&&(p.addEventListener("click",function(e){e.preventDefault(),r()}),f.observe(p))}function d(){(h=i.querySelector(m))||(h=i);var t={rootMargin:"0px 0px 150px 0px",threshold:.5};i.dataset.scrollerEl&&(t.root=e.getElementById(i.dataset.infinitescrollScrollerEl)),f=new IntersectionObserver(u,t),f.POLL_INTERVAL=100,c(),i.addEventListener("infinitescroll.ready",c)}var f,p,h,m="[data-infinitescroll-content-wrapper]",g="[data-infinitescroll-next=true]",v=!1;d()},t.Intellum.util.ready(i)}(window.document,window,$),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll(".levelbadge")).forEach(function(e){new t.Intellum.levelbadge(e)})}t.Intellum=t.Intellum||{},t.Intellum.levelbadge=function(t){var n=e.getElementById("levelbadge-dialog"),i=function(){["name","description","date"].forEach(function(n){e.getElementById("badge-dialog-"+n).innerHTML=t.getAttribute("data-badge-"+n)}),t.getAttribute("data-badge-imgsrc").length&&(e.getElementById("badge-dialog-img").innerHTML='')},r=function(){Array.prototype.slice.call(n.querySelectorAll(".levelbadge__dialog > *")).forEach(function(e){e.innerHTML=""})};!function(){n&&(t.addEventListener("click",function(e){i(),n.dispatchEvent(new CustomEvent("show.dialog",{detail:{trigger:e.target.id}}))}),n.addEventListener("hide.dialog",function(){r()}))}()},t.Intellum.util.ready(n)}(window.document,window),function(e,t){"use strict";var n=function(){var t=Array.prototype.slice.call(e.querySelectorAll('[data-behavior="locale.change"]')),n=!1;t&&t.forEach(function(e){e.addEventListener("change",function(e){n||(n=!0,location.href=e.target.value)})})};t.Intellum.util.ready(n)}(window.document,window),function(e,t){"use strict";var n="exceed_page_state";t.Intellum=t.Intellum||{},t.Intellum.pagestate=function(){var i={"scroll.y":{getScrollElement:function(){return e.querySelector("[data-scroll-y-state]")},getState:function(){var n=this.getScrollElement();return n?n.scrollTop:t.scrollY||e.body.scrollTop},restoreState:function(e){var n=this.getScrollElement();n?n.scrollTop=e:t.scroll(0,e)}}},r=function(){var e=sessionStorage.getItem(n);if(e)try{e=JSON.parse(e)}catch(t){e=!1}return e},o=function(){sessionStorage.removeItem(n)},a=function(e){var t=r(),n=location.pathname+location.search;t&&t[n]&&e.forEach(function(e){var r=t[n][e];r&&i[e]&&i[e].restoreState(r)})},s=function(e){var t=r()||{},o={},a=location.pathname+location.search;e.forEach(function(e){i[e]&&(o[e]=i[e].getState())}),t[a]=o,sessionStorage.setItem(n,JSON.stringify(t))},l=function(e){t.addEventListener("pagehide",function(){s(e)})},u=function(){var e="t";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}};return{init:function(){var t,n,i=e.getElementById("main");i&&u()&&(t=i.getAttribute("data-save-state"),n=i.hasAttribute("data-reset-state"),t&&(t=t.split(" "),a(t,n),l(t),i.setAttribute("data-state-restored","true")),n&&o())}}}(),t.Intellum.util.ready(t.Intellum.pagestate.init)}(window.document,window),function(e,t){"use strict";function n(){var t=new Date;t.setDate(t.getDate()+5),t.toUTCString(),e.cookie="exceedlms-path-"+s.dataset.curriculumEnrollmentId+"-state-cookie=1; expires="+t+"; path=/"}function i(){e.cookie="exceedlms-path-"+s.dataset.curriculumEnrollmentId+"-state-cookie=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/"}function r(){o&&s&&(t.innerWidthl&&(o.classList.contains("pathdrawer__btn--active")?i():n())}),a.addEventListener("click",function(){o.classList.remove("pathdrawer__btn--active"),i()}))}var o=e.getElementById("pathdrawer-trigger"),a=e.getElementById("pathdrawer-close"),s=e.getElementById("pathdrawer"),l=420;t.Intellum.util.ready(r)}(window.document,window,$),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.pgmedia=function(){var t=function(e,t){e.offsetHeight0?t(n,e):n.onload=function(){t(n,e)})}})}}}(),Intellum.util.ready(function(){t.Intellum.pgmedia.init()}),Intellum.util.resized.addHandler(t.Intellum.pgmedia.init)}(window.document,window),function(e,t,n){"use strict";function i(e){Array.prototype.slice.call(e.querySelectorAll("*[data-rating=true]")).forEach(function(e){new t.Intellum.rating(e)})}function r(){i(e),t.addEventListener("rendered.dialog",function(e){e.detail&&e.detail.dialogElement&&i(e.detail.dialogElement)})}t.Intellum=t.Intellum||{},t.Intellum.rating=function(t){function i(e){e.preventDefault(),a(e),l(e)}function r(e){"Enter"==e.key&&i(e)}function o(e){if(e.relatedTarget&&"review[stars]"!=e.relatedTarget.getAttribute("name")){var n=t.querySelector('[name="review[stars]"]:checked'),i=n?n.value:0,r=t.getAttribute("data-rating-value")||0;r=parseInt(r),r!=i&&l()}}function a(n){var i="keydown"==n.type?n.target:e.getElementById(n.currentTarget.htmlFor),r=n.currentTarget.getAttribute("data-linked-star"),o=e.getElementById(r);s(),i.setAttribute("checked","checked"),o&&o.setAttribute("checked","checked"),t.setAttribute(p,!0)}function s(){Array.prototype.slice.call(e.querySelectorAll("[data-review-enabled] input[type=radio][checked]")).forEach(function(e){e.removeAttribute("checked")})}function l(e){n.ajax({type:"post",url:t.getAttribute("action"),data:n(t).serializeArray(),success:function(t){c({content:t,trigger:e.target})}})}function u(){var e=t.querySelector("fieldset.rating__fieldset");e&&e.addEventListener("keydown",r),Array.prototype.slice.call(t.querySelectorAll('[data-behavior~="submit.rating"]')).forEach(function(e){e.addEventListener("click",i)}),Array.prototype.slice.call(t.querySelectorAll('[name="review[stars]"]')).forEach(function(e){e.addEventListener("blur",o)})}function c(n){var i=t.getAttribute("data-dialog-id");i&&e.getElementById(i).dispatchEvent(new CustomEvent("show.dialog",{detail:n}))}function d(){t.classList.remove("rating--disabled"),t.setAttribute(h,!0),t.setAttribute("data-review-enabled",!0),t.setAttribute("data-hint",t.getAttribute("data-hint-when-complete")),t.dispatchEvent(new CustomEvent("show.hint")),t.classList.add("hint--active"),Array.prototype.slice.call(t.querySelectorAll('input[type="radio"]')).forEach(function(e){e.removeAttribute("checked"),e.removeAttribute("disabled"),e.removeAttribute("aria-hidden")}),u()}function f(){"true"===t.getAttribute(h)?u():t.addEventListener("click",function(n){var i={url:t.getAttribute("data-dialog-url")},r=n.target;"INPUT"==r.tagName&&r.className.includes("rating__submit")&&(i.trigger=e.activeElement),c(i)}),t.addEventListener("enable.rating",d)}var p="data-student-reviewed",h="data-rating-enabled";f()},t.Intellum.util.ready(r)}(window.document,window,$),function(e,t,n){"use strict";t.Intellum=t.Intellum||{},t.Intellum.reviews=function(){function i(t){t.preventDefault();var i=t.target.getAttribute("data-review-id"),o=e.getElementById("review_form_"+i);o&&n.ajax({type:"post",url:o.getAttribute("action"),data:n(o).serializeArray(),success:function(e){r(o,e)}})}function r(e,t){e.parentElement.outerHTML=t,c(),s()}function o(t){t.preventDefault();var n=t.currentTarget.getAttribute("data-review-id");e.getElementById("review_"+n).classList.add("review--hidden"),Array.prototype.slice.call(e.getElementById("review_"+n).querySelectorAll("button")).forEach(function(e){e.classList.add("hidden")}),e.getElementById("review_form_"+n).classList.remove("review--hidden"),Array.prototype.slice.call(e.getElementById("review_form_"+n).querySelectorAll(".hidden")).forEach(function(e){e.classList.remove("hidden")}),s()}function a(t){t.preventDefault();var i=t.currentTarget.getAttribute("data-review-id");n.ajax({type:"delete",url:t.currentTarget.getAttribute("data-action"),data:n(m).serializeArray(),success:function(){var t=e.getElementById("review_"+i);t.parentElement.outerHTML="",t.matches("[data-close-dialog-on-delete]")&&m.dispatchEvent(new CustomEvent("hide.dialog"))}})}function s(){Intellum.a11y.releaseFocus(),Intellum.a11y.trapFocus(m,null,function(){m.dispatchEvent(new CustomEvent("hide.dialog"))})}function l(t){var n=t.currentTarget,i=e.getElementById("review_submit");n.value.length>0?i.removeAttribute("disabled"):i.setAttribute("disabled",!0)}function u(){var e=m.querySelector("#review_body:not(["+w+"])");e&&(e.addEventListener("input",l),e.setAttribute(w,"true"))}function c(){Array.prototype.slice.call(m.querySelectorAll('[data-behavior~="submit.review"]:not(['+w+"])")).forEach(function(e){e.addEventListener("click",i),e.setAttribute(w,"true")}),Array.prototype.slice.call(m.querySelectorAll('[data-behavior~="edit.review"]')).forEach(function(e){e.addEventListener("click",o),e.setAttribute(w,"true")}),Array.prototype.slice.call(m.querySelectorAll('[data-behavior~="delete.review"]')).forEach(function(e){e.addEventListener("click",a),e.setAttribute(w,"true")}),u()}function d(){g=m.querySelector("*[data-behavior=infinitescroll]"),new t.Intellum.infinitescroll(g),g.dispatchEvent(new CustomEvent("infinitescroll.ready")),g.addEventListener("infinitescroll.loadednext",c)}function f(){b&&m.addEventListener("hide.dialog",p)}function p(){n.get(b.getAttribute("data-rating-url"),function(n){var i=e.createRange().createContextualFragment(n);b.innerHTML=i.childNodes[0].innerHTML,new t.Intellum.rating(b.querySelector(".rating")),m.removeEventListener("hide.dialog",p),t.Intellum.util.reinitialize.trigger(),v&&v.id?(v=b.querySelector("#"+v.id),v.focus()):(v=b.querySelector("#update-review-trigger"))&&v.focus()})}function h(){t.addEventListener("rendered.dialog",function(t){t.detail&&t.detail.dialogElement&&t.detail.dialogElement.hasAttribute("data-reviews")&&(m=t.detail.dialogElement,v=t.detail.trigger,v&&v.classList.add("a11y-hidefocus"),y=m.getAttribute("data-summary-ratings-id"),b=e.getElementById(y||null),d(),c(),f())})}var m,g,v,y,b,w="data-intelluminitialized";return{initModule:h}}(),t.Intellum.util.ready(Intellum.reviews.initModule)}(window.document,window,$),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll(".sidemenu")).forEach(function(e){i.push(e),new t.Intellum.sidemenu(e)}),Array.prototype.slice.call(e.querySelectorAll('[data-behavior~="toggle.sidemenu"][data-sidemenu-id]')).forEach(function(n){r.push(n),n.setAttribute("aria-pressed","false");var i=n.getAttribute("data-sidemenu-id"),o=e.getElementById(i);o&&(n.setAttribute("aria-controls",i),n.addEventListener("click",function(){o.dispatchEvent(new t.CustomEvent("toggle.sidemenu"))}))}),e.addEventListener("click",function(n){for(var r=null,o=n.target;!r&&o&&o!==e.body&&o!==e;)o.hasAttribute("data-sidemenu-id")?r=e.getElementById(o.getAttribute("data-sidemenu-id")):o.className&&o.className.indexOf&&o.className.match(/(^|\s)sidemenu($|\s)/)&&(r=o),o=o.parentNode;i.forEach(function(e){e!==r&&e.dispatchEvent(new t.CustomEvent("collapse.sidemenu"))})})}t.Intellum=t.Intellum||{};var i=[],r=[];t.Intellum.sidemenu=function(n){function i(){-1===n.className.indexOf("sidemenu--expanded")&&(n.className+=" sidemenu--expanded"),n.setAttribute("aria-expanded","true"),d&&(d.scrollTop=0),a(n.id,"true")}function o(){n.className=n.className.replace(" sidemenu--expanded",""),n.setAttribute("aria-expanded","false"),a(n.id,"false")}function a(e,t){r.forEach(function(n){n.getAttribute("data-sidemenu-id")==e&&n.setAttribute("aria-pressed",t)})}function s(){-1===n.className.indexOf("sidemenu--expanded")?n.dispatchEvent(new t.CustomEvent("expand.sidemenu")):n.dispatchEvent(new t.CustomEvent("collapse.sidemenu"))}function l(){f=null,n.dispatchEvent(new t.CustomEvent("scrollend.sidemenu"))}function u(){f?t.clearTimeout(f):n.dispatchEvent(new t.CustomEvent("scrollstart.sidemenu")),f=t.setTimeout(l,2e3)}function c(){n.addEventListener("expand.sidemenu",i),n.addEventListener("collapse.sidemenu",o),n.addEventListener("toggle.sidemenu",s),n.onexpand=i,n.oncollapse=o,n.ontoggle=s,d&&d.addEventListener("scroll",t.Intellum.util.throttle(u,100)),n.setAttribute("aria-expanded","false")}var d=n.querySelector(".sidemenu__list"),f=null;e.getElementsByClassName("header__titlelink")[0];c()},t.Intellum.util.ready(n)}(window.document,window),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll(".studentform")).forEach(function(e){new t.Intellum.studentform(e)})}t.Intellum=t.Intellum||{},t.Intellum.studentform=function(e){function t(){Array.prototype.slice.call(e.querySelectorAll("*[data-invalid-text]")).forEach(function(e){e.getAttribute("data-invalid-text").length&&(e.addEventListener("invalid",function(e){e.target.setCustomValidity(e.target.getAttribute("data-invalid-text"))}),e.addEventListener("input",function(e){e.target.setCustomValidity("")}))})}t()},t.Intellum.util.ready(n),t.Intellum.util.reinitialize.register(n)}(window.document,window),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.topicpicker=function(n){var i,r,o,a,s,l,u,c,d,f,p,h,m,g,v,y,b,w,_,E,x,k=function(t){t==undefined&&(t="topic-onboarding-dialog"),null!=(i=e.getElementById(t))&&(r="topic-onboarding-dialog"==t,o="topic-following-dialog"==t,a=n("#topics-suggested-container"),s=n("#topics-suggested-list"),u=n("#topics-selected-list"),c=n("#topics-save"),l=n("#followed_topic_ids"),h=n("#display-all-topics"),d=!1,f=!1,p=n(o?"#following-topics-modal":"#onboarding-topics-modal"),E=n("#new_evaluation").length>0,x=n("#onboarding-loading-modal"),m=[],g=[],v=[],b=i.getAttribute("data-user-id"),w="true"==i.getAttribute("data-is-catcat"),_="
"+Intellum.i18nStrings.loading+"
",N(),D(),L(),F(),r?(A(),setTimeout(function(){"false"!=Cookies.get("topic_onboarding")&&i.dispatchEvent(new CustomEvent("show.dialog",{detail:{trigger:null}}))})):o&&I())},A=function(){C(),q()},I=function(){n.get("/category_follows/").done(function(e){S(e)}).fail(function(){})},S=function(e){if(m=e.all_topics||[],g=e.suggested_topics||[],v=e.followed_topics||[],y=e.locked_topics||[],o){var t=v.filter(function(e,t,n){return n.map(function(e){return e.id}).indexOf(e.id)==t});M(t,!1,[],!0),T()}else{if(!m.concat(v).length)return void i.dispatchEvent(new CustomEvent("hide.dialog"));var t=v.concat(g).filter(function(e,t,n){return n.map(function(e){return e.id}).indexOf(e.id)==t});t.forEach(j),M(m,!0,t),r&&!t.length&&c.attr("disabled","disabled"),T()}},C=function(){p.hide(),c.hide(),x.show()},T=function(){p.show(),x.hide(),a.innerHeight()+15>=a[0].scrollHeight?h.remove():h.removeAttr("disabled"),c.show()},D=function(){h.on("click",function(){i.dispatchEvent(new t.CustomEvent("expand.dialog")),a.addClass("topicpicker__choices--expanded"),h.remove()})},L=function(){c.on("click",function(){var e=u.find("[data-topic-id]").map(function(e,t){return n(t).data("topicId")}).toArray();l.val(e);l.html();c.html(_)})},N=function(){s.on("click",".topicpicker__listitem",function(e){var t=n(e.target).data();n(e.target).hasClass("tagbutton--locked")||(n(e.target).hasClass("tagbutton--selected")?O({id:t.topicId,name:t.topicTitle}):j({id:t.topicId,name:t.topicTitle}))})},q=function(){var e="/category_follows?suggested=true";r&&(e+="&topic_onboarding=true"),n.get(e).done(function(e){S(e)}).fail(function(){R()})},M=function(e,t,n,r){n=n||[];var o="";t?(n.forEach(function(e){o+=P(e,!0)}),e.forEach(function(e){n.find(function(t){return t.id==e.id})||(o+=P(e,!1))})):e.forEach(function(e){o+=r?H(e):P(e,!1)}),s.html(o),Intellum.a11y.releaseFocus(),Intellum.a11y.trapFocus(i,null,function(){i.dispatchEvent(new CustomEvent("hide.dialog"))})},j=function(e){var t=s.find('[data-topic-id="'+e.id+'"]');t.addClass("tagbutton--selected"),t.attr("aria-pressed","true"),u.find(".tagbutton").length||u.html(""),u.append(P(e,!0,!0)),c.removeAttr("disabled")},O=function(e){u.find('[data-topic-id="'+e.id+'"]').remove(),u.find("[data-topic-id]").length<1&&R(),s.find('[data-topic-id="'+e.id+'"]').removeClass("tagbutton--selected").attr("aria-pressed","false")},R=function(){var e='
';e+="

"+Intellum.i18nStrings.topicsFollowedSelectionEmpty+"

",e+="
",u.html(e),r&&c.attr("disabled","disabled")},P=function(e,t,n){var i,r="tagbutton",o=n?" disabled":"",a=e.name,s="";return e.parent&&(a=e.parent.name+" > "+a),y&&y.indexOf(e.id)>-1?(r+=" tagbutton--locked hint hint--top",s=' data-hint="Topic cannot be unfollowed" '):t&&(r+=" tagbutton--selected"),i='
  • "},H=function(e){var t,n=e.name;return e.parent&&(n=e.parent.name+" > "+n),t='
  • ',t+='',t+=n,t+="
  • "},F=function(){i.addEventListener("hide.dialog",function(){if(r){var e=new Date((new Date).getTime()+6e4);Cookies.set("topic_onboarding",!1,{expires:e}),n.post("/student/users/"+b+"/mark_as_topic_onboarded/"),i.querySelector(".dialog__content").innerHTML=""}})};return{init:k}}(jQuery),Intellum.util.ready(t.Intellum.topicpicker.init)}(window.document,window),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll('[data-behavior="limit.touchscroll"]')).forEach(function(e){new t.Intellum.touchscroll(e)})}t.Intellum=t.Intellum||{},t.Intellum.util=t.Intellum.util||{},t.Intellum.touchscroll=function(e){var t=function(t){var n=e.scrollWidth-e.offsetWidth;(e.scrollLeft+t.deltaX<0||e.scrollLeft+t.deltaX>n)&&(t.preventDefault(),e.scrollLeft=Math.max(0,Math.min(n,e.scrollLeft+t.deltaX)))};!function(){e.addEventListener("wheel",function(e){t(e)})}()},t.Intellum.util.ready(n)}(window.document,window),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll(".tabs--tabsets")).forEach(function(e){new t.Intellum.tabsets(e)})}t.Intellum=t.Intellum||{},t.Intellum.tabsets=function(t){var n="tabs__tab",i="tabs__tab--selected",r=function(e){Array.prototype.slice.call(t.querySelectorAll("."+n)).forEach(function(t){t==e?(t.classList.add(i),t.setAttribute("aria-selected","true")):(t.classList.remove(i),t.setAttribute("aria-selected","false"))})},o=function(){Array.prototype.slice.call(t.querySelectorAll('[role="tabpanel"]')).forEach(function(e){e.setAttribute("hidden",""),e.setAttribute("aria-expanded","false")})},a=function(t){var n=e.querySelector("#"+t.getAttribute("data-tabcontent"));n&&(n.removeAttribute("hidden"),n.setAttribute("aria-expanded","true"))},s=function(e){e.classList.contains(i)||(r(e),o(),a(e))};!function(){Array.prototype.slice.call(t.querySelectorAll('[role="tab"]')).forEach(function(e){e.addEventListener("click",function(){s(e)})})}()},t.Intellum.util.ready(n)}(window.document,window),function(e,t){"use strict";function n(){Array.prototype.slice.call(e.querySelectorAll('*[data-behavior="show.timepicker"]')).forEach(function(e){new t.Intellum.timepicker(e)})}t.Intellum=t.Intellum||{},t.Intellum.timepicker=function(e){function t(){var t=e.form;t.classList.contains("changed")||t.classList.contains("unchanged"),e.value==e.getAttribute("data-initial-value")?(t.classList.remove("changed"),t.classList.add("unchanged")):(t.classList.remove("unchanged"),t.classList.add("changed"))}function n(){jQuery(e).timepicker({scrollDefault:"now",step:5})}n(),jQuery(e).on("change",t)},t.Intellum.util.ready(n),t.Intellum.util.reinitialize.register(n)}(window.document,window,$),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.truncate=function(){var t=.625,n=function(e,t){Array.prototype.forEach.call(e,function(e){t&&i(e),r(e)})},i=function(e){ var n=o(e),i=getComputedStyle(e),r=i.lineHeight.replace("px",""),l=t*r;null!=n&&(l+=n.offsetWidth,a(n)),e.innerHTML=e.textContent.trim(),null!=n&&s(e,n)},r=function(n){var i,r,u=getComputedStyle(n),c=o(n),d=u.lineHeight.replace("px",""),f=u.maxHeight.replace("px",""),p=t*d,h=Math.ceil(n.getBoundingClientRect().height)+1;if(c!=undefined&&(p+=c.offsetWidth,a(c)),h=h>f?f:h,i=h/d,r=i*d,n.scrollHeight>r+2){var m=d*(i-1),g=e.createElement("div");g.className="truncate__lastline",i>1?g.innerHTML=l(n,m):(g.innerHTML=n.textContent.trim(),n.innerHTML=""),n.appendChild(g),g.style.paddingRight=p+"px";var v=e.createElement("span");v.innerHTML=g.textContent.trim(),v.className="truncate__overflow",v.innerHTML=l(g,d),n.appendChild(v),g.style.paddingRight="0",g.classList.add("truncate__lastline--truncated")}null!=c&&s(n,c)},o=function(e){var t=e.getAttribute("data-decoration");if(null!=t)return e.querySelector("#"+t)},a=function(e){e.parentNode.removeChild(e)},s=function(e,t){e.appendChild(t)},l=function(e,t){for(var n=e.textContent.trim().split(" "),i=n.length-1;i>0&&(e.innerHTML=n.slice(0,i).join(" "),!(parseInt(getComputedStyle(e).height)<=t));i--);return e.innerHTML=" "+e.innerHTML," "+n.slice(i).join(" ")};return{init:function(t){t="object"==typeof t?t:{};var i=!!t.isResize,r=!!t.isFilechange,o="undefined"!=typeof t.scope?t.scope:e,a="undefined"!=typeof t.selector?t.selector:'[data-behavior*="truncate"]';!0===t.isResize?a='[data-behavior="truncate"]':!0===t.isFilechange&&(a='[data-behavior*="truncate"][data-behavior-modifier="onfilechange"]'),n(o.querySelectorAll(a),i||r)}}}(),Intellum.util.ready(function(){t.Intellum.truncate.init()}),Intellum.util.resized.addHandler(function(){t.Intellum.truncate.init({isResize:!0})})}(window.document,window),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.updateableImage=function(e){var t="updateableimage--uploadingstatus",n="updateableimage--generalstatus",i="updateableimage--removingstatus",r={saving:{"class":n,text:Intellum.i18nStrings.saving_ellipsis||"Saving..."},saved:{"class":n,text:Intellum.i18nStrings.saving_ellipsis||"Saving..."},processing:{"class":n,text:Intellum.i18nStrings.processing_ellipsis||"Processing..."},uploading:{"class":t,text:Intellum.i18nStrings.uploading_ellipsis||"Uploading..."},removing:{"class":i,text:Intellum.i18nStrings.removing_ellipsis||"Removing..."},none:{"class":"",text:""}},o=function(){Object.keys(r).map(function(t){var n=r[t]["class"];n.length>0&&e.classList.remove(n)})};e.addEventListener("update",function(t){var n,i,a,s=t.detail.status,l=t.detail.imagePath;o(),s&&r[s]&&(n=r[s]["class"],i=r[s].text,n&&e.classList.add(n),i?e.setAttribute("data-status-text",i):e.setAttribute("data-status-text",""),"saved"===s?setTimeout(function(){o()},3e3):(a="none",l?(a='url("'+l+'")',e.removeAttribute("data-show-default")):e.setAttribute("data-show-default","true"),e.style.backgroundImage=a))})};var n=function(){Array.prototype.slice.call(e.querySelectorAll(".updateableimage")).forEach(function(e){new t.Intellum.updateableImage(e)})};t.Intellum.util.ready(n),t.Intellum.util.reinitialize.register(n)}(window.document,window,jQuery),function(e,t){"use strict";function n(){t.Intellum.updatedrawers={},Array.prototype.slice.call(e.querySelectorAll(".updatedrawer")).forEach(function(e){e.hasAttribute("id")?t.Intellum.updatedrawers[e.id]=new t.Intellum.updatedrawer(e):new t.Intellum.updatedrawer(e)})}t.Intellum=t.Intellum||{},t.Intellum.updatedrawer=function(n){var i,r=!1,o=!1,a=!1,s=!1,l=!1,u=!1,c=function(){var t=new XMLHttpRequest;t.open("POST","/student/user_mentor_cards/mark_all_as_read"),t.setRequestHeader("X-CSRF-Token",e.querySelector('meta[name="csrf-token"]').getAttribute("content")),t.onload=function(){t.status>=200&&t.status<400&&(o=!0)},t.onerror=function(){},t.send()},d=function(t){var n=new XMLHttpRequest;n.open("POST","/student/user_mentor_cards/"+t+"/mark_as_read"),n.setRequestHeader("X-CSRF-Token",e.querySelector('meta[name="csrf-token"]').getAttribute("content")),n.onload=function(){n.status>=200&&n.status<400&&(o=!0)},n.onerror=function(){},n.send()},f=function(t){var n=new XMLHttpRequest;n.open("PUT","/student/user_mentor_cards/"+t),n.setRequestHeader("X-CSRF-Token",e.querySelector('meta[name="csrf-token"]').getAttribute("content")),n.onload=function(){n.status>=200&&n.status},n.onerror=function(){},n.send()},p=function(e){n.contains(e.relatedTarget)||n.classList.add("updatedrawer--hidden")},h=function(e){n.innerHTML=e,l=!0,n.querySelectorAll(".updatecard").forEach(function(e){if(e.hasAttribute("data-id")){var n=e.getAttribute("data-id");e.hasAttribute("href")||e.hasAttribute("data-dialog-url")?(e.addEventListener("click",function(){f(n)}),e.addEventListener("blur",p)):e.querySelectorAll("a[href]").forEach(function(e){e.addEventListener("click",function(){f(n)}),e.addEventListener("blur",p)}),"show.dialog"===e.getAttribute("data-behavior")&&t.Intellum&&t.Intellum.util&&t.Intellum.util.reinitialize&&t.Intellum.util.reinitialize.trigger()}}),o?u=!0:n.classList.contains("updatedrawer--hidden")||c()},m=function(){var t=e.createElement("p"),n=Intellum.i18nStrings.there_was_a_problem_getting_your_updates||"There was a problem in getting your updates.";t.classList.add("updatecards__error"),t.innerHTML=n,h(t.outerHTML)},g=function(){if((!s||o&&!u)&&!a){a=!0;var e=new XMLHttpRequest;e.open("GET","/student/user_mentor_cards"),e.onload=function(){e.status>=200&&e.status<400?(s=!0,a=!1,h(e.responseText)):m()},e.onerror=function(){m()},e.send()}},v=function(){r||(g(),r=!0)},y=function(){n.classList.contains("updatedrawer--hidden")?(n.querySelector(".updatecards")?o?g():c():g(),i.setAttribute("aria-expanded","true")):(o||c(),i.setAttribute("aria-expanded","false")),e.dispatchEvent(new t.CustomEvent("notifications.unreadNumberChange",{detail:{type:"set",value:0}})),n.classList.toggle("updatedrawer--hidden")},b=function(){n.classList.contains("updatedrawer--hidden")&&y()},w=function(){o=!1,a=!1,s=!1,l=!1,u=!1,n.classList.contains("updatedrawer--hidden")?r=!1:g()},_=function(e){if(!n.classList.contains("updatedrawer--hidden")){for(var t=e.target;t!=n&&t!=i&&"BODY"!=t.tagName;)t=t.parentElement;t!=n&&t!=i&&y()}},E=function(){if(null==n)return!1;null!=(i=e.querySelector('[data-behavior="toggle.updatedrawer"][data-updatedrawer-id="'+n.id+'"]'))&&(i.addEventListener("mouseover",v),i.addEventListener("click",y),e.addEventListener("click",_))};return E(),{init:E,postMarkOneRead:d,openUpdatedrawer:b,toggleUpdatedrawer:y,resetOnUnreadNumberChange:w}},t.Intellum.util.ready(n)}(window.document,window),function(e,t,n){"use strict";t.Intellum=t.Intellum||{},t.Intellum.uploadFile=function(e){var i,r,o=n("input",e),a=n(".uploadfile__progress",e),s=n(".uploadfile__progresscontainer",e),l=n(".uploadfile__status",e),u=n(".uploadfile__choosebtn",e),c=n(".uploadfile__cancelbtn",e),d=n(".uploadfile__changebtn",e),f=n(".uploadfile__removebtn",e),p=n("#"+o.data("target")),h=n(".uploadfile__loading",e),m="data-progress-status",g="uploadfile__choosebtn--hidden",v="uploadfile__loading--hidden",y="",b="",w="data-show-remove",_="data-has-file-input-selector",E=e.data("hasManagedPreview");_.length&&(r=o.closest("form").find(e.attr(_)));var x,k,A="gcs"===e.data("provider"),I=function(e){l.text(Intellum.i18nStrings.uploadfile_no_file_selected),u.removeClass(g),f.show(),d.hide(),c.hide(),l.hide(),e&&p.val(""),C(),o.removeAttr("disabled")},S=function(t){t?(f.show(),e.attr(w,"true"),N(!0)):(f.hide(),d.hide(),e.attr(w,"false"),N(!1))},C=function(){s.attr(m,"none"),a.css("width","0")},T=function(t,n){e[0].dispatchEvent(new CustomEvent(t,{detail:n}))},D=function(n){var i=e.data("fileType");i||(0===n.type.indexOf("image")?i="image":0===n.type.indexOf("video")&&(i="video"));var r,o,a=parseFloat(e.data("maxSizeMb")),s=e.data("useCourseFileMaxSize"),l=function(e){switch(e){case"image":case"Image":return/\.(gif|jpe?g|png)$/i;case"video":case"Video":return/\.(avi|flv|m4v|mov|ogg|quicktime|mp4|mpe?g|webm|wmv)$/i;case"caption":case"Caption":return/\.(vtt)$/i;case"audio":case"Audio":return/\.(mp3|ogg|m4a|m4b|oga|wav|wma|flac)$/i;case"Elearning":case"elearning":return/\.(zip|gzip|tar|jar)$/i}};return s?"image"==i?o=t.Intellum.properties.courseContentFileSizeConstraintsInMB.image:"video"==i?o=t.Intellum.properties.courseContentFileSizeConstraintsInMB.video:0===n.type.indexOf("audio")&&(o=t.Intellum.properties.courseContentFileSizeConstraintsInMB.audio):a&&(o=1024*a*1024),r=l(i),r&&!r.test(n.name.toLowerCase())?t.Intellum.i18nStrings.uploadfile_error_format_msg:!!(o&&n.size&&n.size>o)&&(s?t.Intellum.i18nStrings.uploadfile_error_size_coursefile_msg:t.Intellum.i18nStrings.uploadfile_error_size_msg)},L=function(e){var n=e;n&&(n=n.replace("{{FILENAME}}",y));var i=e||t.Intellum.i18nStrings.uploadfile_error_msg;I(!0),l.html(''+i.replace("{{FILENAME}}",""+y+"")+""),C(),l.show(),T("uploadfile.fail",{fileName:y,errorMessage:n})},N=function(e){e?u.text(u.data("replace-text")).removeClass("button--primary").addClass("button--text").addClass("link--primary"):u.text(u.data("choose-text")).addClass("button--primary").removeClass("button--text").removeClass("link--primary")};e.attr("data-intelluminitialized","true"),o.fileupload({autoUpload:!0,replaceFileInput:!1,url:e.data("uploadTo"),type:A?"PUT":"POST",multipart:!A,paramName:"file",fileInput:o,add:function(t,r){var a=o.prop("files"),s=a[0];r.files=a;var l=function(e){e&&o.fileupload("option","url",e),x=r.submit()};y=o.val().split("\\").pop(),b=s.type;var u=D(s);if(u)return void L(u);A?n.getJSON("/gcs_signed_urls/new?name="+encodeURIComponent(y)+"&content_type="+encodeURIComponent(b),function(e){i=e.get_signed_url,l(e.post_signed_url)}).fail(function(){L()}):n.getJSON("/aws_signed_urls/new?file_name="+encodeURIComponent(y)+"&content_type="+encodeURIComponent(b)+"&max_file_size_mb="+encodeURIComponent(e.data("maxSizeMb"))+"&file_type="+encodeURIComponent(e.data("fileType")),function(e){k=JSON.parse(e.data),l(e.signed_url)}).fail(function(e){L(e.responseJSON.errors[0])})},send:function(e,n){l.html(t.Intellum.i18nStrings.uploadfile_uploading_msg.replace("{{FILENAME}}",""+y+"")),s.attr(m,"init"),a.css("width","0"),u.addClass(g),l.show(),f.hide(),c.show(),A&&delete n.headers["Content-Disposition"],T("uploadfile.start",{fileName:y,fileType:b})},fail:function(){L()},progressall:function(e,t){var n=parseInt(t.loaded/t.total*100,10);"init"===s.attr(m)&&s.attr(m,"uploading"),a.css("width",n+"%")},done:function(t,a){C(),l.html(""+y+""),h&&h.removeClass(v),A||(i=n(a.jqXHR.responseXML).find("Location").text()),i=i.replace(/%2F/g,"/"),p.val(i),p[0].dispatchEvent(new CustomEvent("change")),o.attr("disabled","true"),E?(I(!1),N(!0)):(c.hide(),d.show()),e.attr(w,"true"),r&&r.attr("value","true"),T("uploadfile.complete",{path:i,fileName:y,contentType:b})}}),o.bind("fileuploadsubmit",function(e,t){if(A)t.headers={"content-type":b};else{var n=k;n["Content-Type"]=b,t.formData=n}}),c.on("click",function(e){e.preventDefault(),x.abort(),I(!0),T("uploadfile.cancel",{fileName:y})}),d.on("click",function(e){e.preventDefault(),I(!0)}),f.on("click",function(t){t.preventDefault(),T("uploadfile.removed",{path:"",fileName:""}),o.val(""),l.html("").hide(),u.removeClass(g),e.attr(w,"false"),f.hide(),C()}),e.on("reset",function(){I(!0)}),e.on("revert",function(e){S(e.originalEvent.detail.initialImageState)}),e.on("error",function(){L(),N(!1)}),e.on("delete",function(){I(!0),N(!1),p.val("DELETE"),r&&r.attr("value","false")})};var i=function(){n(".uploadfile:not([data-intelluminitialized])").each(function(){new t.Intellum.uploadFile(n(this))})};t.Intellum.util.ready(i),t.Intellum.util.reinitialize.register(i)}(window.document,window,jQuery),function(e,t){"use strict";t.Intellum=t.Intellum||{},t.Intellum.coursesEdit=function(){var t="#course_is_active",n="#confirm-course-inactive-dialog",i="#cancel_active_checkbox",r=function(i){i.target.matches(t)&&!i.target.checked&&e.querySelector(n).dispatchEvent(new CustomEvent("show.dialog"))},o=function(n){n.target.matches(i)&&(e.querySelector(t).checked=!0)};return{init:function(){e.querySelector(t)&&e.querySelector(n)&&e.querySelector(i)&&(e.addEventListener("click",r),e.addEventListener("click",o))}}}(),Intellum.util.ready(t.Intellum.coursesEdit.init)}(window.document,window),function(e,t,n){n(function(){n("#confirm-drop-activity").on("click",function(){var e=n(this).attr("data-confirm-accept");e&&n.ajax({method:"POST",url:e}).done(function(){t.location="/student/home"})})})}(document,window,jQuery),function(e){var t=function(){var t,n=e("#sync-button"),i=e("#syncing-in-progress"),r=e("#syncing-downloading"),o=e("#sync-error"),a=e("#syncing-complete"),s=e('[data-check-sync="true"]'),l=e(".dialog__checksynctext"),u=1==n.data("is-syncing"),c=function(e){n.hide(),a.hide(),i.hide();var t="An unexpected error occurred, please refresh and try again";e.responseJSON&&e.responseJSON.error&&(t=e.responseJSON.error),o.show().text(t)},d=function(){e.get(n.data("evolve-sync-status-url"),function(e){"complete"==e.status?(i.hide(),r.hide(),a.show(),clearInterval(t),window.location.reload()):"downloading"==e.status&&(i.hide(),r.show())}).fail(c)},f=function(){n.hide(),o.hide(),i.show(),e.get(n.data("evolve-sync-url"),function(){t=setInterval(d,3e3)}).fail(c),p(!1)},p=function(t){s.each(function(){e(this).attr("data-behavior",t?"show.dialog":""),e(this).attr("data-dialog-id",t?e(this).attr("data-dialog-string"):""),t?e(this).on("click",!1):e(this).off("click",!1)}),t&&window.Intellum.util.reinitialize.trigger(),l.each(function(){t?e(this).removeClass("a11y-hidden"):e(this).addClass("a11y-hidden")})};return{init:function(){u?(t=setInterval(d,3e3),i.show(),n.hide()):n.length&&e.get(n.data("evolve-sync-required-url"),function(e){e.is_sync_required?(n.is("span")?n.css("display","inline-flex"):n.show().on("click",f),p(!0)):a.show()}).fail(c)}}}();Intellum.util.ready(t.init)}(jQuery),function(e){var t=function(){var t=function(t){var n=t.parents(".dialog");t.length&&(t.on("ajax:send",function(){t.html(window.Intellum.util.templateStrings.loading)}),t.on("ajax:success",function(i,r){t.replaceWith(r),e(".dialog__close",n).on("click",function(t){t.preventDefault(),t.stopPropagation(),location.href=e("#enrolled_participants_okay_button").attr("href")})}))},n=function(t){var n=e("#send_letter_participants_form");t.addEventListener("rendered.dialog",function(){var e=document.querySelectorAll("input[name=enrollment_ids\\[\\]]:checked"),t=[];Array.prototype.slice.call(e).forEach(function(e){t.push(e.value)}),document.getElementById("send_letter_enrollments_list").value=t,document.getElementById("send_letter_recipients_count").innerHTML=t.length}),n.on("ajax:send",function(){n.html(window.Intellum.util.templateStrings.loading)}),n.on("ajax:success",function(e,t){n.html(t)})};return{init:function(){var i=e("#enroll_participants_form"),r=document.getElementById("send_letter_participants_dialog");i.length&&t(i),r&&n(r)}}}();Intellum.util.ready(t.init)}(jQuery),function(e){var t=function(){var t,n,i,r,o=".editcourselist",a="editcourselist--empty",s=function(){(n=document.getElementById("edit-course-container"))&&(r=n.getAttribute("data-course-id"),i=document.querySelector(".coursepage"),l(),d(),p(),m(),g(),v(),y())},l=function(){var e=document.getElementById("edit-path-sortable-sections");Sortable.create(e,{group:"pathSection",handle:".activitysection__movehandle",draggable:".activitysection--editable",dragClass:"activitysection--dragging",ghostClass:"activitysection__droptarget",scroll:i,scrollSensitivity:100,onEnd:function(e){u({sectionEl:e.item,newIndex:e.newIndex,courseId:r})}})},u=function(t){var n={course_id:t.courseId,id:t.sectionEl.getAttribute("data-section-id"),move_to_position:t.newIndex};e.post("/public_curriculum_activities/update_position/",n).done(function(){})},c=function(){Array.prototype.forEach.call(t,function(e){var t=e.querySelectorAll(".editcourselist__item").length;e.setAttribute("data-count",t)})},d=function(){t=document.querySelectorAll(o),t.length&&Array.prototype.forEach.call(t,function(e){c(e),Sortable.create(e,{group:"pathSectionItems",dragClass:"editcourselist__item--dragging",filter:".editcourselist__emptyitem",ghostClass:"editcourselist__item--droptarget",scroll:i,scrollSensitivity:100,onEnd:function(e){var t=e.from;t.querySelectorAll(".editcourselist__item").length||t.classList.add(a),e.to.classList.remove(a),c(),f({activityEl:e.item,newIndex:e.newIndex,newSection:e.to,courseId:r})},onMove:function(t){e.classList.add("editcourselist--moving"),c(),t.related.classList.remove(a)},onStart:function(e){e.clone.classList.add("editcourselist__item--hiding")},onUpdate:function(){c()}})})},f=function(t){var n={course_id:t.courseId,id:t.activityEl.getAttribute("data-activity-id"),move_to_section_id:t.newSection.getAttribute("data-section-id"),move_to_position:t.newIndex};e.post("/public_curriculum_activities/update_position/",n).done(function(){})},p=function(){autosize(document.querySelectorAll("textarea.editcontent__input"))},h=function(e){var t=document.getElementById("course_name"),n=document.getElementById("curation-topics-checkboxes");return t.value.trim().length?!!n.querySelectorAll(".tagbutton").length||(e&&createFlashNotification(n.dataset.translationSubmissionError,"warning"),!1):(e&&createFlashNotification(t.dataset.translationSubmissionError,"warning"),!1)},m=function(){var e=document.getElementById("course_submission_button");e&&e.addEventListener("click",function(e){h(!0)||e.preventDefault()})},g=function(){var t=document.getElementById("course_featured_state_toggle"),n=document.getElementById("course_featured_state_target");t&&n&&t.addEventListener("change",function(){n.value=t.checked,e(n).trigger("change")})},v=function(){var e=document.getElementById("add-activity-to-public-path");e&&e.addEventListener("rendered.dialog",function(e){document.getElementById("section_id").value=e.detail.trigger.getAttribute("data-section-id");var t=document.getElementById("addNewCurationUrl");t&&(t.value="")})},y=function(){var t=document.getElementById("curation-add-more-topics"),n=document.getElementById("form_public_course_curriculum_categories");t&&n&&t.addEventListener("hide.dialog",function(){e(n).trigger("submit.rails")})};return{init:s}}();Intellum.util.ready(t.init)}(jQuery),function(){var e=function(){var e,t,n,i,r=!1,o=!1,a=function(){t&&t.addEventListener("change",function(a){if(!t.checked&&!r)return n.dispatchEvent(new window.CustomEvent("show.dialog",{detail:{trigger:null}})),a.preventDefault(),void a.stopPropagation();var s=e.getElementsByTagName("exceed-sortable-items")[0],l=s.getAttribute("empty-list-class"),u=e.getElementsByClassName(l);if(t.checked&&u.length>0&&!o)return i.dispatchEvent(new window.CustomEvent("show.dialog",{detail:{trigger:null}})),a.preventDefault(),void a.stopPropagation();r=!1,o=!1})},s=function(){n.querySelector('*[data-behaviour="dialog-accept"]').addEventListener("click",function(){r=!0,n.dispatchEvent(new window.CustomEvent("hide.dialog")),jQuery?jQuery(t).trigger("change"):t.dispatchEvent(new Event("change"))}),n.querySelector('*[data-behaviour="dialog-cancel"]').addEventListener("click",function(){r=!1,t.checked=!0,n.dispatchEvent(new window.CustomEvent("hide.dialog"))})},l=function(){i.querySelector('*[data-behaviour="dialog-accept"]').addEventListener("click",function(){o=!0,i.dispatchEvent(new window.CustomEvent("hide.dialog")),jQuery?jQuery(t).trigger("change"):t.dispatchEvent(new Event("change"))}),i.querySelector('*[data-behaviour="dialog-cancel"]').addEventListener("click",function(){o=!1,t.checked=!1,i.dispatchEvent(new window.CustomEvent("hide.dialog"))})};return{init:function(){(e=document.getElementById("edit-category-develop"))&&(t=document.getElementById("category_allow_develop_tab_target"),n=document.getElementById("uncheck-disclaimer-message-dialog"),i=document.getElementById("invalid-disclaimer-message-dialog"),a(),n&&s(),i&&l())}}}();Intellum.util.ready(e.init)}(jQuery),function(e){var t=function(){return{init:function(){var t=e("#public_curriculum_activity_new_form");t.length&&(t.on("ajax:send",function(){document.getElementById("curation-add-url-submit").disabled=!0,e("#get_external_data").show()}),t.on("ajax:success",function(){location.reload()}),t.on("ajax:error",function(){document.getElementById("curation-add-url-submit").disabled=!1,t.data().errorMessage&&Intellum.flashnotice.show(t.data().errorMessage,"warning")}))}}}();Intellum.util.ready(t.init)}(jQuery),function(e){var t=function(){var t,n,i,r,o,a,s,l,u,c,d,f,p=!1,h=function(){u=e("[data-js-topics-name]"),c=e("[data-js-topics-description]"),t=e("#curation-topic-input"),n=e("#curation-topic-input-results"),i=e("#curation-topics-suggested"),r=e("#curation-topics-save"),o=document.getElementById("curation-add-more-topics"),a=e("#curation-topics-checkboxes"),s=e("#curation-topics-selected"),l=e("#edit-topics-dialog-trigger"),d='',d+=Intellum.i18nStrings.loading,d+="",p=s.hasClass("publiccourse-selectedtopics--hidden"),f=parseInt(s.data("maxtopics")),o&&a.length&&(m(),C(),E(),A(),I(),T(),S())},m=function(){t.on("keydown",function(e){if(13===e.keyCode)return e.preventDefault(),e.stopPropagation(),!1}),t.on("keyup",Intellum.util.debounce(function(){t.val().trim().length>0?g(t.val().trim()):y(v())},500))},g=function(t){var i="";n.html(d),e.post("/categories/curation_autocomplete",{category:{name:t}}).done(function(r){r.categories.length?r.categories.forEach(function(t){0===e("span[data-topictag-id="+t.id+"]",s).length&&(i+=k(t.name,t.id,t.key))}):i="",n.html(i),e(".tagbutton",n).length||r.categories.length||!t||b()})},v=function(){return[u.val(),c.val()].join(" ")},y=function(t){if(!n.data("useLocalTopics")){var i="",r=e("#edit-course-container[data-course-id]").data("course-id");n.html(d),e.post("/categories/curation_suggestion",{text:t,course_id:r}).done(function(t){t.categories.length?t.categories.forEach(function(t){0===e("span[data-topictag-key="+t.key+"]",s).length&&(i+=k(t.name,t.id,t.key))}):i="",n.html(i),e(".tagbutton",n).length||w()})}},b=function(){var e='
    ';e+='

    '+n.data("no-topics-match-msg")+"

    ",e+="

    "+n.data("add-topic-msg")+"

    ",e+="

    ",e+=''+t.val()+"",e+="

    ",e+="
    ",n.html(e)},w=function(){var e='

    ';e+=Intellum.i18nStrings.topicsSuggestionEmpty,e+="

    ",i.html(e)},_=function(){var e='
    ';e+="

    "+Intellum.i18nStrings.topicsSelectionEmpty+"

    ",e+="
    ",s.html(e)},E=function(){var r=function(){var i=e(this);i.hasClass("tagbutton--selected")||(x(i),p?(1==f&&e(".tagbutton--selected",n).each(function(){e(".tagbutton__remove",this).trigger("click")}),i.append(''),i.addClass("tagbutton--selected")):i.data("topictag-id")||i.data("topictag-key")?i.remove():(g(""),t.val("")))};n.on("click",".tagbutton:not(.tagbutton--selected)",r),i.on("click",".tagbutton",r)},x=function(t){if(!(t.data("topictag-id")&&e("span[data-topictag-id="+t.data("topictag-id")+"]",s).length||t.data("topictag-key")&&e("span[data-topictag-key="+t.data("topictag-key")+"]",s).length)){var n=k(t.text(),t.data("topictag-id"),t.data("topictag-key"),!0);s.find(".tagbutton").length||s.html(""),s.append(n)}},k=function(e,t,n,i,r){var o,a="tagbutton";return i&&(a+=" tagbutton--selected"),t||i||r||(a+=" tagbutton--curationtopicnew"),o='',o+=e,r&&t&&(o+=''),i&&(o+=''),o+=""},A=function(){p?n.on("click",".tagbutton__remove",function(){var t=e(this).parent(".tagbutton--selected"),n=t.data();e("span[data-topictag-id="+n.topictagId+"][data-topictag-key="+n.topictagKey+"]",s).remove(),e(this).remove(),t.removeClass("tagbutton--selected")}):s.on("click",".tagbutton__remove",function(){var i=e(this).parent(".tagbutton--selected"),r=i.data();i.remove(),s.find(".tagbutton").length||_(),t.length&&t.val().trim().length?g(t.val()):(0==e(".tagbutton",n).length&&n.html(""),n.append(k(r.topicname,r.topictagId,r.topictagKey)))})},I=function(){r.on("click",function(){var t="",n=e(".tagbutton",s),i=e("#edit-topics-dialog-trigger"),r=e("#curation-topics-checkboxes");n.length?(n.each(function(){var n=e(this),i=n.data("topictag-id"),r=n.data("topictag-key");t+=k(n.data("topicname"),i,r,!1,!0)}),i.html(i.data("translation-default")),i.removeClass("button--primary").addClass("button--link")):(t+='',i.html(i.data("translation-nocontent")),i.removeClass("button--link").addClass("button--primary")),r.html(t),o.dispatchEvent(new window.CustomEvent("hide.dialog"))})},S=function(){e(document).bind("course-categories-set",function(t,n){var i="";n.categories.forEach(function(e){i+=k(e.name,e.id,e.key,!1,!0)}),e("#curation-topics-checkboxes").html(i)})},C=function(){o.addEventListener("hide.dialog",function(){t.val(""),n.data("useLocalTopics")||n.html(""),e(".tagbutton",s).remove()})},T=function(){l.on("click",function(){_(),e(".tagbutton",a).each(function(){x(e(this)),p&&(e("span[data-topictag-id="+e(this).data("topictag-id")+"][data-topictag-key="+e(this).data("topictag-key")+"]",n).length?e("span[data-topictag-id="+e(this).data("topictag-id")+"][data-topictag-key="+e(this).data("topictag-key")+"]",n).addClass("tagbutton--selected"):n.prepend(k(e(this).data("topicname"),e(this).data("topictag-id"),e(this).data("topictag-key"),!0)))}),y(v())})};return{init:h}}();Intellum.util.ready(t.init)}(jQuery),function(e){var t=function(){var t=document.getElementById("profile-public-toggle"),n=document.getElementById("public_profile_target"),i=function(){t&&n&&t.addEventListener("change",function(i){var r=document.getElementById("edit-public-profile-dialog");if("true"==n.getAttribute("data-confirmation")&&r&&t.checked){var o=r.querySelector('button[data-response="true"]');r.querySelector('button[data-response="false"]');o.addEventListener("click",function(){n.value="true",e(n).trigger("change"),r.dispatchEvent(new CustomEvent("hide.dialog"))}),r.addEventListener("hide.dialog",function(){"false"==n.value&&(t.checked=!1)}),r.dispatchEvent(new CustomEvent("show.dialog",{detail:{trigger:i.currentTarget}}))}else n.value=t.checked?"true":"false",e(n).trigger("change")})};!function(){i()}()};Intellum.util.ready(t)}(jQuery),$(function(){var e=$("#time-remaining-display").data("time-remaining"),t=$("#time-remaining-display")[0];t&&(startAssessmentTimer(e,t),$("a.coursebar__close").on("click",function(e){e.preventDefault(),e.stopImmediatePropagation(),$("#confirm_timed_assessment_leave_early")[0].dispatchEvent(new window.CustomEvent("show.dialog"))}),$("#leave_timed_assessment_early_button").on("click",function(){leaveTimedAssessmentEarly()}));var n=$("#timed_assessment_time_ran_out")[0];n&&n.addEventListener("hide.dialog",function(){redirectToActivityURL()});var i=$("#assessment_response_form");if(i.length){i.serialize();$("#submit_answer").on("click",function(e){e.preventDefault(),$("#target_path_after_submit").val(e.currentTarget.getAttribute("data-url")),i.submit()})}setInterval(function(){updateTextAreaCharactersLeft()},100),$(document).on("input"," [data-unsaved-answer-or-grading=false] textarea:not([data-flagging]), [data-unsaved-answer-or-grading=false] input[type='text']",function(){$(this).parents("[data-unsaved-answer-or-grading=false]").attr("data-unsaved-answer-or-grading",!0)}),createSortables(),$(document).on("click",".radio__input[data-non-text-option-of-question-id]",function(){var e=$(this).attr("data-non-text-option-of-question-id");$("[data-other-choice-value-question-id="+e+"]").val("")}),$(document).on("click","[data-other-choice-checkox-question-id]",function(){var e=$(this).attr("data-other-choice-checkox-question-id");$(this).is(":checked")?$("[data-other-choice-value-question-id="+e+"]").focus():$("[data-other-choice-value-question-id="+e+"]").val("")}),$(document).on("click","[data-other-choice-value-question-id]",function(){var e=$(this).attr("data-other-choice-value-question-id"),t=$("[data-other-choice-checkox-question-id="+e+"]");t.is(":checked")||t.click()});var r=function(){return!1},o=function(){return!1};$('[data-question-type="grid"]').length>0&&(r=function(){var e=!0;return $('[data-question-type="grid"] tr[data-question-row]').each(function(){if(!(e=$(this).find("input[type=radio]:checked").length>0))return!1}),e},$('[data-question-type="grid"] input[type=radio]').each(function(){$(this).on("change",function(){o=function(){return!0},setQuestionSubmitButtonStatus()})})),$("#media_file_upload").length>0&&(r=function(){return""!==$("#media_asset_id").val()},$("#media_asset_id").on("change",function(){setQuestionSubmitButtonStatus()})),$(".question .rank").length>0&&(r=function(){return $(".question .rank input[type=radio]:checked").length>0},$(".question .rank input[type=radio]").each(function(){$(this).on("change",function(){setQuestionSubmitButtonStatus()})})),$(".question .number_input").length>0&&(r=function(){return $(".question .number_input input[type=text]").val().match(/^[-+]?\d+$/)},$(".question .number_input input[type=text]").on("keyup",function(){setQuestionSubmitButtonStatus()})),$("[data-question-text-area]").length>0&&(r=function(){return""!==$("[data-question-text-area]").val()},$("[data-question-text-area]").on("keyup",function(){setQuestionSubmitButtonStatus()})),$('[data-question-type="multiplechoice"]').length&&(r=function(){return $('[data-question-type="multiplechoice"] input[type=checkbox]:checked, [data-question-type="multiplechoice"] input[type=radio]:checked').length>0},$('[data-question-type="multiplechoice"] input[type=checkbox], [data-question-type="multiplechoice"] input[type=radio]').each(function(){$(this).on("change",function(){setQuestionSubmitButtonStatus()})})),$('[data-question-type="rank"]').length&&(r=function(){return $(".rank__listitem input[type=radio]:checked").length>0},$(".rank__listitem input[type=radio]").each(function(){$(this).on("change",function(){setQuestionSubmitButtonStatus()})})),$('[data-question-type="checklist"]').length&&(r=function(){return!0}),$(".sequence, .matching").length>0&&(r=function(){return!0});var a=$("#assessment_response_question_grading_comment");a.length>0&&a.on("input",function(){setQuestionSubmitButtonStatus()}),window.setQuestionSubmitButtonStatus=function(){var e=$("#assessment-response-submit, #submit_answer"),t=e.data("optionalQuestion");if("feedback_prompt"!=e.data("questionType")||t){r()?enableButton(e,e.data("submitText")):t&&!o()?enableButton(e,e.data("skipText")):disableButton(e,e.data("submitText"))}else{$("#assessment_response_question_grading_comment").val().length>0?enableButton(e,e.data("submitText")):disableButton(e,e.data("submitText"))}},window.enableButton=function(e,t){e.attr("readonly",!1),e.removeClass("button--disabled"),e.find(".text").html(t)},window.disableButton=function(e,t){e.attr("readonly",!0),e.addClass("button--disabled"),e.find(".text").html(t)},setQuestionSubmitButtonStatus(),$(document).on("submit","#assessment_response_form",function(e){$(this).find("button.button--disabled").length>0&&(e.stopPropagation(),e.preventDefault())}),$(document).on("click","#feedback_form button.button--disabled",function(e){e.stopPropagation(),e.preventDefault()}),$(document).on("keyup","#assessment_response_feedback_body",function(){var e=$(this),t=$("#submit-feedback");""===e.val()?(t.attr("readonly",!0),t.addClass("button--disabled"),t.find(".text").html(t.data("submitText"))):(t.attr("readonly",!1),t.removeClass("button--disabled"),t.find(".text").html(t.data("submitText")))}),handleSectionNavigation(),$(document).on("click","a[data-assessment-single-page-submit]",function(e){return e.preventDefault(),e.stopPropagation(),"true"!=$(this).attr("data-already-clicked")&&($(this).attr("data-already-clicked",!0),$(this).text($(this).attr("data-clicked-text")),handleAssessmentSubmitOrSectionMove($(this)),!1)}),$(document).on("click","button[data-show-comment-section]",function(){$(this).next(".assessment__subsection").removeClass("hide"),$(this).remove()}),$(document).on("change",".toggleswitch__input",function(){$(this).is(":checked")?($("#"+$(this).attr("data-element-to-check-when-checked")).prop("checked",!0), $("#"+$(this).attr("data-element-to-check-when-unchecked")).prop("checked",!1)):($("#"+$(this).attr("data-element-to-check-when-checked")).prop("checked",!1),$("#"+$(this).attr("data-element-to-check-when-unchecked")).prop("checked",!0))})}),$(function(){var e=$("#grading-form"),t=$("#submit-grade-button");if(e.length){var n=e.serialize(),i=!1;t.on("click",function(r){if($(this).is(".disabled")||$(this).is(".button--disabled"))r.preventDefault();else{var o=$(this).attr("href"),a=$("#target_path_after_submit").val();e.serialize()!==n||t.data("is-new-grading")?(""===a&&$("#target_path_after_submit").val(o),r.preventDefault(),e.submit()):""!==a||i?$(this).attr("href",a):(i=!0,location.href=o)}});var r=function(){return $('[name^="assessment_response_question_grading[points"]:checked, [name^="toggle-assessment_response_question_grading[points"]:checked, input[type="hidden"][name^="assessment_response_question_grading[points"]').length>0},o=function(){var e="addClass";(t.data("isAutomaticallyGraded")||r())&&(e="removeClass"),t[e]("button--disabled")};o(),$('[name="toggle-assessment_response_question_grading[points]"]').change(function(){o()}),$('[name^="assessment_response_question_grading[points"]').change(function(){o()})}});