@contributte/datagrid 7.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
- const t=t=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()};class e extends Error{}const i=(t,i)=>{if(!t){throw new e("Assertion failed.")}};class n extends EventTarget{constructor(t){super(),this.naja=t,this.selector=".ajax",this.allowedOrigins=[window.location.origin],this.handler=this.handleUI.bind(this),t.addEventListener("init",this.initialize.bind(this))}initialize(){t((()=>this.bindUI(window.document.body))),this.naja.snippetHandler.addEventListener("afterUpdate",(t=>{const{snippet:e}=t.detail;this.bindUI(e)}))}bindUI(t){const e=[`a${this.selector}`,`input[type="submit"]${this.selector}`,`input[type="image"]${this.selector}`,`button[type="submit"]${this.selector}`,`form${this.selector} input[type="submit"]`,`form${this.selector} input[type="image"]`,`form${this.selector} button[type="submit"]`].join(", "),i=t=>{t.removeEventListener("click",this.handler),t.addEventListener("click",this.handler)},n=t.querySelectorAll(e);for(let t=0;t<n.length;t++)i(n.item(t));t.matches(e)&&i(t);const r=t=>{t.removeEventListener("submit",this.handler),t.addEventListener("submit",this.handler)};t.matches(`form${this.selector}`)&&r(t);const s=t.querySelectorAll(`form${this.selector}`);for(let t=0;t<s.length;t++)r(s.item(t))}handleUI(t){const e=t;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey||e.button)return;const i=t.currentTarget,n=this.naja.prepareOptions(),r=()=>{};"submit"===t.type?this.submitForm(i,n,t).catch(r):"click"===t.type&&this.clickElement(i,n,e).catch(r)}async clickElement(t,e={},n){let r,s="GET",o="";if(!this.dispatchEvent(new CustomEvent("interaction",{cancelable:!0,detail:{element:t,originalEvent:n,options:e}})))return n?.preventDefault(),{};if("A"===t.tagName)i(t instanceof HTMLAnchorElement),s="GET",o=t.href,r=null;else if("INPUT"===t.tagName||"BUTTON"===t.tagName){i(t instanceof HTMLInputElement||t instanceof HTMLButtonElement);const{form:e}=t;if(s=t.getAttribute("formmethod")?.toUpperCase()??e?.getAttribute("method")?.toUpperCase()??"GET",o=t.getAttribute("formaction")??e?.getAttribute("action")??window.location.pathname+window.location.search,r=new FormData(e??void 0),"submit"===t.type&&""!==t.name)r.append(t.name,t.value||"");else if("image"===t.type){const e=t.getBoundingClientRect(),i=""!==t.name?`${t.name}.`:"";r.append(`${i}x`,Math.max(0,Math.floor(void 0!==n?n.pageX-e.left:0))),r.append(`${i}y`,Math.max(0,Math.floor(void 0!==n?n.pageY-e.top:0)))}}if(!this.isUrlAllowed(o))throw new Error(`Cannot dispatch async request, URL is not allowed: ${o}`);return n?.preventDefault(),this.naja.makeRequest(s,o,r,e)}async submitForm(t,e={},i){if(!this.dispatchEvent(new CustomEvent("interaction",{cancelable:!0,detail:{element:t,originalEvent:i,options:e}})))return i?.preventDefault(),{};const n=t.getAttribute("method")?.toUpperCase()??"GET",r=t.getAttribute("action")??window.location.pathname+window.location.search,s=new FormData(t);if(!this.isUrlAllowed(r))throw new Error(`Cannot dispatch async request, URL is not allowed: ${r}`);return i?.preventDefault(),this.naja.makeRequest(n,r,s,e)}isUrlAllowed(t){const e=new URL(t,location.href);return"null"!==e.origin&&this.allowedOrigins.includes(e.origin)}}class r{constructor(t){this.naja=t,t.addEventListener("init",this.initialize.bind(this)),t.uiHandler.addEventListener("interaction",this.processForm.bind(this))}initialize(){t((()=>this.initForms(window.document.body))),this.naja.snippetHandler.addEventListener("afterUpdate",(t=>{const{snippet:e}=t.detail;this.initForms(e)}))}initForms(t){const e=this.netteForms||window.Nette;if(e){"form"===t.tagName&&e.initForm(t);const i=t.querySelectorAll("form");for(let t=0;t<i.length;t++)e.initForm(i.item(t))}}processForm(t){const{element:e,originalEvent:i}=t.detail,n=e;void 0!==n.form&&null!==n.form&&(n.form["nette-submittedBy"]=e);const r=this.netteForms||window.Nette;"FORM"!==e.tagName&&!e.form||!r||r.validateForm(e)||(i&&(i.stopImmediatePropagation(),i.preventDefault()),t.preventDefault())}}class s extends EventTarget{constructor(t){super(),this.naja=t,t.uiHandler.addEventListener("interaction",(t=>{const{element:e,options:i}=t.detail;if(e&&(e.hasAttribute("data-naja-force-redirect")||e.form?.hasAttribute("data-naja-force-redirect"))){const t=e.getAttribute("data-naja-force-redirect")??e.form?.getAttribute("data-naja-force-redirect");i.forceRedirect="off"!==t}})),t.addEventListener("success",(t=>{const{payload:e,options:i}=t.detail;e.redirect&&(this.makeRedirect(e.redirect,i.forceRedirect??!1,i),t.stopImmediatePropagation())})),this.locationAdapter={assign:t=>window.location.assign(t)}}makeRedirect(t,e,i={}){t instanceof URL&&(t=t.href);let n=e||!this.naja.uiHandler.isUrlAllowed(t);this.dispatchEvent(new CustomEvent("redirect",{cancelable:!0,detail:{url:t,setUrl(e){t=e},isHardRedirect:n,setHardRedirect(t){n=!!t},options:i}}))&&(n?this.locationAdapter.assign(t):this.naja.makeRequest("GET",t,null,i))}}class o extends EventTarget{constructor(t){super(),this.naja=t,this.op={replace:(t,e)=>{t.innerHTML=e},prepend:(t,e)=>t.insertAdjacentHTML("afterbegin",e),append:(t,e)=>t.insertAdjacentHTML("beforeend",e)},t.addEventListener("success",(t=>{const{options:e,payload:i}=t.detail;i.snippets&&this.updateSnippets(i.snippets,!1,e)}))}static findSnippets(t){const e={},i=window.document.querySelectorAll('[id^="snippet-"]');for(let n=0;n<i.length;n++){const r=i.item(n);(t?.(r)??1)&&(e[r.id]=r.innerHTML)}return e}updateSnippets(t,e=!1,i={}){Object.keys(t).forEach((n=>{const r=document.getElementById(n);r&&this.updateSnippet(r,t[n],e,i)}))}updateSnippet(t,e,i,n){let r=this.op.replace;!t.hasAttribute("data-naja-snippet-prepend")&&!t.hasAttribute("data-ajax-prepend")||i?!t.hasAttribute("data-naja-snippet-append")&&!t.hasAttribute("data-ajax-append")||i||(r=this.op.append):r=this.op.prepend;this.dispatchEvent(new CustomEvent("beforeUpdate",{cancelable:!0,detail:{snippet:t,content:e,fromCache:i,operation:r,changeOperation(t){r=t},options:n}}))&&("title"===t.tagName.toLowerCase()?document.title=e:r(t,e),this.dispatchEvent(new CustomEvent("afterUpdate",{cancelable:!0,detail:{snippet:t,content:e,fromCache:i,operation:r,options:n}})))}}class a extends EventTarget{constructor(t){super(),this.naja=t,this.initialized=!1,this.cursor=0,this.popStateHandler=this.handlePopState.bind(this),t.addEventListener("init",this.initialize.bind(this)),t.addEventListener("before",this.saveUrl.bind(this)),t.addEventListener("before",this.replaceInitialState.bind(this)),t.addEventListener("success",this.pushNewState.bind(this)),t.redirectHandler.addEventListener("redirect",this.saveRedirectedUrl.bind(this)),t.uiHandler.addEventListener("interaction",this.configureMode.bind(this)),this.historyAdapter={replaceState:(t,e,i)=>window.history.replaceState(t,e,i),pushState:(t,e,i)=>window.history.pushState(t,e,i)}}set uiCache(t){console.warn("Naja: HistoryHandler.uiCache is deprecated, use options.snippetCache instead."),this.naja.defaultOptions.snippetCache=t}handlePopState(t){const{state:e}=t;if("naja"!==e?.source)return;const i=e.cursor-this.cursor;this.cursor=e.cursor;const n=this.naja.prepareOptions();this.dispatchEvent(new CustomEvent("restoreState",{detail:{state:e,direction:i,options:n}}))}initialize(){window.addEventListener("popstate",this.popStateHandler)}saveUrl(t){const{url:e,options:i}=t.detail;i.href??=e}saveRedirectedUrl(t){const{url:e,options:i}=t.detail;i.href=e}replaceInitialState(e){const{options:i}=e.detail;!1===a.normalizeMode(i.history)||this.initialized||(t((()=>this.historyAdapter.replaceState(this.buildState(window.location.href,"replace",this.cursor,i),window.document.title,window.location.href))),this.initialized=!0)}configureMode(t){const{element:e,options:i}=t.detail;if(e&&(e.hasAttribute("data-naja-history")||e.form?.hasAttribute("data-naja-history"))){const t=e.getAttribute("data-naja-history")??e.form?.getAttribute("data-naja-history");i.history=a.normalizeMode(t)}}static normalizeMode(t){return"off"!==t&&!1!==t&&("replace"!==t||"replace")}pushNewState(t){const{payload:e,options:i}=t.detail,n=a.normalizeMode(i.history);if(!1===n)return;e.postGet&&e.url&&(i.href=e.url);const r="replace"===n?"replaceState":"pushState",s="replace"===n?this.cursor:++this.cursor;this.historyAdapter[r](this.buildState(i.href,n,s,i),window.document.title,i.href)}buildState(t,e,i,n){const r={source:"naja",cursor:i,href:t};return this.dispatchEvent(new CustomEvent("buildState",{detail:{state:r,operation:"replace"===e?"replaceState":"pushState",options:n}})),r}}class l extends EventTarget{constructor(t){super(),this.naja=t,this.storages={off:new c(t),history:new d,session:new u},t.uiHandler.addEventListener("interaction",this.configureCache.bind(this)),t.historyHandler.addEventListener("buildState",this.buildHistoryState.bind(this)),t.historyHandler.addEventListener("restoreState",this.restoreHistoryState.bind(this))}resolveStorage(t){let e;return e=!0===t||void 0===t?"history":!1===t?"off":t,this.storages[e]}configureCache(t){const{element:e,options:i}=t.detail;if(e&&(e.hasAttribute("data-naja-snippet-cache")||e.form?.hasAttribute("data-naja-snippet-cache")||e.hasAttribute("data-naja-history-cache")||e.form?.hasAttribute("data-naja-history-cache"))){const t=e.getAttribute("data-naja-snippet-cache")??e.form?.getAttribute("data-naja-snippet-cache")??e.getAttribute("data-naja-history-cache")??e.form?.getAttribute("data-naja-history-cache");i.snippetCache=t}}buildHistoryState(t){const{state:e,options:i}=t.detail;"historyUiCache"in i&&(console.warn("Naja: options.historyUiCache is deprecated, use options.snippetCache instead."),i.snippetCache=i.historyUiCache);const n=o.findSnippets((t=>!(t.hasAttribute("data-naja-history-nocache")||t.hasAttribute("data-history-nocache")||t.hasAttribute("data-naja-snippet-cache")&&"off"===t.getAttribute("data-naja-snippet-cache"))));if(!this.dispatchEvent(new CustomEvent("store",{cancelable:!0,detail:{snippets:n,state:e,options:i}})))return;const r=this.resolveStorage(i.snippetCache);e.snippets={storage:r.type,key:r.store(n)}}restoreHistoryState(t){const{state:e,options:i}=t.detail;if(void 0===e.snippets)return;if(i.snippetCache=e.snippets.storage,!this.dispatchEvent(new CustomEvent("fetch",{cancelable:!0,detail:{state:e,options:i}})))return;const n=this.resolveStorage(i.snippetCache).fetch(e.snippets.key,e,i);null!==n&&this.dispatchEvent(new CustomEvent("restore",{cancelable:!0,detail:{snippets:n,state:e,options:i}}))&&this.naja.snippetHandler.updateSnippets(n,!0,i)}}class c{constructor(t){this.naja=t,this.type="off"}store(){return null}fetch(t,e,i){return this.naja.makeRequest("GET",e.href,null,{...i,history:!1,snippetCache:!1}),null}}class d{constructor(){this.type="history"}store(t){return t}fetch(t){return t}}class u{constructor(){this.type="session"}store(t){const e=Math.random().toString(36).substring(2,8);return window.sessionStorage.setItem(e,JSON.stringify(t)),e}fetch(t){const e=window.sessionStorage.getItem(t);return null===e?null:JSON.parse(e)}}class h{constructor(e){this.loadedScripts=new Set,e.addEventListener("init",(()=>{t((()=>{document.querySelectorAll("script[data-naja-script-id]").forEach((t=>{const e=t.getAttribute("data-naja-script-id");null!==e&&""!==e&&this.loadedScripts.add(e)}))})),e.snippetHandler.addEventListener("afterUpdate",(t=>{const{content:e}=t.detail;this.loadScripts(e)}))}))}loadScripts(t){"string"!=typeof t?Object.keys(t).forEach((e=>{const i=t[e];this.loadScriptsInSnippet(i)})):this.loadScriptsInSnippet(t)}loadScriptsInSnippet(t){if(!/<script/i.test(t))return;const e=window.document.createElement("div");e.innerHTML=t;const i=e.querySelectorAll("script");for(let t=0;t<i.length;t++){const e=i.item(t),n=e.getAttribute("data-naja-script-id");if(null!==n&&""!==n&&this.loadedScripts.has(n))continue;const r=window.document.createElement("script");if(r.innerHTML=e.innerHTML,e.hasAttributes()){const t=e.attributes;for(let e=0;e<t.length;e++){const i=t[e].name;r.setAttribute(i,t[e].value)}}window.document.head.appendChild(r).parentNode.removeChild(r),null!==n&&""!==n&&this.loadedScripts.add(n)}}}class p extends EventTarget{constructor(t,e,i,c,d,u,p){super(),this.VERSION=2,this.initialized=!1,this.extensions=[],this.defaultOptions={},this.uiHandler=new(t??n)(this),this.redirectHandler=new(e??s)(this),this.snippetHandler=new(i??o)(this),this.formsHandler=new(c??r)(this),this.historyHandler=new(d??a)(this),this.snippetCache=new(u??l)(this),this.scriptLoader=new(p??h)(this)}registerExtension(t){this.initialized&&t.initialize(this),this.extensions.push(t)}initialize(t={}){if(this.initialized)throw new Error("Cannot initialize Naja, it is already initialized.");this.defaultOptions=this.prepareOptions(t),this.extensions.forEach((t=>t.initialize(this))),this.dispatchEvent(new CustomEvent("init",{detail:{defaultOptions:this.defaultOptions}})),this.initialized=!0}prepareOptions(t){return{...this.defaultOptions,...t,fetch:{...this.defaultOptions.fetch,...t?.fetch}}}async makeRequest(t,e,i=null,n={}){"string"==typeof e&&(e=new URL(e,location.href)),n=this.prepareOptions(n);const r=new Headers(n.fetch.headers||{}),s=this.transformData(e,t,i),o=new AbortController,a=new Request(e.toString(),{credentials:"same-origin",...n.fetch,method:t,headers:r,body:s,signal:o.signal});if(a.headers.set("X-Requested-With","XMLHttpRequest"),a.headers.set("Accept","application/json"),!this.dispatchEvent(new CustomEvent("before",{cancelable:!0,detail:{request:a,method:t,url:e.toString(),data:i,options:n}})))return{};const l=window.fetch(a);let c,d;this.dispatchEvent(new CustomEvent("start",{detail:{request:a,promise:l,abortController:o,options:n}}));try{if(c=await l,!c.ok)throw new f(c);d=await c.json()}catch(t){if("AbortError"===t.name)return this.dispatchEvent(new CustomEvent("abort",{detail:{request:a,error:t,options:n}})),this.dispatchEvent(new CustomEvent("complete",{detail:{request:a,response:c,payload:void 0,error:t,options:n}})),{};throw this.dispatchEvent(new CustomEvent("error",{detail:{request:a,response:c,error:t,options:n}})),this.dispatchEvent(new CustomEvent("complete",{detail:{request:a,response:c,payload:void 0,error:t,options:n}})),t}return this.dispatchEvent(new CustomEvent("payload",{detail:{request:a,response:c,payload:d,options:n}})),this.dispatchEvent(new CustomEvent("success",{detail:{request:a,response:c,payload:d,options:n}})),this.dispatchEvent(new CustomEvent("complete",{detail:{request:a,response:c,payload:d,error:void 0,options:n}})),d}appendToQueryString(t,e,i){if(null!=i)if(Array.isArray(i)||Object.getPrototypeOf(i)===Object.prototype)for(const[n,r]of Object.entries(i))this.appendToQueryString(t,`${e}[${n}]`,r);else t.append(e,String(i))}transformData(t,e,i){const n=["GET","HEAD"].includes(e.toUpperCase());if(n&&i instanceof FormData){for(const[e,n]of i)null!=n&&t.searchParams.append(e,String(n));return null}if(null!==i&&Object.getPrototypeOf(i)===Object.prototype||Array.isArray(i)){const e=n?t.searchParams:new URLSearchParams;for(const[t,n]of Object.entries(i))this.appendToQueryString(e,t,n);return n?null:e}return i}}class f extends Error{constructor(t){const e=`HTTP ${t.status}: ${t.statusText}`;super(e),this.name=this.constructor.name,this.stack=new Error(e).stack,this.response=t}}const g=new p;function m(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}g.registerExtension(new class{constructor(){this.abortControllers=new Set}initialize(t){t.uiHandler.addEventListener("interaction",this.checkAbortable.bind(this)),t.addEventListener("init",this.onInitialize.bind(this)),t.addEventListener("start",this.saveAbortController.bind(this)),t.addEventListener("complete",this.removeAbortController.bind(this))}onInitialize(){document.addEventListener("keydown",(t=>{if("Escape"===t.key&&!(t.ctrlKey||t.shiftKey||t.altKey||t.metaKey)){for(const t of this.abortControllers)t.abort();this.abortControllers.clear()}}))}checkAbortable(t){const{element:e,options:i}=t.detail;(e.hasAttribute("data-naja-abort")||e.form?.hasAttribute("data-naja-abort"))&&(i.abort="off"!==(e.getAttribute("data-naja-abort")??e.form?.getAttribute("data-naja-abort")))}saveAbortController(t){const{abortController:e,options:i}=t.detail;!1!==i.abort&&(this.abortControllers.add(e),i.clearAbortExtension=()=>this.abortControllers.delete(e))}removeAbortController(t){const{options:e}=t.detail;!1!==e.abort&&e.clearAbortExtension&&e.clearAbortExtension()}}),g.registerExtension(new class{constructor(){this.abortControllers=new Map}initialize(t){t.uiHandler.addEventListener("interaction",this.checkUniqueness.bind(this)),t.addEventListener("start",this.abortPreviousRequest.bind(this)),t.addEventListener("complete",this.clearRequest.bind(this))}checkUniqueness(t){const{element:e,options:i}=t.detail;if(e.hasAttribute("data-naja-unique")??e.form?.hasAttribute("data-naja-unique")){const t=e.getAttribute("data-naja-unique")??e.form?.getAttribute("data-naja-unique");i.unique="off"!==t&&(t??"default")}}abortPreviousRequest(t){const{abortController:e,options:i}=t.detail;!1!==i.unique&&(this.abortControllers.get(i.unique??"default")?.abort(),this.abortControllers.set(i.unique??"default",e))}clearRequest(t){const{request:e,options:i}=t.detail;e.signal.aborted||!1===i.unique||this.abortControllers.delete(i.unique??"default")}});var v,b={exports:{}};
1
+ const e=e=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()};class t extends EventTarget{constructor(e){super(),this.naja=e,this.selector=".ajax",this.allowedOrigins=[window.location.origin],this.handler=this.handleUI.bind(this),e.addEventListener("init",this.initialize.bind(this))}initialize(){e(()=>this.bindUI(window.document.body)),this.naja.snippetHandler.addEventListener("afterUpdate",e=>{const{snippet:t}=e.detail;this.bindUI(t)})}bindUI(e){const t=`a${this.selector}`,i=e=>{e.removeEventListener("click",this.handler),e.addEventListener("click",this.handler)};if(e.matches(t))return i(e);e.querySelectorAll(t).forEach(e=>i(e));const n=e=>{e.removeEventListener("submit",this.handler),e.addEventListener("submit",this.handler)};if(e instanceof HTMLFormElement)return n(e);e.querySelectorAll("form").forEach(e=>n(e))}handleUI(e){const t=e.currentTarget,i=this.naja.prepareOptions(),n=()=>{};if(e instanceof MouseEvent){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey||e.button)return;return void this.clickElement(t,i,e).catch(n)}const{submitter:r}=e;(""===this.selector||t.matches(this.selector)||r?.matches(this.selector))&&this.submitForm(r??t,i,e).catch(n)}async clickElement(e,t={},i){if(e instanceof HTMLAnchorElement)return this.processInteraction(e,"GET",e.href,null,t,i);if((e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&e.form)return this.submitForm(e,t,i);throw new Error("Unsupported element in clickElement(): element must be an anchor or a submitter element attached to a form.")}async submitForm(e,t={},i){let n,r=null;if((e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&e.form)n=e.form,r=e;else{if(!(e instanceof HTMLFormElement))throw new Error("Unsupported element in submitForm(): formOrSubmitter must be either a form or a submitter element attached to a form.");n=e,r=i instanceof SubmitEvent?i.submitter:null}const s=(r?.getAttribute("formmethod")??n.getAttribute("method")??"GET").toUpperCase(),o=r?.getAttribute("formaction")??n.getAttribute("action")??window.location.pathname+window.location.search,a=new FormData(n,r);return this.processInteraction(r??n,s,o,a,t,i)}async processInteraction(e,t,i,n=null,r={},s){if(!this.dispatchEvent(new CustomEvent("interaction",{cancelable:!0,detail:{element:e,originalEvent:s,options:r}})))return s?.preventDefault(),{};if(!this.isUrlAllowed(`${i}`))throw new Error(`Cannot dispatch async request, URL is not allowed: ${i}`);return s?.preventDefault(),this.naja.makeRequest(t,i,n,r)}isUrlAllowed(e){const t=new URL(e,location.href);return"null"!==t.origin&&this.allowedOrigins.includes(t.origin)}}class i{constructor(e){this.naja=e,e.addEventListener("init",this.initialize.bind(this)),e.uiHandler.addEventListener("interaction",this.processForm.bind(this))}initialize(){e(()=>this.initForms(window.document.body)),this.naja.snippetHandler.addEventListener("afterUpdate",e=>{const{snippet:t}=e.detail;this.initForms(t)})}initForms(e){const t=this.netteForms||window.Nette;if(!t)return;if(e instanceof HTMLFormElement)return void t.initForm(e);e.querySelectorAll("form").forEach(e=>t.initForm(e))}processForm(e){const{element:t,originalEvent:i}=e.detail,n=t instanceof HTMLFormElement,r=(t instanceof HTMLInputElement||t instanceof HTMLButtonElement)&&t.form;r&&(t.form["nette-submittedBy"]=t);const s=this.netteForms||window.Nette;(n||r)&&s&&!s.validateForm(t)&&(i?.stopImmediatePropagation(),i?.preventDefault(),e.preventDefault())}}class n extends EventTarget{constructor(e){super(),this.naja=e,e.uiHandler.addEventListener("interaction",e=>{const{element:t,options:i}=e.detail;if(t.hasAttribute("data-naja-force-redirect")||t.form?.hasAttribute("data-naja-force-redirect")){const e=t.getAttribute("data-naja-force-redirect")??t.form?.getAttribute("data-naja-force-redirect");i.forceRedirect="off"!==e}}),e.addEventListener("success",e=>{const{payload:t,options:i}=e.detail;t.redirect&&(this.makeRedirect(t.redirect,i.forceRedirect??!1,i),e.stopImmediatePropagation())}),this.locationAdapter={assign:e=>window.location.assign(e)}}makeRedirect(e,t,i={}){e instanceof URL&&(e=e.href);let n=t||!this.naja.uiHandler.isUrlAllowed(e);this.dispatchEvent(new CustomEvent("redirect",{cancelable:!0,detail:{url:e,setUrl(t){e=t},isHardRedirect:n,setHardRedirect(e){n=!!e},options:i}}))&&(n?this.locationAdapter.assign(e):this.naja.makeRequest("GET",e,null,i))}}class r extends EventTarget{constructor(e){super(),this.op={replace:{updateElement(e,t){e.innerHTML=t},updateIndex:(e,t)=>t},prepend:{updateElement(e,t){e.insertAdjacentHTML("afterbegin",t)},updateIndex:(e,t)=>t+e},append:{updateElement(e,t){e.insertAdjacentHTML("beforeend",t)},updateIndex:(e,t)=>e+t}},e.addEventListener("success",e=>{const{options:t,payload:i}=e.detail;i.snippets&&this.updateSnippets(i.snippets,!1,t)})}static findSnippets(e,t=window.document){const i={};return t.querySelectorAll('[id^="snippet-"]').forEach(t=>{(e?.(t)??1)&&(i[t.id]=t.innerHTML)}),i}async updateSnippets(e,t=!1,i={}){await Promise.all(Object.keys(e).map(async n=>{const r=document.getElementById(n);r&&await this.updateSnippet(r,e[n],t,i)}))}async updateSnippet(e,t,i,n){let r=this.op.replace;!e.hasAttribute("data-naja-snippet-prepend")&&!e.hasAttribute("data-ajax-prepend")||i?!e.hasAttribute("data-naja-snippet-append")&&!e.hasAttribute("data-ajax-append")||i||(r=this.op.append):r=this.op.prepend;if(!this.dispatchEvent(new CustomEvent("beforeUpdate",{cancelable:!0,detail:{snippet:e,content:t,fromCache:i,operation:r,changeOperation(e){r=e},options:n}})))return;this.dispatchEvent(new CustomEvent("pendingUpdate",{detail:{snippet:e,content:t,fromCache:i,operation:r,options:n}}));const s="function"==typeof r?r:r.updateElement;await s(e,t),this.dispatchEvent(new CustomEvent("afterUpdate",{detail:{snippet:e,content:t,fromCache:i,operation:r,options:n}}))}}const s=Symbol();class o extends EventTarget{constructor(e){super(),this.naja=e,this.initialized=!1,this.cursor=0,this.popStateHandler=this.handlePopState.bind(this),e.addEventListener("init",this.initialize.bind(this)),e.addEventListener("before",this.saveUrl.bind(this)),e.addEventListener("before",this.saveOriginalTitle.bind(this)),e.addEventListener("before",this.replaceInitialState.bind(this)),e.addEventListener("success",this.pushNewState.bind(this)),e.redirectHandler.addEventListener("redirect",this.saveRedirectedUrl.bind(this)),e.uiHandler.addEventListener("interaction",this.configureMode.bind(this)),this.historyAdapter={replaceState:(e,t,i)=>window.history.replaceState(e,t,i),pushState:(e,t,i)=>window.history.pushState(e,t,i)}}set uiCache(e){console.warn("Naja: HistoryHandler.uiCache is deprecated, use options.snippetCache instead."),this.naja.defaultOptions.snippetCache=e}handlePopState(e){const{state:t}=e;if("naja"!==t?.source)return;const i=t.cursor-this.cursor;this.cursor=t.cursor;const n=this.naja.prepareOptions();this.dispatchEvent(new CustomEvent("restoreState",{detail:{state:t,direction:i,options:n}}))}initialize(){window.addEventListener("popstate",this.popStateHandler)}saveOriginalTitle(e){const{options:t}=e.detail;t[s]=window.document.title}saveUrl(e){const{url:t,options:i}=e.detail;i.href??=t}saveRedirectedUrl(e){const{url:t,options:i}=e.detail;i.href=t}replaceInitialState(t){const{options:i}=t.detail;!1===o.normalizeMode(i.history)||this.initialized||(e(()=>this.historyAdapter.replaceState(this.buildState(window.location.href,"replace",this.cursor,i),window.document.title,window.location.href)),this.initialized=!0)}configureMode(e){const{element:t,options:i}=e.detail;if(t.hasAttribute("data-naja-history")||t.form?.hasAttribute("data-naja-history")){const e=t.getAttribute("data-naja-history")??t.form?.getAttribute("data-naja-history");i.history=o.normalizeMode(e)}}static normalizeMode(e){return"off"!==e&&!1!==e&&("replace"!==e||"replace")}pushNewState(e){const{payload:t,options:i}=e.detail,n=o.normalizeMode(i.history);if(!1===n)return;t.postGet&&t.url&&(i.href=t.url);const r="replace"===n?"replaceState":"pushState",a="replace"===n?this.cursor:++this.cursor,l=this.buildState(i.href,n,a,i),c=window.document.title;window.document.title=i[s],this.historyAdapter[r](l,c,i.href),window.document.title=c}buildState(e,t,i,n){const r={source:"naja",cursor:i,href:e};return this.dispatchEvent(new CustomEvent("buildState",{detail:{state:r,operation:"replace"===t?"replaceState":"pushState",options:n}})),r}}class a extends EventTarget{constructor(e){super(),this.naja=e,this.currentSnippets=new Map,this.storages={off:new l(e),history:new c,session:new d},e.addEventListener("init",this.initializeIndex.bind(this)),e.snippetHandler.addEventListener("pendingUpdate",this.updateIndex.bind(this)),e.uiHandler.addEventListener("interaction",this.configureCache.bind(this)),e.historyHandler.addEventListener("buildState",this.buildHistoryState.bind(this)),e.historyHandler.addEventListener("restoreState",this.restoreHistoryState.bind(this))}resolveStorage(e){let t;return t=!0===e||void 0===e?"history":!1===e?"off":e,this.storages[t]}static shouldCacheSnippet(e){return!(e.hasAttribute("data-naja-history-nocache")||e.hasAttribute("data-history-nocache")||e.hasAttribute("data-naja-snippet-cache")&&"off"===e.getAttribute("data-naja-snippet-cache"))}initializeIndex(){e(()=>{const e=r.findSnippets(a.shouldCacheSnippet);this.currentSnippets=new Map(Object.entries(e))})}updateIndex(e){const{snippet:t,content:i,operation:n}=e.detail;if(!a.shouldCacheSnippet(t))return;const s=this.currentSnippets.get(t.id)??"",o="object"==typeof n?n.updateIndex:()=>i;this.currentSnippets.set(t.id,o(s,i));const l=a.parser.parseFromString(i,"text/html"),c=r.findSnippets(a.shouldCacheSnippet,l);for(const[e,t]of Object.entries(c))this.currentSnippets.set(e,t)}configureCache(e){const{element:t,options:i}=e.detail;if(t&&(t.hasAttribute("data-naja-snippet-cache")||t.form?.hasAttribute("data-naja-snippet-cache")||t.hasAttribute("data-naja-history-cache")||t.form?.hasAttribute("data-naja-history-cache"))){const e=t.getAttribute("data-naja-snippet-cache")??t.form?.getAttribute("data-naja-snippet-cache")??t.getAttribute("data-naja-history-cache")??t.form?.getAttribute("data-naja-history-cache");i.snippetCache=e}}buildHistoryState(e){const{state:t,options:i}=e.detail;"historyUiCache"in i&&(console.warn("Naja: options.historyUiCache is deprecated, use options.snippetCache instead."),i.snippetCache=i.historyUiCache);const n=Object.keys(r.findSnippets(a.shouldCacheSnippet)),s=Object.fromEntries(Array.from(this.currentSnippets).filter(([e])=>n.includes(e)));if(!this.dispatchEvent(new CustomEvent("store",{cancelable:!0,detail:{snippets:s,state:t,options:i}})))return;const o=this.resolveStorage(i.snippetCache);t.snippets={storage:o.type,key:o.store(s)}}restoreHistoryState(e){const{state:t,options:i}=e.detail;if(void 0===t.snippets)return;if(i.snippetCache=t.snippets.storage,!this.dispatchEvent(new CustomEvent("fetch",{cancelable:!0,detail:{state:t,options:i}})))return;const n=this.resolveStorage(i.snippetCache).fetch(t.snippets.key,t,i);null!==n&&this.dispatchEvent(new CustomEvent("restore",{cancelable:!0,detail:{snippets:n,state:t,options:i}}))&&this.naja.snippetHandler.updateSnippets(n,!0,i)}}a.parser=new DOMParser;class l{constructor(e){this.naja=e,this.type="off"}store(){return null}fetch(e,t,i){return this.naja.makeRequest("GET",t.href,null,{...i,history:!1,snippetCache:!1}),null}}class c{constructor(){this.type="history"}store(e){return e}fetch(e){return e}}class d{constructor(){this.type="session"}store(e){const t=Math.random().toString(36).substring(2,8);return window.sessionStorage.setItem(t,JSON.stringify(e)),t}fetch(e){const t=window.sessionStorage.getItem(e);return null===t?null:JSON.parse(t)}}class u{constructor(e){this.naja=e,this.loadedScripts=new Set,e.addEventListener("init",this.initialize.bind(this))}initialize(){e(()=>{document.querySelectorAll("script[data-naja-script-id]").forEach(e=>{const t=e.getAttribute("data-naja-script-id");null!==t&&""!==t&&this.loadedScripts.add(t)})}),this.naja.snippetHandler.addEventListener("afterUpdate",e=>{const{content:t}=e.detail;this.loadScripts(t)})}loadScripts(e){"string"!=typeof e?Object.keys(e).forEach(t=>{const i=e[t];this.loadScriptsInSnippet(i)}):this.loadScriptsInSnippet(e)}loadScriptsInSnippet(e){if(!/<script/i.test(e))return;u.parser.parseFromString(e,"text/html").querySelectorAll("script").forEach(e=>{const t=e.getAttribute("data-naja-script-id");if(null!==t&&""!==t&&this.loadedScripts.has(t))return;const i=window.document.createElement("script");if(i.innerHTML=e.innerHTML,e.hasAttributes())for(const t of e.attributes)i.setAttribute(t.name,t.value);window.document.head.appendChild(i).parentNode.removeChild(i),null!==t&&""!==t&&this.loadedScripts.add(t)})}}u.parser=new DOMParser;class h extends EventTarget{constructor(e,s,l,c,d,h,p){super(),this.VERSION=3,this.initialized=!1,this.extensions=[],this.defaultOptions={},this.uiHandler=new(e??t)(this),this.redirectHandler=new(s??n)(this),this.snippetHandler=new(l??r)(this),this.formsHandler=new(c??i)(this),this.historyHandler=new(d??o)(this),this.snippetCache=new(h??a)(this),this.scriptLoader=new(p??u)(this)}registerExtension(e){this.initialized&&e.initialize(this),this.extensions.push(e)}initialize(e={}){if(this.initialized)throw new Error("Cannot initialize Naja, it is already initialized.");this.defaultOptions=this.prepareOptions(e),this.extensions.forEach(e=>e.initialize(this)),this.dispatchEvent(new CustomEvent("init",{detail:{defaultOptions:this.defaultOptions}})),this.initialized=!0}prepareOptions(e){return{...this.defaultOptions,...e,fetch:{...this.defaultOptions.fetch,...e?.fetch}}}async makeRequest(e,t,i=null,n={}){"string"==typeof t&&(t=new URL(t,location.href)),n=this.prepareOptions(n);const r=new Headers(n.fetch.headers||{}),s=this.transformData(t,e,i),o=new AbortController,a=new Request(t.toString(),{credentials:"same-origin",...n.fetch,method:e,headers:r,body:s,signal:o.signal});if(a.headers.set("X-Requested-With","XMLHttpRequest"),a.headers.set("Accept","application/json"),!this.dispatchEvent(new CustomEvent("before",{cancelable:!0,detail:{request:a,method:e,url:t.toString(),data:i,options:n}})))return{};const l=window.fetch(a);let c,d;this.dispatchEvent(new CustomEvent("start",{detail:{request:a,promise:l,abortController:o,options:n}}));try{if(c=await l,!c.ok)throw new p(c);d=await c.json()}catch(e){if("AbortError"===e.name)return this.dispatchEvent(new CustomEvent("abort",{detail:{request:a,error:e,options:n}})),this.dispatchEvent(new CustomEvent("complete",{detail:{request:a,response:c,payload:void 0,error:e,options:n}})),{};throw this.dispatchEvent(new CustomEvent("error",{detail:{request:a,response:c,error:e,options:n}})),this.dispatchEvent(new CustomEvent("complete",{detail:{request:a,response:c,payload:void 0,error:e,options:n}})),e}return this.dispatchEvent(new CustomEvent("payload",{detail:{request:a,response:c,payload:d,options:n}})),this.dispatchEvent(new CustomEvent("success",{detail:{request:a,response:c,payload:d,options:n}})),this.dispatchEvent(new CustomEvent("complete",{detail:{request:a,response:c,payload:d,error:void 0,options:n}})),d}appendToQueryString(e,t,i){if(null!=i)if(Array.isArray(i)||Object.getPrototypeOf(i)===Object.prototype)for(const[n,r]of Object.entries(i))this.appendToQueryString(e,`${t}[${n}]`,r);else e.append(t,String(i))}transformData(e,t,i){const n=["GET","HEAD"].includes(t.toUpperCase());if(n&&i instanceof FormData){for(const[t,n]of i)null!=n&&e.searchParams.append(t,String(n));return null}if(null!==i&&Object.getPrototypeOf(i)===Object.prototype||Array.isArray(i)){const t=n?e.searchParams:new URLSearchParams;for(const[e,n]of Object.entries(i))this.appendToQueryString(t,e,n);return n?null:t}return i}}class p extends Error{constructor(e){const t=`HTTP ${e.status}: ${e.statusText}`;super(t),this.name=this.constructor.name,this.stack=new Error(t).stack,this.response=e}}const f=new h;function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}f.registerExtension(new class{constructor(){this.abortControllers=new Set}initialize(e){e.uiHandler.addEventListener("interaction",this.checkAbortable.bind(this)),e.addEventListener("init",this.onInitialize.bind(this)),e.addEventListener("start",this.saveAbortController.bind(this)),e.addEventListener("complete",this.removeAbortController.bind(this))}onInitialize(){document.addEventListener("keydown",e=>{if("Escape"===e.key&&!(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)){for(const e of this.abortControllers)e.abort();this.abortControllers.clear()}})}checkAbortable(e){const{element:t,options:i}=e.detail;(t.hasAttribute("data-naja-abort")||t.form?.hasAttribute("data-naja-abort"))&&(i.abort="off"!==(t.getAttribute("data-naja-abort")??t.form?.getAttribute("data-naja-abort")))}saveAbortController(e){const{abortController:t,options:i}=e.detail;!1!==i.abort&&(this.abortControllers.add(t),i.clearAbortExtension=()=>this.abortControllers.delete(t))}removeAbortController(e){const{options:t}=e.detail;!1!==t.abort&&t.clearAbortExtension&&t.clearAbortExtension()}}),f.registerExtension(new class{constructor(){this.abortControllers=new Map}initialize(e){e.uiHandler.addEventListener("interaction",this.checkUniqueness.bind(this)),e.addEventListener("start",this.abortPreviousRequest.bind(this)),e.addEventListener("complete",this.clearRequest.bind(this))}checkUniqueness(e){const{element:t,options:i}=e.detail;if(t.hasAttribute("data-naja-unique")??t.form?.hasAttribute("data-naja-unique")){const e=t.getAttribute("data-naja-unique")??t.form?.getAttribute("data-naja-unique");i.unique="off"!==e&&(e??"default")}}abortPreviousRequest(e){const{abortController:t,options:i}=e.detail;!1!==i.unique&&(this.abortControllers.get(i.unique??"default")?.abort(),this.abortControllers.set(i.unique??"default",t))}clearRequest(e){const{request:t,options:i}=e.detail;t.signal.aborted||!1===i.unique||this.abortControllers.delete(i.unique??"default")}});var m,v={exports:{}};
2
2
  /*!
3
3
  * NetteForms - simple form validation.
4
4
  *
5
5
  * This file is part of the Nette Framework (https://nette.org)
6
6
  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
7
- */var y=(v||(v=1,b.exports=function(){class t{filled(t,e,i){return""!==i&&!1!==i&&null!==i&&(!Array.isArray(i)||i.length>0)&&(!(i instanceof FileList)||i.length>0)}blank(t,e,i){return!this.filled(t,e,i)}valid(t,e){return e.validateControl(t,void 0,!0)}equal(t,e,i){if(void 0===e)return null;let n=t=>"number"==typeof t||"string"==typeof t?""+t:!0===t?"1":"",r=Array.isArray(i)?i:[i],s=Array.isArray(e)?e:[e];t:for(let t of r){for(let e of s)if(n(t)===n(e))continue t;return!1}return r.length>0}notEqual(t,e,i){return void 0===e?null:!this.equal(t,e,i)}minLength(t,e,i){return(i="number"==typeof i?i.toString():i).length>=e}maxLength(t,e,i){return(i="number"==typeof i?i.toString():i).length<=e}length(t,e,i){return i="number"==typeof i?i.toString():i,(null===(e=Array.isArray(e)?e:[e,e])[0]||i.length>=e[0])&&(null===e[1]||i.length<=e[1])}email(t,e,i){return/^("([ !#-[\]-~]|\\[ -~])+"|[-a-z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*)@([0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)+[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?$/i.test(i)}url(t,e,i,n){return/^[a-z\d+.-]+:/.test(i)||(i="https://"+i),!!/^https?:\/\/((([-_0-9a-z\u00C0-\u02FF\u0370-\u1EFF]+\.)*[0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)?[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[[0-9a-f:]{3,39}\])(:\d{1,5})?(\/\S*)?$/i.test(i)&&(n.value=i,!0)}regexp(t,e,i){let n="string"==typeof e&&e.match(/^\/(.*)\/([imu]*)$/);try{return n&&new RegExp(n[1],n[2].replace("u","")).test(i)}catch{return null}}pattern(t,e,i,n,r){if("string"!=typeof e)return null;try{let t;try{t=new RegExp("^(?:"+e+")$",r?"ui":"u")}catch{t=new RegExp("^(?:"+e+")$",r?"i":"")}return i instanceof FileList?Array.from(i).every((e=>t.test(e.name))):t.test(i)}catch{return null}}patternCaseInsensitive(t,e,i){return this.pattern(t,e,i,null,!0)}numeric(t,e,i){return/^[0-9]+$/.test(i)}integer(t,e,i,n){return!!/^-?[0-9]+$/.test(i)&&(n.value=parseFloat(i),!0)}float(t,e,i,n){return i=i.replace(/ +/g,"").replace(/,/g,"."),!!/^-?[0-9]*\.?[0-9]+$/.test(i)&&(n.value=parseFloat(i),!0)}min(t,e,i){return Number.isFinite(e)&&(i=parseFloat(i)),i>=e}max(t,e,i){return Number.isFinite(e)&&(i=parseFloat(i)),i<=e}range(t,e,i){return Array.isArray(e)?"time"===t.type&&e[0]>e[1]?i>=e[0]||i<=e[1]:(null===e[0]||this.min(t,e[0],i))&&(null===e[1]||this.max(t,e[1],i)):null}submitted(t){return t.form["nette-submittedBy"]===t}fileSize(t,e,i){return Array.from(i).every((t=>t.size<=e))}mimeType(t,e,i){let n=[];(e=Array.isArray(e)?e:[e]).forEach((t=>n.push("^"+t.replace(/([^\w])/g,"\\$1").replace("\\*",".*")+"$")));let r=new RegExp(n.join("|"));return Array.from(i).every((t=>!t.type||r.test(t.type)))}image(t,e,i){return this.mimeType(t,e??["image/gif","image/png","image/jpeg","image/webp"],i)}static(t,e){return e}}class e{formErrors=[];validators=new t;#t={};#e={};#i=new WeakMap;#n(t,e){let i=t.elements.namedItem(e);return i instanceof RadioNodeList?i[0]:i}#r(t){let e=t.form.elements.namedItem(t.name);return e instanceof RadioNodeList?Array.from(e):[e]}#s(t){"loading"!==document.readyState?t.call(this):document.addEventListener("DOMContentLoaded",t)}getValue(t){return t instanceof HTMLInputElement?"radio"===t.type?this.#r(t).find((t=>t.checked))?.value??null:"file"===t.type?t.files:"checkbox"===t.type?t.name.endsWith("[]")?this.#r(t).filter((t=>t.checked)).map((t=>t.value)):t.checked:t.value.trim():t instanceof HTMLSelectElement?t.multiple?Array.from(t.selectedOptions,(t=>t.value)):t.selectedOptions[0]?.value??null:t instanceof HTMLTextAreaElement?t.value:t instanceof RadioNodeList?this.getValue(t[0]):null}getEffectiveValue(t,e=!1){let i=this.getValue(t);if(i===t.getAttribute("data-nette-empty-value")&&(i=""),e&&void 0===this.#t[t.name]){this.#t[t.name]=!0;let e={value:i};this.validateControl(t,void 0,!0,e),i=e.value,delete this.#t[t.name]}return i}validateControl(t,e,i=!1,n,r){e??=JSON.parse(t.getAttribute("data-nette-rules")??"[]"),n??={value:this.getEffectiveValue(t)},r??=!this.validateRule(t,":filled",null,n);for(let s of e){let e=s.op.match(/(~)?([^?]+)/),o=s.control?this.#n(t.form,s.control):t;if(s.neg=!!e[1],s.op=e[2],s.condition=!!s.rules,!o)continue;if(r&&!s.condition&&":filled"!==s.op)continue;let a=this.validateRule(o,s.op,s.arg,t===o?n:void 0);if(null!==a)if(s.neg&&(a=!a),s.condition&&a){if(!this.validateControl(t,s.rules,i,n,":blank"!==s.op&&r))return!1}else if(!s.condition&&!a){if(this.isDisabled(o))continue;if(!i){let e=Array.isArray(s.arg)?s.arg:[s.arg],i=s.msg.replace(/%(value|\d+)/g,((i,n)=>this.getValue("value"===n?o:t.form.elements.namedItem(e[n].control))));this.addError(o,i)}return!1}}return!0}validateForm(t,e=!1){let i,n=t.form??t;if(this.formErrors=[],null!==t.getAttribute("formnovalidate")){let e=JSON.parse(t.getAttribute("data-nette-validation-scope")??"[]");if(!e.length)return this.showFormErrors(n,[]),!0;i=new RegExp("^("+e.join("-|")+"-)")}for(let t of n.elements)if(t.willValidate&&t.validity.badInput)return t.reportValidity(),!1;for(let t of n.elements)if(t.getAttribute("data-nette-rules")&&(!i||t.name.replace(/]\[|\[|]|$/g,"-").match(i))&&!this.isDisabled(t)&&!this.validateControl(t,void 0,e)&&!this.formErrors.length)return!1;let r=!this.formErrors.length;return this.showFormErrors(n,this.formErrors),r}isDisabled(t){return"radio"===t.type?this.#r(t).every((t=>t.disabled)):t.disabled}addError(t,e){this.formErrors.push({element:t,message:e})}showFormErrors(t,e){let i,n=[];for(let t of e)n.indexOf(t.message)<0&&(n.push(t.message),i??=t.element);n.length&&this.showModal(n.join("\n"),(()=>{i?.focus()}))}showModal(t,e){let i=document.createElement("dialog");if(!i.showModal)return alert(t),void e();let n=document.createElement("style");n.innerText=".netteFormsModal { text-align: center; margin: auto; border: 2px solid black; padding: 1rem } .netteFormsModal button { padding: .1em 2em }";let r=document.createElement("button");r.innerText="OK",r.onclick=()=>{i.remove(),e()},i.setAttribute("class","netteFormsModal"),i.innerText=t+"\n\n",i.append(n,r),document.body.append(i),i.showModal()}validateRule(t,e,i,n){if(t.validity.badInput)return":filled"===e;n??={value:this.getEffectiveValue(t,!0)};let r=":"===e.charAt(0)?e.substring(1):e;r=r.replace("::","_").replaceAll("\\","");let s=Array.isArray(i)?i:[i];return s=s.map((e=>{if(e?.control){let i=this.#n(t.form,e.control);return i===t?n.value:this.getEffectiveValue(i,!0)}return e})),"valid"===r&&(s[0]=this),this.validators[r]?this.validators[r](t,Array.isArray(i)?s:s[0],n.value,n):null}toggleForm(t,e){this.#e={};for(let i of Array.from(t.elements))i.getAttribute("data-nette-rules")&&this.toggleControl(i,void 0,null,!e);for(let t in this.#e)this.toggle(t,this.#e[t].state,this.#e[t].elem,e)}toggleControl(t,e,i=null,n=!1,r,s){e??=JSON.parse(t.getAttribute("data-nette-rules")??"[]"),r??={value:this.getEffectiveValue(t)},s??=!this.validateRule(t,":filled",null,r);let o,a=!1;for(let l of e){let e=l.op.match(/(~)?([^?]+)/),c=l.control?this.#n(t.form,l.control):t;if(l.neg=!!e[1],l.op=e[2],l.condition=!!l.rules,c&&(!s||l.condition||":filled"===l.op)){if(o=i,!1!==i){if(o=this.validateRule(c,l.op,l.arg,t===c?r:void 0),null===o)continue;l.neg&&(o=!o),l.condition||(i=o)}if(l.condition&&this.toggleControl(t,l.rules,o,n,r,":blank"!==l.op&&s)||l.toggle){a=!0,n&&this.#r(c).filter((t=>!this.#i.has(t))).forEach((e=>{e.addEventListener("change",(e=>this.toggleForm(t.form,e))),this.#i.set(e,null)}));for(let e in l.toggle??{})this.#e[e]??={elem:t,state:!1},this.#e[e].state||=l.toggle[e]?!!o:!o}}}return a}toggle(t,e,i,n){/^\w[\w.:-]*$/.test(t)&&(t="#"+t),Array.from(document.querySelectorAll(t)).forEach((t=>t.hidden=!e))}compactCheckboxes(t,e){let i={};for(let n of t.elements)n instanceof HTMLInputElement&&"checkbox"===n.type&&n.name.endsWith("[]")&&n.checked&&!n.disabled&&(e.delete(n.name),i[n.name]??=[],i[n.name].push(n.value));for(let t in i)e.set(t.substring(0,t.length-2),i[t].join(","))}initForm(t){"get"===t.method&&t.hasAttribute("data-nette-compact")&&t.addEventListener("formdata",(e=>this.compactCheckboxes(t,e.formData))),Array.from(t.elements).some((t=>t.getAttribute("data-nette-rules")))&&(this.toggleForm(t),t.noValidate||(t.noValidate=!0,t.addEventListener("submit",(e=>{this.validateForm(e.submitter||t)||(e.stopImmediatePropagation(),e.preventDefault())})),t.addEventListener("reset",(()=>{setTimeout((()=>this.toggleForm(t)))}))))}initOnLoad(){this.#s((()=>{Array.from(document.forms).forEach((t=>this.initForm(t)))}))}}let i={"á":"a","ä":"a","č":"c","ď":"d","é":"e","ě":"e","í":"i","ľ":"l","ň":"n","ó":"o","ô":"o","ř":"r","š":"s","ť":"t","ú":"u","ů":"u","ý":"y","ž":"z"};function n(t){t=t.toLowerCase();let e="";for(let n=0;n<t.length;n++){let r=i[t.charAt(n)];e+=r||t.charAt(n)}return e.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}var r="3.5.3";let s=new e;return s.version=r,s.webalize=n,s}()),b.exports),_=m(y);function w(t){return"Enter"===t.key}function E(){return null!=E?E:{}}function A(t,e=200){let i=null,n=!1;return(...r)=>{n||(i&&clearTimeout(i),i=setTimeout((()=>{const e=t(...r);var i;"object"==typeof(i=e)&&"function"==typeof i.then&&(n=!0,e.finally((()=>{n=!1})))}),e))}}function k(t,e){t.split(/\s+/).forEach((t=>{e(t)}))}class S{constructor(){this._events={}}on(t,e){k(t,(t=>{const i=this._events[t]||[];i.push(e),this._events[t]=i}))}off(t,e){var i=arguments.length;0!==i?k(t,(t=>{if(1===i)return void delete this._events[t];const n=this._events[t];void 0!==n&&(n.splice(n.indexOf(e),1),this._events[t]=n)})):this._events={}}trigger(t,...e){var i=this;k(t,(t=>{const n=i._events[t];void 0!==n&&n.forEach((t=>{t.apply(i,e)}))}))}}const C=t=>(t=t.filter(Boolean)).length<2?t[0]||"":1==L(t)?"["+t.join("")+"]":"(?:"+t.join("|")+")",O=t=>{if(!x(t))return t.join("");let e="",i=0;const n=()=>{i>1&&(e+="{"+i+"}")};return t.forEach(((r,s)=>{r!==t[s-1]?(n(),e+=r,i=1):i++})),n(),e},D=t=>{let e=Array.from(t);return C(e)},x=t=>new Set(t).size!==t.length,T=t=>(t+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),L=t=>t.reduce(((t,e)=>Math.max(t,I(e))),0),I=t=>Array.from(t).length,F=t=>{if(1===t.length)return[[t]];let e=[];const i=t.substring(1);return F(i).forEach((function(i){let n=i.slice(0);n[0]=t.charAt(0)+n[0],e.push(n),n=i.slice(0),n.unshift(t.charAt(0)),e.push(n)})),e},M=[[0,65535]];let N,j;const P={},$={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let t in $){let e=$[t]||"";for(let i=0;i<e.length;i++){let n=e.substring(i,i+1);P[n]=t}}const H=new RegExp(Object.keys(P).join("|")+"|[̀-ͯ·ʾʼ]","gu"),q=(t,e="NFKD")=>t.normalize(e),R=t=>Array.from(t).reduce(((t,e)=>t+B(e)),""),B=t=>(t=q(t).toLowerCase().replace(H,(t=>P[t]||"")),q(t,"NFC"));const V=t=>{const e={},i=(t,i)=>{const n=e[t]||new Set,r=new RegExp("^"+D(n)+"$","iu");i.match(r)||(n.add(T(i)),e[t]=n)};for(let e of function*(t){for(const[e,i]of t)for(let t=e;t<=i;t++){let e=String.fromCharCode(t),i=R(e);i!=e.toLowerCase()&&(i.length>3||0!=i.length&&(yield{folded:i,composed:e,code_point:t}))}}(t))i(e.folded,e.folded),i(e.folded,e.composed);return e},z=t=>{const e=V(t),i={};let n=[];for(let t in e){let r=e[t];r&&(i[t]=D(r)),t.length>1&&n.push(T(t))}n.sort(((t,e)=>e.length-t.length));const r=C(n);return j=new RegExp("^"+r,"u"),i},W=(t,e=1)=>(e=Math.max(e,t.length-1),C(F(t).map((t=>((t,e=1)=>{let i=0;return t=t.map((t=>(N[t]&&(i+=t.length),N[t]||t))),i>=e?O(t):""})(t,e))))),Y=(t,e=!0)=>{let i=t.length>1?1:0;return C(t.map((t=>{let n=[];const r=e?t.length():t.length()-1;for(let e=0;e<r;e++)n.push(W(t.substrs[e]||"",i));return O(n)})))},K=(t,e)=>{for(const i of e){if(i.start!=t.start||i.end!=t.end)continue;if(i.substrs.join("")!==t.substrs.join(""))continue;let e=t.parts;const n=t=>{for(const i of e){if(i.start===t.start&&i.substr===t.substr)return!1;if(1!=t.length&&1!=i.length){if(t.start<i.start&&t.end>i.start)return!0;if(i.start<t.start&&i.end>t.start)return!0}}return!1};if(!(i.parts.filter(n).length>0))return!0}return!1};class U{parts;substrs;start;end;constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(t){t&&(this.parts.push(t),this.substrs.push(t.substr),this.start=Math.min(t.start,this.start),this.end=Math.max(t.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(t,e){let i=new U,n=JSON.parse(JSON.stringify(this.parts)),r=n.pop();for(const t of n)i.add(t);let s=e.substr.substring(0,t-r.start),o=s.length;return i.add({start:r.start,end:r.start+o,length:o,substr:s}),i}}const X=t=>{void 0===N&&(N=z(M)),t=R(t);let e="",i=[new U];for(let n=0;n<t.length;n++){let r=t.substring(n).match(j);const s=t.substring(n,n+1),o=r?r[0]:null;let a=[],l=new Set;for(const t of i){const e=t.last();if(!e||1==e.length||e.end<=n)if(o){const e=o.length;t.add({start:n,end:n+e,length:e,substr:o}),l.add("1")}else t.add({start:n,end:n+1,length:1,substr:s}),l.add("2");else if(o){let i=t.clone(n,e);const r=o.length;i.add({start:n,end:n+r,length:r,substr:o}),a.push(i)}else l.add("3")}if(a.length>0){a=a.sort(((t,e)=>t.length()-e.length()));for(let t of a)K(t,i)||i.push(t)}else if(n>0&&1==l.size&&!l.has("3")){e+=Y(i,!1);let t=new U;const n=i[0];n&&t.add(n.last()),i=[t]}}return e+=Y(i,!0),e},Q=(t,e)=>{if(t)return t[e]},G=(t,e)=>{if(t){for(var i,n=e.split(".");(i=n.shift())&&(t=t[i]););return t}},J=(t,e,i)=>{var n,r;return t?(t+="",null==e.regex||-1===(r=t.search(e.regex))?0:(n=e.string.length/t.length,0===r&&(n+=.5),n*i)):0},Z=(t,e)=>{var i=t[e];if("function"==typeof i)return i;i&&!Array.isArray(i)&&(t[e]=[i])},tt=(t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},et=(t,e)=>"number"==typeof t&&"number"==typeof e?t>e?1:t<e?-1:0:(t=R(t+"").toLowerCase())>(e=R(e+"").toLowerCase())?1:e>t?-1:0;class it{items;settings;constructor(t,e){this.items=t,this.settings=e||{diacritics:!0}}tokenize(t,e,i){if(!t||!t.length)return[];const n=[],r=t.split(/\s+/);var s;return i&&(s=new RegExp("^("+Object.keys(i).map(T).join("|")+"):(.*)$")),r.forEach((t=>{let i,r=null,o=null;s&&(i=t.match(s))&&(r=i[1],t=i[2]),t.length>0&&(o=this.settings.diacritics?X(t)||null:T(t),o&&e&&(o="\\b"+o)),n.push({string:t,regex:o?new RegExp(o,"iu"):null,field:r})})),n}getScoreFunction(t,e){var i=this.prepareSearch(t,e);return this._getScoreFunction(i)}_getScoreFunction(t){const e=t.tokens,i=e.length;if(!i)return function(){return 0};const n=t.options.fields,r=t.weights,s=n.length,o=t.getAttrFn;if(!s)return function(){return 1};const a=1===s?function(t,e){const i=n[0].field;return J(o(e,i),t,r[i]||1)}:function(t,e){var i=0;if(t.field){const n=o(e,t.field);!t.regex&&n?i+=1/s:i+=J(n,t,1)}else tt(r,((n,r)=>{i+=J(o(e,r),t,n)}));return i/s};return 1===i?function(t){return a(e[0],t)}:"and"===t.options.conjunction?function(t){var n,r=0;for(let i of e){if((n=a(i,t))<=0)return 0;r+=n}return r/i}:function(t){var n=0;return tt(e,(e=>{n+=a(e,t)})),n/i}}getSortFunction(t,e){var i=this.prepareSearch(t,e);return this._getSortFunction(i)}_getSortFunction(t){var e,i=[];const n=this,r=t.options,s=!t.query&&r.sort_empty?r.sort_empty:r.sort;if("function"==typeof s)return s.bind(this);const o=function(e,i){return"$score"===e?i.score:t.getAttrFn(n.items[i.id],e)};if(s)for(let e of s)(t.query||"$score"!==e.field)&&i.push(e);if(t.query){e=!0;for(let t of i)if("$score"===t.field){e=!1;break}e&&i.unshift({field:"$score",direction:"desc"})}else i=i.filter((t=>"$score"!==t.field));return i.length?function(t,e){var n,r;for(let s of i){if(r=s.field,n=("desc"===s.direction?-1:1)*et(o(r,t),o(r,e)))return n}return 0}:null}prepareSearch(t,e){const i={};var n=Object.assign({},e);if(Z(n,"sort"),Z(n,"sort_empty"),n.fields){Z(n,"fields");const t=[];n.fields.forEach((e=>{"string"==typeof e&&(e={field:e,weight:1}),t.push(e),i[e.field]="weight"in e?e.weight:1})),n.fields=t}return{options:n,query:t.toLowerCase().trim(),tokens:this.tokenize(t,n.respect_word_boundaries,i),total:0,items:[],weights:i,getAttrFn:n.nesting?G:Q}}search(t,e){var i,n,r=this;n=this.prepareSearch(t,e),e=n.options,t=n.query;const s=e.score||r._getScoreFunction(n);t.length?tt(r.items,((t,r)=>{i=s(t),(!1===e.filter||i>0)&&n.items.push({score:i,id:r})})):tt(r.items,((t,e)=>{n.items.push({score:1,id:e})}));const o=r._getSortFunction(n);return o&&n.items.sort(o),n.total=n.items.length,"number"==typeof e.limit&&(n.items=n.items.slice(0,e.limit)),n}}const nt=t=>null==t?null:rt(t),rt=t=>"boolean"==typeof t?t?"1":"0":t+"",st=t=>(t+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),ot=(t,e)=>{var i;return function(n,r){var s=this;i&&(s.loading=Math.max(s.loading-1,0),clearTimeout(i)),i=setTimeout((function(){i=null,s.loadedSearches[n]=!0,t.call(s,n,r)}),e)}},at=(t,e,i)=>{var n,r=t.trigger,s={};for(n of(t.trigger=function(){var i=arguments[0];if(-1===e.indexOf(i))return r.apply(t,arguments);s[i]=arguments},i.apply(t,[]),t.trigger=r,e))n in s&&r.apply(t,s[n])},lt=(t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())},ct=(t,e,i,n)=>{t.addEventListener(e,i,n)},dt=(t,e)=>!!e&&(!!e[t]&&1===(e.altKey?1:0)+(e.ctrlKey?1:0)+(e.shiftKey?1:0)+(e.metaKey?1:0)),ut=(t,e)=>{const i=t.getAttribute("id");return i||(t.setAttribute("id",e),e)},ht=t=>t.replace(/[\\"']/g,"\\$&"),pt=(t,e)=>{e&&t.append(e)},ft=(t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},gt=t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(mt(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)},mt=t=>"string"==typeof t&&t.indexOf("<")>-1,vt=(t,e)=>{var i=document.createEvent("HTMLEvents");i.initEvent(e,!0,!1),t.dispatchEvent(i)},bt=(t,e)=>{Object.assign(t.style,e)},yt=(t,...e)=>{var i=wt(e);(t=Et(t)).map((t=>{i.map((e=>{t.classList.add(e)}))}))},_t=(t,...e)=>{var i=wt(e);(t=Et(t)).map((t=>{i.map((e=>{t.classList.remove(e)}))}))},wt=t=>{var e=[];return ft(t,(t=>{"string"==typeof t&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))})),e.filter(Boolean)},Et=t=>(Array.isArray(t)||(t=[t]),t),At=(t,e,i)=>{if(!i||i.contains(t))for(;t&&t.matches;){if(t.matches(e))return t;t=t.parentNode}},kt=(t,e=0)=>e>0?t[t.length-1]:t[0],St=(t,e)=>{if(!t)return-1;e=e||t.nodeName;for(var i=0;t=t.previousElementSibling;)t.matches(e)&&i++;return i},Ct=(t,e)=>{ft(e,((e,i)=>{null==e?t.removeAttribute(i):t.setAttribute(i,""+e)}))},Ot=(t,e)=>{t.parentNode&&t.parentNode.replaceChild(e,t)},Dt=(t,e)=>{if(null===e)return;if("string"==typeof e){if(!e.length)return;e=new RegExp(e,"i")}const i=t=>3===t.nodeType?(t=>{var i=t.data.match(e);if(i&&t.data.length>0){var n=document.createElement("span");n.className="highlight";var r=t.splitText(i.index);r.splitText(i[0].length);var s=r.cloneNode(!0);return n.appendChild(s),Ot(r,n),1}return 0})(t):((t=>{1!==t.nodeType||!t.childNodes||/(script|style)/i.test(t.tagName)||"highlight"===t.className&&"SPAN"===t.tagName||Array.from(t.childNodes).forEach((t=>{i(t)}))})(t),0);i(t)},xt="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey";var Tt={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(t){return t.length>0},render:{}};function Lt(t,e){var i=Object.assign({},Tt,e),n=i.dataAttr,r=i.labelField,s=i.valueField,o=i.disabledField,a=i.optgroupField,l=i.optgroupLabelField,c=i.optgroupValueField,d=t.tagName.toLowerCase(),u=t.getAttribute("placeholder")||t.getAttribute("data-placeholder");if(!u&&!i.allowEmptyOption){let e=t.querySelector('option[value=""]');e&&(u=e.textContent)}var h={placeholder:u,options:[],optgroups:[],items:[],maxItems:null};return"select"===d?(()=>{var e,d=h.options,u={},p=1;let f=0;var g=t=>{var e=Object.assign({},t.dataset),i=n&&e[n];return"string"==typeof i&&i.length&&(e=Object.assign(e,JSON.parse(i))),e},m=(t,e)=>{var n=nt(t.value);if(null!=n&&(n||i.allowEmptyOption)){if(u.hasOwnProperty(n)){if(e){var l=u[n][a];l?Array.isArray(l)?l.push(e):u[n][a]=[l,e]:u[n][a]=e}}else{var c=g(t);c[r]=c[r]||t.textContent,c[s]=c[s]||n,c[o]=c[o]||t.disabled,c[a]=c[a]||e,c.$option=t,c.$order=c.$order||++f,u[n]=c,d.push(c)}t.selected&&h.items.push(n)}};h.maxItems=t.hasAttribute("multiple")?null:1,ft(t.children,(t=>{var i,n,r;"optgroup"===(e=t.tagName.toLowerCase())?((r=g(i=t))[l]=r[l]||i.getAttribute("label")||"",r[c]=r[c]||p++,r[o]=r[o]||i.disabled,r.$order=r.$order||++f,h.optgroups.push(r),n=r[c],ft(i.children,(t=>{m(t,n)}))):"option"===e&&m(t)}))})():(()=>{const e=t.getAttribute(n);if(e)h.options=JSON.parse(e),ft(h.options,(t=>{h.items.push(t[s])}));else{var o=t.value.trim()||"";if(!i.allowEmptyOption&&!o.length)return;const e=o.split(i.delimiter);ft(e,(t=>{const e={};e[r]=t,e[s]=t,h.options.push(e)})),h.items=e}})(),Object.assign({},Tt,h,e)}var It=0;let Ft=class extends(function(t){return t.plugins={},class extends t{constructor(){super(...arguments),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(e,i){t.plugins[e]={name:e,fn:i}}initializePlugins(t){var e,i;const n=this,r=[];if(Array.isArray(t))t.forEach((t=>{"string"==typeof t?r.push(t):(n.plugins.settings[t.name]=t.options,r.push(t.name))}));else if(t)for(e in t)t.hasOwnProperty(e)&&(n.plugins.settings[e]=t[e],r.push(e));for(;i=r.shift();)n.require(i)}loadPlugin(e){var i=this,n=i.plugins,r=t.plugins[e];if(!t.plugins.hasOwnProperty(e))throw new Error('Unable to find "'+e+'" plugin');n.requested[e]=!0,n.loaded[e]=r.fn.apply(i,[i.plugins.settings[e]||{}]),n.names.push(e)}require(t){var e=this,i=e.plugins;if(!e.plugins.loaded.hasOwnProperty(t)){if(i.requested[t])throw new Error('Plugin has circular dependency ("'+t+'")');e.loadPlugin(t)}return i.loaded[t]}}}(S)){constructor(t,e){var i;super(),this.order=0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],this.refreshTimeout=null,It++;var n=gt(t);if(n.tomselect)throw new Error("Tom Select already initialized on this element");n.tomselect=this,i=(window.getComputedStyle&&window.getComputedStyle(n,null)).getPropertyValue("direction");const r=Lt(n,e);this.settings=r,this.input=n,this.tabIndex=n.tabIndex||0,this.is_select_tag="select"===n.tagName.toLowerCase(),this.rtl=/rtl/i.test(i),this.inputId=ut(n,"tomselect-"+It),this.isRequired=n.required,this.sifter=new it(this.options,{diacritics:r.diacritics}),r.mode=r.mode||(1===r.maxItems?"single":"multi"),"boolean"!=typeof r.hideSelected&&(r.hideSelected="multi"===r.mode),"boolean"!=typeof r.hidePlaceholder&&(r.hidePlaceholder="multi"!==r.mode);var s=r.createFilter;"function"!=typeof s&&("string"==typeof s&&(s=new RegExp(s)),s instanceof RegExp?r.createFilter=t=>s.test(t):r.createFilter=t=>this.settings.duplicates||!this.options[t]),this.initializePlugins(r.plugins),this.setupCallbacks(),this.setupTemplates();const o=gt("<div>"),a=gt("<div>"),l=this._render("dropdown"),c=gt('<div role="listbox" tabindex="-1">'),d=this.input.getAttribute("class")||"",u=r.mode;var h;if(yt(o,r.wrapperClass,d,u),yt(a,r.controlClass),pt(o,a),yt(l,r.dropdownClass,u),r.copyClassesToDropdown&&yt(l,d),yt(c,r.dropdownContentClass),pt(l,c),gt(r.dropdownParent||o).appendChild(l),mt(r.controlInput)){h=gt(r.controlInput);ft(["autocorrect","autocapitalize","autocomplete","spellcheck"],(t=>{n.getAttribute(t)&&Ct(h,{[t]:n.getAttribute(t)})})),h.tabIndex=-1,a.appendChild(h),this.focus_node=h}else r.controlInput?(h=gt(r.controlInput),this.focus_node=h):(h=gt("<input/>"),this.focus_node=a);this.wrapper=o,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=h,this.setup()}setup(){const t=this,e=t.settings,i=t.control_input,n=t.dropdown,r=t.dropdown_content,s=t.wrapper,o=t.control,a=t.input,l=t.focus_node,c={passive:!0},d=t.inputId+"-ts-dropdown";Ct(r,{id:d}),Ct(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":d});const u=ut(l,t.inputId+"-ts-control"),h="label[for='"+(t=>t.replace(/['"\\]/g,"\\$&"))(t.inputId)+"']",p=document.querySelector(h),f=t.focus.bind(t);if(p){ct(p,"click",f),Ct(p,{for:u});const e=ut(p,t.inputId+"-ts-label");Ct(l,{"aria-labelledby":e}),Ct(r,{"aria-labelledby":e})}if(s.style.width=a.style.width,t.plugins.names.length){const e="plugin-"+t.plugins.names.join(" plugin-");yt([s,n],e)}(null===e.maxItems||e.maxItems>1)&&t.is_select_tag&&Ct(a,{multiple:"multiple"}),e.placeholder&&Ct(i,{placeholder:e.placeholder}),!e.splitOn&&e.delimiter&&(e.splitOn=new RegExp("\\s*"+T(e.delimiter)+"+\\s*")),e.load&&e.loadThrottle&&(e.load=ot(e.load,e.loadThrottle)),ct(n,"mousemove",(()=>{t.ignoreHover=!1})),ct(n,"mouseenter",(e=>{var i=At(e.target,"[data-selectable]",n);i&&t.onOptionHover(e,i)}),{capture:!0}),ct(n,"click",(e=>{const i=At(e.target,"[data-selectable]");i&&(t.onOptionSelect(e,i),lt(e,!0))})),ct(o,"click",(e=>{var n=At(e.target,"[data-ts-item]",o);n&&t.onItemSelect(e,n)?lt(e,!0):""==i.value&&(t.onClick(),lt(e,!0))})),ct(l,"keydown",(e=>t.onKeyDown(e))),ct(i,"keypress",(e=>t.onKeyPress(e))),ct(i,"input",(e=>t.onInput(e))),ct(l,"blur",(e=>t.onBlur(e))),ct(l,"focus",(e=>t.onFocus(e))),ct(i,"paste",(e=>t.onPaste(e)));const g=e=>{const r=e.composedPath()[0];if(!s.contains(r)&&!n.contains(r))return t.isFocused&&t.blur(),void t.inputState();r==i&&t.isOpen?e.stopPropagation():lt(e,!0)},m=()=>{t.isOpen&&t.positionDropdown()};ct(document,"mousedown",g),ct(window,"scroll",m,c),ct(window,"resize",m,c),this._destroy=()=>{document.removeEventListener("mousedown",g),window.removeEventListener("scroll",m),window.removeEventListener("resize",m),p&&p.removeEventListener("click",f)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",t.wrapper),t.sync(!1),e.items=[],delete e.optgroups,delete e.options,ct(a,"invalid",(()=>{t.isValid&&(t.isValid=!1,t.isInvalid=!0,t.refreshState())})),t.updateOriginalInput(),t.refreshItems(),t.close(!1),t.inputState(),t.isSetup=!0,a.disabled?t.disable():a.readOnly?t.setReadOnly(!0):t.enable(),t.on("change",this.onChange),yt(a,"tomselected","ts-hidden-accessible"),t.trigger("initialize"),!0===e.preload&&t.preload()}setupOptions(t=[],e=[]){this.addOptions(t),ft(e,(t=>{this.registerOptionGroup(t)}))}setupTemplates(){var t=this,e=t.settings.labelField,i=t.settings.optgroupLabelField,n={optgroup:t=>{let e=document.createElement("div");return e.className="optgroup",e.appendChild(t.options),e},optgroup_header:(t,e)=>'<div class="optgroup-header">'+e(t[i])+"</div>",option:(t,i)=>"<div>"+i(t[e])+"</div>",item:(t,i)=>"<div>"+i(t[e])+"</div>",option_create:(t,e)=>'<div class="create">Add <strong>'+e(t.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};t.settings.render=Object.assign({},n,t.settings.render)}setupCallbacks(){var t,e,i={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(t in i)(e=this.settings[i[t]])&&this.on(t,e)}sync(t=!0){const e=this,i=t?Lt(e.input,{delimiter:e.settings.delimiter}):e.settings;e.setupOptions(i.options,i.optgroups),e.setValue(i.items||[],!0),e.lastQuery=null}onClick(){var t=this;if(t.activeItems.length>0)return t.clearActiveItems(),void t.focus();t.isFocused&&t.isOpen?t.blur():t.focus()}onMouseDown(){}onChange(){vt(this.input,"input"),vt(this.input,"change")}onPaste(t){var e=this;e.isInputHidden||e.isLocked?lt(t):e.settings.splitOn&&setTimeout((()=>{var t=e.inputValue();if(t.match(e.settings.splitOn)){var i=t.trim().split(e.settings.splitOn);ft(i,(t=>{nt(t)&&(this.options[t]?e.addItem(t):e.createItem(t))}))}}),0)}onKeyPress(t){var e=this;if(!e.isLocked){var i=String.fromCharCode(t.keyCode||t.which);return e.settings.create&&"multi"===e.settings.mode&&i===e.settings.delimiter?(e.createItem(),void lt(t)):void 0}lt(t)}onKeyDown(t){var e=this;if(e.ignoreHover=!0,e.isLocked)9!==t.keyCode&&lt(t);else{switch(t.keyCode){case 65:if(dt(xt,t)&&""==e.control_input.value)return lt(t),void e.selectAll();break;case 27:return e.isOpen&&(lt(t,!0),e.close()),void e.clearActiveItems();case 40:if(!e.isOpen&&e.hasOptions)e.open();else if(e.activeOption){let t=e.getAdjacent(e.activeOption,1);t&&e.setActiveOption(t)}return void lt(t);case 38:if(e.activeOption){let t=e.getAdjacent(e.activeOption,-1);t&&e.setActiveOption(t)}return void lt(t);case 13:return void(e.canSelect(e.activeOption)?(e.onOptionSelect(t,e.activeOption),lt(t)):(e.settings.create&&e.createItem()||document.activeElement==e.control_input&&e.isOpen)&&lt(t));case 37:return void e.advanceSelection(-1,t);case 39:return void e.advanceSelection(1,t);case 9:return void(e.settings.selectOnTab&&(e.canSelect(e.activeOption)&&(e.onOptionSelect(t,e.activeOption),lt(t)),e.settings.create&&e.createItem()&&lt(t)));case 8:case 46:return void e.deleteSelection(t)}e.isInputHidden&&!dt(xt,t)&&lt(t)}}onInput(t){if(this.isLocked)return;const e=this.inputValue();this.lastValue!==e&&(this.lastValue=e,""!=e?(this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=((t,e)=>e>0?window.setTimeout(t,e):(t.call(null),null))((()=>{this.refreshTimeout=null,this._onInput()}),this.settings.refreshThrottle)):this._onInput())}_onInput(){const t=this.lastValue;this.settings.shouldLoad.call(this,t)&&this.load(t),this.refreshOptions(),this.trigger("type",t)}onOptionHover(t,e){this.ignoreHover||this.setActiveOption(e,!1)}onFocus(t){var e=this,i=e.isFocused;if(e.isDisabled||e.isReadOnly)return e.blur(),void lt(t);e.ignoreFocus||(e.isFocused=!0,"focus"===e.settings.preload&&e.preload(),i||e.trigger("focus"),e.activeItems.length||(e.inputState(),e.refreshOptions(!!e.settings.openOnFocus)),e.refreshState())}onBlur(t){if(!1!==document.hasFocus()){var e=this;if(e.isFocused){e.isFocused=!1,e.ignoreFocus=!1;var i=()=>{e.close(),e.setActiveItem(),e.setCaret(e.items.length),e.trigger("blur")};e.settings.create&&e.settings.createOnBlur?e.createItem(null,i):i()}}}onOptionSelect(t,e){var i,n=this;e.parentElement&&e.parentElement.matches("[data-disabled]")||(e.classList.contains("create")?n.createItem(null,(()=>{n.settings.closeAfterSelect&&n.close()})):void 0!==(i=e.dataset.value)&&(n.lastQuery=null,n.addItem(i),n.settings.closeAfterSelect&&n.close(),!n.settings.hideSelected&&t.type&&/click/.test(t.type)&&n.setActiveOption(e)))}canSelect(t){return!!(this.isOpen&&t&&this.dropdown_content.contains(t))}onItemSelect(t,e){var i=this;return!i.isLocked&&"multi"===i.settings.mode&&(lt(t),i.setActiveItem(e,t),!0)}canLoad(t){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(t)}load(t){const e=this;if(!e.canLoad(t))return;yt(e.wrapper,e.settings.loadingClass),e.loading++;const i=e.loadCallback.bind(e);e.settings.load.call(e,t,i)}loadCallback(t,e){const i=this;i.loading=Math.max(i.loading-1,0),i.lastQuery=null,i.clearActiveOption(),i.setupOptions(t,e),i.refreshOptions(i.isFocused&&!i.isInputHidden),i.loading||_t(i.wrapper,i.settings.loadingClass),i.trigger("load",t,e)}preload(){var t=this.wrapper.classList;t.contains("preloaded")||(t.add("preloaded"),this.load(""))}setTextboxValue(t=""){var e=this.control_input;e.value!==t&&(e.value=t,vt(e,"update"),this.lastValue=t)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(t,e){at(this,e?[]:["change"],(()=>{this.clear(e),this.addItems(t,e)}))}setMaxItems(t){0===t&&(t=null),this.settings.maxItems=t,this.refreshState()}setActiveItem(t,e){var i,n,r,s,o,a,l=this;if("single"!==l.settings.mode){if(!t)return l.clearActiveItems(),void(l.isFocused&&l.inputState());if("click"===(i=e&&e.type.toLowerCase())&&dt("shiftKey",e)&&l.activeItems.length){for(a=l.getLastActive(),(r=Array.prototype.indexOf.call(l.control.children,a))>(s=Array.prototype.indexOf.call(l.control.children,t))&&(o=r,r=s,s=o),n=r;n<=s;n++)t=l.control.children[n],-1===l.activeItems.indexOf(t)&&l.setActiveItemClass(t);lt(e)}else"click"===i&&dt(xt,e)||"keydown"===i&&dt("shiftKey",e)?t.classList.contains("active")?l.removeActiveItem(t):l.setActiveItemClass(t):(l.clearActiveItems(),l.setActiveItemClass(t));l.inputState(),l.isFocused||l.focus()}}setActiveItemClass(t){const e=this,i=e.control.querySelector(".last-active");i&&_t(i,"last-active"),yt(t,"active last-active"),e.trigger("item_select",t),-1==e.activeItems.indexOf(t)&&e.activeItems.push(t)}removeActiveItem(t){var e=this.activeItems.indexOf(t);this.activeItems.splice(e,1),_t(t,"active")}clearActiveItems(){_t(this.activeItems,"active"),this.activeItems=[]}setActiveOption(t,e=!0){t!==this.activeOption&&(this.clearActiveOption(),t&&(this.activeOption=t,Ct(this.focus_node,{"aria-activedescendant":t.getAttribute("id")}),Ct(t,{"aria-selected":"true"}),yt(t,"active"),e&&this.scrollToOption(t)))}scrollToOption(t,e){if(!t)return;const i=this.dropdown_content,n=i.clientHeight,r=i.scrollTop||0,s=t.offsetHeight,o=t.getBoundingClientRect().top-i.getBoundingClientRect().top+r;o+s>n+r?this.scroll(o-n+s,e):o<r&&this.scroll(o,e)}scroll(t,e){const i=this.dropdown_content;e&&(i.style.scrollBehavior=e),i.scrollTop=t,i.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(_t(this.activeOption,"active"),Ct(this.activeOption,{"aria-selected":null})),this.activeOption=null,Ct(this.focus_node,{"aria-activedescendant":null})}selectAll(){const t=this;if("single"===t.settings.mode)return;const e=t.controlChildren();e.length&&(t.inputState(),t.close(),t.activeItems=e,ft(e,(e=>{t.setActiveItemClass(e)})))}inputState(){var t=this;t.control.contains(t.control_input)&&(Ct(t.control_input,{placeholder:t.settings.placeholder}),t.activeItems.length>0||!t.isFocused&&t.settings.hidePlaceholder&&t.items.length>0?(t.setTextboxValue(),t.isInputHidden=!0):(t.settings.hidePlaceholder&&t.items.length>0&&Ct(t.control_input,{placeholder:""}),t.isInputHidden=!1),t.wrapper.classList.toggle("input-hidden",t.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var t=this;t.isDisabled||t.isReadOnly||(t.ignoreFocus=!0,t.control_input.offsetWidth?t.control_input.focus():t.focus_node.focus(),setTimeout((()=>{t.ignoreFocus=!1,t.onFocus()}),0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(t){return this.sifter.getScoreFunction(t,this.getSearchOptions())}getSearchOptions(){var t=this.settings,e=t.sortField;return"string"==typeof t.sortField&&(e=[{field:t.sortField}]),{fields:t.searchField,conjunction:t.searchConjunction,sort:e,nesting:t.nesting}}search(t){var e,i,n=this,r=this.getSearchOptions();if(n.settings.score&&"function"!=typeof(i=n.settings.score.call(n,t)))throw new Error('Tom Select "score" setting must be a function that returns a function');return t!==n.lastQuery?(n.lastQuery=t,e=n.sifter.search(t,Object.assign(r,{score:i})),n.currentResults=e):e=Object.assign({},n.currentResults),n.settings.hideSelected&&(e.items=e.items.filter((t=>{let e=nt(t.id);return!(e&&-1!==n.items.indexOf(e))}))),e}refreshOptions(t=!0){var e,i,n,r,s,o,a,l,c,d;const u={},h=[];var p=this,f=p.inputValue();const g=f===p.lastQuery||""==f&&null==p.lastQuery;var m=p.search(f),v=null,b=p.settings.shouldOpen||!1,y=p.dropdown_content;g&&(v=p.activeOption)&&(c=v.closest("[data-group]")),r=m.items.length,"number"==typeof p.settings.maxOptions&&(r=Math.min(r,p.settings.maxOptions)),r>0&&(b=!0);const _=(t,e)=>{let i=u[t];if(void 0!==i){let t=h[i];if(void 0!==t)return[i,t.fragment]}let n=document.createDocumentFragment();return i=h.length,h.push({fragment:n,order:e,optgroup:t}),[i,n]};for(e=0;e<r;e++){let t=m.items[e];if(!t)continue;let r=t.id,a=p.options[r];if(void 0===a)continue;let l=rt(r),d=p.getOption(l,!0);for(p.settings.hideSelected||d.classList.toggle("selected",p.items.includes(l)),s=a[p.settings.optgroupField]||"",i=0,n=(o=Array.isArray(s)?s:[s])&&o.length;i<n;i++){s=o[i];let t=a.$order,e=p.optgroups[s];void 0===e?s="":t=e.$order;const[n,l]=_(s,t);i>0&&(d=d.cloneNode(!0),Ct(d,{id:a.$id+"-clone-"+i,"aria-selected":null}),d.classList.add("ts-cloned"),_t(d,"active"),p.activeOption&&p.activeOption.dataset.value==r&&c&&c.dataset.group===s.toString()&&(v=d)),l.appendChild(d),""!=s&&(u[s]=n)}}var w;p.settings.lockOptgroupOrder&&h.sort(((t,e)=>t.order-e.order)),a=document.createDocumentFragment(),ft(h,(t=>{let e=t.fragment,i=t.optgroup;if(!e||!e.children.length)return;let n=p.optgroups[i];if(void 0!==n){let t=document.createDocumentFragment(),i=p.render("optgroup_header",n);pt(t,i),pt(t,e);let r=p.render("optgroup",{group:n,options:t});pt(a,r)}else pt(a,e)})),y.innerHTML="",pt(y,a),p.settings.highlight&&(w=y.querySelectorAll("span.highlight"),Array.prototype.forEach.call(w,(function(t){var e=t.parentNode;e.replaceChild(t.firstChild,t),e.normalize()})),m.query.length&&m.tokens.length&&ft(m.tokens,(t=>{Dt(y,t.regex)})));var E=t=>{let e=p.render(t,{input:f});return e&&(b=!0,y.insertBefore(e,y.firstChild)),e};if(p.loading?E("loading"):p.settings.shouldLoad.call(p,f)?0===m.items.length&&E("no_results"):E("not_loading"),(l=p.canCreate(f))&&(d=E("option_create")),p.hasOptions=m.items.length>0||l,b){if(m.items.length>0){if(v||"single"!==p.settings.mode||null==p.items[0]||(v=p.getOption(p.items[0])),!y.contains(v)){let t=0;d&&!p.settings.addPrecedence&&(t=1),v=p.selectable()[t]}}else d&&(v=d);t&&!p.isOpen&&(p.open(),p.scrollToOption(v,"auto")),p.setActiveOption(v)}else p.clearActiveOption(),t&&p.isOpen&&p.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(t,e=!1){const i=this;if(Array.isArray(t))return i.addOptions(t,e),!1;const n=nt(t[i.settings.valueField]);return null!==n&&!i.options.hasOwnProperty(n)&&(t.$order=t.$order||++i.order,t.$id=i.inputId+"-opt-"+t.$order,i.options[n]=t,i.lastQuery=null,e&&(i.userOptions[n]=e,i.trigger("option_add",n,t)),n)}addOptions(t,e=!1){ft(t,(t=>{this.addOption(t,e)}))}registerOption(t){return this.addOption(t)}registerOptionGroup(t){var e=nt(t[this.settings.optgroupValueField]);return null!==e&&(t.$order=t.$order||++this.order,this.optgroups[e]=t,e)}addOptionGroup(t,e){var i;e[this.settings.optgroupValueField]=t,(i=this.registerOptionGroup(e))&&this.trigger("optgroup_add",i,e)}removeOptionGroup(t){this.optgroups.hasOwnProperty(t)&&(delete this.optgroups[t],this.clearCache(),this.trigger("optgroup_remove",t))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(t,e){const i=this;var n,r;const s=nt(t),o=nt(e[i.settings.valueField]);if(null===s)return;const a=i.options[s];if(null==a)return;if("string"!=typeof o)throw new Error("Value must be set in option data");const l=i.getOption(s),c=i.getItem(s);if(e.$order=e.$order||a.$order,delete i.options[s],i.uncacheValue(o),i.options[o]=e,l){if(i.dropdown_content.contains(l)){const t=i._render("option",e);Ot(l,t),i.activeOption===l&&i.setActiveOption(t)}l.remove()}c&&(-1!==(r=i.items.indexOf(s))&&i.items.splice(r,1,o),n=i._render("item",e),c.classList.contains("active")&&yt(n,"active"),Ot(c,n)),i.lastQuery=null}removeOption(t,e){const i=this;t=rt(t),i.uncacheValue(t),delete i.userOptions[t],delete i.options[t],i.lastQuery=null,i.trigger("option_remove",t),i.removeItem(t,e)}clearOptions(t){const e=(t||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const i={};ft(this.options,((t,n)=>{e(t,n)&&(i[n]=t)})),this.options=this.sifter.items=i,this.lastQuery=null,this.trigger("option_clear")}clearFilter(t,e){return this.items.indexOf(e)>=0}getOption(t,e=!1){const i=nt(t);if(null===i)return null;const n=this.options[i];if(null!=n){if(n.$div)return n.$div;if(e)return this._render("option",n)}return null}getAdjacent(t,e,i="option"){var n;if(!t)return null;n="item"==i?this.controlChildren():this.dropdown_content.querySelectorAll("[data-selectable]");for(let i=0;i<n.length;i++)if(n[i]==t)return e>0?n[i+1]:n[i-1];return null}getItem(t){if("object"==typeof t)return t;var e=nt(t);return null!==e?this.control.querySelector(`[data-value="${ht(e)}"]`):null}addItems(t,e){var i=this,n=Array.isArray(t)?t:[t];const r=(n=n.filter((t=>-1===i.items.indexOf(t))))[n.length-1];n.forEach((t=>{i.isPending=t!==r,i.addItem(t,e)}))}addItem(t,e){at(this,e?[]:["change","dropdown_close"],(()=>{var i,n;const r=this,s=r.settings.mode,o=nt(t);if((!o||-1===r.items.indexOf(o)||("single"===s&&r.close(),"single"!==s&&r.settings.duplicates))&&null!==o&&r.options.hasOwnProperty(o)&&("single"===s&&r.clear(e),"multi"!==s||!r.isFull())){if(i=r._render("item",r.options[o]),r.control.contains(i)&&(i=i.cloneNode(!0)),n=r.isFull(),r.items.splice(r.caretPos,0,o),r.insertAtCaret(i),r.isSetup){if(!r.isPending&&r.settings.hideSelected){let t=r.getOption(o),e=r.getAdjacent(t,1);e&&r.setActiveOption(e)}r.isPending||r.settings.closeAfterSelect||r.refreshOptions(r.isFocused&&"single"!==s),0!=r.settings.closeAfterSelect&&r.isFull()?r.close():r.isPending||r.positionDropdown(),r.trigger("item_add",o,i),r.isPending||r.updateOriginalInput({silent:e})}(!r.isPending||!n&&r.isFull())&&(r.inputState(),r.refreshState())}}))}removeItem(t=null,e){const i=this;if(!(t=i.getItem(t)))return;var n,r;const s=t.dataset.value;n=St(t),t.remove(),t.classList.contains("active")&&(r=i.activeItems.indexOf(t),i.activeItems.splice(r,1),_t(t,"active")),i.items.splice(n,1),i.lastQuery=null,!i.settings.persist&&i.userOptions.hasOwnProperty(s)&&i.removeOption(s,e),n<i.caretPos&&i.setCaret(i.caretPos-1),i.updateOriginalInput({silent:e}),i.refreshState(),i.positionDropdown(),i.trigger("item_remove",s,t)}createItem(t=null,e=()=>{}){3===arguments.length&&(e=arguments[2]),"function"!=typeof e&&(e=()=>{});var i,n=this,r=n.caretPos;if(t=t||n.inputValue(),!n.canCreate(t))return e(),!1;n.lock();var s=!1,o=t=>{if(n.unlock(),!t||"object"!=typeof t)return e();var i=nt(t[n.settings.valueField]);if("string"!=typeof i)return e();n.setTextboxValue(),n.addOption(t,!0),n.setCaret(r),n.addItem(i),e(t),s=!0};return i="function"==typeof n.settings.create?n.settings.create.call(this,t,o):{[n.settings.labelField]:t,[n.settings.valueField]:t},s||o(i),!0}refreshItems(){var t=this;t.lastQuery=null,t.isSetup&&t.addItems(t.items),t.updateOriginalInput(),t.refreshState()}refreshState(){const t=this;t.refreshValidityState();const e=t.isFull(),i=t.isLocked;t.wrapper.classList.toggle("rtl",t.rtl);const n=t.wrapper.classList;var r;n.toggle("focus",t.isFocused),n.toggle("disabled",t.isDisabled),n.toggle("readonly",t.isReadOnly),n.toggle("required",t.isRequired),n.toggle("invalid",!t.isValid),n.toggle("locked",i),n.toggle("full",e),n.toggle("input-active",t.isFocused&&!t.isInputHidden),n.toggle("dropdown-active",t.isOpen),n.toggle("has-options",(r=t.options,0===Object.keys(r).length)),n.toggle("has-items",t.items.length>0)}refreshValidityState(){var t=this;t.input.validity&&(t.isValid=t.input.validity.valid,t.isInvalid=!t.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(t={}){const e=this;var i,n;const r=e.input.querySelector('option[value=""]');if(e.is_select_tag){const s=[],o=e.input.querySelectorAll("option:checked").length;function a(t,i,n){return t||(t=gt('<option value="'+st(i)+'">'+st(n)+"</option>")),t!=r&&e.input.append(t),s.push(t),(t!=r||o>0)&&(t.selected=!0),t}e.input.querySelectorAll("option:checked").forEach((t=>{t.selected=!1})),0==e.items.length&&"single"==e.settings.mode?a(r,"",""):e.items.forEach((t=>{if(i=e.options[t],n=i[e.settings.labelField]||"",s.includes(i.$option)){a(e.input.querySelector(`option[value="${ht(t)}"]:not(:checked)`),t,n)}else i.$option=a(i.$option,t,n)}))}else e.input.value=e.getValue();e.isSetup&&(t.silent||e.trigger("change",e.getValue()))}open(){var t=this;t.isLocked||t.isOpen||"multi"===t.settings.mode&&t.isFull()||(t.isOpen=!0,Ct(t.focus_node,{"aria-expanded":"true"}),t.refreshState(),bt(t.dropdown,{visibility:"hidden",display:"block"}),t.positionDropdown(),bt(t.dropdown,{visibility:"visible",display:"block"}),t.focus(),t.trigger("dropdown_open",t.dropdown))}close(t=!0){var e=this,i=e.isOpen;t&&(e.setTextboxValue(),"single"===e.settings.mode&&e.items.length&&e.inputState()),e.isOpen=!1,Ct(e.focus_node,{"aria-expanded":"false"}),bt(e.dropdown,{display:"none"}),e.settings.hideSelected&&e.clearActiveOption(),e.refreshState(),i&&e.trigger("dropdown_close",e.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var t=this.control,e=t.getBoundingClientRect(),i=t.offsetHeight+e.top+window.scrollY,n=e.left+window.scrollX;bt(this.dropdown,{width:e.width+"px",top:i+"px",left:n+"px"})}}clear(t){var e=this;if(e.items.length){var i=e.controlChildren();ft(i,(t=>{e.removeItem(t,!0)})),e.inputState(),t||e.updateOriginalInput(),e.trigger("clear")}}insertAtCaret(t){const e=this,i=e.caretPos,n=e.control;n.insertBefore(t,n.children[i]||null),e.setCaret(i+1)}deleteSelection(t){var e,i,n,r,s,o=this;e=t&&8===t.keyCode?-1:1,i={start:(s=o.control_input).selectionStart||0,length:(s.selectionEnd||0)-(s.selectionStart||0)};const a=[];if(o.activeItems.length)r=kt(o.activeItems,e),n=St(r),e>0&&n++,ft(o.activeItems,(t=>a.push(t)));else if((o.isFocused||"single"===o.settings.mode)&&o.items.length){const t=o.controlChildren();let n;e<0&&0===i.start&&0===i.length?n=t[o.caretPos-1]:e>0&&i.start===o.inputValue().length&&(n=t[o.caretPos]),void 0!==n&&a.push(n)}if(!o.shouldDelete(a,t))return!1;for(lt(t,!0),void 0!==n&&o.setCaret(n);a.length;)o.removeItem(a.pop());return o.inputState(),o.positionDropdown(),o.refreshOptions(!1),!0}shouldDelete(t,e){const i=t.map((t=>t.dataset.value));return!(!i.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(i,e))}advanceSelection(t,e){var i,n,r=this;r.rtl&&(t*=-1),r.inputValue().length||(dt(xt,e)||dt("shiftKey",e)?(n=(i=r.getLastActive(t))?i.classList.contains("active")?r.getAdjacent(i,t,"item"):i:t>0?r.control_input.nextElementSibling:r.control_input.previousElementSibling)&&(n.classList.contains("active")&&r.removeActiveItem(i),r.setActiveItemClass(n)):r.moveCaret(t))}moveCaret(t){}getLastActive(t){let e=this.control.querySelector(".last-active");if(e)return e;var i=this.control.querySelectorAll(".active");return i?kt(i,t):void 0}setCaret(t){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(t=this.isReadOnly||this.isDisabled){this.isLocked=t,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(t){this.focus_node.tabIndex=t?-1:this.tabIndex,this.isDisabled=t,this.input.disabled=t,this.control_input.disabled=t,this.setLocked()}setReadOnly(t){this.isReadOnly=t,this.input.readOnly=t,this.control_input.readOnly=t,this.setLocked()}destroy(){var t=this,e=t.revertSettings;t.trigger("destroy"),t.off(),t.wrapper.remove(),t.dropdown.remove(),t.input.innerHTML=e.innerHTML,t.input.tabIndex=e.tabIndex,_t(t.input,"tomselected","ts-hidden-accessible"),t._destroy(),delete t.input.tomselect}render(t,e){var i,n;const r=this;if("function"!=typeof this.settings.render[t])return null;if(!(n=r.settings.render[t].call(this,e,st)))return null;if(n=gt(n),"option"===t||"option_create"===t?e[r.settings.disabledField]?Ct(n,{"aria-disabled":"true"}):Ct(n,{"data-selectable":""}):"optgroup"===t&&(i=e.group[r.settings.optgroupValueField],Ct(n,{"data-group":i}),e.group[r.settings.disabledField]&&Ct(n,{"data-disabled":""})),"option"===t||"item"===t){const i=rt(e[r.settings.valueField]);Ct(n,{"data-value":i}),"item"===t?(yt(n,r.settings.itemClass),Ct(n,{"data-ts-item":""})):(yt(n,r.settings.optionClass),Ct(n,{role:"option",id:e.$id}),e.$div=n,r.options[i]=e)}return n}_render(t,e){const i=this.render(t,e);if(null==i)throw"HTMLElement expected";return i}clearCache(){ft(this.options,(t=>{t.$div&&(t.$div.remove(),delete t.$div)}))}uncacheValue(t){const e=this.getOption(t);e&&e.remove()}canCreate(t){return this.settings.create&&t.length>0&&this.settings.createFilter.call(this,t)}hook(t,e,i){var n=this,r=n[e];n[e]=function(){var e,s;return"after"===t&&(e=r.apply(n,arguments)),s=i.apply(n,arguments),"instead"===t?s:("before"===t&&(e=r.apply(n,arguments)),e)}}};const Mt=t=>"boolean"==typeof t?t?"1":"0":t+"",Nt=(t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())},jt=t=>"string"==typeof t&&t.indexOf("<")>-1;const Pt=t=>"string"==typeof t&&t.indexOf("<")>-1;const $t=(t,e,i,n)=>{t.addEventListener(e,i,n)},Ht=t=>"string"==typeof t&&t.indexOf("<")>-1,qt=(t,e)=>{((t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)})(e,((e,i)=>{null==e?t.removeAttribute(i):t.setAttribute(i,""+e)}))};const Rt=t=>"string"==typeof t&&t.indexOf("<")>-1;const Bt=t=>{var e=[];return((t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)})(t,(t=>{"string"==typeof t&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))})),e.filter(Boolean)},Vt=t=>(Array.isArray(t)||(t=[t]),t);const zt=t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(Wt(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)},Wt=t=>"string"==typeof t&&t.indexOf("<")>-1,Yt=t=>{var e=[];return((t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)})(t,(t=>{"string"==typeof t&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))})),e.filter(Boolean)},Kt=t=>(Array.isArray(t)||(t=[t]),t);const Ut=(t,e,i,n)=>{t.addEventListener(e,i,n)};const Xt=(t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())},Qt=(t,e,i,n)=>{t.addEventListener(e,i,n)},Gt=t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(Jt(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)},Jt=t=>"string"==typeof t&&t.indexOf("<")>-1;const Zt=t=>{var e=[];return((t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)})(t,(t=>{"string"==typeof t&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))})),e.filter(Boolean)},te=t=>(Array.isArray(t)||(t=[t]),t);Ft.define("change_listener",(function(){var t,e,i,n;t=this.input,e="change",i=()=>{this.sync()},t.addEventListener(e,i,n)})),Ft.define("checkbox_options",(function(t){var e=this,i=e.onOptionSelect;e.settings.hideSelected=!1;const n=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},t);var r=function(t,e){e?(t.checked=!0,n.uncheckedClassNames&&t.classList.remove(...n.uncheckedClassNames),n.checkedClassNames&&t.classList.add(...n.checkedClassNames)):(t.checked=!1,n.checkedClassNames&&t.classList.remove(...n.checkedClassNames),n.uncheckedClassNames&&t.classList.add(...n.uncheckedClassNames))},s=function(t){setTimeout((()=>{var e=t.querySelector("input."+n.className);e instanceof HTMLInputElement&&r(e,t.classList.contains("selected"))}),1)};e.hook("after","setupTemplates",(()=>{var t=e.settings.render.option;e.settings.render.option=(i,s)=>{var o=(t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(jt(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)})(t.call(e,i,s)),a=document.createElement("input");n.className&&a.classList.add(n.className),a.addEventListener("click",(function(t){Nt(t)})),a.type="checkbox";const l=null==(c=i[e.settings.valueField])?null:Mt(c);var c;return r(a,!!(l&&e.items.indexOf(l)>-1)),o.prepend(a),o}})),e.on("item_remove",(t=>{var i=e.getOption(t);i&&(i.classList.remove("selected"),s(i))})),e.on("item_add",(t=>{var i=e.getOption(t);i&&s(i)})),e.hook("instead","onOptionSelect",((t,n)=>{if(n.classList.contains("selected"))return n.classList.remove("selected"),e.removeItem(n.dataset.value),e.refreshOptions(),void Nt(t,!0);i.call(e,t,n),s(n)}))})),Ft.define("clear_button",(function(t){const e=this,i=Object.assign({className:"clear-button",title:"Clear All",html:t=>`<div class="${t.className}" title="${t.title}">&#10799;</div>`},t);e.on("initialize",(()=>{var t=(t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(Pt(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)})(i.html(i));t.addEventListener("click",(t=>{e.isLocked||(e.clear(),"single"===e.settings.mode&&e.settings.allowEmptyOption&&e.addItem(""),t.preventDefault(),t.stopPropagation())})),e.control.appendChild(t)}))})),Ft.define("drag_drop",(function(){var t=this;if("multi"!==t.settings.mode)return;var e=t.lock,i=t.unlock;let n,r=!0;t.hook("after","setupTemplates",(()=>{var e=t.settings.render.item;t.settings.render.item=(i,s)=>{const o=(t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(Ht(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)})(e.call(t,i,s));qt(o,{draggable:"true"});const a=t=>{t.preventDefault(),o.classList.add("ts-drag-over"),l(o,n)},l=(t,e)=>{var i,n,r;void 0!==e&&(((t,e)=>{do{var i;if(t==(e=null==(i=e)?void 0:i.previousElementSibling))return!0}while(e&&e.previousElementSibling);return!1})(e,o)?(n=e,null==(r=(i=t).parentNode)||r.insertBefore(n,i.nextSibling)):((t,e)=>{var i;null==(i=t.parentNode)||i.insertBefore(e,t)})(t,e))};return $t(o,"mousedown",(t=>{r||((t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())})(t),t.stopPropagation()})),$t(o,"dragstart",(t=>{n=o,setTimeout((()=>{o.classList.add("ts-dragging")}),0)})),$t(o,"dragenter",a),$t(o,"dragover",a),$t(o,"dragleave",(()=>{o.classList.remove("ts-drag-over")})),$t(o,"dragend",(()=>{var e;document.querySelectorAll(".ts-drag-over").forEach((t=>t.classList.remove("ts-drag-over"))),null==(e=n)||e.classList.remove("ts-dragging"),n=void 0;var i=[];t.control.querySelectorAll("[data-value]").forEach((t=>{if(t.dataset.value){let e=t.dataset.value;e&&i.push(e)}})),t.setValue(i)})),o}})),t.hook("instead","lock",(()=>(r=!1,e.call(t)))),t.hook("instead","unlock",(()=>(r=!0,i.call(t))))})),Ft.define("dropdown_header",(function(t){const e=this,i=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:t=>'<div class="'+t.headerClass+'"><div class="'+t.titleRowClass+'"><span class="'+t.labelClass+'">'+t.title+'</span><a class="'+t.closeClass+'">&times;</a></div></div>'},t);e.on("initialize",(()=>{var t=(t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(Rt(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)})(i.html(i)),n=t.querySelector("."+i.closeClass);n&&n.addEventListener("click",(t=>{((t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())})(t,!0),e.close()})),e.dropdown.insertBefore(t,e.dropdown.firstChild)}))})),Ft.define("caret_position",(function(){var t=this;t.hook("instead","setCaret",(e=>{"single"!==t.settings.mode&&t.control.contains(t.control_input)?(e=Math.max(0,Math.min(t.items.length,e)))==t.caretPos||t.isPending||t.controlChildren().forEach(((i,n)=>{n<e?t.control_input.insertAdjacentElement("beforebegin",i):t.control.appendChild(i)})):e=t.items.length,t.caretPos=e})),t.hook("instead","moveCaret",(e=>{if(!t.isFocused)return;const i=t.getLastActive(e);if(i){const n=((t,e)=>{if(!t)return-1;e=e||t.nodeName;for(var i=0;t=t.previousElementSibling;)t.matches(e)&&i++;return i})(i);t.setCaret(e>0?n+1:n),t.setActiveItem(),((t,...e)=>{var i=Bt(e);(t=Vt(t)).map((t=>{i.map((e=>{t.classList.remove(e)}))}))})(i,"last-active")}else t.setCaret(t.caretPos+e)}))})),Ft.define("dropdown_input",(function(){const t=this;t.settings.shouldOpen=!0,t.hook("before","setup",(()=>{t.focus_node=t.control,((t,...e)=>{var i=Yt(e);(t=Kt(t)).map((t=>{i.map((e=>{t.classList.add(e)}))}))})(t.control_input,"dropdown-input");const e=zt('<div class="dropdown-input-wrap">');e.append(t.control_input),t.dropdown.insertBefore(e,t.dropdown.firstChild);const i=zt('<input class="items-placeholder" tabindex="-1" />');i.placeholder=t.settings.placeholder||"",t.control.append(i)})),t.on("initialize",(()=>{t.control_input.addEventListener("keydown",(e=>{switch(e.keyCode){case 27:return t.isOpen&&(((t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())})(e,!0),t.close()),void t.clearActiveItems();case 9:t.focus_node.tabIndex=-1}return t.onKeyDown.call(t,e)})),t.on("blur",(()=>{t.focus_node.tabIndex=t.isDisabled?-1:t.tabIndex})),t.on("dropdown_open",(()=>{t.control_input.focus()}));const e=t.onBlur;var i,n,r,s;t.hook("instead","onBlur",(i=>{if(!i||i.relatedTarget!=t.control_input)return e.call(t)})),i=t.control_input,n="blur",r=()=>t.onBlur(),i.addEventListener(n,r,s),t.hook("before","close",(()=>{t.isOpen&&t.focus_node.focus({preventScroll:!0})}))}))})),Ft.define("input_autogrow",(function(){var t=this;t.on("initialize",(()=>{var e=document.createElement("span"),i=t.control_input;e.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",t.wrapper.appendChild(e);for(const t of["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"])e.style[t]=i.style[t];var n=()=>{e.textContent=i.value,i.style.width=e.clientWidth+"px"};n(),t.on("update item_add item_remove",n),Ut(i,"input",n),Ut(i,"keyup",n),Ut(i,"blur",n),Ut(i,"update",n)}))})),Ft.define("no_backspace_delete",(function(){var t=this,e=t.deleteSelection;this.hook("instead","deleteSelection",(i=>!!t.activeItems.length&&e.call(t,i)))})),Ft.define("no_active_items",(function(){this.hook("instead","setActiveItem",(()=>{})),this.hook("instead","selectAll",(()=>{}))})),Ft.define("optgroup_columns",(function(){var t=this,e=t.onKeyDown;t.hook("instead","onKeyDown",(i=>{var n,r,s,o;if(!t.isOpen||37!==i.keyCode&&39!==i.keyCode)return e.call(t,i);t.ignoreHover=!0,o=((t,e)=>{for(;t&&t.matches;){if(t.matches(e))return t;t=t.parentNode}})(t.activeOption,"[data-group]"),n=((t,e)=>{if(!t)return-1;e=e||t.nodeName;for(var i=0;t=t.previousElementSibling;)t.matches(e)&&i++;return i})(t.activeOption,"[data-selectable]"),o&&(o=37===i.keyCode?o.previousSibling:o.nextSibling)&&(r=(s=o.querySelectorAll("[data-selectable]"))[Math.min(s.length-1,n)])&&t.setActiveOption(r)}))})),Ft.define("remove_button",(function(t){const e=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},t);var i=this;if(e.append){var n='<a href="javascript:void(0)" class="'+e.className+'" tabindex="-1" title="'+((e.title+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")+'">')+e.label+"</a>";i.hook("after","setupTemplates",(()=>{var t=i.settings.render.item;i.settings.render.item=(e,r)=>{var s=Gt(t.call(i,e,r)),o=Gt(n);return s.appendChild(o),Qt(o,"mousedown",(t=>{Xt(t,!0)})),Qt(o,"click",(t=>{i.isLocked||(Xt(t,!0),i.isLocked||i.shouldDelete([s],t)&&(i.removeItem(s),i.refreshOptions(!1),i.inputState()))})),s}}))}})),Ft.define("restore_on_backspace",(function(t){const e=this,i=Object.assign({text:t=>t[e.settings.labelField]},t);e.on("item_remove",(function(t){if(e.isFocused&&""===e.control_input.value.trim()){var n=e.options[t];n&&e.setTextboxValue(i.text.call(e,n))}}))})),Ft.define("virtual_scroll",(function(){const t=this,e=t.canLoad,i=t.clearActiveOption,n=t.loadCallback;var r,s,o={},a=!1,l=[];if(t.settings.shouldLoadMore||(t.settings.shouldLoadMore=()=>{if(r.clientHeight/(r.scrollHeight-r.scrollTop)>.9)return!0;if(t.activeOption){var e=t.selectable();if(Array.from(e).indexOf(t.activeOption)>=e.length-2)return!0}return!1}),!t.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";t.settings.sortField=[{field:"$order"},{field:"$score"}];const c=e=>!("number"==typeof t.settings.maxOptions&&r.children.length>=t.settings.maxOptions)&&!(!(e in o)||!o[e]),d=(e,i)=>t.items.indexOf(i)>=0||l.indexOf(i)>=0;t.setNextUrl=(t,e)=>{o[t]=e},t.getUrl=e=>{if(e in o){const t=o[e];return o[e]=!1,t}return t.clearPagination(),t.settings.firstUrl.call(t,e)},t.clearPagination=()=>{o={}},t.hook("instead","clearActiveOption",(()=>{if(!a)return i.call(t)})),t.hook("instead","canLoad",(i=>i in o?c(i):e.call(t,i))),t.hook("instead","loadCallback",((e,i)=>{if(a){if(s){const i=e[0];void 0!==i&&(s.dataset.value=i[t.settings.valueField])}}else t.clearOptions(d);n.call(t,e,i),a=!1})),t.hook("after","refreshOptions",(()=>{const e=t.lastValue;var i;c(e)?(i=t.render("loading_more",{query:e}))&&(i.setAttribute("data-selectable",""),s=i):e in o&&!r.querySelector(".no-results")&&(i=t.render("no_more_results",{query:e})),i&&(((t,...e)=>{var i=Zt(e);(t=te(t)).map((t=>{i.map((e=>{t.classList.add(e)}))}))})(i,t.settings.optionClass),r.append(i))})),t.on("initialize",(()=>{l=Object.keys(t.options),r=t.dropdown_content,t.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>'},t.settings.render),r.addEventListener("scroll",(()=>{t.settings.shouldLoadMore.call(t)&&c(t.lastValue)&&(a||(a=!0,t.load.call(t,t.lastValue)))}))}))}));class ee{constructor(t){this.datepicker=t}onDatagridInit(t){return t.ajax.addEventListener("complete",(e=>{this.initDatepicker(t)})),this.initDatepicker(t),!0}initDatepicker(t){const e=t.el.querySelectorAll("input[data-provide='datepicker']");e.length>=1&&this.datepicker.initDatepickers(Array.from(e),t)}}class ie{constructor(t){this.happy=t}onDatagridInit(t){var e,i;const n=null!==(i=null!==(e=this.happy)&&void 0!==e?e:E().happy)&&void 0!==i?i:null;return n&&n.init(),!0}}class ne{constructor(t){this.nette=t}onDatagridInit(t){var e,i;const n=null!==(i=null!==(e=this.nette)&&void 0!==e?e:E().Nette)&&void 0!==i?i:null;return n&&t.el.querySelectorAll("form").forEach((t=>n.initForm(t))),!0}}class re{constructor(t){this.selectpicker=t}onDatagridInit(t){return t.ajax.addEventListener("complete",(e=>{this.initSelectpicker(t)})),this.initSelectpicker(t),!0}initSelectpicker(t){const e=t.el.querySelectorAll("select.selectpicker");e.length>=1&&this.selectpicker.initSelectpickers(Array.from(e),t)}}class se{constructor(t){this.sortable=t}onDatagridInit(t){return t.ajax.addEventListener("before",(t=>{})),this.sortable.initSortable(t),t.ajax.addEventListener("success",(({detail:{payload:e}})=>{if(e._datagrid_sort){for(const i in e._datagrid_sort){const n=e._datagrid_sort[i],r=t.el.querySelector(`#datagrid-sort-${i}`);r&&(r.setAttribute("href",n),r.setAttribute("data-href",n))}this.sortable.initSortable(t)}if(e._datagrid_tree){const i=t.el.querySelector(`.datagrid-tree-item[data-id='${e._datagrid_tree}'] .datagrid-tree-item-children`);if(i&&e.snippets){i.classList.add("loaded");for(const t in e.snippets){const n=e.snippets[t],r=(new DOMParser).parseFromString(n,"text/html").firstElementChild;if(r){const e=document.createElement("div");e.id=t,e.classList.add("datagrid-tree-item"),e.setAttribute("data-id",t),r.hasAttribute("has-children")&&e.classList.add("has-children"),i.append(e)}}}this.sortable.initSortableTree(t)}})),!0}}class oe{onDatagridInit(t){return t.ajax.addEventListener("complete",(e=>{this.initPerPage(t),this.initChange(t)})),this.initPerPage(t),this.initChange(t),!0}initPerPage(t){t.el.querySelectorAll("select[data-autosubmit-per-page]").forEach((e=>{e.addEventListener("change",(()=>{var i,n;let r=null===(i=e.parentElement)||void 0===i?void 0:i.querySelector("input[type=submit]");if(r||(r=null===(n=e.parentElement)||void 0===n?void 0:n.querySelector("button[type=submit]")),console.log({inputEl:r}),!(r instanceof HTMLElement))return;const s=r.closest("form");console.log({form:s}),s&&t.ajax.submitForm(s)}))}))}initChange(t){t.el.querySelectorAll("[data-autosubmit]").forEach((e=>{const i=e.closest("form");i&&"true"!==e.dataset.listenersAttached&&(e.dataset.listenersAttached="true",e instanceof HTMLSelectElement?e.addEventListener("change",(()=>t.ajax.submitForm(i))):e instanceof HTMLInputElement&&(e.hasAttribute("data-autosubmit-change")&&e.addEventListener("change",A((()=>t.ajax.submitForm(i)))),e.addEventListener("keyup",A((e=>{if(w(e)||!function(t,e,i){const n=1===t.key.length?t.key.charCodeAt(0):0;return n>=e&&n<=i}(e,9,40)&&!function(t){return 2===t.key.length&&t.key.startsWith("F")}(e))return t.ajax.submitForm(i)})))))}))}}class ae{onDatagridInit(t){let e=null;t.el.addEventListener("click",(t=>{if(t.target instanceof HTMLElement&&t.target.classList.contains("col-checkbox")&&(e=t.target,t.shiftKey&&e)){const t=e.closest("tr");if(!t)return;const i=e.closest("tr");if(!i)return;const n=i.closest("tbody");if(!n)return;const r=Array.from(n.querySelectorAll("tr")),[s,o]=[i.rowIndex,t.rowIndex].sort();r.slice(s,o+1).forEach((t=>{const e=t.querySelector('.col-checkbox input[type="checkbox"]');e&&(e.checked=!0)}))}}));let i=t.el.querySelectorAll(`input[data-check='${t.name}']`);const n=t.el.querySelector("select[name='group_action[group_action]']"),r=document.querySelectorAll(".row-group-actions *[type='submit']"),s=document.querySelector(".datagrid-selected-rows-count");return i.forEach((e=>{e.addEventListener("change",(()=>{if(e.hasAttribute("data-check-all")){if(t.name!==e.getAttribute("data-check-all"))return;if(i.forEach((t=>t.checked=e.checked)),r.forEach((t=>t.disabled=!e.checked)),n&&(n.disabled=!e.checked),s){const t=Array.from(i).filter((t=>!t.hasAttribute("data-check-all"))).length;s.innerText=`${e.checked?t:0}/${t}`}return}{const e=t.el.querySelector(`input[data-check='${t.name}'][data-check-all]`);e&&(e.checked=Array.from(i).filter((t=>!t.hasAttribute("data-check-all"))).every((t=>t.checked)))}const o=Array.from(i).filter((t=>t.checked&&!e.hasAttribute("data-check-all"))),a=o.length>=1;r.forEach((t=>t.disabled=!a)),n&&(n.disabled=!a),s&&(s.innerText=`${o.length}/${i.length}`)}))})),!0}}const le="data-datagrid-confirm";class ce{onDatagridInit(t){return t.el.querySelectorAll(`[${le}]:not(.ajax)`).forEach((e=>e.addEventListener("click",(e=>this.confirmEventHandler.bind(t)(e.target,e))))),t.ajax.addEventListener("interact",(e=>this.confirmEventHandler.bind(t)(e.detail.element,e))),!0}confirmEventHandler(t,e){var i;const n=null===(i=t.closest("a"))||void 0===i?void 0:i.getAttribute(le);n&&(window.confirm.bind(window)(n)||(e.stopPropagation(),e.preventDefault()))}}class de{onInit(t){}onDatagridInit(t){return t.ajax.addEventListener("success",(({detail:{payload:e}})=>{var i,n;if(e._datagrid_name&&e._datagrid_name===t.name)if(e._datagrid_inline_edited||e._datagrid_inline_edit_cancel){const i=t.el.querySelector(".datagrid-inline-edit-trigger");if(e._datagrid_inline_edited){t.el.querySelectorAll(`tr[data-id='${e._datagrid_inline_edited}'] > td`).forEach((t=>{t.classList.add("edited")}))}null==i||i.classList.remove("hidden")}else{if(e._datagrid_inline_adding){const e=t.el.querySelector(".datagrid-row-inline-add");e&&(e.classList.remove("datagrid-row-inline-add-hidden"),null===(i=e.querySelector("input:not([readonly]), textarea:not([readonly])"))||void 0===i||i.focus())}e._datagrid_inline_editing&&(null===(n=t.el.querySelector(".datagrid-inline-edit-trigger"))||void 0===n||n.classList.add("hidden")),t.el.querySelectorAll(".datagrid-inline-edit input").forEach((t=>{t.addEventListener("keydown",(e=>{var i,n;if(w(e))return e.stopPropagation(),e.preventDefault(),null===(n=null===(i=t.closest("tr"))||void 0===i?void 0:i.querySelector(".col-action-inline-edit [name='inline_edit[submit]']"))||void 0===n?void 0:n.click()}))})),t.el.querySelectorAll(".datagrid-inline-add input").forEach((t=>{t.addEventListener("keydown",(e=>{var i,n;if(w(e))return e.stopPropagation(),e.preventDefault(),null===(n=null===(i=t.closest("tr"))||void 0===i?void 0:i.querySelector(".col-action-inline-edit [name='inline_add[submit]']"))||void 0===n?void 0:n.click()}))})),t.el.querySelectorAll("[data-datagrid-cancel-inline-add]").forEach((t=>{t.addEventListener("mouseup",(e=>{if(0===e.button){e.stopPropagation(),e.preventDefault();const i=t.closest(".datagrid-row-inline-add");i&&i.classList.add("datagrid-row-inline-add-hidden")}}))}))}})),!0}}class ue{onDatagridInit(t){return t.el.querySelectorAll("[data-toggle-detail-grid]").forEach((e=>{if(e.getAttribute("data-toggle-detail-grid")!==t.name)return;const i=e.getAttribute("data-toggle-detail");e.addEventListener("click",(n=>{const r=t.el.querySelector(`.item-detail-${t.name}-id-${i}`);e.closest("tr"),r&&(r.classList.add("datagrid--content-row"),r.classList.toggle("is-active")),t.ajax.addEventListener("before",(e=>{e.detail.params.url.includes(`do=${t.name}-getItemDetail`)&&e.detail.params.url.includes(`grid-id=${i}`)&&(e.stopPropagation(),e.preventDefault())}))}))})),t.ajax.addEventListener("success",(({detail:{payload:e}})=>{var i;e._datagrid_redraw_item_id&&e._datagrid_redraw_item_class&&(null===(i=t.el.querySelector(`tr[data-id='${e._datagrid_redraw_item_id}']`))||void 0===i||i.setAttribute("class",e._datagrid_redraw_item_class))})),!0}}class he{onDatagridInit(t){return t.ajax.addEventListener("before",(t=>{})),t.ajax.addEventListener("success",(({detail:{payload:t}})=>{var e,i;if(t._datagrid_tree){const n=t._datagrid_tree,r=document.querySelector(`.datagrid-tree-item[data-id="${n}"]`),s=document.querySelector(`.datagrid-tree-item[data-id="${n}"] .datagrid-tree-item-children`);if(s){if(s.classList.contains("showed"))return s.innerHTML="",s.classList.remove("showed"),void(r.querySelector("a.chevron").style.transform="rotate(0deg)");s.classList.add("showed"),r.querySelector("a.chevron").style.transform="rotate(90deg)";const n=t.snippets;for(const t in n){const r=n[t],o=(new DOMParser).parseFromString(r,"text/html").querySelector("[data-id]"),a=null!==(e=null==o?void 0:o.getAttribute("data-id"))&&void 0!==e?e:"",l=`\n<div class="datagrid-tree-item" class='${null!==(i=null==o?void 0:o.hasAttribute("data-has-children"))&&void 0!==i&&i?"has-children":""}' id="${t}" data-id="${a}">${r}</div>`;s.innerHTML=l}}}})),!0}}class pe{constructor(){this.colors=["primary","success","info","warning","danger","white","gray"],this.templates={radio:'<div class="happy-radio"><b></b></div>',checkbox:'<div class="happy-checkbox"><svg viewBox="0 0 30 30"><rect class="mark-storke" x="15" y="3" rx="1" ry="1" width="10" height="4"/><rect class="mark-storke" x="-7" y="21" rx="1" ry="1" width="19" height="4"/></svg></div>',text:"",textarea:""}}init(){this.removeBySelector(".happy-radio"),this.removeBySelector(".happy-checkbox"),this.initRadio(),this.initCheckbox()}reset(){this.init()}addColorToInput(t,e,i){t.classList.contains(i)&&e.classList.add(i),i=`${i}-border`,t.classList.contains(i)&&e.classList.add(i)}addThinkessToInput(t,e){t.classList.contains("thin")&&e.classList.add("thin")}setNames(t,e){var i,n;e.setAttribute("data-name",null!==(i=t.getAttribute("name"))&&void 0!==i?i:"");var r=t.getAttribute("value");"undefined"!==r&&null!==r&&e.setAttribute("data-value",null!==(n=t.getAttribute("value"))&&void 0!==n?n:"")}removeBySelector(t){document.querySelectorAll(t).forEach((t=>{var e;return null===(e=t.parentNode)||void 0===e?void 0:e.removeChild(t)}))}initRadio(){document.querySelectorAll("input[type=radio].happy").forEach((t=>{t.insertAdjacentHTML("afterend",this.templates.radio);const e=t.nextElementSibling;e instanceof HTMLElement&&(this.colors.forEach((i=>{this.addColorToInput(t,e,i),this.setNames(t,e)})),this.addThinkessToInput(t,e)),this.checkRadioState(t),document.addEventListener("change",this.radioOnChange.bind(this))}))}initCheckbox(){document.querySelectorAll("input[type=checkbox].happy").forEach((t=>{t.insertAdjacentHTML("afterend",this.templates.checkbox);const e=t.nextElementSibling;e instanceof HTMLElement&&(this.colors.forEach((i=>{this.addColorToInput(t,e,i),this.setNames(t,e)})),this.addThinkessToInput(t,e)),this.checkCheckboxState(t),document.addEventListener("click",this.checkCheckboxStateOnClick.bind(this)),document.addEventListener("change",this.checkCheckboxStateOnChange.bind(this))}))}checkCheckboxStateOnClick(t){var e;const i=t.target,n=i instanceof SVGSVGElement?i.parentNode:i instanceof SVGGraphicsElement?null===(e=i.closest("svg"))||void 0===e?void 0:e.parentNode:i;if(!(n instanceof HTMLElement&&n.classList.contains("happy-checkbox")))return;t.preventDefault();const r=n.getAttribute("data-name"),s=n.getAttribute("data-value"),o=document.querySelector(`.happy-checkbox[data-name="${r}"]`+(s?`[value="${s}"]`:""));if(!(o instanceof HTMLInputElement))return;const a=n.classList.contains("active");o.checked=!a,a?n.classList.remove("active"):n.classList.add("active")}checkCheckboxStateOnChange({target:t}){t instanceof HTMLInputElement&&t.classList.contains("happy")&&this.checkCheckboxState(t)}checkRadioState(t){if(!t.checked||!t.hasAttribute("name"))return;const e=t.getAttribute("name"),i=t.getAttribute("value"),n=document.querySelector(`.happy-checkbox[data-name="${e}"]`+(i?`[data-value="${i}"]`:""));n&&n.classList.add("active")}checkCheckboxState(t){const e=t.getAttribute("name");if(!e)return;const i=t.getAttribute("value"),n=document.querySelector(`.happy-checkbox[data-name="${e}"]`+(i?`[data-value="${i}"]`:""));n&&(t.checked?n.classList.add("active"):n.classList.remove("active"))}radioOnChange({target:t}){if(!(t instanceof HTMLInputElement&&t.classList.contains("happy")&&t.hasAttribute("name")))return;const e=t.getAttribute("name");document.querySelectorAll(`.happy-radio[data-name="${e}"]`).forEach((t=>t.classList.remove("active"))),this.checkRadioState(t)}}
7
+ */var b=(m||(m=1,v.exports=function(){class e{filled(e,t,i){return""!==i&&!1!==i&&null!==i&&(!Array.isArray(i)||i.length>0)&&(!(i instanceof FileList)||i.length>0)}blank(e,t,i){return!this.filled(e,t,i)}valid(e,t){return t.validateControl(e,void 0,!0)}equal(e,t,i){if(void 0===t)return null;let n=e=>"number"==typeof e||"string"==typeof e?""+e:!0===e?"1":"",r=Array.isArray(i)?i:[i],s=Array.isArray(t)?t:[t];e:for(let e of r){for(let t of s)if(n(e)===n(t))continue e;return!1}return r.length>0}notEqual(e,t,i){return void 0===t?null:!this.equal(e,t,i)}minLength(e,t,i){return(i="number"==typeof i?i.toString():i).length>=t}maxLength(e,t,i){return(i="number"==typeof i?i.toString():i).length<=t}length(e,t,i){return i="number"==typeof i?i.toString():i,(null===(t=Array.isArray(t)?t:[t,t])[0]||i.length>=t[0])&&(null===t[1]||i.length<=t[1])}email(e,t,i){return/^("([ !#-[\]-~]|\\[ -~])+"|[-a-z0-9!#$%&'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*)@([0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)+[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?$/i.test(i)}url(e,t,i,n){return/^[a-z\d+.-]+:/.test(i)||(i="https://"+i),!!/^https?:\/\/((([-_0-9a-z\u00C0-\u02FF\u0370-\u1EFF]+\.)*[0-9a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,61}[0-9a-z\u00C0-\u02FF\u0370-\u1EFF])?\.)?[a-z\u00C0-\u02FF\u0370-\u1EFF]([-0-9a-z\u00C0-\u02FF\u0370-\u1EFF]{0,17}[a-z\u00C0-\u02FF\u0370-\u1EFF])?|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[[0-9a-f:]{3,39}\])(:\d{1,5})?(\/\S*)?$/i.test(i)&&(n.value=i,!0)}regexp(e,t,i){let n="string"==typeof t&&t.match(/^\/(.*)\/([imu]*)$/);try{return n&&new RegExp(n[1],n[2].replace("u","")).test(i)}catch{return null}}pattern(e,t,i,n,r){if("string"!=typeof t)return null;try{let e;try{e=new RegExp("^(?:"+t+")$",r?"ui":"u")}catch{e=new RegExp("^(?:"+t+")$",r?"i":"")}return i instanceof FileList?Array.from(i).every(t=>e.test(t.name)):e.test(i)}catch{return null}}patternCaseInsensitive(e,t,i){return this.pattern(e,t,i,null,!0)}numeric(e,t,i){return/^[0-9]+$/.test(i)}integer(e,t,i,n){return!!/^-?[0-9]+$/.test(i)&&(n.value=parseFloat(i),!0)}float(e,t,i,n){return i=i.replace(/ +/g,"").replace(/,/g,"."),!!/^-?[0-9]*\.?[0-9]+$/.test(i)&&(n.value=parseFloat(i),!0)}min(e,t,i){return Number.isFinite(t)&&(i=parseFloat(i)),i>=t}max(e,t,i){return Number.isFinite(t)&&(i=parseFloat(i)),i<=t}range(e,t,i){return Array.isArray(t)?"time"===e.type&&t[0]>t[1]?i>=t[0]||i<=t[1]:(null===t[0]||this.min(e,t[0],i))&&(null===t[1]||this.max(e,t[1],i)):null}submitted(e){return e.form["nette-submittedBy"]===e}fileSize(e,t,i){return Array.from(i).every(e=>e.size<=t)}mimeType(e,t,i){let n=[];(t=Array.isArray(t)?t:[t]).forEach(e=>n.push("^"+e.replace(/([^\w])/g,"\\$1").replace("\\*",".*")+"$"));let r=new RegExp(n.join("|"));return Array.from(i).every(e=>!e.type||r.test(e.type))}image(e,t,i){return this.mimeType(e,t??["image/gif","image/png","image/jpeg","image/webp"],i)}static(e,t){return t}}class t{formErrors=[];validators=new e;#e={};#t={};#i=new WeakMap;#n(e,t){let i=e.elements.namedItem(t);return i instanceof RadioNodeList?i[0]:i}#r(e){let t=e.form.elements.namedItem(e.name);return t instanceof RadioNodeList?Array.from(t):[t]}#s(e){"loading"!==document.readyState?e.call(this):document.addEventListener("DOMContentLoaded",e)}getValue(e){return e instanceof HTMLInputElement?"radio"===e.type?this.#r(e).find(e=>e.checked)?.value??null:"file"===e.type?e.files:"checkbox"===e.type?e.name.endsWith("[]")?this.#r(e).filter(e=>e.checked).map(e=>e.value):e.checked:e.value.trim():e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions,e=>e.value):e.selectedOptions[0]?.value??null:e instanceof HTMLTextAreaElement?e.value:e instanceof RadioNodeList?this.getValue(e[0]):null}getEffectiveValue(e,t=!1){let i=this.getValue(e);if(i===e.getAttribute("data-nette-empty-value")&&(i=""),t&&void 0===this.#e[e.name]){this.#e[e.name]=!0;let t={value:i};this.validateControl(e,void 0,!0,t),i=t.value,delete this.#e[e.name]}return i}validateControl(e,t,i=!1,n,r){t??=JSON.parse(e.getAttribute("data-nette-rules")??"[]"),n??={value:this.getEffectiveValue(e)},r??=!this.validateRule(e,":filled",null,n);for(let s of t){let t=s.op.match(/(~)?([^?]+)/),o=s.control?this.#n(e.form,s.control):e;if(s.neg=!!t[1],s.op=t[2],s.condition=!!s.rules,!o)continue;if(r&&!s.condition&&":filled"!==s.op)continue;let a=this.validateRule(o,s.op,s.arg,e===o?n:void 0);if(null!==a)if(s.neg&&(a=!a),s.condition&&a){if(!this.validateControl(e,s.rules,i,n,":blank"!==s.op&&r))return!1}else if(!s.condition&&!a){if(this.isDisabled(o))continue;if(!i){let t=Array.isArray(s.arg)?s.arg:[s.arg],i=s.msg.replace(/%(value|\d+)/g,(i,n)=>this.getValue("value"===n?o:e.form.elements.namedItem(t[n].control)));this.addError(o,i)}return!1}}return!0}validateForm(e,t=!1){let i,n=e.form??e;if(this.formErrors=[],null!==e.getAttribute("formnovalidate")){let t=JSON.parse(e.getAttribute("data-nette-validation-scope")??"[]");if(!t.length)return this.showFormErrors(n,[]),!0;i=new RegExp("^("+t.join("-|")+"-)")}for(let e of n.elements)if(e.willValidate&&e.validity.badInput)return e.reportValidity(),!1;for(let e of n.elements)if(e.getAttribute("data-nette-rules")&&(!i||e.name.replace(/]\[|\[|]|$/g,"-").match(i))&&!this.isDisabled(e)&&!this.validateControl(e,void 0,t)&&!this.formErrors.length)return!1;let r=!this.formErrors.length;return this.showFormErrors(n,this.formErrors),r}isDisabled(e){return"radio"===e.type?this.#r(e).every(e=>e.disabled):e.disabled}addError(e,t){this.formErrors.push({element:e,message:t})}showFormErrors(e,t){let i,n=[];for(let e of t)n.indexOf(e.message)<0&&(n.push(e.message),i??=e.element);n.length&&this.showModal(n.join("\n"),()=>{i?.focus()})}showModal(e,t){let i=document.createElement("dialog");if(!i.showModal)return alert(e),void t();let n=document.createElement("style");n.innerText=".netteFormsModal { text-align: center; margin: auto; border: 2px solid black; padding: 1rem } .netteFormsModal button { padding: .1em 2em }";let r=document.createElement("button");r.innerText="OK",r.onclick=()=>{i.remove(),t()},i.setAttribute("class","netteFormsModal"),i.innerText=e+"\n\n",i.append(n,r),document.body.append(i),i.showModal()}validateRule(e,t,i,n){if(e.validity.badInput)return":filled"===t;n??={value:this.getEffectiveValue(e,!0)};let r=":"===t.charAt(0)?t.substring(1):t;r=r.replace("::","_").replaceAll("\\","");let s=Array.isArray(i)?i:[i];return s=s.map(t=>{if(t?.control){let i=this.#n(e.form,t.control);return i===e?n.value:this.getEffectiveValue(i,!0)}return t}),"valid"===r&&(s[0]=this),this.validators[r]?this.validators[r](e,Array.isArray(i)?s:s[0],n.value,n):null}toggleForm(e,t){this.#t={};for(let i of Array.from(e.elements))i.getAttribute("data-nette-rules")&&this.toggleControl(i,void 0,null,!t);for(let e in this.#t)this.toggle(e,this.#t[e].state,this.#t[e].elem,t)}toggleControl(e,t,i=null,n=!1,r,s){t??=JSON.parse(e.getAttribute("data-nette-rules")??"[]"),r??={value:this.getEffectiveValue(e)},s??=!this.validateRule(e,":filled",null,r);let o,a=!1;for(let l of t){let t=l.op.match(/(~)?([^?]+)/),c=l.control?this.#n(e.form,l.control):e;if(l.neg=!!t[1],l.op=t[2],l.condition=!!l.rules,c&&(!s||l.condition||":filled"===l.op)){if(o=i,!1!==i){if(o=this.validateRule(c,l.op,l.arg,e===c?r:void 0),null===o)continue;l.neg&&(o=!o),l.condition||(i=o)}if(l.condition&&this.toggleControl(e,l.rules,o,n,r,":blank"!==l.op&&s)||l.toggle){a=!0,n&&this.#r(c).filter(e=>!this.#i.has(e)).forEach(t=>{t.addEventListener("change",t=>this.toggleForm(e.form,t)),this.#i.set(t,null)});for(let t in l.toggle??{})this.#t[t]??={elem:e,state:!1},this.#t[t].state||=l.toggle[t]?!!o:!o}}}return a}toggle(e,t,i,n){/^\w[\w.:-]*$/.test(e)&&(e="#"+e),Array.from(document.querySelectorAll(e)).forEach(e=>e.hidden=!t)}compactCheckboxes(e,t){let i={};for(let n of e.elements)n instanceof HTMLInputElement&&"checkbox"===n.type&&n.name.endsWith("[]")&&n.checked&&!n.disabled&&(t.delete(n.name),i[n.name]??=[],i[n.name].push(n.value));for(let e in i)t.set(e.substring(0,e.length-2),i[e].join(","))}initForm(e){"get"===e.method&&e.hasAttribute("data-nette-compact")&&e.addEventListener("formdata",t=>this.compactCheckboxes(e,t.formData)),Array.from(e.elements).some(e=>e.getAttribute("data-nette-rules"))&&(this.toggleForm(e),e.noValidate||(e.noValidate=!0,e.addEventListener("submit",t=>{this.validateForm(t.submitter||e)||(t.stopImmediatePropagation(),t.preventDefault())}),e.addEventListener("reset",()=>{setTimeout(()=>this.toggleForm(e))})))}initOnLoad(){this.#s(()=>{Array.from(document.forms).forEach(e=>this.initForm(e))})}}let i={"á":"a","ä":"a","č":"c","ď":"d","é":"e","ě":"e","í":"i","ľ":"l","ň":"n","ó":"o","ô":"o","ř":"r","š":"s","ť":"t","ú":"u","ů":"u","ý":"y","ž":"z"};function n(e){e=e.toLowerCase();let t="";for(let n=0;n<e.length;n++){let r=i[e.charAt(n)];t+=r||e.charAt(n)}return t.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}var r="3.5.3";let s=new t;return s.version=r,s.webalize=n,s}()),v.exports),y=g(b);function _(e){return"Enter"===e.key}function w(){return null!=w?w:{}}function E(e,t=200){let i=null,n=!1;return(...r)=>{n||(i&&clearTimeout(i),i=setTimeout(()=>{const t=e(...r);var i;"object"==typeof(i=t)&&"function"==typeof i.then&&(n=!0,t.finally(()=>{n=!1}))},t))}}function A(e,t){e.split(/\s+/).forEach(e=>{t(e)})}class S{constructor(){this._events={}}on(e,t){A(e,e=>{const i=this._events[e]||[];i.push(t),this._events[e]=i})}off(e,t){var i=arguments.length;0!==i?A(e,e=>{if(1===i)return void delete this._events[e];const n=this._events[e];void 0!==n&&(n.splice(n.indexOf(t),1),this._events[e]=n)}):this._events={}}trigger(e,...t){var i=this;A(e,e=>{const n=i._events[e];void 0!==n&&n.forEach(e=>{e.apply(i,t)})})}}const k=e=>(e=e.filter(Boolean)).length<2?e[0]||"":1==T(e)?"["+e.join("")+"]":"(?:"+e.join("|")+")",O=e=>{if(!D(e))return e.join("");let t="",i=0;const n=()=>{i>1&&(t+="{"+i+"}")};return e.forEach((r,s)=>{r!==e[s-1]?(n(),t+=r,i=1):i++}),n(),t},C=e=>{let t=Array.from(e);return k(t)},D=e=>new Set(e).size!==e.length,x=e=>(e+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),T=e=>e.reduce((e,t)=>Math.max(e,L(t)),0),L=e=>Array.from(e).length,I=e=>{if(1===e.length)return[[e]];let t=[];const i=e.substring(1);return I(i).forEach(function(i){let n=i.slice(0);n[0]=e.charAt(0)+n[0],t.push(n),n=i.slice(0),n.unshift(e.charAt(0)),t.push(n)}),t},M=[[0,65535]];let F,N;const j={},P={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let e in P){let t=P[e]||"";for(let i=0;i<t.length;i++){let n=t.substring(i,i+1);j[n]=e}}const H=new RegExp(Object.keys(j).join("|")+"|[̀-ͯ·ʾʼ]","gu"),q=(e,t="NFKD")=>e.normalize(t),R=e=>Array.from(e).reduce((e,t)=>e+B(t),""),B=e=>(e=q(e).toLowerCase().replace(H,e=>j[e]||""),q(e,"NFC"));const V=e=>{const t={},i=(e,i)=>{const n=t[e]||new Set,r=new RegExp("^"+C(n)+"$","iu");i.match(r)||(n.add(x(i)),t[e]=n)};for(let t of function*(e){for(const[t,i]of e)for(let e=t;e<=i;e++){let t=String.fromCharCode(e),i=R(t);i!=t.toLowerCase()&&(i.length>3||0!=i.length&&(yield{folded:i,composed:t,code_point:e}))}}(e))i(t.folded,t.folded),i(t.folded,t.composed);return t},z=e=>{const t=V(e),i={};let n=[];for(let e in t){let r=t[e];r&&(i[e]=C(r)),e.length>1&&n.push(x(e))}n.sort((e,t)=>t.length-e.length);const r=k(n);return N=new RegExp("^"+r,"u"),i},W=(e,t=1)=>(t=Math.max(t,e.length-1),k(I(e).map(e=>((e,t=1)=>{let i=0;return e=e.map(e=>(F[e]&&(i+=e.length),F[e]||e)),i>=t?O(e):""})(e,t)))),Y=(e,t=!0)=>{let i=e.length>1?1:0;return k(e.map(e=>{let n=[];const r=t?e.length():e.length()-1;for(let t=0;t<r;t++)n.push(W(e.substrs[t]||"",i));return O(n)}))},K=(e,t)=>{for(const i of t){if(i.start!=e.start||i.end!=e.end)continue;if(i.substrs.join("")!==e.substrs.join(""))continue;let t=e.parts;const n=e=>{for(const i of t){if(i.start===e.start&&i.substr===e.substr)return!1;if(1!=e.length&&1!=i.length){if(e.start<i.start&&e.end>i.start)return!0;if(i.start<e.start&&i.end>e.start)return!0}}return!1};if(!(i.parts.filter(n).length>0))return!0}return!1};class U{parts;substrs;start;end;constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(e){e&&(this.parts.push(e),this.substrs.push(e.substr),this.start=Math.min(e.start,this.start),this.end=Math.max(e.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(e,t){let i=new U,n=JSON.parse(JSON.stringify(this.parts)),r=n.pop();for(const e of n)i.add(e);let s=t.substr.substring(0,e-r.start),o=s.length;return i.add({start:r.start,end:r.start+o,length:o,substr:s}),i}}const X=e=>{void 0===F&&(F=z(M)),e=R(e);let t="",i=[new U];for(let n=0;n<e.length;n++){let r=e.substring(n).match(N);const s=e.substring(n,n+1),o=r?r[0]:null;let a=[],l=new Set;for(const e of i){const t=e.last();if(!t||1==t.length||t.end<=n)if(o){const t=o.length;e.add({start:n,end:n+t,length:t,substr:o}),l.add("1")}else e.add({start:n,end:n+1,length:1,substr:s}),l.add("2");else if(o){let i=e.clone(n,t);const r=o.length;i.add({start:n,end:n+r,length:r,substr:o}),a.push(i)}else l.add("3")}if(a.length>0){a=a.sort((e,t)=>e.length()-t.length());for(let e of a)K(e,i)||i.push(e)}else if(n>0&&1==l.size&&!l.has("3")){t+=Y(i,!1);let e=new U;const n=i[0];n&&e.add(n.last()),i=[e]}}return t+=Y(i,!0),t},Q=(e,t)=>{if(e)return e[t]},G=(e,t)=>{if(e){for(var i,n=t.split(".");(i=n.shift())&&(e=e[i]););return e}},J=(e,t,i)=>{var n,r;return e?(e+="",null==t.regex||-1===(r=e.search(t.regex))?0:(n=t.string.length/e.length,0===r&&(n+=.5),n*i)):0},Z=(e,t)=>{var i=e[t];if("function"==typeof i)return i;i&&!Array.isArray(i)&&(e[t]=[i])},ee=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},te=(e,t)=>"number"==typeof e&&"number"==typeof t?e>t?1:e<t?-1:0:(e=R(e+"").toLowerCase())>(t=R(t+"").toLowerCase())?1:t>e?-1:0;class ie{items;settings;constructor(e,t){this.items=e,this.settings=t||{diacritics:!0}}tokenize(e,t,i){if(!e||!e.length)return[];const n=[],r=e.split(/\s+/);var s;return i&&(s=new RegExp("^("+Object.keys(i).map(x).join("|")+"):(.*)$")),r.forEach(e=>{let i,r=null,o=null;s&&(i=e.match(s))&&(r=i[1],e=i[2]),e.length>0&&(o=this.settings.diacritics?X(e)||null:x(e),o&&t&&(o="\\b"+o)),n.push({string:e,regex:o?new RegExp(o,"iu"):null,field:r})}),n}getScoreFunction(e,t){var i=this.prepareSearch(e,t);return this._getScoreFunction(i)}_getScoreFunction(e){const t=e.tokens,i=t.length;if(!i)return function(){return 0};const n=e.options.fields,r=e.weights,s=n.length,o=e.getAttrFn;if(!s)return function(){return 1};const a=1===s?function(e,t){const i=n[0].field;return J(o(t,i),e,r[i]||1)}:function(e,t){var i=0;if(e.field){const n=o(t,e.field);!e.regex&&n?i+=1/s:i+=J(n,e,1)}else ee(r,(n,r)=>{i+=J(o(t,r),e,n)});return i/s};return 1===i?function(e){return a(t[0],e)}:"and"===e.options.conjunction?function(e){var n,r=0;for(let i of t){if((n=a(i,e))<=0)return 0;r+=n}return r/i}:function(e){var n=0;return ee(t,t=>{n+=a(t,e)}),n/i}}getSortFunction(e,t){var i=this.prepareSearch(e,t);return this._getSortFunction(i)}_getSortFunction(e){var t,i=[];const n=this,r=e.options,s=!e.query&&r.sort_empty?r.sort_empty:r.sort;if("function"==typeof s)return s.bind(this);const o=function(t,i){return"$score"===t?i.score:e.getAttrFn(n.items[i.id],t)};if(s)for(let t of s)(e.query||"$score"!==t.field)&&i.push(t);if(e.query){t=!0;for(let e of i)if("$score"===e.field){t=!1;break}t&&i.unshift({field:"$score",direction:"desc"})}else i=i.filter(e=>"$score"!==e.field);return i.length?function(e,t){var n,r;for(let s of i){if(r=s.field,n=("desc"===s.direction?-1:1)*te(o(r,e),o(r,t)))return n}return 0}:null}prepareSearch(e,t){const i={};var n=Object.assign({},t);if(Z(n,"sort"),Z(n,"sort_empty"),n.fields){Z(n,"fields");const e=[];n.fields.forEach(t=>{"string"==typeof t&&(t={field:t,weight:1}),e.push(t),i[t.field]="weight"in t?t.weight:1}),n.fields=e}return{options:n,query:e.toLowerCase().trim(),tokens:this.tokenize(e,n.respect_word_boundaries,i),total:0,items:[],weights:i,getAttrFn:n.nesting?G:Q}}search(e,t){var i,n,r=this;n=this.prepareSearch(e,t),t=n.options,e=n.query;const s=t.score||r._getScoreFunction(n);e.length?ee(r.items,(e,r)=>{i=s(e),(!1===t.filter||i>0)&&n.items.push({score:i,id:r})}):ee(r.items,(e,t)=>{n.items.push({score:1,id:t})});const o=r._getSortFunction(n);return o&&n.items.sort(o),n.total=n.items.length,"number"==typeof t.limit&&(n.items=n.items.slice(0,t.limit)),n}}const ne=e=>null==e?null:re(e),re=e=>"boolean"==typeof e?e?"1":"0":e+"",se=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),oe=(e,t)=>{var i;return function(n,r){var s=this;i&&(s.loading=Math.max(s.loading-1,0),clearTimeout(i)),i=setTimeout(function(){i=null,s.loadedSearches[n]=!0,e.call(s,n,r)},t)}},ae=(e,t,i)=>{var n,r=e.trigger,s={};for(n of(e.trigger=function(){var i=arguments[0];if(-1===t.indexOf(i))return r.apply(e,arguments);s[i]=arguments},i.apply(e,[]),e.trigger=r,t))n in s&&r.apply(e,s[n])},le=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},ce=(e,t,i,n)=>{e.addEventListener(t,i,n)},de=(e,t)=>!!t&&(!!t[e]&&1===(t.altKey?1:0)+(t.ctrlKey?1:0)+(t.shiftKey?1:0)+(t.metaKey?1:0)),ue=(e,t)=>{const i=e.getAttribute("id");return i||(e.setAttribute("id",t),t)},he=e=>e.replace(/[\\"']/g,"\\$&"),pe=(e,t)=>{t&&e.append(t)},fe=(e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)},ge=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(me(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},me=e=>"string"==typeof e&&e.indexOf("<")>-1,ve=(e,t)=>{var i=document.createEvent("HTMLEvents");i.initEvent(t,!0,!1),e.dispatchEvent(i)},be=(e,t)=>{Object.assign(e.style,t)},ye=(e,...t)=>{var i=we(t);(e=Ee(e)).map(e=>{i.map(t=>{e.classList.add(t)})})},_e=(e,...t)=>{var i=we(t);(e=Ee(e)).map(e=>{i.map(t=>{e.classList.remove(t)})})},we=e=>{var t=[];return fe(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Ee=e=>(Array.isArray(e)||(e=[e]),e),Ae=(e,t,i)=>{if(!i||i.contains(e))for(;e&&e.matches;){if(e.matches(t))return e;e=e.parentNode}},Se=(e,t=0)=>t>0?e[e.length-1]:e[0],ke=(e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i},Oe=(e,t)=>{fe(t,(t,i)=>{null==t?e.removeAttribute(i):e.setAttribute(i,""+t)})},Ce=(e,t)=>{e.parentNode&&e.parentNode.replaceChild(t,e)},De=(e,t)=>{if(null===t)return;if("string"==typeof t){if(!t.length)return;t=new RegExp(t,"i")}const i=e=>3===e.nodeType?(e=>{var i=e.data.match(t);if(i&&e.data.length>0){var n=document.createElement("span");n.className="highlight";var r=e.splitText(i.index);r.splitText(i[0].length);var s=r.cloneNode(!0);return n.appendChild(s),Ce(r,n),1}return 0})(e):((e=>{1!==e.nodeType||!e.childNodes||/(script|style)/i.test(e.tagName)||"highlight"===e.className&&"SPAN"===e.tagName||Array.from(e.childNodes).forEach(e=>{i(e)})})(e),0);i(e)},xe="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey";var Te={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,refreshThrottle:300,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(e){return e.length>0},render:{}};function Le(e,t){var i=Object.assign({},Te,t),n=i.dataAttr,r=i.labelField,s=i.valueField,o=i.disabledField,a=i.optgroupField,l=i.optgroupLabelField,c=i.optgroupValueField,d=e.tagName.toLowerCase(),u=e.getAttribute("placeholder")||e.getAttribute("data-placeholder");if(!u&&!i.allowEmptyOption){let t=e.querySelector('option[value=""]');t&&(u=t.textContent)}var h={placeholder:u,options:[],optgroups:[],items:[],maxItems:null};return"select"===d?(()=>{var t,d=h.options,u={},p=1;let f=0;var g=e=>{var t=Object.assign({},e.dataset),i=n&&t[n];return"string"==typeof i&&i.length&&(t=Object.assign(t,JSON.parse(i))),t},m=(e,t)=>{var n=ne(e.value);if(null!=n&&(n||i.allowEmptyOption)){if(u.hasOwnProperty(n)){if(t){var l=u[n][a];l?Array.isArray(l)?l.push(t):u[n][a]=[l,t]:u[n][a]=t}}else{var c=g(e);c[r]=c[r]||e.textContent,c[s]=c[s]||n,c[o]=c[o]||e.disabled,c[a]=c[a]||t,c.$option=e,c.$order=c.$order||++f,u[n]=c,d.push(c)}e.selected&&h.items.push(n)}};h.maxItems=e.hasAttribute("multiple")?null:1,fe(e.children,e=>{var i,n,r;"optgroup"===(t=e.tagName.toLowerCase())?((r=g(i=e))[l]=r[l]||i.getAttribute("label")||"",r[c]=r[c]||p++,r[o]=r[o]||i.disabled,r.$order=r.$order||++f,h.optgroups.push(r),n=r[c],fe(i.children,e=>{m(e,n)})):"option"===t&&m(e)})})():(()=>{const t=e.getAttribute(n);if(t)h.options=JSON.parse(t),fe(h.options,e=>{h.items.push(e[s])});else{var o=e.value.trim()||"";if(!i.allowEmptyOption&&!o.length)return;const t=o.split(i.delimiter);fe(t,e=>{const t={};t[r]=e,t[s]=e,h.options.push(t)}),h.items=t}})(),Object.assign({},Te,h,t)}var Ie=0;let Me=class extends(function(e){return e.plugins={},class extends e{constructor(){super(...arguments),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(t,i){e.plugins[t]={name:t,fn:i}}initializePlugins(e){var t,i;const n=this,r=[];if(Array.isArray(e))e.forEach(e=>{"string"==typeof e?r.push(e):(n.plugins.settings[e.name]=e.options,r.push(e.name))});else if(e)for(t in e)e.hasOwnProperty(t)&&(n.plugins.settings[t]=e[t],r.push(t));for(;i=r.shift();)n.require(i)}loadPlugin(t){var i=this,n=i.plugins,r=e.plugins[t];if(!e.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin');n.requested[t]=!0,n.loaded[t]=r.fn.apply(i,[i.plugins.settings[t]||{}]),n.names.push(t)}require(e){var t=this,i=t.plugins;if(!t.plugins.loaded.hasOwnProperty(e)){if(i.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');t.loadPlugin(e)}return i.loaded[e]}}}(S)){constructor(e,t){var i;super(),this.order=0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],this.refreshTimeout=null,Ie++;var n=ge(e);if(n.tomselect)throw new Error("Tom Select already initialized on this element");n.tomselect=this,i=(window.getComputedStyle&&window.getComputedStyle(n,null)).getPropertyValue("direction");const r=Le(n,t);this.settings=r,this.input=n,this.tabIndex=n.tabIndex||0,this.is_select_tag="select"===n.tagName.toLowerCase(),this.rtl=/rtl/i.test(i),this.inputId=ue(n,"tomselect-"+Ie),this.isRequired=n.required,this.sifter=new ie(this.options,{diacritics:r.diacritics}),r.mode=r.mode||(1===r.maxItems?"single":"multi"),"boolean"!=typeof r.hideSelected&&(r.hideSelected="multi"===r.mode),"boolean"!=typeof r.hidePlaceholder&&(r.hidePlaceholder="multi"!==r.mode);var s=r.createFilter;"function"!=typeof s&&("string"==typeof s&&(s=new RegExp(s)),s instanceof RegExp?r.createFilter=e=>s.test(e):r.createFilter=e=>this.settings.duplicates||!this.options[e]),this.initializePlugins(r.plugins),this.setupCallbacks(),this.setupTemplates();const o=ge("<div>"),a=ge("<div>"),l=this._render("dropdown"),c=ge('<div role="listbox" tabindex="-1">'),d=this.input.getAttribute("class")||"",u=r.mode;var h;if(ye(o,r.wrapperClass,d,u),ye(a,r.controlClass),pe(o,a),ye(l,r.dropdownClass,u),r.copyClassesToDropdown&&ye(l,d),ye(c,r.dropdownContentClass),pe(l,c),ge(r.dropdownParent||o).appendChild(l),me(r.controlInput)){h=ge(r.controlInput);fe(["autocorrect","autocapitalize","autocomplete","spellcheck"],e=>{n.getAttribute(e)&&Oe(h,{[e]:n.getAttribute(e)})}),h.tabIndex=-1,a.appendChild(h),this.focus_node=h}else r.controlInput?(h=ge(r.controlInput),this.focus_node=h):(h=ge("<input/>"),this.focus_node=a);this.wrapper=o,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=h,this.setup()}setup(){const e=this,t=e.settings,i=e.control_input,n=e.dropdown,r=e.dropdown_content,s=e.wrapper,o=e.control,a=e.input,l=e.focus_node,c={passive:!0},d=e.inputId+"-ts-dropdown";Oe(r,{id:d}),Oe(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":d});const u=ue(l,e.inputId+"-ts-control"),h="label[for='"+(e=>e.replace(/['"\\]/g,"\\$&"))(e.inputId)+"']",p=document.querySelector(h),f=e.focus.bind(e);if(p){ce(p,"click",f),Oe(p,{for:u});const t=ue(p,e.inputId+"-ts-label");Oe(l,{"aria-labelledby":t}),Oe(r,{"aria-labelledby":t})}if(s.style.width=a.style.width,e.plugins.names.length){const t="plugin-"+e.plugins.names.join(" plugin-");ye([s,n],t)}(null===t.maxItems||t.maxItems>1)&&e.is_select_tag&&Oe(a,{multiple:"multiple"}),t.placeholder&&Oe(i,{placeholder:t.placeholder}),!t.splitOn&&t.delimiter&&(t.splitOn=new RegExp("\\s*"+x(t.delimiter)+"+\\s*")),t.load&&t.loadThrottle&&(t.load=oe(t.load,t.loadThrottle)),ce(n,"mousemove",()=>{e.ignoreHover=!1}),ce(n,"mouseenter",t=>{var i=Ae(t.target,"[data-selectable]",n);i&&e.onOptionHover(t,i)},{capture:!0}),ce(n,"click",t=>{const i=Ae(t.target,"[data-selectable]");i&&(e.onOptionSelect(t,i),le(t,!0))}),ce(o,"click",t=>{var n=Ae(t.target,"[data-ts-item]",o);n&&e.onItemSelect(t,n)?le(t,!0):""==i.value&&(e.onClick(),le(t,!0))}),ce(l,"keydown",t=>e.onKeyDown(t)),ce(i,"keypress",t=>e.onKeyPress(t)),ce(i,"input",t=>e.onInput(t)),ce(l,"blur",t=>e.onBlur(t)),ce(l,"focus",t=>e.onFocus(t)),ce(i,"paste",t=>e.onPaste(t));const g=t=>{const r=t.composedPath()[0];if(!s.contains(r)&&!n.contains(r))return e.isFocused&&e.blur(),void e.inputState();r==i&&e.isOpen?t.stopPropagation():le(t,!0)},m=()=>{e.isOpen&&e.positionDropdown()};ce(document,"mousedown",g),ce(window,"scroll",m,c),ce(window,"resize",m,c),this._destroy=()=>{document.removeEventListener("mousedown",g),window.removeEventListener("scroll",m),window.removeEventListener("resize",m),p&&p.removeEventListener("click",f)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",e.wrapper),e.sync(!1),t.items=[],delete t.optgroups,delete t.options,ce(a,"invalid",()=>{e.isValid&&(e.isValid=!1,e.isInvalid=!0,e.refreshState())}),e.updateOriginalInput(),e.refreshItems(),e.close(!1),e.inputState(),e.isSetup=!0,a.disabled?e.disable():a.readOnly?e.setReadOnly(!0):e.enable(),e.on("change",this.onChange),ye(a,"tomselected","ts-hidden-accessible"),e.trigger("initialize"),!0===t.preload&&e.preload()}setupOptions(e=[],t=[]){this.addOptions(e),fe(t,e=>{this.registerOptionGroup(e)})}setupTemplates(){var e=this,t=e.settings.labelField,i=e.settings.optgroupLabelField,n={optgroup:e=>{let t=document.createElement("div");return t.className="optgroup",t.appendChild(e.options),t},optgroup_header:(e,t)=>'<div class="optgroup-header">'+t(e[i])+"</div>",option:(e,i)=>"<div>"+i(e[t])+"</div>",item:(e,i)=>"<div>"+i(e[t])+"</div>",option_create:(e,t)=>'<div class="create">Add <strong>'+t(e.input)+"</strong>&hellip;</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};e.settings.render=Object.assign({},n,e.settings.render)}setupCallbacks(){var e,t,i={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in i)(t=this.settings[i[e]])&&this.on(e,t)}sync(e=!0){const t=this,i=e?Le(t.input,{delimiter:t.settings.delimiter}):t.settings;t.setupOptions(i.options,i.optgroups),t.setValue(i.items||[],!0),t.lastQuery=null}onClick(){var e=this;if(e.activeItems.length>0)return e.clearActiveItems(),void e.focus();e.isFocused&&e.isOpen?e.blur():e.focus()}onMouseDown(){}onChange(){ve(this.input,"input"),ve(this.input,"change")}onPaste(e){var t=this;t.isInputHidden||t.isLocked?le(e):t.settings.splitOn&&setTimeout(()=>{var e=t.inputValue();if(e.match(t.settings.splitOn)){var i=e.trim().split(t.settings.splitOn);fe(i,e=>{ne(e)&&(this.options[e]?t.addItem(e):t.createItem(e))})}},0)}onKeyPress(e){var t=this;if(!t.isLocked){var i=String.fromCharCode(e.keyCode||e.which);return t.settings.create&&"multi"===t.settings.mode&&i===t.settings.delimiter?(t.createItem(),void le(e)):void 0}le(e)}onKeyDown(e){var t=this;if(t.ignoreHover=!0,t.isLocked)9!==e.keyCode&&le(e);else{switch(e.keyCode){case 65:if(de(xe,e)&&""==t.control_input.value)return le(e),void t.selectAll();break;case 27:return t.isOpen&&(le(e,!0),t.close()),void t.clearActiveItems();case 40:if(!t.isOpen&&t.hasOptions)t.open();else if(t.activeOption){let e=t.getAdjacent(t.activeOption,1);e&&t.setActiveOption(e)}return void le(e);case 38:if(t.activeOption){let e=t.getAdjacent(t.activeOption,-1);e&&t.setActiveOption(e)}return void le(e);case 13:return void(t.canSelect(t.activeOption)?(t.onOptionSelect(e,t.activeOption),le(e)):(t.settings.create&&t.createItem()||document.activeElement==t.control_input&&t.isOpen)&&le(e));case 37:return void t.advanceSelection(-1,e);case 39:return void t.advanceSelection(1,e);case 9:return void(t.settings.selectOnTab&&(t.canSelect(t.activeOption)&&(t.onOptionSelect(e,t.activeOption),le(e)),t.settings.create&&t.createItem()&&le(e)));case 8:case 46:return void t.deleteSelection(e)}t.isInputHidden&&!de(xe,e)&&le(e)}}onInput(e){if(this.isLocked)return;const t=this.inputValue();this.lastValue!==t&&(this.lastValue=t,""!=t?(this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=((e,t)=>t>0?window.setTimeout(e,t):(e.call(null),null))(()=>{this.refreshTimeout=null,this._onInput()},this.settings.refreshThrottle)):this._onInput())}_onInput(){const e=this.lastValue;this.settings.shouldLoad.call(this,e)&&this.load(e),this.refreshOptions(),this.trigger("type",e)}onOptionHover(e,t){this.ignoreHover||this.setActiveOption(t,!1)}onFocus(e){var t=this,i=t.isFocused;if(t.isDisabled||t.isReadOnly)return t.blur(),void le(e);t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.preload(),i||t.trigger("focus"),t.activeItems.length||(t.inputState(),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState())}onBlur(e){if(!1!==document.hasFocus()){var t=this;if(t.isFocused){t.isFocused=!1,t.ignoreFocus=!1;var i=()=>{t.close(),t.setActiveItem(),t.setCaret(t.items.length),t.trigger("blur")};t.settings.create&&t.settings.createOnBlur?t.createItem(null,i):i()}}}onOptionSelect(e,t){var i,n=this;t.parentElement&&t.parentElement.matches("[data-disabled]")||(t.classList.contains("create")?n.createItem(null,()=>{n.settings.closeAfterSelect&&n.close()}):void 0!==(i=t.dataset.value)&&(n.lastQuery=null,n.addItem(i),n.settings.closeAfterSelect&&n.close(),!n.settings.hideSelected&&e.type&&/click/.test(e.type)&&n.setActiveOption(t)))}canSelect(e){return!!(this.isOpen&&e&&this.dropdown_content.contains(e))}onItemSelect(e,t){var i=this;return!i.isLocked&&"multi"===i.settings.mode&&(le(e),i.setActiveItem(t,e),!0)}canLoad(e){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(e)}load(e){const t=this;if(!t.canLoad(e))return;ye(t.wrapper,t.settings.loadingClass),t.loading++;const i=t.loadCallback.bind(t);t.settings.load.call(t,e,i)}loadCallback(e,t){const i=this;i.loading=Math.max(i.loading-1,0),i.lastQuery=null,i.clearActiveOption(),i.setupOptions(e,t),i.refreshOptions(i.isFocused&&!i.isInputHidden),i.loading||_e(i.wrapper,i.settings.loadingClass),i.trigger("load",e,t)}preload(){var e=this.wrapper.classList;e.contains("preloaded")||(e.add("preloaded"),this.load(""))}setTextboxValue(e=""){var t=this.control_input;t.value!==e&&(t.value=e,ve(t,"update"),this.lastValue=e)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(e,t){ae(this,t?[]:["change"],()=>{this.clear(t),this.addItems(e,t)})}setMaxItems(e){0===e&&(e=null),this.settings.maxItems=e,this.refreshState()}setActiveItem(e,t){var i,n,r,s,o,a,l=this;if("single"!==l.settings.mode){if(!e)return l.clearActiveItems(),void(l.isFocused&&l.inputState());if("click"===(i=t&&t.type.toLowerCase())&&de("shiftKey",t)&&l.activeItems.length){for(a=l.getLastActive(),(r=Array.prototype.indexOf.call(l.control.children,a))>(s=Array.prototype.indexOf.call(l.control.children,e))&&(o=r,r=s,s=o),n=r;n<=s;n++)e=l.control.children[n],-1===l.activeItems.indexOf(e)&&l.setActiveItemClass(e);le(t)}else"click"===i&&de(xe,t)||"keydown"===i&&de("shiftKey",t)?e.classList.contains("active")?l.removeActiveItem(e):l.setActiveItemClass(e):(l.clearActiveItems(),l.setActiveItemClass(e));l.inputState(),l.isFocused||l.focus()}}setActiveItemClass(e){const t=this,i=t.control.querySelector(".last-active");i&&_e(i,"last-active"),ye(e,"active last-active"),t.trigger("item_select",e),-1==t.activeItems.indexOf(e)&&t.activeItems.push(e)}removeActiveItem(e){var t=this.activeItems.indexOf(e);this.activeItems.splice(t,1),_e(e,"active")}clearActiveItems(){_e(this.activeItems,"active"),this.activeItems=[]}setActiveOption(e,t=!0){e!==this.activeOption&&(this.clearActiveOption(),e&&(this.activeOption=e,Oe(this.focus_node,{"aria-activedescendant":e.getAttribute("id")}),Oe(e,{"aria-selected":"true"}),ye(e,"active"),t&&this.scrollToOption(e)))}scrollToOption(e,t){if(!e)return;const i=this.dropdown_content,n=i.clientHeight,r=i.scrollTop||0,s=e.offsetHeight,o=e.getBoundingClientRect().top-i.getBoundingClientRect().top+r;o+s>n+r?this.scroll(o-n+s,t):o<r&&this.scroll(o,t)}scroll(e,t){const i=this.dropdown_content;t&&(i.style.scrollBehavior=t),i.scrollTop=e,i.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(_e(this.activeOption,"active"),Oe(this.activeOption,{"aria-selected":null})),this.activeOption=null,Oe(this.focus_node,{"aria-activedescendant":null})}selectAll(){const e=this;if("single"===e.settings.mode)return;const t=e.controlChildren();t.length&&(e.inputState(),e.close(),e.activeItems=t,fe(t,t=>{e.setActiveItemClass(t)}))}inputState(){var e=this;e.control.contains(e.control_input)&&(Oe(e.control_input,{placeholder:e.settings.placeholder}),e.activeItems.length>0||!e.isFocused&&e.settings.hidePlaceholder&&e.items.length>0?(e.setTextboxValue(),e.isInputHidden=!0):(e.settings.hidePlaceholder&&e.items.length>0&&Oe(e.control_input,{placeholder:""}),e.isInputHidden=!1),e.wrapper.classList.toggle("input-hidden",e.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var e=this;e.isDisabled||e.isReadOnly||(e.ignoreFocus=!0,e.control_input.offsetWidth?e.control_input.focus():e.focus_node.focus(),setTimeout(()=>{e.ignoreFocus=!1,e.onFocus()},0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())}getSearchOptions(){var e=this.settings,t=e.sortField;return"string"==typeof e.sortField&&(t=[{field:e.sortField}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t,nesting:e.nesting}}search(e){var t,i,n=this,r=this.getSearchOptions();if(n.settings.score&&"function"!=typeof(i=n.settings.score.call(n,e)))throw new Error('Tom Select "score" setting must be a function that returns a function');return e!==n.lastQuery?(n.lastQuery=e,t=n.sifter.search(e,Object.assign(r,{score:i})),n.currentResults=t):t=Object.assign({},n.currentResults),n.settings.hideSelected&&(t.items=t.items.filter(e=>{let t=ne(e.id);return!(t&&-1!==n.items.indexOf(t))})),t}refreshOptions(e=!0){var t,i,n,r,s,o,a,l,c,d;const u={},h=[];var p=this,f=p.inputValue();const g=f===p.lastQuery||""==f&&null==p.lastQuery;var m=p.search(f),v=null,b=p.settings.shouldOpen||!1,y=p.dropdown_content;g&&(v=p.activeOption)&&(c=v.closest("[data-group]")),r=m.items.length,"number"==typeof p.settings.maxOptions&&(r=Math.min(r,p.settings.maxOptions)),r>0&&(b=!0);const _=(e,t)=>{let i=u[e];if(void 0!==i){let e=h[i];if(void 0!==e)return[i,e.fragment]}let n=document.createDocumentFragment();return i=h.length,h.push({fragment:n,order:t,optgroup:e}),[i,n]};for(t=0;t<r;t++){let e=m.items[t];if(!e)continue;let r=e.id,a=p.options[r];if(void 0===a)continue;let l=re(r),d=p.getOption(l,!0);for(p.settings.hideSelected||d.classList.toggle("selected",p.items.includes(l)),s=a[p.settings.optgroupField]||"",i=0,n=(o=Array.isArray(s)?s:[s])&&o.length;i<n;i++){s=o[i];let e=a.$order,t=p.optgroups[s];void 0===t?s="":e=t.$order;const[n,l]=_(s,e);i>0&&(d=d.cloneNode(!0),Oe(d,{id:a.$id+"-clone-"+i,"aria-selected":null}),d.classList.add("ts-cloned"),_e(d,"active"),p.activeOption&&p.activeOption.dataset.value==r&&c&&c.dataset.group===s.toString()&&(v=d)),l.appendChild(d),""!=s&&(u[s]=n)}}var w;p.settings.lockOptgroupOrder&&h.sort((e,t)=>e.order-t.order),a=document.createDocumentFragment(),fe(h,e=>{let t=e.fragment,i=e.optgroup;if(!t||!t.children.length)return;let n=p.optgroups[i];if(void 0!==n){let e=document.createDocumentFragment(),i=p.render("optgroup_header",n);pe(e,i),pe(e,t);let r=p.render("optgroup",{group:n,options:e});pe(a,r)}else pe(a,t)}),y.innerHTML="",pe(y,a),p.settings.highlight&&(w=y.querySelectorAll("span.highlight"),Array.prototype.forEach.call(w,function(e){var t=e.parentNode;t.replaceChild(e.firstChild,e),t.normalize()}),m.query.length&&m.tokens.length&&fe(m.tokens,e=>{De(y,e.regex)}));var E=e=>{let t=p.render(e,{input:f});return t&&(b=!0,y.insertBefore(t,y.firstChild)),t};if(p.loading?E("loading"):p.settings.shouldLoad.call(p,f)?0===m.items.length&&E("no_results"):E("not_loading"),(l=p.canCreate(f))&&(d=E("option_create")),p.hasOptions=m.items.length>0||l,b){if(m.items.length>0){if(v||"single"!==p.settings.mode||null==p.items[0]||(v=p.getOption(p.items[0])),!y.contains(v)){let e=0;d&&!p.settings.addPrecedence&&(e=1),v=p.selectable()[e]}}else d&&(v=d);e&&!p.isOpen&&(p.open(),p.scrollToOption(v,"auto")),p.setActiveOption(v)}else p.clearActiveOption(),e&&p.isOpen&&p.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(e,t=!1){const i=this;if(Array.isArray(e))return i.addOptions(e,t),!1;const n=ne(e[i.settings.valueField]);return null!==n&&!i.options.hasOwnProperty(n)&&(e.$order=e.$order||++i.order,e.$id=i.inputId+"-opt-"+e.$order,i.options[n]=e,i.lastQuery=null,t&&(i.userOptions[n]=t,i.trigger("option_add",n,e)),n)}addOptions(e,t=!1){fe(e,e=>{this.addOption(e,t)})}registerOption(e){return this.addOption(e)}registerOptionGroup(e){var t=ne(e[this.settings.optgroupValueField]);return null!==t&&(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)}addOptionGroup(e,t){var i;t[this.settings.optgroupValueField]=e,(i=this.registerOptionGroup(t))&&this.trigger("optgroup_add",i,t)}removeOptionGroup(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.clearCache(),this.trigger("optgroup_remove",e))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(e,t){const i=this;var n,r;const s=ne(e),o=ne(t[i.settings.valueField]);if(null===s)return;const a=i.options[s];if(null==a)return;if("string"!=typeof o)throw new Error("Value must be set in option data");const l=i.getOption(s),c=i.getItem(s);if(t.$order=t.$order||a.$order,delete i.options[s],i.uncacheValue(o),i.options[o]=t,l){if(i.dropdown_content.contains(l)){const e=i._render("option",t);Ce(l,e),i.activeOption===l&&i.setActiveOption(e)}l.remove()}c&&(-1!==(r=i.items.indexOf(s))&&i.items.splice(r,1,o),n=i._render("item",t),c.classList.contains("active")&&ye(n,"active"),Ce(c,n)),i.lastQuery=null}removeOption(e,t){const i=this;e=re(e),i.uncacheValue(e),delete i.userOptions[e],delete i.options[e],i.lastQuery=null,i.trigger("option_remove",e),i.removeItem(e,t)}clearOptions(e){const t=(e||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const i={};fe(this.options,(e,n)=>{t(e,n)&&(i[n]=e)}),this.options=this.sifter.items=i,this.lastQuery=null,this.trigger("option_clear")}clearFilter(e,t){return this.items.indexOf(t)>=0}getOption(e,t=!1){const i=ne(e);if(null===i)return null;const n=this.options[i];if(null!=n){if(n.$div)return n.$div;if(t)return this._render("option",n)}return null}getAdjacent(e,t,i="option"){var n;if(!e)return null;n="item"==i?this.controlChildren():this.dropdown_content.querySelectorAll("[data-selectable]");for(let i=0;i<n.length;i++)if(n[i]==e)return t>0?n[i+1]:n[i-1];return null}getItem(e){if("object"==typeof e)return e;var t=ne(e);return null!==t?this.control.querySelector(`[data-value="${he(t)}"]`):null}addItems(e,t){var i=this,n=Array.isArray(e)?e:[e];const r=(n=n.filter(e=>-1===i.items.indexOf(e)))[n.length-1];n.forEach(e=>{i.isPending=e!==r,i.addItem(e,t)})}addItem(e,t){ae(this,t?[]:["change","dropdown_close"],()=>{var i,n;const r=this,s=r.settings.mode,o=ne(e);if((!o||-1===r.items.indexOf(o)||("single"===s&&r.close(),"single"!==s&&r.settings.duplicates))&&null!==o&&r.options.hasOwnProperty(o)&&("single"===s&&r.clear(t),"multi"!==s||!r.isFull())){if(i=r._render("item",r.options[o]),r.control.contains(i)&&(i=i.cloneNode(!0)),n=r.isFull(),r.items.splice(r.caretPos,0,o),r.insertAtCaret(i),r.isSetup){if(!r.isPending&&r.settings.hideSelected){let e=r.getOption(o),t=r.getAdjacent(e,1);t&&r.setActiveOption(t)}r.isPending||r.settings.closeAfterSelect||r.refreshOptions(r.isFocused&&"single"!==s),0!=r.settings.closeAfterSelect&&r.isFull()?r.close():r.isPending||r.positionDropdown(),r.trigger("item_add",o,i),r.isPending||r.updateOriginalInput({silent:t})}(!r.isPending||!n&&r.isFull())&&(r.inputState(),r.refreshState())}})}removeItem(e=null,t){const i=this;if(!(e=i.getItem(e)))return;var n,r;const s=e.dataset.value;n=ke(e),e.remove(),e.classList.contains("active")&&(r=i.activeItems.indexOf(e),i.activeItems.splice(r,1),_e(e,"active")),i.items.splice(n,1),i.lastQuery=null,!i.settings.persist&&i.userOptions.hasOwnProperty(s)&&i.removeOption(s,t),n<i.caretPos&&i.setCaret(i.caretPos-1),i.updateOriginalInput({silent:t}),i.refreshState(),i.positionDropdown(),i.trigger("item_remove",s,e)}createItem(e=null,t=()=>{}){3===arguments.length&&(t=arguments[2]),"function"!=typeof t&&(t=()=>{});var i,n=this,r=n.caretPos;if(e=e||n.inputValue(),!n.canCreate(e))return t(),!1;n.lock();var s=!1,o=e=>{if(n.unlock(),!e||"object"!=typeof e)return t();var i=ne(e[n.settings.valueField]);if("string"!=typeof i)return t();n.setTextboxValue(),n.addOption(e,!0),n.setCaret(r),n.addItem(i),t(e),s=!0};return i="function"==typeof n.settings.create?n.settings.create.call(this,e,o):{[n.settings.labelField]:e,[n.settings.valueField]:e},s||o(i),!0}refreshItems(){var e=this;e.lastQuery=null,e.isSetup&&e.addItems(e.items),e.updateOriginalInput(),e.refreshState()}refreshState(){const e=this;e.refreshValidityState();const t=e.isFull(),i=e.isLocked;e.wrapper.classList.toggle("rtl",e.rtl);const n=e.wrapper.classList;var r;n.toggle("focus",e.isFocused),n.toggle("disabled",e.isDisabled),n.toggle("readonly",e.isReadOnly),n.toggle("required",e.isRequired),n.toggle("invalid",!e.isValid),n.toggle("locked",i),n.toggle("full",t),n.toggle("input-active",e.isFocused&&!e.isInputHidden),n.toggle("dropdown-active",e.isOpen),n.toggle("has-options",(r=e.options,0===Object.keys(r).length)),n.toggle("has-items",e.items.length>0)}refreshValidityState(){var e=this;e.input.validity&&(e.isValid=e.input.validity.valid,e.isInvalid=!e.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(e={}){const t=this;var i,n;const r=t.input.querySelector('option[value=""]');if(t.is_select_tag){const s=[],o=t.input.querySelectorAll("option:checked").length;function a(e,i,n){return e||(e=ge('<option value="'+se(i)+'">'+se(n)+"</option>")),e!=r&&t.input.append(e),s.push(e),(e!=r||o>0)&&(e.selected=!0),e}t.input.querySelectorAll("option:checked").forEach(e=>{e.selected=!1}),0==t.items.length&&"single"==t.settings.mode?a(r,"",""):t.items.forEach(e=>{if(i=t.options[e],n=i[t.settings.labelField]||"",s.includes(i.$option)){a(t.input.querySelector(`option[value="${he(e)}"]:not(:checked)`),e,n)}else i.$option=a(i.$option,e,n)})}else t.input.value=t.getValue();t.isSetup&&(e.silent||t.trigger("change",t.getValue()))}open(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.isOpen=!0,Oe(e.focus_node,{"aria-expanded":"true"}),e.refreshState(),be(e.dropdown,{visibility:"hidden",display:"block"}),e.positionDropdown(),be(e.dropdown,{visibility:"visible",display:"block"}),e.focus(),e.trigger("dropdown_open",e.dropdown))}close(e=!0){var t=this,i=t.isOpen;e&&(t.setTextboxValue(),"single"===t.settings.mode&&t.items.length&&t.inputState()),t.isOpen=!1,Oe(t.focus_node,{"aria-expanded":"false"}),be(t.dropdown,{display:"none"}),t.settings.hideSelected&&t.clearActiveOption(),t.refreshState(),i&&t.trigger("dropdown_close",t.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var e=this.control,t=e.getBoundingClientRect(),i=e.offsetHeight+t.top+window.scrollY,n=t.left+window.scrollX;be(this.dropdown,{width:t.width+"px",top:i+"px",left:n+"px"})}}clear(e){var t=this;if(t.items.length){var i=t.controlChildren();fe(i,e=>{t.removeItem(e,!0)}),t.inputState(),e||t.updateOriginalInput(),t.trigger("clear")}}insertAtCaret(e){const t=this,i=t.caretPos,n=t.control;n.insertBefore(e,n.children[i]||null),t.setCaret(i+1)}deleteSelection(e){var t,i,n,r,s,o=this;t=e&&8===e.keyCode?-1:1,i={start:(s=o.control_input).selectionStart||0,length:(s.selectionEnd||0)-(s.selectionStart||0)};const a=[];if(o.activeItems.length)r=Se(o.activeItems,t),n=ke(r),t>0&&n++,fe(o.activeItems,e=>a.push(e));else if((o.isFocused||"single"===o.settings.mode)&&o.items.length){const e=o.controlChildren();let n;t<0&&0===i.start&&0===i.length?n=e[o.caretPos-1]:t>0&&i.start===o.inputValue().length&&(n=e[o.caretPos]),void 0!==n&&a.push(n)}if(!o.shouldDelete(a,e))return!1;for(le(e,!0),void 0!==n&&o.setCaret(n);a.length;)o.removeItem(a.pop());return o.inputState(),o.positionDropdown(),o.refreshOptions(!1),!0}shouldDelete(e,t){const i=e.map(e=>e.dataset.value);return!(!i.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(i,t))}advanceSelection(e,t){var i,n,r=this;r.rtl&&(e*=-1),r.inputValue().length||(de(xe,t)||de("shiftKey",t)?(n=(i=r.getLastActive(e))?i.classList.contains("active")?r.getAdjacent(i,e,"item"):i:e>0?r.control_input.nextElementSibling:r.control_input.previousElementSibling)&&(n.classList.contains("active")&&r.removeActiveItem(i),r.setActiveItemClass(n)):r.moveCaret(e))}moveCaret(e){}getLastActive(e){let t=this.control.querySelector(".last-active");if(t)return t;var i=this.control.querySelectorAll(".active");return i?Se(i,e):void 0}setCaret(e){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(e=this.isReadOnly||this.isDisabled){this.isLocked=e,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(e){this.focus_node.tabIndex=e?-1:this.tabIndex,this.isDisabled=e,this.input.disabled=e,this.control_input.disabled=e,this.setLocked()}setReadOnly(e){this.isReadOnly=e,this.input.readOnly=e,this.control_input.readOnly=e,this.setLocked()}destroy(){var e=this,t=e.revertSettings;e.trigger("destroy"),e.off(),e.wrapper.remove(),e.dropdown.remove(),e.input.innerHTML=t.innerHTML,e.input.tabIndex=t.tabIndex,_e(e.input,"tomselected","ts-hidden-accessible"),e._destroy(),delete e.input.tomselect}render(e,t){var i,n;const r=this;if("function"!=typeof this.settings.render[e])return null;if(!(n=r.settings.render[e].call(this,t,se)))return null;if(n=ge(n),"option"===e||"option_create"===e?t[r.settings.disabledField]?Oe(n,{"aria-disabled":"true"}):Oe(n,{"data-selectable":""}):"optgroup"===e&&(i=t.group[r.settings.optgroupValueField],Oe(n,{"data-group":i}),t.group[r.settings.disabledField]&&Oe(n,{"data-disabled":""})),"option"===e||"item"===e){const i=re(t[r.settings.valueField]);Oe(n,{"data-value":i}),"item"===e?(ye(n,r.settings.itemClass),Oe(n,{"data-ts-item":""})):(ye(n,r.settings.optionClass),Oe(n,{role:"option",id:t.$id}),t.$div=n,r.options[i]=t)}return n}_render(e,t){const i=this.render(e,t);if(null==i)throw"HTMLElement expected";return i}clearCache(){fe(this.options,e=>{e.$div&&(e.$div.remove(),delete e.$div)})}uncacheValue(e){const t=this.getOption(e);t&&t.remove()}canCreate(e){return this.settings.create&&e.length>0&&this.settings.createFilter.call(this,e)}hook(e,t,i){var n=this,r=n[t];n[t]=function(){var t,s;return"after"===e&&(t=r.apply(n,arguments)),s=i.apply(n,arguments),"instead"===e?s:("before"===e&&(t=r.apply(n,arguments)),t)}}};const Fe=e=>"boolean"==typeof e?e?"1":"0":e+"",Ne=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},je=e=>"string"==typeof e&&e.indexOf("<")>-1;const Pe=e=>"string"==typeof e&&e.indexOf("<")>-1;const $e=(e,t,i,n)=>{e.addEventListener(t,i,n)},He=e=>"string"==typeof e&&e.indexOf("<")>-1,qe=(e,t)=>{((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(t,(t,i)=>{null==t?e.removeAttribute(i):e.setAttribute(i,""+t)})};const Re=e=>"string"==typeof e&&e.indexOf("<")>-1;const Be=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Ve=e=>(Array.isArray(e)||(e=[e]),e);const ze=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(We(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},We=e=>"string"==typeof e&&e.indexOf("<")>-1,Ye=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},Ke=e=>(Array.isArray(e)||(e=[e]),e);const Ue=(e,t,i,n)=>{e.addEventListener(t,i,n)};const Xe=(e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())},Qe=(e,t,i,n)=>{e.addEventListener(t,i,n)},Ge=e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(Je(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)},Je=e=>"string"==typeof e&&e.indexOf("<")>-1;const Ze=e=>{var t=[];return((e,t)=>{if(Array.isArray(e))e.forEach(t);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)})(e,e=>{"string"==typeof e&&(e=e.trim().split(/[\t\n\f\r\s]/)),Array.isArray(e)&&(t=t.concat(e))}),t.filter(Boolean)},et=e=>(Array.isArray(e)||(e=[e]),e);Me.define("change_listener",function(){var e,t,i,n;e=this.input,t="change",i=()=>{this.sync()},e.addEventListener(t,i,n)}),Me.define("checkbox_options",function(e){var t=this,i=t.onOptionSelect;t.settings.hideSelected=!1;const n=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},e);var r=function(e,t){t?(e.checked=!0,n.uncheckedClassNames&&e.classList.remove(...n.uncheckedClassNames),n.checkedClassNames&&e.classList.add(...n.checkedClassNames)):(e.checked=!1,n.checkedClassNames&&e.classList.remove(...n.checkedClassNames),n.uncheckedClassNames&&e.classList.add(...n.uncheckedClassNames))},s=function(e){setTimeout(()=>{var t=e.querySelector("input."+n.className);t instanceof HTMLInputElement&&r(t,e.classList.contains("selected"))},1)};t.hook("after","setupTemplates",()=>{var e=t.settings.render.option;t.settings.render.option=(i,s)=>{var o=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(je(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(e.call(t,i,s)),a=document.createElement("input");n.className&&a.classList.add(n.className),a.addEventListener("click",function(e){Ne(e)}),a.type="checkbox";const l=null==(c=i[t.settings.valueField])?null:Fe(c);var c;return r(a,!!(l&&t.items.indexOf(l)>-1)),o.prepend(a),o}}),t.on("item_remove",e=>{var i=t.getOption(e);i&&(i.classList.remove("selected"),s(i))}),t.on("item_add",e=>{var i=t.getOption(e);i&&s(i)}),t.hook("instead","onOptionSelect",(e,n)=>{if(n.classList.contains("selected"))return n.classList.remove("selected"),t.removeItem(n.dataset.value),t.refreshOptions(),void Ne(e,!0);i.call(t,e,n),s(n)})}),Me.define("clear_button",function(e){const t=this,i=Object.assign({className:"clear-button",title:"Clear All",html:e=>`<div class="${e.className}" title="${e.title}">&#10799;</div>`},e);t.on("initialize",()=>{var e=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(Pe(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(i.html(i));e.addEventListener("click",e=>{t.isLocked||(t.clear(),"single"===t.settings.mode&&t.settings.allowEmptyOption&&t.addItem(""),e.preventDefault(),e.stopPropagation())}),t.control.appendChild(e)})}),Me.define("drag_drop",function(){var e=this;if("multi"!==e.settings.mode)return;var t=e.lock,i=e.unlock;let n,r=!0;e.hook("after","setupTemplates",()=>{var t=e.settings.render.item;e.settings.render.item=(i,s)=>{const o=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(He(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(t.call(e,i,s));qe(o,{draggable:"true"});const a=e=>{e.preventDefault(),o.classList.add("ts-drag-over"),l(o,n)},l=(e,t)=>{var i,n,r;void 0!==t&&(((e,t)=>{do{var i;if(e==(t=null==(i=t)?void 0:i.previousElementSibling))return!0}while(t&&t.previousElementSibling);return!1})(t,o)?(n=t,null==(r=(i=e).parentNode)||r.insertBefore(n,i.nextSibling)):((e,t)=>{var i;null==(i=e.parentNode)||i.insertBefore(t,e)})(e,t))};return $e(o,"mousedown",e=>{r||((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(e),e.stopPropagation()}),$e(o,"dragstart",e=>{n=o,setTimeout(()=>{o.classList.add("ts-dragging")},0)}),$e(o,"dragenter",a),$e(o,"dragover",a),$e(o,"dragleave",()=>{o.classList.remove("ts-drag-over")}),$e(o,"dragend",()=>{var t;document.querySelectorAll(".ts-drag-over").forEach(e=>e.classList.remove("ts-drag-over")),null==(t=n)||t.classList.remove("ts-dragging"),n=void 0;var i=[];e.control.querySelectorAll("[data-value]").forEach(e=>{if(e.dataset.value){let t=e.dataset.value;t&&i.push(t)}}),e.setValue(i)}),o}}),e.hook("instead","lock",()=>(r=!1,t.call(e))),e.hook("instead","unlock",()=>(r=!0,i.call(e)))}),Me.define("dropdown_header",function(e){const t=this,i=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:e=>'<div class="'+e.headerClass+'"><div class="'+e.titleRowClass+'"><span class="'+e.labelClass+'">'+e.title+'</span><a class="'+e.closeClass+'">&times;</a></div></div>'},e);t.on("initialize",()=>{var e=(e=>{if(e.jquery)return e[0];if(e instanceof HTMLElement)return e;if(Re(e)){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild}return document.querySelector(e)})(i.html(i)),n=e.querySelector("."+i.closeClass);n&&n.addEventListener("click",e=>{((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(e,!0),t.close()}),t.dropdown.insertBefore(e,t.dropdown.firstChild)})}),Me.define("caret_position",function(){var e=this;e.hook("instead","setCaret",t=>{"single"!==e.settings.mode&&e.control.contains(e.control_input)?(t=Math.max(0,Math.min(e.items.length,t)))==e.caretPos||e.isPending||e.controlChildren().forEach((i,n)=>{n<t?e.control_input.insertAdjacentElement("beforebegin",i):e.control.appendChild(i)}):t=e.items.length,e.caretPos=t}),e.hook("instead","moveCaret",t=>{if(!e.isFocused)return;const i=e.getLastActive(t);if(i){const n=((e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i})(i);e.setCaret(t>0?n+1:n),e.setActiveItem(),((e,...t)=>{var i=Be(t);(e=Ve(e)).map(e=>{i.map(t=>{e.classList.remove(t)})})})(i,"last-active")}else e.setCaret(e.caretPos+t)})}),Me.define("dropdown_input",function(){const e=this;e.settings.shouldOpen=!0,e.hook("before","setup",()=>{e.focus_node=e.control,((e,...t)=>{var i=Ye(t);(e=Ke(e)).map(e=>{i.map(t=>{e.classList.add(t)})})})(e.control_input,"dropdown-input");const t=ze('<div class="dropdown-input-wrap">');t.append(e.control_input),e.dropdown.insertBefore(t,e.dropdown.firstChild);const i=ze('<input class="items-placeholder" tabindex="-1" />');i.placeholder=e.settings.placeholder||"",e.control.append(i)}),e.on("initialize",()=>{e.control_input.addEventListener("keydown",t=>{switch(t.keyCode){case 27:return e.isOpen&&(((e,t=!1)=>{e&&(e.preventDefault(),t&&e.stopPropagation())})(t,!0),e.close()),void e.clearActiveItems();case 9:e.focus_node.tabIndex=-1}return e.onKeyDown.call(e,t)}),e.on("blur",()=>{e.focus_node.tabIndex=e.isDisabled?-1:e.tabIndex}),e.on("dropdown_open",()=>{e.control_input.focus()});const t=e.onBlur;var i,n,r,s;e.hook("instead","onBlur",i=>{if(!i||i.relatedTarget!=e.control_input)return t.call(e)}),i=e.control_input,n="blur",r=()=>e.onBlur(),i.addEventListener(n,r,s),e.hook("before","close",()=>{e.isOpen&&e.focus_node.focus({preventScroll:!0})})})}),Me.define("input_autogrow",function(){var e=this;e.on("initialize",()=>{var t=document.createElement("span"),i=e.control_input;t.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",e.wrapper.appendChild(t);for(const e of["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"])t.style[e]=i.style[e];var n=()=>{t.textContent=i.value,i.style.width=t.clientWidth+"px"};n(),e.on("update item_add item_remove",n),Ue(i,"input",n),Ue(i,"keyup",n),Ue(i,"blur",n),Ue(i,"update",n)})}),Me.define("no_backspace_delete",function(){var e=this,t=e.deleteSelection;this.hook("instead","deleteSelection",i=>!!e.activeItems.length&&t.call(e,i))}),Me.define("no_active_items",function(){this.hook("instead","setActiveItem",()=>{}),this.hook("instead","selectAll",()=>{})}),Me.define("optgroup_columns",function(){var e=this,t=e.onKeyDown;e.hook("instead","onKeyDown",i=>{var n,r,s,o;if(!e.isOpen||37!==i.keyCode&&39!==i.keyCode)return t.call(e,i);e.ignoreHover=!0,o=((e,t)=>{for(;e&&e.matches;){if(e.matches(t))return e;e=e.parentNode}})(e.activeOption,"[data-group]"),n=((e,t)=>{if(!e)return-1;t=t||e.nodeName;for(var i=0;e=e.previousElementSibling;)e.matches(t)&&i++;return i})(e.activeOption,"[data-selectable]"),o&&(o=37===i.keyCode?o.previousSibling:o.nextSibling)&&(r=(s=o.querySelectorAll("[data-selectable]"))[Math.min(s.length-1,n)])&&e.setActiveOption(r)})}),Me.define("remove_button",function(e){const t=Object.assign({label:"&times;",title:"Remove",className:"remove",append:!0},e);var i=this;if(t.append){var n='<a href="javascript:void(0)" class="'+t.className+'" tabindex="-1" title="'+((t.title+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")+'">')+t.label+"</a>";i.hook("after","setupTemplates",()=>{var e=i.settings.render.item;i.settings.render.item=(t,r)=>{var s=Ge(e.call(i,t,r)),o=Ge(n);return s.appendChild(o),Qe(o,"mousedown",e=>{Xe(e,!0)}),Qe(o,"click",e=>{i.isLocked||(Xe(e,!0),i.isLocked||i.shouldDelete([s],e)&&(i.removeItem(s),i.refreshOptions(!1),i.inputState()))}),s}})}}),Me.define("restore_on_backspace",function(e){const t=this,i=Object.assign({text:e=>e[t.settings.labelField]},e);t.on("item_remove",function(e){if(t.isFocused&&""===t.control_input.value.trim()){var n=t.options[e];n&&t.setTextboxValue(i.text.call(t,n))}})}),Me.define("virtual_scroll",function(){const e=this,t=e.canLoad,i=e.clearActiveOption,n=e.loadCallback;var r,s,o={},a=!1,l=[];if(e.settings.shouldLoadMore||(e.settings.shouldLoadMore=()=>{if(r.clientHeight/(r.scrollHeight-r.scrollTop)>.9)return!0;if(e.activeOption){var t=e.selectable();if(Array.from(t).indexOf(e.activeOption)>=t.length-2)return!0}return!1}),!e.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";e.settings.sortField=[{field:"$order"},{field:"$score"}];const c=t=>!("number"==typeof e.settings.maxOptions&&r.children.length>=e.settings.maxOptions)&&!(!(t in o)||!o[t]),d=(t,i)=>e.items.indexOf(i)>=0||l.indexOf(i)>=0;e.setNextUrl=(e,t)=>{o[e]=t},e.getUrl=t=>{if(t in o){const e=o[t];return o[t]=!1,e}return e.clearPagination(),e.settings.firstUrl.call(e,t)},e.clearPagination=()=>{o={}},e.hook("instead","clearActiveOption",()=>{if(!a)return i.call(e)}),e.hook("instead","canLoad",i=>i in o?c(i):t.call(e,i)),e.hook("instead","loadCallback",(t,i)=>{if(a){if(s){const i=t[0];void 0!==i&&(s.dataset.value=i[e.settings.valueField])}}else e.clearOptions(d);n.call(e,t,i),a=!1}),e.hook("after","refreshOptions",()=>{const t=e.lastValue;var i;c(t)?(i=e.render("loading_more",{query:t}))&&(i.setAttribute("data-selectable",""),s=i):t in o&&!r.querySelector(".no-results")&&(i=e.render("no_more_results",{query:t})),i&&(((e,...t)=>{var i=Ze(t);(e=et(e)).map(e=>{i.map(t=>{e.classList.add(t)})})})(i,e.settings.optionClass),r.append(i))}),e.on("initialize",()=>{l=Object.keys(e.options),r=e.dropdown_content,e.settings.render=Object.assign({},{loading_more:()=>'<div class="loading-more-results">Loading more results ... </div>',no_more_results:()=>'<div class="no-more-results">No more results</div>'},e.settings.render),r.addEventListener("scroll",()=>{e.settings.shouldLoadMore.call(e)&&c(e.lastValue)&&(a||(a=!0,e.load.call(e,e.lastValue)))})})});class tt{constructor(e){this.datepicker=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initDatepicker(e)}),this.initDatepicker(e),!0}initDatepicker(e){const t=e.el.querySelectorAll("input[data-provide='datepicker']");t.length>=1&&this.datepicker.initDatepickers(Array.from(t),e)}}class it{constructor(e){this.nette=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initNetteForms(e)}),this.initNetteForms(e),!0}initNetteForms(e){var t,i;const n=null!==(i=null!==(t=this.nette)&&void 0!==t?t:w().Nette)&&void 0!==i?i:null;n&&e.el.querySelectorAll("form").forEach(e=>n.initForm(e))}}class nt{constructor(e){this.selectpicker=e}onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initSelectpicker(e)}),this.initSelectpicker(e),!0}initSelectpicker(e){const t=e.el.querySelectorAll("select.selectpicker");t.length>=1&&this.selectpicker.initSelectpickers(Array.from(t),e)}}class rt{constructor(e){this.sortable=e}onDatagridInit(e){return e.ajax.addEventListener("before",e=>{}),this.sortable.initSortable(e),e.ajax.addEventListener("success",({detail:{payload:t}})=>{if(t._datagrid_sort){for(const i in t._datagrid_sort){const n=t._datagrid_sort[i],r=e.el.querySelector(`#datagrid-sort-${i}`);r&&(r.setAttribute("href",n),r.setAttribute("data-href",n))}this.sortable.initSortable(e)}if(t._datagrid_tree){const i=e.el.querySelector(`.datagrid-tree-item[data-id='${t._datagrid_tree}'] .datagrid-tree-item-children`);if(i&&t.snippets){i.classList.add("loaded");for(const e in t.snippets){const n=t.snippets[e],r=(new DOMParser).parseFromString(n,"text/html").firstElementChild;if(r){const t=document.createElement("div");t.id=e,t.classList.add("datagrid-tree-item"),t.setAttribute("data-id",e),r.hasAttribute("has-children")&&t.classList.add("has-children"),i.append(t)}}}this.sortable.initSortableTree(e)}}),!0}}class st{onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.initPerPage(e),this.initChange(e)}),this.initPerPage(e),this.initChange(e),!0}initPerPage(e){e.el.querySelectorAll("select[data-autosubmit-per-page]").forEach(t=>{t.addEventListener("change",()=>{var i,n;let r=null===(i=t.parentElement)||void 0===i?void 0:i.querySelector("input[type=submit]");if(r||(r=null===(n=t.parentElement)||void 0===n?void 0:n.querySelector("button[type=submit]")),!(r instanceof HTMLElement))return;const s=r.closest("form");s&&e.ajax.submitForm(s)})})}initChange(e){e.el.querySelectorAll("[data-autosubmit]").forEach(t=>{const i=t.closest("form");i&&"true"!==t.dataset.listenersAttached&&(t.dataset.listenersAttached="true",t instanceof HTMLSelectElement?t.addEventListener("change",()=>e.ajax.submitForm(i)):t instanceof HTMLInputElement&&(t.hasAttribute("data-autosubmit-change")&&t.addEventListener("change",E(()=>e.ajax.submitForm(i))),t.addEventListener("keyup",E(t=>{if(_(t)||!function(e,t,i){const n=1===e.key.length?e.key.charCodeAt(0):0;return n>=t&&n<=i}(t,9,40)&&!function(e){return 2===e.key.length&&e.key.startsWith("F")}(t))return e.ajax.submitForm(i)}))))})}}class ot{onDatagridInit(e){return e.ajax.addEventListener("complete",t=>{this.init(e)}),this.init(e)}init(e){let t=null;e.el.addEventListener("click",e=>{if(e.target instanceof HTMLElement&&e.target.classList.contains("col-checkbox")&&(t=e.target,e.shiftKey&&t)){const e=t.closest("tr");if(!e)return;const i=t.closest("tr");if(!i)return;const n=i.closest("tbody");if(!n)return;const r=Array.from(n.querySelectorAll("tr")),[s,o]=[i.rowIndex,e.rowIndex].sort();r.slice(s,o+1).forEach(e=>{const t=e.querySelector('.col-checkbox input[type="checkbox"]');t&&(t.checked=!0)})}});const i=Array.from(e.el.querySelectorAll(`input[data-check='${e.name}']:not([data-check-all])`)),n=e.el.querySelector(`input[data-check='${e.name}'][data-check-all]`),r=e.el.querySelector("select[name='group_action[group_action]']"),s=document.querySelectorAll(".row-group-actions *[type='submit']"),o=document.querySelector(".datagrid-selected-rows-count");return[...i,n].forEach(t=>{t&&t.addEventListener("change",()=>{if(t.hasAttribute("data-check-all")){if(e.name!==t.getAttribute("data-check-all"))return;if(i.forEach(e=>e.checked=t.checked),s.forEach(e=>e.disabled=!t.checked),r&&(r.disabled=!t.checked),o){const e=i.length;o.innerText=`${t.checked?e:0}/${e}`}return}n&&(n.checked=i.every(e=>e.checked));const a=i.filter(e=>e.checked),l=a.length>=1;s.forEach(e=>e.disabled=!l),r&&(r.disabled=!l),o&&(o.innerText=`${a.length}/${i.length}`)})}),!0}}const at="data-datagrid-confirm";class lt{onDatagridInit(e){return e.el.querySelectorAll(`[${at}]:not(.ajax)`).forEach(t=>t.addEventListener("click",t=>this.confirmEventHandler.bind(e)(t.target,t))),e.ajax.addEventListener("interact",t=>this.confirmEventHandler.bind(e)(t.detail.element,t)),!0}confirmEventHandler(e,t){var i;const n=null===(i=e.closest("a"))||void 0===i?void 0:i.getAttribute(at);n&&(window.confirm.bind(window)(n)||(t.stopPropagation(),t.preventDefault()))}}const ct="data-datagrid-editable-url";class dt{onDatagridInit(e){return e.ajax.addEventListener("success",t=>{this.initEditableCells(e)}),this.initEditableCells(e),!0}initEditableCells(e){e.el.querySelectorAll(`[${ct}]`).forEach(t=>{t.addEventListener("click",i=>{var n,r,s,o;if(!(t instanceof HTMLAnchorElement||t.classList.contains("datagrid-inline-edit")||t.classList.contains("editing"))){t.classList.add("editing");const i=t.innerHTML.replace(/<\/?br>/g,"\n"),a=null!==(n=t.getAttribute("data-datagrid-editable-value"))&&void 0!==n?n:i;t.setAttribute("originalValue",i),t.setAttribute("valueToEdit",a);const l=null!==(r=t.getAttribute("data-datagrid-editable-type"))&&void 0!==r?r:"text";let c;switch(l){case"textarea":t.innerHTML=`<textarea rows="${function(e){var t;const i=e.style.padding?parseInt(e.style.padding.replace(/[^-\d\.]/g,""),10):0,n=e.getBoundingClientRect().height,r=Math.round(parseFloat(null!==(t=e.style.lineHeight)&&void 0!==t?t:"0"));return Math.round((n-2*i)/r)}(t)}">${a}</textarea>`,c=t.querySelector("textarea");break;case"select":c=t.querySelector(null!==(s=t.getAttribute("data-datagrid-editable-element"))&&void 0!==s?s:""),c.querySelectorAll(`option[value='${a}']`).forEach(e=>e.setAttribute("selected","true"));break;default:t.innerHTML=`<input type='${l}' />`,c=t.querySelector("input"),c.setAttribute("value",a.trim())}const d=JSON.parse(null!==(o=t.getAttribute("datagrid-editable-attrs"))&&void 0!==o?o:"{}");for(const e in d){const t=d[e];c.setAttribute(e,t)}t.classList.remove("edited");const u=async n=>{var r,s,o;let c=n.value;if(c!==a)try{const i=await e.ajax.request({url:null!==(r=t.getAttribute(ct))&&void 0!==r?r:"",method:"POST",data:{value:c}});"select"===l?t.innerHTML=null!==(o=null===(s=t.querySelector(`option[value='${c}']`))||void 0===s?void 0:s.innerHTML)&&void 0!==o?o:"":(i._datagrid_editable_new_value&&(c=i._datagrid_editable_new_value),t.innerHTML=c),t.classList.add("edited")}catch(e){t.innerHTML=i,t.classList.add("edited-error")}else t.innerHTML=i;t.classList.remove("editing")};t.querySelectorAll("input, textarea, select").forEach(e=>{e.addEventListener("blur",()=>u(e)),e.addEventListener("keydown",n=>{if(_(n))return n.stopPropagation(),n.preventDefault(),u(e);(function(e){return"Escape"===e.key})(n)&&(n.stopPropagation(),n.preventDefault(),t.classList.remove("editing"),t.innerHTML=i)}),e instanceof HTMLSelectElement&&e.addEventListener("change",()=>u(e))})}})})}}class ut{onInit(e){}onDatagridInit(e){return e.ajax.addEventListener("success",({detail:{payload:t}})=>{var i,n;if(t._datagrid_name&&t._datagrid_name===e.name){if(t._datagrid_inline_edited||t._datagrid_inline_edit_cancel){const i=e.el.querySelector(".datagrid-inline-edit-trigger");if(t._datagrid_inline_edited){e.el.querySelectorAll(`tr[data-id='${t._datagrid_inline_edited}'] > td`).forEach(e=>{e.classList.add("edited")})}return void(null==i||i.classList.remove("hidden"))}if(t._datagrid_inline_adding){const t=e.el.querySelector(".datagrid-row-inline-add");t&&(t.classList.remove("datagrid-row-inline-add-hidden"),null===(i=t.querySelector("input:not([readonly]), textarea:not([readonly])"))||void 0===i||i.focus())}t._datagrid_inline_editing&&(null===(n=e.el.querySelector(".datagrid-inline-edit-trigger"))||void 0===n||n.classList.add("hidden")),e.el.querySelectorAll(".datagrid-inline-edit input").forEach(e=>{e.addEventListener("keydown",t=>{var i,n;if(_(t))return t.stopPropagation(),t.preventDefault(),null===(n=null===(i=e.closest("tr"))||void 0===i?void 0:i.querySelector(".col-action-inline-edit [name='inline_edit[submit]']"))||void 0===n?void 0:n.click()})}),e.el.querySelectorAll(".datagrid-inline-add input").forEach(e=>{e.addEventListener("keydown",t=>{var i,n;if(_(t))return t.stopPropagation(),t.preventDefault(),null===(n=null===(i=e.closest("tr"))||void 0===i?void 0:i.querySelector(".col-action-inline-edit [name='inline_add[submit]']"))||void 0===n?void 0:n.click()})}),e.el.querySelectorAll("[data-datagrid-cancel-inline-add]").forEach(e=>{e.addEventListener("mouseup",t=>{if(0===t.button){t.stopPropagation(),t.preventDefault();const i=e.closest(".datagrid-row-inline-add");i&&i.classList.add("datagrid-row-inline-add-hidden")}})})}}),!0}}class ht{onDatagridInit(e){return e.el.querySelectorAll("[data-toggle-detail-grid]").forEach(t=>{if(t.getAttribute("data-toggle-detail-grid")!==e.name)return;const i=t.getAttribute("data-toggle-detail");t.addEventListener("click",n=>{const r=e.el.querySelector(`.item-detail-${e.name}-id-${i}`);t.closest("tr"),r&&(r.classList.add("datagrid--content-row"),r.classList.toggle("is-active")),e.ajax.addEventListener("before",t=>{t.detail.params.url.includes(`do=${e.name}-getItemDetail`)&&t.detail.params.url.includes(`grid-id=${i}`)&&(t.stopPropagation(),t.preventDefault())})})}),e.ajax.addEventListener("success",({detail:{payload:t}})=>{var i;t._datagrid_redraw_item_id&&t._datagrid_redraw_item_class&&(null===(i=e.el.querySelector(`tr[data-id='${t._datagrid_redraw_item_id}']`))||void 0===i||i.setAttribute("class",t._datagrid_redraw_item_class))}),!0}}class pt{onDatagridInit(e){return e.ajax.addEventListener("before",e=>{}),e.ajax.addEventListener("success",({detail:{payload:e}})=>{var t,i;if(e._datagrid_tree){const n=e._datagrid_tree,r=document.querySelector(`.datagrid-tree-item[data-id="${n}"]`),s=document.querySelector(`.datagrid-tree-item[data-id="${n}"] .datagrid-tree-item-children`);if(s){if(s.classList.contains("showed")){if(s.innerHTML="",s.classList.remove("showed"),r){const e=r.querySelector("a.chevron");e&&(e.style.transform="rotate(0deg)")}return}if(s.classList.add("showed"),r){const e=r.querySelector("a.chevron");e&&(e.style.transform="rotate(90deg)")}const n=e.snippets;for(const e in n){const r=n[e],o=(new DOMParser).parseFromString(r,"text/html").querySelector("[data-id]"),a=null!==(t=null==o?void 0:o.getAttribute("data-id"))&&void 0!==t?t:"",l=`\n<div class="datagrid-tree-item" class='${null!==(i=null==o?void 0:o.hasAttribute("data-has-children"))&&void 0!==i&&i?"has-children":""}' id="${e}" data-id="${a}">${r}</div>`;s.innerHTML=l}}}}),!0}}
8
8
  /**!
9
9
  * Sortable 1.15.6
10
10
  * @author RubaXa <trash@rubaxa.org>
11
11
  * @author owenm <owen23355@gmail.com>
12
12
  * @license MIT
13
- */function fe(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ge(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?fe(Object(i),!0).forEach((function(e){ve(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):fe(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function ve(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function be(){return be=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},be.apply(this,arguments)}function ye(t,e){if(null==t)return{};var i,n,r=function(t,e){if(null==t)return{};var i,n,r={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function _e(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var we=_e(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ee=_e(/Edge/i),Ae=_e(/firefox/i),ke=_e(/safari/i)&&!_e(/chrome/i)&&!_e(/android/i),Se=_e(/iP(ad|od|hone)/i),Ce=_e(/chrome/i)&&_e(/android/i),Oe={capture:!1,passive:!1};function De(t,e,i){t.addEventListener(e,i,!we&&Oe)}function xe(t,e,i){t.removeEventListener(e,i,!we&&Oe)}function Te(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Le(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Ie(t,e,i,n){if(t){i=i||document;do{if(null!=e&&(">"===e[0]?t.parentNode===i&&Te(t,e):Te(t,e))||n&&t===i)return t;if(t===i)break}while(t=Le(t))}return null}var Fe,Me=/\s+/g;function Ne(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(Me," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(Me," ")}}function je(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||-1!==e.indexOf("webkit")||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function Pe(t,e){var i="";if("string"==typeof t)i=t;else do{var n=je(t,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function $e(t,e,i){if(t){var n=t.getElementsByTagName(e),r=0,s=n.length;if(i)for(;r<s;r++)i(n[r],r);return n}return[]}function He(){var t=document.scrollingElement;return t||document.documentElement}function qe(t,e,i,n,r){if(t.getBoundingClientRect||t===window){var s,o,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==He()?(o=(s=t.getBoundingClientRect()).top,a=s.left,l=s.bottom,c=s.right,d=s.height,u=s.width):(o=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||i)&&t!==window&&(r=r||t.parentNode,!we))do{if(r&&r.getBoundingClientRect&&("none"!==je(r,"transform")||i&&"static"!==je(r,"position"))){var h=r.getBoundingClientRect();o-=h.top+parseInt(je(r,"border-top-width")),a-=h.left+parseInt(je(r,"border-left-width")),l=o+s.height,c=a+s.width;break}}while(r=r.parentNode);if(n&&t!==window){var p=Pe(r||t),f=p&&p.a,g=p&&p.d;p&&(l=(o/=g)+(d/=g),c=(a/=f)+(u/=f))}return{top:o,left:a,bottom:l,right:c,width:u,height:d}}}function Re(t,e,i){for(var n=Ye(t,!0),r=qe(t)[e];n;){if(!(r>=qe(n)[i]))return n;if(n===He())break;n=Ye(n,!1)}return!1}function Be(t,e,i,n){for(var r=0,s=0,o=t.children;s<o.length;){if("none"!==o[s].style.display&&o[s]!==Qi.ghost&&(n||o[s]!==Qi.dragged)&&Ie(o[s],i.draggable,t,!1)){if(r===e)return o[s];r++}s++}return null}function Ve(t,e){for(var i=t.lastElementChild;i&&(i===Qi.ghost||"none"===je(i,"display")||e&&!Te(i,e));)i=i.previousElementSibling;return i||null}function ze(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Qi.clone||e&&!Te(t,e)||i++;return i}function We(t){var e=0,i=0,n=He();if(t)do{var r=Pe(t),s=r.a,o=r.d;e+=t.scrollLeft*s,i+=t.scrollTop*o}while(t!==n&&(t=t.parentNode));return[e,i]}function Ye(t,e){if(!t||!t.getBoundingClientRect)return He();var i=t,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var r=je(i);if(i.clientWidth<i.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!i.getBoundingClientRect||i===document.body)return He();if(n||e)return i;n=!0}}}while(i=i.parentNode);return He()}function Ke(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Ue(t,e){return function(){if(!Fe){var i=arguments;1===i.length?t.call(this,i[0]):t.apply(this,i),Fe=setTimeout((function(){Fe=void 0}),e)}}}function Xe(t,e,i){t.scrollLeft+=e,t.scrollTop+=i}function Qe(t){var e=window.Polymer,i=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):i?i(t).clone(!0)[0]:t.cloneNode(!0)}function Ge(t,e,i){var n={};return Array.from(t.children).forEach((function(r){var s,o,a,l;if(Ie(r,e.draggable,t,!1)&&!r.animated&&r!==i){var c=qe(r);n.left=Math.min(null!==(s=n.left)&&void 0!==s?s:1/0,c.left),n.top=Math.min(null!==(o=n.top)&&void 0!==o?o:1/0,c.top),n.right=Math.max(null!==(a=n.right)&&void 0!==a?a:-1/0,c.right),n.bottom=Math.max(null!==(l=n.bottom)&&void 0!==l?l:-1/0,c.bottom)}})),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Je="Sortable"+(new Date).getTime();function Ze(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==je(t,"display")&&t!==Qi.ghost){e.push({target:t,rect:qe(t)});var i=ge({},e[e.length-1].rect);if(t.thisAnimationDuration){var n=Pe(t,!0);n&&(i.top-=n.f,i.left-=n.e)}t.fromRect=i}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var i in t)if(t.hasOwnProperty(i))for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[i][n])return Number(i);return-1}(e,{target:t}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof i&&i());var r=!1,s=0;e.forEach((function(t){var e=0,i=t.target,o=i.fromRect,a=qe(i),l=i.prevFromRect,c=i.prevToRect,d=t.rect,u=Pe(i,!0);u&&(a.top-=u.f,a.left-=u.e),i.toRect=a,i.thisAnimationDuration&&Ke(l,a)&&!Ke(o,a)&&(d.top-a.top)/(d.left-a.left)===(o.top-a.top)/(o.left-a.left)&&(e=function(t,e,i,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-i.top,2)+Math.pow(e.left-i.left,2))*n.animation}(d,l,c,n.options)),Ke(a,o)||(i.prevFromRect=o,i.prevToRect=a,e||(e=n.options.animation),n.animate(i,d,a,e)),e&&(r=!0,s=Math.max(s,e),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),e),i.thisAnimationDuration=e)})),clearTimeout(t),r?t=setTimeout((function(){"function"==typeof i&&i()}),s):"function"==typeof i&&i(),e=[]},animate:function(t,e,i,n){if(n){je(t,"transition",""),je(t,"transform","");var r=Pe(this.el),s=r&&r.a,o=r&&r.d,a=(e.left-i.left)/(s||1),l=(e.top-i.top)/(o||1);t.animatingX=!!a,t.animatingY=!!l,je(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),je(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),je(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){je(t,"transition",""),je(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),n)}}}}var ti=[],ei={initializeByDefault:!0},ii={mount:function(t){for(var e in ei)ei.hasOwnProperty(e)&&!(e in t)&&(t[e]=ei[e]);ti.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),ti.push(t)},pluginEvent:function(t,e,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var r=t+"Global";ti.forEach((function(n){e[n.pluginName]&&(e[n.pluginName][r]&&e[n.pluginName][r](ge({sortable:e},i)),e.options[n.pluginName]&&e[n.pluginName][t]&&e[n.pluginName][t](ge({sortable:e},i)))}))},initializePlugins:function(t,e,i,n){for(var r in ti.forEach((function(n){var r=n.pluginName;if(t.options[r]||n.initializeByDefault){var s=new n(t,e,t.options);s.sortable=t,s.options=t.options,t[r]=s,be(i,s.defaults)}})),t.options)if(t.options.hasOwnProperty(r)){var s=this.modifyOption(t,r,t.options[r]);void 0!==s&&(t.options[r]=s)}},getEventProperties:function(t,e){var i={};return ti.forEach((function(n){"function"==typeof n.eventProperties&&be(i,n.eventProperties.call(e[n.pluginName],t))})),i},modifyOption:function(t,e,i){var n;return ti.forEach((function(r){t[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[e]&&(n=r.optionListeners[e].call(t[r.pluginName],i))})),n}};var ni=["evt"],ri=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=ye(i,ni);ii.pluginEvent.bind(Qi)(t,e,ge({dragEl:oi,parentEl:ai,ghostEl:li,rootEl:ci,nextEl:di,lastDownEl:ui,cloneEl:hi,cloneHidden:pi,dragStarted:Ci,putSortable:yi,activeSortable:Qi.active,originalEvent:n,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi,hideGhostForTarget:Yi,unhideGhostForTarget:Ki,cloneNowHidden:function(){pi=!0},cloneNowShown:function(){pi=!1},dispatchSortableEvent:function(t){si({sortable:e,name:t,originalEvent:n})}},r))};function si(t){!function(t){var e=t.sortable,i=t.rootEl,n=t.name,r=t.targetEl,s=t.cloneEl,o=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||i&&i[Je]){var g,m=e.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||we||Ee?(g=document.createEvent("Event")).initEvent(n,!0,!0):g=new CustomEvent(n,{bubbles:!0,cancelable:!0}),g.to=o||i,g.from=a||i,g.item=r||i,g.clone=s,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=u,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var b=ge(ge({},f),ii.getEventProperties(n,e));for(var y in b)g[y]=b[y];i&&i.dispatchEvent(g),m[v]&&m[v].call(e,g)}}(ge({putSortable:yi,cloneEl:hi,targetEl:oi,rootEl:ci,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi},t))}var oi,ai,li,ci,di,ui,hi,pi,fi,gi,mi,vi,bi,yi,_i,wi,Ei,Ai,ki,Si,Ci,Oi,Di,xi,Ti,Li=!1,Ii=!1,Fi=[],Mi=!1,Ni=!1,ji=[],Pi=!1,$i=[],Hi="undefined"!=typeof document,qi=Se,Ri=Ee||we?"cssFloat":"float",Bi=Hi&&!Ce&&!Se&&"draggable"in document.createElement("div"),Vi=function(){if(Hi){if(we)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),zi=function(t,e){var i=je(t),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Be(t,0,e),s=Be(t,1,e),o=r&&je(r),a=s&&je(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+qe(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qe(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var d="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[Ri]||s&&"none"===i[Ri]&&l+c>n)?"vertical":"horizontal"},Wi=function(t){function e(t,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==t&&(i||a))return!0;if(null==t||!1===t)return!1;if(i&&"clone"===t)return t;if("function"==typeof t)return e(t(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var i={},n=t.group;n&&"object"==me(n)||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i},Yi=function(){!Vi&&li&&je(li,"display","none")},Ki=function(){!Vi&&li&&je(li,"display","")};Hi&&!Ce&&document.addEventListener("click",(function(t){if(Ii)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ii=!1,!1}),!0);var Ui=function(t){if(oi){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,s=t.clientY,Fi.some((function(t){var e=t[Je].options.emptyInsertThreshold;if(e&&!Ve(t)){var i=qe(t),n=r>=i.left-e&&r<=i.right+e,a=s>=i.top-e&&s<=i.bottom+e;return n&&a?o=t:void 0}})),o);if(e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[Je]._onDragOver(i)}}var r,s,o},Xi=function(t){oi&&oi.parentNode[Je]._isOutsideThisEl(t.target)};function Qi(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=be({},e),t[Je]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zi(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Qi.supportPointer&&"PointerEvent"in window&&(!ke||Se),emptyInsertThreshold:5};for(var n in ii.initializePlugins(this,t,i),i)!(n in e)&&(e[n]=i[n]);for(var r in Wi(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Bi,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?De(t,"pointerdown",this._onTapStart):(De(t,"mousedown",this._onTapStart),De(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(De(t,"dragover",this),De(t,"dragenter",this)),Fi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),be(this,Ze())}function Gi(t,e,i,n,r,s,o,a){var l,c,d=t[Je],u=d.options.onMove;return!window.CustomEvent||we||Ee?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=i,l.draggedRect=n,l.related=r||e,l.relatedRect=s||qe(e),l.willInsertAfter=a,l.originalEvent=o,t.dispatchEvent(l),u&&(c=u.call(d,l,o)),c}function Ji(t){t.draggable=!1}function Zi(){Pi=!1}function tn(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function en(t){return setTimeout(t,0)}function nn(t){return clearTimeout(t)}Qi.prototype={constructor:Qi,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Oi=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,oi):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,n=this.options,r=n.preventOnFilter,s=t.type,o=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(o||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=n.filter;if(function(t){$i.length=0;var e=t.getElementsByTagName("input"),i=e.length;for(;i--;){var n=e[i];n.checked&&$i.push(n)}}(i),!oi&&!(/mousedown|pointerdown/.test(s)&&0!==t.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!ke||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Ie(a,n.draggable,i,!1))&&a.animated||ui===a)){if(fi=ze(a),mi=ze(a,n.draggable),"function"==typeof c){if(c.call(this,t,a,this))return si({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),ri("filter",e,{evt:t}),void(r&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(n){if(n=Ie(l,n.trim(),i,!1))return si({sortable:e,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),ri("filter",e,{evt:t}),!0}))))return void(r&&t.preventDefault());n.handle&&!Ie(l,n.handle,i,!1)||this._prepareDragStart(t,o,a)}}},_prepareDragStart:function(t,e,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!oi&&i.parentNode===s){var l=qe(i);if(ci=s,ai=(oi=i).parentNode,di=oi.nextSibling,ui=i,bi=o.group,Qi.dragged=oi,_i={target:oi,clientX:(e||t).clientX,clientY:(e||t).clientY},ki=_i.clientX-l.left,Si=_i.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,oi.style["will-change"]="all",n=function(){ri("delayEnded",r,{evt:t}),Qi.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!Ae&&r.nativeDraggable&&(oi.draggable=!0),r._triggerDragStart(t,e),si({sortable:r,name:"choose",originalEvent:t}),Ne(oi,o.chosenClass,!0))},o.ignore.split(",").forEach((function(t){$e(oi,t.trim(),Ji)})),De(a,"dragover",Ui),De(a,"mousemove",Ui),De(a,"touchmove",Ui),o.supportPointer?(De(a,"pointerup",r._onDrop),!this.nativeDraggable&&De(a,"pointercancel",r._onDrop)):(De(a,"mouseup",r._onDrop),De(a,"touchend",r._onDrop),De(a,"touchcancel",r._onDrop)),Ae&&this.nativeDraggable&&(this.options.touchStartThreshold=4,oi.draggable=!0),ri("delayStart",this,{evt:t}),!o.delay||o.delayOnTouchOnly&&!e||this.nativeDraggable&&(Ee||we))n();else{if(Qi.eventCanceled)return void this._onDrop();o.supportPointer?(De(a,"pointerup",r._disableDelayedDrag),De(a,"pointercancel",r._disableDelayedDrag)):(De(a,"mouseup",r._disableDelayedDrag),De(a,"touchend",r._disableDelayedDrag),De(a,"touchcancel",r._disableDelayedDrag)),De(a,"mousemove",r._delayedDragTouchMoveHandler),De(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&De(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){oi&&Ji(oi),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;xe(t,"mouseup",this._disableDelayedDrag),xe(t,"touchend",this._disableDelayedDrag),xe(t,"touchcancel",this._disableDelayedDrag),xe(t,"pointerup",this._disableDelayedDrag),xe(t,"pointercancel",this._disableDelayedDrag),xe(t,"mousemove",this._delayedDragTouchMoveHandler),xe(t,"touchmove",this._delayedDragTouchMoveHandler),xe(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?De(document,"pointermove",this._onTouchMove):De(document,e?"touchmove":"mousemove",this._onTouchMove):(De(oi,"dragend",this),De(ci,"dragstart",this._onDragStart));try{document.selection?en((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Li=!1,ci&&oi){ri("dragStarted",this,{evt:e}),this.nativeDraggable&&De(document,"dragover",Xi);var i=this.options;!t&&Ne(oi,i.dragClass,!1),Ne(oi,i.ghostClass,!0),Qi.active=this,t&&this._appendGhost(),si({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(wi){this._lastX=wi.clientX,this._lastY=wi.clientY,Yi();for(var t=document.elementFromPoint(wi.clientX,wi.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(wi.clientX,wi.clientY))!==e;)e=t;if(oi.parentNode[Je]._isOutsideThisEl(t),e)do{if(e[Je]){if(e[Je]._onDragOver({clientX:wi.clientX,clientY:wi.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=Le(e));Ki()}},_onTouchMove:function(t){if(_i){var e=this.options,i=e.fallbackTolerance,n=e.fallbackOffset,r=t.touches?t.touches[0]:t,s=li&&Pe(li,!0),o=li&&s&&s.a,a=li&&s&&s.d,l=qi&&Ti&&We(Ti),c=(r.clientX-_i.clientX+n.x)/(o||1)+(l?l[0]-ji[0]:0)/(o||1),d=(r.clientY-_i.clientY+n.y)/(a||1)+(l?l[1]-ji[1]:0)/(a||1);if(!Qi.active&&!Li){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(li){s?(s.e+=c-(Ei||0),s.f+=d-(Ai||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");je(li,"webkitTransform",u),je(li,"mozTransform",u),je(li,"msTransform",u),je(li,"transform",u),Ei=c,Ai=d,wi=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!li){var t=this.options.fallbackOnBody?document.body:ci,e=qe(oi,!0,qi,!0,t),i=this.options;if(qi){for(Ti=t;"static"===je(Ti,"position")&&"none"===je(Ti,"transform")&&Ti!==document;)Ti=Ti.parentNode;Ti!==document.body&&Ti!==document.documentElement?(Ti===document&&(Ti=He()),e.top+=Ti.scrollTop,e.left+=Ti.scrollLeft):Ti=He(),ji=We(Ti)}Ne(li=oi.cloneNode(!0),i.ghostClass,!1),Ne(li,i.fallbackClass,!0),Ne(li,i.dragClass,!0),je(li,"transition",""),je(li,"transform",""),je(li,"box-sizing","border-box"),je(li,"margin",0),je(li,"top",e.top),je(li,"left",e.left),je(li,"width",e.width),je(li,"height",e.height),je(li,"opacity","0.8"),je(li,"position",qi?"absolute":"fixed"),je(li,"zIndex","100000"),je(li,"pointerEvents","none"),Qi.ghost=li,t.appendChild(li),je(li,"transform-origin",ki/parseInt(li.style.width)*100+"% "+Si/parseInt(li.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,n=t.dataTransfer,r=i.options;ri("dragStart",this,{evt:t}),Qi.eventCanceled?this._onDrop():(ri("setupClone",this),Qi.eventCanceled||((hi=Qe(oi)).removeAttribute("id"),hi.draggable=!1,hi.style["will-change"]="",this._hideClone(),Ne(hi,this.options.chosenClass,!1),Qi.clone=hi),i.cloneId=en((function(){ri("clone",i),Qi.eventCanceled||(i.options.removeCloneOnHide||ci.insertBefore(hi,oi),i._hideClone(),si({sortable:i,name:"clone"}))})),!e&&Ne(oi,r.dragClass,!0),e?(Ii=!0,i._loopId=setInterval(i._emulateDragOver,50)):(xe(document,"mouseup",i._onDrop),xe(document,"touchend",i._onDrop),xe(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",r.setData&&r.setData.call(i,n,oi)),De(document,"drop",i),je(oi,"transform","translateZ(0)")),Li=!0,i._dragStartId=en(i._dragStarted.bind(i,e,t)),De(document,"selectstart",i),Ci=!0,window.getSelection().removeAllRanges(),ke&&je(document.body,"user-select","none"))},_onDragOver:function(t){var e,i,n,r,s=this.el,o=t.target,a=this.options,l=a.group,c=Qi.active,d=bi===l,u=a.sort,h=yi||c,p=this,f=!1;if(!Pi){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),o=Ie(o,a.draggable,s,!0),x("dragOver"),Qi.eventCanceled)return f;if(oi.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return L(!1);if(Ii=!1,c&&!a.disabled&&(d?u||(n=ai!==ci):yi===this||(this.lastPutMode=bi.checkPull(this,c,oi,t))&&l.checkPut(this,c,oi,t))){if(r="vertical"===this._getDirection(t,o),e=qe(oi),x("dragOverValid"),Qi.eventCanceled)return f;if(n)return ai=ci,T(),this._hideClone(),x("revert"),Qi.eventCanceled||(di?ci.insertBefore(oi,di):ci.appendChild(oi)),L(!0);var g=Ve(s,a.draggable);if(!g||function(t,e,i){var n=qe(Ve(i.el,i.options.draggable)),r=Ge(i.el,i.options,li),s=10;return e?t.clientX>r.right+s||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>r.bottom+s||t.clientX>n.right&&t.clientY>n.top}(t,r,this)&&!g.animated){if(g===oi)return L(!1);if(g&&s===t.target&&(o=g),o&&(i=qe(o)),!1!==Gi(ci,s,oi,e,o,i,t,!!o))return T(),g&&g.nextSibling?s.insertBefore(oi,g.nextSibling):s.appendChild(oi),ai=s,I(),L(!0)}else if(g&&function(t,e,i){var n=qe(Be(i.el,0,i.options,!0)),r=Ge(i.el,i.options,li),s=10;return e?t.clientX<r.left-s||t.clientY<n.top&&t.clientX<n.right:t.clientY<r.top-s||t.clientY<n.bottom&&t.clientX<n.left}(t,r,this)){var m=Be(s,0,a,!0);if(m===oi)return L(!1);if(i=qe(o=m),!1!==Gi(ci,s,oi,e,o,i,t,!1))return T(),s.insertBefore(oi,m),ai=s,I(),L(!0)}else if(o.parentNode===s){i=qe(o);var v,b,y,_=oi.parentNode!==s,w=!function(t,e,i){var n=i?t.left:t.top,r=i?t.right:t.bottom,s=i?t.width:t.height,o=i?e.left:e.top,a=i?e.right:e.bottom,l=i?e.width:e.height;return n===o||r===a||n+s/2===o+l/2}(oi.animated&&oi.toRect||e,o.animated&&o.toRect||i,r),E=r?"top":"left",A=Re(o,"top","top")||Re(oi,"top","top"),k=A?A.scrollTop:void 0;if(Oi!==o&&(b=i[E],Mi=!1,Ni=!w&&a.invertSwap||_),v=function(t,e,i,n,r,s,o,a){var l=n?t.clientY:t.clientX,c=n?i.height:i.width,d=n?i.top:i.left,u=n?i.bottom:i.right,h=!1;if(!o)if(a&&xi<c*r){if(!Mi&&(1===Di?l>d+c*s/2:l<u-c*s/2)&&(Mi=!0),Mi)h=!0;else if(1===Di?l<d+xi:l>u-xi)return-Di}else if(l>d+c*(1-r)/2&&l<u-c*(1-r)/2)return function(t){return ze(oi)<ze(t)?1:-1}(e);if((h=h||o)&&(l<d+c*s/2||l>u-c*s/2))return l>d+c/2?1:-1;return 0}(t,o,i,r,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Ni,Oi===o),0!==v){var S=ze(oi);do{S-=v,y=ai.children[S]}while(y&&("none"===je(y,"display")||y===li))}if(0===v||y===o)return L(!1);Oi=o,Di=v;var C=o.nextElementSibling,O=!1,D=Gi(ci,s,oi,e,o,i,t,O=1===v);if(!1!==D)return 1!==D&&-1!==D||(O=1===D),Pi=!0,setTimeout(Zi,30),T(),O&&!C?s.appendChild(oi):o.parentNode.insertBefore(oi,O?C:o),A&&Xe(A,0,k-A.scrollTop),ai=oi.parentNode,void 0===b||Ni||(xi=Math.abs(b-qe(o)[E])),I(),L(!0)}if(s.contains(oi))return L(!1)}return!1}function x(a,l){ri(a,p,ge({evt:t,isOwner:d,axis:r?"vertical":"horizontal",revert:n,dragRect:e,targetRect:i,canSort:u,fromSortable:h,target:o,completed:L,onMove:function(i,n){return Gi(ci,s,oi,e,i,qe(i),t,n)},changed:I},l))}function T(){x("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function L(e){return x("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(Ne(oi,yi?yi.options.ghostClass:c.options.ghostClass,!1),Ne(oi,a.ghostClass,!0)),yi!==p&&p!==Qi.active?yi=p:p===Qi.active&&yi&&(yi=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll((function(){x("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===oi&&!oi.animated||o===s&&!o.animated)&&(Oi=null),a.dragoverBubble||t.rootEl||o===document||(oi.parentNode[Je]._isOutsideThisEl(t.target),!e&&Ui(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function I(){gi=ze(oi),vi=ze(oi,a.draggable),si({sortable:p,name:"change",toEl:s,newIndex:gi,newDraggableIndex:vi,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){xe(document,"mousemove",this._onTouchMove),xe(document,"touchmove",this._onTouchMove),xe(document,"pointermove",this._onTouchMove),xe(document,"dragover",Ui),xe(document,"mousemove",Ui),xe(document,"touchmove",Ui)},_offUpEvents:function(){var t=this.el.ownerDocument;xe(t,"mouseup",this._onDrop),xe(t,"touchend",this._onDrop),xe(t,"pointerup",this._onDrop),xe(t,"pointercancel",this._onDrop),xe(t,"touchcancel",this._onDrop),xe(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;gi=ze(oi),vi=ze(oi,i.draggable),ri("drop",this,{evt:t}),ai=oi&&oi.parentNode,gi=ze(oi),vi=ze(oi,i.draggable),Qi.eventCanceled||(Li=!1,Ni=!1,Mi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),nn(this.cloneId),nn(this._dragStartId),this.nativeDraggable&&(xe(document,"drop",this),xe(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ke&&je(document.body,"user-select",""),je(oi,"transform",""),t&&(Ci&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),li&&li.parentNode&&li.parentNode.removeChild(li),(ci===ai||yi&&"clone"!==yi.lastPutMode)&&hi&&hi.parentNode&&hi.parentNode.removeChild(hi),oi&&(this.nativeDraggable&&xe(oi,"dragend",this),Ji(oi),oi.style["will-change"]="",Ci&&!Li&&Ne(oi,yi?yi.options.ghostClass:this.options.ghostClass,!1),Ne(oi,this.options.chosenClass,!1),si({sortable:this,name:"unchoose",toEl:ai,newIndex:null,newDraggableIndex:null,originalEvent:t}),ci!==ai?(gi>=0&&(si({rootEl:ai,name:"add",toEl:ai,fromEl:ci,originalEvent:t}),si({sortable:this,name:"remove",toEl:ai,originalEvent:t}),si({rootEl:ai,name:"sort",toEl:ai,fromEl:ci,originalEvent:t}),si({sortable:this,name:"sort",toEl:ai,originalEvent:t})),yi&&yi.save()):gi!==fi&&gi>=0&&(si({sortable:this,name:"update",toEl:ai,originalEvent:t}),si({sortable:this,name:"sort",toEl:ai,originalEvent:t})),Qi.active&&(null!=gi&&-1!==gi||(gi=fi,vi=mi),si({sortable:this,name:"end",toEl:ai,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){ri("nulling",this),ci=oi=ai=li=di=hi=ui=pi=_i=wi=Ci=gi=vi=fi=mi=Oi=Di=yi=bi=Qi.dragged=Qi.ghost=Qi.clone=Qi.active=null,$i.forEach((function(t){t.checked=!0})),$i.length=Ei=Ai=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":oi&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],i=this.el.children,n=0,r=i.length,s=this.options;n<r;n++)Ie(t=i[n],s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||tn(t));return e},sort:function(t,e){var i={},n=this.el;this.toArray().forEach((function(t,e){var r=n.children[e];Ie(r,this.options.draggable,n,!1)&&(i[t]=r)}),this),e&&this.captureAnimationState(),t.forEach((function(t){i[t]&&(n.removeChild(i[t]),n.appendChild(i[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return Ie(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];var n=ii.modifyOption(this,t,e);i[t]=void 0!==n?n:e,"group"===t&&Wi(i)},destroy:function(){ri("destroy",this);var t=this.el;t[Je]=null,xe(t,"mousedown",this._onTapStart),xe(t,"touchstart",this._onTapStart),xe(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(xe(t,"dragover",this),xe(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Fi.splice(Fi.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!pi){if(ri("hideClone",this),Qi.eventCanceled)return;je(hi,"display","none"),this.options.removeCloneOnHide&&hi.parentNode&&hi.parentNode.removeChild(hi),pi=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(pi){if(ri("showClone",this),Qi.eventCanceled)return;oi.parentNode!=ci||this.options.group.revertClone?di?ci.insertBefore(hi,di):ci.appendChild(hi):ci.insertBefore(hi,oi),this.options.group.revertClone&&this.animate(oi,hi),je(hi,"display",""),pi=!1}}else this._hideClone()}},Hi&&De(document,"touchmove",(function(t){(Qi.active||Li)&&t.cancelable&&t.preventDefault()})),Qi.utils={on:De,off:xe,css:je,find:$e,is:function(t,e){return!!Ie(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t},throttle:Ue,closest:Ie,toggleClass:Ne,clone:Qe,index:ze,nextTick:en,cancelNextTick:nn,detectDirection:zi,getChild:Be,expando:Je},Qi.get=function(t){return t[Je]},Qi.mount=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Qi.utils=ge(ge({},Qi.utils),t.utils)),ii.mount(t)}))},Qi.create=function(t,e){return new Qi(t,e)},Qi.version="1.15.6";var rn,sn,on,an,ln,cn,dn=[],un=!1;function hn(){dn.forEach((function(t){clearInterval(t.pid)})),dn=[]}function pn(){clearInterval(cn)}var fn=Ue((function(t,e,i,n){if(e.scroll){var r,s=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=He(),d=!1;sn!==i&&(sn=i,hn(),rn=e.scroll,r=e.scrollFn,!0===rn&&(rn=Ye(i,!0)));var u=0,h=rn;do{var p=h,f=qe(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,_=f.height,w=void 0,E=void 0,A=p.scrollWidth,k=p.scrollHeight,S=je(p),C=p.scrollLeft,O=p.scrollTop;p===c?(w=y<A&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),E=_<k&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(w=y<A&&("auto"===S.overflowX||"scroll"===S.overflowX),E=_<k&&("auto"===S.overflowY||"scroll"===S.overflowY));var D=w&&(Math.abs(b-s)<=a&&C+y<A)-(Math.abs(v-s)<=a&&!!C),x=E&&(Math.abs(m-o)<=a&&O+_<k)-(Math.abs(g-o)<=a&&!!O);if(!dn[u])for(var T=0;T<=u;T++)dn[T]||(dn[T]={});dn[u].vx==D&&dn[u].vy==x&&dn[u].el===p||(dn[u].el=p,dn[u].vx=D,dn[u].vy=x,clearInterval(dn[u].pid),0==D&&0==x||(d=!0,dn[u].pid=setInterval(function(){n&&0===this.layer&&Qi.active._onTouchMove(ln);var e=dn[this.layer].vy?dn[this.layer].vy*l:0,i=dn[this.layer].vx?dn[this.layer].vx*l:0;"function"==typeof r&&"continue"!==r.call(Qi.dragged.parentNode[Je],i,e,t,ln,dn[this.layer].el)||Xe(dn[this.layer].el,i,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=Ye(h,!1)));un=d}}),30),gn=function(t){var e=t.originalEvent,i=t.putSortable,n=t.dragEl,r=t.activeSortable,s=t.dispatchSortableEvent,o=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=i||r;o();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function mn(){}function vn(){}mn.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=Be(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(e,n):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:gn},be(mn,{pluginName:"revertOnSpill"}),vn.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:gn},be(vn,{pluginName:"removeOnSpill"}),Qi.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?De(document,"dragover",this._handleAutoScroll):this.options.supportPointer?De(document,"pointermove",this._handleFallbackAutoScroll):e.touches?De(document,"touchmove",this._handleFallbackAutoScroll):De(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?xe(document,"dragover",this._handleAutoScroll):(xe(document,"pointermove",this._handleFallbackAutoScroll),xe(document,"touchmove",this._handleFallbackAutoScroll),xe(document,"mousemove",this._handleFallbackAutoScroll)),pn(),hn(),clearTimeout(Fe),Fe=void 0},nulling:function(){ln=sn=rn=un=cn=on=an=null,dn.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var i=this,n=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(n,r);if(ln=t,e||this.options.forceAutoScrollFallback||Ee||we||ke){fn(t,this.options,s,e);var o=Ye(s,!0);!un||cn&&n===on&&r===an||(cn&&pn(),cn=setInterval((function(){var s=Ye(document.elementFromPoint(n,r),!0);s!==o&&(o=s,hn()),fn(t,i.options,s,e)}),10),on=n,an=r)}else{if(!this.options.bubbleScroll||Ye(s,!0)===He())return void hn();fn(t,this.options,Ye(s,!1),!1)}}},be(t,{pluginName:"scroll",initializeByDefault:!0})}),Qi.mount(vn,mn);class bn{initSortable(t){const e=t.el.querySelector("[data-sortable]");e&&new Qi(e,{handle:".handle-sort",draggable:"tr",sort:!0,direction:"vertical",async onEnd({item:e}){var i,n,r,s,o,a;const l=e.getAttribute("data-id");if(l){const c=null!==(n=null===(i=e.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-id"))&&void 0!==n?n:null,d=null!==(s=null===(r=e.nextElementSibling)||void 0===r?void 0:r.getAttribute("data-id"))&&void 0!==s?s:null,u=t.el.querySelector("tbody");if(u){let e=null!==(o=u.getAttribute("data-sortable-parent-path"))&&void 0!==o?o:"";e.length&&(e=`${e}-`);const i=null!==(a=u.getAttribute("data-sortable-url"))&&void 0!==a?a:"?do=sort",n={[`${e}item_id`]:l,...c?{[`${e}prev_id`]:c}:{},...d?{[`${e}next_id`]:d}:{}};return await t.ajax.request({method:"GET",url:i,data:n})}}}})}initSortableTree(t){t.el.querySelectorAll(".datagrid-tree-item-children").forEach((t=>{new Qi(t,{handle:".handle-sort",draggable:".datagrid-tree-item:not(.datagrid-tree-header)",async onEnd({item:t}){}})}))}}class yn{constructor(t,e={}){this.select=t,this.opts=e}initSelectpickers(t){var e,i,n;const r=null!==(n=null!==(e=this.select)&&void 0!==e?e:null===(i=E())||void 0===i?void 0:i.TomSelect)&&void 0!==n?n:null;if(r)for(const e of t)e.tomselect||new r(e,"function"==typeof this.opts?this.opts(e):this.opts)}}function _n(t){return t[t.length-1]}function wn(t,...e){return e.forEach((e=>{t.includes(e)||t.push(e)})),t}function En(t,e){return t?t.split(e):[]}function An(t,e,i){return(void 0===e||t>=e)&&(void 0===i||t<=i)}function kn(t,e,i){return t<e?e:t>i?i:t}function Sn(t,e,i={},n=0,r=""){r+=`<${Object.keys(i).reduce(((t,e)=>{let r=i[e];return"function"==typeof r&&(r=r(n)),`${t} ${e}="${r}"`}),t)}></${t}>`;const s=n+1;return s<e?Sn(t,e,i,s,r):r}function Cn(t){return t.replace(/>\s+/g,">").replace(/\s+</,"<")}function On(t){return new Date(t).setHours(0,0,0,0)}function Dn(){return(new Date).setHours(0,0,0,0)}function xn(...t){switch(t.length){case 0:return Dn();case 1:return On(t[0])}const e=new Date(0);return e.setFullYear(...t),e.setHours(0,0,0,0)}function Tn(t,e){const i=new Date(t);return i.setDate(i.getDate()+e)}function Ln(t,e){const i=new Date(t),n=i.getMonth()+e;let r=n%12;r<0&&(r+=12);const s=i.setMonth(n);return i.getMonth()!==r?i.setDate(0):s}function In(t,e){const i=new Date(t),n=i.getMonth(),r=i.setFullYear(i.getFullYear()+e);return 1===n&&2===i.getMonth()?i.setDate(0):r}function Fn(t,e){return(t-e+7)%7}function Mn(t,e,i=0){const n=new Date(t).getDay();return Tn(t,Fn(e,i)-Fn(n,i))}function Nn(t,e){return Math.round((t-e)/6048e5)+1}function jn(t){const e=Mn(t,4,1);return Nn(e,Mn(new Date(e).setMonth(0,4),4,1))}function Pn(t,e){const i=Mn(new Date(t).setMonth(0,1),e,e),n=Mn(t,e,e),r=Nn(n,i);if(r<53)return r;return n===Mn(new Date(t).setDate(32),e,e)?1:r}function $n(t){return Pn(t,0)}function Hn(t){return Pn(t,6)}function qn(t,e){const i=new Date(t).getFullYear();return Math.floor(i/e)*e}function Rn(t,e,i){if(1!==e&&2!==e)return t;const n=new Date(t);return 1===e?i?n.setMonth(n.getMonth()+1,0):n.setDate(1):i?n.setFullYear(n.getFullYear()+1,0,0):n.setMonth(0,1),n.setHours(0,0,0,0)}const Bn=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,Vn=/[\s!-/:-@[-`{-~年月日]+/;let zn={};const Wn={y:(t,e)=>new Date(t).setFullYear(parseInt(e,10)),m(t,e,i){const n=new Date(t);let r=parseInt(e,10)-1;if(isNaN(r)){if(!e)return NaN;const t=e.toLowerCase(),n=e=>e.toLowerCase().startsWith(t);if(r=i.monthsShort.findIndex(n),r<0&&(r=i.months.findIndex(n)),r<0)return NaN}return n.setMonth(r),n.getMonth()!==Kn(r)?n.setDate(0):n.getTime()},d:(t,e)=>new Date(t).setDate(parseInt(e,10))},Yn={d:t=>t.getDate(),dd:t=>Un(t.getDate(),2),D:(t,e)=>e.daysShort[t.getDay()],DD:(t,e)=>e.days[t.getDay()],m:t=>t.getMonth()+1,mm:t=>Un(t.getMonth()+1,2),M:(t,e)=>e.monthsShort[t.getMonth()],MM:(t,e)=>e.months[t.getMonth()],y:t=>t.getFullYear(),yy:t=>Un(t.getFullYear(),2).slice(-2),yyyy:t=>Un(t.getFullYear(),4)};function Kn(t){return t>-1?t%12:Kn(t+12)}function Un(t,e){return t.toString().padStart(e,"0")}function Xn(t){if("string"!=typeof t)throw new Error("Invalid date format.");if(t in zn)return zn[t];const e=t.split(Bn),i=t.match(new RegExp(Bn,"g"));if(0===e.length||!i)throw new Error("Invalid date format.");const n=i.map((t=>Yn[t])),r=Object.keys(Wn).reduce(((t,e)=>(i.find((t=>"D"!==t[0]&&t[0].toLowerCase()===e))&&t.push(e),t)),[]);return zn[t]={parser(t,e){const n=t.split(Vn).reduce(((t,e,n)=>{if(e.length>0&&i[n]){const r=i[n][0];"M"===r?t.m=e:"D"!==r&&(t[r]=e)}return t}),{});return r.reduce(((t,i)=>{const r=Wn[i](t,n[i],e);return isNaN(r)?t:r}),Dn())},formatter(t,i){let r=n.reduce(((n,r,s)=>n+`${e[s]}${r(t,i)}`),"");return r+_n(e)}}}function Qn(t,e,i){if(t instanceof Date||"number"==typeof t){const e=On(t);return isNaN(e)?void 0:e}if(t){if("today"===t)return Dn();if(e&&e.toValue){const n=e.toValue(t,e,i);return isNaN(n)?void 0:On(n)}return Xn(e).parser(t,i)}}function Gn(t,e,i){if(isNaN(t)||!t&&0!==t)return"";const n="number"==typeof t?new Date(t):t;return e.toDisplay?e.toDisplay(n,e,i):Xn(e).formatter(n,i)}const Jn=document.createRange();function Zn(t){return Jn.createContextualFragment(t)}function tr(t){return t.parentElement||(t.parentNode instanceof ShadowRoot?t.parentNode.host:void 0)}function er(t){return t.getRootNode().activeElement===t}function ir(t){"none"!==t.style.display&&(t.style.display&&(t.dataset.styleDisplay=t.style.display),t.style.display="none")}function nr(t){"none"===t.style.display&&(t.dataset.styleDisplay?(t.style.display=t.dataset.styleDisplay,delete t.dataset.styleDisplay):t.style.display="")}function rr(t){t.firstChild&&(t.removeChild(t.firstChild),rr(t))}const sr=new WeakMap,{addEventListener:or,removeEventListener:ar}=EventTarget.prototype;function lr(t,e){let i=sr.get(t);i||(i=[],sr.set(t,i)),e.forEach((t=>{or.call(...t),i.push(t)}))}if(!Event.prototype.composedPath){const t=(e,i=[])=>{let n;return i.push(e),e.parentNode?n=e.parentNode:e.host?n=e.host:e.defaultView&&(n=e.defaultView),n?t(n,i):i};Event.prototype.composedPath=function(){return t(this.target)}}function cr(t,e,i){const[n,...r]=t;return e(n)?n:n!==i&&"HTML"!==n.tagName&&0!==r.length?cr(r,e,i):void 0}function dr(t,e){const i="function"==typeof e?e:t=>t instanceof Element&&t.matches(e);return cr(t.composedPath(),i,t.currentTarget)}var ur={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},hr={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:pr,format:fr,weekStart:gr}=hr;function mr(t,e){return t.length<6&&e>=0&&e<7?wn(t,e):t}function vr(t,e){switch(4===t?6===e?3:!e+1:t){case 1:return jn;case 2:return $n;case 3:return Hn}}function br(t,e,i){return e.weekStart=t,e.weekEnd=(t+6)%7,4===i&&(e.getWeekNumber=vr(4,t)),t}function yr(t,e,i,n){const r=Qn(t,e,i);return void 0!==r?r:n}function _r(t,e,i=3){const n=parseInt(t,10);return n>=0&&n<=i?n:e}function wr(t,e,i,n=void 0){e in t&&(i in t||(t[i]=n?n(t[e]):t[e]),delete t[e])}function Er(t,e){const i=Object.assign({},t),n={},r=e.constructor.locales,s=!!e.rangeSideIndex;let{datesDisabled:o,format:a,language:l,locale:c,maxDate:d,maxView:u,minDate:h,pickLevel:p,startView:f,weekNumbers:g,weekStart:m}=e.config||{};if(wr(i,"calendarWeeks","weekNumbers",(t=>t?1:0)),wr(i,"clearBtn","clearButton"),wr(i,"todayBtn","todayButton"),wr(i,"todayBtnMode","todayButtonMode"),i.language){let t;if(i.language!==l&&(r[i.language]?t=i.language:(t=i.language.split("-")[0],r[t]||(t=!1))),delete i.language,t){l=n.language=t;const e=c||r[pr];c=Object.assign({format:fr,weekStart:gr},r[pr]),l!==pr&&Object.assign(c,r[l]),n.locale=c,a===e.format&&(a=n.format=c.format),m===e.weekStart&&(m=br(c.weekStart,n,g))}}if(i.format){const t="function"==typeof i.format.toDisplay,e="function"==typeof i.format.toValue,r=Bn.test(i.format);(t&&e||r)&&(a=n.format=i.format),delete i.format}let v=p;"pickLevel"in i&&(v=_r(i.pickLevel,p,2),delete i.pickLevel),v!==p&&(v>p&&("minDate"in i||(i.minDate=h),"maxDate"in i||(i.maxDate=d)),o&&!i.datesDisabled&&(i.datesDisabled=[]),p=n.pickLevel=v);let b=h,y=d;if("minDate"in i){const t=xn(0,0,1);b=null===i.minDate?t:yr(i.minDate,a,c,b),b!==t&&(b=Rn(b,p,!1)),delete i.minDate}if("maxDate"in i&&(y=null===i.maxDate?void 0:yr(i.maxDate,a,c,y),void 0!==y&&(y=Rn(y,p,!0)),delete i.maxDate),y<b?(h=n.minDate=y,d=n.maxDate=b):(h!==b&&(h=n.minDate=b),d!==y&&(d=n.maxDate=y)),i.datesDisabled){const t=i.datesDisabled;if("function"==typeof t)n.datesDisabled=null,n.checkDisabled=(e,i)=>t(new Date(e),i,s);else{const e=n.datesDisabled=t.reduce(((t,e)=>{const i=Qn(e,a,c);return void 0!==i?wn(t,Rn(i,p,s)):t}),[]);n.checkDisabled=t=>e.includes(t)}delete i.datesDisabled}if("defaultViewDate"in i){const t=Qn(i.defaultViewDate,a,c);void 0!==t&&(n.defaultViewDate=t),delete i.defaultViewDate}if("weekStart"in i){const t=Number(i.weekStart)%7;isNaN(t)||(m=br(t,n,g)),delete i.weekStart}if(i.daysOfWeekDisabled&&(n.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(mr,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(n.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(mr,[]),delete i.daysOfWeekHighlighted),"weekNumbers"in i){let t=i.weekNumbers;if(t){const e="function"==typeof t?(e,i)=>t(new Date(e),i):vr(t=parseInt(t,10),m);e&&(g=n.weekNumbers=t,n.getWeekNumber=e)}else g=n.weekNumbers=0,n.getWeekNumber=null;delete i.weekNumbers}if("maxNumberOfDates"in i){const t=parseInt(i.maxNumberOfDates,10);t>=0&&(n.maxNumberOfDates=t,n.multidate=1!==t),delete i.maxNumberOfDates}i.dateDelimiter&&(n.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let _=u;"maxView"in i&&(_=_r(i.maxView,u),delete i.maxView),_=p>_?p:_,_!==u&&(u=n.maxView=_);let w=f;if("startView"in i&&(w=_r(i.startView,w),delete i.startView),w<p?w=p:w>u&&(w=u),w!==f&&(n.startView=w),i.prevArrow){const t=Zn(i.prevArrow);t.childNodes.length>0&&(n.prevArrow=t.childNodes),delete i.prevArrow}if(i.nextArrow){const t=Zn(i.nextArrow);t.childNodes.length>0&&(n.nextArrow=t.childNodes),delete i.nextArrow}if("disableTouchKeyboard"in i&&(n.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const t=i.orientation.toLowerCase().split(/\s+/g);n.orientation={x:t.find((t=>"left"===t||"right"===t))||"auto",y:t.find((t=>"top"===t||"bottom"===t))||"auto"},delete i.orientation}if("todayButtonMode"in i){switch(i.todayButtonMode){case 0:case 1:n.todayButtonMode=i.todayButtonMode}delete i.todayButtonMode}return Object.entries(i).forEach((([t,e])=>{void 0!==e&&t in hr&&(n[t]=e)})),n}const Ar={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};const kr=t=>t.map((t=>`<button type="button" class="%buttonClass% ${t}" tabindex="-1"></button>`)).join("");var Sr=Cn(`<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n ${kr(["prev-button prev-btn","view-switch","next-button next-btn"])}\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n ${kr(["today-button today-btn","clear-button clear-btn"])}\n </div>\n </div>\n </div>\n</div>`),Cr=Cn(`<div class="days">\n <div class="days-of-week">${Sn("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${Sn("span",42)}</div>\n</div>`),Or=Cn(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${Sn("span",6,{class:"week"})}</div>\n</div>`);class Dr{constructor(t,e){Object.assign(this,e,{picker:t,element:Zn('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!t.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(t){"pickLevel"in t&&(this.isMinView=this.id===t.pickLevel),this.setOptions(t),this.updateFocus(),this.updateSelection()}prepareForRender(t,e,i){this.disabled=[];const n=this.picker;n.setViewSwitchLabel(t),n.setPrevButtonDisabled(e),n.setNextButtonDisabled(i)}setDisabled(t,e){e.add("disabled"),wn(this.disabled,t)}performBeforeHook(t,e){let i=this.beforeShow(new Date(e));switch(typeof i){case"boolean":i={enabled:i};break;case"string":i={classes:i}}if(i){const n=t.classList;if(!1===i.enabled&&this.setDisabled(e,n),i.classes){const t=i.classes.split(/\s+/);n.add(...t),t.includes("disabled")&&this.setDisabled(e,n)}i.content&&function(t,e){rr(t),e instanceof DocumentFragment?t.appendChild(e):"string"==typeof e?t.appendChild(Zn(e)):"function"==typeof e.forEach&&e.forEach((e=>{t.appendChild(e)}))}(t,i.content)}}renderCell(t,e,i,n,{selected:r,range:s},o,a=[]){t.textContent=e,this.isMinView&&(t.dataset.date=n);const l=t.classList;if(t.className=`datepicker-cell ${this.cellClass}`,i<this.first?l.add("prev"):i>this.last&&l.add("next"),l.add(...a),(o||this.checkDisabled(n,this.id))&&this.setDisabled(n,l),s){const[t,e]=s;i>t&&i<e&&l.add("range"),i===t&&l.add("range-start"),i===e&&l.add("range-end")}r.includes(i)&&l.add("selected"),i===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(t,n)}refreshCell(t,e,i,[n,r]){const s=t.classList;s.remove("range","range-start","range-end","selected","focused"),e>n&&e<r&&s.add("range"),e===n&&s.add("range-start"),e===r&&s.add("range-end"),i.includes(e)&&s.add("selected"),e===this.focused&&s.add("focused")}changeFocusedCell(t){this.grid.querySelectorAll(".focused").forEach((t=>{t.classList.remove("focused")})),this.grid.children[t].classList.add("focused")}}class xr extends Dr{constructor(t){super(t,{id:0,name:"days",cellClass:"day"})}init(t,e=!0){if(e){const t=Zn(Cr).firstChild;this.dow=t.firstChild,this.grid=t.lastChild,this.element.appendChild(t)}super.init(t)}setOptions(t){let e;if("minDate"in t&&(this.minDate=t.minDate),"maxDate"in t&&(this.maxDate=t.maxDate),t.checkDisabled&&(this.checkDisabled=t.checkDisabled),t.daysOfWeekDisabled&&(this.daysOfWeekDisabled=t.daysOfWeekDisabled,e=!0),t.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=t.daysOfWeekHighlighted),"todayHighlight"in t&&(this.todayHighlight=t.todayHighlight),"weekStart"in t&&(this.weekStart=t.weekStart,this.weekEnd=t.weekEnd,e=!0),t.locale){const i=this.locale=t.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,e=!0}if("beforeShowDay"in t&&(this.beforeShow="function"==typeof t.beforeShowDay?t.beforeShowDay:void 0),"weekNumbers"in t)if(t.weekNumbers&&!this.weekNumbers){const t=Zn(Or).firstChild;this.weekNumbers={element:t,dow:t.firstChild,weeks:t.lastChild},this.element.insertBefore(t,this.element.firstChild)}else this.weekNumbers&&!t.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in t&&(this.getWeekNumber=t.getWeekNumber),"showDaysOfWeek"in t&&(t.showDaysOfWeek?(nr(this.dow),this.weekNumbers&&nr(this.weekNumbers.dow)):(ir(this.dow),this.weekNumbers&&ir(this.weekNumbers.dow))),e&&Array.from(this.dow.children).forEach(((t,e)=>{const i=(this.weekStart+e)%7;t.textContent=this.dayNames[i],t.className=this.daysOfWeekDisabled.includes(i)?"dow disabled":"dow"}))}updateFocus(){const t=new Date(this.picker.viewDate),e=t.getFullYear(),i=t.getMonth(),n=xn(e,i,1),r=Mn(n,this.weekStart,this.weekStart);this.first=n,this.last=xn(e,i+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t,e&&(this.range=e.dates)}render(){if(this.today=this.todayHighlight?Dn():void 0,this.prepareForRender(Gn(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const t=this.weekStart,e=Mn(this.first,t,t);Array.from(this.weekNumbers.weeks.children).forEach(((i,n)=>{const r=Tn(e,7*n);i.textContent=this.getWeekNumber(r,t),n>3&&i.classList[r>this.last?"add":"remove"]("next")}))}Array.from(this.grid.children).forEach(((t,e)=>{const i=Tn(this.start,e),n=new Date(i),r=n.getDay(),s=[];this.today===i&&s.push("today"),this.daysOfWeekHighlighted.includes(r)&&s.push("highlighted"),this.renderCell(t,n.getDate(),i,i,this,i<this.minDate||i>this.maxDate||this.daysOfWeekDisabled.includes(r),s)}))}refresh(){const t=this.range||[];Array.from(this.grid.children).forEach((e=>{this.refreshCell(e,Number(e.dataset.date),this.selected,t)}))}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function Tr(t,e){if(!t||!t[0]||!t[1])return;const[[i,n],[r,s]]=t;return i>e||r<e?void 0:[i===e?n:-1,r===e?s:12]}class Lr extends Dr{constructor(t){super(t,{id:1,name:"months",cellClass:"month"})}init(t,e=!0){e&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(Zn(Sn("span",12,{"data-month":t=>t}))),this.first=0,this.last=11),super.init(t)}setOptions(t){if(t.locale&&(this.monthNames=t.locale.monthsShort),"minDate"in t)if(void 0===t.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const e=new Date(t.minDate);this.minYear=e.getFullYear(),this.minMonth=e.getMonth(),this.minDate=e.setDate(1)}if("maxDate"in t)if(void 0===t.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const e=new Date(t.maxDate);this.maxYear=e.getFullYear(),this.maxMonth=e.getMonth(),this.maxDate=xn(this.maxYear,this.maxMonth+1,0)}t.checkDisabled&&(this.checkDisabled=this.isMinView||null===t.datesDisabled?t.checkDisabled:()=>!1),"beforeShowMonth"in t&&(this.beforeShow="function"==typeof t.beforeShowMonth?t.beforeShowMonth:void 0)}updateFocus(){const t=new Date(this.picker.viewDate);this.year=t.getFullYear(),this.focused=t.getMonth()}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t.reduce(((t,e)=>{const i=new Date(e),n=i.getFullYear(),r=i.getMonth();return void 0===t[n]?t[n]=[r]:wn(t[n],r),t}),{}),e&&e.dates&&(this.range=e.dates.map((t=>{const e=new Date(t);return isNaN(e)?void 0:[e.getFullYear(),e.getMonth()]})))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const t=this.selected[this.year]||[],e=this.year<this.minYear||this.year>this.maxYear,i=this.year===this.minYear,n=this.year===this.maxYear,r=Tr(this.range,this.year);Array.from(this.grid.children).forEach(((s,o)=>{const a=Rn(new Date(this.year,o,1),1,this.isRangeEnd);this.renderCell(s,this.monthNames[o],o,a,{selected:t,range:r},e||i&&o<this.minMonth||n&&o>this.maxMonth)}))}refresh(){const t=this.selected[this.year]||[],e=Tr(this.range,this.year)||[];Array.from(this.grid.children).forEach(((i,n)=>{this.refreshCell(i,n,t,e)}))}refreshFocus(){this.changeFocusedCell(this.focused)}}class Ir extends Dr{constructor(t,e){super(t,e)}init(t,e=!0){var i;e&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${i=this.cellClass,[...i].reduce(((t,e,i)=>t+(i?e:e.toUpperCase())),"")}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(Zn(Sn("span",12)))),super.init(t)}setOptions(t){if("minDate"in t&&(void 0===t.minDate?this.minYear=this.minDate=void 0:(this.minYear=qn(t.minDate,this.step),this.minDate=xn(this.minYear,0,1))),"maxDate"in t&&(void 0===t.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=qn(t.maxDate,this.step),this.maxDate=xn(this.maxYear,11,31))),t.checkDisabled&&(this.checkDisabled=this.isMinView||null===t.datesDisabled?t.checkDisabled:()=>!1),this.beforeShowOption in t){const e=t[this.beforeShowOption];this.beforeShow="function"==typeof e?e:void 0}}updateFocus(){const t=new Date(this.picker.viewDate),e=qn(t,this.navStep),i=e+9*this.step;this.first=e,this.last=i,this.start=e-this.step,this.focused=qn(t,this.step)}updateSelection(){const{dates:t,rangepicker:e}=this.picker.datepicker;this.selected=t.reduce(((t,e)=>wn(t,qn(e,this.step))),[]),e&&e.dates&&(this.range=e.dates.map((t=>{if(void 0!==t)return qn(t,this.step)})))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach(((t,e)=>{const i=this.start+e*this.step,n=Rn(new Date(i,0,1),2,this.isRangeEnd);t.dataset.year=i,this.renderCell(t,i,i,n,this,i<this.minYear||i>this.maxYear)}))}refresh(){const t=this.range||[];Array.from(this.grid.children).forEach((e=>{this.refreshCell(e,Number(e.textContent),this.selected,t)}))}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function Fr(t,e){const i={bubbles:!0,cancelable:!0,detail:{date:t.getDate(),viewDate:new Date(t.picker.viewDate),viewId:t.picker.currentView.id,datepicker:t}};t.element.dispatchEvent(new CustomEvent(e,i))}function Mr(t,e){const{config:i,picker:n}=t,{currentView:r,viewDate:s}=n;let o;switch(r.id){case 0:o=Ln(s,e);break;case 1:o=In(s,e);break;default:o=In(s,e*r.navStep)}o=kn(o,i.minDate,i.maxDate),n.changeFocus(o).render()}function Nr(t){const e=t.picker.currentView.id;e!==t.config.maxView&&t.picker.changeView(e+1).render()}function jr(t){t.setDate({clear:!0})}function Pr(t){const e=Dn();1===t.config.todayButtonMode?t.setDate(e,{forceRefresh:!0,viewDate:e}):t.setFocusedDate(e,!0)}function $r(t){const e=()=>{t.config.updateOnBlur?t.update({revert:!0}):t.refresh("input"),t.hide()},i=t.element;er(i)?i.addEventListener("blur",e,{once:!0}):e()}function Hr(t,e){const i=t.picker,n=new Date(i.viewDate),r=i.currentView.id,s=1===r?Ln(n,e-n.getMonth()):In(n,e-n.getFullYear());i.changeFocus(s).changeView(r-1).render()}function qr(t){Nr(t)}function Rr(t){Mr(t,-1)}function Br(t){Mr(t,1)}function Vr(t,e){const i=dr(e,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:n,isMinView:r}=t.picker.currentView,s=i.dataset;r?t.setDate(Number(s.date)):Hr(t,Number(1===n?s.month:s.year))}function zr(t){t.preventDefault()}const Wr=["left","top","right","bottom"].reduce(((t,e)=>(t[e]=`datepicker-orient-${e}`,t)),{}),Yr=t=>t?`${t}px`:t;function Kr(t,e){if("title"in e&&(e.title?(t.controls.title.textContent=e.title,nr(t.controls.title)):(t.controls.title.textContent="",ir(t.controls.title))),e.prevArrow){const i=t.controls.prevButton;rr(i),e.prevArrow.forEach((t=>{i.appendChild(t.cloneNode(!0))}))}if(e.nextArrow){const i=t.controls.nextButton;rr(i),e.nextArrow.forEach((t=>{i.appendChild(t.cloneNode(!0))}))}if(e.locale&&(t.controls.todayButton.textContent=e.locale.today,t.controls.clearButton.textContent=e.locale.clear),"todayButton"in e&&(e.todayButton?nr(t.controls.todayButton):ir(t.controls.todayButton)),"minDate"in e||"maxDate"in e){const{minDate:e,maxDate:i}=t.datepicker.config;t.controls.todayButton.disabled=!An(Dn(),e,i)}"clearButton"in e&&(e.clearButton?nr(t.controls.clearButton):ir(t.controls.clearButton))}function Ur(t){const{dates:e,config:i,rangeSideIndex:n}=t;return kn(e.length>0?_n(e):Rn(i.defaultViewDate,i.pickLevel,n),i.minDate,i.maxDate)}function Xr(t,e){"_oldViewDate"in t||e===t.viewDate||(t._oldViewDate=t.viewDate),t.viewDate=e;const{id:i,year:n,first:r,last:s}=t.currentView,o=new Date(e).getFullYear();switch(i){case 0:return e<r||e>s;case 1:return o!==n;default:return o<r||o>s}}function Qr(t){return window.getComputedStyle(t).direction}function Gr(t){const e=tr(t);if(e!==document.body&&e)return"visible"!==window.getComputedStyle(e).overflow?e:Gr(e)}class Jr{constructor(t){const{config:e,inputField:i}=this.datepicker=t,n=Sr.replace(/%buttonClass%/g,e.buttonClass),r=this.element=Zn(n).firstChild,[s,o,a]=r.firstChild.children,l=s.firstElementChild,[c,d,u]=s.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:d,nextButton:u,todayButton:h,clearButton:p};this.main=o,this.controls=f;const g=i?"dropdown":"inline";r.classList.add(`datepicker-${g}`),Kr(this,e),this.viewDate=Ur(t),lr(t,[[r,"mousedown",zr],[o,"click",Vr.bind(null,t)],[f.viewSwitch,"click",qr.bind(null,t)],[f.prevButton,"click",Rr.bind(null,t)],[f.nextButton,"click",Br.bind(null,t)],[f.todayButton,"click",Pr.bind(null,t)],[f.clearButton,"click",jr.bind(null,t)]]),this.views=[new xr(this),new Lr(this),new Ir(this,{id:2,name:"years",cellClass:"year",step:1}),new Ir(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[e.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),e.container?e.container.appendChild(this.element):i.after(this.element)}setOptions(t){Kr(this,t),this.views.forEach((e=>{e.init(t,!1)})),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:t,element:e}=this,i=t.inputField;if(i){const n=Qr(i);n!==Qr(tr(e))?e.dir=n:e.dir&&e.removeAttribute("dir"),this.place(),e.classList.add("active"),t.config.disableTouchKeyboard&&i.blur()}else e.classList.add("active");this.active=!0,Fr(t,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Fr(this.datepicker,"hide"))}place(){const{classList:t,style:e}=this.element;e.display="block";const{width:i,height:n}=this.element.getBoundingClientRect(),r=this.element.offsetParent;e.display="";const{config:s,inputField:o}=this.datepicker,{left:a,top:l,right:c,bottom:d,width:u,height:h}=o.getBoundingClientRect();let{x:p,y:f}=s.orientation,g=a,m=l;if(r!==document.body&&r){const t=r.getBoundingClientRect();g-=t.left-r.scrollLeft,m-=t.top-r.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=Gr(o);let b=0,y=0,{clientWidth:_,clientHeight:w}=document.documentElement;if(v){const t=v.getBoundingClientRect();t.top>0&&(y=t.top),t.left>0&&(b=t.left),t.right<_&&(_=t.right),t.bottom<w&&(w=t.bottom)}let E=0;"auto"===p&&(a<b?(p="left",E=b-a):a+i>_?(p="right",_<c&&(E=_-c)):p="rtl"===Qr(o)?c-i<b?"left":"right":"left"),"right"===p&&(g+=u-i),g+=E,"auto"===f&&(f=l-n>y&&d+n>w?"top":"bottom"),"top"===f?m-=n:m+=h,t.remove(...Object.values(Wr)),t.add(Wr[p],Wr[f]),e.left=Yr(g),e.top=Yr(m)}setViewSwitchLabel(t){this.controls.viewSwitch.textContent=t}setPrevButtonDisabled(t){this.controls.prevButton.disabled=t}setNextButtonDisabled(t){this.controls.nextButton.disabled=t}changeView(t){const e=this.currentView;return t!==e.id&&(this._oldView||(this._oldView=e),this.currentView=this.views[t],this._renderMethod="render"),this}changeFocus(t){return this._renderMethod=Xr(this,t)?"render":"refreshFocus",this.views.forEach((t=>{t.updateFocus()})),this}update(t=void 0){const e=void 0===t?Ur(this.datepicker):t;return this._renderMethod=Xr(this,e)?"render":"refresh",this.views.forEach((t=>{t.updateFocus(),t.updateSelection()})),this}render(t=!0){const{currentView:e,datepicker:i,_oldView:n}=this,r=new Date(this._oldViewDate),s=t&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,e[s](),n&&(this.main.replaceChild(e.element,n.element),Fr(i,"changeView")),!isNaN(r)){const t=new Date(this.viewDate);t.getFullYear()!==r.getFullYear()&&Fr(i,"changeYear"),t.getMonth()!==r.getMonth()&&Fr(i,"changeMonth")}}}function Zr(t,e,i,n,r,s){if(An(t,r,s)){if(n(t)){return Zr(e(t,i),e,i,n,r,s)}return t}}function ts(t,e,i){const n=t.picker,r=n.currentView,s=r.step||1;let o,a=n.viewDate;switch(r.id){case 0:a=Tn(a,i?7*e:e),o=Tn;break;case 1:a=Ln(a,i?4*e:e),o=Ln;break;default:a=In(a,e*(i?4:1)*s),o=In}a=Zr(a,o,e<0?-s:s,(t=>r.disabled.includes(t)),r.minDate,r.maxDate),void 0!==a&&n.changeFocus(a).render()}function es(t,e){const{config:i,picker:n,editMode:r}=t,s=n.active,{key:o,altKey:a,shiftKey:l}=e,c=e.ctrlKey||e.metaKey,d=()=>{e.preventDefault(),e.stopPropagation()};if("Tab"===o)return void $r(t);if("Enter"===o){if(s)if(r)t.exitEditMode({update:!0,autohide:i.autohide});else{const e=n.currentView;e.isMinView?t.setDate(n.viewDate):(n.changeView(e.id-1).render(),d())}else t.update();return}const u=i.shortcutKeys,h={key:o,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(u).find((t=>{const e=u[t];return!Object.keys(e).find((t=>e[t]!==h[t]))}));if(p){let e;if("toggle"===p?e=p:r?"exitEditMode"===p&&(e=p):s?"hide"===p?e=p:"prevButton"===p?e=[Mr,[t,-1]]:"nextButton"===p?e=[Mr,[t,1]]:"viewSwitch"===p?e=[Nr,[t]]:i.clearButton&&"clearButton"===p?e=[jr,[t]]:i.todayButton&&"todayButton"===p&&(e=[Pr,[t]]):"show"===p&&(e=p),e)return Array.isArray(e)?e[0].apply(null,e[1]):t[e](),void d()}if(!s||r)return;const f=(i,n)=>{l||c||a?t.enterEditMode():(ts(t,i,n),e.preventDefault())};"ArrowLeft"===o?f(-1,!1):"ArrowRight"===o?f(1,!1):"ArrowUp"===o?f(-1,!0):"ArrowDown"===o?f(1,!0):("Backspace"===o||"Delete"===o||o&&1===o.length&&!c)&&t.enterEditMode()}function is(t){t.config.showOnFocus&&!t._showing&&t.show()}function ns(t,e){const i=e.target;(t.picker.active||t.config.showOnClick)&&(i._active=er(i),i._clicking=setTimeout((()=>{delete i._active,delete i._clicking}),2e3))}function rs(t,e){const i=e.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&t.enterEditMode(),delete i._active,t.config.showOnClick&&t.show())}function ss(t,e){e.clipboardData.types.includes("text/plain")&&t.enterEditMode()}function os(t,e){const{element:i,picker:n}=t;if(!n.active&&!er(i))return;const r=n.element;dr(e,(t=>t===i||t===r))||$r(t)}function as(t,e){return t.map((t=>Gn(t,e.format,e.locale))).join(e.dateDelimiter)}function ls(t,e,i=!1){if(0===e.length)return i?[]:void 0;const{config:n,dates:r,rangeSideIndex:s}=t,{pickLevel:o,maxNumberOfDates:a}=n;let l=e.reduce(((t,e)=>{let i=Qn(e,n.format,n.locale);return void 0===i||(i=Rn(i,o,s),!An(i,n.minDate,n.maxDate)||t.includes(i)||n.checkDisabled(i,o)||!(o>0)&&n.daysOfWeekDisabled.includes(new Date(i).getDay())||t.push(i)),t}),[]);return 0!==l.length?(n.multidate&&!i&&(l=l.reduce(((t,e)=>(r.includes(e)||t.push(e),t)),r.filter((t=>!l.includes(t))))),a&&l.length>a?l.slice(-1*a):l):void 0}function cs(t,e=3,i=!0,n=void 0){const{config:r,picker:s,inputField:o}=t;if(2&e){const t=s.active?r.pickLevel:r.startView;s.update(n).changeView(t).render(i)}1&e&&o&&(o.value=as(t.dates,r))}function ds(t,e,i){const n=t.config;let{clear:r,render:s,autohide:o,revert:a,forceRefresh:l,viewDate:c}=i;void 0===s&&(s=!0),s?void 0===o&&(o=n.autohide):o=l=!1,c=Qn(c,n.format,n.locale);const d=ls(t,e,r);(d||a)&&(d&&d.toString()!==t.dates.toString()?(t.dates=d,cs(t,s?3:1,!0,c),Fr(t,"changeDate")):cs(t,l?3:1,!0,c),o&&t.hide())}function us(t,e){return e?i=>Gn(i,e,t.config.locale):t=>new Date(t)}class hs{constructor(t,e={},i=void 0){t.datepicker=this,this.element=t,this.dates=[];const n=this.config=Object.assign({buttonClass:e.buttonClass&&String(e.buttonClass)||"button",container:null,defaultViewDate:Dn(),maxDate:void 0,minDate:void 0},Er(hr,this));let r;if("INPUT"===t.tagName?(r=this.inputField=t,r.classList.add("datepicker-input"),e.container&&(n.container=e.container instanceof HTMLElement?e.container:document.querySelector(e.container))):n.container=t,i){const t=i.inputs.indexOf(r),e=i.datepickers;if(t<0||t>1||!Array.isArray(e))throw Error("Invalid rangepicker object.");e[t]=this,this.rangepicker=i,this.rangeSideIndex=t}this._options=e,Object.assign(n,Er(e,this)),n.shortcutKeys=function(t){return Object.keys(Ar).reduce(((e,i)=>{const n=void 0===t[i]?Ar[i]:t[i],r=n&&n.key;if(!r||"string"!=typeof r)return e;const s={key:r,ctrlOrMetaKey:!!(n.ctrlOrMetaKey||n.ctrlKey||n.metaKey)};return r.length>1&&(s.altKey=!!n.altKey,s.shiftKey=!!n.shiftKey),e[i]=s,e}),{})}(e.shortcutKeys||{});const s=En(t.value||t.dataset.date,n.dateDelimiter);delete t.dataset.date;const o=ls(this,s);o&&o.length>0&&(this.dates=o),r&&(r.value=as(this.dates,n));const a=this.picker=new Jr(this),l=[t,"keydown",es.bind(null,this)];r?lr(this,[l,[r,"focus",is.bind(null,this)],[r,"mousedown",ns.bind(null,this)],[r,"click",rs.bind(null,this)],[r,"paste",ss.bind(null,this)],[document,"mousedown",os.bind(null,this)],[window,"resize",a.place.bind(a)]]):(lr(this,[l]),this.show())}static formatDate(t,e,i){return Gn(t,e,i&&ur[i]||ur.en)}static parseDate(t,e,i){return Qn(t,e,i&&ur[i]||ur.en)}static get locales(){return ur}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(t){const e=Er(t,this);Object.assign(this._options,t),Object.assign(this.config,e),this.picker.setOptions(e),cs(this,3)}show(){if(this.inputField){const{config:t,inputField:e}=this;if(e.disabled||e.readOnly&&!t.enableOnReadonly)return;er(e)||t.disableTouchKeyboard||(this._showing=!0,e.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),function(t){let e=sr.get(t);e&&(e.forEach((t=>{ar.call(...t)})),sr.delete(t))}(this),this.picker.detach();const t=this.element;return t.classList.remove("datepicker-input"),delete t.datepicker,this}getDate(t=void 0){const e=us(this,t);return this.config.multidate?this.dates.map(e):this.dates.length>0?e(this.dates[0]):void 0}setDate(...t){const e=[...t],i={},n=_n(t);!n||"object"!=typeof n||Array.isArray(n)||n instanceof Date||Object.assign(i,e.pop());ds(this,Array.isArray(e[0])?e[0]:e,i)}update(t=void 0){if(!this.inputField)return;const e=Object.assign(t||{},{clear:!0,render:!0,viewDate:void 0});ds(this,En(this.inputField.value,this.config.dateDelimiter),e)}getFocusedDate(t=void 0){return us(this,t)(this.picker.viewDate)}setFocusedDate(t,e=!1){const{config:i,picker:n,active:r,rangeSideIndex:s}=this,o=i.pickLevel,a=Qn(t,i.format,i.locale);void 0!==a&&(n.changeFocus(Rn(a,o,s)),r&&e&&n.changeView(o),n.render())}refresh(t=void 0,e=!1){let i;t&&"string"!=typeof t&&(e=t,t=void 0),i="picker"===t?2:"input"===t?1:3,cs(this,i,!e)}enterEditMode(){const t=this.inputField;t&&!t.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,t.classList.add("in-edit"))}exitEditMode(t=void 0){if(!this.inputField||!this.editMode)return;const e=Object.assign({update:!1},t);delete this.editMode,this.inputField.classList.remove("in-edit"),e.update&&this.update(e)}}class ps{constructor(t={}){this.opts=t}initDatepickers(t){t.forEach((t=>{const e="function"==typeof this.opts?this.opts(t):this.opts;new hs(t,{...e,updateOnBlur:!1}),t.addEventListener("changeDate",(()=>{const e=t.closest("form");e&&e.submit()}))}))}}class fs extends EventTarget{constructor(t,e,i){super(),this.el=t,this.options={...fs.defaultOptions,...i};const n=this.resolveDatagridName();if(!n)throw new Error("Cannot resolve name of a datagrid!");this.name=n,this.ajax="function"==typeof e?e(this):e,this.ajax.addEventListener("success",(t=>{var e,i;(null===(e=t.detail.payload)||void 0===e?void 0:e._datagrid_name)===this.name&&(null===(i=t.detail.payload)||void 0===i?void 0:i._datagrid_init)&&this.init()})),this.init()}init(){!this.dispatch("beforeInit",{datagrid:this})||this.options.plugins.forEach((t=>{var e;null===(e=t.onDatagridInit)||void 0===e||e.call(t,this)}));const t=this.el.querySelectorAll("input[data-check]:checked");if(1===t.length&&"toggle-all"===t[0].getAttribute("name")){const e=t[0];e&&(e.checked=!1)}this.el.querySelectorAll("input[data-datagrid-manualsubmit]").forEach((t=>{const e=t.closest("form");e&&t.addEventListener("keydown",(t=>{if(w(t))return t.stopPropagation(),t.preventDefault(),this.ajax.submitForm(e)}))})),this.ajax.addEventListener("success",(({detail:{payload:t}})=>{var e;if(t._datagrid_name&&t._datagrid_name===this.name){const i=t=>t.getAttribute("data-datagrid-reset-filter-by-column"),n=Array.from(this.el.querySelectorAll("[data-datagrid-reset-filter-by-column]")),r=t.non_empty_filters?t.non_empty_filters:[];if(n.forEach((t=>{const e=i(t);e&&r.includes(e)?t.classList.remove("hidden"):t.classList.add("hidden")})),r.length>0){const t=null===(e=this.el.querySelector(".reset-filter"))||void 0===e?void 0:e.getAttribute("href");t&&n.forEach((e=>{const n=i(e),r=t.replace("-resetFilter","-resetColumnFilter");e.setAttribute("href",`${r}&${this.name}-key=${n}`)}))}}})),this.dispatch("afterInit",{datagrid:this})}confirm(t){return this.options.confirm.bind(this)(t)}resolveDatagridName(){return this.options.resolveDatagridName.bind(this)(this.el)}dispatch(t,e,i){return this.dispatchEvent(new CustomEvent(t,{detail:e}))}}fs.defaultOptions={confirm:confirm,resolveDatagridName:function(t){const e=t.getAttribute("data-datagrid-name");if(e)return e;console.warn("Deprecated name resolution for datagrid",t,": Please add a data-datagrid-name attribute instead!\nCurrently, the Datagrid library relies on matching the name from the 'datagrid-[name]' class, which is unreliable and may cause bugs if the default class names are not used (eg. if you add a datagrid-xx class, or change the name class completely!)\nAlternatively, you can customize the name resolution with the `resolveDatagridName` option. See TBD for more info.");const i=t.classList.value.split(" ");for(const t of i){if(!t.startsWith("datagrid-"))continue;const[,...e]=t.split("-"),i=e.join("-");return i.length<1?(console.error(`Failed to resolve datagrid name - ambigious class name '${t}'`),null):i}return null},plugins:[]};class gs{constructor(t,e={}){this.ajax=t,this.datagrids=[],this.options={selector:"div[data-datagrid-name]",datagrid:{},root:document.body,...e};const i="string"==typeof this.options.root?document.querySelector(this.options.root):this.options.root;if(!(i&&i instanceof HTMLElement))throw new Error("Root element not found or is not an HTMLElement");this.root=i,this.init()}init(){var t,e;this.ajax.onInit(),(null!==(e=null===(t=this.options.datagrid)||void 0===t?void 0:t.plugins)&&void 0!==e?e:[]).forEach((t=>{var e;return null===(e=t.onInit)||void 0===e?void 0:e.call(t,this)})),this.initDatagrids()}initDatagrids(){this.datagrids=Array.from(this.root.querySelectorAll(this.options.selector)).map((t=>new fs(t,this.ajax,this.options.datagrid)))}}class ms extends EventTarget{constructor(t){if(!t.VERSION||t.VERSION<2)throw new Error("NajaAjax supports Naja 2 and higher"+(t.VERSION?`(version ${t.VERSION} provided)`:""));super(),this.client=t}onInit(){return this.client.addEventListener("before",(t=>this.dispatch("before",{params:t.detail}))),this.client.uiHandler.addEventListener("interaction",(t=>{if(!(t.detail.element instanceof HTMLElement))throw new Error("Element is not an instanceof HTMLElement");const e=this.dispatch("interact",{...t.detail,element:t.detail.element});return e||(t.stopPropagation(),t.preventDefault()),e})),this.client.addEventListener("success",(t=>this.dispatch("success",{...t.detail,params:t.detail.request,payload:t.detail.payload}))),this.client.addEventListener("error",(t=>this.dispatch("error",{...t.detail,params:t.detail.request,response:t.detail.response}))),this.client.addEventListener("complete",(t=>this.dispatch("complete",{...t.detail,params:t.detail.request,response:t.detail.response}))),this}async request(t){return await this.client.makeRequest(t.method,t.url,t.data)}async submitForm(t){return await this.client.uiHandler.submitForm(t)}dispatch(t,e,i){return this.dispatchEvent(new CustomEvent(t,{detail:e,cancelable:!0}))}}var vs="top",bs="bottom",ys="right",_s="left",ws="auto",Es=[vs,bs,ys,_s],As="start",ks="end",Ss="clippingParents",Cs="viewport",Os="popper",Ds="reference",xs=Es.reduce((function(t,e){return t.concat([e+"-"+As,e+"-"+ks])}),[]),Ts=[].concat(Es,[ws]).reduce((function(t,e){return t.concat([e,e+"-"+As,e+"-"+ks])}),[]),Ls="beforeRead",Is="read",Fs="afterRead",Ms="beforeMain",Ns="main",js="afterMain",Ps="beforeWrite",$s="write",Hs="afterWrite",qs=[Ls,Is,Fs,Ms,Ns,js,Ps,$s,Hs];function Rs(t){return t?(t.nodeName||"").toLowerCase():null}function Bs(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Vs(t){return t instanceof Bs(t).Element||t instanceof Element}function zs(t){return t instanceof Bs(t).HTMLElement||t instanceof HTMLElement}function Ws(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Bs(t).ShadowRoot||t instanceof ShadowRoot)}var Ys={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},r=e.elements[t];zs(r)&&Rs(r)&&(Object.assign(r.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],r=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});zs(n)&&Rs(n)&&(Object.assign(n.style,s),Object.keys(r).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function Ks(t){return t.split("-")[0]}var Us=Math.max,Xs=Math.min,Qs=Math.round;function Gs(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Js(){return!/^((?!chrome|android).)*safari/i.test(Gs())}function Zs(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,s=1;e&&zs(t)&&(r=t.offsetWidth>0&&Qs(n.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Qs(n.height)/t.offsetHeight||1);var o=(Vs(t)?Bs(t):window).visualViewport,a=!Js()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/r,c=(n.top+(a&&o?o.offsetTop:0))/s,d=n.width/r,u=n.height/s;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function to(t){var e=Zs(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function eo(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Ws(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function io(t){return Bs(t).getComputedStyle(t)}function no(t){return["table","td","th"].indexOf(Rs(t))>=0}function ro(t){return((Vs(t)?t.ownerDocument:t.document)||window.document).documentElement}function so(t){return"html"===Rs(t)?t:t.assignedSlot||t.parentNode||(Ws(t)?t.host:null)||ro(t)}function oo(t){return zs(t)&&"fixed"!==io(t).position?t.offsetParent:null}function ao(t){for(var e=Bs(t),i=oo(t);i&&no(i)&&"static"===io(i).position;)i=oo(i);return i&&("html"===Rs(i)||"body"===Rs(i)&&"static"===io(i).position)?e:i||function(t){var e=/firefox/i.test(Gs());if(/Trident/i.test(Gs())&&zs(t)&&"fixed"===io(t).position)return null;var i=so(t);for(Ws(i)&&(i=i.host);zs(i)&&["html","body"].indexOf(Rs(i))<0;){var n=io(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function co(t,e,i){return Us(t,Xs(e,i))}function uo(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function ho(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}var po={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,r=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Ks(i.placement),l=lo(a),c=[_s,ys].indexOf(a)>=0?"height":"width";if(s&&o){var d=function(t,e){return uo("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ho(t,Es))}(r.padding,i),u=to(s),h="y"===l?vs:_s,p="y"===l?bs:ys,f=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],g=o[l]-i.rects.reference[l],m=ao(s),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=f/2-g/2,y=d[h],_=v-u[c]-d[p],w=v/2-u[c]/2+b,E=co(y,w,_),A=l;i.modifiersData[n]=((e={})[A]=E,e.centerOffset=E-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&eo(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fo(t){return t.split("-")[1]}var go={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mo(t){var e,i=t.popper,n=t.popperRect,r=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,g=void 0===f?0:f,m="function"==typeof d?d({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=_s,_=vs,w=window;if(c){var E=ao(i),A="clientHeight",k="clientWidth";if(E===Bs(i)&&"static"!==io(E=ro(i)).position&&"absolute"===a&&(A="scrollHeight",k="scrollWidth"),r===vs||(r===_s||r===ys)&&s===ks)_=bs,g-=(u&&E===w&&w.visualViewport?w.visualViewport.height:E[A])-n.height,g*=l?1:-1;if(r===_s||(r===vs||r===bs)&&s===ks)y=ys,p-=(u&&E===w&&w.visualViewport?w.visualViewport.width:E[k])-n.width,p*=l?1:-1}var S,C=Object.assign({position:a},c&&go),O=!0===d?function(t,e){var i=t.x,n=t.y,r=e.devicePixelRatio||1;return{x:Qs(i*r)/r||0,y:Qs(n*r)/r||0}}({x:p,y:g},Bs(i)):{x:p,y:g};return p=O.x,g=O.y,l?Object.assign({},C,((S={})[_]=b?"0":"",S[y]=v?"0":"",S.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",S)):Object.assign({},C,((e={})[_]=b?g+"px":"",e[y]=v?p+"px":"",e.transform="",e))}var vo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,r=void 0===n||n,s=i.adaptive,o=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:Ks(e.placement),variation:fo(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,mo(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,mo(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},bo={passive:!0};var yo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,r=n.scroll,s=void 0===r||r,o=n.resize,a=void 0===o||o,l=Bs(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",i.update,bo)})),a&&l.addEventListener("resize",i.update,bo),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",i.update,bo)})),a&&l.removeEventListener("resize",i.update,bo)}},data:{}},_o={left:"right",right:"left",bottom:"top",top:"bottom"};function wo(t){return t.replace(/left|right|bottom|top/g,(function(t){return _o[t]}))}var Eo={start:"end",end:"start"};function Ao(t){return t.replace(/start|end/g,(function(t){return Eo[t]}))}function ko(t){var e=Bs(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function So(t){return Zs(ro(t)).left+ko(t).scrollLeft}function Co(t){var e=io(t),i=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Oo(t){return["html","body","#document"].indexOf(Rs(t))>=0?t.ownerDocument.body:zs(t)&&Co(t)?t:Oo(so(t))}function Do(t,e){var i;void 0===e&&(e=[]);var n=Oo(t),r=n===(null==(i=t.ownerDocument)?void 0:i.body),s=Bs(n),o=r?[s].concat(s.visualViewport||[],Co(n)?n:[]):n,a=e.concat(o);return r?a:a.concat(Do(so(o)))}function xo(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function To(t,e,i){return e===Cs?xo(function(t,e){var i=Bs(t),n=ro(t),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=Js();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+So(t),y:l}}(t,i)):Vs(e)?function(t,e){var i=Zs(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):xo(function(t){var e,i=ro(t),n=ko(t),r=null==(e=t.ownerDocument)?void 0:e.body,s=Us(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Us(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+So(t),l=-n.scrollTop;return"rtl"===io(r||i).direction&&(a+=Us(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(ro(t)))}function Lo(t,e,i,n){var r="clippingParents"===e?function(t){var e=Do(so(t)),i=["absolute","fixed"].indexOf(io(t).position)>=0&&zs(t)?ao(t):t;return Vs(i)?e.filter((function(t){return Vs(t)&&eo(t,i)&&"body"!==Rs(t)})):[]}(t):[].concat(e),s=[].concat(r,[i]),o=s[0],a=s.reduce((function(e,i){var r=To(t,i,n);return e.top=Us(r.top,e.top),e.right=Xs(r.right,e.right),e.bottom=Xs(r.bottom,e.bottom),e.left=Us(r.left,e.left),e}),To(t,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Io(t){var e,i=t.reference,n=t.element,r=t.placement,s=r?Ks(r):null,o=r?fo(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case vs:e={x:a,y:i.y-n.height};break;case bs:e={x:a,y:i.y+i.height};break;case ys:e={x:i.x+i.width,y:l};break;case _s:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=s?lo(s):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case As:e[c]=e[c]-(i[d]/2-n[d]/2);break;case ks:e[c]=e[c]+(i[d]/2-n[d]/2)}}return e}function Fo(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=void 0===n?t.placement:n,s=i.strategy,o=void 0===s?t.strategy:s,a=i.boundary,l=void 0===a?Ss:a,c=i.rootBoundary,d=void 0===c?Cs:c,u=i.elementContext,h=void 0===u?Os:u,p=i.altBoundary,f=void 0!==p&&p,g=i.padding,m=void 0===g?0:g,v=uo("number"!=typeof m?m:ho(m,Es)),b=h===Os?Ds:Os,y=t.rects.popper,_=t.elements[f?b:h],w=Lo(Vs(_)?_:_.contextElement||ro(t.elements.popper),l,d,o),E=Zs(t.elements.reference),A=Io({reference:E,element:y,placement:r}),k=xo(Object.assign({},y,A)),S=h===Os?k:E,C={top:w.top-S.top+v.top,bottom:S.bottom-w.bottom+v.bottom,left:w.left-S.left+v.left,right:S.right-w.right+v.right},O=t.modifiersData.offset;if(h===Os&&O){var D=O[r];Object.keys(C).forEach((function(t){var e=[ys,bs].indexOf(t)>=0?1:-1,i=[vs,bs].indexOf(t)>=0?"y":"x";C[t]+=D[i]*e}))}return C}function Mo(t,e){void 0===e&&(e={});var i=e,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Ts:l,d=fo(n),u=d?a?xs:xs.filter((function(t){return fo(t)===d})):Es,h=u.filter((function(t){return c.indexOf(t)>=0}));0===h.length&&(h=u);var p=h.reduce((function(e,i){return e[i]=Fo(t,{placement:i,boundary:r,rootBoundary:s,padding:o})[Ks(i)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}var No={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,h=i.altBoundary,p=i.flipVariations,f=void 0===p||p,g=i.allowedAutoPlacements,m=e.options.placement,v=Ks(m),b=l||(v===m||!f?[wo(m)]:function(t){if(Ks(t)===ws)return[];var e=wo(t);return[Ao(t),e,Ao(e)]}(m)),y=[m].concat(b).reduce((function(t,i){return t.concat(Ks(i)===ws?Mo(e,{placement:i,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:g}):i)}),[]),_=e.rects.reference,w=e.rects.popper,E=new Map,A=!0,k=y[0],S=0;S<y.length;S++){var C=y[S],O=Ks(C),D=fo(C)===As,x=[vs,bs].indexOf(O)>=0,T=x?"width":"height",L=Fo(e,{placement:C,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),I=x?D?ys:_s:D?bs:vs;_[T]>w[T]&&(I=wo(I));var F=wo(I),M=[];if(s&&M.push(L[O]<=0),a&&M.push(L[I]<=0,L[F]<=0),M.every((function(t){return t}))){k=C,A=!1;break}E.set(C,M)}if(A)for(var N=function(t){var e=y.find((function(e){var i=E.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return k=e,"break"},j=f?3:1;j>0;j--){if("break"===N(j))break}e.placement!==k&&(e.modifiersData[n]._skip=!0,e.placement=k,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function jo(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Po(t){return[vs,ys,bs,_s].some((function(e){return t[e]>=0}))}var $o={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=Fo(e,{elementContext:"reference"}),a=Fo(e,{altBoundary:!0}),l=jo(o,n),c=jo(a,r,s),d=Po(l),u=Po(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var Ho={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.offset,s=void 0===r?[0,0]:r,o=Ts.reduce((function(t,i){return t[i]=function(t,e,i){var n=Ks(t),r=[_s,vs].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},e,{placement:t})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[_s,ys].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}(i,e.rects,s),t}),{}),a=o[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=o}};var qo={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Io({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}};var Ro={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,u=i.padding,h=i.tether,p=void 0===h||h,f=i.tetherOffset,g=void 0===f?0:f,m=Fo(e,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),v=Ks(e.placement),b=fo(e.placement),y=!b,_=lo(v),w="x"===_?"y":"x",E=e.modifiersData.popperOffsets,A=e.rects.reference,k=e.rects.popper,S="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,C="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(E){if(s){var x,T="y"===_?vs:_s,L="y"===_?bs:ys,I="y"===_?"height":"width",F=E[_],M=F+m[T],N=F-m[L],j=p?-k[I]/2:0,P=b===As?A[I]:k[I],$=b===As?-k[I]:-A[I],H=e.elements.arrow,q=p&&H?to(H):{width:0,height:0},R=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=R[T],V=R[L],z=co(0,A[I],q[I]),W=y?A[I]/2-j-z-B-C.mainAxis:P-z-B-C.mainAxis,Y=y?-A[I]/2+j+z+V+C.mainAxis:$+z+V+C.mainAxis,K=e.elements.arrow&&ao(e.elements.arrow),U=K?"y"===_?K.clientTop||0:K.clientLeft||0:0,X=null!=(x=null==O?void 0:O[_])?x:0,Q=F+Y-X,G=co(p?Xs(M,F+W-X-U):M,F,p?Us(N,Q):N);E[_]=G,D[_]=G-F}if(a){var J,Z="x"===_?vs:_s,tt="x"===_?bs:ys,et=E[w],it="y"===w?"height":"width",nt=et+m[Z],rt=et-m[tt],st=-1!==[vs,_s].indexOf(v),ot=null!=(J=null==O?void 0:O[w])?J:0,at=st?nt:et-A[it]-k[it]-ot+C.altAxis,lt=st?et+A[it]+k[it]-ot-C.altAxis:rt,ct=p&&st?function(t,e,i){var n=co(t,e,i);return n>i?i:n}(at,et,lt):co(p?at:nt,et,p?lt:rt);E[w]=ct,D[w]=ct-et}e.modifiersData[n]=D}},requiresIfExists:["offset"]};function Bo(t,e,i){void 0===i&&(i=!1);var n,r,s=zs(e),o=zs(e)&&function(t){var e=t.getBoundingClientRect(),i=Qs(e.width)/t.offsetWidth||1,n=Qs(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=ro(e),l=Zs(t,o,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!i)&&(("body"!==Rs(e)||Co(a))&&(c=(n=e)!==Bs(n)&&zs(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:ko(n)),zs(e)?((d=Zs(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=So(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function Vo(t){var e=new Map,i=new Set,n=[];function r(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&r(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||r(t)})),n}var zo={placement:"bottom",modifiers:[],strategy:"absolute"};function Wo(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Yo(t){void 0===t&&(t={});var e=t,i=e.defaultModifiers,n=void 0===i?[]:i,r=e.defaultOptions,s=void 0===r?zo:r;return function(t,e,i){void 0===i&&(i=s);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},zo,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,d={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;u(),a.options=Object.assign({},s,a.options,r),a.scrollParents={reference:Vs(t)?Do(t):t.contextElement?Do(t.contextElement):[],popper:Do(e)};var o,c,h=function(t){var e=Vo(t);return qs.reduce((function(t,i){return t.concat(e.filter((function(t){return t.phase===i})))}),[])}((o=[].concat(n,a.options.modifiers),c=o.reduce((function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return a.orderedModifiers=h.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,i=t.options,n=void 0===i?{}:i,r=t.effect;if("function"==typeof r){var s=r({state:a,name:e,instance:d,options:n}),o=function(){};l.push(s||o)}})),d.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,i=t.popper;if(Wo(e,i)){a.rects={reference:Bo(e,ao(i),"fixed"===a.options.strategy),popper:to(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var r=a.orderedModifiers[n],s=r.fn,o=r.options,l=void 0===o?{}:o,u=r.name;"function"==typeof s&&(a=s({state:a,options:l,name:u,instance:d})||a)}else a.reset=!1,n=-1}}},update:(r=function(){return new Promise((function(t){d.forceUpdate(),t(a)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(r())}))}))),o}),destroy:function(){u(),c=!0}};if(!Wo(t,e))return d;function u(){l.forEach((function(t){return t()})),l=[]}return d.setOptions(i).then((function(t){!c&&i.onFirstUpdate&&i.onFirstUpdate(t)})),d}}var Ko=Yo(),Uo=Yo({defaultModifiers:[yo,qo,vo,Ys]}),Xo=Yo({defaultModifiers:[yo,qo,vo,Ys,Ho,No,Ro,po,$o]}),Qo=Object.freeze({__proto__:null,afterMain:js,afterRead:Fs,afterWrite:Hs,applyStyles:Ys,arrow:po,auto:ws,basePlacements:Es,beforeMain:Ms,beforeRead:Ls,beforeWrite:Ps,bottom:bs,clippingParents:Ss,computeStyles:vo,createPopper:Xo,createPopperBase:Ko,createPopperLite:Uo,detectOverflow:Fo,end:ks,eventListeners:yo,flip:No,hide:$o,left:_s,main:Ns,modifierPhases:qs,offset:Ho,placements:Ts,popper:Os,popperGenerator:Yo,popperOffsets:qo,preventOverflow:Ro,read:Is,reference:Ds,right:ys,start:As,top:vs,variationPlacements:xs,viewport:Cs,write:$s});
13
+ */function ft(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function gt(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(i),!0).forEach(function(t){vt(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ft(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function mt(e){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mt(e)}function vt(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function bt(){return bt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},bt.apply(this,arguments)}function yt(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function _t(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var wt=_t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Et=_t(/Edge/i),At=_t(/firefox/i),St=_t(/safari/i)&&!_t(/chrome/i)&&!_t(/android/i),kt=_t(/iP(ad|od|hone)/i),Ot=_t(/chrome/i)&&_t(/android/i),Ct={capture:!1,passive:!1};function Dt(e,t,i){e.addEventListener(t,i,!wt&&Ct)}function xt(e,t,i){e.removeEventListener(t,i,!wt&&Ct)}function Tt(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Lt(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function It(e,t,i,n){if(e){i=i||document;do{if(null!=t&&(">"===t[0]?e.parentNode===i&&Tt(e,t):Tt(e,t))||n&&e===i)return e;if(e===i)break}while(e=Lt(e))}return null}var Mt,Ft=/\s+/g;function Nt(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(Ft," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(Ft," ")}}function jt(e,t,i){var n=e&&e.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),void 0===t?i:i[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=i+("string"==typeof i?"":"px")}}function Pt(e,t){var i="";if("string"==typeof e)i=e;else do{var n=jt(e,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(i)}function $t(e,t,i){if(e){var n=e.getElementsByTagName(t),r=0,s=n.length;if(i)for(;r<s;r++)i(n[r],r);return n}return[]}function Ht(){var e=document.scrollingElement;return e||document.documentElement}function qt(e,t,i,n,r){if(e.getBoundingClientRect||e===window){var s,o,a,l,c,d,u;if(e!==window&&e.parentNode&&e!==Ht()?(o=(s=e.getBoundingClientRect()).top,a=s.left,l=s.bottom,c=s.right,d=s.height,u=s.width):(o=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||i)&&e!==window&&(r=r||e.parentNode,!wt))do{if(r&&r.getBoundingClientRect&&("none"!==jt(r,"transform")||i&&"static"!==jt(r,"position"))){var h=r.getBoundingClientRect();o-=h.top+parseInt(jt(r,"border-top-width")),a-=h.left+parseInt(jt(r,"border-left-width")),l=o+s.height,c=a+s.width;break}}while(r=r.parentNode);if(n&&e!==window){var p=Pt(r||e),f=p&&p.a,g=p&&p.d;p&&(l=(o/=g)+(d/=g),c=(a/=f)+(u/=f))}return{top:o,left:a,bottom:l,right:c,width:u,height:d}}}function Rt(e,t,i){for(var n=Yt(e,!0),r=qt(e)[t];n;){if(!(r>=qt(n)[i]))return n;if(n===Ht())break;n=Yt(n,!1)}return!1}function Bt(e,t,i,n){for(var r=0,s=0,o=e.children;s<o.length;){if("none"!==o[s].style.display&&o[s]!==Qi.ghost&&(n||o[s]!==Qi.dragged)&&It(o[s],i.draggable,e,!1)){if(r===t)return o[s];r++}s++}return null}function Vt(e,t){for(var i=e.lastElementChild;i&&(i===Qi.ghost||"none"===jt(i,"display")||t&&!Tt(i,t));)i=i.previousElementSibling;return i||null}function zt(e,t){var i=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Qi.clone||t&&!Tt(e,t)||i++;return i}function Wt(e){var t=0,i=0,n=Ht();if(e)do{var r=Pt(e),s=r.a,o=r.d;t+=e.scrollLeft*s,i+=e.scrollTop*o}while(e!==n&&(e=e.parentNode));return[t,i]}function Yt(e,t){if(!e||!e.getBoundingClientRect)return Ht();var i=e,n=!1;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var r=jt(i);if(i.clientWidth<i.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||i.clientHeight<i.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!i.getBoundingClientRect||i===document.body)return Ht();if(n||t)return i;n=!0}}}while(i=i.parentNode);return Ht()}function Kt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function Ut(e,t){return function(){if(!Mt){var i=arguments;1===i.length?e.call(this,i[0]):e.apply(this,i),Mt=setTimeout(function(){Mt=void 0},t)}}}function Xt(e,t,i){e.scrollLeft+=t,e.scrollTop+=i}function Qt(e){var t=window.Polymer,$=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):$?$(e).clone(!0)[0]:e.cloneNode(!0)}function Gt(e,t,i){var n={};return Array.from(e.children).forEach(function(r){var s,o,a,l;if(It(r,t.draggable,e,!1)&&!r.animated&&r!==i){var c=qt(r);n.left=Math.min(null!==(s=n.left)&&void 0!==s?s:1/0,c.left),n.top=Math.min(null!==(o=n.top)&&void 0!==o?o:1/0,c.top),n.right=Math.max(null!==(a=n.right)&&void 0!==a?a:-1/0,c.right),n.bottom=Math.max(null!==(l=n.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Jt="Sortable"+(new Date).getTime();function Zt(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(e){if("none"!==jt(e,"display")&&e!==Qi.ghost){t.push({target:e,rect:qt(e)});var i=gt({},t[t.length-1].rect);if(e.thisAnimationDuration){var n=Pt(e,!0);n&&(i.top-=n.f,i.left-=n.e)}e.fromRect=i}})},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var i in e)if(e.hasOwnProperty(i))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[i][n])return Number(i);return-1}(t,{target:e}),1)},animateAll:function(i){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof i&&i());var r=!1,s=0;t.forEach(function(e){var t=0,i=e.target,o=i.fromRect,a=qt(i),l=i.prevFromRect,c=i.prevToRect,d=e.rect,u=Pt(i,!0);u&&(a.top-=u.f,a.left-=u.e),i.toRect=a,i.thisAnimationDuration&&Kt(l,a)&&!Kt(o,a)&&(d.top-a.top)/(d.left-a.left)===(o.top-a.top)/(o.left-a.left)&&(t=function(e,t,i,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*n.animation}(d,l,c,n.options)),Kt(a,o)||(i.prevFromRect=o,i.prevToRect=a,t||(t=n.options.animation),n.animate(i,d,a,t)),t&&(r=!0,s=Math.max(s,t),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout(function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null},t),i.thisAnimationDuration=t)}),clearTimeout(e),r?e=setTimeout(function(){"function"==typeof i&&i()},s):"function"==typeof i&&i(),t=[]},animate:function(e,t,i,n){if(n){jt(e,"transition",""),jt(e,"transform","");var r=Pt(this.el),s=r&&r.a,o=r&&r.d,a=(t.left-i.left)/(s||1),l=(t.top-i.top)/(o||1);e.animatingX=!!a,e.animatingY=!!l,jt(e,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),jt(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),jt(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){jt(e,"transition",""),jt(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},n)}}}}var ei=[],ti={initializeByDefault:!0},ii={mount:function(e){for(var t in ti)ti.hasOwnProperty(t)&&!(t in e)&&(e[t]=ti[t]);ei.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),ei.push(e)},pluginEvent:function(e,t,i){var n=this;this.eventCanceled=!1,i.cancel=function(){n.eventCanceled=!0};var r=e+"Global";ei.forEach(function(n){t[n.pluginName]&&(t[n.pluginName][r]&&t[n.pluginName][r](gt({sortable:t},i)),t.options[n.pluginName]&&t[n.pluginName][e]&&t[n.pluginName][e](gt({sortable:t},i)))})},initializePlugins:function(e,t,i,n){for(var r in ei.forEach(function(n){var r=n.pluginName;if(e.options[r]||n.initializeByDefault){var s=new n(e,t,e.options);s.sortable=e,s.options=e.options,e[r]=s,bt(i,s.defaults)}}),e.options)if(e.options.hasOwnProperty(r)){var s=this.modifyOption(e,r,e.options[r]);void 0!==s&&(e.options[r]=s)}},getEventProperties:function(e,t){var i={};return ei.forEach(function(n){"function"==typeof n.eventProperties&&bt(i,n.eventProperties.call(t[n.pluginName],e))}),i},modifyOption:function(e,t,i){var n;return ei.forEach(function(r){e[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[t]&&(n=r.optionListeners[t].call(e[r.pluginName],i))}),n}};var ni=["evt"],ri=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,r=yt(i,ni);ii.pluginEvent.bind(Qi)(e,t,gt({dragEl:oi,parentEl:ai,ghostEl:li,rootEl:ci,nextEl:di,lastDownEl:ui,cloneEl:hi,cloneHidden:pi,dragStarted:Oi,putSortable:yi,activeSortable:Qi.active,originalEvent:n,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi,hideGhostForTarget:Yi,unhideGhostForTarget:Ki,cloneNowHidden:function(){pi=!0},cloneNowShown:function(){pi=!1},dispatchSortableEvent:function(e){si({sortable:t,name:e,originalEvent:n})}},r))};function si(e){!function(e){var t=e.sortable,i=e.rootEl,n=e.name,r=e.targetEl,s=e.cloneEl,o=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,f=e.extraEventProperties;if(t=t||i&&i[Jt]){var g,m=t.options,v="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||wt||Et?(g=document.createEvent("Event")).initEvent(n,!0,!0):g=new CustomEvent(n,{bubbles:!0,cancelable:!0}),g.to=o||i,g.from=a||i,g.item=r||i,g.clone=s,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=u,g.originalEvent=h,g.pullMode=p?p.lastPutMode:void 0;var b=gt(gt({},f),ii.getEventProperties(n,t));for(var y in b)g[y]=b[y];i&&i.dispatchEvent(g),m[v]&&m[v].call(t,g)}}(gt({putSortable:yi,cloneEl:hi,targetEl:oi,rootEl:ci,oldIndex:fi,oldDraggableIndex:mi,newIndex:gi,newDraggableIndex:vi},e))}var oi,ai,li,ci,di,ui,hi,pi,fi,gi,mi,vi,bi,yi,_i,wi,Ei,Ai,Si,ki,Oi,Ci,Di,xi,Ti,Li=!1,Ii=!1,Mi=[],Fi=!1,Ni=!1,ji=[],Pi=!1,$i=[],Hi="undefined"!=typeof document,qi=kt,Ri=Et||wt?"cssFloat":"float",Bi=Hi&&!Ot&&!kt&&"draggable"in document.createElement("div"),Vi=function(){if(Hi){if(wt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),zi=function(e,t){var i=jt(e),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Bt(e,0,t),s=Bt(e,1,t),o=r&&jt(r),a=s&&jt(s),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+qt(r).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+qt(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&o.float&&"none"!==o.float){var d="left"===o.float?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return r&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=n&&"none"===i[Ri]||s&&"none"===i[Ri]&&l+c>n)?"vertical":"horizontal"},Wi=function(e){function t(e,i){return function(n,r,s,o){var a=n.options.group.name&&r.options.group.name&&n.options.group.name===r.options.group.name;if(null==e&&(i||a))return!0;if(null==e||!1===e)return!1;if(i&&"clone"===e)return e;if("function"==typeof e)return t(e(n,r,s,o),i)(n,r,s,o);var l=(i?n:r).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var i={},n=e.group;n&&"object"==mt(n)||(n={name:n}),i.name=n.name,i.checkPull=t(n.pull,!0),i.checkPut=t(n.put),i.revertClone=n.revertClone,e.group=i},Yi=function(){!Vi&&li&&jt(li,"display","none")},Ki=function(){!Vi&&li&&jt(li,"display","")};Hi&&!Ot&&document.addEventListener("click",function(e){if(Ii)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ii=!1,!1},!0);var Ui=function(e){if(oi){e=e.touches?e.touches[0]:e;var t=(r=e.clientX,s=e.clientY,Mi.some(function(e){var t=e[Jt].options.emptyInsertThreshold;if(t&&!Vt(e)){var i=qt(e),n=r>=i.left-t&&r<=i.right+t,a=s>=i.top-t&&s<=i.bottom+t;return n&&a?o=e:void 0}}),o);if(t){var i={};for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[Jt]._onDragOver(i)}}var r,s,o},Xi=function(e){oi&&oi.parentNode[Jt]._isOutsideThisEl(e.target)};function Qi(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=bt({},t),e[Jt]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zi(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Qi.supportPointer&&"PointerEvent"in window&&(!St||kt),emptyInsertThreshold:5};for(var n in ii.initializePlugins(this,e,i),i)!(n in t)&&(t[n]=i[n]);for(var r in Wi(t),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!t.forceFallback&&Bi,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Dt(e,"pointerdown",this._onTapStart):(Dt(e,"mousedown",this._onTapStart),Dt(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Dt(e,"dragover",this),Dt(e,"dragenter",this)),Mi.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),bt(this,Zt())}function Gi(e,t,i,n,r,s,o,a){var l,c,d=e[Jt],u=d.options.onMove;return!window.CustomEvent||wt||Et?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=i,l.draggedRect=n,l.related=r||t,l.relatedRect=s||qt(t),l.willInsertAfter=a,l.originalEvent=o,e.dispatchEvent(l),u&&(c=u.call(d,l,o)),c}function Ji(e){e.draggable=!1}function Zi(){Pi=!1}function en(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,n=0;i--;)n+=t.charCodeAt(i);return n.toString(36)}function tn(e){return setTimeout(e,0)}function nn(e){return clearTimeout(e)}Qi.prototype={constructor:Qi,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ci=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,oi):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,i=this.el,n=this.options,r=n.preventOnFilter,s=e.type,o=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,a=(o||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,c=n.filter;if(function(e){$i.length=0;var t=e.getElementsByTagName("input"),i=t.length;for(;i--;){var n=t[i];n.checked&&$i.push(n)}}(i),!oi&&!(/mousedown|pointerdown/.test(s)&&0!==e.button||n.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!St||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=It(a,n.draggable,i,!1))&&a.animated||ui===a)){if(fi=zt(a),mi=zt(a,n.draggable),"function"==typeof c){if(c.call(this,e,a,this))return si({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),ri("filter",t,{evt:e}),void(r&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(n){if(n=It(l,n.trim(),i,!1))return si({sortable:t,rootEl:n,name:"filter",targetEl:a,fromEl:i,toEl:i}),ri("filter",t,{evt:e}),!0})))return void(r&&e.preventDefault());n.handle&&!It(l,n.handle,i,!1)||this._prepareDragStart(e,o,a)}}},_prepareDragStart:function(e,t,i){var n,r=this,s=r.el,o=r.options,a=s.ownerDocument;if(i&&!oi&&i.parentNode===s){var l=qt(i);if(ci=s,ai=(oi=i).parentNode,di=oi.nextSibling,ui=i,bi=o.group,Qi.dragged=oi,_i={target:oi,clientX:(t||e).clientX,clientY:(t||e).clientY},Si=_i.clientX-l.left,ki=_i.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,oi.style["will-change"]="all",n=function(){ri("delayEnded",r,{evt:e}),Qi.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!At&&r.nativeDraggable&&(oi.draggable=!0),r._triggerDragStart(e,t),si({sortable:r,name:"choose",originalEvent:e}),Nt(oi,o.chosenClass,!0))},o.ignore.split(",").forEach(function(e){$t(oi,e.trim(),Ji)}),Dt(a,"dragover",Ui),Dt(a,"mousemove",Ui),Dt(a,"touchmove",Ui),o.supportPointer?(Dt(a,"pointerup",r._onDrop),!this.nativeDraggable&&Dt(a,"pointercancel",r._onDrop)):(Dt(a,"mouseup",r._onDrop),Dt(a,"touchend",r._onDrop),Dt(a,"touchcancel",r._onDrop)),At&&this.nativeDraggable&&(this.options.touchStartThreshold=4,oi.draggable=!0),ri("delayStart",this,{evt:e}),!o.delay||o.delayOnTouchOnly&&!t||this.nativeDraggable&&(Et||wt))n();else{if(Qi.eventCanceled)return void this._onDrop();o.supportPointer?(Dt(a,"pointerup",r._disableDelayedDrag),Dt(a,"pointercancel",r._disableDelayedDrag)):(Dt(a,"mouseup",r._disableDelayedDrag),Dt(a,"touchend",r._disableDelayedDrag),Dt(a,"touchcancel",r._disableDelayedDrag)),Dt(a,"mousemove",r._delayedDragTouchMoveHandler),Dt(a,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&Dt(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(n,o.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){oi&&Ji(oi),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;xt(e,"mouseup",this._disableDelayedDrag),xt(e,"touchend",this._disableDelayedDrag),xt(e,"touchcancel",this._disableDelayedDrag),xt(e,"pointerup",this._disableDelayedDrag),xt(e,"pointercancel",this._disableDelayedDrag),xt(e,"mousemove",this._delayedDragTouchMoveHandler),xt(e,"touchmove",this._delayedDragTouchMoveHandler),xt(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?Dt(document,"pointermove",this._onTouchMove):Dt(document,t?"touchmove":"mousemove",this._onTouchMove):(Dt(oi,"dragend",this),Dt(ci,"dragstart",this._onDragStart));try{document.selection?tn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(Li=!1,ci&&oi){ri("dragStarted",this,{evt:t}),this.nativeDraggable&&Dt(document,"dragover",Xi);var i=this.options;!e&&Nt(oi,i.dragClass,!1),Nt(oi,i.ghostClass,!0),Qi.active=this,e&&this._appendGhost(),si({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(wi){this._lastX=wi.clientX,this._lastY=wi.clientY,Yi();for(var e=document.elementFromPoint(wi.clientX,wi.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(wi.clientX,wi.clientY))!==t;)t=e;if(oi.parentNode[Jt]._isOutsideThisEl(e),t)do{if(t[Jt]){if(t[Jt]._onDragOver({clientX:wi.clientX,clientY:wi.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=Lt(t));Ki()}},_onTouchMove:function(e){if(_i){var t=this.options,i=t.fallbackTolerance,n=t.fallbackOffset,r=e.touches?e.touches[0]:e,s=li&&Pt(li,!0),o=li&&s&&s.a,a=li&&s&&s.d,l=qi&&Ti&&Wt(Ti),c=(r.clientX-_i.clientX+n.x)/(o||1)+(l?l[0]-ji[0]:0)/(o||1),d=(r.clientY-_i.clientY+n.y)/(a||1)+(l?l[1]-ji[1]:0)/(a||1);if(!Qi.active&&!Li){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<i)return;this._onDragStart(e,!0)}if(li){s?(s.e+=c-(Ei||0),s.f+=d-(Ai||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");jt(li,"webkitTransform",u),jt(li,"mozTransform",u),jt(li,"msTransform",u),jt(li,"transform",u),Ei=c,Ai=d,wi=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!li){var e=this.options.fallbackOnBody?document.body:ci,t=qt(oi,!0,qi,!0,e),i=this.options;if(qi){for(Ti=e;"static"===jt(Ti,"position")&&"none"===jt(Ti,"transform")&&Ti!==document;)Ti=Ti.parentNode;Ti!==document.body&&Ti!==document.documentElement?(Ti===document&&(Ti=Ht()),t.top+=Ti.scrollTop,t.left+=Ti.scrollLeft):Ti=Ht(),ji=Wt(Ti)}Nt(li=oi.cloneNode(!0),i.ghostClass,!1),Nt(li,i.fallbackClass,!0),Nt(li,i.dragClass,!0),jt(li,"transition",""),jt(li,"transform",""),jt(li,"box-sizing","border-box"),jt(li,"margin",0),jt(li,"top",t.top),jt(li,"left",t.left),jt(li,"width",t.width),jt(li,"height",t.height),jt(li,"opacity","0.8"),jt(li,"position",qi?"absolute":"fixed"),jt(li,"zIndex","100000"),jt(li,"pointerEvents","none"),Qi.ghost=li,e.appendChild(li),jt(li,"transform-origin",Si/parseInt(li.style.width)*100+"% "+ki/parseInt(li.style.height)*100+"%")}},_onDragStart:function(e,t){var i=this,n=e.dataTransfer,r=i.options;ri("dragStart",this,{evt:e}),Qi.eventCanceled?this._onDrop():(ri("setupClone",this),Qi.eventCanceled||((hi=Qt(oi)).removeAttribute("id"),hi.draggable=!1,hi.style["will-change"]="",this._hideClone(),Nt(hi,this.options.chosenClass,!1),Qi.clone=hi),i.cloneId=tn(function(){ri("clone",i),Qi.eventCanceled||(i.options.removeCloneOnHide||ci.insertBefore(hi,oi),i._hideClone(),si({sortable:i,name:"clone"}))}),!t&&Nt(oi,r.dragClass,!0),t?(Ii=!0,i._loopId=setInterval(i._emulateDragOver,50)):(xt(document,"mouseup",i._onDrop),xt(document,"touchend",i._onDrop),xt(document,"touchcancel",i._onDrop),n&&(n.effectAllowed="move",r.setData&&r.setData.call(i,n,oi)),Dt(document,"drop",i),jt(oi,"transform","translateZ(0)")),Li=!0,i._dragStartId=tn(i._dragStarted.bind(i,t,e)),Dt(document,"selectstart",i),Oi=!0,window.getSelection().removeAllRanges(),St&&jt(document.body,"user-select","none"))},_onDragOver:function(e){var t,i,n,r,s=this.el,o=e.target,a=this.options,l=a.group,c=Qi.active,d=bi===l,u=a.sort,h=yi||c,p=this,f=!1;if(!Pi){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),o=It(o,a.draggable,s,!0),x("dragOver"),Qi.eventCanceled)return f;if(oi.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return L(!1);if(Ii=!1,c&&!a.disabled&&(d?u||(n=ai!==ci):yi===this||(this.lastPutMode=bi.checkPull(this,c,oi,e))&&l.checkPut(this,c,oi,e))){if(r="vertical"===this._getDirection(e,o),t=qt(oi),x("dragOverValid"),Qi.eventCanceled)return f;if(n)return ai=ci,T(),this._hideClone(),x("revert"),Qi.eventCanceled||(di?ci.insertBefore(oi,di):ci.appendChild(oi)),L(!0);var g=Vt(s,a.draggable);if(!g||function(e,t,i){var n=qt(Vt(i.el,i.options.draggable)),r=Gt(i.el,i.options,li),s=10;return t?e.clientX>r.right+s||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>r.bottom+s||e.clientX>n.right&&e.clientY>n.top}(e,r,this)&&!g.animated){if(g===oi)return L(!1);if(g&&s===e.target&&(o=g),o&&(i=qt(o)),!1!==Gi(ci,s,oi,t,o,i,e,!!o))return T(),g&&g.nextSibling?s.insertBefore(oi,g.nextSibling):s.appendChild(oi),ai=s,I(),L(!0)}else if(g&&function(e,t,i){var n=qt(Bt(i.el,0,i.options,!0)),r=Gt(i.el,i.options,li),s=10;return t?e.clientX<r.left-s||e.clientY<n.top&&e.clientX<n.right:e.clientY<r.top-s||e.clientY<n.bottom&&e.clientX<n.left}(e,r,this)){var m=Bt(s,0,a,!0);if(m===oi)return L(!1);if(i=qt(o=m),!1!==Gi(ci,s,oi,t,o,i,e,!1))return T(),s.insertBefore(oi,m),ai=s,I(),L(!0)}else if(o.parentNode===s){i=qt(o);var v,b,y,_=oi.parentNode!==s,w=!function(e,t,i){var n=i?e.left:e.top,r=i?e.right:e.bottom,s=i?e.width:e.height,o=i?t.left:t.top,a=i?t.right:t.bottom,l=i?t.width:t.height;return n===o||r===a||n+s/2===o+l/2}(oi.animated&&oi.toRect||t,o.animated&&o.toRect||i,r),E=r?"top":"left",A=Rt(o,"top","top")||Rt(oi,"top","top"),S=A?A.scrollTop:void 0;if(Ci!==o&&(b=i[E],Fi=!1,Ni=!w&&a.invertSwap||_),v=function(e,t,i,n,r,s,o,a){var l=n?e.clientY:e.clientX,c=n?i.height:i.width,d=n?i.top:i.left,u=n?i.bottom:i.right,h=!1;if(!o)if(a&&xi<c*r){if(!Fi&&(1===Di?l>d+c*s/2:l<u-c*s/2)&&(Fi=!0),Fi)h=!0;else if(1===Di?l<d+xi:l>u-xi)return-Di}else if(l>d+c*(1-r)/2&&l<u-c*(1-r)/2)return function(e){return zt(oi)<zt(e)?1:-1}(t);if((h=h||o)&&(l<d+c*s/2||l>u-c*s/2))return l>d+c/2?1:-1;return 0}(e,o,i,r,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Ni,Ci===o),0!==v){var k=zt(oi);do{k-=v,y=ai.children[k]}while(y&&("none"===jt(y,"display")||y===li))}if(0===v||y===o)return L(!1);Ci=o,Di=v;var O=o.nextElementSibling,C=!1,D=Gi(ci,s,oi,t,o,i,e,C=1===v);if(!1!==D)return 1!==D&&-1!==D||(C=1===D),Pi=!0,setTimeout(Zi,30),T(),C&&!O?s.appendChild(oi):o.parentNode.insertBefore(oi,C?O:o),A&&Xt(A,0,S-A.scrollTop),ai=oi.parentNode,void 0===b||Ni||(xi=Math.abs(b-qt(o)[E])),I(),L(!0)}if(s.contains(oi))return L(!1)}return!1}function x(a,l){ri(a,p,gt({evt:e,isOwner:d,axis:r?"vertical":"horizontal",revert:n,dragRect:t,targetRect:i,canSort:u,fromSortable:h,target:o,completed:L,onMove:function(i,n){return Gi(ci,s,oi,t,i,qt(i),e,n)},changed:I},l))}function T(){x("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function L(t){return x("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(p),p!==h&&(Nt(oi,yi?yi.options.ghostClass:c.options.ghostClass,!1),Nt(oi,a.ghostClass,!0)),yi!==p&&p!==Qi.active?yi=p:p===Qi.active&&yi&&(yi=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){x("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===oi&&!oi.animated||o===s&&!o.animated)&&(Ci=null),a.dragoverBubble||e.rootEl||o===document||(oi.parentNode[Jt]._isOutsideThisEl(e.target),!t&&Ui(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function I(){gi=zt(oi),vi=zt(oi,a.draggable),si({sortable:p,name:"change",toEl:s,newIndex:gi,newDraggableIndex:vi,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){xt(document,"mousemove",this._onTouchMove),xt(document,"touchmove",this._onTouchMove),xt(document,"pointermove",this._onTouchMove),xt(document,"dragover",Ui),xt(document,"mousemove",Ui),xt(document,"touchmove",Ui)},_offUpEvents:function(){var e=this.el.ownerDocument;xt(e,"mouseup",this._onDrop),xt(e,"touchend",this._onDrop),xt(e,"pointerup",this._onDrop),xt(e,"pointercancel",this._onDrop),xt(e,"touchcancel",this._onDrop),xt(document,"selectstart",this)},_onDrop:function(e){var t=this.el,i=this.options;gi=zt(oi),vi=zt(oi,i.draggable),ri("drop",this,{evt:e}),ai=oi&&oi.parentNode,gi=zt(oi),vi=zt(oi,i.draggable),Qi.eventCanceled||(Li=!1,Ni=!1,Fi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),nn(this.cloneId),nn(this._dragStartId),this.nativeDraggable&&(xt(document,"drop",this),xt(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),St&&jt(document.body,"user-select",""),jt(oi,"transform",""),e&&(Oi&&(e.cancelable&&e.preventDefault(),!i.dropBubble&&e.stopPropagation()),li&&li.parentNode&&li.parentNode.removeChild(li),(ci===ai||yi&&"clone"!==yi.lastPutMode)&&hi&&hi.parentNode&&hi.parentNode.removeChild(hi),oi&&(this.nativeDraggable&&xt(oi,"dragend",this),Ji(oi),oi.style["will-change"]="",Oi&&!Li&&Nt(oi,yi?yi.options.ghostClass:this.options.ghostClass,!1),Nt(oi,this.options.chosenClass,!1),si({sortable:this,name:"unchoose",toEl:ai,newIndex:null,newDraggableIndex:null,originalEvent:e}),ci!==ai?(gi>=0&&(si({rootEl:ai,name:"add",toEl:ai,fromEl:ci,originalEvent:e}),si({sortable:this,name:"remove",toEl:ai,originalEvent:e}),si({rootEl:ai,name:"sort",toEl:ai,fromEl:ci,originalEvent:e}),si({sortable:this,name:"sort",toEl:ai,originalEvent:e})),yi&&yi.save()):gi!==fi&&gi>=0&&(si({sortable:this,name:"update",toEl:ai,originalEvent:e}),si({sortable:this,name:"sort",toEl:ai,originalEvent:e})),Qi.active&&(null!=gi&&-1!==gi||(gi=fi,vi=mi),si({sortable:this,name:"end",toEl:ai,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){ri("nulling",this),ci=oi=ai=li=di=hi=ui=pi=_i=wi=Oi=gi=vi=fi=mi=Ci=Di=yi=bi=Qi.dragged=Qi.ghost=Qi.clone=Qi.active=null,$i.forEach(function(e){e.checked=!0}),$i.length=Ei=Ai=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":oi&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],i=this.el.children,n=0,r=i.length,s=this.options;n<r;n++)It(e=i[n],s.draggable,this.el,!1)&&t.push(e.getAttribute(s.dataIdAttr)||en(e));return t},sort:function(e,t){var i={},n=this.el;this.toArray().forEach(function(e,t){var r=n.children[t];It(r,this.options.draggable,n,!1)&&(i[e]=r)},this),t&&this.captureAnimationState(),e.forEach(function(e){i[e]&&(n.removeChild(i[e]),n.appendChild(i[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return It(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var i=this.options;if(void 0===t)return i[e];var n=ii.modifyOption(this,e,t);i[e]=void 0!==n?n:t,"group"===e&&Wi(i)},destroy:function(){ri("destroy",this);var e=this.el;e[Jt]=null,xt(e,"mousedown",this._onTapStart),xt(e,"touchstart",this._onTapStart),xt(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(xt(e,"dragover",this),xt(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Mi.splice(Mi.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!pi){if(ri("hideClone",this),Qi.eventCanceled)return;jt(hi,"display","none"),this.options.removeCloneOnHide&&hi.parentNode&&hi.parentNode.removeChild(hi),pi=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(pi){if(ri("showClone",this),Qi.eventCanceled)return;oi.parentNode!=ci||this.options.group.revertClone?di?ci.insertBefore(hi,di):ci.appendChild(hi):ci.insertBefore(hi,oi),this.options.group.revertClone&&this.animate(oi,hi),jt(hi,"display",""),pi=!1}}else this._hideClone()}},Hi&&Dt(document,"touchmove",function(e){(Qi.active||Li)&&e.cancelable&&e.preventDefault()}),Qi.utils={on:Dt,off:xt,css:jt,find:$t,is:function(e,t){return!!It(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},throttle:Ut,closest:It,toggleClass:Nt,clone:Qt,index:zt,nextTick:tn,cancelNextTick:nn,detectDirection:zi,getChild:Bt,expando:Jt},Qi.get=function(e){return e[Jt]},Qi.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Qi.utils=gt(gt({},Qi.utils),e.utils)),ii.mount(e)})},Qi.create=function(e,t){return new Qi(e,t)},Qi.version="1.15.6";var rn,sn,on,an,ln,cn,dn=[],un=!1;function hn(){dn.forEach(function(e){clearInterval(e.pid)}),dn=[]}function pn(){clearInterval(cn)}var fn=Ut(function(e,t,i,n){if(t.scroll){var r,s=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,c=Ht(),d=!1;sn!==i&&(sn=i,hn(),rn=t.scroll,r=t.scrollFn,!0===rn&&(rn=Yt(i,!0)));var u=0,h=rn;do{var p=h,f=qt(p),g=f.top,m=f.bottom,v=f.left,b=f.right,y=f.width,_=f.height,w=void 0,E=void 0,A=p.scrollWidth,S=p.scrollHeight,k=jt(p),O=p.scrollLeft,C=p.scrollTop;p===c?(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX||"visible"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY||"visible"===k.overflowY)):(w=y<A&&("auto"===k.overflowX||"scroll"===k.overflowX),E=_<S&&("auto"===k.overflowY||"scroll"===k.overflowY));var D=w&&(Math.abs(b-s)<=a&&O+y<A)-(Math.abs(v-s)<=a&&!!O),x=E&&(Math.abs(m-o)<=a&&C+_<S)-(Math.abs(g-o)<=a&&!!C);if(!dn[u])for(var T=0;T<=u;T++)dn[T]||(dn[T]={});dn[u].vx==D&&dn[u].vy==x&&dn[u].el===p||(dn[u].el=p,dn[u].vx=D,dn[u].vy=x,clearInterval(dn[u].pid),0==D&&0==x||(d=!0,dn[u].pid=setInterval(function(){n&&0===this.layer&&Qi.active._onTouchMove(ln);var t=dn[this.layer].vy?dn[this.layer].vy*l:0,i=dn[this.layer].vx?dn[this.layer].vx*l:0;"function"==typeof r&&"continue"!==r.call(Qi.dragged.parentNode[Jt],i,t,e,ln,dn[this.layer].el)||Xt(dn[this.layer].el,i,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&h!==c&&(h=Yt(h,!1)));un=d}},30),gn=function(e){var t=e.originalEvent,i=e.putSortable,n=e.dragEl,r=e.activeSortable,s=e.dispatchSortableEvent,o=e.hideGhostForTarget,a=e.unhideGhostForTarget;if(t){var l=i||r;o();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(s("spill"),this.onSpill({dragEl:n,putSortable:i}))}};function mn(){}function vn(){}mn.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,i=e.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var n=Bt(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(t,n):this.sortable.el.appendChild(t),this.sortable.animateAll(),i&&i.animateAll()},drop:gn},bt(mn,{pluginName:"revertOnSpill"}),vn.prototype={onSpill:function(e){var t=e.dragEl,i=e.putSortable||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:gn},bt(vn,{pluginName:"removeOnSpill"}),Qi.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?Dt(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Dt(document,"pointermove",this._handleFallbackAutoScroll):t.touches?Dt(document,"touchmove",this._handleFallbackAutoScroll):Dt(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?xt(document,"dragover",this._handleAutoScroll):(xt(document,"pointermove",this._handleFallbackAutoScroll),xt(document,"touchmove",this._handleFallbackAutoScroll),xt(document,"mousemove",this._handleFallbackAutoScroll)),pn(),hn(),clearTimeout(Mt),Mt=void 0},nulling:function(){ln=sn=rn=un=cn=on=an=null,dn.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var i=this,n=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,s=document.elementFromPoint(n,r);if(ln=e,t||this.options.forceAutoScrollFallback||Et||wt||St){fn(e,this.options,s,t);var o=Yt(s,!0);!un||cn&&n===on&&r===an||(cn&&pn(),cn=setInterval(function(){var s=Yt(document.elementFromPoint(n,r),!0);s!==o&&(o=s,hn()),fn(e,i.options,s,t)},10),on=n,an=r)}else{if(!this.options.bubbleScroll||Yt(s,!0)===Ht())return void hn();fn(e,this.options,Yt(s,!1),!1)}}},bt(e,{pluginName:"scroll",initializeByDefault:!0})}),Qi.mount(vn,mn);class bn{initSortable(e){const t=e.el.querySelector("[data-sortable]");t&&new Qi(t,{handle:".handle-sort",draggable:"tr",sort:!0,direction:"vertical",async onEnd({item:t}){var i,n,r,s,o,a;const l=t.getAttribute("data-id");if(l){const c=null!==(n=null===(i=t.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-id"))&&void 0!==n?n:null,d=null!==(s=null===(r=t.nextElementSibling)||void 0===r?void 0:r.getAttribute("data-id"))&&void 0!==s?s:null,u=e.el.querySelector("tbody");if(u){let t=null!==(o=u.getAttribute("data-sortable-parent-path"))&&void 0!==o?o:"";t.length&&(t=`${t}-`);const i=null!==(a=u.getAttribute("data-sortable-url"))&&void 0!==a?a:"?do=sort",n={[`${t}item_id`]:l,...c?{[`${t}prev_id`]:c}:{},...d?{[`${t}next_id`]:d}:{}};return await e.ajax.request({method:"GET",url:i,data:n})}}}})}initSortableTree(e){e.el.querySelectorAll(".datagrid-tree-item-children").forEach(e=>{new Qi(e,{handle:".handle-sort",draggable:".datagrid-tree-item:not(.datagrid-tree-header)",async onEnd({item:e}){}})})}}class yn{constructor(e,t={}){this.select=e,this.opts=t}initSelectpickers(e){var t,i,n;const r=null!==(n=null!==(t=this.select)&&void 0!==t?t:null===(i=w())||void 0===i?void 0:i.TomSelect)&&void 0!==n?n:null;r&&e.forEach(e=>{e.hasAttribute("data-Tom-Initialised")||(e.setAttribute("data-Tom-Initialised","true"),new r(e,"function"==typeof this.opts?this.opts(e):this.opts))})}}function _n(e){return e[e.length-1]}function wn(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function En(e,t){return e?e.split(t):[]}function An(e,t,i){return(void 0===t||e>=t)&&(void 0===i||e<=i)}function Sn(e,t,i){return e<t?t:e>i?i:e}function kn(e,t,i={},n=0,r=""){r+=`<${Object.keys(i).reduce((e,t)=>{let r=i[t];return"function"==typeof r&&(r=r(n)),`${e} ${t}="${r}"`},e)}></${e}>`;const s=n+1;return s<t?kn(e,t,i,s,r):r}function On(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function Cn(e){return new Date(e).setHours(0,0,0,0)}function Dn(){return(new Date).setHours(0,0,0,0)}function xn(...e){switch(e.length){case 0:return Dn();case 1:return Cn(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function Tn(e,t){const i=new Date(e);return i.setDate(i.getDate()+t)}function Ln(e,t){const i=new Date(e),n=i.getMonth()+t;let r=n%12;r<0&&(r+=12);const s=i.setMonth(n);return i.getMonth()!==r?i.setDate(0):s}function In(e,t){const i=new Date(e),n=i.getMonth(),r=i.setFullYear(i.getFullYear()+t);return 1===n&&2===i.getMonth()?i.setDate(0):r}function Mn(e,t){return(e-t+7)%7}function Fn(e,t,i=0){const n=new Date(e).getDay();return Tn(e,Mn(t,i)-Mn(n,i))}function Nn(e,t){return Math.round((e-t)/6048e5)+1}function jn(e){const t=Fn(e,4,1);return Nn(t,Fn(new Date(t).setMonth(0,4),4,1))}function Pn(e,t){const i=Fn(new Date(e).setMonth(0,1),t,t),n=Fn(e,t,t),r=Nn(n,i);if(r<53)return r;return n===Fn(new Date(e).setDate(32),t,t)?1:r}function $n(e){return Pn(e,0)}function Hn(e){return Pn(e,6)}function qn(e,t){const i=new Date(e).getFullYear();return Math.floor(i/t)*t}function Rn(e,t,i){if(1!==t&&2!==t)return e;const n=new Date(e);return 1===t?i?n.setMonth(n.getMonth()+1,0):n.setDate(1):i?n.setFullYear(n.getFullYear()+1,0,0):n.setMonth(0,1),n.setHours(0,0,0,0)}const Bn=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,Vn=/[\s!-/:-@[-`{-~年月日]+/;let zn={};const Wn={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,i){const n=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),n=t=>t.toLowerCase().startsWith(e);if(r=i.monthsShort.findIndex(n),r<0&&(r=i.months.findIndex(n)),r<0)return NaN}return n.setMonth(r),n.getMonth()!==Kn(r)?n.setDate(0):n.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},Yn={d:e=>e.getDate(),dd:e=>Un(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>Un(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>Un(e.getFullYear(),2).slice(-2),yyyy:e=>Un(e.getFullYear(),4)};function Kn(e){return e>-1?e%12:Kn(e+12)}function Un(e,t){return e.toString().padStart(t,"0")}function Xn(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in zn)return zn[e];const t=e.split(Bn),i=e.match(new RegExp(Bn,"g"));if(0===t.length||!i)throw new Error("Invalid date format.");const n=i.map(e=>Yn[e]),r=Object.keys(Wn).reduce((e,t)=>(i.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return zn[e]={parser(e,t){const n=e.split(Vn).reduce((e,t,n)=>{if(t.length>0&&i[n]){const r=i[n][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,i)=>{const r=Wn[i](e,n[i],t);return isNaN(r)?e:r},Dn())},formatter(e,i){let r=n.reduce((n,r,s)=>n+`${t[s]}${r(e,i)}`,"");return r+_n(t)}}}function Qn(e,t,i){if(e instanceof Date||"number"==typeof e){const t=Cn(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return Dn();if(t&&t.toValue){const n=t.toValue(e,t,i);return isNaN(n)?void 0:Cn(n)}return Xn(t).parser(e,i)}}function Gn(e,t,i){if(isNaN(e)||!e&&0!==e)return"";const n="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(n,t,i):Xn(t).formatter(n,i)}const Jn=document.createRange();function Zn(e){return Jn.createContextualFragment(e)}function er(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function tr(e){return e.getRootNode().activeElement===e}function ir(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function nr(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function rr(e){e.firstChild&&(e.removeChild(e.firstChild),rr(e))}const sr=new WeakMap,{addEventListener:or,removeEventListener:ar}=EventTarget.prototype;function lr(e,t){let i=sr.get(e);i||(i=[],sr.set(e,i)),t.forEach(e=>{or.call(...e),i.push(e)})}if(!Event.prototype.composedPath){const e=(t,i=[])=>{let n;return i.push(t),t.parentNode?n=t.parentNode:t.host?n=t.host:t.defaultView&&(n=t.defaultView),n?e(n,i):i};Event.prototype.composedPath=function(){return e(this.target)}}function cr(e,t,i){const[n,...r]=e;return t(n)?n:n!==i&&"HTML"!==n.tagName&&0!==r.length?cr(r,t,i):void 0}function dr(e,t){const i="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return cr(e.composedPath(),i,e.currentTarget)}var ur={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},hr={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:pr,format:fr,weekStart:gr}=hr;function mr(e,t){return e.length<6&&t>=0&&t<7?wn(e,t):e}function vr(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return jn;case 2:return $n;case 3:return Hn}}function br(e,t,i){return t.weekStart=e,t.weekEnd=(e+6)%7,4===i&&(t.getWeekNumber=vr(4,e)),e}function yr(e,t,i,n){const r=Qn(e,t,i);return void 0!==r?r:n}function _r(e,t,i=3){const n=parseInt(e,10);return n>=0&&n<=i?n:t}function wr(e,t,i,n=void 0){t in e&&(i in e||(e[i]=n?n(e[t]):e[t]),delete e[t])}function Er(e,t){const i=Object.assign({},e),n={},r=t.constructor.locales,s=!!t.rangeSideIndex;let{datesDisabled:o,format:a,language:l,locale:c,maxDate:d,maxView:u,minDate:h,pickLevel:p,startView:f,weekNumbers:g,weekStart:m}=t.config||{};if(wr(i,"calendarWeeks","weekNumbers",e=>e?1:0),wr(i,"clearBtn","clearButton"),wr(i,"todayBtn","todayButton"),wr(i,"todayBtnMode","todayButtonMode"),i.language){let e;if(i.language!==l&&(r[i.language]?e=i.language:(e=i.language.split("-")[0],r[e]||(e=!1))),delete i.language,e){l=n.language=e;const t=c||r[pr];c=Object.assign({format:fr,weekStart:gr},r[pr]),l!==pr&&Object.assign(c,r[l]),n.locale=c,a===t.format&&(a=n.format=c.format),m===t.weekStart&&(m=br(c.weekStart,n,g))}}if(i.format){const e="function"==typeof i.format.toDisplay,t="function"==typeof i.format.toValue,r=Bn.test(i.format);(e&&t||r)&&(a=n.format=i.format),delete i.format}let v=p;"pickLevel"in i&&(v=_r(i.pickLevel,p,2),delete i.pickLevel),v!==p&&(v>p&&("minDate"in i||(i.minDate=h),"maxDate"in i||(i.maxDate=d)),o&&!i.datesDisabled&&(i.datesDisabled=[]),p=n.pickLevel=v);let b=h,y=d;if("minDate"in i){const e=xn(0,0,1);b=null===i.minDate?e:yr(i.minDate,a,c,b),b!==e&&(b=Rn(b,p,!1)),delete i.minDate}if("maxDate"in i&&(y=null===i.maxDate?void 0:yr(i.maxDate,a,c,y),void 0!==y&&(y=Rn(y,p,!0)),delete i.maxDate),y<b?(h=n.minDate=y,d=n.maxDate=b):(h!==b&&(h=n.minDate=b),d!==y&&(d=n.maxDate=y)),i.datesDisabled){const e=i.datesDisabled;if("function"==typeof e)n.datesDisabled=null,n.checkDisabled=(t,i)=>e(new Date(t),i,s);else{const t=n.datesDisabled=e.reduce((e,t)=>{const i=Qn(t,a,c);return void 0!==i?wn(e,Rn(i,p,s)):e},[]);n.checkDisabled=e=>t.includes(e)}delete i.datesDisabled}if("defaultViewDate"in i){const e=Qn(i.defaultViewDate,a,c);void 0!==e&&(n.defaultViewDate=e),delete i.defaultViewDate}if("weekStart"in i){const e=Number(i.weekStart)%7;isNaN(e)||(m=br(e,n,g)),delete i.weekStart}if(i.daysOfWeekDisabled&&(n.daysOfWeekDisabled=i.daysOfWeekDisabled.reduce(mr,[]),delete i.daysOfWeekDisabled),i.daysOfWeekHighlighted&&(n.daysOfWeekHighlighted=i.daysOfWeekHighlighted.reduce(mr,[]),delete i.daysOfWeekHighlighted),"weekNumbers"in i){let e=i.weekNumbers;if(e){const t="function"==typeof e?(t,i)=>e(new Date(t),i):vr(e=parseInt(e,10),m);t&&(g=n.weekNumbers=e,n.getWeekNumber=t)}else g=n.weekNumbers=0,n.getWeekNumber=null;delete i.weekNumbers}if("maxNumberOfDates"in i){const e=parseInt(i.maxNumberOfDates,10);e>=0&&(n.maxNumberOfDates=e,n.multidate=1!==e),delete i.maxNumberOfDates}i.dateDelimiter&&(n.dateDelimiter=String(i.dateDelimiter),delete i.dateDelimiter);let _=u;"maxView"in i&&(_=_r(i.maxView,u),delete i.maxView),_=p>_?p:_,_!==u&&(u=n.maxView=_);let w=f;if("startView"in i&&(w=_r(i.startView,w),delete i.startView),w<p?w=p:w>u&&(w=u),w!==f&&(n.startView=w),i.prevArrow){const e=Zn(i.prevArrow);e.childNodes.length>0&&(n.prevArrow=e.childNodes),delete i.prevArrow}if(i.nextArrow){const e=Zn(i.nextArrow);e.childNodes.length>0&&(n.nextArrow=e.childNodes),delete i.nextArrow}if("disableTouchKeyboard"in i&&(n.disableTouchKeyboard="ontouchstart"in document&&!!i.disableTouchKeyboard,delete i.disableTouchKeyboard),i.orientation){const e=i.orientation.toLowerCase().split(/\s+/g);n.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete i.orientation}if("todayButtonMode"in i){switch(i.todayButtonMode){case 0:case 1:n.todayButtonMode=i.todayButtonMode}delete i.todayButtonMode}return Object.entries(i).forEach(([e,t])=>{void 0!==t&&e in hr&&(n[e]=t)}),n}const Ar={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};const Sr=e=>e.map(e=>`<button type="button" class="%buttonClass% ${e}" tabindex="-1"></button>`).join("");var kr=On(`<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n ${Sr(["prev-button prev-btn","view-switch","next-button next-btn"])}\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n ${Sr(["today-button today-btn","clear-button clear-btn"])}\n </div>\n </div>\n </div>\n</div>`),Or=On(`<div class="days">\n <div class="days-of-week">${kn("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${kn("span",42)}</div>\n</div>`),Cr=On(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${kn("span",6,{class:"week"})}</div>\n</div>`);class Dr{constructor(e,t){Object.assign(this,t,{picker:e,element:Zn('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,i){this.disabled=[];const n=this.picker;n.setViewSwitchLabel(e),n.setPrevButtonDisabled(t),n.setNextButtonDisabled(i)}setDisabled(e,t){t.add("disabled"),wn(this.disabled,e)}performBeforeHook(e,t){let i=this.beforeShow(new Date(t));switch(typeof i){case"boolean":i={enabled:i};break;case"string":i={classes:i}}if(i){const n=e.classList;if(!1===i.enabled&&this.setDisabled(t,n),i.classes){const e=i.classes.split(/\s+/);n.add(...e),e.includes("disabled")&&this.setDisabled(t,n)}i.content&&function(e,t){rr(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(Zn(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,i.content)}}renderCell(e,t,i,n,{selected:r,range:s},o,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=n);const l=e.classList;if(e.className=`datepicker-cell ${this.cellClass}`,i<this.first?l.add("prev"):i>this.last&&l.add("next"),l.add(...a),(o||this.checkDisabled(n,this.id))&&this.setDisabled(n,l),s){const[e,t]=s;i>e&&i<t&&l.add("range"),i===e&&l.add("range-start"),i===t&&l.add("range-end")}r.includes(i)&&l.add("selected"),i===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,n)}refreshCell(e,t,i,[n,r]){const s=e.classList;s.remove("range","range-start","range-end","selected","focused"),t>n&&t<r&&s.add("range"),t===n&&s.add("range-start"),t===r&&s.add("range-end"),i.includes(t)&&s.add("selected"),t===this.focused&&s.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class xr extends Dr{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=Zn(Or).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const i=this.locale=e.locale;this.dayNames=i.daysMin,this.switchLabelFormat=i.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=Zn(Cr).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(nr(this.dow),this.weekNumbers&&nr(this.weekNumbers.dow)):(ir(this.dow),this.weekNumbers&&ir(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const i=(this.weekStart+t)%7;e.textContent=this.dayNames[i],e.className=this.daysOfWeekDisabled.includes(i)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),i=e.getMonth(),n=xn(t,i,1),r=Fn(n,this.weekStart,this.weekStart);this.first=n,this.last=xn(t,i+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?Dn():void 0,this.prepareForRender(Gn(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=Fn(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((i,n)=>{const r=Tn(t,7*n);i.textContent=this.getWeekNumber(r,e),n>3&&i.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const i=Tn(this.start,t),n=new Date(i),r=n.getDay(),s=[];this.today===i&&s.push("today"),this.daysOfWeekHighlighted.includes(r)&&s.push("highlighted"),this.renderCell(e,n.getDate(),i,i,this,i<this.minDate||i>this.maxDate||this.daysOfWeekDisabled.includes(r),s)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function Tr(e,t){if(!e||!e[0]||!e[1])return;const[[i,n],[r,s]]=e;return i>t||r<t?void 0:[i===t?n:-1,r===t?s:12]}class Lr extends Dr{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(Zn(kn("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=xn(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const i=new Date(t),n=i.getFullYear(),r=i.getMonth();return void 0===e[n]?e[n]=[r]:wn(e[n],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,i=this.year===this.minYear,n=this.year===this.maxYear,r=Tr(this.range,this.year);Array.from(this.grid.children).forEach((s,o)=>{const a=Rn(new Date(this.year,o,1),1,this.isRangeEnd);this.renderCell(s,this.monthNames[o],o,a,{selected:e,range:r},t||i&&o<this.minMonth||n&&o>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=Tr(this.range,this.year)||[];Array.from(this.grid.children).forEach((i,n)=>{this.refreshCell(i,n,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class Ir extends Dr{constructor(e,t){super(e,t)}init(e,t=!0){var i;t&&(this.navStep=10*this.step,this.beforeShowOption=`beforeShow${i=this.cellClass,[...i].reduce((e,t,i)=>e+(i?t:t.toUpperCase()),"")}`,this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(Zn(kn("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=qn(e.minDate,this.step),this.minDate=xn(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=qn(e.maxDate,this.step),this.maxDate=xn(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=qn(e,this.navStep),i=t+9*this.step;this.first=t,this.last=i,this.start=t-this.step,this.focused=qn(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>wn(e,qn(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return qn(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const i=this.start+t*this.step,n=Rn(new Date(i,0,1),2,this.isRangeEnd);e.dataset.year=i,this.renderCell(e,i,i,n,this,i<this.minYear||i>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function Mr(e,t){const i={bubbles:!0,cancelable:!0,detail:{date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e}};e.element.dispatchEvent(new CustomEvent(t,i))}function Fr(e,t){const{config:i,picker:n}=e,{currentView:r,viewDate:s}=n;let o;switch(r.id){case 0:o=Ln(s,t);break;case 1:o=In(s,t);break;default:o=In(s,t*r.navStep)}o=Sn(o,i.minDate,i.maxDate),n.changeFocus(o).render()}function Nr(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function jr(e){e.setDate({clear:!0})}function Pr(e){const t=Dn();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function $r(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},i=e.element;tr(i)?i.addEventListener("blur",t,{once:!0}):t()}function Hr(e,t){const i=e.picker,n=new Date(i.viewDate),r=i.currentView.id,s=1===r?Ln(n,t-n.getMonth()):In(n,t-n.getFullYear());i.changeFocus(s).changeView(r-1).render()}function qr(e){Nr(e)}function Rr(e){Fr(e,-1)}function Br(e){Fr(e,1)}function Vr(e,t){const i=dr(t,".datepicker-cell");if(!i||i.classList.contains("disabled"))return;const{id:n,isMinView:r}=e.picker.currentView,s=i.dataset;r?e.setDate(Number(s.date)):Hr(e,Number(1===n?s.month:s.year))}function zr(e){e.preventDefault()}const Wr=["left","top","right","bottom"].reduce((e,t)=>(e[t]=`datepicker-orient-${t}`,e),{}),Yr=e=>e?`${e}px`:e;function Kr(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,nr(e.controls.title)):(e.controls.title.textContent="",ir(e.controls.title))),t.prevArrow){const i=e.controls.prevButton;rr(i),t.prevArrow.forEach(e=>{i.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const i=e.controls.nextButton;rr(i),t.nextArrow.forEach(e=>{i.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?nr(e.controls.todayButton):ir(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:i}=e.datepicker.config;e.controls.todayButton.disabled=!An(Dn(),t,i)}"clearButton"in t&&(t.clearButton?nr(e.controls.clearButton):ir(e.controls.clearButton))}function Ur(e){const{dates:t,config:i,rangeSideIndex:n}=e;return Sn(t.length>0?_n(t):Rn(i.defaultViewDate,i.pickLevel,n),i.minDate,i.maxDate)}function Xr(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:i,year:n,first:r,last:s}=e.currentView,o=new Date(t).getFullYear();switch(i){case 0:return t<r||t>s;case 1:return o!==n;default:return o<r||o>s}}function Qr(e){return window.getComputedStyle(e).direction}function Gr(e){const t=er(e);if(t!==document.body&&t)return"visible"!==window.getComputedStyle(t).overflow?t:Gr(t)}class Jr{constructor(e){const{config:t,inputField:i}=this.datepicker=e,n=kr.replace(/%buttonClass%/g,t.buttonClass),r=this.element=Zn(n).firstChild,[s,o,a]=r.firstChild.children,l=s.firstElementChild,[c,d,u]=s.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:d,nextButton:u,todayButton:h,clearButton:p};this.main=o,this.controls=f;const g=i?"dropdown":"inline";r.classList.add(`datepicker-${g}`),Kr(this,t),this.viewDate=Ur(e),lr(e,[[r,"mousedown",zr],[o,"click",Vr.bind(null,e)],[f.viewSwitch,"click",qr.bind(null,e)],[f.prevButton,"click",Rr.bind(null,e)],[f.nextButton,"click",Br.bind(null,e)],[f.todayButton,"click",Pr.bind(null,e)],[f.clearButton,"click",jr.bind(null,e)]]),this.views=[new xr(this),new Lr(this),new Ir(this,{id:2,name:"years",cellClass:"year",step:1}),new Ir(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):i.after(this.element)}setOptions(e){Kr(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,i=e.inputField;if(i){const n=Qr(i);n!==Qr(er(t))?t.dir=n:t.dir&&t.removeAttribute("dir"),this.place(),t.classList.add("active"),e.config.disableTouchKeyboard&&i.blur()}else t.classList.add("active");this.active=!0,Mr(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Mr(this.datepicker,"hide"))}place(){const{classList:e,style:t}=this.element;t.display="block";const{width:i,height:n}=this.element.getBoundingClientRect(),r=this.element.offsetParent;t.display="";const{config:s,inputField:o}=this.datepicker,{left:a,top:l,right:c,bottom:d,width:u,height:h}=o.getBoundingClientRect();let{x:p,y:f}=s.orientation,g=a,m=l;if(r!==document.body&&r){const e=r.getBoundingClientRect();g-=e.left-r.scrollLeft,m-=e.top-r.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=Gr(o);let b=0,y=0,{clientWidth:_,clientHeight:w}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(y=e.top),e.left>0&&(b=e.left),e.right<_&&(_=e.right),e.bottom<w&&(w=e.bottom)}let E=0;"auto"===p&&(a<b?(p="left",E=b-a):a+i>_?(p="right",_<c&&(E=_-c)):p="rtl"===Qr(o)?c-i<b?"left":"right":"left"),"right"===p&&(g+=u-i),g+=E,"auto"===f&&(f=l-n>y&&d+n>w?"top":"bottom"),"top"===f?m-=n:m+=h,e.remove(...Object.values(Wr)),e.add(Wr[p],Wr[f]),t.left=Yr(g),t.top=Yr(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Xr(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e=void 0){const t=void 0===e?Ur(this.datepicker):e;return this._renderMethod=Xr(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:i,_oldView:n}=this,r=new Date(this._oldViewDate),s=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[s](),n&&(this.main.replaceChild(t.element,n.element),Mr(i,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&Mr(i,"changeYear"),e.getMonth()!==r.getMonth()&&Mr(i,"changeMonth")}}}function Zr(e,t,i,n,r,s){if(An(e,r,s)){if(n(e)){return Zr(t(e,i),t,i,n,r,s)}return e}}function es(e,t,i){const n=e.picker,r=n.currentView,s=r.step||1;let o,a=n.viewDate;switch(r.id){case 0:a=Tn(a,i?7*t:t),o=Tn;break;case 1:a=Ln(a,i?4*t:t),o=Ln;break;default:a=In(a,t*(i?4:1)*s),o=In}a=Zr(a,o,t<0?-s:s,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&n.changeFocus(a).render()}function ts(e,t){const{config:i,picker:n,editMode:r}=e,s=n.active,{key:o,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,d=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===o)return void $r(e);if("Enter"===o){if(s)if(r)e.exitEditMode({update:!0,autohide:i.autohide});else{const t=n.currentView;t.isMinView?e.setDate(n.viewDate):(n.changeView(t.id-1).render(),d())}else e.update();return}const u=i.shortcutKeys,h={key:o,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(u).find(e=>{const t=u[e];return!Object.keys(t).find(e=>t[e]!==h[e])});if(p){let t;if("toggle"===p?t=p:r?"exitEditMode"===p&&(t=p):s?"hide"===p?t=p:"prevButton"===p?t=[Fr,[e,-1]]:"nextButton"===p?t=[Fr,[e,1]]:"viewSwitch"===p?t=[Nr,[e]]:i.clearButton&&"clearButton"===p?t=[jr,[e]]:i.todayButton&&"todayButton"===p&&(t=[Pr,[e]]):"show"===p&&(t=p),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void d()}if(!s||r)return;const f=(i,n)=>{l||c||a?e.enterEditMode():(es(e,i,n),t.preventDefault())};"ArrowLeft"===o?f(-1,!1):"ArrowRight"===o?f(1,!1):"ArrowUp"===o?f(-1,!0):"ArrowDown"===o?f(1,!0):("Backspace"===o||"Delete"===o||o&&1===o.length&&!c)&&e.enterEditMode()}function is(e){e.config.showOnFocus&&!e._showing&&e.show()}function ns(e,t){const i=t.target;(e.picker.active||e.config.showOnClick)&&(i._active=tr(i),i._clicking=setTimeout(()=>{delete i._active,delete i._clicking},2e3))}function rs(e,t){const i=t.target;i._clicking&&(clearTimeout(i._clicking),delete i._clicking,i._active&&e.enterEditMode(),delete i._active,e.config.showOnClick&&e.show())}function ss(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function os(e,t){const{element:i,picker:n}=e;if(!n.active&&!tr(i))return;const r=n.element;dr(t,e=>e===i||e===r)||$r(e)}function as(e,t){return e.map(e=>Gn(e,t.format,t.locale)).join(t.dateDelimiter)}function ls(e,t,i=!1){if(0===t.length)return i?[]:void 0;const{config:n,dates:r,rangeSideIndex:s}=e,{pickLevel:o,maxNumberOfDates:a}=n;let l=t.reduce((e,t)=>{let i=Qn(t,n.format,n.locale);return void 0===i||(i=Rn(i,o,s),!An(i,n.minDate,n.maxDate)||e.includes(i)||n.checkDisabled(i,o)||!(o>0)&&n.daysOfWeekDisabled.includes(new Date(i).getDay())||e.push(i)),e},[]);return 0!==l.length?(n.multidate&&!i&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function cs(e,t=3,i=!0,n=void 0){const{config:r,picker:s,inputField:o}=e;if(2&t){const e=s.active?r.pickLevel:r.startView;s.update(n).changeView(e).render(i)}1&t&&o&&(o.value=as(e.dates,r))}function ds(e,t,i){const n=e.config;let{clear:r,render:s,autohide:o,revert:a,forceRefresh:l,viewDate:c}=i;void 0===s&&(s=!0),s?void 0===o&&(o=n.autohide):o=l=!1,c=Qn(c,n.format,n.locale);const d=ls(e,t,r);(d||a)&&(d&&d.toString()!==e.dates.toString()?(e.dates=d,cs(e,s?3:1,!0,c),Mr(e,"changeDate")):cs(e,l?3:1,!0,c),o&&e.hide())}function us(e,t){return t?i=>Gn(i,t,e.config.locale):e=>new Date(e)}class hs{constructor(e,t={},i=void 0){e.datepicker=this,this.element=e,this.dates=[];const n=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:Dn(),maxDate:void 0,minDate:void 0},Er(hr,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(n.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):n.container=e,i){const e=i.inputs.indexOf(r),t=i.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=i,this.rangeSideIndex=e}this._options=t,Object.assign(n,Er(t,this)),n.shortcutKeys=function(e){return Object.keys(Ar).reduce((t,i)=>{const n=void 0===e[i]?Ar[i]:e[i],r=n&&n.key;if(!r||"string"!=typeof r)return t;const s={key:r,ctrlOrMetaKey:!!(n.ctrlOrMetaKey||n.ctrlKey||n.metaKey)};return r.length>1&&(s.altKey=!!n.altKey,s.shiftKey=!!n.shiftKey),t[i]=s,t},{})}(t.shortcutKeys||{});const s=En(e.value||e.dataset.date,n.dateDelimiter);delete e.dataset.date;const o=ls(this,s);o&&o.length>0&&(this.dates=o),r&&(r.value=as(this.dates,n));const a=this.picker=new Jr(this),l=[e,"keydown",ts.bind(null,this)];r?lr(this,[l,[r,"focus",is.bind(null,this)],[r,"mousedown",ns.bind(null,this)],[r,"click",rs.bind(null,this)],[r,"paste",ss.bind(null,this)],[document,"mousedown",os.bind(null,this)],[window,"resize",a.place.bind(a)]]):(lr(this,[l]),this.show())}static formatDate(e,t,i){return Gn(e,t,i&&ur[i]||ur.en)}static parseDate(e,t,i){return Qn(e,t,i&&ur[i]||ur.en)}static get locales(){return ur}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=Er(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),cs(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;tr(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),function(e){let t=sr.get(e);t&&(t.forEach(e=>{ar.call(...e)}),sr.delete(e))}(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e=void 0){const t=us(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],i={},n=_n(e);!n||"object"!=typeof n||Array.isArray(n)||n instanceof Date||Object.assign(i,t.pop());ds(this,Array.isArray(t[0])?t[0]:t,i)}update(e=void 0){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});ds(this,En(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e=void 0){return us(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:i,picker:n,active:r,rangeSideIndex:s}=this,o=i.pickLevel,a=Qn(e,i.format,i.locale);void 0!==a&&(n.changeFocus(Rn(a,o,s)),r&&t&&n.changeView(o),n.render())}refresh(e=void 0,t=!1){let i;e&&"string"!=typeof e&&(t=e,e=void 0),i="picker"===e?2:"input"===e?1:3,cs(this,i,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e=void 0){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}class ps{constructor(e={}){this.opts=e}initDatepickers(e){e.forEach(e=>{const t="function"==typeof this.opts?this.opts(e):this.opts;new hs(e,{...t,updateOnBlur:!1}),e.addEventListener("changeDate",()=>{const t=e.closest("form");t&&t.submit()})})}}class fs extends EventTarget{constructor(e,t,i){super(),this.el=e,this.options={...fs.defaultOptions,...i};const n=this.resolveDatagridName();if(!n)throw new Error("Cannot resolve name of a datagrid!");this.name=n,this.ajax="function"==typeof t?t(this):t,this.ajax.addEventListener("success",e=>{var t,i;(null===(t=e.detail.payload)||void 0===t?void 0:t._datagrid_name)===this.name&&(null===(i=e.detail.payload)||void 0===i?void 0:i._datagrid_init)&&this.init()}),this.init()}init(){!this.dispatch("beforeInit",{datagrid:this})||this.options.plugins.forEach(e=>{var t;null===(t=e.onDatagridInit)||void 0===t||t.call(e,this)});const e=this.el.querySelectorAll("input[data-check]:checked");if(1===e.length&&"toggle-all"===e[0].getAttribute("name")){const t=e[0];t&&(t.checked=!1)}this.el.querySelectorAll("input[data-datagrid-manualsubmit]").forEach(e=>{const t=e.closest("form");t&&e.addEventListener("keydown",e=>{if(_(e))return e.stopPropagation(),e.preventDefault(),this.ajax.submitForm(t)})}),this.ajax.addEventListener("success",({detail:{payload:e}})=>{var t;if(e._datagrid_name&&e._datagrid_name===this.name){const i=e=>e.getAttribute("data-datagrid-reset-filter-by-column"),n=Array.from(this.el.querySelectorAll("[data-datagrid-reset-filter-by-column]")),r=e.non_empty_filters?e.non_empty_filters:[];if(n.forEach(e=>{const t=i(e);t&&r.includes(t)?e.classList.remove("hidden"):e.classList.add("hidden")}),r.length>0){const e=null===(t=this.el.querySelector(".reset-filter"))||void 0===t?void 0:t.getAttribute("href");e&&n.forEach(t=>{const n=i(t),r=e.replace("-resetFilter","-resetColumnFilter");t.setAttribute("href",`${r}&${this.name}-key=${n}`)})}}}),this.dispatch("afterInit",{datagrid:this})}confirm(e){return this.options.confirm.bind(this)(e)}resolveDatagridName(){return this.options.resolveDatagridName.bind(this)(this.el)}dispatch(e,t,i){return this.dispatchEvent(new CustomEvent(e,{detail:t}))}}fs.defaultOptions={confirm:confirm,resolveDatagridName:function(e){const t=e.getAttribute("data-datagrid-name");if(t)return t;console.warn("Deprecated name resolution for datagrid",e,": Please add a data-datagrid-name attribute instead!\nCurrently, the Datagrid library relies on matching the name from the 'datagrid-[name]' class, which is unreliable and may cause bugs if the default class names are not used (eg. if you add a datagrid-xx class, or change the name class completely!)\nAlternatively, you can customize the name resolution with the `resolveDatagridName` option. See TBD for more info.");const i=e.classList.value.split(" ");for(const e of i){if(!e.startsWith("datagrid-"))continue;const[,...t]=e.split("-"),i=t.join("-");return i.length<1?(console.error(`Failed to resolve datagrid name - ambigious class name '${e}'`),null):i}return null},plugins:[]};class gs{constructor(e,t={}){this.ajax=e,this.datagrids=[],this.options={selector:"div[data-datagrid-name]",datagrid:{},root:document.body,...t};const i="string"==typeof this.options.root?document.querySelector(this.options.root):this.options.root;if(!(i&&i instanceof HTMLElement))throw new Error("Root element not found or is not an HTMLElement");this.root=i,this.init()}init(){var e,t;this.ajax.onInit(),(null!==(t=null===(e=this.options.datagrid)||void 0===e?void 0:e.plugins)&&void 0!==t?t:[]).forEach(e=>{var t;return null===(t=e.onInit)||void 0===t?void 0:t.call(e,this)}),this.initDatagrids()}initDatagrids(){this.datagrids=Array.from(this.root.querySelectorAll(this.options.selector)).map(e=>new fs(e,this.ajax,this.options.datagrid))}}class ms extends EventTarget{constructor(e){if(!e.VERSION||e.VERSION<2)throw new Error("NajaAjax supports Naja 2 and higher"+(e.VERSION?`(version ${e.VERSION} provided)`:""));super(),this.client=e}onInit(){return this.client.addEventListener("before",e=>this.dispatch("before",{params:e.detail})),this.client.uiHandler.addEventListener("interaction",e=>{if(!(e.detail.element instanceof HTMLElement))throw new Error("Element is not an instanceof HTMLElement");const t=this.dispatch("interact",{...e.detail,element:e.detail.element});return t||(e.stopPropagation(),e.preventDefault()),t}),this.client.addEventListener("success",e=>this.dispatch("success",{...e.detail,params:e.detail.request,payload:e.detail.payload})),this.client.addEventListener("error",e=>this.dispatch("error",{...e.detail,params:e.detail.request,response:e.detail.response})),this.client.addEventListener("complete",e=>this.dispatch("complete",{...e.detail,params:e.detail.request,response:e.detail.response})),this}async request(e){return await this.client.makeRequest(e.method,e.url,e.data)}async submitForm(e){return await this.client.uiHandler.submitForm(e)}dispatch(e,t,i){return this.dispatchEvent(new CustomEvent(e,{detail:t,cancelable:!0}))}}var vs="top",bs="bottom",ys="right",_s="left",ws="auto",Es=[vs,bs,ys,_s],As="start",Ss="end",ks="clippingParents",Os="viewport",Cs="popper",Ds="reference",xs=Es.reduce(function(e,t){return e.concat([t+"-"+As,t+"-"+Ss])},[]),Ts=[].concat(Es,[ws]).reduce(function(e,t){return e.concat([t,t+"-"+As,t+"-"+Ss])},[]),Ls="beforeRead",Is="read",Ms="afterRead",Fs="beforeMain",Ns="main",js="afterMain",Ps="beforeWrite",$s="write",Hs="afterWrite",qs=[Ls,Is,Ms,Fs,Ns,js,Ps,$s,Hs];function Rs(e){return e?(e.nodeName||"").toLowerCase():null}function Bs(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Vs(e){return e instanceof Bs(e).Element||e instanceof Element}function zs(e){return e instanceof Bs(e).HTMLElement||e instanceof HTMLElement}function Ws(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Bs(e).ShadowRoot||e instanceof ShadowRoot)}var Ys={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},r=t.elements[e];zs(r)&&Rs(r)&&(Object.assign(r.style,i),Object.keys(n).forEach(function(e){var t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],r=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});zs(n)&&Rs(n)&&(Object.assign(n.style,s),Object.keys(r).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};function Ks(e){return e.split("-")[0]}var Us=Math.max,Xs=Math.min,Qs=Math.round;function Gs(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Js(){return!/^((?!chrome|android).)*safari/i.test(Gs())}function Zs(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),r=1,s=1;t&&zs(e)&&(r=e.offsetWidth>0&&Qs(n.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Qs(n.height)/e.offsetHeight||1);var o=(Vs(e)?Bs(e):window).visualViewport,a=!Js()&&i,l=(n.left+(a&&o?o.offsetLeft:0))/r,c=(n.top+(a&&o?o.offsetTop:0))/s,d=n.width/r,u=n.height/s;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function eo(e){var t=Zs(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function to(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&Ws(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function io(e){return Bs(e).getComputedStyle(e)}function no(e){return["table","td","th"].indexOf(Rs(e))>=0}function ro(e){return((Vs(e)?e.ownerDocument:e.document)||window.document).documentElement}function so(e){return"html"===Rs(e)?e:e.assignedSlot||e.parentNode||(Ws(e)?e.host:null)||ro(e)}function oo(e){return zs(e)&&"fixed"!==io(e).position?e.offsetParent:null}function ao(e){for(var t=Bs(e),i=oo(e);i&&no(i)&&"static"===io(i).position;)i=oo(i);return i&&("html"===Rs(i)||"body"===Rs(i)&&"static"===io(i).position)?t:i||function(e){var t=/firefox/i.test(Gs());if(/Trident/i.test(Gs())&&zs(e)&&"fixed"===io(e).position)return null;var i=so(e);for(Ws(i)&&(i=i.host);zs(i)&&["html","body"].indexOf(Rs(i))<0;){var n=io(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}function lo(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function co(e,t,i){return Us(e,Xs(t,i))}function uo(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ho(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}var po={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,r=e.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=Ks(i.placement),l=lo(a),c=[_s,ys].indexOf(a)>=0?"height":"width";if(s&&o){var d=function(e,t){return uo("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ho(e,Es))}(r.padding,i),u=eo(s),h="y"===l?vs:_s,p="y"===l?bs:ys,f=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],g=o[l]-i.rects.reference[l],m=ao(s),v=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,b=f/2-g/2,y=d[h],_=v-u[c]-d[p],w=v/2-u[c]/2+b,E=co(y,w,_),A=l;i.modifiersData[n]=((t={})[A]=E,t.centerOffset=E-w,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&to(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function fo(e){return e.split("-")[1]}var go={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mo(e){var t,i=e.popper,n=e.popperRect,r=e.placement,s=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,g=void 0===f?0:f,m="function"==typeof d?d({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),y=_s,_=vs,w=window;if(c){var E=ao(i),A="clientHeight",S="clientWidth";if(E===Bs(i)&&"static"!==io(E=ro(i)).position&&"absolute"===a&&(A="scrollHeight",S="scrollWidth"),r===vs||(r===_s||r===ys)&&s===Ss)_=bs,g-=(u&&E===w&&w.visualViewport?w.visualViewport.height:E[A])-n.height,g*=l?1:-1;if(r===_s||(r===vs||r===bs)&&s===Ss)y=ys,p-=(u&&E===w&&w.visualViewport?w.visualViewport.width:E[S])-n.width,p*=l?1:-1}var k,O=Object.assign({position:a},c&&go),C=!0===d?function(e,t){var i=e.x,n=e.y,r=t.devicePixelRatio||1;return{x:Qs(i*r)/r||0,y:Qs(n*r)/r||0}}({x:p,y:g},Bs(i)):{x:p,y:g};return p=C.x,g=C.y,l?Object.assign({},O,((k={})[_]=b?"0":"",k[y]=v?"0":"",k.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",k)):Object.assign({},O,((t={})[_]=b?g+"px":"",t[y]=v?p+"px":"",t.transform="",t))}var vo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,r=void 0===n||n,s=i.adaptive,o=void 0===s||s,a=i.roundOffsets,l=void 0===a||a,c={placement:Ks(t.placement),variation:fo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,mo(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,mo(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},bo={passive:!0};var yo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,r=n.scroll,s=void 0===r||r,o=n.resize,a=void 0===o||o,l=Bs(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&c.forEach(function(e){e.addEventListener("scroll",i.update,bo)}),a&&l.addEventListener("resize",i.update,bo),function(){s&&c.forEach(function(e){e.removeEventListener("scroll",i.update,bo)}),a&&l.removeEventListener("resize",i.update,bo)}},data:{}},_o={left:"right",right:"left",bottom:"top",top:"bottom"};function wo(e){return e.replace(/left|right|bottom|top/g,function(e){return _o[e]})}var Eo={start:"end",end:"start"};function Ao(e){return e.replace(/start|end/g,function(e){return Eo[e]})}function So(e){var t=Bs(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ko(e){return Zs(ro(e)).left+So(e).scrollLeft}function Oo(e){var t=io(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Co(e){return["html","body","#document"].indexOf(Rs(e))>=0?e.ownerDocument.body:zs(e)&&Oo(e)?e:Co(so(e))}function Do(e,t){var i;void 0===t&&(t=[]);var n=Co(e),r=n===(null==(i=e.ownerDocument)?void 0:i.body),s=Bs(n),o=r?[s].concat(s.visualViewport||[],Oo(n)?n:[]):n,a=t.concat(o);return r?a:a.concat(Do(so(o)))}function xo(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function To(e,t,i){return t===Os?xo(function(e,t){var i=Bs(e),n=ro(e),r=i.visualViewport,s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=Js();(c||!c&&"fixed"===t)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+ko(e),y:l}}(e,i)):Vs(t)?function(e,t){var i=Zs(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):xo(function(e){var t,i=ro(e),n=So(e),r=null==(t=e.ownerDocument)?void 0:t.body,s=Us(i.scrollWidth,i.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Us(i.scrollHeight,i.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+ko(e),l=-n.scrollTop;return"rtl"===io(r||i).direction&&(a+=Us(i.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(ro(e)))}function Lo(e,t,i,n){var r="clippingParents"===t?function(e){var t=Do(so(e)),i=["absolute","fixed"].indexOf(io(e).position)>=0&&zs(e)?ao(e):e;return Vs(i)?t.filter(function(e){return Vs(e)&&to(e,i)&&"body"!==Rs(e)}):[]}(e):[].concat(t),s=[].concat(r,[i]),o=s[0],a=s.reduce(function(t,i){var r=To(e,i,n);return t.top=Us(r.top,t.top),t.right=Xs(r.right,t.right),t.bottom=Xs(r.bottom,t.bottom),t.left=Us(r.left,t.left),t},To(e,o,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Io(e){var t,i=e.reference,n=e.element,r=e.placement,s=r?Ks(r):null,o=r?fo(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(s){case vs:t={x:a,y:i.y-n.height};break;case bs:t={x:a,y:i.y+i.height};break;case ys:t={x:i.x+i.width,y:l};break;case _s:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var c=s?lo(s):null;if(null!=c){var d="y"===c?"height":"width";switch(o){case As:t[c]=t[c]-(i[d]/2-n[d]/2);break;case Ss:t[c]=t[c]+(i[d]/2-n[d]/2)}}return t}function Mo(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=void 0===n?e.placement:n,s=i.strategy,o=void 0===s?e.strategy:s,a=i.boundary,l=void 0===a?ks:a,c=i.rootBoundary,d=void 0===c?Os:c,u=i.elementContext,h=void 0===u?Cs:u,p=i.altBoundary,f=void 0!==p&&p,g=i.padding,m=void 0===g?0:g,v=uo("number"!=typeof m?m:ho(m,Es)),b=h===Cs?Ds:Cs,y=e.rects.popper,_=e.elements[f?b:h],w=Lo(Vs(_)?_:_.contextElement||ro(e.elements.popper),l,d,o),E=Zs(e.elements.reference),A=Io({reference:E,element:y,placement:r}),S=xo(Object.assign({},y,A)),k=h===Cs?S:E,O={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},C=e.modifiersData.offset;if(h===Cs&&C){var D=C[r];Object.keys(O).forEach(function(e){var t=[ys,bs].indexOf(e)>=0?1:-1,i=[vs,bs].indexOf(e)>=0?"y":"x";O[e]+=D[i]*t})}return O}function Fo(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Ts:l,d=fo(n),u=d?a?xs:xs.filter(function(e){return fo(e)===d}):Es,h=u.filter(function(e){return c.indexOf(e)>=0});0===h.length&&(h=u);var p=h.reduce(function(t,i){return t[i]=Mo(e,{placement:i,boundary:r,rootBoundary:s,padding:o})[Ks(i)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}var No={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0===o||o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,u=i.rootBoundary,h=i.altBoundary,p=i.flipVariations,f=void 0===p||p,g=i.allowedAutoPlacements,m=t.options.placement,v=Ks(m),b=l||(v===m||!f?[wo(m)]:function(e){if(Ks(e)===ws)return[];var t=wo(e);return[Ao(e),t,Ao(t)]}(m)),y=[m].concat(b).reduce(function(e,i){return e.concat(Ks(i)===ws?Fo(t,{placement:i,boundary:d,rootBoundary:u,padding:c,flipVariations:f,allowedAutoPlacements:g}):i)},[]),_=t.rects.reference,w=t.rects.popper,E=new Map,A=!0,S=y[0],k=0;k<y.length;k++){var O=y[k],C=Ks(O),D=fo(O)===As,x=[vs,bs].indexOf(C)>=0,T=x?"width":"height",L=Mo(t,{placement:O,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),I=x?D?ys:_s:D?bs:vs;_[T]>w[T]&&(I=wo(I));var M=wo(I),F=[];if(s&&F.push(L[C]<=0),a&&F.push(L[I]<=0,L[M]<=0),F.every(function(e){return e})){S=O,A=!1;break}E.set(O,F)}if(A)for(var N=function(e){var t=y.find(function(t){var i=E.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return S=t,"break"},j=f?3:1;j>0;j--){if("break"===N(j))break}t.placement!==S&&(t.modifiersData[n]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function jo(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Po(e){return[vs,ys,bs,_s].some(function(t){return e[t]>=0})}var $o={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=Mo(t,{elementContext:"reference"}),a=Mo(t,{altBoundary:!0}),l=jo(o,n),c=jo(a,r,s),d=Po(l),u=Po(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}};var Ho={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.offset,s=void 0===r?[0,0]:r,o=Ts.reduce(function(e,i){return e[i]=function(e,t,i){var n=Ks(e),r=[_s,vs].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},t,{placement:e})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[_s,ys].indexOf(n)>=0?{x:a,y:o}:{x:o,y:a}}(i,t.rects,s),e},{}),a=o[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}};var qo={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=Io({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}};var Ro={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,s=void 0===r||r,o=i.altAxis,a=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,u=i.padding,h=i.tether,p=void 0===h||h,f=i.tetherOffset,g=void 0===f?0:f,m=Mo(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),v=Ks(t.placement),b=fo(t.placement),y=!b,_=lo(v),w="x"===_?"y":"x",E=t.modifiersData.popperOffsets,A=t.rects.reference,S=t.rects.popper,k="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,O="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(E){if(s){var x,T="y"===_?vs:_s,L="y"===_?bs:ys,I="y"===_?"height":"width",M=E[_],F=M+m[T],N=M-m[L],j=p?-S[I]/2:0,P=b===As?A[I]:S[I],H=b===As?-S[I]:-A[I],q=t.elements.arrow,R=p&&q?eo(q):{width:0,height:0},B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=B[T],z=B[L],W=co(0,A[I],R[I]),Y=y?A[I]/2-j-W-V-O.mainAxis:P-W-V-O.mainAxis,K=y?-A[I]/2+j+W+z+O.mainAxis:H+W+z+O.mainAxis,U=t.elements.arrow&&ao(t.elements.arrow),X=U?"y"===_?U.clientTop||0:U.clientLeft||0:0,Q=null!=(x=null==C?void 0:C[_])?x:0,G=M+K-Q,J=co(p?Xs(F,M+Y-Q-X):F,M,p?Us(N,G):N);E[_]=J,D[_]=J-M}if(a){var Z,ee="x"===_?vs:_s,te="x"===_?bs:ys,ie=E[w],ne="y"===w?"height":"width",re=ie+m[ee],se=ie-m[te],oe=-1!==[vs,_s].indexOf(v),ae=null!=(Z=null==C?void 0:C[w])?Z:0,le=oe?re:ie-A[ne]-S[ne]-ae+O.altAxis,ce=oe?ie+A[ne]+S[ne]-ae-O.altAxis:se,de=p&&oe?function(e,t,i){var n=co(e,t,i);return n>i?i:n}(le,ie,ce):co(p?le:re,ie,p?ce:se);E[w]=de,D[w]=de-ie}t.modifiersData[n]=D}},requiresIfExists:["offset"]};function Bo(e,t,i){void 0===i&&(i=!1);var n,r,s=zs(t),o=zs(t)&&function(e){var t=e.getBoundingClientRect(),i=Qs(t.width)/e.offsetWidth||1,n=Qs(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),a=ro(t),l=Zs(e,o,i),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!i)&&(("body"!==Rs(t)||Oo(a))&&(c=(n=t)!==Bs(n)&&zs(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:So(n)),zs(t)?((d=Zs(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):a&&(d.x=ko(a))),{x:l.left+c.scrollLeft-d.x,y:l.top+c.scrollTop-d.y,width:l.width,height:l.height}}function Vo(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||r(e)}),n}var zo={placement:"bottom",modifiers:[],strategy:"absolute"};function Wo(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function Yo(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,r=t.defaultOptions,s=void 0===r?zo:r;return function(e,t,i){void 0===i&&(i=s);var r,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},zo,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,d={state:a,setOptions:function(i){var r="function"==typeof i?i(a.options):i;u(),a.options=Object.assign({},s,a.options,r),a.scrollParents={reference:Vs(e)?Do(e):e.contextElement?Do(e.contextElement):[],popper:Do(t)};var o,c,h=function(e){var t=Vo(e);return qs.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}((o=[].concat(n,a.options.modifiers),c=o.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return a.orderedModifiers=h.filter(function(e){return e.enabled}),a.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,r=e.effect;if("function"==typeof r){var s=r({state:a,name:t,instance:d,options:n}),o=function(){};l.push(s||o)}}),d.update()},forceUpdate:function(){if(!c){var e=a.elements,t=e.reference,i=e.popper;if(Wo(t,i)){a.rects={reference:Bo(t,ao(i),"fixed"===a.options.strategy),popper:eo(i)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(e){return a.modifiersData[e.name]=Object.assign({},e.data)});for(var n=0;n<a.orderedModifiers.length;n++)if(!0!==a.reset){var r=a.orderedModifiers[n],s=r.fn,o=r.options,l=void 0===o?{}:o,u=r.name;"function"==typeof s&&(a=s({state:a,options:l,name:u,instance:d})||a)}else a.reset=!1,n=-1}}},update:(r=function(){return new Promise(function(e){d.forceUpdate(),e(a)})},function(){return o||(o=new Promise(function(e){Promise.resolve().then(function(){o=void 0,e(r())})})),o}),destroy:function(){u(),c=!0}};if(!Wo(e,t))return d;function u(){l.forEach(function(e){return e()}),l=[]}return d.setOptions(i).then(function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)}),d}}var Ko=Yo(),Uo=Yo({defaultModifiers:[yo,qo,vo,Ys]}),Xo=Yo({defaultModifiers:[yo,qo,vo,Ys,Ho,No,Ro,po,$o]}),Qo=Object.freeze({__proto__:null,afterMain:js,afterRead:Ms,afterWrite:Hs,applyStyles:Ys,arrow:po,auto:ws,basePlacements:Es,beforeMain:Fs,beforeRead:Ls,beforeWrite:Ps,bottom:bs,clippingParents:ks,computeStyles:vo,createPopper:Xo,createPopperBase:Ko,createPopperLite:Uo,detectOverflow:Mo,end:Ss,eventListeners:yo,flip:No,hide:$o,left:_s,main:Ns,modifierPhases:qs,offset:Ho,placements:Ts,popper:Cs,popperGenerator:Yo,popperOffsets:qo,preventOverflow:Ro,read:Is,reference:Ds,right:ys,start:As,top:vs,variationPlacements:xs,viewport:Os,write:$s});
14
14
  /*!
15
- * Bootstrap v5.3.6 (https://getbootstrap.com/)
15
+ * Bootstrap v5.3.7 (https://getbootstrap.com/)
16
16
  * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
17
17
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
18
18
  */
19
- const Go=new Map,Jo={set(t,e,i){Go.has(t)||Go.set(t,new Map);const n=Go.get(t);n.has(e)||0===n.size?n.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(t,e)=>Go.has(t)&&Go.get(t).get(e)||null,remove(t,e){if(!Go.has(t))return;const i=Go.get(t);i.delete(e),0===i.size&&Go.delete(t)}},Zo="transitionend",ta=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),ea=t=>{t.dispatchEvent(new Event(Zo))},ia=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),na=t=>ia(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(ta(t)):null,ra=t=>{if(!ia(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},sa=t=>!t||t.nodeType!==Node.ELEMENT_NODE||(!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled"))),oa=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?oa(t.parentNode):null},aa=()=>{},la=t=>{t.offsetHeight},ca=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,da=[],ua=()=>"rtl"===document.documentElement.dir,ha=t=>{var e;e=()=>{const e=ca();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(da.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of da)t()})),da.push(e)):e()},pa=(t,e=[],i=t)=>"function"==typeof t?t.call(...e):i,fa=(t,e,i=!0)=>{if(!i)return void pa(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),r=Number.parseFloat(i);return n||r?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const s=({target:i})=>{i===e&&(r=!0,e.removeEventListener(Zo,s),pa(t))};e.addEventListener(Zo,s),setTimeout((()=>{r||ea(e)}),n)},ga=(t,e,i,n)=>{const r=t.length;let s=t.indexOf(e);return-1===s?!i&&n?t[r-1]:t[0]:(s+=i?1:-1,n&&(s=(s+r)%r),t[Math.max(0,Math.min(s,r-1))])},ma=/[^.]*(?=\..*)\.|.*/,va=/\..*/,ba=/::\d+$/,ya={};let _a=1;const wa={mouseenter:"mouseover",mouseleave:"mouseout"},Ea=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 Aa(t,e){return e&&`${e}::${_a++}`||t.uidEvent||_a++}function ka(t){const e=Aa(t);return t.uidEvent=e,ya[e]=ya[e]||{},ya[e]}function Sa(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function Ca(t,e,i){const n="string"==typeof e,r=n?i:e||i;let s=Ta(t);return Ea.has(s)||(s=t),[n,r,s]}function Oa(t,e,i,n,r){if("string"!=typeof e||!t)return;let[s,o,a]=Ca(e,i,n);if(e in wa){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};o=t(o)}const l=ka(t),c=l[a]||(l[a]={}),d=Sa(c,o,s?i:null);if(d)return void(d.oneOff=d.oneOff&&r);const u=Aa(o,e.replace(ma,"")),h=s?function(t,e,i){return function n(r){const s=t.querySelectorAll(e);for(let{target:o}=r;o&&o!==this;o=o.parentNode)for(const a of s)if(a===o)return Ia(r,{delegateTarget:o}),n.oneOff&&La.off(t,r.type,e,i),i.apply(o,[r])}}(t,i,o):function(t,e){return function i(n){return Ia(n,{delegateTarget:t}),i.oneOff&&La.off(t,n.type,e),e.apply(t,[n])}}(t,o);h.delegationSelector=s?i:null,h.callable=o,h.oneOff=r,h.uidEvent=u,c[u]=h,t.addEventListener(a,h,s)}function Da(t,e,i,n,r){const s=Sa(e[i],n,r);s&&(t.removeEventListener(i,s,Boolean(r)),delete e[i][s.uidEvent])}function xa(t,e,i,n){const r=e[i]||{};for(const[s,o]of Object.entries(r))s.includes(n)&&Da(t,e,i,o.callable,o.delegationSelector)}function Ta(t){return t=t.replace(va,""),wa[t]||t}const La={on(t,e,i,n){Oa(t,e,i,n,!1)},one(t,e,i,n){Oa(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[r,s,o]=Ca(e,i,n),a=o!==e,l=ka(t),c=l[o]||{},d=e.startsWith(".");if(void 0===s){if(d)for(const i of Object.keys(l))xa(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const r=i.replace(ba,"");a&&!e.includes(r)||Da(t,l,o,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;Da(t,l,o,s,r?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=ca();let r=null,s=!0,o=!0,a=!1;e!==Ta(e)&&n&&(r=n.Event(e,i),n(t).trigger(r),s=!r.isPropagationStopped(),o=!r.isImmediatePropagationStopped(),a=r.isDefaultPrevented());const l=Ia(new Event(e,{bubbles:s,cancelable:!0}),i);return a&&l.preventDefault(),o&&t.dispatchEvent(l),l.defaultPrevented&&r&&r.preventDefault(),l}};function Ia(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function Fa(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function Ma(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const Na={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${Ma(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${Ma(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=Fa(t.dataset[n])}return e},getDataAttribute:(t,e)=>Fa(t.getAttribute(`data-bs-${Ma(e)}`))};class ja{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(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=ia(e)?Na.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...ia(e)?Na.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[n,r]of Object.entries(e)){const e=t[n],s=ia(e)?"element":null==(i=e)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(r).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${s}" but expected type "${r}".`)}var i}}class Pa extends ja{constructor(t,e){super(),(t=na(t))&&(this._element=t,this._config=this._getConfig(e),Jo.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Jo.remove(this._element,this.constructor.DATA_KEY),La.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){fa(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return Jo.get(na(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.6"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const $a=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e?e.split(",").map((t=>ta(t))).join(","):null},Ha={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!sa(t)&&ra(t)))},getSelectorFromElement(t){const e=$a(t);return e&&Ha.findOne(e)?e:null},getElementFromSelector(t){const e=$a(t);return e?Ha.findOne(e):null},getMultipleElementsFromSelector(t){const e=$a(t);return e?Ha.find(e):[]}},qa=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;La.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),sa(this))return;const r=Ha.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(r)[e]()}))},Ra=".bs.alert",Ba=`close${Ra}`,Va=`closed${Ra}`;class za extends Pa{static get NAME(){return"alert"}close(){if(La.trigger(this._element,Ba).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),La.trigger(this._element,Va),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=za.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}qa(za,"close"),ha(za);const Wa='[data-bs-toggle="button"]';class Ya extends Pa{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=Ya.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}La.on(document,"click.bs.button.data-api",Wa,(t=>{t.preventDefault();const e=t.target.closest(Wa);Ya.getOrCreateInstance(e).toggle()})),ha(Ya);const Ka=".bs.swipe",Ua=`touchstart${Ka}`,Xa=`touchmove${Ka}`,Qa=`touchend${Ka}`,Ga=`pointerdown${Ka}`,Ja=`pointerup${Ka}`,Za={endCallback:null,leftCallback:null,rightCallback:null},tl={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class el extends ja{constructor(t,e){super(),this._element=t,t&&el.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Za}static get DefaultType(){return tl}static get NAME(){return"swipe"}dispose(){La.off(this._element,Ka)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),pa(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&pa(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(La.on(this._element,Ga,(t=>this._start(t))),La.on(this._element,Ja,(t=>this._end(t))),this._element.classList.add("pointer-event")):(La.on(this._element,Ua,(t=>this._start(t))),La.on(this._element,Xa,(t=>this._move(t))),La.on(this._element,Qa,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const il=".bs.carousel",nl=".data-api",rl="ArrowLeft",sl="ArrowRight",ol="next",al="prev",ll="left",cl="right",dl=`slide${il}`,ul=`slid${il}`,hl=`keydown${il}`,pl=`mouseenter${il}`,fl=`mouseleave${il}`,gl=`dragstart${il}`,ml=`load${il}${nl}`,vl=`click${il}${nl}`,bl="carousel",yl="active",_l=".active",wl=".carousel-item",El=_l+wl,Al={[rl]:cl,[sl]:ll},kl={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Sl={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Cl extends Pa{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Ha.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===bl&&this.cycle()}static get Default(){return kl}static get DefaultType(){return Sl}static get NAME(){return"carousel"}next(){this._slide(ol)}nextWhenVisible(){!document.hidden&&ra(this._element)&&this.next()}prev(){this._slide(al)}pause(){this._isSliding&&ea(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?La.one(this._element,ul,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void La.one(this._element,ul,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?ol:al;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&La.on(this._element,hl,(t=>this._keydown(t))),"hover"===this._config.pause&&(La.on(this._element,pl,(()=>this.pause())),La.on(this._element,fl,(()=>this._maybeEnableCycle()))),this._config.touch&&el.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of Ha.find(".carousel-item img",this._element))La.on(t,gl,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(ll)),rightCallback:()=>this._slide(this._directionToOrder(cl)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new el(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=Al[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=Ha.findOne(_l,this._indicatorsElement);e.classList.remove(yl),e.removeAttribute("aria-current");const i=Ha.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(yl),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===ol,r=e||ga(this._getItems(),i,n,this._config.wrap);if(r===i)return;const s=this._getItemIndex(r),o=e=>La.trigger(this._element,e,{relatedTarget:r,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:s});if(o(dl).defaultPrevented)return;if(!i||!r)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=r;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";r.classList.add(c),la(r),i.classList.add(l),r.classList.add(l);this._queueCallback((()=>{r.classList.remove(l,c),r.classList.add(yl),i.classList.remove(yl,c,l),this._isSliding=!1,o(ul)}),i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return Ha.findOne(El,this._element)}_getItems(){return Ha.find(wl,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return ua()?t===ll?al:ol:t===ll?ol:al}_orderToDirection(t){return ua()?t===al?ll:cl:t===al?cl:ll}static jQueryInterface(t){return this.each((function(){const e=Cl.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}La.on(document,vl,"[data-bs-slide], [data-bs-slide-to]",(function(t){const e=Ha.getElementFromSelector(this);if(!e||!e.classList.contains(bl))return;t.preventDefault();const i=Cl.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===Na.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),La.on(window,ml,(()=>{const t=Ha.find('[data-bs-ride="carousel"]');for(const e of t)Cl.getOrCreateInstance(e)})),ha(Cl);const Ol=".bs.collapse",Dl=`show${Ol}`,xl=`shown${Ol}`,Tl=`hide${Ol}`,Ll=`hidden${Ol}`,Il=`click${Ol}.data-api`,Fl="show",Ml="collapse",Nl="collapsing",jl=`:scope .${Ml} .${Ml}`,Pl='[data-bs-toggle="collapse"]',$l={parent:null,toggle:!0},Hl={parent:"(null|element)",toggle:"boolean"};class ql extends Pa{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=Ha.find(Pl);for(const t of i){const e=Ha.getSelectorFromElement(t),i=Ha.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return $l}static get DefaultType(){return Hl}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>ql.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(La.trigger(this._element,Dl).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(Ml),this._element.classList.add(Nl),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Nl),this._element.classList.add(Ml,Fl),this._element.style[e]="",La.trigger(this._element,xl)}),this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(La.trigger(this._element,Tl).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,la(this._element),this._element.classList.add(Nl),this._element.classList.remove(Ml,Fl);for(const t of this._triggerArray){const e=Ha.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Nl),this._element.classList.add(Ml),La.trigger(this._element,Ll)}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(Fl)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=na(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Pl);for(const e of t){const t=Ha.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=Ha.find(jl,this._config.parent);return Ha.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=ql.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}La.on(document,Il,Pl,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of Ha.getMultipleElementsFromSelector(this))ql.getOrCreateInstance(t,{toggle:!1}).toggle()})),ha(ql);const Rl="dropdown",Bl=".bs.dropdown",Vl=".data-api",zl="ArrowUp",Wl="ArrowDown",Yl=`hide${Bl}`,Kl=`hidden${Bl}`,Ul=`show${Bl}`,Xl=`shown${Bl}`,Ql=`click${Bl}${Vl}`,Gl=`keydown${Bl}${Vl}`,Jl=`keyup${Bl}${Vl}`,Zl="show",tc='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ec=`${tc}.${Zl}`,ic=".dropdown-menu",nc=ua()?"top-end":"top-start",rc=ua()?"top-start":"top-end",sc=ua()?"bottom-end":"bottom-start",oc=ua()?"bottom-start":"bottom-end",ac=ua()?"left-start":"right-start",lc=ua()?"right-start":"left-start",cc={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},dc={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class uc extends Pa{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=Ha.next(this._element,ic)[0]||Ha.prev(this._element,ic)[0]||Ha.findOne(ic,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return cc}static get DefaultType(){return dc}static get NAME(){return Rl}toggle(){return this._isShown()?this.hide():this.show()}show(){if(sa(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!La.trigger(this._element,Ul,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))La.on(t,"mouseover",aa);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Zl),this._element.classList.add(Zl),La.trigger(this._element,Xl,t)}}hide(){if(sa(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!La.trigger(this._element,Yl,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))La.off(t,"mouseover",aa);this._popper&&this._popper.destroy(),this._menu.classList.remove(Zl),this._element.classList.remove(Zl),this._element.setAttribute("aria-expanded","false"),Na.removeDataAttribute(this._menu,"popper"),La.trigger(this._element,Kl,t),this._element.focus()}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!ia(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Rl.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===Qo)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let t=this._element;"parent"===this._config.reference?t=this._parent:ia(this._config.reference)?t=na(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=Xo(t,this._menu,e)}_isShown(){return this._menu.classList.contains(Zl)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return ac;if(t.classList.contains("dropstart"))return lc;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?rc:nc:e?oc:sc}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(Na.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...pa(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const i=Ha.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>ra(t)));i.length&&ga(i,e,t===Wl,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=uc.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=Ha.find(ec);for(const i of e){const e=uc.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),r=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!r||"outside"===e._config.autoClose&&r)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const s={relatedTarget:e._element};"click"===t.type&&(s.clickEvent=t),e._completeHide(s)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[zl,Wl].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const r=this.matches(tc)?this:Ha.prev(this,tc)[0]||Ha.next(this,tc)[0]||Ha.findOne(tc,t.delegateTarget.parentNode),s=uc.getOrCreateInstance(r);if(n)return t.stopPropagation(),s.show(),void s._selectMenuItem(t);s._isShown()&&(t.stopPropagation(),s.hide(),r.focus())}}La.on(document,Gl,tc,uc.dataApiKeydownHandler),La.on(document,Gl,ic,uc.dataApiKeydownHandler),La.on(document,Ql,uc.clearMenus),La.on(document,Jl,uc.clearMenus),La.on(document,Ql,tc,(function(t){t.preventDefault(),uc.getOrCreateInstance(this).toggle()})),ha(uc);const hc="backdrop",pc="show",fc=`mousedown.bs.${hc}`,gc={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},mc={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class vc extends ja{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return gc}static get DefaultType(){return mc}static get NAME(){return hc}show(t){if(!this._config.isVisible)return void pa(t);this._append();const e=this._getElement();this._config.isAnimated&&la(e),e.classList.add(pc),this._emulateAnimation((()=>{pa(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(pc),this._emulateAnimation((()=>{this.dispose(),pa(t)}))):pa(t)}dispose(){this._isAppended&&(La.off(this._element,fc),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=na(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),La.on(t,fc,(()=>{pa(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){fa(t,this._getElement(),this._config.isAnimated)}}const bc=".bs.focustrap",yc=`focusin${bc}`,_c=`keydown.tab${bc}`,wc="backward",Ec={autofocus:!0,trapElement:null},Ac={autofocus:"boolean",trapElement:"element"};class kc extends ja{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Ec}static get DefaultType(){return Ac}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),La.off(document,bc),La.on(document,yc,(t=>this._handleFocusin(t))),La.on(document,_c,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,La.off(document,bc))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=Ha.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===wc?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?wc:"forward")}}const Sc=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Cc=".sticky-top",Oc="padding-right",Dc="margin-right";class xc{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Oc,(e=>e+t)),this._setElementAttributes(Sc,Oc,(e=>e+t)),this._setElementAttributes(Cc,Dc,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Oc),this._resetElementAttributes(Sc,Oc),this._resetElementAttributes(Cc,Dc)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const r=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(r))}px`)}))}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&Na.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=Na.getDataAttribute(t,e);null!==i?(Na.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if(ia(t))e(t);else for(const i of Ha.find(t,this._element))e(i)}}const Tc=".bs.modal",Lc=`hide${Tc}`,Ic=`hidePrevented${Tc}`,Fc=`hidden${Tc}`,Mc=`show${Tc}`,Nc=`shown${Tc}`,jc=`resize${Tc}`,Pc=`click.dismiss${Tc}`,$c=`mousedown.dismiss${Tc}`,Hc=`keydown.dismiss${Tc}`,qc=`click${Tc}.data-api`,Rc="modal-open",Bc="show",Vc="modal-static",zc={backdrop:!0,focus:!0,keyboard:!0},Wc={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Yc extends Pa{constructor(t,e){super(t,e),this._dialog=Ha.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new xc,this._addEventListeners()}static get Default(){return zc}static get DefaultType(){return Wc}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown||this._isTransitioning)return;La.trigger(this._element,Mc,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Rc),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){if(!this._isShown||this._isTransitioning)return;La.trigger(this._element,Lc).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Bc),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()))}dispose(){La.off(window,Tc),La.off(this._dialog,Tc),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new vc({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new kc({trapElement:this._element})}_showElement(t){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;const e=Ha.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),la(this._element),this._element.classList.add(Bc);this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,La.trigger(this._element,Nc,{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){La.on(this._element,Hc,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),La.on(window,jc,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),La.on(this._element,$c,(t=>{La.one(this._element,Pc,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_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(Rc),this._resetAdjustments(),this._scrollBar.reset(),La.trigger(this._element,Fc)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(La.trigger(this._element,Ic).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(Vc)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Vc),this._queueCallback((()=>{this._element.classList.remove(Vc),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=ua()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=ua()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=Yc.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}La.on(document,qc,'[data-bs-toggle="modal"]',(function(t){const e=Ha.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),La.one(e,Mc,(t=>{t.defaultPrevented||La.one(e,Fc,(()=>{ra(this)&&this.focus()}))}));const i=Ha.findOne(".modal.show");i&&Yc.getInstance(i).hide();Yc.getOrCreateInstance(e).toggle(this)})),qa(Yc),ha(Yc);const Kc=".bs.offcanvas",Uc=".data-api",Xc=`load${Kc}${Uc}`,Qc="show",Gc="showing",Jc="hiding",Zc=".offcanvas.show",td=`show${Kc}`,ed=`shown${Kc}`,id=`hide${Kc}`,nd=`hidePrevented${Kc}`,rd=`hidden${Kc}`,sd=`resize${Kc}`,od=`click${Kc}${Uc}`,ad=`keydown.dismiss${Kc}`,ld={backdrop:!0,keyboard:!0,scroll:!1},cd={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class dd extends Pa{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return ld}static get DefaultType(){return cd}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown)return;if(La.trigger(this._element,td,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new xc).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Gc);this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Qc),this._element.classList.remove(Gc),La.trigger(this._element,ed,{relatedTarget:t})}),this._element,!0)}hide(){if(!this._isShown)return;if(La.trigger(this._element,id).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Jc),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove(Qc,Jc),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new xc).reset(),La.trigger(this._element,rd)}),this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new vc({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():La.trigger(this._element,nd)}:null})}_initializeFocusTrap(){return new kc({trapElement:this._element})}_addEventListeners(){La.on(this._element,ad,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():La.trigger(this._element,nd))}))}static jQueryInterface(t){return this.each((function(){const e=dd.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}La.on(document,od,'[data-bs-toggle="offcanvas"]',(function(t){const e=Ha.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),sa(this))return;La.one(e,rd,(()=>{ra(this)&&this.focus()}));const i=Ha.findOne(Zc);i&&i!==e&&dd.getInstance(i).hide();dd.getOrCreateInstance(e).toggle(this)})),La.on(window,Xc,(()=>{for(const t of Ha.find(Zc))dd.getOrCreateInstance(t).show()})),La.on(window,sd,(()=>{for(const t of Ha.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&dd.getOrCreateInstance(t).hide()})),qa(dd),ha(dd);const ud={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],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:[]},hd=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),pd=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,fd=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!hd.has(i)||Boolean(pd.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))};const gd={allowList:ud,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},md={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},vd={entry:"(string|element|function|null)",selector:"(string|element)"};class bd extends ja{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return gd}static get DefaultType(){return md}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},vd)}_setContent(t,e,i){const n=Ha.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?ia(e)?this._putElementInTemplate(na(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),r=[].concat(...n.body.querySelectorAll("*"));for(const t of r){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),r=[].concat(e["*"]||[],e[i]||[]);for(const e of n)fd(e,r)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return pa(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const yd=new Set(["sanitize","allowList","sanitizeFn"]),_d="fade",wd="show",Ed=".tooltip-inner",Ad=".modal",kd="hide.bs.modal",Sd="hover",Cd="focus",Od={AUTO:"auto",TOP:"top",RIGHT:ua()?"left":"right",BOTTOM:"bottom",LEFT:ua()?"right":"left"},Dd={allowList:ud,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"},xd={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"};class Td extends Pa{constructor(t,e){if(void 0===Qo)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),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 Dd}static get DefaultType(){return xd}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),La.off(this._element.closest(Ad),kd,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("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=La.trigger(this._element,this.constructor.eventName("show")),e=(oa(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),La.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(wd),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))La.on(t,"mouseover",aa);this._queueCallback((()=>{La.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(La.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(wd),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))La.off(t,"mouseover",aa);this._activeTrigger.click=!1,this._activeTrigger[Cd]=!1,this._activeTrigger[Sd]=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),La.trigger(this._element,this.constructor.eventName("hidden")))}),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(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(_d,wd),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(_d),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new bd({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Ed]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(_d)}_isShown(){return this.tip&&this.tip.classList.contains(wd)}_createPopper(t){const e=pa(this._config.placement,[this,t,this._element]),i=Od[e.toUpperCase()];return Xo(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return pa(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,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:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...pa(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)La.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===Sd?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===Sd?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");La.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?Cd:Sd]=!0,e._enter()})),La.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?Cd:Sd]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},La.on(this._element.closest(Ad),kd,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(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(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=Na.getDataAttributes(this._element);for(const t of Object.keys(e))yd.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:na(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=Td.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}ha(Td);const Ld=".popover-header",Id=".popover-body",Fd={...Td.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"},Md={...Td.DefaultType,content:"(null|string|element|function)"};class Nd extends Td{static get Default(){return Fd}static get DefaultType(){return Md}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Ld]:this._getTitle(),[Id]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=Nd.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}ha(Nd);const jd=".bs.scrollspy",Pd=`activate${jd}`,$d=`click${jd}`,Hd=`load${jd}.data-api`,qd="active",Rd="[href]",Bd=".nav-link",Vd=`${Bd}, .nav-item > ${Bd}, .list-group-item`,zd={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Wd={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Yd extends Pa{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return zd}static get DefaultType(){return Wd}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=na(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(La.off(this._config.target,$d),La.on(this._config.target,$d,Rd,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,r=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const s of t){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(s));continue}const t=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&t){if(i(s),!n)return}else r||t||i(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=Ha.find(Rd,this._config.target);for(const e of t){if(!e.hash||sa(e))continue;const t=Ha.findOne(decodeURI(e.hash),this._element);ra(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(qd),this._activateParents(t),La.trigger(this._element,Pd,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))Ha.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(qd);else for(const e of Ha.parents(t,".nav, .list-group"))for(const t of Ha.prev(e,Vd))t.classList.add(qd)}_clearActiveClass(t){t.classList.remove(qd);const e=Ha.find(`${Rd}.${qd}`,t);for(const t of e)t.classList.remove(qd)}static jQueryInterface(t){return this.each((function(){const e=Yd.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}La.on(window,Hd,(()=>{for(const t of Ha.find('[data-bs-spy="scroll"]'))Yd.getOrCreateInstance(t)})),ha(Yd);const Kd=".bs.tab",Ud=`hide${Kd}`,Xd=`hidden${Kd}`,Qd=`show${Kd}`,Gd=`shown${Kd}`,Jd=`click${Kd}`,Zd=`keydown${Kd}`,tu=`load${Kd}`,eu="ArrowLeft",iu="ArrowRight",nu="ArrowUp",ru="ArrowDown",su="Home",ou="End",au="active",lu="fade",cu="show",du=".dropdown-toggle",uu=`:not(${du})`,hu='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',pu=`${`.nav-link${uu}, .list-group-item${uu}, [role="tab"]${uu}`}, ${hu}`,fu=`.${au}[data-bs-toggle="tab"], .${au}[data-bs-toggle="pill"], .${au}[data-bs-toggle="list"]`;class gu extends Pa{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),La.on(this._element,Zd,(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?La.trigger(e,Ud,{relatedTarget:t}):null;La.trigger(t,Qd,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){if(!t)return;t.classList.add(au),this._activate(Ha.getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),La.trigger(t,Gd,{relatedTarget:e})):t.classList.add(cu)}),t,t.classList.contains(lu))}_deactivate(t,e){if(!t)return;t.classList.remove(au),t.blur(),this._deactivate(Ha.getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),La.trigger(t,Xd,{relatedTarget:e})):t.classList.remove(cu)}),t,t.classList.contains(lu))}_keydown(t){if(![eu,iu,nu,ru,su,ou].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!sa(t)));let i;if([su,ou].includes(t.key))i=e[t.key===su?0:e.length-1];else{const n=[iu,ru].includes(t.key);i=ga(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),gu.getOrCreateInstance(i).show())}_getChildren(){return Ha.find(pu,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=Ha.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const r=Ha.findOne(t,i);r&&r.classList.toggle(n,e)};n(du,au),n(".dropdown-menu",cu),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(au)}_getInnerElement(t){return t.matches(pu)?t:Ha.findOne(pu,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=gu.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}La.on(document,Jd,hu,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),sa(this)||gu.getOrCreateInstance(this).show()})),La.on(window,tu,(()=>{for(const t of Ha.find(fu))gu.getOrCreateInstance(t)})),ha(gu);const mu=".bs.toast",vu=`mouseover${mu}`,bu=`mouseout${mu}`,yu=`focusin${mu}`,_u=`focusout${mu}`,wu=`hide${mu}`,Eu=`hidden${mu}`,Au=`show${mu}`,ku=`shown${mu}`,Su="hide",Cu="show",Ou="showing",Du={animation:"boolean",autohide:"boolean",delay:"number"},xu={animation:!0,autohide:!0,delay:5e3};class Tu extends Pa{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return xu}static get DefaultType(){return Du}static get NAME(){return"toast"}show(){if(La.trigger(this._element,Au).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(Su),la(this._element),this._element.classList.add(Cu,Ou),this._queueCallback((()=>{this._element.classList.remove(Ou),La.trigger(this._element,ku),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this.isShown())return;if(La.trigger(this._element,wu).defaultPrevented)return;this._element.classList.add(Ou),this._queueCallback((()=>{this._element.classList.add(Su),this._element.classList.remove(Ou,Cu),La.trigger(this._element,Eu)}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Cu),super.dispose()}isShown(){return this._element.classList.contains(Cu)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){La.on(this._element,vu,(t=>this._onInteraction(t,!0))),La.on(this._element,bu,(t=>this._onInteraction(t,!1))),La.on(this._element,yu,(t=>this._onInteraction(t,!0))),La.on(this._element,_u,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=Tu.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}qa(Tu),ha(Tu),document.addEventListener("DOMContentLoaded",(()=>{Array.from(document.querySelectorAll(".dropdown")).forEach((t=>new uc(t))),g.formsHandler.netteForms=_,g.initialize(),((t,e={})=>{new gs(t,e)})(new ms(g),{datagrid:{plugins:[new oe,new ae,new ce,new de,new ue,new ne(_),new ie(new pe),new se(new bn),new ee(new ps({buttonClass:"btn"})),new re(new yn(Ft)),new he]}})}));
19
+ const Go=new Map,Jo={set(e,t,i){Go.has(e)||Go.set(e,new Map);const n=Go.get(e);n.has(t)||0===n.size?n.set(t,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>Go.has(e)&&Go.get(e).get(t)||null,remove(e,t){if(!Go.has(e))return;const i=Go.get(e);i.delete(t),0===i.size&&Go.delete(e)}},Zo="transitionend",ea=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),ta=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),ia=e=>{e.dispatchEvent(new Event(Zo))},na=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),ra=e=>na(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(ea(e)):null,sa=e=>{if(!na(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),i=e.closest("details:not([open])");if(!i)return t;if(i!==e){const t=e.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return t},oa=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),aa=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?aa(e.parentNode):null},la=()=>{},ca=e=>{e.offsetHeight},da=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,ua=[],ha=()=>"rtl"===document.documentElement.dir,pa=e=>{var t;t=()=>{const $=da();if($){const t=e.NAME,i=$.fn[t];$.fn[t]=e.jQueryInterface,$.fn[t].Constructor=e,$.fn[t].noConflict=()=>($.fn[t]=i,e.jQueryInterface)}},"loading"===document.readyState?(ua.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of ua)e()}),ua.push(t)):t()},fa=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,ga=(e,t,i=!0)=>{if(!i)return void fa(e);const n=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const n=Number.parseFloat(t),r=Number.parseFloat(i);return n||r?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0})(t)+5;let r=!1;const s=({target:i})=>{i===t&&(r=!0,t.removeEventListener(Zo,s),fa(e))};t.addEventListener(Zo,s),setTimeout(()=>{r||ia(t)},n)},ma=(e,t,i,n)=>{const r=e.length;let s=e.indexOf(t);return-1===s?!i&&n?e[r-1]:e[0]:(s+=i?1:-1,n&&(s=(s+r)%r),e[Math.max(0,Math.min(s,r-1))])},va=/[^.]*(?=\..*)\.|.*/,ba=/\..*/,ya=/::\d+$/,_a={};let wa=1;const Ea={mouseenter:"mouseover",mouseleave:"mouseout"},Aa=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 Sa(e,t){return t&&`${t}::${wa++}`||e.uidEvent||wa++}function ka(e){const t=Sa(e);return e.uidEvent=t,_a[t]=_a[t]||{},_a[t]}function Oa(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function Ca(e,t,i){const n="string"==typeof t,r=n?i:t||i;let s=La(e);return Aa.has(s)||(s=e),[n,r,s]}function Da(e,t,i,n,r){if("string"!=typeof t||!e)return;let[s,o,a]=Ca(t,i,n);if(t in Ea){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};o=e(o)}const l=ka(e),c=l[a]||(l[a]={}),d=Oa(c,o,s?i:null);if(d)return void(d.oneOff=d.oneOff&&r);const u=Sa(o,t.replace(va,"")),h=s?function(e,t,i){return function n(r){const s=e.querySelectorAll(t);for(let{target:o}=r;o&&o!==this;o=o.parentNode)for(const a of s)if(a===o)return Ma(r,{delegateTarget:o}),n.oneOff&&Ia.off(e,r.type,t,i),i.apply(o,[r])}}(e,i,o):function(e,t){return function i(n){return Ma(n,{delegateTarget:e}),i.oneOff&&Ia.off(e,n.type,t),t.apply(e,[n])}}(e,o);h.delegationSelector=s?i:null,h.callable=o,h.oneOff=r,h.uidEvent=u,c[u]=h,e.addEventListener(a,h,s)}function xa(e,t,i,n,r){const s=Oa(t[i],n,r);s&&(e.removeEventListener(i,s,Boolean(r)),delete t[i][s.uidEvent])}function Ta(e,t,i,n){const r=t[i]||{};for(const[s,o]of Object.entries(r))s.includes(n)&&xa(e,t,i,o.callable,o.delegationSelector)}function La(e){return e=e.replace(ba,""),Ea[e]||e}const Ia={on(e,t,i,n){Da(e,t,i,n,!1)},one(e,t,i,n){Da(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[r,s,o]=Ca(t,i,n),a=o!==t,l=ka(e),c=l[o]||{},d=t.startsWith(".");if(void 0===s){if(d)for(const i of Object.keys(l))Ta(e,l,i,t.slice(1));for(const[i,n]of Object.entries(c)){const r=i.replace(ya,"");a&&!t.includes(r)||xa(e,l,o,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;xa(e,l,o,s,r?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const $=da();let n=null,r=!0,s=!0,o=!1;t!==La(t)&&$&&(n=$.Event(t,i),$(e).trigger(n),r=!n.isPropagationStopped(),s=!n.isImmediatePropagationStopped(),o=n.isDefaultPrevented());const a=Ma(new Event(t,{bubbles:r,cancelable:!0}),i);return o&&a.preventDefault(),s&&e.dispatchEvent(a),a.defaultPrevented&&n&&n.preventDefault(),a}};function Ma(e,t={}){for(const[i,n]of Object.entries(t))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get:()=>n})}return e}function Fa(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function Na(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const ja={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${Na(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${Na(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=Fa(e.dataset[n])}return t},getDataAttribute:(e,t)=>Fa(e.getAttribute(`data-bs-${Na(t)}`))};class Pa{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(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const i=na(t)?ja.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...na(t)?ja.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const t=e[i],r=na(t)?"element":ta(t);if(!new RegExp(n).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${r}" but expected type "${n}".`)}}}class $a extends Pa{constructor(e,t){super(),(e=ra(e))&&(this._element=e,this._config=this._getConfig(t),Jo.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Jo.remove(this._element,this.constructor.DATA_KEY),Ia.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){ga(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Jo.get(ra(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.7"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const Ha=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let i=e.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),t=i&&"#"!==i?i.trim():null}return t?t.split(",").map(e=>ea(e)).join(","):null},qa={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const i=[];let n=e.parentNode.closest(t);for(;n;)i.push(n),n=n.parentNode.closest(t);return i},prev(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return[i];i=i.previousElementSibling}return[]},next(e,t){let i=e.nextElementSibling;for(;i;){if(i.matches(t))return[i];i=i.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>`${e}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(e=>!oa(e)&&sa(e))},getSelectorFromElement(e){const t=Ha(e);return t&&qa.findOne(t)?t:null},getElementFromSelector(e){const t=Ha(e);return t?qa.findOne(t):null},getMultipleElementsFromSelector(e){const t=Ha(e);return t?qa.find(t):[]}},Ra=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;Ia.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),oa(this))return;const r=qa.getElementFromSelector(this)||this.closest(`.${n}`);e.getOrCreateInstance(r)[t]()})},Ba=".bs.alert",Va=`close${Ba}`,za=`closed${Ba}`;class Wa extends $a{static get NAME(){return"alert"}close(){if(Ia.trigger(this._element,Va).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),Ia.trigger(this._element,za),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Wa.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ra(Wa,"close"),pa(Wa);const Ya='[data-bs-toggle="button"]';class Ka extends $a{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Ka.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}Ia.on(document,"click.bs.button.data-api",Ya,e=>{e.preventDefault();const t=e.target.closest(Ya);Ka.getOrCreateInstance(t).toggle()}),pa(Ka);const Ua=".bs.swipe",Xa=`touchstart${Ua}`,Qa=`touchmove${Ua}`,Ga=`touchend${Ua}`,Ja=`pointerdown${Ua}`,Za=`pointerup${Ua}`,el={endCallback:null,leftCallback:null,rightCallback:null},tl={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class il extends Pa{constructor(e,t){super(),this._element=e,e&&il.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return el}static get DefaultType(){return tl}static get NAME(){return"swipe"}dispose(){Ia.off(this._element,Ua)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),fa(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&fa(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(Ia.on(this._element,Ja,e=>this._start(e)),Ia.on(this._element,Za,e=>this._end(e)),this._element.classList.add("pointer-event")):(Ia.on(this._element,Xa,e=>this._start(e)),Ia.on(this._element,Qa,e=>this._move(e)),Ia.on(this._element,Ga,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const nl=".bs.carousel",rl=".data-api",sl="ArrowLeft",ol="ArrowRight",al="next",ll="prev",cl="left",dl="right",ul=`slide${nl}`,hl=`slid${nl}`,pl=`keydown${nl}`,fl=`mouseenter${nl}`,gl=`mouseleave${nl}`,ml=`dragstart${nl}`,vl=`load${nl}${rl}`,bl=`click${nl}${rl}`,yl="carousel",_l="active",wl=".active",El=".carousel-item",Al=wl+El,Sl={[sl]:dl,[ol]:cl},kl={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ol={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Cl extends $a{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=qa.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===yl&&this.cycle()}static get Default(){return kl}static get DefaultType(){return Ol}static get NAME(){return"carousel"}next(){this._slide(al)}nextWhenVisible(){!document.hidden&&sa(this._element)&&this.next()}prev(){this._slide(ll)}pause(){this._isSliding&&ia(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?Ia.one(this._element,hl,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void Ia.one(this._element,hl,()=>this.to(e));const i=this._getItemIndex(this._getActive());if(i===e)return;const n=e>i?al:ll;this._slide(n,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&Ia.on(this._element,pl,e=>this._keydown(e)),"hover"===this._config.pause&&(Ia.on(this._element,fl,()=>this.pause()),Ia.on(this._element,gl,()=>this._maybeEnableCycle())),this._config.touch&&il.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of qa.find(".carousel-item img",this._element))Ia.on(e,ml,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(cl)),rightCallback:()=>this._slide(this._directionToOrder(dl)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new il(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Sl[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=qa.findOne(wl,this._indicatorsElement);t.classList.remove(_l),t.removeAttribute("aria-current");const i=qa.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(_l),i.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),n=e===al,r=t||ma(this._getItems(),i,n,this._config.wrap);if(r===i)return;const s=this._getItemIndex(r),o=t=>Ia.trigger(this._element,t,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:s});if(o(ul).defaultPrevented)return;if(!i||!r)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=r;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";r.classList.add(c),ca(r),i.classList.add(l),r.classList.add(l);this._queueCallback(()=>{r.classList.remove(l,c),r.classList.add(_l),i.classList.remove(_l,c,l),this._isSliding=!1,o(hl)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return qa.findOne(Al,this._element)}_getItems(){return qa.find(El,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return ha()?e===cl?ll:al:e===cl?al:ll}_orderToDirection(e){return ha()?e===ll?cl:dl:e===ll?dl:cl}static jQueryInterface(e){return this.each(function(){const t=Cl.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)})}}Ia.on(document,bl,"[data-bs-slide], [data-bs-slide-to]",function(e){const t=qa.getElementFromSelector(this);if(!t||!t.classList.contains(yl))return;e.preventDefault();const i=Cl.getOrCreateInstance(t),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===ja.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),Ia.on(window,vl,()=>{const e=qa.find('[data-bs-ride="carousel"]');for(const t of e)Cl.getOrCreateInstance(t)}),pa(Cl);const Dl=".bs.collapse",xl=`show${Dl}`,Tl=`shown${Dl}`,Ll=`hide${Dl}`,Il=`hidden${Dl}`,Ml=`click${Dl}.data-api`,Fl="show",Nl="collapse",jl="collapsing",Pl=`:scope .${Nl} .${Nl}`,$l='[data-bs-toggle="collapse"]',Hl={parent:null,toggle:!0},ql={parent:"(null|element)",toggle:"boolean"};class Rl extends $a{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=qa.find($l);for(const e of i){const t=qa.getSelectorFromElement(e),i=qa.find(t).filter(e=>e===this._element);null!==t&&i.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Hl}static get DefaultType(){return ql}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>Rl.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(Ia.trigger(this._element,xl).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(Nl),this._element.classList.add(jl),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jl),this._element.classList.add(Nl,Fl),this._element.style[t]="",Ia.trigger(this._element,Tl)},this._element,!0),this._element.style[t]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(Ia.trigger(this._element,Ll).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,ca(this._element),this._element.classList.add(jl),this._element.classList.remove(Nl,Fl);for(const e of this._triggerArray){const t=qa.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0;this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jl),this._element.classList.add(Nl),Ia.trigger(this._element,Il)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(Fl)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=ra(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren($l);for(const t of e){const e=qa.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=qa.find(Pl,this._config.parent);return qa.find(e,this._config.parent).filter(e=>!t.includes(e))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const i of e)i.classList.toggle("collapsed",!t),i.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const i=Rl.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}})}}Ia.on(document,Ml,$l,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of qa.getMultipleElementsFromSelector(this))Rl.getOrCreateInstance(e,{toggle:!1}).toggle()}),pa(Rl);const Bl="dropdown",Vl=".bs.dropdown",zl=".data-api",Wl="ArrowUp",Yl="ArrowDown",Kl=`hide${Vl}`,Ul=`hidden${Vl}`,Xl=`show${Vl}`,Ql=`shown${Vl}`,Gl=`click${Vl}${zl}`,Jl=`keydown${Vl}${zl}`,Zl=`keyup${Vl}${zl}`,ec="show",tc='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ic=`${tc}.${ec}`,nc=".dropdown-menu",rc=ha()?"top-end":"top-start",sc=ha()?"top-start":"top-end",oc=ha()?"bottom-end":"bottom-start",ac=ha()?"bottom-start":"bottom-end",lc=ha()?"left-start":"right-start",cc=ha()?"right-start":"left-start",dc={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},uc={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class hc extends $a{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=qa.next(this._element,nc)[0]||qa.prev(this._element,nc)[0]||qa.findOne(nc,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return dc}static get DefaultType(){return uc}static get NAME(){return Bl}toggle(){return this._isShown()?this.hide():this.show()}show(){if(oa(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!Ia.trigger(this._element,Xl,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))Ia.on(e,"mouseover",la);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ec),this._element.classList.add(ec),Ia.trigger(this._element,Ql,e)}}hide(){if(oa(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!Ia.trigger(this._element,Kl,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Ia.off(e,"mouseover",la);this._popper&&this._popper.destroy(),this._menu.classList.remove(ec),this._element.classList.remove(ec),this._element.setAttribute("aria-expanded","false"),ja.removeDataAttribute(this._menu,"popper"),Ia.trigger(this._element,Ul,e),this._element.focus()}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!na(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Bl.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===Qo)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let e=this._element;"parent"===this._config.reference?e=this._parent:na(this._config.reference)?e=ra(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Xo(e,this._menu,t)}_isShown(){return this._menu.classList.contains(ec)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return lc;if(e.classList.contains("dropstart"))return cc;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?sc:rc:t?ac:oc}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(ja.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...fa(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){const i=qa.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>sa(e));i.length&&ma(i,t,e===Yl,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=hc.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=qa.find(ic);for(const i of t){const t=hc.getInstance(i);if(!t||!1===t._config.autoClose)continue;const n=e.composedPath(),r=n.includes(t._menu);if(n.includes(t._element)||"inside"===t._config.autoClose&&!r||"outside"===t._config.autoClose&&r)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const s={relatedTarget:t._element};"click"===e.type&&(s.clickEvent=e),t._completeHide(s)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,n=[Wl,Yl].includes(e.key);if(!n&&!i)return;if(t&&!i)return;e.preventDefault();const r=this.matches(tc)?this:qa.prev(this,tc)[0]||qa.next(this,tc)[0]||qa.findOne(tc,e.delegateTarget.parentNode),s=hc.getOrCreateInstance(r);if(n)return e.stopPropagation(),s.show(),void s._selectMenuItem(e);s._isShown()&&(e.stopPropagation(),s.hide(),r.focus())}}Ia.on(document,Jl,tc,hc.dataApiKeydownHandler),Ia.on(document,Jl,nc,hc.dataApiKeydownHandler),Ia.on(document,Gl,hc.clearMenus),Ia.on(document,Zl,hc.clearMenus),Ia.on(document,Gl,tc,function(e){e.preventDefault(),hc.getOrCreateInstance(this).toggle()}),pa(hc);const pc="backdrop",fc="show",gc=`mousedown.bs.${pc}`,mc={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},vc={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class bc extends Pa{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return mc}static get DefaultType(){return vc}static get NAME(){return pc}show(e){if(!this._config.isVisible)return void fa(e);this._append();const t=this._getElement();this._config.isAnimated&&ca(t),t.classList.add(fc),this._emulateAnimation(()=>{fa(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(fc),this._emulateAnimation(()=>{this.dispose(),fa(e)})):fa(e)}dispose(){this._isAppended&&(Ia.off(this._element,gc),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=ra(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),Ia.on(e,gc,()=>{fa(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){ga(e,this._getElement(),this._config.isAnimated)}}const yc=".bs.focustrap",_c=`focusin${yc}`,wc=`keydown.tab${yc}`,Ec="backward",Ac={autofocus:!0,trapElement:null},Sc={autofocus:"boolean",trapElement:"element"};class kc extends Pa{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Ac}static get DefaultType(){return Sc}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),Ia.off(document,yc),Ia.on(document,_c,e=>this._handleFocusin(e)),Ia.on(document,wc,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,Ia.off(document,yc))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const i=qa.focusableChildren(t);0===i.length?t.focus():this._lastTabNavDirection===Ec?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?Ec:"forward")}}const Oc=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Cc=".sticky-top",Dc="padding-right",xc="margin-right";class Tc{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Dc,t=>t+e),this._setElementAttributes(Oc,Dc,t=>t+e),this._setElementAttributes(Cc,xc,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Dc),this._resetElementAttributes(Oc,Dc),this._resetElementAttributes(Cc,xc)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){const n=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+n)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${i(Number.parseFloat(r))}px`)})}_saveInitialAttribute(e,t){const i=e.style.getPropertyValue(t);i&&ja.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const i=ja.getDataAttribute(e,t);null!==i?(ja.removeDataAttribute(e,t),e.style.setProperty(t,i)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(na(e))t(e);else for(const i of qa.find(e,this._element))t(i)}}const Lc=".bs.modal",Ic=`hide${Lc}`,Mc=`hidePrevented${Lc}`,Fc=`hidden${Lc}`,Nc=`show${Lc}`,jc=`shown${Lc}`,Pc=`resize${Lc}`,$c=`click.dismiss${Lc}`,Hc=`mousedown.dismiss${Lc}`,qc=`keydown.dismiss${Lc}`,Rc=`click${Lc}.data-api`,Bc="modal-open",Vc="show",zc="modal-static",Wc={backdrop:!0,focus:!0,keyboard:!0},Yc={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Kc extends $a{constructor(e,t){super(e,t),this._dialog=qa.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Tc,this._addEventListeners()}static get Default(){return Wc}static get DefaultType(){return Yc}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;Ia.trigger(this._element,Nc,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Bc),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){if(!this._isShown||this._isTransitioning)return;Ia.trigger(this._element,Ic).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Vc),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){Ia.off(window,Lc),Ia.off(this._dialog,Lc),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new bc({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new kc({trapElement:this._element})}_showElement(e){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;const t=qa.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),ca(this._element),this._element.classList.add(Vc);this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,Ia.trigger(this._element,jc,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){Ia.on(this._element,qc,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),Ia.on(window,Pc,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),Ia.on(this._element,Hc,e=>{Ia.one(this._element,$c,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_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(Bc),this._resetAdjustments(),this._scrollBar.reset(),Ia.trigger(this._element,Fc)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(Ia.trigger(this._element,Mc).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(zc)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(zc),this._queueCallback(()=>{this._element.classList.remove(zc),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const e=ha()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!i&&e){const e=ha()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const i=Kc.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t)}})}}Ia.on(document,Rc,'[data-bs-toggle="modal"]',function(e){const t=qa.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),Ia.one(t,Nc,e=>{e.defaultPrevented||Ia.one(t,Fc,()=>{sa(this)&&this.focus()})});const i=qa.findOne(".modal.show");i&&Kc.getInstance(i).hide();Kc.getOrCreateInstance(t).toggle(this)}),Ra(Kc),pa(Kc);const Uc=".bs.offcanvas",Xc=".data-api",Qc=`load${Uc}${Xc}`,Gc="show",Jc="showing",Zc="hiding",ed=".offcanvas.show",td=`show${Uc}`,id=`shown${Uc}`,nd=`hide${Uc}`,rd=`hidePrevented${Uc}`,sd=`hidden${Uc}`,od=`resize${Uc}`,ad=`click${Uc}${Xc}`,ld=`keydown.dismiss${Uc}`,cd={backdrop:!0,keyboard:!0,scroll:!1},dd={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class ud extends $a{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return cd}static get DefaultType(){return dd}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown)return;if(Ia.trigger(this._element,td,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Tc).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Jc);this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Gc),this._element.classList.remove(Jc),Ia.trigger(this._element,id,{relatedTarget:e})},this._element,!0)}hide(){if(!this._isShown)return;if(Ia.trigger(this._element,nd).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Zc),this._backdrop.hide();this._queueCallback(()=>{this._element.classList.remove(Gc,Zc),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Tc).reset(),Ia.trigger(this._element,sd)},this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new bc({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():Ia.trigger(this._element,rd)}:null})}_initializeFocusTrap(){return new kc({trapElement:this._element})}_addEventListeners(){Ia.on(this._element,ld,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():Ia.trigger(this._element,rd))})}static jQueryInterface(e){return this.each(function(){const t=ud.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ia.on(document,ad,'[data-bs-toggle="offcanvas"]',function(e){const t=qa.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),oa(this))return;Ia.one(t,sd,()=>{sa(this)&&this.focus()});const i=qa.findOne(ed);i&&i!==t&&ud.getInstance(i).hide();ud.getOrCreateInstance(t).toggle(this)}),Ia.on(window,Qc,()=>{for(const e of qa.find(ed))ud.getOrCreateInstance(e).show()}),Ia.on(window,od,()=>{for(const e of qa.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&ud.getOrCreateInstance(e).hide()}),Ra(ud),pa(ud);const hd={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],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:[]},pd=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),fd=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,gd=(e,t)=>{const i=e.nodeName.toLowerCase();return t.includes(i)?!pd.has(i)||Boolean(fd.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(i))};const md={allowList:hd,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},vd={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},bd={entry:"(string|element|function|null)",selector:"(string|element)"};class yd extends Pa{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return md}static get DefaultType(){return vd}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,i]of Object.entries(this._config.content))this._setContent(e,i,t);const t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},bd)}_setContent(e,t,i){const n=qa.findOne(i,e);n&&((t=this._resolvePossibleFunction(t))?na(t)?this._putElementInTemplate(ra(t),n):this._config.html?n.innerHTML=this._maybeSanitize(t):n.textContent=t:n.remove())}_maybeSanitize(e){return this._config.sanitize?function(e,t,i){if(!e.length)return e;if(i&&"function"==typeof i)return i(e);const n=(new window.DOMParser).parseFromString(e,"text/html"),r=[].concat(...n.body.querySelectorAll("*"));for(const e of r){const i=e.nodeName.toLowerCase();if(!Object.keys(t).includes(i)){e.remove();continue}const n=[].concat(...e.attributes),r=[].concat(t["*"]||[],t[i]||[]);for(const t of n)gd(t,r)||e.removeAttribute(t.nodeName)}return n.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return fa(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const _d=new Set(["sanitize","allowList","sanitizeFn"]),wd="fade",Ed="show",Ad=".tooltip-inner",Sd=".modal",kd="hide.bs.modal",Od="hover",Cd="focus",Dd="click",xd={AUTO:"auto",TOP:"top",RIGHT:ha()?"left":"right",BOTTOM:"bottom",LEFT:ha()?"right":"left"},Td={allowList:hd,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"},Ld={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"};class Id extends $a{constructor(e,t){if(void 0===Qo)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(e,t),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 Td}static get DefaultType(){return Ld}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),Ia.off(this._element.closest(Sd),kd,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("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=Ia.trigger(this._element,this.constructor.eventName("show")),t=(aa(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),Ia.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(Ed),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Ia.on(e,"mouseover",la);this._queueCallback(()=>{Ia.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(Ia.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(Ed),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))Ia.off(e,"mouseover",la);this._activeTrigger[Dd]=!1,this._activeTrigger[Cd]=!1,this._activeTrigger[Od]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),Ia.trigger(this._element,this.constructor.eventName("hidden")))},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(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(wd,Ed),t.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e})(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(wd),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new yd({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Ad]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(wd)}_isShown(){return this.tip&&this.tip.classList.contains(Ed)}_createPopper(e){const t=fa(this._config.placement,[this,e,this._element]),i=xd[t.toUpperCase()];return Xo(this._element,e,this._getPopperConfig(i))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return fa(e,[this._element,this._element])}_getPopperConfig(e){const t={placement:e,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:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...fa(this._config.popperConfig,[void 0,t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)Ia.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger[Dd]=!(t._isShown()&&t._activeTrigger[Dd]),t.toggle()});else if("manual"!==t){const e=t===Od?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=t===Od?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");Ia.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?Cd:Od]=!0,t._enter()}),Ia.on(this._element,i,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?Cd:Od]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},Ia.on(this._element.closest(Sd),kd,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(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(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=ja.getDataAttributes(this._element);for(const e of Object.keys(t))_d.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:ra(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,i]of Object.entries(this._config))this.constructor.Default[t]!==i&&(e[t]=i);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=Id.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}pa(Id);const Md=".popover-header",Fd=".popover-body",Nd={...Id.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"},jd={...Id.DefaultType,content:"(null|string|element|function)"};class Pd extends Id{static get Default(){return Nd}static get DefaultType(){return jd}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Md]:this._getTitle(),[Fd]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=Pd.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}pa(Pd);const $d=".bs.scrollspy",Hd=`activate${$d}`,qd=`click${$d}`,Rd=`load${$d}.data-api`,Bd="active",Vd="[href]",zd=".nav-link",Wd=`${zd}, .nav-item > ${zd}, .list-group-item`,Yd={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Kd={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ud extends $a{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Yd}static get DefaultType(){return Kd}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=ra(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(Ia.off(this._config.target,qd),Ia.on(this._config.target,qd,Vd,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const i=this._rootElement||window,n=t.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),i=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},n=(this._rootElement||document.documentElement).scrollTop,r=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const s of e){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(s));continue}const e=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&e){if(i(s),!n)return}else r||e||i(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=qa.find(Vd,this._config.target);for(const t of e){if(!t.hash||oa(t))continue;const e=qa.findOne(decodeURI(t.hash),this._element);sa(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Bd),this._activateParents(e),Ia.trigger(this._element,Hd,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))qa.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Bd);else for(const t of qa.parents(e,".nav, .list-group"))for(const e of qa.prev(t,Wd))e.classList.add(Bd)}_clearActiveClass(e){e.classList.remove(Bd);const t=qa.find(`${Vd}.${Bd}`,e);for(const e of t)e.classList.remove(Bd)}static jQueryInterface(e){return this.each(function(){const t=Ud.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}Ia.on(window,Rd,()=>{for(const e of qa.find('[data-bs-spy="scroll"]'))Ud.getOrCreateInstance(e)}),pa(Ud);const Xd=".bs.tab",Qd=`hide${Xd}`,Gd=`hidden${Xd}`,Jd=`show${Xd}`,Zd=`shown${Xd}`,eu=`click${Xd}`,tu=`keydown${Xd}`,iu=`load${Xd}`,nu="ArrowLeft",ru="ArrowRight",su="ArrowUp",ou="ArrowDown",au="Home",lu="End",cu="active",du="fade",uu="show",hu=".dropdown-toggle",pu=`:not(${hu})`,fu='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',gu=`${`.nav-link${pu}, .list-group-item${pu}, [role="tab"]${pu}`}, ${fu}`,mu=`.${cu}[data-bs-toggle="tab"], .${cu}[data-bs-toggle="pill"], .${cu}[data-bs-toggle="list"]`;class vu extends $a{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),Ia.on(this._element,tu,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),i=t?Ia.trigger(t,Qd,{relatedTarget:e}):null;Ia.trigger(e,Jd,{relatedTarget:t}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(cu),this._activate(qa.getElementFromSelector(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),Ia.trigger(e,Zd,{relatedTarget:t})):e.classList.add(uu)},e,e.classList.contains(du))}_deactivate(e,t){if(!e)return;e.classList.remove(cu),e.blur(),this._deactivate(qa.getElementFromSelector(e));this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),Ia.trigger(e,Gd,{relatedTarget:t})):e.classList.remove(uu)},e,e.classList.contains(du))}_keydown(e){if(![nu,ru,su,ou,au,lu].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(e=>!oa(e));let i;if([au,lu].includes(e.key))i=t[e.key===au?0:t.length-1];else{const n=[ru,ou].includes(e.key);i=ma(t,e.target,n,!0)}i&&(i.focus({preventScroll:!0}),vu.getOrCreateInstance(i).show())}_getChildren(){return qa.find(gu,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),i=this._getOuterElement(e);e.setAttribute("aria-selected",t),i!==e&&this._setAttributeIfNotExists(i,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=qa.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const i=this._getOuterElement(e);if(!i.classList.contains("dropdown"))return;const n=(e,n)=>{const r=qa.findOne(e,i);r&&r.classList.toggle(n,t)};n(hu,cu),n(".dropdown-menu",uu),i.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,i){e.hasAttribute(t)||e.setAttribute(t,i)}_elemIsActive(e){return e.classList.contains(cu)}_getInnerElement(e){return e.matches(gu)?e:qa.findOne(gu,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=vu.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}Ia.on(document,eu,fu,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),oa(this)||vu.getOrCreateInstance(this).show()}),Ia.on(window,iu,()=>{for(const e of qa.find(mu))vu.getOrCreateInstance(e)}),pa(vu);const bu=".bs.toast",yu=`mouseover${bu}`,_u=`mouseout${bu}`,wu=`focusin${bu}`,Eu=`focusout${bu}`,Au=`hide${bu}`,Su=`hidden${bu}`,ku=`show${bu}`,Ou=`shown${bu}`,Cu="hide",Du="show",xu="showing",Tu={animation:"boolean",autohide:"boolean",delay:"number"},Lu={animation:!0,autohide:!0,delay:5e3};class Iu extends $a{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Lu}static get DefaultType(){return Tu}static get NAME(){return"toast"}show(){if(Ia.trigger(this._element,ku).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(Cu),ca(this._element),this._element.classList.add(Du,xu),this._queueCallback(()=>{this._element.classList.remove(xu),Ia.trigger(this._element,Ou),this._maybeScheduleHide()},this._element,this._config.animation)}hide(){if(!this.isShown())return;if(Ia.trigger(this._element,Au).defaultPrevented)return;this._element.classList.add(xu),this._queueCallback(()=>{this._element.classList.add(Cu),this._element.classList.remove(xu,Du),Ia.trigger(this._element,Su)},this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Du),super.dispose()}isShown(){return this._element.classList.contains(Du)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const i=e.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){Ia.on(this._element,yu,e=>this._onInteraction(e,!0)),Ia.on(this._element,_u,e=>this._onInteraction(e,!1)),Ia.on(this._element,wu,e=>this._onInteraction(e,!0)),Ia.on(this._element,Eu,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Iu.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Ra(Iu),pa(Iu),document.addEventListener("DOMContentLoaded",()=>{Array.from(document.querySelectorAll(".dropdown")).forEach(e=>new hc(e)),f.formsHandler.netteForms=y,f.initialize(),((e,t={})=>{new gs(e,t)})(new ms(f),{datagrid:{plugins:[new st,new ot,new lt,new dt,new ut,new ht,new it(y),new rt(new bn),new tt(new ps({buttonClass:"btn"})),new nt(new yn(Me)),new pt]}})});
20
20
  //# sourceMappingURL=datagrid-full.js.map