first.js 488 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. define('core/localstorage', ["core/config"],function(a){var b=!1,c="",d="",e=null,f=function(){if(a.jsrev==-1)return!1;if("undefined"==typeof window.localStorage)return!1;var b="test";try{return e=window.localStorage,null!==e&&(e.setItem(b,"1"),e.removeItem(b),!0)}catch(c){return!1}},g=function(a){return c+a},h=function(){var b=e.getItem(d);if(null===b)return void e.setItem(d,a.jsrev);var c=a.jsrev;c!=b&&(e.clear(),e.setItem(d,a.jsrev))},i=function(a){var b,c,d,e=0;if(0===a.length)return e;for(b=0,d=a.length;b<d;b++)c=a.charCodeAt(b),e=(e<<5)-e+c,e|=0;return e},j=function(){b=f();var e=a.wwwroot+"/"+a.jsrev,g=i(e);c=g+"/",e=a.wwwroot+"/",g=i(e),d=g+"/jsrev"};return j(),{get:function(a){return!!b&&(h(),a=g(a),e.getItem(a))},set:function(a,c){if(!b)return!1;h(),a=g(a);try{e.setItem(a,c)}catch(d){return!1}return!0}}});
  2. define('core/modal_factory', ["jquery","core/modal_events","core/modal","core/modal_save_cancel","core/modal_confirm","core/modal_cancel","core/templates","core/notification","core/custom_interaction_events"],function(a,b,c,d,e,f,g,h,i){var j={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CONFIRM:"core/modal_confirm",CANCEL:"core/modal_cancel"},k={DEFAULT:c,SAVE_CANCEL:d,CONFIRM:e,CANCEL:f},l={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CONFIRM:"CONFIRM",CANCEL:"CANCEL"},m=function(a,c){"undefined"!=typeof c&&(i.define(c,[i.events.activate]),c.on(i.events.activate,function(b,c){a.show(),c.originalEvent.preventDefault()}),a.getRoot().on(b.hidden,function(){c.focus()}))},n=function(b,c,d){c=a(c);var e=k[b],f=new e(c);return m(f,d),f},o=function(b,c){var d=j[b];return g.render(d,{}).then(function(d){var e=a(d);return n(b,e,c)}).fail(h.exception)},p=function(a,b){var c=a.type||l.DEFAULT,d=!!a.large;return l[c]||(c=l.DEFAULT),o(c,b).then(function(b){return"undefined"!=typeof a.title&&b.setTitle(a.title),"undefined"!=typeof a.body&&b.setBody(a.body),"undefined"!=typeof a.footer&&b.setFooter(a.footer),d&&b.setLarge(),b})};return{create:p,types:l}});
  3. define('core/tooltip', ["jquery"],function(a){var b=function(b){this._regionSelector=b,a(this._regionSelector).each(function(b,c){var d=a(c).attr("aria-describedby");if(d){var e=document.getElementById(d);if(e){var f="tooltip"==a(e).attr("role");f&&(a(e).hide(),a(c).attr("tabindex","0")),a(c).on("focus",this._handleFocus.bind(this)),a(c).on("mouseover",this._handleMouseOver.bind(this)),a(c).on("mouseout",this._handleMouseOut.bind(this)),a(c).on("blur",this._handleBlur.bind(this)),a(c).on("keydown",this._handleKeyDown.bind(this))}}}.bind(this))};return b.prototype._regionSelector=null,b.prototype._showTooltip=function(b){var c=a(b.target),d=c.attr("aria-describedby");if(d){var e=a(document.getElementById(d));if(e.show(),e.attr("aria-hidden","false"),!e.is(".tooltip")){var f=a('<div class="tooltip-inner"></div>');f.append(e.contents()),e.append(f),e.addClass("tooltip"),e.addClass("bottom"),e.append('<div class="tooltip-arrow"></div>')}var g=c.offset();g.top+=c.height()+10,a(e).offset(g)}},b.prototype._hideTooltip=function(b){var c=a(b.target),d=c.attr("aria-describedby");if(d){var e=document.getElementById(d);a(e).hide(),a(e).attr("aria-hidden","true")}},b.prototype._handleFocus=function(a){this._showTooltip(a)},b.prototype._handleKeyDown=function(a){27==a.which&&this._hideTooltip(a)},b.prototype._handleMouseOver=function(a){this._showTooltip(a)},b.prototype._handleMouseOut=function(b){var c=a(b.target);c.is(":focus")||this._hideTooltip(b)},b.prototype._handleBlur=function(a){this._hideTooltip(a)},b});
  4. define('core/chart_output_base', ["jquery"],function(a){function b(b,c){this._node=a(b),this._chart=c}return b.prototype.update=function(){throw new Error("Not supported.")},b});
  5. define('core/tag', ["jquery","core/ajax","core/templates","core/notification","core/str"],function(a,b,c,d,e){return{initTagindexPage:function(){a("body").delegate(".tagarea[data-ta] a[data-quickload=1]","click",function(d){d.preventDefault();var e=a(this),f=e[0].search.replace(/^\?/,""),g=e.closest(".tagarea[data-ta]"),h=f.split("&").reduce(function(a,b){var c=b.split("=");return a[c[0]]=decodeURIComponent(c[1]),a},{}),i=b.call([{methodname:"core_tag_get_tagindex",args:{tagindex:h}}],!0);a.when.apply(a,i).done(function(a){c.render("core_tag/index",a).done(function(a){g.replaceWith(a)})})})},initManagePage:function(){a("body").on("updated","[data-inplaceeditable]",function(b){if(e.get_string("now").done(function(c){a(b.target).closest("tr").find("td.col-timemodified").html(c)}),"tagflag"===b.ajaxreturn.itemtype){var c=a(b.target).closest("tr");"0"===b.ajaxreturn.value?c.removeClass("flagged-tag"):c.addClass("flagged-tag")}}),a(".tag-management-table").delegate("a.tagdelete","click",function(b){b.preventDefault();var c=a(this).attr("href");e.get_strings([{key:"delete"},{key:"confirmdeletetag",component:"tag"},{key:"yes"},{key:"no"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],function(){window.location.href=c})})}),a("#tag-management-delete").click(function(b){var c=a(this).closest("form").get(0),f=a(c).find("input[type=checkbox]:checked").length;if(f){var g=a("<input type='hidden'/>").attr("name",this.name);b.preventDefault(),e.get_strings([{key:"delete"},{key:"confirmdeletetags",component:"tag"},{key:"yes"},{key:"no"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],function(){g.appendTo(c),c.submit()})})}}),a("#tag-management-combine").click(function(b){b.preventDefault();var c=a(this).closest("form").get(0),f=a(c).find("input[type=checkbox]:checked");if(f.length<=1)return void e.get_strings([{key:"combineselected",component:"tag"},{key:"selectmultipletags",component:"tag"},{key:"ok"}]).done(function(a){d.alert(a[0],a[1],a[2])});var g=a("<input type='hidden'/>").attr("name",this.name);e.get_strings([{key:"combineselected",component:"tag"},{key:"selectmaintag",component:"tag"},{key:"continue"},{key:"cancel"}]).done(function(b){var d=a('<div><form id="combinetags_form" class="form-inline"><p class="description"></p><p class="options"></p><p class="mdl-align"><input type="submit" id="combinetags_submit"/><input type="button" id="combinetags_cancel"/></p></form></div>');d.find(".description").html(b[1]),d.find("#combinetags_submit").attr("value",b[2]),d.find("#combinetags_cancel").attr("value",b[3]);var e=d.find(".options");f.each(function(){var b=a(this).val(),c=a(".inplaceeditable[data-itemtype=tagname][data-itemid="+b+"]").attr("data-value");e.append(a('<input type="radio" name="maintag" id="combinetags_maintag_'+b+'" value="'+b+'"/><label for="combinetags_maintag_'+b+'">'+c+"</label><br>"))});var h=new M.core.dialogue({draggable:!0,modal:!0,closeButton:!0,headerContent:b[0],bodyContent:d.html()});h.show(),a("#combinetags_form input[type=radio]").first().focus().prop("checked",!0),a("#combinetags_form #combinetags_cancel").on("click",function(){h.destroy()}),a("#combinetags_form").on("submit",function(){g.appendTo(c);var b=a("input[name=maintag]:checked","#combinetags_form").val();return a("<input type='hidden'/>").attr("name","maintag").attr("value",b).appendTo(c),c.submit(),!1})})}),a("body").on("updatefailed","[data-inplaceeditable][data-itemtype=tagname]",function(b){var c=b.exception,f=b.newvalue,g=a(b.target).attr("data-itemid");"namesalreadybeeingused"===c.errorcode&&(b.preventDefault(),e.get_strings([{key:"nameuseddocombine",component:"tag"},{key:"yes"},{key:"cancel"}]).done(function(a){d.confirm(b.message,a[0],a[1],a[2],function(){window.location.href=window.location.href+"&newname="+encodeURIComponent(f)+"&tagid="+encodeURIComponent(g)+"&action=renamecombine&sesskey="+M.cfg.sesskey})}))}),a("body").on("click","a[data-action=addstandardtag]",function(b){b.preventDefault(),e.get_strings([{key:"addotags",component:"tag"},{key:"inputstandardtags",component:"tag"},{key:"continue"},{key:"cancel"}]).done(function(b){var c=a('<div><form id="addtags_form" class="form-inline" method="POST"><input type="hidden" name="action" value="addstandardtag"/><input type="hidden" name="sesskey" value="'+M.cfg.sesskey+'"/><p><label for="id_tagslist">'+b[1]+'</label><input type="text" id="id_tagslist" name="tagslist"/></p><p class="mdl-align"><input type="submit" id="addtags_submit"/><input type="button" id="addtags_cancel"/></p></form></div>');c.find("#addtags_form").attr("action",window.location.href),c.find("#addtags_submit").attr("value",b[2]),c.find("#addtags_cancel").attr("value",b[3]);var d=new M.core.dialogue({draggable:!0,modal:!0,closeButton:!0,headerContent:b[0],bodyContent:c.html()});d.show(),a("#addtags_form input[type=text]").focus(),a("#addtags_form #addtags_cancel").on("click",function(){d.destroy()})})})},initManageCollectionsPage:function(){a("body").on("updated","[data-inplaceeditable]",function(b){var c,d,e,f=b.ajaxreturn;"core_tag"===f.component&&"tagareaenable"===f.itemtype&&(c=a(this).attr("data-itemid"),a(".tag-collections-table ul[data-collectionid] li[data-areaid="+c+"]").hide(),e=f.value,"1"===e?(a(this).closest("tr").removeClass("dimmed_text"),d=a(this).closest("tr").find('[data-itemtype="tagareacollection"]').attr("data-value"),a(".tag-collections-table ul[data-collectionid="+d+"] li[data-areaid="+c+"]").show()):a(this).closest("tr").addClass("dimmed_text")),"core_tag"===f.component&&"tagareacollection"===f.itemtype&&(c=a(this).attr("data-itemid"),a(".tag-collections-table ul[data-collectionid] li[data-areaid="+c+"]").hide(),d=a(this).attr("data-value"),e=a(this).closest("tr").find('[data-itemtype="tagareaenable"]').attr("data-value"),"1"===e&&a(".tag-collections-table ul[data-collectionid="+d+"] li[data-areaid="+c+"]").show())}),a("body").on("click",".addtagcoll > a",function(b){b.preventDefault();var c=a(this).attr("data-url")+"&sesskey="+M.cfg.sesskey;e.get_strings([{key:"addtagcoll",component:"tag"},{key:"name"},{key:"searchable",component:"tag"},{key:"create"},{key:"cancel"}]).done(function(b){var d=a('<div><form id="addtagcoll_form" class="form-inline"><p><label for="addtagcoll_name"></label>: <input id="addtagcoll_name" type="text"/></p><p><label for="addtagcoll_searchable"></label>: <input id="addtagcoll_searchable" type="checkbox" value="1" checked/></p><p class="mdl-align"><input type="submit" id="addtagcoll_submit"/><input type="button" id="addtagcoll_cancel"/></p></form></div>');d.find('label[for="addtagcoll_name"]').html(b[1]),d.find('label[for="addtagcoll_searchable"]').html(b[2]),d.find("#addtagcoll_submit").attr("value",b[3]),d.find("#addtagcoll_cancel").attr("value",b[4]);var e=new M.core.dialogue({draggable:!0,modal:!0,closeButton:!0,headerContent:b[0],bodyContent:d.html()});e.show(),a("#addtagcoll_form #addtagcoll_name").focus(),a("#addtagcoll_form #addtagcoll_cancel").on("click",function(){e.destroy()}),a("#addtagcoll_form").on("submit",function(){var b=a("#addtagcoll_form #addtagcoll_name").val(),d=a("#addtagcoll_form #addtagcoll_searchable").prop("checked")?1:0;return String(b).length>0&&(window.location.href=c+"&name="+encodeURIComponent(b)+"&searchable="+d),!1})})}),a("body").on("click",".tag-collections-table .action_delete",function(b){b.preventDefault();var c=a(this).attr("data-url")+"&sesskey="+M.cfg.sesskey;e.get_strings([{key:"delete"},{key:"suredeletecoll",component:"tag",param:a(this).attr("data-collname")},{key:"yes"},{key:"no"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],function(){window.location.href=c})})})}}});
  6. define('core/form-autocomplete', ["jquery","core/log","core/str","core/templates","core/notification"],function(a,b,c,d,e){var f={DOWN:40,ENTER:13,SPACE:32,ESCAPE:27,COMMA:44,UP:38},g=function(b,c){var d=a(document.getElementById(c.selectionId)),e=d.children("[aria-selected=true]").length;for(b%=e;b<0;)b+=e;var f=a(d.children("[aria-selected=true]").get(b)),g=c.selectionId+"-"+b;d.children().attr("data-active-selection",!1).attr("id",""),f.attr("data-active-selection",!0).attr("id",g),d.attr("aria-activedescendant",g)},h=function(b,c,f){var h=[],i=a(document.getElementById(c.selectionId)),j=i.attr("aria-activedescendant"),k=!1;j&&(k=a(document.getElementById(j)).attr("data-value")),f.children("option").each(function(b,c){a(c).prop("selected")&&h.push({label:a(c).html(),value:a(c).attr("value")})});var l=a.extend({items:h},b,c);d.render("core/form_autocomplete_selection",l).done(function(b){i.empty().append(a(b).html()),k!==!1&&i.children("[aria-selected=true]").each(function(b,d){a(d).attr("data-value")===k&&g(b,c)})}).fail(e.exception)},i=function(a){"undefined"!=typeof M.core_formchangechecker&&M.core_formchangechecker.set_form_changed(),a.change()},j=function(b,c,d,e){var f=a(d).attr("data-value");b.multiple&&e.children("option").each(function(b,c){a(c).attr("value")==f&&(a(c).prop("selected",!1),a(c).attr("data-iscustom")&&a(c).remove())}),h(b,c,e),i(e)},k=function(b,c){var d=a(document.getElementById(c.inputId)),e=a(document.getElementById(c.suggestionsId)),f=e.children("[aria-hidden=false]").length;for(b%=f;b<0;)b+=f;var g=a(e.children("[aria-hidden=false]").get(b)),h=a(e.children("[role=option]")).index(g),i=c.suggestionsId+"-"+h;e.children().attr("aria-selected",!1).attr("id",""),g.attr("aria-selected",!0).attr("id",i),d.attr("aria-activedescendant",i);var j=g.offset().top-e.offset().top+e.scrollTop()-e.height()/2;e.animate({scrollTop:j},100)},l=function(b){var c=a(document.getElementById(b.suggestionsId)),d=c.children("[aria-selected=true]"),e=c.children("[aria-hidden=false]").index(d);k(e+1,b)},m=function(b){var c=a(document.getElementById(b.selectionId)),d=c.children("[data-active-selection=true]");if(!d)return void g(0,b);var e=c.children("[aria-selected=true]").index(d);g(e-1,b)},n=function(b){var c=a(document.getElementById(b.selectionId)),d=c.children("[data-active-selection=true]");if(!d)return void g(0,b);var e=c.children("[aria-selected=true]").index(d);g(e+1,b)},o=function(b){var c=a(document.getElementById(b.suggestionsId)),d=c.children("[aria-selected=true]"),e=c.children("[aria-hidden=false]").index(d);k(e-1,b)},p=function(b){var c=a(document.getElementById(b.inputId)),d=a(document.getElementById(b.suggestionsId));c.attr("aria-expanded",!1).attr("aria-activedescendant",b.selectionId),d.hide().attr("aria-hidden",!0)},q=function(b,f,g,h){var i=a(document.getElementById(f.inputId)),j=a(document.getElementById(f.suggestionsId)),l=!1,m=[];h.children("option").each(function(b,c){a(c).prop("selected")!==!0&&(m[m.length]={label:c.innerHTML,value:a(c).attr("value")})});var n=f.caseSensitive?g:g.toLocaleLowerCase(),o=a.extend({options:m},b,f);d.render("core/form_autocomplete_suggestions",o).done(function(d){j.replaceWith(d),j=a(document.getElementById(f.suggestionsId)),j.show().attr("aria-hidden",!1),j.children().each(function(c,d){d=a(d),b.caseSensitive&&d.text().indexOf(n)>-1||!b.caseSensitive&&d.text().toLocaleLowerCase().indexOf(n)>-1?(d.show().attr("aria-hidden",!1),l=!0):d.hide().attr("aria-hidden",!0)}),i.attr("aria-expanded",!0),l?b.tags||k(0,f):c.get_string("nosuggestions","form").done(function(a){j.html(a)})}).fail(e.exception)},r=function(b,c,d){var e=a(document.getElementById(c.inputId)),f=e.val(),g=f.split(","),j=!1;a.each(g,function(c,e){if(e=e.trim(),""!==e&&(b.multiple||d.children("option").prop("selected",!1),d.children("option").each(function(b,c){a(c).attr("value")==e&&(j=!0,a(c).prop("selected",!0))}),!j)){var f=a("<option>");f.append(e),f.attr("value",e),d.append(f),f.prop("selected",!0),f.attr("data-iscustom",!0)}}),h(b,c,d),i(d),e.val(""),p(c)},s=function(b,c,d){var e=a(document.getElementById(c.inputId)),f=a(document.getElementById(c.suggestionsId)),g=f.children("[aria-selected=true]").attr("data-value");b.multiple||d.children("option").prop("selected",!1),d.children("option").each(function(b,c){a(c).attr("value")==g&&a(c).prop("selected",!0)}),h(b,c,d),i(d),e.val(""),p(c)},t=function(b,c,d,f,g){var h=a(b.currentTarget).val();g.transport(c.selector,h,function(b){var e=g.processResults(c.selector,b),h=[];if(f.children("option").each(function(b,c){c=a(c),c.prop("selected")?h.push(String(c.attr("value"))):c.remove()}),!c.multiple&&0===f.children("option").length){var i=a("<option>");f.append(i)}a.each(e,function(b,c){if(h.indexOf(String(c.value))===-1){var d=a("<option>");d.append(c.label),d.attr("value",c.value),f.append(d)}}),q(c,d,"",f)},e.exception)},u=function(b,c,d){var e=a(document.getElementById(c.inputId));if(e.on("keydown",function(g){switch(g.keyCode){case f.DOWN:return!b.showSuggestions||("true"===e.attr("aria-expanded")?l(c):!e.val()&&b.ajax?require([b.ajax],function(a){t(g,b,c,d,a)}):q(b,c,e.val(),d),g.preventDefault(),!1);case f.UP:return o(c),g.preventDefault(),!1;case f.ENTER:var h=a(document.getElementById(c.suggestionsId));return"true"===e.attr("aria-expanded")&&h.children("[aria-selected=true]").length>0?s(b,c,d):b.tags&&r(b,c,d),g.preventDefault(),!1;case f.ESCAPE:return"true"===e.attr("aria-expanded")&&p(c),g.preventDefault(),!1}return!0}),e.on("keypress",function(a){return a.keyCode!==f.COMMA||(b.tags&&r(b,c,d),a.preventDefault(),!1)}),e.on("behat:set-value",function(){var f=a(document.getElementById(c.suggestionsId));"true"===e.attr("aria-expanded")&&f.children("[aria-selected=true]").length>0?s(b,c,d):b.tags&&r(b,c,d)}),e.on("blur",function(){window.setTimeout(function(){var f=a(document.activeElement);f.attr("id")!=e.attr("id")&&(b.tags&&r(b,c,d),p(c))},500)}),b.showSuggestions){var g=a(document.getElementById(c.downArrowId));g.on("click",function(){e.focus(),q(b,c,e.val(),d)})}var h=a(document.getElementById(c.suggestionsId));h.parent().on("click","[role=option]",function(e){var f=a(e.currentTarget).closest("[role=option]"),g=a(document.getElementById(c.suggestionsId)),h=g.children("[aria-hidden=false]").index(f);k(h,c),s(b,c,d)});var i=a(document.getElementById(c.selectionId));i.on("click","[role=listitem]",function(e){var f=a(e.currentTarget);j(b,c,f,d)}),i.on("keydown",function(e){switch(e.keyCode){case f.DOWN:return n(c),e.preventDefault(),!1;case f.UP:return m(c),e.preventDefault(),!1;case f.SPACE:case f.ENTER:var g=a(document.getElementById(c.selectionId)).children("[data-active-selection=true]");return g&&(j(b,c,g,d),e.preventDefault()),!1}return!0}),b.showSuggestions&&e.on("input",function(e){var f=a(e.currentTarget).val(),g=a(e.currentTarget).data("last-value");g!==f&&q(b,c,f,d),a(e.currentTarget).data("last-value",f)})};return{enhance:function(f,g,i,j,k,l,m){var n={selector:f,tags:!1,ajax:!1,placeholder:j,caseSensitive:!1,showSuggestions:!0,noSelectionString:m};"undefined"!=typeof g&&(n.tags=g),"undefined"!=typeof i&&(n.ajax=i),"undefined"!=typeof k&&(n.caseSensitive=k),"undefined"!=typeof l&&(n.showSuggestions=l),"undefined"==typeof m&&c.get_string("noselection","form").done(function(a){n.noSelectionString=a}).fail(e.exception);var o=a(f);if(!o)return void b.debug("Selector not found: "+f);o.hide().attr("aria-hidden",!0);var p={selectId:o.attr("id"),inputId:"form_autocomplete_input-"+a.now(),suggestionsId:"form_autocomplete_suggestions-"+a.now(),selectionId:"form_autocomplete_selection-"+a.now(),downArrowId:"form_autocomplete_downarrow-"+a.now()};n.multiple=o.attr("multiple");var q=a("[for="+p.selectId+"]"),r=[];o.children("option").each(function(b,c){r[b]={label:c.innerHTML,value:a(c).attr("value")}});var s=a.extend({},n,p);s.options=r,s.items=[];var v=d.render("core/form_autocomplete_input",s),w=d.render("core/form_autocomplete_suggestions",s),x=d.render("core/form_autocomplete_selection",s);a.when(v,w,x).done(function(b,c,d){o.after(c),o.after(b),o.after(d),q.attr("for",p.inputId),u(n,p,o);var e=a(document.getElementById(p.inputId)),f=a(document.getElementById(p.suggestionsId));f.hide().attr("aria-hidden",!0),n.ajax&&require([n.ajax],function(b){var c=null,d=function(a){t(a,n,p,o,b)},f=function(a){null!==c&&(window.clearTimeout(c),c=null),c=window.setTimeout(d.bind(this,a),300)};e.on("input",f);var g=a(document.getElementById(p.downArrowId));g.on("click",d)}),h(n,p,o)})}}});
  7. define('core/chart_bar', ["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}return b.prototype=Object.create(a.prototype),b.prototype._horizontal=!1,b.prototype._stacked=!1,b.prototype.TYPE="bar",b.prototype.create=function(b,c){var d=a.prototype.create.apply(this,arguments);return d.setHorizontal(c.horizontal),d.setStacked(c.stacked),d},b.prototype._setDefaults=function(){a.prototype._setDefaults.apply(this,arguments);var b=this.getYAxis(0,!0);b.setMin(0)},b.prototype.getHorizontal=function(){return this._horizontal},b.prototype.getStacked=function(){return this._stacked},b.prototype.setHorizontal=function(a){var b=this.getXAxis(0,!0);null===b.getMin()&&b.setMin(0),this._horizontal=Boolean(a)},b.prototype.setStacked=function(a){this._stacked=Boolean(a)},b});
  8. !function(a,b){"object"==typeof exports&&exports&&"string"!=typeof exports.nodeName?b(exports):"function"==typeof define&&define.amd?define('core/mustache', ["exports"],b):(a.Mustache={},b(a.Mustache))}(this,function(a){function b(a){return"function"==typeof a}function c(a){return p(a)?"array":typeof a}function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function e(a,b){return null!=a&&"object"==typeof a&&b in a}function f(a,b){return q.call(a,b)}function g(a){return!f(r,a)}function h(a){return String(a).replace(/[&<>"'`=\/]/g,function(a){return s[a]})}function i(b,c){function e(){if(r&&!s)for(;q.length;)delete o[q.pop()];else q=[];r=!1,s=!1}function f(a){if("string"==typeof a&&(a=a.split(u,2)),!p(a)||2!==a.length)throw new Error("Invalid tags: "+a);h=new RegExp(d(a[0])+"\\s*"),i=new RegExp("\\s*"+d(a[1])),m=new RegExp("\\s*"+d("}"+a[1]))}if(!b)return[];var h,i,m,n=[],o=[],q=[],r=!1,s=!1;f(c||a.tags);for(var y,z,A,B,C,D,E=new l(b);!E.eos();){if(y=E.pos,A=E.scanUntil(h))for(var F=0,G=A.length;F<G;++F)B=A.charAt(F),g(B)?q.push(o.length):s=!0,o.push(["text",B,y,y+1]),y+=1,"\n"===B&&e();if(!E.scan(h))break;if(r=!0,z=E.scan(x)||"name",E.scan(t),"="===z?(A=E.scanUntil(v),E.scan(v),E.scanUntil(i)):"{"===z?(A=E.scanUntil(m),E.scan(w),E.scanUntil(i),z="&"):A=E.scanUntil(i),!E.scan(i))throw new Error("Unclosed tag at "+E.pos);if(C=[z,A,y,E.pos],o.push(C),"#"===z||"^"===z||"$"===z||"<"===z)n.push(C);else if("/"===z){if(D=n.pop(),!D)throw new Error('Unopened section "'+A+'" at '+y);if(D[1]!==A)throw new Error('Unclosed section "'+D[1]+'" at '+y)}else"name"===z||"{"===z||"&"===z?s=!0:"="===z&&f(A)}if(D=n.pop())throw new Error('Unclosed section "'+D[1]+'" at '+E.pos);return k(j(o))}function j(a){for(var b,c,d=[],e=0,f=a.length;e<f;++e)b=a[e],b&&("text"===b[0]&&c&&"text"===c[0]?(c[1]+=b[1],c[3]=b[3]):(d.push(b),c=b));return d}function k(a){for(var b,c,d=[],e=d,f=[],g=0,h=a.length;g<h;++g)switch(b=a[g],b[0]){case"$":case"<":case"#":case"^":e.push(b),f.push(b),e=b[4]=[];break;case"/":c=f.pop(),c[5]=b[2],e=f.length>0?f[f.length-1][4]:d;break;default:e.push(b)}return d}function l(a){this.string=a,this.tail=a,this.pos=0}function m(a,b){this.view=a,this.blocks={},this.cache={".":this.view},this.parent=b}function n(){this.cache={}}var o=Object.prototype.toString,p=Array.isArray||function(a){return"[object Array]"===o.call(a)},q=RegExp.prototype.test,r=/\S/,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},t=/\s*/,u=/\s+/,v=/\s*=/,w=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!|\$|</;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(a){var b=this.tail.match(a);if(!b||0!==b.index)return"";var c=b[0];return this.tail=this.tail.substring(c.length),this.pos+=c.length,c},l.prototype.scanUntil=function(a){var b,c=this.tail.search(a);switch(c){case-1:b=this.tail,this.tail="";break;case 0:b="";break;default:b=this.tail.substring(0,c),this.tail=this.tail.substring(c)}return this.pos+=b.length,b},m.prototype.push=function(a){return new m(a,this)},m.prototype.setBlockVar=function(a,b){var c=this.blocks;return c[a]=b,b},m.prototype.clearBlockVars=function(){this.blocks={}},m.prototype.getBlockVar=function(a){var b,c=this.blocks;return c.hasOwnProperty(a)?b=c[a]:this.parent&&(b=this.parent.getBlockVar(a)),b},m.prototype.lookup=function(a){var c,d=this.cache;if(d.hasOwnProperty(a))c=d[a];else{for(var f,g,h=this,i=!1;h;){if(a.indexOf(".")>0)for(c=h.view,f=a.split("."),g=0;null!=c&&g<f.length;)g===f.length-1&&(i=e(c,f[g])),c=c[f[g++]];else c=h.view[a],i=e(h.view,a);if(i)break;h=h.parent}d[a]=c}return b(c)&&(c=c.call(this.view)),c},n.prototype.clearCache=function(){this.cache={}},n.prototype.parse=function(a,b){var c=this.cache,d=c[a];return null==d&&(d=c[a]=i(a,b)),d},n.prototype.render=function(a,b,c){var d=this.parse(a),e=b instanceof m?b:new m(b);return this.renderTokens(d,e,c,a)},n.prototype.renderTokens=function(a,b,c,d){for(var e,f,g,h="",i=0,j=a.length;i<j;++i)g=void 0,e=a[i],f=e[0],"#"===f?g=this.renderSection(e,b,c,d):"^"===f?g=this.renderInverted(e,b,c,d):">"===f?g=this.renderPartial(e,b,c,d):"<"===f?g=this.renderBlock(e,b,c,d):"$"===f?g=this.renderBlockVariable(e,b,c,d):"&"===f?g=this.unescapedValue(e,b):"name"===f?g=this.escapedValue(e,b):"text"===f&&(g=this.rawValue(e)),void 0!==g&&(h+=g);return h},n.prototype.renderSection=function(a,c,d,e){function f(a){return g.render(a,c,d)}var g=this,h="",i=c.lookup(a[1]);if(i){if(p(i))for(var j=0,k=i.length;j<k;++j)h+=this.renderTokens(a[4],c.push(i[j]),d,e);else if("object"==typeof i||"string"==typeof i||"number"==typeof i)h+=this.renderTokens(a[4],c.push(i),d,e);else if(b(i)){if("string"!=typeof e)throw new Error("Cannot use higher-order sections without the original template");i=i.call(c.view,e.slice(a[3],a[5]),f),null!=i&&(h+=i)}else h+=this.renderTokens(a[4],c,d,e);return h}},n.prototype.renderInverted=function(a,b,c,d){var e=b.lookup(a[1]);if(!e||p(e)&&0===e.length)return this.renderTokens(a[4],b,c,d)},n.prototype.renderPartial=function(a,c,d){if(d){var e=b(d)?d(a[1]):d[a[1]];return null!=e?this.renderTokens(this.parse(e),c,d,e):void 0}},n.prototype.renderBlock=function(a,c,d,e){if(d){var f=b(d)?d(a[1]):d[a[1]];null!=f&&c.clearBlockVars(),this.renderTokens(a[4],c,d,e);var g=this.renderTokens(this.parse(f),c,d,f);return c.clearBlockVars(),g}},n.prototype.renderBlockVariable=function(a,b,c,d){var e=a[1],f=b.getBlockVar(e);return f?this.renderTokens(this.parse(f),b,c,f):(b.setBlockVar(e,d.slice(a[3],a[5])),this.renderTokens(a[4],b,c,d))},n.prototype.unescapedValue=function(a,b){var c=b.lookup(a[1]);if(null!=c)return c},n.prototype.escapedValue=function(b,c){var d=c.lookup(b[1]);if(null!=d)return a.escape(d)},n.prototype.rawValue=function(a){return a[1]},a.name="mustache.js",a.version="2.2.1",a.tags=["{{","}}"];var y=new n;a.clearCache=function(){return y.clearCache()},a.parse=function(a,b){return y.parse(a,b)},a.render=function(a,b,d){if("string"!=typeof a)throw new TypeError('Invalid template! Template should be a "string" but "'+c(a)+'" was given as the first argument for mustache#render(template, view, partials)');return y.render(a,b,d)},a.to_html=function(c,d,e,f){var g=a.render(c,d,e);return b(f)?void f(g):g},a.escape=h,a.Scanner=l,a.Context=m,a.Writer=n});
  9. define('core/ajax', ["jquery","core/config"],function(a,b){var c=function(a){var b,c,d=this,e=null,f=0;for(f=0;f<d.length;f++){if(b=d[f],c=a[f],"undefined"==typeof c){e=new Error("missing response");break}if(c.error!==!1){e=c.exception;break}b.deferred.resolve(c.data)}if(null!==e)for(;f<d.length;f++)b=d[f],b.deferred.reject(e)},d=function(a,b){var c=this,d=0;for(d=0;d<c.length;d++){var e=c[d];e.deferred.reject(b)}};return{call:function(e,f,g){var h,i=[],j=[];for("undefined"==typeof g&&(g=!0),"undefined"==typeof f&&(f=!0),h=0;h<e.length;h++){var k=e[h];i.push({index:h,methodname:k.methodname,args:k.args}),k.deferred=a.Deferred(),j.push(k.deferred.promise()),"undefined"!=typeof k.done&&k.deferred.done(k.done),"undefined"!=typeof k.fail&&k.deferred.fail(k.fail),k.index=h}i=JSON.stringify(i);var l={type:"POST",data:i,context:e,dataType:"json",processData:!1,async:f,contentType:"application/json"},m=b.wwwroot+"/lib/ajax/service.php?sesskey="+b.sesskey;return g||(m=b.wwwroot+"/lib/ajax/service-nologin.php?sesskey="+b.sesskey),f?a.ajax(m,l).done(c).fail(d):(l.success=c,l.error=d,a.ajax(m,l)),j}}});
  10. define('core/modal_backdrop', ["jquery","core/templates","core/notification"],function(a,b,c){var d={ROOT:'[data-region="modal-backdrop"]'},e=function(b){this.root=a(b),this.isAttached=!1,this.root.is(d.ROOT)||c.exception({message:"Element is not a modal backdrop"})};return e.prototype.getRoot=function(){return this.root},e.prototype.attachToDOM=function(){this.isAttached||(a("body").append(this.root),this.isAttached=!0)},e.prototype.setZIndex=function(a){this.root.css("z-index",a)},e.prototype.isVisible=function(){return this.root.hasClass("show")},e.prototype.hasTransitions=function(){return this.getRoot().hasClass("fade")},e.prototype.show=function(){this.isVisible()||(this.isAttached||this.attachToDOM(),this.root.removeClass("hide").addClass("show"))},e.prototype.hide=function(){this.isVisible()&&(this.hasTransitions()?this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",function(){this.getRoot().removeClass("show").addClass("hide")}.bind(this)):this.getRoot().removeClass("show").addClass("hide"))},e.prototype.destroy=function(){this.root.remove()},e});
  11. define('core/inplace_editable', ["jquery","core/ajax","core/templates","core/notification","core/str","core/config","core/url"],function(a,b,c,d,e,f,g){return a("body").on("click keypress","[data-inplaceeditable] [data-inplaceeditablelink]",function(h){if("keypress"!==h.type||13===h.keyCode){h.stopImmediatePropagation(),h.preventDefault();var i=a(this),j=i.closest("[data-inplaceeditable]"),k=function(b){b.addClass("updating");var c=b.find("img.spinner");c.length?c.show():(c=a("<img/>").attr("src",g.imageUrl("i/loading_small")).addClass("spinner").addClass("smallicon"),b.append(c))},l=function(a){a.removeClass("updating"),a.find("img.spinner").hide()},m=function(e,f){k(e),b.call([{methodname:"core_update_inplace_editable",args:{itemid:e.attr("data-itemid"),component:e.attr("data-component"),itemtype:e.attr("data-itemtype"),value:f},done:function(b){var d=e.attr("data-value");c.render("core/inplace_editable",b).done(function(f,g){var h=a(f);c.replaceNode(e,h,g),h.find("[data-inplaceeditablelink]").focus(),h.trigger({type:"updated",ajaxreturn:b,oldvalue:d})})},fail:function(b){var c=a.Event("updatefailed",{exception:b,newvalue:f});l(e),e.trigger(c),c.isDefaultPrevented()||d.exception(b)}}],!0)},n=function(a){a.find("input").off(),a.find("select").off(),a.html(a.attr("data-oldcontent")),a.removeAttr("data-oldcontent"),a.removeClass("inplaceeditingon"),a.find("[data-inplaceeditablelink]").focus()},o=function(){a("span.inplaceeditable.inplaceeditingon").each(function(){n(a(this))})},p=function(b,c){var d,e=b;for(d=0;d<c;d++)e+=String(Math.floor(10*Math.random()));return 0===a("#"+e).length?e:p(b,c)},q=function(b){e.get_string("edittitleinstructions").done(function(c){var d=a('<span class="editinstructions">'+c+"</span>").attr("id",p("id_editinstructions_",20)),e=a('<input type="text"/>').attr("id",p("id_inplacevalue_",20)).attr("value",b.attr("data-value")).attr("aria-describedby",d.attr("id")).addClass("ignoredirty").addClass("form-control"),g=a('<label class="accesshide">'+j.attr("data-editlabel")+"</label>").attr("for",e.attr("id"));b.html("").append(d).append(g).append(e),e.focus(),e.select(),e.on("keyup keypress focusout",function(a){if(!f.behatsiterunning||"focusout"!==a.type){if("keypress"===a.type&&13===a.keyCode){var c=e.val();n(b),m(b,c)}("keyup"===a.type&&27===a.keyCode||"focusout"===a.type)&&n(b)}})})},r=function(a,b){n(a),m(a,b)},s=function(b,c){var d,e=a("<select></select>").attr("id",p("id_inplacevalue_",20)).addClass("custom-select"),g=a('<label class="accesshide">'+j.attr("data-editlabel")+"</label>").attr("for",e.attr("id"));for(d in c)e.append(a("<option>").attr("value",c[d].key).html(c[d].value));e.val(b.attr("data-value")),b.html("").append(g).append(e),e.focus(),e.select(),e.on("keyup change focusout",function(a){if(!f.behatsiterunning||"focusout"!==a.type){if("change"===a.type){var c=e.val();n(b),m(b,c)}("keyup"===a.type&&27===a.keyCode||"focusout"===a.type)&&n(b)}})},t=function(b){b.addClass("inplaceeditingon"),b.attr("data-oldcontent",b.html());var c=b.attr("data-type"),d=b.attr("data-options");"toggle"===c?r(b,d):"select"===c?s(b,a.parseJSON(d)):q(b)};o(),t(j)}}),{}});
  12. define('core/url', ["jquery","core/config"],function(a,b){return{fileUrl:function(a,c){var d=b.wwwroot+a;return"/"!=c.charAt(0)&&(c="/"+c),d+=b.slasharguments?c:"?file="+encodeURIComponent(c)},relativeUrl:function(c,d,e){if(0===c.indexOf("http:")||0===c.indexOf("https:")||c.indexOf("://")>=0)throw new Error("relativeUrl function does not accept absolute urls");"/"!=c.charAt(0)&&(c="/"+c),"admin"!==b.admin&&(c=c.replace(/^\/admin\//,"/"+b.admin+"/")),d=d||{},e&&(d.sesskey=b.sesskey);var f="";return Object.keys(d).length&&(f=a.map(d,function(a,b){return b+"="+a}).join("&")),""!==f?b.wwwroot+c+"?"+f:b.wwwroot+c},imageUrl:function(a,b){return M.util.image_url(a,b)}}});
  13. define('core/modal_confirm', ["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_events"],function(a,b,c,d,e){var f={YES_BUTTON:'[data-action="yes"]',NO_BUTTON:'[data-action="no"]'},g=function(a){d.call(this,a),this.getFooter().find(f.YES_BUTTON).length||b.exception({message:'No "yes" button found'}),this.getFooter().find(f.NO_BUTTON).length||b.exception({message:'No "no" button found'})};return g.prototype=Object.create(d.prototype),g.prototype.constructor=g,g.prototype.setFooter=function(){b.exception({message:"Can not change the footer of a confirm modal"})},g.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this),this.getModal().on(c.events.activate,f.YES_BUTTON,function(b,c){var d=a.Event(e.yes);this.getRoot().trigger(d,this),d.isDefaultPrevented()||(this.hide(),c.originalEvent.preventDefault())}.bind(this)),this.getModal().on(c.events.activate,f.NO_BUTTON,function(b,c){var d=a.Event(e.no);this.getRoot().trigger(d,this),d.isDefaultPrevented()||(this.hide(),c.originalEvent.preventDefault())}.bind(this))},g});
  14. define('core/chart_builder', ["jquery"],function(a){var b={make:function(b){var c=a.Deferred();return require(["core/chart_"+b.type],function(a){var d=a.prototype.create(a,b);c.resolve(d)}),c.promise()}};return b});
  15. define('core/chart_output', ["core/chart_output_chartjs"],function(a){var b=a;return b});
  16. define('core/chart_base', ["core/chart_series","core/chart_axis"],function(a,b){function c(){this._series=[],this._labels=[],this._xaxes=[],this._yaxes=[],this._setDefaults()}return c.prototype._series=null,c.prototype._labels=null,c.prototype._title=null,c.prototype._xaxes=null,c.prototype._yaxes=null,c.prototype.COLORSET=["#f3c300","#875692","#f38400","#a1caf1","#be0032","#c2b280","#7f180d","#008856","#e68fac","#0067a5"],c.prototype._configColorSet=null,c.prototype.TYPE=null,c.prototype.addSeries=function(a){if(this._validateSeries(a),this._series.push(a),null===a.getColor()){var b=this.getConfigColorSet()||c.prototype.COLORSET;a.setColor(b[this._series.length%b.length])}},c.prototype.create=function(c,d){var e=new c;return e.setConfigColorSet(d.config_colorset),e.setLabels(d.labels),e.setTitle(d.title),d.series.forEach(function(b){e.addSeries(a.prototype.create(b))}),d.axes.x.forEach(function(a,c){e.setXAxis(b.prototype.create(a),c)}),d.axes.y.forEach(function(a,c){e.setYAxis(b.prototype.create(a),c)}),e},c.prototype.__getAxis=function(a,c,d){var e,f="x"===a?this._xaxes:this._yaxes,g=("x"===a?this.setXAxis:this.setYAxis).bind(this);if(c="undefined"==typeof c?0:c,d="undefined"!=typeof d&&d,e=f[c],"undefined"==typeof e){if(!d)throw new Error("Unknown axis.");e=new b,g(e,c)}return e},c.prototype.getConfigColorSet=function(){return this._configColorSet},c.prototype.getLabels=function(){return this._labels},c.prototype.getSeries=function(){return this._series},c.prototype.getTitle=function(){return this._title},c.prototype.getType=function(){if(!this.TYPE)throw new Error("The TYPE property has not been set.");return this.TYPE},c.prototype.getXAxes=function(){return this._xaxes},c.prototype.getXAxis=function(a,b){return this.__getAxis("x",a,b)},c.prototype.getYAxes=function(){return this._yaxes},c.prototype.getYAxis=function(a,b){return this.__getAxis("y",a,b)},c.prototype.setConfigColorSet=function(a){this._configColorSet=a},c.prototype._setDefaults=function(){},c.prototype.setLabels=function(a){if(a.length&&this._series.length&&this._series[0].length!=a.length)throw new Error("Series must match label values.");this._labels=a},c.prototype.setTitle=function(a){this._title=a},c.prototype.setXAxis=function(a,b){b="undefined"==typeof b?0:b,this._validateAxis("x",a,b),this._xaxes[b]=a},c.prototype.setYAxis=function(a,b){b="undefined"==typeof b?0:b,this._validateAxis("y",a,b),this._yaxes[b]=a},c.prototype._validateAxis=function(a,b,c){if(c="undefined"==typeof c?0:c,c>0){var d="x"==a?this._xaxes:this._yaxes;if("undefined"==typeof d[c-1])throw new Error("Missing "+a+" axis at index lower than "+c)}},c.prototype._validateSeries=function(a){if(this._series.length&&this._series[0].getCount()!=a.getCount())throw new Error("Series do not have an equal number of values.");if(this._labels.length&&this._labels.length!=a.getCount())throw new Error("Series must match label values.")},c});
  17. define('core/modal_events', [],function(){return{shown:"modal:shown",hidden:"modal:hidden",destroyed:"modal:destroyed",save:"modal-save-cancel:save",cancel:"modal-save-cancel:cancel",yes:"modal-confirm:yes",no:"modal-confirm:no"}});
  18. define('core/yui', function(){return Y});
  19. define('core/first', ["jquery"],function(a){a(document).bind("ajaxStart",function(){M.util.js_pending("jq")}).bind("ajaxStop",function(){M.util.js_complete("jq")})});
  20. !function(a,b){"use strict";"function"==typeof define&&define.amd?define('core/loglevel', b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a){return typeof console!==h&&(void 0!==console[a]?b(console,a):void 0!==console.log?b(console,"log"):g)}function b(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(d){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function c(a,b,c){return function(){typeof console!==h&&(d.call(this,b,c),this[a].apply(this,arguments))}}function d(a,b){for(var c=0;c<i.length;c++){var d=i[c];this[d]=c<a?g:this.methodFactory(d,a,b)}}function e(b,d,e){return a(b)||c.apply(this,arguments)}function f(a,b,c){function f(a){var b=(i[a]||"silent").toUpperCase();try{return void(window.localStorage[l]=b)}catch(c){}try{window.document.cookie=encodeURIComponent(l)+"="+b+";"}catch(c){}}function g(){var a;try{a=window.localStorage[l]}catch(b){}if(typeof a===h)try{var c=window.document.cookie,d=c.indexOf(encodeURIComponent(l)+"=");d&&(a=/^([^;]+)/.exec(c.slice(d))[1])}catch(b){}return void 0===k.levels[a]&&(a=void 0),a}var j,k=this,l="loglevel";a&&(l+=":"+a),k.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},k.methodFactory=c||e,k.getLevel=function(){return j},k.setLevel=function(b,c){if("string"==typeof b&&void 0!==k.levels[b.toUpperCase()]&&(b=k.levels[b.toUpperCase()]),!("number"==typeof b&&b>=0&&b<=k.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(j=b,c!==!1&&f(b),d.call(k,b,a),typeof console===h&&b<k.levels.SILENT)return"No console available for logging"},k.setDefaultLevel=function(a){g()||k.setLevel(a,!1)},k.enableAll=function(a){k.setLevel(k.levels.TRACE,a)},k.disableAll=function(a){k.setLevel(k.levels.SILENT,a)};var m=g();null==m&&(m=null==b?"WARN":b),k.setLevel(m,!1)}var g=function(){},h="undefined",i=["trace","debug","info","warn","error"],j=new f,k={};j.getLogger=function(a){if("string"!=typeof a||""===a)throw new TypeError("You must supply a name when creating a logger.");var b=k[a];return b||(b=k[a]=new f(a,j.getLevel(),j.methodFactory)),b};var l=typeof window!==h?window.log:void 0;return j.noConflict=function(){return typeof window!==h&&window.log===j&&(window.log=l),j},j});
  21. define('core/notification', ["core/yui","jquery","core/log"],function(a,b,c){var d={types:{success:"core/notification_success",info:"core/notification_info",warning:"core/notification_warning",error:"core/notification_error"},fieldName:"user-notifications",fetchNotifications:function(){require(["core/ajax"],function(a){var b=a.call([{methodname:"core_fetch_notifications",args:{contextid:d.contextid}}]);b[0].done(d.addNotifications)})},addNotifications:function(a){a||(a=[]),b.each(a,function(a,b){d.renderNotification(b.template,b.variables)})},setupTargetRegion:function(){var a=b("#"+d.fieldName);if(a.length)return!1;var c=b("<span>").attr("id",d.fieldName);return a=b("#region-main"),a.length?a.prepend(c):(a=b('[role="main"]'),a.length?a.prepend(c):(a=b("body"),a.prepend(c)))},addNotification:function(a){var c=d.types.error;return a=b.extend({closebutton:!0,announce:!0,type:"error"},a),a.template?(c=a.template,delete a.template):a.type&&("undefined"!=typeof d.types[a.type]&&(c=d.types[a.type]),delete a.type),d.renderNotification(c,a)},renderNotification:function(a,e){return"undefined"!=typeof e.message&&e.message?void require(["core/templates"],function(c){c.render(a,e).done(function(a,e){b("#"+d.fieldName).prepend(a),c.runTemplateJS(e)}).fail(d.exception)}):void c.debug("Notification received without content. Skipping.")},alert:function(b,c,d){a.use("moodle-core-notification-alert",function(){var a=new M.core.alert({title:b,message:c,yesLabel:d});a.show()})},confirm:function(b,c,d,e,f,g){a.use("moodle-core-notification-confirm",function(){var a=new M.core.confirm({title:b,question:c,yesLabel:d,noLabel:e});a.on("complete-yes",function(){f()}),g&&a.on("complete-no",function(){g()}),a.show()})},exception:function(b){if("undefined"==typeof b.stack&&(b.stack=""),b.debuginfo&&(b.stack+=b.debuginfo+"\n"),b.backtrace){b.stack+=b.backtrace;var c=b.backtrace.match(/line ([^ ]*) of/),d=b.backtrace.match(/ of ([^:]*): /);c&&c[1]&&(b.lineNumber=c[1]),d&&d[1]&&(b.fileName=d[1],b.fileName.length>30&&(b.fileName="..."+b.fileName.substr(b.fileName.length-27)))}"undefined"==typeof b.name&&b.errorcode&&(b.name=b.errorcode),a.use("moodle-core-notification-exception",function(){var a=new M.core.exception(b);a.show()})}};return{init:function(a,b){d.contextid=a,d.setupTargetRegion(),d.addNotifications(b),d.fetchNotifications()},fetchNotifications:d.fetchNotifications,addNotification:d.addNotification,alert:d.alert,confirm:d.confirm,exception:d.exception}});
  22. define('core/chart_line', ["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}return b.prototype=Object.create(a.prototype),b.prototype.TYPE="line",b.prototype._smooth=!1,b.prototype.create=function(b,c){var d=a.prototype.create.apply(this,arguments);return d.setSmooth(c.smooth),d},b.prototype.getSmooth=function(){return this._smooth},b.prototype.setSmooth=function(a){this._smooth=Boolean(a)},b});
  23. define('core/key_codes', function(){return{tab:9,enter:13,escape:27,space:32,end:35,home:36,arrowLeft:37,arrowUp:38,arrowRight:39,arrowDown:40,8:56,asterix:106,pageUp:33,pageDown:34}});
  24. define('core/custom_interaction_events', ["jquery","core/key_codes"],function(a,b){var c={activate:"cie:activate",keyboardActivate:"cie:keyboardactivate",escape:"cie:escape",down:"cie:down",up:"cie:up",home:"cie:home",end:"cie:end",next:"cie:next",previous:"cie:previous",asterix:"cie:asterix",scrollLock:"cie:scrollLock",scrollTop:"cie:scrollTop",scrollBottom:"cie:scrollBottom",ctrlPageUp:"cie:ctrlPageUp",ctrlPageDown:"cie:ctrlPageDown",enter:"cie:enter"},d=function(a,b){return b=b||[],!(!b.length||b.indexOf(a)===-1)},e=function(a){return a.shiftKey||a.metaKey||a.altKey||a.ctrlKey},f=function(b,c,d){b.off("keydown."+c).on("keydown."+c,function(b){e(b)||b.keyCode==d&&a(b.target).trigger(c,[{originalEvent:b}])})},g=function(d){d.off("click.cie.activate").on("click.cie.activate",function(b){a(b.target).trigger(c.activate,[{originalEvent:b}])}),d.off("keydown.cie.activate").on("keydown.cie.activate",function(d){e(d)||d.keyCode!=b.enter&&d.keyCode!=b.space||a(d.target).trigger(c.activate,[{originalEvent:d}])})},h=function(d){d.off("keydown.cie.keyboardactivate").on("keydown.cie.keyboardactivate",function(d){e(d)||d.keyCode!=b.enter&&d.keyCode!=b.space||a(d.target).trigger(c.keyboardActivate,[{originalEvent:d}])})},i=function(a){f(a,c.escape,b.escape)},j=function(a){f(a,c.down,b.arrowDown)},k=function(a){f(a,c.up,b.arrowUp)},l=function(a){f(a,c.home,b.home)},m=function(a){f(a,c.end,b.end)},n=function(d){var e="rtl"==a("html").attr("dir")?b.arrowLeft:b.arrowRight;f(d,c.next,e)},o=function(d){var e="rtl"==a("html").attr("dir")?b.arrowRight:b.arrowLeft;f(d,c.previous,e)},p=function(a){f(a,c.asterix,b.asterix)},q=function(a){a.off("scroll.cie.scrollTop").on("scroll.cie.scrollTop",function(b){var d=a.scrollTop();0===d&&a.trigger(c.scrollTop,[{originalEvent:b}])})},r=function(a){a.off("scroll.cie.scrollBottom").on("scroll.cie.scrollBottom",function(b){var d=a.scrollTop(),e=a.innerHeight(),f=a[0].scrollHeight;d+e>=f&&a.trigger(c.scrollBottom,[{originalEvent:b}])})},s=function(a){a.off("DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock").on("DOMMouseScroll.cie.DOMMouseScrollLock mousewheel.cie.mousewheelLock",function(b){var d=a.scrollTop(),e=a[0].scrollHeight,f=a.height(),g="DOMMouseScroll"==b.type?b.originalEvent.detail*-40:b.originalEvent.wheelDelta,h=g>0;return!h&&-g>e-f-d?(a.scrollTop(e),b.stopPropagation(),b.preventDefault(),b.returnValue=!1,a.trigger(c.scrollLock,[{originalEvent:b}]),!1):!(h&&g>d)||(a.scrollTop(0),b.stopPropagation(),b.preventDefault(),b.returnValue=!1,a.trigger(c.scrollLock,[{originalEvent:b}]),!1)})},t=function(d){d.off("keydown.cie.ctrlpageup").on("keydown.cie.ctrlpageup",function(d){d.ctrlKey&&d.keyCode==b.pageUp&&a(d.target).trigger(c.ctrlPageUp,[{originalEvent:d}])})},u=function(d){d.off("keydown.cie.ctrlpagedown").on("keydown.cie.ctrlpagedown",function(d){d.ctrlKey&&d.keyCode==b.pageDown&&a(d.target).trigger(c.ctrlPageDown,[{originalEvent:d}])})},v=function(a){f(a,c.enter,b.enter)},w=function(){var a={};return a[c.activate]=g,a[c.keyboardActivate]=h,a[c.escape]=i,a[c.down]=j,a[c.up]=k,a[c.home]=l,a[c.end]=m,a[c.next]=n,a[c.previous]=o,a[c.asterix]=p,a[c.scrollLock]=s,a[c.scrollTop]=q,a[c.scrollBottom]=r,a[c.ctrlPageUp]=t,a[c.ctrlPageDown]=u,a[c.enter]=v,a},x=function(b,c){b=a(b),c=c||[],b.length&&c.length&&a.each(w(),function(a,e){d(a,c)&&e(b)})};return{define:x,events:c}});
  25. define('core/form-course-selector', ["core/ajax","jquery"],function(a,b){return{processResults:function(a,c){var d=[],e=0,f=String(b(a).data("exclude")).split(",");for(e=0;e<c.courses.length;e++)f.indexOf(String(c.courses[e].id))===-1&&d.push({value:c.courses[e].id,label:c.courses[e].displayname});return d},transport:function(c,d,e,f){var g=b(c),h=g.data("requiredcapabilities");h=""!==h.trim()?h.split(","):[];var i=g.data("limittoenrolled"),j=g.data("includefrontpage"),k=null;"undefined"==typeof d&&(d="");var l={criterianame:"search",criteriavalue:d,page:0,perpage:100,requiredcapabilities:h,limittoenrolled:i},m=[{methodname:"core_course_search_courses",args:l}];j&&m.push({methodname:"core_course_get_courses",args:{options:{ids:[j]}}}),k=a.call(m),b.when.apply(b.when,k).done(function(a,b){if(b&&1==b.length){var c=b.pop(),f=""===d||c.fullname.toUpperCase().indexOf(d.toUpperCase())>-1||c.shortname.toUpperCase().indexOf(d.toUpperCase())>-1;f&&a.courses.splice(0,0,c)}e(a)}).fail(f)}}});
  26. define('core/popover_region_controller', ["jquery","core/str","core/custom_interaction_events"],function(a,b,c){var d={CONTENT:".popover-region-content",CONTENT_CONTAINER:".popover-region-content-container",MENU_CONTAINER:".popover-region-container",MENU_TOGGLE:".popover-region-toggle",CAN_RECEIVE_FOCUS:'input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]'},e=function(b){this.root=a(b),this.content=this.root.find(d.CONTENT),this.contentContainer=this.root.find(d.CONTENT_CONTAINER),this.menuContainer=this.root.find(d.MENU_CONTAINER),this.menuToggle=this.root.find(d.MENU_TOGGLE),this.isLoading=!1,this.promises={closeHandlers:a.Deferred(),navigationHandlers:a.Deferred()},this.registerBaseEventListeners()};return e.prototype.events=function(){return{menuOpened:"popoverregion:menuopened",menuClosed:"popoverregion:menuclosed",startLoading:"popoverregion:startLoading",stopLoading:"popoverregion:stopLoading"}},e.prototype.getContentContainer=function(){return this.contentContainer},e.prototype.getContent=function(){return this.content},e.prototype.isMenuOpen=function(){return!this.root.hasClass("collapsed")},e.prototype.toggleMenu=function(){this.isMenuOpen()?this.closeMenu():this.openMenu()},e.prototype.closeMenu=function(){this.isMenuOpen()&&(this.root.addClass("collapsed"),this.menuContainer.attr("aria-expanded","false"),this.menuContainer.attr("aria-hidden","true"),this.updateButtonAriaLabel(),this.root.trigger(this.events().menuClosed))},e.prototype.openMenu=function(){this.isMenuOpen()||(this.root.removeClass("collapsed"),this.menuContainer.attr("aria-expanded","true"),this.menuContainer.attr("aria-hidden","false"),this.updateButtonAriaLabel(),this.promises.closeHandlers.resolve(),this.promises.navigationHandlers.resolve(),this.root.trigger(this.events().menuOpened))},e.prototype.updateButtonAriaLabel=function(){this.isMenuOpen()?b.get_string("hidepopoverwindow").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this)):b.get_string("showpopoverwindow").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this))},e.prototype.startLoading=function(){this.isLoading=!0,this.getContentContainer().addClass("loading"),this.getContentContainer().attr("aria-busy","true"),this.root.trigger(this.events().startLoading)},e.prototype.stopLoading=function(){this.isLoading=!1,this.getContentContainer().removeClass("loading"),this.getContentContainer().attr("aria-busy","false"),this.root.trigger(this.events().stopLoading)},e.prototype.focusMenuToggle=function(){this.menuToggle.focus()},e.prototype.contentItemHasFocus=function(){return this.getContentItemWithFocus().length>0},e.prototype.getContentItemWithFocus=function(){var b=a(document.activeElement),c=this.getContent().children(),d=c.filter(b);return d.length||(d=c.has(b)),d},e.prototype.focusContentItem=function(a){a.is(d.CAN_RECEIVE_FOCUS)?a.focus():a.find(d.CAN_RECEIVE_FOCUS).first().focus()},e.prototype.focusFirstContentItem=function(){this.focusContentItem(this.getContent().children().first())},e.prototype.focusLastContentItem=function(){this.focusContentItem(this.getContent().children().last())},e.prototype.focusNextContentItem=function(){var a=this.getContentItemWithFocus();a.length&&a.next()&&this.focusContentItem(a.next())},e.prototype.focusPreviousContentItem=function(){var a=this.getContentItemWithFocus();a.length&&a.prev()&&this.focusContentItem(a.prev())},e.prototype.registerBaseEventListeners=function(){c.define(this.root,[c.events.activate,c.events.escape]),this.root.on(c.events.activate,d.MENU_TOGGLE,function(){this.toggleMenu()}.bind(this)),this.promises.closeHandlers.done(function(){this.root.on(c.events.escape,function(){this.closeMenu(),this.focusMenuToggle()}.bind(this)),a("html").click(function(b){var c=a(b.target);this.root.is(c)||this.root.has(c).length||this.closeMenu()}.bind(this)),c.define(this.getContentContainer(),[c.events.scrollBottom])}.bind(this))},e.prototype.registerListNavigationEventListeners=function(){c.define(this.root,[c.events.down]),this.root.on(c.events.down,function(a,b){this.isMenuOpen()?this.contentItemHasFocus()?this.focusNextContentItem():this.focusFirstContentItem():(this.openMenu(),this.focusFirstContentItem()),b.originalEvent.preventDefault()}.bind(this)),this.promises.navigationHandlers.done(function(){c.define(this.root,[c.events.up,c.events.home,c.events.end]),this.root.on(c.events.up,function(a,b){this.focusPreviousContentItem(),b.originalEvent.preventDefault()}.bind(this)),this.root.on(c.events.home,function(a,b){this.focusFirstContentItem(),b.originalEvent.preventDefault()}.bind(this)),this.root.on(c.events.end,function(a,b){this.focusLastContentItem(),b.originalEvent.preventDefault()}.bind(this))}.bind(this))},e});
  27. define('core/permissionmanager', ["jquery","core/config","core/notification","core/templates"],function(a,b,c,d){var e,f,g,h,i={ADDROLE:"a.allowlink, a.prohibitlink",REMOVEROLE:"a.preventlink, a.unprohibitlink",UNPROHIBIT:"a.unprohibitlink"},j=a.Event("rolesloaded"),k=null,l=function(){var d={contextid:e,getroles:1,sesskey:b.sesskey};a.post(g+"roles/ajax.php",d,null,"json").done(function(b){try{h=b,l=function(){a("body").trigger(j)},l()}catch(d){c.exception(d)}}).fail(function(a,b,d){c.exception(d)})},m=function(b,f,i){var j={contextid:e,roleid:f,sesskey:M.cfg.sesskey,action:i,capability:b.data("name")};a.post(g+"roles/ajax.php",j,null,"json").done(function(e){var i=e;try{var j={rolename:h[f],roleid:f,adminurl:g,imageurl:M.util.image_url("t/delete","moodle")};switch(i){case"allow":j.spanclass="allowed",j.linkclass="preventlink",j.action="prevent";break;case"prohibit":j.spanclass="forbidden",j.linkclass="unprohibitlink",j.action="unprohibit";break;case"prevent":return void b.find('a[data-role-id="'+f+'"]').first().closest(".allowed").remove();case"unprohibit":return void b.find('a[data-role-id="'+f+'"]').first().closest(".forbidden").remove();default:return}d.render("core/permissionmanager_role",j).done(function(c){if("allow"==i)a(c).insertBefore(b.find(".allowmore:first"));else if("prohibit"==i){a(c).insertBefore(b.find(".prohibitmore:first"));var d=b.find(".allowedroles").first().find('a[data-role-id="'+f+'"]');d&&d.first().closest(".allowed").remove()}k.hide()}).fail(c.exception)}catch(l){c.exception(l)}}).fail(function(a,b,d){c.exception(d)})},n=function(b){b.preventDefault(),a("body").one("rolesloaded",function(){var e=a(b.currentTarget),g=e.data("action"),j=e.closest("tr.rolecap"),l={cap:j.data("humanname"),context:f},n=M.util.get_string("role"+g+"info","core_role",l);null===k&&(k=new M.core.dialogue({draggable:!0,modal:!0,closeButton:!0,width:"450px"})),k.set("headerContent",M.util.get_string("role"+g+"header","core_role"));var o,p,q=[];switch(g){case"allow":p=j.find(i.REMOVEROLE);break;case"prohibit":p=j.find(i.UNPROHIBIT)}for(o in h){var r="",s=p.filter("[data-role-id='"+o+"']").length;s&&(r="disabled");var t={roleid:o,rolename:h[o],disabled:r};q.push(t)}d.render("core/permissionmanager_panelcontent",{message:n,roles:q}).done(function(b){k.set("bodyContent",b),k.show(),a("div.role_buttons").delegate("input","click",function(b){var c=a(b.currentTarget).data("role-id");m(j,c,g)})}).fail(c.exception)}),l()},o=function(b){b.preventDefault(),a("body").one("rolesloaded",function(){var d=a(b.currentTarget),e=d.data("action"),g=d.data("role-id"),i=d.closest("tr.rolecap"),j={role:h[g],cap:i.data("humanname"),context:f};c.confirm(M.util.get_string("confirmunassigntitle","core_role"),M.util.get_string("confirmrole"+e,"core_role",j),M.util.get_string("confirmunassignyes","core_role"),M.util.get_string("confirmunassignno","core_role"),function(){m(i,g,e)})}),l()};return{initialize:function(b){e=b.contextid,f=b.contextname,g=b.adminurl;var c=a("body");c.delegate(i.ADDROLE,"click",n),c.delegate(i.REMOVEROLE,"click",o)}}});
  28. define('core/modal_save_cancel', ["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_events"],function(a,b,c,d,e){var f={SAVE_BUTTON:'[data-action="save"]',CANCEL_BUTTON:'[data-action="cancel"]'},g=function(a){d.call(this,a),this.getFooter().find(f.SAVE_BUTTON).length||b.exception({message:"No save button found"}),this.getFooter().find(f.CANCEL_BUTTON).length||b.exception({message:"No cancel button found"})};return g.prototype=Object.create(d.prototype),g.prototype.constructor=g,g.prototype.setFooter=function(){b.exception({message:"Can not change the footer of a save cancel modal"})},g.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this),this.getModal().on(c.events.activate,f.SAVE_BUTTON,function(b,c){var d=a.Event(e.save);this.getRoot().trigger(d,this),d.isDefaultPrevented()||(this.hide(),c.originalEvent.preventDefault())}.bind(this)),this.getModal().on(c.events.activate,f.CANCEL_BUTTON,function(b,c){var d=a.Event(e.cancel);this.getRoot().trigger(d,this),d.isDefaultPrevented()||(this.hide(),c.originalEvent.preventDefault())}.bind(this))},g});
  29. define('core/chart_axis', [],function(){function a(){}return a.prototype.POS_DEFAULT=null,a.prototype.POS_BOTTOM="bottom",a.prototype.POS_LEFT="left",a.prototype.POS_RIGHT="right",a.prototype.POS_TOP="top",a.prototype._label=null,a.prototype._labels=null,a.prototype._max=null,a.prototype._min=null,a.prototype._position=null,a.prototype._stepSize=null,a.prototype.create=function(b){var c=new a;return c.setPosition(b.position),c.setLabel(b.label),c.setStepSize(b.stepSize),c.setMax(b.max),c.setMin(b.min),c.setLabels(b.labels),c},a.prototype.getLabel=function(){return this._label},a.prototype.getLabels=function(){return this._labels},a.prototype.getMax=function(){return this._max},a.prototype.getMin=function(){return this._min},a.prototype.getPosition=function(){return this._position},a.prototype.getStepSize=function(){return this._stepSize},a.prototype.setLabel=function(a){this._label=a||null},a.prototype.setLabels=function(a){this._labels=a||null,null===this._labels||null!==this._stepSize||null!==this._min&&0!==this._min||null!==this._max||(this.setStepSize(1),this.setMin(0),this.setMax(a.length-1))},a.prototype.setMax=function(a){this._max="undefined"!=typeof a?a:null},a.prototype.setMin=function(a){this._min="undefined"!=typeof a?a:null},a.prototype.setPosition=function(a){if(a!=this.POS_DEFAULT&&a!=this.POS_BOTTOM&&a!=this.POS_LEFT&&a!=this.POS_RIGHT&&a!=this.POS_TOP)throw new Error("Invalid axis position.");this._position=a},a.prototype.setStepSize=function(a){if("undefined"==typeof a||null===a)a=null;else{if(isNaN(Number(a)))throw new Error("Value for stepSize is not a number.");a=Number(a)}this._stepSize=a},a});
  30. define('core/templates', ["core/mustache","jquery","core/ajax","core/str","core/notification","core/url","core/log","core/config","core/localstorage","core/event","core/yui","core/log"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=0,n={},o={},p=function(){this.requiredStrings=[],this.requiredJS=[],this.currentThemeName=""};p.prototype.requiredStrings=null,p.prototype.requiredJS=null,p.prototype.currentThemeName="",p.prototype.getTemplate=function(a){var d=a.split("/"),e=d.shift(),f=d.shift(),g=this.currentThemeName+"/"+a;if(g in o)return o[g];var h=i.get("core_template/"+g);if(h)return n[g]=h,o[g]=b.Deferred().resolve(h).promise(),o[g];var j=c.call([{methodname:"core_output_load_template",args:{component:e,template:f,themename:this.currentThemeName}}],!0,!1);return o[g]=j[0].then(function(a){return n[g]=a,i.set("core_template/"+g,a),a}),o[g]},p.prototype.partialHelper=function(a){var b=this.currentThemeName+"/"+a;return b in n||e.exception(new Error("Failed to pre-fetch the template: "+a)),n[b]},p.prototype.pixHelper=function(b,c,d){var e,g=c.split(","),h="",i="",j="";g.length>0&&(h=g.shift().trim()),g.length>0&&(i=g.shift().trim()),g.length>0&&(j=g.join(",").trim());var k=f.imageUrl(h,i),l={attributes:[{name:"src",value:k},{name:"alt",value:d(j)},{name:"title",value:d(j)},{name:"class",value:"smallicon"}]},m=this.currentThemeName+"/core/pix_icon",o=n[m];return e=a.render(o,l,this.partialHelper.bind(this)),e.trim()},p.prototype.jsHelper=function(a,b,c){return this.requiredJS.push(c(b,a)),""},p.prototype.stringHelper=function(a,b,c){var d=b.split(","),e="",f="",g="";d.length>0&&(e=d.shift().trim()),d.length>0&&(f=d.shift().trim()),d.length>0&&(g=d.join(",").trim()),""!==g&&(g=c(g,a)),0===g.indexOf("{")&&0!==g.indexOf("{{")&&(g=JSON.parse(g));var h=this.requiredStrings.length;return this.requiredStrings.push({key:e,component:f,param:g}),"[[_s"+h+"]]"},p.prototype.quoteHelper=function(a,b,c){var d=c(b.trim(),a);return d=d.replace('"','\\"').replace(/([\{\}]{2,3})/g,"{{=<% %>=}}$1<%={{ }}=%>"),'"'+d+'"'},p.prototype.addHelpers=function(a,b){this.currentThemeName=b,this.requiredStrings=[],this.requiredJS=[],a.uniqid=m++,a.str=function(){return this.stringHelper.bind(this,a)}.bind(this),a.pix=function(){return this.pixHelper.bind(this,a)}.bind(this),a.js=function(){return this.jsHelper.bind(this,a)}.bind(this),a.quote=function(){return this.quoteHelper.bind(this,a)}.bind(this),a.globals={config:h},a.currentTheme=b},p.prototype.getJS=function(a){var b="";return this.requiredJS.length>0&&(b=this.requiredJS.join(";\n")),this.treatStringsInContent(b,a)},p.prototype.treatStringsInContent=function(a,b){var c,d,e,f,g,h,i=/\[\[_s\d+\]\]/;do{for(c="",d=a.search(i);d>-1;){c+=a.substring(0,d),a=a.substr(d),e="",f=4,g=a.substr(f,1);do e+=g,f++,g=a.substr(f,1);while("]"!=g);h=b[parseInt(e,10)],"undefined"==typeof h&&(l.debug("Could not find string for pattern [[_s"+e+"]]."),h=""),c+=h,a=a.substr(6+e.length),d=a.search(i)}a=c+a,d=a.search(i)}while(d>-1);return a},p.prototype.doRender=function(c,e,f){return this.currentThemeName=f,this.getTemplate("core/pix_icon").then(function(){this.addHelpers(e,f);var g=a.render(c,e,this.partialHelper.bind(this));return this.requiredStrings.length>0?d.get_strings(this.requiredStrings).then(function(a){return g=this.treatStringsInContent(g,a),b.Deferred().resolve(g,this.getJS(a)).promise()}.bind(this)):b.Deferred().resolve(g.trim(),this.getJS([])).promise()}.bind(this))};var q=function(a){if(""!==a.trim()){var c=b("<script>").attr("type","text/javascript").html(a);b("head").append(c)}},r=function(a,c,d,e){var f=b(a);if(f.length){var g=b(c),h=null;e?(h=new k.NodeList(f.children().get()),h.destroy(!0),f.empty(),f.append(g)):(h=new k.NodeList(f.get()),h.destroy(!0),f.replaceWith(g)),q(d),j.notifyFilterContentUpdated(g)}};p.prototype.scanForPartials=function(b){var c=a.parse(b),d=[],e=function(a,b){var c,d;for(c=0;c<a.length;c++)d=a[c],">"!=d[0]&&"<"!=d[0]||b.push(d[1]),d.length>4&&e(d[4],b)};return e(c,d),d},p.prototype.cachePartials=function(a){return this.getTemplate(a).then(function(a){var c,d=this.scanForPartials(a),e=[];for(c=0;c<d.length;c++){var f=this.currentThemeName+"/"+d[c];f in o?e.push(o[f]):e.push(this.cachePartials(d[c]))}return b.when.apply(b,e).then(function(){return a})}.bind(this))},p.prototype.render=function(a,b,c){return"undefined"==typeof c&&(c=h.theme),this.currentThemeName=c,this.cachePartials(a).then(function(a){return this.doRender(a,b,c)}.bind(this))};var s=function(a,c,d){var e=b(a);e.length&&(e.prepend(c),q(d),j.notifyFilterContentUpdated(e))},t=function(a,c,d){var e=b(a);e.length&&(e.append(c),q(d),j.notifyFilterContentUpdated(e))};return{render:function(a,b,c){var d=new p;return d.render(a,b,c)},runTemplateJS:q,replaceNodeContents:function(a,b,c){r(a,b,c,!0)},replaceNode:function(a,b,c){r(a,b,c,!1)},prependNodeContents:function(a,b,c){s(a,b,c)},appendNodeContents:function(a,b,c){t(a,b,c)}}});
  31. define('core/str', ["jquery","core/ajax","core/localstorage"],function(a,b,c){var d=[];return{get_string:function(a,b,c,d){var e=this.get_strings([{key:a,component:b,param:c,lang:d}]);return e.then(function(a){return a[0]})},get_strings:function(e){var f,g=a.Deferred(),h=[],i=0,j=!1;for(i=0;i<e.length;i++)if(f=e[i],"undefined"==typeof f.lang&&(f.lang=a("html").attr("lang").replace("-","_")),f.cacheKey="core_str/"+f.key+"/"+f.component+"/"+f.lang,"undefined"==typeof M.str[f.component]||"undefined"==typeof M.str[f.component][f.key]){var k=c.get(f.cacheKey);k?("undefined"==typeof M.str[f.component]&&(M.str[f.component]=[]),M.str[f.component][f.key]=k):j=!0}if(j){var l=[],m=[],n=function(a){this.resolve(a)},o=function(a){this.reject(a)};for(i=0;i<e.length;i++)if(f=e[i],"undefined"!=typeof d[f.cacheKey])m.push(d[f.cacheKey]);else{var p=a.Deferred();l.push({methodname:"core_get_string",args:{stringid:f.key,component:f.component,lang:f.lang,stringparams:[]},done:n.bind(p),fail:o.bind(p)}),d[f.cacheKey]=p.promise(),m.push(d[f.cacheKey])}l.length>0&&b.call(l,!0,!1),a.when.apply(null,m).done(function(){var a=0;for(a=0;a<arguments.length;a++)f=e[a],"undefined"==typeof M.str[f.component]&&(M.str[f.component]=[]),M.str[f.component][f.key]=arguments[a],c.set("core_str/"+f.key+"/"+f.component+"/"+f.lang,arguments[a]),h[a]=M.util.get_string(f.key,f.component,f.param).trim();g.resolve(h)}).fail(function(a){g.reject(a)})}else{for(i=0;i<e.length;i++)f=e[i],h[i]=M.util.get_string(f.key,f.component,f.param);g.resolve(h)}return g.promise()}}});
  32. define('core/search-input', ["jquery"],function(a){var b=null,c=function(a){b.hasClass("expanded")?e():d(a)},d=function(c){var d=a(document).width();if("keydown"!==c.type||13===c.keyCode||32===c.keyCode)return d<=767&&("click"===c.type||"keydown"===c.type)?void f():void(d<=767||("keydown"===c.type&&c.preventDefault(),b.addClass("expanded"),b.find("form").addClass("expanded"),b.find("input").focus()))},e=function(){b.removeClass("expanded"),b.find("form").removeClass("expanded")},f=function(){b.find("form").submit()};return{init:function(d){b=a("#"+d),b.on("click mouseover keydown","div",c)}}});
  33. define('core/fragment', ["jquery","core/ajax"],function(a,b){var c=function(c,d,e,f){var g=[];for(var h in f)g.push({name:h,value:f[h]});var i=a.Deferred(),j=b.call([{methodname:"core_get_fragment",args:{component:c,callback:d,contextid:e,args:g}}],!1);return j[0].done(function(a){i.resolve(a)}).fail(function(a){i.reject(a)}),i.promise()};return{loadFragment:function(b,d,e,f){var g=a.Deferred();return a.when(c(b,d,e,f)).then(function(b){var c=a(b.javascript),d="";c.each(function(b,c){c=a(c);var e=c.prop("tagName");if(e&&"script"==e.toLowerCase())if(c.attr("src")){var f=!1;a("script").each(function(b,d){return a(d).attr("src")==c.attr("src")&&(f=!0),!f}),f||(d+=" { ",d+=' node = document.createElement("script"); ',d+=' node.type = "text/javascript"; ',d+=' node.src = decodeURI("'+encodeURI(c.attr("src"))+'"); ',d+=' document.getElementsByTagName("head")[0].appendChild(node); ',d+=" } ")}else d+=" "+c.text()}),g.resolve(b.html,d)}).fail(function(a){g.reject(a)}),g.promise()}}});
  34. define('core/backoff_timer', function(){var a=function(a,b){this.callback=a,this.backOffFunction=b};return a.prototype.callback=null,a.prototype.backOffFunction=null,a.prototype.time=null,a.prototype.timeout=null,a.prototype.generateNextTime=function(){var a=this.backOffFunction(this.time);return this.time=a,a},a.prototype.reset=function(){return this.time=null,this.stop(),this},a.prototype.stop=function(){return this.timeout&&(window.clearTimeout(this.timeout),this.timeout=null),this},a.prototype.start=function(){if(!this.timeout){var a=this.generateNextTime();this.timeout=window.setTimeout(function(){this.callback(),this.stop(),this.start()}.bind(this),a)}return this},a.prototype.restart=function(){return this.reset().start()},a.getIncrementalCallback=function(a,b,c,d){return function(e){return e?e+b>c?d:e+b:a}},a});
  35. define('core/modal_cancel', ["jquery","core/notification","core/custom_interaction_events","core/modal","core/modal_events"],function(a,b,c,d,e){var f={CANCEL_BUTTON:'[data-action="cancel"]'},g=function(a){d.call(this,a),this.getFooter().find(f.CANCEL_BUTTON).length||b.exception({message:"No cancel button found"})};return g.prototype=Object.create(d.prototype),g.prototype.constructor=g,g.prototype.setFooter=function(){b.exception({message:"Can not change the footer of a cancel modal"})},g.prototype.registerEventListeners=function(){d.prototype.registerEventListeners.call(this),this.getModal().on(c.events.activate,f.CANCEL_BUTTON,function(b,c){var d=a.Event(e.cancel);this.getRoot().trigger(d,this),d.isDefaultPrevented()||(this.hide(),c.originalEvent.preventDefault())}.bind(this))},g});
  36. define('core/tree', ["jquery"],function(a){var b={ITEM:"[role=treeitem]",GROUP:"[role=treeitem]:has([role=group]), [role=treeitem][aria-owns], [role=treeitem][data-requires-ajax=true]",CLOSED_GROUP:"[role=treeitem]:has([role=group])[aria-expanded=false], [role=treeitem][aria-owns][aria-expanded=false], [role=treeitem][data-requires-ajax=true][aria-expanded=false]",FIRST_ITEM:"[role=treeitem]:first",VISIBLE_ITEM:"[role=treeitem]:visible",UNLOADED_AJAX_ITEM:"[role=treeitem][data-requires-ajax=true][data-loaded=false][aria-expanded=true]"},c=function(c,d){this.treeRoot=a(c),this.treeRoot.data("activeItem",null),this.selectCallback=d,this.keys={tab:9,enter:13,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,asterisk:106},this.initialiseNodes(this.treeRoot),this.setActiveItem(this.treeRoot.find(b.FIRST_ITEM)),this.refreshVisibleItemsCache(),this.bindEventHandlers()};return c.prototype.refreshVisibleItemsCache=function(){this.treeRoot.data("visibleItems",this.treeRoot.find(b.VISIBLE_ITEM))},c.prototype.getVisibleItems=function(){return this.treeRoot.data("visibleItems")},c.prototype.setActiveItem=function(a){var b=this.treeRoot.data("activeItem");a!==b&&(b&&(b.attr("tabindex","-1"),b.attr("aria-selected","false")),a.attr("tabindex","0"),a.attr("aria-selected","true"),this.treeRoot.data("activeItem",a),"function"==typeof this.selectCallback&&this.selectCallback(a))},c.prototype.isGroupItem=function(a){return a.is(b.GROUP)},c.prototype.getGroupFromItem=function(a){return this.treeRoot.find("#"+a.attr("aria-owns"))||a.children("[role=group]")},c.prototype.isGroupCollapsed=function(a){return"false"===a.attr("aria-expanded")},c.prototype.isGroupCollapsible=function(a){return"false"!==a.attr("data-collapsible")},c.prototype.initialiseNodes=function(c){this.removeAllFromTabOrder(c),this.setAriaSelectedFalseOnItems(c);var d=this;c.find(b.UNLOADED_AJAX_ITEM).each(function(){var b=a(this);d.collapseGroup(b),d.expandGroup(b)})},c.prototype.removeAllFromTabOrder=function(b){b.find("*").attr("tabindex","-1"),this.getGroupFromItem(a(b)).find("*").attr("tabindex","-1")},c.prototype.setAriaSelectedFalseOnItems=function(a){a.find(b.ITEM).attr("aria-selected","false")},c.prototype.expandAllGroups=function(){var c=this;this.treeRoot.find(b.CLOSED_GROUP).each(function(){var b=a(this);c.expandGroup(a(this)).done(function(){c.expandAllChildGroups(b)})})},c.prototype.expandAllChildGroups=function(c){var d=this;this.getGroupFromItem(c).find(b.CLOSED_GROUP).each(function(){var b=a(this);d.expandGroup(a(this)).done(function(){d.expandAllChildGroups(b)})})},c.prototype.expandGroup=function(b){var c=a.Deferred();if("false"!==b.attr("data-expandable")&&this.isGroupCollapsed(b))if("true"===b.attr("data-requires-ajax")&&"true"!==b.attr("data-loaded")){b.attr("data-loaded",!1);var d=b.closest("[data-ajax-loader]").attr("data-ajax-loader"),e=this;b.addClass("loading"),require([d],function(a){a.load(b).done(function(){b.attr("data-loaded",!0),e.initialiseNodes(b),e.finishExpandingGroup(b),b.removeClass("loading"),c.resolve()})})}else this.finishExpandingGroup(b),c.resolve();else c.resolve();return c},c.prototype.finishExpandingGroup=function(a){var b=this.getGroupFromItem(a);b.attr("aria-hidden","false"),a.attr("aria-expanded","true"),this.refreshVisibleItemsCache()},c.prototype.collapseGroup=function(a){if(this.isGroupCollapsible(a)&&!this.isGroupCollapsed(a)){var b=this.getGroupFromItem(a);b.attr("aria-hidden","true"),a.attr("aria-expanded","false"),this.refreshVisibleItemsCache()}},c.prototype.toggleGroup=function(a){"true"===a.attr("aria-expanded")?this.collapseGroup(a):this.expandGroup(a)},c.prototype.handleKeyDown=function(c,d){var e=this.getVisibleItems().index(c);if(d.altKey||d.ctrlKey||d.metaKey||d.shiftKey&&d.keyCode!=this.keys.tab)return!0;switch(d.keyCode){case this.keys.home:return this.getVisibleItems().first().focus(),d.stopPropagation(),!1;case this.keys.end:return this.getVisibleItems().last().focus(),d.stopPropagation(),!1;case this.keys.enter:var f=c.children("a").length?c.children("a"):c.children().not(b.GROUP).find("a");return f.length?window.location.href=f.first().attr("href"):this.isGroupItem(c)&&this.toggleGroup(c,!0),d.stopPropagation(),!1;case this.keys.space:return this.isGroupItem(c)&&this.toggleGroup(c,!0),d.stopPropagation(),!1;case this.keys.left:var g=function(b){b.getVisibleItems().filter(function(){return b.getGroupFromItem(a(this)).has(c).length}).focus()};return this.isGroupItem(c)?this.isGroupCollapsed(c)?g(this):this.collapseGroup(c):g(this),d.stopPropagation(),!1;case this.keys.right:return this.isGroupItem(c)&&(this.isGroupCollapsed(c)?this.expandGroup(c):this.getGroupFromItem(c).find(b.ITEM).first().focus()),d.stopPropagation(),!1;case this.keys.up:if(e>0){var h=this.getVisibleItems().eq(e-1);h.focus()}return d.stopPropagation(),!1;case this.keys.down:if(e<this.getVisibleItems().length-1){var i=this.getVisibleItems().eq(e+1);i.focus()}return d.stopPropagation(),!1;case this.keys.asterisk:return this.expandAllGroups(),d.stopPropagation(),!1}return!0},c.prototype.handleClick=function(a,b){return!!(b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)||(a.focus(),this.isGroupItem(a)&&this.toggleGroup(a),b.stopPropagation(),!0)},c.prototype.handleFocus=function(a,b){return this.setActiveItem(a),b.stopPropagation(),!0},c.prototype.bindEventHandlers=function(){var c=this;this.treeRoot.on({click:function(b){return c.handleClick(a(this),b)},keydown:function(b){return c.handleKeyDown(a(this),b)},focus:function(b){return c.handleFocus(a(this),b)}},b.ITEM)},c});
  37. define('core/chartjs', ["core/chartjs-lazy"],function(a){return a});
  38. define('core/modal', ["jquery","core/templates","core/notification","core/key_codes","core/custom_interaction_events","core/modal_backdrop","core/modal_events"],function(a,b,c,d,e,f,g){var h,i={CONTAINER:'[data-region="modal-container"]',MODAL:'[data-region="modal"]',HEADER:'[data-region="header"]',TITLE:'[data-region="title"]',BODY:'[data-region="body"]',FOOTER:'[data-region="footer"]',HIDE:'[data-action="hide"]',DIALOG:"[role=dialog]",MENU_BAR:"[role=menubar]",HAS_Z_INDEX:".moodle-has-zindex",CAN_RECEIVE_FOCUS:'input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]'},j={LOADING:"core/loading",BACKDROP:"core/modal_backdrop"},k=function(b){this.root=a(b),this.modal=this.root.find(i.MODAL),this.header=this.modal.find(i.HEADER),this.title=this.header.find(i.TITLE),this.body=this.modal.find(i.BODY),this.footer=this.modal.find(i.FOOTER),this.hiddenSiblings=[],this.isAttached=!1,this.bodyJS=null,this.footerJS=null,this.root.is(i.CONTAINER)||c.exception({message:"Element is not a modal container"}),this.modal.length||c.exception({message:"Container does not contain a modal"}),this.header.length||c.exception({message:"Modal is missing a header region"}),this.title.length||c.exception({message:"Modal header is missing a title region"}),this.body.length||c.exception({message:"Modal is missing a body region"}),this.footer.length||c.exception({message:"Modal is missing a footer region"}),this.registerEventListeners()};return k.prototype.attachToDOM=function(){this.isAttached||(a("body").append(this.root),this.bodyJS&&(b.runTemplateJS(this.bodyJS),this.bodyJS=null),this.footerJS&&(b.runTemplateJS(this.footerJS),this.footerJS=null),this.isAttached=!0)},k.prototype.countOtherVisibleModals=function(){var b=0;return a("body").find(i.CONTAINER).each(function(c,d){d=a(d),!this.root.is(d)&&d.hasClass("show")&&b++}.bind(this)),b},k.prototype.getBackdrop=function(){return h||(h=b.render(j.BACKDROP,{}).then(function(b){var c=a(b);return new f(c)}).fail(c.exception)),h},k.prototype.getRoot=function(){return this.root},k.prototype.getModal=function(){return this.modal},k.prototype.getTitle=function(){return this.title},k.prototype.getBody=function(){return this.body},k.prototype.getFooter=function(){return this.footer},k.prototype.setTitle=function(a){var b=this.getTitle();b.html(a)},k.prototype.setBody=function(a){var c=this.getBody();"string"==typeof a?c.html(a):b.render(j.LOADING,{}).done(function(d){c.html(d),a.done(function(a,d){c.html(a),d&&(this.isAttached?b.runTemplateJS(d):this.bodyJS=d)}.bind(this))}.bind(this))},k.prototype.setFooter=function(a){var c=this.getFooter();"string"==typeof a?c.html(a):b.render(j.LOADING,{}).done(function(d){c.html(d),a.done(function(a,d){c.html(a),d&&(this.isAttached?b.runTemplateJS(d):this.footerJS=d)}.bind(this))}.bind(this))},k.prototype.setLarge=function(){this.isLarge()||this.getRoot().addClass("large")},k.prototype.isLarge=function(){return this.getRoot().hasClass("large")},k.prototype.setSmall=function(){this.isSmall()||this.getRoot().removeClass("large")},k.prototype.isSmall=function(){return!this.getRoot().hasClass("large")},k.prototype.calculateZIndex=function(){var b=a(i.DIALOG+", "+i.MENU_BAR+", "+i.HAS_Z_INDEX),c=parseInt(this.root.css("z-index"));return b.each(function(b,d){d=a(d);var e=d.css("z-index")?parseInt(d.css("z-index")):0;e>c&&(c=e)}),c},k.prototype.isVisible=function(){return this.root.hasClass("show")},k.prototype.hasFocus=function(){var b=a(document.activeElement);return this.root.is(b)||this.root.has(b).length},k.prototype.hasTransitions=function(){return this.getRoot().hasClass("fade")},k.prototype.show=function(){this.isVisible()||(this.isAttached||this.attachToDOM(),this.getBackdrop().done(function(b){var c=this.calculateZIndex(),d=c+2,e=d-1;this.root.css("z-index",d),b.setZIndex(e),b.show(),this.root.removeClass("hide").addClass("show"),this.accessibilityShow(),this.getTitle().focus(),a("body").addClass("modal-open"),this.root.trigger(g.shown,this)}.bind(this)))},k.prototype.hide=function(){this.isVisible()&&this.getBackdrop().done(function(b){this.countOtherVisibleModals()||(b.hide(),a("body").removeClass("modal-open"));var c=parseInt(this.root.css("z-index"));this.root.css("z-index",""),b.setZIndex(c-3),this.accessibilityHide(),this.hasTransitions()?this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",function(){this.getRoot().removeClass("show").addClass("hide")}.bind(this)):this.getRoot().removeClass("show").addClass("hide"),this.root.trigger(g.hidden,this)}.bind(this))},k.prototype.destroy=function(){this.root.remove(),this.root.trigger(g.destroyed,this)},k.prototype.accessibilityShow=function(){a("body").children().each(function(b,c){if(!this.root.is(c)){c=a(c);var d=c.attr("aria-hidden");"true"!==d&&(c.data("previous-aria-hidden",d),this.hiddenSiblings.push(c),c.attr("aria-hidden","true"))}}.bind(this)),this.root.attr("aria-hidden","false")},k.prototype.accessibilityHide=function(){this.root.attr("aria-hidden","true"),a.each(this.hiddenSiblings,function(b,c){c=a(c);var d=c.data("previous-aria-hidden");"undefined"==typeof d?c.removeAttr("aria-hidden"):c.attr("aria-hidden",d)}),this.hiddenSiblings=[]},k.prototype.handleTabLock=function(b){if(this.hasFocus()){var c=a(document.activeElement),d=this.modal.find(i.CAN_RECEIVE_FOCUS),e=d.first(),f=d.last();c.is(e)&&b.shiftKey?(f.focus(),b.preventDefault()):c.is(f)&&!b.shiftKey&&(e.focus(),b.preventDefault())}},k.prototype.registerEventListeners=function(){this.getRoot().on("keydown",function(a){this.isVisible()&&(a.keyCode==d.tab?this.handleTabLock(a):a.keyCode==d.escape&&this.hide())}.bind(this)),e.define(this.getModal(),[e.events.activate]),this.getModal().on(e.events.activate,i.HIDE,function(a,b){this.hide(),b.originalEvent.preventDefault()}.bind(this))},k});
  39. define('core/chart_pie', ["core/chart_base"],function(a){function b(){a.prototype.constructor.apply(this,arguments)}return b.prototype=Object.create(a.prototype),b.prototype.TYPE="pie",b.prototype._doughnut=null,b.prototype.create=function(b,c){var d=a.prototype.create.apply(this,arguments);return d.setDoughnut(c.doughnut),d},b.prototype.addSeries=function(b){if(null===b.getColor()){for(var c=[],d=this.getConfigColorSet()||a.prototype.COLORSET,e=0;e<b.getCount();e++)c.push(d[e%d.length]);b.setColors(c)}return a.prototype.addSeries.apply(this,arguments)},b.prototype.getDoughnut=function(){return this._doughnut},b.prototype.setDoughnut=function(a){this._doughnut=Boolean(a)},b.prototype._validateSeries=function(){if(this._series.length>=1)throw new Error("Pie charts only support one serie.");return a.prototype._validateSeries.apply(this,arguments)},b});
  40. define('core/log', ["core/loglevel"],function(a){var b=a.methodFactory;return a.methodFactory=function(a,c){var d=b(a,c);return function(a,b){d(b?b+": "+a:a)}},a.setConfig=function(b){"undefined"!=typeof b.level&&a.setLevel(b.level)},a});
  41. define('core/chart_series', [],function(){function a(a,b){if("string"!=typeof a)throw new Error("Invalid label for series.");if("object"!=typeof b)throw new Error("Values for a series must be an array.");if(b.length<1)throw new Error("Invalid values received for series.");this._colors=[],this._label=a,this._values=b}return a.prototype.TYPE_DEFAULT=null,a.prototype.TYPE_LINE="line",a.prototype._colors=null,a.prototype._label=null,a.prototype._labels=null,a.prototype._smooth=!1,a.prototype._type=a.prototype.TYPE_DEFAULT,a.prototype._values=null,a.prototype._xaxis=null,a.prototype._yaxis=null,a.prototype.create=function(b){var c=new a(b.label,b.values);return c.setType(b.type),c.setXAxis(b.axes.x),c.setYAxis(b.axes.y),c.setLabels(b.labels),b.colors&&b.colors.length>1?c.setColors(b.colors):c.setColor(b.colors[0]),c.setSmooth(b.smooth),c},a.prototype.getColor=function(){return this._colors[0]||null},a.prototype.getColors=function(){return this._colors},a.prototype.getCount=function(){return this._values.length},a.prototype.getLabel=function(){return this._label},a.prototype.getLabels=function(){return this._labels},a.prototype.getSmooth=function(){return this._smooth},a.prototype.getType=function(){return this._type},a.prototype.getValues=function(){return this._values},a.prototype.getXAxis=function(){return this._xaxis},a.prototype.getYAxis=function(){return this._yaxis},a.prototype.hasColoredValues=function(){return this._colors.length==this.getCount()},a.prototype.setColor=function(a){this._colors=[a]},a.prototype.setColors=function(a){if(a&&a.length!=this.getCount())throw new Error("When setting multiple colors there must be one per value.");this._colors=a||[]},a.prototype.setLabels=function(a){this._validateLabels(a),a="undefined"==typeof a?null:a,this._labels=a},a.prototype.setSmooth=function(a){a="undefined"==typeof a?null:a,this._smooth=a},a.prototype.setType=function(a){if(a!=this.TYPE_DEFAULT&&a!=this.TYPE_LINE)throw new Error("Invalid serie type.");this._type=a||null},a.prototype.setXAxis=function(a){this._xaxis=a||null},a.prototype.setYAxis=function(a){this._yaxis=a||null},a.prototype._validateLabels=function(a){if(a&&a.length>0&&a.length!=this.getCount())throw new Error("Series labels must match series values.")},a});
  42. define('core/chart_output_chartjs', ["jquery","core/chartjs","core/chart_axis","core/chart_bar","core/chart_output_base","core/chart_line","core/chart_pie","core/chart_series"],function(a,b,c,d,e,f,g,h){function i(){e.prototype.constructor.apply(this,arguments),this._canvas=this._node,"CANVAS"!=this._canvas.prop("tagName")&&(this._canvas=a("<canvas>"),this._node.append(this._canvas)),this._build()}var j=function(a,b){return"axis-"+a+"-"+b};return i.prototype=Object.create(e.prototype),i.prototype._config=null,i.prototype._chartjs=null,i.prototype._canvas=null,i.prototype._build=function(){this._config=this._makeConfig(),this._chartjs=new b(this._canvas[0],this._config)},i.prototype._cleanData=function(b){return b instanceof Array?b.map(function(b){return a("<span>").html(b).text()}):a("<span>").html(b).text()},i.prototype._getChartType=function(){var a=this._chart.getType();return this._chart.getType()===d.prototype.TYPE&&this._chart.getHorizontal()===!0?a="horizontalBar":this._chart.getType()===g.prototype.TYPE&&this._chart.getDoughnut()===!0&&(a="doughnut"),a},i.prototype._makeAxisConfig=function(a,b,d){var e={id:j(b,d)};return a.getPosition()!==c.prototype.POS_DEFAULT&&(e.position=a.getPosition()),null!==a.getLabel()&&(e.scaleLabel={display:!0,labelString:this._cleanData(a.getLabel())}),null!==a.getStepSize()&&(e.ticks=e.ticks||{},e.ticks.stepSize=a.getStepSize()),null!==a.getMax()&&(e.ticks=e.ticks||{},e.ticks.max=a.getMax()),null!==a.getMin()&&(e.ticks=e.ticks||{},e.ticks.min=a.getMin()),e},i.prototype._makeConfig=function(){var a={type:this._getChartType(),data:{labels:this._cleanData(this._chart.getLabels()),datasets:this._makeDatasetsConfig()},options:{title:{display:null!==this._chart.getTitle(),text:this._cleanData(this._chart.getTitle())}}};return this._chart.getXAxes().forEach(function(b,c){var d=b.getLabels();a.options.scales=a.options.scales||{},a.options.scales.xAxes=a.options.scales.xAxes||[],a.options.scales.xAxes[c]=this._makeAxisConfig(b,"x",c),null!==d&&(a.options.scales.xAxes[c].ticks.callback=function(a,b){return d[b]||""}),a.options.scales.xAxes[c].stacked=this._isStacked()}.bind(this)),this._chart.getYAxes().forEach(function(b,c){var d=b.getLabels();a.options.scales=a.options.scales||{},a.options.scales.yAxes=a.options.scales.yAxes||[],a.options.scales.yAxes[c]=this._makeAxisConfig(b,"y",c),null!==d&&(a.options.scales.yAxes[c].ticks.callback=function(a){return d[parseInt(a,10)]||""}),a.options.scales.yAxes[c].stacked=this._isStacked()}.bind(this)),a.options.tooltips={callbacks:{label:this._makeTooltip.bind(this)}},a},i.prototype._makeDatasetsConfig=function(){var a=this._chart.getSeries().map(function(a){var b=a.hasColoredValues()?a.getColors():a.getColor(),c={label:this._cleanData(a.getLabel()),data:a.getValues(),type:a.getType(),fill:!1,backgroundColor:b,borderColor:this._chart.getType()==g.prototype.TYPE?null:b,lineTension:this._isSmooth(a)?.3:0};return null!==a.getXAxis()&&(c.xAxisID=j("x",a.getXAxis())),null!==a.getYAxis()&&(c.yAxisID=j("y",a.getYAxis())),c}.bind(this));return a},i.prototype._makeTooltip=function(a,b){var c=this._chart.getSeries()[a.datasetIndex],d=c.getLabel(),e=c.getLabels(),f=b.datasets[a.datasetIndex].data,g=f[a.index],h=this._cleanData(d)+": "+g;return null!==e&&(h=this._cleanData(e[a.index])),h},i.prototype._isSmooth=function(a){var b=!1;return this._chart.getType()===f.prototype.TYPE?(b=a.getSmooth(),null===b&&(b=this._chart.getSmooth())):a.getType()===h.prototype.TYPE_LINE&&(b=a.getSmooth()),b},i.prototype._isStacked=function(){var a=!1;return this._chart.getType()===d.prototype.TYPE&&(a=this._chart.getStacked()),a},i.prototype.update=function(){a.extend(!0,this._config,this._makeConfig()),this._chartjs.update()},i});
  43. define('core/event', ["jquery","core/yui"],function(a,b){return{Events:{FORM_FIELD_VALIDATION:"core_form-field-validation"},getLegacyEvents:function(){var c=a.Deferred();return b.use("event","moodle-core-event",function(){c.resolve(window.M.core.event)}),c.promise()},notifyFilterContentUpdated:function(c){c=a(c),b.use("event","moodle-core-event",function(b){a(document).trigger(M.core.event.FILTER_CONTENT_UPDATED,[c]);var d=new b.NodeList(c.get());b.fire(M.core.event.FILTER_CONTENT_UPDATED,{nodes:d})})},notifyEditorContentRestored:function(){b.use("event","moodle-core-event",function(b){a(document).trigger(M.core.event.EDITOR_CONTENT_RESTORED),b.fire(M.core.event.EDITOR_CONTENT_RESTORED)})}}});
  44. define('core/chart_output_htmltable', ["jquery","core/chart_output_base"],function(a,b){function c(){b.prototype.constructor.apply(this,arguments),this._build()}return c.prototype=Object.create(b.prototype),c.prototype._build=function(){this._node.empty(),this._node.append(this._makeTable())},c.prototype._makeTable=function(){var b,c,d,e=a("<table>"),f=this._chart,g=f.getLabels(),h=g.length>0,i=f.getSeries(),j=i[0].getCount();e.addClass("chart-output-htmltable generaltable"),null!==f.getTitle()&&e.append(a("<caption>").text(f.getTitle())),b=a("<tr>"),h&&b.append(a("<td>")),i.forEach(function(c){b.append(a("<th>").text(c.getLabel()).attr("scope","col"))}),e.append(b);for(var k=0;k<j;k++){b=a("<tr>"),g.length>0&&b.append(a("<th>").text(g[k]).attr("scope","row"));for(var l=0;l<i.length;l++)c=i[l].getValues()[k],d=i[l].getLabels(),null!==d&&(c=i[l].getLabels()[k]),b.append(a("<td>").text(c));e.append(b)}return e},c.prototype.update=function(){this._build()},c});
  45. define('core/addblockmodal', ["jquery","core/modal_factory","core/templates","core/str","core/notification"],function(a,b,c,d,e){return{init:function(f){var g=a("[data-key=addblock]");d.get_string("addblock").done(function(e){var h=[];a.each(f.blocks,function(a,b){h[h.length]={key:"pluginname",component:"block_"+b}});var i=[];d.get_strings(h).done(function(d){a.each(d,function(a,b){i[i.length]={name:f.blocks[a],title:b}}),f.blocks=i,b.create({title:e,body:c.render("core/add_block_body",f),type:"CANCEL"},g)})}).fail(e.exception)}}});
  46. define('core/auto_rows', ["jquery"],function(a){var b={ELEMENT:"[data-auto-rows]"},c={ROW_CHANGE:"autorows:rowchange"},d=function(a){var b=a.attr("rows"),c=a.attr("data-max-rows"),d=a.height(),e=a.innerHeight(),f=e-d;a.height("1px");var g=a[0].scrollHeight,h=(g-f)/(d/b);return a.css("height",""),c&&h>=c?c:h},e=function(e){a(e).on("input propertychange",b.ELEMENT,function(b){var f=a(b.target),g=f.attr("rows"),h=d(f);h!=g&&(f.attr("rows",h),a(e).trigger(c.ROW_CHANGE))})};return{init:e,events:c}});
  47. define('core/config', function(){return M.cfg});
  48. define('core_form/passwordunmask', ["jquery","core/templates"],function(a,b){var c=function(b){this.wrapperSelector='[data-passwordunmask="wrapper"][data-passwordunmaskid="'+b+'"]',this.wrapper=a(this.wrapperSelector),this.editorSpace=this.wrapper.find('[data-passwordunmask="editor"]'),this.editLink=this.wrapper.find('a[data-passwordunmask="edit"]'),this.editInstructions=this.wrapper.find('[data-passwordunmask="instructions"]'),this.displayValue=this.wrapper.find('[data-passwordunmask="displayvalue"]'),this.inputFieldLabel=a('label[for="'+b+'"]'),this.inputField=this.editorSpace.find(document.getElementById(b)),this.inputField.attr("type","hidden"),this.inputField.removeClass("hiddenifjs"),this.editInstructions.attr("id")||this.editInstructions.attr("id",b+"_instructions"),this.editInstructions.hide(),this.setDisplayValue(),this.addListeners()};return c.prototype.addListeners=function(){return this.wrapper.on("click keypress",'[data-passwordunmask="edit"]',a.proxy(function(b){"keypress"===b.type&&13!==b.keyCode||(b.stopImmediatePropagation(),b.preventDefault(),"hidden"!==this.inputField.attr("type")?"click"===b.type||a(b.relatedTarget).is(":input")?this.turnEditingOff(!1):this.turnEditingOff(!0):this.turnEditingOn())},this)),this.wrapper.on("click keypress",'[data-passwordunmask="unmask"]',a.proxy(function(a){"keypress"===a.type&&13!==a.keyCode||(a.stopImmediatePropagation(),a.preventDefault(),this.wrapper.data("unmasked",!this.wrapper.data("unmasked")),this.setDisplayValue())},this)),this.wrapper.on("keydown","input",a.proxy(function(a){"keydown"===a.type&&13!==a.keyCode||(a.stopImmediatePropagation(),a.preventDefault(),this.turnEditingOff(!0))},this)),this.inputFieldLabel.on("click",a.proxy(function(a){a.preventDefault(),this.turnEditingOn()},this)),this},c.prototype.checkFocusOut=function(b){this.isEditing()&&window.setTimeout(a.proxy(function(){var c=b.relatedTarget||document.activeElement;this.wrapper.has(a(c)).length||this.turnEditingOff(!a(c).is(":input,a"))},this),100)},c.prototype.passwordVisible=function(){return!!this.wrapper.data("unmasked")},c.prototype.isEditing=function(){return"hidden"!==this.inputField.attr("type")},c.prototype.turnEditingOn=function(){var b=this.getDisplayValue();return this.passwordVisible()?this.inputField.attr("type","text"):this.inputField.attr("type","password"),this.inputField.val(b),this.inputField.attr("size",this.inputField.attr("data-size")),this.editInstructions.length&&(this.inputField.attr("aria-describedby",this.editInstructions.attr("id")),this.editInstructions.show()),this.wrapper.attr("data-passwordunmask-visible",1),this.editLink.hide(),this.inputField.focus().select(),a("body").on("focusout",this.wrapperSelector,a.proxy(this.checkFocusOut,this)),this},c.prototype.turnEditingOff=function(b){a("body").off("focusout",this.wrapperSelector,this.checkFocusOut);var c=this.getDisplayValue();return this.inputField.attr("type","hidden").attr("aria-describedby",null),this.inputField.val(c),this.editInstructions.hide(),this.wrapper.removeAttr("data-passwordunmask-visible"),this.inputField.removeAttr("size"),this.editLink.show(),this.setDisplayValue(),b&&this.editLink.focus(),this},c.prototype.getDisplayValue=function(){return this.inputField.val()},c.prototype.setDisplayValue=function(){var c=this.getDisplayValue();return this.isEditing()&&(this.wrapper.data("unmasked")?this.inputField.attr("type","text"):this.inputField.attr("type","password"),this.inputField.val(c)),c&&this.wrapper.data("unmasked")?this.displayValue.text(c):(c||(c=""),b.render("core_form/element-passwordunmask-fill",{element:{frozen:this.inputField.is("[readonly]"),value:c,valuechars:c.split("")}}).done(a.proxy(function(a,c){this.displayValue.html(a),b.runTemplateJS(c)},this))),this},c});
  49. define('core_grades/edittree_index', ["jquery"],function(a){var b=function(){a("body").on("change",".itemselect.ignoredirty",b.checkMoveMenuState),a("body").on("click",'[data-action="grade_edittree-index-bulkselect"]',b.toggleAllSelectItems),a("body").on("change",".weightoverride",b.toggleWeightInput),a("#menumoveafter").on("change",function(){var b=a(this).closest("form"),c=b.find("#bulkmoveinput");c.val(1),b.submit()}),b.checkMoveMenuState()};return b.toggleWeightInput=function(b){b.preventDefault();var c=a(this),d=c.closest("tr");a('input[name="weight_'+d.data("itemid")+'"]').prop("disabled",!c.prop("checked"))},b.toggleAllSelectItems=function(c){c.preventDefault();var d=a(this),e=d.closest("tr");a("."+e.data("category")+" .itemselect").prop("checked",d.data("checked")),b.checkMoveMenuState()},b.getMoveMenu=function(){return a("#menumoveafter")},b.checkMoveMenuState=function(){var c=b.getMoveMenu();if(!c.length)return!1;var d;return a(".itemselect").each(function(){return d=a(this).prop("checked"),!d}),c.prop("disabled",!d),d},{enhance:b}});
  50. define('core_message/notification_preference', ["jquery","core/ajax","core/notification","core_message/notification_processor"],function(a,b,c,d){var e={PROCESSOR:"[data-processor-name]",STATE_INPUTS:"[data-state] input"},f=function(b,c){this.root=a(b),this.userId=c};return f.prototype.getPreferenceKey=function(){return this.root.attr("data-preference-key")},f.prototype.getLoggedInPreferenceKey=function(){return this.getPreferenceKey()+"_loggedin"},f.prototype.getLoggedOffPreferenceKey=function(){return this.getPreferenceKey()+"_loggedoff"},f.prototype.getProcessors=function(){return this.root.find(e.PROCESSOR).map(function(b,c){return new d(a(c))})},f.prototype.startLoading=function(){this.root.addClass("loading"),this.root.find(e.STATE_INPUTS).prop("disabled",!0)},f.prototype.stopLoading=function(){this.root.removeClass("loading"),this.root.find(e.STATE_INPUTS).prop("disabled",!1)},f.prototype.isLoading=function(){return this.root.hasClass("loading")},f.prototype.save=function(){if(this.isLoading())return a.Deferred().resolve();this.startLoading();var d="",e="";this.getProcessors().each(function(a,b){b.isLoggedInEnabled()&&(""===d?d=b.getName():d+=","+b.getName()),b.isLoggedOffEnabled()&&(""===e?e=b.getName():e+=","+b.getName())}),""===d&&(d="none"),""===e&&(e="none");var f={userid:this.userId,preferences:[{type:this.getLoggedInPreferenceKey(),value:d},{type:this.getLoggedOffPreferenceKey(),value:e}]},g={methodname:"core_user_update_user_preferences",args:f};return b.call([g])[0].fail(c.exception).always(function(){this.stopLoading()}.bind(this))},f});
  51. define('core_message/message_area_search', ["jquery","core/ajax","core/templates","core/notification","core/str","core/custom_interaction_events","core_message/message_area_events"],function(a,b,c,d,e,f,g){function h(a){this.messageArea=a,this._init()}var i={CONTACTS:"[data-region='contacts'][data-region-content='contacts']",CONTACTSAREA:"[data-region='contacts-area']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",DELETESEARCHFILTER:"[data-region='search-filter-area']",LOADINGICON:".loading-icon",SEARCHBOX:"[data-region='search-box']",SEARCHFILTER:"[data-region='search-filter']",SEARCHFILTERAREA:"[data-region='search-filter-area']",SEARCHRESULTSAREA:"[data-region='search-results-area']",SEARCHTEXTAREA:"[data-region='search-text-area']",SEARCHUSERSINCOURSE:"[data-action='search-users-in-course']"};return h.prototype.messageArea=null,h.prototype._searchArea=null,h.prototype._courseid=null,h.prototype._isLoading=!1,h.prototype._numMessagesDisplayed=0,h.prototype._numMessagesToRetrieve=20,h.prototype._numUsersDisplayed=0,h.prototype._numUsersToRetrieve=20,h.prototype._searchAreas={MESSAGES:"messages",USERS:"users",USERSINCOURSE:"usersincourse"},h.prototype._requestTimeout=null,h.prototype._init=function(){this.messageArea.find(i.SEARCHTEXTAREA).on("input",this._searchRequest.bind(this)),this.messageArea.onDelegateEvent(f.events.activate,i.SEARCHUSERSINCOURSE,function(b){this._setFilter(a(b.currentTarget).html()),this._setPlaceholderText("searchforuser"),this._clearSearchArea(),this._searchArea=this._searchAreas.USERSINCOURSE,this._courseid=a(b.currentTarget).data("courseid"),this._searchUsersInCourse(),this.messageArea.find(i.SEARCHBOX).focus()}.bind(this)),this.messageArea.onDelegateEvent(f.events.activate,i.DELETESEARCHFILTER,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.USERS,this._setPlaceholderText("searchforuserorcourse"),this.messageArea.trigger(g.USERSSEARCHCANCELED),this.messageArea.find(i.SEARCHBOX).focus()}.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONSSELECTED,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.MESSAGES,this._setPlaceholderText("searchmessages")}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.USERS,this._setPlaceholderText("searchforuserorcourse")}.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESENT,function(){this._hideSearchResults(),this._searchArea=this._searchAreas.MESSAGES,this._setPlaceholderText("searchmessages")}.bind(this)),f.define(this.messageArea.find(i.SEARCHRESULTSAREA),[f.events.scrollBottom]),this.messageArea.onDelegateEvent(f.events.scrollBottom,i.SEARCHRESULTSAREA,function(){this._searchArea==this._searchAreas.MESSAGES?this._searchMessages():this._searchArea==this._searchAreas.USERSINCOURSE&&this._searchUsersInCourse()}.bind(this)),this._searchArea=this.messageArea.showContactsFirst()?this._searchAreas.USERS:this._searchAreas.MESSAGES},h.prototype._searchRequest=function(){var a=this.messageArea.find(i.SEARCHTEXTAREA+" input").val();return this._requestTimeout&&clearTimeout(this._requestTimeout),""===a.trim()?void(this._searchArea==this._searchAreas.MESSAGES?(this._hideSearchResults(),this.messageArea.trigger(g.MESSAGESEARCHCANCELED)):this._searchArea==this._searchAreas.USERS?(this._hideSearchResults(),this.messageArea.trigger(g.USERSSEARCHCANCELED)):this._searchArea==this._searchAreas.USERSINCOURSE&&(this._clearSearchArea(),this._searchUsersInCourse())):(this.messageArea.find(i.CONVERSATIONS).hide(),this.messageArea.find(i.CONTACTS).hide(),this.messageArea.find(i.SEARCHRESULTSAREA).show(),void(this._searchArea==this._searchAreas.MESSAGES?this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numMessagesDisplayed=0,this._searchMessages()}.bind(this),300):this._searchArea==this._searchAreas.USERSINCOURSE?this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numUsersDisplayed=0,this._searchUsersInCourse()}.bind(this),300):this._requestTimeout=setTimeout(function(){this._clearSearchArea(),this._numUsersDisplayed=0,this._searchUsers()}.bind(this),300)))},h.prototype._searchMessages=function(){if(this._isLoading)return!1;var a=this.messageArea.find(i.SEARCHBOX).val();this._isLoading=!0;var e=b.call([{methodname:"core_message_data_for_messagearea_search_messages",args:{userid:this.messageArea.getCurrentUserId(),search:a,limitfrom:this._numMessagesDisplayed,limitnum:this._numMessagesToRetrieve}}]),f=0;return c.render("core/loading",{}).then(function(a,b){return c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),"<div style='text-align:center'>"+a+"</div>",b),e[0]}.bind(this)).then(function(a){return f=a.contacts.length,c.render("core_message/message_area_message_search_results",a)}).then(function(a,b){this.messageArea.find(i.SEARCHRESULTSAREA+" "+i.LOADINGICON).remove(),f>0?(c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._numMessagesDisplayed+=f):0==this._numMessagesDisplayed&&c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._isLoading=!1}.bind(this)).fail(d.exception)},h.prototype._searchUsers=function(){var a=this.messageArea.find(i.SEARCHBOX).val(),e=b.call([{methodname:"core_message_data_for_messagearea_search_users",args:{userid:this.messageArea.getCurrentUserId(),search:a,limitnum:this._numUsersToRetrieve}}]);return c.render("core/loading",{}).then(function(a,b){return c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),"<div style='text-align:center'>"+a+"</div>",b),e[0]}.bind(this)).then(function(a){return a.contacts.length>0&&(a.hascontacts=!0),a.courses.length>0&&(a.hascourses=!0),a.noncontacts.length>0&&(a.hasnoncontacts=!0),c.render("core_message/message_area_user_search_results",a)}).then(function(a,b){c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b)}.bind(this)).fail(d.exception)},h.prototype._searchUsersInCourse=function(){if(this._isLoading)return!1;var a=this.messageArea.find(i.SEARCHBOX).val();this._isLoading=!0;var e=b.call([{methodname:"core_message_data_for_messagearea_search_users_in_course",args:{userid:this.messageArea.getCurrentUserId(),courseid:this._courseid,search:a,limitfrom:this._numUsersDisplayed,limitnum:this._numUsersToRetrieve}}]),f=0;return c.render("core/loading",{}).then(function(a,b){return c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),"<div style='text-align:center'>"+a+"</div>",b),e[0]}.bind(this)).then(function(a){return f=a.contacts.length,f>0&&(a.hascontacts=!0),c.render("core_message/message_area_user_search_results",a)}).then(function(a,b){this.messageArea.find(i.SEARCHRESULTSAREA+" "+i.LOADINGICON).remove(),f>0?(c.appendNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._numUsersDisplayed+=f):0==this._numUsersDisplayed&&c.replaceNodeContents(this.messageArea.find(i.SEARCHRESULTSAREA),a,b),this._isLoading=!1}.bind(this)).fail(d.exception)},h.prototype._setPlaceholderText=function(a){return e.get_string(a,"message").then(function(a){this.messageArea.find(i.SEARCHTEXTAREA+" input").attr("placeholder",a)}.bind(this))},h.prototype._setFilter=function(a){this.messageArea.find(i.SEARCHBOX).val(""),this.messageArea.find(i.CONTACTSAREA).addClass("searchfilter"),this.messageArea.find(i.SEARCHFILTERAREA).show(),this.messageArea.find(i.SEARCHFILTER).html(a),e.get_string("removecoursefilter","message",a).then(function(a){this.messageArea.find(i.SEARCHFILTERAREA).attr("aria-label",a)}.bind(this))},h.prototype._clearFilters=function(){this.messageArea.find(i.CONTACTSAREA).removeClass("searchfilter"),this.messageArea.find(i.SEARCHFILTER).empty(),this.messageArea.find(i.SEARCHFILTERAREA).hide(),this.messageArea.find(i.SEARCHFILTERAREA).removeAttr("aria-label")},h.prototype._clearSearchArea=function(){this.messageArea.find(i.SEARCHRESULTSAREA).empty()},h.prototype._hideSearchResults=function(){this._clearFilters(),this.messageArea.find(i.SEARCHTEXTAREA+" input").val(""),this._clearSearchArea(),this.messageArea.find(i.SEARCHRESULTSAREA).hide()},h});
  52. define('core_message/message_notification_preference', ["jquery","core_message/notification_preference"],function(a,b){var c={PREFERENCE_KEY:"[data-preference-key]"},d=function(a,c){b.call(this,a,c)};return d.prototype=Object.create(b.prototype),d.prototype.constructor=d,d.prototype.getPreferenceKey=function(){return this.root.find(c.PREFERENCE_KEY).attr("data-preference-key")},d});
  53. define('core_message/message_preferences', ["jquery","core/ajax","core/notification","core_message/message_notification_preference","core/custom_interaction_events"],function(a,b,c,d,e){var f={PREFERENCE:"[data-state]",PREFERENCES_CONTAINER:'[data-region="preferences-container"]',BLOCK_NON_CONTACTS:'[data-region="block-non-contacts-container"] [data-block-non-contacts]',BLOCK_NON_CONTACTS_CONTAINER:'[data-region="block-non-contacts-container"]'},g=function(b){this.root=a(b),this.registerEventListeners()};return g.prototype.preferencesDisabled=function(){return this.root.find(f.PREFERENCES_CONTAINER).hasClass("disabled")},g.prototype.saveBlockNonContactsStatus=function(){var d=this.root.find(f.BLOCK_NON_CONTACTS),e=this.root.find(f.BLOCK_NON_CONTACTS_CONTAINER),g=d.prop("checked");if(e.hasClass("loading"))return a.Deferred().resolve();e.addClass("loading");var h={methodname:"core_user_update_user_preferences",args:{preferences:[{type:d.attr("data-preference-key"),value:g?1:0}]}};return b.call([h])[0].fail(c.exception).always(function(){e.removeClass("loading")})},g.prototype.registerEventListeners=function(){e.define(this.root,[e.events.activate]),this.root.on(e.events.activate,f.BLOCK_NON_CONTACTS,function(){this.saveBlockNonContactsStatus()}.bind(this)),this.root.on("change",function(b){if(!this.preferencesDisabled()){var c=a(b.target).closest(f.PREFERENCES_CONTAINER),e=a(b.target).closest(f.PREFERENCE),g=new d(c);e.addClass("loading"),g.save().always(function(){e.removeClass("loading")})}}.bind(this))},g});
  54. define('core_message/message_area_contacts', ["jquery","core/ajax","core/templates","core/notification","core/custom_interaction_events","core/str","core_message/message_area_events"],function(a,b,c,d,e,f,g){function h(a){this.messageArea=a,this._init()}var i={CONTACT:"[data-region='contact']",CONTACTICONBLOCKED:"[data-region='contact-icon-blocked']",CONTACTS:"[data-region='contacts'][data-region-content='contacts']",CONTACTSAREA:"[data-region='contacts-area']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",COURSE:"[data-region='course']",LASTMESSAGETEXT:"[data-region='last-message-text']",LASTMESSAGEUSER:"[data-region='last-message-user']",LOADINGICON:".loading-icon",MESSAGETEXT:"[data-region='message-text']",MESSAGINGAREA:"[data-region='messaging-area']",NOCONTACTS:"[data-region=no-contacts]",SEARCHBOX:"[data-region='search-box']",SEARCHRESULTSAREA:"[data-region='search-results-area']",SEARCHTEXTAREA:"[data-region='search-text-area']",SELECTEDVIEWCONVERSATION:"[data-action='view-contact-msg'].selected",SELECTEDVIEWPROFILE:"[data-action='view-contact-profile'].selected",SHOWMESSAGES:"[data-action='show-messages']",VIEWCONVERSATION:"[data-action='view-contact-msg']",VIEWPROFILE:"[data-action='view-contact-profile']"};return h.prototype._isLoadingConversations=!1,h.prototype._isLoadingContacts=!1,h.prototype._numContactsDisplayed=0,h.prototype._numContactsToRetrieve=20,h.prototype._numConversationsDisplayed=0,h.prototype._numConversationsToRetrieve=20,h.prototype._messageLength=60,h.prototype.messageArea=null,h.prototype._init=function(){e.define(this.messageArea.node,[e.events.activate,e.events.down,e.events.up]),this.messageArea.onCustomEvent(g.MESSAGESEARCHCANCELED,this._viewConversations.bind(this)),this.messageArea.onCustomEvent(g.USERSSEARCHCANCELED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONDELETED,this._deleteConversation.bind(this)),this.messageArea.onCustomEvent(g.CONVERSATIONSSELECTED,this._viewConversations.bind(this)),this.messageArea.onCustomEvent(g.CONTACTSSELECTED,this._viewContacts.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESDELETED,this._updateLastMessage.bind(this)),this.messageArea.onCustomEvent(g.MESSAGESENT,this._handleMessageSent.bind(this)),this.messageArea.onCustomEvent(g.CONTACTREMOVED,function(a,b){this._removeContact(i.CONTACTS,b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTADDED,function(a,b){this._addContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTBLOCKED,function(a,b){this._blockContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CONTACTUNBLOCKED,function(a,b){this._unblockContact(b)}.bind(this)),this.messageArea.onCustomEvent(g.CHOOSEMESSAGESTODELETE,this._startDeleting.bind(this)),this.messageArea.onCustomEvent(g.CANCELDELETEMESSAGES,this._stopDeleting.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.VIEWCONVERSATION,this._viewConversation.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.VIEWPROFILE,this._viewContact.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,i.SHOWMESSAGES,this._showMessagingArea.bind(this)),this.messageArea.onDelegateEvent(e.events.up,i.CONTACT,this._selectPreviousContact.bind(this)),this.messageArea.onDelegateEvent(e.events.down,i.CONTACT,this._selectNextContact.bind(this)),this.messageArea.onDelegateEvent(e.events.up,i.VIEWCONVERSATION,this._selectPreviousConversation.bind(this)),this.messageArea.onDelegateEvent(e.events.down,i.VIEWCONVERSATION,this._selectNextConversation.bind(this)),this.messageArea.onDelegateEvent(e.events.up,i.COURSE,this._selectPreviousCourse.bind()),this.messageArea.onDelegateEvent(e.events.down,i.COURSE,this._selectNextCourse.bind()),this.messageArea.onDelegateEvent("focus",i.SEARCHBOX,this._setSearching.bind(this)),this.messageArea.onDelegateEvent("blur",i.SEARCHBOX,this._clearSearching.bind(this)),e.define(this.messageArea.find(i.CONVERSATIONS),[e.events.scrollBottom]),e.define(this.messageArea.find(i.CONTACTS),[e.events.scrollBottom]),this.messageArea.onDelegateEvent(e.events.scrollBottom,i.CONVERSATIONS,this._loadConversations.bind(this)),this.messageArea.onDelegateEvent(e.events.scrollBottom,i.CONTACTS,this._loadContacts.bind(this)),this.messageArea.showContactsFirst()||(this._numConversationsDisplayed=20)},h.prototype._startDeleting=function(){this.messageArea.find(i.CONTACTSAREA).addClass("editing")},h.prototype._stopDeleting=function(){this.messageArea.find(i.CONTACTSAREA).removeClass("editing")},h.prototype._viewConversations=function(){0===this._numConversationsDisplayed&&this._loadConversations(),this.messageArea.find(i.CONTACTS).hide(),this.messageArea.find(i.CONVERSATIONS).show()},h.prototype._viewContacts=function(){0===this._numContactsDisplayed&&this._loadContacts(),this.messageArea.find(i.CONVERSATIONS).hide(),this.messageArea.find(i.CONTACTS).show()},h.prototype._handleMessageSent=function(a,b,c){this._viewConversations();var d=this._getUserNode(i.CONVERSATIONS,b);if(0===d.length){var e=this._getUserNode(i.CONTACTS,b);if(0===e.length&&(e=this._getUserNode(i.SEARCHRESULTSAREA,b)),0==e.length)return;d=e.clone(),d.attr("data-action","view-contact-msg"),this.messageArea.find(i.CONVERSATIONS+" "+i.NOCONTACTS).remove(),this._numConversationsDisplayed++}d.prependTo(this.messageArea.find(i.CONVERSATIONS)),this.messageArea.find(i.CONVERSATIONS).scrollTop(0),this._updateContactText(d,c,!0),this._setSelectedUser("[data-userid='"+b+"']")},h.prototype._loadConversations=function(){if(this._isLoadingConversations)return!1;this._isLoadingConversations=!0;var a=0;return c.render("core/loading",{}).then(function(a,b){return this._numConversationsDisplayed?c.appendNodeContents(this.messageArea.find(i.CONVERSATIONS),"<div style='text-align:center'>"+a+"</div>",b):c.replaceNodeContents(this.messageArea.find(i.CONVERSATIONS),"<div style='text-align:center'>"+a+"</div>",b),this._getItems("core_message_data_for_messagearea_conversations",this._numConversationsDisplayed,this._numConversationsToRetrieve)}.bind(this)).then(function(b){return a=b.contacts.length,b.isconversation=!0,c.render("core_message/message_area_contacts",b)}).then(function(b,d){this.messageArea.find(i.CONVERSATIONS+" "+i.LOADINGICON).remove(),a>0?(c.appendNodeContents(this.messageArea.find(i.CONVERSATIONS),b,d),this._numConversationsDisplayed+=this._numConversationsToRetrieve):this._numConversationsDisplayed||c.replaceNodeContents(this.messageArea.find(i.CONVERSATIONS),b,d),this._isLoadingConversations=!1}.bind(this)).fail(d.exception)},h.prototype._loadContacts=function(){if(this._isLoadingContacts)return!1;this._isLoadingContacts=!0;var a=0;return c.render("core/loading",{}).then(function(a,b){return this._numContactsDisplayed?c.appendNodeContents(this.messageArea.find(i.CONTACTS),"<div style='text-align:center'>"+a+"</div>",b):c.replaceNodeContents(this.messageArea.find(i.CONTACTS),"<div style='text-align:center'>"+a+"</div>",b),this._getItems("core_message_data_for_messagearea_contacts",this._numContactsDisplayed,this._numContactsToRetrieve)}.bind(this)).then(function(b){return a=b.contacts.length,b.isconversation=!1,c.render("core_message/message_area_contacts",b)}).then(function(b,d){this.messageArea.find(i.CONTACTS+" "+i.LOADINGICON).remove(),a>0?(c.appendNodeContents(this.messageArea.find(i.CONTACTS),b,d),this._numContactsDisplayed+=a):this._numContactsDisplayed||c.replaceNodeContents(this.messageArea.find(i.CONTACTS),b,d),this._isLoadingContacts=!1}.bind(this)).fail(d.exception)},h.prototype._viewConversation=function(b){this.messageArea.trigger(g.CANCELDELETEMESSAGES);var c=a(b.currentTarget).data("userid"),d=a(b.currentTarget).data("messageid"),e="[data-userid='"+c+"']";d&&(e="[data-messageid='"+d+"']"),this._setSelectedUser(e),this.messageArea.trigger(g.CONVERSATIONSELECTED,c),this.messageArea.find(i.SELECTEDVIEWPROFILE).removeClass("selected"),this._showMessagingArea()},h.prototype._viewContact=function(b){this.messageArea.trigger(g.CANCELDELETEMESSAGES);var c=a(b.currentTarget).data("userid");this._setSelectedUser("[data-userid='"+c+"']"),this.messageArea.trigger(g.CONTACTSELECTED,c),this.messageArea.find(i.SELECTEDVIEWCONVERSATION).removeClass("selected"),this._showMessagingArea()},h.prototype._getItems=function(a,c,d){var e=b.call([{methodname:a,args:{userid:this.messageArea.getCurrentUserId(),limitfrom:c,limitnum:d}}]);return e[0]},h.prototype._deleteConversation=function(a,b){this._removeContact(i.CONVERSATIONS,b),this._numConversationsDisplayed--,this._hideMessagingArea(),this._stopDeleting()},h.prototype._updateLastMessage=function(a,b,c){if(c){var d=this._getUserNode(i.CONVERSATIONS,b),e=c.find(i.MESSAGETEXT).text().trim(),f=!1;c.data("useridto")==b&&(f=!0),this._updateContactText(d,e,f)}this._stopDeleting()},h.prototype._addContact=function(){this.messageArea.find(i.CONTACTS).empty(),this._numContactsDisplayed=0,this._loadContacts()},h.prototype._removeContact=function(a,b){this._getUserNode(a,b).remove(),this._numContactsDisplayed--},h.prototype._blockContact=function(a){var b=this._getUserNode(i.CONTACTS,a);b.find(i.CONTACTICONBLOCKED).removeClass("hidden"),b=this._getUserNode(i.CONVERSATIONS,a),b.find(i.CONTACTICONBLOCKED).removeClass("hidden"),b=this._getUserNode(i.SEARCHRESULTSAREA,a),b.find(i.CONTACTICONBLOCKED).removeClass("hidden")},h.prototype._unblockContact=function(a){var b=this._getUserNode(i.CONTACTS,a);b.find(i.CONTACTICONBLOCKED).addClass("hidden"),b=this._getUserNode(i.CONVERSATIONS,a),b.find(i.CONTACTICONBLOCKED).addClass("hidden"),b=this._getUserNode(i.SEARCHRESULTSAREA,a),b.find(i.CONTACTICONBLOCKED).addClass("hidden")},h.prototype._getUserNode=function(a,b){return this.messageArea.find(a+" "+i.CONTACT+"[data-userid='"+b+"']")},h.prototype._setSelectedUser=function(a){this.messageArea.find(i.CONTACT).removeClass("selected"),this.messageArea.find(i.CONTACT).attr("aria-pressed",!1),this.messageArea.find(i.CONTACT+a).addClass("selected"),this.messageArea.find(i.CONTACT+a).attr("aria-pressed",!0)},h.prototype._getContactText=function(b){return b=a(document.createElement("div")).html(b).text(),b.length>this._messageLength&&(b=b.substr(0,this._messageLength-3),b+="..."),b},h.prototype._updateContactText=function(a,b,c){b=this._getContactText(b),c?f.get_string("you","message").done(function(b){a.find(i.LASTMESSAGEUSER).empty().append(b)}).always(function(){a.find(i.LASTMESSAGETEXT).empty().append(b)}):(a.find(i.LASTMESSAGEUSER).empty(),a.find(i.LASTMESSAGETEXT).empty().append(b))},h.prototype._selectNextContact=function(b,c){var d=a(b.target).closest(i.CONTACT),e=d.next();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectPreviousContact=function(b,c){var d=a(b.target).closest(i.CONTACT),e=d.prev();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectNextCourse=function(b,c){var d=a(b.target).closest(i.COURSE);d.next().focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectPreviousCourse=function(b,c){var d=a(b.target).closest(i.COURSE);d.prev().focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectNextConversation=function(b,c){var d=a(b.target).closest(i.VIEWCONVERSATION),e=d.next();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._selectPreviousConversation=function(b,c){var d=a(b.target).closest(i.VIEWCONVERSATION),e=d.prev();e.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},h.prototype._setSearching=function(){a(i.SEARCHTEXTAREA).addClass("searching")},h.prototype._clearSearching=function(){a(i.SEARCHTEXTAREA).removeClass("searching")},h.prototype._showMessagingArea=function(){this.messageArea.find(i.MESSAGINGAREA).removeClass("hide-messages").addClass("show-messages")},h.prototype._hideMessagingArea=function(){this.messageArea.find(i.MESSAGINGAREA).removeClass("show-messages").addClass("hide-messages")},h});
  55. define('core_message/message_area_profile', ["jquery","core/ajax","core/templates","core/notification","core/str","core/config","core/custom_interaction_events","core_message/message_area_events"],function(a,b,c,d,e,f,g,h){function i(a){this.messageArea=a,this._init()}var j={PROFILE:"[data-region='profile']",PROFILEADDCONTACT:"[data-action='profile-add-contact']",PROFILEBLOCKCONTACT:"[data-action='profile-block-contact']",PROFILEREMOVECONTACT:"[data-action='profile-remove-contact']",PROFILESENDMESSAGE:"[data-action='profile-send-message']",PROFILEUNBLOCKCONTACT:"[data-action='profile-unblock-contact']",PROFILEVIEW:"[data-action='profile-view']",SHOWCONTACTS:"[data-action='show-contacts']",MESSAGESAREA:"[data-region='messages-area']",MESSAGINGAREA:"[data-region='messaging-area']"};return i.prototype.messageArea=null,i.prototype._init=function(){g.define(this.messageArea.node,[g.events.activate]),this.messageArea.onCustomEvent(h.CONTACTSELECTED,this._viewProfile.bind(this)),this.messageArea.onDelegateEvent(g.events.activate,j.PROFILEVIEW,function(a,b){this._viewFullProfile(),b.originalEvent.preventDefault()}.bind(this)),this.messageArea.onDelegateEvent(g.events.activate,j.PROFILESENDMESSAGE,function(a,b){this._sendMessage(),b.originalEvent.preventDefault()}.bind(this)),this.messageArea.onDelegateEvent(g.events.activate,j.PROFILEUNBLOCKCONTACT,function(a,b){this._unblockContact(),b.originalEvent.preventDefault()}.bind(this)),this.messageArea.onDelegateEvent(g.events.activate,j.PROFILEBLOCKCONTACT,function(a,b){this._blockContact(),b.originalEvent.preventDefault()}.bind(this)),this.messageArea.onDelegateEvent(g.events.activate,j.PROFILEADDCONTACT,function(a,b){this._addContact(),b.originalEvent.preventDefault()}.bind(this)),this.messageArea.onDelegateEvent(g.events.activate,j.PROFILEREMOVECONTACT,function(a,b){this._removeContact(),b.originalEvent.preventDefault()}.bind(this)),this.messageArea.onDelegateEvent(g.events.activate,j.SHOWCONTACTS,this._hideMessagingArea.bind(this))},i.prototype._viewProfile=function(a,e){c.render("core/loading",{}).done(function(a,b){c.replaceNodeContents(this.messageArea.find(j.MESSAGESAREA),a,b)}.bind(this));var f=b.call([{methodname:"core_message_data_for_messagearea_get_profile",args:{currentuserid:this.messageArea.getCurrentUserId(),otheruserid:e}}]);return f[0].then(function(a){return c.render("core_message/message_area_profile",a)}).then(function(a,b){c.replaceNodeContents(this.messageArea.find(j.MESSAGESAREA),a,b)}.bind(this)).fail(d.exception)},i.prototype._viewFullProfile=function(){window.location.href=f.wwwroot+"/user/profile.php?id="+this._getUserId()},i.prototype._sendMessage=function(){this.messageArea.trigger(h.SENDMESSAGE,this._getUserId())},i.prototype._blockContact=function(){var a=this._performAction("core_message_block_contacts","unblockcontact","profile-block-contact","profile-unblock-contact","");return a.then(function(){this.messageArea.trigger(h.CONTACTBLOCKED,this._getUserId())}.bind(this))},i.prototype._unblockContact=function(){var a=this._performAction("core_message_unblock_contacts","blockcontact","profile-unblock-contact","profile-block-contact","danger");return a.then(function(){this.messageArea.trigger(h.CONTACTUNBLOCKED,this._getUserId())}.bind(this))},i.prototype._addContact=function(){var a=this._performAction("core_message_create_contacts","removecontact","profile-add-contact","profile-remove-contact","danger");return a.then(function(){this.messageArea.trigger(h.CONTACTADDED,this._getUserId())}.bind(this))},i.prototype._removeContact=function(){var a=this._performAction("core_message_delete_contacts","addcontact","profile-remove-contact","profile-add-contact","");return a.then(function(){this.messageArea.trigger(h.CONTACTREMOVED,this._getUserId())}.bind(this))},i.prototype._performAction=function(a,c,f,g,h){var i=b.call([{methodname:a,args:{userid:this.messageArea.getCurrentUserId(),userids:[this._getUserId()]}}]);return i[0].then(function(){return e.get_string(c,"message")}).then(function(a){this._changeText(a,f,g,h)}.bind(this)).fail(d.exception)},i.prototype._changeText=function(a,b,c,d){var e=this.messageArea.find("[data-action='"+b+"']");e.text(a),e.removeClass(),d&&e.addClass(d),e.attr("data-action",c)},i.prototype._getUserId=function(){return this.messageArea.find(j.PROFILE).data("userid")},i.prototype._hideMessagingArea=function(){this.messageArea.find(j.MESSAGINGAREA).removeClass("show-messages").addClass("hide-messages")},i});
  56. define('core_message/message_area', ["jquery","core_message/message_area_contacts","core_message/message_area_messages","core_message/message_area_profile","core_message/message_area_tabs","core_message/message_area_search"],function(a,b,c,d,e,f){function g(b,c,d,e){this.node=a(b),this.pollmin=c,this.pollmax=d,this.polltimeout=e,this._init()}return g.prototype.node=null,g.prototype.pollmin=null,g.prototype.pollmax=null,g.prototype.polltimeout=null,g.prototype._init=function(){new b(this),new c(this),new d(this),new e(this),new f(this)},g.prototype.onDelegateEvent=function(a,b,c){this.node.on(a,b,c)},g.prototype.onCustomEvent=function(a,b){this.node.on(a,b)},g.prototype.trigger=function(a,b){"undefined"==typeof b&&(b=""),this.node.trigger(a,b)},g.prototype.find=function(a){return this.node.find(a)},g.prototype.getCurrentUserId=function(){return this.node.data("userid")},g.prototype.showContactsFirst=function(){return!!this.node.data("displaycontacts")},g});
  57. define('core_message/notification_processor', ["jquery"],function(a){var b={STATE_NONE:'[data-state="none"]',STATE_BOTH:'[data-state="both"]',STATE_LOGGED_IN:'[data-state="loggedin"]',STATE_LOGGED_OFF:'[data-state="loggedoff"]'},c=function(b){this.root=a(b)};return c.prototype.getName=function(){return this.root.attr("data-processor-name")},c.prototype.isLoggedInEnabled=function(){var a=this.root.find(b.STATE_NONE).find("input");if(a.prop("checked"))return!1;var c=this.root.find(b.STATE_BOTH).find("input"),d=this.root.find(b.STATE_LOGGED_IN).find("input");return d.prop("checked")||c.prop("checked")},c.prototype.isLoggedOffEnabled=function(){var a=this.root.find(b.STATE_NONE).find("input");if(a.prop("checked"))return!1;var c=this.root.find(b.STATE_BOTH).find("input"),d=this.root.find(b.STATE_LOGGED_OFF).find("input");return d.prop("checked")||c.prop("checked")},c});
  58. define('core_message/message_area_tabs', ["core/custom_interaction_events","core_message/message_area_events"],function(a,b){function c(a){this.messageArea=a,this._init()}var d={ACTIVECONTACTSTAB:"[data-region='contacts-area'] [role='tab'][aria-selected='true']",CONTACTSPANELS:"[data-region='contacts']",VIEWCONTACTS:"[data-action='contacts-view']",VIEWCONVERSATIONS:"[data-action='conversations-view']"};return c.prototype.messageArea=null,c.prototype._init=function(){a.define(this.messageArea.node,[a.events.activate,a.events.up,a.events.down,a.events.next,a.events.previous,a.events.ctrlPageUp,a.events.ctrlPageDown]),this.messageArea.onDelegateEvent(a.events.activate,d.VIEWCONVERSATIONS,this._viewConversations.bind(this)),this.messageArea.onDelegateEvent(a.events.activate,d.VIEWCONTACTS,this._viewContacts.bind(this)),this.messageArea.onDelegateEvent(a.events.up,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.down,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.next,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.previous,d.VIEWCONVERSATIONS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.up,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.down,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.next,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.previous,d.VIEWCONTACTS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.ctrlPageUp,d.CONTACTSPANELS,this._toggleTabs.bind(this)),this.messageArea.onDelegateEvent(a.events.ctrlPageDown,d.CONTACTSPANELS,this._toggleTabs.bind(this)),this.messageArea.onCustomEvent(b.MESSAGESENT,function(){this._selectTab(d.VIEWCONVERSATIONS,d.VIEWCONTACTS)}.bind(this))},c.prototype._viewConversations=function(){this.messageArea.trigger(b.CONVERSATIONSSELECTED),this._selectTab(d.VIEWCONVERSATIONS,d.VIEWCONTACTS)},c.prototype._viewContacts=function(){this.messageArea.trigger(b.CONTACTSSELECTED),this._selectTab(d.VIEWCONTACTS,d.VIEWCONVERSATIONS)},c.prototype._selectTab=function(a,b){b=this.messageArea.find(b),b.removeClass("selected"),b.attr("aria-selected","false"),b.attr("tabindex","-1"),a=this.messageArea.find(a),a.addClass("selected"),a.attr("aria-selected","true"),a.attr("tabindex","0")},c.prototype._toggleTabs=function(a,b){var c=this.messageArea.find(d.ACTIVECONTACTSTAB);c.is(d.VIEWCONVERSATIONS)?this._viewContacts():this._viewConversations(),this.messageArea.find(d.ACTIVECONTACTSTAB).focus(),a.preventDefault(),a.stopPropagation(),b.originalEvent.preventDefault(),b.originalEvent.stopPropagation()},c});
  59. define('core_message/toggle_contact_button', ["jquery","core/ajax","core/templates","core/notification","core/custom_interaction_events"],function(a,b,c,d,e){var f=function(a){return"1"==a.attr("data-is-contact")},g=function(a){a.attr("data-is-contact","1")},h=function(a){a.attr("data-is-contact","0")},i=function(a){return a.attr("data-userid")},j=function(a){return a.hasClass("loading")||a.attr("disabled")},k=function(c,e){return j(c)?a.Deferred():(c.addClass("loading"),c.attr("disabled","disabled"),b.call([e])[0].fail(d.exception).always(function(){c.removeClass("loading"),c.removeAttr("disabled")}))},l=function(a){if(!j(a)){var b={methodname:"core_message_create_contacts",args:{userids:[i(a)]}};k(a,b).done(function(){g(a),c.render("message/remove_contact_button",{}).done(function(b,d){c.replaceNodeContents(a,b,d)})})}},m=function(a){if(!j(a)){var b={methodname:"core_message_delete_contacts",args:{userids:[i(a)]}};k(a,b).done(function(){h(a),c.render("message/add_contact_button",{}).done(function(b,d){c.replaceNodeContents(a,b,d)})})}},n=function(b){b=a(b),b.children(".loading-icon").length||c.render("core/loading",{}).done(function(a,c){b.append(a,c)}),e.define(b,[e.events.activate]),b.on(e.events.activate,function(a,c){f(b)?m(b):l(b),a.preventDefault(),c.originalEvent.preventDefault()})};return{enhance:n}});
  60. define('core_message/message_area_messages', ["jquery","core/ajax","core/templates","core/notification","core/custom_interaction_events","core/auto_rows","core_message/message_area_actions","core/modal_factory","core/modal_events","core/str","core_message/message_area_events","core/backoff_timer"],function(a,b,c,d,e,f,g,h,i,j,k,l){function m(a){this.messageArea=a,this._init()}var n=500,o=50,p={BLOCKTIME:"[data-region='blocktime']",CANCELDELETEMESSAGES:"[data-action='cancel-delete-messages']",CONTACT:"[data-region='contact']",CONVERSATIONS:"[data-region='contacts'][data-region-content='conversations']",DELETEALLMESSAGES:"[data-action='delete-all-messages']",DELETEMESSAGES:"[data-action='delete-messages']",LOADINGICON:".loading-icon",MESSAGE:"[data-region='message']",MESSAGERESPONSE:"[data-region='response']",MESSAGES:"[data-region='messages']",MESSAGESAREA:"[data-region='messages-area']",MESSAGINGAREA:"[data-region='messaging-area']",SENDMESSAGE:"[data-action='send-message']",SENDMESSAGETEXT:"[data-region='send-message-txt']",SHOWCONTACTS:"[data-action='show-contacts']",STARTDELETEMESSAGES:"[data-action='start-delete-messages']"},q=1e3;return m.prototype._isSendingMessage=!1,m.prototype._isLoadingMessages=!1,m.prototype._numMessagesDisplayed=0,m.prototype._messageQueue=[],m.prototype._numMessagesToRetrieve=20,m.prototype._confirmationModal=null,m.prototype._latestMessageTimestamp=0,m.prototype._backoffTimer=null,m.prototype.messageArea=null,m.prototype._init=function(){e.define(this.messageArea.node,[e.events.activate,e.events.up,e.events.down,e.events.enter]),a(window).height()<=670&&(n=400),f.init(this.messageArea.node),this.messageArea.onCustomEvent(k.CONVERSATIONSELECTED,this._viewMessages.bind(this)),this.messageArea.onCustomEvent(k.SENDMESSAGE,this._viewMessages.bind(this)),this.messageArea.onCustomEvent(k.CHOOSEMESSAGESTODELETE,this._chooseMessagesToDelete.bind(this)),this.messageArea.onCustomEvent(k.CANCELDELETEMESSAGES,this._hideDeleteAction.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.SENDMESSAGE,this._sendMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.STARTDELETEMESSAGES,this._startDeleting.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.DELETEMESSAGES,this._deleteMessages.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.DELETEALLMESSAGES,this._deleteAllMessages.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.CANCELDELETEMESSAGES,this._triggerCancelMessagesToDelete.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.MESSAGE,this._toggleMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.activate,p.SHOWCONTACTS,this._hideMessagingArea.bind(this)),this.messageArea.onDelegateEvent(e.events.up,p.MESSAGE,this._selectPreviousMessage.bind(this)),this.messageArea.onDelegateEvent(e.events.down,p.MESSAGE,this._selectNextMessage.bind(this)),this.messageArea.onDelegateEvent("focus",p.SENDMESSAGETEXT,this._setMessaging.bind(this)),this.messageArea.onDelegateEvent("blur",p.SENDMESSAGETEXT,this._clearMessaging.bind(this)),a(document).on(f.events.ROW_CHANGE,this._adjustMessagesAreaHeight.bind(this));var b=this.messageArea.find(p.MESSAGES);b.length&&(this._addScrollEventListener(b.find(p.MESSAGE).length),this._latestMessageTimestamp=b.find(p.MESSAGE+":last").data("timecreated")),this._backoffTimer=new l(this._loadNewMessages.bind(this),l.getIncrementalCallback(this.messageArea.pollmin*q,q,this.messageArea.pollmax*q,this.messageArea.polltimeout*q)),this._backoffTimer.start()},m.prototype._viewMessages=function(e,f){this._numMessagesDisplayed=0,this._backoffTimer.stop(),this._latestMessageTimestamp=0;var g=b.call([{methodname:"core_message_mark_all_messages_as_read",args:{useridto:this.messageArea.getCurrentUserId(),useridfrom:f}}]),h=0;return c.render("core/loading",{}).then(function(a,b){return c.replaceNodeContents(this.messageArea.find(p.MESSAGESAREA),a,b),g[0]}.bind(this)).then(function(){var b=this.messageArea.find(p.CONVERSATIONS+" "+p.CONTACT+"[data-userid='"+f+"']");return b.hasClass("unread")&&(b.removeClass("unread"),a(document).trigger("messagearea:conversationselected",f)),this._getMessages(f)}.bind(this)).then(function(a){return h=a.messages.length,c.render("core_message/message_area_messages_area",a)}).then(function(a,b){c.replaceNodeContents(this.messageArea.find(p.MESSAGESAREA),a,b),this._addScrollEventListener(h),this._backoffTimer.restart(),this.messageArea.find(p.SENDMESSAGETEXT).focus()}.bind(this)).fail(d.exception)},m.prototype._loadMessages=function(){if(this._isLoadingMessages)return!1;this._isLoadingMessages=!0;var b=0;return c.render("core/loading",{}).then(function(a,b){return c.prependNodeContents(this.messageArea.find(p.MESSAGES),"<div style='text-align:center'>"+a+"</div>",b),this._getMessages(this._getUserId())}.bind(this)).then(function(a){return b=a.messages.length,c.render("core_message/message_area_messages",a)}).then(function(d,e){if(this.messageArea.find(p.MESSAGES+" "+p.LOADINGICON).remove(),b>0){var f=a("<div>"+d+"</div>");this._hasMatchingBlockTime(this.messageArea.node,f,!0)&&this.messageArea.node.find(p.BLOCKTIME+":first").remove();var g=this.messageArea.find(p.MESSAGES)[0].scrollHeight;c.prependNodeContents(this.messageArea.find(p.MESSAGES),d,e);var h=this.messageArea.find(p.MESSAGES)[0].scrollHeight;this.messageArea.find(p.MESSAGES).scrollTop(h-g),this._numMessagesDisplayed+=b}this._isLoadingMessages=!1}.bind(this)).fail(d.exception)},m.prototype._loadNewMessages=function(){if(this._isLoadingMessages)return!1;if(!this._getUserId())return!1;this._isLoadingMessages=!0;var a=!1,b=this.messageArea.find(p.MESSAGES);if(0!==b.length){var c=b.scrollTop(),e=b.innerHeight(),f=b[0].scrollHeight;c+e>=f&&(a=!0)}return this._getMessages(this._getUserId(),!0).then(function(b){return this._addMessagesToDom(b.messages,a)}.bind(this)).always(function(){this._isLoadingMessages=!1}.bind(this)).fail(d.exception)},m.prototype._getMessages=function(a,c){var e={currentuserid:this.messageArea.getCurrentUserId(),otheruserid:a,limitfrom:this._numMessagesDisplayed,limitnum:this._numMessagesToRetrieve,newest:!0};c&&(e.timefrom=this._latestMessageTimestamp,e.limitfrom=0,e.limitnum=0);var f=b.call([{methodname:"core_message_data_for_messagearea_messages",args:e}]);return f[0].then(function(a){var b=a.messages;if(b&&b.length){var c=b[b.length-1];c.timecreated>this._latestMessageTimestamp&&(this._latestMessageTimestamp=c.timecreated+1)}return a}.bind(this)).fail(function(a){this._backoffTimer.stop(),d.exception(a)}.bind(this))},m.prototype._sendMessage=function(){var a=this.messageArea.find(p.SENDMESSAGETEXT),c=a.val().trim();if(""===c)return!1;if(this._isSendingMessage)return!1;this._isSendingMessage=!0;var e=b.call([{methodname:"core_message_send_instant_messages",args:{messages:[{touserid:this._getUserId(),text:c}]}}]);return a.prop("disabled",!0),e[0].then(function(a){if(a.length<0)throw new Error("Invalid response");if(a[0].errormessage)throw new Error(a[0].errormessage);return this.messageArea.trigger(k.MESSAGESENT,[this._getUserId(),c]),this._addLastMessageToDom()}.bind(this)).then(function(){this._isSendingMessage=!1}.bind(this)).always(function(){a.prop("disabled",!1),a.focus()}).fail(d.exception)},m.prototype._chooseMessagesToDelete=function(){this.messageArea.find(p.MESSAGESAREA).addClass("editing"),this.messageArea.find(p.MESSAGE).attr("role","checkbox").attr("aria-checked","false")},m.prototype._deleteMessages=function(){var c=this.messageArea.getCurrentUserId(),e=this.messageArea.find(p.MESSAGE+"[aria-checked='true']"),f=[],g=[];e.each(function(b,d){var e=a(d),h=e.data("messageid"),i=e.data("messageread")?1:0;g.push(e),f.push({methodname:"core_message_delete_message",args:{messageid:h,userid:c,read:i}})}),f.length>0?b.call(f)[f.length-1].then(function(){var b=null,c=this.messageArea.find(p.MESSAGE),d=c.last(),e=g[g.length-1];a.each(g,function(a,b){b.remove()}),d.data("id")===e.data("id")&&(b=this.messageArea.find(p.MESSAGE).last()),a.each(g,function(a,b){var c=b.data("blocktime");0===this.messageArea.find(p.MESSAGE+"[data-blocktime='"+c+"']").length&&this.messageArea.find(p.BLOCKTIME+"[data-blocktime='"+c+"']").remove()}.bind(this)),0===this.messageArea.find(p.MESSAGE).length&&this.messageArea.find(p.CONVERSATIONS+" "+p.CONTACT+"[data-userid='"+this._getUserId()+"']").remove(),this.messageArea.trigger(k.MESSAGESDELETED,[this._getUserId(),b])}.bind(this),d.exception):this.messageArea.trigger(k.MESSAGESDELETED,this._getUserId()),this._hideDeleteAction()},m.prototype._addScrollEventListener=function(a){this._scrollBottom(),this._numMessagesDisplayed=a,e.define(this.messageArea.find(p.MESSAGES),[e.events.scrollTop]),this.messageArea.onCustomEvent(e.events.scrollTop,this._loadMessages.bind(this))},m.prototype._deleteAllMessages=function(){this._confirmationModal?this._confirmationModal.show():j.get_strings([{key:"confirm"},{key:"deleteallconfirm",component:"message"}]).done(function(a){h.create({title:a[0],type:h.types.CONFIRM,body:a[1]},this.messageArea.find(p.DELETEALLMESSAGES)).done(function(a){this._confirmationModal=a,a.getRoot().on(i.yes,function(){var a=this._getUserId(),c={methodname:"core_message_delete_conversation",args:{userid:this.messageArea.getCurrentUserId(),otheruserid:a}};b.call([c])[0].then(function(){this.messageArea.find(p.MESSAGESAREA).empty(),this.messageArea.trigger(k.CONVERSATIONDELETED,a),this._hideDeleteAction()}.bind(this),d.exception)}.bind(this)),a.show()}.bind(this))}.bind(this))},m.prototype._hideDeleteAction=function(){this.messageArea.find(p.MESSAGE).removeAttr("role").removeAttr("aria-checked"),this.messageArea.find(p.MESSAGESAREA).removeClass("editing")},m.prototype._triggerCancelMessagesToDelete=function(){this.messageArea.trigger(k.CANCELDELETEMESSAGES)},m.prototype._addMessagesToDom=function(b,d){var e=0,f=this.messageArea.find(p.MESSAGES);return b=b.filter(function(a){var b=""+a.id+a.isread;if(this._messageQueue[b])return!1;var c=f.find(p.MESSAGE+'[data-id="'+b+'"]');return c.length||(this._messageQueue[b]=!0),!c.length}.bind(this)),e=b.length,c.render("core_message/message_area_messages",{messages:b}).then(function(b,f){if(e>0){var g=a("<div>"+b+"</div>");this._hasMatchingBlockTime(this.messageArea.node,g,!1)&&g.find(p.BLOCKTIME+":first").remove(),c.appendNodeContents(this.messageArea.find(p.MESSAGES),g,f),d&&this._scrollBottom(),this._numMessagesDisplayed+=e,this._backoffTimer.restart()}}.bind(this))},m.prototype._addLastMessageToDom=function(){var a=b.call([{methodname:"core_message_data_for_messagearea_get_most_recent_message",args:{currentuserid:this.messageArea.getCurrentUserId(),otheruserid:this._getUserId()}}]);return a[0].then(function(a){return this._addMessagesToDom([a],!0)}.bind(this)).always(function(){this.messageArea.find(p.SENDMESSAGETEXT).val("").trigger("input")}.bind(this)).fail(d.exception)},m.prototype._getUserId=function(){return this.messageArea.find(p.MESSAGES).data("userid")},m.prototype._scrollBottom=function(){var a=this.messageArea.find(p.MESSAGES);0!==a.length&&a.scrollTop(a[0].scrollHeight)},m.prototype._selectPreviousMessage=function(b,c){var d=a(b.target).closest(p.MESSAGE);do d=d.prev();while(d.length&&!d.is(p.MESSAGE));d.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},m.prototype._selectNextMessage=function(b,c){var d=a(b.target).closest(p.MESSAGE);do d=d.next();while(d.length&&!d.is(p.MESSAGE));d.focus(),c.originalEvent.preventDefault(),c.originalEvent.stopPropagation()},m.prototype._setMessaging=function(b){a(b.target).closest(p.MESSAGERESPONSE).addClass("messaging")},m.prototype._clearMessaging=function(b){a(b.target).closest(p.MESSAGERESPONSE).removeClass("messaging")},m.prototype._startDeleting=function(a){var b=new g(this.messageArea);b.chooseMessagesToDelete(),a.preventDefault()},m.prototype._isEditing=function(){return this.messageArea.find(p.MESSAGESAREA).hasClass("editing")},m.prototype._toggleMessage=function(b){if(this._isEditing()){var c=a(b.target).closest(p.MESSAGE);"true"===c.attr("aria-checked")?c.attr("aria-checked","false"):c.attr("aria-checked","true")}},m.prototype._adjustMessagesAreaHeight=function(){var a=this.messageArea.find(p.MESSAGES),b=this.messageArea.find(p.MESSAGERESPONSE),c=b.outerHeight(),d=c-o,e=n-d;a.outerHeight(e)},m.prototype._sendMessageHandler=function(a,b){b.originalEvent.preventDefault(),this._sendMessage()},m.prototype._hideMessagingArea=function(){this.messageArea.find(p.MESSAGINGAREA).removeClass("show-messages").addClass("hide-messages")},m.prototype._hasMatchingBlockTime=function(a,b,c){var d,e,f,g;return c?(e=":first",g=":last"):(e=":last",g=":first"),d=a.find(p.BLOCKTIME+e),f=b.find(p.BLOCKTIME+g),!(!d.length||!f.length)&&d.data("blocktime")==f.data("blocktime")},m});
  61. define('core_message/preferences_processor_form', ["jquery","core/ajax","core/notification","core/custom_interaction_events"],function(a,b,c,d){var e=function(b){this.root=a(b),this.userId=this.root.attr("data-user-id"),this.name=this.root.attr("data-processor-name"),this.root.find("form").on("submit",function(b){b.preventDefault(),this.save().done(function(){a(document).trigger("mpp:formsubmitted")})}.bind(this));var c=this.root.find("[data-cancel-button]");d.define(c,[d.events.activate]),c.on(d.events.activate,function(){a(document).trigger("mpp:formcancelled")})};return e.prototype.startLoading=function(){this.root.addClass("loading")},e.prototype.stopLoading=function(){this.root.removeClass("loading")},e.prototype.isLoading=function(){return this.root.hasClass("loading")},e.prototype.save=function(){if(this.isLoading())return a.Deferred();this.startLoading();var d=this.root.find("form").serializeArray(),e={methodname:"core_message_message_processor_config_form",args:{userid:this.userId,name:this.name,formvalues:d}};return b.call([e])[0].fail(c.exception).always(function(){this.stopLoading()}.bind(this))},e});
  62. define('core_message/preferences_notifications_list_controller', ["jquery","core/ajax","core/notification","core/custom_interaction_events","core_message/notification_preference","core_message/notification_processor_settings"],function(a,b,c,d,e,f){var g={DISABLE_NOTIFICATIONS:'[data-region="disable-notification-container"] [data-disable-notifications]',DISABLE_NOTIFICATIONS_CONTAINER:'[data-region="disable-notification-container"]',PREFERENCE:"[data-state]",PREFERENCE_ROW:'[data-region="preference-row"]',PREFERENCE_INPUT:"[data-state] input",PROCESSOR_SETTING:"[data-processor-setting]"},h=function(b){this.root=a(b),this.userId=this.root.attr("data-user-id"),this.registerEventListeners()};return h.prototype.isDisabled=function(){return this.root.hasClass("disabled")},h.prototype.setDisabled=function(){this.root.addClass("disabled"),this.root.find(g.PREFERENCE_INPUT).prop("disabled",!0)},h.prototype.setEnabled=function(){this.root.removeClass("disabled"),this.root.find(g.PREFERENCE_INPUT).prop("disabled",!1)},h.prototype.toggleDisableAllStatus=function(){var d=a(g.DISABLE_NOTIFICATIONS),e=a(g.DISABLE_NOTIFICATIONS_CONTAINER),f=d.prop("checked");if(e.hasClass("loading"))return a.Deferred().resolve();e.addClass("loading");var h={methodname:"core_user_update_user_preferences",args:{userid:this.userId,emailstop:f?1:0}};return b.call([h])[0].done(function(){f?this.setDisabled():this.setEnabled()}.bind(this)).always(function(){e.removeClass("loading")}).fail(c.exception)},h.prototype.registerEventListeners=function(){var b=a(g.DISABLE_NOTIFICATIONS);d.define(this.root,[d.events.activate]),this.root.on("change",function(b){if(!this.isDisabled()){var c=a(b.target).closest(g.PREFERENCE),d=a(b.target).closest(g.PREFERENCE_ROW),f=new e(d,this.userId);c.addClass("loading"),f.save().always(function(){c.removeClass("loading")})}}.bind(this)),this.root.on(d.events.activate,g.PROCESSOR_SETTING,function(b,c){var d=a(b.target).closest(g.PROCESSOR_SETTING),e=new f(d);e.show(),c.originalEvent.preventDefault()}),d.define(b,[d.events.activate]),b.on(d.events.activate,function(){this.toggleDisableAllStatus()}.bind(this))},h});
  63. define('core_message/message_area_actions', ["core_message/message_area_events"],function(a){function b(a){this.messageArea=a}var c={MESSAGES:"[data-region='messages']"};return b.prototype.messageArea=null,b.prototype.chooseMessagesToDelete=function(){0!==this.messageArea.find(c.MESSAGES).length&&this.messageArea.trigger(a.CHOOSEMESSAGESTODELETE)},b});
  64. define('core_message/message_repository', ["jquery","core/ajax","core/notification"],function(a,b,c){var d=function(a){"undefined"==typeof a.limit&&(a.limit=0),"undefined"==typeof a.offset&&(a.offset=0),a.limitfrom=a.offset,a.limitnum=a.limit,delete a.limit,delete a.offset;var d={methodname:"core_message_data_for_messagearea_conversations",args:a},e=b.call([d])[0];return e.fail(c.exception),e},e=function(a){var d={methodname:"core_message_get_unread_conversations_count",args:a},e=b.call([d])[0];return e.fail(c.exception),e},f=function(a){var d={methodname:"core_message_mark_all_messages_as_read",args:a},e=b.call([d])[0];return e.fail(c.exception),e};return{query:d,countUnreadConversations:e,markAllAsRead:f}});
  65. define('core_message/message_area_events', [],function(){return{CANCELDELETEMESSAGES:"cancel-delete-messages",CHOOSEMESSAGESTODELETE:"choose-messages-to-delete",CONTACTADDED:"contact-added",CONTACTBLOCKED:"contact-blocked",CONTACTREMOVED:"contact-removed",CONTACTSELECTED:"contact-selected",CONTACTSSELECTED:"contacts-selected",CONTACTUNBLOCKED:"contact-unblocked",CONVERSATIONDELETED:"conversation-deleted",CONVERSATIONSELECTED:"conversation-selected",CONVERSATIONSSELECTED:"conversations-selected",MESSAGESDELETED:"messages-deleted",MESSAGESEARCHCANCELED:"message-search-canceled",MESSAGESENT:"message-sent",SENDMESSAGE:"message-send",USERSSEARCHCANCELED:"users-search-canceled"}});
  66. define('core_message/notification_processor_settings', ["jquery","core/ajax","core/notification","core/fragment","core/templates","core/str","tool_lp/dialogue"],function(a,b,c,d,e,f,g){var h={PROCESSOR:"[data-processor-name]",PREFERENCE_ROW:'[data-region="preference-row"]'},i=function(b){this.root=a(b),this.name=this.root.attr("data-name"),this.userId=this.root.attr("data-user-id"),this.contextId=this.root.attr("data-context-id")};return i.prototype.show=function(){d.loadFragment("message","processor_settings",this.contextId,{userid:this.userId,type:this.name}).done(function(b,c){f.get_string("processorsettings","message").done(function(d){var f=new g(d,b,function(){e.runTemplateJS(c)},function(){f.close()});a(document).on("mpp:formsubmitted",function(){f.close(),this.updateConfiguredStatus()}.bind(this)),a(document).on("mpp:formcancelled",function(){f.close()})}.bind(this))}.bind(this))},i.prototype.updateConfiguredStatus=function(){var d=this.root.closest(h.PROCESSOR);if(!d.hasClass("unconfigured"))return!1;var e=d.attr("data-processor-name"),f={methodname:"core_message_get_message_processor",args:{name:e,userid:this.userId}};return b.call([f])[0].fail(c.exception).done(function(b){if(b.userconfigured){var c=a(h.PREFERENCE_ROW+' [data-processor-name="'+e+'"]');d.removeClass("unconfigured"),c.removeClass("disabled")}})},i});
  67. define('mod_assign/grading_navigation', ["jquery","core/notification","core/str","core/form-autocomplete","core/ajax","mod_assign/grading_form_change_checker"],function(a,b,c,d,e,f){var g=function(e){this._regionSelector=e,this._region=a(e),this._filters=[],this._users=[],this._filteredUsers=[],this._loadAllUsers(),this._region.find('[data-action="previous-user"]').on("click",this._handlePreviousUser.bind(this)),this._region.find('[data-action="next-user"]').on("click",this._handleNextUser.bind(this)),this._region.find('[data-action="change-user"]').on("change",this._handleChangeUser.bind(this)),this._region.find('[data-region="user-filters"]').on("click",this._toggleExpandFilters.bind(this)),a(document).on("user-changed",this._refreshSelector.bind(this));var f=this._region.find('[data-region="user-filters"]'),g=a(document.getElementById(f.attr("aria-controls")));g.on("change",'[type="checkbox"]',this._filterChanged.bind(this));var h=a('[data-region="grading-navigation-panel"]').data("first-userid");h&&this._selectUserById(h),c.get_string("changeuser","mod_assign").done(function(a){d.enhance("[data-action=change-user]",!1,"mod_assign/participant_selector",a)}).fail(b.exception),a(document).bind("start-loading-user",function(){this._isLoading=!0}.bind(this)),a(document).bind("finish-loading-user",function(){this._isLoading=!1}.bind(this))};return g.prototype._isLoading=!1,g.prototype._regionSelector=null,g.prototype._filters=null,g.prototype._users=null,g.prototype._region=null,g.prototype._loadAllUsers=function(){var a=this._region.find("[data-action=change-user]"),c=a.attr("data-assignmentid"),d=a.attr("data-groupid");e.call([{methodname:"mod_assign_list_participants",args:{assignid:c,groupid:d,filter:"",onlyids:!0},done:this._usersLoaded.bind(this),fail:b.exception}])},g.prototype._usersLoaded=function(b){if(this._filteredUsers=this._users=b,this._users.length){var c=this._region.find('[data-region="user-filters"]'),d=a(document.getElementById(c.attr("aria-controls")));d.find('[type="checkbox"]').trigger("change")}else this._selectNoUser()},g.prototype._checkClickOutsideConfigureFilters=function(b){var c=this._region.find('[data-region="configure-filters"]');if(!c.is(b.target)&&0===c.has(b.target).length){var d=this._region.find('[data-region="user-filters"]');c.hide(),c.attr("aria-hidden","true"),d.attr("aria-expanded","false"),a(document).unbind("click.mod_assign_grading_navigation")}},g.prototype._filterChanged=function(d){var e=a(d.target).attr("name"),f=e.split("_").pop(),g=a(d.target).prop("checked");if(g)this._filters.indexOf(f)==-1&&(this._filters[this._filters.length]=f);else{var h=this._filters.indexOf(f);h!=-1&&this._filters.splice(h,1)}var i=[];this._region.find('[data-region="configure-filters"]').find('[type="checkbox"]').each(function(b,c){a(c).prop("checked")&&(i[i.length]=a(c).closest("label").text())}),i.length?this._region.find('[data-region="user-filters"] span').text(i.join(", ")):c.get_string("nofilters","mod_assign").done(function(a){this._region.find('[data-region="user-filters"] span').text(a)}.bind(this)).fail(b.exception);var j=this._region.find("[data-action=change-user]"),k=j.attr("data-selected"),l=0;this._filteredUsers=[],a.each(this._users,function(b,c){var d=!0;a.each(this._filters,function(a,b){"submitted"==b?"0"==c.submitted&&(d=!1):"notsubmitted"==b?"1"==c.submitted&&(d=!1):"requiregrading"==b&&"0"==c.requiregrading&&(d=!1)}),d&&(this._filteredUsers[this._filteredUsers.length]=c,k==c.id&&(l=this._filteredUsers.length-1))}.bind(this)),this._filteredUsers.length?this._selectUserById(this._filteredUsers[l].id):this._selectNoUser()},g.prototype._selectNoUser=function(){this._isLoading||(f.checkFormForChanges('[data-region="grade-panel"] .gradeform')?c.get_strings([{key:"unsavedchanges",component:"mod_assign"},{key:"unsavedchangesquestion",component:"mod_assign"},{key:"saveandcontinue",component:"mod_assign"},{key:"cancel",component:"core"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){a(document).trigger("save-changes",-1)})}):a(document).trigger("user-changed",-1))},g.prototype._selectUserById=function(d){var e=this._region.find("[data-action=change-user]"),g=parseInt(d,10);this._isLoading||(f.checkFormForChanges('[data-region="grade-panel"] .gradeform')?c.get_strings([{key:"unsavedchanges",component:"mod_assign"},{key:"unsavedchangesquestion",component:"mod_assign"},{key:"saveandcontinue",component:"mod_assign"},{key:"cancel",component:"core"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){a(document).trigger("save-changes",g)})}):(e.attr("data-selected",d),!isNaN(g)&&g>0&&a(document).trigger("user-changed",d)))},g.prototype._toggleExpandFilters=function(b){b.preventDefault();var c=a(b.target).closest('[data-region="user-filters"]'),d="true"==c.attr("aria-expanded"),e=a(document.getElementById(c.attr("aria-controls")));d?(e.hide(),e.attr("aria-hidden","true"),c.attr("aria-expanded","false"),a(document).unbind("click.mod_assign_grading_navigation")):(e.css("display","inline-block"),e.attr("aria-hidden","false"),c.attr("aria-expanded","true"),b.stopPropagation(),a(document).on("click.mod_assign_grading_navigation",this._checkClickOutsideConfigureFilters.bind(this)))},g.prototype._handlePreviousUser=function(a){a.preventDefault();var b=this._region.find("[data-action=change-user]"),c=b.attr("data-selected"),d=0,e=0;for(d=0;d<this._filteredUsers.length;d++)if(this._filteredUsers[d].id==c){e=d;break}var f=this._filteredUsers.length,g=e-1;g<0&&(g=f-1),f&&this._selectUserById(this._filteredUsers[g].id)},g.prototype._handleNextUser=function(a){a.preventDefault();var b=this._region.find("[data-action=change-user]"),c=b.attr("data-selected"),d=0,e=0;for(d=0;d<this._filteredUsers.length;d++)if(this._filteredUsers[d].id==c){e=d;break}var f=this._filteredUsers.length,g=(e+1)%f;f&&this._selectUserById(this._filteredUsers[g].id)},g.prototype._refreshCount=function(){var a=this._region.find("[data-action=change-user]"),d=a.attr("data-selected"),e=0,f=0;if(isNaN(d)||d<=0)this._region.find('[data-region="user-count"]').hide();else{for(this._region.find('[data-region="user-count"]').show(),e=0;e<this._filteredUsers.length;e++)if(this._filteredUsers[e].id==d){f=e;break}var g=this._filteredUsers.length;g&&(f+=1);var h={x:f,y:g};c.get_string("xofy","mod_assign",h).done(function(a){this._region.find('[data-region="user-count-summary"]').text(a)}.bind(this)).fail(b.exception)}},g.prototype._refreshSelector=function(a,b){var c=this._region.find("[data-action=change-user]");b=parseInt(b,10),!isNaN(b)&&b>0&&c.attr("data-selected",b),this._refreshCount()},g.prototype._handleChangeUser=function(){var d=this._region.find("[data-action=change-user]"),e=parseInt(d.val(),10);this._isLoading||(f.checkFormForChanges('[data-region="grade-panel"] .gradeform')?c.get_strings([{key:"unsavedchanges",component:"mod_assign"},{key:"unsavedchangesquestion",component:"mod_assign"},{key:"saveandcontinue",component:"mod_assign"},{key:"cancel",component:"core"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){a(document).trigger("save-changes",e)})}):!isNaN(e)&&e>0&&(d.attr("data-selected",e),a(document).trigger("user-changed",e)))},g});
  68. define('mod_assign/grading_form_change_checker', ["jquery"],function(a){return{saveFormState:function(b){a(b).trigger("save-form-state");var c=a(b).serialize();a(b).data("saved-form-state",c)},checkFormForChanges:function(b){a(b).trigger("save-form-state");var c=a(b).serialize(),d=a(b).data("saved-form-state");return"undefined"!=typeof d&&d!=c}}});
  69. define('mod_assign/grading_navigation_user_info', ["jquery","core/notification","core/ajax","core/templates"],function(a,b,c,d){var e=function(b){this._regionSelector=b,this._region=a(b),this._userCache={},a(document).on("user-changed",this._refreshUserInfo.bind(this))};return e.prototype._regionSelector=null,e.prototype._userCache=null,e.prototype._region=null,e.prototype._lastUserId=0,e.prototype._getAssignmentId=function(){return this._region.attr("data-assignmentid")},e.prototype._refreshUserInfo=function(e,f){var g=a.Deferred();this._lastUserId!=f&&(this._lastUserId=f,d.render("mod_assign/loading",{}).done(function(e,h){if(this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,e,h),this._region.fadeIn("fast")}.bind(this)),f<0)return void d.render("mod_assign/grading_navigation_no_users",{}).done(function(a,b){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception);if("undefined"!=typeof this._userCache[f])g.resolve(this._userCache[f]);else{var i=this._getAssignmentId(),j=c.call([{methodname:"mod_assign_get_participant",args:{userid:f,assignid:i,embeduser:!0}}]);j[0].done(function(a){a.hasOwnProperty("id")?(this._userCache[f]=a,g.resolve(this._userCache[f])):g.reject("No users")}.bind(this)).fail(b.exception)}g.done(function(c){var e=a("[data-showuseridentity]").data("showuseridentity").split(","),f=[];c.courseid=a('[data-region="grading-navigation-panel"]').attr("data-courseid"),c.user&&(a.each(e,function(a,b){"undefined"!=typeof c.user[b]&&""!==c.user[b]&&(c.hasidentity=!0,f.push(c.user[b]))}),c.identity=f.join(", "),c.user.profileimageurl&&(c.profileimageurl=c.user.profileimageurl)),d.render("mod_assign/grading_navigation_user_summary",c).done(function(a,b){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception)}.bind(this)).fail(function(){d.render("mod_assign/grading_navigation_no_users",{}).done(function(a,b){this._region.fadeOut("fast",function(){d.replaceNodeContents(this._region,a,b),this._region.fadeIn("fast")}.bind(this))}.bind(this)).fail(b.exception)}.bind(this))}.bind(this)).fail(b.exception))},e});
  70. define('mod_assign/grading_review_panel', ["jquery","mod_assign/grading_events"],function(a,b){var c=function(){this._region=a('[data-region="review-panel-content"]'),this.registerEventListeners()};return c.prototype._region=null,c.prototype.getReviewPanel=function(a){var b=this._region.data("panel-owner");return"undefined"==typeof b&&this._region.data("review-panel-plugin",a),this._region.data("review-panel-plugin")==a&&this._region[0]},c.prototype.getTogglePanelButton=function(){return this.getPanelElement().find('[data-region="review-panel-toggle"]')},c.prototype.getPanelElement=function(){return a('[data-region="review-panel"]')},c.prototype.getPanelContentElement=function(){return a('[data-region="review-panel-content"]')},c.prototype.togglePanel=function(){this.getPanelElement().hasClass("collapsed")?a(document).trigger(b.EXPAND_REVIEW_PANEL):a(document).trigger(b.COLLAPSE_REVIEW_PANEL)},c.prototype.collapsePanel=function(){this.getPanelElement().addClass("collapsed").removeClass("grade-panel-collapsed"),this.getPanelContentElement().attr("aria-hidden",!0)},c.prototype.expandPanel=function(){this.getPanelElement().removeClass("collapsed"),this.getPanelContentElement().removeAttr("aria-hidden")},c.prototype.registerEventListeners=function(){var c=this.getTogglePanelButton();c.click(function(a){this.togglePanel(),a.preventDefault()}.bind(this)),c.keydown(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||13!==a.keyCode&&32!==a.keyCode||(this.togglePanel(),a.preventDefault())}.bind(this));var d=a(document);d.on(b.COLLAPSE_REVIEW_PANEL,function(){this.collapsePanel()}.bind(this)),d.on(b.COLLAPSE_GRADE_PANEL,function(){this.expandPanel(),this.getPanelElement().addClass("grade-panel-collapsed")}.bind(this)),d.on(b.EXPAND_REVIEW_PANEL,function(){this.expandPanel()}.bind(this)),d.on(b.EXPAND_GRADE_PANEL,function(){this.getPanelElement().removeClass("grade-panel-collapsed")}.bind(this))},c});
  71. define('mod_assign/grading_events', function(){return{COLLAPSE_REVIEW_PANEL:"grading:collapse-review-panel",EXPAND_REVIEW_PANEL:"grading:expand-review-panel",COLLAPSE_GRADE_PANEL:"grading:collapse-grade-panel",EXPAND_GRADE_PANEL:"grading:expand-grade-panel"}});
  72. define('mod_assign/grading_panel', ["jquery","core/yui","core/notification","core/templates","core/fragment","core/ajax","core/str","mod_assign/grading_form_change_checker","mod_assign/grading_events"],function(a,b,c,d,e,f,g,h,i){var j=function(b){this._regionSelector=b,this._region=a(b),this._userCache=[],this.registerEventListeners()};return j.prototype._regionSelector=null,j.prototype._lastUserId=0,j.prototype._lastAttemptNumber=-1,j.prototype._region=null,j.prototype._niceReplaceNodeContents=function(b,c,e){var f=a.Deferred();return b.fadeOut("fast",function(){d.replaceNodeContents(b,c,e),b.fadeIn("fast",function(){f.resolve()})}),f.promise()},j.prototype._saveFormState=function(){"undefined"!=typeof window.tinyMCE&&window.tinyMCE.triggerSave();var b=a('[data-region="grading-actions-form"] [name="sendstudentnotifications"]').prop("checked");a('.gradeform [name="sendstudentnotifications"]').val(b)},j.prototype._submitForm=function(b,d){var e=a(this._region.find("form.gradeform"));a('[data-region="overlay"]').show(),e.trigger("save-form-state");var g=e.serialize(),h=this._region.attr("data-assignmentid");f.call([{methodname:"mod_assign_submit_grading_form",args:{assignmentid:h,userid:this._lastUserId,jsonformdata:JSON.stringify(g)},done:this._handleFormSubmissionResponse.bind(this,g,d),fail:c.exception}])},j.prototype._handleFormSubmissionResponse=function(d,e,f){"undefined"==typeof e&&(e=this._lastUserId),f.length?a(document).trigger("reset",[this._lastUserId,d]):(g.get_strings([{key:"changessaved",component:"core"},{key:"gradechangessaveddetail",component:"mod_assign"}]).done(function(a){c.alert(a[0],a[1])}).fail(c.exception),b.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()}),e==this._lastUserId?a(document).trigger("reset",e):a(document).trigger("user-changed",e)),a('[data-region="overlay"]').hide()},j.prototype._resetForm=function(b,c,d){var e=a.Event("custom");"undefined"==typeof c&&(c=this._lastUserId),this._lastUserId=0,this._refreshGradingPanel(e,c,d)},j.prototype._chooseAttempt=function(b){var d=a(b.target),e=d.data("submissions"),f=a(document.getElementById(e)),h=f.clone(),i=h.wrap(a("<form/>")).html();g.get_strings([{key:"viewadifferentattempt",component:"mod_assign"},{key:"view",component:"core"},{key:"cancel",component:"core"}]).done(function(b){c.confirm(b[0],i,b[1],b[2],function(){var b=a("input:radio[name='select-attemptnumber']:checked").val();this._refreshGradingPanel(null,this._lastUserId,"",b)}.bind(this))}.bind(this)).fail(c.exception)},j.prototype._addPopoutButtons=function(b){var e=a(b);d.render("mod_assign/popout_button",{}).done(function(a){var b=e.find('[data-fieldtype="filemanager"],[data-fieldtype="editor"],[data-fieldtype="grading"]').closest(".fitem");b.addClass("has-popout").find("label").parent().append(a),e.on("click",'[data-region="popout-button"]',this._togglePopout.bind(this))}.bind(this)).fail(c.exception)},j.prototype._togglePopout=function(b){b.preventDefault();var c=a(b.target).closest(".fitem");c.hasClass("popout")?a(".popout").removeClass("popout"):(a(".popout").removeClass("popout"),c.addClass("popout"),c.addClass("moodle-has-zindex"))},j.prototype._refreshGradingPanel=function(b,f,g,i){var j=this._region.attr("data-contextid");"undefined"==typeof g&&(g=""),"undefined"==typeof i&&(i=-1),this._lastUserId==f&&this._lastAttemptNumber==i&&""===g||(this._lastUserId=f,this._lastAttemptNumber=i,a(document).trigger("start-loading-user"),window.M.util.js_pending("mod-assign-loading-user"),d.render("mod_assign/loading",{}).done(function(b,d){this._niceReplaceNodeContents(this._region,b,d).done(function(){if(f>0){this._region.show();var b={userid:f,attemptnumber:i,jsonformdata:JSON.stringify(g)};e.loadFragment("mod_assign","gradingpanel",j,b).done(function(b,d){this._niceReplaceNodeContents(this._region,b,d).done(function(){h.saveFormState('[data-region="grade-panel"] .gradeform'),a(document).on("editor-content-restored",function(){h.saveFormState('[data-region="grade-panel"] .gradeform')}),a('[data-region="attempt-chooser"]').on("click",this._chooseAttempt.bind(this)),this._addPopoutButtons('[data-region="grade-panel"] .gradeform'),a(document).trigger("finish-loading-user"),window.M.util.js_complete("mod-assign-loading-user")}.bind(this)).fail(c.exception)}.bind(this)).fail(c.exception),a('[data-region="review-panel"]').show()}else this._region.hide(),a('[data-region="review-panel"]').hide(),a(document).trigger("finish-loading-user"),window.M.util.js_complete("mod-assign-loading-user")}.bind(this))}.bind(this)).fail(c.exception))},j.prototype.getPanelElement=function(){return a('[data-region="grade-panel"]')},j.prototype.collapsePanel=function(){this.getPanelElement().addClass("collapsed")},j.prototype.expandPanel=function(){this.getPanelElement().removeClass("collapsed")},j.prototype.registerEventListeners=function(){var b=a(document),c=a(this._region);c.on("submit","form",function(a){a.preventDefault()}),b.on("user-changed",this._refreshGradingPanel.bind(this)),b.on("save-changes",this._submitForm.bind(this)),b.on("reset",this._resetForm.bind(this)),b.on("save-form-state",this._saveFormState.bind(this)),b.on(i.COLLAPSE_GRADE_PANEL,function(){this.collapsePanel()}.bind(this)),b.on(i.COLLAPSE_REVIEW_PANEL,function(){this.expandPanel()}.bind(this)),b.on(i.EXPAND_GRADE_PANEL,function(){this.expandPanel()}.bind(this))},j});
  73. define('mod_assign/participant_selector', ["core/ajax","jquery","core/templates"],function(a,b,c){return{processResults:function(a,b){return b},transport:function(d,e,f,g){var h=b(d).attr("data-assignmentid"),i=b(d).attr("data-groupid"),j=b('[data-region="configure-filters"] input[type="checkbox"]'),k=[];j.each(function(a,c){k[b(c).attr("name")]=b(c).prop("checked")}),a.call([{methodname:"mod_assign_list_participants",args:{assignid:h,groupid:i,filter:e,limit:30,includeenrolments:!1}}])[0].then(function(a){var d=[],e=b("[data-showuseridentity]").data("showuseridentity").split(",");return b.each(a,function(a,f){var g=f,h=[],i=!0;k.filter_submitted&&!f.submitted&&(i=!1),k.filter_notsubmitted&&f.submitted&&(i=!1),k.filter_requiregrading&&!f.requiregrading&&(i=!1),i&&(b.each(e,function(a,b){"undefined"!=typeof f[b]&&""!==f[b]&&(g.hasidentity=!0,h.push(f[b]))}),g.identity=h.join(", "),d.push(c.render("mod_assign/list_participant_user_summary",g).then(function(a){return{value:f.id,label:a}})))}),b.when.apply(b,d)}).then(function(){var a=[];arguments[0]&&(a=Array.prototype.slice.call(arguments)),f(a)})["catch"](g)}}});
  74. define('mod_assign/grading_actions', ["jquery","mod_assign/grading_events"],function(a,b){var c=function(b){this._regionSelector=b,this._region=a(b),this.registerEventListeners()};return c.prototype._regionSelector=null,c.prototype._lastUserId=0,c.prototype._region=null,c.prototype._showActionsForm=function(a,b){var c=this._region.find("[data-region=grading-actions-form]");b!=this._lastUserId&&b>0&&(this._lastUserId=b),b>0?c.removeClass("hide"):c.addClass("hide")},c.prototype._trigger=function(b){a(document).trigger(b)},c.prototype.getReviewPanelElement=function(){return a('[data-region="review-panel"]')},c.prototype.hasReviewPanelElement=function(){return this.getReviewPanelElement().length>0},c.prototype.getCollapseGradePanelButton=function(){return a('[data-region="grade-actions"] .collapse-grade-panel')},c.prototype.getCollapseReviewPanelButton=function(){return a('[data-region="grade-actions"] .collapse-review-panel')},c.prototype.getExpandAllPanelsButton=function(){return a('[data-region="grade-actions"] .collapse-none')},c.prototype.resetLayoutButtons=function(){this.getCollapseGradePanelButton().removeClass("active"),this.getCollapseReviewPanelButton().removeClass("active"),this.getExpandAllPanelsButton().removeClass("active")},c.prototype.collapseReviewPanel=function(){a(document).trigger(b.COLLAPSE_REVIEW_PANEL),a(document).trigger(b.EXPAND_GRADE_PANEL),this.resetLayoutButtons(),this.getCollapseReviewPanelButton().addClass("active")},c.prototype.collapseGradePanel=function(){a(document).trigger(b.COLLAPSE_GRADE_PANEL),a(document).trigger(b.EXPAND_REVIEW_PANEL),this.resetLayoutButtons(),this.getCollapseGradePanelButton().addClass("active")},c.prototype.expandAllPanels=function(){a(document).trigger(b.EXPAND_GRADE_PANEL),a(document).trigger(b.EXPAND_REVIEW_PANEL),this.resetLayoutButtons(),this.getExpandAllPanelsButton().addClass("active")},c.prototype.registerEventListeners=function(){if(this.hasReviewPanelElement()){var b=this.getCollapseReviewPanelButton();b.click(function(a){this.collapseReviewPanel(),a.preventDefault()}.bind(this)),b.keydown(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||13!==a.keyCode&&32!==a.keyCode||(this.collapseReviewPanel(),a.preventDefault())}.bind(this));var c=this.getCollapseGradePanelButton();c.click(function(a){this.collapseGradePanel(),a.preventDefault()}.bind(this)),c.keydown(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||13!==a.keyCode&&32!==a.keyCode||(this.collapseGradePanel(),a.preventDefault())}.bind(this));var d=this.getExpandAllPanelsButton();d.click(function(a){this.expandAllPanels(),a.preventDefault()}.bind(this)),d.keydown(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||13!==a.keyCode&&32!==a.keyCode||(this.expandAllPanels(),a.preventDefault())}.bind(this))}a(document).on("user-changed",this._showActionsForm.bind(this)),this._region.find('[name="savechanges"]').on("click",this._trigger.bind(this,"save-changes")),this._region.find('[name="resetbutton"]').on("click",this._trigger.bind(this,"reset")),this._region.find("form").on("submit",function(a){a.preventDefault()})},c});
  75. define('mod_feedback/edit', ["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={deleteItem:function(b){b.preventDefault(),c.get_strings([{key:"confirmation",component:"admin"},{key:"confirmdeleteitem",component:"mod_feedback"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],a.proxy(function(){window.location=a(this).attr("href")},b.currentTarget))})},setup:function(){a("body").delegate('[data-action="delete"]',"click",e.deleteItem)}};return{setup:e.setup}});
  76. define('mod_lti/tool_card_controller', ["jquery","core/ajax","core/notification","core/templates","mod_lti/tool_type","mod_lti/events","mod_lti/keys","core/str"],function(a,b,c,d,e,f,g,h){var i={DELETE_BUTTON:".delete",NAME_ELEMENT:".name",DESCRIPTION_ELEMENT:".description",CAPABILITIES_CONTAINER:".capabilities-container",ACTIVATE_BUTTON:".tool-card-footer a.activate"},j=2e3,k=function(a){return a.find(i.DELETE_BUTTON)},l=function(a){return a.find(i.NAME_ELEMENT)},m=function(a){return a.find(i.DESCRIPTION_ELEMENT)},n=function(a){return a.find(i.ACTIVATE_BUTTON)},o=function(a){return!!n(a).length},p=function(a){return a.find(i.CAPABILITIES_CONTAINER)},q=function(a){return!!p(a).length},r=function(a){return a.attr("data-type-id")},s=function(a){a.removeClass("announcement loading success fail capabilities")},t=function(a){s(a),a.addClass("announcement loading")},u=function(a){a.removeClass("announcement loading")},v=function(b){var c=a.Deferred();return s(b),b.addClass("announcement success"),setTimeout(function(){b.removeClass("announcement success"),c.resolve()},j),c},w=function(b){var c=a.Deferred();return s(b),b.addClass("announcement fail"),setTimeout(function(){b.removeClass("announcement fail"),c.resolve()},j),c},x=function(b){var d=a.Deferred(),f=r(b);return t(b),""===f?a.Deferred().resolve():(h.get_strings([{key:"delete",component:"mod_lti"},{key:"delete_confirmation",component:"mod_lti"},{key:"delete",component:"mod_lti"},{key:"cancel",component:"core"}]).done(function(a){c.confirm(a[0],a[1],a[2],a[3],function(){e["delete"](f).done(function(){u(b),v(b).done(function(){b.remove()}).fail(c.exception).always(function(){d.resolve()})}).fail(function(a){w(b),d.reject(a)})},function(){u(b),d.resolve()})}).fail(function(a){u(b),c.exception(a),d.reject(a)}),d)},y=function(a,b){a.attr("data-val-snapshot",b)},z=function(a){return a.attr("data-val-snapshot")},A=function(a){var b=m(a);if(!b.hasClass("loading")){var c=b.text().trim();y(b,c)}},B=function(b){var d=r(b);if(""===d)return a.Deferred().resolve();var f=m(b);if(f.hasClass("loading"))return a.Deferred().resolve();var g=f.text().trim(),h=z(f);if(h==g)return a.Deferred().resolve();f.addClass("loading");var i=e.update({id:d,description:g});return i.done(function(a){f.removeClass("loading"),f.text(a.description)}).fail(c.exception),i.fail(function(){f.removeClass("loading")}),i},C=function(a){var b=l(a);if(!b.hasClass("loading")){var c=b.text().trim();y(b,c)}},D=function(b){var c=r(b);if(""===c)return a.Deferred().resolve();var d=l(b);if(d.hasClass("loading"))return a.Deferred().resolve();var f=d.text().trim(),g=z(d);if(g==f)return a.Deferred().resolve();d.addClass("loading");var h=e.update({id:c,name:f});return h.done(function(a){d.removeClass("loading"),d.text(a.name)}),h.fail(function(){d.removeClass("loading")}),h},E=function(b){var c=r(b);if(""===c)return a.Deferred().resolve();t(b);var f=e.update({id:c,state:e.constants.state.configured});return f.done(function(c){u(b);var e=v(b),f=d.render("mod_lti/tool_card",c);a.when(f,e).then(function(a){var c=a[0],e=a[1];d.replaceNode(b,c,e)})}),f.fail(function(){u(b),w(b)}),f},F=function(a){a.addClass("announcement capabilities")},G=function(a){a.removeClass("announcement capabilities")},H=function(a){q(a)?F(a):E(a)},I=function(a){var b=k(a);b.click(function(b){b.preventDefault(),x(a)}),b.keypress(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||a.keyCode!=g.ENTER&&a.keyCode!=g.SPACE||(a.preventDefault(),b.click())});var c=m(a);c.focus(function(b){b.preventDefault(),A(a)}),c.blur(function(b){b.preventDefault(),B(a)}),c.keypress(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||a.keyCode==g.ENTER&&(a.preventDefault(),c.blur())});var d=l(a);if(d.focus(function(b){b.preventDefault(),C(a)}),d.blur(function(b){b.preventDefault(),D(a)}),d.keypress(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||a.keyCode==g.ENTER&&(a.preventDefault(),d.blur())}),o(a)){var e=n(a);e.click(function(b){b.preventDefault(),H(a)}),e.keypress(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||a.keyCode!=g.ENTER&&a.keyCode!=g.SPACE||(a.preventDefault(),e.click())})}if(q(a)){var h=p(a);h.on(f.CAPABILITIES_AGREE,function(){E(a)}),h.on(f.CAPABILITIES_DECLINE,function(){G(a)})}};return{init:function(a){I(a)}}});
  77. define('mod_lti/events', [],function(){return{NEW_TOOL_TYPE:"lti.tool.type.new",START_EXTERNAL_REGISTRATION:"lti.registration.external.start",STOP_EXTERNAL_REGISTRATION:"lti.registration.external.stop",START_CARTRIDGE_REGISTRATION:"lti.registration.cartridge.start",STOP_CARTRIDGE_REGISTRATION:"lti.registration.cartridge.stop",REGISTRATION_FEEDBACK:"lti.registration.feedback",CAPABILITIES_AGREE:"lti.tool.type.capabilities.agree",CAPABILITIES_DECLINE:"lti.tool.type.capabilities.decline"}});
  78. define('mod_lti/tool_type', ["core/ajax","core/notification"],function(a,b){return{query:function(c){var d={methodname:"mod_lti_get_tool_types",args:c||{}},e=a.call([d])[0];return e.fail(b.exception),e},create:function(b){var c={methodname:"mod_lti_create_tool_type",args:b},d=a.call([c])[0];return d},update:function(c){var d={methodname:"mod_lti_update_tool_type",args:c},e=a.call([d])[0];return e.fail(b.exception),e},"delete":function(c){var d={methodname:"mod_lti_delete_tool_type",args:{id:c}},e=a.call([d])[0];return e.fail(b.exception),e},getFromToolProxyId:function(a){return this.query({toolproxyid:a})},isCartridge:function(b){var c={methodname:"mod_lti_is_cartridge",args:{url:b}},d=a.call([c])[0];return d},constants:{state:{configured:1,pending:2,rejected:3}}}});
  79. define('mod_lti/form-field', ["jquery"],function(a){var b=function(a,b,c,d){this.name=a,this.id="id_"+this.name,this.selector="#"+this.id,this.type=b,this.resetIfUndefined=c,this.defaultValue=d};return b.TYPES={TEXT:1,SELECT:2,CHECKBOX:3,EDITOR:4},b.prototype.setFieldValue=function(c){if(null===c){if(!this.resetIfUndefined)return;c=this.defaultValue}switch(this.type){case b.TYPES.CHECKBOX:c?a(this.selector).prop("checked",!0):a(this.selector).prop("checked",!1);break;case b.TYPES.EDITOR:if("undefined"!==a.type(c.text)){var d=a(this.selector+"editable");d.length?d.html(c.text):"undefined"!=typeof tinyMCE&&tinyMCE.execInstanceCommand(this.id,"mceInsertContent",!1,c.text),a(this.selector).val(c.text)}break;default:a(this.selector).val(c)}},b});
  80. define('mod_lti/contentitem_return', ["jquery"],function(a){return{init:function(b){a(window).ready(function(){window!=top&&parent.processContentItemReturnData(b)})}}});
  81. define('mod_lti/contentitem', ["jquery","core/notification","core/str","core/templates","mod_lti/form-field","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f,g){var h,i={init:function(a,e){var i="";c.get_string("selectcontent","lti").then(function(c){i=c;var j={url:a,postData:e},k=d.render("mod_lti/contentitem",j);h?(h.setBody(k),h.show()):f.create({title:i,body:k,large:!0}).done(function(a){h=a,h.show(),a.getRoot().on(g.hidden,function(){a.setBody(""),b.fetchNotifications()})})})}},j=[new e("name",e.TYPES.TEXT,(!1),""),new e("introeditor",e.TYPES.EDITOR,(!1),""),new e("toolurl",e.TYPES.TEXT,(!0),""),new e("securetoolurl",e.TYPES.TEXT,(!0),""),new e("instructorchoiceacceptgrades",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorchoicesendname",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorchoicesendemailaddr",e.TYPES.CHECKBOX,(!0),(!0)),new e("instructorcustomparameters",e.TYPES.TEXT,(!0),""),new e("icon",e.TYPES.TEXT,(!0),""),new e("secureicon",e.TYPES.TEXT,(!0),""),new e("launchcontainer",e.TYPES.SELECT,(!0),0)];return window.processContentItemReturnData=function(b){h&&h.hide();var c;for(c in j){var d=j[c],e=null;"undefined"!==a.type(b[d.name])&&(e=b[d.name]),d.setFieldValue(e)}},i});
  82. define('mod_lti/keys', [],function(){return{ENTER:13,SPACE:32}});
  83. define('mod_lti/external_registration', ["jquery","core/ajax","core/notification","core/templates","mod_lti/events","mod_lti/tool_proxy","mod_lti/tool_type","mod_lti/keys","core/str"],function(a,b,c,d,e,f,g,h,i){var j={EXTERNAL_REGISTRATION_CONTAINER:"#external-registration-page-container",EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER:"#external-registration-template-container",EXTERNAL_REGISTRATION_CANCEL_BUTTON:"#cancel-external-registration",TOOL_TYPE_CAPABILITIES_CONTAINER:"#tool-type-capabilities-container",TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER:"#tool-type-capabilities-template-container",CAPABILITIES_AGREE_CONTAINER:".capabilities-container"},k=function(){return a(j.EXTERNAL_REGISTRATION_CANCEL_BUTTON)},l=function(){return a(j.EXTERNAL_REGISTRATION_CONTAINER)},m=function(){return a(j.EXTERNAL_REGISTRATION_TEMPLATE_CONTAINER)},n=function(){return a(j.TOOL_TYPE_CAPABILITIES_CONTAINER)},o=function(){return a(j.TOOL_TYPE_CAPABILITIES_TEMPLATE_CONTAINER)},p=function(){n().addClass("loading")},q=function(){n().removeClass("loading")},r=function(){k().addClass("loading")},s=function(){k().removeClass("loading")},t=function(){n().addClass("hidden")},u=function(){n().removeClass("hidden")},v=function(){l().addClass("hidden")},w=function(){l().removeClass("hidden")},x=function(a){var b=k();b.attr("data-tool-proxy-id",a)},y=function(){var a=k();return a.attr("data-tool-proxy-id")},z=function(){var a=k();a.removeAttr("data-tool-proxy-id")},A=function(){return!!y()},B=function(){var a=k();return a.attr("data-tool-proxy-new")&&A()},C=function(){var a=k();return a.attr("data-tool-proxy-new","new")},D=function(){var a=k();return a.removeAttr("data-tool-proxy-new")},E=function(a){var c={methodname:"mod_lti_get_tool_proxy_registration_request",args:{id:a}};return b.call([c])[0]},F=function(){r();var b=a.Deferred();if(B()){var d=y();f["delete"](d).done(function(){b.resolve()}).fail(function(a){b.reject(a)})}else b.resolve();return b.done(function(){L(),s()}).fail(function(b){c.exception(b),L(),s(),i.get_string("failedtodeletetoolproxy","mod_lti").done(function(b){var c={message:b,error:!0};a(document).trigger(e.REGISTRATION_FEEDBACK,c)}).fail(c.exception)}),b},G=function(a){var b=d.render("mod_lti/tool_proxy_registration_form",a);return b.done(function(a,b){var c=m();c.append(a),d.runTemplateJS(b),c.find("form").submit(),w()}).fail(c.exception),b},H=function(a){return g.update({id:a.id,state:g.constants.state.configured})},I=function(b){var f=a.Deferred();return d.render("mod_lti/tool_type_capabilities_agree",b).done(function(a,c){var g=o();v(),u(),d.replaceNodeContents(g,a,c);var h=g.find(j.CAPABILITIES_AGREE_CONTAINER);h.on(e.CAPABILITIES_AGREE,function(){p(),H(b).always(function(){q(),g.empty(),f.resolve()})}),h.on(e.CAPABILITIES_DECLINE,function(){g.empty(),f.resolve()})}).fail(f.reject),f.done(function(){t()}).fail(c.exception),f},J=function(b){var c=a.Deferred();return b&&""!==b?f.create({regurl:b}).done(function(a){C(),c=K(a.id)}).fail(function(b){F();var d={message:b.message,error:!0};a(document).trigger(e.REGISTRATION_FEEDBACK,d),c.reject(b)}):c.resolve(),c},K=function(b){var c=a.Deferred();return x(b),E(b).done(function(a){G(a).done(function(){c.resolve()}).fail(c.fail)}).fail(c.fail),c},L=function(){A()&&z(),D(!1),v();var b=m();b.empty(),a(document).trigger(e.STOP_EXTERNAL_REGISTRATION)},M=function(){a(document).on(e.START_EXTERNAL_REGISTRATION,function(a,b){b&&(b.url&&J(b.url),b.proxyid&&K(b.proxyid))});var b=k();b.click(function(a){a.preventDefault(),F()}),b.keypress(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||a.keyCode!=h.ENTER&&a.keyCode!=h.SPACE||(a.preventDefault(),F())}),window.triggerExternalRegistrationComplete=function(b){var d=a.Deferred(),f={message:"",error:!1};if("success"==b.status){if(i.get_string("successfullycreatedtooltype","mod_lti").done(function(a){f.message=a}).fail(c.exception),d.done(function(){L(),a(document).trigger(e.REGISTRATION_FEEDBACK,f),a(document).trigger(e.NEW_TOOL_TYPE)}).fail(c.exception),B()){var h=y();g.getFromToolProxyId(h).done(function(a){if(a&&a.length){var b=a[0];b.hascapabilitygroups?I(b).always(function(){d.resolve()}):d.resolve()}else d.resolve()}).fail(function(){d.resolve()})}}else f.message=b.error,f.error=!0,d.done(function(){F().always(function(){a(document).trigger(e.REGISTRATION_FEEDBACK,f)})}).fail(c.exception),d.resolve();return d}};return{init:function(){M()}}});
  84. define('mod_lti/external_registration_return', [],function(){return{init:function(a,b,c,d){window.parent&&window.parent.triggerExternalRegistrationComplete({message:a,error:b,id:c,status:d})}}});
  85. define('mod_lti/tool_configure_controller', ["jquery","core/ajax","core/notification","core/templates","mod_lti/events","mod_lti/keys","mod_lti/tool_type","mod_lti/tool_proxy","core/str"],function(a,b,c,d,e,f,g,h,i){var j={EXTERNAL_REGISTRATION_CONTAINER:"#external-registration-container",EXTERNAL_REGISTRATION_PAGE_CONTAINER:"#external-registration-page-container",CARTRIDGE_REGISTRATION_CONTAINER:"#cartridge-registration-container",CARTRIDGE_REGISTRATION_FORM:"#cartridge-registration-form",ADD_TOOL_FORM:"#add-tool-form",TOOL_LIST_CONTAINER:"#tool-list-container",TOOL_CREATE_BUTTON:"#tool-create-button",REGISTRATION_CHOICE_CONTAINER:"#registration-choice-container",TOOL_URL:"#tool-url"},k=function(){return a(j.TOOL_CREATE_BUTTON)},l=function(){return a(j.TOOL_LIST_CONTAINER)},m=function(){return a(j.EXTERNAL_REGISTRATION_CONTAINER)},n=function(){return a(j.CARTRIDGE_REGISTRATION_CONTAINER)},o=function(){return a(j.REGISTRATION_CHOICE_CONTAINER)},p=function(){return a(j.TOOL_URL).val()},q=function(){m().addClass("hidden")},r=function(){n().addClass("hidden")},s=function(){o().addClass("hidden")},t=function(){r(),s(),m().removeClass("hidden"),w(m())},u=function(a){q(),s(),n().removeClass("hidden"),n().find(j.CARTRIDGE_REGISTRATION_FORM).attr("data-cartridge-url",a),w(n())},v=function(){q(),r(),o().removeClass("hidden"),w(o())},w=function(a){var b=a.children().detach();b.appendTo(a)},x=function(){l().addClass("hidden")},y=function(){l().removeClass("hidden")},z=function(a){var b=a.error?"error":"success";c.addNotification({message:a.message,type:b})},A=function(a){a.addClass("loading")},B=function(a){a.removeClass("loading")},C=function(){var b=a.Deferred(),e=l();A(e),a.when(g.query(),h.query({orphanedonly:!0})).done(function(a,c){d.render("mod_lti/tool_list",{tools:a,proxies:c}).done(function(a,c){e.empty(),e.append(a),d.runTemplateJS(c),b.resolve()}).fail(b.reject)}).fail(b.reject),b.fail(c.exception).always(function(){B(e)})},D=function(){var b=a.trim(p());if(""===b)return a.Deferred().resolve();var d=k();A(d);var f=g.isCartridge(b);return f.always(function(){B(d)}),f.done(function(c){c.iscartridge?(a(j.TOOL_URL).val(""),a(document).trigger(e.START_CARTRIDGE_REGISTRATION,b)):a(document).trigger(e.START_EXTERNAL_REGISTRATION,{url:b})}),f.fail(function(){i.get_string("errorbadurl","mod_lti").done(function(b){a(document).trigger(e.REGISTRATION_FEEDBACK,{message:b,error:!0})}).fail(c.exception)}),f},E=function(){a(document).on(e.NEW_TOOL_TYPE,function(){C()}),a(document).on(e.START_EXTERNAL_REGISTRATION,function(){t(),a(j.TOOL_URL).val(""),x()}),a(document).on(e.STOP_EXTERNAL_REGISTRATION,function(){y(),v()}),a(document).on(e.START_CARTRIDGE_REGISTRATION,function(a,b){u(b)}),a(document).on(e.STOP_CARTRIDGE_REGISTRATION,function(){n().find(j.CARTRIDGE_REGISTRATION_FORM).removeAttr("data-cartridge-url"),v()}),a(document).on(e.REGISTRATION_FEEDBACK,function(a,b){z(b)});var b=a(j.ADD_TOOL_FORM);b.submit(function(a){a.preventDefault(),D()})};return{init:function(){E(),C()}}});
  86. define('mod_lti/tool_proxy', ["core/ajax","core/notification"],function(a,b){return{query:function(c){var d={methodname:"mod_lti_get_tool_proxies",args:c||{}},e=a.call([d])[0];return e.fail(b.exception),e},"delete":function(c){var d={methodname:"mod_lti_delete_tool_proxy",args:{id:c}},e=a.call([d])[0];return e.fail(b.exception),e},create:function(b){var c={methodname:"mod_lti_create_tool_proxy",args:b},d=a.call([c])[0];return d}}});
  87. define('mod_lti/tool_proxy_card_controller', ["jquery","core/ajax","core/notification","core/templates","mod_lti/tool_proxy","mod_lti/events","mod_lti/keys","core/str"],function(a,b,c,d,e,f,g,h){var i={DELETE_BUTTON:".delete",CAPABILITIES_CONTAINER:".capabilities-container",ACTIVATE_BUTTON:".tool-card-footer a.activate"},j=2e3,k=function(a){return a.find(i.DELETE_BUTTON)},l=function(a){return a.find(i.ACTIVATE_BUTTON)},m=function(a){return a.attr("data-proxy-id")},n=function(a){a.removeClass("announcement loading success fail capabilities")},o=function(a){n(a),a.addClass("announcement loading")},p=function(a){a.removeClass("announcement loading")},q=function(b){var c=a.Deferred();return n(b),b.addClass("announcement success"),setTimeout(function(){b.removeClass("announcement success"),c.resolve()},j),c},r=function(b){var c=a.Deferred();return n(b),b.addClass("announcement fail"),setTimeout(function(){b.removeClass("announcement fail"),c.resolve()},j),c},s=function(b){var d=a.Deferred(),f=m(b);return o(b),""===f?a.Deferred().resolve():(h.get_strings([{key:"delete",component:"mod_lti"},{key:"delete_confirmation",component:"mod_lti"},{key:"delete",component:"mod_lti"},{key:"cancel",component:"core"}]).done(function(a){c.confirm(a[0],a[1],a[2],a[3],function(){e["delete"](f).done(function(){p(b),q(b).done(function(){b.remove(),d.resolve()}).fail(c.exception)}).fail(function(a){r(b),d.reject(a)})},function(){p(b),d.resolve()})}).fail(function(a){p(b),c.exception(a),d.reject(a)}),d)},t=function(b){var c={proxyid:m(b)};a(document).trigger(f.START_EXTERNAL_REGISTRATION,c)},u=function(a){var b=k(a);b.click(function(b){b.preventDefault(),s(a)}),b.keypress(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||a.keyCode!=g.ENTER&&a.keyCode!=g.SPACE||(a.preventDefault(),b.click())});var c=l(a);c.click(function(b){b.preventDefault(),t(a)}),c.keypress(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||a.keyCode!=g.ENTER&&a.keyCode!=g.SPACE||(a.preventDefault(),c.click())})};return{init:function(a){u(a)}}});
  88. define('mod_lti/cartridge_registration_form', ["jquery","core/ajax","core/notification","mod_lti/tool_type","mod_lti/events","mod_lti/keys","core/str"],function(a,b,c,d,e,f,g){var h={CARTRIDGE_URL:"#cartridge-url",CONSUMER_KEY:"#registration-key",SHARED_SECRET:"#registration-secret",REGISTRATION_FORM:"#cartridge-registration-form",REGISTRATION_SUBMIT_BUTTON:"#cartridge-registration-submit",REGISTRATION_CANCEL_BUTTON:"#cartridge-registration-cancel"},i=function(){return a(h.REGISTRATION_FORM).attr("data-cartridge-url")},j=function(){return a(h.REGISTRATION_SUBMIT_BUTTON)},k=function(){return a(h.REGISTRATION_CANCEL_BUTTON)},l=function(){return a(h.CONSUMER_KEY).val()},m=function(){return a(h.SHARED_SECRET).val()},n=function(){j().addClass("loading")},o=function(){j().removeClass("loading")},p=function(){return j().hasClass("loading")},q=function(){if(p())return!1;var b=i();if(""===b)return!1;n();var f=l(),h=m(),j=d.create({cartridgeurl:b,key:f,secret:h});return j.done(function(){g.get_string("successfullycreatedtooltype","mod_lti").done(function(b){a(document).trigger(e.NEW_TOOL_TYPE),a(document).trigger(e.STOP_CARTRIDGE_REGISTRATION),a(document).trigger(e.REGISTRATION_FEEDBACK,{message:b})}).fail(c.exception)}).fail(function(){g.get_string("failedtocreatetooltype","mod_lti").done(function(b){a(document).trigger(e.NEW_TOOL_TYPE),a(document).trigger(e.STOP_CARTRIDGE_REGISTRATION),a(document).trigger(e.REGISTRATION_FEEDBACK,{message:b,error:!0})}).fail(c.exception)}).always(function(){o()}),j},r=function(){var b=a(h.REGISTRATION_FORM);b.submit(function(a){a.preventDefault(),q()});var c=k();c.click(function(b){b.preventDefault(),a(document).trigger(e.STOP_CARTRIDGE_REGISTRATION)}),c.keypress(function(a){a.metaKey||a.shiftKey||a.altKey||a.ctrlKey||a.keyCode!=f.ENTER&&a.keyCode!=f.SPACE||(a.preventDefault(),c.click())})};return{init:function(){r()}}});
  89. define('mod_quiz/preflightcheck', ["jquery","core/yui"],function(a,b){var c={confirmDialogue:null,init:function(a,d,e,f){var g=a;b.use("moodle-core-notification",function(){b.one(e)&&(c.confirmDialogue=new M.core.dialogue({headerContent:d,bodyContent:b.one(e),draggable:!0,visible:!1,center:!0,modal:!0,width:null,extraClasses:["mod_quiz_preflight_popup"]}),b.one(a).on("click",c.displayDialogue),b.one("#id_cancel").on("click",c.hideDialogue),g=c.confirmDialogue.get("boundingBox").one('[name="submitbutton"]')),f&&b.one(g).on("click",c.launchQuizPopup,c,f)})},displayDialogue:function(a){a&&a.halt(),c.confirmDialogue.show()},hideDialogue:function(a){a&&a.halt(),c.confirmDialogue.hide(a)},launchQuizPopup:function(a,c){a.halt(),b.use("moodle-core-formchangechecker","io-form",function(){M.core_formchangechecker.reset_form_dirty_state();var d=a.target.ancestor("form");window.openpopup(a,{url:d.get("action")+"?"+b.IO.stringify(d).replace(/\bcancel=/,"x="),windowname:"quizpopup",options:c,fullscreen:!0})})}};return c});
  90. define('mod_workshop/workshopview', ["jquery"],function(a){function b(b){var c=0;b.height("auto"),b.each(function(){var b=a(this).height();b>c&&(c=b)}),b.height(c)}return{init:function(){var c=a(".path-mod-workshop .userplan dt"),d=a(".path-mod-workshop .userplan dd");b(c),b(d),a(window).on("resize",function(){b(c),b(d)})}}});
  91. define('message_popup/notification_popover_controller', ["jquery","core/ajax","core/templates","core/str","core/url","core/notification","core/custom_interaction_events","core/popover_region_controller","message_popup/notification_repository","message_popup/notification_area_events"],function(a,b,c,d,e,f,g,h,i,j){var k={MARK_ALL_READ_BUTTON:'[data-action="mark-all-read"]',ALL_NOTIFICATIONS_CONTAINER:'[data-region="all-notifications"]',NOTIFICATION:'[data-region="notification-content-item-container"]',UNREAD_NOTIFICATION:'[data-region="notification-content-item-container"].unread',NOTIFICATION_LINK:'[data-action="content-item-link"]',EMPTY_MESSAGE:'[data-region="empty-message"]',COUNT_CONTAINER:'[data-region="count-container"]'},l=function(a){h.call(this,a),this.markAllReadButton=this.root.find(k.MARK_ALL_READ_BUTTON),this.unreadCount=0,this.userId=this.root.attr("data-userid"),this.container=this.root.find(k.ALL_NOTIFICATIONS_CONTAINER),this.limit=20,this.offset=0,this.loadedAll=!1,this.initialLoad=!1,this.loadUnreadNotificationCount()};return l.prototype=Object.create(h.prototype),l.prototype.constructor=l,l.prototype.updateButtonAriaLabel=function(){this.isMenuOpen()?d.get_string("hidenotificationwindow","message").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this)):this.unreadCount?d.get_string("shownotificationwindowwithcount","message",this.unreadCount).done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this)):d.get_string("shownotificationwindownonew","message").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this))},l.prototype.getContent=function(){return this.container},l.prototype.getOffset=function(){return this.offset},l.prototype.incrementOffset=function(){this.offset+=this.limit},l.prototype.hasDoneInitialLoad=function(){return this.initialLoad},l.prototype.hasLoadedAllContent=function(){return this.loadedAll},l.prototype.setLoadedAllContent=function(a){this.loadedAll=a},l.prototype.renderUnreadCount=function(){var a=this.root.find(k.COUNT_CONTAINER);this.unreadCount?(a.text(this.unreadCount),a.removeClass("hidden")):a.addClass("hidden")},l.prototype.hideUnreadCount=function(){this.root.find(k.COUNT_CONTAINER).addClass("hidden")},l.prototype.loadUnreadNotificationCount=function(){i.countUnread({useridto:this.userId}).then(function(a){this.unreadCount=a,this.renderUnreadCount(),this.updateButtonAriaLabel()}.bind(this))},l.prototype.getNotificationElement=function(a){var b=this.root.find(k.NOTIFICATION+'[data-id="'+a+'"]');return 1==b.length?b:null},l.prototype.renderNotifications=function(b,d){var g=[],h=[],i=[];return b.length&&a.each(b,function(a,b){var d=this.getOffset()-this.limit;b.viewmoreurl=e.relativeUrl("/message/output/popup/notifications.php",{notificationid:b.id,offset:d});var j=c.render("message_popup/notification_content_item",b);g.push(j),j.then(function(b,c){h[a]=b,i[a]=c}).fail(f.exception)}.bind(this)),a.when.apply(a.when,g).then(function(){b.length&&a.each(b,function(a){d.append(h[a]),c.runTemplateJS(i[a])})})},l.prototype.loadMoreNotifications=function(){if(this.isLoading||this.hasLoadedAllContent())return a.Deferred().resolve();this.startLoading();var b={limit:this.limit,offset:this.getOffset(),useridto:this.userId},c=this.getContent();return i.query(b).then(function(a){var b=a.notifications;return this.unreadCount=a.unreadcount,this.setLoadedAllContent(!b.length||b.length<this.limit),this.initialLoad=!0,this.updateButtonAriaLabel(),!!b.length&&(this.incrementOffset(),this.renderNotifications(b,c))}.bind(this)).always(function(){this.stopLoading()}.bind(this))},l.prototype.markAllAsRead=function(){return this.markAllReadButton.addClass("loading"),i.markAllAsRead({useridto:this.userId}).then(function(){this.unreadCount=0,this.root.find(k.UNREAD_NOTIFICATION).removeClass("unread")}.bind(this)).always(function(){this.markAllReadButton.removeClass("loading")}.bind(this))},l.prototype.markNotificationAsRead=function(a){return!!a.hasClass("unread")&&i.markAsRead(a.attr("data-id")).then(function(){this.unreadCount--,a.removeClass("unread")}.bind(this))},l.prototype.registerEventListeners=function(){g.define(this.root,[g.events.activate]),this.root.on(g.events.activate,k.MARK_ALL_READ_BUTTON,function(a){this.markAllAsRead(),a.stopPropagation()}.bind(this)),this.root.on(g.events.activate,k.NOTIFICATION_LINK,function(b){var c=a(b.target).closest(k.NOTIFICATION);this.markNotificationAsRead(c),b.stopPropagation()}.bind(this)),this.root.on(this.events().menuOpened,function(){this.hideUnreadCount(),this.updateButtonAriaLabel(),this.hasDoneInitialLoad()||this.loadMoreNotifications()}.bind(this)),this.root.on(this.events().menuClosed,function(){this.renderUnreadCount(),this.updateButtonAriaLabel()}.bind(this)),this.root.on(this.events().startLoading,function(){this.getContent().attr("aria-busy","true")}.bind(this)),this.root.on(this.events().stopLoading,function(){this.getContent().attr("aria-busy","false")}.bind(this)),this.getContentContainer().on(g.events.scrollBottom,function(){this.isLoading||this.hasLoadedAllContent()||this.loadMoreNotifications()}.bind(this)),g.define(this.getContentContainer(),[g.events.scrollLock]),a(document).on(j.notificationShown,function(a,b){if(!b.read){var c=this.getNotificationElement(b.id);c&&c.removeClass("unread"),this.unreadCount--,this.renderUnreadCount()}}.bind(this))},l});
  92. define('message_popup/notification_area_control_area', ["jquery","core/templates","core/notification","core/custom_interaction_events","message_popup/notification_repository","message_popup/notification_area_events"],function(a,b,c,d,e,f){var g={CONTAINER:'[data-region="notification-area"]',CONTENT:'[data-region="content"]',NOTIFICATION:'[data-region="notification-content-item-container"]',CAN_RECEIVE_FOCUS:'input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]'},h={NOTIFICATION:"message_popup/notification_content_item"},i=function(b,c){this.root=a(b),this.container=this.root.closest(g.CONTAINER),this.userId=c,this.content=this.root.find(g.CONTENT),this.offset=0,this.limit=20,this.initialLoad=!1,this.isLoading=!1,this.loadedAll=!1,this.notifications={},this.registerEventListeners()};return i.prototype.getRoot=function(){return this.root},i.prototype.getContainer=function(){return this.container},i.prototype.getUserId=function(){return this.userId},i.prototype.getContent=function(){return this.content},i.prototype.getOffset=function(){return this.offset},i.prototype.getLimit=function(){return this.limit},i.prototype.setOffset=function(a){this.offset=a},i.prototype.setLimit=function(a){this.limit=a},i.prototype.incrementOffset=function(){this.offset+=this.limit},i.prototype.startLoading=function(){this.isLoading=!0,this.getRoot().addClass("loading")},i.prototype.stopLoading=function(){this.isLoading=!1,this.getRoot().removeClass("loading")},i.prototype.hasDoneInitialLoad=function(){return this.initialLoad},i.prototype.hasLoadedAllContent=function(){return this.loadedAll},i.prototype.setLoadedAllContent=function(a){this.loadedAll=a},i.prototype.setCacheNotification=function(a){this.notifications[a.id]=a},i.prototype.getCacheNotification=function(a){return this.notifications[a]},i.prototype.getNotificationElement=function(a){var b=this.getRoot().find(g.NOTIFICATION+'[data-id="'+a+'"]');return 1==b.length?b:null},i.prototype.scrollNotificationIntoView=function(a){var b=a.position(),c=this.getRoot(),d=b.top-c.scrollTop();if(d>c.innerHeight()){var e=a.outerHeight();e=4*e;var f=b.top-e;c.scrollTop(f)}},i.prototype.showNotification=function(b){if("object"!=typeof b&&(b=this.getNotificationElement(b)),b&&b.length){this.getRoot().find(g.NOTIFICATION).removeClass("selected"),b.addClass("selected").find(g.CAN_RECEIVE_FOCUS).focus();var c=b.attr("data-id"),d=this.getCacheNotification(c);this.scrollNotificationIntoView(b),this.getContainer().trigger(f.showNotification,[a.extend({},d)])}},i.prototype.markNotificationAsRead=function(a){return e.markAsRead(a.attr("data-id")).done(function(){a.removeClass("unread")})},i.prototype.renderNotifications=function(d){var e=[],f=[],g=[],i=this.getContent();return d.length&&a.each(d,function(a,d){var i=d.contexturl;delete d.contexturl;var j=b.render(h.NOTIFICATION,d);e.push(j),j.then(function(b,c){f[a]=b,g[a]=c,d.contexturl=i,this.setCacheNotification(d)}.bind(this)).fail(c.exception)}.bind(this)),a.when.apply(a.when,e).then(function(){d.length&&a.each(d,function(a){i.append(f[a]),b.runTemplateJS(g[a])})})},i.prototype.loadMoreNotifications=function(){if(this.isLoading||this.hasLoadedAllContent())return a.Deferred().resolve();this.startLoading();var b={limit:this.getLimit(),offset:this.getOffset(),useridto:this.getUserId()};this.initialLoad||(b.limit=this.getOffset()+this.getLimit(),b.offset=0);var c=e.query(b).then(function(a){var b=a.notifications;return this.unreadCount=a.unreadcount,this.setLoadedAllContent(!b.length||b.length<this.getLimit()),this.initialLoad=!0,!!b.length&&(this.incrementOffset(),this.renderNotifications(b))}.bind(this)).always(function(){this.stopLoading()}.bind(this));return c},i.prototype.registerEventListeners=function(){d.define(this.getRoot(),[d.events.activate,d.events.scrollBottom,d.events.scrollLock,d.events.up,d.events.down]),this.getRoot().on(d.events.scrollBottom,function(){this.loadMoreNotifications()}.bind(this)),this.getRoot().on(d.events.activate,g.NOTIFICATION,function(b){var c=a(b.target).closest(g.NOTIFICATION);this.showNotification(c)}.bind(this)),this.getRoot().on(d.events.up,g.NOTIFICATION,function(b,c){var d=a(b.target).closest(g.NOTIFICATION);this.showNotification(d.prev()),c.originalEvent.preventDefault()}.bind(this)),this.getRoot().on(d.events.down,g.NOTIFICATION,function(b,c){var d=a(b.target).closest(g.NOTIFICATION);this.showNotification(d.next()),c.originalEvent.preventDefault()}.bind(this)),this.getContainer().on(f.notificationShown,function(a,b){if(!b.read){var c=this.getNotificationElement(b.id);c&&this.markNotificationAsRead(c);var d=this.getCacheNotification(b.id);d&&(d.read=!0)}}.bind(this))},i});
  93. define('message_popup/notification_area_events', [],function(){return{showNotification:"notification-area-events:showNotification",notificationShown:"notification-area-events:notificationShown"}});
  94. define('message_popup/notification_area_content_area', ["jquery","core/templates","core/notification","core/custom_interaction_events","message_popup/notification_repository","message_popup/notification_area_events"],function(a,b,c,d,e,f){var g={CONTAINER:'[data-region="notification-area"]',CONTENT:'[data-region="content"]',HEADER:'[data-region="header"]',FOOTER:'[data-region="footer"]',TOGGLE_MODE:'[data-action="toggle-mode"]'},h={HEADER:"message_popup/notification_area_content_area_header",CONTENT:"message_popup/notification_area_content_area_content",FOOTER:"message_popup/notification_area_content_area_footer"},i=function(b,c){this.root=a(b),this.container=this.root.closest(g.CONTAINER),this.userId=c,this.header=this.root.find(g.HEADER),this.content=this.root.find(g.CONTENT),this.footer=this.root.find(g.FOOTER),this.registerEventListeners()};return i.prototype.getRoot=function(){return this.root},i.prototype.getContainer=function(){return this.container},i.prototype.getUserId=function(){return this.userId},i.prototype.getHeader=function(){return this.header},i.prototype.getContent=function(){return this.content},i.prototype.getFooter=function(){return this.footer},i.prototype.show=function(){this.getContainer().addClass("show-content-area")},i.prototype.hide=function(){this.getContainer().removeClass("show-content-area")},i.prototype.setHeaderHTML=function(a){this.getHeader().empty().html(a)},i.prototype.setContentHTML=function(a){this.getContent().empty().html(a)},i.prototype.setFooterHTML=function(a){this.getFooter().empty().html(a)},i.prototype.showNotification=function(c){var d=b.render(h.HEADER,c).done(function(a){this.setHeaderHTML(a)}.bind(this)),e=b.render(h.CONTENT,c).done(function(a){this.setContentHTML(a)}.bind(this)),g=b.render(h.FOOTER,c).done(function(a){this.setFooterHTML(a)}.bind(this));return a.when(d,e,g).done(function(){this.show(),this.getContainer().trigger(f.notificationShown,[c])}.bind(this))},i.prototype.registerEventListeners=function(){d.define(this.getRoot(),[d.events.activate]),this.getRoot().on(d.events.activate,g.VIEW_TOGGLE,function(){this.hide()}.bind(this)),this.getContainer().on(f.showNotification,function(a,b){this.showNotification(b)}.bind(this))},i});
  95. define('message_popup/message_popover_controller', ["jquery","core/ajax","core/templates","core/str","core/notification","core/custom_interaction_events","core/popover_region_controller","core_message/message_repository","core/url"],function(a,b,c,d,e,f,g,h,i){var j={MARK_ALL_READ_BUTTON:'[data-action="mark-all-read"]',CONTENT:'[data-region="messages"]',CONTENT_ITEM_CONTAINER:'[data-region="message-content-item-container"]',EMPTY_MESSAGE:'[data-region="empty-message"]',COUNT_CONTAINER:'[data-region="count-container"]'},k=function(a){g.call(this,a),this.markAllReadButton=this.root.find(j.MARK_ALL_READ_BUTTON),this.content=this.root.find(j.CONTENT),this.userId=this.root.attr("data-userid"),this.limit=20,this.offset=0,this.loadedAll=!1,this.initialLoad=!1,this.loadUnreadMessageCount()};return k.prototype=Object.create(g.prototype),k.prototype.constructor=k,k.prototype.getContent=function(){return this.content},k.prototype.incrementOffset=function(){this.offset+=this.limit},k.prototype.updateButtonAriaLabel=function(){this.isMenuOpen()?d.get_string("hidemessagewindow","message").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this)):this.unreadCount?d.get_string("showmessagewindowwithcount","message",this.unreadCount).done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this)):d.get_string("showmessagewindownonew","message").done(function(a){this.menuToggle.attr("aria-label",a)}.bind(this))},k.prototype.renderUnreadCount=function(){var a=this.root.find(j.COUNT_CONTAINER);this.unreadCount?(a.text(this.unreadCount),a.removeClass("hidden")):a.addClass("hidden")},k.prototype.hideUnreadCount=function(){this.root.find(j.COUNT_CONTAINER).addClass("hidden")},k.prototype.loadUnreadMessageCount=function(){h.countUnreadConversations({useridto:this.userId}).then(function(a){this.unreadCount=a,this.renderUnreadCount(),this.updateButtonAriaLabel()}.bind(this))},k.prototype.renderMessages=function(b,d){var e=[],f=[],g=[];return b.length&&a.each(b,function(a,b){b.contexturl=i.relativeUrl("/message/index.php",{user:this.userId,id:b.userid}),b.profileurl=i.relativeUrl("/user/profile.php",{id:b.userid});var d=c.render("message_popup/message_content_item",b);e.push(d),d.then(function(b,c){f[a]=b,g[a]=c})}.bind(this)),a.when.apply(a.when,e).then(function(){b.length&&a.each(b,function(a){d.append(f[a]),c.runTemplateJS(g[a])})})},k.prototype.loadMoreMessages=function(){if(this.isLoading||this.loadedAll)return a.Deferred().resolve();this.startLoading();var b={userid:this.userId,limit:this.limit,offset:this.offset},c=this.getContent();return h.query(b).then(function(a){var b=a.contacts;return this.loadedAll=!b.length||b.length<this.limit,this.initialLoad=!0,this.updateButtonAriaLabel(),!!b.length&&(this.incrementOffset(),this.renderMessages(b,c))}.bind(this)).always(function(){this.stopLoading()}.bind(this))},k.prototype.markAllAsRead=function(){return this.markAllReadButton.hasClass("loading")?a.Deferred().resolve():(this.markAllReadButton.addClass("loading"),h.markAllAsRead({useridto:this.userId}).then(function(){this.unreadCount=0,this.hideUnreadCount(),this.getContent().find(j.CONTENT_ITEM_CONTAINER).removeClass("unread")}.bind(this)).always(function(){this.markAllReadButton.removeClass("loading")}.bind(this)))},k.prototype.registerEventListeners=function(){f.define(this.root,[f.events.keyboardActivate]),this.root.on(this.events().menuOpened,function(){this.hideUnreadCount(),this.updateButtonAriaLabel(),this.initialLoad||this.loadMoreMessages()}.bind(this)),this.root.on(this.events().menuClosed,function(){this.renderUnreadCount(),this.updateButtonAriaLabel()}.bind(this)),this.root.on(f.events.scrollBottom,function(){this.loadMoreMessages()}.bind(this)),this.root.on(f.events.activate,j.MARK_ALL_READ_BUTTON,function(a,b){this.markAllAsRead(),a.stopPropagation(),b.originalEvent.preventDefault()}.bind(this)),f.define(this.getContentContainer(),[f.events.scrollLock]),a(document).on("messagearea:conversationselected",function(){this.unreadCount--,this.renderUnreadCount()}.bind(this))},k});
  96. define('message_popup/notification_repository', ["core/ajax","core/notification"],function(a,b){var c=function(c){"undefined"==typeof c.limit&&(c.limit=20),"undefined"==typeof c.offset&&(c.offset=0);var d={methodname:"message_popup_get_popup_notifications",args:c},e=a.call([d])[0];return e.fail(b.exception),e},d=function(c){var d={methodname:"message_popup_get_unread_popup_notification_count",args:c},e=a.call([d])[0];return e.fail(b.exception),e},e=function(c){var d={methodname:"core_message_mark_all_notifications_as_read",args:c},e=a.call([d])[0];return e.fail(b.exception),e},f=function(c,d){var e={messageid:c};d&&(e.timeread=d);var f={methodname:"core_message_mark_message_read",args:e},g=a.call([f])[0];return g.fail(b.exception),g};return{query:c,countUnread:d,markAllAsRead:e,markAsRead:f}});
  97. define('block_navigation/navblock', ["jquery","core/tree"],function(a,b){return{init:function(a){var c=new b(".block_navigation .block_tree");c.finishExpandingGroup=function(c){b.prototype.finishExpandingGroup.call(this,c),Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})},c.collapseGroup=function(c){b.prototype.collapseGroup.call(this,c),Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})}}}});
  98. define('block_navigation/ajax_response_renderer', ["jquery"],function(a){function b(d,e){var f=a("<ul></ul>");f.attr("role","group"),f.attr("aria-hidden",!0),a.each(e,function(d,e){if("object"==typeof e){var g=a("<li></li>"),h=a("<p></p>"),i=e.id||e.key+"_tree_item",j=null,k=!(!e.expandable&&!e.haschildren);if(h.addClass("tree_item"),h.attr("id",i),h.attr("role","treeitem"),h.attr("tabindex","-1"),e.requiresajaxloading&&(h.attr("data-requires-ajax",!0),h.attr("data-node-id",e.id),h.attr("data-node-key",e.key),h.attr("data-node-type",e.type)),k&&(g.addClass("collapsed contains_branch"),h.attr("aria-expanded",!1),h.addClass("branch")),!e.icon||k&&e.type!==c.ACTIVITY&&e.type!==c.RESOURCE||(g.addClass("item_with_icon"),h.addClass("hasicon"),j=a("<img/>"),j.attr("alt",e.icon.alt),j.attr("title",e.icon.title),j.attr("src",M.util.image_url(e.icon.pix,e.icon.component)),a.each(e.icon.classes,function(a,b){j.addClass(b)})),e.link){var l=a('<a title="'+e.title+'" href="'+e.link+'"></a>');j?(l.append(j),l.append('<span class="item-content-wrap">'+e.name+"</span>")):l.append(e.name),e.hidden&&l.addClass("dimmed"),h.append(l)}else{var m=a("<span></span>");j?(m.append(j),m.append('<span class="item-content-wrap">'+e.name+"</span>")):m.append(e.name),e.hidden&&m.addClass("dimmed"),h.append(m)}g.append(h),f.append(g),e.children&&e.children.length?b(h,e.children):k&&!e.requiresajaxloading&&(g.removeClass("contains_branch"),h.addClass("emptybranch"))}}),d.parent().append(f);var g=d.attr("id")+"_group";f.attr("id",g),d.attr("aria-owns",g),d.attr("role","treeitem")}var c={ACTIVITY:40,RESOURCE:50};return{render:function(a,c){if(c.children&&c.children.length){b(a,c.children);var d=a.children("[role='treeitem']").first(),e=a.find("#"+d.attr("aria-owns"));d.attr("aria-expanded",!0),e.attr("aria-hidden",!1)}else a.parent().hasClass("contains_branch")&&(a.parent().removeClass("contains_branch"),a.addClass("emptybranch"))}}});
  99. define('block_navigation/site_admin_loader', ["jquery","core/ajax","core/config","block_navigation/ajax_response_renderer"],function(a,b,c,d){var e=71,f=c.wwwroot+"/lib/ajax/getsiteadminbranch.php";return{load:function(b){b=a(b);var g=a.Deferred(),h={type:e,sesskey:c.sesskey},i={type:"POST",dataType:"json",data:h};return a.ajax(f,i).done(function(a){d.render(b,a),g.resolve()}),g}}});
  100. define('block_navigation/nav_loader', ["jquery","core/ajax","core/config","block_navigation/ajax_response_renderer"],function(a,b,c,d){function e(a){return a.closest("[data-block]").attr("data-instanceid")}var f=c.wwwroot+"/lib/ajax/getnavbranch.php";return{load:function(b){b=a(b);var g=a.Deferred(),h={elementid:b.attr("data-node-id"),id:b.attr("data-node-key"),type:b.attr("data-node-type"),sesskey:c.sesskey,instance:e(b)},i={type:"POST",dataType:"json",data:h};return a.ajax(f,i).done(function(a){d.render(b,a),g.resolve()}),g}}});
  101. define('block_settings/settingsblock', ["jquery","core/tree"],function(a,b){return{init:function(a,c){var d=new b(".block_settings .block_tree");if(c){var e=d.treeRoot.find("#"+c),f=e.children("a").first();f.replaceWith('<span tabindex="0">'+f.html()+"</span>")}d.finishExpandingGroup=function(c){b.prototype.finishExpandingGroup.call(this,c),Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})},d.collapseGroup=function(c){b.prototype.collapseGroup.call(this,c),Y.use("moodle-core-event",function(){Y.Global.fire(M.core.globalEvents.BLOCK_CONTENT_UPDATED,{instanceid:a})})}}}});
  102. define('media_videojs/loader', ["jquery","core/event"],function(a,b){var c,d=function(d){c=d,e(null,a("body")),b.getLegacyEvents().done(function(b){a(document).on(b.FILTER_CONTENT_UPDATED,e)})},e=function(b,d){var e=".mediaplugin_videojs";d.find(e).addBack(e).find("audio, video").each(function(){var b=a(this).attr("id"),d=a(this).data("setup"),e=["media_videojs/video-lazy"];d.techOrder&&d.techOrder.indexOf("youtube")!==-1&&e.push("media_videojs/Youtube-lazy"),require(e,function(a){c&&(c(a),c=null),a(b,d)})})};return{setUp:d}});
  103. define('report_competency/user_course_navigation', ["jquery"],function(a){var b=function(b,c,d,e){this._baseUrl=c,this._userId=d+"",this._courseId=e,a(b).on("change",this._userChanged.bind(this))};return b.prototype._userChanged=function(b){var c=a(b.target).val(),d="?user="+c+"&id="+this._courseId;document.location=this._baseUrl+d},b.prototype._userId=null,b.prototype._courseId=null,b.prototype._baseUrl=null,b});
  104. define('report_competency/grading_popup', ["jquery","core/notification","core/str","core/ajax","core/log","core/templates","tool_lp/dialogue"],function(a,b,c,d,e,f,g){var h=function(b,c){this._regionSelector=b,this._userCompetencySelector=c,a(this._regionSelector).on("click",this._userCompetencySelector,this._handleClick.bind(this))};return h.prototype._handleClick=function(c){var f=a(c.target).closest(this._userCompetencySelector),g=a(f).data("competencyid"),h=a(f).data("courseid"),i=a(f).data("userid");e.debug("Clicked on cell: competencyId="+g+", courseId="+h+", userId="+i);var j=d.call([{methodname:"tool_lp_data_for_user_competency_summary_in_course",args:{userid:i,competencyid:g,courseid:h},done:this._contextLoaded.bind(this),fail:b.exception}]);j[0].then(function(){d.call([{methodname:"core_competency_user_competency_viewed_in_course",args:{userid:i,competencyid:g,courseid:h},fail:b.exception}])})},h.prototype._contextLoaded=function(a){var d=this;a.displayuser=!0,f.render("tool_lp/user_competency_summary_in_course",a).done(function(a,e){c.get_string("usercompetencysummary","report_competency").done(function(b){new g(b,a,f.runTemplateJS.bind(f,e),d._refresh.bind(d),(!0))}).fail(b.exception)}).fail(b.exception)},h.prototype._refresh=function(){var c=a(this._regionSelector),e=c.data("courseid"),f=c.data("userid");d.call([{methodname:"report_competency_data_for_report",args:{courseid:e,userid:f},done:this._pageContextLoaded.bind(this),fail:b.exception}])},h.prototype._pageContextLoaded=function(a){var c=this;f.render("report_competency/report",a).done(function(a,b){f.replaceNode(c._regionSelector,a,b)}).fail(b.exception)},h.prototype._regionSelector=null,h.prototype._userCompetencySelector=null,h});
  105. define('gradingform_guide/comment_chooser', ["jquery","core/templates","core/notification","core/yui"],function(a,b,c){return{initialise:function(d,e,f,g){function h(b,c){var e="<label>"+M.util.get_string("insertcomment","gradingform_guide")+"</label>",g="comment-chooser-"+d+"-cancel",h='<button id="'+g+'">'+M.util.get_string("cancel","moodle")+"</button>",i=new M.core.dialogue({modal:!0,headerContent:e,bodyContent:b,footerContent:h,focusAfterHide:"#"+f,id:"comments-chooser-dialog-"+d});a("#"+g).click(function(){i.hide()}),a.each(c,function(b,c){var e="#comment-option-"+d+"-"+c.id;a(e).click(function(){var b=a("#"+f),d=b.val();""!==a.trim(d)&&(d+="\n"),d+=c.description,b.val(d),i.hide()}),a(document).off("keypress",e).on("keypress",e,function(){var b=event.which||event.keyCode;13!=b&&32!=b||a(e).click()})}),i.after("visibleChange",function(a){a.prevVal&&!a.newVal&&this.destroy()},i),i.show()}function i(){var a={criterionId:d,comments:g};b.render("gradingform_guide/comment_chooser",a).done(function(a){h(a,g)}).fail(c.exception)}a("#"+e).click(function(a){a.preventDefault(),i()})}}});
  106. define('tool_lp/form-user-selector', ["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.id,label:b._label})}),d},transport:function(d,e,f,g){var h,i=a(d).data("capability");"undefined"==typeof i&&(i=""),h=b.call([{methodname:"tool_lp_search_users",args:{query:e,capability:i}}]),h[0].then(function(b){var d=[],e=0;return a.each(b.users,function(b,e){var f=e,g=[];a.each(["idnumber","email","phone1","phone2","department","institution"],function(a,b){"undefined"!=typeof e[b]&&""!==e[b]&&(f.hasidentity=!0,g.push(e[b]))}),f.identity=g.join(", "),d.push(c.render("tool_lp/form-user-selector-suggestion",f))}),a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b.users,function(a,b){b._label=c[e],e++}),f(b.users)})},g)}}});
  107. define('tool_lp/scaleconfig', ["jquery","core/notification","core/templates","core/ajax","tool_lp/dialogue","tool_lp/scalevalues"],function(a,b,c,d,e,f){var g=function(b,c,d){this.selectSelector=b,this.inputSelector=c,this.triggerSelector=d,this.originalscaleid=a(b).val(),a(b).on("change",this.scaleChangeHandler.bind(this)).change(),a(d).click(this.showConfig.bind(this))};return g.prototype.selectSelector=null,g.prototype.inputSelector=null,g.prototype.triggerSelector=null,g.prototype.scalevalues=null,g.prototype.originalscaleid=0,g.prototype.scaleid=0,g.prototype.popup=null,g.prototype.showConfig=function(){var d=this;if(this.scaleid=a(this.selectSelector).val(),!(this.scaleid<=0)){var f=a(this.selectSelector).find("option:selected").text();this.getScaleValues(this.scaleid).done(function(){var a={scalename:f,scales:d.scalevalues};c.render("tool_lp/scale_configuration_page",a).done(function(a){new e(f,a,d.initScaleConfig.bind(d))}).fail(b.exception)}).fail(b.exception)}},g.prototype.retrieveOriginalScaleConfig=function(){var b=a(this.inputSelector).val();if(""!==b){var c=a.parseJSON(b),d=c.shift();if(d.scaleid===this.originalscaleid)return c}return""},g.prototype.initScaleConfig=function(b){this.popup=b;var c=a(b.getContent());if(this.originalscaleid===this.scaleid){var d=this.retrieveOriginalScaleConfig();""!==d&&d.forEach(function(a){1===a.scaledefault&&c.find('[data-field="tool_lp_scale_default_'+a.id+'"]').attr("checked",!0),1===a.proficient&&c.find('[data-field="tool_lp_scale_proficient_'+a.id+'"]').attr("checked",!0)})}c.on("click",'[data-action="close"]',function(){this.setScaleConfig(),b.close()}.bind(this)),c.on("click",'[data-action="cancel"]',function(){b.close()})},g.prototype.setScaleConfig=function(){var b=a(this.popup.getContent()),c=[{scaleid:this.scaleid}];this.scalevalues.forEach(function(a){var d=0,e=0;b.find('[data-field="tool_lp_scale_default_'+a.id+'"]').is(":checked")&&(d=1),b.find('[data-field="tool_lp_scale_proficient_'+a.id+'"]').is(":checked")&&(e=1),(d||e)&&c.push({id:a.id,scaledefault:d,proficient:e})});var d=JSON.stringify(c);a(this.inputSelector).val(d),this.originalscaleid=this.scaleid},g.prototype.getScaleValues=function(a){return f.get_values(a).then(function(a){return this.scalevalues=a,a}.bind(this))},g.prototype.scaleChangeHandler=function(b){a(b.target).val()<=0?a(this.triggerSelector).prop("disabled",!0):a(this.triggerSelector).prop("disabled",!1)},{init:function(a,b,c){return new g(a,b,c)}}});
  108. define('tool_lp/course_competency_settings', ["jquery","core/notification","tool_lp/dialogue","core/str","core/ajax","core/templates"],function(a,b,c,d,e,f){var g=function(b){a(b).on("click",this.configureSettings.bind(this))};return g.prototype._dialogue=null,g.prototype.configureSettings=function(e){var g=a(e.target).closest("a").data("courseid"),h=a(e.target).closest("a").data("pushratingstouserplans"),i={courseid:g,settings:{pushratingstouserplans:h}};e.preventDefault(),f.render("tool_lp/course_competency_settings",i).done(function(a){d.get_string("configurecoursecompetencysettings","tool_lp").done(function(b){this._dialogue=new c(b,a,this.addListeners.bind(this))}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},g.prototype.addListeners=function(){var a=this._find('[data-action="save"]');a.on("click",this.saveSettings.bind(this));var b=this._find('[data-action="cancel"]');b.on("click",this.cancelChanges.bind(this))},g.prototype.cancelChanges=function(a){a.preventDefault(),this._dialogue.close()},g.prototype._find=function(b){return a('[data-region="coursecompetencysettings"]').find(b)},g.prototype.saveSettings=function(a){a.preventDefault();var c=this._find('input[name="pushratingstouserplans"]:checked').val(),d=this._find('input[name="courseid"]').val(),f={pushratingstouserplans:c};e.call([{methodname:"core_competency_update_course_competency_settings",args:{courseid:d,settings:f}}])[0].done(function(){this.refreshCourseCompetenciesPage()}.bind(this)).fail(b.exception)},g.prototype.refreshCourseCompetenciesPage=function(){var c=this._find('input[name="courseid"]').val();e.call([{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:c}}])[0].done(function(c){f.render("tool_lp/course_competencies_page",c).done(function(b,c){a('[data-region="coursecompetenciespage"]').replaceWith(b),f.runTemplateJS(c),this._dialogue.close()}.bind(this)).fail(b.exception)}.bind(this)).fail(b.exception)},g});
  109. define('tool_lp/competencytree', ["core/ajax","core/notification","core/templates","tool_lp/tree","tool_lp/competency_outcomes","jquery"],function(a,b,c,d,e,f){var g={},h=0,i="",j="",k="",l=!1,m=function(a,b){var c=0,d=!1;for(a.haschildren=!1,a.children=[],c=0;c<b.length;c++)d=b[c],d.parentid==a.id&&(a.haschildren=!0,a.children.push(d),m(d,b))},n=function(b){var e=f.Deferred();return c.render("tool_lp/loading",{}).done(function(n,o){c.replaceNodeContents(f(j),n,o);var p=a.call([{methodname:"core_competency_search_competencies",args:{searchtext:b,competencyframeworkid:h}}]);p[0].done(function(a){g={};var b=0;for(b=0;b<a.length;b++)g[a[b].id]=a[b];var h=[],n=!1;for(b=0;b<a.length;b++)n=a[b],0===parseInt(n.parentid,10)&&(h.push(n),m(n,a));var o={shortname:i,canmanage:l,competencies:h};c.render("tool_lp/competencies_tree_root",o).done(function(a,b){c.replaceNodeContents(f(j),f(a).html(),b);var h=new d(j,(!1));if(k){var i=f(j).find("[data-id="+k+"]");i.length&&(h.selectItem(i),h.updateFocus(i))}e.resolve(g)}).fail(e.reject)}).fail(e.reject)}),e.promise()},o=function(a,b){var c=b.selected;k=c.attr("data-id")};return{init:function(a,c,d,e,f){h=a,i=c,l=f,j=e,n(d).fail(b.exception),this.on("selectionchanged",o)},on:function(a,b){f(j).on(a,b)},getChildren:function(a){var b=[];return f.each(g,function(c,d){d.parentid==a&&b.push(d)}),b},getCompetencyFrameworkId:function(){return h},getCompetency:function(a){return g[a]},getCompetencyLevel:function(a){var b=this.getCompetency(a),c=b.path.replace(/^\/|\/$/g,"").split("/").length;return c},hasChildren:function(a){return this.getChildren(a).length>0},hasRule:function(a){var b=this.getCompetency(a);return!!b&&(b.ruleoutcome!=e.OUTCOME_NONE&&b.ruletype)},reloadCompetencies:function(){return n("").fail(b.exception)},listCompetencies:function(){return g}}});
  110. define('tool_lp/competency_plan_navigation', ["jquery"],function(a){var b=function(b,c,d,e,f){this._baseUrl=c,this._userId=d+"",this._competencyId=e+"",this._planId=f,this._ignoreFirstCompetency=!0,a(b).on("change",this._competencyChanged.bind(this))};return b.prototype._competencyChanged=function(b){if(this._ignoreFirstCompetency)return void(this._ignoreFirstCompetency=!1);var c=a(b.target).val(),d="?userid="+this._userId+"&planid="+this._planId+"&competencyid="+c;document.location=this._baseUrl+d},b.prototype._competencyId=null,b.prototype._userId=null,b.prototype._planId=null,b.prototype._baseUrl=null,b.prototype._ignoreFirstCompetency=null,b});
  111. define('tool_lp/grade_dialogue', ["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/event_base","core/str"],function(a,b,c,d,e,f){var g=function(a){e.prototype.constructor.apply(this,[]),this._ratingOptions=a};return g.prototype=Object.create(e.prototype),g.prototype._popup=null,g.prototype._ratingOptions=null,g.prototype._afterRender=function(){var b=this._find('[data-action="rate"]'),c=this._find('[name="rating"]'),d=this._find('[name="comment"]');this._find('[data-action="cancel"]').click(function(a){a.preventDefault(),this._trigger("cancelled"),this.close()}.bind(this)),c.change(function(){var c=a(this);c.val()?b.prop("disabled",!1):b.prop("disabled",!0)}).change(),b.click(function(a){a.preventDefault();var b=c.val();b&&(this._trigger("rated",{rating:b,note:d.val()}),this.close())}.bind(this))},g.prototype.close=function(){this._popup.close(),this._popup=null},g.prototype.display=function(){return this._render().then(function(a){return f.get_string("rate","tool_lp").then(function(b){this._popup=new d(b,a,this._afterRender.bind(this))}.bind(this))}.bind(this)).fail(b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._render=function(){var a={cangrade:this._canGrade,ratings:this._ratingOptions};return c.render("tool_lp/competency_grader",a)},g});
  112. define('tool_lp/competencies', ["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/competencypicker","tool_lp/dragdrop-reorder"],function(a,b,c,d,e,f,g){var h=function(b,c,d){this.itemid=b,this.itemtype=c,this.pageContextId=d,this.pickerInstance=null,a('[data-region="actions"] button').prop("disabled",!1),this.registerEvents(),this.registerDragDrop()};return h.prototype.registerDragDrop=function(){var a=this;e.get_string("movecompetency","tool_lp").done(function(b){g.dragdrop("movecompetency",b,{identifier:"movecompetency",component:"tool_lp"},{identifier:"movecompetencyafter",component:"tool_lp"},"drag-samenode","drag-parentnode","drag-handlecontainer",function(b,c){a.handleDrop(b,c)})}).fail(b.exception)},h.prototype.handleDrop=function(d,e){var f=a(d).data("id"),g=a(e).data("id"),h=this,i=[];if("course"==h.itemtype)i=c.call([{methodname:"core_competency_reorder_course_competency",args:{courseid:h.itemid,competencyidfrom:f,competencyidto:g}}]);else if("template"==h.itemtype)i=c.call([{methodname:"core_competency_reorder_template_competency",args:{templateid:h.itemid,competencyidfrom:f,competencyidto:g}}]);else{if("plan"!=h.itemtype)return;i=c.call([{methodname:"core_competency_reorder_plan_competency",args:{planid:h.itemid,competencyidfrom:f,competencyidto:g}}])}i[0].fail(b.exception)},h.prototype.pickCompetency=function(){var e,g,h,i,j=this;j.pickerInstance||("template"!==j.itemtype&&"course"!==j.itemtype||(i="parents"),j.pickerInstance=new f(j.pageContextId,(!1),i),j.pickerInstance.on("save",function(f,i){var k=i.competencyIds;"course"===j.itemtype?(e=[],a.each(k,function(a,b){e.push({methodname:"core_competency_add_competency_to_course",args:{courseid:j.itemid,competencyid:b}})}),e.push({methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:j.itemid}}),g="tool_lp/course_competencies_page",h="coursecompetenciespage"):"template"===j.itemtype?(e=[],a.each(k,function(a,b){e.push({methodname:"core_competency_add_competency_to_template",args:{templateid:j.itemid,competencyid:b}})}),e.push({methodname:"tool_lp_data_for_template_competencies_page",args:{templateid:j.itemid,pagecontext:{contextid:j.pageContextId}}}),g="tool_lp/template_competencies_page",h="templatecompetenciespage"):"plan"===j.itemtype&&(e=[],a.each(k,function(a,b){e.push({methodname:"core_competency_add_competency_to_plan",args:{planid:j.itemid,competencyid:b}})}),e.push({methodname:"tool_lp_data_for_plan_page",args:{planid:j.itemid}}),g="tool_lp/plan_page",h="plan-page"),c.call(e)[e.length-1].then(function(b){return d.render(g,b).done(function(b,c){a('[data-region="'+h+'"]').replaceWith(b),d.runTemplateJS(c)})},b.exception)})),j.pickerInstance.display()},h.prototype.doDelete=function(e){var f=this,g=[],h="",i="";"course"==f.itemtype?(g=c.call([{methodname:"core_competency_remove_competency_from_course",args:{courseid:f.itemid,competencyid:e}},{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:f.itemid}}]),h="tool_lp/course_competencies_page",i="coursecompetenciespage"):"template"==f.itemtype?(g=c.call([{methodname:"core_competency_remove_competency_from_template",args:{templateid:f.itemid,competencyid:e}},{methodname:"tool_lp_data_for_template_competencies_page",args:{templateid:f.itemid,pagecontext:{contextid:f.pageContextId}}}]),h="tool_lp/template_competencies_page",i="templatecompetenciespage"):"plan"==f.itemtype&&(g=c.call([{methodname:"core_competency_remove_competency_from_plan",args:{planid:f.itemid,competencyid:e}},{methodname:"tool_lp_data_for_plan_page",args:{planid:f.itemid}}]),h="tool_lp/plan_page",i="plan-page"),g[1].done(function(c){d.render(h,c).done(function(b,c){a('[data-region="'+i+'"]').replaceWith(b),d.runTemplateJS(c)}).fail(b.exception)}).fail(b.exception)},h.prototype.deleteHandler=function(a){var d,f=this,g=[];if("course"==f.itemtype)d="unlinkcompetencycourse";else if("template"==f.itemtype)d="unlinkcompetencytemplate";else{if("plan"!=f.itemtype)return;d="unlinkcompetencyplan"}g=c.call([{methodname:"core_competency_read_competency",args:{id:a}}]),g[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:d,component:"tool_lp",param:c.shortname},{key:"confirm",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(c){b.confirm(c[0],c[1],c[2],c[3],function(){f.doDelete(a)})}).fail(b.exception)}).fail(b.exception)},h.prototype.registerEvents=function(){var e=this;"course"==e.itemtype&&a('[data-region="coursecompetenciespage"]').on("change",'select[data-field="ruleoutcome"]',function(f){var g=[],h="tool_lp/course_competencies_page",i="coursecompetenciespage",j=a(f.target).data("id"),k=a(f.target).val();g=c.call([{methodname:"core_competency_set_course_competency_ruleoutcome",args:{coursecompetencyid:j,ruleoutcome:k}},{methodname:"tool_lp_data_for_course_competencies_page",args:{courseid:e.itemid}}]),g[1].done(function(c){d.render(h,c).done(function(b,c){a('[data-region="'+i+'"]').replaceWith(b),d.runTemplateJS(c)}).fail(b.exception)}).fail(b.exception)}),a('[data-region="actions"] button').click(function(a){a.preventDefault(),e.pickCompetency()}),a('[data-action="delete-competency-link"]').click(function(b){b.preventDefault();var c=a(b.target).closest("[data-id]").data("id");e.deleteHandler(c)})},h});
  113. define('tool_lp/frameworks_datasource', ["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function(d,e){var f,g={context:{contextid:d}};return a.extend(g,"undefined"==typeof e?{}:e),f=b.call([{methodname:"core_competency_list_competency_frameworks",args:g}])[0],f.fail(c.exception)},processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.id,label:b.shortname+" "+b.idnumber})}),d},transport:function(b,c,d){var e=a(b),f=e.data("contextid"),g=e.data("onlyvisible");if(!f)throw new Error("The attribute data-contextid is required on "+b);this.list(f,{query:c,onlyvisible:g}).then(d)}}});
  114. define('tool_lp/competencyruleconfig', ["jquery","core/notification","core/templates","tool_lp/dialogue","tool_lp/competency_outcomes","core/str"],function(a,b,c,d,e,f){var g=function(b,c){this._eventNode=a("<div></div>"),this._tree=b,this._rulesModules=c,this._setUp()};return g.prototype._competency=null,g.prototype._eventNode=null,g.prototype._outcomesOption=null,g.prototype._popup=null,g.prototype._ready=null,g.prototype._rules=null,g.prototype._rulesModules=null,g.prototype._tree=null,g.prototype._afterChange=function(){this._isValid()?this._find('[data-action="save"]').prop("disabled",!1):this._find('[data-action="save"]').prop("disabled",!0)},g.prototype._afterRuleConfigChange=function(a,b){b==this._getRule()&&this._afterChange()},g.prototype._afterRender=function(){var a=this;a._find('[name="outcome"]').on("change",function(){a._switchedOutcome()}).trigger("change"),a._find('[name="rule"]').on("change",function(){a._switchedRule()}).trigger("change"),a._find('[data-action="save"]').on("click",function(){a._trigger("save",a._getConfig()),a.close()}),a._find('[data-action="cancel"]').on("click",function(){a.close()})},g.prototype.canBeConfigured=function(){var b=!1;return a.each(this._rules,function(a,c){if(c.canConfig())return void(b=!0)}),b},g.prototype.close=function(){this._popup.close(),this._popup=null},g.prototype.display=function(){var a=this;return!!a._competency&&a._render().then(function(b){return f.get_string("competencyrule","tool_lp").then(function(c){a._popup=new d(c,b,a._afterRender.bind(a))})}).fail(b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._getApplicableOutcomesOptions=function(){var b=this,c=[];return a.each(b._outcomesOption,function(a,d){c.push({code:d.code,name:d.name,selected:d.code==b._competency.ruleoutcome})}),c},g.prototype._getApplicableRulesOptions=function(){var b=this,c=[];return a.each(b._rules,function(a,d){d.canConfig()&&c.push({name:b._getRuleName(d.getType()),type:d.getType(),selected:d.getType()==b._competency.ruletype})}),c},g.prototype._getConfig=function(){var a=this._getRule();return{ruletype:a?a.getType():null,ruleconfig:a?a.getConfig():null,ruleoutcome:this._getOutcome()}},g.prototype._getOutcome=function(){return this._find('[name="outcome"]').val()},g.prototype._getRule=function(){var b,c=this._find('[name="rule"]').val();return a.each(this._rules,function(a,d){if(d.getType()==c)return void(b=d)}),b},g.prototype._getRuleName=function(b){var c,d=this;return a.each(d._rulesModules,function(a,d){if(d.type==b)return void(c=d.name)}),c},g.prototype._initOutcomes=function(){var a=this;return e.getAll().then(function(b){a._outcomesOption=b})},g.prototype._initRules=function(){var b=this,c=[];return a.each(b._rules,function(d,e){var f=e.init().then(function(){e.setTargetCompetency(b._competency),e.on("change",b._afterRuleConfigChange.bind(b))},function(){return b._rules.splice(d,1),a.when()});c.push(f)}),a.when.apply(a.when,c)},g.prototype._isValid=function(){var a=this._getOutcome(),b=this._getRule();return a==e.NONE||!!b&&b.isValid()},g.prototype.on=function(a,b){this._eventNode.on(a,b)},g.prototype._preRender=function(){return this.ready()},g.prototype.ready=function(){return this._ready.promise()},g.prototype._render=function(){var a=this;return this._preRender().then(function(){var b;a.canBeConfigured()?(b={},b.outcomes=a._getApplicableOutcomesOptions(),b.rules=a._getApplicableRulesOptions()):b=!1;var d={competencyshortname:a._competency.shortname,config:b};return c.render("tool_lp/competency_rule_config",d)})},g.prototype.setTargetCompetencyId=function(b){var c=this;c._competency=c._tree.getCompetency(b),a.each(c._rules,function(a,b){b.setTargetCompetency(c._competency)})},g.prototype._setUp=function(){var b=this,c=[],d=[];b._ready=a.Deferred(),b._rules=[],a.each(b._rulesModules,function(a,b){d.push(b.amd)}),require(d,function(){a.each(arguments,function(a,c){var d=new c(b._tree);b._rules.push(d)}),c.push(b._initRules()),c.push(b._initOutcomes()),a.when.apply(a.when,c).always(function(){b._ready.resolve()})})},g.prototype._switchedOutcome=function(){var a=this,b=a._getOutcome();return b==e.NONE?(a._find('[data-region="rule-type"]').hide().find('[name="rule"]').val(-1),a._find('[data-region="rule-config"]').empty().hide(),void a._afterChange()):(a._find('[data-region="rule-type"]').show(),a._find('[data-region="rule-config"]').show(),void a._afterChange())},g.prototype._switchedRule=function(){var a=this,b=a._find('[data-region="rule-config"]'),c=a._getRule();return c?void c.injectTemplate(b).then(function(){b.show()},function(){b.empty().hide()}).always(function(){a._afterChange()}):(b.empty().hide(),void a._afterChange())},g.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])},g});
  115. define('tool_lp/competency_rule_points', ["jquery","core/str","core/templates","tool_lp/competency_rule"],function(a,b,c,d){var e=function(){d.apply(this,arguments)};return e.prototype=Object.create(d.prototype),e.prototype._container=null,e.prototype._templateLoaded=!1,e.prototype.getConfig=function(){return JSON.stringify({base:{points:this._getRequiredPoints()},competencies:this._getCompetenciesConfig()})},e.prototype._getCompetenciesConfig=function(){var b=[];return this._container.find("[data-competency]").each(function(){var c=a(this),d=c.data("competency"),e=parseInt(c.find('[name="points"]').val(),10),f=c.find('[name="required"]').prop("checked");b.push({id:d,points:e,required:f?1:0})}),b},e.prototype._getRequiredPoints=function(){return parseInt(this._container.find('[name="requiredpoints"]').val()||1,10)},e.prototype.getType=function(){return"core_competency\\competency_rule_points"},e.prototype.injectTemplate=function(b){var d,e=this,f=this._tree.getChildren(this._competency.id),g={base:{points:2},competencies:[]};if(this._templateLoaded=!1,e._competency.ruletype==e.getType())try{g=JSON.parse(e._competency.ruleconfig)}catch(h){}return d={requiredpoints:g&&g.base?g.base.points:2,competency:e._competency,children:[]},a.each(f,function(b,c){var e={id:c.id,shortname:c.shortname,required:!1,points:0};g&&a.each(g.competencies,function(a,b){b.id==e.id&&(e.required=!!b.required,e.points=b.points)}),d.children.push(e)}),c.render("tool_lp/competency_rule_points",d).then(function(a){e._container=b,b.html(a),b.find("input").change(function(){e._triggerChange()}),e._templateLoaded=!0,e._triggerChange()})},e.prototype.isValid=function(){if(!this._templateLoaded)return!1;var b=this._getRequiredPoints(),c=0,d=!0;return a.each(this._getCompetenciesConfig(),function(a,b){b.points<0&&(d=!1),c+=b.points}),d=d&&c>=b},e});
  116. define('tool_lp/templateactions', ["jquery","core/templates","core/ajax","core/notification","core/str","tool_lp/actionselector"],function(a,b,c,d,e,f){var g=0,h=0,i=!0,j=function(c,d){a('[data-region="managetemplates"]').replaceWith(c),b.runTemplateJS(d)},k=function(a){b.render("tool_lp/manage_templates_page",a).done(j).fail(d.exception)},l=function(){var a=c.call([{methodname:"core_competency_delete_template",args:{id:h,deleteplans:i}},{methodname:"tool_lp_data_for_templates_manage_page",args:{pagecontext:{contextid:g}}}]);a[1].done(k).fail(d.exception)},m=function(b){b.preventDefault(),h=a(this).attr("data-templateid");var e=c.call([{methodname:"core_competency_duplicate_template",args:{id:h}},{methodname:"tool_lp_data_for_templates_manage_page",args:{pagecontext:{contextid:g}}}]);e[1].done(k).fail(d.exception)},n=function(b){b.preventDefault();var g=a(this).attr("data-templateid");h=g,i=!0;var j=c.call([{methodname:"core_competency_read_template",args:{id:h}},{methodname:"core_competency_template_has_related_data",args:{id:h}}]);j[0].done(function(a){j[1].done(function(b){b?e.get_strings([{key:"deletetemplate",component:"tool_lp",param:a.shortname},{key:"deletetemplatewithplans",component:"tool_lp"},{key:"deleteplans",component:"tool_lp"},{key:"unlinkplanstemplate",component:"tool_lp"},{key:"confirm",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){var b=[{text:a[2],value:"delete"},{text:a[3],value:"unlink"}],c=new f(a[0],a[1],b,a[4],a[5]);c.display(),c.on("save",function(a,b){"delete"!=b.action&&(i=!1),l()})}).fail(d.exception):e.get_strings([{key:"confirm",component:"moodle"},{key:"deletetemplate",component:"tool_lp",param:a.shortname},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],l)}).fail(d.exception)}).fail(d.exception)}).fail(d.exception)};return{deleteHandler:n,duplicateHandler:m,init:function(a){g=a}}});
  117. define('tool_lp/competency_rule_all', ["jquery","core/str","tool_lp/competency_rule"],function(a,b,c){var d=function(){c.apply(this,arguments)};return d.prototype=Object.create(c.prototype),d.prototype.getType=function(){return"core_competency\\competency_rule_all"},d.prototype.isValid=function(){return!0},d});
  118. define('tool_lp/grade_user_competency_inline', ["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);var j=a(b);if(!j.length)throw new Error("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};return h.prototype=Object.create(f.prototype),h.prototype._setUp=function(){var a=[],d=this,f=g.get_values(d._scaleId);f.done(function(f){a.push({value:"",name:d._chooseStr});for(var g=0;g<f.length;g++){var h=f[g];a.push({value:h.id,name:h.name})}d._dialogue=new e(a),d._dialogue.on("rated",function(a,e){var f=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])})}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h});
  119. define('tool_lp/user_competency_workflow', ["jquery","core/templates","core/ajax","core/notification","core/str","tool_lp/menubar","tool_lp/event_base"],function(a,b,c,d,e,f,g){var h=function(){g.prototype.constructor.apply(this,[])};return h.prototype=Object.create(g.prototype),h.prototype._nodeSelector='[data-node="user-competency"]',h.prototype._cancelReviewRequest=function(a){var b={methodname:"core_competency_user_competency_cancel_review_request",args:{userid:a.userid,competencyid:a.competencyid}};c.call([b])[0].then(function(){this._trigger("review-request-cancelled",a),this._trigger("status-changed",a)}.bind(this),function(){this._trigger("error-occured",a)}.bind(this))},h.prototype.cancelReviewRequest=function(a){this._cancelReviewRequest(a)},h.prototype._cancelReviewRequestHandler=function(b){b.preventDefault();var c=this._findUserCompetencyData(a(b.target));this.cancelReviewRequest(c)},h.prototype._requestReview=function(a){var b={methodname:"core_competency_user_competency_request_review",args:{userid:a.userid,competencyid:a.competencyid}};c.call([b])[0].then(function(){this._trigger("review-requested",a),this._trigger("status-changed",a)}.bind(this),function(){this._trigger("error-occured",a)}.bind(this))},h.prototype.requestReview=function(a){this._requestReview(a)},h.prototype._requestReviewHandler=function(b){b.preventDefault();var c=this._findUserCompetencyData(a(b.target));this.requestReview(c)},h.prototype._startReview=function(a){var b={methodname:"core_competency_user_competency_start_review",args:{userid:a.userid,competencyid:a.competencyid}};c.call([b])[0].then(function(){this._trigger("review-started",a),this._trigger("status-changed",a)}.bind(this),function(){this._trigger("error-occured",a)}.bind(this))},h.prototype.startReview=function(a){this._startReview(a)},h.prototype._startReviewHandler=function(b){b.preventDefault();var c=this._findUserCompetencyData(a(b.target));this.startReview(c)},h.prototype._stopReview=function(a){var b={methodname:"core_competency_user_competency_stop_review",args:{userid:a.userid,competencyid:a.competencyid}};c.call([b])[0].then(function(){this._trigger("review-stopped",a),this._trigger("status-changed",a)}.bind(this),function(){this._trigger("error-occured",a)}.bind(this))},h.prototype.stopReview=function(a){this._stopReview(a)},h.prototype._stopReviewHandler=function(b){b.preventDefault();var c=this._findUserCompetencyData(a(b.target));this.stopReview(c)},h.prototype.enhanceMenubar=function(a){f.enhance(a,{'[data-action="request-review"]':this._requestReviewHandler.bind(this),'[data-action="cancel-review-request"]':this._cancelReviewRequestHandler.bind(this)})},h.prototype._findUserCompetencyData=function(a){var b,c=a.parents(this._nodeSelector);if(1!=c.length)throw new Error("The evidence node was not located.");if(b=c.data(),"undefined"==typeof b||"undefined"==typeof b.userid||"undefined"==typeof b.competencyid)throw new Error("User competency data could not be found.");return b},h.prototype.enhanceMenubar=function(a){f.enhance(a,{'[data-action="request-review"]':this._requestReviewHandler.bind(this),'[data-action="cancel-review-request"]':this._cancelReviewRequestHandler.bind(this),'[data-action="start-review"]':this._startReviewHandler.bind(this),'[data-action="stop-review"]':this._stopReviewHandler.bind(this)})},h.prototype.registerEvents=function(b){var c=a(b);c.find('[data-action="request-review"]').click(this._requestReviewHandler.bind(this)),c.find('[data-action="cancel-review-request"]').click(this._cancelReviewRequestHandler.bind(this)),c.find('[data-action="start-review"]').click(this._startReviewHandler.bind(this)),c.find('[data-action="stop-review"]').click(this._stopReviewHandler.bind(this))},h});
  120. define('tool_lp/dragdrop-reorder', ["core/str","core/yui"],function(a,b){var c=null,d=function(a){var b=a.drag.get("node"),c=a.drop.get("node");this.callback(b.getDOMNode(),c.getDOMNode())};return{dragdrop:function(e,f,g,h,i,j,k,l){a.get_strings([{key:"emptydragdropregion",component:"moodle"},{key:"movecontent",component:"moodle"},{key:"tocontent",component:"moodle"}]).done(function(){b.use("moodle-tool_lp-dragdrop-reorder",function(){var a={callback:l};c&&c.destroy(),c=M.tool_lp.dragdrop_reorder({group:e,dragHandleText:f,sameNodeText:g,parentNodeText:h,sameNodeClass:i,parentNodeClass:j,dragHandleInsertClass:k,callback:b.bind(d,a)})})})}}});
  121. define('tool_lp/planactions', ["jquery","core/templates","core/ajax","core/notification","core/str","tool_lp/menubar","tool_lp/dialogue"],function(a,b,c,d,e,f,g){var h=function(a){if(this._type=a,"plan"===a)this._region='[data-region="plan-page"]',this._planNode='[data-region="plan-page"]',this._template="tool_lp/plan_page",this._contextMethod="tool_lp_data_for_plan_page";else{if("plans"!==a)throw new TypeError("Unexpected type.");this._region='[data-region="plans"]',this._planNode='[data-region="plan-node"]',this._template="tool_lp/plans_page",this._contextMethod="tool_lp_data_for_plans_page"}};return h.prototype._contextMethod=null,h.prototype._planNode=null,h.prototype._region=null,h.prototype._template=null,h.prototype._type=null,h.prototype._getContextArgs=function(a){var b=this,c={};return"plan"===b._type?c={planid:a.id}:"plans"===b._type&&(c={userid:a.userid}),c},h.prototype.refresh=function(b){var c=this._findPlanData(a(b));this._callAndRefresh([],c)},h.prototype._renderView=function(c){var e=this;b.render(e._template,c).done(function(c,d){a(e._region).replaceWith(c),b.runTemplateJS(d)}).fail(d.exception)},h.prototype._callAndRefresh=function(b,e){var f=this;return b.push({methodname:f._contextMethod,args:f._getContextArgs(e)}),a.when.apply(a.when,c.call(b)).then(function(){f._renderView(arguments[arguments.length-1])}).fail(d.exception)},h.prototype._doDelete=function(a){var b=this,c=[{methodname:"core_competency_delete_plan",args:{id:a.id}}];b._callAndRefresh(c,a)},h.prototype.deletePlan=function(a){var b,f=this;b=c.call([{methodname:"core_competency_read_plan",args:{id:a.id}}]),b[0].done(function(b){e.get_strings([{key:"confirm",component:"moodle"},{key:"deleteplan",component:"tool_lp",param:b.name},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(b){d.confirm(b[0],b[1],b[2],b[3],function(){f._doDelete(a)})}).fail(d.exception)}).fail(d.exception)},h.prototype._doReopenPlan=function(a){var b=this,c=[{methodname:"core_competency_reopen_plan",args:{planid:a.id}}];b._callAndRefresh(c,a)},h.prototype.reopenPlan=function(a){var b=this,f=c.call([{methodname:"core_competency_read_plan",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"reopenplanconfirm",component:"tool_lp",param:c.name},{key:"reopenplan",component:"tool_lp"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doReopenPlan(a)})}).fail(d.exception)}).fail(d.exception)},h.prototype._doCompletePlan=function(a){var b=this,c=[{methodname:"core_competency_complete_plan",args:{planid:a.id}}];b._callAndRefresh(c,a)},h.prototype.completePlan=function(a){var b=this,f=c.call([{methodname:"core_competency_read_plan",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"completeplanconfirm",component:"tool_lp",param:c.name},{key:"completeplan",component:"tool_lp"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doCompletePlan(a)})}).fail(d.exception)}).fail(d.exception)},h.prototype._doUnlinkPlan=function(a){var b=this,c=[{methodname:"core_competency_unlink_plan_from_template",args:{planid:a.id}}];b._callAndRefresh(c,a)},h.prototype.unlinkPlan=function(a){var b=this,f=c.call([{methodname:"core_competency_read_plan",args:{id:a.id}}]);f[0].done(function(c){e.get_strings([{key:"confirm",component:"moodle"},{key:"unlinkplantemplateconfirm",component:"tool_lp",param:c.name},{key:"unlinkplantemplate",component:"tool_lp"},{key:"cancel",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],function(){b._doUnlinkPlan(a)})}).fail(d.exception)}).fail(d.exception)},h.prototype._doRequestReview=function(a){var b=[{methodname:"core_competency_plan_request_review",args:{id:a.id}}];this._callAndRefresh(b,a)},h.prototype.requestReview=function(a){this._doRequestReview(a)},h.prototype._doCancelReviewRequest=function(a){var b=[{methodname:"core_competency_plan_cancel_review_request",args:{id:a.id}}];this._callAndRefresh(b,a)},h.prototype.cancelReviewRequest=function(a){this._doCancelReviewRequest(a)},h.prototype._doStartReview=function(a){var b=[{methodname:"core_competency_plan_start_review",args:{id:a.id}}];this._callAndRefresh(b,a)},h.prototype.startReview=function(a){this._doStartReview(a)},h.prototype._doStopReview=function(a){var b=[{methodname:"core_competency_plan_stop_review",args:{id:a.id}}];this._callAndRefresh(b,a)},h.prototype.stopReview=function(a){this._doStopReview(a)},h.prototype._doApprove=function(a){var b=[{methodname:"core_competency_approve_plan",args:{id:a.id}}];this._callAndRefresh(b,a)},h.prototype.approve=function(a){this._doApprove(a)},h.prototype._doUnapprove=function(a){var b=[{methodname:"core_competency_unapprove_plan",args:{id:a.id}}];this._callAndRefresh(b,a)},h.prototype.unapprove=function(a){this._doUnapprove(a)},h.prototype._showLinkedCoursesHandler=function(f){f.preventDefault();var h=a(f.target).data("id"),i=c.call([{methodname:"tool_lp_list_courses_using_competency",args:{id:h}}]);i[0].done(function(a){var c={courses:a};b.render("tool_lp/linked_courses_summary",c).done(function(a){e.get_string("linkedcourses","tool_lp").done(function(b){new g(b,a)}).fail(d.exception)}).fail(d.exception)}).fail(d.exception)},h.prototype._eventHandler=function(b,c){c.preventDefault();var d=this._findPlanData(a(c.target));this[b](d)},h.prototype._findPlanData=function(b){var c,d=b.parentsUntil(a(this._region).parent(),this._planNode);if(1!=d.length)throw new Error("The plan node was not located.");if(c=d.data(),"undefined"==typeof c||"undefined"==typeof c.id)throw new Error("Plan data could not be found.");return c},h.prototype.enhanceMenubar=function(a){f.enhance(a,{'[data-action="plan-delete"]':this._eventHandler.bind(this,"deletePlan"),'[data-action="plan-complete"]':this._eventHandler.bind(this,"completePlan"),'[data-action="plan-reopen"]':this._eventHandler.bind(this,"reopenPlan"),'[data-action="plan-unlink"]':this._eventHandler.bind(this,"unlinkPlan"),'[data-action="plan-request-review"]':this._eventHandler.bind(this,"requestReview"),'[data-action="plan-cancel-review-request"]':this._eventHandler.bind(this,"cancelReviewRequest"),'[data-action="plan-start-review"]':this._eventHandler.bind(this,"startReview"),'[data-action="plan-stop-review"]':this._eventHandler.bind(this,"stopReview"),'[data-action="plan-approve"]':this._eventHandler.bind(this,"approve"),'[data-action="plan-unapprove"]':this._eventHandler.bind(this,"unapprove")})},h.prototype.registerEvents=function(){var b=a(this._region);b.find('[data-action="plan-delete"]').click(this._eventHandler.bind(this,"deletePlan")),b.find('[data-action="plan-complete"]').click(this._eventHandler.bind(this,"completePlan")),b.find('[data-action="plan-reopen"]').click(this._eventHandler.bind(this,"reopenPlan")),b.find('[data-action="plan-unlink"]').click(this._eventHandler.bind(this,"unlinkPlan")),b.find('[data-action="plan-request-review"]').click(this._eventHandler.bind(this,"requestReview")),b.find('[data-action="plan-cancel-review-request"]').click(this._eventHandler.bind(this,"cancelReviewRequest")),b.find('[data-action="plan-start-review"]').click(this._eventHandler.bind(this,"startReview")),b.find('[data-action="plan-stop-review"]').click(this._eventHandler.bind(this,"stopReview")),b.find('[data-action="plan-approve"]').click(this._eventHandler.bind(this,"approve")),b.find('[data-action="plan-unapprove"]').click(this._eventHandler.bind(this,"unapprove")),b.find('[data-action="find-courses-link"]').click(this._showLinkedCoursesHandler.bind(this))},h});
  122. define('tool_lp/parentcompetency_form', ["jquery","core/ajax","core/str","tool_lp/competencypicker","core/templates","core/notification"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){this.buttonSelector=a,this.inputHiddenSelector=b,this.staticElementSelector=c,this.frameworkId=d,this.pageContextId=e,this.registerEvents()};return g.prototype.buttonSelector=null,g.prototype.inputHiddenSelector=null,g.prototype.staticElementSelector=null,g.prototype.frameworkId=null,g.prototype.pageContextId=null,g.prototype.setParent=function(d){var e=this;0!==d.competencyId?b.call([{methodname:"core_competency_read_competency",args:{id:d.competencyId}}])[0].done(function(b){a(e.staticElementSelector).html(b.shortname),a(e.inputHiddenSelector).val(b.id)}).fail(f.exception):c.get_string("competencyframeworkroot","tool_lp").then(function(b){a(e.staticElementSelector).html(b),a(e.inputHiddenSelector).val(d.competencyId)}).fail(f.exception)},g.prototype.registerEvents=function(){var b=this;a(b.buttonSelector).on("click",function(a){a.preventDefault();var c=new d(b.pageContextId,b.frameworkId,"self",(!1));c._render=function(){var a=this;return a._preRender().then(function(){var b={competencies:a._competencies,framework:a._getFramework(a._frameworkId),frameworks:a._frameworks,search:a._searchText,singleFramework:a._singleFramework};return e.render("tool_lp/competency_picker_competencyform",b)})},c.on("save",function(a,c){b.setParent(c)}),c.display()})},{init:function(a,b,c,d,e){new g(a,b,c,d,e)}}});
  123. define('tool_lp/evidence_delete', ["jquery","core/notification","core/ajax","core/str","core/log"],function(a,b,c,d,e){var f={},g=function(g,h){"undefined"==typeof f[g]&&(f[g]=a("body").delegate(g,"click",function(f){var g=a(f.currentTarget).parents(h);if(!g.length||g.length>1)return void e.error("None or too many evidence container were found.");var i=g.data("id");return i?(f.preventDefault(),f.stopPropagation(),void d.get_strings([{key:"confirm",component:"moodle"},{key:"areyousure",component:"moodle"},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){b.confirm(a[0],a[1],a[2],a[3],function(){var a=c.call([{methodname:"core_competency_delete_evidence",args:{id:i}}]);a[0].then(function(){g.remove()}).fail(b.exception)})}).fail(b.exception)):void e.error("Evidence ID was not found.")}))};return{register:g}});
  124. define('tool_lp/competencypicker_user_plans', ["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/tree","tool_lp/competencypicker"],function(a,b,c,d,e,f,g){var h=function(a,b,c){g.prototype.constructor.apply(this,[1,!1,"self",c]),this._userId=a,this._plans=[],b&&(this._planId=b,this._singlePlan=!0)};return h.prototype=Object.create(g.prototype),h.prototype._plans=null,h.prototype._planId=null,h.prototype._singlePlan=!1,h.prototype._userId=null,h.prototype._afterRender=function(){var b=this;g.prototype._afterRender.apply(b,arguments),b._singlePlan||b._find('[data-action="chooseplan"]').change(function(c){b._planId=a(c.target).val(),b._loadCompetencies().then(b._refresh.bind(b))})},h.prototype._fetchCompetencies=function(a,d){var e=this;return c.call([{methodname:"core_competency_list_plan_competencies",args:{id:a}}])[0].done(function(a){var b,c,f=[];for(b=0;b<a.length;b++)c=a[b].competency,c.shortname.toLowerCase().indexOf(d.toLowerCase())<0||(c.children=[],c.haschildren=0,f.push(c));e._competencies=f}).fail(b.exception)},h.prototype._getPlan=function(b){var c;return a.each(this._plans,function(a,d){if(d.id==b)return void(c=d)}),c},h.prototype._loadCompetencies=function(){return this._fetchCompetencies(this._planId,this._searchText)},h.prototype._loadPlans=function(){var d,e=this;return e._plans.length>0?a.when():(d=e._singlePlan?c.call([{methodname:"core_competency_read_plan",args:{id:this._planId}}])[0].then(function(a){return[a]}):c.call([{methodname:"core_competency_list_user_plans",args:{userid:e._userId}}])[0],d.done(function(a){e._plans=a}).fail(b.exception))},h.prototype._preRender=function(){var b=this;return b._loadPlans().then(function(){return!b._planId&&b._plans.length>0&&(b._planId=b._plans[0].id),b._planId?b._loadCompetencies():(b._plans=[],a.when())})},h.prototype._render=function(){var b=this;return b._preRender().then(function(){b._singlePlan||a.each(b._plans,function(a,c){c.id==b._planId?c.selected=!0:c.selected=!1});var c={competencies:b._competencies,plan:b._getPlan(b._planId),plans:b._plans,search:b._searchText,singlePlan:b._singlePlan};return d.render("tool_lp/competency_picker_user_plans",c)})},h});
  125. define('tool_lp/menubar', ["jquery"],function(a){var b=!1,c=!1,d=function(){a(".tool-lp-menu .tool-lp-sub-menu").attr("aria-hidden","true"),c=!1},e=function(a,b){this.menuRoot=a,this.handlers=b,this.rootMenus=this.menuRoot.children("li"),this.subMenus=this.rootMenus.children("ul"),this.subMenuItems=this.subMenus.children("li"),this.allItems=this.rootMenus.add(this.subMenuItems),this.activeItem=null,this.isChildOpen=!1,this.keys={tab:9,enter:13,esc:27,space:32,left:37,up:38,right:39,down:40},this.addAriaAttributes(),this.addEventListeners()};return e.prototype.openSubMenu=function(a){this.setOpenDirection(),d(),a.attr("aria-hidden","false"),c=!0},e.prototype.addEventListeners=function(){var e=this;b===!1&&(a(document).click(function(){c&&d()}),b=!0),this.subMenuItems.mouseenter(function(){return a(this).addClass("menu-hover"),!0}),this.subMenuItems.mouseout(function(){return a(this).removeClass("menu-hover"),!0}),this.allItems.click(function(b){return e.handleClick(a(this),b)}),this.allItems.keydown(function(b){return e.handleKeyDown(a(this),b)}),this.allItems.focus(function(){return e.handleFocus(a(this))}),this.allItems.blur(function(){return e.handleBlur(a(this))})},e.prototype.handleClick=function(b,c){c.stopPropagation();var d=b.parent();if(d.is(".tool-lp-menu"))"true"==b.children("ul").first().attr("aria-hidden")?this.openSubMenu(b.children("ul").first()):b.children("ul").first().attr("aria-hidden","true");else{this.allItems.removeClass("menu-hover menu-focus"),this.activeItem=null,this.menuRoot.find("ul").not(".root-level").attr("aria-hidden","true");var e=b.find("a").first(),f=new a.Event("click");f.target=e;var g=!1;this.handlers&&a.each(this.handlers,function(c,d){if(!g&&b.find(c).length>0){var h=a.proxy(d,e);g=h(f)===!1||f.isDefaultPrevented()}}),g||"#"===e.attr("href")||(window.location.href=e.attr("href"))}return!1},e.prototype.handleFocus=function(a){if(null===this.activeItem)this.activeItem=a;else if(a[0]!=this.activeItem[0])return!0;var b=this.activeItem.parentsUntil("ul.tool-lp-menu").filter("li");if(this.allItems.removeClass("menu-focus"),this.activeItem.addClass("menu-focus"),b.addClass("menu-focus"),this.isChildOpen===!0){var c=a.parent();c.is(".tool-lp-menu")&&"true"==a.attr("aria-haspopup")&&this.openSubMenu(a.children("ul").first())}return!0},e.prototype.handleBlur=function(a){return a.removeClass("menu-focus"),!0},e.prototype.setOpenDirection=function(){var b=this.menuRoot.offset(),c=a(document.body).hasClass("dir-rtl"),d=!0,e=this.rootMenus.outerHeight(),f=this.rootMenus.outerWidth(),g=this.rootMenus.find("ul.tool-lp-sub-menu");g.css("margin-right",""),g.css("margin-left",""),g.css("margin-top",""),g.attr("aria-hidden",!1);var h=g.outerWidth(),i=g.outerHeight(),j=null,k=null,l=null,m=b.top-a(window).scrollTop();m+i>a(window).height()&&(j=i+e,g.css("margin-top","-"+j+"px")),c?b.left-h<0&&(k=h-f,g.css("margin-right","-"+k+"px")):b.left+h>a(window).width()&&(l=h-f,g.css("margin-left","-"+l+"px")),d?this.menuRoot.addClass("tool-lp-menu-open-left"):this.menuRoot.removeClass("tool-lp-menu-open-left")},e.prototype.handleKeyDown=function(a,b){if(b.altKey||b.ctrlKey)return!0;switch(b.keyCode){case this.keys.tab:this.menuRoot.find("ul").attr("aria-hidden","true"),this.allItems.removeClass("menu-focus"),this.activeItem=null,this.isChildOpen=!1;break;case this.keys.esc:var c=a.parent();return c.is(".tool-lp-menu")?a.children("ul").first().attr("aria-hidden","true"):(this.activeItem=c.parent(),this.isChildOpen=!1,this.activeItem.focus(),c.attr("aria-hidden","true")),b.stopPropagation(),!1;case this.keys.enter:case this.keys.space:return this.handleClick(a,b);case this.keys.left:return this.activeItem=this.moveToPrevious(a),this.activeItem.focus(),b.stopPropagation(),!1;case this.keys.right:return this.activeItem=this.moveToNext(a),this.activeItem.focus(),b.stopPropagation(),!1;case this.keys.up:return this.activeItem=this.moveUp(a),this.activeItem.focus(),b.stopPropagation(),!1;case this.keys.down:return this.activeItem=this.moveDown(a),this.activeItem.focus(),b.stopPropagation(),!1}return!0},e.prototype.moveToNext=function(a){var b=a.parent(),c=b.children("li"),d=c.length,e=c.index(a),f=null,g=null;if(b.is(".tool-lp-menu"))f=e<d-1?a.next():c.first(),"true"==a.attr("aria-haspopup")&&(g=a.children("ul").first(),"false"==g.attr("aria-hidden")&&(g.attr("aria-hidden","true"),this.isChildOpen=!0)),a.removeClass("menu-focus"),"true"===f.attr("aria-haspopup")&&this.isChildOpen===!0&&(g=f.children("ul").first(),this.openSubMenu(g));else if("true"==a.attr("aria-haspopup"))g=a.children("ul").first(),f=g.children("li").first(),this.openSubMenu(g);else{var h=null,i=null;h=a.parentsUntil("ul.tool-lp-menu").filter("ul").not(".tool-lp-menu"),h.attr("aria-hidden","true"),h.find("li").removeClass("menu-focus"),h.last().parent().removeClass("menu-focus"),i=h.last().parent(),e=this.rootMenus.index(i),f=e<this.rootMenus.length-1?i.next():this.rootMenus.first(),f.addClass("menu-focus"),"true"==f.attr("aria-haspopup")&&(g=f.children("ul").first(),f=g.children("li").first(),this.openSubMenu(g),this.isChildOpen=!0)}return f},e.prototype.moveToPrevious=function(a){var b=a.parent(),c=b.children("li"),d=c.index(a),e=null,f=null;if(b.is(".tool-lp-menu"))e=d>0?a.prev():c.last(),"true"==a.attr("aria-haspopup")&&(f=a.children("ul").first(),"false"==f.attr("aria-hidden")&&(f.attr("aria-hidden","true"),this.isChildOpen=!0)),a.removeClass("menu-focus"),"true"===e.attr("aria-haspopup")&&this.isChildOpen===!0&&(f=e.children("ul").first(),this.openSubMenu(f));else{var g=b.parent(),h=g.parent();h.is(".tool-lp-menu")?(b.attr("aria-hidden","true"),a.removeClass("menu-focus"),g.removeClass("menu-focus"),d=this.rootMenus.index(g),e=d>0?g.prev():this.rootMenus.last(),e.addClass("menu-focus"),"true"==e.attr("aria-haspopup")&&(f=e.children("ul").first(),this.openSubMenu(f),this.isChildOpen=!0,e=f.children("li").first())):(e=b.parent(),b.attr("aria-hidden","true"),a.removeClass("menu-focus"))}return e},e.prototype.moveDown=function(a,b){var c=a.parent(),d=c.children("li").not(".separator"),e=d.length,f=d.index(a),g=null,h=null;if(c.is(".tool-lp-menu"))return"true"!=a.attr("aria-haspopup")?a:(h=a.children("ul").first(),g=h.children("li").first(),this.openSubMenu(h),g);if(b){var i=!1,j=f+1;for(j==e&&(j=0);j!=f;){var k=d.eq(j).html().charAt(0);if(k.toLowerCase()==b){i=!0;break}j+=1,j==e&&(j=0)}return i===!0?(g=d.eq(j),a.removeClass("menu-focus"),g):a}return g=f<e-1?d.eq(f+1):d.first(),a.removeClass("menu-focus"),g},e.prototype.moveUp=function(a){var b=a.parent(),c=b.children("li").not(".separator"),d=c.index(a),e=null;return b.is(".tool-lp-menu")?a:(e=d>0?c.eq(d-1):c.last(),a.removeClass("menu-focus"),e)},e.prototype.addAriaAttributes=function(){this.menuRoot.attr("role","menubar"),this.rootMenus.attr("role","menuitem"),this.rootMenus.attr("tabindex","0"),this.rootMenus.attr("aria-haspopup","true"),this.subMenus.attr("role","menu"),this.subMenus.attr("aria-hidden","true"),this.subMenuItems.attr("role","menuitem"),this.subMenuItems.attr("tabindex","-1"),this.menuRoot.addClass("tool-lp-menu"),this.allItems.addClass("tool-lp-menu-item"),this.rootMenus.addClass("tool-lp-root-menu"),this.subMenus.addClass("tool-lp-sub-menu"),this.subMenuItems.addClass("dropdown-item")},{enhance:function(b,c){a(b).each(function(b,d){var f=a(d);f.data("menubarEnhanced")!==!0&&(new e(f,c),f.data("menubarEnhanced",!0))})},closeAll:d}});
  126. define('tool_lp/user_evidence_actions', ["jquery","core/templates","core/ajax","core/notification","core/str","tool_lp/menubar","tool_lp/competencypicker_user_plans"],function(a,b,c,d,e,f,g){var h=function(a){if(this._type=a,"evidence"===a)this._region='[data-region="user-evidence-page"]',this._evidenceNode='[data-region="user-evidence-page"]',this._template="tool_lp/user_evidence_page",this._contextMethod="tool_lp_data_for_user_evidence_page";else{if("list"!==a)throw new TypeError("Unexpected type.");this._region='[data-region="user-evidence-list"]',this._evidenceNode='[data-region="user-evidence-node"]',this._template="tool_lp/user_evidence_list_page",this._contextMethod="tool_lp_data_for_user_evidence_list_page"}};return h.prototype._contextMethod=null,h.prototype._evidenceNode=null,h.prototype._region=null,h.prototype._template=null,h.prototype._type=null,h.prototype._getContextArgs=function(a){var b=this,c={};return"evidence"===b._type?c={id:a.id}:"list"===b._type&&(c={userid:a.userid}),c},h.prototype._renderView=function(c){var e=this;b.render(e._template,c).done(function(c,d){b.replaceNode(a(e._region),c,d)}).fail(d.exception)},h.prototype._callAndRefresh=function(b,e){var f=this;return b.push({methodname:f._contextMethod,args:f._getContextArgs(e)}),a.when.apply(a.when,c.call(b)).then(function(){f._renderView(arguments[arguments.length-1])}).fail(d.exception)},h.prototype._doDelete=function(a){var b=this,c=[{methodname:"core_competency_delete_user_evidence",args:{id:a.id}}];b._callAndRefresh(c,a)},h.prototype.deleteEvidence=function(a){var b,f=this;b=c.call([{methodname:"core_competency_read_user_evidence",args:{id:a.id}}]),b[0].done(function(b){e.get_strings([{key:"confirm",component:"moodle"},{key:"deleteuserevidence",component:"tool_lp",param:b.name},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(b){d.confirm(b[0],b[1],b[2],b[3],function(){f._doDelete(a)})}).fail(d.exception)}).fail(d.exception)},h.prototype._deleteEvidenceHandler=function(b){b.preventDefault();var c=this._findEvidenceData(a(b.target));this.deleteEvidence(c)},h.prototype._doCreateUserEvidenceCompetency=function(b,c){var d=this,e=[];a.each(c,function(a,c){e.push({methodname:"core_competency_create_user_evidence_competency",args:{userevidenceid:b.id,competencyid:c}})}),d._callAndRefresh(e,b)},h.prototype.createUserEvidenceCompetency=function(a){var b=this,c=new g(a.userid);c.on("save",function(c,d){var e=d.competencyIds;b._doCreateUserEvidenceCompetency(a,e,d.requestReview)}),c.display()},h.prototype._createUserEvidenceCompetencyHandler=function(b){b.preventDefault();var c=this._findEvidenceData(a(b.target));this.createUserEvidenceCompetency(c)},h.prototype._doDeleteUserEvidenceCompetency=function(a,b){var c=this,d=[];d.push({methodname:"core_competency_delete_user_evidence_competency",args:{userevidenceid:a.id,competencyid:b}}),c._callAndRefresh(d,a)},h.prototype.deleteUserEvidenceCompetency=function(a,b){this._doDeleteUserEvidenceCompetency(a,b)},h.prototype._deleteUserEvidenceCompetencyHandler=function(b){var c=this._findEvidenceData(a(b.currentTarget)),d=a(b.currentTarget).data("id");b.preventDefault(),this.deleteUserEvidenceCompetency(c,d)},h.prototype._doReviewUserEvidenceCompetencies=function(a){var b=this,c=[{methodname:"core_competency_request_review_of_user_evidence_linked_competencies",args:{id:a.id}}];b._callAndRefresh(c,a)},h.prototype.reviewUserEvidenceCompetencies=function(a){var b,f=this;b=c.call([{methodname:"core_competency_read_user_evidence",args:{id:a.id}}]),b[0].done(function(b){e.get_strings([{key:"confirm",component:"moodle"},{key:"sendallcompetenciestoreview",component:"tool_lp",param:b.name},{key:"confirm",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(b){d.confirm(b[0],b[1],b[2],b[3],function(){f._doReviewUserEvidenceCompetencies(a)})}).fail(d.exception)}).fail(d.exception)},h.prototype._reviewUserEvidenceCompetenciesHandler=function(b){b.preventDefault();var c=this._findEvidenceData(a(b.target));this.reviewUserEvidenceCompetencies(c)},h.prototype._findEvidenceData=function(b){var c,d=b.parentsUntil(a(this._region).parent(),this._evidenceNode);if(1!=d.length)throw new Error("The evidence node was not located.");if(c=d.data(),"undefined"==typeof c||"undefined"==typeof c.id)throw new Error("Evidence data could not be found.");return c},h.prototype.enhanceMenubar=function(a){var b=this;f.enhance(a,{'[data-action="user-evidence-delete"]':b._deleteEvidenceHandler.bind(b),'[data-action="link-competency"]':b._createUserEvidenceCompetencyHandler.bind(b),'[data-action="send-competencies-review"]':b._reviewUserEvidenceCompetenciesHandler.bind(b)})},h.prototype.registerEvents=function(){var b=a(this._region),c=this;b.find('[data-action="user-evidence-delete"]').click(c._deleteEvidenceHandler.bind(c)),b.find('[data-action="link-competency"]').click(c._createUserEvidenceCompetencyHandler.bind(c)),b.find('[data-action="delete-competency-link"]').click(c._deleteUserEvidenceCompetencyHandler.bind(c)),b.find('[data-action="send-competencies-review"]').click(c._reviewUserEvidenceCompetenciesHandler.bind(c))},h});
  127. define('tool_lp/competencydialogue', ["jquery","core/notification","core/ajax","core/templates","core/str","tool_lp/dialogue"],function(a,b,c,d,e,f){var g,h=function(){};return h.prototype.triggerCompetencyViewedEvent=function(a){c.call([{methodname:"core_competency_competency_viewed",args:{id:a}}])},h.prototype.showDialogue=function(a,c){var e=this.getCompetencyDataPromise(a,c),g=this;e.done(function(c){d.render("tool_lp/competency_summary",c).done(function(b){g.triggerCompetencyViewedEvent(a),new f(c.competency.shortname,b)}).fail(b.exception)}).fail(b.exception)},h.prototype.showDialogueFromData=function(a){var c=this;d.render("tool_lp/competency_summary",a).done(function(b){c.triggerCompetencyViewedEvent(a.id),new f(a.shortname,b,c.enhanceDialogue)}).fail(b.exception)},h.prototype.clickEventHandler=function(b){var c=b.data.compdialogue,d=a(b.currentTarget),e=d.data("id"),f=!d.data("excluderelated"),g=d.data("includecourses");c.showDialogue(e,{includerelated:f,includecourses:g}),b.preventDefault()},h.prototype.getCompetencyDataPromise=function(a,d){var e=c.call([{methodname:"tool_lp_data_for_competency_summary",args:{competencyid:a,includerelated:d.includerelated||!1,includecourses:d.includecourses||!1}}]);return e[0].then(function(a){return a}).fail(b.exception)},{init:function(){"undefined"==typeof g&&(g=new h,a("body").delegate('[data-action="competency-dialogue"]',"click",{compdialogue:g},g.clickEventHandler.bind(g)))}}});
  128. define('tool_lp/competencyactions', ["jquery","core/url","core/templates","core/notification","core/str","core/ajax","tool_lp/dragdrop-reorder","tool_lp/tree","tool_lp/dialogue","tool_lp/menubar","tool_lp/competencypicker","tool_lp/competency_outcomes","tool_lp/competencyruleconfig"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n,o,p,q,r,s,t=null,u=null,v=null,w=null,x=function(){var c=a('[data-region="competencyactions"]').data("competency"),f={competencyframeworkid:t.getCompetencyFrameworkId(),pagecontextid:n};null!==c&&(f.parentid=c.id);var g=function(){var c=a.param(f);window.location=b.relativeUrl("/admin/tool/lp/editcompetency.php?"+c)};null!==c&&t.hasRule(c.id)?e.get_strings([{key:"confirm",component:"moodle"},{key:"addingcompetencywillresetparentrule",component:"tool_lp",param:c.shortname},{key:"yes",component:"core"},{key:"no",component:"core"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],g)}).fail(d.exception):g()},y=function(){var b=a('[data-region="filtercompetencies"]').data("frameworkid"),c=f.call([{methodname:"core_competency_set_parent_competency",args:{competencyid:u,parentid:v}},{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:b,search:a('[data-region="filtercompetencies"] input').val()}}]);c[1].done(E).fail(d.exception)},z=function(){if(v="undefined"==typeof v?0:v,v!=u){var a=t.getCompetency(v)||{},b=t.getCompetency(u)||{},c="movecompetencywillresetrules",f=!1;b.parentid!=v&&(a.path&&a.path.indexOf("/"+b.id+"/")>=0&&(c="movecompetencytochildofselfwillresetrules",f=f||t.hasRule(b.id)),f=f||t.hasRule(a.id)||t.hasRule(b.parentid),f?e.get_strings([{key:"confirm",component:"moodle"},{key:c,component:"tool_lp"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],y)}).fail(d.exception):y())}},A=function(b){var c=a(b.getContent()),d=c.find("[data-enhance=movetree]"),e=new h(d,(!1));e.on("selectionchanged",function(b,c){var d=c.selected;v=a(d).data("id")}),d.show(),c.on("click",'[data-action="move"]',function(){b.close(),z()}),c.on("click",'[data-action="cancel"]',function(){b.close()})},B=function(a,b){var c;for(c=0;c<b.length;c++)b[c].parentid==a.id&&(a.haschildren=!0,b[c].children=[],b[c].haschildren=!1,a.children[a.children.length]=b[c],B(b[c],b))},C=function(b){b.preventDefault();var g=a('[data-region="competencyactions"]').data("competency");u=g.id;var h=f.call([{methodname:"core_competency_search_competencies",args:{competencyframeworkid:g.competencyframeworkid,searchtext:""}},{methodname:"core_competency_read_competency_framework",args:{id:g.competencyframeworkid}}]);a.when.apply(null,h).done(function(a,b){var f,h=[];for(f=0;f<a.length;f++){var j=a[f];"0"==j.parentid&&(j.children=[],j.haschildren=0,h[h.length]=j,B(j,a))}e.get_strings([{key:"movecompetency",component:"tool_lp",param:g.shortname},{key:"move",component:"tool_lp"},{key:"cancel",component:"moodle"}]).done(function(a){var e={framework:b,competencies:h};c.render("tool_lp/competencies_move_tree",e).done(function(b){new i(a[0],b,A)}).fail(d.exception)}).fail(d.exception)}).fail(d.exception)},D=function(){var c=a('[data-region="competencyactions"]').data("competency"),d={competencyframeworkid:t.getCompetencyFrameworkId(),id:c.id,parentid:c.parentid,pagecontextid:n},e=a.param(d);window.location=b.relativeUrl("/admin/tool/lp/editcompetency.php?"+e)},E=function(b){c.render("tool_lp/manage_competencies_page",b).done(function(b,d){a('[data-region="managecompetencies"]').replaceWith(b),c.runTemplateJS(d)}).fail(d.exception)},F=function(b){b.preventDefault();var c=a('[data-region="filtercompetencies"]').data("frameworkid"),e=f.call([{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:c,search:a('[data-region="filtercompetencies"] input').val()}}]);e[0].done(E).fail(d.exception)},G=function(){var b=a('[data-region="competencyactions"]').data("competency"),c=f.call([{methodname:"core_competency_move_up_competency",args:{id:b.id}},{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:b.competencyframeworkid,search:a('[data-region="filtercompetencies"] input').val()}}]);c[1].done(E).fail(d.exception)},H=function(){var b=a('[data-region="competencyactions"]').data("competency"),c=f.call([{methodname:"core_competency_move_down_competency",args:{id:b.id}},{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:b.competencyframeworkid,search:a('[data-region="filtercompetencies"] input').val()}}]);c[1].done(E).fail(d.exception)},I=function(){var b=a('[data-region="competencyactions"]').data("competency"),g=f.call([{methodname:"tool_lp_list_courses_using_competency",args:{id:b.id}}]);g[0].done(function(a){var b={courses:a};c.render("tool_lp/linked_courses_summary",b).done(function(a){e.get_string("linkedcourses","tool_lp").done(function(b){new i(b,a,A)}).fail(d.exception)}).fail(d.exception)}).fail(d.exception)},J=function(){q=a('[data-region="competencyactions"]').data("competency"),o||(o=new k(n,q.competencyframeworkid),o.on("save",function(b,e){var g=e.competencyIds,h=[];a.each(g,function(a,b){h.push({methodname:"core_competency_add_related_competency",args:{competencyid:b,relatedcompetencyid:q.id}})}),h.push({methodname:"tool_lp_data_for_related_competencies_section",args:{competencyid:q.id}});var i=f.call(h);i[h.length-1].then(function(b){return c.render("tool_lp/related_competencies",b).done(function(b,d){a('[data-region="relatedcompetencies"]').replaceWith(b),c.runTemplateJS(d),U()})},d.exception)})),o.setDisallowedCompetencyIDs([q.id]),o.display()},K=function(b){b.preventDefault(),q=a('[data-region="competencyactions"]').data("competency"),p.setTargetCompetencyId(q.id),p.display()},L=function(a,b){var c={id:q.id,shortname:q.shortname,idnumber:q.idnumber,description:q.description,descriptionformat:q.descriptionformat,ruletype:b.ruletype,ruleoutcome:b.ruleoutcome,ruleconfig:b.ruleconfig},e=f.call([{methodname:"core_competency_update_competency",args:{competency:c}}]);e[0].then(function(a){a&&(q.ruletype=b.ruletype,q.ruleoutcome=b.ruleoutcome,q.ruleconfig=b.ruleconfig,X(q))},d.exception)},M=function(){var b=a('[data-region="competencyactions"]').data("competency"),c=f.call([{methodname:"core_competency_delete_competency",args:{id:b.id}},{methodname:"tool_lp_data_for_competencies_manage_page",args:{competencyframeworkid:b.competencyframeworkid,search:a('[data-region="filtercompetencies"] input').val()}}]);c[0].done(function(a){a===!1&&e.get_strings([{key:"competencycannotbedeleted",component:"tool_lp",param:b.shortname},{key:"cancel",component:"moodle"}]).done(function(a){d.alert(null,a[0])}).fail(d.exception)}).fail(d.exception),c[1].done(E).fail(d.exception)},N=function(){var b=a('[data-region="competencyactions"]').data("competency"),c="deletecompetency";t.hasRule(b.parentid)&&(c="deletecompetencyparenthasrule"),e.get_strings([{key:"confirm",component:"moodle"},{key:c,component:"tool_lp",param:b.shortname},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],M)}).fail(d.exception)},O=function(b){b.originalEvent.dataTransfer.setData("text",a(b.target).parent().data("id"))},P=function(a){a.originalEvent.dataTransfer.dropEffect="move",a.preventDefault()},Q=function(b){b.preventDefault(),a(this).addClass("currentdragtarget")},R=function(b){b.preventDefault(),a(this).removeClass("currentdragtarget")},S=function(b){b.preventDefault(),u=b.originalEvent.dataTransfer.getData("text"),v=a(b.target).parent().data("id"),a(this).removeClass("currentdragtarget"),z()},T=function(b){b.preventDefault();var e=this.id.substr(11),g=a('[data-region="competencyactions"]').data("competency"),h=f.call([{methodname:"core_competency_remove_related_competency",args:{relatedcompetencyid:e,competencyid:g.id}},{methodname:"tool_lp_data_for_related_competencies_section",args:{competencyid:g.id}}]);h[1].done(function(b){c.render("tool_lp/related_competencies",b).done(function(b){a('[data-region="relatedcompetencies"]').replaceWith(b),U()}).fail(d.exception)}).fail(d.exception)},U=function(){a('[data-action="deleterelation"]').on("click",T)},V=function(a){a.id!==w&&(w=a.id,f.call([{methodname:"core_competency_competency_viewed",args:{id:a.id}}]))},W=function(a){var b=r[a];return b||(b="competency"),b},X=function(b){var e=a.Deferred().resolve().promise(),g={};g.competency=b,g.showdeleterelatedaction=!0,g.showrelatedcompetencies=!0,g.showrule=!1,b.ruleoutcome!=l.NONE&&(e=l.getString(b.ruleoutcome).then(function(c){var d;return a.each(s,function(a,c){c.type==b.ruletype&&(d=c.name)}),[c,d]})),e.then(function(a){"undefined"!=typeof a&&(g.showrule=!0,g.rule={outcome:a[0],type:a[1]})}).then(function(){return c.render("tool_lp/competency_summary",g).then(function(b){a('[data-region="competencyinfo"]').html(b),a('[data-action="deleterelation"]').on("click",T)})}).then(function(){return c.render("tool_lp/loading",{})}).then(function(a,b){c.replaceNodeContents('[data-region="relatedcompetencies"]',a,b)}).done(function(){f.call([{methodname:"tool_lp_data_for_related_competencies_section",args:{competencyid:b.id},done:function(b){return c.render("tool_lp/related_competencies",b).done(function(b,d){a('[data-region="relatedcompetencies"]').replaceWith(b),c.runTemplateJS(d),U()})}}])}).fail(d.exception)},Y=function(a){return e.get_string("taxonomy_add_"+W(a),"tool_lp")},Z=function(a){return e.get_string("taxonomy_selected_"+W(a),"tool_lp")},$=function(b,c){var d=c.selected,e=a(d).data("id"),f=a('[data-region="competencyactions"] [data-action="add"]'),g=a('[data-region="competencyactionsmenu"]'),h=a('[data-region="selected-competency"]'),i=0,k=1;if(j.closeAll(),"undefined"==typeof e)a('[data-region="competencyinfo"]').html(d.clone().children().remove().end().text()),a('[data-region="competencyactions"]').data("competency",null),g.hide();else{var l=t.getCompetency(e);i=t.getCompetencyLevel(e),k=i+1,g.show(),a('[data-region="competencyactions"]').data("competency",l),X(l),V(l)}return Z(i).then(function(a){h.text(a)}),Y(k).then(function(a){f.show().find('[data-region="term"]').text(a)}),b.preventDefault(),!1},_=function(a){var b=a.split(",");return b.unshift(""),delete b[0],b};return{init:function(b,c,d,e){t=b,n=c,r=_(d),s=e,a('[data-region="competencyactions"] [data-action="add"]').on("click",x),j.enhance(".competencyactionsmenu",{'[data-action="edit"]':D,'[data-action="delete"]':N,'[data-action="move"]':C,'[data-action="moveup"]':G,'[data-action="movedown"]':H,'[data-action="linkedcourses"]':I,'[data-action="relatedcompetencies"]':J.bind(this),'[data-action="competencyrules"]':K.bind(this)}),a('[data-region="competencyactionsmenu"]').hide(),a('[data-region="competencyactions"] [data-action="add"]').hide(),a('[data-region="filtercompetencies"]').on("submit",F);var f=a('[data-region="managecompetencies"] [data-enhance="tree"]');f.on("dragstart","li>span",O).on("dragover","li>span",P).on("dragenter","li>span",Q).on("dragleave","li>span",R).on("drop","li>span",S),b.on("selectionchanged",$),p=new m(t,s),p.on("save",L.bind(this))}}});
  129. define('tool_lp/scalevalues', ["jquery","core/ajax"],function(a,b){var c=[];return{get_values:function(d){var e=a.Deferred();return"undefined"==typeof c[d]?b.call([{methodname:"core_competency_get_scale_values",args:{scaleid:d},done:function(a){c[d]=a,e.resolve(a)},fail:e.reject}]):e.resolve(c[d]),e.promise()}}});
  130. define('tool_lp/frameworkactions', ["jquery","core/templates","core/ajax","core/notification","core/str"],function(a,b,c,d,e){var f=0,g=0,h=function(c,d){a('[data-region="managecompetencies"]').replaceWith(c),b.runTemplateJS(d)},i=function(a){b.render("tool_lp/manage_competency_frameworks_page",a).done(h).fail(d.exception)},j=function(b){b.preventDefault(),g=a(this).attr("data-frameworkid");var e=c.call([{methodname:"core_competency_duplicate_competency_framework",args:{id:g}},{methodname:"tool_lp_data_for_competency_frameworks_manage_page",args:{pagecontext:{contextid:f}}}]);e[1].done(i).fail(d.exception)},k=function(){var a=c.call([{methodname:"core_competency_delete_competency_framework",args:{id:g}},{methodname:"tool_lp_data_for_competency_frameworks_manage_page",args:{pagecontext:{contextid:f}}}]);a[0].done(function(a){if(a===!1){var b=c.call([{methodname:"core_competency_read_competency_framework",args:{id:g}}]);b[0].done(function(a){e.get_strings([{key:"frameworkcannotbedeleted",component:"tool_lp",param:a.shortname},{key:"cancel",component:"moodle"}]).done(function(a){d.alert(null,a[0])}).fail(d.exception)})}}).fail(d.exception),a[1].done(i).fail(d.exception)},l=function(b){b.preventDefault();var f=a(this).attr("data-frameworkid");g=f;var h=c.call([{methodname:"core_competency_read_competency_framework",args:{id:g}}]);h[0].done(function(a){e.get_strings([{key:"confirm",component:"moodle"},{key:"deletecompetencyframework",component:"tool_lp",param:a.shortname},{key:"delete",component:"moodle"},{key:"cancel",component:"moodle"}]).done(function(a){d.confirm(a[0],a[1],a[2],a[3],k)}).fail(d.exception)}).fail(d.exception)};return{deleteHandler:l,duplicateHandler:j,init:function(a){f=a}}});
  131. define('tool_lp/actionselector', ["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","tool_lp/event_base"],function(a,b,c,d,e,f){var g=function(a,b,c,d,e){var g=this;f.prototype.constructor.apply(this,[]),g._title=a,g._message=b,g._actions=c,g._confirm=d,g._cancel=e,g._selectedValue=null,g._reset()};return g.prototype=Object.create(f.prototype),g.prototype._selectedValue=null,g.prototype._popup=null,g.prototype._title=null,g.prototype._message=null,g.prototype._actions=null,g.prototype._confirm=null,g.prototype._cancel=null,g.prototype._afterRender=function(){var b=this;b._find('[data-action="action-selector-confirm"]').attr("disabled","disabled"),b._find('[data-region="action-selector-radio-buttons"]').change(function(){b._selectedValue=a("input[type='radio']:checked").val(),b._find('[data-action="action-selector-confirm"]').removeAttr("disabled"),b._refresh.bind(b)}),b._find('[data-action="action-selector-cancel"]').click(function(a){a.preventDefault(),b.close()}),b._find('[data-action="action-selector-confirm"]').click(function(a){a.preventDefault(),b._selectedValue.length&&(b._trigger("save",{action:b._selectedValue}),b.close())})},g.prototype.close=function(){var a=this;a._popup.close(),a._reset()},g.prototype.display=function(){var a=this;return a._render().then(function(b){a._popup=new e(a._title,b,a._afterRender.bind(a))}).fail(b.exception)},g.prototype._find=function(b){return a(this._popup.getContent()).find(b)},g.prototype._refresh=function(){var a=this;return a._render().then(function(b){a._find('[data-region="action-selector"]').replaceWith(b),a._afterRender()})},g.prototype._render=function(){var a=this,b=[];for(var c in a._actions)b.push(a._actions[c]);var e={message:a._message,choices:b,confirm:a._confirm,cancel:a._cancel};return d.render("tool_lp/action_selector",e)},g.prototype._reset=function(){this._popup=null,this._selectedValue=""},g});
  132. define('tool_lp/form-cohort-selector', ["jquery","core/ajax","core/templates"],function(a,b,c){return{processResults:function(b,c){var d=[];return a.each(c,function(a,b){d.push({value:b.id,label:b._label})}),d},transport:function(d,e,f,g){var h,i=parseInt(a(d).data("contextid"),10),j=a(d).data("includes");h=b.call([{methodname:"tool_lp_search_cohorts",args:{query:e,context:{contextid:i},includes:j}}]),h[0].then(function(b){var d=[],e=0;return a.each(b.cohorts,function(a,b){d.push(c.render("tool_lp/form-cohort-selector-suggestion",b))}),a.when.apply(a.when,d).then(function(){var c=arguments;a.each(b.cohorts,function(a,b){b._label=c[e],e++}),f(b.cohorts)})},g)}}});
  133. define('tool_lp/user_competency_info', ["jquery","core/notification","core/ajax","core/templates"],function(a,b,c,d){var e=function(a,b,c,d,e,f){this._rootElement=a,this._competencyId=b,this._userId=c,this._planId=d,this._courseId=e,this._valid=!0,this._displayuser="undefined"!=typeof f&&f,this._planId?(this._methodName="tool_lp_data_for_user_competency_summary_in_plan",this._args={competencyid:this._competencyId,planid:this._planId},this._templateName="tool_lp/user_competency_summary_in_plan"):this._courseId?(this._methodName="tool_lp_data_for_user_competency_summary_in_course",this._args={userid:this._userId,competencyid:this._competencyId,courseid:this._courseId},this._templateName="tool_lp/user_competency_summary_in_course"):(this._methodName="tool_lp_data_for_user_competency_summary",this._args={userid:this._userId,competencyid:this._competencyId},this._templateName="tool_lp/user_competency_summary")};return e.prototype.reload=function(){var a=this,e=[];this._valid&&(e=c.call([{methodname:this._methodName,args:this._args}]),e[0].done(function(c){a._displayuser&&(c.displayuser=!0),d.render(a._templateName,c).done(function(b,c){d.replaceNode(a._rootElement,b,c)}).fail(b.exception)}).fail(b.exception))},e.prototype._rootElement=null,e.prototype._courseId=null,e.prototype._valid=null,e.prototype._planId=null,e.prototype._competencyId=null,e.prototype._userId=null,e.prototype._methodName=null,e.prototype._args=null,e.prototype._templateName=null,e.prototype._displayuser=!1,e});
  134. define('tool_lp/user_competency_course_navigation', ["jquery"],function(a){var b=function(b,c,d,e,f,g){this._baseUrl=d,this._userId=e+"",this._competencyId=f+"",this._courseId=g,a(b).on("change",this._userChanged.bind(this)),a(c).on("change",this._competencyChanged.bind(this))};return b.prototype._userChanged=function(b){var c=a(b.target).val(),d="?userid="+c+"&courseid="+this._courseId+"&competencyid="+this._competencyId;document.location=this._baseUrl+d},b.prototype._competencyChanged=function(b){var c=a(b.target).val(),d="?userid="+this._userId+"&courseid="+this._courseId+"&competencyid="+c;document.location=this._baseUrl+d},b.prototype._competencyId=null,b.prototype._userId=null,b.prototype._courseId=null,b.prototype._baseUrl=null,b.prototype._ignoreFirstCompetency=null,b});
  135. define('tool_lp/competencypicker', ["jquery","core/notification","core/ajax","core/templates","tool_lp/dialogue","core/str","tool_lp/tree"],function(a,b,c,d,e,f,g){var h=function(b,c,d,e){var f=this;f._eventNode=a("<div></div>"),f._frameworks=[],f._reset(),f._pageContextId=b,f._pageContextIncludes=d||"children",f._multiSelect="undefined"==typeof e||e===!0,c&&(f._frameworkId=c,f._singleFramework=!0)};return h.prototype._competencies=null,h.prototype._disallowedCompetencyIDs=null,h.prototype._eventNode=null,h.prototype._frameworks=null,h.prototype._frameworkId=null,h.prototype._pageContextId=null,h.prototype._pageContextIncludes=null,h.prototype._popup=null,h.prototype._searchText="",h.prototype._selectedCompetencies=null,h.prototype._singleFramework=!1,h.prototype._multiSelect=!0,h.prototype._onlyVisible=!0,h.prototype._afterRender=function(){var b=this,c=new g(b._find("[data-enhance=linktree]"),b._multiSelect);b._find("[data-enhance=linktree]").show(),c.on("selectionchanged",function(c,d){var e=d.selected;c.preventDefault();var f=[];a.each(e,function(c,d){var e=a(d).data("id"),g=!0;"undefined"==typeof e?g=!1:a.each(b._disallowedCompetencyIDs,function(a,b){b==e&&(g=!1)}),g&&f.push(e)}),b._selectedCompetencies=f,b._selectedCompetencies.length?b._find('[data-region="competencylinktree"] [data-action="add"]').removeAttr("disabled"):b._find('[data-region="competencylinktree"] [data-action="add"]').attr("disabled","disabled")}),b._singleFramework||b._find('[data-action="chooseframework"]').change(function(c){b._frameworkId=a(c.target).val(),b._loadCompetencies().then(b._refresh.bind(b))}),b._find('[data-region="filtercompetencies"] button').click(function(c){return c.preventDefault(),a(c.target).attr("disabled","disabled"),b._searchText=b._find('[data-region="filtercompetencies"] input').val()||"",b._refresh().always(function(){a(c.target).removeAttr("disabled")})}),b._find('[data-region="competencylinktree"] [data-action="cancel"]').click(function(a){a.preventDefault(),b.close()}),b._find('[data-region="competencylinktree"] [data-action="add"]').click(function(a){a.preventDefault(),b._selectedCompetencies.length&&(b._multiSelect?b._trigger("save",{competencyIds:b._selectedCompetencies}):b._trigger("save",{competencyId:b._selectedCompetencies[0]}),b.close())});var d=b._selectedCompetencies.slice(0);a.each(d,function(a,d){var e=b._find("[data-id="+d+"]");e.length&&(c.toggleItem(e),c.updateFocus(e))})},h.prototype.close=function(){var a=this;a._popup.close(),a._reset()},h.prototype.display=function(){var a=this;return a._render().then(function(b){return f.get_string("competencypicker","tool_lp").then(function(c){a._popup=new e(c,b,a._afterRender.bind(a))})}).fail(b.exception)},h.prototype._fetchCompetencies=function(a,d){var e=this;return c.call([{methodname:"core_competency_search_competencies",args:{searchtext:d,competencyframeworkid:a}}])[0].done(function(a){function b(a,c){for(var d=0;d<c.length;d++)c[d].parentid==a.id&&(a.haschildren=!0,c[d].children=[],c[d].haschildren=!1,a.children[a.children.length]=c[d],b(c[d],c))}var c,d,f=[];for(c=0;c<a.length;c++)d=a[c],"0"==d.parentid&&(d.children=[],d.haschildren=0,f[f.length]=d,b(d,a));e._competencies=f}).fail(b.exception)},h.prototype._find=function(b){return a(this._popup.getContent()).find(b)},h.prototype._getFramework=function(b){var c;return a.each(this._frameworks,function(a,d){if(d.id==b)return void(c=d)}),c},h.prototype._loadCompetencies=function(){return this._fetchCompetencies(this._frameworkId,this._searchText)},h.prototype._loadFrameworks=function(){var d,e=this;return e._frameworks.length>0?a.when():(d=e._singleFramework?c.call([{methodname:"core_competency_read_competency_framework",args:{id:this._frameworkId}}])[0].then(function(a){return[a]}):c.call([{methodname:"core_competency_list_competency_frameworks",args:{sort:"shortname",context:{contextid:e._pageContextId},includes:e._pageContextIncludes,onlyvisible:e._onlyVisible}}])[0],d.done(function(a){e._frameworks=a}).fail(b.exception))},h.prototype.on=function(a,b){this._eventNode.on(a,b)},h.prototype._preRender=function(){var b=this;return b._loadFrameworks().then(function(){return!b._frameworkId&&b._frameworks.length>0&&(b._frameworkId=b._frameworks[0].id),b._frameworkId?b._loadCompetencies():(b._frameworks=[],a.when())})},h.prototype._refresh=function(){var a=this;return a._render().then(function(b){a._find('[data-region="competencylinktree"]').replaceWith(b),a._afterRender()})},h.prototype._render=function(){var b=this;return b._preRender().then(function(){b._singleFramework||a.each(b._frameworks,function(a,c){c.id==b._frameworkId?c.selected=!0:c.selected=!1});var c={competencies:b._competencies,framework:b._getFramework(b._frameworkId),frameworks:b._frameworks,search:b._searchText,singleFramework:b._singleFramework};return d.render("tool_lp/competency_picker",c)})},h.prototype._reset=function(){this._competencies=[],this._disallowedCompetencyIDs=[],this._popup=null,this._searchText="",this._selectedCompetencies=[]},h.prototype.setDisallowedCompetencyIDs=function(a){this._disallowedCompetencyIDs=a},h.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])},h});
  136. define('tool_lp/tree', ["jquery","core/url","core/log"],function(a,b,c){var d=a('<img alt="" src="'+b.imageUrl("t/expanded")+'"/>'),e=a('<img alt="" src="'+b.imageUrl("t/collapsed")+'"/>'),f=function(b,c){this.treeRoot=a(b),this.multiSelect="undefined"==typeof c||c===!0,this.items=this.treeRoot.find("li"),this.expandAll=this.items.length<20,this.parents=this.treeRoot.find("li:has(ul)"),c&&this.treeRoot.attr("aria-multiselectable","true"),this.items.attr("aria-selected","false"),this.visibleItems=null,this.activeItem=null,this.lastActiveItem=null,this.keys={tab:9,enter:13,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,eight:56,asterisk:106},this.init(),this.bindEventHandlers()};return f.prototype.init=function(){this.parents.attr("aria-expanded","true"),this.parents.prepend(d.clone()),this.items.attr("role","tree-item"),this.items.attr("tabindex","-1"),this.parents.attr("role","group"),this.treeRoot.attr("role","tree"),this.visibleItems=this.treeRoot.find("li");var b=this;this.expandAll||(this.parents.each(function(){b.collapseGroup(a(this))}),this.expandGroup(this.parents.first()))},f.prototype.expandGroup=function(a){var b=a.children("ul");b.show().attr("aria-hidden","false"),a.attr("aria-expanded","true"),a.children("img").attr("src",d.attr("src")),this.visibleItems=this.treeRoot.find("li:visible")},f.prototype.collapseGroup=function(a){var b=a.children("ul");b.hide().attr("aria-hidden","true"),a.attr("aria-expanded","false"),a.children("img").attr("src",e.attr("src")),this.visibleItems=this.treeRoot.find("li:visible")},f.prototype.toggleGroup=function(a){"true"==a.attr("aria-expanded")?this.collapseGroup(a):this.expandGroup(a)},f.prototype.triggerChange=function(){var a=this.items.filter("[aria-selected=true]");this.multiSelect||(a=a.first()),this.treeRoot.trigger("selectionchanged",{selected:a})},f.prototype.multiSelectItem=function(b){if(this.multiSelect){if(null!==this.lastActiveItem){for(var c=this.visibleItems.index(this.lastActiveItem),d=this.visibleItems.index(this.activeItem),e=null;c<d;)e=a(this.visibleItems.get(c)),e.attr("aria-selected","true"),c++;for(;c>d;)e=a(this.visibleItems.get(c)),e.attr("aria-selected","true"),c--}}else this.items.attr("aria-selected","false");b.attr("aria-selected","true"),this.triggerChange()},f.prototype.selectItem=function(a){for(var b=a.parent();"tree"!=b.attr("role");)b=b.parent(),"false"==b.attr("aria-expanded")&&this.expandGroup(b),b=b.parent();this.items.attr("aria-selected","false"),a.attr("aria-selected","true"),this.triggerChange()},f.prototype.toggleItem=function(a){if(!this.multiSelect)return void this.selectItem(a);var b=a.attr("aria-selected");b="true"===b?"false":"true",a.attr("aria-selected",b),this.triggerChange()},f.prototype.updateFocus=function(a){this.lastActiveItem=this.activeItem,this.activeItem=a;for(var b=a.parent();"tree"!=b.attr("role");)b=b.parent(),"false"==b.attr("aria-expanded")&&this.expandGroup(b),b=b.parent();this.items.attr("tabindex","-1"),a.attr("tabindex",0)},f.prototype.handleKeyDown=function(b,c){var d=this.visibleItems.index(b),e=null,f=c.shiftKey||c.ctrlKey||c.metaKey||c.altKey,g=this;switch(c.keyCode){case this.keys.home:return e=this.parents.first(),e.focus(),c.shiftKey?this.multiSelectItem(e):f||this.selectItem(e),c.stopPropagation(),!1;case this.keys.end:return e=this.visibleItems.last(),e.focus(),c.shiftKey?this.multiSelectItem(e):f||this.selectItem(e),c.stopPropagation(),!1;case this.keys.enter:case this.keys.space:return c.shiftKey?this.multiSelectItem(b):c.metaKey||c.ctrlKey?this.toggleItem(b):this.selectItem(b),c.stopPropagation(),!1;case this.keys.left:if(b.has("ul")&&"true"==b.attr("aria-expanded"))this.collapseGroup(b);else{var h=b.parent(),i=h.parent();i.is("li")&&(i.focus(),c.shiftKey?this.multiSelectItem(i):f||this.selectItem(i))}return c.stopPropagation(),!1;case this.keys.right:return b.has("ul")&&"false"==b.attr("aria-expanded")?this.expandGroup(b):(e=b.children("ul").children("li").first(),e.length>0&&(e.focus(),c.shiftKey?this.multiSelectItem(e):f||this.selectItem(e))),c.stopPropagation(),!1;case this.keys.up:if(d>0){var j=this.visibleItems.eq(d-1);j.focus(),c.shiftKey?this.multiSelectItem(j):f||this.selectItem(j)}return c.stopPropagation(),!1;case this.keys.down:if(d<this.visibleItems.length-1){var k=this.visibleItems.eq(d+1);k.focus(),c.shiftKey?this.multiSelectItem(k):f||this.selectItem(k)}return c.stopPropagation(),!1;case this.keys.asterisk:return this.parents.each(function(){g.expandGroup(a(this))}),c.stopPropagation(),!1;case this.keys.eight:return c.shiftKey&&(this.parents.each(function(){g.expandGroup(a(this))}),c.stopPropagation()),!1}return!0},f.prototype.handleKeyPress=function(a,b){if(b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)return!0;switch(b.keyCode){case this.keys.tab:return!0;case this.keys.enter:case this.keys.home:case this.keys.end:case this.keys.left:case this.keys.right:case this.keys.up:case this.keys.down:return b.stopPropagation(),!1;default:var c=String.fromCharCode(b.which),d=!1,e=this.visibleItems.index(a),f=this.visibleItems.length,g=e+1;for(g==f&&(g=0);g!=e;){var h=this.visibleItems.eq(g),i=h.text().charAt(0);if(h.has("ul")&&(i=h.find("span").text().charAt(0)),i.toLowerCase()==c){d=!0;break}g+=1,g==f&&(g=0)}return d===!0&&this.updateFocus(this.visibleItems.eq(g)),b.stopPropagation(),!1}return!0},f.prototype.on=function(a,b){"selectionchanged"!==a?c.warning('Invalid custom event name for tree. Only "selectionchanged" is supported.'):this.treeRoot.on(a,b)},f.prototype.handleDblClick=function(a,b){return!!(b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)||(this.updateFocus(a),this.toggleGroup(a),b.stopPropagation(),!1)},f.prototype.handleExpandCollapseClick=function(a,b){return this.toggleGroup(a),b.stopPropagation(),!1},f.prototype.handleClick=function(a,b){return b.shiftKey?this.multiSelectItem(a):b.metaKey||b.ctrlKey?this.toggleItem(a):this.selectItem(a),this.updateFocus(a),b.stopPropagation(),!1},f.prototype.handleBlur=function(){return!0},f.prototype.handleFocus=function(a){return this.updateFocus(a),!0},f.prototype.bindEventHandlers=function(){var b=this;this.parents.dblclick(function(c){return b.handleDblClick(a(this),c)}),this.items.click(function(c){return b.handleClick(a(this),c)}),this.items.children("img").click(function(c){return b.handleExpandCollapseClick(a(this).parent(),c)}),this.items.keydown(function(c){return b.handleKeyDown(a(this),c)}),this.items.keypress(function(c){return b.handleKeyPress(a(this),c)}),this.items.focus(function(c){return b.handleFocus(a(this),c)}),this.items.blur(function(c){return b.handleBlur(a(this),c)})},f});
  137. define('tool_lp/competency_outcomes', ["jquery","core/str"],function(a,b){var c=0,d=1,e=2,f=3;return{NONE:c,EVIDENCE:d,COMPLETE:e,RECOMMEND:f,getAll:function(){var a=this;return b.get_strings([{key:"competencyoutcome_none",component:"tool_lp"},{key:"competencyoutcome_evidence",component:"tool_lp"},{key:"competencyoutcome_recommend",component:"tool_lp"},{key:"competencyoutcome_complete",component:"tool_lp"}]).then(function(b){var c={};return c[a.NONE]={code:a.NONE,name:b[0]},c[a.EVIDENCE]={code:a.EVIDENCE,name:b[1]},c[a.RECOMMEND]={code:a.RECOMMEND,name:b[2]},c[a.COMPLETE]={code:a.COMPLETE,name:b[3]},c})},getString:function(b){var c=this,d=c.getAll();return d.then(function(c){return"undefined"==typeof c[b]?a.Deferred().reject().promise():c[b].name})}}});
  138. define('tool_lp/user_competency_plan_popup', ["jquery","core/notification","core/str","core/ajax","core/templates","tool_lp/dialogue"],function(a,b,c,d,e,f){var g=function(b,c,d){this._regionSelector=b,this._userCompetencySelector=c,this._planId=d,a(this._regionSelector).on("click",this._userCompetencySelector,this._handleClick.bind(this))};return g.prototype._handleClick=function(c){c.preventDefault();var e=a(c.target).closest("tr"),f=a(e).data("competencyid"),g=a(e).data("userid"),h=this._planId,i=d.call([{methodname:"tool_lp_data_for_user_competency_summary_in_plan",args:{competencyid:f,planid:h},done:this._contextLoaded.bind(this),fail:b.exception}]);i[0].then(function(a){var c="core_competency_user_competency_viewed_in_plan";a.plan.iscompleted&&(c="core_competency_user_competency_plan_viewed"),d.call([{methodname:c,args:{competencyid:f,userid:g,planid:h},fail:b.exception}])})},g.prototype._contextLoaded=function(a){var d=this;e.render("tool_lp/user_competency_summary_in_plan",a).done(function(a,g){c.get_string("usercompetencysummary","report_competency").done(function(b){new f(b,a,e.runTemplateJS.bind(e,g),d._refresh.bind(d),(!0))}).fail(b.exception)}).fail(b.exception)},g.prototype._refresh=function(){var a=this._planId;d.call([{methodname:"tool_lp_data_for_plan_page",args:{planid:a},done:this._pageContextLoaded.bind(this),fail:b.exception}])},g.prototype._pageContextLoaded=function(a){var c=this;e.render("tool_lp/plan_page",a).done(function(a,b){e.replaceNode(c._regionSelector,a,b)}).fail(b.exception)},g.prototype._regionSelector=null,g.prototype._userCompetencySelector=null,g.prototype._planId=null,g});
  139. define('tool_lp/dialogue', ["core/yui"],function(a){var b=function(b,c,d,e,f){this.yuiDialogue=null;var g=this;"undefined"==typeof f&&(f=!1),a.use("moodle-core-notification","timers",function(){var h="480px";f&&(h="800px"),g.yuiDialogue=new M.core.dialogue({headerContent:b,bodyContent:c,draggable:!0,visible:!1,center:!0,modal:!0,width:h}),g.yuiDialogue.after("visibleChange",function(b){b.newVal?"undefined"!=typeof d&&a.soon(function(){d(g),g.yuiDialogue.centerDialogue()}):"undefined"!=typeof e&&a.soon(function(){e(g)})}),g.yuiDialogue.show()})};return b.prototype.close=function(){this.yuiDialogue.hide(),this.yuiDialogue.destroy()},b.prototype.getContent=function(){return this.yuiDialogue.bodyNode.getDOMNode()},b});
  140. define('tool_lp/competency_rule', ["jquery"],function(a){var b=function(b){this._eventNode=a("<div>"),this._ready=a.Deferred(),this._tree=b};return b.prototype._competency=null,b.prototype._eventNode=null,b.prototype._ready=null,b.prototype._tree=null,b.prototype.canConfig=function(){return this._tree.hasChildren(this._competency.id)},b.prototype.getConfig=function(){return null},b.prototype.getType=function(){throw new Error("Not implemented")},b.prototype.init=function(){return this._load()},b.prototype.injectTemplate=function(){return a.Deferred().reject().promise()},b.prototype.isValid=function(){return!1},b.prototype._load=function(){return a.when()},b.prototype.on=function(a,b){this._eventNode.on(a,b)},b.prototype.setTargetCompetency=function(a){this._competency=a},b.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])},b.prototype._triggerChange=function(){this._trigger("change",this)},b});
  141. define('tool_lp/event_base', ["jquery"],function(a){var b=function(){this._eventNode=a("<div></div>")};return b.prototype._eventNode=null,b.prototype.on=function(a,b){this._eventNode.on(a,b)},b.prototype._trigger=function(a,b){this._eventNode.trigger(a,[b])},b});
  142. define('tool_templatelibrary/display', ["jquery","core/ajax","core/log","core/notification","core/templates","core/config","core/str"],function(a,b,c,d,e,f,g){var h=function(a,b){if(!a)return!1;var c="@template "+b,d=0,e=[];if(e=a.match(/{{!([\s\S]*?)}}/g),null!==e)for(d=0;d<e.length;d++){var f=e[d],g=f.indexOf(c);if(g!==-1){var h=g+c.length+1;return f=f.substr(h,f.length-2-h)}}return!1},i=function(b,f,i){g.get_string("templateselected","tool_templatelibrary",b).done(function(b){a('[data-region="displaytemplateheader"]').text(b)}).fail(d.exception);var j=h(f,b);j===!1&&(j=h(i,b)),j&&(f=j),a('[data-region="displaytemplatesource"]').text(f);var k=f.match(/Example context \(json\):([\s\S]*)/),l=!1;if(k){var m=k[1].trim();try{l=a.parseJSON(m)}catch(n){c.debug("Could not parse json example context for template."),c.debug(n)}}l?e.render(b,l).done(function(b,c){e.replaceNodeContents(a('[data-region="displaytemplateexample"]'),b,c)}).fail(d.exception):g.get_string("templatehasnoexample","tool_templatelibrary").done(function(b){a('[data-region="displaytemplateexample"]').text(b)}).fail(d.exception)},j=function(c){var e=c.split("/"),g=e.shift(),h=e.shift(),j=b.call([{methodname:"core_output_load_template",args:{component:g,template:h,themename:f.theme}},{methodname:"tool_templatelibrary_load_canonical_template",args:{component:g,template:h}}],!0,!1);a.when.apply(a,j).done(function(a,b){i(c,a,b)}).fail(d.exception)};return a('[data-region="list-templates"]').on("click","[data-templatename]",function(b){var c=a(this).data("templatename");b.preventDefault(),j(c)}),{}});
  143. define('tool_templatelibrary/search', ["jquery","core/ajax","core/log","core/notification","core/templates","core/config"],function(a,b,c,d,e,f){var g=function(b){e.render("tool_templatelibrary/search_results",{templates:b}).done(function(b,c){e.replaceNode(a('[data-region="searchresults"]'),b,c)}).fail(d.exception)},h=function(c){var e=a('[data-field="component"]').val(),f=a('[data-field="search"]').val();document.location.hash=f,b.call([{methodname:"tool_templatelibrary_list_templates",args:{component:e,search:f,themename:c},done:g,fail:d.exception}],!0,!1)},i=null,j=function(a,b){null!==i&&window.clearTimeout(i),i=window.setTimeout(function(){a(),i=null},b)},k=function(){j(h.bind(this,f.theme),400)};return a('[data-region="list-templates"]').on("change",'[data-field="component"]',k),a('[data-region="list-templates"]').on("input",'[data-field="search"]',k),a('[data-field="search"]').val(document.location.hash.replace("#","")),h(f.theme),{}});
  144. define('tool_usertours/managesteps', ["jquery","core/str","core/notification"],function(a,b,c){var d={removeStep:function(d){d.preventDefault(),b.get_strings([{key:"confirmstepremovaltitle",component:"tool_usertours"},{key:"confirmstepremovalquestion",component:"tool_usertours"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).done(function(b){c.confirm(b[0],b[1],b[2],b[3],a.proxy(function(){window.location=a(this).attr("href")},d.currentTarget))})},setup:function(){a("body").delegate('[data-action="delete"]',"click",d.removeStep)}};return{setup:d.setup}});
  145. define('tool_usertours/usertours', ["core/ajax","tool_usertours/tour","jquery","core/templates","core/str","core/log","core/notification"],function(a,b,c,d,e,f,g){var h={tourId:null,currentTour:null,context:null,init:function(a,b,d){h.tourId=a,h.context=d,"undefined"==typeof b&&(b=!0),b&&h.fetchTour(a),h.addResetLink(),c("body").on("click",'[data-action="tool_usertours/resetpagetour"]',function(a){a.preventDefault(),h.resetTourState(h.tourId)})},fetchTour:function(b){c.when(a.call([{methodname:"tool_usertours_fetch_and_start_tour",args:{tourid:b,context:h.context,pageurl:window.location.href}}])[0],d.render("tool_usertours/tourstep",{})).then(function(a,c){h.startBootstrapTour(b,c[0],a.tourconfig)}).fail(g.exception)},addResetLink:function(){e.get_string("resettouronpage","tool_usertours").done(function(a){c("footer, .logininfo").last().append('<div class="usertour"><a href="#" data-action="tool_usertours/resetpagetour">'+a+"</a></div>")})},startBootstrapTour:function(a,c,d){h.currentTour&&(d.onEnd=null,h.currentTour.endTour(),delete h.currentTour),d.eventHandlers={afterEnd:[h.markTourComplete],afterRender:[h.markStepShown]},d.tourName=d.name,delete d.name,d.template=c,d.steps=d.steps.map(function(a){return"undefined"!=typeof a.element&&(a.target=a.element,delete a.element),"undefined"!=typeof a.reflex&&(a.moveOnClick=!!a.reflex,delete a.reflex),"undefined"!=typeof a.content&&(a.body=a.content,delete a.content),a}),h.currentTour=new b(d),h.currentTour.startTour()},markStepShown:function(){var b=this.getStepConfig(this.getCurrentStepNumber());c.when(a.call([{methodname:"tool_usertours_step_shown",args:{tourid:h.tourId,context:h.context,pageurl:window.location.href,stepid:b.stepid,stepindex:this.getCurrentStepNumber()}}])[0]).fail(f.error)},markTourComplete:function(){var b=this.getStepConfig(this.getCurrentStepNumber());c.when(a.call([{methodname:"tool_usertours_complete_tour",args:{tourid:h.tourId,context:h.context,pageurl:window.location.href,stepid:b.stepid,stepindex:this.getCurrentStepNumber()}}])[0]).fail(f.error)},resetTourState:function(b){c.when(a.call([{methodname:"tool_usertours_reset_tour",args:{tourid:b,context:h.context,pageurl:window.location.href}}])[0]).then(function(a){a.startTour&&h.fetchTour(a.startTour)}).fail(g.exception)}};return{init:h.init,resetTourState:h.resetTourState}});
  146. !function(a,b){"function"==typeof define&&define.amd?define('tool_usertours/tour', ["jquery","./popper"],function(c,d){return a.Tour=b(c,d)}):"object"==typeof exports?module.exports=b(require("jquery"),require("popper.js")):a.Tour=b($,Popper)}(this,function(a,b){"use strict";function c(a){this.init(a)}var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a};return c.prototype.tourName,c.prototype.storageKey,c.prototype.storage,c.prototype.originalConfiguration,c.prototype.listeners,c.prototype.eventHandlers,c.prototype.steps,c.prototype.currentStepNode,c.prototype.currentStepNumber,c.prototype.currentStepPopper,c.prototype.currentStepConfig,c.prototype.templateContent,c.prototype.init=function(a){this.eventHandlers={},this.reset(),this.originalConfiguration=a||{},this.configure.apply(this,arguments);try{this.storage=window.sessionStorage,this.storageKey="tourstate_"+this.tourName}catch(b){this.storage=!1,this.storageKey=""}return this},c.prototype.reset=function(){return this.hide(),this.eventHandlers=[],this.resetStepListeners(),this.originalConfiguration={},this.steps=[],this.currentStepNumber=0,this},c.prototype.configure=function(a){var b=this;return"object"===("undefined"==typeof a?"undefined":d(a))&&("undefined"!=typeof a.tourName&&(this.tourName=a.tourName),a.eventHandlers&&!function(){var c=void 0;for(c in a.eventHandlers)a.eventHandlers[c].forEach(function(a){this.addEventHandler(c,a)},b)}(),this.resetStepDefaults(!0),"object"===d(a.steps)&&(this.steps=a.steps),"undefined"!=typeof a.template&&(this.templateContent=a.template)),this.checkMinimumRequirements(),this},c.prototype.checkMinimumRequirements=function(){if(!this.tourName)throw new Error("Tour Name required");if(!this.steps||!this.steps.length)throw new Error("Steps must be specified")},c.prototype.resetStepDefaults=function(a){return"undefined"==typeof a&&(a=!0),this.stepDefaults={},a&&"undefined"!=typeof this.originalConfiguration.stepDefaults?this.setStepDefaults(this.originalConfiguration.stepDefaults):this.setStepDefaults({}),this},c.prototype.setStepDefaults=function(b){return this.stepDefaults||(this.stepDefaults={}),a.extend(this.stepDefaults,{element:"",placement:"top",delay:0,moveOnClick:!1,moveAfterTime:0,orphan:!1,direction:1},b),this},c.prototype.getCurrentStepNumber=function(){return parseInt(this.currentStepNumber,10)},c.prototype.setCurrentStepNumber=function(a){if(this.currentStepNumber=a,this.storage)try{this.storage.setItem(this.storageKey,a)}catch(b){b.code===DOMException.QUOTA_EXCEEDED_ERR&&this.storage.removeItem(this.storageKey)}},c.prototype.getNextStepNumber=function(a){"undefined"==typeof a&&(a=this.getCurrentStepNumber());for(var b=a+1;b<=this.steps.length;){if(this.isStepPotentiallyVisible(this.getStepConfig(b)))return b;b++}return null},c.prototype.getPreviousStepNumber=function(a){"undefined"==typeof a&&(a=this.getCurrentStepNumber());for(var b=a-1;b>=0;){if(this.isStepPotentiallyVisible(this.getStepConfig(b)))return b;b--}return null},c.prototype.isLastStep=function(a){var b=this.getNextStepNumber(a);return null===b},c.prototype.isFirstStep=function(a){var b=this.getPreviousStepNumber(a);return null===b},c.prototype.isStepPotentiallyVisible=function(a){return!!a&&(!!this.isStepActuallyVisible(a)||(!("undefined"==typeof a.orphan||!a.orphan)||!("undefined"==typeof a.delay||!a.delay)))},c.prototype.isStepActuallyVisible=function(a){if(!a)return!1;var b=this.getStepTarget(a);return!!(b&&b.length&&b.is(":visible"))&&!!b.length},c.prototype.next=function(){return this.gotoStep(this.getNextStepNumber())},c.prototype.previous=function(){return this.gotoStep(this.getPreviousStepNumber(),-1)},c.prototype.gotoStep=function(a,b){if(a<0)return this.endTour();var c=this.getStepConfig(a);return null===c?this.endTour():this._gotoStep(c,b)},c.prototype._gotoStep=function(a,b){if(!a)return this.endTour();if("undefined"!=typeof a.delay&&a.delay&&!a.delayed)return a.delayed=!0,window.setTimeout(this._gotoStep.bind(this),a.delay,a,b),this;if(!a.orphan&&!this.isStepActuallyVisible(a)){var c=b==-1?"getPreviousStepNumber":"getNextStepNumber";return this.gotoStep(this[c](a.stepNumber),b)}return this.hide(),this.fireEventHandlers("beforeRender",a),this.renderStep(a),this.fireEventHandlers("afterRender",a),this},c.prototype.getStepConfig=function(b){if(null===b||b<0||b>=this.steps.length)return null;var c=this.normalizeStepConfig(this.steps[b]);return c=a.extend(c,{stepNumber:b})},c.prototype.normalizeStepConfig=function(b){return"undefined"!=typeof b.reflex&&"undefined"==typeof b.moveAfterClick&&(b.moveAfterClick=b.reflex),"undefined"!=typeof b.element&&"undefined"==typeof b.target&&(b.target=b.element),"undefined"!=typeof b.content&&"undefined"==typeof b.body&&(b.body=b.content),b=a.extend({},this.stepDefaults,b),b=a.extend({},{attachTo:b.target,attachPoint:"after"},b),b.attachTo&&(b.attachTo=a(b.attachTo).first()),b},c.prototype.getStepTarget=function(b){return b.target?a(b.target):null},c.prototype.fireEventHandlers=function(a,b){return"undefined"==typeof this.eventHandlers[a]?this:(this.eventHandlers[a].forEach(function(a){a.call(this,b)},this),this)},c.prototype.addEventHandler=function(a,b){return"undefined"==typeof this.eventHandlers[a]&&(this.eventHandlers[a]=[]),this.eventHandlers[a].push(b),this},c.prototype.processStepListeners=function(b){if(this.listeners.push({node:this.currentStepNode,args:["click",'[data-role="next"]',a.proxy(this.next,this)]},{node:this.currentStepNode,args:["click",'[data-role="previous"]',a.proxy(this.previous,this)]},{node:this.currentStepNode,args:["click",'[data-role="end"]',a.proxy(this.endTour,this)]},{node:a("body"),args:["keydown",a.proxy(this.handleKeyDown,this)]}),b.moveOnClick){var c=this.getStepTarget(b);this.listeners.push({node:c,args:["click",a.proxy(function(b){0===a(b.target).parents('[data-flexitour="container"]').length&&window.setTimeout(a.proxy(this.next,this),500)},this)]})}return this.listeners.forEach(function(a){a.node.on.apply(a.node,a.args)}),this},c.prototype.resetStepListeners=function(){return this.listeners&&this.listeners.forEach(function(a){a.node.off.apply(a.node,a.args)}),this.listeners=[],this},c.prototype.renderStep=function(b){this.currentStepConfig=b,this.setCurrentStepNumber(b.stepNumber);var c=a(this.getTemplateContent());return c.find('[data-placeholder="title"]').html(b.title),c.find('[data-placeholder="body"]').html(b.body),this.isFirstStep(b.stepNumber)?c.find('[data-role="previous"]').prop("disabled",!0):c.find('[data-role="previous"]').prop("disabled",!1),this.isLastStep(b.stepNumber)?c.find('[data-role="next"]').prop("disabled",!0):c.find('[data-role="next"]').prop("disabled",!1),c.find('[data-role="previous"]').attr("role","button"),c.find('[data-role="next"]').attr("role","button"),c.find('[data-role="end"]').attr("role","button"),b.template=c,this.addStepToPage(b),this.processStepListeners(b),this},c.prototype.getTemplateContent=function(){return a(this.templateContent).clone()},c.prototype.addStepToPage=function(c){var d=(c.template,a('<span data-flexitour="container"></span>').html(c.template).hide()),e=a("body, html").stop(!0,!0);if(this.isStepActuallyVisible(c)){var f=this.getStepTarget(c);f.data("flexitour","target");var g=this.calculateZIndex(f);g&&(c.zIndex=g+1),c.zIndex&&d.css("zIndex",c.zIndex+1),this.positionBackdrop(c),"append"===c.attachPoint?(c.attachTo.append(d),this.currentStepNode=d):this.currentStepNode=d.insertAfter(c.attachTo),this.currentStepNode.css({top:0,left:0}),e.animate({scrollTop:this.calculateScrollTop(c)}).promise().then(function(){this.positionStep(c),this.revealStep(c)}.bind(this))}else c.orphan&&(c.isOrphan=!0,c.attachTo=a("body").first(),c.attachPoint="append",this.positionBackdrop(c),d.addClass("orphan"),c.attachTo.append(d),this.currentStepNode=d,this.currentStepNode.offset(this.calculateStepPositionInPage()),this.currentStepNode.css("position","fixed"),this.currentStepPopper=new b(a("body"),this.currentStepNode[0],{removeOnDestroy:!0,placement:c.placement+"-start",arrowElement:'[data-role="arrow"]',modifiers:{hide:{enabled:!1},applyStyle:{onLoad:null,enabled:!1}}}),this.revealStep(c));return this},c.prototype.revealStep=function(b){return this.currentStepNode.fadeIn("",a.proxy(function(){this.announceStep(b),this.currentStepNode.focus(),window.setTimeout(a.proxy(function(){this.currentStepNode&&this.currentStepNode.focus()},this),100)},this)),this},c.prototype.announceStep=function(a){var b="tour-step-"+this.tourName+"-"+a.stepNumber;this.currentStepNode.attr("id",b);var c=this.currentStepNode.find('[data-placeholder="body"]').first();c.attr("id",b+"-body"),c.attr("role","document");var d=this.currentStepNode.find('[data-placeholder="title"]').first();d.attr("id",b+"-title"),d.attr("aria-labelledby",b+"-body"),this.currentStepNode.attr("role","dialog"),this.currentStepNode.attr("tabindex",0),this.currentStepNode.attr("aria-labelledby",b+"-title"),this.currentStepNode.attr("aria-describedby",b+"-body");var e=this.getStepTarget(a);return e&&(e.attr("tabindex")||e.attr("tabindex",0),e.data("original-describedby",e.attr("aria-describedby")).attr("aria-describedby",b+"-body")),this.accessibilityShow(a),this},c.prototype.handleKeyDown=function(b){var c="a[href], link[href], [draggable=true], [contenteditable=true], :input:enabled, [tabindex], button";switch(b.keyCode){case 27:this.endTour();break;case 9:(function(){if(this.currentStepConfig.hasBackdrop){var d=a(document.activeElement),e=this.getStepTarget(this.currentStepConfig),f=a(c),g=void 0;f.filter(function(a,b){if(d.is(b))return g=a,!1});var h=void 0,i=void 0,j=void 0;if(g){var k=1;b.shiftKey&&(k=-1),h=g;do h+=k,i=a(f[h]);while(i.length&&i.is(":disabled")||i.is(":hidden"));i.length?(j=i.closest(e).length,j=j||i.closest(this.currentStepNode).length):j=!1}j?i.focus():b.shiftKey?this.currentStepNode.find(c).last().focus():this.currentStepConfig.isOrphan?this.currentStepNode.focus():e.focus(),b.preventDefault()}}).call(this)}},c.prototype.startTour=function(a){if(this.storage&&"undefined"==typeof a){var b=this.storage.getItem(this.storageKey);if(b){var c=parseInt(b,10);c<=this.steps.length&&(a=c)}}return"undefined"==typeof a&&(a=this.getCurrentStepNumber()),this.fireEventHandlers("beforeStart",a),this.gotoStep(a),this.fireEventHandlers("afterStart",a),this},c.prototype.restartTour=function(){return this.startTour(0)},c.prototype.endTour=function(){if(this.fireEventHandlers("beforeEnd"),this.currentStepConfig){var a=this.getStepTarget(this.currentStepConfig);a&&(a.attr("tabindex")||a.attr("tabindex","-1"),a.focus())}return this.hide(!0),this.fireEventHandlers("afterEnd"),this},c.prototype.hide=function(b){if(this.fireEventHandlers("beforeHide"),this.currentStepNode&&this.currentStepNode.length&&(this.currentStepNode.hide(),this.currentStepPopper&&this.currentStepPopper.destroy()),this.currentStepConfig){var c=this.getStepTarget(this.currentStepConfig);c&&(c.data("original-labelledby")&&c.attr("aria-labelledby",c.data("original-labelledby")),c.data("original-describedby")&&c.attr("aria-describedby",c.data("original-describedby")),c.data("original-tabindex")&&c.attr("tabindex",c.data("tabindex"))),this.currentStepConfig=null}var d=0;return b&&(d=400),a('[data-flexitour="step-background"]').remove(),a('[data-flexitour="step-backdrop"]').removeAttr("data-flexitour"),a('[data-flexitour="backdrop"]').fadeOut(d,function(){a(this).remove()}),this.resetStepListeners(),this.accessibilityHide(),this.fireEventHandlers("afterHide"),this.currentStepNode=null,this.currentStepPopper=null,this},c.prototype.show=function(){var a=this.getCurrentStepNumber();return this.gotoStep(a)},c.prototype.getStepContainer=function(){return a(this.currentStepNode)},c.prototype.calculateScrollTop=function(b){var c=a(window).scrollTop(),d=a(window).height(),e=this.getStepTarget(b);return c="top"===b.placement?e.offset().top-d/2:"bottom"===b.placement?e.offset().top+e.height()-d/2:e.height()<=.8*d?e.offset().top-(d-e.height())/2:e.offset().top-.2*d,c=Math.max(0,c),c=Math.min(a(document).height()-d,c),Math.ceil(c)},c.prototype.calculateStepPositionInPage=function(){var b=a(window).height(),c=this.currentStepNode.height(),d=a(window).width(),e=this.currentStepNode.width();return{top:Math.ceil((b-c)/2),left:Math.ceil((d-e)/2)}},c.prototype.positionStep=function(c){var d=this.currentStepNode;if(!d||!d.length)return this;var e=void 0;switch(c.placement){case"left":e=["left","right","top","bottom"];break;case"right":e=["right","left","top","bottom"];break;case"top":e=["top","bottom","right","left"];break;case"bottom":e=["bottom","top","right","left"];break;default:e="flip"}var f=this.getStepTarget(c),g={placement:c.placement+"-start",removeOnDestroy:!0,modifiers:{flip:{behaviour:e},arrow:{element:'[data-role="arrow"]'}}},h=f.closest("section");h.length&&(g.boundariesElement=h[0]);var i=a('[data-flexitour="step-background"]');return i.length&&(f=i),this.currentStepPopper=new b(f,d[0],g),this},c.prototype.positionBackdrop=function(b){if(b.backdrop){this.currentStepConfig.hasBackdrop=!0;var c=a('<div data-flexitour="backdrop"></div>');if(b.zIndex?"append"===b.attachPoint?b.attachTo.append(c):c.insertAfter(b.attachTo):a("body").append(c),this.isStepActuallyVisible(b)){var d=a('<div data-flexitour="step-background"></div>'),e=this.getStepTarget(b),f=10,g=e;f&&(g=a("body")),d.css({width:e.outerWidth()+f+f,height:e.outerHeight()+f+f,left:e.offset().left-f,top:e.offset().top-f,backgroundColor:this.calculateInherittedBackgroundColor(g)}),e.offset().left<f&&d.css({width:e.outerWidth()+e.offset().left+f,left:e.offset().left}),e.offset().top<f&&d.css({height:e.outerHeight()+e.offset().top+f,top:e.offset().top});var h=e.css("borderRadius");h&&h!==a("body").css("borderRadius")&&d.css("borderRadius",h);var i=this.calculatePosition(e);"fixed"===i&&d.css("top",0);var j=d.clone();j.css({backgroundColor:c.css("backgroundColor"),opacity:c.css("opacity")}),j.attr("data-flexitour","step-background-fader"),b.zIndex?"append"===b.attachPoint?b.attachTo.append(d):(j.insertAfter(b.attachTo),d.insertAfter(b.attachTo)):(a("body").append(j),a("body").append(d)),e.attr("data-flexitour","step-backdrop"),b.zIndex&&(c.css("zIndex",b.zIndex),d.css("zIndex",b.zIndex+1),e.css("zIndex",b.zIndex+2)),j.fadeOut("2000",function(){a(this).remove()})}}return this},c.prototype.calculateZIndex=function(b){for(b=a(b);b.length&&b[0]!==document;){var c=b.css("position");if("absolute"===c||"relative"===c||"fixed"===c){var d=parseInt(b.css("zIndex"),10);if(!isNaN(d)&&0!==d)return d}b=b.parent()}return 0},c.prototype.calculateInherittedBackgroundColor=function(b){var c=a("<div>").hide();a("body").append(c);var d=c.css("backgroundColor");for(c.remove(),b=a(b);b.length&&b[0]!==document;){var e=b.css("backgroundColor");if(e!==d)return e;b=b.parent()}return null},c.prototype.calculatePosition=function(b){for(b=a(b);b.length&&b[0]!==document;){var c=b.css("position");if("static"!==c)return c;b=b.parent()}return null},c.prototype.accessibilityShow=function(){var b="data-has-hidden",c="aria-hidden",d=function(a){var d=a.data("flexitour");if(d)switch(d){case"container":case"target":return}var e=a.attr(c);e||(a.attr(b,!0),a.attr(c,!0))};this.currentStepNode.siblings().each(function(b,c){d(a(c))}),this.currentStepNode.parentsUntil("body").siblings().each(function(b,c){d(a(c))})},c.prototype.accessibilityHide=function(){var b="data-has-hidden",c="aria-hidden",d=function(a){var d=a.attr(b);"undefined"!=typeof d&&(a.removeAttr(b),a.removeAttr(c))};a("["+b+"]").each(function(b,c){d(a(c))})},"object"===("undefined"==typeof exports?"undefined":d(exports))&&(module.exports=c),c});
  147. define('tool_usertours/managetours', ["jquery","core/ajax","core/str","core/notification"],function(a,b,c,d){var e={removeTour:function(b){b.preventDefault(),c.get_strings([{key:"confirmtourremovaltitle",component:"tool_usertours"},{key:"confirmtourremovalquestion",component:"tool_usertours"},{key:"yes",component:"moodle"},{key:"no",component:"moodle"}]).done(function(c){d.confirm(c[0],c[1],c[2],c[3],a.proxy(function(){window.location=a(this).attr("href")},b.currentTarget))})},setup:function(){a("body").delegate('[data-action="delete"]',"click",e.removeTour)}};return{setup:e.setup}});
  148. !function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define('tool_usertours/popper', b):a.Popper=b()}(this,function(){"use strict";function a(a,b,c){var d=a.filter(function(a){return a[b]===c})[0];return a.indexOf(d)}function b(a){var b=a.offsetParent;return b&&"BODY"!==b.nodeName?b:window.document.documentElement}function c(a,b){if(1!==a.nodeType)return[];var c=window.getComputedStyle(a,null);return c[b]}function d(a){return a.parentNode||a.host}function e(a){return a===window.document?window.document.body.scrollTop?window.document.body:window.document.documentElement:["scroll","auto"].indexOf(c(a,"overflow"))!==-1||["scroll","auto"].indexOf(c(a,"overflow-x"))!==-1||["scroll","auto"].indexOf(c(a,"overflow-y"))!==-1?a===window.document.body?e(d(a)):a:d(a)?e(d(a)):a}function f(a){var b={width:a.offsetWidth,height:a.offsetHeight,left:a.offsetLeft,top:a.offsetTop};return b.right=b.left+b.width,b.bottom=b.top+b.height,b}function g(a,c,d,g){var h={};if("window"===g){var i=window.document.body,j=window.document.documentElement,k=Math.max(i.scrollHeight,i.offsetHeight,j.clientHeight,j.scrollHeight,j.offsetHeight),l=Math.max(i.scrollWidth,i.offsetWidth,j.clientWidth,j.scrollWidth,j.offsetWidth);h={top:0,right:l,bottom:k,left:0}}else if("viewport"===g){var m=b(a),n=e(a),o=f(m),p="fixed"===c.offsets.popper.position?0:n.scrollTop,q="fixed"===c.offsets.popper.position?0:n.scrollLeft;h={top:0-(o.top-p),right:window.document.documentElement.clientWidth-(o.left-q),bottom:window.document.documentElement.clientHeight-(o.top-p),left:0-(o.left-q)}}else h=b(a)===g?{top:0,left:0,right:g.clientWidth,bottom:g.clientHeight}:f(g);return h.left+=d,h.right-=d,h.top=h.top+d,h.bottom=h.bottom-d,h}function h(a){var b=a.getBoundingClientRect();return{left:b.left,top:b.top,right:b.right,bottom:b.bottom,width:b.right-b.left,height:b.bottom-b.top}}function i(a,b,c,d){var f=h(a),g=h(b);if(c&&!d){var i=e(b);g.top+=i.scrollTop,g.bottom+=i.scrollTop,g.left+=i.scrollLeft,g.right+=i.scrollLeft}var j={top:f.top-g.top,left:f.left-g.left,bottom:f.top-g.top+f.height,right:f.left-g.left+f.width,width:f.width,height:f.height};return j}function j(a){var b=a.style.display,c=a.style.visibility;a.style.display="block",a.style.visibility="hidden";var d=window.getComputedStyle(a),e=parseFloat(d.marginTop)+parseFloat(d.marginBottom),f=parseFloat(d.marginLeft)+parseFloat(d.marginRight),g={width:a.offsetWidth+f,height:a.offsetHeight+e};return a.style.display=b,a.style.visibility=c,g}function k(a){return Object.assign({},a,{right:a.left+a.width,bottom:a.top+a.height})}function l(a){return a!==window.document.body&&("fixed"===c(a,"position")||(d(a)?l(d(a)):a))}function m(a,c){var d=b(c),e=l(d);return e?"fixed":"absolute"}function n(a){for(var b=["","ms","webkit","moz","o"],c=0;c<b.length;c++){var d=b[c]?b[c]+a.charAt(0).toUpperCase()+a.slice(1):a;if("undefined"!=typeof window.document.body.style[d])return d}return null}function o(a){var b={};return a&&"[object Function]"===b.toString.call(a)}function p(a,b,c){return!!a.filter(function(a){return a.name===c||(a.name===b,!1)}).length}function q(a){return""!==a&&!isNaN(parseFloat(a))&&isFinite(a)}function r(a){return a!==window.document.body&&("none"!==c(a,"transform")||(d(a)?r(d(a)):a))}function s(b,c,d,e){var f=void 0===e?b:b.slice(0,a(b,"name",e));return f.forEach(function(a){a.enabled&&o(a["function"])&&(d=a["function"](d,a))}),d}function t(a,b){Object.keys(b).forEach(function(c){var d="";["width","height","top","right","bottom","left"].indexOf(c)!==-1&&q(b[c])&&(d="px"),a.style[c]=b[c]+d})}function u(a,c,d,e){e=e.split("-")[0];var f={};f.position=a.position;var g="fixed"===f.position,h=a.isParentTransformed,k=b(g&&h?d:c),l=i(d,k,g,h),m=j(c);return["right","left"].indexOf(e)!==-1?(f.top=l.top+l.height/2-m.height/2,"left"===e?f.left=l.left-m.width:f.left=l.right):(f.left=l.left+l.width/2-m.width/2,"top"===e?f.top=l.top-m.height:f.top=l.bottom),f.width=m.width,f.height=m.height,{popper:f,reference:l}}function v(a,b,c,d){if(c.updateBound=d,window.addEventListener("resize",c.updateBound,{passive:!0}),"window"!==b.boundariesElement){var f=e(a);f!==window.document.body&&f!==window.document.documentElement||(f=window),f.addEventListener("scroll",c.updateBound,{passive:!0})}}function w(a,b,c){if(window.removeEventListener("resize",b.updateBound),"window"!==c.boundariesElement){var d=e(a);d!==window.document.body&&d!==window.document.documentElement||(d=window),d.removeEventListener("scroll",b.updateBound)}return b.updateBound=null,b}function x(a,b){return a.order<b.order?-1:a.order>b.order?1:0}function y(a){var b={position:a.offsets.popper.position},c=Math.round(a.offsets.popper.left),d=Math.round(a.offsets.popper.top),e=n("transform");return a.instance.options.gpuAcceleration&&e?(b[e]="translate3d("+c+"px, "+d+"px, 0)",b.top=0,b.left=0):(b.left=c,b.top=d),Object.assign(b,a.styles),t(a.instance.popper,b),a.instance.popper.setAttribute("x-placement",a.placement),a.offsets.arrow&&t(a.arrowElement,a.offsets.arrow),a}function z(a,b,c){b.setAttribute("x-placement",c.placement)}function A(a,b){var c=b.element;if("string"==typeof c&&(c=a.instance.popper.querySelector(c)),!c)return a;if(!a.instance.popper.contains(c))return console.warn("WARNING: `arrowElement` must be child of its popper element!"),a;if(!p(a.instance.modifiers,"arrow","keepTogether"))return console.warn("WARNING: keepTogether modifier is required by arrow modifier in order to work, be sure to include it before arrow!"),a;var d={},e=a.placement.split("-")[0],f=k(a.offsets.popper),g=a.offsets.reference,h=["left","right"].indexOf(e)!==-1,i=h?"height":"width",l=h?"top":"left",m=h?"left":"top",n=h?"bottom":"right",o=j(c)[i];g[n]-o<f[l]&&(a.offsets.popper[l]-=f[l]-(g[n]-o)),g[l]+o>f[n]&&(a.offsets.popper[l]+=g[l]+o-f[n]);var q=g[l]+g[i]/2-o/2,r=q-k(a.offsets.popper)[l];return r=Math.max(Math.min(f[i]-o,r),0),d[l]=r,d[m]="",a.offsets.arrow=d,a.arrowElement=c,a}function B(a){var b={left:"right",right:"left",bottom:"top",top:"bottom"};return a.replace(/left|right|bottom|top/g,function(a){return b[a]})}function C(a){return"end"===a?"start":"start"===a?"end":a}function D(a,b){if(!p(a.instance.modifiers,"flip","preventOverflow"))return console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!"),a;if(a.flipped&&a.placement===a.originalPlacement)return a;var c=a.placement.split("-")[0],d=B(c),e=a.placement.split("-")[1]||"",f=[];return f="flip"===b.behavior?[c,d]:b.behavior,f.forEach(function(g,h){if(c!==g||f.length===h+1)return a;c=a.placement.split("-")[0],d=B(c);var i=k(a.offsets.popper),j=["right","bottom"].indexOf(c)!==-1,l=["top","bottom"].indexOf(c)!==-1,m=j&&Math.floor(a.offsets.reference[c])>Math.floor(i[d])||!j&&Math.floor(a.offsets.reference[c])<Math.floor(i[d]),n=b.flipVariations&&(l&&"start"===e&&Math.floor(i.left)<Math.floor(a.boundaries.left)||l&&"end"===e&&Math.floor(i.right)>Math.floor(a.boundaries.right)||!l&&"start"===e&&Math.floor(i.top)<Math.floor(a.boundaries.top)||!l&&"end"===e&&Math.floor(i.bottom)>Math.floor(a.boundaries.bottom));(m||n)&&(a.flipped=!0,m&&(c=f[h+1]),n&&(e=C(e)),a.placement=c+(e?"-"+e:""),a.offsets.popper=u(a.instance.state,a.instance.popper,a.instance.reference,a.placement).popper,a=s(a.instance.modifiers,a.instance.options,a,"flip"))}),a}function E(a){var b=k(a.offsets.popper),c=a.offsets.reference,d=Math.floor,e=a.placement.split("-")[0];return["top","bottom"].indexOf(e)!==-1?(b.right<d(c.left)&&(a.offsets.popper.left=d(c.left)-b.width),b.left>d(c.right)&&(a.offsets.popper.left=d(c.right))):(b.bottom<d(c.top)&&(a.offsets.popper.top=d(c.top)-b.height),b.top>d(c.bottom)&&(a.offsets.popper.top=d(c.bottom))),a}function F(a,b){var c=a.placement,d=a.offsets.popper,e=void 0;return q(b.offset)?e=[b.offset,0]:(e=b.offset.split(" "),e=e.map(function(b,d){var e=b.match(/(\d*\.?\d*)(.*)/),f=+e[1],g=e[2],h=c.indexOf("right")!==-1||c.indexOf("left")!==-1;if(1===d&&(h=!h),"%"===g||"%r"===g){var i=k(a.offsets.reference),j=void 0;return j=h?i.height:i.width,j/100*f}if("%p"===g){var l=k(a.offsets.popper),m=void 0;return m=h?l.height:l.width,m/100*f}if("vh"===g||"vw"===g){var n=void 0;return n="vh"===g?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0),n/100*f}return"px"===g?+f:+b})),a.placement.indexOf("left")!==-1?(d.top+=e[0],d.left-=e[1]||0):a.placement.indexOf("right")!==-1?(d.top+=e[0],d.left+=e[1]||0):a.placement.indexOf("top")!==-1?(d.left+=e[0],d.top-=e[1]||0):a.placement.indexOf("bottom")!==-1&&(d.left+=e[0],d.top+=e[1]||0),a}function G(a,b){function c(c){if(!b.moveWithTarget)return!1;var d=a.originalPlacement.split("-")[0];return!!(a.flipped&&d===c||d===B(c))||d!==c&&d!==B(c)}var d=b.priority,e=k(a.offsets.popper),f={left:function g(){var g=e.left;return e.left<a.boundaries.left&&!c("left")&&(g=Math.max(e.left,a.boundaries.left)),{left:g}},right:function(){var b=e.left;return e.right>a.boundaries.right&&!c("right")&&(b=Math.min(e.left,a.boundaries.right-e.width)),{left:b}},top:function h(){var h=e.top;return e.top<a.boundaries.top&&!c("top")&&(h=Math.max(e.top,a.boundaries.top)),{top:h}},bottom:function(){var b=e.top;return e.bottom>a.boundaries.bottom&&!c("bottom")&&(b=Math.min(e.top,a.boundaries.bottom-e.height)),{top:b}}};return d.forEach(function(b){a.offsets.popper=Object.assign(e,f[b]())}),a}function H(a){var b=a.placement,c=b.split("-")[0],d=b.split("-")[1];if(d){var e=a.offsets.reference,f=k(a.offsets.popper),g={y:{start:{top:e.top},end:{top:e.top+e.height-f.height}},x:{start:{left:e.left},end:{left:e.left+e.width-f.width}}},h=["bottom","top"].indexOf(c)!==-1?"x":"y";a.offsets.popper=Object.assign(f,g[h][d])}return a}function I(a){var b=a.offsets.reference,c=a.boundaries;return b.bottom<c.top||b.left>c.right||b.top>c.bottom||b.right<c.left?(a.hide=!0,a.instance.popper.setAttribute("x-out-of-boundaries","")):(a.hide=!1,a.instance.popper.removeAttribute("x-out-of-boundaries")),a}if(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(a){if(void 0===a||null===a)throw new TypeError("Cannot convert first argument to object");for(var b=Object(a),c=1;c<arguments.length;c++){var d=arguments[c];if(void 0!==d&&null!==d){d=Object(d);for(var e=Object.keys(d),f=0,g=e.length;f<g;f++){var h=e[f],i=Object.getOwnPropertyDescriptor(d,h);void 0!==i&&i.enumerable&&(b[h]=d[h])}}}return b}}),!window.requestAnimationFrame){for(var J=0,K=["ms","moz","webkit","o"],L=0;L<K.length&&!window.requestAnimationFrame;++L)window.requestAnimationFrame=window[K[L]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[K[L]+"CancelAnimationFrame"]||window[K[L]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-J)),d=window.setTimeout(function(){a(b+c)},c);return J=b+c,d}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)})}var M={findIndex:a,getBoundaries:g,getBoundingClientRect:h,getOffsetParent:b,getOffsetRectRelativeToCustomParent:i,getOuterSizes:j,getPopperClientRect:k,getPosition:m,getScrollParent:e,getStyleComputedProperty:c,getSupportedPropertyName:n,isFixed:l,isFunction:o,isModifierRequired:p,isNumeric:q,isTransformed:r,runModifiers:s,setStyle:t},N={applyStyle:y,arrow:A,flip:D,keepTogether:E,offset:F,preventOverflow:G,shift:H,hide:I},O={applyStyleOnLoad:z},P=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},Q=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),R={placement:"bottom",gpuAcceleration:!0,boundariesElement:"viewport",boundariesPadding:5,modifiers:{shift:{order:100,enabled:!0,"function":N.shift},offset:{order:200,enabled:!0,"function":N.offset,offset:0},preventOverflow:{order:300,enabled:!0,"function":N.preventOverflow,priority:["left","right","top","bottom"]},keepTogether:{order:400,enabled:!0,"function":N.keepTogether},arrow:{order:500,enabled:!0,"function":N.arrow,element:"[x-arrow]"},flip:{order:600,enabled:!0,"function":N.flip,behavior:"flip"},hide:{order:700,enabled:!0,"function":N.hide},applyStyle:{order:800,enabled:!0,"function":N.applyStyle,onLoad:O.applyStyleOnLoad}}},S=function(){function a(b,c){var d=this,e=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return P(this,a),this.Defaults=R,this.state={isDestroyed:!1},this.reference=b.jquery?b[0]:b,this.popper=c.jquery?c[0]:c,this.options=Object.assign({},R,e),this.modifiers=Object.keys(R.modifiers).map(function(a){return Object.assign({name:a},R.modifiers[a])}),this.modifiers=this.modifiers.map(function(a){var b=e.modifiers&&e.modifiers[a.name]||{},c=Object.assign({},a,b);return c}),e.modifiers&&Object.keys(e.modifiers).forEach(function(a){if(void 0===R.modifiers[a]){var b=e.modifiers[a];b.name=a,d.modifiers.push(b)}}),this.modifiers=this.modifiers.sort(x),this.modifiers.forEach(function(a){a.enabled&&o(a.onLoad)&&a.onLoad(d.reference,d.popper,d.options)}),this.state.position=m(this.popper,this.reference),this.state.isParentTransformed=r(this.popper.parentNode),this.update(!0),v(this.reference,this.options,this.state,function(){return d.update()}),this}return Q(a,[{key:"update",value:function(a){var b=this,c={instance:this,styles:{}};this.state.position=m(this.popper,this.reference),t(this.popper,{position:this.state.position}),window.requestAnimationFrame(function(){if(!b.state.isDestroyed){var d=window.performance.now();if(d-b.state.lastFrame<=16)return b.update();b.state.lastFrame=d,c.placement=b.options.placement,c.originalPlacement=b.options.placement,c.offsets=u(b.state,b.popper,b.reference,c.placement),c.boundaries=g(b.popper,c,b.options.boundariesPadding,b.options.boundariesElement),c=s(b.modifiers,b.options,c),a&&o(b.state.createCalback)?b.state.createCalback(c):!a&&o(b.state.updateCallback)&&b.state.updateCallback(c)}})}},{key:"onCreate",value:function(a){return this.state.createCalback=a,this}},{key:"onUpdate",value:function(a){return this.state.updateCallback=a,this}},{key:"destroy",value:function(){return this.state.isDestroyed=!0,this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[n("transform")]="",this.state=w(this.reference,this.state,this.options),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}}]),a}();return S.Utils=M,S});
  149. define('theme_boost/form-display-errors', ["jquery","core/event"],function(a,b){return{enhance:function(c){var d=document.getElementById(c);a(d).on(b.Events.FORM_FIELD_VALIDATION,function(b,c){b.preventDefault();var e=a(d).closest(".form-group"),f=e.find(".form-control-feedback");"TEXTAREA"==a(d).prop("tagName")&&e.find("[contenteditable]")&&(d=e.find("[contenteditable]")),""!==c?(e.addClass("has-danger"),e.data("client-validation-error",!0),a(d).addClass("form-control-danger"),a(d).attr("aria-describedby",f.attr("id")),a(d).attr("aria-invalid",!0),f.attr("tabindex",0),f.html(c),f.is(":visible")||(f.show(),f.focus())):e.data("client-validation-error")===!0&&(e.removeClass("has-danger"),e.data("client-validation-error",!1),a(d).removeClass("form-control-danger"),a(d).removeAttr("aria-describedby"),a(d).attr("aria-invalid",!1),f.hide())})}}});
  150. define('theme_boost/tooltip', ["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=function(a){if(void 0===window.Tether)throw new Error("Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)");var b="tooltip",c="4.0.0-alpha.4",h="bs.tooltip",i="."+h,j=a.fn[b],k=150,l="bs-tether",m={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[]},n={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array"},o={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},p={IN:"in",OUT:"out"},q={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,INSERTED:"inserted"+i,CLICK:"click"+i,FOCUSIN:"focusin"+i,FOCUSOUT:"focusout"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i},r={FADE:"fade",IN:"in"},s={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},t={element:!1,enabled:!1},u={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},v=function(){function j(a,b){d(this,j),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._tether=null,this.element=a,this.config=this._getConfig(b),this.tip=null,this._setListeners()}return g(j,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(b){if(b){var c=this.constructor.DATA_KEY,d=a(b.currentTarget).data(c);d||(d=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(c,d)),d._activeTrigger.click=!d._activeTrigger.click,d._isWithActiveTrigger()?d._enter(null,d):d._leave(null,d)}else{if(a(this.getTipElement()).hasClass(r.IN))return void this._leave(null,this);this._enter(null,this)}}},{key:"dispose",value:function(){clearTimeout(this._timeout),this.cleanupTether(),a.removeData(this.element,this.constructor.DATA_KEY),a(this.element).off(this.constructor.EVENT_KEY),this.tip&&a(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null}},{key:"show",value:function(){var b=this,c=a.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){a(this.element).trigger(c);var d=a.contains(this.element.ownerDocument.documentElement,this.element);if(c.isDefaultPrevented()||!d)return;var f=this.getTipElement(),g=e["default"].getUID(this.constructor.NAME);f.setAttribute("id",g),this.element.setAttribute("aria-describedby",g),this.setContent(),this.config.animation&&a(f).addClass(r.FADE);var h="function"==typeof this.config.placement?this.config.placement.call(this,f,this.element):this.config.placement,i=this._getAttachment(h);a(f).data(this.constructor.DATA_KEY,this).appendTo(document.body),a(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({attachment:i,element:f,target:this.element,classes:t,classPrefix:l,offset:this.config.offset,constraints:this.config.constraints,addTargetClasses:!1}),e["default"].reflow(f),this._tether.position(),a(f).addClass(r.IN);var k=function(){var c=b._hoverState;b._hoverState=null,a(b.element).trigger(b.constructor.Event.SHOWN),c===p.OUT&&b._leave(null,b)};if(e["default"].supportsTransitionEnd()&&a(this.tip).hasClass(r.FADE))return void a(this.tip).one(e["default"].TRANSITION_END,k).emulateTransitionEnd(j._TRANSITION_DURATION);k()}}},{key:"hide",value:function(b){var c=this,d=this.getTipElement(),f=a.Event(this.constructor.Event.HIDE),g=function(){c._hoverState!==p.IN&&d.parentNode&&d.parentNode.removeChild(d),c.element.removeAttribute("aria-describedby"),a(c.element).trigger(c.constructor.Event.HIDDEN),c.cleanupTether(),b&&b()};a(this.element).trigger(f),f.isDefaultPrevented()||(a(d).removeClass(r.IN),e["default"].supportsTransitionEnd()&&a(this.tip).hasClass(r.FADE)?a(d).one(e["default"].TRANSITION_END,g).emulateTransitionEnd(k):g(),this._hoverState="")}},{key:"isWithContent",value:function(){return Boolean(this.getTitle())}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=a(this.getTipElement());this.setElementContent(b.find(s.TOOLTIP_INNER),this.getTitle()),b.removeClass(r.FADE).removeClass(r.IN),this.cleanupTether()}},{key:"setElementContent",value:function(b,c){var d=this.config.html;"object"===("undefined"==typeof c?"undefined":f(c))&&(c.nodeType||c.jquery)?d?a(c).parent().is(b)||b.empty().append(c):b.text(a(c).text()):b[d?"html":"text"](c)}},{key:"getTitle",value:function(){var a=this.element.getAttribute("data-original-title");return a||(a="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),a}},{key:"cleanupTether",value:function(){this._tether&&this._tether.destroy()}},{key:"_getAttachment",value:function(a){return o[a.toUpperCase()]}},{key:"_setListeners",value:function(){var b=this,c=this.config.trigger.split(" ");c.forEach(function(c){if("click"===c)a(b.element).on(b.constructor.Event.CLICK,b.config.selector,a.proxy(b.toggle,b));else if(c!==u.MANUAL){var d=c===u.HOVER?b.constructor.Event.MOUSEENTER:b.constructor.Event.FOCUSIN,e=c===u.HOVER?b.constructor.Event.MOUSELEAVE:b.constructor.Event.FOCUSOUT;a(b.element).on(d,b.config.selector,a.proxy(b._enter,b)).on(e,b.config.selector,a.proxy(b._leave,b))}}),this.config.selector?this.config=a.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()}},{key:"_fixTitle",value:function(){var a=f(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==a)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))}},{key:"_enter",value:function(b,c){var d=this.constructor.DATA_KEY;return c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusin"===b.type?u.FOCUS:u.HOVER]=!0),a(c.getTipElement()).hasClass(r.IN)||c._hoverState===p.IN?void(c._hoverState=p.IN):(clearTimeout(c._timeout),c._hoverState=p.IN,c.config.delay&&c.config.delay.show?void(c._timeout=setTimeout(function(){c._hoverState===p.IN&&c.show()},c.config.delay.show)):void c.show())}},{key:"_leave",value:function(b,c){var d=this.constructor.DATA_KEY;if(c=c||a(b.currentTarget).data(d),c||(c=new this.constructor(b.currentTarget,this._getDelegateConfig()),a(b.currentTarget).data(d,c)),b&&(c._activeTrigger["focusout"===b.type?u.FOCUS:u.HOVER]=!1),!c._isWithActiveTrigger())return clearTimeout(c._timeout),c._hoverState=p.OUT,c.config.delay&&c.config.delay.hide?void(c._timeout=setTimeout(function(){c._hoverState===p.OUT&&c.hide()},c.config.delay.hide)):void c.hide()}},{key:"_isWithActiveTrigger",value:function(){for(var a in this._activeTrigger)if(this._activeTrigger[a])return!0;return!1}},{key:"_getConfig",value:function(c){return c=a.extend({},this.constructor.Default,a(this.element).data(),c),c.delay&&"number"==typeof c.delay&&(c.delay={show:c.delay,hide:c.delay}),e["default"].typeCheckConfig(b,c,this.constructor.DefaultType),c}},{key:"_getDelegateConfig",value:function(){var a={};if(this.config)for(var b in this.config)this.constructor.Default[b]!==this.config[b]&&(a[b]=this.config[b]);return a}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(h),d="object"===("undefined"==typeof b?"undefined":f(b))?b:null;if((c||!/destroy|hide/.test(b))&&(c||(c=new j(this,d),a(this).data(h,c)),"string"==typeof b)){if(void 0===c[b])throw new Error('No method named "'+b+'"');c[b]()}})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return m}},{key:"NAME",get:function(){return b}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return q}},{key:"EVENT_KEY",get:function(){return i}},{key:"DefaultType",get:function(){return n}}]),j}();return a.fn[b]=v._jQueryInterface,a.fn[b].Constructor=v,a.fn[b].noConflict=function(){return a.fn[b]=j,v._jQueryInterface},v}(jQuery);a["default"]=h});
  151. define('theme_boost/scrollspy', ["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=function(a){var b="scrollspy",c="4.0.0-alpha.4",h="bs.scrollspy",i="."+h,j=".data-api",k=a.fn[b],l={offset:10,method:"auto",target:""},m={offset:"number",method:"string",target:"(string|element)"},n={ACTIVATE:"activate"+i,SCROLL:"scroll"+i,LOAD_DATA_API:"load"+i+j},o={DROPDOWN_ITEM:"dropdown-item",DROPDOWN_MENU:"dropdown-menu",NAV_LINK:"nav-link",NAV:"nav",ACTIVE:"active"},p={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",LIST_ITEM:".list-item",LI:"li",LI_DROPDOWN:"li.dropdown",NAV_LINKS:".nav-link",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},q={OFFSET:"offset",POSITION:"position"},r=function(){function j(b,c){d(this,j),this._element=b,this._scrollElement="BODY"===b.tagName?window:b,this._config=this._getConfig(c),this._selector=this._config.target+" "+p.NAV_LINKS+","+(this._config.target+" "+p.DROPDOWN_ITEMS),this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,a(this._scrollElement).on(n.SCROLL,a.proxy(this._process,this)),this.refresh(),this._process()}return g(j,[{key:"refresh",value:function(){var b=this,c=this._scrollElement!==this._scrollElement.window?q.POSITION:q.OFFSET,d="auto"===this._config.method?c:this._config.method,f=d===q.POSITION?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight();var g=a.makeArray(a(this._selector));g.map(function(b){var c=void 0,g=e["default"].getSelectorFromElement(b);return g&&(c=a(g)[0]),c&&(c.offsetWidth||c.offsetHeight)?[a(c)[d]().top+f,g]:null}).filter(function(a){return a}).sort(function(a,b){return a[0]-b[0]}).forEach(function(a){b._offsets.push(a[0]),b._targets.push(a[1])})}},{key:"dispose",value:function(){a.removeData(this._element,h),a(this._scrollElement).off(i),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null}},{key:"_getConfig",value:function(c){if(c=a.extend({},l,c),"string"!=typeof c.target){var d=a(c.target).attr("id");d||(d=e["default"].getUID(b),a(c.target).attr("id",d)),c.target="#"+d}return e["default"].typeCheckConfig(b,c,m),c}},{key:"_getScrollTop",value:function(){return this._scrollElement===window?this._scrollElement.scrollY:this._scrollElement.scrollTop}},{key:"_getScrollHeight",value:function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}},{key:"_process",value:function(){var a=this._getScrollTop()+this._config.offset,b=this._getScrollHeight(),c=this._config.offset+b-this._scrollElement.offsetHeight;if(this._scrollHeight!==b&&this.refresh(),a>=c){var d=this._targets[this._targets.length-1];this._activeTarget!==d&&this._activate(d)}if(this._activeTarget&&a<this._offsets[0])return this._activeTarget=null,void this._clear();for(var e=this._offsets.length;e--;){var f=this._activeTarget!==this._targets[e]&&a>=this._offsets[e]&&(void 0===this._offsets[e+1]||a<this._offsets[e+1]);f&&this._activate(this._targets[e])}}},{key:"_activate",value:function(b){this._activeTarget=b,this._clear();var c=this._selector.split(",");c=c.map(function(a){return a+'[data-target="'+b+'"],'+(a+'[href="'+b+'"]')});var d=a(c.join(","));d.hasClass(o.DROPDOWN_ITEM)?(d.closest(p.DROPDOWN).find(p.DROPDOWN_TOGGLE).addClass(o.ACTIVE),d.addClass(o.ACTIVE)):d.parents(p.LI).find(p.NAV_LINKS).addClass(o.ACTIVE),a(this._scrollElement).trigger(n.ACTIVATE,{relatedTarget:b})}},{key:"_clear",value:function(){a(this._selector).filter(p.ACTIVE).removeClass(o.ACTIVE)}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(h),d="object"===("undefined"==typeof b?"undefined":f(b))&&b||null;if(c||(c=new j(this,d),a(this).data(h,c)),"string"==typeof b){if(void 0===c[b])throw new Error('No method named "'+b+'"');c[b]()}})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return l}}]),j}();return a(window).on(n.LOAD_DATA_API,function(){for(var b=a.makeArray(a(p.DATA_SPY)),c=b.length;c--;){var d=a(b[c]);r._jQueryInterface.call(d,d.data())}}),a.fn[b]=r._jQueryInterface,a.fn[b].Constructor=r,a.fn[b].noConflict=function(){return a.fn[b]=k,r._jQueryInterface},r}(jQuery);a["default"]=h});
  152. define('theme_boost/dropdown', ["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=function(a){var b="dropdown",c="4.0.0-alpha.4",g="bs.dropdown",h="."+g,i=".data-api",j=a.fn[b],k=27,l=38,m=40,n=3,o={HIDE:"hide"+h,HIDDEN:"hidden"+h,SHOW:"show"+h,SHOWN:"shown"+h,CLICK:"click"+h,CLICK_DATA_API:"click"+h+i,KEYDOWN_DATA_API:"keydown"+h+i},p={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",OPEN:"open"},q={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},r=function(){function b(a){d(this,b),this._element=a,this._addEventListeners()}return f(b,[{key:"toggle",value:function(){if(this.disabled||a(this).hasClass(p.DISABLED))return!1;var c=b._getParentFromElement(this),d=a(c).hasClass(p.OPEN);if(b._clearMenus(),d)return!1;if("ontouchstart"in document.documentElement&&!a(c).closest(q.NAVBAR_NAV).length){var e=document.createElement("div");e.className=p.BACKDROP,a(e).insertBefore(this),a(e).on("click",b._clearMenus)}var f={relatedTarget:this},g=a.Event(o.SHOW,f);return a(c).trigger(g),!g.isDefaultPrevented()&&(this.focus(),this.setAttribute("aria-expanded","true"),a(c).toggleClass(p.OPEN),a(c).trigger(a.Event(o.SHOWN,f)),!1)}},{key:"dispose",value:function(){a.removeData(this._element,g),a(this._element).off(h),this._element=null}},{key:"_addEventListeners",value:function(){a(this._element).on(o.CLICK,this.toggle)}}],[{key:"_jQueryInterface",value:function(c){return this.each(function(){var d=a(this).data(g);if(d||a(this).data(g,d=new b(this)),"string"==typeof c){if(void 0===d[c])throw new Error('No method named "'+c+'"');d[c].call(this)}})}},{key:"_clearMenus",value:function(c){if(!c||c.which!==n){var d=a(q.BACKDROP)[0];d&&d.parentNode.removeChild(d);for(var e=a.makeArray(a(q.DATA_TOGGLE)),f=0;f<e.length;f++){var g=b._getParentFromElement(e[f]),h={relatedTarget:e[f]};if(a(g).hasClass(p.OPEN)&&!(c&&"click"===c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(g,c.target))){var i=a.Event(o.HIDE,h);a(g).trigger(i),i.isDefaultPrevented()||(e[f].setAttribute("aria-expanded","false"),a(g).removeClass(p.OPEN).trigger(a.Event(o.HIDDEN,h)))}}}}},{key:"_getParentFromElement",value:function(b){var c=void 0,d=e["default"].getSelectorFromElement(b);return d&&(c=a(d)[0]),c||b.parentNode}},{key:"_dataApiKeydownHandler",value:function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)&&(c.preventDefault(),c.stopPropagation(),!this.disabled&&!a(this).hasClass(p.DISABLED))){var d=b._getParentFromElement(this),e=a(d).hasClass(p.OPEN);if(!e&&c.which!==k||e&&c.which===k){if(c.which===k){var f=a(d).find(q.DATA_TOGGLE)[0];a(f).trigger("focus")}return void a(this).trigger("click")}var g=a.makeArray(a(q.VISIBLE_ITEMS));if(g=g.filter(function(a){return a.offsetWidth||a.offsetHeight}),g.length){var h=g.indexOf(c.target);c.which===l&&h>0&&h--,c.which===m&&h<g.length-1&&h++,h<0&&(h=0),g[h].focus()}}}},{key:"VERSION",get:function(){return c}}]),b}();return a(document).on(o.KEYDOWN_DATA_API,q.DATA_TOGGLE,r._dataApiKeydownHandler).on(o.KEYDOWN_DATA_API,q.ROLE_MENU,r._dataApiKeydownHandler).on(o.KEYDOWN_DATA_API,q.ROLE_LISTBOX,r._dataApiKeydownHandler).on(o.CLICK_DATA_API,r._clearMenus).on(o.CLICK_DATA_API,q.DATA_TOGGLE,r.prototype.toggle).on(o.CLICK_DATA_API,q.FORM_CHILD,function(a){a.stopPropagation()}),a.fn[b]=r._jQueryInterface,a.fn[b].Constructor=r,a.fn[b].noConflict=function(){return a.fn[b]=j,r._jQueryInterface},r}(jQuery);a["default"]=g});
  153. define('theme_boost/loader', ["jquery","./tether","core/event"],function(a,b,c){return window.jQuery=a,window.Tether=b,require(["theme_boost/util","theme_boost/alert","theme_boost/button","theme_boost/carousel","theme_boost/collapse","theme_boost/dropdown","theme_boost/modal","theme_boost/scrollspy","theme_boost/tab","theme_boost/tooltip","theme_boost/popover"],function(){a("body").popover({selector:'[data-toggle="popover"]',trigger:"focus"}),c.getLegacyEvents().done(function(b){a(document).on(b.FILTER_CONTENT_UPDATED,function(){a("body").popover({selector:'[data-toggle="popover"]',trigger:"focus"})})})}),{}});
  154. define('theme_boost/collapse', ["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=function(a){var b="collapse",c="4.0.0-alpha.4",h="bs.collapse",i="."+h,j=".data-api",k=a.fn[b],l=600,m={toggle:!0,parent:""},n={toggle:"boolean",parent:"string"},o={SHOW:"show"+i,SHOWN:"shown"+i,HIDE:"hide"+i,HIDDEN:"hidden"+i,CLICK_DATA_API:"click"+i+j},p={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},q={WIDTH:"width",HEIGHT:"height"},r={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},s=function(){function i(b,c){d(this,i),this._isTransitioning=!1,this._element=b,this._config=this._getConfig(c),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'+b.id+'"],'+('[data-toggle="collapse"][data-target="#'+b.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return g(i,[{key:"toggle",value:function(){a(this._element).hasClass(p.IN)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(p.IN)){var c=void 0,d=void 0;if(this._parent&&(c=a.makeArray(a(r.ACTIVES)),c.length||(c=null)),!(c&&(d=a(c).data(h),d&&d._isTransitioning))){var f=a.Event(o.SHOW);if(a(this._element).trigger(f),!f.isDefaultPrevented()){c&&(i._jQueryInterface.call(a(c),"hide"),d||a(c).data(h,null));var g=this._getDimension();a(this._element).removeClass(p.COLLAPSE).addClass(p.COLLAPSING),this._element.style[g]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&a(this._triggerArray).removeClass(p.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var j=function(){a(b._element).removeClass(p.COLLAPSING).addClass(p.COLLAPSE).addClass(p.IN),b._element.style[g]="",b.setTransitioning(!1),a(b._element).trigger(o.SHOWN)};if(!e["default"].supportsTransitionEnd())return void j();var k=g[0].toUpperCase()+g.slice(1),m="scroll"+k;a(this._element).one(e["default"].TRANSITION_END,j).emulateTransitionEnd(l),this._element.style[g]=this._element[m]+"px"}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(p.IN)){var c=a.Event(o.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var d=this._getDimension(),f=d===q.WIDTH?"offsetWidth":"offsetHeight";this._element.style[d]=this._element[f]+"px",e["default"].reflow(this._element),a(this._element).addClass(p.COLLAPSING).removeClass(p.COLLAPSE).removeClass(p.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&a(this._triggerArray).addClass(p.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var g=function(){b.setTransitioning(!1),a(b._element).removeClass(p.COLLAPSING).addClass(p.COLLAPSE).trigger(o.HIDDEN)};return this._element.style[d]=0,e["default"].supportsTransitionEnd()?void a(this._element).one(e["default"].TRANSITION_END,g).emulateTransitionEnd(l):void g()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"dispose",value:function(){a.removeData(this._element,h),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null}},{key:"_getConfig",value:function(c){return c=a.extend({},m,c),c.toggle=Boolean(c.toggle),e["default"].typeCheckConfig(b,c,n),c}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(q.WIDTH);return b?q.WIDTH:q.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=a(this._config.parent)[0],d='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(i._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(p.IN);b.setAttribute("aria-expanded",d),c.length&&a(c).toggleClass(p.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"_getTargetFromElement",value:function(b){var c=e["default"].getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),d=c.data(h),e=a.extend({},m,c.data(),"object"===("undefined"==typeof b?"undefined":f(b))&&b);if(!d&&e.toggle&&/show|hide/.test(b)&&(e.toggle=!1),d||(d=new i(this,e),c.data(h,d)),"string"==typeof b){if(void 0===d[b])throw new Error('No method named "'+b+'"');d[b]()}})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return m}}]),i}();return a(document).on(o.CLICK_DATA_API,r.DATA_TOGGLE,function(b){b.preventDefault();var c=s._getTargetFromElement(this),d=a(c).data(h),e=d?"toggle":a(this).data();s._jQueryInterface.call(a(c),e)}),a.fn[b]=s._jQueryInterface,a.fn[b].Constructor=s,a.fn[b].noConflict=function(){return a.fn[b]=k,s._jQueryInterface},s}(jQuery);a["default"]=h});
  155. !function(a,b){"function"==typeof define&&define.amd?define('theme_boost/tether', b):"object"==typeof exports?module.exports=b(require,exports,module):a.Tether=b()}(this,function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a){var b=a.getBoundingClientRect(),c={};for(var d in b)c[d]=b[d];if(a.ownerDocument!==document){var f=a.ownerDocument.defaultView.frameElement;if(f){var g=e(f);c.top+=g.top,c.bottom+=g.top,c.left+=g.left,c.right+=g.left}}return c}function f(a){var b=getComputedStyle(a)||{},c=b.position,d=[];if("fixed"===c)return[a];for(var e=a;(e=e.parentNode)&&e&&1===e.nodeType;){var f=void 0;try{f=getComputedStyle(e)}catch(g){}if("undefined"==typeof f||null===f)return d.push(e),d;var h=f,i=h.overflow,j=h.overflowX,k=h.overflowY;/(auto|scroll)/.test(i+k+j)&&("absolute"!==c||["relative","absolute","fixed"].indexOf(f.position)>=0)&&d.push(e)}return d.push(a.ownerDocument.body),a.ownerDocument!==document&&d.push(a.ownerDocument.defaultView),d}function g(){z&&document.body.removeChild(z),z=null}function h(a){var b=void 0;a===document?(b=document,a=document.documentElement):b=a.ownerDocument;var c=b.documentElement,d=e(a),f=C();return d.top-=f.top,d.left-=f.left,"undefined"==typeof d.width&&(d.width=document.body.scrollWidth-d.left-d.right),"undefined"==typeof d.height&&(d.height=document.body.scrollHeight-d.top-d.bottom),d.top=d.top-c.clientTop,d.left=d.left-c.clientLeft,d.right=b.body.clientWidth-d.width-d.left,d.bottom=b.body.clientHeight-d.height-d.top,d}function i(a){return a.offsetParent||document.documentElement}function j(){var a=document.createElement("div");a.style.width="100%",a.style.height="200px";var b=document.createElement("div");k(b.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),b.appendChild(a),document.body.appendChild(b);var c=a.offsetWidth;b.style.overflow="scroll";var d=a.offsetWidth;c===d&&(d=b.clientWidth),document.body.removeChild(b);var e=c-d;return{width:e,height:e}}function k(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=[];return Array.prototype.push.apply(b,arguments),b.slice(1).forEach(function(b){if(b)for(var c in b)({}).hasOwnProperty.call(b,c)&&(a[c]=b[c])}),a}function l(a,b){if("undefined"!=typeof a.classList)b.split(" ").forEach(function(b){b.trim()&&a.classList.remove(b)});else{var c=new RegExp("(^| )"+b.split(" ").join("|")+"( |$)","gi"),d=o(a).replace(c," ");p(a,d)}}function m(a,b){if("undefined"!=typeof a.classList)b.split(" ").forEach(function(b){b.trim()&&a.classList.add(b)});else{l(a,b);var c=o(a)+(" "+b);p(a,c)}}function n(a,b){if("undefined"!=typeof a.classList)return a.classList.contains(b);var c=o(a);return new RegExp("(^| )"+b+"( |$)","gi").test(c)}function o(a){return a.className instanceof a.ownerDocument.defaultView.SVGAnimatedString?a.className.baseVal:a.className}function p(a,b){a.setAttribute("class",b)}function q(a,b,c){c.forEach(function(c){b.indexOf(c)===-1&&n(a,c)&&l(a,c)}),b.forEach(function(b){n(a,b)||m(a,b)})}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function r(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function s(a,b){var c=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return a+c>=b&&b>=a-c}function t(){return"undefined"!=typeof performance&&"undefined"!=typeof performance.now?performance.now():+new Date}function u(){for(var a={top:0,left:0},b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];return c.forEach(function(b){var c=b.top,d=b.left;"string"==typeof c&&(c=parseFloat(c,10)),"string"==typeof d&&(d=parseFloat(d,10)),a.top+=c,a.left+=d}),a}function v(a,b){return"string"==typeof a.left&&a.left.indexOf("%")!==-1&&(a.left=parseFloat(a.left,10)/100*b.width),"string"==typeof a.top&&a.top.indexOf("%")!==-1&&(a.top=parseFloat(a.top,10)/100*b.height),a}function w(a,b){return"scrollParent"===b?b=a.scrollParents[0]:"window"===b&&(b=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),b===document&&(b=b.documentElement),"undefined"!=typeof b.nodeType&&!function(){var a=b,c=h(b),d=c,e=getComputedStyle(b);if(b=[d.left,d.top,c.width+d.left,c.height+d.top],a.ownerDocument!==document){var f=a.ownerDocument.defaultView;b[0]+=f.pageXOffset,b[1]+=f.pageYOffset,b[2]+=f.pageXOffset,b[3]+=f.pageYOffset}W.forEach(function(a,c){a=a[0].toUpperCase()+a.substr(1),"Top"===a||"Left"===a?b[c]+=parseFloat(e["border"+a+"Width"]):b[c]-=parseFloat(e["border"+a+"Width"])})}(),b}var x=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),y=void 0;"undefined"==typeof y&&(y={modules:[]});var z=null,A=function(){var a=0;return function(){return++a}}(),B={},C=function(){var a=z;a||(a=document.createElement("div"),a.setAttribute("data-tether-id",A()),k(a.style,{top:0,left:0,position:"absolute"}),document.body.appendChild(a),z=a);var b=a.getAttribute("data-tether-id");return"undefined"==typeof B[b]&&(B[b]=e(a),E(function(){delete B[b]})),B[b]},D=[],E=function(a){D.push(a)},F=function(){for(var a=void 0;a=D.pop();)a()},G=function(){function a(){d(this,a)}return x(a,[{key:"on",value:function(a,b,c){var d=!(arguments.length<=3||void 0===arguments[3])&&arguments[3];"undefined"==typeof this.bindings&&(this.bindings={}),"undefined"==typeof this.bindings[a]&&(this.bindings[a]=[]),this.bindings[a].push({handler:b,ctx:c,once:d})}},{key:"once",value:function(a,b,c){this.on(a,b,c,!0)}},{key:"off",value:function(a,b){if("undefined"!=typeof this.bindings&&"undefined"!=typeof this.bindings[a])if("undefined"==typeof b)delete this.bindings[a];else for(var c=0;c<this.bindings[a].length;)this.bindings[a][c].handler===b?this.bindings[a].splice(c,1):++c}},{key:"trigger",value:function(a){if("undefined"!=typeof this.bindings&&this.bindings[a]){for(var b=0,c=arguments.length,d=Array(c>1?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];for(;b<this.bindings[a].length;){var f=this.bindings[a][b],g=f.handler,h=f.ctx,i=f.once,j=h;"undefined"==typeof j&&(j=this),g.apply(j,d),i?this.bindings[a].splice(b,1):++b}}}}]),a}();y.Utils={getActualBoundingClientRect:e,getScrollParents:f,getBounds:h,getOffsetParent:i,extend:k,addClass:m,removeClass:l,hasClass:n,updateClasses:q,defer:E,flush:F,uniqueId:A,Evented:G,getScrollBarSize:j,removeUtilElements:g};var H=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h["return"]&&h["return"]()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),x=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),I=function(a,b,c){for(var d=!0;d;){var e=a,f=b,g=c;d=!1,null===e&&(e=Function.prototype);var h=Object.getOwnPropertyDescriptor(e,f);if(void 0!==h){if("value"in h)return h.value;var i=h.get;if(void 0===i)return;return i.call(g)}var j=Object.getPrototypeOf(e);if(null===j)return;a=j,b=f,c=g,d=!0,h=j=void 0}};if("undefined"==typeof y)throw new Error("You must include the utils.js file before tether.js");var J=y.Utils,f=J.getScrollParents,h=J.getBounds,i=J.getOffsetParent,k=J.extend,m=J.addClass,l=J.removeClass,q=J.updateClasses,E=J.defer,F=J.flush,j=J.getScrollBarSize,g=J.removeUtilElements,K=function(){if("undefined"==typeof document)return"";for(var a=document.createElement("div"),b=["transform","WebkitTransform","OTransform","MozTransform","msTransform"],c=0;c<b.length;++c){var d=b[c];if(void 0!==a.style[d])return d}}(),L=[],M=function(){L.forEach(function(a){a.position(!1)}),F()};!function(){var a=null,b=null,c=null,d=function e(){return"undefined"!=typeof b&&b>16?(b=Math.min(b-16,250),void(c=setTimeout(e,250))):void("undefined"!=typeof a&&t()-a<10||(null!=c&&(clearTimeout(c),c=null),a=t(),M(),b=t()-a))};"undefined"!=typeof window&&"undefined"!=typeof window.addEventListener&&["resize","scroll","touchmove"].forEach(function(a){window.addEventListener(a,d)})}();var N={center:"center",left:"right",right:"left"},O={middle:"middle",top:"bottom",bottom:"top"},P={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},Q=function(a,b){var c=a.left,d=a.top;return"auto"===c&&(c=N[b.left]),"auto"===d&&(d=O[b.top]),{left:c,top:d}},R=function(a){var b=a.left,c=a.top;return"undefined"!=typeof P[a.left]&&(b=P[a.left]),"undefined"!=typeof P[a.top]&&(c=P[a.top]),{left:b,top:c}},S=function(a){var b=a.split(" "),c=H(b,2),d=c[0],e=c[1];return{top:d,left:e}},T=S,U=function(a){function b(a){var c=this;d(this,b),I(Object.getPrototypeOf(b.prototype),"constructor",this).call(this),this.position=this.position.bind(this),L.push(this),this.history=[],this.setOptions(a,!1),y.modules.forEach(function(a){"undefined"!=typeof a.initialize&&a.initialize.call(c)}),this.position()}return r(b,a),x(b,[{key:"getClass",value:function(){var a=arguments.length<=0||void 0===arguments[0]?"":arguments[0],b=this.options.classes;return"undefined"!=typeof b&&b[a]?this.options.classes[a]:this.options.classPrefix?this.options.classPrefix+"-"+a:a}},{key:"setOptions",value:function(a){var b=this,c=arguments.length<=1||void 0===arguments[1]||arguments[1],d={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=k(d,a);var e=this.options,g=e.element,h=e.target,i=e.targetModifier;if(this.element=g,this.target=h,this.targetModifier=i,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(a){if("undefined"==typeof b[a])throw new Error("Tether Error: Both element and target must be defined");"undefined"!=typeof b[a].jquery?b[a]=b[a][0]:"string"==typeof b[a]&&(b[a]=document.querySelector(b[a]))}),m(this.element,this.getClass("element")),this.options.addTargetClasses!==!1&&m(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=T(this.options.targetAttachment),this.attachment=T(this.options.attachment),this.offset=S(this.options.offset),this.targetOffset=S(this.options.targetOffset),"undefined"!=typeof this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=f(this.target),this.options.enabled!==!1&&this.enable(c)}},{key:"getTargetBounds",value:function(){if("undefined"==typeof this.targetModifier)return h(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var a=h(this.target),b={height:a.height,width:a.width,top:a.top,left:a.left};return b.height=Math.min(b.height,a.height-(pageYOffset-a.top)),b.height=Math.min(b.height,a.height-(a.top+a.height-(pageYOffset+innerHeight))),b.height=Math.min(innerHeight,b.height),b.height-=2,b.width=Math.min(b.width,a.width-(pageXOffset-a.left)),b.width=Math.min(b.width,a.width-(a.left+a.width-(pageXOffset+innerWidth))),b.width=Math.min(innerWidth,b.width),b.width-=2,b.top<pageYOffset&&(b.top=pageYOffset),b.left<pageXOffset&&(b.left=pageXOffset),b}if("scroll-handle"===this.targetModifier){var a=void 0,c=this.target;c===document.body?(c=document.documentElement,a={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):a=h(c);var d=getComputedStyle(c),e=c.scrollWidth>c.clientWidth||[d.overflow,d.overflowX].indexOf("scroll")>=0||this.target!==document.body,f=0;e&&(f=15);var g=a.height-parseFloat(d.borderTopWidth)-parseFloat(d.borderBottomWidth)-f,b={width:15,height:.975*g*(g/c.scrollHeight),left:a.left+a.width-parseFloat(d.borderLeftWidth)-15},i=0;g<408&&this.target===document.body&&(i=-11e-5*Math.pow(g,2)-.00727*g+22.58),this.target!==document.body&&(b.height=Math.max(b.height,24));var j=this.target.scrollTop/(c.scrollHeight-g);return b.top=j*(g-b.height-i)+a.top+parseFloat(d.borderTopWidth),this.target===document.body&&(b.height=Math.max(b.height,24)),b}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(a,b){return"undefined"==typeof this._cache&&(this._cache={}),"undefined"==typeof this._cache[a]&&(this._cache[a]=b.call(this)),this._cache[a]}},{key:"enable",value:function(){var a=this,b=arguments.length<=0||void 0===arguments[0]||arguments[0];this.options.addTargetClasses!==!1&&m(this.target,this.getClass("enabled")),m(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(b){b!==a.target.ownerDocument&&b.addEventListener("scroll",a.position)}),b&&this.position()}},{key:"disable",value:function(){var a=this;l(this.target,this.getClass("enabled")),l(this.element,this.getClass("enabled")),this.enabled=!1,"undefined"!=typeof this.scrollParents&&this.scrollParents.forEach(function(b){b.removeEventListener("scroll",a.position)})}},{key:"destroy",value:function(){var a=this;this.disable(),L.forEach(function(b,c){b===a&&L.splice(c,1)}),0===L.length&&g()}},{key:"updateAttachClasses",value:function(a,b){var c=this;a=a||this.attachment,b=b||this.targetAttachment;var d=["left","top","bottom","right","middle","center"];"undefined"!=typeof this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),"undefined"==typeof this._addAttachClasses&&(this._addAttachClasses=[]);var e=this._addAttachClasses;a.top&&e.push(this.getClass("element-attached")+"-"+a.top),a.left&&e.push(this.getClass("element-attached")+"-"+a.left),b.top&&e.push(this.getClass("target-attached")+"-"+b.top),b.left&&e.push(this.getClass("target-attached")+"-"+b.left);var f=[];d.forEach(function(a){f.push(c.getClass("element-attached")+"-"+a),f.push(c.getClass("target-attached")+"-"+a)}),E(function(){"undefined"!=typeof c._addAttachClasses&&(q(c.element,c._addAttachClasses,f),c.options.addTargetClasses!==!1&&q(c.target,c._addAttachClasses,f),delete c._addAttachClasses)})}},{key:"position",value:function(){var a=this,b=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var c=Q(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,c);var d=this.cache("element-bounds",function(){return h(a.element)}),e=d.width,f=d.height;if(0===e&&0===f&&"undefined"!=typeof this.lastSize){var g=this.lastSize;e=g.width,f=g.height}else this.lastSize={width:e,height:f};var k=this.cache("target-bounds",function(){return a.getTargetBounds()}),l=k,m=v(R(this.attachment),{width:e,height:f}),n=v(R(c),l),o=v(this.offset,{width:e,height:f}),p=v(this.targetOffset,l);m=u(m,o),n=u(n,p);for(var q=k.left+n.left-m.left,r=k.top+n.top-m.top,s=0;s<y.modules.length;++s){var t=y.modules[s],w=t.position.call(this,{left:q,top:r,targetAttachment:c,targetPos:k,elementPos:d,offset:m,targetOffset:n,manualOffset:o,manualTargetOffset:p,scrollbarSize:B,attachment:this.attachment});if(w===!1)return!1;"undefined"!=typeof w&&"object"==typeof w&&(r=w.top,q=w.left)}var x={page:{top:r,left:q},viewport:{top:r-pageYOffset,bottom:pageYOffset-r-f+innerHeight,left:q-pageXOffset,right:pageXOffset-q-e+innerWidth}},z=this.target.ownerDocument,A=z.defaultView,B=void 0;return z.body.scrollWidth>A.innerWidth&&(B=this.cache("scrollbar-size",j),x.viewport.bottom-=B.height),z.body.scrollHeight>A.innerHeight&&(B=this.cache("scrollbar-size",j),x.viewport.right-=B.width),["","static"].indexOf(z.body.style.position)!==-1&&["","static"].indexOf(z.body.parentElement.style.position)!==-1||(x.page.bottom=z.body.scrollHeight-r-f,x.page.right=z.body.scrollWidth-q-e),"undefined"!=typeof this.options.optimizations&&this.options.optimizations.moveElement!==!1&&"undefined"==typeof this.targetModifier&&!function(){var b=a.cache("target-offsetparent",function(){return i(a.target)}),c=a.cache("target-offsetparent-bounds",function(){return h(b)}),d=getComputedStyle(b),e=c,f={};if(["Top","Left","Bottom","Right"].forEach(function(a){f[a.toLowerCase()]=parseFloat(d["border"+a+"Width"])}),c.right=z.body.scrollWidth-c.left-e.width+f.right,c.bottom=z.body.scrollHeight-c.top-e.height+f.bottom,x.page.top>=c.top+f.top&&x.page.bottom>=c.bottom&&x.page.left>=c.left+f.left&&x.page.right>=c.right){var g=b.scrollTop,j=b.scrollLeft;x.offset={top:x.page.top-c.top+g-f.top,left:x.page.left-c.left+j-f.left}}}(),this.move(x),this.history.unshift(x),this.history.length>3&&this.history.pop(),b&&F(),!0}}},{key:"move",value:function(a){var b=this;if("undefined"!=typeof this.element.parentNode){var c={};for(var d in a){c[d]={};for(var e in a[d]){for(var f=!1,g=0;g<this.history.length;++g){var h=this.history[g];if("undefined"!=typeof h[d]&&!s(h[d][e],a[d][e])){f=!0;break}}f||(c[d][e]=!0)}}var j={top:"",left:"",right:"",bottom:""},l=function(a,c){var d="undefined"!=typeof b.options.optimizations,e=d?b.options.optimizations.gpu:null;if(e!==!1){var f=void 0,g=void 0;a.top?(j.top=0,f=c.top):(j.bottom=0,f=-c.bottom),a.left?(j.left=0,g=c.left):(j.right=0,g=-c.right),j[K]="translateX("+Math.round(g)+"px) translateY("+Math.round(f)+"px)","msTransform"!==K&&(j[K]+=" translateZ(0)")}else a.top?j.top=c.top+"px":j.bottom=c.bottom+"px",a.left?j.left=c.left+"px":j.right=c.right+"px"},m=!1;if((c.page.top||c.page.bottom)&&(c.page.left||c.page.right)?(j.position="absolute",l(c.page,a.page)):(c.viewport.top||c.viewport.bottom)&&(c.viewport.left||c.viewport.right)?(j.position="fixed",l(c.viewport,a.viewport)):"undefined"!=typeof c.offset&&c.offset.top&&c.offset.left?!function(){j.position="absolute";var d=b.cache("target-offsetparent",function(){return i(b.target)});i(b.element)!==d&&E(function(){b.element.parentNode.removeChild(b.element),d.appendChild(b.element)}),l(c.offset,a.offset),m=!0}():(j.position="absolute",l({top:!0,left:!0},a.page)),!m){for(var n=!0,o=this.element.parentNode;o&&1===o.nodeType&&"BODY"!==o.tagName;){if("static"!==getComputedStyle(o).position){n=!1;break}o=o.parentNode}n||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var p={},q=!1;for(var e in j){var r=j[e],t=this.element.style[e];t!==r&&(q=!0,p[e]=r)}q&&E(function(){k(b.element.style,p)})}}}]),b}(G);U.modules=[],y.position=M;var V=k(U,y),H=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h["return"]&&h["return"]()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),J=y.Utils,h=J.getBounds,k=J.extend,q=J.updateClasses,E=J.defer,W=["left","top","right","bottom"];y.modules.push({position:function(a){var b=this,c=a.top,d=a.left,e=a.targetAttachment;if(!this.options.constraints)return!0;var f=this.cache("element-bounds",function(){return h(b.element)}),g=f.height,i=f.width;if(0===i&&0===g&&"undefined"!=typeof this.lastSize){var j=this.lastSize;i=j.width,g=j.height}var l=this.cache("target-bounds",function(){return b.getTargetBounds()}),m=l.height,n=l.width,o=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach(function(a){var b=a.outOfBoundsClass,c=a.pinnedClass;b&&o.push(b),c&&o.push(c)}),o.forEach(function(a){["left","top","right","bottom"].forEach(function(b){o.push(a+"-"+b)})});var p=[],r=k({},e),s=k({},this.attachment);return this.options.constraints.forEach(function(a){var f=a.to,h=a.attachment,j=a.pin;"undefined"==typeof h&&(h="");var k=void 0,l=void 0;if(h.indexOf(" ")>=0){var o=h.split(" "),q=H(o,2);l=q[0],k=q[1]}else k=l=h;var t=w(b,f);"target"!==l&&"both"!==l||(c<t[1]&&"top"===r.top&&(c+=m,r.top="bottom"),c+g>t[3]&&"bottom"===r.top&&(c-=m,r.top="top")),"together"===l&&("top"===r.top&&("bottom"===s.top&&c<t[1]?(c+=m,r.top="bottom",c+=g,s.top="top"):"top"===s.top&&c+g>t[3]&&c-(g-m)>=t[1]&&(c-=g-m,r.top="bottom",s.top="bottom")),"bottom"===r.top&&("top"===s.top&&c+g>t[3]?(c-=m,r.top="top",c-=g,s.top="bottom"):"bottom"===s.top&&c<t[1]&&c+(2*g-m)<=t[3]&&(c+=g-m,r.top="top",s.top="top")),"middle"===r.top&&(c+g>t[3]&&"top"===s.top?(c-=g,s.top="bottom"):c<t[1]&&"bottom"===s.top&&(c+=g,s.top="top"))),"target"!==k&&"both"!==k||(d<t[0]&&"left"===r.left&&(d+=n,r.left="right"),d+i>t[2]&&"right"===r.left&&(d-=n,r.left="left")),"together"===k&&(d<t[0]&&"left"===r.left?"right"===s.left?(d+=n,r.left="right",d+=i,s.left="left"):"left"===s.left&&(d+=n,r.left="right",d-=i,s.left="right"):d+i>t[2]&&"right"===r.left?"left"===s.left?(d-=n,r.left="left",d-=i,s.left="right"):"right"===s.left&&(d-=n,r.left="left",d+=i,s.left="left"):"center"===r.left&&(d+i>t[2]&&"left"===s.left?(d-=i,s.left="right"):d<t[0]&&"right"===s.left&&(d+=i,s.left="left"))),"element"!==l&&"both"!==l||(c<t[1]&&"bottom"===s.top&&(c+=g,s.top="top"),c+g>t[3]&&"top"===s.top&&(c-=g,s.top="bottom")),"element"!==k&&"both"!==k||(d<t[0]&&("right"===s.left?(d+=i,s.left="left"):"center"===s.left&&(d+=i/2,s.left="left")),d+i>t[2]&&("left"===s.left?(d-=i,s.left="right"):"center"===s.left&&(d-=i/2,s.left="right"))),"string"==typeof j?j=j.split(",").map(function(a){return a.trim()}):j===!0&&(j=["top","left","right","bottom"]),j=j||[];var u=[],v=[];c<t[1]&&(j.indexOf("top")>=0?(c=t[1],u.push("top")):v.push("top")),c+g>t[3]&&(j.indexOf("bottom")>=0?(c=t[3]-g,u.push("bottom")):v.push("bottom")),d<t[0]&&(j.indexOf("left")>=0?(d=t[0],u.push("left")):v.push("left")),d+i>t[2]&&(j.indexOf("right")>=0?(d=t[2]-i,u.push("right")):v.push("right")),u.length&&!function(){var a=void 0;a="undefined"!=typeof b.options.pinnedClass?b.options.pinnedClass:b.getClass("pinned"),p.push(a),u.forEach(function(b){p.push(a+"-"+b)})}(),v.length&&!function(){var a=void 0;a="undefined"!=typeof b.options.outOfBoundsClass?b.options.outOfBoundsClass:b.getClass("out-of-bounds"),p.push(a),v.forEach(function(b){p.push(a+"-"+b)})}(),(u.indexOf("left")>=0||u.indexOf("right")>=0)&&(s.left=r.left=!1),(u.indexOf("top")>=0||u.indexOf("bottom")>=0)&&(s.top=r.top=!1),r.top===e.top&&r.left===e.left&&s.top===b.attachment.top&&s.left===b.attachment.left||(b.updateAttachClasses(s,r),b.trigger("update",{attachment:s,targetAttachment:r}))}),E(function(){b.options.addTargetClasses!==!1&&q(b.target,p,o),q(b.element,p,o)}),{top:c,left:d}}});var J=y.Utils,h=J.getBounds,q=J.updateClasses,E=J.defer;y.modules.push({position:function(a){var b=this,c=a.top,d=a.left,e=this.cache("element-bounds",function(){return h(b.element)}),f=e.height,g=e.width,i=this.getTargetBounds(),j=c+f,k=d+g,l=[];c<=i.bottom&&j>=i.top&&["left","right"].forEach(function(a){var b=i[a];b!==d&&b!==k||l.push(a)}),d<=i.right&&k>=i.left&&["top","bottom"].forEach(function(a){var b=i[a];b!==c&&b!==j||l.push(a)});var m=[],n=[],o=["left","top","right","bottom"];return m.push(this.getClass("abutted")),o.forEach(function(a){m.push(b.getClass("abutted")+"-"+a)}),l.length&&n.push(this.getClass("abutted")),l.forEach(function(a){n.push(b.getClass("abutted")+"-"+a)}),E(function(){b.options.addTargetClasses!==!1&&q(b.target,n,m),q(b.element,n,m)}),!0}});var H=function(){function a(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{!d&&h["return"]&&h["return"]()}finally{if(e)throw f}}return c}return function(b,c){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return a(b,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();return y.modules.push({position:function(a){var b=a.top,c=a.left;if(this.options.shift){var d=this.options.shift;"function"==typeof this.options.shift&&(d=this.options.shift.call(this,{top:b,left:c}));var e=void 0,f=void 0;if("string"==typeof d){d=d.split(" "),d[1]=d[1]||d[0];var g=d,h=H(g,2);e=h[0],f=h[1],e=parseFloat(e,10),f=parseFloat(f,10)}else e=d.top,f=d.left;return b+=e,c+=f,{top:b,left:c}}}}),V});
  156. define('theme_boost/carousel', ["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=function(a){var b="carousel",c="4.0.0-alpha.4",h="bs.carousel",i="."+h,j=".data-api",k=a.fn[b],l=600,m=37,n=39,o={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},p={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},q={NEXT:"next",PREVIOUS:"prev"},r={SLIDE:"slide"+i,SLID:"slid"+i,KEYDOWN:"keydown"+i,MOUSEENTER:"mouseenter"+i,MOUSELEAVE:"mouseleave"+i,LOAD_DATA_API:"load"+i+j,CLICK_DATA_API:"click"+i+j},s={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"right",LEFT:"left",ITEM:"carousel-item"},t={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".next, .prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},u=function(){function j(b,c){d(this,j),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this._config=this._getConfig(c),this._element=a(b)[0],this._indicatorsElement=a(this._element).find(t.INDICATORS)[0],this._addEventListeners()}return g(j,[{key:"next",value:function(){this._isSliding||this._slide(q.NEXT)}},{key:"nextWhenVisible",value:function(){document.hidden||this.next()}},{key:"prev",value:function(){this._isSliding||this._slide(q.PREVIOUS)}},{key:"pause",value:function(b){b||(this._isPaused=!0),a(this._element).find(t.NEXT_PREV)[0]&&e["default"].supportsTransitionEnd()&&(e["default"].triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}},{key:"cycle",value:function(b){b||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval(a.proxy(document.visibilityState?this.nextWhenVisible:this.next,this),this._config.interval))}},{key:"to",value:function(b){var c=this;this._activeElement=a(this._element).find(t.ACTIVE_ITEM)[0];var d=this._getItemIndex(this._activeElement);if(!(b>this._items.length-1||b<0)){if(this._isSliding)return void a(this._element).one(r.SLID,function(){return c.to(b)});if(d===b)return this.pause(),void this.cycle();var e=b>d?q.NEXT:q.PREVIOUS;this._slide(e,this._items[b])}}},{key:"dispose",value:function(){a(this._element).off(i),a.removeData(this._element,h),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null}},{key:"_getConfig",value:function(c){return c=a.extend({},o,c),e["default"].typeCheckConfig(b,c,p),c}},{key:"_addEventListeners",value:function(){this._config.keyboard&&a(this._element).on(r.KEYDOWN,a.proxy(this._keydown,this)),"hover"!==this._config.pause||"ontouchstart"in document.documentElement||a(this._element).on(r.MOUSEENTER,a.proxy(this.pause,this)).on(r.MOUSELEAVE,a.proxy(this.cycle,this))}},{key:"_keydown",value:function(a){if(a.preventDefault(),!/input|textarea/i.test(a.target.tagName))switch(a.which){case m:this.prev();break;case n:this.next();break;default:return}}},{key:"_getItemIndex",value:function(b){return this._items=a.makeArray(a(b).parent().find(t.ITEM)),this._items.indexOf(b)}},{key:"_getItemByDirection",value:function(a,b){var c=a===q.NEXT,d=a===q.PREVIOUS,e=this._getItemIndex(b),f=this._items.length-1,g=d&&0===e||c&&e===f;if(g&&!this._config.wrap)return b;var h=a===q.PREVIOUS?-1:1,i=(e+h)%this._items.length;return i===-1?this._items[this._items.length-1]:this._items[i]}},{key:"_triggerSlideEvent",value:function(b,c){var d=a.Event(r.SLIDE,{relatedTarget:b,direction:c});return a(this._element).trigger(d),d}},{key:"_setActiveIndicatorElement",value:function(b){if(this._indicatorsElement){a(this._indicatorsElement).find(t.ACTIVE).removeClass(s.ACTIVE);var c=this._indicatorsElement.children[this._getItemIndex(b)];c&&a(c).addClass(s.ACTIVE)}}},{key:"_slide",value:function(b,c){var d=this,f=a(this._element).find(t.ACTIVE_ITEM)[0],g=c||f&&this._getItemByDirection(b,f),h=Boolean(this._interval),i=b===q.NEXT?s.LEFT:s.RIGHT;if(g&&a(g).hasClass(s.ACTIVE))return void(this._isSliding=!1);var j=this._triggerSlideEvent(g,i);if(!j.isDefaultPrevented()&&f&&g){this._isSliding=!0,h&&this.pause(),this._setActiveIndicatorElement(g);var k=a.Event(r.SLID,{relatedTarget:g,direction:i});e["default"].supportsTransitionEnd()&&a(this._element).hasClass(s.SLIDE)?(a(g).addClass(b),e["default"].reflow(g),a(f).addClass(i),a(g).addClass(i),a(f).one(e["default"].TRANSITION_END,function(){a(g).removeClass(i).removeClass(b),a(g).addClass(s.ACTIVE),a(f).removeClass(s.ACTIVE).removeClass(b).removeClass(i),d._isSliding=!1,setTimeout(function(){return a(d._element).trigger(k)},0)}).emulateTransitionEnd(l)):(a(f).removeClass(s.ACTIVE),a(g).addClass(s.ACTIVE),this._isSliding=!1,a(this._element).trigger(k)),h&&this.cycle()}}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(h),d=a.extend({},o,a(this).data());"object"===("undefined"==typeof b?"undefined":f(b))&&a.extend(d,b);var e="string"==typeof b?b:d.slide;if(c||(c=new j(this,d),a(this).data(h,c)),"number"==typeof b)c.to(b);else if("string"==typeof e){if(void 0===c[e])throw new Error('No method named "'+e+'"');c[e]()}else d.interval&&(c.pause(),c.cycle())})}},{key:"_dataApiClickHandler",value:function(b){var c=e["default"].getSelectorFromElement(this);if(c){var d=a(c)[0];if(d&&a(d).hasClass(s.CAROUSEL)){var f=a.extend({},a(d).data(),a(this).data()),g=this.getAttribute("data-slide-to");g&&(f.interval=!1),j._jQueryInterface.call(a(d),f),g&&a(d).data(h).to(g),b.preventDefault()}}}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return o}}]),j}();return a(document).on(r.CLICK_DATA_API,t.DATA_SLIDE,u._dataApiClickHandler),a(window).on(r.LOAD_DATA_API,function(){a(t.DATA_RIDE).each(function(){var b=a(this);u._jQueryInterface.call(b,b.data())})}),a.fn[b]=u._jQueryInterface,a.fn[b].Constructor=u,a.fn[b].noConflict=function(){return a.fn[b]=k,u._jQueryInterface},u}(jQuery);a["default"]=h});
  157. define('theme_boost/drawer', ["jquery","core/custom_interaction_events","core/log"],function(a,b,c){var d={TOGGLE_REGION:'[data-region="drawer-toggle"]',TOGGLE_ACTION:'[data-action="toggle-drawer"]',TOGGLE_TARGET:"aria-controls",TOGGLE_SIDE:"left",BODY:"body"},e=function(){a(d.TOGGLE_REGION).length||c.debug("Page is missing a drawer region"),a(d.TOGGLE_ACTION).length||c.debug("Page is missing a drawer toggle link"),a(d.TOGGLE_REGION).each(function(b,c){var e=a(c).find(d.TOGGLE_ACTION),f=e.attr("aria-controls"),g=a(document.getElementById(f)),h="false"==e.attr("aria-expanded"),i=e.attr("data-side"),j=a(d.BODY);g.on("mousewheel DOMMouseScroll",this.preventPageScroll),h?e.attr("aria-expanded","false"):(j.addClass("drawer-open-"+i),e.attr("aria-expanded","true"))}.bind(this)),this.registerEventListeners();var b=a(document).width()<768;b&&this.closeAll()};return e.prototype.closeAll=function(){a(d.TOGGLE_REGION).each(function(b,c){var e=a(c).find(d.TOGGLE_ACTION),f=e.attr("data-side"),g=a(d.BODY),h=e.attr("aria-controls"),i=a(document.getElementById(h)),j=e.attr("data-preference");e.attr("aria-expanded","false"),g.removeClass("drawer-open-"+f),i.attr("aria-hidden","true"),i.addClass("closed"),M.util.set_user_preference(j,"false")})},e.prototype.toggleDrawer=function(b){var c=a(b.target).closest("[data-action=toggle-drawer]"),e=c.attr("aria-controls"),f=a(document.getElementById(e)),g=a(d.BODY),h=c.attr("data-side"),i=c.attr("data-preference");g.addClass("drawer-ease");var j="true"==c.attr("aria-expanded");if(j)g.removeClass("drawer-open-"+h),c.attr("aria-expanded","false"),f.attr("aria-hidden","true"),f.addClass("closed"),M.util.set_user_preference(i,"false");else{var k=a(document).width()<768;k&&this.closeAll(),c.attr("aria-expanded","true"),f.attr("aria-hidden","false"),f.focus(),g.addClass("drawer-open-"+h),f.removeClass("closed"),M.util.set_user_preference(i,"true")}},e.prototype.preventPageScroll=function(b){var c=b.wheelDelta||b.originalEvent&&b.originalEvent.wheelDelta||-b.originalEvent.detail,d=this.scrollTop+a(this).outerHeight()-this.scrollHeight>=0,e=this.scrollTop<=0;(c<0&&d||c>0&&e)&&b.preventDefault()},e.prototype.registerEventListeners=function(){a(d.TOGGLE_ACTION).each(function(c,d){b.define(a(d),[b.events.activate]),a(d).on(b.events.activate,function(a,b){this.toggleDrawer(b.originalEvent),b.originalEvent.preventDefault()}.bind(this))}.bind(this))},{init:function(){return new e}}});
  158. define('theme_boost/popover', ["exports","./tooltip"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(a,"__esModule",{value:!0});var g=c(b),h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=function(a){var b="popover",c="4.0.0-alpha.4",j="bs.popover",k="."+j,l=a.fn[b],m=a.extend({},g["default"].Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),n=a.extend({},g["default"].DefaultType,{content:"(string|element|function)"}),o={FADE:"fade",IN:"in"},p={TITLE:".popover-title",CONTENT:".popover-content",ARROW:".popover-arrow"},q={HIDE:"hide"+k,HIDDEN:"hidden"+k,SHOW:"show"+k,SHOWN:"shown"+k,INSERTED:"inserted"+k,CLICK:"click"+k,FOCUSIN:"focusin"+k,FOCUSOUT:"focusout"+k,MOUSEENTER:"mouseenter"+k,MOUSELEAVE:"mouseleave"+k},r=function(g){function l(){return d(this,l),e(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return f(l,g),i(l,[{key:"isWithContent",value:function(){return this.getTitle()||this._getContent()}},{key:"getTipElement",value:function(){return this.tip=this.tip||a(this.config.template)[0]}},{key:"setContent",value:function(){var b=a(this.getTipElement());this.setElementContent(b.find(p.TITLE),this.getTitle()),this.setElementContent(b.find(p.CONTENT),this._getContent()),b.removeClass(o.FADE).removeClass(o.IN),this.cleanupTether()}},{key:"_getContent",value:function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(j),d="object"===("undefined"==typeof b?"undefined":h(b))?b:null;if((c||!/destroy|hide/.test(b))&&(c||(c=new l(this,d),a(this).data(j,c)),"string"==typeof b)){if(void 0===c[b])throw new Error('No method named "'+b+'"');c[b]()}})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return m}},{key:"NAME",get:function(){return b}},{key:"DATA_KEY",get:function(){return j}},{key:"Event",get:function(){return q}},{key:"EVENT_KEY",get:function(){return k}},{key:"DefaultType",get:function(){return n}}]),l}(g["default"]);return a.fn[b]=r._jQueryInterface,a.fn[b].Constructor=r,a.fn[b].noConflict=function(){return a.fn[b]=l,r._jQueryInterface},r}(jQuery);a["default"]=j});
  159. define('theme_boost/button', ["exports"],function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var c=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),d=function(a){var d="button",e="4.0.0-alpha.4",f="bs.button",g="."+f,h=".data-api",i=a.fn[d],j={ACTIVE:"active",BUTTON:"btn",FOCUS:"focus"},k={DATA_TOGGLE_CARROT:'[data-toggle^="button"]',DATA_TOGGLE:'[data-toggle="buttons"]',INPUT:"input",ACTIVE:".active",BUTTON:".btn"},l={CLICK_DATA_API:"click"+g+h,FOCUS_BLUR_DATA_API:"focus"+g+h+" "+("blur"+g+h)},m=function(){function d(a){b(this,d),this._element=a}return c(d,[{key:"toggle",value:function(){var b=!0,c=a(this._element).closest(k.DATA_TOGGLE)[0];if(c){var d=a(this._element).find(k.INPUT)[0];if(d){if("radio"===d.type)if(d.checked&&a(this._element).hasClass(j.ACTIVE))b=!1;else{var e=a(c).find(k.ACTIVE)[0];e&&a(e).removeClass(j.ACTIVE)}b&&(d.checked=!a(this._element).hasClass(j.ACTIVE),a(this._element).trigger("change")),d.focus()}}else this._element.setAttribute("aria-pressed",!a(this._element).hasClass(j.ACTIVE));b&&a(this._element).toggleClass(j.ACTIVE)}},{key:"dispose",value:function(){a.removeData(this._element,f),this._element=null}}],[{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this).data(f);c||(c=new d(this),a(this).data(f,c)),"toggle"===b&&c[b]()})}},{key:"VERSION",get:function(){return e}}]),d}();return a(document).on(l.CLICK_DATA_API,k.DATA_TOGGLE_CARROT,function(b){b.preventDefault();var c=b.target;a(c).hasClass(j.BUTTON)||(c=a(c).closest(k.BUTTON)),m._jQueryInterface.call(a(c),"toggle")}).on(l.FOCUS_BLUR_DATA_API,k.DATA_TOGGLE_CARROT,function(b){var c=a(b.target).closest(k.BUTTON)[0];a(c).toggleClass(j.FOCUS,/^focus(in)?$/.test(b.type))}),a.fn[d]=m._jQueryInterface,a.fn[d].Constructor=m,a.fn[d].noConflict=function(){return a.fn[d]=i,m._jQueryInterface},m}(jQuery);a["default"]=d});
  160. define('theme_boost/util', ["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var b=function(a){function b(a){return{}.toString.call(a).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function c(a){return(a[0]||a).nodeType}function d(){return{bindType:h.end,delegateType:h.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}}}function e(){if(window.QUnit)return!1;var a=document.createElement("bootstrap");for(var b in j)if(void 0!==a.style[b])return{end:j[b]};return!1}function f(b){var c=this,d=!1;return a(this).one(k.TRANSITION_END,function(){d=!0}),setTimeout(function(){d||k.triggerTransitionEnd(c)},b),this}function g(){h=e(),a.fn.emulateTransitionEnd=f,k.supportsTransitionEnd()&&(a.event.special[k.TRANSITION_END]=d())}var h=!1,i=1e6,j={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},k={TRANSITION_END:"bsTransitionEnd",getUID:function(a){do a+=~~(Math.random()*i);while(document.getElementById(a));return a},getSelectorFromElement:function(a){var b=a.getAttribute("data-target");return b||(b=a.getAttribute("href")||"",b=/^#[a-z]/i.test(b)?b:null),b},reflow:function(a){new Function("bs","return bs")(a.offsetHeight)},triggerTransitionEnd:function(b){a(b).trigger(h.end)},supportsTransitionEnd:function(){return Boolean(h)},typeCheckConfig:function(a,d,e){for(var f in e)if(e.hasOwnProperty(f)){var g=e[f],h=d[f],i=void 0;if(i=h&&c(h)?"element":b(h),!new RegExp(g).test(i))throw new Error(a.toUpperCase()+": "+('Option "'+f+'" provided type "'+i+'" ')+('but expected type "'+g+'".'))}}};return g(),k}(jQuery);a["default"]=b});
  161. define('theme_boost/alert', ["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=function(a){var b="alert",c="4.0.0-alpha.4",g="bs.alert",h="."+g,i=".data-api",j=a.fn[b],k=150,l={DISMISS:'[data-dismiss="alert"]'},m={CLOSE:"close"+h,CLOSED:"closed"+h,CLICK_DATA_API:"click"+h+i},n={ALERT:"alert",FADE:"fade",IN:"in"},o=function(){function b(a){d(this,b),this._element=a}return f(b,[{key:"close",value:function(a){a=a||this._element;var b=this._getRootElement(a),c=this._triggerCloseEvent(b);c.isDefaultPrevented()||this._removeElement(b)}},{key:"dispose",value:function(){a.removeData(this._element,g),this._element=null}},{key:"_getRootElement",value:function(b){var c=e["default"].getSelectorFromElement(b),d=!1;return c&&(d=a(c)[0]),d||(d=a(b).closest("."+n.ALERT)[0]),d}},{key:"_triggerCloseEvent",value:function(b){var c=a.Event(m.CLOSE);return a(b).trigger(c),c}},{key:"_removeElement",value:function(b){return a(b).removeClass(n.IN),e["default"].supportsTransitionEnd()&&a(b).hasClass(n.FADE)?void a(b).one(e["default"].TRANSITION_END,a.proxy(this._destroyElement,this,b)).emulateTransitionEnd(k):void this._destroyElement(b)}},{key:"_destroyElement",value:function(b){a(b).detach().trigger(m.CLOSED).remove()}}],[{key:"_jQueryInterface",value:function(c){return this.each(function(){var d=a(this),e=d.data(g);e||(e=new b(this),d.data(g,e)),"close"===c&&e[c](this)})}},{key:"_handleDismiss",value:function(a){return function(b){b&&b.preventDefault(),a.close(this)}}},{key:"VERSION",get:function(){return c}}]),b}();return a(document).on(m.CLICK_DATA_API,l.DISMISS,o._handleDismiss(new o)),a.fn[b]=o._jQueryInterface,a.fn[b].Constructor=o,a.fn[b].noConflict=function(){return a.fn[b]=j,o._jQueryInterface},o}(jQuery);a["default"]=g});
  162. define('theme_boost/modal', ["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=function(a){var b="modal",c="4.0.0-alpha.4",h="bs.modal",i="."+h,j=".data-api",k=a.fn[b],l=300,m=150,n=27,o={backdrop:!0,keyboard:!0,focus:!0,show:!0},p={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},q={HIDE:"hide"+i,HIDDEN:"hidden"+i,SHOW:"show"+i,SHOWN:"shown"+i,FOCUSIN:"focusin"+i,RESIZE:"resize"+i,CLICK_DISMISS:"click.dismiss"+i,KEYDOWN_DISMISS:"keydown.dismiss"+i,MOUSEUP_DISMISS:"mouseup.dismiss"+i,MOUSEDOWN_DISMISS:"mousedown.dismiss"+i,CLICK_DATA_API:"click"+i+j},r={SCROLLBAR_MEASURER:"modal-scrollbar-measure",BACKDROP:"modal-backdrop",OPEN:"modal-open",FADE:"fade",IN:"in"},s={DIALOG:".modal-dialog",DATA_TOGGLE:'[data-toggle="modal"]',DATA_DISMISS:'[data-dismiss="modal"]',FIXED_CONTENT:".navbar-fixed-top, .navbar-fixed-bottom, .is-fixed"},t=function(){function j(b,c){d(this,j),this._config=this._getConfig(c),this._element=b,this._dialog=a(b).find(s.DIALOG)[0],this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._originalBodyPadding=0,this._scrollbarWidth=0}return g(j,[{key:"toggle",value:function(a){return this._isShown?this.hide():this.show(a)}},{key:"show",value:function(b){var c=this,d=a.Event(q.SHOW,{relatedTarget:b});a(this._element).trigger(d),this._isShown||d.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),a(document.body).addClass(r.OPEN),this._setEscapeEvent(),this._setResizeEvent(),a(this._element).on(q.CLICK_DISMISS,s.DATA_DISMISS,a.proxy(this.hide,this)),a(this._dialog).on(q.MOUSEDOWN_DISMISS,function(){a(c._element).one(q.MOUSEUP_DISMISS,function(b){a(b.target).is(c._element)&&(c._ignoreBackdropClick=!0)})}),this._showBackdrop(a.proxy(this._showElement,this,b)))}},{key:"hide",value:function(b){b&&b.preventDefault();var c=a.Event(q.HIDE);a(this._element).trigger(c),this._isShown&&!c.isDefaultPrevented()&&(this._isShown=!1,this._setEscapeEvent(),this._setResizeEvent(),a(document).off(q.FOCUSIN),a(this._element).removeClass(r.IN),a(this._element).off(q.CLICK_DISMISS),a(this._dialog).off(q.MOUSEDOWN_DISMISS),e["default"].supportsTransitionEnd()&&a(this._element).hasClass(r.FADE)?a(this._element).one(e["default"].TRANSITION_END,a.proxy(this._hideModal,this)).emulateTransitionEnd(l):this._hideModal())}},{key:"dispose",value:function(){a.removeData(this._element,h),a(window).off(i),a(document).off(i),a(this._element).off(i),a(this._backdrop).off(i),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._originalBodyPadding=null,this._scrollbarWidth=null}},{key:"_getConfig",value:function(c){return c=a.extend({},o,c),e["default"].typeCheckConfig(b,c,p),c}},{key:"_showElement",value:function(b){var c=this,d=e["default"].supportsTransitionEnd()&&a(this._element).hasClass(r.FADE);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.scrollTop=0,d&&e["default"].reflow(this._element),a(this._element).addClass(r.IN),this._config.focus&&this._enforceFocus();var f=a.Event(q.SHOWN,{relatedTarget:b}),g=function(){c._config.focus&&c._element.focus(),a(c._element).trigger(f)};d?a(this._dialog).one(e["default"].TRANSITION_END,g).emulateTransitionEnd(l):g()}},{key:"_enforceFocus",value:function(){var b=this;a(document).off(q.FOCUSIN).on(q.FOCUSIN,function(c){document===c.target||b._element===c.target||a(b._element).has(c.target).length||b._element.focus()})}},{key:"_setEscapeEvent",value:function(){var b=this;this._isShown&&this._config.keyboard?a(this._element).on(q.KEYDOWN_DISMISS,function(a){a.which===n&&b.hide()}):this._isShown||a(this._element).off(q.KEYDOWN_DISMISS)}},{key:"_setResizeEvent",value:function(){this._isShown?a(window).on(q.RESIZE,a.proxy(this._handleUpdate,this)):a(window).off(q.RESIZE)}},{key:"_hideModal",value:function(){var b=this;this._element.style.display="none",this._element.setAttribute("aria-hidden","true"),this._showBackdrop(function(){a(document.body).removeClass(r.OPEN),b._resetAdjustments(),b._resetScrollbar(),a(b._element).trigger(q.HIDDEN)})}},{key:"_removeBackdrop",value:function(){this._backdrop&&(a(this._backdrop).remove(),this._backdrop=null)}},{key:"_showBackdrop",value:function(b){var c=this,d=a(this._element).hasClass(r.FADE)?r.FADE:"";if(this._isShown&&this._config.backdrop){var f=e["default"].supportsTransitionEnd()&&d;if(this._backdrop=document.createElement("div"),this._backdrop.className=r.BACKDROP,d&&a(this._backdrop).addClass(d),a(this._backdrop).appendTo(document.body),a(this._element).on(q.CLICK_DISMISS,function(a){return c._ignoreBackdropClick?void(c._ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"===c._config.backdrop?c._element.focus():c.hide()))}),f&&e["default"].reflow(this._backdrop),a(this._backdrop).addClass(r.IN),!b)return;if(!f)return void b();a(this._backdrop).one(e["default"].TRANSITION_END,b).emulateTransitionEnd(m)}else if(!this._isShown&&this._backdrop){a(this._backdrop).removeClass(r.IN);var g=function(){c._removeBackdrop(),b&&b()};e["default"].supportsTransitionEnd()&&a(this._element).hasClass(r.FADE)?a(this._backdrop).one(e["default"].TRANSITION_END,g).emulateTransitionEnd(m):g()}else b&&b()}},{key:"_handleUpdate",value:function(){this._adjustDialog()}},{key:"_adjustDialog",value:function(){var a=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&a&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!a&&(this._element.style.paddingRight=this._scrollbarWidth+"px")}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}},{key:"_checkScrollbar",value:function(){this._isBodyOverflowing=document.body.clientWidth<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()}},{key:"_setScrollbar",value:function(){var b=parseInt(a(s.FIXED_CONTENT).css("padding-right")||0,10);this._originalBodyPadding=document.body.style.paddingRight||"",this._isBodyOverflowing&&(document.body.style.paddingRight=b+this._scrollbarWidth+"px")}},{key:"_resetScrollbar",value:function(){document.body.style.paddingRight=this._originalBodyPadding}},{key:"_getScrollbarWidth",value:function(){var a=document.createElement("div");a.className=r.SCROLLBAR_MEASURER,document.body.appendChild(a);var b=a.offsetWidth-a.clientWidth;return document.body.removeChild(a),b}}],[{key:"_jQueryInterface",value:function(b,c){return this.each(function(){var d=a(this).data(h),e=a.extend({},j.Default,a(this).data(),"object"===("undefined"==typeof b?"undefined":f(b))&&b);if(d||(d=new j(this,e),a(this).data(h,d)),"string"==typeof b){if(void 0===d[b])throw new Error('No method named "'+b+'"');d[b](c)}else e.show&&d.show(c)})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return o}}]),j}();return a(document).on(q.CLICK_DATA_API,s.DATA_TOGGLE,function(b){var c=this,d=void 0,f=e["default"].getSelectorFromElement(this);f&&(d=a(f)[0]);var g=a(d).data(h)?"toggle":a.extend({},a(d).data(),a(this).data());"A"===this.tagName&&b.preventDefault();var i=a(d).one(q.SHOW,function(b){b.isDefaultPrevented()||i.one(q.HIDDEN,function(){a(c).is(":visible")&&c.focus()})});t._jQueryInterface.call(a(d),g,this)}),a.fn[b]=t._jQueryInterface,a.fn[b].Constructor=t,a.fn[b].noConflict=function(){return a.fn[b]=k,t._jQueryInterface},t}(jQuery);a["default"]=h});
  163. define('theme_boost/tab', ["exports","./util"],function(a,b){"use strict";function c(a){return a&&a.__esModule?a:{"default":a}}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var e=c(b),f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=function(a){var b="tab",c="4.0.0-alpha.4",g="bs.tab",h="."+g,i=".data-api",j=a.fn[b],k=150,l={HIDE:"hide"+h,HIDDEN:"hidden"+h,SHOW:"show"+h,SHOWN:"shown"+h,CLICK_DATA_API:"click"+h+i},m={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",FADE:"fade",IN:"in"},n={A:"a",LI:"li",DROPDOWN:".dropdown",UL:"ul:not(.dropdown-menu)",FADE_CHILD:"> .nav-item .fade, > .fade",ACTIVE:".active",ACTIVE_CHILD:"> .nav-item > .active, > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},o=function(){function b(a){d(this,b),this._element=a}return f(b,[{key:"show",value:function(){var b=this;if(!this._element.parentNode||this._element.parentNode.nodeType!==Node.ELEMENT_NODE||!a(this._element).hasClass(m.ACTIVE)){var c=void 0,d=void 0,f=a(this._element).closest(n.UL)[0],g=e["default"].getSelectorFromElement(this._element);f&&(d=a.makeArray(a(f).find(n.ACTIVE)),d=d[d.length-1]);var h=a.Event(l.HIDE,{relatedTarget:this._element}),i=a.Event(l.SHOW,{relatedTarget:d});if(d&&a(d).trigger(h),a(this._element).trigger(i),!i.isDefaultPrevented()&&!h.isDefaultPrevented()){g&&(c=a(g)[0]),this._activate(this._element,f);var j=function(){var c=a.Event(l.HIDDEN,{relatedTarget:b._element}),e=a.Event(l.SHOWN,{relatedTarget:d});a(d).trigger(c),a(b._element).trigger(e)};c?this._activate(c,c.parentNode,j):j()}}}},{key:"dispose",value:function(){a.removeClass(this._element,g),this._element=null}},{key:"_activate",value:function(b,c,d){var f=a(c).find(n.ACTIVE_CHILD)[0],g=d&&e["default"].supportsTransitionEnd()&&(f&&a(f).hasClass(m.FADE)||Boolean(a(c).find(n.FADE_CHILD)[0])),h=a.proxy(this._transitionComplete,this,b,f,g,d);f&&g?a(f).one(e["default"].TRANSITION_END,h).emulateTransitionEnd(k):h(),f&&a(f).removeClass(m.IN)}},{key:"_transitionComplete",value:function(b,c,d,f){if(c){a(c).removeClass(m.ACTIVE);var g=a(c).find(n.DROPDOWN_ACTIVE_CHILD)[0];g&&a(g).removeClass(m.ACTIVE),c.setAttribute("aria-expanded",!1)}if(a(b).addClass(m.ACTIVE),b.setAttribute("aria-expanded",!0),d?(e["default"].reflow(b),a(b).addClass(m.IN)):a(b).removeClass(m.FADE),b.parentNode&&a(b.parentNode).hasClass(m.DROPDOWN_MENU)){var h=a(b).closest(n.DROPDOWN)[0];h&&a(h).find(n.DROPDOWN_TOGGLE).addClass(m.ACTIVE),b.setAttribute("aria-expanded",!0)}f&&f()}}],[{key:"_jQueryInterface",value:function(c){return this.each(function(){var d=a(this),e=d.data(g);if(e||(e=e=new b(this),d.data(g,e)),"string"==typeof c){if(void 0===e[c])throw new Error('No method named "'+c+'"');e[c]()}})}},{key:"VERSION",get:function(){return c}}]),b}();return a(document).on(l.CLICK_DATA_API,n.DATA_TOGGLE,function(b){b.preventDefault(),o._jQueryInterface.call(a(this),"show")}),a.fn[b]=o._jQueryInterface,a.fn[b].Constructor=o,a.fn[b].noConflict=function(){return a.fn[b]=j,o._jQueryInterface},o}(jQuery);a["default"]=g});
  164. define('theme_bootstrapbase/bootstrap', ["jquery"],function(a){function b(b){a(".dropdown-backdrop").remove(),a(k).each(function(){var d=c(a(this));void 0!=b&&0!=d.find(b).length||d.removeClass("open")})}function c(b){var c,d=b.attr("data-target");return d||(d=b.attr("href"),d=d&&/#/.test(d)&&d.replace(/.*(?=#[^\s]*$)/,"")),c=d&&a(d),c&&c.length||(c=b.parent()),c}function d(b,c){var d,e=a.proxy(this.process,this),f=a(a(b).is("body")?window:b);this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=f.on("scroll.scroll-spy.data-api",e),this.selector=(this.options.target||(d=a(b).attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body"),this.refresh(),this.process()}a(".h1").hide(),a(function(){a.support.transition=function(){var a=function(){var a,b=document.createElement("bootstrap"),c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(a in c)if(void 0!==b.style[a])return c[a]}();return a&&{end:a}}()});var e='[data-dismiss="alert"]',f=function(b){a(b).on("click",e,this.close)};f.prototype.close=function(b){function c(){d.trigger("closed").remove()}var d,e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,"")),d=a(f),b&&b.preventDefault(),d.length||(d=e.hasClass("alert")?e:e.parent()),d.trigger(b=a.Event("close")),b.isDefaultPrevented()||(d.removeClass("in"),a.support.transition&&d.hasClass("fade")?d.on(a.support.transition.end,c):c())};var g=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var c=a(this),d=c.data("alert");d||c.data("alert",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.alert.Constructor=f,a.fn.alert.noConflict=function(){return a.fn.alert=g,this},a(document).on("click.alert.data-api",e,f.prototype.close);var h=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};h.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},h.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")};var g=a.fn.button;a.fn.button=function(b){return this.each(function(){var c=a(this),d=c.data("button"),e="object"==typeof b&&b;d||c.data("button",d=new h(this,e)),"toggle"==b?d.toggle():b&&d.setState(b)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=h,a.fn.button.noConflict=function(){return a.fn.button=g,this},a(document).on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")});var i=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};i.prototype={cycle:function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(b){var c=this.getActiveIndex(),d=this;if(!(b>this.$items.length-1||b<0))return this.sliding?this.$element.one("slid",function(){d.to(b)}):c==b?this.pause().cycle():this.slide(b>c?"next":"prev",a(this.$items[b]))},pause:function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(!this.sliding)return this.slide("next")},prev:function(){if(!this.sliding)return this.slide("prev")},slide:function(b,c){var d,e=this.$element.find(".item.active"),f=c||e[b](),g=this.interval,h="next"==b?"left":"right",i="next"==b?"first":"last",j=this;if(this.sliding=!0,g&&this.pause(),f=f.length?f:this.$element.find(".item")[i](),d=a.Event("slide",{relatedTarget:f[0],direction:h}),!f.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(j.$indicators.children()[j.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(d),d.isDefaultPrevented())return;f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),this.$element.one(a.support.transition.end,function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),j.sliding=!1,setTimeout(function(){j.$element.trigger("slid")},0)})}else{if(this.$element.trigger(d),d.isDefaultPrevented())return;e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return g&&this.cycle(),this}}};var g=a.fn.carousel;a.fn.carousel=function(b){return this.each(function(){var c=a(this),d=c.data("carousel"),e=a.extend({},a.fn.carousel.defaults,"object"==typeof b&&b),f="string"==typeof b?b:e.slide;d||c.data("carousel",d=new i(this,e)),"number"==typeof b?d.to(b):f?d[f]():e.interval&&d.pause().cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=i,a.fn.carousel.noConflict=function(){return a.fn.carousel=g,this},a(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d,e=a(this),f=a(e.attr("data-target")||(c=e.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),g=a.extend({},f.data(),e.data());f.carousel(g),(d=e.attr("data-slide-to"))&&f.data("carousel").pause().to(d).cycle(),b.preventDefault()});var j=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};j.prototype={constructor:j,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b,c,d,e;if(!this.transitioning&&!this.$element.hasClass("in")){if(b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find("> .accordion-group > .in"),d&&d.length){if(e=d.data("collapse"),e&&e.transitioning)return;d.collapse("hide"),e||d.data("collapse",null)}this.$element[b](0),this.transition("addClass",a.Event("show"),"shown"),a.support.transition&&this.$element[b](this.$element[0][c])}},hide:function(){var b;!this.transitioning&&this.$element.hasClass("in")&&(b=this.dimension(),this.reset(this.$element[b]()),this.transition("removeClass",a.Event("hide"),"hidden"),this.$element[b](0))},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[null!==a?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){"show"==c.type&&e.reset(),e.transitioning=0,e.$element.trigger(d)};this.$element.trigger(c),c.isDefaultPrevented()||(this.transitioning=1,this.$element[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var g=a.fn.collapse;a.fn.collapse=function(b){return this.each(function(){var c=a(this),d=c.data("collapse"),e=a.extend({},a.fn.collapse.defaults,c.data(),"object"==typeof b&&b);d||c.data("collapse",d=new j(this,e)),"string"==typeof b&&d[b]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=j,a.fn.collapse.noConflict=function(){return a.fn.collapse=g,this},a(document).on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":d.data();d[a(e).hasClass("in")?"addClass":"removeClass"]("collapsed"),a(e).collapse(f)});var k="[data-toggle=dropdown]",l=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};l.prototype={constructor:l,toggle:function(d){var e,f,g=a(this);if(!g.is(".disabled, :disabled"))return e=c(g),f=e.hasClass("open"),b(g),f||"ontouchstart"in document.documentElement&&a('<div class="dropdown-backdrop"/>').insertBefore(a(this)).on("click",b),e.toggleClass("open"),g.focus(),!1},keydown:function(b){var d,e,f,g,h;if(/(38|40|27)/.test(b.keyCode)&&(d=a(this),b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled"))){if(f=c(d),g=f.hasClass("open"),!g||g&&27==b.keyCode)return 27==b.which&&f.find(k).focus(),d.click();e=a("[role=menu] li:not(.divider):visible a",f),e.length&&(h=e.index(e.filter(":focus")),38==b.keyCode&&h>0&&h--,40==b.keyCode&&h<e.length-1&&h++,~h||(h=0),e.eq(h).focus())}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("dropdown");d||c.data("dropdown",d=new l(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=l,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.dropdown.data-api",b).on("click.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.dropdown.data-api",k,l.prototype.toggle).on("keydown.dropdown.data-api",k+", [role=menu]",l.prototype.keydown);var m=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};m.prototype={constructor:m,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this,c=a.Event("show");this.$element.trigger(c),this.isShown||c.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var c=a.support.transition&&b.$element.hasClass("fade");b.$element.parent().length||b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in").attr("aria-hidden",!1),b.enforceFocus(),c?b.$element.one(a.support.transition.end,function(){b.$element.focus().trigger("shown")}):b.$element.focus().trigger("shown")}))},hide:function(b){b&&b.preventDefault();b=a.Event("hide"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),a.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var b=this;a(document).on("focusin.modal",function(a){b.$element[0]===a.target||b.$element.has(a.target).length||b.$element.focus()})},escape:function(){var a=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(b){27==b.which&&a.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),b.hideModal()},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),b.hideModal()})},hideModal:function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('<div class="modal-backdrop '+c+'" />').appendTo(document.body),this.$backdrop.click("static"==this.options.backdrop?a.proxy(this.$element[0].focus,this.$element[0]):a.proxy(this.hide,this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b):b()):b&&b()}};var g=a.fn.modal;a.fn.modal=function(b){return this.each(function(){var c=a(this),d=c.data("modal"),e=a.extend({},a.fn.modal.defaults,c.data(),"object"==typeof b&&b);d||c.data("modal",d=new m(this,e)),"string"==typeof b?d[b]():e.show&&d.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=m,a.fn.modal.noConflict=function(){return a.fn.modal=g,this},a(document).on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f).one("hide",function(){c.focus()})});var n=function(a,b){this.init("tooltip",a,b)};n.prototype={constructor:n,init:function(b,c,d){var e,f,g,h,i;for(this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,g=this.options.trigger.split(" "),i=g.length;i--;)h=g[i],"click"==h?this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this)):"manual"!=h&&(e="hover"==h?"mouseenter":"focus",f="hover"==h?"mouseleave":"blur",this.$element.on(e+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,a.proxy(this.leave,this)));this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c,d=a.fn[this.type].defaults,e={};return this._options&&a.each(this._options,function(a,b){d[a]!=b&&(e[a]=b)},this),c=a(b.currentTarget)[this.type](e).data(this.type),c.options.delay&&c.options.delay.show?(clearTimeout(this.timeout),c.hoverState="in",void(this.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show))):c.show()},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);return this.timeout&&clearTimeout(this.timeout),c.options.delay&&c.options.delay.hide?(c.hoverState="out",void(this.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide))):c.hide()},show:function(){var b,c,d,e,f,g,h=a.Event("show");if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),h.isDefaultPrevented())return;switch(b=this.tip(),this.setContent(),this.options.animation&&b.addClass("fade"),f="function"==typeof this.options.placement?this.options.placement.call(this,b[0],this.$element[0]):this.options.placement,b.detach().css({top:0,left:0,display:"block"}),this.options.container?b.appendTo(this.options.container):b.insertAfter(this.$element),c=this.getPosition(),d=b[0].offsetWidth,e=b[0].offsetHeight,f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}this.applyPlacement(g,f),this.$element.trigger("shown")}},applyPlacement:function(a,b){var c,d,e,f,g=this.tip(),h=g[0].offsetWidth,i=g[0].offsetHeight;g.offset(a).addClass(b).addClass("in"),c=g[0].offsetWidth,d=g[0].offsetHeight,"top"==b&&d!=i&&(a.top=a.top+i-d,f=!0),"bottom"==b||"top"==b?(e=0,a.left<0&&(e=a.left*-2,a.left=0,g.offset(a),c=g[0].offsetWidth,d=g[0].offsetHeight),this.replaceArrow(e-h+c,c,"left")):this.replaceArrow(d-i,d,"top"),f&&g.offset(a)},replaceArrow:function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},setContent:function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},hide:function(){function b(){var b=setTimeout(function(){c.off(a.support.transition.end).detach()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.detach()})}var c=this.tip(),d=a.Event("hide");if(this.$element.trigger(d),!d.isDefaultPrevented())return c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?b():c.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},tip:function(){return this.$tip=this.$tip||a(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(b){var c=b?a(b.currentTarget)[this.type](this._options).data(this.type):this;c.tip().hasClass("in")?c.hide():c.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var g=a.fn.tooltip;a.fn.tooltip=function(b){return this.each(function(){var c=a(this),d=c.data("tooltip"),e="object"==typeof b&&b;d||c.data("tooltip",d=new n(this,e)),"string"==typeof b&&d[b]()})},a.fn.tooltip.Constructor=n,a.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},a.fn.tooltip.noConflict=function(){return a.fn.tooltip=g,this};var o=function(a,b){this.init("popover",a,b)};o.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:o,setContent:function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=("function"==typeof c.content?c.content.call(b[0]):c.content)||b.attr("data-content")},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var g=a.fn.popover;a.fn.popover=function(b){return this.each(function(){var c=a(this),d=c.data("popover"),e="object"==typeof b&&b;d||c.data("popover",d=new o(this,e)),"string"==typeof b&&d[b]()})},a.fn.popover.Constructor=o,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),a.fn.popover.noConflict=function(){return a.fn.popover=g,this},d.prototype={constructor:d,refresh:function(){var b,c=this;this.offsets=a([]),this.targets=a([]),b=this.$body.find(this.selector).map(function(){var b=a(this),d=b.data("target")||b.attr("href"),e=/^#\w/.test(d)&&a(d);return e&&e.length&&[[e.position().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),d]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},process:function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},activate:function(b){var c,d;this.activeTarget=b,a(this.selector).parent(".active").removeClass("active"),d=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',c=a(d).parent("li").addClass("active"),c.parent(".dropdown-menu").length&&(c=c.closest("li.dropdown").addClass("active")),c.trigger("activate")}};var g=a.fn.scrollspy;a.fn.scrollspy=function(b){return this.each(function(){var c=a(this),e=c.data("scrollspy"),f="object"==typeof b&&b;e||c.data("scrollspy",e=new d(this,f)),"string"==typeof b&&e[b]()})},a.fn.scrollspy.Constructor=d,a.fn.scrollspy.defaults={offset:10},a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=g,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})});var p=function(b){this.element=a(b)};p.prototype={constructor:p,show:function(){var b,c,d,e=this.element,f=e.closest("ul:not(.dropdown-menu)"),g=e.attr("data-target");g||(g=e.attr("href"),g=g&&g.replace(/.*(?=#[^\s]*$)/,"")),e.parent("li").hasClass("active")||(b=f.find(".active:last a")[0],d=a.Event("show",{relatedTarget:b}),e.trigger(d),d.isDefaultPrevented()||(c=a(g),this.activate(e.parent("li"),f),this.activate(c,c.parent(),function(){e.trigger({type:"shown",relatedTarget:b})})))},activate:function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e):e(),f.removeClass("in")}};var g=a.fn.tab;a.fn.tab=function(b){return this.each(function(){var c=a(this),d=c.data("tab");d||c.data("tab",d=new p(this)),"string"==typeof b&&d[b]()})},a.fn.tab.Constructor=p,a.fn.tab.noConflict=function(){return a.fn.tab=g,this},a(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")});var q=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=a(this.options.menu),this.shown=!1,this.listen()};q.prototype={constructor:q,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(a)).change(),this.hide()},updater:function(a){return a},show:function(){var b=a.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:b.top+b.height,left:b.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(c=a.isFunction(this.source)?this.source(this.query,a.proxy(this.process,this)):this.source,c?this.process(c):this)},process:function(b){var c=this;return b=a.grep(b,function(a){return c.matcher(a)}),b=this.sorter(b),b.length?this.render(b.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(a){return~a.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){for(var b,c=[],d=[],e=[];b=a.shift();)b.toLowerCase().indexOf(this.query.toLowerCase())?~b.indexOf(this.query)?d.push(b):e.push(b):c.push(b);return c.concat(d,e)},highlighter:function(a){var b=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return a.replace(new RegExp("("+b+")","ig"),function(a,b){return"<strong>"+b+"</strong>"})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("focus",a.proxy(this.focus,this)).on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",a.proxy(this.keydown,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this)).on("mouseleave","li",a.proxy(this.mouseleave,this))},eventSupported:function(a){var b=a in this.$element;return b||(this.$element.setAttribute(a,"return;"),b="function"==typeof this.$element[a]),b},move:function(a){if(this.shown){switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}a.stopPropagation()}},keydown:function(b){this.suppressKeyPressRepeat=~a.inArray(b.keyCode,[40,38,9,13,27]),this.move(b)},keypress:function(a){this.suppressKeyPressRepeat||this.move(a)},keyup:function(a){switch(a.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},focus:function(a){this.focused=!0},blur:function(a){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(a){a.stopPropagation(),a.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(b){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")},mouseleave:function(a){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var g=a.fn.typeahead;a.fn.typeahead=function(b){return this.each(function(){var c=a(this),d=c.data("typeahead"),e="object"==typeof b&&b;d||c.data("typeahead",d=new q(this,e)),"string"==typeof b&&d[b]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},a.fn.typeahead.Constructor=q,a.fn.typeahead.noConflict=function(){return a.fn.typeahead=g,this},a(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);c.data("typeahead")||c.typeahead(c.data())});var r=function(b,c){this.options=a.extend({},a.fn.affix.defaults,c),this.$window=a(window).on("scroll.affix.data-api",a.proxy(this.checkPosition,this)).on("click.affix.data-api",a.proxy(function(){setTimeout(a.proxy(this.checkPosition,this),1)},this)),this.$element=a(b),this.checkPosition()};r.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b,c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.bottom,h=f.top,i="affix affix-top affix-bottom";"object"!=typeof f&&(g=h=f),"function"==typeof h&&(h=f.top()),"function"==typeof g&&(g=f.bottom()),b=!(null!=this.unpin&&d+this.unpin<=e.top)&&(null!=g&&e.top+this.$element.height()>=c-g?"bottom":null!=h&&d<=h&&"top"),this.affixed!==b&&(this.affixed=b,this.unpin="bottom"==b?e.top-d:null,this.$element.removeClass(i).addClass("affix"+(b?"-"+b:"")))}};var g=a.fn.affix;a.fn.affix=function(b){return this.each(function(){var c=a(this),d=c.data("affix"),e="object"==typeof b&&b;d||c.data("affix",d=new r(this,e)),"string"==typeof b&&d[b]()})},a.fn.affix.Constructor=r,a.fn.affix.defaults={offset:0},a.fn.affix.noConflict=function(){return a.fn.affix=g,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})});
  165. /**
  166. * Essential is a clean and customizable theme.
  167. *
  168. * @package theme_essential
  169. * @copyright 2016 Gareth J Barnard
  170. * @copyright 2015 Gareth J Barnard
  171. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  172. */
  173. /* jshint ignore:start */
  174. define('theme_essential/anti_gravity', ["jquery","core/log"],function(a,b){"use strict";// jshint ;_;
  175. b.debug("Essential anti gravity AMD initialised"),a(document).ready(function(){var b=220,c=500;a(window).scroll(function(){a(window).scrollTop()>b?a(".back-to-top").fadeIn(c):a(".back-to-top").fadeOut(c)}),a(".back-to-top").click(function(b){return b.preventDefault(),a("html, body").animate({scrollTop:0},c),!1}),a('a[href="\\#region-main"]').click(function(b){b.preventDefault();var d=a("#region-main");return a("html, body").animate({scrollTop:d.height()},c),!1})})});
  176. /**
  177. * @author Jason Roy for CompareNetworks Inc.
  178. * Thanks to mikejbond for suggested udaptes
  179. *
  180. * Version 1.1
  181. * Copyright (c) 2009 CompareNetworks Inc.
  182. *
  183. * Licensed under the MIT license:
  184. * http://www.opensource.org/licenses/mit-license.php
  185. *
  186. */
  187. /* jshint ignore:start */
  188. define('theme_essential/jBreadCrumb', ["jquery","core/log"],function(a,b){"use strict";
  189. // Private functions
  190. function c(){
  191. //Check if easing plugin exists. If it doesn't, use "swing"
  192. g="object"==typeof a.easing?"easeOutQuad":"swing",
  193. //The reference object containing all of the breadcrumb elements
  194. j=a(i).find("li"),
  195. //Keep it from overflowing in ie6 & 7
  196. a(i).find("ul").wrap('<div style="overflow:hidden; position:relative; width: '+a(i).css("width")+';"><div>'),
  197. //If the breadcrumb contains nothing, don't do anything
  198. j.length>0&&(a(j[j.length-1]).addClass("last"),a(j[0]).addClass("first"),
  199. //If the breadcrumb object length is long enough, compress.
  200. j.length>h.minimumCompressionElements&&d())}function d(){
  201. // Factor to determine if we should compress the element at all
  202. var b=a(j[j.length-1]);
  203. // If the final element is really long, compress more elements
  204. a(b).width()>h.maxFinalElementLength&&(h.beginningElementsToLeaveOpen>0&&h.beginningElementsToLeaveOpen--,h.endElementsToLeaveOpen>0&&h.endElementsToLeaveOpen--),/* If the final element is within the short and long range,
  205. compress to the default end elements and 1 less beginning elements. */
  206. a(b).width()<h.maxFinalElementLength&&a(b).width()>h.minFinalElementLength&&h.beginningElementsToLeaveOpen>0&&h.beginningElementsToLeaveOpen--;var c=j.length-1-h.endElementsToLeaveOpen;
  207. // We compress only elements determined by the formula setting below.
  208. a(j).each(function(b,d){if(b>h.beginningElementsToLeaveOpen&&b<c){a(d).find("a").wrap("<span></span>").width(a(d).find("a").width()+h.previewWidth);var g={id:b,width:a(d).width(),listElement:a(d).find("span"),isAnimating:!1,element:a(d).find("span")};a(d).bind("mouseover",g,e).bind("mouseout",g,f),a(d).find("a").unbind("mouseover",e).unbind("mouseout",f),d.autoInterval=setInterval(function(){clearInterval(d.autoInterval),a(d).find("span").animate({width:h.previewWidth},h.timeInitialCollapse,h.easing)},150*(b-2))}})}function e(b){var c=b.data.width;return a(b.data.element).stop(),a(b.data.element).animate({width:c+h.previewWidth/2},{duration:h.timeExpansionAnimation,easing:h.easing,queue:!1}),!1}function f(b){return a(b.data.element).stop(),a(b.data.element).animate({width:h.previewWidth},{duration:h.timeCompressionAnimation,easing:h.easing,queue:!1}),!1}// jshint ;_;
  209. b.debug("Essential jBreadCrumb AMD");
  210. // Private variables
  211. var g,h={},i={},j={};
  212. // Public functions
  213. // Public global variables.
  214. return a.fn.jBreadCrumb=function(b){return h=a.extend({},a.fn.jBreadCrumb.defaults,b),this.each(function(){i=a(this),c()})},a.fn.jBreadCrumb.defaults={maxFinalElementLength:Math.round(.05*a(window).width()),minFinalElementLength:Math.round(.02*a(window).width()),minimumCompressionElements:1,endElementsToLeaveOpen:0,beginningElementsToLeaveOpen:0,timeExpansionAnimation:500,timeCompressionAnimation:400,timeInitialCollapse:500,easing:"swing",previewWidth:Math.round(.015*a(window).width())},{init:function(){a(document).ready(function(a){a(".breadcrumb.style1").jBreadCrumb()}),b.debug("Essential jBreadCrumb AMD init")}}});
  215. /**
  216. * Essential is a clean and customizable theme.
  217. *
  218. * @package theme_essential
  219. * @copyright 2016 Gareth J Barnard
  220. * @copyright 2015 Gareth J Barnard
  221. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  222. */
  223. /* jshint ignore:start */
  224. define('theme_essential/inspector_scourer', ["jquery","jqueryui","core/log"],function(a,b,c){"use strict";// jshint ;_;
  225. return c.debug("Essential Inspector Scourer AMD initialised"),{init:function(b){a(document).ready(function(a){c.debug("Essential Inspector Scourer AMD init"),c.debug("Essential Inspector Scourer AJAX File: "+b.theme),a("#courseitemsearch").autocomplete({source:b.theme,appendTo:"#courseitemsearchresults",minLength:2,select:function(a,b){var c=b.item.id;"#"!=c&&(location.href=c)}}).prop("disabled",!1)})}}});
  226. /**
  227. * Essential is a clean and customizable theme.
  228. *
  229. * @package theme_essential
  230. * @copyright 2016 Gareth J Barnard
  231. * @copyright 2015 Gareth J Barnard
  232. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  233. */
  234. /* jshint ignore:start */
  235. define('theme_essential/course_navigation', ["jquery","core/log"],function(a,b){"use strict";// jshint ;_;
  236. return b.debug("Essential Course Navigation AMD."),{init:function(){b.debug("Essential Course Navigation AMD init."),a(document).ready(function(a){var c=0,d=500,e=0;a(".navbar").length&&(e=a(".navbar"),c=e.height(),b.debug("Essential Course Navigation AMD navbar height: "+c));var f=location.href,g=location.href.indexOf("#");if(b.debug("Essential Course Navigation AMD navigation pageHrefBase 1: "+f),b.debug("Essential Course Navigation AMD navigation hrefIndex: "+g),g!=-1){f=location.href.substring(0,g),b.debug("Essential Course Navigation AMD navigation pageHrefBase 2: "+f);
  237. // We are an anchor on the same site - otherwise why would this run? Therefore still need to scroll.
  238. var h=location.href,i=h.substring(h.indexOf("#")+1);b.debug("Essential Course Navigation AMD navigation page hash: "+i);var j=a('[id="'+i+'"]'),k=j.offset().top,l=k;e&&(l-="fixed"==e.css("position")?c:2*c),a("html, body").animate({scrollTop:l},d),b.debug("Essential Course Navigation AMD navigation page scrollTop: "+l),b.debug("Essential Course Navigation AMD navigation page target offset: "+k)}a('a[href*="\\#section-"]').each(function(){var g=this.href.substring(0,this.href.indexOf("#"));b.debug("Essential Course Navigation AMD navigation element: "+a(this).attr("href")),b.debug("Essential Course Navigation AMD navigation linkHrefBase: "+g),f==g&&a(this).click(function(f){f.preventDefault();var g=this.href;b.debug("Essential Course Navigation AMD navigation element url: "+g);var h=g.substring(g.indexOf("#")+1);b.debug("Essential Course Navigation AMD navigation element hash: "+h);var i=a('[id="'+h+'"]'),j=i.offset().top,k=j;e&&(k-="fixed"==e.css("position")?c:2*c),a("html, body").animate({scrollTop:k},d),b.debug("Essential Course Navigation AMD navigation element scrollTop: "+k),b.debug("Essential Course Navigation AMD navigation element target offset: "+j)})})})}}});
  239. /* jshint ignore:start */
  240. define('theme_essential/carousel', ["jquery","theme_bootstrapbase/bootstrap","core/log"],function(a,b,c){"use strict";// jshint ;_;
  241. return c.debug("Essential carousel AMD"),{init:function(b){c.debug("Essential carousel AMD init, slide interval: "+b.slideinterval+", slideright: "+b.slideright),a(document).ready(function(a){a("#essentialCarousel").carousel({interval:b.slideinterval,dirright:b.slideright})})}}});
  242. /**
  243. * Essential is a clean and customizable theme.
  244. *
  245. * @package theme_essential
  246. * @copyright 2016 Gareth J Barnard
  247. * @copyright 2015 Gareth J Barnard
  248. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  249. */
  250. /* jshint ignore:start */
  251. define('theme_essential/coloursswitcher', ["jquery","core/log"],function(a,b){"use strict";// jshint ;_;
  252. return b.debug("Essential Colour Switcher AMD"),function(a){
  253. // Constructor.
  254. var c=function(b,c){this.$element=a(b),this.SCHEMES=["default","alternative1","alternative2","alternative3","alternative4"],this.scheme="default",this.init(c)};c.prototype={constructor:c,init:function(c){var d,e;/* Attach events to the links to change colours scheme so we can do it with
  255. JavaScript without refreshing the page. */
  256. b.debug("Colour switcher on element: "+c.div);var f=a("body");for(d in this.SCHEMES){e=this.SCHEMES[d],
  257. // Check if this is the current colour.
  258. f.hasClass("essential-colours-"+e)&&(this.scheme=e,b.debug("Colour switcher current scheme: "+e));var g=this;a(c.div+" ."+e).each(function(){b.debug("Colour switcher 'init' each: "+e),a(this).click({scheme:e,us:g},g.setScheme)})}},setScheme:function(a){if(a.preventDefault(),b.debug("Colour switcher 'setScheme' scheme: "+a.data.scheme),b.debug("Colour switcher 'setScheme' our scheme: "+a.data.us.scheme),a.data.scheme!=a.data.us.scheme){
  259. // Switch over the CSS classes on the body.
  260. var c="essential-colours-";
  261. // The $element is the 'body', see module 'init' below.
  262. a.data.us.$element.removeClass(c+a.data.us.scheme).addClass(c+a.data.scheme),
  263. // Update the current colour.
  264. a.data.us.scheme=a.data.scheme,
  265. // Store the users selection (uses AJAX to save to the database).
  266. // Core YUI function, so only need to replace if core changes.
  267. M.util.set_user_preference("theme_essential_colours",a.data.us.scheme),b.debug("Colour switcher 'setScheme' our scheme now: "+a.data.us.scheme)}}};
  268. // Plugin definition.
  269. var d=a.fn.ColoursSwitcher;a.fn.ColoursSwitcher=function(a){return new c(this,a),this},
  270. // No conflict.
  271. a.fn.ColoursSwitcher.noConflict=function(){return a.fn.ColoursSwitcher=d,this}}(a),{init:function(c){a(document).ready(function(a){return b.debug("Essential Colour Switcher AMD init"),a(document.body).ColoursSwitcher(c)})}}});
  272. /**
  273. * Essential is a clean and customizable theme.
  274. *
  275. * @package theme_essential
  276. * @copyright 2016 Gareth J Barnard
  277. * @copyright 2015 Gareth J Barnard
  278. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  279. */
  280. /* jshint ignore:start */
  281. define('theme_essential/affix', ["jquery","theme_bootstrapbase/bootstrap","core/log"],function(a,b,c){"use strict";// jshint ;_;
  282. return c.debug("Essential affix AMD"),{init:function(){a(document).ready(function(a){if(a("#essentialnavbar").length){var b=a("#essentialnavbar"),d=a("#page-header").height();c.debug("Essential affix AMD pageheaderHeight: "+d),b.affix({offset:{top:function(){d=a("#page-header").height(),c.debug("Essential affix offset AMD phh: "+d);var e=a(window).scrollTop();c.debug("Essential affix offset AMD wst: "+e);var f=d-e;return c.debug("Essential affix offset AMD diff: "+f),f<0&&(f=0),b.css("top",f+"px"),d}}}),a(window).resize(function(){d=a("#page-header").height(),c.debug("Essential affix resize AMD phh: "+d);var e=a(window).scrollTop();c.debug("Essential affix resize AMD wst: "+e);var f=d-e;c.debug("Essential affix resize AMD diff: "+f),f<0&&(f=0),b.css("top",f+"px")})}}),c.debug("Essential affix AMD init")}}});
  283. /**
  284. * Essential is a clean and customizable theme.
  285. *
  286. * @package theme_essential
  287. * @copyright 2016 Gareth J Barnard
  288. * @copyright 2015 Gareth J Barnard
  289. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  290. */
  291. /* jshint ignore:start */
  292. define('theme_essential/header', ["jquery","core/log"],function(a,b){"use strict";// jshint ;_;
  293. return b.debug("Essential header AMD"),{init:function(){a(document).ready(function(a){if(a("#page-header .titlearea").length&&a("#essentialicons").length){var c=a("#page-header .titlearea");a("#essentialicons").on("hide",function(){c.fadeIn()}),a("#essentialicons").on("show",function(){c.fadeOut()})}if(a("#essentialicons").length&&a("#essentialnavbar").length){var d=a("#essentialnavbar");a("#essentialicons").on("hidden",function(){var c=a("#page-header").height();b.debug("Essential header hidden AMD phh: "+c);var e=a(window).scrollTop();b.debug("Essential header hidden AMD wst: "+e);var f=c-e;b.debug("Essential header hidden AMD diff: "+f),f<0&&(f=0),d.css("top",f+"px")}),a("#essentialicons").on("shown",function(){var c=a("#page-header").height();b.debug("Essential header shown AMD phh: "+c);var e=a(window).scrollTop();b.debug("Essential header shown AMD wst: "+e);var f=c-e;b.debug("Essential header shown AMD diff: "+f),f<0&&(f=0),d.css("top",f+"px")})}}),b.debug("Essential header AMD init")}}});
  294. /* jshint ignore:start */
  295. define('theme_essential/fitvids', ["jquery","core/log"],function(a,b){"use strict";// jshint ;_;
  296. /*jshint browser:true */
  297. /*!
  298. * FitVids 1.1.
  299. *
  300. * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
  301. * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
  302. * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
  303. *
  304. * Adapted to AMD for Moodle by Gareth J Barnard.
  305. *
  306. */
  307. return b.debug("Essential fitvids AMD"),a.fn.fitVids=function(c){var d={customSelector:null,ignore:"object[type='application/pdf']"};if(!document.getElementById("fit-vids-style")){
  308. // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
  309. var e=document.head||document.getElementsByTagName("head")[0],f=".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}",g=document.createElement("div");g.innerHTML='<p>x</p><style id="fit-vids-style">'+f+"</style>",e.appendChild(g.childNodes[1])}return c&&a.extend(d,c),this.each(function(){var c=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];d.customSelector&&c.push(d.customSelector);var e=".fitvidsignore";d.ignore&&(e=e+", "+d.ignore);var f=a(this).find(c.join(","));f=f.not("object object"),// SwfObj conflict patch.
  310. f=f.not(e),// Disable FitVids on these.
  311. f.each(function(){var c=a(this);if(b.debug("FitVids attempt on: "+c.prop("outerHTML")),c.parents(e).length>0)return void b.debug("FitVids not on (ignoreList)");var d=c.attr("id");if(d){if("onlineaudiorecorder"===d)return void b.debug("FitVids not on (onlineaudiorecorder)");if(d.indexOf("mp3")>=0)return void b.debug("FitVids not on (core media mp3)")}if(b.debug("FitVids attempt successful"),!("embed"===this.tagName.toLowerCase()&&c.parent("object").length||c.parent(".fluid-width-video-wrapper").length)){c.css("height")||c.css("width")||!isNaN(c.attr("height"))&&!isNaN(c.attr("width"))||(c.attr("height",9),c.attr("width",16));var f="object"===this.tagName.toLowerCase()||c.attr("height")&&!isNaN(parseInt(c.attr("height"),10))?parseInt(c.attr("height"),10):c.height(),g=isNaN(parseInt(c.attr("width"),10))?c.width():parseInt(c.attr("width"),10),h=f/g;if(!c.attr("id")){var i="fitvid"+Math.floor(999999*Math.random());c.attr("id",i)}c.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*h+"%"),c.removeAttr("height").removeAttr("width")}})})},{init:function(){a(document).ready(function(a){a("#page").fitVids()}),b.debug("Essential fitvids AMD init")}}});
  312. /**
  313. * Essential is a clean and customizable theme.
  314. *
  315. * @package theme_essential
  316. * @copyright 2016 Gareth J Barnard
  317. * @copyright 2015 Gareth J Barnard
  318. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  319. */
  320. /* jshint ignore:start */
  321. define('theme_essential/footer', ["jquery","core/log"],function(a,b){"use strict";// jshint ;_;
  322. return b.debug("Essential Footer AMD."),{init:function(){b.debug("Essential Footer AMD init."),a(document).ready(function(a){if(a("#page-footer").length){// Might not have a footer.
  323. var c=a(document).height();if(a("html").height()<c){b.debug("Essential Footer AMD adjusting footer position.");var d=a("#page-footer"),e=d.offset().top,f=d.outerHeight();b.debug("Calculated page footer offset: "+f+"."),f=c-f,b.debug("Old footer offset: "+e+"."),b.debug("Calculated footer offset: "+f+"."),b.debug("Old document height: "+c+"."),d.offset({top:f,left:0}),d.css("left",0);// Negate the effect of the dock.
  324. var g=d.offset().top;b.debug("New footer offset: "+g+"."),b.debug("New document height: "+a(document).height()+".")}}})}}});
  325. /*!
  326. Holder - client side image placeholders
  327. Version 2.9.0+f2dkw
  328. © 2015 Ivan Malopinsky - http://imsky.co
  329. Site: http://holderjs.com
  330. Issues: https://github.com/imsky/holder/issues
  331. License: MIT
  332. */
  333. !function(e){if(e.document){var t=e.document;t.querySelectorAll||(t.querySelectorAll=function(n){var r,i=t.createElement("style"),o=[];for(t.documentElement.firstChild.appendChild(i),t._qsa=[],i.styleSheet.cssText=n+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",e.scrollBy(0,0),i.parentNode.removeChild(i);t._qsa.length;)r=t._qsa.shift(),r.style.removeAttribute("x-qsa"),o.push(r);return t._qsa=null,o}),t.querySelector||(t.querySelector=function(e){var n=t.querySelectorAll(e);return n.length?n[0]:null}),t.getElementsByClassName||(t.getElementsByClassName=function(e){return e=String(e).replace(/^|\s+/g,"."),t.querySelectorAll(e)}),Object.keys||(Object.keys=function(e){if(e!==Object(e))throw TypeError("Object.keys called on non-object");var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n}),Array.prototype.forEach||(Array.prototype.forEach=function(e){if(void 0===this||null===this)throw TypeError();var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw TypeError();var r,i=arguments[1];for(r=0;n>r;r++)r in t&&e.call(i,t[r],r,t)}),function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.atob=e.atob||function(e){e=String(e);var n,r=0,i=[],o=0,a=0;if(e=e.replace(/\s/g,""),e.length%4===0&&(e=e.replace(/=+$/,"")),e.length%4===1)throw Error("InvalidCharacterError");if(/[^+/0-9A-Za-z]/.test(e))throw Error("InvalidCharacterError");for(;r<e.length;)n=t.indexOf(e.charAt(r)),o=o<<6|n,a+=6,24===a&&(i.push(String.fromCharCode(o>>16&255)),i.push(String.fromCharCode(o>>8&255)),i.push(String.fromCharCode(255&o)),a=0,o=0),r+=1;return 12===a?(o>>=4,i.push(String.fromCharCode(255&o))):18===a&&(o>>=2,i.push(String.fromCharCode(o>>8&255)),i.push(String.fromCharCode(255&o))),i.join("")},e.btoa=e.btoa||function(e){e=String(e);var n,r,i,o,a,s,l,h=0,u=[];if(/[^\x00-\xFF]/.test(e))throw Error("InvalidCharacterError");for(;h<e.length;)n=e.charCodeAt(h++),r=e.charCodeAt(h++),i=e.charCodeAt(h++),o=n>>2,a=(3&n)<<4|r>>4,s=(15&r)<<2|i>>6,l=63&i,h===e.length+2?(s=64,l=64):h===e.length+1&&(l=64),u.push(t.charAt(o),t.charAt(a),t.charAt(s),t.charAt(l));return u.join("")}}(e),Object.prototype.hasOwnProperty||(Object.prototype.hasOwnProperty=function(e){var t=this.__proto__||this.constructor.prototype;return e in this&&(!(e in t)||t[e]!==this[e])}),function(){if("performance"in e==!1&&(e.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in e.performance==!1){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),e.performance.now=function(){return Date.now()-t}}}(),e.requestAnimationFrame||(e.webkitRequestAnimationFrame?!function(e){e.requestAnimationFrame=function(t){return webkitRequestAnimationFrame(function(){t(e.performance.now())})},e.cancelAnimationFrame=webkitCancelAnimationFrame}(e):e.mozRequestAnimationFrame?!function(e){e.requestAnimationFrame=function(t){return mozRequestAnimationFrame(function(){t(e.performance.now())})},e.cancelAnimationFrame=mozCancelAnimationFrame}(e):!function(e){e.requestAnimationFrame=function(t){return e.setTimeout(t,1e3/60)},e.cancelAnimationFrame=e.clearTimeout}(e))}}(this),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define('theme_essential/holder', [],t):"object"==typeof exports?exports.Holder=t():e.Holder=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){(function(t){function r(e,t,n,r){var a=i(n.substr(n.lastIndexOf(e.domain)),e);a&&o({mode:null,el:r,flags:a,engineSettings:t})}function i(e,t){var n={theme:T(F.settings.themes.gray,null),stylesheets:t.stylesheets,instanceOptions:t},r=e.split("?"),i=r[0].split("/");n.holderURL=e;var o=i[1],a=o.match(/([\d]+p?)x([\d]+p?)/);if(!a)return!1;if(n.fluid=-1!==o.indexOf("p"),n.dimensions={width:a[1].replace("p","%"),height:a[2].replace("p","%")},2===r.length){var s=v.parse(r[1]);if(s.bg&&(n.theme.bg=w.parseColor(s.bg)),s.fg&&(n.theme.fg=w.parseColor(s.fg)),s.bg&&!s.fg&&(n.autoFg=!0),s.theme&&n.instanceOptions.themes.hasOwnProperty(s.theme)&&(n.theme=T(n.instanceOptions.themes[s.theme],null)),s.text&&(n.text=s.text),s.textmode&&(n.textmode=s.textmode),s.size&&(n.size=s.size),s.font&&(n.font=s.font),s.align&&(n.align=s.align),s.lineWrap&&(n.lineWrap=s.lineWrap),n.nowrap=w.truthy(s.nowrap),n.auto=w.truthy(s.auto),n.outline=w.truthy(s.outline),w.truthy(s.random)){F.vars.cache.themeKeys=F.vars.cache.themeKeys||Object.keys(n.instanceOptions.themes);var l=F.vars.cache.themeKeys[0|Math.random()*F.vars.cache.themeKeys.length];n.theme=T(n.instanceOptions.themes[l],null)}}return n}function o(e){var t=e.mode,n=e.el,r=e.flags,i=e.engineSettings,o=r.dimensions,s=r.theme,l=o.width+"x"+o.height;t=null==t?r.fluid?"fluid":"image":t;var d=/holder_([a-z]+)/g,c=!1;if(null!=r.text&&(s.text=r.text,"object"===n.nodeName.toLowerCase())){for(var f=s.text.split("\\n"),p=0;p<f.length;p++)f[p]=w.encodeHtmlEntity(f[p]);s.text=f.join("\\n")}if(s.text){var g=s.text.match(d);null!==g&&g.forEach(function(e){"holder_dimensions"===e&&(s.text=s.text.replace(e,l))})}var m=r.holderURL,v=T(i,null);if(r.font&&(s.font=r.font,!v.noFontFallback&&"img"===n.nodeName.toLowerCase()&&F.setup.supportsCanvas&&"svg"===v.renderer&&(v=T(v,{renderer:"canvas"}))),r.font&&"canvas"==v.renderer&&(v.reRender=!0),"background"==t)null==n.getAttribute("data-background-src")&&x.setAttr(n,{"data-background-src":m});else{var y={};y[F.vars.dataAttr]=m,x.setAttr(n,y)}r.theme=s,n.holderData={flags:r,engineSettings:v},("image"==t||"fluid"==t)&&x.setAttr(n,{alt:s.text?c?s.text:s.text+" ["+l+"]":l});var b={mode:t,el:n,holderSettings:{dimensions:o,theme:s,flags:r},engineSettings:v};"image"==t?(r.auto||(n.style.width=o.width+"px",n.style.height=o.height+"px"),"html"==v.renderer?n.style.backgroundColor=s.background:(a(b),"exact"==r.textmode&&(n.holderData.resizeUpdate=!0,F.vars.resizableImages.push(n),h(n)))):"background"==t&&"html"!=v.renderer?a(b):"fluid"==t&&(n.holderData.resizeUpdate=!0,"%"==o.height.slice(-1)?n.style.height=o.height:null!=r.auto&&r.auto||(n.style.height=o.height+"px"),"%"==o.width.slice(-1)?n.style.width=o.width:null!=r.auto&&r.auto||(n.style.width=o.width+"px"),("inline"==n.style.display||""===n.style.display||"none"==n.style.display)&&(n.style.display="block"),u(n),"html"==v.renderer?n.style.backgroundColor=s.background:(F.vars.resizableImages.push(n),h(n)))}function a(e){function n(){var t=null;switch(l.renderer){case"canvas":t=E(u,e);break;case"svg":t=C(u,e);break;default:throw"Holder: invalid renderer: "+l.renderer}return t}var r=null,i=e.mode,o=e.el,a=e.holderSettings,l=e.engineSettings;switch(l.renderer){case"svg":if(!F.setup.supportsSVG)return;break;case"canvas":if(!F.setup.supportsCanvas)return;break;default:return}var h={width:a.dimensions.width,height:a.dimensions.height,theme:a.theme,flags:a.flags},u=s(h);if(r=n(),null==r)throw"Holder: couldn't render placeholder";"background"==i?(o.style.backgroundImage="url("+r+")",o.style.backgroundSize=h.width+"px "+h.height+"px"):("img"===o.nodeName.toLowerCase()?x.setAttr(o,{src:r}):"object"===o.nodeName.toLowerCase()&&x.setAttr(o,{data:r,type:"image/svg+xml"}),l.reRender&&t.setTimeout(function(){var e=n();if(null==e)throw"Holder: couldn't render placeholder";"img"===o.nodeName.toLowerCase()?x.setAttr(o,{src:e}):"object"===o.nodeName.toLowerCase()&&x.setAttr(o,{data:e,type:"image/svg+xml"})},150)),x.setAttr(o,{"data-holder-rendered":!0})}function s(e){function t(e,t,n,r){t.width=n,t.height=r,e.width=Math.max(e.width,t.width),e.height+=t.height}var n=F.defaults.size;switch(parseFloat(e.theme.size)?n=e.theme.size:parseFloat(e.flags.size)&&(n=e.flags.size),e.font={family:e.theme.font?e.theme.font:"Arial, Helvetica, Open Sans, sans-serif",size:l(e.width,e.height,n,F.defaults.scale),units:e.theme.units?e.theme.units:F.defaults.units,weight:e.theme.fontweight?e.theme.fontweight:"bold"},e.text=e.theme.text||Math.floor(e.width)+"x"+Math.floor(e.height),e.noWrap=e.theme.nowrap||e.flags.nowrap,e.align=e.theme.align||e.flags.align||"center",e.flags.textmode){case"literal":e.text=e.flags.dimensions.width+"x"+e.flags.dimensions.height;break;case"exact":if(!e.flags.exactDimensions)break;e.text=Math.floor(e.flags.exactDimensions.width)+"x"+Math.floor(e.flags.exactDimensions.height)}var r=e.flags.lineWrap||F.setup.lineWrapRatio,i=e.width*r,o=i,a=new y({width:e.width,height:e.height}),s=a.Shape,h=new s.Rect("holderBg",{fill:e.theme.bg});if(h.resize(e.width,e.height),a.root.add(h),e.flags.outline){var u=new S(h.properties.fill);u=u.lighten(u.lighterThan("7f7f7f")?-.1:.1),h.properties.outline={fill:u.toHex(!0),width:2}}var d=e.theme.fg;if(e.flags.autoFg){var c=new S(h.properties.fill),f=new S("fff"),p=new S("000",{alpha:.285714});d=c.blendAlpha(c.lighterThan("7f7f7f")?p:f).toHex(!0)}var g=new s.Group("holderTextGroup",{text:e.text,align:e.align,font:e.font,fill:d});g.moveTo(null,null,1),a.root.add(g);var m=g.textPositionData=z(a);if(!m)throw"Holder: staging fallback not supported yet.";g.properties.leading=m.boundingBox.height;var v=null,w=null;if(m.lineCount>1){var b,x=0,A=0,C=0;w=new s.Group("line"+C),("left"===e.align||"right"===e.align)&&(o=e.width*(1-2*(1-r)));for(var E=0;E<m.words.length;E++){var T=m.words[E];v=new s.Text(T.text);var k="\\n"==T.text;!e.noWrap&&(x+T.width>=o||k===!0)&&(t(g,w,x,g.properties.leading),g.add(w),x=0,A+=g.properties.leading,C+=1,w=new s.Group("line"+C),w.y=A),k!==!0&&(v.moveTo(x,0),x+=m.spaceWidth+T.width,w.add(v))}if(t(g,w,x,g.properties.leading),g.add(w),"left"===e.align)g.moveTo(e.width-i,null,null);else if("right"===e.align){for(b in g.children)w=g.children[b],w.moveTo(e.width-w.width,null,null);g.moveTo(0-(e.width-i),null,null)}else{for(b in g.children)w=g.children[b],w.moveTo((g.width-w.width)/2,null,null);g.moveTo((e.width-g.width)/2,null,null)}g.moveTo(null,(e.height-g.height)/2,null),(e.height-g.height)/2<0&&g.moveTo(null,0,null)}else v=new s.Text(e.text),w=new s.Group("line0"),w.add(v),g.add(w),"left"===e.align?g.moveTo(e.width-i,null,null):"right"===e.align?g.moveTo(0-(e.width-i),null,null):g.moveTo((e.width-m.boundingBox.width)/2,null,null),g.moveTo(null,(e.height-m.boundingBox.height)/2,null);return a}function l(e,t,n,r){var i=parseInt(e,10),o=parseInt(t,10),a=Math.max(i,o),s=Math.min(i,o),l=.8*Math.min(s,a*r);return Math.round(Math.max(n,l))}function h(e){var t;t=null==e||null==e.nodeType?F.vars.resizableImages:[e];for(var n=0,r=t.length;r>n;n++){var i=t[n];if(i.holderData){var o=i.holderData.flags,s=k(i);if(s){if(!i.holderData.resizeUpdate)continue;if(o.fluid&&o.auto){var l=i.holderData.fluidConfig;switch(l.mode){case"width":s.height=s.width/l.ratio;break;case"height":s.width=s.height*l.ratio}}var h={mode:"image",holderSettings:{dimensions:s,theme:o.theme,flags:o},el:i,engineSettings:i.holderData.engineSettings};"exact"==o.textmode&&(o.exactDimensions=s,h.holderSettings.dimensions=o.dimensions),a(h)}else f(i)}}}function u(e){if(e.holderData){var t=k(e);if(t){var n=e.holderData.flags,r={fluidHeight:"%"==n.dimensions.height.slice(-1),fluidWidth:"%"==n.dimensions.width.slice(-1),mode:null,initialDimensions:t};r.fluidWidth&&!r.fluidHeight?(r.mode="width",r.ratio=r.initialDimensions.width/parseFloat(n.dimensions.height)):!r.fluidWidth&&r.fluidHeight&&(r.mode="height",r.ratio=parseFloat(n.dimensions.width)/r.initialDimensions.height),e.holderData.fluidConfig=r}else f(e)}}function d(){var e,n=[],r=Object.keys(F.vars.invisibleImages);r.forEach(function(t){e=F.vars.invisibleImages[t],k(e)&&"img"==e.nodeName.toLowerCase()&&(n.push(e),delete F.vars.invisibleImages[t])}),n.length&&O.run({images:n}),setTimeout(function(){t.requestAnimationFrame(d)},10)}function c(){F.vars.visibilityCheckStarted||(t.requestAnimationFrame(d),F.vars.visibilityCheckStarted=!0)}function f(e){e.holderData.invisibleId||(F.vars.invisibleId+=1,F.vars.invisibleImages["i"+F.vars.invisibleId]=e,e.holderData.invisibleId=F.vars.invisibleId)}function p(e){F.vars.debounceTimer||e.call(this),F.vars.debounceTimer&&t.clearTimeout(F.vars.debounceTimer),F.vars.debounceTimer=t.setTimeout(function(){F.vars.debounceTimer=null,e.call(this)},F.setup.debounce)}function g(){p(function(){h(null)})}var m=n(2),v=n(3),y=n(6),w=n(7),b=n(8),x=n(9),S=n(10),A=n(11),C=n(12),E=n(15),T=w.extend,k=w.dimensionCheck,j=A.svg_ns,O={version:A.version,addTheme:function(e,t){return null!=e&&null!=t&&(F.settings.themes[e]=t),delete F.vars.cache.themeKeys,this},addImage:function(e,t){var n=x.getNodeArray(t);return n.forEach(function(t){var n=x.newEl("img"),r={};r[F.setup.dataAttr]=e,x.setAttr(n,r),t.appendChild(n)}),this},setResizeUpdate:function(e,t){e.holderData&&(e.holderData.resizeUpdate=!!t,e.holderData.resizeUpdate&&h(e))},run:function(e){e=e||{};var n={},a=T(F.settings,e);F.vars.preempted=!0,F.vars.dataAttr=a.dataAttr||F.setup.dataAttr,n.renderer=a.renderer?a.renderer:F.setup.renderer,-1===F.setup.renderers.join(",").indexOf(n.renderer)&&(n.renderer=F.setup.supportsSVG?"svg":F.setup.supportsCanvas?"canvas":"html");var s=x.getNodeArray(a.images),l=x.getNodeArray(a.bgnodes),h=x.getNodeArray(a.stylenodes),u=x.getNodeArray(a.objects);return n.stylesheets=[],n.svgXMLStylesheet=!0,n.noFontFallback=a.noFontFallback?a.noFontFallback:!1,h.forEach(function(e){if(e.attributes.rel&&e.attributes.href&&"stylesheet"==e.attributes.rel.value){var t=e.attributes.href.value,r=x.newEl("a");r.href=t;var i=r.protocol+"//"+r.host+r.pathname+r.search;n.stylesheets.push(i)}}),l.forEach(function(e){if(t.getComputedStyle){var r=t.getComputedStyle(e,null).getPropertyValue("background-image"),s=e.getAttribute("data-background-src"),l=s||r,h=null,u=a.domain+"/",d=l.indexOf(u);if(0===d)h=l;else if(1===d&&"?"===l[0])h=l.slice(1);else{var c=l.substr(d).match(/([^\"]*)"?\)/);if(null!==c)h=c[1];else if(0===l.indexOf("url("))throw"Holder: unable to parse background URL: "+l}if(null!=h){var f=i(h,a);f&&o({mode:"background",el:e,flags:f,engineSettings:n})}}}),u.forEach(function(e){var t={};try{t.data=e.getAttribute("data"),t.dataSrc=e.getAttribute(F.vars.dataAttr)}catch(i){}var o=null!=t.data&&0===t.data.indexOf(a.domain),s=null!=t.dataSrc&&0===t.dataSrc.indexOf(a.domain);o?r(a,n,t.data,e):s&&r(a,n,t.dataSrc,e)}),s.forEach(function(e){var t={};try{t.src=e.getAttribute("src"),t.dataSrc=e.getAttribute(F.vars.dataAttr),t.rendered=e.getAttribute("data-holder-rendered")}catch(i){}var o=null!=t.src,s=null!=t.dataSrc&&0===t.dataSrc.indexOf(a.domain),l=null!=t.rendered&&"true"==t.rendered;o?0===t.src.indexOf(a.domain)?r(a,n,t.src,e):s&&(l?r(a,n,t.dataSrc,e):!function(e,t,n,i,o){w.imageExists(e,function(e){e||r(t,n,i,o)})}(t.src,a,n,t.dataSrc,e)):s&&r(a,n,t.dataSrc,e)}),this}},F={settings:{domain:"holder.js",images:"img",objects:"object",bgnodes:"body .holderjs",stylenodes:"head link.holderjs",themes:{gray:{bg:"#EEEEEE",fg:"#AAAAAA"},social:{bg:"#3a5a97",fg:"#FFFFFF"},industrial:{bg:"#434A52",fg:"#C2F200"},sky:{bg:"#0D8FDB",fg:"#FFFFFF"},vine:{bg:"#39DBAC",fg:"#1E292C"},lava:{bg:"#F8591A",fg:"#1C2846"}}},defaults:{size:10,units:"pt",scale:1/16}},z=function(){var e=null,t=null,n=null;return function(r){var i=r.root;if(F.setup.supportsSVG){var o=!1,a=function(e){return document.createTextNode(e)};(null==e||e.parentNode!==document.body)&&(o=!0),e=b.initSVG(e,i.properties.width,i.properties.height),e.style.display="block",o&&(t=x.newEl("text",j),n=a(null),x.setAttr(t,{x:0}),t.appendChild(n),e.appendChild(t),document.body.appendChild(e),e.style.visibility="hidden",e.style.position="absolute",e.style.top="-100%",e.style.left="-100%");var s=i.children.holderTextGroup,l=s.properties;x.setAttr(t,{y:l.font.size,style:w.cssProps({"font-weight":l.font.weight,"font-size":l.font.size+l.font.units,"font-family":l.font.family})}),n.nodeValue=l.text;var h=t.getBBox(),u=Math.ceil(h.width/i.properties.width),d=l.text.split(" "),c=l.text.match(/\\n/g);u+=null==c?0:c.length,n.nodeValue=l.text.replace(/[ ]+/g,"");var f=t.getComputedTextLength(),p=h.width-f,g=Math.round(p/Math.max(1,d.length-1)),m=[];if(u>1){n.nodeValue="";for(var v=0;v<d.length;v++)if(0!==d[v].length){n.nodeValue=w.decodeHtmlEntity(d[v]);var y=t.getBBox();m.push({text:d[v],width:y.width})}}return e.style.display="none",{spaceWidth:g,lineCount:u,boundingBox:h,words:m}}return!1}}();for(var D in F.flags)F.flags.hasOwnProperty(D)&&(F.flags[D].match=function(e){return e.match(this.regex)});F.setup={renderer:"html",debounce:100,ratio:1,supportsCanvas:!1,supportsSVG:!1,lineWrapRatio:.9,dataAttr:"data-src",renderers:["html","canvas","svg"]},F.vars={preempted:!1,resizableImages:[],invisibleImages:{},invisibleId:0,visibilityCheckStarted:!1,debounceTimer:null,cache:{}},function(){var e=x.newEl("canvas");e.getContext&&-1!=e.toDataURL("image/png").indexOf("data:image/png")&&(F.setup.renderer="canvas",F.setup.supportsCanvas=!0),document.createElementNS&&document.createElementNS(j,"svg").createSVGRect&&(F.setup.renderer="svg",F.setup.supportsSVG=!0)}(),c(),m&&m(function(){F.vars.preempted||O.run(),t.addEventListener?(t.addEventListener("resize",g,!1),t.addEventListener("orientationchange",g,!1)):t.attachEvent("onresize",g),"object"==typeof t.Turbolinks&&t.document.addEventListener("page:change",function(){O.run()})}),e.exports=O}).call(t,function(){return this}())},function(e,t){function n(e){function t(e){if(!x){if(!a.body)return i(t);for(x=!0;e=S.shift();)i(e)}}function n(e){(w||e.type===l||a[c]===d)&&(r(),t())}function r(){w?(a[y](m,n,h),e[y](l,n,h)):(a[p](v,n),e[p](u,n))}function i(e,t){setTimeout(e,+t>=0?t:1)}function o(e){x?i(e):S.push(e)}null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function C(){document.removeEventListener("DOMContentLoaded",C,!1),document.readyState="complete"},!1),document.readyState="loading");var a=e.document,s=a.documentElement,l="load",h=!1,u="on"+l,d="complete",c="readyState",f="attachEvent",p="detachEvent",g="addEventListener",m="DOMContentLoaded",v="onreadystatechange",y="removeEventListener",w=g in a,b=h,x=h,S=[];if(a[c]===d)i(t);else if(w)a[g](m,n,h),e[g](l,n,h);else{a[f](v,n),e[f](u,n);try{b=null==e.frameElement&&s}catch(A){}b&&b.doScroll&&!function E(){if(!x){try{b.doScroll("left")}catch(e){return i(E,50)}r(),t()}}()}return o.version="1.4.0",o.isReady=function(){return x},o}e.exports="undefined"!=typeof window&&n(window)},function(e,t,n){var r=encodeURIComponent,i=decodeURIComponent,o=n(4),a=n(5),s=/(\w+)\[(\d+)\]/,l=/\w+\.\w+/;t.parse=function(e){if("string"!=typeof e)return{};if(e=o(e),""===e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t={},n=e.split("&"),r=0;r<n.length;r++){var a,h,u,d=n[r].split("="),c=i(d[0]);if(a=s.exec(c))t[a[1]]=t[a[1]]||[],t[a[1]][a[2]]=i(d[1]);else if(a=l.test(c)){for(a=c.split("."),h=t;a.length;)if(u=a.shift(),u.length){if(h[u]){if(h[u]&&"object"!=typeof h[u])break}else h[u]={};a.length||(h[u]=i(d[1])),h=h[u]}}else t[d[0]]=null==d[1]?"":i(d[1])}return t},t.stringify=function(e){if(!e)return"";var t=[];for(var n in e){var i=e[n];if("array"!=a(i))t.push(r(n)+"="+r(e[n]));else for(var o=0;o<i.length;++o)t.push(r(n+"["+o+"]")+"="+r(i[o]))}return t.join("&")}},function(e,t){function n(e){return e.replace(/^\s*|\s*$/g,"")}t=e.exports=n,t.left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){switch(n.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!==e?"nan":e&&1===e.nodeType?"element":(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e),typeof e)}},function(e,t){var n=function(e){function t(e,t){for(var n in t)e[n]=t[n];return e}var n=1,r=function(e){n++,this.parent=null,this.children={},this.id=n,this.name="n"+n,"undefined"!=typeof e&&(this.name=e),this.x=this.y=this.z=0,this.width=this.height=0};r.prototype.resize=function(e,t){null!=e&&(this.width=e),null!=t&&(this.height=t)},r.prototype.moveTo=function(e,t,n){this.x=null!=e?e:this.x,this.y=null!=t?t:this.y,this.z=null!=n?n:this.z},r.prototype.add=function(e){var t=e.name;if("undefined"!=typeof this.children[t])throw"SceneGraph: child already exists: "+t;this.children[t]=e,e.parent=this};var i=function(){r.call(this,"root"),this.properties=e};i.prototype=new r;var o=function(e,n){if(r.call(this,e),this.properties={fill:"#000000"},"undefined"!=typeof n)t(this.properties,n);else if("undefined"!=typeof e&&"string"!=typeof e)throw"SceneGraph: invalid node name"};o.prototype=new r;var a=function(){o.apply(this,arguments),this.type="group"};a.prototype=new o;var s=function(){o.apply(this,arguments),this.type="rect"};s.prototype=new o;var l=function(e){o.call(this),this.type="text",this.properties.text=e};l.prototype=new o;var h=new i;return this.Shape={Rect:s,Text:l,Group:a},this.root=h,this};e.exports=n},function(e,t){(function(e){t.extend=function(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);if(null!=t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n},t.cssProps=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+":"+e[n]);return t.join(";")},t.encodeHtmlEntity=function(e){for(var t=[],n=0,r=e.length-1;r>=0;r--)n=e.charCodeAt(r),n>128?t.unshift(["&#",n,";"].join("")):t.unshift(e[r]);return t.join("")},t.imageExists=function(e,t){var n=new Image;n.onerror=function(){t.call(this,!1)},n.onload=function(){t.call(this,!0)},n.src=e},t.decodeHtmlEntity=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)})},t.dimensionCheck=function(e){var t={height:e.clientHeight,width:e.clientWidth};return t.height&&t.width?t:!1},t.truthy=function(e){return"string"==typeof e?"true"===e||"yes"===e||"1"===e||"on"===e||"✓"===e:!!e},t.parseColor=function(e){var t,n=/(^(?:#?)[0-9a-f]{6}$)|(^(?:#?)[0-9a-f]{3}$)/i,r=/^rgb\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,i=/^rgba\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0\.\d{1,}|1)\)$/,o=e.match(n);return null!==o?(t=o[1]||o[2],"#"!==t[0]?"#"+t:t):(o=e.match(r),null!==o?t="rgb("+o.slice(1).join(",")+")":(o=e.match(i),null!==o?t="rgba("+o.slice(1).join(",")+")":null))},t.canvasRatio=function(){var t=1,n=1;if(e.document){var r=e.document.createElement("canvas");if(r.getContext){var i=r.getContext("2d");t=e.devicePixelRatio||1,n=i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1}}return t/n}}).call(t,function(){return this}())},function(e,t,n){(function(e){var r=n(9),i="http://www.w3.org/2000/svg",o=8;t.initSVG=function(e,t,n){var a,s,l=!1;e&&e.querySelector?(s=e.querySelector("style"),null===s&&(l=!0)):(e=r.newEl("svg",i),l=!0),l&&(a=r.newEl("defs",i),s=r.newEl("style",i),r.setAttr(s,{type:"text/css"}),a.appendChild(s),e.appendChild(a)),e.webkitMatchesSelector&&e.setAttribute("xmlns",i);for(var h=0;h<e.childNodes.length;h++)e.childNodes[h].nodeType===o&&e.removeChild(e.childNodes[h]);for(;s.childNodes.length;)s.removeChild(s.childNodes[0]);return r.setAttr(e,{width:t,height:n,viewBox:"0 0 "+t+" "+n,preserveAspectRatio:"none"}),e},t.svgStringToDataURI=function(){var t="data:image/svg+xml;charset=UTF-8,",n="data:image/svg+xml;charset=UTF-8;base64,";return function(r,i){return i?n+btoa(e.unescape(encodeURIComponent(r))):t+encodeURIComponent(r)}}(),t.serializeSVG=function(t,n){if(e.XMLSerializer){var i=new XMLSerializer,o="",a=n.stylesheets;if(n.svgXMLStylesheet){for(var s=r.createXML(),l=a.length-1;l>=0;l--){var h=s.createProcessingInstruction("xml-stylesheet",'href="'+a[l]+'" rel="stylesheet"');s.insertBefore(h,s.firstChild)}s.removeChild(s.documentElement),o=i.serializeToString(s)}var u=i.serializeToString(t);return u=u.replace(/\&amp;(\#[0-9]{2,}\;)/g,"&$1"),o+u}}}).call(t,function(){return this}())},function(e,t){(function(e){t.newEl=function(t,n){return e.document?null==n?e.document.createElement(t):e.document.createElementNS(n,t):void 0},t.setAttr=function(e,t){for(var n in t)e.setAttribute(n,t[n])},t.createXML=function(){return e.DOMParser?(new DOMParser).parseFromString("<xml />","application/xml"):void 0},t.getNodeArray=function(t){var n=null;return"string"==typeof t?n=document.querySelectorAll(t):e.NodeList&&t instanceof e.NodeList?n=t:e.Node&&t instanceof e.Node?n=[t]:e.HTMLCollection&&t instanceof e.HTMLCollection?n=t:t instanceof Array?n=t:null===t&&(n=[]),n=Array.prototype.slice.call(n)}}).call(t,function(){return this}())},function(e,t){var n=function(e,t){"string"==typeof e&&(this.original=e,"#"===e.charAt(0)&&(e=e.slice(1)),/[^a-f0-9]+/i.test(e)||(3===e.length&&(e=e.replace(/./g,"$&$&")),6===e.length&&(this.alpha=1,t&&t.alpha&&(this.alpha=t.alpha),this.set(parseInt(e,16)))))};n.rgb2hex=function(e,t,n){function r(e){var t=(0|e).toString(16);return 16>e&&(t="0"+t),t}return[e,t,n].map(r).join("")},n.hsl2rgb=function(e,t,n){var r=e/60,i=(1-Math.abs(2*n-1))*t,o=i*(1-Math.abs(parseInt(r)%2-1)),a=n-i/2,s=0,l=0,h=0;return r>=0&&1>r?(s=i,l=o):r>=1&&2>r?(s=o,l=i):r>=2&&3>r?(l=i,h=o):r>=3&&4>r?(l=o,h=i):r>=4&&5>r?(s=o,h=i):r>=5&&6>r&&(s=i,h=o),s+=a,l+=a,h+=a,s=parseInt(255*s),l=parseInt(255*l),h=parseInt(255*h),[s,l,h]},n.prototype.set=function(e){this.raw=e;var t=(16711680&this.raw)>>16,n=(65280&this.raw)>>8,r=255&this.raw,i=.2126*t+.7152*n+.0722*r,o=-.09991*t-.33609*n+.436*r,a=.615*t-.55861*n-.05639*r;return this.rgb={r:t,g:n,b:r},this.yuv={y:i,u:o,v:a},this},n.prototype.lighten=function(e){var t=Math.min(1,Math.max(0,Math.abs(e)))*(0>e?-1:1),r=255*t|0,i=Math.min(255,Math.max(0,this.rgb.r+r)),o=Math.min(255,Math.max(0,this.rgb.g+r)),a=Math.min(255,Math.max(0,this.rgb.b+r)),s=n.rgb2hex(i,o,a);return new n(s)},n.prototype.toHex=function(e){return(e?"#":"")+this.raw.toString(16)},n.prototype.lighterThan=function(e){return e instanceof n||(e=new n(e)),this.yuv.y>e.yuv.y},n.prototype.blendAlpha=function(e){e instanceof n||(e=new n(e));var t=e,r=this,i=t.alpha*t.rgb.r+(1-t.alpha)*r.rgb.r,o=t.alpha*t.rgb.g+(1-t.alpha)*r.rgb.g,a=t.alpha*t.rgb.b+(1-t.alpha)*r.rgb.b;return new n(n.rgb2hex(i,o,a))},e.exports=n},function(e,t){e.exports={version:"2.9.0",svg_ns:"http://www.w3.org/2000/svg"}},function(e,t,n){function r(e,t){return d.element({tag:t,width:e.width,height:e.height,fill:e.properties.fill})}function i(e){return h.cssProps({fill:e.fill,"font-weight":e.font.weight,"font-family":e.font.family+", monospace","font-size":e.font.size+e.font.units})}function o(e,t,n){var r=n/2;return["M",r,r,"H",e-r,"V",t-r,"H",r,"V",0,"M",0,r,"L",e,t-r,"M",0,t-r,"L",e,r].join(" ")}var a=n(13),s=n(8),l=n(11),h=n(7),u=l.svg_ns,d={element:function(e){var t=e.tag,n=e.content||"";return delete e.tag,delete e.content,[t,n,e]}};e.exports=function(e,t){var n=t.engineSettings,l=n.stylesheets,h=l.map(function(e){return'<?xml-stylesheet rel="stylesheet" href="'+e+'"?>'}).join("\n"),c="holder_"+Number(new Date).toString(16),f=e.root,p=f.children.holderTextGroup,g="#"+c+" text { "+i(p.properties)+" } ";p.y+=.8*p.textPositionData.boundingBox.height;var m=[];Object.keys(p.children).forEach(function(e){var t=p.children[e];Object.keys(t.children).forEach(function(e){var n=t.children[e],r=p.x+t.x+n.x,i=p.y+t.y+n.y,o=d.element({tag:"text",content:n.properties.text,x:r,y:i});m.push(o)})});var v=d.element({tag:"g",content:m}),y=null;if(f.children.holderBg.properties.outline){var w=f.children.holderBg.properties.outline;y=d.element({tag:"path",d:o(f.children.holderBg.width,f.children.holderBg.height,w.width),"stroke-width":w.width,stroke:w.fill,fill:"none"})}var b=r(f.children.holderBg,"rect"),x=[];x.push(b),w&&x.push(y),x.push(v);var S=d.element({tag:"g",id:c,content:x}),A=d.element({tag:"style",content:g,type:"text/css"}),C=d.element({tag:"defs",content:A}),E=d.element({tag:"svg",content:[C,S],width:f.properties.width,height:f.properties.height,xmlns:u,viewBox:[0,0,f.properties.width,f.properties.height].join(" "),preserveAspectRatio:"none"}),T=a(E);T=h+T[0];var k=s.svgStringToDataURI(T,"background"===t.mode);return k}},function(e,t,n){n(14);e.exports=function r(e,t,n){"use strict";function i(e){var t=e.match(/^\w+/),r={tag:t?t[0]:"div",attr:{},children:[]},i=e.match(/#([\w-]+)/),o=e.match(/\$([\w-]+)/),a=e.match(/\.[\w-]+/g);return i&&(r.attr.id=i[1],n[i[1]]=r),o&&(n[o[1]]=r),a&&(r.attr["class"]=a.join(" ").replace(/\./g,"")),e.match(/&$/g)&&(f=!1),r}function o(e,t){return null!==t&&t!==!1&&void 0!==t?"string"!=typeof t&&"object"!=typeof t?String(t):t:void 0}function a(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function s(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var l,h,u,d,c=1,f=!0;if(n=n||{},"string"==typeof e[0])e[0]=i(e[0]);else{if(!Array.isArray(e[0]))throw new Error("First element of array must be a string, or an array and not "+JSON.stringify(e[0]));c=0}for(;c<e.length;c++){if(e[c]===!1||null===e[c]){e[0]=!1;break}if(void 0!==e[c]&&e[c]!==!0)if("string"==typeof e[c])f&&(e[c]=s(e[c])),e[0].children.push(e[c]);else if("number"==typeof e[c])e[0].children.push(e[c]);else if(Array.isArray(e[c])){if(Array.isArray(e[c][0])){if(e[c].reverse().forEach(function(t){e.splice(c+1,0,t)}),0!==c)continue;c++}r(e[c],t,n),e[c][0]&&e[0].children.push(e[c][0])}else if("function"==typeof e[c])u=e[c];else{if("object"!=typeof e[c])throw new TypeError('"'+e[c]+'" is not allowed as a value.');for(h in e[c])e[c].hasOwnProperty(h)&&null!==e[c][h]&&e[c][h]!==!1&&("style"===h&&"object"==typeof e[c][h]?e[0].attr[h]=JSON.stringify(e[c][h],o).slice(2,-2).replace(/","/g,";").replace(/":"/g,":").replace(/\\"/g,"'"):e[0].attr[h]=e[c][h])}}if(e[0]!==!1){l="<"+e[0].tag;for(d in e[0].attr)e[0].attr.hasOwnProperty(d)&&(l+=" "+d+'="'+a(e[0].attr[d]||"")+'"');l+=">",e[0].children.forEach(function(e){l+=e}),l+="</"+e[0].tag+">",e[0]=l}return n[0]=e[0],u&&u(e[0]),n}},function(e,t){function n(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}e.exports=n},function(e,t,n){var r=n(9),i=n(7);e.exports=function(){var e=r.newEl("canvas"),t=null;return function(n){null==t&&(t=e.getContext("2d"));var r=i.canvasRatio(),o=n.root;e.width=r*o.properties.width,e.height=r*o.properties.height,t.textBaseline="middle";var a=o.children.holderBg,s=r*a.width,l=r*a.height,h=2,u=h/2;t.fillStyle=a.properties.fill,t.fillRect(0,0,s,l),a.properties.outline&&(t.strokeStyle=a.properties.outline.fill,t.lineWidth=a.properties.outline.width,t.moveTo(u,u),t.lineTo(s-u,u),t.lineTo(s-u,l-u),t.lineTo(u,l-u),t.lineTo(u,u),t.moveTo(0,u),t.lineTo(s,l-u),t.moveTo(0,l-u),t.lineTo(s,u),t.stroke());var d=o.children.holderTextGroup;t.font=d.properties.font.weight+" "+r*d.properties.font.size+d.properties.font.units+" "+d.properties.font.family+", monospace",t.fillStyle=d.properties.fill;for(var c in d.children){var f=d.children[c];for(var p in f.children){var g=f.children[p],m=r*(d.x+f.x+g.x),v=r*(d.y+f.y+g.y+d.properties.leading/2);t.fillText(g.properties.text,m,v)}}return e.toDataURL("image/png")}}()}])}),function(e,t){t&&(Holder=e.Holder)}(this,"undefined"!=typeof Meteor&&"undefined"!=typeof Package);
  334. /**
  335. * Essential is a clean and customizable theme.
  336. *
  337. * @package theme_essential
  338. * @copyright 2016 Gareth J Barnard
  339. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  340. */
  341. /* jshint ignore:start */
  342. define('theme_essential/navbar', ["jquery","core/log"],function(a,b){"use strict";// jshint ;_;
  343. return b.debug("Essential navbar AMD"),{init:function(c){a(document).ready(function(a){a("#essentialnavbar").length&&(c.oldnavbar?a("#page-header").css("margin-bottom",a("#essentialnavbar .navbar-inner").height()+"px"):a("#page-header").css("margin-top",a("#essentialnavbar .navbar-inner").height()+"px"))}),b.debug("Essential navbar AMD init: "+c.oldnavbar)}}});
  344. /**
  345. * Essential is a clean and customizable theme.
  346. *
  347. * @package theme_essential
  348. * @copyright 2016 Gareth J Barnard
  349. * @copyright 2015 Gareth J Barnard
  350. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  351. */
  352. /* jshint ignore:start */
  353. define('theme_essential/styleguide', ["jquery","theme_bootstrapbase/bootstrap","theme_essential/holder","core/log"],function(a,b,c,d){"use strict";// jshint ;_;
  354. return d.debug("Essential Style Guide AMD"),{init:function(){a(document).ready(function(a){a("[data-toggle=tooltip]").tooltip(),a("[data-toggle=popover]").popover().click(function(a){a.preventDefault()})}),d.debug("Essential Style Guide AMD init")}}});