@formkit/pro 0.127.9 → 0.127.11

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.
Files changed (3) hide show
  1. package/index.cjs +3 -3
  2. package/index.mjs +3 -3
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("@formkit/utils"),t=require("@formkit/core"),o=require("@formkit/inputs");require("@formkit/vue");var n=require("@formkit/drag-and-drop"),r=require("@formkit/tempo");const s=[988,24029,396,13078,980],a=18806588,l=502357,i=16217489;let p=189024;const d=/^[0-9a-f]+$/,c="undefined"!=typeof window,u=_(32,(e=>e)).map((()=>{p|=0,p=p+1831565813|0;let e=p^p>>>15|p;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),f=c?setTimeout:()=>0,v={},h=e=>e.toString(32),m=e=>`${h(u[e]).substring(2)}.${h(s[e%(s.length-1)])}`;const g={},$={},b=new Set(["",null,void 0]);function y(e,t){e in g||(g[e]={timer:0,inputs:new Set});const o=g[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=f((()=>{v[e]||(v[e]=f((()=>b.add(e)),2e3)),function(e){if(c){window.addEventListener([30548127325,27022924,34729821653783].map(h).join("y"),(t=>{if("report"===t.disposition)return;const o=new URL(t.blockedURI).hostname;u.some(((e,t)=>m(t)===o))&&(x(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=h(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(g[e].inputs),p=a.filter((t=>!($[e]&&$[e].has(t)))).join("");if((e=>{clearTimeout(v[e])})(e),p){t++;try{const s=await window[h(i)](`${o}${n}${m((r+t)%u.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${p}`)}`),d=await s.json();if(d[h(l)])return x(e,d.schema);if(s.ok)return $[e]||($[e]=new Set),void a.forEach((t=>$[e].add(t)))}catch(e){}t<2&&f(s,1e4*Math.random())}};s()}}(e)}),500)}function x(e,t){b.add(e),function(e,t){k[e]&&k[e].forEach((e=>e(t)))}(e,t)}function w(e,t,o){if(y(t,o),!t)throw new Error("FormKitNoKey");return b.has(t)?null:e}function _(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const k={};const S=()=>({$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.invalid || 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"}}),L=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),A=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),I=()=>({$el:"ul",if:"$fns.length($messages)"}),D=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),C=()=>({$el:"div",if:"$help"}),T=()=>({$el:null}),E=(e,t)=>()=>o.icon(e,t),O=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),M=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),V=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),P=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),B=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),H=()=>({$el:null,for:["part","$_overlayParts"]});function R(n,r,s,a){return(...l)=>i=>p=>{const d=function(e,n,r,s,a,l){const i=l[r],p="function"==typeof s?s():{$el:s},d=a.map((e=>"string"==typeof e?e:e(n)(l)));let c=d.length&&p?o.extendSchema(p,{children:d}):p;if(c=o.extendSchema(c,i),"object"==typeof c){let o=c;if((t.isDOM(c)||t.isComponent(c))&&(c.meta={...c.meta||{},section:r,node:s}),t.isDOM(c)){const{$el:t,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${r}`,...s.attrs}):s.attrs={class:`$classes.${r}`},o=N(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:w.bind(null,t,n,e)}))}return o}return N(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function N(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 K(e){return(t,o,n=!1)=>R(e,t,o,n)}function W(e){return{outer:e("outer",S,!0),wrapper:e("wrapper","div",!1),inner:e("inner",L,!1),icon:E,label:e("label",A,!1),prefix:e("prefix",T,!1),suffix:e("suffix",T,!1),help:e("help",C,!1),messages:e("messages",I,!1),message:e("message",D,!1)}}function q(e){return{overlayPlaceholder:e("overlayPlaceholder",O),overlayLiteral:e("overlayLiteral",M),overlayChar:e("overlayChar",V),overlayEnum:e("overlayEnum",F),overlay:e("overlay",P),overlayParts:e("overlayParts",H),overlayInner:e("overlayInner",B)}}function U(e,t,n){return r=>s=>{const a="string"==typeof t?t:t(r)(s);return n?{if:e,then:a,else:"string"==typeof n?n:n(r)(s)}:(o.isSlotCondition(a)?Object.assign(a.else,{if:e}):o.isSchemaObject(a)&&Object.assign(a,{if:e}),a)}}function z(n){const r=n("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),s=n("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),a=n("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"}}))),l=n("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"}}))),i=n("loadMoreInner","span"),p=n("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),d=n("emptyMessageInner","span"),c=n("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),u=n("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),f=n("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=n("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),h=n("groupLabel","span"),m=n("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return r(s(p(d("$emptyMessage")),u(U("$option.group",v(h("$option.group"),m(f((n=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),g=a(U("$fns.isSelected($option)",E("selected")),c("$option.label")),r=>{const s=s=>{const a=g(r)(s),l="function"==typeof n?n(r):n;return e.isObject(l)?(o.isSlotCondition(a)&&t.isDOM(a.else)?a.else.attrs={...a.else.attrs,...l}:t.isDOM(a)&&(a.attrs={...a.attrs,...l}),a):a};return s._s=g._s,s})))),a(U("$fns.isSelected($option)",E("selected")),c("$option.label")))),l(U("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",i(U("$state.loading",E("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var n,g}}const Y=/* #__PURE__ */K("dd"),{outer:j,wrapper:Z,inner:G,icon:X,label:J,prefix:Q,suffix:ee,help:te,messages:oe,message:ne}=/* #__PURE__ */W(Y),re=Y("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"}}))),se=Y("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ae=Y("selection",(()=>({$el:"div"}))),le=Y("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'}}}))),ie=Y("optionLoading","span"),pe=Y("option",(()=>({$el:"div"}))),de=Y("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)',onTouchstartPassive:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),ce=Y("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ue=Y("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),fe=Y("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),ve=Y("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 || ""'}))),he=Y("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)"}}))),me=Y("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),ge=Y("tagLabel",(()=>({$el:"span"}))),$e=Y("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),be=Y("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),ye=Y("tagLoading","span"),xe=/* #__PURE__ */z(Y);function we(t){return e.isRecord(t)&&"value"in t&&"label"in t}function _e(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 ke(){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 Se(e){return"__original"in e?e.__original:e.value}const Le=new WeakMap,Ae=new WeakMap;async function Ie(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Ae.get(e));const o=t?e.props.debounce:0;0===o?De(e,n):Ae.set(e,setTimeout((()=>{e.props.page=1,De(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 De(e,t){e.props.allowAppendOptions=t,Ve(e)}const Ce=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Te=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function Ee(e,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const n=o.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=Se(n[0]),e.props.options=e.props.options.concat(n)}(e,n);const r=o.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(Te),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),Le.set(e,e.props.searchValue)}const Oe=new WeakMap;function Me(t,o,n){if(t.store.set(Ce),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let n;n=e.isPojo(o)?{label:"Loading...",value:String(o)}:{label:String(o),value:o},t.props.optionLoaderValues.includes(n.value)||t.props.optionLoaderValues.push(n.value),"transferlist"===t.props.type||t.props.selections.includes(n)||(t.props.selections=[...t.props.selections,n])}const r=t.props.optionLoader(o,n),s=t=>"string"==typeof t?{label:t,value:o}:we(t)?t:e.isRecord(t)?Object.assign({label:String(o),value:o},t):{label:String(o),value:o},a=o=>{const n=t.props.memoOptions.findIndex((t=>e.eq(Se(t),Se(o))));return-1===n?t.props.memoOptions=[...t.props.memoOptions,o]:t.props.memoOptions[n]=o,o};return r instanceof Promise?r.then((e=>{if("string"==typeof e||we(e))return a(s(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--,a(s(r)))}function Ve(e){e.store.set(Ce),e.props.optionsLoadingCounter++,e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Oe.get(e)),r=Ee.bind(null,e),s=n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):(r(n),e.props.optionsLoadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.optionsLoadingCounter--}))}function Fe(e,o){e.props.page++,Oe.set(e,o),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Pe=Symbol(),Be=t=>{const o=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(t),n=t.props.inputStd||[],r=[];for(const t of n){let n,s=o.find((o=>e.eq(Se(o),t)));n=e.isPojo(t)?void 0:Array.isArray(t)?t.join(", "):t,s||(s={value:t,label:n,isPlaceholder:!1,noOptionFound:!0}),r.push(s)}return r};function He(t,o){if(t.props.optionRemoved=!0,o){const n=(t.props.inputStd||[]).filter((t=>!e.eq(Se(o),t)));t.input(n)}else t.input(void 0);t.props.openOnRemove&&!t.props.expanded&&t.isCreated&&(t.props.expanded=!0),setTimeout((()=>{var e;return t.emit("selectRange",[null===(e=t.props.highlightedRange)||void 0===e?void 0:e.option])}),20)}async function Re(e){const t=Be(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:c&&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 Ne(t){var o,n;if(t.props.allOptions&&t.props.allOptions.length)if(null===(o=t.props.highlightedRange)||void 0===o?void 0:o.option.value)t.props.activeValue=Se(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeSelectionValue)));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=Se(t.props.allOptions[0]);else if(t.props.inputStd.length>0&&!t.props.multiple||t.props.multiple&&(null===(n=t.context)||void 0===n?void 0:n.state.dirty))t.props.selections[t.props.selections.length-1]?t.props.activeValue=Se(t.props.selections[t.props.selections.length-1]):t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=Se(t.props.allOptions[0])}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function Ke(e){return e.reduce(((e,t)=>(t.options?e.push(...Ke(t.options)):e.push(t),e)),[])}function We(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(Se(t)!==Pe?(e.props.option=t,e.props.maxReached&&!ze(e,t)||(e.input(qe(e,Se(t))),ze(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function qe(t,o){if(t.props.multiple){const n=Array.isArray(t.value)?t.value:[];for(const r of n)if(e.eq(r,o))return t.props.optionRemoved=!0,n.filter((t=>!e.eq(t,o)));return[...n,o]}return e.eq(o,t.value)&&t.props.deselect?void(t.props.optionRemoved=!0):o}function Ue(t,o){return e.eq(t.props.activeValue,Se(o))||void 0}function ze(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,Se(o)))return!0;return!1}return e.eq(t.value,Se(o))}function Ye(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 je(t){t.props.firstCommit=!0;let o=null;t.on("commit",(()=>{if(0===t.props.inputStd.length&&t.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}(t),void(o=t.props.inputStd);if(t.props.inputStd.length&&"function"==typeof t.props.optionsLoader&&0===t.props.options.length&&"function"!=typeof t.props.optionLoader&&0===t.props.optionsLoadingCounter){t.props.optionsLoaded=!0;const e=Ve(t);e instanceof Promise&&e.then((()=>{Re(t)}))}"function"!=typeof t.props.optionLoader||t.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}(o,t.props.inputStd)?0===t.props.optionsLoadingCounter&&Re(t):(o=t.props.inputStd,async function(t){const o=Be(t),n=t.props.inputStd.length>1?t.props.inputStd.filter((o=>!t.props.memoOptions.find((t=>e.eq(Se(t),o))))):t.props.inputStd;if(n.forEach((n=>{Me(t,n,Array.isArray(o)&&o.find((t=>e.eq(Se(t),n)&&!t.noOptionFound)))})),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",(()=>{Re(t),t.props.optionLoadingCounter||t.off(e)}))}else Re(t)}(t))}))}const Ze=new WeakSet;function Ge(t){if(!c)return;t.props.positionListBox=function(t,o){var n,r;let s=null;if(t.props.activeDescendant){s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o)))),-1===s&&(s=null);(null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant))&&Xe(t)}if("undefined"==typeof window)return s;const a=o.getBoundingClientRect(),l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`);if(l){const e=l.getBoundingClientRect();e.top+e.height+a.height>window.innerHeight&&e.top+e.height>a.height?(t.props.invertPopover=!0,t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,bottom:"auto",top:"100%"})}return s}.bind(null,t),t.props.styleWrapper=Je.bind(null),t.on("mounted",(()=>{e.whenAvailable(`${t.props.id}_popover`,r.bind(null,t),t.props.__root)}));const o=e=>{var o;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_popover`);if(n){const o=n.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}},n=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};function r(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const o=new MutationObserver((o=>{const n=o[0].target;if("overscroll"===e.props.behavior&&n.id!==`${e.props.id}_popover`)return;const r=e.props.positionListBox(t);Ze.delete(e),s(e,r);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)}));o.observe(t,{childList:!0,subtree:!0})}function s(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Ze.has(e))return;const n=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}),[]),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);r&&n.push([r,e.props.loadMoreOption]),Ze.add(e),n.length&&a(e,n,t)}function a(e,t,o){var n,r,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const n=p?p.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.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 s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?e.props.activeValue=Se(s):e.props.activeValue=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)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||Xe(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(r=e.store.loading)||void 0===r?void 0:r.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)),Ze.has(e)?requestAnimationFrame(a.bind(null,e,t,o)):s(e,o)):Ze.delete(e)}t.on("prop:trackHover",(({payload:e})=>{var o,r,s;c&&(e?null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_popover`))||void 0===s||s.removeEventListener("scroll",n):null===(o=t.props.__root)||void 0===o||o.getElementById(`${t.props.id}_popover`))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e||t.props.forceExpanded?"999":"-1",pointerEvents:e?"auto":"none"},e?(document.addEventListener("mousemove",o),t.props.styleWrapper(),Ne(t)):document.removeEventListener("mousemove",o)})),t.on("prop:trackHover",(({payload:e})=>{var o,r;c&&(e?null===(r=document.getElementById(`${t.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",n):null===(o=document.getElementById(`${t.props.id}_popover`))||void 0===o||o.addEventListener("scroll",n))})),t.on("prop:activeValue",(({payload:o})=>{if(o===Pe)return void(t.props.activeDescendant=`${t.props.id}_load_more`);let n,r=-1;for(let s=0;s<t.props.options.length;s++){if("group"in t.props.options[s])for(let a=0;a<t.props.options[s].options.length;a++)if(e.eq(Se(t.props.options[s].options[a]),o)){r=a,n=s;break}if(e.eq(Se(t.props.options[s]),o)){r=s;break}}t.props.activeDescendant=r<0?void 0:void 0===n?`${t.props.id}_listitem_${r}`:`${t.props.id}_listitem_${n}_${r}`}))}function Xe(e){var t,o;if(!c)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 Je(){}const Qe=new WeakMap;function et(t){t.on("created",(()=>{if(!t.context||!c)return;t.context.fns.isActive=Ue.bind(null,t),t.context.fns.isSelected=e=>ze(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(Se(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=dt,t.context.handlers.selectOption=e=>o=>ct.call(null,t,e,o),t.context.handlers.loadMore=De.bind(null,t),t.context.handlers.removeSelection=e=>o=>pt(t,e,o),t.context.handlers.tagTouchstart=e=>o=>pt(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?rt.bind(null,t,e):nt.bind(null,t),t.context.handlers.selectionBlur=()=>st.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,Se(o)),t.context.handlers.tagClick=e=>at.bind(null,t,e),t.context.handlers.tagFocus=e=>lt.bind(null,t,e),t.context.handlers.tagBlur=()=>it.bind(null,t);const o=t.context.handlers.blur;t.context.handlers.blur=function(e,t){var n;if(t&&t.relatedTarget instanceof HTMLElement){const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(o instanceof HTMLElement&&o.contains(t.relatedTarget))return}o(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,t),t.context.handlers.touchmove=tt.bind(null,t),t.context.handlers.touchend=ot.bind(null,t)}))}function tt(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=Qe.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Qe.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function ot(e){Qe.delete(e)}function nt(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 rt(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus()))}function st(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 at(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus())))}function lt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=Se(t),e.props.justFocused=!0)}function it(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 pt(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},He(e,t))}function dt(e){e.stopPropagation()}function ct(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},We(e,t))}function ut(o,n,r,s){!function(o){o.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===o.props.deselect?o.props.deselect=!0:o.props.deselect=e.undefine(o.props.deselect),o.props.option={},o.props.expanded=!1,o.props.inputStd=[],void 0===o.props.draggable?o.props.draggable=!0:"false"===o.props.draggable&&(o.props.draggable=!1),o.props.options||(t.warn(350,{node:o,inputType:o.props.type}),o.props.options=[]),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),o.props.allOptions=Ke(o.props.options),o.props.selections=[],o.props.memoOptions=[],o.props.invertPopover=!1,o.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},o.props.decrementCount=0,o.props.page=1,o.props.loadMoreOption={label:"Load more",value:Pe},o.props.loadOptions=Ve,o.props.listboxStyles={},o.props.optionsLoadingCounter=0,o.props.optionLoadingCounter=0,o.props.searchable=e.undefine(o.props.searchable),o.props.loadOnScroll=e.undefine(o.props.loadOnScroll),o.props.multiple=e.undefine(o.props.multiple)||!1,"taglist"===o.props.type&&(o.props.multiple=!0),o.props.openOnFocus=e.undefine(o.props.openOnFocus),o.props.openOnRemove=void 0!==o.props.openOnRemove&&e.undefine(o.props.openOnRemove),o.props.hasNextPage=Fe.bind(null,o),o.props.initialOptions=[...o.props.options],o.props.optionLoaderValues=[],o.props.loadOnCreated=e.undefine(o.props.loadOnCreated),o.props.max&&"number"!=typeof o.props.max?o.props.max=parseInt(o.props.max):o.props.max&&!o.props.multiple&&(o.props.max=void 0),o.on("mounted",(()=>Ye(o))),o.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ye(o)}),10)))}(s),s.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,Se(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]))))}(s):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(s),o(s),je(s),function(t){t.on("created",(()=>{t.context&&(t.props.trackHover=!0,void 0!==t.props.disabled||t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.emptyMessage||t.props.allowNewValues||0!==t.props.inputStd.length||(t.props.disabledInternally=!0),Ge(t),t.props.loadOnCreated&&!t.props.optionsLoaded&&t.props.optionsLoader?Ve(t):t.props.optionsLoaded&&(t.props.optionsLoaded=!1),t.props.forceExpanded=e.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{t.props.setForceExpanded=!0}),100)))}))}(s),et(s),n(s),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(Te))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Te)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Ke(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),Ne(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(c)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}}(s),r(s)}function ft(t){void 0===t.props.closeOnSelect?t.props.closeOnSelect=!t.props.multiple:t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),(t.props.multiple&&void 0===t.props.selectionAppearance||"truncate"===t.props.selectionAppearance)&&(t.props.selectionAppearance="truncate",t.props.formattedSelections=[]),t.props.multiple?t.props.selectionRemovable=!1:t.props.selectionRemovable=e.undefine(t.props.selectionRemovable)}function vt(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 ht(t,o,n){var r,s,a;if(n.preventDefault(),t.props.trackHover=!1,t.props.expanded){const n=t.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(Se(t)),e}),[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(Pe);let l=-1;t.props.activeValue&&(l=n.findIndex((o=>e.eq(o,t.props.activeValue)))),-1===l&&n.length?t.props.activeValue=n[0]:"ArrowDown"===o&&n.length>l+1?t.props.activeValue=n[l+1]:"ArrowUp"===o&&l>0?t.props.activeValue=n[l-1]:"ArrowUp"===o&&0===l&&(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}_tag-wrapper_${t.props.selections.length-1}`))||void 0===a||a.focus(),t.props.expanded=!1)}else t.props.expanded||"ArrowDown"!==o||(t.props.expanded=!0)}function mt(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=Se(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=Se(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function gt(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 $t(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=ke(),s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o)))),a=[...t.props.selections];"ArrowRight"===n.key?s<t.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,o)):"ArrowLeft"===n.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,o)),t.props.activeSelectionValue=Se(o),t.input([...a.map(Se)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const n=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===n)return;const f="ArrowRight"===u?n+1:n-1;if(f>=t.props.selections.length){if(!r)return t.props.expanded=!0,t.props.activeSelectionValue=void 0,void(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}`))||void 0===a||a.focus());null===(i=null===(l=t.props.__root)||void 0===l?void 0:l.getElementById(`${t.props.id}`))||void 0===i||i.focus()}else if(f<0&&0===n)null===(d=null===(p=t.props.__root)||void 0===p?void 0:p.getElementById(`${t.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=t.props.__root)||void 0===c?void 0:c.getElementById(`${t.props.id}_tag-wrapper_${f}`);v&&v.focus(),t.props.selections[f]?t.props.activeSelectionValue=Se(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function bt(t,o,n){var r;if(!(n.currentTarget instanceof HTMLElement))return;if(t.props.searchValue)return;const s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===s)return;const a=t.props.selections[s+1]?s+1:s-1,l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_tag-wrapper_${a}`);l&&l.focus(),t.props.userAction={type:"tagDelete"},He(t,o)}function yt(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(qe(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}function xt(e){e.props.expanded&&(e.props.expanded=!1)}function wt(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o,!1);break;case"Delete":case"Backspace":bt(e,t,o)}}function _t(t,o,n){if(t.props.disabled)return;switch(n.key){case"ArrowUp":case"ArrowDown":!function(t,o,n){var r,s,a,l;n.preventDefault();const i=n.key,p=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===p)return;const d="ArrowDown"===i?p+1:p-1;if(d<0&&(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus()),d<0||d>=t.props.selections.length)return;const c=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${d}`);c&&c.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[d])||void 0===l?void 0:l.value)||void 0}(t,o,n);break;case"Enter":break;case"Tab":!function(t,o,n){var r,s,a,l;if(o){const i=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===i)return;const p=n.shiftKey?i-1:i+1;if(p>=t.props.selections.length)return;if(p<0)return void(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus());const d=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${p}`);d&&d.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[p])||void 0===l?void 0:l.value)||void 0}}(t,o,n);break;case"Delete":case"Backspace":!function(t,o){var n;if(o){const r=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===r)return;const s=t.props.selections[r+1]?r+1:r-1,a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}_selection_wrapper_${s}`);a&&a.focus(),t.props.selections[s]?t.props.activeSelectionValue=Se(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"}),He(t,o)}(t,o)}}function kt(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":ht(e,o,t);break;case"ArrowLeft":case"ArrowRight":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e);break;default:e.emit("unusedKeydown",t)}}function St(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":ht(e,o,t);break;case"ArrowRight":case"ArrowLeft":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e)}}function Lt(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",(()=>{t.context&&(t.context.handlers.click=At.bind(null,t),t.context.handlers.focus=It.bind(null,t),t.context.handlers.keydown=kt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>wt.bind(null,t,e))}))}function At(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 It(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 Dt(t){let o,n="";t.on("unusedKeydown",(({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!n&&" "===r.key)return void function(t,o){var n;if(o.preventDefault(),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}(t,r);t.props.expanded=!0,clearTimeout(o),n+=r.key;const s=t.props.allOptions.find((e=>e.label.toLowerCase().startsWith(n.toLowerCase())));s&&(t.props.activeValue=Se(s)),o=setTimeout((()=>{n=""}),400)}}))}function Ct(t){Tt(t),t.on("prop:selections",(()=>{t.props.skipFormatSelections=!1,Tt(t)})),c&&e.whenAvailable(`${t.props.id}_selections`,Ot.bind(null,t),t.props.__root)}function Tt(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 Et(e){var t,o;if(!c||!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((()=>{Tt(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,Tt(e)}function Ot(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Et(e))})),n=new ResizeObserver((()=>{Et(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Mt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Vt={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Ft={overflow:"hidden",height:"100%"},Pt={},Bt={};let Ht=0;function Rt(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 Nt(t,o){var n,r;let s=null;if(t.props.activeDescendant){const a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant);if(!a)return s;t.props.ignoreScroll=!0;const l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_listbox`);if(!l)return s;const i=o.getBoundingClientRect(),p=l.getBoundingClientRect(),d=parseInt(getComputedStyle(o).paddingTop),c=parseInt(getComputedStyle(o).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(o.scrollHeight-c-u-i.height,0),h=p.height-f-v;o.scrollTop=u;const m=()=>{o.scrollTop=v>0?v<d?o.scrollHeight:d:f<c?0:u-c},g=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>g?o.scrollTop=u:m();o.clientHeight/2<o.scrollTop&&(s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o))))),-1===s&&(s=null)}return s}function Kt(o){o.addProps(["behavior"]),o.on("created",(()=>{"overscroll"===o.props.behavior&&("function"==typeof o.props.optionsLoader&&t.error(300,[o]),o.props.dropdownWrapperStyles=e.clone(Mt),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Rt.bind(null,o),o.props.positionListBox=Nt.bind(null,o))})),o.on("prop:expanded",(({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Ht=document.documentElement.scrollTop;for(const e in Vt)Bt[e]=document.documentElement.style[e],document.documentElement.style[e]=Vt[e];for(const e in Ft)Pt[e]=document.body.style[e],document.body.style[e]=Ft[e];document.body.scrollTop=Ht}():function(){for(const e in Vt)document.documentElement.style[e]=Bt[e];for(const e in Ft)document.body.style[e]=Pt[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ht}())}))}function Wt(t){t.addProps(["multiLine"]),t.on("created",(()=>{c&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,qt.bind(null,t),t.props.__root))}))}function qt(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),Ut(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 Ut(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 zt(t){if(t.on("created",(()=>{t.context&&Dt(t)})),t.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]}))}(t),"truncate"===t.props.selectionAppearance&&(t.props.lastVisibleIndex=null,Ct(t),t.on("prop:selections",(()=>{Ct(t)}))),"tags"===t.props.selectionAppearance&&Wt(t),t.props.multiple&&"tags"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e,o){t.input(e)}t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(t.context&&e instanceof HTMLElement){const s={threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}t.on("prop:expanded",(({payload:e})=>{e&&t.props.optionsLoader&&"function"==typeof t.props.optionsLoader&&(!t.props.options.length||t.props.alwaysLoadOnOpen)&&(t.props.options=[],Ve(t))})),"overscroll"===t.props.behavior&&Kt(t)}const Yt=(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))}};function jt(t){if(t.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),t.props.popover=e.undefine(t.props.popover)?"manual":void 0,"input"!==t.type||"overscroll"===t.props.behavior)return;let o=null,n=null,r=[],s=null;if(t.props.popoverOffset=e.undefine(t.props.popoverOffset)?parseInt(t.props.popoverOffset):0,!t.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void("undefined"!=typeof window&&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 a=()=>{t.props.invertPopover=!1,document.removeEventListener("resize",s),document.removeEventListener("scroll",s),r.forEach((e=>{e.removeEventListener("scroll",s)}))};function l(){const{x:e,y:r,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}}(o,n);t.props.popoverAncestorCoordinates={x:e,y:r,width:s,height:a},t.props.popoverCoordinates={x:e,y:r,width:s,height:0}}function i(e){o&&document.body.contains(o)&&(e?(null==o||o.showPopover(),setTimeout((()=>{t.props.popoverCoordinates.height=(null==o?void 0:o.offsetHeight)||0}),5)):o.matches(":popover-open")&&(o.hidePopover(),t.props.popoverCoordinates.height=0))}t.on("mounted",(()=>{t.context&&(t.props.usePopover=!0,t.props.popoverCoordinates={x:0,y:0,width:0,height:0},t.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),t.on("destroyed",(()=>{a()})),t.on("prop:inputText",(()=>{t.context&&(l(),i(!0))})),t.on("prop:expanded",(({payload:p})=>{var d;t.context&&(!1===p?a():e.whenAvailable(`${null===(d=t.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!t.context)return;o=document.querySelector(`[id="${t.context.id}_popover"][popover]`)||document.querySelector(`[id="${t.context.id}_popover"] [popover]`),n||(n=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(o)),l(),i(p),s=Yt((()=>{t.context&&(l(),i(p))}),10),document.addEventListener("resize",s),document.addEventListener("scroll",s),r=[];let e=null==o?void 0:o.parentElement;for(;e;)e.scrollHeight>e.clientHeight&&r.push(e),e=e.parentElement;r.forEach((e=>{e.addEventListener("scroll",s)}))})))}))}const Zt={schema:/* #__PURE__ */j(/* #__PURE__ */Z(/* #__PURE__ */J("$label"),/* #__PURE__ */G(/* #__PURE__ */X("prefix"),/* #__PURE__ */Q(),/* #__PURE__ */re(/* #__PURE__ */U("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */le('$placeholder || "placeholder"'),/* #__PURE__ */U("$multiple !== true",/* #__PURE__ */se(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ae(/* #__PURE__ */pe("$option.label")))),/* #__PURE__ */U('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */ce(/* #__PURE__ */ue(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ve()))),/* #__PURE__ */U('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */$e(/* #__PURE__ */be(/* #__PURE__ */U("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */he(/* #__PURE__ */me(/* #__PURE__ */U("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */ye("$ui.isLoading.value"),/* #__PURE__ */ge("$option.label")),/* #__PURE__ */de(/* #__PURE__ */X("close"))))))))))),/* #__PURE__ */U("$truncationCount && $state.loading !== true",/* #__PURE__ */fe("$truncationCount")),/* #__PURE__ */U("$state.loading",/* #__PURE__ */X("loader")),/* #__PURE__ */U("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */de(/* #__PURE__ */X("close")),/* #__PURE__ */X("select"))),/* #__PURE__ */xe(),/* #__PURE__ */ee(),/* #__PURE__ */X("suffix"))),/* #__PURE__ */te("$help"),/* #__PURE__ */oe(/* #__PURE__ */ne("$message.value"))),type:"input",family:"dropdown",props:[],features:[
1
+ "use strict";var e=require("@formkit/utils"),t=require("@formkit/core"),o=require("@formkit/inputs");require("@formkit/vue");var n=require("@formkit/drag-and-drop"),r=require("@formkit/tempo");const s=[988,24029,396,13078,980],a=18806588,l=502357,i=16217489;let p=189024;const d=/^[0-9a-f]+$/,c="undefined"!=typeof window,u=_(32,(e=>e)).map((()=>{p|=0,p=p+1831565813|0;let e=p^p>>>15|p;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),f=c?setTimeout:()=>0,v={},h=e=>e.toString(32),m=e=>`${h(u[e]).substring(2)}.${h(s[e%(s.length-1)])}`;const g={},$={},b=new Set(["",null,void 0]);function y(e,t){e in g||(g[e]={timer:0,inputs:new Set});const o=g[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=f((()=>{v[e]||(v[e]=f((()=>b.add(e)),2e3)),function(e){if(c){window.addEventListener([30548127325,27022924,34729821653783].map(h).join("y"),(t=>{if("report"===t.disposition)return;const o=new URL(t.blockedURI).hostname;u.some(((e,t)=>m(t)===o))&&(x(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=h(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(g[e].inputs),p=a.filter((t=>!($[e]&&$[e].has(t)))).join("");if((e=>{clearTimeout(v[e])})(e),p){t++;try{const s=await window[h(i)](`${o}${n}${m((r+t)%u.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${p}`)}`),d=await s.json();if(d[h(l)])return x(e,d.schema);if(s.ok)return $[e]||($[e]=new Set),void a.forEach((t=>$[e].add(t)))}catch(e){}t<2&&f(s,1e4*Math.random())}};s()}}(e)}),500)}function x(e,t){b.add(e),function(e,t){k[e]&&k[e].forEach((e=>e(t)))}(e,t)}function w(e,t,o){if(y(t,o),!t)throw new Error("FormKitNoKey");return b.has(t)?null:e}function _(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const k={};const S=()=>({$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.invalid || 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"}}),L=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),A=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),I=()=>({$el:"ul",if:"$fns.length($messages)"}),D=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),C=()=>({$el:"div",if:"$help"}),T=()=>({$el:null}),E=(e,t)=>()=>o.icon(e,t),O=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),M=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),V=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),P=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),B=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),H=()=>({$el:null,for:["part","$_overlayParts"]});function R(n,r,s,a){return(...l)=>i=>p=>{const d=function(e,n,r,s,a,l){const i=l[r],p="function"==typeof s?s():{$el:s},d=a.map((e=>"string"==typeof e?e:e(n)(l)));let c=d.length&&p?o.extendSchema(p,{children:d}):p;if(c=o.extendSchema(c,i),"object"==typeof c){let o=c;if((t.isDOM(c)||t.isComponent(c))&&(c.meta={...c.meta||{},section:r,node:s}),t.isDOM(c)){const{$el:t,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${r}`,...s.attrs}):s.attrs={class:`$classes.${r}`},o=N(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:w.bind(null,t,n,e)}))}return o}return N(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function N(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 K(e){return(t,o,n=!1)=>R(e,t,o,n)}function W(e){return{outer:e("outer",S,!0),wrapper:e("wrapper","div",!1),inner:e("inner",L,!1),icon:E,label:e("label",A,!1),prefix:e("prefix",T,!1),suffix:e("suffix",T,!1),help:e("help",C,!1),messages:e("messages",I,!1),message:e("message",D,!1)}}function q(e){return{overlayPlaceholder:e("overlayPlaceholder",O),overlayLiteral:e("overlayLiteral",M),overlayChar:e("overlayChar",V),overlayEnum:e("overlayEnum",F),overlay:e("overlay",P),overlayParts:e("overlayParts",H),overlayInner:e("overlayInner",B)}}function U(e,t,n){return r=>s=>{const a="string"==typeof t?t:t(r)(s);return n?{if:e,then:a,else:"string"==typeof n?n:n(r)(s)}:(o.isSlotCondition(a)?Object.assign(a.else,{if:e}):o.isSchemaObject(a)&&Object.assign(a,{if:e}),a)}}function z(n){const r=n("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),s=n("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),a=n("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"}}))),l=n("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"}}))),i=n("loadMoreInner","span"),p=n("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),d=n("emptyMessageInner","span"),c=n("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),u=n("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),f=n("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=n("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),h=n("groupLabel","span"),m=n("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return r(s(p(d("$emptyMessage")),u(U("$option.group",v(h("$option.group"),m(f((n=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),g=a(U("$fns.isSelected($option)",E("selected")),c("$option.label")),r=>{const s=s=>{const a=g(r)(s),l="function"==typeof n?n(r):n;return e.isObject(l)?(o.isSlotCondition(a)&&t.isDOM(a.else)?a.else.attrs={...a.else.attrs,...l}:t.isDOM(a)&&(a.attrs={...a.attrs,...l}),a):a};return s._s=g._s,s})))),a(U("$fns.isSelected($option)",E("selected")),c("$option.label")))),l(U("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",i(U("$state.loading",E("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var n,g}}const Y=/* #__PURE__ */K("dd"),{outer:j,wrapper:Z,inner:G,icon:X,label:J,prefix:Q,suffix:ee,help:te,messages:oe,message:ne}=/* #__PURE__ */W(Y),re=Y("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"}}))),se=Y("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ae=Y("selection",(()=>({$el:"div"}))),le=Y("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'}}}))),ie=Y("optionLoading","span"),pe=Y("option",(()=>({$el:"div"}))),de=Y("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)',onTouchstartPassive:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),ce=Y("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ue=Y("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),fe=Y("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),ve=Y("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 || ""'}))),he=Y("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)"}}))),me=Y("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),ge=Y("tagLabel",(()=>({$el:"span"}))),$e=Y("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),be=Y("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),ye=Y("tagLoading","span"),xe=/* #__PURE__ */z(Y);function we(t){return e.isRecord(t)&&"value"in t&&"label"in t}function _e(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 ke(){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 Se(e){return"__original"in e?e.__original:e.value}const Le=new WeakMap,Ae=new WeakMap;async function Ie(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Ae.get(e));const o=t?e.props.debounce:0;0===o?De(e,n):Ae.set(e,setTimeout((()=>{e.props.page=1,De(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 De(e,t){e.props.allowAppendOptions=t,Ve(e)}const Ce=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Te=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function Ee(e,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const n=o.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=Se(n[0]),e.props.options=e.props.options.concat(n)}(e,n);const r=o.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(Te),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),Le.set(e,e.props.searchValue)}const Oe=new WeakMap;function Me(t,o,n){if(t.store.set(Ce),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let n;n=e.isPojo(o)?{label:"Loading...",value:String(o)}:{label:String(o),value:o},t.props.optionLoaderValues.includes(n.value)||t.props.optionLoaderValues.push(n.value),"transferlist"===t.props.type||t.props.selections.includes(n)||(t.props.selections=[...t.props.selections,n])}const r=t.props.optionLoader(o,n),s=t=>"string"==typeof t?{label:t,value:o}:we(t)?t:e.isRecord(t)?Object.assign({label:String(o),value:o},t):{label:String(o),value:o},a=o=>{const n=t.props.memoOptions.findIndex((t=>e.eq(Se(t),Se(o))));return-1===n?t.props.memoOptions=[...t.props.memoOptions,o]:t.props.memoOptions[n]=o,o};return r instanceof Promise?r.then((e=>{if("string"==typeof e||we(e))return a(s(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--,a(s(r)))}function Ve(e){e.store.set(Ce),e.props.optionsLoadingCounter++,e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Oe.get(e)),r=Ee.bind(null,e),s=n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):(r(n),e.props.optionsLoadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.optionsLoadingCounter--}))}function Fe(e,o){e.props.page++,Oe.set(e,o),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Pe=Symbol(),Be=t=>{const o=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(t),n=t.props.inputStd||[],r=[];for(const t of n){let n,s=o.find((o=>e.eq(Se(o),t)));n=e.isPojo(t)?void 0:Array.isArray(t)?t.join(", "):t,s||(s={value:t,label:n,isPlaceholder:!1,noOptionFound:!0}),r.push(s)}return r};function He(t,o){if(t.props.optionRemoved=!0,o){const n=(t.props.inputStd||[]).filter((t=>!e.eq(Se(o),t)));t.input(n)}else t.input(void 0);t.props.openOnRemove&&!t.props.expanded&&t.isCreated&&(t.props.expanded=!0),setTimeout((()=>{var e;return t.emit("selectRange",[null===(e=t.props.highlightedRange)||void 0===e?void 0:e.option])}),20)}async function Re(e){const t=Be(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:c&&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 Ne(t){var o,n;if(t.props.allOptions&&t.props.allOptions.length)if(null===(o=t.props.highlightedRange)||void 0===o?void 0:o.option.value)t.props.activeValue=Se(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeSelectionValue)));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=Se(t.props.allOptions[0]);else if(t.props.inputStd.length>0&&!t.props.multiple||t.props.multiple&&(null===(n=t.context)||void 0===n?void 0:n.state.dirty))t.props.selections[t.props.selections.length-1]?t.props.activeValue=Se(t.props.selections[t.props.selections.length-1]):t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=Se(function(e){return e.props.allOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}(t))}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function Ke(e){return e.reduce(((e,t)=>(t.options?e.push(...Ke(t.options)):e.push(t),e)),[])}function We(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(Se(t)!==Pe?(e.props.option=t,e.props.maxReached&&!ze(e,t)||(e.input(qe(e,Se(t))),ze(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function qe(t,o){if(t.props.multiple){const n=Array.isArray(t.value)?t.value:[];for(const r of n)if(e.eq(r,o))return t.props.optionRemoved=!0,n.filter((t=>!e.eq(t,o)));return[...n,o]}return e.eq(o,t.value)&&t.props.deselect?void(t.props.optionRemoved=!0):o}function Ue(t,o){return e.eq(t.props.activeValue,Se(o))||void 0}function ze(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,Se(o)))return!0;return!1}return e.eq(t.value,Se(o))}function Ye(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 je(t){t.props.firstCommit=!0;let o=null;t.on("commit",(()=>{if(0===t.props.inputStd.length&&t.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}(t),void(o=t.props.inputStd);if(t.props.inputStd.length&&"function"==typeof t.props.optionsLoader&&0===t.props.options.length&&"function"!=typeof t.props.optionLoader&&0===t.props.optionsLoadingCounter){t.props.optionsLoaded=!0;const e=Ve(t);e instanceof Promise&&e.then((()=>{Re(t)}))}"function"!=typeof t.props.optionLoader||t.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}(o,t.props.inputStd)?0===t.props.optionsLoadingCounter&&Re(t):(o=t.props.inputStd,async function(t){const o=Be(t),n=t.props.inputStd.length>1?t.props.inputStd.filter((o=>!t.props.memoOptions.find((t=>e.eq(Se(t),o))))):t.props.inputStd;if(n.forEach((n=>{Me(t,n,Array.isArray(o)&&o.find((t=>e.eq(Se(t),n)&&!t.noOptionFound)))})),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",(()=>{Re(t),t.props.optionLoadingCounter||t.off(e)}))}else Re(t)}(t))}))}const Ze=new WeakSet;function Ge(t){if(!c)return;t.props.positionListBox=function(t,o){var n,r;let s=null;if(t.props.activeDescendant){s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o)))),-1===s&&(s=null);(null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant))&&Xe(t)}if("undefined"==typeof window)return s;const a=o.getBoundingClientRect(),l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`);if(l){const e=l.getBoundingClientRect();e.top+e.height+a.height>window.innerHeight&&e.top+e.height>a.height?(t.props.invertPopover=!0,t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,bottom:"auto",top:"100%"})}return s}.bind(null,t),t.props.styleWrapper=Je.bind(null),t.on("mounted",(()=>{e.whenAvailable(`${t.props.id}_popover`,r.bind(null,t),t.props.__root)}));const o=e=>{var o;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_popover`);if(n){const o=n.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}},n=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};function r(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const o=new MutationObserver((o=>{const n=o[0].target;if("overscroll"===e.props.behavior&&n.id!==`${e.props.id}_popover`)return;const r=e.props.positionListBox(t);Ze.delete(e),s(e,r);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)}));o.observe(t,{childList:!0,subtree:!0})}function s(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Ze.has(e))return;const n=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}),[]),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);r&&n.push([r,e.props.loadMoreOption]),Ze.add(e),n.length&&a(e,n,t)}function a(e,t,o){var n,r,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const n=p?p.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.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 s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?e.props.activeValue=Se(s):e.props.activeValue=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)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||Xe(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(r=e.store.loading)||void 0===r?void 0:r.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)),Ze.has(e)?requestAnimationFrame(a.bind(null,e,t,o)):s(e,o)):Ze.delete(e)}t.on("prop:trackHover",(({payload:e})=>{var o,r,s;c&&(e?null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_popover`))||void 0===s||s.removeEventListener("scroll",n):null===(o=t.props.__root)||void 0===o||o.getElementById(`${t.props.id}_popover`))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e||t.props.forceExpanded?"999":"-1",pointerEvents:e?"auto":"none"},e?(document.addEventListener("mousemove",o),t.props.styleWrapper(),Ne(t)):document.removeEventListener("mousemove",o)})),t.on("prop:trackHover",(({payload:e})=>{var o,r;c&&(e?null===(r=document.getElementById(`${t.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",n):null===(o=document.getElementById(`${t.props.id}_popover`))||void 0===o||o.addEventListener("scroll",n))})),t.on("prop:activeValue",(({payload:o})=>{if(o===Pe)return void(t.props.activeDescendant=`${t.props.id}_load_more`);let n,r=-1;for(let s=0;s<t.props.options.length;s++){if("group"in t.props.options[s])for(let a=0;a<t.props.options[s].options.length;a++)if(e.eq(Se(t.props.options[s].options[a]),o)){r=a,n=s;break}if(e.eq(Se(t.props.options[s]),o)){r=s;break}}t.props.activeDescendant=r<0?void 0:void 0===n?`${t.props.id}_listitem_${r}`:`${t.props.id}_listitem_${n}_${r}`}))}function Xe(e){var t,o;if(!c)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 Je(){}const Qe=new WeakMap;function et(t){t.on("created",(()=>{if(!t.context||!c)return;t.context.fns.isActive=Ue.bind(null,t),t.context.fns.isSelected=e=>ze(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(Se(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=dt,t.context.handlers.selectOption=e=>o=>ct.call(null,t,e,o),t.context.handlers.loadMore=De.bind(null,t),t.context.handlers.removeSelection=e=>o=>pt(t,e,o),t.context.handlers.tagTouchstart=e=>o=>pt(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?rt.bind(null,t,e):nt.bind(null,t),t.context.handlers.selectionBlur=()=>st.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,Se(o)),t.context.handlers.tagClick=e=>at.bind(null,t,e),t.context.handlers.tagFocus=e=>lt.bind(null,t,e),t.context.handlers.tagBlur=()=>it.bind(null,t);const o=t.context.handlers.blur;t.context.handlers.blur=function(e,t){var n;if(t&&t.relatedTarget instanceof HTMLElement){const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(o instanceof HTMLElement&&o.contains(t.relatedTarget))return}o(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,t),t.context.handlers.touchmove=tt.bind(null,t),t.context.handlers.touchend=ot.bind(null,t)}))}function tt(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=Qe.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Qe.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function ot(e){Qe.delete(e)}function nt(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 rt(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus()))}function st(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 at(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus())))}function lt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=Se(t),e.props.justFocused=!0)}function it(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 pt(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},He(e,t))}function dt(e){e.stopPropagation()}function ct(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},We(e,t))}function ut(o,n,r,s){!function(o){o.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===o.props.deselect?o.props.deselect=!0:o.props.deselect=e.undefine(o.props.deselect),o.props.option={},o.props.expanded=!1,o.props.inputStd=[],void 0===o.props.draggable?o.props.draggable=!0:"false"===o.props.draggable&&(o.props.draggable=!1),o.props.options||(t.warn(350,{node:o,inputType:o.props.type}),o.props.options=[]),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),o.props.allOptions=Ke(o.props.options),o.props.selections=[],o.props.memoOptions=[],o.props.invertPopover=!1,o.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},o.props.decrementCount=0,o.props.page=1,o.props.loadMoreOption={label:"Load more",value:Pe},o.props.loadOptions=Ve,o.props.listboxStyles={},o.props.optionsLoadingCounter=0,o.props.optionLoadingCounter=0,o.props.searchable=e.undefine(o.props.searchable),o.props.loadOnScroll=e.undefine(o.props.loadOnScroll),o.props.multiple=e.undefine(o.props.multiple)||!1,"taglist"===o.props.type&&(o.props.multiple=!0),o.props.openOnFocus=e.undefine(o.props.openOnFocus),o.props.openOnRemove=void 0!==o.props.openOnRemove&&e.undefine(o.props.openOnRemove),o.props.hasNextPage=Fe.bind(null,o),o.props.initialOptions=[...o.props.options],o.props.optionLoaderValues=[],o.props.loadOnCreated=e.undefine(o.props.loadOnCreated),o.props.max&&"number"!=typeof o.props.max?o.props.max=parseInt(o.props.max):o.props.max&&!o.props.multiple&&(o.props.max=void 0),o.on("mounted",(()=>Ye(o))),o.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ye(o)}),10)))}(s),s.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,Se(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]))))}(s):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(s),o(s),je(s),function(t){t.on("created",(()=>{t.context&&(t.props.trackHover=!0,void 0!==t.props.disabled||t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.emptyMessage||t.props.allowNewValues||0!==t.props.inputStd.length||(t.props.disabledInternally=!0),Ge(t),t.props.loadOnCreated&&!t.props.optionsLoaded&&t.props.optionsLoader?Ve(t):t.props.optionsLoaded&&(t.props.optionsLoaded=!1),t.props.forceExpanded=e.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{t.props.setForceExpanded=!0}),100)))}))}(s),et(s),n(s),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(Te))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Te)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Ke(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),Ne(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(c)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}}(s),r(s)}function ft(t){void 0===t.props.closeOnSelect?t.props.closeOnSelect=!t.props.multiple:t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),(t.props.multiple&&void 0===t.props.selectionAppearance||"truncate"===t.props.selectionAppearance)&&(t.props.selectionAppearance="truncate",t.props.formattedSelections=[]),t.props.multiple?t.props.selectionRemovable=!1:t.props.selectionRemovable=e.undefine(t.props.selectionRemovable)}function vt(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 ht(t,o,n){var r,s,a;if(n.preventDefault(),t.props.trackHover=!1,t.props.expanded){const n=t.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(Se(t)),e}),[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(Pe);let l=-1;t.props.activeValue&&(l=n.findIndex((o=>e.eq(o,t.props.activeValue)))),-1===l&&n.length?t.props.activeValue=n[0]:"ArrowDown"===o&&n.length>l+1?t.props.activeValue=n[l+1]:"ArrowUp"===o&&l>0?t.props.activeValue=n[l-1]:"ArrowUp"===o&&0===l&&(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}_tag-wrapper_${t.props.selections.length-1}`))||void 0===a||a.focus(),t.props.expanded=!1)}else t.props.expanded||"ArrowDown"!==o||(t.props.expanded=!0)}function mt(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=Se(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=Se(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function gt(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 $t(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=ke(),s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o)))),a=[...t.props.selections];"ArrowRight"===n.key?s<t.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,o)):"ArrowLeft"===n.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,o)),t.props.activeSelectionValue=Se(o),t.input([...a.map(Se)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const n=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===n)return;const f="ArrowRight"===u?n+1:n-1;if(f>=t.props.selections.length){if(!r)return t.props.expanded=!0,t.props.activeSelectionValue=void 0,void(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}`))||void 0===a||a.focus());null===(i=null===(l=t.props.__root)||void 0===l?void 0:l.getElementById(`${t.props.id}`))||void 0===i||i.focus()}else if(f<0&&0===n)null===(d=null===(p=t.props.__root)||void 0===p?void 0:p.getElementById(`${t.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=t.props.__root)||void 0===c?void 0:c.getElementById(`${t.props.id}_tag-wrapper_${f}`);v&&v.focus(),t.props.selections[f]?t.props.activeSelectionValue=Se(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function bt(t,o,n){var r;if(!(n.currentTarget instanceof HTMLElement))return;if(t.props.searchValue)return;const s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===s)return;const a=t.props.selections[s+1]?s+1:s-1,l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_tag-wrapper_${a}`);l&&l.focus(),t.props.userAction={type:"tagDelete"},He(t,o)}function yt(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(qe(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}function xt(e){e.props.expanded&&(e.props.expanded=!1)}function wt(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o,!1);break;case"Delete":case"Backspace":bt(e,t,o)}}function _t(t,o,n){if(t.props.disabled)return;switch(n.key){case"ArrowUp":case"ArrowDown":!function(t,o,n){var r,s,a,l;n.preventDefault();const i=n.key,p=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===p)return;const d="ArrowDown"===i?p+1:p-1;if(d<0&&(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus()),d<0||d>=t.props.selections.length)return;const c=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${d}`);c&&c.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[d])||void 0===l?void 0:l.value)||void 0}(t,o,n);break;case"Enter":break;case"Tab":!function(t,o,n){var r,s,a,l;if(o){const i=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===i)return;const p=n.shiftKey?i-1:i+1;if(p>=t.props.selections.length)return;if(p<0)return void(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus());const d=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${p}`);d&&d.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[p])||void 0===l?void 0:l.value)||void 0}}(t,o,n);break;case"Delete":case"Backspace":!function(t,o){var n;if(o){const r=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===r)return;const s=t.props.selections[r+1]?r+1:r-1,a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}_selection_wrapper_${s}`);a&&a.focus(),t.props.selections[s]?t.props.activeSelectionValue=Se(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"}),He(t,o)}(t,o)}}function kt(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":ht(e,o,t);break;case"ArrowLeft":case"ArrowRight":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e);break;default:e.emit("unusedKeydown",t)}}function St(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":ht(e,o,t);break;case"ArrowRight":case"ArrowLeft":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e)}}function Lt(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",(()=>{t.context&&(t.context.handlers.click=At.bind(null,t),t.context.handlers.focus=It.bind(null,t),t.context.handlers.keydown=kt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>wt.bind(null,t,e))}))}function At(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 It(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 Dt(t){let o,n="";t.on("unusedKeydown",(({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!n&&" "===r.key)return void function(t,o){var n;if(o.preventDefault(),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}(t,r);t.props.expanded=!0,clearTimeout(o),n+=r.key;const s=t.props.allOptions.find((e=>e.label.toLowerCase().startsWith(n.toLowerCase())));s&&(t.props.activeValue=Se(s)),o=setTimeout((()=>{n=""}),400)}}))}function Ct(t){Tt(t),t.on("prop:selections",(()=>{t.props.skipFormatSelections=!1,Tt(t)})),c&&e.whenAvailable(`${t.props.id}_selections`,Ot.bind(null,t),t.props.__root)}function Tt(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 Et(e){var t,o;if(!c||!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((()=>{Tt(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,Tt(e)}function Ot(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Et(e))})),n=new ResizeObserver((()=>{Et(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Mt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Vt={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Ft={overflow:"hidden",height:"100%"},Pt={},Bt={};let Ht=0;function Rt(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 Nt(t,o){var n,r;let s=null;if(t.props.activeDescendant){const a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant);if(!a)return s;t.props.ignoreScroll=!0;const l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_listbox`);if(!l)return s;const i=o.getBoundingClientRect(),p=l.getBoundingClientRect(),d=parseInt(getComputedStyle(o).paddingTop),c=parseInt(getComputedStyle(o).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(o.scrollHeight-c-u-i.height,0),h=p.height-f-v;o.scrollTop=u;const m=()=>{o.scrollTop=v>0?v<d?o.scrollHeight:d:f<c?0:u-c},g=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>g?o.scrollTop=u:m();o.clientHeight/2<o.scrollTop&&(s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o))))),-1===s&&(s=null)}return s}function Kt(o){o.addProps(["behavior"]),o.on("created",(()=>{"overscroll"===o.props.behavior&&("function"==typeof o.props.optionsLoader&&t.error(300,[o]),o.props.dropdownWrapperStyles=e.clone(Mt),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Rt.bind(null,o),o.props.positionListBox=Nt.bind(null,o))})),o.on("prop:expanded",(({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Ht=document.documentElement.scrollTop;for(const e in Vt)Bt[e]=document.documentElement.style[e],document.documentElement.style[e]=Vt[e];for(const e in Ft)Pt[e]=document.body.style[e],document.body.style[e]=Ft[e];document.body.scrollTop=Ht}():function(){for(const e in Vt)document.documentElement.style[e]=Bt[e];for(const e in Ft)document.body.style[e]=Pt[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ht}())}))}function Wt(t){t.addProps(["multiLine"]),t.on("created",(()=>{c&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,qt.bind(null,t),t.props.__root))}))}function qt(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),Ut(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 Ut(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 zt(t){if(t.on("created",(()=>{t.context&&Dt(t)})),t.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]}))}(t),"truncate"===t.props.selectionAppearance&&(t.props.lastVisibleIndex=null,Ct(t),t.on("prop:selections",(()=>{Ct(t)}))),"tags"===t.props.selectionAppearance&&Wt(t),t.props.multiple&&"tags"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e,o){t.input(e)}t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(t.context&&e instanceof HTMLElement){const s={threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}t.on("prop:expanded",(({payload:e})=>{e&&t.props.optionsLoader&&"function"==typeof t.props.optionsLoader&&(!t.props.options.length||t.props.alwaysLoadOnOpen)&&(t.props.options=[],Ve(t))})),"overscroll"===t.props.behavior&&Kt(t)}const Yt=(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))}};function jt(t){if(t.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),t.props.popover=e.undefine(t.props.popover)?"manual":void 0,"input"!==t.type||"overscroll"===t.props.behavior)return;let o=null,n=null,r=[],s=null;if(t.props.popoverOffset=e.undefine(t.props.popoverOffset)?parseInt(t.props.popoverOffset):0,!t.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void("undefined"!=typeof window&&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 a=()=>{t.props.invertPopover=!1,document.removeEventListener("resize",s),document.removeEventListener("scroll",s),r.forEach((e=>{e.removeEventListener("scroll",s)}))};function l(){const{x:e,y:r,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}}(o,n);t.props.popoverAncestorCoordinates={x:e,y:r,width:s,height:a},t.props.popoverCoordinates={x:e,y:r,width:s,height:0}}function i(e){o&&document.body.contains(o)&&(e?(null==o||o.showPopover(),setTimeout((()=>{t.props.popoverCoordinates.height=(null==o?void 0:o.offsetHeight)||0}),5)):o.matches(":popover-open")&&(o.hidePopover(),t.props.popoverCoordinates.height=0))}t.on("mounted",(()=>{t.context&&(t.props.usePopover=!0,t.props.popoverCoordinates={x:0,y:0,width:0,height:0},t.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),t.on("destroyed",(()=>{a()})),t.on("prop:inputText",(()=>{t.context&&(l(),i(!0))})),t.on("prop:expanded",(({payload:p})=>{var d;t.context&&(!1===p?a():e.whenAvailable(`${null===(d=t.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!t.context)return;o=document.querySelector(`[id="${t.context.id}_popover"][popover]`)||document.querySelector(`[id="${t.context.id}_popover"] [popover]`),n||(n=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(o)),l(),i(p),s=Yt((()=>{t.context&&(l(),i(p))}),10),document.addEventListener("resize",s),document.addEventListener("scroll",s),r=[];let e=null==o?void 0:o.parentElement;for(;e;)e.scrollHeight>e.clientHeight&&r.push(e),e=e.parentElement;r.forEach((e=>{e.addEventListener("scroll",s)}))})))}))}const Zt={schema:/* #__PURE__ */j(/* #__PURE__ */Z(/* #__PURE__ */J("$label"),/* #__PURE__ */G(/* #__PURE__ */X("prefix"),/* #__PURE__ */Q(),/* #__PURE__ */re(/* #__PURE__ */U("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */le('$placeholder || "placeholder"'),/* #__PURE__ */U("$multiple !== true",/* #__PURE__ */se(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ae(/* #__PURE__ */pe("$option.label")))),/* #__PURE__ */U('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */ce(/* #__PURE__ */ue(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ve()))),/* #__PURE__ */U('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */$e(/* #__PURE__ */be(/* #__PURE__ */U("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */he(/* #__PURE__ */me(/* #__PURE__ */U("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */ye("$ui.isLoading.value"),/* #__PURE__ */ge("$option.label")),/* #__PURE__ */de(/* #__PURE__ */X("close"))))))))))),/* #__PURE__ */U("$truncationCount && $state.loading !== true",/* #__PURE__ */fe("$truncationCount")),/* #__PURE__ */U("$state.loading",/* #__PURE__ */X("loader")),/* #__PURE__ */U("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */de(/* #__PURE__ */X("close")),/* #__PURE__ */X("select"))),/* #__PURE__ */xe(),/* #__PURE__ */ee(),/* #__PURE__ */X("suffix"))),/* #__PURE__ */te("$help"),/* #__PURE__ */oe(/* #__PURE__ */ne("$message.value"))),type:"input",family:"dropdown",props:[],features:[
2
2
  /* #__PURE__ */o.defaultIcon("select","select"),
3
3
  /* #__PURE__ */o.defaultIcon("close","close"),
4
4
  /* #__PURE__ */o.defaultIcon("selected","check"),
@@ -16,7 +16,7 @@
16
16
  /* #__PURE__ */o.defaultIcon("remove","trash"),
17
17
  /* #__PURE__ */o.defaultIcon("add","add"),
18
18
  /* #__PURE__ */o.defaultIcon("moveUp","arrowUp"),
19
- /* #__PURE__ */o.defaultIcon("moveDown","arrowDown")]},Zo=new WeakMap;function Go(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 Xo(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function Jo(e,t){const{x:o,y:n}=ln(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 Qo(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?pn(e,t,o):e.input(t+1,!1))}function en(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Go(e);const o=Zo.get(e);o&&(o.abort(),Zo.delete(e))}function tn(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=>en(e,t)),{signal:n.signal}),Zo.set(e,n),1===e.props.step?e.input(t+1,!1):pn(e,t,o)}function on(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?dn(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?dn(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 nn(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 rn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Go(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):pn(e,t,o,!!e.props.dragStarted)))}function sn(e){Go(e)}function an(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 pn(e,t,o)}function ln(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function pn(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=ln(o),a=o.currentTarget.getBoundingClientRect();let l=dn((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):Go(e,l):e.input(0)}function dn(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const cn=/* #__PURE__ */K("rt"),{outer:un,wrapper:fn,inner:vn,label:hn,prefix:mn,suffix:gn,help:$n,messages:bn,message:yn,icon:xn}=/* #__PURE__ */W(cn),wn=cn("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"}}))),_n=cn("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",onTouchstartPassive:"$handlers.handleTouchstart($item)",onTouchmovePassive:"$handlers.handleTouchmove"}}))),kn=cn("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),Sn=cn("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%"'}}}))),Ln=cn("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),An=cn("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))"}}))),In=cn("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),Dn=cn("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"}}}))),Cn=cn("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),Tn=cn("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),En=()=>U("$slots.onItem",(()=>()=>"$slots.onItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),On=()=>U("$slots.offItem",(()=>()=>"$slots.offItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),Mn={schema:/* #__PURE__ */un(/* #__PURE__ */fn(/* #__PURE__ */hn("$label"),/* #__PURE__ */vn(/* #__PURE__ */xn("prefix"),/* #__PURE__ */mn(),/* #__PURE__ */wn(/* #__PURE__ */_n(/* #__PURE__ */kn(/* #__PURE__ */Sn(/* #__PURE__ */In(/* #__PURE__ */Cn(/* #__PURE__ */En())),/* #__PURE__ */Dn(/* #__PURE__ */Tn(/* #__PURE__ */On())),/* #__PURE__ */Ln()),/* #__PURE__ */An()))),/* #__PURE__ */gn(),/* #__PURE__ */xn("suffix"))),/* #__PURE__ */$n("$help"),/* #__PURE__ */bn(/* #__PURE__ */yn("$message.value"))),type:"input",props:[],features:[function(t){function o(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`}}))}t.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==t.props.hoverHighlight&&"false"!==t.props.hoverHighlight&&(t.props.hoverHighlight=!0),t.props.deselect=e.undefine(t.props.deselect),t.props.max=Number(t.props.max)||5,t.props.min=Number(t.props.min)||0,t.props.step=Number(t.props.step)||1,t.props.numberOfSteps=t.props.max/t.props.step,t.props.lastIndex=1/t.props.step-1,t.props.itemsToPercentages={},"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.rightToLeft?(t.props.onItemStyles=void 0,t.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):t.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},t.props.stepsPerValue=1/t.props.step,t.hook.input(((e,o)=>{if(null===e||""===e||isNaN(e))return o(e);const n=Number(e),r=Number(t.props.min),s=Number(t.props.max);return n>s?o(s):t.props.min&&n<=r?o(r):o(n)})),t.on("commit",(({payload:e})=>{const o=Number(e||0);Go(t,o)})),t.on("created",(()=>{t.context&&(e.whenAvailable(`${t.props.id}_items_wrapper`,(()=>{o(t),function(e){var t;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{o(e)})).observe(n)}(t),setTimeout((()=>o(t)),100)}),t.props.__root),t.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],t.context.fns.getValue=(e,o)=>e+Number((o*t.props.step+t.props.step).toFixed(1)),t.context.fns.showLabel=(e,o)=>{const n=Number(t.value||0);return 0===n&&0===o||n&&e===n||e>n&&0===o||n>e&&o===t.props.lastIndex},t.context.handlers.handleFocus=e=>nn.call(null,t,e),t.context.handlers.handleWrapperKeydown=e=>on.call(null,t,e),t.context.handlers.handleWrapperBlur=e=>Xo.call(null,t,e),t.context.handlers.handleItemClick=e=>o=>an.call(null,t,e,o),t.context.handlers.handleMousemove=e=>o=>rn.call(null,t,e,o),t.context.handlers.handleMouseleave=()=>sn.call(null,t),t.context.handlers.handleDragstart=e=>o=>tn.call(null,t,e,o),t.context.handlers.handleMouseup=e=>en.call(null,t,e),t.context.handlers.handleTouchstart=e=>o=>Qo.call(null,t,e,o),t.context.handlers.handleTouchmove=e=>Jo.call(null,t,e),t.context.handlers.handleKeydown=e=>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)}(t,e,o))}))},/* #__PURE__ */o.defaultIcon("rating","star")]},Vn=/* #__PURE__ */K("ac"),{outer:Fn,wrapper:Pn,inner:Bn,icon:Hn,label:Rn,prefix:Nn,suffix:Kn,help:Wn,messages:qn,message:Un}=/* #__PURE__ */W(Vn),zn=Vn("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",onTouchmovePassive:"$handlers.touchmove",onTouchstartPassive:"$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"}}))),Yn=Vn("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"}}))),jn=Vn("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',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)"}}))),Zn=Vn("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Gn=Vn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Xn=Vn("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"}}))),Jn=Vn("optionLoading","span"),Qn=Vn("option",(()=>({$el:"div",if:"$value !== undefined"}))),er=/* #__PURE__ */z(Vn);function tr(t){"option"!==t.props.selectionAppearance||t.props.multiple||!1===t.props.selectionRemovable||"false"===t.props.selectionRemovable||(t.props.selectionRemovable=!0),t.props.multiple||(t.props.clearSearchOnOpen=e.undefine(t.props.clearSearchOnOpen)),t.props.selectionRemovable=e.undefine(t.props.selectionRemovable),t.props.openOnClick=e.undefine(t.props.openOnClick),"option"!==t.props.selectionAppearance||t.props.multiple||(t.props.isSingleOption=!0),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),void 0===t.props.selectionAppearance&&(t.props.selectionAppearance="text-input"),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function or(t){t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===t.props.debounce?t.props.debounce=200:t.props.debounce=parseInt(t.props.debounce),t.props.nonceKey="searchValue",t.props.searchValue="",t.props.inputText="",t.props.filterOptions=Ie.bind(null,t),t.props.reloadOnCommit=e.undefine(t.props.reloadOnCommit),void 0===t.props.alwaysLoadOnOpen?t.props.alwaysLoadOnOpen=!0:t.props.alwaysLoadOnOpen=e.undefine(t.props.alwaysLoadOnOpen),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.on("created",(()=>{t.context&&c&&(t.context.handlers.focus=sr.bind(null,t),t.context.handlers.input=nr.bind(null,t),t.context.handlers.focus=sr.bind(null,t),t.context.handlers.click=rr.bind(null,t),t.context.handlers.toggleListbox=ar.bind(null,t),t.context.handlers.toggleListboxKeydown=lr.bind(null,t),t.context.handlers.keydown=St.bind(null,t),t.context.handlers.selectionKeydown=e=>o=>_t(t,e,o),t.context.handlers.searchInputTagKeydown=e=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o);break;case"Delete":case"Backspace":bt(e,t,o)}}(t,e,o),t.on("prop:options",(({payload:e})=>{if((0===t.props.initialOptions.length&&"function"!=typeof t.props.optionsLoader||!t.props.searchValue&&e.length)&&(t.props.initialOptions=[...e]),t.props.selections&&t.props.selections.length&&e.length)for(let o=0;o<t.props.selections.length;o++){const n=t.props.selections[o],r=e.find((e=>Se(e)===n.value));r&&(t.props.selections[o]=r)}})))})),t.on("prop:expanded",(({payload:e})=>{e||Le.delete(t)}))}function nr(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&Ie(e,e.props.searchValue,!0)}function rr(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 sr(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 ar(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 lr(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),ar(e))}const ir=new WeakMap,pr="undefined"!=typeof window,dr=new WeakMap;let cr=!1;function ur(t){t.props.searchValue=null,t.on("commit",(()=>{t.props.searchValue=null,t.props.highlightedRange||fr(t)})),t.on("created",(()=>{if(!t.context||!pr)return;t.on("handleSearchInput",(({payload:e})=>{""===e?(t.props.searchValue=null,t.input([])):e&&0===t.props.inputStd.length?t.props.searchValue=e:e&&t.props.inputStd.length>0&&(t.props.searchValue=function(e){var t;const o=hr(e);if(e.props.highlightedRange){const[t,n]=vr(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)}(t)),!t.props.expanded&&e?t.props.expanded=!0:!e&&t.props.expanded&&(t.props.expanded=!1)})),function(t){e.whenAvailable(`${t.props.id}`,(e=>{e instanceof HTMLInputElement&&dr.set(e,t)}),t.props.__root),pr&&!cr&&(cr=!0,document.addEventListener("selectionchange",(()=>{const e=ke();if(e instanceof HTMLInputElement&&dr.has(e)){const t=dr.get(e);t&&function(e){clearTimeout(ir.get(e)),ir.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=hr(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]=vr(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,fr(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)}})))}(t);const n=t.context.handlers.keydown;t.context.handlers.keydown=e=>{n(e),function(e,t){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(t.key)&&t.target instanceof HTMLInputElement&&null!==t.target.selectionEnd&&null!==t.target.selectionStart){if(0===t.target.selectionStart&&t.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===t.key?o(0):o(-1);else if(!e.props.searchValue){e.props.searchValue=null;const o=hr(e),n=null===(r=o[o.length-1])||void 0===r?void 0:r.end;t.target.selectionStart<n&&(t.target.selectionStart=Math.max(0,"ArrowLeft"===t.key?t.target.selectionStart-2:t.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(t.key))e.props.highlightedRange&&!e.props.searchValue?(He(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):t.target instanceof HTMLInputElement&&(e.props.searchValue=null,o(-1,!0)&&t.preventDefault());else if(t.target instanceof HTMLInputElement&&0===t.target.selectionStart&&t.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)t.preventDefault();else if("Tab"===t.key)return;"ArrowLeft"===t.key&&o(-1,!0)&&t.preventDefault()}(t,e)};const r=t.context.handlers.focus;t.context.handlers.focus=e=>{r(t,e);const o=new Event("selectionchange");document.dispatchEvent(o)},t.on("blur",(()=>{t.props.selections.length?(t.props.inputText=t.props.selections.map((e=>e.label)).join(", "),t.props.searchValue=null):t.props.selections.length||(t.props.inputText="",t.props.searchValue="")}))})),t.on("prop:expanded",(({payload:e})=>{e||t.props.inputStd.length?e&&(t.props.options.length&&!t.props.alwaysLoadOnOpen||(t.props.options=[],Ie(t,t.props.searchValue))):(t.props.searchValue="",t.props.inputText="")})),t.on("prop:selections",(()=>{var e;const o=[...t.props.selections].map((e=>e.label)).join(", ");let n="";if(pr&&t.isCreated){const o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`${t.props.id}`);if(ke()===o&&Array.isArray(t._value)&&t._value.length){if(t.props.max&&t._value.length>=Number(t.props.max))return;n=", "}}t.props.inputText=`${o}${n}`,t.props.reloadOnCommit&&(t.props.searchValue="",Ie(t,t.props.searchValue))}));const o=(e,o=!1)=>{var n,r;const s=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=hr(t),l=e>=0?e: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 n;t.on("selectRange",(({payload:e})=>o(...e))),t.on("prop:highlightedRange",(({payload:e})=>{t.props.hasHighlightedRange=!!e,e&&t.props.expanded&&n!==e.option&&(n=e.option,Ne(t))}))}function fr(e){var t;if(!pr)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 vr(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 hr(e){const t=Be(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 mr(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],Ie(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&&Ie(e,e.props.searchValue,!0))}))}(e)}function gr(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=[],Ie(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&&Ie(e,e.props.searchValue,!0)}))}(e)}function $r(t){if(t.props.multiple)if(t.props.multiple&&"option"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}mr(t),t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(e instanceof HTMLElement&&t.context){const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[n.animations()],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}else t.props.multiple&&"text-input"===t.props.selectionAppearance&&ur(t);else gr(t)}const br={schema:/* #__PURE__ */Fn(/* #__PURE__ */Pn(/* #__PURE__ */Rn("$label"),/* #__PURE__ */Bn(/* #__PURE__ */Hn("prefix"),/* #__PURE__ */Nn(),/* #__PURE__ */zn(),/* #__PURE__ */U("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */U("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U("$selectionRemovable && $isSingleOption",/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */U("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")),/* #__PURE__ */U('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Yn(/* #__PURE__ */Hn("select")))),/* #__PURE__ */U("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Yn(/* #__PURE__ */Hn("select"))),/* #__PURE__ */er(),/* #__PURE__ */Kn(),/* #__PURE__ */Hn("suffix")),/* #__PURE__ */U("$multiple && $selectionAppearance === option",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading && $isLoadingOption",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */Wn("$help"),/* #__PURE__ */qn(/* #__PURE__ */Un("$message.value"))),type:"input",family:"dropdown",props:[],features:[
19
+ /* #__PURE__ */o.defaultIcon("moveDown","arrowDown")]},Zo=new WeakMap;function Go(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 Xo(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function Jo(e,t){const{x:o,y:n}=ln(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 Qo(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?pn(e,t,o):e.input(t+1,!1))}function en(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Go(e);const o=Zo.get(e);o&&(o.abort(),Zo.delete(e))}function tn(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=>en(e,t)),{signal:n.signal}),Zo.set(e,n),1===e.props.step?e.input(t+1,!1):pn(e,t,o)}function on(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?dn(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?dn(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 nn(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 rn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Go(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):pn(e,t,o,!!e.props.dragStarted)))}function sn(e){Go(e)}function an(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 pn(e,t,o)}function ln(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function pn(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=ln(o),a=o.currentTarget.getBoundingClientRect();let l=dn((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):Go(e,l):e.input(0)}function dn(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const cn=/* #__PURE__ */K("rt"),{outer:un,wrapper:fn,inner:vn,label:hn,prefix:mn,suffix:gn,help:$n,messages:bn,message:yn,icon:xn}=/* #__PURE__ */W(cn),wn=cn("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"}}))),_n=cn("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",onTouchstartPassive:"$handlers.handleTouchstart($item)",onTouchmovePassive:"$handlers.handleTouchmove"}}))),kn=cn("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),Sn=cn("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%"'}}}))),Ln=cn("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),An=cn("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))"}}))),In=cn("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),Dn=cn("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"}}}))),Cn=cn("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),Tn=cn("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),En=()=>U("$slots.onItem",(()=>()=>"$slots.onItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),On=()=>U("$slots.offItem",(()=>()=>"$slots.offItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),Mn={schema:/* #__PURE__ */un(/* #__PURE__ */fn(/* #__PURE__ */hn("$label"),/* #__PURE__ */vn(/* #__PURE__ */xn("prefix"),/* #__PURE__ */mn(),/* #__PURE__ */wn(/* #__PURE__ */_n(/* #__PURE__ */kn(/* #__PURE__ */Sn(/* #__PURE__ */In(/* #__PURE__ */Cn(/* #__PURE__ */En())),/* #__PURE__ */Dn(/* #__PURE__ */Tn(/* #__PURE__ */On())),/* #__PURE__ */Ln()),/* #__PURE__ */An()))),/* #__PURE__ */gn(),/* #__PURE__ */xn("suffix"))),/* #__PURE__ */$n("$help"),/* #__PURE__ */bn(/* #__PURE__ */yn("$message.value"))),type:"input",props:[],features:[function(t){function o(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`}}))}t.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==t.props.hoverHighlight&&"false"!==t.props.hoverHighlight&&(t.props.hoverHighlight=!0),t.props.deselect=e.undefine(t.props.deselect),t.props.max=Number(t.props.max)||5,t.props.min=Number(t.props.min)||0,t.props.step=Number(t.props.step)||1,t.props.numberOfSteps=t.props.max/t.props.step,t.props.lastIndex=1/t.props.step-1,t.props.itemsToPercentages={},"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.rightToLeft?(t.props.onItemStyles=void 0,t.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):t.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},t.props.stepsPerValue=1/t.props.step,t.hook.input(((e,o)=>{if(null===e||""===e||isNaN(e))return o(e);const n=Number(e),r=Number(t.props.min),s=Number(t.props.max);return n>s?o(s):t.props.min&&n<=r?o(r):o(n)})),t.on("commit",(({payload:e})=>{const o=Number(e||0);Go(t,o)})),t.on("created",(()=>{t.context&&(e.whenAvailable(`${t.props.id}_items_wrapper`,(()=>{o(t),function(e){var t;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{o(e)})).observe(n)}(t),setTimeout((()=>o(t)),100)}),t.props.__root),t.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],t.context.fns.getValue=(e,o)=>e+Number((o*t.props.step+t.props.step).toFixed(1)),t.context.fns.showLabel=(e,o)=>{const n=Number(t.value||0);return 0===n&&0===o||n&&e===n||e>n&&0===o||n>e&&o===t.props.lastIndex},t.context.handlers.handleFocus=e=>nn.call(null,t,e),t.context.handlers.handleWrapperKeydown=e=>on.call(null,t,e),t.context.handlers.handleWrapperBlur=e=>Xo.call(null,t,e),t.context.handlers.handleItemClick=e=>o=>an.call(null,t,e,o),t.context.handlers.handleMousemove=e=>o=>rn.call(null,t,e,o),t.context.handlers.handleMouseleave=()=>sn.call(null,t),t.context.handlers.handleDragstart=e=>o=>tn.call(null,t,e,o),t.context.handlers.handleMouseup=e=>en.call(null,t,e),t.context.handlers.handleTouchstart=e=>o=>Qo.call(null,t,e,o),t.context.handlers.handleTouchmove=e=>Jo.call(null,t,e),t.context.handlers.handleKeydown=e=>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)}(t,e,o))}))},/* #__PURE__ */o.defaultIcon("rating","star")]},Vn=/* #__PURE__ */K("ac"),{outer:Fn,wrapper:Pn,inner:Bn,icon:Hn,label:Rn,prefix:Nn,suffix:Kn,help:Wn,messages:qn,message:Un}=/* #__PURE__ */W(Vn),zn=Vn("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",onTouchmovePassive:"$handlers.touchmove",onTouchstartPassive:"$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"}}))),Yn=Vn("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"}}))),jn=Vn("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',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)"}}))),Zn=Vn("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Gn=Vn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Xn=Vn("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"}}))),Jn=Vn("optionLoading","span"),Qn=Vn("option",(()=>({$el:"div",if:"$value !== undefined"}))),er=/* #__PURE__ */z(Vn);function tr(t){"option"!==t.props.selectionAppearance||t.props.multiple||!1===t.props.selectionRemovable||"false"===t.props.selectionRemovable||(t.props.selectionRemovable=!0),t.props.multiple||(t.props.clearSearchOnOpen=e.undefine(t.props.clearSearchOnOpen)),t.props.selectionRemovable=e.undefine(t.props.selectionRemovable),t.props.openOnClick=e.undefine(t.props.openOnClick),"option"!==t.props.selectionAppearance||t.props.multiple||(t.props.isSingleOption=!0),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),void 0===t.props.selectionAppearance&&(t.props.selectionAppearance="text-input"),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function or(t){t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===t.props.debounce?t.props.debounce=200:t.props.debounce=parseInt(t.props.debounce),t.props.nonceKey="searchValue",t.props.searchValue="",t.props.inputText="",t.props.filterOptions=Ie.bind(null,t),t.props.reloadOnCommit=e.undefine(t.props.reloadOnCommit),void 0===t.props.alwaysLoadOnOpen?t.props.alwaysLoadOnOpen=!0:t.props.alwaysLoadOnOpen=e.undefine(t.props.alwaysLoadOnOpen),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.on("created",(()=>{t.context&&c&&(t.context.handlers.focus=sr.bind(null,t),t.context.handlers.input=nr.bind(null,t),t.context.handlers.focus=sr.bind(null,t),t.context.handlers.click=rr.bind(null,t),t.context.handlers.toggleListbox=ar.bind(null,t),t.context.handlers.toggleListboxKeydown=lr.bind(null,t),t.context.handlers.keydown=St.bind(null,t),t.context.handlers.selectionKeydown=e=>o=>_t(t,e,o),t.context.handlers.searchInputTagKeydown=e=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o);break;case"Delete":case"Backspace":bt(e,t,o)}}(t,e,o),t.on("prop:options",(({payload:e})=>{if((0===t.props.initialOptions.length&&"function"!=typeof t.props.optionsLoader||!t.props.searchValue&&e.length)&&(t.props.initialOptions=[...e]),t.props.selections&&t.props.selections.length&&e.length)for(let o=0;o<t.props.selections.length;o++){const n=t.props.selections[o],r=e.find((e=>Se(e)===n.value));r&&(t.props.selections[o]=r)}})))})),t.on("prop:expanded",(({payload:e})=>{e||Le.delete(t)}))}function nr(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&Ie(e,e.props.searchValue,!0)}function rr(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 sr(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 ar(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 lr(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),ar(e))}const ir=new WeakMap,pr="undefined"!=typeof window,dr=new WeakMap;let cr=!1;function ur(t){t.props.searchValue=null,t.on("commit",(()=>{t.props.searchValue=null,t.props.highlightedRange||fr(t)})),t.on("created",(()=>{if(!t.context||!pr)return;t.on("handleSearchInput",(({payload:e})=>{""===e?(t.props.searchValue=null,t.input([])):e&&0===t.props.inputStd.length?t.props.searchValue=e:e&&t.props.inputStd.length>0&&(t.props.searchValue=function(e){var t;const o=hr(e);if(e.props.highlightedRange){const[t,n]=vr(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)}(t)),!t.props.expanded&&e?t.props.expanded=!0:!e&&t.props.expanded&&(t.props.expanded=!1)})),function(t){e.whenAvailable(`${t.props.id}`,(e=>{e instanceof HTMLInputElement&&dr.set(e,t)}),t.props.__root),pr&&!cr&&(cr=!0,document.addEventListener("selectionchange",(()=>{const e=ke();if(e instanceof HTMLInputElement&&dr.has(e)){const t=dr.get(e);t&&function(e){clearTimeout(ir.get(e)),ir.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=hr(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]=vr(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,fr(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)}})))}(t);const n=t.context.handlers.keydown;t.context.handlers.keydown=e=>{n(e),function(e,t){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(t.key)&&t.target instanceof HTMLInputElement&&null!==t.target.selectionEnd&&null!==t.target.selectionStart){if(0===t.target.selectionStart&&t.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===t.key?o(0):o(-1);else if(!e.props.searchValue){e.props.searchValue=null;const o=hr(e),n=null===(r=o[o.length-1])||void 0===r?void 0:r.end;t.target.selectionStart<n&&(t.target.selectionStart=Math.max(0,"ArrowLeft"===t.key?t.target.selectionStart-2:t.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(t.key))e.props.highlightedRange&&!e.props.searchValue?(He(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):t.target instanceof HTMLInputElement&&(e.props.searchValue=null,o(-1,!0)&&t.preventDefault());else if(t.target instanceof HTMLInputElement&&0===t.target.selectionStart&&t.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)t.preventDefault();else if("Tab"===t.key)return;"ArrowLeft"===t.key&&o(-1,!0)&&t.preventDefault()}(t,e)};const r=t.context.handlers.focus;t.context.handlers.focus=e=>{r(t,e);const o=new Event("selectionchange");document.dispatchEvent(o)},t.on("blur",(()=>{t.props.selections.length?(t.props.inputText=t.props.selections.map((e=>e.label)).join(", "),t.props.searchValue=null):t.props.selections.length||(t.props.inputText="",t.props.searchValue="")}))})),t.on("prop:expanded",(({payload:e})=>{e||t.props.inputStd.length?e&&(t.props.options.length&&!t.props.alwaysLoadOnOpen||(t.props.options=[],Ie(t,t.props.searchValue))):(t.props.searchValue="",t.props.inputText="")})),t.on("prop:selections",(()=>{var e;const o=[...t.props.selections].map((e=>e.label)).join(", ");let n="";if(pr&&t.isCreated){const o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`${t.props.id}`);if(ke()===o&&Array.isArray(t._value)&&t._value.length){if(t.props.max&&t._value.length>=Number(t.props.max))return;n=", "}}t.props.inputText=`${o}${n}`,t.props.reloadOnCommit&&(t.props.searchValue="",Ie(t,t.props.searchValue))}));const o=(e,o=!1)=>{var n,r;const s=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=hr(t),l=e>=0?e: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 n;t.on("selectRange",(({payload:e})=>o(...e))),t.on("prop:highlightedRange",(({payload:e})=>{t.props.hasHighlightedRange=!!e,e&&t.props.expanded&&n!==e.option&&(n=e.option,Ne(t))}))}function fr(e){var t;if(!pr)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 vr(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 hr(e){const t=Be(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 mr(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],Ie(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&&Ie(e,e.props.searchValue,!0))}))}(e)}function gr(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.options=[],Ie(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&&Ie(e,e.props.searchValue,!0)}))}(e)}function $r(t){if(t.props.multiple)if(t.props.multiple&&"option"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}mr(t),t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(e instanceof HTMLElement&&t.context){const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[n.animations()],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}else t.props.multiple&&"text-input"===t.props.selectionAppearance&&ur(t);else gr(t)}const br={schema:/* #__PURE__ */Fn(/* #__PURE__ */Pn(/* #__PURE__ */Rn("$label"),/* #__PURE__ */Bn(/* #__PURE__ */Hn("prefix"),/* #__PURE__ */Nn(),/* #__PURE__ */zn(),/* #__PURE__ */U("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */U("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U("$selectionRemovable && $isSingleOption",/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */U("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")),/* #__PURE__ */U('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Yn(/* #__PURE__ */Hn("select")))),/* #__PURE__ */U("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Yn(/* #__PURE__ */Hn("select"))),/* #__PURE__ */er(),/* #__PURE__ */Kn(),/* #__PURE__ */Hn("suffix")),/* #__PURE__ */U("$multiple && $selectionAppearance === option",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading && $isLoadingOption",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */Wn("$help"),/* #__PURE__ */qn(/* #__PURE__ */Un("$message.value"))),type:"input",family:"dropdown",props:[],features:[
20
20
  /* #__PURE__ */o.defaultIcon("select","select"),
21
21
  /* #__PURE__ */o.defaultIcon("close","close"),
22
22
  /* #__PURE__ */o.defaultIcon("selected","check"),
@@ -62,4 +62,4 @@
62
62
  /* #__PURE__ */o.defaultIcon("eyeDropper","color"),
63
63
  /* #__PURE__ */o.defaultIcon("close","close"),
64
64
  /* #__PURE__ */o.localize("close"),
65
- /* #__PURE__ */o.localize("next")]},Qd=/* #__PURE__ */K("tb"),{outer:ec,inner:tc,wrapper:oc,prefix:nc,suffix:rc,help:sc,messages:ac,message:lc,icon:ic}=/* #__PURE__ */W(Qd),pc=Qd("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),dc=Qd("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"}}))),cc=Qd("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"}}))),uc=Qd("inputInner",(()=>({bind:"$attrs",$el:"span"}))),fc=Qd("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),vc=Qd("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function hc(t,o){return o=(null==o?void 0:o.hasOwnProperty("__original"))?null==o?void 0:o.__original:null==o?void 0:o.value,t.props.multiple?!!Array.isArray(t.value)&&t.value.filter((t=>e.eq(t,o))).length>0:void 0!==o?e.eq(t.value,o):(t.props._isChecked=e.eq(t.value,t.props.onValue),t.props._isChecked)}const mc={schema:/* #__PURE__ */ec(/* #__PURE__ */U("$options",/* #__PURE__ */oc(/* #__PURE__ */pc("$label"),/* #__PURE__ */fc(/* #__PURE__ */vc(/* #__PURE__ */cc(/* #__PURE__ */U("$fns.isChecked($option) === true",/* #__PURE__ */uc("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */uc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */oc(/* #__PURE__ */U("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */pc("$label")),/* #__PURE__ */dc(/* #__PURE__ */ic("prefix"),/* #__PURE__ */nc(),/* #__PURE__ */U("$_isChecked === true",/* #__PURE__ */uc("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */uc("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */rc(),/* #__PURE__ */ic("suffix")))),/* #__PURE__ */sc("$help"),/* #__PURE__ */ac(/* #__PURE__ */lc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(t){var o,n,r,s;t.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),t.props._isChecked=!1,t.props.enforced=e.undefine(t.props.enforced),t.props.multiple=e.undefine(t.props.multiple),t.props.vertical=e.undefine(t.props.vertical),t.props.disabled=e.undefine(t.props.disabled),null!==(o=(r=t.props).onValue)&&void 0!==o||(r.onValue=!0),null!==(n=(s=t.props).offValue)&&void 0!==n||(s.offValue=!1),t.on("created",(()=>{var o;t.props._isChecked=hc(t,null),t.props.options&&t.props.multiple&&t.input(null!==(o=t.value)&&void 0!==o?o:[],!1),t.context&&(t.context.fns.isChecked=e=>hc(t,e),t.context.handlers.toggleValue=o=>n=>function(t,o,n){if(n.preventDefault(),o=o?Se(o):o,t.props.options)if(t.props.multiple){const n=Array.isArray(t.value)?[...t.value]:[],r=n.findIndex((t=>e.eq(t,o)));r>-1&&(!t.props.enforced||n.length>1)?n.splice(r,1):-1===r&&n.push(o),t.input(n)}else e.eq(t.value,o)&&!t.props.enforced?t.input(void 0):t.input(o);else t.input(e.eq(t.value,t.props.onValue)?t.props.offValue:t.props.onValue)}(t,o,n))}))},o.options]},gc=/* #__PURE__ */K("ut"),{outer:$c,inner:bc,wrapper:yc,label:xc,prefix:wc,suffix:_c,help:kc,messages:Sc,message:Lc,icon:Ac}=/* #__PURE__ */W(gc),Ic=gc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.unitBlur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",placeholder:"$placeholder || $unitParts.unit",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"}}))),Dc={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,"mile-scandinavian":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,"mile-scandinavian":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,"mile-scandinavian":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,"mile-scandinavian":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,"mile-scandinavian":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,"mile-scandinavian":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,"mile-scandinavian":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,"mile-scandinavian":254e-8},"mile-scandinavian":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,"mile-scandinavian":1}},Cc={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},Tc={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},Ec={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},Oc={liter:{liter:1,milliliter:1e3,gallon:.264172,"fluid-ounce":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,"fluid-ounce":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,"fluid-ounce":128},"fluid-ounce":{liter:.0295735,milliliter:29.5735,gallon:.0078125,"fluid-ounce":1}},Mc={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},Vc={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function Fc(t){let o=!1;function n(e){var n,r,s;const i=(`${e}`.match(/\-/g)||[]).length%2==1;e=function(e){e=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${e}`),isNaN(e)&&(e=e.split(t.props.unitParts.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(e=e.replace(/[^0-9\.]/g,""),e.includes(".")){const o=e.split(".");0===t.props.decimals?e=o[0]:"currency"===t.props.type&&(o[1]=o[1].padEnd(p(),"0").slice(0,p()),e=o.join("."))}return e}(e);const d={};"unit"!==a()&&"decimal"!==a()||(d.minimumFractionDigits=e.includes(".")?1:0),d.maximumFractionDigits="currency"===t.props.type?p():t.props.decimals,t.props.minDecimals&&(d.minimumFractionDigits=t.props.minDecimals,e&&!e.includes(".")&&(e+=".".padEnd(t.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&e.includes(".")&&(e=e.split(".")[0]);let c="";if(!isNaN(e)&&""!==e.trim()&&(e=i?`-${e}`:e,t.props.max&&!isNaN(t.props.max)&&(e=Number(e)>t.props.max?`${t.props.max}`:e),t.props.min&&!isNaN(t.props.min)&&(e=Number(e)<t.props.min?`${t.props.min}`:e),e.includes(".")&&"currency"===t.props.type?e=e.split(".")[0].padStart(1,"0")+"."+(null!==(n=e.split(".")[1])&&void 0!==n?n:"0"):"currency"===t.props.type&&(d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0),c=l(t.props.displayLocale,d).format(e),"unit"===t.props.type&&"."===e[e.length-1])){const o=c.lastIndexOf(t.props.unitParts.decimal);c=c.slice(0,o+1)+c.slice(o+2),e=e.slice(0,-1)}let u,f=e.split(".");"currency"===t.props.type&&(f=f[0]+(null!==(s=f[1])&&void 0!==s?s:"").padEnd(p(),"0"),f.length>1&&(f=f.replace(/^0+/,""),f=""!==e&&""===f?"0":f)),t.props.valueStore={number:e,integer:f,string:c},o=!0,t.props.valueStore&&(u=t.props.valueStore.hasOwnProperty(t.props.valueFormat)?t.props.valueStore[t.props.valueFormat]:t.props.valueStore.number),t.input(""===u?void 0:u).then((()=>(o=!1,Promise.resolve())))}function r(){e.whenAvailable(`${t.props.id}`,(e=>{var o,n;e instanceof HTMLInputElement&&(e.value=null!==(n=null===(o=t.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),t.props.__root)}function s(){var e,o;const n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`#${t.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function a(){return t.props.currency?"currency":t.props.unit?"unit":"decimal"}function l(e,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return"unit"===t.props.type&&(r.unitDisplay=t.props.unitDisplay),"currency"===t.props.type&&(r.currencyDisplay=t.props.currencyDisplay),r[n]=t.props[n],new Intl.NumberFormat(e,r)}function i(e,o){var n,r,a,l,i;const p=null===(n=t.props.__root)||void 0===n?void 0:n.querySelector(`#${t.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(r=t.props.unitParts.unit)||void 0===r?void 0:r.length)&&void 0!==a?a:0)+(null!==(i=null===(l=t.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);t.props.unitParts.unitLeft?e=Math.max(e,d):(e=Math.min(e,s().length-d),"insertText"===o&&0===e&&(e=1)),p.setSelectionRange(e,e)}function p(){return void 0!==t.props.decimals?t.props.decimals:void 0!==t.props.minDecimals&&t.props.minDecimals>t.props.unitParts.fractionLength?t.props.minDecimals:t.props.unitParts.fractionLength}t.props.valueStore=null,t.on("input",(({payload:e})=>{o||(n(e),r())})),t.context&&(t.context.handlers.init=(e=null)=>{var o;t.props.skipInit?t.props.skipInit=!1:function(){var e,o,n,r,s,a,i;t.props.skipInit=!0;const p=l(t.props.displayLocale).formatToParts(12345678.12345678);t.props.unitParts={decimal:null===(e=p.find((e=>"decimal"==e.type)))||void 0===e?void 0:e.value,group:null===(o=p.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=p.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(p[0].type),literal:null!==(s=null===(r=p.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==s?s:"",fractionLength:null!==(i=null===(a=p.find((e=>"fraction"==e.type)))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(o=null!=e?e:t._value)&&void 0!==o?o:"";t.props.valueStore?s=t.props.valueStore.number:"integer"===t.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(".",p())}(`${null!=s?s:""}`)),"unit"===t.props.type&&t.props.valueUnit&&t.props.unit&&t.props.valueUnit!==t.props.unit&&t.hook.input(((e,o)=>{const n=function(e,t,o){if(Dc[e]&&Dc[e][o])return t*Dc[e][o];if(Cc[e]&&Cc[e][o])return Cc[e][o](t);if(Tc[e]&&Tc[e][o])return t*Tc[e][o];if(Ec[e]&&Ec[e][o])return t*Ec[e][o];if(Oc[e]&&Oc[e][o])return t*Oc[e][o];if(Mc[e]&&Mc[e][o])return t*Mc[e][o];if(Vc[e]&&Vc[e][o])return t*Vc[e][o];throw new Error("Conversion not supported")}(t.props.unit,e,t.props.valueUnit);return isNaN(n)?o(e):o(+n.toFixed(Number(t.props.valueDecimals)||2))})),n(s),r()},t.context.handlers.handleBeforeInput=e=>{var o,r,s,a,l,p,d,c,u;if(!t.props.inExecCommand&&"insertLineBreak"!==e.inputType&&(e.preventDefault(),e.stopPropagation(),e.target instanceof HTMLInputElement)){const f=e.target,v=null!==(o=e.data)&&void 0!==o?o:"",h=null!==(r=e.target.value)&&void 0!==r?r:"",m=null!==(s=e.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=e.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(t.props.unitParts.decimal);let y=(null!==(l=e.target.selectionStart)&&void 0!==l?l:0)+(e.data?0:-1),x=h,w=1;if(h.includes(t.props.unitParts.decimal)&&v===t.props.unitParts.decimal)return v===t.props.unitParts.decimal&&(y=x.indexOf(t.props.unitParts.decimal)+1),void i(y);if(!(null===t.props.min||t.props.min<0||t.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===t.props.unitParts.decimal&&0===t.props.decimals)return;if("deleteByCut"===e.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),"insertFromPaste"===e.inputType){const t=null!==(p=e.data)&&void 0!==p?p:"";x=x.slice(0,m)+t+x.slice(g)}if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.group?(w+=1,y-=1):"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&"insertText"===e.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=e.data)&&void 0!==d?d:"0"):"insertText"===e.inputType?(y=g,x=x.slice(0,m)+e.data+x.slice(g)):"deleteContentForward"===e.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):"deleteContentBackward"===e.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}else if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m-1),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}if(n(x),x=(null===(c=t.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=t.props.valueStore)||void 0===u?void 0:u.number)||"",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=e.inputType.includes("delete")?-1:1),f.setSelectionRange(0,h.length),t.props.inExecCommand=!0,document.execCommand("insertText",void 0,x),t.props.inExecCommand=!1,v===t.props.unitParts.decimal?y=x.indexOf(t.props.unitParts.decimal)+1:h.includes(t.props.unitParts.decimal)&&!x.includes(t.props.unitParts.decimal)&&(y=x.length),"insertText"===e.inputType&&t.props.minDecimals&&(!t.value||0===m&&g===h.length||-1===b&&t.props.minDecimals&&h)){let e=0;e=t.props.unitParts.unit?t.props.unitParts.unit.length+1:0,y-=t.props.minDecimals,t.props.unitParts.unitLeft?y-=e-1:y-=e+1}i(Math.max(0,y),e.inputType)}},t.context.handlers.handleInput=e=>{t.emit("dom-input-event",e),e.target instanceof HTMLInputElement&&(t.props.inputText=e.target.value,n(e.target.value))},t.context.handlers.handleKeyDown=e=>{var o,a;if(e.target instanceof HTMLInputElement&&("ArrowUp"===e.key||"ArrowDown"===e.key)){const l="ArrowUp"===e.key?1*t.props.step:-1*t.props.step;n(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===(o=t.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==a?a:0,l)),r(),setTimeout((()=>{i(s().length)}),1)}})}const Pc={schema:/* #__PURE__ */$c(/* #__PURE__ */yc(/* #__PURE__ */xc("$label"),/* #__PURE__ */bc(/* #__PURE__ */Ac("prefix"),/* #__PURE__ */wc(),/* #__PURE__ */Ic(),/* #__PURE__ */_c(),/* #__PURE__ */Ac("suffix"))),/* #__PURE__ */kc("$help"),/* #__PURE__ */Sc(/* #__PURE__ */Lc("$message.value"))),type:"input",family:"text",features:[function(e){var t,o,n,r,s,a;const l=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat","unitDisplay","placeholder","unitParts","valueUnit","valueDecimals"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||"en-US"),e.props.unitDisplay=e.props.unitDisplay||"short","false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\d+\,\s*%?$/;return/\d+\.\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,""),t.target.value=o)},Fc(e),e.context.handlers.init(),l.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]},Bc=/* #__PURE__ */K("cr"),{outer:Hc,inner:Rc,wrapper:Nc,label:Kc,prefix:Wc,suffix:qc,help:Uc,messages:zc,message:Yc,icon:jc}=/* #__PURE__ */W(Bc),Zc=Bc("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",placeholder:"$placeholder || $unitParts.unit",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 Gc={schema:/* #__PURE__ */Hc(/* #__PURE__ */Nc(/* #__PURE__ */Kc("$label"),/* #__PURE__ */Rc(/* #__PURE__ */jc("prefix"),/* #__PURE__ */Wc(),/* #__PURE__ */Zc(),/* #__PURE__ */qc(),/* #__PURE__ */jc("suffix"))),/* #__PURE__ */Uc("$help"),/* #__PURE__ */zc(/* #__PURE__ */Yc("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i;const p=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat","currencyDisplay","placeholder","unitParts"];e.addProps(p),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(Fc(e),e.context.handlers.init(),p.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]};var Xc=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:br,colorpicker:Jd,currency:Gc,datepicker:ul,dropdown:Zt,mask:si,rating:Mn,repeater:jo,slider:Yp,taglist:Vl,toggle:mo,togglebuttons:mc,transferlist:hp,unit:Pc});const Jc="undefined"!=typeof window?setInterval:()=>0,Qc=new WeakSet;exports.$if=U,exports.autocomplete=br,exports.colorpicker=Jd,exports.createBaseSections=W,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Qc.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:h(13919),children:`${h(451228594)}${h(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){k[e]?k[e].add(t):k[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(!d.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];Qc.add(o),o.define({...r,schema:n(e)})}Jc((()=>b.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}},exports.createSectionFactory=K,exports.currency=Gc,exports.datepicker=ul,exports.dropdown=Zt,exports.inputs=Xc,exports.mask=si,exports.rating=Mn,exports.repeater=jo,exports.slider=Yp,exports.taglist=Vl,exports.toggle=mo,exports.togglebuttons=mc,exports.transferlist=hp,exports.unit=Pc;
65
+ /* #__PURE__ */o.localize("next")]},Qd=/* #__PURE__ */K("tb"),{outer:ec,inner:tc,wrapper:oc,prefix:nc,suffix:rc,help:sc,messages:ac,message:lc,icon:ic}=/* #__PURE__ */W(Qd),pc=Qd("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),dc=Qd("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"}}))),cc=Qd("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"}}))),uc=Qd("inputInner",(()=>({bind:"$attrs",$el:"span"}))),fc=Qd("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),vc=Qd("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function hc(t,o){return o=(null==o?void 0:o.hasOwnProperty("__original"))?null==o?void 0:o.__original:null==o?void 0:o.value,t.props.multiple?!!Array.isArray(t.value)&&t.value.filter((t=>e.eq(t,o))).length>0:void 0!==o?e.eq(t.value,o):(t.props._isChecked=e.eq(t.value,t.props.onValue),t.props._isChecked)}const mc={schema:/* #__PURE__ */ec(/* #__PURE__ */U("$options",/* #__PURE__ */oc(/* #__PURE__ */pc("$label"),/* #__PURE__ */fc(/* #__PURE__ */vc(/* #__PURE__ */cc(/* #__PURE__ */U("$fns.isChecked($option) === true",/* #__PURE__ */uc("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */uc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */oc(/* #__PURE__ */U("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */pc("$label")),/* #__PURE__ */dc(/* #__PURE__ */ic("prefix"),/* #__PURE__ */nc(),/* #__PURE__ */U("$_isChecked === true",/* #__PURE__ */uc("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */uc("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */rc(),/* #__PURE__ */ic("suffix")))),/* #__PURE__ */sc("$help"),/* #__PURE__ */ac(/* #__PURE__ */lc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(t){var o,n,r,s;t.addProps(["enforced","multiple","offLabel","offValue","disabled","onLabel","onValue","vertical","_isChecked"]),t.props._isChecked=!1,t.props.enforced=e.undefine(t.props.enforced),t.props.multiple=e.undefine(t.props.multiple),t.props.vertical=e.undefine(t.props.vertical),"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),null!==(o=(r=t.props).onValue)&&void 0!==o||(r.onValue=!0),null!==(n=(s=t.props).offValue)&&void 0!==n||(s.offValue=!1),t.on("created",(()=>{var o;t.props._isChecked=hc(t,null),t.props.options&&t.props.multiple&&t.input(null!==(o=t.value)&&void 0!==o?o:[],!1),t.context&&(t.context.fns.isChecked=e=>hc(t,e),t.context.handlers.toggleValue=o=>n=>function(t,o,n){if(n.preventDefault(),o=o?Se(o):o,t.props.options)if(t.props.multiple){const n=Array.isArray(t.value)?[...t.value]:[],r=n.findIndex((t=>e.eq(t,o)));r>-1&&(!t.props.enforced||n.length>1)?n.splice(r,1):-1===r&&n.push(o),t.input(n)}else e.eq(t.value,o)&&!t.props.enforced?t.input(void 0):t.input(o);else t.input(e.eq(t.value,t.props.onValue)?t.props.offValue:t.props.onValue)}(t,o,n))}))},o.options]},gc=/* #__PURE__ */K("ut"),{outer:$c,inner:bc,wrapper:yc,label:xc,prefix:wc,suffix:_c,help:kc,messages:Sc,message:Lc,icon:Ac}=/* #__PURE__ */W(gc),Ic=gc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.unitBlur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",placeholder:"$placeholder || $unitParts.unit",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"}}))),Dc={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,"mile-scandinavian":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,"mile-scandinavian":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,"mile-scandinavian":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,"mile-scandinavian":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,"mile-scandinavian":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,"mile-scandinavian":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,"mile-scandinavian":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,"mile-scandinavian":254e-8},"mile-scandinavian":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,"mile-scandinavian":1}},Cc={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},Tc={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},Ec={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},Oc={liter:{liter:1,milliliter:1e3,gallon:.264172,"fluid-ounce":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,"fluid-ounce":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,"fluid-ounce":128},"fluid-ounce":{liter:.0295735,milliliter:29.5735,gallon:.0078125,"fluid-ounce":1}},Mc={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},Vc={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function Fc(t){let o=!1;function n(e){var n,r,s;const i=(`${e}`.match(/\-/g)||[]).length%2==1;e=function(e){e=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${e}`),isNaN(e)&&(e=e.split(t.props.unitParts.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(e=e.replace(/[^0-9\.]/g,""),e.includes(".")){const o=e.split(".");0===t.props.decimals?e=o[0]:"currency"===t.props.type&&(o[1]=o[1].padEnd(p(),"0").slice(0,p()),e=o.join("."))}return e}(e);const d={};"unit"!==a()&&"decimal"!==a()||(d.minimumFractionDigits=e.includes(".")?1:0),d.maximumFractionDigits="currency"===t.props.type?p():t.props.decimals,t.props.minDecimals&&(d.minimumFractionDigits=t.props.minDecimals,e&&!e.includes(".")&&(e+=".".padEnd(t.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&e.includes(".")&&(e=e.split(".")[0]);let c="";if(!isNaN(e)&&""!==e.trim()&&(e=i?`-${e}`:e,t.props.max&&!isNaN(t.props.max)&&(e=Number(e)>t.props.max?`${t.props.max}`:e),t.props.min&&!isNaN(t.props.min)&&(e=Number(e)<t.props.min?`${t.props.min}`:e),e.includes(".")&&"currency"===t.props.type?e=e.split(".")[0].padStart(1,"0")+"."+(null!==(n=e.split(".")[1])&&void 0!==n?n:"0"):"currency"===t.props.type&&(d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0),c=l(t.props.displayLocale,d).format(e),"unit"===t.props.type&&"."===e[e.length-1])){const o=c.lastIndexOf(t.props.unitParts.decimal);c=c.slice(0,o+1)+c.slice(o+2),e=e.slice(0,-1)}let u,f=e.split(".");"currency"===t.props.type&&(f=f[0]+(null!==(s=f[1])&&void 0!==s?s:"").padEnd(p(),"0"),f.length>1&&(f=f.replace(/^0+/,""),f=""!==e&&""===f?"0":f)),t.props.valueStore={number:e,integer:f,string:c},o=!0,t.props.valueStore&&(u=t.props.valueStore.hasOwnProperty(t.props.valueFormat)?t.props.valueStore[t.props.valueFormat]:t.props.valueStore.number),t.input(""===u?void 0:u).then((()=>(o=!1,Promise.resolve())))}function r(){e.whenAvailable(`${t.props.id}`,(e=>{var o,n;e instanceof HTMLInputElement&&(e.value=null!==(n=null===(o=t.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),t.props.__root)}function s(){var e,o;const n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`#${t.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function a(){return t.props.currency?"currency":t.props.unit?"unit":"decimal"}function l(e,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return"unit"===t.props.type&&(r.unitDisplay=t.props.unitDisplay),"currency"===t.props.type&&(r.currencyDisplay=t.props.currencyDisplay),r[n]=t.props[n],new Intl.NumberFormat(e,r)}function i(e,o){var n,r,a,l,i;const p=null===(n=t.props.__root)||void 0===n?void 0:n.querySelector(`#${t.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(r=t.props.unitParts.unit)||void 0===r?void 0:r.length)&&void 0!==a?a:0)+(null!==(i=null===(l=t.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);t.props.unitParts.unitLeft?e=Math.max(e,d):(e=Math.min(e,s().length-d),"insertText"===o&&0===e&&(e=1)),p.setSelectionRange(e,e)}function p(){return void 0!==t.props.decimals?t.props.decimals:void 0!==t.props.minDecimals&&t.props.minDecimals>t.props.unitParts.fractionLength?t.props.minDecimals:t.props.unitParts.fractionLength}t.props.valueStore=null,t.on("input",(({payload:e})=>{o||(n(e),r())})),t.context&&(t.context.handlers.init=(e=null)=>{var o;t.props.skipInit?t.props.skipInit=!1:function(){var e,o,n,r,s,a,i;t.props.skipInit=!0;const p=l(t.props.displayLocale).formatToParts(12345678.12345678);t.props.unitParts={decimal:null===(e=p.find((e=>"decimal"==e.type)))||void 0===e?void 0:e.value,group:null===(o=p.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=p.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(p[0].type),literal:null!==(s=null===(r=p.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==s?s:"",fractionLength:null!==(i=null===(a=p.find((e=>"fraction"==e.type)))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(o=null!=e?e:t._value)&&void 0!==o?o:"";t.props.valueStore?s=t.props.valueStore.number:"integer"===t.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(".",p())}(`${null!=s?s:""}`)),"unit"===t.props.type&&t.props.valueUnit&&t.props.unit&&t.props.valueUnit!==t.props.unit&&t.hook.input(((e,o)=>{const n=function(e,t,o){if(Dc[e]&&Dc[e][o])return t*Dc[e][o];if(Cc[e]&&Cc[e][o])return Cc[e][o](t);if(Tc[e]&&Tc[e][o])return t*Tc[e][o];if(Ec[e]&&Ec[e][o])return t*Ec[e][o];if(Oc[e]&&Oc[e][o])return t*Oc[e][o];if(Mc[e]&&Mc[e][o])return t*Mc[e][o];if(Vc[e]&&Vc[e][o])return t*Vc[e][o];throw new Error("Conversion not supported")}(t.props.unit,e,t.props.valueUnit);return isNaN(n)?o(e):o(+n.toFixed(Number(t.props.valueDecimals)||2))})),n(s),r()},t.context.handlers.handleBeforeInput=e=>{var o,r,s,a,l,p,d,c,u;if(!t.props.inExecCommand&&"insertLineBreak"!==e.inputType&&(e.preventDefault(),e.stopPropagation(),e.target instanceof HTMLInputElement)){const f=e.target,v=null!==(o=e.data)&&void 0!==o?o:"",h=null!==(r=e.target.value)&&void 0!==r?r:"",m=null!==(s=e.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=e.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(t.props.unitParts.decimal);let y=(null!==(l=e.target.selectionStart)&&void 0!==l?l:0)+(e.data?0:-1),x=h,w=1;if(h.includes(t.props.unitParts.decimal)&&v===t.props.unitParts.decimal)return v===t.props.unitParts.decimal&&(y=x.indexOf(t.props.unitParts.decimal)+1),void i(y);if(!(null===t.props.min||t.props.min<0||t.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===t.props.unitParts.decimal&&0===t.props.decimals)return;if("deleteByCut"===e.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),"insertFromPaste"===e.inputType){const t=null!==(p=e.data)&&void 0!==p?p:"";x=x.slice(0,m)+t+x.slice(g)}if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.group?(w+=1,y-=1):"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&"insertText"===e.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=e.data)&&void 0!==d?d:"0"):"insertText"===e.inputType?(y=g,x=x.slice(0,m)+e.data+x.slice(g)):"deleteContentForward"===e.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):"deleteContentBackward"===e.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}else if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m-1),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}if(n(x),x=(null===(c=t.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=t.props.valueStore)||void 0===u?void 0:u.number)||"",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=e.inputType.includes("delete")?-1:1),f.setSelectionRange(0,h.length),t.props.inExecCommand=!0,document.execCommand("insertText",void 0,x),t.props.inExecCommand=!1,v===t.props.unitParts.decimal?y=x.indexOf(t.props.unitParts.decimal)+1:h.includes(t.props.unitParts.decimal)&&!x.includes(t.props.unitParts.decimal)&&(y=x.length),"insertText"===e.inputType&&t.props.minDecimals&&(!t.value||0===m&&g===h.length||-1===b&&t.props.minDecimals&&h)){let e=0;e=t.props.unitParts.unit?t.props.unitParts.unit.length+1:0,y-=t.props.minDecimals,t.props.unitParts.unitLeft?y-=e-1:y-=e+1}i(Math.max(0,y),e.inputType)}},t.context.handlers.handleInput=e=>{t.emit("dom-input-event",e),e.target instanceof HTMLInputElement&&(t.props.inputText=e.target.value,n(e.target.value))},t.context.handlers.handleKeyDown=e=>{var o,a;if(e.target instanceof HTMLInputElement&&("ArrowUp"===e.key||"ArrowDown"===e.key)){const l="ArrowUp"===e.key?1*t.props.step:-1*t.props.step;n(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===(o=t.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==a?a:0,l)),r(),setTimeout((()=>{i(s().length)}),1)}})}const Pc={schema:/* #__PURE__ */$c(/* #__PURE__ */yc(/* #__PURE__ */xc("$label"),/* #__PURE__ */bc(/* #__PURE__ */Ac("prefix"),/* #__PURE__ */wc(),/* #__PURE__ */Ic(),/* #__PURE__ */_c(),/* #__PURE__ */Ac("suffix"))),/* #__PURE__ */kc("$help"),/* #__PURE__ */Sc(/* #__PURE__ */Lc("$message.value"))),type:"input",family:"text",features:[function(e){var t,o,n,r,s,a;const l=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat","unitDisplay","placeholder","unitParts","valueUnit","valueDecimals"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||"en-US"),e.props.unitDisplay=e.props.unitDisplay||"short","false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\d+\,\s*%?$/;return/\d+\.\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,""),t.target.value=o)},Fc(e),e.context.handlers.init(),l.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]},Bc=/* #__PURE__ */K("cr"),{outer:Hc,inner:Rc,wrapper:Nc,label:Kc,prefix:Wc,suffix:qc,help:Uc,messages:zc,message:Yc,icon:jc}=/* #__PURE__ */W(Bc),Zc=Bc("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",placeholder:"$placeholder || $unitParts.unit",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 Gc={schema:/* #__PURE__ */Hc(/* #__PURE__ */Nc(/* #__PURE__ */Kc("$label"),/* #__PURE__ */Rc(/* #__PURE__ */jc("prefix"),/* #__PURE__ */Wc(),/* #__PURE__ */Zc(),/* #__PURE__ */qc(),/* #__PURE__ */jc("suffix"))),/* #__PURE__ */Uc("$help"),/* #__PURE__ */zc(/* #__PURE__ */Yc("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i;const p=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat","currencyDisplay","placeholder","unitParts"];e.addProps(p),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(Fc(e),e.context.handlers.init(),p.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]};var Xc=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:br,colorpicker:Jd,currency:Gc,datepicker:ul,dropdown:Zt,mask:si,rating:Mn,repeater:jo,slider:Yp,taglist:Vl,toggle:mo,togglebuttons:mc,transferlist:hp,unit:Pc});const Jc="undefined"!=typeof window?setInterval:()=>0,Qc=new WeakSet;exports.$if=U,exports.autocomplete=br,exports.colorpicker=Jd,exports.createBaseSections=W,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Qc.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:h(13919),children:`${h(451228594)}${h(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){k[e]?k[e].add(t):k[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(!d.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];Qc.add(o),o.define({...r,schema:n(e)})}Jc((()=>b.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}},exports.createSectionFactory=K,exports.currency=Gc,exports.datepicker=ul,exports.dropdown=Zt,exports.inputs=Xc,exports.mask=si,exports.rating=Mn,exports.repeater=jo,exports.slider=Yp,exports.taglist=Vl,exports.toggle=mo,exports.togglebuttons=mc,exports.transferlist=hp,exports.unit=Pc;