@formkit/pro 0.125.6 → 0.125.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +2 -2
- package/index.mjs +2 -2
- package/package.json +2 -2
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=()=>[30548127325,27022924,34729821653783].map($).join("y"),c=/^[0-9a-f]+$/,u="undefined"!=typeof window,f=S(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})),v=u?setTimeout:()=>0,h=e=>{clearTimeout(m[e])},m={},$=e=>e.toString(32),g=e=>`${$(f[e]).substring(2)}.${$(s[e%(s.length-1)])}`;const b={},y={},x=new Set(["",null,void 0]);function w(e,t){e in b||(b[e]={timer:0,inputs:new Set});const o=b[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=v((()=>{m[e]||(m[e]=v((()=>x.add(e)),2e3)),function(e){if(u){window.addEventListener(d(),(t=>{const o=new URL(t.blockedURI).hostname;f.some(((e,t)=>g(t)===o))&&(_(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=$(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(b[e].inputs),p=a.filter((t=>!(y[e]&&y[e].has(t)))).join("");if(h(e),p){t++;try{const s=await window[$(i)](`${o}${n}${g((r+t)%f.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[$(l)])return _(e,d.schema);if(s.ok)return y[e]||(y[e]=new Set),void a.forEach((t=>y[e].add(t)))}catch(e){}t<2&&v(s,1e4*Math.random())}};s()}}(e)}),500)}function _(e,t){x.add(e),function(e,t){L[e]&&L[e].forEach((e=>e(t)))}(e,t)}function k(e,t,o){if(w(t,o),!t)throw new Error("FormKitNoKey");return x.has(t)?null:e}function S(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const L={};const A=()=>({$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"}}),D=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),I=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),C=()=>({$el:"ul",if:"$fns.length($messages)"}),E=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),O=()=>({$el:"div",if:"$help"}),T=()=>({$el:null}),M=(e,t)=>()=>o.icon(e,t),V=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),B=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),P=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),H=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),R=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),K=()=>({$el:null,for:["part","$_overlayParts"]});function N(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=W(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:k.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=W(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:k.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=W(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:k.bind(null,t,n,e)}))}return o}return W(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function W(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 q(e){return(t,o,n=!1)=>N(e,t,o,n)}function z(e){return{outer:e("outer",A,!0),wrapper:e("wrapper","div",!1),inner:e("inner",D,!1),icon:M,label:e("label",I,!1),prefix:e("prefix",T,!1),suffix:e("suffix",T,!1),help:e("help",O,!1),messages:e("messages",C,!1),message:e("message",E,!1)}}function U(e){return{overlayPlaceholder:e("overlayPlaceholder",V),overlayLiteral:e("overlayLiteral",F),overlayChar:e("overlayChar",B),overlayEnum:e("overlayEnum",P),overlay:e("overlay",H),overlayParts:e("overlayParts",K),overlayInner:e("overlayInner",R)}}function Y(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 j(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(Y("$option.group",v(h("$option.group"),m(f((n=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),$=a(Y("$fns.isSelected($option)",M("selected")),c("$option.label")),r=>{const s=s=>{const a=$(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=$._s,s})))),a(Y("$fns.isSelected($option)",M("selected")),c("$option.label")))),l(Y("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",i(Y("$state.loading",M("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var n,$}}const Z=/* #__PURE__ */q("dd"),{outer:G,wrapper:X,inner:J,icon:Q,label:ee,prefix:te,suffix:oe,help:ne,messages:re,message:se}=/* #__PURE__ */z(Z),ae=Z("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"}}))),le=Z("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ie=Z("selection",(()=>({$el:"div"}))),pe=Z("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'}}}))),de=Z("optionLoading","span"),ce=Z("option",(()=>({$el:"div"}))),ue=Z("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),fe=Z("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ve=Z("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),he=Z("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),me=Z("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 || ""'}))),$e=Z("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)"}}))),ge=Z("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),be=Z("tagLabel",(()=>({$el:"span"}))),ye=Z("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),xe=Z("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),we=Z("tagLoading","span"),_e=/* #__PURE__ */j(Z);function ke(t){return e.isRecord(t)&&"value"in t&&"label"in t}function Se(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 Le(){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 Ae(e){return"__original"in e?e.__original:e.value}const De=new WeakMap,Ie=new WeakMap;async function Ce(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Ie.get(e));const o=t?e.props.debounce:0;0===o?Ee(e,n):Ie.set(e,setTimeout((()=>{e.props.page=1,Ee(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 Ee(e,t){e.props.allowAppendOptions=t,Be(e)}const Oe=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Te=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function Me(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=Ae(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}))),De.set(e,e.props.searchValue)}const Ve=new WeakMap;function Fe(t,o,n){if(t.store.set(Oe),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}:ke(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(Ae(t),Ae(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||ke(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 Be(e){e.store.set(Oe),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,Ve.get(e)),r=Me.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 Pe(e,o){e.props.page++,Ve.set(e,o),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const He=Symbol(),Re=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(Ae(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 Ke(t,o){if(t.props.optionRemoved=!0,o){const n=(t.props.inputStd||[]).filter((t=>!e.eq(Ae(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 Ne(e){const t=Re(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:u&&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 We(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=Ae(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find((o=>e.eq(Ae(o),t.props.activeSelectionValue)));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=Ae(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=Ae(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=Ae(t.props.selections[t.props.selections.length-1]):t.props.activeValue=Ae(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=Ae(t.props.allOptions[0])}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function qe(e){return e.reduce(((e,t)=>(t.options?e.push(...qe(t.options)):e.push(t),e)),[])}function ze(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(Ae(t)!==He?(e.props.option=t,e.props.maxReached&&!je(e,t)||(e.input(Ue(e,Ae(t))),je(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function Ue(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 Ye(t,o){return e.eq(t.props.activeValue,Ae(o))||void 0}function je(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,Ae(o)))return!0;return!1}return e.eq(t.value,Ae(o))}function Ze(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 Ge(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=Be(t);e instanceof Promise&&e.then((()=>{Ne(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&&Ne(t):(o=t.props.inputStd,async function(t){const o=Re(t),n=t.props.inputStd.length>1?t.props.inputStd.filter((o=>!t.props.memoOptions.find((t=>e.eq(Ae(t),o))))):t.props.inputStd;if(n.forEach((n=>{Fe(t,n,Array.isArray(o)&&o.find((t=>e.eq(Ae(t),n)&&!t.noOptionFound)))})),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",(()=>{Ne(t),t.props.optionLoadingCounter||t.off(e)}))}else Ne(t)}(t))}))}const Xe=new WeakSet;function Je(t){if(!u)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,Ae(o)))),-1===s&&(s=null);(null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant))&&Qe(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=et.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);Xe.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||Xe.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]),Xe.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=Ae(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||Qe(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)),Xe.has(e)?requestAnimationFrame(a.bind(null,e,t,o)):s(e,o)):Xe.delete(e)}t.on("prop:trackHover",(({payload:e})=>{var o,r,s;u&&(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(),We(t)):document.removeEventListener("mousemove",o)})),t.on("prop:trackHover",(({payload:e})=>{var o,r;u&&(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===He)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(Ae(t.props.options[s].options[a]),o)){r=a,n=s;break}if(e.eq(Ae(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 Qe(e){var t,o;if(!u)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 et(){}const tt=new WeakMap;function ot(t){t.on("created",(()=>{if(!t.context||!u)return;t.context.fns.isActive=Ye.bind(null,t),t.context.fns.isSelected=e=>je(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(Ae(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=ut,t.context.handlers.selectOption=e=>o=>ft.call(null,t,e,o),t.context.handlers.loadMore=Ee.bind(null,t),t.context.handlers.removeSelection=e=>o=>ct(t,e,o),t.context.handlers.tagTouchstart=e=>o=>ct(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?at.bind(null,t,e):st.bind(null,t),t.context.handlers.selectionBlur=()=>lt.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,Ae(o)),t.context.handlers.tagClick=e=>it.bind(null,t,e),t.context.handlers.tagFocus=e=>pt.bind(null,t,e),t.context.handlers.tagBlur=()=>dt.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=nt.bind(null,t),t.context.handlers.touchend=rt.bind(null,t)}))}function nt(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=tt.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else tt.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function rt(e){tt.delete(e)}function st(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 at(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Ae(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Ae(o),n.currentTarget.focus()))}function lt(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 it(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Ae(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Ae(o),n.currentTarget.focus())))}function pt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=Ae(t),e.props.justFocused=!0)}function dt(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 ct(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},Ke(e,t))}function ut(e){e.stopPropagation()}function ft(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},ze(e,t))}function vt(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=qe(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:He},o.props.loadOptions=Be,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=Pe.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",(()=>Ze(o))),o.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ze(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,Ae(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),Ge(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),Je(t),t.props.loadOnCreated&&!t.props.optionsLoaded?Be(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),ot(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=qe(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),We(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(u)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 ht(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 mt(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 $t(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(Ae(t)),e}),[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(He);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 gt(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=Ae(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=Ae(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function bt(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 yt(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=Le(),s=t.props.selections.findIndex((t=>e.eq(Ae(t),Ae(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=Ae(o),t.input([...a.map(Ae)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const n=t.props.selections.findIndex((t=>e.eq(Ae(t),Ae(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=Ae(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function xt(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(Ae(t),Ae(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"},Ke(t,o)}function wt(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(Ue(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===He)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find((o=>e.eq(Ae(o),t.props.activeValue)));if(!o)return;ze(t,o)}else t.props.expanded=!0}function _t(e){e.props.expanded&&(e.props.expanded=!1)}function kt(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":bt(e);break;case"ArrowRight":case"ArrowLeft":yt(e,t,o,!1);break;case"Delete":case"Backspace":xt(e,t,o)}}function St(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(Ae(t),Ae(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(Ae(t),Ae(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(Ae(t),Ae(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=Ae(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"}),Ke(t,o)}(t,o)}}function Lt(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":$t(e,o,t);break;case"ArrowLeft":case"ArrowRight":gt(e,o);break;case"Enter":wt(e,t);break;case"Escape":_t(e);break;case"Delete":case"Backspace":mt(e);break;default:e.emit("unusedKeydown",t)}}function At(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":$t(e,o,t);break;case"ArrowRight":case"ArrowLeft":gt(e,o);break;case"Enter":wt(e,t);break;case"Escape":_t(e);break;case"Delete":case"Backspace":mt(e)}}function Dt(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",(()=>{t.context&&(t.context.handlers.click=It.bind(null,t),t.context.handlers.focus=Ct.bind(null,t),t.context.handlers.keydown=Lt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>kt.bind(null,t,e))}))}function It(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 Ct(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 Et(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===He)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find((o=>e.eq(Ae(o),t.props.activeValue)));if(!o)return;ze(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=Ae(s)),o=setTimeout((()=>{n=""}),400)}}))}function Ot(t){Tt(t),t.on("prop:selections",(()=>{t.props.skipFormatSelections=!1,Tt(t)})),u&&e.whenAvailable(`${t.props.id}_selections`,Vt.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 Mt(e){var t,o;if(!u||!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 Vt(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Mt(e))})),n=new ResizeObserver((()=>{Mt(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Ft={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Bt={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Pt={overflow:"hidden",height:"100%"},Ht={},Rt={};let Kt=0;function Nt(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 Wt(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},$=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>$?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,Ae(o))))),-1===s&&(s=null)}return s}function qt(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(Ft),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Nt.bind(null,o),o.props.positionListBox=Wt.bind(null,o))})),o.on("prop:expanded",(({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Kt=document.documentElement.scrollTop;for(const e in Bt)Rt[e]=document.documentElement.style[e],document.documentElement.style[e]=Bt[e];for(const e in Pt)Ht[e]=document.body.style[e],document.body.style[e]=Pt[e];document.body.scrollTop=Kt}():function(){for(const e in Bt)document.documentElement.style[e]=Rt[e];for(const e in Pt)document.body.style[e]=Ht[e];document.body.scrollTop=0,document.documentElement.scrollTop=Kt}())}))}function zt(t){t.addProps(["multiLine"]),t.on("created",(()=>{u&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,Ut.bind(null,t),t.props.__root))}))}function Ut(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),Yt(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 Yt(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 jt(t){if(t.on("created",(()=>{t.context&&Et(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,Ot(t),t.on("prop:selections",(()=>{Ot(t)}))),"tags"===t.props.selectionAppearance&&zt(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=[],Be(t))})),"overscroll"===t.props.behavior&&qt(t)}const Zt=(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 Gt(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){e?(null==o||o.showPopover(),setTimeout((()=>{t.props.popoverCoordinates.height=(null==o?void 0:o.offsetHeight)||0}),5)):(null==o?void 0:o.matches(":popover-open"))&&(null==o||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=Zt((()=>{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 Xt={schema:/* #__PURE__ */G(/* #__PURE__ */X(/* #__PURE__ */ee("$label"),/* #__PURE__ */J(/* #__PURE__ */Q("prefix"),/* #__PURE__ */te(),/* #__PURE__ */ae(/* #__PURE__ */Y("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */pe('$placeholder || "placeholder"'),/* #__PURE__ */Y("$multiple !== true",/* #__PURE__ */le(/* #__PURE__ */Y("$state.loading && $selections.length === 0",/* #__PURE__ */de("$ui.isLoading.value"),/* #__PURE__ */ie(/* #__PURE__ */ce("$option.label")))),/* #__PURE__ */Y('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */fe(/* #__PURE__ */ve(/* #__PURE__ */Y("$state.loading && $selections.length === 0",/* #__PURE__ */de("$ui.isLoading.value"),/* #__PURE__ */me()))),/* #__PURE__ */Y('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */ye(/* #__PURE__ */xe(/* #__PURE__ */Y("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */de("$ui.isLoading.value"),/* #__PURE__ */$e(/* #__PURE__ */ge(/* #__PURE__ */Y("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */we("$ui.isLoading.value"),/* #__PURE__ */be("$option.label")),/* #__PURE__ */ue(/* #__PURE__ */Q("close"))))))))))),/* #__PURE__ */Y("$truncationCount && $state.loading !== true",/* #__PURE__ */he("$truncationCount")),/* #__PURE__ */Y("$state.loading",/* #__PURE__ */Q("loader")),/* #__PURE__ */Y("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */ue(/* #__PURE__ */Q("close")),/* #__PURE__ */Q("select"))),/* #__PURE__ */_e(),/* #__PURE__ */oe(),/* #__PURE__ */Q("suffix"))),/* #__PURE__ */ne("$help"),/* #__PURE__ */re(/* #__PURE__ */se("$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=()=>[30548127325,27022924,34729821653783].map($).join("y"),c=/^[0-9a-f]+$/,u="undefined"!=typeof window,f=S(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})),v=u?setTimeout:()=>0,h=e=>{clearTimeout(m[e])},m={},$=e=>e.toString(32),g=e=>`${$(f[e]).substring(2)}.${$(s[e%(s.length-1)])}`;const b={},y={},x=new Set(["",null,void 0]);function w(e,t){e in b||(b[e]={timer:0,inputs:new Set});const o=b[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=v((()=>{m[e]||(m[e]=v((()=>x.add(e)),2e3)),function(e){if(u){window.addEventListener(d(),(t=>{const o=new URL(t.blockedURI).hostname;f.some(((e,t)=>g(t)===o))&&(_(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=$(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(b[e].inputs),p=a.filter((t=>!(y[e]&&y[e].has(t)))).join("");if(h(e),p){t++;try{const s=await window[$(i)](`${o}${n}${g((r+t)%f.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[$(l)])return _(e,d.schema);if(s.ok)return y[e]||(y[e]=new Set),void a.forEach((t=>y[e].add(t)))}catch(e){}t<2&&v(s,1e4*Math.random())}};s()}}(e)}),500)}function _(e,t){x.add(e),function(e,t){L[e]&&L[e].forEach((e=>e(t)))}(e,t)}function k(e,t,o){if(w(t,o),!t)throw new Error("FormKitNoKey");return x.has(t)?null:e}function S(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const L={};const A=()=>({$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"}}),D=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),I=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),C=()=>({$el:"ul",if:"$fns.length($messages)"}),E=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),O=()=>({$el:"div",if:"$help"}),T=()=>({$el:null}),M=(e,t)=>()=>o.icon(e,t),V=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),B=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),P=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),H=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),R=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),K=()=>({$el:null,for:["part","$_overlayParts"]});function N(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=W(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:k.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=W(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:k.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=W(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:k.bind(null,t,n,e)}))}return o}return W(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function W(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 q(e){return(t,o,n=!1)=>N(e,t,o,n)}function z(e){return{outer:e("outer",A,!0),wrapper:e("wrapper","div",!1),inner:e("inner",D,!1),icon:M,label:e("label",I,!1),prefix:e("prefix",T,!1),suffix:e("suffix",T,!1),help:e("help",O,!1),messages:e("messages",C,!1),message:e("message",E,!1)}}function U(e){return{overlayPlaceholder:e("overlayPlaceholder",V),overlayLiteral:e("overlayLiteral",F),overlayChar:e("overlayChar",B),overlayEnum:e("overlayEnum",P),overlay:e("overlay",H),overlayParts:e("overlayParts",K),overlayInner:e("overlayInner",R)}}function Y(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 j(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(Y("$option.group",v(h("$option.group"),m(f((n=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),$=a(Y("$fns.isSelected($option)",M("selected")),c("$option.label")),r=>{const s=s=>{const a=$(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=$._s,s})))),a(Y("$fns.isSelected($option)",M("selected")),c("$option.label")))),l(Y("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",i(Y("$state.loading",M("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var n,$}}const Z=/* #__PURE__ */q("dd"),{outer:G,wrapper:X,inner:J,icon:Q,label:ee,prefix:te,suffix:oe,help:ne,messages:re,message:se}=/* #__PURE__ */z(Z),ae=Z("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"}}))),le=Z("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ie=Z("selection",(()=>({$el:"div"}))),pe=Z("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'}}}))),de=Z("optionLoading","span"),ce=Z("option",(()=>({$el:"div"}))),ue=Z("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),fe=Z("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ve=Z("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),he=Z("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),me=Z("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 || ""'}))),$e=Z("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)"}}))),ge=Z("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),be=Z("tagLabel",(()=>({$el:"span"}))),ye=Z("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),xe=Z("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),we=Z("tagLoading","span"),_e=/* #__PURE__ */j(Z);function ke(t){return e.isRecord(t)&&"value"in t&&"label"in t}function Se(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 Le(){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 Ae(e){return"__original"in e?e.__original:e.value}const De=new WeakMap,Ie=new WeakMap;async function Ce(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Ie.get(e));const o=t?e.props.debounce:0;0===o?Ee(e,n):Ie.set(e,setTimeout((()=>{e.props.page=1,Ee(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 Ee(e,t){e.props.allowAppendOptions=t,Be(e)}const Oe=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Te=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function Me(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=Ae(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}))),De.set(e,e.props.searchValue)}const Ve=new WeakMap;function Fe(t,o,n){if(t.store.set(Oe),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}:ke(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(Ae(t),Ae(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||ke(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 Be(e){e.store.set(Oe),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,Ve.get(e)),r=Me.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 Pe(e,o){e.props.page++,Ve.set(e,o),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const He=Symbol(),Re=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(Ae(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 Ke(t,o){if(t.props.optionRemoved=!0,o){const n=(t.props.inputStd||[]).filter((t=>!e.eq(Ae(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 Ne(e){const t=Re(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:u&&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 We(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=Ae(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find((o=>e.eq(Ae(o),t.props.activeSelectionValue)));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=Ae(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=Ae(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=Ae(t.props.selections[t.props.selections.length-1]):t.props.activeValue=Ae(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=Ae(t.props.allOptions[0])}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function qe(e){return e.reduce(((e,t)=>(t.options?e.push(...qe(t.options)):e.push(t),e)),[])}function ze(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(Ae(t)!==He?(e.props.option=t,e.props.maxReached&&!je(e,t)||(e.input(Ue(e,Ae(t))),je(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function Ue(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 Ye(t,o){return e.eq(t.props.activeValue,Ae(o))||void 0}function je(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,Ae(o)))return!0;return!1}return e.eq(t.value,Ae(o))}function Ze(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 Ge(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=Be(t);e instanceof Promise&&e.then((()=>{Ne(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&&Ne(t):(o=t.props.inputStd,async function(t){const o=Re(t),n=t.props.inputStd.length>1?t.props.inputStd.filter((o=>!t.props.memoOptions.find((t=>e.eq(Ae(t),o))))):t.props.inputStd;if(n.forEach((n=>{Fe(t,n,Array.isArray(o)&&o.find((t=>e.eq(Ae(t),n)&&!t.noOptionFound)))})),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",(()=>{Ne(t),t.props.optionLoadingCounter||t.off(e)}))}else Ne(t)}(t))}))}const Xe=new WeakSet;function Je(t){if(!u)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,Ae(o)))),-1===s&&(s=null);(null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant))&&Qe(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=et.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);Xe.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||Xe.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]),Xe.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=Ae(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||Qe(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)),Xe.has(e)?requestAnimationFrame(a.bind(null,e,t,o)):s(e,o)):Xe.delete(e)}t.on("prop:trackHover",(({payload:e})=>{var o,r,s;u&&(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(),We(t)):document.removeEventListener("mousemove",o)})),t.on("prop:trackHover",(({payload:e})=>{var o,r;u&&(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===He)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(Ae(t.props.options[s].options[a]),o)){r=a,n=s;break}if(e.eq(Ae(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 Qe(e){var t,o;if(!u)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 et(){}const tt=new WeakMap;function ot(t){t.on("created",(()=>{if(!t.context||!u)return;t.context.fns.isActive=Ye.bind(null,t),t.context.fns.isSelected=e=>je(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(Ae(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=ut,t.context.handlers.selectOption=e=>o=>ft.call(null,t,e,o),t.context.handlers.loadMore=Ee.bind(null,t),t.context.handlers.removeSelection=e=>o=>ct(t,e,o),t.context.handlers.tagTouchstart=e=>o=>ct(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?at.bind(null,t,e):st.bind(null,t),t.context.handlers.selectionBlur=()=>lt.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,Ae(o)),t.context.handlers.tagClick=e=>it.bind(null,t,e),t.context.handlers.tagFocus=e=>pt.bind(null,t,e),t.context.handlers.tagBlur=()=>dt.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=nt.bind(null,t),t.context.handlers.touchend=rt.bind(null,t)}))}function nt(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=tt.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else tt.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function rt(e){tt.delete(e)}function st(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 at(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Ae(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Ae(o),n.currentTarget.focus()))}function lt(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 it(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Ae(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Ae(o),n.currentTarget.focus())))}function pt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=Ae(t),e.props.justFocused=!0)}function dt(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 ct(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},Ke(e,t))}function ut(e){e.stopPropagation()}function ft(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},ze(e,t))}function vt(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=qe(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:He},o.props.loadOptions=Be,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=Pe.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",(()=>Ze(o))),o.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ze(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,Ae(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),Ge(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),Je(t),t.props.loadOnCreated&&!t.props.optionsLoaded?Be(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),ot(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=qe(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),We(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(u)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 ht(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 mt(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 $t(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(Ae(t)),e}),[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(He);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 gt(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=Ae(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=Ae(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function bt(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 yt(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=Le(),s=t.props.selections.findIndex((t=>e.eq(Ae(t),Ae(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=Ae(o),t.input([...a.map(Ae)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const n=t.props.selections.findIndex((t=>e.eq(Ae(t),Ae(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=Ae(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function xt(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(Ae(t),Ae(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"},Ke(t,o)}function wt(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(Ue(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===He)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find((o=>e.eq(Ae(o),t.props.activeValue)));if(!o)return;ze(t,o)}else t.props.expanded=!0}function _t(e){e.props.expanded&&(e.props.expanded=!1)}function kt(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":bt(e);break;case"ArrowRight":case"ArrowLeft":yt(e,t,o,!1);break;case"Delete":case"Backspace":xt(e,t,o)}}function St(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(Ae(t),Ae(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(Ae(t),Ae(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(Ae(t),Ae(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=Ae(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"}),Ke(t,o)}(t,o)}}function Lt(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":$t(e,o,t);break;case"ArrowLeft":case"ArrowRight":gt(e,o);break;case"Enter":wt(e,t);break;case"Escape":_t(e);break;case"Delete":case"Backspace":mt(e);break;default:e.emit("unusedKeydown",t)}}function At(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":$t(e,o,t);break;case"ArrowRight":case"ArrowLeft":gt(e,o);break;case"Enter":wt(e,t);break;case"Escape":_t(e);break;case"Delete":case"Backspace":mt(e)}}function Dt(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",(()=>{t.context&&(t.context.handlers.click=It.bind(null,t),t.context.handlers.focus=Ct.bind(null,t),t.context.handlers.keydown=Lt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>kt.bind(null,t,e))}))}function It(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 Ct(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 Et(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===He)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find((o=>e.eq(Ae(o),t.props.activeValue)));if(!o)return;ze(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=Ae(s)),o=setTimeout((()=>{n=""}),400)}}))}function Ot(t){Tt(t),t.on("prop:selections",(()=>{t.props.skipFormatSelections=!1,Tt(t)})),u&&e.whenAvailable(`${t.props.id}_selections`,Vt.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 Mt(e){var t,o;if(!u||!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 Vt(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Mt(e))})),n=new ResizeObserver((()=>{Mt(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Ft={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Bt={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Pt={overflow:"hidden",height:"100%"},Ht={},Rt={};let Kt=0;function Nt(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 Wt(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},$=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>$?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,Ae(o))))),-1===s&&(s=null)}return s}function qt(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(Ft),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Nt.bind(null,o),o.props.positionListBox=Wt.bind(null,o))})),o.on("prop:expanded",(({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Kt=document.documentElement.scrollTop;for(const e in Bt)Rt[e]=document.documentElement.style[e],document.documentElement.style[e]=Bt[e];for(const e in Pt)Ht[e]=document.body.style[e],document.body.style[e]=Pt[e];document.body.scrollTop=Kt}():function(){for(const e in Bt)document.documentElement.style[e]=Rt[e];for(const e in Pt)document.body.style[e]=Ht[e];document.body.scrollTop=0,document.documentElement.scrollTop=Kt}())}))}function zt(t){t.addProps(["multiLine"]),t.on("created",(()=>{u&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,Ut.bind(null,t),t.props.__root))}))}function Ut(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),Yt(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 Yt(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 jt(t){if(t.on("created",(()=>{t.context&&Et(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,Ot(t),t.on("prop:selections",(()=>{Ot(t)}))),"tags"===t.props.selectionAppearance&&zt(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=[],Be(t))})),"overscroll"===t.props.behavior&&qt(t)}const Zt=(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 Gt(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=Zt((()=>{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 Xt={schema:/* #__PURE__ */G(/* #__PURE__ */X(/* #__PURE__ */ee("$label"),/* #__PURE__ */J(/* #__PURE__ */Q("prefix"),/* #__PURE__ */te(),/* #__PURE__ */ae(/* #__PURE__ */Y("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */pe('$placeholder || "placeholder"'),/* #__PURE__ */Y("$multiple !== true",/* #__PURE__ */le(/* #__PURE__ */Y("$state.loading && $selections.length === 0",/* #__PURE__ */de("$ui.isLoading.value"),/* #__PURE__ */ie(/* #__PURE__ */ce("$option.label")))),/* #__PURE__ */Y('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */fe(/* #__PURE__ */ve(/* #__PURE__ */Y("$state.loading && $selections.length === 0",/* #__PURE__ */de("$ui.isLoading.value"),/* #__PURE__ */me()))),/* #__PURE__ */Y('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */ye(/* #__PURE__ */xe(/* #__PURE__ */Y("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */de("$ui.isLoading.value"),/* #__PURE__ */$e(/* #__PURE__ */ge(/* #__PURE__ */Y("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */we("$ui.isLoading.value"),/* #__PURE__ */be("$option.label")),/* #__PURE__ */ue(/* #__PURE__ */Q("close"))))))))))),/* #__PURE__ */Y("$truncationCount && $state.loading !== true",/* #__PURE__ */he("$truncationCount")),/* #__PURE__ */Y("$state.loading",/* #__PURE__ */Q("loader")),/* #__PURE__ */Y("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */ue(/* #__PURE__ */Q("close")),/* #__PURE__ */Q("select"))),/* #__PURE__ */_e(),/* #__PURE__ */oe(),/* #__PURE__ */Q("suffix"))),/* #__PURE__ */ne("$help"),/* #__PURE__ */re(/* #__PURE__ */se("$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"),
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/* #__PURE__ */o.localize("loadMore"),
|
|
8
8
|
/* #__PURE__ */o.localize("remove"),o.options,
|
|
9
9
|
/* #__PURE__ */vt.bind(null,ht,Dt,jt),Gt]},Jt=/* #__PURE__ */q("tg"),{outer:Qt,wrapper:eo,label:to,prefix:oo,suffix:no,help:ro,messages:so,message:ao,icon:lo}=/* #__PURE__ */z(Jt),io=Jt("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",name:"$node.name",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),po=Jt("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),co=Jt("altLabel",(()=>({$el:"label",if:"($label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner) || $altLabelPosition === true",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),uo=Jt("innerLabel",(()=>({$el:"div",if:"$valueLabelDisplay === inner && ($checked && $onValueLabel || $offValueLabel)",attrs:{style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:{if:"$checked",then:"$onValueLabel",else:"$offValueLabel"}}))),fo=Jt("valueLabel",(()=>({$el:"label",if:"$valueLabelDisplay !== hidden && $valueLabelDisplay !== inner && (($checked === true && $onValueLabel) || ($checked === false && $offValueLabel))",attrs:{for:"$id"},children:{if:"$checked && $onValueLabel",then:"$onValueLabel",else:{if:"$offValueLabel",then:"$offValueLabel"}}}))),vo=Jt("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),ho=Jt("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),mo=Jt("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),$o=()=>mo(Y("$slots.default","$slots.default",lo("thumb")));const go={schema:/* #__PURE__ */Qt(/* #__PURE__ */eo(/* #__PURE__ */co(),/* #__PURE__ */vo(/* #__PURE__ */oo(),/* #__PURE__ */io(),/* #__PURE__ */ho(/* #__PURE__ */uo(),/* #__PURE__ */$o()),/* #__PURE__ */no()),/* #__PURE__ */fo(),/* #__PURE__ */po()),/* #__PURE__ */ro("$help"),/* #__PURE__ */so(/* #__PURE__ */ao("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(t){function o(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}t.on("created",(()=>{"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.altLabelPosition=e.undefine(t.props.altLabelPosition),void 0===t.props.offValue&&(t.props.offValue=!1),void 0===t.props.onValue&&(t.props.onValue=!0),t.props.checked=e.eq(t.value,t.props.onValue),t.context&&(t.context.handlers.toggles=o.bind(null,t))})),t.on("commit",(({payload:o})=>{t.props.checked=e.eq(o,t.props.onValue)}))}]},bo=/* #__PURE__ */q("rp"),{outer:yo,inner:xo,prefix:wo,suffix:_o,help:ko,messages:So,message:Lo,icon:Ao}=
|
|
10
|
-
/* #__PURE__ */z(bo),Do=bo("empty",(()=>({$el:"div"}))),Io=bo("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),Co=bo("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Eo=bo("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),Oo=bo("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),To=bo("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Mo=bo("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Vo=bo("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),Fo=bo("content","div"),Bo=bo("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),Po=bo("legend",(()=>({$el:"legend",if:"$label"}))),Ho=bo("group",(()=>({$formkit:"group",index:"$index"}))),Ro=bo("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Ko=bo("remove",(()=>({$el:"li",if:"$removeControl"}))),No=bo("insert",(()=>({$el:"li",if:"$insertControl"}))),Wo=bo("up",(()=>({$el:"li",if:"$upControl"}))),qo=bo("down",(()=>({$el:"li",if:"$downControl"}))),zo=bo("controlLabel","span"),Uo=bo("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Yo=bo("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}})));function jo(t){var o,n,r,s,a,l,i,p,d,c,u,f,v,h;if(null!==(o=(p=t.props).removeControl)&&void 0!==o||(p.removeControl=!0),null!==(n=(d=t.props).upControl)&&void 0!==n||(d.upControl=!0),null!==(r=(c=t.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=t.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=t.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=t.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(i=(h=t.props).addAttrs)&&void 0!==i||(h.addAttrs={}),t.props.draggable=e.undefine(t.props.draggable),t.props.min=void 0!==t.props.min?Number(t.props.min):1,t.props.max=void 0!==t.props.max?Number(t.props.max):1/0,t.props.min>t.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(t.value))if(t.value.length<t.props.min){const e=S(t.props.min-t.value.length,(()=>({})));t.input(t.value.concat(e),!1)}else t.value.length>t.props.max&&t.input(t.value.slice(0,t.props.max),!1);else t.input(S(t.props.min,(()=>({}))),!1);t.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(t,t.context.fns)}function Zo(e,t){if(!t.context)return;const o={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[n.animations({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};function
|
|
10
|
+
/* #__PURE__ */z(bo),Do=bo("empty",(()=>({$el:"div"}))),Io=bo("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),Co=bo("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Eo=bo("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),Oo=bo("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),To=bo("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Mo=bo("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Vo=bo("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),Fo=bo("content","div"),Bo=bo("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),Po=bo("legend",(()=>({$el:"legend",if:"$label"}))),Ho=bo("group",(()=>({$formkit:"group",index:"$index"}))),Ro=bo("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Ko=bo("remove",(()=>({$el:"li",if:"$removeControl"}))),No=bo("insert",(()=>({$el:"li",if:"$insertControl"}))),Wo=bo("up",(()=>({$el:"li",if:"$upControl"}))),qo=bo("down",(()=>({$el:"li",if:"$downControl"}))),zo=bo("controlLabel","span"),Uo=bo("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Yo=bo("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}})));function jo(t){var o,n,r,s,a,l,i,p,d,c,u,f,v,h;if(null!==(o=(p=t.props).removeControl)&&void 0!==o||(p.removeControl=!0),null!==(n=(d=t.props).upControl)&&void 0!==n||(d.upControl=!0),null!==(r=(c=t.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=t.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=t.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=t.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(i=(h=t.props).addAttrs)&&void 0!==i||(h.addAttrs={}),t.props.draggable=e.undefine(t.props.draggable),t.props.min=void 0!==t.props.min?Number(t.props.min):1,t.props.max=void 0!==t.props.max?Number(t.props.max):1/0,t.props.min>t.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(t.value))if(t.value.length<t.props.min){const e=S(t.props.min-t.value.length,(()=>({})));t.input(t.value.concat(e),!1)}else t.value.length>t.props.max&&t.input(t.value.slice(0,t.props.max),!1);else t.input(S(t.props.min,(()=>({}))),!1);t.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(t,t.context.fns)}function Zo(e,t){var o;if(!t.context)return;const r=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`#${t.props.id} .${t.context.classes.inner}`),s=null==r?void 0:r.hasAttribute("data-auto-animate"),a={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:s?[]:[n.animations({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};function l(){return Array.isArray(t.value)?t.value:[]}function i(e){t.input(e)}n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a}),t.on("prop:disabled",(({payload:t})=>{a.disabled=t,n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a})})),t.on("prop:draggable",(({payload:t})=>{a.disabled=!t,n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a})}))}const Go={schema:/* #__PURE__ */yo(/* #__PURE__ */Bo(/* #__PURE__ */Po("$label"),/* #__PURE__ */ko("$help"),/* #__PURE__ */xo(/* #__PURE__ */wo(),/* #__PURE__ */Y("$value.length === 0",/* #__PURE__ */Y("$slots.empty",/* #__PURE__ */Do()),/* #__PURE__ */Y("$slots.default",/* #__PURE__ */Oo(/* #__PURE__ */To(/* #__PURE__ */Uo(/* #__PURE__ */Yo(/* #__PURE__ */Ao("dragHandle"))),/* #__PURE__ */Fo(/* #__PURE__ */Ho("$slots.default")),/* #__PURE__ */Ro(/* #__PURE__ */Wo(/* #__PURE__ */Vo(/* #__PURE__ */zo("$ui.moveUp.value"),/* #__PURE__ */Ao("moveUp"))),/* #__PURE__ */Ko(/* #__PURE__ */Eo(/* #__PURE__ */zo("$ui.remove.value"),/* #__PURE__ */Ao("remove"))),/* #__PURE__ */No(/* #__PURE__ */Io(/* #__PURE__ */zo("$ui.add.value"),/* #__PURE__ */Ao("add"))),/* #__PURE__ */qo(/* #__PURE__ */Mo(/* #__PURE__ */zo("$ui.moveDown.value"),/* #__PURE__ */Ao("moveDown")))))),/* #__PURE__ */_o()))),/* #__PURE__ */Co('$addLabel || ($ui.add.value + " " + ($label || ""))')),/* #__PURE__ */So(/* #__PURE__ */Lo("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(t){t._c.sync=!0,t.on("created",jo.bind(null,t)),t.on("mounted",(()=>{e.whenAvailable(`${t.props.id}_items`,(e=>{if(e instanceof HTMLElement){Zo(e,t);function o(e){for(const o of e)for(const e of Array.from(o.addedNodes))if(e instanceof HTMLElement&&e.id===`${t.props.id}_items`)return void Zo(e,t)}new MutationObserver(o).observe(e.parentNode,{childList:!0})}}),t.props.__root)}))},o.disablesChildren,
|
|
11
11
|
/* #__PURE__ */o.localize("remove"),
|
|
12
12
|
/* #__PURE__ */o.localize("add"),
|
|
13
13
|
/* #__PURE__ */o.localize("moveUp"),
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailable as s,clone as a}from"@formkit/utils";import{isDOM as l,isComponent as p,createMessage as i,warn as d,error as c}from"@formkit/core";import{icon as u,isSlotCondition as f,isSchemaObject as v,extendSchema as h,normalizeOptions as m,defaultIcon as $,localize as g,options as b,disablesChildren as y}from"@formkit/inputs";import"@formkit/vue";import{animations as x,dragAndDrop as w,handleEnd as _,handleDragstart as k,handleTouchstart as S,handleTouchmove as L,multiDrag as A}from"@formkit/drag-and-drop";import{offset as C,format as D,nearestDay as I,removeOffset as E,parse as T,sameDay as O,range as M,parts as V,parseParts as F,addDay as B,addMonth as P,addYear as H,dayStart as R,monthStart as K,monthEnd as N,date as W,formatStr as U,applyOffset as Y,monthDays as j,weekStart as z,weekEnd as Z}from"@formkit/tempo";const q=[988,24029,396,13078,980],G=18806588,X=502357,J=16217489;let Q=189024;const ee=()=>[30548127325,27022924,34729821653783].map(le).join("y"),te=/^[0-9a-f]+$/,oe="undefined"!=typeof window,ne=he(32,(e=>e)).map((()=>{Q|=0,Q=Q+1831565813|0;let e=Q^Q>>>15|Q;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),re=oe?setTimeout:()=>0,se=e=>{clearTimeout(ae[e])},ae={},le=e=>e.toString(32),pe=e=>`${le(ne[e]).substring(2)}.${le(q[e%(q.length-1)])}`;const ie={},de={},ce=new Set(["",null,void 0]);function ue(e,t){e in ie||(ie[e]={timer:0,inputs:new Set});const o=ie[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=re((()=>{ae[e]||(ae[e]=re((()=>ce.add(e)),2e3)),function(e){if(oe){window.addEventListener(ee(),(t=>{const o=new URL(t.blockedURI).hostname;ne.some(((e,t)=>pe(t)===o))&&(fe(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=le(G),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(ie[e].inputs),l=a.filter((t=>!(de[e]&&de[e].has(t)))).join("");if(se(e),l){t++;try{const s=await window[le(J)](`${o}${n}${pe((r+t)%ne.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${l}`)}`),p=await s.json();if(p[le(X)])return fe(e,p.schema);if(s.ok)return de[e]||(de[e]=new Set),void a.forEach((t=>de[e].add(t)))}catch(e){}t<2&&re(s,1e4*Math.random())}};s()}}(e)}),500)}function fe(e,t){ce.add(e),function(e,t){me[e]&&me[e].forEach((e=>e(t)))}(e,t)}function ve(e,t,o){if(ue(t,o),!t)throw new Error("FormKitNoKey");return ce.has(t)?null:e}function he(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const me={};const $e=()=>({$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"}}),ge=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),be=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),ye=()=>({$el:"ul",if:"$fns.length($messages)"}),xe=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),we=()=>({$el:"div",if:"$help"}),_e=()=>({$el:null}),ke=(e,t)=>()=>u(e,t),Se=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Le=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Ae=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Ce=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),De=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Ie=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Ee=()=>({$el:null,for:["part","$_overlayParts"]});function Te(t,o,n,r){return(...s)=>a=>i=>{const d=function(e,t,o,n,r,s){const a=s[o],i="function"==typeof n?n():{$el:n},d=r.map((e=>"string"==typeof e?e:e(t)(s)));let c=d.length&&i?h(i,{children:d}):i;if(c=h(c,a),"object"==typeof c){let r=c;if((l(c)||p(c))&&(c.meta={...c.meta||{},section:o,node:n}),l(c)){const{$el:n,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${o}`,...s.attrs}):s.attrs={class:`$classes.${o}`},r=Oe(t,o,Object.defineProperty(s,"$el",{enumerable:!1,get:ve.bind(null,n,t,e)}))}else if(p(c)){const{$cmp:n,...s}=c;r=Oe(t,o,Object.defineProperty(s,"$cmp",{enumerable:!1,get:ve.bind(null,n,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${o}`;const{$formkit:n,...s}=c;r=Oe(t,o,Object.defineProperty(s,"$formkit",{enumerable:!1,get:ve.bind(null,n,t,e)}))}return r}return Oe(t,o,c)}(t,a,o,n,s,i);return r&&e(d)&&(d.memo=t+JSON.stringify(i)),r?[d]:d}}function Oe(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function Me(e){return(t,o,n=!1)=>Te(e,t,o,n)}function Ve(e){return{outer:e("outer",$e,!0),wrapper:e("wrapper","div",!1),inner:e("inner",ge,!1),icon:ke,label:e("label",be,!1),prefix:e("prefix",_e,!1),suffix:e("suffix",_e,!1),help:e("help",we,!1),messages:e("messages",ye,!1),message:e("message",xe,!1)}}function Fe(e){return{overlayPlaceholder:e("overlayPlaceholder",Se),overlayLiteral:e("overlayLiteral",Le),overlayChar:e("overlayChar",Ae),overlayEnum:e("overlayEnum",Ce),overlay:e("overlay",De),overlayParts:e("overlayParts",Ee),overlayInner:e("overlayInner",Ie)}}function Be(e,t,o){return n=>r=>{const s="string"==typeof t?t:t(n)(r);return o?{if:e,then:s,else:"string"==typeof o?o:o(n)(r)}:(f(s)?Object.assign(s.else,{if:e}):v(s)&&Object.assign(s,{if:e}),s)}}function Pe(e){const o=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),n=e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),r=e("listitem",(()=>({$el:"li",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),s=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),a=e("loadMoreInner","span"),p=e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),i=e("emptyMessageInner","span"),d=e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),c=e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),u=e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),h=e("groupLabel","span"),m=e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return o(n(p(i("$emptyMessage")),c(Be("$option.group",v(h("$option.group"),m(u((e=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),$=r(Be("$fns.isSelected($option)",ke("selected")),d("$option.label")),o=>{const n=n=>{const r=$(o)(n),s="function"==typeof e?e(o):e;return t(s)?(f(r)&&l(r.else)?r.else.attrs={...r.else.attrs,...s}:l(r)&&(r.attrs={...r.attrs,...s}),r):r};return n._s=$._s,n})))),r(Be("$fns.isSelected($option)",ke("selected")),d("$option.label")))),s(Be("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",a(Be("$state.loading",ke("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,$}}const He=/* #__PURE__ */Me("dd"),{outer:Re,wrapper:Ke,inner:Ne,icon:We,label:Ue,prefix:Ye,suffix:je,help:ze,messages:Ze,message:qe}=/* #__PURE__ */Ve(He),Ge=He("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"}}))),Xe=He("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),Je=He("selection",(()=>({$el:"div"}))),Qe=He("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'}}}))),et=He("optionLoading","span"),tt=He("option",(()=>({$el:"div"}))),ot=He("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),nt=He("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),rt=He("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),st=He("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),at=He("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 || ""'}))),lt=He("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),pt=He("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),it=He("tagLabel",(()=>({$el:"span"}))),dt=He("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),ct=He("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),ut=He("tagLoading","span"),ft=/* #__PURE__ */Pe(He);function vt(t){return e(t)&&"value"in t&&"label"in t}function ht(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function mt(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function $t(e){return"__original"in e?e.__original:e.value}const gt=new WeakMap,bt=new WeakMap;async function yt(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(bt.get(e));const o=t?e.props.debounce:0;0===o?xt(e,n):bt.set(e,setTimeout((()=>{e.props.page=1,xt(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 xt(e,t){e.props.allowAppendOptions=t,At(e)}const wt=/* #__PURE__ */i({key:"loading",type:"state",value:!0,visible:!1}),_t=/* #__PURE__ */i({key:"loading",type:"state",value:!1,visible:!1});function kt(e,t){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const o=m(t);e.props.appendingOptions=!0,e.props.activeValue=$t(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=m(t);e.props.options=o,e.props.options.length||(e.store.set(_t),e.store.set(i({key:"hasNextPage",type:"state",value:!1,visible:!1}))),gt.set(e,e.props.searchValue)}const St=new WeakMap;function Lt(t,r,s){if(t.store.set(wt),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let e;e=o(r)?{label:"Loading...",value:String(r)}:{label:String(r),value:r},t.props.optionLoaderValues.includes(e.value)||t.props.optionLoaderValues.push(e.value),"transferlist"===t.props.type||t.props.selections.includes(e)||(t.props.selections=[...t.props.selections,e])}const a=t.props.optionLoader(r,s),l=t=>"string"==typeof t?{label:t,value:r}:vt(t)?t:e(t)?Object.assign({label:String(r),value:r},t):{label:String(r),value:r},p=e=>{const o=t.props.memoOptions.findIndex((t=>n($t(t),$t(e))));return-1===o?t.props.memoOptions=[...t.props.memoOptions,e]:t.props.memoOptions[o]=e,e};return a instanceof Promise?a.then((e=>{if("string"==typeof e||vt(e))return p(l(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==r)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==r)),t.props.optionLoadingCounter--,p(l(a)))}function At(e){e.store.set(wt),e.props.optionsLoadingCounter++,e.store.set(i({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,St.get(e)),n=kt.bind(null,e),r=o instanceof Promise?o.then(((...o)=>{void 0!==e.props.nonceKey&&t!==e.props[e.props.nonceKey]||n(...o)})):(n(o),e.props.optionsLoadingCounter--);if(r instanceof Promise)return r.finally((()=>{e.props.optionsLoadingCounter--}))}function Ct(e,t){e.props.page++,St.set(e,t),e.store.set(i({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Dt=Symbol(),It=e=>{const t=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),r=e.props.inputStd||[],s=[];for(const e of r){let r,a=t.find((t=>n($t(t),e)));r=o(e)?void 0:Array.isArray(e)?e.join(", "):e,a||(a={value:e,label:r,isPlaceholder:!1,noOptionFound:!0}),s.push(a)}return s};function Et(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!n($t(t),e)));e.input(o)}else e.input(void 0);e.props.openOnRemove&&!e.props.expanded&&e.isCreated&&(e.props.expanded=!0),setTimeout((()=>{var t;return e.emit("selectRange",[null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option])}),20)}async function Tt(e){const t=It(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:oe&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function Ot(e){var t,o;if(e.props.allOptions&&e.props.allOptions.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=$t(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>n($t(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=$t(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=$t(e.props.allOptions[0]);else if(e.props.inputStd.length>0&&!e.props.multiple||e.props.multiple&&(null===(o=e.context)||void 0===o?void 0:o.state.dirty))e.props.selections[e.props.selections.length-1]?e.props.activeValue=$t(e.props.selections[e.props.selections.length-1]):e.props.activeValue=$t(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=$t(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function Mt(e){return e.reduce(((e,t)=>(t.options?e.push(...Mt(t.options)):e.push(t),e)),[])}function Vt(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||($t(t)!==Dt?(e.props.option=t,e.props.maxReached&&!Pt(e,t)||(e.input(Ft(e,$t(t))),Pt(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function Ft(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];for(const r of o)if(n(r,t))return e.props.optionRemoved=!0,o.filter((e=>!n(e,t)));return[...o,t]}return n(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function Bt(e,t){return n(e.props.activeValue,$t(t))||void 0}function Pt(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(n(o,$t(t)))return!0;return!1}return n(e.value,$t(t))}function Ht(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function Rt(e){e.props.firstCommit=!0;let t=null;e.on("commit",(()=>{if(0===e.props.inputStd.length&&e.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(e),void(t=e.props.inputStd);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=At(e);t instanceof Promise&&t.then((()=>{Tt(e)}))}"function"!=typeof e.props.optionLoader||e.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(t,e.props.inputStd)?0===e.props.optionsLoadingCounter&&Tt(e):(t=e.props.inputStd,async function(e){const t=It(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>n($t(e),t))))):e.props.inputStd;if(o.forEach((o=>{Lt(e,o,Array.isArray(t)&&t.find((e=>n($t(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{Tt(e),e.props.optionLoadingCounter||e.off(t)}))}else Tt(e)}(e))}))}const Kt=new WeakSet;function Nt(e){if(!oe)return;e.props.positionListBox=function(e,t){var o,r;let s=null;if(e.props.activeDescendant){s=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>n(e.value,$t(t)))),-1===s&&(s=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&Wt(e)}if("undefined"==typeof window)return s;const a=t.getBoundingClientRect(),l=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`);if(l){const t=l.getBoundingClientRect();t.top+t.height+a.height>window.innerHeight&&t.top+t.height>a.height?(e.props.invertPopover=!0,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"})}return s}.bind(null,e),e.props.styleWrapper=Ut.bind(null),e.on("mounted",(()=>{s(`${e.props.id}_popover`,r.bind(null,e),e.props.__root)}));const t=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_popover`);if(n){const o=n.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}},o=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.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);Kt.delete(e),a(e,r);let s,l=null;const p=new ResizeObserver((()=>{clearTimeout(s),s=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),l||(l=e.on("prop:expanded",(()=>{p.disconnect(),e.off(l)})))}))}));p.observe(t)}));o.observe(t,{childList:!0,subtree:!0})}function a(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Kt.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]),Kt.add(e),n.length&&l(e,n,t)}function l(e,t,o){var n,r,s,p;const i=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const n=i?i.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:p,width:i}=s.getBoundingClientRect();if(e.props.mouseX>p&&e.props.mouseX<p+i&&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=$t(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||Wt(e),e.props.expanded?(i&&e.props.loadOnScroll&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&i.scrollTop+i.offsetHeight>i.scrollHeight-200&&(null===(p=e.context)||void 0===p||p.handlers.loadMore(!0)),Kt.has(e)?requestAnimationFrame(l.bind(null,e,t,o)):a(e,o)):Kt.delete(e)}e.on("prop:trackHover",(({payload:t})=>{var n,r,s;oe&&(t?null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_popover`))||void 0===s||s.removeEventListener("scroll",o):null===(n=e.props.__root)||void 0===n||n.getElementById(`${e.props.id}_popover`))})),e.on("prop:expanded",(({payload:o})=>{e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:o||e.props.forceExpanded?"999":"-1",pointerEvents:o?"auto":"none"},o?(document.addEventListener("mousemove",t),e.props.styleWrapper(),Ot(e)):document.removeEventListener("mousemove",t)})),e.on("prop:trackHover",(({payload:t})=>{var n,r;oe&&(t?null===(r=document.getElementById(`${e.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",o):null===(n=document.getElementById(`${e.props.id}_popover`))||void 0===n||n.addEventListener("scroll",o))})),e.on("prop:activeValue",(({payload:t})=>{if(t===Dt)return void(e.props.activeDescendant=`${e.props.id}_load_more`);let o,r=-1;for(let s=0;s<e.props.options.length;s++){if("group"in e.props.options[s])for(let a=0;a<e.props.options[s].options.length;a++)if(n($t(e.props.options[s].options[a]),t)){r=a,o=s;break}if(n($t(e.props.options[s]),t)){r=s;break}}e.props.activeDescendant=r<0?void 0:void 0===o?`${e.props.id}_listitem_${r}`:`${e.props.id}_listitem_${o}_${r}`}))}function Wt(e){var t,o;if(!oe)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:p}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+p&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-p)}function Ut(){}const Yt=new WeakMap;function jt(e){e.on("created",(()=>{if(!e.context||!oe)return;e.context.fns.isActive=Bt.bind(null,e),e.context.fns.isSelected=t=>Pt(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(n($t(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=oo,e.context.handlers.selectOption=t=>o=>no.call(null,e,t,o),e.context.handlers.loadMore=xt.bind(null,e),e.context.handlers.removeSelection=t=>o=>to(e,t,o),e.context.handlers.tagTouchstart=t=>o=>to(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?Gt.bind(null,e,t):qt.bind(null,e),e.context.handlers.selectionBlur=()=>Xt.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>n(e,$t(t)),e.context.handlers.tagClick=t=>Jt.bind(null,e,t),e.context.handlers.tagFocus=t=>Qt.bind(null,e,t),e.context.handlers.tagBlur=()=>eo.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){var n;if(o&&o.relatedTarget instanceof HTMLElement){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(t instanceof HTMLElement&&t.contains(o.relatedTarget))return}t(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,e),e.context.handlers.touchmove=zt.bind(null,e),e.context.handlers.touchend=Zt.bind(null,e)}))}function zt(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=Yt.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Yt.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function Zt(e){Yt.delete(e)}function qt(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 Gt(e,t,o){o.currentTarget instanceof HTMLElement&&(n(e.props.activeSelectionValue,$t(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=$t(t),o.currentTarget.focus()))}function Xt(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 Jt(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(n(e.props.activeSelectionValue,$t(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=$t(t),o.currentTarget.focus())))}function Qt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=$t(t),e.props.justFocused=!0)}function eo(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 to(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},Et(e,t))}function oo(e){e.stopPropagation()}function no(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},Vt(e,t))}function ro(e,t,o,n){!function(e){e.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===e.props.deselect?e.props.deselect=!0:e.props.deselect=r(e.props.deselect),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.options||(d(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.allOptions=Mt(e.props.options),e.props.selections=[],e.props.memoOptions=[],e.props.invertPopover=!1,e.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},e.props.decrementCount=0,e.props.page=1,e.props.loadMoreOption={label:"Load more",value:Dt},e.props.loadOptions=At,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=r(e.props.searchable),e.props.loadOnScroll=r(e.props.loadOnScroll),e.props.multiple=r(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=r(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&r(e.props.openOnRemove),e.props.hasNextPage=Ct.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=r(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0),e.on("mounted",(()=>Ht(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ht(e)}),10)))}(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,$t(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd]))))}(n):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(n),e(n),Rt(n),function(e){e.on("created",(()=>{e.context&&(e.props.trackHover=!0,void 0!==e.props.disabled||e.props.optionsLoader||!e.props.options||e.props.options.length||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||(e.props.disabledInternally=!0),Nt(e),e.props.loadOnCreated&&!e.props.optionsLoaded?At(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=r(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),jt(n),t(n),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(_t))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(_t)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Mt(e.props.options),e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0),Ot(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(oe)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),e.props.searchExpand||(o.value="",o.value=e.props.inputText))}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(n),o(n)}function so(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=r(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=r(e.props.selectionRemovable)}function ao(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 lo(e,t,o){var r,s,a;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push($t(t)),e}),[]);(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&o.push(Dt);let l=-1;e.props.activeValue&&(l=o.findIndex((t=>n(t,e.props.activeValue)))),-1===l&&o.length?e.props.activeValue=o[0]:"ArrowDown"===t&&o.length>l+1?e.props.activeValue=o[l+1]:"ArrowUp"===t&&l>0?e.props.activeValue=o[l-1]:"ArrowUp"===t&&0===l&&(null===(a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===a||a.focus(),e.props.expanded=!1)}else e.props.expanded||"ArrowDown"!==t||(e.props.expanded=!0)}function po(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=$t(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=$t(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function io(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 co(e,t,o,r=!0){var s,a,l,p,i,d,c;const u=o.key;if(o.altKey){const r=mt(),s=e.props.selections.findIndex((e=>n($t(e),$t(t)))),a=[...e.props.selections];"ArrowRight"===o.key?s<e.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,t)):"ArrowLeft"===o.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,t)),e.props.activeSelectionValue=$t(t),e.input([...a.map($t)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const o=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===o)return;const f="ArrowRight"===u?o+1:o-1;if(f>=e.props.selections.length){if(!r)return e.props.expanded=!0,e.props.activeSelectionValue=void 0,void(null===(a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}`))||void 0===a||a.focus());null===(p=null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`))||void 0===p||p.focus()}else if(f<0&&0===o)null===(d=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=e.props.__root)||void 0===c?void 0:c.getElementById(`${e.props.id}_tag-wrapper_${f}`);v&&v.focus(),e.props.selections[f]?e.props.activeSelectionValue=$t(e.props.selections[f]):e.props.activeSelectionValue=void 0}}function uo(e,t,o){var r;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const s=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===s)return;const a=e.props.selections[s+1]?s+1:s-1,l=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${a}`);l&&l.focus(),e.props.userAction={type:"tagDelete"},Et(e,t)}function fo(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(Ft(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===Dt)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>n($t(t),e.props.activeValue)));if(!t)return;Vt(e,t)}else e.props.expanded=!0}function vo(e){e.props.expanded&&(e.props.expanded=!1)}function ho(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":io(e);break;case"ArrowRight":case"ArrowLeft":co(e,t,o,!1);break;case"Delete":case"Backspace":uo(e,t,o)}}function mo(e,t,o){if(e.props.disabled)return;switch(o.key){case"ArrowUp":case"ArrowDown":!function(e,t,o){var r,s,a,l;o.preventDefault();const p=o.key,i=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===i)return;const d="ArrowDown"===p?i+1:i-1;if(d<0&&(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus()),d<0||d>=e.props.selections.length)return;const c=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_selection_wrapper_${d}`);c&&c.focus(),e.props.activeSelectionValue=(null===(l=e.props.selections[d])||void 0===l?void 0:l.value)||void 0}(e,t,o);break;case"Enter":break;case"Tab":!function(e,t,o){var r,s,a,l;if(t){const p=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===p)return;const i=o.shiftKey?p-1:p+1;if(i>=e.props.selections.length)return;if(i<0)return void(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus());const d=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_selection_wrapper_${i}`);d&&d.focus(),e.props.activeSelectionValue=(null===(l=e.props.selections[i])||void 0===l?void 0:l.value)||void 0}}(e,t,o);break;case"Delete":case"Backspace":!function(e,t){var o;if(t){const r=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${s}`);a&&a.focus(),e.props.selections[s]?e.props.activeSelectionValue=$t(e.props.selections[s]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),Et(e,t)}(e,t)}}function $o(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":lo(e,o,t);break;case"ArrowLeft":case"ArrowRight":po(e,o);break;case"Enter":fo(e,t);break;case"Escape":vo(e);break;case"Delete":case"Backspace":ao(e);break;default:e.emit("unusedKeydown",t)}}function go(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":lo(e,o,t);break;case"ArrowRight":case"ArrowLeft":po(e,o);break;case"Enter":fo(e,t);break;case"Escape":vo(e);break;case"Delete":case"Backspace":ao(e)}}function bo(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&r(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=yo.bind(null,e),e.context.handlers.focus=xo.bind(null,e),e.context.handlers.keydown=$o.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>ho.bind(null,e,t))}))}function yo(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 xo(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 wo(e){let t,o="";e.on("unusedKeydown",(({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!o&&" "===r.key)return void function(e,t){var o;if(t.preventDefault(),e.props.expanded){if(e.props.activeValue===Dt)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>n($t(t),e.props.activeValue)));if(!t)return;Vt(e,t)}else e.props.expanded=!0}(e,r);e.props.expanded=!0,clearTimeout(t),o+=r.key;const s=e.props.allOptions.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));s&&(e.props.activeValue=$t(s)),t=setTimeout((()=>{o=""}),400)}}))}function _o(e){ko(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,ko(e)})),oe&&s(`${e.props.id}_selections`,Lo.bind(null,e),e.props.__root)}function ko(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 So(e){var t,o;if(!oe||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const 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),p=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<p.length;e++)t.push([p[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 p=s-n;if(a>p){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()+"...",p+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((()=>{ko(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,ko(e)}function Lo(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:So(e))})),n=new ResizeObserver((()=>{So(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Ao={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Co={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Do={overflow:"hidden",height:"100%"},Io={},Eo={};let To=0;function Oo(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 p=r.getBoundingClientRect(),i=n.getBoundingClientRect(),d=Math.round(p.top-i.top)+"px",c=Math.round(p.left-i.left-5)+"px",u=Math.max(Math.round(Math.min(i.height-i.top,window.innerHeight)-(p.top+p.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(${p.width+"px"}, calc(100vw - 4em))`:p.width+"px",maxWidth:"calc(100vw - 4em)"}}function Mo(e,t){var o,r;let s=null;if(e.props.activeDescendant){const a=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!a)return s;e.props.ignoreScroll=!0;const l=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_listbox`);if(!l)return s;const p=t.getBoundingClientRect(),i=l.getBoundingClientRect(),d=parseInt(getComputedStyle(t).paddingTop),c=parseInt(getComputedStyle(t).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(t.scrollHeight-c-u-p.height,0),h=i.height-f-v;t.scrollTop=u;const m=()=>{t.scrollTop=v>0?v<d?t.scrollHeight:d:f<c?0:u-c},$=Math.min(150,i.height);f>0&&v>0||0===f&&0===v||h>$?t.scrollTop=u:m();t.clientHeight/2<t.scrollTop&&(s=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>n(e.value,$t(t))))),-1===s&&(s=null)}return s}function Vo(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&c(300,[e]),e.props.dropdownWrapperStyles=a(Ao),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=Oo.bind(null,e),e.props.positionListBox=Mo.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){To=document.documentElement.scrollTop;for(const e in Co)Eo[e]=document.documentElement.style[e],document.documentElement.style[e]=Co[e];for(const e in Do)Io[e]=document.body.style[e],document.body.style[e]=Do[e];document.body.scrollTop=To}():function(){for(const e in Co)document.documentElement.style[e]=Eo[e];for(const e in Do)document.body.style[e]=Io[e];document.body.scrollTop=0,document.documentElement.scrollTop=To}())}))}function Fo(e){e.addProps(["multiLine"]),e.on("created",(()=>{oe&&(e.props.multiLineHeight=void 0,s(`${e.props.id}_selections`,Bo.bind(null,e),e.props.__root))}))}function Bo(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),Po(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 Po(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 Ho(e){if(e.on("created",(()=>{e.context&&wo(e)})),e.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(e),"truncate"===e.props.selectionAppearance&&(e.props.lastVisibleIndex=null,_o(e),e.on("prop:selections",(()=>{_o(e)}))),"tags"===e.props.selectionAppearance&&Fo(e),e.props.multiple&&"tags"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t,o){e.input(t)}e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),s(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const r={threshold:{horizontal:.25,vertical:0},plugins:[x()],draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};w({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,w({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,w({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}e.on("prop:expanded",(({payload:t})=>{t&&e.props.optionsLoader&&"function"==typeof e.props.optionsLoader&&(!e.props.options.length||e.props.alwaysLoadOnOpen)&&(e.props.options=[],At(e))})),"overscroll"===e.props.behavior&&Vo(e)}const Ro=(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 Ko(e){if(e.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),e.props.popover=r(e.props.popover)?"manual":void 0,"input"!==e.type||"overscroll"===e.props.behavior)return;let t=null,o=null,n=[],a=null;if(e.props.popoverOffset=r(e.props.popoverOffset)?parseInt(e.props.popoverOffset):0,!e.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 l=()=>{e.props.invertPopover=!1,document.removeEventListener("resize",a),document.removeEventListener("scroll",a),n.forEach((e=>{e.removeEventListener("scroll",a)}))};function p(){const{x:n,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}}(t,o);e.props.popoverAncestorCoordinates={x:n,y:r,width:s,height:a},e.props.popoverCoordinates={x:n,y:r,width:s,height:0}}function i(o){o?(null==t||t.showPopover(),setTimeout((()=>{e.props.popoverCoordinates.height=(null==t?void 0:t.offsetHeight)||0}),5)):(null==t?void 0:t.matches(":popover-open"))&&(null==t||t.hidePopover(),e.props.popoverCoordinates.height=0)}e.on("mounted",(()=>{e.context&&(e.props.usePopover=!0,e.props.popoverCoordinates={x:0,y:0,width:0,height:0},e.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),e.on("destroyed",(()=>{l()})),e.on("prop:inputText",(()=>{e.context&&(p(),i(!0))})),e.on("prop:expanded",(({payload:r})=>{var d;e.context&&(!1===r?l():s(`${null===(d=e.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!e.context)return;t=document.querySelector(`[id="${e.context.id}_popover"][popover]`)||document.querySelector(`[id="${e.context.id}_popover"] [popover]`),o||(o=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(t)),p(),i(r),a=Ro((()=>{e.context&&(p(),i(r))}),10),document.addEventListener("resize",a),document.addEventListener("scroll",a),n=[];let s=null==t?void 0:t.parentElement;for(;s;)s.scrollHeight>s.clientHeight&&n.push(s),s=s.parentElement;n.forEach((e=>{e.addEventListener("scroll",a)}))})))}))}const No={schema:/* #__PURE__ */Re(/* #__PURE__ */Ke(/* #__PURE__ */Ue("$label"),/* #__PURE__ */Ne(/* #__PURE__ */We("prefix"),/* #__PURE__ */Ye(),/* #__PURE__ */Ge(/* #__PURE__ */Be("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */Qe('$placeholder || "placeholder"'),/* #__PURE__ */Be("$multiple !== true",/* #__PURE__ */Xe(/* #__PURE__ */Be("$state.loading && $selections.length === 0",/* #__PURE__ */et("$ui.isLoading.value"),/* #__PURE__ */Je(/* #__PURE__ */tt("$option.label")))),/* #__PURE__ */Be('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */nt(/* #__PURE__ */rt(/* #__PURE__ */Be("$state.loading && $selections.length === 0",/* #__PURE__ */et("$ui.isLoading.value"),/* #__PURE__ */at()))),/* #__PURE__ */Be('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */dt(/* #__PURE__ */ct(/* #__PURE__ */Be("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */et("$ui.isLoading.value"),/* #__PURE__ */lt(/* #__PURE__ */pt(/* #__PURE__ */Be("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */ut("$ui.isLoading.value"),/* #__PURE__ */it("$option.label")),/* #__PURE__ */ot(/* #__PURE__ */We("close"))))))))))),/* #__PURE__ */Be("$truncationCount && $state.loading !== true",/* #__PURE__ */st("$truncationCount")),/* #__PURE__ */Be("$state.loading",/* #__PURE__ */We("loader")),/* #__PURE__ */Be("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */ot(/* #__PURE__ */We("close")),/* #__PURE__ */We("select"))),/* #__PURE__ */ft(),/* #__PURE__ */je(),/* #__PURE__ */We("suffix"))),/* #__PURE__ */ze("$help"),/* #__PURE__ */Ze(/* #__PURE__ */qe("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
1
|
+
import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailable as s,clone as a}from"@formkit/utils";import{isDOM as l,isComponent as p,createMessage as i,warn as d,error as c}from"@formkit/core";import{icon as u,isSlotCondition as f,isSchemaObject as v,extendSchema as h,normalizeOptions as m,defaultIcon as $,localize as g,options as b,disablesChildren as y}from"@formkit/inputs";import"@formkit/vue";import{animations as x,dragAndDrop as w,handleEnd as _,handleDragstart as k,handleTouchstart as S,handleTouchmove as L,multiDrag as A}from"@formkit/drag-and-drop";import{offset as C,format as D,nearestDay as I,removeOffset as E,parse as T,sameDay as O,range as M,parts as V,parseParts as F,addDay as B,addMonth as P,addYear as H,dayStart as R,monthStart as K,monthEnd as N,date as W,formatStr as U,applyOffset as Y,monthDays as j,weekStart as z,weekEnd as Z}from"@formkit/tempo";const q=[988,24029,396,13078,980],G=18806588,X=502357,J=16217489;let Q=189024;const ee=()=>[30548127325,27022924,34729821653783].map(le).join("y"),te=/^[0-9a-f]+$/,oe="undefined"!=typeof window,ne=he(32,(e=>e)).map((()=>{Q|=0,Q=Q+1831565813|0;let e=Q^Q>>>15|Q;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),re=oe?setTimeout:()=>0,se=e=>{clearTimeout(ae[e])},ae={},le=e=>e.toString(32),pe=e=>`${le(ne[e]).substring(2)}.${le(q[e%(q.length-1)])}`;const ie={},de={},ce=new Set(["",null,void 0]);function ue(e,t){e in ie||(ie[e]={timer:0,inputs:new Set});const o=ie[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=re((()=>{ae[e]||(ae[e]=re((()=>ce.add(e)),2e3)),function(e){if(oe){window.addEventListener(ee(),(t=>{const o=new URL(t.blockedURI).hostname;ne.some(((e,t)=>pe(t)===o))&&(fe(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=le(G),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(ie[e].inputs),l=a.filter((t=>!(de[e]&&de[e].has(t)))).join("");if(se(e),l){t++;try{const s=await window[le(J)](`${o}${n}${pe((r+t)%ne.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${l}`)}`),p=await s.json();if(p[le(X)])return fe(e,p.schema);if(s.ok)return de[e]||(de[e]=new Set),void a.forEach((t=>de[e].add(t)))}catch(e){}t<2&&re(s,1e4*Math.random())}};s()}}(e)}),500)}function fe(e,t){ce.add(e),function(e,t){me[e]&&me[e].forEach((e=>e(t)))}(e,t)}function ve(e,t,o){if(ue(t,o),!t)throw new Error("FormKitNoKey");return ce.has(t)?null:e}function he(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const me={};const $e=()=>({$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"}}),ge=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),be=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),ye=()=>({$el:"ul",if:"$fns.length($messages)"}),xe=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),we=()=>({$el:"div",if:"$help"}),_e=()=>({$el:null}),ke=(e,t)=>()=>u(e,t),Se=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Le=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Ae=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Ce=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),De=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Ie=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Ee=()=>({$el:null,for:["part","$_overlayParts"]});function Te(t,o,n,r){return(...s)=>a=>i=>{const d=function(e,t,o,n,r,s){const a=s[o],i="function"==typeof n?n():{$el:n},d=r.map((e=>"string"==typeof e?e:e(t)(s)));let c=d.length&&i?h(i,{children:d}):i;if(c=h(c,a),"object"==typeof c){let r=c;if((l(c)||p(c))&&(c.meta={...c.meta||{},section:o,node:n}),l(c)){const{$el:n,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${o}`,...s.attrs}):s.attrs={class:`$classes.${o}`},r=Oe(t,o,Object.defineProperty(s,"$el",{enumerable:!1,get:ve.bind(null,n,t,e)}))}else if(p(c)){const{$cmp:n,...s}=c;r=Oe(t,o,Object.defineProperty(s,"$cmp",{enumerable:!1,get:ve.bind(null,n,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${o}`;const{$formkit:n,...s}=c;r=Oe(t,o,Object.defineProperty(s,"$formkit",{enumerable:!1,get:ve.bind(null,n,t,e)}))}return r}return Oe(t,o,c)}(t,a,o,n,s,i);return r&&e(d)&&(d.memo=t+JSON.stringify(i)),r?[d]:d}}function Oe(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function Me(e){return(t,o,n=!1)=>Te(e,t,o,n)}function Ve(e){return{outer:e("outer",$e,!0),wrapper:e("wrapper","div",!1),inner:e("inner",ge,!1),icon:ke,label:e("label",be,!1),prefix:e("prefix",_e,!1),suffix:e("suffix",_e,!1),help:e("help",we,!1),messages:e("messages",ye,!1),message:e("message",xe,!1)}}function Fe(e){return{overlayPlaceholder:e("overlayPlaceholder",Se),overlayLiteral:e("overlayLiteral",Le),overlayChar:e("overlayChar",Ae),overlayEnum:e("overlayEnum",Ce),overlay:e("overlay",De),overlayParts:e("overlayParts",Ee),overlayInner:e("overlayInner",Ie)}}function Be(e,t,o){return n=>r=>{const s="string"==typeof t?t:t(n)(r);return o?{if:e,then:s,else:"string"==typeof o?o:o(n)(r)}:(f(s)?Object.assign(s.else,{if:e}):v(s)&&Object.assign(s,{if:e}),s)}}function Pe(e){const o=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),n=e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),r=e("listitem",(()=>({$el:"li",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),s=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),a=e("loadMoreInner","span"),p=e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),i=e("emptyMessageInner","span"),d=e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),c=e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),u=e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),h=e("groupLabel","span"),m=e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return o(n(p(i("$emptyMessage")),c(Be("$option.group",v(h("$option.group"),m(u((e=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),$=r(Be("$fns.isSelected($option)",ke("selected")),d("$option.label")),o=>{const n=n=>{const r=$(o)(n),s="function"==typeof e?e(o):e;return t(s)?(f(r)&&l(r.else)?r.else.attrs={...r.else.attrs,...s}:l(r)&&(r.attrs={...r.attrs,...s}),r):r};return n._s=$._s,n})))),r(Be("$fns.isSelected($option)",ke("selected")),d("$option.label")))),s(Be("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",a(Be("$state.loading",ke("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,$}}const He=/* #__PURE__ */Me("dd"),{outer:Re,wrapper:Ke,inner:Ne,icon:We,label:Ue,prefix:Ye,suffix:je,help:ze,messages:Ze,message:qe}=/* #__PURE__ */Ve(He),Ge=He("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"}}))),Xe=He("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),Je=He("selection",(()=>({$el:"div"}))),Qe=He("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'}}}))),et=He("optionLoading","span"),tt=He("option",(()=>({$el:"div"}))),ot=He("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),nt=He("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),rt=He("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),st=He("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),at=He("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 || ""'}))),lt=He("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),pt=He("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),it=He("tagLabel",(()=>({$el:"span"}))),dt=He("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),ct=He("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),ut=He("tagLoading","span"),ft=/* #__PURE__ */Pe(He);function vt(t){return e(t)&&"value"in t&&"label"in t}function ht(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function mt(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function $t(e){return"__original"in e?e.__original:e.value}const gt=new WeakMap,bt=new WeakMap;async function yt(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(bt.get(e));const o=t?e.props.debounce:0;0===o?xt(e,n):bt.set(e,setTimeout((()=>{e.props.page=1,xt(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 xt(e,t){e.props.allowAppendOptions=t,At(e)}const wt=/* #__PURE__ */i({key:"loading",type:"state",value:!0,visible:!1}),_t=/* #__PURE__ */i({key:"loading",type:"state",value:!1,visible:!1});function kt(e,t){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const o=m(t);e.props.appendingOptions=!0,e.props.activeValue=$t(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=m(t);e.props.options=o,e.props.options.length||(e.store.set(_t),e.store.set(i({key:"hasNextPage",type:"state",value:!1,visible:!1}))),gt.set(e,e.props.searchValue)}const St=new WeakMap;function Lt(t,r,s){if(t.store.set(wt),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let e;e=o(r)?{label:"Loading...",value:String(r)}:{label:String(r),value:r},t.props.optionLoaderValues.includes(e.value)||t.props.optionLoaderValues.push(e.value),"transferlist"===t.props.type||t.props.selections.includes(e)||(t.props.selections=[...t.props.selections,e])}const a=t.props.optionLoader(r,s),l=t=>"string"==typeof t?{label:t,value:r}:vt(t)?t:e(t)?Object.assign({label:String(r),value:r},t):{label:String(r),value:r},p=e=>{const o=t.props.memoOptions.findIndex((t=>n($t(t),$t(e))));return-1===o?t.props.memoOptions=[...t.props.memoOptions,e]:t.props.memoOptions[o]=e,e};return a instanceof Promise?a.then((e=>{if("string"==typeof e||vt(e))return p(l(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==r)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==r)),t.props.optionLoadingCounter--,p(l(a)))}function At(e){e.store.set(wt),e.props.optionsLoadingCounter++,e.store.set(i({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,St.get(e)),n=kt.bind(null,e),r=o instanceof Promise?o.then(((...o)=>{void 0!==e.props.nonceKey&&t!==e.props[e.props.nonceKey]||n(...o)})):(n(o),e.props.optionsLoadingCounter--);if(r instanceof Promise)return r.finally((()=>{e.props.optionsLoadingCounter--}))}function Ct(e,t){e.props.page++,St.set(e,t),e.store.set(i({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Dt=Symbol(),It=e=>{const t=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),r=e.props.inputStd||[],s=[];for(const e of r){let r,a=t.find((t=>n($t(t),e)));r=o(e)?void 0:Array.isArray(e)?e.join(", "):e,a||(a={value:e,label:r,isPlaceholder:!1,noOptionFound:!0}),s.push(a)}return s};function Et(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!n($t(t),e)));e.input(o)}else e.input(void 0);e.props.openOnRemove&&!e.props.expanded&&e.isCreated&&(e.props.expanded=!0),setTimeout((()=>{var t;return e.emit("selectRange",[null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option])}),20)}async function Tt(e){const t=It(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:oe&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function Ot(e){var t,o;if(e.props.allOptions&&e.props.allOptions.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=$t(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>n($t(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=$t(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=$t(e.props.allOptions[0]);else if(e.props.inputStd.length>0&&!e.props.multiple||e.props.multiple&&(null===(o=e.context)||void 0===o?void 0:o.state.dirty))e.props.selections[e.props.selections.length-1]?e.props.activeValue=$t(e.props.selections[e.props.selections.length-1]):e.props.activeValue=$t(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=$t(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function Mt(e){return e.reduce(((e,t)=>(t.options?e.push(...Mt(t.options)):e.push(t),e)),[])}function Vt(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||($t(t)!==Dt?(e.props.option=t,e.props.maxReached&&!Pt(e,t)||(e.input(Ft(e,$t(t))),Pt(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function Ft(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];for(const r of o)if(n(r,t))return e.props.optionRemoved=!0,o.filter((e=>!n(e,t)));return[...o,t]}return n(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function Bt(e,t){return n(e.props.activeValue,$t(t))||void 0}function Pt(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(n(o,$t(t)))return!0;return!1}return n(e.value,$t(t))}function Ht(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function Rt(e){e.props.firstCommit=!0;let t=null;e.on("commit",(()=>{if(0===e.props.inputStd.length&&e.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(e),void(t=e.props.inputStd);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=At(e);t instanceof Promise&&t.then((()=>{Tt(e)}))}"function"!=typeof e.props.optionLoader||e.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(t,e.props.inputStd)?0===e.props.optionsLoadingCounter&&Tt(e):(t=e.props.inputStd,async function(e){const t=It(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>n($t(e),t))))):e.props.inputStd;if(o.forEach((o=>{Lt(e,o,Array.isArray(t)&&t.find((e=>n($t(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{Tt(e),e.props.optionLoadingCounter||e.off(t)}))}else Tt(e)}(e))}))}const Kt=new WeakSet;function Nt(e){if(!oe)return;e.props.positionListBox=function(e,t){var o,r;let s=null;if(e.props.activeDescendant){s=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>n(e.value,$t(t)))),-1===s&&(s=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&Wt(e)}if("undefined"==typeof window)return s;const a=t.getBoundingClientRect(),l=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`);if(l){const t=l.getBoundingClientRect();t.top+t.height+a.height>window.innerHeight&&t.top+t.height>a.height?(e.props.invertPopover=!0,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"})}return s}.bind(null,e),e.props.styleWrapper=Ut.bind(null),e.on("mounted",(()=>{s(`${e.props.id}_popover`,r.bind(null,e),e.props.__root)}));const t=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_popover`);if(n){const o=n.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}},o=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.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);Kt.delete(e),a(e,r);let s,l=null;const p=new ResizeObserver((()=>{clearTimeout(s),s=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),l||(l=e.on("prop:expanded",(()=>{p.disconnect(),e.off(l)})))}))}));p.observe(t)}));o.observe(t,{childList:!0,subtree:!0})}function a(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Kt.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]),Kt.add(e),n.length&&l(e,n,t)}function l(e,t,o){var n,r,s,p;const i=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const n=i?i.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:p,width:i}=s.getBoundingClientRect();if(e.props.mouseX>p&&e.props.mouseX<p+i&&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=$t(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||Wt(e),e.props.expanded?(i&&e.props.loadOnScroll&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&i.scrollTop+i.offsetHeight>i.scrollHeight-200&&(null===(p=e.context)||void 0===p||p.handlers.loadMore(!0)),Kt.has(e)?requestAnimationFrame(l.bind(null,e,t,o)):a(e,o)):Kt.delete(e)}e.on("prop:trackHover",(({payload:t})=>{var n,r,s;oe&&(t?null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_popover`))||void 0===s||s.removeEventListener("scroll",o):null===(n=e.props.__root)||void 0===n||n.getElementById(`${e.props.id}_popover`))})),e.on("prop:expanded",(({payload:o})=>{e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:o||e.props.forceExpanded?"999":"-1",pointerEvents:o?"auto":"none"},o?(document.addEventListener("mousemove",t),e.props.styleWrapper(),Ot(e)):document.removeEventListener("mousemove",t)})),e.on("prop:trackHover",(({payload:t})=>{var n,r;oe&&(t?null===(r=document.getElementById(`${e.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",o):null===(n=document.getElementById(`${e.props.id}_popover`))||void 0===n||n.addEventListener("scroll",o))})),e.on("prop:activeValue",(({payload:t})=>{if(t===Dt)return void(e.props.activeDescendant=`${e.props.id}_load_more`);let o,r=-1;for(let s=0;s<e.props.options.length;s++){if("group"in e.props.options[s])for(let a=0;a<e.props.options[s].options.length;a++)if(n($t(e.props.options[s].options[a]),t)){r=a,o=s;break}if(n($t(e.props.options[s]),t)){r=s;break}}e.props.activeDescendant=r<0?void 0:void 0===o?`${e.props.id}_listitem_${r}`:`${e.props.id}_listitem_${o}_${r}`}))}function Wt(e){var t,o;if(!oe)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:p}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+p&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-p)}function Ut(){}const Yt=new WeakMap;function jt(e){e.on("created",(()=>{if(!e.context||!oe)return;e.context.fns.isActive=Bt.bind(null,e),e.context.fns.isSelected=t=>Pt(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(n($t(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=oo,e.context.handlers.selectOption=t=>o=>no.call(null,e,t,o),e.context.handlers.loadMore=xt.bind(null,e),e.context.handlers.removeSelection=t=>o=>to(e,t,o),e.context.handlers.tagTouchstart=t=>o=>to(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?Gt.bind(null,e,t):qt.bind(null,e),e.context.handlers.selectionBlur=()=>Xt.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>n(e,$t(t)),e.context.handlers.tagClick=t=>Jt.bind(null,e,t),e.context.handlers.tagFocus=t=>Qt.bind(null,e,t),e.context.handlers.tagBlur=()=>eo.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){var n;if(o&&o.relatedTarget instanceof HTMLElement){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(t instanceof HTMLElement&&t.contains(o.relatedTarget))return}t(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,e),e.context.handlers.touchmove=zt.bind(null,e),e.context.handlers.touchend=Zt.bind(null,e)}))}function zt(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=Yt.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Yt.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function Zt(e){Yt.delete(e)}function qt(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 Gt(e,t,o){o.currentTarget instanceof HTMLElement&&(n(e.props.activeSelectionValue,$t(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=$t(t),o.currentTarget.focus()))}function Xt(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 Jt(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(n(e.props.activeSelectionValue,$t(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=$t(t),o.currentTarget.focus())))}function Qt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=$t(t),e.props.justFocused=!0)}function eo(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 to(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},Et(e,t))}function oo(e){e.stopPropagation()}function no(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},Vt(e,t))}function ro(e,t,o,n){!function(e){e.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===e.props.deselect?e.props.deselect=!0:e.props.deselect=r(e.props.deselect),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.options||(d(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.allOptions=Mt(e.props.options),e.props.selections=[],e.props.memoOptions=[],e.props.invertPopover=!1,e.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},e.props.decrementCount=0,e.props.page=1,e.props.loadMoreOption={label:"Load more",value:Dt},e.props.loadOptions=At,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=r(e.props.searchable),e.props.loadOnScroll=r(e.props.loadOnScroll),e.props.multiple=r(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=r(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&r(e.props.openOnRemove),e.props.hasNextPage=Ct.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=r(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0),e.on("mounted",(()=>Ht(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ht(e)}),10)))}(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,$t(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd]))))}(n):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(n),e(n),Rt(n),function(e){e.on("created",(()=>{e.context&&(e.props.trackHover=!0,void 0!==e.props.disabled||e.props.optionsLoader||!e.props.options||e.props.options.length||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||(e.props.disabledInternally=!0),Nt(e),e.props.loadOnCreated&&!e.props.optionsLoaded?At(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=r(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),jt(n),t(n),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(_t))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(_t)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Mt(e.props.options),e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0),Ot(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(oe)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),e.props.searchExpand||(o.value="",o.value=e.props.inputText))}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(n),o(n)}function so(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=r(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=r(e.props.selectionRemovable)}function ao(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 lo(e,t,o){var r,s,a;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push($t(t)),e}),[]);(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&o.push(Dt);let l=-1;e.props.activeValue&&(l=o.findIndex((t=>n(t,e.props.activeValue)))),-1===l&&o.length?e.props.activeValue=o[0]:"ArrowDown"===t&&o.length>l+1?e.props.activeValue=o[l+1]:"ArrowUp"===t&&l>0?e.props.activeValue=o[l-1]:"ArrowUp"===t&&0===l&&(null===(a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===a||a.focus(),e.props.expanded=!1)}else e.props.expanded||"ArrowDown"!==t||(e.props.expanded=!0)}function po(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=$t(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=$t(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function io(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 co(e,t,o,r=!0){var s,a,l,p,i,d,c;const u=o.key;if(o.altKey){const r=mt(),s=e.props.selections.findIndex((e=>n($t(e),$t(t)))),a=[...e.props.selections];"ArrowRight"===o.key?s<e.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,t)):"ArrowLeft"===o.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,t)),e.props.activeSelectionValue=$t(t),e.input([...a.map($t)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const o=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===o)return;const f="ArrowRight"===u?o+1:o-1;if(f>=e.props.selections.length){if(!r)return e.props.expanded=!0,e.props.activeSelectionValue=void 0,void(null===(a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}`))||void 0===a||a.focus());null===(p=null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`))||void 0===p||p.focus()}else if(f<0&&0===o)null===(d=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=e.props.__root)||void 0===c?void 0:c.getElementById(`${e.props.id}_tag-wrapper_${f}`);v&&v.focus(),e.props.selections[f]?e.props.activeSelectionValue=$t(e.props.selections[f]):e.props.activeSelectionValue=void 0}}function uo(e,t,o){var r;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const s=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===s)return;const a=e.props.selections[s+1]?s+1:s-1,l=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${a}`);l&&l.focus(),e.props.userAction={type:"tagDelete"},Et(e,t)}function fo(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(Ft(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===Dt)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>n($t(t),e.props.activeValue)));if(!t)return;Vt(e,t)}else e.props.expanded=!0}function vo(e){e.props.expanded&&(e.props.expanded=!1)}function ho(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":io(e);break;case"ArrowRight":case"ArrowLeft":co(e,t,o,!1);break;case"Delete":case"Backspace":uo(e,t,o)}}function mo(e,t,o){if(e.props.disabled)return;switch(o.key){case"ArrowUp":case"ArrowDown":!function(e,t,o){var r,s,a,l;o.preventDefault();const p=o.key,i=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===i)return;const d="ArrowDown"===p?i+1:i-1;if(d<0&&(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus()),d<0||d>=e.props.selections.length)return;const c=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_selection_wrapper_${d}`);c&&c.focus(),e.props.activeSelectionValue=(null===(l=e.props.selections[d])||void 0===l?void 0:l.value)||void 0}(e,t,o);break;case"Enter":break;case"Tab":!function(e,t,o){var r,s,a,l;if(t){const p=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===p)return;const i=o.shiftKey?p-1:p+1;if(i>=e.props.selections.length)return;if(i<0)return void(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus());const d=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_selection_wrapper_${i}`);d&&d.focus(),e.props.activeSelectionValue=(null===(l=e.props.selections[i])||void 0===l?void 0:l.value)||void 0}}(e,t,o);break;case"Delete":case"Backspace":!function(e,t){var o;if(t){const r=e.props.selections.findIndex((e=>n($t(e),$t(t))));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${s}`);a&&a.focus(),e.props.selections[s]?e.props.activeSelectionValue=$t(e.props.selections[s]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),Et(e,t)}(e,t)}}function $o(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":lo(e,o,t);break;case"ArrowLeft":case"ArrowRight":po(e,o);break;case"Enter":fo(e,t);break;case"Escape":vo(e);break;case"Delete":case"Backspace":ao(e);break;default:e.emit("unusedKeydown",t)}}function go(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":lo(e,o,t);break;case"ArrowRight":case"ArrowLeft":po(e,o);break;case"Enter":fo(e,t);break;case"Escape":vo(e);break;case"Delete":case"Backspace":ao(e)}}function bo(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&r(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=yo.bind(null,e),e.context.handlers.focus=xo.bind(null,e),e.context.handlers.keydown=$o.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>ho.bind(null,e,t))}))}function yo(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 xo(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 wo(e){let t,o="";e.on("unusedKeydown",(({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!o&&" "===r.key)return void function(e,t){var o;if(t.preventDefault(),e.props.expanded){if(e.props.activeValue===Dt)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>n($t(t),e.props.activeValue)));if(!t)return;Vt(e,t)}else e.props.expanded=!0}(e,r);e.props.expanded=!0,clearTimeout(t),o+=r.key;const s=e.props.allOptions.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));s&&(e.props.activeValue=$t(s)),t=setTimeout((()=>{o=""}),400)}}))}function _o(e){ko(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,ko(e)})),oe&&s(`${e.props.id}_selections`,Lo.bind(null,e),e.props.__root)}function ko(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 So(e){var t,o;if(!oe||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const 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),p=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<p.length;e++)t.push([p[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 p=s-n;if(a>p){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()+"...",p+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((()=>{ko(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,ko(e)}function Lo(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:So(e))})),n=new ResizeObserver((()=>{So(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Ao={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Co={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Do={overflow:"hidden",height:"100%"},Io={},Eo={};let To=0;function Oo(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 p=r.getBoundingClientRect(),i=n.getBoundingClientRect(),d=Math.round(p.top-i.top)+"px",c=Math.round(p.left-i.left-5)+"px",u=Math.max(Math.round(Math.min(i.height-i.top,window.innerHeight)-(p.top+p.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(${p.width+"px"}, calc(100vw - 4em))`:p.width+"px",maxWidth:"calc(100vw - 4em)"}}function Mo(e,t){var o,r;let s=null;if(e.props.activeDescendant){const a=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!a)return s;e.props.ignoreScroll=!0;const l=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_listbox`);if(!l)return s;const p=t.getBoundingClientRect(),i=l.getBoundingClientRect(),d=parseInt(getComputedStyle(t).paddingTop),c=parseInt(getComputedStyle(t).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(t.scrollHeight-c-u-p.height,0),h=i.height-f-v;t.scrollTop=u;const m=()=>{t.scrollTop=v>0?v<d?t.scrollHeight:d:f<c?0:u-c},$=Math.min(150,i.height);f>0&&v>0||0===f&&0===v||h>$?t.scrollTop=u:m();t.clientHeight/2<t.scrollTop&&(s=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>n(e.value,$t(t))))),-1===s&&(s=null)}return s}function Vo(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&c(300,[e]),e.props.dropdownWrapperStyles=a(Ao),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=Oo.bind(null,e),e.props.positionListBox=Mo.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){To=document.documentElement.scrollTop;for(const e in Co)Eo[e]=document.documentElement.style[e],document.documentElement.style[e]=Co[e];for(const e in Do)Io[e]=document.body.style[e],document.body.style[e]=Do[e];document.body.scrollTop=To}():function(){for(const e in Co)document.documentElement.style[e]=Eo[e];for(const e in Do)document.body.style[e]=Io[e];document.body.scrollTop=0,document.documentElement.scrollTop=To}())}))}function Fo(e){e.addProps(["multiLine"]),e.on("created",(()=>{oe&&(e.props.multiLineHeight=void 0,s(`${e.props.id}_selections`,Bo.bind(null,e),e.props.__root))}))}function Bo(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),Po(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 Po(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 Ho(e){if(e.on("created",(()=>{e.context&&wo(e)})),e.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(e),"truncate"===e.props.selectionAppearance&&(e.props.lastVisibleIndex=null,_o(e),e.on("prop:selections",(()=>{_o(e)}))),"tags"===e.props.selectionAppearance&&Fo(e),e.props.multiple&&"tags"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t,o){e.input(t)}e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),s(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const r={threshold:{horizontal:.25,vertical:0},plugins:[x()],draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};w({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,w({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,w({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}e.on("prop:expanded",(({payload:t})=>{t&&e.props.optionsLoader&&"function"==typeof e.props.optionsLoader&&(!e.props.options.length||e.props.alwaysLoadOnOpen)&&(e.props.options=[],At(e))})),"overscroll"===e.props.behavior&&Vo(e)}const Ro=(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 Ko(e){if(e.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),e.props.popover=r(e.props.popover)?"manual":void 0,"input"!==e.type||"overscroll"===e.props.behavior)return;let t=null,o=null,n=[],a=null;if(e.props.popoverOffset=r(e.props.popoverOffset)?parseInt(e.props.popoverOffset):0,!e.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 l=()=>{e.props.invertPopover=!1,document.removeEventListener("resize",a),document.removeEventListener("scroll",a),n.forEach((e=>{e.removeEventListener("scroll",a)}))};function p(){const{x:n,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}}(t,o);e.props.popoverAncestorCoordinates={x:n,y:r,width:s,height:a},e.props.popoverCoordinates={x:n,y:r,width:s,height:0}}function i(o){t&&document.body.contains(t)&&(o?(null==t||t.showPopover(),setTimeout((()=>{e.props.popoverCoordinates.height=(null==t?void 0:t.offsetHeight)||0}),5)):t.matches(":popover-open")&&(t.hidePopover(),e.props.popoverCoordinates.height=0))}e.on("mounted",(()=>{e.context&&(e.props.usePopover=!0,e.props.popoverCoordinates={x:0,y:0,width:0,height:0},e.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),e.on("destroyed",(()=>{l()})),e.on("prop:inputText",(()=>{e.context&&(p(),i(!0))})),e.on("prop:expanded",(({payload:r})=>{var d;e.context&&(!1===r?l():s(`${null===(d=e.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!e.context)return;t=document.querySelector(`[id="${e.context.id}_popover"][popover]`)||document.querySelector(`[id="${e.context.id}_popover"] [popover]`),o||(o=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(t)),p(),i(r),a=Ro((()=>{e.context&&(p(),i(r))}),10),document.addEventListener("resize",a),document.addEventListener("scroll",a),n=[];let s=null==t?void 0:t.parentElement;for(;s;)s.scrollHeight>s.clientHeight&&n.push(s),s=s.parentElement;n.forEach((e=>{e.addEventListener("scroll",a)}))})))}))}const No={schema:/* #__PURE__ */Re(/* #__PURE__ */Ke(/* #__PURE__ */Ue("$label"),/* #__PURE__ */Ne(/* #__PURE__ */We("prefix"),/* #__PURE__ */Ye(),/* #__PURE__ */Ge(/* #__PURE__ */Be("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */Qe('$placeholder || "placeholder"'),/* #__PURE__ */Be("$multiple !== true",/* #__PURE__ */Xe(/* #__PURE__ */Be("$state.loading && $selections.length === 0",/* #__PURE__ */et("$ui.isLoading.value"),/* #__PURE__ */Je(/* #__PURE__ */tt("$option.label")))),/* #__PURE__ */Be('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */nt(/* #__PURE__ */rt(/* #__PURE__ */Be("$state.loading && $selections.length === 0",/* #__PURE__ */et("$ui.isLoading.value"),/* #__PURE__ */at()))),/* #__PURE__ */Be('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */dt(/* #__PURE__ */ct(/* #__PURE__ */Be("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */et("$ui.isLoading.value"),/* #__PURE__ */lt(/* #__PURE__ */pt(/* #__PURE__ */Be("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */ut("$ui.isLoading.value"),/* #__PURE__ */it("$option.label")),/* #__PURE__ */ot(/* #__PURE__ */We("close"))))))))))),/* #__PURE__ */Be("$truncationCount && $state.loading !== true",/* #__PURE__ */st("$truncationCount")),/* #__PURE__ */Be("$state.loading",/* #__PURE__ */We("loader")),/* #__PURE__ */Be("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */ot(/* #__PURE__ */We("close")),/* #__PURE__ */We("select"))),/* #__PURE__ */ft(),/* #__PURE__ */je(),/* #__PURE__ */We("suffix"))),/* #__PURE__ */ze("$help"),/* #__PURE__ */Ze(/* #__PURE__ */qe("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
2
2
|
/* #__PURE__ */$("select","select"),
|
|
3
3
|
/* #__PURE__ */$("close","close"),
|
|
4
4
|
/* #__PURE__ */$("selected","check"),
|
|
@@ -7,7 +7,7 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
|
|
|
7
7
|
/* #__PURE__ */g("loadMore"),
|
|
8
8
|
/* #__PURE__ */g("remove"),b,
|
|
9
9
|
/* #__PURE__ */ro.bind(null,so,bo,Ho),Ko]},Wo=/* #__PURE__ */Me("tg"),{outer:Uo,wrapper:Yo,label:jo,prefix:zo,suffix:Zo,help:qo,messages:Go,message:Xo,icon:Jo}=/* #__PURE__ */Ve(Wo),Qo=Wo("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",name:"$node.name",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),en=Wo("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),tn=Wo("altLabel",(()=>({$el:"label",if:"($label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner) || $altLabelPosition === true",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),on=Wo("innerLabel",(()=>({$el:"div",if:"$valueLabelDisplay === inner && ($checked && $onValueLabel || $offValueLabel)",attrs:{style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:{if:"$checked",then:"$onValueLabel",else:"$offValueLabel"}}))),nn=Wo("valueLabel",(()=>({$el:"label",if:"$valueLabelDisplay !== hidden && $valueLabelDisplay !== inner && (($checked === true && $onValueLabel) || ($checked === false && $offValueLabel))",attrs:{for:"$id"},children:{if:"$checked && $onValueLabel",then:"$onValueLabel",else:{if:"$offValueLabel",then:"$offValueLabel"}}}))),rn=Wo("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),sn=Wo("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),an=Wo("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),ln=()=>an(Be("$slots.default","$slots.default",Jo("thumb")));const pn={schema:/* #__PURE__ */Uo(/* #__PURE__ */Yo(/* #__PURE__ */tn(),/* #__PURE__ */rn(/* #__PURE__ */zo(),/* #__PURE__ */Qo(),/* #__PURE__ */sn(/* #__PURE__ */on(),/* #__PURE__ */ln()),/* #__PURE__ */Zo()),/* #__PURE__ */nn(),/* #__PURE__ */en()),/* #__PURE__ */qo("$help"),/* #__PURE__ */Go(/* #__PURE__ */Xo("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(e){function t(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}e.on("created",(()=>{"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.altLabelPosition=r(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=n(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=n(t,e.props.onValue)}))}]},dn=/* #__PURE__ */Me("rp"),{outer:cn,inner:un,prefix:fn,suffix:vn,help:hn,messages:mn,message:$n,icon:gn}=
|
|
10
|
-
/* #__PURE__ */Ve(dn),bn=dn("empty",(()=>({$el:"div"}))),yn=dn("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),xn=dn("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),wn=dn("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),_n=dn("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),kn=dn("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Sn=dn("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Ln=dn("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),An=dn("content","div"),Cn=dn("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),Dn=dn("legend",(()=>({$el:"legend",if:"$label"}))),In=dn("group",(()=>({$formkit:"group",index:"$index"}))),En=dn("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Tn=dn("remove",(()=>({$el:"li",if:"$removeControl"}))),On=dn("insert",(()=>({$el:"li",if:"$insertControl"}))),Mn=dn("up",(()=>({$el:"li",if:"$upControl"}))),Vn=dn("down",(()=>({$el:"li",if:"$downControl"}))),Fn=dn("controlLabel","span"),Bn=dn("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Pn=dn("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}})));function Hn(e){var t,o,n,s,a,l,p,i,d,c,u,f,v,h;if(null!==(t=(i=e.props).removeControl)&&void 0!==t||(i.removeControl=!0),null!==(o=(d=e.props).upControl)&&void 0!==o||(d.upControl=!0),null!==(n=(c=e.props).downControl)&&void 0!==n||(c.downControl=!0),null!==(s=(u=e.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=e.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(p=(h=e.props).addAttrs)&&void 0!==p||(h.addAttrs={}),e.props.draggable=r(e.props.draggable),e.props.min=void 0!==e.props.min?Number(e.props.min):1,e.props.max=void 0!==e.props.max?Number(e.props.max):1/0,e.props.min>e.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(e.value))if(e.value.length<e.props.min){const t=he(e.props.min-e.value.length,(()=>({})));e.input(e.value.concat(t),!1)}else e.value.length>e.props.max&&e.input(e.value.slice(0,e.props.max),!1);else e.input(he(e.props.min,(()=>({}))),!1);e.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(e,e.context.fns)}function Rn(e,t){if(!t.context)return;const o={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[x({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};function
|
|
10
|
+
/* #__PURE__ */Ve(dn),bn=dn("empty",(()=>({$el:"div"}))),yn=dn("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),xn=dn("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),wn=dn("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),_n=dn("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),kn=dn("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Sn=dn("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Ln=dn("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),An=dn("content","div"),Cn=dn("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),Dn=dn("legend",(()=>({$el:"legend",if:"$label"}))),In=dn("group",(()=>({$formkit:"group",index:"$index"}))),En=dn("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Tn=dn("remove",(()=>({$el:"li",if:"$removeControl"}))),On=dn("insert",(()=>({$el:"li",if:"$insertControl"}))),Mn=dn("up",(()=>({$el:"li",if:"$upControl"}))),Vn=dn("down",(()=>({$el:"li",if:"$downControl"}))),Fn=dn("controlLabel","span"),Bn=dn("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Pn=dn("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}})));function Hn(e){var t,o,n,s,a,l,p,i,d,c,u,f,v,h;if(null!==(t=(i=e.props).removeControl)&&void 0!==t||(i.removeControl=!0),null!==(o=(d=e.props).upControl)&&void 0!==o||(d.upControl=!0),null!==(n=(c=e.props).downControl)&&void 0!==n||(c.downControl=!0),null!==(s=(u=e.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=e.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(p=(h=e.props).addAttrs)&&void 0!==p||(h.addAttrs={}),e.props.draggable=r(e.props.draggable),e.props.min=void 0!==e.props.min?Number(e.props.min):1,e.props.max=void 0!==e.props.max?Number(e.props.max):1/0,e.props.min>e.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(e.value))if(e.value.length<e.props.min){const t=he(e.props.min-e.value.length,(()=>({})));e.input(e.value.concat(t),!1)}else e.value.length>e.props.max&&e.input(e.value.slice(0,e.props.max),!1);else e.input(he(e.props.min,(()=>({}))),!1);e.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(e,e.context.fns)}function Rn(e,t){var o;if(!t.context)return;const n=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`#${t.props.id} .${t.context.classes.inner}`),r=null==n?void 0:n.hasAttribute("data-auto-animate"),s={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:r?[]:[x({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};function a(){return Array.isArray(t.value)?t.value:[]}function l(e){t.input(e)}w({parent:e,getValues:a,setValues:l,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,w({parent:e,getValues:a,setValues:l,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,w({parent:e,getValues:a,setValues:l,config:s})}))}const Kn={schema:/* #__PURE__ */cn(/* #__PURE__ */Cn(/* #__PURE__ */Dn("$label"),/* #__PURE__ */hn("$help"),/* #__PURE__ */un(/* #__PURE__ */fn(),/* #__PURE__ */Be("$value.length === 0",/* #__PURE__ */Be("$slots.empty",/* #__PURE__ */bn()),/* #__PURE__ */Be("$slots.default",/* #__PURE__ */_n(/* #__PURE__ */kn(/* #__PURE__ */Bn(/* #__PURE__ */Pn(/* #__PURE__ */gn("dragHandle"))),/* #__PURE__ */An(/* #__PURE__ */In("$slots.default")),/* #__PURE__ */En(/* #__PURE__ */Mn(/* #__PURE__ */Ln(/* #__PURE__ */Fn("$ui.moveUp.value"),/* #__PURE__ */gn("moveUp"))),/* #__PURE__ */Tn(/* #__PURE__ */wn(/* #__PURE__ */Fn("$ui.remove.value"),/* #__PURE__ */gn("remove"))),/* #__PURE__ */On(/* #__PURE__ */yn(/* #__PURE__ */Fn("$ui.add.value"),/* #__PURE__ */gn("add"))),/* #__PURE__ */Vn(/* #__PURE__ */Sn(/* #__PURE__ */Fn("$ui.moveDown.value"),/* #__PURE__ */gn("moveDown")))))),/* #__PURE__ */vn()))),/* #__PURE__ */xn('$addLabel || ($ui.add.value + " " + ($label || ""))')),/* #__PURE__ */mn(/* #__PURE__ */$n("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(e){e._c.sync=!0,e.on("created",Hn.bind(null,e)),e.on("mounted",(()=>{s(`${e.props.id}_items`,(t=>{if(t instanceof HTMLElement){Rn(t,e);function o(t){for(const o of t)for(const t of Array.from(o.addedNodes))if(t instanceof HTMLElement&&t.id===`${e.props.id}_items`)return void Rn(t,e)}new MutationObserver(o).observe(t.parentNode,{childList:!0})}}),e.props.__root)}))},y,
|
|
11
11
|
/* #__PURE__ */g("remove"),
|
|
12
12
|
/* #__PURE__ */g("add"),
|
|
13
13
|
/* #__PURE__ */g("moveUp"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formkit/pro",
|
|
3
|
-
"version": "0.125.
|
|
3
|
+
"version": "0.125.8",
|
|
4
4
|
"description": "FormKit Pro — Form inputs and tools for high quality forms.",
|
|
5
5
|
"main": "index.cjs",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vue"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@formkit/drag-and-drop": "^0.0.
|
|
47
|
+
"@formkit/drag-and-drop": "^0.0.38",
|
|
48
48
|
"@formkit/tempo": "^0.0.8"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|