From c8670bfe65273f5f2a7dc8eea0a6297d35b3799c Mon Sep 17 00:00:00 2001 From: Corban-Lee Date: Tue, 22 Apr 2025 12:19:09 +0100 Subject: [PATCH] esbuild for compile/bundle ts --- esbuild.mjs | 16 + package.json | 11 +- src/client/public/js/main.js | 669 ++++++++++++++++++++++++++++++++++ src/client/tsconfig.json | 3 +- src/client/typescript/main.ts | 7 + 5 files changed, 703 insertions(+), 3 deletions(-) create mode 100644 esbuild.mjs create mode 100644 src/client/public/js/main.js create mode 100644 src/client/typescript/main.ts diff --git a/esbuild.mjs b/esbuild.mjs new file mode 100644 index 0000000..722ad10 --- /dev/null +++ b/esbuild.mjs @@ -0,0 +1,16 @@ +import { build } from "esbuild"; +import glob from "fast-glob"; + +const entryPoints = await glob("./src/client/typescript/**/*"); + +build({ + entryPoints, + // outBase: "", + outdir: "./src/client/public/js", + bundle: true, + target: ["es6"], + format: "iife", + sourcemap: false, + loader: {".ts": "ts"}, + minify: true +}).catch(() => process.exit(1)); \ No newline at end of file diff --git a/package.json b/package.json index dac6182..6306013 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "start": "node ./dist/app.js", "dev": "npx ts-node -r tsconfig-paths/register ./src/app.ts", "build": "sh ./scripts/build.sh", - "build:client": "npx tsc -p ./src/client/tsconfig.json", + "build:client": "node esbuild.mjs", "build:server": "npx tsc -p ./tsconfig.json", "build:tailwind": "npx @tailwindcss/cli -i ./src/client/public/css/main.css -o ./src/client/public/css/tailwind.css", "db:migrate": "npx prisma migrate dev --name", @@ -23,6 +23,8 @@ "@types/jquery": "^3.5.32", "@types/node": "^22.14.1", "@zerollup/ts-transform-paths": "^1.7.18", + "esbuild": "^0.25.2", + "fast-glob": "^3.3.3", "nodemon": "^3.1.9", "prisma": "^6.6.0", "tailwindcss": "^4.1.4", @@ -32,12 +34,17 @@ }, "dependencies": { "@prisma/client": "^6.6.0", + "@tailwindcss/forms": "^0.5.10", + "discord.js": "^14.18.0", "dotenv": "^16.5.0", "ejs": "^3.1.10", "ejs-mate": "^4.0.0", "express": "^5.1.0", + "jquery": "^3.7.1", + "preline": "^3.0.1", "sqlite3": "^5.1.7", - "tsconfig-paths": "^4.2.0" + "tsconfig-paths": "^4.2.0", + "vanilla-calendar-pro": "^3.0.4" }, "prisma": { "seed": "ts-node prisma/seed.ts" diff --git a/src/client/public/js/main.js b/src/client/public/js/main.js new file mode 100644 index 0000000..3631b66 --- /dev/null +++ b/src/client/public/js/main.js @@ -0,0 +1,669 @@ +(()=>{var ka=Object.create;var Ei=Object.defineProperty,Ha=Object.defineProperties,Aa=Object.getOwnPropertyDescriptor,Da=Object.getOwnPropertyDescriptors,Pa=Object.getOwnPropertyNames,In=Object.getOwnPropertySymbols,$a=Object.getPrototypeOf,ws=Object.prototype.hasOwnProperty,ar=Object.prototype.propertyIsEnumerable;var bs=(n,c,e)=>c in n?Ei(n,c,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[c]=e,B=(n,c)=>{for(var e in c||(c={}))ws.call(c,e)&&bs(n,e,c[e]);if(In)for(var e of In(c))ar.call(c,e)&&bs(n,e,c[e]);return n},De=(n,c)=>Ha(n,Da(c));var cr=(n,c)=>{var e={};for(var t in n)ws.call(n,t)&&c.indexOf(t)<0&&(e[t]=n[t]);if(n!=null&&In)for(var t of In(n))c.indexOf(t)<0&&ar.call(n,t)&&(e[t]=n[t]);return e};var ot=(n,c)=>()=>(n&&(c=n(n=0)),c);var Oa=(n,c)=>()=>(c||n((c={exports:{}}).exports,c),c.exports),Mn=(n,c)=>{for(var e in c)Ei(n,e,{get:c[e],enumerable:!0})},dr=(n,c,e,t)=>{if(c&&typeof c=="object"||typeof c=="function")for(let i of Pa(c))!ws.call(n,i)&&i!==e&&Ei(n,i,{get:()=>c[i],enumerable:!(t=Aa(c,i))||t.enumerable});return n};var Na=(n,c,e)=>(e=n!=null?ka($a(n)):{},dr(c||!n||!n.__esModule?Ei(e,"default",{value:n,enumerable:!0}):e,n)),kt=n=>dr(Ei({},"__esModule",{value:!0}),n);var g=(n,c,e)=>bs(n,typeof c!="symbol"?c+"":c,e);var Pe=(n,c,e)=>new Promise((t,i)=>{var o=p=>{try{d(e.next(p))}catch(y){i(y)}},r=p=>{try{d(e.throw(p))}catch(y){i(y)}},d=p=>p.done?t(p.value):Promise.resolve(p.value).then(o,r);d((e=e.apply(n,c)).next())});var Xe,de,Cs,Ba,ur,hr,si,pr,fr,Ss,Ts,kn,xi,je,Q,Ee,ie,Ce,mr,be=ot(()=>{Xe=n=>n==="true",de=(n,c,e="")=>(window.getComputedStyle(n).getPropertyValue(c)||e).replace(" ",""),Cs=(n,c,e="")=>{let t="";return n.classList.forEach(i=>{i.includes(c)&&(t=i)}),t.match(/:(.*)]/)?t.match(/:(.*)]/)[1]:e},Ba=n=>window.getComputedStyle(n).getPropertyValue("z-index"),ur=n=>{let c=Number.NEGATIVE_INFINITY;return n.forEach(e=>{let t=Ba(e);t!=="auto"&&(t=parseInt(t,10),t>c&&(c=t))}),c},hr=(n,c)=>{let e=n.children;for(let t=0;t{let o=c.getBoundingClientRect(),r=i?i.getBoundingClientRect():null,d=window.innerHeight,p=r?o.top-r.top:o.top,y=(i?r.bottom:d)-o.bottom,b=n.clientHeight+t;return e==="bottom"?y>=b:e==="top"?p>=b:p>=b||y>=b},pr=n=>document.activeElement===n,fr=n=>n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement,Ss=()=>/iPad|iPhone|iPod/.test(navigator.platform)?!0:navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Ts=()=>navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),kn=n=>{if(typeof n!="string")return!1;let c=n.trim()[0],e=n.trim().slice(-1);if(c==="{"&&e==="}"||c==="["&&e==="]")try{return JSON.parse(n),!0}catch(t){return!1}return!1},xi=n=>n?window.getComputedStyle(n).display==="none"?!0:xi(n.parentElement):!1,je=(n,c=200)=>{let e;return(...t)=>{clearTimeout(e),e=setTimeout(()=>{n.apply(void 0,t)},c)}},Q=(n,c,e=null)=>{let t=new CustomEvent(n,{detail:{payload:e},bubbles:!0,cancelable:!0,composed:!1});c.dispatchEvent(t)},Ee=(n,c)=>{let e=()=>{c(),n.removeEventListener("transitionend",e,!0)},t=window.getComputedStyle(n),i=t.getPropertyValue("transition-duration");t.getPropertyValue("transition-property")!=="none"&&parseFloat(i)>0?n.addEventListener("transitionend",e,!0):c()},ie=n=>{let c=document.createElement("template");return n=n.trim(),c.innerHTML=n,c.content.firstChild},Ce=(n,c,e=" ",t="add")=>{n.split(e).forEach(o=>t==="add"?c.classList.add(o):c.classList.remove(o))},mr={historyIndex:-1,addHistory(n){this.historyIndex=n},existsInHistory(n){return n>this.historyIndex},clearHistory(){this.historyIndex=-1}}});var X,ve=ot(()=>{X=class{constructor(c,e,t){this.el=c;this.options=e;this.events=t;this.el=c,this.options=e,this.events={}}createCollection(c,e){var t;c.push({id:((t=e==null?void 0:e.el)==null?void 0:t.id)||c.length+1,element:e})}fireEvent(c,e=null){if(this.events.hasOwnProperty(c))return this.events[c](e)}on(c,e){this.events[c]=e}}});var Ft,gr,vr,yr,br,Rt,Ht=ot(()=>{Ft={auto:"auto","auto-start":"auto-start","auto-end":"auto-end",top:"top","top-left":"top-start","top-right":"top-end",bottom:"bottom","bottom-left":"bottom-start","bottom-right":"bottom-end",right:"right","right-start":"right-start","right-end":"right-end",left:"left","left-start":"left-start","left-end":"left-end"},gr=["Escape","ArrowUp","ArrowDown","ArrowRight","ArrowLeft","Home","End","Enter"],vr=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End"],yr=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter","Space","Tab"],br=["ArrowUp","ArrowLeft","ArrowDown","ArrowRight","Home","End","Escape","Enter"],Rt={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536}});var Qi,Ge,Bn=ot(()=>{be();ve();Ht();Qi=class n extends X{constructor(e,t){var d,p,y,b;super(e,t);g(this,"value");g(this,"placeholder");g(this,"hasSearch");g(this,"minSearchLength");g(this,"preventSearchFocus");g(this,"mode");g(this,"viewport");g(this,"isOpened");g(this,"isMultiple");g(this,"isDisabled");g(this,"selectedItems");g(this,"apiUrl");g(this,"apiQuery");g(this,"apiOptions");g(this,"apiDataPart");g(this,"apiSearchQueryKey");g(this,"apiFieldsMap");g(this,"apiIconTag");g(this,"toggleTag");g(this,"toggleClasses");g(this,"toggleSeparators");g(this,"toggleCountText");g(this,"toggleCountTextPlacement");g(this,"toggleCountTextMinItems");g(this,"toggleCountTextMode");g(this,"wrapperClasses");g(this,"tagsItemTemplate");g(this,"tagsItemClasses");g(this,"tagsInputId");g(this,"tagsInputClasses");g(this,"dropdownTag");g(this,"dropdownClasses");g(this,"dropdownDirectionClasses");g(this,"dropdownSpace");g(this,"dropdownPlacement");g(this,"dropdownVerticalFixedPlacement");g(this,"dropdownScope");g(this,"searchTemplate");g(this,"searchWrapperTemplate");g(this,"searchPlaceholder");g(this,"searchId");g(this,"searchLimit");g(this,"isSearchDirectMatch");g(this,"searchClasses");g(this,"searchWrapperClasses");g(this,"searchNoResultTemplate");g(this,"searchNoResultText");g(this,"searchNoResultClasses");g(this,"optionAllowEmptyOption");g(this,"optionTag");g(this,"optionTemplate");g(this,"optionClasses");g(this,"descriptionClasses");g(this,"iconClasses");g(this,"animationInProcess");g(this,"wrapper");g(this,"toggle");g(this,"toggleTextWrapper");g(this,"tagsInput");g(this,"dropdown");g(this,"floatingUIInstance");g(this,"searchWrapper");g(this,"search");g(this,"searchNoResult");g(this,"selectOptions");g(this,"extraMarkup");g(this,"isAddTagOnEnter");g(this,"tagsInputHelper");g(this,"remoteOptions");g(this,"optionId",0);g(this,"onWrapperClickListener");g(this,"onToggleClickListener");g(this,"onTagsInputFocusListener");g(this,"onTagsInputInputListener");g(this,"onTagsInputInputSecondListener");g(this,"onTagsInputKeydownListener");g(this,"onSearchInputListener");let i=e.getAttribute("data-hs-select"),o=i?JSON.parse(i):{},r=B(B({},o),t);this.value=(r==null?void 0:r.value)||this.el.value||null,this.placeholder=(r==null?void 0:r.placeholder)||"Select...",this.hasSearch=(r==null?void 0:r.hasSearch)||!1,this.minSearchLength=(d=r==null?void 0:r.minSearchLength)!=null?d:0,this.preventSearchFocus=(r==null?void 0:r.preventSearchFocus)||!1,this.mode=(r==null?void 0:r.mode)||"default",this.viewport=typeof(r==null?void 0:r.viewport)!="undefined"?document.querySelector(r==null?void 0:r.viewport):null,this.isOpened=!!(r!=null&&r.isOpened)||!1,this.isMultiple=this.el.hasAttribute("multiple")||!1,this.isDisabled=this.el.hasAttribute("disabled")||!1,this.selectedItems=[],this.apiUrl=(r==null?void 0:r.apiUrl)||null,this.apiQuery=(r==null?void 0:r.apiQuery)||null,this.apiOptions=(r==null?void 0:r.apiOptions)||null,this.apiSearchQueryKey=(r==null?void 0:r.apiSearchQueryKey)||null,this.apiDataPart=(r==null?void 0:r.apiDataPart)||null,this.apiFieldsMap=(r==null?void 0:r.apiFieldsMap)||null,this.apiIconTag=(r==null?void 0:r.apiIconTag)||null,this.wrapperClasses=(r==null?void 0:r.wrapperClasses)||null,this.toggleTag=(r==null?void 0:r.toggleTag)||null,this.toggleClasses=(r==null?void 0:r.toggleClasses)||null,this.toggleCountText=typeof(r==null?void 0:r.toggleCountText)===void 0?null:r.toggleCountText,this.toggleCountTextPlacement=(r==null?void 0:r.toggleCountTextPlacement)||"postfix",this.toggleCountTextMinItems=(r==null?void 0:r.toggleCountTextMinItems)||1,this.toggleCountTextMode=(r==null?void 0:r.toggleCountTextMode)||"countAfterLimit",this.toggleSeparators={items:((p=r==null?void 0:r.toggleSeparators)==null?void 0:p.items)||", ",betweenItemsAndCounter:((y=r==null?void 0:r.toggleSeparators)==null?void 0:y.betweenItemsAndCounter)||"and"},this.tagsItemTemplate=(r==null?void 0:r.tagsItemTemplate)||null,this.tagsItemClasses=(r==null?void 0:r.tagsItemClasses)||null,this.tagsInputId=(r==null?void 0:r.tagsInputId)||null,this.tagsInputClasses=(r==null?void 0:r.tagsInputClasses)||null,this.dropdownTag=(r==null?void 0:r.dropdownTag)||null,this.dropdownClasses=(r==null?void 0:r.dropdownClasses)||null,this.dropdownDirectionClasses=(r==null?void 0:r.dropdownDirectionClasses)||null,this.dropdownSpace=(r==null?void 0:r.dropdownSpace)||10,this.dropdownPlacement=(r==null?void 0:r.dropdownPlacement)||null,this.dropdownVerticalFixedPlacement=(r==null?void 0:r.dropdownVerticalFixedPlacement)||null,this.dropdownScope=(r==null?void 0:r.dropdownScope)||"parent",this.searchTemplate=(r==null?void 0:r.searchTemplate)||null,this.searchWrapperTemplate=(r==null?void 0:r.searchWrapperTemplate)||null,this.searchWrapperClasses=(r==null?void 0:r.searchWrapperClasses)||"bg-white p-2 sticky top-0",this.searchId=(r==null?void 0:r.searchId)||null,this.searchLimit=(r==null?void 0:r.searchLimit)||1/0,this.isSearchDirectMatch=typeof(r==null?void 0:r.isSearchDirectMatch)!="undefined"?r==null?void 0:r.isSearchDirectMatch:!0,this.searchClasses=(r==null?void 0:r.searchClasses)||"block w-[calc(100%-32px)] text-sm border-gray-200 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 py-2 px-3 my-2 mx-4",this.searchPlaceholder=(r==null?void 0:r.searchPlaceholder)||"Search...",this.searchNoResultTemplate=(r==null?void 0:r.searchNoResultTemplate)||"",this.searchNoResultText=(r==null?void 0:r.searchNoResultText)||"No results found",this.searchNoResultClasses=(r==null?void 0:r.searchNoResultClasses)||"px-4 text-sm text-gray-800 dark:text-neutral-200",this.optionAllowEmptyOption=typeof(r==null?void 0:r.optionAllowEmptyOption)!="undefined"?r==null?void 0:r.optionAllowEmptyOption:!1,this.optionTemplate=(r==null?void 0:r.optionTemplate)||null,this.optionTag=(r==null?void 0:r.optionTag)||null,this.optionClasses=(r==null?void 0:r.optionClasses)||null,this.extraMarkup=(r==null?void 0:r.extraMarkup)||null,this.descriptionClasses=(r==null?void 0:r.descriptionClasses)||null,this.iconClasses=(r==null?void 0:r.iconClasses)||null,this.isAddTagOnEnter=(b=r==null?void 0:r.isAddTagOnEnter)!=null?b:!0,this.animationInProcess=!1,this.selectOptions=[],this.remoteOptions=[],this.tagsInputHelper=null,this.init()}wrapperClick(e){!e.target.closest("[data-hs-select-dropdown]")&&!e.target.closest("[data-tag-value]")&&this.tagsInput.focus()}toggleClick(){if(this.isDisabled)return!1;this.toggleFn()}tagsInputFocus(){this.isOpened||this.open()}tagsInputInput(){this.calculateInputWidth()}tagsInputInputSecond(e){this.searchOptions(e.target.value)}tagsInputKeydown(e){if(e.key==="Enter"&&this.isAddTagOnEnter){let t=e.target.value;if(this.selectOptions.find(i=>i.val===t))return!1;this.addSelectOption(t,t),this.buildOption(t,t),this.dropdown.querySelector(`[data-value="${t}"]`).click(),this.resetTagsInputField()}}searchInput(e){let t=e.target.value;this.apiUrl?this.remoteSearch(t):this.searchOptions(t)}setValue(e){this.value=e,this.clearSelections(),Array.isArray(e)?this.mode==="tags"?(this.unselectMultipleItems(),this.selectMultipleItems(),this.selectedItems=[],this.wrapper.querySelectorAll("[data-tag-value]").forEach(i=>i.remove()),this.setTagsItems(),this.reassignTagsInputPlaceholder(this.value.length?"":this.placeholder)):(this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder,this.unselectMultipleItems(),this.selectMultipleItems()):(this.setToggleTitle(),this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.selectSingleItem())}init(){this.createCollection(window.$hsSelectCollection,this),this.build()}build(){if(this.el.style.display="none",this.el.children&&Array.from(this.el.children).filter(e=>this.optionAllowEmptyOption||!this.optionAllowEmptyOption&&e.value&&e.value!=="").forEach(e=>{let t=e.getAttribute("data-hs-select-option");this.selectOptions=[...this.selectOptions,{title:e.textContent,val:e.value,disabled:e.disabled,options:t!=="undefined"?JSON.parse(t):null}]}),this.isMultiple){let e=Array.from(this.el.children).filter(t=>t.selected);if(e){let t=[];e.forEach(i=>{t.push(i.value)}),this.value=t}}this.buildWrapper(),this.mode==="tags"?this.buildTags():this.buildToggle(),this.buildDropdown(),this.extraMarkup&&this.buildExtraMarkup()}buildWrapper(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("hs-select","relative"),this.mode==="tags"&&(this.onWrapperClickListener=e=>this.wrapperClick(e),this.wrapper.addEventListener("click",this.onWrapperClickListener)),this.wrapperClasses&&Ce(this.wrapperClasses,this.wrapper),this.el.before(this.wrapper),this.wrapper.append(this.el)}buildExtraMarkup(){let e=i=>{let o=ie(i);return this.wrapper.append(o),o},t=i=>{i.classList.contains("--prevent-click")||i.addEventListener("click",o=>{o.stopPropagation(),this.toggleFn()})};if(Array.isArray(this.extraMarkup))this.extraMarkup.forEach(i=>{let o=e(i);t(o)});else{let i=e(this.extraMarkup);t(i)}}buildToggle(){var i,o;let e,t;this.toggleTextWrapper=document.createElement("span"),this.toggleTextWrapper.classList.add("truncate"),this.toggle=ie(this.toggleTag||"
"),e=this.toggle.querySelector("[data-icon]"),t=this.toggle.querySelector("[data-title]"),!this.isMultiple&&e&&this.setToggleIcon(),!this.isMultiple&&t&&this.setToggleTitle(),this.isMultiple?this.toggleTextWrapper.innerHTML=this.value.length?this.stringFromValue():this.placeholder:this.toggleTextWrapper.innerHTML=((i=this.getItemByValue(this.value))==null?void 0:i.title)||this.placeholder,t||this.toggle.append(this.toggleTextWrapper),this.toggleClasses&&Ce(this.toggleClasses,this.toggle),this.isDisabled&&this.toggle.classList.add("disabled"),this.wrapper&&this.wrapper.append(this.toggle),(o=this.toggle)!=null&&o.ariaExpanded&&(this.isOpened?this.toggle.ariaExpanded="true":this.toggle.ariaExpanded="false"),this.onToggleClickListener=()=>this.toggleClick(),this.toggle.addEventListener("click",this.onToggleClickListener)}setToggleIcon(){var i;let e=this.getItemByValue(this.value),t=this.toggle.querySelector("[data-icon]");if(t){t.innerHTML="";let o=ie(this.apiUrl&&this.apiIconTag?this.apiIconTag||"":((i=e==null?void 0:e.options)==null?void 0:i.icon)||"");this.value&&this.apiUrl&&this.apiIconTag&&e[this.apiFieldsMap.icon]&&(o.src=e[this.apiFieldsMap.icon]||""),t.append(o),o?t.classList.remove("hidden"):t.classList.add("hidden")}}setToggleTitle(){var t,i;let e=this.toggle.querySelector("[data-title]");e?(e.innerHTML=((t=this.getItemByValue(this.value))==null?void 0:t.title)||this.placeholder,e.classList.add("truncate"),this.toggle.append(e)):this.toggle.innerText=((i=this.getItemByValue(this.value))==null?void 0:i.title)||this.placeholder}buildTags(){this.isDisabled&&this.wrapper.classList.add("disabled"),this.buildTagsInput(),this.setTagsItems()}reassignTagsInputPlaceholder(e){this.tagsInput.placeholder=e,this.tagsInputHelper.innerHTML=e,this.calculateInputWidth()}buildTagsItem(e){var y,b,T,k;let t=this.getItemByValue(e),i,o,r,d,p=document.createElement("div");if(p.setAttribute("data-tag-value",e),this.tagsItemClasses&&Ce(this.tagsItemClasses,p),this.tagsItemTemplate&&(i=ie(this.tagsItemTemplate),p.append(i)),(y=t==null?void 0:t.options)!=null&&y.icon||this.apiIconTag){let L=ie(this.apiUrl&&this.apiIconTag?this.apiIconTag:(b=t==null?void 0:t.options)==null?void 0:b.icon);this.apiUrl&&this.apiIconTag&&t[this.apiFieldsMap.icon]&&(L.src=t[this.apiFieldsMap.icon]||""),d=i?i.querySelector("[data-icon]"):document.createElement("span"),d.append(L),i||p.append(d)}i&&i.querySelector("[data-icon]")&&!((T=t==null?void 0:t.options)!=null&&T.icon)&&!this.apiUrl&&!this.apiIconTag&&!t[(k=this.apiFieldsMap)==null?void 0:k.icon]&&i.querySelector("[data-icon]").classList.add("hidden"),o=i?i.querySelector("[data-title]"):document.createElement("span"),o.textContent=t.title||"",i||p.append(o),i?r=i.querySelector("[data-remove]"):(r=document.createElement("span"),r.textContent="X",p.append(r)),r.addEventListener("click",()=>{this.value=this.value.filter(L=>L!==e),this.selectedItems=this.selectedItems.filter(L=>L!==e),this.value.length||this.reassignTagsInputPlaceholder(this.placeholder),this.unselectMultipleItems(),this.selectMultipleItems(),p.remove(),this.triggerChangeEventForNativeSelect()}),this.wrapper.append(p)}getItemByValue(e){return this.apiUrl?this.remoteOptions.find(i=>`${i[this.apiFieldsMap.val]}`===e||i[this.apiFieldsMap.title]===e):this.selectOptions.find(i=>i.val===e)}setTagsItems(){this.value&&this.value.forEach(e=>{this.selectedItems.includes(e)||this.buildTagsItem(e),this.selectedItems=this.selectedItems.includes(e)?this.selectedItems:[...this.selectedItems,e]}),this.isOpened&&this.floatingUIInstance&&this.floatingUIInstance.update()}buildTagsInput(){this.tagsInput=document.createElement("input"),this.tagsInputId&&(this.tagsInput.id=this.tagsInputId),this.tagsInputClasses&&Ce(this.tagsInputClasses,this.tagsInput),this.onTagsInputFocusListener=()=>this.tagsInputFocus(),this.onTagsInputInputListener=()=>this.tagsInputInput(),this.onTagsInputInputSecondListener=je(e=>this.tagsInputInputSecond(e)),this.onTagsInputKeydownListener=e=>this.tagsInputKeydown(e),this.tagsInput.addEventListener("focus",this.onTagsInputFocusListener),this.tagsInput.addEventListener("input",this.onTagsInputInputListener),this.tagsInput.addEventListener("input",this.onTagsInputInputSecondListener),this.tagsInput.addEventListener("keydown",this.onTagsInputKeydownListener),this.wrapper.append(this.tagsInput),setTimeout(()=>{this.adjustInputWidth(),this.reassignTagsInputPlaceholder(this.value.length?"":this.placeholder)})}buildDropdown(){this.dropdown=ie(this.dropdownTag||"
"),this.dropdown.setAttribute("data-hs-select-dropdown",""),this.dropdownScope==="parent"&&(this.dropdown.classList.add("absolute"),this.dropdownVerticalFixedPlacement||this.dropdown.classList.add("top-full")),this.dropdown.role="listbox",this.dropdown.tabIndex=-1,this.dropdown.ariaOrientation="vertical",this.isOpened||this.dropdown.classList.add("hidden"),this.dropdownClasses&&Ce(this.dropdownClasses,this.dropdown),this.wrapper&&this.wrapper.append(this.dropdown),this.dropdown&&this.hasSearch&&this.buildSearch(),this.selectOptions&&this.selectOptions.forEach((e,t)=>this.buildOption(e.title,e.val,e.disabled,e.selected,e.options,`${t}`)),this.apiUrl&&this.optionsFromRemoteData(),this.dropdownScope==="window"&&this.buildFloatingUI()}buildFloatingUI(){if(typeof FloatingUIDOM!="undefined"&&FloatingUIDOM.computePosition){document.body.appendChild(this.dropdown);let e=this.mode==="tags"?this.wrapper:this.toggle,t={placement:Ft[this.dropdownPlacement]||"bottom",strategy:"fixed",middleware:[FloatingUIDOM.offset([0,5])]},i=()=>{FloatingUIDOM.computePosition(e,this.dropdown,t).then(({x:r,y:d,placement:p})=>{Object.assign(this.dropdown.style,{position:"fixed",left:`${r}px`,top:`${d}px`}),this.dropdown.setAttribute("data-placement",p)})};i();let o=FloatingUIDOM.autoUpdate(e,this.dropdown,i);this.floatingUIInstance={update:i,destroy:o}}else console.error("FloatingUIDOM not found! Please enable it on the page.")}updateDropdownWidth(){let e=this.mode==="tags"?this.wrapper:this.toggle;this.dropdown.style.width=`${e.clientWidth}px`}buildSearch(){let e;this.searchWrapper=ie(this.searchWrapperTemplate||"
"),this.searchWrapperClasses&&Ce(this.searchWrapperClasses,this.searchWrapper),e=this.searchWrapper.querySelector("[data-input]");let t=ie(this.searchTemplate||'');this.search=t.tagName==="INPUT"?t:t.querySelector(":scope input"),this.search.placeholder=this.searchPlaceholder,this.searchClasses&&Ce(this.searchClasses,this.search),this.searchId&&(this.search.id=this.searchId),this.onSearchInputListener=je(i=>this.searchInput(i)),this.search.addEventListener("input",this.onSearchInputListener),e?e.append(t):this.searchWrapper.append(t),this.dropdown.append(this.searchWrapper)}buildOption(e,t,i=!1,o=!1,r,d="1",p){var $;let y=null,b=null,T=null,k=null,L=ie(this.optionTag||"
");if(L.setAttribute("data-value",t),L.setAttribute("data-title-value",e),L.setAttribute("tabIndex",d),L.classList.add("cursor-pointer"),L.setAttribute("data-id",p||`${this.optionId}`),p||this.optionId++,i&&L.classList.add("disabled"),o&&(this.isMultiple?this.value=[...this.value,t]:this.value=t),this.optionTemplate&&(y=ie(this.optionTemplate),L.append(y)),y?(b=y.querySelector("[data-title]"),b.textContent=e||""):L.textContent=e||"",r){if(r.icon){let W=ie(($=this.apiIconTag)!=null?$:r.icon);if(W.classList.add("max-w-full"),this.apiUrl&&(W.setAttribute("alt",e),W.setAttribute("src",r.icon)),y)T=y.querySelector("[data-icon]"),T.append(W);else{let N=ie("
");this.iconClasses&&Ce(this.iconClasses,N),N.append(W),L.append(N)}}if(r.description)if(y)k=y.querySelector("[data-description]"),k&&k.append(r.description);else{let W=ie("
");W.textContent=r.description,this.descriptionClasses&&Ce(this.descriptionClasses,W),L.append(W)}}y&&y.querySelector("[data-icon]")&&!r&&!(r!=null&&r.icon)&&y.querySelector("[data-icon]").classList.add("hidden"),this.value&&(this.isMultiple?this.value.includes(t):this.value===t)&&L.classList.add("selected"),i||L.addEventListener("click",()=>this.onSelectOption(t)),this.optionClasses&&Ce(this.optionClasses,L),this.dropdown&&this.dropdown.append(L),o&&this.setNewValue()}buildOptionFromRemoteData(e,t,i=!1,o=!1,r="1",d,p){r?this.buildOption(e,t,i,o,p,r,d):alert("ID parameter is required for generating remote options! Please check your API endpoint have it.")}buildOptionsFromRemoteData(e){e.forEach((t,i)=>{let o=null,r="",d="",p={id:"",val:"",title:"",icon:null,description:null,rest:{}};Object.keys(t).forEach(y=>{var b;t[this.apiFieldsMap.id]&&(o=t[this.apiFieldsMap.id]),(t[this.apiFieldsMap.val]||t[this.apiFieldsMap.title])&&(d=t[this.apiFieldsMap.val]||t[this.apiFieldsMap.title]),t[this.apiFieldsMap.title]&&(r=t[this.apiFieldsMap.title]),t[this.apiFieldsMap.icon]&&(p.icon=t[this.apiFieldsMap.icon]),t[(b=this.apiFieldsMap)==null?void 0:b.description]&&(p.description=t[this.apiFieldsMap.description]),p.rest[y]=t[y]}),this.buildOriginalOption(r,`${d}`,o,!1,!1,p),this.buildOptionFromRemoteData(r,`${d}`,!1,!1,`${i}`,o,p)}),this.sortElements(this.el,"option"),this.sortElements(this.dropdown,"[data-value]")}optionsFromRemoteData(e=""){return Pe(this,null,function*(){let t=yield this.apiRequest(e);this.remoteOptions=t,t.length?this.buildOptionsFromRemoteData(this.remoteOptions):console.log("There is no data were responded!")})}apiRequest(e=""){return Pe(this,null,function*(){try{let t=this.apiUrl,i=this.apiSearchQueryKey?`${this.apiSearchQueryKey}=${e.toLowerCase()}`:null,o=`${this.apiQuery}`,r=this.apiOptions||{};i&&(t+=`?${i}`),this.apiQuery&&(t+=`${i?"&":"?"}${o}`);let p=yield(yield fetch(t,r)).json();return this.apiDataPart?p[this.apiDataPart]:p}catch(t){console.error(t)}})}sortElements(e,t){let i=Array.from(e.querySelectorAll(t));i.sort((o,r)=>{let d=o.classList.contains("selected")||o.hasAttribute("selected"),p=r.classList.contains("selected")||r.hasAttribute("selected");return d&&!p?-1:!d&&p?1:0}),i.forEach(o=>e.appendChild(o))}remoteSearch(e){return Pe(this,null,function*(){if(e.length<=this.minSearchLength){let p=yield this.apiRequest("");return this.remoteOptions=p,Array.from(this.dropdown.querySelectorAll("[data-value]")).forEach(y=>y.remove()),Array.from(this.el.querySelectorAll("option[value]")).forEach(y=>{y.remove()}),p.length?this.buildOptionsFromRemoteData(p):console.log("No data responded!"),!1}let t=yield this.apiRequest(e);this.remoteOptions=t;let i=t.map(p=>`${p.id}`),o=null,r=this.dropdown.querySelectorAll("[data-value]");this.el.querySelectorAll("[data-hs-select-option]").forEach(p=>{var b;let y=p.getAttribute("data-id");!i.includes(y)&&!((b=this.value)!=null&&b.includes(p.value))&&this.destroyOriginalOption(p.value)}),r.forEach(p=>{var b;let y=p.getAttribute("data-id");!i.includes(y)&&!((b=this.value)!=null&&b.includes(p.getAttribute("data-value")))?this.destroyOption(p.getAttribute("data-value")):i=i.filter(T=>T!==y)}),o=t.filter(p=>i.includes(`${p.id}`)),o.length?this.buildOptionsFromRemoteData(o):console.log("No data responded!")})}destroyOption(e){let t=this.dropdown.querySelector(`[data-value="${e}"]`);if(!t)return!1;t.remove()}buildOriginalOption(e,t,i,o,r,d){let p=ie("");p.setAttribute("value",t),o&&p.setAttribute("disabled","disabled"),r&&p.setAttribute("selected","selected"),i&&p.setAttribute("data-id",i),p.setAttribute("data-hs-select-option",JSON.stringify(d)),p.innerText=e,this.el.append(p)}destroyOriginalOption(e){let t=this.el.querySelector(`[value="${e}"]`);if(!t)return!1;t.remove()}buildTagsInputHelper(){this.tagsInputHelper=document.createElement("span"),this.tagsInputHelper.style.fontSize=window.getComputedStyle(this.tagsInput).fontSize,this.tagsInputHelper.style.fontFamily=window.getComputedStyle(this.tagsInput).fontFamily,this.tagsInputHelper.style.fontWeight=window.getComputedStyle(this.tagsInput).fontWeight,this.tagsInputHelper.style.letterSpacing=window.getComputedStyle(this.tagsInput).letterSpacing,this.tagsInputHelper.style.visibility="hidden",this.tagsInputHelper.style.whiteSpace="pre",this.tagsInputHelper.style.position="absolute",this.wrapper.appendChild(this.tagsInputHelper)}calculateInputWidth(){this.tagsInputHelper.textContent=this.tagsInput.value||this.tagsInput.placeholder;let e=parseInt(window.getComputedStyle(this.tagsInput).paddingLeft)+parseInt(window.getComputedStyle(this.tagsInput).paddingRight),t=parseInt(window.getComputedStyle(this.tagsInput).borderLeftWidth)+parseInt(window.getComputedStyle(this.tagsInput).borderRightWidth),i=this.tagsInputHelper.offsetWidth+e+t,o=this.wrapper.offsetWidth-(parseInt(window.getComputedStyle(this.wrapper).paddingLeft)+parseInt(window.getComputedStyle(this.wrapper).paddingRight));this.tagsInput.style.width=`${Math.min(i,o)+2}px`}adjustInputWidth(){this.buildTagsInputHelper(),this.calculateInputWidth()}onSelectOption(e){if(this.clearSelections(),this.isMultiple?(this.value=this.value.includes(e)?Array.from(this.value).filter(t=>t!==e):[...Array.from(this.value),e],this.selectMultipleItems(),this.setNewValue()):(this.value=e,this.selectSingleItem(),this.setNewValue()),this.fireEvent("change",this.value),this.mode==="tags"){let t=this.selectedItems.filter(i=>!this.value.includes(i));t.length&&t.forEach(i=>{this.selectedItems=this.selectedItems.filter(o=>o!==i),this.wrapper.querySelector(`[data-tag-value="${i}"]`).remove()}),this.resetTagsInputField()}this.isMultiple||(this.toggle.querySelector("[data-icon]")&&this.setToggleIcon(),this.toggle.querySelector("[data-title]")&&this.setToggleTitle(),this.close(!0)),!this.value.length&&this.mode==="tags"&&this.reassignTagsInputPlaceholder(this.placeholder),this.isOpened&&this.mode==="tags"&&this.tagsInput&&this.tagsInput.focus(),this.triggerChangeEventForNativeSelect()}triggerChangeEventForNativeSelect(){let e=new Event("change",{bubbles:!0});this.el.dispatchEvent(e),Q("change.hs.select",this.el,this.value)}addSelectOption(e,t,i,o,r){this.selectOptions=[...this.selectOptions,{title:e,val:t,disabled:i,selected:o,options:r}]}removeSelectOption(e,t=!1){if(!!!this.selectOptions.some(o=>o.val===e))return!1;this.selectOptions=this.selectOptions.filter(o=>o.val!==e),this.value=t?this.value.filter(o=>o!==e):e}resetTagsInputField(){this.tagsInput.value="",this.reassignTagsInputPlaceholder(""),this.searchOptions("")}clearSelections(){Array.from(this.dropdown.children).forEach(e=>{e.classList.contains("selected")&&e.classList.remove("selected")}),Array.from(this.el.children).forEach(e=>{e.selected&&(e.selected=!1)})}setNewValue(){var e;this.mode==="tags"?this.setTagsItems():(e=this.value)!=null&&e.length?this.toggleTextWrapper.innerHTML=this.stringFromValue():this.toggleTextWrapper.innerHTML=this.placeholder}stringFromValueBasic(e){var o;let t=[],i="";if(e.forEach(r=>{this.isMultiple?this.value.includes(r.val)&&t.push(r.title):this.value===r.val&&t.push(r.title)}),this.toggleCountText!==void 0&&this.toggleCountText!==null&&t.length>=this.toggleCountTextMinItems)if(this.toggleCountTextMode==="nItemsAndCount"){let r=t.slice(0,this.toggleCountTextMinItems-1),d=[r.join(this.toggleSeparators.items)],p=`${t.length-r.length}`;if((o=this==null?void 0:this.toggleSeparators)!=null&&o.betweenItemsAndCounter&&d.push(this.toggleSeparators.betweenItemsAndCounter),this.toggleCountText)switch(this.toggleCountTextPlacement){case"postfix-no-space":d.push(`${p}${this.toggleCountText}`);break;case"prefix-no-space":d.push(`${this.toggleCountText}${p}`);break;case"prefix":d.push(`${this.toggleCountText} ${p}`);break;default:d.push(`${p} ${this.toggleCountText}`);break}i=d.join(" ")}else i=`${t.length} ${this.toggleCountText}`;else i=t.join(this.toggleSeparators.items);return i}stringFromValueRemoteData(){let e=this.dropdown.querySelectorAll("[data-title-value]"),t=[],i="";if(e.forEach(o=>{let r=o.getAttribute("data-value"),d=o.getAttribute("data-title-value");this.isMultiple?this.value.includes(r)&&t.push(d):this.value===r&&t.push(d)}),this.toggleCountText&&this.toggleCountText!==""&&t.length>=this.toggleCountTextMinItems)if(this.toggleCountTextMode==="nItemsAndCount"){let o=t.slice(0,this.toggleCountTextMinItems-1);i=`${o.join(this.toggleSeparators.items)} ${this.toggleSeparators.betweenItemsAndCounter} ${t.length-o.length} ${this.toggleCountText}`}else i=`${t.length} ${this.toggleCountText}`;else i=t.join(this.toggleSeparators.items);return i}stringFromValue(){return this.apiUrl?this.stringFromValueRemoteData():this.stringFromValueBasic(this.selectOptions)}selectSingleItem(){let e=Array.from(this.el.children).find(i=>this.value===i.value);e.selected=!0;let t=Array.from(this.dropdown.children).find(i=>this.value===i.getAttribute("data-value"));t&&t.classList.add("selected")}selectMultipleItems(){Array.from(this.dropdown.children).filter(e=>this.value.includes(e.getAttribute("data-value"))).forEach(e=>e.classList.add("selected")),Array.from(this.el.children).filter(e=>this.value.includes(e.value)).forEach(e=>e.selected=!0)}unselectMultipleItems(){Array.from(this.dropdown.children).forEach(e=>e.classList.remove("selected")),Array.from(this.el.children).forEach(e=>e.selected=!1)}searchOptions(e){if(e.length<=this.minSearchLength)return this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.dropdown.querySelectorAll("[data-value]").forEach(d=>{d.classList.remove("hidden")}),!1;this.searchNoResult&&(this.searchNoResult.remove(),this.searchNoResult=null),this.searchNoResult=ie(this.searchNoResultTemplate),this.searchNoResult.innerText=this.searchNoResultText,Ce(this.searchNoResultClasses,this.searchNoResult);let t=this.dropdown.querySelectorAll("[data-value]"),i=!1,o;this.searchLimit&&(o=0),t.forEach(r=>{let d=r.getAttribute("data-title-value").toLocaleLowerCase(),p=this.isSearchDirectMatch,y;if(p)y=!d.includes(e.toLowerCase())||this.searchLimit&&o>=this.searchLimit;else{let b=e?e.split("").map(k=>/\w/.test(k)?`${k}[\\W_]*`:"\\W*").join(""):"";y=!new RegExp(b,"i").test(d.trim())||this.searchLimit&&o>=this.searchLimit}y?r.classList.add("hidden"):(r.classList.remove("hidden"),i=!0,this.searchLimit&&o++)}),i||this.dropdown.append(this.searchNoResult)}eraseToggleIcon(){let e=this.toggle.querySelector("[data-icon]");e&&(e.innerHTML=null,e.classList.add("hidden"))}eraseToggleTitle(){let e=this.toggle.querySelector("[data-title]");e?e.innerHTML=this.placeholder:this.toggleTextWrapper.innerHTML=this.placeholder}toggleFn(){this.isOpened?this.close():this.open()}destroy(){this.wrapper&&this.wrapper.removeEventListener("click",this.onWrapperClickListener),this.toggle&&this.toggle.removeEventListener("click",this.onToggleClickListener),this.tagsInput&&(this.tagsInput.removeEventListener("focus",this.onTagsInputFocusListener),this.tagsInput.removeEventListener("input",this.onTagsInputInputListener),this.tagsInput.removeEventListener("input",this.onTagsInputInputSecondListener),this.tagsInput.removeEventListener("keydown",this.onTagsInputKeydownListener)),this.search&&this.search.removeEventListener("input",this.onSearchInputListener);let e=this.el.parentElement.parentElement;this.el.classList.add("hidden"),this.el.style.display="",e.prepend(this.el),e.querySelector(".hs-select").remove(),this.wrapper=null,window.$hsSelectCollection=window.$hsSelectCollection.filter(({element:t})=>t.el!==this.el)}open(){var t;let e=((t=window==null?void 0:window.$hsSelectCollection)==null?void 0:t.find(i=>i.element.isOpened))||null;if(e&&e.element.close(),this.animationInProcess)return!1;this.animationInProcess=!0,this.dropdownScope==="window"&&this.dropdown.classList.add("invisible"),this.dropdown.classList.remove("hidden"),this.recalculateDirection(),setTimeout(()=>{var i;(i=this==null?void 0:this.toggle)!=null&&i.ariaExpanded&&(this.toggle.ariaExpanded="true"),this.wrapper.classList.add("active"),this.dropdown.classList.add("opened"),this.dropdown.classList.contains("w-full")&&this.dropdownScope==="window"&&this.updateDropdownWidth(),this.floatingUIInstance&&this.dropdownScope==="window"&&(this.floatingUIInstance.update(),this.dropdown.classList.remove("invisible")),this.hasSearch&&!this.preventSearchFocus&&this.search.focus(),this.animationInProcess=!1}),this.isOpened=!0}close(e=!1){var t,i,o,r;if(this.animationInProcess)return!1;this.animationInProcess=!0,(t=this==null?void 0:this.toggle)!=null&&t.ariaExpanded&&(this.toggle.ariaExpanded="false"),this.wrapper.classList.remove("active"),this.dropdown.classList.remove("opened","bottom-full","top-full"),(i=this.dropdownDirectionClasses)!=null&&i.bottom&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),(o=this.dropdownDirectionClasses)!=null&&o.top&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.style.marginBottom="",Ee(this.dropdown,()=>{this.dropdown.classList.add("hidden"),this.hasSearch&&(this.search.value="",this.search.dispatchEvent(new Event("input",{bubbles:!0})),this.search.blur()),e&&this.toggle.focus(),this.animationInProcess=!1}),(r=this.dropdown.querySelector(".hs-select-option-highlighted"))==null||r.classList.remove("hs-select-option-highlighted"),this.isOpened=!1}addOption(e){let t=`${this.selectOptions.length}`,i=o=>{let{title:r,val:d,disabled:p,selected:y,options:b}=o;!!this.selectOptions.some(k=>k.val===d)||(this.addSelectOption(r,d,p,y,b),this.buildOption(r,d,p,y,b,t),this.buildOriginalOption(r,d,null,p,y,b),y&&!this.isMultiple&&this.onSelectOption(d))};Array.isArray(e)?e.forEach(o=>{i(o)}):i(e)}removeOption(e){let t=(i,o=!1)=>{!!this.selectOptions.some(d=>d.val===i)&&(this.removeSelectOption(i,o),this.destroyOption(i),this.destroyOriginalOption(i),this.value===i&&(this.value=null,this.eraseToggleTitle(),this.eraseToggleIcon()))};Array.isArray(e)?e.forEach(i=>{t(i,this.isMultiple)}):t(e,this.isMultiple),this.setNewValue()}recalculateDirection(){var e,t,i,o;if(this!=null&&this.dropdownVerticalFixedPlacement&&(this.dropdown.classList.contains("bottom-full")||this.dropdown.classList.contains("top-full")))return!1;(this==null?void 0:this.dropdownVerticalFixedPlacement)==="top"?(this.dropdown.classList.add("bottom-full"),this.dropdown.style.marginBottom=`${this.dropdownSpace}px`):(this==null?void 0:this.dropdownVerticalFixedPlacement)==="bottom"?(this.dropdown.classList.add("top-full"),this.dropdown.style.marginTop=`${this.dropdownSpace}px`):si(this.dropdown,this.toggle||this.tagsInput,"bottom",this.dropdownSpace,this.viewport)?(this.dropdown.classList.remove("bottom-full"),(e=this.dropdownDirectionClasses)!=null&&e.bottom&&this.dropdown.classList.remove(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom="",this.dropdown.classList.add("top-full"),(t=this.dropdownDirectionClasses)!=null&&t.top&&this.dropdown.classList.add(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop=`${this.dropdownSpace}px`):(this.dropdown.classList.remove("top-full"),(i=this.dropdownDirectionClasses)!=null&&i.top&&this.dropdown.classList.remove(this.dropdownDirectionClasses.top),this.dropdown.style.marginTop="",this.dropdown.classList.add("bottom-full"),(o=this.dropdownDirectionClasses)!=null&&o.bottom&&this.dropdown.classList.add(this.dropdownDirectionClasses.bottom),this.dropdown.style.marginBottom=`${this.dropdownSpace}px`)}static findInCollection(e){return window.$hsSelectCollection.find(t=>e instanceof n?t.element.el===e.el:typeof e=="string"?t.element.el===document.querySelector(e):t.element.el===e)||null}static getInstance(e,t){let i=window.$hsSelectCollection.find(o=>o.element.el===(typeof e=="string"?document.querySelector(e):e));return i?t?i:i.element:null}static autoInit(){window.$hsSelectCollection||(window.$hsSelectCollection=[],window.addEventListener("click",e=>{let t=e.target;n.closeCurrentlyOpened(t)}),document.addEventListener("keydown",e=>n.accessibility(e))),window.$hsSelectCollection&&(window.$hsSelectCollection=window.$hsSelectCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-select]:not(.--prevent-on-load-init)").forEach(e=>{if(!window.$hsSelectCollection.find(t=>{var i;return((i=t==null?void 0:t.element)==null?void 0:i.el)===e})){let t=e.getAttribute("data-hs-select"),i=t?JSON.parse(t):{};new n(e,i)}})}static open(e){let t=n.findInCollection(e);t&&!t.element.isOpened&&t.element.open()}static close(e){let t=n.findInCollection(e);t&&t.element.isOpened&&t.element.close()}static closeCurrentlyOpened(e=null){if(!e.closest(".hs-select.active")&&!e.closest("[data-hs-select-dropdown].opened")){let t=window.$hsSelectCollection.filter(i=>i.element.isOpened)||null;t&&t.forEach(i=>{i.element.close()})}}static accessibility(e){let t=window.$hsSelectCollection.find(i=>i.element.isOpened);if(t&&yr.includes(e.code)&&!e.metaKey)switch(e.code){case"Escape":e.preventDefault(),this.onEscape();break;case"ArrowUp":e.preventDefault(),e.stopImmediatePropagation(),this.onArrow();break;case"ArrowDown":e.preventDefault(),e.stopImmediatePropagation(),this.onArrow(!1);break;case"Tab":e.preventDefault(),e.stopImmediatePropagation(),this.onTab(e.shiftKey);break;case"Home":e.preventDefault(),e.stopImmediatePropagation(),this.onStartEnd();break;case"End":e.preventDefault(),e.stopImmediatePropagation(),this.onStartEnd(!1);break;case"Enter":e.preventDefault(),this.onEnter(e);break;case"Space":if(pr(t.element.search))break;e.preventDefault(),this.onEnter(e);break;default:break}}static onEscape(){let e=window.$hsSelectCollection.find(t=>t.element.isOpened);e&&e.element.close()}static onArrow(e=!0){let t=window.$hsSelectCollection.find(i=>i.element.isOpened);if(t){let i=t.element.dropdown;if(!i)return!1;let r=(e?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter(y=>!y.classList.contains("disabled")),d=i.querySelector(".hs-select-option-highlighted")||i.querySelector(".selected");d||r[0].classList.add("hs-select-option-highlighted");let p=r.findIndex(y=>y===d);p+1i.element.isOpened);if(t){let i=t.element.dropdown;if(!i)return!1;let r=(e?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse():Array.from(i.querySelectorAll(":scope > *:not(.hidden)"))).filter(y=>!y.classList.contains("disabled")),d=i.querySelector(".hs-select-option-highlighted")||i.querySelector(".selected");d||r[0].classList.add("hs-select-option-highlighted");let p=r.findIndex(y=>y===d);if(p+1i.element.isOpened);if(t){let i=t.element.dropdown;if(!i)return!1;let r=(e?Array.from(i.querySelectorAll(":scope > *:not(.hidden)")):Array.from(i.querySelectorAll(":scope > *:not(.hidden)")).reverse()).filter(p=>!p.classList.contains("disabled")),d=i.querySelector(".hs-select-option-highlighted");r.length&&(r[0].focus(),d&&d.classList.remove("hs-select-option-highlighted"),r[0].classList.add("hs-select-option-highlighted"))}}static onEnter(e){let t=e.target.previousSibling;if(window.$hsSelectCollection.find(i=>i.element.el===t)){let i=window.$hsSelectCollection.find(r=>r.element.isOpened),o=window.$hsSelectCollection.find(r=>r.element.el===t);i.element.close(),i!==o&&o.element.open()}else{let i=window.$hsSelectCollection.find(o=>o.element.isOpened);i&&i.element.onSelectOption(e.target.dataset.value||"")}}};window.addEventListener("load",()=>{Qi.autoInit()});document.addEventListener("scroll",()=>{if(!window.$hsSelectCollection)return!1;let n=window.$hsSelectCollection.find(c=>c.element.isOpened);n&&n.element.recalculateDirection()});typeof window!="undefined"&&(window.HSSelect=Qi);Ge=Qi});var Xs={};Mn(Xs,{default:()=>lc});var on,lc,Js=ot(()=>{be();ve();on=class n extends X{constructor(e,t,i){var p,y,b,T,k,L,$,W,N,se,pe,V,G,ue,h,we,fe,et,Ue,ze,re,$e;super(e,t,i);g(this,"concatOptions");g(this,"dataTable");g(this,"table");g(this,"searches");g(this,"pageEntitiesList");g(this,"pagingList");g(this,"pagingPagesList");g(this,"pagingPrevList");g(this,"pagingNextList");g(this,"infoList");g(this,"rowSelectingAll");g(this,"rowSelectingIndividual");g(this,"maxPagesToShow");g(this,"isRowSelecting");g(this,"pageBtnClasses");g(this,"onSearchInputListener");g(this,"onPageEntitiesChangeListener");g(this,"onSinglePagingClickListener");g(this,"onPagingPrevClickListener");g(this,"onPagingNextClickListener");g(this,"onRowSelectingAllChangeListener");this.el=typeof e=="string"?document.querySelector(e):e;let o=[];Array.from(this.el.querySelectorAll("thead th, thead td")).forEach((gt,vt)=>{gt.classList.contains("--exclude-from-ordering")&&o.push({targets:vt,orderable:!1})});let r=this.el.getAttribute("data-hs-datatable"),d=r?JSON.parse(r):{};this.concatOptions=B(B({searching:!0,lengthChange:!1,order:[],columnDefs:[...o]},d),t),this.table=this.el.querySelector("table"),this.searches=(p=Array.from(this.el.querySelectorAll("[data-hs-datatable-search]")))!=null?p:null,this.pageEntitiesList=(y=Array.from(this.el.querySelectorAll("[data-hs-datatable-page-entities]")))!=null?y:null,this.pagingList=(b=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging]")))!=null?b:null,this.pagingPagesList=(T=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-pages]")))!=null?T:null,this.pagingPrevList=(k=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-prev]")))!=null?k:null,this.pagingNextList=(L=Array.from(this.el.querySelectorAll("[data-hs-datatable-paging-next]")))!=null?L:null,this.infoList=($=Array.from(this.el.querySelectorAll("[data-hs-datatable-info]")))!=null?$:null,(W=this.concatOptions)!=null&&W.rowSelectingOptions&&(this.rowSelectingAll=(G=(se=(N=this.concatOptions)==null?void 0:N.rowSelectingOptions)!=null&&se.selectAllSelector?document.querySelector((V=(pe=this.concatOptions)==null?void 0:pe.rowSelectingOptions)==null?void 0:V.selectAllSelector):document.querySelector("[data-hs-datatable-row-selecting-all]"))!=null?G:null),(ue=this.concatOptions)!=null&&ue.rowSelectingOptions&&(this.rowSelectingIndividual=(et=(fe=(we=(h=this.concatOptions)==null?void 0:h.rowSelectingOptions)==null?void 0:we.individualSelector)!=null?fe:"[data-hs-datatable-row-selecting-individual]")!=null?et:null),this.pageEntitiesList.length&&(this.concatOptions.pageLength=parseInt(this.pageEntitiesList[0].value)),this.maxPagesToShow=3,this.isRowSelecting=!!((Ue=this.concatOptions)!=null&&Ue.rowSelectingOptions),this.pageBtnClasses=($e=(re=(ze=this.concatOptions)==null?void 0:ze.pagingOptions)==null?void 0:re.pageBtnClasses)!=null?$e:null,this.onSearchInputListener=[],this.onPageEntitiesChangeListener=[],this.onSinglePagingClickListener=[],this.onPagingPrevClickListener=[],this.onPagingNextClickListener=[],this.init()}init(){this.createCollection(window.$hsDataTableCollection,this),this.initTable(),this.searches.length&&this.initSearch(),this.pageEntitiesList.length&&this.initPageEntities(),this.pagingList.length&&this.initPaging(),this.pagingPagesList.length&&this.buildPagingPages(),this.pagingPrevList.length&&this.initPagingPrev(),this.pagingNextList.length&&this.initPagingNext(),this.infoList.length&&this.initInfo(),this.isRowSelecting&&this.initRowSelecting()}initTable(){this.dataTable=new DataTable(this.table,this.concatOptions),this.isRowSelecting&&this.triggerChangeEventToRow(),this.dataTable.on("draw",()=>{this.isRowSelecting&&this.updateSelectAllCheckbox(),this.isRowSelecting&&this.triggerChangeEventToRow(),this.updateInfo(),this.pagingPagesList.forEach(e=>this.updatePaging(e))})}searchInput(e){this.onSearchInput(e.target.value)}pageEntitiesChange(e){this.onEntitiesChange(parseInt(e.target.value),e.target)}pagingPrevClick(){this.onPrevClick()}pagingNextClick(){this.onNextClick()}rowSelectingAllChange(){this.onSelectAllChange()}singlePagingClick(e){this.onPageClick(e)}initSearch(){this.searches.forEach(e=>{this.onSearchInputListener.push({el:e,fn:je(t=>this.searchInput(t))}),e.addEventListener("input",this.onSearchInputListener.find(t=>t.el===e).fn)})}onSearchInput(e){this.dataTable.search(e).draw()}initPageEntities(){this.pageEntitiesList.forEach(e=>{this.onPageEntitiesChangeListener.push({el:e,fn:t=>this.pageEntitiesChange(t)}),e.addEventListener("change",this.onPageEntitiesChangeListener.find(t=>t.el===e).fn)})}onEntitiesChange(e,t){let i=this.pageEntitiesList.filter(o=>o!==t);i.length&&i.forEach(o=>{if(window.HSSelect){let r=window.HSSelect.getInstance(o,!0);r&&r.element.setValue(`${e}`)}else o.value=`${e}`}),this.dataTable.page.len(e).draw()}initInfo(){this.infoList.forEach(e=>{this.initInfoFrom(e),this.initInfoTo(e),this.initInfoLength(e)})}initInfoFrom(e){var o;let t=(o=e.querySelector("[data-hs-datatable-info-from]"))!=null?o:null,{start:i}=this.dataTable.page.info();t&&(t.innerText=`${i+1}`)}initInfoTo(e){var o;let t=(o=e.querySelector("[data-hs-datatable-info-to]"))!=null?o:null,{end:i}=this.dataTable.page.info();t&&(t.innerText=`${i}`)}initInfoLength(e){var o;let t=(o=e.querySelector("[data-hs-datatable-info-length]"))!=null?o:null,{recordsTotal:i}=this.dataTable.page.info();t&&(t.innerText=`${i}`)}updateInfo(){this.initInfo()}initPaging(){this.pagingList.forEach(e=>this.hidePagingIfSinglePage(e))}hidePagingIfSinglePage(e){let{pages:t}=this.dataTable.page.info();t<2?(e.classList.add("hidden"),e.style.display="none"):(e.classList.remove("hidden"),e.style.display="")}initPagingPrev(){this.pagingPrevList.forEach(e=>{this.onPagingPrevClickListener.push({el:e,fn:()=>this.pagingPrevClick()}),e.addEventListener("click",this.onPagingPrevClickListener.find(t=>t.el===e).fn)})}onPrevClick(){this.dataTable.page("previous").draw("page")}disablePagingArrow(e,t){t?(e.classList.add("disabled"),e.setAttribute("disabled","disabled")):(e.classList.remove("disabled"),e.removeAttribute("disabled"))}initPagingNext(){this.pagingNextList.forEach(e=>{this.onPagingNextClickListener.push({el:e,fn:()=>this.pagingNextClick()}),e.addEventListener("click",this.onPagingNextClickListener.find(t=>t.el===e).fn)})}onNextClick(){this.dataTable.page("next").draw("page")}buildPagingPages(){this.pagingPagesList.forEach(e=>this.updatePaging(e))}updatePaging(e){let{page:t,pages:i,length:o}=this.dataTable.page.info(),r=this.dataTable.rows({search:"applied"}).count(),d=Math.ceil(r/o),p=t+1,y=Math.max(1,p-Math.floor(this.maxPagesToShow/2)),b=Math.min(d,y+(this.maxPagesToShow-1));b-y+11&&(this.buildPagingPage(1,e),y>2&&e.appendChild(ie('...')));for(let T=y;T<=b;T++)this.buildPagingPage(T,e);b...')),this.buildPagingPage(d,e)),this.pagingPrevList.forEach(T=>this.disablePagingArrow(T,t===0)),this.pagingNextList.forEach(T=>this.disablePagingArrow(T,t===i-1)),this.pagingList.forEach(T=>this.hidePagingIfSinglePage(T))}buildPagingPage(e,t){let{page:i}=this.dataTable.page.info(),o=ie('');o.innerText=`${e}`,o.setAttribute("data-page",`${e}`),this.pageBtnClasses&&Ce(this.pageBtnClasses,o),i===e-1&&o.classList.add("active"),this.onSinglePagingClickListener.push({el:o,fn:()=>this.singlePagingClick(e)}),o.addEventListener("click",this.onSinglePagingClickListener.find(r=>r.el===o).fn),t.append(o)}onPageClick(e){this.dataTable.page(e-1).draw("page")}initRowSelecting(){this.onRowSelectingAllChangeListener=()=>this.rowSelectingAllChange(),this.rowSelectingAll.addEventListener("change",this.onRowSelectingAllChangeListener)}triggerChangeEventToRow(){this.table.querySelectorAll(`tbody ${this.rowSelectingIndividual}`).forEach(e=>{e.addEventListener("change",()=>{this.updateSelectAllCheckbox()})})}onSelectAllChange(){let e=this.rowSelectingAll.checked;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach(i=>{let o=i.querySelector(this.rowSelectingIndividual);o&&(o.checked=e)}),this.updateSelectAllCheckbox()}updateSelectAllCheckbox(){if(!this.dataTable.rows({search:"applied"}).count())return this.rowSelectingAll.checked=!1,!1;let t=!0;Array.from(this.dataTable.rows({page:"current",search:"applied"}).nodes()).forEach(o=>{let r=o.querySelector(this.rowSelectingIndividual);if(r&&!r.checked)return t=!1,!1}),this.rowSelectingAll.checked=t}destroy(){this.searches&&this.onSearchInputListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pageEntitiesList&&this.onPageEntitiesChangeListener.forEach(({el:e,fn:t})=>e.removeEventListener("change",t)),this.pagingPagesList.length&&(this.onSinglePagingClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pagingPagesList.forEach(e=>e.innerHTML="")),this.pagingPrevList.length&&this.onPagingPrevClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.pagingNextList.length&&this.onPagingNextClickListener.forEach(({el:e,fn:t})=>e.removeEventListener("click",t)),this.rowSelectingAll&&this.rowSelectingAll.removeEventListener("change",this.onRowSelectingAllChangeListener),this.dataTable.destroy(),this.rowSelectingAll=null,this.rowSelectingIndividual=null,window.$hsDataTableCollection=window.$hsDataTableCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t){let i=window.$hsDataTableCollection.find(o=>o.element.el===(typeof e=="string"?document.querySelector(e):e));return i?t?i:i.element.el:null}static autoInit(){window.$hsDataTableCollection||(window.$hsDataTableCollection=[]),window.$hsDataTableCollection&&(window.$hsDataTableCollection=window.$hsDataTableCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsDataTableCollection.find(t=>{var i;return((i=t==null?void 0:t.element)==null?void 0:i.el)===e})||new n(e)})}};window.addEventListener("load",()=>{document.querySelectorAll("[data-hs-datatable]:not(.--prevent-on-load-init)").length&&(typeof jQuery=="undefined"&&console.error("HSDataTable: jQuery is not available, please add it to the page."),typeof DataTable=="undefined"&&console.error("HSDataTable: DataTable is not available, please add it to the page.")),typeof DataTable!="undefined"&&typeof jQuery!="undefined"&&on.autoInit()});typeof window!="undefined"&&(window.HSDataTable=on);lc=on});var Zs={};Mn(Zs,{default:()=>ac});var rn,ac,Gs=ot(()=>{be();ve();typeof Dropzone!="undefined"&&(Dropzone.autoDiscover=!1);rn=class n extends X{constructor(e,t,i){var d;super(e,t,i);g(this,"concatOptions");g(this,"previewTemplate");g(this,"extensions",{});g(this,"singleton");g(this,"dropzone");g(this,"onReloadButtonClickListener");g(this,"onTempFileInputChangeListener");this.el=typeof e=="string"?document.querySelector(e):e;let o=this.el.getAttribute("data-hs-file-upload"),r=o?JSON.parse(o):{};this.previewTemplate=((d=this.el.querySelector("[data-hs-file-upload-preview]"))==null?void 0:d.innerHTML)||`
+
+
+ +
+

+ . +

+

+
+
+
+ +
+
+
+
+
+
+
+ + 0% + +
+
+
`,this.extensions=_.merge({default:{icon:'',class:"size-5"},xls:{icon:'',class:"size-5"},doc:{icon:'',class:"size-5"},zip:{icon:'',class:"size-5"}},r.extensions),this.singleton=r.singleton,this.concatOptions=B(B({clickable:this.el.querySelector("[data-hs-file-upload-trigger]"),previewsContainer:this.el.querySelector("[data-hs-file-upload-previews]"),addRemoveLinks:!1,previewTemplate:this.previewTemplate,autoHideTrigger:!1},r),t),this.onReloadButtonClickListener=[],this.onTempFileInputChangeListener=[],this.init()}tempFileInputChange(e,t){var r;let o=(r=e.target.files)==null?void 0:r[0];if(o){let d=o;d.status=Dropzone.ADDED,d.accepted=!0,d.previewElement=t.previewElement,d.previewTemplate=t.previewTemplate,d.previewsContainer=t.previewsContainer,this.dropzone.removeFile(t),this.dropzone.addFile(d)}}reloadButtonClick(e,t){e.preventDefault(),e.stopPropagation();let i=document.createElement("input");i.type="file",this.onTempFileInputChangeListener.push({el:i,fn:o=>this.tempFileInputChange(o,t)}),i.click(),i.addEventListener("change",this.onTempFileInputChangeListener.find(o=>o.el===i).fn)}init(){this.createCollection(window.$hsFileUploadCollection,this),this.initDropzone()}initDropzone(){let e=this.el.querySelector("[data-hs-file-upload-clear]"),t=Array.from(this.el.querySelectorAll("[data-hs-file-upload-pseudo-trigger]"));this.dropzone=new Dropzone(this.el,this.concatOptions),this.dropzone.on("addedfile",i=>this.onAddFile(i)),this.dropzone.on("removedfile",()=>this.onRemoveFile()),this.dropzone.on("uploadprogress",(i,o)=>this.onUploadProgress(i,o)),this.dropzone.on("complete",i=>this.onComplete(i)),e&&(e.onclick=()=>{this.dropzone.files.length&&this.dropzone.removeAllFiles(!0)}),t.length&&t.forEach(i=>{i.onclick=()=>{var o,r;(o=this.concatOptions)!=null&&o.clickable&&((r=this.concatOptions)==null?void 0:r.clickable).click()}})}destroy(){this.onTempFileInputChangeListener.forEach(e=>{e.el.removeEventListener("change",e.fn)}),this.onTempFileInputChangeListener=null,this.onReloadButtonClickListener.forEach(e=>{e.el.removeEventListener("click",e.fn)}),this.onReloadButtonClickListener=null,this.dropzone.destroy(),window.$hsFileUploadCollection=window.$hsFileUploadCollection.filter(({element:e})=>e.el!==this.el)}onAddFile(e){let{previewElement:t}=e,i=e.previewElement.querySelector("[data-hs-file-upload-reload]");if(!t)return!1;this.singleton&&this.dropzone.files.length>1&&this.dropzone.removeFile(this.dropzone.files[0]),i&&(this.onReloadButtonClickListener.push({el:i,fn:o=>this.reloadButtonClick(o,e)}),i.addEventListener("click",this.onReloadButtonClickListener.find(o=>o.el===i).fn)),this.previewAccepted(e)}previewAccepted(e){let{previewElement:t}=e,i=this.splitFileName(e.name),o=t.querySelector("[data-hs-file-upload-file-name]"),r=t.querySelector("[data-hs-file-upload-file-ext]"),d=t.querySelector("[data-hs-file-upload-file-size]"),p=t.querySelector("[data-hs-file-upload-file-icon]"),y=this.el.querySelector("[data-hs-file-upload-trigger]"),b=t.querySelector("[data-dz-thumbnail]"),T=t.querySelector("[data-hs-file-upload-remove]");o&&(o.textContent=i.name),r&&(r.textContent=i.extension),d&&(d.textContent=this.formatFileSize(e.size)),b&&(e.type.includes("image/")?b.classList.remove("hidden"):this.setIcon(i.extension,p)),this.dropzone.files.length>0&&this.concatOptions.autoHideTrigger&&(y.style.display="none"),T&&(T.onclick=()=>this.dropzone.removeFile(e))}onRemoveFile(){let e=this.el.querySelector("[data-hs-file-upload-trigger]");this.dropzone.files.length===0&&this.concatOptions.autoHideTrigger&&(e.style.display="")}onUploadProgress(e,t){let{previewElement:i}=e;if(!i)return!1;let o=i.querySelector("[data-hs-file-upload-progress-bar]"),r=i.querySelector("[data-hs-file-upload-progress-bar-pane]"),d=i.querySelector("[data-hs-file-upload-progress-bar-value]"),p=Math.floor(t);o&&o.setAttribute("aria-valuenow",`${p}`),r&&(r.style.width=`${p}%`),d&&(d.innerText=`${p}`)}onComplete(e){let{previewElement:t}=e;if(!t)return!1;t.classList.add("complete")}setIcon(e,t){let i=this.createIcon(e);t.append(i)}createIcon(e){var i,o;let t=(i=this.extensions[e])!=null&&i.icon?ie(this.extensions[e].icon):ie(this.extensions.default.icon);return Ce((o=this.extensions[e])!=null&&o.class?this.extensions[e].class:this.extensions.default.class,t),t}formatFileSize(e){return e<1024?e.toFixed(2)+" B":e<1024*1024?(e/1024).toFixed(2)+" KB":e<1024*1024*1024?(e/(1024*1024)).toFixed(2)+" MB":e<1024*1024*1024*1024?(e/(1024*1024*1024)).toFixed(2)+" GB":(e/(1024*1024*1024*1024)).toFixed(2)+" TB"}splitFileName(e){let t=e.lastIndexOf(".");return t==-1?{name:e,extension:""}:{name:e.substring(0,t),extension:e.substring(t+1)}}static getInstance(e,t){let i=window.$hsFileUploadCollection.find(o=>o.element.el===(typeof e=="string"?document.querySelector(e):e));return i?t?i:i.element.el:null}static autoInit(){window.$hsFileUploadCollection||(window.$hsFileUploadCollection=[]),window.$hsFileUploadCollection&&(window.$hsFileUploadCollection=window.$hsFileUploadCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsFileUploadCollection.find(t=>{var i;return((i=t==null?void 0:t.element)==null?void 0:i.el)===e})||new n(e)})}};window.addEventListener("load",()=>{document.querySelectorAll("[data-hs-file-upload]:not(.--prevent-on-load-init)").length&&(typeof _=="undefined"&&console.error("HSFileUpload: Lodash is not available, please add it to the page."),typeof Dropzone=="undefined"&&console.error("HSFileUpload: Dropzone is not available, please add it to the page.")),typeof _!="undefined"&&typeof Dropzone!="undefined"&&rn.autoInit()});typeof window!="undefined"&&(window.HSFileUpload=rn);ac=rn});var eo={};Mn(eo,{default:()=>cc});var ln,cc,to=ot(()=>{ve();ln=class n extends X{constructor(e,t,i){super(e,t,i);g(this,"concatOptions");g(this,"format");let o=e.getAttribute("data-hs-range-slider"),r=o?JSON.parse(o):{};this.concatOptions=De(B(B({},r),t),{cssClasses:B(B({},noUiSlider.cssClasses),this.processClasses(r.cssClasses))}),this.init()}get formattedValue(){let e=this.el.noUiSlider.get();if(Array.isArray(e)&&this.format){let t=[];return e.forEach(i=>{t.push(this.format.to(i))}),t}else return this.format?this.format.to(e):e}processClasses(e){let t={};return Object.keys(e).forEach(i=>{i&&(t[i]=`${noUiSlider.cssClasses[i]} ${e[i]}`)}),t}init(){var e,t,i,o,r,d,p,y,b,T,k,L,$;this.createCollection(window.$hsRangeSliderCollection,this),(typeof((e=this.concatOptions)==null?void 0:e.formatter)=="object"?((i=(t=this.concatOptions)==null?void 0:t.formatter)==null?void 0:i.type)==="thousandsSeparatorAndDecimalPoints":((o=this.concatOptions)==null?void 0:o.formatter)==="thousandsSeparatorAndDecimalPoints")?this.thousandsSeparatorAndDecimalPointsFormatter():(typeof((r=this.concatOptions)==null?void 0:r.formatter)=="object"?((p=(d=this.concatOptions)==null?void 0:d.formatter)==null?void 0:p.type)==="integer":((y=this.concatOptions)==null?void 0:y.formatter)==="integer")?this.integerFormatter():typeof((b=this.concatOptions)==null?void 0:b.formatter)=="object"&&((k=(T=this.concatOptions)==null?void 0:T.formatter)!=null&&k.prefix||($=(L=this.concatOptions)==null?void 0:L.formatter)!=null&&$.postfix)&&this.prefixOrPostfixFormatter(),noUiSlider.create(this.el,this.concatOptions),this.concatOptions.disabled&&this.setDisabled()}formatValue(e){var i,o,r,d,p,y,b,T,k;let t="";return typeof((i=this.concatOptions)==null?void 0:i.formatter)=="object"?((r=(o=this.concatOptions)==null?void 0:o.formatter)!=null&&r.prefix&&(t+=(p=(d=this.concatOptions)==null?void 0:d.formatter)==null?void 0:p.prefix),t+=e,(b=(y=this.concatOptions)==null?void 0:y.formatter)!=null&&b.postfix&&(t+=(k=(T=this.concatOptions)==null?void 0:T.formatter)==null?void 0:k.postfix)):t+=e,t}integerFormatter(){var e;this.format={to:t=>this.formatValue(Math.round(t)),from:t=>Math.round(+t)},(e=this.concatOptions)!=null&&e.tooltips&&(this.concatOptions.tooltips=this.format)}prefixOrPostfixFormatter(){var e;this.format={to:t=>this.formatValue(t),from:t=>+t},(e=this.concatOptions)!=null&&e.tooltips&&(this.concatOptions.tooltips=this.format)}thousandsSeparatorAndDecimalPointsFormatter(){var e;this.format={to:t=>this.formatValue(new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(t)),from:t=>parseFloat(t.replace(/,/g,""))},(e=this.concatOptions)!=null&&e.tooltips&&(this.concatOptions.tooltips=this.format)}setDisabled(){this.el.setAttribute("disabled","disabled"),this.el.classList.add("disabled")}destroy(){this.el.noUiSlider.destroy(),this.format=null,window.$hsRangeSliderCollection=window.$hsRangeSliderCollection.filter(({element:e})=>e.el!==this.el)}static getInstance(e,t=!1){let i=window.$hsRangeSliderCollection.find(o=>o.element.el===(typeof e=="string"?document.querySelector(e):e));return i?t?i:i.element.el:null}static autoInit(){window.$hsRangeSliderCollection||(window.$hsRangeSliderCollection=[]),window.$hsRangeSliderCollection&&(window.$hsRangeSliderCollection=window.$hsRangeSliderCollection.filter(({element:e})=>document.contains(e.el))),document.querySelectorAll("[data-hs-range-slider]:not(.--prevent-on-load-init)").forEach(e=>{window.$hsRangeSliderCollection.find(t=>{var i;return((i=t==null?void 0:t.element)==null?void 0:i.el)===e})||new n(e)})}};window.addEventListener("load",()=>{ln.autoInit()});typeof window!="undefined"&&(window.HSRangeSlider=ln);cc=ln});function ho(n){if(!n||!n.getBoundingClientRect)return{top:0,bottom:0,left:0,right:0};let c=n.getBoundingClientRect(),e=document.documentElement;return{bottom:c.bottom,right:c.right,top:c.top+window.scrollY-e.clientTop,left:c.left+window.scrollX-e.clientLeft}}function po(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function vc(){return{left:window.scrollX||document.documentElement.scrollLeft||0,top:window.scrollY||document.documentElement.scrollTop||0}}function yc(n){let{top:c,left:e}=vc(),{top:t,left:i}=ho(n),{vh:o,vw:r}=po(),d=t-c,p=i-e;return{top:d,bottom:o-(d+n.clientHeight),left:p,right:r-(p+n.clientWidth)}}function nl(n,c,e=5){let t={top:!0,bottom:!0,left:!0,right:!0},i=[];if(!c||!n)return{canShow:t,parentPositions:i};let{bottom:o,top:r}=yc(n),{top:d,left:p}=ho(n),{height:y,width:b}=c.getBoundingClientRect(),{vh:T,vw:k}=po(),L=k/2,$=T/2;return[{condition:d<$,position:"top"},{condition:d>$,position:"bottom"},{condition:pL,position:"right"}].forEach(({condition:W,position:N})=>{W&&i.push(N)}),Object.assign(t,{top:y<=r-e,bottom:y<=o-e,left:b<=p,right:b<=k-p}),{canShow:t,parentPositions:i}}function Pd(n,c){let e="left";if(!c||!n)return e;let{canShow:t,parentPositions:i}=nl(n,c),o=t.left&&t.right;return(o&&t.bottom?"center":o&&t.top?["top","center"]:Array.isArray(i)?[i[0]==="bottom"?"top":"bottom",...i.slice(1)]:i)||e}var dc,uc,hc,Ur,pc,fc,so,di,mc,R,Pt,U,gc,oo,bc,wc,ne,_t,Qt,Dt,sl,Cc,ol,Sc,Tc,fo,Ec,xc,Lc,Ic,ro,Mc,kc,Hc,Ac,Dc,Pc,$c,Oc,Nc,Bc,qc,Fc,Rc,Wc,Vc,zc,jc,io,Uc,mo,rl,Yc,_c,jn,Qc,pn,go,vo,Kc,ll,Yr,_r,dn,Wn,Xc,un,qn,Jc,Qr,Zc,Gc,Kr,Xr,Jr,ed,td,Zr,id,yo,nd,Vn,ui,Gr,sd,od,zn,rd,ld,ad,Un,al,lo,cd,ao,el,xt,q,dd,hn,ud,hd,cl,Rn,Fn,cn,Yt,pd,dl,no,fd,md,ul,gd,vd,yd,bd,wd,Cd,Sd,hl,Td,Ed,an,xd,Ld,tl,Id,Md,pl,fl,kd,Hd,Ad,ml,bo,Dd,il,wo,$d,Od,co,gl,vl,yl=ot(()=>{dc=Object.defineProperty,uc=Object.defineProperties,hc=Object.getOwnPropertyDescriptors,Ur=Object.getOwnPropertySymbols,pc=Object.prototype.hasOwnProperty,fc=Object.prototype.propertyIsEnumerable,so=(n,c,e)=>c in n?dc(n,c,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[c]=e,di=(n,c)=>{for(var e in c||(c={}))pc.call(c,e)&&so(n,e,c[e]);if(Ur)for(var e of Ur(c))fc.call(c,e)&&so(n,e,c[e]);return n},mc=(n,c)=>uc(n,hc(c)),R=(n,c,e)=>(so(n,typeof c!="symbol"?c+"":c,e),e),Pt={notFoundSelector:n=>`${n} is not found, check the first argument passed to new Calendar.`,notInit:'The calendar has not been initialized, please initialize it using the "init()" method first.',notLocale:"You specified an incorrect language label or did not specify the required number of values \u200B\u200Bfor \xABlocale.weekdays\xBB or \xABlocale.months\xBB.",incorrectTime:"The value of the time property can be: false, 12 or 24.",incorrectMonthsCount:"For the \xABmultiple\xBB calendar type, the \xABdisplayMonthsCount\xBB parameter can have a value from 2 to 12, and for all others it cannot be greater than 1."},U=(n,c,e)=>{n.context[c]=e},gc=n=>{var c,e,t,i,o;if(!n.context.isInit)throw new Error(Pt.notInit);n.inputMode?((c=n.context.mainElement.parentElement)==null||c.removeChild(n.context.mainElement),(t=(e=n.context.inputElement)==null?void 0:e.replaceWith)==null||t.call(e,n.context.originalElement),U(n,"inputElement",void 0)):(o=(i=n.context.mainElement).replaceWith)==null||o.call(i,n.context.originalElement),U(n,"mainElement",n.context.originalElement),n.onDestroy&&n.onDestroy(n)},oo=n=>{n.context.isShowInInputMode&&n.context.currentType&&(n.context.mainElement.dataset.vcCalendarHidden="",U(n,"isShowInInputMode",!1),n.context.cleanupHandlers[0]&&(n.context.cleanupHandlers.forEach(c=>c()),U(n,"cleanupHandlers",[])),n.onHide&&n.onHide(n))};bc=(n,c,e,t)=>{var i;let o=t.querySelector(`[data-vc-date="${c}"]`),r=o==null?void 0:o.querySelector("[data-vc-date-btn]");if(!o||!r||(e!=null&&e.modifier&&r.classList.add(...e.modifier.trim().split(" ")),!(e!=null&&e.html)))return;let d=document.createElement("div");d.className=n.styles.datePopup,d.dataset.vcDatePopup="",d.innerHTML=n.sanitizerHTML(e.html),r.ariaExpanded="true",r.ariaLabel=`${r.ariaLabel}, ${(i=d==null?void 0:d.textContent)==null?void 0:i.replace(/^\s+|\s+(?=\s)|\s+$/g,"").replace(/ /g," ")}`,o.appendChild(d),requestAnimationFrame(()=>{if(!d)return;let{canShow:p}=nl(o,d),y=p.bottom?o.offsetHeight:-d.offsetHeight,b=p.left&&!p.right?o.offsetWidth-d.offsetWidth/2:!p.left&&p.right?d.offsetWidth/2:0;Object.assign(d.style,{left:`${b}px`,top:`${y}px`})})},wc=(n,c)=>{var e;n.popups&&((e=Object.entries(n.popups))==null||e.forEach(([t,i])=>bc(n,t,i,c)))},ne=n=>new Date(`${n}T00:00:00`),_t=n=>`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`,Qt=n=>n.reduce((c,e)=>{if(e instanceof Date||typeof e=="number"){let t=e instanceof Date?e:new Date(e);c.push(t.toISOString().substring(0,10))}else e.match(/^(\d{4}-\d{2}-\d{2})$/g)?c.push(e):e.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(t,i,o)=>{let r=ne(i),d=ne(o),p=new Date(r.getTime());for(;p<=d;p.setDate(p.getDate()+1))c.push(_t(p));return t});return c},[]),Dt=(n,c,e,t="")=>{c?n.setAttribute(e,t):n.getAttribute(e)===t&&n.removeAttribute(e)},sl=(n,c,e,t,i,o,r)=>{var d,p,y,b;let T=ne(n.context.displayDateMin)>ne(o)||ne(n.context.displayDateMax)1&&n.selectionDatesMode==="multiple-ranged"&&(n.context.selectedDates[0]===o&&n.context.selectedDates[n.context.selectedDates.length-1]===o?e.setAttribute("data-vc-date-selected","first-and-last"):n.context.selectedDates[0]===o?e.setAttribute("data-vc-date-selected","first"):n.context.selectedDates[n.context.selectedDates.length-1]===o&&e.setAttribute("data-vc-date-selected","last"),n.context.selectedDates[0]!==o&&n.context.selectedDates[n.context.selectedDates.length-1]!==o&&e.setAttribute("data-vc-date-selected","middle"))):e.hasAttribute("data-vc-date-selected")&&(e.removeAttribute("data-vc-date-selected"),t&&t.removeAttribute("aria-selected")),!n.context.disableDates.includes(o)&&n.enableEdgeDatesOnly&&n.context.selectedDates.length>1&&n.selectionDatesMode==="multiple-ranged"){let L=ne(n.context.selectedDates[0]),$=ne(n.context.selectedDates[n.context.selectedDates.length-1]),W=ne(o);Dt(e,W>L&&W<$,"data-vc-date-selected","middle")}},Cc=(n,c,e)=>new Date(`${n}T00:00:00.000Z`).toLocaleString(c,e),ol=(n,c)=>{let e=ne(n),t=(e.getDay()-c+7)%7;e.setDate(e.getDate()+4-t);let i=new Date(e.getFullYear(),0,1),o=Math.ceil(((+e-+i)/864e5+1)/7);return{year:e.getFullYear(),week:o}},Sc=(n,c,e)=>{let t=ol(e,n.firstWeekday);t&&(c.dataset.vcDateWeekNumber=String(t.week))},Tc=(n,c,e)=>{var t,i,o,r,d;let p=(t=n.disableWeekdays)==null?void 0:t.includes(e),y=n.disableAllDates&&!!((i=n.context.enableDates)!=null&&i[0]);!p&&!y||(o=n.context.enableDates)!=null&&o.includes(c)||(r=n.context.disableDates)!=null&&r.includes(c)||(n.context.disableDates.push(c),(d=n.context.disableDates)==null||d.sort((b,T)=>+new Date(b)-+new Date(T)))},fo=(n,c,e,t,i,o)=>{let r=ne(i).getDay(),d=typeof n.locale=="string"&&n.locale.length?n.locale:"en",p=document.createElement("div"),y;p.className=n.styles.date,p.dataset.vcDate=i,p.dataset.vcDateMonth=o,p.dataset.vcDateWeekDay=String(r),(o==="current"||n.displayDatesOutside)&&(y=document.createElement("button"),y.className=n.styles.dateBtn,y.type="button",y.role="gridcell",y.ariaLabel=Cc(i,d,{dateStyle:"long",timeZone:"UTC"}),y.dataset.vcDateBtn="",y.innerText=String(t),p.appendChild(y)),n.enableWeekNumbers&&Sc(n,p,i),Tc(n,i,r),sl(n,c,p,y,r,i,o),e.appendChild(p),n.onCreateDateEls&&n.onCreateDateEls(n,p)},Ec=(n,c,e,t,i)=>{for(let o=1;o<=e;o++){let r=new Date(t,i,o);fo(n,t,c,o,_t(r),"current")}},xc=(n,c,e,t,i,o)=>{let r=o+e,d=7*Math.ceil(r/7)-r,p=i+1===12?t+1:t,y=i+1===12?"01":i+2<10?`0${i+2}`:i+2;for(let b=1;b<=d;b++){let T=b<10?`0${b}`:String(b);fo(n,t,c,b,`${p}-${y}-${T}`,"next")}},Lc=(n,c,e,t,i)=>{let o=new Date(e,t,0).getDate()-(i-1),r=t===0?e-1:e,d=t===0?12:t<10?`0${t}`:t;for(let p=i;p>0;p--,o++)fo(n,e,c,o,`${r}-${d}-${o}`,"prev")},Ic=(n,c,e,t,i)=>{if(!n.enableWeekNumbers)return;t.textContent="";let o=document.createElement("b");o.className=n.styles.weekNumbersTitle,o.innerText="#",o.dataset.vcWeekNumbers="title",t.appendChild(o);let r=document.createElement("div");r.className=n.styles.weekNumbersContent,r.dataset.vcWeekNumbers="content",t.appendChild(r);let d=document.createElement("button");d.type="button",d.className=n.styles.weekNumber;let p=i.querySelectorAll("[data-vc-date]"),y=Math.ceil((c+e)/7);for(let b=0;b{let c=new Date(n.context.selectedYear,n.context.selectedMonth,1),e=n.context.mainElement.querySelectorAll('[data-vc="dates"]'),t=n.context.mainElement.querySelectorAll('[data-vc-week="numbers"]');e.forEach((i,o)=>{n.selectionDatesMode||(i.dataset.vcDatesDisabled=""),i.textContent="";let r=new Date(c);r.setMonth(r.getMonth()+o);let d=r.getMonth(),p=r.getFullYear(),y=(new Date(p,d,1).getDay()-n.firstWeekday+7)%7,b=new Date(p,d+1,0).getDate();Lc(n,i,p,d,y),Ec(n,i,b,p,d),xc(n,i,b,p,d,y),wc(n,i),Ic(n,y,b,t[o],i)})},Mc=n=>` + +
+ <#WeekNumbers /> +
+ <#Week /> + <#Dates /> + <#DateRangeTooltip /> +
+
+ <#ControlTime /> +`,kc=n=>` + +
+
+ <#Months /> +
+
+`,Hc=n=>` + +
+ <#Multiple> +
+
+
+ <#Month /> + <#Year /> +
+
+
+ <#WeekNumbers /> +
+ <#Week /> + <#Dates /> +
+
+
+ <#/Multiple> + <#DateRangeTooltip /> +
+ <#ControlTime /> +`,Ac=n=>` + +
+
+ <#Years /> +
+
+`,Dc=(n,c)=>``,Pc=(n,c)=>``,$c=n=>n.selectionTimeMode?`
`:"",Oc=n=>n.onCreateDateRangeTooltip?`
`:"",Nc=n=>`
`,Bc=n=>``,qc=n=>`
`,Fc=n=>`
`,Rc=n=>n.enableWeekNumbers?`
`:"",Wc=n=>``,Vc=n=>`
`,zc={ArrowNext:Dc,ArrowPrev:Pc,ControlTime:$c,Dates:Nc,DateRangeTooltip:Oc,Month:Bc,Months:qc,Week:Fc,WeekNumbers:Rc,Year:Wc,Years:Vc},jc=n=>zc[n],io=(n,c)=>c.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(e,t)=>{let i=(t.match(/\[(.*?)\]/)||[])[1],o=t.replace(/[/\s\n\t]|\[(.*?)\]/g,""),r=jc(o),d=r?r(n,i!=null?i:null):"";return n.sanitizerHTML(d)}).replace(/[\n\t]/g,""),Uc=(n,c)=>c.replace(new RegExp("<#Multiple>(.*?)<#\\/Multiple>","gs"),(e,t)=>{let i=Array(n.context.displayMonthsCount).fill(t).join("");return n.sanitizerHTML(i)}).replace(/[\n\t]/g,""),mo=(n,c)=>{let e={default:Mc,month:kc,year:Ac,multiple:Hc};if(Object.keys(e).forEach(t=>{let i=t;n.layouts[i].length||(n.layouts[i]=e[i](n))}),n.context.mainElement.className=n.styles.calendar,n.context.mainElement.dataset.vc="calendar",n.context.mainElement.dataset.vcType=n.context.currentType,n.context.mainElement.role="application",n.context.mainElement.tabIndex=0,n.context.mainElement.ariaLabel=n.labels.application,n.context.currentType!=="multiple"){if(n.type==="multiple"&&c){let t=n.context.mainElement.querySelector('[data-vc="controls"]'),i=n.context.mainElement.querySelector('[data-vc="grid"]'),o=c.closest('[data-vc="column"]');return t&&n.context.mainElement.removeChild(t),i&&(i.dataset.vcGrid="hidden"),o&&(o.dataset.vcColumn=n.context.currentType),void(o&&(o.innerHTML=n.sanitizerHTML(io(n,n.layouts[n.context.currentType]))))}n.context.mainElement.innerHTML=n.sanitizerHTML(io(n,n.layouts[n.context.currentType]))}else n.context.mainElement.innerHTML=n.sanitizerHTML(Uc(n,io(n,n.layouts[n.context.currentType])))},rl=(n,c,e,t)=>{n.style.visibility=e?"hidden":"",c.style.visibility=t?"hidden":""},Yc=(n,c,e)=>{let t=ne(_t(new Date(n.context.selectedYear,n.context.selectedMonth,1))),i=new Date(t.getTime()),o=new Date(t.getTime());i.setMonth(i.getMonth()-n.monthsToSwitch),o.setMonth(o.getMonth()+n.monthsToSwitch);let r=ne(n.context.dateMin),d=ne(n.context.dateMax);n.selectionYearsMode||(r.setFullYear(t.getFullYear()),d.setFullYear(t.getFullYear()));let p=!n.selectionMonthsMode||i.getFullYear()d.getFullYear()||o.getFullYear()===d.getFullYear()&&o.getMonth()>d.getMonth()-(n.context.displayMonthsCount-1);rl(c,e,p,y)},_c=(n,c,e)=>{let t=ne(n.context.dateMin),i=ne(n.context.dateMax),o=!!(t.getFullYear()&&n.context.displayYear-7<=t.getFullYear()),r=!!(i.getFullYear()&&n.context.displayYear+7>=i.getFullYear());rl(c,e,o,r)},jn=n=>{if(n.context.currentType==="month")return;let c=n.context.mainElement.querySelector('[data-vc-arrow="prev"]'),e=n.context.mainElement.querySelector('[data-vc-arrow="next"]');!c||!e||{default:()=>Yc(n,c,e),year:()=>_c(n,c,e)}[n.context.currentType==="multiple"?"default":n.context.currentType]()},Qc=(n,c,e,t,i)=>{let o=new Date(t.setFullYear(n.context.selectedYear,n.context.selectedMonth+e)).getFullYear(),r=new Date(t.setMonth(n.context.selectedMonth+e)).getMonth(),d=n.context.locale.months.long[r],p=c.closest('[data-vc="column"]');p&&(p.ariaLabel=`${d} ${o}`);let y={month:{id:r,label:d},year:{id:o,label:o}};c.innerText=String(y[i].label),c.dataset[`vc${i.charAt(0).toUpperCase()+i.slice(1)}`]=String(y[i].id),c.ariaLabel=`${n.labels[i]} ${y[i].label}`;let b={month:n.selectionMonthsMode,year:n.selectionYearsMode},T=b[i]===!1||b[i]==="only-arrows";T&&(c.tabIndex=-1),c.disabled=T},pn=n=>{let c=n.context.mainElement.querySelectorAll('[data-vc="month"]'),e=n.context.mainElement.querySelectorAll('[data-vc="year"]'),t=new Date(n.context.selectedYear,n.context.selectedMonth,1);[c,e].forEach(i=>i==null?void 0:i.forEach((o,r)=>Qc(n,o,r,t,o.dataset.vc)))},go=(n,c,e,t,i)=>{var o;let r={month:"[data-vc-months-month]",year:"[data-vc-years-year]"},d={month:{selected:"data-vc-months-month-selected",aria:"aria-selected",value:"vcMonthsMonth",selectedProperty:"selectedMonth"},year:{selected:"data-vc-years-year-selected",aria:"aria-selected",value:"vcYearsYear",selectedProperty:"selectedYear"}};i&&((o=n.context.mainElement.querySelectorAll(r[e]))==null||o.forEach(p=>{p.removeAttribute(d[e].selected),p.removeAttribute(d[e].aria)}),U(n,d[e].selectedProperty,Number(c.dataset[d[e].value])),pn(n),e==="year"&&jn(n)),t&&(c.setAttribute(d[e].selected,""),c.setAttribute(d[e].aria,"true"))},vo=(n,c)=>{var e;if(n.type!=="multiple")return{currentValue:null,columnID:0};let t=n.context.mainElement.querySelectorAll('[data-vc="column"]'),i=Array.from(t).findIndex(o=>o.closest(`[data-vc-column="${c}"]`));return{currentValue:i>=0?Number((e=t[i].querySelector(`[data-vc="${c}"]`))==null?void 0:e.getAttribute(`data-vc-${c}`)):null,columnID:Math.max(i,0)}},Kc=(n,c,e,t,i,o,r)=>{let d=c.cloneNode(!1);return d.className=n.styles.monthsMonth,d.innerText=t,d.ariaLabel=i,d.role="gridcell",d.dataset.vcMonthsMonth=`${r}`,o&&(d.ariaDisabled="true"),o&&(d.tabIndex=-1),d.disabled=o,go(n,d,"month",e===r,!1),d},ll=(n,c)=>{var e,t;let i=(e=c==null?void 0:c.closest('[data-vc="header"]'))==null?void 0:e.querySelector('[data-vc="year"]'),o=i?Number(i.dataset.vcYear):n.context.selectedYear,r=c!=null&&c.dataset.vcMonth?Number(c.dataset.vcMonth):n.context.selectedMonth;U(n,"currentType","month"),mo(n,c),pn(n);let d=n.context.mainElement.querySelector('[data-vc="months"]');if(!n.selectionMonthsMode||!d)return;let p=n.monthsToSwitch>1?n.context.locale.months.long.map((b,T)=>r-n.monthsToSwitch*T).concat(n.context.locale.months.long.map((b,T)=>r+n.monthsToSwitch*T)).filter(b=>b>=0&&b<=12):Array.from(Array(12).keys()),y=document.createElement("button");y.type="button";for(let b=0;b<12;b++){let T=ne(n.context.dateMin),k=ne(n.context.dateMax),L=n.context.displayMonthsCount-1,{columnID:$}=vo(n,"month"),W=o<=T.getFullYear()&&b=k.getFullYear()&&b>k.getMonth()-L+$||o>k.getFullYear()||b!==r&&!p.includes(b),N=Kc(n,y,r,n.context.locale.months.short[b],n.context.locale.months.long[b],W,b);d.appendChild(N),n.onCreateMonthEls&&n.onCreateMonthEls(n,N)}(t=n.context.mainElement.querySelector("[data-vc-months-month]:not([disabled])"))==null||t.focus()},Yr=(n,c,e,t,i)=>` + +`,_r=(n,c,e,t,i,o,r)=>` + +`,dn=(n,c,e,t)=>{({hour:()=>U(n,"selectedHours",e),minute:()=>U(n,"selectedMinutes",e)})[t](),U(n,"selectedTime",`${n.context.selectedHours}:${n.context.selectedMinutes}${n.context.selectedKeeping?` ${n.context.selectedKeeping}`:""}`),n.onChangeTime&&n.onChangeTime(n,c,!1),n.inputMode&&n.context.inputElement&&n.context.mainElement&&n.onChangeToInput&&n.onChangeToInput(n,c)},Wn=(n,c)=>{var e;return((e={0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"00",PM:"12"}}[Number(n)])==null?void 0:e[c])||String(n)},Xc=(n,c,e,t,i)=>{let o=r=>{let d=n.context.selectedKeeping==="AM"?"PM":"AM",p=Wn(n.context.selectedHours,d);Number(p)<=t&&Number(p)>=i?(U(n,"selectedKeeping",d),e.value=p,dn(n,r,n.context.selectedHours,"hour"),c.ariaLabel=`${n.labels.btnKeeping} ${n.context.selectedKeeping}`,c.innerText=n.context.selectedKeeping):n.onChangeTime&&n.onChangeTime(n,r,!0)};return c.addEventListener("click",o),()=>{c.removeEventListener("click",o)}},un=n=>({0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"})[Number(n)]||String(n),qn=(n,c,e,t)=>{n.value=e,c.value=t},Jc=(n,c,e)=>{c&&e&&(U(n,"selectedKeeping",e),c.innerText=e)},Qr=(n,c,e,t,i,o,r)=>{let d={hour:(y,b,T)=>{n.selectionTimeMode&&{12:()=>{if(!n.context.selectedKeeping)return;let k=Number(Wn(b,n.context.selectedKeeping));if(!(k<=o&&k>=r))return qn(e,c,n.context.selectedHours,n.context.selectedHours),void(n.onChangeTime&&n.onChangeTime(n,T,!0));qn(e,c,un(b),Wn(b,n.context.selectedKeeping)),y>12&&Jc(n,t,"PM"),dn(n,T,un(b),i)},24:()=>{if(!(y<=o&&y>=r))return qn(e,c,n.context.selectedHours,n.context.selectedHours),void(n.onChangeTime&&n.onChangeTime(n,T,!0));qn(e,c,b,b),dn(n,T,b,i)}}[n.selectionTimeMode]()},minute:(y,b,T)=>{if(!(y<=o&&y>=r))return e.value=n.context.selectedMinutes,void(n.onChangeTime&&n.onChangeTime(n,T,!0));e.value=b,c.value=b,dn(n,T,b,i)}},p=y=>{let b=Number(e.value),T=e.value.padStart(2,"0");d[i]&&d[i](b,T,y)};return e.addEventListener("change",p),()=>{e.removeEventListener("change",p)}},Zc=(n,c,e,t,i)=>{c.value=i,dn(n,e,i,t)},Gc=(n,c,e)=>{c&&(U(n,"selectedKeeping",e),c.innerText=e)},Kr=(n,c,e,t,i)=>{let o=r=>{let d=Number(c.value),p=c.value.padStart(2,"0"),y=i==="hour",b=n.selectionTimeMode===24,T=d>0&&d<12;y&&!b&&Gc(n,t,d===0||T?"AM":"PM"),Zc(n,e,r,i,!y||b||T?p:un(c.value))};return c.addEventListener("input",o),()=>{c.removeEventListener("input",o)}},Xr=n=>n.setAttribute("data-vc-input-focus",""),Jr=n=>n.removeAttribute("data-vc-input-focus"),ed=(n,c)=>{let e=c.querySelector('[data-vc-time-range="hour"] input[name="hour"]'),t=c.querySelector('[data-vc-time-range="minute"] input[name="minute"]'),i=c.querySelector('[data-vc-time-input="hour"] input[name="hour"]'),o=c.querySelector('[data-vc-time-input="minute"] input[name="minute"]'),r=c.querySelector('[data-vc-time="keeping"]');if(!(e&&t&&i&&o))return;let d=y=>{y.target===e&&Xr(i),y.target===t&&Xr(o)},p=y=>{y.target===e&&Jr(i),y.target===t&&Jr(o)};return c.addEventListener("mouseover",d),c.addEventListener("mouseout",p),Qr(n,e,i,r,"hour",n.timeMaxHour,n.timeMinHour),Qr(n,t,o,r,"minute",n.timeMaxMinute,n.timeMinMinute),Kr(n,e,i,r,"hour"),Kr(n,t,o,r,"minute"),r&&Xc(n,r,e,n.timeMaxHour,n.timeMinHour),()=>{c.removeEventListener("mouseover",d),c.removeEventListener("mouseout",p)}},td=n=>{let c=n.context.mainElement.querySelector('[data-vc="time"]');if(!n.selectionTimeMode||!c)return;let[e,t]=[n.timeMinHour,n.timeMaxHour],[i,o]=[n.timeMinMinute,n.timeMaxMinute],r=n.context.selectedKeeping?Wn(n.context.selectedHours,n.context.selectedKeeping):n.context.selectedHours,d=n.timeControls==="range";var p;c.innerHTML=n.sanitizerHTML(` +
+ ${Yr("hour",n.styles.timeHour,n.labels,n.context.selectedHours,d)} + ${Yr("minute",n.styles.timeMinute,n.labels,n.context.selectedMinutes,d)} + ${n.selectionTimeMode===12?(p=n.context.selectedKeeping,``):""} +
+
+ ${_r("hour",n.styles.timeRange,n.labels,e,t,n.timeStepHour,r)} + ${_r("minute",n.styles.timeRange,n.labels,i,o,n.timeStepMinute,n.context.selectedMinutes)} +
+ `),ed(n,c)},Zr=n=>{let c=n.selectedWeekends?[...n.selectedWeekends]:[],e=[...n.context.locale.weekdays.long].reduce((i,o,r)=>[...i,{id:r,titleShort:n.context.locale.weekdays.short[r],titleLong:o,isWeekend:c.includes(r)}],[]),t=[...e.slice(n.firstWeekday),...e.slice(0,n.firstWeekday)];n.context.mainElement.querySelectorAll('[data-vc="week"]').forEach(i=>{let o=n.onClickWeekDay?document.createElement("button"):document.createElement("b");n.onClickWeekDay&&(o.type="button"),t.forEach(r=>{let d=o.cloneNode(!0);d.innerText=r.titleShort,d.className=n.styles.weekDay,d.role="columnheader",d.ariaLabel=r.titleLong,d.dataset.vcWeekDay=String(r.id),r.isWeekend&&(d.dataset.vcWeekDayOff=""),i.appendChild(d)})})},id=(n,c,e,t,i)=>{let o=c.cloneNode(!1);return o.className=n.styles.yearsYear,o.innerText=String(i),o.ariaLabel=String(i),o.role="gridcell",o.dataset.vcYearsYear=`${i}`,t&&(o.ariaDisabled="true"),t&&(o.tabIndex=-1),o.disabled=t,go(n,o,"year",e===i,!1),o},yo=(n,c)=>{var e;let t=c!=null&&c.dataset.vcYear?Number(c.dataset.vcYear):n.context.selectedYear;U(n,"currentType","year"),mo(n,c),pn(n),jn(n);let i=n.context.mainElement.querySelector('[data-vc="years"]');if(!n.selectionYearsMode||!i)return;let o=n.type!=="multiple"||n.context.selectedYear===t?0:1,r=document.createElement("button");r.type="button";for(let d=n.context.displayYear-7;dne(n.context.dateMax).getFullYear(),y=id(n,r,t,p,d);i.appendChild(y),n.onCreateYearEls&&n.onCreateYearEls(n,y)}(e=n.context.mainElement.querySelector("[data-vc-years-year]:not([disabled])"))==null||e.focus()},nd=(n,c,e)=>{new MutationObserver(t=>{for(let i=0;iVn.value=!0,check:()=>Vn.value},ui=(n,c)=>n.dataset.vcTheme=c,Gr=(n,c)=>{if(ui(n.context.mainElement,c.matches?"dark":"light"),n.selectedTheme!=="system"||Vn.check())return;let e=t=>{let i=document.querySelectorAll('[data-vc="calendar"]');i==null||i.forEach(o=>ui(o,t.matches?"dark":"light"))};c.addEventListener?c.addEventListener("change",e):c.addListener(e),Vn.set()},sd=(n,c)=>{let e=n.themeAttrDetect.length?document.querySelector(n.themeAttrDetect):null,t=n.themeAttrDetect.replace(/^.*\[(.+)\]/g,(o,r)=>r);if(!e||e.getAttribute(t)==="system")return void Gr(n,c);let i=e.getAttribute(t);i?(ui(n.context.mainElement,i),nd(e,t,()=>{let o=e.getAttribute(t);o&&ui(n.context.mainElement,o)})):Gr(n,c)},od=n=>{window.matchMedia("(prefers-color-scheme)").media!=="not all"?n.selectedTheme==="system"?sd(n,window.matchMedia("(prefers-color-scheme: dark)")):ui(n.context.mainElement,n.selectedTheme):ui(n.context.mainElement,"light")},zn=n=>n.charAt(0).toUpperCase()+n.slice(1).replace(/\./,""),rd=(n,c,e)=>{let t=new Date(`1978-01-0${c+1}T00:00:00.000Z`),i=t.toLocaleString(e,{weekday:"short",timeZone:"UTC"}),o=t.toLocaleString(e,{weekday:"long",timeZone:"UTC"});n.context.locale.weekdays.short.push(zn(i)),n.context.locale.weekdays.long.push(zn(o))},ld=(n,c,e)=>{let t=new Date(`1978-${String(c+1).padStart(2,"0")}-01T00:00:00.000Z`),i=t.toLocaleString(e,{month:"short",timeZone:"UTC"}),o=t.toLocaleString(e,{month:"long",timeZone:"UTC"});n.context.locale.months.short.push(zn(i)),n.context.locale.months.long.push(zn(o))},ad=n=>{var c,e,t,i,o,r,d,p;if(!(n.context.locale.weekdays.short[6]&&n.context.locale.weekdays.long[6]&&n.context.locale.months.short[11]&&n.context.locale.months.long[11]))if(typeof n.locale=="string"){if(typeof n.locale=="string"&&!n.locale.length)throw new Error(Pt.notLocale);Array.from({length:7},(y,b)=>rd(n,b,n.locale)),Array.from({length:12},(y,b)=>ld(n,b,n.locale))}else{if(!((e=(c=n.locale)==null?void 0:c.weekdays)!=null&&e.short[6]&&((i=(t=n.locale)==null?void 0:t.weekdays)!=null&&i.long[6])&&((r=(o=n.locale)==null?void 0:o.months)!=null&&r.short[11])&&((p=(d=n.locale)==null?void 0:d.months)!=null&&p.long[11])))throw new Error(Pt.notLocale);U(n,"locale",di({},n.locale))}},Un=n=>{let c={default:()=>{Zr(n),ro(n)},multiple:()=>{Zr(n),ro(n)},month:()=>ll(n),year:()=>yo(n)};od(n),ad(n),mo(n),pn(n),jn(n),td(n),c[n.context.currentType]()},al=n=>{let c=e=>{var t;let i=e.target;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)||i.localName!=="button")return;let o=Array.from(n.context.mainElement.querySelectorAll('[data-vc="calendar"] button')),r=o.indexOf(i);if(r===-1)return;let d=(p=o[r]).hasAttribute("data-vc-date-btn")?7:p.hasAttribute("data-vc-months-month")?4:p.hasAttribute("data-vc-years-year")?5:1;var p;let y=(0,{ArrowUp:()=>Math.max(0,r-d),ArrowDown:()=>Math.min(o.length-1,r+d),ArrowLeft:()=>Math.max(0,r-1),ArrowRight:()=>Math.min(o.length-1,r+1)}[e.key])();(t=o[y])==null||t.focus()};return n.context.mainElement.addEventListener("keydown",c),()=>n.context.mainElement.removeEventListener("keydown",c)},lo=(n,c)=>{let e=ne(_t(new Date(n.context.selectedYear,n.context.selectedMonth,1)));({prev:()=>e.setMonth(e.getMonth()-n.monthsToSwitch),next:()=>e.setMonth(e.getMonth()+n.monthsToSwitch)})[c](),U(n,"selectedMonth",e.getMonth()),U(n,"selectedYear",e.getFullYear()),pn(n),jn(n),ro(n)},cd=(n,c)=>{let e=c.target.closest("[data-vc-arrow]");if(e){if(["default","multiple"].includes(n.context.currentType))lo(n,e.dataset.vcArrow);else if(n.context.currentType==="year"&&n.context.displayYear!==void 0){let t={prev:-15,next:15}[e.dataset.vcArrow];U(n,"displayYear",n.context.displayYear+t),yo(n,c.target)}n.onClickArrow&&n.onClickArrow(n,c)}},ao=n=>n.enableDateToggle===void 0||(typeof n.enableDateToggle=="function"?n.enableDateToggle(n):n.enableDateToggle),el=(n,c,e)=>{let t=c.dataset.vcDate,i=c.closest("[data-vc-date][data-vc-date-selected]"),o=ao(n);if(i&&!o)return;let r=i?n.context.selectedDates.filter(d=>d!==t):e?[...n.context.selectedDates,t]:[t];U(n,"selectedDates",r)},xt=(n,c,e)=>{if(!c)return;if(!e)return c.dataset.vcDateRangeTooltip="hidden",void(c.textContent="");let t=n.context.mainElement.getBoundingClientRect(),i=e.getBoundingClientRect();c.style.left=i.left-t.left+i.width/2+"px",c.style.top=i.bottom-t.top-i.height+"px",c.dataset.vcDateRangeTooltip="visible",c.innerHTML=n.sanitizerHTML(n.onCreateDateRangeTooltip(n,e,c,i,t))},q={self:null,lastDateEl:null,isHovering:!1,rangeMin:void 0,rangeMax:void 0,tooltipEl:null,timeoutId:null},dd=(n,c,e)=>{var t,i,o;if(!((i=(t=q.self)==null?void 0:t.context)!=null&&i.selectedDates[0]))return;let r=_t(n);(o=q.self.context.disableDates)!=null&&o.includes(r)||(q.self.context.mainElement.querySelectorAll(`[data-vc-date="${r}"]`).forEach(d=>d.dataset.vcDateHover=""),c.forEach(d=>d.dataset.vcDateHover="first"),e.forEach(d=>{d.dataset.vcDateHover==="first"?d.dataset.vcDateHover="first-and-last":d.dataset.vcDateHover="last"}))},hn=()=>{var n,c;(c=(n=q.self)==null?void 0:n.context)!=null&&c.mainElement&&q.self.context.mainElement.querySelectorAll("[data-vc-date-hover]").forEach(e=>e.removeAttribute("data-vc-date-hover"))},ud=n=>{var c,e;if(!n.target||!((e=(c=q.self)==null?void 0:c.context)!=null&&e.selectedDates[0]))return;if(!n.target.closest('[data-vc="dates"]'))return q.lastDateEl=null,xt(q.self,q.tooltipEl,null),void hn();let t=n.target.closest("[data-vc-date]");if(!t||q.lastDateEl===t)return;q.lastDateEl=t,xt(q.self,q.tooltipEl,t),hn();let i=t.dataset.vcDate,o=ne(q.self.context.selectedDates[0]),r=ne(i),d=q.self.context.mainElement.querySelectorAll(`[data-vc-date="${q.self.context.selectedDates[0]}"]`),p=q.self.context.mainElement.querySelectorAll(`[data-vc-date="${i}"]`),[y,b]=o{let c=n.target.closest("[data-vc-date-selected]");if(!c&&q.lastDateEl)return q.lastDateEl=null,void xt(q.self,q.tooltipEl,null);c&&q.lastDateEl!==c&&(q.lastDateEl=c,xt(q.self,q.tooltipEl,c))},cl=n=>c=>{q.isHovering||(q.isHovering=!0,requestAnimationFrame(()=>{n(c),q.isHovering=!1}))},Rn=cl(ud),Fn=cl(hd),cn=n=>{q.self&&n.key==="Escape"&&(q.lastDateEl=null,U(q.self,"selectedDates",[]),q.self.context.mainElement.removeEventListener("mousemove",Rn),q.self.context.mainElement.removeEventListener("keydown",cn),xt(q.self,q.tooltipEl,null),hn())},Yt=()=>{q.timeoutId!==null&&clearTimeout(q.timeoutId),q.timeoutId=setTimeout(()=>{q.lastDateEl=null,xt(q.self,q.tooltipEl,null),hn()},50)},pd=()=>{var n,c,e,t;if(!((e=(c=(n=q.self)==null?void 0:n.context)==null?void 0:c.selectedDates)!=null&&e[0])||!((t=q.self.context.disableDates)!=null&&t[0]))return;let i=ne(q.self.context.selectedDates[0]),[o,r]=q.self.context.disableDates.map(d=>ne(d)).reduce(([d,p],y)=>[i>=y?y:d,i{q.self=n,q.lastDateEl=c,hn(),n.disableDatesGaps&&(q.rangeMin=q.rangeMin?q.rangeMin:n.context.displayDateMin,q.rangeMax=q.rangeMax?q.rangeMax:n.context.displayDateMax),n.onCreateDateRangeTooltip&&(q.tooltipEl=n.context.mainElement.querySelector("[data-vc-date-range-tooltip]"));let e=c==null?void 0:c.dataset.vcDate;if(e){let t=n.context.selectedDates.length===1&&n.context.selectedDates[0].includes(e),i=t&&!ao(n)?[e,e]:t&&ao(n)?[]:n.context.selectedDates.length>1?[e]:[...n.context.selectedDates,e];U(n,"selectedDates",i),n.context.selectedDates.length>1&&n.context.selectedDates.sort((o,r)=>+new Date(o)-+new Date(r))}({set:()=>(n.disableDatesGaps&&pd(),xt(q.self,q.tooltipEl,c),q.self.context.mainElement.removeEventListener("mousemove",Fn),q.self.context.mainElement.removeEventListener("mouseleave",Yt),q.self.context.mainElement.removeEventListener("keydown",cn),q.self.context.mainElement.addEventListener("mousemove",Rn),q.self.context.mainElement.addEventListener("mouseleave",Yt),q.self.context.mainElement.addEventListener("keydown",cn),()=>{q.self.context.mainElement.removeEventListener("mousemove",Rn),q.self.context.mainElement.removeEventListener("mouseleave",Yt),q.self.context.mainElement.removeEventListener("keydown",cn)}),reset:()=>{let[t,i]=[n.context.selectedDates[0],n.context.selectedDates[n.context.selectedDates.length-1]],o=n.context.selectedDates[0]!==n.context.selectedDates[n.context.selectedDates.length-1],r=Qt([`${t}:${i}`]).filter(p=>!n.context.disableDates.includes(p)),d=o?n.enableEdgeDatesOnly?[t,i]:r:[n.context.selectedDates[0],n.context.selectedDates[0]];if(U(n,"selectedDates",d),n.disableDatesGaps&&(U(n,"displayDateMin",q.rangeMin),U(n,"displayDateMax",q.rangeMax)),q.self.context.mainElement.removeEventListener("mousemove",Rn),q.self.context.mainElement.removeEventListener("mouseleave",Yt),q.self.context.mainElement.removeEventListener("keydown",cn),n.onCreateDateRangeTooltip)return n.context.selectedDates[0]||(q.self.context.mainElement.removeEventListener("mousemove",Fn),q.self.context.mainElement.removeEventListener("mouseleave",Yt),xt(q.self,q.tooltipEl,null)),n.context.selectedDates[0]&&(q.self.context.mainElement.addEventListener("mousemove",Fn),q.self.context.mainElement.addEventListener("mouseleave",Yt),xt(q.self,q.tooltipEl,c)),()=>{q.self.context.mainElement.removeEventListener("mousemove",Fn),q.self.context.mainElement.removeEventListener("mouseleave",Yt)}}})[n.context.selectedDates.length===1?"set":"reset"]()},no=n=>{n.context.mainElement.querySelectorAll("[data-vc-date]").forEach(c=>{let e=c.querySelector("[data-vc-date-btn]"),t=c.dataset.vcDate,i=ne(t).getDay();sl(n,n.context.selectedYear,c,e,i,t,"current")})},fd=(n,c)=>{var e;let t=c.target,i=t.closest("[data-vc-date-btn]");if(!n.selectionDatesMode||!["single","multiple","multiple-ranged"].includes(n.selectionDatesMode)||!i)return;let o=i.closest("[data-vc-date]");({single:()=>el(n,o,!1),multiple:()=>el(n,o,!0),"multiple-ranged":()=>dl(n,o)})[n.selectionDatesMode](),(e=n.context.selectedDates)==null||e.sort((p,y)=>+new Date(p)-+new Date(y)),n.onClickDate&&n.onClickDate(n,c),n.inputMode&&n.context.inputElement&&n.context.mainElement&&n.onChangeToInput&&n.onChangeToInput(n,c);let r=t.closest('[data-vc-date-month="prev"]'),d=t.closest('[data-vc-date-month="next"]');({prev:()=>n.enableMonthChangeOnDayClick?lo(n,"prev"):no(n),next:()=>n.enableMonthChangeOnDayClick?lo(n,"next"):no(n),current:()=>no(n)})[r?"prev":d?"next":"current"]()},md=["month","year"],ul=(n,c,e)=>{let{currentValue:t,columnID:i}=vo(n,c);return n.context.currentType==="month"&&i>=0?e-i:n.context.currentType==="year"&&n.context.selectedYear!==t?e-1:e},gd=(n,c)=>{let e=ul(n,"year",Number(c.dataset.vcYearsYear)),t=ne(n.context.dateMin),i=ne(n.context.dateMax),o=n.context.displayMonthsCount-1,{columnID:r}=vo(n,"year"),d=n.context.selectedMonthi.getMonth()-o+r&&e>=i.getFullYear(),y=ei.getFullYear(),T=d||y?t.getFullYear():p||b?i.getFullYear():e,k=d||y?t.getMonth():p||b?i.getMonth()-o+r:n.context.selectedMonth;U(n,"selectedYear",T),U(n,"selectedMonth",k)},vd=(n,c)=>{let e=c.closest('[data-vc-column="month"]').querySelector('[data-vc="year"]'),t=ul(n,"month",Number(c.dataset.vcMonthsMonth)),i=Number(e.dataset.vcYear),o=ne(n.context.dateMin),r=ne(n.context.dateMax),d=tr.getMonth()&&i>=r.getFullYear();U(n,"selectedYear",i),U(n,"selectedMonth",d?o.getMonth():p?r.getMonth():t)},yd=(n,c,e,t)=>{var i;({year:()=>{if(n.type==="multiple")return gd(n,t);U(n,"selectedYear",Number(t.dataset.vcYearsYear))},month:()=>{if(n.type==="multiple")return vd(n,t);U(n,"selectedMonth",Number(t.dataset.vcMonthsMonth))}})[e](),{year:()=>{var o;return(o=n.onClickYear)==null?void 0:o.call(n,n,c)},month:()=>{var o;return(o=n.onClickMonth)==null?void 0:o.call(n,n,c)}}[e](),n.context.currentType!==n.type?(U(n,"currentType",n.type),Un(n),(i=n.context.mainElement.querySelector(`[data-vc="${e}"]`))==null||i.focus()):go(n,t,e,!0,!0)},bd=(n,c,e)=>{var t;let i=c.target,o=i.closest(`[data-vc="${e}"]`),r={year:()=>yo(n,i),month:()=>ll(n,i)};if(o&&n.onClickTitle&&n.onClickTitle(n,c),o&&n.context.currentType!==e)return r[e]();let d=i.closest(`[data-vc-${e}s-${e}]`);if(d)return yd(n,c,e,d);let p=i.closest('[data-vc="grid"]'),y=i.closest('[data-vc="column"]');(n.context.currentType===e&&o||n.type==="multiple"&&n.context.currentType===e&&p&&!y)&&(U(n,"currentType",n.type),Un(n),(t=n.context.mainElement.querySelector(`[data-vc="${e}"]`))==null||t.focus())},wd=(n,c)=>{let e={month:n.selectionMonthsMode,year:n.selectionYearsMode};md.forEach(t=>{e[t]&&c.target&&bd(n,c,t)})},Cd=(n,c)=>{if(!n.enableWeekNumbers||!n.onClickWeekNumber)return;let e=c.target.closest("[data-vc-week-number]"),t=n.context.mainElement.querySelectorAll("[data-vc-date-week-number]");if(!e||!t[0])return;let i=Number(e.innerText),o=Number(e.dataset.vcWeekYear),r=Array.from(t).filter(d=>Number(d.dataset.vcDateWeekNumber)===i);n.onClickWeekNumber(n,i,o,r,c)},Sd=(n,c)=>{if(!n.onClickWeekDay)return;let e=c.target.closest("[data-vc-week-day]"),t=c.target.closest('[data-vc="column"]'),i=t?t.querySelectorAll("[data-vc-date-week-day]"):n.context.mainElement.querySelectorAll("[data-vc-date-week-day]");if(!e||!i[0])return;let o=Number(e.dataset.vcWeekDay),r=Array.from(i).filter(d=>Number(d.dataset.vcDateWeekDay)===o);n.onClickWeekDay(n,o,r,c)},hl=n=>{let c=e=>{cd(n,e),Sd(n,e),Cd(n,e),fd(n,e),wd(n,e)};return n.context.mainElement.addEventListener("click",c),()=>n.context.mainElement.removeEventListener("click",c)},Td=n=>{if(n.type==="multiple"&&(n.displayMonthsCount<=1||n.displayMonthsCount>12))throw new Error(Pt.incorrectMonthsCount);if(n.type!=="multiple"&&n.displayMonthsCount>1)throw new Error(Pt.incorrectMonthsCount);U(n,"displayMonthsCount",n.displayMonthsCount?n.displayMonthsCount:n.type==="multiple"?2:1)},Ed=()=>{let n=new Date;return new Date(n.getTime()-6e4*n.getTimezoneOffset()).toISOString().substring(0,10)},an=(n,c)=>n==="today"?Ed():n instanceof Date||typeof n=="number"||typeof n=="string"?Qt([n])[0]:c,xd=n=>{var c,e,t;let i=an(n.dateMin,n.dateMin),o=an(n.dateMax,n.dateMax),r=an(n.displayDateMin,i),d=an(n.displayDateMax,o);U(n,"dateToday",an(n.dateToday,n.dateToday)),U(n,"displayDateMin",r?ne(i)>=ne(r)?i:r:i),U(n,"displayDateMax",d?ne(o)<=ne(d)?o:d:o);let p=n.disableDatesPast&&!n.disableAllDates&&ne(r)1&&n.context.disableDates.sort((y,b)=>+new Date(y)-+new Date(b)),U(n,"enableDates",n.enableDates[0]?Qt(n.enableDates):[]),(c=n.context.enableDates)!=null&&c[0]&&((e=n.context.disableDates)!=null&&e[0])&&U(n,"disableDates",n.context.disableDates.filter(y=>!n.context.enableDates.includes(y))),n.context.enableDates.length>1&&n.context.enableDates.sort((y,b)=>+new Date(y)-+new Date(b)),(t=n.context.enableDates)!=null&&t[0]&&n.disableAllDates&&(U(n,"displayDateMin",n.context.enableDates[0]),U(n,"displayDateMax",n.context.enableDates[n.context.enableDates.length-1])),U(n,"dateMin",n.displayDisabledDates?i:n.context.displayDateMin),U(n,"dateMax",n.displayDisabledDates?o:n.context.displayDateMax)},Ld=n=>{var c;U(n,"selectedDates",(c=n.selectedDates)!=null&&c[0]?Qt(n.selectedDates):[])},tl=(n,c,e)=>{U(n,"selectedMonth",c),U(n,"selectedYear",e),U(n,"displayYear",e)},Id=n=>{var c;if(n.enableJumpToSelectedDate&&((c=n.selectedDates)!=null&&c[0])&&n.selectedMonth===void 0&&n.selectedYear===void 0){let i=ne(Qt(n.selectedDates)[0]);return void tl(n,i.getMonth(),i.getFullYear())}let e=n.selectedMonth!==void 0&&Number(n.selectedMonth)>=0&&Number(n.selectedMonth)<12,t=n.selectedYear!==void 0&&Number(n.selectedYear)>=0&&Number(n.selectedYear)<=9999;tl(n,e?Number(n.selectedMonth):ne(n.context.dateToday).getMonth(),t?Number(n.selectedYear):ne(n.context.dateToday).getFullYear())},Md=n=>{var c,e,t;if(!n.selectionTimeMode)return;if(![12,24].includes(n.selectionTimeMode))throw new Error(Pt.incorrectTime);let i=n.selectionTimeMode===12,o=i?/^(0[1-9]|1[0-2]):([0-5][0-9]) ?(AM|PM)?$/i:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/,[r,d,p]=(t=(e=(c=n.selectedTime)==null?void 0:c.match(o))==null?void 0:e.slice(1))!=null?t:[];r?i&&!p&&(p="AM"):(r=i?un(String(n.timeMinHour)):String(n.timeMinHour),d=String(n.timeMinMinute),p=i?Number(un(String(n.timeMinHour)))>=12?"PM":"AM":null),U(n,"selectedHours",r.padStart(2,"0")),U(n,"selectedMinutes",d.padStart(2,"0")),U(n,"selectedKeeping",p),U(n,"selectedTime",`${n.context.selectedHours}:${n.context.selectedMinutes}${p?` ${p}`:""}`)},pl=n=>{U(n,"currentType",n.type),Td(n),xd(n),Id(n),Ld(n),Md(n)},fl=(n,{year:c,month:e,dates:t,time:i,locale:o},r=!0)=>{var d;let p={year:n.selectedYear,month:n.selectedMonth,dates:n.selectedDates,time:n.selectedTime};n.selectedYear=c?p.year:n.context.selectedYear,n.selectedMonth=e?p.month:n.context.selectedMonth,n.selectedTime=i?p.time:n.context.selectedTime,n.selectedDates=t==="only-first"&&((d=n.context.selectedDates)!=null&&d[0])?[n.context.selectedDates[0]]:t===!0?p.dates:n.context.selectedDates,o&&U(n,"locale",{months:{short:[],long:[]},weekdays:{short:[],long:[]}}),pl(n),r&&Un(n),n.selectedYear=p.year,n.selectedMonth=p.month,n.selectedDates=p.dates,n.selectedTime=p.time,n.selectionDatesMode==="multiple-ranged"&&t&&dl(n,null)},kd=n=>{let c=document.createElement("div");return c.className=n.styles.calendar,c.dataset.vc="calendar",c.dataset.vcInput="",c.dataset.vcCalendarHidden="",U(n,"inputModeInit",!0),U(n,"isShowInInputMode",!1),U(n,"mainElement",c),document.body.appendChild(n.context.mainElement),fl(n,{year:!0,month:!0,dates:!0,time:!0,locale:!0}),queueMicrotask(()=>wo(n)),n.onInit&&n.onInit(n),al(n),hl(n)},Hd=n=>{U(n,"inputElement",n.context.mainElement);let c=()=>{n.context.inputModeInit?queueMicrotask(()=>wo(n)):kd(n)};return n.context.inputElement.addEventListener("click",c),n.context.inputElement.addEventListener("focus",c),()=>{n.context.inputElement.removeEventListener("click",c),n.context.inputElement.removeEventListener("focus",c)}},Ad=n=>(U(n,"originalElement",n.context.mainElement.cloneNode(!0)),U(n,"isInit",!0),n.inputMode?Hd(n):(pl(n),Un(n),n.onInit&&n.onInit(n),al(n),hl(n))),ml=(n,c)=>{if(!n.context.isInit)throw new Error(Pt.notInit);fl(n,di(di({},{year:!0,month:!0,dates:!0,time:!0,locale:!0}),c),!(n.inputMode&&!n.context.inputModeInit)),n.onUpdate&&n.onUpdate(n)},bo=(n,c)=>{let e=Object.keys(c);for(let t=0;t{bo(n,c),n.context.isInit&&ml(n,e)};il=(n,c,e)=>{if(!n)return;let t=e==="auto"?Pd(n,c):e,i={top:-c.offsetHeight,bottom:n.offsetHeight,left:0,center:n.offsetWidth/2-c.offsetWidth/2,right:n.offsetWidth-c.offsetWidth},o=Array.isArray(t)?t[0]:"bottom",r=Array.isArray(t)?t[1]:t;c.dataset.vcPosition=o;let{top:d,left:p}=ho(n),y=d+i[o],b=p+i[r],{vw:T}=po();if(b+c.clientWidth>T){let k=window.innerWidth-document.body.clientWidth;b=T-c.clientWidth-k}else b<0&&(b=0);Object.assign(c.style,{left:`${b}px`,top:`${y}px`})},wo=n=>{if(n.context.isShowInInputMode)return;if(!n.context.currentType)return void n.context.mainElement.click();U(n,"cleanupHandlers",[]),U(n,"isShowInInputMode",!0),il(n.context.inputElement,n.context.mainElement,n.positionToInput),n.context.mainElement.removeAttribute("data-vc-calendar-hidden");let c=()=>{il(n.context.inputElement,n.context.mainElement,n.positionToInput)};window.addEventListener("resize",c),n.context.cleanupHandlers.push(()=>window.removeEventListener("resize",c));let e=i=>{i.key==="Escape"&&oo(n)};document.addEventListener("keydown",e),n.context.cleanupHandlers.push(()=>document.removeEventListener("keydown",e));let t=i=>{i.target===n.context.inputElement||n.context.mainElement.contains(i.target)||oo(n)};document.addEventListener("click",t,{capture:!0}),n.context.cleanupHandlers.push(()=>document.removeEventListener("click",t,{capture:!0})),n.onShow&&n.onShow(n)},$d={application:"Calendar",navigation:"Calendar Navigation",arrowNext:{month:"Next month",year:"Next list of years"},arrowPrev:{month:"Previous month",year:"Previous list of years"},month:"Select month, current selected month:",months:"List of months",year:"Select year, current selected year:",years:"List of years",week:"Days of the week",weekNumber:"Numbers of weeks in a year",dates:"Dates in the current month",selectingTime:"Selecting a time ",inputHour:"Hours",inputMinute:"Minutes",rangeHour:"Slider for selecting hours",rangeMinute:"Slider for selecting minutes",btnKeeping:"Switch AM/PM, current position:"},Od={calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"},co=class{constructor(){R(this,"type","default"),R(this,"inputMode",!1),R(this,"positionToInput","left"),R(this,"firstWeekday",1),R(this,"monthsToSwitch",1),R(this,"themeAttrDetect","html[data-theme]"),R(this,"locale","en"),R(this,"dateToday","today"),R(this,"dateMin","1970-01-01"),R(this,"dateMax","2470-12-31"),R(this,"displayDateMin"),R(this,"displayDateMax"),R(this,"displayDatesOutside",!0),R(this,"displayDisabledDates",!1),R(this,"displayMonthsCount"),R(this,"disableDates",[]),R(this,"disableAllDates",!1),R(this,"disableDatesPast",!1),R(this,"disableDatesGaps",!1),R(this,"disableWeekdays",[]),R(this,"disableToday",!1),R(this,"enableDates",[]),R(this,"enableEdgeDatesOnly",!0),R(this,"enableDateToggle",!0),R(this,"enableWeekNumbers",!1),R(this,"enableMonthChangeOnDayClick",!0),R(this,"enableJumpToSelectedDate",!1),R(this,"selectionDatesMode","single"),R(this,"selectionMonthsMode",!0),R(this,"selectionYearsMode",!0),R(this,"selectionTimeMode",!1),R(this,"selectedDates",[]),R(this,"selectedMonth"),R(this,"selectedYear"),R(this,"selectedHolidays",[]),R(this,"selectedWeekends",[0,6]),R(this,"selectedTime"),R(this,"selectedTheme","system"),R(this,"timeMinHour",0),R(this,"timeMaxHour",23),R(this,"timeMinMinute",0),R(this,"timeMaxMinute",59),R(this,"timeControls","all"),R(this,"timeStepHour",1),R(this,"timeStepMinute",1),R(this,"sanitizerHTML",c=>c),R(this,"onClickDate"),R(this,"onClickWeekDay"),R(this,"onClickWeekNumber"),R(this,"onClickTitle"),R(this,"onClickMonth"),R(this,"onClickYear"),R(this,"onClickArrow"),R(this,"onChangeTime"),R(this,"onChangeToInput"),R(this,"onCreateDateRangeTooltip"),R(this,"onCreateDateEls"),R(this,"onCreateMonthEls"),R(this,"onCreateYearEls"),R(this,"onInit"),R(this,"onUpdate"),R(this,"onDestroy"),R(this,"onShow"),R(this,"onHide"),R(this,"popups",{}),R(this,"labels",di({},$d)),R(this,"layouts",{default:"",multiple:"",month:"",year:""}),R(this,"styles",di({},Od))}},gl=class uo extends co{constructor(c,e){var t;super(),R(this,"init",()=>Ad(this)),R(this,"update",i=>ml(this,i)),R(this,"destroy",()=>gc(this)),R(this,"show",()=>wo(this)),R(this,"hide",()=>oo(this)),R(this,"set",(i,o)=>Dd(this,i,o)),R(this,"context"),this.context=mc(di({},this.context),{locale:{months:{short:[],long:[]},weekdays:{short:[],long:[]}}}),U(this,"mainElement",typeof c=="string"?(t=uo.memoizedElements.get(c))!=null?t:this.queryAndMemoize(c):c),e&&bo(this,e)}queryAndMemoize(c){let e=document.querySelector(c);if(!e)throw new Error(Pt.notFoundSelector(c));return uo.memoizedElements.set(c,e),e}};R(gl,"memoizedElements",new Map);vl=gl});var Co,So,bl=ot(()=>{yl();Co=class extends vl{constructor(c,e){super(c,e);let t=this.set;this.set=(i,o)=>{t&&t.call(this,i,o),i.selectedTime&&this.onChangeTime&&this.onChangeTime(this,null,!0),i.selectedMonth&&this.onClickMonth&&this.onClickMonth(this,null),i.selectedYear&&this.onClickYear&&this.onClickYear(this,null)}}static get defaultStyles(){return{calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"}}logInfo(){console.log("This log is from CustomVanillaCalendar!",this)}},So=Co});var Ve,wl=ot(()=>{Ve={default:`
+
+
+ <#CustomArrowPrev /> +
+
+ <#CustomMonth /> + / + <#CustomYear /> +
+
+ <#CustomArrowNext /> +
+
+
+
+ <#Week /> + <#Dates /> +
+
+
`,multiple:`
+
+ <#CustomArrowPrev /> +
+
+ <#CustomArrowNext /> +
+
+ <#Multiple> +
+
+
+ <#CustomMonth /> + / + <#CustomYear /> +
+
+
+
+ <#Week /> + <#Dates /> +
+
+
+ <#/Multiple> +
+
`,year:` +
+
+ <#Years /> +
+
`,month:` +
+
+ <#Months /> +
+
`,years:n=>`
+ + +
`,months:`
+ + +
`,hours:`
+ +
+ +
+
`,minutes:`
+ +
+ +
+
`,meridiem:`
+ +
+ +
+
`}});var To={};Mn(To,{default:()=>Nd});var fn,Nd,Eo=ot(()=>{be();bl();wl();be();Bn();ve();fn=class n extends X{constructor(e,t,i){var L,$,W,N,se,pe;super(e,t,i);g(this,"dataOptions");g(this,"updatedStyles");g(this,"vanillaCalendar");let o=e.getAttribute("data-hs-datepicker")?JSON.parse(e.getAttribute("data-hs-datepicker")):{};this.dataOptions=B(B({},o),t);let r=typeof((L=this.dataOptions)==null?void 0:L.removeDefaultStyles)!="undefined"?($=this.dataOptions)==null?void 0:$.removeDefaultStyles:!1;this.updatedStyles=_.mergeWith(r?{}:So.defaultStyles,((W=this.dataOptions)==null?void 0:W.styles)||{},(V,G)=>{if(typeof V=="string"&&typeof G=="string")return`${V} ${G}`});let d=new Date,p={styles:this.updatedStyles,dateMin:(N=this.dataOptions.dateMin)!=null?N:d.toISOString().split("T")[0],dateMax:(se=this.dataOptions.dateMax)!=null?se:"2470-12-31",mode:(pe=this.dataOptions.mode)!=null?pe:"default",inputMode:typeof this.dataOptions.inputMode!="undefined"?this.dataOptions.inputMode:!0},y=(V,G)=>ue=>{V==null||V(ue),G==null||G(ue)},b=V=>{this.hasTime(V)&&this.initCustomTime(V)},T={layouts:{month:Ve.month},onInit:y(this.dataOptions.onInit,V=>{p.mode==="custom-select"&&!this.dataOptions.inputMode&&b(V)}),onShow:y(this.dataOptions.onShow,V=>{p.mode==="custom-select"&&(this.updateCustomSelects(V),b(V))}),onHide:y(this.dataOptions.onHide,V=>{p.mode==="custom-select"&&this.destroySelects(V.context.mainElement)}),onUpdate:y(this.dataOptions.onUpdate,V=>{this.updateCalendar(V.context.mainElement)}),onCreateDateEls:y(this.dataOptions.onCreateDateEls,V=>{p.mode==="custom-select"&&this.updateCustomSelects(V)}),onChangeToInput:y(this.dataOptions.onChangeToInput,V=>{if(!V.context.inputElement)return;this.setInputValue(V.context.inputElement,V.context.selectedDates);let G={selectedDates:V.context.selectedDates,selectedTime:V.context.selectedTime,rest:V.context};this.fireEvent("change",G),Q("change.hs.datepicker",this.el,G)}),onChangeTime:y(this.dataOptions.onChangeTime,b),onClickYear:y(this.dataOptions.onClickYear,b),onClickMonth:y(this.dataOptions.onClickMonth,b),onClickArrow:y(this.dataOptions.onClickArrow,V=>{p.mode==="custom-select"&&setTimeout(()=>{this.disableNav(),this.disableOptions(),this.updateCalendar(V.context.mainElement)})})},k=De(B({},p),{layouts:{default:this.processCustomTemplate(Ve.default,"default"),multiple:this.processCustomTemplate(Ve.multiple,"multiple"),year:this.processCustomTemplate(Ve.year,"default")}});this.vanillaCalendar=new So(this.el,_.merge(T,this.dataOptions,k)),this.init()}init(){var e,t;this.createCollection(window.$hsDatepickerCollection,this),this.vanillaCalendar.init(),(e=this.dataOptions)!=null&&e.selectedDates&&this.setInputValue(this.vanillaCalendar.context.inputElement,this.formatDateArrayToIndividualDates((t=this.dataOptions)==null?void 0:t.selectedDates))}getTimeParts(e){let[t,i]=e.split(" "),[o,r]=t.split(":");return[o,r,i]}getCurrentMonthAndYear(e){let t=e.querySelector('[data-vc="month"]'),i=e.querySelector('[data-vc="year"]');return{month:+t.getAttribute("data-vc-month"),year:+i.getAttribute("data-vc-year")}}setInputValue(e,t){var d,p,y,b,T,k,L,$;let i=(y=(p=(d=this.dataOptions)==null?void 0:d.inputModeOptions)==null?void 0:p.dateSeparator)!=null?y:".",o=(k=(T=(b=this.dataOptions)==null?void 0:b.inputModeOptions)==null?void 0:T.itemsSeparator)!=null?k:", ",r=($=(L=this.dataOptions)==null?void 0:L.selectionDatesMode)!=null?$:"single";if(t.length&&t.length>1)if(r==="multiple"){let W=[];t.forEach(N=>W.push(this.changeDateSeparator(N,i))),e.value=W.join(o)}else e.value=[this.changeDateSeparator(t[0],i),this.changeDateSeparator(t[1],i)].join(o);else t.length&&t.length===1?e.value=this.changeDateSeparator(t[0],i):e.value=""}changeDateSeparator(e,t=".",i="-"){return e.split(i).join(t)}formatDateArrayToIndividualDates(e){var r,d;let t=(d=(r=this.dataOptions)==null?void 0:r.selectionDatesMode)!=null?d:"single",i=(p,y)=>{let b=new Date(p),T=new Date(y),k=[];for(;b<=T;)k.push(b.toISOString().split("T")[0]),b.setDate(b.getDate()+1);return k},o=p=>{if(typeof p=="string"){let y=p.match(/^(\d{4}-\d{2}-\d{2})\s*[^a-zA-Z0-9]*\s*(\d{4}-\d{2}-\d{2})$/);if(y){let[b,T,k]=y;return t==="multiple-ranged"?[T,k]:i(T.trim(),k.trim())}return[p]}else{if(typeof p=="number")return[new Date(p).toISOString().split("T")[0]];if(p instanceof Date)return[p.toISOString().split("T")[0]]}return[]};return e.flatMap(o)}hasTime(e){let{mainElement:t}=e.context,i=t.querySelector("[data-hs-select].--hours"),o=t.querySelector("[data-hs-select].--minutes"),r=t.querySelector("[data-hs-select].--meridiem");return i&&o&&r}createArrowFromTemplate(e,t=!1){if(!t)return e;let i=ie(e);return Ce(t,i),i.outerHTML}concatObjectProperties(e,t){let i={};return new Set([...Object.keys(e||{}),...Object.keys(t||{})]).forEach(r=>{let d=e[r]||"",p=t[r]||"";i[r]=`${d} ${p}`.trim()}),i}updateTemplate(e,t,i){if(!t)return e;let o=JSON.parse(e.match(/data-hs-select='([^']+)'/)[1]),r=this.concatObjectProperties(t,i),d=_.merge(o,r);return e.replace(/data-hs-select='[^']+'/,`data-hs-select='${JSON.stringify(d)}'`)}initCustomTime(e){var r;let{mainElement:t}=e.context,i=this.getTimeParts((r=e.selectedTime)!=null?r:"12:00 PM"),o={hours:t.querySelector("[data-hs-select].--hours"),minutes:t.querySelector("[data-hs-select].--minutes"),meridiem:t.querySelector("[data-hs-select].--meridiem")};Object.entries(o).forEach(([d,p])=>{if(!Ge.getInstance(p,!0)){let y=new Ge(p);y.setValue(i[d==="meridiem"?2:d==="minutes"?1:0]),y.el.addEventListener("change.hs.select",b=>{this.destroySelects(t);let T={hours:d==="hours"?b.detail.payload:i[0],minutes:d==="minutes"?b.detail.payload:i[1],meridiem:d==="meridiem"?b.detail.payload:i[2]};e.set({selectedTime:`${T.hours}:${T.minutes} ${T.meridiem}`},{dates:!1,year:!1,month:!1})})}})}initCustomMonths(e){let{mainElement:t}=e.context,i=Array.from(t.querySelectorAll(".--single-month"));i.length&&i.forEach((o,r)=>{let d=o.querySelector("[data-hs-select].--month");if(Ge.getInstance(d,!0))return!1;let y=new Ge(d),{month:b,year:T}=this.getCurrentMonthAndYear(o);y.setValue(`${b}`),y.el.addEventListener("change.hs.select",k=>{this.destroySelects(t),e.set({selectedMonth:+k.detail.payload-r<0?11:+k.detail.payload-r,selectedYear:+k.detail.payload-r<0?+T-1:T},{dates:!1,time:!1})})})}initCustomYears(e){let{mainElement:t}=e.context,i=Array.from(t.querySelectorAll(".--single-month"));i.length&&i.forEach(o=>{let r=o.querySelector("[data-hs-select].--year");if(Ge.getInstance(r,!0))return!1;let p=new Ge(r),{month:y,year:b}=this.getCurrentMonthAndYear(o);p.setValue(`${b}`),p.el.addEventListener("change.hs.select",T=>{let{dateMax:k,displayMonthsCount:L}=this.vanillaCalendar.context,$=new Date(k).getFullYear(),W=new Date(k).getMonth();this.destroySelects(t),e.set({selectedMonth:y>W-L&&+T.detail.payload===$?W-L+1:y,selectedYear:T.detail.payload},{dates:!1,time:!1})})})}generateCustomTimeMarkup(){var d,p,y,b;let e=(d=this.updatedStyles)==null?void 0:d.customSelect,t=e?this.updateTemplate(Ve.hours,(e==null?void 0:e.shared)||{},(e==null?void 0:e.hours)||{}):Ve.hours,i=e?this.updateTemplate(Ve.minutes,(e==null?void 0:e.shared)||{},(e==null?void 0:e.minutes)||{}):Ve.minutes,o=e?this.updateTemplate(Ve.meridiem,(e==null?void 0:e.shared)||{},(e==null?void 0:e.meridiem)||{}):Ve.meridiem;return`
${(b=(y=(p=this==null?void 0:this.dataOptions)==null?void 0:p.templates)==null?void 0:y.time)!=null?b:` +
+ ${t} + : + ${i} + ${o} +
+ `}
`}generateCustomMonthMarkup(){var r,d,p;let e=(d=(r=this==null?void 0:this.dataOptions)==null?void 0:r.mode)!=null?d:"default",t=(p=this.updatedStyles)==null?void 0:p.customSelect,i=t?this.updateTemplate(Ve.months,(t==null?void 0:t.shared)||{},(t==null?void 0:t.months)||{}):Ve.months;return e==="custom-select"?i:"<#Month />"}generateCustomYearMarkup(){var t,i,o,r,d,p,y;if(((i=(t=this==null?void 0:this.dataOptions)==null?void 0:t.mode)!=null?i:"default")==="custom-select"){let b=new Date,T=(r=(o=this==null?void 0:this.dataOptions)==null?void 0:o.dateMin)!=null?r:b.toISOString().split("T")[0],L=(p=(d=this==null?void 0:this.dataOptions)==null?void 0:d.dateMax)!=null?p:"2470-12-31",$=new Date(T),W=new Date(L),N=$.getFullYear(),se=W.getFullYear(),pe=()=>{let h="";for(let we=N;we<=se;we++)h+=``;return h},V=Ve.years(pe()),G=(y=this.updatedStyles)==null?void 0:y.customSelect;return G?this.updateTemplate(V,(G==null?void 0:G.shared)||{},(G==null?void 0:G.years)||{}):V}else return"<#Year />"}generateCustomArrowPrevMarkup(){var t,i;return(i=(t=this==null?void 0:this.dataOptions)==null?void 0:t.templates)!=null&&i.arrowPrev?this.createArrowFromTemplate(this.dataOptions.templates.arrowPrev,this.updatedStyles.arrowPrev):"<#ArrowPrev [month] />"}generateCustomArrowNextMarkup(){var t,i;return(i=(t=this==null?void 0:this.dataOptions)==null?void 0:t.templates)!=null&&i.arrowNext?this.createArrowFromTemplate(this.dataOptions.templates.arrowNext,this.updatedStyles.arrowNext):"<#ArrowNext [month] />"}parseCustomTime(e){return e=e.replace(/<#CustomTime\s*\/>/g,this.generateCustomTimeMarkup()),e}parseCustomMonth(e){return e=e.replace(/<#CustomMonth\s*\/>/g,this.generateCustomMonthMarkup()),e}parseCustomYear(e){return e=e.replace(/<#CustomYear\s*\/>/g,this.generateCustomYearMarkup()),e}parseArrowPrev(e){return e=e.replace(/<#CustomArrowPrev\s*\/>/g,this.generateCustomArrowPrevMarkup()),e}parseArrowNext(e){return e=e.replace(/<#CustomArrowNext\s*\/>/g,this.generateCustomArrowNextMarkup()),e}processCustomTemplate(e,t){var b,T,k,L;let i=t==="default"?(T=(b=this==null?void 0:this.dataOptions)==null?void 0:b.layouts)==null?void 0:T.default:(L=(k=this==null?void 0:this.dataOptions)==null?void 0:k.layouts)==null?void 0:L.multiple,o=this.parseCustomMonth(i!=null?i:e),r=this.parseCustomYear(o),d=this.parseCustomTime(r),p=this.parseArrowPrev(d);return this.parseArrowNext(p)}disableOptions(){let{mainElement:e,dateMax:t,displayMonthsCount:i}=this.vanillaCalendar.context,o=new Date(t);Array.from(e.querySelectorAll(".--single-month")).forEach((d,p)=>{var L;let y=+((L=d.querySelector('[data-vc="year"]'))==null?void 0:L.getAttribute("data-vc-year")),b=d.querySelectorAll("[data-hs-select].--month option"),T=d.querySelectorAll("[data-hs-select-dropdown] [data-value]"),k=$=>+$.getAttribute("data-value")>o.getMonth()-i+p+1&&y===o.getFullYear();Array.from(b).forEach($=>$.toggleAttribute("disabled",k($))),Array.from(T).forEach($=>$.classList.toggle("disabled",k($)))})}disableNav(){let{mainElement:e,dateMax:t,selectedYear:i,selectedMonth:o,displayMonthsCount:r}=this.vanillaCalendar.context,d=new Date(t).getFullYear(),p=e.querySelector('[data-vc-arrow="next"]');i===d&&o+r>11?p.style.visibility="hidden":p.style.visibility=""}destroySelects(e){Array.from(e.querySelectorAll("[data-hs-select]")).forEach(i=>{let o=Ge.getInstance(i,!0);o&&o.element.destroy()})}updateSelect(e,t){let i=Ge.getInstance(e,!0);i&&i.element.setValue(t)}updateCalendar(e){let t=e.querySelectorAll(".--single-month");t.length&&t.forEach(i=>{let{month:o,year:r}=this.getCurrentMonthAndYear(i);this.updateSelect(i.querySelector("[data-hs-select].--month"),`${o}`),this.updateSelect(i.querySelector("[data-hs-select].--year"),`${r}`)})}updateCustomSelects(e){setTimeout(()=>{this.disableOptions(),this.disableNav(),this.initCustomMonths(e),this.initCustomYears(e)})}getCurrentState(){return{selectedDates:this.vanillaCalendar.selectedDates,selectedTime:this.vanillaCalendar.selectedTime}}static getInstance(e,t){let i=window.$hsDatepickerCollection.find(o=>o.element.el===(typeof e=="string"?document.querySelector(e):e));return i?t?i:i.element.el:null}static autoInit(){window.$hsDatepickerCollection||(window.$hsDatepickerCollection=[]),document.querySelectorAll(".hs-datepicker:not(.--prevent-on-load-init)").forEach(e=>{window.$hsDatepickerCollection.find(t=>{var i;return((i=t==null?void 0:t.element)==null?void 0:i.el)===e})||new n(e)})}};window.addEventListener("load",()=>{fn.autoInit()});typeof window!="undefined"&&(window.HSDatepicker=fn);Nd=fn});var Ll=Oa((xl,Xn)=>{(function(n,c){"use strict";typeof Xn=="object"&&typeof Xn.exports=="object"?Xn.exports=n.document?c(n,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return c(e)}:c(n)})(typeof window!="undefined"?window:xl,function(n,c){"use strict";var e=[],t=Object.getPrototypeOf,i=e.slice,o=e.flat?function(s){return e.flat.call(s)}:function(s){return e.concat.apply([],s)},r=e.push,d=e.indexOf,p={},y=p.toString,b=p.hasOwnProperty,T=b.toString,k=T.call(Object),L={},$=function(l){return typeof l=="function"&&typeof l.nodeType!="number"&&typeof l.item!="function"},W=function(l){return l!=null&&l===l.window},N=n.document,se={type:!0,src:!0,nonce:!0,noModule:!0};function pe(s,l,a){a=a||N;var u,f,m=a.createElement("script");if(m.text=s,l)for(u in se)f=l[u]||l.getAttribute&&l.getAttribute(u),f&&m.setAttribute(u,f);a.head.appendChild(m).parentNode.removeChild(m)}function V(s){return s==null?s+"":typeof s=="object"||typeof s=="function"?p[y.call(s)]||"object":typeof s}var G="3.7.1",ue=/HTML$/i,h=function(s,l){return new h.fn.init(s,l)};h.fn=h.prototype={jquery:G,constructor:h,length:0,toArray:function(){return i.call(this)},get:function(s){return s==null?i.call(this):s<0?this[s+this.length]:this[s]},pushStack:function(s){var l=h.merge(this.constructor(),s);return l.prevObject=this,l},each:function(s){return h.each(this,s)},map:function(s){return this.pushStack(h.map(this,function(l,a){return s.call(l,a,l)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(h.grep(this,function(s,l){return(l+1)%2}))},odd:function(){return this.pushStack(h.grep(this,function(s,l){return l%2}))},eq:function(s){var l=this.length,a=+s+(s<0?l:0);return this.pushStack(a>=0&&a0&&l-1 in s}function fe(s,l){return s.nodeName&&s.nodeName.toLowerCase()===l.toLowerCase()}var et=e.pop,Ue=e.sort,ze=e.splice,re="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+re+"+$","g");h.contains=function(s,l){var a=l&&l.parentNode;return s===a||!!(a&&a.nodeType===1&&(s.contains?s.contains(a):s.compareDocumentPosition&&s.compareDocumentPosition(a)&16))};var gt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function vt(s,l){return l?s==="\0"?"\uFFFD":s.slice(0,-1)+"\\"+s.charCodeAt(s.length-1).toString(16)+" ":"\\"+s}h.escapeSelector=function(s){return(s+"").replace(gt,vt)};var xe=N,yt=r;(function(){var s,l,a,u,f,m=yt,v,S,C,x,A,P=h.expando,M=0,O=0,ee=Tn(),he=Tn(),oe=Tn(),Me=Tn(),Le=function(w,E){return w===E&&(f=!0),0},ut="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ht="(?:\\\\[\\da-fA-F]{1,6}"+re+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",ce="\\["+re+"*("+ht+")(?:"+re+"*([*^$|!~]?=)"+re+`*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(`+ht+"))|)"+re+"*\\]",Bt=":("+ht+`)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|`+ce+")*)|.*)\\)|)",me=new RegExp(re+"+","g"),Te=new RegExp("^"+re+"*,"+re+"*"),Ci=new RegExp("^"+re+"*([>+~]|"+re+")"+re+"*"),hs=new RegExp(re+"|>"),pt=new RegExp(Bt),Si=new RegExp("^"+ht+"$"),ft={ID:new RegExp("^#("+ht+")"),CLASS:new RegExp("^\\.("+ht+")"),TAG:new RegExp("^("+ht+"|[*])"),ATTR:new RegExp("^"+ce),PSEUDO:new RegExp("^"+Bt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+re+"*(even|odd|(([+-]|)(\\d*)n|)"+re+"*(?:([+-]|)"+re+"*(\\d+)|))"+re+"*\\)|)","i"),bool:new RegExp("^(?:"+ut+")$","i"),needsContext:new RegExp("^"+re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+re+"*((?:-\\d)?\\d*)"+re+"*\\)|)(?=[^-]|$)","i")},Lt=/^(?:input|select|textarea|button)$/i,It=/^h\d$/i,Qe=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ps=/[+~]/,Ct=new RegExp("\\\\[\\da-fA-F]{1,6}"+re+"?|\\\\([^\\r\\n\\f])","g"),St=function(w,E){var I="0x"+w.slice(1)-65536;return E||(I<0?String.fromCharCode(I+65536):String.fromCharCode(I>>10|55296,I&1023|56320))},Sa=function(){Mt()},Ta=xn(function(w){return w.disabled===!0&&fe(w,"fieldset")},{dir:"parentNode",next:"legend"});function Ea(){try{return v.activeElement}catch(w){}}try{m.apply(e=i.call(xe.childNodes),xe.childNodes),e[xe.childNodes.length].nodeType}catch(w){m={apply:function(E,I){yt.apply(E,i.call(I))},call:function(E){yt.apply(E,i.call(arguments,1))}}}function ge(w,E,I,H){var D,F,z,Y,j,le,Z,te=E&&E.ownerDocument,ae=E?E.nodeType:9;if(I=I||[],typeof w!="string"||!w||ae!==1&&ae!==9&&ae!==11)return I;if(!H&&(Mt(E),E=E||v,C)){if(ae!==11&&(j=Qe.exec(w)))if(D=j[1]){if(ae===9)if(z=E.getElementById(D)){if(z.id===D)return m.call(I,z),I}else return I;else if(te&&(z=te.getElementById(D))&&ge.contains(E,z)&&z.id===D)return m.call(I,z),I}else{if(j[2])return m.apply(I,E.getElementsByTagName(w)),I;if((D=j[3])&&E.getElementsByClassName)return m.apply(I,E.getElementsByClassName(D)),I}if(!Me[w+" "]&&(!x||!x.test(w))){if(Z=w,te=E,ae===1&&(hs.test(w)||Ci.test(w))){for(te=ps.test(w)&&fs(E.parentNode)||E,(te!=E||!L.scope)&&((Y=E.getAttribute("id"))?Y=h.escapeSelector(Y):E.setAttribute("id",Y=P)),le=Ti(w),F=le.length;F--;)le[F]=(Y?"#"+Y:":scope")+" "+En(le[F]);Z=le.join(",")}try{return m.apply(I,te.querySelectorAll(Z)),I}catch(J){Me(w,!0)}finally{Y===P&&E.removeAttribute("id")}}}return lr(w.replace($e,"$1"),E,I,H)}function Tn(){var w=[];function E(I,H){return w.push(I+" ")>l.cacheLength&&delete E[w.shift()],E[I+" "]=H}return E}function st(w){return w[P]=!0,w}function ii(w){var E=v.createElement("fieldset");try{return!!w(E)}catch(I){return!1}finally{E.parentNode&&E.parentNode.removeChild(E),E=null}}function xa(w){return function(E){return fe(E,"input")&&E.type===w}}function La(w){return function(E){return(fe(E,"input")||fe(E,"button"))&&E.type===w}}function or(w){return function(E){return"form"in E?E.parentNode&&E.disabled===!1?"label"in E?"label"in E.parentNode?E.parentNode.disabled===w:E.disabled===w:E.isDisabled===w||E.isDisabled!==!w&&Ta(E)===w:E.disabled===w:"label"in E?E.disabled===w:!1}}function qt(w){return st(function(E){return E=+E,st(function(I,H){for(var D,F=w([],I.length,E),z=F.length;z--;)I[D=F[z]]&&(I[D]=!(H[D]=I[D]))})})}function fs(w){return w&&typeof w.getElementsByTagName!="undefined"&&w}function Mt(w){var E,I=w?w.ownerDocument||w:xe;return I==v||I.nodeType!==9||!I.documentElement||(v=I,S=v.documentElement,C=!h.isXMLDoc(v),A=S.matches||S.webkitMatchesSelector||S.msMatchesSelector,S.msMatchesSelector&&xe!=v&&(E=v.defaultView)&&E.top!==E&&E.addEventListener("unload",Sa),L.getById=ii(function(H){return S.appendChild(H).id=h.expando,!v.getElementsByName||!v.getElementsByName(h.expando).length}),L.disconnectedMatch=ii(function(H){return A.call(H,"*")}),L.scope=ii(function(){return v.querySelectorAll(":scope")}),L.cssHas=ii(function(){try{return v.querySelector(":has(*,:jqfake)"),!1}catch(H){return!0}}),L.getById?(l.filter.ID=function(H){var D=H.replace(Ct,St);return function(F){return F.getAttribute("id")===D}},l.find.ID=function(H,D){if(typeof D.getElementById!="undefined"&&C){var F=D.getElementById(H);return F?[F]:[]}}):(l.filter.ID=function(H){var D=H.replace(Ct,St);return function(F){var z=typeof F.getAttributeNode!="undefined"&&F.getAttributeNode("id");return z&&z.value===D}},l.find.ID=function(H,D){if(typeof D.getElementById!="undefined"&&C){var F,z,Y,j=D.getElementById(H);if(j){if(F=j.getAttributeNode("id"),F&&F.value===H)return[j];for(Y=D.getElementsByName(H),z=0;j=Y[z++];)if(F=j.getAttributeNode("id"),F&&F.value===H)return[j]}return[]}}),l.find.TAG=function(H,D){return typeof D.getElementsByTagName!="undefined"?D.getElementsByTagName(H):D.querySelectorAll(H)},l.find.CLASS=function(H,D){if(typeof D.getElementsByClassName!="undefined"&&C)return D.getElementsByClassName(H)},x=[],ii(function(H){var D;S.appendChild(H).innerHTML="",H.querySelectorAll("[selected]").length||x.push("\\["+re+"*(?:value|"+ut+")"),H.querySelectorAll("[id~="+P+"-]").length||x.push("~="),H.querySelectorAll("a#"+P+"+*").length||x.push(".#.+[+~]"),H.querySelectorAll(":checked").length||x.push(":checked"),D=v.createElement("input"),D.setAttribute("type","hidden"),H.appendChild(D).setAttribute("name","D"),S.appendChild(H).disabled=!0,H.querySelectorAll(":disabled").length!==2&&x.push(":enabled",":disabled"),D=v.createElement("input"),D.setAttribute("name",""),H.appendChild(D),H.querySelectorAll("[name='']").length||x.push("\\["+re+"*name"+re+"*="+re+`*(?:''|"")`)}),L.cssHas||x.push(":has"),x=x.length&&new RegExp(x.join("|")),Le=function(H,D){if(H===D)return f=!0,0;var F=!H.compareDocumentPosition-!D.compareDocumentPosition;return F||(F=(H.ownerDocument||H)==(D.ownerDocument||D)?H.compareDocumentPosition(D):1,F&1||!L.sortDetached&&D.compareDocumentPosition(H)===F?H===v||H.ownerDocument==xe&&ge.contains(xe,H)?-1:D===v||D.ownerDocument==xe&&ge.contains(xe,D)?1:u?d.call(u,H)-d.call(u,D):0:F&4?-1:1)}),v}ge.matches=function(w,E){return ge(w,null,null,E)},ge.matchesSelector=function(w,E){if(Mt(w),C&&!Me[E+" "]&&(!x||!x.test(E)))try{var I=A.call(w,E);if(I||L.disconnectedMatch||w.document&&w.document.nodeType!==11)return I}catch(H){Me(E,!0)}return ge(E,v,null,[w]).length>0},ge.contains=function(w,E){return(w.ownerDocument||w)!=v&&Mt(w),h.contains(w,E)},ge.attr=function(w,E){(w.ownerDocument||w)!=v&&Mt(w);var I=l.attrHandle[E.toLowerCase()],H=I&&b.call(l.attrHandle,E.toLowerCase())?I(w,E,!C):void 0;return H!==void 0?H:w.getAttribute(E)},ge.error=function(w){throw new Error("Syntax error, unrecognized expression: "+w)},h.uniqueSort=function(w){var E,I=[],H=0,D=0;if(f=!L.sortStable,u=!L.sortStable&&i.call(w,0),Ue.call(w,Le),f){for(;E=w[D++];)E===w[D]&&(H=I.push(D));for(;H--;)ze.call(w,I[H],1)}return u=null,w},h.fn.uniqueSort=function(){return this.pushStack(h.uniqueSort(i.apply(this)))},l=h.expr={cacheLength:50,createPseudo:st,match:ft,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(w){return w[1]=w[1].replace(Ct,St),w[3]=(w[3]||w[4]||w[5]||"").replace(Ct,St),w[2]==="~="&&(w[3]=" "+w[3]+" "),w.slice(0,4)},CHILD:function(w){return w[1]=w[1].toLowerCase(),w[1].slice(0,3)==="nth"?(w[3]||ge.error(w[0]),w[4]=+(w[4]?w[5]+(w[6]||1):2*(w[3]==="even"||w[3]==="odd")),w[5]=+(w[7]+w[8]||w[3]==="odd")):w[3]&&ge.error(w[0]),w},PSEUDO:function(w){var E,I=!w[6]&&w[2];return ft.CHILD.test(w[0])?null:(w[3]?w[2]=w[4]||w[5]||"":I&&pt.test(I)&&(E=Ti(I,!0))&&(E=I.indexOf(")",I.length-E)-I.length)&&(w[0]=w[0].slice(0,E),w[2]=I.slice(0,E)),w.slice(0,3))}},filter:{TAG:function(w){var E=w.replace(Ct,St).toLowerCase();return w==="*"?function(){return!0}:function(I){return fe(I,E)}},CLASS:function(w){var E=ee[w+" "];return E||(E=new RegExp("(^|"+re+")"+w+"("+re+"|$)"))&&ee(w,function(I){return E.test(typeof I.className=="string"&&I.className||typeof I.getAttribute!="undefined"&&I.getAttribute("class")||"")})},ATTR:function(w,E,I){return function(H){var D=ge.attr(H,w);return D==null?E==="!=":E?(D+="",E==="="?D===I:E==="!="?D!==I:E==="^="?I&&D.indexOf(I)===0:E==="*="?I&&D.indexOf(I)>-1:E==="$="?I&&D.slice(-I.length)===I:E==="~="?(" "+D.replace(me," ")+" ").indexOf(I)>-1:E==="|="?D===I||D.slice(0,I.length+1)===I+"-":!1):!0}},CHILD:function(w,E,I,H,D){var F=w.slice(0,3)!=="nth",z=w.slice(-4)!=="last",Y=E==="of-type";return H===1&&D===0?function(j){return!!j.parentNode}:function(j,le,Z){var te,ae,J,ye,qe,ke=F!==z?"nextSibling":"previousSibling",Ke=j.parentNode,mt=Y&&j.nodeName.toLowerCase(),ni=!Z&&!Y,Ae=!1;if(Ke){if(F){for(;ke;){for(J=j;J=J[ke];)if(Y?fe(J,mt):J.nodeType===1)return!1;qe=ke=w==="only"&&!qe&&"nextSibling"}return!0}if(qe=[z?Ke.firstChild:Ke.lastChild],z&&ni){for(ae=Ke[P]||(Ke[P]={}),te=ae[w]||[],ye=te[0]===M&&te[1],Ae=ye&&te[2],J=ye&&Ke.childNodes[ye];J=++ye&&J&&J[ke]||(Ae=ye=0)||qe.pop();)if(J.nodeType===1&&++Ae&&J===j){ae[w]=[M,ye,Ae];break}}else if(ni&&(ae=j[P]||(j[P]={}),te=ae[w]||[],ye=te[0]===M&&te[1],Ae=ye),Ae===!1)for(;(J=++ye&&J&&J[ke]||(Ae=ye=0)||qe.pop())&&!((Y?fe(J,mt):J.nodeType===1)&&++Ae&&(ni&&(ae=J[P]||(J[P]={}),ae[w]=[M,Ae]),J===j)););return Ae-=D,Ae===H||Ae%H===0&&Ae/H>=0}}},PSEUDO:function(w,E){var I,H=l.pseudos[w]||l.setFilters[w.toLowerCase()]||ge.error("unsupported pseudo: "+w);return H[P]?H(E):H.length>1?(I=[w,w,"",E],l.setFilters.hasOwnProperty(w.toLowerCase())?st(function(D,F){for(var z,Y=H(D,E),j=Y.length;j--;)z=d.call(D,Y[j]),D[z]=!(F[z]=Y[j])}):function(D){return H(D,0,I)}):H}},pseudos:{not:st(function(w){var E=[],I=[],H=ys(w.replace($e,"$1"));return H[P]?st(function(D,F,z,Y){for(var j,le=H(D,null,Y,[]),Z=D.length;Z--;)(j=le[Z])&&(D[Z]=!(F[Z]=j))}):function(D,F,z){return E[0]=D,H(E,null,z,I),E[0]=null,!I.pop()}}),has:st(function(w){return function(E){return ge(w,E).length>0}}),contains:st(function(w){return w=w.replace(Ct,St),function(E){return(E.textContent||h.text(E)).indexOf(w)>-1}}),lang:st(function(w){return Si.test(w||"")||ge.error("unsupported lang: "+w),w=w.replace(Ct,St).toLowerCase(),function(E){var I;do if(I=C?E.lang:E.getAttribute("xml:lang")||E.getAttribute("lang"))return I=I.toLowerCase(),I===w||I.indexOf(w+"-")===0;while((E=E.parentNode)&&E.nodeType===1);return!1}}),target:function(w){var E=n.location&&n.location.hash;return E&&E.slice(1)===w.id},root:function(w){return w===S},focus:function(w){return w===Ea()&&v.hasFocus()&&!!(w.type||w.href||~w.tabIndex)},enabled:or(!1),disabled:or(!0),checked:function(w){return fe(w,"input")&&!!w.checked||fe(w,"option")&&!!w.selected},selected:function(w){return w.parentNode&&w.parentNode.selectedIndex,w.selected===!0},empty:function(w){for(w=w.firstChild;w;w=w.nextSibling)if(w.nodeType<6)return!1;return!0},parent:function(w){return!l.pseudos.empty(w)},header:function(w){return It.test(w.nodeName)},input:function(w){return Lt.test(w.nodeName)},button:function(w){return fe(w,"input")&&w.type==="button"||fe(w,"button")},text:function(w){var E;return fe(w,"input")&&w.type==="text"&&((E=w.getAttribute("type"))==null||E.toLowerCase()==="text")},first:qt(function(){return[0]}),last:qt(function(w,E){return[E-1]}),eq:qt(function(w,E,I){return[I<0?I+E:I]}),even:qt(function(w,E){for(var I=0;IE?H=E:H=I;--H>=0;)w.push(H);return w}),gt:qt(function(w,E,I){for(var H=I<0?I+E:I;++H1?function(E,I,H){for(var D=w.length;D--;)if(!w[D](E,I,H))return!1;return!0}:w[0]}function Ia(w,E,I){for(var H=0,D=E.length;H-1&&(z[Z]=!(Y[Z]=ae))}}else J=Ln(J===Y?J.splice(ke,J.length):J),D?D(null,Y,J,le):m.apply(Y,J)})}function vs(w){for(var E,I,H,D=w.length,F=l.relative[w[0].type],z=F||l.relative[" "],Y=F?1:0,j=xn(function(te){return te===E},z,!0),le=xn(function(te){return d.call(E,te)>-1},z,!0),Z=[function(te,ae,J){var ye=!F&&(J||ae!=a)||((E=ae).nodeType?j(te,ae,J):le(te,ae,J));return E=null,ye}];Y1&&ms(Z),Y>1&&En(w.slice(0,Y-1).concat({value:w[Y-2].type===" "?"*":""})).replace($e,"$1"),I,Y0,H=w.length>0,D=function(F,z,Y,j,le){var Z,te,ae,J=0,ye="0",qe=F&&[],ke=[],Ke=a,mt=F||H&&l.find.TAG("*",le),ni=M+=Ke==null?1:Math.random()||.1,Ae=mt.length;for(le&&(a=z==v||z||le);ye!==Ae&&(Z=mt[ye])!=null;ye++){if(H&&Z){for(te=0,!z&&Z.ownerDocument!=v&&(Mt(Z),Y=!C);ae=w[te++];)if(ae(Z,z||v,Y)){m.call(j,Z);break}le&&(M=ni)}I&&((Z=!ae&&Z)&&J--,F&&qe.push(Z))}if(J+=ye,I&&ye!==J){for(te=0;ae=E[te++];)ae(qe,ke,z,Y);if(F){if(J>0)for(;ye--;)qe[ye]||ke[ye]||(ke[ye]=et.call(j));ke=Ln(ke)}m.apply(j,ke),le&&!F&&ke.length>0&&J+E.length>1&&h.uniqueSort(j)}return le&&(M=ni,a=Ke),qe};return I?st(D):D}function ys(w,E){var I,H=[],D=[],F=oe[w+" "];if(!F){for(E||(E=Ti(w)),I=E.length;I--;)F=vs(E[I]),F[P]?H.push(F):D.push(F);F=oe(w,Ma(D,H)),F.selector=w}return F}function lr(w,E,I,H){var D,F,z,Y,j,le=typeof w=="function"&&w,Z=!H&&Ti(w=le.selector||w);if(I=I||[],Z.length===1){if(F=Z[0]=Z[0].slice(0),F.length>2&&(z=F[0]).type==="ID"&&E.nodeType===9&&C&&l.relative[F[1].type]){if(E=(l.find.ID(z.matches[0].replace(Ct,St),E)||[])[0],E)le&&(E=E.parentNode);else return I;w=w.slice(F.shift().value.length)}for(D=ft.needsContext.test(w)?0:F.length;D--&&(z=F[D],!l.relative[Y=z.type]);)if((j=l.find[Y])&&(H=j(z.matches[0].replace(Ct,St),ps.test(F[0].type)&&fs(E.parentNode)||E))){if(F.splice(D,1),w=H.length&&En(F),!w)return m.apply(I,H),I;break}}return(le||ys(w,Z))(H,E,!C,I,!E||ps.test(w)&&fs(E.parentNode)||E),I}L.sortStable=P.split("").sort(Le).join("")===P,Mt(),L.sortDetached=ii(function(w){return w.compareDocumentPosition(v.createElement("fieldset"))&1}),h.find=ge,h.expr[":"]=h.expr.pseudos,h.unique=h.uniqueSort,ge.compile=ys,ge.select=lr,ge.setDocument=Mt,ge.tokenize=Ti,ge.escape=h.escapeSelector,ge.getText=h.text,ge.isXML=h.isXMLDoc,ge.selectors=h.expr,ge.support=h.support,ge.uniqueSort=h.uniqueSort})();var He=function(s,l,a){for(var u=[],f=a!==void 0;(s=s[l])&&s.nodeType!==9;)if(s.nodeType===1){if(f&&h(s).is(a))break;u.push(s)}return u},Ye=function(s,l){for(var a=[];s;s=s.nextSibling)s.nodeType===1&&s!==l&&a.push(s);return a},tt=h.expr.match.needsContext,it=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function hi(s,l,a){return $(l)?h.grep(s,function(u,f){return!!l.call(u,f,u)!==a}):l.nodeType?h.grep(s,function(u){return u===l!==a}):typeof l!="string"?h.grep(s,function(u){return d.call(l,u)>-1!==a}):h.filter(l,s,a)}h.filter=function(s,l,a){var u=l[0];return a&&(s=":not("+s+")"),l.length===1&&u.nodeType===1?h.find.matchesSelector(u,s)?[u]:[]:h.find.matches(s,h.grep(l,function(f){return f.nodeType===1}))},h.fn.extend({find:function(s){var l,a,u=this.length,f=this;if(typeof s!="string")return this.pushStack(h(s).filter(function(){for(l=0;l1?h.uniqueSort(a):a},filter:function(s){return this.pushStack(hi(this,s||[],!1))},not:function(s){return this.pushStack(hi(this,s||[],!0))},is:function(s){return!!hi(this,typeof s=="string"&&tt.test(s)?h(s):s||[],!1).length}});var xo,Ml=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,kl=h.fn.init=function(s,l,a){var u,f;if(!s)return this;if(a=a||xo,typeof s=="string")if(s[0]==="<"&&s[s.length-1]===">"&&s.length>=3?u=[null,s,null]:u=Ml.exec(s),u&&(u[1]||!l))if(u[1]){if(l=l instanceof h?l[0]:l,h.merge(this,h.parseHTML(u[1],l&&l.nodeType?l.ownerDocument||l:N,!0)),it.test(u[1])&&h.isPlainObject(l))for(u in l)$(this[u])?this[u](l[u]):this.attr(u,l[u]);return this}else return f=N.getElementById(u[2]),f&&(this[0]=f,this.length=1),this;else return!l||l.jquery?(l||a).find(s):this.constructor(l).find(s);else{if(s.nodeType)return this[0]=s,this.length=1,this;if($(s))return a.ready!==void 0?a.ready(s):s(h)}return h.makeArray(s,this)};kl.prototype=h.fn,xo=h(N);var Hl=/^(?:parents|prev(?:Until|All))/,Al={children:!0,contents:!0,next:!0,prev:!0};h.fn.extend({has:function(s){var l=h(s,this),a=l.length;return this.filter(function(){for(var u=0;u-1:a.nodeType===1&&h.find.matchesSelector(a,s))){m.push(a);break}}return this.pushStack(m.length>1?h.uniqueSort(m):m)},index:function(s){return s?typeof s=="string"?d.call(h(s),this[0]):d.call(this,s.jquery?s[0]:s):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(s,l){return this.pushStack(h.uniqueSort(h.merge(this.get(),h(s,l))))},addBack:function(s){return this.add(s==null?this.prevObject:this.prevObject.filter(s))}});function Lo(s,l){for(;(s=s[l])&&s.nodeType!==1;);return s}h.each({parent:function(s){var l=s.parentNode;return l&&l.nodeType!==11?l:null},parents:function(s){return He(s,"parentNode")},parentsUntil:function(s,l,a){return He(s,"parentNode",a)},next:function(s){return Lo(s,"nextSibling")},prev:function(s){return Lo(s,"previousSibling")},nextAll:function(s){return He(s,"nextSibling")},prevAll:function(s){return He(s,"previousSibling")},nextUntil:function(s,l,a){return He(s,"nextSibling",a)},prevUntil:function(s,l,a){return He(s,"previousSibling",a)},siblings:function(s){return Ye((s.parentNode||{}).firstChild,s)},children:function(s){return Ye(s.firstChild)},contents:function(s){return s.contentDocument!=null&&t(s.contentDocument)?s.contentDocument:(fe(s,"template")&&(s=s.content||s),h.merge([],s.childNodes))}},function(s,l){h.fn[s]=function(a,u){var f=h.map(this,l,a);return s.slice(-5)!=="Until"&&(u=a),u&&typeof u=="string"&&(f=h.filter(u,f)),this.length>1&&(Al[s]||h.uniqueSort(f),Hl.test(s)&&f.reverse()),this.pushStack(f)}});var ct=/[^\x20\t\r\n\f]+/g;function Dl(s){var l={};return h.each(s.match(ct)||[],function(a,u){l[u]=!0}),l}h.Callbacks=function(s){s=typeof s=="string"?Dl(s):h.extend({},s);var l,a,u,f,m=[],v=[],S=-1,C=function(){for(f=f||s.once,u=l=!0;v.length;S=-1)for(a=v.shift();++S-1;)m.splice(M,1),M<=S&&S--}),this},has:function(A){return A?h.inArray(A,m)>-1:m.length>0},empty:function(){return m&&(m=[]),this},disable:function(){return f=v=[],m=a="",this},disabled:function(){return!m},lock:function(){return f=v=[],!a&&!l&&(m=a=""),this},locked:function(){return!!f},fireWith:function(A,P){return f||(P=P||[],P=[A,P.slice?P.slice():P],v.push(P),l||C()),this},fire:function(){return x.fireWith(this,arguments),this},fired:function(){return!!u}};return x};function Kt(s){return s}function gn(s){throw s}function Io(s,l,a,u){var f;try{s&&$(f=s.promise)?f.call(s).done(l).fail(a):s&&$(f=s.then)?f.call(s,l,a):l.apply(void 0,[s].slice(u))}catch(m){a.apply(void 0,[m])}}h.extend({Deferred:function(s){var l=[["notify","progress",h.Callbacks("memory"),h.Callbacks("memory"),2],["resolve","done",h.Callbacks("once memory"),h.Callbacks("once memory"),0,"resolved"],["reject","fail",h.Callbacks("once memory"),h.Callbacks("once memory"),1,"rejected"]],a="pending",u={state:function(){return a},always:function(){return f.done(arguments).fail(arguments),this},catch:function(m){return u.then(null,m)},pipe:function(){var m=arguments;return h.Deferred(function(v){h.each(l,function(S,C){var x=$(m[C[4]])&&m[C[4]];f[C[1]](function(){var A=x&&x.apply(this,arguments);A&&$(A.promise)?A.promise().progress(v.notify).done(v.resolve).fail(v.reject):v[C[0]+"With"](this,x?[A]:arguments)})}),m=null}).promise()},then:function(m,v,S){var C=0;function x(A,P,M,O){return function(){var ee=this,he=arguments,oe=function(){var Le,ut;if(!(A=C&&(M!==gn&&(ee=void 0,he=[Le]),P.rejectWith(ee,he))}};A?Me():(h.Deferred.getErrorHook?Me.error=h.Deferred.getErrorHook():h.Deferred.getStackHook&&(Me.error=h.Deferred.getStackHook()),n.setTimeout(Me))}}return h.Deferred(function(A){l[0][3].add(x(0,A,$(S)?S:Kt,A.notifyWith)),l[1][3].add(x(0,A,$(m)?m:Kt)),l[2][3].add(x(0,A,$(v)?v:gn))}).promise()},promise:function(m){return m!=null?h.extend(m,u):u}},f={};return h.each(l,function(m,v){var S=v[2],C=v[5];u[v[1]]=S.add,C&&S.add(function(){a=C},l[3-m][2].disable,l[3-m][3].disable,l[0][2].lock,l[0][3].lock),S.add(v[3].fire),f[v[0]]=function(){return f[v[0]+"With"](this===f?void 0:this,arguments),this},f[v[0]+"With"]=S.fireWith}),u.promise(f),s&&s.call(f,f),f},when:function(s){var l=arguments.length,a=l,u=Array(a),f=i.call(arguments),m=h.Deferred(),v=function(S){return function(C){u[S]=this,f[S]=arguments.length>1?i.call(arguments):C,--l||m.resolveWith(u,f)}};if(l<=1&&(Io(s,m.done(v(a)).resolve,m.reject,!l),m.state()==="pending"||$(f[a]&&f[a].then)))return m.then();for(;a--;)Io(f[a],v(a),m.reject);return m.promise()}});var Pl=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;h.Deferred.exceptionHook=function(s,l){n.console&&n.console.warn&&s&&Pl.test(s.name)&&n.console.warn("jQuery.Deferred exception: "+s.message,s.stack,l)},h.readyException=function(s){n.setTimeout(function(){throw s})};var Jn=h.Deferred();h.fn.ready=function(s){return Jn.then(s).catch(function(l){h.readyException(l)}),this},h.extend({isReady:!1,readyWait:1,ready:function(s){(s===!0?--h.readyWait:h.isReady)||(h.isReady=!0,!(s!==!0&&--h.readyWait>0)&&Jn.resolveWith(N,[h]))}}),h.ready.then=Jn.then;function vn(){N.removeEventListener("DOMContentLoaded",vn),n.removeEventListener("load",vn),h.ready()}N.readyState==="complete"||N.readyState!=="loading"&&!N.documentElement.doScroll?n.setTimeout(h.ready):(N.addEventListener("DOMContentLoaded",vn),n.addEventListener("load",vn));var bt=function(s,l,a,u,f,m,v){var S=0,C=s.length,x=a==null;if(V(a)==="object"){f=!0;for(S in a)bt(s,l,S,a[S],!0,m,v)}else if(u!==void 0&&(f=!0,$(u)||(v=!0),x&&(v?(l.call(s,u),l=null):(x=l,l=function(A,P,M){return x.call(h(A),M)})),l))for(;S1,null,!0)},removeData:function(s){return this.each(function(){Oe.remove(this,s)})}}),h.extend({queue:function(s,l,a){var u;if(s)return l=(l||"fx")+"queue",u=K.get(s,l),a&&(!u||Array.isArray(a)?u=K.access(s,l,h.makeArray(a)):u.push(a)),u||[]},dequeue:function(s,l){l=l||"fx";var a=h.queue(s,l),u=a.length,f=a.shift(),m=h._queueHooks(s,l),v=function(){h.dequeue(s,l)};f==="inprogress"&&(f=a.shift(),u--),f&&(l==="fx"&&a.unshift("inprogress"),delete m.stop,f.call(s,v,m)),!u&&m&&m.empty.fire()},_queueHooks:function(s,l){var a=l+"queueHooks";return K.get(s,a)||K.access(s,a,{empty:h.Callbacks("once memory").add(function(){K.remove(s,[l+"queue",a])})})}}),h.fn.extend({queue:function(s,l){var a=2;return typeof s!="string"&&(l=s,s="fx",a--),arguments.length\x20\t\r\n\f]*)/i,Po=/^$|^module$|\/(?:java|ecma)script/i;(function(){var s=N.createDocumentFragment(),l=s.appendChild(N.createElement("div")),a=N.createElement("input");a.setAttribute("type","radio"),a.setAttribute("checked","checked"),a.setAttribute("name","t"),l.appendChild(a),L.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,l.innerHTML="",L.noCloneChecked=!!l.cloneNode(!0).lastChild.defaultValue,l.innerHTML="",L.option=!!l.lastChild})();var _e={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};_e.tbody=_e.tfoot=_e.colgroup=_e.caption=_e.thead,_e.th=_e.td,L.option||(_e.optgroup=_e.option=[1,""]);function Ne(s,l){var a;return typeof s.getElementsByTagName!="undefined"?a=s.getElementsByTagName(l||"*"):typeof s.querySelectorAll!="undefined"?a=s.querySelectorAll(l||"*"):a=[],l===void 0||l&&fe(s,l)?h.merge([s],a):a}function Zn(s,l){for(var a=0,u=s.length;a-1){f&&f.push(m);continue}if(x=Xt(m),v=Ne(P.appendChild(m),"script"),x&&Zn(v),a)for(A=0;m=v[A++];)Po.test(m.type||"")&&a.push(m)}return P}var Oo=/^([^.]*)(?:\.(.+)|)/;function Zt(){return!0}function Gt(){return!1}function Gn(s,l,a,u,f,m){var v,S;if(typeof l=="object"){typeof a!="string"&&(u=u||a,a=void 0);for(S in l)Gn(s,S,a,u,l[S],m);return s}if(u==null&&f==null?(f=a,u=a=void 0):f==null&&(typeof a=="string"?(f=u,u=void 0):(f=u,u=a,a=void 0)),f===!1)f=Gt;else if(!f)return s;return m===1&&(v=f,f=function(C){return h().off(C),v.apply(this,arguments)},f.guid=v.guid||(v.guid=h.guid++)),s.each(function(){h.event.add(this,l,f,u,a)})}h.event={global:{},add:function(s,l,a,u,f){var m,v,S,C,x,A,P,M,O,ee,he,oe=K.get(s);if(pi(s))for(a.handler&&(m=a,a=m.handler,f=m.selector),f&&h.find.matchesSelector($t,f),a.guid||(a.guid=h.guid++),(C=oe.events)||(C=oe.events=Object.create(null)),(v=oe.handle)||(v=oe.handle=function(Me){return typeof h!="undefined"&&h.event.triggered!==Me.type?h.event.dispatch.apply(s,arguments):void 0}),l=(l||"").match(ct)||[""],x=l.length;x--;)S=Oo.exec(l[x])||[],O=he=S[1],ee=(S[2]||"").split(".").sort(),O&&(P=h.event.special[O]||{},O=(f?P.delegateType:P.bindType)||O,P=h.event.special[O]||{},A=h.extend({type:O,origType:he,data:u,handler:a,guid:a.guid,selector:f,needsContext:f&&h.expr.match.needsContext.test(f),namespace:ee.join(".")},m),(M=C[O])||(M=C[O]=[],M.delegateCount=0,(!P.setup||P.setup.call(s,u,ee,v)===!1)&&s.addEventListener&&s.addEventListener(O,v)),P.add&&(P.add.call(s,A),A.handler.guid||(A.handler.guid=a.guid)),f?M.splice(M.delegateCount++,0,A):M.push(A),h.event.global[O]=!0)},remove:function(s,l,a,u,f){var m,v,S,C,x,A,P,M,O,ee,he,oe=K.hasData(s)&&K.get(s);if(!(!oe||!(C=oe.events))){for(l=(l||"").match(ct)||[""],x=l.length;x--;){if(S=Oo.exec(l[x])||[],O=he=S[1],ee=(S[2]||"").split(".").sort(),!O){for(O in C)h.event.remove(s,O+l[x],a,u,!0);continue}for(P=h.event.special[O]||{},O=(u?P.delegateType:P.bindType)||O,M=C[O]||[],S=S[2]&&new RegExp("(^|\\.)"+ee.join("\\.(?:.*\\.|)")+"(\\.|$)"),v=m=M.length;m--;)A=M[m],(f||he===A.origType)&&(!a||a.guid===A.guid)&&(!S||S.test(A.namespace))&&(!u||u===A.selector||u==="**"&&A.selector)&&(M.splice(m,1),A.selector&&M.delegateCount--,P.remove&&P.remove.call(s,A));v&&!M.length&&((!P.teardown||P.teardown.call(s,ee,oe.handle)===!1)&&h.removeEvent(s,O,oe.handle),delete C[O])}h.isEmptyObject(C)&&K.remove(s,"handle events")}},dispatch:function(s){var l,a,u,f,m,v,S=new Array(arguments.length),C=h.event.fix(s),x=(K.get(this,"events")||Object.create(null))[C.type]||[],A=h.event.special[C.type]||{};for(S[0]=C,l=1;l=1)){for(;x!==this;x=x.parentNode||this)if(x.nodeType===1&&!(s.type==="click"&&x.disabled===!0)){for(m=[],v={},a=0;a-1:h.find(f,this,null,[x]).length),v[f]&&m.push(u);m.length&&S.push({elem:x,handlers:m})}}return x=this,C\s*$/g;function No(s,l){return fe(s,"table")&&fe(l.nodeType!==11?l:l.firstChild,"tr")&&h(s).children("tbody")[0]||s}function Yl(s){return s.type=(s.getAttribute("type")!==null)+"/"+s.type,s}function _l(s){return(s.type||"").slice(0,5)==="true/"?s.type=s.type.slice(5):s.removeAttribute("type"),s}function Bo(s,l){var a,u,f,m,v,S,C;if(l.nodeType===1){if(K.hasData(s)&&(m=K.get(s),C=m.events,C)){K.remove(l,"handle events");for(f in C)for(a=0,u=C[f].length;a1&&typeof O=="string"&&!L.checkClone&&jl.test(O))return s.each(function(he){var oe=s.eq(he);ee&&(l[0]=O.call(this,he,oe.html())),ei(oe,l,a,u)});if(P&&(f=$o(l,s[0].ownerDocument,!1,s,u),m=f.firstChild,f.childNodes.length===1&&(f=m),m||u)){for(v=h.map(Ne(f,"script"),Yl),S=v.length;A0&&Zn(v,!C&&Ne(s,"script")),S},cleanData:function(s){for(var l,a,u,f=h.event.special,m=0;(a=s[m])!==void 0;m++)if(pi(a)){if(l=a[K.expando]){if(l.events)for(u in l.events)f[u]?h.event.remove(a,u):h.removeEvent(a,u,l.handle);a[K.expando]=void 0}a[Oe.expando]&&(a[Oe.expando]=void 0)}}}),h.fn.extend({detach:function(s){return qo(this,s,!0)},remove:function(s){return qo(this,s)},text:function(s){return bt(this,function(l){return l===void 0?h.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=l)})},null,s,arguments.length)},append:function(){return ei(this,arguments,function(s){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var l=No(this,s);l.appendChild(s)}})},prepend:function(){return ei(this,arguments,function(s){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var l=No(this,s);l.insertBefore(s,l.firstChild)}})},before:function(){return ei(this,arguments,function(s){this.parentNode&&this.parentNode.insertBefore(s,this)})},after:function(){return ei(this,arguments,function(s){this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling)})},empty:function(){for(var s,l=0;(s=this[l])!=null;l++)s.nodeType===1&&(h.cleanData(Ne(s,!1)),s.textContent="");return this},clone:function(s,l){return s=s==null?!1:s,l=l==null?s:l,this.map(function(){return h.clone(this,s,l)})},html:function(s){return bt(this,function(l){var a=this[0]||{},u=0,f=this.length;if(l===void 0&&a.nodeType===1)return a.innerHTML;if(typeof l=="string"&&!zl.test(l)&&!_e[(Do.exec(l)||["",""])[1].toLowerCase()]){l=h.htmlPrefilter(l);try{for(;u=0&&(C+=Math.max(0,Math.ceil(s["offset"+l[0].toUpperCase()+l.slice(1)]-m-C-S-.5))||0),C+x}function Yo(s,l,a){var u=wn(s),f=!L.boxSizingReliable()||a,m=f&&h.css(s,"boxSizing",!1,u)==="border-box",v=m,S=vi(s,l,u),C="offset"+l[0].toUpperCase()+l.slice(1);if(es.test(S)){if(!a)return S;S="auto"}return(!L.boxSizingReliable()&&m||!L.reliableTrDimensions()&&fe(s,"tr")||S==="auto"||!parseFloat(S)&&h.css(s,"display",!1,u)==="inline")&&s.getClientRects().length&&(m=h.css(s,"boxSizing",!1,u)==="border-box",v=C in s,v&&(S=s[C])),S=parseFloat(S)||0,S+ns(s,l,a||(m?"border":"content"),v,u,S)+"px"}h.extend({cssHooks:{opacity:{get:function(s,l){if(l){var a=vi(s,"opacity");return a===""?"1":a}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(s,l,a,u){if(!(!s||s.nodeType===3||s.nodeType===8||!s.style)){var f,m,v,S=dt(l),C=ts.test(l),x=s.style;if(C||(l=is(S)),v=h.cssHooks[l]||h.cssHooks[S],a!==void 0){if(m=typeof a,m==="string"&&(f=mi.exec(a))&&f[1]&&(a=Ho(s,l,f),m="number"),a==null||a!==a)return;m==="number"&&!C&&(a+=f&&f[3]||(h.cssNumber[S]?"":"px")),!L.clearCloneStyle&&a===""&&l.indexOf("background")===0&&(x[l]="inherit"),(!v||!("set"in v)||(a=v.set(s,a,u))!==void 0)&&(C?x.setProperty(l,a):x[l]=a)}else return v&&"get"in v&&(f=v.get(s,!1,u))!==void 0?f:x[l]}},css:function(s,l,a,u){var f,m,v,S=dt(l),C=ts.test(l);return C||(l=is(S)),v=h.cssHooks[l]||h.cssHooks[S],v&&"get"in v&&(f=v.get(s,!0,a)),f===void 0&&(f=vi(s,l,u)),f==="normal"&&l in jo&&(f=jo[l]),a===""||a?(m=parseFloat(f),a===!0||isFinite(m)?m||0:f):f}}),h.each(["height","width"],function(s,l){h.cssHooks[l]={get:function(a,u,f){if(u)return Jl.test(h.css(a,"display"))&&(!a.getClientRects().length||!a.getBoundingClientRect().width)?Fo(a,Zl,function(){return Yo(a,l,f)}):Yo(a,l,f)},set:function(a,u,f){var m,v=wn(a),S=!L.scrollboxSize()&&v.position==="absolute",C=S||f,x=C&&h.css(a,"boxSizing",!1,v)==="border-box",A=f?ns(a,l,f,x,v):0;return x&&S&&(A-=Math.ceil(a["offset"+l[0].toUpperCase()+l.slice(1)]-parseFloat(v[l])-ns(a,l,"border",!1,v)-.5)),A&&(m=mi.exec(u))&&(m[3]||"px")!=="px"&&(a.style[l]=u,u=h.css(a,l)),Uo(a,u,A)}}}),h.cssHooks.marginLeft=Ro(L.reliableMarginLeft,function(s,l){if(l)return(parseFloat(vi(s,"marginLeft"))||s.getBoundingClientRect().left-Fo(s,{marginLeft:0},function(){return s.getBoundingClientRect().left}))+"px"}),h.each({margin:"",padding:"",border:"Width"},function(s,l){h.cssHooks[s+l]={expand:function(a){for(var u=0,f={},m=typeof a=="string"?a.split(" "):[a];u<4;u++)f[s+wt[u]+l]=m[u]||m[u-2]||m[0];return f}},s!=="margin"&&(h.cssHooks[s+l].set=Uo)}),h.fn.extend({css:function(s,l){return bt(this,function(a,u,f){var m,v,S={},C=0;if(Array.isArray(u)){for(m=wn(a),v=u.length;C1)}});function Be(s,l,a,u,f){return new Be.prototype.init(s,l,a,u,f)}h.Tween=Be,Be.prototype={constructor:Be,init:function(s,l,a,u,f,m){this.elem=s,this.prop=a,this.easing=f||h.easing._default,this.options=l,this.start=this.now=this.cur(),this.end=u,this.unit=m||(h.cssNumber[a]?"":"px")},cur:function(){var s=Be.propHooks[this.prop];return s&&s.get?s.get(this):Be.propHooks._default.get(this)},run:function(s){var l,a=Be.propHooks[this.prop];return this.options.duration?this.pos=l=h.easing[this.easing](s,this.options.duration*s,0,1,this.options.duration):this.pos=l=s,this.now=(this.end-this.start)*l+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),a&&a.set?a.set(this):Be.propHooks._default.set(this),this}},Be.prototype.init.prototype=Be.prototype,Be.propHooks={_default:{get:function(s){var l;return s.elem.nodeType!==1||s.elem[s.prop]!=null&&s.elem.style[s.prop]==null?s.elem[s.prop]:(l=h.css(s.elem,s.prop,""),!l||l==="auto"?0:l)},set:function(s){h.fx.step[s.prop]?h.fx.step[s.prop](s):s.elem.nodeType===1&&(h.cssHooks[s.prop]||s.elem.style[is(s.prop)]!=null)?h.style(s.elem,s.prop,s.now+s.unit):s.elem[s.prop]=s.now}}},Be.propHooks.scrollTop=Be.propHooks.scrollLeft={set:function(s){s.elem.nodeType&&s.elem.parentNode&&(s.elem[s.prop]=s.now)}},h.easing={linear:function(s){return s},swing:function(s){return .5-Math.cos(s*Math.PI)/2},_default:"swing"},h.fx=Be.prototype.init,h.fx.step={};var ti,Cn,Gl=/^(?:toggle|show|hide)$/,ea=/queueHooks$/;function ss(){Cn&&(N.hidden===!1&&n.requestAnimationFrame?n.requestAnimationFrame(ss):n.setTimeout(ss,h.fx.interval),h.fx.tick())}function _o(){return n.setTimeout(function(){ti=void 0}),ti=Date.now()}function Sn(s,l){var a,u=0,f={height:s};for(l=l?1:0;u<4;u+=2-l)a=wt[u],f["margin"+a]=f["padding"+a]=s;return l&&(f.opacity=f.width=s),f}function Qo(s,l,a){for(var u,f=(nt.tweeners[l]||[]).concat(nt.tweeners["*"]),m=0,v=f.length;m1)},removeAttr:function(s){return this.each(function(){h.removeAttr(this,s)})}}),h.extend({attr:function(s,l,a){var u,f,m=s.nodeType;if(!(m===3||m===8||m===2)){if(typeof s.getAttribute=="undefined")return h.prop(s,l,a);if((m!==1||!h.isXMLDoc(s))&&(f=h.attrHooks[l.toLowerCase()]||(h.expr.match.bool.test(l)?Ko:void 0)),a!==void 0){if(a===null){h.removeAttr(s,l);return}return f&&"set"in f&&(u=f.set(s,a,l))!==void 0?u:(s.setAttribute(l,a+""),a)}return f&&"get"in f&&(u=f.get(s,l))!==null?u:(u=h.find.attr(s,l),u==null?void 0:u)}},attrHooks:{type:{set:function(s,l){if(!L.radioValue&&l==="radio"&&fe(s,"input")){var a=s.value;return s.setAttribute("type",l),a&&(s.value=a),l}}}},removeAttr:function(s,l){var a,u=0,f=l&&l.match(ct);if(f&&s.nodeType===1)for(;a=f[u++];)s.removeAttribute(a)}}),Ko={set:function(s,l,a){return l===!1?h.removeAttr(s,a):s.setAttribute(a,a),a}},h.each(h.expr.match.bool.source.match(/\w+/g),function(s,l){var a=yi[l]||h.find.attr;yi[l]=function(u,f,m){var v,S,C=f.toLowerCase();return m||(S=yi[C],yi[C]=v,v=a(u,f,m)!=null?C:null,yi[C]=S),v}});var na=/^(?:input|select|textarea|button)$/i,sa=/^(?:a|area)$/i;h.fn.extend({prop:function(s,l){return bt(this,h.prop,s,l,arguments.length>1)},removeProp:function(s){return this.each(function(){delete this[h.propFix[s]||s]})}}),h.extend({prop:function(s,l,a){var u,f,m=s.nodeType;if(!(m===3||m===8||m===2))return(m!==1||!h.isXMLDoc(s))&&(l=h.propFix[l]||l,f=h.propHooks[l]),a!==void 0?f&&"set"in f&&(u=f.set(s,a,l))!==void 0?u:s[l]=a:f&&"get"in f&&(u=f.get(s,l))!==null?u:s[l]},propHooks:{tabIndex:{get:function(s){var l=h.find.attr(s,"tabindex");return l?parseInt(l,10):na.test(s.nodeName)||sa.test(s.nodeName)&&s.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),L.optSelected||(h.propHooks.selected={get:function(s){var l=s.parentNode;return l&&l.parentNode&&l.parentNode.selectedIndex,null},set:function(s){var l=s.parentNode;l&&(l.selectedIndex,l.parentNode&&l.parentNode.selectedIndex)}}),h.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){h.propFix[this.toLowerCase()]=this});function Ot(s){var l=s.match(ct)||[];return l.join(" ")}function Nt(s){return s.getAttribute&&s.getAttribute("class")||""}function os(s){return Array.isArray(s)?s:typeof s=="string"?s.match(ct)||[]:[]}h.fn.extend({addClass:function(s){var l,a,u,f,m,v;return $(s)?this.each(function(S){h(this).addClass(s.call(this,S,Nt(this)))}):(l=os(s),l.length?this.each(function(){if(u=Nt(this),a=this.nodeType===1&&" "+Ot(u)+" ",a){for(m=0;m-1;)a=a.replace(" "+f+" "," ");v=Ot(a),u!==v&&this.setAttribute("class",v)}}):this):this.attr("class","")},toggleClass:function(s,l){var a,u,f,m,v=typeof s,S=v==="string"||Array.isArray(s);return $(s)?this.each(function(C){h(this).toggleClass(s.call(this,C,Nt(this),l),l)}):typeof l=="boolean"&&S?l?this.addClass(s):this.removeClass(s):(a=os(s),this.each(function(){if(S)for(m=h(this),f=0;f-1)return!0;return!1}});var oa=/\r/g;h.fn.extend({val:function(s){var l,a,u,f=this[0];return arguments.length?(u=$(s),this.each(function(m){var v;this.nodeType===1&&(u?v=s.call(this,m,h(this).val()):v=s,v==null?v="":typeof v=="number"?v+="":Array.isArray(v)&&(v=h.map(v,function(S){return S==null?"":S+""})),l=h.valHooks[this.type]||h.valHooks[this.nodeName.toLowerCase()],(!l||!("set"in l)||l.set(this,v,"value")===void 0)&&(this.value=v))})):f?(l=h.valHooks[f.type]||h.valHooks[f.nodeName.toLowerCase()],l&&"get"in l&&(a=l.get(f,"value"))!==void 0?a:(a=f.value,typeof a=="string"?a.replace(oa,""):a==null?"":a)):void 0}}),h.extend({valHooks:{option:{get:function(s){var l=h.find.attr(s,"value");return l!=null?l:Ot(h.text(s))}},select:{get:function(s){var l,a,u,f=s.options,m=s.selectedIndex,v=s.type==="select-one",S=v?null:[],C=v?m+1:f.length;for(m<0?u=C:u=v?m:0;u-1)&&(a=!0);return a||(s.selectedIndex=-1),m}}}}),h.each(["radio","checkbox"],function(){h.valHooks[this]={set:function(s,l){if(Array.isArray(l))return s.checked=h.inArray(h(s).val(),l)>-1}},L.checkOn||(h.valHooks[this].get=function(s){return s.getAttribute("value")===null?"on":s.value})});var bi=n.location,Xo={guid:Date.now()},rs=/\?/;h.parseXML=function(s){var l,a;if(!s||typeof s!="string")return null;try{l=new n.DOMParser().parseFromString(s,"text/xml")}catch(u){}return a=l&&l.getElementsByTagName("parsererror")[0],(!l||a)&&h.error("Invalid XML: "+(a?h.map(a.childNodes,function(u){return u.textContent}).join(` +`):s)),l};var Jo=/^(?:focusinfocus|focusoutblur)$/,Zo=function(s){s.stopPropagation()};h.extend(h.event,{trigger:function(s,l,a,u){var f,m,v,S,C,x,A,P,M=[a||N],O=b.call(s,"type")?s.type:s,ee=b.call(s,"namespace")?s.namespace.split("."):[];if(m=P=v=a=a||N,!(a.nodeType===3||a.nodeType===8)&&!Jo.test(O+h.event.triggered)&&(O.indexOf(".")>-1&&(ee=O.split("."),O=ee.shift(),ee.sort()),C=O.indexOf(":")<0&&"on"+O,s=s[h.expando]?s:new h.Event(O,typeof s=="object"&&s),s.isTrigger=u?2:3,s.namespace=ee.join("."),s.rnamespace=s.namespace?new RegExp("(^|\\.)"+ee.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,s.result=void 0,s.target||(s.target=a),l=l==null?[s]:h.makeArray(l,[s]),A=h.event.special[O]||{},!(!u&&A.trigger&&A.trigger.apply(a,l)===!1))){if(!u&&!A.noBubble&&!W(a)){for(S=A.delegateType||O,Jo.test(S+O)||(m=m.parentNode);m;m=m.parentNode)M.push(m),v=m;v===(a.ownerDocument||N)&&M.push(v.defaultView||v.parentWindow||n)}for(f=0;(m=M[f++])&&!s.isPropagationStopped();)P=m,s.type=f>1?S:A.bindType||O,x=(K.get(m,"events")||Object.create(null))[s.type]&&K.get(m,"handle"),x&&x.apply(m,l),x=C&&m[C],x&&x.apply&&pi(m)&&(s.result=x.apply(m,l),s.result===!1&&s.preventDefault());return s.type=O,!u&&!s.isDefaultPrevented()&&(!A._default||A._default.apply(M.pop(),l)===!1)&&pi(a)&&C&&$(a[O])&&!W(a)&&(v=a[C],v&&(a[C]=null),h.event.triggered=O,s.isPropagationStopped()&&P.addEventListener(O,Zo),a[O](),s.isPropagationStopped()&&P.removeEventListener(O,Zo),h.event.triggered=void 0,v&&(a[C]=v)),s.result}},simulate:function(s,l,a){var u=h.extend(new h.Event,a,{type:s,isSimulated:!0});h.event.trigger(u,null,l)}}),h.fn.extend({trigger:function(s,l){return this.each(function(){h.event.trigger(s,l,this)})},triggerHandler:function(s,l){var a=this[0];if(a)return h.event.trigger(s,l,a,!0)}});var ra=/\[\]$/,Go=/\r?\n/g,la=/^(?:submit|button|image|reset|file)$/i,aa=/^(?:input|select|textarea|keygen)/i;function ls(s,l,a,u){var f;if(Array.isArray(l))h.each(l,function(m,v){a||ra.test(s)?u(s,v):ls(s+"["+(typeof v=="object"&&v!=null?m:"")+"]",v,a,u)});else if(!a&&V(l)==="object")for(f in l)ls(s+"["+f+"]",l[f],a,u);else u(s,l)}h.param=function(s,l){var a,u=[],f=function(m,v){var S=$(v)?v():v;u[u.length]=encodeURIComponent(m)+"="+encodeURIComponent(S==null?"":S)};if(s==null)return"";if(Array.isArray(s)||s.jquery&&!h.isPlainObject(s))h.each(s,function(){f(this.name,this.value)});else for(a in s)ls(a,s[a],l,f);return u.join("&")},h.fn.extend({serialize:function(){return h.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var s=h.prop(this,"elements");return s?h.makeArray(s):this}).filter(function(){var s=this.type;return this.name&&!h(this).is(":disabled")&&aa.test(this.nodeName)&&!la.test(s)&&(this.checked||!gi.test(s))}).map(function(s,l){var a=h(this).val();return a==null?null:Array.isArray(a)?h.map(a,function(u){return{name:l.name,value:u.replace(Go,`\r +`)}}):{name:l.name,value:a.replace(Go,`\r +`)}}).get()}});var ca=/%20/g,da=/#.*$/,ua=/([?&])_=[^&]*/,ha=/^(.*?):[ \t]*([^\r\n]*)$/mg,pa=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,fa=/^(?:GET|HEAD)$/,ma=/^\/\//,er={},as={},tr="*/".concat("*"),cs=N.createElement("a");cs.href=bi.href;function ir(s){return function(l,a){typeof l!="string"&&(a=l,l="*");var u,f=0,m=l.toLowerCase().match(ct)||[];if($(a))for(;u=m[f++];)u[0]==="+"?(u=u.slice(1)||"*",(s[u]=s[u]||[]).unshift(a)):(s[u]=s[u]||[]).push(a)}}function nr(s,l,a,u){var f={},m=s===as;function v(S){var C;return f[S]=!0,h.each(s[S]||[],function(x,A){var P=A(l,a,u);if(typeof P=="string"&&!m&&!f[P])return l.dataTypes.unshift(P),v(P),!1;if(m)return!(C=P)}),C}return v(l.dataTypes[0])||!f["*"]&&v("*")}function ds(s,l){var a,u,f=h.ajaxSettings.flatOptions||{};for(a in l)l[a]!==void 0&&((f[a]?s:u||(u={}))[a]=l[a]);return u&&h.extend(!0,s,u),s}function ga(s,l,a){for(var u,f,m,v,S=s.contents,C=s.dataTypes;C[0]==="*";)C.shift(),u===void 0&&(u=s.mimeType||l.getResponseHeader("Content-Type"));if(u){for(f in S)if(S[f]&&S[f].test(u)){C.unshift(f);break}}if(C[0]in a)m=C[0];else{for(f in a){if(!C[0]||s.converters[f+" "+C[0]]){m=f;break}v||(v=f)}m=m||v}if(m)return m!==C[0]&&C.unshift(m),a[m]}function va(s,l,a,u){var f,m,v,S,C,x={},A=s.dataTypes.slice();if(A[1])for(v in s.converters)x[v.toLowerCase()]=s.converters[v];for(m=A.shift();m;)if(s.responseFields[m]&&(a[s.responseFields[m]]=l),!C&&u&&s.dataFilter&&(l=s.dataFilter(l,s.dataType)),C=m,m=A.shift(),m){if(m==="*")m=C;else if(C!=="*"&&C!==m){if(v=x[C+" "+m]||x["* "+m],!v){for(f in x)if(S=f.split(" "),S[1]===m&&(v=x[C+" "+S[0]]||x["* "+S[0]],v)){v===!0?v=x[f]:x[f]!==!0&&(m=S[0],A.unshift(S[1]));break}}if(v!==!0)if(v&&s.throws)l=v(l);else try{l=v(l)}catch(P){return{state:"parsererror",error:v?P:"No conversion from "+C+" to "+m}}}}return{state:"success",data:l}}h.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bi.href,type:"GET",isLocal:pa.test(bi.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tr,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":h.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(s,l){return l?ds(ds(s,h.ajaxSettings),l):ds(h.ajaxSettings,s)},ajaxPrefilter:ir(er),ajaxTransport:ir(as),ajax:function(s,l){typeof s=="object"&&(l=s,s=void 0),l=l||{};var a,u,f,m,v,S,C,x,A,P,M=h.ajaxSetup({},l),O=M.context||M,ee=M.context&&(O.nodeType||O.jquery)?h(O):h.event,he=h.Deferred(),oe=h.Callbacks("once memory"),Me=M.statusCode||{},Le={},ut={},ht="canceled",ce={readyState:0,getResponseHeader:function(me){var Te;if(C){if(!m)for(m={};Te=ha.exec(f);)m[Te[1].toLowerCase()+" "]=(m[Te[1].toLowerCase()+" "]||[]).concat(Te[2]);Te=m[me.toLowerCase()+" "]}return Te==null?null:Te.join(", ")},getAllResponseHeaders:function(){return C?f:null},setRequestHeader:function(me,Te){return C==null&&(me=ut[me.toLowerCase()]=ut[me.toLowerCase()]||me,Le[me]=Te),this},overrideMimeType:function(me){return C==null&&(M.mimeType=me),this},statusCode:function(me){var Te;if(me)if(C)ce.always(me[ce.status]);else for(Te in me)Me[Te]=[Me[Te],me[Te]];return this},abort:function(me){var Te=me||ht;return a&&a.abort(Te),Bt(0,Te),this}};if(he.promise(ce),M.url=((s||M.url||bi.href)+"").replace(ma,bi.protocol+"//"),M.type=l.method||l.type||M.method||M.type,M.dataTypes=(M.dataType||"*").toLowerCase().match(ct)||[""],M.crossDomain==null){S=N.createElement("a");try{S.href=M.url,S.href=S.href,M.crossDomain=cs.protocol+"//"+cs.host!=S.protocol+"//"+S.host}catch(me){M.crossDomain=!0}}if(M.data&&M.processData&&typeof M.data!="string"&&(M.data=h.param(M.data,M.traditional)),nr(er,M,l,ce),C)return ce;x=h.event&&M.global,x&&h.active++===0&&h.event.trigger("ajaxStart"),M.type=M.type.toUpperCase(),M.hasContent=!fa.test(M.type),u=M.url.replace(da,""),M.hasContent?M.data&&M.processData&&(M.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(M.data=M.data.replace(ca,"+")):(P=M.url.slice(u.length),M.data&&(M.processData||typeof M.data=="string")&&(u+=(rs.test(u)?"&":"?")+M.data,delete M.data),M.cache===!1&&(u=u.replace(ua,"$1"),P=(rs.test(u)?"&":"?")+"_="+Xo.guid+++P),M.url=u+P),M.ifModified&&(h.lastModified[u]&&ce.setRequestHeader("If-Modified-Since",h.lastModified[u]),h.etag[u]&&ce.setRequestHeader("If-None-Match",h.etag[u])),(M.data&&M.hasContent&&M.contentType!==!1||l.contentType)&&ce.setRequestHeader("Content-Type",M.contentType),ce.setRequestHeader("Accept",M.dataTypes[0]&&M.accepts[M.dataTypes[0]]?M.accepts[M.dataTypes[0]]+(M.dataTypes[0]!=="*"?", "+tr+"; q=0.01":""):M.accepts["*"]);for(A in M.headers)ce.setRequestHeader(A,M.headers[A]);if(M.beforeSend&&(M.beforeSend.call(O,ce,M)===!1||C))return ce.abort();if(ht="abort",oe.add(M.complete),ce.done(M.success),ce.fail(M.error),a=nr(as,M,l,ce),!a)Bt(-1,"No Transport");else{if(ce.readyState=1,x&&ee.trigger("ajaxSend",[ce,M]),C)return ce;M.async&&M.timeout>0&&(v=n.setTimeout(function(){ce.abort("timeout")},M.timeout));try{C=!1,a.send(Le,Bt)}catch(me){if(C)throw me;Bt(-1,me)}}function Bt(me,Te,Ci,hs){var pt,Si,ft,Lt,It,Qe=Te;C||(C=!0,v&&n.clearTimeout(v),a=void 0,f=hs||"",ce.readyState=me>0?4:0,pt=me>=200&&me<300||me===304,Ci&&(Lt=ga(M,ce,Ci)),!pt&&h.inArray("script",M.dataTypes)>-1&&h.inArray("json",M.dataTypes)<0&&(M.converters["text script"]=function(){}),Lt=va(M,Lt,ce,pt),pt?(M.ifModified&&(It=ce.getResponseHeader("Last-Modified"),It&&(h.lastModified[u]=It),It=ce.getResponseHeader("etag"),It&&(h.etag[u]=It)),me===204||M.type==="HEAD"?Qe="nocontent":me===304?Qe="notmodified":(Qe=Lt.state,Si=Lt.data,ft=Lt.error,pt=!ft)):(ft=Qe,(me||!Qe)&&(Qe="error",me<0&&(me=0))),ce.status=me,ce.statusText=(Te||Qe)+"",pt?he.resolveWith(O,[Si,Qe,ce]):he.rejectWith(O,[ce,Qe,ft]),ce.statusCode(Me),Me=void 0,x&&ee.trigger(pt?"ajaxSuccess":"ajaxError",[ce,M,pt?Si:ft]),oe.fireWith(O,[ce,Qe]),x&&(ee.trigger("ajaxComplete",[ce,M]),--h.active||h.event.trigger("ajaxStop")))}return ce},getJSON:function(s,l,a){return h.get(s,l,a,"json")},getScript:function(s,l){return h.get(s,void 0,l,"script")}}),h.each(["get","post"],function(s,l){h[l]=function(a,u,f,m){return $(u)&&(m=m||f,f=u,u=void 0),h.ajax(h.extend({url:a,type:l,dataType:m,data:u,success:f},h.isPlainObject(a)&&a))}}),h.ajaxPrefilter(function(s){var l;for(l in s.headers)l.toLowerCase()==="content-type"&&(s.contentType=s.headers[l]||"")}),h._evalUrl=function(s,l,a){return h.ajax({url:s,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(u){h.globalEval(u,l,a)}})},h.fn.extend({wrapAll:function(s){var l;return this[0]&&($(s)&&(s=s.call(this[0])),l=h(s,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&l.insertBefore(this[0]),l.map(function(){for(var a=this;a.firstElementChild;)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(s){return $(s)?this.each(function(l){h(this).wrapInner(s.call(this,l))}):this.each(function(){var l=h(this),a=l.contents();a.length?a.wrapAll(s):l.append(s)})},wrap:function(s){var l=$(s);return this.each(function(a){h(this).wrapAll(l?s.call(this,a):s)})},unwrap:function(s){return this.parent(s).not("body").each(function(){h(this).replaceWith(this.childNodes)}),this}}),h.expr.pseudos.hidden=function(s){return!h.expr.pseudos.visible(s)},h.expr.pseudos.visible=function(s){return!!(s.offsetWidth||s.offsetHeight||s.getClientRects().length)},h.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(s){}};var ya={0:200,1223:204},wi=h.ajaxSettings.xhr();L.cors=!!wi&&"withCredentials"in wi,L.ajax=wi=!!wi,h.ajaxTransport(function(s){var l,a;if(L.cors||wi&&!s.crossDomain)return{send:function(u,f){var m,v=s.xhr();if(v.open(s.type,s.url,s.async,s.username,s.password),s.xhrFields)for(m in s.xhrFields)v[m]=s.xhrFields[m];s.mimeType&&v.overrideMimeType&&v.overrideMimeType(s.mimeType),!s.crossDomain&&!u["X-Requested-With"]&&(u["X-Requested-With"]="XMLHttpRequest");for(m in u)v.setRequestHeader(m,u[m]);l=function(S){return function(){l&&(l=a=v.onload=v.onerror=v.onabort=v.ontimeout=v.onreadystatechange=null,S==="abort"?v.abort():S==="error"?typeof v.status!="number"?f(0,"error"):f(v.status,v.statusText):f(ya[v.status]||v.status,v.statusText,(v.responseType||"text")!=="text"||typeof v.responseText!="string"?{binary:v.response}:{text:v.responseText},v.getAllResponseHeaders()))}},v.onload=l(),a=v.onerror=v.ontimeout=l("error"),v.onabort!==void 0?v.onabort=a:v.onreadystatechange=function(){v.readyState===4&&n.setTimeout(function(){l&&a()})},l=l("abort");try{v.send(s.hasContent&&s.data||null)}catch(S){if(l)throw S}},abort:function(){l&&l()}}}),h.ajaxPrefilter(function(s){s.crossDomain&&(s.contents.script=!1)}),h.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(s){return h.globalEval(s),s}}}),h.ajaxPrefilter("script",function(s){s.cache===void 0&&(s.cache=!1),s.crossDomain&&(s.type="GET")}),h.ajaxTransport("script",function(s){if(s.crossDomain||s.scriptAttrs){var l,a;return{send:function(u,f){l=h("