<commit_before>!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e,n){
/*!
 * clipboard.js v2.0.4
 * https://zenorocha.github.io/clipboard.js
 * 
 * Licensed MIT © <NAME>
 */
var i;i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=l(n(1)),s=l(n(3)),a=l(n(4));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.resolveOptions(n),i.listenClick(t),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===i(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,a.default)(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new o.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var e=d("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach((function(t){n=n&&!!document.queryCommandSupported(t)})),n}}]),e}(s.default);function d(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=c},function(t,e,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(2),a=(i=s)&&i.__esModule?i:{default:i},l=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.resolveOptions(e),this.initSelection()}return o(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,a.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,a.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=l},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(t),i.removeAllRanges(),i.addRange(r),e=i.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var i=this;function r(){i.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),i=n[t],r=[];if(i&&e)for(var o=0,s=i.length;o<s;o++)i[o].fn!==e&&i[o].fn._!==e&&r.push(i[o]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var i=n(5),r=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!i.string(e))throw new TypeError("Second argument must be a String");if(!i.fn(n))throw new TypeError("Third argument must be a Function");if(i.node(t))return function(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}(t,e,n);if(i.nodeList(t))return function(t,e,n){return Array.prototype.forEach.call(t,(function(t){t.addEventListener(e,n)})),{destroy:function(){Array.prototype.forEach.call(t,(function(t){t.removeEventListener(e,n)}))}}}(t,e,n);if(i.string(t))return function(t,e,n){return r(document.body,t,e,n)}(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var i=n(7);function r(t,e,n,i,r){var s=o.apply(this,arguments);return t.addEventListener(n,s,r),{destroy:function(){t.removeEventListener(n,s,r)}}}function o(t,e,n,r){return function(n){n.delegateTarget=i(n.target,e),n.delegateTarget&&r.call(t,n)}}t.exports=function(t,e,n,i,o){return"function"==typeof t.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return r(t,e,n,i,o)})))}},function(t,e){var n=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}t.exports=function(t,e){for(;t&&t.nodeType!==n;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])},t.exports=i()},function(t,e,n){t.exports=function(){"use strict";
/*!
   * mustache.js - Logic-less {{mustache}} templates with JavaScript
   * http://github.com/janl/mustache.js
   */var t=Object.prototype.toString,e=Array.isArray||function(e){return"[object Array]"===t.call(e)};function n(t){return"function"==typeof t}function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function r(t,e){return null!=t&&"object"==typeof t&&e in t}var o=RegExp.prototype.test,s=/\S/;function a(t){return!function(t,e){return o.call(t,e)}(s,t)}var l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},c=/\s*/,d=/\s+/,h=/\s*=/,u=/\s*\}/,p=/#|\^|\/|>|\{|&|=|!/;function f(t){this.string=t,this.tail=t,this.pos=0}function g(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function m(){this.cache={}}f.prototype.eos=function(){return""===this.tail},f.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},f.prototype.scanUntil=function(t){var e,n=this.tail.search(t);switch(n){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=e.length,e},g.prototype.push=function(t){return new g(t,this)},g.prototype.lookup=function(t){var e,i,o,s=this.cache;if(s.hasOwnProperty(t))e=s[t];else{for(var a,l,c,d=this,h=!1;d;){if(t.indexOf(".")>0)for(a=d.view,l=t.split("."),c=0;null!=a&&c<l.length;)c===l.length-1&&(h=r(a,l[c])||(i=a,o=l[c],null!=i&&"object"!=typeof i&&i.hasOwnProperty&&i.hasOwnProperty(o))),a=a[l[c++]];else a=d.view[t],h=r(d.view,t);if(h){e=a;break}d=d.parent}s[t]=e}return n(e)&&(e=e.call(this.view)),e},m.prototype.clearCache=function(){this.cache={}},m.prototype.parse=function(t,n){var r=this.cache,o=t+":"+(n||y.tags).join(":"),s=r[o];return null==s&&(s=r[o]=function(t,n){if(!t)return[];var r,o,s,l=!1,g=[],m=[],v=[],w=!1,b=!1,$="",_=0;function x(){if(w&&!b)for(;v.length;)delete m[v.pop()];else v=[];w=!1,b=!1}function k(t){if("string"==typeof t&&(t=t.split(d,2)),!e(t)||2!==t.length)throw new Error("Invalid tags: "+t);r=new RegExp(i(t[0])+"\\s*"),o=new RegExp("\\s*"+i(t[1])),s=new RegExp("\\s*"+i("}"+t[1]))}k(n||y.tags);for(var S,A,C,I,E,T,N=new f(t);!N.eos();){if(S=N.pos,C=N.scanUntil(r))for(var j=0,L=C.length;j<L;++j)a(I=C.charAt(j))?(v.push(m.length),$+=I):(b=!0,l=!0,$+=" "),m.push(["text",I,S,S+1]),S+=1,"\n"===I&&(x(),$="",_=0,l=!1);if(!N.scan(r))break;if(w=!0,A=N.scan(p)||"name",N.scan(c),"="===A?(C=N.scanUntil(h),N.scan(h),N.scanUntil(o)):"{"===A?(C=N.scanUntil(s),N.scan(u),N.scanUntil(o),A="&"):C=N.scanUntil(o),!N.scan(o))throw new Error("Unclosed tag at "+N.pos);if(E=">"==A?[A,C,S,N.pos,$,_,l]:[A,C,S,N.pos],_++,m.push(E),"#"===A||"^"===A)g.push(E);else if("/"===A){if(!(T=g.pop()))throw new Error('Unopened section "'+C+'" at '+S);if(T[1]!==C)throw new Error('Unclosed section "'+T[1]+'" at '+S)}else"name"===A||"{"===A||"&"===A?b=!0:"="===A&&k(C)}if(x(),T=g.pop())throw new Error('Unclosed section "'+T[1]+'" at '+N.pos);return function(t){for(var e,n=[],i=n,r=[],o=0,s=t.length;o<s;++o)switch((e=t[o])[0]){case"#":case"^":i.push(e),r.push(e),i=e[4]=[];break;case"/":r.pop()[5]=e[2],i=r.length>0?r[r.length-1][4]:n;break;default:i.push(e)}return n}(function(t){for(var e,n,i=[],r=0,o=t.length;r<o;++r)(e=t[r])&&("text"===e[0]&&n&&"text"===n[0]?(n[1]+=e[1],n[3]=e[3]):(i.push(e),n=e));return i}(m))}(t,n)),s},m.prototype.render=function(t,e,n,i){var r=this.parse(t,i),o=e instanceof g?e:new g(e,void 0);return this.renderTokens(r,o,n,t,i)},m.prototype.renderTokens=function(t,e,n,i,r){for(var o,s,a,l="",c=0,d=t.length;c<d;++c)a=void 0,"#"===(s=(o=t[c])[0])?a=this.renderSection(o,e,n,i):"^"===s?a=this.renderInverted(o,e,n,i):">"===s?a=this.renderPartial(o,e,n,r):"&"===s?a=this.unescapedValue(o,e):"name"===s?a=this.escapedValue(o,e):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(l+=a);return l},m.prototype.renderSection=function(t,i,r,o){var s=this,a="",l=i.lookup(t[1]);if(l){if(e(l))for(var c=0,d=l.length;c<d;++c)a+=this.renderTokens(t[4],i.push(l[c]),r,o);else if("object"==typeof l||"string"==typeof l||"number"==typeof l)a+=this.renderTokens(t[4],i.push(l),r,o);else if(n(l)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(l=l.call(i.view,o.slice(t[3],t[5]),(function(t){return s.render(t,i,r)})))&&(a+=l)}else a+=this.renderTokens(t[4],i,r,o);return a}},m.prototype.renderInverted=function(t,n,i,r){var o=n.lookup(t[1]);if(!o||e(o)&&0===o.length)return this.renderTokens(t[4],n,i,r)},m.prototype.indentPartial=function(t,e,n){for(var i=e.replace(/[^ \t]/g,""),r=t.split("\n"),o=0;o<r.length;o++)r[o].length&&(o>0||!n)&&(r[o]=i+r[o]);return r.join("\n")},m.prototype.renderPartial=function(t,e,i,r){if(i){var o=n(i)?i(t[1]):i[t[1]];if(null!=o){var s=t[6],a=t[5],l=t[4],c=o;return 0==a&&l&&(c=this.indentPartial(o,l,s)),this.renderTokens(this.parse(c,r),e,i,c)}}},m.prototype.unescapedValue=function(t,e){var n=e.lookup(t[1]);if(null!=n)return n},m.prototype.escapedValue=function(t,e){var n=e.lookup(t[1]);if(null!=n)return y.escape(n)},m.prototype.rawValue=function(t){return t[1]};var y={name:"mustache.js",version:"3.2.1",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,to_html:void 0,Scanner:void 0,Context:void 0,Writer:void 0},v=new m;return y.clearCache=function(){return v.clearCache()},y.parse=function(t,e){return v.parse(t,e)},y.render=function(t,n,i,r){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+(e(o=t)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return v.render(t,n,i,r)},y.to_html=function(t,e,i,r){var o=y.render(t,e,i);if(!n(r))return o;r(o)},y.escape=function(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return l[t]}))},y.Scanner=f,y.Context=g,y.Writer=m,y}()},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(2);var i=class{constructor(t){return t.onRefreshUi(()=>{this.init()}),this}init(){return $(".alert__close:not(.alert__close--initiated)").addClass("alert__close--initiated").on("click",(function(){$(this).closest(".alert").remove()})),this}};var r=class{constructor(t){return t.onRefreshUi(t=>{this.init(t)}),this}init(t){return $("a.confirm",t).on("click",t=>{let e=$(t.currentTarget),n=e.data("body")||"Please confirm you'd like to continue with this action.",i=e.data("title")||"Are you sure?";return n.replace(/\\n/g,"\n"),!n.length||($("<div>").html(n).dialog({title:i,resizable:!1,draggable:!1,modal:!0,dialogClass:"no-close",buttons:{OK:function(){window.location.href=e.attr("href")},Cancel:function(){$(this).dialog("close")}}}),!1)}),this}},o=n(0),s=n.n(o);class a{constructor(t){$(document).on("admin:js-copy-to-clipboard",(t,e)=>{a.log("Initiating new copy buttons"),$(e).addClass("js-copy-to-clipboard--initiated").each((t,e)=>{$(e).data("clipboardjs")||$(e).data("clipboardjs",new l(e))})}),t.onRefreshUi(()=>{$(document).trigger("admin:js-copy-to-clipboard",[".js-copy-to-clipboard"])})}static log(){"function"==typeof console.log&&console.log('"[33m[CopyToClipboard][0m"',...arguments)}static warn(){"function"==typeof console.warn&&console.warn('"[33m[CopyToClipboard][0m"',...arguments)}}class l{constructor(t){this.$body=$("body"),this.$el=$(t),this.$icon=$("<div>").text("Copied").css({position:"absolute",left:0,top:0,background:"#000000",color:"#ffffff",zIndex:1e6,padding:"0.25rem 0.5rem",borderRadius:"3px",border:"1px solid #ffffff",fontSize:"0.8rem"}),this.clipboardJs=new s.a(t),this.clipboardJs.on("success",t=>{a.log("Item copied!"),this.showIcon(),t.clearSelection()}).on("error",t=>{a.warn("Error",t),t.clearSelection()})}showIcon(){this.$icon.remove(),this.$body.append(this.$icon);this.calcOffsetTop();this.$icon.css({opacity:0,left:this.calcOffsetLeft(),top:this.calcOffsetTop()}).animate({opacity:1},100).delay(250).animate({opacity:0},250),setTimeout(()=>{this.$icon.remove()},600)}calcOffsetLeft(){return this.$el.offset().left+this.$el.outerWidth()/2-this.$icon.outerWidth()/2}calcOffsetTop(){return this.$el.offset().top-this.$icon.outerHeight()-5}}var c=a;var d=class{constructor(){return $(document).on("click",".btn-disabled",()=>!1),this}};var h=class{constructor(t){return this.adminController=t,this.adminController.onRefreshUi(()=>{$(".js-admin-dynamic-table:not(.ready)").addClass("ready").each((t,e)=>{this.init($(e))})}),this}init(t){t.trigger("dynamic-table:starting");let e=t.find(".js-admin-dynamic-table__template"),n=t.data("data")||[];t.data("template",e.html()),t.data("index",0),e.empty(),e.removeClass("js-admin-dynamic-table__template"),this.bindEvents(t,e);for(let i=0,r=n.length;i<r;i++)this.add(t,e,n[i]);return t.trigger("dynamic-table:ready"),this}bindEvents(t,e){return $(".js-admin-dynamic-table__add",t).on("click",()=>(this.add(t,e),!1)),t.on("click",".js-admin-dynamic-table__remove",e=>(this.remove(t,$(e.currentTarget).closest("tr")),!1)),this}add(t,e,n){(n=n||{}).index=t.data("index")||0;let i=$(Mustache.render(t.data("template"),n));return $("input[type=checkbox]",i).each((t,e)=>{let n=$(e);n[0].hasAttribute("data-dynamic-table-checked")&&n.prop("checked",n.attr("data-dynamic-table-checked"))}),$("select",i).each((t,e)=>{let n=$(e);if(n[0].hasAttribute("data-dynamic-table-value")){let t=n.data("dynamic-table-value");$('option[value="'+t+'"]',n).prop("selected",!0)}n.css("width","100%").select2()}),e.append(i),t.data("index",n.index+1),t.trigger("dynamic-table:add",[i]),t.find(".js-admin-sortable").trigger("sortable:sort"),this.adminController.refreshUi(i),this}remove(t,e){return e.remove(),t.trigger("dynamic-table:remove"),t.find(".js-admin-sortable").trigger("sortable:sort"),this}};var u=class{constructor(t){return t.onRefreshUi((t,e)=>{this.init(e)}),this}init(t){return $("td.actions",t).each((t,e)=>{let n=$("> .btn, > .btn-group",e),i=[];n.each((t,e)=>{i.push(e.offsetTop)}),Math.max(...i)!==Math.min(...i)?(n.addClass("btn-block"),n.filter(".btn-group").find("> .btn").addClass("btn-block")):(n.removeClass("btn-block"),n.filter(".btn-group").find("> .btn").removeClass("btn-block"))}),this}};class p{constructor(t){return $(document).on("admin:js-admin-modalize",(t,e,n,i)=>{p.log("Initiating new modalize buttons"),this.init(e,n,i)}),this.adminController=t,this.adminController.onRefreshUi((t,e)=>{$(document).trigger("admin:js-admin-modalize",[".js-admin-modalize:not(.modalized)",{},e])}),this}init(t,e,n){return e=e||{},$(t,n).each((t,n)=>{$(n).add("modalized").data("modalize",new f(this.adminController,n,e))}),this}static log(){"function"==typeof console.log&&console.log("[33m[Modalize][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[Modalize][0m",...arguments)}}class f{constructor(t,e,n){this.adminController=t,this.$trigger=$(e),this.$trigger.data("modalize")instanceof f||(this.target_id=this.coalesce(this.$trigger.data("target-id"),n.target_id),this.title=this.coalesce(this.$trigger.data("title"),n.title),this.width=this.coalesce(this.$trigger.data("width"),n.width),this.max_height=this.coalesce(this.$trigger.data("max-height"),n.max_height),this.target=document.getElementById(this.target_id),this.target?($(this.target).wrapInner("<div></div>").hide(),this.$trigger.on("click",()=>(this.open(),!1))):p.warn('"'+this.target_id+'" is not a valid ID'))}open(){p.log("Opening modal"),this.adminController.destroyUi(this.target);let t=$(this.target).find("> div").detach();p.log(t),this.$modal=$("<div>").html(t).dialog({modal:!0,dialogClass:"no-close no-padding",closeOnEscape:!1,draggable:!1,title:this.title,width:this.width,maxHeight:this.max_height,position:{my:"center",at:"center",of:window},open:()=>{this.adminController.refreshUi(this.$modal)},buttons:{OK:()=>{this.close()}}})}close(t){p.log("Closing modal"),this.adminController.instances["nails/module-admin"].Wysiwyg.destroy(this.$modal);let e=this.$modal.find("> div").detach();$(this.target).append(e),this.$modal.dialog("close").remove(),this.$modal=null}coalesce(){var t=arguments.length;for(let e=0;e<t;e++)if(null!==arguments[e]&&void 0!==arguments[e])return arguments[e];return null}}var g=p;class m{constructor(t){return t.onRefreshUi(()=>{this.init()}),this}init(){return $(".js-admin-notes:not(.processed)").addClass("processed").each((t,e)=>{let n=$(e),i=$("<span>").addClass("admin-notes__counter"),r=n.data("model-name"),o=n.data("model-provider"),s=n.data("id"),a=n.data("modal-title")||"Notes",l=n.data("modal-width")||500,c=n.data("modal-max-height")||750;n.append(i).on("click",()=>{let t=$("<div>").dialog({modal:!0,title:a,width:l,maxHeight:c,position:{my:"center",at:"center",of:window}});return this.load(t,r,o,s),!1}),this.countNotes(r,o,s).done(t=>{this.setCounter(t)})}),this}load(t,e,n,i){t.html($("<p>").text("Loading...")),this.loadNotes(e,n,i).done(r=>{let o=$("<ul>").addClass("admin-notes"),s=$("<li>").addClass("admin-notes__empty").append($("<p>").text("No notes recorded for this item"));if(o.append(s),r.data.length){s.hide();for(let e=0,n=r.data.length;e<n;e++)o.append(this.renderMessageItem(t,r.data[e].id,r.data[e].message,r.data[e].user,r.data[e].date))}let a=$("<li>"),l=$("<textarea>"),c=$("<button>").addClass("btn btn-block btn-primary").text("Add Note").on("click",()=>{this.saveNote(e,n,i,l.val()).done(e=>{l.val(""),$(".admin-notes__empty",t).hide(),a.before(this.renderMessageItem(t,e.data.id,e.data.message,e.data.user,e.data.date)),this.setCounter(t.length).centerModal(t,!0)})});o.append(a.append(l).append(c)),t.html(o),this.centerModal(t,!0)})}centerModal(t,e){return t.dialog("option","position",{my:"center",at:"center",of:window}),e&&t.animate({scrollTop:t.find(".admin-notes").outerHeight()},200),this}countNotes(t,e,n){let i=new $.Deferred;return $.ajax({url:window.SITE_URL+"api/admin/note/count",data:{model_name:t,model_provider:e,item_id:n}}).done(t=>{i.resolve(t.data)}).fail(t=>{m.showError(t.responseText),i.reject(t.responseText)}),i.promise()}loadNotes(t,e,n){let i=new $.Deferred;return $.ajax({url:window.SITE_URL+"api/admin/note",data:{model_name:t,model_provider:e,item_id:n}}).done(t=>{i.resolve(t)}).fail(t=>{m.showError(t.responseText),i.reject(t.responseText)}),i.promise()}saveNote(t,e,n,i){let r=new $.Deferred;return $.ajax({url:window.SITE_URL+"api/admin/note",method:"POST",data:{model_name:t,model_provider:e,item_id:n,message:i}}).done(t=>{r.resolve(t)}).fail(t=>{m.showError(t.responseText),r.reject(t.responseText)}),r.promise()}deleteNote(t){let e=new $.Deferred;return $.ajax({url:window.SITE_URL+"api/admin/note/"+t,method:"DELETE"}).done(t=>{e.resolve(t)}).fail(t=>{m.showError(t.responseText),e.reject(t.responseText)}),e.promise()}renderMessageItem(t,e,n,i,r){let o=$("<li>").addClass("admin-notes__note"),s=$("<div>").addClass("admin-notes__note__message").html(n),a=$("<button>").addClass("admin-notes__note__delete").html("&times;"),l=$("<div>").addClass("admin-notes__note__meta"),c=$("<span>").addClass("admin-notes__note__meta__user").html(i.first_name+" "+i.last_name),d=$("<span>").addClass("admin-notes__note__meta__date").html(r);return a.on("click",()=>(this.deleteNote(e).done(()=>{o.remove(),this.centerModal(t,!1);let e=$(".admin-notes__note",t).length;this.setCounter(e),0===e&&$(".admin-notes__empty",t).show()}),!1)),o.append(s).append(a).append(l.append(c).append(d))}setCounter(t){return $(".admin-notes__counter").text(t||""),this}static showError(t){let e;try{e=JSON.parse(t)}catch(t){e={error:"An unknown error occurred"}}alert(e.error)}}var y=m,v=n(1),w=n.n(v);class b{constructor(t){return this.adminController=t,this.adminController.onRefreshUi((t,e)=>{this.init(e)}),this}init(t){return $(".js-admin-repeater:not(.processed)",t).addClass("processed").each((t,e)=>{let n=$(e),i=new _(this.adminController,n,n.data("data"));n.data("js-admin-repeater-instance",i)}),this}static log(){"function"==typeof console.log&&console.log("[33m[Repeater][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[Repeater][0m",...arguments)}}class _{constructor(t,e,n){return this.trigger("constructing"),this.index=0,this.adminController=t,this.$element=e,this.$target=$(".js-admin-repeater__target",this.$element),this.$add=$(".js-admin-repeater__add",this.$element),this.template=$(".js-admin-repeater__template",this.$element).html(),$(".js-admin-repeater__template",this.$element).remove(),this.bindEvents(),this.load(n||[]),this.trigger("constructed"),this}bindEvents(){this.trigger("binding"),this.$add.on("click",t=>(this.add(),!1)),this.$target.on("click",".js-admin-repeater__remove",t=>(this.remove($(t.currentTarget)),!1)),this.$element.on("js-admin-repeater:load",(t,e)=>{this.load(e)}).on("js-admin-repeater:clear",t=>{this.reset()}),this.trigger("bound")}add(t){(t=t||{}).index=this.index,this.trigger("adding",t);let e=$("<li>").addClass("js-admin-repeater__target__item"),n=this.template;n=w.a.render(n,t),e.html(n),$("input[type=checkbox]",e).each((t,e)=>{let n=$(e);n[0].hasAttribute("data-repeater-checked")&&n.prop("checked",n.attr("data-repeater-checked"))}),$("select",e).each((t,e)=>{let n=$(e);if(n[0].hasAttribute("data-repeater-value")){let t=n.data("repeater-value");$('option[value="'+t+'"]',n).prop("selected",!0)}n.css("width","100%").select2()}),this.$target.append(e),this.index++,this.$element.find(".js-admin-sortable").trigger("sortable:sort"),this.adminController.refreshUi(e),this.trigger("added")}remove(t){let e=t.closest(".js-admin-repeater__target__item");this.trigger("removing",e),e.remove(),this.$element.find(".js-admin-sortable").trigger("sortable:sort"),this.trigger("removed",e)}load(t){this.trigger("loading",t);for(let e in t)t.hasOwnProperty(e)&&this.add(t[e]);this.trigger("loaded",t)}reset(){this.trigger("resetting"),$(".js-admin-repeater__target__item",this.$target).remove(),this.index=0,this.trigger("reset")}trigger(t,e){let n={instance:this,data:e};b.log("Triggering Event: "+t,n)}}var x=b;class k{constructor(t){return this.groups={},t.onRefreshUi((t,e)=>{this.init(e)}).onDestroyUi((t,e)=>{this.destroy(e)}),this}init(t){return $("[data-revealer]:not(.processed)",t).filter(":input").filter("input[type=checkbox], select").each((e,n)=>{let i=$(n).data("revealer");void 0===this.groups[i]?(this.groups[i]=new S(i,n),this.groups[i].findNewElements(t)):k.warn(`Duplicate group "${i}"`)}),this}destroy(t){for(let e in this.groups)this.groups.hasOwnProperty(e)&&(null===t||$.contains(t,this.groups[e].$control))&&(this.groups[e].destroy(),delete this.groups[e])}static log(){"function"==typeof console.log&&console.log("[33m[Revealer][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[Revealer][0m",...arguments)}}class S{constructor(t,e){this.group=t,this.$control=$(e),this.elements=[],this.$control.addClass("processed").on("change",()=>{this.toggle(this.getControlValue())})}findNewElements(t){return $(`[data-revealer="${this.group}"]:not(.processed)`,t).filter(":not(input[type=checkbox], select)").each((t,e)=>{this.elements.push(new A(e))}),this.$control.trigger("change"),this}getControlValue(){let t;return t=this.$control.is("select")?this.$control.val():this.$control.is(":checked")}toggle(t){k.log(`Toggling elements for value ${t}`);for(let e=0;e<this.elements.length;e++)this.elements[e].isShown(t)?this.elements[e].show():this.elements[e].hide()}destroy(){this.$control.removeClass("processed");for(let t=0;t<this.elements.length;t++)this.elements[t].destroy()}}class A{constructor(t){this.$element=$(t),this.value=this.$element.data("reveal-on"),this.$element.addClass("processed")}isShown(t){return this.value===t}show(){return this.$element.show(),this}hide(){return this.$element.hide(),this}destroy(){this.$element.removeClass("processed"),this.show()}}var C=k;class I{constructor(t){return $(document).on("admin:js-searcher",(t,e,n,i)=>{I.log("Initiating new searchers"),this.init(e,n,i)}),this.adminController=t,this.adminController.onRefreshUi((t,e)=>{$(document).trigger("admin:js-searcher",[".js-searcher:not(.processed)",{},e])}),this}init(t,e,n){return e=e||{},$(t,n).each((t,n)=>{$(n).add("processed").data("searcher",new E(n,e))}),this}static log(){"function"==typeof console.log&&console.log("[33m[Searcher][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[Searcher][0m",...arguments)}}class E{constructor(t,e){this.$input=$(t),this.$input.data("searcher")instanceof E||(this.api=this.coalesce(this.$input.data("api"),e.api),this.isMultiple=this.coalesce(this.$input.data("multiple"),e.isMultiple,!1),this.isClearable=this.coalesce(this.$input.data("clearable"),e.isClearable,!0),this.placeholder=this.coalesce(this.$input.data("placeholder"),e.placeholder,"Search for an item"),this.minLength=this.coalesce(this.$input.data("min-length"),e.minLength,2),this.getParam=this.coalesce(this.$input.data("get-param"),e.getParam,"search"),this.formatter=this.coalesce(e.formatter,null),this.propId=this.coalesce(this.$input.data("prop-id"),e.propId,"id"),this.propLabel=this.coalesce(this.$input.data("prop-label"),e.propLabel,"label"),this.api?this.$input.removeClass("js-searcher").select2({placeholder:this.placeholder,minimumInputLength:this.minLength,multiple:this.isMultiple,allowClear:this.isClearable,ajax:{url:window.SITE_URL+"api/"+this.api,dataType:"json",quietMillis:250,data:t=>{let e={};return e[this.getParam]=t,e},results:t=>({results:this.formatResults(t.data)}),cache:!0},initSelection:(t,e)=>{let n=$(t).val();""!==n&&this.isMultiple?$.ajax({url:window.SITE_URL+"api/"+this.api+"?ids="+n,dataType:"json"}).done(t=>{e(this.formatResults(t.data))}):""!==n&&$.ajax({url:window.SITE_URL+"api/"+this.api+"/"+n,dataType:"json"}).done(t=>{e(this.formatResult(t.data))})}}):console.warn("Element is configured as a Searcher but no api has been defined",this.$input))}formatResults(t){let e=[];for(let n=0;n<t.length;n++)e.push(this.formatResult(t[n]));return e}formatResult(t){return"function"==typeof this.formatter?this.formatter.call(this,t):{id:t[this.propId],text:t[this.propLabel]}}coalesce(){var t=arguments.length;for(let e=0;e<t;e++)if(null!==arguments[e]&&void 0!==arguments[e])return arguments[e];return null}}var T=I;var N=class{constructor(t){return t.onRefreshUi((t,e)=>{this.init(e)}),this}init(t){return $(".js-admin-sortable:not(.processed)",t).addClass("processed").each((function(){let t=$(this),e=t.data("handle")||null,n=t.data("axis")||"y",i=t.data("containment")||"parent";t.sortable({handle:e,axis:n,containment:i,forceHelperSize:!0,helper:function(t,e){let n=e.children(),i=e.clone();return i.children().each((function(t){$(this).width(n.eq(t).outerWidth())})),i},stop:function(){t.trigger("sortable:sort")}}).on("sortable:sort",()=>{t.find(".js-admin-sortable__order").each((function(t){$(this).val(t)}))}),e&&t.find(e).addClass("js-admin-sortable__handle")})),this}};var j=class{constructor(t){return t.onRefreshUi((t,e)=>{this.init(e)}),this}init(t){return $("fieldset,.fieldset",t).each((function(){$("div.field",this).removeClass("odd even"),$("div.field:visible:odd",this).addClass("odd"),$("div.field:visible:even",this).addClass("even")})),this}};class L{constructor(t,e){return this.slug=t,this.adminController=e,this.controls=[],this.panels=[],this.input=document.querySelectorAll('input[data-tabgroup="'+this.slug+'"]'),this.defaultTabSet=!1,this}addControl(t){this.controls.push(t)}addPanel(t){this.panels.push(t)}setDefaultActiveTab(){if(this.defaultTabSet)return this;this.defaultTabSet=!0;for(let t=0;t<this.controls.length;t++){let e=this.controls[t].getTarget();for(let t=0;t<this.panels.length;t++){let n=this.panels[t];if(n.targets(e)&&n.containsError())return this.goTo(e),this}}return this.input.length&&this.input[0].value.length?(this.goTo(this.input[0].value),this):(this.controls.length>0&&this.goTo(this.controls[0].getTarget()),this)}setControlsWithErrors(){for(let t=0;t<this.controls.length;t++){let e=this.controls[t].getTarget();for(let n=0;n<this.panels.length;n++){let i=this.panels[n];i.targets(e)&&(i.containsError()?this.controls[t].setError():this.controls[t].setNoError())}}}goTo(t){let e;for(e=0;e<this.controls.length;e++)this.controls[e].targets(t)?this.controls[e].setActive():this.controls[e].setInactive();for(e=0;e<this.panels.length;e++)this.panels[e].targets(t)?this.panels[e].setActive():this.panels[e].setInactive();if(this.input.length)for(let e=0;e<this.input.length;e++)this.input[e].value=t;this.adminController.refreshUi()}}class M{constructor(t,e){return this.group=t,this.element=e,this.link=this.element.querySelector("a"),this.target=this.link.dataset.tab,this.element.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.group.goTo(this.target)}),this}getTarget(){return this.target}targets(t){return this.target===t}isActive(){return this.element.classList.contains("active")}setActive(){return this.element.classList.add("active"),this}setInactive(){return this.element.classList.remove("active"),this}setError(){return this.link.classList.add("error"),this}setNoError(){return this.link.classList.remove("error"),this}}class R{constructor(t,e){return this.group=t,this.element=e,this}targets(t){return this.element.classList.contains(t)}isActive(){return this.element.classList.contains("active")}setActive(){this.element.classList.add("active")}setInactive(){this.element.classList.remove("active")}containsError(){let t=this.element.querySelectorAll("div.field.error, .system-alert.error, .alert.alert-danger, .error.show-in-tabs");return null!==t&&t.length>0}}var D=class{constructor(t){return this.adminController=t,this.groups={},this.adminController.onRefreshUi((t,e)=>{this.init()}),this}init(){this.prepareDomElements().instantiateTabs();for(let t in this.groups)this.groups.hasOwnProperty(t)&&this.groups[t].setDefaultActiveTab().setControlsWithErrors();return this}prepareDomElements(){let t=["ul.tabs","section.tabs"];for(let e=0;e<t.length;e++){let n=0,i=document.querySelectorAll(t[e]+":not(.ready)");for(let t=0;t<i.length;t++)void 0===i[t].dataset.tabgroup&&i[t].setAttribute("data-tabgroup","tab-group-"+n++)}return this}instantiateTabs(){let t,e,n,i,r;for(t=document.querySelectorAll("ul.tabs:not(.ready)"),n=0;n<t.length;n++){for(i=t[n].dataset.tabgroup,this.groups.hasOwnProperty(i)||(this.groups[i]=new L(i,this.adminController)),e=t[n].querySelectorAll("li.tab"),r=0;r<e.length;r++)this.groups[i].addControl(new M(this.groups[i],e[r]));t[n].classList.add("ready")}for(t=document.querySelectorAll("section.tabs:not(.ready)"),n=0;n<t.length;n++){for(i=t[n].dataset.tabgroup,e=t[n].querySelectorAll("div.tab-page"),r=0;r<e.length;r++)this.groups[i].addPanel(new R(this.groups[i],e[r]));t[n].classList.add("ready")}return this}};class P{constructor(t){this.container=t,this.checkbox=this.container.next("input[type=checkbox]"),this.is_readonly=this.checkbox.hasClass("readonly"),this.width=this.checkbox.data("toggle-width")||"100px",this.height=this.checkbox.data("toggle-height")||"30px",this.text_on=this.checkbox.data("text-on")||"ON",this.text_off=this.checkbox.data("text-off")||"OFF",this.checkbox.hide(),this.container.addClass("toggled").css({width:this.width,height:this.height,"text-align":"center"}).toggles({checkbox:this.checkbox,click:!this.is_readonly,drag:!this.is_readonly,clicker:this.checkbox,on:this.checkbox.is(":checked"),text:{on:this.text_on,off:this.text_off}}).on("toggle",(t,e)=>{this.checkbox.trigger("toggle",[e]).trigger("change")})}destroy(){this.container.empty().removeClass("toggled").removeAttr("style"),this.checkbox.show()}}var O=class{constructor(t){return t.onRefreshUi((t,e)=>{this.init(e)}).onDestroyUi((t,e)=>{this.destroy(e)}),this}init(t){return $(".form-bool:not(.toggled)",t).each((function(){$(this).data("instance",new P($(this)))})),this}destroy(t){return $(".form-bool.toggled",t).each((t,e)=>{$(e).data("instance").destroy()}),this}};class U{constructor(t){return this.ready=!1,this.config={basic:window.NAILS.URL+"js/ckeditor.config.basic.min.js",default:window.NAILS.URL+"js/ckeditor.config.default.min.js"},t.onRefreshUi((t,e)=>{this.init(e)}).onDestroyUi((t,e)=>{this.destroy(e)}),$.ajax({url:window.SITE_URL+"api/admin/ckeditor/configs"}).done(t=>{this.config.basic=t.data.basic,this.config.default=t.data.default,this.ready=!0,U.log("Ready"),this.init(document)}).fail(t=>{U.warn("Failed to fetch configs. Falling back to default configuration"),this.ready=!0,U.log("Ready"),this.init(document)}),this}init(t){return this.ready&&(U.log("Initiating new WYSIWYG",t),$("textarea.wysiwyg:not(.wysiwyged)",t).each((t,e)=>{$(e).data("instance",new z($(e),this.config))})),this}destroy(t){return $("textarea.wysiwyg.wysiwyged",t).each((t,e)=>{$(e).data("instance").destroy()}),this}static log(){"function"==typeof console.log&&console.log("WYSIWYG:",...arguments)}static warn(t,e){"function"==typeof console.warn&&console.warn("WYSIWYG:",...arguments)}}class z{constructor(t,e){this.container=t,this.config=e,U.log("Constructing",this.container),this.container.addClass("wysiwyged").ckeditor({customConfig:this.container.hasClass("wysiwyg-basic")?this.config.basic:this.config.default})}destroy(){U.log("Destroying",this.container),this.container.removeClass("wysiwyged").ckeditor((function(){this.destroy()})).data("instance",null)}}var q=U;let H;H=function(){return{namespace:"nails/module-admin",instances:{},registerPlugin:function(t,e,n){return void 0===this.instances[t]&&(this.instances[t]={}),this.instances[t][e]=n,this},trigger:function(t,e){return document.dispatchEvent(new CustomEvent(t,{detail:e})),this},on:function(t,e){return document.addEventListener(t,e),this},refreshUi:function(t){return this.log("Refreshing UI",t||document),this.trigger("admin:refresh-ui",{domElement:t||document}),this},onRefreshUi:function(t){return this.on("admin:refresh-ui",(function(e){t(e,e.detail?e.detail.domElement:null)})),this},destroyUi:function(t){return this.log("Destroying UI",t||document),this.trigger("admin:destroy-ui",{domElement:t||document}),this},onDestroyUi:function(t){return this.on("admin:destroy-ui",(function(e){t(e,e.detail?e.detail.domElement:null)})),this},log:function(){"function"==typeof console.log&&console.log("[33m[Admin][0m",...arguments)},warn:function(t,e){"function"==typeof console.warn&&console.warn("[33m[Admin][0m",...arguments)}}},window.NAILS.ADMIN=new H,window.NAILS.ADMIN.registerPlugin(window.NAILS.ADMIN.namespace,"Alerts",new i(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Confirm",new r(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"CopyToClipboard",new c(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"DisabledElements",new d).registerPlugin(window.NAILS.ADMIN.namespace,"DynamicTable",new h(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"IndexButtons",new u(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Modalize",new g(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Notes",new y(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Repeater",new x(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Revealer",new C(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Searcher",new T(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Sortable",new N(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Stripes",new j(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Tabs",new D(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Toggles",new O(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Wysiwyg",new q(window.NAILS.ADMIN))}]);<commit_msg>Compiles assets<commit_after>!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e,n){
/*!
 * clipboard.js v2.0.4
 * https://zenorocha.github.io/clipboard.js
 * 
 * Licensed MIT © <NAME>
 */
var i;i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=l(n(1)),s=l(n(3)),a=l(n(4));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.resolveOptions(n),i.listenClick(t),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===i(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,a.default)(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new o.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return d("action",t)}},{key:"defaultTarget",value:function(t){var e=d("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return d("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach((function(t){n=n&&!!document.queryCommandSupported(t)})),n}}]),e}(s.default);function d(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=c},function(t,e,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(2),a=(i=s)&&i.__esModule?i:{default:i},l=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.resolveOptions(e),this.initSelection()}return o(t,[{key:"resolveOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,a.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,a.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=l},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(t),i.removeAllRanges(),i.addRange(r),e=i.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var i=this;function r(){i.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),i=n[t],r=[];if(i&&e)for(var o=0,s=i.length;o<s;o++)i[o].fn!==e&&i[o].fn._!==e&&r.push(i[o]);return r.length?n[t]=r:delete n[t],this}},t.exports=n},function(t,e,n){var i=n(5),r=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!i.string(e))throw new TypeError("Second argument must be a String");if(!i.fn(n))throw new TypeError("Third argument must be a Function");if(i.node(t))return function(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}(t,e,n);if(i.nodeList(t))return function(t,e,n){return Array.prototype.forEach.call(t,(function(t){t.addEventListener(e,n)})),{destroy:function(){Array.prototype.forEach.call(t,(function(t){t.removeEventListener(e,n)}))}}}(t,e,n);if(i.string(t))return function(t,e,n){return r(document.body,t,e,n)}(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var i=n(7);function r(t,e,n,i,r){var s=o.apply(this,arguments);return t.addEventListener(n,s,r),{destroy:function(){t.removeEventListener(n,s,r)}}}function o(t,e,n,r){return function(n){n.delegateTarget=i(n.target,e),n.delegateTarget&&r.call(t,n)}}t.exports=function(t,e,n,i,o){return"function"==typeof t.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return r(t,e,n,i,o)})))}},function(t,e){var n=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}t.exports=function(t,e){for(;t&&t.nodeType!==n;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])},t.exports=i()},function(t,e,n){t.exports=function(){"use strict";
/*!
   * mustache.js - Logic-less {{mustache}} templates with JavaScript
   * http://github.com/janl/mustache.js
   */var t=Object.prototype.toString,e=Array.isArray||function(e){return"[object Array]"===t.call(e)};function n(t){return"function"==typeof t}function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function r(t,e){return null!=t&&"object"==typeof t&&e in t}var o=RegExp.prototype.test,s=/\S/;function a(t){return!function(t,e){return o.call(t,e)}(s,t)}var l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},c=/\s*/,d=/\s+/,h=/\s*=/,u=/\s*\}/,p=/#|\^|\/|>|\{|&|=|!/;function f(t){this.string=t,this.tail=t,this.pos=0}function g(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function m(){this.cache={}}f.prototype.eos=function(){return""===this.tail},f.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},f.prototype.scanUntil=function(t){var e,n=this.tail.search(t);switch(n){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=e.length,e},g.prototype.push=function(t){return new g(t,this)},g.prototype.lookup=function(t){var e,i,o,s=this.cache;if(s.hasOwnProperty(t))e=s[t];else{for(var a,l,c,d=this,h=!1;d;){if(t.indexOf(".")>0)for(a=d.view,l=t.split("."),c=0;null!=a&&c<l.length;)c===l.length-1&&(h=r(a,l[c])||(i=a,o=l[c],null!=i&&"object"!=typeof i&&i.hasOwnProperty&&i.hasOwnProperty(o))),a=a[l[c++]];else a=d.view[t],h=r(d.view,t);if(h){e=a;break}d=d.parent}s[t]=e}return n(e)&&(e=e.call(this.view)),e},m.prototype.clearCache=function(){this.cache={}},m.prototype.parse=function(t,n){var r=this.cache,o=t+":"+(n||y.tags).join(":"),s=r[o];return null==s&&(s=r[o]=function(t,n){if(!t)return[];var r,o,s,l=!1,g=[],m=[],v=[],w=!1,b=!1,$="",_=0;function x(){if(w&&!b)for(;v.length;)delete m[v.pop()];else v=[];w=!1,b=!1}function k(t){if("string"==typeof t&&(t=t.split(d,2)),!e(t)||2!==t.length)throw new Error("Invalid tags: "+t);r=new RegExp(i(t[0])+"\\s*"),o=new RegExp("\\s*"+i(t[1])),s=new RegExp("\\s*"+i("}"+t[1]))}k(n||y.tags);for(var S,A,C,I,E,T,N=new f(t);!N.eos();){if(S=N.pos,C=N.scanUntil(r))for(var j=0,L=C.length;j<L;++j)a(I=C.charAt(j))?(v.push(m.length),$+=I):(b=!0,l=!0,$+=" "),m.push(["text",I,S,S+1]),S+=1,"\n"===I&&(x(),$="",_=0,l=!1);if(!N.scan(r))break;if(w=!0,A=N.scan(p)||"name",N.scan(c),"="===A?(C=N.scanUntil(h),N.scan(h),N.scanUntil(o)):"{"===A?(C=N.scanUntil(s),N.scan(u),N.scanUntil(o),A="&"):C=N.scanUntil(o),!N.scan(o))throw new Error("Unclosed tag at "+N.pos);if(E=">"==A?[A,C,S,N.pos,$,_,l]:[A,C,S,N.pos],_++,m.push(E),"#"===A||"^"===A)g.push(E);else if("/"===A){if(!(T=g.pop()))throw new Error('Unopened section "'+C+'" at '+S);if(T[1]!==C)throw new Error('Unclosed section "'+T[1]+'" at '+S)}else"name"===A||"{"===A||"&"===A?b=!0:"="===A&&k(C)}if(x(),T=g.pop())throw new Error('Unclosed section "'+T[1]+'" at '+N.pos);return function(t){for(var e,n=[],i=n,r=[],o=0,s=t.length;o<s;++o)switch((e=t[o])[0]){case"#":case"^":i.push(e),r.push(e),i=e[4]=[];break;case"/":r.pop()[5]=e[2],i=r.length>0?r[r.length-1][4]:n;break;default:i.push(e)}return n}(function(t){for(var e,n,i=[],r=0,o=t.length;r<o;++r)(e=t[r])&&("text"===e[0]&&n&&"text"===n[0]?(n[1]+=e[1],n[3]=e[3]):(i.push(e),n=e));return i}(m))}(t,n)),s},m.prototype.render=function(t,e,n,i){var r=this.parse(t,i),o=e instanceof g?e:new g(e,void 0);return this.renderTokens(r,o,n,t,i)},m.prototype.renderTokens=function(t,e,n,i,r){for(var o,s,a,l="",c=0,d=t.length;c<d;++c)a=void 0,"#"===(s=(o=t[c])[0])?a=this.renderSection(o,e,n,i):"^"===s?a=this.renderInverted(o,e,n,i):">"===s?a=this.renderPartial(o,e,n,r):"&"===s?a=this.unescapedValue(o,e):"name"===s?a=this.escapedValue(o,e):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(l+=a);return l},m.prototype.renderSection=function(t,i,r,o){var s=this,a="",l=i.lookup(t[1]);if(l){if(e(l))for(var c=0,d=l.length;c<d;++c)a+=this.renderTokens(t[4],i.push(l[c]),r,o);else if("object"==typeof l||"string"==typeof l||"number"==typeof l)a+=this.renderTokens(t[4],i.push(l),r,o);else if(n(l)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(l=l.call(i.view,o.slice(t[3],t[5]),(function(t){return s.render(t,i,r)})))&&(a+=l)}else a+=this.renderTokens(t[4],i,r,o);return a}},m.prototype.renderInverted=function(t,n,i,r){var o=n.lookup(t[1]);if(!o||e(o)&&0===o.length)return this.renderTokens(t[4],n,i,r)},m.prototype.indentPartial=function(t,e,n){for(var i=e.replace(/[^ \t]/g,""),r=t.split("\n"),o=0;o<r.length;o++)r[o].length&&(o>0||!n)&&(r[o]=i+r[o]);return r.join("\n")},m.prototype.renderPartial=function(t,e,i,r){if(i){var o=n(i)?i(t[1]):i[t[1]];if(null!=o){var s=t[6],a=t[5],l=t[4],c=o;return 0==a&&l&&(c=this.indentPartial(o,l,s)),this.renderTokens(this.parse(c,r),e,i,c)}}},m.prototype.unescapedValue=function(t,e){var n=e.lookup(t[1]);if(null!=n)return n},m.prototype.escapedValue=function(t,e){var n=e.lookup(t[1]);if(null!=n)return y.escape(n)},m.prototype.rawValue=function(t){return t[1]};var y={name:"mustache.js",version:"3.2.1",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,to_html:void 0,Scanner:void 0,Context:void 0,Writer:void 0},v=new m;return y.clearCache=function(){return v.clearCache()},y.parse=function(t,e){return v.parse(t,e)},y.render=function(t,n,i,r){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+(e(o=t)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return v.render(t,n,i,r)},y.to_html=function(t,e,i,r){var o=y.render(t,e,i);if(!n(r))return o;r(o)},y.escape=function(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return l[t]}))},y.Scanner=f,y.Context=g,y.Writer=m,y}()},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(2);var i=class{constructor(t){return t.onRefreshUi(()=>{this.init()}),this}init(){return $(".alert__close:not(.alert__close--initiated)").addClass("alert__close--initiated").on("click",(function(){$(this).closest(".alert").remove()})),this}};var r=class{constructor(t){return t.onRefreshUi(t=>{this.init(t)}),this}init(t){return $("a.confirm",t).on("click",t=>{let e=$(t.currentTarget),n=e.data("body")||"Please confirm you'd like to continue with this action.",i=e.data("title")||"Are you sure?";return n.replace(/\\n/g,"\n"),!n.length||($("<div>").html(n).dialog({title:i,resizable:!1,draggable:!1,modal:!0,dialogClass:"no-close",buttons:{OK:function(){window.location.href=e.attr("href")},Cancel:function(){$(this).dialog("close")}}}),!1)}),this}},o=n(0),s=n.n(o);class a{constructor(t){$(document).on("admin:js-copy-to-clipboard",(t,e)=>{a.log("Initiating new copy buttons"),$(e).addClass("js-copy-to-clipboard--initiated").each((t,e)=>{$(e).data("clipboardjs")||$(e).data("clipboardjs",new l(e))})}),t.onRefreshUi(()=>{$(document).trigger("admin:js-copy-to-clipboard",[".js-copy-to-clipboard"])})}static log(){"function"==typeof console.log&&console.log("[33m[CopyToClipboard][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[CopyToClipboard][0m",...arguments)}}class l{constructor(t){this.$body=$("body"),this.$el=$(t),this.$icon=$("<div>").text("Copied").css({position:"absolute",left:0,top:0,background:"#000000",color:"#ffffff",zIndex:1e6,padding:"0.25rem 0.5rem",borderRadius:"3px",border:"1px solid #ffffff",fontSize:"0.8rem"}),this.clipboardJs=new s.a(t),this.clipboardJs.on("success",t=>{a.log("Item copied!"),this.showIcon(),t.clearSelection()}).on("error",t=>{a.warn("Error",t),t.clearSelection()})}showIcon(){this.$icon.remove(),this.$body.append(this.$icon);this.calcOffsetTop();this.$icon.css({opacity:0,left:this.calcOffsetLeft(),top:this.calcOffsetTop()}).animate({opacity:1},100).delay(250).animate({opacity:0},250),setTimeout(()=>{this.$icon.remove()},600)}calcOffsetLeft(){return this.$el.offset().left+this.$el.outerWidth()/2-this.$icon.outerWidth()/2}calcOffsetTop(){return this.$el.offset().top-this.$icon.outerHeight()-5}}var c=a;var d=class{constructor(){return $(document).on("click",".btn-disabled",()=>!1),this}};var h=class{constructor(t){return this.adminController=t,this.adminController.onRefreshUi(()=>{$(".js-admin-dynamic-table:not(.ready)").addClass("ready").each((t,e)=>{this.init($(e))})}),this}init(t){t.trigger("dynamic-table:starting");let e=t.find(".js-admin-dynamic-table__template"),n=t.data("data")||[];t.data("template",e.html()),t.data("index",0),e.empty(),e.removeClass("js-admin-dynamic-table__template"),this.bindEvents(t,e);for(let i=0,r=n.length;i<r;i++)this.add(t,e,n[i]);return t.trigger("dynamic-table:ready"),this}bindEvents(t,e){return $(".js-admin-dynamic-table__add",t).on("click",()=>(this.add(t,e),!1)),t.on("click",".js-admin-dynamic-table__remove",e=>(this.remove(t,$(e.currentTarget).closest("tr")),!1)),this}add(t,e,n){(n=n||{}).index=t.data("index")||0;let i=$(Mustache.render(t.data("template"),n));return $("input[type=checkbox]",i).each((t,e)=>{let n=$(e);n[0].hasAttribute("data-dynamic-table-checked")&&n.prop("checked",n.attr("data-dynamic-table-checked"))}),$("select",i).each((t,e)=>{let n=$(e);if(n[0].hasAttribute("data-dynamic-table-value")){let t=n.data("dynamic-table-value");$('option[value="'+t+'"]',n).prop("selected",!0)}n.css("width","100%").select2()}),e.append(i),t.data("index",n.index+1),t.trigger("dynamic-table:add",[i]),t.find(".js-admin-sortable").trigger("sortable:sort"),this.adminController.refreshUi(i),this}remove(t,e){return e.remove(),t.trigger("dynamic-table:remove"),t.find(".js-admin-sortable").trigger("sortable:sort"),this}};var u=class{constructor(t){return t.onRefreshUi((t,e)=>{this.init(e)}),this}init(t){return $("td.actions",t).each((t,e)=>{let n=$("> .btn, > .btn-group",e),i=[];n.each((t,e)=>{i.push(e.offsetTop)}),Math.max(...i)!==Math.min(...i)?(n.addClass("btn-block"),n.filter(".btn-group").find("> .btn").addClass("btn-block")):(n.removeClass("btn-block"),n.filter(".btn-group").find("> .btn").removeClass("btn-block"))}),this}};class p{constructor(t){return $(document).on("admin:js-admin-modalize",(t,e,n,i)=>{p.log("Initiating new modalize buttons"),this.init(e,n,i)}),this.adminController=t,this.adminController.onRefreshUi((t,e)=>{$(document).trigger("admin:js-admin-modalize",[".js-admin-modalize:not(.modalized)",{},e])}),this}init(t,e,n){return e=e||{},$(t,n).each((t,n)=>{$(n).add("modalized").data("modalize",new f(this.adminController,n,e))}),this}static log(){"function"==typeof console.log&&console.log("[33m[Modalize][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[Modalize][0m",...arguments)}}class f{constructor(t,e,n){this.adminController=t,this.$trigger=$(e),this.$trigger.data("modalize")instanceof f||(this.target_id=this.coalesce(this.$trigger.data("target-id"),n.target_id),this.title=this.coalesce(this.$trigger.data("title"),n.title),this.width=this.coalesce(this.$trigger.data("width"),n.width),this.max_height=this.coalesce(this.$trigger.data("max-height"),n.max_height),this.target=document.getElementById(this.target_id),this.target?($(this.target).wrapInner("<div></div>").hide(),this.$trigger.on("click",()=>(this.open(),!1))):p.warn('"'+this.target_id+'" is not a valid ID'))}open(){p.log("Opening modal"),this.adminController.destroyUi(this.target);let t=$(this.target).find("> div").detach();p.log(t),this.$modal=$("<div>").html(t).dialog({modal:!0,dialogClass:"no-close no-padding",closeOnEscape:!1,draggable:!1,title:this.title,width:this.width,maxHeight:this.max_height,position:{my:"center",at:"center",of:window},open:()=>{this.adminController.refreshUi(this.$modal)},buttons:{OK:()=>{this.close()}}})}close(t){p.log("Closing modal"),this.adminController.instances["nails/module-admin"].Wysiwyg.destroy(this.$modal);let e=this.$modal.find("> div").detach();$(this.target).append(e),this.$modal.dialog("close").remove(),this.$modal=null}coalesce(){var t=arguments.length;for(let e=0;e<t;e++)if(null!==arguments[e]&&void 0!==arguments[e])return arguments[e];return null}}var g=p;class m{constructor(t){return t.onRefreshUi(()=>{this.init()}),this}init(){return $(".js-admin-notes:not(.processed)").addClass("processed").each((t,e)=>{let n=$(e),i=$("<span>").addClass("admin-notes__counter"),r=n.data("model-name"),o=n.data("model-provider"),s=n.data("id"),a=n.data("modal-title")||"Notes",l=n.data("modal-width")||500,c=n.data("modal-max-height")||750;n.append(i).on("click",()=>{let t=$("<div>").dialog({modal:!0,title:a,width:l,maxHeight:c,position:{my:"center",at:"center",of:window}});return this.load(t,r,o,s),!1}),this.countNotes(r,o,s).done(t=>{this.setCounter(t)})}),this}load(t,e,n,i){t.html($("<p>").text("Loading...")),this.loadNotes(e,n,i).done(r=>{let o=$("<ul>").addClass("admin-notes"),s=$("<li>").addClass("admin-notes__empty").append($("<p>").text("No notes recorded for this item"));if(o.append(s),r.data.length){s.hide();for(let e=0,n=r.data.length;e<n;e++)o.append(this.renderMessageItem(t,r.data[e].id,r.data[e].message,r.data[e].user,r.data[e].date))}let a=$("<li>"),l=$("<textarea>"),c=$("<button>").addClass("btn btn-block btn-primary").text("Add Note").on("click",()=>{this.saveNote(e,n,i,l.val()).done(e=>{l.val(""),$(".admin-notes__empty",t).hide(),a.before(this.renderMessageItem(t,e.data.id,e.data.message,e.data.user,e.data.date)),this.setCounter(t.length).centerModal(t,!0)})});o.append(a.append(l).append(c)),t.html(o),this.centerModal(t,!0)})}centerModal(t,e){return t.dialog("option","position",{my:"center",at:"center",of:window}),e&&t.animate({scrollTop:t.find(".admin-notes").outerHeight()},200),this}countNotes(t,e,n){let i=new $.Deferred;return $.ajax({url:window.SITE_URL+"api/admin/note/count",data:{model_name:t,model_provider:e,item_id:n}}).done(t=>{i.resolve(t.data)}).fail(t=>{m.showError(t.responseText),i.reject(t.responseText)}),i.promise()}loadNotes(t,e,n){let i=new $.Deferred;return $.ajax({url:window.SITE_URL+"api/admin/note",data:{model_name:t,model_provider:e,item_id:n}}).done(t=>{i.resolve(t)}).fail(t=>{m.showError(t.responseText),i.reject(t.responseText)}),i.promise()}saveNote(t,e,n,i){let r=new $.Deferred;return $.ajax({url:window.SITE_URL+"api/admin/note",method:"POST",data:{model_name:t,model_provider:e,item_id:n,message:i}}).done(t=>{r.resolve(t)}).fail(t=>{m.showError(t.responseText),r.reject(t.responseText)}),r.promise()}deleteNote(t){let e=new $.Deferred;return $.ajax({url:window.SITE_URL+"api/admin/note/"+t,method:"DELETE"}).done(t=>{e.resolve(t)}).fail(t=>{m.showError(t.responseText),e.reject(t.responseText)}),e.promise()}renderMessageItem(t,e,n,i,r){let o=$("<li>").addClass("admin-notes__note"),s=$("<div>").addClass("admin-notes__note__message").html(n),a=$("<button>").addClass("admin-notes__note__delete").html("&times;"),l=$("<div>").addClass("admin-notes__note__meta"),c=$("<span>").addClass("admin-notes__note__meta__user").html(i.first_name+" "+i.last_name),d=$("<span>").addClass("admin-notes__note__meta__date").html(r);return a.on("click",()=>(this.deleteNote(e).done(()=>{o.remove(),this.centerModal(t,!1);let e=$(".admin-notes__note",t).length;this.setCounter(e),0===e&&$(".admin-notes__empty",t).show()}),!1)),o.append(s).append(a).append(l.append(c).append(d))}setCounter(t){return $(".admin-notes__counter").text(t||""),this}static showError(t){let e;try{e=JSON.parse(t)}catch(t){e={error:"An unknown error occurred"}}alert(e.error)}}var y=m,v=n(1),w=n.n(v);class b{constructor(t){return this.adminController=t,this.adminController.onRefreshUi((t,e)=>{this.init(e)}),this}init(t){return $(".js-admin-repeater:not(.processed)",t).addClass("processed").each((t,e)=>{let n=$(e),i=new _(this.adminController,n,n.data("data"));n.data("js-admin-repeater-instance",i)}),this}static log(){"function"==typeof console.log&&console.log("[33m[Repeater][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[Repeater][0m",...arguments)}}class _{constructor(t,e,n){return this.trigger("constructing"),this.index=0,this.adminController=t,this.$element=e,this.$target=$(".js-admin-repeater__target",this.$element),this.$add=$(".js-admin-repeater__add",this.$element),this.template=$(".js-admin-repeater__template",this.$element).html(),$(".js-admin-repeater__template",this.$element).remove(),this.bindEvents(),this.load(n||[]),this.trigger("constructed"),this}bindEvents(){this.trigger("binding"),this.$add.on("click",t=>(this.add(),!1)),this.$target.on("click",".js-admin-repeater__remove",t=>(this.remove($(t.currentTarget)),!1)),this.$element.on("js-admin-repeater:load",(t,e)=>{this.load(e)}).on("js-admin-repeater:clear",t=>{this.reset()}),this.trigger("bound")}add(t){(t=t||{}).index=this.index,this.trigger("adding",t);let e=$("<li>").addClass("js-admin-repeater__target__item"),n=this.template;n=w.a.render(n,t),e.html(n),$("input[type=checkbox]",e).each((t,e)=>{let n=$(e);n[0].hasAttribute("data-repeater-checked")&&n.prop("checked",n.attr("data-repeater-checked"))}),$("select",e).each((t,e)=>{let n=$(e);if(n[0].hasAttribute("data-repeater-value")){let t=n.data("repeater-value");$('option[value="'+t+'"]',n).prop("selected",!0)}n.css("width","100%").select2()}),this.$target.append(e),this.index++,this.$element.find(".js-admin-sortable").trigger("sortable:sort"),this.adminController.refreshUi(e),this.trigger("added")}remove(t){let e=t.closest(".js-admin-repeater__target__item");this.trigger("removing",e),e.remove(),this.$element.find(".js-admin-sortable").trigger("sortable:sort"),this.trigger("removed",e)}load(t){this.trigger("loading",t);for(let e in t)t.hasOwnProperty(e)&&this.add(t[e]);this.trigger("loaded",t)}reset(){this.trigger("resetting"),$(".js-admin-repeater__target__item",this.$target).remove(),this.index=0,this.trigger("reset")}trigger(t,e){let n={instance:this,data:e};b.log("Triggering Event: "+t,n)}}var x=b;class k{constructor(t){return this.groups={},t.onRefreshUi((t,e)=>{this.init(e)}).onDestroyUi((t,e)=>{this.destroy(e)}),this}init(t){return $("[data-revealer]:not(.processed)",t).filter(":input").filter("input[type=checkbox], select").each((e,n)=>{let i=$(n).data("revealer");void 0===this.groups[i]?(this.groups[i]=new S(i,n),this.groups[i].findNewElements(t)):k.warn(`Duplicate group "${i}"`)}),this}destroy(t){for(let e in this.groups)this.groups.hasOwnProperty(e)&&(null===t||$.contains(t,this.groups[e].$control))&&(this.groups[e].destroy(),delete this.groups[e])}static log(){"function"==typeof console.log&&console.log("[33m[Revealer][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[Revealer][0m",...arguments)}}class S{constructor(t,e){this.group=t,this.$control=$(e),this.elements=[],this.$control.addClass("processed").on("change",()=>{this.toggle(this.getControlValue())})}findNewElements(t){return $(`[data-revealer="${this.group}"]:not(.processed)`,t).filter(":not(input[type=checkbox], select)").each((t,e)=>{this.elements.push(new A(e))}),this.$control.trigger("change"),this}getControlValue(){let t;return t=this.$control.is("select")?this.$control.val():this.$control.is(":checked")}toggle(t){k.log(`Toggling elements for value ${t}`);for(let e=0;e<this.elements.length;e++)this.elements[e].isShown(t)?this.elements[e].show():this.elements[e].hide()}destroy(){this.$control.removeClass("processed");for(let t=0;t<this.elements.length;t++)this.elements[t].destroy()}}class A{constructor(t){this.$element=$(t),this.value=this.$element.data("reveal-on"),this.$element.addClass("processed")}isShown(t){return this.value===t}show(){return this.$element.show(),this}hide(){return this.$element.hide(),this}destroy(){this.$element.removeClass("processed"),this.show()}}var C=k;class I{constructor(t){return $(document).on("admin:js-searcher",(t,e,n,i)=>{I.log("Initiating new searchers"),this.init(e,n,i)}),this.adminController=t,this.adminController.onRefreshUi((t,e)=>{$(document).trigger("admin:js-searcher",[".js-searcher:not(.processed)",{},e])}),this}init(t,e,n){return e=e||{},$(t,n).each((t,n)=>{$(n).add("processed").data("searcher",new E(n,e))}),this}static log(){"function"==typeof console.log&&console.log("[33m[Searcher][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[Searcher][0m",...arguments)}}class E{constructor(t,e){this.$input=$(t),this.$input.data("searcher")instanceof E||(this.api=this.coalesce(this.$input.data("api"),e.api),this.isMultiple=this.coalesce(this.$input.data("multiple"),e.isMultiple,!1),this.isClearable=this.coalesce(this.$input.data("clearable"),e.isClearable,!0),this.placeholder=this.coalesce(this.$input.data("placeholder"),e.placeholder,"Search for an item"),this.minLength=this.coalesce(this.$input.data("min-length"),e.minLength,2),this.getParam=this.coalesce(this.$input.data("get-param"),e.getParam,"search"),this.formatter=this.coalesce(e.formatter,null),this.propId=this.coalesce(this.$input.data("prop-id"),e.propId,"id"),this.propLabel=this.coalesce(this.$input.data("prop-label"),e.propLabel,"label"),this.api?this.$input.removeClass("js-searcher").select2({placeholder:this.placeholder,minimumInputLength:this.minLength,multiple:this.isMultiple,allowClear:this.isClearable,ajax:{url:window.SITE_URL+"api/"+this.api,dataType:"json",quietMillis:250,data:t=>{let e={};return e[this.getParam]=t,e},results:t=>({results:this.formatResults(t.data)}),cache:!0},initSelection:(t,e)=>{let n=$(t).val();""!==n&&this.isMultiple?$.ajax({url:window.SITE_URL+"api/"+this.api+"?ids="+n,dataType:"json"}).done(t=>{e(this.formatResults(t.data))}):""!==n&&$.ajax({url:window.SITE_URL+"api/"+this.api+"/"+n,dataType:"json"}).done(t=>{e(this.formatResult(t.data))})}}):console.warn("Element is configured as a Searcher but no api has been defined",this.$input))}formatResults(t){let e=[];for(let n=0;n<t.length;n++)e.push(this.formatResult(t[n]));return e}formatResult(t){return"function"==typeof this.formatter?this.formatter.call(this,t):{id:t[this.propId],text:t[this.propLabel]}}coalesce(){var t=arguments.length;for(let e=0;e<t;e++)if(null!==arguments[e]&&void 0!==arguments[e])return arguments[e];return null}}var T=I;var N=class{constructor(t){return t.onRefreshUi((t,e)=>{this.init(e)}),this}init(t){return $(".js-admin-sortable:not(.processed)",t).addClass("processed").each((function(){let t=$(this),e=t.data("handle")||null,n=t.data("axis")||"y",i=t.data("containment")||"parent";t.sortable({handle:e,axis:n,containment:i,forceHelperSize:!0,helper:function(t,e){let n=e.children(),i=e.clone();return i.children().each((function(t){$(this).width(n.eq(t).outerWidth())})),i},stop:function(){t.trigger("sortable:sort")}}).on("sortable:sort",()=>{t.find(".js-admin-sortable__order").each((function(t){$(this).val(t)}))}),e&&t.find(e).addClass("js-admin-sortable__handle")})),this}};var j=class{constructor(t){return t.onRefreshUi((t,e)=>{this.init(e)}),this}init(t){return $("fieldset,.fieldset",t).each((function(){$("div.field",this).removeClass("odd even"),$("div.field:visible:odd",this).addClass("odd"),$("div.field:visible:even",this).addClass("even")})),this}};class L{constructor(t,e){return this.slug=t,this.adminController=e,this.controls=[],this.panels=[],this.input=document.querySelectorAll('input[data-tabgroup="'+this.slug+'"]'),this.defaultTabSet=!1,this}addControl(t){this.controls.push(t)}addPanel(t){this.panels.push(t)}setDefaultActiveTab(){if(this.defaultTabSet)return this;this.defaultTabSet=!0;for(let t=0;t<this.controls.length;t++){let e=this.controls[t].getTarget();for(let t=0;t<this.panels.length;t++){let n=this.panels[t];if(n.targets(e)&&n.containsError())return this.goTo(e),this}}return this.input.length&&this.input[0].value.length?(this.goTo(this.input[0].value),this):(this.controls.length>0&&this.goTo(this.controls[0].getTarget()),this)}setControlsWithErrors(){for(let t=0;t<this.controls.length;t++){let e=this.controls[t].getTarget();for(let n=0;n<this.panels.length;n++){let i=this.panels[n];i.targets(e)&&(i.containsError()?this.controls[t].setError():this.controls[t].setNoError())}}}goTo(t){let e;for(e=0;e<this.controls.length;e++)this.controls[e].targets(t)?this.controls[e].setActive():this.controls[e].setInactive();for(e=0;e<this.panels.length;e++)this.panels[e].targets(t)?this.panels[e].setActive():this.panels[e].setInactive();if(this.input.length)for(let e=0;e<this.input.length;e++)this.input[e].value=t;this.adminController.refreshUi()}}class M{constructor(t,e){return this.group=t,this.element=e,this.link=this.element.querySelector("a"),this.target=this.link.dataset.tab,this.element.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.group.goTo(this.target)}),this}getTarget(){return this.target}targets(t){return this.target===t}isActive(){return this.element.classList.contains("active")}setActive(){return this.element.classList.add("active"),this}setInactive(){return this.element.classList.remove("active"),this}setError(){return this.link.classList.add("error"),this}setNoError(){return this.link.classList.remove("error"),this}}class R{constructor(t,e){return this.group=t,this.element=e,this}targets(t){return this.element.classList.contains(t)}isActive(){return this.element.classList.contains("active")}setActive(){this.element.classList.add("active")}setInactive(){this.element.classList.remove("active")}containsError(){let t=this.element.querySelectorAll("div.field.error, .system-alert.error, .alert.alert-danger, .error.show-in-tabs");return null!==t&&t.length>0}}var D=class{constructor(t){return this.adminController=t,this.groups={},this.adminController.onRefreshUi((t,e)=>{this.init()}),this}init(){this.prepareDomElements().instantiateTabs();for(let t in this.groups)this.groups.hasOwnProperty(t)&&this.groups[t].setDefaultActiveTab().setControlsWithErrors();return this}prepareDomElements(){let t=["ul.tabs","section.tabs"];for(let e=0;e<t.length;e++){let n=0,i=document.querySelectorAll(t[e]+":not(.ready)");for(let t=0;t<i.length;t++)void 0===i[t].dataset.tabgroup&&i[t].setAttribute("data-tabgroup","tab-group-"+n++)}return this}instantiateTabs(){let t,e,n,i,r;for(t=document.querySelectorAll("ul.tabs:not(.ready)"),n=0;n<t.length;n++){for(i=t[n].dataset.tabgroup,this.groups.hasOwnProperty(i)||(this.groups[i]=new L(i,this.adminController)),e=t[n].querySelectorAll("li.tab"),r=0;r<e.length;r++)this.groups[i].addControl(new M(this.groups[i],e[r]));t[n].classList.add("ready")}for(t=document.querySelectorAll("section.tabs:not(.ready)"),n=0;n<t.length;n++){for(i=t[n].dataset.tabgroup,e=t[n].querySelectorAll("div.tab-page"),r=0;r<e.length;r++)this.groups[i].addPanel(new R(this.groups[i],e[r]));t[n].classList.add("ready")}return this}};class P{constructor(t){this.container=t,this.checkbox=this.container.next("input[type=checkbox]"),this.is_readonly=this.checkbox.hasClass("readonly"),this.width=this.checkbox.data("toggle-width")||"100px",this.height=this.checkbox.data("toggle-height")||"30px",this.text_on=this.checkbox.data("text-on")||"ON",this.text_off=this.checkbox.data("text-off")||"OFF",this.checkbox.hide(),this.container.addClass("toggled").css({width:this.width,height:this.height,"text-align":"center"}).toggles({checkbox:this.checkbox,click:!this.is_readonly,drag:!this.is_readonly,clicker:this.checkbox,on:this.checkbox.is(":checked"),text:{on:this.text_on,off:this.text_off}}).on("toggle",(t,e)=>{this.checkbox.trigger("toggle",[e]).trigger("change")})}destroy(){this.container.empty().removeClass("toggled").removeAttr("style"),this.checkbox.show()}}var O=class{constructor(t){return t.onRefreshUi((t,e)=>{this.init(e)}).onDestroyUi((t,e)=>{this.destroy(e)}),this}init(t){return $(".form-bool:not(.toggled)",t).each((function(){$(this).data("instance",new P($(this)))})),this}destroy(t){return $(".form-bool.toggled",t).each((t,e)=>{$(e).data("instance").destroy()}),this}};class U{constructor(t){return this.ready=!1,this.config={basic:window.NAILS.URL+"js/ckeditor.config.basic.min.js",default:window.NAILS.URL+"js/ckeditor.config.default.min.js"},t.onRefreshUi((t,e)=>{this.init(e)}).onDestroyUi((t,e)=>{this.destroy(e)}),$.ajax({url:window.SITE_URL+"api/admin/ckeditor/configs"}).done(t=>{this.config.basic=t.data.basic,this.config.default=t.data.default,this.ready=!0,U.log("Ready"),this.init(document)}).fail(t=>{U.warn("Failed to fetch configs. Falling back to default configuration"),this.ready=!0,U.log("Ready"),this.init(document)}),this}init(t){return this.ready&&(U.log("Initiating new WYSIWYG",t),$("textarea.wysiwyg:not(.wysiwyged)",t).each((t,e)=>{$(e).data("instance",new z($(e),this.config))})),this}destroy(t){return $("textarea.wysiwyg.wysiwyged",t).each((t,e)=>{$(e).data("instance").destroy()}),this}static log(){"function"==typeof console.log&&console.log("[33m[WYSIWYG][0m",...arguments)}static warn(){"function"==typeof console.warn&&console.warn("[33m[WYSIWYG][0m",...arguments)}}class z{constructor(t,e){this.container=t,this.config=e,U.log("Constructing",this.container),this.container.addClass("wysiwyged").ckeditor({customConfig:this.container.hasClass("wysiwyg-basic")?this.config.basic:this.config.default})}destroy(){U.log("Destroying",this.container),this.container.removeClass("wysiwyged").ckeditor((function(){this.destroy()})).data("instance",null)}}var q=U;let H;H=function(){return{namespace:"nails/module-admin",instances:{},registerPlugin:function(t,e,n){return void 0===this.instances[t]&&(this.instances[t]={}),this.instances[t][e]=n,this},trigger:function(t,e){return document.dispatchEvent(new CustomEvent(t,{detail:e})),this},on:function(t,e){return document.addEventListener(t,e),this},refreshUi:function(t){return this.log("Refreshing UI",t||document),this.trigger("admin:refresh-ui",{domElement:t||document}),this},onRefreshUi:function(t){return this.on("admin:refresh-ui",(function(e){t(e,e.detail?e.detail.domElement:null)})),this},destroyUi:function(t){return this.log("Destroying UI",t||document),this.trigger("admin:destroy-ui",{domElement:t||document}),this},onDestroyUi:function(t){return this.on("admin:destroy-ui",(function(e){t(e,e.detail?e.detail.domElement:null)})),this},log:function(){"function"==typeof console.log&&console.log("[33m[Admin][0m",...arguments)},warn:function(t,e){"function"==typeof console.warn&&console.warn("[33m[Admin][0m",...arguments)}}},window.NAILS.ADMIN=new H,window.NAILS.ADMIN.registerPlugin(window.NAILS.ADMIN.namespace,"Alerts",new i(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Confirm",new r(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"CopyToClipboard",new c(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"DisabledElements",new d).registerPlugin(window.NAILS.ADMIN.namespace,"DynamicTable",new h(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"IndexButtons",new u(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Modalize",new g(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Notes",new y(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Repeater",new x(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Revealer",new C(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Searcher",new T(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Sortable",new N(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Stripes",new j(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Tabs",new D(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Toggles",new O(window.NAILS.ADMIN)).registerPlugin(window.NAILS.ADMIN.namespace,"Wysiwyg",new q(window.NAILS.ADMIN))}]);
{'fraction_non_alphanumeric': 0.2755362231888406, 'fraction_numerical': 0.008145746558825905, 'mean_word_length': 14.02635228848821, 'pattern_counts': {'":': 50, '<': 113, '<?xml version=': 0, '>': 243, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1034309', 'n_tokens_mistral': 33383, 'n_tokens_neox': 32986, 'n_words': 1624}