=0)&&Object.prototype.propertyIsEnumerable.call(u,l)&&(a[l]=u[l])}return a}var Ih="1.15.2";function cn(u){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(u)}var hn=cn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Si=cn(/Edge/i),mf=cn(/firefox/i),bi=cn(/safari/i)&&!cn(/chrome/i)&&!cn(/android/i),Lf=cn(/iP(ad|od|hone)/i),Sf=cn(/chrome/i)&&cn(/android/i),Tf={capture:!1,passive:!1};function ke(u,o,a){u.addEventListener(o,a,!hn&&Tf)}function Se(u,o,a){u.removeEventListener(o,a,!hn&&Tf)}function No(u,o){if(o){if(o[0]===">"&&(o=o.substring(1)),u)try{if(u.matches)return u.matches(o);if(u.msMatchesSelector)return u.msMatchesSelector(o);if(u.webkitMatchesSelector)return u.webkitMatchesSelector(o)}catch(a){return!1}return!1}}function Oh(u){return u.host&&u!==document&&u.host.nodeType?u.host:u.parentNode}function $t(u,o,a,l){if(u){a=a||document;do{if(o!=null&&(o[0]===">"?u.parentNode===a&&No(u,o):No(u,o))||l&&u===a)return u;if(u===a)break}while(u=Oh(u))}return null}var gf=/\s+/g;function Ot(u,o,a){if(u&&o)if(u.classList)u.classList[a?"add":"remove"](o);else{var l=(" "+u.className+" ").replace(gf," ").replace(" "+o+" "," ");u.className=(l+(a?" "+o:"")).replace(gf," ")}}function ce(u,o,a){var l=u&&u.style;if(l){if(a===void 0)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(u,""):u.currentStyle&&(a=u.currentStyle),o===void 0?a:a[o];!(o in l)&&o.indexOf("webkit")===-1&&(o="-webkit-"+o),l[o]=a+(typeof a=="string"?"":"px")}}function Mr(u,o){var a="";if(typeof u=="string")a=u;else do{var l=ce(u,"transform");l&&l!=="none"&&(a=l+" "+a)}while(!o&&(u=u.parentNode));var c=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return c&&new c(a)}function Cf(u,o,a){if(u){var l=u.getElementsByTagName(o),c=0,p=l.length;if(a)for(;c=p:m=c<=p,!m)return l;if(l===tn())break;l=Dn(l,!1)}return!1}function Dr(u,o,a,l){for(var c=0,p=0,m=u.children;p2&&arguments[2]!==void 0?arguments[2]:{},c=l.evt,p=Nh(l,Gh);Ti.pluginEvent.bind(de)(o,a,nn({dragEl:Z,parentEl:je,ghostEl:ve,rootEl:We,nextEl:$n,lastDownEl:Mo,cloneEl:Ue,cloneHidden:Mn,dragStarted:gi,putSortable:ht,activeSortable:de.active,originalEvent:c,oldIndex:kr,oldDraggableIndex:wi,newIndex:Ft,newDraggableIndex:kn,hideGhostForTarget:Of,unhideGhostForTarget:Ff,cloneNowHidden:function(){Mn=!0},cloneNowShown:function(){Mn=!1},dispatchSortableEvent:function(v){St({sortable:a,name:v,originalEvent:c})}},p))};function St(u){_h(nn({putSortable:ht,cloneEl:Ue,targetEl:Z,rootEl:We,oldIndex:kr,oldDraggableIndex:wi,newIndex:Ft,newDraggableIndex:kn},u))}var Z,je,ve,We,$n,Mo,Ue,Mn,kr,Ft,wi,kn,Lo,ht,Cr=!1,Io=!1,Oo=[],Xn,Kt,Ts,Cs,bf,xf,gi,Tr,Ei,Li=!1,So=!1,Do,vt,ks=[],Ns=!1,Fo=[],Bo=typeof document!="undefined",To=Lf,wf=Si||hn?"cssFloat":"float",Uh=Bo&&!Sf&&!Lf&&"draggable"in document.createElement("div"),Hf=function(){if(Bo){if(hn)return!1;var u=document.createElement("x");return u.style.cssText="pointer-events:auto",u.style.pointerEvents==="auto"}}(),Nf=function(o,a){var l=ce(o),c=parseInt(l.width)-parseInt(l.paddingLeft)-parseInt(l.paddingRight)-parseInt(l.borderLeftWidth)-parseInt(l.borderRightWidth),p=Dr(o,0,a),m=Dr(o,1,a),v=p&&ce(p),b=m&&ce(m),x=v&&parseInt(v.marginLeft)+parseInt(v.marginRight)+Je(p).width,L=b&&parseInt(b.marginLeft)+parseInt(b.marginRight)+Je(m).width;if(l.display==="flex")return l.flexDirection==="column"||l.flexDirection==="column-reverse"?"vertical":"horizontal";if(l.display==="grid")return l.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(p&&v.float&&v.float!=="none"){var k=v.float==="left"?"left":"right";return m&&(b.clear==="both"||b.clear===k)?"vertical":"horizontal"}return p&&(v.display==="block"||v.display==="flex"||v.display==="table"||v.display==="grid"||x>=c&&l[wf]==="none"||m&&l[wf]==="none"&&x+L>c)?"vertical":"horizontal"},qh=function(o,a,l){var c=l?o.left:o.top,p=l?o.right:o.bottom,m=l?o.width:o.height,v=l?a.left:a.top,b=l?a.right:a.bottom,x=l?a.width:a.height;return c===v||p===b||c+m/2===v+x/2},jh=function(o,a){var l;return Oo.some(function(c){var p=c[Pt].options.emptyInsertThreshold;if(!(!p||Ps(c))){var m=Je(c),v=o>=m.left-p&&o<=m.right+p,b=a>=m.top-p&&a<=m.bottom+p;if(v&&b)return l=c}}),l},If=function(o){function a(p,m){return function(v,b,x,L){var k=v.options.group.name&&b.options.group.name&&v.options.group.name===b.options.group.name;if(p==null&&(m||k))return!0;if(p==null||p===!1)return!1;if(m&&p==="clone")return p;if(typeof p=="function")return a(p(v,b,x,L),m)(v,b,x,L);var F=(m?v:b).options.group.name;return p===!0||typeof p=="string"&&p===F||p.join&&p.indexOf(F)>-1}}var l={},c=o.group;(!c||ko(c)!="object")&&(c={name:c}),l.name=c.name,l.checkPull=a(c.pull,!0),l.checkPut=a(c.put),l.revertClone=c.revertClone,o.group=l},Of=function(){!Hf&&ve&&ce(ve,"display","none")},Ff=function(){!Hf&&ve&&ce(ve,"display","")};Bo&&!Sf&&document.addEventListener("click",function(u){if(Io)return u.preventDefault(),u.stopPropagation&&u.stopPropagation(),u.stopImmediatePropagation&&u.stopImmediatePropagation(),Io=!1,!1},!0);var Kn=function(o){if(Z){o=o.touches?o.touches[0]:o;var a=jh(o.clientX,o.clientY);if(a){var l={};for(var c in o)o.hasOwnProperty(c)&&(l[c]=o[c]);l.target=l.rootEl=a,l.preventDefault=void 0,l.stopPropagation=void 0,a[Pt]._onDragOver(l)}}},Yh=function(o){Z&&Z.parentNode[Pt]._isOutsideThisEl(o.target)};function de(u,o){if(!(u&&u.nodeType&&u.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(u));this.el=u,this.options=o=dn({},o),u[Pt]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(u.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Nf(u,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(m,v){m.setData("Text",v.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:de.supportPointer!==!1&&"PointerEvent"in window&&!bi,emptyInsertThreshold:5};Ti.initializePlugins(this,u,a);for(var l in a)!(l in o)&&(o[l]=a[l]);If(o);for(var c in this)c.charAt(0)==="_"&&typeof this[c]=="function"&&(this[c]=this[c].bind(this));this.nativeDraggable=o.forceFallback?!1:Uh,this.nativeDraggable&&(this.options.touchStartThreshold=1),o.supportPointer?ke(u,"pointerdown",this._onTapStart):(ke(u,"mousedown",this._onTapStart),ke(u,"touchstart",this._onTapStart)),this.nativeDraggable&&(ke(u,"dragover",this),ke(u,"dragenter",this)),Oo.push(this.el),o.store&&o.store.get&&this.sort(o.store.get(this)||[]),dn(this,Rh())}de.prototype={constructor:de,_isOutsideThisEl:function(o){!this.el.contains(o)&&o!==this.el&&(Tr=null)},_getDirection:function(o,a){return typeof this.options.direction=="function"?this.options.direction.call(this,o,a,Z):this.options.direction},_onTapStart:function(o){if(o.cancelable){var a=this,l=this.el,c=this.options,p=c.preventOnFilter,m=o.type,v=o.touches&&o.touches[0]||o.pointerType&&o.pointerType==="touch"&&o,b=(v||o).target,x=o.target.shadowRoot&&(o.path&&o.path[0]||o.composedPath&&o.composedPath()[0])||b,L=c.filter;if(ep(l),!Z&&!(/mousedown|pointerdown/.test(m)&&o.button!==0||c.disabled)&&!x.isContentEditable&&!(!this.nativeDraggable&&bi&&b&&b.tagName.toUpperCase()==="SELECT")&&(b=$t(b,c.draggable,l,!1),!(b&&b.animated)&&Mo!==b)){if(kr=Wt(b),wi=Wt(b,c.draggable),typeof L=="function"){if(L.call(this,o,b,this)){St({sortable:a,rootEl:x,name:"filter",targetEl:b,toEl:l,fromEl:l}),At("filter",a,{evt:o}),p&&o.cancelable&&o.preventDefault();return}}else if(L&&(L=L.split(",").some(function(k){if(k=$t(x,k.trim(),l,!1),k)return St({sortable:a,rootEl:k,name:"filter",targetEl:b,fromEl:l,toEl:l}),At("filter",a,{evt:o}),!0}),L)){p&&o.cancelable&&o.preventDefault();return}c.handle&&!$t(x,c.handle,l,!1)||this._prepareDragStart(o,v,b)}}},_prepareDragStart:function(o,a,l){var c=this,p=c.el,m=c.options,v=p.ownerDocument,b;if(l&&!Z&&l.parentNode===p){var x=Je(l);if(We=p,Z=l,je=Z.parentNode,$n=Z.nextSibling,Mo=l,Lo=m.group,de.dragged=Z,Xn={target:Z,clientX:(a||o).clientX,clientY:(a||o).clientY},bf=Xn.clientX-x.left,xf=Xn.clientY-x.top,this._lastX=(a||o).clientX,this._lastY=(a||o).clientY,Z.style["will-change"]="all",b=function(){if(At("delayEnded",c,{evt:o}),de.eventCanceled){c._onDrop();return}c._disableDelayedDragEvents(),!mf&&c.nativeDraggable&&(Z.draggable=!0),c._triggerDragStart(o,a),St({sortable:c,name:"choose",originalEvent:o}),Ot(Z,m.chosenClass,!0)},m.ignore.split(",").forEach(function(L){Cf(Z,L.trim(),Ms)}),ke(v,"dragover",Kn),ke(v,"mousemove",Kn),ke(v,"touchmove",Kn),ke(v,"mouseup",c._onDrop),ke(v,"touchend",c._onDrop),ke(v,"touchcancel",c._onDrop),mf&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),At("delayStart",this,{evt:o}),m.delay&&(!m.delayOnTouchOnly||a)&&(!this.nativeDraggable||!(Si||hn))){if(de.eventCanceled){this._onDrop();return}ke(v,"mouseup",c._disableDelayedDrag),ke(v,"touchend",c._disableDelayedDrag),ke(v,"touchcancel",c._disableDelayedDrag),ke(v,"mousemove",c._delayedDragTouchMoveHandler),ke(v,"touchmove",c._delayedDragTouchMoveHandler),m.supportPointer&&ke(v,"pointermove",c._delayedDragTouchMoveHandler),c._dragStartTimer=setTimeout(b,m.delay)}else b()}},_delayedDragTouchMoveHandler:function(o){var a=o.touches?o.touches[0]:o;Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Ms(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var o=this.el.ownerDocument;Se(o,"mouseup",this._disableDelayedDrag),Se(o,"touchend",this._disableDelayedDrag),Se(o,"touchcancel",this._disableDelayedDrag),Se(o,"mousemove",this._delayedDragTouchMoveHandler),Se(o,"touchmove",this._delayedDragTouchMoveHandler),Se(o,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(o,a){a=a||o.pointerType=="touch"&&o,!this.nativeDraggable||a?this.options.supportPointer?ke(document,"pointermove",this._onTouchMove):a?ke(document,"touchmove",this._onTouchMove):ke(document,"mousemove",this._onTouchMove):(ke(Z,"dragend",this),ke(We,"dragstart",this._onDragStart));try{document.selection?Ao(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(l){}},_dragStarted:function(o,a){if(Cr=!1,We&&Z){At("dragStarted",this,{evt:a}),this.nativeDraggable&&ke(document,"dragover",Yh);var l=this.options;!o&&Ot(Z,l.dragClass,!1),Ot(Z,l.ghostClass,!0),de.active=this,o&&this._appendGhost(),St({sortable:this,name:"start",originalEvent:a})}else this._nulling()},_emulateDragOver:function(){if(Kt){this._lastX=Kt.clientX,this._lastY=Kt.clientY,Of();for(var o=document.elementFromPoint(Kt.clientX,Kt.clientY),a=o;o&&o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(Kt.clientX,Kt.clientY),o!==a);)a=o;if(Z.parentNode[Pt]._isOutsideThisEl(o),a)do{if(a[Pt]){var l=void 0;if(l=a[Pt]._onDragOver({clientX:Kt.clientX,clientY:Kt.clientY,target:o,rootEl:a}),l&&!this.options.dragoverBubble)break}o=a}while(a=a.parentNode);Ff()}},_onTouchMove:function(o){if(Xn){var a=this.options,l=a.fallbackTolerance,c=a.fallbackOffset,p=o.touches?o.touches[0]:o,m=ve&&Mr(ve,!0),v=ve&&m&&m.a,b=ve&&m&&m.d,x=To&&vt&&yf(vt),L=(p.clientX-Xn.clientX+c.x)/(v||1)+(x?x[0]-ks[0]:0)/(v||1),k=(p.clientY-Xn.clientY+c.y)/(b||1)+(x?x[1]-ks[1]:0)/(b||1);if(!de.active&&!Cr){if(l&&Math.max(Math.abs(p.clientX-this._lastX),Math.abs(p.clientY-this._lastY))=0&&(St({rootEl:je,name:"add",toEl:je,fromEl:We,originalEvent:o}),St({sortable:this,name:"remove",toEl:je,originalEvent:o}),St({rootEl:je,name:"sort",toEl:je,fromEl:We,originalEvent:o}),St({sortable:this,name:"sort",toEl:je,originalEvent:o})),ht&&ht.save()):Ft!==kr&&Ft>=0&&(St({sortable:this,name:"update",toEl:je,originalEvent:o}),St({sortable:this,name:"sort",toEl:je,originalEvent:o})),de.active&&((Ft==null||Ft===-1)&&(Ft=kr,kn=wi),St({sortable:this,name:"end",toEl:je,originalEvent:o}),this.save()))),this._nulling()},_nulling:function(){At("nulling",this),We=Z=je=ve=$n=Ue=Mo=Mn=Xn=Kt=gi=Ft=kn=kr=wi=Tr=Ei=ht=Lo=de.dragged=de.ghost=de.clone=de.active=null,Fo.forEach(function(o){o.checked=!0}),Fo.length=Ts=Cs=0},handleEvent:function(o){switch(o.type){case"drop":case"dragend":this._onDrop(o);break;case"dragenter":case"dragover":Z&&(this._onDragOver(o),Xh(o));break;case"selectstart":o.preventDefault();break}},toArray:function(){for(var o=[],a,l=this.el.children,c=0,p=l.length,m=this.options;cc.right+p||u.clientY>l.bottom&&u.clientX>l.left:u.clientY>c.bottom+p||u.clientX>l.right&&u.clientY>l.top}function Zh(u,o,a,l,c,p,m,v){var b=l?u.clientY:u.clientX,x=l?a.height:a.width,L=l?a.top:a.left,k=l?a.bottom:a.right,F=!1;if(!m){if(v&&DoL+x*p/2:bk-Do)return-Ei}else if(b>L+x*(1-c)/2&&bk-x*p/2)?b>L+x/2?1:-1:0}function Jh(u){return Wt(Z)b(x)),Ro.create(o,{handle:".sortable-handle",forceFallback:!0});function c(x){let L=x.cloneNode(!0),k=x.parentNode;m(L),b(L),x.nextSibling?k.insertBefore(L,x.nextSibling):k.appendChild(L)}function p(x){let L=x.parentNode;ie(".form-input-array-row",L).length>1?L.removeChild(x):m(x)}function m(x){if(a){let k=D(".form-input-array-key",x);k.value="",k.removeAttribute("value")}let L=D(".form-input-array-value",x);L.value="",L.removeAttribute("value"),L.name=`${l}[]`}function v(x){let L=D(".form-input-array-key",x),k=D(".form-input-array-value",x);k.name=`${l}[${L.value.trim()}]`}function b(x){let L=D(".form-input-array-add",x),k=D(".form-input-array-remove",x);if(L.addEventListener("click",c.bind(L,x)),k.addEventListener("click",p.bind(k,x)),a){let F=D(".form-input-array-key",x),O=D(".form-input-array-value",x);F.addEventListener("keyup",v.bind(F,x)),O.addEventListener("keyup",v.bind(O,x))}}}};var Ws=new Map;function Ci(u,o){if(Ws.has(u)){o(Ws.get(u));return}let a=new XMLHttpRequest;a.onload=function(){let l=this.status===200?this.response:"";l!==""&&Ws.set(u,l),o(l)},a.open("GET",`${Ae.config.baseUri}assets/icons/svg/${u}.svg`),a.send()}function pt(u,o,a="afterbegin"){Ci(u,l=>o.insertAdjacentHTML(a,l))}var Ar={};function Hr(u,o,a,l){let c;function p(){clearTimeout(c)}u.addEventListener("mousedown",function(m){let v=this;m.button!==0?p():(o.call(v,m),c=setTimeout(()=>c=setInterval(o.bind(v,m),l),a))}),u.addEventListener("mouseout",p),window.addEventListener("mouseup",p)}var zo=class{constructor(o,a={}){let c=Object.assign({},{weekStarts:0,format:"YYYY-MM-DD",time:!1,labels:{today:"Today",weekdays:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},months:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}},onChange(P){let J=v();J!==null&&(Ar[J.id]=P,J.value=K(P),J.dispatchEvent(new Event("input",{bubbles:!0})),J.dispatchEvent(new Event("change",{bubbles:!0})))}},a);Ar[o.id]=new Date;let p=b(D(".calendar"),Ar[o.id]);m();function m(){let P=o.value;o.readOnly=!0,o.size=c.format.length,F(P)&&(Ar[o.id]=new Date(P),o.value=K(Ar[o.id])),o.addEventListener("focus",()=>{p.gotoDate(Ar[o.id]),p.show()}),o.addEventListener("blur",()=>{p.hide()}),o.addEventListener("keydown",J=>{switch(J.key){case"Backspace":o.value="",o.blur(),o.dispatchEvent(new Event("input",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}));break;case"Escape":o.blur();break;case"Tab":o.blur();return}J.preventDefault()})}function v(){let P=document.activeElement;return P.matches(".form-input-date")?P:null}function b(P,J){let Y,H,R,W,ne,te;P=P||Nn(),ae(J);function ae(we){Y=we.getFullYear(),H=we.getMonth(),R=we.getDate(),W=we.getHours(),ne=we.getMinutes(),te=we.getSeconds()}function M(we){ae(we),$e()}function I(){return new Date(Y,H,R,W,ne,te)}function N(){return P}function j(){ae(new Date)}function me(){j(),$e()}function Le(){Y--}function Oe(){Le(),$e()}function S(){Y++}function y(){S(),$e()}function oe(){R=T(H,Y)}function Ee(){oe(),$e()}function ge(){H=L(H-1,12),H===11&&Le(),R>T(H,Y)&&oe()}function Ve(){ge(),$e()}function ft(){H=L(H+1,12),H===0&&S(),R>T(H,Y)&&oe()}function Be(){ft(),$e()}function st(){R-=7,R<1&&(ge(),R+=T(H,Y))}function He(){st(),$e()}function Fe(){R+=7,R>T(H,Y)&&(R-=T(H,Y),ft())}function ze(){Fe(),$e()}function lt(){R--,R<1&&(ge(),oe())}function mn(){lt(),$e()}function Ht(){R++,R>T(H,Y)&&(ft(),R=1)}function Nt(){Ht(),$e()}function Ct(){W=L(W+1,24),W===0&&Ht()}function _t(){Ct(),$e()}function xe(){W=L(W-1,24),W===23&<()}function kt(){xe(),$e()}function Gt(){ne=L(ne+1,60),ne===0&&Ct()}function Hn(){Gt(),$e()}function Br(){ne=L(ne-1,60),ne===59&&xe()}function Ii(){Br(),$e()}function Rr(){te=L(te+1,60),te===0&&Gt()}function Jn(){Rr(),$e()}function Oi(){te=L(te-1,60),te===59&&Br()}function ha(){Oi(),$e()}function Wr(){P.style.display="block",x()}function Vn(){P.style.display="none"}function gn(){return getComputedStyle(P).display!=="none"}function $e(){D(".calendar-table",P).innerHTML=we(),Ce(),c.time&&Ut();function we(){let vn=new Date(Y,H,1).getDay(),ue=L(vn-c.weekStarts,7),er=T(H,Y),et=1,be="";be+='
",be+="";for(let Ie=0;Ie<7;Ie++)be+='";be+="
";for(let Ie=0;Ie<6;Ie++){for(let In=0;In<7;In++)et<=er&&(Ie>0||In>=ue)?(et===R?be+='':be+=' | ',be+=et++):et===1?(be+=' | ',be+=T(L(H-1,12),Y)-ue+In+1):(be+=' | ',be+=et++-er),be+=" | ";be+="
"}return be+="
",be}function Ce(){ie(".calendar-day",P).forEach(vn=>{vn.addEventListener("mousedown",ue=>{ue.stopPropagation(),ue.preventDefault()}),vn.addEventListener("click",()=>{R=parseInt(`${vn.textContent}`),$e(),c.onChange(I())})})}function Ut(){D(".calendar-hours",P).innerHTML=k(X(c.format)?L(W,12)||12:W,2),D(".calendar-minutes",P).innerHTML=k(ne,2),D(".calendar-meridiem",P).innerHTML=X(c.format)?W<12?"AM":"PM":""}}function Nn(){let we=document.createElement("div");return we.className="calendar",we.innerHTML=``,c.time&&(we.innerHTML+='',pt("chevron-down",D(".prevHour",we)),pt("chevron-up",D(".nextHour",we)),pt("chevron-down",D(".prevMinute",we)),pt("chevron-up",D(".nextMinute",we))),pt("calendar-clock",D(".currentMonth",we)),pt("chevron-left",D(".prevMonth",we)),pt("chevron-right",D(".nextMonth",we)),D(".currentMonth",we).addEventListener("mousedown",Ce=>{me(),c.onChange(I()),Ce.preventDefault()}),Hr(D(".prevMonth",we),Ce=>{Ve(),c.onChange(I()),Ce.preventDefault()},750,500),Hr(D(".nextMonth",we),Ce=>{Be(),c.onChange(I()),Ce.preventDefault()},750,500),c.time&&(Hr(D(".nextHour",we),Ce=>{_t(),c.onChange(I()),Ce.preventDefault()},750,250),Hr(D(".prevHour",we),Ce=>{kt(),c.onChange(I()),Ce.preventDefault()},750,250),Hr(D(".nextMinute",we),Ce=>{Hn(),c.onChange(I()),Ce.preventDefault()},750,250),Hr(D(".prevMinute",we),Ce=>{Ii(),c.onChange(I()),Ce.preventDefault()},750,250)),window.addEventListener("resize",xo(x,100)),window.addEventListener("mousedown",Ce=>{we.style.display!=="none"&&Ce.target.closest(".calendar")&&Ce.preventDefault()}),window.addEventListener("keydown",Ce=>{if(gn()){switch(Ce.key){case"Enter":D(".calendar-day.selected",we).click(),Vn();break;case"Backspace":case"Escape":case"Tab":Vn();break;case"ArrowLeft":Ce.ctrlKey||Ce.metaKey?Ce.shiftKey?Oe():Ve():mn(),c.onChange(I());break;case"ArrowUp":He(),c.onChange(I());break;case"ArrowRight":Ce.ctrlKey||Ce.metaKey?Ce.shiftKey?y():Be():Nt(),c.onChange(I());break;case"ArrowDown":ze(),c.onChange(I());break;case"0":(Ce.ctrlKey||Ce.metaKey)&&me(),c.onChange(I());break;default:return}Ce.preventDefault()}}),document.body.appendChild(we),we}return{setDate:ae,gotoDate:M,getDate:I,getElement:N,now:me,prevYear:Oe,nextYear:y,lastDayOfMonth:Ee,prevMonth:Ve,nextMonth:Be,prevWeek:He,nextWeek:ze,prevDay:mn,nextDay:Nt,nextHour:_t,prevHour:kt,nextMinute:Hn,prevMinute:Ii,nextSecond:Jn,prevSecond:ha,show:Wr,hide:Vn,isVisible:gn}}function x(){let P=v();if(!P||!p.isVisible())return;let J=P.getBoundingClientRect(),Y=J.top+window.scrollY,H=J.left+window.scrollX,R=p.getElement();R.style.top=`${Y+P.offsetHeight}px`,R.style.left=`${H+P.offsetLeft}px`;let W=R.getBoundingClientRect(),ne=W.top+window.scrollY,te=W.left+window.scrollX,ae=yo(R),M=bo(R),I=document.documentElement.clientWidth,N=document.documentElement.clientHeight;te+ae>I&&(R.style.left=`${I-ae}px`),(ne=H.getTime()?J+1:P.getTime()>=Y.getTime()?J:J-1}function ee(P){let J=q(P),Y=_(new Date(J,0,4),1),H=_(P,1);return Math.round((H.getTime()-Y.getTime())/6048e5)+1}function X(P){let J=P.match(/\[([^\]]*)\]|H{1,2}/);return J!==null&&J[0][0]==="H"}function K(P,J=c.format){let Y=/\[([^\]]*)\]|[YR]{4}|uuu|[YR]{2}|[MD]{1,4}|[WHhms]{1,2}|[AaZz]/g;function H(R){let W=R>0?"-":"+",ne=Math.floor(Math.abs(R)/60),te=Math.abs(R)%60;return[W+k(ne,2),k(te,2)]}return J.replace(Y,(R,W)=>{switch(R){case"YY":return P.getFullYear().toString().substr(-2);case"YYYY":return P.getFullYear();case"M":return P.getMonth()+1;case"MM":return k(P.getMonth()+1,2);case"MMM":return c.labels.months.short[P.getMonth()];case"MMMM":return c.labels.months.long[P.getMonth()];case"D":return P.getDate();case"DD":return k(P.getDate(),2);case"DDD":return c.labels.weekdays.short[L(P.getDay()+c.weekStarts,7)];case"DDDD":return c.labels.weekdays.long[L(P.getDay()+c.weekStarts,7)];case"W":return ee(P);case"WW":return k(ee(P),2);case"RR":return q(P).toString().substr(-2);case"RRRR":return q(P);case"H":return L(P.getHours(),12)||12;case"HH":return k(L(P.getHours(),12)||12,2);case"h":return P.getHours();case"hh":return k(P.getHours(),2);case"m":return P.getMinutes();case"mm":return k(P.getMinutes(),2);case"s":return P.getSeconds();case"ss":return k(P.getSeconds(),2);case"uuu":return k(P.getMilliseconds(),3);case"A":return P.getHours()<12?"AM":"PM";case"a":return P.getHours()<12?"am":"pm";case"Z":return H(P.getTimezoneOffset()).join(":");case"z":return H(P.getTimezoneOffset()).join("");default:return W||R}})}}};function Bf(u){let o=Number.MAX_SAFE_INTEGER,a=-o;return u>o?o:u{X.includes(P)&&(K[P]=Math.floor(ee/pn[P]),ee-=K[P]*pn[P])}),K}function L(ee){let X=0;return Object.entries(ee).forEach(([K,P])=>{X+=P*pn[K]}),Bf(X)}function k(){let ee={},X=0,K=0;Object.entries(m).forEach(([P,J])=>{ee[P]=parseInt(J.value)}),X=L(ee),p.step&&(K=parseInt(p.step)*pn[b.unit],X=Math.floor(X/K)*K),p.min&&(X=Math.max(X,parseInt(p.min))),p.max&&(X=Math.min(X,parseInt(p.max))),p.value=`${Math.round(X/pn[b.unit])}`,p.dispatchEvent(new Event("input",{bubbles:!0})),p.dispatchEvent(new Event("change",{bubbles:!0}))}function F(){let ee=x(parseInt(p.value)*pn[b.unit]);Object.entries(m).forEach(([X,K])=>{K.value=`${ee[X]||0}`})}function O(){Object.values(m).forEach(ee=>{ee.style.width=`${Math.max(3,ee.value.length+2)}ch`})}function T(){Object.entries(m).forEach(([ee,X])=>{v[ee].innerHTML=b.labels[ee][parseInt(X.value)===1?0:1]})}function _(ee,X){c=document.createElement("div"),c.className="form-input-duration";let K;for(let P of b.intervals){K=document.createElement("input"),K.className="form-input";let J=document.createElement("span");J.className=`duration-${P}`,K.type="number",K.value=`${ee[P]||0}`,K.style.width=`${Math.max(3,K.value.length+2)}ch`,X[P]>1&&(K.step=`${X[P]}`),o.disabled&&(K.disabled=!0),m[P]=K,K.addEventListener("input",function(){for(;this.value.charAt(0)==="0"&&this.value.length>1&&!this.value.charAt(1).match(/[.,]/);)this.value=this.value.slice(1);for(;parseInt(this.value)>Number.MAX_SAFE_INTEGER;)this.value=this.value.slice(0,-1);O(),k(),T()}),K.addEventListener("blur",()=>{k(),F(),O(),T()}),K.addEventListener("focus",()=>c.classList.add("focused")),K.addEventListener("blur",()=>c.classList.remove("focused")),J.addEventListener("mousedown",function(H){let R=D("input",this);R&&H.target!==R&&(R.focus(),H.preventDefault())});let Y=document.createElement("label");Y.className="form-label",Y.innerHTML=b.labels[P][parseInt(K.value)===1?0:1],v[P]=Y,J.appendChild(K),J.appendChild(Y),c.appendChild(J)}return c.addEventListener("mousedown",function(P){P.target===this&&(K.focus(),P.preventDefault())}),c}function q(){p=document.createElement("input"),p.className="form-input-duration-hidden",p.name=o.name,p.id=o.id,p.type="text",p.value=o.value,p.readOnly=!0,p.hidden=!0,o.min&&(p.min=o.min),o.max&&(p.max=o.max),o.step&&(p.step=o.step),o.required&&(p.required=!0),o.disabled&&(p.disabled=!0),"intervals"in o.dataset&&(b.intervals=o.dataset.intervals.split(", ")),"unit"in o.dataset&&(b.unit=o.dataset.unit);let ee=parseInt(o.value)*pn[b.unit],X=parseInt(o.step)*pn[b.unit],K=_(x(ee||0),x(X||1));o.parentNode.replaceChild(K,o),K.appendChild(p)}}};function Rf(u,o){if(u.length!==o.length)return!1;for(let a=0;a({extend:!1,addNew:!1})}),c=D(`.editor-toolbar[data-for=${o.id}]`),p=o.parentNode.classList.contains("editor-wrap")?o.parentNode:null,m=[];l.getWrapperElement().style.height=`${a}px`,(T=D("[data-command=bold]",c))==null||T.addEventListener("click",()=>{L("**")}),(_=D("[data-command=italic]",c))==null||_.addEventListener("click",()=>{L("_")}),(q=D("[data-command=ul]",c))==null||q.addEventListener("click",()=>{L(`${x()}- `,"")}),(ee=D("[data-command=ol]",c))==null||ee.addEventListener("click",()=>{let H=/^(\d+)\./.exec(v(l.getValue()));L(H?`
+${parseInt(H[1])+1}. `:`${x()}1. `,"")}),(X=D("[data-command=quote]",c))==null||X.addEventListener("click",()=>{L(`${x()}> `,"")}),(K=D("[data-command=link]",c))==null||K.addEventListener("click",()=>{let H=l.getSelection();/^(https?:\/\/|mailto:)/i.test(H)?L("[",`](${H})`,!0):H!==""?L(`[${H}](http://`,")",!0):L("[","](http://)")}),(P=D("[data-command=image]",c))==null||P.addEventListener("click",()=>{Ae.modals.imagesModal.show(void 0,H=>{let R=D(".image-picker-thumbnail.selected",H.element);R&&R.classList.remove("selected");function W(){let ne=D(".image-picker-thumbnail.selected",H.element);if(ne){let te=ne.dataset.filename;L(`${x()}![`,`](${te})`)}H.hide(),this.removeEventListener("click",W)}D("[data-command=pick-image]",H.element).addEventListener("click",W)})}),(J=D("[data-command=undo]",c))==null||J.addEventListener("click",()=>{l.undo(),l.focus()}),(Y=D("[data-command=redo]",c))==null||Y.addEventListener("click",()=>{l.redo(),l.focus()}),l.on("changes",fn(()=>{o.value=l.getValue(),o.dispatchEvent(new Event("input",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0})),l.historySize().undo<1?D("[data-command=undo]").disabled=!0:D("[data-command=undo]").disabled=!1,l.historySize().redo<1?D("[data-command=redo]").disabled=!0:D("[data-command=redo]").disabled=!1},500)),l.on("beforeSelectionChange",(H,R)=>{let W=k(R.ranges);H.operation(()=>{Rf(W,m)||(F(H,m),O(H,W),m=W)}),H.refresh()}),l.on("focus",()=>{p!==null&&p.classList.add("focused")}),l.on("blur",H=>{p!==null&&p.classList.remove("focused"),F(H,m),m=[]}),document.addEventListener("keydown",H=>{var R,W,ne;if(!H.altKey&&(H.ctrlKey||H.metaKey))switch(H.key){case"b":(R=D("[data-command=bold]",c))==null||R.click(),H.preventDefault();break;case"i":(W=D("[data-command=italic]",c))==null||W.click(),H.preventDefault();break;case"k":(ne=D("[data-command=link]",c))==null||ne.click(),H.preventDefault();break}});function v(H){let R=H.lastIndexOf(`
+`);return R===-1?H:H.substring(R+1)}function b(){let H=l.getLine(l.getCursor().line);return H.length===0?void 0:H.slice(-1)}function x(){switch(b()){case void 0:return"";case`
`:return`
`;default:return`
-`}}function L(I,R,W=!1){R===void 0&&(R=I);let ne=W===!0?"":s.getSelection(),ee=s.getCursor(),ae=I.split(`
-`).length-1;s.replaceSelection(I+ne+R),s.setCursor(ee.line+ae,ee.ch+I.length-ae),s.focus()}function C(I){let R=[];for(let W of I)R.push(W.head.line);return R}function H(I,R){for(let W of R)I.removeLineClass(W,"wrap","CodeMirror-activeline")}function N(I,R){for(let W of R)I.addLineClass(W,"wrap","CodeMirror-activeline")}}};var Uo=class{constructor(o){var b,L;let a=D(`label[for="${o.id}"]`),s=D("span",a),c=!1;o.dataset.label=(b=D(`label[for="${o.id}"] span`))==null?void 0:b.innerHTML,o.addEventListener("change",p),o.addEventListener("input",p),(L=o.form)==null||L.addEventListener("submit",()=>{o.files&&o.files.length>0&&(s.innerHTML+=' '),c=!0}),a.addEventListener("drag",m),a.addEventListener("dragstart",m),a.addEventListener("dragend",m),a.addEventListener("dragover",v),a.addEventListener("dragenter",v),a.addEventListener("dragleave",x),a.addEventListener("drop",C=>{C.preventDefault(),!c&&C.dataTransfer&&(o.files=C.dataTransfer.files,o.dispatchEvent(new Event("change")))}),a.addEventListener("click",C=>{c&&C.preventDefault()});function p(){if(this.files&&this.files.length>0){let C=[];for(let H of Array.from(this.files))C.push(H.name);s.innerHTML=C.join(", ")}else s.innerHTML=this.dataset.label}function m(C){C.preventDefault()}function v(C){this.classList.add("drag"),C.preventDefault()}function x(C){this.classList.remove("drag"),C.preventDefault()}}};var qo=class{constructor(o){o.addEventListener("click",()=>{Ae.modals.imagesModal.show(void 0,a=>{let s=D(".image-picker-thumbnail.selected",a.element);if(s&&s.classList.remove("selected"),o.value){let p=D(`.image-picker-thumbnail[data-filename="${o.value}"]`,a.element);p&&p.classList.add("selected")}let c=D("[data-command=pick-image]",a.element);c.dataset.target=o.id,c.addEventListener("click",()=>a.hide())})})}};var jo=class{constructor(o){var m,v;let a=ie("option",o),s=D("[data-command=pick-image]",(m=o.parentNode.parentNode)!=null?m:document);if(o.hidden=!0,a.length>0){let x=document.createElement("div");x.className="image-picker-thumbnails";for(let b of Array.from(a)){let L=document.createElement("div");L.className="image-picker-thumbnail",L.style.backgroundImage=`url(${(v=b.dataset.thumbnail)!=null?v:b.value})`,L.dataset.uri=b.value,L.dataset.filename=b.text,L.addEventListener("click",c),L.addEventListener("dblclick",p),x.appendChild(L)}o.parentNode.insertBefore(x,o),D(".image-picker-empty-state").style.display="none"}s==null||s.addEventListener("click",function(){let x=D(".image-picker-thumbnail.selected"),b=this.dataset.target;if(x&&b){let L=document.getElementById(b),C=x.dataset.filename;L&&C&&(L.value=C)}});function c(){ie(".image-picker-thumbnail").forEach(b=>{b.classList.remove("selected")}),this.classList.add("selected");let x=D("[data-command=pick-image]").dataset.target;if(x){let b=document.getElementById(x);b&&(b.value=this.dataset.filename)}}function p(){var x;this.click(),(x=D("[data-command=pick-image]"))==null||x.click()}}};var Yo=class{constructor(o){if(o.addEventListener("change",a),o.addEventListener("input",a),a.call(o),"ticks"in o.dataset){let c=o.dataset.ticks;switch(c){case"0":break;case"true":case"":s((parseInt(o.max)-parseInt(o.min))/(parseInt(o.step)||1)+1);break;default:s(parseInt(c)+1);break}}function a(){this.style.setProperty("--progress",`${Math.round(parseInt(this.value)/(parseInt(this.max)-parseInt(this.min))*100)}%`);let c=D(`output[for="${this.id}"]`);c&&(c.innerHTML=this.value)}function s(c){let p=document.createElement("div");p.className="form-input-range-ticks",p.dataset.for=o.id,o.parentElement.insertBefore(p,o.nextSibling);for(let m=0;m":"","?":"","@":"","[":"","]":"","^":"","`":"","{":"","|":"","}":"","\xA1":"","\xA3":"","\xA4":"","\xA5":"","\xA6":"","\xA7":"","\xAB":"","\xB0":"","\xBB":"","\u2018":"","\u2019":"","\u201C":"","\u201D":"","\n":"-"," ":"-","-":"-","\u2013":"-","\u2014":"-","/":"-","\\":"-",_:"-","~":"-",\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00C6:"Ae",\u00C7:"C",\u00D0:"D",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u0152:"Oe",\u0160:"S",\u00DE:"Th",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00DD:"Y",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"ae",\u00E5:"a",\u00E6:"ae","\xA2":"c",\u00E7:"c",\u00F0:"d",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"oe",\u00F8:"o",\u0153:"oe",\u0161:"s",\u00DF:"ss",\u00FE:"th",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"ue",\u00FD:"y",\u00FF:"y",\u0178:"y"};u=u.toLowerCase();for(let a in o)u=u.split(a).join(o[a]);return u.replace(/[^a-z0-9-]/g,"").replace(/^-+|-+$/g,"").replace(/-+/g,"-")}function Ul(u){return u.toLowerCase().replace(" ","-").replace(/[^a-z0-9-]/g,"")}var Xo=class{constructor(o,a){let c=Object.assign({},{labels:{empty:"No matching options"}},a),p,m=document.createElement("input"),v=document.createElement("div");x();function x(){let I=document.createElement("div");I.className="form-input-wrap",o.hidden=!0,m.type="text",m.classList.add("form-select"),m.dataset.for=o.id;let R=D(`label[for="${o.id}"]`);R&&m.setAttribute("aria-label",R.innerText),o.hasAttribute("disabled")&&(m.disabled=!0);for(let ne in o.dataset)m.dataset[ne]=o.dataset[ne];let W=[];ie("option",o).forEach(ne=>{let ee={};for(let ae in ne.dataset)ee[ae]=ne.dataset[ae];W.push({label:ne.innerText,value:ne.value,selected:ne.selected,disabled:ne.disabled,dataset:ee}),ne.selected&&(m.value=ne.innerText)}),o.parentNode.insertBefore(I,o.nextSibling),I.appendChild(o),I.appendChild(m),b(W,I)}function b(I,R){p=document.createElement("div"),p.className="dropdown-list",p.dataset.for=o.id;let W=document.createElement("div");W.className="dropdown-list-items",p.appendChild(W),v.className="dropdown-empty",v.style.display="none",v.innerText=c.labels.empty,W.appendChild(v);for(let ee of I){let ae=document.createElement("div");ae.className="dropdown-item",ae.innerText=ee.label,ae.dataset.value=ee.value,ee.selected&&ae.classList.add("selected"),ee.disabled&&ae.classList.add("disabled");for(let k in ee.dataset)ae.dataset[k]=ee.dataset[k];ae.addEventListener("mousedown",k=>{ae.classList.contains("disabled")?k.preventDefault():(N(ae),Q(ae)),k.stopPropagation()}),W.appendChild(ae)}R.appendChild(p);let ne=!1;m.addEventListener("focus",()=>{J(),m.setSelectionRange(0,0),ne=!1}),m.addEventListener("mousedown",ee=>{m.focus(),ee.preventDefault()}),m.addEventListener("blur",()=>{j(m.value)||(m.value=B()),p.style.display="none"}),m.addEventListener("keydown",ee=>{let ae=D(".dropdown-item.selected",p);switch(ee.key){case"Backspace":L();break;case"ArrowUp":getComputedStyle(p).display!=="none"?te():J(),ee.preventDefault();break;case"ArrowDown":getComputedStyle(p).display!=="none"?V():J(),ee.preventDefault();break;case"Enter":ae&&getComputedStyle(ae).display!=="none"&&Q(ae),m.blur(),ee.preventDefault();break;case"Escape":case"ArrowLeft":case"ArrowRight":break;default:ne||(m.value="",ne=!0);break}}),m.addEventListener("keyup",ee=>{let ae=m.value.trim();switch(ee.key){case"Escape":m.blur(),ee.stopPropagation();break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Tab":case"Enter":return!0;default:p.style.display="block",C(ae),ae.length>0&&M()}})}function L(){let I=0;ie(".dropdown-item",p).forEach(R=>{getComputedStyle(R).display!=="none"&&I++,R.classList.remove("selected")}),I>0?v.style.display="none":v.style.display="block"}function C(I){let R=ne=>{let ee=`${ne.textContent}`;return new RegExp(Ir(Nr(I)),"i").test(ee)},W=0;ie(".dropdown-item",p).forEach(ne=>{I===null||R(ne)?(ne.style.display="block",W++):ne.style.display="none"}),W>0?v.style.display="none":v.style.display="block"}function H(I){let R=p.scrollTop,W=p.clientHeight,ne=R+W,ee=getComputedStyle(p),ae=parseInt(ee.paddingTop),k=parseInt(ee.paddingBottom),F=I.offsetTop,O=I.clientHeight,q=F+O;F