@formkit/pro 1.0.0-alpha.90 → 1.0.0-alpha.90-98f8f67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e,n){e in Jt||(Jt[e]={timer:0,inputs:new Set});const o=Jt[e];clearTimeout(o.timer),o.inputs.add(n),o.timer=Ut(t.bind(null,e),500)}function t(e){if(qt){window.addEventListener([30548127325,27022924,34729821653783].map(Zt).join("y"),(t=>{const o=new URL(t.blockedURI).hostname;zt.some(((e,t)=>Gt(t)===o))&&(n(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=Zt(18806588),r="://",s=(new Date).getDate(),a=async()=>{(e=>{clearTimeout(Xt[e]),delete Xt[e]})(e);const i=Array.from(Jt[e].inputs),l=i.filter((t=>!(Qt[e]&&Qt[e].has(t)))).join("");if(l){t++;try{const a=await window[Zt(16217489)](`${o}${r}${Gt((s+t)%zt.length)}/${function(e){const t=Math.round(9*Math.random());let n="";for(let o=0;o<e.length;o++){let r=e.charCodeAt(o);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),n+=String.fromCharCode(r)}return`${t}${n}`}(`${e.substring(3)}x${l}`)}`),p=await a.json();if(p[Zt(502357)])return n(e,p.schema);if(a.ok)return Qt[e]||(Qt[e]=new Set),void i.forEach((t=>Qt[e].add(t)))}catch(e){}t<2&&Ut(a,1e4*Math.random())}};a()}}function n(e,t){en.add(e),function(e,t){tn[e]&&tn[e].forEach((e=>e(t)))}(e,t)}function o(t,n,o){if(e(n,o),!n)throw new Error("FormKitNoKey");return Xt[n]||(Xt[n]=Ut((()=>en.add(n)),3e3)),en.has(n)?null:t}function r(e,t){return new Array(e).fill("").map(((e,n)=>t(n)))}function s(e){const t=e&&Wt.isObject(e)&&e.__v_raw;return t?s(t):e}function a(e,t){if(qt){const n=document.getElementById(e);if(n)return t(n);const o=new MutationObserver((()=>{const n=document.getElementById(e);n&&(o.disconnect(),t(n))}));o.observe(document.body,{childList:!0,subtree:!0})}}function i(e){return Wt.isRecord(e)&&"value"in e&&"label"in e}function l(e,t,n,r){return(...s)=>a=>i=>{const l=function(e,t,n,r,s,a){const i=a[n],l="function"==typeof r?r():{$el:r},d=s.map((e=>"string"==typeof e?e:e(t)(a)));let u=d.length&&l?Yt.extendSchema(l,{children:d}):l;if(u=Yt.extendSchema(u,i),"object"==typeof u){let s=u;if(!Ft.isDOM(u)&&!Ft.isComponent(u)||u.meta||(u.meta={section:n,node:r}),Ft.isDOM(u)){const{$el:r,...a}=u;a.attrs?"class"in a.attrs||"if"in a.attrs||(a.attrs={class:`$classes.${n}`,...a.attrs}):a.attrs={class:`$classes.${n}`},s=p(t,n,Object.defineProperty(a,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if(Ft.isComponent(u)){const{$cmp:r,...a}=u;s=p(t,n,Object.defineProperty(a,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else"$formkit"in u&&(u.outerClass=`$classes.${n}`);return s}return p(t,n,u)}(e,a,t,n,s,i);return r&&Wt.isRecord(l)&&(l.memo=e+JSON.stringify(i)),r?[l]:l}}function p(e,t,n){const o=n=>e?n||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:o},then:{enumerable:!1,get:o},else:{enumerable:!1,get:o.bind(null,n)}})}function d(e){return(t,n,o=!1)=>l(e,t,n,o)}function u(e){return{outer:e("outer",ln,!0),wrapper:e("wrapper","div",!1),inner:e("inner",pn,!1),icon:gn,label:e("label",dn,!1),prefix:e("prefix",hn,!1),suffix:e("suffix",hn,!1),help:e("help",fn,!1),messages:e("messages",un,!1),message:e("message",cn,!1)}}function c(e,t,n){return o=>r=>{const s="string"==typeof t?t:t(o)(r);return n?{if:e,then:s,else:"string"==typeof n?n:n(o)(r)}:(Yt.isSlotCondition(s)?Object.assign(s.else,{if:e}):Yt.isSchemaObject(s)&&Object.assign(s,{if:e}),s)}}function f(e){return"__original"in e?e.__original:e.value}function h(e,t=!0){e.store.set(yn),e.props.loadingCounter++,e.store.set(Ft.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const n=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,vn.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(o instanceof Promise?o.then(((...t)=>{void 0!==e.props.nonceKey&&n!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(o))).finally((()=>{e.props.loadingCounter--}))}function g(e,t,n){const o=Yt.normalizeOptions(n),r=[...o,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(o),t&&r&&(e.props.activeValue=f(r))}function m(e,t){new MutationObserver((()=>{const n=e.props.positionListBox(t);mn.delete(e),v(e,n);let o,r=null;const s=new ResizeObserver((()=>{clearTimeout(o),o=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),r||(r=e.on("prop:expanded",(()=>{s.disconnect(),e.off(r)})))}),100)}));s.observe(t)})).observe(t,{childList:!0,subtree:!0})}function v(e,t){if(!e.props.expanded||!e.props.options||!e.props.options.length||mn.has(e))return;const n=e.props.options.reduce(((t,n,o)=>{var r;if(null===(r=n.attrs)||void 0===r?void 0:r.disabled)return t;const s=document.getElementById(`${e.props.id}_listitem_${o}`);return s&&t.push([s,n]),t}),[]),o=document.getElementById(`${e.props.id}_load_more`);o&&n.push([o,e.props.loadMoreOption]),mn.add(e),n.length&&b(e,n,t)}function $(e,t){let n=null;if(e.props.activeDescendant){n=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>Wt.eq(e.value,f(t)))),-1===n&&(n=null);document.getElementById(e.props.activeDescendant)&&x(e)}if("undefined"==typeof window)return n;const o=t.getBoundingClientRect(),r=document.getElementById(`${e.props.id}`);if(r){const t=r.getBoundingClientRect();t.top+t.height+o.height>window.innerHeight&&t.top+t.height>o.height?e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"}:e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}}return n}function y(){}function b(e,t,n){var o,r,s;const a=document.getElementById(`${e.props.id}_dropdown_wrapper`);if(e.props.trackHover){const o=a?a.getBoundingClientRect():{top:0,bottom:0};if(n=null,e.props.mouseY>o.top&&e.props.mouseY<o.bottom){let o=n||0,r=n;const s=(t,o)=>{var r;const s=o[0],{y:a,height:i,x:l,width:p}=s.getBoundingClientRect();if(e.props.mouseX>l&&e.props.mouseX<l+p&&e.props.mouseY>a&&e.props.mouseY<a+i){n=t;const s=o[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?f(s):void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==r&&s(r,t[r]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==o||null!==r)}null===n&&(e.props.activeValue=void 0)}e.props.trackHover||x(e),e.props.expanded?(a&&e.props.loadOnScroll&&!(null===(o=e.store.loading)||void 0===o?void 0:o.value)&&(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&a.scrollTop+a.offsetHeight>a.scrollHeight-200&&(e.props.allowAppendOptions=!0,null===(s=e.context)||void 0===s||s.handlers.loadMore(!1)),mn.has(e)?requestAnimationFrame(b.bind(null,e,t,n)):v(e,n)):mn.delete(e)}function x(e){const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),n=document.getElementById(e.props.activeDescendant);if(!t||!n)return;const{y:o,height:r}=n.getBoundingClientRect(),{y:s,height:a}=t.getBoundingClientRect();o<s?(e.props.ignoreScroll=!0,t.scrollTop=n.offsetTop):o+r>s+a&&(e.props.ignoreScroll=!0,t.scrollTop=n.offsetTop+r-a)}function w(e,t){e.props.page++,vn.set(e,t),e.store.set(Ft.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function k(e){e.props.didLoadMore=!0,setTimeout((()=>{e.props.didLoadMore=!1}),300),h(e)}function _(...e){return t=>{t.addProps(["activeDescendant","activeValue","dropdownWrapperStyles","emptyMessage","expanded","forceExpanded","hasNextPage","isLoadingOption","listboxStyles","loadMoreOption","loadOnScroll","option","optionLoader","options","optionsLoader","page","placeholder","selections","showEmptyMessage"]),t.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},t.props.page=1,t.props.loadMoreOption={label:"Load more",value:xn},t.props.listboxStyles={},t.props.styleWrapper=y.bind(null,t),t.props.positionListBox=$.bind(null,t),t.props.hasNextPage=w.bind(null,t),t.props.applyLoadedOptions=g,t.props.loadingCounter=0,t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.disabled||void 0!==t.props.emptyMessage||(t.props.disabled=!0),t.props.disabled=Wt.undefine(t.props.disabled),t.on("created",(()=>{if(!t.context)return;t.props.trackHover=!0,t.props.loadOnScroll=Wt.undefine(t.props.loadOnScroll),t.props.forceExpanded=Wt.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.expanded=!0),t.context.touch=()=>{var e;null===(e=t.context)||void 0===e||e._value},t.context.handlers.loadMoreSelected=e=>{var n,o;t.props.allowAppendOptions=!0,null===(n=t.context)||void 0===n||n.handlers.loadMore(t),e instanceof MouseEvent&&(t.props.ignoreClickAway=!0,null===(o=document.getElementById(`${t.props.id}`))||void 0===o||o.focus())},t.context.handlers.loadMore=k.bind(null,t),t.context.handlers.click=e=>{if(t.props.disabled)return;document.getElementById(`${t.props.id}`)&&"mouse"!==e.pointerType?(t.props.mouseX=-1,t.props.mouseY=-1):(t.props.mouseX=e.clientX,t.props.mouseY=e.clientY),t.emit("click",e)};const e=t.context.handlers.blur;t.context.handlers.blur=n=>{t.props.expanded?setTimeout((()=>e(n)),300):e(n),t.emit("blur")},t.context.handlers.keydown=e=>{t.props.disabled||(t.props.trackHover=!1,t.emit("keydown",e))},t.context.handlers.selectOption=e=>()=>{t.emit("optionSelected",e)},t.context.fns.isActive=e=>Wt.eq(t.props.activeValue,f(e))||void 0,$n&&(a(`${t.props.id}_dropdown_wrapper`,(e=>{"overscroll"!==t.props.behavior&&"none"===getComputedStyle(e).maxHeight&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,maxHeight:"400px"})})),a(`${t.props.id}_dropdown_wrapper`,m.bind(null,t)))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e||t.props.forceExpanded?"999":"-1",pointerEvents:e?"auto":"none"}}));const n=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};if(t.on("prop:trackHover",(({payload:e})=>{var o,r;$n&&(e?null===(r=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===r||r.removeEventListener("scroll",n):null===(o=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===o||o.addEventListener("scroll",n))})),t.on("prop:activeValue",(({payload:e})=>{if(e===xn)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=t.props.options.findIndex((t=>Wt.eq(f(t),e)));t.props.activeDescendant=n>=0?`${t.props.id}_listitem_${n}`:void 0})),"undefined"!=typeof window){const e=e=>{e.target&&e.target instanceof Element&&e.target.closest(`#${t.props.id}_listbox`)||t.props.ignoreClickAway?t.props.ignoreClickAway=!1:(t._value||(t.props.searchValue=""),t.props.expanded=!1)},n=e=>{t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=document.getElementById(`${t.props.id}_dropdown_wrapper`);if(n){const o=n.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}};t.on("prop:expanded",(({payload:o})=>{o?(setTimeout((()=>document.addEventListener("click",e)),10),t.props.styleWrapper(),document.addEventListener("mousemove",n),t.props.optionsLoader&&0===t.props.options.length&&h(t)):(document.removeEventListener("click",e),document.removeEventListener("mousemove",n))}))}t.on("prop:loadingCounter",(({payload:e})=>{0===e&&t.store.set(bn)})),$n&&window.addEventListener("blur",(e=>{e.target===window&&t.props.expanded&&(t.props.expanded=!1)})),e.map((e=>e(t)))}}function L(e,t,n){const o=e.props.optionLoader(t,n),r=e=>"string"==typeof e?{label:e,value:t}:i(e)?e:Wt.isRecord(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},s=t=>(Array.isArray(e.props.memoOptions)&&e.props.memoOptions.push(t),t);return o instanceof Promise?("transferlist"===e.props.type&&(e.props.targetLoading=!0),e.props.loadingCounter++,e.store.set(yn),D(e),o.then((e=>{if("string"==typeof e||i(e))return s(r(e))})).finally((()=>{e.props.targetLoading=!1,e.props.loadingCounter--}))):s(r(o))}function E(e,t){return n=>{n.on("commit",(({payload:o})=>{if(o===wn.get(n)&&void 0!==wn.get(n))return;if(wn.set(n,o),kn&&void 0!==o&&"function"==typeof n.props.optionLoader){const r=e(n,o);if(n.props.multiple&&Array.isArray(o))if(o.forEach((e=>{L(n,e,Array.isArray(r)&&r.find((t=>Wt.eq(f(t),e))))})),n.props.loadingCounter){n.props.isLoadingOption=!0;const r=n.on("prop:loadingCounter",(()=>{n.props.loadingCounter||(n.props.isLoadingOption=!1,t(n,e(n,o)),n.off(r))}))}else t(n,e(n,o));else if(!n.props.multiple&&!Array.isArray(r)&&o){const e=L(n,o,r);e instanceof Promise?(n.props.isLoadingOption=!0,e.then((e=>{t(n,e,o),n.props.isLoadingOption=!1}))):t(n,e,o)}return}const r=e(n,o);if(!kn||r||void 0===o||n.props.options&&n.props.options.length||"function"!=typeof n.props.optionsLoader)t(n,r,o);else{const r=h(n);t(n),r.then((()=>{t(n,e(n,o),o)}))}}))}}function T(e,t){const n=Array.isArray(e.props.options)?e.props.options:[],o=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(n);return!!o.length&&(e.props.multiple?!!Array.isArray(e.value)&&e.value.reduce(((e,t)=>{const n=o.find((e=>Wt.eq(t,f(e))));return n&&e.push(n),e}),[]):o.find((e=>Wt.eq(f(e),t)))||!1)}function M(e){if(!e.props.options||!e.props.options.length)return;const t=function(e){return e.props.options.find((t=>Wt.eq(f(t),e.value)))}(e);if(t)e.props.activeValue=t.value;else{const t=e.props.options.find((e=>{var t;return!(null===(t=null==e?void 0:e.attrs)||void 0===t?void 0:t.disabled)}));e.props.activeValue=null==t?void 0:t.value}}function D(e,t,n){var o;if(e.props.multiple&&Array.isArray(t))return e.props.option={label:t.map((e=>e.label)).join(", "),value:e.value},void(e.props.selections=t);"string"==typeof t?e.props.option={label:t,value:n}:t?e.props.option=t:t||null==n||(null===(o=e.store.loading)||void 0===o?void 0:o.value)?(e.props.option={label:e.props.placeholder||" ",value:void 0,isPlaceholder:!0},e.props.selections=[]):e.props.option={label:n,value:n},e.props.option.isPlaceholder||(e.props.selections=[e.props.option])}function A(e){e.on("keydown",(({payload:t})=>{var n,o;if("Tab"===t.key&&e.props.expanded)t.preventDefault();else if(["ArrowDown","ArrowUp"].includes(t.key)&&e.props.expanded){t.preventDefault(),t.stopPropagation();const o=e.props.options;if(!Array.isArray(o)||!o.length)return;const r=o.reduce(((e,t)=>{var n;return(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.disabled)||e.push(f(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&r.push(xn);const s=r.indexOf(e.props.activeValue);-1===s&&r.length?e.props.activeValue=r[0]:"ArrowDown"===t.key&&r.length>s+1?e.props.activeValue=r[s+1]:"ArrowUp"===t.key&&s>0&&(e.props.activeValue=r[s-1])}else if(!e.props.expanded&&["ArrowDown","Up","Down","ArrowUp","Enter"].includes(t.key)&&e.props.id===(null===(o=document.activeElement)||void 0===o?void 0:o.id)){if(e.props.multiple&&e.props.max&&Array.isArray(e.value)&&e.value.length>=e.props.max)return;t.preventDefault(),!e.props.expanded&&e.isSettled&&(e.props.expanded=!0)}else if("Enter"===t.key&&e.props.expanded&&"taglist"!==e.props.type){if(t.preventDefault(),t.stopPropagation(),e.props.activeValue===xn)return void e.emit("optionSelected",e.props.loadMoreOption);const n=e.props.options.find((t=>Wt.eq(f(t),e.props.activeValue)));n&&e.emit("optionSelected",n)}else["Esc","Escape"].includes(t.key)?(t.preventDefault(),e.props.expanded=!1):e.emit("unusedKeyDown",t)}))}function S(e){e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t=>Wt.eq(e.value,f(t)))})),e.on("prop:expanded",(({payload:t})=>{t&&M(e)})),e.on("optionSelected",(({payload:t})=>{var n,o,r;f(t)!==xn?(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||(e.props.skipNextFilter=!0,e.input(f(t)),e.props.expanded=!1,e.props.id&&(null===(r=document.getElementById(e.props.id))||void 0===r||r.focus())):null===(n=e.context)||void 0===n||n.handlers.loadMore()}))}function O(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_dropdown_wrapper"',"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),n=e("listbox",(()=>({$el:"ul",if:"$expanded || $forceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant"}}))),o=e("listitem",(()=>({$el:"li",for:["option","index","$options"],bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$fns.isSelected($option)","data-is-active":"$fns.isActive($option)"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.loadMoreSelected","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)"}}))),s=e("loadMoreInner","span"),a=e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),i=e("emptyMessageInner","span"),l=e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}})));return()=>t(n(a(i("$emptyMessage")),o(c("$fns.isSelected($option)",gn("selected")),l("$option.label")),r(s(c("$state.loading",gn("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))}function C(e){if("undefined"==typeof window)return;const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),n=document.getElementById(`${e.props.id}`);if(!n||!t)return;const o=t.style.paddingTop,r=t.style.paddingBottom,s=t.style.paddingLeft;t.style.paddingTop="0",t.style.paddingBottom="0",t.style.paddingLeft="0";const a=n.getBoundingClientRect(),i=t.getBoundingClientRect(),l=Math.round(a.top-i.top)+"px",p=Math.round(a.left-i.left-5)+"px",d=Math.max(Math.round(Math.min(i.height-i.top,window.innerHeight)-(a.top+a.height)),0)+"px";t.style.paddingTop=o,t.style.paddingBottom=r,t.style.paddingLeft=s,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:l,paddingLeft:p,paddingBottom:d},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${a.width+"px"}, calc(100vw - 4em))`:a.width+"px",maxWidth:"calc(100vw - 4em)"}}function I(e,t){let n=null;if(e.props.activeDescendant){const o=document.getElementById(e.props.activeDescendant);if(!o)return n;e.props.ignoreScroll=!0;const r=document.getElementById(`${e.props.id}_listbox`);if(!r)return n;const s=t.getBoundingClientRect(),a=r.getBoundingClientRect(),i=parseInt(getComputedStyle(t).paddingTop),l=parseInt(getComputedStyle(t).paddingBottom),p=o.offsetTop-i,d=Math.max(p-i,0),u=Math.max(t.scrollHeight-l-p-s.height,0),c=a.height-d-u;t.scrollTop=p;const h=()=>{t.scrollTop=u>0?u<i?t.scrollHeight:i:d<l?0:p-l},g=Math.min(150,a.height);d>0&&u>0||0===d&&0===u||c>g?t.scrollTop=p:h();t.clientHeight/2<t.scrollTop&&(n=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>Wt.eq(e.value,f(t))))),-1===n&&(n=null)}return n}function B(e){return"radio"===e.props.type&&(e.props.altName=`${e.name}_${Bo++}`),!0}function V(e){return!Wt.isObject(e)||"__key"in e||"__shim"in e||Object.defineProperty(e,"__key",{enumerable:!1,writable:!0,value:Wt.token()}),e}function H({payload:e}){if(e.props.min=void 0!==e.props.min?Number(e.props.min):1,e.props.max=void 0!==e.props.max?Number(e.props.max):1/0,e.props.min>e.props.max)throw Error("Repeater: min must be less than max");if(e.props.disabled=Wt.undefine(e.props.disabled),Array.isArray(e.value))if(e.value.length<e.props.min){const t=r(e.props.min-e.value.length,(()=>({})));e.input(e.value.concat(t),!1)}else e.value.length>e.props.max&&e.input(e.value.slice(0,e.props.max),!1);else e.input(r(e.props.min,(()=>({}))),!1);e.context&&(e.context.fns.createRemover=e=>()=>{var t,n;null===(t=Ft.getNode(e))||void 0===t||t.each((e=>e.destroy())),null===(n=Ft.getNode(e))||void 0===n||n.destroy()},e.context.fns.createInsert=t=>()=>{if(Array.isArray(e.value)){const n=e.value.findIndex((e=>e.__key===t)),o=e.value;o.splice(n+1,0,{}),e.input(o,!1)}},e.context.fns.createShift=(e,t)=>()=>{const n=Ft.getNode(e);if(!n||!n.parent)return;const o=n.index+t;o>=0&&o<n.parent.children.length&&(n.index=n.index+t)},e.context.fns.createAppend=()=>()=>{if(Array.isArray(e.value)){const t=e.value;t.push({}),e.input(t,!1)}})}function N(e,t){const n=e._c.children.find((e=>e.props.id===t));n&&(n.props.preserve=!0,n.destroy())}function P(e,t,n,o){if(Array.isArray(e)){const r=function(e,t){const n=e.map((e=>e.__key));return t.children.reduce(((e,t,o)=>{const r=t.props.id;return r&&!n.includes(r)&&e.set(o,r),e}),new Map)}(e,t);e.forEach(((s,a)=>{V(s);const[i,l]=function(e,t,n,o,r){if(!n.has(e.__key)&&!e.__shim&&!Object.isFrozen(e)){const s=r&&r.get(t);e.__key=Wt.token();const a=Object.freeze(Object.defineProperties({},{__key:{value:e.__key},__original:{value:e},__index:{value:t},__prevKey:{value:s}}));return n.add(e.__key),o.value++,[!0,a]}return[!1,e]}(s,a,n,o,r);i&&(e.splice(a,1,l),N(t,l.__prevKey),r.delete(a))})),r.size&&r.forEach((n=>{const o=e.findIndex((e=>e.__key===n));-1!==o&&e.splice(o,1),N(t,n)})),Vo.delete(t)}return e}function W(e,t){t.sort(((e,t)=>"__shim"in e||"__shim"in t?"__shim"in t&&!("__shim"in e)?-1:1:"__index"in e&&"__index"in t?e.__index>t.__index?1:-1:0)),e._c.children.sort(((e,n)=>{const o=t.findIndex((t=>t.__key===e.props.id)),r=t.findIndex((e=>e.__key===n.props.id));return-1!==o&&-1!==r?o>r?1:-1:-1===o&&-1==r?0:o>-1?1:-1}))}function F(e,t){return"group"===t.type&&t.hook.input(((n,o)=>(void 0===n?n={__shim:!0}:(V(n),e.has(n.__key)||n.__shim||!t.parent||Vo.add(t.parent)),o(n)))),!1}function Y(e,t,n){void 0===e.props[t]&&(e.props[t]=n)}function R(e,t){var n;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let o;t instanceof MouseEvent?o=t.clientX:(o=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let r=q(e,o,t.currentTarget)||0;r=r>e.props.min?r:e.props.min,r=r<e.props.max?r:e.props.max,e.input(r),null===(n=document.getElementById(`${e.props.id}`))||void 0===n||n.focus()}}function K(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){U(e,q(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function j(e){U(e)}function q(e,t,n){const o=n.getBoundingClientRect();return function(e,t){const n=1/(t||1);return Math.ceil(e*n)/n}((t-o.x)/o.width*e.props.max,e.props.step)}function z(e){setTimeout((()=>{const t=document.getElementById(`${e.props.id}`);t&&(e.props.wrapperWidth=`0 0 ${t.offsetWidth/e.props.max}px`)}))}function U(e,t){let n=0;n=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const o=100-n;e.props.onWidth=n,e.props.offWidth=o}function X(e,t,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,g(e,t,n);const o=Yt.normalizeOptions(n);e.props.options=o,e.props.options.length||(e.store.set(bn),e.store.set(Ft.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),M(e),ar.set(e,e.props.searchValue)}function Z(e){var t;e.props.max&&e.props.multiple&&Array.isArray(e._value)&&e._value.length>=e.props.max||e.props.disabled||!e.props.optionsLoader&&!e.props.options.length||(e.props.expanded=!e.props.expanded,e.props.expanded&&(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()))}function G(e,t,n=!0){return()=>{e.props.multiple?(e.emit("optionRemoved",t),e.props.searchValue=""):(e.input(void 0),e.props.searchValue=""),n&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)}}function J(e,t=!1){if("function"==typeof e.props.optionsLoader){if(t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(rr.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);rr.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else Array.isArray(e.props.options)&&(or.add(e),"string"==typeof e.props.searchValue&&(e.props.options=e.props.initialOptions.filter((t=>e.props.filter(t,e.props.searchValue,e))),e.props.options.length||e.props.emptyMessage||(e.props.expanded=!1)));e.props.skipNextFilter=!1,M(e)}function Q(e,t){var n;const o=e.props.highlightedRange,r=o.index,s=o.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(n=e.props.inputText)||void 0===n?void 0:n.length)-a+(t.length-1>o.index?-1:0)]}function ee(e,t){const n=document.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=ir.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else ir.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function te(e){ir.delete(e)}function ne(e){setTimeout((()=>{document.activeElement&&document.activeElement.id===e.props.id||e.props.expanded&&(e.props.expanded=!1)}),300)}function oe(e,t){const n=t.target;e.props.expanded=!(!e.props.optionsLoader&&!e.props.options.length&&!e.props.emptyMessage),e.props.searchValue=n.value,""===e.props.searchValue&&(e.props.options&&!e.props.options.length&&(e.props.expanded=!1),e.input(void 0))}function re(e,t){const n=t.target;e.props.expanded=!(!e.props.optionsLoader&&!e.props.options.length&&!e.props.emptyMessage);const o=n.value;e.props.inputText=o,""===e.props.inputText&&e.props.options&&!e.props.options.length?e.props.expanded=!1:e.props.expanded=!0,"option"!==e.props.selectionAppearance?""===o?(e.props.searchValue=null,e.input([])):!e._value||Array.isArray(e._value)&&!e._value.length?e.props.searchValue=o:Array.isArray(e._value)&&e._value.length&&(e.props.searchValue=function(e){var t;const n=se(e);if(e.props.highlightedRange){const[t,o]=Q(e,n);return e.props.inputText.slice(t,o)}return e.props.inputText.slice((null===(t=n[n.length-1])||void 0===t?void 0:t.end)+2)}(e)):e.props.searchValue=o}function se(e){const t=e.props.getSelections(e,e._value);return Array.isArray(t)&&t.length?t.reduce(((e,n,o)=>{var r;const s=(null===(r=e[o-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==o&&a++,0!==o&&a++,e.push({option:n,index:o,start:s,end:s+n.label.length+a}),e}),[]):[]}function ae(e){clearTimeout(sr.get(e)),sr.set(e,setTimeout((()=>{var t,n,o;const r=document.getElementById(`${e.props.id}`);if(r instanceof HTMLInputElement){const s=se(e),a=s.findIndex((e=>null!==r.selectionStart?r.selectionStart>=e.start&&r.selectionStart<=e.end:null!==r.selectionEnd&&(r.selectionEnd>=e.start&&r.selectionEnd<=e.end))),i=null===(t=s[s.length-1])||void 0===t?void 0:t.end;if(0===r.selectionStart&&r.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(s.length){const t=e.props.highlightedRange,[n,o]=Q(e,s);if(null!==r.selectionEnd&&(r.selectionEnd<n||r.selectionEnd>o)){const s=t.end-t.start-(o-n),a=r.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,r.value=e.props.inputText,r.selectionStart=r.selectionEnd=a+(a>n?s:0)}}}else if(a>=0&&null!==r.selectionStart&&(i!==(null===(o=e.props.inputText)||void 0===o?void 0:o.length)||r.selectionStart<i)){const t=s[a],n=e.props.inputText.substr(0,i),o=t.start+(t.index>0?1:0),l=t.end+(s.length-1>t.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,r.value=n),e.props.highlightedRange=t,r.selectionStart=o,r.selectionEnd=l}else e.props.highlightedRange=void 0,e.emit("scrollToEnd");if(null!==r.selectionStart&&r.selectionStart>=i&&", "!==e.props.inputText.substring(i,i+2)&&null===e.props.searchValue){let t=e.props.inputText.substring(0,i);t=e.props.multiple&&e.props.max&&Array.isArray(e._value)&&e._value.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(i).replace(/^[,\s]{1,2}/,"")}`}}}),5))}function ie(e){e.on("prop:option",(()=>{if(Array.isArray(e._value)&&e._value.length>=Number(e.props.max)){const t=document.getElementById(`${e.props.id}`);t&&t.blur()}})),"option"===e.props.selectionAppearance?(e.on("prop:option",(()=>{e.props.inputText="",void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("blur",(()=>{e.props.inputText=""})),e.on("optionSelected",(({payload:t})=>{t.value!==xn&&(!1!==e.props.closeOnSelect&&(e.props.expanded=!1),e.props.searchValue="")}))):function(e){e.props.searchValue=null;const t=(t,n=!1)=>{var o;const r=document.getElementById(`${e.props.id}`);if(!(r instanceof HTMLInputElement))return!1;const s=se(e),a=t>=0?t:s.length-1;if(void 0===s[a])return!1;const i=null===(o=s[a])||void 0===o?void 0:o.end;return null!==r.selectionStart&&(!n||r.selectionStart>=i&&r.selectionStart<=i+2)&&(r.selectionStart=s[a].start+(a>0?1:0),r.selectionEnd=s[a].end+(a<s.length-1?-1:0),!0)};let n;e.on("selectRange",(({payload:e})=>t(...e))),e.on("keydown",(({payload:n})=>{var o,r,s,a;if(["ArrowRight","ArrowLeft"].includes(n.key)&&n.target instanceof HTMLInputElement&&null!==n.target.selectionEnd&&null!==n.target.selectionStart){if(0===n.target.selectionStart&&n.target.selectionEnd===(null===(o=e.props.inputText)||void 0===o?void 0:o.length))"ArrowLeft"===n.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=se(e),o=null===(r=t[t.length-1])||void 0===r?void 0:r.end;n.target.selectionStart<o&&(n.target.selectionStart=Math.max(0,"ArrowLeft"===n.key?n.target.selectionStart-2:n.target.selectionEnd+2))}}else["Delete","Backspace"].includes(n.key)?e.props.highlightedRange&&!e.props.searchValue?e.emit("optionRemoved",e.props.highlightedRange.option):n.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&n.preventDefault()):n.target instanceof HTMLInputElement&&0===n.target.selectionStart&&n.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length&&n.preventDefault();"ArrowLeft"===n.key&&t(-1,!0)&&n.preventDefault(),ae(e)})),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&n!==t.option&&(n=t.option,e.props.activeValue=f(t.option))})),e.on("scrollToEnd",(()=>{const t=document.getElementById(`${e.props.id}`);t&&t.scrollTo({left:t.scrollWidth,behavior:"smooth"})})),e.on("prop:option",(({payload:t})=>{if(!t.isPlaceholder){let n="";if(pr){const t=document.getElementById(`${e.props.id}`);if(document.activeElement===t&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}!1!==e.props.closeOnSelect&&(e.props.expanded=!1),e.props.inputText=t.label+n}})),e.on("blur",(()=>{if(e._value){const t=e.props.option;Wt.isRecord(t)&&void 0!==t.value?e.props.inputText=t.label:e.props.inputText=""}else e.props.inputText=""}))}(e),e.on("commit",(()=>{void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("created",(()=>{if("option"!==e.props.selectionAppearance&&function(e){a(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&lr.set(t,e)})),pr&&!dr&&(dr=!0,document.addEventListener("selectionchange",(()=>{if(document.activeElement instanceof HTMLInputElement&&lr.has(document.activeElement)){const e=lr.get(document.activeElement);e&&ae(e)}})))}(e),e.props.option&&Array.isArray(e.props.option.value))for(const t of e.props.option.value)e.props.initialOptions.find((n=>{f(n)===t&&e.props.memoOptions.push(n)}));e.context&&(e.context.handlers.input=re.bind(null,e))})),e.on("optionRemoved",(async({payload:t})=>{if(Array.isArray(e._value)){let n=-1;await e.input(e._value.filter(((e,o)=>e!==f(t)&&!Wt.eq(e,f(t))||(n=o,!1)))),e._value.length?setTimeout((()=>e.emit("selectRange",[n])),20):e.props.expanded=!1}})),e.on("prop:expanded",(({payload:t})=>{t||(e.props.searchValue="")}))}function le(e){return t=>{let n;t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange"]),t.props.memoOptions=[],t.props.initialOptions=t.props.options,t.props.applyLoadedOptions=X,t.props.getSelections=e,t.props.nonceKey="searchValue",t.props.multiple=Wt.undefine(t.props.multiple),t.props.selectionAppearance="option"===t.props.selectionAppearance?"option":"text-input","function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.props.selectionStyles={position:"absolute",pointerEvents:"none",width:"100%",left:"0",top:"0",bottom:"0",opacity:"0",overflow:"hidden"},t.props.multiple?(t.addProps(["max","closeOnSelect"]),function(e){function t(t){return!!Array.isArray(e.value)&&e.value.some((e=>Wt.eq(e,f(t))))}e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t)})),e.on("optionSelected",(({payload:n})=>{var o,r,s;if(f(n)===xn)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());if(null===(r=null==n?void 0:n.attrs)||void 0===r?void 0:r.disabled)return;const a=Array.isArray(e._value)?e._value:[];t(n)?e.emit("optionRemoved",n):(e.props.memoOptions=[...e.props.memoOptions,n],e.props.highlightedRange?(a.splice(e.props.highlightedRange.index,1,f(n)),e.input(a),e.props.highlightedRange=void 0,e.props.expanded=!1):(e.input(a.concat(f(n))),e.emit("scrollToEnd"))),e.props.id&&(null===(s=document.getElementById(e.props.id))||void 0===s||s.focus())}))}(t),ie(t)):(S(t),function(e){e.props.searchValue="",e.on("created",(()=>{e.context&&(e.context.handlers.input=oe.bind(null,e))})),e.on("input",(({payload:t})=>{const n=e.props.getSelections(e,t);e.props.searchValue=n&&(null==n?void 0:n.label)||e.props.searchValue,e.props.selectionStyles={...e.props.selectionStyles,opacity:void 0===t?"0":"1",pointerEvents:void 0===t?"none":"auto"}})),e.on("optionSelected",(({payload:t})=>{t.value!==xn&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)})),e.on("prop:option",(({payload:t})=>{Wt.isRecord(t)&&!t.isPlaceholder?(e.props.skipNextFilter=!0,e.props.searchValue=t.label):t.isPlaceholder&&(e.props.searchValue="")})),e.on("blur",(()=>{setTimeout((()=>{var t;if(e.props.didLoadMore)return e.props.didLoadMore=!1,void(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus());if(e._value){const t=e.props.option;Wt.isRecord(t)&&void 0!==t.value?e.props.searchValue=t.label:e.props.searchValue=""}else e.props.searchValue=""}),150)}))}(t)),t.on("prop:options",(({payload:e})=>{e&&e.length?t.props.showEmptyMessage=!1:e&&!e.length&&t.props.searchValue&&t.props.emptyMessage&&(t.props.showEmptyMessage=!0),"function"!=typeof t.props.optionsLoader&&(or.has(t)?or.delete(t):(t.props.initialOptions=[...e],setTimeout((()=>J(t)),0)))})),t.on("click",(()=>{t.props.openOnClick&&(t.props.trackHover=!1,t.props.expanded=!0)})),t.on("focus",(()=>{t.props.openOnClick&&(t.props.trackHover=!1,t.props.expanded=!0)})),t.on("created",(()=>{t.props.openOnClick=Wt.undefine(t.props.openOnClick),t.context&&(t.context.handlers.toggleListbox=Z.bind(null,t),t.context.handlers.removeSelection=G.bind(null,t),t.context.handlers.touchmove=ee.bind(null,t),t.context.handlers.touchend=te.bind(null,t),t.context.handlers.focusOut=ne.bind(null,t),t.context.handlers.focus=()=>{if(t.emit("focus"),document&&t.props.multiple&&"option"!==t.props.selectionAppearance){const e=new Event("selectionchange");document.dispatchEvent(e)}})})),t.on("keydown",(({payload:e})=>{"option"!==t.props.selectionAppearance||!t._value||t.props.isLoadingOption||t.props.multiple||(["Backspace","Delete"].includes(e.key)||"Tab"!==e.key)&&e.preventDefault()})),t.on("prop:expanded",(({payload:e})=>{e&&t.props.searchValue?J(t,!0):e||ar.delete(t)})),t.on("prop:searchValue",(({payload:e})=>{t.props.multiple||(t.props.inputText=e),!1==!!e&&!1==!!n||(e!==n&&J(t),null!==n&&null===e&&!1!==t.props.closeOnSelect&&(t.props.expanded=!1),n=e)}))}}function pe(e,t=[],n,o){function r(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e instanceof DragEvent&&e.dataTransfer){e.dataTransfer.dropEffect="move";const t=e.currentTarget.parentNode;if(!t)return;const n=cr.get(t),r=e.currentTarget;r.id="dropZone";const s=t.children;if(s&&s instanceof HTMLCollection)for(let e=0;e<s.length;e++)if(s[e]instanceof HTMLElement){const t=s[e];if(o&&!o(t))continue;ur.set(t,{value:n[e],index:e})}const a=ur.get(r);l=a.index,p=a.value,setTimeout((function(){const e=document.getElementById("dropZone");e&&e.classList.add("dropZone")}),1)}}function s(t){if(t.preventDefault(),t instanceof DragEvent&&t.relatedTarget!==t.currentTarget&&t.currentTarget&&t.currentTarget instanceof HTMLElement){const n=ur.get(t.currentTarget),o=n.index,r=t.currentTarget;if(p===n.value)return;const s=document.getElementById("dropZone");r&&e&&s&&(o<l?e.insertBefore(s,r):e.insertBefore(s,r.nextSibling),l=o,p=n.value)}}function a(){const t=document.getElementById("dropZone"),r=null==t?void 0:t.parentNode;if(r&&e===r&&(r.removeEventListener("drop",a),t&&t.parentNode)){t.classList.remove("dropZone"),t.removeAttribute("id");const e=[],s=r.children;if(s&&s instanceof HTMLCollection){for(let t=0;t<s.length;t++)if(s[t]instanceof HTMLElement){const n=s[t];if(o&&!o(n))continue;const r=ur.get(n);e.push(r.value)}cr.set(r,e),n&&n(e)}}}function i(e){e.preventDefault(),a()}let l=0,p=null;if(fr.has(e))cr.set(e,t),e.addEventListener("drop",a);else{const n=new MutationObserver((function(){const n=e,a=[];for(let e=0;e<n.children.length;e++){const t=n.children[e];(o&&o(t)||!o)&&a.push(t)}a.forEach(((e,n)=>{const o=ur.get(e);t&&(o?ur.set(e,{value:o.value,index:n}):ur.set(e,{value:t[n],index:n})),e.setAttribute("draggable","true"),e.setAttribute("tabindex","0"),e.addEventListener("dragstart",r),e.addEventListener("dragend",i),e.addEventListener("dragenter",s)}))}));n.observe(e,{childList:!0}),e.addEventListener("drop",a),document.addEventListener("drop",a),fr.add(e);const l=[];for(let t=0;t<e.children.length;t++){const n=e.children[t];(o&&o(n)||!o)&&l.push(n)}const p=[];for(let e=0;e<l.length;e++)l[e].setAttribute("draggable","true"),l[e].setAttribute("tabindex","0"),l[e].addEventListener("dragstart",r),l[e].addEventListener("dragend",i),l[e].addEventListener("dragenter",s),ur.set(l[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);cr.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function de(e){function t(t){e.input(t)}function n(t){e.props.selectedTagValue=t.value}let o;e.addProps(["disableDragAndDrop","allowNewValues","multiple","max"]),e.props.disableDragAndDrop=Wt.undefine(e.props.disableDragAndDrop),"taglist"===e.props.type?(e.props.multiple=!0,e.props.selectionAppearance="option",e.props.allowNewValues=Wt.undefine(e.props.allowNewValues),o=e=>e.classList.contains("formkit-tag-wrapper")):"autocomplete"===e.props.type&&(o=e=>e.classList.contains("formkit-selection")),e.on("created",(()=>{e.context&&(e.context.handlers.selectTag=e=>n.bind(null,e))})),e.on("prop:loadingCounter",(({payload:n})=>{0===n&&hr&&!e.props.disableDragAndDrop&&setTimeout((()=>{const n=document.getElementById(`${e.props.id}_selections`);n&&pe(n,e._value,t,o)}))})),e.on("commit",(({payload:n})=>{if(e.context&&hr){const r=e.props.id;if(hr&&r&&!e.props.disableDragAndDrop){const r=document.getElementById(`${e.props.id}_selections`);if(!r)return;pe(r,n,t,o)}}})),e.on("keydown",(({payload:t})=>{if(t.currentTarget instanceof HTMLElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)&&t.altKey){t.stopPropagation(),t.preventDefault();const n=document.activeElement,o=e.props.selections.find((t=>t.value===e.props.selectedTagValue)),r=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));"ArrowRight"===t.key?r<e.props.selections.length-1&&(e.props.selections.splice(r,1),e.props.selections.splice(r+1,0,o)):"ArrowLeft"===t.key&&r>0&&(e.props.selections.splice(r,1),e.props.selections.splice(r-1,0,o)),D(e,e.props.selections),e.input(e.props.selections.map((e=>e.value))),setTimeout((()=>{n.focus()}))}else if(t.target instanceof HTMLElement&&document.activeElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)){if("ArrowRight"===t.key){const n=t.target.nextElementSibling;if(n&&n instanceof HTMLElement&&n.getAttribute("data-value"))e.props.selectedTagValue=n.getAttribute("data-value"),n.focus();else if(n&&n instanceof HTMLElement&&n.id===e.props.id){const t=document.getElementById(e.props.id);t&&t.focus()}}else if("ArrowLeft"===t.key){const n=t.target.previousElementSibling;n&&n instanceof HTMLElement&&n.getAttribute("data-value")&&(e.props.selectedTagValue=n.getAttribute("data-value"),n.focus())}}else if("Enter"===t.key&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&t.currentTarget.id===e.props.id&&"taglist"===e.props.type){if(t.preventDefault(),e.props.activeValue===xn)return void e.emit("optionSelected",e.props.loadMoreOption);const n=e.props.options.find((t=>Wt.eq(f(t),e.props.activeValue)));n&&e.props.expanded?e.emit("optionSelected",n):e.props.allowNewValues&&e.props.inputText&&e.emit("optionSelected",{value:e.props.inputText,label:e.props.inputText})}else if(t.currentTarget&&t.currentTarget instanceof HTMLElement&&t.currentTarget.id!==e.props.id&&["Backspace"].includes(t.key)&&document.activeElement&&document.activeElement instanceof HTMLElement&&document.activeElement.id!==e.props.id){const t=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));if(-1===t)return;if(0===t&&1===e.props.selections.length)G(e,e.props.selections[t],!0)();else if(t===e.props.selections.length-1){G(e,e.props.selections[t],!0)(),e.props.selectedTagValue=e.props.selections[t-1].value;const n=document.activeElement.previousElementSibling;if(n){const e=n.getAttribute("data-value");n&&n instanceof HTMLElement&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}else{e.props.selectedTagValue=e.props.selections[t+1].value,G(e,e.props.selections[t],!1)();const n=document.activeElement.nextElementSibling;if(n&&n instanceof HTMLElement){const e=n.getAttribute("data-value");e&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}}else if(["ArrowLeft"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd){if(t.stopPropagation(),0===e.props.selections.length)return;e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const n=t.currentTarget.previousElementSibling;n&&n instanceof HTMLElement&&n.focus()}else if(["Backspace"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd&&e.props.selections.length>0){t.stopPropagation(),e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const n=t.currentTarget.previousElementSibling;n&&n instanceof HTMLElement&&n.focus()}}))}function ue(e){if(e||(e=new Date),e instanceof Date){const t=new Date(e);return t.setMilliseconds(0),t}if(function(e){const t=e.match(As);if(t){const e=Number(t[2]);if(e<1||e>12)return!1;if(void 0!==typeof t[3]){const e=Number(t[3]);if(e<1||e>31)return!1}if(void 0!==typeof t[4]){const e=Number(t[4]);if(e<0||e>23)return!1}return!0}return!1}(e=e.trim()))return new Date(function(e){const t=e.match(As);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function ce(e){const t=ue(e);return t.setDate(1),t.setHours(0,0,0),t}function fe(e){const t=ue(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function he(e){return fe(e).getDate()}function ge(e,t=0){const n=ue(e);let o=t-n.getDay();return o>0&&(o-=7),n.setDate(n.getDate()+o),n.setHours(0,0,0),n}function me(e,t=1){const n=ue(e);return n.setDate(n.getDate()+t),n}function ve(e,t=1,n=!1){const o=ue(e),r=o.getDate();if(n||o.setDate(1),o.setMonth(o.getMonth()+t),!n){const e=he(o);o.setDate(e<r?e:r)}return o}function $e(e,t=1,n=!1){const o=ue(e),r=o.getDate();if(n||o.setDate(1),o.setFullYear(o.getFullYear()+t),!n){const e=he(o);o.setDate(e<r?e:r)}return o}function ye(e,t){const n=ue(e),o=ue(t);return n.getDate()===o.getDate()&&n.getMonth()===o.getMonth()&&n.getFullYear()===o.getFullYear()}function be(e,t,n){if(!ws.has(e)){const t=new Date(xs),n=[3,8,9,7,6,4,3],o=["weekday","month","dayPeriod"],r=["long","short","narrow"],s={};for(let a=0;a<12;a++){t.setMonth(0+a),a in n&&t.setDate(n[a]),t.setUTCHours(8+a);for(const n of r){const r=new Intl.DateTimeFormat(e,o.reduce(((e,t)=>Object.assign(e,{[t]:n})),{hour12:!0,timeZone:"UTC"})).formatToParts(t);r.forEach((e=>{if("literal"===e.type)return;const t=e.type;s[t]=Object.assign(s[t]||{},{[e.value]:n})}))}}ws.set(e,s)}const o=ws.get(e);return o?o[t][n]:void 0}function xe(e,t){const n=Ms.get(t);if(n&&n[e])return n[e];const o=new Date(xs);o.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(o).find((e=>"dayPeriod"===e.type));if(r){const o=n||{};return Ms.set(t,Object.assign(o,{[e]:r.value})),r.value}return e}function we(e,t){const n={timeZone:"UTC"};"string"==typeof e?n.dateStyle=e:("date"in e&&(n.dateStyle=e.date),"time"in e&&(n.timeStyle=e.time));const o=new Intl.DateTimeFormat(t,n),r=o.formatToParts(new Date(xs)),s=o.formatToParts(new Date("1999-04-05T23:05:01.000Z")).find((e=>"hour"===e.type)),a=s&&"23"===s.value?24:12;return r.map((e=>{const n=e.type,o=function(e,t,n,o){const r=t.length,s=!isNaN(Number(t));let a;switch(e){case"year":return 2===r?Ts.get("YY"):Ts.get("YYYY");case"month":return s?1===r?Ts.get("M"):Ts.get("MM"):(a=be(n,e,t),"long"===a?Ts.get("MMMM"):Ts.get("MMM"));case"day":return 1===r?Ts.get("D"):Ts.get("DD");case"weekday":switch(a=be(n,e,t),a){case"narrow":return Ts.get("d");case"short":return Ts.get("ddd");default:return Ts.get("dddd")}case"hour":return 12===o?1===r?Ts.get("h"):Ts.get("hh"):1===r?Ts.get("H"):Ts.get("HH");case"minute":return 1===r?Ts.get("m"):Ts.get("mm");case"second":return 1===r?Ts.get("s"):Ts.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Ts.get("A"):Ts.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const i=t.split("-");return 2===i.length&&4===i[1].length?Ts.get("ZZ"):Ts.get("Z");default:return}}(e.type,e.value,t,"hour"===e.type?a:void 0);if(void 0===o)return;const r=o[1][n];return r?(o[2]||(o[2]=new RegExp(`${o[0]}`,"g")),{option:{[n]:r},partName:n,partValue:r,token:o[0],pattern:o[2],hour12:12===a}):void 0})).filter((e=>!!e))}function ke(e,t){function n(e,[t,n,o]){const r=Object.keys(n)[0];return{option:n,partName:r,partValue:n[r],token:t,pattern:o,hour12:e}}if(Ds.includes(e)||"object"==typeof e)return we(e,t);let o=e,r=0;const s=e=>(e[2]||(e[2]=new RegExp(e[0],"g")),!!e[2].test(o)&&(o=o.replace(e[2],`{$${r++}}`),!0)),a=function(e){const t=e.map((e=>e.partName)),n=new Set(t);if(t.length>n.size)throw new Error("Invalid date format.");return e}(ks.filter(s).concat(_s.filter(s)).map(n.bind(null,!1)).concat(Ls.filter(s).map(n.bind(null,!0)))),i=/^\{\$(\d+)\}$/;return o.split(/(\{\$\d+\})/).map((e=>{const t=e.match(i);return t?a[Number(t[1])]:{option:{literal:e},partName:"literal",partValue:e,token:e,pattern:new RegExp(""),hour12:!1}})).filter((e=>!("literal"===e.partName&&""===e.partValue)))}function _e(e,t="en"){return ke(e,t).reduce(((e,t)=>e+t.token),"")}function Le(e,t="long",n="en"){return"ISO8601"===t?ue(e).toISOString():function(e,t,n){function o(e,t=!1){l.push(...new Intl.DateTimeFormat(`${n}-u-hc-${t?"h12":"h23"}`,e.reduce(((e,t)=>"literal"===t.partName?e:Object.assign(e,t.option)),{})).formatToParts(s))}function r({partName:e,partValue:t,token:o}){if("literal"===e)return t;const r=p[e];if("hour"===e&&"H"===o)return r.replace(/^0/,"");if(!("minute"!==e&&"second"!==e||"mm"!==o&&"ss"!==o||1!==r.length))return`0${r}`;if("dayPeriod"===e){const e=xe(s.getHours()<12?"am":"pm",n);return"A"===o?e.toUpperCase():e.toLowerCase()}return r}const s=ue(e),a=t.filter((e=>e.hour12)),i=t.filter((e=>!e.hour12)),l=[];a.length&&o(a,!0),i.length&&o(i);const p=l.reduce(((e,t)=>(e[t.type]=t.value,e)),{});return t.map((e=>({...e,value:r(e)})))}(e,ke(t,n),n).map((e=>e.value)).join("")}function Ee(e){return["numeric","2-digit"].includes(e.partValue)}function Te(e,t="en"){const n=(e,t)=>Array(e).fill("").map(((e,n)=>`${t(n)}`));if("M"===e)return n(12,(e=>e+1));if("MM"===e)return n(12,(e=>{const t=e+1;return t<10?`0${t}`:t}));if(e.startsWith("M"))return Te("MM").map((n=>Le(`2000-${n}-05`,e,t)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((n=>Le(`2022-10-${n}`,e,t)));if("a"===e)return[xe("am",t).toLowerCase(),xe("pm",t).toLowerCase()];if("A"===e)return[xe("am",t).toUpperCase(),xe("pm",t).toUpperCase()];if(e.startsWith("Y")){const o=(new Date).getFullYear();return n(50,(e=>e+1)).reduce(((n,r)=>("50"!==r&&n.push(Le(`${o+Number(r)}-06-06`,e,t)),n.unshift(Le(o-Number(r)+"-06-06",e,t)),n)),[Le(`${o}-06-06`,e,t)])}return e.startsWith("D")?n(31,(t=>`${"DD"===e&&t<9?"0":""}${t+1}`)):e.startsWith("H")?n(24,(t=>`${"HH"===e&&t<10?"0":""}${t}`)):e.startsWith("h")?n(12,(t=>`${"hh"===e&&t<9?"0":""}${t+1}`)):e.startsWith("m")||e.startsWith("s")?n(60,(t=>`${e.length>1&&t<10?"0":""}${t}`)):[]}function Me(e,t="ISO8601",n="en"){const o=()=>{throw new Error(`Date (${e}) does not match format (${_e(t)})`)};if("ISO8601"===t)return ue(e);const r=function(e){let t;for(const n of e){if("literal"===n.partName&&!isNaN(parseFloat(n.partValue)))throw new Error(`Numbers in format (${n.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==n.partName&&!(t.token in Es||n.token in Es||Ee(t)&&"a"===n.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${n.token})`);t=n}return e}(ke(t,n));if(!r.length)throw new Error("parse() requires a pattern.");let s;try{s=function(e,t){let n=0;const o=e=>[e[n++],e[n]];let r=0;const s=[];let a;do{const[n,i]=o(t);a=i;let l=1;if("literal"===n.partName)l=n.partValue.length;else if(n.partName in Es)l=Es[n.partName];else if(i)if("literal"===i.partName){if(l=e.indexOf(i.partValue,r)-r,l<0)throw new Error}else if("dayPeriod"===i.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(r+t)))){l=t;break}}else{const t=e.substring(r).search(/\d/);-1!==t&&(l=r+t)}else l=e.length;s.push({...n,value:e.substring(r,r+l)}),r+=l}while(a);return s}(e,r)}catch{return o()}const a=new Date,i=new Map([["YYYY",a.getFullYear()],["MM",a.getMonth()+1],["DD",a.getDate()],["HH",0],["mm",0],["ss",0]]);let l=null;s.forEach((e=>{if("literal"===e.partName)return;const t=Number(e.value);if(i.has(e.token))i.set(e.token,t);else if("YY"===e.token)i.set("YYYY",function(e){const t=(new Date).getFullYear(),n=t%100,o=Math.floor(t/100),r=Number(e);return 100*(o+(r>n+20?-1:0))+r}(e.value));else{const o=e.token;if(o.startsWith("d"))return;if("D"===o)i.set("DD",t);else if("H"===o||o.startsWith("h"))i.set("HH",t);else if("M"===o)i.set("MM",t);else if("a"===o||"A"===o)l=e.value===xe("am",n).toLowerCase();else{const t=Te(o,n).indexOf(e.value);if(-1!==t)switch(o){case"MMM":case"MMMM":i.set("MM",t+1)}}}}));let p=i.get("HH")||0;!1===l?(p+=12,i.set("HH",24===p?0:p)):!0===l&&12===p&&i.set("HH",0),i.set("MM",(i.get("MM")||1)-1);const[d,u,c,f,h,g]=Array.from(i.values()),m=new Date(d,u,c,f,h,g);return isFinite(+m)?m:o()}function De(e,t){const n=[],o=ue(t);o.setDate(1);let r=ge(o,e.props.weekStart);r.setHours(o.getHours(),o.getMinutes(),o.getSeconds());const s=function(e,t=0){const n=ge(e,t);return n.setDate(n.getDate()+6),n.setHours(23,59,59),n}(fe(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(n.push(a),a=[]),r=me(r)}while(r.getTime()<=s.getTime());return{monthDay:o,weeks:n}}function Ae(e){e.props.calendar=r(e.props.showMonths,(e=>e)).map((t=>De(e,ve(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(Le(e.props.renderedDate,"YYYY")),n=t-t%10;return e.props.decade=`${n} - ${n+9}`,r(10,(o=>$e(e.props.renderedDate,n+o-t)))}(e),e.props.months=function(e){const t=ue(e.props.renderedDate);return t.setMonth(0),r(12,(e=>ve(t,e)))}(e)}function Se(e,t){t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_panels`)||!document.contains(t.target))||(e.props.expanded=!1)}function Oe(e,t){if(!t)return e.props.inputText="",new Date;const n=t instanceof Date?t:Me(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(n,e.props.format,e.props.locale),n}function Ce(e){return Array.isArray(e.props.sequence)?Wt.clone(e.props.sequence):["day"]}function Ie(e,t,n=!0){null==t?e.input(t,n):e.input(Le(t,e.props.valueFormat,e.props.valueLocale),n)}function Be(e,t){const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>document.getElementById(`${e.props.id}_${t}`))),o=document.getElementById(`${e.props.id}_${n}`);o instanceof HTMLElement&&(t.preventDefault(),o.focus())}function Ve(e){const t=Array.isArray(e.props.options)?e.props.options:[],n=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(t);return!!n.length&&(!!Array.isArray(e.value)&&e.value.reduce(((t,o)=>{const r=n.find((e=>Wt.eq(o,f(e))));return r?t.push(r):e.props.arbitraryValues&&t.push({value:o,label:o}),t}),[]))}function He(e,t){var n;if(ca.has(e))return;ca.set(e,[]),t.reverse&&_a.add(e),t.prefix&&La.set(e,t.prefix),t.suffix&&Ea.set(e,t.suffix),We(e,t.pattern,t.partOverrides);const o=ma.get(e),r=null==o?void 0:o.some((e=>Re(e))),s=null==o?void 0:o.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(r&&s)throw new Error("Cannot use enums and groups in the same mask.");const a=r?"select":null!==(n=t.mode)&&void 0!==n?n:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&va.add(e),$a.set(e,a),t.onChange&&ka.set(e,t.onChange),e.addEventListener("beforeinput",(n=>{if(Oa)return;if(n.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(n=>{var o;n.preventDefault(),n.stopImmediatePropagation();const r=ca.get(e);if(null==r?void 0:r.length){const n=(null!==(o=fa.get(e))&&void 0!==o?o:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[n];if(!s)return;et(e,s),e.setSelectionRange(...s.selectionAfter),fa.set(e,n),ka.has(e)&&ka.get(e)(s.valueAfter,e)}}),{once:!0})}(e,n.inputType);n.preventDefault();const o=(r=n.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=ze(e),a=e.value;o&&Ue(e,{type:o,selectionBefore:s,data:n.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),wt(e);case"ArrowLeft":return t.preventDefault(),wt(e,-1);case"ArrowUp":return void(kt(e,1)&&t.preventDefault());case"ArrowDown":return void(kt(e,-1)&&t.preventDefault());case"Tab":return Ta?void t.preventDefault():void(wt(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const n=va.has(e),o=$a.get(e);if(n){let n=null,r=null,s=!1;const a="shift"===o?0:1,i=e.value;dt(e,{type:"insert",data:i,selectionBefore:[0,0,"none"],valueBefore:i},"shift"===o?"":i,((e,t)=>(null===n&&"char"===t.type&&(n=e.pos-a),(Ye(t)||Re(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0))));const l=null!==(t=null!=r?r:s?i.length:n)&&void 0!==t?t:null;if(null!==l){let t=[l,l,"none"];if("select"===$a.get(e)){const[n]=$t(e),o=Lt(e,t);void 0!==o&&o in n&&(t=n[o])}return function(e,t,n=50){ba.set(e,Ze(e,t));const o=async()=>{if(!Sa||document.activeElement!==e)return;"select"===$a.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=ze(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Ge(e,t);const[n]=$t(e),o=Lt(e,t),r=t[0];void 0!==o&&n.some((e=>r>=e[0]&&r<e[1]))&&ba.set(e,Ze(e,n[o]))}(e));const t=ba.get(e);t&&e.setSelectionRange(...t)};o(),document.addEventListener("selectionchange",o),setTimeout((()=>{document.removeEventListener("selectionchange",o),ba.delete(e)}),n)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(ba.get(e))return;t=Ge(e,t);const[n]=$t(e),o=Lt(e,t),r=void 0!==o&&Ze(e,n[o]);r&&!qe(t,r)&&Qe(e,r,!0)}(e,t.detail))),Ue(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ne(e,t){const n="string"==typeof e||!ca.has(e),o="string"==typeof e?Pe(e):e;if(n)t.prefix&&La.set(o,t.prefix),t.suffix&&Ea.set(o,t.suffix),o.value=Xe(o,o.value),He(o,t);else{const e=o.value;o.value="",Ue(o,{type:"insert",selectionBefore:[0,0,"none"],valueBefore:"",data:e,suffix:t.suffix,prefix:t.prefix})}return o.value}function Pe(e){return{value:e,selectionStart:0,selectionEnd:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function We(e,t,n,o,r){r=e&&_a.has(e)||r;const s=(null!=o?o:function(e){const t=Object.values(Da);if(!e)return t;const n={...e},o=[];for(const r of t)if(!je(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Fe(t)&&o.push(t),delete n[r.token]}else o.push(r);const r=Object.values(n);for(const e of r)Fe(e)?o.push(e):console.warn(`Invalid ${e.type} token`,e);return o}(n)).sort(((e,t)=>{const n="token"in e?e.token.length:-1,o="token"in t?t.token.length:-1;return n===o?0:n>o?-1:1}));let a=[];[t,a]=function(e,t,n,o){let r,s=0,a="",i="",l="";const p=[];for(;a=tt(e);)a===t&&r!==o?(s++,s>1&&(l+=a)):a===n&&s&&r!==o?(s--,0===s?(i+=`{$${p.length}}`,p.push(l),l=""):l+=a):s?l+=a:r!==o||a!==t&&a!==n?i+=a:i=`${i.substring(0,i.length-1)}${a}`,r=a,e=e.substring(a.length);return[i,p]}(t,"{","}","\\");const i=a.length;t=s.reduce(((e,t,n)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${i+n}}`).replaceAll("{“!”}",t.token):e),t);const l=function(e,t,n){return e.reduce(((e,o)=>{const[r,s]=function(e){const[t,...n]=e.split("|"),o=n.reduce(((e,t)=>{const[n,o=!0]=t.split(":");return Object.assign(e,{[n]:o})}),{});return[t,o]}(o);let a=We(null,r,void 0,t,n);a=a.map((e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t}));const i={type:"group",parts:a,...s};return e.push(i),e}),[])}(a,s,r).concat(s),p=/\{\$\d+\}/g,d=t.match(p),u=t.split(p).reduce(((e,t,n)=>{if(t&&e.push({type:"literal",value:r?[...t].reverse().join(""):t}),d&&d[n]){const t=d[n],o=Number(t.substring(2,t.length-1));!isNaN(o)&&l[o]&&e.push(l[o])}return e}),[]);return r&&u.reverse(),e&&ma.set(e,u),u}function Fe(e){return!!e&&(je(e)||Ye(e)||Re(e))}function Ye(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Ke(e))}function Re(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Ke(e))}function Ke(e){return!!e&&("placeholder"in e&&"token"in e)}function je(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function qe(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function ze(e){var t,n;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(n=e.selectionEnd)&&void 0!==n?n:e.value.length,"none"]}function Ue(e,t){var n;_a.has(e)&&Et(t);let o=!1;switch(t.type){case"insert":o=function(e,t){let n=Je(t);const o=t.selectionBefore,r=function(e,t){var n,o,r;if("select"===$a.get(e)){const[s,a]=$t(e),i=s.findIndex((e=>qe(e,t.selectionBefore))),l=null!==(n=a[i])&&void 0!==n?n:null;if(Ye(l)){const e=t.selectionBefore,n=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===l.selectDirection,i=lt(s,l),p=a?0:function(e,t,n){if(!e)return 0;let o="";for(;e.length;){const n=tt(e);e=e.substring(n.length),t.pattern.test(n)&&(o+=n)}return Math.min(Math.max(o.length,1),n)}(t.data,l,n);if(i.length>=n)return a||(t.insertPos=e[1]-p),(null!==(o=l.selectFill)&&void 0!==o?o:l.placeholder).repeat(n);const d=(null!==(r=l.selectFill)&&void 0!==r?r:l.placeholder).repeat(n-i.length-(a?0:p));return t.insertPos=a?e[0]+i.length:e[1]-p,"left"===l.selectDirection?`${i}${d}`:`${d}${i}${l.placeholder}`}if(Re(l)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);n=`${n.substring(0,o[0])}${r}${n.substring(o[1])}`;const s=dt(e,t,n);return ga.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:pt(e,s),unmasked:s.unmasked,complete:s.complete}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":o=function(e,t){const n=Je(t),o=t.selectionBefore,r=_a.has(e);let s=o[0],a=o[1];s===a&&("deleteContentBackward"!==t.type||r?a+=nt(n,s):s-=nt(n,s,"backward"));const i=$a.get(e);let l="";if("select"===i){const[n,o]=$t(e),r=Lt(e,[s,a,"none"]);if(void 0!==r){const i=o[r],p=n[r];Ye(i)?l=i.placeholder.repeat(a-s):Re(i)&&([l,s]=qe(p,ze(e))?[i.placeholder,s]:function(e,t,n,o){var r;const s=o.valueBefore,a=nt(s,o.selectionBefore[0],"backward"),i=Math.max(n[0],o.selectionBefore[0]-a),l=s.substring(n[0],i),p=null===(r=bt(t.values,l))||void 0===r?void 0:r.substring(l.length);return[null!=p?p:t.placeholder,p?i:n[0]]}(0,i,p,t))}}const p=`${n.substring(0,s)}${l}${n.substring(a)}`,d=dt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:gt(e,d,t,s),unmasked:d.unmasked,complete:d.complete}}(e,t)}if(_a.has(e)&&o&&Et(o),o&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=Ze(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,o),o&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(o)){let t=null!==(n=ca.get(e))&&void 0!==n?n:[];const r=fa.get(e);r&&(t=t.slice(0,r),fa.delete(e)),Sa&&document.activeElement===e&&"function"==typeof document.execCommand?(Qe(e,[0,e.value.length,"forward"],!0),Oa=!0,document.execCommand("insertText",void 0,o.valueAfter),Oa=!1):et(e,o),t.push(o),ca.set(e,t),Qe(e,o.selectionAfter),ka.has(e)&&ka.get(e)(o.valueAfter,e)}}function Xe(e,t){var n,o;const r=null!==(n=La.get(e))&&void 0!==n?n:"",s=null!==(o=Ea.get(e))&&void 0!==o?o:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function Ze(e,t){const n=La.get(e),o=[...t];return n&&(o[0]+=n.length,o[1]+=n.length),o}function Ge(e,t){const n=La.get(e),o=[...t];return n&&(o[0]-=n.length,o[1]-=n.length),o}function Je(e){let t=e.valueBefore;const n=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,n[0]>=t.length&&(n[0]=t.length),n[1]>=t.length&&(n[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const o=e.prefix.length;t=t.substring(o),e.valueBefore=t,n[0]=Math.max(n[0]-o,0),n[1]=Math.max(n[1]-o,0)}return t}function Qe(e,t,n=!1){n&&ha.add(e),ba.get(e)&&ba.set(e,t),e.setSelectionRange(...t)}function et(e,t,n="After"){if(e.value=t[`value${n}`],Sa){const n=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(n)}}function tt(e){if(null==e)return"";const t=ya.test(e.charAt(0))&&ya.test(e.charAt(1))?2:1;return e.substring(0,t)}function nt(e,t,n="forward"){if("backward"===n)return 0===t?0:1===t?1:ya.test(e.charAt(t))&&ya.test(e.charAt(t-1))?2:1;const o=e.length-t;return 0===o?0:1===o?1:tt(e.substring(t)).length}function ot(e,t){const n=tt(e.data),o=n.length;if(e.value+=n,e.pos+=o,"string"==typeof e.data&&(e.data=e.data.substring(o),e.data.length||(e.endPos=e.pos)),t)return t.substring(o)}function rt(e){const t=tt(e.buffer),n=t.length;e.value+=t,e.pos+=n,e.buffer=e.buffer.substring(n)}function st(e,t){const n=tt(t),o=n.length;return e.value+=n,e.pos+=o,t.substring(o)}function at(e,t){for(;t.buffer;){const n=tt(t.buffer);if(e.pattern.test(n)||t.placeholder&&e.placeholder===n)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(n.length)));t.buffer=t.buffer.substring(n.length)}}function it(e,t){for(;t.buffer;){const n=e.values.concat([e.placeholder]),o=t.buffer.toLowerCase(),r=n.find((e=>o.startsWith(e.toLowerCase())));if(r){const e=t.buffer.substring(0,r.length);return t.buffer=t.buffer.substring(r.length),e}t.buffer=t.buffer.substring(nt(t.buffer,0))}return null}function lt(e,t){let n=e.replaceAll(t.placeholder,"");const o="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${o?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${o?"$":""}`);n=n.replace(e,"")}var r;return n}function pt(e,t){let n=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return n;const o=ze(e);n=[o[0],t.endPos,"none"];const[r,s]=$t(e,t.value),a=Lt(e,n,[r,s]);if(void 0===a)return n;if(!(a in r)||!(a in s))return n;const i=r[a],l=s[a],p=t.value.slice(i[0],i[1]);if(Ye(l)&&lt(p,l).length===p.length&&a<r.length-1)return Ma(),r[a+1];if(Re(l)&&t.insertPos>=i[0]&&t.insertPos<=i[1]){const s=function(e,t,n){if(null===e.originalData)return 0;const o=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${o}${e.originalData}`,s=bt(n.values,r);if(s)return vt(r,s).length-o.length;return 0}(t,i[0],l);if(t.originalData&&s===t.originalData.length&&i[1]-i[0]===s)return n;if(t.insertPos+s===i[1])return Ma(),r[a+1]?r[a+1]:r[a];const p=[t.insertPos+s,i[1],"none"];return qe(p,o)||(ha.add(e),setTimeout((()=>ha.delete(e)),5)),p}return i}function dt(e,t,n,o){var r,s;const a=null!==(r=ma.get(e))&&void 0!==r?r:[],i={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:va.has(e),buffer:n,data:t.data,originalData:t.data,value:"",mode:$a.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:$t(e),unmasked:"",complete:!0};return ut(a,i,void 0,o),i}function ut(e,t,n,o){var r,s;const a={...t};(null==n?void 0:n.placeholder)&&(t.placeholder=!0);const i=(null==n?void 0:n.repeat)&&"literal"===(null===(r=n.nextPart)||void 0===r?void 0:r.type)?n.nextPart.value:null;let l=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const n of e){const r=e[l+1];switch(n.type){case"literal":ft(n,t,e.at(-1)===n);break;case"char":ht(n,t,i);break;case"enum":ct(n,t);break;case"group":const a={repeat:null!==(s=n.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!n.placeholder};ut(n.parts,t,a,o)}if(o){if(!1===o(t,n))break}const a=je(r)&&l+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;l++}if(t.chars<p&&(t.complete=!1),n){const r=t.chars-d,s=r===p,l=!(!t.data||i&&t.data.startsWith(i)&&t.insertPos<=t.pos),u=!(t.buffer&&i&&t.buffer.startsWith(i)&&t.insertPos>=t.pos+i.length)&&(t.buffer||l);if(n.repeat&&u&&s)return n.repeats++,ut(e,t,n,o);if(!s){t.complete=!1;const n=e.reverse().find((e=>"literal"===e.type));e.reverse(),je(n)&&t.value.endsWith(n.value)&&(t.value=t.value.substring(0,t.value.length-n.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":n.repeat&&!s&&n.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function ct(e,t){const[n,o]=t.rangeParts,r=n[o.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const n=t.buffer.substring(0,t.insertPos-t.pos),o=`${n}${t.data}`,r=bt(e.values.concat([e.placeholder]),o);if(r){const s=vt(o,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,n?t.buffer=t.buffer.substring(n.length):it(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}}if(t.buffer){const n=it(e,t);if(n)return t.value+=n,n!==e.placeholder?t.unmasked+=n:t.complete=!1,void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.pos=t.value.length}function ft(e,t,n){let o=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!n)return;let r=!1;for(;o;){const e=t.insertPos<=t.pos?tt(t.data):"",s=tt(o);if(e===s)o=ot(t,o),r=!0;else if(!r||t.data||null===t.data||t.placeholder||n)o=st(t,o);else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function ht(e,t,n){var o;let r=!0;if(t.insertPos<=t.pos)for(;null===(o=t.data)||void 0===o?void 0:o.length;){const o=tt(t.data);if(e.pattern.test(o))return ot(t),t.chars++,t.unmasked+=o,void at(e,t);if("string"==typeof t.data){if(n&&t.data.startsWith(n)){r=!1;break}t.data=t.data.substring(o.length)}}for(;r&&t.buffer;){const o=tt(t.buffer);if(e.pattern.test(o))return t.chars++,t.unmasked+=o,void rt(t);if(t.placeholder&&o===e.placeholder)return void rt(t);if("string"==typeof t.buffer){if(n&&t.buffer.startsWith(n)){t.buffer=t.buffer.substring(n.length);break}t.buffer=t.buffer.substring(o.length)}}t.placeholder?t.value+=e.placeholder:t.endPos=t.pos}function gt(e,t,n,o){const r=[o,o,"none"];if("select"===t.mode){const s=$t(e),a=Lt(e,r,s),[i,l]=$t(e,t.value),p=void 0!==a&&mt(n.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in i){if(p){const e=i.slice(a).every(((e,n)=>mt(t.value,e,l[a+n])));return e&&i[a-1]?i[a-1]:i[a]}return[o,i[a][1],"none"]}}return r}function mt(e,t,n){if(je(n))return!1;if(Ye(n)){let o=t[0];for(;o<t[1];){const t=tt(e.substring(o));if(t!==n.placeholder)return!1;o+=t.length}}return!Re(n)||e.substring(t[0],t[1])===n.placeholder}function vt(e,t){let n="";do{const o=tt(e).toLowerCase(),r=tt(t).toLowerCase();if(o!==r)break;n+=o,e=e.substring(o.length),t=t.substring(r.length)}while(e.length&&t.length);return n}function $t(e,t){const n=ma.get(e);if(!n)return[[],[]];if(xa.has(e))return xa.get(e);const o=null!=t?t:Xe(e,e.value),r=[],s=[];let a=null,i=null,l=0,p=!0;for(const e of n)if(je(e))a=e,null!==i&&(r.push([i,l,"none"]),i=null),l+=e.value.length;else{if(Ye(a)&&Ye(e)&&e.token===a.token)l++;else if(Ye(e))null===i?(i=l,s.push(e)):(r.push([i,l,"none"]),i=l,s.push(e)),l++;else if(Re(e)){i&&r.push([i,l,"none"]),xt(e)||(p=!1);const t=yt(o,e,l);i=null,r.push([l,l+t,"none"]),s.push(e),l+=t}a=e}null!==i&&r.push([i,l,"none"]);const d=[[...r],[...s]];return p&&!t&&xa.set(e,d),d}function yt(e,t,n){if(xt(t))return t.values[0].length;const o=e.slice(n),r=bt(t.values.concat([t.placeholder]),o);return r?r.length:0}function bt(e,t,n){var o;if(0===t.length)return null;const r=tt(t.toLowerCase()),s=`${null!=n?n:""}${r}`,a=e.filter((e=>e.toLowerCase().startsWith(s))),i=a.find((e=>e.toLowerCase()===s));return i||(0===a.length?null:1===a.length?a[0]:null!==(o=bt(a,t.substring(r.length),s))&&void 0!==o?o:a[0])}function xt(e){if(!wa.has(e)){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;wa.set(e,e.values.every((e=>e.length===t)))}return wa.get(e)}function wt(e,t=1){const[n]=$t(e),o=Lt(e,Ge(e,ze(e)));return void 0!==o&&void 0!==n[o+t]&&(e.setSelectionRange(...Ze(e,n[o+t])),!0)}function kt(e,t=1){const[n,o]=$t(e),r=Lt(e,ze(e));if(void 0!==r&&r in o){const s=o[r];if(Re(s)){const o=n[r],a=e.value.slice(o[0],o[1]);let i=null,l=s.values.indexOf(a);const p=s.values.length-1;if(-1!==l){const e=l+t;l=e<0?p:e>p?0:e,i=s.values[l]}else a===s.placeholder&&(i=t>0?s.values[0]:s.values[p]);if(null!==i){const t={selectionBefore:o,insertPos:o[0],type:"insert",data:i,valueBefore:e.value};return setTimeout((()=>Ue(e,t)),0),!0}}}return!1}function _t(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const n=e.length/2,o=Number.isInteger(n)?n:Math.floor(n),r=Math.abs(t-e[o-1])<Math.abs(t-e[o])?[0,o]:[o];return _t(e.slice(...r),t)}function Lt(e,t,n){const[o]=null!=n?n:$t(e),r=o.findIndex((e=>e[0]!==e[1]&&(!!qe(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==r)return r;const[s,a]=o.reduce(((e,t,n)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=n,e[1][t[1]]=n,e)),[new Set,{}]),i=_t([...s],t[1]);return i in a?a[i]:void 0}function Et(e){const t=e=>[...e].reverse().join(""),n=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=n(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=n(e.selectionBefore,e.valueBefore.length)}function Tt(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Ia.set(e,t),He(t,{...Ca.get(e),onChange:t=>{e.props._maskValue=t,e.input({maskValue:t})}})}function Mt(e){const t=Di.get(e.parentElement);t&&(!1===t.accepts||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("drop",Ht),e.addEventListener("dragenter",It),e.addEventListener("dragleave",Ct))}function Dt(e){const t=Di.get(e.parentElement);t&&t.childIsDraggable&&!t.childIsDraggable(e)||(e.setAttribute("draggable","true"),e.setAttribute("tabindex","0"),e.addEventListener("dragstart",Ot),t&&(!1===t.accepts||"append"==t.dropBehavior||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("dragenter",Vt),e.addEventListener("dragleave",Bt)))}function At(e,t,n,o){if(Si.has(e)){Ti.set(e,t),Mt(e);for(let n=0;n<e.children.length;n++){const o=e.children[n];o instanceof HTMLElement&&"true"!==o.getAttribute("data-disabled")&&(Dt(o),Ei.set(o,{value:t()[n],index:n}))}}else{new MutationObserver(St).observe(e,{childList:!0}),Di.set(e,n),function(e,t){if(t&&t.accepts&&Array.isArray(t.accepts)){const n=[];for(const e of t.accepts)n.push(e);Ai.set(e,n)}}(e,n),Si.add(e),Ti.set(e,t),Mi.set(e,o),Mt(e);for(let o=0;o<e.children.length;o++){const r=e.children[o];r instanceof HTMLElement&&((!n||!n.childIsDraggable||n.childIsDraggable&&n.childIsDraggable(r))&&(Dt(r),Ei.set(r,{value:t()[o],index:o})))}}}function St(e){if(Ii&&Wi){Ii.classList.add("dnd-placeholder");for(const e of Hi)e.classList.add("dnd-placeholder")}const t=[];for(const n of e)for(const e of n.addedNodes)e instanceof HTMLElement&&t.push(e);for(const e of t)e!==Ii&&Dt(e),Wi&&Vi&&e.classList.add("dnd-placeholder");if(Vi&&t.length){Ii=t[0],Fi=!1,Hi=[Ii];for(const e of t.slice(1))Hi.push(e);Vi=!1}const n=e[0].target,o=Ti.get(n)();for(let e=0;e<n.children.length;e++){const t=n.children[e];Ei.set(t,{value:o[e],index:e})}}function Ot(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e.dataTransfer){if(Ii=e.currentTarget,!(Ii.parentNode&&Ii.parentNode instanceof HTMLElement))return;const t=Di.get(Ii.parentNode);if(t&&t.isDisabled&&t.isDisabled())return void e.preventDefault();const n=Mi.get(Ii.parentNode)();n.length||Ii.parentNode.dispatchEvent(new CustomEvent("dndDragStart",{detail:Ei.get(Ii)})),Wi=!0,Bi=Ei.get(Ii).index;const o=Ti.get(Ii.parentNode)();if(Oi.set(Ii.parentNode,[...o]),Ii.id="dragging",Ci.push(Ii.parentNode),n.length>1&&n.includes(Ii)){const e=new DocumentFragment,t=document.createElement("div");t.classList.add("dnd-multiple-selections"),t.id="dnd-multiple-selections",n.sort(((e,t)=>Ei.get(e).index-Ei.get(t).index)).map((e=>{Hi.push(e);const n=e.cloneNode(!0);t.appendChild(n),e.classList.add("dnd-children-hidden")})),e.appendChild(t),Ii.appendChild(e)}else Hi.push(Ii)}}function Ct(){Ni=!1}function It(e){if(!e.currentTarget||!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.parentNode||!(e.currentTarget.parentNode instanceof HTMLElement)||!Ii||!Ii.parentNode||Ni||Pi||null===Bi||Fi||e.currentTarget===Ii.parentNode||Ai.get(e.currentTarget)&&!Ai.get(e.currentTarget).includes(Ii.parentNode))return;Ni=!0,Vi=!0;let t=Ti.get(e.currentTarget)();Oi.has(e.currentTarget)||(Oi.set(e.currentTarget,[...t]),Ci.push(e.currentTarget));const n=[...Ti.get(Ii.parentNode)()];let o=[];if(Hi.length){for(const e of Hi){const t=Ei.get(e);n.splice(t.index,1)}o=Hi.map((e=>Ei.get(e).value))}t=[...t,...o],Bi=t.length-1-o.length,e.currentTarget.dispatchEvent(new CustomEvent("dndNewValue",{detail:t})),Fi=!0}function Bt(){Pi=!1}function Vt(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e.currentTarget.parentNode&&e.currentTarget.parentNode instanceof HTMLElement&&Ii&&null!==Bi&&Ii instanceof HTMLElement&&!Ni&&!Pi&&e.currentTarget!==Ii&&!Fi){if(Ai.get(e.currentTarget.parentNode)&&!Ai.get(e.currentTarget.parentNode).includes(Ii.parentNode))return;Pi=!0;let t=[...Ti.get(e.currentTarget.parentNode)()];const n=Ei.get(e.currentTarget).index,o=Ii.parentNode;if(!o)return;const r=Ti.get(o)();let s=[],a=[];Hi.length&&(s=Hi.map((e=>Ei.get(e).value)),a=Hi.map((e=>Ei.get(e).index)));const i=[...a],l=[];if(e.currentTarget.parentNode===Ii.parentNode){for(const e of i)l.push(t[e]);t=t.filter(((e,t)=>!i.includes(t))),t.splice(n,0,...l)}else Vi=!0,Oi.has(e.currentTarget.parentNode)||(Oi.set(e.currentTarget.parentNode,[...Ti.get(e.currentTarget.parentNode)()]),Ci.push(e.currentTarget.parentNode)),r.splice(Bi,1),t.splice(n,0,...s);Ii.classList.remove("dnd-hidden"),Ii.classList.remove("dnd-children-hidden");for(let e=0;e<Ii.children.length;e++){const t=Ii.children[e];"dnd-multiple-selections"===t.getAttribute("id")&&t.remove()}for(const e of Hi)e.classList.remove("dnd-hidden"),e.classList.remove("dnd-children-hidden");e.currentTarget.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:t})),e.currentTarget.parentNode!==Ii.parentNode&&(Fi=!0),Bi=n}}function Ht(e){e.stopPropagation(),e.currentTarget&&(Pt(),document.dispatchEvent(new Event("dndDrop")))}function Nt(){for(const e of Ci){let t=Ti.get(e);Oi.get(e)&&(t=[...Oi.get(e)]),e.dispatchEvent(new CustomEvent("dndNewValue",{detail:t})),Oi.delete(e)}Pt()}function Pt(){if(Wi=!1,Ii&&Ii.children){for(let e=0;e<Ii.children.length;e++){const t=Ii.children[e];"dnd-multiple-selections"===t.getAttribute("id")&&t.remove()}document.querySelectorAll(".dnd-hidden").forEach((e=>{e.classList.remove("dnd-hidden")})),document.querySelectorAll(".dnd-children-hidden").forEach((e=>{e.classList.remove("dnd-children-hidden")})),document.querySelectorAll(".dnd-placeholder").forEach((e=>{e.classList.remove("dnd-placeholder")}))}Ii=null,Bi=null,Vi=!1,Hi=[];for(const e of Ci)Oi.delete(e);Ci=[]}Object.defineProperty(exports,"__esModule",{value:!0});var Wt=require("@formkit/utils"),Ft=require("@formkit/core"),Yt=require("@formkit/inputs");const Rt=[988,24029,396,13078,980];let Kt=189024;const jt=/^[0-9a-f]+$/,qt="undefined"!=typeof window,zt=r(32,(e=>e)).map((()=>{Kt|=0,Kt=Kt+1831565813|0;let e=Kt^Kt>>>15|Kt;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),Ut=setTimeout,Xt={},Zt=e=>e.toString(32),Gt=e=>`${Zt(zt[e]).substring(2)}.${Zt(Rt[e%(Rt.length-1)])}`,Jt={},Qt={},en=new Set(["",null,void 0]),tn={},nn={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},on={overflow:"hidden",height:"100%"},rn={},sn={};let an=0;const ln=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple","data-disabled":"$disabled || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.valid === false && $state.validationVisible || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined"}}),pn=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),dn=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),un=()=>({$el:"ul",if:"$fns.length($messages)"}),cn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),fn=()=>({$el:"div",if:"$help"}),hn=()=>({$el:null}),gn=(e,t)=>()=>Yt.icon(e,t),mn=new WeakSet,vn=new WeakMap,$n="undefined"!=typeof window,yn=Ft.createMessage({key:"loading",type:"state",value:!0,visible:!1}),bn=Ft.createMessage({key:"loading",type:"state",value:!1,visible:!1}),xn=Symbol(),wn=new WeakMap,kn="undefined"!=typeof window,_n=d("dd"),{outer:Ln,wrapper:En,inner:Tn,icon:Mn,label:Dn,prefix:An,suffix:Sn,help:On,messages:Cn,message:In}=u(_n),Bn=_n("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",tabindex:"0","aria-has-popup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),Vn=_n("selection","div"),Hn=_n("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),Nn=_n("optionLoading","span"),Pn=_n("option",(()=>({$el:"div",attrs:{"data-is-placeholder":"$option.isPlaceholder || undefined"}}))),Wn=O(_n),Fn={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Yn={schema:Ln(En(Dn("$label"),Tn(Mn("prefix"),An(),Bn(c("$option.isPlaceholder && $state.loading !== true",Hn("$option.label"),Vn(Pn(c("$state.loading",Nn("$ui.isLoading.value"),"$option.label")))),c("$state.loading",Mn("loader")),Mn("select")),Wn(),Sn(),Mn("suffix"))),On("$help"),Cn(In("$message.value"))),type:"input",family:"dropdown",props:[],features:[Yt.options,_(S,(function(e){e.on("click",(()=>{e.props.trackHover=!1,(!e.props.options||e.props.options.length||e.props.emptyMessage||e.props.optionsLoader)&&(e.props.options&&!e.props.options.length&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),e.props.expanded=!0)}))}),A,E(T,D),(function(e){let t,n="";e.on("unusedKeyDown",(({payload:o})=>{if(!o.isComposing&&1===[...o.key].length){clearTimeout(t),n+=o.key;const r=e.props.options.find((e=>e.label.toLowerCase().startsWith(n.toLowerCase())));r&&(e.props.activeValue=f(r)),t=setTimeout((()=>{n=""}),400)}}))})),function(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&Ft.error(300,[e]),e.props.dropdownWrapperStyles=Wt.clone(Fn),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=C.bind(null,e),e.props.positionListBox=I.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){an=document.documentElement.scrollTop;for(const e in nn)sn[e]=document.documentElement.style[e],document.documentElement.style[e]=nn[e];for(const e in on)rn[e]=document.body.style[e],document.body.style[e]=on[e];document.body.scrollTop=an}():function(){for(const e in nn)document.documentElement.style[e]=sn[e];for(const e in on)document.body.style[e]=rn[e];document.body.scrollTop=0,document.documentElement.scrollTop=an}())}))},Yt.defaultIcon("select","select"),Yt.defaultIcon("selected","check"),Yt.defaultIcon("loader","spinner"),Yt.localize("isLoading"),Yt.localize("loadMore")]},Rn=d("tg"),{outer:Kn,wrapper:jn,label:qn,prefix:zn,suffix:Un,help:Xn,messages:Zn,message:Gn,icon:Jn}=u(Rn),Qn=Rn("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$_value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),eo=Rn("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),to=Rn("altLabel",(()=>({$el:"label",if:"($label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner) || $altLabelPosition === true",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),no=Rn("innerLabel",(()=>({$el:"div",if:"$valueLabelDisplay === inner && ($checked && $onValueLabel || $offValueLabel)",attrs:{style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:{if:"$checked",then:"$onValueLabel",else:"$offValueLabel"}}))),oo=Rn("valueLabel",(()=>({$el:"label",if:"$valueLabelDisplay !== hidden && $valueLabelDisplay !== inner && (($checked === true && $onValueLabel) || ($checked === false && $offValueLabel))",attrs:{for:"$id"},children:{if:"$checked && $onValueLabel",then:"$onValueLabel",else:{if:"$offValueLabel",then:"$offValueLabel"}}}))),ro=Rn("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),so=Rn("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),ao=Rn("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),io={schema:Kn(jn(to(),ro(zn(),Qn(),so(no(),ao(c("$slots.default","$slots.default",Jn("thumb")))),Un()),oo(),eo()),Xn("$help"),Zn(Gn("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(e){function t(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}e.on("created",(()=>{e.props.disabled=Wt.undefine(e.props.disabled),e.props.altLabelPosition=Wt.undefine(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=Wt.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))}))}]},lo=d("rp"),{outer:po,inner:uo,prefix:co,suffix:fo,help:ho,messages:go,message:mo,icon:vo}=u(lo),$o=lo("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($item.__key)",type:"button"}}))),yo=lo("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),bo=lo("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($item.__key)",type:"button"}}))),xo=lo("items",(()=>({$el:"ul",attrs:{role:"list"}}))),wo=lo("item",(()=>({$el:"li",for:["item","index","$value"],if:"$item.__key",attrs:{role:"listitem",key:"$item.__key","data-index":"$item.__index"}}))),ko=lo("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($item.__key, 1)",type:"button"}}))),_o=lo("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($item.__key, -1)",type:"button"}}))),Lo=lo("content","div"),Eo=lo("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),To=lo("legend",(()=>({$el:"legend",if:"$label"}))),Mo=lo("group",(()=>({$formkit:"group",id:"$item.__key",index:"$item.__index"}))),Do=lo("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Ao=lo("remove",(()=>({$el:"li",if:"$removeControl"}))),So=lo("insert",(()=>({$el:"li",if:"$insertControl"}))),Oo=lo("up",(()=>({$el:"li",if:"$upControl"}))),Co=lo("down",(()=>({$el:"li",if:"$downControl"}))),Io=lo("controlLabel","span");let Bo=0;const Vo=new Set,Ho={schema:po(Eo(To("$label"),ho("$help"),uo(co(),c("$slots.default",xo(wo(Lo(Mo("$slots.default")),Do(Oo(_o(Io("$ui.moveUp.value"),vo("moveUp"))),Ao(bo(Io("$ui.remove.value"),vo("remove"))),So($o(Io("$ui.add.value"),vo("add"))),Co(ko(Io("$ui.moveDown.value"),vo("moveDown"))))))),fo()),yo('$addLabel || ($ui.add.value + " " + ($label || ""))')),go(mo("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){const t=new Set,n={value:0};Y(e,"removeControl",!0),Y(e,"upControl",!0),Y(e,"downControl",!0),Y(e,"insertControl",!1),Y(e,"addButton",!0),Y(e,"addLabel",!1),Y(e,"addAttrs",{}),e.plugins.add(B),e.plugins.add(F.bind(null,t)),e.hook.input(((o,r)=>r(P(o,e,t,n)))),e.on("commit",(({payload:t})=>{Vo.has(e)&&e.input(t,!1)})),e.hook.commit(((t,o)=>{if(n.value&&Array.isArray(t)&&t.forEach(((o,r)=>{const a=Object.isFrozen(o)&&e.children.findIndex((e=>e.props.id===o.__key));if(!1!==a&&-1!==a){n.value--;const i=o.__index,l=o.__original;Object.defineProperty(l,"__index",{configurable:!0,value:i});const p=s(t);p.splice(r,1),p.splice(i,0,l);const[d]=e._c.children.splice(a,1);d&&e._c.children.splice(i,0,d),0===n.value&&(W(e,t),t.forEach((e=>delete e.__index)))}})),Array.isArray(t)){W(e,t);const n=t[t.length-1];Wt.isObject(n)&&"__shim"in n&&function(e){const t=e.findIndex((e=>Wt.isObject(e)&&"__shim"in e));-1!==t&&e.splice(t)}(t)}return o(t)})),e.on("created",H)},Yt.localize("remove"),Yt.localize("add"),Yt.localize("moveUp"),Yt.localize("moveDown"),Yt.defaultIcon("remove","trash"),Yt.defaultIcon("add","add"),Yt.defaultIcon("moveUp","arrowUp"),Yt.defaultIcon("moveDown","arrowDown")]},No="undefined"!=typeof window,Po=d("rt"),{outer:Wo,wrapper:Fo,inner:Yo,label:Ro,prefix:Ko,suffix:jo,help:qo,messages:zo,message:Uo,icon:Xo}=u(Po),Zo=Po("input",(()=>({$el:"input",attrs:{id:"$id",type:"range",max:"$max",name:"$name",min:"0",disabled:"$disabled",step:"$step",onInput:"$handlers.DOMInput",onBlur:"$handlers.blur",value:"$_value",style:{position:"absolute",zIndex:"0",top:0,right:0,bottom:0,opacity:"0"}}}))),Go=Po("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),Jo=Po("onItems",(()=>({$el:"div",attrs:{id:'$id + "_on_wrapper"',style:{position:"relative",display:"flex",width:'$onWidth + "%"',top:"0",bottom:"0",left:"0",overflow:"hidden",color:"$onColor"}}}))),Qo=Po("offItems",(()=>({$el:"div",attrs:{id:'$id + "_off_wrapper"',style:{position:"absolute",display:"flex",flexDirection:"row-reverse",width:'$offWidth + "%"',top:"0",bottom:"0",right:"0",overflow:"hidden",color:"$offColor"}}}))),er=Po("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),tr=Po("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),nr={schema:Wo(Fo(Ro("$label"),Yo(Xo("prefix"),Ko(),Go(Jo(er(c("$slots.onItem",(()=>()=>"$slots.onItem"),c("$slots.default",(()=>()=>"$slots.default"),Xo("rating"))))),Qo(tr(c("$slots.offItem",(()=>()=>"$slots.offItem"),c("$slots.default",(()=>()=>"$slots.default"),Xo("rating")))))),Zo(),jo(),Xo("suffix"))),qo("$help"),zo(Uo("$message"))),type:"input",props:[],features:[function(e){e.addProps(["onWidth","offWidth","wrapperWidth","max","min","icon","step","hoverHighlight","ratingIcon","onColor","offColor"]),e.props.max=e.props.max||5,e.props.min=e.props.min||0,e.props.step=e.props.step||1,!1!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.disabled=Wt.undefine(e.props.disabled),e.on("created",(()=>{No&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=K.bind(null,e),e.context.handlers.ratingHoverOut=j.bind(null,e),e.context.handlers.handleClick=R.bind(null,e),No&&a(`${e.props.id}`,(()=>{z(e),function(e){const t=document.getElementById(`${e.props.id}_items_wrapper`);if(!t)return;new ResizeObserver((()=>{z(e)})).observe(t)}(e),setTimeout((()=>z(e)),100)})))})),e.on("input",(()=>U(e))),e.hook.input(((t,n)=>{if(null===t||""===t||isNaN(t))return n(t);const o=Number(t),r=Number(e.props.min),s=Number(e.props.max);return o>s?n(s):e.props.min&&o<=r?n(r):n(o)}))},Yt.defaultIcon("rating","star")]},or=new WeakSet,rr=new WeakMap,sr=new WeakMap,ar=new WeakMap,ir=new WeakMap,lr=new WeakMap,pr="undefined"!=typeof window;let dr=!1;const ur=new WeakMap,cr=new WeakMap,fr=new WeakSet,hr="undefined"!=typeof window,gr=d("ac"),{outer:mr,wrapper:vr,inner:$r,icon:yr,label:br,prefix:xr,suffix:wr,help:kr,messages:_r,message:Lr}=u(gr),Er=gr("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",tabindex:"0",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend",onFocus:"$handlers.focus",onFocusout:"$handlers.focusOut","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),Tr=gr("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Mr=gr("selection",(()=>({for:["option","index","$selections"],$el:"div",attrs:{key:"$option.value","data-value":"$option.value",tabindex:"0",onClick:"$handlers.selectTag($option)",onFocus:"$handlers.selectTag($option)"}}))),Dr=gr("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"',onKeydown:"$handlers.keydown"}}))),Ar=gr("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$disabled !== true && $handlers.removeSelection($option)","aria-controls":"$id"}}))),Sr=gr("optionLoading","span"),Or=gr("option",(()=>({$el:"div",if:"$_value !== undefined"}))),Cr=O(gr),Ir={schema:mr(vr(br("$label"),$r(yr("prefix"),xr(),Er(),c("$multiple !== true && $selectionAppearance === option",Dr(Mr(Or(c("$state.loading",Sr("$ui.isLoading.value"),"$option.label")),Ar(yr("close"))))),c("$state.loading",yr("loader")),Tr(yr("select")),Cr(),wr(),yr("suffix")),c("$multiple && $selectionAppearance === option",Dr(Mr(Or(c("$state.loading",Sr("$ui.isLoading.value"),"$option.label")),Ar(yr("close")))))),kr("$help"),_r(Lr("$message.value"))),type:"input",family:"dropdown",props:[],features:[Yt.options,de,_(A,E(T,D)),le(T),Yt.defaultIcon("select","select"),Yt.defaultIcon("close","close"),Yt.defaultIcon("selected","check"),Yt.defaultIcon("loader","spinner"),Yt.localize("isLoading"),Yt.localize("loadMore")]},Br=d("dp"),{outer:Vr,wrapper:Hr,inner:Nr,icon:Pr,label:Wr,prefix:Fr,suffix:Yr,help:Rr,messages:Kr,message:jr}=u(Br),qr=Br("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",readonly:!0,onClick:"$handlers.open"}}))),zr=Br("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:"$id + _panels",role:"dialog","aria-modal":"true","aria-label":"Choose date"}}))),Ur=Br("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Xr=Br("nextLabel","span"),Zr=Br("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Gr=Br("prevLabel","span"),Jr=Br("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "D")'}}))),Qr=Br("calendarWeeks",(()=>({$el:"tbody"}))),es=Br("calendarHeader",(()=>({$el:"thead"}))),ts=Br("weekDays",(()=>({$el:"tr"}))),ns=Br("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),os=Br("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),rs=Br("day",(()=>({$el:"td",for:["day","$week"],attrs:{key:'$: "day" + $fns.format($day, "D")',onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","aria-selected":"$fns.isSelected($day)","aria-label":'$fns.format($day, "long")'}}))),ss=Br("openButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.open","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),as=Br("years",(()=>({if:'$panel === "year"',$el:"ul"}))),is=Br("year",(()=>({for:["year","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$fns.isSelected($year)"}}))),ls=Br("months",(()=>({if:'$panel === "month"',$el:"ul"}))),ps=Br("month",(()=>({$el:"li",for:["month","$months"],attrs:{key:'$: "month" + $fns.format($month, "M")',onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$fns.isSelected($month)"}}))),ds=Br("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),us=Br("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),cs=Br("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),fs=Br("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),hs=Br("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),gs=Br("yearButton",(()=>({$el:"button",attrs:{id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),ms=Br("monthButton",(()=>({$el:"button",attrs:{id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),vs=Br("dayButton",(()=>({$el:"button",attrs:{id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),$s=Br("time",(()=>({$el:"div",if:'$panel === "time"'}))),ys=Br("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown"}}))),bs=Br("panel","div"),xs="1999-03-04T02:05:01.000Z",ws=new Map,ks=[["YYYY",{year:"numeric"}],["YY",{year:"2-digit"}],["MMMM",{month:"long"}],["MMM",{month:"short"}],["MM",{month:"2-digit"}],["M",{month:"numeric"}],["DD",{day:"2-digit"}],["D",{day:"numeric"}],["dddd",{weekday:"long"}],["ddd",{weekday:"short"}],["d",{weekday:"narrow"}],["mm",{minute:"2-digit"}],["m",{minute:"numeric"}],["ss",{second:"2-digit"}],["s",{second:"numeric"}],["ZZ",{timeZoneName:"short"}],["Z",{timeZoneName:"longOffset"}]],_s=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Ls=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Es={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2},Ts=new Map([...ks,..._s,...Ls].map((e=>[e[0],e]))),Ms=new Map,Ds=["full","long","medium","short"],As=/^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]{3})?(Z|\+[0-9]{3})?$/,Ss="undefined"!=typeof window,Os={schema:Vr(Hr(Wr("$label"),Nr(Pr("prefix"),Fr(),qr(),zr(ds(Zr(Gr("$ui.prev.value"),Pr("prev")),us("$decade"),cs(gs()),fs(ms(),gs()),hs(ms(),vs(),gs()),Ur(Xr("$ui.next.value"),Pr("next"))),bs(as(is("$fns.format($year, $yearFormat)")),ls(ps("$fns.format($month, $monthFormat)")),Jr(es(ts(ns("$fns.format($day, $weekdayFormat)"))),Qr(os(rs("$fns.format($day, $dateFormat)")))),$s(ys()))),ss(Pr("calendar")),Yr(),Pr("suffix"))),Rr("$help"),Kr(jr("$message.value"))),type:"input",family:"date",props:["startingMonth"],features:[function(e){var t,n,o,r,s,i,l,p,d,u,c,f,h,g,m,v,$,y;e.addProps(["expanded","calendar","years","months","panel","sequence","format","inputText","weekStart","showMonths","activeDate","weekdayFormat","monthFormat","monthButtonFormat","dayButtonFormat","renderedDate","dateFormat","yearFormat","valueFormat","decade","localTime","showPagination","paginatedPanels","valueLocale"]),null!==(t=(u=e.props).valueFormat)&&void 0!==t||(u.valueFormat="ISO8601"),null!==(n=(c=e.props).weekdayFormat)&&void 0!==n||(c.weekdayFormat="d"),null!==(o=(f=e.props).monthFormat)&&void 0!==o||(f.monthFormat="MMM"),null!==(r=(h=e.props).monthButtonFormat)&&void 0!==r||(h.monthButtonFormat="MMMM"),null!==(s=(g=e.props).dayButtonFormat)&&void 0!==s||(g.dayButtonFormat="D"),null!==(i=(m=e.props).dateFormat)&&void 0!==i||(m.dateFormat="D"),null!==(l=(v=e.props).yearFormat)&&void 0!==l||(v.yearFormat="YYYY"),null!==(p=($=e.props).paginatedPanels)&&void 0!==p||($.paginatedPanels=["day","year"]),null!==(d=(y=e.props).valueLocale)&&void 0!==d||(y.valueLocale=e.props.locale),e.props.panels=Ce(e),function(e){const t=e._value;let n=new Date;if(null!=t){if(t instanceof Date)Ie(e,t,!1),n=ue(t);else if("string"==typeof t)try{const o=Me(t,e.props.valueFormat,e.props.valueLocale);n=ue(o),Ie(e,o,!1)}catch{console.warn(`Date (${t}) does not match format (${_e(e.props.valueFormat,e.props.valueLocale)})`),Ie(e,void 0,!1)}e.props.renderedDate=n,e.props.activeDate=n}}(e),function(e,t){if("string"!=typeof t&&!(t instanceof Date))return void(e.props.localTime="12:00");const n=t instanceof Date?t:Me(t,e.props.valueFormat,e.props.valueLocale);e.props.localTime=Le(n,"HH:mm")}(e,e._value),e.hook.prop(((e,t)=>("weekStart"===e.prop&&(e.value=Number(e.value||0)),"showMonths"===e.prop&&(e.value=Number(e.value||2)),t(e)))),e.props.calendar=[],e.props.inputText="",e.props.showMonths=e.props.showMonths||2,"function"==typeof e.props.format?(e.props.formatDate=e.props.format,e.props.format=null):e.props.formatDate=Le,e.on("created",(()=>{if(e.context){let t;e.context.fns.format=(t,n)=>Le(t,n,e.props.locale||"en"),e.context.fns.isSelected=t=>{var n;const o=null===(n=e.context)||void 0===n?void 0:n.value;if(null==o)return;return ye(t,o instanceof Date?o:Me(o,e.props.valueFormat,e.props.valueLocale))},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=$e(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=ve(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=$e(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=ve(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const n=t.target,[o,r]=n.value.split(":");e.props.localTime=n.value,e.props.activeDate.setHours(o,r),Oe(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.mouseEnter=n=>o=>{clearTimeout(t),o.target instanceof HTMLElement&&"-1"===o.target.getAttribute("tabindex")&&"true"!==o.target.getAttribute("data-is-extra")&&(e.props.activeDate=n)},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var n;return(null===(n=e.context)||void 0===n?void 0:n.activeDate)instanceof Date&&ye(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var n;return(null===(n=e.context)||void 0===n?void 0:n.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var n,o;return(null===(n=e.context)||void 0===n?void 0:n.activeDate)instanceof Date&&t.getFullYear()===(null===(o=e.context)||void 0===o?void 0:o.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const n=function(e){const t=ue(e);return t.setHours(0,0,0),t}(t).getTime();return n<ce(e).getTime()||n>fe(e).getTime()||void 0}}}));const b=Se.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():e.props.expanded=!1,Ie(e,t)})),e.on("input",(({payload:t})=>{const n=Oe(e,t);e.props.activeDate=n,e.props.renderedDate=n})),e.on("prop:renderedDate",Ae.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{var n;t?(e.props.panels=Ce(e),e.props.panel=e.props.panels.shift(),Ae(e),a(`${e.props.id}_panels`,(t=>{const n=t.querySelector('[tabindex="0"]');n&&(n.focus(),function(e,t){const n=new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach((e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())}))}));n.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const o=e.on("prop:expanded",(({payload:t})=>{t||(e.off(o),n.disconnect())}))}(e,t))})),Ss&&setTimeout((()=>document.addEventListener("click",b)),10)):("time"===e.props.panel?e.emit("dateSelected",e.props.activeDate):Oe(e,e._value),Ss&&(null===(n=document.getElementById(`${e.props.id}`))||void 0===n||n.focus(),document.removeEventListener("click",b)))})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const n=e.props.calendar,o=ce(e.props.renderedDate),r=fe(ve(e.props.renderedDate,n.length-1));t.getTime()<o.getTime()?e.props.renderedDate=ve(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=ve(e.props.renderedDate))}else if("year"===e.props.panel){const t=e.props.years,n=t[0].getFullYear(),o=t[t.length-1].getFullYear(),r=e.props.activeDate.getFullYear();r>o?e.props.renderedDate=$e(e.props.renderedDate,10):r<n&&(e.props.renderedDate=$e(e.props.renderedDate,-10))}e.props.expanded&&Oe(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":e.props.expanded=!0;break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{switch(t.key){case"ArrowRight":e.props.activeDate=me(e.props.activeDate);break;case"ArrowLeft":e.props.activeDate=me(e.props.activeDate,-1);break;case"ArrowDown":e.props.activeDate=me(e.props.activeDate,7);break;case"ArrowUp":e.props.activeDate=me(e.props.activeDate,-7);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||Be(e,t);break;case"Escape":e.props.expanded=!1}})),e.on("yearKeydown",(({payload:t})=>{let n;switch(t.key){case"ArrowDown":n=5;break;case"ArrowRight":n=1;break;case"ArrowUp":n=-5;break;case"ArrowLeft":n=-1;break;case"Tab":t.shiftKey||Be(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const o=e.props.activeDate.getFullYear()+n-e.props.renderedDate.getFullYear();e.props.activeDate=$e(e.props.renderedDate,o)})),e.on("monthKeydown",(({payload:t})=>{let n=0;switch(t.key){case"ArrowDown":n=3;break;case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowUp":n=-3;break;case"Tab":t.shiftKey||Be(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}let o=(e.props.activeDate.getMonth()+n)%12;o=o<0?12+o:o;const r=o-e.props.renderedDate.getMonth();e.props.activeDate=ve(e.props.renderedDate,r)})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate)}}))},Yt.localize("next"),Yt.localize("prev"),Yt.localize("changeDate"),Yt.localize("chooseDate"),Yt.defaultIcon("next","right"),Yt.defaultIcon("prev","left"),Yt.defaultIcon("calendar","date")]},Cs=d("tl"),{outer:Is,wrapper:Bs,inner:Vs,icon:Hs,label:Ns,prefix:Ps,suffix:Ws,help:Fs,messages:Ys,message:Rs}=u(Cs),Ks=Cs("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText",tabindex:"0",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),js=Cs("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),qs=Cs("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),zs=Cs("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),Us=Cs("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$disabled !== true && $handlers.removeSelection($option)","aria-controls":"$id"}}))),Xs=Cs("tagLabel",(()=>({$el:"span"}))),Zs=Cs("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite",onKeydown:"$handlers.keydown"}}))),Gs=Cs("tagLoading","span"),Js=O(Cs),Qs={schema:Is(Bs(Ns("$label"),Vs(Hs("prefix"),Ps(),Zs(qs(zs(c("$state.loading",Gs("$ui.isLoading.value"),Xs("$option.label")),Us(Hs("close")))),Ks()),c("$state.loading",Hs("loader")),js(Hs("select")),Js(),Ws(),Hs("suffix"))),Fs("$help"),Ys(Rs("$message.value"))),type:"input",family:"dropdown",props:[],features:[Yt.options,de,_(A,E(Ve,D)),le(Ve),Yt.defaultIcon("select","select"),Yt.defaultIcon("close","close"),Yt.defaultIcon("selected","check"),Yt.defaultIcon("loader","spinner"),Yt.localize("isLoading"),Yt.localize("loadMore")]},ea=d("mk"),{outer:ta,wrapper:na,inner:oa,label:ra,prefix:sa,suffix:aa,help:ia,messages:la,message:pa,icon:da}=u(ea),ua=ea("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",value:"$_maskValue",id:"$id","aria-describedby":"$describedBy"}}))),ca=new WeakMap,fa=new WeakMap,ha=new WeakSet,ga=new WeakMap,ma=new WeakMap,va=new WeakSet,$a=new WeakMap,ya=/[\uD800-\uDBFF]/,ba=new WeakMap,xa=new WeakMap,wa=new WeakMap,ka=new WeakMap,_a=new WeakSet,La=new WeakMap,Ea=new WeakMap;let Ta=!1;const Ma=()=>{Ta=!0,setTimeout((()=>{Ta=!1}),500)},Da={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},Aa=new WeakMap,Sa="undefined"!=typeof window;let Oa=!1;Sa&&document.addEventListener("selectionchange",(()=>{if(!(document.activeElement instanceof HTMLInputElement))return;const e=document.activeElement;if("select"!==$a.get(e))return;const t=ze(e);if(!qe(t,Aa.get(e))){if(Aa.set(e,t),ha.has(e))return ha.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:ze(e)}))}}));const Ca=new WeakMap,Ia=new WeakMap,Ba=new WeakMap,Va={schema:ta(na(ra("$label"),oa(da("prefix"),sa(),ua(),aa(),da("suffix"))),ia("$help"),la(pa("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse"],family:"text",features:[function(e){e.addProps(["_maskValue"]),e.on("created",(()=>{var t,n,o,r,s;const i=Pe("string"==typeof e._value?e._value:"");Ia.set(e,i),Ba.set(e,i),e.props.allowIncomplete=Wt.undefine(e.props.allowIncomplete);const l=!(void 0!==e.props.showMask&&!Wt.undefine(e.props.showMask));e.props.unmaskValue=Wt.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=Wt.undefine(e)),t(e))));const p={placeholder:l,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(n=e.props.mode)&&void 0!==n?n:"shift",partOverrides:null!==(o=e.props.tokens)&&void 0!==o?o:{},prefix:null!==(r=e.props.prefix)&&void 0!==r?r:void 0,suffix:null!==(s=e.props.suffix)&&void 0!==s?s:void 0,reverse:Wt.undefine(e.props.reverse)};Ca.set(e,p),e.hook.input(((t,n)=>n(function(e,t){const n=Ia.get(e),o="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:o?t.maskValue:"";const r=Ba.get(e);r.value=Xe(r,t);const s=Ne(r,Ca.get(e)),a=function(e,t=!1){var n,o;const r=null!==(n=ca.get(e))&&void 0!==n?n:[],s=r[null!==(o=fa.get(e))&&void 0!==o?o:r.length-1];return s&&(s.complete||t)?_a.has(e)?[...s.unmasked].reverse().join(""):s.unmasked:t?"":null}(r,e.props.allowIncomplete);if(t===n.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==n.value&&!e.props.allowIncomplete)return t;o||s===e.props._maskValue||(n.value=s,e.props._maskValue=s);return null===a?"":e.props.unmaskValue?a:s}(e,t)))),e.props._maskValue=Ne(i,p),e.input(e.props._maskValue,!1),a(`${e.props.id}`,Tt.bind(null,e))}))}]},Ha=d("tf"),{outer:Na,wrapper:Pa,inner:Wa,icon:Fa,prefix:Ya,suffix:Ra,help:Ka,messages:ja,message:qa}=u(Ha),za=Ha("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),Ua=Ha("legend",(()=>({if:"$label",$el:"legend"}))),Xa=Ha("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),Za=Ha("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),Ga=Ha("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),Ja=Ha("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$fns.getOptionCount() + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'},children:"$fns.getOptionCount()"}))),Qa=Ha("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),ei=Ha("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation",tabindex:"0","aria-label":'$fns.getOptionCount(true) + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$fns.getOptionCount(true)"}))),ti=Ha("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),ni=Ha("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),oi=Ha("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceKeyDown",disabled:"$disabled","aria-label":"Search",role:"searchbox",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput'}}))),ri=Ha("sourceSearchClear",(()=>({$el:"button",if:"$inputText !== undefined",attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),si=Ha("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseover:"$handlers.onMouseEnter(true)",onMouseout:"$handlers.onMouseLeave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems'}}))),ai=Ha("template",(()=>({for:["option","index","$options"],$el:null}))),ii=Ha("sourceListItem",(()=>({if:"$targetOptionValues.includes($fns.optionValue($option)) === false",$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$selections && $selections.length > 0 && $fns.isSelected($option)","data-is-active":"$fns.isActive($option)","data-disabled":"$option.attrs.disabled",onKeydown:"$targetOptionValues.includes($option.value) === false && $handlers.sourceKeyDown",role:"option",onClick:"$option.attrs.disabled !== true && $handlers.selectOption($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),li=Ha("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$selections && $selections.length > 0 && $fns.isSelected($option)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),pi=Ha("sourceLoadMore",(()=>({$el:"li",if:"$targetLoading !== true && $state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.sourceLoadMore'}}))),di=Ha("loadMoreInner","span"),ui=Ha("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),ci=Ha("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",tabindex:"0",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),fi=Ha("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseover:"$handlers.onMouseEnter(false)",onMouseout:"$handlers.onMouseLeave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems'}}))),hi=Ha("targetListItem",(()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$selections && $selections.length && $fns.isSelected($option, $target)","data-is-active":"$fns.isActive($option)",onKeydown:"$handlers.targetKeyDown",role:"option",onClick:"$option.attrs.disabled !== true && $handlers.selectOption($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),gi=Ha("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index',class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),mi=Ha("targetLoadMore",(()=>({$el:"li",if:"$targetLoading && $state.loading",attrs:{id:'$id + "_target_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.targetLoadMore'}}))),vi=Ha("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),$i=Ha("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selections.length === 0 || $sourceSelected === false || $state.loading || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),yi=Ha("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$options.length === $targetOptions.length || $state.loading || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),bi=Ha("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selections.length === 0 || $sourceSelected === true || $state.loading || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),xi=Ha("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $state.loading || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),wi=Ha("controlLabel","span"),ki=Ha("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),_i=Ha("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Li=Ha("emptyMessageInner","span"),Ei=new WeakMap,Ti=new WeakMap,Mi=new WeakMap,Di=new WeakMap,Ai=new WeakMap,Si=new WeakSet,Oi=new WeakMap;let Ci=[],Ii=null,Bi=null,Vi=!1,Hi=[],Ni=!1,Pi=!1,Wi=!1,Fi=!1;"undefined"!=typeof window&&(document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("drop",Nt),document.addEventListener("dragleave",(e=>{(e.target instanceof HTMLElement&&e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight)&&(e.preventDefault(),Nt())})));const Yi=new WeakSet,Ri=new WeakSet,Ki=new WeakMap,ji=new WeakMap,qi="undefined"!=typeof window,zi={schema:Na(za(Ua("$label"),Ka("$help"),Pa(Xa(Za(Ga(),Ja()),ti(ni(oi(),ri(Fa("close")))),si(ki(Li("$sourceEmptyMessage")),ai(ii(c("$transferOnSelect !== true && $fns.isSelected($option)",Fa("selected")),li("$option.label"))),pi(di(c("$targetLoading !== true && $state.loading",Fa("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))),vi(yi(wi("$ui.addAllValues.value"),Fa("fastForward")),$i(wi("$ui.addSelectedValues.value"),Fa("moveRight")),bi(wi("$ui.removeSelectedValues.value"),Fa("moveLeft")),xi(wi("$ui.removeAllValues.value"),Fa("rewind"))),ui(ci(Qa(),ei()),fi(_i(Li("$targetEmptyMessage")),hi(c("$transferOnSelect !== true && $fns.isSelected($option)",Fa("selected")),gi("$option.label")),mi(di(c("$targetLoading && $state.loading",Fa("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),ja(qa("$message.value")))),type:"input",props:["options","selections","activeValue","activeDescendant","sourceSelected","targetOptions","target","source","optionLoader","filterOptions","inputText","renderList","search","hasNextPage","page","targetOptionValues","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","debounce"],features:[function(e){function t(e,t){e.props.showTargetEmptyMessage=0===t.length||!1===t,t=t||[],e.props.targetOptions=[...t],e.props.targetOptionValues=t.map((e=>f(e))),e.props.showSourceEmptyMessage=e.props.options&&e.props.options.length===e.props.targetOptions.length,e.props.selections=[]}function n(e,t,n){var r;const s=n?e.props.options:e.props.targetOptions;if(e.props.trackHover=!1,["ArrowDown","ArrowUp"].includes(t.key)){if(t.preventDefault(),!Array.isArray(s)||!s.length)return;const n=s.reduce(((e,t)=>{var n;return(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.disabled)||e.push(f(t)),e}),[]);(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(xn);const o=n.indexOf(e.props.activeValue);-1===o&&n.length?e.props.activeValue=n[0]:"ArrowDown"===t.key&&n.length>o+1?e.props.activeValue=n[o+1]:"ArrowUp"===t.key&&o>0&&(e.props.activeValue=n[o-1]),p(e)}else if("Enter"===t.key){if(t.preventDefault(),e.props.activeValue){const t=e.props.options.find((t=>f(t)===e.props.activeValue));t&&o(e,t,n)}}else"Backspace"!==t.key||n||e.props.selections.length&&function(e,t){const n=t.map((e=>f(e)));if(Array.isArray(e._value)){const t=e._value.filter((e=>!n.includes(e)));e.props.selections=[],e.input(t),e.props.activeValue=void 0}}(e,e.props.selections)}function o(e,t,n,o){function a(){const n=p.findIndex((e=>f(e)===f(t))),o=p.findIndex((t=>f(t)===f(e.props.selections[0]))),r=Math.min(n,o),s=Math.max(n,o),a=p.slice(r,s+1);e.props.selections=a}if(e.props.disabled)return;if(e.props.isSourceOption!==n&&(e.props.isSourceOption=n,e.props.selections=[]),e.props.isSourceOption&&Array.isArray(e._value)&&e._value.length>=e.props.max)return;const i=!!o&&(o.shiftKey&&e.props.selections.length);e.props.isSourceOption=n;const l=e.props.selections.map((e=>f(e)));if(l.includes(f(t))){const n=e.props.selections.findIndex((e=>f(e)===f(t)));return e.props.selections.splice(n,1),void(e.props.selections=[...e.props.selections])}const p=n?e.props.options:e.props.targetOptions;e.props.sourceSelected===!n?i?a():(e.props.selections=[...e.props.selections,t],e.props.sourceSelected=n):i?a():e.props.selections=[...e.props.selections,t],e.props.transferOnSelect&&(n?r(e):s(e))}function r(e){if(Array.isArray(e._value)){e.props.optionsLoader||!1===e.props.clearOnSelect||(e.props.inputText=void 0);const t=e.props.selections.map((e=>f(e))),n=[...e._value,...t];e.input(n),e.props.selections=[]}}function s(e){if(Array.isArray(e._value)){const t=e.props.selections.map((e=>f(e))),n=e._value.filter((e=>!t.includes(e)));if(e.input(n),e.props.optionsLoader){const t=[...e.props.options];e.props.options=[...t]}e.props.selections=[]}}function i(t){let n=null,o="",r=[];if(e.props.mouseOnSource){if(n=Yi.has(e),o=`${e.props.id}_source_list_item`,r=[...e.props.options],!r||!r.length||n)return r=[],o="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Ri.has(e),o=`${e.props.id}_target_list_item`,r=[...e.props.targetOptions],!r||!r.length||n))return r=[],o="",void(n=null);const s=r.reduce(((e,t,n)=>{var r;if(null===(r=t.attrs)||void 0===r?void 0:r.disabled)return e;const s=document.getElementById(o+`_${n}`);return s&&e.push([s,t]),e}),[]),a=document.getElementById(`${e.props.id}_load_more`);a&&s.push([a,e.props.loadMoreOption]),e.props.mouseOnSource&&Yi.add(e),e.props.mouseOnTarget&&Ri.add(e),s.length&&l(e,s,null,t)}function l(e,t,n,o){var r,s,a;const d=o,u=d?d.getBoundingClientRect():{top:0,bottom:0};if(n=null,e.props.trackHover){if(e.props.mouseY>u.top&&e.props.mouseY<u.bottom){let o=n||0,r=n;const s=(t,o)=>{var r;const s=o[0],{y:a,height:i,x:l,width:p}=s.getBoundingClientRect();if(e.props.mouseX>l&&e.props.mouseX<l+p&&e.props.mouseY>a&&e.props.mouseY<a+i){n=t;const s=o[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?f(s):void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==r&&s(r,t[r]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==o||null!==r)}null===n&&(e.props.activeValue=void 0)}else p(e);e.props.mouseOnSource||e.props.mouseOnTarget?(d&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&d.scrollTop+d.offsetHeight>d.scrollHeight-200&&e.props.mouseOnSource&&(e.props.allowAppendOptions=!0,null===(a=e.context)||void 0===a||a.handlers.loadMore(!1)),e.props.mouseOnSource&&Yi.has(e)||e.props.mouseOnTarget&&Ri.has(e)?requestAnimationFrame(l.bind(null,e,t,n,o)):i(o)):(Yi.delete(e),Ri.delete(e))}function p(e){const t=document.getElementById(e.props.activeDescendant);t&&t.scrollIntoView({block:"nearest",inline:"start"})}e.props.memoOptions=[],e.props.targetOptions=[],e.props.targetOptionValues=[],e.props.multiple=!0,e.props.loadingCounter=0,e.props.page=1,e.props.hasNextPage=w.bind(null,e),e.props.applyLoadedOptions=X,e.on("created",(()=>{if(e._value||e.input([]),e.props.options||(e.props.options=[]),e.props.disabled=Wt.undefine(e.props.disabled),e.props.searchable=Wt.undefine(e.props.searchable),void 0===e.props.clearOnSelect?e.props.clearOnSelect=!0:"false"===e.props.clearOnSelect&&(e.props.clearOnSelect=!1),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>f(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.selections=[],e.props.sourceSelected=!1,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.props.optionsLoader&&0===e.props.options.length?h(e):e.props.optionsLoader||0!==e.props.options.length||(e.props.showSourceEmptyMessage=!0),e.context){function t(e){return e._value?e._value:[]}function i(e){return e.props.options.map((e=>f(e))).filter((t=>!e.props.targetOptionValues.includes(t)))}function l(e){return qi&&d(e)}function p(e){return qi&&d(e,!1)}function d(e,t=!0){if(!e.props.selections)return[];const n=e.props.selections.map((e=>f(e))),o=[];for(const e of n){const n=t?".formkit-source-list-items":".formkit-target-list-items",r=document.querySelector(`[data-type="transferlist"] ${n} [data-value="${e}"]`);r&&o.push(r)}return o}function u(t){t.stopImmediatePropagation(),t.detail&&e.props.options.find((n=>{f(n)===t.detail.value&&(e.props.selections=[n])})),e.props.trackHover=!1}function c(e){return"true"!==e.getAttribute("data-disabled")&&!e.classList.contains("formkit-source-empty-message")&&!e.classList.contains("formkit-target-empty-message")}function g(e){return e.props.disabled||e.props.max&&Array.isArray(e._value)&&e._value.length>=e.props.max}function m(e){return e.props.disabled}if(e.context.handlers.loadMore=k.bind(null,e),e.context.fns.isActive=t=>Wt.eq(e.props.activeValue,f(t))||void 0,e.context.fns.optionValue=f,e.context.fns.isSelected=t=>e.props.selections.map((e=>f(e))).includes(f(t)),e.context.fns.getOptionCount=(t=!1)=>{const n=t?e.props.targetOptions:e.props.options;let o;return o=t?n.length:n.filter((t=>!e.props.targetOptionValues.includes(f(t)))).length,e.props.selections.length>0&&t!==e.props.isSourceOption?e.props.selections.length+"/"+o:o},e.context.handlers.clearSearch=()=>{e.props.inputText=void 0},e.context.handlers.selectOption=(t,n)=>o.bind(null,e,t,n),e.context.handlers.transferForward=r.bind(null,e),e.context.handlers.transferForwardAll=()=>{if(Array.isArray(e._value)){const t=e.props.options.filter((e=>!e.attrs||!e.attrs.disabled)).map((e=>f(e)));e.props.max&&t.length>e.props.max&&(t.length=e.props.max);const n=[...t];e.input(n),e.props.selections=[]}},e.context.handlers.transferBackward=s.bind(null,e),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e._value)&&(e.input([]),e.props.selections=[])},e.context.handlers.onSearch=t=>{const n=t.target;e.props.inputText=""===n.value?void 0:n.value,function(e,t,n=!1){if("function"==typeof e.props.optionsLoader){if(n&&(e.props.options=[]),e.props.search=t,clearTimeout(Ki.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);Ki.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else if(Array.isArray(e.props.initialOptions)&&"string"==typeof t){const n=[...e.props.initialOptions].filter((t=>Array.isArray(e._value)&&!e._value.includes(f(t))));e.props.options=n.filter((n=>e.props.filter(n,t,e)))}}(e,n.value)},e.context.handlers.sourceKeyDown=t=>n(e,t,!0),e.context.handlers.targetKeyDown=t=>n(e,t,!1),e.context.handlers.onMouseEnter=t=>()=>{t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0},e.context.handlers.onMouseLeave=t=>()=>{t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1},qi){a(e.props.id+"_source_list_items",(n=>{a(`${e.props.id}`,(o=>{n instanceof HTMLElement&&o instanceof HTMLElement&&(n.addEventListener("dndNewValue",(t=>{if(t.stopImmediatePropagation(),!Array.isArray(e._value))return;const n=e._value.filter((e=>!t.detail.includes(e)));e.input([...n])})),o.addEventListener("dndNewValue",(t=>{t.stopImmediatePropagation(),e.input([...t.detail])})),n.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!0,u(t)})),o.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!1,u(t)})),document.addEventListener("dndDrop",(()=>{e.props.selections=[],e.props.trackHover=!0})),At(n,i.bind(null,e),{accepts:[o],dropBehavior:"append",childIsDraggable:c,isDisabled:g.bind(null,e)},l.bind(null,e)),At(o,t.bind(null,e),{accepts:[o,n],childIsDraggable:c,isDisabled:m.bind(null,e)},p.bind(null,e)))}))}));const v=t=>{e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,o=document.getElementById(n);if(o){const n=o.getBoundingClientRect();t.clientX>n.x&&t.clientX<n.x+n.width&&t.clientY>n.y&&t.clientY<n.y+n.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",v)}}})),e.on("commit",(({payload:n})=>{if(n===ji.get(e)&&void 0!==ji.get(e))return;if(ji.set(e,n),qi&&void 0!==n&&"function"==typeof e.props.optionLoader){const o=T(e,n);if(e.props.multiple&&Array.isArray(n))if(n.forEach((t=>{L(e,t,Array.isArray(o)&&o.find((e=>Wt.eq(f(e),t))))})),e.props.loadingCounter){e.props.isLoadingOption=!0;const o=e.on("prop:loadingCounter",(()=>{e.props.loadingCounter||(e.props.isLoadingOption=!1,t(e,T(e,n)),e.off(o))}))}else t(e,T(e,n));return}const o=T(e,n);t(e,o)})),e.on("prop:inputText",(({payload:t})=>{t||(e.props.initialOptions.length&&(e.props.options=[...e.props.initialOptions]),e.props.optionsLoader&&(e.props.page=1,e.props.options=[],e.props.search=void 0,h(e)))})),e.on("prop:options",(({payload:t})=>{t&&t.length?(t.forEach((t=>{Array.isArray(e._value)&&e._value.includes(f(t))&&e.props.targetOptionValues.push(f(t))})),e.props.showSourceEmptyMessage=!1):t&&!t.length&&e.props.sourceEmptyMessage&&(e.props.showSourceEmptyMessage=!0)})),e.on("prop:activeValue",(({payload:t})=>{if(t===xn)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const n=e.props.options.findIndex((e=>Wt.eq(f(e),t)));e.props.activeDescendant=n>=0?`${e.props.id}_source_list_item_${n}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{if(t&&!0!==e.props.disabled){const t=document.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,Yi.delete(e),i(t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{if(t&&!0!==e.props.disabled){const t=document.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,Ri.delete(e),i(t)}})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(bn)})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(bn)}))},Yt.options,Yt.defaultIcon("moveRight","right"),Yt.defaultIcon("moveLeft","left"),Yt.defaultIcon("fastForward","fastForward"),Yt.defaultIcon("rewind","rewind"),Yt.defaultIcon("close","close"),Yt.defaultIcon("loader","spinner"),Yt.defaultIcon("selected","check"),Yt.localize("isLoading"),Yt.localize("loadMore"),Yt.localize("addAllValues"),Yt.localize("addSelectedValues"),Yt.localize("removeSelectedValues"),Yt.localize("removeAllValues")]};var Ui=Object.freeze({__proto__:null,dropdown:Yn,toggle:io,repeater:Ho,rating:nr,autocomplete:Ir,datepicker:Os,taglist:Qs,mask:Va,transferlist:zi});const Xi=setInterval,Zi=new WeakSet;exports.$if=c,exports.autocomplete=Ir,exports.createBaseSections=u,exports.createProPlugin=function(e,t={}){const n=e;try{if(!n)throw new Error("FormKitNoKey");function o(t){if(Zi.has(t)){const n=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:Zt(13919),children:`${Zt(451228594)}${Zt(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){tn[e]?tn[e].add(t):tn[e]=new Set([t])}(e,n)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const n=e.substring(3);if(!jt.test(n))return t();const o=parseInt(n,16).toString(),r=Number(o[0])<6?Number(o[0]):6,s=o.substring(r,r+(o.length-6)),a=o.substring(0,r)+o.substring(r+s.length),i=a.slice(0,2),l=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(i)/Number(l))&&t()}(n),o.library=n=>{if(n.props.type in t){const{schema:o,...r}=t[n.props.type];Zi.add(n),n.define({...r,schema:o(e)})}Xi((()=>en.has(e)&&n.emit(952679114..toString(32))),4e3)},o}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}},exports.createSectionFactory=d,exports.datepicker=Os,exports.dropdown=Yn,exports.inputs=Ui,exports.mask=Va,exports.rating=nr,exports.repeater=Ho,exports.taglist=Qs,exports.toggle=io,exports.transferlist=zi;
1
+ "use strict";function e(e,n){e in Mn||(Mn[e]={timer:0,inputs:new Set});const o=Mn[e];clearTimeout(o.timer),o.inputs.add(n),o.timer=_n(t.bind(null,e),500)}function t(e){if(wn){window.addEventListener(bn(),(t=>{const o=new URL(t.blockedURI).hostname;kn.some(((e,t)=>En(t)===o))&&(n(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=Tn(gn),r="://",s=(new Date).getDate(),a=async()=>{Dn(e);const l=Array.from(Mn[e].inputs),i=l.filter((t=>!(Sn[e]&&Sn[e].has(t)))).join("");if(i){t++;try{const a=await window[Tn($n)](`${o}${r}${En((s+t)%kn.length)}/${function(e){const t=Math.round(9*Math.random());let n="";for(let o=0;o<e.length;o++){let r=e.charCodeAt(o);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),n+=String.fromCharCode(r)}return`${t}${n}`}(`${e.substring(3)}x${i}`)}`),p=await a.json();if(p[Tn(vn)])return n(e,p.schema);if(a.ok)return Sn[e]||(Sn[e]=new Set),void l.forEach((t=>Sn[e].add(t)))}catch(e){}t<2&&_n(a,1e4*Math.random())}};a()}}function n(e,t){An.add(e),function(e,t){On[e]&&On[e].forEach((e=>e(t)))}(e,t)}function o(t,n,o){if(e(n,o),!n)throw new Error("FormKitNoKey");return Ln[n]||(Ln[n]=_n((()=>An.add(n)),3e3)),An.has(n)?null:t}function r(e,t){return new Array(e).fill("").map(((e,n)=>t(n)))}function s(e){const t=e&&un.isObject(e)&&e.__v_raw;return t?s(t):e}function a(e,t){if(wn){const n=document.getElementById(e);if(n)return t(n);const o=new MutationObserver((()=>{const n=document.getElementById(e);n&&(o.disconnect(),t(n))}));o.observe(document.body,{childList:!0,subtree:!0})}}function l(e){return un.isRecord(e)&&"value"in e&&"label"in e}function i(e){return e?e.reduce(((e,t)=>{var n;return(null===(n=e.at(-1))||void 0===n?void 0:n.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function p(e,t,n,r){return(...s)=>a=>l=>{const i=function(e,t,n,r,s,a){const l=a[n],i="function"==typeof r?r():{$el:r},p=s.map((e=>"string"==typeof e?e:e(t)(a)));let c=p.length&&i?mn.extendSchema(i,{children:p}):i;if(c=mn.extendSchema(c,l),"object"==typeof c){let s=c;if(!fn.isDOM(c)&&!fn.isComponent(c)||c.meta||(c.meta={section:n,node:r}),fn.isDOM(c)){const{$el:r,...a}=c;a.attrs?"class"in a.attrs||"if"in a.attrs||(a.attrs={class:`$classes.${n}`,...a.attrs}):a.attrs={class:`$classes.${n}`},s=d(t,n,Object.defineProperty(a,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if(fn.isComponent(c)){const{$cmp:r,...a}=c;s=d(t,n,Object.defineProperty(a,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else"$formkit"in c&&(c.outerClass=`$classes.${n}`);return s}return d(t,n,c)}(e,a,t,n,s,l);return r&&un.isRecord(i)&&(i.memo=e+JSON.stringify(l)),r?[i]:i}}function d(e,t,n){const o=n=>e?n||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:o},then:{enumerable:!1,get:o},else:{enumerable:!1,get:o.bind(null,n)}})}function c(e){return(t,n,o=!1)=>p(e,t,n,o)}function u(e){return{outer:e("outer",Pn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",Nn,!1),icon:zn,label:e("label",Wn,!1),prefix:e("prefix",Kn,!1),suffix:e("suffix",Kn,!1),help:e("help",Rn,!1),messages:e("messages",Fn,!1),message:e("message",Yn,!1)}}function f(e){return{overlayPlaceholder:e("overlayPlaceholder",jn),overlayLiteral:e("overlayLiteral",qn),overlayChar:e("overlayChar",Un),overlayEnum:e("overlayEnum",Zn),overlay:e("overlay",Xn),overlayParts:e("overlayParts",Jn),overlayInner:e("overlayInner",Gn)}}function m(e,t,n){return o=>r=>{const s="string"==typeof t?t:t(o)(r);return n?{if:e,then:s,else:"string"==typeof n?n:n(o)(r)}:(mn.isSlotCondition(s)?Object.assign(s.else,{if:e}):mn.isSchemaObject(s)&&Object.assign(s,{if:e}),s)}}function h(e){return"__original"in e?e.__original:e.value}function g(e,t=!0){e.store.set(no),e.props.loadingCounter++,e.store.set(fn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const n=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,eo.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(o instanceof Promise?o.then(((...t)=>{void 0!==e.props.nonceKey&&n!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(o))).finally((()=>{e.props.loadingCounter--}))}function v(e,t,n){const o=mn.normalizeOptions(n),r=[...o,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(o),t&&r&&(e.props.activeValue=h(r))}function $(e,t){new MutationObserver((()=>{const n=e.props.positionListBox(t);Qn.delete(e),y(e,n);let o,r=null;const s=new ResizeObserver((()=>{clearTimeout(o),o=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),r||(r=e.on("prop:expanded",(()=>{s.disconnect(),e.off(r)})))}),100)}));s.observe(t)})).observe(t,{childList:!0,subtree:!0})}function y(e,t){if(!e.props.expanded||!e.props.options||!e.props.options.length||Qn.has(e))return;const n=e.props.options.reduce(((t,n,o)=>{var r;if(null===(r=n.attrs)||void 0===r?void 0:r.disabled)return t;const s=document.getElementById(`${e.props.id}_listitem_${o}`);return s&&t.push([s,n]),t}),[]),o=document.getElementById(`${e.props.id}_load_more`);o&&n.push([o,e.props.loadMoreOption]),Qn.add(e),n.length&&w(e,n,t)}function b(e,t){let n=null;if(e.props.activeDescendant){n=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>un.eq(e.value,h(t)))),-1===n&&(n=null);document.getElementById(e.props.activeDescendant)&&k(e)}if("undefined"==typeof window)return n;const o=t.getBoundingClientRect(),r=document.getElementById(`${e.props.id}`);if(r){const t=r.getBoundingClientRect();t.top+t.height+o.height>window.innerHeight&&t.top+t.height>o.height?e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"}:e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}}return n}function x(){}function w(e,t,n){var o,r,s;const a=document.getElementById(`${e.props.id}_dropdown_wrapper`);if(e.props.trackHover){const o=a?a.getBoundingClientRect():{top:0,bottom:0};if(n=null,e.props.mouseY>o.top&&e.props.mouseY<o.bottom){let o=n||0,r=n;const s=(t,o)=>{var r;const s=o[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){n=t;const s=o[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?h(s):void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==r&&s(r,t[r]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==o||null!==r)}null===n&&(e.props.activeValue=void 0)}e.props.trackHover||k(e),e.props.expanded?(a&&e.props.loadOnScroll&&!(null===(o=e.store.loading)||void 0===o?void 0:o.value)&&(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&a.scrollTop+a.offsetHeight>a.scrollHeight-200&&(e.props.allowAppendOptions=!0,null===(s=e.context)||void 0===s||s.handlers.loadMore(!1)),Qn.has(e)?requestAnimationFrame(w.bind(null,e,t,n)):y(e,n)):Qn.delete(e)}function k(e){const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),n=document.getElementById(e.props.activeDescendant);if(!t||!n)return;const{y:o,height:r}=n.getBoundingClientRect(),{y:s,height:a}=t.getBoundingClientRect();o<s?(e.props.ignoreScroll=!0,t.scrollTop=n.offsetTop):o+r>s+a&&(e.props.ignoreScroll=!0,t.scrollTop=n.offsetTop+r-a)}function _(e,t){e.props.page++,eo.set(e,t),e.store.set(fn.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function D(e){e.props.didLoadMore=!0,setTimeout((()=>{e.props.didLoadMore=!1}),300),g(e)}function L(...e){return t=>{t.addProps(["activeDescendant","activeValue","dropdownWrapperStyles","emptyMessage","expanded","forceExpanded","hasNextPage","isLoadingOption","listboxStyles","loadMoreOption","loadOnScroll","option","optionLoader","options","optionsLoader","page","placeholder","selections","showEmptyMessage"]),t.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},t.props.page=1,t.props.loadMoreOption={label:"Load more",value:ro},t.props.listboxStyles={},t.props.styleWrapper=x.bind(null,t),t.props.positionListBox=b.bind(null,t),t.props.hasNextPage=_.bind(null,t),t.props.applyLoadedOptions=v,t.props.loadingCounter=0,t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.disabled||void 0!==t.props.emptyMessage||(t.props.disabled=!0),t.props.disabled=un.undefine(t.props.disabled),t.on("created",(()=>{if(!t.context)return;t.props.trackHover=!0,t.props.loadOnScroll=un.undefine(t.props.loadOnScroll),t.props.forceExpanded=un.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.expanded=!0),t.context.touch=()=>{var e;null===(e=t.context)||void 0===e||e._value},t.context.handlers.loadMoreSelected=e=>{var n,o;t.props.allowAppendOptions=!0,null===(n=t.context)||void 0===n||n.handlers.loadMore(t),e instanceof MouseEvent&&(t.props.ignoreClickAway=!0,null===(o=document.getElementById(`${t.props.id}`))||void 0===o||o.focus())},t.context.handlers.loadMore=D.bind(null,t),t.context.handlers.click=e=>{if(t.props.disabled)return;document.getElementById(`${t.props.id}`)&&"mouse"!==e.pointerType?(t.props.mouseX=-1,t.props.mouseY=-1):(t.props.mouseX=e.clientX,t.props.mouseY=e.clientY),t.emit("click",e)};const e=t.context.handlers.blur;t.context.handlers.blur=n=>{t.props.expanded?setTimeout((()=>e(n)),300):e(n),t.emit("blur")},t.context.handlers.keydown=e=>{t.props.disabled||(t.props.trackHover=!1,t.emit("keydown",e))},t.context.handlers.selectOption=e=>()=>{t.emit("optionSelected",e)},t.context.fns.isActive=e=>un.eq(t.props.activeValue,h(e))||void 0,to&&(a(`${t.props.id}_dropdown_wrapper`,(e=>{"overscroll"!==t.props.behavior&&"none"===getComputedStyle(e).maxHeight&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,maxHeight:"400px"})})),a(`${t.props.id}_dropdown_wrapper`,$.bind(null,t)))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e||t.props.forceExpanded?"999":"-1",pointerEvents:e?"auto":"none"}}));const n=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};if(t.on("prop:trackHover",(({payload:e})=>{var o,r;to&&(e?null===(r=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===r||r.removeEventListener("scroll",n):null===(o=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===o||o.addEventListener("scroll",n))})),t.on("prop:activeValue",(({payload:e})=>{if(e===ro)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=t.props.options.findIndex((t=>un.eq(h(t),e)));t.props.activeDescendant=n>=0?`${t.props.id}_listitem_${n}`:void 0})),"undefined"!=typeof window){const e=e=>{e.target&&e.target instanceof Element&&e.target.closest(`#${t.props.id}_listbox`)||t.props.ignoreClickAway?t.props.ignoreClickAway=!1:(t._value||(t.props.searchValue=""),t.props.expanded=!1)},n=e=>{t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=document.getElementById(`${t.props.id}_dropdown_wrapper`);if(n){const o=n.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}};t.on("prop:expanded",(({payload:o})=>{o?(setTimeout((()=>document.addEventListener("click",e)),10),t.props.styleWrapper(),document.addEventListener("mousemove",n),t.props.optionsLoader&&0===t.props.options.length&&g(t)):(document.removeEventListener("click",e),document.removeEventListener("mousemove",n))}))}t.on("prop:loadingCounter",(({payload:e})=>{0===e&&t.store.set(oo)})),to&&window.addEventListener("blur",(e=>{e.target===window&&t.props.expanded&&(t.props.expanded=!1)})),e.map((e=>e(t)))}}function T(e,t,n){const o=e.props.optionLoader(t,n),r=e=>"string"==typeof e?{label:e,value:t}:l(e)?e:un.isRecord(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},s=t=>(Array.isArray(e.props.memoOptions)&&e.props.memoOptions.push(t),t);return o instanceof Promise?("transferlist"===e.props.type&&(e.props.targetLoading=!0),e.props.loadingCounter++,e.store.set(no),A(e),o.then((e=>{if("string"==typeof e||l(e))return s(r(e))})).finally((()=>{e.props.targetLoading=!1,e.props.loadingCounter--}))):s(r(o))}function E(e,t){return n=>{n.on("commit",(({payload:o})=>{if(o===so.get(n)&&void 0!==so.get(n))return;if(so.set(n,o),ao&&void 0!==o&&"function"==typeof n.props.optionLoader){const r=e(n,o);if(n.props.multiple&&Array.isArray(o))if(o.forEach((e=>{T(n,e,Array.isArray(r)&&r.find((t=>un.eq(h(t),e))))})),n.props.loadingCounter){n.props.isLoadingOption=!0;const r=n.on("prop:loadingCounter",(()=>{n.props.loadingCounter||(n.props.isLoadingOption=!1,t(n,e(n,o)),n.off(r))}))}else t(n,e(n,o));else if(!n.props.multiple&&!Array.isArray(r)&&o){const e=T(n,o,r);e instanceof Promise?(n.props.isLoadingOption=!0,e.then((e=>{t(n,e,o),n.props.isLoadingOption=!1}))):t(n,e,o)}return}const r=e(n,o);if(!ao||r||void 0===o||n.props.options&&n.props.options.length||"function"!=typeof n.props.optionsLoader)t(n,r,o);else{const r=g(n);t(n),r.then((()=>{t(n,e(n,o),o)}))}}))}}function M(e,t){const n=Array.isArray(e.props.options)?e.props.options:[],o=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(n);return!!o.length&&(e.props.multiple?!!Array.isArray(e.value)&&e.value.reduce(((e,t)=>{const n=o.find((e=>un.eq(t,h(e))));return n&&e.push(n),e}),[]):o.find((e=>un.eq(h(e),t)))||!1)}function S(e){if(!e.props.options||!e.props.options.length)return;const t=function(e){return e.props.options.find((t=>un.eq(h(t),e.value)))}(e);if(t)e.props.activeValue=t.value;else{const t=e.props.options.find((e=>{var t;return!(null===(t=null==e?void 0:e.attrs)||void 0===t?void 0:t.disabled)}));e.props.activeValue=null==t?void 0:t.value}}function A(e,t,n){var o;if(e.props.multiple&&Array.isArray(t))return e.props.option={label:t.map((e=>e.label)).join(", "),value:e.value},void(e.props.selections=t);"string"==typeof t?e.props.option={label:t,value:n}:t?e.props.option=t:t||null==n||(null===(o=e.store.loading)||void 0===o?void 0:o.value)?(e.props.option={label:e.props.placeholder||" ",value:void 0,isPlaceholder:!0},e.props.selections=[]):e.props.option={label:n,value:n},e.props.option.isPlaceholder||(e.props.selections=[e.props.option])}function O(e){e.on("keydown",(({payload:t})=>{var n,o;if("Tab"===t.key&&e.props.expanded)t.preventDefault();else if(["ArrowDown","ArrowUp"].includes(t.key)&&e.props.expanded){t.preventDefault(),t.stopPropagation();const o=e.props.options;if(!Array.isArray(o)||!o.length)return;const r=o.reduce(((e,t)=>{var n;return(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.disabled)||e.push(h(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&r.push(ro);const s=r.indexOf(e.props.activeValue);-1===s&&r.length?e.props.activeValue=r[0]:"ArrowDown"===t.key&&r.length>s+1?e.props.activeValue=r[s+1]:"ArrowUp"===t.key&&s>0&&(e.props.activeValue=r[s-1])}else if(!e.props.expanded&&["ArrowDown","Up","Down","ArrowUp","Enter"].includes(t.key)&&e.props.id===(null===(o=document.activeElement)||void 0===o?void 0:o.id)){if(e.props.multiple&&e.props.max&&Array.isArray(e.value)&&e.value.length>=e.props.max)return;t.preventDefault(),!e.props.expanded&&e.isSettled&&(e.props.expanded=!0)}else if("Enter"===t.key&&e.props.expanded&&"taglist"!==e.props.type){if(t.preventDefault(),t.stopPropagation(),e.props.activeValue===ro)return void e.emit("optionSelected",e.props.loadMoreOption);const n=e.props.options.find((t=>un.eq(h(t),e.props.activeValue)));n&&e.emit("optionSelected",n)}else["Esc","Escape"].includes(t.key)?(t.preventDefault(),e.props.expanded=!1):e.emit("unusedKeyDown",t)}))}function I(e){e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t=>un.eq(e.value,h(t)))})),e.on("prop:expanded",(({payload:t})=>{t&&S(e)})),e.on("optionSelected",(({payload:t})=>{var n,o,r;h(t)!==ro?(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||(e.props.skipNextFilter=!0,e.input(h(t)),e.props.expanded=!1,e.props.id&&(null===(r=document.getElementById(e.props.id))||void 0===r||r.focus())):null===(n=e.context)||void 0===n||n.handlers.loadMore()}))}function C(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_dropdown_wrapper"',"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),n=e("listbox",(()=>({$el:"ul",if:"$expanded || $forceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant"}}))),o=e("listitem",(()=>({$el:"li",for:["option","index","$options"],bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$fns.isSelected($option)","data-is-active":"$fns.isActive($option)"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.loadMoreSelected","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)"}}))),s=e("loadMoreInner","span"),a=e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),l=e("emptyMessageInner","span"),i=e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}})));return()=>t(n(a(l("$emptyMessage")),o(m("$fns.isSelected($option)",zn("selected")),i("$option.label")),r(s(m("$state.loading",zn("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))}function B(e){if("undefined"==typeof window)return;const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),n=document.getElementById(`${e.props.id}`);if(!n||!t)return;const o=t.style.paddingTop,r=t.style.paddingBottom,s=t.style.paddingLeft;t.style.paddingTop="0",t.style.paddingBottom="0",t.style.paddingLeft="0";const a=n.getBoundingClientRect(),l=t.getBoundingClientRect(),i=Math.round(a.top-l.top)+"px",p=Math.round(a.left-l.left-5)+"px",d=Math.max(Math.round(Math.min(l.height-l.top,window.innerHeight)-(a.top+a.height)),0)+"px";t.style.paddingTop=o,t.style.paddingBottom=r,t.style.paddingLeft=s,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:i,paddingLeft:p,paddingBottom:d},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${a.width+"px"}, calc(100vw - 4em))`:a.width+"px",maxWidth:"calc(100vw - 4em)"}}function V(e,t){let n=null;if(e.props.activeDescendant){const o=document.getElementById(e.props.activeDescendant);if(!o)return n;e.props.ignoreScroll=!0;const r=document.getElementById(`${e.props.id}_listbox`);if(!r)return n;const s=t.getBoundingClientRect(),a=r.getBoundingClientRect(),l=parseInt(getComputedStyle(t).paddingTop),i=parseInt(getComputedStyle(t).paddingBottom),p=o.offsetTop-l,d=Math.max(p-l,0),c=Math.max(t.scrollHeight-i-p-s.height,0),u=a.height-d-c;t.scrollTop=p;const f=()=>{t.scrollTop=c>0?c<l?t.scrollHeight:l:d<i?0:p-i},m=Math.min(150,a.height);d>0&&c>0||0===d&&0===c||u>m?t.scrollTop=p:f();t.clientHeight/2<t.scrollTop&&(n=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>un.eq(e.value,h(t))))),-1===n&&(n=null)}return n}function H(e){return"radio"===e.props.type&&(e.props.altName=`${e.name}_${$r++}`),!0}function P(e){return!un.isObject(e)||"__key"in e||"__shim"in e||Object.defineProperty(e,"__key",{enumerable:!1,writable:!0,value:un.token()}),e}function N({payload:e}){if(e.props.min=void 0!==e.props.min?Number(e.props.min):1,e.props.max=void 0!==e.props.max?Number(e.props.max):1/0,e.props.min>e.props.max)throw Error("Repeater: min must be less than max");if(e.props.disabled=un.undefine(e.props.disabled),Array.isArray(e.value))if(e.value.length<e.props.min){const t=r(e.props.min-e.value.length,(()=>({})));e.input(e.value.concat(t),!1)}else e.value.length>e.props.max&&e.input(e.value.slice(0,e.props.max),!1);else e.input(r(e.props.min,(()=>({}))),!1);e.context&&(e.context.fns.createRemover=e=>()=>{var t,n;null===(t=fn.getNode(e))||void 0===t||t.each((e=>e.destroy())),null===(n=fn.getNode(e))||void 0===n||n.destroy()},e.context.fns.createInsert=t=>()=>{if(Array.isArray(e.value)){const n=e.value.findIndex((e=>e.__key===t)),o=e.value;o.splice(n+1,0,{}),e.input(o,!1)}},e.context.fns.createShift=(e,t)=>()=>{const n=fn.getNode(e);if(!n||!n.parent)return;const o=n.index+t;o>=0&&o<n.parent.children.length&&(n.index=n.index+t)},e.context.fns.createAppend=()=>()=>{if(Array.isArray(e.value)){const t=e.value;t.push({}),e.input(t,!1)}})}function W(e,t){const n=e._c.children.find((e=>e.props.id===t));n&&(n.props.preserve=!0,n.destroy())}function F(e,t,n,o){if(Array.isArray(e)){const r=function(e,t){const n=e.map((e=>e.__key));return t.children.reduce(((e,t,o)=>{const r=t.props.id;return r&&!n.includes(r)&&e.set(o,r),e}),new Map)}(e,t);e.forEach(((s,a)=>{P(s);const[l,i]=function(e,t,n,o,r){if(!n.has(e.__key)&&!e.__shim&&!Object.isFrozen(e)){const s=r&&r.get(t);e.__key=un.token();const a=Object.freeze(Object.defineProperties({},{__key:{value:e.__key},__original:{value:e},__index:{value:t},__prevKey:{value:s}}));return n.add(e.__key),o.value++,[!0,a]}return[!1,e]}(s,a,n,o,r);l&&(e.splice(a,1,i),W(t,i.__prevKey),r.delete(a))})),r.size&&r.forEach((n=>{const o=e.findIndex((e=>e.__key===n));-1!==o&&e.splice(o,1),W(t,n)})),yr.delete(t)}return e}function Y(e,t){t.sort(((e,t)=>"__shim"in e||"__shim"in t?"__shim"in t&&!("__shim"in e)?-1:1:"__index"in e&&"__index"in t?e.__index>t.__index?1:-1:0)),e._c.children.sort(((e,n)=>{const o=t.findIndex((t=>t.__key===e.props.id)),r=t.findIndex((e=>e.__key===n.props.id));return-1!==o&&-1!==r?o>r?1:-1:-1===o&&-1==r?0:o>-1?1:-1}))}function R(e,t){return"group"===t.type&&t.hook.input(((n,o)=>(void 0===n?n={__shim:!0}:(P(n),e.has(n.__key)||n.__shim||!t.parent||yr.add(t.parent)),o(n)))),!1}function K(e,t,n){void 0===e.props[t]&&(e.props[t]=n)}function z(e,t){var n;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let o;t instanceof MouseEvent?o=t.clientX:(o=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let r=U(e,o,t.currentTarget)||0;r=r>e.props.min?r:e.props.min,r=r<e.props.max?r:e.props.max,e.input(r),null===(n=document.getElementById(`${e.props.id}`))||void 0===n||n.focus()}}function j(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){X(e,U(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function q(e){X(e)}function U(e,t,n){const o=n.getBoundingClientRect();return function(e,t){const n=1/(t||1);return Math.ceil(e*n)/n}((t-o.x)/o.width*e.props.max,e.props.step)}function Z(e){setTimeout((()=>{const t=document.getElementById(`${e.props.id}`);t&&(e.props.wrapperWidth=`0 0 ${t.offsetWidth/e.props.max}px`)}))}function X(e,t){let n=0;n=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const o=100-n;e.props.onWidth=n,e.props.offWidth=o}function G(e,t,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,v(e,t,n);const o=mn.normalizeOptions(n);e.props.options=o,e.props.options.length||(e.store.set(oo),e.store.set(fn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),S(e),Rr.set(e,e.props.searchValue)}function J(e){var t;e.props.max&&e.props.multiple&&Array.isArray(e._value)&&e._value.length>=e.props.max||e.props.disabled||!e.props.optionsLoader&&!e.props.options.length||(e.props.expanded=!e.props.expanded,e.props.expanded&&(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()))}function Q(e,t,n=!0){return()=>{e.props.multiple?(e.emit("optionRemoved",t),e.props.searchValue=""):(e.input(void 0),e.props.searchValue=""),n&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)}}function ee(e,t=!1){if("function"==typeof e.props.optionsLoader){if(t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(Fr.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);Fr.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else Array.isArray(e.props.options)&&(Wr.add(e),"string"==typeof e.props.searchValue&&(e.props.options=e.props.initialOptions.filter((t=>e.props.filter(t,e.props.searchValue,e))),e.props.options.length||e.props.emptyMessage||(e.props.expanded=!1)));e.props.skipNextFilter=!1,S(e)}function te(e,t){var n;const o=e.props.highlightedRange,r=o.index,s=o.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(n=e.props.inputText)||void 0===n?void 0:n.length)-a+(t.length-1>o.index?-1:0)]}function ne(e,t){const n=document.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=Kr.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Kr.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function oe(e){Kr.delete(e)}function re(e){setTimeout((()=>{document.activeElement&&document.activeElement.id===e.props.id||e.props.expanded&&(e.props.expanded=!1)}),300)}function se(e,t){const n=t.target;e.props.expanded=!(!e.props.optionsLoader&&!e.props.options.length&&!e.props.emptyMessage),e.props.searchValue=n.value,""===e.props.searchValue&&(e.props.options&&!e.props.options.length&&(e.props.expanded=!1),e.input(void 0))}function ae(e,t){const n=t.target;e.props.expanded=!(!e.props.optionsLoader&&!e.props.options.length&&!e.props.emptyMessage);const o=n.value;e.props.inputText=o,""===e.props.inputText&&e.props.options&&!e.props.options.length?e.props.expanded=!1:e.props.expanded=!0,"option"!==e.props.selectionAppearance?""===o?(e.props.searchValue=null,e.input([])):!e._value||Array.isArray(e._value)&&!e._value.length?e.props.searchValue=o:Array.isArray(e._value)&&e._value.length&&(e.props.searchValue=function(e){var t;const n=le(e);if(e.props.highlightedRange){const[t,o]=te(e,n);return e.props.inputText.slice(t,o)}return e.props.inputText.slice((null===(t=n[n.length-1])||void 0===t?void 0:t.end)+2)}(e)):e.props.searchValue=o}function le(e){const t=e.props.getSelections(e,e._value);return Array.isArray(t)&&t.length?t.reduce(((e,n,o)=>{var r;const s=(null===(r=e[o-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==o&&a++,0!==o&&a++,e.push({option:n,index:o,start:s,end:s+n.label.length+a}),e}),[]):[]}function ie(e){clearTimeout(Yr.get(e)),Yr.set(e,setTimeout((()=>{var t,n,o;const r=document.getElementById(`${e.props.id}`);if(r instanceof HTMLInputElement){const s=le(e),a=s.findIndex((e=>null!==r.selectionStart?r.selectionStart>=e.start&&r.selectionStart<=e.end:null!==r.selectionEnd&&(r.selectionEnd>=e.start&&r.selectionEnd<=e.end))),l=null===(t=s[s.length-1])||void 0===t?void 0:t.end;if(0===r.selectionStart&&r.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(s.length){const t=e.props.highlightedRange,[n,o]=te(e,s);if(null!==r.selectionEnd&&(r.selectionEnd<n||r.selectionEnd>o)){const s=t.end-t.start-(o-n),a=r.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,r.value=e.props.inputText,r.selectionStart=r.selectionEnd=a+(a>n?s:0)}}}else if(a>=0&&null!==r.selectionStart&&(l!==(null===(o=e.props.inputText)||void 0===o?void 0:o.length)||r.selectionStart<l)){const t=s[a],n=e.props.inputText.substr(0,l),o=t.start+(t.index>0?1:0),i=t.end+(s.length-1>t.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,r.value=n),e.props.highlightedRange=t,r.selectionStart=o,r.selectionEnd=i}else e.props.highlightedRange=void 0,e.emit("scrollToEnd");if(null!==r.selectionStart&&r.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)&&null===e.props.searchValue){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e._value)&&e._value.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}function pe(e){e.on("prop:option",(()=>{if(Array.isArray(e._value)&&e._value.length>=Number(e.props.max)){const t=document.getElementById(`${e.props.id}`);t&&t.blur()}})),"option"===e.props.selectionAppearance?(e.on("prop:option",(()=>{e.props.inputText="",void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("blur",(()=>{e.props.inputText=""})),e.on("optionSelected",(({payload:t})=>{t.value!==ro&&(!1!==e.props.closeOnSelect&&(e.props.expanded=!1),e.props.searchValue="")}))):function(e){e.props.searchValue=null;const t=(t,n=!1)=>{var o;const r=document.getElementById(`${e.props.id}`);if(!(r instanceof HTMLInputElement))return!1;const s=le(e),a=t>=0?t:s.length-1;if(void 0===s[a])return!1;const l=null===(o=s[a])||void 0===o?void 0:o.end;return null!==r.selectionStart&&(!n||r.selectionStart>=l&&r.selectionStart<=l+2)&&(r.selectionStart=s[a].start+(a>0?1:0),r.selectionEnd=s[a].end+(a<s.length-1?-1:0),!0)};let n;e.on("selectRange",(({payload:e})=>t(...e))),e.on("keydown",(({payload:n})=>{var o,r,s,a;if(["ArrowRight","ArrowLeft"].includes(n.key)&&n.target instanceof HTMLInputElement&&null!==n.target.selectionEnd&&null!==n.target.selectionStart){if(0===n.target.selectionStart&&n.target.selectionEnd===(null===(o=e.props.inputText)||void 0===o?void 0:o.length))"ArrowLeft"===n.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=le(e),o=null===(r=t[t.length-1])||void 0===r?void 0:r.end;n.target.selectionStart<o&&(n.target.selectionStart=Math.max(0,"ArrowLeft"===n.key?n.target.selectionStart-2:n.target.selectionEnd+2))}}else["Delete","Backspace"].includes(n.key)?e.props.highlightedRange&&!e.props.searchValue?e.emit("optionRemoved",e.props.highlightedRange.option):n.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&n.preventDefault()):n.target instanceof HTMLInputElement&&0===n.target.selectionStart&&n.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length&&n.preventDefault();"ArrowLeft"===n.key&&t(-1,!0)&&n.preventDefault(),ie(e)})),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&n!==t.option&&(n=t.option,e.props.activeValue=h(t.option))})),e.on("scrollToEnd",(()=>{const t=document.getElementById(`${e.props.id}`);t&&t.scrollTo({left:t.scrollWidth,behavior:"smooth"})})),e.on("prop:option",(({payload:t})=>{if(!t.isPlaceholder){let n="";if(jr){const t=document.getElementById(`${e.props.id}`);if(document.activeElement===t&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}!1!==e.props.closeOnSelect&&(e.props.expanded=!1),e.props.inputText=t.label+n}})),e.on("blur",(()=>{if(e._value){const t=e.props.option;un.isRecord(t)&&void 0!==t.value?e.props.inputText=t.label:e.props.inputText=""}else e.props.inputText=""}))}(e),e.on("commit",(()=>{void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("created",(()=>{if("option"!==e.props.selectionAppearance&&function(e){a(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&zr.set(t,e)})),jr&&!qr&&(qr=!0,document.addEventListener("selectionchange",(()=>{if(document.activeElement instanceof HTMLInputElement&&zr.has(document.activeElement)){const e=zr.get(document.activeElement);e&&ie(e)}})))}(e),e.props.option&&Array.isArray(e.props.option.value))for(const t of e.props.option.value)e.props.initialOptions.find((n=>{h(n)===t&&e.props.memoOptions.push(n)}));e.context&&(e.context.handlers.input=ae.bind(null,e))})),e.on("optionRemoved",(async({payload:t})=>{if(Array.isArray(e._value)){let n=-1;await e.input(e._value.filter(((e,o)=>e!==h(t)&&!un.eq(e,h(t))||(n=o,!1)))),e._value.length?setTimeout((()=>e.emit("selectRange",[n])),20):e.props.expanded=!1}})),e.on("prop:expanded",(({payload:t})=>{t||(e.props.searchValue="")}))}function de(e){return t=>{let n;t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange"]),t.props.memoOptions=[],t.props.initialOptions=t.props.options,t.props.applyLoadedOptions=G,t.props.getSelections=e,t.props.nonceKey="searchValue",t.props.multiple=un.undefine(t.props.multiple),t.props.selectionAppearance="option"===t.props.selectionAppearance?"option":"text-input","function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.props.selectionStyles={position:"absolute",pointerEvents:"none",width:"100%",left:"0",top:"0",bottom:"0",opacity:"0",overflow:"hidden"},t.props.multiple?(t.addProps(["max","closeOnSelect"]),function(e){function t(t){return!!Array.isArray(e.value)&&e.value.some((e=>un.eq(e,h(t))))}e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t)})),e.on("optionSelected",(({payload:n})=>{var o,r,s;if(h(n)===ro)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());if(null===(r=null==n?void 0:n.attrs)||void 0===r?void 0:r.disabled)return;const a=Array.isArray(e._value)?e._value:[];t(n)?e.emit("optionRemoved",n):(e.props.memoOptions=[...e.props.memoOptions,n],e.props.highlightedRange?(a.splice(e.props.highlightedRange.index,1,h(n)),e.input(a),e.props.highlightedRange=void 0,e.props.expanded=!1):(e.input(a.concat(h(n))),e.emit("scrollToEnd"))),e.props.id&&(null===(s=document.getElementById(e.props.id))||void 0===s||s.focus())}))}(t),pe(t)):(I(t),function(e){e.props.searchValue="",e.on("created",(()=>{e.context&&(e.context.handlers.input=se.bind(null,e))})),e.on("input",(({payload:t})=>{const n=e.props.getSelections(e,t);e.props.searchValue=n&&(null==n?void 0:n.label)||e.props.searchValue,e.props.selectionStyles={...e.props.selectionStyles,opacity:void 0===t?"0":"1",pointerEvents:void 0===t?"none":"auto"}})),e.on("optionSelected",(({payload:t})=>{t.value!==ro&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)})),e.on("prop:option",(({payload:t})=>{un.isRecord(t)&&!t.isPlaceholder?(e.props.skipNextFilter=!0,e.props.searchValue=t.label):t.isPlaceholder&&(e.props.searchValue="")})),e.on("blur",(()=>{setTimeout((()=>{var t;if(e.props.didLoadMore)return e.props.didLoadMore=!1,void(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus());if(e._value){const t=e.props.option;un.isRecord(t)&&void 0!==t.value?e.props.searchValue=t.label:e.props.searchValue=""}else e.props.searchValue=""}),150)}))}(t)),t.on("prop:options",(({payload:e})=>{e&&e.length?t.props.showEmptyMessage=!1:e&&!e.length&&t.props.searchValue&&t.props.emptyMessage&&(t.props.showEmptyMessage=!0),"function"!=typeof t.props.optionsLoader&&(Wr.has(t)?Wr.delete(t):(t.props.initialOptions=[...e],setTimeout((()=>ee(t)),0)))})),t.on("click",(()=>{t.props.openOnClick&&(t.props.trackHover=!1,t.props.expanded=!0)})),t.on("focus",(()=>{t.props.openOnClick&&(t.props.trackHover=!1,t.props.expanded=!0)})),t.on("created",(()=>{t.props.openOnClick=un.undefine(t.props.openOnClick),t.context&&(t.context.handlers.toggleListbox=J.bind(null,t),t.context.handlers.removeSelection=Q.bind(null,t),t.context.handlers.touchmove=ne.bind(null,t),t.context.handlers.touchend=oe.bind(null,t),t.context.handlers.focusOut=re.bind(null,t),t.context.handlers.focus=()=>{if(t.emit("focus"),document&&t.props.multiple&&"option"!==t.props.selectionAppearance){const e=new Event("selectionchange");document.dispatchEvent(e)}})})),t.on("keydown",(({payload:e})=>{"option"!==t.props.selectionAppearance||!t._value||t.props.isLoadingOption||t.props.multiple||(["Backspace","Delete"].includes(e.key)||"Tab"!==e.key)&&e.preventDefault()})),t.on("prop:expanded",(({payload:e})=>{e&&t.props.searchValue?ee(t,!0):e||Rr.delete(t)})),t.on("prop:searchValue",(({payload:e})=>{t.props.multiple||(t.props.inputText=e),!1==!!e&&!1==!!n||(e!==n&&ee(t),null!==n&&null===e&&!1!==t.props.closeOnSelect&&(t.props.expanded=!1),n=e)}))}}function ce(e,t=[],n,o){function r(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e instanceof DragEvent&&e.dataTransfer){e.dataTransfer.dropEffect="move";const t=e.currentTarget.parentNode;if(!t)return;const n=Zr.get(t),r=e.currentTarget;r.id="dropZone";const s=t.children;if(s&&s instanceof HTMLCollection)for(let e=0;e<s.length;e++)if(s[e]instanceof HTMLElement){const t=s[e];if(o&&!o(t))continue;Ur.set(t,{value:n[e],index:e})}const a=Ur.get(r);i=a.index,p=a.value,setTimeout((function(){const e=document.getElementById("dropZone");e&&e.classList.add("dropZone")}),1)}}function s(t){if(t.preventDefault(),t instanceof DragEvent&&t.relatedTarget!==t.currentTarget&&t.currentTarget&&t.currentTarget instanceof HTMLElement){const n=Ur.get(t.currentTarget),o=n.index,r=t.currentTarget;if(p===n.value)return;const s=document.getElementById("dropZone");r&&e&&s&&(o<i?e.insertBefore(s,r):e.insertBefore(s,r.nextSibling),i=o,p=n.value)}}function a(){const t=document.getElementById("dropZone"),r=null==t?void 0:t.parentNode;if(r&&e===r&&(r.removeEventListener("drop",a),t&&t.parentNode)){t.classList.remove("dropZone"),t.removeAttribute("id");const e=[],s=r.children;if(s&&s instanceof HTMLCollection){for(let t=0;t<s.length;t++)if(s[t]instanceof HTMLElement){const n=s[t];if(o&&!o(n))continue;const r=Ur.get(n);e.push(r.value)}Zr.set(r,e),n&&n(e)}}}function l(e){e.preventDefault(),a()}let i=0,p=null;if(Xr.has(e))Zr.set(e,t),e.addEventListener("drop",a);else{const n=new MutationObserver((function(){const n=e,a=[];for(let e=0;e<n.children.length;e++){const t=n.children[e];(o&&o(t)||!o)&&a.push(t)}a.forEach(((e,n)=>{const o=Ur.get(e);t&&(o?Ur.set(e,{value:o.value,index:n}):Ur.set(e,{value:t[n],index:n})),e.setAttribute("draggable","true"),e.setAttribute("tabindex","0"),e.addEventListener("dragstart",r),e.addEventListener("dragend",l),e.addEventListener("dragenter",s)}))}));n.observe(e,{childList:!0}),e.addEventListener("drop",a),document.addEventListener("drop",a),Xr.add(e);const i=[];for(let t=0;t<e.children.length;t++){const n=e.children[t];(o&&o(n)||!o)&&i.push(n)}const p=[];for(let e=0;e<i.length;e++)i[e].setAttribute("draggable","true"),i[e].setAttribute("tabindex","0"),i[e].addEventListener("dragstart",r),i[e].addEventListener("dragend",l),i[e].addEventListener("dragenter",s),Ur.set(i[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);Zr.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function ue(e){function t(t){e.input(t)}function n(t){e.props.selectedTagValue=t.value}let o;e.addProps(["disableDragAndDrop","allowNewValues","multiple","max"]),e.props.disableDragAndDrop=un.undefine(e.props.disableDragAndDrop),"taglist"===e.props.type?(e.props.multiple=!0,e.props.selectionAppearance="option",e.props.allowNewValues=un.undefine(e.props.allowNewValues),o=e=>e.classList.contains("formkit-tag-wrapper")):"autocomplete"===e.props.type&&(o=e=>e.classList.contains("formkit-selection")),e.on("created",(()=>{e.context&&(e.context.handlers.selectTag=e=>n.bind(null,e))})),e.on("prop:loadingCounter",(({payload:n})=>{0===n&&Gr&&!e.props.disableDragAndDrop&&setTimeout((()=>{const n=document.getElementById(`${e.props.id}_selections`);n&&ce(n,e._value,t,o)}))})),e.on("commit",(({payload:n})=>{if(e.context&&Gr){const r=e.props.id;if(Gr&&r&&!e.props.disableDragAndDrop){const r=document.getElementById(`${e.props.id}_selections`);if(!r)return;ce(r,n,t,o)}}})),e.on("keydown",(({payload:t})=>{if(t.currentTarget instanceof HTMLElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)&&t.altKey){t.stopPropagation(),t.preventDefault();const n=document.activeElement,o=e.props.selections.find((t=>t.value===e.props.selectedTagValue)),r=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));"ArrowRight"===t.key?r<e.props.selections.length-1&&(e.props.selections.splice(r,1),e.props.selections.splice(r+1,0,o)):"ArrowLeft"===t.key&&r>0&&(e.props.selections.splice(r,1),e.props.selections.splice(r-1,0,o)),A(e,e.props.selections),e.input(e.props.selections.map((e=>e.value))),setTimeout((()=>{n.focus()}))}else if(t.target instanceof HTMLElement&&document.activeElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)){if("ArrowRight"===t.key){const n=t.target.nextElementSibling;if(n&&n instanceof HTMLElement&&n.getAttribute("data-value"))e.props.selectedTagValue=n.getAttribute("data-value"),n.focus();else if(n&&n instanceof HTMLElement&&n.id===e.props.id){const t=document.getElementById(e.props.id);t&&t.focus()}}else if("ArrowLeft"===t.key){const n=t.target.previousElementSibling;n&&n instanceof HTMLElement&&n.getAttribute("data-value")&&(e.props.selectedTagValue=n.getAttribute("data-value"),n.focus())}}else if("Enter"===t.key&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&t.currentTarget.id===e.props.id&&"taglist"===e.props.type){if(t.preventDefault(),e.props.activeValue===ro)return void e.emit("optionSelected",e.props.loadMoreOption);const n=e.props.options.find((t=>un.eq(h(t),e.props.activeValue)));n&&e.props.expanded?e.emit("optionSelected",n):e.props.allowNewValues&&e.props.inputText&&e.emit("optionSelected",{value:e.props.inputText,label:e.props.inputText})}else if(t.currentTarget&&t.currentTarget instanceof HTMLElement&&t.currentTarget.id!==e.props.id&&["Backspace"].includes(t.key)&&document.activeElement&&document.activeElement instanceof HTMLElement&&document.activeElement.id!==e.props.id){const t=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));if(-1===t)return;if(0===t&&1===e.props.selections.length)Q(e,e.props.selections[t],!0)();else if(t===e.props.selections.length-1){Q(e,e.props.selections[t],!0)(),e.props.selectedTagValue=e.props.selections[t-1].value;const n=document.activeElement.previousElementSibling;if(n){const e=n.getAttribute("data-value");n&&n instanceof HTMLElement&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}else{e.props.selectedTagValue=e.props.selections[t+1].value,Q(e,e.props.selections[t],!1)();const n=document.activeElement.nextElementSibling;if(n&&n instanceof HTMLElement){const e=n.getAttribute("data-value");e&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}}else if(["ArrowLeft"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd){if(t.stopPropagation(),0===e.props.selections.length)return;e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const n=t.currentTarget.previousElementSibling;n&&n instanceof HTMLElement&&n.focus()}else if(["Backspace"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd&&e.props.selections.length>0){t.stopPropagation(),e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const n=t.currentTarget.previousElementSibling;n&&n instanceof HTMLElement&&n.focus()}}))}function fe(e,t){var n;if(ca.has(e))return;ca.set(e,[]),t.reverse&&_a.add(e),t.prefix&&Da.set(e,t.prefix),t.suffix&&La.set(e,t.suffix),$e(e,t.pattern,t.partOverrides);const o=ha.get(e),r=null==o?void 0:o.some((e=>xe(e))),s=null==o?void 0:o.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(r&&s)throw new Error("Cannot use enums and groups in the same mask.");const a=r?"select":null!==(n=t.mode)&&void 0!==n?n:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&ga.add(e),va.set(e,a),t.onChange&&wa.set(e,t.onChange),e.addEventListener("beforeinput",(n=>{if(Ca)return;if(n.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(n=>{var o;n.preventDefault(),n.stopImmediatePropagation();const r=ca.get(e);if(null==r?void 0:r.length){const n=(null!==(o=ua.get(e))&&void 0!==o?o:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[n];if(!s)return;Oe(e,s),e.setSelectionRange(...s.selectionAfter),ua.set(e,n),wa.has(e)&&wa.get(e)(s,e)}}),{once:!0})}(e,n.inputType);n.preventDefault();const o=(r=n.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=De(e),a=e.value;o&&Le(e,{type:o,selectionBefore:s,data:n.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),tt(e);case"ArrowLeft":return t.preventDefault(),tt(e,-1);case"ArrowUp":return void(nt(e,1)&&t.preventDefault());case"ArrowDown":return void(nt(e,-1)&&t.preventDefault());case"Tab":return Ma?void t.preventDefault():void(tt(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const n=ga.has(e),o=va.get(e);if(n){let n=null,r=null,s=!1;const a="shift"===o?0:1,l=e.value;Ye(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===o?"":l,((e,t)=>(null===n&&"char"===t.type&&(n=e.pos-a),(be(t)||xe(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0))));const i=null!==(t=null!=r?r:s?l.length:n)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===va.get(e)){const[n]=Xe(e),o=rt(e,t);void 0!==o&&o in n&&(t=n[o])}return function(e,t,n=50){ya.set(e,Ee(e,t));const o=async()=>{if(!Ia||document.activeElement!==e)return;"select"===va.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=De(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Me(e,t);const[n]=Xe(e),o=rt(e,t),r=t[0];void 0!==o&&n.some((e=>r>=e[0]&&r<e[1]))&&ya.set(e,Ee(e,n[o]))}(e));const t=ya.get(e);t&&e.setSelectionRange(...t)};o(),document.addEventListener("selectionchange",o),setTimeout((()=>{document.removeEventListener("selectionchange",o),ya.delete(e)}),n)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(ya.get(e))return;it(e),t=Me(e,t);const[n]=Xe(e),o=rt(e,t),r=void 0!==o&&Ee(e,n[o]);r&&!_e(t,r)&&Ae(e,r,!0)}(e,t.detail))),Le(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function me(e){var t,n;if(Ea.has(e))return;const o=null!==(t=ca.get(e))&&void 0!==t?t:[],r=o[null!==(n=ua.get(e))&&void 0!==n?n:o.length-1];if(r){const t=r.selectionAfter,[n,o]=Xe(e,r.valueAfter),s=rt(e,t,[n,o]);if(void 0!==s&&s in n){const r=o[s],a=n[s],l=[t[0]-a[0],t[1]-a[0],"none"];Ea.set(e,[r,l])}}}function he(e){Ea.delete(e)}function ge(e,t){const n="string"==typeof e||!ca.has(e),o="string"==typeof e?ve(e):e;if(n)t.prefix&&Da.set(o,t.prefix),t.suffix&&La.set(o,t.suffix),o.value=Te(o,o.value),fe(o,t);else{const e=o.value;o.value="",Le(o,{type:"insert",selectionBefore:[0,0,"none"],valueBefore:"",data:e,suffix:t.suffix,prefix:t.prefix})}return o.value}function ve(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function $e(e,t,n,o,r){r=e&&_a.has(e)||r;const s=(null!=o?o:function(e){const t=Object.values(Aa);if(!e)return t;const n={...e},o=[];for(const r of t)if(!ke(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};ye(t)&&o.push(t),delete n[r.token]}else o.push(r);const r=Object.values(n);for(const e of r)ye(e)?o.push(e):console.warn(`Invalid ${e.type} token`,e);return o}(n)).sort(((e,t)=>{const n="token"in e?e.token.length:-1,o="token"in t?t.token.length:-1;return n===o?0:n>o?-1:1}));let a=[];[t,a]=function(e,t,n,o){let r,s=0,a="",l="",i="";const p=[];for(;a=Ie(e);)a===t&&r!==o?(s++,s>1&&(i+=a)):a===n&&s&&r!==o?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==o||a!==t&&a!==n?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce(((e,t,n)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+n}}`).replaceAll("{“!”}",t.token):e),t);const i=function(e,t,n){return e.reduce(((e,o)=>{const[r,s]=function(e){const[t,...n]=e.split("|"),o=n.reduce(((e,t)=>{const[n,o=!0]=t.split(":");return Object.assign(e,{[n]:o})}),{});return[t,o]}(o);let a=$e(null,r,void 0,t,n);a=a.map((e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t}));const l={type:"group",parts:a,...s};return e.push(l),e}),[])}(a,s,r).concat(s),p=/\{\$\d+\}/g,d=t.match(p),c=t.split(p).reduce(((e,t,n)=>{if(t&&e.push({type:"literal",value:r?[...t].reverse().join(""):t}),d&&d[n]){const t=d[n],o=Number(t.substring(2,t.length-1));!isNaN(o)&&i[o]&&e.push(i[o])}return e}),[]);return r&&c.reverse(),e&&ha.set(e,c),c}function ye(e){return!!e&&(ke(e)||be(e)||xe(e))}function be(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&we(e))}function xe(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&we(e))}function we(e){return!!e&&("placeholder"in e&&"token"in e)}function ke(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function _e(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function De(e){var t,n;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(n=e.selectionEnd)&&void 0!==n?n:e.value.length,"none"]}function Le(e,t){var n;_a.has(e)&&lt(t);let o=!1;switch(ka.set(e,"playing"),t.type){case"insert":o=function(e,t){let n=Se(t);const o=t.selectionBefore,r=function(e,t){var n,o,r;if("select"===va.get(e)){const[s,a]=Xe(e),l=s.findIndex((e=>_e(e,t.selectionBefore))),i=null!==(n=a[l])&&void 0!==n?n:null;if(be(i)){const e=t.selectionBefore,n=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=We(s,i),p=a?0:function(e,t,n){if(!e)return 0;let o="";for(;e.length;){const n=Ie(e);e=e.substring(n.length),t.pattern.test(n)&&(o+=n)}return Math.min(Math.max(o.length,1),n)}(t.data,i,n);if(l.length>=n)return a||(t.insertPos=e[1]-p),(null!==(o=i.selectFill)&&void 0!==o?o:i.placeholder).repeat(n);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(n-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(xe(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);n=`${n.substring(0,o[0])}${r}${n.substring(o[1])}`;const s=Ye(e,t,n);return ma.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:Fe(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":o=function(e,t){const n=Se(t),o=t.selectionBefore,r=_a.has(e);let s=o[0],a=o[1];s===a&&("deleteContentBackward"!==t.type||r?a+=Ce(n,s):s-=Ce(n,s,"backward"));const l=va.get(e);let i="";if("select"===l){const[n,o]=Xe(e),r=rt(e,[s,a,"none"]);if(void 0!==r){const l=o[r],p=n[r];be(l)?i=l.placeholder.repeat(a-s):xe(l)&&([i,s]=_e(p,De(e))?[l.placeholder,s]:function(e,t,n,o){const r=o.valueBefore,s=Ce(r,o.selectionBefore[0],"backward"),a=Math.max(n[0],o.selectionBefore[0]-s),l=r.substring(n[0],a),i=Je(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Qe(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:n[0]]}(0,l,p,t))}}const p=`${n.substring(0,s)}${i}${n.substring(a)}`,d=Ye(e,t,p);return{...t,valueAfter:d.value,selectionAfter:qe(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(_a.has(e)&&o&&lt(o),o&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=Ee(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,o),o&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(o)){wa.has(e)&&Ta.set(e,(()=>{Ta.delete(e),o&&wa.get(e)(o,e)})),ka.set(e,"beforeCallback");let t=null!==(n=ca.get(e))&&void 0!==n?n:[];const r=ua.get(e);r&&(t=t.slice(0,r),ua.delete(e)),t.push(o),ca.set(e,t),Ia&&document.activeElement===e&&"function"==typeof document.execCommand&&!Ca?(Ae(e,[0,e.value.length,"forward"],!0),Ca=!0,document.execCommand("insertText",void 0,o.valueAfter),Ca=!1):Oe(e,o),Ae(e,o.selectionAfter);const s=Ta.get(e);s&&s(),it(e)}ka.set(e,"complete")}function Te(e,t){var n,o;const r=null!==(n=Da.get(e))&&void 0!==n?n:"",s=null!==(o=La.get(e))&&void 0!==o?o:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function Ee(e,t){const n=Da.get(e),o=[...t];return n&&(o[0]+=n.length,o[1]+=n.length),o}function Me(e,t){const n=Da.get(e),o=[...t];return n&&(o[0]-=n.length,o[1]-=n.length),o}function Se(e){let t=e.valueBefore;const n=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,n[0]>=t.length&&(n[0]=t.length),n[1]>=t.length&&(n[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const o=e.prefix.length;t=t.substring(o),e.valueBefore=t,n[0]=Math.max(n[0]-o,0),n[1]=Math.max(n[1]-o,0)}return t}function Ae(e,t,n=!1){n&&(fa.add(e),setTimeout((()=>fa.delete(e)),5)),ya.get(e)&&ya.set(e,t),e.setSelectionRange(...t)}function Oe(e,t,n="After"){if(e.value=t[`value${n}`],Ia){const n=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(n)}}function Ie(e){if(null==e)return"";const t=$a.test(e.charAt(0))&&$a.test(e.charAt(1))?2:1;return e.substring(0,t)}function Ce(e,t,n="forward"){if("backward"===n)return 0===t?0:1===t?1:$a.test(e.charAt(t))&&$a.test(e.charAt(t-1))?2:1;const o=e.length-t;return 0===o?0:1===o?1:Ie(e.substring(t)).length}function Be(e,t){const n=Ie(e.data),o=n.length;if(e.value+=n,e.pos+=o,"string"==typeof e.data&&(e.data=e.data.substring(o),e.data.length||(e.endPos=e.pos)),t)return t.substring(o)}function Ve(e){const t=Ie(e.buffer),n=t.length;e.value+=t,e.pos+=n,e.buffer=e.buffer.substring(n)}function He(e,t){const n=Ie(t),o=n.length;return e.value+=n,e.pos+=o,t.substring(o)}function Pe(e,t){for(;t.buffer;){const n=Ie(t.buffer);if(e.pattern.test(n)||t.placeholder&&e.placeholder===n)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(n.length)));t.buffer=t.buffer.substring(n.length)}}function Ne(e,t){const n=e.values.concat([e.placeholder]).map((e=>e.toLowerCase())).sort(((e,t)=>e.length>t.length?-1:1));for(;t.buffer;){const e=t.buffer.toLowerCase(),o=n.find((t=>e.startsWith(t)));if(o){const e=t.buffer.substring(0,o.length);return t.buffer=t.buffer.substring(o.length),e}t.buffer=t.buffer.substring(Ce(t.buffer,0))}return null}function We(e,t){let n=e.replaceAll(t.placeholder,"");const o="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${o?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${o?"$":""}`);n=n.replace(e,"")}var r;return n}function Fe(e,t){let n=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return n;const o=De(e);n=[o[0],t.endPos,"none"];const[r,s]=Xe(e,t.value),a=rt(e,n,[r,s]);if(void 0===a)return n;if(!(a in r)||!(a in s))return n;const l=r[a],i=s[a],p=t.value.slice(l[0],l[1]);if(be(i)&&We(p,i).length===p.length&&a<r.length-1)return Sa(),r[a+1];if(xe(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const n=function(e,t,n){if(null===e.originalData)return 0;const o=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${o}${e.originalData}`,s=Je(n.values,r);if(s)return Ze(r,s).length-o.length;return 0}(t,l[0],i);if(t.insertPos+n===l[1])return Qe(i.values,p)?[l[1],l[1],"forward"]:(Sa(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+n,l[1],"none"];return _e(s,o)||(fa.add(e),setTimeout((()=>fa.delete(e)),5)),s}return l}function Ye(e,t,n,o){var r,s;const a=null!==(r=ha.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:ga.has(e),buffer:n,data:t.data,originalData:t.data,value:"",mode:va.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:Xe(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return Re(a,l,void 0,o),l}function Re(e,t,n,o){var r,s;const a={...t};(null==n?void 0:n.placeholder)&&(t.placeholder=!0);const l=(null==n?void 0:n.repeat)&&"literal"===(null===(r=n.nextPart)||void 0===r?void 0:r.type)?n.nextPart.value:null;let i=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const n of e){const r=e[i+1];switch(n.type){case"literal":ze(n,t,e.at(-1)===n);break;case"char":je(n,t,l);break;case"enum":Ke(n,t);break;case"group":const a={repeat:null!==(s=n.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!n.placeholder};Re(n.parts,t,a,o)}if(o){if(!1===o(t,n))break}const a=ke(r)&&i+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;i++}if(t.chars<p&&(t.complete=!1),n){const r=t.chars-d,s=r===p,i=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(n.repeat&&c&&s)return n.repeats++,Re(e,t,n,o);if(!s){t.complete=!1;const n=e.reverse().find((e=>"literal"===e.type));e.reverse(),ke(n)&&t.value.endsWith(n.value)&&(t.value=t.value.substring(0,t.value.length-n.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":n.repeat&&!s&&n.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function Ke(e,t){const[n,o]=t.rangeParts,r=n[o.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const n=t.buffer.substring(0,t.insertPos-t.pos),o=`${n}${t.data}`,r=Je(e.values.concat([e.placeholder]),o);if(r){const s=Ze(o,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),n?t.buffer=t.buffer.substring(n.length):Ne(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const n=Ne(e,t);if(n)return t.value+=n,n!==e.placeholder?t.unmasked+=n:t.complete=!1,t.meta.push({type:n!==e.placeholder?"enum":"placeholder",value:n}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function ze(e,t,n){let o=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!n)return;let r=!1;for(;o;){const e=t.insertPos<=t.pos?Ie(t.data):"",s=Ie(o);if(e===s)o=Be(t,o),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||n)o=He(t,o),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function je(e,t,n){var o;let r=!0;if(t.insertPos<=t.pos)for(;null===(o=t.data)||void 0===o?void 0:o.length;){const o=Ie(t.data);if(e.pattern.test(o))return Be(t),t.meta.push({type:"char",value:o}),t.chars++,t.unmasked+=o,void Pe(e,t);if("string"==typeof t.data){if(n&&t.data.startsWith(n)){r=!1;break}t.data=t.data.substring(o.length)}}for(;r&&t.buffer;){const o=Ie(t.buffer);if(e.pattern.test(o))return t.chars++,t.unmasked+=o,Ve(t),void t.meta.push({type:"char",value:o});if(t.placeholder&&o===e.placeholder)return Ve(t),void t.meta.push({type:"placeholder",value:o});if("string"==typeof t.buffer){if(n&&t.buffer.startsWith(n)){t.buffer=t.buffer.substring(n.length);break}t.buffer=t.buffer.substring(o.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function qe(e,t,n,o){const r=[o,o,"none"];if("select"===t.mode){const s=Xe(e),a=rt(e,r,s),[l,i]=Xe(e,t.value),p=void 0!==a&&Ue(n.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every(((e,n)=>Ue(t.value,e,i[a+n])));return e&&l[a-1]?l[a-1]:l[a]}return[o,l[a][1],"none"]}}return r}function Ue(e,t,n){if(ke(n))return!1;if(be(n)){let o=t[0];for(;o<t[1];){const t=Ie(e.substring(o));if(t!==n.placeholder)return!1;o+=t.length}}return!xe(n)||e.substring(t[0],t[1])===n.placeholder}function Ze(e,t){let n="";do{const o=Ie(e).toLowerCase(),r=Ie(t).toLowerCase();if(o!==r)break;n+=o,e=e.substring(o.length),t=t.substring(r.length)}while(e.length&&t.length);return n}function Xe(e,t){const n=ha.get(e);if(!n)return[[],[]];if(ba.has(e))return ba.get(e);const o=null!=t?t:Te(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of n)if(ke(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(be(a)&&be(e)&&e.token===a.token)i++;else if(be(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(xe(e)){l&&r.push([l,i,"none"]),et(e)||(p=!1);const t=Ge(o,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&ba.set(e,d),d}function Ge(e,t,n){if(et(t))return t.values[0].length;const o=e.slice(n),r=Je(t.values.concat([t.placeholder]),o);return r?r.length:0}function Je(e,t,n=null,o){var r;if(0===t.length)return n;if(!o){const n=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(n)return n}const s=Ie(t.toLowerCase()),a=`${null!=o?o:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),i=l.find((e=>e.toLowerCase()===a));return i&&(n=i),0===l.length?n:1===l.length?l[0]:(l.length>1&&(n=l[0]),null!==(r=Je(l,t.substring(s.length),n,a))&&void 0!==r?r:l[0])}function Qe(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function et(e){if(!xa.has(e)){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;xa.set(e,e.values.every((e=>e.length===t)))}return xa.get(e)}function tt(e,t=1){const[n]=Xe(e),o=rt(e,Me(e,De(e)));return void 0!==o&&void 0!==n[o+t]&&(e.setSelectionRange(...Ee(e,n[o+t])),!0)}function nt(e,t=1){const[n,o]=Xe(e),r=rt(e,De(e));if(void 0!==r&&r in o){const s=o[r];if(xe(s)){const o=n[r],a=e.value.slice(o[0],o[1]);let l=null,i=s.values.indexOf(a);const p=s.values.length-1;if(-1!==i){const e=i+t;i=e<0?p:e>p?0:e,l=s.values[i]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[p]);if(null!==l){const t={selectionBefore:o,insertPos:o[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout((()=>Le(e,t)),0),!0}}}return!1}function ot(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const n=e.length/2,o=Number.isInteger(n)?n:Math.floor(n),r=Math.abs(t-e[o-1])<Math.abs(t-e[o])?[0,o]:[o];return ot(e.slice(...r),t)}function rt(e,t,n){const[o]=null!=n?n:Xe(e),r=o.findIndex((e=>e[0]!==e[1]&&(!!_e(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==r)return r;const[s,a]=o.reduce(((e,t,n)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=n,e[1][t[1]]=n,e)),[new Set,{}]),l=ot([...s],t[1]);return l in a?a[l]:void 0}function st(e,t=!1){var n,o;const r=null!==(n=ca.get(e))&&void 0!==n?n:[],s=r[null!==(o=ua.get(e))&&void 0!==o?o:r.length-1];return s&&(s.complete||t)?_a.has(e)?[...s.unmasked].reverse().join(""):s.unmasked:t?"":null}function at(e){var t,n,o;const r=null!==(t=ca.get(e))&&void 0!==t?t:[],s=r[null!==(n=ua.get(e))&&void 0!==n?n:r.length-1];return null!==(o=null==s?void 0:s.meta)&&void 0!==o?o:null}function lt(e){const t=e=>[...e].reverse().join(""),n=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=n(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=n(e.selectionBefore,e.valueBefore.length)}function it(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,n=e.selectionEnd/e.value.length;e.scrollLeft=n>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}function pt(e){if(e||(e=new Date),e instanceof Date){const t=new Date(e);return t.setMilliseconds(0),t}if(function(e){const t=e.match(za);if(t){const e=Number(t[2]);if(e<1||e>12)return!1;if(void 0!==typeof t[3]){const e=Number(t[3]);if(e<1||e>31)return!1}if(void 0!==typeof t[4]){const e=Number(t[4]);if(e<0||e>23)return!1}return!0}return!1}(e=e.trim()))return new Date(function(e){const t=e.match(za);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function dt(e){const t=pt(e);return t.setDate(1),t.setHours(0,0,0),t}function ct(e){const t=pt(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function ut(e){return ct(e).getDate()}function ft(e,t=0){const n=pt(e);let o=t-n.getDay();return o>0&&(o-=7),n.setDate(n.getDate()+o),n.setHours(0,0,0),n}function mt(e,t=1){const n=pt(e);return n.setDate(n.getDate()+t),n}function ht(e,t=1,n=!1){const o=pt(e),r=o.getDate();if(n||o.setDate(1),o.setMonth(o.getMonth()+t),!n){const e=ut(o);o.setDate(e<r?e:r)}return o}function gt(e,t=1,n=!1){const o=pt(e),r=o.getDate();if(n||o.setDate(1),o.setFullYear(o.getFullYear()+t),!n){const e=ut(o);o.setDate(e<r?e:r)}return o}function vt(e,t){const n=pt(e),o=pt(t);return n.getDate()===o.getDate()&&n.getMonth()===o.getMonth()&&n.getFullYear()===o.getFullYear()}function $t(e,t,n){if(!Va.has(e)){const t=new Date(Ba),n=[3,8,9,7,6,4,3],o=["weekday","month","dayPeriod"],r=["long","short","narrow"],s={};for(let a=0;a<12;a++){t.setMonth(0+a),a in n&&t.setDate(n[a]),t.setUTCHours(8+a);for(const n of r){const r=new Intl.DateTimeFormat(e,o.reduce(((e,t)=>Object.assign(e,{[t]:n})),{hour12:!0,timeZone:"UTC"})).formatToParts(t).map(At);if("long"===n||"short"===n){const o=new Intl.DateTimeFormat(e,{dateStyle:"short"===n?"medium":"long"}).formatToParts(t).map(At).find((e=>"month"===e.type)),s=r.findIndex((e=>"month"===e.type));s>-1&&o&&(r[s]=o)}r.forEach((e=>{if("literal"===e.type)return;const t=e.type;s[t]=Object.assign(s[t]||{},{[e.value]:n})}))}}Va.set(e,s)}const o=Va.get(e);return o?o[t][n]:void 0}function yt(e,t){const n=Ra.get(t);if(n&&n[e])return n[e];const o=new Date(Ba);o.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(o).map(At).find((e=>"dayPeriod"===e.type));if(r){const o=n||{};return Ra.set(t,Object.assign(o,{[e]:r.value})),r.value}return e}function bt(e,t){const n={timeZone:"UTC"};"string"==typeof e?n.dateStyle=e:("date"in e&&(n.dateStyle=e.date),"time"in e&&(n.timeStyle=e.time));const o=new Intl.DateTimeFormat(t,n),r=o.formatToParts(new Date(Ba)).map(At),s=o.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(At).find((e=>"hour"===e.type)),a=s&&"23"===s.value?24:12;return r.map((e=>{const n=e.type,o=function(e,t,n,o){const r=t.length,s=!isNaN(Number(t));let a;switch(e){case"year":return 2===r?Ya.get("YY"):Ya.get("YYYY");case"month":return s?1===r?Ya.get("M"):Ya.get("MM"):(a=$t(n,e,t),"long"===a?Ya.get("MMMM"):Ya.get("MMM"));case"day":return 1===r?Ya.get("D"):Ya.get("DD");case"weekday":switch(a=$t(n,e,t),a){case"narrow":return Ya.get("d");case"short":return Ya.get("ddd");default:return Ya.get("dddd")}case"hour":return 12===o?1===r?Ya.get("h"):Ya.get("hh"):1===r?Ya.get("H"):Ya.get("HH");case"minute":return 1===r?Ya.get("m"):Ya.get("mm");case"second":return 1===r?Ya.get("s"):Ya.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Ya.get("A"):Ya.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Ya.get("ZZ"):Ya.get("Z");default:return}}(e.type,e.value,t,"hour"===e.type?a:void 0);if(void 0===o)return;const r=o[1][n];return r?(o[2]||(o[2]=new RegExp(`${o[0]}`,"g")),{option:{[n]:r},partName:n,partValue:r,token:o[0],pattern:o[2],hour12:12===a}):void 0})).filter((e=>!!e))}function xt(e,t){function n(e,[t,n,o]){const r=Object.keys(n)[0];return{option:n,partName:r,partValue:n[r],token:t,pattern:o,hour12:e}}if(Ka.includes(e)||"object"==typeof e)return bt(e,t);let o=e,r=0;const s=e=>(e[2]||(e[2]=new RegExp(e[0],"g")),!!e[2].test(o)&&(o=o.replace(e[2],`{$${r++}}`),!0)),a=function(e){const t=e.map((e=>e.partName)),n=new Set(t);if(t.length>n.size)throw new Error("Invalid date format.");return e}(Ha.filter(s).concat(Pa.filter(s)).map(n.bind(null,!1)).concat(Na.filter(s).map(n.bind(null,!0)))),l=/^\{\$(\d+)\}$/;return o.split(/(\{\$\d+\})/).map((e=>{const t=e.match(l);return t?a[Number(t[1])]:{option:{literal:e},partName:"literal",partValue:e,token:e,pattern:new RegExp(""),hour12:!1}})).filter((e=>!("literal"===e.partName&&""===e.partValue)))}function wt(e,t="en"){return xt(e,t).reduce(((e,t)=>e+t.token),"").normalize("NFKC")}function kt(e,t,n,o=!1){function r({partName:e,partValue:t,token:o}){if("literal"===e)return t;const r=s[e];if("hour"===e&&"H"===o)return r.replace(/^0/,"");if(!("minute"!==e&&"second"!==e||"mm"!==o&&"ss"!==o||1!==r.length))return`0${r}`;if("dayPeriod"===e){const e=yt(a.getHours()<12?"am":"pm",n);return"A"===o?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Ot(-1*a.getTimezoneOffset()):r}const s=function(e,t,n,o=!1){function r(e,t=!1){const r=`${n}-u-hc-${t?"h12":"h23"}`;if(i.push(...new Intl.DateTimeFormat(r,e.reduce(((e,t)=>"literal"===t.partName?e:(o&&Fa.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(At)),o&&p.length)for(const e of p){let t=[];switch(e.token){case"MMMM":t=new Intl.DateTimeFormat(r,{dateStyle:"long"}).formatToParts(s).map(At);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(At)}const n=t.find((t=>t.type===e.partName)),o=i.findIndex((t=>t.type===e.partName));n&&o>-1&&(i[o]=n)}}const s=pt(e),a=t.filter((e=>e.hour12)),l=t.filter((e=>!e.hour12)),i=[],p=[];return a.length&&r(a,!0),l.length&&r(l),i.reduce(((e,t)=>(e[t.type]=t.value,e)),{})}(e,t,n,o),a=pt(e);return t.map((e=>({...e,value:r(e)})))}function _t(e,t="long",n="en",o=!1,r=(()=>!0)){return"ISO8601"===t?pt(e).toISOString():kt(e,xt(t,n).filter(r),n,o).map((e=>e.value)).join("")}function Dt(e){return["numeric","2-digit"].includes(e.partValue)}function Lt(e,t){let n=0;const o=e=>[e[n++],e[n]];let r=0;const s=[];let a;do{const[n,l]=o(t);a=l;let i=1;if("literal"===n.partName)i=n.partValue.length;else if(n.token in Wa)i=Wa[n.token];else if(l)if("literal"===l.partName){if(i=e.indexOf(l.partValue,r)-r,i<0)throw new Error}else if("dayPeriod"===l.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(r+t)))){i=t;break}}else{const t=e.substring(r).search(/\d/);-1!==t&&(i=r+t)}else i=e.length;s.push({...n,value:e.substring(r,r+i)}),r+=i}while(a);return s}function Tt(e,t="en",n=!1){const o=(e,t)=>Array(e).fill("").map(((e,n)=>`${t(n)}`));if("M"===e)return o(12,(e=>e+1));if("MM"===e)return o(12,(e=>{const t=e+1;return t<10?`0${t}`:t}));if(e.startsWith("M"))return Tt("MM").map((o=>_t(`2000-${o}-05`,e,t,n)));if(e.startsWith("d"))return o(7,(e=>`0${e+2}`)).map((n=>_t(`2022-10-${n}`,e,t)));if("a"===e)return[yt("am",t).toLowerCase(),yt("pm",t).toLowerCase()];if("A"===e)return[yt("am",t).toUpperCase(),yt("pm",t).toUpperCase()];if(e.startsWith("Y")){const n=(new Date).getFullYear();return o(120,(e=>e+1)).reduce(((o,r)=>("120"!==r&&o.push(_t(`${n+Number(r)}-06-06`,e,t)),o.unshift(_t(n-Number(r)+"-06-06",e,t)),o)),[_t(`${n}-06-06`,e,t)])}return e.startsWith("D")?o(31,(t=>`${"DD"===e&&t<9?"0":""}${t+1}`)):e.startsWith("H")?o(24,(t=>`${"HH"===e&&t<10?"0":""}${t}`)):e.startsWith("h")?o(12,(t=>`${"hh"===e&&t<9?"0":""}${t+1}`)):e.startsWith("m")||e.startsWith("s")?o(60,(t=>`${e.length>1&&t<10?"0":""}${t}`)):[]}function Et(e,t="ISO8601",n="en"){let o,r=()=>!0,s="backward";if("object"==typeof e?({date:o,format:t="ISO8601",locale:n="en",dateOverflow:s="backward",partFilter:r=(()=>!0)}=e):o=e,!o)throw new Error("parse() requires a date string.");const a=()=>{throw new Error(`Date (${o}) does not match format (${wt(t,n)})`)};if("ISO8601"===t)return pt(o);const l=Ka.includes(t)||"object"==typeof t,i=function(e){let t;for(const n of e){if("literal"===n.partName&&!isNaN(parseFloat(n.partValue)))throw new Error(`Numbers in format (${n.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==n.partName&&!(t.token in Wa||n.token in Wa||Dt(t)&&"a"===n.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${n.token})`);t=n}return e}(xt(t,n).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=Lt(o,i)}catch{return a()}const d=new Date,c=new Map([["YYYY",d.getFullYear()],["MM",d.getMonth()+1],["DD",d.getDate()],["HH",0],["mm",0],["ss",0]]);let u=null,f="";p.forEach((e=>{if("literal"===e.partName)return;if(e.token===e.value)return a();const t=Number(e.value);if(c.has(e.token))c.set(e.token,t);else if("YY"===e.token)c.set("YYYY",function(e){const t=(new Date).getFullYear(),n=t%100,o=Math.floor(t/100),r=Number(e);return 100*(o+(r>n+20?-1:0))+r}(e.value));else{const o=e.token;if(o.startsWith("d"))return;if("D"===o)c.set("DD",t);else if("H"===o||o.startsWith("h"))c.set("HH",t);else if("M"===o)c.set("MM",t);else if("a"===o||"A"===o)u=e.value.toLowerCase()===yt("am",n).toLowerCase();else if("Z"===o)f=Mt(e.value);else{const t=Tt(o,n,l).indexOf(e.value);if(-1!==t)switch(o){case"MMM":case"MMMM":c.set("MM",t+1)}}}}));let m=c.get("HH")||0;!1===u?(m+=12===m?0:12,c.set("HH",24===m?0:m)):!0===u&&12===m&&c.set("HH",0),c.set("MM",(c.get("MM")||1)-1);let[h,g,v,$,y,b]=Array.from(c.values());const x=ut(new Date(`${qa(h)}-${ja(g+1)}-10`));if(x<v&&"throw"===s)throw new Error(`Invalid date ${qa(h)}-${ja(g+1)}-${ja(v)}`);v="backward"===s?Math.min(v,x):v;const w=`${qa(h)}-${ja(g+1)}-${ja(v)}T${ja($)}:${ja(y)}:${ja(b)}${f}`,k=new Date(w);return isFinite(+k)?k:a()}function Mt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function St(e,t="UTC",n="browser"){n="browser"===n?Intl.DateTimeFormat().resolvedOptions().timeZone:n;const o=pt(e),r=e=>{const t=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:e,hourCycle:"h23"}).formatToParts(o).map(At),n={};return t.forEach((e=>{n[e.type]=e.value})),new Date(`${n.year}-${n.month}-${n.day}T${n.hour}:${n.minute}:${n.second}Z`)},s=r(t);return Ot((r(n).getTime()-s.getTime())/1e3/60)}function At(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Ot(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function It(e,t="+0000"){const n=pt(e),o=function(e){Mt(e);const[t,n,o,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(o)+Number(r);return"+"===n?s:-s}(t);return new Date(n.getTime()+1e3*o*60)}function Ct(e,t="+0000"){const n="+"===t.slice(0,1);return It(e,t.replace(n?"+":"-",n?"-":"+"))}function Bt(e,t,n=7){let o,r;const s=pt(e);switch(n){case"month":r=s.getDate(),o=ut(s)-s.getDate();break;case"week":r=s.getDay()+1,o=6-s.getDay();break;case"year":const e=function(e){const t=pt(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=pt(e);return Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5)}(s);r=t,o=e-t;break;default:o=r=n}for(let e=0;e<=o||e<r;e++){if(e<=o){const n=mt(s,e);if(t(n))return n}if(e&&e<=r){const n=mt(s,-e);if(t(n))return n}}return null}function Vt(e){return"timeZoneName"!==e.partName}function Ht(e,t){const n=[],o=pt(t);o.setDate(1);let r=ft(o,e.props.weekStart);r.setHours(o.getHours(),o.getMinutes(),o.getSeconds());const s=function(e,t=0){const n=ft(e,t);return n.setDate(n.getDate()+6),n.setHours(23,59,59),n}(ct(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(n.push(a),a=[]),r=mt(r)}while(r.getTime()<=s.getTime());return{monthDay:o,weeks:n}}function Pt(e){e.props.calendar=r(e.props.showMonths,(e=>e)).map((t=>Ht(e,ht(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(_t(e.props.renderedDate,"YYYY")),n=t-t%10;return e.props.decade=`${n} - ${n+9}`,r(10,(o=>gt(e.props.renderedDate,n+o-t)))}(e),e.props.months=function(e){const t=pt(e.props.renderedDate);return t.setMonth(0),r(12,(e=>ht(t,e)))}(e)}function Nt(e,t){t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_panels`)||!document.contains(t.target))||Ga.has(e)||(e.props.expanded=!1)}function Wt(e,t){if(!t)return e.props.inputText="",new Date;const n=t instanceof Date?t:Et(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(n,e.props.format,e.props.locale,!1,Vt),n}function Ft(e){return Array.isArray(e.props.sequence)?un.clone(e.props.sequence):["day"]}function Yt(e,t,n=!0){var o,r;if(e._value===t)return;if(null==t)return e.input(t,n);e.props.offset=e.props.timezone?St(t,e.props.timezone):"+0000";const s=It(t,null!==(o=(r=e.props).offset)&&void 0!==o?o:r.offset="+0000");e.input(_t(s,e.props.valueFormat,e.props.valueLocale,!1),n)}function Rt(e,t){const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>document.getElementById(`${e.props.id}_${t}`))),o=document.getElementById(`${e.props.id}_${n}`);o instanceof HTMLElement&&(t.preventDefault(),o.focus())}function Kt(e,t){let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Ja.set(e,t),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===ka.get(t)&&(n=t.value),me(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var n,o;if(!ca.has(e))return;const r=null!==(n=Da.get(e))&&void 0!==n?n:"",s=null!==(o=La.get(e))&&void 0!==o?o:"";Le(e,{type:"insert",selectionBefore:De(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>he(t)),10))}));const[o,r]=jt(e);fe(t,{pattern:o,partOverrides:r,onChange:({valueAfter:o})=>{if(zt(e),Za.has(e))return Za.delete(e);n&&n===o?n="":(me(t),e.props.inputText=o,setTimeout((()=>he(t)),10))}})}function zt(e){var t,n;if(e.props.overlay){const o=Ja.get(e);!o||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||st(o,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?o&&(e.props._isPlaceholder=!1,e.props._overlayParts=i(at(o))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(n=e.props.attrs)||void 0===n?void 0:n.placeholder}])}}function jt(e){const t=e.props.locale,n=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,o=xt(e.props.format,t);return[wt(e.props.format,t).replace(/([a#])/g,"\\$1").replace("Z",""),o.reduce(((o,s)=>{if("literal"===s.partName)return o;let a=Tt(s.token,t,n);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=r(e.props.maxDate.getFullYear()-t+1,(e=>String(t+e)))}const l={type:"enum",token:s.token,values:a,placeholder:"A"===s.token?"A/P":s.token,selectDirection:"left"};return o[s.token]=l,s.token.startsWith("D")&&Qa.set(e,a),o}),{})]}function qt(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Ut(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function Zt(e,t){if(t instanceof HTMLInputElement&&!nl.get(e)&&tl){const n=document.getElementById(`${e.props.id}_overlay`),o=document.getElementById(`${e.props.id}_overlay_inner`);if(n&&t&&o){nl.set(e,n);const r=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=r;const s=new ResizeObserver((()=>{const n=getComputedStyle(t);e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight}}));s.observe(t);const a=e=>{o.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),s.disconnect()}))}}}function Xt(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=un.undefine(e.props.overlay),e.props.overlay&&a(`${e.props.id}`,Zt.bind(null,e))})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function Gt(e){const t=Array.isArray(e.props.options)?e.props.options:[],n=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(t);return!!n.length&&(!!Array.isArray(e.value)&&e.value.reduce(((t,o)=>{const r=n.find((e=>un.eq(o,h(e))));return r?t.push(r):e.props.arbitraryValues&&t.push({value:o,label:o}),t}),[]))}function Jt(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);zl.set(e,t),fe(t,{...Kl.get(e),onChange:({valueAfter:t,meta:n})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=i(n)}})}function Qt(e){const t=Wi.get(e.parentElement);t&&(!1===t.accepts||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("drop",pn),e.addEventListener("dragenter",sn),e.addEventListener("dragleave",rn))}function en(e){const t=Wi.get(e.parentElement);t&&t.childIsDraggable&&!t.childIsDraggable(e)||(e.setAttribute("draggable","true"),e.setAttribute("tabindex","0"),e.addEventListener("dragstart",on),t&&(!1===t.accepts||"append"==t.dropBehavior||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("dragenter",ln),e.addEventListener("dragleave",an)))}function tn(e,t,n,o){if(Yi.has(e)){Pi.set(e,t),Qt(e);for(let n=0;n<e.children.length;n++){const o=e.children[n];o instanceof HTMLElement&&"true"!==o.getAttribute("data-disabled")&&(en(o),Hi.set(o,{value:t()[n],index:n}))}}else{new MutationObserver(nn).observe(e,{childList:!0}),Wi.set(e,n),function(e,t){if(t&&t.accepts&&Array.isArray(t.accepts)){const n=[];for(const e of t.accepts)n.push(e);Fi.set(e,n)}}(e,n),Yi.add(e),Pi.set(e,t),Ni.set(e,o),Qt(e);for(let o=0;o<e.children.length;o++){const r=e.children[o];r instanceof HTMLElement&&((!n||!n.childIsDraggable||n.childIsDraggable&&n.childIsDraggable(r))&&(en(r),Hi.set(r,{value:t()[o],index:o})))}}}function nn(e){if(zi&&Gi){zi.classList.add("dnd-placeholder");for(const e of Ui)e.classList.add("dnd-placeholder")}const t=[];for(const n of e)for(const e of n.addedNodes)e instanceof HTMLElement&&t.push(e);for(const e of t)e!==zi&&en(e),Gi&&qi&&e.classList.add("dnd-placeholder");if(qi&&t.length){zi=t[0],Ji=!1,Ui=[zi];for(const e of t.slice(1))Ui.push(e);qi=!1}const n=e[0].target,o=Pi.get(n)();for(let e=0;e<n.children.length;e++){const t=n.children[e];Hi.set(t,{value:o[e],index:e})}}function on(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e.dataTransfer){if(zi=e.currentTarget,!(zi.parentNode&&zi.parentNode instanceof HTMLElement))return;const t=Wi.get(zi.parentNode);if(t&&t.isDisabled&&t.isDisabled())return void e.preventDefault();const n=Ni.get(zi.parentNode)();n.length||zi.parentNode.dispatchEvent(new CustomEvent("dndDragStart",{detail:Hi.get(zi)})),Gi=!0,ji=Hi.get(zi).index;const o=Pi.get(zi.parentNode)();if(Ri.set(zi.parentNode,[...o]),zi.id="dragging",Ki.push(zi.parentNode),n.length>1&&n.includes(zi)){const e=new DocumentFragment,t=document.createElement("div");t.classList.add("dnd-multiple-selections"),t.id="dnd-multiple-selections",n.sort(((e,t)=>Hi.get(e).index-Hi.get(t).index)).map((e=>{Ui.push(e);const n=e.cloneNode(!0);t.appendChild(n),e.classList.add("dnd-children-hidden")})),e.appendChild(t),zi.appendChild(e)}else Ui.push(zi)}}function rn(){Zi=!1}function sn(e){if(!e.currentTarget||!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.parentNode||!(e.currentTarget.parentNode instanceof HTMLElement)||!zi||!zi.parentNode||Zi||Xi||null===ji||Ji||e.currentTarget===zi.parentNode||Fi.get(e.currentTarget)&&!Fi.get(e.currentTarget).includes(zi.parentNode))return;Zi=!0,qi=!0;let t=Pi.get(e.currentTarget)();Ri.has(e.currentTarget)||(Ri.set(e.currentTarget,[...t]),Ki.push(e.currentTarget));const n=[...Pi.get(zi.parentNode)()];let o=[];if(Ui.length){for(const e of Ui){const t=Hi.get(e);n.splice(t.index,1)}o=Ui.map((e=>Hi.get(e).value))}t=[...t,...o],ji=t.length-1-o.length,e.currentTarget.dispatchEvent(new CustomEvent("dndNewValue",{detail:t})),Ji=!0}function an(){Xi=!1}function ln(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e.currentTarget.parentNode&&e.currentTarget.parentNode instanceof HTMLElement&&zi&&null!==ji&&zi instanceof HTMLElement&&!Zi&&!Xi&&e.currentTarget!==zi&&!Ji){if(Fi.get(e.currentTarget.parentNode)&&!Fi.get(e.currentTarget.parentNode).includes(zi.parentNode))return;Xi=!0;let t=[...Pi.get(e.currentTarget.parentNode)()];const n=Hi.get(e.currentTarget).index,o=zi.parentNode;if(!o)return;const r=Pi.get(o)();let s=[],a=[];Ui.length&&(s=Ui.map((e=>Hi.get(e).value)),a=Ui.map((e=>Hi.get(e).index)));const l=[...a],i=[];if(e.currentTarget.parentNode===zi.parentNode){for(const e of l)i.push(t[e]);t=t.filter(((e,t)=>!l.includes(t))),t.splice(n,0,...i)}else qi=!0,Ri.has(e.currentTarget.parentNode)||(Ri.set(e.currentTarget.parentNode,[...Pi.get(e.currentTarget.parentNode)()]),Ki.push(e.currentTarget.parentNode)),r.splice(ji,1),t.splice(n,0,...s);zi.classList.remove("dnd-hidden"),zi.classList.remove("dnd-children-hidden");for(let e=0;e<zi.children.length;e++){const t=zi.children[e];"dnd-multiple-selections"===t.getAttribute("id")&&t.remove()}for(const e of Ui)e.classList.remove("dnd-hidden"),e.classList.remove("dnd-children-hidden");e.currentTarget.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:t})),e.currentTarget.parentNode!==zi.parentNode&&(Ji=!0),ji=n}}function pn(e){e.stopPropagation(),e.currentTarget&&(cn(),document.dispatchEvent(new Event("dndDrop")))}function dn(){for(const e of Ki){let t=Pi.get(e);Ri.get(e)&&(t=[...Ri.get(e)]),e.dispatchEvent(new CustomEvent("dndNewValue",{detail:t})),Ri.delete(e)}cn()}function cn(){if(Gi=!1,zi&&zi.children){for(let e=0;e<zi.children.length;e++){const t=zi.children[e];"dnd-multiple-selections"===t.getAttribute("id")&&t.remove()}document.querySelectorAll(".dnd-hidden").forEach((e=>{e.classList.remove("dnd-hidden")})),document.querySelectorAll(".dnd-children-hidden").forEach((e=>{e.classList.remove("dnd-children-hidden")})),document.querySelectorAll(".dnd-placeholder").forEach((e=>{e.classList.remove("dnd-placeholder")}))}zi=null,ji=null,qi=!1,Ui=[];for(const e of Ki)Ri.delete(e);Ki=[]}Object.defineProperty(exports,"__esModule",{value:!0});var un=require("@formkit/utils"),fn=require("@formkit/core"),mn=require("@formkit/inputs");const hn=[988,24029,396,13078,980],gn=18806588,vn=502357,$n=16217489;let yn=189024;const bn=()=>[30548127325,27022924,34729821653783].map(Tn).join("y"),xn=/^[0-9a-f]+$/,wn="undefined"!=typeof window,kn=r(32,(e=>e)).map((()=>{yn|=0,yn=yn+1831565813|0;let e=yn^yn>>>15|yn;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),_n=setTimeout,Dn=e=>{clearTimeout(Ln[e]),delete Ln[e]},Ln={},Tn=e=>e.toString(32),En=e=>`${Tn(kn[e]).substring(2)}.${Tn(hn[e%(hn.length-1)])}`,Mn={},Sn={},An=new Set(["",null,void 0]),On={},In={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Cn={overflow:"hidden",height:"100%"},Bn={},Vn={};let Hn=0;const Pn=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple","data-disabled":"$disabled || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.valid === false && $state.validationVisible || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-is-max":"$max && $value && $value.length >= $max || undefined","data-has-overlay":"$overlay || undefined","data-multi-select":"$transferOnSelect === false || undefined"}}),Nn=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),Wn=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Fn=()=>({$el:"ul",if:"$fns.length($messages)"}),Yn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Rn=()=>({$el:"div",if:"$help"}),Kn=()=>({$el:null}),zn=(e,t)=>()=>mn.icon(e,t),jn=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),qn=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Un=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Zn=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),Xn=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Gn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Jn=()=>({$el:null,for:["part","$_overlayParts"]}),Qn=new WeakSet,eo=new WeakMap,to="undefined"!=typeof window,no=fn.createMessage({key:"loading",type:"state",value:!0,visible:!1}),oo=fn.createMessage({key:"loading",type:"state",value:!1,visible:!1}),ro=Symbol(),so=new WeakMap,ao="undefined"!=typeof window,lo=c("dd"),{outer:io,wrapper:po,inner:co,icon:uo,label:fo,prefix:mo,suffix:ho,help:go,messages:vo,message:$o}=u(lo),yo=lo("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",tabindex:"0","aria-has-popup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),bo=lo("selection","div"),xo=lo("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),wo=lo("optionLoading","span"),ko=lo("option",(()=>({$el:"div",attrs:{"data-is-placeholder":"$option.isPlaceholder || undefined"}}))),_o=C(lo),Do={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Lo={schema:io(po(fo("$label"),co(uo("prefix"),mo(),yo(m("$option.isPlaceholder && $state.loading !== true",xo("$option.label"),bo(ko(m("$state.loading",wo("$ui.isLoading.value"),"$option.label")))),m("$state.loading",uo("loader")),uo("select")),_o(),ho(),uo("suffix"))),go("$help"),vo($o("$message.value"))),type:"input",family:"dropdown",props:[],features:[mn.options,L(I,(function(e){e.on("click",(()=>{e.props.trackHover=!1,(!e.props.options||e.props.options.length||e.props.emptyMessage||e.props.optionsLoader)&&(e.props.options&&!e.props.options.length&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),e.props.expanded=!0)}))}),O,E(M,A),(function(e){let t,n="";e.on("unusedKeyDown",(({payload:o})=>{if(!o.isComposing&&1===[...o.key].length){clearTimeout(t),n+=o.key;const r=e.props.options.find((e=>e.label.toLowerCase().startsWith(n.toLowerCase())));r&&(e.props.activeValue=h(r)),t=setTimeout((()=>{n=""}),400)}}))})),function(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&fn.error(300,[e]),e.props.dropdownWrapperStyles=un.clone(Do),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=B.bind(null,e),e.props.positionListBox=V.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Hn=document.documentElement.scrollTop;for(const e in In)Vn[e]=document.documentElement.style[e],document.documentElement.style[e]=In[e];for(const e in Cn)Bn[e]=document.body.style[e],document.body.style[e]=Cn[e];document.body.scrollTop=Hn}():function(){for(const e in In)document.documentElement.style[e]=Vn[e];for(const e in Cn)document.body.style[e]=Bn[e];document.body.scrollTop=0,document.documentElement.scrollTop=Hn}())}))},mn.defaultIcon("select","select"),mn.defaultIcon("selected","check"),mn.defaultIcon("loader","spinner"),mn.localize("isLoading"),mn.localize("loadMore")]},To=c("tg"),{outer:Eo,wrapper:Mo,label:So,prefix:Ao,suffix:Oo,help:Io,messages:Co,message:Bo,icon:Vo}=u(To),Ho=To("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$_value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Po=To("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),No=To("altLabel",(()=>({$el:"label",if:"($label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner) || $altLabelPosition === true",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),Wo=To("innerLabel",(()=>({$el:"div",if:"$valueLabelDisplay === inner && ($checked && $onValueLabel || $offValueLabel)",attrs:{style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:{if:"$checked",then:"$onValueLabel",else:"$offValueLabel"}}))),Fo=To("valueLabel",(()=>({$el:"label",if:"$valueLabelDisplay !== hidden && $valueLabelDisplay !== inner && (($checked === true && $onValueLabel) || ($checked === false && $offValueLabel))",attrs:{for:"$id"},children:{if:"$checked && $onValueLabel",then:"$onValueLabel",else:{if:"$offValueLabel",then:"$offValueLabel"}}}))),Yo=To("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Ro=To("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Ko=To("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),zo={schema:Eo(Mo(No(),Yo(Ao(),Ho(),Ro(Wo(),Ko(m("$slots.default","$slots.default",Vo("thumb")))),Oo()),Fo(),Po()),Io("$help"),Co(Bo("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(e){function t(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}e.on("created",(()=>{e.props.disabled=un.undefine(e.props.disabled),e.props.altLabelPosition=un.undefine(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=un.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))}))}]},jo=c("rp"),{outer:qo,inner:Uo,prefix:Zo,suffix:Xo,help:Go,messages:Jo,message:Qo,icon:er}=u(jo),tr=jo("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($item.__key)",type:"button"}}))),nr=jo("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),or=jo("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($item.__key)",type:"button"}}))),rr=jo("items",(()=>({$el:"ul",attrs:{role:"list"}}))),sr=jo("item",(()=>({$el:"li",for:["item","index","$value"],if:"$item.__key",attrs:{role:"listitem",key:"$item.__key","data-index":"$item.__index"}}))),ar=jo("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($item.__key, 1)",type:"button"}}))),lr=jo("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($item.__key, -1)",type:"button"}}))),ir=jo("content","div"),pr=jo("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),dr=jo("legend",(()=>({$el:"legend",if:"$label"}))),cr=jo("group",(()=>({$formkit:"group",id:"$item.__key",index:"$item.__index"}))),ur=jo("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),fr=jo("remove",(()=>({$el:"li",if:"$removeControl"}))),mr=jo("insert",(()=>({$el:"li",if:"$insertControl"}))),hr=jo("up",(()=>({$el:"li",if:"$upControl"}))),gr=jo("down",(()=>({$el:"li",if:"$downControl"}))),vr=jo("controlLabel","span");let $r=0;const yr=new Set,br={schema:qo(pr(dr("$label"),Go("$help"),Uo(Zo(),m("$slots.default",rr(sr(ir(cr("$slots.default")),ur(hr(lr(vr("$ui.moveUp.value"),er("moveUp"))),fr(or(vr("$ui.remove.value"),er("remove"))),mr(tr(vr("$ui.add.value"),er("add"))),gr(ar(vr("$ui.moveDown.value"),er("moveDown"))))))),Xo()),nr('$addLabel || ($ui.add.value + " " + ($label || ""))')),Jo(Qo("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){const t=new Set,n={value:0};K(e,"removeControl",!0),K(e,"upControl",!0),K(e,"downControl",!0),K(e,"insertControl",!1),K(e,"addButton",!0),K(e,"addLabel",!1),K(e,"addAttrs",{}),e.plugins.add(H),e.plugins.add(R.bind(null,t)),e.hook.input(((o,r)=>r(F(o,e,t,n)))),e.on("commit",(({payload:t})=>{yr.has(e)&&e.input(t,!1)})),e.hook.commit(((t,o)=>{if(n.value&&Array.isArray(t)&&t.forEach(((o,r)=>{const a=Object.isFrozen(o)&&e.children.findIndex((e=>e.props.id===o.__key));if(!1!==a&&-1!==a){n.value--;const l=o.__index,i=o.__original;Object.defineProperty(i,"__index",{configurable:!0,value:l});const p=s(t);p.splice(r,1),p.splice(l,0,i);const[d]=e._c.children.splice(a,1);d&&e._c.children.splice(l,0,d),0===n.value&&(Y(e,t),t.forEach((e=>delete e.__index)))}})),Array.isArray(t)){Y(e,t);const n=t[t.length-1];un.isObject(n)&&"__shim"in n&&function(e){const t=e.findIndex((e=>un.isObject(e)&&"__shim"in e));-1!==t&&e.splice(t)}(t)}return o(t)})),e.on("created",N)},mn.localize("remove"),mn.localize("add"),mn.localize("moveUp"),mn.localize("moveDown"),mn.defaultIcon("remove","trash"),mn.defaultIcon("add","add"),mn.defaultIcon("moveUp","arrowUp"),mn.defaultIcon("moveDown","arrowDown")]},xr="undefined"!=typeof window,wr=c("rt"),{outer:kr,wrapper:_r,inner:Dr,label:Lr,prefix:Tr,suffix:Er,help:Mr,messages:Sr,message:Ar,icon:Or}=u(wr),Ir=wr("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"range",max:"$max",name:"$name",min:"0",disabled:"$disabled",step:"$step",onInput:"$handlers.DOMInput",onBlur:"$handlers.blur",value:"$_value",style:{position:"absolute",zIndex:"0",top:0,right:0,bottom:0,opacity:"0"}}}))),Cr=wr("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),Br=wr("onItems",(()=>({$el:"div",attrs:{id:'$id + "_on_wrapper"',style:{position:"relative",display:"flex",width:'$onWidth + "%"',top:"0",bottom:"0",left:"0",overflow:"hidden",color:"$onColor"}}}))),Vr=wr("offItems",(()=>({$el:"div",attrs:{id:'$id + "_off_wrapper"',style:{position:"absolute",display:"flex",flexDirection:"row-reverse",width:'$offWidth + "%"',top:"0",bottom:"0",right:"0",overflow:"hidden",color:"$offColor"}}}))),Hr=wr("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Pr=wr("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Nr={schema:kr(_r(Lr("$label"),Dr(Or("prefix"),Tr(),Cr(Br(Hr(m("$slots.onItem",(()=>()=>"$slots.onItem"),m("$slots.default",(()=>()=>"$slots.default"),Or("rating"))))),Vr(Pr(m("$slots.offItem",(()=>()=>"$slots.offItem"),m("$slots.default",(()=>()=>"$slots.default"),Or("rating")))))),Ir(),Er(),Or("suffix"))),Mr("$help"),Sr(Ar("$message"))),type:"input",props:[],features:[function(e){e.addProps(["onWidth","offWidth","wrapperWidth","max","min","icon","step","hoverHighlight","ratingIcon","onColor","offColor"]),e.props.max=e.props.max||5,e.props.min=e.props.min||0,e.props.step=e.props.step||1,!1!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.disabled=un.undefine(e.props.disabled),e.on("created",(()=>{xr&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=j.bind(null,e),e.context.handlers.ratingHoverOut=q.bind(null,e),e.context.handlers.handleClick=z.bind(null,e),xr&&a(`${e.props.id}`,(()=>{Z(e),function(e){const t=document.getElementById(`${e.props.id}_items_wrapper`);if(!t)return;const n=new ResizeObserver((()=>{Z(e)}));n.observe(t)}(e),setTimeout((()=>Z(e)),100)})))})),e.on("input",(()=>X(e))),e.hook.input(((t,n)=>{if(null===t||""===t||isNaN(t))return n(t);const o=Number(t),r=Number(e.props.min),s=Number(e.props.max);return o>s?n(s):e.props.min&&o<=r?n(r):n(o)}))},mn.defaultIcon("rating","star")]},Wr=new WeakSet,Fr=new WeakMap,Yr=new WeakMap,Rr=new WeakMap,Kr=new WeakMap,zr=new WeakMap,jr="undefined"!=typeof window;let qr=!1;const Ur=new WeakMap,Zr=new WeakMap,Xr=new WeakSet,Gr="undefined"!=typeof window,Jr=c("ac"),{outer:Qr,wrapper:es,inner:ts,icon:ns,label:os,prefix:rs,suffix:ss,help:as,messages:ls,message:is}=u(Jr),ps=Jr("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",tabindex:"0",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend",onFocus:"$handlers.focus",onFocusout:"$handlers.focusOut","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),ds=Jr("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),cs=Jr("selection",(()=>({for:["option","index","$selections"],$el:"div",attrs:{key:"$option.value","data-value":"$option.value",tabindex:"0",onClick:"$handlers.selectTag($option)",onFocus:"$handlers.selectTag($option)"}}))),us=Jr("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"',onKeydown:"$handlers.keydown"}}))),fs=Jr("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$disabled !== true && $handlers.removeSelection($option)","aria-controls":"$id"}}))),ms=Jr("optionLoading","span"),hs=Jr("option",(()=>({$el:"div",if:"$_value !== undefined"}))),gs=C(Jr),vs={schema:Qr(es(os("$label"),ts(ns("prefix"),rs(),ps(),m("$multiple !== true && $selectionAppearance === option",us(cs(hs(m("$state.loading",ms("$ui.isLoading.value"),"$option.label")),fs(ns("close"))))),m("$state.loading",ns("loader")),ds(ns("select")),gs(),ss(),ns("suffix")),m("$multiple && $selectionAppearance === option",us(cs(hs(m("$state.loading",ms("$ui.isLoading.value"),"$option.label")),fs(ns("close")))))),as("$help"),ls(is("$message.value"))),type:"input",family:"dropdown",props:[],features:[mn.options,ue,L(O,E(M,A)),de(M),mn.defaultIcon("select","select"),mn.defaultIcon("close","close"),mn.defaultIcon("selected","check"),mn.defaultIcon("loader","spinner"),mn.localize("isLoading"),mn.localize("loadMore")]},$s=c("dp"),{outer:ys,wrapper:bs,inner:xs,icon:ws,label:ks,prefix:_s,suffix:Ds,help:Ls,messages:Ts,message:Es}=u($s),Ms=$s("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly"}}))),Ss=$s("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:"$id + _panels",role:"dialog","aria-modal":"true","aria-label":"Choose date"}}))),As=$s("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Os=$s("nextLabel","span"),Is=$s("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Cs=$s("prevLabel","span"),Bs=$s("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Vs=$s("calendarWeeks",(()=>({$el:"tbody"}))),Hs=$s("calendarHeader",(()=>({$el:"thead"}))),Ps=$s("weekDays",(()=>({$el:"tr"}))),Ns=$s("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Ws=$s("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Fs=$s("day",(()=>({$el:"td",for:["day","$week"],attrs:{key:'$: "day" + $fns.format($day, "D")',onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","data-disabled":"$fns.isDisabled($day)","aria-selected":"$fns.isSelected($day)","aria-label":'$fns.format($day, "long")'}}))),Ys=$s("openButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.open",tabIndex:'$pickerOnly && "-1" || "0"',"aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Rs=$s("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Ks=$s("year",(()=>({for:["year","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$fns.isSelected($year)","data-disabled":"$fns.isDisabledYear($year)"}}))),zs=$s("months",(()=>({if:'$panel === "month"',$el:"ul"}))),js=$s("month",(()=>({$el:"li",for:["month","$months"],attrs:{key:'$: "month" + $fns.format($month, "M")',onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$fns.isSelected($month)","data-disabled":"$fns.isDisabledMonth($month)"}}))),qs=$s("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Us=$s("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Zs=$s("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Xs=$s("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),Gs=$s("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Js=$s("yearButton",(()=>({$el:"button",attrs:{id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Qs=$s("monthButton",(()=>({$el:"button",attrs:{id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),ea=$s("dayButton",(()=>({$el:"button",attrs:{id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),ta=$s("time",(()=>({$el:"div",if:'$panel === "time"'}))),na=$s("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false"}}))),{overlayPlaceholder:oa,overlayLiteral:ra,overlayChar:sa,overlayEnum:aa,overlay:la,overlayParts:ia,overlayInner:pa}=f($s),da=$s("panel","div"),ca=new WeakMap,ua=new WeakMap,fa=new WeakSet,ma=new WeakMap,ha=new WeakMap,ga=new WeakSet,va=new WeakMap,$a=/[\uD800-\uDBFF]/,ya=new WeakMap,ba=new WeakMap,xa=new WeakMap,wa=new WeakMap,ka=new WeakMap,_a=new WeakSet,Da=new WeakMap,La=new WeakMap,Ta=new WeakMap,Ea=new WeakMap;let Ma=!1;const Sa=()=>{Ma=!0,setTimeout((()=>{Ma=!1}),500)},Aa={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},Oa=new WeakMap,Ia="undefined"!=typeof window;let Ca=!1;Ia&&document.addEventListener("selectionchange",(()=>{if(!(document.activeElement instanceof HTMLInputElement))return;const e=document.activeElement;if(Ea.has(e))return function(e){const t=Ea.get(e);if(t){const[n,o]=t,[r,s]=Xe(e),a=s.indexOf(n);if(-1===a)return void Ea.delete(e);const l=r[a],i=[l[0]+o[0],l[1],"none"];_e(De(e),i)||Ae(e,i)}}(e);if("select"!==va.get(e))return;const t=De(e);if(!_e(t,Oa.get(e))){if(Oa.set(e,t),fa.has(e))return fa.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:De(e)}))}}));const Ba="1999-03-04T02:05:01.000Z",Va=new Map,Ha=[["YYYY",{year:"numeric"}],["YY",{year:"2-digit"}],["MMMM",{month:"long"}],["MMM",{month:"short"}],["MM",{month:"2-digit"}],["M",{month:"numeric"}],["DD",{day:"2-digit"}],["D",{day:"numeric"}],["dddd",{weekday:"long"}],["ddd",{weekday:"short"}],["d",{weekday:"narrow"}],["mm",{minute:"2-digit"}],["m",{minute:"numeric"}],["ss",{second:"2-digit"}],["s",{second:"numeric"}],["Z",{timeZoneName:"short"}]],Pa=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Na=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Wa={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Fa=["MMMM","MMM","dddd","ddd"],Ya=new Map([...Ha,...Pa,...Na].map((e=>[e[0],e]))),Ra=new Map,Ka=["full","long","medium","short"],za=/^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]{3})?(Z|(?:\+|\-)[0-9]{4})?$/,ja=e=>String(e).padStart(2,"0"),qa=e=>String(e).padStart(2,"0"),Ua="undefined"!=typeof window,Za=new WeakSet,Xa=new WeakSet,Ga=new WeakSet,Ja=new WeakMap,Qa=new WeakMap,el=new WeakSet,tl="undefined"!=typeof window,nl=new WeakMap,ol={schema:ys(bs(ks("$label"),xs(ws("prefix"),_s(),la(pa(ia(oa("$part.value"),ra("$part.value"),sa("$part.value"),aa("$part.value")))),Ms(),Ss(qs(Is(Cs("$ui.prev.value"),ws("prev")),Us("$decade"),Zs(Js()),Xs(Qs(),Js()),Gs(Qs(),ea(),Js()),As(Os("$ui.next.value"),ws("next"))),da(Rs(Ks("$fns.format($year, $yearFormat)")),zs(js("$fns.format($month, $monthFormat)")),Bs(Hs(Ps(Ns("$fns.format($day, $weekdayFormat)"))),Vs(Ws(Fs("$fns.format($day, $dateFormat)")))),ta(na()))),Ys(ws("calendar")),Ds(),ws("suffix"))),Ls("$help"),Ts(Es("$message.value"))),type:"input",family:"date",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","showMonths","showPagination","valueFormat","valueLocale","weekStart","weekdayFormat","yearFormat","years","pickerOnly","overlay"],features:[Xt,function(e){var t,n,o,s,l,i,p,d,c,u,f,m,h,g,v,$,y,b,x,w,k,_;e.addProps(["activeDate","calendar","decade","expanded","inputText","localTime","months","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","minDate","maxDate","offset","searchDays","disabledDays","_isDisabled","_isFocused"]),e.hook.prop(((t,n)=>("weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"searchDays"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=St(e._value,t.value)),n(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(m=e.props).valueFormat)&&void 0!==t||(m.valueFormat="ISO8601"),null!==(n=(h=e.props).weekdayFormat)&&void 0!==n||(h.weekdayFormat="d"),null!==(o=(g=e.props).monthFormat)&&void 0!==o||(g.monthFormat="MMM"),null!==(s=(v=e.props).monthButtonFormat)&&void 0!==s||(v.monthButtonFormat="MMMM"),null!==(l=($=e.props).dayButtonFormat)&&void 0!==l||($.dayButtonFormat="D"),null!==(i=(y=e.props).dateFormat)&&void 0!==i||(y.dateFormat="D"),null!==(p=(b=e.props).yearFormat)&&void 0!==p||(b.yearFormat="YYYY"),null!==(d=(x=e.props).paginatedPanels)&&void 0!==d||(x.paginatedPanels=["day","year"]),null!==(c=(w=e.props).valueLocale)&&void 0!==c||(w.valueLocale=e.props.locale),null!==(u=(k=e.props).format)&&void 0!==u||(k.format="long"),e.props.panels=Ft(e),e.props.pickerOnly=un.undefine(e.props.pickerOnly),null!==(f=(_=e.props).searchDays)&&void 0!==f||(_.searchDays=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):qt.bind(null,e),function(e){const t=e._value;let n=new Date;if(t instanceof Date)n=pt(t);else if("string"==typeof t)try{n=pt(Et(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${wt(e.props.valueFormat,e.props.valueLocale)})`),n=void 0}else t||(n=void 0);e.props.offset=e.props.timezone?St(n||new Date,e.props.timezone):"+0000",e.props.minDate&&(e.props.minDate=Ct(Et(e.props.minDate),e.props.offset)),e.props.maxDate&&(e.props.maxDate=Ct(Et(e.props.maxDate),e.props.offset)),n=n&&Ct(n,e.props.offset),n&&Yt(e,n,!1);let o=n||new Date;o=e.props.minDate>o?e.props.minDate:o,e.props.renderedDate=o,e.props.activeDate=o,e.props.localTime=n&&_t(n,"HH:mm")||"12:00"}(e),e.props.calendar=[],e.props.inputText="",e.props.showMonths=e.props.showMonths||1,"function"==typeof e.props.format?(e.props.formatDate=e.props.format,e.props.format=null):e.props.formatDate=_t,e.on("created",(()=>{if(a(`${e.props.id}`,Kt.bind(null,e)),e.context){let t;e.context.fns.format=(t,n)=>_t(t,n,e.props.locale||"en",!1,Vt),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!Bt(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!Bt(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var n;const o=null===(n=e.context)||void 0===n?void 0:n.value;if(null==o)return;return vt(t,Ct(o instanceof Date?o:Et(o,e.props.valueFormat,e.props.valueLocale),e.props.offset))},e.context.handlers._blur=()=>{var t,n;e.props._isFocused=!1,"function"==typeof(null===(t=e.context)||void 0===t?void 0:t.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur())},e.context.handlers.overlayClick=()=>{const t=Ja.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props._isFocused=!0,e.props.pickerOnly&&!Xa.has(e)&&(Ga.add(e),e.props.expanded=!0,setTimeout((()=>Ga.delete(e)),200))},e.context.handlers.dateInput=t=>{var n;if(el.has(e))return el.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let o=Et({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:Vt});if(function(e){return xt(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===o.getTime()&&!Ea.get(t.target)&&_t(o,e.props.format,e.props.locale,!1,Vt)!==t.target.value){const r=Tt("dddd",e.props.locale),s=xt(e.props.format,e.props.locale),a=null===(n=Lt(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===n?void 0:n.value,l=_t(o,"dddd",e.props.locale);if(a&&r.includes(a)&&l!==a){let t=r.indexOf(a)-r.indexOf(l);t=t<-1?7+t:t,o=mt(o,t),Za.add(e)}}Yt(e,o)}catch(t){Yt(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=gt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=ht(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=gt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=ht(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var n;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(n=e.context)||void 0===n?void 0:n.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const n=t.target,[o,r]=n.value.split(":");e.props.localTime=n.value,e.props.activeDate.setHours(o,r),Wt(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.mouseEnter=n=>o=>{clearTimeout(t),o.target instanceof HTMLElement&&"-1"===o.target.getAttribute("tabindex")&&"true"!==o.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=Bt(n,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=n)},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var n;return(null===(n=e.context)||void 0===n?void 0:n.activeDate)instanceof Date&&vt(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var n;return(null===(n=e.context)||void 0===n?void 0:n.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var n,o;return(null===(n=e.context)||void 0===n?void 0:n.activeDate)instanceof Date&&t.getFullYear()===(null===(o=e.context)||void 0===o?void 0:o.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const n=function(e){const t=pt(e);return t.setHours(0,0,0),t}(t).getTime();return n<dt(e).getTime()||n>ct(e).getTime()||void 0}}}));const D=Nt.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{t&&e.props._isDisabled(t)||(Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():e.props.expanded=!1,Yt(e,t))})),e.on("input",(({payload:t})=>{const n=new Date,o=t?Wt(e,Ct(t,e.props.offset)):n;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:o,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:o,e.props.localTime=_t(o,"HH:mm"),function(e){const t=Qa.get(e);if(e._value&&t){const n=ut(e.props.activeDate);if(t.length>n)t.splice(n,t.length-n);else if(t.length<n)for(let e=t.length+1;e<=n;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",Pt.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{var n;if(t){if(e.props.panels=Ft(e),e.props.panel=e.props.panels.shift(),"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=Bt(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}Pt(e),a(`${e.props.id}_panels`,(t=>{const n=t.querySelector('[tabindex="0"]');n&&(n.focus(),function(e,t){const n=new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach((e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())}))}));n.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const o=e.on("prop:expanded",(({payload:t})=>{t||(e.off(o),n.disconnect())}))}(e,t))})),Ua&&setTimeout((()=>{document.addEventListener("click",D)}),10)}else"time"===e.props.panel?e.emit("dateSelected",e.props.activeDate):e._value?(el.add(e),Wt(e,Ct(e._value,e.props.offset))):Wt(e,void 0),Ua&&(Xa.add(e),document.removeEventListener("click",D),null===(n=document.getElementById(`${e.props.id}`))||void 0===n||n.focus(),setTimeout((()=>Xa.delete(e)),50))})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const n=e.props.calendar,o=dt(e.props.renderedDate),r=ct(ht(e.props.renderedDate,n.length-1));t.getTime()<o.getTime()?e.props.renderedDate=ht(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=ht(e.props.renderedDate))}else if("year"===e.props.panel){const t=e.props.years,n=t[0].getFullYear(),o=t[t.length-1].getFullYear(),r=e.props.activeDate.getFullYear();r>o?e.props.renderedDate=gt(e.props.renderedDate,10):r<n&&(e.props.renderedDate=gt(e.props.renderedDate,-10))}e.props.expanded&&Wt(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{let n=null,o=0;switch(t.key){case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowDown":o=7;break;case"ArrowUp":o=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||Rt(e,t);break;case"Escape":e.props.expanded=!1}if(o&&(n=mt(e.props.activeDate,o)),n&&!e.props._isDisabled(n))e.props.activeDate=n;else if(n&&e.props._isDisabled(n)){const t=o>0?1:-1;r(Number(e.props.searchDays),(e=>t*e)).some((t=>{const o=mt(n,t);return!e.props._isDisabled(o)&&(e.props.activeDate=o,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let n;switch(t.key){case"ArrowDown":n=5;break;case"ArrowRight":n=1;break;case"ArrowUp":n=-5;break;case"ArrowLeft":n=-1;break;case"Tab":t.shiftKey||Rt(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const o=e.props.activeDate.getFullYear()+n-e.props.renderedDate.getFullYear();e.props.activeDate=gt(e.props.renderedDate,o)})),e.on("monthKeydown",(({payload:t})=>{let n=0;switch(t.key){case"ArrowDown":n=3;break;case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowUp":n=-3;break;case"Tab":t.shiftKey||Rt(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}let o=(e.props.activeDate.getMonth()+n)%12;o=o<0?12+o:o;const r=o-e.props.renderedDate.getMonth();let s=ht(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=Bt(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Ja.get(e)&&zt(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=fn.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:Ut(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},mn.localize("next"),mn.localize("prev"),mn.localize("changeDate"),mn.localize("chooseDate"),mn.defaultIcon("next","right"),mn.defaultIcon("prev","left"),mn.defaultIcon("calendar","date")]},rl=c("tl"),{outer:sl,wrapper:al,inner:ll,icon:il,label:pl,prefix:dl,suffix:cl,help:ul,messages:fl,message:ml}=u(rl),hl=rl("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText",tabindex:"0",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),gl=rl("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),vl=rl("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),$l=rl("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),yl=rl("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$disabled !== true && $handlers.removeSelection($option)","aria-controls":"$id"}}))),bl=rl("tagLabel",(()=>({$el:"span"}))),xl=rl("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite",onKeydown:"$handlers.keydown"}}))),wl=rl("tagLoading","span"),kl=C(rl),_l={schema:sl(al(pl("$label"),ll(il("prefix"),dl(),xl(vl($l(m("$state.loading",wl("$ui.isLoading.value"),bl("$option.label")),yl(il("close")))),hl()),m("$state.loading",il("loader")),gl(il("select")),kl(),cl(),il("suffix"))),ul("$help"),fl(ml("$message.value"))),type:"input",family:"dropdown",props:[],features:[mn.options,ue,L(O,E(Gt,A)),de(Gt),mn.defaultIcon("select","select"),mn.defaultIcon("close","close"),mn.defaultIcon("selected","check"),mn.defaultIcon("loader","spinner"),mn.localize("isLoading"),mn.localize("loadMore")]},Dl=c("mk"),{outer:Ll,wrapper:Tl,inner:El,label:Ml,prefix:Sl,suffix:Al,help:Ol,messages:Il,message:Cl,icon:Bl}=u(Dl),{overlayPlaceholder:Vl,overlayLiteral:Hl,overlayChar:Pl,overlayEnum:Nl,overlay:Wl,overlayParts:Fl,overlayInner:Yl}=f(Dl),Rl=Dl("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",value:"$_maskValue",id:"$id","aria-describedby":"$describedBy"}}))),Kl=new WeakMap,zl=new WeakMap,jl=new WeakMap,ql={schema:Ll(Tl(Ml("$label"),El(Bl("prefix"),Sl(),Wl(Yl(Fl(Vl("$part.value"),Hl("$part.value"),Pl("$part.value"),Nl("$part.value")))),Rl(),Al(),Bl("suffix"))),Ol("$help"),Il(Cl("$message.value")),"$_overlayStyles"),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[Xt,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,n,o,r,s;const l=ve("string"==typeof e._value?e._value:"");zl.set(e,l),jl.set(e,l),e.props.allowIncomplete=un.undefine(e.props.allowIncomplete),e.props.overlay=un.undefine(e.props.overlay);const p=!(void 0!==e.props.showMask&&!un.undefine(e.props.showMask));e.props.unmaskValue=un.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=un.undefine(e)),t(e))));const d={placeholder:p,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(n=e.props.mode)&&void 0!==n?n:"shift",partOverrides:null!==(o=e.props.tokens)&&void 0!==o?o:{},prefix:null!==(r=e.props.prefix)&&void 0!==r?r:void 0,suffix:null!==(s=e.props.suffix)&&void 0!==s?s:void 0,reverse:un.undefine(e.props.reverse)};Kl.set(e,d),e.hook.input(((t,n)=>n(function(e,t){const n=zl.get(e),o="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:o?t.maskValue:"";const r=jl.get(e);r.value=Te(r,t);const s=ge(r,Kl.get(e)),a=st(r,e.props.allowIncomplete);if(t===n.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==n.value&&!e.props.allowIncomplete)return t;o||s===e.props._maskValue||(n.value=s,e.props._maskValue=s,e.props._overlayParts=i(at(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(e,t)))),e.props._maskValue=ge(l,d),e.input(e.props._maskValue,!1),a(`${e.props.id}`,Jt.bind(null,e))}))}]},Ul=c("tf"),{outer:Zl,wrapper:Xl,inner:Gl,icon:Jl,prefix:Ql,suffix:ei,help:ti,messages:ni,message:oi}=u(Ul),ri=Ul("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),si=Ul("legend",(()=>({if:"$label",$el:"legend"}))),ai=Ul("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),li=Ul("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),ii=Ul("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),pi=Ul("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$fns.getOptionCount() + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'},children:"$fns.getOptionCount()"}))),di=Ul("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),ci=Ul("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation",tabindex:"0","aria-label":'$fns.getOptionCount(true) + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$fns.getOptionCount(true)"}))),ui=Ul("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),fi=Ul("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),mi=Ul("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceKeyDown",disabled:"$disabled","aria-label":"Search",role:"searchbox",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput'}}))),hi=Ul("sourceSearchClear",(()=>({$el:"button",if:"$inputText !== undefined",attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),gi=Ul("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseover:"$handlers.onMouseEnter(true)",onMouseout:"$handlers.onMouseLeave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems'}}))),vi=Ul("template",(()=>({for:["option","index","$options"],$el:null}))),$i=Ul("sourceListItem",(()=>({if:"$targetOptionValues.includes($fns.optionValue($option)) === false",$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$selections && $selections.length > 0 && $fns.isSelected($option)","data-is-active":"$fns.isActive($option)","data-disabled":"$option.attrs.disabled",onKeydown:"$targetOptionValues.includes($option.value) === false && $handlers.sourceKeyDown",role:"option",onClick:"$option.attrs.disabled !== true && $handlers.selectOption($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),yi=Ul("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$selections && $selections.length > 0 && $fns.isSelected($option)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),bi=Ul("sourceLoadMore",(()=>({$el:"li",if:"$targetLoading !== true && $state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.sourceLoadMore'}}))),xi=Ul("loadMoreInner","span"),wi=Ul("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),ki=Ul("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",tabindex:"0",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),_i=Ul("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseover:"$handlers.onMouseEnter(false)",onMouseout:"$handlers.onMouseLeave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems'}}))),Di=Ul("targetListItem",(()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$selections && $selections.length && $fns.isSelected($option, $target)","data-is-active":"$fns.isActive($option)",onKeydown:"$handlers.targetKeyDown",role:"option",onClick:"$option.attrs.disabled !== true && $handlers.selectOption($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),Li=Ul("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index',class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Ti=Ul("targetLoadMore",(()=>({$el:"li",if:"$targetLoading && $state.loading",attrs:{id:'$id + "_target_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.targetLoadMore'}}))),Ei=Ul("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Mi=Ul("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selections.length === 0 || $sourceSelected === false || $state.loading || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),Si=Ul("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$options.length === $targetOptions.length || $state.loading || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),Ai=Ul("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selections.length === 0 || $sourceSelected === true || $state.loading || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),Oi=Ul("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $state.loading || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),Ii=Ul("controlLabel","span"),Ci=Ul("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Bi=Ul("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Vi=Ul("emptyMessageInner","span"),Hi=new WeakMap,Pi=new WeakMap,Ni=new WeakMap,Wi=new WeakMap,Fi=new WeakMap,Yi=new WeakSet,Ri=new WeakMap;let Ki=[],zi=null,ji=null,qi=!1,Ui=[],Zi=!1,Xi=!1,Gi=!1,Ji=!1;"undefined"!=typeof window&&(document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("drop",dn),document.addEventListener("dragleave",(e=>{(e.target instanceof HTMLElement&&e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight)&&(e.preventDefault(),dn())})));const Qi=new WeakSet,ep=new WeakSet,tp=new WeakMap,np=new WeakMap,op="undefined"!=typeof window,rp={schema:Zl(ri(si("$label"),ti("$help"),Xl(ai(li(ii(),pi()),ui(fi(mi(),hi(Jl("close")))),gi(Ci(Vi("$sourceEmptyMessage")),vi($i(m("$transferOnSelect !== true && $fns.isSelected($option)",Jl("selected")),yi("$option.label"))),bi(xi(m("$targetLoading !== true && $state.loading",Jl("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))),Ei(Si(Ii("$ui.addAllValues.value"),Jl("fastForward")),Mi(Ii("$ui.addSelectedValues.value"),Jl("moveRight")),Ai(Ii("$ui.removeSelectedValues.value"),Jl("moveLeft")),Oi(Ii("$ui.removeAllValues.value"),Jl("rewind"))),wi(ki(di(),ci()),_i(Bi(Vi("$targetEmptyMessage")),Di(m("$transferOnSelect !== true && $fns.isSelected($option)",Jl("selected")),Li("$option.label")),Ti(xi(m("$targetLoading && $state.loading",Jl("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),ni(oi("$message.value")))),type:"input",props:["options","selections","activeValue","activeDescendant","sourceSelected","targetOptions","target","source","optionLoader","filterOptions","inputText","renderList","search","hasNextPage","page","targetOptionValues","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","debounce"],features:[function(e){function t(e,t){e.props.showTargetEmptyMessage=0===t.length||!1===t,t=t||[],e.props.targetOptions=[...t],e.props.targetOptionValues=t.map((e=>h(e))),e.props.showSourceEmptyMessage=e.props.options&&e.props.options.length===e.props.targetOptions.length,e.props.selections=[]}function n(e,t,n){var r;const s=n?e.props.options:e.props.targetOptions;if(e.props.trackHover=!1,["ArrowDown","ArrowUp"].includes(t.key)){if(t.preventDefault(),!Array.isArray(s)||!s.length)return;const n=s.reduce(((e,t)=>{var n;return(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.disabled)||e.push(h(t)),e}),[]);(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(ro);const o=n.indexOf(e.props.activeValue);-1===o&&n.length?e.props.activeValue=n[0]:"ArrowDown"===t.key&&n.length>o+1?e.props.activeValue=n[o+1]:"ArrowUp"===t.key&&o>0&&(e.props.activeValue=n[o-1]),p(e)}else if("Enter"===t.key){if(t.preventDefault(),e.props.activeValue){const t=e.props.options.find((t=>h(t)===e.props.activeValue));t&&o(e,t,n)}}else"Backspace"!==t.key||n||e.props.selections.length&&function(e,t){const n=t.map((e=>h(e)));if(Array.isArray(e._value)){const t=e._value.filter((e=>!n.includes(e)));e.props.selections=[],e.input(t),e.props.activeValue=void 0}}(e,e.props.selections)}function o(e,t,n,o){function a(){const n=p.findIndex((e=>h(e)===h(t))),o=p.findIndex((t=>h(t)===h(e.props.selections[0]))),r=Math.min(n,o),s=Math.max(n,o),a=p.slice(r,s+1);e.props.selections=a}if(e.props.disabled)return;if(e.props.isSourceOption!==n&&(e.props.isSourceOption=n,e.props.selections=[]),e.props.isSourceOption&&Array.isArray(e._value)&&e._value.length>=e.props.max)return;const l=!!o&&(o.shiftKey&&e.props.selections.length);e.props.isSourceOption=n;const i=e.props.selections.map((e=>h(e)));if(i.includes(h(t))){const n=e.props.selections.findIndex((e=>h(e)===h(t)));return e.props.selections.splice(n,1),void(e.props.selections=[...e.props.selections])}const p=n?e.props.options:e.props.targetOptions;e.props.sourceSelected===!n?l?a():(e.props.selections=[...e.props.selections,t],e.props.sourceSelected=n):l?a():e.props.selections=[...e.props.selections,t],e.props.transferOnSelect&&(n?r(e):s(e))}function r(e){if(Array.isArray(e._value)){e.props.optionsLoader||!1===e.props.clearOnSelect||(e.props.inputText=void 0);const t=e.props.selections.map((e=>h(e))),n=[...e._value,...t];e.input(n),e.props.selections=[]}}function s(e){if(Array.isArray(e._value)){const t=e.props.selections.map((e=>h(e))),n=e._value.filter((e=>!t.includes(e)));if(e.input(n),e.props.optionsLoader){const t=[...e.props.options];e.props.options=[...t]}e.props.selections=[]}}function l(t){let n=null,o="",r=[];if(e.props.mouseOnSource){if(n=Qi.has(e),o=`${e.props.id}_source_list_item`,r=[...e.props.options],!r||!r.length||n)return r=[],o="",void(n=null)}else if(e.props.mouseOnTarget&&(n=ep.has(e),o=`${e.props.id}_target_list_item`,r=[...e.props.targetOptions],!r||!r.length||n))return r=[],o="",void(n=null);const s=r.reduce(((e,t,n)=>{var r;if(null===(r=t.attrs)||void 0===r?void 0:r.disabled)return e;const s=document.getElementById(o+`_${n}`);return s&&e.push([s,t]),e}),[]),a=document.getElementById(`${e.props.id}_load_more`);a&&s.push([a,e.props.loadMoreOption]),e.props.mouseOnSource&&Qi.add(e),e.props.mouseOnTarget&&ep.add(e),s.length&&i(e,s,null,t)}function i(e,t,n,o){var r,s,a;const d=o,c=d?d.getBoundingClientRect():{top:0,bottom:0};if(n=null,e.props.trackHover){if(e.props.mouseY>c.top&&e.props.mouseY<c.bottom){let o=n||0,r=n;const s=(t,o)=>{var r;const s=o[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){n=t;const s=o[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?h(s):void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==r&&s(r,t[r]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==o||null!==r)}null===n&&(e.props.activeValue=void 0)}else p(e);e.props.mouseOnSource||e.props.mouseOnTarget?(d&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&d.scrollTop+d.offsetHeight>d.scrollHeight-200&&e.props.mouseOnSource&&(e.props.allowAppendOptions=!0,null===(a=e.context)||void 0===a||a.handlers.loadMore(!1)),e.props.mouseOnSource&&Qi.has(e)||e.props.mouseOnTarget&&ep.has(e)?requestAnimationFrame(i.bind(null,e,t,n,o)):l(o)):(Qi.delete(e),ep.delete(e))}function p(e){const t=document.getElementById(e.props.activeDescendant);t&&t.scrollIntoView({block:"nearest",inline:"start"})}e.props.memoOptions=[],e.props.targetOptions=[],e.props.targetOptionValues=[],e.props.multiple=!0,e.props.loadingCounter=0,e.props.page=1,e.props.hasNextPage=_.bind(null,e),e.props.applyLoadedOptions=G,e.on("created",(()=>{if(e._value||e.input([]),e.props.options||(e.props.options=[]),e.props.disabled=un.undefine(e.props.disabled),e.props.searchable=un.undefine(e.props.searchable),void 0===e.props.clearOnSelect?e.props.clearOnSelect=!0:"false"===e.props.clearOnSelect&&(e.props.clearOnSelect=!1),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>h(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.selections=[],e.props.sourceSelected=!1,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.props.optionsLoader&&0===e.props.options.length?g(e):e.props.optionsLoader||0!==e.props.options.length||(e.props.showSourceEmptyMessage=!0),e.context){function t(e){return e._value?e._value:[]}function l(e){return e.props.options.map((e=>h(e))).filter((t=>!e.props.targetOptionValues.includes(t)))}function i(e){return op&&d(e)}function p(e){return op&&d(e,!1)}function d(e,t=!0){if(!e.props.selections)return[];const n=e.props.selections.map((e=>h(e))),o=[];for(const e of n){const n=t?".formkit-source-list-items":".formkit-target-list-items",r=document.querySelector(`[data-type="transferlist"] ${n} [data-value="${e}"]`);r&&o.push(r)}return o}function c(t){t.stopImmediatePropagation(),t.detail&&e.props.options.find((n=>{h(n)===t.detail.value&&(e.props.selections=[n])})),e.props.trackHover=!1}function u(e){return"true"!==e.getAttribute("data-disabled")&&!e.classList.contains("formkit-source-empty-message")&&!e.classList.contains("formkit-target-empty-message")}function f(e){return e.props.disabled||e.props.max&&Array.isArray(e._value)&&e._value.length>=e.props.max}function m(e){return e.props.disabled}if(e.context.handlers.loadMore=D.bind(null,e),e.context.fns.isActive=t=>un.eq(e.props.activeValue,h(t))||void 0,e.context.fns.optionValue=h,e.context.fns.isSelected=t=>e.props.selections.map((e=>h(e))).includes(h(t)),e.context.fns.getOptionCount=(t=!1)=>{const n=t?e.props.targetOptions:e.props.options;let o;return o=t?n.length:n.filter((t=>!e.props.targetOptionValues.includes(h(t)))).length,e.props.selections.length>0&&t!==e.props.isSourceOption?e.props.selections.length+"/"+o:o},e.context.handlers.clearSearch=()=>{e.props.inputText=void 0},e.context.handlers.selectOption=(t,n)=>o.bind(null,e,t,n),e.context.handlers.transferForward=r.bind(null,e),e.context.handlers.transferForwardAll=()=>{if(Array.isArray(e._value)){const t=e.props.options.filter((e=>!e.attrs||!e.attrs.disabled)).map((e=>h(e)));e.props.max&&t.length>e.props.max&&(t.length=e.props.max);const n=[...t];e.input(n),e.props.selections=[]}},e.context.handlers.transferBackward=s.bind(null,e),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e._value)&&(e.input([]),e.props.selections=[])},e.context.handlers.onSearch=t=>{const n=t.target;e.props.inputText=""===n.value?void 0:n.value,function(e,t,n=!1){if("function"==typeof e.props.optionsLoader){if(n&&(e.props.options=[]),e.props.search=t,clearTimeout(tp.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);tp.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else if(Array.isArray(e.props.initialOptions)&&"string"==typeof t){const n=[...e.props.initialOptions].filter((t=>Array.isArray(e._value)&&!e._value.includes(h(t))));e.props.options=n.filter((n=>e.props.filter(n,t,e)))}}(e,n.value)},e.context.handlers.sourceKeyDown=t=>n(e,t,!0),e.context.handlers.targetKeyDown=t=>n(e,t,!1),e.context.handlers.onMouseEnter=t=>()=>{t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0},e.context.handlers.onMouseLeave=t=>()=>{t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1},op){a(e.props.id+"_source_list_items",(n=>{a(`${e.props.id}`,(o=>{n instanceof HTMLElement&&o instanceof HTMLElement&&(n.addEventListener("dndNewValue",(t=>{if(t.stopImmediatePropagation(),!Array.isArray(e._value))return;const n=e._value.filter((e=>!t.detail.includes(e)));e.input([...n])})),o.addEventListener("dndNewValue",(t=>{t.stopImmediatePropagation(),e.input([...t.detail])})),n.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!0,c(t)})),o.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!1,c(t)})),document.addEventListener("dndDrop",(()=>{e.props.selections=[],e.props.trackHover=!0})),tn(n,l.bind(null,e),{accepts:[o],dropBehavior:"append",childIsDraggable:u,isDisabled:f.bind(null,e)},i.bind(null,e)),tn(o,t.bind(null,e),{accepts:[o,n],childIsDraggable:u,isDisabled:m.bind(null,e)},p.bind(null,e)))}))}));const v=t=>{e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,o=document.getElementById(n);if(o){const n=o.getBoundingClientRect();t.clientX>n.x&&t.clientX<n.x+n.width&&t.clientY>n.y&&t.clientY<n.y+n.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",v)}}})),e.on("commit",(({payload:n})=>{if(n===np.get(e)&&void 0!==np.get(e))return;if(np.set(e,n),op&&void 0!==n&&"function"==typeof e.props.optionLoader){const o=M(e,n);if(e.props.multiple&&Array.isArray(n))if(n.forEach((t=>{T(e,t,Array.isArray(o)&&o.find((e=>un.eq(h(e),t))))})),e.props.loadingCounter){e.props.isLoadingOption=!0;const o=e.on("prop:loadingCounter",(()=>{e.props.loadingCounter||(e.props.isLoadingOption=!1,t(e,M(e,n)),e.off(o))}))}else t(e,M(e,n));return}const o=M(e,n);t(e,o)})),e.on("prop:inputText",(({payload:t})=>{t||(e.props.initialOptions.length&&(e.props.options=[...e.props.initialOptions]),e.props.optionsLoader&&(e.props.page=1,e.props.options=[],e.props.search=void 0,g(e)))})),e.on("prop:options",(({payload:t})=>{t&&t.length?(t.forEach((t=>{Array.isArray(e._value)&&e._value.includes(h(t))&&e.props.targetOptionValues.push(h(t))})),e.props.showSourceEmptyMessage=!1):t&&!t.length&&e.props.sourceEmptyMessage&&(e.props.showSourceEmptyMessage=!0)})),e.on("prop:activeValue",(({payload:t})=>{if(t===ro)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const n=e.props.options.findIndex((e=>un.eq(h(e),t)));e.props.activeDescendant=n>=0?`${e.props.id}_source_list_item_${n}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{if(t&&!0!==e.props.disabled){const t=document.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,Qi.delete(e),l(t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{if(t&&!0!==e.props.disabled){const t=document.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,ep.delete(e),l(t)}})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(oo)})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(oo)}))},mn.options,mn.defaultIcon("moveRight","right"),mn.defaultIcon("moveLeft","left"),mn.defaultIcon("fastForward","fastForward"),mn.defaultIcon("rewind","rewind"),mn.defaultIcon("close","close"),mn.defaultIcon("loader","spinner"),mn.defaultIcon("selected","check"),mn.localize("isLoading"),mn.localize("loadMore"),mn.localize("addAllValues"),mn.localize("addSelectedValues"),mn.localize("removeSelectedValues"),mn.localize("removeAllValues")]};var sp=Object.freeze({__proto__:null,dropdown:Lo,toggle:zo,repeater:br,rating:Nr,autocomplete:vs,datepicker:ol,taglist:_l,mask:ql,transferlist:rp});const ap=setInterval,lp=952679114,ip=451228594,pp=32863693,dp=13919,cp=new WeakSet;exports.$if=m,exports.autocomplete=vs,exports.createBaseSections=u,exports.createProPlugin=function(e,t={}){const n=e;try{if(!n)throw new Error("FormKitNoKey");function o(t){if(cp.has(t)){const n=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:Tn(dp),children:`${Tn(ip)}${Tn(pp)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){On[e]?On[e].add(t):On[e]=new Set([t])}(e,n)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const n=e.substring(3);if(!xn.test(n))return t();const o=parseInt(n,16).toString(),r=Number(o[0])<6?Number(o[0]):6,s=o.substring(r,r+(o.length-6)),a=o.substring(0,r)+o.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(n),o.library=n=>{if(n.props.type in t){const{schema:o,...r}=t[n.props.type];cp.add(n),n.define({...r,schema:o(e)})}ap((()=>An.has(e)&&n.emit(lp.toString(32))),4e3)},o}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}},exports.createSectionFactory=c,exports.datepicker=ol,exports.dropdown=Lo,exports.inputs=sp,exports.mask=ql,exports.rating=Nr,exports.repeater=br,exports.taglist=_l,exports.toggle=zo,exports.transferlist=rp;