File: //home/turkishi/www/wp-content/plugins/learnpress/assets/js/dist/admin/pages/open-ai.min.js
(()=>{var e={9455:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var o=n(1601),i=n.n(o),r=n(6314),s=n.n(r)()(i());s.push([e.id,"/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n\n.toastify {\n padding: 12px 20px;\n color: #ffffff;\n display: inline-block;\n box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.12), 0 10px 36px -4px rgba(77, 96, 232, 0.3);\n background: -webkit-linear-gradient(315deg, #73a5ff, #5477f5);\n background: linear-gradient(135deg, #73a5ff, #5477f5);\n position: fixed;\n opacity: 0;\n transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);\n border-radius: 2px;\n cursor: pointer;\n text-decoration: none;\n max-width: calc(50% - 20px);\n z-index: 2147483647;\n}\n\n.toastify.on {\n opacity: 1;\n}\n\n.toast-close {\n background: transparent;\n border: 0;\n color: white;\n cursor: pointer;\n font-family: inherit;\n font-size: 1em;\n opacity: 0.4;\n padding: 0 5px;\n}\n\n.toastify-right {\n right: 15px;\n}\n\n.toastify-left {\n left: 15px;\n}\n\n.toastify-top {\n top: -150px;\n}\n\n.toastify-bottom {\n bottom: -150px;\n}\n\n.toastify-rounded {\n border-radius: 25px;\n}\n\n.toastify-avatar {\n width: 1.5em;\n height: 1.5em;\n margin: -7px 5px;\n border-radius: 2px;\n}\n\n.toastify-center {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n max-width: -moz-fit-content;\n}\n\n@media only screen and (max-width: 360px) {\n .toastify-right, .toastify-left {\n margin-left: auto;\n margin-right: auto;\n left: 0;\n right: 0;\n max-width: fit-content;\n }\n}\n",""]);const a=s},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,o,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(o)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);o&&s[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},1601:e=>{"use strict";e.exports=function(e){return e[1]}},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,o=0;o<t.length;o++)if(t[o].identifier===e){n=o;break}return n}function o(e,o){for(var r={},s=[],a=0;a<e.length;a++){var l=e[a],c=o.base?l[0]+o.base:l[0],d=r[c]||0,u="".concat(c," ").concat(d);r[c]=d+1;var p=n(u),h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)t[p].references++,t[p].updater(h);else{var m=i(h,o);o.byIndex=a,t.splice(a,0,{identifier:u,updater:m,references:1})}s.push(u)}return s}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var r=o(e=e||[],i=i||{});return function(e){e=e||[];for(var s=0;s<r.length;s++){var a=n(r[s]);t[a].references--}for(var l=o(e,i),c=0;c<r.length;c++){var d=n(r[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}r=l}}},7659:e=>{"use strict";var t={};e.exports=function(e,n){var o=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},7736:function(e){var t;t=function(e){var t=function(e){return new t.lib.init(e)};function n(e,t){return t.offset[e]?isNaN(t.offset[e])?t.offset[e]:t.offset[e]+"px":"0px"}function o(e,t){return!(!e||"string"!=typeof t||!(e.className&&e.className.trim().split(/\s+/gi).indexOf(t)>-1))}return t.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},t.lib=t.prototype={toastify:"1.12.0",constructor:t,init:function(e){return e||(e={}),this.options={},this.toastElement=null,this.options.text=e.text||t.defaults.text,this.options.node=e.node||t.defaults.node,this.options.duration=0===e.duration?0:e.duration||t.defaults.duration,this.options.selector=e.selector||t.defaults.selector,this.options.callback=e.callback||t.defaults.callback,this.options.destination=e.destination||t.defaults.destination,this.options.newWindow=e.newWindow||t.defaults.newWindow,this.options.close=e.close||t.defaults.close,this.options.gravity="bottom"===e.gravity?"toastify-bottom":t.defaults.gravity,this.options.positionLeft=e.positionLeft||t.defaults.positionLeft,this.options.position=e.position||t.defaults.position,this.options.backgroundColor=e.backgroundColor||t.defaults.backgroundColor,this.options.avatar=e.avatar||t.defaults.avatar,this.options.className=e.className||t.defaults.className,this.options.stopOnFocus=void 0===e.stopOnFocus?t.defaults.stopOnFocus:e.stopOnFocus,this.options.onClick=e.onClick||t.defaults.onClick,this.options.offset=e.offset||t.defaults.offset,this.options.escapeMarkup=void 0!==e.escapeMarkup?e.escapeMarkup:t.defaults.escapeMarkup,this.options.ariaLive=e.ariaLive||t.defaults.ariaLive,this.options.style=e.style||t.defaults.style,e.backgroundColor&&(this.options.style.background=e.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var e=document.createElement("div");for(var t in e.className="toastify on "+this.options.className,this.options.position?e.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(e.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):e.className+=" toastify-right",e.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.'),this.options.style)e.style[t]=this.options.style[t];if(this.options.ariaLive&&e.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)e.appendChild(this.options.node);else if(this.options.escapeMarkup?e.innerText=this.options.text:e.innerHTML=this.options.text,""!==this.options.avatar){var o=document.createElement("img");o.src=this.options.avatar,o.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?e.appendChild(o):e.insertAdjacentElement("afterbegin",o)}if(!0===this.options.close){var i=document.createElement("button");i.type="button",i.setAttribute("aria-label","Close"),i.className="toast-close",i.innerHTML="✖",i.addEventListener("click",function(e){e.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var r=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&r>360?e.insertAdjacentElement("afterbegin",i):e.appendChild(i)}if(this.options.stopOnFocus&&this.options.duration>0){var s=this;e.addEventListener("mouseover",function(t){window.clearTimeout(e.timeOutValue)}),e.addEventListener("mouseleave",function(){e.timeOutValue=window.setTimeout(function(){s.removeElement(e)},s.options.duration)})}if(void 0!==this.options.destination&&e.addEventListener("click",function(e){e.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&e.addEventListener("click",function(e){e.stopPropagation(),this.options.onClick()}.bind(this)),"object"==typeof this.options.offset){var a=n("x",this.options),l=n("y",this.options),c="left"==this.options.position?a:"-"+a,d="toastify-top"==this.options.gravity?l:"-"+l;e.style.transform="translate("+c+","+d+")"}return e},showToast:function(){var e;if(this.toastElement=this.buildToast(),!(e="string"==typeof this.options.selector?document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||"undefined"!=typeof ShadowRoot&&this.options.selector instanceof ShadowRoot?this.options.selector:document.body))throw"Root element is not defined";var n=t.defaults.oldestFirst?e.firstChild:e.lastChild;return e.insertBefore(this.toastElement,n),t.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(e){e.className=e.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),e.parentNode&&e.parentNode.removeChild(e),this.options.callback.call(e),t.reposition()}.bind(this),400)}},t.reposition=function(){for(var e,t={top:15,bottom:15},n={top:15,bottom:15},i={top:15,bottom:15},r=document.getElementsByClassName("toastify"),s=0;s<r.length;s++){e=!0===o(r[s],"toastify-top")?"toastify-top":"toastify-bottom";var a=r[s].offsetHeight;e=e.substr(9,e.length-1),(window.innerWidth>0?window.innerWidth:screen.width)<=360?(r[s].style[e]=i[e]+"px",i[e]+=a+15):!0===o(r[s],"toastify-left")?(r[s].style[e]=t[e]+"px",t[e]+=a+15):(r[s].style[e]=n[e]+"px",n[e]+=a+15)}return this},t.lib.init.prototype=t.lib,t},e.exports?e.exports=t():this.Toastify=t()}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={id:o,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,(()=>{"use strict";var e={};n.r(e),n.d(e,{listenElementCreated:()=>Se,listenElementViewed:()=>Ee,lpAddQueryArgs:()=>ke,lpAjaxParseJsonOld:()=>Oe,lpClassName:()=>ye,lpFetchAPI:()=>xe,lpGetCurrentURLNoParam:()=>Ce,lpOnElementReady:()=>Ae,lpSetLoadingEl:()=>_e,lpShowHideEl:()=>Te});var t={};function o(e,t){e.split(/\s+/).forEach(e=>{t(e)})}n.r(t),n.d(t,{s7:()=>Ze,$3:()=>Ye,hV:()=>Ue,$g:()=>We,HE:()=>Je,EO:()=>e,C4:()=>tt,P0:()=>et,C7:()=>Ge,P9:()=>Ke});class i{constructor(){this._events={}}on(e,t){o(e,e=>{const n=this._events[e]||[];n.push(t),this._events[e]=n})}off(e,t){var n=arguments.length;0!==n?o(e,e=>{if(1===n)return void delete this._events[e];const o=this._events[e];void 0!==o&&(o.splice(o.indexOf(t),1),this._events[e]=o)}):this._events={}}trigger(e,...t){var n=this;o(e,e=>{const o=n._events[e];void 0!==o&&o.forEach(e=>{e.apply(n,t)})})}}const r=e=>(e=e.filter(Boolean)).length<2?e[0]||"":1==d(e)?"["+e.join("")+"]":"(?:"+e.join("|")+")",s=e=>{if(!l(e))return e.join("");let t="",n=0;const o=()=>{n>1&&(t+="{"+n+"}")};return e.forEach((i,r)=>{i!==e[r-1]?(o(),t+=i,n=1):n++}),o(),t},a=e=>{let t=Array.from(e);return r(t)},l=e=>new Set(e).size!==e.length,c=e=>(e+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),d=e=>e.reduce((e,t)=>Math.max(e,u(t)),0),u=e=>Array.from(e).length,p=e=>{if(1===e.length)return[[e]];let t=[];const n=e.substring(1);return p(n).forEach(function(n){let o=n.slice(0);o[0]=e.charAt(0)+o[0],t.push(o),o=n.slice(0),o.unshift(e.charAt(0)),t.push(o)}),t},h=[[0,65535]];let m,g;const f={},w={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let e in w){let t=w[e]||"";for(let n=0;n<t.length;n++){let o=t.substring(n,n+1);f[o]=e}}const v=new RegExp(Object.keys(f).join("|")+"|[̀-ͯ·ʾʼ]","gu"),b=(e,t="NFKD")=>e.normalize(t),y=e=>Array.from(e).reduce((e,t)=>e+x(t),""),x=e=>(e=b(e).toLowerCase().replace(v,e=>f[e]||""),b(e,"NFC")),C=e=>{const t=(e=>{const t={},n=(e,n)=>{const o=t[e]||new Set,i=new RegExp("^"+a(o)+"$","iu");n.match(i)||(o.add(c(n)),t[e]=o)};for(let t of function*(e){for(const[t,n]of e)for(let e=t;e<=n;e++){let t=String.fromCharCode(e),n=y(t);n!=t.toLowerCase()&&(n.length>3||0!=n.length&&(yield{folded:n,composed:t,code_point:e}))}}(e))n(t.folded,t.folded),n(t.folded,t.composed);return t})(e),n={};let o=[];for(let e in t){let i=t[e];i&&(n[e]=a(i)),e.length>1&&o.push(c(e))}o.sort((e,t)=>t.length-e.length);const i=r(o);return g=new RegExp("^"+i,"u"),n},k=(e,t=1)=>(t=Math.max(t,e.length-1),r(p(e).map(e=>((e,t=1)=>{let n=0;return e=e.map(e=>(m[e]&&(n+=e.length),m[e]||e)),n>=t?s(e):""})(e,t)))),E=(e,t=!0)=>{let n=e.length>1?1:0;return r(e.map(e=>{let o=[];const i=t?e.length():e.length()-1;for(let t=0;t<i;t++)o.push(k(e.substrs[t]||"",n));return s(o)}))},S=(e,t)=>{for(const n of t){if(n.start!=e.start||n.end!=e.end)continue;if(n.substrs.join("")!==e.substrs.join(""))continue;let t=e.parts;const o=e=>{for(const n of t){if(n.start===e.start&&n.substr===e.substr)return!1;if(1!=e.length&&1!=n.length){if(e.start<n.start&&e.end>n.start)return!0;if(n.start<e.start&&n.end>e.start)return!0}}return!1};if(!(n.parts.filter(o).length>0))return!0}return!1};class A{parts;substrs;start;end;constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(e){e&&(this.parts.push(e),this.substrs.push(e.substr),this.start=Math.min(e.start,this.start),this.end=Math.max(e.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(e,t){let n=new A,o=JSON.parse(JSON.stringify(this.parts)),i=o.pop();for(const e of o)n.add(e);let r=t.substr.substring(0,e-i.start),s=r.length;return n.add({start:i.start,end:i.start+s,length:s,substr:r}),n}}const O=(e,t)=>{if(e)return e[t]},T=(e,t)=>{if(e){for(var n,o=t.split(".");(n=o.shift())&&(e=e[n]););return e}},_=(e,t,n)=>{var o,i;return e?(e+="",null==t.regex||-1===(i=e.search(t.regex))?0:(o=t.string.length/e.length,0===i&&(o+=.5),o*n)):0},L=(e,t)=>{var n=e[t];if("function"==typeof n)return n;n&&!Array.isArray(n)&&(e[t]=[n])},I=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)},P=(e,t)=>"number"==typeof e&&"number"==typeof t?e>t?1:e<t?-1:0:(e=y(e+"").toLowerCase())>(t=y(t+"").toLowerCase())?1:t>e?-1:0;class D{items;settings;constructor(e,t){this.items=e,this.settings=t||{diacritics:!0}}tokenize(e,t,n){if(!e||!e.length)return[];const o=[],i=e.split(/\s+/);var r;return n&&(r=new RegExp("^("+Object.keys(n).map(c).join("|")+"):(.*)$")),i.forEach(e=>{let n,i=null,s=null;r&&(n=e.match(r))&&(i=n[1],e=n[2]),e.length>0&&(s=this.settings.diacritics?(e=>{void 0===m&&(m=C(h)),e=y(e);let t="",n=[new A];for(let o=0;o<e.length;o++){let i=e.substring(o).match(g);const r=e.substring(o,o+1),s=i?i[0]:null;let a=[],l=new Set;for(const e of n){const t=e.last();if(!t||1==t.length||t.end<=o)if(s){const t=s.length;e.add({start:o,end:o+t,length:t,substr:s}),l.add("1")}else e.add({start:o,end:o+1,length:1,substr:r}),l.add("2");else if(s){let n=e.clone(o,t);const i=s.length;n.add({start:o,end:o+i,length:i,substr:s}),a.push(n)}else l.add("3")}if(a.length>0){a=a.sort((e,t)=>e.length()-t.length());for(let e of a)S(e,n)||n.push(e)}else if(o>0&&1==l.size&&!l.has("3")){t+=E(n,!1);let e=new A;const o=n[0];o&&e.add(o.last()),n=[e]}}return t+=E(n,!0),t})(e)||null:c(e),s&&t&&(s="\\b"+s)),o.push({string:e,regex:s?new RegExp(s,"iu"):null,field:i})}),o}getScoreFunction(e,t){var n=this.prepareSearch(e,t);return this._getScoreFunction(n)}_getScoreFunction(e){const t=e.tokens,n=t.length;if(!n)return function(){return 0};const o=e.options.fields,i=e.weights,r=o.length,s=e.getAttrFn;if(!r)return function(){return 1};const a=1===r?function(e,t){const n=o[0].field;return _(s(t,n),e,i[n]||1)}:function(e,t){var n=0;if(e.field){const o=s(t,e.field);!e.regex&&o?n+=1/r:n+=_(o,e,1)}else I(i,(o,i)=>{n+=_(s(t,i),e,o)});return n/r};return 1===n?function(e){return a(t[0],e)}:"and"===e.options.conjunction?function(e){var o,i=0;for(let n of t){if((o=a(n,e))<=0)return 0;i+=o}return i/n}:function(e){var o=0;return I(t,t=>{o+=a(t,e)}),o/n}}getSortFunction(e,t){var n=this.prepareSearch(e,t);return this._getSortFunction(n)}_getSortFunction(e){var t,n=[];const o=this,i=e.options,r=!e.query&&i.sort_empty?i.sort_empty:i.sort;if("function"==typeof r)return r.bind(this);const s=function(t,n){return"$score"===t?n.score:e.getAttrFn(o.items[n.id],t)};if(r)for(let t of r)(e.query||"$score"!==t.field)&&n.push(t);if(e.query){t=!0;for(let e of n)if("$score"===e.field){t=!1;break}t&&n.unshift({field:"$score",direction:"desc"})}else n=n.filter(e=>"$score"!==e.field);return n.length?function(e,t){var o,i;for(let r of n)if(i=r.field,o=("desc"===r.direction?-1:1)*P(s(i,e),s(i,t)))return o;return 0}:null}prepareSearch(e,t){const n={};var o=Object.assign({},t);if(L(o,"sort"),L(o,"sort_empty"),o.fields){L(o,"fields");const e=[];o.fields.forEach(t=>{"string"==typeof t&&(t={field:t,weight:1}),e.push(t),n[t.field]="weight"in t?t.weight:1}),o.fields=e}return{options:o,query:e.toLowerCase().trim(),tokens:this.tokenize(e,o.respect_word_boundaries,n),total:0,items:[],weights:n,getAttrFn:o.nesting?T:O}}search(e,t){var n,o,i=this;o=this.prepareSearch(e,t),t=o.options,e=o.query;const r=t.score||i._getScoreFunction(o);e.length?I(i.items,(e,i)=>{n=r(e),(!1===t.filter||n>0)&&o.items.push({score:n,id:i})}):I(i.items,(e,t)=>{o.items.push({score:1,id:t})});const s=i._getSortFunction(o);return s&&o.items.sort(s),o.total=o.items.length,"number"==typeof t.limit&&(o.items=o.items.slice(0,t.limit)),o}}const M=e=>null==e?null:B(e),B=e=>"boolean"==typeof e?e?"1":"0":e+"",N=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),$=(e,t)=>{var n;return function(o,i){var r=this;n&&(r.loading=Math.max(r.loading-1,0),clearTimeout(n)),n=setTimeout(function(){n=null,r.loadedSearches[o]=!0,e.call(r,o,i)},t)}},q=(e,t,n)=>{var o,i=e.trigger,r={};for(o of(e.trigger=function(){var n=arguments[0];if(-1===t.indexOf(n))return i.apply(e,arguments);r[n]=arguments},n.apply(e,[]),e.trigger=i,t))o in r&&i.apply(e,r[o])},F=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},j=(e,t,n,o)=>{e.addEventListener(t,n,o)},H=(e,t)=>!!t&&!!t[e]&&1==(t.altKey?1:0)+(t.ctrlKey?1:0)+(t.shiftKey?1:0)+(t.metaKey?1:0),V=(e,t)=>e.getAttribute("id")||(e.setAttribute("id",t),t),z=e=>e.replace(/[\\"']/g,"\\$&"),R=(e,t)=>{t&&e.append(t)},X=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)},Y=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(W(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},W=e=>"string"==typeof e&&e.indexOf("<")>-1,U=(e,t)=>{var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!1),e.dispatchEvent(n)},K=(e,t)=>{Object.assign(e.style,t)},G=(e,...t)=>{var n=Z(t);(e=Q(e)).map(e=>{n.map(t=>{e.classList.add(t)})})},J=(e,...t)=>{var n=Z(t);(e=Q(e)).map(e=>{n.map(t=>{e.classList.remove(t)})})},Z=e=>{var t=[];return X(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Q=e=>(Array.isArray(e)||(e=[e]),e),ee=(e,t,n)=>{if(!n||n.contains(e))for(;e&&e.matches;){if(e.matches(t))return e;e=e.parentNode}},te=(e,t=0)=>t>0?e[e.length-1]:e[0],ne=(e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var n=0;e=e.previousElementSibling;)e.matches(t)&&n++;return n},oe=(e,t)=>{X(t,(t,n)=>{null==t?e.removeAttribute(n):e.setAttribute(n,""+t)})},ie=(e,t)=>{e.parentNode&&e.parentNode.replaceChild(t,e)},re="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey",se={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,refreshThrottle:300,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(e){return e.length>0},render:{}};function ae(e,t){var n=Object.assign({},se,t),o=n.dataAttr,i=n.labelField,r=n.valueField,s=n.disabledField,a=n.optgroupField,l=n.optgroupLabelField,c=n.optgroupValueField,d=e.tagName.toLowerCase(),u=e.getAttribute("placeholder")||e.getAttribute("data-placeholder");if(!u&&!n.allowEmptyOption){let t=e.querySelector('option[value=""]');t&&(u=t.textContent)}var p={placeholder:u,options:[],optgroups:[],items:[],maxItems:null};return"select"===d?(()=>{var t,d=p.options,u={},h=1;let m=0;var g=e=>{var t=Object.assign({},e.dataset),n=o&&t[o];return"string"==typeof n&&n.length&&(t=Object.assign(t,JSON.parse(n))),t},f=(e,t)=>{var o=M(e.value);if(null!=o&&(o||n.allowEmptyOption)){if(u.hasOwnProperty(o)){if(t){var l=u[o][a];l?Array.isArray(l)?l.push(t):u[o][a]=[l,t]:u[o][a]=t}}else{var c=g(e);c[i]=c[i]||e.textContent,c[r]=c[r]||o,c[s]=c[s]||e.disabled,c[a]=c[a]||t,c.$option=e,c.$order=c.$order||++m,u[o]=c,d.push(c)}e.selected&&p.items.push(o)}};p.maxItems=e.hasAttribute("multiple")?null:1,X(e.children,e=>{var n,o,i;"optgroup"===(t=e.tagName.toLowerCase())?((i=g(n=e))[l]=i[l]||n.getAttribute("label")||"",i[c]=i[c]||h++,i[s]=i[s]||n.disabled,i.$order=i.$order||++m,p.optgroups.push(i),o=i[c],X(n.children,e=>{f(e,o)})):"option"===t&&f(e)})})():(()=>{const t=e.getAttribute(o);if(t)p.options=JSON.parse(t),X(p.options,e=>{p.items.push(e[r])});else{var s=e.value.trim()||"";if(!n.allowEmptyOption&&!s.length)return;const t=s.split(n.delimiter);X(t,e=>{const t={};t[i]=e,t[r]=e,p.options.push(t)}),p.items=t}})(),Object.assign({},se,p,t)}var le=0;class ce extends(function(e){return e.plugins={},class extends e{constructor(){super(...arguments),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(t,n){e.plugins[t]={name:t,fn:n}}initializePlugins(e){var t,n;const o=this,i=[];if(Array.isArray(e))e.forEach(e=>{"string"==typeof e?i.push(e):(o.plugins.settings[e.name]=e.options,i.push(e.name))});else if(e)for(t in e)e.hasOwnProperty(t)&&(o.plugins.settings[t]=e[t],i.push(t));for(;n=i.shift();)o.require(n)}loadPlugin(t){var n=this,o=n.plugins,i=e.plugins[t];if(!e.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin');o.requested[t]=!0,o.loaded[t]=i.fn.apply(n,[n.plugins.settings[t]||{}]),o.names.push(t)}require(e){var t=this,n=t.plugins;if(!t.plugins.loaded.hasOwnProperty(e)){if(n.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');t.loadPlugin(e)}return n.loaded[e]}}}(i)){constructor(e,t){var n;super(),this.order=0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],this.refreshTimeout=null,le++;var o=Y(e);if(o.tomselect)throw new Error("Tom Select already initialized on this element");o.tomselect=this,n=(window.getComputedStyle&&window.getComputedStyle(o,null)).getPropertyValue("direction");const i=ae(o,t);this.settings=i,this.input=o,this.tabIndex=o.tabIndex||0,this.is_select_tag="select"===o.tagName.toLowerCase(),this.rtl=/rtl/i.test(n),this.inputId=V(o,"tomselect-"+le),this.isRequired=o.required,this.sifter=new D(this.options,{diacritics:i.diacritics}),i.mode=i.mode||(1===i.maxItems?"single":"multi"),"boolean"!=typeof i.hideSelected&&(i.hideSelected="multi"===i.mode),"boolean"!=typeof i.hidePlaceholder&&(i.hidePlaceholder="multi"!==i.mode);var r=i.createFilter;"function"!=typeof r&&("string"==typeof r&&(r=new RegExp(r)),r instanceof RegExp?i.createFilter=e=>r.test(e):i.createFilter=e=>this.settings.duplicates||!this.options[e]),this.initializePlugins(i.plugins),this.setupCallbacks(),this.setupTemplates();const s=Y("<div>"),a=Y("<div>"),l=this._render("dropdown"),c=Y('<div role="listbox" tabindex="-1">'),d=this.input.getAttribute("class")||"",u=i.mode;var p;G(s,i.wrapperClass,d,u),G(a,i.controlClass),R(s,a),G(l,i.dropdownClass,u),i.copyClassesToDropdown&&G(l,d),G(c,i.dropdownContentClass),R(l,c),Y(i.dropdownParent||s).appendChild(l),W(i.controlInput)?(p=Y(i.controlInput),X(["autocorrect","autocapitalize","autocomplete","spellcheck"],e=>{o.getAttribute(e)&&oe(p,{[e]:o.getAttribute(e)})}),p.tabIndex=-1,a.appendChild(p),this.focus_node=p):i.controlInput?(p=Y(i.controlInput),this.focus_node=p):(p=Y("<input/>"),this.focus_node=a),this.wrapper=s,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=p,this.setup()}setup(){const e=this,t=e.settings,n=e.control_input,o=e.dropdown,i=e.dropdown_content,r=e.wrapper,s=e.control,a=e.input,l=e.focus_node,d={passive:!0},u=e.inputId+"-ts-dropdown";oe(i,{id:u}),oe(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":u});const p=V(l,e.inputId+"-ts-control"),h="label[for='"+(e=>e.replace(/['"\\]/g,"\\$&"))(e.inputId)+"']",m=document.querySelector(h),g=e.focus.bind(e);if(m){j(m,"click",g),oe(m,{for:p});const t=V(m,e.inputId+"-ts-label");oe(l,{"aria-labelledby":t}),oe(i,{"aria-labelledby":t})}if(r.style.width=a.style.width,e.plugins.names.length){const t="plugin-"+e.plugins.names.join(" plugin-");G([r,o],t)}(null===t.maxItems||t.maxItems>1)&&e.is_select_tag&&oe(a,{multiple:"multiple"}),t.placeholder&&oe(n,{placeholder:t.placeholder}),!t.splitOn&&t.delimiter&&(t.splitOn=new RegExp("\\s*"+c(t.delimiter)+"+\\s*")),t.load&&t.loadThrottle&&(t.load=$(t.load,t.loadThrottle)),j(o,"mousemove",()=>{e.ignoreHover=!1}),j(o,"mouseenter",t=>{var n=ee(t.target,"[data-selectable]",o);n&&e.onOptionHover(t,n)},{capture:!0}),j(o,"click",t=>{const n=ee(t.target,"[data-selectable]");n&&(e.onOptionSelect(t,n),F(t,!0))}),j(s,"click",t=>{var o=ee(t.target,"[data-ts-item]",s);o&&e.onItemSelect(t,o)?F(t,!0):""==n.value&&(e.onClick(),F(t,!0))}),j(l,"keydown",t=>e.onKeyDown(t)),j(n,"keypress",t=>e.onKeyPress(t)),j(n,"input",t=>e.onInput(t)),j(l,"blur",t=>e.onBlur(t)),j(l,"focus",t=>e.onFocus(t)),j(n,"paste",t=>e.onPaste(t));const f=t=>{const i=t.composedPath()[0];if(!r.contains(i)&&!o.contains(i))return e.isFocused&&e.blur(),void e.inputState();i==n&&e.isOpen?t.stopPropagation():F(t,!0)},w=()=>{e.isOpen&&e.positionDropdown()};j(document,"mousedown",f),j(window,"scroll",w,d),j(window,"resize",w,d),this._destroy=()=>{document.removeEventListener("mousedown",f),window.removeEventListener("scroll",w),window.removeEventListener("resize",w),m&&m.removeEventListener("click",g)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",e.wrapper),e.sync(!1),t.items=[],delete t.optgroups,delete t.options,j(a,"invalid",()=>{e.isValid&&(e.isValid=!1,e.isInvalid=!0,e.refreshState())}),e.updateOriginalInput(),e.refreshItems(),e.close(!1),e.inputState(),e.isSetup=!0,a.disabled?e.disable():a.readOnly?e.setReadOnly(!0):e.enable(),e.on("change",this.onChange),G(a,"tomselected","ts-hidden-accessible"),e.trigger("initialize"),!0===t.preload&&e.preload()}setupOptions(e=[],t=[]){this.addOptions(e),X(t,e=>{this.registerOptionGroup(e)})}setupTemplates(){var e=this,t=e.settings.labelField,n=e.settings.optgroupLabelField,o={optgroup:e=>{let t=document.createElement("div");return t.className="optgroup",t.appendChild(e.options),t},optgroup_header:(e,t)=>'<div class="optgroup-header">'+t(e[n])+"</div>",option:(e,n)=>"<div>"+n(e[t])+"</div>",item:(e,n)=>"<div>"+n(e[t])+"</div>",option_create:(e,t)=>'<div class="create">Add <strong>'+t(e.input)+"</strong>…</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};e.settings.render=Object.assign({},o,e.settings.render)}setupCallbacks(){var e,t,n={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in n)(t=this.settings[n[e]])&&this.on(e,t)}sync(e=!0){const t=this,n=e?ae(t.input,{delimiter:t.settings.delimiter}):t.settings;t.setupOptions(n.options,n.optgroups),t.setValue(n.items||[],!0),t.lastQuery=null}onClick(){var e=this;if(e.activeItems.length>0)return e.clearActiveItems(),void e.focus();e.isFocused&&e.isOpen?e.blur():e.focus()}onMouseDown(){}onChange(){U(this.input,"input"),U(this.input,"change")}onPaste(e){var t=this;t.isInputHidden||t.isLocked?F(e):t.settings.splitOn&&setTimeout(()=>{var e=t.inputValue();if(e.match(t.settings.splitOn)){var n=e.trim().split(t.settings.splitOn);X(n,e=>{M(e)&&(this.options[e]?t.addItem(e):t.createItem(e))})}},0)}onKeyPress(e){var t=this;if(!t.isLocked){var n=String.fromCharCode(e.keyCode||e.which);return t.settings.create&&"multi"===t.settings.mode&&n===t.settings.delimiter?(t.createItem(),void F(e)):void 0}F(e)}onKeyDown(e){var t=this;if(t.ignoreHover=!0,t.isLocked)9!==e.keyCode&&F(e);else{switch(e.keyCode){case 65:if(H(re,e)&&""==t.control_input.value)return F(e),void t.selectAll();break;case 27:return t.isOpen&&(F(e,!0),t.close()),void t.clearActiveItems();case 40:if(!t.isOpen&&t.hasOptions)t.open();else if(t.activeOption){let e=t.getAdjacent(t.activeOption,1);e&&t.setActiveOption(e)}return void F(e);case 38:if(t.activeOption){let e=t.getAdjacent(t.activeOption,-1);e&&t.setActiveOption(e)}return void F(e);case 13:return void(t.canSelect(t.activeOption)?(t.onOptionSelect(e,t.activeOption),F(e)):(t.settings.create&&t.createItem()||document.activeElement==t.control_input&&t.isOpen)&&F(e));case 37:return void t.advanceSelection(-1,e);case 39:return void t.advanceSelection(1,e);case 9:return void(t.settings.selectOnTab&&(t.canSelect(t.activeOption)&&(t.onOptionSelect(e,t.activeOption),F(e)),t.settings.create&&t.createItem()&&F(e)));case 8:case 46:return void t.deleteSelection(e)}t.isInputHidden&&!H(re,e)&&F(e)}}onInput(e){if(this.isLocked)return;const t=this.inputValue();var n,o;this.lastValue!==t&&(this.lastValue=t,""!=t?(this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=(n=()=>{this.refreshTimeout=null,this._onInput()},(o=this.settings.refreshThrottle)>0?window.setTimeout(n,o):(n.call(null),null))):this._onInput())}_onInput(){const e=this.lastValue;this.settings.shouldLoad.call(this,e)&&this.load(e),this.refreshOptions(),this.trigger("type",e)}onOptionHover(e,t){this.ignoreHover||this.setActiveOption(t,!1)}onFocus(e){var t=this,n=t.isFocused;if(t.isDisabled||t.isReadOnly)return t.blur(),void F(e);t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.preload(),n||t.trigger("focus"),t.activeItems.length||(t.inputState(),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState())}onBlur(e){if(!1!==document.hasFocus()){var t=this;if(t.isFocused){t.isFocused=!1,t.ignoreFocus=!1;var n=()=>{t.close(),t.setActiveItem(),t.setCaret(t.items.length),t.trigger("blur")};t.settings.create&&t.settings.createOnBlur?t.createItem(null,n):n()}}}onOptionSelect(e,t){var n,o=this;t.parentElement&&t.parentElement.matches("[data-disabled]")||(t.classList.contains("create")?o.createItem(null,()=>{o.settings.closeAfterSelect&&o.close()}):void 0!==(n=t.dataset.value)&&(o.lastQuery=null,o.addItem(n),o.settings.closeAfterSelect&&o.close(),!o.settings.hideSelected&&e.type&&/click/.test(e.type)&&o.setActiveOption(t)))}canSelect(e){return!!(this.isOpen&&e&&this.dropdown_content.contains(e))}onItemSelect(e,t){var n=this;return!n.isLocked&&"multi"===n.settings.mode&&(F(e),n.setActiveItem(t,e),!0)}canLoad(e){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(e)}load(e){const t=this;if(!t.canLoad(e))return;G(t.wrapper,t.settings.loadingClass),t.loading++;const n=t.loadCallback.bind(t);t.settings.load.call(t,e,n)}loadCallback(e,t){const n=this;n.loading=Math.max(n.loading-1,0),n.lastQuery=null,n.clearActiveOption(),n.setupOptions(e,t),n.refreshOptions(n.isFocused&&!n.isInputHidden),n.loading||J(n.wrapper,n.settings.loadingClass),n.trigger("load",e,t)}preload(){var e=this.wrapper.classList;e.contains("preloaded")||(e.add("preloaded"),this.load(""))}setTextboxValue(e=""){var t=this.control_input;t.value!==e&&(t.value=e,U(t,"update"),this.lastValue=e)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(e,t){q(this,t?[]:["change"],()=>{this.clear(t),this.addItems(e,t)})}setMaxItems(e){0===e&&(e=null),this.settings.maxItems=e,this.refreshState()}setActiveItem(e,t){var n,o,i,r,s,a,l=this;if("single"!==l.settings.mode){if(!e)return l.clearActiveItems(),void(l.isFocused&&l.inputState());if("click"===(n=t&&t.type.toLowerCase())&&H("shiftKey",t)&&l.activeItems.length){for(a=l.getLastActive(),(i=Array.prototype.indexOf.call(l.control.children,a))>(r=Array.prototype.indexOf.call(l.control.children,e))&&(s=i,i=r,r=s),o=i;o<=r;o++)e=l.control.children[o],-1===l.activeItems.indexOf(e)&&l.setActiveItemClass(e);F(t)}else"click"===n&&H(re,t)||"keydown"===n&&H("shiftKey",t)?e.classList.contains("active")?l.removeActiveItem(e):l.setActiveItemClass(e):(l.clearActiveItems(),l.setActiveItemClass(e));l.inputState(),l.isFocused||l.focus()}}setActiveItemClass(e){const t=this,n=t.control.querySelector(".last-active");n&&J(n,"last-active"),G(e,"active last-active"),t.trigger("item_select",e),-1==t.activeItems.indexOf(e)&&t.activeItems.push(e)}removeActiveItem(e){var t=this.activeItems.indexOf(e);this.activeItems.splice(t,1),J(e,"active")}clearActiveItems(){J(this.activeItems,"active"),this.activeItems=[]}setActiveOption(e,t=!0){e!==this.activeOption&&(this.clearActiveOption(),e&&(this.activeOption=e,oe(this.focus_node,{"aria-activedescendant":e.getAttribute("id")}),oe(e,{"aria-selected":"true"}),G(e,"active"),t&&this.scrollToOption(e)))}scrollToOption(e,t){if(!e)return;const n=this.dropdown_content,o=n.clientHeight,i=n.scrollTop||0,r=e.offsetHeight,s=e.getBoundingClientRect().top-n.getBoundingClientRect().top+i;s+r>o+i?this.scroll(s-o+r,t):s<i&&this.scroll(s,t)}scroll(e,t){const n=this.dropdown_content;t&&(n.style.scrollBehavior=t),n.scrollTop=e,n.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(J(this.activeOption,"active"),oe(this.activeOption,{"aria-selected":null})),this.activeOption=null,oe(this.focus_node,{"aria-activedescendant":null})}selectAll(){const e=this;if("single"===e.settings.mode)return;const t=e.controlChildren();t.length&&(e.inputState(),e.close(),e.activeItems=t,X(t,t=>{e.setActiveItemClass(t)}))}inputState(){var e=this;e.control.contains(e.control_input)&&(oe(e.control_input,{placeholder:e.settings.placeholder}),e.activeItems.length>0||!e.isFocused&&e.settings.hidePlaceholder&&e.items.length>0?(e.setTextboxValue(),e.isInputHidden=!0):(e.settings.hidePlaceholder&&e.items.length>0&&oe(e.control_input,{placeholder:""}),e.isInputHidden=!1),e.wrapper.classList.toggle("input-hidden",e.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var e=this;e.isDisabled||e.isReadOnly||(e.ignoreFocus=!0,e.control_input.offsetWidth?e.control_input.focus():e.focus_node.focus(),setTimeout(()=>{e.ignoreFocus=!1,e.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())}getSearchOptions(){var e=this.settings,t=e.sortField;return"string"==typeof e.sortField&&(t=[{field:e.sortField}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t,nesting:e.nesting}}search(e){var t,n,o=this,i=this.getSearchOptions();if(o.settings.score&&"function"!=typeof(n=o.settings.score.call(o,e)))throw new Error('Tom Select "score" setting must be a function that returns a function');return e!==o.lastQuery?(o.lastQuery=e,t=o.sifter.search(e,Object.assign(i,{score:n})),o.currentResults=t):t=Object.assign({},o.currentResults),o.settings.hideSelected&&(t.items=t.items.filter(e=>{let t=M(e.id);return!(t&&-1!==o.items.indexOf(t))})),t}refreshOptions(e=!0){var t,n,o,i,r,s,a,l,c,d;const u={},p=[];var h=this,m=h.inputValue();const g=m===h.lastQuery||""==m&&null==h.lastQuery;var f=h.search(m),w=null,v=h.settings.shouldOpen||!1,b=h.dropdown_content;g&&(w=h.activeOption)&&(c=w.closest("[data-group]")),i=f.items.length,"number"==typeof h.settings.maxOptions&&(i=Math.min(i,h.settings.maxOptions)),i>0&&(v=!0);const y=(e,t)=>{let n=u[e];if(void 0!==n){let e=p[n];if(void 0!==e)return[n,e.fragment]}let o=document.createDocumentFragment();return n=p.length,p.push({fragment:o,order:t,optgroup:e}),[n,o]};for(t=0;t<i;t++){let e=f.items[t];if(!e)continue;let i=e.id,a=h.options[i];if(void 0===a)continue;let l=B(i),d=h.getOption(l,!0);for(h.settings.hideSelected||d.classList.toggle("selected",h.items.includes(l)),r=a[h.settings.optgroupField]||"",n=0,o=(s=Array.isArray(r)?r:[r])&&s.length;n<o;n++){r=s[n];let e=a.$order,t=h.optgroups[r];void 0===t?r="":e=t.$order;const[o,l]=y(r,e);n>0&&(d=d.cloneNode(!0),oe(d,{id:a.$id+"-clone-"+n,"aria-selected":null}),d.classList.add("ts-cloned"),J(d,"active"),h.activeOption&&h.activeOption.dataset.value==i&&c&&c.dataset.group===r.toString()&&(w=d)),l.appendChild(d),""!=r&&(u[r]=o)}}var x;h.settings.lockOptgroupOrder&&p.sort((e,t)=>e.order-t.order),a=document.createDocumentFragment(),X(p,e=>{let t=e.fragment,n=e.optgroup;if(!t||!t.children.length)return;let o=h.optgroups[n];if(void 0!==o){let e=document.createDocumentFragment(),n=h.render("optgroup_header",o);R(e,n),R(e,t);let i=h.render("optgroup",{group:o,options:e});R(a,i)}else R(a,t)}),b.innerHTML="",R(b,a),h.settings.highlight&&(x=b.querySelectorAll("span.highlight"),Array.prototype.forEach.call(x,function(e){var t=e.parentNode;t.replaceChild(e.firstChild,e),t.normalize()}),f.query.length&&f.tokens.length&&X(f.tokens,e=>{((e,t)=>{if(null===t)return;if("string"==typeof t){if(!t.length)return;t=new RegExp(t,"i")}const n=e=>3===e.nodeType?(e=>{var n=e.data.match(t);if(n&&e.data.length>0){var o=document.createElement("span");o.className="highlight";var i=e.splitText(n.index);i.splitText(n[0].length);var r=i.cloneNode(!0);return o.appendChild(r),ie(i,o),1}return 0})(e):((e=>{1!==e.nodeType||!e.childNodes||/(script|style)/i.test(e.tagName)||"highlight"===e.className&&"SPAN"===e.tagName||Array.from(e.childNodes).forEach(e=>{n(e)})})(e),0);n(e)})(b,e.regex)}));var C=e=>{let t=h.render(e,{input:m});return t&&(v=!0,b.insertBefore(t,b.firstChild)),t};if(h.loading?C("loading"):h.settings.shouldLoad.call(h,m)?0===f.items.length&&C("no_results"):C("not_loading"),(l=h.canCreate(m))&&(d=C("option_create")),h.hasOptions=f.items.length>0||l,v){if(f.items.length>0){if(w||"single"!==h.settings.mode||null==h.items[0]||(w=h.getOption(h.items[0])),!b.contains(w)){let e=0;d&&!h.settings.addPrecedence&&(e=1),w=h.selectable()[e]}}else d&&(w=d);e&&!h.isOpen&&(h.open(),h.scrollToOption(w,"auto")),h.setActiveOption(w)}else h.clearActiveOption(),e&&h.isOpen&&h.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(e,t=!1){const n=this;if(Array.isArray(e))return n.addOptions(e,t),!1;const o=M(e[n.settings.valueField]);return null!==o&&!n.options.hasOwnProperty(o)&&(e.$order=e.$order||++n.order,e.$id=n.inputId+"-opt-"+e.$order,n.options[o]=e,n.lastQuery=null,t&&(n.userOptions[o]=t,n.trigger("option_add",o,e)),o)}addOptions(e,t=!1){X(e,e=>{this.addOption(e,t)})}registerOption(e){return this.addOption(e)}registerOptionGroup(e){var t=M(e[this.settings.optgroupValueField]);return null!==t&&(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)}addOptionGroup(e,t){var n;t[this.settings.optgroupValueField]=e,(n=this.registerOptionGroup(t))&&this.trigger("optgroup_add",n,t)}removeOptionGroup(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.clearCache(),this.trigger("optgroup_remove",e))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(e,t){const n=this;var o,i;const r=M(e),s=M(t[n.settings.valueField]);if(null===r)return;const a=n.options[r];if(null==a)return;if("string"!=typeof s)throw new Error("Value must be set in option data");const l=n.getOption(r),c=n.getItem(r);if(t.$order=t.$order||a.$order,delete n.options[r],n.uncacheValue(s),n.options[s]=t,l){if(n.dropdown_content.contains(l)){const e=n._render("option",t);ie(l,e),n.activeOption===l&&n.setActiveOption(e)}l.remove()}c&&(-1!==(i=n.items.indexOf(r))&&n.items.splice(i,1,s),o=n._render("item",t),c.classList.contains("active")&&G(o,"active"),ie(c,o)),n.lastQuery=null}removeOption(e,t){const n=this;e=B(e),n.uncacheValue(e),delete n.userOptions[e],delete n.options[e],n.lastQuery=null,n.trigger("option_remove",e),n.removeItem(e,t)}clearOptions(e){const t=(e||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const n={};X(this.options,(e,o)=>{t(e,o)&&(n[o]=e)}),this.options=this.sifter.items=n,this.lastQuery=null,this.trigger("option_clear")}clearFilter(e,t){return this.items.indexOf(t)>=0}getOption(e,t=!1){const n=M(e);if(null===n)return null;const o=this.options[n];if(null!=o){if(o.$div)return o.$div;if(t)return this._render("option",o)}return null}getAdjacent(e,t,n="option"){var o;if(!e)return null;o="item"==n?this.controlChildren():this.dropdown_content.querySelectorAll("[data-selectable]");for(let n=0;n<o.length;n++)if(o[n]==e)return t>0?o[n+1]:o[n-1];return null}getItem(e){if("object"==typeof e)return e;var t=M(e);return null!==t?this.control.querySelector(`[data-value="${z(t)}"]`):null}addItems(e,t){var n=this,o=Array.isArray(e)?e:[e];const i=(o=o.filter(e=>-1===n.items.indexOf(e)))[o.length-1];o.forEach(e=>{n.isPending=e!==i,n.addItem(e,t)})}addItem(e,t){q(this,t?[]:["change","dropdown_close"],()=>{var n,o;const i=this,r=i.settings.mode,s=M(e);if((!s||-1===i.items.indexOf(s)||("single"===r&&i.close(),"single"!==r&&i.settings.duplicates))&&null!==s&&i.options.hasOwnProperty(s)&&("single"===r&&i.clear(t),"multi"!==r||!i.isFull())){if(n=i._render("item",i.options[s]),i.control.contains(n)&&(n=n.cloneNode(!0)),o=i.isFull(),i.items.splice(i.caretPos,0,s),i.insertAtCaret(n),i.isSetup){if(!i.isPending&&i.settings.hideSelected){let e=i.getOption(s),t=i.getAdjacent(e,1);t&&i.setActiveOption(t)}i.isPending||i.settings.closeAfterSelect||i.refreshOptions(i.isFocused&&"single"!==r),0!=i.settings.closeAfterSelect&&i.isFull()?i.close():i.isPending||i.positionDropdown(),i.trigger("item_add",s,n),i.isPending||i.updateOriginalInput({silent:t})}(!i.isPending||!o&&i.isFull())&&(i.inputState(),i.refreshState())}})}removeItem(e=null,t){const n=this;if(!(e=n.getItem(e)))return;var o,i;const r=e.dataset.value;o=ne(e),e.remove(),e.classList.contains("active")&&(i=n.activeItems.indexOf(e),n.activeItems.splice(i,1),J(e,"active")),n.items.splice(o,1),n.lastQuery=null,!n.settings.persist&&n.userOptions.hasOwnProperty(r)&&n.removeOption(r,t),o<n.caretPos&&n.setCaret(n.caretPos-1),n.updateOriginalInput({silent:t}),n.refreshState(),n.positionDropdown(),n.trigger("item_remove",r,e)}createItem(e=null,t=()=>{}){3===arguments.length&&(t=arguments[2]),"function"!=typeof t&&(t=()=>{});var n,o=this,i=o.caretPos;if(e=e||o.inputValue(),!o.canCreate(e))return t(),!1;o.lock();var r=!1,s=e=>{if(o.unlock(),!e||"object"!=typeof e)return t();var n=M(e[o.settings.valueField]);if("string"!=typeof n)return t();o.setTextboxValue(),o.addOption(e,!0),o.setCaret(i),o.addItem(n),t(e),r=!0};return n="function"==typeof o.settings.create?o.settings.create.call(this,e,s):{[o.settings.labelField]:e,[o.settings.valueField]:e},r||s(n),!0}refreshItems(){var e=this;e.lastQuery=null,e.isSetup&&e.addItems(e.items),e.updateOriginalInput(),e.refreshState()}refreshState(){const e=this;e.refreshValidityState();const t=e.isFull(),n=e.isLocked;e.wrapper.classList.toggle("rtl",e.rtl);const o=e.wrapper.classList;var i;o.toggle("focus",e.isFocused),o.toggle("disabled",e.isDisabled),o.toggle("readonly",e.isReadOnly),o.toggle("required",e.isRequired),o.toggle("invalid",!e.isValid),o.toggle("locked",n),o.toggle("full",t),o.toggle("input-active",e.isFocused&&!e.isInputHidden),o.toggle("dropdown-active",e.isOpen),o.toggle("has-options",(i=e.options,0===Object.keys(i).length)),o.toggle("has-items",e.items.length>0)}refreshValidityState(){var e=this;e.input.validity&&(e.isValid=e.input.validity.valid,e.isInvalid=!e.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(e={}){const t=this;var n,o;const i=t.input.querySelector('option[value=""]');if(t.is_select_tag){const r=[],s=t.input.querySelectorAll("option:checked").length;function a(e,n,o){return e||(e=Y('<option value="'+N(n)+'">'+N(o)+"</option>")),e!=i&&t.input.append(e),r.push(e),(e!=i||s>0)&&(e.selected=!0),e}t.input.querySelectorAll("option:checked").forEach(e=>{e.selected=!1}),0==t.items.length&&"single"==t.settings.mode?a(i,"",""):t.items.forEach(e=>{n=t.options[e],o=n[t.settings.labelField]||"",r.includes(n.$option)?a(t.input.querySelector(`option[value="${z(e)}"]:not(:checked)`),e,o):n.$option=a(n.$option,e,o)})}else t.input.value=t.getValue();t.isSetup&&(e.silent||t.trigger("change",t.getValue()))}open(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.isOpen=!0,oe(e.focus_node,{"aria-expanded":"true"}),e.refreshState(),K(e.dropdown,{visibility:"hidden",display:"block"}),e.positionDropdown(),K(e.dropdown,{visibility:"visible",display:"block"}),e.focus(),e.trigger("dropdown_open",e.dropdown))}close(e=!0){var t=this,n=t.isOpen;e&&(t.setTextboxValue(),"single"===t.settings.mode&&t.items.length&&t.inputState()),t.isOpen=!1,oe(t.focus_node,{"aria-expanded":"false"}),K(t.dropdown,{display:"none"}),t.settings.hideSelected&&t.clearActiveOption(),t.refreshState(),n&&t.trigger("dropdown_close",t.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var e=this.control,t=e.getBoundingClientRect(),n=e.offsetHeight+t.top+window.scrollY,o=t.left+window.scrollX;K(this.dropdown,{width:t.width+"px",top:n+"px",left:o+"px"})}}clear(e){var t=this;if(t.items.length){var n=t.controlChildren();X(n,e=>{t.removeItem(e,!0)}),t.inputState(),e||t.updateOriginalInput(),t.trigger("clear")}}insertAtCaret(e){const t=this,n=t.caretPos,o=t.control;o.insertBefore(e,o.children[n]||null),t.setCaret(n+1)}deleteSelection(e){var t,n,o,i,r,s=this;t=e&&8===e.keyCode?-1:1,n={start:(r=s.control_input).selectionStart||0,length:(r.selectionEnd||0)-(r.selectionStart||0)};const a=[];if(s.activeItems.length)i=te(s.activeItems,t),o=ne(i),t>0&&o++,X(s.activeItems,e=>a.push(e));else if((s.isFocused||"single"===s.settings.mode)&&s.items.length){const e=s.controlChildren();let o;t<0&&0===n.start&&0===n.length?o=e[s.caretPos-1]:t>0&&n.start===s.inputValue().length&&(o=e[s.caretPos]),void 0!==o&&a.push(o)}if(!s.shouldDelete(a,e))return!1;for(F(e,!0),void 0!==o&&s.setCaret(o);a.length;)s.removeItem(a.pop());return s.inputState(),s.positionDropdown(),s.refreshOptions(!1),!0}shouldDelete(e,t){const n=e.map(e=>e.dataset.value);return!(!n.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(n,t))}advanceSelection(e,t){var n,o,i=this;i.rtl&&(e*=-1),i.inputValue().length||(H(re,t)||H("shiftKey",t)?(o=(n=i.getLastActive(e))?n.classList.contains("active")?i.getAdjacent(n,e,"item"):n:e>0?i.control_input.nextElementSibling:i.control_input.previousElementSibling)&&(o.classList.contains("active")&&i.removeActiveItem(n),i.setActiveItemClass(o)):i.moveCaret(e))}moveCaret(e){}getLastActive(e){let t=this.control.querySelector(".last-active");if(t)return t;var n=this.control.querySelectorAll(".active");return n?te(n,e):void 0}setCaret(e){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(e=this.isReadOnly||this.isDisabled){this.isLocked=e,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(e){this.focus_node.tabIndex=e?-1:this.tabIndex,this.isDisabled=e,this.input.disabled=e,this.control_input.disabled=e,this.setLocked()}setReadOnly(e){this.isReadOnly=e,this.input.readOnly=e,this.control_input.readOnly=e,this.setLocked()}destroy(){var e=this,t=e.revertSettings;e.trigger("destroy"),e.off(),e.wrapper.remove(),e.dropdown.remove(),e.input.innerHTML=t.innerHTML,e.input.tabIndex=t.tabIndex,J(e.input,"tomselected","ts-hidden-accessible"),e._destroy(),delete e.input.tomselect}render(e,t){var n,o;const i=this;if("function"!=typeof this.settings.render[e])return null;if(!(o=i.settings.render[e].call(this,t,N)))return null;if(o=Y(o),"option"===e||"option_create"===e?t[i.settings.disabledField]?oe(o,{"aria-disabled":"true"}):oe(o,{"data-selectable":""}):"optgroup"===e&&(n=t.group[i.settings.optgroupValueField],oe(o,{"data-group":n}),t.group[i.settings.disabledField]&&oe(o,{"data-disabled":""})),"option"===e||"item"===e){const n=B(t[i.settings.valueField]);oe(o,{"data-value":n}),"item"===e?(G(o,i.settings.itemClass),oe(o,{"data-ts-item":""})):(G(o,i.settings.optionClass),oe(o,{role:"option",id:t.$id}),t.$div=o,i.options[n]=t)}return o}_render(e,t){const n=this.render(e,t);if(null==n)throw"HTMLElement expected";return n}clearCache(){X(this.options,e=>{e.$div&&(e.$div.remove(),delete e.$div)})}uncacheValue(e){const t=this.getOption(e);t&&t.remove()}canCreate(e){return this.settings.create&&e.length>0&&this.settings.createFilter.call(this,e)}hook(e,t,n){var o=this,i=o[t];o[t]=function(){var t,r;return"after"===e&&(t=i.apply(o,arguments)),r=n.apply(o,arguments),"instead"===e?r:("before"===e&&(t=i.apply(o,arguments)),t)}}}const de=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},ue=(e,t,n,o)=>{e.addEventListener(t,n,o)},pe=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(he(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},he=e=>"string"==typeof e&&e.indexOf("<")>-1,me=(e,t,n,o)=>{e.addEventListener(t,n,o)},ge=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},fe=(e,t,n,o)=>{e.addEventListener(t,n,o)},we=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(ve(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},ve=e=>"string"==typeof e&&e.indexOf("<")>-1;ce.define("change_listener",function(){((e,t,n)=>{this.input.addEventListener("change",n,void 0)})(0,0,()=>{this.sync()})}),ce.define("checkbox_options",function(e){var t=this,n=t.onOptionSelect;t.settings.hideSelected=!1;const o=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},e);var i=function(e,t){t?(e.checked=!0,o.uncheckedClassNames&&e.classList.remove(...o.uncheckedClassNames),o.checkedClassNames&&e.classList.add(...o.checkedClassNames)):(e.checked=!1,o.checkedClassNames&&e.classList.remove(...o.checkedClassNames),o.uncheckedClassNames&&e.classList.add(...o.uncheckedClassNames))},r=function(e){setTimeout(()=>{var t=e.querySelector("input."+o.className);t instanceof HTMLInputElement&&i(t,e.classList.contains("selected"))},1)};t.hook("after","setupTemplates",()=>{var e=t.settings.render.option;t.settings.render.option=(n,r)=>{var s=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if("string"==typeof(n=e)&&n.indexOf("<")>-1){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}var n;return document.querySelector(e)})(e.call(t,n,r)),a=document.createElement("input");o.className&&a.classList.add(o.className),a.addEventListener("click",function(e){de(e)}),a.type="checkbox";const l=null==(c=n[t.settings.valueField])?null:(e=>"boolean"==typeof e?e?"1":"0":e+"")(c);var c;return i(a,!!(l&&t.items.indexOf(l)>-1)),s.prepend(a),s}}),t.on("item_remove",e=>{var n=t.getOption(e);n&&(n.classList.remove("selected"),r(n))}),t.on("item_add",e=>{var n=t.getOption(e);n&&r(n)}),t.hook("instead","onOptionSelect",(e,o)=>{if(o.classList.contains("selected"))return o.classList.remove("selected"),t.removeItem(o.dataset.value),t.refreshOptions(),void de(e,!0);n.call(t,e,o),r(o)})}),ce.define("clear_button",function(e){const t=this,n=Object.assign({className:"clear-button",title:"Clear All",html:e=>`<div class="${e.className}" title="${e.title}">⨯</div>`},e);t.on("initialize",()=>{var e=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if("string"==typeof(n=e)&&n.indexOf("<")>-1){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}var n;return document.querySelector(e)})(n.html(n));e.addEventListener("click",e=>{t.isLocked||(t.clear(),"single"===t.settings.mode&&t.settings.allowEmptyOption&&t.addItem(""),e.preventDefault(),e.stopPropagation())}),t.control.appendChild(e)})}),ce.define("drag_drop",function(){var e=this;if("multi"!==e.settings.mode)return;var t=e.lock,n=e.unlock;let o,i=!0;e.hook("after","setupTemplates",()=>{var t=e.settings.render.item;e.settings.render.item=(n,r)=>{const s=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if("string"==typeof(n=e)&&n.indexOf("<")>-1){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}var n;return document.querySelector(e)})(t.call(e,n,r));var a;a=s,((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)})({draggable:"true"},(e,t)=>{null==e?a.removeAttribute(t):a.setAttribute(t,""+e)});const l=e=>{e.preventDefault(),s.classList.add("ts-drag-over"),c(s,o)},c=(e,t)=>{var n,o,i;void 0!==t&&(((e,t)=>{do{var n;if(e==(t=null==(n=t)?void 0:n.previousElementSibling))return!0}while(t&&t.previousElementSibling);return!1})(t,s)?(o=t,null==(i=(n=e).parentNode)||i.insertBefore(o,n.nextSibling)):((e,t)=>{var n;null==(n=e.parentNode)||n.insertBefore(t,e)})(e,t))};return ue(s,"mousedown",e=>{i||((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(e),e.stopPropagation()}),ue(s,"dragstart",e=>{o=s,setTimeout(()=>{s.classList.add("ts-dragging")},0)}),ue(s,"dragenter",l),ue(s,"dragover",l),ue(s,"dragleave",()=>{s.classList.remove("ts-drag-over")}),ue(s,"dragend",()=>{var t;document.querySelectorAll(".ts-drag-over").forEach(e=>e.classList.remove("ts-drag-over")),null==(t=o)||t.classList.remove("ts-dragging"),o=void 0;var n=[];e.control.querySelectorAll("[data-value]").forEach(e=>{if(e.dataset.value){let t=e.dataset.value;t&&n.push(t)}}),e.setValue(n)}),s}}),e.hook("instead","lock",()=>(i=!1,t.call(e))),e.hook("instead","unlock",()=>(i=!0,n.call(e)))}),ce.define("dropdown_header",function(e){const t=this,n=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:e=>'<div class="'+e.headerClass+'"><div class="'+e.titleRowClass+'"><span class="'+e.labelClass+'">'+e.title+'</span><a class="'+e.closeClass+'">×</a></div></div>'},e);t.on("initialize",()=>{var e=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if("string"==typeof(n=e)&&n.indexOf("<")>-1){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}var n;return document.querySelector(e)})(n.html(n)),o=e.querySelector("."+n.closeClass);o&&o.addEventListener("click",e=>{((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(e,!0),t.close()}),t.dropdown.insertBefore(e,t.dropdown.firstChild)})}),ce.define("caret_position",function(){var e=this;e.hook("instead","setCaret",t=>{"single"!==e.settings.mode&&e.control.contains(e.control_input)?(t=Math.max(0,Math.min(e.items.length,t)))==e.caretPos||e.isPending||e.controlChildren().forEach((n,o)=>{o<t?e.control_input.insertAdjacentElement("beforebegin",n):e.control.appendChild(n)}):t=e.items.length,e.caretPos=t}),e.hook("instead","moveCaret",t=>{if(!e.isFocused)return;const n=e.getLastActive(t);if(n){const a=((e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var n=0;e=e.previousElementSibling;)e.matches(t)&&n++;return n})(n);e.setCaret(t>0?a+1:a),e.setActiveItem(),i=n,o=[],((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var n in e)e.hasOwnProperty(n)&&t(e[n])})(["last-active"],e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(o=o.concat(e))}),s=o.filter(Boolean),(r=i,Array.isArray(r)||(r=[r]),i=r).map(e=>{s.map(t=>{e.classList.remove(t)})})}else e.setCaret(e.caretPos+t);var o,i,r,s})}),ce.define("dropdown_input",function(){const e=this;e.settings.shouldOpen=!0,e.hook("before","setup",()=>{e.focus_node=e.control,((e,...t)=>{var n,o=(e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var n in e)e.hasOwnProperty(n)&&t(e[n])})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)})(t);(n=e,Array.isArray(n)||(n=[n]),e=n).map(e=>{o.map(t=>{e.classList.add(t)})})})(e.control_input,"dropdown-input");const t=pe('<div class="dropdown-input-wrap">');t.append(e.control_input),e.dropdown.insertBefore(t,e.dropdown.firstChild);const n=pe('<input class="items-placeholder" tabindex="-1" />');n.placeholder=e.settings.placeholder||"",e.control.append(n)}),e.on("initialize",()=>{e.control_input.addEventListener("keydown",t=>{switch(t.keyCode){case 27:return e.isOpen&&(((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(t,!0),e.close()),void e.clearActiveItems();case 9:e.focus_node.tabIndex=-1}return e.onKeyDown.call(e,t)}),e.on("blur",()=>{e.focus_node.tabIndex=e.isDisabled?-1:e.tabIndex}),e.on("dropdown_open",()=>{e.control_input.focus()});const t=e.onBlur;e.hook("instead","onBlur",n=>{if(!n||n.relatedTarget!=e.control_input)return t.call(e)}),e.control_input.addEventListener("blur",()=>e.onBlur(),void 0),e.hook("before","close",()=>{e.isOpen&&e.focus_node.focus({preventScroll:!0})})})}),ce.define("input_autogrow",function(){var e=this;e.on("initialize",()=>{var t=document.createElement("span"),n=e.control_input;t.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",e.wrapper.appendChild(t);for(const e of["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"])t.style[e]=n.style[e];var o=()=>{t.textContent=n.value,n.style.width=t.clientWidth+"px"};o(),e.on("update item_add item_remove",o),me(n,"input",o),me(n,"keyup",o),me(n,"blur",o),me(n,"update",o)})}),ce.define("no_backspace_delete",function(){var e=this,t=e.deleteSelection;this.hook("instead","deleteSelection",n=>!!e.activeItems.length&&t.call(e,n))}),ce.define("no_active_items",function(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}),ce.define("optgroup_columns",function(){var e=this,t=e.onKeyDown;e.hook("instead","onKeyDown",n=>{var o,i,r,s;if(!e.isOpen||37!==n.keyCode&&39!==n.keyCode)return t.call(e,n);e.ignoreHover=!0,s=(e=>{for(;e&&e.matches;){if(e.matches("[data-group]"))return e;e=e.parentNode}})(e.activeOption),o=((e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var n=0;e=e.previousElementSibling;)e.matches(t)&&n++;return n})(e.activeOption,"[data-selectable]"),s&&(s=37===n.keyCode?s.previousSibling:s.nextSibling)&&(i=(r=s.querySelectorAll("[data-selectable]"))[Math.min(r.length-1,o)])&&e.setActiveOption(i)})}),ce.define("remove_button",function(e){const t=Object.assign({label:"×",title:"Remove",className:"remove",append:!0},e);var n=this;if(t.append){var o='<a href="javascript:void(0)" class="'+t.className+'" tabindex="-1" title="'+(t.title+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")+'">'+t.label+"</a>";n.hook("after","setupTemplates",()=>{var e=n.settings.render.item;n.settings.render.item=(t,i)=>{var r=we(e.call(n,t,i)),s=we(o);return r.appendChild(s),fe(s,"mousedown",e=>{ge(e,!0)}),fe(s,"click",e=>{n.isLocked||(ge(e,!0),n.isLocked||n.shouldDelete([r],e)&&(n.removeItem(r),n.refreshOptions(!1),n.inputState()))}),r}})}}),ce.define("restore_on_backspace",function(e){const t=this,n=Object.assign({text:e=>e[t.settings.labelField]},e);t.on("item_remove",function(e){if(t.isFocused&&""===t.control_input.value.trim()){var o=t.options[e];o&&t.setTextboxValue(n.text.call(t,o))}})}),ce.define("virtual_scroll",function(){const e=this,t=e.canLoad,n=e.clearActiveOption,o=e.loadCallback;var i,r,s={},a=!1,l=[];if(e.settings.shouldLoadMore||(e.settings.shouldLoadMore=()=>{if(i.clientHeight/(i.scrollHeight-i.scrollTop)>.9)return!0;if(e.activeOption){var t=e.selectable();if(Array.from(t).indexOf(e.activeOption)>=t.length-2)return!0}return!1}),!e.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";e.settings.sortField=[{field:"$order"},{field:"$score"}];const c=t=>!("number"==typeof e.settings.maxOptions&&i.children.length>=e.settings.maxOptions||!(t in s)||!s[t]),d=(t,n)=>e.items.indexOf(n)>=0||l.indexOf(n)>=0;e.setNextUrl=(e,t)=>{s[e]=t},e.getUrl=t=>{if(t in s){const e=s[t];return s[t]=!1,e}return e.clearPagination(),e.settings.firstUrl.call(e,t)},e.clearPagination=()=>{s={}},e.hook("instead","clearActiveOption",()=>{if(!a)return n.call(e)}),e.hook("instead","canLoad",n=>n in s?c(n):t.call(e,n)),e.hook("instead","loadCallback",(t,n)=>{if(a){if(r){const n=t[0];void 0!==n&&(r.dataset.value=n[e.settings.valueField])}}else e.clearOptions(d);o.call(e,t,n),a=!1}),e.hook("after","refreshOptions",()=>{const t=e.lastValue;var n;c(t)?(n=e.render("loading_more",{query:t}))&&(n.setAttribute("data-selectable",""),r=n):t in s&&!i.querySelector(".no-results")&&(n=e.render("no_more_results",{query:t})),n&&(((e,...t)=>{var n,o=(e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var n in e)e.hasOwnProperty(n)&&t(e[n])})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)})(t);(n=e,Array.isArray(n)||(n=[n]),e=n).map(e=>{o.map(t=>{e.classList.add(t)})})})(n,e.settings.optionClass),i.append(n))}),e.on("initialize",()=>{l=Object.keys(e.options),i=e.dropdown_content,e.settings.render=Object.assign({},{loading_more:()=>'<div class="loading-more-results">Loading more results ... </div>',no_more_results:()=>'<div class="no-more-results">No more results</div>'},e.settings.render),i.addEventListener("scroll",()=>{e.settings.shouldLoadMore.call(e)&&c(e.lastValue)&&(a||(a=!0,e.load.call(e,e.lastValue)))})})});const be=ce,ye={hidden:"lp-hidden",loading:"loading"},xe=(e,t={},n={})=>{"function"==typeof n.before&&n.before(),fetch(e,{method:"GET",...t}).then(e=>e.json()).then(e=>{"function"==typeof n.success&&n.success(e)}).catch(e=>{"function"==typeof n.error&&n.error(e)}).finally(()=>{"function"==typeof n.completed&&n.completed()})},Ce=()=>{let e=window.location.href;return e.includes("?")&&(e=e.split("?")[0]),e},ke=(e,t)=>{const n=new URL(e);return Object.keys(t).forEach(e=>{n.searchParams.set(e,t[e])}),n},Ee=(e,t)=>{new IntersectionObserver(function(e){for(const n of e)n.isIntersecting&&t(n)}).observe(e)},Se=e=>{new MutationObserver(function(t){t.forEach(function(t){t.addedNodes&&t.addedNodes.forEach(function(t){1===t.nodeType&&e(t)})})}).observe(document,{childList:!0,subtree:!0})},Ae=(e,t)=>{const n=document.querySelector(e);if(n)return void t(n);const o=new MutationObserver((n,o)=>{const i=document.querySelector(e);i&&(o.disconnect(),t(i))});o.observe(document.documentElement,{childList:!0,subtree:!0})},Oe=e=>{if("string"!=typeof e)return e;const t=String.raw({raw:e}).match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/s);try{e=t?JSON.parse(t[1].replace(/(?:\r\n|\r|\n)/g,"")):JSON.parse(e)}catch(t){e={}}return e},Te=(e,t=0)=>{e&&(t?e.classList.remove(ye.hidden):e.classList.add(ye.hidden))},_e=(e,t)=>{e&&(t?e.classList.add(ye.loading):e.classList.remove(ye.loading))};var Le=n(7736),Ie=n.n(Le),Pe=n(5072),De=n.n(Pe),Me=n(7825),Be=n.n(Me),Ne=n(7659),$e=n.n(Ne),qe=n(5056),Fe=n.n(qe),je=n(540),He=n.n(je),Ve=n(1113),ze=n.n(Ve),Re=n(9455),Xe={};let Ye,We,Ue,Ke,Ge,Je;Xe.styleTagTransform=ze(),Xe.setAttributes=Fe(),Xe.insert=$e().bind(null,"head"),Xe.domAPI=Be(),Xe.insertStyleElement=He(),De()(Re.A,Xe),Re.A&&Re.A.locals&&Re.A.locals;const Ze={idElEditCurriculum:"#lp-course-edit-curriculum",elCurriculumSections:".curriculum-sections",elSection:".section",elToggleAllSections:".course-toggle-all-sections",elSectionItem:".section-item",LPTarget:".lp-target",elCollapse:"lp-collapse"},Qe={text:"",gravity:lpDataAdmin.toast.gravity,position:lpDataAdmin.toast.position,className:`${lpDataAdmin.toast.classPrefix}`,close:1==lpDataAdmin.toast.close,stopOnFocus:1==lpDataAdmin.toast.stopOnFocus,duration:lpDataAdmin.toast.duration},et=(e,t="success")=>{new(Ie())({...Qe,text:e,className:`${lpDataAdmin.toast.classPrefix} ${t}`}).showToast()},tt=e=>{({courseId:Ye,elEditCurriculum:We,elCurriculumSections:Ue,updateCountItems:Ke,hasChange:Je}=e)};function nt(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function ot(e,t){return e.get(nt(e,t))}const it={},rt="swal2-",st=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"].reduce((e,t)=>(e[t]=rt+t,e),{}),at=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=rt+t,e),{}),lt="SweetAlert2:",ct=e=>e.charAt(0).toUpperCase()+e.slice(1),dt=e=>{console.warn(`${lt} ${"object"==typeof e?e.join(" "):e}`)},ut=e=>{console.error(`${lt} ${e}`)},pt=[],ht=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var n;n=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,pt.includes(n)||(pt.push(n),dt(n))},mt=e=>"function"==typeof e?e():e,gt=e=>e&&"function"==typeof e.toPromise,ft=e=>gt(e)?e.toPromise():Promise.resolve(e),wt=e=>e&&Promise.resolve(e)===e,vt=()=>document.body.querySelector(`.${st.container}`),bt=e=>{const t=vt();return t?t.querySelector(e):null},yt=e=>bt(`.${e}`),xt=()=>yt(st.popup),Ct=()=>yt(st.icon),kt=()=>yt(st.title),Et=()=>yt(st["html-container"]),St=()=>yt(st.image),At=()=>yt(st["progress-steps"]),Ot=()=>yt(st["validation-message"]),Tt=()=>bt(`.${st.actions} .${st.confirm}`),_t=()=>bt(`.${st.actions} .${st.cancel}`),Lt=()=>bt(`.${st.actions} .${st.deny}`),It=()=>bt(`.${st.loader}`),Pt=()=>yt(st.actions),Dt=()=>yt(st.footer),Mt=()=>yt(st["timer-progress-bar"]),Bt=()=>yt(st.close),Nt=()=>{const e=xt();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(t).sort((e,t)=>{const n=parseInt(e.getAttribute("tabindex")||"0"),o=parseInt(t.getAttribute("tabindex")||"0");return n>o?1:n<o?-1:0}),o=e.querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n'),i=Array.from(o).filter(e=>"-1"!==e.getAttribute("tabindex"));return[...new Set(n.concat(i))].filter(e=>en(e))},$t=()=>jt(document.body,st.shown)&&!jt(document.body,st["toast-shown"])&&!jt(document.body,st["no-backdrop"]),qt=()=>{const e=xt();return!!e&&jt(e,st.toast)},Ft=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html"),o=n.querySelector("head");o&&Array.from(o.childNodes).forEach(t=>{e.appendChild(t)});const i=n.querySelector("body");i&&Array.from(i.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},jt=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t<n.length;t++)if(!e.classList.contains(n[t]))return!1;return!0},Ht=(e,t,n)=>{if(((e,t)=>{Array.from(e.classList).forEach(n=>{Object.values(st).includes(n)||Object.values(at).includes(n)||Object.values(t.showClass||{}).includes(n)||e.classList.remove(n)})})(e,t),!t.customClass)return;const o=t.customClass[n];o&&("string"==typeof o||o.forEach?Xt(e,o):dt(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof o}"`))},Vt=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${st.popup} > .${st[t]}`);case"checkbox":return e.querySelector(`.${st.popup} > .${st.checkbox} input`);case"radio":return e.querySelector(`.${st.popup} > .${st.radio} input:checked`)||e.querySelector(`.${st.popup} > .${st.radio} input:first-child`);case"range":return e.querySelector(`.${st.popup} > .${st.range} input`);default:return e.querySelector(`.${st.popup} > .${st.input}`)}},zt=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},Rt=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(t=>{Array.isArray(e)?e.forEach(e=>{n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)}))},Xt=(e,t)=>{Rt(e,t,!0)},Yt=(e,t)=>{Rt(e,t,!1)},Wt=(e,t)=>{const n=Array.from(e.children);for(let e=0;e<n.length;e++){const o=n[e];if(o instanceof HTMLElement&&jt(o,t))return o}},Ut=(e,t,n)=>{n===`${parseInt(n)}`&&(n=parseInt(n)),n||0===parseInt(n)?e.style.setProperty(t,"number"==typeof n?`${n}px`:n):e.style.removeProperty(t)},Kt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},Gt=e=>{e&&(e.style.display="none")},Jt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver(()=>{Qt(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},Zt=(e,t,n,o)=>{const i=e.querySelector(t);i&&i.style.setProperty(n,o)},Qt=function(e,t){t?Kt(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):Gt(e)},en=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),tn=e=>!!(e.scrollHeight>e.clientHeight),nn=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),o=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||o>0},on=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Mt();n&&en(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width="0%"},10))},rn=`\n <div aria-labelledby="${st.title}" aria-describedby="${st["html-container"]}" class="${st.popup}" tabindex="-1">\n <button type="button" class="${st.close}"></button>\n <ul class="${st["progress-steps"]}"></ul>\n <div class="${st.icon}"></div>\n <img class="${st.image}" />\n <h2 class="${st.title}" id="${st.title}"></h2>\n <div class="${st["html-container"]}" id="${st["html-container"]}"></div>\n <input class="${st.input}" id="${st.input}" />\n <input type="file" class="${st.file}" />\n <div class="${st.range}">\n <input type="range" />\n <output></output>\n </div>\n <select class="${st.select}" id="${st.select}"></select>\n <div class="${st.radio}"></div>\n <label class="${st.checkbox}">\n <input type="checkbox" id="${st.checkbox}" />\n <span class="${st.label}"></span>\n </label>\n <textarea class="${st.textarea}" id="${st.textarea}"></textarea>\n <div class="${st["validation-message"]}" id="${st["validation-message"]}"></div>\n <div class="${st.actions}">\n <div class="${st.loader}"></div>\n <button type="button" class="${st.confirm}"></button>\n <button type="button" class="${st.deny}"></button>\n <button type="button" class="${st.cancel}"></button>\n </div>\n <div class="${st.footer}"></div>\n <div class="${st["timer-progress-bar-container"]}">\n <div class="${st["timer-progress-bar"]}"></div>\n </div>\n </div>\n`.replace(/(^|\n)\s*/g,""),sn=()=>{it.currentInstance.resetValidationMessage()},an=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?ln(e,t):e&&Ft(t,e)},ln=(e,t)=>{e.jquery?cn(t,e):Ft(t,e.toString())},cn=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))};function dn(e,t,n){const o=ct(t);Qt(e,n[`show${o}Button`],"inline-block"),Ft(e,n[`${t}ButtonText`]||""),e.setAttribute("aria-label",n[`${t}ButtonAriaLabel`]||""),e.className=st[t],Ht(e,n,`${t}Button`)}var un={innerParams:new WeakMap,domCache:new WeakMap};const pn=["input","file","range","select","radio","checkbox","textarea"],hn=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},mn=(e,t,n)=>{if(n.inputLabel){const o=document.createElement("label"),i=st["input-label"];o.setAttribute("for",e.id),o.className=i,"object"==typeof n.customClass&&Xt(o,n.customClass.inputLabel),o.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",o)}},gn=e=>{const t=xt();if(t)return Wt(t,st[e]||st.input)},fn=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:wt(t)||dt(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},wn={};wn.text=wn.email=wn.password=wn.number=wn.tel=wn.url=wn.search=wn.date=wn["datetime-local"]=wn.time=wn.week=wn.month=(e,t)=>(fn(e,t.inputValue),mn(e,e,t),hn(e,t),e.type=t.input,e),wn.file=(e,t)=>(mn(e,e,t),hn(e,t),e),wn.range=(e,t)=>{const n=e.querySelector("input"),o=e.querySelector("output");return fn(n,t.inputValue),n.type=t.input,fn(o,t.inputValue),mn(n,e,t),e},wn.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");Ft(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return mn(e,e,t),e},wn.radio=e=>(e.textContent="",e),wn.checkbox=(e,t)=>{const n=Vt(xt(),"checkbox");n.value="1",n.checked=Boolean(t.inputValue);const o=e.querySelector("span");return Ft(o,t.inputPlaceholder||t.inputLabel),n},wn.textarea=(e,t)=>(fn(e,t.inputValue),hn(e,t),mn(e,e,t),setTimeout(()=>{if("MutationObserver"in window){const n=parseInt(window.getComputedStyle(xt()).width);new MutationObserver(()=>{if(!document.body.contains(e))return;const o=e.offsetWidth+(i=e,parseInt(window.getComputedStyle(i).marginLeft)+parseInt(window.getComputedStyle(i).marginRight));var i;o>n?xt().style.width=`${o}px`:Ut(xt(),"width",t.width)}).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e);const vn=(e,t)=>{const n=Et();n&&(Jt(n),Ht(n,t,"htmlContainer"),t.html?(an(t.html,n),Kt(n,"block")):t.text?(n.textContent=t.text,Kt(n,"block")):Gt(n),((e,t)=>{const n=xt();if(!n)return;const o=un.innerParams.get(e),i=!o||t.input!==o.input;pn.forEach(e=>{const o=Wt(n,st[e]);o&&(((e,t)=>{const n=xt();if(!n)return;const o=Vt(n,e);if(o){(e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["id","type","value","style"].includes(n)||e.removeAttribute(n)}})(o);for(const e in t)o.setAttribute(e,t[e])}})(e,t.inputAttributes),o.className=st[e],i&&Gt(o))}),t.input&&(i&&(e=>{if(!e.input)return;if(!wn[e.input])return void ut(`Unexpected type of input! Expected ${Object.keys(wn).join(" | ")}, got "${e.input}"`);const t=gn(e.input);if(!t)return;const n=wn[e.input](t,e);Kt(t),e.inputAutoFocus&&setTimeout(()=>{zt(n)})})(t),(e=>{if(!e.input)return;const t=gn(e.input);t&&Ht(t,e,"input")})(t))})(e,t))},bn=(e,t)=>{for(const[n,o]of Object.entries(at))t.icon!==n&&Yt(e,o);Xt(e,t.icon&&at[t.icon]),Cn(e,t),yn(),Ht(e,t,"icon")},yn=()=>{const e=xt();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},xn=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,o="";t.iconHtml?o=kn(t.iconHtml):"success"===t.icon?(o='\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n',n=n.replace(/ style=".*?"/g,"")):"error"===t.icon?o='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n':t.icon&&(o=kn({question:"?",warning:"!",info:"i"}[t.icon])),n.trim()!==o.trim()&&Ft(e,o)},Cn=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])Zt(e,n,"background-color",t.iconColor);Zt(e,".swal2-success-ring","border-color",t.iconColor)}},kn=e=>`<div class="${st["icon-content"]}">${e}</div>`;let En=!1,Sn=0,An=0,On=0,Tn=0;const Ln=e=>{const t=xt();if(e.target===t||Ct().contains(e.target)){En=!0;const n=Dn(e);Sn=n.clientX,An=n.clientY,On=parseInt(t.style.insetInlineStart)||0,Tn=parseInt(t.style.insetBlockStart)||0,Xt(t,"swal2-dragging")}},In=e=>{const t=xt();if(En){let{clientX:n,clientY:o}=Dn(e);t.style.insetInlineStart=`${On+(n-Sn)}px`,t.style.insetBlockStart=`${Tn+(o-An)}px`}},Pn=()=>{const e=xt();En=!1,Yt(e,"swal2-dragging")},Dn=e=>{let t=0,n=0;return e.type.startsWith("mouse")?(t=e.clientX,n=e.clientY):e.type.startsWith("touch")&&(t=e.touches[0].clientX,n=e.touches[0].clientY),{clientX:t,clientY:n}},Mn=(e,t)=>{const n=t.showClass||{};e.className=`${st.popup} ${en(e)?n.popup:""}`,t.toast?(Xt([document.documentElement,document.body],st["toast-shown"]),Xt(e,st.toast)):Xt(e,st.modal),Ht(e,t,"popup"),"string"==typeof t.customClass&&Xt(e,t.customClass),t.icon&&Xt(e,st[`icon-${t.icon}`])},Bn=(e,t)=>{((e,t)=>{const n=vt(),o=xt();if(n&&o){if(t.toast){Ut(n,"width",t.width),o.style.width="100%";const e=It();e&&o.insertBefore(e,Ct())}else Ut(o,"width",t.width);Ut(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),Gt(Ot()),Mn(o,t),t.draggable&&!t.toast?(Xt(o,st.draggable),(e=>{e.addEventListener("mousedown",Ln),document.body.addEventListener("mousemove",In),e.addEventListener("mouseup",Pn),e.addEventListener("touchstart",Ln),document.body.addEventListener("touchmove",In),e.addEventListener("touchend",Pn)})(o)):(Yt(o,st.draggable),(e=>{e.removeEventListener("mousedown",Ln),document.body.removeEventListener("mousemove",In),e.removeEventListener("mouseup",Pn),e.removeEventListener("touchstart",Ln),document.body.removeEventListener("touchmove",In),e.removeEventListener("touchend",Pn)})(o))}})(0,t),((e,t)=>{const n=vt();n&&(function(e,t){"string"==typeof t?e.style.background=t:t||Xt([document.documentElement,document.body],st["no-backdrop"])}(n,t.backdrop),function(e,t){t&&(t in st?Xt(e,st[t]):(dt('The "position" parameter is not valid, defaulting to "center"'),Xt(e,st.center)))}(n,t.position),function(e,t){t&&Xt(e,st[`grow-${t}`])}(n,t.grow),Ht(n,t,"container"))})(0,t),((e,t)=>{const n=At();if(!n)return;const{progressSteps:o,currentProgressStep:i}=t;o&&0!==o.length&&void 0!==i?(Kt(n),n.textContent="",i>=o.length&&dt("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.forEach((e,r)=>{const s=(e=>{const t=document.createElement("li");return Xt(t,st["progress-step"]),Ft(t,e),t})(e);if(n.appendChild(s),r===i&&Xt(s,st["active-progress-step"]),r!==o.length-1){const e=(e=>{const t=document.createElement("li");return Xt(t,st["progress-step-line"]),e.progressStepsDistance&&Ut(t,"width",e.progressStepsDistance),t})(t);n.appendChild(e)}})):Gt(n)})(0,t),((e,t)=>{const n=un.innerParams.get(e),o=Ct();if(o){if(n&&t.icon===n.icon)return xn(o,t),void bn(o,t);if(t.icon||t.iconHtml)return t.icon&&-1===Object.keys(at).indexOf(t.icon)?(ut(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void Gt(o)):(Kt(o),xn(o,t),bn(o,t),Xt(o,t.showClass&&t.showClass.icon),void window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",yn));Gt(o)}})(e,t),((e,t)=>{const n=St();n&&(t.imageUrl?(Kt(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt||""),Ut(n,"width",t.imageWidth),Ut(n,"height",t.imageHeight),n.className=st.image,Ht(n,t,"image")):Gt(n))})(0,t),((e,t)=>{const n=kt();n&&(Jt(n),Qt(n,t.title||t.titleText,"block"),t.title&&an(t.title,n),t.titleText&&(n.innerText=t.titleText),Ht(n,t,"title"))})(0,t),((e,t)=>{const n=Bt();n&&(Ft(n,t.closeButtonHtml||""),Ht(n,t,"closeButton"),Qt(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),vn(e,t),((e,t)=>{const n=Pt(),o=It();n&&o&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?Kt(n):Gt(n),Ht(n,t,"actions"),function(e,t,n){const o=Tt(),i=Lt(),r=_t();o&&i&&r&&(dn(o,"confirm",n),dn(i,"deny",n),dn(r,"cancel",n),function(e,t,n,o){o.buttonsStyling?(Xt([e,t,n],st.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,Xt(e,st["default-outline"])),o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,Xt(t,st["default-outline"])),o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,Xt(n,st["default-outline"]))):Yt([e,t,n],st.styled)}(o,i,r,n),n.reverseButtons&&(n.toast?(e.insertBefore(r,o),e.insertBefore(i,o)):(e.insertBefore(r,t),e.insertBefore(i,t),e.insertBefore(o,t))))}(n,o,t),Ft(o,t.loaderHtml||""),Ht(o,t,"loader"))})(0,t),((e,t)=>{const n=Dt();n&&(Jt(n),Qt(n,t.footer,"block"),t.footer&&an(t.footer,n),Ht(n,t,"footer"))})(0,t);const n=xt();"function"==typeof t.didRender&&n&&t.didRender(n),it.eventEmitter.emit("didRender",n)},Nn=()=>{var e;return null===(e=Tt())||void 0===e?void 0:e.click()},$n=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),qn=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Fn=(e,t)=>{var n;const o=Nt();if(o.length)return(e+=t)===o.length?e=0:-1===e&&(e=o.length-1),void o[e].focus();null===(n=xt())||void 0===n||n.focus()},jn=["ArrowRight","ArrowDown"],Hn=["ArrowLeft","ArrowUp"],Vn=(e,t)=>{if(!mt(t.allowEnterKey))return;const n=Vt(xt(),t.input);if(e.target&&n&&e.target instanceof HTMLElement&&e.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(t.input))return;Nn(),e.preventDefault()}},zn=e=>{const t=e.target,n=Nt();let o=-1;for(let e=0;e<n.length;e++)if(t===n[e]){o=e;break}e.shiftKey?Fn(o,-1):Fn(o,1),e.stopPropagation(),e.preventDefault()},Rn=e=>{const t=Pt(),n=Tt(),o=Lt(),i=_t();if(!(t&&n&&o&&i))return;const r=[n,o,i];if(document.activeElement instanceof HTMLElement&&!r.includes(document.activeElement))return;const s=jn.includes(e)?"nextElementSibling":"previousElementSibling";let a=document.activeElement;if(a){for(let e=0;e<t.children.length;e++){if(a=a[s],!a)return;if(a instanceof HTMLButtonElement&&en(a))break}a instanceof HTMLButtonElement&&a.focus()}},Xn=(e,t,n)=>{mt(t.allowEscapeKey)&&(e.preventDefault(),n($n.esc))};var Yn={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Wn=()=>{Array.from(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},Un="undefined"!=typeof window&&!!window.GestureEvent,Kn=e=>{const t=e.target,n=vt(),o=Et();return!(!n||!o||Gn(e)||Jn(e)||t!==n&&(tn(n)||!(t instanceof HTMLElement)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||tn(o)&&o.contains(t)))},Gn=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,Jn=e=>e.touches&&e.touches.length>1;let Zn=null;function Qn(e,t,n,o){qt()?ao(e,o):((e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,o=window.scrollY;it.restoreFocusTimeout=setTimeout(()=>{it.previousActiveElement instanceof HTMLElement?(it.previousActiveElement.focus(),it.previousActiveElement=null):document.body&&document.body.focus(),t()},100),window.scrollTo(n,o)}))(n).then(()=>ao(e,o)),qn(it)),Un?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),$t()&&(null!==Zn&&(document.body.style.paddingRight=`${Zn}px`,Zn=null),(()=>{if(jt(document.body,st.iosfix)){const e=parseInt(document.body.style.top,10);Yt(document.body,st.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Wn()),Yt([document.documentElement,document.body],[st.shown,st["height-auto"],st["no-backdrop"],st["toast-shown"]])}function eo(e){e=io(e);const t=Yn.swalPromiseResolve.get(this),n=to(this);this.isAwaitingPromise?e.isDismissed||(oo(this),t(e)):n&&t(e)}const to=e=>{const t=xt();if(!t)return!1;const n=un.innerParams.get(e);if(!n||jt(t,n.hideClass.popup))return!1;Yt(t,n.showClass.popup),Xt(t,n.hideClass.popup);const o=vt();return Yt(o,n.showClass.backdrop),Xt(o,n.hideClass.backdrop),ro(e,t,n),!0};function no(e){const t=Yn.swalPromiseReject.get(this);oo(this),t&&t(e)}const oo=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,un.innerParams.get(e)||e._destroy())},io=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),ro=(e,t,n)=>{var o;const i=vt(),r=nn(t);"function"==typeof n.willClose&&n.willClose(t),null===(o=it.eventEmitter)||void 0===o||o.emit("willClose",t),r?so(e,t,i,n.returnFocus,n.didClose):Qn(e,i,n.returnFocus,n.didClose)},so=(e,t,n,o,i)=>{it.swalCloseEventFinishedCallback=Qn.bind(null,e,n,o,i);const r=function(e){var n;e.target===t&&(null===(n=it.swalCloseEventFinishedCallback)||void 0===n||n.call(it),delete it.swalCloseEventFinishedCallback,t.removeEventListener("animationend",r),t.removeEventListener("transitionend",r))};t.addEventListener("animationend",r),t.addEventListener("transitionend",r)},ao=(e,t)=>{setTimeout(()=>{var n;"function"==typeof t&&t.bind(e.params)(),null===(n=it.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()})},lo=e=>{let t=xt();if(t||new Ei,t=xt(),!t)return;const n=It();qt()?Gt(Ct()):co(t,e),Kt(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},co=(e,t)=>{const n=Pt(),o=It();n&&o&&(!t&&en(Tt())&&(t=Tt()),Kt(n),t&&(Gt(t),o.setAttribute("data-button-to-replace",t.className),n.insertBefore(o,t)),Xt([e,n],st.loading))},uo=e=>{const t=[];return e instanceof Map?e.forEach((e,n)=>{let o=e;"object"==typeof o&&(o=uo(o)),t.push([n,o])}):Object.keys(e).forEach(n=>{let o=e[n];"object"==typeof o&&(o=uo(o)),t.push([n,o])}),t},po=(e,t)=>!!t&&t.toString()===e.toString(),ho=(e,t)=>{const n=un.innerParams.get(e);if(!n.input)return void ut(`The "input" parameter is needed to be set when using returnInputValueOn${ct(t)}`);const o=e.getInput(),i=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return(e=>e.checked?1:0)(n);case"radio":return(e=>e.checked?e.value:null)(n);case"file":return(e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null)(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,n);n.inputValidator?mo(e,i,t):o&&!o.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||o.validationMessage)):"deny"===t?go(e,i):vo(e,i)},mo=(e,t,n)=>{const o=un.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>ft(o.inputValidator(t,o.validationMessage))).then(o=>{e.enableButtons(),e.enableInput(),o?e.showValidationMessage(o):"deny"===n?go(e,t):vo(e,t)})},go=(e,t)=>{const n=un.innerParams.get(e||void 0);n.showLoaderOnDeny&&lo(Lt()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>ft(n.preDeny(t,n.validationMessage))).then(n=>{!1===n?(e.hideLoading(),oo(e)):e.close({isDenied:!0,value:void 0===n?t:n})}).catch(t=>wo(e||void 0,t))):e.close({isDenied:!0,value:t})},fo=(e,t)=>{e.close({isConfirmed:!0,value:t})},wo=(e,t)=>{e.rejectPromise(t)},vo=(e,t)=>{const n=un.innerParams.get(e||void 0);n.showLoaderOnConfirm&&lo(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>ft(n.preConfirm(t,n.validationMessage))).then(n=>{en(Ot())||!1===n?(e.hideLoading(),oo(e)):fo(e,void 0===n?t:n)}).catch(t=>wo(e||void 0,t))):fo(e,t)};function bo(){const e=un.innerParams.get(this);if(!e)return;const t=un.domCache.get(this);Gt(t.loader),qt()?e.icon&&Kt(Ct()):yo(t),Yt([t.popup,t.actions],st.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const yo=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Kt(t[0],"inline-block"):en(Tt())||en(Lt())||en(_t())||Gt(e.actions)};function xo(){const e=un.innerParams.get(this),t=un.domCache.get(this);return t?Vt(t.popup,e.input):null}function Co(e,t,n){const o=un.domCache.get(e);t.forEach(e=>{o[e].disabled=n})}function ko(e,t){const n=xt();if(n&&e)if("radio"===e.type){const e=n.querySelectorAll(`[name="${st.radio}"]`);for(let n=0;n<e.length;n++)e[n].disabled=t}else e.disabled=t}function Eo(){Co(this,["confirmButton","denyButton","cancelButton"],!1)}function So(){Co(this,["confirmButton","denyButton","cancelButton"],!0)}function Ao(){ko(this.getInput(),!1)}function Oo(){ko(this.getInput(),!0)}function To(e){const t=un.domCache.get(this),n=un.innerParams.get(this);Ft(t.validationMessage,e),t.validationMessage.className=st["validation-message"],n.customClass&&n.customClass.validationMessage&&Xt(t.validationMessage,n.customClass.validationMessage),Kt(t.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid","true"),o.setAttribute("aria-describedby",st["validation-message"]),zt(o),Xt(o,st.inputerror))}function _o(){const e=un.domCache.get(this);e.validationMessage&&Gt(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),Yt(t,st.inputerror))}const Lo={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:"light",showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Io=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","theme","willClose"],Po={allowEnterKey:void 0},Do=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Mo=e=>Object.prototype.hasOwnProperty.call(Lo,e),Bo=e=>-1!==Io.indexOf(e),No=e=>Po[e],$o=e=>{Mo(e)||dt(`Unknown parameter "${e}"`)},qo=e=>{Do.includes(e)&&dt(`The parameter "${e}" is incompatible with toasts`)},Fo=e=>{const t=No(e);t&&ht(e,t)},jo=e=>{!1===e.backdrop&&e.allowOutsideClick&&dt('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e.theme&&!["light","dark","auto","borderless","embed-iframe"].includes(e.theme)&&dt(`Invalid theme "${e.theme}". Expected "light", "dark", "auto", "borderless", or "embed-iframe"`);for(const t in e)$o(t),e.toast&&qo(t),Fo(t)};function Ho(e){const t=vt(),n=xt(),o=un.innerParams.get(this);if(!n||jt(n,o.hideClass.popup))return void dt("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const i=Vo(e),r=Object.assign({},o,i);jo(r),t.dataset.swal2Theme=r.theme,Bn(this,r),un.innerParams.set(this,r),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Vo=e=>{const t={};return Object.keys(e).forEach(n=>{Bo(n)?t[n]=e[n]:dt(`Invalid parameter to update: ${n}`)}),t};function zo(){const e=un.domCache.get(this),t=un.innerParams.get(this);t?(e.popup&&it.swalCloseEventFinishedCallback&&(it.swalCloseEventFinishedCallback(),delete it.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),it.eventEmitter.emit("didDestroy"),Ro(this)):Xo(this)}const Ro=e=>{Xo(e),delete e.params,delete it.keydownHandler,delete it.keydownTarget,delete it.currentInstance},Xo=e=>{e.isAwaitingPromise?(Yo(un,e),e.isAwaitingPromise=!0):(Yo(Yn,e),Yo(un,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},Yo=(e,t)=>{for(const n in e)e[n].delete(t)};var Wo=Object.freeze({__proto__:null,_destroy:zo,close:eo,closeModal:eo,closePopup:eo,closeToast:eo,disableButtons:So,disableInput:Oo,disableLoading:bo,enableButtons:Eo,enableInput:Ao,getInput:xo,handleAwaitingPromise:oo,hideLoading:bo,rejectPromise:no,resetValidationMessage:_o,showValidationMessage:To,update:Ho});const Uo=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let Ko=!1;const Go=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e),Jo=()=>{if(it.timeout)return(()=>{const e=Mt();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`})(),it.timeout.stop()},Zo=()=>{if(it.timeout){const e=it.timeout.start();return on(e),e}};let Qo=!1;const ei={},ti=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in ei){const n=t.getAttribute(e);if(n)return void ei[e].fire({template:n})}};it.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){var n=this;const o=function(){n.removeListener(e,o);for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];t.apply(n,r)};this.on(e,o)}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];this._getHandlersByEventName(e).forEach(e=>{try{e.apply(this,n)}catch(e){console.error(e)}})}removeListener(e,t){const n=this._getHandlersByEventName(e),o=n.indexOf(t);o>-1&&n.splice(o,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var ni=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||Go(e[0])?["title","html","icon"].forEach((n,o)=>{const i=e[o];"string"==typeof i||Go(i)?t[n]=i:void 0!==i&&ut(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)}):Object.assign(t,e[0]),t},bindClickHandler:function(){ei[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,Qo||(document.body.addEventListener("click",ti),Qo=!0)},clickCancel:()=>{var e;return null===(e=_t())||void 0===e?void 0:e.click()},clickConfirm:Nn,clickDeny:()=>{var e;return null===(e=Lt())||void 0===e?void 0:e.click()},enableLoading:lo,fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this(...t)},getActions:Pt,getCancelButton:_t,getCloseButton:Bt,getConfirmButton:Tt,getContainer:vt,getDenyButton:Lt,getFocusableElements:Nt,getFooter:Dt,getHtmlContainer:Et,getIcon:Ct,getIconContent:()=>yt(st["icon-content"]),getImage:St,getInputLabel:()=>yt(st["input-label"]),getLoader:It,getPopup:xt,getProgressSteps:At,getTimerLeft:()=>it.timeout&&it.timeout.getTimerLeft(),getTimerProgressBar:Mt,getTitle:kt,getValidationMessage:Ot,increaseTimer:e=>{if(it.timeout){const t=it.timeout.increase(e);return on(t,!0),t}},isDeprecatedParameter:No,isLoading:()=>{const e=xt();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!(!it.timeout||!it.timeout.isRunning()),isUpdatableParameter:Bo,isValidParameter:Mo,isVisible:()=>en(xt()),mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},off:(e,t)=>{e?t?it.eventEmitter.removeListener(e,t):it.eventEmitter.removeAllListeners(e):it.eventEmitter.reset()},on:(e,t)=>{it.eventEmitter.on(e,t)},once:(e,t)=>{it.eventEmitter.once(e,t)},resumeTimer:Zo,showLoading:lo,stopTimer:Jo,toggleTimer:()=>{const e=it.timeout;return e&&(e.running?Jo():Zo())}});class oi{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const ii=["swal-title","swal-html","swal-footer"],ri=(e,t)=>{Array.from(e.attributes).forEach(n=>{-1===t.indexOf(n.name)&&dt([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])})},si=e=>{const t=xt();if(e.target!==t)return;const n=vt();t.removeEventListener("animationend",si),t.removeEventListener("transitionend",si),n.style.overflowY="auto"},ai=(e,t)=>{nn(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",si),t.addEventListener("transitionend",si)):e.style.overflowY="auto"},li=(e,t,n)=>{(()=>{if(Un&&!jt(document.body,st.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",Xt(document.body,st.iosfix),(()=>{const e=vt();if(!e)return;let t;e.ontouchstart=e=>{t=Kn(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}})()}})(),t&&"hidden"!==n&&(e=>{null===Zn&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(Zn=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Zn+(()=>{const e=document.createElement("div");e.className=st["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)})(n),setTimeout(()=>{e.scrollTop=0})},ci=(e,t,n)=>{Xt(e,n.showClass.backdrop),n.animation?(t.style.setProperty("opacity","0","important"),Kt(t,"grid"),setTimeout(()=>{Xt(t,n.showClass.popup),t.style.removeProperty("opacity")},10)):Kt(t,"grid"),Xt([document.documentElement,document.body],st.shown),n.heightAuto&&n.backdrop&&!n.toast&&Xt([document.documentElement,document.body],st["height-auto"])};var di=(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),ui=(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL");function pi(e){!function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=di),"url"===e.input&&(e.inputValidator=ui))}(e),e.showLoaderOnConfirm&&!e.preConfirm&&dt("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(dt('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),(e=>{const t=(()=>{const e=vt();return!!e&&(e.remove(),Yt([document.documentElement,document.body],[st["no-backdrop"],st["toast-shown"],st["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return void ut("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=st.container,t&&Xt(n,st["no-transition"]),Ft(n,rn),n.dataset.swal2Theme=e.theme;const o="string"==typeof(i=e.target)?document.querySelector(i):i;var i;o.appendChild(n),(e=>{const t=xt();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&Xt(vt(),st.rtl)})(o),(()=>{const e=xt(),t=Wt(e,st.input),n=Wt(e,st.file),o=e.querySelector(`.${st.range} input`),i=e.querySelector(`.${st.range} output`),r=Wt(e,st.select),s=e.querySelector(`.${st.checkbox} input`),a=Wt(e,st.textarea);t.oninput=sn,n.onchange=sn,r.onchange=sn,s.onchange=sn,a.oninput=sn,o.oninput=()=>{sn(),i.value=o.value},o.onchange=()=>{sn(),i.value=o.value}})()})(e)}let hi;var mi=new WeakMap;class gi{constructor(){if(function(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}(this,mi,void 0),"undefined"==typeof window)return;hi=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=Object.freeze(this.constructor.argsToParams(t));var i,r;this.params=o,this.isAwaitingPromise=!1,i=mi,r=this._main(hi.params),i.set(nt(i,this),r)}_main(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(jo(Object.assign({},t,e)),it.currentInstance){const e=Yn.swalPromiseResolve.get(it.currentInstance),{isAwaitingPromise:t}=it.currentInstance;it.currentInstance._destroy(),t||e({isDismissed:!0}),$t()&&Wn()}it.currentInstance=hi;const n=wi(e,t);pi(n),Object.freeze(n),it.timeout&&(it.timeout.stop(),delete it.timeout),clearTimeout(it.restoreFocusTimeout);const o=vi(hi);return Bn(hi,n),un.innerParams.set(hi,n),fi(hi,o,n)}then(e){return ot(mi,this).then(e)}finally(e){return ot(mi,this).finally(e)}}const fi=(e,t,n)=>new Promise((o,i)=>{const r=t=>{e.close({isDismissed:!0,dismiss:t})};Yn.swalPromiseResolve.set(e,o),Yn.swalPromiseReject.set(e,i),t.confirmButton.onclick=()=>{(e=>{const t=un.innerParams.get(e);e.disableButtons(),t.input?ho(e,"confirm"):vo(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=un.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?ho(e,"deny"):go(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t($n.cancel)})(e,r)},t.closeButton.onclick=()=>{r($n.close)},((e,t,n)=>{e.toast?((e,t,n)=>{t.popup.onclick=()=>{e&&(Uo(e)||e.timer||e.input)||n($n.close)}})(e,t,n):((e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Ko=!0)}}})(t),(e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Ko=!0)}}})(t),((e,t,n)=>{t.container.onclick=o=>{Ko?Ko=!1:o.target===t.container&&mt(e.allowOutsideClick)&&n($n.backdrop)}})(e,t,n))})(n,t,r),((e,t,n)=>{qn(e),t.toast||(e.keydownHandler=e=>((e,t,n)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Vn(t,e):"Tab"===t.key?zn(t):[...jn,...Hn].includes(t.key)?Rn(t.key):"Escape"===t.key&&Xn(t,e,n)))})(t,e,n),e.keydownTarget=t.keydownListenerCapture?window:xt(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)})(it,n,r),((e,t)=>{"select"===t.input||"radio"===t.input?((e,t)=>{const n=xt();if(!n)return;const o=e=>{"select"===t.input?function(e,t,n){const o=Wt(e,st.select);if(!o)return;const i=(e,t,o)=>{const i=document.createElement("option");i.value=o,Ft(i,t),i.selected=po(o,n.inputValue),e.appendChild(i)};t.forEach(e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,o.appendChild(e),n.forEach(t=>i(e,t[1],t[0]))}else i(o,n,t)}),o.focus()}(n,uo(e),t):"radio"===t.input&&function(e,t,n){const o=Wt(e,st.radio);if(!o)return;t.forEach(e=>{const t=e[0],i=e[1],r=document.createElement("input"),s=document.createElement("label");r.type="radio",r.name=st.radio,r.value=t,po(t,n.inputValue)&&(r.checked=!0);const a=document.createElement("span");Ft(a,i),a.className=st.label,s.appendChild(r),s.appendChild(a),o.appendChild(s)});const i=o.querySelectorAll("input");i.length&&i[0].focus()}(n,uo(e),t)};gt(t.inputOptions)||wt(t.inputOptions)?(lo(Tt()),ft(t.inputOptions).then(t=>{e.hideLoading(),o(t)})):"object"==typeof t.inputOptions?o(t.inputOptions):ut("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)})(e,t):["text","email","number","tel","textarea"].some(e=>e===t.input)&&(gt(t.inputValue)||wt(t.inputValue))&&(lo(Tt()),((e,t)=>{const n=e.getInput();n&&(Gt(n),ft(t.inputValue).then(o=>{n.value="number"===t.input?`${parseFloat(o)||0}`:`${o}`,Kt(n),n.focus(),e.hideLoading()}).catch(t=>{ut(`Error in inputValue promise: ${t}`),n.value="",Kt(n),n.focus(),e.hideLoading()}))})(e,t))})(e,n),(e=>{const t=vt(),n=xt();"function"==typeof e.willOpen&&e.willOpen(n),it.eventEmitter.emit("willOpen",n);const o=window.getComputedStyle(document.body).overflowY;ci(t,n,e),setTimeout(()=>{ai(t,n)},10),$t()&&(li(t,e.scrollbarPadding,o),(()=>{const e=vt();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))})})()),qt()||it.previousActiveElement||(it.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout(()=>e.didOpen(n)),it.eventEmitter.emit("didOpen",n),Yt(t,st["no-transition"])})(n),bi(it,n,r),yi(t,n),setTimeout(()=>{t.container.scrollTop=0})}),wi=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return(e=>{const t=ii.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(e=>{const n=e.tagName.toLowerCase();t.includes(n)||dt(`Unrecognized element <${n}>`)})})(n),Object.assign((e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach(e=>{ri(e,["name","value"]);const n=e.getAttribute("name"),o=e.getAttribute("value");n&&o&&(t[n]="boolean"==typeof Lo[n]?"false"!==o:"object"==typeof Lo[n]?JSON.parse(o):o)}),t})(n),(e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(e=>{const n=e.getAttribute("name"),o=e.getAttribute("value");n&&o&&(t[n]=new Function(`return ${o}`)())}),t})(n),(e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach(e=>{ri(e,["type","color","aria-label"]);const n=e.getAttribute("type");n&&["confirm","cancel","deny"].includes(n)&&(t[`${n}ButtonText`]=e.innerHTML,t[`show${ct(n)}Button`]=!0,e.hasAttribute("color")&&(t[`${n}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=e.getAttribute("aria-label")))}),t})(n),(e=>{const t={},n=e.querySelector("swal-image");return n&&(ri(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt")||void 0)),t})(n),(e=>{const t={},n=e.querySelector("swal-icon");return n&&(ri(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t})(n),(e=>{const t={},n=e.querySelector("swal-input");n&&(ri(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const o=Array.from(e.querySelectorAll("swal-input-option"));return o.length&&(t.inputOptions={},o.forEach(e=>{ri(e,["value"]);const n=e.getAttribute("value");if(!n)return;const o=e.innerHTML;t.inputOptions[n]=o})),t})(n),((e,t)=>{const n={};for(const o in t){const i=t[o],r=e.querySelector(i);r&&(ri(r,[]),n[i.replace(/^swal-/,"")]=r.innerHTML.trim())}return n})(n,ii))})(e),o=Object.assign({},Lo,t,n,e);return o.showClass=Object.assign({},Lo.showClass,o.showClass),o.hideClass=Object.assign({},Lo.hideClass,o.hideClass),!1===o.animation&&(o.showClass={backdrop:"swal2-noanimation"},o.hideClass={}),o},vi=e=>{const t={popup:xt(),container:vt(),actions:Pt(),confirmButton:Tt(),denyButton:Lt(),cancelButton:_t(),loader:It(),closeButton:Bt(),validationMessage:Ot(),progressSteps:At()};return un.domCache.set(e,t),t},bi=(e,t,n)=>{const o=Mt();Gt(o),t.timer&&(e.timeout=new oi(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(Kt(o),Ht(o,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&on(t.timer)})))},yi=(e,t)=>{if(!t.toast)return mt(t.allowEnterKey)?void(xi(e)||Ci(e,t)||Fn(-1,1)):(ht("allowEnterKey"),void ki())},xi=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&en(e))return e.focus(),!0;return!1},Ci=(e,t)=>t.focusDeny&&en(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&en(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!en(e.confirmButton)||(e.confirmButton.focus(),0)),ki=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};gi.prototype.disableButtons=So,gi.prototype.enableButtons=Eo,gi.prototype.getInput=xo,gi.prototype.disableInput=Oo,gi.prototype.enableInput=Ao,gi.prototype.hideLoading=bo,gi.prototype.disableLoading=bo,gi.prototype.showValidationMessage=To,gi.prototype.resetValidationMessage=_o,gi.prototype.close=eo,gi.prototype.closePopup=eo,gi.prototype.closeModal=eo,gi.prototype.closeToast=eo,gi.prototype.rejectPromise=no,gi.prototype.update=Ho,gi.prototype._destroy=zo,Object.assign(gi,ni),Object.keys(Wo).forEach(e=>{gi[e]=function(){return hi&&hi[e]?hi[e](...arguments):null}}),gi.DismissReason=$n,gi.version="11.18.0";const Ei=gi;function Si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function Ai(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Si(Object(n),!0).forEach(function(t){Ti(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Si(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oi(e){return Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oi(e)}function Ti(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _i(){return _i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_i.apply(this,arguments)}function Li(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}Ei.default=Ei,"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,':root{--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-footer-border-color: #eee;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-background: transparent;--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.1s, box-shadow 0.1s;--swal2-close-button-outline: initial;--swal2-close-button-hover-transform: none}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);color:inherit;font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:var(--swal2-input-background);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:var(--swal2-background);box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}');var Ii=Li(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pi=Li(/Edge/i),Di=Li(/firefox/i),Mi=Li(/safari/i)&&!Li(/chrome/i)&&!Li(/android/i),Bi=Li(/iP(ad|od|hone)/i),Ni=Li(/chrome/i)&&Li(/android/i),$i={capture:!1,passive:!1};function qi(e,t,n){e.addEventListener(t,n,!Ii&&$i)}function Fi(e,t,n){e.removeEventListener(t,n,!Ii&&$i)}function ji(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Hi(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Vi(e,t,n,o){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&ji(e,t):ji(e,t))||o&&e===n)return e;if(e===n)break}while(e=Hi(e))}return null}var zi,Ri=/\s+/g;function Xi(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(Ri," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(Ri," ")}}function Yi(e,t,n){var o=e&&e.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in o||-1!==t.indexOf("webkit")||(t="-webkit-"+t),o[t]=n+("string"==typeof n?"":"px")}}function Wi(e,t){var n="";if("string"==typeof e)n=e;else do{var o=Yi(e,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Ui(e,t,n){if(e){var o=e.getElementsByTagName(t),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function Ki(){return document.scrollingElement||document.documentElement}function Gi(e,t,n,o,i){if(e.getBoundingClientRect||e===window){var r,s,a,l,c,d,u;if(e!==window&&e.parentNode&&e!==Ki()?(s=(r=e.getBoundingClientRect()).top,a=r.left,l=r.bottom,c=r.right,d=r.height,u=r.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!Ii))do{if(i&&i.getBoundingClientRect&&("none"!==Yi(i,"transform")||n&&"static"!==Yi(i,"position"))){var p=i.getBoundingClientRect();s-=p.top+parseInt(Yi(i,"border-top-width")),a-=p.left+parseInt(Yi(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&e!==window){var h=Wi(i||e),m=h&&h.a,g=h&&h.d;h&&(l=(s/=g)+(d/=g),c=(a/=m)+(u/=m))}return{top:s,left:a,bottom:l,right:c,width:u,height:d}}}function Ji(e,t,n){for(var o=nr(e,!0),i=Gi(e)[t];o;){var r=Gi(o)[n];if(!("top"===n||"left"===n?i>=r:i<=r))return o;if(o===Ki())break;o=nr(o,!1)}return!1}function Zi(e,t,n,o){for(var i=0,r=0,s=e.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==rs.ghost&&(o||s[r]!==rs.dragged)&&Vi(s[r],n.draggable,e,!1)){if(i===t)return s[r];i++}r++}return null}function Qi(e,t){for(var n=e.lastElementChild;n&&(n===rs.ghost||"none"===Yi(n,"display")||t&&!ji(n,t));)n=n.previousElementSibling;return n||null}function er(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===rs.clone||t&&!ji(e,t)||n++;return n}function tr(e){var t=0,n=0,o=Ki();if(e)do{var i=Wi(e),r=i.a,s=i.d;t+=e.scrollLeft*r,n+=e.scrollTop*s}while(e!==o&&(e=e.parentNode));return[t,n]}function nr(e,t){if(!e||!e.getBoundingClientRect)return Ki();var n=e,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Yi(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return Ki();if(o||t)return n;o=!0}}}while(n=n.parentNode);return Ki()}function or(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function ir(e,t){return function(){if(!zi){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),zi=setTimeout(function(){zi=void 0},t)}}}function rr(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function sr(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function ar(e,t,n){var o={};return Array.from(e.children).forEach(function(i){var r,s,a,l;if(Vi(i,t.draggable,e,!1)&&!i.animated&&i!==n){var c=Gi(i);o.left=Math.min(null!==(r=o.left)&&void 0!==r?r:1/0,c.left),o.top=Math.min(null!==(s=o.top)&&void 0!==s?s:1/0,c.top),o.right=Math.max(null!==(a=o.right)&&void 0!==a?a:-1/0,c.right),o.bottom=Math.max(null!==(l=o.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var lr="Sortable"+(new Date).getTime();var cr=[],dr={initializeByDefault:!0},ur={mount:function(e){for(var t in dr)dr.hasOwnProperty(t)&&!(t in e)&&(e[t]=dr[t]);cr.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),cr.push(e)},pluginEvent:function(e,t,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=e+"Global";cr.forEach(function(o){t[o.pluginName]&&(t[o.pluginName][i]&&t[o.pluginName][i](Ai({sortable:t},n)),t.options[o.pluginName]&&t[o.pluginName][e]&&t[o.pluginName][e](Ai({sortable:t},n)))})},initializePlugins:function(e,t,n,o){for(var i in cr.forEach(function(o){var i=o.pluginName;if(e.options[i]||o.initializeByDefault){var r=new o(e,t,e.options);r.sortable=e,r.options=e.options,e[i]=r,_i(n,r.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var r=this.modifyOption(e,i,e.options[i]);void 0!==r&&(e.options[i]=r)}},getEventProperties:function(e,t){var n={};return cr.forEach(function(o){"function"==typeof o.eventProperties&&_i(n,o.eventProperties.call(t[o.pluginName],e))}),n},modifyOption:function(e,t,n){var o;return cr.forEach(function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(o=i.optionListeners[t].call(e[i.pluginName],n))}),o}};var pr=["evt"],hr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=function(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},r=Object.keys(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,pr);ur.pluginEvent.bind(rs)(e,t,Ai({dragEl:gr,parentEl:fr,ghostEl:wr,rootEl:vr,nextEl:br,lastDownEl:yr,cloneEl:xr,cloneHidden:Cr,dragStarted:Br,putSortable:Tr,activeSortable:rs.active,originalEvent:o,oldIndex:kr,oldDraggableIndex:Sr,newIndex:Er,newDraggableIndex:Ar,hideGhostForTarget:ts,unhideGhostForTarget:ns,cloneNowHidden:function(){Cr=!0},cloneNowShown:function(){Cr=!1},dispatchSortableEvent:function(e){mr({sortable:t,name:e,originalEvent:o})}},i))};function mr(e){!function(e){var t=e.sortable,n=e.rootEl,o=e.name,i=e.targetEl,r=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,p=e.originalEvent,h=e.putSortable,m=e.extraEventProperties;if(t=t||n&&n[lr]){var g,f=t.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Ii||Pi?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=s||n,g.from=a||n,g.item=i||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=u,g.originalEvent=p,g.pullMode=h?h.lastPutMode:void 0;var v=Ai(Ai({},m),ur.getEventProperties(o,t));for(var b in v)g[b]=v[b];n&&n.dispatchEvent(g),f[w]&&f[w].call(t,g)}}(Ai({putSortable:Tr,cloneEl:xr,targetEl:gr,rootEl:vr,oldIndex:kr,oldDraggableIndex:Sr,newIndex:Er,newDraggableIndex:Ar},e))}var gr,fr,wr,vr,br,yr,xr,Cr,kr,Er,Sr,Ar,Or,Tr,_r,Lr,Ir,Pr,Dr,Mr,Br,Nr,$r,qr,Fr,jr=!1,Hr=!1,Vr=[],zr=!1,Rr=!1,Xr=[],Yr=!1,Wr=[],Ur="undefined"!=typeof document,Kr=Bi,Gr=Pi||Ii?"cssFloat":"float",Jr=Ur&&!Ni&&!Bi&&"draggable"in document.createElement("div"),Zr=function(){if(Ur){if(Ii)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Qr=function(e,t){var n=Yi(e),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Zi(e,0,t),r=Zi(e,1,t),s=i&&Yi(i),a=r&&Yi(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Gi(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Gi(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=o&&"none"===n[Gr]||r&&"none"===n[Gr]&&l+c>o)?"vertical":"horizontal"},es=function(e){function t(e,n){return function(o,i,r,s){var a=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==e&&(n||a))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(o,i,r,s),n)(o,i,r,s);var l=(n?o:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},o=e.group;o&&"object"==Oi(o)||(o={name:o}),n.name=o.name,n.checkPull=t(o.pull,!0),n.checkPut=t(o.put),n.revertClone=o.revertClone,e.group=n},ts=function(){!Zr&&wr&&Yi(wr,"display","none")},ns=function(){!Zr&&wr&&Yi(wr,"display","")};Ur&&!Ni&&document.addEventListener("click",function(e){if(Hr)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Hr=!1,!1},!0);var os=function(e){if(gr){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,r=e.clientY,Vr.some(function(e){var t=e[lr].options.emptyInsertThreshold;if(t&&!Qi(e)){var n=Gi(e),o=i>=n.left-t&&i<=n.right+t,a=r>=n.top-t&&r<=n.bottom+t;return o&&a?s=e:void 0}}),s);if(t){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[lr]._onDragOver(n)}}var i,r,s},is=function(e){gr&&gr.parentNode[lr]._isOutsideThisEl(e.target)};function rs(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=_i({},t),e[lr]=this;var n,o,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Qr(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==rs.supportPointer&&"PointerEvent"in window&&(!Mi||Bi),emptyInsertThreshold:5};for(var r in ur.initializePlugins(this,e,i),i)!(r in t)&&(t[r]=i[r]);for(var s in es(t),this)"_"===s.charAt(0)&&"function"==typeof this[s]&&(this[s]=this[s].bind(this));this.nativeDraggable=!t.forceFallback&&Jr,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?qi(e,"pointerdown",this._onTapStart):(qi(e,"mousedown",this._onTapStart),qi(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(qi(e,"dragover",this),qi(e,"dragenter",this)),Vr.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),_i(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(e){if("none"!==Yi(e,"display")&&e!==rs.ghost){o.push({target:e,rect:Gi(e)});var t=Ai({},o[o.length-1].rect);if(e.thisAnimationDuration){var n=Wi(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}})},addAnimationState:function(e){o.push(e)},removeAnimationState:function(e){o.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n);return-1}(o,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var i=!1,r=0;o.forEach(function(e){var n=0,o=e.target,s=o.fromRect,a=Gi(o),l=o.prevFromRect,c=o.prevToRect,d=e.rect,u=Wi(o,!0);u&&(a.top-=u.f,a.left-=u.e),o.toRect=a,o.thisAnimationDuration&&or(l,a)&&!or(s,a)&&(d.top-a.top)/(d.left-a.left)===(s.top-a.top)/(s.left-a.left)&&(n=function(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}(d,l,c,t.options)),or(a,s)||(o.prevFromRect=s,o.prevToRect=a,n||(n=t.options.animation),t.animate(o,d,a,n)),n&&(i=!0,r=Math.max(r,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout(function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null},n),o.thisAnimationDuration=n)}),clearTimeout(n),i?n=setTimeout(function(){"function"==typeof e&&e()},r):"function"==typeof e&&e(),o=[]},animate:function(e,t,n,o){if(o){Yi(e,"transition",""),Yi(e,"transform","");var i=Wi(this.el),r=i&&i.a,s=i&&i.d,a=(t.left-n.left)/(r||1),l=(t.top-n.top)/(s||1);e.animatingX=!!a,e.animatingY=!!l,Yi(e,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),Yi(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Yi(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){Yi(e,"transition",""),Yi(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},o)}}}))}function ss(e,t,n,o,i,r,s,a){var l,c,d=e[lr],u=d.options.onMove;return!window.CustomEvent||Ii||Pi?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=o,l.related=i||t,l.relatedRect=r||Gi(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function as(e){e.draggable=!1}function ls(){Yr=!1}function cs(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function ds(e){return setTimeout(e,0)}function us(e){return clearTimeout(e)}rs.prototype={constructor:rs,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Nr=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,gr):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,o=this.options,i=o.preventOnFilter,r=e.type,s=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,a=(s||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,c=o.filter;if(function(e){Wr.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&Wr.push(o)}}(n),!gr&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Mi||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Vi(a,o.draggable,n,!1))&&a.animated||yr===a)){if(kr=er(a),Sr=er(a,o.draggable),"function"==typeof c){if(c.call(this,e,a,this))return mr({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),hr("filter",t,{evt:e}),void(i&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(o){if(o=Vi(l,o.trim(),n,!1))return mr({sortable:t,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),hr("filter",t,{evt:e}),!0})))return void(i&&e.preventDefault());o.handle&&!Vi(l,o.handle,n,!1)||this._prepareDragStart(e,s,a)}}},_prepareDragStart:function(e,t,n){var o,i=this,r=i.el,s=i.options,a=r.ownerDocument;if(n&&!gr&&n.parentNode===r){var l=Gi(n);if(vr=r,fr=(gr=n).parentNode,br=gr.nextSibling,yr=n,Or=s.group,rs.dragged=gr,_r={target:gr,clientX:(t||e).clientX,clientY:(t||e).clientY},Dr=_r.clientX-l.left,Mr=_r.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,gr.style["will-change"]="all",o=function(){hr("delayEnded",i,{evt:e}),rs.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Di&&i.nativeDraggable&&(gr.draggable=!0),i._triggerDragStart(e,t),mr({sortable:i,name:"choose",originalEvent:e}),Xi(gr,s.chosenClass,!0))},s.ignore.split(",").forEach(function(e){Ui(gr,e.trim(),as)}),qi(a,"dragover",os),qi(a,"mousemove",os),qi(a,"touchmove",os),s.supportPointer?(qi(a,"pointerup",i._onDrop),!this.nativeDraggable&&qi(a,"pointercancel",i._onDrop)):(qi(a,"mouseup",i._onDrop),qi(a,"touchend",i._onDrop),qi(a,"touchcancel",i._onDrop)),Di&&this.nativeDraggable&&(this.options.touchStartThreshold=4,gr.draggable=!0),hr("delayStart",this,{evt:e}),!s.delay||s.delayOnTouchOnly&&!t||this.nativeDraggable&&(Pi||Ii))o();else{if(rs.eventCanceled)return void this._onDrop();s.supportPointer?(qi(a,"pointerup",i._disableDelayedDrag),qi(a,"pointercancel",i._disableDelayedDrag)):(qi(a,"mouseup",i._disableDelayedDrag),qi(a,"touchend",i._disableDelayedDrag),qi(a,"touchcancel",i._disableDelayedDrag)),qi(a,"mousemove",i._delayedDragTouchMoveHandler),qi(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&qi(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,s.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){gr&&as(gr),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Fi(e,"mouseup",this._disableDelayedDrag),Fi(e,"touchend",this._disableDelayedDrag),Fi(e,"touchcancel",this._disableDelayedDrag),Fi(e,"pointerup",this._disableDelayedDrag),Fi(e,"pointercancel",this._disableDelayedDrag),Fi(e,"mousemove",this._delayedDragTouchMoveHandler),Fi(e,"touchmove",this._delayedDragTouchMoveHandler),Fi(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?qi(document,"pointermove",this._onTouchMove):qi(document,t?"touchmove":"mousemove",this._onTouchMove):(qi(gr,"dragend",this),qi(vr,"dragstart",this._onDragStart));try{document.selection?ds(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(jr=!1,vr&&gr){hr("dragStarted",this,{evt:t}),this.nativeDraggable&&qi(document,"dragover",is);var n=this.options;!e&&Xi(gr,n.dragClass,!1),Xi(gr,n.ghostClass,!0),rs.active=this,e&&this._appendGhost(),mr({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Lr){this._lastX=Lr.clientX,this._lastY=Lr.clientY,ts();for(var e=document.elementFromPoint(Lr.clientX,Lr.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Lr.clientX,Lr.clientY))!==t;)t=e;if(gr.parentNode[lr]._isOutsideThisEl(e),t)do{if(t[lr]&&t[lr]._onDragOver({clientX:Lr.clientX,clientY:Lr.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=Hi(t));ns()}},_onTouchMove:function(e){if(_r){var t=this.options,n=t.fallbackTolerance,o=t.fallbackOffset,i=e.touches?e.touches[0]:e,r=wr&&Wi(wr,!0),s=wr&&r&&r.a,a=wr&&r&&r.d,l=Kr&&Fr&&tr(Fr),c=(i.clientX-_r.clientX+o.x)/(s||1)+(l?l[0]-Xr[0]:0)/(s||1),d=(i.clientY-_r.clientY+o.y)/(a||1)+(l?l[1]-Xr[1]:0)/(a||1);if(!rs.active&&!jr){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(wr){r?(r.e+=c-(Ir||0),r.f+=d-(Pr||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Yi(wr,"webkitTransform",u),Yi(wr,"mozTransform",u),Yi(wr,"msTransform",u),Yi(wr,"transform",u),Ir=c,Pr=d,Lr=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!wr){var e=this.options.fallbackOnBody?document.body:vr,t=Gi(gr,!0,Kr,!0,e),n=this.options;if(Kr){for(Fr=e;"static"===Yi(Fr,"position")&&"none"===Yi(Fr,"transform")&&Fr!==document;)Fr=Fr.parentNode;Fr!==document.body&&Fr!==document.documentElement?(Fr===document&&(Fr=Ki()),t.top+=Fr.scrollTop,t.left+=Fr.scrollLeft):Fr=Ki(),Xr=tr(Fr)}Xi(wr=gr.cloneNode(!0),n.ghostClass,!1),Xi(wr,n.fallbackClass,!0),Xi(wr,n.dragClass,!0),Yi(wr,"transition",""),Yi(wr,"transform",""),Yi(wr,"box-sizing","border-box"),Yi(wr,"margin",0),Yi(wr,"top",t.top),Yi(wr,"left",t.left),Yi(wr,"width",t.width),Yi(wr,"height",t.height),Yi(wr,"opacity","0.8"),Yi(wr,"position",Kr?"absolute":"fixed"),Yi(wr,"zIndex","100000"),Yi(wr,"pointerEvents","none"),rs.ghost=wr,e.appendChild(wr),Yi(wr,"transform-origin",Dr/parseInt(wr.style.width)*100+"% "+Mr/parseInt(wr.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,o=e.dataTransfer,i=n.options;hr("dragStart",this,{evt:e}),rs.eventCanceled?this._onDrop():(hr("setupClone",this),rs.eventCanceled||((xr=sr(gr)).removeAttribute("id"),xr.draggable=!1,xr.style["will-change"]="",this._hideClone(),Xi(xr,this.options.chosenClass,!1),rs.clone=xr),n.cloneId=ds(function(){hr("clone",n),rs.eventCanceled||(n.options.removeCloneOnHide||vr.insertBefore(xr,gr),n._hideClone(),mr({sortable:n,name:"clone"}))}),!t&&Xi(gr,i.dragClass,!0),t?(Hr=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Fi(document,"mouseup",n._onDrop),Fi(document,"touchend",n._onDrop),Fi(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,gr)),qi(document,"drop",n),Yi(gr,"transform","translateZ(0)")),jr=!0,n._dragStartId=ds(n._dragStarted.bind(n,t,e)),qi(document,"selectstart",n),Br=!0,window.getSelection().removeAllRanges(),Mi&&Yi(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,o,i,r=this.el,s=e.target,a=this.options,l=a.group,c=rs.active,d=Or===l,u=a.sort,p=Tr||c,h=this,m=!1;if(!Yr){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=Vi(s,a.draggable,r,!0),_("dragOver"),rs.eventCanceled)return m;if(gr.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||h._ignoreWhileAnimating===s)return I(!1);if(Hr=!1,c&&!a.disabled&&(d?u||(o=fr!==vr):Tr===this||(this.lastPutMode=Or.checkPull(this,c,gr,e))&&l.checkPut(this,c,gr,e))){if(i="vertical"===this._getDirection(e,s),t=Gi(gr),_("dragOverValid"),rs.eventCanceled)return m;if(o)return fr=vr,L(),this._hideClone(),_("revert"),rs.eventCanceled||(br?vr.insertBefore(gr,br):vr.appendChild(gr)),I(!0);var g=Qi(r,a.draggable);if(!g||function(e,t,n){var o=Gi(Qi(n.el,n.options.draggable)),i=ar(n.el,n.options,wr);return t?e.clientX>i.right+10||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>i.bottom+10||e.clientX>o.right&&e.clientY>o.top}(e,i,this)&&!g.animated){if(g===gr)return I(!1);if(g&&r===e.target&&(s=g),s&&(n=Gi(s)),!1!==ss(vr,r,gr,t,s,n,e,!!s))return L(),g&&g.nextSibling?r.insertBefore(gr,g.nextSibling):r.appendChild(gr),fr=r,P(),I(!0)}else if(g&&function(e,t,n){var o=Gi(Zi(n.el,0,n.options,!0)),i=ar(n.el,n.options,wr);return t?e.clientX<i.left-10||e.clientY<o.top&&e.clientX<o.right:e.clientY<i.top-10||e.clientY<o.bottom&&e.clientX<o.left}(e,i,this)){var f=Zi(r,0,a,!0);if(f===gr)return I(!1);if(n=Gi(s=f),!1!==ss(vr,r,gr,t,s,n,e,!1))return L(),r.insertBefore(gr,f),fr=r,P(),I(!0)}else if(s.parentNode===r){n=Gi(s);var w,v,b,y=gr.parentNode!==r,x=!function(e,t,n){var o=n?e.left:e.top,i=n?e.right:e.bottom,r=n?e.width:e.height,s=n?t.left:t.top,a=n?t.right:t.bottom,l=n?t.width:t.height;return o===s||i===a||o+r/2===s+l/2}(gr.animated&&gr.toRect||t,s.animated&&s.toRect||n,i),C=i?"top":"left",k=Ji(s,"top","top")||Ji(gr,"top","top"),E=k?k.scrollTop:void 0;if(Nr!==s&&(v=n[C],zr=!1,Rr=!x&&a.invertSwap||y),w=function(e,t,n,o,i,r,s,a){var l=o?e.clientY:e.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,p=!1;if(!s)if(a&&qr<c*i){if(!zr&&(1===$r?l>d+c*r/2:l<u-c*r/2)&&(zr=!0),zr)p=!0;else if(1===$r?l<d+qr:l>u-qr)return-$r}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(e){return er(gr)<er(e)?1:-1}(t);return(p=p||s)&&(l<d+c*r/2||l>u-c*r/2)?l>d+c/2?1:-1:0}(e,s,n,i,x?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Rr,Nr===s),0!==w){var S=er(gr);do{S-=w,b=fr.children[S]}while(b&&("none"===Yi(b,"display")||b===wr))}if(0===w||b===s)return I(!1);Nr=s,$r=w;var A=s.nextElementSibling,O=!1,T=ss(vr,r,gr,t,s,n,e,O=1===w);if(!1!==T)return 1!==T&&-1!==T||(O=1===T),Yr=!0,setTimeout(ls,30),L(),O&&!A?r.appendChild(gr):s.parentNode.insertBefore(gr,O?A:s),k&&rr(k,0,E-k.scrollTop),fr=gr.parentNode,void 0===v||Rr||(qr=Math.abs(v-Gi(s)[C])),P(),I(!0)}if(r.contains(gr))return I(!1)}return!1}function _(a,l){hr(a,h,Ai({evt:e,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:t,targetRect:n,canSort:u,fromSortable:p,target:s,completed:I,onMove:function(n,o){return ss(vr,r,gr,t,n,Gi(n),e,o)},changed:P},l))}function L(){_("dragOverAnimationCapture"),h.captureAnimationState(),h!==p&&p.captureAnimationState()}function I(t){return _("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(h),h!==p&&(Xi(gr,Tr?Tr.options.ghostClass:c.options.ghostClass,!1),Xi(gr,a.ghostClass,!0)),Tr!==h&&h!==rs.active?Tr=h:h===rs.active&&Tr&&(Tr=null),p===h&&(h._ignoreWhileAnimating=s),h.animateAll(function(){_("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(s===gr&&!gr.animated||s===r&&!s.animated)&&(Nr=null),a.dragoverBubble||e.rootEl||s===document||(gr.parentNode[lr]._isOutsideThisEl(e.target),!t&&os(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function P(){Er=er(gr),Ar=er(gr,a.draggable),mr({sortable:h,name:"change",toEl:r,newIndex:Er,newDraggableIndex:Ar,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Fi(document,"mousemove",this._onTouchMove),Fi(document,"touchmove",this._onTouchMove),Fi(document,"pointermove",this._onTouchMove),Fi(document,"dragover",os),Fi(document,"mousemove",os),Fi(document,"touchmove",os)},_offUpEvents:function(){var e=this.el.ownerDocument;Fi(e,"mouseup",this._onDrop),Fi(e,"touchend",this._onDrop),Fi(e,"pointerup",this._onDrop),Fi(e,"pointercancel",this._onDrop),Fi(e,"touchcancel",this._onDrop),Fi(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;Er=er(gr),Ar=er(gr,n.draggable),hr("drop",this,{evt:e}),fr=gr&&gr.parentNode,Er=er(gr),Ar=er(gr,n.draggable),rs.eventCanceled||(jr=!1,Rr=!1,zr=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),us(this.cloneId),us(this._dragStartId),this.nativeDraggable&&(Fi(document,"drop",this),Fi(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Mi&&Yi(document.body,"user-select",""),Yi(gr,"transform",""),e&&(Br&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),wr&&wr.parentNode&&wr.parentNode.removeChild(wr),(vr===fr||Tr&&"clone"!==Tr.lastPutMode)&&xr&&xr.parentNode&&xr.parentNode.removeChild(xr),gr&&(this.nativeDraggable&&Fi(gr,"dragend",this),as(gr),gr.style["will-change"]="",Br&&!jr&&Xi(gr,Tr?Tr.options.ghostClass:this.options.ghostClass,!1),Xi(gr,this.options.chosenClass,!1),mr({sortable:this,name:"unchoose",toEl:fr,newIndex:null,newDraggableIndex:null,originalEvent:e}),vr!==fr?(Er>=0&&(mr({rootEl:fr,name:"add",toEl:fr,fromEl:vr,originalEvent:e}),mr({sortable:this,name:"remove",toEl:fr,originalEvent:e}),mr({rootEl:fr,name:"sort",toEl:fr,fromEl:vr,originalEvent:e}),mr({sortable:this,name:"sort",toEl:fr,originalEvent:e})),Tr&&Tr.save()):Er!==kr&&Er>=0&&(mr({sortable:this,name:"update",toEl:fr,originalEvent:e}),mr({sortable:this,name:"sort",toEl:fr,originalEvent:e})),rs.active&&(null!=Er&&-1!==Er||(Er=kr,Ar=Sr),mr({sortable:this,name:"end",toEl:fr,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){hr("nulling",this),vr=gr=fr=wr=br=xr=yr=Cr=_r=Lr=Br=Er=Ar=kr=Sr=Nr=$r=Tr=Or=rs.dragged=rs.ghost=rs.clone=rs.active=null,Wr.forEach(function(e){e.checked=!0}),Wr.length=Ir=Pr=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":gr&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)Vi(e=n[o],r.draggable,this.el,!1)&&t.push(e.getAttribute(r.dataIdAttr)||cs(e));return t},sort:function(e,t){var n={},o=this.el;this.toArray().forEach(function(e,t){var i=o.children[t];Vi(i,this.options.draggable,o,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(o.removeChild(n[e]),o.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Vi(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var o=ur.modifyOption(this,e,t);n[e]=void 0!==o?o:t,"group"===e&&es(n)},destroy:function(){hr("destroy",this);var e=this.el;e[lr]=null,Fi(e,"mousedown",this._onTapStart),Fi(e,"touchstart",this._onTapStart),Fi(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Fi(e,"dragover",this),Fi(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Vr.splice(Vr.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Cr){if(hr("hideClone",this),rs.eventCanceled)return;Yi(xr,"display","none"),this.options.removeCloneOnHide&&xr.parentNode&&xr.parentNode.removeChild(xr),Cr=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(Cr){if(hr("showClone",this),rs.eventCanceled)return;gr.parentNode!=vr||this.options.group.revertClone?br?vr.insertBefore(xr,br):vr.appendChild(xr):vr.insertBefore(xr,gr),this.options.group.revertClone&&this.animate(gr,xr),Yi(xr,"display",""),Cr=!1}}else this._hideClone()}},Ur&&qi(document,"touchmove",function(e){(rs.active||jr)&&e.cancelable&&e.preventDefault()}),rs.utils={on:qi,off:Fi,css:Yi,find:Ui,is:function(e,t){return!!Vi(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:ir,closest:Vi,toggleClass:Xi,clone:sr,index:er,nextTick:ds,cancelNextTick:us,detectDirection:Qr,getChild:Zi,expando:lr},rs.get=function(e){return e[lr]},rs.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(rs.utils=Ai(Ai({},rs.utils),e.utils)),ur.mount(e)})},rs.create=function(e,t){return new rs(e,t)},rs.version="1.15.6";var ps,hs,ms,gs,fs,ws,vs=[],bs=!1;function ys(){vs.forEach(function(e){clearInterval(e.pid)}),vs=[]}function xs(){clearInterval(ws)}var Cs=ir(function(e,t,n,o){if(t.scroll){var i,r=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,c=Ki(),d=!1;hs!==n&&(hs=n,ys(),ps=t.scroll,i=t.scrollFn,!0===ps&&(ps=nr(n,!0)));var u=0,p=ps;do{var h=p,m=Gi(h),g=m.top,f=m.bottom,w=m.left,v=m.right,b=m.width,y=m.height,x=void 0,C=void 0,k=h.scrollWidth,E=h.scrollHeight,S=Yi(h),A=h.scrollLeft,O=h.scrollTop;h===c?(x=b<k&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),C=y<E&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(x=b<k&&("auto"===S.overflowX||"scroll"===S.overflowX),C=y<E&&("auto"===S.overflowY||"scroll"===S.overflowY));var T=x&&(Math.abs(v-r)<=a&&A+b<k)-(Math.abs(w-r)<=a&&!!A),_=C&&(Math.abs(f-s)<=a&&O+y<E)-(Math.abs(g-s)<=a&&!!O);if(!vs[u])for(var L=0;L<=u;L++)vs[L]||(vs[L]={});vs[u].vx==T&&vs[u].vy==_&&vs[u].el===h||(vs[u].el=h,vs[u].vx=T,vs[u].vy=_,clearInterval(vs[u].pid),0==T&&0==_||(d=!0,vs[u].pid=setInterval(function(){o&&0===this.layer&&rs.active._onTouchMove(fs);var t=vs[this.layer].vy?vs[this.layer].vy*l:0,n=vs[this.layer].vx?vs[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(rs.dragged.parentNode[lr],n,t,e,fs,vs[this.layer].el)||rr(vs[this.layer].el,n,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&p!==c&&(p=nr(p,!1)));bs=d}},30),ks=function(e){var t=e.originalEvent,n=e.putSortable,o=e.dragEl,i=e.activeSortable,r=e.dispatchSortableEvent,s=e.hideGhostForTarget,a=e.unhideGhostForTarget;if(t){var l=n||i;s();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function Es(){}function Ss(){}Es.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=Zi(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:ks},_i(Es,{pluginName:"revertOnSpill"}),Ss.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:ks},_i(Ss,{pluginName:"removeOnSpill"}),rs.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?qi(document,"dragover",this._handleAutoScroll):this.options.supportPointer?qi(document,"pointermove",this._handleFallbackAutoScroll):t.touches?qi(document,"touchmove",this._handleFallbackAutoScroll):qi(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?Fi(document,"dragover",this._handleAutoScroll):(Fi(document,"pointermove",this._handleFallbackAutoScroll),Fi(document,"touchmove",this._handleFallbackAutoScroll),Fi(document,"mousemove",this._handleFallbackAutoScroll)),xs(),ys(),clearTimeout(zi),zi=void 0},nulling:function(){fs=hs=ps=bs=ws=ms=gs=null,vs.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(o,i);if(fs=e,t||this.options.forceAutoScrollFallback||Pi||Ii||Mi){Cs(e,this.options,r,t);var s=nr(r,!0);!bs||ws&&o===ms&&i===gs||(ws&&xs(),ws=setInterval(function(){var r=nr(document.elementFromPoint(o,i),!0);r!==s&&(s=r,ys()),Cs(e,n.options,r,t)},10),ms=o,gs=i)}else{if(!this.options.bubbleScroll||nr(r,!0)===Ki())return void ys();Cs(e,this.options,nr(r,!1),!1)}}},_i(e,{pluginName:"scroll",initializeByDefault:!0})}),rs.mount(Ss,Es);const As={...Ze,elDivAddNewSection:".add-new-section",elSectionClone:".section.clone",elSectionTitleNewInput:".lp-section-title-new-input",elSectionTitleInput:".lp-section-title-input",etBtnEditTitle:".lp-btn-edit-section-title",elSectionDesInput:".lp-section-description-input",elBtnAddSection:".lp-btn-add-section",elBtnUpdateTitle:".lp-btn-update-section-title",elBtnUpdateDes:".lp-btn-update-section-description",elBtnCancelUpdateTitle:".lp-btn-cancel-update-section-title",elBtnCancelUpdateDes:".lp-btn-cancel-update-section-description",elBtnDeleteSection:".lp-btn-delete-section",elSectionDesc:".section-description",elSectionToggle:".section-toggle",elCountSections:".count-sections"};let{$3:Os,$g:Ts,hV:_s,P0:Ls,EO:Is,P9:Ps}=t;const Ds="edit-course-curriculum",Ms=e=>new Promise((t,n)=>{if(!e||""===e.trim())return;let o=document.querySelector(".curriculum-sections");const i=o.querySelector(As.elSectionClone);if(!i)return console.error("Cannot find section clone element in DOM!"),null;const r=i.cloneNode(!0);r.classList.remove("clone"),Is.lpShowHideEl(r,1),Is.lpSetLoadingEl(r,1);const s=r.querySelector(As.elSectionTitleInput);s&&(s.value=e),o.appendChild(r);const a={action:"add_section",course_id:Os,section_name:e,args:{id_url:Ds}},l={success:e=>{const{message:o,status:i,data:s}=e;if("error"===i)r.remove(),Ls(o,"error"),n(new Error(o));else if("success"===i){const{section:e}=s;r.dataset.sectionId=e?.section_id||"",Ls(o,i),t(r)}},error:e=>{r.remove(),Ls(e,"error"),n(e)},completed:()=>{Is.lpSetLoadingEl(r,0),r.classList.remove(As.elCollapse);const e=r.querySelector(As.elSectionDesInput);e&&e.focus(),(()=>{const e=Ts.querySelector(`${As.elCountSections}`),t=_s.querySelectorAll(`${As.elSection}:not(.clone)`).length;e.dataset.count=t,e.querySelector(".count").textContent=t})(),Je&&delete Je.titleNew}};window.lpAJAXG.fetchAJAX(a,l)}),Bs=(e,t)=>{if(!e||!t||""===t.trim())return;console.log(e.dataset);const n=e.querySelector("ul.section-list-items");if(!n)return;const o=n.querySelector("li.section-item.clone");if(!o)return;const i=o.cloneNode(!0);i.classList.remove("clone"),Is.lpShowHideEl(i,1);const r=i.querySelector(".lp-item-title-input");r&&(r.value=t),n.appendChild(i);const s=e.dataset.sectionId||"",a={action:"create_item_add_to_section",course_id:Os,section_id:s,item_title:t,item_type:"lp_lesson",args:{id_url:Ds}},l={success:e=>{const{message:t,status:n,data:o}=e;"error"===n?(i.remove(),Ls(t,"error"),console.log(error)):"success"===n&&(i.dataset.itemId=o.section_item.item_id||"",Ls(t,n))},error:e=>{i.remove(),Ls(e,"error"),console.log(e)},completed:()=>{Is.lpSetLoadingEl(i,0)}};return window.lpAJAXG.fetchAJAX(a,l),i};let Ns,$s,qs,Fs;const{__}=wp.i18n,js=()=>{const e=document.getElementById("lp-ai-branding-logo"),t=document.getElementById("logo-file-name");e&&t&&e.addEventListener("change",function(){this.files&&this.files.length>0?t.textContent=this.files[0].name:t.textContent=""})},Hs=()=>{const e=document.querySelector("#lp-edit-ai-course-title");Ns&&(Ns.style.display="none"),e&&(e.disabled=!1),document.body.style.overflow="visible"},Vs=()=>{const e=document.querySelector("#lp-edit-ai-course-description");$s&&($s.style.display="none"),e&&(e.disabled=!1),document.body.style.overflow="visible"},zs=()=>{const e=document.querySelector("#lp-edit-ai-course-feature-image");qs&&(qs.style.display="none"),e&&(e.disabled=!1),document.body.style.overflow="visible"},Rs=()=>{const e=document.querySelector("#lp-edit-ai-course-curriculum");Fs&&(Fs.style.display="none"),e&&(e.disabled=!1),document.body.style.overflow="visible"};document.addEventListener("click",function(e){const t=e.target,n=document.getElementById("lp-ai-output-count"),o=document.getElementById("lp-course-description-ai-output-count"),i=document.getElementById("lp-ai-feature-image-output-count"),r=document.getElementById("lp-ai-course-curriculum-output-count");let s=parseInt(n.textContent,10),a=parseInt(o.textContent,10),l=parseInt(r.textContent,10),c=i?parseInt(i.textContent,10):0;"lp-ai-minus-output-button"===t.id?s>1&&(s--,n.textContent=s.toString().padStart(2,"0")):"lp-ai-plus-output-button"===t.id?s<99&&(s++,n.textContent=s.toString().padStart(2,"0")):"lp-course-description-ai-plus-output-button"===t.id?a<99&&(a++,o.textContent=a.toString().padStart(2,"0")):"lp-course-description-ai-minus-output-button"===t.id?a<99&&(a--,o.textContent=a.toString().padStart(2,"0")):"lp-ai-plus-output-button-feature-image"===t.id?c<99&&(c++,i.textContent=c.toString().padStart(2,"0")):"lp-ai-minus-output-button-feature-image"===t.id?c<99&&(c--,i.textContent=c.toString().padStart(2,"0")):"lp-ai-curriculum-plus-output-button"===t.id?l<99&&(l++,r.textContent=l.toString().padStart(2,"0")):"lp-ai-curriculum-minus-output-button"===t.id&&l<99&&(l--,r.textContent=l.toString().padStart(2,"0"))});const Xs=()=>{document.querySelectorAll("select.lp-tom-select").forEach(e=>{e.tomselect&&e.tomselect.destroy();const t={maxOptions:null,plugins:e.multiple?["no_backspace_delete","remove_button","dropdown_input","change_listener"]:["dropdown_input"]};new be(e,t)}),Ns=document.getElementById("lp-ai-course-title-modal-wrapper"),$s=document.getElementById("lp-ai-course-description-modal-wrapper"),qs=document.getElementById("lp-ai-course-feature-image-modal-wrapper"),Fs=document.getElementById("lp-ai-course-curriculum-modal-wrapper"),(()=>{const e=document.querySelector("body.post-type-lp_course #titlewrap");e?e.insertAdjacentHTML("afterend",'<button type="button" class="button" id="lp-edit-ai-course-title">'+__("Edit with AI","learnpress")+"</button>"):console.warn("Title wrap element not found for adding AI button.");const t=document.querySelector("body.post-type-lp_course #insert-media-button");t?t.insertAdjacentHTML("afterend",'<button type="button" class="button" id="lp-edit-ai-course-description">'+__("Edit with AI","learnpress")+"</button>"):console.warn("Title wrap element not found for adding AI button.");const n=document.querySelector("body.post-type-lp_course #set-post-thumbnail");n?n.insertAdjacentHTML("afterend",'<button type="button" class="button" id="lp-edit-ai-course-feature-image">'+__("Edit with AI","learnpress")+"</button>"):console.warn("Title wrap element not found for adding AI button.");const o=document.querySelector("#course-editor");o&&setTimeout(()=>{if(!o.querySelector(".postbox-header > h2.hndle.ui-sortable-handle"))return;const e=document.createElement("button");e.type="button",e.className="button",e.id="lp-edit-ai-course-curriculum",e.textContent=__("Edit with AI","learnpress");const t=o.querySelector(".handle-actions");t&&t.prepend(e)},2e3)})(),Ns?$s&&qs?(document.addEventListener("click",function(e){const t=e.target;"lp-edit-ai-course-title"===t.id&&(Ns&&(Ns.style.display="flex"),t.disabled=!0,document.querySelector("body").style.overflow="hidden"),"lp-edit-ai-course-description"===t.id&&($s&&($s.style.display="flex"),t.disabled=!0,document.querySelector("body").style.overflow="hidden"),"lp-edit-ai-course-feature-image"===t.id&&(qs&&(qs.style.display="flex"),t.disabled=!0,document.querySelector("body").style.overflow="hidden"),"lp-edit-ai-course-curriculum"===t.id&&(Fs&&(Fs.style.display="flex"),t.disabled=!0,document.querySelector("body").style.overflow="hidden")}),window._lpCloseModalHandlersAdded||(document.addEventListener("click",e=>{const t=e.target;(t.classList.contains("close-button")&&t.closest("#lp-ai-course-title-modal")||t.classList.contains("create-course-modal-wrapper"))&&Hs(),(t.classList.contains("close-button")&&t.closest("#lp-ai-course-description-modal")||t.classList.contains("create-course-modal-wrapper"))&&Vs(),(t.classList.contains("close-button")&&t.closest("#lp-ai-course-feature-image-modal-wrapper")||t.classList.contains("create-course-modal-wrapper"))&&zs(),(t.classList.contains("close-button")&&t.closest("#lp-ai-course-curriculum-modal-wrapper")||t.classList.contains("create-course-modal-wrapper"))&&Rs()}),document.addEventListener("keydown",e=>{"Escape"===e.key&&(Ns||$s)&&(Hs(),Vs(),zs(),Rs())}),window._lpCloseModalHandlersAdded=!0),(()=>{document.addEventListener("click",function(i){const r=i.target;"generate-button lp-ai-generate-button"===r.getAttribute("class")&&e(r),"generate-button lp-ai-generate-course-description"===r.getAttribute("class")&&t(r),"generate-button lp-ai-generate-course-feature-image"===r.getAttribute("class")&&o(r),"generate-button lp-ai-generate-course-curriculum"===r.getAttribute("class")&&n(r)});const e=e=>{var t,n,o,i,r;const s=e.closest("#lp-ai-course-title-modal");if(!s)return;const a=s.querySelector(".prompt-output"),l=document.querySelector("#lp-ai-output-prompt-desc"),c=document.querySelector("#lp-ai-output-prompt"),d=s.querySelector("#lp-ai-output-suggestion"),u=s.querySelector(".content");e.disabled=!0,a&&(a.classList.remove("active"),a.style.display="none"),d&&(d.innerHTML=""),u&&(u.style.opacity=.6);const p=s.querySelector("#lp-ai-course-title-field-topic"),h=s.querySelector("#lp-ai-course-goals"),m=document.getElementById("lp-ai-audience"),g=document.getElementById("lp-ai-tone"),f=document.getElementById("lp-ai-output-language"),w=s.querySelector("#lp-ai-output-count"),v=s.querySelector("#lp-ai-output-prompt-desc")?.value.trim();let b={type:"course-title",topic:null!==(t=p.value)&&void 0!==t?t:"",goal:null!==(n=h.value)&&void 0!==n?n:"",audience:null!==(o=m?.tomselect?.getValue())&&void 0!==o?o:[],tone:null!==(i=g?.tomselect?.getValue())&&void 0!==i?i:[],lang:null!==(r=[f?.tomselect?.getValue()])&&void 0!==r?r:[],outputs:w?parseInt(w.textContent):1,prompt:v};wp.apiFetch({path:"/lp/v1/open-ai/generate-text",method:"POST",data:b}).then(e=>{if(e.data&&e.data.prompt&&l&&!b.prompt&&(l.value=e.data.prompt.replace(/\\n/g,"\n"),c&&!c.querySelector(".lp-ai-generate-button")&&c.insertAdjacentHTML("beforeend",'<button type="button" class="generate-button lp-ai-generate-button"> '+__("Generate","learnpress")+"</button>")),"success"===e.status&&e.data.content&&d){let t="";e.data.content.forEach(e=>{t+='<div class="output-item output-suggestion" bis_skin_checked="1">\n\t\t\t\t\t\t\t\t<textarea >'+e+'</textarea>\n\t\t\t\t\t\t\t\t<div class="output-actions" bis_skin_checked="1">\n\t\t\t\t\t\t\t\t\t<button class="action-button copy-button">Copy</button>\n\t\t\t\t\t\t\t\t\t<button class="action-button apply-button">Apply</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>'}),d.innerHTML=t}e.msg&&"error"===e.status&&d&&(d.innerHTML=`<div class="error">${e.msg}</div>`)}).catch(e=>{console.error("API Fetch Error:",e),d&&(d.innerHTML=`<div class="error"> ${__("An error occurred during generation.","learnpress")} </div>`)}).finally(()=>{e&&(e.disabled=!1),u&&(u.style.opacity=1)})},t=e=>{var t,n,o,i,r;const s=e.closest("#lp-ai-course-description-modal");if(!s)return;const a=s.querySelector(".prompt-output"),l=document.querySelector("#lp-course-description-ai-output-prompt-desc"),c=document.querySelector("#lp-ai-output-prompt-desc-modal-course-description"),d=s.querySelector("#lp-course-description-ai-output-suggestion"),u=s.querySelector(".content");e.disabled=!0,a&&(a.classList.remove("active"),a.style.display="none"),d&&(d.innerHTML=""),u&&(u.style.opacity=.6);const p=s.querySelector("#lp-ai-course-description-field-topic"),h=document.getElementById("lp-course-description-ai-audience"),m=document.getElementById("lp-course-description-ai-tone"),g=document.getElementById("lp-course-description-ai-output-language"),f=s.querySelector("#lp-course-description-ai-output-count"),w=s.querySelector("#lp-course-description-ai-output-prompt-desc")?.value.trim(),v=document.querySelector("#post-body-content #title");let b={type:"course-description",topic:null!==(t=p.value)&&void 0!==t?t:"",audience:null!==(n=h?.tomselect?.getValue())&&void 0!==n?n:[],tone:null!==(o=m?.tomselect?.getValue())&&void 0!==o?o:[],lang:null!==(i=[g?.tomselect?.getValue()])&&void 0!==i?i:[],outputs:f?parseInt(f.textContent):1,prompt:w,title:null!==(r=v.value)&&void 0!==r?r:""};wp.apiFetch({path:"/lp/v1/open-ai/generate-text",method:"POST",data:b}).then(e=>{if(e.data&&e.data.prompt&&l&&!b.prompt&&(l.value=e.data.prompt.replace(/\\n/g,"\n"),c&&!c.querySelector(".lp-ai-generate-course-description")&&c.insertAdjacentHTML("beforeend",'<button type="button" class="generate-button lp-ai-generate-course-description"> '+__("Generate","learnpress")+"</button>")),"success"===e.status&&e.data.content&&d){let t="";e.data.content.forEach(e=>{t+='<div class="output-item output-suggestion" bis_skin_checked="1">\n\t\t\t\t\t\t\t\t<textarea >'+e+'</textarea>\n\t\t\t\t\t\t\t\t<div class="output-actions" bis_skin_checked="1">\n\t\t\t\t\t\t\t\t\t<button class="action-button copy-button-desc">Copy</button>\n\t\t\t\t\t\t\t\t\t<button class="action-button apply-button-desc">Apply</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>'}),d.innerHTML=t}e.msg&&"error"===e.status&&d&&(d.innerHTML=`<div class="error">${e.msg}</div>`)}).catch(e=>{console.error("API Fetch Error:",e),d&&(d.innerHTML=`<div class="error"> ${__("An error occurred during generation.","learnpress")} </div>`)}).finally(()=>{e&&(e.disabled=!1),u&&(u.style.opacity=1)})},n=e=>{var t,n,o,i,r,s,a;const l=e.closest("#lp-ai-course-curriculum-modal");if(!l)return;const c=document.querySelector("#lp-ai-output-prompt-curriculum-modal-course-description"),d=document.querySelector("#lp-course-description-ai-output-prompt-curriculum"),u=l.querySelector("#lp-course-curriculum-ai-output-suggestion"),p=l.querySelector("#lp-ai-course-curriculum-sections"),h=document.getElementById("lp-ai-course-curriculum-lessons"),m=document.getElementById("lp-ai-course-curriculum-levels"),g=document.getElementById("lp-ai-course-curriculum-specific-key-topics"),f=document.getElementById("lp-course-curriculum-output-language"),w=l.querySelector("#lp-ai-course-curriculum-output-count"),v=l.querySelector("#lp-course-description-ai-output-prompt-desc")?.value.trim(),b=document.querySelector("#post-body-content #title"),y=document.querySelector("#post-body-content #content");let x={type:"course-curriculum",section_number:null!==(t=p.value)&&void 0!==t?t:"",topic:null!==(n=g.value)&&void 0!==n?n:"",less_per_section:null!==(o=h.value)&&void 0!==o?o:"",level:null!==(i=m?.tomselect?.getValue())&&void 0!==i?i:[],lang:null!==(r=[f?.tomselect?.getValue()])&&void 0!==r?r:[],outputs:w?parseInt(w.textContent):1,prompt:v,title:null!==(s=b.value)&&void 0!==s?s:"",description:null!==(a=y.value)&&void 0!==a?a:""};wp.apiFetch({path:"/lp/v1/open-ai/generate-text",method:"POST",data:x}).then(e=>{if(e.data&&e.data.prompt&&d&&!x.prompt&&(d.value=e.data.prompt.replace(/\\n/g,"\n"),c&&!c.querySelector(".lp-ai-generate-course-description")&&c.insertAdjacentHTML("beforeend",'<button type="button" class="generate-button lp-ai-generate-course-description"> '+__("Generate","learnpress")+"</button>")),"success"===e.status&&e.data.content&&e.data.content.length>0){let t="";e.data.content.forEach((n,o)=>{t+=`<div class="output-item output-suggestion" data-lessons='${JSON.stringify(e.data.sections[o])}'>\n\t\t\t\t\t\t\t <textarea>${n}</textarea>\n\t\t\t\t\t\t\t <div class="output-actions">\n\t\t\t\t\t\t\t\t <button class="action-button copy-button-curriculum">Copy</button>\n\t\t\t\t\t\t\t\t <button class="action-button apply-button-curriculum">Apply</button>\n\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t </div>`}),u.innerHTML=t}e.msg&&"error"===e.status&&u&&(u.innerHTML=`<div class="error">${e.msg}</div>`)}).catch(e=>{console.error("API Fetch Error:",e),u&&(u.innerHTML=`<div class="error"> ${__("An error occurred during generation.","learnpress")} </div>`)}).finally(()=>{e&&(e.disabled=!1)})},o=e=>{var t,n,o,i;const r=e.closest("#lp-ai-course-feature-image-modal");if(!r)return;const s=r.querySelector(".prompt-output"),a=document.querySelector("#lp-course-feature-image-ai-output-prompt-desc"),l=document.querySelector("#lp-ai-output-prompt-desc-modal-course-feature-image"),c=r.querySelector("#lp-course-feature-image-ai-output-suggestion"),d=r.querySelector(".content");e.disabled=!0,s&&(s.classList.remove("active"),s.style.display="none"),c&&(c.innerHTML=""),d&&(d.style.opacity=.6);const u=r.querySelector("#lp-ai-image-desc"),p=document.getElementById("lp-ai-image-style"),h=document.getElementById("lp-ai-image-size"),m=r.querySelector("#lp-ai-feature-image-output-count"),g=r.querySelector("#lp-course-feature-image-ai-output-prompt-desc")?.value.trim(),f=document.querySelector("#post-body-content #title"),w=tinymce.get("content");let v={type:"course-feature-image",topic:null!==(t=u.value)&&void 0!==t?t:"",style:null!==(n=p?.tomselect?.getValue())&&void 0!==n?n:[],size:null!==(o=[h?.tomselect?.getValue()])&&void 0!==o?o:[],outputs:m?parseInt(m.textContent):1,prompt:g,title:null!==(i=f.value)&&void 0!==i?i:"",description:null!=w?w:""};wp.apiFetch({path:"/lp/v1/open-ai/create-feature-image",method:"POST",data:v}).then(e=>{if(e.data&&e.data.prompt&&a&&!v.prompt&&(a.value=e.data.prompt.replace(/\\n/g,"\n"),l&&!l.querySelector(".lp-course-feature-image-ai-output-prompt-desc")&&l.insertAdjacentHTML("beforeend",'<button type="button" class="generate-button lp-ai-generate-course-feature-image"> '+__("Generate","learnpress")+"</button>")),"success"===e.status&&e.data.urls&&c){let t="";e.data.urls.forEach(e=>{t+=`<div class="output-placeholder" style="background-image: url('${e}');">\n\t\t\t\t\t\t\t\t<div class="output-actions">\n\t\t\t\t\t\t\t\t\t<button class="action-button">Copy</button>\n\t\t\t\t\t\t\t\t\t<button class="action-button apply-button apply-feature-image">Apply</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>`}),c.innerHTML=t}e.msg&&"error"===e.status&&c&&(c.innerHTML=`<div class="error">${e.msg}</div>`)}).catch(e=>{console.error("API Fetch Error:",e),c&&(c.innerHTML=`<div class="error"> ${__("An error occurred during generation.","learnpress")} </div>`)}).finally(()=>{e&&(e.disabled=!1),d&&(d.style.opacity=1)})}})(),document.addEventListener("click",function(e){const t=e.target;if(t.classList.contains("copy-button")||t.classList.contains("copy-button-desc")){const e=t.closest(".output-item");if(!e)return;const n=e.querySelector("textarea");if(!n)return void console.warn("Textarea not found in selected output item.");let o=n.value.trim();window.isSecureContext&&navigator.clipboard&&(t.disabled=!0,navigator.clipboard.writeText(o).then(()=>{t.innerHTML=__("Copied","learnpress"),setTimeout(()=>{t.innerHTML=__("Copy","learnpress"),t.disabled=!1},1e3)}).catch(e=>{console.error(__("Failed to copy text: ","learnpress"),e)}))}}),(()=>{document.addEventListener("click",function(t){const r=t.target;r.classList.contains("apply-button")&&e(r),r.classList.contains("apply-button-desc")&&n(r),r.classList.contains("apply-feature-image")&&o(r),r.classList.contains("apply-button-curriculum")&&i(r)});const e=e=>{const t=e.closest(".output-item");if(!t)return;const n=document.querySelector("#post-body-content #title");if(!n)return void console.warn("WordPress post title input (#title) not found.");const o=t.querySelector("textarea");o?(n.value=o.value.trim(),e.innerHTML=__("Applied","learnpress"),e.disabled=!0,setTimeout(()=>{e.innerHTML=__("Apply","learnpress"),e.disabled=!1,Hs()},1e3)):console.warn("Textarea not found in selected output item.")},n=e=>{const t=e.closest(".output-item");if(!t)return;const n=t.querySelector("textarea");n?(tinymce.get("content").setContent(n.value.trim()),e.innerHTML=__("Applied","learnpress"),e.disabled=!0,setTimeout(()=>{e.innerHTML=__("Apply","learnpress"),e.disabled=!1,Vs()},1e3)):console.warn("Textarea not found in selected output item.")},o=e=>{if(!e.closest("#lp-ai-course-feature-image-modal-wrapper"))return;zs();const t=document.querySelector("#post_ID").value,n=e.closest(".output-placeholder");if(!n)return;const o=window.getComputedStyle(n).backgroundImage.match(/url\(["']?(.*?)["']?\)/),i=o?.[1];if(!i)return;let r={image_url:i,post_id:null!=t?t:0};const s=document.getElementById("remove-post-thumbnail");s&&(s.click(),console.log("Featured image removed.")),wp.apiFetch({path:"/lp/v1/open-ai/save-feature-image",method:"POST",data:r}).then(e=>{"success"===e.status?setTimeout(()=>{location.reload()},1e3):console.log(e.message)}).catch(e=>{console.error("API Fetch Error:",e)}).finally(()=>{})},i=async e=>{const n=document.querySelector(Ze.idElEditCurriculum),o=window.lpAJAXG.getDataSetCurrent(document.querySelector(Ze.LPTarget));if(!n)return void console.error("Error: Curriculum container element not found on the page.");tt({elEditCurriculum:n,courseId:o.args.course_id,elCurriculumSections:n.querySelector(Ze.elCurriculumSections)}),({$3:Os,$g:Ts,hV:_s,P0:Ls,EO:Is,P9:Ps}=t);const i=e.closest(".output-item");if(!i)return;if(!e.closest("#lp-ai-course-curriculum-modal-wrapper"))return;Rs();const r=i.getAttribute("data-lessons");if(r)try{const e=JSON.parse(JSON.parse(r));for(const t of e.sections||e.sections){const e=await Ms(t.section_title);e&&t.lessons?.length>0&&t.lessons.forEach(t=>{Bs(e,t.lesson_title)})}}catch(e){console.error("JSON parse error:",e)}else console.warn("Attribute data-lessons not found")}})(),js()):console.error("AI Course Content Modal wrapper not found."):console.error("AI Course Title Modal wrapper not found.")};document.addEventListener("DOMContentLoaded",function(e){Xs()})})()})();