netbox/netbox/project-static/dist/netbox.js

29 lines
367 KiB
JavaScript

(()=>{var dh=Object.create;var Qo=Object.defineProperty,fh=Object.defineProperties,hh=Object.getOwnPropertyDescriptor,ph=Object.getOwnPropertyDescriptors,mh=Object.getOwnPropertyNames,eu=Object.getOwnPropertySymbols,gh=Object.getPrototypeOf,tu=Object.prototype.hasOwnProperty,vh=Object.prototype.propertyIsEnumerable;var Vl=(ii,ti,ei)=>ti in ii?Qo(ii,ti,{enumerable:!0,configurable:!0,writable:!0,value:ei}):ii[ti]=ei,jn=(ii,ti)=>{for(var ei in ti||(ti={}))tu.call(ti,ei)&&Vl(ii,ei,ti[ei]);if(eu)for(var ei of eu(ti))vh.call(ti,ei)&&Vl(ii,ei,ti[ei]);return ii},fs=(ii,ti)=>fh(ii,ph(ti)),iu=ii=>Qo(ii,"__esModule",{value:!0});var Un=(ii,ti)=>()=>(ti||ii((ti={exports:{}}).exports,ti),ti.exports),_h=(ii,ti)=>{iu(ii);for(var ei in ti)Qo(ii,ei,{get:ti[ei],enumerable:!0})},yh=(ii,ti,ei)=>{if(ti&&typeof ti=="object"||typeof ti=="function")for(let ni of mh(ti))!tu.call(ii,ni)&&ni!=="default"&&Qo(ii,ni,{get:()=>ti[ni],enumerable:!(ei=hh(ti,ni))||ei.enumerable});return ii},Ns=ii=>yh(iu(Qo(ii!=null?dh(gh(ii)):{},"default",ii&&ii.__esModule&&"default"in ii?{get:()=>ii.default,enumerable:!0}:{value:ii,enumerable:!0})),ii);var Rn=(ii,ti,ei)=>(Vl(ii,typeof ti!="symbol"?ti+"":ti,ei),ei);var hs=(ii,ti,ei)=>new Promise((ni,ri)=>{var si=fi=>{try{ci(ei.next(fi))}catch(vi){ri(vi)}},ai=fi=>{try{ci(ei.throw(fi))}catch(vi){ri(vi)}},ci=fi=>fi.done?ni(fi.value):Promise.resolve(fi.value).then(si,ai);ci((ei=ei.apply(ii,ti)).next())});var xd=Un((exports,module)=>{(function(ii,ti){typeof define=="function"&&define.amd?define([],ti):ii.htmx=ii.htmx||ti()})(typeof self!="undefined"?self:exports,function(){return function(){"use strict";var U={onLoad:t,process:vt,on:X,off:F,trigger:$,ajax:nr,find:R,findAll:O,closest:N,values:function(ii,ti){var ei=Pt(ii,ti||"post");return ei.values},remove:q,addClass:L,removeClass:T,toggleClass:A,takeClass:H,defineExtension:fr,removeExtension:cr,logAll:C,logger:null,config:{historyEnabled:!0,historyCacheSize:10,refreshOnHistoryMiss:!1,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:!0,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:!0,inlineScriptNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:!1,timeout:0,wsReconnectDelay:"full-jitter",disableSelector:"[hx-disable], [data-hx-disable]",useTemplateFragments:!1,scrollBehavior:"smooth",defaultFocusScroll:!1},parseInterval:v,_:e,createEventSource:function(ii){return new EventSource(ii,{withCredentials:!0})},createWebSocket:function(ii){return new WebSocket(ii,[])},version:"1.8.0"},r={addTriggerHandler:st,bodyContains:K,canAccessLocalStorage:E,filterValues:Ut,hasAttribute:o,getAttributeValue:V,getClosestMatch:h,getExpressionVars:Qt,getHeaders:Bt,getInputValues:Pt,getInternalData:W,getSwapSpecification:_t,getTriggerSpecs:Me,getTarget:re,makeFragment:g,mergeObjects:Y,makeSettleInfo:Gt,oobSwap:ae,selectAndSwap:Ee,settleImmediately:Lt,shouldCancel:je,triggerEvent:$,triggerErrorEvent:J,withExtensions:xt},n=["get","post","put","delete","patch"],i=n.map(function(ii){return"[hx-"+ii+"], [data-hx-"+ii+"]"}).join(", ");function v(ii){if(ii!=null)return ii.slice(-2)=="ms"?parseFloat(ii.slice(0,-2))||void 0:ii.slice(-1)=="s"?parseFloat(ii.slice(0,-1))*1e3||void 0:ii.slice(-1)=="m"?parseFloat(ii.slice(0,-1))*1e3*60||void 0:parseFloat(ii)||void 0}function f(ii,ti){return ii.getAttribute&&ii.getAttribute(ti)}function o(ii,ti){return ii.hasAttribute&&(ii.hasAttribute(ti)||ii.hasAttribute("data-"+ti))}function V(ii,ti){return f(ii,ti)||f(ii,"data-"+ti)}function u(ii){return ii.parentElement}function _(){return document}function h(ii,ti){for(;ii&&!ti(ii);)ii=u(ii);return ii||null}function a(ii,ti,ei){var ni=V(ti,ei),ri=V(ti,"hx-disinherit");return ii!==ti&&ri&&(ri==="*"||ri.split(" ").indexOf(ei)>=0)?"unset":ni}function z(ii,ti){var ei=null;if(h(ii,function(ni){return ei=a(ii,ni,ti)}),ei!=="unset")return ei}function d(ii,ti){var ei=ii.matches||ii.matchesSelector||ii.msMatchesSelector||ii.mozMatchesSelector||ii.webkitMatchesSelector||ii.oMatchesSelector;return ei&&ei.call(ii,ti)}function s(ii){var ti=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ei=ti.exec(ii);return ei?ei[1].toLowerCase():""}function l(ii,ti){for(var ei=new DOMParser,ni=ei.parseFromString(ii,"text/html"),ri=ni.body;ti>0;)ti--,ri=ri.firstChild;return ri==null&&(ri=_().createDocumentFragment()),ri}function g(ii){if(U.config.useTemplateFragments){var ti=l("<body><template>"+ii+"</template></body>",0);return ti.querySelector("template").content}else{var ei=s(ii);switch(ei){case"thead":case"tbody":case"tfoot":case"colgroup":case"caption":return l("<table>"+ii+"</table>",1);case"col":return l("<table><colgroup>"+ii+"</colgroup></table>",2);case"tr":return l("<table><tbody>"+ii+"</tbody></table>",2);case"td":case"th":return l("<table><tbody><tr>"+ii+"</tr></tbody></table>",3);case"script":return l("<div>"+ii+"</div>",1);default:return l(ii,0)}}}function Z(ii){ii&&ii()}function p(ii,ti){return Object.prototype.toString.call(ii)==="[object "+ti+"]"}function m(ii){return p(ii,"Function")}function x(ii){return p(ii,"Object")}function W(ii){var ti="htmx-internal-data",ei=ii[ti];return ei||(ei=ii[ti]={}),ei}function y(ii){var ti=[];if(ii)for(var ei=0;ei<ii.length;ei++)ti.push(ii[ei]);return ti}function G(ii,ti){if(ii)for(var ei=0;ei<ii.length;ei++)ti(ii[ei])}function b(ii){var ti=ii.getBoundingClientRect(),ei=ti.top,ni=ti.bottom;return ei<window.innerHeight&&ni>=0}function K(ii){return ii.getRootNode()instanceof ShadowRoot?_().body.contains(ii.getRootNode().host):_().body.contains(ii)}function w(ii){return ii.trim().split(/\s+/)}function Y(ii,ti){for(var ei in ti)ti.hasOwnProperty(ei)&&(ii[ei]=ti[ei]);return ii}function S(ii){try{return JSON.parse(ii)}catch(ti){return yt(ti),null}}function E(){var ii="htmx:localStorageTest";try{return localStorage.setItem(ii,ii),localStorage.removeItem(ii),!0}catch(ti){return!1}}function e(e){return Zt(_().body,function(){return eval(e)})}function t(ii){var ti=U.on("htmx:load",function(ei){ii(ei.detail.elt)});return ti}function C(){U.logger=function(ii,ti,ei){console&&console.log(ti,ii,ei)}}function R(ii,ti){return ti?ii.querySelector(ti):R(_(),ii)}function O(ii,ti){return ti?ii.querySelectorAll(ti):O(_(),ii)}function q(ii,ti){ii=D(ii),ti?setTimeout(function(){q(ii)},ti):ii.parentElement.removeChild(ii)}function L(ii,ti,ei){ii=D(ii),ei?setTimeout(function(){L(ii,ti)},ei):ii.classList&&ii.classList.add(ti)}function T(ii,ti,ei){ii=D(ii),ei?setTimeout(function(){T(ii,ti)},ei):ii.classList&&(ii.classList.remove(ti),ii.classList.length===0&&ii.removeAttribute("class"))}function A(ii,ti){ii=D(ii),ii.classList.toggle(ti)}function H(ii,ti){ii=D(ii),G(ii.parentElement.children,function(ei){T(ei,ti)}),L(ii,ti)}function N(ii,ti){if(ii=D(ii),ii.closest)return ii.closest(ti);do if(ii==null||d(ii,ti))return ii;while(ii=ii&&u(ii))}function I(ii,ti){return ti.indexOf("closest ")===0?[N(ii,ti.substr(8))]:ti.indexOf("find ")===0?[R(ii,ti.substr(5))]:ti.indexOf("next ")===0?[k(ii,ti.substr(5))]:ti.indexOf("previous ")===0?[M(ii,ti.substr(9))]:ti==="document"?[document]:ti==="window"?[window]:_().querySelectorAll(ti)}var k=function(ii,ti){for(var ei=_().querySelectorAll(ti),ni=0;ni<ei.length;ni++){var ri=ei[ni];if(ri.compareDocumentPosition(ii)===Node.DOCUMENT_POSITION_PRECEDING)return ri}},M=function(ii,ti){for(var ei=_().querySelectorAll(ti),ni=ei.length-1;ni>=0;ni--){var ri=ei[ni];if(ri.compareDocumentPosition(ii)===Node.DOCUMENT_POSITION_FOLLOWING)return ri}};function Q(ii,ti){return ti?I(ii,ti)[0]:I(_().body,ii)[0]}function D(ii){return p(ii,"String")?R(ii):ii}function P(ii,ti,ei){return m(ti)?{target:_().body,event:ii,listener:ti}:{target:D(ii),event:ti,listener:ei}}function X(ii,ti,ei){dr(function(){var ri=P(ii,ti,ei);ri.target.addEventListener(ri.event,ri.listener)});var ni=m(ti);return ni?ti:ei}function F(ii,ti,ei){return dr(function(){var ni=P(ii,ti,ei);ni.target.removeEventListener(ni.event,ni.listener)}),m(ti)?ti:ei}var ee=_().createElement("output");function j(ii,ti){var ei=z(ii,ti);if(ei){if(ei==="this")return[te(ii,ti)];var ni=I(ii,ei);return ni.length===0?(yt('The selector "'+ei+'" on '+ti+" returned no matches!"),[ee]):ni}}function te(ii,ti){return h(ii,function(ei){return V(ei,ti)!=null})}function re(ii){var ti=z(ii,"hx-target");if(ti)return ti==="this"?te(ii,"hx-target"):Q(ii,ti);var ei=W(ii);return ei.boosted?_().body:ii}function B(ii){for(var ti=U.config.attributesToSettle,ei=0;ei<ti.length;ei++)if(ii===ti[ei])return!0;return!1}function ne(ii,ti){G(ii.attributes,function(ei){!ti.hasAttribute(ei.name)&&B(ei.name)&&ii.removeAttribute(ei.name)}),G(ti.attributes,function(ei){B(ei.name)&&ii.setAttribute(ei.name,ei.value)})}function ie(ii,ti){for(var ei=hr(ti),ni=0;ni<ei.length;ni++){var ri=ei[ni];try{if(ri.isInlineSwap(ii))return!0}catch(si){yt(si)}}return ii==="outerHTML"}function ae(ii,ti,ei){var ni="#"+ti.id,ri="outerHTML";ii==="true"||(ii.indexOf(":")>0?(ri=ii.substr(0,ii.indexOf(":")),ni=ii.substr(ii.indexOf(":")+1,ii.length)):ri=ii);var si=_().querySelectorAll(ni);return si?(G(si,function(ai){var ci,fi=ti.cloneNode(!0);ci=_().createDocumentFragment(),ci.appendChild(fi),ie(ri,ai)||(ci=fi);var vi={shouldSwap:!0,target:ai,fragment:ci};!$(ai,"htmx:oobBeforeSwap",vi)||(ai=vi.target,vi.shouldSwap&&we(ri,ai,ai,ci,ei),G(ei.elts,function(hi){$(hi,"htmx:oobAfterSwap",vi)}))}),ti.parentNode.removeChild(ti)):(ti.parentNode.removeChild(ti),J(_().body,"htmx:oobErrorNoTarget",{content:ti})),ii}function oe(ii,ti,ei){var ni=z(ii,"hx-select-oob");if(ni){var ri=ni.split(",");for(let vi=0;vi<ri.length;vi++){var si=ri[vi].split(":",2),ai=si[0];ai.indexOf("#")===0&&(ai=ai.substring(1));var ci=si[1]||"true",fi=ti.querySelector("#"+ai);fi&&ae(ci,fi,ei)}}G(O(ti,"[hx-swap-oob], [data-hx-swap-oob]"),function(vi){var hi=V(vi,"hx-swap-oob");hi!=null&&ae(hi,vi,ei)})}function se(ii){G(O(ii,"[hx-preserve], [data-hx-preserve]"),function(ti){var ei=V(ti,"id"),ni=_().getElementById(ei);ni!=null&&ti.parentNode.replaceChild(ni,ti)})}function le(ii,ti,ei){G(ti.querySelectorAll("[id]"),function(ni){if(ni.id&&ni.id.length>0){var ri=ii.querySelector(ni.tagName+"[id='"+ni.id+"']");if(ri&&ri!==ii){var si=ni.cloneNode();ne(ni,ri),ei.tasks.push(function(){ne(ni,si)})}}})}function ue(ii){return function(){T(ii,U.config.addedClass),vt(ii),ut(ii),fe(ii),$(ii,"htmx:load")}}function fe(ii){var ti="[autofocus]",ei=d(ii,ti)?ii:ii.querySelector(ti);ei!=null&&ei.focus()}function ce(ii,ti,ei,ni){for(le(ii,ei,ni);ei.childNodes.length>0;){var ri=ei.firstChild;L(ri,U.config.addedClass),ii.insertBefore(ri,ti),ri.nodeType!==Node.TEXT_NODE&&ri.nodeType!==Node.COMMENT_NODE&&ni.tasks.push(ue(ri))}}function he(ii){var ti=W(ii);ti.webSocket&&ti.webSocket.close(),ti.sseEventSource&&ti.sseEventSource.close(),$(ii,"htmx:beforeCleanupElement"),ti.listenerInfos&&G(ti.listenerInfos,function(ei){ii!==ei.on&&ei.on.removeEventListener(ei.trigger,ei.listener)}),ii.children&&G(ii.children,function(ei){he(ei)})}function de(ii,ti,ei){if(ii.tagName==="BODY")return ye(ii,ti,ei);var ni,ri=ii.previousSibling;for(ce(u(ii),ii,ti,ei),ri==null?ni=u(ii).firstChild:ni=ri.nextSibling,W(ii).replacedWith=ni,ei.elts=[];ni&&ni!==ii;)ni.nodeType===Node.ELEMENT_NODE&&ei.elts.push(ni),ni=ni.nextElementSibling;he(ii),u(ii).removeChild(ii)}function ve(ii,ti,ei){return ce(ii,ii.firstChild,ti,ei)}function ge(ii,ti,ei){return ce(u(ii),ii,ti,ei)}function pe(ii,ti,ei){return ce(ii,null,ti,ei)}function me(ii,ti,ei){return ce(u(ii),ii.nextSibling,ti,ei)}function xe(ii,ti,ei){return he(ii),u(ii).removeChild(ii)}function ye(ii,ti,ei){var ni=ii.firstChild;if(ce(ii,ni,ti,ei),ni){for(;ni.nextSibling;)he(ni.nextSibling),ii.removeChild(ni.nextSibling);he(ni),ii.removeChild(ni)}}function be(ii,ti){var ei=z(ii,"hx-select");if(ei){var ni=_().createDocumentFragment();G(ti.querySelectorAll(ei),function(ri){ni.appendChild(ri)}),ti=ni}return ti}function we(ii,ti,ei,ni,ri){switch(ii){case"none":return;case"outerHTML":de(ei,ni,ri);return;case"afterbegin":ve(ei,ni,ri);return;case"beforebegin":ge(ei,ni,ri);return;case"beforeend":pe(ei,ni,ri);return;case"afterend":me(ei,ni,ri);return;case"delete":xe(ei,ni,ri);return;default:for(var si=hr(ti),ai=0;ai<si.length;ai++){var ci=si[ai];try{var fi=ci.handleSwap(ii,ei,ni,ri);if(fi){if(typeof fi.length!="undefined")for(var vi=0;vi<fi.length;vi++){var hi=fi[vi];hi.nodeType!==Node.TEXT_NODE&&hi.nodeType!==Node.COMMENT_NODE&&ri.tasks.push(ue(hi))}return}}catch(bi){yt(bi)}}ii==="innerHTML"?ye(ei,ni,ri):we(U.config.defaultSwapStyle,ti,ei,ni,ri)}}function Se(ii){if(ii.indexOf("<title")>-1){var ti=ii.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,""),ei=ti.match(/<title(\s[^>]*>|>)([\s\S]*?)<\/title>/im);if(ei)return ei[2]}}function Ee(ii,ti,ei,ni,ri){ri.title=Se(ni);var si=g(ni);if(si)return oe(ei,si,ri),si=be(ei,si),se(si),we(ii,ei,ti,si,ri)}function Ce(ii,ti,ei){var ni=ii.getResponseHeader(ti);if(ni.indexOf("{")===0){var ri=S(ni);for(var si in ri)if(ri.hasOwnProperty(si)){var ai=ri[si];x(ai)||(ai={value:ai}),$(ei,si,ai)}}else $(ei,ni,[])}var Re=/\s/,Oe=/[\s,]/,qe=/[_$a-zA-Z]/,Le=/[_$a-zA-Z0-9]/,Te=['"',"'","/"],Ae=/[^\s]/;function He(ii){for(var ti=[],ei=0;ei<ii.length;){if(qe.exec(ii.charAt(ei))){for(var ni=ei;Le.exec(ii.charAt(ei+1));)ei++;ti.push(ii.substr(ni,ei-ni+1))}else if(Te.indexOf(ii.charAt(ei))!==-1){var ri=ii.charAt(ei),ni=ei;for(ei++;ei<ii.length&&ii.charAt(ei)!==ri;)ii.charAt(ei)==="\\"&&ei++,ei++;ti.push(ii.substr(ni,ei-ni+1))}else{var si=ii.charAt(ei);ti.push(si)}ei++}return ti}function Ne(ii,ti,ei){return qe.exec(ii.charAt(0))&&ii!=="true"&&ii!=="false"&&ii!=="this"&&ii!==ei&&ti!=="."}function Ie(ii,ti,ei){if(ti[0]==="["){ti.shift();for(var ni=1,ri=" return (function("+ei+"){ return (",si=null;ti.length>0;){var ai=ti[0];if(ai==="]"){if(ni--,ni===0){si===null&&(ri=ri+"true"),ti.shift(),ri+=")})";try{var ci=Zt(ii,function(){return Function(ri)()},function(){return!0});return ci.source=ri,ci}catch(fi){return J(_().body,"htmx:syntax:error",{error:fi,source:ri}),null}}}else ai==="["&&ni++;Ne(ai,si,ei)?ri+="(("+ei+"."+ai+") ? ("+ei+"."+ai+") : (window."+ai+"))":ri=ri+ai,si=ti.shift()}}}function c(ii,ti){for(var ei="";ii.length>0&&!ii[0].match(ti);)ei+=ii.shift();return ei}var ke="input, textarea, select";function Me(ii){var ti=V(ii,"hx-trigger"),ei=[];if(ti){var ni=He(ti);do{c(ni,Ae);var ri=ni.length,si=c(ni,/[,\[\s]/);if(si!=="")if(si==="every"){var ai={trigger:"every"};c(ni,Ae),ai.pollInterval=v(c(ni,/[,\[\s]/)),c(ni,Ae);var ci=Ie(ii,ni,"event");ci&&(ai.eventFilter=ci),ei.push(ai)}else if(si.indexOf("sse:")===0)ei.push({trigger:"sse",sseEvent:si.substr(4)});else{var fi={trigger:si},ci=Ie(ii,ni,"event");for(ci&&(fi.eventFilter=ci);ni.length>0&&ni[0]!==",";){c(ni,Ae);var vi=ni.shift();if(vi==="changed")fi.changed=!0;else if(vi==="once")fi.once=!0;else if(vi==="consume")fi.consume=!0;else if(vi==="delay"&&ni[0]===":")ni.shift(),fi.delay=v(c(ni,Oe));else if(vi==="from"&&ni[0]===":"){ni.shift();var hi=c(ni,Oe);(hi==="closest"||hi==="find"||hi==="next"||hi==="previous")&&(ni.shift(),hi+=" "+c(ni,Oe)),fi.from=hi}else vi==="target"&&ni[0]===":"?(ni.shift(),fi.target=c(ni,Oe)):vi==="throttle"&&ni[0]===":"?(ni.shift(),fi.throttle=v(c(ni,Oe))):vi==="queue"&&ni[0]===":"?(ni.shift(),fi.queue=c(ni,Oe)):(vi==="root"||vi==="threshold")&&ni[0]===":"?(ni.shift(),fi[vi]=c(ni,Oe)):J(ii,"htmx:syntax:error",{token:ni.shift()})}ei.push(fi)}ni.length===ri&&J(ii,"htmx:syntax:error",{token:ni.shift()}),c(ni,Ae)}while(ni[0]===","&&ni.shift())}return ei.length>0?ei:d(ii,"form")?[{trigger:"submit"}]:d(ii,'input[type="button"]')?[{trigger:"click"}]:d(ii,ke)?[{trigger:"change"}]:[{trigger:"click"}]}function De(ii){W(ii).cancelled=!0}function Pe(ii,ti,ei){var ni=W(ii);ni.timeout=setTimeout(function(){K(ii)&&ni.cancelled!==!0&&(Ue(ei,pt("hx:poll:trigger",{triggerSpec:ei,target:ii}))||ti(ii),Pe(ii,ti,ei))},ei.pollInterval)}function Xe(ii){return location.hostname===ii.hostname&&f(ii,"href")&&f(ii,"href").indexOf("#")!==0}function Fe(ii,ti,ei){if(ii.tagName==="A"&&Xe(ii)&&(ii.target===""||ii.target==="_self")||ii.tagName==="FORM"){ti.boosted=!0;var ni,ri;if(ii.tagName==="A")ni="get",ri=f(ii,"href");else{var si=f(ii,"method");ni=si?si.toLowerCase():"get",ri=f(ii,"action")}ei.forEach(function(ai){Ve(ii,function(ci){ar(ni,ri,ii,ci)},ti,ai,!0)})}}function je(ii,ti){return!!((ii.type==="submit"||ii.type==="click")&&(ti.tagName==="FORM"||d(ti,'input[type="submit"], button')&&N(ti,"form")!==null||ti.tagName==="A"&&ti.href&&(ti.getAttribute("href")==="#"||ti.getAttribute("href").indexOf("#")!==0)))}function Be(ii,ti){return W(ii).boosted&&ii.tagName==="A"&&ti.type==="click"&&(ti.ctrlKey||ti.metaKey)}function Ue(ii,ti){var ei=ii.eventFilter;if(ei)try{return ei(ti)!==!0}catch(ni){return J(_().body,"htmx:eventFilter:error",{error:ni,source:ei.source}),!0}return!1}function Ve(ii,ti,ei,ni,ri){var si;ni.from?si=I(ii,ni.from):si=[ii],G(si,function(ai){var ci=function(fi){if(!K(ii)){ai.removeEventListener(ni.trigger,ci);return}if(!Be(ii,fi)&&((ri||je(fi,ii))&&fi.preventDefault(),!Ue(ni,fi))){var vi=W(fi);vi.triggerSpec=ni,vi.handledFor==null&&(vi.handledFor=[]);var hi=W(ii);if(vi.handledFor.indexOf(ii)<0){if(vi.handledFor.push(ii),ni.consume&&fi.stopPropagation(),ni.target&&fi.target&&!d(fi.target,ni.target))return;if(ni.once){if(hi.triggeredOnce)return;hi.triggeredOnce=!0}if(ni.changed){if(hi.lastValue===ii.value)return;hi.lastValue=ii.value}if(hi.delayed&&clearTimeout(hi.delayed),hi.throttle)return;ni.throttle?hi.throttle||(ti(ii,fi),hi.throttle=setTimeout(function(){hi.throttle=null},ni.throttle)):ni.delay?hi.delayed=setTimeout(function(){ti(ii,fi)},ni.delay):ti(ii,fi)}}};ei.listenerInfos==null&&(ei.listenerInfos=[]),ei.listenerInfos.push({trigger:ni.trigger,listener:ci,on:ai}),ai.addEventListener(ni.trigger,ci)})}var _e=!1,ze=null;function We(){ze||(ze=function(){_e=!0},window.addEventListener("scroll",ze),setInterval(function(){_e&&(_e=!1,G(_().querySelectorAll("[hx-trigger='revealed'],[data-hx-trigger='revealed']"),function(ii){Ge(ii)}))},200))}function Ge(ii){if(!o(ii,"data-hx-revealed")&&b(ii)){ii.setAttribute("data-hx-revealed","true");var ti=W(ii);ti.initialized?$(ii,"revealed"):ii.addEventListener("htmx:afterProcessNode",function(ei){$(ii,"revealed")},{once:!0})}}function Je(ii,ti,ei){for(var ni=w(ei),ri=0;ri<ni.length;ri++){var si=ni[ri].split(/:(.+)/);si[0]==="connect"&&$e(ii,si[1],0),si[0]==="send"&&Ke(ii)}}function $e(ii,ti,ei){if(!!K(ii)){if(ti.indexOf("/")==0){var ni=location.hostname+(location.port?":"+location.port:"");location.protocol=="https:"?ti="wss://"+ni+ti:location.protocol=="http:"&&(ti="ws://"+ni+ti)}var ri=U.createWebSocket(ti);ri.onerror=function(si){J(ii,"htmx:wsError",{error:si,socket:ri}),Ze(ii)},ri.onclose=function(si){if([1006,1012,1013].indexOf(si.code)>=0){var ai=Ye(ei);setTimeout(function(){$e(ii,ti,ei+1)},ai)}},ri.onopen=function(si){ei=0},W(ii).webSocket=ri,ri.addEventListener("message",function(si){if(!Ze(ii)){var ai=si.data;xt(ii,function(wi){ai=wi.transformResponse(ai,null,ii)});for(var ci=Gt(ii),fi=g(ai),vi=y(fi.children),hi=0;hi<vi.length;hi++){var bi=vi[hi];ae(V(bi,"hx-swap-oob")||"true",bi,ci)}Lt(ci.tasks)}})}}function Ze(ii){if(!K(ii))return W(ii).webSocket.close(),!0}function Ke(ii){var ti=h(ii,function(ei){return W(ei).webSocket!=null});ti?ii.addEventListener(Me(ii)[0].trigger,function(ei){var ni=W(ti).webSocket,ri=Bt(ii,ti),si=Pt(ii,"post"),ai=si.errors,ci=si.values,fi=Qt(ii),vi=Y(ci,fi),hi=Ut(vi,ii);if(hi.HEADERS=ri,ai&&ai.length>0){$(ii,"htmx:validation:halted",ai);return}ni.send(JSON.stringify(hi)),je(ei,ii)&&ei.preventDefault()}):J(ii,"htmx:noWebSocketSourceError")}function Ye(ii){var ti=U.config.wsReconnectDelay;if(typeof ti=="function")return ti(ii);if(ti==="full-jitter"){var ei=Math.min(ii,6),ni=1e3*Math.pow(2,ei);return ni*Math.random()}yt('htmx.config.wsReconnectDelay must either be a function or the string "full-jitter"')}function Qe(ii,ti,ei){for(var ni=w(ei),ri=0;ri<ni.length;ri++){var si=ni[ri].split(/:(.+)/);si[0]==="connect"&&et(ii,si[1]),si[0]==="swap"&&tt(ii,si[1])}}function et(ii,ti){var ei=U.createEventSource(ti);ei.onerror=function(ni){J(ii,"htmx:sseError",{error:ni,source:ei}),nt(ii)},W(ii).sseEventSource=ei}function tt(ii,ti){var ei=h(ii,it);if(ei){var ni=W(ei).sseEventSource,ri=function(si){if(nt(ei)){ni.removeEventListener(ti,ri);return}var ai=si.data;xt(ii,function(hi){ai=hi.transformResponse(ai,null,ii)});var ci=_t(ii),fi=re(ii),vi=Gt(ii);Ee(ci.swapStyle,ii,fi,ai,vi),Lt(vi.tasks),$(ii,"htmx:sseMessage",si)};W(ii).sseListener=ri,ni.addEventListener(ti,ri)}else J(ii,"htmx:noSSESourceError")}function rt(ii,ti,ei){var ni=h(ii,it);if(ni){var ri=W(ni).sseEventSource,si=function(){nt(ni)||(K(ii)?ti(ii):ri.removeEventListener(ei,si))};W(ii).sseListener=si,ri.addEventListener(ei,si)}else J(ii,"htmx:noSSESourceError")}function nt(ii){if(!K(ii))return W(ii).sseEventSource.close(),!0}function it(ii){return W(ii).sseEventSource!=null}function at(ii,ti,ei,ni){var ri=function(){ei.loaded||(ei.loaded=!0,ti(ii))};ni?setTimeout(ri,ni):ri()}function ot(ii,ti,ei){var ni=!1;return G(n,function(ri){if(o(ii,"hx-"+ri)){var si=V(ii,"hx-"+ri);ni=!0,ti.path=si,ti.verb=ri,ei.forEach(function(ai){st(ii,ai,ti,function(ci,fi){ar(ri,si,ci,fi)})})}}),ni}function st(ii,ti,ei,ni){if(ti.sseEvent)rt(ii,ni,ti.sseEvent);else if(ti.trigger==="revealed")We(),Ve(ii,ni,ei,ti),Ge(ii);else if(ti.trigger==="intersect"){var ri={};ti.root&&(ri.root=Q(ii,ti.root)),ti.threshold&&(ri.threshold=parseFloat(ti.threshold));var si=new IntersectionObserver(function(ai){for(var ci=0;ci<ai.length;ci++){var fi=ai[ci];if(fi.isIntersecting){$(ii,"intersect");break}}},ri);si.observe(ii),Ve(ii,ni,ei,ti)}else ti.trigger==="load"?Ue(ti,pt("load",{elt:ii}))||at(ii,ni,ei,ti.delay):ti.pollInterval?(ei.polling=!0,Pe(ii,ni,ti)):Ve(ii,ni,ei,ti)}function lt(ii){if(ii.type==="text/javascript"||ii.type==="module"||ii.type===""){var ti=_().createElement("script");G(ii.attributes,function(ni){ti.setAttribute(ni.name,ni.value)}),ti.textContent=ii.textContent,ti.async=!1,U.config.inlineScriptNonce&&(ti.nonce=U.config.inlineScriptNonce);var ei=ii.parentElement;try{ei.insertBefore(ti,ii)}catch(ni){yt(ni)}finally{ei.removeChild(ii)}}}function ut(ii){d(ii,"script")&&lt(ii),G(O(ii,"script"),function(ti){lt(ti)})}function ft(){return document.querySelector("[hx-boost], [data-hx-boost]")}function ct(ii){if(ii.querySelectorAll){var ti=ft()?", a, form":"",ei=ii.querySelectorAll(i+ti+", [hx-sse], [data-hx-sse], [hx-ws], [data-hx-ws], [hx-ext], [hx-data-ext]");return ei}else return[]}function ht(ii){var ti=function(ei){if(d(ei.target,"button, input[type='submit']")){var ni=W(ii);ni.lastButtonClicked=ei.target}};ii.addEventListener("click",ti),ii.addEventListener("focusin",ti),ii.addEventListener("focusout",function(ei){var ni=W(ii);ni.lastButtonClicked=null})}function dt(ii){if(!(ii.closest&&ii.closest(U.config.disableSelector))){var ti=W(ii);if(!ti.initialized){ti.initialized=!0,$(ii,"htmx:beforeProcessNode"),ii.value&&(ti.lastValue=ii.value);var ei=Me(ii),ni=ot(ii,ti,ei);!ni&&z(ii,"hx-boost")==="true"&&Fe(ii,ti,ei),ii.tagName==="FORM"&&ht(ii);var ri=V(ii,"hx-sse");ri&&Qe(ii,ti,ri);var si=V(ii,"hx-ws");si&&Je(ii,ti,si),$(ii,"htmx:afterProcessNode")}}}function vt(ii){ii=D(ii),dt(ii),G(ct(ii),function(ti){dt(ti)})}function gt(ii){return ii.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function pt(ii,ti){var ei;return window.CustomEvent&&typeof window.CustomEvent=="function"?ei=new CustomEvent(ii,{bubbles:!0,cancelable:!0,detail:ti}):(ei=_().createEvent("CustomEvent"),ei.initCustomEvent(ii,!0,!0,ti)),ei}function J(ii,ti,ei){$(ii,ti,Y({error:ti},ei))}function mt(ii){return ii==="htmx:afterProcessNode"}function xt(ii,ti){G(hr(ii),function(ei){try{ti(ei)}catch(ni){yt(ni)}})}function yt(ii){console.error?console.error(ii):console.log&&console.log("ERROR: ",ii)}function $(ii,ti,ei){ii=D(ii),ei==null&&(ei={}),ei.elt=ii;var ni=pt(ti,ei);U.logger&&!mt(ti)&&U.logger(ii,ti,ei),ei.error&&(yt(ei.error),$(ii,"htmx:error",{errorInfo:ei}));var ri=ii.dispatchEvent(ni),si=gt(ti);if(ri&&si!==ti){var ai=pt(si,ni.detail);ri=ri&&ii.dispatchEvent(ai)}return xt(ii,function(ci){ri=ri&&ci.onEvent(ti,ni)!==!1}),ri}var bt=location.pathname+location.search;function wt(){var ii=_().querySelector("[hx-history-elt],[data-hx-history-elt]");return ii||_().body}function St(ii,ti,ei,ni){if(!!E()){for(var ri=S(localStorage.getItem("htmx-history-cache"))||[],si=0;si<ri.length;si++)if(ri[si].url===ii){ri.splice(si,1);break}for(ri.push({url:ii,content:ti,title:ei,scroll:ni});ri.length>U.config.historyCacheSize;)ri.shift();for(;ri.length>0;)try{localStorage.setItem("htmx-history-cache",JSON.stringify(ri));break}catch(ai){J(_().body,"htmx:historyCacheError",{cause:ai,cache:ri}),ri.shift()}}}function Et(ii){if(!E())return null;for(var ti=S(localStorage.getItem("htmx-history-cache"))||[],ei=0;ei<ti.length;ei++)if(ti[ei].url===ii)return ti[ei];return null}function Ct(ii){var ti=U.config.requestClass,ei=ii.cloneNode(!0);return G(O(ei,"."+ti),function(ni){T(ni,ti)}),ei.innerHTML}function Rt(){var ii=wt(),ti=bt||location.pathname+location.search;$(_().body,"htmx:beforeHistorySave",{path:ti,historyElt:ii}),U.config.historyEnabled&&history.replaceState({htmx:!0},_().title,window.location.href),St(ti,Ct(ii),_().title,window.scrollY)}function Ot(ii){U.config.historyEnabled&&history.pushState({htmx:!0},"",ii),bt=ii}function qt(ii){U.config.historyEnabled&&history.replaceState({htmx:!0},"",ii),bt=ii}function Lt(ii){G(ii,function(ti){ti.call()})}function Tt(ii){var ti=new XMLHttpRequest,ei={path:ii,xhr:ti};$(_().body,"htmx:historyCacheMiss",ei),ti.open("GET",ii,!0),ti.setRequestHeader("HX-History-Restore-Request","true"),ti.onload=function(){if(this.status>=200&&this.status<400){$(_().body,"htmx:historyCacheMissLoad",ei);var ni=g(this.response);ni=ni.querySelector("[hx-history-elt],[data-hx-history-elt]")||ni;var ri=wt(),si=Gt(ri);ye(ri,ni,si),Lt(si.tasks),bt=ii,$(_().body,"htmx:historyRestore",{path:ii})}else J(_().body,"htmx:historyCacheMissLoadError",ei)},ti.send()}function At(ii){Rt(),ii=ii||location.pathname+location.search;var ti=Et(ii);if(ti){var ei=g(ti.content),ni=wt(),ri=Gt(ni);ye(ni,ei,ri),Lt(ri.tasks),document.title=ti.title,window.scrollTo(0,ti.scroll),bt=ii,$(_().body,"htmx:historyRestore",{path:ii})}else U.config.refreshOnHistoryMiss?window.location.reload(!0):Tt(ii)}function Ht(ii){var ti=j(ii,"hx-indicator");return ti==null&&(ti=[ii]),G(ti,function(ei){ei.classList.add.call(ei.classList,U.config.requestClass)}),ti}function Nt(ii){G(ii,function(ti){ti.classList.remove.call(ti.classList,U.config.requestClass)})}function It(ii,ti){for(var ei=0;ei<ii.length;ei++){var ni=ii[ei];if(ni.isSameNode(ti))return!0}return!1}function kt(ii){return ii.name===""||ii.name==null||ii.disabled||ii.type==="button"||ii.type==="submit"||ii.tagName==="image"||ii.tagName==="reset"||ii.tagName==="file"?!1:ii.type==="checkbox"||ii.type==="radio"?ii.checked:!0}function Mt(ii,ti,ei,ni,ri){if(!(ni==null||It(ii,ni))){if(ii.push(ni),kt(ni)){var si=f(ni,"name"),ai=ni.value;if(ni.multiple&&(ai=y(ni.querySelectorAll("option:checked")).map(function(vi){return vi.value})),ni.files&&(ai=y(ni.files)),si!=null&&ai!=null){var ci=ti[si];ci?Array.isArray(ci)?Array.isArray(ai)?ti[si]=ci.concat(ai):ci.push(ai):Array.isArray(ai)?ti[si]=[ci].concat(ai):ti[si]=[ci,ai]:ti[si]=ai}ri&&Dt(ni,ei)}if(d(ni,"form")){var fi=ni.elements;G(fi,function(vi){Mt(ii,ti,ei,vi,ri)})}}}function Dt(ii,ti){ii.willValidate&&($(ii,"htmx:validation:validate"),ii.checkValidity()||(ti.push({elt:ii,message:ii.validationMessage,validity:ii.validity}),$(ii,"htmx:validation:failed",{message:ii.validationMessage,validity:ii.validity})))}function Pt(ii,ti){var ei=[],ni={},ri={},si=[],ai=W(ii),ci=d(ii,"form")&&ii.noValidate!==!0;if(ai.lastButtonClicked&&(ci=ci&&ai.lastButtonClicked.formNoValidate!==!0),ti!=="get"&&Mt(ei,ri,si,N(ii,"form"),ci),Mt(ei,ni,si,ii,ci),ai.lastButtonClicked){var fi=f(ai.lastButtonClicked,"name");fi&&(ni[fi]=ai.lastButtonClicked.value)}var vi=j(ii,"hx-include");return G(vi,function(hi){Mt(ei,ni,si,hi,ci),d(hi,"form")||G(hi.querySelectorAll(ke),function(bi){Mt(ei,ni,si,bi,ci)})}),ni=Y(ni,ri),{errors:si,values:ni}}function Xt(ii,ti,ei){ii!==""&&(ii+="&"),String(ei)==="[object Object]"&&(ei=JSON.stringify(ei));var ni=encodeURIComponent(ei);return ii+=encodeURIComponent(ti)+"="+ni,ii}function Ft(ii){var ti="";for(var ei in ii)if(ii.hasOwnProperty(ei)){var ni=ii[ei];Array.isArray(ni)?G(ni,function(ri){ti=Xt(ti,ei,ri)}):ti=Xt(ti,ei,ni)}return ti}function jt(ii){var ti=new FormData;for(var ei in ii)if(ii.hasOwnProperty(ei)){var ni=ii[ei];Array.isArray(ni)?G(ni,function(ri){ti.append(ei,ri)}):ti.append(ei,ni)}return ti}function Bt(ii,ti,ei){var ni={"HX-Request":"true","HX-Trigger":f(ii,"id"),"HX-Trigger-Name":f(ii,"name"),"HX-Target":V(ti,"id"),"HX-Current-URL":_().location.href};return $t(ii,"hx-headers",!1,ni),ei!==void 0&&(ni["HX-Prompt"]=ei),W(ii).boosted&&(ni["HX-Boosted"]="true"),ni}function Ut(ii,ti){var ei=z(ti,"hx-params");if(ei){if(ei==="none")return{};if(ei==="*")return ii;if(ei.indexOf("not ")===0)return G(ei.substr(4).split(","),function(ri){ri=ri.trim(),delete ii[ri]}),ii;var ni={};return G(ei.split(","),function(ri){ri=ri.trim(),ni[ri]=ii[ri]}),ni}else return ii}function Vt(ii){return f(ii,"href")&&f(ii,"href").indexOf("#")>=0}function _t(ii,ti){var ei=ti||z(ii,"hx-swap"),ni={swapStyle:W(ii).boosted?"innerHTML":U.config.defaultSwapStyle,swapDelay:U.config.defaultSwapDelay,settleDelay:U.config.defaultSettleDelay};if(W(ii).boosted&&!Vt(ii)&&(ni.show="top"),ei){var ri=w(ei);if(ri.length>0){ni.swapStyle=ri[0];for(var si=1;si<ri.length;si++){var ai=ri[si];if(ai.indexOf("swap:")===0&&(ni.swapDelay=v(ai.substr(5))),ai.indexOf("settle:")===0&&(ni.settleDelay=v(ai.substr(7))),ai.indexOf("scroll:")===0){var ci=ai.substr(7),fi=ci.split(":"),vi=fi.pop(),hi=fi.length>0?fi.join(":"):null;ni.scroll=vi,ni.scrollTarget=hi}if(ai.indexOf("show:")===0){var bi=ai.substr(5),fi=bi.split(":"),wi=fi.pop(),hi=fi.length>0?fi.join(":"):null;ni.show=wi,ni.showTarget=hi}if(ai.indexOf("focus-scroll:")===0){var Ti=ai.substr("focus-scroll:".length);ni.focusScroll=Ti=="true"}}}}return ni}function zt(ii){return z(ii,"hx-encoding")==="multipart/form-data"||d(ii,"form")&&f(ii,"enctype")==="multipart/form-data"}function Wt(ii,ti,ei){var ni=null;return xt(ti,function(ri){ni==null&&(ni=ri.encodeParameters(ii,ei,ti))}),ni!=null?ni:zt(ti)?jt(ei):Ft(ei)}function Gt(ii){return{tasks:[],elts:[ii]}}function Jt(ii,ti){var ei=ii[0],ni=ii[ii.length-1];if(ti.scroll){var ri=null;ti.scrollTarget&&(ri=Q(ei,ti.scrollTarget)),ti.scroll==="top"&&(ei||ri)&&(ri=ri||ei,ri.scrollTop=0),ti.scroll==="bottom"&&(ni||ri)&&(ri=ri||ni,ri.scrollTop=ri.scrollHeight)}if(ti.show){var ri=null;if(ti.showTarget){var si=ti.showTarget;ti.showTarget==="window"&&(si="body"),ri=Q(ei,si)}ti.show==="top"&&(ei||ri)&&(ri=ri||ei,ri.scrollIntoView({block:"start",behavior:U.config.scrollBehavior})),ti.show==="bottom"&&(ni||ri)&&(ri=ri||ni,ri.scrollIntoView({block:"end",behavior:U.config.scrollBehavior}))}}function $t(ii,ti,ei,ni){if(ni==null&&(ni={}),ii==null)return ni;var ri=V(ii,ti);if(ri){var si=ri.trim(),ai=ei;si.indexOf("javascript:")===0?(si=si.substr(11),ai=!0):si.indexOf("js:")===0&&(si=si.substr(3),ai=!0),si.indexOf("{")!==0&&(si="{"+si+"}");var ci;ai?ci=Zt(ii,function(){return Function("return ("+si+")")()},{}):ci=S(si);for(var fi in ci)ci.hasOwnProperty(fi)&&ni[fi]==null&&(ni[fi]=ci[fi])}return $t(u(ii),ti,ei,ni)}function Zt(ii,ti,ei){return U.config.allowEval?ti():(J(ii,"htmx:evalDisallowedError"),ei)}function Kt(ii,ti){return $t(ii,"hx-vars",!0,ti)}function Yt(ii,ti){return $t(ii,"hx-vals",!1,ti)}function Qt(ii){return Y(Kt(ii),Yt(ii))}function er(ii,ti,ei){if(ei!==null)try{ii.setRequestHeader(ti,ei)}catch(ni){ii.setRequestHeader(ti,encodeURIComponent(ei)),ii.setRequestHeader(ti+"-URI-AutoEncoded","true")}}function tr(ii){if(ii.responseURL&&typeof URL!="undefined")try{var ti=new URL(ii.responseURL);return ti.pathname+ti.search}catch(ei){J(_().body,"htmx:badResponseUrl",{url:ii.responseURL})}}function rr(ii,ti){return ii.getAllResponseHeaders().match(ti)}function nr(ii,ti,ei){return ii=ii.toLowerCase(),ei?ei instanceof Element||p(ei,"String")?ar(ii,ti,null,null,{targetOverride:D(ei),returnPromise:!0}):ar(ii,ti,D(ei.source),ei.event,{handler:ei.handler,headers:ei.headers,values:ei.values,targetOverride:D(ei.target),swapOverride:ei.swap,returnPromise:!0}):ar(ii,ti,null,null,{returnPromise:!0})}function ir(ii){for(var ti=[];ii;)ti.push(ii),ii=ii.parentElement;return ti}function ar(ii,ti,ei,ni,ri){var si=null,ai=null;if(ri=ri!=null?ri:{},ri.returnPromise&&typeof Promise!="undefined")var ci=new Promise(function(fn,On){si=fn,ai=On});ei==null&&(ei=_().body);var fi=ri.handler||sr;if(!!K(ei)){var vi=ri.targetOverride||re(ei);if(vi==null||vi==ee){J(ei,"htmx:targetError",{target:V(ei,"hx-target")});return}var hi=ei,bi=W(ei),wi=z(ei,"hx-sync"),Ti=null,ki=!1;if(wi){var Ci=wi.split(":"),Bi=Ci[0].trim();if(Bi==="this"?hi=te(ei,"hx-sync"):hi=Q(ei,Bi),wi=(Ci[1]||"drop").trim(),bi=W(hi),wi==="drop"&&bi.xhr&&bi.abortable!==!0)return;if(wi==="abort"){if(bi.xhr)return;ki=!0}else if(wi==="replace")$(hi,"htmx:abort");else if(wi.indexOf("queue")===0){var rn=wi.split(" ");Ti=(rn[1]||"last").trim()}}if(bi.xhr)if(bi.abortable)$(hi,"htmx:abort");else{if(Ti==null){if(ni){var nn=W(ni);nn&&nn.triggerSpec&&nn.triggerSpec.queue&&(Ti=nn.triggerSpec.queue)}Ti==null&&(Ti="last")}bi.queuedRequests==null&&(bi.queuedRequests=[]),Ti==="first"&&bi.queuedRequests.length===0?bi.queuedRequests.push(function(){ar(ii,ti,ei,ni,ri)}):Ti==="all"?bi.queuedRequests.push(function(){ar(ii,ti,ei,ni,ri)}):Ti==="last"&&(bi.queuedRequests=[],bi.queuedRequests.push(function(){ar(ii,ti,ei,ni,ri)}));return}var Ji=new XMLHttpRequest;bi.xhr=Ji,bi.abortable=ki;var Wi=function(){if(bi.xhr=null,bi.abortable=!1,bi.queuedRequests!=null&&bi.queuedRequests.length>0){var fn=bi.queuedRequests.shift();fn()}},ln=z(ei,"hx-prompt");if(ln){var Yi=prompt(ln);if(Yi===null||!$(ei,"htmx:prompt",{prompt:Yi,target:vi}))return Z(si),Wi(),ci}var dn=z(ei,"hx-confirm");if(dn&&!confirm(dn))return Z(si),Wi(),ci;var un=Bt(ei,vi,Yi);ri.headers&&(un=Y(un,ri.headers));var pn=Pt(ei,ii),gn=pn.errors,Cn=pn.values;ri.values&&(Cn=Y(Cn,ri.values));var kn=Qt(ei),En=Y(Cn,kn),Li=Ut(En,ei);ii!=="get"&&!zt(ei)&&(un["Content-Type"]="application/x-www-form-urlencoded"),(ti==null||ti==="")&&(ti=_().location.href);var Ui=$t(ei,"hx-request"),ji={parameters:Li,unfilteredParameters:En,headers:un,target:vi,verb:ii,errors:gn,withCredentials:ri.credentials||Ui.credentials||U.config.withCredentials,timeout:ri.timeout||Ui.timeout||U.config.timeout,path:ti,triggeringEvent:ni};if(!$(ei,"htmx:configRequest",ji))return Z(si),Wi(),ci;if(ti=ji.path,ii=ji.verb,un=ji.headers,Li=ji.parameters,gn=ji.errors,gn&&gn.length>0)return $(ei,"htmx:validation:halted",ji),Z(si),Wi(),ci;var Fi=ti.split("#"),vn=Fi[0],sn=Fi[1],Pi=null;if(ii==="get"){Pi=vn;var Mi=Object.keys(Li).length!==0;Mi&&(Pi.indexOf("?")<0?Pi+="?":Pi+="&",Pi+=Ft(Li),sn&&(Pi+="#"+sn)),Ji.open("GET",Pi,!0)}else Ji.open(ii.toUpperCase(),ti,!0);if(Ji.overrideMimeType("text/html"),Ji.withCredentials=ji.withCredentials,Ji.timeout=ji.timeout,!Ui.noHeaders){for(var $i in un)if(un.hasOwnProperty($i)){var en=un[$i];er(Ji,$i,en)}}var Ii={xhr:Ji,target:vi,requestConfig:ji,etc:ri,pathInfo:{requestPath:ti,finalRequestPath:Pi||ti,anchor:sn}};if(Ji.onload=function(){try{var fn=ir(ei);if(Ii.pathInfo.responsePath=tr(Ji),fi(ei,Ii),Nt(Ri),$(ei,"htmx:afterRequest",Ii),$(ei,"htmx:afterOnLoad",Ii),!K(ei)){for(var On=null;fn.length>0&&On==null;){var In=fn.shift();K(In)&&(On=In)}On&&($(On,"htmx:afterRequest",Ii),$(On,"htmx:afterOnLoad",Ii))}Z(si),Wi()}catch(br){throw J(ei,"htmx:onLoadError",Y({error:br},Ii)),br}},Ji.onerror=function(){Nt(Ri),J(ei,"htmx:afterRequest",Ii),J(ei,"htmx:sendError",Ii),Z(ai),Wi()},Ji.onabort=function(){Nt(Ri),J(ei,"htmx:afterRequest",Ii),J(ei,"htmx:sendAbort",Ii),Z(ai),Wi()},Ji.ontimeout=function(){Nt(Ri),J(ei,"htmx:afterRequest",Ii),J(ei,"htmx:timeout",Ii),Z(ai),Wi()},!$(ei,"htmx:beforeRequest",Ii))return Z(si),Wi(),ci;var Ri=Ht(ei);return G(["loadstart","loadend","progress","abort"],function(fn){G([Ji,Ji.upload],function(On){On.addEventListener(fn,function(In){$(ei,"htmx:xhr:"+fn,{lengthComputable:In.lengthComputable,loaded:In.loaded,total:In.total})})})}),$(ei,"htmx:beforeSend",Ii),Ji.send(ii==="get"?null:Wt(Ji,ei,Li)),ci}}function or(ii,ti){var ei=ti.xhr,ni=null,ri=null;if(rr(ei,/HX-Push:/i)?(ni=ei.getResponseHeader("HX-Push"),ri="push"):rr(ei,/HX-Push-Url:/i)?(ni=ei.getResponseHeader("HX-Push-Url"),ri="push"):rr(ei,/HX-Replace-Url:/i)&&(ni=ei.getResponseHeader("HX-Replace-Url"),ri="replace"),ni)return ni==="false"?{}:{type:ri,path:ni};var si=ti.pathInfo.finalRequestPath,ai=ti.pathInfo.responsePath,ci=z(ii,"hx-push-url"),fi=z(ii,"hx-replace-url"),vi=W(ii).boosted,hi=null,bi=null;return ci?(hi="push",bi=ci):fi?(hi="replace",bi=fi):vi&&(hi="push",bi=ai||si),bi?bi==="false"?{}:(bi==="true"&&(bi=ai||si),ti.pathInfo.anchor&&bi.indexOf("#")===-1&&(bi=bi+"#"+ti.pathInfo.anchor),{type:hi,path:bi}):{}}function sr(ii,ti){var ei=ti.xhr,ni=ti.target,ri=ti.etc;if(!!$(ii,"htmx:beforeOnLoad",ti)){if(rr(ei,/HX-Trigger:/i)&&Ce(ei,"HX-Trigger",ii),rr(ei,/HX-Location:/i)){Rt();var si=ei.getResponseHeader("HX-Location"),ai;si.indexOf("{")===0&&(ai=S(si),si=ai.path,delete ai.path),nr("GET",si,ai).then(()=>{Ot(si)});return}if(rr(ei,/HX-Redirect:/i)){location.href=ei.getResponseHeader("HX-Redirect");return}if(rr(ei,/HX-Refresh:/i)&&ei.getResponseHeader("HX-Refresh")==="true"){location.reload();return}rr(ei,/HX-Retarget:/i)&&(ti.target=_().querySelector(ei.getResponseHeader("HX-Retarget")));var ci=or(ii,ti),fi=ei.status>=200&&ei.status<400&&ei.status!==204,vi=ei.response,hi=ei.status>=400,bi=Y({shouldSwap:fi,serverResponse:vi,isError:hi},ti);if(!!$(ni,"htmx:beforeSwap",bi)){if(ni=bi.target,vi=bi.serverResponse,hi=bi.isError,ti.failed=hi,ti.successful=!hi,bi.shouldSwap){ei.status===286&&De(ii),xt(ii,function(Ci){vi=Ci.transformResponse(vi,ei,ii)}),ci.type&&Rt();var wi=ri.swapOverride;rr(ei,/HX-Reswap:/i)&&(wi=ei.getResponseHeader("HX-Reswap"));var ai=_t(ii,wi);ni.classList.add(U.config.swappingClass);var Ti=function(){try{var Ci=document.activeElement,Bi={};try{Bi={elt:Ci,start:Ci?Ci.selectionStart:null,end:Ci?Ci.selectionEnd:null}}catch(Yi){}var rn=Gt(ni);if(Ee(ai.swapStyle,ni,ii,vi,rn),Bi.elt&&!K(Bi.elt)&&Bi.elt.id){var nn=document.getElementById(Bi.elt.id),Ji={preventScroll:ai.focusScroll!==void 0?!ai.focusScroll:!U.config.defaultFocusScroll};nn&&(Bi.start&&nn.setSelectionRange&&nn.setSelectionRange(Bi.start,Bi.end),nn.focus(Ji))}if(ni.classList.remove(U.config.swappingClass),G(rn.elts,function(Yi){Yi.classList&&Yi.classList.add(U.config.settlingClass),$(Yi,"htmx:afterSwap",ti)}),rr(ei,/HX-Trigger-After-Swap:/i)){var Wi=ii;K(ii)||(Wi=_().body),Ce(ei,"HX-Trigger-After-Swap",Wi)}var ln=function(){if(G(rn.tasks,function(pn){pn.call()}),G(rn.elts,function(pn){pn.classList&&pn.classList.remove(U.config.settlingClass),$(pn,"htmx:afterSettle",ti)}),ci.type&&(ci.type==="push"?(Ot(ci.path),$(_().body,"htmx:pushedIntoHistory",{path:ci.path})):(qt(ci.path),$(_().body,"htmx:replacedInHistory",{path:ci.path}))),ti.pathInfo.anchor){var Yi=R("#"+ti.pathInfo.anchor);Yi&&Yi.scrollIntoView({block:"start",behavior:"auto"})}if(rn.title){var dn=R("title");dn?dn.innerHTML=rn.title:window.document.title=rn.title}if(Jt(rn.elts,ai),rr(ei,/HX-Trigger-After-Settle:/i)){var un=ii;K(ii)||(un=_().body),Ce(ei,"HX-Trigger-After-Settle",un)}};ai.settleDelay>0?setTimeout(ln,ai.settleDelay):ln()}catch(Yi){throw J(ii,"htmx:swapError",ti),Yi}};ai.swapDelay>0?setTimeout(Ti,ai.swapDelay):Ti()}hi&&J(ii,"htmx:responseError",Y({error:"Response Status Error Code "+ei.status+" from "+ti.pathInfo.path},ti))}}}var lr={};function ur(){return{init:function(ii){return null},onEvent:function(ii,ti){return!0},transformResponse:function(ii,ti,ei){return ii},isInlineSwap:function(ii){return!1},handleSwap:function(ii,ti,ei,ni){return!1},encodeParameters:function(ii,ti,ei){return null}}}function fr(ii,ti){ti.init&&ti.init(r),lr[ii]=Y(ur(),ti)}function cr(ii){delete lr[ii]}function hr(ii,ti,ei){if(ii==null)return ti;ti==null&&(ti=[]),ei==null&&(ei=[]);var ni=V(ii,"hx-ext");return ni&&G(ni.split(","),function(ri){if(ri=ri.replace(/ /g,""),ri.slice(0,7)=="ignore:"){ei.push(ri.slice(7));return}if(ei.indexOf(ri)<0){var si=lr[ri];si&&ti.indexOf(si)<0&&ti.push(si)}}),hr(u(ii),ti,ei)}function dr(ii){_().readyState!=="loading"?ii():_().addEventListener("DOMContentLoaded",ii)}function vr(){U.config.includeIndicatorStyles!==!1&&_().head.insertAdjacentHTML("beforeend","<style> ."+U.config.indicatorClass+"{opacity:0;transition: opacity 200ms ease-in;} ."+U.config.requestClass+" ."+U.config.indicatorClass+"{opacity:1} ."+U.config.requestClass+"."+U.config.indicatorClass+"{opacity:1} </style>")}function gr(){var ii=_().querySelector('meta[name="htmx-config"]');return ii?S(ii.content):null}function pr(){var ii=gr();ii&&(U.config=Y(U.config,ii))}return dr(function(){pr(),vr();var ii=_().body;vt(ii);var ti=_().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");ii.addEventListener("htmx:abort",function(ei){var ni=ei.target,ri=W(ni);ri&&ri.xhr&&ri.xhr.abort()}),window.onpopstate=function(ei){ei.state&&ei.state.htmx&&(At(),G(ti,function(ni){$(ni,"htmx:restored",{document:_(),triggerEvent:$})}))},setTimeout(function(){$(ii,"htmx:load",{})},0)}),U}()})});var Za=Un((Oc,Mc)=>{(function(ii,ti){typeof Oc=="object"&&typeof Mc!="undefined"?Mc.exports=ti():typeof define=="function"&&define.amd?define(ti):(ii=typeof globalThis!="undefined"?globalThis:ii||self,ii.TomSelect=ti())})(Oc,function(){"use strict";function ii(di,oi){di.split(/\s+/).forEach(li=>{oi(li)})}class ti{constructor(){this._events=void 0,this._events={}}on(oi,li){ii(oi,ui=>{let mi=this._events[ui]||[];mi.push(li),this._events[ui]=mi})}off(oi,li){var ui=arguments.length;if(ui===0){this._events={};return}ii(oi,mi=>{if(ui===1){delete this._events[mi];return}let yi=this._events[mi];yi!==void 0&&(yi.splice(yi.indexOf(li),1),this._events[mi]=yi)})}trigger(oi,...li){var ui=this;ii(oi,mi=>{let yi=ui._events[mi];yi!==void 0&&yi.forEach(_i=>{_i.apply(ui,li)})})}}function ei(di){return di.plugins={},class extends di{constructor(...oi){super(...oi);this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(oi,li){di.plugins[oi]={name:oi,fn:li}}initializePlugins(oi){var li,ui;let mi=this,yi=[];if(Array.isArray(oi))oi.forEach(_i=>{typeof _i=="string"?yi.push(_i):(mi.plugins.settings[_i.name]=_i.options,yi.push(_i.name))});else if(oi)for(li in oi)oi.hasOwnProperty(li)&&(mi.plugins.settings[li]=oi[li],yi.push(li));for(;ui=yi.shift();)mi.require(ui)}loadPlugin(oi){var li=this,ui=li.plugins,mi=di.plugins[oi];if(!di.plugins.hasOwnProperty(oi))throw new Error('Unable to find "'+oi+'" plugin');ui.requested[oi]=!0,ui.loaded[oi]=mi.fn.apply(li,[li.plugins.settings[oi]||{}]),ui.names.push(oi)}require(oi){var li=this,ui=li.plugins;if(!li.plugins.loaded.hasOwnProperty(oi)){if(ui.requested[oi])throw new Error('Plugin has circular dependency ("'+oi+'")');li.loadPlugin(oi)}return ui.loaded[oi]}}}let ni=di=>(di=di.filter(Boolean),di.length<2?di[0]||"":fi(di)==1?"["+di.join("")+"]":"(?:"+di.join("|")+")"),ri=di=>{if(!ai(di))return di.join("");let oi="",li=0,ui=()=>{li>1&&(oi+="{"+li+"}")};return di.forEach((mi,yi)=>{if(mi===di[yi-1]){li++;return}ui(),oi+=mi,li=1}),ui(),oi},si=di=>{let oi=hi(di);return ni(oi)},ai=di=>new Set(di).size!==di.length,ci=di=>(di+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),fi=di=>di.reduce((oi,li)=>Math.max(oi,vi(li)),0),vi=di=>hi(di).length,hi=di=>Array.from(di);let bi=di=>{if(di.length===1)return[[di]];let oi=[],li=di.substring(1);return bi(li).forEach(function(mi){let yi=mi.slice(0);yi[0]=di.charAt(0)+yi[0],oi.push(yi),yi=mi.slice(0),yi.unshift(di.charAt(0)),oi.push(yi)}),oi};let wi=[[0,65535]],Ti="[\u0300-\u036F\xB7\u02BE\u02BC]",ki,Ci,Bi=3,rn={},nn={"/":"\u2044\u2215","0":"\u07C0",a:"\u2C65\u0250\u0251",aa:"\uA733",ae:"\xE6\u01FD\u01E3",ao:"\uA735",au:"\uA737",av:"\uA739\uA73B",ay:"\uA73D",b:"\u0180\u0253\u0183",c:"\uA73F\u0188\u023C\u2184",d:"\u0111\u0257\u0256\u1D05\u018C\uABB7\u0501\u0266",e:"\u025B\u01DD\u1D07\u0247",f:"\uA77C\u0192",g:"\u01E5\u0260\uA7A1\u1D79\uA77F\u0262",h:"\u0127\u2C68\u2C76\u0265",i:"\u0268\u0131",j:"\u0249\u0237",k:"\u0199\u2C6A\uA741\uA743\uA745\uA7A3",l:"\u0142\u019A\u026B\u2C61\uA749\uA747\uA781\u026D",m:"\u0271\u026F\u03FB",n:"\uA7A5\u019E\u0272\uA791\u1D0E\u043B\u0509",o:"\xF8\u01FF\u0254\u0275\uA74B\uA74D\u1D11",oe:"\u0153",oi:"\u01A3",oo:"\uA74F",ou:"\u0223",p:"\u01A5\u1D7D\uA751\uA753\uA755\u03C1",q:"\uA757\uA759\u024B",r:"\u024D\u027D\uA75B\uA7A7\uA783",s:"\xDF\u023F\uA7A9\uA785\u0282",t:"\u0167\u01AD\u0288\u2C66\uA787",th:"\xFE",tz:"\uA729",u:"\u0289",v:"\u028B\uA75F\u028C",vy:"\uA761",w:"\u2C73",y:"\u01B4\u024F\u1EFF",z:"\u01B6\u0225\u0240\u2C6C\uA763",hv:"\u0195"};for(let di in nn){let oi=nn[di]||"";for(let li=0;li<oi.length;li++){let ui=oi.substring(li,li+1);rn[ui]=di}}let Ji=new RegExp(Object.keys(rn).join("|")+"|"+Ti,"gu"),Wi=di=>{ki===void 0&&(ki=gn(di||wi))},ln=(di,oi="NFKD")=>di.normalize(oi),Yi=di=>hi(di).reduce((oi,li)=>oi+dn(li),""),dn=di=>(di=ln(di).toLowerCase().replace(Ji,oi=>rn[oi]||""),ln(di,"NFC"));function*un(di){for(let[oi,li]of di)for(let ui=oi;ui<=li;ui++){let mi=String.fromCharCode(ui),yi=Yi(mi);yi!=mi.toLowerCase()&&(yi.length>Bi||yi.length!=0&&(yield{folded:yi,composed:mi,code_point:ui}))}}let pn=di=>{let oi={},li=(ui,mi)=>{let yi=oi[ui]||new Set,_i=new RegExp("^"+si(yi)+"$","iu");mi.match(_i)||(yi.add(ci(mi)),oi[ui]=yi)};for(let ui of un(di))li(ui.folded,ui.folded),li(ui.folded,ui.composed);return oi},gn=di=>{let oi=pn(di),li={},ui=[];for(let yi in oi){let _i=oi[yi];_i&&(li[yi]=si(_i)),yi.length>1&&ui.push(ci(yi))}ui.sort((yi,_i)=>_i.length-yi.length);let mi=ni(ui);return Ci=new RegExp("^"+mi,"u"),li},Cn=(di,oi=1)=>{let li=0;return di=di.map(ui=>(ki[ui]&&(li+=ui.length),ki[ui]||ui)),li>=oi?ri(di):""},kn=(di,oi=1)=>(oi=Math.max(oi,di.length-1),ni(bi(di).map(li=>Cn(li,oi)))),En=(di,oi=!0)=>{let li=di.length>1?1:0;return ni(di.map(ui=>{let mi=[],yi=oi?ui.length():ui.length()-1;for(let _i=0;_i<yi;_i++)mi.push(kn(ui.substrs[_i]||"",li));return ri(mi)}))},Li=(di,oi)=>{for(let li of oi){if(li.start!=di.start||li.end!=di.end||li.substrs.join("")!==di.substrs.join(""))continue;let ui=di.parts,mi=_i=>{for(let Si of ui){if(Si.start===_i.start&&Si.substr===_i.substr)return!1;if(!(_i.length==1||Si.length==1)&&(_i.start<Si.start&&_i.end>Si.start||Si.start<_i.start&&Si.end>_i.start))return!0}return!1};if(!(li.parts.filter(mi).length>0))return!0}return!1};class Ui{constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(oi){oi&&(this.parts.push(oi),this.substrs.push(oi.substr),this.start=Math.min(oi.start,this.start),this.end=Math.max(oi.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(oi,li){let ui=new Ui,mi=JSON.parse(JSON.stringify(this.parts)),yi=mi.pop();for(let Ai of mi)ui.add(Ai);let _i=li.substr.substring(0,oi-yi.start),Si=_i.length;return ui.add({start:yi.start,end:yi.start+Si,length:Si,substr:_i}),ui}}let ji=di=>{Wi(),di=Yi(di);let oi="",li=[new Ui];for(let ui=0;ui<di.length;ui++){let yi=di.substring(ui).match(Ci),_i=di.substring(ui,ui+1),Si=yi?yi[0]:null,Ai=[],Di=new Set;for(let zi of li){let Hi=zi.last();if(!Hi||Hi.length==1||Hi.end<=ui)if(Si){let Zi=Si.length;zi.add({start:ui,end:ui+Zi,length:Zi,substr:Si}),Di.add("1")}else zi.add({start:ui,end:ui+1,length:1,substr:_i}),Di.add("2");else if(Si){let Zi=zi.clone(ui,Hi),Pn=Si.length;Zi.add({start:ui,end:ui+Pn,length:Pn,substr:Si}),Ai.push(Zi)}else Di.add("3")}if(Ai.length>0){Ai=Ai.sort((zi,Hi)=>zi.length()-Hi.length());for(let zi of Ai)Li(zi,li)||li.push(zi);continue}if(ui>0&&Di.size==1&&!Di.has("3")){oi+=En(li,!1);let zi=new Ui,Hi=li[0];Hi&&zi.add(Hi.last()),li=[zi]}}return oi+=En(li,!0),oi};let Fi=(di,oi)=>{if(!!di)return di[oi]},vn=(di,oi)=>{if(!!di){for(var li,ui=oi.split(".");(li=ui.shift())&&(di=di[li]););return di}},sn=(di,oi,li)=>{var ui,mi;return!di||(di=di+"",oi.regex==null)||(mi=di.search(oi.regex),mi===-1)?0:(ui=oi.string.length/di.length,mi===0&&(ui+=.5),ui*li)},Pi=(di,oi)=>{var li=di[oi];if(typeof li=="function")return li;li&&!Array.isArray(li)&&(di[oi]=[li])},Mi=(di,oi)=>{if(Array.isArray(di))di.forEach(oi);else for(var li in di)di.hasOwnProperty(li)&&oi(di[li],li)},$i=(di,oi)=>typeof di=="number"&&typeof oi=="number"?di>oi?1:di<oi?-1:0:(di=Yi(di+"").toLowerCase(),oi=Yi(oi+"").toLowerCase(),di>oi?1:oi>di?-1:0);class en{constructor(oi,li){this.items=void 0,this.settings=void 0,this.items=oi,this.settings=li||{diacritics:!0}}tokenize(oi,li,ui){if(!oi||!oi.length)return[];let mi=[],yi=oi.split(/\s+/);var _i;return ui&&(_i=new RegExp("^("+Object.keys(ui).map(ci).join("|")+"):(.*)$")),yi.forEach(Si=>{let Ai,Di=null,zi=null;_i&&(Ai=Si.match(_i))&&(Di=Ai[1],Si=Ai[2]),Si.length>0&&(this.settings.diacritics?zi=ji(Si)||null:zi=ci(Si),zi&&li&&(zi="\\b"+zi)),mi.push({string:Si,regex:zi?new RegExp(zi,"iu"):null,field:Di})}),mi}getScoreFunction(oi,li){var ui=this.prepareSearch(oi,li);return this._getScoreFunction(ui)}_getScoreFunction(oi){let li=oi.tokens,ui=li.length;if(!ui)return function(){return 0};let mi=oi.options.fields,yi=oi.weights,_i=mi.length,Si=oi.getAttrFn;if(!_i)return function(){return 1};let Ai=function(){return _i===1?function(Di,zi){let Hi=mi[0].field;return sn(Si(zi,Hi),Di,yi[Hi]||1)}:function(Di,zi){var Hi=0;if(Di.field){let Zi=Si(zi,Di.field);!Di.regex&&Zi?Hi+=1/_i:Hi+=sn(Zi,Di,1)}else Mi(yi,(Zi,Pn)=>{Hi+=sn(Si(zi,Pn),Di,Zi)});return Hi/_i}}();return ui===1?function(Di){return Ai(li[0],Di)}:oi.options.conjunction==="and"?function(Di){var zi,Hi=0;for(let Zi of li){if(zi=Ai(Zi,Di),zi<=0)return 0;Hi+=zi}return Hi/ui}:function(Di){var zi=0;return Mi(li,Hi=>{zi+=Ai(Hi,Di)}),zi/ui}}getSortFunction(oi,li){var ui=this.prepareSearch(oi,li);return this._getSortFunction(ui)}_getSortFunction(oi){var li,ui=[];let mi=this,yi=oi.options,_i=!oi.query&&yi.sort_empty?yi.sort_empty:yi.sort;if(typeof _i=="function")return _i.bind(this);let Si=function(zi,Hi){return zi==="$score"?Hi.score:oi.getAttrFn(mi.items[Hi.id],zi)};if(_i)for(let Di of _i)(oi.query||Di.field!=="$score")&&ui.push(Di);if(oi.query){li=!0;for(let Di of ui)if(Di.field==="$score"){li=!1;break}li&&ui.unshift({field:"$score",direction:"desc"})}else ui=ui.filter(Di=>Di.field!=="$score");return ui.length?function(Di,zi){var Hi,Zi;for(let Pn of ui)if(Zi=Pn.field,Hi=(Pn.direction==="desc"?-1:1)*$i(Si(Zi,Di),Si(Zi,zi)),Hi)return Hi;return 0}:null}prepareSearch(oi,li){let ui={};var mi=Object.assign({},li);if(Pi(mi,"sort"),Pi(mi,"sort_empty"),mi.fields){Pi(mi,"fields");let yi=[];mi.fields.forEach(_i=>{typeof _i=="string"&&(_i={field:_i,weight:1}),yi.push(_i),ui[_i.field]="weight"in _i?_i.weight:1}),mi.fields=yi}return{options:mi,query:oi.toLowerCase().trim(),tokens:this.tokenize(oi,mi.respect_word_boundaries,ui),total:0,items:[],weights:ui,getAttrFn:mi.nesting?vn:Fi}}search(oi,li){var ui=this,mi,yi;yi=this.prepareSearch(oi,li),li=yi.options,oi=yi.query;let _i=li.score||ui._getScoreFunction(yi);oi.length?Mi(ui.items,(Ai,Di)=>{mi=_i(Ai),(li.filter===!1||mi>0)&&yi.items.push({score:mi,id:Di})}):Mi(ui.items,(Ai,Di)=>{yi.items.push({score:1,id:Di})});let Si=ui._getSortFunction(yi);return Si&&yi.items.sort(Si),yi.total=yi.items.length,typeof li.limit=="number"&&(yi.items=yi.items.slice(0,li.limit)),yi}}let Ii=(di,oi)=>{if(Array.isArray(di))di.forEach(oi);else for(var li in di)di.hasOwnProperty(li)&&oi(di[li],li)},Ri=di=>{if(di.jquery)return di[0];if(di instanceof HTMLElement)return di;if(fn(di)){var oi=document.createElement("template");return oi.innerHTML=di.trim(),oi.content.firstChild}return document.querySelector(di)},fn=di=>typeof di=="string"&&di.indexOf("<")>-1,On=di=>di.replace(/['"\\]/g,"\\$&"),In=(di,oi)=>{var li=document.createEvent("HTMLEvents");li.initEvent(oi,!0,!1),di.dispatchEvent(li)},br=(di,oi)=>{Object.assign(di.style,oi)},Xn=(di,...oi)=>{var li=us(oi);di=qs(di),di.map(ui=>{li.map(mi=>{ui.classList.add(mi)})})},Er=(di,...oi)=>{var li=us(oi);di=qs(di),di.map(ui=>{li.map(mi=>{ui.classList.remove(mi)})})},us=di=>{var oi=[];return Ii(di,li=>{typeof li=="string"&&(li=li.trim().split(/[\11\12\14\15\40]/)),Array.isArray(li)&&(oi=oi.concat(li))}),oi.filter(Boolean)},qs=di=>(Array.isArray(di)||(di=[di]),di),Ts=(di,oi,li)=>{if(!(li&&!li.contains(di)))for(;di&&di.matches;){if(di.matches(oi))return di;di=di.parentNode}},Ws=(di,oi=0)=>oi>0?di[di.length-1]:di[0],po=di=>Object.keys(di).length===0,is=(di,oi)=>{if(!di)return-1;oi=oi||di.nodeName;for(var li=0;di=di.previousElementSibling;)di.matches(oi)&&li++;return li},Dn=(di,oi)=>{Ii(oi,(li,ui)=>{li==null?di.removeAttribute(ui):di.setAttribute(ui,""+li)})},ns=(di,oi)=>{di.parentNode&&di.parentNode.replaceChild(oi,di)},Kr=(di,oi)=>{if(oi===null)return;if(typeof oi=="string"){if(!oi.length)return;oi=new RegExp(oi,"i")}let li=yi=>{var _i=yi.data.match(oi);if(_i&&yi.data.length>0){var Si=document.createElement("span");Si.className="highlight";var Ai=yi.splitText(_i.index);Ai.splitText(_i[0].length);var Di=Ai.cloneNode(!0);return Si.appendChild(Di),ns(Ai,Si),1}return 0},ui=yi=>{yi.nodeType===1&&yi.childNodes&&!/(script|style)/i.test(yi.tagName)&&(yi.className!=="highlight"||yi.tagName!=="SPAN")&&Array.from(yi.childNodes).forEach(_i=>{mi(_i)})},mi=yi=>yi.nodeType===3?li(yi):(ui(yi),0);mi(di)},Cs=di=>{var oi=di.querySelectorAll("span.highlight");Array.prototype.forEach.call(oi,function(li){var ui=li.parentNode;ui.replaceChild(li.firstChild,li),ui.normalize()})},Ys=65,Ds=13,ds=27,Xr=37,mo=38,As=39,go=40,Ko=8,kl=46,Xo=9,vo=(typeof navigator=="undefined"?!1:/Mac/.test(navigator.userAgent))?"metaKey":"ctrlKey";var Ca={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(di){return di.length>0},render:{}};let _n=di=>typeof di=="undefined"||di===null?null:Os(di),Os=di=>typeof di=="boolean"?di?"1":"0":di+"",Ms=di=>(di+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Pl=(di,oi)=>oi>0?setTimeout(di,oi):(di.call(null),null),_o=(di,oi)=>{var li;return function(ui,mi){var yi=this;li&&(yi.loading=Math.max(yi.loading-1,0),clearTimeout(li)),li=setTimeout(function(){li=null,yi.loadedSearches[ui]=!0,di.call(yi,ui,mi)},oi)}},yo=(di,oi,li)=>{var ui,mi=di.trigger,yi={};di.trigger=function(){var _i=arguments[0];if(oi.indexOf(_i)!==-1)yi[_i]=arguments;else return mi.apply(di,arguments)},li.apply(di,[]),di.trigger=mi;for(ui of oi)ui in yi&&mi.apply(di,yi[ui])},Jr=di=>({start:di.selectionStart||0,length:(di.selectionEnd||0)-(di.selectionStart||0)}),xn=(di,oi=!1)=>{di&&(di.preventDefault(),oi&&di.stopPropagation())},Sn=(di,oi,li,ui)=>{di.addEventListener(oi,li,ui)},pi=(di,oi)=>{if(!oi||!oi[di])return!1;var li=(oi.altKey?1:0)+(oi.ctrlKey?1:0)+(oi.shiftKey?1:0)+(oi.metaKey?1:0);return li===1},gi=(di,oi)=>{let li=di.getAttribute("id");return li||(di.setAttribute("id",oi),oi)},Ei=di=>di.replace(/[\\"']/g,"\\$&"),xi=(di,oi)=>{oi&&di.append(oi)};function Ni(di,oi){var li=Object.assign({},Ca,oi),ui=li.dataAttr,mi=li.labelField,yi=li.valueField,_i=li.disabledField,Si=li.optgroupField,Ai=li.optgroupLabelField,Di=li.optgroupValueField,zi=di.tagName.toLowerCase(),Hi=di.getAttribute("placeholder")||di.getAttribute("data-placeholder");if(!Hi&&!li.allowEmptyOption){let bn=di.querySelector('option[value=""]');bn&&(Hi=bn.textContent)}var Zi={placeholder:Hi,options:[],optgroups:[],items:[],maxItems:null},Pn=()=>{var bn,Hn=Zi.options,Ln={},an=1;let Fn=0;var rs=yn=>{var An=Object.assign({},yn.dataset),mn=ui&&An[ui];return typeof mn=="string"&&mn.length&&(An=Object.assign(An,JSON.parse(mn))),An},Da=(yn,An)=>{var mn=_n(yn.value);if(mn!=null&&!(!mn&&!li.allowEmptyOption)){if(Ln.hasOwnProperty(mn)){if(An){var wr=Ln[mn][Si];wr?Array.isArray(wr)?wr.push(An):Ln[mn][Si]=[wr,An]:Ln[mn][Si]=An}}else{var Nn=rs(yn);Nn[mi]=Nn[mi]||yn.textContent,Nn[yi]=Nn[yi]||mn,Nn[_i]=Nn[_i]||yn.disabled,Nn[Si]=Nn[Si]||An,Nn.$option=yn,Nn.$order=Nn.$order||++Fn,Ln[mn]=Nn,Hn.push(Nn)}yn.selected&&Zi.items.push(mn)}},bo=yn=>{var An,mn;mn=rs(yn),mn[Ai]=mn[Ai]||yn.getAttribute("label")||"",mn[Di]=mn[Di]||an++,mn[_i]=mn[_i]||yn.disabled,mn.$order=mn.$order||++Fn,Zi.optgroups.push(mn),An=mn[Di],Ii(yn.children,wr=>{Da(wr,An)})};Zi.maxItems=di.hasAttribute("multiple")?null:1,Ii(di.children,yn=>{bn=yn.tagName.toLowerCase(),bn==="optgroup"?bo(yn):bn==="option"&&Da(yn)})},Xi=()=>{let bn=di.getAttribute(ui);if(bn)Zi.options=JSON.parse(bn),Ii(Zi.options,Ln=>{Zi.items.push(Ln[yi])});else{var Hn=di.value.trim()||"";if(!li.allowEmptyOption&&!Hn.length)return;let Ln=Hn.split(li.delimiter);Ii(Ln,an=>{let Fn={};Fn[mi]=an,Fn[yi]=an,Zi.options.push(Fn)}),Zi.items=Ln}};return zi==="select"?Pn():Xi(),Object.assign({},Ca,Zi,oi)}var Vi=0;class tn extends ei(ti){constructor(oi,li){super();this.control_input=void 0,this.wrapper=void 0,this.dropdown=void 0,this.control=void 0,this.dropdown_content=void 0,this.focus_node=void 0,this.order=0,this.settings=void 0,this.input=void 0,this.tabIndex=void 0,this.is_select_tag=void 0,this.rtl=void 0,this.inputId=void 0,this._destroy=void 0,this.sifter=void 0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isRequired=void 0,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.currentResults=void 0,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,Vi++;var ui,mi=Ri(oi);if(mi.tomselect)throw new Error("Tom Select already initialized on this element");mi.tomselect=this;var yi=window.getComputedStyle&&window.getComputedStyle(mi,null);ui=yi.getPropertyValue("direction");let _i=Ni(mi,li);this.settings=_i,this.input=mi,this.tabIndex=mi.tabIndex||0,this.is_select_tag=mi.tagName.toLowerCase()==="select",this.rtl=/rtl/i.test(ui),this.inputId=gi(mi,"tomselect-"+Vi),this.isRequired=mi.required,this.sifter=new en(this.options,{diacritics:_i.diacritics}),_i.mode=_i.mode||(_i.maxItems===1?"single":"multi"),typeof _i.hideSelected!="boolean"&&(_i.hideSelected=_i.mode==="multi"),typeof _i.hidePlaceholder!="boolean"&&(_i.hidePlaceholder=_i.mode!=="multi");var Si=_i.createFilter;typeof Si!="function"&&(typeof Si=="string"&&(Si=new RegExp(Si)),Si instanceof RegExp?_i.createFilter=Hn=>Si.test(Hn):_i.createFilter=Hn=>this.settings.duplicates||!this.options[Hn]),this.initializePlugins(_i.plugins),this.setupCallbacks(),this.setupTemplates();let Ai=Ri("<div>"),Di=Ri("<div>"),zi=this._render("dropdown"),Hi=Ri('<div role="listbox" tabindex="-1">'),Zi=this.input.getAttribute("class")||"",Pn=_i.mode;var Xi;if(Xn(Ai,_i.wrapperClass,Zi,Pn),Xn(Di,_i.controlClass),xi(Ai,Di),Xn(zi,_i.dropdownClass,Pn),_i.copyClassesToDropdown&&Xn(zi,Zi),Xn(Hi,_i.dropdownContentClass),xi(zi,Hi),Ri(_i.dropdownParent||Ai).appendChild(zi),fn(_i.controlInput)){Xi=Ri(_i.controlInput);var bn=["autocorrect","autocapitalize","autocomplete","spellcheck"];Mi(bn,Hn=>{mi.getAttribute(Hn)&&Dn(Xi,{[Hn]:mi.getAttribute(Hn)})}),Xi.tabIndex=-1,Di.appendChild(Xi),this.focus_node=Xi}else _i.controlInput?(Xi=Ri(_i.controlInput),this.focus_node=Xi):(Xi=Ri("<input/>"),this.focus_node=Di);this.wrapper=Ai,this.dropdown=zi,this.dropdown_content=Hi,this.control=Di,this.control_input=Xi,this.setup()}setup(){let oi=this,li=oi.settings,ui=oi.control_input,mi=oi.dropdown,yi=oi.dropdown_content,_i=oi.wrapper,Si=oi.control,Ai=oi.input,Di=oi.focus_node,zi={passive:!0},Hi=oi.inputId+"-ts-dropdown";Dn(yi,{id:Hi}),Dn(Di,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":Hi});let Zi=gi(Di,oi.inputId+"-ts-control"),Pn="label[for='"+On(oi.inputId)+"']",Xi=document.querySelector(Pn),bn=oi.focus.bind(oi);if(Xi){Sn(Xi,"click",bn),Dn(Xi,{for:Zi});let an=gi(Xi,oi.inputId+"-ts-label");Dn(Di,{"aria-labelledby":an}),Dn(yi,{"aria-labelledby":an})}if(_i.style.width=Ai.style.width,oi.plugins.names.length){let an="plugin-"+oi.plugins.names.join(" plugin-");Xn([_i,mi],an)}(li.maxItems===null||li.maxItems>1)&&oi.is_select_tag&&Dn(Ai,{multiple:"multiple"}),li.placeholder&&Dn(ui,{placeholder:li.placeholder}),!li.splitOn&&li.delimiter&&(li.splitOn=new RegExp("\\s*"+ci(li.delimiter)+"+\\s*")),li.load&&li.loadThrottle&&(li.load=_o(li.load,li.loadThrottle)),Sn(mi,"mousemove",()=>{oi.ignoreHover=!1}),Sn(mi,"mouseenter",an=>{var Fn=Ts(an.target,"[data-selectable]",mi);Fn&&oi.onOptionHover(an,Fn)},{capture:!0}),Sn(mi,"click",an=>{let Fn=Ts(an.target,"[data-selectable]");Fn&&(oi.onOptionSelect(an,Fn),xn(an,!0))}),Sn(Si,"click",an=>{var Fn=Ts(an.target,"[data-ts-item]",Si);if(Fn&&oi.onItemSelect(an,Fn)){xn(an,!0);return}ui.value==""&&(oi.onClick(),xn(an,!0))}),Sn(Di,"keydown",an=>oi.onKeyDown(an)),Sn(ui,"keypress",an=>oi.onKeyPress(an)),Sn(ui,"input",an=>oi.onInput(an)),Sn(Di,"blur",an=>oi.onBlur(an)),Sn(Di,"focus",an=>oi.onFocus(an)),Sn(ui,"paste",an=>oi.onPaste(an));let Hn=an=>{let Fn=an.composedPath()[0];if(!_i.contains(Fn)&&!mi.contains(Fn)){oi.isFocused&&oi.blur(),oi.inputState();return}Fn==ui&&oi.isOpen?an.stopPropagation():xn(an,!0)},Ln=()=>{oi.isOpen&&oi.positionDropdown()};Sn(document,"mousedown",Hn),Sn(window,"scroll",Ln,zi),Sn(window,"resize",Ln,zi),this._destroy=()=>{document.removeEventListener("mousedown",Hn),window.removeEventListener("scroll",Ln),window.removeEventListener("resize",Ln),Xi&&Xi.removeEventListener("click",bn)},this.revertSettings={innerHTML:Ai.innerHTML,tabIndex:Ai.tabIndex},Ai.tabIndex=-1,Ai.insertAdjacentElement("afterend",oi.wrapper),oi.sync(!1),li.items=[],delete li.optgroups,delete li.options,Sn(Ai,"invalid",()=>{oi.isValid&&(oi.isValid=!1,oi.isInvalid=!0,oi.refreshState())}),oi.updateOriginalInput(),oi.refreshItems(),oi.close(!1),oi.inputState(),oi.isSetup=!0,Ai.disabled?oi.disable():Ai.readOnly?oi.setReadOnly(!0):oi.enable(),oi.on("change",this.onChange),Xn(Ai,"tomselected","ts-hidden-accessible"),oi.trigger("initialize"),li.preload===!0&&oi.preload()}setupOptions(oi=[],li=[]){this.addOptions(oi),Mi(li,ui=>{this.registerOptionGroup(ui)})}setupTemplates(){var oi=this,li=oi.settings.labelField,ui=oi.settings.optgroupLabelField,mi={optgroup:yi=>{let _i=document.createElement("div");return _i.className="optgroup",_i.appendChild(yi.options),_i},optgroup_header:(yi,_i)=>'<div class="optgroup-header">'+_i(yi[ui])+"</div>",option:(yi,_i)=>"<div>"+_i(yi[li])+"</div>",item:(yi,_i)=>"<div>"+_i(yi[li])+"</div>",option_create:(yi,_i)=>'<div class="create">Add <strong>'+_i(yi.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};oi.settings.render=Object.assign({},mi,oi.settings.render)}setupCallbacks(){var oi,li,ui={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(oi in ui)li=this.settings[ui[oi]],li&&this.on(oi,li)}sync(oi=!0){let li=this,ui=oi?Ni(li.input,{delimiter:li.settings.delimiter}):li.settings;li.setupOptions(ui.options,ui.optgroups),li.setValue(ui.items||[],!0),li.lastQuery=null}onClick(){var oi=this;if(oi.activeItems.length>0){oi.clearActiveItems(),oi.focus();return}oi.isFocused&&oi.isOpen?oi.blur():oi.focus()}onMouseDown(){}onChange(){In(this.input,"input"),In(this.input,"change")}onPaste(oi){var li=this;if(li.isInputHidden||li.isLocked){xn(oi);return}!li.settings.splitOn||setTimeout(()=>{var ui=li.inputValue();if(!!ui.match(li.settings.splitOn)){var mi=ui.trim().split(li.settings.splitOn);Mi(mi,yi=>{_n(yi)&&(this.options[yi]?li.addItem(yi):li.createItem(yi))})}},0)}onKeyPress(oi){var li=this;if(li.isLocked){xn(oi);return}var ui=String.fromCharCode(oi.keyCode||oi.which);if(li.settings.create&&li.settings.mode==="multi"&&ui===li.settings.delimiter){li.createItem(),xn(oi);return}}onKeyDown(oi){var li=this;if(li.ignoreHover=!0,li.isLocked){oi.keyCode!==Xo&&xn(oi);return}switch(oi.keyCode){case Ys:if(pi(vo,oi)&&li.control_input.value==""){xn(oi),li.selectAll();return}break;case ds:li.isOpen&&(xn(oi,!0),li.close()),li.clearActiveItems();return;case go:if(!li.isOpen&&li.hasOptions)li.open();else if(li.activeOption){let ui=li.getAdjacent(li.activeOption,1);ui&&li.setActiveOption(ui)}xn(oi);return;case mo:if(li.activeOption){let ui=li.getAdjacent(li.activeOption,-1);ui&&li.setActiveOption(ui)}xn(oi);return;case Ds:li.canSelect(li.activeOption)?(li.onOptionSelect(oi,li.activeOption),xn(oi)):(li.settings.create&&li.createItem()||document.activeElement==li.control_input&&li.isOpen)&&xn(oi);return;case Xr:li.advanceSelection(-1,oi);return;case As:li.advanceSelection(1,oi);return;case Xo:li.settings.selectOnTab&&(li.canSelect(li.activeOption)&&(li.onOptionSelect(oi,li.activeOption),xn(oi)),li.settings.create&&li.createItem()&&xn(oi));return;case Ko:case kl:li.deleteSelection(oi);return}li.isInputHidden&&!pi(vo,oi)&&xn(oi)}onInput(oi){if(this.isLocked)return;let li=this.inputValue();if(this.lastValue!==li){if(this.lastValue=li,li==""){this._onInput();return}this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshTimeout=Pl(()=>{this.refreshTimeout=null,this._onInput()},this.settings.refreshThrottle)}}_onInput(){let oi=this.lastValue;this.settings.shouldLoad.call(this,oi)&&this.load(oi),this.refreshOptions(),this.trigger("type",oi)}onOptionHover(oi,li){this.ignoreHover||this.setActiveOption(li,!1)}onFocus(oi){var li=this,ui=li.isFocused;if(li.isDisabled||li.isReadOnly){li.blur(),xn(oi);return}li.ignoreFocus||(li.isFocused=!0,li.settings.preload==="focus"&&li.preload(),ui||li.trigger("focus"),li.activeItems.length||(li.inputState(),li.refreshOptions(!!li.settings.openOnFocus)),li.refreshState())}onBlur(oi){if(document.hasFocus()!==!1){var li=this;if(!!li.isFocused){li.isFocused=!1,li.ignoreFocus=!1;var ui=()=>{li.close(),li.setActiveItem(),li.setCaret(li.items.length),li.trigger("blur")};li.settings.create&&li.settings.createOnBlur?li.createItem(null,ui):ui()}}}onOptionSelect(oi,li){var ui,mi=this;li.parentElement&&li.parentElement.matches("[data-disabled]")||(li.classList.contains("create")?mi.createItem(null,()=>{mi.settings.closeAfterSelect&&mi.close()}):(ui=li.dataset.value,typeof ui!="undefined"&&(mi.lastQuery=null,mi.addItem(ui),mi.settings.closeAfterSelect&&mi.close(),!mi.settings.hideSelected&&oi.type&&/click/.test(oi.type)&&mi.setActiveOption(li))))}canSelect(oi){return!!(this.isOpen&&oi&&this.dropdown_content.contains(oi))}onItemSelect(oi,li){var ui=this;return!ui.isLocked&&ui.settings.mode==="multi"?(xn(oi),ui.setActiveItem(li,oi),!0):!1}canLoad(oi){return!(!this.settings.load||this.loadedSearches.hasOwnProperty(oi))}load(oi){let li=this;if(!li.canLoad(oi))return;Xn(li.wrapper,li.settings.loadingClass),li.loading++;let ui=li.loadCallback.bind(li);li.settings.load.call(li,oi,ui)}loadCallback(oi,li){let ui=this;ui.loading=Math.max(ui.loading-1,0),ui.lastQuery=null,ui.clearActiveOption(),ui.setupOptions(oi,li),ui.refreshOptions(ui.isFocused&&!ui.isInputHidden),ui.loading||Er(ui.wrapper,ui.settings.loadingClass),ui.trigger("load",oi,li)}preload(){var oi=this.wrapper.classList;oi.contains("preloaded")||(oi.add("preloaded"),this.load(""))}setTextboxValue(oi=""){var li=this.control_input,ui=li.value!==oi;ui&&(li.value=oi,In(li,"update"),this.lastValue=oi)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(oi,li){var ui=li?[]:["change"];yo(this,ui,()=>{this.clear(li),this.addItems(oi,li)})}setMaxItems(oi){oi===0&&(oi=null),this.settings.maxItems=oi,this.refreshState()}setActiveItem(oi,li){var ui=this,mi,yi,_i,Si,Ai,Di;if(ui.settings.mode!=="single"){if(!oi){ui.clearActiveItems(),ui.isFocused&&ui.inputState();return}if(mi=li&&li.type.toLowerCase(),mi==="click"&&pi("shiftKey",li)&&ui.activeItems.length){for(Di=ui.getLastActive(),_i=Array.prototype.indexOf.call(ui.control.children,Di),Si=Array.prototype.indexOf.call(ui.control.children,oi),_i>Si&&(Ai=_i,_i=Si,Si=Ai),yi=_i;yi<=Si;yi++)oi=ui.control.children[yi],ui.activeItems.indexOf(oi)===-1&&ui.setActiveItemClass(oi);xn(li)}else mi==="click"&&pi(vo,li)||mi==="keydown"&&pi("shiftKey",li)?oi.classList.contains("active")?ui.removeActiveItem(oi):ui.setActiveItemClass(oi):(ui.clearActiveItems(),ui.setActiveItemClass(oi));ui.inputState(),ui.isFocused||ui.focus()}}setActiveItemClass(oi){let li=this,ui=li.control.querySelector(".last-active");ui&&Er(ui,"last-active"),Xn(oi,"active last-active"),li.trigger("item_select",oi),li.activeItems.indexOf(oi)==-1&&li.activeItems.push(oi)}removeActiveItem(oi){var li=this.activeItems.indexOf(oi);this.activeItems.splice(li,1),Er(oi,"active")}clearActiveItems(){Er(this.activeItems,"active"),this.activeItems=[]}setActiveOption(oi,li=!0){oi!==this.activeOption&&(this.clearActiveOption(),!!oi&&(this.activeOption=oi,Dn(this.focus_node,{"aria-activedescendant":oi.getAttribute("id")}),Dn(oi,{"aria-selected":"true"}),Xn(oi,"active"),li&&this.scrollToOption(oi)))}scrollToOption(oi,li){if(!oi)return;let ui=this.dropdown_content,mi=ui.clientHeight,yi=ui.scrollTop||0,_i=oi.offsetHeight,Si=oi.getBoundingClientRect().top-ui.getBoundingClientRect().top+yi;Si+_i>mi+yi?this.scroll(Si-mi+_i,li):Si<yi&&this.scroll(Si,li)}scroll(oi,li){let ui=this.dropdown_content;li&&(ui.style.scrollBehavior=li),ui.scrollTop=oi,ui.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(Er(this.activeOption,"active"),Dn(this.activeOption,{"aria-selected":null})),this.activeOption=null,Dn(this.focus_node,{"aria-activedescendant":null})}selectAll(){let oi=this;if(oi.settings.mode==="single")return;let li=oi.controlChildren();!li.length||(oi.inputState(),oi.close(),oi.activeItems=li,Mi(li,ui=>{oi.setActiveItemClass(ui)}))}inputState(){var oi=this;!oi.control.contains(oi.control_input)||(Dn(oi.control_input,{placeholder:oi.settings.placeholder}),oi.activeItems.length>0||!oi.isFocused&&oi.settings.hidePlaceholder&&oi.items.length>0?(oi.setTextboxValue(),oi.isInputHidden=!0):(oi.settings.hidePlaceholder&&oi.items.length>0&&Dn(oi.control_input,{placeholder:""}),oi.isInputHidden=!1),oi.wrapper.classList.toggle("input-hidden",oi.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var oi=this;oi.isDisabled||oi.isReadOnly||(oi.ignoreFocus=!0,oi.control_input.offsetWidth?oi.control_input.focus():oi.focus_node.focus(),setTimeout(()=>{oi.ignoreFocus=!1,oi.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(oi){return this.sifter.getScoreFunction(oi,this.getSearchOptions())}getSearchOptions(){var oi=this.settings,li=oi.sortField;return typeof oi.sortField=="string"&&(li=[{field:oi.sortField}]),{fields:oi.searchField,conjunction:oi.searchConjunction,sort:li,nesting:oi.nesting}}search(oi){var li,ui,mi=this,yi=this.getSearchOptions();if(mi.settings.score&&(ui=mi.settings.score.call(mi,oi),typeof ui!="function"))throw new Error('Tom Select "score" setting must be a function that returns a function');return oi!==mi.lastQuery?(mi.lastQuery=oi,li=mi.sifter.search(oi,Object.assign(yi,{score:ui})),mi.currentResults=li):li=Object.assign({},mi.currentResults),mi.settings.hideSelected&&(li.items=li.items.filter(_i=>{let Si=_n(_i.id);return!(Si&&mi.items.indexOf(Si)!==-1)})),li}refreshOptions(oi=!0){var li,ui,mi,yi,_i,Si,Ai,Di,zi,Hi;let Zi={},Pn=[];var Xi=this,bn=Xi.inputValue();let Hn=bn===Xi.lastQuery||bn==""&&Xi.lastQuery==null;var Ln=Xi.search(bn),an=null,Fn=Xi.settings.shouldOpen||!1,rs=Xi.dropdown_content;Hn&&(an=Xi.activeOption,an&&(zi=an.closest("[data-group]"))),yi=Ln.items.length,typeof Xi.settings.maxOptions=="number"&&(yi=Math.min(yi,Xi.settings.maxOptions)),yi>0&&(Fn=!0);let Da=(yn,An)=>{let mn=Zi[yn];if(mn!==void 0){let Nn=Pn[mn];if(Nn!==void 0)return[mn,Nn.fragment]}let wr=document.createDocumentFragment();return mn=Pn.length,Pn.push({fragment:wr,order:An,optgroup:yn}),[mn,wr]};for(li=0;li<yi;li++){let yn=Ln.items[li];if(!yn)continue;let An=yn.id,mn=Xi.options[An];if(mn===void 0)continue;let wr=Os(An),Nn=Xi.getOption(wr,!0);for(Xi.settings.hideSelected||Nn.classList.toggle("selected",Xi.items.includes(wr)),_i=mn[Xi.settings.optgroupField]||"",Si=Array.isArray(_i)?_i:[_i],ui=0,mi=Si&&Si.length;ui<mi;ui++){_i=Si[ui];let Aa=mn.$order,Oa=Xi.optgroups[_i];Oa===void 0?_i="":Aa=Oa.$order;let[ch,uh]=Da(_i,Aa);ui>0&&(Nn=Nn.cloneNode(!0),Dn(Nn,{id:mn.$id+"-clone-"+ui,"aria-selected":null}),Nn.classList.add("ts-cloned"),Er(Nn,"active"),Xi.activeOption&&Xi.activeOption.dataset.value==An&&zi&&zi.dataset.group===_i.toString()&&(an=Nn)),uh.appendChild(Nn),_i!=""&&(Zi[_i]=ch)}}Xi.settings.lockOptgroupOrder&&Pn.sort((yn,An)=>yn.order-An.order),Ai=document.createDocumentFragment(),Mi(Pn,yn=>{let An=yn.fragment,mn=yn.optgroup;if(!An||!An.children.length)return;let wr=Xi.optgroups[mn];if(wr!==void 0){let Nn=document.createDocumentFragment(),Aa=Xi.render("optgroup_header",wr);xi(Nn,Aa),xi(Nn,An);let Oa=Xi.render("optgroup",{group:wr,options:Nn});xi(Ai,Oa)}else xi(Ai,An)}),rs.innerHTML="",xi(rs,Ai),Xi.settings.highlight&&(Cs(rs),Ln.query.length&&Ln.tokens.length&&Mi(Ln.tokens,yn=>{Kr(rs,yn.regex)}));var bo=yn=>{let An=Xi.render(yn,{input:bn});return An&&(Fn=!0,rs.insertBefore(An,rs.firstChild)),An};if(Xi.loading?bo("loading"):Xi.settings.shouldLoad.call(Xi,bn)?Ln.items.length===0&&bo("no_results"):bo("not_loading"),Di=Xi.canCreate(bn),Di&&(Hi=bo("option_create")),Xi.hasOptions=Ln.items.length>0||Di,Fn){if(Ln.items.length>0){if(!an&&Xi.settings.mode==="single"&&Xi.items[0]!=null&&(an=Xi.getOption(Xi.items[0])),!rs.contains(an)){let yn=0;Hi&&!Xi.settings.addPrecedence&&(yn=1),an=Xi.selectable()[yn]}}else Hi&&(an=Hi);oi&&!Xi.isOpen&&(Xi.open(),Xi.scrollToOption(an,"auto")),Xi.setActiveOption(an)}else Xi.clearActiveOption(),oi&&Xi.isOpen&&Xi.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(oi,li=!1){let ui=this;if(Array.isArray(oi))return ui.addOptions(oi,li),!1;let mi=_n(oi[ui.settings.valueField]);return mi===null||ui.options.hasOwnProperty(mi)?!1:(oi.$order=oi.$order||++ui.order,oi.$id=ui.inputId+"-opt-"+oi.$order,ui.options[mi]=oi,ui.lastQuery=null,li&&(ui.userOptions[mi]=li,ui.trigger("option_add",mi,oi)),mi)}addOptions(oi,li=!1){Mi(oi,ui=>{this.addOption(ui,li)})}registerOption(oi){return this.addOption(oi)}registerOptionGroup(oi){var li=_n(oi[this.settings.optgroupValueField]);return li===null?!1:(oi.$order=oi.$order||++this.order,this.optgroups[li]=oi,li)}addOptionGroup(oi,li){var ui;li[this.settings.optgroupValueField]=oi,(ui=this.registerOptionGroup(li))&&this.trigger("optgroup_add",ui,li)}removeOptionGroup(oi){this.optgroups.hasOwnProperty(oi)&&(delete this.optgroups[oi],this.clearCache(),this.trigger("optgroup_remove",oi))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(oi,li){let ui=this;var mi,yi;let _i=_n(oi),Si=_n(li[ui.settings.valueField]);if(_i===null)return;let Ai=ui.options[_i];if(Ai==null)return;if(typeof Si!="string")throw new Error("Value must be set in option data");let Di=ui.getOption(_i),zi=ui.getItem(_i);if(li.$order=li.$order||Ai.$order,delete ui.options[_i],ui.uncacheValue(Si),ui.options[Si]=li,Di){if(ui.dropdown_content.contains(Di)){let Hi=ui._render("option",li);ns(Di,Hi),ui.activeOption===Di&&ui.setActiveOption(Hi)}Di.remove()}zi&&(yi=ui.items.indexOf(_i),yi!==-1&&ui.items.splice(yi,1,Si),mi=ui._render("item",li),zi.classList.contains("active")&&Xn(mi,"active"),ns(zi,mi)),ui.lastQuery=null}removeOption(oi,li){let ui=this;oi=Os(oi),ui.uncacheValue(oi),delete ui.userOptions[oi],delete ui.options[oi],ui.lastQuery=null,ui.trigger("option_remove",oi),ui.removeItem(oi,li)}clearOptions(oi){let li=(oi||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();let ui={};Mi(this.options,(mi,yi)=>{li(mi,yi)&&(ui[yi]=mi)}),this.options=this.sifter.items=ui,this.lastQuery=null,this.trigger("option_clear")}clearFilter(oi,li){return this.items.indexOf(li)>=0}getOption(oi,li=!1){let ui=_n(oi);if(ui===null)return null;let mi=this.options[ui];if(mi!=null){if(mi.$div)return mi.$div;if(li)return this._render("option",mi)}return null}getAdjacent(oi,li,ui="option"){var mi=this,yi;if(!oi)return null;ui=="item"?yi=mi.controlChildren():yi=mi.dropdown_content.querySelectorAll("[data-selectable]");for(let _i=0;_i<yi.length;_i++)if(yi[_i]==oi)return li>0?yi[_i+1]:yi[_i-1];return null}getItem(oi){if(typeof oi=="object")return oi;var li=_n(oi);return li!==null?this.control.querySelector(`[data-value="${Ei(li)}"]`):null}addItems(oi,li){var ui=this,mi=Array.isArray(oi)?oi:[oi];mi=mi.filter(_i=>ui.items.indexOf(_i)===-1);let yi=mi[mi.length-1];mi.forEach(_i=>{ui.isPending=_i!==yi,ui.addItem(_i,li)})}addItem(oi,li){var ui=li?[]:["change","dropdown_close"];yo(this,ui,()=>{var mi,yi;let _i=this,Si=_i.settings.mode,Ai=_n(oi);if(!(Ai&&_i.items.indexOf(Ai)!==-1&&(Si==="single"&&_i.close(),Si==="single"||!_i.settings.duplicates))&&!(Ai===null||!_i.options.hasOwnProperty(Ai))&&(Si==="single"&&_i.clear(li),!(Si==="multi"&&_i.isFull()))){if(mi=_i._render("item",_i.options[Ai]),_i.control.contains(mi)&&(mi=mi.cloneNode(!0)),yi=_i.isFull(),_i.items.splice(_i.caretPos,0,Ai),_i.insertAtCaret(mi),_i.isSetup){if(!_i.isPending&&_i.settings.hideSelected){let Di=_i.getOption(Ai),zi=_i.getAdjacent(Di,1);zi&&_i.setActiveOption(zi)}!_i.isPending&&!_i.settings.closeAfterSelect&&_i.refreshOptions(_i.isFocused&&Si!=="single"),_i.settings.closeAfterSelect!=!1&&_i.isFull()?_i.close():_i.isPending||_i.positionDropdown(),_i.trigger("item_add",Ai,mi),_i.isPending||_i.updateOriginalInput({silent:li})}(!_i.isPending||!yi&&_i.isFull())&&(_i.inputState(),_i.refreshState())}})}removeItem(oi=null,li){let ui=this;if(oi=ui.getItem(oi),!oi)return;var mi,yi;let _i=oi.dataset.value;mi=is(oi),oi.remove(),oi.classList.contains("active")&&(yi=ui.activeItems.indexOf(oi),ui.activeItems.splice(yi,1),Er(oi,"active")),ui.items.splice(mi,1),ui.lastQuery=null,!ui.settings.persist&&ui.userOptions.hasOwnProperty(_i)&&ui.removeOption(_i,li),mi<ui.caretPos&&ui.setCaret(ui.caretPos-1),ui.updateOriginalInput({silent:li}),ui.refreshState(),ui.positionDropdown(),ui.trigger("item_remove",_i,oi)}createItem(oi=null,li=()=>{}){arguments.length===3&&(li=arguments[2]),typeof li!="function"&&(li=()=>{});var ui=this,mi=ui.caretPos,yi;if(oi=oi||ui.inputValue(),!ui.canCreate(oi))return li(),!1;ui.lock();var _i=!1,Si=Ai=>{if(ui.unlock(),!Ai||typeof Ai!="object")return li();var Di=_n(Ai[ui.settings.valueField]);if(typeof Di!="string")return li();ui.setTextboxValue(),ui.addOption(Ai,!0),ui.setCaret(mi),ui.addItem(Di),li(Ai),_i=!0};return typeof ui.settings.create=="function"?yi=ui.settings.create.call(this,oi,Si):yi={[ui.settings.labelField]:oi,[ui.settings.valueField]:oi},_i||Si(yi),!0}refreshItems(){var oi=this;oi.lastQuery=null,oi.isSetup&&oi.addItems(oi.items),oi.updateOriginalInput(),oi.refreshState()}refreshState(){let oi=this;oi.refreshValidityState();let li=oi.isFull(),ui=oi.isLocked;oi.wrapper.classList.toggle("rtl",oi.rtl);let mi=oi.wrapper.classList;mi.toggle("focus",oi.isFocused),mi.toggle("disabled",oi.isDisabled),mi.toggle("readonly",oi.isReadOnly),mi.toggle("required",oi.isRequired),mi.toggle("invalid",!oi.isValid),mi.toggle("locked",ui),mi.toggle("full",li),mi.toggle("input-active",oi.isFocused&&!oi.isInputHidden),mi.toggle("dropdown-active",oi.isOpen),mi.toggle("has-options",po(oi.options)),mi.toggle("has-items",oi.items.length>0)}refreshValidityState(){var oi=this;!oi.input.validity||(oi.isValid=oi.input.validity.valid,oi.isInvalid=!oi.isValid)}isFull(){return this.settings.maxItems!==null&&this.items.length>=this.settings.maxItems}updateOriginalInput(oi={}){let li=this;var ui,mi;let yi=li.input.querySelector('option[value=""]');if(li.is_select_tag){let Ai=function(Di,zi,Hi){return Di||(Di=Ri('<option value="'+Ms(zi)+'">'+Ms(Hi)+"</option>")),Di!=yi&&li.input.append(Di),_i.push(Di),(Di!=yi||Si>0)&&(Di.selected=!0),Di},_i=[],Si=li.input.querySelectorAll("option:checked").length;li.input.querySelectorAll("option:checked").forEach(Di=>{Di.selected=!1}),li.items.length==0&&li.settings.mode=="single"?Ai(yi,"",""):li.items.forEach(Di=>{if(ui=li.options[Di],mi=ui[li.settings.labelField]||"",_i.includes(ui.$option)){let zi=li.input.querySelector(`option[value="${Ei(Di)}"]:not(:checked)`);Ai(zi,Di,mi)}else ui.$option=Ai(ui.$option,Di,mi)})}else li.input.value=li.getValue();li.isSetup&&(oi.silent||li.trigger("change",li.getValue()))}open(){var oi=this;oi.isLocked||oi.isOpen||oi.settings.mode==="multi"&&oi.isFull()||(oi.isOpen=!0,Dn(oi.focus_node,{"aria-expanded":"true"}),oi.refreshState(),br(oi.dropdown,{visibility:"hidden",display:"block"}),oi.positionDropdown(),br(oi.dropdown,{visibility:"visible",display:"block"}),oi.focus(),oi.trigger("dropdown_open",oi.dropdown))}close(oi=!0){var li=this,ui=li.isOpen;oi&&(li.setTextboxValue(),li.settings.mode==="single"&&li.items.length&&li.inputState()),li.isOpen=!1,Dn(li.focus_node,{"aria-expanded":"false"}),br(li.dropdown,{display:"none"}),li.settings.hideSelected&&li.clearActiveOption(),li.refreshState(),ui&&li.trigger("dropdown_close",li.dropdown)}positionDropdown(){if(this.settings.dropdownParent==="body"){var oi=this.control,li=oi.getBoundingClientRect(),ui=oi.offsetHeight+li.top+window.scrollY,mi=li.left+window.scrollX;br(this.dropdown,{width:li.width+"px",top:ui+"px",left:mi+"px"})}}clear(oi){var li=this;if(!!li.items.length){var ui=li.controlChildren();Mi(ui,mi=>{li.removeItem(mi,!0)}),li.inputState(),oi||li.updateOriginalInput(),li.trigger("clear")}}insertAtCaret(oi){let li=this,ui=li.caretPos,mi=li.control;mi.insertBefore(oi,mi.children[ui]||null),li.setCaret(ui+1)}deleteSelection(oi){var li,ui,mi,yi,_i=this;li=oi&&oi.keyCode===Ko?-1:1,ui=Jr(_i.control_input);let Si=[];if(_i.activeItems.length)yi=Ws(_i.activeItems,li),mi=is(yi),li>0&&mi++,Mi(_i.activeItems,Ai=>Si.push(Ai));else if((_i.isFocused||_i.settings.mode==="single")&&_i.items.length){let Ai=_i.controlChildren(),Di;li<0&&ui.start===0&&ui.length===0?Di=Ai[_i.caretPos-1]:li>0&&ui.start===_i.inputValue().length&&(Di=Ai[_i.caretPos]),Di!==void 0&&Si.push(Di)}if(!_i.shouldDelete(Si,oi))return!1;for(xn(oi,!0),typeof mi!="undefined"&&_i.setCaret(mi);Si.length;)_i.removeItem(Si.pop());return _i.inputState(),_i.positionDropdown(),_i.refreshOptions(!1),!0}shouldDelete(oi,li){let ui=oi.map(mi=>mi.dataset.value);return!(!ui.length||typeof this.settings.onDelete=="function"&&this.settings.onDelete(ui,li)===!1)}advanceSelection(oi,li){var ui,mi,yi=this;yi.rtl&&(oi*=-1),!yi.inputValue().length&&(pi(vo,li)||pi("shiftKey",li)?(ui=yi.getLastActive(oi),ui?ui.classList.contains("active")?mi=yi.getAdjacent(ui,oi,"item"):mi=ui:oi>0?mi=yi.control_input.nextElementSibling:mi=yi.control_input.previousElementSibling,mi&&(mi.classList.contains("active")&&yi.removeActiveItem(ui),yi.setActiveItemClass(mi))):yi.moveCaret(oi))}moveCaret(oi){}getLastActive(oi){let li=this.control.querySelector(".last-active");if(li)return li;var ui=this.control.querySelectorAll(".active");if(ui)return Ws(ui,oi)}setCaret(oi){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(oi=this.isReadOnly||this.isDisabled){this.isLocked=oi,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(oi){this.focus_node.tabIndex=oi?-1:this.tabIndex,this.isDisabled=oi,this.input.disabled=oi,this.control_input.disabled=oi,this.setLocked()}setReadOnly(oi){this.isReadOnly=oi,this.input.readOnly=oi,this.control_input.readOnly=oi,this.setLocked()}destroy(){var oi=this,li=oi.revertSettings;oi.trigger("destroy"),oi.off(),oi.wrapper.remove(),oi.dropdown.remove(),oi.input.innerHTML=li.innerHTML,oi.input.tabIndex=li.tabIndex,Er(oi.input,"tomselected","ts-hidden-accessible"),oi._destroy(),delete oi.input.tomselect}render(oi,li){var ui,mi;let yi=this;if(typeof this.settings.render[oi]!="function"||(mi=yi.settings.render[oi].call(this,li,Ms),!mi))return null;if(mi=Ri(mi),oi==="option"||oi==="option_create"?li[yi.settings.disabledField]?Dn(mi,{"aria-disabled":"true"}):Dn(mi,{"data-selectable":""}):oi==="optgroup"&&(ui=li.group[yi.settings.optgroupValueField],Dn(mi,{"data-group":ui}),li.group[yi.settings.disabledField]&&Dn(mi,{"data-disabled":""})),oi==="option"||oi==="item"){let _i=Os(li[yi.settings.valueField]);Dn(mi,{"data-value":_i}),oi==="item"?(Xn(mi,yi.settings.itemClass),Dn(mi,{"data-ts-item":""})):(Xn(mi,yi.settings.optionClass),Dn(mi,{role:"option",id:li.$id}),li.$div=mi,yi.options[_i]=li)}return mi}_render(oi,li){let ui=this.render(oi,li);if(ui==null)throw"HTMLElement expected";return ui}clearCache(){Mi(this.options,oi=>{oi.$div&&(oi.$div.remove(),delete oi.$div)})}uncacheValue(oi){let li=this.getOption(oi);li&&li.remove()}canCreate(oi){return this.settings.create&&oi.length>0&&this.settings.createFilter.call(this,oi)}hook(oi,li,ui){var mi=this,yi=mi[li];mi[li]=function(){var _i,Si;return oi==="after"&&(_i=yi.apply(mi,arguments)),Si=ui.apply(mi,arguments),oi==="instead"?Si:(oi==="before"&&(_i=yi.apply(mi,arguments)),_i)}}}function Qi(){Sn(this.input,"change",()=>{this.sync()})}function hn(di){var oi=this,li=oi.onOptionSelect;oi.settings.hideSelected=!1;let ui=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},di);var mi=function(Si,Ai){Ai?(Si.checked=!0,ui.uncheckedClassNames&&Si.classList.remove(...ui.uncheckedClassNames),ui.checkedClassNames&&Si.classList.add(...ui.checkedClassNames)):(Si.checked=!1,ui.checkedClassNames&&Si.classList.remove(...ui.checkedClassNames),ui.uncheckedClassNames&&Si.classList.add(...ui.uncheckedClassNames))},yi=function(Si){setTimeout(()=>{var Ai=Si.querySelector("input."+ui.className);Ai instanceof HTMLInputElement&&mi(Ai,Si.classList.contains("selected"))},1)};oi.hook("after","setupTemplates",()=>{var _i=oi.settings.render.option;oi.settings.render.option=(Si,Ai)=>{var Di=Ri(_i.call(oi,Si,Ai)),zi=document.createElement("input");ui.className&&zi.classList.add(ui.className),zi.addEventListener("click",function(Zi){xn(Zi)}),zi.type="checkbox";let Hi=_n(Si[oi.settings.valueField]);return mi(zi,!!(Hi&&oi.items.indexOf(Hi)>-1)),Di.prepend(zi),Di}}),oi.on("item_remove",_i=>{var Si=oi.getOption(_i);Si&&(Si.classList.remove("selected"),yi(Si))}),oi.on("item_add",_i=>{var Si=oi.getOption(_i);Si&&yi(Si)}),oi.hook("instead","onOptionSelect",(_i,Si)=>{if(Si.classList.contains("selected")){Si.classList.remove("selected"),oi.removeItem(Si.dataset.value),oi.refreshOptions(),xn(_i,!0);return}li.call(oi,_i,Si),yi(Si)})}function Gi(di){let oi=this,li=Object.assign({className:"clear-button",title:"Clear All",html:ui=>`<div class="${ui.className}" title="${ui.title}">&#10799;</div>`},di);oi.on("initialize",()=>{var ui=Ri(li.html(li));ui.addEventListener("click",mi=>{oi.isLocked||(oi.clear(),oi.settings.mode==="single"&&oi.settings.allowEmptyOption&&oi.addItem(""),mi.preventDefault(),mi.stopPropagation())}),oi.control.appendChild(ui)})}let cn=(di,oi)=>{var li;(li=di.parentNode)==null||li.insertBefore(oi,di.nextSibling)},Mn=(di,oi)=>{var li;(li=di.parentNode)==null||li.insertBefore(oi,di)},Hr=(di,oi)=>{do{var li;if(oi=(li=oi)==null?void 0:li.previousElementSibling,di==oi)return!0}while(oi&&oi.previousElementSibling);return!1};function Dr(){var di=this;if(di.settings.mode!=="multi")return;var oi=di.lock,li=di.unlock;let ui=!0,mi;di.hook("after","setupTemplates",()=>{var yi=di.settings.render.item;di.settings.render.item=(_i,Si)=>{let Ai=Ri(yi.call(di,_i,Si));Dn(Ai,{draggable:"true"});let Di=bn=>{ui||xn(bn),bn.stopPropagation()},zi=bn=>{mi=Ai,setTimeout(()=>{Ai.classList.add("ts-dragging")},0)},Hi=bn=>{bn.preventDefault(),Ai.classList.add("ts-drag-over"),Pn(Ai,mi)},Zi=()=>{Ai.classList.remove("ts-drag-over")},Pn=(bn,Hn)=>{Hn!==void 0&&(Hr(Hn,Ai)?cn(bn,Hn):Mn(bn,Hn))},Xi=()=>{var bn;document.querySelectorAll(".ts-drag-over").forEach(Ln=>Ln.classList.remove("ts-drag-over")),(bn=mi)==null||bn.classList.remove("ts-dragging"),mi=void 0;var Hn=[];di.control.querySelectorAll("[data-value]").forEach(Ln=>{if(Ln.dataset.value){let an=Ln.dataset.value;an&&Hn.push(an)}}),di.setValue(Hn)};return Sn(Ai,"mousedown",Di),Sn(Ai,"dragstart",zi),Sn(Ai,"dragenter",Hi),Sn(Ai,"dragover",Hi),Sn(Ai,"dragleave",Zi),Sn(Ai,"dragend",Xi),Ai}}),di.hook("instead","lock",()=>(ui=!1,oi.call(di))),di.hook("instead","unlock",()=>(ui=!0,li.call(di)))}function Gs(di){let oi=this,li=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:ui=>'<div class="'+ui.headerClass+'"><div class="'+ui.titleRowClass+'"><span class="'+ui.labelClass+'">'+ui.title+'</span><a class="'+ui.closeClass+'">&times;</a></div></div>'},di);oi.on("initialize",()=>{var ui=Ri(li.html(li)),mi=ui.querySelector("."+li.closeClass);mi&&mi.addEventListener("click",yi=>{xn(yi,!0),oi.close()}),oi.dropdown.insertBefore(ui,oi.dropdown.firstChild)})}function Ls(){var di=this;di.hook("instead","setCaret",oi=>{di.settings.mode==="single"||!di.control.contains(di.control_input)?oi=di.items.length:(oi=Math.max(0,Math.min(di.items.length,oi)),oi!=di.caretPos&&!di.isPending&&di.controlChildren().forEach((li,ui)=>{ui<oi?di.control_input.insertAdjacentElement("beforebegin",li):di.control.appendChild(li)})),di.caretPos=oi}),di.hook("instead","moveCaret",oi=>{if(!di.isFocused)return;let li=di.getLastActive(oi);if(li){let ui=is(li);di.setCaret(oi>0?ui+1:ui),di.setActiveItem(),Er(li,"last-active")}else di.setCaret(di.caretPos+oi)})}function Rl(){let di=this;di.settings.shouldOpen=!0,di.hook("before","setup",()=>{di.focus_node=di.control,Xn(di.control_input,"dropdown-input");let oi=Ri('<div class="dropdown-input-wrap">');oi.append(di.control_input),di.dropdown.insertBefore(oi,di.dropdown.firstChild);let li=Ri('<input class="items-placeholder" tabindex="-1" />');li.placeholder=di.settings.placeholder||"",di.control.append(li)}),di.on("initialize",()=>{di.control_input.addEventListener("keydown",li=>{switch(li.keyCode){case ds:di.isOpen&&(xn(li,!0),di.close()),di.clearActiveItems();return;case Xo:di.focus_node.tabIndex=-1;break}return di.onKeyDown.call(di,li)}),di.on("blur",()=>{di.focus_node.tabIndex=di.isDisabled?-1:di.tabIndex}),di.on("dropdown_open",()=>{di.control_input.focus()});let oi=di.onBlur;di.hook("instead","onBlur",li=>{if(!(li&&li.relatedTarget==di.control_input))return oi.call(di)}),Sn(di.control_input,"blur",()=>di.onBlur()),di.hook("before","close",()=>{!di.isOpen||di.focus_node.focus({preventScroll:!0})})})}function Jo(){var di=this;di.on("initialize",()=>{var oi=document.createElement("span"),li=di.control_input;oi.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",di.wrapper.appendChild(oi);var ui=["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"];for(let yi of ui)oi.style[yi]=li.style[yi];var mi=()=>{oi.textContent=li.value,li.style.width=oi.clientWidth+"px"};mi(),di.on("update item_add item_remove",mi),Sn(li,"input",mi),Sn(li,"keyup",mi),Sn(li,"blur",mi),Sn(li,"update",mi)})}function Hl(){var di=this,oi=di.deleteSelection;this.hook("instead","deleteSelection",li=>di.activeItems.length?oi.call(di,li):!1)}function jl(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}function $l(){var di=this,oi=di.onKeyDown;di.hook("instead","onKeyDown",li=>{var ui,mi,yi,_i;if(!di.isOpen||!(li.keyCode===Xr||li.keyCode===As))return oi.call(di,li);di.ignoreHover=!0,_i=Ts(di.activeOption,"[data-group]"),ui=is(di.activeOption,"[data-selectable]"),!!_i&&(li.keyCode===Xr?_i=_i.previousSibling:_i=_i.nextSibling,!!_i&&(yi=_i.querySelectorAll("[data-selectable]"),mi=yi[Math.min(yi.length-1,ui)],mi&&di.setActiveOption(mi)))})}function Fl(di){let oi=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},di);var li=this;if(!!oi.append){var ui='<a href="javascript:void(0)" class="'+oi.className+'" tabindex="-1" title="'+Ms(oi.title)+'">'+oi.label+"</a>";li.hook("after","setupTemplates",()=>{var mi=li.settings.render.item;li.settings.render.item=(yi,_i)=>{var Si=Ri(mi.call(li,yi,_i)),Ai=Ri(ui);return Si.appendChild(Ai),Sn(Ai,"mousedown",Di=>{xn(Di,!0)}),Sn(Ai,"click",Di=>{li.isLocked||(xn(Di,!0),!li.isLocked&&(!li.shouldDelete([Si],Di)||(li.removeItem(Si),li.refreshOptions(!1),li.inputState())))}),Si}})}}function Bl(di){let oi=this,li=Object.assign({text:ui=>ui[oi.settings.labelField]},di);oi.on("item_remove",function(ui){if(!!oi.isFocused&&oi.control_input.value.trim()===""){var mi=oi.options[ui];mi&&oi.setTextboxValue(li.text.call(oi,mi))}})}function Ul(){let di=this,oi=di.canLoad,li=di.clearActiveOption,ui=di.loadCallback;var mi={},yi,_i=!1,Si,Ai=[];if(di.settings.shouldLoadMore||(di.settings.shouldLoadMore=()=>{if(yi.clientHeight/(yi.scrollHeight-yi.scrollTop)>.9)return!0;if(di.activeOption){var Zi=di.selectable(),Pn=Array.from(Zi).indexOf(di.activeOption);if(Pn>=Zi.length-2)return!0}return!1}),!di.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";di.settings.sortField=[{field:"$order"},{field:"$score"}];let Di=Hi=>typeof di.settings.maxOptions=="number"&&yi.children.length>=di.settings.maxOptions?!1:!!(Hi in mi&&mi[Hi]),zi=(Hi,Zi)=>di.items.indexOf(Zi)>=0||Ai.indexOf(Zi)>=0;di.setNextUrl=(Hi,Zi)=>{mi[Hi]=Zi},di.getUrl=Hi=>{if(Hi in mi){let Zi=mi[Hi];return mi[Hi]=!1,Zi}return di.clearPagination(),di.settings.firstUrl.call(di,Hi)},di.clearPagination=()=>{mi={}},di.hook("instead","clearActiveOption",()=>{if(!_i)return li.call(di)}),di.hook("instead","canLoad",Hi=>Hi in mi?Di(Hi):oi.call(di,Hi)),di.hook("instead","loadCallback",(Hi,Zi)=>{if(!_i)di.clearOptions(zi);else if(Si){let Pn=Hi[0];Pn!==void 0&&(Si.dataset.value=Pn[di.settings.valueField])}ui.call(di,Hi,Zi),_i=!1}),di.hook("after","refreshOptions",()=>{let Hi=di.lastValue;var Zi;Di(Hi)?(Zi=di.render("loading_more",{query:Hi}),Zi&&(Zi.setAttribute("data-selectable",""),Si=Zi)):Hi in mi&&!yi.querySelector(".no-results")&&(Zi=di.render("no_more_results",{query:Hi})),Zi&&(Xn(Zi,di.settings.optionClass),yi.append(Zi))}),di.on("initialize",()=>{Ai=Object.keys(di.options),yi=di.dropdown_content,di.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>'},di.settings.render),yi.addEventListener("scroll",()=>{!di.settings.shouldLoadMore.call(di)||!Di(di.lastValue)||_i||(_i=!0,di.load.call(di,di.lastValue))})})}return tn.define("change_listener",Qi),tn.define("checkbox_options",hn),tn.define("clear_button",Gi),tn.define("drag_drop",Dr),tn.define("dropdown_header",Gs),tn.define("caret_position",Ls),tn.define("dropdown_input",Rl),tn.define("input_autogrow",Jo),tn.define("no_backspace_delete",Hl),tn.define("no_active_items",jl),tn.define("optgroup_columns",$l),tn.define("remove_button",Fl),tn.define("restore_on_backspace",Bl),tn.define("virtual_scroll",Ul),tn})});var jd=Un((il,Hd)=>{(function(ii,ti){typeof il=="object"&&typeof Hd!="undefined"?ti(il):typeof define=="function"&&define.amd?define(["exports"],ti):(ii=typeof globalThis!="undefined"?globalThis:ii||self,ti(ii.diacritics={}))})(il,function(ii){"use strict";let ti=Li=>(Li=Li.filter(Boolean),Li.length<2?Li[0]||"":ai(Li)==1?"["+Li.join("")+"]":"(?:"+Li.join("|")+")"),ei=Li=>{if(!ri(Li))return Li.join("");let Ui="",ji=0,Fi=()=>{ji>1&&(Ui+="{"+ji+"}")};return Li.forEach((vn,sn)=>{if(vn===Li[sn-1]){ji++;return}Fi(),Ui+=vn,ji=1}),Fi(),Ui},ni=Li=>{let Ui=fi(Li);return ti(Ui)},ri=Li=>new Set(Li).size!==Li.length,si=Li=>(Li+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),ai=Li=>Li.reduce((Ui,ji)=>Math.max(Ui,ci(ji)),0),ci=Li=>fi(Li).length,fi=Li=>Array.from(Li),vi=Li=>{if(Li.length===1)return[[Li]];let Ui=[],ji=Li.substring(1);return vi(ji).forEach(function(vn){let sn=vn.slice(0);sn[0]=Li.charAt(0)+sn[0],Ui.push(sn),sn=vn.slice(0),sn.unshift(Li.charAt(0)),Ui.push(sn)}),Ui},hi=[[0,65535]],bi="[\u0300-\u036F\xB7\u02BE\u02BC]";ii.unicode_map=void 0;let wi,Ti=3,ki={},Ci={"/":"\u2044\u2215","0":"\u07C0",a:"\u2C65\u0250\u0251",aa:"\uA733",ae:"\xE6\u01FD\u01E3",ao:"\uA735",au:"\uA737",av:"\uA739\uA73B",ay:"\uA73D",b:"\u0180\u0253\u0183",c:"\uA73F\u0188\u023C\u2184",d:"\u0111\u0257\u0256\u1D05\u018C\uABB7\u0501\u0266",e:"\u025B\u01DD\u1D07\u0247",f:"\uA77C\u0192",g:"\u01E5\u0260\uA7A1\u1D79\uA77F\u0262",h:"\u0127\u2C68\u2C76\u0265",i:"\u0268\u0131",j:"\u0249\u0237",k:"\u0199\u2C6A\uA741\uA743\uA745\uA7A3",l:"\u0142\u019A\u026B\u2C61\uA749\uA747\uA781\u026D",m:"\u0271\u026F\u03FB",n:"\uA7A5\u019E\u0272\uA791\u1D0E\u043B\u0509",o:"\xF8\u01FF\u0254\u0275\uA74B\uA74D\u1D11",oe:"\u0153",oi:"\u01A3",oo:"\uA74F",ou:"\u0223",p:"\u01A5\u1D7D\uA751\uA753\uA755\u03C1",q:"\uA757\uA759\u024B",r:"\u024D\u027D\uA75B\uA7A7\uA783",s:"\xDF\u023F\uA7A9\uA785\u0282",t:"\u0167\u01AD\u0288\u2C66\uA787",th:"\xFE",tz:"\uA729",u:"\u0289",v:"\u028B\uA75F\u028C",vy:"\uA761",w:"\u2C73",y:"\u01B4\u024F\u1EFF",z:"\u01B6\u0225\u0240\u2C6C\uA763",hv:"\u0195"};for(let Li in Ci){let Ui=Ci[Li]||"";for(let ji=0;ji<Ui.length;ji++){let Fi=Ui.substring(ji,ji+1);ki[Fi]=Li}}let Bi=new RegExp(Object.keys(ki).join("|")+"|"+bi,"gu"),rn=Li=>{ii.unicode_map===void 0&&(ii.unicode_map=dn(Li||hi))},nn=(Li,Ui="NFKD")=>Li.normalize(Ui),Ji=Li=>fi(Li).reduce((Ui,ji)=>Ui+Wi(ji),""),Wi=Li=>(Li=nn(Li).toLowerCase().replace(Bi,Ui=>ki[Ui]||""),nn(Li,"NFC"));function*ln(Li){for(let[Ui,ji]of Li)for(let Fi=Ui;Fi<=ji;Fi++){let vn=String.fromCharCode(Fi),sn=Ji(vn);sn!=vn.toLowerCase()&&(sn.length>Ti||sn.length!=0&&(yield{folded:sn,composed:vn,code_point:Fi}))}}let Yi=Li=>{let Ui={},ji=(Fi,vn)=>{let sn=Ui[Fi]||new Set,Pi=new RegExp("^"+ni(sn)+"$","iu");vn.match(Pi)||(sn.add(si(vn)),Ui[Fi]=sn)};for(let Fi of ln(Li))ji(Fi.folded,Fi.folded),ji(Fi.folded,Fi.composed);return Ui},dn=Li=>{let Ui=Yi(Li),ji={},Fi=[];for(let sn in Ui){let Pi=Ui[sn];Pi&&(ji[sn]=ni(Pi)),sn.length>1&&Fi.push(si(sn))}Fi.sort((sn,Pi)=>Pi.length-sn.length);let vn=ti(Fi);return wi=new RegExp("^"+vn,"u"),ji},un=(Li,Ui=1)=>{let ji=0;return Li=Li.map(Fi=>(ii.unicode_map[Fi]&&(ji+=Fi.length),ii.unicode_map[Fi]||Fi)),ji>=Ui?ei(Li):""},pn=(Li,Ui=1)=>(Ui=Math.max(Ui,Li.length-1),ti(vi(Li).map(ji=>un(ji,Ui)))),gn=(Li,Ui=!0)=>{let ji=Li.length>1?1:0;return ti(Li.map(Fi=>{let vn=[],sn=Ui?Fi.length():Fi.length()-1;for(let Pi=0;Pi<sn;Pi++)vn.push(pn(Fi.substrs[Pi]||"",ji));return ei(vn)}))},Cn=(Li,Ui)=>{for(let ji of Ui){if(ji.start!=Li.start||ji.end!=Li.end||ji.substrs.join("")!==Li.substrs.join(""))continue;let Fi=Li.parts,vn=Pi=>{for(let Mi of Fi){if(Mi.start===Pi.start&&Mi.substr===Pi.substr)return!1;if(!(Pi.length==1||Mi.length==1)&&(Pi.start<Mi.start&&Pi.end>Mi.start||Mi.start<Pi.start&&Mi.end>Pi.start))return!0}return!1};if(!(ji.parts.filter(vn).length>0))return!0}return!1};class kn{constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(Ui){Ui&&(this.parts.push(Ui),this.substrs.push(Ui.substr),this.start=Math.min(Ui.start,this.start),this.end=Math.max(Ui.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(Ui,ji){let Fi=new kn,vn=JSON.parse(JSON.stringify(this.parts)),sn=vn.pop();for(let $i of vn)Fi.add($i);let Pi=ji.substr.substring(0,Ui-sn.start),Mi=Pi.length;return Fi.add({start:sn.start,end:sn.start+Mi,length:Mi,substr:Pi}),Fi}}let En=Li=>{rn(),Li=Ji(Li);let Ui="",ji=[new kn];for(let Fi=0;Fi<Li.length;Fi++){let sn=Li.substring(Fi).match(wi),Pi=Li.substring(Fi,Fi+1),Mi=sn?sn[0]:null,$i=[],en=new Set;for(let Ii of ji){let Ri=Ii.last();if(!Ri||Ri.length==1||Ri.end<=Fi)if(Mi){let fn=Mi.length;Ii.add({start:Fi,end:Fi+fn,length:fn,substr:Mi}),en.add("1")}else Ii.add({start:Fi,end:Fi+1,length:1,substr:Pi}),en.add("2");else if(Mi){let fn=Ii.clone(Fi,Ri),On=Mi.length;fn.add({start:Fi,end:Fi+On,length:On,substr:Mi}),$i.push(fn)}else en.add("3")}if($i.length>0){$i=$i.sort((Ii,Ri)=>Ii.length()-Ri.length());for(let Ii of $i)Cn(Ii,ji)||ji.push(Ii);continue}if(Fi>0&&en.size==1&&!en.has("3")){Ui+=gn(ji,!1);let Ii=new kn,Ri=ji[0];Ri&&Ii.add(Ri.last()),ji=[Ii]}}return Ui+=gn(ji,!0),Ui};ii._asciifold=Wi,ii.asciifold=Ji,ii.code_points=hi,ii.escape_regex=si,ii.generateMap=dn,ii.generateSets=Yi,ii.generator=ln,ii.getPattern=En,ii.initialize=rn,ii.mapSequence=un,ii.normalize=nn,ii.substringsToPattern=pn,Object.defineProperty(ii,"__esModule",{value:!0})})});var Ud=Un((cS,Bd)=>{"use strict";Bd.exports=ii=>encodeURIComponent(ii).replace(/[!'()*]/g,ti=>`%${ti.charCodeAt(0).toString(16).toUpperCase()}`)});var Yd=Un((uS,Wd)=>{"use strict";var Vd="%[a-f0-9]{2}",zd=new RegExp(Vd,"gi"),qd=new RegExp("("+Vd+")+","gi");function Pc(ii,ti){try{return decodeURIComponent(ii.join(""))}catch(ri){}if(ii.length===1)return ii;ti=ti||1;var ei=ii.slice(0,ti),ni=ii.slice(ti);return Array.prototype.concat.call([],Pc(ei),Pc(ni))}function m_(ii){try{return decodeURIComponent(ii)}catch(ni){for(var ti=ii.match(zd),ei=1;ei<ti.length;ei++)ii=Pc(ti,ei).join(""),ti=ii.match(zd);return ii}}function g_(ii){for(var ti={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},ei=qd.exec(ii);ei;){try{ti[ei[0]]=decodeURIComponent(ei[0])}catch(ci){var ni=m_(ei[0]);ni!==ei[0]&&(ti[ei[0]]=ni)}ei=qd.exec(ii)}ti["%C2"]="\uFFFD";for(var ri=Object.keys(ti),si=0;si<ri.length;si++){var ai=ri[si];ii=ii.replace(new RegExp(ai,"g"),ti[ai])}return ii}Wd.exports=function(ii){if(typeof ii!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof ii+"`");try{return ii=ii.replace(/\+/g," "),decodeURIComponent(ii)}catch(ti){return g_(ii)}}});var Kd=Un((dS,Gd)=>{"use strict";Gd.exports=(ii,ti)=>{if(!(typeof ii=="string"&&typeof ti=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(ti==="")return[ii];let ei=ii.indexOf(ti);return ei===-1?[ii]:[ii.slice(0,ei),ii.slice(ei+ti.length)]}});var Jd=Un((fS,Xd)=>{"use strict";Xd.exports=function(ii,ti){for(var ei={},ni=Object.keys(ii),ri=Array.isArray(ti),si=0;si<ni.length;si++){var ai=ni[si],ci=ii[ai];(ri?ti.indexOf(ai)!==-1:ti(ai,ci,ii))&&(ei[ai]=ci)}return ei}});var of=Un(Lr=>{"use strict";var v_=Ud(),__=Yd(),Qd=Kd(),y_=Jd(),b_=ii=>ii==null,Rc=Symbol("encodeFragmentIdentifier");function E_(ii){switch(ii.arrayFormat){case"index":return ti=>(ei,ni)=>{let ri=ei.length;return ni===void 0||ii.skipNull&&ni===null||ii.skipEmptyString&&ni===""?ei:ni===null?[...ei,[Yn(ti,ii),"[",ri,"]"].join("")]:[...ei,[Yn(ti,ii),"[",Yn(ri,ii),"]=",Yn(ni,ii)].join("")]};case"bracket":return ti=>(ei,ni)=>ni===void 0||ii.skipNull&&ni===null||ii.skipEmptyString&&ni===""?ei:ni===null?[...ei,[Yn(ti,ii),"[]"].join("")]:[...ei,[Yn(ti,ii),"[]=",Yn(ni,ii)].join("")];case"colon-list-separator":return ti=>(ei,ni)=>ni===void 0||ii.skipNull&&ni===null||ii.skipEmptyString&&ni===""?ei:ni===null?[...ei,[Yn(ti,ii),":list="].join("")]:[...ei,[Yn(ti,ii),":list=",Yn(ni,ii)].join("")];case"comma":case"separator":case"bracket-separator":{let ti=ii.arrayFormat==="bracket-separator"?"[]=":"=";return ei=>(ni,ri)=>ri===void 0||ii.skipNull&&ri===null||ii.skipEmptyString&&ri===""?ni:(ri=ri===null?"":ri,ni.length===0?[[Yn(ei,ii),ti,Yn(ri,ii)].join("")]:[[ni,Yn(ri,ii)].join(ii.arrayFormatSeparator)])}default:return ti=>(ei,ni)=>ni===void 0||ii.skipNull&&ni===null||ii.skipEmptyString&&ni===""?ei:ni===null?[...ei,Yn(ti,ii)]:[...ei,[Yn(ti,ii),"=",Yn(ni,ii)].join("")]}}function w_(ii){let ti;switch(ii.arrayFormat){case"index":return(ei,ni,ri)=>{if(ti=/\[(\d*)\]$/.exec(ei),ei=ei.replace(/\[\d*\]$/,""),!ti){ri[ei]=ni;return}ri[ei]===void 0&&(ri[ei]={}),ri[ei][ti[1]]=ni};case"bracket":return(ei,ni,ri)=>{if(ti=/(\[\])$/.exec(ei),ei=ei.replace(/\[\]$/,""),!ti){ri[ei]=ni;return}if(ri[ei]===void 0){ri[ei]=[ni];return}ri[ei]=[].concat(ri[ei],ni)};case"colon-list-separator":return(ei,ni,ri)=>{if(ti=/(:list)$/.exec(ei),ei=ei.replace(/:list$/,""),!ti){ri[ei]=ni;return}if(ri[ei]===void 0){ri[ei]=[ni];return}ri[ei]=[].concat(ri[ei],ni)};case"comma":case"separator":return(ei,ni,ri)=>{let si=typeof ni=="string"&&ni.includes(ii.arrayFormatSeparator),ai=typeof ni=="string"&&!si&&ws(ni,ii).includes(ii.arrayFormatSeparator);ni=ai?ws(ni,ii):ni;let ci=si||ai?ni.split(ii.arrayFormatSeparator).map(fi=>ws(fi,ii)):ni===null?ni:ws(ni,ii);ri[ei]=ci};case"bracket-separator":return(ei,ni,ri)=>{let si=/(\[\])$/.test(ei);if(ei=ei.replace(/\[\]$/,""),!si){ri[ei]=ni&&ws(ni,ii);return}let ai=ni===null?[]:ni.split(ii.arrayFormatSeparator).map(ci=>ws(ci,ii));if(ri[ei]===void 0){ri[ei]=ai;return}ri[ei]=[].concat(ri[ei],ai)};default:return(ei,ni,ri)=>{if(ri[ei]===void 0){ri[ei]=ni;return}ri[ei]=[].concat(ri[ei],ni)}}}function Zd(ii){if(typeof ii!="string"||ii.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Yn(ii,ti){return ti.encode?ti.strict?v_(ii):encodeURIComponent(ii):ii}function ws(ii,ti){return ti.decode?__(ii):ii}function ef(ii){return Array.isArray(ii)?ii.sort():typeof ii=="object"?ef(Object.keys(ii)).sort((ti,ei)=>Number(ti)-Number(ei)).map(ti=>ii[ti]):ii}function tf(ii){let ti=ii.indexOf("#");return ti!==-1&&(ii=ii.slice(0,ti)),ii}function x_(ii){let ti="",ei=ii.indexOf("#");return ei!==-1&&(ti=ii.slice(ei)),ti}function nf(ii){ii=tf(ii);let ti=ii.indexOf("?");return ti===-1?"":ii.slice(ti+1)}function rf(ii,ti){return ti.parseNumbers&&!Number.isNaN(Number(ii))&&typeof ii=="string"&&ii.trim()!==""?ii=Number(ii):ti.parseBooleans&&ii!==null&&(ii.toLowerCase()==="true"||ii.toLowerCase()==="false")&&(ii=ii.toLowerCase()==="true"),ii}function sf(ii,ti){ti=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},ti),Zd(ti.arrayFormatSeparator);let ei=w_(ti),ni=Object.create(null);if(typeof ii!="string"||(ii=ii.trim().replace(/^[?#&]/,""),!ii))return ni;for(let ri of ii.split("&")){if(ri==="")continue;let[si,ai]=Qd(ti.decode?ri.replace(/\+/g," "):ri,"=");ai=ai===void 0?null:["comma","separator","bracket-separator"].includes(ti.arrayFormat)?ai:ws(ai,ti),ei(ws(si,ti),ai,ni)}for(let ri of Object.keys(ni)){let si=ni[ri];if(typeof si=="object"&&si!==null)for(let ai of Object.keys(si))si[ai]=rf(si[ai],ti);else ni[ri]=rf(si,ti)}return ti.sort===!1?ni:(ti.sort===!0?Object.keys(ni).sort():Object.keys(ni).sort(ti.sort)).reduce((ri,si)=>{let ai=ni[si];return Boolean(ai)&&typeof ai=="object"&&!Array.isArray(ai)?ri[si]=ef(ai):ri[si]=ai,ri},Object.create(null))}Lr.extract=nf;Lr.parse=sf;Lr.stringify=(ii,ti)=>{if(!ii)return"";ti=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},ti),Zd(ti.arrayFormatSeparator);let ei=ai=>ti.skipNull&&b_(ii[ai])||ti.skipEmptyString&&ii[ai]==="",ni=E_(ti),ri={};for(let ai of Object.keys(ii))ei(ai)||(ri[ai]=ii[ai]);let si=Object.keys(ri);return ti.sort!==!1&&si.sort(ti.sort),si.map(ai=>{let ci=ii[ai];return ci===void 0?"":ci===null?Yn(ai,ti):Array.isArray(ci)?ci.length===0&&ti.arrayFormat==="bracket-separator"?Yn(ai,ti)+"[]":ci.reduce(ni(ai),[]).join("&"):Yn(ai,ti)+"="+Yn(ci,ti)}).filter(ai=>ai.length>0).join("&")};Lr.parseUrl=(ii,ti)=>{ti=Object.assign({decode:!0},ti);let[ei,ni]=Qd(ii,"#");return Object.assign({url:ei.split("?")[0]||"",query:sf(nf(ii),ti)},ti&&ti.parseFragmentIdentifier&&ni?{fragmentIdentifier:ws(ni,ti)}:{})};Lr.stringifyUrl=(ii,ti)=>{ti=Object.assign({encode:!0,strict:!0,[Rc]:!0},ti);let ei=tf(ii.url).split("?")[0]||"",ni=Lr.extract(ii.url),ri=Lr.parse(ni,{sort:!1}),si=Object.assign(ri,ii.query),ai=Lr.stringify(si,ti);ai&&(ai=`?${ai}`);let ci=x_(ii.url);return ii.fragmentIdentifier&&(ci=`#${ti[Rc]?Yn(ii.fragmentIdentifier,ti):ii.fragmentIdentifier}`),`${ei}${ai}${ci}`};Lr.pick=(ii,ti,ei)=>{ei=Object.assign({parseFragmentIdentifier:!0,[Rc]:!1},ei);let{url:ni,query:ri,fragmentIdentifier:si}=Lr.parseUrl(ii,ei);return Lr.stringifyUrl({url:ni,query:y_(ri,ti),fragmentIdentifier:si},ei)};Lr.exclude=(ii,ti,ei)=>{let ni=Array.isArray(ti)?ri=>!ti.includes(ri):(ri,si)=>!ti(ri,si);return Lr.pick(ii,ni,ei)}});var Mf=Un((ya,Bc)=>{(function(ti,ei){typeof ya=="object"&&typeof Bc=="object"?Bc.exports=ei():typeof define=="function"&&define.amd?define([],ei):typeof ya=="object"?ya.ClipboardJS=ei():ti.ClipboardJS=ei()})(ya,function(){return function(){var ii={686:function(ni,ri,si){"use strict";si.d(ri,{default:function(){return sn}});var ai=si(279),ci=si.n(ai),fi=si(370),vi=si.n(fi),hi=si(817),bi=si.n(hi);function wi(Pi){try{return document.execCommand(Pi)}catch(Mi){return!1}}var Ti=function(Mi){var $i=bi()(Mi);return wi("cut"),$i},ki=Ti;function Ci(Pi){var Mi=document.documentElement.getAttribute("dir")==="rtl",$i=document.createElement("textarea");$i.style.fontSize="12pt",$i.style.border="0",$i.style.padding="0",$i.style.margin="0",$i.style.position="absolute",$i.style[Mi?"right":"left"]="-9999px";var en=window.pageYOffset||document.documentElement.scrollTop;return $i.style.top="".concat(en,"px"),$i.setAttribute("readonly",""),$i.value=Pi,$i}var Bi=function(Mi,$i){var en=Ci(Mi);$i.container.appendChild(en);var Ii=bi()(en);return wi("copy"),en.remove(),Ii},rn=function(Mi){var $i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},en="";return typeof Mi=="string"?en=Bi(Mi,$i):Mi instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(Mi==null?void 0:Mi.type)?en=Bi(Mi.value,$i):(en=bi()(Mi),wi("copy")),en},nn=rn;function Ji(Pi){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ji=function($i){return typeof $i}:Ji=function($i){return $i&&typeof Symbol=="function"&&$i.constructor===Symbol&&$i!==Symbol.prototype?"symbol":typeof $i},Ji(Pi)}var Wi=function(){var Mi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$i=Mi.action,en=$i===void 0?"copy":$i,Ii=Mi.container,Ri=Mi.target,fn=Mi.text;if(en!=="copy"&&en!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Ri!==void 0)if(Ri&&Ji(Ri)==="object"&&Ri.nodeType===1){if(en==="copy"&&Ri.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(en==="cut"&&(Ri.hasAttribute("readonly")||Ri.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(fn)return nn(fn,{container:Ii});if(Ri)return en==="cut"?ki(Ri):nn(Ri,{container:Ii})},ln=Wi;function Yi(Pi){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Yi=function($i){return typeof $i}:Yi=function($i){return $i&&typeof Symbol=="function"&&$i.constructor===Symbol&&$i!==Symbol.prototype?"symbol":typeof $i},Yi(Pi)}function dn(Pi,Mi){if(!(Pi instanceof Mi))throw new TypeError("Cannot call a class as a function")}function un(Pi,Mi){for(var $i=0;$i<Mi.length;$i++){var en=Mi[$i];en.enumerable=en.enumerable||!1,en.configurable=!0,"value"in en&&(en.writable=!0),Object.defineProperty(Pi,en.key,en)}}function pn(Pi,Mi,$i){return Mi&&un(Pi.prototype,Mi),$i&&un(Pi,$i),Pi}function gn(Pi,Mi){if(typeof Mi!="function"&&Mi!==null)throw new TypeError("Super expression must either be null or a function");Pi.prototype=Object.create(Mi&&Mi.prototype,{constructor:{value:Pi,writable:!0,configurable:!0}}),Mi&&Cn(Pi,Mi)}function Cn(Pi,Mi){return Cn=Object.setPrototypeOf||function(en,Ii){return en.__proto__=Ii,en},Cn(Pi,Mi)}function kn(Pi){var Mi=Ui();return function(){var en=ji(Pi),Ii;if(Mi){var Ri=ji(this).constructor;Ii=Reflect.construct(en,arguments,Ri)}else Ii=en.apply(this,arguments);return En(this,Ii)}}function En(Pi,Mi){return Mi&&(Yi(Mi)==="object"||typeof Mi=="function")?Mi:Li(Pi)}function Li(Pi){if(Pi===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Pi}function Ui(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(Pi){return!1}}function ji(Pi){return ji=Object.setPrototypeOf?Object.getPrototypeOf:function($i){return $i.__proto__||Object.getPrototypeOf($i)},ji(Pi)}function Fi(Pi,Mi){var $i="data-clipboard-".concat(Pi);if(!!Mi.hasAttribute($i))return Mi.getAttribute($i)}var vn=function(Pi){gn($i,Pi);var Mi=kn($i);function $i(en,Ii){var Ri;return dn(this,$i),Ri=Mi.call(this),Ri.resolveOptions(Ii),Ri.listenClick(en),Ri}return pn($i,[{key:"resolveOptions",value:function(){var Ii=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof Ii.action=="function"?Ii.action:this.defaultAction,this.target=typeof Ii.target=="function"?Ii.target:this.defaultTarget,this.text=typeof Ii.text=="function"?Ii.text:this.defaultText,this.container=Yi(Ii.container)==="object"?Ii.container:document.body}},{key:"listenClick",value:function(Ii){var Ri=this;this.listener=vi()(Ii,"click",function(fn){return Ri.onClick(fn)})}},{key:"onClick",value:function(Ii){var Ri=Ii.delegateTarget||Ii.currentTarget,fn=this.action(Ri)||"copy",On=ln({action:fn,container:this.container,target:this.target(Ri),text:this.text(Ri)});this.emit(On?"success":"error",{action:fn,text:On,trigger:Ri,clearSelection:function(){Ri&&Ri.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(Ii){return Fi("action",Ii)}},{key:"defaultTarget",value:function(Ii){var Ri=Fi("target",Ii);if(Ri)return document.querySelector(Ri)}},{key:"defaultText",value:function(Ii){return Fi("text",Ii)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(Ii){var Ri=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return nn(Ii,Ri)}},{key:"cut",value:function(Ii){return ki(Ii)}},{key:"isSupported",value:function(){var Ii=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Ri=typeof Ii=="string"?[Ii]:Ii,fn=!!document.queryCommandSupported;return Ri.forEach(function(On){fn=fn&&!!document.queryCommandSupported(On)}),fn}}]),$i}(ci()),sn=vn},828:function(ni){var ri=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var si=Element.prototype;si.matches=si.matchesSelector||si.mozMatchesSelector||si.msMatchesSelector||si.oMatchesSelector||si.webkitMatchesSelector}function ai(ci,fi){for(;ci&&ci.nodeType!==ri;){if(typeof ci.matches=="function"&&ci.matches(fi))return ci;ci=ci.parentNode}}ni.exports=ai},438:function(ni,ri,si){var ai=si(828);function ci(hi,bi,wi,Ti,ki){var Ci=vi.apply(this,arguments);return hi.addEventListener(wi,Ci,ki),{destroy:function(){hi.removeEventListener(wi,Ci,ki)}}}function fi(hi,bi,wi,Ti,ki){return typeof hi.addEventListener=="function"?ci.apply(null,arguments):typeof wi=="function"?ci.bind(null,document).apply(null,arguments):(typeof hi=="string"&&(hi=document.querySelectorAll(hi)),Array.prototype.map.call(hi,function(Ci){return ci(Ci,bi,wi,Ti,ki)}))}function vi(hi,bi,wi,Ti){return function(ki){ki.delegateTarget=ai(ki.target,bi),ki.delegateTarget&&Ti.call(hi,ki)}}ni.exports=fi},879:function(ni,ri){ri.node=function(si){return si!==void 0&&si instanceof HTMLElement&&si.nodeType===1},ri.nodeList=function(si){var ai=Object.prototype.toString.call(si);return si!==void 0&&(ai==="[object NodeList]"||ai==="[object HTMLCollection]")&&"length"in si&&(si.length===0||ri.node(si[0]))},ri.string=function(si){return typeof si=="string"||si instanceof String},ri.fn=function(si){var ai=Object.prototype.toString.call(si);return ai==="[object Function]"}},370:function(ni,ri,si){var ai=si(879),ci=si(438);function fi(wi,Ti,ki){if(!wi&&!Ti&&!ki)throw new Error("Missing required arguments");if(!ai.string(Ti))throw new TypeError("Second argument must be a String");if(!ai.fn(ki))throw new TypeError("Third argument must be a Function");if(ai.node(wi))return vi(wi,Ti,ki);if(ai.nodeList(wi))return hi(wi,Ti,ki);if(ai.string(wi))return bi(wi,Ti,ki);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function vi(wi,Ti,ki){return wi.addEventListener(Ti,ki),{destroy:function(){wi.removeEventListener(Ti,ki)}}}function hi(wi,Ti,ki){return Array.prototype.forEach.call(wi,function(Ci){Ci.addEventListener(Ti,ki)}),{destroy:function(){Array.prototype.forEach.call(wi,function(Ci){Ci.removeEventListener(Ti,ki)})}}}function bi(wi,Ti,ki){return ci(document.body,wi,Ti,ki)}ni.exports=fi},817:function(ni){function ri(si){var ai;if(si.nodeName==="SELECT")si.focus(),ai=si.value;else if(si.nodeName==="INPUT"||si.nodeName==="TEXTAREA"){var ci=si.hasAttribute("readonly");ci||si.setAttribute("readonly",""),si.select(),si.setSelectionRange(0,si.value.length),ci||si.removeAttribute("readonly"),ai=si.value}else{si.hasAttribute("contenteditable")&&si.focus();var fi=window.getSelection(),vi=document.createRange();vi.selectNodeContents(si),fi.removeAllRanges(),fi.addRange(vi),ai=fi.toString()}return ai}ni.exports=ri},279:function(ni){function ri(){}ri.prototype={on:function(si,ai,ci){var fi=this.e||(this.e={});return(fi[si]||(fi[si]=[])).push({fn:ai,ctx:ci}),this},once:function(si,ai,ci){var fi=this;function vi(){fi.off(si,vi),ai.apply(ci,arguments)}return vi._=ai,this.on(si,vi,ci)},emit:function(si){var ai=[].slice.call(arguments,1),ci=((this.e||(this.e={}))[si]||[]).slice(),fi=0,vi=ci.length;for(fi;fi<vi;fi++)ci[fi].fn.apply(ci[fi].ctx,ai);return this},off:function(si,ai){var ci=this.e||(this.e={}),fi=ci[si],vi=[];if(fi&&ai)for(var hi=0,bi=fi.length;hi<bi;hi++)fi[hi].fn!==ai&&fi[hi].fn._!==ai&&vi.push(fi[hi]);return vi.length?ci[si]=vi:delete ci[si],this}},ni.exports=ri,ni.exports.TinyEmitter=ri}},ti={};function ei(ni){if(ti[ni])return ti[ni].exports;var ri=ti[ni]={exports:{}};return ii[ni](ri,ri.exports,ei),ri.exports}return function(){ei.n=function(ni){var ri=ni&&ni.__esModule?function(){return ni.default}:function(){return ni};return ei.d(ri,{a:ri}),ri}}(),function(){ei.d=function(ni,ri){for(var si in ri)ei.o(ri,si)&&!ei.o(ni,si)&&Object.defineProperty(ni,si,{enumerable:!0,get:ri[si]})}}(),function(){ei.o=function(ni,ri){return Object.prototype.hasOwnProperty.call(ni,ri)}}(),ei(686)}().default})});var zs=Un(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.Utils=qr.obsoleteAttr=qr.obsoleteOptsDel=qr.obsoleteOpts=qr.obsolete=void 0;function Q_(ii,ti,ei,ni,ri){let si=(...ai)=>(console.warn("gridstack.js: Function `"+ei+"` is deprecated in "+ri+" and has been replaced with `"+ni+"`. It will be **removed** in a future release"),ti.apply(ii,ai));return si.prototype=ti.prototype,si}qr.obsolete=Q_;function Z_(ii,ti,ei,ni){ii[ti]!==void 0&&(ii[ei]=ii[ti],console.warn("gridstack.js: Option `"+ti+"` is deprecated in "+ni+" and has been replaced with `"+ei+"`. It will be **removed** in a future release"))}qr.obsoleteOpts=Z_;function ey(ii,ti,ei,ni){ii[ti]!==void 0&&console.warn("gridstack.js: Option `"+ti+"` is deprecated in "+ei+ni)}qr.obsoleteOptsDel=ey;function ty(ii,ti,ei,ni){let ri=ii.getAttribute(ti);ri!==null&&(ii.setAttribute(ei,ri),console.warn("gridstack.js: attribute `"+ti+"`="+ri+" is deprecated on this object in "+ni+" and has been replaced with `"+ei+"`. It will be **removed** in a future release"))}qr.obsoleteAttr=ty;var Vo=class{static getElements(ti){if(typeof ti=="string"){let ei=document.querySelectorAll(ti);return!ei.length&&ti[0]!=="."&&ti[0]!=="#"&&(ei=document.querySelectorAll("."+ti),ei.length||(ei=document.querySelectorAll("#"+ti))),Array.from(ei)}return[ti]}static getElement(ti){if(typeof ti=="string"){if(!ti.length)return null;if(ti[0]==="#")return document.getElementById(ti.substring(1));if(ti[0]==="."||ti[0]==="[")return document.querySelector(ti);if(!isNaN(+ti[0]))return document.getElementById(ti);let ei=document.querySelector(ti);return ei||(ei=document.getElementById(ti)),ei||(ei=document.querySelector("."+ti)),ei}return ti}static isIntercepted(ti,ei){return!(ti.y>=ei.y+ei.h||ti.y+ti.h<=ei.y||ti.x+ti.w<=ei.x||ti.x>=ei.x+ei.w)}static isTouching(ti,ei){return Vo.isIntercepted(ti,{x:ei.x-.5,y:ei.y-.5,w:ei.w+1,h:ei.h+1})}static areaIntercept(ti,ei){let ni=ti.x>ei.x?ti.x:ei.x,ri=ti.x+ti.w<ei.x+ei.w?ti.x+ti.w:ei.x+ei.w;if(ri<=ni)return 0;let si=ti.y>ei.y?ti.y:ei.y,ai=ti.y+ti.h<ei.y+ei.h?ti.y+ti.h:ei.y+ei.h;return ai<=si?0:(ri-ni)*(ai-si)}static area(ti){return ti.w*ti.h}static sort(ti,ei,ni){return ni=ni||ti.reduce((ri,si)=>Math.max(si.x+si.w,ri),0)||12,ei===-1?ti.sort((ri,si)=>si.x+si.y*ni-(ri.x+ri.y*ni)):ti.sort((ri,si)=>ri.x+ri.y*ni-(si.x+si.y*ni))}static createStylesheet(ti,ei){let ni=document.createElement("style");return ni.setAttribute("type","text/css"),ni.setAttribute("gs-style-id",ti),ni.styleSheet?ni.styleSheet.cssText="":ni.appendChild(document.createTextNode("")),ei?ei.insertBefore(ni,ei.firstChild):(ei=document.getElementsByTagName("head")[0],ei.appendChild(ni)),ni.sheet}static removeStylesheet(ti){let ei=document.querySelector("STYLE[gs-style-id="+ti+"]");ei&&ei.parentNode&&ei.remove()}static addCSSRule(ti,ei,ni){typeof ti.addRule=="function"?ti.addRule(ei,ni):typeof ti.insertRule=="function"&&ti.insertRule(`${ei}{${ni}}`)}static toBool(ti){return typeof ti=="boolean"?ti:typeof ti=="string"?(ti=ti.toLowerCase(),!(ti===""||ti==="no"||ti==="false"||ti==="0")):Boolean(ti)}static toNumber(ti){return ti===null||ti.length===0?void 0:Number(ti)}static parseHeight(ti){let ei,ni="px";if(typeof ti=="string"){let ri=ti.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!ri)throw new Error("Invalid height");ni=ri[2]||"px",ei=parseFloat(ri[1])}else ei=ti;return{h:ei,unit:ni}}static defaults(ti,...ei){return ei.forEach(ni=>{for(let ri in ni){if(!ni.hasOwnProperty(ri))return;ti[ri]===null||ti[ri]===void 0?ti[ri]=ni[ri]:typeof ni[ri]=="object"&&typeof ti[ri]=="object"&&this.defaults(ti[ri],ni[ri])}}),ti}static same(ti,ei){if(typeof ti!="object")return ti==ei;if(typeof ti!=typeof ei||Object.keys(ti).length!==Object.keys(ei).length)return!1;for(let ni in ti)if(ti[ni]!==ei[ni])return!1;return!0}static copyPos(ti,ei,ni=!1){return ti.x=ei.x,ti.y=ei.y,ti.w=ei.w,ti.h=ei.h,ni&&(ei.minW&&(ti.minW=ei.minW),ei.minH&&(ti.minH=ei.minH),ei.maxW&&(ti.maxW=ei.maxW),ei.maxH&&(ti.maxH=ei.maxH)),ti}static samePos(ti,ei){return ti&&ei&&ti.x===ei.x&&ti.y===ei.y&&ti.w===ei.w&&ti.h===ei.h}static removeInternalAndSame(ti,ei){if(!(typeof ti!="object"||typeof ei!="object"))for(let ni in ti){let ri=ti[ni];if(ni[0]==="_"||ri===ei[ni])delete ti[ni];else if(ri&&typeof ri=="object"&&ei[ni]!==void 0){for(let si in ri)(ri[si]===ei[ni][si]||si[0]==="_")&&delete ri[si];Object.keys(ri).length||delete ti[ni]}}}static removeInternalForSave(ti,ei=!0){for(let ni in ti)(ni[0]==="_"||ti[ni]===null||ti[ni]===void 0)&&delete ti[ni];delete ti.grid,ei&&delete ti.el,ti.autoPosition||delete ti.autoPosition,ti.noResize||delete ti.noResize,ti.noMove||delete ti.noMove,ti.locked||delete ti.locked,(ti.w===1||ti.w===ti.minW)&&delete ti.w,(ti.h===1||ti.h===ti.minH)&&delete ti.h}static closestUpByClass(ti,ei){for(;ti;){if(ti.classList.contains(ei))return ti;ti=ti.parentElement}return null}static throttle(ti,ei){let ni=!1;return(...ri)=>{ni||(ni=!0,setTimeout(()=>{ti(...ri),ni=!1},ei))}}static removePositioningStyles(ti){let ei=ti.style;ei.position&&ei.removeProperty("position"),ei.left&&ei.removeProperty("left"),ei.top&&ei.removeProperty("top"),ei.width&&ei.removeProperty("width"),ei.height&&ei.removeProperty("height")}static getScrollElement(ti){if(!ti)return document.scrollingElement||document.documentElement;let ei=getComputedStyle(ti);return/(auto|scroll)/.test(ei.overflow+ei.overflowY)?ti:this.getScrollElement(ti.parentElement)}static updateScrollPosition(ti,ei,ni){let ri=ti.getBoundingClientRect(),si=window.innerHeight||document.documentElement.clientHeight;if(ri.top<0||ri.bottom>si){let ai=ri.bottom-si,ci=ri.top,fi=this.getScrollElement(ti);if(fi!==null){let vi=fi.scrollTop;ri.top<0&&ni<0?ti.offsetHeight>si?fi.scrollTop+=ni:fi.scrollTop+=Math.abs(ci)>Math.abs(ni)?ni:ci:ni>0&&(ti.offsetHeight>si?fi.scrollTop+=ni:fi.scrollTop+=ai>ni?ni:ai),ei.top+=fi.scrollTop-vi}}}static updateScrollResize(ti,ei,ni){let ri=this.getScrollElement(ei),si=ri.clientHeight,ai=ri===this.getScrollElement()?0:ri.getBoundingClientRect().top,ci=ti.clientY-ai,fi=ci<ni,vi=ci>si-ni;fi?ri.scrollBy({behavior:"smooth",top:ci-ni}):vi&&ri.scrollBy({behavior:"smooth",top:ni-(si-ci)})}static clone(ti){return ti==null||typeof ti!="object"?ti:ti instanceof Array?[...ti]:Object.assign({},ti)}static cloneDeep(ti){let ei=["parentGrid","el","grid","subGrid","engine"],ni=Vo.clone(ti);for(let ri in ni)ni.hasOwnProperty(ri)&&typeof ni[ri]=="object"&&ri.substring(0,2)!=="__"&&!ei.find(si=>si===ri)&&(ni[ri]=Vo.cloneDeep(ti[ri]));return ni}static cloneNode(ti){let ei=ti.cloneNode(!0);return ei.removeAttribute("id"),ei}static appendTo(ti,ei){let ni;typeof ei=="string"?ni=document.querySelector(ei):ni=ei,ni&&ni.appendChild(ti)}static addElStyles(ti,ei){if(ei instanceof Object)for(let ni in ei)ei.hasOwnProperty(ni)&&(Array.isArray(ei[ni])?ei[ni].forEach(ri=>{ti.style[ni]=ri}):ti.style[ni]=ei[ni])}static initEvent(ti,ei){let ni={type:ei.type},ri={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:ei.target?ei.target:ti.target};return ti.dataTransfer&&(ni.dataTransfer=ti.dataTransfer),["altKey","ctrlKey","metaKey","shiftKey"].forEach(si=>ni[si]=ti[si]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(si=>ni[si]=ti[si]),Object.assign(Object.assign({},ni),ri)}static simulateMouseEvent(ti,ei,ni){let ri=document.createEvent("MouseEvents");ri.initMouseEvent(ei,!0,!0,window,1,ti.screenX,ti.screenY,ti.clientX,ti.clientY,ti.ctrlKey,ti.altKey,ti.shiftKey,ti.metaKey,0,ti.target),(ni||ti.target).dispatchEvent(ri)}};qr.Utils=Vo});var Wc=Un(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.GridStackEngine=void 0;var Tn=zs(),Ss=class{constructor(ti={}){this.addedNodes=[],this.removedNodes=[],this.column=ti.column||12,this.maxRow=ti.maxRow,this._float=ti.float,this.nodes=ti.nodes||[],this.onChange=ti.onChange}batchUpdate(ti=!0){return!!this.batchMode===ti?this:(this.batchMode=ti,ti?(this._prevFloat=this._float,this._float=!0,this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,this._packNodes()._notify()),this)}_useEntireRowArea(ti,ei){return!this.float&&!this._hasLocked&&(!ti._moving||ti._skipDown||ei.y<=ti.y)}_fixCollisions(ti,ei=ti,ni,ri={}){if(this.sortNodes(-1),ni=ni||this.collide(ti,ei),!ni)return!1;if(ti._moving&&!ri.nested&&!this.float&&this.swap(ti,ni))return!0;let si=ei;this._useEntireRowArea(ti,ei)&&(si={x:0,w:this.column,y:ei.y,h:ei.h},ni=this.collide(ti,si,ri.skip));let ai=!1,ci={nested:!0,pack:!1};for(;ni=ni||this.collide(ti,si,ri.skip);){let fi;if(ni.locked||ti._moving&&!ti._skipDown&&ei.y>ti.y&&!this.float&&(!this.collide(ni,Object.assign(Object.assign({},ni),{y:ti.y}),ti)||!this.collide(ni,Object.assign(Object.assign({},ni),{y:ei.y-ni.h}),ti))?(ti._skipDown=ti._skipDown||ei.y>ti.y,fi=this.moveNode(ti,Object.assign(Object.assign(Object.assign({},ei),{y:ni.y+ni.h}),ci)),ni.locked&&fi?Tn.Utils.copyPos(ei,ti):!ni.locked&&fi&&ri.pack&&(this._packNodes(),ei.y=ni.y+ni.h,Tn.Utils.copyPos(ti,ei)),ai=ai||fi):fi=this.moveNode(ni,Object.assign(Object.assign(Object.assign({},ni),{y:ei.y+ei.h,skip:ti}),ci)),!fi)return ai;ni=void 0}return ai}collide(ti,ei=ti,ni){return this.nodes.find(ri=>ri!==ti&&ri!==ni&&Tn.Utils.isIntercepted(ri,ei))}collideAll(ti,ei=ti,ni){return this.nodes.filter(ri=>ri!==ti&&ri!==ni&&Tn.Utils.isIntercepted(ri,ei))}directionCollideCoverage(ti,ei,ni){if(!ei.rect||!ti._rect)return;let ri=ti._rect,si=Object.assign({},ei.rect);si.y>ri.y?(si.h+=si.y-ri.y,si.y=ri.y):si.h+=ri.y-si.y,si.x>ri.x?(si.w+=si.x-ri.x,si.x=ri.x):si.w+=ri.x-si.x;let ai;return ni.forEach(ci=>{if(ci.locked||!ci._rect)return;let fi=ci._rect,vi=Number.MAX_VALUE,hi=Number.MAX_VALUE,bi=.5;ri.y<fi.y?vi=(si.y+si.h-fi.y)/fi.h:ri.y+ri.h>fi.y+fi.h&&(vi=(fi.y+fi.h-si.y)/fi.h),ri.x<fi.x?hi=(si.x+si.w-fi.x)/fi.w:ri.x+ri.w>fi.x+fi.w&&(hi=(fi.x+fi.w-si.x)/fi.w);let wi=Math.min(hi,vi);wi>bi&&(bi=wi,ai=ci)}),ei.collide=ai,ai}cacheRects(ti,ei,ni,ri,si,ai){return this.nodes.forEach(ci=>ci._rect={y:ci.y*ei+ni,x:ci.x*ti+ai,w:ci.w*ti-ai-ri,h:ci.h*ei-ni-si}),this}swap(ti,ei){if(!ei||ei.locked||!ti||ti.locked)return!1;function ni(){let si=ei.x,ai=ei.y;return ei.x=ti.x,ei.y=ti.y,ti.h!=ei.h?(ti.x=si,ti.y=ei.y+ei.h):ti.w!=ei.w?(ti.x=ei.x+ei.w,ti.y=ai):(ti.x=si,ti.y=ai),ti._dirty=ei._dirty=!0,!0}let ri;if(ti.w===ei.w&&ti.h===ei.h&&(ti.x===ei.x||ti.y===ei.y)&&(ri=Tn.Utils.isTouching(ti,ei)))return ni();if(ri!==!1){if(ti.w===ei.w&&ti.x===ei.x&&(ri||(ri=Tn.Utils.isTouching(ti,ei)))){if(ei.y<ti.y){let si=ti;ti=ei,ei=si}return ni()}if(ri!==!1){if(ti.h===ei.h&&ti.y===ei.y&&(ri||(ri=Tn.Utils.isTouching(ti,ei)))){if(ei.x<ti.x){let si=ti;ti=ei,ei=si}return ni()}return!1}}}isAreaEmpty(ti,ei,ni,ri){let si={x:ti||0,y:ei||0,w:ni||1,h:ri||1};return!this.collide(si)}compact(){if(this.nodes.length===0)return this;this.batchUpdate().sortNodes();let ti=this.nodes;return this.nodes=[],ti.forEach(ei=>{ei.locked||(ei.autoPosition=!0),this.addNode(ei,!1),ei._dirty=!0}),this.batchUpdate(!1)}set float(ti){this._float!==ti&&(this._float=ti||!1,ti||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(ti){return this.nodes=Tn.Utils.sort(this.nodes,ti,this.column),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(ti=>{if(ti._updating||ti._orig===void 0||ti.y===ti._orig.y)return;let ei=ti.y;for(;ei>ti._orig.y;)--ei,this.collide(ti,{x:ti.x,y:ei,w:ti.w,h:ti.h})||(ti._dirty=!0,ti.y=ei)}):this.nodes.forEach((ti,ei)=>{if(!ti.locked)for(;ti.y>0;){let ni=ei===0?0:ti.y-1;if(!(ei===0||!this.collide(ti,{x:ti.x,y:ni,w:ti.w,h:ti.h})))break;ti._dirty=ti.y!==ni,ti.y=ni}}),this)}prepareNode(ti,ei){ti=ti||{},ti._id=ti._id||Ss._idSeq++,(ti.x===void 0||ti.y===void 0||ti.x===null||ti.y===null)&&(ti.autoPosition=!0);let ni={x:0,y:0,w:1,h:1};return Tn.Utils.defaults(ti,ni),ti.autoPosition||delete ti.autoPosition,ti.noResize||delete ti.noResize,ti.noMove||delete ti.noMove,typeof ti.x=="string"&&(ti.x=Number(ti.x)),typeof ti.y=="string"&&(ti.y=Number(ti.y)),typeof ti.w=="string"&&(ti.w=Number(ti.w)),typeof ti.h=="string"&&(ti.h=Number(ti.h)),isNaN(ti.x)&&(ti.x=ni.x,ti.autoPosition=!0),isNaN(ti.y)&&(ti.y=ni.y,ti.autoPosition=!0),isNaN(ti.w)&&(ti.w=ni.w),isNaN(ti.h)&&(ti.h=ni.h),this.nodeBoundFix(ti,ei)}nodeBoundFix(ti,ei){let ni=ti._orig||Tn.Utils.copyPos({},ti);if(ti.maxW&&(ti.w=Math.min(ti.w,ti.maxW)),ti.maxH&&(ti.h=Math.min(ti.h,ti.maxH)),ti.minW&&ti.minW<=this.column&&(ti.w=Math.max(ti.w,ti.minW)),ti.minH&&(ti.h=Math.max(ti.h,ti.minH)),(this.column===1||ti.x+ti.w>this.column)&&this.column<12&&!this._inColumnResize&&!ti.autoPosition&&ti._id&&this.findCacheLayout(ti,12)===-1){let si=Object.assign({},ti);si.x=Math.min(11,si.x),si.w=Math.min(12,si.w),this.cacheOneLayout(si,12)}return ti.w>this.column?ti.w=this.column:ti.w<1&&(ti.w=1),this.maxRow&&ti.h>this.maxRow?ti.h=this.maxRow:ti.h<1&&(ti.h=1),ti.x<0&&(ti.x=0),ti.y<0&&(ti.y=0),ti.x+ti.w>this.column&&(ei?ti.w=this.column-ti.x:ti.x=this.column-ti.w),this.maxRow&&ti.y+ti.h>this.maxRow&&(ei?ti.h=this.maxRow-ti.y:ti.y=this.maxRow-ti.h),Tn.Utils.samePos(ti,ni)||(ti._dirty=!0),ti}getDirtyNodes(ti){return ti?this.nodes.filter(ei=>ei._dirty&&!Tn.Utils.samePos(ei,ei._orig)):this.nodes.filter(ei=>ei._dirty)}_notify(ti){if(this.batchMode||!this.onChange)return this;let ei=(ti||[]).concat(this.getDirtyNodes());return this.onChange(ei),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(ti=>{delete ti._dirty,delete ti._lastTried}),this)}saveInitial(){return this.nodes.forEach(ti=>{ti._orig=Tn.Utils.copyPos({},ti),delete ti._dirty}),this._hasLocked=this.nodes.some(ti=>ti.locked),this}restoreInitial(){return this.nodes.forEach(ti=>{Tn.Utils.samePos(ti,ti._orig)||(Tn.Utils.copyPos(ti,ti._orig),ti._dirty=!0)}),this._notify(),this}findEmptyPosition(ti){this.sortNodes();let ei=!1;for(let ni=0;!ei;++ni){let ri=ni%this.column,si=Math.floor(ni/this.column);if(ri+ti.w>this.column)continue;let ai={x:ri,y:si,w:ti.w,h:ti.h};this.nodes.find(ci=>Tn.Utils.isIntercepted(ai,ci))||(ti.x=ri,ti.y=si,ei=!0)}return ei}addNode(ti,ei=!1){let ni=this.nodes.find(ri=>ri._id===ti._id);return ni||(ti=this._inColumnResize?this.nodeBoundFix(ti):this.prepareNode(ti),delete ti._temporaryRemoved,delete ti._removeDOM,ti.autoPosition&&this.findEmptyPosition(ti)&&delete ti.autoPosition,this.nodes.push(ti),ei&&this.addedNodes.push(ti),this._fixCollisions(ti),this.batchMode||this._packNodes()._notify(),ti)}removeNode(ti,ei=!0,ni=!1){return this.nodes.find(ri=>ri===ti)?(ni&&this.removedNodes.push(ti),ei&&(ti._removeDOM=!0),this.nodes=this.nodes.filter(ri=>ri!==ti),this._packNodes()._notify([ti])):this}removeAll(ti=!0){return delete this._layouts,this.nodes.length===0?this:(ti&&this.nodes.forEach(ei=>ei._removeDOM=!0),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes))}moveNodeCheck(ti,ei){if(!this.changedPosConstrain(ti,ei))return!1;if(ei.pack=!0,!this.maxRow)return this.moveNode(ti,ei);let ni,ri=new Ss({column:this.column,float:this.float,nodes:this.nodes.map(ai=>ai===ti?(ni=Object.assign({},ai),ni):Object.assign({},ai))});if(!ni)return!1;let si=ri.moveNode(ni,ei)&&ri.getRow()<=this.maxRow;if(!si&&!ei.resizing&&ei.collide){let ai=ei.collide.el.gridstackNode;if(this.swap(ti,ai))return this._notify(),!0}return si?(ri.nodes.filter(ai=>ai._dirty).forEach(ai=>{let ci=this.nodes.find(fi=>fi._id===ai._id);!ci||(Tn.Utils.copyPos(ci,ai),ci._dirty=!0)}),this._notify(),!0):!1}willItFit(ti){if(delete ti._willFitPos,!this.maxRow)return!0;let ei=new Ss({column:this.column,float:this.float,nodes:this.nodes.map(ri=>Object.assign({},ri))}),ni=Object.assign({},ti);return this.cleanupNode(ni),delete ni.el,delete ni._id,delete ni.content,delete ni.grid,ei.addNode(ni),ei.getRow()<=this.maxRow?(ti._willFitPos=Tn.Utils.copyPos({},ni),!0):!1}changedPosConstrain(ti,ei){return ei.w=ei.w||ti.w,ei.h=ei.h||ti.h,ti.x!==ei.x||ti.y!==ei.y?!0:(ti.maxW&&(ei.w=Math.min(ei.w,ti.maxW)),ti.maxH&&(ei.h=Math.min(ei.h,ti.maxH)),ti.minW&&(ei.w=Math.max(ei.w,ti.minW)),ti.minH&&(ei.h=Math.max(ei.h,ti.minH)),ti.w!==ei.w||ti.h!==ei.h)}moveNode(ti,ei){var ni,ri;if(!ti||!ei)return!1;let si;ei.pack===void 0&&(si=ei.pack=!0),typeof ei.x!="number"&&(ei.x=ti.x),typeof ei.y!="number"&&(ei.y=ti.y),typeof ei.w!="number"&&(ei.w=ti.w),typeof ei.h!="number"&&(ei.h=ti.h);let ai=ti.w!==ei.w||ti.h!==ei.h,ci=Tn.Utils.copyPos({},ti,!0);if(Tn.Utils.copyPos(ci,ei),ci=this.nodeBoundFix(ci,ai),Tn.Utils.copyPos(ei,ci),Tn.Utils.samePos(ti,ei))return!1;let fi=Tn.Utils.copyPos({},ti),vi=this.collideAll(ti,ci,ei.skip),hi=!0;if(vi.length){let bi=ti._moving&&!ei.nested,wi=bi?this.directionCollideCoverage(ti,ei,vi):vi[0];if(bi&&wi&&((ri=(ni=ti.grid)===null||ni===void 0?void 0:ni.opts)===null||ri===void 0?void 0:ri.subGridDynamic)&&!ti.grid._isTemp){let Ti=Tn.Utils.areaIntercept(ei.rect,wi._rect),ki=Tn.Utils.area(ei.rect),Ci=Tn.Utils.area(wi._rect);Ti/(ki<Ci?ki:Ci)>.8&&(wi.grid.makeSubGrid(wi.el,void 0,ti),wi=void 0)}wi?hi=!this._fixCollisions(ti,ci,wi,ei):(hi=!1,si&&delete ei.pack)}return hi&&(ti._dirty=!0,Tn.Utils.copyPos(ti,ci)),ei.pack&&this._packNodes()._notify(),!Tn.Utils.samePos(ti,fi)}getRow(){return this.nodes.reduce((ti,ei)=>Math.max(ti,ei.y+ei.h),0)}beginUpdate(ti){return ti._updating||(ti._updating=!0,delete ti._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let ti=this.nodes.find(ei=>ei._updating);return ti&&(delete ti._updating,delete ti._skipDown),this}save(ti=!0){var ei;let ni=(ei=this._layouts)===null||ei===void 0?void 0:ei.length,ri=ni&&this.column!==ni-1?this._layouts[ni-1]:null,si=[];return this.sortNodes(),this.nodes.forEach(ai=>{let ci=ri==null?void 0:ri.find(vi=>vi._id===ai._id),fi=Object.assign({},ai);ci&&(fi.x=ci.x,fi.y=ci.y,fi.w=ci.w),Tn.Utils.removeInternalForSave(fi,!ti),si.push(fi)}),si}layoutsNodesChange(ti){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((ei,ni)=>{if(!ei||ni===this.column)return this;if(ni<this.column)this._layouts[ni]=void 0;else{let ri=ni/this.column;ti.forEach(si=>{if(!si._orig)return;let ai=ei.find(ci=>ci._id===si._id);!ai||(si.y!==si._orig.y&&(ai.y+=si.y-si._orig.y),si.x!==si._orig.x&&(ai.x=Math.round(si.x*ri)),si.w!==si._orig.w&&(ai.w=Math.round(si.w*ri)))})}}),this)}updateNodeWidths(ti,ei,ni,ri="moveScale"){var si;if(!this.nodes.length||!ei||ti===ei)return this;this.cacheLayout(this.nodes,ti),this.batchUpdate();let ai=[],ci=!1;if(ei===1&&(ni==null?void 0:ni.length)){ci=!0;let vi=0;ni.forEach(hi=>{hi.x=0,hi.w=1,hi.y=Math.max(hi.y,vi),vi=hi.y+hi.h}),ai=ni,ni=[]}else ni=Tn.Utils.sort(this.nodes,-1,ti);let fi=[];if(ei>ti){fi=this._layouts[ei]||[];let vi=this._layouts.length-1;!fi.length&&ti!==vi&&((si=this._layouts[vi])===null||si===void 0?void 0:si.length)&&(ti=vi,this._layouts[vi].forEach(hi=>{let bi=ni.find(wi=>wi._id===hi._id);bi&&(bi.x=hi.x,bi.y=hi.y,bi.w=hi.w)}))}if(fi.forEach(vi=>{let hi=ni.findIndex(bi=>bi._id===vi._id);hi!==-1&&(ni[hi].x=vi.x,ni[hi].y=vi.y,ni[hi].w=vi.w,ai.push(ni[hi]),ni.splice(hi,1))}),ni.length){if(typeof ri=="function")ri(ei,ti,ai,ni);else if(!ci){let vi=ei/ti,hi=ri==="move"||ri==="moveScale",bi=ri==="scale"||ri==="moveScale";ni.forEach(wi=>{wi.x=ei===1?0:hi?Math.round(wi.x*vi):Math.min(wi.x,ei-1),wi.w=ei===1||ti===1?1:bi?Math.round(wi.w*vi)||1:Math.min(wi.w,ei),ai.push(wi)}),ni=[]}}return ci||(ai=Tn.Utils.sort(ai,-1,ei)),this._inColumnResize=!0,this.nodes=[],ai.forEach(vi=>{this.addNode(vi,!1),delete vi._orig}),this.batchUpdate(!1),delete this._inColumnResize,this}cacheLayout(ti,ei,ni=!1){let ri=[];return ti.forEach((si,ai)=>{si._id=si._id||Ss._idSeq++,ri[ai]={x:si.x,y:si.y,w:si.w,_id:si._id}}),this._layouts=ni?[]:this._layouts||[],this._layouts[ei]=ri,this}cacheOneLayout(ti,ei){ti._id=ti._id||Ss._idSeq++;let ni={x:ti.x,y:ti.y,w:ti.w,_id:ti._id};this._layouts=this._layouts||[],this._layouts[ei]=this._layouts[ei]||[];let ri=this.findCacheLayout(ti,ei);return ri===-1?this._layouts[ei].push(ni):this._layouts[ei][ri]=ni,this}findCacheLayout(ti,ei){var ni,ri,si;return(si=(ri=(ni=this._layouts)===null||ni===void 0?void 0:ni[ei])===null||ri===void 0?void 0:ri.findIndex(ai=>ai._id===ti._id))!==null&&si!==void 0?si:-1}cleanupNode(ti){for(let ei in ti)ei[0]==="_"&&ei!=="_id"&&delete ti[ei];return this}};vl.GridStackEngine=Ss;Ss._idSeq=1});var Yc=Un(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.dragInDefaultOptions=zo.gridDefaults=void 0;zo.gridDefaults={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,oneColumnSize:768,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:".grid-stack-item"},resizable:{handles:"se"},rtl:"auto"};zo.dragInDefaultOptions={handle:".grid-stack-item-content",appendTo:"body"}});var fo=Un(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.DDManager=void 0;var qf=class{};_l.DDManager=qf});var Sa=Un(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.pointerleave=Cr.pointerenter=Cr.pointerdown=Cr.touchend=Cr.touchmove=Cr.touchstart=Cr.isTouch=void 0;var Gc=fo();Cr.isTouch=typeof window!="undefined"&&typeof document!="undefined"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);var ts=class{};function yl(ii,ti){if(ii.touches.length>1)return;ii.cancelable&&ii.preventDefault();let ei=ii.changedTouches[0],ni=document.createEvent("MouseEvents");ni.initMouseEvent(ti,!0,!0,window,1,ei.screenX,ei.screenY,ei.clientX,ei.clientY,!1,!1,!1,!1,0,null),ii.target.dispatchEvent(ni)}function Wf(ii,ti){ii.cancelable&&ii.preventDefault();let ei=document.createEvent("MouseEvents");ei.initMouseEvent(ti,!0,!0,window,1,ii.screenX,ii.screenY,ii.clientX,ii.clientY,!1,!1,!1,!1,0,null),ii.target.dispatchEvent(ei)}function iy(ii){ts.touchHandled||(ts.touchHandled=!0,yl(ii,"mousedown"))}Cr.touchstart=iy;function ny(ii){!ts.touchHandled||yl(ii,"mousemove")}Cr.touchmove=ny;function ry(ii){if(!ts.touchHandled)return;ts.pointerLeaveTimeout&&(window.clearTimeout(ts.pointerLeaveTimeout),delete ts.pointerLeaveTimeout);let ti=!!Gc.DDManager.dragElement;yl(ii,"mouseup"),ti||yl(ii,"click"),ts.touchHandled=!1}Cr.touchend=ry;function sy(ii){ii.target.releasePointerCapture(ii.pointerId)}Cr.pointerdown=sy;function oy(ii){!Gc.DDManager.dragElement||Wf(ii,"mouseenter")}Cr.pointerenter=oy;function ay(ii){!Gc.DDManager.dragElement||(ts.pointerLeaveTimeout=window.setTimeout(()=>{delete ts.pointerLeaveTimeout,Wf(ii,"mouseleave")},10))}Cr.pointerleave=ay});var Yf=Un(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.DDResizableHandle=void 0;var Wr=Sa(),Ta=class{constructor(ti,ei,ni){this.moving=!1,this.host=ti,this.dir=ei,this.option=ni,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._init()}_init(){let ti=document.createElement("div");return ti.classList.add("ui-resizable-handle"),ti.classList.add(`${Ta.prefix}${this.dir}`),ti.style.zIndex="100",ti.style.userSelect="none",this.el=ti,this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Wr.isTouch&&(this.el.addEventListener("touchstart",Wr.touchstart),this.el.addEventListener("pointerdown",Wr.pointerdown)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Wr.isTouch&&(this.el.removeEventListener("touchstart",Wr.touchstart),this.el.removeEventListener("pointerdown",Wr.pointerdown)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(ti){this.mouseDownEvent=ti,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),Wr.isTouch&&(this.el.addEventListener("touchmove",Wr.touchmove),this.el.addEventListener("touchend",Wr.touchend)),ti.stopPropagation(),ti.preventDefault()}_mouseMove(ti){let ei=this.mouseDownEvent;this.moving?this._triggerEvent("move",ti):Math.abs(ti.x-ei.x)+Math.abs(ti.y-ei.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",ti)),ti.stopPropagation(),ti.preventDefault()}_mouseUp(ti){this.moving&&this._triggerEvent("stop",ti),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Wr.isTouch&&(this.el.removeEventListener("touchmove",Wr.touchmove),this.el.removeEventListener("touchend",Wr.touchend)),delete this.moving,delete this.mouseDownEvent,ti.stopPropagation(),ti.preventDefault()}_triggerEvent(ti,ei){return this.option[ti]&&this.option[ti](ei),this}};bl.DDResizableHandle=Ta;Ta.prefix="ui-resizable-"});var wl=Un(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.DDBaseImplement=void 0;var Gf=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(ti,ei){this._eventRegister[ti]=ei}off(ti){delete this._eventRegister[ti]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(ti,ei){if(!this.disabled&&this._eventRegister&&this._eventRegister[ti])return this._eventRegister[ti](ei)}};El.DDBaseImplement=Gf});var Kf=Un(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.DDResizable=void 0;var ly=Yf(),cy=wl(),xl=zs(),ho=fo(),qo=class extends cy.DDBaseImplement{constructor(ti,ei={}){super();this._ui=()=>{let ri=this.el.parentElement.getBoundingClientRect(),si={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},ai=this.temporalRect||si;return{position:{left:ai.left-ri.left,top:ai.top-ri.top},size:{width:ai.width,height:ai.height}}},this.el=ti,this.option=ei,this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(ti,ei){super.on(ti,ei)}off(ti){super.off(ti)}enable(){super.enable(),this.el.classList.add("ui-resizable"),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this.el.classList.remove("ui-resizable"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),this.el.classList.remove("ui-resizable"),delete this.el,super.destroy()}updateOption(ti){let ei=ti.handles&&ti.handles!==this.option.handles,ni=ti.autoHide&&ti.autoHide!==this.option.autoHide;return Object.keys(ti).forEach(ri=>this.option[ri]=ti[ri]),ei&&(this._removeHandlers(),this._setupHandlers()),ni&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(ti){return ti?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),ho.DDManager.overResizeElement===this&&delete ho.DDManager.overResizeElement),this}_mouseOver(ti){ho.DDManager.overResizeElement||ho.DDManager.dragElement||(ho.DDManager.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(ti){ho.DDManager.overResizeElement===this&&(delete ho.DDManager.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){let ti=this.option.handles||"e,s,se";return ti==="all"&&(ti="n,e,s,w,se,sw,ne,nw"),this.handlers=ti.split(",").map(ei=>ei.trim()).map(ei=>new ly.DDResizableHandle(this.el,ei,{start:ni=>{this._resizeStart(ni)},stop:ni=>{this._resizeStop(ni)},move:ni=>{this._resizing(ni,ei)}})),this}_resizeStart(ti){this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=xl.Utils.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=ti,this._setupHelper(),this._applyChange();let ei=xl.Utils.initEvent(ti,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(ei,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",ei),this}_resizing(ti,ei){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(ti,ei),this._applyChange();let ni=xl.Utils.initEvent(ti,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(ni,this._ui()),this.triggerEvent("resize",ni),this}_resizeStop(ti){let ei=xl.Utils.initEvent(ti,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(ei),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",ei),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){return this.elOriginStyleVal=qo._originStyleProp.map(ti=>this.el.style[ti]),this.parentOriginStylePosition=this.el.parentElement.style.position,window.getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return qo._originStyleProp.forEach((ti,ei)=>{this.el.style[ti]=this.elOriginStyleVal[ei]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(ti,ei){let ni=this.startEvent,ri={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},si=ti.clientX-ni.clientX,ai=ti.clientY-ni.clientY;ei.indexOf("e")>-1?ri.width+=si:ei.indexOf("w")>-1&&(ri.width-=si,ri.left+=si),ei.indexOf("s")>-1?ri.height+=ai:ei.indexOf("n")>-1&&(ri.height-=ai,ri.top+=ai);let ci=this._constrainSize(ri.width,ri.height);return Math.round(ri.width)!==Math.round(ci.width)&&(ei.indexOf("w")>-1&&(ri.left+=ri.width-ci.width),ri.width=ci.width),Math.round(ri.height)!==Math.round(ci.height)&&(ei.indexOf("n")>-1&&(ri.top+=ri.height-ci.height),ri.height=ci.height),ri}_constrainSize(ti,ei){let ni=this.option.maxWidth||Number.MAX_SAFE_INTEGER,ri=this.option.minWidth||ti,si=this.option.maxHeight||Number.MAX_SAFE_INTEGER,ai=this.option.minHeight||ei,ci=Math.min(ni,Math.max(ri,ti)),fi=Math.min(si,Math.max(ai,ei));return{width:ci,height:fi}}_applyChange(){let ti={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let ei=this.el.parentElement,{left:ni,top:ri}=ei.getBoundingClientRect();ti={left:ni,top:ri,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(ei=>{let ni=this.temporalRect[ei];this.el.style[ei]=ni-ti[ei]+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(ti=>ti.destroy()),delete this.handlers,this}};Sl.DDResizable=qo;qo._originStyleProp=["width","height","position","left","top","opacity","zIndex"]});var Xf=Un(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.DDDraggable=void 0;var _r=fo(),Wo=zs(),uy=wl(),Yr=Sa(),Yo=class extends uy.DDBaseImplement{constructor(ti,ei={}){super();this.el=ti,this.option=ei;let ni=ei.handle.substring(1);this.dragEl=ti.classList.contains(ni)?ti:ti.querySelector(ei.handle)||ti,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this.enable()}on(ti,ei){super.on(ti,ei)}off(ti){super.off(ti)}enable(){this.disabled!==!1&&(super.enable(),this.dragEl.addEventListener("mousedown",this._mouseDown),Yr.isTouch&&(this.dragEl.addEventListener("touchstart",Yr.touchstart),this.dragEl.addEventListener("pointerdown",Yr.pointerdown)),this.el.classList.remove("ui-draggable-disabled"),this.el.classList.add("ui-draggable"))}disable(ti=!1){this.disabled!==!0&&(super.disable(),this.dragEl.removeEventListener("mousedown",this._mouseDown),Yr.isTouch&&(this.dragEl.removeEventListener("touchstart",Yr.touchstart),this.dragEl.removeEventListener("pointerdown",Yr.pointerdown)),this.el.classList.remove("ui-draggable"),ti||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.dragging&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(ti){return Object.keys(ti).forEach(ei=>this.option[ei]=ti[ei]),this}_mouseDown(ti){if(_r.DDManager.mouseHandled)return;if(ti.button!==0)return!0;let ei=["input","textarea","button","select","option"],ni=ti.target.nodeName.toLowerCase();return ei.find(ri=>ri===ni)||ti.target.closest('[contenteditable="true"]')||(this.mouseDownEvent=ti,delete this.dragging,delete _r.DDManager.dragElement,delete _r.DDManager.dropElement,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),Yr.isTouch&&(this.dragEl.addEventListener("touchmove",Yr.touchmove),this.dragEl.addEventListener("touchend",Yr.touchend)),ti.preventDefault(),document.activeElement&&document.activeElement.blur(),_r.DDManager.mouseHandled=!0),!0}_callDrag(ti){if(!this.dragging)return;let ei=Wo.Utils.initEvent(ti,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(ei,this.ui()),this.triggerEvent("drag",ei)}_mouseMove(ti){var ei;let ni=this.mouseDownEvent;if(this.dragging)if(this._dragFollow(ti),_r.DDManager.pauseDrag){let ri=Number.isInteger(_r.DDManager.pauseDrag)?_r.DDManager.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(ti),ri)}else this._callDrag(ti);else if(Math.abs(ti.x-ni.x)+Math.abs(ti.y-ni.y)>3){this.dragging=!0,_r.DDManager.dragElement=this;let ri=(ei=this.el.gridstackNode)===null||ei===void 0?void 0:ei.grid;ri?_r.DDManager.dropElement=ri.el.ddElement.ddDroppable:delete _r.DDManager.dropElement,this.helper=this._createHelper(ti),this._setupHelperContainmentStyle(),this.dragOffset=this._getDragOffset(ti,this.el,this.helperContainment);let si=Wo.Utils.initEvent(ti,{target:this.el,type:"dragstart"});this._setupHelperStyle(ti),this.option.start&&this.option.start(si,this.ui()),this.triggerEvent("dragstart",si)}return ti.preventDefault(),!0}_mouseUp(ti){var ei;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Yr.isTouch&&(this.dragEl.removeEventListener("touchmove",Yr.touchmove,!0),this.dragEl.removeEventListener("touchend",Yr.touchend,!0)),this.dragging){delete this.dragging,((ei=_r.DDManager.dropElement)===null||ei===void 0?void 0:ei.el)===this.el.parentElement&&delete _r.DDManager.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();let ni=Wo.Utils.initEvent(ti,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(ni),this.triggerEvent("dragstop",ni),_r.DDManager.dropElement&&_r.DDManager.dropElement.drop(ti)}delete this.helper,delete this.mouseDownEvent,delete _r.DDManager.dragElement,delete _r.DDManager.dropElement,delete _r.DDManager.mouseHandled,ti.preventDefault()}_createHelper(ti){let ei=this.el;return typeof this.option.helper=="function"?ei=this.option.helper(ti):this.option.helper==="clone"&&(ei=Wo.Utils.cloneNode(this.el)),document.body.contains(ei)||Wo.Utils.appendTo(ei,this.option.appendTo==="parent"?this.el.parentNode:this.option.appendTo),ei===this.el&&(this.dragElementOriginStyle=Yo.originStyleProp.map(ni=>this.el.style[ni])),ei}_setupHelperStyle(ti){this.helper.classList.add("ui-draggable-dragging");let ei=this.helper.style;return ei.pointerEvents="none",ei["min-width"]=0,ei.width=this.dragOffset.width+"px",ei.height=this.dragOffset.height+"px",ei.willChange="left, top",ei.position="fixed",this._dragFollow(ti),ei.transition="none",setTimeout(()=>{this.helper&&(ei.transition=null)},0),this}_removeHelperStyle(){var ti;this.helper.classList.remove("ui-draggable-dragging");let ei=(ti=this.helper)===null||ti===void 0?void 0:ti.gridstackNode;if(!(ei==null?void 0:ei._isAboutToRemove)&&this.dragElementOriginStyle){let ni=this.helper,ri=this.dragElementOriginStyle.transition||null;ni.style.transition=this.dragElementOriginStyle.transition="none",Yo.originStyleProp.forEach(si=>ni.style[si]=this.dragElementOriginStyle[si]||null),setTimeout(()=>ni.style.transition=ri,50)}return delete this.dragElementOriginStyle,this}_dragFollow(ti){let ei={left:0,top:0},ni=this.helper.style,ri=this.dragOffset;ni.left=ti.clientX+ri.offsetLeft-ei.left+"px",ni.top=ti.clientY+ri.offsetTop-ei.top+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,window.getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(ti,ei,ni){let ri=0,si=0;if(ni){let ci=document.createElement("div");Wo.Utils.addElStyles(ci,{opacity:"0",position:"fixed",top:0+"px",left:0+"px",width:"1px",height:"1px",zIndex:"-999999"}),ni.appendChild(ci);let fi=ci.getBoundingClientRect();ni.removeChild(ci),ri=fi.left,si=fi.top}let ai=ei.getBoundingClientRect();return{left:ai.left,top:ai.top,offsetLeft:-ti.clientX+ai.left-ri,offsetTop:-ti.clientY+ai.top-si,width:ai.width,height:ai.height}}ui(){let ei=this.el.parentElement.getBoundingClientRect(),ni=this.helper.getBoundingClientRect();return{position:{top:ni.top-ei.top,left:ni.left-ei.left}}}};Tl.DDDraggable=Yo;Yo.originStyleProp=["transition","pointerEvents","position","left","top","minWidth","willChange"]});var Qf=Un(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.DDDroppable=void 0;var Pr=fo(),dy=wl(),Kc=zs(),Go=Sa(),Jf=class extends dy.DDBaseImplement{constructor(ti,ei={}){super();this.el=ti,this.option=ei,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(ti,ei){super.on(ti,ei)}off(ti){super.off(ti)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Go.isTouch&&(this.el.addEventListener("pointerenter",Go.pointerenter),this.el.addEventListener("pointerleave",Go.pointerleave)))}disable(ti=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),ti||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Go.isTouch&&(this.el.removeEventListener("pointerenter",Go.pointerenter),this.el.removeEventListener("pointerleave",Go.pointerleave)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(ti){return Object.keys(ti).forEach(ei=>this.option[ei]=ti[ei]),this._setupAccept(),this}_mouseEnter(ti){if(!Pr.DDManager.dragElement||!this._canDrop(Pr.DDManager.dragElement.el))return;ti.preventDefault(),ti.stopPropagation(),Pr.DDManager.dropElement&&Pr.DDManager.dropElement!==this&&Pr.DDManager.dropElement._mouseLeave(ti),Pr.DDManager.dropElement=this;let ei=Kc.Utils.initEvent(ti,{target:this.el,type:"dropover"});this.option.over&&this.option.over(ei,this._ui(Pr.DDManager.dragElement)),this.triggerEvent("dropover",ei),this.el.classList.add("ui-droppable-over")}_mouseLeave(ti){var ei;if(!Pr.DDManager.dragElement||Pr.DDManager.dropElement!==this)return;ti.preventDefault(),ti.stopPropagation();let ni=Kc.Utils.initEvent(ti,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(ni,this._ui(Pr.DDManager.dragElement)),this.triggerEvent("dropout",ni),Pr.DDManager.dropElement===this){delete Pr.DDManager.dropElement;let ri,si=this.el.parentElement;for(;!ri&&si;)ri=(ei=si.ddElement)===null||ei===void 0?void 0:ei.ddDroppable,si=si.parentElement;ri&&ri._mouseEnter(ti)}}drop(ti){ti.preventDefault();let ei=Kc.Utils.initEvent(ti,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(ei,this._ui(Pr.DDManager.dragElement)),this.triggerEvent("drop",ei)}_canDrop(ti){return ti&&(!this.accept||this.accept(ti))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=ti=>ti.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(ti){return Object.assign({draggable:ti.el},ti.ui())}};Cl.DDDroppable=Jf});var Zf=Un(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.DDElement=void 0;var fy=Kf(),hy=Xf(),py=Qf(),Dl=class{constructor(ti){this.el=ti}static init(ti){return ti.ddElement||(ti.ddElement=new Dl(ti)),ti.ddElement}on(ti,ei){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(ti)>-1?this.ddDraggable.on(ti,ei):this.ddDroppable&&["drop","dropover","dropout"].indexOf(ti)>-1?this.ddDroppable.on(ti,ei):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(ti)>-1&&this.ddResizable.on(ti,ei),this}off(ti){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(ti)>-1?this.ddDraggable.off(ti):this.ddDroppable&&["drop","dropover","dropout"].indexOf(ti)>-1?this.ddDroppable.off(ti):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(ti)>-1&&this.ddResizable.off(ti),this}setupDraggable(ti){return this.ddDraggable?this.ddDraggable.updateOption(ti):this.ddDraggable=new hy.DDDraggable(this.el,ti),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(ti){return this.ddResizable?this.ddResizable.updateOption(ti):this.ddResizable=new fy.DDResizable(this.el,ti),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(ti){return this.ddDroppable?this.ddDroppable.updateOption(ti):this.ddDroppable=new py.DDDroppable(this.el,ti),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};Al.DDElement=Dl});var Xc=Un(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.DDGridStack=void 0;var my=zs(),Ol=fo(),gy=Zf(),eh=class{resizable(ti,ei,ni,ri){return this._getDDElements(ti).forEach(si=>{if(ei==="disable"||ei==="enable")si.ddResizable&&si.ddResizable[ei]();else if(ei==="destroy")si.ddResizable&&si.cleanResizable();else if(ei==="option")si.setupResizable({[ni]:ri});else{let ai=si.el.gridstackNode.grid,ci=si.el.getAttribute("gs-resize-handles")?si.el.getAttribute("gs-resize-handles"):ai.opts.resizable.handles,fi=!ai.opts.alwaysShowResizeHandle;si.setupResizable(Object.assign(Object.assign(Object.assign({},ai.opts.resizable),{handles:ci,autoHide:fi}),{start:ei.start,stop:ei.stop,resize:ei.resize}))}}),this}draggable(ti,ei,ni,ri){return this._getDDElements(ti).forEach(si=>{if(ei==="disable"||ei==="enable")si.ddDraggable&&si.ddDraggable[ei]();else if(ei==="destroy")si.ddDraggable&&si.cleanDraggable();else if(ei==="option")si.setupDraggable({[ni]:ri});else{let ai=si.el.gridstackNode.grid;si.setupDraggable(Object.assign(Object.assign({},ai.opts.draggable),{start:ei.start,stop:ei.stop,drag:ei.drag}))}}),this}dragIn(ti,ei){return this._getDDElements(ti).forEach(ni=>ni.setupDraggable(ei)),this}droppable(ti,ei,ni,ri){return typeof ei.accept=="function"&&!ei._accept&&(ei._accept=ei.accept,ei.accept=si=>ei._accept(si)),this._getDDElements(ti).forEach(si=>{ei==="disable"||ei==="enable"?si.ddDroppable&&si.ddDroppable[ei]():ei==="destroy"?si.ddDroppable&&si.cleanDroppable():ei==="option"?si.setupDroppable({[ni]:ri}):si.setupDroppable(ei)}),this}isDroppable(ti){return!!(ti&&ti.ddElement&&ti.ddElement.ddDroppable&&!ti.ddElement.ddDroppable.disabled)}isDraggable(ti){return!!(ti&&ti.ddElement&&ti.ddElement.ddDraggable&&!ti.ddElement.ddDraggable.disabled)}isResizable(ti){return!!(ti&&ti.ddElement&&ti.ddElement.ddResizable&&!ti.ddElement.ddResizable.disabled)}on(ti,ei,ni){return this._getDDElements(ti).forEach(ri=>ri.on(ei,si=>{ni(si,Ol.DDManager.dragElement?Ol.DDManager.dragElement.el:si.target,Ol.DDManager.dragElement?Ol.DDManager.dragElement.helper:null)})),this}off(ti,ei){return this._getDDElements(ti).forEach(ni=>ni.off(ei)),this}_getDDElements(ti,ei=!0){let ni=my.Utils.getElements(ti);if(!ni.length)return[];let ri=ni.map(si=>si.ddElement||(ei?gy.DDElement.init(si):null));return ei||ri.filter(si=>si),ri}};Ml.DDGridStack=eh});var th=Un(Gr=>{"use strict";var vy=Gr&&Gr.__createBinding||(Object.create?function(ii,ti,ei,ni){ni===void 0&&(ni=ei),Object.defineProperty(ii,ni,{enumerable:!0,get:function(){return ti[ei]}})}:function(ii,ti,ei,ni){ni===void 0&&(ni=ei),ii[ni]=ti[ei]}),Ll=Gr&&Gr.__exportStar||function(ii,ti){for(var ei in ii)ei!=="default"&&!ti.hasOwnProperty(ei)&&vy(ti,ii,ei)};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.GridStack=void 0;var Jc=Wc(),qi=zs(),Rr=Yc(),_y=Xc(),yy=Sa(),Nl=fo(),yr=new _y.DDGridStack;Ll(Yc(),Gr);Ll(zs(),Gr);Ll(Wc(),Gr);Ll(Xc(),Gr);var zn=class{constructor(ti,ei={}){var ni,ri;this._gsEventHandler={},this._extraDragRow=0,this.el=ti,ei=ei||{},ti.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),ei.row&&(ei.minRow=ei.maxRow=ei.row,delete ei.row);let si=qi.Utils.toNumber(ti.getAttribute("gs-row"));ei.column==="auto"&&delete ei.column;let ai=ei;ai.minWidth!==void 0&&(ei.oneColumnSize=ei.oneColumnSize||ai.minWidth,delete ai.minWidth),ei.alwaysShowResizeHandle!==void 0&&(ei._alwaysShowResizeHandle=ei.alwaysShowResizeHandle);let ci=Object.assign(Object.assign({},qi.Utils.cloneDeep(Rr.gridDefaults)),{column:qi.Utils.toNumber(ti.getAttribute("gs-column"))||Rr.gridDefaults.column,minRow:si||qi.Utils.toNumber(ti.getAttribute("gs-min-row"))||Rr.gridDefaults.minRow,maxRow:si||qi.Utils.toNumber(ti.getAttribute("gs-max-row"))||Rr.gridDefaults.maxRow,staticGrid:qi.Utils.toBool(ti.getAttribute("gs-static"))||Rr.gridDefaults.staticGrid,draggable:{handle:(ei.handleClass?"."+ei.handleClass:ei.handle?ei.handle:"")||Rr.gridDefaults.draggable.handle},removableOptions:{accept:ei.itemClass?"."+ei.itemClass:Rr.gridDefaults.removableOptions.accept}});ti.getAttribute("gs-animate")&&(ci.animate=qi.Utils.toBool(ti.getAttribute("gs-animate"))),this.opts=qi.Utils.defaults(ei,ci),ei=null,this._initMargin(),this.opts.column!==1&&!this.opts.disableOneColumnMode&&this._widthOrContainer()<=this.opts.oneColumnSize&&(this._prevColumn=this.getColumn(),this.opts.column=1),this.opts.rtl==="auto"&&(this.opts.rtl=ti.style.direction==="rtl"),this.opts.rtl&&this.el.classList.add("grid-stack-rtl");let fi=(ni=qi.Utils.closestUpByClass(this.el,Rr.gridDefaults.itemClass))===null||ni===void 0?void 0:ni.gridstackNode;fi&&(fi.subGrid=this,this.parentGridItem=fi,this.el.classList.add("grid-stack-nested"),fi.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=this.opts.cellHeight==="auto",this._isAutoCellHeight||this.opts.cellHeight==="initial"?this.cellHeight(void 0,!1):(typeof this.opts.cellHeight=="number"&&this.opts.cellHeightUnit&&this.opts.cellHeightUnit!==Rr.gridDefaults.cellHeightUnit&&(this.opts.cellHeight=this.opts.cellHeight+this.opts.cellHeightUnit,delete this.opts.cellHeightUnit),this.cellHeight(this.opts.cellHeight,!1)),this.opts.alwaysShowResizeHandle==="mobile"&&(this.opts.alwaysShowResizeHandle=yy.isTouch),this._styleSheetClass="grid-stack-instance-"+Jc.GridStackEngine._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let vi=this.opts.engineClass||zn.engineClass||Jc.GridStackEngine;if(this.engine=new vi({column:this.getColumn(),float:this.opts.float,maxRow:this.opts.maxRow,onChange:hi=>{let bi=0;this.engine.nodes.forEach(wi=>{bi=Math.max(bi,wi.y+wi.h)}),hi.forEach(wi=>{let Ti=wi.el;!Ti||(wi._removeDOM?(Ti&&Ti.remove(),delete wi._removeDOM):this._writePosAttr(Ti,wi))}),this._updateStyles(!1,bi)}}),this.opts.auto){this.batchUpdate();let hi=[],bi=this.getColumn();bi===1&&this._prevColumn&&(bi=this._prevColumn),this.getGridItems().forEach(wi=>{let Ti=parseInt(wi.getAttribute("gs-x")),ki=parseInt(wi.getAttribute("gs-y"));hi.push({el:wi,i:(Number.isNaN(Ti)?1e3:Ti)+(Number.isNaN(ki)?1e3:ki)*bi})}),hi.sort((wi,Ti)=>Ti.i-wi.i).forEach(wi=>this._prepareElement(wi.el)),this.batchUpdate(!1)}if(this.opts.children){let hi=this.opts.children;delete this.opts.children,hi.length&&this.load(hi)}this.setAnimation(this.opts.animate),this._updateStyles(),this.opts.column!=12&&this.el.classList.add("grid-stack-"+this.opts.column),this.opts.dragIn&&zn.setupDragIn(this.opts.dragIn,this.opts.dragInOptions),delete this.opts.dragIn,delete this.opts.dragInOptions,this.opts.subGridDynamic&&!Nl.DDManager.pauseDrag&&(Nl.DDManager.pauseDrag=!0),((ri=this.opts.draggable)===null||ri===void 0?void 0:ri.pause)!==void 0&&(Nl.DDManager.pauseDrag=this.opts.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateWindowResizeEvent()}static init(ti={},ei=".grid-stack"){let ni=zn.getGridElement(ei);return ni?(ni.gridstack||(ni.gridstack=new zn(ni,qi.Utils.cloneDeep(ti))),ni.gridstack):(console.error(typeof ei=="string"?'GridStack.initAll() no grid was found with selector "'+ei+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(ti={},ei=".grid-stack"){let ni=[];return zn.getGridElements(ei).forEach(ri=>{ri.gridstack||(ri.gridstack=new zn(ri,qi.Utils.cloneDeep(ti)),delete ti.dragIn,delete ti.dragInOptions),ni.push(ri.gridstack)}),ni.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+ei+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`),ni}static addGrid(ti,ei={}){if(!ti)return null;let ni=ti;if(!ti.classList.contains("grid-stack")){let si=document.implementation.createHTMLDocument("");si.body.innerHTML=`<div class="grid-stack ${ei.class||""}"></div>`,ni=si.body.children[0],ti.appendChild(ni)}return zn.init(ei,ni)}static registerEngine(ti){zn.engineClass=ti}get placeholder(){if(!this._placeholder){let ti=document.createElement("div");ti.className="placeholder-content",this.opts.placeholderText&&(ti.innerHTML=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,Rr.gridDefaults.itemClass,this.opts.itemClass),this.placeholder.appendChild(ti)}return this._placeholder}addWidget(ti,ei){function ni(ci){return ci.el!==void 0||ci.x!==void 0||ci.y!==void 0||ci.w!==void 0||ci.h!==void 0||ci.content!==void 0}let ri,si;if(typeof ti=="string"){let ci=document.implementation.createHTMLDocument("");ci.body.innerHTML=ti,ri=ci.body.children[0]}else if(arguments.length===0||arguments.length===1&&ni(ti))if(si=ei=ti,si==null?void 0:si.el)ri=si.el;else if(this.opts.addRemoveCB)ri=this.opts.addRemoveCB(this,ei,!0);else{let ci=(ei==null?void 0:ei.content)||"",fi=document.implementation.createHTMLDocument("");fi.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${ci}</div></div>`,ri=fi.body.children[0]}else ri=ti;if(!ri)return;let ai=this._readAttr(ri);return ei=qi.Utils.cloneDeep(ei)||{},qi.Utils.defaults(ei,ai),si=this.engine.prepareNode(ei),this._writeAttr(ri,ei),this._insertNotAppend?this.el.prepend(ri):this.el.appendChild(ri),this._prepareElement(ri,!0,ei),this._updateContainerHeight(),si.subGrid&&this.makeSubGrid(si.el,void 0,void 0,!1),this._prevColumn&&this.opts.column===1&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,ri}makeSubGrid(ti,ei,ni,ri=!0){var si,ai,ci;let fi=ti.gridstackNode;if(fi||(fi=this.makeWidget(ti).gridstackNode),(si=fi.subGrid)===null||si===void 0?void 0:si.el)return fi.subGrid;let vi,hi=this;for(;hi&&!vi;)vi=(ai=hi.opts)===null||ai===void 0?void 0:ai.subGrid,hi=(ci=hi.parentGridItem)===null||ci===void 0?void 0:ci.grid;ei=qi.Utils.cloneDeep(Object.assign(Object.assign(Object.assign({},vi||{}),{children:void 0}),ei||fi.subGrid)),fi.subGrid=ei;let bi;ei.column==="auto"&&(bi=!0,ei.column=Math.max(fi.w||1,(ni==null?void 0:ni.w)||1),ei.disableOneColumnMode=!0);let wi=fi.el.querySelector(".grid-stack-item-content"),Ti,ki;if(ri){this._removeDD(fi.el);let Bi=document.implementation.createHTMLDocument("");Bi.body.innerHTML='<div class="grid-stack-item"></div>',Ti=Bi.body.children[0],Ti.appendChild(wi),ki=Object.assign(Object.assign({},fi),{x:0,y:0}),qi.Utils.removeInternalForSave(ki),delete ki.subGrid,fi.content&&(ki.content=fi.content,delete fi.content),Bi.body.innerHTML='<div class="grid-stack-item-content"></div>',wi=Bi.body.children[0],fi.el.appendChild(wi),this._prepareDragDropByNode(fi)}if(ni){let Bi=bi?ei.column:fi.w,rn=fi.h+ni.h,nn=fi.el.style;nn.transition="none",this.update(fi.el,{w:Bi,h:rn}),setTimeout(()=>nn.transition=null)}let Ci=fi.subGrid=zn.addGrid(wi,ei);return(ni==null?void 0:ni._moving)&&(Ci._isTemp=!0),bi&&(Ci._autoColumn=!0),ri&&Ci.addWidget(Ti,ki),ni&&(ni._moving?window.setTimeout(()=>qi.Utils.simulateMouseEvent(ni._event,"mouseenter",Ci.el),0):Ci.addWidget(fi.el,fi)),Ci}removeAsSubGrid(ti){var ei;let ni=(ei=this.parentGridItem)===null||ei===void 0?void 0:ei.grid;!ni||(ni.batchUpdate(),ni.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach(ri=>{ri.x+=this.parentGridItem.x,ri.y+=this.parentGridItem.y,ni.addWidget(ri.el,ri)}),ni.batchUpdate(!1),delete this.parentGridItem,ti&&window.setTimeout(()=>qi.Utils.simulateMouseEvent(ti._event,"mouseenter",ni.el),0))}save(ti=!0,ei=!1){let ni=this.engine.save(ti);if(ni.forEach(ri=>{var si;if(ti&&ri.el&&!ri.subGrid){let ai=ri.el.querySelector(".grid-stack-item-content");ri.content=ai?ai.innerHTML:void 0,ri.content||delete ri.content}else if(ti||delete ri.content,(si=ri.subGrid)===null||si===void 0?void 0:si.el){let ai=ri.subGrid.save(ti,ei);ri.subGrid=ei?ai:{children:ai}}delete ri.el}),ei){let ri=qi.Utils.cloneDeep(this.opts);ri.marginBottom===ri.marginTop&&ri.marginRight===ri.marginLeft&&ri.marginTop===ri.marginRight&&(ri.margin=ri.marginTop,delete ri.marginTop,delete ri.marginRight,delete ri.marginBottom,delete ri.marginLeft),ri.rtl===(this.el.style.direction==="rtl")&&(ri.rtl="auto"),this._isAutoCellHeight&&(ri.cellHeight="auto"),this._autoColumn&&(ri.column="auto",delete ri.disableOneColumnMode);let si=ri._alwaysShowResizeHandle;return delete ri._alwaysShowResizeHandle,si!==void 0?ri.alwaysShowResizeHandle=si:delete ri.alwaysShowResizeHandle,qi.Utils.removeInternalAndSame(ri,Rr.gridDefaults),ri.children=ni,ri}return ni}load(ti,ei=this.opts.addRemoveCB||!0){let ni=zn.Utils.sort([...ti],-1,this._prevColumn||this.getColumn());this._insertNotAppend=!0,this._prevColumn&&this._prevColumn!==this.opts.column&&ni.some(ai=>ai.x+ai.w>this.opts.column)&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(ni,this._prevColumn,!0));let ri=this.opts.addRemoveCB;typeof ei=="function"&&(this.opts.addRemoveCB=ei);let si=[];return this.batchUpdate(),ei&&[...this.engine.nodes].forEach(ci=>{ni.find(vi=>ci.id===vi.id)||(this.opts.addRemoveCB&&this.opts.addRemoveCB(this,ci,!1),si.push(ci),this.removeWidget(ci.el,!0,!1))}),ni.forEach(ai=>{let ci=ai.id||ai.id===0?this.engine.nodes.find(fi=>fi.id===ai.id):void 0;if(ci){if(this.update(ci.el,ai),ai.subGrid&&ai.subGrid.children){let fi=ci.el.querySelector(".grid-stack");fi&&fi.gridstack&&(fi.gridstack.load(ai.subGrid.children),this._insertNotAppend=!0)}}else ei&&this.addWidget(ai)}),this.engine.removedNodes=si,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,ri?this.opts.addRemoveCB=ri:delete this.opts.addRemoveCB,this}batchUpdate(ti=!0){return this.engine.batchUpdate(ti),ti||(this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(ti=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!ti||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;let ei=this.el.querySelector("."+this.opts.itemClass);if(ei){let ri=qi.Utils.toNumber(ei.getAttribute("gs-h"));return Math.round(ei.offsetHeight/ri)}let ni=parseInt(this.el.getAttribute("gs-current-row"));return ni?Math.round(this.el.getBoundingClientRect().height/ni):this.opts.cellHeight}cellHeight(ti,ei=!0){if(ei&&ti!==void 0&&this._isAutoCellHeight!==(ti==="auto")&&(this._isAutoCellHeight=ti==="auto",this._updateWindowResizeEvent()),(ti==="initial"||ti==="auto")&&(ti=void 0),ti===void 0){let ri=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;ti=this.cellWidth()+ri}let ni=qi.Utils.parseHeight(ti);return this.opts.cellHeightUnit===ni.unit&&this.opts.cellHeight===ni.h?this:(this.opts.cellHeightUnit=ni.unit,this.opts.cellHeight=ni.h,ei&&this._updateStyles(!0),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(){return this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}compact(){return this.engine.compact(),this._triggerChangeEvent(),this}column(ti,ei="moveScale"){if(ti<1||this.opts.column===ti)return this;let ni=this.getColumn();ti===1?this._prevColumn=ni:delete this._prevColumn,this.el.classList.remove("grid-stack-"+ni),this.el.classList.add("grid-stack-"+ti),this.opts.column=this.engine.column=ti;let ri;return ti===1&&this.opts.oneColumnModeDomSort&&(ri=[],this.getGridItems().forEach(si=>{si.gridstackNode&&ri.push(si.gridstackNode)}),ri.length||(ri=void 0)),this.engine.updateNodeWidths(ni,ti,ri,ei),this._isAutoCellHeight&&this.cellHeight(),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(ti=>ti.matches("."+this.opts.itemClass)&&!ti.matches("."+this.opts.placeholderClass))}destroy(ti=!0){if(!!this.el)return this._updateWindowResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),ti?this.el.parentNode.removeChild(this.el):(this.removeAll(ti),this.el.classList.remove(this._styleSheetClass)),this._removeStylesheet(),this.el.removeAttribute("gs-current-row"),delete this.parentGridItem,delete this.opts,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(ti){return this.opts.float!==ti&&(this.opts.float=this.engine.float=ti,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(ti,ei=!1){let ni=this.el.getBoundingClientRect(),ri;ei?ri={top:ni.top+document.documentElement.scrollTop,left:ni.left}:ri={top:this.el.offsetTop,left:this.el.offsetLeft};let si=ti.left-ri.left,ai=ti.top-ri.top,ci=ni.width/this.getColumn(),fi=ni.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(si/ci),y:Math.floor(ai/fi)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(ti,ei,ni,ri){return this.engine.isAreaEmpty(ti,ei,ni,ri)}makeWidget(ti){let ei=zn.getElement(ti);return this._prepareElement(ei,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),ei}on(ti,ei){return ti.indexOf(" ")!==-1?(ti.split(" ").forEach(ri=>this.on(ri,ei)),this):(ti==="change"||ti==="added"||ti==="removed"||ti==="enable"||ti==="disable"?(ti==="enable"||ti==="disable"?this._gsEventHandler[ti]=ri=>ei(ri):this._gsEventHandler[ti]=ri=>ei(ri,ri.detail),this.el.addEventListener(ti,this._gsEventHandler[ti])):ti==="drag"||ti==="dragstart"||ti==="dragstop"||ti==="resizestart"||ti==="resize"||ti==="resizestop"||ti==="dropped"?this._gsEventHandler[ti]=ei:console.log("GridStack.on("+ti+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.'),this)}off(ti){return ti.indexOf(" ")!==-1?(ti.split(" ").forEach(ni=>this.off(ni)),this):((ti==="change"||ti==="added"||ti==="removed"||ti==="enable"||ti==="disable")&&this._gsEventHandler[ti]&&this.el.removeEventListener(ti,this._gsEventHandler[ti]),delete this._gsEventHandler[ti],this)}removeWidget(ti,ei=!0,ni=!0){return zn.getElements(ti).forEach(ri=>{if(ri.parentElement&&ri.parentElement!==this.el)return;let si=ri.gridstackNode;si||(si=this.engine.nodes.find(ai=>ri===ai.el)),!!si&&(delete ri.gridstackNode,this._removeDD(ri),this.engine.removeNode(si,ei,ni),ei&&ri.parentElement&&ri.remove())}),ni&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(ti=!0){return this.engine.nodes.forEach(ei=>{delete ei.el.gridstackNode,this._removeDD(ei.el)}),this.engine.removeAll(ti),this._triggerRemoveEvent(),this}setAnimation(ti){return ti?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}setStatic(ti,ei=!0,ni=!0){return this.opts.staticGrid===ti?this:(this.opts.staticGrid=ti,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(ri=>{this._prepareDragDropByNode(ri),ri.subGrid&&ni&&ri.subGrid.setStatic(ti,ei,ni)}),ei&&this._setStaticClass(),this)}update(ti,ei){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let ni=arguments,ri=1;return ei={x:ni[ri++],y:ni[ri++],w:ni[ri++],h:ni[ri++]},this.update(ti,ei)}return zn.getElements(ti).forEach(ni=>{if(!ni||!ni.gridstackNode)return;let ri=ni.gridstackNode,si=qi.Utils.cloneDeep(ei);delete si.autoPosition;let ai=["x","y","w","h"],ci;if(ai.some(hi=>si[hi]!==void 0&&si[hi]!==ri[hi])&&(ci={},ai.forEach(hi=>{ci[hi]=si[hi]!==void 0?si[hi]:ri[hi],delete si[hi]})),!ci&&(si.minW||si.minH||si.maxW||si.maxH)&&(ci={}),si.content){let hi=ni.querySelector(".grid-stack-item-content");hi&&hi.innerHTML!==si.content&&(hi.innerHTML=si.content),delete si.content}let fi=!1,vi=!1;for(let hi in si)hi[0]!=="_"&&ri[hi]!==si[hi]&&(ri[hi]=si[hi],fi=!0,vi=vi||!this.opts.staticGrid&&(hi==="noResize"||hi==="noMove"||hi==="locked"));ci&&(this.engine.cleanNodes().beginUpdate(ri).moveNode(ri,ci),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()),fi&&this._writeAttr(ni,ri),vi&&this._prepareDragDropByNode(ri)}),this}margin(ti){if(!(typeof ti=="string"&&ti.split(" ").length>1)){let ni=qi.Utils.parseHeight(ti);if(this.opts.marginUnit===ni.unit&&this.opts.margin===ni.h)return}return this.opts.margin=ti,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(ti){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let ei=arguments,ni=0,ri={x:ei[ni++],y:ei[ni++],w:ei[ni++],h:ei[ni++],autoPosition:ei[ni++]};return this.willItFit(ri)}return this.engine.willItFit(ti)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let ti=this.engine.getDirtyNodes(!0);return ti&&ti.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(ti),this._triggerEvent("change",ti)),this.engine.saveInitial(),this}_triggerAddEvent(){return this.engine.batchMode?this:(this.engine.addedNodes&&this.engine.addedNodes.length>0&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(ti=>{delete ti._dirty}),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this)}_triggerRemoveEvent(){return this.engine.batchMode?this:(this.engine.removedNodes&&this.engine.removedNodes.length>0&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this)}_triggerEvent(ti,ei){let ni=ei?new CustomEvent(ti,{bubbles:!1,detail:ei}):new Event(ti);return this.el.dispatchEvent(ni),this}_removeStylesheet(){return this._styles&&(qi.Utils.removeStylesheet(this._styleSheetClass),delete this._styles),this}_updateStyles(ti=!1,ei){if(ti&&this._removeStylesheet(),ei||(ei=this.getRow()),this._updateContainerHeight(),this.opts.cellHeight===0)return this;let ni=this.opts.cellHeight,ri=this.opts.cellHeightUnit,si=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let ai=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=qi.Utils.createStylesheet(this._styleSheetClass,ai),!this._styles)return this;this._styles._max=0,qi.Utils.addCSSRule(this._styles,si,`min-height: ${ni}${ri}`);let ci=this.opts.marginTop+this.opts.marginUnit,fi=this.opts.marginBottom+this.opts.marginUnit,vi=this.opts.marginRight+this.opts.marginUnit,hi=this.opts.marginLeft+this.opts.marginUnit,bi=`${si} > .grid-stack-item-content`,wi=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;qi.Utils.addCSSRule(this._styles,bi,`top: ${ci}; right: ${vi}; bottom: ${fi}; left: ${hi};`),qi.Utils.addCSSRule(this._styles,wi,`top: ${ci}; right: ${vi}; bottom: ${fi}; left: ${hi};`),qi.Utils.addCSSRule(this._styles,`${si} > .ui-resizable-ne`,`right: ${vi}`),qi.Utils.addCSSRule(this._styles,`${si} > .ui-resizable-e`,`right: ${vi}`),qi.Utils.addCSSRule(this._styles,`${si} > .ui-resizable-se`,`right: ${vi}; bottom: ${fi}`),qi.Utils.addCSSRule(this._styles,`${si} > .ui-resizable-nw`,`left: ${hi}`),qi.Utils.addCSSRule(this._styles,`${si} > .ui-resizable-w`,`left: ${hi}`),qi.Utils.addCSSRule(this._styles,`${si} > .ui-resizable-sw`,`left: ${hi}; bottom: ${fi}`)}if(ei=ei||this._styles._max,ei>this._styles._max){let ai=ci=>ni*ci+ri;for(let ci=this._styles._max+1;ci<=ei;ci++){let fi=ai(ci);qi.Utils.addCSSRule(this._styles,`${si}[gs-y="${ci-1}"]`,`top: ${ai(ci-1)}`),qi.Utils.addCSSRule(this._styles,`${si}[gs-h="${ci}"]`,`height: ${fi}`),qi.Utils.addCSSRule(this._styles,`${si}[gs-min-h="${ci}"]`,`min-height: ${fi}`),qi.Utils.addCSSRule(this._styles,`${si}[gs-max-h="${ci}"]`,`max-height: ${fi}`)}this._styles._max=ei}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let ti=this.getRow()+this._extraDragRow;if(this.el.setAttribute("gs-current-row",String(ti)),ti===0)return this.el.style.removeProperty("min-height"),this;let ei=this.opts.cellHeight,ni=this.opts.cellHeightUnit;return ei?(this.el.style.minHeight=ti*ei+ni,this):this}_prepareElement(ti,ei=!1,ni){ti.classList.add(this.opts.itemClass),ni=ni||this._readAttr(ti),ti.gridstackNode=ni,ni.el=ti,ni.grid=this;let ri=Object.assign({},ni);return ni=this.engine.addNode(ni,ei),qi.Utils.same(ni,ri)||this._writeAttr(ti,ni),this._prepareDragDropByNode(ni),this}_writePosAttr(ti,ei){return ei.x!==void 0&&ei.x!==null&&ti.setAttribute("gs-x",String(ei.x)),ei.y!==void 0&&ei.y!==null&&ti.setAttribute("gs-y",String(ei.y)),ei.w&&ti.setAttribute("gs-w",String(ei.w)),ei.h&&ti.setAttribute("gs-h",String(ei.h)),this}_writeAttr(ti,ei){if(!ei)return this;this._writePosAttr(ti,ei);let ni={autoPosition:"gs-auto-position",minW:"gs-min-w",minH:"gs-min-h",maxW:"gs-max-w",maxH:"gs-max-h",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id"};for(let ri in ni)ei[ri]?ti.setAttribute(ni[ri],String(ei[ri])):ti.removeAttribute(ni[ri]);return this}_readAttr(ti){let ei={};ei.x=qi.Utils.toNumber(ti.getAttribute("gs-x")),ei.y=qi.Utils.toNumber(ti.getAttribute("gs-y")),ei.w=qi.Utils.toNumber(ti.getAttribute("gs-w")),ei.h=qi.Utils.toNumber(ti.getAttribute("gs-h")),ei.maxW=qi.Utils.toNumber(ti.getAttribute("gs-max-w")),ei.minW=qi.Utils.toNumber(ti.getAttribute("gs-min-w")),ei.maxH=qi.Utils.toNumber(ti.getAttribute("gs-max-h")),ei.minH=qi.Utils.toNumber(ti.getAttribute("gs-min-h")),ei.autoPosition=qi.Utils.toBool(ti.getAttribute("gs-auto-position")),ei.noResize=qi.Utils.toBool(ti.getAttribute("gs-no-resize")),ei.noMove=qi.Utils.toBool(ti.getAttribute("gs-no-move")),ei.locked=qi.Utils.toBool(ti.getAttribute("gs-locked")),ei.id=ti.getAttribute("gs-id");for(let ni in ei){if(!ei.hasOwnProperty(ni))return;!ei[ni]&&ei[ni]!==0&&delete ei[ni]}return ei}_setStaticClass(){let ti=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...ti),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...ti),this.el.removeAttribute("gs-static")),this}onParentResize(){if(!this.el||!this.el.clientWidth)return;let ti=!1;if(this._autoColumn&&this.parentGridItem)this.opts.column!==this.parentGridItem.w&&(ti=!0,this.column(this.parentGridItem.w,"none"));else{let ei=!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.oneColumnSize;this.opts.column===1!==ei&&(ti=!0,this.opts.animate&&this.setAnimation(!1),this.column(ei?1:this._prevColumn),this.opts.animate&&this.setAnimation(!0))}return this._isAutoCellHeight&&(!ti&&this.opts.cellHeightThrottle?(this._cellHeightThrottle||(this._cellHeightThrottle=qi.Utils.throttle(()=>this.cellHeight(),this.opts.cellHeightThrottle)),this._cellHeightThrottle()):this.cellHeight()),this.engine.nodes.forEach(ei=>{ei.subGrid&&ei.subGrid.onParentResize()}),this}_updateWindowResizeEvent(ti=!1){let ei=(this._isAutoCellHeight||!this.opts.disableOneColumnMode)&&!this.parentGridItem;return!ti&&ei&&!this._windowResizeBind?(this._windowResizeBind=this.onParentResize.bind(this),window.addEventListener("resize",this._windowResizeBind)):(ti||!ei)&&this._windowResizeBind&&(window.removeEventListener("resize",this._windowResizeBind),delete this._windowResizeBind),this}static getElement(ti=".grid-stack-item"){return qi.Utils.getElement(ti)}static getElements(ti=".grid-stack-item"){return qi.Utils.getElements(ti)}static getGridElement(ti){return zn.getElement(ti)}static getGridElements(ti){return qi.Utils.getElements(ti)}_initMargin(){let ti,ei=0,ni=[];return typeof this.opts.margin=="string"&&(ni=this.opts.margin.split(" ")),ni.length===2?(this.opts.marginTop=this.opts.marginBottom=ni[0],this.opts.marginLeft=this.opts.marginRight=ni[1]):ni.length===4?(this.opts.marginTop=ni[0],this.opts.marginRight=ni[1],this.opts.marginBottom=ni[2],this.opts.marginLeft=ni[3]):(ti=qi.Utils.parseHeight(this.opts.margin),this.opts.marginUnit=ti.unit,ei=this.opts.margin=ti.h),this.opts.marginTop===void 0?this.opts.marginTop=ei:(ti=qi.Utils.parseHeight(this.opts.marginTop),this.opts.marginTop=ti.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=ei:(ti=qi.Utils.parseHeight(this.opts.marginBottom),this.opts.marginBottom=ti.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=ei:(ti=qi.Utils.parseHeight(this.opts.marginRight),this.opts.marginRight=ti.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=ei:(ti=qi.Utils.parseHeight(this.opts.marginLeft),this.opts.marginLeft=ti.h,delete this.opts.margin),this.opts.marginUnit=ti.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static getDD(){return yr}static setupDragIn(ti,ei){(ei==null?void 0:ei.pause)!==void 0&&(Nl.DDManager.pauseDrag=ei.pause),typeof ti=="string"&&(ei=Object.assign(Object.assign({},Rr.dragInDefaultOptions),ei||{}),qi.Utils.getElements(ti).forEach(ni=>{yr.isDraggable(ni)||yr.dragIn(ni,ei)}))}movable(ti,ei){return this.opts.staticGrid?this:(zn.getElements(ti).forEach(ni=>{let ri=ni.gridstackNode;!ri||(ei?delete ri.noMove:ri.noMove=!0,this._prepareDragDropByNode(ri))}),this)}resizable(ti,ei){return this.opts.staticGrid?this:(zn.getElements(ti).forEach(ni=>{let ri=ni.gridstackNode;!ri||(ei?delete ri.noResize:ri.noResize=!0,this._prepareDragDropByNode(ri))}),this)}disable(ti=!0){if(!this.opts.staticGrid)return this.enableMove(!1,ti),this.enableResize(!1,ti),this._triggerEvent("disable"),this}enable(ti=!0){if(!this.opts.staticGrid)return this.enableMove(!0,ti),this.enableResize(!0,ti),this._triggerEvent("enable"),this}enableMove(ti,ei=!0){return this.opts.staticGrid?this:(this.opts.disableDrag=!ti,this.engine.nodes.forEach(ni=>{this.movable(ni.el,ti),ni.subGrid&&ei&&ni.subGrid.enableMove(ti,ei)}),this)}enableResize(ti,ei=!0){return this.opts.staticGrid?this:(this.opts.disableResize=!ti,this.engine.nodes.forEach(ni=>{this.resizable(ni.el,ti),ni.subGrid&&ei&&ni.subGrid.enableResize(ti,ei)}),this)}_removeDD(ti){return yr.draggable(ti,"destroy").resizable(ti,"destroy"),ti.gridstackNode&&delete ti.gridstackNode._initDD,delete ti.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return yr.droppable(this.el,"destroy"),this;let ti,ei,ni=(ri,si,ai)=>{let ci=si.gridstackNode;if(!ci)return;ai=ai||si;let fi=this.el.getBoundingClientRect(),{top:vi,left:hi}=ai.getBoundingClientRect();hi-=fi.left,vi-=fi.top;let bi={position:{top:vi,left:hi}};if(ci._temporaryRemoved){if(ci.x=Math.max(0,Math.round(hi/ei)),ci.y=Math.max(0,Math.round(vi/ti)),delete ci.autoPosition,this.engine.nodeBoundFix(ci),!this.engine.willItFit(ci)){if(ci.autoPosition=!0,!this.engine.willItFit(ci)){yr.off(si,"drag");return}ci._willFitPos&&(qi.Utils.copyPos(ci,ci._willFitPos),delete ci._willFitPos)}this._onStartMoving(ai,ri,bi,ci,ei,ti)}else this._dragOrResize(ai,ri,bi,ci,ei,ti)};return yr.droppable(this.el,{accept:ri=>{let si=ri.gridstackNode;if((si==null?void 0:si.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let ai=!0;if(typeof this.opts.acceptWidgets=="function")ai=this.opts.acceptWidgets(ri);else{let ci=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;ai=ri.matches(ci)}if(ai&&si&&this.opts.maxRow){let ci={w:si.w,h:si.h,minW:si.minW,minH:si.minH};ai=this.engine.willItFit(ci)}return ai}}).on(this.el,"dropover",(ri,si,ai)=>{let ci=si.gridstackNode;if((ci==null?void 0:ci.grid)===this&&!ci._temporaryRemoved)return!1;(ci==null?void 0:ci.grid)&&ci.grid!==this&&!ci._temporaryRemoved&&ci.grid._leave(si,ai),ei=this.cellWidth(),ti=this.getCellHeight(!0),ci||(ci=this._readAttr(si)),ci.grid||(ci._isExternal=!0,si.gridstackNode=ci),ai=ai||si;let fi=ci.w||Math.round(ai.offsetWidth/ei)||1,vi=ci.h||Math.round(ai.offsetHeight/ti)||1;return ci.grid&&ci.grid!==this?(si._gridstackNodeOrig||(si._gridstackNodeOrig=ci),si.gridstackNode=ci=Object.assign(Object.assign({},ci),{w:fi,h:vi,grid:this}),this.engine.cleanupNode(ci).nodeBoundFix(ci),ci._initDD=ci._isExternal=ci._temporaryRemoved=!0):(ci.w=fi,ci.h=vi,ci._temporaryRemoved=!0),this._itemRemoving(ci.el,!1),yr.on(si,"drag",ni),ni(ri,si,ai),!1}).on(this.el,"dropout",(ri,si,ai)=>{let ci=si.gridstackNode;return ci&&(!ci.grid||ci.grid===this)&&(this._leave(si,ai),this._isTemp&&this.removeAsSubGrid(ci)),!1}).on(this.el,"drop",(ri,si,ai)=>{var ci,fi;let vi=si.gridstackNode;if((vi==null?void 0:vi.grid)===this&&!vi._isExternal)return!1;let hi=!!this.placeholder.parentElement;this.placeholder.remove();let bi=si._gridstackNodeOrig;if(delete si._gridstackNodeOrig,hi&&(bi==null?void 0:bi.grid)&&bi.grid!==this){let Ti=bi.grid;Ti.engine.removedNodes.push(bi),Ti._triggerRemoveEvent()._triggerChangeEvent(),Ti.parentGridItem&&!Ti.engine.nodes.length&&Ti.opts.subGridDynamic&&Ti.removeAsSubGrid()}if(!vi||(hi&&(this.engine.cleanupNode(vi),vi.grid=this),yr.off(si,"drag"),ai!==si?(ai.remove(),si.gridstackNode=bi,hi&&(si=si.cloneNode(!0))):(si.remove(),this._removeDD(si)),!hi))return!1;si.gridstackNode=vi,vi.el=si;let wi=(fi=(ci=vi.subGrid)===null||ci===void 0?void 0:ci.el)===null||fi===void 0?void 0:fi.gridstack;return qi.Utils.copyPos(vi,this._readAttr(this.placeholder)),qi.Utils.removePositioningStyles(si),this._writeAttr(si,vi),si.classList.add(Rr.gridDefaults.itemClass,this.opts.itemClass),this.el.appendChild(si),wi&&(wi.parentGridItem=vi,wi.opts.styleInHead||wi._updateStyles(!0)),this._updateContainerHeight(),this.engine.addedNodes.push(vi),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(Object.assign(Object.assign({},ri),{type:"dropped"}),bi&&bi.grid?bi:void 0,vi),window.setTimeout(()=>{vi.el&&vi.el.parentElement?this._prepareDragDropByNode(vi):this.engine.removeNode(vi),delete vi.grid._isTemp}),!1}),this}_itemRemoving(ti,ei){let ni=ti?ti.gridstackNode:void 0;!ni||!ni.grid||(ei?ni._isAboutToRemove=!0:delete ni._isAboutToRemove,ei?ti.classList.add("grid-stack-item-removing"):ti.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(!this.opts.staticGrid&&typeof this.opts.removable=="string"){let ti=document.querySelector(this.opts.removable);if(!ti)return this;yr.isDroppable(ti)||yr.droppable(ti,this.opts.removableOptions).on(ti,"dropover",(ei,ni)=>this._itemRemoving(ni,!0)).on(ti,"dropout",(ei,ni)=>this._itemRemoving(ni,!1))}return this}_prepareDragDropByNode(ti){let ei=ti.el,ni=ti.noMove||this.opts.disableDrag,ri=ti.noResize||this.opts.disableResize;if(this.opts.staticGrid||ni&&ri)return ti._initDD&&(this._removeDD(ei),delete ti._initDD),ei.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!ti._initDD){let si,ai,ci=(hi,bi)=>{this._gsEventHandler[hi.type]&&this._gsEventHandler[hi.type](hi,hi.target),si=this.cellWidth(),ai=this.getCellHeight(!0),this._onStartMoving(ei,hi,bi,ti,si,ai)},fi=(hi,bi)=>{this._dragOrResize(ei,hi,bi,ti,si,ai)},vi=hi=>{this.placeholder.remove(),delete ti._moving,delete ti._event,delete ti._lastTried;let bi=hi.target;if(!(!bi.gridstackNode||bi.gridstackNode.grid!==this)){if(ti.el=bi,ti._isAboutToRemove){let wi=ei.gridstackNode.grid;wi._gsEventHandler[hi.type]&&wi._gsEventHandler[hi.type](hi,bi),this._removeDD(ei),wi.engine.removedNodes.push(ti),wi._triggerRemoveEvent(),delete ei.gridstackNode,delete ti.el,ei.remove()}else qi.Utils.removePositioningStyles(bi),ti._temporaryRemoved?(qi.Utils.copyPos(ti,ti._orig),this._writePosAttr(bi,ti),this.engine.addNode(ti)):this._writePosAttr(bi,ti),this._gsEventHandler[hi.type]&&this._gsEventHandler[hi.type](hi,bi);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()}};yr.draggable(ei,{start:ci,stop:vi,drag:fi}).resizable(ei,{start:ci,stop:vi,resize:fi}),ti._initDD=!0}return yr.draggable(ei,ni?"disable":"enable").resizable(ei,ri?"disable":"enable"),this}_onStartMoving(ti,ei,ni,ri,si,ai){this.engine.cleanNodes().beginUpdate(ri),this._writePosAttr(this.placeholder,ri),this.el.appendChild(this.placeholder),ri.el=this.placeholder,ri._lastUiPosition=ni.position,ri._prevYPix=ni.position.top,ri._moving=ei.type==="dragstart",delete ri._lastTried,ei.type==="dropover"&&ri._temporaryRemoved&&(this.engine.addNode(ri),ri._moving=!0),this.engine.cacheRects(si,ai,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),ei.type==="resizestart"&&(yr.resizable(ti,"option","minWidth",si*(ri.minW||1)).resizable(ti,"option","minHeight",ai*(ri.minH||1)),ri.maxW&&yr.resizable(ti,"option","maxWidth",si*ri.maxW),ri.maxH&&yr.resizable(ti,"option","maxHeight",ai*ri.maxH))}_dragOrResize(ti,ei,ni,ri,si,ai){let ci=Object.assign({},ri._orig),fi,vi=this.opts.marginLeft,hi=this.opts.marginRight,bi=this.opts.marginTop,wi=this.opts.marginBottom,Ti=Math.round(ai*.1),ki=Math.round(si*.1);if(vi=Math.min(vi,ki),hi=Math.min(hi,ki),bi=Math.min(bi,Ti),wi=Math.min(wi,Ti),ei.type==="drag"){if(ri._temporaryRemoved)return;let Bi=ni.position.top-ri._prevYPix;ri._prevYPix=ni.position.top,this.opts.draggable.scroll!==!1&&qi.Utils.updateScrollPosition(ti,ni.position,Bi);let rn=ni.position.left+(ni.position.left>ri._lastUiPosition.left?-hi:vi),nn=ni.position.top+(ni.position.top>ri._lastUiPosition.top?-wi:bi);ci.x=Math.round(rn/si),ci.y=Math.round(nn/ai);let Ji=this._extraDragRow;if(this.engine.collide(ri,ci)){let Wi=this.getRow(),ln=Math.max(0,ci.y+ri.h-Wi);this.opts.maxRow&&Wi+ln>this.opts.maxRow&&(ln=Math.max(0,this.opts.maxRow-Wi)),this._extraDragRow=ln}else this._extraDragRow=0;if(this._extraDragRow!==Ji&&this._updateContainerHeight(),ri.x===ci.x&&ri.y===ci.y)return}else if(ei.type==="resize"){if(ci.x<0||(qi.Utils.updateScrollResize(ei,ti,ai),ci.w=Math.round((ni.size.width-vi)/si),ci.h=Math.round((ni.size.height-bi)/ai),ri.w===ci.w&&ri.h===ci.h)||ri._lastTried&&ri._lastTried.w===ci.w&&ri._lastTried.h===ci.h)return;let Bi=ni.position.left+vi,rn=ni.position.top+bi;ci.x=Math.round(Bi/si),ci.y=Math.round(rn/ai),fi=!0}ri._event=ei,ri._lastTried=ci;let Ci={x:ni.position.left+vi,y:ni.position.top+bi,w:(ni.size?ni.size.width:ri.w*si)-vi-hi,h:(ni.size?ni.size.height:ri.h*ai)-bi-wi};if(this.engine.moveNodeCheck(ri,Object.assign(Object.assign({},ci),{cellWidth:si,cellHeight:ai,rect:Ci,resizing:fi}))){ri._lastUiPosition=ni.position,this.engine.cacheRects(si,ai,bi,hi,wi,vi),delete ri._skipDown,fi&&ri.subGrid&&ri.subGrid.onParentResize(),this._extraDragRow=0,this._updateContainerHeight();let Bi=ei.target;this._writePosAttr(Bi,ri),this._gsEventHandler[ei.type]&&this._gsEventHandler[ei.type](ei,Bi)}}_leave(ti,ei){let ni=ti.gridstackNode;!ni||(yr.off(ti,"drag"),!ni._temporaryRemoved&&(ni._temporaryRemoved=!0,this.engine.removeNode(ni),ni.el=ni._isExternal&&ei?ei:ti,this.opts.removable===!0&&this._itemRemoving(ti,!0),ti._gridstackNodeOrig?(ti.gridstackNode=ti._gridstackNodeOrig,delete ti._gridstackNodeOrig):ni._isExternal&&(delete ni.el,delete ti.gridstackNode,this.engine.restoreInitial())))}commit(){return qi.obsolete(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}};Gr.GridStack=zn;zn.Utils=qi.Utils;zn.Engine=Jc.GridStackEngine;zn.GDRev="7.2.3"});var Fa={};_h(Fa,{afterMain:()=>lu,afterRead:()=>su,afterWrite:()=>du,applyStyles:()=>wo,arrow:()=>La,auto:()=>Zo,basePlacements:()=>ps,beforeMain:()=>ou,beforeRead:()=>nu,beforeWrite:()=>cu,bottom:()=>Gn,clippingParents:()=>zl,computeStyles:()=>So,createPopper:()=>$a,createPopperBase:()=>bu,createPopperLite:()=>Eu,detectOverflow:()=>Or,end:()=>ks,eventListeners:()=>To,flip:()=>Pa,hide:()=>Ra,left:()=>Vn,main:()=>au,modifierPhases:()=>Wl,offset:()=>Ha,placements:()=>ta,popper:()=>Ks,popperGenerator:()=>no,popperOffsets:()=>Ao,preventOverflow:()=>ja,read:()=>ru,reference:()=>ql,right:()=>qn,start:()=>ss,top:()=>Bn,variationPlacements:()=>Ma,viewport:()=>ea,write:()=>uu});var Bn="top",Gn="bottom",qn="right",Vn="left",Zo="auto",ps=[Bn,Gn,qn,Vn],ss="start",ks="end",zl="clippingParents",ea="viewport",Ks="popper",ql="reference",Ma=ps.reduce(function(ii,ti){return ii.concat([ti+"-"+ss,ti+"-"+ks])},[]),ta=[].concat(ps,[Zo]).reduce(function(ii,ti){return ii.concat([ti,ti+"-"+ss,ti+"-"+ks])},[]),nu="beforeRead",ru="read",su="afterRead",ou="beforeMain",au="main",lu="afterMain",cu="beforeWrite",uu="write",du="afterWrite",Wl=[nu,ru,su,ou,au,lu,cu,uu,du];function Qn(ii){return ii?(ii.nodeName||"").toLowerCase():null}function $n(ii){if(ii==null)return window;if(ii.toString()!=="[object Window]"){var ti=ii.ownerDocument;return ti&&ti.defaultView||window}return ii}function jr(ii){var ti=$n(ii).Element;return ii instanceof ti||ii instanceof Element}function Jn(ii){var ti=$n(ii).HTMLElement;return ii instanceof ti||ii instanceof HTMLElement}function Eo(ii){if(typeof ShadowRoot=="undefined")return!1;var ti=$n(ii).ShadowRoot;return ii instanceof ti||ii instanceof ShadowRoot}function bh(ii){var ti=ii.state;Object.keys(ti.elements).forEach(function(ei){var ni=ti.styles[ei]||{},ri=ti.attributes[ei]||{},si=ti.elements[ei];!Jn(si)||!Qn(si)||(Object.assign(si.style,ni),Object.keys(ri).forEach(function(ai){var ci=ri[ai];ci===!1?si.removeAttribute(ai):si.setAttribute(ai,ci===!0?"":ci)}))})}function Eh(ii){var ti=ii.state,ei={popper:{position:ti.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(ti.elements.popper.style,ei.popper),ti.styles=ei,ti.elements.arrow&&Object.assign(ti.elements.arrow.style,ei.arrow),function(){Object.keys(ti.elements).forEach(function(ni){var ri=ti.elements[ni],si=ti.attributes[ni]||{},ai=Object.keys(ti.styles.hasOwnProperty(ni)?ti.styles[ni]:ei[ni]),ci=ai.reduce(function(fi,vi){return fi[vi]="",fi},{});!Jn(ri)||!Qn(ri)||(Object.assign(ri.style,ci),Object.keys(si).forEach(function(fi){ri.removeAttribute(fi)}))})}}var wo={name:"applyStyles",enabled:!0,phase:"write",fn:bh,effect:Eh,requires:["computeStyles"]};function Zn(ii){return ii.split("-")[0]}var Qr=Math.max,Xs=Math.min,ms=Math.round;function xo(){var ii=navigator.userAgentData;return ii!=null&&ii.brands&&Array.isArray(ii.brands)?ii.brands.map(function(ti){return ti.brand+"/"+ti.version}).join(" "):navigator.userAgent}function ia(){return!/^((?!chrome|android).)*safari/i.test(xo())}function $r(ii,ti,ei){ti===void 0&&(ti=!1),ei===void 0&&(ei=!1);var ni=ii.getBoundingClientRect(),ri=1,si=1;ti&&Jn(ii)&&(ri=ii.offsetWidth>0&&ms(ni.width)/ii.offsetWidth||1,si=ii.offsetHeight>0&&ms(ni.height)/ii.offsetHeight||1);var ai=jr(ii)?$n(ii):window,ci=ai.visualViewport,fi=!ia()&&ei,vi=(ni.left+(fi&&ci?ci.offsetLeft:0))/ri,hi=(ni.top+(fi&&ci?ci.offsetTop:0))/si,bi=ni.width/ri,wi=ni.height/si;return{width:bi,height:wi,top:hi,right:vi+bi,bottom:hi+wi,left:vi,x:vi,y:hi}}function Js(ii){var ti=$r(ii),ei=ii.offsetWidth,ni=ii.offsetHeight;return Math.abs(ti.width-ei)<=1&&(ei=ti.width),Math.abs(ti.height-ni)<=1&&(ni=ti.height),{x:ii.offsetLeft,y:ii.offsetTop,width:ei,height:ni}}function na(ii,ti){var ei=ti.getRootNode&&ti.getRootNode();if(ii.contains(ti))return!0;if(ei&&Eo(ei)){var ni=ti;do{if(ni&&ii.isSameNode(ni))return!0;ni=ni.parentNode||ni.host}while(ni)}return!1}function Ar(ii){return $n(ii).getComputedStyle(ii)}function Yl(ii){return["table","td","th"].indexOf(Qn(ii))>=0}function mr(ii){return((jr(ii)?ii.ownerDocument:ii.document)||window.document).documentElement}function gs(ii){return Qn(ii)==="html"?ii:ii.assignedSlot||ii.parentNode||(Eo(ii)?ii.host:null)||mr(ii)}function fu(ii){return!Jn(ii)||Ar(ii).position==="fixed"?null:ii.offsetParent}function wh(ii){var ti=/firefox/i.test(xo()),ei=/Trident/i.test(xo());if(ei&&Jn(ii)){var ni=Ar(ii);if(ni.position==="fixed")return null}var ri=gs(ii);for(Eo(ri)&&(ri=ri.host);Jn(ri)&&["html","body"].indexOf(Qn(ri))<0;){var si=Ar(ri);if(si.transform!=="none"||si.perspective!=="none"||si.contain==="paint"||["transform","perspective"].indexOf(si.willChange)!==-1||ti&&si.willChange==="filter"||ti&&si.filter&&si.filter!=="none")return ri;ri=ri.parentNode}return null}function Zr(ii){for(var ti=$n(ii),ei=fu(ii);ei&&Yl(ei)&&Ar(ei).position==="static";)ei=fu(ei);return ei&&(Qn(ei)==="html"||Qn(ei)==="body"&&Ar(ei).position==="static")?ti:ei||wh(ii)||ti}function Qs(ii){return["top","bottom"].indexOf(ii)>=0?"x":"y"}function Zs(ii,ti,ei){return Qr(ii,Xs(ti,ei))}function hu(ii,ti,ei){var ni=Zs(ii,ti,ei);return ni>ei?ei:ni}function ra(){return{top:0,right:0,bottom:0,left:0}}function sa(ii){return Object.assign({},ra(),ii)}function oa(ii,ti){return ti.reduce(function(ei,ni){return ei[ni]=ii,ei},{})}var xh=function(ti,ei){return ti=typeof ti=="function"?ti(Object.assign({},ei.rects,{placement:ei.placement})):ti,sa(typeof ti!="number"?ti:oa(ti,ps))};function Sh(ii){var ti,ei=ii.state,ni=ii.name,ri=ii.options,si=ei.elements.arrow,ai=ei.modifiersData.popperOffsets,ci=Zn(ei.placement),fi=Qs(ci),vi=[Vn,qn].indexOf(ci)>=0,hi=vi?"height":"width";if(!(!si||!ai)){var bi=xh(ri.padding,ei),wi=Js(si),Ti=fi==="y"?Bn:Vn,ki=fi==="y"?Gn:qn,Ci=ei.rects.reference[hi]+ei.rects.reference[fi]-ai[fi]-ei.rects.popper[hi],Bi=ai[fi]-ei.rects.reference[fi],rn=Zr(si),nn=rn?fi==="y"?rn.clientHeight||0:rn.clientWidth||0:0,Ji=Ci/2-Bi/2,Wi=bi[Ti],ln=nn-wi[hi]-bi[ki],Yi=nn/2-wi[hi]/2+Ji,dn=Zs(Wi,Yi,ln),un=fi;ei.modifiersData[ni]=(ti={},ti[un]=dn,ti.centerOffset=dn-Yi,ti)}}function Th(ii){var ti=ii.state,ei=ii.options,ni=ei.element,ri=ni===void 0?"[data-popper-arrow]":ni;ri!=null&&(typeof ri=="string"&&(ri=ti.elements.popper.querySelector(ri),!ri)||!na(ti.elements.popper,ri)||(ti.elements.arrow=ri))}var La={name:"arrow",enabled:!0,phase:"main",fn:Sh,effect:Th,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fr(ii){return ii.split("-")[1]}var Ch={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Dh(ii,ti){var ei=ii.x,ni=ii.y,ri=ti.devicePixelRatio||1;return{x:ms(ei*ri)/ri||0,y:ms(ni*ri)/ri||0}}function pu(ii){var ti,ei=ii.popper,ni=ii.popperRect,ri=ii.placement,si=ii.variation,ai=ii.offsets,ci=ii.position,fi=ii.gpuAcceleration,vi=ii.adaptive,hi=ii.roundOffsets,bi=ii.isFixed,wi=ai.x,Ti=wi===void 0?0:wi,ki=ai.y,Ci=ki===void 0?0:ki,Bi=typeof hi=="function"?hi({x:Ti,y:Ci}):{x:Ti,y:Ci};Ti=Bi.x,Ci=Bi.y;var rn=ai.hasOwnProperty("x"),nn=ai.hasOwnProperty("y"),Ji=Vn,Wi=Bn,ln=window;if(vi){var Yi=Zr(ei),dn="clientHeight",un="clientWidth";if(Yi===$n(ei)&&(Yi=mr(ei),Ar(Yi).position!=="static"&&ci==="absolute"&&(dn="scrollHeight",un="scrollWidth")),Yi=Yi,ri===Bn||(ri===Vn||ri===qn)&&si===ks){Wi=Gn;var pn=bi&&Yi===ln&&ln.visualViewport?ln.visualViewport.height:Yi[dn];Ci-=pn-ni.height,Ci*=fi?1:-1}if(ri===Vn||(ri===Bn||ri===Gn)&&si===ks){Ji=qn;var gn=bi&&Yi===ln&&ln.visualViewport?ln.visualViewport.width:Yi[un];Ti-=gn-ni.width,Ti*=fi?1:-1}}var Cn=Object.assign({position:ci},vi&&Ch),kn=hi===!0?Dh({x:Ti,y:Ci},$n(ei)):{x:Ti,y:Ci};if(Ti=kn.x,Ci=kn.y,fi){var En;return Object.assign({},Cn,(En={},En[Wi]=nn?"0":"",En[Ji]=rn?"0":"",En.transform=(ln.devicePixelRatio||1)<=1?"translate("+Ti+"px, "+Ci+"px)":"translate3d("+Ti+"px, "+Ci+"px, 0)",En))}return Object.assign({},Cn,(ti={},ti[Wi]=nn?Ci+"px":"",ti[Ji]=rn?Ti+"px":"",ti.transform="",ti))}function Ah(ii){var ti=ii.state,ei=ii.options,ni=ei.gpuAcceleration,ri=ni===void 0?!0:ni,si=ei.adaptive,ai=si===void 0?!0:si,ci=ei.roundOffsets,fi=ci===void 0?!0:ci,vi={placement:Zn(ti.placement),variation:Fr(ti.placement),popper:ti.elements.popper,popperRect:ti.rects.popper,gpuAcceleration:ri,isFixed:ti.options.strategy==="fixed"};ti.modifiersData.popperOffsets!=null&&(ti.styles.popper=Object.assign({},ti.styles.popper,pu(Object.assign({},vi,{offsets:ti.modifiersData.popperOffsets,position:ti.options.strategy,adaptive:ai,roundOffsets:fi})))),ti.modifiersData.arrow!=null&&(ti.styles.arrow=Object.assign({},ti.styles.arrow,pu(Object.assign({},vi,{offsets:ti.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:fi})))),ti.attributes.popper=Object.assign({},ti.attributes.popper,{"data-popper-placement":ti.placement})}var So={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ah,data:{}};var Na={passive:!0};function Oh(ii){var ti=ii.state,ei=ii.instance,ni=ii.options,ri=ni.scroll,si=ri===void 0?!0:ri,ai=ni.resize,ci=ai===void 0?!0:ai,fi=$n(ti.elements.popper),vi=[].concat(ti.scrollParents.reference,ti.scrollParents.popper);return si&&vi.forEach(function(hi){hi.addEventListener("scroll",ei.update,Na)}),ci&&fi.addEventListener("resize",ei.update,Na),function(){si&&vi.forEach(function(hi){hi.removeEventListener("scroll",ei.update,Na)}),ci&&fi.removeEventListener("resize",ei.update,Na)}}var To={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Oh,data:{}};var Mh={left:"right",right:"left",bottom:"top",top:"bottom"};function Co(ii){return ii.replace(/left|right|bottom|top/g,function(ti){return Mh[ti]})}var Lh={start:"end",end:"start"};function ka(ii){return ii.replace(/start|end/g,function(ti){return Lh[ti]})}function eo(ii){var ti=$n(ii),ei=ti.pageXOffset,ni=ti.pageYOffset;return{scrollLeft:ei,scrollTop:ni}}function to(ii){return $r(mr(ii)).left+eo(ii).scrollLeft}function Gl(ii,ti){var ei=$n(ii),ni=mr(ii),ri=ei.visualViewport,si=ni.clientWidth,ai=ni.clientHeight,ci=0,fi=0;if(ri){si=ri.width,ai=ri.height;var vi=ia();(vi||!vi&&ti==="fixed")&&(ci=ri.offsetLeft,fi=ri.offsetTop)}return{width:si,height:ai,x:ci+to(ii),y:fi}}function Kl(ii){var ti,ei=mr(ii),ni=eo(ii),ri=(ti=ii.ownerDocument)==null?void 0:ti.body,si=Qr(ei.scrollWidth,ei.clientWidth,ri?ri.scrollWidth:0,ri?ri.clientWidth:0),ai=Qr(ei.scrollHeight,ei.clientHeight,ri?ri.scrollHeight:0,ri?ri.clientHeight:0),ci=-ni.scrollLeft+to(ii),fi=-ni.scrollTop;return Ar(ri||ei).direction==="rtl"&&(ci+=Qr(ei.clientWidth,ri?ri.clientWidth:0)-si),{width:si,height:ai,x:ci,y:fi}}function io(ii){var ti=Ar(ii),ei=ti.overflow,ni=ti.overflowX,ri=ti.overflowY;return/auto|scroll|overlay|hidden/.test(ei+ri+ni)}function Ia(ii){return["html","body","#document"].indexOf(Qn(ii))>=0?ii.ownerDocument.body:Jn(ii)&&io(ii)?ii:Ia(gs(ii))}function Is(ii,ti){var ei;ti===void 0&&(ti=[]);var ni=Ia(ii),ri=ni===((ei=ii.ownerDocument)==null?void 0:ei.body),si=$n(ni),ai=ri?[si].concat(si.visualViewport||[],io(ni)?ni:[]):ni,ci=ti.concat(ai);return ri?ci:ci.concat(Is(gs(ai)))}function Do(ii){return Object.assign({},ii,{left:ii.x,top:ii.y,right:ii.x+ii.width,bottom:ii.y+ii.height})}function Nh(ii,ti){var ei=$r(ii,!1,ti==="fixed");return ei.top=ei.top+ii.clientTop,ei.left=ei.left+ii.clientLeft,ei.bottom=ei.top+ii.clientHeight,ei.right=ei.left+ii.clientWidth,ei.width=ii.clientWidth,ei.height=ii.clientHeight,ei.x=ei.left,ei.y=ei.top,ei}function mu(ii,ti,ei){return ti===ea?Do(Gl(ii,ei)):jr(ti)?Nh(ti,ei):Do(Kl(mr(ii)))}function kh(ii){var ti=Is(gs(ii)),ei=["absolute","fixed"].indexOf(Ar(ii).position)>=0,ni=ei&&Jn(ii)?Zr(ii):ii;return jr(ni)?ti.filter(function(ri){return jr(ri)&&na(ri,ni)&&Qn(ri)!=="body"}):[]}function Xl(ii,ti,ei,ni){var ri=ti==="clippingParents"?kh(ii):[].concat(ti),si=[].concat(ri,[ei]),ai=si[0],ci=si.reduce(function(fi,vi){var hi=mu(ii,vi,ni);return fi.top=Qr(hi.top,fi.top),fi.right=Xs(hi.right,fi.right),fi.bottom=Xs(hi.bottom,fi.bottom),fi.left=Qr(hi.left,fi.left),fi},mu(ii,ai,ni));return ci.width=ci.right-ci.left,ci.height=ci.bottom-ci.top,ci.x=ci.left,ci.y=ci.top,ci}function aa(ii){var ti=ii.reference,ei=ii.element,ni=ii.placement,ri=ni?Zn(ni):null,si=ni?Fr(ni):null,ai=ti.x+ti.width/2-ei.width/2,ci=ti.y+ti.height/2-ei.height/2,fi;switch(ri){case Bn:fi={x:ai,y:ti.y-ei.height};break;case Gn:fi={x:ai,y:ti.y+ti.height};break;case qn:fi={x:ti.x+ti.width,y:ci};break;case Vn:fi={x:ti.x-ei.width,y:ci};break;default:fi={x:ti.x,y:ti.y}}var vi=ri?Qs(ri):null;if(vi!=null){var hi=vi==="y"?"height":"width";switch(si){case ss:fi[vi]=fi[vi]-(ti[hi]/2-ei[hi]/2);break;case ks:fi[vi]=fi[vi]+(ti[hi]/2-ei[hi]/2);break;default:}}return fi}function Or(ii,ti){ti===void 0&&(ti={});var ei=ti,ni=ei.placement,ri=ni===void 0?ii.placement:ni,si=ei.strategy,ai=si===void 0?ii.strategy:si,ci=ei.boundary,fi=ci===void 0?zl:ci,vi=ei.rootBoundary,hi=vi===void 0?ea:vi,bi=ei.elementContext,wi=bi===void 0?Ks:bi,Ti=ei.altBoundary,ki=Ti===void 0?!1:Ti,Ci=ei.padding,Bi=Ci===void 0?0:Ci,rn=sa(typeof Bi!="number"?Bi:oa(Bi,ps)),nn=wi===Ks?ql:Ks,Ji=ii.rects.popper,Wi=ii.elements[ki?nn:wi],ln=Xl(jr(Wi)?Wi:Wi.contextElement||mr(ii.elements.popper),fi,hi,ai),Yi=$r(ii.elements.reference),dn=aa({reference:Yi,element:Ji,strategy:"absolute",placement:ri}),un=Do(Object.assign({},Ji,dn)),pn=wi===Ks?un:Yi,gn={top:ln.top-pn.top+rn.top,bottom:pn.bottom-ln.bottom+rn.bottom,left:ln.left-pn.left+rn.left,right:pn.right-ln.right+rn.right},Cn=ii.modifiersData.offset;if(wi===Ks&&Cn){var kn=Cn[ri];Object.keys(gn).forEach(function(En){var Li=[qn,Gn].indexOf(En)>=0?1:-1,Ui=[Bn,Gn].indexOf(En)>=0?"y":"x";gn[En]+=kn[Ui]*Li})}return gn}function Jl(ii,ti){ti===void 0&&(ti={});var ei=ti,ni=ei.placement,ri=ei.boundary,si=ei.rootBoundary,ai=ei.padding,ci=ei.flipVariations,fi=ei.allowedAutoPlacements,vi=fi===void 0?ta:fi,hi=Fr(ni),bi=hi?ci?Ma:Ma.filter(function(ki){return Fr(ki)===hi}):ps,wi=bi.filter(function(ki){return vi.indexOf(ki)>=0});wi.length===0&&(wi=bi);var Ti=wi.reduce(function(ki,Ci){return ki[Ci]=Or(ii,{placement:Ci,boundary:ri,rootBoundary:si,padding:ai})[Zn(Ci)],ki},{});return Object.keys(Ti).sort(function(ki,Ci){return Ti[ki]-Ti[Ci]})}function Ih(ii){if(Zn(ii)===Zo)return[];var ti=Co(ii);return[ka(ii),ti,ka(ti)]}function Ph(ii){var ti=ii.state,ei=ii.options,ni=ii.name;if(!ti.modifiersData[ni]._skip){for(var ri=ei.mainAxis,si=ri===void 0?!0:ri,ai=ei.altAxis,ci=ai===void 0?!0:ai,fi=ei.fallbackPlacements,vi=ei.padding,hi=ei.boundary,bi=ei.rootBoundary,wi=ei.altBoundary,Ti=ei.flipVariations,ki=Ti===void 0?!0:Ti,Ci=ei.allowedAutoPlacements,Bi=ti.options.placement,rn=Zn(Bi),nn=rn===Bi,Ji=fi||(nn||!ki?[Co(Bi)]:Ih(Bi)),Wi=[Bi].concat(Ji).reduce(function(Ii,Ri){return Ii.concat(Zn(Ri)===Zo?Jl(ti,{placement:Ri,boundary:hi,rootBoundary:bi,padding:vi,flipVariations:ki,allowedAutoPlacements:Ci}):Ri)},[]),ln=ti.rects.reference,Yi=ti.rects.popper,dn=new Map,un=!0,pn=Wi[0],gn=0;gn<Wi.length;gn++){var Cn=Wi[gn],kn=Zn(Cn),En=Fr(Cn)===ss,Li=[Bn,Gn].indexOf(kn)>=0,Ui=Li?"width":"height",ji=Or(ti,{placement:Cn,boundary:hi,rootBoundary:bi,altBoundary:wi,padding:vi}),Fi=Li?En?qn:Vn:En?Gn:Bn;ln[Ui]>Yi[Ui]&&(Fi=Co(Fi));var vn=Co(Fi),sn=[];if(si&&sn.push(ji[kn]<=0),ci&&sn.push(ji[Fi]<=0,ji[vn]<=0),sn.every(function(Ii){return Ii})){pn=Cn,un=!1;break}dn.set(Cn,sn)}if(un)for(var Pi=ki?3:1,Mi=function(Ri){var fn=Wi.find(function(On){var In=dn.get(On);if(In)return In.slice(0,Ri).every(function(br){return br})});if(fn)return pn=fn,"break"},$i=Pi;$i>0;$i--){var en=Mi($i);if(en==="break")break}ti.placement!==pn&&(ti.modifiersData[ni]._skip=!0,ti.placement=pn,ti.reset=!0)}}var Pa={name:"flip",enabled:!0,phase:"main",fn:Ph,requiresIfExists:["offset"],data:{_skip:!1}};function gu(ii,ti,ei){return ei===void 0&&(ei={x:0,y:0}),{top:ii.top-ti.height-ei.y,right:ii.right-ti.width+ei.x,bottom:ii.bottom-ti.height+ei.y,left:ii.left-ti.width-ei.x}}function vu(ii){return[Bn,qn,Gn,Vn].some(function(ti){return ii[ti]>=0})}function Rh(ii){var ti=ii.state,ei=ii.name,ni=ti.rects.reference,ri=ti.rects.popper,si=ti.modifiersData.preventOverflow,ai=Or(ti,{elementContext:"reference"}),ci=Or(ti,{altBoundary:!0}),fi=gu(ai,ni),vi=gu(ci,ri,si),hi=vu(fi),bi=vu(vi);ti.modifiersData[ei]={referenceClippingOffsets:fi,popperEscapeOffsets:vi,isReferenceHidden:hi,hasPopperEscaped:bi},ti.attributes.popper=Object.assign({},ti.attributes.popper,{"data-popper-reference-hidden":hi,"data-popper-escaped":bi})}var Ra={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Rh};function Hh(ii,ti,ei){var ni=Zn(ii),ri=[Vn,Bn].indexOf(ni)>=0?-1:1,si=typeof ei=="function"?ei(Object.assign({},ti,{placement:ii})):ei,ai=si[0],ci=si[1];return ai=ai||0,ci=(ci||0)*ri,[Vn,qn].indexOf(ni)>=0?{x:ci,y:ai}:{x:ai,y:ci}}function jh(ii){var ti=ii.state,ei=ii.options,ni=ii.name,ri=ei.offset,si=ri===void 0?[0,0]:ri,ai=ta.reduce(function(hi,bi){return hi[bi]=Hh(bi,ti.rects,si),hi},{}),ci=ai[ti.placement],fi=ci.x,vi=ci.y;ti.modifiersData.popperOffsets!=null&&(ti.modifiersData.popperOffsets.x+=fi,ti.modifiersData.popperOffsets.y+=vi),ti.modifiersData[ni]=ai}var Ha={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jh};function $h(ii){var ti=ii.state,ei=ii.name;ti.modifiersData[ei]=aa({reference:ti.rects.reference,element:ti.rects.popper,strategy:"absolute",placement:ti.placement})}var Ao={name:"popperOffsets",enabled:!0,phase:"read",fn:$h,data:{}};function Ql(ii){return ii==="x"?"y":"x"}function Fh(ii){var ti=ii.state,ei=ii.options,ni=ii.name,ri=ei.mainAxis,si=ri===void 0?!0:ri,ai=ei.altAxis,ci=ai===void 0?!1:ai,fi=ei.boundary,vi=ei.rootBoundary,hi=ei.altBoundary,bi=ei.padding,wi=ei.tether,Ti=wi===void 0?!0:wi,ki=ei.tetherOffset,Ci=ki===void 0?0:ki,Bi=Or(ti,{boundary:fi,rootBoundary:vi,padding:bi,altBoundary:hi}),rn=Zn(ti.placement),nn=Fr(ti.placement),Ji=!nn,Wi=Qs(rn),ln=Ql(Wi),Yi=ti.modifiersData.popperOffsets,dn=ti.rects.reference,un=ti.rects.popper,pn=typeof Ci=="function"?Ci(Object.assign({},ti.rects,{placement:ti.placement})):Ci,gn=typeof pn=="number"?{mainAxis:pn,altAxis:pn}:Object.assign({mainAxis:0,altAxis:0},pn),Cn=ti.modifiersData.offset?ti.modifiersData.offset[ti.placement]:null,kn={x:0,y:0};if(!!Yi){if(si){var En,Li=Wi==="y"?Bn:Vn,Ui=Wi==="y"?Gn:qn,ji=Wi==="y"?"height":"width",Fi=Yi[Wi],vn=Fi+Bi[Li],sn=Fi-Bi[Ui],Pi=Ti?-un[ji]/2:0,Mi=nn===ss?dn[ji]:un[ji],$i=nn===ss?-un[ji]:-dn[ji],en=ti.elements.arrow,Ii=Ti&&en?Js(en):{width:0,height:0},Ri=ti.modifiersData["arrow#persistent"]?ti.modifiersData["arrow#persistent"].padding:ra(),fn=Ri[Li],On=Ri[Ui],In=Zs(0,dn[ji],Ii[ji]),br=Ji?dn[ji]/2-Pi-In-fn-gn.mainAxis:Mi-In-fn-gn.mainAxis,Xn=Ji?-dn[ji]/2+Pi+In+On+gn.mainAxis:$i+In+On+gn.mainAxis,Er=ti.elements.arrow&&Zr(ti.elements.arrow),us=Er?Wi==="y"?Er.clientTop||0:Er.clientLeft||0:0,qs=(En=Cn==null?void 0:Cn[Wi])!=null?En:0,Ts=Fi+br-qs-us,Ws=Fi+Xn-qs,po=Zs(Ti?Xs(vn,Ts):vn,Fi,Ti?Qr(sn,Ws):sn);Yi[Wi]=po,kn[Wi]=po-Fi}if(ci){var is,Dn=Wi==="x"?Bn:Vn,ns=Wi==="x"?Gn:qn,Kr=Yi[ln],Cs=ln==="y"?"height":"width",Ys=Kr+Bi[Dn],Ds=Kr-Bi[ns],ds=[Bn,Vn].indexOf(rn)!==-1,Xr=(is=Cn==null?void 0:Cn[ln])!=null?is:0,mo=ds?Ys:Kr-dn[Cs]-un[Cs]-Xr+gn.altAxis,As=ds?Kr+dn[Cs]+un[Cs]-Xr-gn.altAxis:Ds,go=Ti&&ds?hu(mo,Kr,As):Zs(Ti?mo:Ys,Kr,Ti?As:Ds);Yi[ln]=go,kn[ln]=go-Kr}ti.modifiersData[ni]=kn}}var ja={name:"preventOverflow",enabled:!0,phase:"main",fn:Fh,requiresIfExists:["offset"]};function Zl(ii){return{scrollLeft:ii.scrollLeft,scrollTop:ii.scrollTop}}function ec(ii){return ii===$n(ii)||!Jn(ii)?eo(ii):Zl(ii)}function Bh(ii){var ti=ii.getBoundingClientRect(),ei=ms(ti.width)/ii.offsetWidth||1,ni=ms(ti.height)/ii.offsetHeight||1;return ei!==1||ni!==1}function tc(ii,ti,ei){ei===void 0&&(ei=!1);var ni=Jn(ti),ri=Jn(ti)&&Bh(ti),si=mr(ti),ai=$r(ii,ri,ei),ci={scrollLeft:0,scrollTop:0},fi={x:0,y:0};return(ni||!ni&&!ei)&&((Qn(ti)!=="body"||io(si))&&(ci=ec(ti)),Jn(ti)?(fi=$r(ti,!0),fi.x+=ti.clientLeft,fi.y+=ti.clientTop):si&&(fi.x=to(si))),{x:ai.left+ci.scrollLeft-fi.x,y:ai.top+ci.scrollTop-fi.y,width:ai.width,height:ai.height}}function Uh(ii){var ti=new Map,ei=new Set,ni=[];ii.forEach(function(si){ti.set(si.name,si)});function ri(si){ei.add(si.name);var ai=[].concat(si.requires||[],si.requiresIfExists||[]);ai.forEach(function(ci){if(!ei.has(ci)){var fi=ti.get(ci);fi&&ri(fi)}}),ni.push(si)}return ii.forEach(function(si){ei.has(si.name)||ri(si)}),ni}function ic(ii){var ti=Uh(ii);return Wl.reduce(function(ei,ni){return ei.concat(ti.filter(function(ri){return ri.phase===ni}))},[])}function nc(ii){var ti;return function(){return ti||(ti=new Promise(function(ei){Promise.resolve().then(function(){ti=void 0,ei(ii())})})),ti}}function rc(ii){var ti=ii.reduce(function(ei,ni){var ri=ei[ni.name];return ei[ni.name]=ri?Object.assign({},ri,ni,{options:Object.assign({},ri.options,ni.options),data:Object.assign({},ri.data,ni.data)}):ni,ei},{});return Object.keys(ti).map(function(ei){return ti[ei]})}var _u={placement:"bottom",modifiers:[],strategy:"absolute"};function yu(){for(var ii=arguments.length,ti=new Array(ii),ei=0;ei<ii;ei++)ti[ei]=arguments[ei];return!ti.some(function(ni){return!(ni&&typeof ni.getBoundingClientRect=="function")})}function no(ii){ii===void 0&&(ii={});var ti=ii,ei=ti.defaultModifiers,ni=ei===void 0?[]:ei,ri=ti.defaultOptions,si=ri===void 0?_u:ri;return function(ci,fi,vi){vi===void 0&&(vi=si);var hi={placement:"bottom",orderedModifiers:[],options:Object.assign({},_u,si),modifiersData:{},elements:{reference:ci,popper:fi},attributes:{},styles:{}},bi=[],wi=!1,Ti={state:hi,setOptions:function(rn){var nn=typeof rn=="function"?rn(hi.options):rn;Ci(),hi.options=Object.assign({},si,hi.options,nn),hi.scrollParents={reference:jr(ci)?Is(ci):ci.contextElement?Is(ci.contextElement):[],popper:Is(fi)};var Ji=ic(rc([].concat(ni,hi.options.modifiers)));return hi.orderedModifiers=Ji.filter(function(Wi){return Wi.enabled}),ki(),Ti.update()},forceUpdate:function(){if(!wi){var rn=hi.elements,nn=rn.reference,Ji=rn.popper;if(!!yu(nn,Ji)){hi.rects={reference:tc(nn,Zr(Ji),hi.options.strategy==="fixed"),popper:Js(Ji)},hi.reset=!1,hi.placement=hi.options.placement,hi.orderedModifiers.forEach(function(gn){return hi.modifiersData[gn.name]=Object.assign({},gn.data)});for(var Wi=0;Wi<hi.orderedModifiers.length;Wi++){if(hi.reset===!0){hi.reset=!1,Wi=-1;continue}var ln=hi.orderedModifiers[Wi],Yi=ln.fn,dn=ln.options,un=dn===void 0?{}:dn,pn=ln.name;typeof Yi=="function"&&(hi=Yi({state:hi,options:un,name:pn,instance:Ti})||hi)}}}},update:nc(function(){return new Promise(function(Bi){Ti.forceUpdate(),Bi(hi)})}),destroy:function(){Ci(),wi=!0}};if(!yu(ci,fi))return Ti;Ti.setOptions(vi).then(function(Bi){!wi&&vi.onFirstUpdate&&vi.onFirstUpdate(Bi)});function ki(){hi.orderedModifiers.forEach(function(Bi){var rn=Bi.name,nn=Bi.options,Ji=nn===void 0?{}:nn,Wi=Bi.effect;if(typeof Wi=="function"){var ln=Wi({state:hi,name:rn,instance:Ti,options:Ji}),Yi=function(){};bi.push(ln||Yi)}})}function Ci(){bi.forEach(function(Bi){return Bi()}),bi=[]}return Ti}}var bu=no();var Vh=[To,Ao,So,wo],Eu=no({defaultModifiers:Vh});var zh=[To,Ao,So,wo,Ha,Pa,ja,La,Ra],$a=no({defaultModifiers:zh});var Ps=new Map,sc={set(ii,ti,ei){Ps.has(ii)||Ps.set(ii,new Map);let ni=Ps.get(ii);if(!ni.has(ti)&&ni.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(ni.keys())[0]}.`);return}ni.set(ti,ei)},get(ii,ti){return Ps.has(ii)&&Ps.get(ii).get(ti)||null},remove(ii,ti){if(!Ps.has(ii))return;let ei=Ps.get(ii);ei.delete(ti),ei.size===0&&Ps.delete(ii)}},qh=1e6,Wh=1e3,oc="transitionend",wu=ii=>(ii&&window.CSS&&window.CSS.escape&&(ii=ii.replace(/#([^\s"#']+)/g,(ti,ei)=>`#${CSS.escape(ei)}`)),ii),Yh=ii=>ii==null?`${ii}`:Object.prototype.toString.call(ii).match(/\s([a-z]+)/i)[1].toLowerCase(),Gh=ii=>{do ii+=Math.floor(Math.random()*qh);while(document.getElementById(ii));return ii},Kh=ii=>{if(!ii)return 0;let{transitionDuration:ti,transitionDelay:ei}=window.getComputedStyle(ii),ni=Number.parseFloat(ti),ri=Number.parseFloat(ei);return!ni&&!ri?0:(ti=ti.split(",")[0],ei=ei.split(",")[0],(Number.parseFloat(ti)+Number.parseFloat(ei))*Wh)},xu=ii=>{ii.dispatchEvent(new Event(oc))},vs=ii=>!ii||typeof ii!="object"?!1:(typeof ii.jquery!="undefined"&&(ii=ii[0]),typeof ii.nodeType!="undefined"),Rs=ii=>vs(ii)?ii.jquery?ii[0]:ii:typeof ii=="string"&&ii.length>0?document.querySelector(wu(ii)):null,Oo=ii=>{if(!vs(ii)||ii.getClientRects().length===0)return!1;let ti=getComputedStyle(ii).getPropertyValue("visibility")==="visible",ei=ii.closest("details:not([open])");if(!ei)return ti;if(ei!==ii){let ni=ii.closest("summary");if(ni&&ni.parentNode!==ei||ni===null)return!1}return ti},Hs=ii=>!ii||ii.nodeType!==Node.ELEMENT_NODE||ii.classList.contains("disabled")?!0:typeof ii.disabled!="undefined"?ii.disabled:ii.hasAttribute("disabled")&&ii.getAttribute("disabled")!=="false",Su=ii=>{if(!document.documentElement.attachShadow)return null;if(typeof ii.getRootNode=="function"){let ti=ii.getRootNode();return ti instanceof ShadowRoot?ti:null}return ii instanceof ShadowRoot?ii:ii.parentNode?Su(ii.parentNode):null},Ba=()=>{},la=ii=>{ii.offsetHeight},Tu=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,ac=[],Xh=ii=>{document.readyState==="loading"?(ac.length||document.addEventListener("DOMContentLoaded",()=>{for(let ti of ac)ti()}),ac.push(ii)):ii()},Br=()=>document.documentElement.dir==="rtl",Ur=ii=>{Xh(()=>{let ti=Tu();if(ti){let ei=ii.NAME,ni=ti.fn[ei];ti.fn[ei]=ii.jQueryInterface,ti.fn[ei].Constructor=ii,ti.fn[ei].noConflict=()=>(ti.fn[ei]=ni,ii.jQueryInterface)}})},Mr=(ii,ti=[],ei=ii)=>typeof ii=="function"?ii(...ti):ei,Cu=(ii,ti,ei=!0)=>{if(!ei){Mr(ii);return}let ni=5,ri=Kh(ti)+ni,si=!1,ai=({target:ci})=>{ci===ti&&(si=!0,ti.removeEventListener(oc,ai),Mr(ii))};ti.addEventListener(oc,ai),setTimeout(()=>{si||xu(ti)},ri)},lc=(ii,ti,ei,ni)=>{let ri=ii.length,si=ii.indexOf(ti);return si===-1?!ei&&ni?ii[ri-1]:ii[0]:(si+=ei?1:-1,ni&&(si=(si+ri)%ri),ii[Math.max(0,Math.min(si,ri-1))])},Jh=/[^.]*(?=\..*)\.|.*/,Qh=/\..*/,Zh=/::\d+$/,cc={},Du=1,Au={mouseenter:"mouseover",mouseleave:"mouseout"},ep=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function Ou(ii,ti){return ti&&`${ti}::${Du++}`||ii.uidEvent||Du++}function Mu(ii){let ti=Ou(ii);return ii.uidEvent=ti,cc[ti]=cc[ti]||{},cc[ti]}function tp(ii,ti){return function ei(ni){return dc(ni,{delegateTarget:ii}),ei.oneOff&&Oi.off(ii,ni.type,ti),ti.apply(ii,[ni])}}function ip(ii,ti,ei){return function ni(ri){let si=ii.querySelectorAll(ti);for(let{target:ai}=ri;ai&&ai!==this;ai=ai.parentNode)for(let ci of si)if(ci===ai)return dc(ri,{delegateTarget:ai}),ni.oneOff&&Oi.off(ii,ri.type,ti,ei),ei.apply(ai,[ri])}}function Lu(ii,ti,ei=null){return Object.values(ii).find(ni=>ni.callable===ti&&ni.delegationSelector===ei)}function Nu(ii,ti,ei){let ni=typeof ti=="string",ri=ni?ei:ti||ei,si=Iu(ii);return ep.has(si)||(si=ii),[ni,ri,si]}function ku(ii,ti,ei,ni,ri){if(typeof ti!="string"||!ii)return;let[si,ai,ci]=Nu(ti,ei,ni);ti in Au&&(ai=(ki=>function(Ci){if(!Ci.relatedTarget||Ci.relatedTarget!==Ci.delegateTarget&&!Ci.delegateTarget.contains(Ci.relatedTarget))return ki.call(this,Ci)})(ai));let fi=Mu(ii),vi=fi[ci]||(fi[ci]={}),hi=Lu(vi,ai,si?ei:null);if(hi){hi.oneOff=hi.oneOff&&ri;return}let bi=Ou(ai,ti.replace(Jh,"")),wi=si?ip(ii,ei,ai):tp(ii,ai);wi.delegationSelector=si?ei:null,wi.callable=ai,wi.oneOff=ri,wi.uidEvent=bi,vi[bi]=wi,ii.addEventListener(ci,wi,si)}function uc(ii,ti,ei,ni,ri){let si=Lu(ti[ei],ni,ri);!si||(ii.removeEventListener(ei,si,Boolean(ri)),delete ti[ei][si.uidEvent])}function np(ii,ti,ei,ni){let ri=ti[ei]||{};for(let[si,ai]of Object.entries(ri))si.includes(ni)&&uc(ii,ti,ei,ai.callable,ai.delegationSelector)}function Iu(ii){return ii=ii.replace(Qh,""),Au[ii]||ii}var Oi={on(ii,ti,ei,ni){ku(ii,ti,ei,ni,!1)},one(ii,ti,ei,ni){ku(ii,ti,ei,ni,!0)},off(ii,ti,ei,ni){if(typeof ti!="string"||!ii)return;let[ri,si,ai]=Nu(ti,ei,ni),ci=ai!==ti,fi=Mu(ii),vi=fi[ai]||{},hi=ti.startsWith(".");if(typeof si!="undefined"){if(!Object.keys(vi).length)return;uc(ii,fi,ai,si,ri?ei:null);return}if(hi)for(let bi of Object.keys(fi))np(ii,fi,bi,ti.slice(1));for(let[bi,wi]of Object.entries(vi)){let Ti=bi.replace(Zh,"");(!ci||ti.includes(Ti))&&uc(ii,fi,ai,wi.callable,wi.delegationSelector)}},trigger(ii,ti,ei){if(typeof ti!="string"||!ii)return null;let ni=Tu(),ri=Iu(ti),si=ti!==ri,ai=null,ci=!0,fi=!0,vi=!1;si&&ni&&(ai=ni.Event(ti,ei),ni(ii).trigger(ai),ci=!ai.isPropagationStopped(),fi=!ai.isImmediatePropagationStopped(),vi=ai.isDefaultPrevented());let hi=dc(new Event(ti,{bubbles:ci,cancelable:!0}),ei);return vi&&hi.preventDefault(),fi&&ii.dispatchEvent(hi),hi.defaultPrevented&&ai&&ai.preventDefault(),hi}};function dc(ii,ti={}){for(let[ei,ni]of Object.entries(ti))try{ii[ei]=ni}catch(ri){Object.defineProperty(ii,ei,{configurable:!0,get(){return ni}})}return ii}function Pu(ii){if(ii==="true")return!0;if(ii==="false")return!1;if(ii===Number(ii).toString())return Number(ii);if(ii===""||ii==="null")return null;if(typeof ii!="string")return ii;try{return JSON.parse(decodeURIComponent(ii))}catch(ti){return ii}}function fc(ii){return ii.replace(/[A-Z]/g,ti=>`-${ti.toLowerCase()}`)}var _s={setDataAttribute(ii,ti,ei){ii.setAttribute(`data-bs-${fc(ti)}`,ei)},removeDataAttribute(ii,ti){ii.removeAttribute(`data-bs-${fc(ti)}`)},getDataAttributes(ii){if(!ii)return{};let ti={},ei=Object.keys(ii.dataset).filter(ni=>ni.startsWith("bs")&&!ni.startsWith("bsConfig"));for(let ni of ei){let ri=ni.replace(/^bs/,"");ri=ri.charAt(0).toLowerCase()+ri.slice(1,ri.length),ti[ri]=Pu(ii.dataset[ni])}return ti},getDataAttribute(ii,ti){return Pu(ii.getAttribute(`data-bs-${fc(ti)}`))}},Mo=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(ti){return ti=this._mergeConfigObj(ti),ti=this._configAfterMerge(ti),this._typeCheckConfig(ti),ti}_configAfterMerge(ti){return ti}_mergeConfigObj(ti,ei){let ni=vs(ei)?_s.getDataAttribute(ei,"config"):{};return jn(jn(jn(jn({},this.constructor.Default),typeof ni=="object"?ni:{}),vs(ei)?_s.getDataAttributes(ei):{}),typeof ti=="object"?ti:{})}_typeCheckConfig(ti,ei=this.constructor.DefaultType){for(let[ni,ri]of Object.entries(ei)){let si=ti[ni],ai=vs(si)?"element":Yh(si);if(!new RegExp(ri).test(ai))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${ni}" provided type "${ai}" but expected type "${ri}".`)}}},rp="5.3.1",Vr=class extends Mo{constructor(ti,ei){super();ti=Rs(ti),!!ti&&(this._element=ti,this._config=this._getConfig(ei),sc.set(this._element,this.constructor.DATA_KEY,this))}dispose(){sc.remove(this._element,this.constructor.DATA_KEY),Oi.off(this._element,this.constructor.EVENT_KEY);for(let ti of Object.getOwnPropertyNames(this))this[ti]=null}_queueCallback(ti,ei,ni=!0){Cu(ti,ei,ni)}_getConfig(ti){return ti=this._mergeConfigObj(ti,this._element),ti=this._configAfterMerge(ti),this._typeCheckConfig(ti),ti}static getInstance(ti){return sc.get(Rs(ti),this.DATA_KEY)}static getOrCreateInstance(ti,ei={}){return this.getInstance(ti)||new this(ti,typeof ei=="object"?ei:null)}static get VERSION(){return rp}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(ti){return`${ti}${this.EVENT_KEY}`}},hc=ii=>{let ti=ii.getAttribute("data-bs-target");if(!ti||ti==="#"){let ei=ii.getAttribute("href");if(!ei||!ei.includes("#")&&!ei.startsWith("."))return null;ei.includes("#")&&!ei.startsWith("#")&&(ei=`#${ei.split("#")[1]}`),ti=ei&&ei!=="#"?ei.trim():null}return wu(ti)},on={find(ii,ti=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(ti,ii))},findOne(ii,ti=document.documentElement){return Element.prototype.querySelector.call(ti,ii)},children(ii,ti){return[].concat(...ii.children).filter(ei=>ei.matches(ti))},parents(ii,ti){let ei=[],ni=ii.parentNode.closest(ti);for(;ni;)ei.push(ni),ni=ni.parentNode.closest(ti);return ei},prev(ii,ti){let ei=ii.previousElementSibling;for(;ei;){if(ei.matches(ti))return[ei];ei=ei.previousElementSibling}return[]},next(ii,ti){let ei=ii.nextElementSibling;for(;ei;){if(ei.matches(ti))return[ei];ei=ei.nextElementSibling}return[]},focusableChildren(ii){let ti=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(ei=>`${ei}:not([tabindex^="-"])`).join(",");return this.find(ti,ii).filter(ei=>!Hs(ei)&&Oo(ei))},getSelectorFromElement(ii){let ti=hc(ii);return ti&&on.findOne(ti)?ti:null},getElementFromSelector(ii){let ti=hc(ii);return ti?on.findOne(ti):null},getMultipleElementsFromSelector(ii){let ti=hc(ii);return ti?on.find(ti):[]}},Ua=(ii,ti="hide")=>{let ei=`click.dismiss${ii.EVENT_KEY}`,ni=ii.NAME;Oi.on(document,ei,`[data-bs-dismiss="${ni}"]`,function(ri){if(["A","AREA"].includes(this.tagName)&&ri.preventDefault(),Hs(this))return;let si=on.getElementFromSelector(this)||this.closest(`.${ni}`);ii.getOrCreateInstance(si)[ti]()})},sp="alert",op="bs.alert",Ru=`.${op}`,ap=`close${Ru}`,lp=`closed${Ru}`,cp="fade",up="show",ca=class extends Vr{static get NAME(){return sp}close(){if(Oi.trigger(this._element,ap).defaultPrevented)return;this._element.classList.remove(up);let ei=this._element.classList.contains(cp);this._queueCallback(()=>this._destroyElement(),this._element,ei)}_destroyElement(){this._element.remove(),Oi.trigger(this._element,lp),this.dispose()}static jQueryInterface(ti){return this.each(function(){let ei=ca.getOrCreateInstance(this);if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti](this)}})}};Ua(ca,"close");Ur(ca);var dp="button",fp="bs.button",hp=`.${fp}`,pp=".data-api",mp="active",Hu='[data-bs-toggle="button"]',gp=`click${hp}${pp}`,ua=class extends Vr{static get NAME(){return dp}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(mp))}static jQueryInterface(ti){return this.each(function(){let ei=ua.getOrCreateInstance(this);ti==="toggle"&&ei[ti]()})}};Oi.on(document,gp,Hu,ii=>{ii.preventDefault();let ti=ii.target.closest(Hu);ua.getOrCreateInstance(ti).toggle()});Ur(ua);var vp="swipe",Lo=".bs.swipe",_p=`touchstart${Lo}`,yp=`touchmove${Lo}`,bp=`touchend${Lo}`,Ep=`pointerdown${Lo}`,wp=`pointerup${Lo}`,xp="touch",Sp="pen",Tp="pointer-event",Cp=40,Dp={endCallback:null,leftCallback:null,rightCallback:null},Ap={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},da=class extends Mo{constructor(ti,ei){super();this._element=ti,!(!ti||!da.isSupported())&&(this._config=this._getConfig(ei),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Dp}static get DefaultType(){return Ap}static get NAME(){return vp}dispose(){Oi.off(this._element,Lo)}_start(ti){if(!this._supportPointerEvents){this._deltaX=ti.touches[0].clientX;return}this._eventIsPointerPenTouch(ti)&&(this._deltaX=ti.clientX)}_end(ti){this._eventIsPointerPenTouch(ti)&&(this._deltaX=ti.clientX-this._deltaX),this._handleSwipe(),Mr(this._config.endCallback)}_move(ti){this._deltaX=ti.touches&&ti.touches.length>1?0:ti.touches[0].clientX-this._deltaX}_handleSwipe(){let ti=Math.abs(this._deltaX);if(ti<=Cp)return;let ei=ti/this._deltaX;this._deltaX=0,!!ei&&Mr(ei>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Oi.on(this._element,Ep,ti=>this._start(ti)),Oi.on(this._element,wp,ti=>this._end(ti)),this._element.classList.add(Tp)):(Oi.on(this._element,_p,ti=>this._start(ti)),Oi.on(this._element,yp,ti=>this._move(ti)),Oi.on(this._element,bp,ti=>this._end(ti)))}_eventIsPointerPenTouch(ti){return this._supportPointerEvents&&(ti.pointerType===Sp||ti.pointerType===xp)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}},Op="carousel",Mp="bs.carousel",js=`.${Mp}`,ju=".data-api",Lp="ArrowLeft",Np="ArrowRight",kp=500,fa="next",No="prev",ko="left",Va="right",Ip=`slide${js}`,pc=`slid${js}`,Pp=`keydown${js}`,Rp=`mouseenter${js}`,Hp=`mouseleave${js}`,jp=`dragstart${js}`,$p=`load${js}${ju}`,Fp=`click${js}${ju}`,$u="carousel",za="active",Bp="slide",Up="carousel-item-end",Vp="carousel-item-start",zp="carousel-item-next",qp="carousel-item-prev",Fu=".active",Bu=".carousel-item",Wp=Fu+Bu,Yp=".carousel-item img",Gp=".carousel-indicators",Kp="[data-bs-slide], [data-bs-slide-to]",Xp='[data-bs-ride="carousel"]',Jp={[Lp]:Va,[Np]:ko},Qp={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Zp={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},Io=class extends Vr{constructor(ti,ei){super(ti,ei);this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=on.findOne(Gp,this._element),this._addEventListeners(),this._config.ride===$u&&this.cycle()}static get Default(){return Qp}static get DefaultType(){return Zp}static get NAME(){return Op}next(){this._slide(fa)}nextWhenVisible(){!document.hidden&&Oo(this._element)&&this.next()}prev(){this._slide(No)}pause(){this._isSliding&&xu(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(!!this._config.ride){if(this._isSliding){Oi.one(this._element,pc,()=>this.cycle());return}this.cycle()}}to(ti){let ei=this._getItems();if(ti>ei.length-1||ti<0)return;if(this._isSliding){Oi.one(this._element,pc,()=>this.to(ti));return}let ni=this._getItemIndex(this._getActive());if(ni===ti)return;let ri=ti>ni?fa:No;this._slide(ri,ei[ti])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(ti){return ti.defaultInterval=ti.interval,ti}_addEventListeners(){this._config.keyboard&&Oi.on(this._element,Pp,ti=>this._keydown(ti)),this._config.pause==="hover"&&(Oi.on(this._element,Rp,()=>this.pause()),Oi.on(this._element,Hp,()=>this._maybeEnableCycle())),this._config.touch&&da.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(let ni of on.find(Yp,this._element))Oi.on(ni,jp,ri=>ri.preventDefault());let ei={leftCallback:()=>this._slide(this._directionToOrder(ko)),rightCallback:()=>this._slide(this._directionToOrder(Va)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),kp+this._config.interval))}};this._swipeHelper=new da(this._element,ei)}_keydown(ti){if(/input|textarea/i.test(ti.target.tagName))return;let ei=Jp[ti.key];ei&&(ti.preventDefault(),this._slide(this._directionToOrder(ei)))}_getItemIndex(ti){return this._getItems().indexOf(ti)}_setActiveIndicatorElement(ti){if(!this._indicatorsElement)return;let ei=on.findOne(Fu,this._indicatorsElement);ei.classList.remove(za),ei.removeAttribute("aria-current");let ni=on.findOne(`[data-bs-slide-to="${ti}"]`,this._indicatorsElement);ni&&(ni.classList.add(za),ni.setAttribute("aria-current","true"))}_updateInterval(){let ti=this._activeElement||this._getActive();if(!ti)return;let ei=Number.parseInt(ti.getAttribute("data-bs-interval"),10);this._config.interval=ei||this._config.defaultInterval}_slide(ti,ei=null){if(this._isSliding)return;let ni=this._getActive(),ri=ti===fa,si=ei||lc(this._getItems(),ni,ri,this._config.wrap);if(si===ni)return;let ai=this._getItemIndex(si),ci=Ti=>Oi.trigger(this._element,Ti,{relatedTarget:si,direction:this._orderToDirection(ti),from:this._getItemIndex(ni),to:ai});if(ci(Ip).defaultPrevented||!ni||!si)return;let vi=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(ai),this._activeElement=si;let hi=ri?Vp:Up,bi=ri?zp:qp;si.classList.add(bi),la(si),ni.classList.add(hi),si.classList.add(hi);let wi=()=>{si.classList.remove(hi,bi),si.classList.add(za),ni.classList.remove(za,bi,hi),this._isSliding=!1,ci(pc)};this._queueCallback(wi,ni,this._isAnimated()),vi&&this.cycle()}_isAnimated(){return this._element.classList.contains(Bp)}_getActive(){return on.findOne(Wp,this._element)}_getItems(){return on.find(Bu,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(ti){return Br()?ti===ko?No:fa:ti===ko?fa:No}_orderToDirection(ti){return Br()?ti===No?ko:Va:ti===No?Va:ko}static jQueryInterface(ti){return this.each(function(){let ei=Io.getOrCreateInstance(this,ti);if(typeof ti=="number"){ei.to(ti);return}if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};Oi.on(document,Fp,Kp,function(ii){let ti=on.getElementFromSelector(this);if(!ti||!ti.classList.contains($u))return;ii.preventDefault();let ei=Io.getOrCreateInstance(ti),ni=this.getAttribute("data-bs-slide-to");if(ni){ei.to(ni),ei._maybeEnableCycle();return}if(_s.getDataAttribute(this,"slide")==="next"){ei.next(),ei._maybeEnableCycle();return}ei.prev(),ei._maybeEnableCycle()});Oi.on(window,$p,()=>{let ii=on.find(Xp);for(let ti of ii)Io.getOrCreateInstance(ti)});Ur(Io);var em="collapse",tm="bs.collapse",ha=`.${tm}`,im=".data-api",nm=`show${ha}`,rm=`shown${ha}`,sm=`hide${ha}`,om=`hidden${ha}`,am=`click${ha}${im}`,mc="show",Po="collapse",qa="collapsing",lm="collapsed",cm=`:scope .${Po} .${Po}`,um="collapse-horizontal",dm="width",fm="height",hm=".collapse.show, .collapse.collapsing",gc='[data-bs-toggle="collapse"]',pm={parent:null,toggle:!0},mm={parent:"(null|element)",toggle:"boolean"},os=class extends Vr{constructor(ti,ei){super(ti,ei);this._isTransitioning=!1,this._triggerArray=[];let ni=on.find(gc);for(let ri of ni){let si=on.getSelectorFromElement(ri),ai=on.find(si).filter(ci=>ci===this._element);si!==null&&ai.length&&this._triggerArray.push(ri)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return pm}static get DefaultType(){return mm}static get NAME(){return em}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let ti=[];if(this._config.parent&&(ti=this._getFirstLevelChildren(hm).filter(ci=>ci!==this._element).map(ci=>os.getOrCreateInstance(ci,{toggle:!1}))),ti.length&&ti[0]._isTransitioning||Oi.trigger(this._element,nm).defaultPrevented)return;for(let ci of ti)ci.hide();let ni=this._getDimension();this._element.classList.remove(Po),this._element.classList.add(qa),this._element.style[ni]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;let ri=()=>{this._isTransitioning=!1,this._element.classList.remove(qa),this._element.classList.add(Po,mc),this._element.style[ni]="",Oi.trigger(this._element,rm)},ai=`scroll${ni[0].toUpperCase()+ni.slice(1)}`;this._queueCallback(ri,this._element,!0),this._element.style[ni]=`${this._element[ai]}px`}hide(){if(this._isTransitioning||!this._isShown()||Oi.trigger(this._element,sm).defaultPrevented)return;let ei=this._getDimension();this._element.style[ei]=`${this._element.getBoundingClientRect()[ei]}px`,la(this._element),this._element.classList.add(qa),this._element.classList.remove(Po,mc);for(let ri of this._triggerArray){let si=on.getElementFromSelector(ri);si&&!this._isShown(si)&&this._addAriaAndCollapsedClass([ri],!1)}this._isTransitioning=!0;let ni=()=>{this._isTransitioning=!1,this._element.classList.remove(qa),this._element.classList.add(Po),Oi.trigger(this._element,om)};this._element.style[ei]="",this._queueCallback(ni,this._element,!0)}_isShown(ti=this._element){return ti.classList.contains(mc)}_configAfterMerge(ti){return ti.toggle=Boolean(ti.toggle),ti.parent=Rs(ti.parent),ti}_getDimension(){return this._element.classList.contains(um)?dm:fm}_initializeChildren(){if(!this._config.parent)return;let ti=this._getFirstLevelChildren(gc);for(let ei of ti){let ni=on.getElementFromSelector(ei);ni&&this._addAriaAndCollapsedClass([ei],this._isShown(ni))}}_getFirstLevelChildren(ti){let ei=on.find(cm,this._config.parent);return on.find(ti,this._config.parent).filter(ni=>!ei.includes(ni))}_addAriaAndCollapsedClass(ti,ei){if(!!ti.length)for(let ni of ti)ni.classList.toggle(lm,!ei),ni.setAttribute("aria-expanded",ei)}static jQueryInterface(ti){let ei={};return typeof ti=="string"&&/show|hide/.test(ti)&&(ei.toggle=!1),this.each(function(){let ni=os.getOrCreateInstance(this,ei);if(typeof ti=="string"){if(typeof ni[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ni[ti]()}})}};Oi.on(document,am,gc,function(ii){(ii.target.tagName==="A"||ii.delegateTarget&&ii.delegateTarget.tagName==="A")&&ii.preventDefault();for(let ti of on.getMultipleElementsFromSelector(this))os.getOrCreateInstance(ti,{toggle:!1}).toggle()});Ur(os);var Uu="dropdown",gm="bs.dropdown",ro=`.${gm}`,vc=".data-api",vm="Escape",Vu="Tab",_m="ArrowUp",zu="ArrowDown",ym=2,bm=`hide${ro}`,Em=`hidden${ro}`,wm=`show${ro}`,xm=`shown${ro}`,qu=`click${ro}${vc}`,Wu=`keydown${ro}${vc}`,Sm=`keyup${ro}${vc}`,Ro="show",Tm="dropup",Cm="dropend",Dm="dropstart",Am="dropup-center",Om="dropdown-center",so='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Mm=`${so}.${Ro}`,Wa=".dropdown-menu",Lm=".navbar",Nm=".navbar-nav",km=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Im=Br()?"top-end":"top-start",Pm=Br()?"top-start":"top-end",Rm=Br()?"bottom-end":"bottom-start",Hm=Br()?"bottom-start":"bottom-end",jm=Br()?"left-start":"right-start",$m=Br()?"right-start":"left-start",Fm="top",Bm="bottom",Um={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Vm={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},es=class extends Vr{constructor(ti,ei){super(ti,ei);this._popper=null,this._parent=this._element.parentNode,this._menu=on.next(this._element,Wa)[0]||on.prev(this._element,Wa)[0]||on.findOne(Wa,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Um}static get DefaultType(){return Vm}static get NAME(){return Uu}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Hs(this._element)||this._isShown())return;let ti={relatedTarget:this._element};if(!Oi.trigger(this._element,wm,ti).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(Nm))for(let ni of[].concat(...document.body.children))Oi.on(ni,"mouseover",Ba);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Ro),this._element.classList.add(Ro),Oi.trigger(this._element,xm,ti)}}hide(){if(Hs(this._element)||!this._isShown())return;let ti={relatedTarget:this._element};this._completeHide(ti)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(ti){if(!Oi.trigger(this._element,bm,ti).defaultPrevented){if("ontouchstart"in document.documentElement)for(let ni of[].concat(...document.body.children))Oi.off(ni,"mouseover",Ba);this._popper&&this._popper.destroy(),this._menu.classList.remove(Ro),this._element.classList.remove(Ro),this._element.setAttribute("aria-expanded","false"),_s.removeDataAttribute(this._menu,"popper"),Oi.trigger(this._element,Em,ti)}}_getConfig(ti){if(ti=super._getConfig(ti),typeof ti.reference=="object"&&!vs(ti.reference)&&typeof ti.reference.getBoundingClientRect!="function")throw new TypeError(`${Uu.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return ti}_createPopper(){if(typeof Fa=="undefined")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let ti=this._element;this._config.reference==="parent"?ti=this._parent:vs(this._config.reference)?ti=Rs(this._config.reference):typeof this._config.reference=="object"&&(ti=this._config.reference);let ei=this._getPopperConfig();this._popper=$a(ti,this._menu,ei)}_isShown(){return this._menu.classList.contains(Ro)}_getPlacement(){let ti=this._parent;if(ti.classList.contains(Cm))return jm;if(ti.classList.contains(Dm))return $m;if(ti.classList.contains(Am))return Fm;if(ti.classList.contains(Om))return Bm;let ei=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return ti.classList.contains(Tm)?ei?Pm:Im:ei?Hm:Rm}_detectNavbar(){return this._element.closest(Lm)!==null}_getOffset(){let{offset:ti}=this._config;return typeof ti=="string"?ti.split(",").map(ei=>Number.parseInt(ei,10)):typeof ti=="function"?ei=>ti(ei,this._element):ti}_getPopperConfig(){let ti={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(_s.setDataAttribute(this._menu,"popper","static"),ti.modifiers=[{name:"applyStyles",enabled:!1}]),jn(jn({},ti),Mr(this._config.popperConfig,[ti]))}_selectMenuItem({key:ti,target:ei}){let ni=on.find(km,this._menu).filter(ri=>Oo(ri));!ni.length||lc(ni,ei,ti===zu,!ni.includes(ei)).focus()}static jQueryInterface(ti){return this.each(function(){let ei=es.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ei[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}static clearMenus(ti){if(ti.button===ym||ti.type==="keyup"&&ti.key!==Vu)return;let ei=on.find(Mm);for(let ni of ei){let ri=es.getInstance(ni);if(!ri||ri._config.autoClose===!1)continue;let si=ti.composedPath(),ai=si.includes(ri._menu);if(si.includes(ri._element)||ri._config.autoClose==="inside"&&!ai||ri._config.autoClose==="outside"&&ai||ri._menu.contains(ti.target)&&(ti.type==="keyup"&&ti.key===Vu||/input|select|option|textarea|form/i.test(ti.target.tagName)))continue;let ci={relatedTarget:ri._element};ti.type==="click"&&(ci.clickEvent=ti),ri._completeHide(ci)}}static dataApiKeydownHandler(ti){let ei=/input|textarea/i.test(ti.target.tagName),ni=ti.key===vm,ri=[_m,zu].includes(ti.key);if(!ri&&!ni||ei&&!ni)return;ti.preventDefault();let si=this.matches(so)?this:on.prev(this,so)[0]||on.next(this,so)[0]||on.findOne(so,ti.delegateTarget.parentNode),ai=es.getOrCreateInstance(si);if(ri){ti.stopPropagation(),ai.show(),ai._selectMenuItem(ti);return}ai._isShown()&&(ti.stopPropagation(),ai.hide(),si.focus())}};Oi.on(document,Wu,so,es.dataApiKeydownHandler);Oi.on(document,Wu,Wa,es.dataApiKeydownHandler);Oi.on(document,qu,es.clearMenus);Oi.on(document,Sm,es.clearMenus);Oi.on(document,qu,so,function(ii){ii.preventDefault(),es.getOrCreateInstance(this).toggle()});Ur(es);var Yu="backdrop",zm="fade",Gu="show",Ku=`mousedown.bs.${Yu}`,qm={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Wm={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},_c=class extends Mo{constructor(ti){super();this._config=this._getConfig(ti),this._isAppended=!1,this._element=null}static get Default(){return qm}static get DefaultType(){return Wm}static get NAME(){return Yu}show(ti){if(!this._config.isVisible){Mr(ti);return}this._append();let ei=this._getElement();this._config.isAnimated&&la(ei),ei.classList.add(Gu),this._emulateAnimation(()=>{Mr(ti)})}hide(ti){if(!this._config.isVisible){Mr(ti);return}this._getElement().classList.remove(Gu),this._emulateAnimation(()=>{this.dispose(),Mr(ti)})}dispose(){!this._isAppended||(Oi.off(this._element,Ku),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){let ti=document.createElement("div");ti.className=this._config.className,this._config.isAnimated&&ti.classList.add(zm),this._element=ti}return this._element}_configAfterMerge(ti){return ti.rootElement=Rs(ti.rootElement),ti}_append(){if(this._isAppended)return;let ti=this._getElement();this._config.rootElement.append(ti),Oi.on(ti,Ku,()=>{Mr(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(ti){Cu(ti,this._getElement(),this._config.isAnimated)}},Ym="focustrap",Gm="bs.focustrap",Ya=`.${Gm}`,Km=`focusin${Ya}`,Xm=`keydown.tab${Ya}`,Jm="Tab",Qm="forward",Xu="backward",Zm={autofocus:!0,trapElement:null},eg={autofocus:"boolean",trapElement:"element"},yc=class extends Mo{constructor(ti){super();this._config=this._getConfig(ti),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Zm}static get DefaultType(){return eg}static get NAME(){return Ym}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Oi.off(document,Ya),Oi.on(document,Km,ti=>this._handleFocusin(ti)),Oi.on(document,Xm,ti=>this._handleKeydown(ti)),this._isActive=!0)}deactivate(){!this._isActive||(this._isActive=!1,Oi.off(document,Ya))}_handleFocusin(ti){let{trapElement:ei}=this._config;if(ti.target===document||ti.target===ei||ei.contains(ti.target))return;let ni=on.focusableChildren(ei);ni.length===0?ei.focus():this._lastTabNavDirection===Xu?ni[ni.length-1].focus():ni[0].focus()}_handleKeydown(ti){ti.key===Jm&&(this._lastTabNavDirection=ti.shiftKey?Xu:Qm)}},Ju=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Qu=".sticky-top",Ga="padding-right",Zu="margin-right",Ka=class{constructor(){this._element=document.body}getWidth(){let ti=document.documentElement.clientWidth;return Math.abs(window.innerWidth-ti)}hide(){let ti=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Ga,ei=>ei+ti),this._setElementAttributes(Ju,Ga,ei=>ei+ti),this._setElementAttributes(Qu,Zu,ei=>ei-ti)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Ga),this._resetElementAttributes(Ju,Ga),this._resetElementAttributes(Qu,Zu)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(ti,ei,ni){let ri=this.getWidth(),si=ai=>{if(ai!==this._element&&window.innerWidth>ai.clientWidth+ri)return;this._saveInitialAttribute(ai,ei);let ci=window.getComputedStyle(ai).getPropertyValue(ei);ai.style.setProperty(ei,`${ni(Number.parseFloat(ci))}px`)};this._applyManipulationCallback(ti,si)}_saveInitialAttribute(ti,ei){let ni=ti.style.getPropertyValue(ei);ni&&_s.setDataAttribute(ti,ei,ni)}_resetElementAttributes(ti,ei){let ni=ri=>{let si=_s.getDataAttribute(ri,ei);if(si===null){ri.style.removeProperty(ei);return}_s.removeDataAttribute(ri,ei),ri.style.setProperty(ei,si)};this._applyManipulationCallback(ti,ni)}_applyManipulationCallback(ti,ei){if(vs(ti)){ei(ti);return}for(let ni of on.find(ti,this._element))ei(ni)}},tg="modal",ig="bs.modal",zr=`.${ig}`,ng=".data-api",rg="Escape",sg=`hide${zr}`,og=`hidePrevented${zr}`,ed=`hidden${zr}`,td=`show${zr}`,ag=`shown${zr}`,lg=`resize${zr}`,cg=`click.dismiss${zr}`,ug=`mousedown.dismiss${zr}`,dg=`keydown.dismiss${zr}`,fg=`click${zr}${ng}`,id="modal-open",hg="fade",nd="show",bc="modal-static",pg=".modal.show",mg=".modal-dialog",gg=".modal-body",vg='[data-bs-toggle="modal"]',_g={backdrop:!0,focus:!0,keyboard:!0},yg={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},as=class extends Vr{constructor(ti,ei){super(ti,ei);this._dialog=on.findOne(mg,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Ka,this._addEventListeners()}static get Default(){return _g}static get DefaultType(){return yg}static get NAME(){return tg}toggle(ti){return this._isShown?this.hide():this.show(ti)}show(ti){this._isShown||this._isTransitioning||Oi.trigger(this._element,td,{relatedTarget:ti}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(id),this._adjustDialog(),this._backdrop.show(()=>this._showElement(ti)))}hide(){!this._isShown||this._isTransitioning||Oi.trigger(this._element,sg).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(nd),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){Oi.off(window,zr),Oi.off(this._dialog,zr),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new _c({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new yc({trapElement:this._element})}_showElement(ti){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;let ei=on.findOne(gg,this._dialog);ei&&(ei.scrollTop=0),la(this._element),this._element.classList.add(nd);let ni=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Oi.trigger(this._element,ag,{relatedTarget:ti})};this._queueCallback(ni,this._dialog,this._isAnimated())}_addEventListeners(){Oi.on(this._element,dg,ti=>{if(ti.key===rg){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),Oi.on(window,lg,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Oi.on(this._element,ug,ti=>{Oi.one(this._element,cg,ei=>{if(!(this._element!==ti.target||this._element!==ei.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(id),this._resetAdjustments(),this._scrollBar.reset(),Oi.trigger(this._element,ed)})}_isAnimated(){return this._element.classList.contains(hg)}_triggerBackdropTransition(){if(Oi.trigger(this._element,og).defaultPrevented)return;let ei=this._element.scrollHeight>document.documentElement.clientHeight,ni=this._element.style.overflowY;ni==="hidden"||this._element.classList.contains(bc)||(ei||(this._element.style.overflowY="hidden"),this._element.classList.add(bc),this._queueCallback(()=>{this._element.classList.remove(bc),this._queueCallback(()=>{this._element.style.overflowY=ni},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){let ti=this._element.scrollHeight>document.documentElement.clientHeight,ei=this._scrollBar.getWidth(),ni=ei>0;if(ni&&!ti){let ri=Br()?"paddingLeft":"paddingRight";this._element.style[ri]=`${ei}px`}if(!ni&&ti){let ri=Br()?"paddingRight":"paddingLeft";this._element.style[ri]=`${ei}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(ti,ei){return this.each(function(){let ni=as.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ni[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ni[ti](ei)}})}};Oi.on(document,fg,vg,function(ii){let ti=on.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&ii.preventDefault(),Oi.one(ti,td,ri=>{ri.defaultPrevented||Oi.one(ti,ed,()=>{Oo(this)&&this.focus()})});let ei=on.findOne(pg);ei&&as.getInstance(ei).hide(),as.getOrCreateInstance(ti).toggle(this)});Ua(as);Ur(as);var bg="offcanvas",Eg="bs.offcanvas",ys=`.${Eg}`,rd=".data-api",wg=`load${ys}${rd}`,xg="Escape",sd="show",od="showing",ad="hiding",Sg="offcanvas-backdrop",ld=".offcanvas.show",Tg=`show${ys}`,Cg=`shown${ys}`,Dg=`hide${ys}`,cd=`hidePrevented${ys}`,ud=`hidden${ys}`,Ag=`resize${ys}`,Og=`click${ys}${rd}`,Mg=`keydown.dismiss${ys}`,Lg='[data-bs-toggle="offcanvas"]',Ng={backdrop:!0,keyboard:!0,scroll:!1},kg={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},bs=class extends Vr{constructor(ti,ei){super(ti,ei);this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Ng}static get DefaultType(){return kg}static get NAME(){return bg}toggle(ti){return this._isShown?this.hide():this.show(ti)}show(ti){if(this._isShown||Oi.trigger(this._element,Tg,{relatedTarget:ti}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new Ka().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(od);let ni=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(sd),this._element.classList.remove(od),Oi.trigger(this._element,Cg,{relatedTarget:ti})};this._queueCallback(ni,this._element,!0)}hide(){if(!this._isShown||Oi.trigger(this._element,Dg).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(ad),this._backdrop.hide();let ei=()=>{this._element.classList.remove(sd,ad),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new Ka().reset(),Oi.trigger(this._element,ud)};this._queueCallback(ei,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){let ti=()=>{if(this._config.backdrop==="static"){Oi.trigger(this._element,cd);return}this.hide()},ei=Boolean(this._config.backdrop);return new _c({className:Sg,isVisible:ei,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:ei?ti:null})}_initializeFocusTrap(){return new yc({trapElement:this._element})}_addEventListeners(){Oi.on(this._element,Mg,ti=>{if(ti.key===xg){if(this._config.keyboard){this.hide();return}Oi.trigger(this._element,cd)}})}static jQueryInterface(ti){return this.each(function(){let ei=bs.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti](this)}})}};Oi.on(document,Og,Lg,function(ii){let ti=on.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&ii.preventDefault(),Hs(this))return;Oi.one(ti,ud,()=>{Oo(this)&&this.focus()});let ei=on.findOne(ld);ei&&ei!==ti&&bs.getInstance(ei).hide(),bs.getOrCreateInstance(ti).toggle(this)});Oi.on(window,wg,()=>{for(let ii of on.find(ld))bs.getOrCreateInstance(ii).show()});Oi.on(window,Ag,()=>{for(let ii of on.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(ii).position!=="fixed"&&bs.getOrCreateInstance(ii).hide()});Ua(bs);Ur(bs);var Ig=/^aria-[\w-]*$/i,dd={"*":["class","dir","id","lang","role",Ig],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Pg=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Rg=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Hg=(ii,ti)=>{let ei=ii.nodeName.toLowerCase();return ti.includes(ei)?Pg.has(ei)?Boolean(Rg.test(ii.nodeValue)):!0:ti.filter(ni=>ni instanceof RegExp).some(ni=>ni.test(ei))};function jg(ii,ti,ei){if(!ii.length)return ii;if(ei&&typeof ei=="function")return ei(ii);let ri=new window.DOMParser().parseFromString(ii,"text/html"),si=[].concat(...ri.body.querySelectorAll("*"));for(let ai of si){let ci=ai.nodeName.toLowerCase();if(!Object.keys(ti).includes(ci)){ai.remove();continue}let fi=[].concat(...ai.attributes),vi=[].concat(ti["*"]||[],ti[ci]||[]);for(let hi of fi)Hg(hi,vi)||ai.removeAttribute(hi.nodeName)}return ri.body.innerHTML}var $g="TemplateFactory",Fg={allowList:dd,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Bg={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Ug={entry:"(string|element|function|null)",selector:"(string|element)"},fd=class extends Mo{constructor(ti){super();this._config=this._getConfig(ti)}static get Default(){return Fg}static get DefaultType(){return Bg}static get NAME(){return $g}getContent(){return Object.values(this._config.content).map(ti=>this._resolvePossibleFunction(ti)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(ti){return this._checkContent(ti),this._config.content=jn(jn({},this._config.content),ti),this}toHtml(){let ti=document.createElement("div");ti.innerHTML=this._maybeSanitize(this._config.template);for(let[ri,si]of Object.entries(this._config.content))this._setContent(ti,si,ri);let ei=ti.children[0],ni=this._resolvePossibleFunction(this._config.extraClass);return ni&&ei.classList.add(...ni.split(" ")),ei}_typeCheckConfig(ti){super._typeCheckConfig(ti),this._checkContent(ti.content)}_checkContent(ti){for(let[ei,ni]of Object.entries(ti))super._typeCheckConfig({selector:ei,entry:ni},Ug)}_setContent(ti,ei,ni){let ri=on.findOne(ni,ti);if(!!ri){if(ei=this._resolvePossibleFunction(ei),!ei){ri.remove();return}if(vs(ei)){this._putElementInTemplate(Rs(ei),ri);return}if(this._config.html){ri.innerHTML=this._maybeSanitize(ei);return}ri.textContent=ei}}_maybeSanitize(ti){return this._config.sanitize?jg(ti,this._config.allowList,this._config.sanitizeFn):ti}_resolvePossibleFunction(ti){return Mr(ti,[this])}_putElementInTemplate(ti,ei){if(this._config.html){ei.innerHTML="",ei.append(ti);return}ei.textContent=ti.textContent}},Vg="tooltip",zg=new Set(["sanitize","allowList","sanitizeFn"]),Ec="fade",qg="modal",Xa="show",Wg=".tooltip-inner",hd=`.${qg}`,pd="hide.bs.modal",pa="hover",wc="focus",Yg="click",Gg="manual",Kg="hide",Xg="hidden",Jg="show",Qg="shown",Zg="inserted",ev="click",tv="focusin",iv="focusout",nv="mouseenter",rv="mouseleave",sv={AUTO:"auto",TOP:"top",RIGHT:Br()?"left":"right",BOTTOM:"bottom",LEFT:Br()?"right":"left"},ov={allowList:dd,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},av={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},ls=class extends Vr{constructor(ti,ei){if(typeof Fa=="undefined")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(ti,ei);this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return ov}static get DefaultType(){return av}static get NAME(){return Vg}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(!!this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),Oi.off(this._element.closest(hd),pd,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;let ti=Oi.trigger(this._element,this.constructor.eventName(Jg)),ni=(Su(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(ti.defaultPrevented||!ni)return;this._disposePopper();let ri=this._getTipElement();this._element.setAttribute("aria-describedby",ri.getAttribute("id"));let{container:si}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(si.append(ri),Oi.trigger(this._element,this.constructor.eventName(Zg))),this._popper=this._createPopper(ri),ri.classList.add(Xa),"ontouchstart"in document.documentElement)for(let ci of[].concat(...document.body.children))Oi.on(ci,"mouseover",Ba);let ai=()=>{Oi.trigger(this._element,this.constructor.eventName(Qg)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(ai,this.tip,this._isAnimated())}hide(){if(!this._isShown()||Oi.trigger(this._element,this.constructor.eventName(Kg)).defaultPrevented)return;if(this._getTipElement().classList.remove(Xa),"ontouchstart"in document.documentElement)for(let ri of[].concat(...document.body.children))Oi.off(ri,"mouseover",Ba);this._activeTrigger[Yg]=!1,this._activeTrigger[wc]=!1,this._activeTrigger[pa]=!1,this._isHovered=null;let ni=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Oi.trigger(this._element,this.constructor.eventName(Xg)))};this._queueCallback(ni,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(ti){let ei=this._getTemplateFactory(ti).toHtml();if(!ei)return null;ei.classList.remove(Ec,Xa),ei.classList.add(`bs-${this.constructor.NAME}-auto`);let ni=Gh(this.constructor.NAME).toString();return ei.setAttribute("id",ni),this._isAnimated()&&ei.classList.add(Ec),ei}setContent(ti){this._newContent=ti,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(ti){return this._templateFactory?this._templateFactory.changeContent(ti):this._templateFactory=new fd(fs(jn({},this._config),{content:ti,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}_getContentForTemplate(){return{[Wg]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(ti){return this.constructor.getOrCreateInstance(ti.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Ec)}_isShown(){return this.tip&&this.tip.classList.contains(Xa)}_createPopper(ti){let ei=Mr(this._config.placement,[this,ti,this._element]),ni=sv[ei.toUpperCase()];return $a(this._element,ti,this._getPopperConfig(ni))}_getOffset(){let{offset:ti}=this._config;return typeof ti=="string"?ti.split(",").map(ei=>Number.parseInt(ei,10)):typeof ti=="function"?ei=>ti(ei,this._element):ti}_resolvePossibleFunction(ti){return Mr(ti,[this._element])}_getPopperConfig(ti){let ei={placement:ti,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:ni=>{this._getTipElement().setAttribute("data-popper-placement",ni.state.placement)}}]};return jn(jn({},ei),Mr(this._config.popperConfig,[ei]))}_setListeners(){let ti=this._config.trigger.split(" ");for(let ei of ti)if(ei==="click")Oi.on(this._element,this.constructor.eventName(ev),this._config.selector,ni=>{this._initializeOnDelegatedTarget(ni).toggle()});else if(ei!==Gg){let ni=ei===pa?this.constructor.eventName(nv):this.constructor.eventName(tv),ri=ei===pa?this.constructor.eventName(rv):this.constructor.eventName(iv);Oi.on(this._element,ni,this._config.selector,si=>{let ai=this._initializeOnDelegatedTarget(si);ai._activeTrigger[si.type==="focusin"?wc:pa]=!0,ai._enter()}),Oi.on(this._element,ri,this._config.selector,si=>{let ai=this._initializeOnDelegatedTarget(si);ai._activeTrigger[si.type==="focusout"?wc:pa]=ai._element.contains(si.relatedTarget),ai._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Oi.on(this._element.closest(hd),pd,this._hideModalHandler)}_fixTitle(){let ti=this._element.getAttribute("title");!ti||(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",ti),this._element.setAttribute("data-bs-original-title",ti),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(ti,ei){clearTimeout(this._timeout),this._timeout=setTimeout(ti,ei)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(ti){let ei=_s.getDataAttributes(this._element);for(let ni of Object.keys(ei))zg.has(ni)&&delete ei[ni];return ti=jn(jn({},ei),typeof ti=="object"&&ti?ti:{}),ti=this._mergeConfigObj(ti),ti=this._configAfterMerge(ti),this._typeCheckConfig(ti),ti}_configAfterMerge(ti){return ti.container=ti.container===!1?document.body:Rs(ti.container),typeof ti.delay=="number"&&(ti.delay={show:ti.delay,hide:ti.delay}),typeof ti.title=="number"&&(ti.title=ti.title.toString()),typeof ti.content=="number"&&(ti.content=ti.content.toString()),ti}_getDelegateConfig(){let ti={};for(let[ei,ni]of Object.entries(this._config))this.constructor.Default[ei]!==ni&&(ti[ei]=ni);return ti.selector=!1,ti.trigger="manual",ti}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(ti){return this.each(function(){let ei=ls.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ei[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};Ur(ls);var lv="popover",cv=".popover-header",uv=".popover-body",dv=fs(jn({},ls.Default),{content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"}),fv=fs(jn({},ls.DefaultType),{content:"(null|string|element|function)"}),oo=class extends ls{static get Default(){return dv}static get DefaultType(){return fv}static get NAME(){return lv}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[cv]:this._getTitle(),[uv]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(ti){return this.each(function(){let ei=oo.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ei[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};Ur(oo);var hv="scrollspy",pv="bs.scrollspy",xc=`.${pv}`,mv=".data-api",gv=`activate${xc}`,md=`click${xc}`,vv=`load${xc}${mv}`,_v="dropdown-item",Ho="active",yv='[data-bs-spy="scroll"]',Sc="[href]",bv=".nav, .list-group",gd=".nav-link",Ev=".nav-item",wv=".list-group-item",xv=`${gd}, ${Ev} > ${gd}, ${wv}`,Sv=".dropdown",Tv=".dropdown-toggle",Cv={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Dv={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},ma=class extends Vr{constructor(ti,ei){super(ti,ei);this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Cv}static get DefaultType(){return Dv}static get NAME(){return hv}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(let ti of this._observableSections.values())this._observer.observe(ti)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(ti){return ti.target=Rs(ti.target)||document.body,ti.rootMargin=ti.offset?`${ti.offset}px 0px -30%`:ti.rootMargin,typeof ti.threshold=="string"&&(ti.threshold=ti.threshold.split(",").map(ei=>Number.parseFloat(ei))),ti}_maybeEnableSmoothScroll(){!this._config.smoothScroll||(Oi.off(this._config.target,md),Oi.on(this._config.target,md,Sc,ti=>{let ei=this._observableSections.get(ti.target.hash);if(ei){ti.preventDefault();let ni=this._rootElement||window,ri=ei.offsetTop-this._element.offsetTop;if(ni.scrollTo){ni.scrollTo({top:ri,behavior:"smooth"});return}ni.scrollTop=ri}}))}_getNewObserver(){let ti={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(ei=>this._observerCallback(ei),ti)}_observerCallback(ti){let ei=ai=>this._targetLinks.get(`#${ai.target.id}`),ni=ai=>{this._previousScrollData.visibleEntryTop=ai.target.offsetTop,this._process(ei(ai))},ri=(this._rootElement||document.documentElement).scrollTop,si=ri>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=ri;for(let ai of ti){if(!ai.isIntersecting){this._activeTarget=null,this._clearActiveClass(ei(ai));continue}let ci=ai.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(si&&ci){if(ni(ai),!ri)return;continue}!si&&!ci&&ni(ai)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;let ti=on.find(Sc,this._config.target);for(let ei of ti){if(!ei.hash||Hs(ei))continue;let ni=on.findOne(decodeURI(ei.hash),this._element);Oo(ni)&&(this._targetLinks.set(decodeURI(ei.hash),ei),this._observableSections.set(ei.hash,ni))}}_process(ti){this._activeTarget!==ti&&(this._clearActiveClass(this._config.target),this._activeTarget=ti,ti.classList.add(Ho),this._activateParents(ti),Oi.trigger(this._element,gv,{relatedTarget:ti}))}_activateParents(ti){if(ti.classList.contains(_v)){on.findOne(Tv,ti.closest(Sv)).classList.add(Ho);return}for(let ei of on.parents(ti,bv))for(let ni of on.prev(ei,xv))ni.classList.add(Ho)}_clearActiveClass(ti){ti.classList.remove(Ho);let ei=on.find(`${Sc}.${Ho}`,ti);for(let ni of ei)ni.classList.remove(Ho)}static jQueryInterface(ti){return this.each(function(){let ei=ma.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};Oi.on(window,vv,()=>{for(let ii of on.find(yv))ma.getOrCreateInstance(ii)});Ur(ma);var Av="tab",Ov="bs.tab",ao=`.${Ov}`,Mv=`hide${ao}`,Lv=`hidden${ao}`,Nv=`show${ao}`,kv=`shown${ao}`,Iv=`click${ao}`,Pv=`keydown${ao}`,Rv=`load${ao}`,Hv="ArrowLeft",vd="ArrowRight",jv="ArrowUp",_d="ArrowDown",Tc="Home",yd="End",lo="active",bd="fade",Cc="show",$v="dropdown",Fv=".dropdown-toggle",Bv=".dropdown-menu",Dc=":not(.dropdown-toggle)",Uv='.list-group, .nav, [role="tablist"]',Vv=".nav-item, .list-group-item",zv=`.nav-link${Dc}, .list-group-item${Dc}, [role="tab"]${Dc}`,Ed='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ac=`${zv}, ${Ed}`,qv=`.${lo}[data-bs-toggle="tab"], .${lo}[data-bs-toggle="pill"], .${lo}[data-bs-toggle="list"]`,Es=class extends Vr{constructor(ti){super(ti);this._parent=this._element.closest(Uv),!!this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Oi.on(this._element,Pv,ei=>this._keydown(ei)))}static get NAME(){return Av}show(){let ti=this._element;if(this._elemIsActive(ti))return;let ei=this._getActiveElem(),ni=ei?Oi.trigger(ei,Mv,{relatedTarget:ti}):null;Oi.trigger(ti,Nv,{relatedTarget:ei}).defaultPrevented||ni&&ni.defaultPrevented||(this._deactivate(ei,ti),this._activate(ti,ei))}_activate(ti,ei){if(!ti)return;ti.classList.add(lo),this._activate(on.getElementFromSelector(ti));let ni=()=>{if(ti.getAttribute("role")!=="tab"){ti.classList.add(Cc);return}ti.removeAttribute("tabindex"),ti.setAttribute("aria-selected",!0),this._toggleDropDown(ti,!0),Oi.trigger(ti,kv,{relatedTarget:ei})};this._queueCallback(ni,ti,ti.classList.contains(bd))}_deactivate(ti,ei){if(!ti)return;ti.classList.remove(lo),ti.blur(),this._deactivate(on.getElementFromSelector(ti));let ni=()=>{if(ti.getAttribute("role")!=="tab"){ti.classList.remove(Cc);return}ti.setAttribute("aria-selected",!1),ti.setAttribute("tabindex","-1"),this._toggleDropDown(ti,!1),Oi.trigger(ti,Lv,{relatedTarget:ei})};this._queueCallback(ni,ti,ti.classList.contains(bd))}_keydown(ti){if(![Hv,vd,jv,_d,Tc,yd].includes(ti.key))return;ti.stopPropagation(),ti.preventDefault();let ei=this._getChildren().filter(ri=>!Hs(ri)),ni;if([Tc,yd].includes(ti.key))ni=ei[ti.key===Tc?0:ei.length-1];else{let ri=[vd,_d].includes(ti.key);ni=lc(ei,ti.target,ri,!0)}ni&&(ni.focus({preventScroll:!0}),Es.getOrCreateInstance(ni).show())}_getChildren(){return on.find(Ac,this._parent)}_getActiveElem(){return this._getChildren().find(ti=>this._elemIsActive(ti))||null}_setInitialAttributes(ti,ei){this._setAttributeIfNotExists(ti,"role","tablist");for(let ni of ei)this._setInitialAttributesOnChild(ni)}_setInitialAttributesOnChild(ti){ti=this._getInnerElement(ti);let ei=this._elemIsActive(ti),ni=this._getOuterElement(ti);ti.setAttribute("aria-selected",ei),ni!==ti&&this._setAttributeIfNotExists(ni,"role","presentation"),ei||ti.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(ti,"role","tab"),this._setInitialAttributesOnTargetPanel(ti)}_setInitialAttributesOnTargetPanel(ti){let ei=on.getElementFromSelector(ti);!ei||(this._setAttributeIfNotExists(ei,"role","tabpanel"),ti.id&&this._setAttributeIfNotExists(ei,"aria-labelledby",`${ti.id}`))}_toggleDropDown(ti,ei){let ni=this._getOuterElement(ti);if(!ni.classList.contains($v))return;let ri=(si,ai)=>{let ci=on.findOne(si,ni);ci&&ci.classList.toggle(ai,ei)};ri(Fv,lo),ri(Bv,Cc),ni.setAttribute("aria-expanded",ei)}_setAttributeIfNotExists(ti,ei,ni){ti.hasAttribute(ei)||ti.setAttribute(ei,ni)}_elemIsActive(ti){return ti.classList.contains(lo)}_getInnerElement(ti){return ti.matches(Ac)?ti:on.findOne(Ac,ti)}_getOuterElement(ti){return ti.closest(Vv)||ti}static jQueryInterface(ti){return this.each(function(){let ei=Es.getOrCreateInstance(this);if(typeof ti=="string"){if(ei[ti]===void 0||ti.startsWith("_")||ti==="constructor")throw new TypeError(`No method named "${ti}"`);ei[ti]()}})}};Oi.on(document,Iv,Ed,function(ii){["A","AREA"].includes(this.tagName)&&ii.preventDefault(),!Hs(this)&&Es.getOrCreateInstance(this).show()});Oi.on(window,Rv,()=>{for(let ii of on.find(qv))Es.getOrCreateInstance(ii)});Ur(Es);var Wv="toast",Yv="bs.toast",$s=`.${Yv}`,Gv=`mouseover${$s}`,Kv=`mouseout${$s}`,Xv=`focusin${$s}`,Jv=`focusout${$s}`,Qv=`hide${$s}`,Zv=`hidden${$s}`,e_=`show${$s}`,t_=`shown${$s}`,i_="fade",wd="hide",Ja="show",Qa="showing",n_={animation:"boolean",autohide:"boolean",delay:"number"},r_={animation:!0,autohide:!0,delay:5e3},cs=class extends Vr{constructor(ti,ei){super(ti,ei);this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return r_}static get DefaultType(){return n_}static get NAME(){return Wv}show(){if(Oi.trigger(this._element,e_).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(i_);let ei=()=>{this._element.classList.remove(Qa),Oi.trigger(this._element,t_),this._maybeScheduleHide()};this._element.classList.remove(wd),la(this._element),this._element.classList.add(Ja,Qa),this._queueCallback(ei,this._element,this._config.animation)}hide(){if(!this.isShown()||Oi.trigger(this._element,Qv).defaultPrevented)return;let ei=()=>{this._element.classList.add(wd),this._element.classList.remove(Qa,Ja),Oi.trigger(this._element,Zv)};this._element.classList.add(Qa),this._queueCallback(ei,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Ja),super.dispose()}isShown(){return this._element.classList.contains(Ja)}_maybeScheduleHide(){!this._config.autohide||this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay))}_onInteraction(ti,ei){switch(ti.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=ei;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=ei;break}}if(ei){this._clearTimeout();return}let ni=ti.relatedTarget;this._element===ni||this._element.contains(ni)||this._maybeScheduleHide()}_setListeners(){Oi.on(this._element,Gv,ti=>this._onInteraction(ti,!0)),Oi.on(this._element,Kv,ti=>this._onInteraction(ti,!1)),Oi.on(this._element,Xv,ti=>this._onInteraction(ti,!0)),Oi.on(this._element,Jv,ti=>this._onInteraction(ti,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(ti){return this.each(function(){let ei=cs.getOrCreateInstance(this,ti);if(typeof ti=="string"){if(typeof ei[ti]=="undefined")throw new TypeError(`No method named "${ti}"`);ei[ti](this)}})}};Ua(cs);Ur(cs);var KC=Ns(xd()),XC=Ns(Za());function co(ii){return"error"in ii}function Wn(ii){let ti=["","null","undefined"];return Array.isArray(ii)?ii.length>0:typeof ii=="string"&&!ti.includes(ii)||typeof ii=="number"||typeof ii=="boolean"?!0:typeof ii=="object"&&ii!==null}function el(ii){return typeof ii!==null&&typeof ii!="undefined"}function s_(ii,ti,ei){return hs(this,null,function*(){let ni=window.CSRF_TOKEN,ri=new Headers({"X-CSRFToken":ni}),si;typeof ei!="undefined"&&(si=JSON.stringify(ei),ri.set("content-type","application/json"));let ai=yield fetch(ii,{method:ti,body:si,headers:ri,credentials:"same-origin"}),ci=ai.headers.get("Content-Type");if(typeof ci=="string"&&ci.includes("text"))return{error:yield ai.text()};let fi=yield ai.json();return!ai.ok&&Array.isArray(fi)?{error:fi.join(`
`)}:!ai.ok&&"detail"in fi?{error:fi.detail}:fi})}function jo(ii,ti){return hs(this,null,function*(){return yield s_(ii,"PATCH",ti)})}function*Ki(...ii){for(let ti of ii)for(let ei of document.querySelectorAll(ti))ei!==null&&(yield ei)}function ga(ii){return document.getElementById(ii)}function Sd(ii,ti=0){let ei=ti,ni=document.getElementById("content-title");ni!==null&&(ei+=ni.getBoundingClientRect().bottom);let ri=ii.getBoundingClientRect().top+window.pageYOffset+ei;window.scrollTo({top:ri,behavior:"smooth"})}function Td(ii,ti="select"){let ei=[];for(let ni of ii.querySelectorAll(ti))if(ni!==null){let ri={name:ni.name,options:[]};for(let si of ni.options)si.selected&&ri.options.push(si.value);ei=[...ei,ri]}return ei}function Lc(ii,ti){ii!==null&&(typeof ti=="undefined"?window.getComputedStyle(ii).display==="none"?ii.style.display="":ii.style.display="none":ti==="show"?ii.style.display="":ii.style.display="none")}function uo(ii,ti,ei){function ni(si){return!!(typeof ei=="string"&&si!==null&&si.matches(ei))}function ri(si){if(si!==null&&si.parentElement!==null&&!ni(si)){for(let ai of si.parentElement.querySelectorAll(ti))if(ai!==null)return ai;return ri(si.parentElement.parentElement)}return null}return ri(ii)}function Nc(ii,ti,ei=null,ni=[]){let ri=document.createElement(ii);if(ti!==null)for(let si of Object.keys(ti)){let ai=si,ci=ti[ai];ai in ri&&(ri[ai]=ci)}ei!==null&&ei.length>0&&ri.classList.add(...ei);for(let si of ni)ri.appendChild(si);return ri}function $o(ii,ti,ei){if(typeof ii!="string")throw new TypeError("replaceAll 'input' argument must be a string");if(typeof ti!="string"&&!(ti instanceof RegExp))throw new TypeError("replaceAll 'pattern' argument must be a string or RegExp instance");switch(typeof ei){case"boolean":ei=String(ei);break;case"number":ei=String(ei);break;case"string":break;default:throw new TypeError("replaceAll 'replacement' argument must be stringifyable")}if(ti instanceof RegExp){let ni=Array.from(new Set([...ti.flags.split(""),"g"])).join("");ti=new RegExp(ti.source,ni)}else ti=new RegExp(ti,"g");return ii.replace(ti,ei)}function o_(ii,ti){let ei=new Set;for(let ni of ti.querySelectorAll("*[name]"))ni.validity.valid?ni.classList.contains("is-invalid")&&ni.classList.remove("is-invalid"):(ei.add(ni.name),ni.classList.contains("is-invalid")||ni.classList.add("is-invalid"));if(ei.size!==0){let ni=ti.elements.namedItem(Array.from(ei)[0]);Sd(ni),ii.preventDefault()}}function Cd(){for(let ii of Ki("form")){let ti=ii.querySelectorAll("button[type=submit]");for(let ei of ti)ei.addEventListener("click",ni=>o_(ni,ii))}}function Dd(){for(let ii of Ki("a.set_field_value"))if(ii!==null){let ti=function(ei){ei.preventDefault();let ni=ii.getAttribute("data"),ri=document.getElementById(ii.target);ri!==null&&ni!==null&&(ri.value=ni)};ii.addEventListener("click",ti)}}var Ad={vlangroup:{region:{hide:["id_sitegroup","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:["id_region"]},"site group":{hide:["id_region","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:["id_sitegroup"]},site:{hide:["id_location","id_rack","id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site"]},location:{hide:["id_rack","id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site","id_location"]},rack:{hide:["id_clustergroup","id_cluster"],show:["id_region","id_sitegroup","id_site","id_location","id_rack"]},"cluster group":{hide:["id_region","id_sitegroup","id_site","id_location","id_rack","id_cluster"],show:["id_clustergroup"]},cluster:{hide:["id_region","id_sitegroup","id_site","id_location","id_rack"],show:["id_clustergroup","id_cluster"]},default:{hide:["id_region","id_sitegroup","id_site","id_location","id_rack","id_clustergroup","id_cluster"],show:[]}}},Od={vlangroup_add:"vlangroup",vlangroup_edit:"vlangroup",vlangroup_bulk_edit:"vlangroup"};function kc(ii,ti){var ei;for(let ni of Ki(ii)){let ri=(ei=ni.parentElement)==null?void 0:ei.parentElement;ri!==null&&(ti==="show"?Lc(ri,"show"):Lc(ri,"hide"))}}function Md(ii,ti){let ei=ti.options[ti.selectedIndex].innerText.toLowerCase(),ni=Od[ii];for(let[ri,si]of Object.entries(Ad[ni]))if(ei.endsWith(ri)){for(let ai of si.hide)kc(`#${ai}`,"hide");for(let ai of si.show)kc(`#${ai}`,"show");break}else for(let ai of Ad[ni].default.hide)kc(`#${ai}`,"hide")}function Ld(){for(let ii of Object.keys(Od))for(let ti of Ki(`html[data-netbox-url-name="${ii}"] #id_scope_type`))Md(ii,ti),ti.addEventListener("change",()=>Md(ii,ti))}function Nd(){for(let ii of[Cd,Dd,Ld])ii()}window.Collapse=os;window.Modal=as;window.Popover=oo;window.Toast=cs;window.Tooltip=ls;function a_(){for(let ii of Ki('[data-bs-toggle="tooltip"]'))new ls(ii,{container:"body"})}function l_(){for(let ii of Ki('[data-bs-toggle="modal"]'))new as(ii)}function Fs(ii,ti,ei,ni){let ri="mdi-alert";switch(ii){case"warning":ri="mdi-alert";break;case"success":ri="mdi-check-circle";break;case"info":ri="mdi-information";break;case"danger":ri="mdi-alert";break}let si=document.createElement("div");si.setAttribute("class","toast-container position-fixed bottom-0 end-0 m-3");let ai=document.createElement("div");ai.setAttribute("class",`toast bg-${ii}`),ai.setAttribute("role","alert"),ai.setAttribute("aria-live","assertive"),ai.setAttribute("aria-atomic","true");let ci=document.createElement("div");ci.setAttribute("class",`toast-header bg-${ii} text-body`);let fi=document.createElement("i");fi.setAttribute("class",`mdi ${ri}`);let vi=document.createElement("strong");vi.setAttribute("class","me-auto ms-1"),vi.innerText=ti;let hi=document.createElement("button");hi.setAttribute("type","button"),hi.setAttribute("class","btn-close"),hi.setAttribute("data-bs-dismiss","toast"),hi.setAttribute("aria-label","Close");let bi=document.createElement("div");if(bi.setAttribute("class","toast-body"),ci.appendChild(fi),ci.appendChild(vi),typeof ni!="undefined"){let Ti=document.createElement("small");Ti.setAttribute("class","text-muted"),ci.appendChild(Ti)}return ci.appendChild(hi),bi.innerText=ei.trim(),ai.appendChild(ci),ai.appendChild(bi),si.appendChild(ai),document.body.appendChild(si),new cs(ai)}function c_(){let{hash:ii}=location;if(ii&&ii.match(/^#tab_.+$/)){let ti=ii.replace("tab_","");for(let ei of Ki(`ul.nav.nav-tabs .nav-link[data-bs-target="${ti}"]`))new Es(ei).show()}}function u_(){let ii=document.querySelectorAll(".sidebar .accordion-item");function ti(ei){for(let ni of ii)ni!==ei?ni.classList.remove("is-open"):ni.classList.toggle("is-open")}for(let ei of ii)for(let ni of ei.querySelectorAll(".accordion-button"))ni.addEventListener("click",()=>{ti(ei)})}function d_(){for(let ii of Ki("a.image-preview")){let ti=`${Math.round(window.innerWidth/4)}px`,ei=Nc("img",{src:ii.href});ei.style.maxWidth=ti;let ni=Nc("div",null,null,[ei]);new oo(ii,{customClass:"image-preview-popover",trigger:"hover",html:!0,content:ni})}}function tl(){for(let ii of[a_,l_,c_,d_,u_])ii()}function kd(ii){let ti=ii.currentTarget,ei=document.getElementById("quicksearch_clear");Wn(ei)&&(ti.value===""?ei.classList.add("d-none"):ei.classList.remove("d-none"))}function Id(){let ii=document.getElementById("quicksearch"),ti=document.getElementById("quicksearch_clear");Wn(ii)&&(ii.addEventListener("keyup",kd,{passive:!0}),ii.addEventListener("search",kd,{passive:!0}),Wn(ti)&&ti.addEventListener("click",()=>hs(this,null,function*(){let ei=new Event("search");ii.value="",yield new Promise(ni=>setTimeout(ni,100)),ii.dispatchEvent(ei)}),{passive:!0}))}var Ic=Ns(Za());var va={plugins:{clear_button:{html:ii=>`<i class="mdi mdi-close-circle ${ii.className}" title="${ii.title}"></i>`}}};function Pd(){for(let ii of Ki("select:not(.tomselected):not(.no-ts):not([size]):not(.api-select):not(.color-select)"))new Ic.default(ii,fs(jn({},va),{maxOptions:void 0}))}function Rd(){function ii(ti,ei){return`<div><span class="dropdown-item-indicator color-label" style="background-color: #${ei(ti.value)}"></span> ${ei(ti.text)}</div>`}for(let ti of Ki("select.color-select:not(.tomselected)"))new Ic.default(ti,fs(jn({},va),{maxOptions:void 0,render:{option:ii,item:ii}}))}var f_=Ns(jd());var $d=(ii,ti)=>{if(Array.isArray(ii))ii.forEach(ti);else for(var ei in ii)ii.hasOwnProperty(ei)&&ti(ii[ei],ei)};var Fd=(ii,...ti)=>{var ei=h_(ti);ii=p_(ii),ii.map(ni=>{ei.map(ri=>{ni.classList.add(ri)})})};var h_=ii=>{var ti=[];return $d(ii,ei=>{typeof ei=="string"&&(ei=ei.trim().split(/[\11\12\14\15\40]/)),Array.isArray(ei)&&(ti=ti.concat(ei))}),ti.filter(Boolean)},p_=ii=>(Array.isArray(ii)||(ii=[ii]),ii);var lf=Ns(of()),cf=Ns(Za());function af(ii){if(Array.isArray(ii)){for(let ti of ii)if(typeof ti=="object"&&ti!==null&&"fieldName"in ti&&"queryParam"in ti)return typeof ti.fieldName=="string"&&typeof ti.queryParam=="string"}return!1}var Hc=class extends Map{queryParam(ti){let ei=this.get(ti);return typeof ei!="undefined"?ei.queryParam:null}queryValue(ti){let ei=this.get(ti);return typeof ei!="undefined"?ei.queryValue:[]}updateValue(ti,ei){let ni=this.get(ti);if(Wn(ni)){let{queryParam:ri}=ni;return this.set(ti,{queryParam:ri,queryValue:ei}),!0}return!1}addFromJson(ti){if(Wn(ti)){let ei=JSON.parse(ti);if(af(ei))for(let{queryParam:ni,fieldName:ri}of ei)this.set(ri,{queryParam:ni,queryValue:[]});else throw new Error(`Data from 'data-dynamic-params' attribute is improperly formatted: '${ti}'`)}}};var jc=class extends cf.default{constructor(ti,ei){super(ti,ei);Rn(this,"nullOption",null);Rn(this,"queryParams",new Map);Rn(this,"staticParams",new Map);Rn(this,"dynamicParams",new Hc);Rn(this,"pathValues",new Map);this.api_url=this.input.getAttribute("data-url"),this.valueField=this.input.getAttribute("ts-value-field")||this.settings.valueField,this.labelField=this.input.getAttribute("ts-label-field")||this.settings.labelField,this.disabledField=this.input.getAttribute("ts-disabled-field")||this.settings.disabledField,this.descriptionField=this.input.getAttribute("ts-description-field")||"description",this.depthField=this.input.getAttribute("ts-depth-field")||"_depth",this.parentField=this.input.getAttribute("ts-parent-field")||null,this.countField=this.input.getAttribute("ts-count-field")||null;let ni=this.input.getAttribute("data-null-option");if(ni){let ri=this.settings.valueField,si=this.settings.labelField;this.nullOption={},this.nullOption[ri]="null",this.nullOption[si]=ni}this.getStaticParams();for(let[ri,si]of this.staticParams.entries())this.queryParams.set(ri,si);this.getDynamicParams();for(let ri of this.dynamicParams.keys())this.updateQueryParams(ri);this.getPathKeys();for(let ri of this.pathValues.keys())this.updatePathValues(ri);this.addEventListeners()}load(ti){let ei=this,ni=ei.getRequestUrl(ti);ei.clearOptions(),Fd(ei.wrapper,ei.settings.loadingClass),ei.loading++,ei.nullOption&&!ti&&ei.addOption(ei.nullOption),fetch(ni).then(ri=>ri.json()).then(ri=>{let si=ri.results,ai=[];for(let ci of si){let fi=ei.getOptionFromData(ci);ai.push(fi)}return ai}).then(ri=>{ei.loadCallback(ri,[])}).catch(()=>{ei.loadCallback([],[])})}getRequestUrl(ti){let ei=this.api_url,ni={};for(let[ri,si]of this.queryParams.entries())ni[ri]=si;for(let[ri,si]of this.pathValues.entries())for(let ai of this.api_url.matchAll(new RegExp(`({{${ri}}})`,"g")))si&&(ei=$o(ei,ai[1],si.toString()));return ti&&(ni.q=[ti]),ni.brief=[!0],ni.limit=[this.settings.maxOptions],lf.default.stringifyUrl({url:ei,query:ni})}getOptionFromData(ti){let ei={id:ti[this.valueField],display:ti[this.labelField],depth:ti[this.depthField]||null,description:ti[this.descriptionField]||null};if(ti[this.parentField]){let ni=ti[this.parentField];ei.parent=ni[this.labelField]}return ti[this.countField]&&(ei.count=ti[this.countField]),ti[this.disabledField]&&(ei.disabled=ti[this.disabledField]),ei}getStaticParams(){let ti=this.input.getAttribute("data-static-params");try{if(ti){let ei=JSON.parse(ti);if(ei)for(let{queryParam:ni,queryValue:ri}of ei)Array.isArray(ri)?this.staticParams.set(ni,ri):this.staticParams.set(ni,[ri])}}catch(ei){console.group(`Unable to determine static query parameters for select field '${this.name}'`),console.warn(ei),console.groupEnd()}}getDynamicParams(){let ti=this.input.getAttribute("data-dynamic-params");try{this.dynamicParams.addFromJson(ti)}catch(ei){console.group(`Unable to determine dynamic query parameters for select field '${this.name}'`),console.warn(ei),console.groupEnd()}}getPathKeys(){for(let ti of this.api_url.matchAll(new RegExp("{{(.+)}}","g")))this.pathValues.set(ti[1],"")}updateQueryParams(ti){let ei=document.querySelector(`[name="${ti}"]`);if(ei!==null){let ni=[];if(ei.multiple?ni=Array.from(ei.options).filter(ri=>ri.selected).map(ri=>ri.value):ei.value!==""&&(ni=[ei.value]),ni.length>0){this.dynamicParams.updateValue(ti,ni);let ri=this.dynamicParams.get(ti);if(typeof ri!="undefined"){let{queryParam:si,queryValue:ai}=ri,ci=[];if(this.staticParams.has(si)){let fi=this.staticParams.get(si);typeof fi!="undefined"&&(ci=[...fi,...ai])}else ci=ai;ci.length>0?this.queryParams.set(si,ci):this.queryParams.delete(si)}}else{let ri=this.dynamicParams.queryParam(ti);ri!==null&&this.queryParams.delete(ri)}}}updatePathValues(ti){let ei=$o(ti,/^id_/i,""),ni=ga(`id_${ei}`);ni!==null&&this.api_url.includes("{{")&&Boolean(this.api_url.match(new RegExp(`({{(${ti})}})`,"g")))&&(ni.value?this.pathValues.set(ti,ni.value):this.pathValues.set(ti,""))}addEventListeners(){let ti=new Set([...this.dynamicParams.keys(),...this.pathValues.keys()]);for(let ei of ti){let ni=document.querySelector(`[name="${ei}"]`);ni!==null&&ni.addEventListener("change",ri=>this.handleEvent(ri)),this.input.addEventListener(`netbox.select.onload.${ei}`,ri=>this.handleEvent(ri))}}handleEvent(ti){let ei=ti.target;this.updateQueryParams(ei.name),this.updatePathValues(ei.name),this.clear(),this.load(this.lastValue)}};var S_="id",nl="display",T_=100;function C_(ii,ti){let ei="<div>";return typeof ii.depth=="number"&&ii.depth>0&&(ei=`${ei}${"\u2500".repeat(ii.depth)} `),ei=`${ei}${ti(ii[nl])}`,ii.parent&&(ei=`${ei} <span class="text-secondary">${ti(ii.parent)}</span>`),ii.count&&(ei=`${ei} <span class="badge">${ti(ii.count)}</span>`),ii.description&&(ei=`${ei}<br /><small class="text-secondary">${ti(ii.description)}</small>`),ei=`${ei}</div>`,ei}function D_(ii,ti){return ii.parent?`<div>${ti(ii.parent)} > ${ti(ii[nl])}</div>`:`<div>${ti(ii[nl])}<div>`}function uf(){for(let ii of Ki("select.api-select:not(.tomselected)"))new jc(ii,fs(jn({},va),{valueField:S_,labelField:nl,maxOptions:T_,searchField:[],preload:"focus",render:{option:C_,item:D_},shouldLoad:function(){return!0}}))}function rl(){Pd(),uf(),Rd()}function A_(ii){let ti=ii.getAttribute("data-url"),ei=ii.classList.contains("connected"),ni=ei?"planned":"connected";Wn(ti)&&jo(ti,{status:ni}).then(ri=>{var si;if(co(ri)){Fs("danger","Error",ri.error).show();return}else{let ai=(si=ii.parentElement)==null?void 0:si.parentElement,ci=ii.querySelector("i.mdi, span.mdi");ei?(ai.classList.remove("success"),ai.classList.add("info"),ii.classList.remove("connected","btn-warning"),ii.classList.add("btn-info"),ii.title="Mark Installed",ci.classList.remove("mdi-lan-disconnect"),ci.classList.add("mdi-lan-connect")):(ai.classList.remove("info"),ai.classList.add("success"),ii.classList.remove("btn-success"),ii.classList.add("connected","btn-warning"),ii.title="Mark Installed",ci.classList.remove("mdi-lan-connect"),ci.classList.add("mdi-lan-disconnect"))}})}function df(){for(let ii of Ki("button.cable-toggle"))ii.addEventListener("click",()=>A_(ii))}var ff=class{set(ti,ei,ni){return ti[ei]=ni,!0}get(ti,ei){return ti[ei]}has(ti,ei){return ei in ti}},sl=class{constructor(ti,ei){Rn(this,"handlers");Rn(this,"proxy");Rn(this,"options");Rn(this,"key","");if(this.options=ei,typeof this.options.key=="string"?this.key=this.options.key:this.key=this.generateStateKey(ti),this.options.persist){let ni=this.retrieve();ni!==null&&(ti=jn(jn({},ti),ni))}this.handlers=new ff,this.proxy=new Proxy(ti,this.handlers),this.options.persist&&this.save()}generateStateKey(ti){return`netbox-${window.btoa(Object.keys(ti).join("---"))}`}get(ti){return this.handlers.get(this.proxy,ti)}set(ti,ei){this.handlers.set(this.proxy,ti,ei),this.options.persist&&this.save()}all(){return this.proxy}keys(){return Object.keys(this.proxy)}values(){return Object.values(this.proxy)}save(){let ti=JSON.stringify(this.proxy);localStorage.setItem(this.key,ti)}retrieve(){let ti=localStorage.getItem(this.key);return ti!==null?JSON.parse(ti):null}};function Bs(ii,ti={}){return new sl(ii,ti)}var $c=Bs({hidden:!1},{persist:!0,key:"netbox-object-depth"});var Fc=Bs({view:"images-and-labels"},{persist:!0});var hf=Bs({element:null},{persist:!1});var pf=Bs({hidden:!0},{persist:!0,key:"netbox-secret"});function mf(ii,ti){ti.setAttribute("data-depth-indicators",ii?"hidden":"shown"),ti.innerText=ii?"Show Depth Indicators":"Hide Depth Indicators"}function gf(){for(let ii of Ki(".record-depth"))ii.style.display=""}function vf(){for(let ii of Ki(".record-depth"))ii.style.display="none"}function O_(ii,ti){let ei=ii.get("hidden");ii.set("hidden",!ei);let ni=ii.get("hidden");ni?vf():gf(),mf(ni,ti)}function _f(){let ii=$c.get("hidden");for(let ti of Ki("button.toggle-depth"))mf(ii,ti),ti.addEventListener("click",ei=>{O_($c,ei.currentTarget)},!1);ii?vf():ii||gf()}function M_(ii){let ti=Array.from(ii.options);for(let ei=1;ei<ti.length;ei++){let ni=ti[ei];ni.selected&&(ii.removeChild(ni),ii.insertBefore(ni,ii.options[ei-1]))}}function L_(ii){let ti=Array.from(ii.options);for(let ei=ti.length-2;ei>=0;ei--){let ni=ti[ei];if(ni.selected){let ri=ii.options[ei+1];ni=ii.removeChild(ni),ri=ii.replaceChild(ni,ri),ii.insertBefore(ri,ni)}}}function yf(){for(let ii of Ki("#move-option-up")){let ti=ii.getAttribute("data-target");if(ti!==null)for(let ei of Ki(`#${ti}`))ii.addEventListener("click",()=>M_(ei))}for(let ii of Ki("#move-option-down")){let ti=ii.getAttribute("data-target");if(ti!==null)for(let ei of Ki(`#${ti}`))ii.addEventListener("click",()=>L_(ei))}}function bf(ii,ti){return ii.replace(/[^\-.\w\s]/g,"").replace(/^[\s.]+|[\s.]+$/g,"").replace(/[-.\s]+/g,"-").toLowerCase().substring(0,ti)}function Ef(){let ii=document.getElementById("id_slug"),ti=document.getElementById("reslug");if(ii===null||ti===null)return;let ei=ii.getAttribute("slug-source"),ni=document.getElementById(`id_${ei}`);if(ni===null){console.error("Unable to find field for slug field.");return}let ri=ii.getAttribute("maxlength"),si=50;ri&&(si=Number(ri)),ni.addEventListener("blur",()=>{ii.value||(ii.value=bf(ni.value,si))}),ti.addEventListener("click",()=>{ii.value=bf(ni.value,si)})}function N_(ii){if(!ii.currentTarget.checked)for(let ei of Ki('input[type="checkbox"].toggle',"input#select-all"))ei.checked=!1}function k_(ii){let ti=ii.currentTarget,ei=uo(ti,"table"),ni=document.getElementById("select-all-box"),ri=document.getElementById("select-all");if(ei!==null){for(let si of ei.querySelectorAll('tr:not(.d-none) input[type="checkbox"][name="pk"]'))ti.checked?si.checked=!0:si.checked=!1;ni!==null&&(ti.checked?ni.classList.remove("d-none"):(ni.classList.add("d-none"),ri!==null&&(ri.checked=!1)))}}function wf(){for(let ii of Ki('table tr th > input[type="checkbox"].toggle'))ii.addEventListener("change",k_);for(let ii of Ki('input[type="checkbox"][name="pk"]'))ii.addEventListener("change",N_)}function xf(){var ii;(ii=window.getSelection())==null||ii.removeAllRanges()}function Sf(ii,ti){ti.set("element",ii)}function I_(ii,ti,ei){let ni=!1;for(let ri of ei){let si=ri;if(ni===!0&&(si.checked=ii.checked),ri===ti){if(ni===!0){ni=!1;return}ni=!0,si.checked=ii.checked}if(ri===ii){if(ni===!0){ni=!1;return}ni=!0}}}function P_(ii,ti){let ei=ii.target,ni=ti.get("element");if(Sf(ei,ti),!ii.shiftKey)return;if(xf(),ni===null)return Sf(ei,ti);let ri=Ki('input[type="checkbox"][name="pk"]');I_(ei,ni,ri)}function Tf(){let ii=Ki('input[type="checkbox"][name="pk"]');for(let ti of ii)ti.addEventListener("click",ei=>{xf(),ei.stopPropagation(),P_(ei,hf)})}function R_(ii){let ti=ii.querySelector("button.preview-button"),ei=ii.querySelector("textarea"),ni=ii.querySelector("div.preview");if(!Wn(ei.style.height)){let{height:ri}=ei.getBoundingClientRect();ei.style.height=`${ri}px`}ti.addEventListener("htmx:configRequest",ri=>{ri.detail.parameters={text:ei.value||""},ri.detail.headers["X-CSRFToken"]=window.CSRF_TOKEN,ni.style.minHeight=ei.style.height,ni.innerHTML=""})}function Cf(){for(let ii of document.querySelectorAll(".markdown-widget"))R_(ii)}function H_(ii,ti){ti.setAttribute("data-secret-visibility",ii?"hidden":"shown"),ti.innerText=ii?"Show Secret":"Hide Secret"}function j_(){let ii=ga("secret");if(Wn(ii)){let ti=ii.getAttribute("data-secret");Wn(ti)&&(ii.innerText=ti)}}function Df(){let ii=ga("secret");if(Wn(ii)){let ti=ii.getAttribute("data-secret");Wn(ti)&&(ii.innerText="\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022")}}function $_(ii,ti){ii.set("hidden",!ii.get("hidden"));let ei=ii.get("hidden");ei?Df():j_(),H_(ei,ti)}function Af(){Df();for(let ii of Ki("button.toggle-secret"))ii.addEventListener("click",ti=>{$_(pf,ti.currentTarget)},!1)}function ol(){for(let ii of[_f,df,Ef,wf,Tf,yf,Cf,Af])ii()}var _a="netbox-color-mode";function F_(ii){return ii==="dark"||ii==="light"}function B_(ii){return localStorage.setItem(_a,ii)}function U_(ii){var ei,ni;let ti=document.querySelector("body");ti&&ii=="dark"?ti.setAttribute("data-bs-theme","dark"):ti&&ti.setAttribute("data-bs-theme","light");for(let ri of Ki(".rack_elevation")){let si=(ni=(ei=ri.contentDocument)==null?void 0:ei.querySelector("svg"))!=null?ni:null;si!==null&&si.setAttribute(`data-${_a}`,ii)}}function Us(ii){B_(ii),U_(ii)}function V_(){let ii=localStorage.getItem(_a);ii==="light"?Us("dark"):ii==="dark"?Us("light"):console.warn("Unable to determine the current color mode")}function z_(){let ii=localStorage.getItem(_a),ti=document.documentElement.getAttribute(`data-${_a}`);if(Wn(ti)&&Wn(ii))return Us(ii);let ei="none";for(let ni of["dark","light"])if(window.matchMedia(`(prefers-color-scheme: ${ni})`).matches){ei=ni;break}if(Wn(ii)&&!Wn(ti)&&F_(ii))return Us(ii);switch(ei){case"dark":return Us("dark");case"light":return Us("light");case"none":return Us("light");default:return Us("light")}}function q_(){for(let ii of Ki("button.color-mode-toggle"))ii.addEventListener("click",V_)}function Of(){window.addEventListener("load",z_);for(let ii of[q_])ii()}function al(){let ii=document.querySelectorAll("body > div#django-messages > div.toast");for(let ti of ii)ti!==null&&new cs(ti).show()}var Lf=Ns(Mf());function ll(){for(let ii of Ki(".copy-content"))new Lf.default(ii)}var cl=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Vs={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(ii){return typeof console!="undefined"&&console.warn(ii)},getWeek:function(ii){var ti=new Date(ii.getTime());ti.setHours(0,0,0,0),ti.setDate(ti.getDate()+3-(ti.getDay()+6)%7);var ei=new Date(ti.getFullYear(),0,4);return 1+Math.round(((ti.getTime()-ei.getTime())/864e5-3+(ei.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var ul={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(ii){var ti=ii%100;if(ti>3&&ti<21)return"th";switch(ti%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},dl=ul;var xr=function(ii,ti){return ti===void 0&&(ti=2),("000"+ii).slice(ti*-1)},Nr=function(ii){return ii===!0?1:0};function Uc(ii,ti){var ei;return function(){var ni=this,ri=arguments;clearTimeout(ei),ei=setTimeout(function(){return ii.apply(ni,ri)},ti)}}var fl=function(ii){return ii instanceof Array?ii:[ii]};function Sr(ii,ti,ei){if(ei===!0)return ii.classList.add(ti);ii.classList.remove(ti)}function wn(ii,ti,ei){var ni=window.document.createElement(ii);return ti=ti||"",ei=ei||"",ni.className=ti,ei!==void 0&&(ni.textContent=ei),ni}function ba(ii){for(;ii.firstChild;)ii.removeChild(ii.firstChild)}function Vc(ii,ti){if(ti(ii))return ii;if(ii.parentNode)return Vc(ii.parentNode,ti)}function Ea(ii,ti){var ei=wn("div","numInputWrapper"),ni=wn("input","numInput "+ii),ri=wn("span","arrowUp"),si=wn("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?ni.type="number":(ni.type="text",ni.pattern="\\d*"),ti!==void 0)for(var ai in ti)ni.setAttribute(ai,ti[ai]);return ei.appendChild(ni),ei.appendChild(ri),ei.appendChild(si),ei}function kr(ii){try{if(typeof ii.composedPath=="function"){var ti=ii.composedPath();return ti[0]}return ii.target}catch(ei){return ii.target}}var zc=function(){},wa=function(ii,ti,ei){return ei.months[ti?"shorthand":"longhand"][ii]},Nf={D:zc,F:function(ii,ti,ei){ii.setMonth(ei.months.longhand.indexOf(ti))},G:function(ii,ti){ii.setHours((ii.getHours()>=12?12:0)+parseFloat(ti))},H:function(ii,ti){ii.setHours(parseFloat(ti))},J:function(ii,ti){ii.setDate(parseFloat(ti))},K:function(ii,ti,ei){ii.setHours(ii.getHours()%12+12*Nr(new RegExp(ei.amPM[1],"i").test(ti)))},M:function(ii,ti,ei){ii.setMonth(ei.months.shorthand.indexOf(ti))},S:function(ii,ti){ii.setSeconds(parseFloat(ti))},U:function(ii,ti){return new Date(parseFloat(ti)*1e3)},W:function(ii,ti,ei){var ni=parseInt(ti),ri=new Date(ii.getFullYear(),0,2+(ni-1)*7,0,0,0,0);return ri.setDate(ri.getDate()-ri.getDay()+ei.firstDayOfWeek),ri},Y:function(ii,ti){ii.setFullYear(parseFloat(ti))},Z:function(ii,ti){return new Date(ti)},d:function(ii,ti){ii.setDate(parseFloat(ti))},h:function(ii,ti){ii.setHours((ii.getHours()>=12?12:0)+parseFloat(ti))},i:function(ii,ti){ii.setMinutes(parseFloat(ti))},j:function(ii,ti){ii.setDate(parseFloat(ti))},l:zc,m:function(ii,ti){ii.setMonth(parseFloat(ti)-1)},n:function(ii,ti){ii.setMonth(parseFloat(ti)-1)},s:function(ii,ti){ii.setSeconds(parseFloat(ti))},u:function(ii,ti){return new Date(parseFloat(ti))},w:zc,y:function(ii,ti){ii.setFullYear(2e3+parseFloat(ti))}},xs={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Fo={Z:function(ii){return ii.toISOString()},D:function(ii,ti,ei){return ti.weekdays.shorthand[Fo.w(ii,ti,ei)]},F:function(ii,ti,ei){return wa(Fo.n(ii,ti,ei)-1,!1,ti)},G:function(ii,ti,ei){return xr(Fo.h(ii,ti,ei))},H:function(ii){return xr(ii.getHours())},J:function(ii,ti){return ti.ordinal!==void 0?ii.getDate()+ti.ordinal(ii.getDate()):ii.getDate()},K:function(ii,ti){return ti.amPM[Nr(ii.getHours()>11)]},M:function(ii,ti){return wa(ii.getMonth(),!0,ti)},S:function(ii){return xr(ii.getSeconds())},U:function(ii){return ii.getTime()/1e3},W:function(ii,ti,ei){return ei.getWeek(ii)},Y:function(ii){return xr(ii.getFullYear(),4)},d:function(ii){return xr(ii.getDate())},h:function(ii){return ii.getHours()%12?ii.getHours()%12:12},i:function(ii){return xr(ii.getMinutes())},j:function(ii){return ii.getDate()},l:function(ii,ti){return ti.weekdays.longhand[ii.getDay()]},m:function(ii){return xr(ii.getMonth()+1)},n:function(ii){return ii.getMonth()+1},s:function(ii){return ii.getSeconds()},u:function(ii){return ii.getTime()},w:function(ii){return ii.getDay()},y:function(ii){return String(ii.getFullYear()).substring(2)}};var qc=function(ii){var ti=ii.config,ei=ti===void 0?Vs:ti,ni=ii.l10n,ri=ni===void 0?ul:ni,si=ii.isMobile,ai=si===void 0?!1:si;return function(ci,fi,vi){var hi=vi||ri;return ei.formatDate!==void 0&&!ai?ei.formatDate(ci,fi,hi):fi.split("").map(function(bi,wi,Ti){return Fo[bi]&&Ti[wi-1]!=="\\"?Fo[bi](ci,hi,ei):bi!=="\\"?bi:""}).join("")}},hl=function(ii){var ti=ii.config,ei=ti===void 0?Vs:ti,ni=ii.l10n,ri=ni===void 0?ul:ni;return function(si,ai,ci,fi){if(!(si!==0&&!si)){var vi=fi||ri,hi,bi=si;if(si instanceof Date)hi=new Date(si.getTime());else if(typeof si!="string"&&si.toFixed!==void 0)hi=new Date(si);else if(typeof si=="string"){var wi=ai||(ei||Vs).dateFormat,Ti=String(si).trim();if(Ti==="today")hi=new Date,ci=!0;else if(ei&&ei.parseDate)hi=ei.parseDate(si,wi);else if(/Z$/.test(Ti)||/GMT$/.test(Ti))hi=new Date(si);else{for(var ki=void 0,Ci=[],Bi=0,rn=0,nn="";Bi<wi.length;Bi++){var Ji=wi[Bi],Wi=Ji==="\\",ln=wi[Bi-1]==="\\"||Wi;if(xs[Ji]&&!ln){nn+=xs[Ji];var Yi=new RegExp(nn).exec(si);Yi&&(ki=!0)&&Ci[Ji!=="Y"?"push":"unshift"]({fn:Nf[Ji],val:Yi[++rn]})}else Wi||(nn+=".")}hi=!ei||!ei.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),Ci.forEach(function(dn){var un=dn.fn,pn=dn.val;return hi=un(hi,pn,vi)||hi}),hi=ki?hi:void 0}}if(!(hi instanceof Date&&!isNaN(hi.getTime()))){ei.errorHandler(new Error("Invalid date provided: "+bi));return}return ci===!0&&hi.setHours(0,0,0,0),hi}}};function Ir(ii,ti,ei){return ei===void 0&&(ei=!0),ei!==!1?new Date(ii.getTime()).setHours(0,0,0,0)-new Date(ti.getTime()).setHours(0,0,0,0):ii.getTime()-ti.getTime()}var kf=function(ii,ti,ei){return ii>Math.min(ti,ei)&&ii<Math.max(ti,ei)},pl=function(ii,ti,ei){return ii*3600+ti*60+ei},If=function(ii){var ti=Math.floor(ii/3600),ei=(ii-ti*3600)/60;return[ti,ei,ii-ti*3600-ei*60]},Pf={DAY:864e5};function ml(ii){var ti=ii.defaultHour,ei=ii.defaultMinute,ni=ii.defaultSeconds;if(ii.minDate!==void 0){var ri=ii.minDate.getHours(),si=ii.minDate.getMinutes(),ai=ii.minDate.getSeconds();ti<ri&&(ti=ri),ti===ri&&ei<si&&(ei=si),ti===ri&&ei===si&&ni<ai&&(ni=ii.minDate.getSeconds())}if(ii.maxDate!==void 0){var ci=ii.maxDate.getHours(),fi=ii.maxDate.getMinutes();ti=Math.min(ti,ci),ti===ci&&(ei=Math.min(fi,ei)),ti===ci&&ei===fi&&(ni=ii.maxDate.getSeconds())}return{hours:ti,minutes:ei,seconds:ni}}"use strict";typeof Object.assign!="function"&&(Object.assign=function(ii){for(var ti=[],ei=1;ei<arguments.length;ei++)ti[ei-1]=arguments[ei];if(!ii)throw TypeError("Cannot convert undefined or null to object");for(var ni=function(ci){ci&&Object.keys(ci).forEach(function(fi){return ii[fi]=ci[fi]})},ri=0,si=ti;ri<si.length;ri++){var ai=si[ri];ni(ai)}return ii});var Tr=function(){return Tr=Object.assign||function(ii){for(var ti,ei=1,ni=arguments.length;ei<ni;ei++){ti=arguments[ei];for(var ri in ti)Object.prototype.hasOwnProperty.call(ti,ri)&&(ii[ri]=ti[ri])}return ii},Tr.apply(this,arguments)},Rf=function(){for(var ii=0,ti=0,ei=arguments.length;ti<ei;ti++)ii+=arguments[ti].length;for(var ni=Array(ii),ri=0,ti=0;ti<ei;ti++)for(var si=arguments[ti],ai=0,ci=si.length;ai<ci;ai++,ri++)ni[ri]=si[ai];return ni},W_=300;function Y_(ii,ti){var ei={config:Tr(Tr({},Vs),Kn.defaultConfig),l10n:dl};ei.parseDate=hl({config:ei.config,l10n:ei.l10n}),ei._handlers=[],ei.pluginElements=[],ei.loadedPlugins=[],ei._bind=Ci,ei._setHoursFromDate=wi,ei._positionCalendar=ns,ei.changeMonth=Mi,ei.changeYear=On,ei.clear=$i,ei.close=en,ei.onMouseOver=us,ei._createElement=wn,ei.createDay=Yi,ei.destroy=Ii,ei.isEnabled=In,ei.jumpToDate=nn,ei.updateValue=Jr,ei.open=Ts,ei.redraw=Ys,ei.set=mo,ei.setDate=go,ei.toggle=Ca;function ni(){ei.utils={getDaysInMonth:function(pi,gi){return pi===void 0&&(pi=ei.currentMonth),gi===void 0&&(gi=ei.currentYear),pi===1&&(gi%4==0&&gi%100!=0||gi%400==0)?29:ei.l10n.daysInMonth[pi]}}}function ri(){ei.element=ei.input=ii,ei.isOpen=!1,po(),Dn(),Xo(),kl(),ni(),ei.isMobile||ln(),rn(),(ei.selectedDates.length||ei.config.noCalendar)&&(ei.config.enableTime&&wi(ei.config.noCalendar?ei.latestSelectedDateObj:void 0),Jr(!1)),ci();var pi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!ei.isMobile&&pi&&ns(),_n("onReady")}function si(){var pi;return((pi=ei.calendarContainer)===null||pi===void 0?void 0:pi.getRootNode()).activeElement||document.activeElement}function ai(pi){return pi.bind(ei)}function ci(){var pi=ei.config;pi.weekNumbers===!1&&pi.showMonths===1||pi.noCalendar!==!0&&window.requestAnimationFrame(function(){if(ei.calendarContainer!==void 0&&(ei.calendarContainer.style.visibility="hidden",ei.calendarContainer.style.display="block"),ei.daysContainer!==void 0){var gi=(ei.days.offsetWidth+1)*pi.showMonths;ei.daysContainer.style.width=gi+"px",ei.calendarContainer.style.width=gi+(ei.weekWrapper!==void 0?ei.weekWrapper.offsetWidth:0)+"px",ei.calendarContainer.style.removeProperty("visibility"),ei.calendarContainer.style.removeProperty("display")}})}function fi(pi){if(ei.selectedDates.length===0){var gi=ei.config.minDate===void 0||Ir(new Date,ei.config.minDate)>=0?new Date:new Date(ei.config.minDate.getTime()),Ei=ml(ei.config);gi.setHours(Ei.hours,Ei.minutes,Ei.seconds,gi.getMilliseconds()),ei.selectedDates=[gi],ei.latestSelectedDateObj=gi}pi!==void 0&&pi.type!=="blur"&&Sn(pi);var xi=ei._input.value;bi(),Jr(),ei._input.value!==xi&&ei._debouncedChange()}function vi(pi,gi){return pi%12+12*Nr(gi===ei.l10n.amPM[1])}function hi(pi){switch(pi%24){case 0:case 12:return 12;default:return pi%12}}function bi(){if(!(ei.hourElement===void 0||ei.minuteElement===void 0)){var pi=(parseInt(ei.hourElement.value.slice(-2),10)||0)%24,gi=(parseInt(ei.minuteElement.value,10)||0)%60,Ei=ei.secondElement!==void 0?(parseInt(ei.secondElement.value,10)||0)%60:0;ei.amPM!==void 0&&(pi=vi(pi,ei.amPM.textContent));var xi=ei.config.minTime!==void 0||ei.config.minDate&&ei.minDateHasTime&&ei.latestSelectedDateObj&&Ir(ei.latestSelectedDateObj,ei.config.minDate,!0)===0,Ni=ei.config.maxTime!==void 0||ei.config.maxDate&&ei.maxDateHasTime&&ei.latestSelectedDateObj&&Ir(ei.latestSelectedDateObj,ei.config.maxDate,!0)===0;if(ei.config.maxTime!==void 0&&ei.config.minTime!==void 0&&ei.config.minTime>ei.config.maxTime){var Vi=pl(ei.config.minTime.getHours(),ei.config.minTime.getMinutes(),ei.config.minTime.getSeconds()),tn=pl(ei.config.maxTime.getHours(),ei.config.maxTime.getMinutes(),ei.config.maxTime.getSeconds()),Qi=pl(pi,gi,Ei);if(Qi>tn&&Qi<Vi){var hn=If(Vi);pi=hn[0],gi=hn[1],Ei=hn[2]}}else{if(Ni){var Gi=ei.config.maxTime!==void 0?ei.config.maxTime:ei.config.maxDate;pi=Math.min(pi,Gi.getHours()),pi===Gi.getHours()&&(gi=Math.min(gi,Gi.getMinutes())),gi===Gi.getMinutes()&&(Ei=Math.min(Ei,Gi.getSeconds()))}if(xi){var cn=ei.config.minTime!==void 0?ei.config.minTime:ei.config.minDate;pi=Math.max(pi,cn.getHours()),pi===cn.getHours()&&gi<cn.getMinutes()&&(gi=cn.getMinutes()),gi===cn.getMinutes()&&(Ei=Math.max(Ei,cn.getSeconds()))}}Ti(pi,gi,Ei)}}function wi(pi){var gi=pi||ei.latestSelectedDateObj;gi&&gi instanceof Date&&Ti(gi.getHours(),gi.getMinutes(),gi.getSeconds())}function Ti(pi,gi,Ei){ei.latestSelectedDateObj!==void 0&&ei.latestSelectedDateObj.setHours(pi%24,gi,Ei||0,0),!(!ei.hourElement||!ei.minuteElement||ei.isMobile)&&(ei.hourElement.value=xr(ei.config.time_24hr?pi:(12+pi)%12+12*Nr(pi%12==0)),ei.minuteElement.value=xr(gi),ei.amPM!==void 0&&(ei.amPM.textContent=ei.l10n.amPM[Nr(pi>=12)]),ei.secondElement!==void 0&&(ei.secondElement.value=xr(Ei)))}function ki(pi){var gi=kr(pi),Ei=parseInt(gi.value)+(pi.delta||0);(Ei/1e3>1||pi.key==="Enter"&&!/[^\d]/.test(Ei.toString()))&&On(Ei)}function Ci(pi,gi,Ei,xi){if(gi instanceof Array)return gi.forEach(function(Ni){return Ci(pi,Ni,Ei,xi)});if(pi instanceof Array)return pi.forEach(function(Ni){return Ci(Ni,gi,Ei,xi)});pi.addEventListener(gi,Ei,xi),ei._handlers.push({remove:function(){return pi.removeEventListener(gi,Ei,xi)}})}function Bi(){_n("onChange")}function rn(){if(ei.config.wrap&&["open","close","toggle","clear"].forEach(function(Ei){Array.prototype.forEach.call(ei.element.querySelectorAll("[data-"+Ei+"]"),function(xi){return Ci(xi,"click",ei[Ei])})}),ei.isMobile){vo();return}var pi=Uc(qs,50);if(ei._debouncedChange=Uc(Bi,W_),ei.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&Ci(ei.daysContainer,"mouseover",function(Ei){ei.config.mode==="range"&&us(kr(Ei))}),Ci(ei._input,"keydown",Er),ei.calendarContainer!==void 0&&Ci(ei.calendarContainer,"keydown",Er),!ei.config.inline&&!ei.config.static&&Ci(window,"resize",pi),window.ontouchstart!==void 0?Ci(window.document,"touchstart",fn):Ci(window.document,"mousedown",fn),Ci(window.document,"focus",fn,{capture:!0}),ei.config.clickOpens===!0&&(Ci(ei._input,"focus",ei.open),Ci(ei._input,"click",ei.open)),ei.daysContainer!==void 0&&(Ci(ei.monthNav,"click",xn),Ci(ei.monthNav,["keyup","increment"],ki),Ci(ei.daysContainer,"click",ds)),ei.timeContainer!==void 0&&ei.minuteElement!==void 0&&ei.hourElement!==void 0){var gi=function(Ei){return kr(Ei).select()};Ci(ei.timeContainer,["increment"],fi),Ci(ei.timeContainer,"blur",fi,{capture:!0}),Ci(ei.timeContainer,"click",Ji),Ci([ei.hourElement,ei.minuteElement],["focus","click"],gi),ei.secondElement!==void 0&&Ci(ei.secondElement,"focus",function(){return ei.secondElement&&ei.secondElement.select()}),ei.amPM!==void 0&&Ci(ei.amPM,"click",function(Ei){fi(Ei)})}ei.config.allowInput&&Ci(ei._input,"blur",Xn)}function nn(pi,gi){var Ei=pi!==void 0?ei.parseDate(pi):ei.latestSelectedDateObj||(ei.config.minDate&&ei.config.minDate>ei.now?ei.config.minDate:ei.config.maxDate&&ei.config.maxDate<ei.now?ei.config.maxDate:ei.now),xi=ei.currentYear,Ni=ei.currentMonth;try{Ei!==void 0&&(ei.currentYear=Ei.getFullYear(),ei.currentMonth=Ei.getMonth())}catch(Vi){Vi.message="Invalid date supplied: "+Ei,ei.config.errorHandler(Vi)}gi&&ei.currentYear!==xi&&(_n("onYearChange"),En()),gi&&(ei.currentYear!==xi||ei.currentMonth!==Ni)&&_n("onMonthChange"),ei.redraw()}function Ji(pi){var gi=kr(pi);~gi.className.indexOf("arrow")&&Wi(pi,gi.classList.contains("arrowUp")?1:-1)}function Wi(pi,gi,Ei){var xi=pi&&kr(pi),Ni=Ei||xi&&xi.parentNode&&xi.parentNode.firstChild,Vi=Os("increment");Vi.delta=gi,Ni&&Ni.dispatchEvent(Vi)}function ln(){var pi=window.document.createDocumentFragment();if(ei.calendarContainer=wn("div","flatpickr-calendar"),ei.calendarContainer.tabIndex=-1,!ei.config.noCalendar){if(pi.appendChild(ji()),ei.innerContainer=wn("div","flatpickr-innerContainer"),ei.config.weekNumbers){var gi=Pi(),Ei=gi.weekWrapper,xi=gi.weekNumbers;ei.innerContainer.appendChild(Ei),ei.weekNumbers=xi,ei.weekWrapper=Ei}ei.rContainer=wn("div","flatpickr-rContainer"),ei.rContainer.appendChild(vn()),ei.daysContainer||(ei.daysContainer=wn("div","flatpickr-days"),ei.daysContainer.tabIndex=-1),kn(),ei.rContainer.appendChild(ei.daysContainer),ei.innerContainer.appendChild(ei.rContainer),pi.appendChild(ei.innerContainer)}ei.config.enableTime&&pi.appendChild(Fi()),Sr(ei.calendarContainer,"rangeMode",ei.config.mode==="range"),Sr(ei.calendarContainer,"animate",ei.config.animate===!0),Sr(ei.calendarContainer,"multiMonth",ei.config.showMonths>1),ei.calendarContainer.appendChild(pi);var Ni=ei.config.appendTo!==void 0&&ei.config.appendTo.nodeType!==void 0;if((ei.config.inline||ei.config.static)&&(ei.calendarContainer.classList.add(ei.config.inline?"inline":"static"),ei.config.inline&&(!Ni&&ei.element.parentNode?ei.element.parentNode.insertBefore(ei.calendarContainer,ei._input.nextSibling):ei.config.appendTo!==void 0&&ei.config.appendTo.appendChild(ei.calendarContainer)),ei.config.static)){var Vi=wn("div","flatpickr-wrapper");ei.element.parentNode&&ei.element.parentNode.insertBefore(Vi,ei.element),Vi.appendChild(ei.element),ei.altInput&&Vi.appendChild(ei.altInput),Vi.appendChild(ei.calendarContainer)}!ei.config.static&&!ei.config.inline&&(ei.config.appendTo!==void 0?ei.config.appendTo:window.document.body).appendChild(ei.calendarContainer)}function Yi(pi,gi,Ei,xi){var Ni=In(gi,!0),Vi=wn("span",pi,gi.getDate().toString());return Vi.dateObj=gi,Vi.$i=xi,Vi.setAttribute("aria-label",ei.formatDate(gi,ei.config.ariaDateFormat)),pi.indexOf("hidden")===-1&&Ir(gi,ei.now)===0&&(ei.todayDateElem=Vi,Vi.classList.add("today"),Vi.setAttribute("aria-current","date")),Ni?(Vi.tabIndex=-1,Ms(gi)&&(Vi.classList.add("selected"),ei.selectedDateElem=Vi,ei.config.mode==="range"&&(Sr(Vi,"startRange",ei.selectedDates[0]&&Ir(gi,ei.selectedDates[0],!0)===0),Sr(Vi,"endRange",ei.selectedDates[1]&&Ir(gi,ei.selectedDates[1],!0)===0),pi==="nextMonthDay"&&Vi.classList.add("inRange")))):Vi.classList.add("flatpickr-disabled"),ei.config.mode==="range"&&Pl(gi)&&!Ms(gi)&&Vi.classList.add("inRange"),ei.weekNumbers&&ei.config.showMonths===1&&pi!=="prevMonthDay"&&xi%7==6&&ei.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+ei.config.getWeek(gi)+"</span>"),_n("onDayCreate",Vi),Vi}function dn(pi){pi.focus(),ei.config.mode==="range"&&us(pi)}function un(pi){for(var gi=pi>0?0:ei.config.showMonths-1,Ei=pi>0?ei.config.showMonths:-1,xi=gi;xi!=Ei;xi+=pi)for(var Ni=ei.daysContainer.children[xi],Vi=pi>0?0:Ni.children.length-1,tn=pi>0?Ni.children.length:-1,Qi=Vi;Qi!=tn;Qi+=pi){var hn=Ni.children[Qi];if(hn.className.indexOf("hidden")===-1&&In(hn.dateObj))return hn}}function pn(pi,gi){for(var Ei=pi.className.indexOf("Month")===-1?pi.dateObj.getMonth():ei.currentMonth,xi=gi>0?ei.config.showMonths:-1,Ni=gi>0?1:-1,Vi=Ei-ei.currentMonth;Vi!=xi;Vi+=Ni)for(var tn=ei.daysContainer.children[Vi],Qi=Ei-ei.currentMonth===Vi?pi.$i+gi:gi<0?tn.children.length-1:0,hn=tn.children.length,Gi=Qi;Gi>=0&&Gi<hn&&Gi!=(gi>0?hn:-1);Gi+=Ni){var cn=tn.children[Gi];if(cn.className.indexOf("hidden")===-1&&In(cn.dateObj)&&Math.abs(pi.$i-Gi)>=Math.abs(gi))return dn(cn)}ei.changeMonth(Ni),gn(un(Ni),0)}function gn(pi,gi){var Ei=si(),xi=br(Ei||document.body),Ni=pi!==void 0?pi:xi?Ei:ei.selectedDateElem!==void 0&&br(ei.selectedDateElem)?ei.selectedDateElem:ei.todayDateElem!==void 0&&br(ei.todayDateElem)?ei.todayDateElem:un(gi>0?1:-1);Ni===void 0?ei._input.focus():xi?pn(Ni,gi):dn(Ni)}function Cn(pi,gi){for(var Ei=(new Date(pi,gi,1).getDay()-ei.l10n.firstDayOfWeek+7)%7,xi=ei.utils.getDaysInMonth((gi-1+12)%12,pi),Ni=ei.utils.getDaysInMonth(gi,pi),Vi=window.document.createDocumentFragment(),tn=ei.config.showMonths>1,Qi=tn?"prevMonthDay hidden":"prevMonthDay",hn=tn?"nextMonthDay hidden":"nextMonthDay",Gi=xi+1-Ei,cn=0;Gi<=xi;Gi++,cn++)Vi.appendChild(Yi("flatpickr-day "+Qi,new Date(pi,gi-1,Gi),Gi,cn));for(Gi=1;Gi<=Ni;Gi++,cn++)Vi.appendChild(Yi("flatpickr-day",new Date(pi,gi,Gi),Gi,cn));for(var Mn=Ni+1;Mn<=42-Ei&&(ei.config.showMonths===1||cn%7!=0);Mn++,cn++)Vi.appendChild(Yi("flatpickr-day "+hn,new Date(pi,gi+1,Mn%Ni),Mn,cn));var Hr=wn("div","dayContainer");return Hr.appendChild(Vi),Hr}function kn(){if(ei.daysContainer!==void 0){ba(ei.daysContainer),ei.weekNumbers&&ba(ei.weekNumbers);for(var pi=document.createDocumentFragment(),gi=0;gi<ei.config.showMonths;gi++){var Ei=new Date(ei.currentYear,ei.currentMonth,1);Ei.setMonth(ei.currentMonth+gi),pi.appendChild(Cn(Ei.getFullYear(),Ei.getMonth()))}ei.daysContainer.appendChild(pi),ei.days=ei.daysContainer.firstChild,ei.config.mode==="range"&&ei.selectedDates.length===1&&us()}}function En(){if(!(ei.config.showMonths>1||ei.config.monthSelectorType!=="dropdown")){var pi=function(xi){return ei.config.minDate!==void 0&&ei.currentYear===ei.config.minDate.getFullYear()&&xi<ei.config.minDate.getMonth()?!1:!(ei.config.maxDate!==void 0&&ei.currentYear===ei.config.maxDate.getFullYear()&&xi>ei.config.maxDate.getMonth())};ei.monthsDropdownContainer.tabIndex=-1,ei.monthsDropdownContainer.innerHTML="";for(var gi=0;gi<12;gi++)if(!!pi(gi)){var Ei=wn("option","flatpickr-monthDropdown-month");Ei.value=new Date(ei.currentYear,gi).getMonth().toString(),Ei.textContent=wa(gi,ei.config.shorthandCurrentMonth,ei.l10n),Ei.tabIndex=-1,ei.currentMonth===gi&&(Ei.selected=!0),ei.monthsDropdownContainer.appendChild(Ei)}}}function Li(){var pi=wn("div","flatpickr-month"),gi=window.document.createDocumentFragment(),Ei;ei.config.showMonths>1||ei.config.monthSelectorType==="static"?Ei=wn("span","cur-month"):(ei.monthsDropdownContainer=wn("select","flatpickr-monthDropdown-months"),ei.monthsDropdownContainer.setAttribute("aria-label",ei.l10n.monthAriaLabel),Ci(ei.monthsDropdownContainer,"change",function(tn){var Qi=kr(tn),hn=parseInt(Qi.value,10);ei.changeMonth(hn-ei.currentMonth),_n("onMonthChange")}),En(),Ei=ei.monthsDropdownContainer);var xi=Ea("cur-year",{tabindex:"-1"}),Ni=xi.getElementsByTagName("input")[0];Ni.setAttribute("aria-label",ei.l10n.yearAriaLabel),ei.config.minDate&&Ni.setAttribute("min",ei.config.minDate.getFullYear().toString()),ei.config.maxDate&&(Ni.setAttribute("max",ei.config.maxDate.getFullYear().toString()),Ni.disabled=!!ei.config.minDate&&ei.config.minDate.getFullYear()===ei.config.maxDate.getFullYear());var Vi=wn("div","flatpickr-current-month");return Vi.appendChild(Ei),Vi.appendChild(xi),gi.appendChild(Vi),pi.appendChild(gi),{container:pi,yearElement:Ni,monthElement:Ei}}function Ui(){ba(ei.monthNav),ei.monthNav.appendChild(ei.prevMonthNav),ei.config.showMonths&&(ei.yearElements=[],ei.monthElements=[]);for(var pi=ei.config.showMonths;pi--;){var gi=Li();ei.yearElements.push(gi.yearElement),ei.monthElements.push(gi.monthElement),ei.monthNav.appendChild(gi.container)}ei.monthNav.appendChild(ei.nextMonthNav)}function ji(){return ei.monthNav=wn("div","flatpickr-months"),ei.yearElements=[],ei.monthElements=[],ei.prevMonthNav=wn("span","flatpickr-prev-month"),ei.prevMonthNav.innerHTML=ei.config.prevArrow,ei.nextMonthNav=wn("span","flatpickr-next-month"),ei.nextMonthNav.innerHTML=ei.config.nextArrow,Ui(),Object.defineProperty(ei,"_hidePrevMonthArrow",{get:function(){return ei.__hidePrevMonthArrow},set:function(pi){ei.__hidePrevMonthArrow!==pi&&(Sr(ei.prevMonthNav,"flatpickr-disabled",pi),ei.__hidePrevMonthArrow=pi)}}),Object.defineProperty(ei,"_hideNextMonthArrow",{get:function(){return ei.__hideNextMonthArrow},set:function(pi){ei.__hideNextMonthArrow!==pi&&(Sr(ei.nextMonthNav,"flatpickr-disabled",pi),ei.__hideNextMonthArrow=pi)}}),ei.currentYearElement=ei.yearElements[0],_o(),ei.monthNav}function Fi(){ei.calendarContainer.classList.add("hasTime"),ei.config.noCalendar&&ei.calendarContainer.classList.add("noCalendar");var pi=ml(ei.config);ei.timeContainer=wn("div","flatpickr-time"),ei.timeContainer.tabIndex=-1;var gi=wn("span","flatpickr-time-separator",":"),Ei=Ea("flatpickr-hour",{"aria-label":ei.l10n.hourAriaLabel});ei.hourElement=Ei.getElementsByTagName("input")[0];var xi=Ea("flatpickr-minute",{"aria-label":ei.l10n.minuteAriaLabel});if(ei.minuteElement=xi.getElementsByTagName("input")[0],ei.hourElement.tabIndex=ei.minuteElement.tabIndex=-1,ei.hourElement.value=xr(ei.latestSelectedDateObj?ei.latestSelectedDateObj.getHours():ei.config.time_24hr?pi.hours:hi(pi.hours)),ei.minuteElement.value=xr(ei.latestSelectedDateObj?ei.latestSelectedDateObj.getMinutes():pi.minutes),ei.hourElement.setAttribute("step",ei.config.hourIncrement.toString()),ei.minuteElement.setAttribute("step",ei.config.minuteIncrement.toString()),ei.hourElement.setAttribute("min",ei.config.time_24hr?"0":"1"),ei.hourElement.setAttribute("max",ei.config.time_24hr?"23":"12"),ei.hourElement.setAttribute("maxlength","2"),ei.minuteElement.setAttribute("min","0"),ei.minuteElement.setAttribute("max","59"),ei.minuteElement.setAttribute("maxlength","2"),ei.timeContainer.appendChild(Ei),ei.timeContainer.appendChild(gi),ei.timeContainer.appendChild(xi),ei.config.time_24hr&&ei.timeContainer.classList.add("time24hr"),ei.config.enableSeconds){ei.timeContainer.classList.add("hasSeconds");var Ni=Ea("flatpickr-second");ei.secondElement=Ni.getElementsByTagName("input")[0],ei.secondElement.value=xr(ei.latestSelectedDateObj?ei.latestSelectedDateObj.getSeconds():pi.seconds),ei.secondElement.setAttribute("step",ei.minuteElement.getAttribute("step")),ei.secondElement.setAttribute("min","0"),ei.secondElement.setAttribute("max","59"),ei.secondElement.setAttribute("maxlength","2"),ei.timeContainer.appendChild(wn("span","flatpickr-time-separator",":")),ei.timeContainer.appendChild(Ni)}return ei.config.time_24hr||(ei.amPM=wn("span","flatpickr-am-pm",ei.l10n.amPM[Nr((ei.latestSelectedDateObj?ei.hourElement.value:ei.config.defaultHour)>11)]),ei.amPM.title=ei.l10n.toggleTitle,ei.amPM.tabIndex=-1,ei.timeContainer.appendChild(ei.amPM)),ei.timeContainer}function vn(){ei.weekdayContainer?ba(ei.weekdayContainer):ei.weekdayContainer=wn("div","flatpickr-weekdays");for(var pi=ei.config.showMonths;pi--;){var gi=wn("div","flatpickr-weekdaycontainer");ei.weekdayContainer.appendChild(gi)}return sn(),ei.weekdayContainer}function sn(){if(!!ei.weekdayContainer){var pi=ei.l10n.firstDayOfWeek,gi=Rf(ei.l10n.weekdays.shorthand);pi>0&&pi<gi.length&&(gi=Rf(gi.splice(pi,gi.length),gi.splice(0,pi)));for(var Ei=ei.config.showMonths;Ei--;)ei.weekdayContainer.children[Ei].innerHTML=`
<span class='flatpickr-weekday'>
`+gi.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function Pi(){ei.calendarContainer.classList.add("hasWeeks");var pi=wn("div","flatpickr-weekwrapper");pi.appendChild(wn("span","flatpickr-weekday",ei.l10n.weekAbbreviation));var gi=wn("div","flatpickr-weeks");return pi.appendChild(gi),{weekWrapper:pi,weekNumbers:gi}}function Mi(pi,gi){gi===void 0&&(gi=!0);var Ei=gi?pi:pi-ei.currentMonth;Ei<0&&ei._hidePrevMonthArrow===!0||Ei>0&&ei._hideNextMonthArrow===!0||(ei.currentMonth+=Ei,(ei.currentMonth<0||ei.currentMonth>11)&&(ei.currentYear+=ei.currentMonth>11?1:-1,ei.currentMonth=(ei.currentMonth+12)%12,_n("onYearChange"),En()),kn(),_n("onMonthChange"),_o())}function $i(pi,gi){if(pi===void 0&&(pi=!0),gi===void 0&&(gi=!0),ei.input.value="",ei.altInput!==void 0&&(ei.altInput.value=""),ei.mobileInput!==void 0&&(ei.mobileInput.value=""),ei.selectedDates=[],ei.latestSelectedDateObj=void 0,gi===!0&&(ei.currentYear=ei._initialDate.getFullYear(),ei.currentMonth=ei._initialDate.getMonth()),ei.config.enableTime===!0){var Ei=ml(ei.config),xi=Ei.hours,Ni=Ei.minutes,Vi=Ei.seconds;Ti(xi,Ni,Vi)}ei.redraw(),pi&&_n("onChange")}function en(){ei.isOpen=!1,ei.isMobile||(ei.calendarContainer!==void 0&&ei.calendarContainer.classList.remove("open"),ei._input!==void 0&&ei._input.classList.remove("active")),_n("onClose")}function Ii(){ei.config!==void 0&&_n("onDestroy");for(var pi=ei._handlers.length;pi--;)ei._handlers[pi].remove();if(ei._handlers=[],ei.mobileInput)ei.mobileInput.parentNode&&ei.mobileInput.parentNode.removeChild(ei.mobileInput),ei.mobileInput=void 0;else if(ei.calendarContainer&&ei.calendarContainer.parentNode)if(ei.config.static&&ei.calendarContainer.parentNode){var gi=ei.calendarContainer.parentNode;if(gi.lastChild&&gi.removeChild(gi.lastChild),gi.parentNode){for(;gi.firstChild;)gi.parentNode.insertBefore(gi.firstChild,gi);gi.parentNode.removeChild(gi)}}else ei.calendarContainer.parentNode.removeChild(ei.calendarContainer);ei.altInput&&(ei.input.type="text",ei.altInput.parentNode&&ei.altInput.parentNode.removeChild(ei.altInput),delete ei.altInput),ei.input&&(ei.input.type=ei.input._type,ei.input.classList.remove("flatpickr-input"),ei.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(Ei){try{delete ei[Ei]}catch(xi){}})}function Ri(pi){return ei.calendarContainer.contains(pi)}function fn(pi){if(ei.isOpen&&!ei.config.inline){var gi=kr(pi),Ei=Ri(gi),xi=gi===ei.input||gi===ei.altInput||ei.element.contains(gi)||pi.path&&pi.path.indexOf&&(~pi.path.indexOf(ei.input)||~pi.path.indexOf(ei.altInput)),Ni=!xi&&!Ei&&!Ri(pi.relatedTarget),Vi=!ei.config.ignoredFocusElements.some(function(tn){return tn.contains(gi)});Ni&&Vi&&(ei.config.allowInput&&ei.setDate(ei._input.value,!1,ei.config.altInput?ei.config.altFormat:ei.config.dateFormat),ei.timeContainer!==void 0&&ei.minuteElement!==void 0&&ei.hourElement!==void 0&&ei.input.value!==""&&ei.input.value!==void 0&&fi(),ei.close(),ei.config&&ei.config.mode==="range"&&ei.selectedDates.length===1&&ei.clear(!1))}}function On(pi){if(!(!pi||ei.config.minDate&&pi<ei.config.minDate.getFullYear()||ei.config.maxDate&&pi>ei.config.maxDate.getFullYear())){var gi=pi,Ei=ei.currentYear!==gi;ei.currentYear=gi||ei.currentYear,ei.config.maxDate&&ei.currentYear===ei.config.maxDate.getFullYear()?ei.currentMonth=Math.min(ei.config.maxDate.getMonth(),ei.currentMonth):ei.config.minDate&&ei.currentYear===ei.config.minDate.getFullYear()&&(ei.currentMonth=Math.max(ei.config.minDate.getMonth(),ei.currentMonth)),Ei&&(ei.redraw(),_n("onYearChange"),En())}}function In(pi,gi){var Ei;gi===void 0&&(gi=!0);var xi=ei.parseDate(pi,void 0,gi);if(ei.config.minDate&&xi&&Ir(xi,ei.config.minDate,gi!==void 0?gi:!ei.minDateHasTime)<0||ei.config.maxDate&&xi&&Ir(xi,ei.config.maxDate,gi!==void 0?gi:!ei.maxDateHasTime)>0)return!1;if(!ei.config.enable&&ei.config.disable.length===0)return!0;if(xi===void 0)return!1;for(var Ni=!!ei.config.enable,Vi=(Ei=ei.config.enable)!==null&&Ei!==void 0?Ei:ei.config.disable,tn=0,Qi=void 0;tn<Vi.length;tn++){if(Qi=Vi[tn],typeof Qi=="function"&&Qi(xi))return Ni;if(Qi instanceof Date&&xi!==void 0&&Qi.getTime()===xi.getTime())return Ni;if(typeof Qi=="string"){var hn=ei.parseDate(Qi,void 0,!0);return hn&&hn.getTime()===xi.getTime()?Ni:!Ni}else if(typeof Qi=="object"&&xi!==void 0&&Qi.from&&Qi.to&&xi.getTime()>=Qi.from.getTime()&&xi.getTime()<=Qi.to.getTime())return Ni}return!Ni}function br(pi){return ei.daysContainer!==void 0?pi.className.indexOf("hidden")===-1&&pi.className.indexOf("flatpickr-disabled")===-1&&ei.daysContainer.contains(pi):!1}function Xn(pi){var gi=pi.target===ei._input,Ei=ei._input.value.trimEnd()!==yo();gi&&Ei&&!(pi.relatedTarget&&Ri(pi.relatedTarget))&&ei.setDate(ei._input.value,!0,pi.target===ei.altInput?ei.config.altFormat:ei.config.dateFormat)}function Er(pi){var gi=kr(pi),Ei=ei.config.wrap?ii.contains(gi):gi===ei._input,xi=ei.config.allowInput,Ni=ei.isOpen&&(!xi||!Ei),Vi=ei.config.inline&&Ei&&!xi;if(pi.keyCode===13&&Ei){if(xi)return ei.setDate(ei._input.value,!0,gi===ei.altInput?ei.config.altFormat:ei.config.dateFormat),ei.close(),gi.blur();ei.open()}else if(Ri(gi)||Ni||Vi){var tn=!!ei.timeContainer&&ei.timeContainer.contains(gi);switch(pi.keyCode){case 13:tn?(pi.preventDefault(),fi(),Ds()):ds(pi);break;case 27:pi.preventDefault(),Ds();break;case 8:case 46:Ei&&!ei.config.allowInput&&(pi.preventDefault(),ei.clear());break;case 37:case 39:if(!tn&&!Ei){pi.preventDefault();var Qi=si();if(ei.daysContainer!==void 0&&(xi===!1||Qi&&br(Qi))){var hn=pi.keyCode===39?1:-1;pi.ctrlKey?(pi.stopPropagation(),Mi(hn),gn(un(1),0)):gn(void 0,hn)}}else ei.hourElement&&ei.hourElement.focus();break;case 38:case 40:pi.preventDefault();var Gi=pi.keyCode===40?1:-1;ei.daysContainer&&gi.$i!==void 0||gi===ei.input||gi===ei.altInput?pi.ctrlKey?(pi.stopPropagation(),On(ei.currentYear-Gi),gn(un(1),0)):tn||gn(void 0,Gi*7):gi===ei.currentYearElement?On(ei.currentYear-Gi):ei.config.enableTime&&(!tn&&ei.hourElement&&ei.hourElement.focus(),fi(pi),ei._debouncedChange());break;case 9:if(tn){var cn=[ei.hourElement,ei.minuteElement,ei.secondElement,ei.amPM].concat(ei.pluginElements).filter(function(Dr){return Dr}),Mn=cn.indexOf(gi);if(Mn!==-1){var Hr=cn[Mn+(pi.shiftKey?-1:1)];pi.preventDefault(),(Hr||ei._input).focus()}}else!ei.config.noCalendar&&ei.daysContainer&&ei.daysContainer.contains(gi)&&pi.shiftKey&&(pi.preventDefault(),ei._input.focus());break;default:break}}if(ei.amPM!==void 0&&gi===ei.amPM)switch(pi.key){case ei.l10n.amPM[0].charAt(0):case ei.l10n.amPM[0].charAt(0).toLowerCase():ei.amPM.textContent=ei.l10n.amPM[0],bi(),Jr();break;case ei.l10n.amPM[1].charAt(0):case ei.l10n.amPM[1].charAt(0).toLowerCase():ei.amPM.textContent=ei.l10n.amPM[1],bi(),Jr();break}(Ei||Ri(gi))&&_n("onKeyDown",pi)}function us(pi,gi){if(gi===void 0&&(gi="flatpickr-day"),!(ei.selectedDates.length!==1||pi&&(!pi.classList.contains(gi)||pi.classList.contains("flatpickr-disabled")))){for(var Ei=pi?pi.dateObj.getTime():ei.days.firstElementChild.dateObj.getTime(),xi=ei.parseDate(ei.selectedDates[0],void 0,!0).getTime(),Ni=Math.min(Ei,ei.selectedDates[0].getTime()),Vi=Math.max(Ei,ei.selectedDates[0].getTime()),tn=!1,Qi=0,hn=0,Gi=Ni;Gi<Vi;Gi+=Pf.DAY)In(new Date(Gi),!0)||(tn=tn||Gi>Ni&&Gi<Vi,Gi<xi&&(!Qi||Gi>Qi)?Qi=Gi:Gi>xi&&(!hn||Gi<hn)&&(hn=Gi));var cn=Array.from(ei.rContainer.querySelectorAll("*:nth-child(-n+"+ei.config.showMonths+") > ."+gi));cn.forEach(function(Mn){var Hr=Mn.dateObj,Dr=Hr.getTime(),Gs=Qi>0&&Dr<Qi||hn>0&&Dr>hn;if(Gs){Mn.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Ls){Mn.classList.remove(Ls)});return}else if(tn&&!Gs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Ls){Mn.classList.remove(Ls)}),pi!==void 0&&(pi.classList.add(Ei<=ei.selectedDates[0].getTime()?"startRange":"endRange"),xi<Ei&&Dr===xi?Mn.classList.add("startRange"):xi>Ei&&Dr===xi&&Mn.classList.add("endRange"),Dr>=Qi&&(hn===0||Dr<=hn)&&kf(Dr,xi,Ei)&&Mn.classList.add("inRange"))})}}function qs(){ei.isOpen&&!ei.config.static&&!ei.config.inline&&ns()}function Ts(pi,gi){if(gi===void 0&&(gi=ei._positionElement),ei.isMobile===!0){if(pi){pi.preventDefault();var Ei=kr(pi);Ei&&Ei.blur()}ei.mobileInput!==void 0&&(ei.mobileInput.focus(),ei.mobileInput.click()),_n("onOpen");return}else if(ei._input.disabled||ei.config.inline)return;var xi=ei.isOpen;ei.isOpen=!0,xi||(ei.calendarContainer.classList.add("open"),ei._input.classList.add("active"),_n("onOpen"),ns(gi)),ei.config.enableTime===!0&&ei.config.noCalendar===!0&&ei.config.allowInput===!1&&(pi===void 0||!ei.timeContainer.contains(pi.relatedTarget))&&setTimeout(function(){return ei.hourElement.select()},50)}function Ws(pi){return function(gi){var Ei=ei.config["_"+pi+"Date"]=ei.parseDate(gi,ei.config.dateFormat),xi=ei.config["_"+(pi==="min"?"max":"min")+"Date"];Ei!==void 0&&(ei[pi==="min"?"minDateHasTime":"maxDateHasTime"]=Ei.getHours()>0||Ei.getMinutes()>0||Ei.getSeconds()>0),ei.selectedDates&&(ei.selectedDates=ei.selectedDates.filter(function(Ni){return In(Ni)}),!ei.selectedDates.length&&pi==="min"&&wi(Ei),Jr()),ei.daysContainer&&(Ys(),Ei!==void 0?ei.currentYearElement[pi]=Ei.getFullYear().toString():ei.currentYearElement.removeAttribute(pi),ei.currentYearElement.disabled=!!xi&&Ei!==void 0&&xi.getFullYear()===Ei.getFullYear())}}function po(){var pi=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],gi=Tr(Tr({},JSON.parse(JSON.stringify(ii.dataset||{}))),ti),Ei={};ei.config.parseDate=gi.parseDate,ei.config.formatDate=gi.formatDate,Object.defineProperty(ei.config,"enable",{get:function(){return ei.config._enable},set:function(cn){ei.config._enable=Ko(cn)}}),Object.defineProperty(ei.config,"disable",{get:function(){return ei.config._disable},set:function(cn){ei.config._disable=Ko(cn)}});var xi=gi.mode==="time";if(!gi.dateFormat&&(gi.enableTime||xi)){var Ni=Kn.defaultConfig.dateFormat||Vs.dateFormat;Ei.dateFormat=gi.noCalendar||xi?"H:i"+(gi.enableSeconds?":S":""):Ni+" H:i"+(gi.enableSeconds?":S":"")}if(gi.altInput&&(gi.enableTime||xi)&&!gi.altFormat){var Vi=Kn.defaultConfig.altFormat||Vs.altFormat;Ei.altFormat=gi.noCalendar||xi?"h:i"+(gi.enableSeconds?":S K":" K"):Vi+(" h:i"+(gi.enableSeconds?":S":"")+" K")}Object.defineProperty(ei.config,"minDate",{get:function(){return ei.config._minDate},set:Ws("min")}),Object.defineProperty(ei.config,"maxDate",{get:function(){return ei.config._maxDate},set:Ws("max")});var tn=function(cn){return function(Mn){ei.config[cn==="min"?"_minTime":"_maxTime"]=ei.parseDate(Mn,"H:i:S")}};Object.defineProperty(ei.config,"minTime",{get:function(){return ei.config._minTime},set:tn("min")}),Object.defineProperty(ei.config,"maxTime",{get:function(){return ei.config._maxTime},set:tn("max")}),gi.mode==="time"&&(ei.config.noCalendar=!0,ei.config.enableTime=!0),Object.assign(ei.config,Ei,gi);for(var Qi=0;Qi<pi.length;Qi++)ei.config[pi[Qi]]=ei.config[pi[Qi]]===!0||ei.config[pi[Qi]]==="true";cl.filter(function(cn){return ei.config[cn]!==void 0}).forEach(function(cn){ei.config[cn]=fl(ei.config[cn]||[]).map(ai)}),ei.isMobile=!ei.config.disableMobile&&!ei.config.inline&&ei.config.mode==="single"&&!ei.config.disable.length&&!ei.config.enable&&!ei.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Qi=0;Qi<ei.config.plugins.length;Qi++){var hn=ei.config.plugins[Qi](ei)||{};for(var Gi in hn)cl.indexOf(Gi)>-1?ei.config[Gi]=fl(hn[Gi]).map(ai).concat(ei.config[Gi]):typeof gi[Gi]=="undefined"&&(ei.config[Gi]=hn[Gi])}gi.altInputClass||(ei.config.altInputClass=is().className+" "+ei.config.altInputClass),_n("onParseConfig")}function is(){return ei.config.wrap?ii.querySelector("[data-input]"):ii}function Dn(){typeof ei.config.locale!="object"&&typeof Kn.l10ns[ei.config.locale]=="undefined"&&ei.config.errorHandler(new Error("flatpickr: invalid locale "+ei.config.locale)),ei.l10n=Tr(Tr({},Kn.l10ns.default),typeof ei.config.locale=="object"?ei.config.locale:ei.config.locale!=="default"?Kn.l10ns[ei.config.locale]:void 0),xs.D="("+ei.l10n.weekdays.shorthand.join("|")+")",xs.l="("+ei.l10n.weekdays.longhand.join("|")+")",xs.M="("+ei.l10n.months.shorthand.join("|")+")",xs.F="("+ei.l10n.months.longhand.join("|")+")",xs.K="("+ei.l10n.amPM[0]+"|"+ei.l10n.amPM[1]+"|"+ei.l10n.amPM[0].toLowerCase()+"|"+ei.l10n.amPM[1].toLowerCase()+")";var pi=Tr(Tr({},ti),JSON.parse(JSON.stringify(ii.dataset||{})));pi.time_24hr===void 0&&Kn.defaultConfig.time_24hr===void 0&&(ei.config.time_24hr=ei.l10n.time_24hr),ei.formatDate=qc(ei),ei.parseDate=hl({config:ei.config,l10n:ei.l10n})}function ns(pi){if(typeof ei.config.position=="function")return void ei.config.position(ei,pi);if(ei.calendarContainer!==void 0){_n("onPreCalendarPosition");var gi=pi||ei._positionElement,Ei=Array.prototype.reduce.call(ei.calendarContainer.children,function(di,oi){return di+oi.offsetHeight},0),xi=ei.calendarContainer.offsetWidth,Ni=ei.config.position.split(" "),Vi=Ni[0],tn=Ni.length>1?Ni[1]:null,Qi=gi.getBoundingClientRect(),hn=window.innerHeight-Qi.bottom,Gi=Vi==="above"||Vi!=="below"&&hn<Ei&&Qi.top>Ei,cn=window.pageYOffset+Qi.top+(Gi?-Ei-2:gi.offsetHeight+2);if(Sr(ei.calendarContainer,"arrowTop",!Gi),Sr(ei.calendarContainer,"arrowBottom",Gi),!ei.config.inline){var Mn=window.pageXOffset+Qi.left,Hr=!1,Dr=!1;tn==="center"?(Mn-=(xi-Qi.width)/2,Hr=!0):tn==="right"&&(Mn-=xi-Qi.width,Dr=!0),Sr(ei.calendarContainer,"arrowLeft",!Hr&&!Dr),Sr(ei.calendarContainer,"arrowCenter",Hr),Sr(ei.calendarContainer,"arrowRight",Dr);var Gs=window.document.body.offsetWidth-(window.pageXOffset+Qi.right),Ls=Mn+xi>window.document.body.offsetWidth,Rl=Gs+xi>window.document.body.offsetWidth;if(Sr(ei.calendarContainer,"rightMost",Ls),!ei.config.static)if(ei.calendarContainer.style.top=cn+"px",!Ls)ei.calendarContainer.style.left=Mn+"px",ei.calendarContainer.style.right="auto";else if(!Rl)ei.calendarContainer.style.left="auto",ei.calendarContainer.style.right=Gs+"px";else{var Jo=Kr();if(Jo===void 0)return;var Hl=window.document.body.offsetWidth,jl=Math.max(0,Hl/2-xi/2),$l=".flatpickr-calendar.centerMost:before",Fl=".flatpickr-calendar.centerMost:after",Bl=Jo.cssRules.length,Ul="{left:"+Qi.left+"px;right:auto;}";Sr(ei.calendarContainer,"rightMost",!1),Sr(ei.calendarContainer,"centerMost",!0),Jo.insertRule($l+","+Fl+Ul,Bl),ei.calendarContainer.style.left=jl+"px",ei.calendarContainer.style.right="auto"}}}}function Kr(){for(var pi=null,gi=0;gi<document.styleSheets.length;gi++){var Ei=document.styleSheets[gi];if(!!Ei.cssRules){try{Ei.cssRules}catch(xi){continue}pi=Ei;break}}return pi!=null?pi:Cs()}function Cs(){var pi=document.createElement("style");return document.head.appendChild(pi),pi.sheet}function Ys(){ei.config.noCalendar||ei.isMobile||(En(),_o(),kn())}function Ds(){ei._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(ei.close,0):ei.close()}function ds(pi){pi.preventDefault(),pi.stopPropagation();var gi=function(cn){return cn.classList&&cn.classList.contains("flatpickr-day")&&!cn.classList.contains("flatpickr-disabled")&&!cn.classList.contains("notAllowed")},Ei=Vc(kr(pi),gi);if(Ei!==void 0){var xi=Ei,Ni=ei.latestSelectedDateObj=new Date(xi.dateObj.getTime()),Vi=(Ni.getMonth()<ei.currentMonth||Ni.getMonth()>ei.currentMonth+ei.config.showMonths-1)&&ei.config.mode!=="range";if(ei.selectedDateElem=xi,ei.config.mode==="single")ei.selectedDates=[Ni];else if(ei.config.mode==="multiple"){var tn=Ms(Ni);tn?ei.selectedDates.splice(parseInt(tn),1):ei.selectedDates.push(Ni)}else ei.config.mode==="range"&&(ei.selectedDates.length===2&&ei.clear(!1,!1),ei.latestSelectedDateObj=Ni,ei.selectedDates.push(Ni),Ir(Ni,ei.selectedDates[0],!0)!==0&&ei.selectedDates.sort(function(cn,Mn){return cn.getTime()-Mn.getTime()}));if(bi(),Vi){var Qi=ei.currentYear!==Ni.getFullYear();ei.currentYear=Ni.getFullYear(),ei.currentMonth=Ni.getMonth(),Qi&&(_n("onYearChange"),En()),_n("onMonthChange")}if(_o(),kn(),Jr(),!Vi&&ei.config.mode!=="range"&&ei.config.showMonths===1?dn(xi):ei.selectedDateElem!==void 0&&ei.hourElement===void 0&&ei.selectedDateElem&&ei.selectedDateElem.focus(),ei.hourElement!==void 0&&ei.hourElement!==void 0&&ei.hourElement.focus(),ei.config.closeOnSelect){var hn=ei.config.mode==="single"&&!ei.config.enableTime,Gi=ei.config.mode==="range"&&ei.selectedDates.length===2&&!ei.config.enableTime;(hn||Gi)&&Ds()}Bi()}}var Xr={locale:[Dn,sn],showMonths:[Ui,ci,vn],minDate:[nn],maxDate:[nn],positionElement:[Il],clickOpens:[function(){ei.config.clickOpens===!0?(Ci(ei._input,"focus",ei.open),Ci(ei._input,"click",ei.open)):(ei._input.removeEventListener("focus",ei.open),ei._input.removeEventListener("click",ei.open))}]};function mo(pi,gi){if(pi!==null&&typeof pi=="object"){Object.assign(ei.config,pi);for(var Ei in pi)Xr[Ei]!==void 0&&Xr[Ei].forEach(function(xi){return xi()})}else ei.config[pi]=gi,Xr[pi]!==void 0?Xr[pi].forEach(function(xi){return xi()}):cl.indexOf(pi)>-1&&(ei.config[pi]=fl(gi));ei.redraw(),Jr(!0)}function As(pi,gi){var Ei=[];if(pi instanceof Array)Ei=pi.map(function(xi){return ei.parseDate(xi,gi)});else if(pi instanceof Date||typeof pi=="number")Ei=[ei.parseDate(pi,gi)];else if(typeof pi=="string")switch(ei.config.mode){case"single":case"time":Ei=[ei.parseDate(pi,gi)];break;case"multiple":Ei=pi.split(ei.config.conjunction).map(function(xi){return ei.parseDate(xi,gi)});break;case"range":Ei=pi.split(ei.l10n.rangeSeparator).map(function(xi){return ei.parseDate(xi,gi)});break;default:break}else ei.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(pi)));ei.selectedDates=ei.config.allowInvalidPreload?Ei:Ei.filter(function(xi){return xi instanceof Date&&In(xi,!1)}),ei.config.mode==="range"&&ei.selectedDates.sort(function(xi,Ni){return xi.getTime()-Ni.getTime()})}function go(pi,gi,Ei){if(gi===void 0&&(gi=!1),Ei===void 0&&(Ei=ei.config.dateFormat),pi!==0&&!pi||pi instanceof Array&&pi.length===0)return ei.clear(gi);As(pi,Ei),ei.latestSelectedDateObj=ei.selectedDates[ei.selectedDates.length-1],ei.redraw(),nn(void 0,gi),wi(),ei.selectedDates.length===0&&ei.clear(!1),Jr(gi),gi&&_n("onChange")}function Ko(pi){return pi.slice().map(function(gi){return typeof gi=="string"||typeof gi=="number"||gi instanceof Date?ei.parseDate(gi,void 0,!0):gi&&typeof gi=="object"&&gi.from&&gi.to?{from:ei.parseDate(gi.from,void 0),to:ei.parseDate(gi.to,void 0)}:gi}).filter(function(gi){return gi})}function kl(){ei.selectedDates=[],ei.now=ei.parseDate(ei.config.now)||new Date;var pi=ei.config.defaultDate||((ei.input.nodeName==="INPUT"||ei.input.nodeName==="TEXTAREA")&&ei.input.placeholder&&ei.input.value===ei.input.placeholder?null:ei.input.value);pi&&As(pi,ei.config.dateFormat),ei._initialDate=ei.selectedDates.length>0?ei.selectedDates[0]:ei.config.minDate&&ei.config.minDate.getTime()>ei.now.getTime()?ei.config.minDate:ei.config.maxDate&&ei.config.maxDate.getTime()<ei.now.getTime()?ei.config.maxDate:ei.now,ei.currentYear=ei._initialDate.getFullYear(),ei.currentMonth=ei._initialDate.getMonth(),ei.selectedDates.length>0&&(ei.latestSelectedDateObj=ei.selectedDates[0]),ei.config.minTime!==void 0&&(ei.config.minTime=ei.parseDate(ei.config.minTime,"H:i")),ei.config.maxTime!==void 0&&(ei.config.maxTime=ei.parseDate(ei.config.maxTime,"H:i")),ei.minDateHasTime=!!ei.config.minDate&&(ei.config.minDate.getHours()>0||ei.config.minDate.getMinutes()>0||ei.config.minDate.getSeconds()>0),ei.maxDateHasTime=!!ei.config.maxDate&&(ei.config.maxDate.getHours()>0||ei.config.maxDate.getMinutes()>0||ei.config.maxDate.getSeconds()>0)}function Xo(){if(ei.input=is(),!ei.input){ei.config.errorHandler(new Error("Invalid input element specified"));return}ei.input._type=ei.input.type,ei.input.type="text",ei.input.classList.add("flatpickr-input"),ei._input=ei.input,ei.config.altInput&&(ei.altInput=wn(ei.input.nodeName,ei.config.altInputClass),ei._input=ei.altInput,ei.altInput.placeholder=ei.input.placeholder,ei.altInput.disabled=ei.input.disabled,ei.altInput.required=ei.input.required,ei.altInput.tabIndex=ei.input.tabIndex,ei.altInput.type="text",ei.input.setAttribute("type","hidden"),!ei.config.static&&ei.input.parentNode&&ei.input.parentNode.insertBefore(ei.altInput,ei.input.nextSibling)),ei.config.allowInput||ei._input.setAttribute("readonly","readonly"),Il()}function Il(){ei._positionElement=ei.config.positionElement||ei._input}function vo(){var pi=ei.config.enableTime?ei.config.noCalendar?"time":"datetime-local":"date";ei.mobileInput=wn("input",ei.input.className+" flatpickr-mobile"),ei.mobileInput.tabIndex=1,ei.mobileInput.type=pi,ei.mobileInput.disabled=ei.input.disabled,ei.mobileInput.required=ei.input.required,ei.mobileInput.placeholder=ei.input.placeholder,ei.mobileFormatStr=pi==="datetime-local"?"Y-m-d\\TH:i:S":pi==="date"?"Y-m-d":"H:i:S",ei.selectedDates.length>0&&(ei.mobileInput.defaultValue=ei.mobileInput.value=ei.formatDate(ei.selectedDates[0],ei.mobileFormatStr)),ei.config.minDate&&(ei.mobileInput.min=ei.formatDate(ei.config.minDate,"Y-m-d")),ei.config.maxDate&&(ei.mobileInput.max=ei.formatDate(ei.config.maxDate,"Y-m-d")),ei.input.getAttribute("step")&&(ei.mobileInput.step=String(ei.input.getAttribute("step"))),ei.input.type="hidden",ei.altInput!==void 0&&(ei.altInput.type="hidden");try{ei.input.parentNode&&ei.input.parentNode.insertBefore(ei.mobileInput,ei.input.nextSibling)}catch(gi){}Ci(ei.mobileInput,"change",function(gi){ei.setDate(kr(gi).value,!1,ei.mobileFormatStr),_n("onChange"),_n("onClose")})}function Ca(pi){if(ei.isOpen===!0)return ei.close();ei.open(pi)}function _n(pi,gi){if(ei.config!==void 0){var Ei=ei.config[pi];if(Ei!==void 0&&Ei.length>0)for(var xi=0;Ei[xi]&&xi<Ei.length;xi++)Ei[xi](ei.selectedDates,ei.input.value,ei,gi);pi==="onChange"&&(ei.input.dispatchEvent(Os("change")),ei.input.dispatchEvent(Os("input")))}}function Os(pi){var gi=document.createEvent("Event");return gi.initEvent(pi,!0,!0),gi}function Ms(pi){for(var gi=0;gi<ei.selectedDates.length;gi++){var Ei=ei.selectedDates[gi];if(Ei instanceof Date&&Ir(Ei,pi)===0)return""+gi}return!1}function Pl(pi){return ei.config.mode!=="range"||ei.selectedDates.length<2?!1:Ir(pi,ei.selectedDates[0])>=0&&Ir(pi,ei.selectedDates[1])<=0}function _o(){ei.config.noCalendar||ei.isMobile||!ei.monthNav||(ei.yearElements.forEach(function(pi,gi){var Ei=new Date(ei.currentYear,ei.currentMonth,1);Ei.setMonth(ei.currentMonth+gi),ei.config.showMonths>1||ei.config.monthSelectorType==="static"?ei.monthElements[gi].textContent=wa(Ei.getMonth(),ei.config.shorthandCurrentMonth,ei.l10n)+" ":ei.monthsDropdownContainer.value=Ei.getMonth().toString(),pi.value=Ei.getFullYear().toString()}),ei._hidePrevMonthArrow=ei.config.minDate!==void 0&&(ei.currentYear===ei.config.minDate.getFullYear()?ei.currentMonth<=ei.config.minDate.getMonth():ei.currentYear<ei.config.minDate.getFullYear()),ei._hideNextMonthArrow=ei.config.maxDate!==void 0&&(ei.currentYear===ei.config.maxDate.getFullYear()?ei.currentMonth+1>ei.config.maxDate.getMonth():ei.currentYear>ei.config.maxDate.getFullYear()))}function yo(pi){var gi=pi||(ei.config.altInput?ei.config.altFormat:ei.config.dateFormat);return ei.selectedDates.map(function(Ei){return ei.formatDate(Ei,gi)}).filter(function(Ei,xi,Ni){return ei.config.mode!=="range"||ei.config.enableTime||Ni.indexOf(Ei)===xi}).join(ei.config.mode!=="range"?ei.config.conjunction:ei.l10n.rangeSeparator)}function Jr(pi){pi===void 0&&(pi=!0),ei.mobileInput!==void 0&&ei.mobileFormatStr&&(ei.mobileInput.value=ei.latestSelectedDateObj!==void 0?ei.formatDate(ei.latestSelectedDateObj,ei.mobileFormatStr):""),ei.input.value=yo(ei.config.dateFormat),ei.altInput!==void 0&&(ei.altInput.value=yo(ei.config.altFormat)),pi!==!1&&_n("onValueUpdate")}function xn(pi){var gi=kr(pi),Ei=ei.prevMonthNav.contains(gi),xi=ei.nextMonthNav.contains(gi);Ei||xi?Mi(Ei?-1:1):ei.yearElements.indexOf(gi)>=0?gi.select():gi.classList.contains("arrowUp")?ei.changeYear(ei.currentYear+1):gi.classList.contains("arrowDown")&&ei.changeYear(ei.currentYear-1)}function Sn(pi){pi.preventDefault();var gi=pi.type==="keydown",Ei=kr(pi),xi=Ei;ei.amPM!==void 0&&Ei===ei.amPM&&(ei.amPM.textContent=ei.l10n.amPM[Nr(ei.amPM.textContent===ei.l10n.amPM[0])]);var Ni=parseFloat(xi.getAttribute("min")),Vi=parseFloat(xi.getAttribute("max")),tn=parseFloat(xi.getAttribute("step")),Qi=parseInt(xi.value,10),hn=pi.delta||(gi?pi.which===38?1:-1:0),Gi=Qi+tn*hn;if(typeof xi.value!="undefined"&&xi.value.length===2){var cn=xi===ei.hourElement,Mn=xi===ei.minuteElement;Gi<Ni?(Gi=Vi+Gi+Nr(!cn)+(Nr(cn)&&Nr(!ei.amPM)),Mn&&Wi(void 0,-1,ei.hourElement)):Gi>Vi&&(Gi=xi===ei.hourElement?Gi-Vi-Nr(!ei.amPM):Ni,Mn&&Wi(void 0,1,ei.hourElement)),ei.amPM&&cn&&(tn===1?Gi+Qi===23:Math.abs(Gi-Qi)>tn)&&(ei.amPM.textContent=ei.l10n.amPM[Nr(ei.amPM.textContent===ei.l10n.amPM[0])]),xi.value=xr(Gi)}}return ri(),ei}function Bo(ii,ti){for(var ei=Array.prototype.slice.call(ii).filter(function(ai){return ai instanceof HTMLElement}),ni=[],ri=0;ri<ei.length;ri++){var si=ei[ri];try{if(si.getAttribute("data-fp-omit")!==null)continue;si._flatpickr!==void 0&&(si._flatpickr.destroy(),si._flatpickr=void 0),si._flatpickr=Y_(si,ti||{}),ni.push(si._flatpickr)}catch(ai){console.error(ai)}}return ni.length===1?ni[0]:ni}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(ii){return Bo(this,ii)},HTMLElement.prototype.flatpickr=function(ii){return Bo([this],ii)});var Kn=function(ii,ti){return typeof ii=="string"?Bo(window.document.querySelectorAll(ii),ti):ii instanceof Node?Bo([ii],ti):Bo(ii,ti)};Kn.defaultConfig={};Kn.l10ns={en:Tr({},dl),default:Tr({},dl)};Kn.localize=function(ii){Kn.l10ns.default=Tr(Tr({},Kn.l10ns.default),ii)};Kn.setDefaults=function(ii){Kn.defaultConfig=Tr(Tr({},Kn.defaultConfig),ii)};Kn.parseDate=hl({});Kn.formatDate=qc({});Kn.compareDates=Ir;typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(ii){return Bo(this,ii)});Date.prototype.fp_incr=function(ii){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof ii=="string"?parseInt(ii,10):ii))};typeof window!="undefined"&&(window.flatpickr=Kn);var gl=Kn;function Hf(){gl(".date-picker",{allowInput:!0}),gl(".datetime-picker",{allowInput:!0,enableSeconds:!0,enableTime:!0,time_24hr:!0}),gl(".time-picker",{allowInput:!0,enableSeconds:!0,enableTime:!0,noCalendar:!0,time_24hr:!0})}function G_(){for(let ii of Ki('select[name="columns"] option'))ii.selected=!0}function K_(ii){for(let ti of Ki("#id_available_columns > option"))if(ti.selected){for(let ei of Ki("#id_columns"))ei.appendChild(ti.cloneNode(!0));ti.remove()}ii.preventDefault()}function X_(ii){for(let ti of Ki("#id_columns > option"))if(ti.selected){for(let ei of Ki("#id_available_columns"))ei.appendChild(ti.cloneNode(!0));ti.remove()}ii.preventDefault()}function jf(ii,ti){return hs(this,null,function*(){return yield jo(ii,ti)})}function J_(ii){var fi,vi,hi;ii.preventDefault();let ti=ii.currentTarget,ei=ti.getAttribute("data-url");if(ei==null){Fs("danger","Error Updating Table Configuration","No API path defined for configuration form.").show();return}let ni=((fi=document.activeElement)==null?void 0:fi.getAttribute("value"))==="Reset",ri=(hi=(vi=ti.getAttribute("data-config-root"))==null?void 0:vi.split("."))!=null?hi:[];if(ni){let bi=ri.reduceRight((wi,Ti)=>({[Ti]:wi}),{});jf(ei,bi).then(wi=>{co(wi)?Fs("danger","Error Resetting Table Configuration",wi.error).show():location.reload()});return}let si=Td(ti,"select[name=columns]"),ai=Object.assign({},...si.map(bi=>({[bi.name]:bi.options}))),ci=ri.reduceRight((bi,wi)=>({[wi]:bi}),ai);jf(ei,ci).then(bi=>{co(bi)?Fs("danger","Error Updating Table Configuration",bi.error).show():location.reload()})}function $f(){for(let ii of Ki("#save_tableconfig"))ii.addEventListener("click",G_);for(let ii of Ki("#add_columns"))ii.addEventListener("click",K_);for(let ii of Ki("#remove_columns"))ii.addEventListener("click",X_);for(let ii of Ki("form.userconfigform"))ii.addEventListener("submit",J_)}function Ff(ii){return typeof ii=="string"&&["show","hide"].includes(ii)}var Uo=class extends Error{constructor(ti,ei){super(ti);Rn(this,"table");this.table=ei}},xa=class{constructor(ti,ei){Rn(this,"button");Rn(this,"rows");this.button=ti,this.rows=ei}hideRows(){for(let ti of this.rows)ti.classList.add("d-none")}set buttonState(ti){Ff(ti)&&this.button.setAttribute("data-state",ti)}get buttonState(){let ti=this.button.getAttribute("data-state");return Ff(ti)?ti:null}toggleButton(){this.buttonState==="show"?this.button.innerText=$o(this.button.innerText,"Show","Hide"):this.buttonState==="hide"&&(this.button.innerText=$o(this.button.innerHTML,"Hide","Show"))}toggleState(){this.buttonState==="show"?this.buttonState="hide":this.buttonState==="hide"&&(this.buttonState="show")}toggle(){this.toggleState(),this.toggleButton()}handleClick(ti){ti.currentTarget.isEqualNode(this.button)&&this.toggle(),this.buttonState==="hide"&&this.hideRows()}},Bf=class{constructor(ti){Rn(this,"table");Rn(this,"enabledButton");Rn(this,"disabledButton");Rn(this,"virtualButton");Rn(this,"disconnectedButton");Rn(this,"rows");this.table=ti,this.rows=this.table.querySelectorAll("tr");try{let ei=uo(this.table,"button.toggle-enabled"),ni=uo(this.table,"button.toggle-disabled"),ri=uo(this.table,"button.toggle-virtual"),si=uo(this.table,"button.toggle-disconnected");if(ei===null)throw new Uo("Table is missing a 'toggle-enabled' button.",ti);if(ni===null)throw new Uo("Table is missing a 'toggle-disabled' button.",ti);if(ri===null)throw new Uo("Table is missing a 'toggle-virtual' button.",ti);if(si===null)throw new Uo("Table is missing a 'toggle-disconnected' button.",ti);ei.addEventListener("click",ai=>this.handleClick(ai,this)),ni.addEventListener("click",ai=>this.handleClick(ai,this)),ri.addEventListener("click",ai=>this.handleClick(ai,this)),si.addEventListener("click",ai=>this.handleClick(ai,this)),this.enabledButton=new xa(ei,ti.querySelectorAll('tr[data-enabled="enabled"]')),this.disabledButton=new xa(ni,ti.querySelectorAll('tr[data-enabled="disabled"]')),this.virtualButton=new xa(ri,ti.querySelectorAll('tr[data-type="virtual"]')),this.disconnectedButton=new xa(si,ti.querySelectorAll('tr[data-connected="disconnected"]'))}catch(ei){if(ei instanceof Uo){console.debug("Table does not contain enable/disable toggle buttons");return}else throw ei}}handleClick(ti,ei){for(let ni of this.rows)ni.classList.remove("d-none");ei.enabledButton.handleClick(ti),ei.disabledButton.handleClick(ti),ei.virtualButton.handleClick(ti),ei.disconnectedButton.handleClick(ti)}};function Uf(){for(let ii of Ki("table"))new Bf(ii)}var Vf=class{constructor(ti){Rn(this,"base");Rn(this,"state");Rn(this,"activeLink",null);Rn(this,"sections",[]);this.base=ti,this.state=new sl({pinned:!0},{persist:!0,key:"netbox-sidenav"}),this.init(),this.initSectionLinks(),this.initLinks()}bodyHas(ti){return document.body.hasAttribute(`data-sidenav-${ti}`)}bodyRemove(...ti){for(let ei of ti)document.body.removeAttribute(`data-sidenav-${ei}`)}bodyAdd(...ti){for(let ei of ti)document.body.setAttribute(`data-sidenav-${ei}`,"")}init(){for(let ti of this.base.querySelectorAll(".sidenav-toggle"))ti.addEventListener("click",ei=>this.onToggle(ei));for(let ti of Ki(".sidenav-toggle-mobile"))ti.addEventListener("click",ei=>this.onMobileToggle(ei));window.innerWidth>1200&&(this.state.get("pinned")&&this.pin(),this.state.get("pinned")||this.unpin(),window.addEventListener("resize",()=>this.onResize())),window.innerWidth<1200&&(this.bodyRemove("hide"),this.bodyAdd("hidden"),window.addEventListener("resize",()=>this.onResize())),this.base.addEventListener("mouseenter",()=>this.onEnter()),this.base.addEventListener("mouseleave",()=>this.onLeave())}initLinks(){for(let ti of this.getActiveLinks())this.bodyHas("show")?this.activateLink(ti,"expand"):this.bodyHas("hidden")&&this.activateLink(ti,"collapse")}show(){this.bodyAdd("show"),this.bodyRemove("hidden","hide")}hide(){this.bodyAdd("hidden"),this.bodyRemove("pinned","show");for(let ti of this.base.querySelectorAll(".collapse"))ti.classList.remove("show")}pin(){this.bodyAdd("show","pinned"),this.bodyRemove("hidden"),this.state.set("pinned",!0)}unpin(){this.bodyRemove("pinned","show"),this.bodyAdd("hidden");for(let ti of this.base.querySelectorAll(".collapse"))ti.classList.remove("show");this.state.set("pinned",!1)}handleSectionClick(ti){ti.preventDefault();let ei=ti.target;this.activeLink=ei,this.closeInactiveSections()}closeInactiveSections(){for(let[ti,ei]of this.sections)ti!==this.activeLink&&(ti.classList.add("collapsed"),ti.setAttribute("aria-expanded","false"),ei.hide())}initSectionLinks(){for(let ti of Ki(".navbar-nav .nav-item .nav-link[data-bs-toggle]"))if(ti.parentElement!==null){let ei=ti.parentElement.querySelector(".collapse");if(ei!==null){let ni=new os(ei,{toggle:!1});this.sections.push([ti,ni]),ti.addEventListener("click",ri=>this.handleSectionClick(ri))}}}activateLink(ti,ei){var ri;let ni=ti.closest(".dropdown-menu");if(el(ni)){let si=ni.parentElement,ai=(ri=ni.parentElement)==null?void 0:ri.querySelector(".nav-link");if(el(ai)&&el(si))switch(ei){case"expand":ai.setAttribute("aria-expanded","true"),si.classList.add("active"),ni.classList.add("show"),ti.classList.add("active");break;case"collapse":ai.setAttribute("aria-expanded","false"),si.classList.remove("active"),ni.classList.remove("show"),ti.classList.remove("active");break}}}*getActiveLinks(){for(let ti of this.base.querySelectorAll("ul.navbar-nav .nav-item .dropdown-item")){let ei=ti.querySelector("a");if(ei){let ni=new RegExp(ei.href,"gi");window.location.href.match(ni)&&(yield ti)}}}onEnter(){if(!this.bodyHas("pinned")){this.bodyRemove("hide","hidden"),this.bodyAdd("show");for(let ti of this.getActiveLinks())this.activateLink(ti,"expand")}}onLeave(){if(!this.bodyHas("pinned")){this.bodyRemove("show"),this.bodyAdd("hide");for(let ti of this.getActiveLinks())this.activateLink(ti,"collapse");this.bodyRemove("hide"),this.bodyAdd("hidden")}}onResize(){this.bodyHas("show")&&!this.bodyHas("pinned")&&(this.bodyRemove("show"),this.bodyAdd("hidden"))}onToggle(ti){ti.preventDefault(),this.state.get("pinned")?this.unpin():this.pin()}onMobileToggle(ti){ti.preventDefault(),this.bodyHas("hidden")?this.show():this.hide()}};function zf(){for(let ii of Ki(".navbar"))new Vf(ii)}var ih=Ns(th());function by(){let ii=document.getElementById("dashboard");ii&&ii.gridstack.disable()}function Ey(){let ii=document.getElementById("dashboard");ii&&ii.gridstack.enable()}function wy(ii,ti){return hs(this,null,function*(){return yield jo(ii,{layout:ti})})}function nh(){if(document.getElementById("dashboard")==null)return;let ti=ih.GridStack.init({cellHeight:100,disableDrag:!0,disableResize:!0,draggable:{handle:".grid-stack-item-content .card-header",appendTo:"body",scroll:!0}}),ei=document.getElementById("lock_dashboard");ei&&ei.addEventListener("click",()=>{by()});let ni=document.getElementById("unlock_dashboard");ni&&ni.addEventListener("click",()=>{Ey()});let ri=document.getElementById("save_dashboard");ri!==null&&ri.addEventListener("click",()=>{let si=ri.getAttribute("data-url");if(si==null)return;let ai=ti.save(!1);wy(si,ai).then(ci=>{co(ci)?Fs("danger","Error Saving Dashboard Config",ci.error).show():location.reload()})})}function rh(ii,ti){switch(ii){case"images-and-labels":{Qc("image.device-image",ti),Qc("text.device-image-label",ti);break}case"images-only":{Qc("image.device-image",ti),Zc("text.device-image-label",ti);break}case"labels-only":{Zc("image.device-image",ti),Zc("text.device-image-label",ti);break}}}function Qc(ii,ti){var ni,ri;let ei=(ri=(ni=ti.contentDocument)==null?void 0:ni.querySelectorAll(ii))!=null?ri:[];for(let si of ei)si.classList.remove("hidden")}function Zc(ii,ti){var ni,ri;let ei=(ri=(ni=ti.contentDocument)==null?void 0:ni.querySelectorAll(ii))!=null?ri:[];for(let si of ei)si.classList.add("hidden")}function xy(ii,ti){ti.set("view",ii);for(let ei of Ki(".rack_elevation"))rh(ii,ei)}function sh(){let ii=Fc.get("view");for(let ti of Ki("select.rack-view"))ti.selectedIndex=[...ti.options].findIndex(ei=>ei.value==ii),ti.addEventListener("change",ei=>{xy(ei.currentTarget.value,Fc)},!1);for(let ti of Ki(".rack_elevation"))ti.addEventListener("load",()=>{rh(ii,ti)})}function Sy(ii){let ti=document.getElementById("selector_results");if(ti==null)return;let ei=ti.getAttribute("data-selector-target");if(ei==null)return;let ni=document.getElementById(ei);if(ni==null)return;let ri=ii.getAttribute("data-label"),si=ii.getAttribute("data-value");ni.tomselect.addOption({id:si,display:ri}),ni.tomselect.addItem(si)}function oh(){for(let ii of Ki("#selector_results a"))ii.addEventListener("click",()=>Sy(ii))}function Ty(){for(let ii of[ol,ll,rl,oh,tl,al])ii()}function ah(){document.addEventListener("htmx:afterSettle",Ty)}function lh(){for(let ii of[tl,Of,al,Nd,Id,rl,Hf,ol,ll,$f,Uf,zf,nh,sh,ah])ii()}function Cy(){let ii=document.forms;for(let ei of ii)ei.method.toUpperCase()=="GET"&&ei.addEventListener("formdata",function(ni){let ri=ni.formData;for(let[si,ai]of Array.from(ri.entries()))ai===""&&ri.delete(si)});let ti=document.querySelector(".content-container");ti!==null&&ti.focus()}window.addEventListener("load",Cy);document.readyState!=="loading"?lh():document.addEventListener("DOMContentLoaded",lh);})();
/*!
* Bootstrap v5.3.1 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* GridStack 7.2.3
* https://gridstackjs.com/
*
* Copyright (c) 2021-2022 Alain Dumesny
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
*/
/*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
/*! @orchidjs/unicode-variants | https://github.com/orchidjs/unicode-variants | Apache License (v2) */
/*! sifter.js | https://github.com/orchidjs/sifter.js | Apache License (v2) */