@formkit/pro 0.124.2 → 0.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/index.mjs +2 -1
- package/colorpicker/index.mjs +1 -1
- package/currency/index.mjs +1 -1
- package/datepicker/index.mjs +1 -1
- package/dropdown/index.mjs +2 -1
- package/index.cjs +73 -1
- package/index.mjs +73 -1
- package/mask/index.mjs +1 -1
- package/package.json +1 -1
- package/rating/index.mjs +5 -1
- package/repeater/index.mjs +1 -1
- package/slider/index.mjs +1 -1
- package/taglist/index.mjs +2 -1
- package/toggle/index.mjs +1 -1
- package/togglebuttons/index.mjs +1 -1
- package/transferList/index.mjs +1 -1
- package/unit/index.mjs +1 -1
package/index.mjs
CHANGED
|
@@ -1 +1,73 @@
|
|
|
1
|
-
function e(e,o){e in Qn||(Qn[e]={timer:0,inputs:new Set});const n=Qn[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=zn((()=>{Gn[e]||(Gn[e]=zn((()=>tr.add(e)),2e3)),function(e){if(Zn){window.addEventListener(Yn(),(o=>{const n=new URL(o.blockedURI).hostname;jn.some(((e,t)=>Jn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=Xn(Nn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(Qn[e].inputs),i=l.filter((t=>!(er[e]&&er[e].has(t)))).join("");if(qn(e),i){o++;try{const a=await window[Xn(Kn)](`${n}${r}${Jn((s+o)%jn.length)}/${function(e){const t=Math.round(9*Math.random());let o="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),o+=String.fromCharCode(r)}return`${t}${o}`}(`${e.substring(3)}x${i}`)}`),p=await a.json();if(p[Xn(Rn)])return t(e,p.schema);if(a.ok)return er[e]||(er[e]=new Set),void l.forEach((t=>er[e].add(t)))}catch(e){}o<2&&zn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){tr.add(e),function(e,t){or[e]&&or[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return tr.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e,t,n,r){return(...a)=>l=>i=>{const p=function(e,t,n,r,a,l){const i=l[n],p="function"==typeof r?r():{$el:r},d=a.map((e=>"string"==typeof e?e:e(t)(l)));let c=d.length&&p?Ln(p,{children:d}):p;if(c=Ln(c,i),"object"==typeof c){let a=c;if(!$n(c)&&!bn(c)||c.meta||(c.meta={section:n,node:r}),$n(c)){const{$el:r,...l}=c;l.attrs?"class"in l.attrs||"if"in l.attrs||(l.attrs={class:`$classes.${n}`,...l.attrs}):l.attrs={class:`$classes.${n}`},a=s(t,n,Object.defineProperty(l,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if(bn(c)){const{$cmp:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${n}`;const{$formkit:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return a}return s(t,n,c)}(e,l,t,n,a,i);return r&&cn(p)&&(p.memo=e+JSON.stringify(i)),r?[p]:p}}function s(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function a(e){return(t,o,n=!1)=>r(e,t,o,n)}function l(e){return{outer:e("outer",nr,!0),wrapper:e("wrapper","div",!1),inner:e("inner",rr,!1),icon:dr,label:e("label",sr,!1),prefix:e("prefix",pr,!1),suffix:e("suffix",pr,!1),help:e("help",ir,!1),messages:e("messages",ar,!1),message:e("message",lr,!1)}}function i(e){return{overlayPlaceholder:e("overlayPlaceholder",cr),overlayLiteral:e("overlayLiteral",ur),overlayChar:e("overlayChar",fr),overlayEnum:e("overlayEnum",hr),overlay:e("overlay",vr),overlayParts:e("overlayParts",gr),overlayInner:e("overlayInner",mr)}}function p(e,t,o){return n=>r=>{const s="string"==typeof t?t:t(n)(r);return o?{if:e,then:s,else:"string"==typeof o?o:o(n)(r)}:(kn(s)?Object.assign(s.else,{if:e}):Sn(s)&&Object.assign(s,{if:e}),s)}}function d(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),n=e("listitem",(()=>({$el:"li",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":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),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)"}}))),d=e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),c=e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),u=e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),f=e("groupLabel","span"),h=e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return t(o(a(l("$emptyMessage")),d(p("$option.group",u(f("$option.group"),h(c((e=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),v=n(p("$fns.isSelected($option)",dr("selected")),i("$option.label")),t=>{const o=o=>{const n=v(t)(o),r="function"==typeof e?e(t):e;return un(r)?(kn(n)&&$n(n.else)?n.else.attrs={...n.else.attrs,...r}:$n(n)&&(n.attrs={...n.attrs,...r}),n):n};return o._s=v._s,o})))),n(p("$fns.isSelected($option)",dr("selected")),i("$option.label")))),r(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(p("$state.loading",dr("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,v}}function c(e){return cn(e)&&"value"in e&&"label"in e}function u(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function f(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function h(e){return"__original"in e?e.__original:e.value}async function v(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(zr.get(e));const o=t?e.props.debounce:0;0===o?m(e,n):zr.set(e,setTimeout((()=>{e.props.page=1,m(e,n)}),o))}else if(Array.isArray(e.props.options)){const o=JSON.parse(JSON.stringify(e.props.initialOptions));e.props.options=[...o.filter((o=>{if("options"in o){const n=o.options=[...o.options].filter((o=>e.props.filter(o,null!=t?t:"",e)));return n.length>0&&{...o,options:n}}return e.props.filter(o,null!=t?t:"",e)}))]}}function m(e,t){e.props.allowAppendOptions=t,b(e)}function g(e,t){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const o=Dn(t);e.props.appendingOptions=!0,e.props.activeValue=h(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=Dn(t);e.props.options=o,e.props.options.length||(e.store.set(Gr),e.store.set(yn({key:"hasNextPage",type:"state",value:!1,visible:!1}))),jr.set(e,e.props.searchValue)}function $(e,t,o){if(e.store.set(qr),e.props.optionLoadingCounter++,e.props.multiple&&"truncate"!==e.props.selectionAppearance){let o;o=fn(t)?{label:"Loading...",value:String(t)}:{label:String(t),value:t},e.props.optionLoaderValues.includes(o.value)||e.props.optionLoaderValues.push(o.value),"transferlist"===e.props.type||e.props.selections.includes(o)||(e.props.selections=[...e.props.selections,o])}const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:c(e)?e:cn(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},s=t=>{const o=e.props.memoOptions.findIndex((e=>hn(h(e),h(t))));return-1===o?e.props.memoOptions=[...e.props.memoOptions,t]:e.props.memoOptions[o]=t,t};return n instanceof Promise?n.then((e=>{if("string"==typeof e||c(e))return s(r(e))})).finally((()=>{e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--})):(e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--,s(r(n)))}function b(e){e.store.set(qr),e.props.optionsLoadingCounter++,e.store.set(yn({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,Xr.get(e)),n=g.bind(null,e),r=o instanceof Promise?o.then(((...o)=>{void 0!==e.props.nonceKey&&t!==e.props[e.props.nonceKey]||n(...o)})):(n(o),e.props.optionsLoadingCounter--);if(r instanceof Promise)return r.finally((()=>{e.props.optionsLoadingCounter--}))}function y(e,t){e.props.page++,Xr.set(e,t),e.store.set(yn({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function x(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!hn(h(t),e)));e.input(o)}else e.input(void 0);e.props.openOnRemove&&!e.props.expanded&&e.isCreated&&(e.props.expanded=!0),setTimeout((()=>{var t;return e.emit("selectRange",[null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option])}),20)}async function w(e){const t=Qr(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:Zn&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function _(e){var t,o;if(e.props.allOptions&&e.props.allOptions.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=h(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>hn(h(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=h(e.props.allOptions[0]);else if(e.props.inputStd.length>0&&!e.props.multiple||e.props.multiple&&(null===(o=e.context)||void 0===o?void 0:o.state.dirty))e.props.selections[e.props.selections.length-1]?e.props.activeValue=h(e.props.selections[e.props.selections.length-1]):e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=h(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function k(e){return e.reduce(((e,t)=>(t.options?e.push(...k(t.options)):e.push(t),e)),[])}function S(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(h(t)!==Jr?(e.props.option=t,e.props.maxReached&&!A(e,t)||(e.input(L(e,h(t))),A(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function L(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];for(const n of o)if(hn(n,t))return e.props.optionRemoved=!0,o.filter((e=>!hn(e,t)));return[...o,t]}return hn(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function D(e,t){return hn(e.props.activeValue,h(t))||void 0}function A(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(hn(o,h(t)))return!0;return!1}return hn(e.value,h(t))}function C(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function I(e){e.props.firstCommit=!0;let t=null;e.on("commit",(()=>{if(0===e.props.inputStd.length&&e.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(e),void(t=e.props.inputStd);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=b(e);t instanceof Promise&&t.then((()=>{w(e)}))}"function"!=typeof e.props.optionLoader||e.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(t,e.props.inputStd)?0===e.props.optionsLoadingCounter&&w(e):(t=e.props.inputStd,async function(e){const t=Qr(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>hn(h(e),t))))):e.props.inputStd;if(o.forEach((o=>{$(e,o,Array.isArray(t)&&t.find((e=>hn(h(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{w(e),e.props.optionLoadingCounter||e.off(t)}))}else w(e)}(e))}))}function M(e){function t(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const n=new MutationObserver((n=>{const r=n[0].target;if("overscroll"===e.props.behavior&&r.id!==`${e.props.id}_popover`)return;const s=e.props.positionListBox(t);es.delete(e),o(e,s);let a,l=null;const i=new ResizeObserver((()=>{clearTimeout(a),a=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),l||(l=e.on("prop:expanded",(()=>{i.disconnect(),e.off(l)})))}))}));i.observe(t)}));n.observe(t,{childList:!0,subtree:!0})}function o(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||es.has(e))return;const r=e.props.options.reduce(((t,o,n)=>{var r,s,a;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;if("group"in o&&(null===(s=o.options)||void 0===s?void 0:s.length))return o.options.forEach(((o,r)=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}_${r}`);a&&t.push([a,o])})),t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_listitem_${n}`);return l&&t.push([l,o]),t}),[]),s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);s&&r.push([s,e.props.loadMoreOption]),es.add(e),r.length&&n(e,r,t)}function n(e,t,r){var s,a,l,i;const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const o=p?p.getBoundingClientRect():{top:0,bottom:0};if(r=null,e.props.mouseY>o.top&&e.props.mouseY<o.bottom){let o=r||0,n=r;const s=(t,o)=>{var n;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){r=t;const s=o[1];return s&&!(null===(n=s.attrs)||void 0===n?void 0:n.disabled)?e.props.activeValue=h(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==n&&s(n,t[n]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==n&&(n--,n<0&&(n=null))}while(null!==o||null!==n)}null===r&&(e.props.activeValue=void 0)}e.props.trackHover||T(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(a=e.store.loading)||void 0===a?void 0:a.value)&&(null===(l=e.store.hasNextPage)||void 0===l?void 0:l.value)&&p.scrollTop+p.offsetHeight>p.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!0)),es.has(e)?requestAnimationFrame(n.bind(null,e,t,r)):o(e,r)):es.delete(e)}if(!Zn)return;e.props.positionListBox=function(e,t){var o,n;let r=null;if(e.props.activeDescendant){r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>hn(e.value,h(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&T(e)}if("undefined"==typeof window)return r;const s=t.getBoundingClientRect(),a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(a){const t=a.getBoundingClientRect();t.top+t.height+s.height>window.innerHeight&&t.top+t.height>s.height?(e.props.invertPopover=!0,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):(e.props.invertPopover=!1,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}))}return r}.bind(null,e),e.props.styleWrapper=E.bind(null),e.on("mounted",(()=>{mn(`${e.props.id}_popover`,t.bind(null,e),e.props.__root)}));const r=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_popover`);if(n){const o=n.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}},s=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.props.trackHover=!0};e.on("prop:trackHover",(({payload:t})=>{var o,n,r;Zn&&(t?null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",s):null===(o=e.props.__root)||void 0===o||o.getElementById(`${e.props.id}_popover`))})),e.on("prop:expanded",(({payload:t})=>{e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:t||e.props.forceExpanded?"999":"-1",pointerEvents:t?"auto":"none"},t?(document.addEventListener("mousemove",r),e.props.styleWrapper(),_(e)):document.removeEventListener("mousemove",r)})),e.on("prop:trackHover",(({payload:t})=>{var o,n;Zn&&(t?null===(n=document.getElementById(`${e.props.id}_popover`))||void 0===n||n.removeEventListener("scroll",s):null===(o=document.getElementById(`${e.props.id}_popover`))||void 0===o||o.addEventListener("scroll",s))})),e.on("prop:activeValue",(({payload:t})=>{if(t===Jr)return void(e.props.activeDescendant=`${e.props.id}_load_more`);let o,n=-1;for(let r=0;r<e.props.options.length;r++){if("group"in e.props.options[r])for(let s=0;s<e.props.options[r].options.length;s++)if(hn(h(e.props.options[r].options[s]),t)){n=s,o=r;break}if(hn(h(e.props.options[r]),t)){n=r;break}}e.props.activeDescendant=n<0?void 0:void 0===o?`${e.props.id}_listitem_${n}`:`${e.props.id}_listitem_${o}_${n}`}))}function T(e){var t,o;if(!Zn)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function E(){}function O(e){e.on("created",(()=>{if(!e.context||!Zn)return;e.context.fns.isActive=D.bind(null,e),e.context.fns.isSelected=t=>A(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(hn(h(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=Y,e.context.handlers.selectOption=t=>o=>U.call(null,e,t,o),e.context.handlers.loadMore=m.bind(null,e),e.context.handlers.removeSelection=t=>o=>W(e,t,o),e.context.handlers.tagTouchstart=t=>o=>W(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?P.bind(null,e,t):B.bind(null,e),e.context.handlers.selectionBlur=()=>H.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>hn(e,h(t)),e.context.handlers.tagClick=t=>N.bind(null,e,t),e.context.handlers.tagFocus=t=>R.bind(null,e,t),e.context.handlers.tagBlur=()=>K.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){var n;if(o&&o.relatedTarget instanceof HTMLElement){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(t instanceof HTMLElement&&t.contains(o.relatedTarget))return}t(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,e),e.context.handlers.touchmove=F.bind(null,e),e.context.handlers.touchend=V.bind(null,e)}))}function F(e,t){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=ts.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else ts.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function V(e){ts.delete(e)}function B(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function P(e,t,o){o.currentTarget instanceof HTMLElement&&(hn(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus()))}function H(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function N(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(hn(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus())))}function R(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=h(t),e.props.justFocused=!0)}function K(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function W(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},x(e,t))}function Y(e){e.stopPropagation()}function U(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},S(e,t))}function Z(e,t,o,n){!function(e){e.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===e.props.deselect?e.props.deselect=!0:e.props.deselect=vn(e.props.deselect),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.options||(xn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),e.props.allOptions=k(e.props.options),e.props.selections=[],e.props.memoOptions=[],e.props.invertPopover=!1,e.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},e.props.decrementCount=0,e.props.page=1,e.props.loadMoreOption={label:"Load more",value:Jr},e.props.loadOptions=b,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=vn(e.props.searchable),e.props.loadOnScroll=vn(e.props.loadOnScroll),e.props.multiple=vn(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=vn(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&vn(e.props.openOnRemove),e.props.hasNextPage=y.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=vn(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0),e.on("mounted",(()=>C(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{C(e)}),10)))}(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,h(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd]))))}(n):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(n),e(n),I(n),function(e){e.on("created",(()=>{e.context&&(e.props.trackHover=!0,void 0!==e.props.disabled||e.props.optionsLoader||!e.props.options||e.props.options.length||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||(e.props.disabledInternally=!0),M(e),e.props.loadOnCreated&&!e.props.optionsLoaded?b(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=vn(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),O(n),t(n),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(Gr))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Gr)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=k(e.props.options),e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0),_(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(Zn)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),e.props.searchExpand||(o.value="",o.value=e.props.inputText))}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(n),o(n)}function j(e){var t,o;e.props.searchValue||null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===o||o.focus()}function z(e,t,o){var n,r,s;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(h(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&o.push(Jr);let a=-1;e.props.activeValue&&(a=o.findIndex((t=>hn(t,e.props.activeValue)))),-1===a&&o.length?e.props.activeValue=o[0]:"ArrowDown"===t&&o.length>a+1?e.props.activeValue=o[a+1]:"ArrowUp"===t&&a>0?e.props.activeValue=o[a-1]:"ArrowUp"===t&&0===a&&(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===s||s.focus(),e.props.expanded=!1)}else e.props.expanded||"ArrowDown"!==t||(e.props.expanded=!0)}function q(e,t){var o,n,r;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length&&!e.props.inputText){if("ArrowLeft"===t)return e.props.selections.length&&(null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===n||n.focus(),e.props.selections[e.props.selections.length-1]?e.props.activeSelectionValue=h(e.props.selections[e.props.selections.length-1]):e.props.activeSelectionValue=void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(r=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===r||r.focus(),e.props.selections[0]?e.props.activeSelectionValue=h(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function G(e){var t,o;e.props.expanded=!0,null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()}function X(e,t,o,n=!0){var r,s,a,l,i,p,d;const c=o.key;if(o.altKey){const n=f(),r=e.props.selections.findIndex((e=>hn(h(e),h(t)))),s=[...e.props.selections];"ArrowRight"===o.key?r<e.props.selections.length-1&&(s.splice(r,1),s.splice(r+1,0,t)):"ArrowLeft"===o.key&&r>0&&(s.splice(r,1),s.splice(r-1,0,t)),e.props.activeSelectionValue=h(t),e.input([...s.map(h)]),setTimeout((()=>{n instanceof HTMLElement&&n.focus()}),100)}else{const o=e.props.selections.findIndex((e=>hn(h(e),h(t))));if(-1===o)return;const u="ArrowRight"===c?o+1:o-1;if(u>=e.props.selections.length){if(!n)return e.props.expanded=!0,e.props.activeSelectionValue=void 0,void(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus());null===(l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}`))||void 0===l||l.focus()}else if(u<0&&0===o)null===(p=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`))||void 0===p||p.focus();else if(u<0)return;const f=null===(d=e.props.__root)||void 0===d?void 0:d.getElementById(`${e.props.id}_tag-wrapper_${u}`);f&&f.focus(),e.props.selections[u]?e.props.activeSelectionValue=h(e.props.selections[u]):e.props.activeSelectionValue=void 0}}function J(e,t,o){var n;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.findIndex((e=>hn(h(e),h(t))));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_tag-wrapper_${s}`);a&&a.focus(),e.props.userAction={type:"tagDelete"},x(e,t)}function Q(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(L(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===Jr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>hn(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}function ee(e){e.props.expanded&&(e.props.expanded=!1)}function te(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o,!1);break;case"Delete":case"Backspace":J(e,t,o)}}function oe(e,t,o){if(e.props.disabled)return;switch(o.key){case"ArrowUp":case"ArrowDown":!function(e,t,o){var n,r,s,a;o.preventDefault();const l=o.key,i=e.props.selections.findIndex((e=>hn(h(e),h(t))));if(-1===i)return;const p="ArrowDown"===l?i+1:i-1;if(p<0&&(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus()),p<0||p>=e.props.selections.length)return;const d=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${p}`);d&&d.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[p])||void 0===a?void 0:a.value)||void 0}(e,t,o);break;case"Enter":break;case"Tab":!function(e,t,o){var n,r,s,a;if(t){const l=e.props.selections.findIndex((e=>hn(h(e),h(t))));if(-1===l)return;const i=o.shiftKey?l-1:l+1;if(i>=e.props.selections.length)return;if(i<0)return void(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus());const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${i}`);p&&p.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[i])||void 0===a?void 0:a.value)||void 0}}(e,t,o);break;case"Delete":case"Backspace":!function(e,t){var o;if(t){const n=e.props.selections.findIndex((e=>hn(h(e),h(t))));if(-1===n)return;const r=e.props.selections[n+1]?n+1:n-1,s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${r}`);s&&s.focus(),e.props.selections[r]?e.props.activeSelectionValue=h(e.props.selections[r]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),x(e,t)}(e,t)}}function ne(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e){e.props.expanded&&(e.props.expanded=!1)}(e);break;case"ArrowUp":case"ArrowDown":z(e,o,t);break;case"ArrowLeft":case"ArrowRight":q(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":j(e);break;default:e.emit("unusedKeydown",t)}}function re(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e,t){var o,n,r;e.props.expanded=!1,e.props.multiple&&e.props.selections.length&&"autocomplete"===e.props.type&&"option"===e.props.selectionAppearance&&(t.preventDefault(),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_0`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[0])||void 0===r?void 0:r.value)||void 0)}(e,t);break;case"ArrowUp":case"ArrowDown":z(e,o,t);break;case"ArrowRight":case"ArrowLeft":q(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":j(e)}}function se(e,t){var o;if(t.stopPropagation(),0===t.detail)return;if(e.props.disabled)return;e.props.attrs.onClick&&e.props.attrs.onClick(t);const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);e.props.justOpened?e.props.justOpened=!1:e.props.expanded?e.props.expanded=!1:(n&&"mouse"!==t.pointerType?(e.props.mouseX=-1,e.props.mouseY=-1):(e.props.mouseX=t.clientX,e.props.mouseY=t.clientY),e.props.expanded=!0,null==n||n.focus())}function ae(e){e.props.disabled||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.justOpened=!0,e.props.expanded=!0))}function le(e){let t,o="";e.on("unusedKeydown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){if(!o&&" "===n.key)return void function(e,t){var o;if(t.preventDefault(),e.props.expanded){if(e.props.activeValue===Jr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>hn(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}(e,n);e.props.expanded=!0,clearTimeout(t),o+=n.key;const r=e.props.allOptions.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=h(r)),t=setTimeout((()=>{o=""}),400)}}))}function ie(e){pe(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,pe(e)})),Zn&&mn(`${e.props.id}_selections`,ce.bind(null,e),e.props.__root)}function pe(e){e.isCreated&&(e.props.selections.length&&e.props.lastVisibleIndex&&e.props.selections.length-e.props.lastVisibleIndex>1?e.props.truncationCount="+ "+(e.props.selections.length-e.props.lastVisibleIndex-1).toString():e.props.truncationCount=void 0,e.props.formattedSelections=e.props.selections.map(((t,o)=>e.props.lastVisibleIndex&&o===e.props.lastVisibleIndex&&0!==o?e.props.lastTruncatedElText&&o===e.props.selections.length-1?e.props.lastTruncatedElText:o===e.props.selections.length-1?t.label:t.label+"...":o===e.props.selections.length-1?t.label:t.label+", ")))}function de(e){var t,o;if(!Zn||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const r=n.parentNode;if(!(r instanceof HTMLElement))return;let s=n.getBoundingClientRect().width;const a=.98*r.getBoundingClientRect().width,l=Array.prototype.slice.call(n.children),i=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<i.length;e++)t.push([i[e],l[e]]);for(let r=t.length-1;r>=0;r--){const l=t[r];if(!(l[1]instanceof HTMLElement))return;n+=l[1].getBoundingClientRect().width+parseFloat(window.getComputedStyle(l[1]).marginRight)+parseFloat(window.getComputedStyle(l[1]).marginLeft);const i=s-n;if(a>i){const t=l[0].label;e.props.skipFormatSelections=!0,l[1].textContent=t;let n=!1;for(let s=t.length;s>=0;s--){if(e.props.skipFormatSelections=!0,l[1].textContent=t.slice(0,s).trim()+"...",i+l[1].getBoundingClientRect().width<a){if(s<4){e.props.lastVisibleIndex=r-1,e.props.lastTruncatedElText=null;break}if(e.props.lastVisibleIndex=r,e.props.lastTruncatedElText&&l[1].textContent.slice(0,4)===e.props.lastTruncatedElText.slice(0,4))break;e.props.lastTruncatedElText=null===(o=l[1])||void 0===o?void 0:o.textContent;break}0===s&&(n=!0)}l[1].textContent=e.props.lastTruncatedElText&&!n&&0!==r?e.props.lastTruncatedElText:t,null===e.props.lastVisibleIndex&&(e.props.lastVisibleIndex=0===r?0:r-1,e.props.lastTruncatedElText=null),setTimeout((()=>{pe(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,pe(e)}function ce(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:de(e))})),n=new ResizeObserver((()=>{de(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}function ue(e){var t,o;if("undefined"==typeof window)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!r||!n)return;const s=n.style.paddingTop,a=n.style.paddingBottom,l=n.style.paddingLeft;n.style.paddingTop="0",n.style.paddingBottom="0",n.style.paddingLeft="0";const i=r.getBoundingClientRect(),p=n.getBoundingClientRect(),d=Math.round(i.top-p.top)+"px",c=Math.round(i.left-p.left-5)+"px",u=Math.max(Math.round(Math.min(p.height-p.top,window.innerHeight)-(i.top+i.height)),0)+"px";n.style.paddingTop=s,n.style.paddingBottom=a,n.style.paddingLeft=l,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:d,paddingLeft:c,paddingBottom:u},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${i.width+"px"}, calc(100vw - 4em))`:i.width+"px",maxWidth:"calc(100vw - 4em)"}}function fe(e,t){var o,n;let r=null;if(e.props.activeDescendant){const s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!s)return r;e.props.ignoreScroll=!0;const a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_listbox`);if(!a)return r;const l=t.getBoundingClientRect(),i=a.getBoundingClientRect(),p=parseInt(getComputedStyle(t).paddingTop),d=parseInt(getComputedStyle(t).paddingBottom),c=s.offsetTop-p,u=Math.max(c-p,0),f=Math.max(t.scrollHeight-d-c-l.height,0),v=i.height-u-f;t.scrollTop=c;const m=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:u<d?0:c-d},g=Math.min(150,i.height);u>0&&f>0||0===u&&0===f||v>g?t.scrollTop=c:m();t.clientHeight/2<t.scrollTop&&(r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>hn(e.value,h(t))))),-1===r&&(r=null)}return r}function he(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&wn(300,[e]),e.props.dropdownWrapperStyles=gn(os),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=ue.bind(null,e),e.props.positionListBox=fe.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){ls=document.documentElement.scrollTop;for(const e in ns)as[e]=document.documentElement.style[e],document.documentElement.style[e]=ns[e];for(const e in rs)ss[e]=document.body.style[e],document.body.style[e]=rs[e];document.body.scrollTop=ls}():function(){for(const e in ns)document.documentElement.style[e]=as[e];for(const e in rs)document.body.style[e]=ss[e];document.body.scrollTop=0,document.documentElement.scrollTop=ls}())}))}function ve(e){e.addProps(["multiLine"]),e.on("created",(()=>{Zn&&(e.props.multiLineHeight=void 0,mn(`${e.props.id}_selections`,me.bind(null,e),e.props.__root))}))}function me(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),ge(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function ge(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function $e(e){function t(){const{x:t,y:o,width:s,height:a}=function(e,t){if(!e||!t)return{x:0,y:0};const{left:o,top:n,width:r,height:s}=t.getBoundingClientRect();return{x:o+window.scrollX,y:n+s+window.scrollY,width:r,height:s}}(n,r);e.props.popoverAncestorCoordinates={x:t,y:o,width:s,height:a},e.props.popoverCoordinates={x:t,y:o,width:s,height:0}}function o(t){t?(null==n||n.showPopover(),setTimeout((()=>{e.props.popoverCoordinates.height=(null==n?void 0:n.offsetHeight)||0}),5)):(null==n?void 0:n.matches(":popover-open"))&&(null==n||n.hidePopover(),e.props.popoverCoordinates.height=0)}if(e.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),e.props.popover=vn(e.props.popover)?"manual":void 0,"input"!==e.type||"overscroll"===e.props.behavior)return;let n=null,r=null,s=[],a=null;if(e.props.popoverOffset=vn(e.props.popoverOffset)?parseInt(e.props.popoverOffset):0,!e.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void console.warn('FormKit: Popover API is not supported in this browser — input panels will be rendered with fallback CSS positioning. This could result in inaccessible inputs due to parent containers using "overflow: hidden" or z-index conflicts.');const l=()=>{document.removeEventListener("resize",a),document.removeEventListener("scroll",a),s.forEach((e=>{e.removeEventListener("scroll",a)}))};e.on("mounted",(()=>{e.context&&(e.props.usePopover=!0,e.props.popoverCoordinates={x:0,y:0,width:0,height:0},e.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),e.on("destroyed",(()=>{l()})),e.on("prop:expanded",(({payload:i})=>{var p;e.context&&(!1===i?l():mn(`${null===(p=e.context)||void 0===p?void 0:p.id}_popover`,(()=>{if(!e.context)return;n=document.querySelector(`#${e.context.id}_popover[popover]`)||document.querySelector(`#${e.context.id}_popover [popover]`),r||(r=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(n)),t(),o(i),a=is((()=>{e.context&&(t(),o(i))}),10),document.addEventListener("resize",a),document.addEventListener("scroll",a),s=[];let l=null==n?void 0:n.parentElement;for(;l;)l.scrollHeight>l.clientHeight&&s.push(l),l=l.parentElement;s.forEach((e=>{e.addEventListener("scroll",a)}))})))}))}function be(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v;if(null!==(t=(p=e.props).removeControl)&&void 0!==t||(p.removeControl=!0),null!==(o=(d=e.props).upControl)&&void 0!==o||(d.upControl=!0),null!==(r=(c=e.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=e.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(h=e.props).addLabel)&&void 0!==l||(h.addLabel=!1),null!==(i=(v=e.props).addAttrs)&&void 0!==i||(v.addAttrs={}),e.props.draggable=vn(e.props.draggable),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(Array.isArray(e.value))if(e.value.length<e.props.min){const t=n(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(n(e.props.min,(()=>({}))),!1);e.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(e,e.context.fns)}function ye(e,t){function o(){return Array.isArray(t.value)?t.value:[]}function n(e){t.input(e)}if(!t.context)return;const r={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[Tn({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};En({parent:e,getValues:o,setValues:n,config:r}),t.on("prop:disabled",(({payload:t})=>{r.disabled=t,En({parent:e,getValues:o,setValues:n,config:r})})),t.on("prop:draggable",(({payload:t})=>{r.disabled=!t,En({parent:e,getValues:o,setValues:n,config:r})}))}function xe(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function we(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function _e(e,t){const{x:o,y:n}=Te(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function ke(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?Ee(e,t,o):e.input(t+1,!1))}function Se(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,xe(e);const o=sa.get(e);o&&(o.abort(),sa.delete(e))}function Le(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>Se(e,t)),{signal:n.signal}),sa.set(e,n),1===e.props.step?e.input(t+1,!1):Ee(e,t,o)}function De(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?Oe(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?Oe(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function Ae(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function Ce(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(xe(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):Ee(e,t,o,!!e.props.dragStarted)))}function Ie(e){xe(e)}function Me(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void Ee(e,t,o)}function Te(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function Ee(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=Te(o),a=o.currentTarget.getBoundingClientRect();let l=Oe((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):xe(e,l):e.input(0)}function Oe(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}function Fe(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=v.bind(null,e),e.props.reloadOnCommit=vn(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=vn(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&Zn&&(e.context.handlers.focus=Pe.bind(null,e),e.context.handlers.input=Ve.bind(null,e),e.context.handlers.focus=Pe.bind(null,e),e.context.handlers.click=Be.bind(null,e),e.context.handlers.toggleListbox=He.bind(null,e),e.context.handlers.toggleListboxKeydown=Ne.bind(null,e),e.context.handlers.keydown=re.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>oe(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o);break;case"Delete":case"Backspace":J(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>h(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||jr.delete(e)}))}function Ve(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&v(e,e.props.searchValue,!0)}function Be(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function Pe(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function He(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function Ne(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),He(e))}function Re(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Ke(e)})),e.on("created",(()=>{if(!e.context||!qa)return;e.on("handleSearchInput",(({payload:t})=>{""===t?(e.props.searchValue=null,e.input([])):t&&0===e.props.inputStd.length?e.props.searchValue=t:t&&e.props.inputStd.length>0&&(e.props.searchValue=function(e){var t;const o=Ye(e);if(e.props.highlightedRange){const[t,n]=We(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(e)),!e.props.expanded&&t?e.props.expanded=!0:!t&&e.props.expanded&&(e.props.expanded=!1)})),function(e){mn(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Ga.set(t,e)}),e.props.__root),qa&&!Xa&&(Xa=!0,document.addEventListener("selectionchange",(()=>{const e=f();if(e instanceof HTMLInputElement&&Ga.has(e)){const t=Ga.get(e);t&&function(e){clearTimeout(za.get(e)),za.set(e,setTimeout((()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=Ye(e),a=t.findIndex((e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end))),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=We(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),i=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=i}else e.props.highlightedRange=void 0,Ke(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(e);const o=e.context.handlers.keydown;e.context.handlers.keydown=n=>{o(n),function(e,o){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(o.key)&&o.target instanceof HTMLInputElement&&null!==o.target.selectionEnd&&null!==o.target.selectionStart){if(0===o.target.selectionStart&&o.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===o.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=Ye(e),n=null===(r=t[t.length-1])||void 0===r?void 0:r.end;o.target.selectionStart<n&&(o.target.selectionStart=Math.max(0,"ArrowLeft"===o.key?o.target.selectionStart-2:o.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(o.key))e.props.highlightedRange&&!e.props.searchValue?(x(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault());else if(o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.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)o.preventDefault();else if("Tab"===o.key)return;"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault()}(e,n)};const n=e.context.handlers.focus;e.context.handlers.focus=t=>{n(e,t);const o=new Event("selectionchange");document.dispatchEvent(o)},e.on("blur",(()=>{e.props.selections.length?(e.props.inputText=e.props.selections.map((e=>e.label)).join(", "),e.props.searchValue=null):e.props.selections.length||(e.props.inputText="",e.props.searchValue="")}))})),e.on("prop:expanded",(({payload:t})=>{t||e.props.inputStd.length?t&&(e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],v(e,e.props.searchValue))):(e.props.searchValue="",e.props.inputText="")})),e.on("prop:selections",(()=>{var t;const o=[...e.props.selections].map((e=>e.label)).join(", ");let n="";if(qa&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),f()===o&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}e.props.inputText=`${o}${n}`,e.props.reloadOnCommit&&(e.props.searchValue="",v(e,e.props.searchValue))}));const t=(t,o=!1)=>{var n,r;const s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=Ye(e),l=t>=0?t:a.length-1;if(void 0===a[l])return!1;const i=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=i&&s.selectionStart<=i+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&o!==t.option&&(o=t.option,_(e))}))}function Ke(e){var t;if(!qa)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function We(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function Ye(e){const t=Qr(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e}),[]):[]}function Ue(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],v(e,e.props.searchValue,!0))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&v(e,e.props.searchValue,!0))}))}(e)}function Ze(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand&&(e.props.inputText="",e.props.searchValue=""),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||e.props.searchExpand||(e.props.options=[],v(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&v(e,e.props.searchValue,!0)}))}(e)}function je(e,t){var o;if(ql.has(e))return;ql.set(e,[]),t.reverse&&ii.add(e),t.prefix&&pi.set(e,t.prefix),t.suffix&&di.set(e,t.suffix),Je(e,t.pattern,t.partOverrides,t.explicitParts);const n=Ql.get(e),r=null==n?void 0:n.some((e=>tt(e))),s=null==n?void 0:n.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!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&ei.add(e),ti.set(e,a),t.onChange&&ai.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if($i)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=ql.get(e);if(null==r?void 0:r.length){const o=(null!==(n=Gl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;ut(e,s),e.setSelectionRange(...s.selectionAfter),Gl.set(e,o),ai.has(e)&&ai.get(e)(s,e)}}),{once:!0})}(e,o.inputType);o.preventDefault();const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=st(e),a=e.value;n&&at(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Ft(e);case"ArrowLeft":return t.preventDefault(),Ft(e,-1);case"ArrowUp":return void(Vt(e,1)&&t.preventDefault());case"ArrowDown":return void(Vt(e,-1)&&t.preventDefault());case"Tab":return fi?void t.preventDefault():void(Ft(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=ei.has(e),n=ti.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;wt(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(et(t)||tt(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:o)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===ti.get(e)){const[o]=It(e),n=Pt(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){ni.set(e,it(e,t));const n=async()=>{if(!gi||f()!==e)return;"select"===ti.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=st(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=pt(e,t);const[o]=It(e),n=Pt(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&ni.set(e,it(e,o[n]))}(e));const t=ni.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),ni.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(ni.get(e))return;Wt(e),t=pt(e,t);const[o]=It(e),n=Pt(e,t),r=void 0!==n&&it(e,o[n]);r&&!rt(t,r)&&ct(e,r,!0)}(e,t.detail))),at(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function ze(e){var t,o;if(ui.has(e))return;const n=null!==(t=ql.get(e))&&void 0!==t?t:[],r=n[null!==(o=Gl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=It(e,r.valueAfter),s=Pt(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];ui.set(e,[r,l])}}}function qe(e){ui.delete(e)}function Ge(e,t){const o="string"==typeof e||!ql.has(e),n="string"==typeof e?Xe(e):e;if(o)t.prefix&&pi.set(n,t.prefix),t.suffix&&di.set(n,t.suffix),n.value=lt(n,n.value),je(n,t);else{const e=Ht(n),o=n.value;n.value="",at(n,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return n.value}function Xe(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Je(e,t,o,n,r){r=e&&ii.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(vi);if(!e)return t;const o={...e},n=[];for(const r of t)if(!nt(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Qe(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Qe(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=ft(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?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,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const i=function(e,t,o){return e.reduce(((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=Je(null,r,void 0,t,o);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,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&i[n]&&e.push(i[n])}return e}),[]);return r&&c.reverse(),e&&Ql.set(e,c),c}function Qe(e){return!!e&&(nt(e)||et(e)||tt(e))}function et(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&ot(e))}function tt(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&ot(e))}function ot(e){return!!e&&("placeholder"in e&&"token"in e)}function nt(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function rt(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function st(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function at(e,t){var o;ii.has(e)&&Kt(t);let n=!1;switch(li.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=dt(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===ti.get(e)){const[s,a]=It(e),l=s.findIndex((e=>rt(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(et(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=yt(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ft(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-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(tt(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=wt(e,t,o);return Jl.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:xt(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=dt(t),n=t.selectionBefore,r=ii.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ht(o,s):s-=ht(o,s,"backward"));const l=ti.get(e);let i="";if("select"===l){const[o,n]=It(e),r=Pt(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];et(l)?i=l.placeholder.repeat(a-s):tt(l)&&([i,s]=rt(p,st(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ht(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Tt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Et(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=wt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:Dt(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(ii.has(e)&&n&&Kt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=it(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){ai.has(e)&&ci.set(e,(()=>{ci.delete(e),n&&ai.get(e)(n,e)})),li.set(e,"beforeCallback");let t=null!==(o=ql.get(e))&&void 0!==o?o:[];const r=Gl.get(e);r&&(t=t.slice(0,r),Gl.delete(e)),t.push(n),ql.set(e,t),gi&&f()===e&&"function"==typeof document.execCommand&&!$i?(ct(e,[0,e.value.length,"forward"],!0),$i=!0,document.execCommand("insertText",void 0,n.valueAfter),$i=!1):ut(e,n),gi&&f()===e&&ct(e,n.selectionAfter);const s=ci.get(e);s&&s(),Wt(e)}li.set(e,"complete")}function lt(e,t){var o,n;const r=null!==(o=pi.get(e))&&void 0!==o?o:"",s=null!==(n=di.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function it(e,t){const o=pi.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function pt(e,t){const o=pi.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function dt(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function ct(e,t,o=!1){o&&(Xl.add(e),setTimeout((()=>Xl.delete(e)),5)),ni.get(e)&&ni.set(e,t),e.setSelectionRange(...t)}function ut(e,t,o="After"){if(e.value=t[`value${o}`],gi){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ft(e){if(null==e)return"";const t=oi.test(e.charAt(0))&&oi.test(e.charAt(1))?2:1;return e.substring(0,t)}function ht(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:oi.test(e.charAt(t))&&oi.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ft(e.substring(t)).length}function vt(e,t){const o=ft(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function mt(e){const t=ft(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function gt(e,t){const o=ft(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function $t(e,t){for(;t.buffer;){const o=ft(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function bt(e,t){const o=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(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(ht(t.buffer,0))}return null}function yt(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function xt(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=st(e);o=[n[0],t.endPos,"none"];const[r,s]=It(e,t.value),a=Pt(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],i=s[a],p=t.value.slice(l[0],l[1]);if(et(i)&&yt(p,i).length===p.length&&a<r.length-1)return hi(),r[a+1];if(tt(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=Tt(o.values,r);if(s)return Ct(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Et(i.values,p)?[l[1],l[1],"forward"]:(hi(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return rt(s,n)||(Xl.add(e),setTimeout((()=>Xl.delete(e)),5)),s}return l}function wt(e,t,o,n){var r,s;const a=null!==(r=Ql.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:ei.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:ti.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:It(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return _t(a,l,void 0,n),l}function _t(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":St(o,t,e.at(-1)===o);break;case"char":Lt(o,t,l);break;case"enum":kt(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};_t(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=nt(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),o){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(o.repeat&&c&&s)return o.repeats++,_t(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),nt(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function kt(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=Tt(e.values.concat([e.placeholder]),n);if(r){const s=Ct(n,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}),o?t.buffer=t.buffer.substring(o.length):bt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=bt(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),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 St(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?ft(t.data):"",s=ft(n);if(e===s)n=vt(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=gt(t,n),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 Lt(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=ft(t.data);if(e.pattern.test(n))return vt(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void $t(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=ft(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,mt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return mt(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function Dt(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=It(e),a=Pt(e,r,s),[l,i]=It(e,t.value),p=void 0!==a&&At(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every(((e,o)=>At(t.value,e,i[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function At(e,t,o){if(nt(o))return!1;if(et(o)){let n=t[0];for(;n<t[1];){const t=ft(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!tt(o)||e.substring(t[0],t[1])===o.placeholder}function Ct(e,t){let o="";do{const n=ft(e).toLowerCase(),r=ft(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function It(e,t){const o=Ql.get(e);if(!o)return[[],[]];if(ri.has(e))return ri.get(e);const n=null!=t?t:lt(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(nt(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(et(a)&&et(e)&&e.token===a.token)i++;else if(et(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(tt(e)){l&&r.push([l,i,"none"]),Ot(e)||(p=!1);const t=Mt(n,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&&ri.set(e,d),d}function Mt(e,t,o){if(Ot(t))return t.values[0].length;const n=e.slice(o),r=Tt(t.values.concat([t.placeholder]),n);return r?r.length:0}function Tt(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const s=ft(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),i=l.find((e=>e.toLowerCase()===a));return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=Tt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Et(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function Ot(e){if(!si.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;si.set(e,e.values.every((e=>e.length===t)))}return si.get(e)}function Ft(e,t=1){const[o]=It(e),n=Pt(e,pt(e,st(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...it(e,o[n+t])),!0)}function Vt(e,t=1){const[o,n]=It(e),r=Pt(e,st(e));if(void 0!==r&&r in n){const s=n[r];if(tt(s)){const n=o[r],a=e.value.slice(n[0],n[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:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout((()=>at(e,t)),0),!0}}}return!1}function Bt(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return Bt(e.slice(...r),t)}function Pt(e,t,o){const[n]=null!=o?o:It(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!rt(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==r)return r;const[s,a]=n.reduce(((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e)),[new Set,{}]),l=Bt([...s],t[1]);return l in a?a[l]:void 0}function Ht(e){var t,o;const n=null!==(t=ql.get(e))&&void 0!==t?t:[];return n[null!==(o=Gl.get(e))&&void 0!==o?o:n.length-1]}function Nt(e,t=!1){const o=Ht(e);return o&&(o.complete||t)?ii.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Rt(e){var t;const o=Ht(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Kt(e){const t=e=>[...e].reverse().join(""),o=(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=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function Wt(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}function Yt(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(bi);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(bi);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function Ut(e,t=1){const o=Yt(e);return o.setDate(o.getDate()+t),o}function Zt(e){const t=Yt(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function jt(e){return Zt(e).getDate()}function zt(e,t=1,o=!1){const n=Yt(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=jt(n);n.setDate(e<r?e:r)}return n}function qt(e,t=1,o=!1){const n=Yt(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=jt(n);n.setDate(e<r?e:r)}return n}function Gt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Xt(e,t,o,n=!1){function r({partName:e,partValue:t,token:n}){if("literal"===e)return t;const r=s[e];if("hour"===e&&"H"===n)return r.replace(/^0/,"");if(!("minute"!==e&&"second"!==e||"mm"!==n&&"ss"!==n||1!==r.length))return`0${r}`;if("dayPeriod"===e){const e=to(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Jt(-1*a.getTimezoneOffset()):r}const s=function(e,t,o,n=!1){function r(e,t=!1){const r=`${o}-u-hc-${t?"h12":"h23"}`;if(i.push(...new Intl.DateTimeFormat(r,e.reduce(((e,t)=>"literal"===t.partName?e:(n&&Li.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(Gt)),n&&p.length)for(const e of p){let t=[];switch(e.token){case"MMMM":t=new Intl.DateTimeFormat(r,{dateStyle:"long"}).formatToParts(s).map(Gt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(Gt)}const o=t.find((t=>t.type===e.partName)),n=i.findIndex((t=>t.type===e.partName));o&&n>-1&&(i[n]=o)}}const s=Yt(e),a=t.filter((e=>e.hour12)),l=t.filter((e=>!e.hour12)),i=[],p=[];a.length&&r(a,!0);l.length&&r(l);return i.reduce(((e,t)=>(e[t.type]=t.value,e)),{})}(e,t,o,n),a=Yt(e);return t.map((e=>({...e,value:r(e)})))}function Jt(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function Qt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function eo(e){return["numeric","2-digit"].includes(e.partValue)}function to(e,t){const o=Ai.get(t);if(o&&o[e])return o[e];const n=new Date(yi);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(Gt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return Ai.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function oo(e,t="+0000"){const o=Yt(e),n=function(e){Qt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function no(e,t){const o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:t,hourCycle:"h23"}).formatToParts(e).map(Gt),n={};return o.forEach((e=>{n[e.type]=e.value})),new Date(`${n.year}-${n.month}-${n.day}T${n.hour}:${n.minute}:${n.second}Z`)}function ro(e,t="UTC",o="device"){o="device"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=Yt(e),r=no(n,t);return Jt((no(n,o).getTime()-r.getTime())/1e3/60)}function so(e,t){function o(e,[t,o,n]){const r=Object.keys(o)[0];return{option:o,partName:r,partValue:o[r],token:t,pattern:n,hour12:e}}if(Ci.includes(e)||"object"==typeof e)return function(e,t){const o={timeZone:"UTC"};"string"==typeof e?o.dateStyle=e:("date"in e&&(o.dateStyle=e.date),"time"in e&&(o.timeStyle=e.time));const n=new Intl.DateTimeFormat(t,o),r=n.formatToParts(new Date(yi)).map(Gt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(Gt).find((e=>"hour"===e.type)),a=s&&"23"===s.value?24:12;return r.map((e=>{const o=e.type,n=function(e,t,o,n){const r=t.length,s=!isNaN(Number(t));let a;switch(e){case"year":return 2===r?Di.get("YY"):Di.get("YYYY");case"month":return s?1===r?Di.get("M"):Di.get("MM"):(a=ao(o,e,t),"long"===a?Di.get("MMMM"):Di.get("MMM"));case"day":return 1===r?Di.get("D"):Di.get("DD");case"weekday":switch(a=ao(o,e,t),a){case"narrow":return Di.get("d");case"short":return Di.get("ddd");default:return Di.get("dddd")}case"hour":return 12===n?1===r?Di.get("h"):Di.get("hh"):1===r?Di.get("H"):Di.get("HH");case"minute":return 1===r?Di.get("m"):Di.get("mm");case"second":return 1===r?Di.get("s"):Di.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Di.get("A"):Di.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Di.get("ZZ"):Di.get("Z");default:return}}(e.type,e.value,t,"hour"===e.type?a:void 0);if(void 0===n)return;const r=n[1][o];return r?(n[2]||(n[2]=new RegExp(`${n[0]}`,"g")),{option:{[o]:r},partName:o,partValue:r,token:n[0],pattern:n[2],hour12:12===a}):void 0})).filter((e=>!!e))}(e,t);let n=e,r=0;const s=e=>{if(e[2]||(e[2]=new RegExp(`(.)?(${e[0]})`,"g")),e[2].test(n)){let t=0;return n=n.replace(e[2],((e,o,n)=>"\\"===o?n:`${"string"==typeof o?o:""}{!${t++?r:r++}!}`)),!!t}return!1},a=function(e){const t=e.map((e=>e.partName)),o=new Set(t);if(t.length>o.size)throw new Error("Cannot reuse format tokens.");return e}(wi.filter(s).concat(_i.filter(s)).map(o.bind(null,!1)).concat(ki.filter(s).map(o.bind(null,!0)))),l=/^\{!(\d+)!\}$/;return n.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 ao(e,t,o){if(!xi.has(e)){const t=new Date(yi),o=[3,8,9,7,6,4,3],n=["weekday","month","dayPeriod"],r=["long","short","narrow"],s={};for(let a=0;a<12;a++){t.setMonth(0+a),a in o&&t.setDate(o[a]),t.setUTCHours(8+a);for(const o of r){const r=new Intl.DateTimeFormat(e,n.reduce(((e,t)=>Object.assign(e,{[t]:o})),{hour12:!0,timeZone:"UTC"})).formatToParts(t).map(Gt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(Gt).find((e=>"month"===e.type)),s=r.findIndex((e=>"month"===e.type));s>-1&&n&&(r[s]=n)}r.forEach((e=>{if("literal"===e.type)return;const t=e.type;s[t]=Object.assign(s[t]||{},{[e.value]:o})}))}}xi.set(e,s)}const n=xi.get(e);return n?n[t][o]:void 0}function lo(e,t="+0000"){const o="+"===t.slice(0,1);return oo(e,t.replace(o?"+":"-",o?"-":"+"))}function io(e,t="long",o="device",n=!1,r){let s;return"object"!=typeof e||e instanceof Date||({date:e,format:t,locale:o,genitive:n,partFilter:r,tz:s}=e),"ISO8601"===t?Yt(e).toISOString():(s&&(e=lo(e,ro(e,s))),o&&"device"!==o||(o=Intl.DateTimeFormat().resolvedOptions().locale),Xt(e,so(t,o).filter(null!=r?r:()=>!0),o,n).map((e=>e.value)).join(""))}function po(e,t="en",o=!1,n=(()=>!0)){return so(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return wi.concat(_i).concat(ki).sort(((e,t)=>e[0].length>t[0].length?1:-1)).reduce(((e,t)=>e.replace(t[0],`\\${t[0]}`)),e)}(t.token):t.token)),"").normalize("NFKC")}function co(e){const t=Yt(e);return t.setDate(1),t.setHours(0,0,0),t}function uo(e,t,o=7){let n,r;const s=Yt(e);switch(o){case"month":r=s.getDate(),n=jt(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Yt(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Yt(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,n=e-t;break;default:n=r=o}for(let e=0;e<=n||e<r;e++){if(e<=n){const o=Ut(s,e);if(t(o))return o}if(e&&e<=r){const o=Ut(s,-e);if(t(o))return o}}return null}function fo(e,t="en",o=!1){const n=(e,t)=>Array(e).fill("").map(((e,o)=>`${t(o)}`));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 fo("MM").map((n=>io(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>io(`2022-10-${o}`,e,t)));if("a"===e)return[to("am",t).toLowerCase(),to("pm",t).toLowerCase()];if("A"===e)return[to("am",t).toUpperCase(),to("pm",t).toUpperCase()];if(e.startsWith("Y")){const o=(new Date).getFullYear();return n(120,(e=>e+1)).reduce(((n,r)=>("120"!==r&&n.push(io(`${o+Number(r)}-06-06`,e,t)),n.unshift(io(o-Number(r)+"-06-06",e,t)),n)),[io(`${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 ho(e,t="ISO8601",o="device"){let n,r=()=>!0,s="backward";if("object"==typeof e?({date:n,format:t="ISO8601",locale:o="device",dateOverflow:s="backward",partFilter:r=(()=>!0)}=e):n=e,!n)throw new Error("parse() requires a date string.");const a=()=>{throw new Error(`Date (${n}) does not match format (${po(t,o)})`)};if("ISO8601"===t)return Yt(n);const l=Ci.includes(t)||"object"==typeof t,i=function(e){let t;for(const o of e){if("literal"===o.partName&&!isNaN(parseFloat(o.partValue)))throw new Error(`Numbers in format (${o.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==o.partName&&!(t.token in Si||o.token in Si||eo(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(so(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=vo(n,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(),o=t%100,n=Math.floor(t/100),r=Number(e);return 100*(n+(r>o+20?-1:0))+r}(e.value));else{const n=e.token;if(n.startsWith("d"))return;if("D"===n)c.set("DD",t);else if("H"===n||n.startsWith("h"))c.set("HH",t);else if("M"===n)c.set("MM",t);else if("a"===n||"A"===n)u=e.value.toLowerCase()===to("am",o).toLowerCase();else if("Z"===n)f=Qt(e.value);else{const t=fo(n,o,l).indexOf(e.value);if(-1!==t)switch(n){case"MMM":case"MMMM":c.set("MM",t+1)}}}}));let h=c.get("HH")||0;!1===u?(h+=12===h?0:12,c.set("HH",24===h?0:h)):!0===u&&12===h&&c.set("HH",0),c.set("MM",(c.get("MM")||1)-1);let[v,m,g,$,b,y]=Array.from(c.values());const x=jt(new Date(`${Mi(v)}-${Ii(m+1)}-10`));if(x<g&&"throw"===s)throw new Error(`Invalid date ${Mi(v)}-${Ii(m+1)}-${Ii(g)}`);g="backward"===s?Math.min(g,x):g;const w=`${Mi(v)}-${Ii(m+1)}-${Ii(g)}T${Ii($)}:${Ii(b)}:${Ii(y)}${f}`,_=new Date(w);return isFinite(+_)?_:a()}function vo(e,t){let o=0;let n=0;const r=[];let s;do{const[l,i]=[(a=t)[o++],a[o]];s=i;let p=1;if("literal"===l.partName)p=l.partValue.length;else if(l.token in Si)p=Si[l.token];else if(i)if("literal"===i.partName){if(p=e.indexOf(i.partValue,n)-n,p<0)throw new Error}else if("dayPeriod"===i.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(n+t)))){p=t;break}}else{const t=e.substring(n).search(/\d/);-1!==t&&(p=n+t)}else p=e.length;r.push({...l,value:e.substring(n,n+p)}),n+=p}while(s);var a;return r}function mo(e,t){const o=Yt(e),n=Yt(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function go(e,t=0){const o=Yt(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function $o(e){return"timeZoneName"!==e.partName}function bo(e,t){const o=[],n=Yt(t);n.setDate(1);let r=go(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=go(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Zt(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=Ut(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function yo(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>bo(e,zt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(io(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>qt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Yt(e.props.renderedDate);return t.setMonth(0),n(12,(e=>zt(t,e)))}(e)}function xo(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function wo(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:ho(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,$o),o}function _o(e){return Array.isArray(e.props.sequence)?gn(e.props.sequence):["day"]}function ko(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?ro(t,e.props.timezone):"+0000";const s=oo(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(io(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function So(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function Lo(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Vi.set(e,t),null===(o=e.props.__root)||void 0===o||o.addEventListener("click",(t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_popover`)?Hi.add(e):Hi.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===li.get(t)&&(n=t.value),ze(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!ql.has(e))return;const r=null!==(o=pi.get(e))&&void 0!==o?o:"",s=null!==(n=di.get(e))&&void 0!==n?n:"";at(e,{type:"insert",selectionBefore:st(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>qe(t)),10))}));const[r,s]=Ao(e);je(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(Do(e),Ei.has(e))return Ei.delete(e);n&&n===o?n="":(ze(t),e.props.inputText=o,setTimeout((()=>qe(t)),10))}})}function Do(e){var t,o;if(e.props.overlay){const n=Vi.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Nt(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=u(Rt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function Ao(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=so(e.props.format,t);return[po(e.props.format,t,!0,$o),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=fo(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=n(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 r.push(l),s.token.startsWith("D")&&Bi.set(e,a),r}),[])]}function Co(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Io(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function Mo(e,t){var o,n;if(t instanceof HTMLInputElement&&!Ri.get(e)&&Ni){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){Ri.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();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,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function To(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=vn(e.props.overlay),e.props.pickerOnly=vn(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&mn(`${e.props.id}`,Mo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function Eo(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Ip.set(e,t),je(t,{...Cp.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=u(o)}})}function Oo(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter((e=>e!==t)),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter((e=>e!==t)));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function Fo(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map((e=>h(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Vo(e,t){if(e.props.sourceListOrigin=!1,t){const o=Array.isArray(e.value)?e.value.filter((e=>e!==t)):[];return void e.input(o)}const o=e.props.selectedTargetItems.map((e=>h(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function Bo(e){var t,o;if(e.props.activeValue===yd){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function Po(e){var t;if(Array.isArray(e.value)){const t=[];let o=[...e.props.options];e.value.forEach((n=>{const r=e.props.memoOptions.find((e=>hn(h(e),n)));if(r&&!r.noOptionFound){t.push(r);const s=e.props.options.findIndex((e=>hn(h(e),n)));-1!==s&&(o=o.filter((e=>!hn(h(e),n))))}else{const e=o.find((e=>hn(h(e),n)));e?(t.push(e),o=o.filter((e=>!hn(h(e),n)))):t.push({label:String(n),value:n,noOptionFound:!0})}})),e.props.targetOptions=t,e.props.sourceOptions=o}else e.props.sourceOptions=[...e.props.options],e.props.targetOptions=[];if(e.props.skipSetActiveValue)return void(e.props.skipSetActiveValue=!1);(null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_source_list_items"))&&function(e){var t,o,n,r,s,a,l;if(e.props.isDragging)return;if(e.props.sourceSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=h(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const i=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let p=!1;for(let t=e.props.activeIndex;t<=i.length;t++)if(!(null===(n=i.attrs)||void 0===n?void 0:n.disabled)&&i[t]){p=!0,e.props.activeValue=h(i[t]);break}if(!p&&i.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)&&i[t])return p=!0,void(e.props.activeValue=h(i[t]));if(!p){let t;t=e.props.sourceListOrigin?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`):e.props.searchable?null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_source_search_input`):null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}(e)}function Ho(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}function No(e){Array.isArray(e.value)&&e.value.forEach((async t=>{$(e,t,function(e,t){const o=[...e.props.options,...e.props.memoOptions];return o.find((e=>hn(h(e),t)))}(e,t))}))}function Ro(e){e.context&&(e.context.handlers.loadMore=m.bind(null,e),e.context.fns.getSourceItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.sourceOptions.length:e.props.sourceOptions.length,e.context.fns.getTargetItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.targetOptions.length:e.props.targetOptions.length,e.context.fns.isActive=(t,o)=>{if(!e.props.isDragging&&!e.props.touchStarted)return hn(o,h(t))||void 0},e.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),e.context.fns.optionLoading=t=>e.props.optionLoaderValues.includes(h(t)),e.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",v(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(e)},e.context.handlers.sourceSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.listitemClick=(t,o)=>n=>{Ko(e,t,o)},e.context.handlers.transferForward=Fo.bind(null,e,void 0),e.context.handlers.transferForwardAll=()=>{let t;if(e.props.maxReached)return;const o=e.props.sourceOptions.map((e=>h(e)));t=Array.isArray(e.value)?[...e.value,...o]:[...o],e.input(t),e.props.selectedSourceItems=[]},e.context.handlers.transferBackward=Vo.bind(null,e,void 0),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.input([]),e.props.selectedTargetItems=[])},e.context.handlers.onSearch=t=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,v(e,o.value,!0)}(e,t)},e.context.handlers.onMouseenter=t=>o=>{"touchstart"!==o.type&&(t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0)},e.context.handlers.onMouseleave=t=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(t?`${e.props.id}_source_list_items`:`${e.props.id}`);r&&(r.contains(o.relatedTarget)||(e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeIndex=void 0,t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1))},e.context.handlers.listitemClick=(t,o)=>n=>{n instanceof MouseEvent&&e.props.touchStarted||Ko(e,t,o)},e.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(e)},e.context.handlers.listitemTouchend=(t,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const r=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===r)),e.props.transferOnSelect?o?Fo(e,r):Vo(e,r):Oo(e,t,o)}(e,t,o)},e.context.handlers.listitemTouchmove=()=>t=>{!function(e){e.props.touchMoved=!0}(e)},e.context.handlers.sourceSearchFocus=t=>{Wo(e,!0)},e.context.handlers.sourceListFocused=t=>{Wo(e,!0)},e.context.handlers.targetListFocused=()=>{Wo(e,!1)},e.context.handlers.sourceListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.targetListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.sourceListKeydown=t=>{Yo(e,t,!0)},e.context.handlers.targetListKeydown=t=>{Yo(e,t,!1)},e.context.handlers.sourceSearchKeydown=t=>{Yo(e,t,!0)})}function Ko(e,t,o,n){var r;if(h(t)===yd)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===s)),e.props.transferOnSelect?o?Fo(e,s):Vo(e,s):Oo(e,t,o)}function Wo(e,t){const o=Ho(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=h(o))}function Yo(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(h(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(yd);const i=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==i)for(let e=i-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[i-1];break}else if("ArrowDown"===e.key&&i!==l.length-1)for(let e=i+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}Bo(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(Ho(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===yd)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex((e=>h(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?Fo(t,h(a)):Vo(t,h(a)):Oo(t,a,o)}(t,e,o)}function Uo(e){e.on("created",(()=>{if(e.props.skipSetActiveValue=!0,"function"==typeof e.props.optionsLoader&&b(e),Ro(e),e.props.disabled&&(e.props.draggable=!1),Zn){mn(e.props.id+"_source_list_items",(t=>{t instanceof HTMLElement&&function(e,t){function o(){return e.props.sourceOptions.map((e=>h(e)))}function n(){return[]}if(!e.context)return;const r={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],Bn(t)},draggable:e=>"option"===e.getAttribute("role")};r.plugins=[Pn({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,Fn(t)},handleEnd(t){On(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,Vn(t)},selections:()=>e.props.selectedSourceItems.map((e=>h(e)))})],En({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:maxReached",(({payload:e})=>{r.disabled=e,En({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root),mn(`${e.props.id}`,(t=>{t instanceof HTMLElement&&function(e,t){function o(){return Array.isArray(e.value)?[...e.value]:[]}function n(t,o){e.props.sourceListOrigin=!0,e.input(t)}if(!e.context)return;const r={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};r.plugins=[Pn({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,Fn(t)},handleEnd(t){On(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,Vn(t)},selections:()=>e.props.selectedTargetItems.map((e=>h(e)))})],En({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root);const t=t=>{var o;if(e.props.isDragging)return;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",t)}}))}function Zo(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=xd.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=wd.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&xd.add(e),e.props.mouseOnTarget&&wd.add(e),a.length&&jo(e,a,null,t)}function jo(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[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){o=t;const s=n[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!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}}else Bo(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&xd.has(e)||e.props.mouseOnTarget&&wd.has(e)?requestAnimationFrame(jo.bind(null,e,t,o,n)):Zo(e,n):(xd.delete(e),wd.delete(e))}function zo(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function qo(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...Xo(t,o,n,r)]}function Go(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,zo(255*t,2),zo(255*a,2),n]}function Xo(e,t,o,n=1){const r=zo(t/255,4),s=zo(o/255,4);if(1===s)return[e,0,100,n];const a=zo(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,zo(l,2),zo(100*a,2),n]}function Jo(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Qo(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function en(e,t,o,n=1){const[r,s,a,l]=Jo(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function tn(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function on(e){if(e){if(tn(e))return qo(e);if(e.startsWith("rgb")){const t=e.match(Yc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Qo(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(Uc);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Xo(o,zo(255*n,2),zo(255*r,2),s)}}}function nn(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function rn(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function sn(e){return!1!==e&&"false"!==e}function an(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}function ln(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>hn(e,t))).length>0:void 0!==t?hn(e.value,t):(e.props._isChecked=hn(e.value,e.props.onValue),e.props._isChecked)}function pn(e){function t(t){var o,n,a;const l=(`${t}`.match(/\-/g)||[]).length%2==1;t=function(t){t=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${t}`),isNaN(t)&&(t=t.split(p.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(t=t.replace(/[^0-9\.]/g,""),t.includes(".")){const o=t.split(".");0===e.props.decimals?t=o[0]:(o[1]=o[1].padEnd(i(),"0").slice(0,i()),t=o.join("."))}return t}(t);const c={};"unit"===r()&&(c.minimumFractionDigits=t.includes(".")?1:0),c.maximumFractionDigits=i(),e.props.minDecimals&&(c.minimumFractionDigits=e.props.minDecimals,t.includes(".")||(t+=".".padEnd(e.props.minDecimals,"0"))),0===c.maximumFractionDigits&&t.includes(".")&&(t=t.split(".")[0]);let u="";isNaN(t)||""===t.trim()||(t=l?`-${t}`:t,e.props.max&&!isNaN(e.props.max)&&(t=`${Math.min(t,e.props.max)}`),e.props.min&&!isNaN(e.props.min)&&(t=`${Math.max(t,e.props.min)}`),t.includes(".")?t=t.split(".")[0].padStart(1,"0")+"."+(null!==(o=t.split(".")[1])&&void 0!==o?o:"0"):c.maximumFractionDigits=null!==(n=c.minimumFractionDigits)&&void 0!==n?n:0,u=s(e.props.displayLocale,c).format(t));let f,h=t.split(".");h=h[0]+(null!==(a=h[1])&&void 0!==a?a:"").padEnd(i(),"0"),h.length>1&&(h=h.replace(/^0+/,""),h=""!==t&&""===h?"0":h),e.props.valueStore={number:t,integer:h,string:u},d=!0,e.props.valueStore&&(f=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(""===f?void 0:f).then((()=>(d=!1,Promise.resolve())))}function o(){mn(`${e.props.id}`,(t=>{var o,n;t instanceof HTMLInputElement&&(t.value=null!==(n=null===(o=e.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),e.props.__root)}function n(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function r(){return e.props.currency?"currency":"unit"}function s(t,o={}){const n=r(),s=Object.assign({},{style:n,roundingMode:"trunc"},o);return s[n]=e.props[n],new Intl.NumberFormat(t,s)}function a(){var t,o,n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);if(r){r.dataset.placeholder||(r.dataset.placeholder=null!==(o=r.getAttribute("placeholder"))&&void 0!==o?o:"");const e=((p.unitLeft?`${p.unit} `:"")+(null!==(n=r.dataset.placeholder)&&void 0!==n?n:"")+(p.unitLeft?"":` ${p.unit}`)).trim();r.setAttribute("placeholder",e)}}function l(t){var o;const r=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`#${e.props.id}_inner input`);if(!r)return;const s=p.unit.length+p.literal.length;t=p.unitLeft?Math.max(t,s):Math.min(t,n().length-s),r.setSelectionRange(t,t)}function i(){return!1===e.props.decimals||"false"===e.props.decimals?0:isNaN(`${e.props.decimals}`)?p.fractionLength:e.props.decimals}let p=null,d=!1;e.props.valueStore=null,e.on("input",(({payload:e})=>{d||(t(e),o())})),e.on("mounted",(()=>{a()})),e.context&&(e.context.handlers.setPlaceholder=a,e.context.handlers.init=(n=null)=>{var r;!function(){var t,o,n,r,a,l,i;const d=s(e.props.displayLocale).formatToParts(12345678.12345678);p={decimal:null===(t=d.find((e=>"decimal"==e.type)))||void 0===t?void 0:t.value,group:null===(o=d.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=d.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(r=d.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==a?a:"",fractionLength:null!==(i=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==i?i:0}}();let a=null!==(r=null!=n?n:e._value)&&void 0!==r?r:"";e.props.valueStore?a=e.props.valueStore.number:"integer"===e.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=i())&&void 0!==t?t:0)).toString().replace(".",i())}(`${null!=a?a:""}`)),t(a),o()},e.context.handlers.handleBeforeInput=o=>{var n,r,s,a,i,d,c,u,f;if(!e.props.inExecCommand&&(o.preventDefault(),o.stopPropagation(),o.target instanceof HTMLInputElement)){const h=o.target,v=null!==(n=o.data)&&void 0!==n?n:"",m=null!==(r=o.target.value)&&void 0!==r?r:"",g=null!==(s=o.target.selectionStart)&&void 0!==s?s:0,$=null!==(a=o.target.selectionEnd)&&void 0!==a?a:0,b=$-g,y=m.indexOf(p.decimal);let x=(null!==(i=o.target.selectionStart)&&void 0!==i?i:0)+(o.data?0:-1),w=m,_=1;if(m.includes(p.decimal)&&v===p.decimal)return v===p.decimal&&(x=w.indexOf(p.decimal)+1),void l(x);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===p.decimal&&(!1===e.props.decimals||"false"===e.props.decimals))return;if("deleteByCut"===o.inputType&&b>0&&(w=w.slice(0,g)+w.slice($),x=$),"insertFromPaste"===o.inputType){const e=null!==(d=o.data)&&void 0!==d?d:"";w=w.slice(0,g)+e+w.slice($)}if("deleteContentBackward"===o.inputType&&m[g-1]===p.group?(_+=1,x-=1):"deleteContentForward"===o.inputType&&m[g]===p.group&&(_+=1,x+=1),-1!==y&&x>y&&"insertText"===o.inputType?w=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(w,x,null!==(c=o.data)&&void 0!==c?c:"0"):"insertText"===o.inputType?(x=$,w=w.slice(0,g)+o.data+w.slice($)):"deleteContentForward"===o.inputType?(x+=2,w=0===b?w.slice(0,g)+w.slice($+_):w.slice(0,g)+w.slice($)):"deleteContentBackward"===o.inputType&&(x+=1,0===b?w=w.slice(0,Math.max(g-_,0))+w.slice($):b>0&&(w=w.slice(0,g)+w.slice($))),"deleteContentForward"===o.inputType&&m[g]===p.decimal){const e=w.slice(g-1);w=w.slice(0,g),e.includes(p.unit)&&(w+=" "+p.unit)}else if("deleteContentBackward"===o.inputType&&m[g-1]===p.decimal){const e=w.slice(g-1);w=w.slice(0,g-1),e.includes(p.unit)&&(w+=" "+p.unit)}t(w),w=null!==(f=null===(u=e.props.valueStore)||void 0===u?void 0:u.string)&&void 0!==f?f:"",x=w.length-m.length+x,w.length===m.length&&(x+=o.inputType.includes("delete")?-1:1),h.setSelectionRange(0,m.length),e.props.inExecCommand=!0,document.execCommand("insertText",void 0,w),e.props.inExecCommand=!1,v===p.decimal?x=w.indexOf(p.decimal)+1:m.includes(p.decimal)&&!w.includes(p.decimal)&&(x=w.length),l(Math.max(0,x))}},e.context.handlers.handleInput=o=>{o.target instanceof HTMLInputElement&&(e.props.inputText=o.target.value,t(o.target.value))},e.context.handlers.handleKeyDown=r=>{var s,a;if(r.target instanceof HTMLInputElement&&("ArrowUp"===r.key||"ArrowDown"===r.key)){const i="ArrowUp"===r.key?1*e.props.step:-1*e.props.step;t(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(a=null===(s=e.props.valueStore)||void 0===s?void 0:s.number)&&void 0!==a?a:0,i)),o(),setTimeout((()=>{l(n().length)}),1)}})}function dn(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Hu.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:Xn(13919),children:`${Xn(451228594)}${Xn(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){or[e]?or[e].add(t):or[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!Un.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.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()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Hu.add(o),o.define({...r,schema:n(e)})}Pu((()=>tr.has(e)&&o.emit(952679114..toString(32))),4e3)},n}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}}import{isRecord as cn,isObject as un,isPojo as fn,eq as hn,undefine as vn,whenAvailable as mn,clone as gn}from"@formkit/utils";import{isDOM as $n,isComponent as bn,createMessage as yn,warn as xn,error as wn}from"@formkit/core";import{icon as _n,isSlotCondition as kn,isSchemaObject as Sn,extendSchema as Ln,normalizeOptions as Dn,defaultIcon as An,localize as Cn,options as In,disablesChildren as Mn}from"@formkit/inputs";import"@formkit/vue";import{animations as Tn,dragAndDrop as En,handleEnd as On,handleDragstart as Fn,handleTouchstart as Vn,handleTouchmove as Bn,multiDrag as Pn}from"@formkit/drag-and-drop";const Hn=[988,24029,396,13078,980],Nn=18806588,Rn=502357,Kn=16217489;let Wn=189024;const Yn=()=>[30548127325,27022924,34729821653783].map(Xn).join("y"),Un=/^[0-9a-f]+$/,Zn="undefined"!=typeof window,jn=n(32,(e=>e)).map((()=>{Wn|=0,Wn=Wn+1831565813|0;let e=Wn^Wn>>>15|Wn;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),zn=Zn?setTimeout:()=>0,qn=e=>{clearTimeout(Gn[e])},Gn={},Xn=e=>e.toString(32),Jn=e=>`${Xn(jn[e]).substring(2)}.${Xn(Hn[e%(Hn.length-1)])}`,Qn={},er={},tr=new Set(["",null,void 0]),or={},nr=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple || $multiple || undefined","data-disabled":"$disabled || $disabledInternally || undefined","data-empty":"$state.empty || 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-draggable":"$draggable || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-inline":"$inline || undefined","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined"}}),rr=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),sr=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),ar=()=>({$el:"ul",if:"$fns.length($messages)"}),lr=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),ir=()=>({$el:"div",if:"$help"}),pr=()=>({$el:null}),dr=(e,t)=>()=>_n(e,t),cr=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),ur=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),fr=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),hr=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),vr=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),mr=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),gr=()=>({$el:null,for:["part","$_overlayParts"]}),$r=a("dd"),{outer:br,wrapper:yr,inner:xr,icon:wr,label:_r,prefix:kr,suffix:Sr,help:Lr,messages:Dr,message:Ar}=l($r),Cr=$r("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",name:"$node.name",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),Ir=$r("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),Mr=$r("selection",(()=>({$el:"div"}))),Tr=$r("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),Er=$r("optionLoading","span"),Or=$r("option",(()=>({$el:"div"}))),Fr=$r("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),Vr=$r("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),Br=$r("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),Pr=$r("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),Hr=$r("selectionsItem",(()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'}))),Nr=$r("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Rr=$r("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),Kr=$r("tagLabel",(()=>({$el:"span"}))),Wr=$r("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),Yr=$r("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),Ur=$r("tagLoading","span"),Zr=d($r),jr=new WeakMap,zr=new WeakMap,qr=yn({key:"loading",type:"state",value:!0,visible:!1}),Gr=yn({key:"loading",type:"state",value:!1,visible:!1}),Xr=new WeakMap,Jr=Symbol(),Qr=e=>{const t=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),o=e.props.inputStd||[],n=[];for(const e of o){let o,r=t.find((t=>hn(h(t),e)));o=fn(e)?void 0:Array.isArray(e)?e.join(", "):e,r||(r={value:e,label:o,isPlaceholder:!1,noOptionFound:!0}),n.push(r)}return n},es=new WeakSet,ts=new WeakMap,os={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},ns={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},rs={overflow:"hidden",height:"100%"},ss={},as={};let ls=0;const is=(e,t)=>{let o=null,n=null,r=null;return function(...s){const a=this;o?(n=s,r=a):(e.apply(a,s),o=window.setTimeout((()=>{o=null,null!==n&&null!==r&&(e.apply(r,n),n=null,r=null)}),t))}},ps={schema:br(yr(_r("$label"),xr(wr("prefix"),kr(),Cr(p("$inputStd.length === 0 && $state.loading !== true",Tr('$placeholder || "placeholder"'),p("$multiple !== true",Ir(p("$state.loading && $selections.length === 0",Er("$ui.isLoading.value"),Mr(Or("$option.label")))),p('$multiple && $selectionAppearance === "truncate"',Vr(Br(p("$state.loading && $selections.length === 0",Er("$ui.isLoading.value"),Hr()))),p('$multiple && $selectionAppearance === "tags"',Wr(Yr(p("$state.loading && $isLoadingOption !== true && $selections.length === 0",Er("$ui.isLoading.value"),Nr(Rr(p("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",Ur("$ui.isLoading.value"),Kr("$option.label")),Fr(wr("close"))))))))))),p("$truncationCount && $state.loading !== true",Pr("$truncationCount")),p("$state.loading",wr("loader")),p("$inputStd.length !== 0 && $selectionRemovable",Fr(wr("close")),wr("select"))),Zr(),Sr(),wr("suffix"))),Lr("$help"),Dr(Ar("$message.value"))),type:"input",family:"dropdown",props:[],features:[An("select","select"),An("close","close"),An("selected","check"),An("loader","spinner"),Cn("isLoading"),Cn("loadMore"),Cn("remove"),In,Z.bind(null,(function(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=vn(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=vn(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&vn(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=se.bind(null,e),e.context.handlers.focus=ae.bind(null,e),e.context.handlers.keydown=ne.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>te.bind(null,e,t))}))}),(function(e){if(e.on("created",(()=>{e.context&&le(e)})),e.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(e),"truncate"===e.props.selectionAppearance&&(e.props.lastVisibleIndex=null,ie(e),e.on("prop:selections",(()=>{ie(e)}))),"tags"===e.props.selectionAppearance&&ve(e),e.props.multiple&&"tags"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t,o){e.input(t)}e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),mn(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const r={threshold:{horizontal:.25,vertical:0},plugins:[Tn()],draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};En({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}e.on("prop:expanded",(({payload:t})=>{t&&e.props.optionsLoader&&"function"==typeof e.props.optionsLoader&&(!e.props.options.length||e.props.alwaysLoadOnOpen)&&(e.props.options=[],b(e))})),"overscroll"===e.props.behavior&&he(e)})),$e]},ds=a("tg"),{outer:cs,wrapper:us,label:fs,prefix:hs,suffix:vs,help:ms,messages:gs,message:$s,icon:bs}=l(ds),ys=ds("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",name:"$node.name",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),xs=ds("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),ws=ds("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"}))),_s=ds("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"}}))),ks=ds("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"}}}))),Ss=ds("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Ls=ds("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Ds=ds("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),As={schema:cs(us(ws(),Ss(hs(),ys(),Ls(_s(),Ds(p("$slots.default","$slots.default",bs("thumb")))),vs()),ks(),xs()),ms("$help"),gs($s("$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",(()=>{"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),e.props.altLabelPosition=vn(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=hn(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=hn(t,e.props.onValue)}))}]},Cs=a("rp"),{outer:Is,inner:Ms,prefix:Ts,suffix:Es,help:Os,messages:Fs,message:Vs,icon:Bs}=l(Cs),Ps=Cs("empty",(()=>({$el:"div"}))),Hs=Cs("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),Ns=Cs("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Rs=Cs("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),Ks=Cs("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),Ws=Cs("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Ys=Cs("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Us=Cs("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),Zs=Cs("content","div"),js=Cs("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),zs=Cs("legend",(()=>({$el:"legend",if:"$label"}))),qs=Cs("group",(()=>({$formkit:"group",index:"$index"}))),Gs=Cs("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Xs=Cs("remove",(()=>({$el:"li",if:"$removeControl"}))),Js=Cs("insert",(()=>({$el:"li",if:"$insertControl"}))),Qs=Cs("up",(()=>({$el:"li",if:"$upControl"}))),ea=Cs("down",(()=>({$el:"li",if:"$downControl"}))),ta=Cs("controlLabel","span"),oa=Cs("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),na=Cs("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}}))),ra={schema:Is(js(zs("$label"),Os("$help"),Ms(Ts(),p("$value.length === 0",p("$slots.empty",Ps()),p("$slots.default",Ks(Ws(oa(na(Bs("dragHandle"))),Zs(qs("$slots.default")),Gs(Qs(Us(ta("$ui.moveUp.value"),Bs("moveUp"))),Xs(Rs(ta("$ui.remove.value"),Bs("remove"))),Js(Hs(ta("$ui.add.value"),Bs("add"))),ea(Ys(ta("$ui.moveDown.value"),Bs("moveDown")))))),Es()))),Ns('$addLabel || ($ui.add.value + " " + ($label || ""))')),Fs(Vs("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(e){e._c.sync=!0,e.on("created",be.bind(null,e)),e.on("mounted",(()=>{mn(`${e.props.id}_items`,(t=>{if(t instanceof HTMLElement){ye(t,e);function o(t){for(const o of t)for(const t of Array.from(o.addedNodes))if(t instanceof HTMLElement&&t.id===`${e.props.id}_items`)return void ye(t,e)}new MutationObserver(o).observe(t.parentNode,{childList:!0})}}),e.props.__root)}))},Mn,Cn("remove"),Cn("add"),Cn("moveUp"),Cn("moveDown"),An("dragHandle","dragHandle"),An("remove","trash"),An("add","add"),An("moveUp","arrowUp"),An("moveDown","arrowDown")]},sa=new WeakMap,aa=a("rt"),{outer:la,wrapper:ia,inner:pa,label:da,prefix:ca,suffix:ua,help:fa,messages:ha,message:va,icon:ma}=l(aa),ga=aa("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),$a=aa("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),ba=aa("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),ya=aa("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),xa=aa("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),wa=aa("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),_a=aa("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),ka=aa("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),Sa=aa("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),La=aa("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),Da={schema:la(ia(da("$label"),pa(ma("prefix"),ca(),ga($a(ba(ya(_a(Sa(p("$slots.onItem",(()=>()=>"$slots.onItem"),p("$slots.default",(()=>()=>"$slots.default"),ma("rating"))))),ka(La(p("$slots.offItem",(()=>()=>"$slots.offItem"),p("$slots.default",(()=>()=>"$slots.default"),ma("rating"))))),xa()),wa()))),ua(),ma("suffix"))),fa("$help"),ha(va("$message.value"))),type:"input",props:[],features:[function(e){function t(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}e.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==e.props.hoverHighlight&&"false"!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.deselect=vn(e.props.deselect),e.props.max=Number(e.props.max)||5,e.props.min=Number(e.props.min)||0,e.props.step=Number(e.props.step)||1,e.props.numberOfSteps=e.props.max/e.props.step,e.props.lastIndex=1/e.props.step-1,e.props.itemsToPercentages={},"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),e.props.rightToLeft?(e.props.onItemStyles=void 0,e.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):e.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},e.props.stepsPerValue=1/e.props.step,e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)})),e.on("commit",(({payload:t})=>{const o=Number(t||0);xe(e,o)})),e.on("created",(()=>{e.context&&(mn(`${e.props.id}_items_wrapper`,(()=>{t(e),function(e){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{t(e)})).observe(n)}(e),setTimeout((()=>t(e)),100)}),e.props.__root),e.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],e.context.fns.getValue=(t,o)=>t+Number((o*e.props.step+e.props.step).toFixed(1)),e.context.fns.showLabel=(t,o)=>{const n=Number(e.value||0);return 0===n&&0===o||n&&t===n||t>n&&0===o||n>t&&o===e.props.lastIndex},e.context.handlers.handleFocus=t=>Ae.call(null,e,t),e.context.handlers.handleWrapperKeydown=t=>De.call(null,e,t),e.context.handlers.handleWrapperBlur=t=>we.call(null,e,t),e.context.handlers.handleItemClick=t=>o=>Me.call(null,e,t,o),e.context.handlers.handleMousemove=t=>o=>Ce.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>Ie.call(null,e),e.context.handlers.handleDragstart=t=>o=>Le.call(null,e,t,o),e.context.handlers.handleMouseup=t=>Se.call(null,e,t),e.context.handlers.handleTouchstart=t=>o=>ke.call(null,e,t,o),e.context.handlers.handleTouchmove=t=>_e.call(null,e,t),e.context.handlers.handleKeydown=t=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(e,t,o))}))},An("rating","star")]},Aa=a("ac"),{outer:Ca,wrapper:Ia,inner:Ma,icon:Ta,label:Ea,prefix:Oa,suffix:Fa,help:Va,messages:Ba,message:Pa}=l(Aa),Ha=Aa("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 || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || 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"}}))),Na=Aa("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),Ra=Aa("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 1',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Ka=Aa("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Wa=Aa("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Ya=Aa("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),Ua=Aa("optionLoading","span"),Za=Aa("option",(()=>({$el:"div",if:"$value !== undefined"}))),ja=d(Aa),za=new WeakMap,qa="undefined"!=typeof window,Ga=new WeakMap;let Xa=!1;const Ja={schema:Ca(Ia(Ea("$label"),Ma(Ta("prefix"),Oa(),Ha(),p("$multiple !== true && $selectionAppearance === option && $expanded === false",Wa(Ra(Ka(Za(p("$state.loading",Ua("$ui.isLoading.value"),"$option.label"))),p("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",Ta("loader")),p("$selectionRemovable && $isSingleOption",Ya(Ta("close")))))),p("$state.loading && ($isSingleOption !== true || $selections.length === 0)",Ta("loader")),p('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',Ya(Ta("close")),p('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',Na(Ta("select")))),p("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",Na(Ta("select"))),ja(),Fa(),Ta("suffix")),p("$multiple && $selectionAppearance === option",Wa(Ra(Ka(Za(p("$state.loading && $isLoadingOption",Ua("$ui.isLoading.value"),"$option.label"))),Ya(Ta("close")))))),Va("$help"),Ba(Pa("$message.value"))),type:"input",family:"dropdown",props:[],features:[An("select","select"),An("close","close"),An("selected","check"),An("loader","spinner"),Cn("isLoading"),Cn("loadMore"),Cn("remove"),Cn("open"),Cn("close"),In,Z.bind(null,(function(e){"option"!==e.props.selectionAppearance||e.props.multiple||!1===e.props.selectionRemovable||"false"===e.props.selectionRemovable||(e.props.selectionRemovable=!0),e.props.multiple||(e.props.clearSearchOnOpen=vn(e.props.clearSearchOnOpen)),e.props.selectionRemovable=vn(e.props.selectionRemovable),e.props.openOnClick=vn(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=vn(e.props.allowNewValues)}),Fe,(function(e){if(e.props.multiple)if(e.props.multiple&&"option"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}Ue(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),mn(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement&&e.context){const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,root:e.props.__root,disabled:!e.props.draggable,plugins:[Tn()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};En({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&Re(e);else Ze(e)})),$e]},Qa=a("dp"),{outer:el,wrapper:tl,inner:ol,icon:nl,label:rl,prefix:sl,suffix:al,help:ll,messages:il,message:pl}=l(Qa),dl=Qa("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}}))),cl=Qa("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}}))),ul=Qa("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),fl=Qa("nextLabel","span"),hl=Qa("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),vl=Qa("prevLabel","span"),ml=Qa("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),gl=Qa("calendarWeeks",(()=>({$el:"tbody"}))),$l=Qa("calendarHeader",(()=>({$el:"thead"}))),bl=Qa("weekDays",(()=>({$el:"tr"}))),yl=Qa("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),xl=Qa("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),wl=Qa("dayCell",(()=>({$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",onBlur:"$handlers._blurOut(day)",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")'}}))),_l=Qa("day","div"),kl=Qa("openButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Sl=Qa("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Ll=Qa("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",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$fns.isSelected($year)","data-disabled":"$fns.isDisabledYear($year)"}}))),Dl=Qa("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Al=Qa("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",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$fns.isSelected($month)","data-disabled":"$fns.isDisabledMonth($month)"}}))),Cl=Qa("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Il=Qa("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Ml=Qa("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Tl=Qa("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),El=Qa("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Ol=Qa("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Fl=Qa("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Vl=Qa("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Bl=Qa("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),Pl=Qa("time",(()=>({$el:"div",if:'$panel === "time"'}))),Hl=Qa("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),Nl=Qa("panelClose",(()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}}))),{overlayPlaceholder:Rl,overlayLiteral:Kl,overlayChar:Wl,overlayEnum:Yl,overlay:Ul,overlayParts:Zl,overlayInner:jl}=i(Qa),zl=Qa("panel","div"),ql=new WeakMap,Gl=new WeakMap,Xl=new WeakSet,Jl=new WeakMap,Ql=new WeakMap,ei=new WeakSet,ti=new WeakMap,oi=/[\uD800-\uDBFF]/,ni=new WeakMap,ri=new WeakMap,si=new WeakMap,ai=new WeakMap,li=new WeakMap,ii=new WeakSet,pi=new WeakMap,di=new WeakMap,ci=new WeakMap,ui=new WeakMap;let fi=!1;const hi=()=>{fi=!0,setTimeout((()=>{fi=!1}),500)},vi={"#":{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"}},mi=new WeakMap,gi="undefined"!=typeof window;let $i=!1;gi&&document.addEventListener("selectionchange",(()=>{const e=f();if(!(e instanceof HTMLInputElement))return;if(ui.has(e))return function(e){const t=ui.get(e);if(t){const[o,n]=t,[r,s]=It(e),a=s.indexOf(o);if(-1===a)return void ui.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];rt(st(e),i)||ct(e,i)}}(e);if("select"!==ti.get(e))return;const t=st(e);if(!rt(t,mi.get(e))){if(mi.set(e,t),Xl.has(e))return Xl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:st(e)}))}}));var bi=/^([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]+)?(Z|(?:\+|\-)[0-9]{4})?$/,yi="1999-03-04T02:05:01.000Z",xi=new Map,wi=[["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"}]],_i=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],ki=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Si={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Li=["MMMM","MMM","dddd","ddd"],Di=new Map([...wi,..._i,...ki].map((e=>[e[0],e]))),Ai=new Map,Ci=["full","long","medium","short"],Ii=e=>String(e).padStart(2,"0"),Mi=e=>String(e).padStart(2,"0");const Ti="undefined"!=typeof window,Ei=new WeakSet,Oi=new WeakSet,Fi=new WeakSet,Vi=new WeakMap,Bi=new WeakMap,Pi=new WeakSet,Hi=new WeakSet,Ni="undefined"!=typeof window,Ri=new WeakMap,Ki={schema:el(tl(rl("$label"),ol(nl("prefix"),sl(),Ul(jl(Zl(Rl("$part.value"),Kl("$part.value"),Wl("$part.value"),Yl("$part.value")))),dl(),cl(Cl(hl(vl("$ui.prev.value"),nl("prev")),Il("$decade"),Ml(Ol()),Tl(Fl(),Ol()),El(Fl(),Vl(),Ol()),ul(fl("$ui.next.value"),nl("next")),Nl(nl("close"))),zl(Sl(Ll("$fns.format($year, $yearFormat)")),Dl(Al("$fns.format($month, $monthFormat)")),ml($l(bl(yl("$fns.format($day, $weekdayFormat)"))),gl(xl(wl(_l("$fns.format($day, $dateFormat)"))))),Pl(Hl()))),Bl(nl("clear")),kl(nl("calendar")),al(),nl("suffix"))),ll("$help"),il(pl("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[To,function(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v,m,g,$,b,y,x,w,_;e.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","showPanelClose"]),e.hook.prop(((t,o)=>("expanded"===t.prop&&e.props.disabled&&(t.value=!1),"weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"maxScan"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=ro(e._value,t.value)),o(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(f=e.props).valueFormat)&&void 0!==t||(f.valueFormat="ISO8601"),null!==(o=(h=e.props).weekdayFormat)&&void 0!==o||(h.weekdayFormat="d"),null!==(r=(v=e.props).monthFormat)&&void 0!==r||(v.monthFormat="MMM"),null!==(s=(m=e.props).monthButtonFormat)&&void 0!==s||(m.monthButtonFormat="MMMM"),null!==(a=(g=e.props).dayButtonFormat)&&void 0!==a||(g.dayButtonFormat="D"),null!==(l=($=e.props).dateFormat)&&void 0!==l||($.dateFormat="D"),null!==(i=(b=e.props).yearFormat)&&void 0!==i||(b.yearFormat="YYYY"),null!==(p=(y=e.props).paginatedPanels)&&void 0!==p||(y.paginatedPanels=["day","year"]),null!==(d=(x=e.props).valueLocale)&&void 0!==d||(x.valueLocale=e.props.locale),null!==(c=(w=e.props).format)&&void 0!==c||(w.format="long"),e.props.panels=_o(e),e.props.pickerOnly=vn(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=vn(e.props.clearable)),null!==(u=(_=e.props).maxScan)&&void 0!==u||(_.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):Co.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Yt(t);else if("string"==typeof t)try{o=Yt(ho(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${po(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?ro(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?ho(e.props.minDate):e.props.minDate;e.props.minDate=lo(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?ho(e.props.maxDate):e.props.maxDate;e.props.maxDate=lo(t,e.props.offset)}o=o&&lo(o,e.props.offset),o&&ko(e,o,!1);let n=o||new Date;n=e.props.minDate>n?e.props.minDate:n,e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&io(o,"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=io,e.on("created",(()=>{if(mn(`${e.props.id}`,Lo.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>io(t,o,e.props.locale||"en",!1,$o),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!uo(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!uo(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;return mo(t,lo(n instanceof Date?n:ho(n,e.props.valueFormat,e.props.valueLocale),e.props.offset))},e.context.handlers._blur=t=>{var o,n;e.props._isFocused=!1,"function"==typeof(null===(o=e.context)||void 0===o?void 0:o.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur(t))},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers._blurOut=t=>o=>{var n;o.preventDefault(),t&&t!==e.props.panel||e.props.pickerOnly&&o.relatedTarget instanceof Element&&(o.relatedTarget===document.getElementById(`${e.props.id}_inner`)||o.relatedTarget.closest(`#${e.props.id}_inner`))||o.relatedTarget&&o.relatedTarget instanceof Element&&(o.relatedTarget.closest(`#${e.props.id}_popover`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_popover`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=Vi.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!Oi.has(e)&&(Fi.add(e),e.props.expanded=!0,setTimeout((()=>Fi.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;ko(e,void 0,!0),wo(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(Pi.has(e))return Pi.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=ho({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:$o});if(function(e){return so(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!ui.get(t.target)&&io(n,e.props.format,e.props.locale,!1,$o)!==t.target.value){const r=fo("dddd",e.props.locale),s=so(e.props.format,e.props.locale),a=null===(o=vo(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=io(n,"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,n=Ut(n,t),Ei.add(e)}}ko(e,n)}catch(t){ko(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=qt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=zt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=qt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=zt(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var o;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(o=e.context)||void 0===o?void 0:o.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),wo(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.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=uo(o,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=o)},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 o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&mo(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var o,n;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getFullYear()===(null===(n=e.context)||void 0===n?void 0:n.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const o=function(e){const t=Yt(e);return t.setHours(0,0,0),t}(t).getTime();return o<co(e).getTime()||o>Zt(e).getTime()||void 0}}}));const k=xo.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;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,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),ko(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void wo(e,void 0);const o=new Date,n=t?wo(e,lo("string"==typeof t?ho(t,e.props.valueFormat,e.props.valueLocale):t,e.props.offset)):o;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:n,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:n,e.props.localTime=io(n,"HH:mm"),function(e){const t=Bi.get(e);if(e._value&&t){const o=jt(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",yo.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(Hi.delete(e),e.props.panels=_o(e),e.props.panel=e.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=uo(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}yo(e),mn(`${e.props.id}_popover`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&setTimeout((()=>{o.focus(),function(e,t){const o=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())}))}));o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",(({payload:t})=>{t||(e.off(n),o.disconnect())}))}(e,t)}),0)}),e.props.__root),Ti&&setTimeout((()=>{document.addEventListener("click",k)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){Pi.add(e);const t="string"==typeof e._value?ho(e._value,e.props.valueFormat,e.props.valueLocale):e._value;wo(e,lo(t,e.props.offset))}else wo(e,void 0);Ti&&(Oi.add(e),document.removeEventListener("click",k),setTimeout((()=>Oi.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 o=e.props.calendar,n=co(e.props.renderedDate),r=Zt(zt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=zt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=zt(e.props.renderedDate))}else if("year"===e.props.panel){const t=e.props.years,o=t[0].getFullYear(),n=t[t.length-1].getFullYear(),r=e.props.activeDate.getFullYear();r>n?e.props.renderedDate=qt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=qt(e.props.renderedDate,-10))}e.props.expanded&&wo(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),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})=>{t.preventDefault();let o=null,r=0;switch(t.key){case"ArrowRight":r=1;break;case"ArrowLeft":r=-1;break;case"ArrowDown":r=7;break;case"ArrowUp":r=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||So(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=Ut(e.props.activeDate,r)),o&&!e.props._isDisabled(o))e.props.activeDate=o;else if(o&&e.props._isDisabled(o)){const t=r>0?1:-1;n(Number(e.props.maxScan),(e=>t*e)).some((t=>{const n=Ut(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||So(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=qt(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||So(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=zt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=uo(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":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Vi.get(e)&&Do(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=yn({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:Io(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},$e,Cn("next"),Cn("prev"),Cn("changeDate"),Cn("chooseDate"),An("close","close"),An("next","right"),An("clear","close"),An("prev","left"),An("calendar","date")]},Wi=a("tl"),{outer:Yi,wrapper:Ui,inner:Zi,icon:ji,label:zi,prefix:qi,suffix:Gi,help:Xi,messages:Ji,message:Qi}=l(Wi),ep=Wi("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",name:"$node.name",tabindex:"0",placeholder:"$state.loading && $inputStd.length === 0 && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || $disabledInternally || undefined","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),tp=Wi("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-label":"$expanded && $ui.close.value || $ui.open.value",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),op=Wi("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)",onKeydown:"$handlers.searchInputTagKeydown && $handlers.searchInputTagKeydown($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),np=Wi("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),rp=Wi("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1","aria-label":"$ui.remove.value",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)",onTouchstart:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),sp=Wi("tagLabel",(()=>({$el:"span"}))),ap=Wi("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),lp=Wi("tagLoading","span"),ip=d(Wi),pp={schema:Yi(Ui(zi("$label"),Zi(ji("prefix"),qi(),ap(op(np(p("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",lp("$ui.isLoading.value"),sp("$option.label")),rp(ji("close")))),ep()),p("$state.loading",ji("loader")),tp(ji("select")),ip(),Gi(),ji("suffix"))),Xi("$help"),Ji(Qi("$message.value"))),type:"input",family:"dropdown",props:[],features:[In,Z.bind(null,(function(e){e.props.multiple=!0,e.props.openOnClick=vn(e.props.openOnClick),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=vn(e.props.allowNewValues)}),Fe,(function(e){Ue(e),ve(e),e.on("created",(()=>{function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}e.props.disabled&&(e.props.draggable=!1),mn(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement){if(!e.context)return;const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[Tn()],root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(t){e.props.activeSelectionValue=void 0,On(t)},handleDragstart(t){e.props.activeSelectionValue=void 0,Fn(t)},handleTouchstart(t){e.props.activeSelectionValue=void 0,Vn(t)}};En({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))})),An("select","select"),An("close","close"),An("selected","check"),An("loader","spinner"),Cn("isLoading"),Cn("loadMore"),Cn("remove"),Cn("open"),Cn("close"),$e]},dp=a("mk"),{outer:cp,wrapper:up,inner:fp,label:hp,prefix:vp,suffix:mp,help:gp,messages:$p,message:bp,icon:yp}=l(dp),{overlayPlaceholder:xp,overlayLiteral:wp,overlayChar:_p,overlayEnum:kp,overlay:Sp,overlayParts:Lp,overlayInner:Dp}=i(dp),Ap=dp("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),Cp=new WeakMap,Ip=new WeakMap,Mp=new WeakMap,Tp={schema:cp(up(hp("$label"),fp(yp("prefix"),vp(),Sp(Dp(Lp(xp("$part.value"),wp("$part.value"),_p("$part.value"),kp("$part.value")))),Ap(),mp(),yp("suffix"))),gp("$help"),$p(bp("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[To,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,s;const a=Xe("string"==typeof e._value?e._value:"");Ip.set(e,a),Mp.set(e,a),e.props.allowIncomplete=vn(e.props.allowIncomplete),e.props.overlay=vn(e.props.overlay);const l=!(void 0!==e.props.showMask&&!vn(e.props.showMask));e.props.unmaskValue=vn(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=vn(e)),t(e))));const i={placeholder:l,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(o=e.props.mode)&&void 0!==o?o:"shift",partOverrides:null!==(n=e.props.tokens)&&void 0!==n?n:{},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:vn(e.props.reverse)};Cp.set(e,i),e.hook.input(((t,o)=>{const n=function(e,t){const o=Ip.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=Mp.get(e);r.value=lt(r,t);const s=Ge(r,Cp.get(e)),a=Nt(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=u(Rt(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(e,t);return o(n)})),e.props._maskValue=Ge(a,i),e.input(e.props._maskValue,!1),e.context&&(e.context.handlers.DOMInput=t=>{e.emit("dom-input-event",t)}),mn(`${e.props.id}`,Eo.bind(null,e),e.props.__root)}))}]},Ep=a("tf"),{outer:Op,wrapper:Fp,inner:Vp,icon:Bp,prefix:Pp,suffix:Hp,help:Np,messages:Rp,message:Kp}=l(Ep),Wp=Ep("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),Yp=Ep("legend",(()=>({if:"$label",$el:"legend"}))),Up=Ep("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),Zp=Ep("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),jp=Ep("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),zp=Ep("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),qp=Ep("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),Gp=Ep("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"}))),Xp=Ep("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),Jp=Ep("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),Qp=Ep("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}}))),ed=Ep("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),td=Ep("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$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',onKeydown:"$handlers.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred"}}))),od=Ep("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstart:"$handlers.listitemTouchstart($option, true)",onTouchmove:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),nd=Ep("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),rd=Ep("sourceLoadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),sd=Ep("loadMoreInner","span"),ad=Ep("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),ld=Ep("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),id=Ep("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred"}}))),pd=Ep("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":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstart:"$handlers.listitemTouchstart($option, false)",onTouchmove:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),dd=Ep("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),cd=Ep("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),ud=Ep("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),fd=Ep("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),hd=Ep("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),vd=Ep("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),md=Ep("controlLabel","span"),gd=Ep("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),$d=Ep("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),bd=Ep("emptyMessageInner","span"),yd=Symbol(),xd=new WeakSet,wd=new WeakSet,_d={schema:Op(Wp(Yp("$label"),Np("$help"),Fp(Up(Zp(jp(),zp(p("$optionsLoadingCounter > 0",Bp("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),Xp(Jp(Qp(),ed(Bp("close")))),td(gd(bd("$sourceEmptyMessage")),od(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",Bp("selected")),nd("$option.label")),rd(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",sd(p("$state.loading",Bp("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),cd(fd(md("$ui.addAllValues.value"),Bp("fastForward")),ud(md("$ui.addSelectedValues.value"),Bp("moveRight")),hd(md("$ui.removeSelectedValues.value"),Bp("moveLeft")),vd(md("$ui.removeAllValues.value"),Bp("rewind"))),ad(ld(qp(),Gp("$fns.getTargetItemCount($selectedTargetItems)")),id($d(p("$state.loading !== true",bd("$targetEmptyMessage"))),pd(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",Bp("selected")),dd(p("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),Rp(Kp("$message.value")))),type:"input",props:[],features:[An("moveRight","right"),An("moveLeft","left"),An("fastForward","fastForward"),An("rewind","rewind"),An("close","close"),An("loader","spinner"),An("selected","check"),Cn("isLoading"),Cn("loadMore"),Cn("addAllValues"),Cn("addSelectedValues"),Cn("removeSelectedValues"),Cn("removeAllValues"),In,function(e){!function(e){e.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption"]),e.props.loadMoreOption={label:"Load more",value:yd},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=y.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),e.props.searchable=vn(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=vn(e.props.clearOnSelect),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.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(v(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Po(e)),"function"==typeof e.props.optionLoader?No(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),Uo(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Po(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Po(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,xd.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===yd)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>hn(h(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,e.props.sourceListOrigin=!0,xd.delete(e),Zo(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,wd.delete(e),Zo(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(Gr)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(Gr),e.props.skipSetActiveValue=!0,Po(e))}))}(e)}]},kd=a("sl"),{outer:Sd,wrapper:Ld,inner:Dd,icon:Ad,label:Cd,prefix:Id,suffix:Md,help:Td,messages:Ed,message:Od}=l(kd),Fd=kd("chart",(()=>({$el:"div",if:"$chart"}))),Vd=kd("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),Bd=kd("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),Pd=kd("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),Hd=kd("trackWrapper",(()=>({$el:"div"}))),Nd=kd("trackInner",(()=>({$el:"div"}))),Rd=kd("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Kd=kd("linkedValues",(()=>({$el:"div"}))),Wd=kd("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),Yd=kd("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Ud=kd("marks",(()=>({$el:"div",if:"$marks"}))),Zd=kd("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),jd=kd("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),zd=kd("handles",(()=>({$el:"ul"}))),qd=kd("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Gd=kd("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Xd=kd("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Jd=kd("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Qd=kd("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),ec=kd("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),tc={schema:Sd(Ld(Cd("$label"),Td("$help"),Bd(Ad("prefix"),Id(),Pd(Fd(Vd()),Hd(Nd(Rd(),Ud(Zd(jd())),zd(Gd(ec(),Xd()),qd(Qd(),Jd()))))),Md(),Ad("suffix"),p("$showInput && $isMulti === false",Wd())),p("$showInput && $isMulti",Kd(Yd(),Wd())),Ed(Od("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){function t(t){const{min:o,max:r,intervals:s}=e.props;if(t=Math.min(Math.max(t,0),100),!s||0===s.length){u();const n=o+t/100*(r-o);return e.props.scalingFunction.reverse(n,o,r)}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:r,width:s,stepsInInterval:l}=a[e];if(t>=r&&t<=r+s){const e=o+(t-r)/s*l*n,a=e%n;return p(a<n/2?e-a:e+(n-a))}}return t>100?r:t<0?o:void 0}function o(t,o=e.props.min,r=e.props.max){const s=e.props.intervals;if(!s||0===s.length){u();return(e.props.scalingFunction.forward(t,o,r)-o)/(r-o)*100}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:s,width:l,stepsInInterval:i}=a[e],p=e<a.length-1?a[e+1].value:r;if(t>=o&&t<=p){return 100*((s+(t-o)/n/i*l)/100)}}return 100}function n(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,i=s/r*100;return s+=l,{value:e.value,step:e.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function r(){const t=parseFloat(`${e.props.min}`),n=parseFloat(`${e.props.max}`);let r,a=0;if(Array.isArray(e._value)){const t=[...e._value].sort(s);a=parseFloat(`${t[0]}`),r=parseFloat(`${t[1]}`)}else r=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${o(r,t,n)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${o(a,t,n)}%`},e.props.fillStyles={left:`${o(a,t,n)}%`,width:o(r,t,n)-o(a,t,n)+"%"}):e.props.fillStyles={left:"0%",width:`${o(r,t,n)}%`}}function s(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function a(t,o=!0){if(e.props.disabled)return;let n;if(void 0===t){if(e.props.isMulti)e.input([e.props.min,e.props.max]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(t)}return r(),void l()}if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(t)){const o="min"===e.props.lastHandleInteraction?0:1;e._value[o]=t;const[r,a]=[...e._value];if(r>=a){const t=null==f?void 0:f.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}n=d([...e._value].sort(s))}else Array.isArray(t)?n=d(t):(n=d(t),n=isNaN(n)?e.props.min:n);e.props.snapToMarks&&(n=c(n));const a=i(n);o&&e.input(a),r(),l()}function l(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];h&&h.input(t),v&&v.input(o)}else v&&v.input(e._value)}function i(t){return e.props.isMulti&&Array.isArray(t)?[i(t[0]),i(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function p(t){return parseFloat(t.toFixed(e.props.decimals))}function d(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>p(Math.round(t/e.props.step)*e.props.step))):p(Math.round(t/e.props.step)*e.props.step);const o=n(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return p(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return p(n.value+Math.round((t-n.value)/n.step)*n.step)}}function c(t){if(Array.isArray(t))return t[0]=c(t[0]),t[1]=c(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}function u(){if(g)return;vn(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=m[e.props.scalingFunction]||m.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...m.linear,...e.props.scalingFunction}):e.props.scalingFunction=m.linear,g=!0}let f,h,v;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const m={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};let g=!1;e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),e.on("created",(()=>{function l(o){var n;if(!f||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:l}=f.getBoundingClientRect();a(t((r-s)/l*100))}var p;u(),e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(p=e.props.step.toString().split(".")[1])||void 0===p?void 0:p.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const d=vn(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":d;const m=vn(e.props.marks);e.props.marks=!!m&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=vn(e.props.markLabels),e.props.snapToMarks=vn(e.props.snapToMarks),e.props.showInput=vn(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar;const g={disabled:e.props.disabled,min:e.props.min,max:e.props.max,step:e.props.step};if(e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(g,e.props.inputAttrs):g,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs,mn(`track-${e.props.id}`,(()=>{var t;f=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`track-${e.props.id}`),a(e.value,!1),r()}),e.props.__root),e.context){let r=0,p="";const d=e.context.handlers.blur;e.context.handlers.blur=t=>{d(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!f)return;e.props.dragging=!1;const{left:n,width:r}=f.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[o,n]=e.value,r=Math.abs(o-s*e.props.max)<Math.abs(n-s*e.props.max)?"min":"max",l="min"===r?0:1;e.props.lastHandleInteraction=r,e.value[l]=t(100*s),a(e._value)}else a(t(100*s))},e.context.handlers.focus=t=>{if(!f)return;const o=t.target.dataset.handle;o&&(e.props.lastHandleInteraction=o)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1,a(e._value)},e.context.handlers.startDrag=t=>{if(!f)return;e.props.dragging=!0;const o="touchstart"===t.type,n=o?"touchmove":"mousemove",r=o?"touchend":"mouseup";e.props.lastHandleInteraction=t.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(n,l,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,l),o&&t.target instanceof HTMLElement&&t.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),p+=t.key;const e="-"===p?-1:1;r=window.setTimeout((()=>{"-"!==p?(a(parseFloat(p)*e),p=""):p=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,r=Array.isArray(e._value)?e._value[o]:e._value,s=function(t,o){if(!e.props.intervals)return e.props.step;const r=n(e.props.intervals);if(t>=e.props.max)return r[r.length-1].step;let s=r.find(((o,n)=>{var s;return t>=o.value&&t<((null===(s=r[n+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!s)return e.props.step;-1===o&&t-s.step<s.value&&(s=r[r.indexOf(s)-1]||s);return s.step}(r,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=c(r),n=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(n),l=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,i=Math.min(Math.max(0,s+l),e.props.marks.length-1);return void a(e.props.marks[i].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?a(e.props.min):a(e.props.max));if("Home"===t.key)return void a(e.props.min);if("End"===t.key)return void a(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){a(r+(t.shiftKey?10*s:s)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?a(r+10*s):"PageDown"===t.key&&a(r-10*s)}},e.context.handlers.maxNode=t=>{v=t,t.hook.commit(((o,n)=>{if(hn(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=r,a(e.value)):a(r),n(i(r))}))},e.context.handlers.minNode=t=>{h=t,t.hook.commit(((o,n)=>{if(hn(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=r,a(e.value)):a(r),n(i(r))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(s),h&&h.input(e.value[0]),v&&v.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>o(t,e.props.min,e.props.max)}a(e.value,!1)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||a(t,!1):e.value!==t&&a(t,!1)})),e.on("prop:max",(()=>{e.props.max=parseFloat(`${e.props.max}`),a(e.value)})),e.on("prop:min",(()=>{e.props.min=parseFloat(`${e.props.min}`),a(e.value)}))}]},oc=a("cp"),{outer:nc,wrapper:rc,inner:sc,label:ac,prefix:lc,suffix:ic,help:pc,messages:dc,message:cc,icon:uc}=l(oc),fc=oc("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),hc=oc("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),vc=oc("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),mc=oc("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),gc=oc("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),$c=oc("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),bc=oc("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),yc=oc("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),xc=oc("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),wc=oc("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),_c=oc("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),kc=oc("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),Sc=oc("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),Lc=oc("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),Dc=oc("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),Ac=oc("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),Cc=oc("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),Ic=oc("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),Mc=oc("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),Tc=oc("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),Ec=oc("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),Oc=oc("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),Fc=oc("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),Vc=oc("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),Bc=oc("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),Pc=oc("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),Hc=oc("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),Nc=oc("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),Rc=oc("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),Kc=oc("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Wc=oc("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),Yc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Uc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,Zc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},jc={schema:nc(rc(ac("$label"),p("$inline && $help",pc("$help")),sc(p("($inline === undefined || $inline === false) && $prefixIcon !== undefined",uc("prefix","label")),p("$inline === undefined || $inline === false",lc()),p("$inline === undefined || $inline === false",fc(Cc(),p("$showValue",hc()))),p("$inline || $expanded)",vc(p("$showPanelClose && ($inline === undefined || $inline === false)",mc(uc("close"))),p("$panelControls",gc($c(bc(),yc()),Dc(Ac()),xc(wc(),_c()),kc(Sc(),Lc()),p("$eyeDropper && $hasNativeEyeDropper",Ic(uc("eyeDropper"))))),p("$panelFormat",Mc(Tc(p('$panelActiveFormat === "hex"',Ec()),p('$panelActiveFormat === "rgba"',Oc()),p('$panelActiveFormat === "rgba"',Fc()),p('$panelActiveFormat === "rgba"',Vc()),p('$panelActiveFormat === "hsla"',Pc()),p('$panelActiveFormat === "hsla"',Hc()),p('$panelActiveFormat === "hsla"',Nc()),p('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',Bc())),Rc(uc("switch")))),p("$options",Kc(Wc())))),p("$inline === undefined || $inline === false",ic()),p("($inline === undefined || $inline === false) && $suffixIcon !== undefined",uc("suffix"))),p("$: ($inline === undefined || $inline === false) && $help",pc("$help"))),dc(cc("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){function t(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(k&&k.contains(s)){const n=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!n)return;if("INPUT"===s.tagName&&!tn(n)&&!Yc.test(n)&&!Uc.test(n))return;(tn(n)||n.startsWith("hsl")||n.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),o(n))}}function o(t){var o;if(!t)return;const n=on(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||zo(o,2)===e.props.h&&zo(r,2)===e.props.s&&zo(s,2)===e.props.v&&zo(a,2)===e.props.alpha)||(e.props.alpha=zo(a,2),x(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=on(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=zo(s,2),x(o,n,r)}else x(e.props.h,e.props.s,e.props.v)}else x(e.props.h,e.props.s,e.props.v)}}function n(t){if(!e.context||!I)return;const o=I[t];o&&(e.props.focusedSwatch=o.dataset.color)}function r(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function s(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),mn(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=qo(t.sRGBHex);e.props.alpha=1,x(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{S=e}),E,v),l("canvas-hue",(e=>{L=e}),d,m),l("canvas-alpha",(e=>{D=e}),O,g),i(`canvas-preview-${e.props.id}`,(e=>{A=e,c()}),F),i(`canvas-swatch-preview-${e.props.id}`,(e=>{C=e,u()}),V),p()}function l(t,o,n,r){let s=!1;const a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},l=e=>{1===e.buttons&&_&&r(e)},p=e=>{_&&r(e)},d=()=>{_=void 0,a()},c=()=>{_=void 0,a()};i(`${t}-${e.props.id}`,(e=>{const a=e.nextElementSibling;o(e),n(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,r),s||function(e,t){s=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(a,e),e.addEventListener("mousedown",(e=>{a.focus(),a.setAttribute("data-prevent-focus-style","true"),_=Zc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),_=Zc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){mn(t,(()=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(t);a&&(o(a),n&&r(a,n))}),e.props.__root)}function p(){mn(`swatches-${e.props.id}`,(()=>{var t,o,n;I=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),I.forEach((e=>{r(e,f)})),e.props.focusedSwatch=null===(n=null===(o=I[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,b()}),e.props.__root)}function d(){if(!L)return;const e=L.getContext("2d");if(!e)return;const t=L.width,o=L.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function c(){if(!A)return;const t=A.getContext("2d");if(!t)return;$(A,A.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,A.width,A.height)}function u(){if(!C)return;const t=C.getContext("2d");if(!t)return;$(C,C.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,C.width,C.height)}function f(e){if(!e)return;const t=e.getContext("2d");if(!t)return;$(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=nn(o),[l,i,p,d]=Go(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function h(e,t,o){let n=null;const r=e=>{null!==n&&cancelAnimationFrame(n),n=requestAnimationFrame((()=>{if(!t)return;const n=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-n.left,s=e.touches[0].clientY-n.top):(r=e.clientX-n.left,s=e.clientY-n.top),r=Math.min(Math.max(r,0),n.width),s=Math.min(Math.max(s,0),n.height),o(r,s)}))};r(e);const s=e=>{e.preventDefault(),r(e)},a=e=>{e.preventDefault(),r(e)},l=()=>{_=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l)},i=()=>{_=void 0,document.removeEventListener("touchmove",a),document.removeEventListener("touchend",i)};"touches"in e?(document.addEventListener("touchmove",a),document.addEventListener("touchend",i)):(document.addEventListener("mousemove",s),document.addEventListener("mouseup",l))}function v(t){h(t,S,((t,o)=>{const n=t/S.width*100,r=100-o/S.height*100;B(e.props.hue,n,r)}))}function m(t){h(t,L,((t,o)=>{if(!L)return;const n=L.width,r=Math.floor(t/n*360);e.props.h=r,B(e.props.h,e.props.s,e.props.v)}))}function g(t){h(t,D,((t,o)=>{const n=t/D.width*100/100;e.props.alpha=n,B(e.props.hue,e.props.s,e.props.v)}))}function $(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function b(){var t,o;if(!e.context||!e.props.options||!I)return;const{h:r,s:s,v:a,alpha:l}=e.props,i=function(e,t,o,n=1){const r=0===o?0:t;return`${zo(0===o||100===o&&0===t?0:e,0)}-${zo(r,0)}-${zo(o,0)}-${zo(n,2)}`}(r,s,a,l);let p=!1,d=!1;I.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,r,s,c]=t.split("-");"0"===s&&0===a&&c===`${l}`&&(d=!0);const u=e.parentElement;d||t===i?(u.dataset.active="true",e.ariaSelected="true",d=!1,!p&&I&&(n(I.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=I[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function y(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function x(t,o,n,r=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:zo(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:zo(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:zo(Math.max(Math.min(n,100),0),2);const{h:s,s:a,v:l,alpha:i}=e.props,[p,d,c]=Go(s,a,l),[u,f,h]=Jo(s,a,l),v=e.props.hexInputFocused?e.props.hex:en(s,a,l,i),m=zo(i,2);e.props.hsla={h:s,s:d,l:c,a:m},e.props.hslaPercent={h:zo(s,0),s:100===l&&0===a?0:zo(0===l?d/255:Math.max(Math.min(d/255*100,100),0),0),l:zo(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:m},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${m})`,e.props.hslaStringPrecise=`hsla(${s}, ${zo(0===l?d/255:d/255*100,2)}%, ${zo(c/255*100,2)}%, ${m})`,e.props.rgba={r:u,g:f,b:h,a:m},e.props.rgbaString=`rgba(${u}, ${f}, ${h}, ${m})`,y(v),setTimeout((()=>{var t;w(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),P(),k||"undefined"==typeof window||(k=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const g=e.props.valueFormat?e.props.valueFormat:e.props.format;r||("hex"===g?e.input(e.props.hex):"rgba"===g?e.input(e.props.rgbaString):"hsla"===g&&e.input(e.props.hslaStringPrecise))}function w(){E(),O(),F(),V()}let _,k=null,S=null,L=null,D=null,A=null,C=null,I=null,M=0;const T=["hex","rgba","hsla"],E=rn((function(){if(!S)return;const t=S.getContext("2d");if(!t)return;const{width:o,height:n}=S,r=e.props.h||0;t.fillStyle=`hsl(${r}, 100%, 50%)`,t.fillRect(0,0,o,n);const s=t.createLinearGradient(0,0,o,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=s,t.fillRect(0,0,o,n);const a=t.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=a,t.fillRect(0,0,o,n)}),2),O=rn((function(){if(!D)return;const t=D.getContext("2d");if(!t)return;const o=Math.round(D.width),n=Math.round(D.height);t.clearRect(0,0,o,n),$(D,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,l=t.createLinearGradient(0,0,o,0);l.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),l.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=l,t.fillRect(0,0,o,n)}),2),F=rn(c,2),V=rn(u,2),B=rn(x,2),P=rn(b,10,!1);e.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",t)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",t),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||T[0],e.props.panelControls=sn(e.props.panelControls),e.props.eyeDropper=sn(e.props.eyeDropper),e.props.panelFormat=sn(e.props.panelFormat),e.props.showValue=sn(e.props.showValue),e.props.allowPaste=sn(e.props.allowPaste),e.props.inline=vn(e.props.inline),e.props.disabled=vn(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=vn(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},x(0,0,0,!0)):o(`${e.value}`),e.on("input",(({payload:t})=>{k&&void 0!==e.props.__root&&!k.contains(e.props.__root.activeElement)&&o(t)})),setTimeout((()=>{s()}),5),a(),e.on("prop:expanded",(()=>{function t(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}var o;if(e.props.expanded)s(),a(),p(),document.addEventListener("keydown",t),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",t);(null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=on(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${zo(n,t)}-${zo(r,t)}-${zo(s,t)}-${zo(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.expanded=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(T.indexOf(e.props.panelActiveFormat)+t+T.length)%T.length;e.props.panelActiveFormat=T[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.expanded){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(an),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":x(o,n-s,r);break;case"ArrowRight":x(o,n+s,r);break;case"ArrowUp":x(o,n,r+s);break;case"ArrowDown":x(o,n,r-s);break;case"PageUp":x(o,n,r+10);break;case"PageDown":x(o,n,r-10);break;case"Home":x(o,n-10,r);break;case"End":x(o,n+10,r)}w()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":x(o-s,n,r);break;case"ArrowRight":case"ArrowUp":x(o+s,n,r);break;case"PageUp":x(o+10,n,r);break;case"PageDown":x(o-10,n,r);break;case"Home":x(0,n,r);break;case"End":x(360,n,r)}w()}},e.context.handlers.alphaControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,alpha:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.alpha=zo(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=zo(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=zo(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=zo(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}x(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,tn(r)){const[t,o,n,s]=qo(r);e.props.alpha=s,y(r),x(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!tn(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;tn(o)&&y(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=Xo(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);x(t,o,n)}else if("rgba"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=Qo(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);x(t,o,n)}else"alpha"==t&&(e.props.alpha=i,x())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=nn(o.dataset.colorPrecise);e.props.alpha=s,x(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,r,s,a;if(!e.context||!I||!I.length)return;const l=I.indexOf(t.currentTarget);let i=null;const p=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(I),d=I.length;let c=0,u=d,f=!1;const h=I[l].dataset.group;if(void 0!==h){const e=I.filter((e=>e.dataset.group===h));c=I.indexOf(e[0]),u=I.indexOf(e[e.length-1])}const v=(l-c)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,M=v,n(l)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void I.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),M=v,e.context.handlers.swatchClick(t),void n(l);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":i=Math.max(l-p,l-(p-(M-v))),f=!0;break;case"ArrowDown":i=Math.max(l+p,l+(p+(M-v))),f=!0;break;case"ArrowLeft":i=l-1,M=(i-c)%p;break;case"ArrowRight":i=l+1,M=(i-c)%p}if(f&&null!==i&&(i<c||i>u)){let e;e=i<c?null===(r=null===(o=I[c-1])||void 0===o?void 0:o.dataset)||void 0===r?void 0:r.group:null===(a=null===(s=I[u+1])||void 0===s?void 0:s.dataset)||void 0===a?void 0:a.group;const t=I.filter((e=>e.dataset.group===h)),n=I.filter((t=>t.dataset.group===e)),d=(l-c)%p,f=t.length%p||p,v=l>=c+t.length-f;if(i<c){const e=n.length%p||p;i=c-e+Math.min(Math.max(d,M),e-1)}else i>u&&(i=v?Math.min(u+Math.max(d,M)+1,I.indexOf(n[n.length-1])):Math.min(i,u))}if(null!==i&&i>=0&&i<d){n(i),I.forEach((e=>{delete e.parentElement.dataset.focused}));const e=I[i],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},$e,In,An("eyeDropper","color"),An("close","close"),Cn("close"),Cn("next")]},zc=a("tb"),{outer:qc,inner:Gc,wrapper:Xc,label:Jc,prefix:Qc,suffix:eu,help:tu,messages:ou,message:nu,icon:ru}=l(zc),su=zc("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),au=zc("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),lu=zc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),iu=zc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),pu=zc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}}))),du={schema:qc(p("$options",Xc(Jc("$label"),iu(pu(au(p("$fns.isChecked($option) === true",lu("$slots.default || $slots.on || $option.onLabel || $option.label"),lu("$slots.default || $slots.off || $option.offLabel || $option.label")))))),Xc(p("$label && ($slots.default || $slots.on || $onLabel)",Jc("$label")),su(ru("prefix"),Qc(),p("$_isChecked === true",lu("$slots.default || $slots.on || $onLabel || $label"),lu("$slots.default || $slots.off || $offLabel || $label")),eu(),ru("suffix")))),tu("$help"),ou(nu("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,n,r;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=vn(e.props.enforced),e.props.multiple=vn(e.props.multiple),e.props.vertical=vn(e.props.vertical),e.props.disabled=vn(e.props.disabled),null!==(t=(n=e.props).onValue)&&void 0!==t||(n.onValue=!0),null!==(o=(r=e.props).offValue)&&void 0!==o||(r.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=ln(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>ln(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?h(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],n=o.findIndex((e=>hn(e,t)));n>-1&&(!e.props.enforced||o.length>1)?o.splice(n,1):-1===n&&o.push(t),e.input(o)}else hn(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(hn(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},In]},cu=a("ut"),{outer:uu,inner:fu,wrapper:hu,label:vu,prefix:mu,suffix:gu,help:$u,messages:bu,message:yu,icon:xu}=l(cu),wu=cu("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),_u={schema:uu(hu(vu("$label"),fu(xu("prefix"),mu(),wu(),gu(),xu("suffix"))),$u("$help"),bu(yu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).decimals)&&void 0!==o||(d.decimals=null),null!==(n=(c=e.props).minDecimals)&&void 0!==n||(c.minDecimals=null),null!==(r=(u=e.props).min)&&void 0!==r||(u.min=null),null!==(s=(f=e.props).max)&&void 0!==s||(f.max=null),null!==(a=(h=e.props).step)&&void 0!==a||(h.step=1),null!==(l=(v=e.props).unit)&&void 0!==l||(v.unit=e.props.unit||"percent"),-1===["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"].indexOf(e.props.unit)&&(e.props.unit="percent"),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(pn(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},In]},ku=a("cr"),{outer:Su,inner:Lu,wrapper:Du,label:Au,prefix:Cu,suffix:Iu,help:Mu,messages:Tu,message:Eu,icon:Ou}=l(ku),Fu=ku("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),Vu={schema:Su(Du(Au("$label"),Lu(Ou("prefix"),Cu(),Fu(),Iu(),Ou("suffix"))),Mu("$help"),Tu(Eu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["currency","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),e.addProps(["inputText"]),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).currency)&&void 0!==o||(d.currency=e.props.currency||"USD"),null!==(n=(c=e.props).decimals)&&void 0!==n||(c.decimals=null),null!==(r=(u=e.props).minDecimals)&&void 0!==r||(u.minDecimals=null),null!==(s=(f=e.props).min)&&void 0!==s||(f.min=null),null!==(a=(h=e.props).max)&&void 0!==a||(h.max=null),null!==(l=(v=e.props).step)&&void 0!==l||(v.step=1),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(pn(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.setPlaceholder(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.init()}))})))}))}]};var Bu=Object.freeze({__proto__:null,autocomplete:Ja,colorpicker:jc,currency:Vu,datepicker:Ki,dropdown:ps,mask:Tp,rating:Da,repeater:ra,slider:tc,taglist:pp,toggle:As,togglebuttons:du,transferlist:_d,unit:_u});const Pu="undefined"!=typeof window?setInterval:()=>0,Hu=new WeakSet;export{p as $if,Ja as autocomplete,jc as colorpicker,l as createBaseSections,dn as createProPlugin,a as createSectionFactory,Vu as currency,Ki as datepicker,ps as dropdown,Bu as inputs,Tp as mask,Da as rating,ra as repeater,tc as slider,pp as taglist,As as toggle,du as togglebuttons,_d as transferlist,_u as unit};
|
|
1
|
+
import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as s,whenAvailable as r,clone as a}from"@formkit/utils";import{isDOM as l,isComponent as i,createMessage as p,warn as d,error as c}from"@formkit/core";import{icon as u,isSlotCondition as f,isSchemaObject as v,extendSchema as h,normalizeOptions as $,defaultIcon as m,localize as g,options as b,disablesChildren as y}from"@formkit/inputs";import"@formkit/vue";import{animations as x,dragAndDrop as w,handleEnd as _,handleDragstart as k,handleTouchstart as S,handleTouchmove as L,multiDrag as A}from"@formkit/drag-and-drop";import{offset as C,format as D,nearestDay as I,removeOffset as T,parse as O,sameDay as E,range as M,parts as V,parseParts as F,addDay as B,addMonth as P,addYear as H,dayStart as R,monthStart as K,monthEnd as N,date as W,formatStr as U,applyOffset as Y,monthDays as j,weekStart as Z,weekEnd as z}from"@formkit/tempo";const G=[988,24029,396,13078,980],q=18806588,X=502357,J=16217489;let Q=189024;const ee=()=>[30548127325,27022924,34729821653783].map(le).join("y"),te=/^[0-9a-f]+$/,oe="undefined"!=typeof window,ne=he(32,(e=>e)).map((()=>{Q|=0,Q=Q+1831565813|0;let e=Q^Q>>>15|Q;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),se=oe?setTimeout:()=>0,re=e=>{clearTimeout(ae[e])},ae={},le=e=>e.toString(32),ie=e=>`${le(ne[e]).substring(2)}.${le(G[e%(G.length-1)])}`;const pe={},de={},ce=new Set(["",null,void 0]);function ue(e,t){e in pe||(pe[e]={timer:0,inputs:new Set});const o=pe[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=se((()=>{ae[e]||(ae[e]=se((()=>ce.add(e)),2e3)),function(e){if(oe){window.addEventListener(ee(),(t=>{const o=new URL(t.blockedURI).hostname;ne.some(((e,t)=>ie(t)===o))&&(fe(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=le(q),n="://",s=(new Date).getDate(),r=async()=>{const a=Array.from(pe[e].inputs),l=a.filter((t=>!(de[e]&&de[e].has(t)))).join("");if(re(e),l){t++;try{const r=await window[le(J)](`${o}${n}${ie((s+t)%ne.length)}/${function(e){const t=Math.round(9*Math.random());let o="";for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);s>=48&&s<=57?s=48+(s+t)%58%48:s>=97&&s<=122&&(s=97+(s+t)%123%97),o+=String.fromCharCode(s)}return`${t}${o}`}(`${e.substring(3)}x${l}`)}`),i=await r.json();if(i[le(X)])return fe(e,i.schema);if(r.ok)return de[e]||(de[e]=new Set),void a.forEach((t=>de[e].add(t)))}catch(e){}t<2&&se(r,1e4*Math.random())}};r()}}(e)}),500)}function fe(e,t){ce.add(e),function(e,t){$e[e]&&$e[e].forEach((e=>e(t)))}(e,t)}function ve(e,t,o){if(ue(t,o),!t)throw new Error("FormKitNoKey");return ce.has(t)?null:e}function he(e,t){return new Array(e).fill("").map(((e,o)=>/* #__PURE__ */t(o)))}const $e={};const me=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple || $multiple || undefined","data-disabled":"$disabled || $disabledInternally || undefined","data-empty":"$state.empty || 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-draggable":"$draggable || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-inline":"$inline || undefined","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined"}}),ge=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),be=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),ye=()=>({$el:"ul",if:"$fns.length($messages)"}),xe=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),we=()=>({$el:"div",if:"$help"}),_e=()=>({$el:null}),ke=(e,t)=>()=>u(e,t),Se=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Le=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Ae=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Ce=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),De=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Ie=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Te=()=>({$el:null,for:["part","$_overlayParts"]});function Oe(t,o,n,s){return(...r)=>a=>p=>{const d=function(e,t,o,n,s,r){const a=r[o],p="function"==typeof n?n():{$el:n},d=s.map((e=>"string"==typeof e?e:e(t)(r)));let c=d.length&&p?h(p,{children:d}):p;if(c=h(c,a),"object"==typeof c){let s=c;if(!l(c)&&!i(c)||c.meta||(c.meta={section:o,node:n}),l(c)){const{$el:n,...r}=c;r.attrs?"class"in r.attrs||"if"in r.attrs||(r.attrs={class:`$classes.${o}`,...r.attrs}):r.attrs={class:`$classes.${o}`},s=Ee(t,o,Object.defineProperty(r,"$el",{enumerable:!1,get:ve.bind(null,n,t,e)}))}else if(i(c)){const{$cmp:n,...r}=c;s=Ee(t,o,Object.defineProperty(r,"$cmp",{enumerable:!1,get:ve.bind(null,n,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${o}`;const{$formkit:n,...r}=c;s=Ee(t,o,Object.defineProperty(r,"$formkit",{enumerable:!1,get:ve.bind(null,n,t,e)}))}return s}return Ee(t,o,c)}(t,a,o,n,r,p);return s&&e(d)&&(d.memo=t+JSON.stringify(p)),s?[d]:d}}function Ee(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function Me(e){return(t,o,n=!1)=>/* #__PURE__ */Oe(e,t,o,n)}function Ve(e){return{outer:/* #__PURE__ */e("outer",me,!0),wrapper:/* #__PURE__ */e("wrapper","div",!1),inner:/* #__PURE__ */e("inner",ge,!1),icon:ke,label:/* #__PURE__ */e("label",be,!1),prefix:/* #__PURE__ */e("prefix",_e,!1),suffix:/* #__PURE__ */e("suffix",_e,!1),help:/* #__PURE__ */e("help",we,!1),messages:/* #__PURE__ */e("messages",ye,!1),message:/* #__PURE__ */e("message",xe,!1)}}function Fe(e){return{overlayPlaceholder:/* #__PURE__ */e("overlayPlaceholder",Se),overlayLiteral:/* #__PURE__ */e("overlayLiteral",Le),overlayChar:/* #__PURE__ */e("overlayChar",Ae),overlayEnum:/* #__PURE__ */e("overlayEnum",Ce),overlay:/* #__PURE__ */e("overlay",De),overlayParts:/* #__PURE__ */e("overlayParts",Te),overlayInner:/* #__PURE__ */e("overlayInner",Ie)}}function Be(e,t,o){return n=>s=>{const r="string"==typeof t?t:t(n)(s);return o?{if:e,then:r,else:"string"==typeof o?o:o(n)(s)}:(f(r)?Object.assign(r.else,{if:e}):v(r)&&Object.assign(r,{if:e}),r)}}function Pe(e,o){return n=>{const s=s=>{const r=o(n)(s),a="function"==typeof e?e(n):e;return t(a)?(f(r)&&l(r.else)?r.else.attrs={...r.else.attrs,...a}:l(r)&&(r.attrs={...r.attrs,...a}),r):r};return s._s=o._s,s}}function He(e){const t=/* #__PURE__ */e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=/* #__PURE__ */e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),n=/* #__PURE__ */e("listitem",(()=>({$el:"li",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":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),s=/* #__PURE__ */e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),r=/* #__PURE__ */e("loadMoreInner","span"),a=/* #__PURE__ */e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),l=/* #__PURE__ */e("emptyMessageInner","span"),i=/* #__PURE__ */e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),p=/* #__PURE__ */e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),d=/* #__PURE__ */e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),c=/* #__PURE__ */e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),u=/* #__PURE__ */e("groupLabel","span"),f=/* #__PURE__ */e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>/* #__PURE__ */t(/* #__PURE__ */o(/* #__PURE__ */a(/* #__PURE__ */l("$emptyMessage")),/* #__PURE__ */p(/* #__PURE__ */Be("$option.group",/* #__PURE__ */c(/* #__PURE__ */u("$option.group"),/* #__PURE__ */f(/* #__PURE__ */d(
|
|
2
|
+
/* #__PURE__ */Pe((()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'})),/* #__PURE__ */n(/* #__PURE__ */Be("$fns.isSelected($option)",/* #__PURE__ */ke("selected")),/* #__PURE__ */i("$option.label")))))),/* #__PURE__ */n(/* #__PURE__ */Be("$fns.isSelected($option)",/* #__PURE__ */ke("selected")),/* #__PURE__ */i("$option.label")))),/* #__PURE__ */s(/* #__PURE__ */Be("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */r(/* #__PURE__ */Be("$state.loading",/* #__PURE__ */ke("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}const Re=/* #__PURE__ */Me("dd"),{outer:Ke,wrapper:Ne,inner:We,icon:Ue,label:Ye,prefix:je,suffix:Ze,help:ze,messages:Ge,message:qe}=/* #__PURE__ */Ve(Re),Xe=/* #__PURE__ */Re("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",name:"$node.name",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),Je=/* #__PURE__ */Re("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),Qe=/* #__PURE__ */Re("selection",(()=>({$el:"div"}))),et=/* #__PURE__ */Re("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),tt=/* #__PURE__ */Re("optionLoading","span"),ot=/* #__PURE__ */Re("option",(()=>({$el:"div"}))),nt=/* #__PURE__ */Re("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),st=/* #__PURE__ */Re("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),rt=/* #__PURE__ */Re("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),at=/* #__PURE__ */Re("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),lt=/* #__PURE__ */Re("selectionsItem",(()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'}))),it=/* #__PURE__ */Re("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),pt=/* #__PURE__ */Re("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),dt=/* #__PURE__ */Re("tagLabel",(()=>({$el:"span"}))),ct=/* #__PURE__ */Re("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),ut=/* #__PURE__ */Re("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),ft=/* #__PURE__ */Re("tagLoading","span"),vt=He(Re);function ht(t){return e(t)&&"value"in t&&"label"in t}function $t(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function mt(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function gt(e){return"__original"in e?e.__original:e.value}const bt=new WeakMap,yt=new WeakMap;async function xt(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(yt.get(e));const o=t?e.props.debounce:0;0===o?wt(e,n):yt.set(e,setTimeout((()=>{e.props.page=1,wt(e,n)}),o))}else if(Array.isArray(e.props.options)){const o=JSON.parse(JSON.stringify(e.props.initialOptions));e.props.options=[...o.filter((o=>{if("options"in o){const n=o.options=[...o.options].filter((o=>e.props.filter(o,null!=t?t:"",e)));return n.length>0&&{...o,options:n}}return e.props.filter(o,null!=t?t:"",e)}))]}}function wt(e,t){e.props.allowAppendOptions=t,Ct(e)}const _t=/* #__PURE__ */p({key:"loading",type:"state",value:!0,visible:!1}),kt=/* #__PURE__ */p({key:"loading",type:"state",value:!1,visible:!1});function St(e,t){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const o=$(t);e.props.appendingOptions=!0,e.props.activeValue=gt(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=$(t);e.props.options=o,e.props.options.length||(e.store.set(kt),e.store.set(/* #__PURE__ */p({key:"hasNextPage",type:"state",value:!1,visible:!1}))),bt.set(e,e.props.searchValue)}const Lt=new WeakMap;function At(t,s,r){if(t.store.set(_t),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let e;e=o(s)?{label:"Loading...",value:String(s)}:{label:String(s),value:s},t.props.optionLoaderValues.includes(e.value)||t.props.optionLoaderValues.push(e.value),"transferlist"===t.props.type||t.props.selections.includes(e)||(t.props.selections=[...t.props.selections,e])}const a=t.props.optionLoader(s,r),l=t=>"string"==typeof t?{label:t,value:s}:ht(t)?t:e(t)?Object.assign({label:String(s),value:s},t):{label:String(s),value:s},i=e=>{const o=t.props.memoOptions.findIndex((t=>n(gt(t),gt(e))));return-1===o?t.props.memoOptions=[...t.props.memoOptions,e]:t.props.memoOptions[o]=e,e};return a instanceof Promise?a.then((e=>{if("string"==typeof e||ht(e))return i(l(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==s)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==s)),t.props.optionLoadingCounter--,i(l(a)))}function Ct(e){e.store.set(_t),e.props.optionsLoadingCounter++,e.store.set(/* #__PURE__ */p({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,Lt.get(e)),n=St.bind(null,e),s=o instanceof Promise?o.then(((...o)=>{void 0!==e.props.nonceKey&&t!==e.props[e.props.nonceKey]||n(...o)})):(n(o),e.props.optionsLoadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.optionsLoadingCounter--}))}function Dt(e,t){e.props.page++,Lt.set(e,t),e.store.set(/* #__PURE__ */p({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const It=Symbol(),Tt=e=>{const t=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),s=e.props.inputStd||[],r=[];for(const e of s){let s,a=t.find((t=>n(gt(t),e)));s=o(e)?void 0:Array.isArray(e)?e.join(", "):e,a||(a={value:e,label:s,isPlaceholder:!1,noOptionFound:!0}),r.push(a)}return r};async function Ot(e){const t=Tt(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:oe&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function Et(e){var t,o;if(e.props.allOptions&&e.props.allOptions.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=gt(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>n(gt(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=gt(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=gt(e.props.allOptions[0]);else if(e.props.inputStd.length>0&&!e.props.multiple||e.props.multiple&&(null===(o=e.context)||void 0===o?void 0:o.state.dirty))e.props.selections[e.props.selections.length-1]?e.props.activeValue=gt(e.props.selections[e.props.selections.length-1]):e.props.activeValue=gt(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=gt(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function Mt(e){return e.reduce(((e,t)=>(t.options?e.push(...Mt(t.options)):e.push(t),e)),[])}function Vt(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(gt(t)!==It?(e.props.option=t,e.props.maxReached&&!Pt(e,t)||(e.input(Ft(e,gt(t))),Pt(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function Ft(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];for(const s of o)if(n(s,t))return e.props.optionRemoved=!0,o.filter((e=>!n(e,t)));return[...o,t]}return n(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function Bt(e,t){return n(e.props.activeValue,gt(t))||void 0}function Pt(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(n(o,gt(t)))return!0;return!1}return n(e.value,gt(t))}function Ht(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function Rt(e){e.props.firstCommit=!0;let t=null;e.on("commit",(()=>{if(0===e.props.inputStd.length&&e.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(e),void(t=e.props.inputStd);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=Ct(e);t instanceof Promise&&t.then((()=>{Ot(e)}))}"function"!=typeof e.props.optionLoader||e.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(t,e.props.inputStd)?0===e.props.optionsLoadingCounter&&Ot(e):(t=e.props.inputStd,async function(e){const t=Tt(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>n(gt(e),t))))):e.props.inputStd;if(o.forEach((o=>{At(e,o,Array.isArray(t)&&t.find((e=>n(gt(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{Ot(e),e.props.optionLoadingCounter||e.off(t)}))}else Ot(e)}(e))}))}const Kt=new WeakMap;function Nt(e){e.on("created",(()=>{if(!e.context||!oe)return;e.context.fns.isActive=Bt.bind(null,e),e.context.fns.isSelected=t=>Pt(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(n(gt(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=Jt,e.context.handlers.selectOption=t=>o=>Qt.call(null,e,t,o),e.context.handlers.loadMore=wt.bind(null,e),e.context.handlers.removeSelection=t=>o=>Xt(e,t,o),e.context.handlers.tagTouchstart=t=>o=>Xt(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?jt.bind(null,e,t):Yt.bind(null,e),e.context.handlers.selectionBlur=()=>Zt.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>n(e,gt(t)),e.context.handlers.tagClick=t=>zt.bind(null,e,t),e.context.handlers.tagFocus=t=>Gt.bind(null,e,t),e.context.handlers.tagBlur=()=>qt.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){var n;if(o&&o.relatedTarget instanceof HTMLElement){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(t instanceof HTMLElement&&t.contains(o.relatedTarget))return}t(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,e),e.context.handlers.touchmove=Wt.bind(null,e),e.context.handlers.touchend=Ut.bind(null,e)}))}function Wt(e,t){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=Kt.get(e);if(o){const[e,s]=o,r=t.touches[0].clientX-s;n.scrollLeft=e-r}else Kt.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function Ut(e){Kt.delete(e)}function Yt(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function jt(e,t,o){o.currentTarget instanceof HTMLElement&&(n(e.props.activeSelectionValue,gt(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=gt(t),o.currentTarget.focus()))}function Zt(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function zt(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(n(e.props.activeSelectionValue,gt(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=gt(t),o.currentTarget.focus())))}function Gt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=gt(t),e.props.justFocused=!0)}function qt(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function Xt(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"})}function Jt(e){e.stopPropagation()}function Qt(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},Vt(e,t))}function eo(e,t,o,n){!function(e){e.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===e.props.deselect?e.props.deselect=!0:e.props.deselect=s(e.props.deselect),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.options||(d(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=s(e.props.disabled)),e.props.allOptions=Mt(e.props.options),e.props.selections=[],e.props.memoOptions=[],e.props.invertPopover=!1,e.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},e.props.decrementCount=0,e.props.page=1,e.props.loadMoreOption={label:"Load more",value:It},e.props.loadOptions=Ct,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=s(e.props.searchable),e.props.loadOnScroll=s(e.props.loadOnScroll),e.props.multiple=s(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=s(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&s(e.props.openOnRemove),e.props.hasNextPage=Dt.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=s(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0),e.on("mounted",(()=>Ht(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ht(e)}),10)))}(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,gt(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],/* #__PURE__ */o(void 0===t?void 0:[...e.props.inputStd]))))}(n):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],/* #__PURE__ */o(t))))}(n),e(n),Rt(n),function(e){e.on("created",(()=>{e.context&&(e.props.trackHover=!0,void 0!==e.props.disabled||e.props.optionsLoader||!e.props.options||e.props.options.length||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||(e.props.disabledInternally=!0),e.props.loadOnCreated&&!e.props.optionsLoaded?Ct(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=s(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),Nt(n),t(n),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(kt))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(kt)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Mt(e.props.options),e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0),Et(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(oe)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),e.props.searchExpand||(o.value="",o.value=e.props.inputText))}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(n),o(n)}function to(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=s(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=s(e.props.selectionRemovable)}function oo(e){var t,o;e.props.searchValue||null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===o||o.focus()}function no(e,t,o){var s,r,a;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(gt(t)),e}),[]);(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&o.push(It);let l=-1;e.props.activeValue&&(l=o.findIndex((t=>n(t,e.props.activeValue)))),-1===l&&o.length?e.props.activeValue=o[0]:"ArrowDown"===t&&o.length>l+1?e.props.activeValue=o[l+1]:"ArrowUp"===t&&l>0?e.props.activeValue=o[l-1]:"ArrowUp"===t&&0===l&&(null===(a=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===a||a.focus(),e.props.expanded=!1)}else e.props.expanded||"ArrowDown"!==t||(e.props.expanded=!0)}function so(e,t){var o,n,s;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length&&!e.props.inputText){if("ArrowLeft"===t)return e.props.selections.length&&(null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===n||n.focus(),e.props.selections[e.props.selections.length-1]?e.props.activeSelectionValue=gt(e.props.selections[e.props.selections.length-1]):e.props.activeSelectionValue=void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(s=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===s||s.focus(),e.props.selections[0]?e.props.activeSelectionValue=gt(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function ro(e){var t,o;e.props.expanded=!0,null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()}function ao(e,t,o,s=!0){var r,a,l,i,p,d,c;const u=o.key;if(o.altKey){const s=mt(),r=e.props.selections.findIndex((e=>n(gt(e),gt(t)))),a=[...e.props.selections];"ArrowRight"===o.key?r<e.props.selections.length-1&&(a.splice(r,1),a.splice(r+1,0,t)):"ArrowLeft"===o.key&&r>0&&(a.splice(r,1),a.splice(r-1,0,t)),e.props.activeSelectionValue=gt(t),e.input([...a.map(gt)]),setTimeout((()=>{s instanceof HTMLElement&&s.focus()}),100)}else{const o=e.props.selections.findIndex((e=>n(gt(e),gt(t))));if(-1===o)return;const f="ArrowRight"===u?o+1:o-1;if(f>=e.props.selections.length){if(!s)return e.props.expanded=!0,e.props.activeSelectionValue=void 0,void(null===(a=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===a||a.focus());null===(i=null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`))||void 0===i||i.focus()}else if(f<0&&0===o)null===(d=null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=e.props.__root)||void 0===c?void 0:c.getElementById(`${e.props.id}_tag-wrapper_${f}`);v&&v.focus(),e.props.selections[f]?e.props.activeSelectionValue=gt(e.props.selections[f]):e.props.activeSelectionValue=void 0}}function lo(e,t,o){var s;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.findIndex((e=>n(gt(e),gt(t))));if(-1===r)return;const a=e.props.selections[r+1]?r+1:r-1,l=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_tag-wrapper_${a}`);l&&l.focus(),e.props.userAction={type:"tagDelete"}}function io(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(Ft(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===It)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>n(gt(t),e.props.activeValue)));if(!t)return;Vt(e,t)}else e.props.expanded=!0}function po(e){e.props.expanded&&(e.props.expanded=!1)}function co(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":ro(e);break;case"ArrowRight":case"ArrowLeft":ao(e,t,o,!1);break;case"Delete":case"Backspace":lo(e,t,o)}}function uo(e,t,o){if(e.props.disabled)return;switch(o.key){case"ArrowUp":case"ArrowDown":!function(e,t,o){var s,r,a,l;o.preventDefault();const i=o.key,p=e.props.selections.findIndex((e=>n(gt(e),gt(t))));if(-1===p)return;const d="ArrowDown"===i?p+1:p-1;if(d<0&&(null===(r=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}`))||void 0===r||r.focus()),d<0||d>=e.props.selections.length)return;const c=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_selection_wrapper_${d}`);c&&c.focus(),e.props.activeSelectionValue=(null===(l=e.props.selections[d])||void 0===l?void 0:l.value)||void 0}(e,t,o);break;case"Enter":break;case"Tab":!function(e,t,o){var s,r,a,l;if(t){const i=e.props.selections.findIndex((e=>n(gt(e),gt(t))));if(-1===i)return;const p=o.shiftKey?i-1:i+1;if(p>=e.props.selections.length)return;if(p<0)return void(null===(r=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}`))||void 0===r||r.focus());const d=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_selection_wrapper_${p}`);d&&d.focus(),e.props.activeSelectionValue=(null===(l=e.props.selections[p])||void 0===l?void 0:l.value)||void 0}}(e,t,o);break;case"Delete":case"Backspace":!function(e,t){var o;if(t){const s=e.props.selections.findIndex((e=>n(gt(e),gt(t))));if(-1===s)return;const r=e.props.selections[s+1]?s+1:s-1,a=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${r}`);a&&a.focus(),e.props.selections[r]?e.props.activeSelectionValue=gt(e.props.selections[r]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"})}(e,t)}}function fo(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e){e.props.expanded&&(e.props.expanded=!1)}(e);break;case"ArrowUp":case"ArrowDown":no(e,o,t);break;case"ArrowLeft":case"ArrowRight":so(e,o);break;case"Enter":io(e,t);break;case"Escape":po(e);break;case"Delete":case"Backspace":oo(e);break;default:e.emit("unusedKeydown",t)}}function vo(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e,t){var o,n,s;e.props.expanded=!1,e.props.multiple&&e.props.selections.length&&"autocomplete"===e.props.type&&"option"===e.props.selectionAppearance&&(t.preventDefault(),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_0`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(s=e.props.selections[0])||void 0===s?void 0:s.value)||void 0)}(e,t);break;case"ArrowUp":case"ArrowDown":no(e,o,t);break;case"ArrowRight":case"ArrowLeft":so(e,o);break;case"Enter":io(e,t);break;case"Escape":po(e);break;case"Delete":case"Backspace":oo(e)}}function ho(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&s(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=$o.bind(null,e),e.context.handlers.focus=mo.bind(null,e),e.context.handlers.keydown=fo.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>co.bind(null,e,t))}))}function $o(e,t){var o;if(t.stopPropagation(),0===t.detail)return;if(e.props.disabled)return;e.props.attrs.onClick&&e.props.attrs.onClick(t);const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);e.props.justOpened?e.props.justOpened=!1:e.props.expanded?e.props.expanded=!1:(n&&"mouse"!==t.pointerType?(e.props.mouseX=-1,e.props.mouseY=-1):(e.props.mouseX=t.clientX,e.props.mouseY=t.clientY),e.props.expanded=!0,null==n||n.focus())}function mo(e){e.props.disabled||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.justOpened=!0,e.props.expanded=!0))}function go(e){let t,o="";e.on("unusedKeydown",(({payload:s})=>{if(!s.isComposing&&1===[...s.key].length){if(!o&&" "===s.key)return void function(e,t){var o;if(t.preventDefault(),e.props.expanded){if(e.props.activeValue===It)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>n(gt(t),e.props.activeValue)));if(!t)return;Vt(e,t)}else e.props.expanded=!0}(e,s);e.props.expanded=!0,clearTimeout(t),o+=s.key;const r=e.props.allOptions.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=gt(r)),t=setTimeout((()=>{o=""}),400)}}))}function bo(e){yo(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,yo(e)})),oe&&r(`${e.props.id}_selections`,wo.bind(null,e),e.props.__root)}function yo(e){e.isCreated&&(e.props.selections.length&&e.props.lastVisibleIndex&&e.props.selections.length-e.props.lastVisibleIndex>1?e.props.truncationCount="+ "+(e.props.selections.length-e.props.lastVisibleIndex-1).toString():e.props.truncationCount=void 0,e.props.formattedSelections=e.props.selections.map(((t,o)=>e.props.lastVisibleIndex&&o===e.props.lastVisibleIndex&&0!==o?e.props.lastTruncatedElText&&o===e.props.selections.length-1?e.props.lastTruncatedElText:o===e.props.selections.length-1?t.label:t.label+"...":o===e.props.selections.length-1?t.label:t.label+", ")))}function xo(e){var t,o;if(!oe||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const s=n.parentNode;if(!(s instanceof HTMLElement))return;let r=n.getBoundingClientRect().width;const a=.98*s.getBoundingClientRect().width,l=Array.prototype.slice.call(n.children),i=[...e.props.selections];if(r>a){const t=[];let n=0;for(let e=0;e<i.length;e++)t.push([i[e],l[e]]);for(let s=t.length-1;s>=0;s--){const l=t[s];if(!(l[1]instanceof HTMLElement))return;n+=l[1].getBoundingClientRect().width+parseFloat(window.getComputedStyle(l[1]).marginRight)+parseFloat(window.getComputedStyle(l[1]).marginLeft);const i=r-n;if(a>i){const t=l[0].label;e.props.skipFormatSelections=!0,l[1].textContent=t;let n=!1;for(let r=t.length;r>=0;r--){if(e.props.skipFormatSelections=!0,l[1].textContent=t.slice(0,r).trim()+"...",i+l[1].getBoundingClientRect().width<a){if(r<4){e.props.lastVisibleIndex=s-1,e.props.lastTruncatedElText=null;break}if(e.props.lastVisibleIndex=s,e.props.lastTruncatedElText&&l[1].textContent.slice(0,4)===e.props.lastTruncatedElText.slice(0,4))break;e.props.lastTruncatedElText=null===(o=l[1])||void 0===o?void 0:o.textContent;break}0===r&&(n=!0)}l[1].textContent=e.props.lastTruncatedElText&&!n&&0!==s?e.props.lastTruncatedElText:t,null===e.props.lastVisibleIndex&&(e.props.lastVisibleIndex=0===s?0:s-1,e.props.lastTruncatedElText=null),setTimeout((()=>{yo(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,yo(e)}function wo(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:xo(e))})),n=new ResizeObserver((()=>{xo(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const _o={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},ko={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},So={overflow:"hidden",height:"100%"},Lo={},Ao={};let Co=0;function Do(e){var t,o;if("undefined"==typeof window)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!s||!n)return;const r=n.style.paddingTop,a=n.style.paddingBottom,l=n.style.paddingLeft;n.style.paddingTop="0",n.style.paddingBottom="0",n.style.paddingLeft="0";const i=s.getBoundingClientRect(),p=n.getBoundingClientRect(),d=Math.round(i.top-p.top)+"px",c=Math.round(i.left-p.left-5)+"px",u=Math.max(Math.round(Math.min(p.height-p.top,window.innerHeight)-(i.top+i.height)),0)+"px";n.style.paddingTop=r,n.style.paddingBottom=a,n.style.paddingLeft=l,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:d,paddingLeft:c,paddingBottom:u},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${i.width+"px"}, calc(100vw - 4em))`:i.width+"px",maxWidth:"calc(100vw - 4em)"}}function Io(e,t){var o,s;let r=null;if(e.props.activeDescendant){const a=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!a)return r;e.props.ignoreScroll=!0;const l=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listbox`);if(!l)return r;const i=t.getBoundingClientRect(),p=l.getBoundingClientRect(),d=parseInt(getComputedStyle(t).paddingTop),c=parseInt(getComputedStyle(t).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(t.scrollHeight-c-u-i.height,0),h=p.height-f-v;t.scrollTop=u;const $=()=>{t.scrollTop=v>0?v<d?t.scrollHeight:d:f<c?0:u-c},m=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>m?t.scrollTop=u:$();t.clientHeight/2<t.scrollTop&&(r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>n(e.value,gt(t))))),-1===r&&(r=null)}return r}function To(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&c(300,[e]),e.props.dropdownWrapperStyles=a(_o),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=Do.bind(null,e),e.props.positionListBox=Io.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Co=document.documentElement.scrollTop;for(const e in ko)Ao[e]=document.documentElement.style[e],document.documentElement.style[e]=ko[e];for(const e in So)Lo[e]=document.body.style[e],document.body.style[e]=So[e];document.body.scrollTop=Co}():function(){for(const e in ko)document.documentElement.style[e]=Ao[e];for(const e in So)document.body.style[e]=Lo[e];document.body.scrollTop=0,document.documentElement.scrollTop=Co}())}))}function Oo(e){e.addProps(["multiLine"]),e.on("created",(()=>{oe&&(e.props.multiLineHeight=void 0,r(`${e.props.id}_selections`,Eo.bind(null,e),e.props.__root))}))}function Eo(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),Mo(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function Mo(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let s,r=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;r=[t,...Array.from(n)]}else r=Array.from(n);if(!n)return;let a=!1;for(const t of r)if(void 0===s)s=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(s.top>=o.top+o.height/5||s.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function Vo(e){if(e.on("created",(()=>{e.context&&go(e)})),e.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(e),"truncate"===e.props.selectionAppearance&&(e.props.lastVisibleIndex=null,bo(e),e.on("prop:selections",(()=>{bo(e)}))),"tags"===e.props.selectionAppearance&&Oo(e),e.props.multiple&&"tags"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t,o){e.input(t)}e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),r(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const s={threshold:{horizontal:.25,vertical:0},plugins:[x()],draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};w({parent:n,getValues:t,setValues:o,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,w({parent:n,getValues:t,setValues:o,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,w({parent:n,getValues:t,setValues:o,config:s})}))}}),e.props.__root)}))}e.on("prop:expanded",(({payload:t})=>{t&&e.props.optionsLoader&&"function"==typeof e.props.optionsLoader&&(!e.props.options.length||e.props.alwaysLoadOnOpen)&&(e.props.options=[],Ct(e))})),"overscroll"===e.props.behavior&&To(e)}const Fo=(e,t)=>{let o=null,n=null,s=null;return function(...r){const a=this;o?(n=r,s=a):(e.apply(a,r),o=window.setTimeout((()=>{o=null,null!==n&&null!==s&&(e.apply(s,n),n=null,s=null)}),t))}};function Bo(e){if(e.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),e.props.popover=s(e.props.popover)?"manual":void 0,"input"!==e.type||"overscroll"===e.props.behavior)return;let t=null,o=null,n=[],a=null;if(e.props.popoverOffset=s(e.props.popoverOffset)?parseInt(e.props.popoverOffset):0,!e.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void console.warn('FormKit: Popover API is not supported in this browser — input panels will be rendered with fallback CSS positioning. This could result in inaccessible inputs due to parent containers using "overflow: hidden" or z-index conflicts.');const l=()=>{document.removeEventListener("resize",a),document.removeEventListener("scroll",a),n.forEach((e=>{e.removeEventListener("scroll",a)}))};function i(){const{x:n,y:s,width:r,height:a}=function(e,t){if(!e||!t)return{x:0,y:0};const{left:o,top:n,width:s,height:r}=t.getBoundingClientRect();return{x:o+window.scrollX,y:n+r+window.scrollY,width:s,height:r}}(t,o);e.props.popoverAncestorCoordinates={x:n,y:s,width:r,height:a},e.props.popoverCoordinates={x:n,y:s,width:r,height:0}}function p(o){o?(null==t||t.showPopover(),setTimeout((()=>{e.props.popoverCoordinates.height=(null==t?void 0:t.offsetHeight)||0}),5)):(null==t?void 0:t.matches(":popover-open"))&&(null==t||t.hidePopover(),e.props.popoverCoordinates.height=0)}e.on("mounted",(()=>{e.context&&(e.props.usePopover=!0,e.props.popoverCoordinates={x:0,y:0,width:0,height:0},e.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),e.on("destroyed",(()=>{l()})),e.on("prop:expanded",(({payload:s})=>{var d;e.context&&(!1===s?l():r(`${null===(d=e.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!e.context)return;t=document.querySelector(`#${e.context.id}_popover[popover]`)||document.querySelector(`#${e.context.id}_popover [popover]`),o||(o=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(t)),i(),p(s),a=Fo((()=>{e.context&&(i(),p(s))}),10),document.addEventListener("resize",a),document.addEventListener("scroll",a),n=[];let r=null==t?void 0:t.parentElement;for(;r;)r.scrollHeight>r.clientHeight&&n.push(r),r=r.parentElement;n.forEach((e=>{e.addEventListener("scroll",a)}))})))}))}const Po={schema:/* #__PURE__ */Ke(/* #__PURE__ */Ne(/* #__PURE__ */Ye("$label"),/* #__PURE__ */We(/* #__PURE__ */Ue("prefix"),/* #__PURE__ */je(),/* #__PURE__ */Xe(/* #__PURE__ */Be("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */et('$placeholder || "placeholder"'),/* #__PURE__ */Be("$multiple !== true",/* #__PURE__ */Je(/* #__PURE__ */Be("$state.loading && $selections.length === 0",/* #__PURE__ */tt("$ui.isLoading.value"),/* #__PURE__ */Qe(/* #__PURE__ */ot("$option.label")))),/* #__PURE__ */Be('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */st(/* #__PURE__ */rt(/* #__PURE__ */Be("$state.loading && $selections.length === 0",/* #__PURE__ */tt("$ui.isLoading.value"),/* #__PURE__ */lt()))),/* #__PURE__ */Be('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */ct(/* #__PURE__ */ut(/* #__PURE__ */Be("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */tt("$ui.isLoading.value"),/* #__PURE__ */it(/* #__PURE__ */pt(/* #__PURE__ */Be("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */ft("$ui.isLoading.value"),/* #__PURE__ */dt("$option.label")),/* #__PURE__ */nt(/* #__PURE__ */Ue("close"))))))))))),/* #__PURE__ */Be("$truncationCount && $state.loading !== true",/* #__PURE__ */at("$truncationCount")),/* #__PURE__ */Be("$state.loading",/* #__PURE__ */Ue("loader")),/* #__PURE__ */Be("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */nt(/* #__PURE__ */Ue("close")),/* #__PURE__ */Ue("select"))),/* #__PURE__ */vt(),/* #__PURE__ */Ze(),/* #__PURE__ */Ue("suffix"))),/* #__PURE__ */ze("$help"),/* #__PURE__ */Ge(/* #__PURE__ */qe("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
3
|
+
/* #__PURE__ */m("select","select"),
|
|
4
|
+
/* #__PURE__ */m("close","close"),
|
|
5
|
+
/* #__PURE__ */m("selected","check"),
|
|
6
|
+
/* #__PURE__ */m("loader","spinner"),
|
|
7
|
+
/* #__PURE__ */g("isLoading"),
|
|
8
|
+
/* #__PURE__ */g("loadMore"),
|
|
9
|
+
/* #__PURE__ */g("remove"),b,
|
|
10
|
+
/* #__PURE__ */eo.bind(null,to,ho,Vo),Bo]},Ho=/* #__PURE__ */Me("tg"),{outer:Ro,wrapper:Ko,label:No,prefix:Wo,suffix:Uo,help:Yo,messages:jo,message:Zo,icon:zo}=/* #__PURE__ */Ve(Ho),Go=/* #__PURE__ */Ho("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",name:"$node.name",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),qo=/* #__PURE__ */Ho("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Xo=/* #__PURE__ */Ho("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"}))),Jo=/* #__PURE__ */Ho("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"}}))),Qo=/* #__PURE__ */Ho("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"}}}))),en=/* #__PURE__ */Ho("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),tn=/* #__PURE__ */Ho("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),on=/* #__PURE__ */Ho("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}})));const nn={schema:/* #__PURE__ */Ro(/* #__PURE__ */Ko(/* #__PURE__ */Xo(),/* #__PURE__ */en(/* #__PURE__ */Wo(),/* #__PURE__ */Go(),/* #__PURE__ */tn(/* #__PURE__ */Jo(),/* #__PURE__ */on(/* #__PURE__ */Be("$slots.default","$slots.default",/* #__PURE__ */zo("thumb")))),/* #__PURE__ */Uo()),/* #__PURE__ */Qo(),/* #__PURE__ */qo()),/* #__PURE__ */Yo("$help"),/* #__PURE__ */jo(/* #__PURE__ */Zo("$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",(()=>{"disabled"in e.props&&(e.props.disabled=s(e.props.disabled)),e.props.altLabelPosition=s(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=n(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=n(t,e.props.onValue)}))}]},sn=/* #__PURE__ */Me("rp"),{outer:rn,inner:an,prefix:ln,suffix:pn,help:dn,messages:cn,message:un,icon:fn}=/* #__PURE__ */Ve(sn),vn=/* #__PURE__ */sn("empty",(()=>({$el:"div"}))),hn=/* #__PURE__ */sn("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),$n=/* #__PURE__ */sn("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),mn=/* #__PURE__ */sn("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),gn=/* #__PURE__ */sn("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),bn=/* #__PURE__ */sn("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),yn=/* #__PURE__ */sn("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),xn=/* #__PURE__ */sn("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),wn=/* #__PURE__ */sn("content","div"),_n=/* #__PURE__ */sn("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),kn=/* #__PURE__ */sn("legend",(()=>({$el:"legend",if:"$label"}))),Sn=/* #__PURE__ */sn("group",(()=>({$formkit:"group",index:"$index"}))),Ln=/* #__PURE__ */sn("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),An=/* #__PURE__ */sn("remove",(()=>({$el:"li",if:"$removeControl"}))),Cn=/* #__PURE__ */sn("insert",(()=>({$el:"li",if:"$insertControl"}))),Dn=/* #__PURE__ */sn("up",(()=>({$el:"li",if:"$upControl"}))),In=/* #__PURE__ */sn("down",(()=>({$el:"li",if:"$downControl"}))),Tn=/* #__PURE__ */sn("controlLabel","span"),On=/* #__PURE__ */sn("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),En=/* #__PURE__ */sn("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}})));function Mn(e){var t,o,n,r,a,l,i,p,d,c,u,f,v,h;if(null!==(t=(p=e.props).removeControl)&&void 0!==t||(p.removeControl=!0),null!==(o=(d=e.props).upControl)&&void 0!==o||(d.upControl=!0),null!==(n=(c=e.props).downControl)&&void 0!==n||(c.downControl=!0),null!==(r=(u=e.props).insertControl)&&void 0!==r||(u.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=e.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(i=(h=e.props).addAttrs)&&void 0!==i||(h.addAttrs={}),e.props.draggable=s(e.props.draggable),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(Array.isArray(e.value))if(e.value.length<e.props.min){const t=he(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(he(e.props.min,(()=>({}))),!1);e.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(e,e.context.fns)}function Vn(e,t){if(!t.context)return;const o={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[x({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};function n(){return Array.isArray(t.value)?t.value:[]}function s(e){t.input(e)}w({parent:e,getValues:n,setValues:s,config:o}),t.on("prop:disabled",(({payload:t})=>{o.disabled=t,w({parent:e,getValues:n,setValues:s,config:o})})),t.on("prop:draggable",(({payload:t})=>{o.disabled=!t,w({parent:e,getValues:n,setValues:s,config:o})}))}const Fn={schema:/* #__PURE__ */rn(/* #__PURE__ */_n(/* #__PURE__ */kn("$label"),/* #__PURE__ */dn("$help"),/* #__PURE__ */an(/* #__PURE__ */ln(),/* #__PURE__ */Be("$value.length === 0",/* #__PURE__ */Be("$slots.empty",/* #__PURE__ */vn()),/* #__PURE__ */Be("$slots.default",/* #__PURE__ */gn(/* #__PURE__ */bn(/* #__PURE__ */On(/* #__PURE__ */En(/* #__PURE__ */fn("dragHandle"))),/* #__PURE__ */wn(/* #__PURE__ */Sn("$slots.default")),/* #__PURE__ */Ln(/* #__PURE__ */Dn(/* #__PURE__ */xn(/* #__PURE__ */Tn("$ui.moveUp.value"),/* #__PURE__ */fn("moveUp"))),/* #__PURE__ */An(/* #__PURE__ */mn(/* #__PURE__ */Tn("$ui.remove.value"),/* #__PURE__ */fn("remove"))),/* #__PURE__ */Cn(/* #__PURE__ */hn(/* #__PURE__ */Tn("$ui.add.value"),/* #__PURE__ */fn("add"))),/* #__PURE__ */In(/* #__PURE__ */yn(/* #__PURE__ */Tn("$ui.moveDown.value"),/* #__PURE__ */fn("moveDown")))))),/* #__PURE__ */pn()))),/* #__PURE__ */$n('$addLabel || ($ui.add.value + " " + ($label || ""))')),/* #__PURE__ */cn(/* #__PURE__ */un("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(e){e._c.sync=!0,e.on("created",Mn.bind(null,e)),e.on("mounted",(()=>{r(`${e.props.id}_items`,(t=>{if(t instanceof HTMLElement){Vn(t,e);function o(t){for(const o of t)for(const t of Array.from(o.addedNodes))if(t instanceof HTMLElement&&t.id===`${e.props.id}_items`)return void Vn(t,e)}new MutationObserver(o).observe(t.parentNode,{childList:!0})}}),e.props.__root)}))},y,
|
|
11
|
+
/* #__PURE__ */g("remove"),
|
|
12
|
+
/* #__PURE__ */g("add"),
|
|
13
|
+
/* #__PURE__ */g("moveUp"),
|
|
14
|
+
/* #__PURE__ */g("moveDown"),
|
|
15
|
+
/* #__PURE__ */m("dragHandle","dragHandle"),
|
|
16
|
+
/* #__PURE__ */m("remove","trash"),
|
|
17
|
+
/* #__PURE__ */m("add","add"),
|
|
18
|
+
/* #__PURE__ */m("moveUp","arrowUp"),
|
|
19
|
+
/* #__PURE__ */m("moveDown","arrowDown")]},Bn=new WeakMap;function Pn(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const s=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(s+"%"),o.offItems.push(100-s+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function Hn(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function Rn(e,t){const{x:o,y:n}=Gn(t);let s=document.elementFromPoint(o,n);const r=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;s&&a;){if(r.includes(s)){a=!1;break}s=s.parentNode}if(!a){const t=r.indexOf(s);if(1===e.props.step)return void e.input(t+1,!1)}}function Kn(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?qn(e,t,o):e.input(t+1,!1))}function Nn(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Pn(e);const o=Bn.get(e);o&&(o.abort(),Bn.delete(e))}function Wn(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>Nn(e,t)),{signal:n.signal}),Bn.set(e,n),1===e.props.step?e.input(t+1,!1):qn(e,t,o)}function Un(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?Xn(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?Xn(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function Yn(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function jn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Pn(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):qn(e,t,o,!!e.props.dragStarted)))}function Zn(e){Pn(e)}function zn(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void qn(e,t,o)}function Gn(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function qn(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:s,y:r}=Gn(o),a=o.currentTarget.getBoundingClientRect();let l=Xn((s-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):Pn(e,l):e.input(0)}function Xn(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const Jn=/* #__PURE__ */Me("rt"),{outer:Qn,wrapper:es,inner:ts,label:os,prefix:ns,suffix:ss,help:rs,messages:as,message:ls,icon:is}=/* #__PURE__ */Ve(Jn),ps=/* #__PURE__ */Jn("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),ds=/* #__PURE__ */Jn("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),cs=/* #__PURE__ */Jn("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),us=/* #__PURE__ */Jn("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),fs=/* #__PURE__ */Jn("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),vs=/* #__PURE__ */Jn("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),hs=/* #__PURE__ */Jn("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),$s=/* #__PURE__ */Jn("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),ms=/* #__PURE__ */Jn("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),gs=/* #__PURE__ */Jn("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),bs={schema:/* #__PURE__ */Qn(/* #__PURE__ */es(/* #__PURE__ */os("$label"),/* #__PURE__ */ts(/* #__PURE__ */is("prefix"),/* #__PURE__ */ns(),/* #__PURE__ */ps(/* #__PURE__ */ds(/* #__PURE__ */cs(/* #__PURE__ */us(/* #__PURE__ */hs(/* #__PURE__ */ms(
|
|
20
|
+
/* #__PURE__ */Be("$slots.onItem",(()=>()=>"$slots.onItem"),
|
|
21
|
+
/* #__PURE__ */Be("$slots.default",(()=>()=>"$slots.default"),/* #__PURE__ */is("rating"))))),/* #__PURE__ */$s(/* #__PURE__ */gs(
|
|
22
|
+
/* #__PURE__ */Be("$slots.offItem",(()=>()=>"$slots.offItem"),
|
|
23
|
+
/* #__PURE__ */Be("$slots.default",(()=>()=>"$slots.default"),/* #__PURE__ */is("rating"))))),/* #__PURE__ */fs()),/* #__PURE__ */vs()))),/* #__PURE__ */ss(),/* #__PURE__ */is("suffix"))),/* #__PURE__ */rs("$help"),/* #__PURE__ */as(/* #__PURE__ */ls("$message.value"))),type:"input",props:[],features:[function(e){function t(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}e.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==e.props.hoverHighlight&&"false"!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.deselect=s(e.props.deselect),e.props.max=Number(e.props.max)||5,e.props.min=Number(e.props.min)||0,e.props.step=Number(e.props.step)||1,e.props.numberOfSteps=e.props.max/e.props.step,e.props.lastIndex=1/e.props.step-1,e.props.itemsToPercentages={},"disabled"in e.props&&(e.props.disabled=s(e.props.disabled)),e.props.rightToLeft?(e.props.onItemStyles=void 0,e.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):e.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},e.props.stepsPerValue=1/e.props.step,e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))
|
|
24
|
+
return o(t);const n=Number(t),s=Number(e.props.min),r=Number(e.props.max);return n>r?/* #__PURE__ */o(r):e.props.min&&n<=s?/* #__PURE__ */o(s):/* #__PURE__ */o(n)})),e.on("commit",(({payload:t})=>{const o=Number(t||0);Pn(e,o)})),e.on("created",(()=>{e.context&&(r(`${e.props.id}_items_wrapper`,(()=>{t(e),function(e){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{t(e)})).observe(n)}(e),setTimeout((()=>t(e)),100)}),e.props.__root),e.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],e.context.fns.getValue=(t,o)=>t+Number((o*e.props.step+e.props.step).toFixed(1)),e.context.fns.showLabel=(t,o)=>{const n=Number(e.value||0);return 0===n&&0===o||n&&t===n||t>n&&0===o||n>t&&o===e.props.lastIndex},e.context.handlers.handleFocus=t=>Yn.call(null,e,t),e.context.handlers.handleWrapperKeydown=t=>Un.call(null,e,t),e.context.handlers.handleWrapperBlur=t=>Hn.call(null,e,t),e.context.handlers.handleItemClick=t=>o=>zn.call(null,e,t,o),e.context.handlers.handleMousemove=t=>o=>jn.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>Zn.call(null,e),e.context.handlers.handleDragstart=t=>o=>Wn.call(null,e,t,o),e.context.handlers.handleMouseup=t=>Nn.call(null,e,t),e.context.handlers.handleTouchstart=t=>o=>Kn.call(null,e,t,o),e.context.handlers.handleTouchmove=t=>Rn.call(null,e,t),e.context.handlers.handleKeydown=t=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(e,t,o))}))},/* #__PURE__ */m("rating","star")]},ys=/* #__PURE__ */Me("ac"),{outer:xs,wrapper:ws,inner:_s,icon:ks,label:Ss,prefix:Ls,suffix:As,help:Cs,messages:Ds,message:Is}=/* #__PURE__ */Ve(ys),Ts=/* #__PURE__ */ys("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 || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || 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"}}))),Os=/* #__PURE__ */ys("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),Es=/* #__PURE__ */ys("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 1',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Ms=/* #__PURE__ */ys("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Vs=/* #__PURE__ */ys("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Fs=/* #__PURE__ */ys("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),Bs=/* #__PURE__ */ys("optionLoading","span"),Ps=/* #__PURE__ */ys("option",(()=>({$el:"div",if:"$value !== undefined"}))),Hs=He(ys);function Rs(e){"option"!==e.props.selectionAppearance||e.props.multiple||!1===e.props.selectionRemovable||"false"===e.props.selectionRemovable||(e.props.selectionRemovable=!0),e.props.multiple||(e.props.clearSearchOnOpen=s(e.props.clearSearchOnOpen)),e.props.selectionRemovable=s(e.props.selectionRemovable),e.props.openOnClick=s(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=s(e.props.allowNewValues)}function Ks(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=xt.bind(null,e),e.props.reloadOnCommit=s(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=s(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&oe&&(e.context.handlers.focus=Us.bind(null,e),e.context.handlers.input=Ns.bind(null,e),e.context.handlers.focus=Us.bind(null,e),e.context.handlers.click=Ws.bind(null,e),e.context.handlers.toggleListbox=Ys.bind(null,e),e.context.handlers.toggleListboxKeydown=js.bind(null,e),e.context.handlers.keydown=vo.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>uo(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":ro(e);break;case"ArrowRight":case"ArrowLeft":ao(e,t,o);break;case"Delete":case"Backspace":lo(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],s=t.find((e=>gt(e)===n.value));s&&(e.props.selections[o]=s)}})))})),e.on("prop:expanded",(({payload:t})=>{t||bt.delete(e)}))}function Ns(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&xt(e,e.props.searchValue,!0)}function Ws(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function Us(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function Ys(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function js(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),Ys(e))}const Zs=new WeakMap,zs="undefined"!=typeof window,Gs=new WeakMap;let qs=!1;function Xs(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Js(e)})),e.on("created",(()=>{if(!e.context||!zs)return;e.on("handleSearchInput",(({payload:t})=>{""===t?(e.props.searchValue=null,e.input([])):t&&0===e.props.inputStd.length?e.props.searchValue=t:t&&e.props.inputStd.length>0&&(e.props.searchValue=function(e){var t;const o=er(e);if(e.props.highlightedRange){const[t,n]=Qs(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(e)),!e.props.expanded&&t?e.props.expanded=!0:!t&&e.props.expanded&&(e.props.expanded=!1)})),function(e){r(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Gs.set(t,e)}),e.props.__root),zs&&!qs&&(qs=!0,document.addEventListener("selectionchange",(()=>{const e=mt();if(e instanceof HTMLInputElement&&Gs.has(e)){const t=Gs.get(e);t&&function(e){clearTimeout(Zs.get(e)),Zs.set(e,setTimeout((()=>{var t,o,n,s;const r=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(r instanceof HTMLInputElement){const t=er(e),a=t.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===(o=t[t.length-1])||void 0===o?void 0:o.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(t.length){const o=e.props.highlightedRange,[n,s]=Qs(e,t);if(null!==r.selectionEnd&&(r.selectionEnd<n||r.selectionEnd>s)){const t=o.end-o.start-(s-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?t:0)}}}else if(a>=0&&null!==r.selectionStart&&(l!==(null===(s=e.props.inputText)||void 0===s?void 0:s.length)||r.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),s=o.start+(o.index>0?1:0),i=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,r.value=n),e.props.highlightedRange=o,r.selectionStart=s,r.selectionEnd=i}else e.props.highlightedRange=void 0,Js(e);if(null!==r.selectionStart&&r.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(e);const o=e.context.handlers.keydown;e.context.handlers.keydown=n=>{o(n),function(e,o){var n,s,r,a;if(["ArrowRight","ArrowLeft"].includes(o.key)&&o.target instanceof HTMLInputElement&&null!==o.target.selectionEnd&&null!==o.target.selectionStart){if(0===o.target.selectionStart&&o.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===o.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=er(e),n=null===(s=t[t.length-1])||void 0===s?void 0:s.end;o.target.selectionStart<n&&(o.target.selectionStart=Math.max(0,"ArrowLeft"===o.key?o.target.selectionStart-2:o.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(o.key))e.props.highlightedRange&&!e.props.searchValue?(e.props.highlightedRange.option,0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault());else if(o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(r=e.props.inputText)||void 0===r?void 0:r.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)o.preventDefault();else if("Tab"===o.key)return;"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault()}(e,n)};const n=e.context.handlers.focus;e.context.handlers.focus=t=>{n(e,t);const o=new Event("selectionchange");document.dispatchEvent(o)},e.on("blur",(()=>{e.props.selections.length?(e.props.inputText=e.props.selections.map((e=>e.label)).join(", "),e.props.searchValue=null):e.props.selections.length||(e.props.inputText="",e.props.searchValue="")}))})),e.on("prop:expanded",(({payload:t})=>{t||e.props.inputStd.length?t&&(e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],xt(e,e.props.searchValue))):(e.props.searchValue="",e.props.inputText="")})),e.on("prop:selections",(()=>{var t;const o=[...e.props.selections].map((e=>e.label)).join(", ");let n="";if(zs&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),mt()===o&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}e.props.inputText=`${o}${n}`,e.props.reloadOnCommit&&(e.props.searchValue="",xt(e,e.props.searchValue))}));const t=(t,o=!1)=>{var n,s;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(!(r instanceof HTMLInputElement))return!1;const a=er(e),l=t>=0?t:a.length-1;if(void 0===a[l])return!1;const i=null===(s=a[l])||void 0===s?void 0:s.end;return null!==r.selectionStart&&(!o||r.selectionStart>=i&&r.selectionStart<=i+2)&&(r.selectionStart=a[l].start+(l>0?1:0),r.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&o!==t.option&&(o=t.option,Et(e))}))}function Js(e){var t;if(!zs)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function Qs(e,t){var o;const n=e.props.highlightedRange,s=n.index,r=n.start+(s?1:0),a=t.length-1>s?t[t.length-1].end-t[s+1].start:0;return[r,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function er(e){const t=Tt(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var s;const r=(null===(s=e[n-1])||void 0===s?void 0:s.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:r,end:r+o.label.length+a}),e}),[]):[]}function tr(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],xt(e,e.props.searchValue,!0))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&xt(e,e.props.searchValue,!0))}))}(e)}function or(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand&&(e.props.inputText="",e.props.searchValue=""),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||e.props.searchExpand||(e.props.options=[],xt(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&xt(e,e.props.searchValue,!0)}))}(e)}function nr(e){if(e.props.multiple)if(e.props.multiple&&"option"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}tr(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),r(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement&&e.context){const s={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,root:e.props.__root,disabled:!e.props.draggable,plugins:[x()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};w({parent:n,getValues:t,setValues:o,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,w({parent:n,getValues:t,setValues:o,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,w({parent:n,getValues:t,setValues:o,config:s})}))}}),e.props.__root)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&Xs(e);else or(e)}const sr={schema:/* #__PURE__ */xs(/* #__PURE__ */ws(/* #__PURE__ */Ss("$label"),/* #__PURE__ */_s(/* #__PURE__ */ks("prefix"),/* #__PURE__ */Ls(),/* #__PURE__ */Ts(),/* #__PURE__ */Be("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */Vs(/* #__PURE__ */Es(/* #__PURE__ */Ms(/* #__PURE__ */Ps(/* #__PURE__ */Be("$state.loading",/* #__PURE__ */Bs("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Be("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */ks("loader")),/* #__PURE__ */Be("$selectionRemovable && $isSingleOption",/* #__PURE__ */Fs(/* #__PURE__ */ks("close")))))),/* #__PURE__ */Be("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */ks("loader")),/* #__PURE__ */Be('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Fs(/* #__PURE__ */ks("close")),/* #__PURE__ */Be('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Os(/* #__PURE__ */ks("select")))),/* #__PURE__ */Be("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Os(/* #__PURE__ */ks("select"))),/* #__PURE__ */Hs(),/* #__PURE__ */As(),/* #__PURE__ */ks("suffix")),/* #__PURE__ */Be("$multiple && $selectionAppearance === option",/* #__PURE__ */Vs(/* #__PURE__ */Es(/* #__PURE__ */Ms(/* #__PURE__ */Ps(/* #__PURE__ */Be("$state.loading && $isLoadingOption",/* #__PURE__ */Bs("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Fs(/* #__PURE__ */ks("close")))))),/* #__PURE__ */Cs("$help"),/* #__PURE__ */Ds(/* #__PURE__ */Is("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
25
|
+
/* #__PURE__ */m("select","select"),
|
|
26
|
+
/* #__PURE__ */m("close","close"),
|
|
27
|
+
/* #__PURE__ */m("selected","check"),
|
|
28
|
+
/* #__PURE__ */m("loader","spinner"),
|
|
29
|
+
/* #__PURE__ */g("isLoading"),
|
|
30
|
+
/* #__PURE__ */g("loadMore"),
|
|
31
|
+
/* #__PURE__ */g("remove"),
|
|
32
|
+
/* #__PURE__ */g("open"),
|
|
33
|
+
/* #__PURE__ */g("close"),b,
|
|
34
|
+
/* #__PURE__ */eo.bind(null,Rs,Ks,nr),Bo]},rr=/* #__PURE__ */Me("dp"),{outer:ar,wrapper:lr,inner:ir,icon:pr,label:dr,prefix:cr,suffix:ur,help:fr,messages:vr,message:hr}=/* #__PURE__ */Ve(rr),$r=/* #__PURE__ */rr("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}}))),mr=/* #__PURE__ */rr("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}}))),gr=/* #__PURE__ */rr("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),br=/* #__PURE__ */rr("nextLabel","span"),yr=/* #__PURE__ */rr("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),xr=/* #__PURE__ */rr("prevLabel","span"),wr=/* #__PURE__ */rr("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),_r=/* #__PURE__ */rr("calendarWeeks",(()=>({$el:"tbody"}))),kr=/* #__PURE__ */rr("calendarHeader",(()=>({$el:"thead"}))),Sr=/* #__PURE__ */rr("weekDays",(()=>({$el:"tr"}))),Lr=/* #__PURE__ */rr("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Ar=/* #__PURE__ */rr("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Cr=/* #__PURE__ */rr("dayCell",(()=>({$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",onBlur:"$handlers._blurOut(day)",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")'}}))),Dr=/* #__PURE__ */rr("day","div"),Ir=/* #__PURE__ */rr("openButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Tr=/* #__PURE__ */rr("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Or=/* #__PURE__ */rr("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",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$fns.isSelected($year)","data-disabled":"$fns.isDisabledYear($year)"}}))),Er=/* #__PURE__ */rr("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Mr=/* #__PURE__ */rr("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",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$fns.isSelected($month)","data-disabled":"$fns.isDisabledMonth($month)"}}))),Vr=/* #__PURE__ */rr("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Fr=/* #__PURE__ */rr("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Br=/* #__PURE__ */rr("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Pr=/* #__PURE__ */rr("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),Hr=/* #__PURE__ */rr("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Rr=/* #__PURE__ */rr("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Kr=/* #__PURE__ */rr("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Nr=/* #__PURE__ */rr("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Wr=/* #__PURE__ */rr("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),Ur=/* #__PURE__ */rr("time",(()=>({$el:"div",if:'$panel === "time"'}))),Yr=/* #__PURE__ */rr("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),jr=/* #__PURE__ */rr("panelClose",(()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}}))),{overlayPlaceholder:Zr,overlayLiteral:zr,overlayChar:Gr,overlayEnum:qr,overlay:Xr,overlayParts:Jr,overlayInner:Qr}=/* #__PURE__ */Fe(rr),ea=/* #__PURE__ */rr("panel","div"),ta=/* #__PURE__ */new WeakMap,oa=/* #__PURE__ */new WeakMap,na=new WeakSet,sa=/* #__PURE__ */new WeakMap,ra=/* #__PURE__ */new WeakMap,aa=new WeakSet,la=/* #__PURE__ */new WeakMap,ia=/[\uD800-\uDBFF]/,pa=/* #__PURE__ */new WeakMap,da=/* #__PURE__ */new WeakMap,ca=/* #__PURE__ */new WeakMap,ua=/* #__PURE__ */new WeakMap,fa=/* #__PURE__ */new WeakMap,va=new WeakSet,ha=/* #__PURE__ */new WeakMap,$a=/* #__PURE__ */new WeakMap,ma=/* #__PURE__ */new WeakMap,ga=/* #__PURE__ */new WeakMap;let ba=!1;const ya=()=>{ba=!0,setTimeout((()=>{ba=!1}),500)},xa={"#":{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"}},wa=/* #__PURE__ */new WeakMap,_a="undefined"!=typeof window;let ka=!1,Sa=!1;function La(){_a&&!Sa&&(Sa=!0,document.addEventListener("selectionchange",(()=>{const e=mt();if(!(e instanceof HTMLInputElement))return;if(ga.has(e))return function(e){const t=ga.get(e);if(t){const[o,n]=t,[s,r]=pl(e),a=r.indexOf(o);if(-1===a)return void ga.delete(e);const l=s[a],i=[l[0]+n[0],l[1],"none"];Pa(/* #__PURE__ */Ha(e),i)||Ya(e,i)}}(e);if("select"!==la.get(e))return;const t=/* #__PURE__ */Ha(e);if(!Pa(t,wa.get(e))){if(wa.set(e,t),na.has(e))return na.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:/* #__PURE__ */Ha(e)}))}})))}function Aa(e,t){var o;if(La(),ta.has(e))return;ta.set(e,[]),t.reverse&&va.add(e),t.prefix&&ha.set(e,t.prefix),t.suffix&&$a.set(e,t.suffix),Oa(e,t.pattern,t.partOverrides,t.explicitParts);const n=ra.get(e),s=null==n?void 0:n.some((e=>Va(e))),r=null==n?void 0:n.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(s&&r)throw new Error("Cannot use enums and groups in the same mask.");const a=s?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(r&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&aa.add(e),la.set(e,a),t.onChange&&ua.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(ka)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const s=ta.get(e);if(null==s?void 0:s.length){const o=(null!==(n=oa.get(e))&&void 0!==n?n:s.length-1)+(t.endsWith("Undo")?-1:1),r=s[o];if(!r)return;e.setSelectionRange(...r.selectionAfter),oa.set(e,o),ua.has(e)&&ua.get(e)(r,e)}}),{once:!0})}(e,o.inputType);o.preventDefault();const n=(s=o.inputType).startsWith("insert")?"insert":!!s.startsWith("delete")&&("deleteContentForward"===s?"deleteContentForward":"deleteContentBackward");var s;const r=/* #__PURE__ */Ha(e),a=e.value;n&&Ra(e,{type:n,selectionBefore:r,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),vl(e);case"ArrowLeft":return t.preventDefault(),vl(e,-1);case"ArrowUp":return void(hl(e,1)&&t.preventDefault());case"ArrowDown":return void(hl(e,-1)&&t.preventDefault());case"Tab":return ba?void t.preventDefault():void(vl(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=aa.has(e),n=la.get(e);if(o){let o=null,s=null,r=!1;const a="shift"===n?0:1,l=e.value;tl(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(Ma(t)||Va(t))&&e.value.endsWith(t.placeholder)?(s=e.pos-a,!1):("char"===t.type&&(r=!0),!0))));const i=null!==(t=null!=s?s:r?l.length:o)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===la.get(e)){const[o]=pl(e),n=ml(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){pa.set(e,Na(e,t));const n=async()=>{if(!_a||mt()!==e)return;"select"===la.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=/* #__PURE__ */Ha(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Wa(e,t);const[o]=pl(e),n=ml(e,t),s=t[0];void 0!==n&&o.some((e=>s>=e[0]&&s<e[1]))&&pa.set(e,Na(e,o[n]))}(e));const t=pa.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),pa.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(pa.get(e))return;wl(e),t=Wa(e,t);const[o]=pl(e),n=ml(e,t),s=void 0!==n&&Na(e,o[n]);s&&!Pa(t,s)&&Ya(e,s,!0)}(e,t.detail))),Ra(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ca(e){var t,o;if(ga.has(e))return;const n=null!==(t=ta.get(e))&&void 0!==t?t:[],s=n[null!==(o=oa.get(e))&&void 0!==o?o:n.length-1];if(s){const t=s.selectionAfter,[o,n]=pl(e,s.valueAfter),r=ml(e,t,[o,n]);if(void 0!==r&&r in o){const s=n[r],a=o[r],l=[t[0]-a[0],t[1]-a[0],"none"];ga.set(e,[s,l])}}}function Da(e){ga.delete(e)}function Ia(e,t){const o="string"==typeof e||!ta.has(e),n="string"==typeof e?Ta(e):e;if(o)t.prefix&&ha.set(n,t.prefix),t.suffix&&$a.set(n,t.suffix),n.value=Ka(n,n.value),Aa(n,t);else{const e=gl(n),o=n.value;n.value="",Ra(n,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return n.value}function Ta(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Oa(e,t,o,n,s){s=e&&va.has(e)||s;const r=(null!=n?n:function(e){const t=Object.values(xa);if(!e)return t;const o={...e},n=[];for(const s of t)if(!Ba(s))if("token"in s&&s.token in e){const t={...s,...e[s.token]};Ea(t)&&n.push(t),delete o[s.token]}else n.push(s);const s=Object.values(o);for(const e of s)Ea(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let s,r=0,a="",l="",i="";const p=[];for(;a=ja(e);)a===t&&s!==n?(r++,r>1&&(i+=a)):a===o&&r&&s!==n?(r--,0===r?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):r?i+=a:s!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,s=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=r.reduce(((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const i=function(e,t,o){return e.reduce(((e,n)=>{const[s,r]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=Oa(null,s,void 0,t,o);a=a.map((e=>{const t={...e};if("char"===t.type&&r.placeholder)t.placeholder=r.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t}));const l={type:"group",parts:a,...r};return e.push(l),e}),[])}(a,r,s).concat(r),p=/\{\$\d+\}/g,d=t.match(p),c=t.split(p).reduce(((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:s?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&i[n]&&e.push(i[n])}return e}),[]);return s&&c.reverse(),e&&ra.set(e,c),c}function Ea(e){return!!e&&(Ba(e)||Ma(e)||Va(e))}function Ma(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Fa(e))}function Va(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Fa(e))}function Fa(e){return!!e&&("placeholder"in e&&"token"in e)}function Ba(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function Pa(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function Ha(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function Ra(e,t){var o;va.has(e)&&xl(t);let n=!1;switch(fa.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Ua(t);const n=t.selectionBefore,s=function(e,t){var o,n,s;if("select"===la.get(e)){const[r,a]=pl(e),l=r.findIndex((e=>Pa(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(Ma(i)){const e=t.selectionBefore,o=e[1]-e[0],r=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=Qa(r,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ja(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(s=i.selectFill)&&void 0!==s?s:i.placeholder).repeat(o-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(Va(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${s}${o.substring(n[1])}`;const r=tl(e,t,o);return sa.set(e,r.endPos),{...t,valueAfter:r.value,selectionAfter:el(e,r),unmasked:r.unmasked,complete:r.complete,meta:r.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Ua(t),n=t.selectionBefore,s=va.has(e);let r=n[0],a=n[1];r===a&&("deleteContentBackward"!==t.type||s?a+=Za(o,r):r-=Za(o,r,"backward"));const l=la.get(e);let i="";if("select"===l){const[o,n]=pl(e),s=ml(e,[r,a,"none"]);if(void 0!==s){const l=n[s],p=o[s];Ma(l)?i=l.placeholder.repeat(a-r):Va(l)&&([i,r]=Pa(p,/* #__PURE__ */Ha(e))?[l.placeholder,r]:function(e,t,o,n){const s=n.valueBefore,r=Za(s,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-r),l=s.substring(o[0],a),i=cl(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&ul(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,r)}${i}${o.substring(a)}`,d=tl(e,t,p);return{...t,valueAfter:d.value,selectionAfter:al(e,d,t,r),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(va.has(e)&&n&&xl(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=Na(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){ua.has(e)&&ma.set(e,(()=>{ma.delete(e),n&&ua.get(e)(n,e)})),fa.set(e,"beforeCallback");let t=null!==(o=ta.get(e))&&void 0!==o?o:[];const s=oa.get(e);s&&(t=t.slice(0,s),oa.delete(e)),t.push(n),ta.set(e,t),_a&&mt()===e&&"function"==typeof document.execCommand&&!ka&&(Ya(e,[0,e.value.length,"forward"],!0),ka=!0,document.execCommand("insertText",void 0,n.valueAfter),ka=!1),_a&&mt()===e&&Ya(e,n.selectionAfter);const r=ma.get(e);r&&r(),wl(e)}fa.set(e,"complete")}function Ka(e,t){var o,n;const s=null!==(o=ha.get(e))&&void 0!==o?o:"",r=null!==(n=$a.get(e))&&void 0!==n?n:"";return s&&t.startsWith(s)&&(t=t.substring(s.length)),r&&t.endsWith(r)&&(t=t.substring(0,t.length-r.length)),t}function Na(e,t){const o=ha.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function Wa(e,t){const o=ha.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Ua(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function Ya(e,t,o=!1){o&&(na.add(e),setTimeout((()=>na.delete(e)),5)),pa.get(e)&&pa.set(e,t),e.setSelectionRange(...t)}function ja(e){if(null==e)return"";const t=ia.test(e.charAt(0))&&ia.test(e.charAt(1))?2:1;return e.substring(0,t)}function Za(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:ia.test(e.charAt(t))&&ia.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ja(e.substring(t)).length}function za(e,t){const o=ja(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function Ga(e){const t=ja(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function qa(e,t){const o=ja(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function Xa(e,t){for(;t.buffer;){const o=ja(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function Ja(e,t){const o=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(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(Za(t.buffer,0))}return null}function Qa(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${s=t.selectFill,s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var s;return o}function el(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=/* #__PURE__ */Ha(e);o=[n[0],t.endPos,"none"];const[s,r]=pl(e,t.value),a=ml(e,o,[s,r]);if(void 0===a)return o;if(!(a in s)||!(a in r))return o;const l=s[a],i=r[a],p=t.value.slice(l[0],l[1]);if(Ma(i)&&Qa(p,i).length===p.length&&a<s.length-1)return ya(),s[a+1];if(Va(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",s=`${n}${e.originalData}`,r=cl(o.values,s);if(r)return il(s,r).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return ul(i.values,p)?[l[1],l[1],"forward"]:(ya(),s[a+1]?s[a+1]:s[a]);const r=[t.insertPos+o,l[1],"none"];return Pa(r,n)||(na.add(e),setTimeout((()=>na.delete(e)),5)),r}return l}function tl(e,t,o,n){var s,r;const a=null!==(s=ra.get(e))&&void 0!==s?s:[],l={pos:0,insertPos:null!==(r=t.insertPos)&&void 0!==r?r:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:aa.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:la.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:pl(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return ol(a,l,void 0,n),l}function ol(e,t,o,n){var s,r;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(s=o.nextPart)||void 0===s?void 0:s.type)?o.nextPart.value:null;let i=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const s=e[i+1];switch(o.type){case"literal":sl(o,t,e.at(-1)===o);break;case"char":rl(o,t,l);break;case"enum":nl(o,t);break;case"group":const a={repeat:null!==(r=o.repeat)&&void 0!==r&&r,nextPart:s,repeats:0,placeholder:!!o.placeholder};ol(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=Ba(s)&&i+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;i++}if(t.chars<p&&(t.complete=!1),o){const s=t.chars-d,r=s===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(o.repeat&&c&&r)return o.repeats++,ol(e,t,o,n);if(!r){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),Ba(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&s<p&&0!==s&&t.insertPos<=t.pos?t.data="":o.repeat&&!r&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function nl(e,t){const[o,n]=t.rangeParts,s=o[n.indexOf(e)];if(s&&(t.insertPos<=t.pos||t.insertPos>=s[0]&&t.insertPos<=s[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,s=cl(e.values.concat([e.placeholder]),n);if(s){const r=il(n,s);return t.data=t.data.substring(r.length),t.value+=s,s!==e.placeholder?t.unmasked+=s:t.complete=!1,t.meta.push({type:s!==e.placeholder?"enum":"placeholder",value:s}),o?t.buffer=t.buffer.substring(o.length):Ja(e,t),t.endPos=t.pos+r.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=Ja(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),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 sl(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let s=!1;for(;n;){const e=t.insertPos<=t.pos?ja(t.data):"",r=ja(n);if(e===r)n=za(t,n),t.meta.push({type:"literal",value:r}),s=!0;else if(!s||t.data||null===t.data||t.placeholder||o)n=qa(t,n),t.meta.push({type:"literal",value:r});else if(s&&!t.data)break;t.buffer.startsWith(r)&&(t.buffer=t.buffer.substring(r.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 rl(e,t,o){var n;let s=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=ja(t.data);if(e.pattern.test(n))return za(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void Xa(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){s=!1;break}t.data=t.data.substring(n.length)}}for(;s&&t.buffer;){const n=ja(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,Ga(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return Ga(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function al(e,t,o,n){const s=[n,n,"none"];if("select"===t.mode){const r=pl(e),a=ml(e,s,r),[l,i]=pl(e,t.value),p=void 0!==a&&ll(o.valueBefore,r[0][a],r[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every(((e,o)=>ll(t.value,e,i[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return s}function ll(e,t,o){if(Ba(o))return!1;if(Ma(o)){let n=t[0];for(;n<t[1];){const t=ja(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Va(o)||e.substring(t[0],t[1])===o.placeholder}function il(e,t){let o="";do{const n=ja(e).toLowerCase(),s=ja(t).toLowerCase();if(n!==s)break;o+=n,e=e.substring(n.length),t=t.substring(s.length)}while(e.length&&t.length);return o}function pl(e,t){const o=ra.get(e);if(!o)return[[],[]];if(da.has(e))return da.get(e);const n=null!=t?t:Ka(e,e.value),s=[],r=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(Ba(e))a=e,null!==l&&(s.push([l,i,"none"]),l=null),i+=e.value.length;else{if(Ma(a)&&Ma(e)&&e.token===a.token)i++;else if(Ma(e))null===l?(l=i,r.push(e)):(s.push([l,i,"none"]),l=i,r.push(e)),i++;else if(Va(e)){l&&s.push([l,i,"none"]),fl(e)||(p=!1);const t=dl(n,e,i);l=null,s.push([i,i+t,"none"]),r.push(e),i+=t}a=e}null!==l&&s.push([l,i,"none"]);const d=[[...s],[...r]];return p&&!t&&da.set(e,d),d}function dl(e,t,o){if(fl(t))return t.values[0].length;const n=e.slice(o),s=cl(t.values.concat([t.placeholder]),n);return s?s.length:0}function cl(e,t,o=null,n){var s;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const r=ja(t.toLowerCase()),a=`${null!=n?n:""}${r}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),i=l.find((e=>e.toLowerCase()===a));return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(s=cl(l,t.substring(r.length),o,a))&&void 0!==s?s:l[0])}function ul(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function fl(e){if(!ca.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;ca.set(e,e.values.every((e=>e.length===t)))}return ca.get(e)}function vl(e,t=1){const[o]=pl(e),n=ml(e,Wa(e,/* #__PURE__ */Ha(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...Na(e,o[n+t])),!0)}function hl(e,t=1){const[o,n]=pl(e),s=ml(e,/* #__PURE__ */Ha(e));if(void 0!==s&&s in n){const r=n[s];if(Va(r)){const n=o[s],a=e.value.slice(n[0],n[1]);let l=null,i=r.values.indexOf(a);const p=r.values.length-1;if(-1!==i){const e=i+t;i=e<0?p:e>p?0:e,l=r.values[i]}else a===r.placeholder&&(l=t>0?r.values[0]:r.values[p]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout((()=>Ra(e,t)),0),!0}}}return!1}function $l(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),s=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return $l(e.slice(...s),t)}function ml(e,t,o){const[n]=null!=o?o:pl(e),s=n.findIndex((e=>e[0]!==e[1]&&(!!Pa(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==s)return s;const[r,a]=n.reduce(((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e)),[new Set,{}]),l=$l([...r],t[1]);return l in a?a[l]:void 0}function gl(e){var t,o;const n=null!==(t=ta.get(e))&&void 0!==t?t:[];return n[null!==(o=oa.get(e))&&void 0!==o?o:n.length-1]}function bl(e,t=!1){const o=gl(e);return o&&(o.complete||t)?va.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function yl(e){var t;const o=gl(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function xl(e){const t=e=>[...e].reverse().join(""),o=(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=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function wl(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}const _l="undefined"!=typeof window,kl=new WeakSet,Sl=new WeakSet,Ll=new WeakSet,Al=new WeakMap,Cl=new WeakMap,Dl=new WeakSet,Il=new WeakSet;function Tl(e){return"timeZoneName"!==e.partName}function Ol(e){e.props.calendar=he(e.props.showMonths,(e=>e)).map((t=>function(e,t){const o=[],n=W(t);n.setDate(1);let s=Z(n,e.props.weekStart);s.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const r=z(N(t),e.props.weekStart);let a=[];do{a.push(s),7===a.length&&(o.push(a),a=[]),s=B(s)}while(s.getTime()<=r.getTime());return{monthDay:n,weeks:o}}(e,P(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(D(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,he(10,(n=>H(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=W(e.props.renderedDate);return t.setMonth(0),he(12,(e=>P(t,e)))}(e)}function El(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function Ml(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:O(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,Tl),o}function Vl(e){return Array.isArray(e.props.sequence)?a(e.props.sequence):["day"]}function Fl(e,t,o=!0){var n,s;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?C(t,e.props.timezone):"+0000";const r=Y(t,null!==(n=(s=e.props).offset)&&void 0!==n?n:s.offset="+0000");e.input(D(r,e.props.valueFormat,e.props.valueLocale,!1),o)}function Bl(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);s instanceof HTMLElement&&(t.preventDefault(),s.focus())}function Pl(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Al.set(e,t),null===(o=e.props.__root)||void 0===o||o.addEventListener("click",(t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_popover`)?Il.add(e):Il.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===fa.get(t)&&(n=t.value),Ca(t),t.selectionStart=0,t.selectionEnd=t.value.length,t.value=e,setTimeout((()=>Da(t)),10))}));const[s,r]=Rl(e);Aa(t,{pattern:s,explicitParts:r,onChange:({valueAfter:o})=>{if(Hl(e),kl.has(e))return kl.delete(e);n&&n===o?n="":(Ca(t),e.props.inputText=o,setTimeout((()=>Da(t)),10))}})}function Hl(e){var t,o;if(e.props.overlay){const n=Al.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||bl(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=$t(yl(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function Rl(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,n=V(e.props.format,t);return[U(e.props.format,t,!0,Tl),n.reduce(((n,s)=>{if("literal"===s.partName)return n;let r=M(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();r=he(e.props.maxDate.getFullYear()-t+1,(e=>String(t+e)))}const a={type:"enum",token:s.token,values:r,placeholder:"A"===s.token?"A/P":s.token,selectDirection:"left"};return n.push(a),s.token.startsWith("D")&&Cl.set(e,r),n}),[])]}function Kl(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Nl(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}const Wl="undefined"!=typeof window,Ul=new WeakMap;function Yl(e,t){var o,n;if(t instanceof HTMLInputElement&&!Ul.get(e)&&Wl){const s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(s&&t&&r){Ul.set(e,s);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),s=t.getBoundingClientRect(),r=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();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,top:s.top-((null==r?void 0:r.top)||s.top)+"px",left:s.left-((null==r?void 0:r.left)||s.left)+"px"}}));n.observe(t);const a=e=>{r.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function jl(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=s(e.props.overlay),e.props.pickerOnly=s(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&r(`${e.props.id}`,Yl.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}const Zl={schema:/* #__PURE__ */ar(/* #__PURE__ */lr(/* #__PURE__ */dr("$label"),/* #__PURE__ */ir(/* #__PURE__ */pr("prefix"),/* #__PURE__ */cr(),/* #__PURE__ */Xr(/* #__PURE__ */Qr(/* #__PURE__ */Jr(/* #__PURE__ */Zr("$part.value"),/* #__PURE__ */zr("$part.value"),/* #__PURE__ */Gr("$part.value"),/* #__PURE__ */qr("$part.value")))),/* #__PURE__ */$r(),/* #__PURE__ */mr(/* #__PURE__ */Vr(/* #__PURE__ */yr(/* #__PURE__ */xr("$ui.prev.value"),/* #__PURE__ */pr("prev")),/* #__PURE__ */Fr("$decade"),/* #__PURE__ */Br(/* #__PURE__ */Rr()),/* #__PURE__ */Pr(/* #__PURE__ */Kr(),/* #__PURE__ */Rr()),/* #__PURE__ */Hr(/* #__PURE__ */Kr(),/* #__PURE__ */Nr(),/* #__PURE__ */Rr()),/* #__PURE__ */gr(/* #__PURE__ */br("$ui.next.value"),/* #__PURE__ */pr("next")),/* #__PURE__ */jr(/* #__PURE__ */pr("close"))),/* #__PURE__ */ea(/* #__PURE__ */Tr(/* #__PURE__ */Or("$fns.format($year, $yearFormat)")),/* #__PURE__ */Er(/* #__PURE__ */Mr("$fns.format($month, $monthFormat)")),/* #__PURE__ */wr(/* #__PURE__ */kr(/* #__PURE__ */Sr(/* #__PURE__ */Lr("$fns.format($day, $weekdayFormat)"))),/* #__PURE__ */_r(/* #__PURE__ */Ar(/* #__PURE__ */Cr(/* #__PURE__ */Dr("$fns.format($day, $dateFormat)"))))),/* #__PURE__ */Ur(/* #__PURE__ */Yr()))),/* #__PURE__ */Wr(/* #__PURE__ */pr("clear")),/* #__PURE__ */Ir(/* #__PURE__ */pr("calendar")),/* #__PURE__ */ur(),/* #__PURE__ */pr("suffix"))),/* #__PURE__ */fr("$help"),/* #__PURE__ */vr(/* #__PURE__ */hr("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[jl,function(e){var t,o,n,a,l,i,d,c,u,f,v,h,$,m,g,b,y,x,w,_,k,S;e.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","showPanelClose"]),e.hook.prop(((t,o)=>("expanded"===t.prop&&e.props.disabled&&(t.value=!1),"weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"maxScan"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=C(e._value,t.value)),/* #__PURE__ */o(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(h=e.props).valueFormat)&&void 0!==t||(h.valueFormat="ISO8601"),null!==(o=($=e.props).weekdayFormat)&&void 0!==o||($.weekdayFormat="d"),null!==(n=(m=e.props).monthFormat)&&void 0!==n||(m.monthFormat="MMM"),null!==(a=(g=e.props).monthButtonFormat)&&void 0!==a||(g.monthButtonFormat="MMMM"),null!==(l=(b=e.props).dayButtonFormat)&&void 0!==l||(b.dayButtonFormat="D"),null!==(i=(y=e.props).dateFormat)&&void 0!==i||(y.dateFormat="D"),null!==(d=(x=e.props).yearFormat)&&void 0!==d||(x.yearFormat="YYYY"),null!==(c=(w=e.props).paginatedPanels)&&void 0!==c||(w.paginatedPanels=["day","year"]),null!==(u=(_=e.props).valueLocale)&&void 0!==u||(_.valueLocale=e.props.locale),null!==(f=(k=e.props).format)&&void 0!==f||(k.format="long"),e.props.panels=Vl(e),e.props.pickerOnly=s(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=s(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=s(e.props.clearable)),null!==(v=(S=e.props).maxScan)&&void 0!==v||(S.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):Kl.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=W(t);else if("string"==typeof t)try{const n=O(t,e.props.valueFormat,e.props.valueLocale);o=W(n)}catch{console.warn(`Date (${t}) does not match format (${U(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?C(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?O(e.props.minDate):e.props.minDate;e.props.minDate=T(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?O(e.props.maxDate):e.props.maxDate;e.props.maxDate=T(t,e.props.offset)}o=o&&T(o,e.props.offset),o&&Fl(e,o,!1);let n=o||new Date;n=e.props.minDate>n?e.props.minDate:n,e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&D(o,"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=D,e.on("created",(()=>{if(r(`${e.props.id}`,Pl.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>D(t,o,e.props.locale||"en",!1,Tl),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!I(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!I(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;const s=T(n instanceof Date?n:O(n,e.props.valueFormat,e.props.valueLocale),e.props.offset);return E(t,s)},e.context.handlers._blur=t=>{var o,n;e.props._isFocused=!1,"function"==typeof(null===(o=e.context)||void 0===o?void 0:o.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur(t))},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers._blurOut=t=>o=>{var n;o.preventDefault(),t&&t!==e.props.panel||e.props.pickerOnly&&o.relatedTarget instanceof Element&&(o.relatedTarget===document.getElementById(`${e.props.id}_inner`)||o.relatedTarget.closest(`#${e.props.id}_inner`))||o.relatedTarget&&o.relatedTarget instanceof Element&&(o.relatedTarget.closest(`#${e.props.id}_popover`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_popover`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=Al.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!Sl.has(e)&&(Ll.add(e),e.props.expanded=!0,setTimeout((()=>Ll.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;Fl(e,void 0,!0),Ml(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(Dl.has(e))return Dl.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=O({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:Tl});if(function(e){return V(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!ga.get(t.target)&&D(n,e.props.format,e.props.locale,!1,Tl)!==t.target.value){const s=M("dddd",e.props.locale),r=V(e.props.format,e.props.locale),a=null===(o=F(t.target.value,r).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=D(n,"dddd",e.props.locale);if(a&&s.includes(a)&&l!==a){let t=s.indexOf(a)-s.indexOf(l);t=t<-1?7+t:t,n=B(n,t),kl.add(e)}}Fl(e,n)}catch(t){Fl(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=H(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=P(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=H(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=P(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var o;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(o=e.context)||void 0===o?void 0:o.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,s]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,s),Ml(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.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=I(o,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=o)},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 o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&E(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var o,n;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getFullYear()===(null===(n=e.context)||void 0===n?void 0:n.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const o=R(t).getTime();return o<K(e).getTime()||o>N(e).getTime()||void 0}}}));const L=El.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;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,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),Fl(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void Ml(e,void 0);const o=new Date,n=t?Ml(e,T("string"==typeof t?O(t,e.props.valueFormat,e.props.valueLocale):t,e.props.offset)):o;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:n,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:n,e.props.localTime=D(n,"HH:mm"),function(e){const t=Cl.get(e);if(e._value&&t){const o=j(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",Ol.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(Il.delete(e),e.props.panels=Vl(e),e.props.panel=e.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=I(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}Ol(e),r(`${e.props.id}_popover`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&setTimeout((()=>{o.focus(),function(e,t){const o=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())}))}));o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",(({payload:t})=>{t||(e.off(n),o.disconnect())}))}(e,t)}),0)}),e.props.__root),_l&&setTimeout((()=>{document.addEventListener("click",L)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){Dl.add(e);const t="string"==typeof e._value?O(e._value,e.props.valueFormat,e.props.valueLocale):e._value;Ml(e,T(t,e.props.offset))}else Ml(e,void 0);_l&&(Sl.add(e),document.removeEventListener("click",L),setTimeout((()=>Sl.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 o=e.props.calendar,n=K(e.props.renderedDate),s=N(P(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=P(e.props.renderedDate,-1):t.getTime()>s.getTime()&&(e.props.renderedDate=P(e.props.renderedDate))}else if("year"===e.props.panel){const t=e.props.years,o=t[0].getFullYear(),n=t[t.length-1].getFullYear(),s=e.props.activeDate.getFullYear();s>n?e.props.renderedDate=H(e.props.renderedDate,10):s<o&&(e.props.renderedDate=H(e.props.renderedDate,-10))}e.props.expanded&&Ml(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),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})=>{t.preventDefault();let o=null,n=0;switch(t.key){case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowDown":n=7;break;case"ArrowUp":n=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||Bl(e,t);break;case"Escape":e.props.expanded=!1}if(n&&(t.preventDefault(),o=B(e.props.activeDate,n)),o&&!e.props._isDisabled(o))e.props.activeDate=o;else if(o&&e.props._isDisabled(o)){const t=n>0?1:-1;he(Number(e.props.maxScan),(e=>t*e)).some((t=>{const n=B(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||Bl(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=H(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||Bl(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const s=n-e.props.renderedDate.getMonth();let r=P(e.props.renderedDate,s);if(e.props._isDisabled(r)){const t=I(r,(t=>!e.props._isDisabled(t)),"month");t&&(r=t)}e.props.activeDate=r})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Al.get(e)&&Hl(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=/* #__PURE__ */p({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:Nl(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},Bo,
|
|
35
|
+
/* #__PURE__ */g("next"),
|
|
36
|
+
/* #__PURE__ */g("prev"),
|
|
37
|
+
/* #__PURE__ */g("changeDate"),
|
|
38
|
+
/* #__PURE__ */g("chooseDate"),
|
|
39
|
+
/* #__PURE__ */m("close","close"),
|
|
40
|
+
/* #__PURE__ */m("next","right"),
|
|
41
|
+
/* #__PURE__ */m("clear","close"),
|
|
42
|
+
/* #__PURE__ */m("prev","left"),
|
|
43
|
+
/* #__PURE__ */m("calendar","date")]},zl=/* #__PURE__ */Me("tl"),{outer:Gl,wrapper:ql,inner:Xl,icon:Jl,label:Ql,prefix:ei,suffix:ti,help:oi,messages:ni,message:si}=/* #__PURE__ */Ve(zl),ri=/* #__PURE__ */zl("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",name:"$node.name",tabindex:"0",placeholder:"$state.loading && $inputStd.length === 0 && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || $disabledInternally || undefined","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),ai=/* #__PURE__ */zl("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-label":"$expanded && $ui.close.value || $ui.open.value",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),li=/* #__PURE__ */zl("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)",onKeydown:"$handlers.searchInputTagKeydown && $handlers.searchInputTagKeydown($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),ii=/* #__PURE__ */zl("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),pi=/* #__PURE__ */zl("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1","aria-label":"$ui.remove.value",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)",onTouchstart:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),di=/* #__PURE__ */zl("tagLabel",(()=>({$el:"span"}))),ci=/* #__PURE__ */zl("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),ui=/* #__PURE__ */zl("tagLoading","span"),fi=He(zl);function vi(e){e.props.multiple=!0,e.props.openOnClick=s(e.props.openOnClick),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=s(e.props.allowNewValues)}function hi(e){tr(e),Oo(e),e.on("created",(()=>{function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}e.props.disabled&&(e.props.draggable=!1),r(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement){if(!e.context)return;const s={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[x()],root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(t){e.props.activeSelectionValue=void 0,_(t)},handleDragstart(t){e.props.activeSelectionValue=void 0,k(t)},handleTouchstart(t){e.props.activeSelectionValue=void 0,S(t)}};w({parent:n,getValues:t,setValues:o,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,w({parent:n,getValues:t,setValues:o,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,w({parent:n,getValues:t,setValues:o,config:s})}))}}),e.props.__root)}))}const $i={schema:/* #__PURE__ */Gl(/* #__PURE__ */ql(/* #__PURE__ */Ql("$label"),/* #__PURE__ */Xl(/* #__PURE__ */Jl("prefix"),/* #__PURE__ */ei(),/* #__PURE__ */ci(/* #__PURE__ */li(/* #__PURE__ */ii(/* #__PURE__ */Be("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",/* #__PURE__ */ui("$ui.isLoading.value"),/* #__PURE__ */di("$option.label")),/* #__PURE__ */pi(/* #__PURE__ */Jl("close")))),/* #__PURE__ */ri()),/* #__PURE__ */Be("$state.loading",/* #__PURE__ */Jl("loader")),/* #__PURE__ */ai(/* #__PURE__ */Jl("select")),/* #__PURE__ */fi(),/* #__PURE__ */ti(),/* #__PURE__ */Jl("suffix"))),/* #__PURE__ */oi("$help"),/* #__PURE__ */ni(/* #__PURE__ */si("$message.value"))),type:"input",family:"dropdown",props:[],features:[b,
|
|
44
|
+
/* #__PURE__ */eo.bind(null,vi,Ks,hi),
|
|
45
|
+
/* #__PURE__ */m("select","select"),
|
|
46
|
+
/* #__PURE__ */m("close","close"),
|
|
47
|
+
/* #__PURE__ */m("selected","check"),
|
|
48
|
+
/* #__PURE__ */m("loader","spinner"),
|
|
49
|
+
/* #__PURE__ */g("isLoading"),
|
|
50
|
+
/* #__PURE__ */g("loadMore"),
|
|
51
|
+
/* #__PURE__ */g("remove"),
|
|
52
|
+
/* #__PURE__ */g("open"),
|
|
53
|
+
/* #__PURE__ */g("close"),Bo]},mi=/* #__PURE__ */Me("mk"),{outer:gi,wrapper:bi,inner:yi,label:xi,prefix:wi,suffix:_i,help:ki,messages:Si,message:Li,icon:Ai}=/* #__PURE__ */Ve(mi),{overlayPlaceholder:Ci,overlayLiteral:Di,overlayChar:Ii,overlayEnum:Ti,overlay:Oi,overlayParts:Ei,overlayInner:Mi}=/* #__PURE__ */Fe(mi),Vi=/* #__PURE__ */mi("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),Fi=new WeakMap,Bi=new WeakMap,Pi=new WeakMap;function Hi(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Bi.set(e,t),Aa(t,{...Fi.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=$t(o)}})}const Ri={schema:/* #__PURE__ */gi(/* #__PURE__ */bi(/* #__PURE__ */xi("$label"),/* #__PURE__ */yi(/* #__PURE__ */Ai("prefix"),/* #__PURE__ */wi(),/* #__PURE__ */Oi(/* #__PURE__ */Mi(/* #__PURE__ */Ei(/* #__PURE__ */Ci("$part.value"),/* #__PURE__ */Di("$part.value"),/* #__PURE__ */Ii("$part.value"),/* #__PURE__ */Ti("$part.value")))),/* #__PURE__ */Vi(),/* #__PURE__ */_i(),/* #__PURE__ */Ai("suffix"))),/* #__PURE__ */ki("$help"),/* #__PURE__ */Si(/* #__PURE__ */Li("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[jl,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,a,l;const i=Ta("string"==typeof e._value?e._value:"");Bi.set(e,i),Pi.set(e,i),e.props.allowIncomplete=s(e.props.allowIncomplete),e.props.overlay=s(e.props.overlay);const p=!(void 0!==e.props.showMask&&!s(e.props.showMask));e.props.unmaskValue=s(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=s(e)),/* #__PURE__ */t(e))));const d={placeholder:p,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(o=e.props.mode)&&void 0!==o?o:"shift",partOverrides:null!==(n=e.props.tokens)&&void 0!==n?n:{},prefix:null!==(a=e.props.prefix)&&void 0!==a?a:void 0,suffix:null!==(l=e.props.suffix)&&void 0!==l?l:void 0,reverse:s(e.props.reverse)};Fi.set(e,d),e.hook.input(((t,o)=>{const n=function(e,t){const o=Bi.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const s=Pi.get(e);s.value=Ka(s,t);const r=Ia(s,Fi.get(e)),a=bl(s,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||r===e.props._maskValue||(o.value=r,e.props._maskValue=r,e.props._overlayParts=$t(yl(s)||[]));return null===a?"":e.props.unmaskValue?a:r}(e,t);
|
|
54
|
+
return o(n)})),e.props._maskValue=Ia(i,d),e.input(e.props._maskValue,!1),e.context&&(e.context.handlers.DOMInput=t=>{e.emit("dom-input-event",t)}),r(`${e.props.id}`,Hi.bind(null,e),e.props.__root)}))}]},Ki=/* #__PURE__ */Me("tf"),{outer:Ni,wrapper:Wi,inner:Ui,icon:Yi,prefix:ji,suffix:Zi,help:zi,messages:Gi,message:qi}=/* #__PURE__ */Ve(Ki),Xi=/* #__PURE__ */Ki("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),Ji=/* #__PURE__ */Ki("legend",(()=>({if:"$label",$el:"legend"}))),Qi=/* #__PURE__ */Ki("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),ep=/* #__PURE__ */Ki("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),tp=/* #__PURE__ */Ki("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),op=/* #__PURE__ */Ki("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),np=/* #__PURE__ */Ki("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),sp=/* #__PURE__ */Ki("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"}))),rp=/* #__PURE__ */Ki("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),ap=/* #__PURE__ */Ki("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),lp=/* #__PURE__ */Ki("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}}))),ip=/* #__PURE__ */Ki("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),pp=/* #__PURE__ */Ki("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$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',onKeydown:"$handlers.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred"}}))),dp=/* #__PURE__ */Ki("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstart:"$handlers.listitemTouchstart($option, true)",onTouchmove:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),cp=/* #__PURE__ */Ki("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),up=/* #__PURE__ */Ki("sourceLoadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),fp=/* #__PURE__ */Ki("loadMoreInner","span"),vp=/* #__PURE__ */Ki("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),hp=/* #__PURE__ */Ki("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),$p=/* #__PURE__ */Ki("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred"}}))),mp=/* #__PURE__ */Ki("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":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstart:"$handlers.listitemTouchstart($option, false)",onTouchmove:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),gp=/* #__PURE__ */Ki("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),bp=/* #__PURE__ */Ki("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),yp=/* #__PURE__ */Ki("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),xp=/* #__PURE__ */Ki("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),wp=/* #__PURE__ */Ki("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),_p=/* #__PURE__ */Ki("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),kp=/* #__PURE__ */Ki("controlLabel","span"),Sp=/* #__PURE__ */Ki("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Lp=/* #__PURE__ */Ki("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Ap=/* #__PURE__ */Ki("emptyMessageInner","span"),Cp=Symbol(),Dp=new WeakSet,Ip=new WeakSet;function Tp(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter((e=>e!==t)),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter((e=>e!==t)));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function Op(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map((e=>gt(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Ep(e,t){if(e.props.sourceListOrigin=!1,t){const o=Array.isArray(e.value)?e.value.filter((e=>e!==t)):[];return void e.input(o)}const o=e.props.selectedTargetItems.map((e=>gt(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function Mp(e){var t,o;if(e.props.activeValue===Cp){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function Vp(e){var t;if(Array.isArray(e.value)){const t=[];let o=[...e.props.options];e.value.forEach((s=>{const r=e.props.memoOptions.find((e=>n(gt(e),s)));if(r&&!r.noOptionFound){t.push(r);const a=e.props.options.findIndex((e=>n(gt(e),s)));-1!==a&&(o=o.filter((e=>!n(gt(e),s))))}else{const e=o.find((e=>n(gt(e),s)));e?(t.push(e),o=o.filter((e=>!n(gt(e),s)))):t.push({label:String(s),value:s,noOptionFound:!0})}})),e.props.targetOptions=t,e.props.sourceOptions=o}else e.props.sourceOptions=[...e.props.options],e.props.targetOptions=[];if(e.props.skipSetActiveValue)return void(e.props.skipSetActiveValue=!1);(null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_source_list_items"))&&function(e){var t,o,n,s,r,a,l;if(e.props.isDragging)return;if(e.props.sourceSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=gt(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const i=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let p=!1;for(let t=e.props.activeIndex;t<=i.length;t++)if(!(null===(n=i.attrs)||void 0===n?void 0:n.disabled)&&i[t]){p=!0,e.props.activeValue=gt(i[t]);break}if(!p&&i.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(s=i.attrs)||void 0===s?void 0:s.disabled)&&i[t])return p=!0,void(e.props.activeValue=gt(i[t]));if(!p){let t;t=e.props.sourceListOrigin?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`):e.props.searchable?null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_search_input`):null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}(e)}function Fp(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}function Bp(e){Array.isArray(e.value)&&e.value.forEach((async t=>{At(e,t,function(e,t){const o=[...e.props.options,...e.props.memoOptions];return o.find((e=>n(gt(e),t)))}(e,t))}))}function Pp(e){e.context&&(e.context.handlers.loadMore=wt.bind(null,e),e.context.fns.getSourceItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.sourceOptions.length:e.props.sourceOptions.length,e.context.fns.getTargetItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.targetOptions.length:e.props.targetOptions.length,e.context.fns.isActive=(t,o)=>{if(!e.props.isDragging&&!e.props.touchStarted)return n(o,gt(t))||void 0},e.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),e.context.fns.optionLoading=t=>e.props.optionLoaderValues.includes(gt(t)),e.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",xt(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(e)},e.context.handlers.sourceSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.listitemClick=(t,o)=>n=>{Hp(e,t,o)},e.context.handlers.transferForward=Op.bind(null,e,void 0),e.context.handlers.transferForwardAll=()=>{let t;if(e.props.maxReached)return;const o=e.props.sourceOptions.map((e=>gt(e)));t=Array.isArray(e.value)?[...e.value,...o]:[...o],e.input(t),e.props.selectedSourceItems=[]},e.context.handlers.transferBackward=Ep.bind(null,e,void 0),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.input([]),e.props.selectedTargetItems=[])},e.context.handlers.onSearch=t=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,xt(e,o.value,!0)}(e,t)},e.context.handlers.onMouseenter=t=>o=>{"touchstart"!==o.type&&(t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0)},e.context.handlers.onMouseleave=t=>o=>{var n;if("touchend"===o.type)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(t?`${e.props.id}_source_list_items`:`${e.props.id}`);s&&(s.contains(o.relatedTarget)||(e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeIndex=void 0,t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1))},e.context.handlers.listitemClick=(t,o)=>n=>{n instanceof MouseEvent&&e.props.touchStarted||Hp(e,t,o)},e.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(e)},e.context.handlers.listitemTouchend=(t,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const s=gt(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>gt(e)===s)),e.props.transferOnSelect?o?Op(e,s):Ep(e,s):Tp(e,t,o)}(e,t,o)},e.context.handlers.listitemTouchmove=()=>t=>{!function(e){e.props.touchMoved=!0}(e)},e.context.handlers.sourceSearchFocus=t=>{Rp(e,!0)},e.context.handlers.sourceListFocused=t=>{Rp(e,!0)},e.context.handlers.targetListFocused=()=>{Rp(e,!1)},e.context.handlers.sourceListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.targetListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.sourceListKeydown=t=>{Kp(e,t,!0)},e.context.handlers.targetListKeydown=t=>{Kp(e,t,!1)},e.context.handlers.sourceSearchKeydown=t=>{Kp(e,t,!0)})}function Hp(e,t,o,n){var s;if(gt(t)===Cp)return void(null===(s=e.context)||void 0===s||s.handlers.loadMore(!0));const r=gt(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>gt(e)===r)),e.props.transferOnSelect?o?Op(e,r):Ep(e,r):Tp(e,t,o)}function Rp(e,t){const o=Fp(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=gt(o))}function Kp(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,s,r;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(gt(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(Cp);const i=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==i)for(let e=i-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[i-1];break}else if("ArrowDown"===e.key&&i!==l.length-1)for(let e=i+1;e<l.length;e++)if(!(null===(r=null===(s=a[e])||void 0===s?void 0:s.attrs)||void 0===r?void 0:r.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}Mp(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,s;if(Fp(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===Cp)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const s=o?t.props.sourceOptions:t.props.targetOptions,r=s.findIndex((e=>gt(e)===t.props.activeValue));t.props.activeIndex=r;const a=s[r];if(!a)return;t.props.transferOnSelect?o?Op(t,gt(a)):Ep(t,gt(a)):Tp(t,a,o)}(t,e,o)}function Np(e){e.on("created",(()=>{if(e.props.skipSetActiveValue=!0,"function"==typeof e.props.optionsLoader&&Ct(e),Pp(e),e.props.disabled&&(e.props.draggable=!1),oe){r(e.props.id+"_source_list_items",(t=>{t instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.sourceOptions.map((e=>gt(e)))}function n(){return[]}const s={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],L(t)},draggable:e=>"option"===e.getAttribute("role")};s.plugins=[A({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,k(t)},handleEnd(t){_(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,S(t)},selections:()=>e.props.selectedSourceItems.map((e=>gt(e)))})],w({parent:t,getValues:o,setValues:n,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,w({parent:t,getValues:o,setValues:n,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,w({parent:t,getValues:o,setValues:n,config:s})})),e.on("prop:maxReached",(({payload:e})=>{s.disabled=e,w({parent:t,getValues:o,setValues:n,config:s})}))}(e,t)}),e.props.__root),r(`${e.props.id}`,(t=>{t instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return Array.isArray(e.value)?[...e.value]:[]}function n(t,o){e.props.sourceListOrigin=!0,e.input(t)}const s={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};s.plugins=[A({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,k(t)},handleEnd(t){_(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,S(t)},selections:()=>e.props.selectedTargetItems.map((e=>gt(e)))})],w({parent:t,getValues:o,setValues:n,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,w({parent:t,getValues:o,setValues:n,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,w({parent:t,getValues:o,setValues:n,config:s})}))}(e,t)}),e.props.__root);const t=t=>{var o;if(e.props.isDragging)return;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(n);if(s){const o=s.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",t)}}))}function Wp(e,t){var o;let n=null,s="",r=[];if(e.props.mouseOnSource){if(n=Dp.has(e),s=`${e.props.id}_source_list_item`,r=[...e.props.sourceOptions],!r||!r.length||n)return r=[],s="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Ip.has(e),s=`${e.props.id}_target_list_item`,r=[...e.props.targetOptions],!r||!r.length||n))return r=[],s="",void(n=null);const a=r.reduce(((t,o,n)=>{var r,a;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(s+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&Dp.add(e),e.props.mouseOnTarget&&Ip.add(e),a.length&&Up(e,a,null,t)}function Up(e,t,o,n){const s=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>s.top&&e.props.mouseY<s.bottom){let n=o||0,s=o;const r=(t,n)=>{var s;const r=n[0],{y:a,height:l,x:i,width:p}=r.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const r=n[1];return e.props.activeValue=r&&!(null===(s=r.attrs)||void 0===s?void 0:s.disabled)?gt(r):void 0,!0}return!1};do{if(null!==n&&r(n,t[n]))break;if(null!==s&&r(s,t[s]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==s&&(s--,s<0&&(s=null))}while(null!==n||null!==s)}}else Mp(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&Dp.has(e)||e.props.mouseOnTarget&&Ip.has(e)?requestAnimationFrame(Up.bind(null,e,t,o,n)):Wp(e,n):(Dp.delete(e),Ip.delete(e))}const Yp={schema:/* #__PURE__ */Ni(/* #__PURE__ */Xi(/* #__PURE__ */Ji("$label"),/* #__PURE__ */zi("$help"),/* #__PURE__ */Wi(/* #__PURE__ */Qi(/* #__PURE__ */ep(/* #__PURE__ */tp(),/* #__PURE__ */op(/* #__PURE__ */Be("$optionsLoadingCounter > 0",/* #__PURE__ */Yi("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),/* #__PURE__ */rp(/* #__PURE__ */ap(/* #__PURE__ */lp(),/* #__PURE__ */ip(/* #__PURE__ */Yi("close")))),/* #__PURE__ */pp(/* #__PURE__ */Sp(/* #__PURE__ */Ap("$sourceEmptyMessage")),/* #__PURE__ */dp(/* #__PURE__ */Be("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",/* #__PURE__ */Yi("selected")),/* #__PURE__ */cp("$option.label")),/* #__PURE__ */up(/* #__PURE__ */Be("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */fp(/* #__PURE__ */Be("$state.loading",/* #__PURE__ */Yi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),/* #__PURE__ */bp(/* #__PURE__ */xp(/* #__PURE__ */kp("$ui.addAllValues.value"),/* #__PURE__ */Yi("fastForward")),/* #__PURE__ */yp(/* #__PURE__ */kp("$ui.addSelectedValues.value"),/* #__PURE__ */Yi("moveRight")),/* #__PURE__ */wp(/* #__PURE__ */kp("$ui.removeSelectedValues.value"),/* #__PURE__ */Yi("moveLeft")),/* #__PURE__ */_p(/* #__PURE__ */kp("$ui.removeAllValues.value"),/* #__PURE__ */Yi("rewind"))),/* #__PURE__ */vp(/* #__PURE__ */hp(/* #__PURE__ */np(),/* #__PURE__ */sp("$fns.getTargetItemCount($selectedTargetItems)")),/* #__PURE__ */$p(/* #__PURE__ */Lp(/* #__PURE__ */Be("$state.loading !== true",/* #__PURE__ */Ap("$targetEmptyMessage"))),/* #__PURE__ */mp(/* #__PURE__ */Be("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",/* #__PURE__ */Yi("selected")),/* #__PURE__ */gp(/* #__PURE__ */Be("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),/* #__PURE__ */Gi(/* #__PURE__ */qi("$message.value")))),type:"input",props:[],features:[
|
|
55
|
+
/* #__PURE__ */m("moveRight","right"),
|
|
56
|
+
/* #__PURE__ */m("moveLeft","left"),
|
|
57
|
+
/* #__PURE__ */m("fastForward","fastForward"),
|
|
58
|
+
/* #__PURE__ */m("rewind","rewind"),
|
|
59
|
+
/* #__PURE__ */m("close","close"),
|
|
60
|
+
/* #__PURE__ */m("loader","spinner"),
|
|
61
|
+
/* #__PURE__ */m("selected","check"),
|
|
62
|
+
/* #__PURE__ */g("isLoading"),
|
|
63
|
+
/* #__PURE__ */g("loadMore"),
|
|
64
|
+
/* #__PURE__ */g("addAllValues"),
|
|
65
|
+
/* #__PURE__ */g("addSelectedValues"),
|
|
66
|
+
/* #__PURE__ */g("removeSelectedValues"),
|
|
67
|
+
/* #__PURE__ */g("removeAllValues"),b,function(e){!function(e){e.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption"]),e.props.loadMoreOption={label:"Load more",value:Cp},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=Dt.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=s(e.props.disabled)),e.props.searchable=s(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=s(e.props.clearOnSelect),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=>gt(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(xt(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Vp(e)),"function"==typeof e.props.optionLoader?Bp(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),Np(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Vp(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Vp(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,Dp.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===Cp)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>n(gt(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,e.props.sourceListOrigin=!0,Dp.delete(e),Wp(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,Ip.delete(e),Wp(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(kt)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(kt),e.props.skipSetActiveValue=!0,Vp(e))}))}(e)}]};const jp=/* #__PURE__ */Me("sl"),{outer:Zp,wrapper:zp,inner:Gp,icon:qp,label:Xp,prefix:Jp,suffix:Qp,help:ed,messages:td,message:od}=/* #__PURE__ */Ve(jp),nd=/* #__PURE__ */jp("chart",(()=>({$el:"div",if:"$chart"}))),sd=/* #__PURE__ */jp("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),rd=/* #__PURE__ */jp("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),ad=/* #__PURE__ */jp("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),ld=/* #__PURE__ */jp("trackWrapper",(()=>({$el:"div"}))),id=/* #__PURE__ */jp("trackInner",(()=>({$el:"div"}))),pd=/* #__PURE__ */jp("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),dd=/* #__PURE__ */jp("linkedValues",(()=>({$el:"div"}))),cd=/* #__PURE__ */jp("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),ud=/* #__PURE__ */jp("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),fd=/* #__PURE__ */jp("marks",(()=>({$el:"div",if:"$marks"}))),vd=/* #__PURE__ */jp("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),hd=/* #__PURE__ */jp("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),$d=/* #__PURE__ */jp("handles",(()=>({$el:"ul"}))),md=/* #__PURE__ */jp("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),gd=/* #__PURE__ */jp("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),bd=/* #__PURE__ */jp("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),yd=/* #__PURE__ */jp("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),xd=/* #__PURE__ */jp("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),wd=/* #__PURE__ */jp("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),_d={schema:/* #__PURE__ */Zp(/* #__PURE__ */zp(/* #__PURE__ */Xp("$label"),/* #__PURE__ */ed("$help"),/* #__PURE__ */rd(/* #__PURE__ */qp("prefix"),/* #__PURE__ */Jp(),/* #__PURE__ */ad(/* #__PURE__ */nd(/* #__PURE__ */sd()),/* #__PURE__ */ld(/* #__PURE__ */id(/* #__PURE__ */pd(),/* #__PURE__ */fd(/* #__PURE__ */vd(/* #__PURE__ */hd())),/* #__PURE__ */$d(/* #__PURE__ */gd(/* #__PURE__ */wd(),/* #__PURE__ */bd()),/* #__PURE__ */md(/* #__PURE__ */xd(),/* #__PURE__ */yd()))))),/* #__PURE__ */Qp(),/* #__PURE__ */qp("suffix"),/* #__PURE__ */Be("$showInput && $isMulti === false",/* #__PURE__ */cd())),/* #__PURE__ */Be("$showInput && $isMulti",/* #__PURE__ */dd(/* #__PURE__ */ud(),/* #__PURE__ */cd())),/* #__PURE__ */td(/* #__PURE__ */od("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){let t,o,a;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const l={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};let i=!1;function p(t){const{min:o,max:n,intervals:s}=e.props;if(t=Math.min(Math.max(t,0),100),!s||0===s.length){y();const s=o+t/100*(n-o);return e.props.scalingFunction.reverse(s,o,n)}const r=c(s,o,n);for(let e=0;e<r.length;e++){const{value:o,step:n,left:s,width:a,stepsInInterval:l}=r[e];if(t>=s&&t<=s+a){const e=o+(t-s)/a*l*n,r=e%n;return m(r<n/2?e-r:e+(n-r))}}return t>100?n:t<0?o:void 0}function d(t,o=e.props.min,n=e.props.max){const s=e.props.intervals;if(!s||0===s.length){y();return(e.props.scalingFunction.forward(t,o,n)-o)/(n-o)*100}const r=c(s,o,n);for(let e=0;e<r.length;e++){const{value:o,step:s,left:a,width:l,stepsInInterval:i}=r[e],p=e<r.length-1?r[e+1].value:n;if(t>=o&&t<=p){return 100*((a+(t-o)/s/i*l)/100)}}return 100}function c(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let s=0;for(let e=0;e<t.length;e++){const o=t[e].value,r=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;s+=r}let r=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,i=r/s*100;return r+=l,{value:e.value,step:e.step,left:i,width:l/s*100,stepsInInterval:l,totalSteps:s}}))}function u(){const t=parseFloat(`${e.props.min}`),o=parseFloat(`${e.props.max}`);let n,s=0;if(Array.isArray(e._value)){const t=[...e._value].sort(f);s=parseFloat(`${t[0]}`),n=parseFloat(`${t[1]}`)}else n=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${d(n,t,o)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${d(s,t,o)}%`},e.props.fillStyles={left:`${d(s,t,o)}%`,width:d(n,t,o)-d(s,t,o)+"%"}):e.props.fillStyles={left:"0%",width:`${d(n,t,o)}%`}}function f(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function v(o,n=!0){if(e.props.disabled)return;let s;if(void 0===o){if(e.props.isMulti)e.input([e.props.min,e.props.max]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(t)}return u(),void h()}if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(o)){const n="min"===e.props.lastHandleInteraction?0:1;e._value[n]=o;const[r,a]=[...e._value];if(r>=a){const o=null==t?void 0:t.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==o||o.focus()}s=g([...e._value].sort(f))}else Array.isArray(o)?s=g(o):(s=g(o),s=isNaN(s)?e.props.min:s);e.props.snapToMarks&&(s=b(s));const r=$(s);n&&e.input(r),u(),h()}function h(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,n]=[...e._value];o&&o.input(t),a&&a.input(n)}else a&&a.input(e._value)}function $(t){return e.props.isMulti&&Array.isArray(t)?[$(t[0]),$(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function m(t){return parseFloat(t.toFixed(e.props.decimals))}function g(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>m(Math.round(t/e.props.step)*e.props.step))):m(Math.round(t/e.props.step)*e.props.step);const o=c(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,s)=>{var r;return t>=n.value&&t<((null===(r=o[s+1])||void 0===r?void 0:r.value)||e.props.max)}));if(!n)return t;return m(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,s)=>{var r;return t>=n.value&&t<((null===(r=o[s+1])||void 0===r?void 0:r.value)||e.props.max)}));if(!n)return t;return m(n.value+Math.round((t-n.value)/n.step)*n.step)}}function b(t){if(Array.isArray(t))return t[0]=b(t[0]),t[1]=b(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}function y(){if(i)return;s(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=l[e.props.scalingFunction]||l.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...l.linear,...e.props.scalingFunction}):e.props.scalingFunction=l.linear,i=!0}e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=s(e.props.disabled)),e.on("created",(()=>{var l;y(),e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(l=e.props.step.toString().split(".")[1])||void 0===l?void 0:l.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const i=s(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":i;const h=s(e.props.marks);e.props.marks=!!h&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,s=[];for(let e=t;e<=o;e+=n)s.push({at:e,label:e});return s}()),e.props.markLabels=s(e.props.markLabels),e.props.snapToMarks=s(e.props.snapToMarks),e.props.showInput=s(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar;const m={disabled:e.props.disabled,min:e.props.min,max:e.props.max,step:e.props.step};if(e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(m,e.props.inputAttrs):m,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs,r(`track-${e.props.id}`,(()=>{var o;t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`track-${e.props.id}`),v(e.value,!1),u()}),e.props.__root),e.context){let s=0,r="";const l=e.context.handlers.blur;e.context.handlers.blur=t=>{l(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!t)return;e.props.dragging=!1;const{left:n,width:s}=t.getBoundingClientRect(),r=(o.clientX-n)/s;if(e.props.isMulti&&Array.isArray(e.value)){const[t,o]=e.value,n=Math.abs(t-r*e.props.max)<Math.abs(o-r*e.props.max)?"min":"max",s="min"===n?0:1;e.props.lastHandleInteraction=n,e.value[s]=p(100*r),v(e._value)}else v(p(100*r))},e.context.handlers.focus=o=>{if(!t)return;const n=o.target.dataset.handle;n&&(e.props.lastHandleInteraction=n)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1,v(e._value)},e.context.handlers.startDrag=o=>{if(!t)return;e.props.dragging=!0;const n="touchstart"===o.type,s=n?"touchmove":"mousemove",r=n?"touchend":"mouseup";e.props.lastHandleInteraction=o.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(s,g,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(s,g),n&&o.target instanceof HTMLElement&&o.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(s),r+=t.key;const e="-"===r?-1:1;s=window.setTimeout((()=>{"-"!==r?(v(parseFloat(r)*e),r=""):r=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,n=Array.isArray(e._value)?e._value[o]:e._value,s=function(t,o){if(!e.props.intervals)return e.props.step;const n=c(e.props.intervals);if(t>=e.props.max)return n[n.length-1].step;let s=n.find(((o,s)=>{var r;return t>=o.value&&t<((null===(r=n[s+1])||void 0===r?void 0:r.value)||e.props.max)}));if(!s)return e.props.step;if(-1===o){t-s.step<s.value&&(s=n[n.indexOf(s)-1]||s)}return s.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=b(n),s=e.props.marks.find((e=>e.at===o)),r=e.props.marks.indexOf(s),a=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,l=Math.min(Math.max(0,r+a),e.props.marks.length-1);return void v(e.props.marks[l].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?v(e.props.min):v(e.props.max));if("Home"===t.key)return void v(e.props.min);if("End"===t.key)return void v(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){v(n+(t.shiftKey?10*s:s)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?v(n+10*s):"PageDown"===t.key&&v(n-10*s)}},e.context.handlers.maxNode=t=>{a=t,t.hook.commit(((o,s)=>{if(n(t.value,o))
|
|
68
|
+
return s(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=r,v(e.value)):v(r),/* #__PURE__ */s($(r))}))},e.context.handlers.minNode=t=>{o=t,t.hook.commit(((o,s)=>{if(n(t.value,o))
|
|
69
|
+
return s(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=r,v(e.value)):v(r),/* #__PURE__ */s($(r))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(f),o&&o.input(e.value[0]),a&&a.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>d(t,e.props.min,e.props.max)}function g(o){var n;if(!t||!e.props.dragging)return;o.preventDefault();const s=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:r,width:a}=t.getBoundingClientRect();v(p((s-r)/a*100))}v(e.value,!1)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||v(t,!1):e.value!==t&&v(t,!1)})),e.on("prop:max",(()=>{e.props.max=parseFloat(`${e.props.max}`),v(e.value)})),e.on("prop:min",(()=>{e.props.min=parseFloat(`${e.props.min}`),v(e.value)}))}]},kd=/* #__PURE__ */Me("cp"),{outer:Sd,wrapper:Ld,inner:Ad,label:Cd,prefix:Dd,suffix:Id,help:Td,messages:Od,message:Ed,icon:Md}=/* #__PURE__ */Ve(kd),Vd=/* #__PURE__ */kd("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),Fd=/* #__PURE__ */kd("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),Bd=/* #__PURE__ */kd("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),Pd=/* #__PURE__ */kd("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),Hd=/* #__PURE__ */kd("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),Rd=/* #__PURE__ */kd("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),Kd=/* #__PURE__ */kd("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),Nd=/* #__PURE__ */kd("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),Wd=/* #__PURE__ */kd("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),Ud=/* #__PURE__ */kd("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),Yd=/* #__PURE__ */kd("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),jd=/* #__PURE__ */kd("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),Zd=/* #__PURE__ */kd("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),zd=/* #__PURE__ */kd("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),Gd=/* #__PURE__ */kd("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),qd=/* #__PURE__ */kd("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),Xd=/* #__PURE__ */kd("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),Jd=/* #__PURE__ */kd("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),Qd=/* #__PURE__ */kd("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),ec=/* #__PURE__ */kd("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),tc=/* #__PURE__ */kd("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),oc=/* #__PURE__ */kd("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),nc=/* #__PURE__ */kd("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),sc=/* #__PURE__ */kd("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),rc=/* #__PURE__ */kd("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),ac=/* #__PURE__ */kd("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),lc=/* #__PURE__ */kd("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),ic=/* #__PURE__ */kd("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),pc=/* #__PURE__ */kd("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),dc=/* #__PURE__ */kd("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),cc=/* #__PURE__ */kd("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),uc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,fc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function vc(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function hc(e){const[t,o,n,s]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),s=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const s=e/255,r=t/255,a=o/255,l=Math.max(s,r,a),i=Math.min(s,r,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case s:d=(r-a)/e+(r<a?6:0);break;case r:d=(a-s)/e+2;break;case a:d=(s-r)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,s)}(e);return[...mc(t,o,n,s)]}function $c(e,t,o,n=1){const s=t/100,r=o/100,a=(2-s)*r/2;return 0!==a&&(1===a||(t=a<.5?s*r/(2*a):s*r/(2-2*a))),[e,vc(255*t,2),vc(255*a,2),n]}function mc(e,t,o,n=1){const s=vc(t/255,4),r=vc(o/255,4);if(1===r)return[e,0,100,n];const a=vc(r+s*Math.min(r,1-r),4);let l=t/2.55;return 0!==a&&(l=1!==r&&0!==r?2*(a-r)/a*100:t/2.55),[e,vc(l,2),vc(100*a,2),n]}function gc(e,t,o,n=1){const s=o/100,r=s*(t/100),a=r*(1-Math.abs(e/60%2-1)),l=s-r;let i=0,p=0,d=0;return[i,p,d]=e<60?[r,a,0]:e<120?[a,r,0]:e<180?[0,r,a]:e<240?[0,a,r]:e<300?[a,0,r]:[r,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function bc(e,t,o,n=1){const s=e/255,r=t/255,a=o/255,l=Math.max(s,r,a),i=Math.min(s,r,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case s:p=(r-a)/c+(r<a?6:0);break;case r:p=(a-s)/c+2;break;case a:p=(s-r)/c+4}p/=6}return[360*p,100*u,100*d,n]}function yc(e,t,o,n=1){const[s,r,a,l]=gc(e,t,o,n);return function(e,t,o,n=1){const s=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),r=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+s(e)+s(t)+s(o)+`${"FF"===r?"":r}`}(s,r,a,l)}function xc(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function wc(e){if(e){if(xc(e))return hc(e);if(e.startsWith("rgb")){const t=e.match(uc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return bc(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(fc);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,s=Number(t[3].slice(0,-1))/100,r=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return mc(o,vc(255*n,2),vc(255*s,2),r)}}}function _c(e){const[t,o,n,s]=e.split("-").map((e=>Number(e)));return[t,o,n,s]}function kc(e,t=150,o=!0){let n=null;return(...o)=>{const s=()=>{e(...o),n=null};n||(n=setTimeout(s,t))}}function Sc(e){return!1!==e&&"false"!==e}function Lc(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const Ac={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const Cc={schema:/* #__PURE__ */Sd(/* #__PURE__ */Ld(/* #__PURE__ */Cd("$label"),/* #__PURE__ */Be("$inline && $help",/* #__PURE__ */Td("$help")),/* #__PURE__ */Ad(/* #__PURE__ */Be("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */Md("prefix","label")),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Dd()),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Vd(/* #__PURE__ */Xd(),/* #__PURE__ */Be("$showValue",/* #__PURE__ */Fd()))),/* #__PURE__ */Be("$inline || $expanded)",/* #__PURE__ */Bd(/* #__PURE__ */Be("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */Pd(/* #__PURE__ */Md("close"))),/* #__PURE__ */Be("$panelControls",/* #__PURE__ */Hd(/* #__PURE__ */Rd(/* #__PURE__ */Kd(),/* #__PURE__ */Nd()),/* #__PURE__ */Gd(/* #__PURE__ */qd()),/* #__PURE__ */Wd(/* #__PURE__ */Ud(),/* #__PURE__ */Yd()),/* #__PURE__ */jd(/* #__PURE__ */Zd(),/* #__PURE__ */zd()),/* #__PURE__ */Be("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */Jd(/* #__PURE__ */Md("eyeDropper"))))),/* #__PURE__ */Be("$panelFormat",/* #__PURE__ */Qd(/* #__PURE__ */ec(/* #__PURE__ */Be('$panelActiveFormat === "hex"',/* #__PURE__ */tc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */oc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */nc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */sc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */ac()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */lc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */ic()),/* #__PURE__ */Be('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */rc())),/* #__PURE__ */pc(/* #__PURE__ */Md("switch")))),/* #__PURE__ */Be("$options",/* #__PURE__ */dc(/* #__PURE__ */cc())))),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Id()),/* #__PURE__ */Be("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */Md("suffix"))),/* #__PURE__ */Be("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */Td("$help"))),/* #__PURE__ */Od(/* #__PURE__ */Ed("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){let t,o=null,n=null,a=null,l=null,i=null,p=null,d=null,c=0;const u=["hex","rgba","hsla"],f=kc((function(){if(!n)return;const t=n.getContext("2d");if(!t)return;const{width:o,height:s}=n,r=e.props.h||0;t.fillStyle=`hsl(${r}, 100%, 50%)`,t.fillRect(0,0,o,s);const a=t.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=a,t.fillRect(0,0,o,s);const l=t.createLinearGradient(0,0,0,s);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=l,t.fillRect(0,0,o,s)}),2),v=kc((function(){if(!l)return;const t=l.getContext("2d");if(!t)return;const o=Math.round(l.width),n=Math.round(l.height);t.clearRect(0,0,o,n),F(l,n/2);const s=e.props.rgba.r||0,r=e.props.rgba.g||0,a=e.props.rgba.b||0,i=t.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${s}, ${r}, ${a}, 0)`),i.addColorStop(1,`rgba(${s}, ${r}, ${a}, 1)`),t.fillStyle=i,t.fillRect(0,0,o,n)}),2),h=kc(D,2),$=kc(I,2),m=kc(H,2),g=kc(B,10,!1);function b(t){var n,s;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const r=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(o&&o.contains(r)){const o=null===(s=t.clipboardData)||void 0===s?void 0:s.getData("text");if(!o)return;if("INPUT"===r.tagName&&!xc(o)&&!uc.test(o)&&!fc.test(o))return;(xc(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),y(o))}}function y(t){var o;if(!t)return;const n=wc(t);if(n){const[o,s,r,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof s||isNaN(s)||"number"!=typeof r||isNaN(r)||"number"!=typeof a||isNaN(a)||vc(o,2)===e.props.h&&vc(s,2)===e.props.s&&vc(r,2)===e.props.v&&vc(a,2)===e.props.alpha)||(e.props.alpha=vc(a,2),H(o,s,r))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=wc(n.value);if(t){const[o,n,s,r]=t;e.props.alpha=vc(r,2),H(o,n,s)}else H(e.props.h,e.props.s,e.props.v)}else H(e.props.h,e.props.s,e.props.v)}}function x(t){if(!e.context||!d)return;const o=d[t];o&&(e.props.focusedSwatch=o.dataset.color)}function w(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function _(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),r(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,s,r]=hc(t.sRGBHex);e.props.alpha=1,H(n,s,r)}))}),e.props.__root))}function k(){S("canvas-ls",(e=>{n=e}),f,E),S("canvas-hue",(e=>{a=e}),C,M),S("canvas-alpha",(e=>{l=e}),v,V),L(`canvas-preview-${e.props.id}`,(e=>{i=e,D()}),h),L(`canvas-swatch-preview-${e.props.id}`,(e=>{p=e,I()}),$),A()}function S(o,n,s,r){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&t&&r(e)},p=e=>{t&&r(e)},d=()=>{t=void 0,l()},c=()=>{t=void 0,l()};L(`${o}-${e.props.id}`,(e=>{const l=e.nextElementSibling;n(e),s(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,r),a||function(e,t){a=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(l,e),e.addEventListener("mousedown",(e=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),t=Ac[o],r(e),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),t=Ac[o],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),s)}function L(t,o,n){r(t,(()=>{var s;const r=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(t);r&&(o(r),n&&w(r,n))}),e.props.__root)}function A(){r(`swatches-${e.props.id}`,(()=>{var t,o,n;d=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),d.forEach((e=>{w(e,T)})),e.props.focusedSwatch=null===(n=null===(o=d[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,B()}),e.props.__root)}function C(){if(!a)return;const e=a.getContext("2d");if(!e)return;const t=a.width,o=a.height;for(let n=0;n<t;n++){const s=Math.floor(n/t*360);e.fillStyle=`hsl(${s}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!i)return;const t=i.getContext("2d");if(!t)return;F(i,i.width/3);const{r:o,g:n,b:s,a:r}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${s}, ${r})`,t.fillRect(0,0,i.width,i.height)}function I(){if(!p)return;const t=p.getContext("2d");if(!t)return;F(p,p.height/2);const{r:o,g:n,b:s,a:r}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${s}, ${r})`,t.fillRect(0,0,p.width,p.height)}function T(e){if(!e)return;const t=e.getContext("2d");if(!t)return;F(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,s,r,a]=_c(o),[l,i,p,d]=$c(n,s,r,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function O(e,o,n){let s=null;const r=e=>{null!==s&&cancelAnimationFrame(s),s=requestAnimationFrame((()=>{if(!o)return;const t=o.getBoundingClientRect();let s,r;"touches"in e?(s=e.touches[0].clientX-t.left,r=e.touches[0].clientY-t.top):(s=e.clientX-t.left,r=e.clientY-t.top),s=Math.min(Math.max(s,0),t.width),r=Math.min(Math.max(r,0),t.height),n(s,r)}))};r(e);const a=e=>{e.preventDefault(),r(e)},l=e=>{e.preventDefault(),r(e)},i=()=>{t=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{t=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function E(t){O(t,n,((t,o)=>{const s=t/n.width*100,r=100-o/n.height*100;m(e.props.hue,s,r)}))}function M(t){O(t,a,((t,o)=>{if(!a)return;const n=a.width,s=Math.floor(t/n*360);e.props.h=s,m(e.props.h,e.props.s,e.props.v)}))}function V(t){O(t,l,((t,o)=>{const n=t/l.width*100/100;e.props.alpha=n,m(e.props.hue,e.props.s,e.props.v)}))}function F(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),s=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<s;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function B(){var t,o;if(!e.context||!e.props.options||!d)return;const{h:n,s:s,v:r,alpha:a}=e.props,l=function(e,t,o,n=1){const s=0===o?0:t;return`${vc(0===o||100===o&&0===t?0:e,0)}-${vc(s,0)}-${vc(o,0)}-${vc(n,2)}`}(n,s,r,a);let i=!1,p=!1;d.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,s,c]=t.split("-");"0"===s&&0===r&&c===`${a}`&&(p=!0);const u=e.parentElement;p||t===l?(u.dataset.active="true",e.ariaSelected="true",p=!1,!i&&d&&(x(d.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")})),i||(e.props.focusedSwatch=null===(o=null===(t=d[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function P(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function H(t,n,s,r=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:vc(Math.max(Math.min(t,360),0),2),e.props.s=void 0===n||isNaN(n)?e.props.s:vc(Math.max(Math.min(n,100),0),2),e.props.v=void 0===s||isNaN(s)?e.props.v:vc(Math.max(Math.min(s,100),0),2);const{h:a,s:l,v:i,alpha:p}=e.props,[d,c,u]=$c(a,l,i),[f,v,h]=gc(a,l,i),$=e.props.hexInputFocused?e.props.hex:yc(a,l,i,p),m=vc(p,2);e.props.hsla={h:a,s:c,l:u,a:m},e.props.hslaPercent={h:vc(a,0),s:100===i&&0===l?0:vc(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:vc(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:m},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${m})`,e.props.hslaStringPrecise=`hsla(${a}, ${vc(0===i?c/255:c/255*100,2)}%, ${vc(u/255*100,2)}%, ${m})`,e.props.rgba={r:f,g:v,b:h,a:m},e.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${m})`,P($),setTimeout((()=>{var t;R(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),g(),o||"undefined"==typeof window||(o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const b=e.props.valueFormat?e.props.valueFormat:e.props.format;r||("hex"===b?e.input(e.props.hex):"rgba"===b?e.input(e.props.rgbaString):"hsla"===b&&e.input(e.props.hslaStringPrecise))}function R(){f(),v(),h(),$()}e.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",b)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",b),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||u[0],e.props.panelControls=Sc(e.props.panelControls),e.props.eyeDropper=Sc(e.props.eyeDropper),e.props.panelFormat=Sc(e.props.panelFormat),e.props.showValue=Sc(e.props.showValue),e.props.allowPaste=Sc(e.props.allowPaste),e.props.inline=s(e.props.inline),e.props.disabled=s(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=s(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},H(0,0,0,!0)):y(`${e.value}`),e.on("input",(({payload:t})=>{o&&void 0!==e.props.__root&&!o.contains(e.props.__root.activeElement)&&y(t)})),setTimeout((()=>{_()}),5),k(),e.on("prop:expanded",(()=>{var t;if(e.props.expanded)_(),k(),A(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}function o(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=wc(e);if(!o)return"0-0-0-1";let[n,s,r,a]=o;return 0===t&&(n=0===r||100===r&&0===s?0:n),`${vc(n,t)}-${vc(s,t)}-${vc(r,t)}-${vc(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},e.context.handlers.inputPreviewFocusout=t=>{var o,n,s;const r=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(r.contains(a)){function l(t){var o,n;r.contains(t.target)||(e.props.expanded=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(s=e.props.__root)||void 0===s||s.addEventListener("touchstart",l)}else e.props.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(u.indexOf(e.props.panelActiveFormat)+t+u.length)%u.length;e.props.panelActiveFormat=u[o]},e.context.handlers.panelKeydown=t=>{var o,n,s;if("Tab"===t.key&&e.props.expanded){t.preventDefault();const r=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Lc),a=r.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(s=e.props.__root)||void 0===s?void 0:s.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+r.length)%r.length:(a+1)%r.length,r[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:s}=e.props,r=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":H(o,n-r,s);break;case"ArrowRight":H(o,n+r,s);break;case"ArrowUp":H(o,n,s+r);break;case"ArrowDown":H(o,n,s-r);break;case"PageUp":H(o,n,s+10);break;case"PageDown":H(o,n,s-10);break;case"Home":H(o,n-10,s);break;case"End":H(o,n+10,s)}R()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:s}=e.props,r=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":H(o-r,n,s);break;case"ArrowRight":case"ArrowUp":H(o+r,n,s);break;case"PageUp":H(o+10,n,s);break;case"PageDown":H(o-10,n,s);break;case"Home":H(0,n,s);break;case"End":H(360,n,s)}R()}},e.context.handlers.alphaControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:s,alpha:r}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.alpha=vc(Math.min(Math.max(r-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=vc(Math.min(Math.max(r+a,0),1),2);break;case"PageUp":e.props.alpha=vc(Math.min(Math.max(r+.1,0),1),2);break;case"PageDown":e.props.alpha=vc(Math.min(Math.max(r-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}H(o,n,s)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,s=o.value.slice(0,n);if(o.value=s,xc(s)){const[t,o,n,r]=hc(s);e.props.alpha=r,P(s),H(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let s="";if(!xc(n))return;const r=n.startsWith("#")?n.slice(1):n,a=8===r.length,l=a?r.substring(0,6):r,i=a?r.substring(6,8):"",p=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(s=c.toString(16).padStart(6,"0").toUpperCase()),s&&(o.value=a?`#${s}${i}`:`#${s}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;xc(o)&&P(o)},e.context.handlers.rangeLimitInput=(t,o,n,s)=>r=>{const a=s||r;if(!a||!e.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=mc(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);H(t,o,n)}else if("rgba"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=bc(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);H(t,o,n)}else"alpha"==t&&(e.props.alpha=i,H())},e.context.handlers.rangeLimitKeydown=(t,o,n,s)=>r=>{if(!e.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(r.key)||r.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(r.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(r.key)){const a=r.target,l=Number(a.value),i=r.shiftKey?10*s:s;switch(r.key){case"ArrowUp":r.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":r.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":r.preventDefault(),a.value=`${Math.min(l+10*s,n)}`;break;case"PageDown":r.preventDefault(),a.value=`${Math.max(l-10*s,o)}`;break;case"Home":r.preventDefault(),a.value=`${o}`;break;case"End":r.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,r)()}}else r.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,s,r]=_c(o.dataset.colorPrecise);e.props.alpha=r,H(t,n,s),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,n,s,r;if(!e.context||!d||!d.length)return;const a=d.indexOf(t.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,s=e[0].parentElement;if(!s)return 0;const r=s.getBoundingClientRect(),a=window.getComputedStyle(s),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=r.width+l;return Math.floor(n/i)}(d),p=d.length;let u=0,f=p,v=!1;const h=d[a].dataset.group;if(void 0!==h){const e=d.filter((e=>e.dataset.group===h));u=d.indexOf(e[0]),f=d.indexOf(e[e.length-1])}const $=(a-u)%i;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,c=$,x(a)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void d.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),c=$,e.context.handlers.swatchClick(t),void x(a);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":l=Math.max(a-i,a-(i-(c-$))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(c-$))),v=!0;break;case"ArrowLeft":l=a-1,c=(l-u)%i;break;case"ArrowRight":l=a+1,c=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=d[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(r=null===(s=d[f+1])||void 0===s?void 0:s.dataset)||void 0===r?void 0:r.group;const t=d.filter((e=>e.dataset.group===h)),p=d.filter((t=>t.dataset.group===e)),v=(a-u)%i,$=t.length%i||i,m=a>=u+t.length-$;if(l<u){const e=p.length%i||i;l=u-e+Math.min(Math.max(v,c),e-1)}else l>f&&(l=m?Math.min(f+Math.max(v,c)+1,d.indexOf(p[p.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<p){x(l),d.forEach((e=>{delete e.parentElement.dataset.focused}));const e=d[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},Bo,b,
|
|
70
|
+
/* #__PURE__ */m("eyeDropper","color"),
|
|
71
|
+
/* #__PURE__ */m("close","close"),
|
|
72
|
+
/* #__PURE__ */g("close"),
|
|
73
|
+
/* #__PURE__ */g("next")]},Dc=/* #__PURE__ */Me("tb"),{outer:Ic,inner:Tc,wrapper:Oc,label:Ec,prefix:Mc,suffix:Vc,help:Fc,messages:Bc,message:Pc,icon:Hc}=/* #__PURE__ */Ve(Dc),Rc=/* #__PURE__ */Dc("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),Kc=/* #__PURE__ */Dc("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),Nc=/* #__PURE__ */Dc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),Wc=/* #__PURE__ */Dc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),Uc=/* #__PURE__ */Dc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function Yc(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>n(e,t))).length>0:void 0!==t?n(e.value,t):(e.props._isChecked=n(e.value,e.props.onValue),e.props._isChecked)}const jc={schema:/* #__PURE__ */Ic(/* #__PURE__ */Be("$options",/* #__PURE__ */Oc(/* #__PURE__ */Ec("$label"),/* #__PURE__ */Wc(/* #__PURE__ */Uc(/* #__PURE__ */Kc(/* #__PURE__ */Be("$fns.isChecked($option) === true",/* #__PURE__ */Nc("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */Nc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */Oc(/* #__PURE__ */Be("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */Ec("$label")),/* #__PURE__ */Rc(/* #__PURE__ */Hc("prefix"),/* #__PURE__ */Mc(),/* #__PURE__ */Be("$_isChecked === true",/* #__PURE__ */Nc("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */Nc("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */Vc(),/* #__PURE__ */Hc("suffix")))),/* #__PURE__ */Fc("$help"),/* #__PURE__ */Bc(/* #__PURE__ */Pc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,r,a;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=s(e.props.enforced),e.props.multiple=s(e.props.multiple),e.props.vertical=s(e.props.vertical),e.props.disabled=s(e.props.disabled),null!==(t=(r=e.props).onValue)&&void 0!==t||(r.onValue=!0),null!==(o=(a=e.props).offValue)&&void 0!==o||(a.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=Yc(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>Yc(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?gt(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],s=o.findIndex((e=>n(e,t)));s>-1&&(!e.props.enforced||o.length>1)?o.splice(s,1):-1===s&&o.push(t),e.input(o)}else n(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(n(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},b]},Zc=/* #__PURE__ */Me("ut"),{outer:zc,inner:Gc,wrapper:qc,label:Xc,prefix:Jc,suffix:Qc,help:eu,messages:tu,message:ou,icon:nu}=/* #__PURE__ */Ve(Zc),su=/* #__PURE__ */Zc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));function ru(e){let t=null,o=!1;function n(n){var s,r,a;const p=(`${n}`.match(/\-/g)||[]).length%2==1;n=function(o){o=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${o}`),isNaN(o)&&(o=o.split(t.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(o=o.replace(/[^0-9\.]/g,""),o.includes(".")){const t=o.split(".");0===e.props.decimals?o=t[0]:(t[1]=t[1].padEnd(c(),"0").slice(0,c()),o=t.join("."))}return o}(n);const d={};"unit"===l()&&(d.minimumFractionDigits=n.includes(".")?1:0),d.maximumFractionDigits=c(),e.props.minDecimals&&(d.minimumFractionDigits=e.props.minDecimals,n.includes(".")||(n+=".".padEnd(e.props.minDecimals,"0"))),0===d.maximumFractionDigits&&n.includes(".")&&(n=n.split(".")[0]);let u="";isNaN(n)||""===n.trim()||(n=p?`-${n}`:n,e.props.max&&!isNaN(e.props.max)&&(n=`${Math.min(n,e.props.max)}`),e.props.min&&!isNaN(e.props.min)&&(n=`${Math.max(n,e.props.min)}`),n.includes(".")?n=n.split(".")[0].padStart(1,"0")+"."+(null!==(s=n.split(".")[1])&&void 0!==s?s:"0"):d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0,u=i(e.props.displayLocale,d).format(n));let f,v=n.split(".");v=v[0]+(null!==(a=v[1])&&void 0!==a?a:"").padEnd(c(),"0"),v.length>1&&(v=v.replace(/^0+/,""),v=""!==n&&""===v?"0":v),e.props.valueStore={number:n,integer:v,string:u},o=!0,e.props.valueStore&&(f=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(""===f?void 0:f).then((()=>(o=!1,Promise.resolve())))}function s(){r(`${e.props.id}`,(t=>{var o,n;t instanceof HTMLInputElement&&(t.value=null!==(n=null===(o=e.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),e.props.__root)}function a(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function l(){return e.props.currency?"currency":"unit"}function i(t,o={}){const n=l(),s=Object.assign({},{style:n,roundingMode:"trunc"},o);return s[n]=e.props[n],new Intl.NumberFormat(t,s)}function p(){var o,n,s;const r=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`#${e.props.id}_inner input`);if(r){r.dataset.placeholder||(r.dataset.placeholder=null!==(n=r.getAttribute("placeholder"))&&void 0!==n?n:"");const e=((t.unitLeft?`${t.unit} `:"")+(null!==(s=r.dataset.placeholder)&&void 0!==s?s:"")+(t.unitLeft?"":` ${t.unit}`)).trim();r.setAttribute("placeholder",e)}}function d(o){var n;const s=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input`);if(!s)return;const r=t.unit.length+t.literal.length;o=t.unitLeft?Math.max(o,r):Math.min(o,a().length-r),s.setSelectionRange(o,o)}function c(){return!1===e.props.decimals||"false"===e.props.decimals?0:isNaN(`${e.props.decimals}`)?t.fractionLength:e.props.decimals}e.props.valueStore=null,e.on("input",(({payload:e})=>{o||(n(e),s())})),e.on("mounted",(()=>{p()})),e.context&&(e.context.handlers.setPlaceholder=p,e.context.handlers.init=(o=null)=>{var r;!function(){var o,n,s,r,a,l,p;const d=i(e.props.displayLocale).formatToParts(12345678.12345678);t={decimal:null===(o=d.find((e=>"decimal"==e.type)))||void 0===o?void 0:o.value,group:null===(n=d.find((e=>"group"==e.type)))||void 0===n?void 0:n.value,unit:null===(s=d.find((e=>["unit","currency"].includes(e.type))))||void 0===s?void 0:s.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(r=d.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==a?a:"",fractionLength:null!==(p=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==p?p:0}}();let a=null!==(r=null!=o?o:e._value)&&void 0!==r?r:"";e.props.valueStore?a=e.props.valueStore.number:"integer"===e.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=c())&&void 0!==t?t:0)).toString().replace(".",c())}(`${null!=a?a:""}`)),n(a),s()},e.context.handlers.handleBeforeInput=o=>{var s,r,a,l,i,p,c,u,f;if(!e.props.inExecCommand&&(o.preventDefault(),o.stopPropagation(),o.target instanceof HTMLInputElement)){const v=o.target,h=null!==(s=o.data)&&void 0!==s?s:"",$=null!==(r=o.target.value)&&void 0!==r?r:"",m=null!==(a=o.target.selectionStart)&&void 0!==a?a:0,g=null!==(l=o.target.selectionEnd)&&void 0!==l?l:0,b=g-m,y=$.indexOf(t.decimal);let x=(null!==(i=o.target.selectionStart)&&void 0!==i?i:0)+(o.data?0:-1),w=$,_=1;if($.includes(t.decimal)&&h===t.decimal)return h===t.decimal&&(x=w.indexOf(t.decimal)+1),void d(x);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===h)return;if(h.match(/[a-zA-Z]/))return;if(h===t.decimal&&(!1===e.props.decimals||"false"===e.props.decimals))return;if("deleteByCut"===o.inputType&&b>0&&(w=w.slice(0,m)+w.slice(g),x=g),"insertFromPaste"===o.inputType){const e=null!==(p=o.data)&&void 0!==p?p:"";w=w.slice(0,m)+e+w.slice(g)}if("deleteContentBackward"===o.inputType&&$[m-1]===t.group?(_+=1,x-=1):"deleteContentForward"===o.inputType&&$[m]===t.group&&(_+=1,x+=1),-1!==y&&x>y&&"insertText"===o.inputType?w=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(w,x,null!==(c=o.data)&&void 0!==c?c:"0"):"insertText"===o.inputType?(x=g,w=w.slice(0,m)+o.data+w.slice(g)):"deleteContentForward"===o.inputType?(x+=2,w=0===b?w.slice(0,m)+w.slice(g+_):w.slice(0,m)+w.slice(g)):"deleteContentBackward"===o.inputType&&(x+=1,0===b?w=w.slice(0,Math.max(m-_,0))+w.slice(g):b>0&&(w=w.slice(0,m)+w.slice(g))),"deleteContentForward"===o.inputType&&$[m]===t.decimal){const e=w.slice(m-1);w=w.slice(0,m),e.includes(t.unit)&&(w+=" "+t.unit)}else if("deleteContentBackward"===o.inputType&&$[m-1]===t.decimal){const e=w.slice(m-1);w=w.slice(0,m-1),e.includes(t.unit)&&(w+=" "+t.unit)}n(w),w=null!==(f=null===(u=e.props.valueStore)||void 0===u?void 0:u.string)&&void 0!==f?f:"",x=w.length-$.length+x,w.length===$.length&&(x+=o.inputType.includes("delete")?-1:1),v.setSelectionRange(0,$.length),e.props.inExecCommand=!0,document.execCommand("insertText",void 0,w),e.props.inExecCommand=!1,h===t.decimal?x=w.indexOf(t.decimal)+1:$.includes(t.decimal)&&!w.includes(t.decimal)&&(x=w.length),d(Math.max(0,x))}},e.context.handlers.handleInput=t=>{t.target instanceof HTMLInputElement&&(e.props.inputText=t.target.value,n(t.target.value))},e.context.handlers.handleKeyDown=t=>{var o,r;if(t.target instanceof HTMLInputElement&&("ArrowUp"===t.key||"ArrowDown"===t.key)){const l="ArrowUp"===t.key?1*e.props.step:-1*e.props.step;n(function(e,t){var o,n,s,r;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(s=a[1])&&void 0!==s?s:"",c=null!==(r=l[1])&&void 0!==r?r:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(r=null===(o=e.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==r?r:0,l)),s(),setTimeout((()=>{d(a().length)}),1)}})}const au={schema:/* #__PURE__ */zc(/* #__PURE__ */qc(/* #__PURE__ */Xc("$label"),/* #__PURE__ */Gc(/* #__PURE__ */nu("prefix"),/* #__PURE__ */Jc(),/* #__PURE__ */su(),/* #__PURE__ */Qc(),/* #__PURE__ */nu("suffix"))),/* #__PURE__ */eu("$help"),/* #__PURE__ */tu(/* #__PURE__ */ou("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,s,r,a,l,i,p,d,c,u,f,v,h,$;const m=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(m),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).decimals)&&void 0!==o||(d.decimals=null),null!==(n=(c=e.props).minDecimals)&&void 0!==n||(c.minDecimals=null),null!==(s=(u=e.props).min)&&void 0!==s||(u.min=null),null!==(r=(f=e.props).max)&&void 0!==r||(f.max=null),null!==(a=(v=e.props).step)&&void 0!==a||(v.step=1),null!==(l=(h=e.props).unit)&&void 0!==l||(h.unit=e.props.unit||"percent"),-1===["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"].indexOf(e.props.unit)&&(e.props.unit="percent"),null!==(i=($=e.props).valueFormat)&&void 0!==i||($.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(ru(e),e.context.handlers.init(),m.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},b]},lu=/* #__PURE__ */Me("cr"),{outer:iu,inner:pu,wrapper:du,label:cu,prefix:uu,suffix:fu,help:vu,messages:hu,message:$u,icon:mu}=/* #__PURE__ */Ve(lu),gu=/* #__PURE__ */lu("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));const bu={schema:/* #__PURE__ */iu(/* #__PURE__ */du(/* #__PURE__ */cu("$label"),/* #__PURE__ */pu(/* #__PURE__ */mu("prefix"),/* #__PURE__ */uu(),/* #__PURE__ */gu(),/* #__PURE__ */fu(),/* #__PURE__ */mu("suffix"))),/* #__PURE__ */vu("$help"),/* #__PURE__ */hu(/* #__PURE__ */$u("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,s,r,a,l,i,p,d,c,u,f,v,h,$;const m=["currency","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(m),e.addProps(["inputText"]),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).currency)&&void 0!==o||(d.currency=e.props.currency||"USD"),null!==(n=(c=e.props).decimals)&&void 0!==n||(c.decimals=null),null!==(s=(u=e.props).minDecimals)&&void 0!==s||(u.minDecimals=null),null!==(r=(f=e.props).min)&&void 0!==r||(f.min=null),null!==(a=(v=e.props).max)&&void 0!==a||(v.max=null),null!==(l=(h=e.props).step)&&void 0!==l||(h.step=1),null!==(i=($=e.props).valueFormat)&&void 0!==i||($.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(ru(e),e.context.handlers.init(),m.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.setPlaceholder(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.init()}))})))}))}]};var yu=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:sr,colorpicker:Cc,currency:bu,datepicker:Zl,dropdown:Po,mask:Ri,rating:bs,repeater:Fn,slider:_d,taglist:$i,toggle:nn,togglebuttons:jc,transferlist:Yp,unit:au});const xu="undefined"!=typeof window?setInterval:()=>0,wu=new WeakSet;function _u(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(wu.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:le(13919),children:`${le(451228594)}${le(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){$e[e]?$e[e].add(t):$e[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!te.test(o))return t();const n=parseInt(o,16).toString(),s=Number(n[0])<6?Number(n[0]):6,r=n.substring(s,s+(n.length-6)),a=n.substring(0,s)+n.substring(s+r.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(r)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...s}=t[o.props.type];wu.add(o),o.define({...s,schema:n(e)})}xu((()=>ce.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(s){throw s instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(s),s}}export{Be as $if,sr as autocomplete,Cc as colorpicker,Ve as createBaseSections,_u as createProPlugin,Me as createSectionFactory,bu as currency,Zl as datepicker,Po as dropdown,yu as inputs,Ri as mask,bs as rating,Fn as repeater,_d as slider,$i as taglist,nn as toggle,jc as togglebuttons,Yp as transferlist,au as unit};
|