@formkit/pro 0.126.4 → 0.126.6
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/README.md +30 -13
- package/datepicker/datepicker.ts +2 -6
- package/datepicker/index.mjs +1 -1
- package/index.cjs +10 -10
- package/index.mjs +10 -10
- package/package.json +4 -4
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 I,format as C,nearestDay as D,removeOffset as T,parse as E,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'}),Ie=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),Ce=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),De=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Te=()=>({$el:null,for:["part","$_overlayParts"]});function Ee(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)=>Ee(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",Ie),overlay:e("overlay",Ce),overlayParts:e("overlayParts",Te),overlayInner:e("overlayInner",De)}}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 It(e,t){e.props.page++,St.set(e,t),e.store.set(i({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Ct=Symbol(),Dt=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 Tt(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 Et(e){const t=Dt(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)!==Ct?(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((()=>{Et(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&&Et(e):(t=e.props.inputStd,async function(e){const t=Dt(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",(()=>{Et(e),e.props.optionLoadingCounter||e.off(t)}))}else Et(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===Ct)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"},Tt(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:Ct},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=It.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(Ct);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"},Tt(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===Ct)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"}),Tt(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===Ct)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"},Io={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Co={overflow:"hidden",height:"100%"},Do={},To={};let Eo=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(){Eo=document.documentElement.scrollTop;for(const e in Io)To[e]=document.documentElement.style[e],document.documentElement.style[e]=Io[e];for(const e in Co)Do[e]=document.body.style[e],document.body.style[e]=Co[e];document.body.scrollTop=Eo}():function(){for(const e in Io)document.documentElement.style[e]=To[e];for(const e in Co)document.body.style[e]=Do[e];document.body.scrollTop=0,document.documentElement.scrollTop=Eo}())}))}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:[
|
|
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 I}from"@formkit/drag-and-drop";import{offset as A,format as C,nearestDay as D,parse as T,range as E,parts as O,parseParts as M,addDay as V,addMonth as F,addYear as B,dayStart as P,monthStart as H,monthEnd as R,removeOffset as K,sameDay as N,date as W,formatStr as U,applyOffset as Y,monthDays as j,isBefore as z,isAfter as Z,weekStart as q,weekEnd as G}from"@formkit/tempo";const X=[988,24029,396,13078,980],J=18806588,Q=502357,ee=16217489;let te=189024;const oe=()=>[30548127325,27022924,34729821653783].map(ie).join("y"),ne=/^[0-9a-f]+$/,re="undefined"!=typeof window,se=$e(32,(e=>e)).map((()=>{te|=0,te=te+1831565813|0;let e=te^te>>>15|te;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),ae=re?setTimeout:()=>0,le=e=>{clearTimeout(pe[e])},pe={},ie=e=>e.toString(32),de=e=>`${ie(se[e]).substring(2)}.${ie(X[e%(X.length-1)])}`;const ce={},ue={},fe=new Set(["",null,void 0]);function ve(e,t){e in ce||(ce[e]={timer:0,inputs:new Set});const o=ce[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=ae((()=>{pe[e]||(pe[e]=ae((()=>fe.add(e)),2e3)),function(e){if(re){window.addEventListener(oe(),(t=>{const o=new URL(t.blockedURI).hostname;se.some(((e,t)=>de(t)===o))&&(he(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=ie(J),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(ce[e].inputs),l=a.filter((t=>!(ue[e]&&ue[e].has(t)))).join("");if(le(e),l){t++;try{const s=await window[ie(ee)](`${o}${n}${de((r+t)%se.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[ie(Q)])return he(e,p.schema);if(s.ok)return ue[e]||(ue[e]=new Set),void a.forEach((t=>ue[e].add(t)))}catch(e){}t<2&&ae(s,1e4*Math.random())}};s()}}(e)}),500)}function he(e,t){fe.add(e),function(e,t){ge[e]&&ge[e].forEach((e=>e(t)))}(e,t)}function me(e,t,o){if(ve(t,o),!t)throw new Error("FormKitNoKey");return fe.has(t)?null:e}function $e(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const ge={};const be=()=>({$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"}}),ye=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),xe=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),we=()=>({$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"}}),ke=()=>({$el:"div",if:"$help"}),Se=()=>({$el:null}),Le=(e,t)=>()=>u(e,t),Ie=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Ae=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Ce=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),De=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),Te=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Ee=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Oe=()=>({$el:null,for:["part","$_overlayParts"]});function Me(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=Ve(t,o,Object.defineProperty(s,"$el",{enumerable:!1,get:me.bind(null,n,t,e)}))}else if(p(c)){const{$cmp:n,...s}=c;r=Ve(t,o,Object.defineProperty(s,"$cmp",{enumerable:!1,get:me.bind(null,n,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${o}`;const{$formkit:n,...s}=c;r=Ve(t,o,Object.defineProperty(s,"$formkit",{enumerable:!1,get:me.bind(null,n,t,e)}))}return r}return Ve(t,o,c)}(t,a,o,n,s,i);return r&&e(d)&&(d.memo=t+JSON.stringify(i)),r?[d]:d}}function Ve(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 Fe(e){return(t,o,n=!1)=>Me(e,t,o,n)}function Be(e){return{outer:e("outer",be,!0),wrapper:e("wrapper","div",!1),inner:e("inner",ye,!1),icon:Le,label:e("label",xe,!1),prefix:e("prefix",Se,!1),suffix:e("suffix",Se,!1),help:e("help",ke,!1),messages:e("messages",we,!1),message:e("message",_e,!1)}}function Pe(e){return{overlayPlaceholder:e("overlayPlaceholder",Ie),overlayLiteral:e("overlayLiteral",Ae),overlayChar:e("overlayChar",Ce),overlayEnum:e("overlayEnum",De),overlay:e("overlay",Te),overlayParts:e("overlayParts",Oe),overlayInner:e("overlayInner",Ee)}}function He(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 Re(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(He("$option.group",v(h("$option.group"),m(u((e=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),$=r(He("$fns.isSelected($option)",Le("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(He("$fns.isSelected($option)",Le("selected")),d("$option.label")))),s(He("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",a(He("$state.loading",Le("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,$}}const Ke=/* #__PURE__ */Fe("dd"),{outer:Ne,wrapper:We,inner:Ue,icon:Ye,label:je,prefix:ze,suffix:Ze,help:qe,messages:Ge,message:Xe}=/* #__PURE__ */Be(Ke),Je=Ke("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"}}))),Qe=Ke("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),et=Ke("selection",(()=>({$el:"div"}))),tt=Ke("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'}}}))),ot=Ke("optionLoading","span"),nt=Ke("option",(()=>({$el:"div"}))),rt=Ke("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),st=Ke("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),at=Ke("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),lt=Ke("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),pt=Ke("selectionsItem",(()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'}))),it=Ke("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)"}}))),dt=Ke("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),ct=Ke("tagLabel",(()=>({$el:"span"}))),ut=Ke("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),ft=Ke("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),vt=Ke("tagLoading","span"),ht=/* #__PURE__ */Re(Ke);function mt(t){return e(t)&&"value"in t&&"label"in t}function $t(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function gt(){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 bt(e){return"__original"in e?e.__original:e.value}const yt=new WeakMap,xt=new WeakMap;async function wt(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(xt.get(e));const o=t?e.props.debounce:0;0===o?_t(e,n):xt.set(e,setTimeout((()=>{e.props.page=1,_t(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 _t(e,t){e.props.allowAppendOptions=t,Ct(e)}const kt=/* #__PURE__ */i({key:"loading",type:"state",value:!0,visible:!1}),St=/* #__PURE__ */i({key:"loading",type:"state",value:!1,visible:!1});function Lt(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=bt(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(St),e.store.set(i({key:"hasNextPage",type:"state",value:!1,visible:!1}))),yt.set(e,e.props.searchValue)}const It=new WeakMap;function At(t,r,s){if(t.store.set(kt),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}:mt(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(bt(t),bt(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||mt(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 Ct(e){e.store.set(kt),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,It.get(e)),n=Lt.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 Dt(e,t){e.props.page++,It.set(e,t),e.store.set(i({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Tt=Symbol(),Et=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(bt(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 Ot(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!n(bt(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 Mt(e){const t=Et(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:re&&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 Vt(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=bt(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>n(bt(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=bt(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=bt(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=bt(e.props.selections[e.props.selections.length-1]):e.props.activeValue=bt(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=bt(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function Ft(e){return e.reduce(((e,t)=>(t.options?e.push(...Ft(t.options)):e.push(t),e)),[])}function Bt(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(bt(t)!==Tt?(e.props.option=t,e.props.maxReached&&!Rt(e,t)||(e.input(Pt(e,bt(t))),Rt(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function Pt(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 Ht(e,t){return n(e.props.activeValue,bt(t))||void 0}function Rt(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(n(o,bt(t)))return!0;return!1}return n(e.value,bt(t))}function Kt(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 Nt(e){e.props.firstCommit=!0;let t=null;e.on("commit",(()=>{if(0===e.props.inputStd.length&&e.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(e),void(t=e.props.inputStd);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=Ct(e);t instanceof Promise&&t.then((()=>{Mt(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&&Mt(e):(t=e.props.inputStd,async function(e){const t=Et(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>n(bt(e),t))))):e.props.inputStd;if(o.forEach((o=>{At(e,o,Array.isArray(t)&&t.find((e=>n(bt(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{Mt(e),e.props.optionLoadingCounter||e.off(t)}))}else Mt(e)}(e))}))}const Wt=new WeakSet;function Ut(e){if(!re)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,bt(t)))),-1===s&&(s=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&Yt(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=jt.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);Wt.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||Wt.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]),Wt.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=bt(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||Yt(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)),Wt.has(e)?requestAnimationFrame(l.bind(null,e,t,o)):a(e,o)):Wt.delete(e)}e.on("prop:trackHover",(({payload:t})=>{var n,r,s;re&&(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(),Vt(e)):document.removeEventListener("mousemove",t)})),e.on("prop:trackHover",(({payload:t})=>{var n,r;re&&(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===Tt)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(bt(e.props.options[s].options[a]),t)){r=a,o=s;break}if(n(bt(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 Yt(e){var t,o;if(!re)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 jt(){}const zt=new WeakMap;function Zt(e){e.on("created",(()=>{if(!e.context||!re)return;e.context.fns.isActive=Ht.bind(null,e),e.context.fns.isSelected=t=>Rt(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(n(bt(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=ro,e.context.handlers.selectOption=t=>o=>so.call(null,e,t,o),e.context.handlers.loadMore=_t.bind(null,e),e.context.handlers.removeSelection=t=>o=>no(e,t,o),e.context.handlers.tagTouchstart=t=>o=>no(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?Jt.bind(null,e,t):Xt.bind(null,e),e.context.handlers.selectionBlur=()=>Qt.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>n(e,bt(t)),e.context.handlers.tagClick=t=>eo.bind(null,e,t),e.context.handlers.tagFocus=t=>to.bind(null,e,t),e.context.handlers.tagBlur=()=>oo.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=qt.bind(null,e),e.context.handlers.touchend=Gt.bind(null,e)}))}function qt(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=zt.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else zt.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function Gt(e){zt.delete(e)}function Xt(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function Jt(e,t,o){o.currentTarget instanceof HTMLElement&&(n(e.props.activeSelectionValue,bt(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=bt(t),o.currentTarget.focus()))}function Qt(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function eo(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(n(e.props.activeSelectionValue,bt(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=bt(t),o.currentTarget.focus())))}function to(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=bt(t),e.props.justFocused=!0)}function oo(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 no(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},Ot(e,t))}function ro(e){e.stopPropagation()}function so(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},Bt(e,t))}function ao(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=Ft(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:Tt},e.props.loadOptions=Ct,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=Dt.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",(()=>Kt(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Kt(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,bt(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),Nt(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),Ut(e),e.props.loadOnCreated&&!e.props.optionsLoaded?Ct(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),Zt(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(St))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(St)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Ft(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),Vt(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(re)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 lo(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 po(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 io(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(bt(t)),e}),[]);(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&o.push(Tt);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 co(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=bt(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=bt(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function uo(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 fo(e,t,o,r=!0){var s,a,l,p,i,d,c;const u=o.key;if(o.altKey){const r=gt(),s=e.props.selections.findIndex((e=>n(bt(e),bt(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=bt(t),e.input([...a.map(bt)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const o=e.props.selections.findIndex((e=>n(bt(e),bt(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=bt(e.props.selections[f]):e.props.activeSelectionValue=void 0}}function vo(e,t,o){var r;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const s=e.props.selections.findIndex((e=>n(bt(e),bt(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"},Ot(e,t)}function ho(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(Pt(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===Tt)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>n(bt(t),e.props.activeValue)));if(!t)return;Bt(e,t)}else e.props.expanded=!0}function mo(e){e.props.expanded&&(e.props.expanded=!1)}function $o(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":uo(e);break;case"ArrowRight":case"ArrowLeft":fo(e,t,o,!1);break;case"Delete":case"Backspace":vo(e,t,o)}}function go(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(bt(e),bt(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(bt(e),bt(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(bt(e),bt(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=bt(e.props.selections[s]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),Ot(e,t)}(e,t)}}function bo(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":io(e,o,t);break;case"ArrowLeft":case"ArrowRight":co(e,o);break;case"Enter":ho(e,t);break;case"Escape":mo(e);break;case"Delete":case"Backspace":po(e);break;default:e.emit("unusedKeydown",t)}}function yo(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":io(e,o,t);break;case"ArrowRight":case"ArrowLeft":co(e,o);break;case"Enter":ho(e,t);break;case"Escape":mo(e);break;case"Delete":case"Backspace":po(e)}}function xo(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&r(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=wo.bind(null,e),e.context.handlers.focus=_o.bind(null,e),e.context.handlers.keydown=bo.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>$o.bind(null,e,t))}))}function wo(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 _o(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 ko(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===Tt)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>n(bt(t),e.props.activeValue)));if(!t)return;Bt(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=bt(s)),t=setTimeout((()=>{o=""}),400)}}))}function So(e){Lo(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,Lo(e)})),re&&s(`${e.props.id}_selections`,Ao.bind(null,e),e.props.__root)}function Lo(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 Io(e){var t,o;if(!re||!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((()=>{Lo(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,Lo(e)}function Ao(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Io(e))})),n=new ResizeObserver((()=>{Io(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Co={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Do={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},To={overflow:"hidden",height:"100%"},Eo={},Oo={};let Mo=0;function Vo(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 Fo(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,bt(t))))),-1===s&&(s=null)}return s}function Bo(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&c(300,[e]),e.props.dropdownWrapperStyles=a(Co),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=Vo.bind(null,e),e.props.positionListBox=Fo.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Mo=document.documentElement.scrollTop;for(const e in Do)Oo[e]=document.documentElement.style[e],document.documentElement.style[e]=Do[e];for(const e in To)Eo[e]=document.body.style[e],document.body.style[e]=To[e];document.body.scrollTop=Mo}():function(){for(const e in Do)document.documentElement.style[e]=Oo[e];for(const e in To)document.body.style[e]=Eo[e];document.body.scrollTop=0,document.documentElement.scrollTop=Mo}())}))}function Po(e){e.addProps(["multiLine"]),e.on("created",(()=>{re&&(e.props.multiLineHeight=void 0,s(`${e.props.id}_selections`,Ho.bind(null,e),e.props.__root))}))}function Ho(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),Ro(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 Ro(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 Ko(e){if(e.on("created",(()=>{e.context&&ko(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,So(e),e.on("prop:selections",(()=>{So(e)}))),"tags"===e.props.selectionAppearance&&Po(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=[],Ct(e))})),"overscroll"===e.props.behavior&&Bo(e)}const No=(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 Wo(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=No((()=>{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 Uo={schema:/* #__PURE__ */Ne(/* #__PURE__ */We(/* #__PURE__ */je("$label"),/* #__PURE__ */Ue(/* #__PURE__ */Ye("prefix"),/* #__PURE__ */ze(),/* #__PURE__ */Je(/* #__PURE__ */He("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */tt('$placeholder || "placeholder"'),/* #__PURE__ */He("$multiple !== true",/* #__PURE__ */Qe(/* #__PURE__ */He("$state.loading && $selections.length === 0",/* #__PURE__ */ot("$ui.isLoading.value"),/* #__PURE__ */et(/* #__PURE__ */nt("$option.label")))),/* #__PURE__ */He('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */st(/* #__PURE__ */at(/* #__PURE__ */He("$state.loading && $selections.length === 0",/* #__PURE__ */ot("$ui.isLoading.value"),/* #__PURE__ */pt()))),/* #__PURE__ */He('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */ut(/* #__PURE__ */ft(/* #__PURE__ */He("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */ot("$ui.isLoading.value"),/* #__PURE__ */it(/* #__PURE__ */dt(/* #__PURE__ */He("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */vt("$ui.isLoading.value"),/* #__PURE__ */ct("$option.label")),/* #__PURE__ */rt(/* #__PURE__ */Ye("close"))))))))))),/* #__PURE__ */He("$truncationCount && $state.loading !== true",/* #__PURE__ */lt("$truncationCount")),/* #__PURE__ */He("$state.loading",/* #__PURE__ */Ye("loader")),/* #__PURE__ */He("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */rt(/* #__PURE__ */Ye("close")),/* #__PURE__ */Ye("select"))),/* #__PURE__ */ht(),/* #__PURE__ */Ze(),/* #__PURE__ */Ye("suffix"))),/* #__PURE__ */qe("$help"),/* #__PURE__ */Ge(/* #__PURE__ */Xe("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
2
2
|
/* #__PURE__ */$("select","select"),
|
|
3
3
|
/* #__PURE__ */$("close","close"),
|
|
4
4
|
/* #__PURE__ */$("selected","check"),
|
|
@@ -6,8 +6,8 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
|
|
|
6
6
|
/* #__PURE__ */g("isLoading"),
|
|
7
7
|
/* #__PURE__ */g("loadMore"),
|
|
8
8
|
/* #__PURE__ */g("remove"),b,
|
|
9
|
-
/* #__PURE__ */
|
|
10
|
-
/* #__PURE__ */
|
|
9
|
+
/* #__PURE__ */ao.bind(null,lo,xo,Ko),Wo]},Yo=/* #__PURE__ */Fe("tg"),{outer:jo,wrapper:zo,label:Zo,prefix:qo,suffix:Go,help:Xo,messages:Jo,message:Qo,icon:en}=/* #__PURE__ */Be(Yo),tn=Yo("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"}}))),on=Yo("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),nn=Yo("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"}))),rn=Yo("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"}}))),sn=Yo("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"}}}))),an=Yo("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),ln=Yo("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),pn=Yo("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),dn=()=>pn(He("$slots.default","$slots.default",en("thumb")));const cn={schema:/* #__PURE__ */jo(/* #__PURE__ */zo(/* #__PURE__ */nn(),/* #__PURE__ */an(/* #__PURE__ */qo(),/* #__PURE__ */tn(),/* #__PURE__ */ln(/* #__PURE__ */rn(),/* #__PURE__ */dn()),/* #__PURE__ */Go()),/* #__PURE__ */sn(),/* #__PURE__ */on()),/* #__PURE__ */Xo("$help"),/* #__PURE__ */Jo(/* #__PURE__ */Qo("$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)}))}]},un=/* #__PURE__ */Fe("rp"),{outer:fn,inner:vn,prefix:hn,suffix:mn,help:$n,messages:gn,message:bn,icon:yn}=
|
|
10
|
+
/* #__PURE__ */Be(un),xn=un("empty",(()=>({$el:"div"}))),wn=un("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),_n=un("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),kn=un("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),Sn=un("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),Ln=un("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),In=un("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),An=un("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),Cn=un("content","div"),Dn=un("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),Tn=un("legend",(()=>({$el:"legend",if:"$label"}))),En=un("group",(()=>({$formkit:"group",index:"$index"}))),On=un("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Mn=un("remove",(()=>({$el:"li",if:"$removeControl"}))),Vn=un("insert",(()=>({$el:"li",if:"$insertControl"}))),Fn=un("up",(()=>({$el:"li",if:"$upControl"}))),Bn=un("down",(()=>({$el:"li",if:"$downControl"}))),Pn=un("controlLabel","span"),Hn=un("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Rn=un("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}})));function Kn(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=$e(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($e(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 Nn(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 Wn={schema:/* #__PURE__ */fn(/* #__PURE__ */Dn(/* #__PURE__ */Tn("$label"),/* #__PURE__ */$n("$help"),/* #__PURE__ */vn(/* #__PURE__ */hn(),/* #__PURE__ */He("$value.length === 0",/* #__PURE__ */He("$slots.empty",/* #__PURE__ */xn()),/* #__PURE__ */He("$slots.default",/* #__PURE__ */Sn(/* #__PURE__ */Ln(/* #__PURE__ */Hn(/* #__PURE__ */Rn(/* #__PURE__ */yn("dragHandle"))),/* #__PURE__ */Cn(/* #__PURE__ */En("$slots.default")),/* #__PURE__ */On(/* #__PURE__ */Fn(/* #__PURE__ */An(/* #__PURE__ */Pn("$ui.moveUp.value"),/* #__PURE__ */yn("moveUp"))),/* #__PURE__ */Mn(/* #__PURE__ */kn(/* #__PURE__ */Pn("$ui.remove.value"),/* #__PURE__ */yn("remove"))),/* #__PURE__ */Vn(/* #__PURE__ */wn(/* #__PURE__ */Pn("$ui.add.value"),/* #__PURE__ */yn("add"))),/* #__PURE__ */Bn(/* #__PURE__ */In(/* #__PURE__ */Pn("$ui.moveDown.value"),/* #__PURE__ */yn("moveDown")))))),/* #__PURE__ */mn()))),/* #__PURE__ */_n('$addLabel || ($ui.add.value + " " + ($label || ""))')),/* #__PURE__ */gn(/* #__PURE__ */bn("$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",Kn.bind(null,e)),e.on("mounted",(()=>{s(`${e.props.id}_items`,(t=>{if(t instanceof HTMLElement){Nn(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 Nn(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"),
|
|
@@ -16,7 +16,7 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
|
|
|
16
16
|
/* #__PURE__ */$("remove","trash"),
|
|
17
17
|
/* #__PURE__ */$("add","add"),
|
|
18
18
|
/* #__PURE__ */$("moveUp","arrowUp"),
|
|
19
|
-
/* #__PURE__ */$("moveDown","arrowDown")]},Nn=new WeakMap;function Wn(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function Un(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function Yn(e,t){const{x:o,y:n}=er(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function jn(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?tr(e,t,o):e.input(t+1,!1))}function zn(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Wn(e);const o=Nn.get(e);o&&(o.abort(),Nn.delete(e))}function Zn(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>zn(e,t)),{signal:n.signal}),Nn.set(e,n),1===e.props.step?e.input(t+1,!1):tr(e,t,o)}function qn(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?or(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?or(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function Gn(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function Xn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Wn(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):tr(e,t,o,!!e.props.dragStarted)))}function Jn(e){Wn(e)}function Qn(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void tr(e,t,o)}function er(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function tr(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=er(o),a=o.currentTarget.getBoundingClientRect();let l=or((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):Wn(e,l):e.input(0)}function or(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const nr=/* #__PURE__ */Me("rt"),{outer:rr,wrapper:sr,inner:ar,label:lr,prefix:pr,suffix:ir,help:dr,messages:cr,message:ur,icon:fr}=/* #__PURE__ */Ve(nr),vr=nr("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),hr=nr("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),mr=nr("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),$r=nr("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),gr=nr("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),br=nr("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),yr=nr("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),xr=nr("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),wr=nr("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),_r=nr("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),kr=()=>Be("$slots.onItem",(()=>()=>"$slots.onItem"),Be("$slots.default",(()=>()=>"$slots.default"),fr("rating"))),Sr=()=>Be("$slots.offItem",(()=>()=>"$slots.offItem"),Be("$slots.default",(()=>()=>"$slots.default"),fr("rating"))),Lr={schema:/* #__PURE__ */rr(/* #__PURE__ */sr(/* #__PURE__ */lr("$label"),/* #__PURE__ */ar(/* #__PURE__ */fr("prefix"),/* #__PURE__ */pr(),/* #__PURE__ */vr(/* #__PURE__ */hr(/* #__PURE__ */mr(/* #__PURE__ */$r(/* #__PURE__ */yr(/* #__PURE__ */wr(/* #__PURE__ */kr())),/* #__PURE__ */xr(/* #__PURE__ */_r(/* #__PURE__ */Sr())),/* #__PURE__ */gr()),/* #__PURE__ */br()))),/* #__PURE__ */ir(),/* #__PURE__ */fr("suffix"))),/* #__PURE__ */dr("$help"),/* #__PURE__ */cr(/* #__PURE__ */ur("$message.value"))),type:"input",props:[],features:[function(e){function t(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}e.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==e.props.hoverHighlight&&"false"!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.deselect=r(e.props.deselect),e.props.max=Number(e.props.max)||5,e.props.min=Number(e.props.min)||0,e.props.step=Number(e.props.step)||1,e.props.numberOfSteps=e.props.max/e.props.step,e.props.lastIndex=1/e.props.step-1,e.props.itemsToPercentages={},"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.rightToLeft?(e.props.onItemStyles=void 0,e.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):e.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},e.props.stepsPerValue=1/e.props.step,e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)})),e.on("commit",(({payload:t})=>{const o=Number(t||0);Wn(e,o)})),e.on("created",(()=>{e.context&&(s(`${e.props.id}_items_wrapper`,(()=>{t(e),function(e){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{t(e)})).observe(n)}(e),setTimeout((()=>t(e)),100)}),e.props.__root),e.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],e.context.fns.getValue=(t,o)=>t+Number((o*e.props.step+e.props.step).toFixed(1)),e.context.fns.showLabel=(t,o)=>{const n=Number(e.value||0);return 0===n&&0===o||n&&t===n||t>n&&0===o||n>t&&o===e.props.lastIndex},e.context.handlers.handleFocus=t=>Gn.call(null,e,t),e.context.handlers.handleWrapperKeydown=t=>qn.call(null,e,t),e.context.handlers.handleWrapperBlur=t=>Un.call(null,e,t),e.context.handlers.handleItemClick=t=>o=>Qn.call(null,e,t,o),e.context.handlers.handleMousemove=t=>o=>Xn.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>Jn.call(null,e),e.context.handlers.handleDragstart=t=>o=>Zn.call(null,e,t,o),e.context.handlers.handleMouseup=t=>zn.call(null,e,t),e.context.handlers.handleTouchstart=t=>o=>jn.call(null,e,t,o),e.context.handlers.handleTouchmove=t=>Yn.call(null,e,t),e.context.handlers.handleKeydown=t=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(e,t,o))}))},/* #__PURE__ */$("rating","star")]},Ar=/* #__PURE__ */Me("ac"),{outer:Ir,wrapper:Cr,inner:Dr,icon:Tr,label:Er,prefix:Or,suffix:Mr,help:Vr,messages:Fr,message:Br}=/* #__PURE__ */Ve(Ar),Pr=Ar("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),Hr=Ar("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),Rr=Ar("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Kr=Ar("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Nr=Ar("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Wr=Ar("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),Ur=Ar("optionLoading","span"),Yr=Ar("option",(()=>({$el:"div",if:"$value !== undefined"}))),jr=/* #__PURE__ */Pe(Ar);function zr(e){"option"!==e.props.selectionAppearance||e.props.multiple||!1===e.props.selectionRemovable||"false"===e.props.selectionRemovable||(e.props.selectionRemovable=!0),e.props.multiple||(e.props.clearSearchOnOpen=r(e.props.clearSearchOnOpen)),e.props.selectionRemovable=r(e.props.selectionRemovable),e.props.openOnClick=r(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=r(e.props.allowNewValues)}function Zr(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=yt.bind(null,e),e.props.reloadOnCommit=r(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=r(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&oe&&(e.context.handlers.focus=Xr.bind(null,e),e.context.handlers.input=qr.bind(null,e),e.context.handlers.focus=Xr.bind(null,e),e.context.handlers.click=Gr.bind(null,e),e.context.handlers.toggleListbox=Jr.bind(null,e),e.context.handlers.toggleListboxKeydown=Qr.bind(null,e),e.context.handlers.keydown=go.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>mo(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":io(e);break;case"ArrowRight":case"ArrowLeft":co(e,t,o);break;case"Delete":case"Backspace":uo(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>$t(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||gt.delete(e)}))}function qr(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&yt(e,e.props.searchValue,!0)}function Gr(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function Xr(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function Jr(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function Qr(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),Jr(e))}const es=new WeakMap,ts="undefined"!=typeof window,os=new WeakMap;let ns=!1;function rs(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||ss(e)})),e.on("created",(()=>{if(!e.context||!ts)return;e.on("handleSearchInput",(({payload:t})=>{""===t?(e.props.searchValue=null,e.input([])):t&&0===e.props.inputStd.length?e.props.searchValue=t:t&&e.props.inputStd.length>0&&(e.props.searchValue=function(e){var t;const o=ls(e);if(e.props.highlightedRange){const[t,n]=as(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(e)),!e.props.expanded&&t?e.props.expanded=!0:!t&&e.props.expanded&&(e.props.expanded=!1)})),function(e){s(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&os.set(t,e)}),e.props.__root),ts&&!ns&&(ns=!0,document.addEventListener("selectionchange",(()=>{const e=mt();if(e instanceof HTMLInputElement&&os.has(e)){const t=os.get(e);t&&function(e){clearTimeout(es.get(e)),es.set(e,setTimeout((()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=ls(e),a=t.findIndex((e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end))),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=as(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),p=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=p}else e.props.highlightedRange=void 0,ss(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(e);const o=e.context.handlers.keydown;e.context.handlers.keydown=n=>{o(n),function(e,o){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(o.key)&&o.target instanceof HTMLInputElement&&null!==o.target.selectionEnd&&null!==o.target.selectionStart){if(0===o.target.selectionStart&&o.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===o.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=ls(e),n=null===(r=t[t.length-1])||void 0===r?void 0:r.end;o.target.selectionStart<n&&(o.target.selectionStart=Math.max(0,"ArrowLeft"===o.key?o.target.selectionStart-2:o.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(o.key))e.props.highlightedRange&&!e.props.searchValue?(Tt(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault());else if(o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)o.preventDefault();else if("Tab"===o.key)return;"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault()}(e,n)};const n=e.context.handlers.focus;e.context.handlers.focus=t=>{n(e,t);const o=new Event("selectionchange");document.dispatchEvent(o)},e.on("blur",(()=>{e.props.selections.length?(e.props.inputText=e.props.selections.map((e=>e.label)).join(", "),e.props.searchValue=null):e.props.selections.length||(e.props.inputText="",e.props.searchValue="")}))})),e.on("prop:expanded",(({payload:t})=>{t||e.props.inputStd.length?t&&(e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],yt(e,e.props.searchValue))):(e.props.searchValue="",e.props.inputText="")})),e.on("prop:selections",(()=>{var t;const o=[...e.props.selections].map((e=>e.label)).join(", ");let n="";if(ts&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),mt()===o&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}e.props.inputText=`${o}${n}`,e.props.reloadOnCommit&&(e.props.searchValue="",yt(e,e.props.searchValue))}));const t=(t,o=!1)=>{var n,r;const s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=ls(e),l=t>=0?t:a.length-1;if(void 0===a[l])return!1;const p=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=p&&s.selectionStart<=p+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&o!==t.option&&(o=t.option,Ot(e))}))}function ss(e){var t;if(!ts)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function as(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function ls(e){const t=Dt(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e}),[]):[]}function ps(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],yt(e,e.props.searchValue,!0))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&yt(e,e.props.searchValue,!0))}))}(e)}function is(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand&&(e.props.inputText="",e.props.searchValue=""),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||e.props.searchExpand||(e.props.options=[],yt(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&yt(e,e.props.searchValue,!0)}))}(e)}function ds(e){if(e.props.multiple)if(e.props.multiple&&"option"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}ps(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),s(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement&&e.context){const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,root:e.props.__root,disabled:!e.props.draggable,plugins:[x()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};w({parent:n,getValues:t,setValues:o,config: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)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&rs(e);else is(e)}const cs={schema:/* #__PURE__ */Ir(/* #__PURE__ */Cr(/* #__PURE__ */Er("$label"),/* #__PURE__ */Dr(/* #__PURE__ */Tr("prefix"),/* #__PURE__ */Or(),/* #__PURE__ */Pr(),/* #__PURE__ */Be("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */Nr(/* #__PURE__ */Rr(/* #__PURE__ */Kr(/* #__PURE__ */Yr(/* #__PURE__ */Be("$state.loading",/* #__PURE__ */Ur("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Be("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Tr("loader")),/* #__PURE__ */Be("$selectionRemovable && $isSingleOption",/* #__PURE__ */Wr(/* #__PURE__ */Tr("close")))))),/* #__PURE__ */Be("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Tr("loader")),/* #__PURE__ */Be('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Wr(/* #__PURE__ */Tr("close")),/* #__PURE__ */Be('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Hr(/* #__PURE__ */Tr("select")))),/* #__PURE__ */Be("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Hr(/* #__PURE__ */Tr("select"))),/* #__PURE__ */jr(),/* #__PURE__ */Mr(),/* #__PURE__ */Tr("suffix")),/* #__PURE__ */Be("$multiple && $selectionAppearance === option",/* #__PURE__ */Nr(/* #__PURE__ */Rr(/* #__PURE__ */Kr(/* #__PURE__ */Yr(/* #__PURE__ */Be("$state.loading && $isLoadingOption",/* #__PURE__ */Ur("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Wr(/* #__PURE__ */Tr("close")))))),/* #__PURE__ */Vr("$help"),/* #__PURE__ */Fr(/* #__PURE__ */Br("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
19
|
+
/* #__PURE__ */$("moveDown","arrowDown")]},Un=new WeakMap;function Yn(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function jn(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function zn(e,t){const{x:o,y:n}=or(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function Zn(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?nr(e,t,o):e.input(t+1,!1))}function qn(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Yn(e);const o=Un.get(e);o&&(o.abort(),Un.delete(e))}function Gn(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>qn(e,t)),{signal:n.signal}),Un.set(e,n),1===e.props.step?e.input(t+1,!1):nr(e,t,o)}function Xn(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?rr(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?rr(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function Jn(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function Qn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Yn(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):nr(e,t,o,!!e.props.dragStarted)))}function er(e){Yn(e)}function tr(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void nr(e,t,o)}function or(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function nr(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=or(o),a=o.currentTarget.getBoundingClientRect();let l=rr((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):Yn(e,l):e.input(0)}function rr(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const sr=/* #__PURE__ */Fe("rt"),{outer:ar,wrapper:lr,inner:pr,label:ir,prefix:dr,suffix:cr,help:ur,messages:fr,message:vr,icon:hr}=/* #__PURE__ */Be(sr),mr=sr("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),$r=sr("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),gr=sr("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),br=sr("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),yr=sr("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),xr=sr("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),wr=sr("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),_r=sr("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),kr=sr("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),Sr=sr("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),Lr=()=>He("$slots.onItem",(()=>()=>"$slots.onItem"),He("$slots.default",(()=>()=>"$slots.default"),hr("rating"))),Ir=()=>He("$slots.offItem",(()=>()=>"$slots.offItem"),He("$slots.default",(()=>()=>"$slots.default"),hr("rating"))),Ar={schema:/* #__PURE__ */ar(/* #__PURE__ */lr(/* #__PURE__ */ir("$label"),/* #__PURE__ */pr(/* #__PURE__ */hr("prefix"),/* #__PURE__ */dr(),/* #__PURE__ */mr(/* #__PURE__ */$r(/* #__PURE__ */gr(/* #__PURE__ */br(/* #__PURE__ */wr(/* #__PURE__ */kr(/* #__PURE__ */Lr())),/* #__PURE__ */_r(/* #__PURE__ */Sr(/* #__PURE__ */Ir())),/* #__PURE__ */yr()),/* #__PURE__ */xr()))),/* #__PURE__ */cr(),/* #__PURE__ */hr("suffix"))),/* #__PURE__ */ur("$help"),/* #__PURE__ */fr(/* #__PURE__ */vr("$message.value"))),type:"input",props:[],features:[function(e){function t(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}e.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==e.props.hoverHighlight&&"false"!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.deselect=r(e.props.deselect),e.props.max=Number(e.props.max)||5,e.props.min=Number(e.props.min)||0,e.props.step=Number(e.props.step)||1,e.props.numberOfSteps=e.props.max/e.props.step,e.props.lastIndex=1/e.props.step-1,e.props.itemsToPercentages={},"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.rightToLeft?(e.props.onItemStyles=void 0,e.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):e.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},e.props.stepsPerValue=1/e.props.step,e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)})),e.on("commit",(({payload:t})=>{const o=Number(t||0);Yn(e,o)})),e.on("created",(()=>{e.context&&(s(`${e.props.id}_items_wrapper`,(()=>{t(e),function(e){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{t(e)})).observe(n)}(e),setTimeout((()=>t(e)),100)}),e.props.__root),e.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],e.context.fns.getValue=(t,o)=>t+Number((o*e.props.step+e.props.step).toFixed(1)),e.context.fns.showLabel=(t,o)=>{const n=Number(e.value||0);return 0===n&&0===o||n&&t===n||t>n&&0===o||n>t&&o===e.props.lastIndex},e.context.handlers.handleFocus=t=>Jn.call(null,e,t),e.context.handlers.handleWrapperKeydown=t=>Xn.call(null,e,t),e.context.handlers.handleWrapperBlur=t=>jn.call(null,e,t),e.context.handlers.handleItemClick=t=>o=>tr.call(null,e,t,o),e.context.handlers.handleMousemove=t=>o=>Qn.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>er.call(null,e),e.context.handlers.handleDragstart=t=>o=>Gn.call(null,e,t,o),e.context.handlers.handleMouseup=t=>qn.call(null,e,t),e.context.handlers.handleTouchstart=t=>o=>Zn.call(null,e,t,o),e.context.handlers.handleTouchmove=t=>zn.call(null,e,t),e.context.handlers.handleKeydown=t=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(e,t,o))}))},/* #__PURE__ */$("rating","star")]},Cr=/* #__PURE__ */Fe("ac"),{outer:Dr,wrapper:Tr,inner:Er,icon:Or,label:Mr,prefix:Vr,suffix:Fr,help:Br,messages:Pr,message:Hr}=/* #__PURE__ */Be(Cr),Rr=Cr("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),Kr=Cr("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),Nr=Cr("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Wr=Cr("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Ur=Cr("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Yr=Cr("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),jr=Cr("optionLoading","span"),zr=Cr("option",(()=>({$el:"div",if:"$value !== undefined"}))),Zr=/* #__PURE__ */Re(Cr);function qr(e){"option"!==e.props.selectionAppearance||e.props.multiple||!1===e.props.selectionRemovable||"false"===e.props.selectionRemovable||(e.props.selectionRemovable=!0),e.props.multiple||(e.props.clearSearchOnOpen=r(e.props.clearSearchOnOpen)),e.props.selectionRemovable=r(e.props.selectionRemovable),e.props.openOnClick=r(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=r(e.props.allowNewValues)}function Gr(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=wt.bind(null,e),e.props.reloadOnCommit=r(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=r(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&re&&(e.context.handlers.focus=Qr.bind(null,e),e.context.handlers.input=Xr.bind(null,e),e.context.handlers.focus=Qr.bind(null,e),e.context.handlers.click=Jr.bind(null,e),e.context.handlers.toggleListbox=es.bind(null,e),e.context.handlers.toggleListboxKeydown=ts.bind(null,e),e.context.handlers.keydown=yo.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>go(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":uo(e);break;case"ArrowRight":case"ArrowLeft":fo(e,t,o);break;case"Delete":case"Backspace":vo(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>bt(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||yt.delete(e)}))}function Xr(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&wt(e,e.props.searchValue,!0)}function Jr(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function Qr(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function es(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function ts(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),es(e))}const os=new WeakMap,ns="undefined"!=typeof window,rs=new WeakMap;let ss=!1;function as(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||ls(e)})),e.on("created",(()=>{if(!e.context||!ns)return;e.on("handleSearchInput",(({payload:t})=>{""===t?(e.props.searchValue=null,e.input([])):t&&0===e.props.inputStd.length?e.props.searchValue=t:t&&e.props.inputStd.length>0&&(e.props.searchValue=function(e){var t;const o=is(e);if(e.props.highlightedRange){const[t,n]=ps(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(e)),!e.props.expanded&&t?e.props.expanded=!0:!t&&e.props.expanded&&(e.props.expanded=!1)})),function(e){s(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&rs.set(t,e)}),e.props.__root),ns&&!ss&&(ss=!0,document.addEventListener("selectionchange",(()=>{const e=gt();if(e instanceof HTMLInputElement&&rs.has(e)){const t=rs.get(e);t&&function(e){clearTimeout(os.get(e)),os.set(e,setTimeout((()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=is(e),a=t.findIndex((e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end))),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=ps(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),p=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=p}else e.props.highlightedRange=void 0,ls(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(e);const o=e.context.handlers.keydown;e.context.handlers.keydown=n=>{o(n),function(e,o){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(o.key)&&o.target instanceof HTMLInputElement&&null!==o.target.selectionEnd&&null!==o.target.selectionStart){if(0===o.target.selectionStart&&o.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===o.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=is(e),n=null===(r=t[t.length-1])||void 0===r?void 0:r.end;o.target.selectionStart<n&&(o.target.selectionStart=Math.max(0,"ArrowLeft"===o.key?o.target.selectionStart-2:o.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(o.key))e.props.highlightedRange&&!e.props.searchValue?(Ot(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault());else if(o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)o.preventDefault();else if("Tab"===o.key)return;"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault()}(e,n)};const n=e.context.handlers.focus;e.context.handlers.focus=t=>{n(e,t);const o=new Event("selectionchange");document.dispatchEvent(o)},e.on("blur",(()=>{e.props.selections.length?(e.props.inputText=e.props.selections.map((e=>e.label)).join(", "),e.props.searchValue=null):e.props.selections.length||(e.props.inputText="",e.props.searchValue="")}))})),e.on("prop:expanded",(({payload:t})=>{t||e.props.inputStd.length?t&&(e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],wt(e,e.props.searchValue))):(e.props.searchValue="",e.props.inputText="")})),e.on("prop:selections",(()=>{var t;const o=[...e.props.selections].map((e=>e.label)).join(", ");let n="";if(ns&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),gt()===o&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}e.props.inputText=`${o}${n}`,e.props.reloadOnCommit&&(e.props.searchValue="",wt(e,e.props.searchValue))}));const t=(t,o=!1)=>{var n,r;const s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=is(e),l=t>=0?t:a.length-1;if(void 0===a[l])return!1;const p=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=p&&s.selectionStart<=p+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&o!==t.option&&(o=t.option,Vt(e))}))}function ls(e){var t;if(!ns)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function ps(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function is(e){const t=Et(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e}),[]):[]}function ds(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],wt(e,e.props.searchValue,!0))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&wt(e,e.props.searchValue,!0))}))}(e)}function cs(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand&&(e.props.inputText="",e.props.searchValue=""),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||e.props.searchExpand||(e.props.options=[],wt(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&wt(e,e.props.searchValue,!0)}))}(e)}function us(e){if(e.props.multiple)if(e.props.multiple&&"option"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}ds(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),s(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement&&e.context){const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,root:e.props.__root,disabled:!e.props.draggable,plugins:[x()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};w({parent:n,getValues:t,setValues:o,config: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)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&as(e);else cs(e)}const fs={schema:/* #__PURE__ */Dr(/* #__PURE__ */Tr(/* #__PURE__ */Mr("$label"),/* #__PURE__ */Er(/* #__PURE__ */Or("prefix"),/* #__PURE__ */Vr(),/* #__PURE__ */Rr(),/* #__PURE__ */He("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */Ur(/* #__PURE__ */Nr(/* #__PURE__ */Wr(/* #__PURE__ */zr(/* #__PURE__ */He("$state.loading",/* #__PURE__ */jr("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */He("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Or("loader")),/* #__PURE__ */He("$selectionRemovable && $isSingleOption",/* #__PURE__ */Yr(/* #__PURE__ */Or("close")))))),/* #__PURE__ */He("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Or("loader")),/* #__PURE__ */He('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Yr(/* #__PURE__ */Or("close")),/* #__PURE__ */He('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Kr(/* #__PURE__ */Or("select")))),/* #__PURE__ */He("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Kr(/* #__PURE__ */Or("select"))),/* #__PURE__ */Zr(),/* #__PURE__ */Fr(),/* #__PURE__ */Or("suffix")),/* #__PURE__ */He("$multiple && $selectionAppearance === option",/* #__PURE__ */Ur(/* #__PURE__ */Nr(/* #__PURE__ */Wr(/* #__PURE__ */zr(/* #__PURE__ */He("$state.loading && $isLoadingOption",/* #__PURE__ */jr("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Yr(/* #__PURE__ */Or("close")))))),/* #__PURE__ */Br("$help"),/* #__PURE__ */Pr(/* #__PURE__ */Hr("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
20
20
|
/* #__PURE__ */$("select","select"),
|
|
21
21
|
/* #__PURE__ */$("close","close"),
|
|
22
22
|
/* #__PURE__ */$("selected","check"),
|
|
@@ -26,7 +26,7 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
|
|
|
26
26
|
/* #__PURE__ */g("remove"),
|
|
27
27
|
/* #__PURE__ */g("open"),
|
|
28
28
|
/* #__PURE__ */g("close"),b,
|
|
29
|
-
/* #__PURE__ */ro.bind(null,zr,Zr,ds),Ko]},us=/* #__PURE__ */Me("dp"),{outer:fs,wrapper:vs,inner:hs,icon:ms,label:$s,prefix:gs,suffix:bs,help:ys,messages:xs,message:ws}=/* #__PURE__ */Ve(us),_s=us("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}}))),ks=us("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}}))),Ss=us("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ls=us("nextLabel","span"),As=us("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Is=us("prevLabel","span"),Cs=us("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Ds=us("calendarWeeks",(()=>({$el:"tbody"}))),Ts=us("calendarHeader",(()=>({$el:"thead"}))),Es=us("weekDays",(()=>({$el:"tr"}))),Os=us("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Ms=us("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Vs=us("dayCell",(()=>({$el:"td",for:["day","$week"],attrs:{key:'$: "day" + $fns.format($day, "D")',onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(day)",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","data-disabled":"$fns.isDisabled($day)","aria-selected":"$fns.isSelected($day)","aria-label":'$fns.format($day, "long")'}}))),Fs=us("day","div"),Bs=us("openButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Ps=us("years",(()=>({if:'$panel === "year"',$el:"ul",attrs:{id:'$id + "_years"'}}))),Hs=us("year",(()=>({for:["year","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$fns.isSelected($year)","data-disabled":"$fns.isDisabledYear($year)"}}))),Rs=us("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Ks=us("month",(()=>({$el:"li",for:["month","$months"],attrs:{key:'$: "month" + $fns.format($month, "M")',onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$fns.isSelected($month)","data-disabled":"$fns.isDisabledMonth($month)"}}))),Ns=us("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Ws=us("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Us=us("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Ys=us("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),js=us("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),zs=us("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Zs=us("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),qs=us("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Gs=us("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),Xs=us("time",(()=>({$el:"div",if:'$panel === "time"'}))),Js=us("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),Qs=us("panelClose",(()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}}))),{overlayPlaceholder:ea,overlayLiteral:ta,overlayChar:oa,overlayEnum:na,overlay:ra,overlayParts:sa,overlayInner:aa}=/* #__PURE__ */Fe(us),la=us("panel","div"),pa=/* #__PURE__ */new WeakMap,ia=/* #__PURE__ */new WeakMap,da=new WeakSet,ca=/* #__PURE__ */new WeakMap,ua=/* #__PURE__ */new WeakMap,fa=new WeakSet,va=/* #__PURE__ */new WeakMap,ha=/[\uD800-\uDBFF]/,ma=/* #__PURE__ */new WeakMap,$a=/* #__PURE__ */new WeakMap,ga=/* #__PURE__ */new WeakMap,ba=/* #__PURE__ */new WeakMap,ya=/* #__PURE__ */new WeakMap,xa=new WeakSet,wa=/* #__PURE__ */new WeakMap,_a=/* #__PURE__ */new WeakMap,ka=/* #__PURE__ */new WeakMap,Sa=/* #__PURE__ */new WeakMap;let La=!1;const Aa=()=>{La=!0,setTimeout((()=>{La=!1}),500)},Ia={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},Ca=/* #__PURE__ */new WeakMap,Da="undefined"!=typeof window;let Ta=!1,Ea=!1;function Oa(){Da&&!Ea&&(Ea=!0,document.addEventListener("selectionchange",(()=>{const e=mt();if(!(e instanceof HTMLInputElement))return;if(Sa.has(e))return function(e){const t=Sa.get(e);if(t){const[o,n]=t,[r,s]=$l(e),a=s.indexOf(o);if(-1===a)return void Sa.delete(e);const l=r[a],p=[l[0]+n[0],l[1],"none"];Ya(ja(e),p)||Ja(e,p)}}(e);if("select"!==va.get(e))return;const t=ja(e);if(!Ya(t,Ca.get(e))){if(Ca.set(e,t),da.has(e))return da.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:ja(e)}))}})))}function Ma(e,t){var o;if(Oa(),pa.has(e))return;pa.set(e,[]),t.reverse&&xa.add(e),t.prefix&&wa.set(e,t.prefix),t.suffix&&_a.set(e,t.suffix),Ha(e,t.pattern,t.partOverrides,t.explicitParts);const n=ua.get(e),r=null==n?void 0:n.some((e=>Na(e))),s=null==n?void 0:n.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(r&&s)throw new Error("Cannot use enums and groups in the same mask.");const a=r?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&fa.add(e),va.set(e,a),t.onChange&&ba.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Ta)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=pa.get(e);if(null==r?void 0:r.length){const o=(null!==(n=ia.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;Qa(e,s),e.setSelectionRange(...s.selectionAfter),ia.set(e,o),ba.has(e)&&ba.get(e)(s,e)}}),{once:!0})}(e,o.inputType);o.preventDefault();const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=ja(e),a=e.value;n&&za(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),wl(e);case"ArrowLeft":return t.preventDefault(),wl(e,-1);case"ArrowUp":return void(_l(e,1)&&t.preventDefault());case"ArrowDown":return void(_l(e,-1)&&t.preventDefault());case"Tab":return La?void t.preventDefault():void(wl(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=fa.has(e),n=va.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;il(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(Ka(t)||Na(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0))));const p=null!==(t=null!=r?r:s?l.length:o)&&void 0!==t?t:null;if(null!==p){let t=[p,p,"none"];if("select"===va.get(e)){const[o]=$l(e),n=Sl(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){ma.set(e,qa(e,t));const n=async()=>{if(!Da||mt()!==e)return;"select"===va.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=ja(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Ga(e,t);const[o]=$l(e),n=Sl(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&ma.set(e,qa(e,o[n]))}(e));const t=ma.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),ma.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(ma.get(e))return;Dl(e),t=Ga(e,t);const[o]=$l(e),n=Sl(e,t),r=void 0!==n&&qa(e,o[n]);r&&!Ya(t,r)&&Ja(e,r,!0)}(e,t.detail))),za(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Va(e){var t,o;if(Sa.has(e))return;const n=null!==(t=pa.get(e))&&void 0!==t?t:[],r=n[null!==(o=ia.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=$l(e,r.valueAfter),s=Sl(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];Sa.set(e,[r,l])}}}function Fa(e){Sa.delete(e)}function Ba(e,t){const o="string"==typeof e||!pa.has(e),n="string"==typeof e?Pa(e):e;if(o)t.prefix&&wa.set(n,t.prefix),t.suffix&&_a.set(n,t.suffix),n.value=Za(n,n.value),Ma(n,t);else{const e=Ll(n),o=n.value;n.value="",za(n,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return n.value}function Pa(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Ha(e,t,o,n,r){r=e&&xa.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Ia);if(!e)return t;const o={...e},n=[];for(const r of t)if(!Ua(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Ra(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Ra(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",p="";const i=[];for(;a=el(e);)a===t&&r!==n?(s++,s>1&&(p+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${i.length}}`,i.push(p),p=""):p+=a):s?p+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,i]}(t,"{","}","\\");const l=a.length;t=s.reduce(((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const p=function(e,t,o){return e.reduce(((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=Ha(null,r,void 0,t,o);a=a.map((e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t}));const l={type:"group",parts:a,...s};return e.push(l),e}),[])}(a,s,r).concat(s),i=/\{\$\d+\}/g,d=t.match(i),c=t.split(i).reduce(((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&p[n]&&e.push(p[n])}return e}),[]);return r&&c.reverse(),e&&ua.set(e,c),c}function Ra(e){return!!e&&(Ua(e)||Ka(e)||Na(e))}function Ka(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Wa(e))}function Na(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Wa(e))}function Wa(e){return!!e&&("placeholder"in e&&"token"in e)}function Ua(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function Ya(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function ja(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function za(e,t){var o;xa.has(e)&&Cl(t);let n=!1;switch(ya.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Xa(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===va.get(e)){const[s,a]=$l(e),l=s.findIndex((e=>Ya(e,t.selectionBefore))),p=null!==(o=a[l])&&void 0!==o?o:null;if(Ka(p)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===p.selectDirection,l=ll(s,p),i=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=el(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,p,o);if(l.length>=o)return a||(t.insertPos=e[1]-i),(null!==(n=p.selectFill)&&void 0!==n?n:p.placeholder).repeat(o);const d=(null!==(r=p.selectFill)&&void 0!==r?r:p.placeholder).repeat(o-l.length-(a?0:i));return t.insertPos=a?e[0]+l.length:e[1]-i,"left"===p.selectDirection?`${l}${d}`:`${d}${l}${p.placeholder}`}if(Na(p)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=il(e,t,o);return ca.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:pl(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Xa(t),n=t.selectionBefore,r=xa.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=tl(o,s):s-=tl(o,s,"backward"));const l=va.get(e);let p="";if("select"===l){const[o,n]=$l(e),r=Sl(e,[s,a,"none"]);if(void 0!==r){const l=n[r],i=o[r];Ka(l)?p=l.placeholder.repeat(a-s):Na(l)&&([p,s]=Ya(i,ja(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=tl(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),p=bl(t.values,l);let i=null==p?void 0:p.substring(l.length);p&&!i&&yl(t.values,p)&&(i=p);return[null!=i?i:t.placeholder,i?a:o[0]]}(0,l,i,t))}}const i=`${o.substring(0,s)}${p}${o.substring(a)}`,d=il(e,t,i);return{...t,valueAfter:d.value,selectionAfter:vl(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(xa.has(e)&&n&&Cl(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=qa(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){ba.has(e)&&ka.set(e,(()=>{ka.delete(e),n&&ba.get(e)(n,e)})),ya.set(e,"beforeCallback");let t=null!==(o=pa.get(e))&&void 0!==o?o:[];const r=ia.get(e);r&&(t=t.slice(0,r),ia.delete(e)),t.push(n),pa.set(e,t),Da&&mt()===e&&"function"==typeof document.execCommand&&!Ta?(Ja(e,[0,e.value.length,"forward"],!0),Ta=!0,document.execCommand("insertText",void 0,n.valueAfter),Ta=!1):Qa(e,n),Da&&mt()===e&&Ja(e,n.selectionAfter);const s=ka.get(e);s&&s(),Dl(e)}ya.set(e,"complete")}function Za(e,t){var o,n;const r=null!==(o=wa.get(e))&&void 0!==o?o:"",s=null!==(n=_a.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function qa(e,t){const o=wa.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function Ga(e,t){const o=wa.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Xa(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function Ja(e,t,o=!1){o&&(da.add(e),setTimeout((()=>da.delete(e)),5)),ma.get(e)&&ma.set(e,t),e.setSelectionRange(...t)}function Qa(e,t,o="After"){if(e.value=t[`value${o}`],Da){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function el(e){if(null==e)return"";const t=ha.test(e.charAt(0))&&ha.test(e.charAt(1))?2:1;return e.substring(0,t)}function tl(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:ha.test(e.charAt(t))&&ha.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:el(e.substring(t)).length}function ol(e,t){const o=el(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function nl(e){const t=el(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function rl(e,t){const o=el(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function sl(e,t){for(;t.buffer;){const o=el(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function al(e,t){const o=e.values.concat([e.placeholder]).map((e=>e.toLowerCase())).sort(((e,t)=>e.length>t.length?-1:1));for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(tl(t.buffer,0))}return null}function ll(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function pl(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=ja(e);o=[n[0],t.endPos,"none"];const[r,s]=$l(e,t.value),a=Sl(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],p=s[a],i=t.value.slice(l[0],l[1]);if(Ka(p)&&ll(i,p).length===i.length&&a<r.length-1)return Aa(),r[a+1];if(Na(p)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=bl(o.values,r);if(s)return ml(r,s).length-n.length;return 0}(t,l[0],p);if(t.insertPos+o===l[1])return yl(p.values,i)?[l[1],l[1],"forward"]:(Aa(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return Ya(s,n)||(da.add(e),setTimeout((()=>da.delete(e)),5)),s}return l}function il(e,t,o,n){var r,s;const a=null!==(r=ua.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:fa.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:va.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:$l(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return dl(a,l,void 0,n),l}function dl(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let p=0;const i=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const r=e[p+1];switch(o.type){case"literal":ul(o,t,e.at(-1)===o);break;case"char":fl(o,t,l);break;case"enum":cl(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};dl(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=Ua(r)&&p+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;p++}if(t.chars<i&&(t.complete=!1),o){const r=t.chars-d,s=r===i,p=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||p);if(o.repeat&&c&&s)return o.repeats++,dl(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),Ua(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}i>1&&r<i&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function cl(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=bl(e.values.concat([e.placeholder]),n);if(r){const s=ml(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):al(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=al(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function ul(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?el(t.data):"",s=el(n);if(e===s)n=ol(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=rl(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function fl(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=el(t.data);if(e.pattern.test(n))return ol(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void sl(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=el(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,nl(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return nl(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function vl(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=$l(e),a=Sl(e,r,s),[l,p]=$l(e,t.value),i=void 0!==a&&hl(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(i){const e=l.slice(a).every(((e,o)=>hl(t.value,e,p[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function hl(e,t,o){if(Ua(o))return!1;if(Ka(o)){let n=t[0];for(;n<t[1];){const t=el(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Na(o)||e.substring(t[0],t[1])===o.placeholder}function ml(e,t){let o="";do{const n=el(e).toLowerCase(),r=el(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function $l(e,t){const o=ua.get(e);if(!o)return[[],[]];if($a.has(e))return $a.get(e);const n=null!=t?t:Za(e,e.value),r=[],s=[];let a=null,l=null,p=0,i=!0;for(const e of o)if(Ua(e))a=e,null!==l&&(r.push([l,p,"none"]),l=null),p+=e.value.length;else{if(Ka(a)&&Ka(e)&&e.token===a.token)p++;else if(Ka(e))null===l?(l=p,s.push(e)):(r.push([l,p,"none"]),l=p,s.push(e)),p++;else if(Na(e)){l&&r.push([l,p,"none"]),xl(e)||(i=!1);const t=gl(n,e,p);l=null,r.push([p,p+t,"none"]),s.push(e),p+=t}a=e}null!==l&&r.push([l,p,"none"]);const d=[[...r],[...s]];return i&&!t&&$a.set(e,d),d}function gl(e,t,o){if(xl(t))return t.values[0].length;const n=e.slice(o),r=bl(t.values.concat([t.placeholder]),n);return r?r.length:0}function bl(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const s=el(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),p=l.find((e=>e.toLowerCase()===a));return p&&(o=p),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=bl(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function yl(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function xl(e){if(!ga.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;ga.set(e,e.values.every((e=>e.length===t)))}return ga.get(e)}function wl(e,t=1){const[o]=$l(e),n=Sl(e,Ga(e,ja(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...qa(e,o[n+t])),!0)}function _l(e,t=1){const[o,n]=$l(e),r=Sl(e,ja(e));if(void 0!==r&&r in n){const s=n[r];if(Na(s)){const n=o[r],a=e.value.slice(n[0],n[1]);let l=null,p=s.values.indexOf(a);const i=s.values.length-1;if(-1!==p){const e=p+t;p=e<0?i:e>i?0:e,l=s.values[p]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[i]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout((()=>za(e,t)),0),!0}}}return!1}function kl(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return kl(e.slice(...r),t)}function Sl(e,t,o){const[n]=null!=o?o:$l(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!Ya(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==r)return r;const[s,a]=n.reduce(((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e)),[new Set,{}]),l=kl([...s],t[1]);return l in a?a[l]:void 0}function Ll(e){var t,o;const n=null!==(t=pa.get(e))&&void 0!==t?t:[];return n[null!==(o=ia.get(e))&&void 0!==o?o:n.length-1]}function Al(e,t=!1){const o=Ll(e);return o&&(o.complete||t)?xa.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Il(e){var t;const o=Ll(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Cl(e){const t=e=>[...e].reverse().join(""),o=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function Dl(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}const Tl="undefined"!=typeof window,El=new WeakSet,Ol=new WeakSet,Ml=new WeakSet,Vl=new WeakMap,Fl=new WeakMap,Bl=new WeakSet,Pl=new WeakSet;function Hl(e){return"timeZoneName"!==e.partName}function Rl(e){e.props.calendar=he(e.props.showMonths,(e=>e)).map((t=>function(e,t){const o=[],n=W(t);n.setDate(1);let r=z(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=Z(N(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=B(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}(e,P(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(C(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,he(10,(n=>H(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=W(e.props.renderedDate);return t.setMonth(0),he(12,(e=>P(t,e)))}(e)}function Kl(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function Nl(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:E(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,Hl),o}function Wl(e){return Array.isArray(e.props.sequence)?a(e.props.sequence):["day"]}function Ul(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?I(t,e.props.timezone):"+0000";const s=Y(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(C(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function Yl(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function jl(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Vl.set(e,t),null===(o=e.props.__root)||void 0===o||o.addEventListener("click",(t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_popover`)?Pl.add(e):Pl.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===ya.get(t)&&(n=t.value),Va(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!pa.has(e))return;const r=null!==(o=wa.get(e))&&void 0!==o?o:"",s=null!==(n=_a.get(e))&&void 0!==n?n:"";za(e,{type:"insert",selectionBefore:ja(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Fa(t)),10))}));const[r,s]=Zl(e);Ma(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(zl(e),El.has(e))return El.delete(e);n&&n===o?n="":(Va(t),e.props.inputText=o,setTimeout((()=>Fa(t)),10))}})}function zl(e){var t,o;if(e.props.overlay){const n=Vl.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Al(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=ht(Il(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function Zl(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,n=V(e.props.format,t);return[U(e.props.format,t,!0,Hl),n.reduce(((n,r)=>{if("literal"===r.partName)return n;let s=M(r.token,t,o);if("YYYY"===r.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();s=he(e.props.maxDate.getFullYear()-t+1,(e=>String(t+e)))}const a={type:"enum",token:r.token,values:s,placeholder:"A"===r.token?"A/P":r.token,selectDirection:"left"};return n.push(a),r.token.startsWith("D")&&Fl.set(e,s),n}),[])]}function ql(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Gl(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}const Xl="undefined"!=typeof window,Jl=new WeakMap;function Ql(e,t){var o,n;if(t instanceof HTMLInputElement&&!Jl.get(e)&&Xl){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){Jl.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function ep(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=r(e.props.overlay),e.props.pickerOnly=r(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&s(`${e.props.id}`,Ql.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}const tp={schema:/* #__PURE__ */fs(/* #__PURE__ */vs(/* #__PURE__ */$s("$label"),/* #__PURE__ */hs(/* #__PURE__ */ms("prefix"),/* #__PURE__ */gs(),/* #__PURE__ */ra(/* #__PURE__ */aa(/* #__PURE__ */sa(/* #__PURE__ */ea("$part.value"),/* #__PURE__ */ta("$part.value"),/* #__PURE__ */oa("$part.value"),/* #__PURE__ */na("$part.value")))),/* #__PURE__ */_s(),/* #__PURE__ */ks(/* #__PURE__ */Ns(/* #__PURE__ */As(/* #__PURE__ */Is("$ui.prev.value"),/* #__PURE__ */ms("prev")),/* #__PURE__ */Ws("$decade"),/* #__PURE__ */Us(/* #__PURE__ */zs()),/* #__PURE__ */Ys(/* #__PURE__ */Zs(),/* #__PURE__ */zs()),/* #__PURE__ */js(/* #__PURE__ */Zs(),/* #__PURE__ */qs(),/* #__PURE__ */zs()),/* #__PURE__ */Ss(/* #__PURE__ */Ls("$ui.next.value"),/* #__PURE__ */ms("next")),/* #__PURE__ */Qs(/* #__PURE__ */ms("close"))),/* #__PURE__ */la(/* #__PURE__ */Ps(/* #__PURE__ */Hs("$fns.format($year, $yearFormat)")),/* #__PURE__ */Rs(/* #__PURE__ */Ks("$fns.format($month, $monthFormat)")),/* #__PURE__ */Cs(/* #__PURE__ */Ts(/* #__PURE__ */Es(/* #__PURE__ */Os("$fns.format($day, $weekdayFormat)"))),/* #__PURE__ */Ds(/* #__PURE__ */Ms(/* #__PURE__ */Vs(/* #__PURE__ */Fs("$fns.format($day, $dateFormat)"))))),/* #__PURE__ */Xs(/* #__PURE__ */Js()))),/* #__PURE__ */Gs(/* #__PURE__ */ms("clear")),/* #__PURE__ */Bs(/* #__PURE__ */ms("calendar")),/* #__PURE__ */bs(),/* #__PURE__ */ms("suffix"))),/* #__PURE__ */ys("$help"),/* #__PURE__ */xs(/* #__PURE__ */ws("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[ep,function(e){var t,o,n,a,l,p,d,c,u,f,v,h,m,$,g,b,y,x,w,_,k,S;e.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","showPanelClose"]),e.hook.prop(((t,o)=>("expanded"===t.prop&&e.props.disabled&&(t.value=!1),"weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"maxScan"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=I(e._value,t.value)),o(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(h=e.props).valueFormat)&&void 0!==t||(h.valueFormat="ISO8601"),null!==(o=(m=e.props).weekdayFormat)&&void 0!==o||(m.weekdayFormat="d"),null!==(n=($=e.props).monthFormat)&&void 0!==n||($.monthFormat="MMM"),null!==(a=(g=e.props).monthButtonFormat)&&void 0!==a||(g.monthButtonFormat="MMMM"),null!==(l=(b=e.props).dayButtonFormat)&&void 0!==l||(b.dayButtonFormat="D"),null!==(p=(y=e.props).dateFormat)&&void 0!==p||(y.dateFormat="D"),null!==(d=(x=e.props).yearFormat)&&void 0!==d||(x.yearFormat="YYYY"),null!==(c=(w=e.props).paginatedPanels)&&void 0!==c||(w.paginatedPanels=["day","year"]),null!==(u=(_=e.props).valueLocale)&&void 0!==u||(_.valueLocale=e.props.locale),null!==(f=(k=e.props).format)&&void 0!==f||(k.format="long"),e.props.panels=Wl(e),e.props.pickerOnly=r(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=r(e.props.clearable)),null!==(v=(S=e.props).maxScan)&&void 0!==v||(S.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):ql.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=W(t);else if("string"==typeof t)try{const n=E(t,e.props.valueFormat,e.props.valueLocale);o=W(n)}catch{console.warn(`Date (${t}) does not match format (${U(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?I(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?E(e.props.minDate):e.props.minDate;e.props.minDate=T(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?E(e.props.maxDate):e.props.maxDate;e.props.maxDate=T(t,e.props.offset)}o=o&&T(o,e.props.offset),o&&Ul(e,o,!1);let n=o||new Date;e.props.minDate&&n<e.props.minDate?n=e.props.minDate:e.props.maxDate&&n>e.props.maxDate&&(n=e.props.maxDate),e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&C(o,"HH:mm")||"12:00"}(e),e.props.calendar=[],e.props.inputText="",e.props.showMonths=e.props.showMonths||1,"function"==typeof e.props.format?(e.props.formatDate=e.props.format,e.props.format=null):e.props.formatDate=C,e.on("mounted",(()=>{s(`${e.props.id}`,jl.bind(null,e),e.props.__root)})),e.on("created",(()=>{if(e.context){let t;e.context.fns.format=(t,o)=>C(t,o,e.props.locale||"en",!1,Hl),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!D(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!D(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;const r=T(n instanceof Date?n:E(n,e.props.valueFormat,e.props.valueLocale),e.props.offset);return O(t,r)},e.context.handlers._blur=t=>{var o,n;e.props._isFocused=!1,"function"==typeof(null===(o=e.context)||void 0===o?void 0:o.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur(t))},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers._blurOut=t=>o=>{var n;o.preventDefault(),t&&t!==e.props.panel||e.props.pickerOnly&&o.relatedTarget instanceof Element&&(o.relatedTarget===document.getElementById(`${e.props.id}_inner`)||o.relatedTarget.closest(`#${e.props.id}_inner`))||o.relatedTarget&&o.relatedTarget instanceof Element&&(o.relatedTarget.closest(`#${e.props.id}_popover`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_popover`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=Vl.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!Ol.has(e)&&(Ml.add(e),e.props.expanded=!0,setTimeout((()=>Ml.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;Ul(e,void 0,!0),Nl(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(Bl.has(e))return Bl.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=E({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:Hl});if(function(e){return V(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Sa.get(t.target)&&C(n,e.props.format,e.props.locale,!1,Hl)!==t.target.value){const r=M("dddd",e.props.locale),s=V(e.props.format,e.props.locale),a=null===(o=F(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=C(n,"dddd",e.props.locale);if(a&&r.includes(a)&&l!==a){let t=r.indexOf(a)-r.indexOf(l);t=t<-1?7+t:t,n=B(n,t),El.add(e)}}Ul(e,n)}catch(t){Ul(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=H(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=P(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=H(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=P(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),Nl(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{if(clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra"))if("month"===e.props.panel||"year"===e.props.panel){const t=D(o,(()=>!0),e.props.panel);t&&(e.props.activeDate=t)}else e.props.activeDate=o},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&O(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var o,n;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getFullYear()===(null===(n=e.context)||void 0===n?void 0:n.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const o=R(t).getTime();return o<K(e).getTime()||o>N(e).getTime()||void 0}}}));const L=Kl.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():(e.props.expanded=!1,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),t&&e.props._isDisabled(t)||Ul(e,t)})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void Nl(e,void 0);const o=new Date,n=t?Nl(e,T("string"==typeof t?E(t,e.props.valueFormat,e.props.valueLocale):t,e.props.offset)):o;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:n,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:n,e.props.localTime=C(n,"HH:mm"),function(e){const t=Fl.get(e);if(e._value&&t){const o=j(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",Rl.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(Pl.delete(e),e.props.panels=Wl(e),e.props.panel=e.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=D(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}Rl(e),s(`${e.props.id}_popover`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&setTimeout((()=>{o.focus(),function(e,t){const o=new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach((e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())}))}));o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",(({payload:t})=>{t||(e.off(n),o.disconnect())}))}(e,t)}),0)}),e.props.__root),Tl&&setTimeout((()=>{document.addEventListener("click",L)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){Bl.add(e);const t="string"==typeof e._value?E(e._value,e.props.valueFormat,e.props.valueLocale):e._value;Nl(e,T(t,e.props.offset))}else Nl(e,void 0);Tl&&(Ol.add(e),document.removeEventListener("click",L),setTimeout((()=>Ol.delete(e)),50))}})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const o=e.props.calendar,n=K(e.props.renderedDate),r=N(P(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=P(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=P(e.props.renderedDate))}else if("year"===e.props.panel){const o=e.props.years,n=o[0].getFullYear(),r=o[o.length-1].getFullYear(),s=e.props.activeDate.getFullYear();e.props.renderedDate=s>r?H(e.props.renderedDate,10):s<n?H(e.props.renderedDate,-10):t}e.props.expanded&&Nl(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{t.preventDefault();let o=null,n=0;switch(t.key){case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowDown":n=7;break;case"ArrowUp":n=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||Yl(e,t);break;case"Escape":e.props.expanded=!1}if(n&&(t.preventDefault(),o=B(e.props.activeDate,n)),o&&!e.props._isDisabled(o))e.props.activeDate=o;else if(o&&e.props._isDisabled(o)){const t=n>0?1:-1;he(Number(e.props.maxScan),(e=>t*e)).some((t=>{const n=B(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||Yl(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=H(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||Yl(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=P(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=D(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Vl.get(e)&&zl(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=i({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:Gl(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},Ko,
|
|
29
|
+
/* #__PURE__ */ao.bind(null,qr,Gr,us),Wo]},vs=/* #__PURE__ */Fe("dp"),{outer:hs,wrapper:ms,inner:$s,icon:gs,label:bs,prefix:ys,suffix:xs,help:ws,messages:_s,message:ks}=/* #__PURE__ */Be(vs),Ss=vs("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}}))),Ls=vs("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}}))),Is=vs("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),As=vs("nextLabel","span"),Cs=vs("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Ds=vs("prevLabel","span"),Ts=vs("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Es=vs("calendarWeeks",(()=>({$el:"tbody"}))),Os=vs("calendarHeader",(()=>({$el:"thead"}))),Ms=vs("weekDays",(()=>({$el:"tr"}))),Vs=vs("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day.0, "dddd")'}}))),Fs=vs("week",(()=>({$el:"tr",for:["week","weekIndex","$month.weeks"]}))),Bs=vs("dayCell",(()=>({$el:"td",for:["day","dayIndex","$week"],attrs:{key:"$day.0",onClick:"$handlers.setDate($day.0)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day.0)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(day)",tabindex:'$fns.sameDay($day.0) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day.0)","data-disabled":"$fns.isDisabled($day.0)","aria-selected":"$selectedWeek === $weekIndex && $selectedDay === $dayIndex","aria-label":"$day.2"}}))),Ps=vs("day","div"),Hs=vs("openButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Rs=vs("years",(()=>({if:'$panel === "year"',$el:"ul",attrs:{id:'$id + "_years"'}}))),Ks=vs("year",(()=>({for:["year","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$selectedYear === $year","data-disabled":"$fns.isDisabledYear($year)","data-test":"$year","aria-label":"$fns.format($year, $yearFormat)"}}))),Ns=vs("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Ws=vs("month",(()=>({$el:"li",for:["month","index","$months"],attrs:{key:"$month",onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$selectedMonth === $month","data-disabled":"$fns.isDisabledMonth($month)"}}))),Us=vs("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Ys=vs("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),js=vs("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),zs=vs("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),Zs=vs("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),qs=vs("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Gs=vs("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Xs=vs("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Js=vs("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),Qs=vs("time",(()=>({$el:"div",if:'$panel === "time"'}))),ea=vs("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),ta=vs("panelClose",(()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}}))),{overlayPlaceholder:oa,overlayLiteral:na,overlayChar:ra,overlayEnum:sa,overlay:aa,overlayParts:la,overlayInner:pa}=/* #__PURE__ */Pe(vs),ia=vs("panel","div"),da=/* #__PURE__ */new WeakMap,ca=/* #__PURE__ */new WeakMap,ua=new WeakSet,fa=/* #__PURE__ */new WeakMap,va=/* #__PURE__ */new WeakMap,ha=new WeakSet,ma=/* #__PURE__ */new WeakMap,$a=/[\uD800-\uDBFF]/,ga=/* #__PURE__ */new WeakMap,ba=/* #__PURE__ */new WeakMap,ya=/* #__PURE__ */new WeakMap,xa=/* #__PURE__ */new WeakMap,wa=/* #__PURE__ */new WeakMap,_a=new WeakSet,ka=/* #__PURE__ */new WeakMap,Sa=/* #__PURE__ */new WeakMap,La=/* #__PURE__ */new WeakMap,Ia=/* #__PURE__ */new WeakMap;let Aa=!1;const Ca=()=>{Aa=!0,setTimeout((()=>{Aa=!1}),500)},Da={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},Ta=/* #__PURE__ */new WeakMap,Ea="undefined"!=typeof window;let Oa=!1,Ma=!1;function Va(){Ea&&!Ma&&(Ma=!0,document.addEventListener("selectionchange",(()=>{const e=gt();if(!(e instanceof HTMLInputElement))return;if(Ia.has(e))return function(e){const t=Ia.get(e);if(t){const[o,n]=t,[r,s]=bl(e),a=s.indexOf(o);if(-1===a)return void Ia.delete(e);const l=r[a],p=[l[0]+n[0],l[1],"none"];za(Za(e),p)||el(e,p)}}(e);if("select"!==ma.get(e))return;const t=Za(e);if(!za(t,Ta.get(e))){if(Ta.set(e,t),ua.has(e))return ua.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:Za(e)}))}})))}function Fa(e,t){var o;if(Va(),da.has(e))return;da.set(e,[]),t.reverse&&_a.add(e),t.prefix&&ka.set(e,t.prefix),t.suffix&&Sa.set(e,t.suffix),Ka(e,t.pattern,t.partOverrides,t.explicitParts);const n=va.get(e),r=null==n?void 0:n.some((e=>Ua(e))),s=null==n?void 0:n.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(r&&s)throw new Error("Cannot use enums and groups in the same mask.");const a=r?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&ha.add(e),ma.set(e,a),t.onChange&&xa.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Oa)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=da.get(e);if(null==r?void 0:r.length){const o=(null!==(n=ca.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;tl(e,s),e.setSelectionRange(...s.selectionAfter),ca.set(e,o),xa.has(e)&&xa.get(e)(s,e)}}),{once:!0})}(e,o.inputType);o.preventDefault();const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=Za(e),a=e.value;n&&qa(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),kl(e);case"ArrowLeft":return t.preventDefault(),kl(e,-1);case"ArrowUp":return void(Sl(e,1)&&t.preventDefault());case"ArrowDown":return void(Sl(e,-1)&&t.preventDefault());case"Tab":return Aa?void t.preventDefault():void(kl(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=ha.has(e),n=ma.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;cl(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(Wa(t)||Ua(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0))));const p=null!==(t=null!=r?r:s?l.length:o)&&void 0!==t?t:null;if(null!==p){let t=[p,p,"none"];if("select"===ma.get(e)){const[o]=bl(e),n=Il(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){ga.set(e,Xa(e,t));const n=async()=>{if(!Ea||gt()!==e)return;"select"===ma.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=Za(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Ja(e,t);const[o]=bl(e),n=Il(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&ga.set(e,Xa(e,o[n]))}(e));const t=ga.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),ga.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(ga.get(e))return;El(e),t=Ja(e,t);const[o]=bl(e),n=Il(e,t),r=void 0!==n&&Xa(e,o[n]);r&&!za(t,r)&&el(e,r,!0)}(e,t.detail))),qa(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ba(e){var t,o;if(Ia.has(e))return;const n=null!==(t=da.get(e))&&void 0!==t?t:[],r=n[null!==(o=ca.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=bl(e,r.valueAfter),s=Il(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];Ia.set(e,[r,l])}}}function Pa(e){Ia.delete(e)}function Ha(e,t){const o="string"==typeof e||!da.has(e),n="string"==typeof e?Ra(e):e;if(o)t.prefix&&ka.set(n,t.prefix),t.suffix&&Sa.set(n,t.suffix),n.value=Ga(n,n.value),Fa(n,t);else{const e=Al(n),o=n.value;n.value="",qa(n,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return n.value}function Ra(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Ka(e,t,o,n,r){r=e&&_a.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Da);if(!e)return t;const o={...e},n=[];for(const r of t)if(!ja(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Na(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Na(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",p="";const i=[];for(;a=ol(e);)a===t&&r!==n?(s++,s>1&&(p+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${i.length}}`,i.push(p),p=""):p+=a):s?p+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,i]}(t,"{","}","\\");const l=a.length;t=s.reduce(((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const p=function(e,t,o){return e.reduce(((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=Ka(null,r,void 0,t,o);a=a.map((e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t}));const l={type:"group",parts:a,...s};return e.push(l),e}),[])}(a,s,r).concat(s),i=/\{\$\d+\}/g,d=t.match(i),c=t.split(i).reduce(((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&p[n]&&e.push(p[n])}return e}),[]);return r&&c.reverse(),e&&va.set(e,c),c}function Na(e){return!!e&&(ja(e)||Wa(e)||Ua(e))}function Wa(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Ya(e))}function Ua(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Ya(e))}function Ya(e){return!!e&&("placeholder"in e&&"token"in e)}function ja(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function za(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function Za(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function qa(e,t){var o;_a.has(e)&&Tl(t);let n=!1;switch(wa.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Qa(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===ma.get(e)){const[s,a]=bl(e),l=s.findIndex((e=>za(e,t.selectionBefore))),p=null!==(o=a[l])&&void 0!==o?o:null;if(Wa(p)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===p.selectDirection,l=il(s,p),i=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ol(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,p,o);if(l.length>=o)return a||(t.insertPos=e[1]-i),(null!==(n=p.selectFill)&&void 0!==n?n:p.placeholder).repeat(o);const d=(null!==(r=p.selectFill)&&void 0!==r?r:p.placeholder).repeat(o-l.length-(a?0:i));return t.insertPos=a?e[0]+l.length:e[1]-i,"left"===p.selectDirection?`${l}${d}`:`${d}${l}${p.placeholder}`}if(Ua(p)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=cl(e,t,o);return fa.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:dl(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Qa(t),n=t.selectionBefore,r=_a.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=nl(o,s):s-=nl(o,s,"backward"));const l=ma.get(e);let p="";if("select"===l){const[o,n]=bl(e),r=Il(e,[s,a,"none"]);if(void 0!==r){const l=n[r],i=o[r];Wa(l)?p=l.placeholder.repeat(a-s):Ua(l)&&([p,s]=za(i,Za(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=nl(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),p=xl(t.values,l);let i=null==p?void 0:p.substring(l.length);p&&!i&&wl(t.values,p)&&(i=p);return[null!=i?i:t.placeholder,i?a:o[0]]}(0,l,i,t))}}const i=`${o.substring(0,s)}${p}${o.substring(a)}`,d=cl(e,t,i);return{...t,valueAfter:d.value,selectionAfter:ml(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(_a.has(e)&&n&&Tl(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=Xa(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){xa.has(e)&&La.set(e,(()=>{La.delete(e),n&&xa.get(e)(n,e)})),wa.set(e,"beforeCallback");let t=null!==(o=da.get(e))&&void 0!==o?o:[];const r=ca.get(e);r&&(t=t.slice(0,r),ca.delete(e)),t.push(n),da.set(e,t),Ea&>()===e&&"function"==typeof document.execCommand&&!Oa?(el(e,[0,e.value.length,"forward"],!0),Oa=!0,document.execCommand("insertText",void 0,n.valueAfter),Oa=!1):tl(e,n),Ea&>()===e&&el(e,n.selectionAfter);const s=La.get(e);s&&s(),El(e)}wa.set(e,"complete")}function Ga(e,t){var o,n;const r=null!==(o=ka.get(e))&&void 0!==o?o:"",s=null!==(n=Sa.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function Xa(e,t){const o=ka.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function Ja(e,t){const o=ka.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Qa(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function el(e,t,o=!1){o&&(ua.add(e),setTimeout((()=>ua.delete(e)),5)),ga.get(e)&&ga.set(e,t),e.setSelectionRange(...t)}function tl(e,t,o="After"){if(e.value=t[`value${o}`],Ea){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ol(e){if(null==e)return"";const t=$a.test(e.charAt(0))&&$a.test(e.charAt(1))?2:1;return e.substring(0,t)}function nl(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:$a.test(e.charAt(t))&&$a.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ol(e.substring(t)).length}function rl(e,t){const o=ol(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function sl(e){const t=ol(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function al(e,t){const o=ol(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function ll(e,t){for(;t.buffer;){const o=ol(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function pl(e,t){const o=e.values.concat([e.placeholder]).map((e=>e.toLowerCase())).sort(((e,t)=>e.length>t.length?-1:1));for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(nl(t.buffer,0))}return null}function il(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function dl(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=Za(e);o=[n[0],t.endPos,"none"];const[r,s]=bl(e,t.value),a=Il(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],p=s[a],i=t.value.slice(l[0],l[1]);if(Wa(p)&&il(i,p).length===i.length&&a<r.length-1)return Ca(),r[a+1];if(Ua(p)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=xl(o.values,r);if(s)return gl(r,s).length-n.length;return 0}(t,l[0],p);if(t.insertPos+o===l[1])return wl(p.values,i)?[l[1],l[1],"forward"]:(Ca(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return za(s,n)||(ua.add(e),setTimeout((()=>ua.delete(e)),5)),s}return l}function cl(e,t,o,n){var r,s;const a=null!==(r=va.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:ha.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:ma.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:bl(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return ul(a,l,void 0,n),l}function ul(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let p=0;const i=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const r=e[p+1];switch(o.type){case"literal":vl(o,t,e.at(-1)===o);break;case"char":hl(o,t,l);break;case"enum":fl(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};ul(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=ja(r)&&p+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;p++}if(t.chars<i&&(t.complete=!1),o){const r=t.chars-d,s=r===i,p=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||p);if(o.repeat&&c&&s)return o.repeats++,ul(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),ja(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}i>1&&r<i&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function fl(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=xl(e.values.concat([e.placeholder]),n);if(r){const s=gl(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):pl(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=pl(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function vl(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?ol(t.data):"",s=ol(n);if(e===s)n=rl(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=al(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function hl(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=ol(t.data);if(e.pattern.test(n))return rl(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void ll(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=ol(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,sl(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return sl(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function ml(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=bl(e),a=Il(e,r,s),[l,p]=bl(e,t.value),i=void 0!==a&&$l(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(i){const e=l.slice(a).every(((e,o)=>$l(t.value,e,p[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function $l(e,t,o){if(ja(o))return!1;if(Wa(o)){let n=t[0];for(;n<t[1];){const t=ol(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Ua(o)||e.substring(t[0],t[1])===o.placeholder}function gl(e,t){let o="";do{const n=ol(e).toLowerCase(),r=ol(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function bl(e,t){const o=va.get(e);if(!o)return[[],[]];if(ba.has(e))return ba.get(e);const n=null!=t?t:Ga(e,e.value),r=[],s=[];let a=null,l=null,p=0,i=!0;for(const e of o)if(ja(e))a=e,null!==l&&(r.push([l,p,"none"]),l=null),p+=e.value.length;else{if(Wa(a)&&Wa(e)&&e.token===a.token)p++;else if(Wa(e))null===l?(l=p,s.push(e)):(r.push([l,p,"none"]),l=p,s.push(e)),p++;else if(Ua(e)){l&&r.push([l,p,"none"]),_l(e)||(i=!1);const t=yl(n,e,p);l=null,r.push([p,p+t,"none"]),s.push(e),p+=t}a=e}null!==l&&r.push([l,p,"none"]);const d=[[...r],[...s]];return i&&!t&&ba.set(e,d),d}function yl(e,t,o){if(_l(t))return t.values[0].length;const n=e.slice(o),r=xl(t.values.concat([t.placeholder]),n);return r?r.length:0}function xl(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const s=ol(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),p=l.find((e=>e.toLowerCase()===a));return p&&(o=p),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=xl(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function wl(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function _l(e){if(!ya.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;ya.set(e,e.values.every((e=>e.length===t)))}return ya.get(e)}function kl(e,t=1){const[o]=bl(e),n=Il(e,Ja(e,Za(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...Xa(e,o[n+t])),!0)}function Sl(e,t=1){const[o,n]=bl(e),r=Il(e,Za(e));if(void 0!==r&&r in n){const s=n[r];if(Ua(s)){const n=o[r],a=e.value.slice(n[0],n[1]);let l=null,p=s.values.indexOf(a);const i=s.values.length-1;if(-1!==p){const e=p+t;p=e<0?i:e>i?0:e,l=s.values[p]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[i]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout((()=>qa(e,t)),0),!0}}}return!1}function Ll(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return Ll(e.slice(...r),t)}function Il(e,t,o){const[n]=null!=o?o:bl(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!za(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==r)return r;const[s,a]=n.reduce(((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e)),[new Set,{}]),l=Ll([...s],t[1]);return l in a?a[l]:void 0}function Al(e){var t,o;const n=null!==(t=da.get(e))&&void 0!==t?t:[];return n[null!==(o=ca.get(e))&&void 0!==o?o:n.length-1]}function Cl(e,t=!1){const o=Al(e);return o&&(o.complete||t)?_a.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Dl(e){var t;const o=Al(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Tl(e){const t=e=>[...e].reverse().join(""),o=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function El(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}const Ol="undefined"!=typeof window,Ml=new WeakSet,Vl=new WeakSet,Fl=new WeakSet,Bl=new WeakMap,Pl=new WeakMap,Hl=new WeakSet,Rl=new WeakSet;function Kl(e){e.props.selectedMonth=e.props.selectedYear=e.props.selectedDay=e.props.selectedWeek=void 0}function Nl(e){var t,o,n;e.props.selectedMonth=e.props.months.findIndex((t=>Yl(t,e.props.activeDate))),e.props.selectedYear=e.props.years.findIndex((t=>Ul(t,e.props.activeDate)));for(let r=0;r<(null===(t=e.props.calendar[0])||void 0===t?void 0:t.weeks.length);r++)for(let t=0;t<(null===(o=e.props.calendar[0])||void 0===o?void 0:o.weeks[r].length);t++){const o=null===(n=e.props.calendar[0])||void 0===n?void 0:n.weeks[r][t];if(N(o[0],e.props.activeDate)){e.props.selectedWeek=r,e.props.selectedDay=t;break}}}function Wl(e){return"timeZoneName"!==e.partName}function Ul(e,t){return t instanceof Date&&e.getFullYear()===t.getFullYear()}function Yl(e,t){return t instanceof Date&&e.getMonth()===t.getMonth()}function jl(e){Kl(e),e.props.selectedIndex=e.props.calendar=$e(e.props.showMonths,(e=>e)).map((t=>function(e,t){const o=[],n=W(t);n.setDate(1);let r=q(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=G(R(t),e.props.weekStart);let a=[];do{a.push([r,C(r,e.props.dateFormat),C(r,"long"),C(r,e.props.weekdayFormat)]),7===a.length&&(o.push(a),a=[]),r=V(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}(e,F(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(C(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,$e(10,(n=>B(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=W(e.props.renderedDate);return t.setMonth(0),$e(12,(e=>F(t,e)))}(e),e.value&&Nl(e)}function zl(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function Zl(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:T(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,Wl),o}function ql(e){return Array.isArray(e.props.sequence)?a(e.props.sequence):["day"]}function Gl(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?A(t,e.props.timezone):"+0000";const s=Y(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(C(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function Xl(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function Jl(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Bl.set(e,t),null===(o=e.props.__root)||void 0===o||o.addEventListener("click",(t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_popover`)?Rl.add(e):Rl.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===wa.get(t)&&(n=t.value),Ba(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!da.has(e))return;const r=null!==(o=ka.get(e))&&void 0!==o?o:"",s=null!==(n=Sa.get(e))&&void 0!==n?n:"";qa(e,{type:"insert",selectionBefore:Za(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Pa(t)),10))}));const[r,s]=ep(e);Fa(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(Ql(e),Ml.has(e))return Ml.delete(e);n&&n===o?n="":(Ba(t),e.props.inputText=o,setTimeout((()=>Pa(t)),10))}})}function Ql(e){var t,o;if(e.props.overlay){const n=Bl.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Cl(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=$t(Dl(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function ep(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,n=O(e.props.format,t);return[U(e.props.format,t,!0,Wl),n.reduce(((n,r)=>{if("literal"===r.partName)return n;let s=E(r.token,t,o);if("YYYY"===r.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();s=$e(e.props.maxDate.getFullYear()-t+1,(e=>String(t+e)))}const a={type:"enum",token:r.token,values:s,placeholder:"A"===r.token?"A/P":r.token,selectDirection:"left"};return n.push(a),r.token.startsWith("D")&&Pl.set(e,s),n}),[])]}function tp(e,t){return!t||(!(!e.props.minDate||!z(t,e.props.minDate))||(!(!e.props.maxDate||!Z(t,e.props.maxDate))||void 0))}function op(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}const np="undefined"!=typeof window,rp=new WeakMap;function sp(e,t){var o,n;if(t instanceof HTMLInputElement&&!rp.get(e)&&np){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){rp.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function ap(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=r(e.props.overlay),e.props.pickerOnly=r(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&s(`${e.props.id}`,sp.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}const lp={schema:/* #__PURE__ */hs(/* #__PURE__ */ms(/* #__PURE__ */bs("$label"),/* #__PURE__ */$s(/* #__PURE__ */gs("prefix"),/* #__PURE__ */ys(),/* #__PURE__ */aa(/* #__PURE__ */pa(/* #__PURE__ */la(/* #__PURE__ */oa("$part.value"),/* #__PURE__ */na("$part.value"),/* #__PURE__ */ra("$part.value"),/* #__PURE__ */sa("$part.value")))),/* #__PURE__ */Ss(),/* #__PURE__ */Ls(/* #__PURE__ */Us(/* #__PURE__ */Cs(/* #__PURE__ */Ds("$ui.prev.value"),/* #__PURE__ */gs("prev")),/* #__PURE__ */Ys("$decade"),/* #__PURE__ */js(/* #__PURE__ */qs()),/* #__PURE__ */zs(/* #__PURE__ */Gs(),/* #__PURE__ */qs()),/* #__PURE__ */Zs(/* #__PURE__ */Gs(),/* #__PURE__ */Xs(),/* #__PURE__ */qs()),/* #__PURE__ */Is(/* #__PURE__ */As("$ui.next.value"),/* #__PURE__ */gs("next")),/* #__PURE__ */ta(/* #__PURE__ */gs("close"))),/* #__PURE__ */ia(/* #__PURE__ */Rs(/* #__PURE__ */Ks("$fns.format($year, $yearFormat)")),/* #__PURE__ */Ns(/* #__PURE__ */Ws("$fns.format($month, $monthFormat)")),/* #__PURE__ */Ts(/* #__PURE__ */Os(/* #__PURE__ */Ms(/* #__PURE__ */Vs("$day.3"))),/* #__PURE__ */Es(/* #__PURE__ */Fs(/* #__PURE__ */Bs(/* #__PURE__ */Ps("$day.1"))))),/* #__PURE__ */Qs(/* #__PURE__ */ea()))),/* #__PURE__ */Js(/* #__PURE__ */gs("clear")),/* #__PURE__ */Hs(/* #__PURE__ */gs("calendar")),/* #__PURE__ */xs(),/* #__PURE__ */gs("suffix"))),/* #__PURE__ */ws("$help"),/* #__PURE__ */_s(/* #__PURE__ */ks("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[ap,function(e){var t,o,n,a,l,p,d,c,u,f,v,h,m,$,g,b,y,x,w,_,k,S;e.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","showPanelClose","selectedDay","selectedWeek","selectedMonth","selectedYear"]),e.hook.prop(((t,o)=>("expanded"===t.prop&&e.props.disabled&&(t.value=!1),"weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"maxScan"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=A(e._value,t.value)),o(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(h=e.props).valueFormat)&&void 0!==t||(h.valueFormat="ISO8601"),null!==(o=(m=e.props).weekdayFormat)&&void 0!==o||(m.weekdayFormat="d"),null!==(n=($=e.props).monthFormat)&&void 0!==n||($.monthFormat="MMM"),null!==(a=(g=e.props).monthButtonFormat)&&void 0!==a||(g.monthButtonFormat="MMMM"),null!==(l=(b=e.props).dayButtonFormat)&&void 0!==l||(b.dayButtonFormat="D"),null!==(p=(y=e.props).dateFormat)&&void 0!==p||(y.dateFormat="D"),null!==(d=(x=e.props).yearFormat)&&void 0!==d||(x.yearFormat="YYYY"),null!==(c=(w=e.props).paginatedPanels)&&void 0!==c||(w.paginatedPanels=["day","year"]),null!==(u=(_=e.props).valueLocale)&&void 0!==u||(_.valueLocale=e.props.locale),null!==(f=(k=e.props).format)&&void 0!==f||(k.format="long"),e.props.panels=ql(e),e.props.pickerOnly=r(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=r(e.props.clearable)),null!==(v=(S=e.props).maxScan)&&void 0!==v||(S.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):tp.bind(null,e),e.props.calendar=[],e.props.inputText="",e.props.showMonths=e.props.showMonths||1,"function"==typeof e.props.format?(e.props.formatDate=e.props.format,e.props.format=null):e.props.formatDate=C,jl(e),e.on("mounted",(()=>{s(`${e.props.id}`,Jl.bind(null,e),e.props.__root)})),e.on("created",(()=>{if(function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=W(t);else if("string"==typeof t)try{const n=T(t,e.props.valueFormat,e.props.valueLocale);o=W(n)}catch{console.warn(`Date (${t}) does not match format (${U(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?A(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?T(e.props.minDate):e.props.minDate;e.props.minDate=K(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?T(e.props.maxDate):e.props.maxDate;e.props.maxDate=K(t,e.props.offset)}o=o&&K(o,e.props.offset),o&&Gl(e,o,!1);let n=o||new Date;e.props.minDate&&n<e.props.minDate?n=e.props.minDate:e.props.maxDate&&n>e.props.maxDate&&(n=e.props.maxDate),e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&C(o,"HH:mm")||"12:00"}(e),e.context){let t;e.context.fns.format=(t,o)=>C(t,o,e.props.locale||"en",!1,Wl),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!D(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!D(t,(t=>!e.props._isDisabled(t)),"year"),e.context.handlers._blur=t=>{var o,n;e.props._isFocused=!1,"function"==typeof(null===(o=e.context)||void 0===o?void 0:o.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur(t))},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers._blurOut=t=>o=>{var n;o.preventDefault(),t&&t!==e.props.panel||e.props.pickerOnly&&o.relatedTarget instanceof Element&&(o.relatedTarget===document.getElementById(`${e.props.id}_inner`)||o.relatedTarget.closest(`#${e.props.id}_inner`))||o.relatedTarget&&o.relatedTarget instanceof Element&&(o.relatedTarget.closest(`#${e.props.id}_popover`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_popover`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=Bl.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!Vl.has(e)&&(Fl.add(e),e.props.expanded=!0,setTimeout((()=>Fl.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;Gl(e,void 0,!0),Zl(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(Hl.has(e))return Hl.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=T({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:Wl});if(function(e){return O(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Ia.get(t.target)&&C(n,e.props.format,e.props.locale,!1,Wl)!==t.target.value){const r=E("dddd",e.props.locale),s=O(e.props.format,e.props.locale),a=null===(o=M(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=C(n,"dddd",e.props.locale);if(a&&r.includes(a)&&l!==a){let t=r.indexOf(a)-r.indexOf(l);t=t<-1?7+t:t,n=V(n,t),Ml.add(e)}}Gl(e,n)}catch(t){Gl(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=B(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=F(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=B(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=F(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),Zl(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{if(clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra"))if("month"===e.props.panel||"year"===e.props.panel){const t=D(o,(()=>!0),e.props.panel);t&&(e.props.activeDate=t)}else e.props.activeDate=o},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>function(e,t){return t instanceof Date&&N(e,t)}(t,e.props.activeDate),e.context.fns.sameMonth=t=>Yl(t,e.props.activeDate),e.context.fns.sameYear=t=>Ul(t,e.props.activeDate),e.context.fns.notInMonth=(e,t)=>{const o=P(t).getTime();return o<H(e).getTime()||o>R(e).getTime()||void 0}}}));const L=zl.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():(e.props.expanded=!1,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),t&&e.props._isDisabled(t)||Gl(e,t)})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void Zl(e,void 0);const o=new Date,n=t?Zl(e,K("string"==typeof t?T(t,e.props.valueFormat,e.props.valueLocale):t,e.props.offset)):o;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:n,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:n,e.props.localTime=C(n,"HH:mm"),function(e){const t=Pl.get(e);if(e._value&&t){const o=j(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",jl.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(Rl.delete(e),e.props.panels=ql(e),e.props.panel=e.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=D(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}jl(e),s(`${e.props.id}_popover`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&setTimeout((()=>{o.focus(),function(e,t){const o=new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach((e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())}))}));o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",(({payload:t})=>{t||(e.off(n),o.disconnect())}))}(e,t)}),0)}),e.props.__root),Ol&&setTimeout((()=>{document.addEventListener("click",L)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){Hl.add(e);const t="string"==typeof e._value?T(e._value,e.props.valueFormat,e.props.valueLocale):e._value;Zl(e,K(t,e.props.offset))}else Zl(e,void 0);Ol&&(Vl.add(e),document.removeEventListener("click",L),setTimeout((()=>Vl.delete(e)),50))}})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const o=e.props.calendar,n=H(e.props.renderedDate),r=R(F(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=F(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=F(e.props.renderedDate))}else if("year"===e.props.panel){const o=e.props.years,n=o[0].getFullYear(),r=o[o.length-1].getFullYear(),s=e.props.activeDate.getFullYear();e.props.renderedDate=s>r?B(e.props.renderedDate,10):s<n?B(e.props.renderedDate,-10):t}e.props.expanded&&Zl(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{t.preventDefault();let o=null,n=0;switch(t.key){case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowDown":n=7;break;case"ArrowUp":n=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||Xl(e,t);break;case"Escape":e.props.expanded=!1}if(n&&(t.preventDefault(),o=V(e.props.activeDate,n)),o&&!e.props._isDisabled(o))e.props.activeDate=o;else if(o&&e.props._isDisabled(o)){const t=n>0?1:-1;$e(Number(e.props.maxScan),(e=>t*e)).some((t=>{const n=V(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||Xl(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=B(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||Xl(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=F(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=D(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Bl.get(e)&&Ql(e)})),e.on("commit",(({payload:t})=>{if(t?Nl(e):Kl(e),e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=i({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:op(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},Wo,
|
|
30
30
|
/* #__PURE__ */g("next"),
|
|
31
31
|
/* #__PURE__ */g("prev"),
|
|
32
32
|
/* #__PURE__ */g("changeDate"),
|
|
@@ -35,8 +35,8 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
|
|
|
35
35
|
/* #__PURE__ */$("next","right"),
|
|
36
36
|
/* #__PURE__ */$("clear","close"),
|
|
37
37
|
/* #__PURE__ */$("prev","left"),
|
|
38
|
-
/* #__PURE__ */$("calendar","date")]},
|
|
39
|
-
/* #__PURE__ */
|
|
38
|
+
/* #__PURE__ */$("calendar","date")]},pp=/* #__PURE__ */Fe("tl"),{outer:ip,wrapper:dp,inner:cp,icon:up,label:fp,prefix:vp,suffix:hp,help:mp,messages:$p,message:gp}=/* #__PURE__ */Be(pp),bp=pp("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText",name:"$node.name",tabindex:"0",placeholder:"$state.loading && $inputStd.length === 0 && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || $disabledInternally || undefined","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),yp=pp("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-label":"$expanded && $ui.close.value || $ui.open.value",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),xp=pp("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)",onKeydown:"$handlers.searchInputTagKeydown && $handlers.searchInputTagKeydown($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),wp=pp("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),_p=pp("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1","aria-label":"$ui.remove.value",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)",onTouchstart:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),kp=pp("tagLabel",(()=>({$el:"span"}))),Sp=pp("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),Lp=pp("tagLoading","span"),Ip=/* #__PURE__ */Re(pp);function Ap(e){e.props.multiple=!0,e.props.openOnClick=r(e.props.openOnClick),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=r(e.props.allowNewValues)}function Cp(e){ds(e),Po(e),e.on("created",(()=>{function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}e.props.disabled&&(e.props.draggable=!1),s(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement){if(!e.context)return;const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[x()],root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(t){e.props.activeSelectionValue=void 0,_(t)},handleDragstart(t){e.props.activeSelectionValue=void 0,k(t)},handleTouchstart(t){e.props.activeSelectionValue=void 0,S(t)}};w({parent:n,getValues:t,setValues:o,config: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)}))}const Dp={schema:/* #__PURE__ */ip(/* #__PURE__ */dp(/* #__PURE__ */fp("$label"),/* #__PURE__ */cp(/* #__PURE__ */up("prefix"),/* #__PURE__ */vp(),/* #__PURE__ */Sp(/* #__PURE__ */xp(/* #__PURE__ */wp(/* #__PURE__ */He("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",/* #__PURE__ */Lp("$ui.isLoading.value"),/* #__PURE__ */kp("$option.label")),/* #__PURE__ */_p(/* #__PURE__ */up("close")))),/* #__PURE__ */bp()),/* #__PURE__ */He("$state.loading",/* #__PURE__ */up("loader")),/* #__PURE__ */yp(/* #__PURE__ */up("select")),/* #__PURE__ */Ip(),/* #__PURE__ */hp(),/* #__PURE__ */up("suffix"))),/* #__PURE__ */mp("$help"),/* #__PURE__ */$p(/* #__PURE__ */gp("$message.value"))),type:"input",family:"dropdown",props:[],features:[b,
|
|
39
|
+
/* #__PURE__ */ao.bind(null,Ap,Gr,Cp),
|
|
40
40
|
/* #__PURE__ */$("select","select"),
|
|
41
41
|
/* #__PURE__ */$("close","close"),
|
|
42
42
|
/* #__PURE__ */$("selected","check"),
|
|
@@ -45,7 +45,7 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
|
|
|
45
45
|
/* #__PURE__ */g("loadMore"),
|
|
46
46
|
/* #__PURE__ */g("remove"),
|
|
47
47
|
/* #__PURE__ */g("open"),
|
|
48
|
-
/* #__PURE__ */g("close"),Ko]},Sp=/* #__PURE__ */Me("mk"),{outer:Lp,wrapper:Ap,inner:Ip,label:Cp,prefix:Dp,suffix:Tp,help:Ep,messages:Op,message:Mp,icon:Vp}=/* #__PURE__ */Ve(Sp),{overlayPlaceholder:Fp,overlayLiteral:Bp,overlayChar:Pp,overlayEnum:Hp,overlay:Rp,overlayParts:Kp,overlayInner:Np}=/* #__PURE__ */Fe(Sp),Wp=Sp("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),Up=new WeakMap,Yp=new WeakMap,jp=new WeakMap;function zp(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Yp.set(e,t),Ma(t,{...Up.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=ht(o)}})}const Zp={schema:/* #__PURE__ */Lp(/* #__PURE__ */Ap(/* #__PURE__ */Cp("$label"),/* #__PURE__ */Ip(/* #__PURE__ */Vp("prefix"),/* #__PURE__ */Dp(),/* #__PURE__ */Rp(/* #__PURE__ */Np(/* #__PURE__ */Kp(/* #__PURE__ */Fp("$part.value"),/* #__PURE__ */Bp("$part.value"),/* #__PURE__ */Pp("$part.value"),/* #__PURE__ */Hp("$part.value")))),/* #__PURE__ */Wp(),/* #__PURE__ */Tp(),/* #__PURE__ */Vp("suffix"))),/* #__PURE__ */Ep("$help"),/* #__PURE__ */Op(/* #__PURE__ */Mp("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[ep,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,a,l;const p=Pa("string"==typeof e._value?e._value:"");Yp.set(e,p),jp.set(e,p),e.props.allowIncomplete=r(e.props.allowIncomplete),e.props.overlay=r(e.props.overlay);const i=!(void 0!==e.props.showMask&&!r(e.props.showMask));e.props.unmaskValue=r(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=r(e)),t(e))));const d={placeholder:i,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(o=e.props.mode)&&void 0!==o?o:"shift",partOverrides:null!==(n=e.props.tokens)&&void 0!==n?n:{},prefix:null!==(a=e.props.prefix)&&void 0!==a?a:void 0,suffix:null!==(l=e.props.suffix)&&void 0!==l?l:void 0,reverse:r(e.props.reverse)};Up.set(e,d),e.hook.input(((t,o)=>{const n=function(e,t){const o=Yp.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=jp.get(e);r.value=Za(r,t);const s=Ba(r,Up.get(e)),a=Al(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=ht(Il(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(e,t);return o(n)})),e.props._maskValue=Ba(p,d),e.input(e.props._maskValue,!1),e.context&&(e.context.handlers.DOMInput=t=>{e.emit("dom-input-event",t)}),s(`${e.props.id}`,zp.bind(null,e),e.props.__root)}))}]},qp=/* #__PURE__ */Me("tf"),{outer:Gp,wrapper:Xp,inner:Jp,icon:Qp,prefix:ei,suffix:ti,help:oi,messages:ni,message:ri}=/* #__PURE__ */Ve(qp),si=qp("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),ai=qp("legend",(()=>({if:"$label",$el:"legend"}))),li=qp("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),pi=qp("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),ii=qp("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),di=qp("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),ci=qp("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),ui=qp("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"}))),fi=qp("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),vi=qp("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),hi=qp("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}}))),mi=qp("targetSearch",(()=>({if:"$targetSearchable",$el:"div",attrs:{id:'$id + "_target_search"',class:'$classes.transferlistSearch + " " + $classes.targetSearch'}}))),$i=qp("targetSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_target_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onTargetSearch",value:"$targetInputText",onKeydown:"$handlers.targetSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.targetSearchInput',onFocus:"$handlers.targetSearchFocus",onBlur:"$handlers.targetSearchBlur"}}))),gi=qp("targetControls",(()=>({$el:"div",if:"$targetSearchable",attrs:{id:'$id + "_target_controls"',class:'$classes.transferlistControls + " " + $classes.targetControls'}}))),bi=qp("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear Source Search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),yi=qp("targetSearchClear",(()=>({$el:"button",if:'$targetInputText !== ""',attrs:{id:'$id + "_target_search_clear"',type:"button",onClick:"$handlers.clearTargetSearch","aria-label":"Clear Target Search",class:'$classes.transferlistSearchClear + " " + $classes.targetSearchClear'}}))),xi=qp("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(true)",onMouseout:"$handlers.onMouseleave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems',onKeydown:"$handlers.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred","aria-label":"Source list"}}))),wi=qp("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstart:"$handlers.listitemTouchstart($option, true)",onTouchmove:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),_i=qp("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),ki=qp("sourceLoadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),Si=qp("loadMoreInner","span"),Li=qp("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),Ai=qp("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Ii=qp("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",role:"listbox",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred","aria-label":"Target list"}}))),Ci=qp("targetListItem",(()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstart:"$handlers.listitemTouchstart($option, false)",onTouchmove:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),Di=qp("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Ti=qp("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Ei=qp("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),Oi=qp("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),Mi=qp("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),Vi=qp("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),Fi=qp("controlLabel","span"),Bi=qp("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Pi=qp("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Hi=qp("emptyMessageInner","span"),Ri=Symbol(),Ki=new WeakSet,Ni=new WeakSet;function Wi(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter((e=>e!==t)),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter((e=>e!==t)));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function Ui(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map((e=>$t(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Yi(e,t){if(e.props.sourceListOrigin=!1,t){const o=Array.isArray(e.value)?e.value.filter((e=>e!==t)):[];return void e.input(o)}const o=e.props.selectedTargetItems.map((e=>$t(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function ji(e){var t,o;if(e.props.activeValue===Ri){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function zi(e){var t;if(Array.isArray(e.value)){const t=[];let o=[...e.props.options];e.value.forEach((r=>{const s=e.props.memoOptions.find((e=>n($t(e),r)));if(s&&!s.noOptionFound){t.push(s);const a=e.props.options.findIndex((e=>n($t(e),r)));-1!==a&&(o=o.filter((e=>!n($t(e),r))))}else{const e=o.find((e=>n($t(e),r)));e?(t.push(e),o=o.filter((e=>!n($t(e),r)))):t.push({label:String(r),value:r,noOptionFound:!0})}})),e.props.targetOptions=e.props.targetInputText?t.filter((t=>e.props.filter(t,e.props.targetInputText,e))):t,e.props.sourceOptions=o}else e.props.sourceOptions=[...e.props.options],e.props.targetOptions=[];if(e.props.skipSetActiveValue)return void(e.props.skipSetActiveValue=!1);(null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_source_list_items"))&&Zi(e)}function Zi(e){var t,o,n,r,s,a,l,p,i;if(e.props.isDragging)return;if(e.props.targetSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_target_search_input`){const t=e.props.targetOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=$t(t)):void(e.props.activeValue=void 0)}return}if(e.props.sourceSearchActive){if((null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)||void 0===r?void 0:r.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=$t(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const d=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let c=!1;for(let t=e.props.activeIndex;t<=d.length;t++)if(!(null===(s=d.attrs)||void 0===s?void 0:s.disabled)&&d[t]){c=!0,e.props.activeValue=$t(d[t]);break}if(!c&&d.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(a=d.attrs)||void 0===a?void 0:a.disabled)&&d[t])return c=!0,void(e.props.activeValue=$t(d[t]));if(!c){let t;t=e.props.sourceListOrigin?null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`):e.props.searchable?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}_source_search_input`):null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}function qi(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}function Gi(e){Array.isArray(e.value)&&e.value.forEach((async t=>{Lt(e,t,function(e,t){const o=[...e.props.options,...e.props.memoOptions];return o.find((e=>n($t(e),t)))}(e,t))}))}function Xi(e){e.context&&(e.context.handlers.loadMore=xt.bind(null,e),e.context.fns.getSourceItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.sourceOptions.length:e.props.sourceOptions.length,e.context.fns.getTargetItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.targetOptions.length:e.props.targetOptions.length,e.context.fns.isActive=(t,o)=>{if(!e.props.isDragging&&!e.props.touchStarted)return n(o,$t(t))||void 0},e.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),e.context.fns.optionLoading=t=>e.props.optionLoaderValues.includes($t(t)),e.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",yt(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(e)},e.context.handlers.clearTargetSearch=()=>{!function(e){var t;e.props.targetSearchActive=!1,e.props.targetInputText="";const o=[...new Set([...e.props.options,...e.props.memoOptions])],n=[];for(const t of e.value){const e=o.find((e=>$t(e)===t));e&&n.push(e)}e.props.targetOptions=n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_target_search_input`);if(!r)return;r.focus()}(e)},e.context.handlers.sourceSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.targetSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_target_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.listitemClick=(t,o)=>n=>{Ji(e,t,o)},e.context.handlers.transferForward=Ui.bind(null,e,void 0),e.context.handlers.transferForwardAll=()=>{let t;if(e.props.maxReached)return;const o=e.props.sourceOptions.map((e=>$t(e)));t=Array.isArray(e.value)?[...e.value,...o]:[...o],e.input(t),e.props.selectedSourceItems=[]},e.context.handlers.transferBackward=Yi.bind(null,e,void 0),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.input([]),e.props.selectedTargetItems=[])},e.context.handlers.onSearch=t=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,yt(e,o.value,!0)}(e,t)},e.context.handlers.onTargetSearch=t=>{!function(e,t){e.props.targetSearchActive=!0;const o=t.target;e.props.targetInputText=o.value;const n=[...new Set([...e.props.memoOptions,...e.props.options])],r=[];for(const t of e.value){const e=n.find((e=>$t(e)===t));e&&r.push(e)}const s=[...new Map([...e.props.targetOptions,...r].map((e=>[JSON.stringify(e),e]))).values()];e.props.targetOptions=s.filter((t=>e.props.filter(t,o.value,e))),0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1;Zi(e)}(e,t)},e.context.handlers.onMouseenter=t=>o=>{"touchstart"!==o.type&&(t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0)},e.context.handlers.onMouseleave=t=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(t?`${e.props.id}_source_list_items`:`${e.props.id}`);r&&(r.contains(o.relatedTarget)||(e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeIndex=void 0,t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1))},e.context.handlers.listitemClick=(t,o)=>n=>{n instanceof MouseEvent&&e.props.touchStarted||Ji(e,t,o)},e.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(e)},e.context.handlers.listitemTouchend=(t,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const r=$t(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>$t(e)===r)),e.props.transferOnSelect?o?Ui(e,r):Yi(e,r):Wi(e,t,o)}(e,t,o)},e.context.handlers.listitemTouchmove=()=>t=>{!function(e){e.props.touchMoved=!0}(e)},e.context.handlers.sourceSearchFocus=t=>{Qi(e,!0)},e.context.handlers.targetSearchFocus=t=>{Qi(e,!1)},e.context.handlers.sourceListFocused=t=>{Qi(e,!0)},e.context.handlers.targetListFocused=()=>{Qi(e,!1)},e.context.handlers.sourceListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.targetListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.sourceListKeydown=t=>{ed(e,t,!0)},e.context.handlers.targetListKeydown=t=>{ed(e,t,!1)},e.context.handlers.sourceSearchKeydown=t=>{ed(e,t,!0)},e.context.handlers.targetSearchKeydown=t=>{ed(e,t,!1)})}function Ji(e,t,o,n){var r;if($t(t)===Ri)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=$t(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>$t(e)===s)),e.props.transferOnSelect?o?Ui(e,s):Yi(e,s):Wi(e,t,o)}function Qi(e,t){const o=qi(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=$t(o))}function ed(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push($t(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(Ri);const p=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==p)for(let e=p-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[p-1];break}else if("ArrowDown"===e.key&&p!==l.length-1)for(let e=p+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}ji(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(qi(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===Ri)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex((e=>$t(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?Ui(t,$t(a)):Yi(t,$t(a)):Wi(t,a,o)}(t,e,o)}function td(e){e.on("created",(()=>{if("function"==typeof e.props.optionsLoader&&(e.props.skipSetActiveValue=!0,At(e)),Xi(e),e.props.disabled&&(e.props.draggable=!1),oe){s(e.props.id+"_source_list_items",(t=>{t instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.sourceOptions.map((e=>$t(e)))}function n(){return[]}const r={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],L(t)},draggable:e=>"option"===e.getAttribute("role")};r.plugins=[A({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,k(t)},handleEnd(t){_(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,S(t)},selections:()=>e.props.selectedSourceItems.map((e=>$t(e)))})],w({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,w({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,w({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:maxReached",(({payload:e})=>{r.disabled=e,w({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root),s(`${e.props.id}`,(t=>{t instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.targetOptions.map((e=>$t(e)))}function n(t,o){e.props.sourceListOrigin=!0,e.input(t)}const r={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};r.plugins=[A({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,k(t)},handleEnd(t){_(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,S(t)},selections:()=>e.props.selectedTargetItems.map((e=>$t(e)))})],w({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,w({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,w({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root);const t=t=>{var o;if(e.props.isDragging)return;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",t)}}))}function od(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Ki.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Ni.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&Ki.add(e),e.props.mouseOnTarget&&Ni.add(e),a.length&&nd(e,a,null,t)}function nd(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x: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 e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?$t(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}}else ji(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&Ki.has(e)||e.props.mouseOnTarget&&Ni.has(e)?requestAnimationFrame(nd.bind(null,e,t,o,n)):od(e,n):(Ki.delete(e),Ni.delete(e))}const rd={schema:/* #__PURE__ */Gp(/* #__PURE__ */si(/* #__PURE__ */ai("$label"),/* #__PURE__ */oi("$help"),/* #__PURE__ */Xp(/* #__PURE__ */li(/* #__PURE__ */pi(/* #__PURE__ */ii(),/* #__PURE__ */di(/* #__PURE__ */Be("$optionsLoadingCounter > 0",/* #__PURE__ */Qp("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),/* #__PURE__ */fi(/* #__PURE__ */vi(/* #__PURE__ */hi(),/* #__PURE__ */bi(/* #__PURE__ */Qp("close")))),/* #__PURE__ */xi(/* #__PURE__ */Bi(/* #__PURE__ */Hi("$sourceEmptyMessage")),/* #__PURE__ */wi(/* #__PURE__ */Be("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",/* #__PURE__ */Qp("selected")),/* #__PURE__ */_i("$option.label")),/* #__PURE__ */ki(/* #__PURE__ */Be("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */Si(/* #__PURE__ */Be("$state.loading",/* #__PURE__ */Qp("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),/* #__PURE__ */Ti(/* #__PURE__ */Oi(/* #__PURE__ */Fi("$ui.addAllValues.value"),/* #__PURE__ */Qp("fastForward")),/* #__PURE__ */Ei(/* #__PURE__ */Fi("$ui.addSelectedValues.value"),/* #__PURE__ */Qp("moveRight")),/* #__PURE__ */Mi(/* #__PURE__ */Fi("$ui.removeSelectedValues.value"),/* #__PURE__ */Qp("moveLeft")),/* #__PURE__ */Vi(/* #__PURE__ */Fi("$ui.removeAllValues.value"),/* #__PURE__ */Qp("rewind"))),/* #__PURE__ */Li(/* #__PURE__ */Ai(/* #__PURE__ */ci(),/* #__PURE__ */ui("$fns.getTargetItemCount($selectedTargetItems)")),/* #__PURE__ */gi(/* #__PURE__ */mi(/* #__PURE__ */$i(),/* #__PURE__ */yi(/* #__PURE__ */Qp("close")))),/* #__PURE__ */Ii(/* #__PURE__ */Pi(/* #__PURE__ */Be("$state.loading !== true",/* #__PURE__ */Hi("$targetEmptyMessage"))),/* #__PURE__ */Ci(/* #__PURE__ */Be("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",/* #__PURE__ */Qp("selected")),/* #__PURE__ */Di(/* #__PURE__ */Be("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),/* #__PURE__ */ni(/* #__PURE__ */ri("$message.value")))),type:"input",props:[],features:[
|
|
48
|
+
/* #__PURE__ */g("close"),Wo]},Tp=/* #__PURE__ */Fe("mk"),{outer:Ep,wrapper:Op,inner:Mp,label:Vp,prefix:Fp,suffix:Bp,help:Pp,messages:Hp,message:Rp,icon:Kp}=/* #__PURE__ */Be(Tp),{overlayPlaceholder:Np,overlayLiteral:Wp,overlayChar:Up,overlayEnum:Yp,overlay:jp,overlayParts:zp,overlayInner:Zp}=/* #__PURE__ */Pe(Tp),qp=Tp("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),Gp=new WeakMap,Xp=new WeakMap,Jp=new WeakMap;function Qp(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Xp.set(e,t),Fa(t,{...Gp.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=$t(o)}})}const ei={schema:/* #__PURE__ */Ep(/* #__PURE__ */Op(/* #__PURE__ */Vp("$label"),/* #__PURE__ */Mp(/* #__PURE__ */Kp("prefix"),/* #__PURE__ */Fp(),/* #__PURE__ */jp(/* #__PURE__ */Zp(/* #__PURE__ */zp(/* #__PURE__ */Np("$part.value"),/* #__PURE__ */Wp("$part.value"),/* #__PURE__ */Up("$part.value"),/* #__PURE__ */Yp("$part.value")))),/* #__PURE__ */qp(),/* #__PURE__ */Bp(),/* #__PURE__ */Kp("suffix"))),/* #__PURE__ */Pp("$help"),/* #__PURE__ */Hp(/* #__PURE__ */Rp("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[ap,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,a,l;const p=Ra("string"==typeof e._value?e._value:"");Xp.set(e,p),Jp.set(e,p),e.props.allowIncomplete=r(e.props.allowIncomplete),e.props.overlay=r(e.props.overlay);const i=!(void 0!==e.props.showMask&&!r(e.props.showMask));e.props.unmaskValue=r(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=r(e)),t(e))));const d={placeholder:i,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(o=e.props.mode)&&void 0!==o?o:"shift",partOverrides:null!==(n=e.props.tokens)&&void 0!==n?n:{},prefix:null!==(a=e.props.prefix)&&void 0!==a?a:void 0,suffix:null!==(l=e.props.suffix)&&void 0!==l?l:void 0,reverse:r(e.props.reverse)};Gp.set(e,d),e.hook.input(((t,o)=>{const n=function(e,t){const o=Xp.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=Jp.get(e);r.value=Ga(r,t);const s=Ha(r,Gp.get(e)),a=Cl(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=$t(Dl(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(e,t);return o(n)})),e.props._maskValue=Ha(p,d),e.input(e.props._maskValue,!1),e.context&&(e.context.handlers.DOMInput=t=>{e.emit("dom-input-event",t)}),s(`${e.props.id}`,Qp.bind(null,e),e.props.__root)}))}]},ti=/* #__PURE__ */Fe("tf"),{outer:oi,wrapper:ni,inner:ri,icon:si,prefix:ai,suffix:li,help:pi,messages:ii,message:di}=/* #__PURE__ */Be(ti),ci=ti("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),ui=ti("legend",(()=>({if:"$label",$el:"legend"}))),fi=ti("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),vi=ti("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),hi=ti("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),mi=ti("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),$i=ti("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),gi=ti("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"}))),bi=ti("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),yi=ti("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),xi=ti("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}}))),wi=ti("targetSearch",(()=>({if:"$targetSearchable",$el:"div",attrs:{id:'$id + "_target_search"',class:'$classes.transferlistSearch + " " + $classes.targetSearch'}}))),_i=ti("targetSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_target_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onTargetSearch",value:"$targetInputText",onKeydown:"$handlers.targetSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.targetSearchInput',onFocus:"$handlers.targetSearchFocus",onBlur:"$handlers.targetSearchBlur"}}))),ki=ti("targetControls",(()=>({$el:"div",if:"$targetSearchable",attrs:{id:'$id + "_target_controls"',class:'$classes.transferlistControls + " " + $classes.targetControls'}}))),Si=ti("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear Source Search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),Li=ti("targetSearchClear",(()=>({$el:"button",if:'$targetInputText !== ""',attrs:{id:'$id + "_target_search_clear"',type:"button",onClick:"$handlers.clearTargetSearch","aria-label":"Clear Target Search",class:'$classes.transferlistSearchClear + " " + $classes.targetSearchClear'}}))),Ii=ti("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(true)",onMouseout:"$handlers.onMouseleave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems',onKeydown:"$handlers.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred","aria-label":"Source list"}}))),Ai=ti("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstart:"$handlers.listitemTouchstart($option, true)",onTouchmove:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),Ci=ti("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),Di=ti("sourceLoadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),Ti=ti("loadMoreInner","span"),Ei=ti("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),Oi=ti("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Mi=ti("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",role:"listbox",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred","aria-label":"Target list"}}))),Vi=ti("targetListItem",(()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstart:"$handlers.listitemTouchstart($option, false)",onTouchmove:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),Fi=ti("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Bi=ti("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Pi=ti("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),Hi=ti("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),Ri=ti("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),Ki=ti("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),Ni=ti("controlLabel","span"),Wi=ti("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Ui=ti("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Yi=ti("emptyMessageInner","span"),ji=Symbol(),zi=new WeakSet,Zi=new WeakSet;function qi(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter((e=>e!==t)),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter((e=>e!==t)));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function Gi(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map((e=>bt(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Xi(e,t){if(e.props.sourceListOrigin=!1,t){const o=Array.isArray(e.value)?e.value.filter((e=>e!==t)):[];return void e.input(o)}const o=e.props.selectedTargetItems.map((e=>bt(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function Ji(e){var t,o;if(e.props.activeValue===ji){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function Qi(e){var t;if(Array.isArray(e.value)){const t=[];let o=[...e.props.options];e.value.forEach((r=>{const s=e.props.memoOptions.find((e=>n(bt(e),r)));if(s&&!s.noOptionFound){t.push(s);const a=e.props.options.findIndex((e=>n(bt(e),r)));-1!==a&&(o=o.filter((e=>!n(bt(e),r))))}else{const e=o.find((e=>n(bt(e),r)));e?(t.push(e),o=o.filter((e=>!n(bt(e),r)))):t.push({label:String(r),value:r,noOptionFound:!0})}})),e.props.targetOptions=e.props.targetInputText?t.filter((t=>e.props.filter(t,e.props.targetInputText,e))):t,e.props.sourceOptions=o}else e.props.sourceOptions=[...e.props.options],e.props.targetOptions=[];if(e.props.skipSetActiveValue)return void(e.props.skipSetActiveValue=!1);(null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_source_list_items"))&&ed(e)}function ed(e){var t,o,n,r,s,a,l,p,i;if(e.props.isDragging)return;if(e.props.targetSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_target_search_input`){const t=e.props.targetOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=bt(t)):void(e.props.activeValue=void 0)}return}if(e.props.sourceSearchActive){if((null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)||void 0===r?void 0:r.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=bt(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const d=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let c=!1;for(let t=e.props.activeIndex;t<=d.length;t++)if(!(null===(s=d.attrs)||void 0===s?void 0:s.disabled)&&d[t]){c=!0,e.props.activeValue=bt(d[t]);break}if(!c&&d.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(a=d.attrs)||void 0===a?void 0:a.disabled)&&d[t])return c=!0,void(e.props.activeValue=bt(d[t]));if(!c){let t;t=e.props.sourceListOrigin?null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`):e.props.searchable?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}_source_search_input`):null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}function td(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}function od(e){Array.isArray(e.value)&&e.value.forEach((async t=>{At(e,t,function(e,t){const o=[...e.props.options,...e.props.memoOptions];return o.find((e=>n(bt(e),t)))}(e,t))}))}function nd(e){e.context&&(e.context.handlers.loadMore=_t.bind(null,e),e.context.fns.getSourceItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.sourceOptions.length:e.props.sourceOptions.length,e.context.fns.getTargetItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.targetOptions.length:e.props.targetOptions.length,e.context.fns.isActive=(t,o)=>{if(!e.props.isDragging&&!e.props.touchStarted)return n(o,bt(t))||void 0},e.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),e.context.fns.optionLoading=t=>e.props.optionLoaderValues.includes(bt(t)),e.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",wt(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(e)},e.context.handlers.clearTargetSearch=()=>{!function(e){var t;e.props.targetSearchActive=!1,e.props.targetInputText="";const o=[...new Set([...e.props.options,...e.props.memoOptions])],n=[];for(const t of e.value){const e=o.find((e=>bt(e)===t));e&&n.push(e)}e.props.targetOptions=n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_target_search_input`);if(!r)return;r.focus()}(e)},e.context.handlers.sourceSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.targetSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_target_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.listitemClick=(t,o)=>n=>{rd(e,t,o)},e.context.handlers.transferForward=Gi.bind(null,e,void 0),e.context.handlers.transferForwardAll=()=>{let t;if(e.props.maxReached)return;const o=e.props.sourceOptions.map((e=>bt(e)));t=Array.isArray(e.value)?[...e.value,...o]:[...o],e.input(t),e.props.selectedSourceItems=[]},e.context.handlers.transferBackward=Xi.bind(null,e,void 0),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.input([]),e.props.selectedTargetItems=[])},e.context.handlers.onSearch=t=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,wt(e,o.value,!0)}(e,t)},e.context.handlers.onTargetSearch=t=>{!function(e,t){e.props.targetSearchActive=!0;const o=t.target;e.props.targetInputText=o.value;const n=[...new Set([...e.props.memoOptions,...e.props.options])],r=[];for(const t of e.value){const e=n.find((e=>bt(e)===t));e&&r.push(e)}const s=[...new Map([...e.props.targetOptions,...r].map((e=>[JSON.stringify(e),e]))).values()];e.props.targetOptions=s.filter((t=>e.props.filter(t,o.value,e))),0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1;ed(e)}(e,t)},e.context.handlers.onMouseenter=t=>o=>{"touchstart"!==o.type&&(t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0)},e.context.handlers.onMouseleave=t=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(t?`${e.props.id}_source_list_items`:`${e.props.id}`);r&&(r.contains(o.relatedTarget)||(e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeIndex=void 0,t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1))},e.context.handlers.listitemClick=(t,o)=>n=>{n instanceof MouseEvent&&e.props.touchStarted||rd(e,t,o)},e.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(e)},e.context.handlers.listitemTouchend=(t,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const r=bt(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>bt(e)===r)),e.props.transferOnSelect?o?Gi(e,r):Xi(e,r):qi(e,t,o)}(e,t,o)},e.context.handlers.listitemTouchmove=()=>t=>{!function(e){e.props.touchMoved=!0}(e)},e.context.handlers.sourceSearchFocus=t=>{sd(e,!0)},e.context.handlers.targetSearchFocus=t=>{sd(e,!1)},e.context.handlers.sourceListFocused=t=>{sd(e,!0)},e.context.handlers.targetListFocused=()=>{sd(e,!1)},e.context.handlers.sourceListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.targetListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.sourceListKeydown=t=>{ad(e,t,!0)},e.context.handlers.targetListKeydown=t=>{ad(e,t,!1)},e.context.handlers.sourceSearchKeydown=t=>{ad(e,t,!0)},e.context.handlers.targetSearchKeydown=t=>{ad(e,t,!1)})}function rd(e,t,o,n){var r;if(bt(t)===ji)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=bt(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>bt(e)===s)),e.props.transferOnSelect?o?Gi(e,s):Xi(e,s):qi(e,t,o)}function sd(e,t){const o=td(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=bt(o))}function ad(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(bt(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(ji);const p=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==p)for(let e=p-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[p-1];break}else if("ArrowDown"===e.key&&p!==l.length-1)for(let e=p+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}Ji(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(td(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===ji)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex((e=>bt(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?Gi(t,bt(a)):Xi(t,bt(a)):qi(t,a,o)}(t,e,o)}function ld(e){e.on("created",(()=>{if("function"==typeof e.props.optionsLoader&&(e.props.skipSetActiveValue=!0,Ct(e)),nd(e),e.props.disabled&&(e.props.draggable=!1),re){s(e.props.id+"_source_list_items",(t=>{t instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.sourceOptions.map((e=>bt(e)))}function n(){return[]}const r={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],L(t)},draggable:e=>"option"===e.getAttribute("role")};r.plugins=[I({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,k(t)},handleEnd(t){_(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,S(t)},selections:()=>e.props.selectedSourceItems.map((e=>bt(e)))})],w({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,w({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,w({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:maxReached",(({payload:e})=>{r.disabled=e,w({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root),s(`${e.props.id}`,(t=>{t instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.targetOptions.map((e=>bt(e)))}function n(t,o){e.props.sourceListOrigin=!0,e.input(t)}const r={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};r.plugins=[I({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,k(t)},handleEnd(t){_(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,S(t)},selections:()=>e.props.selectedTargetItems.map((e=>bt(e)))})],w({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,w({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,w({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root);const t=t=>{var o;if(e.props.isDragging)return;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",t)}}))}function pd(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=zi.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Zi.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&zi.add(e),e.props.mouseOnTarget&&Zi.add(e),a.length&&id(e,a,null,t)}function id(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x: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 e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?bt(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}}else Ji(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&zi.has(e)||e.props.mouseOnTarget&&Zi.has(e)?requestAnimationFrame(id.bind(null,e,t,o,n)):pd(e,n):(zi.delete(e),Zi.delete(e))}const dd={schema:/* #__PURE__ */oi(/* #__PURE__ */ci(/* #__PURE__ */ui("$label"),/* #__PURE__ */pi("$help"),/* #__PURE__ */ni(/* #__PURE__ */fi(/* #__PURE__ */vi(/* #__PURE__ */hi(),/* #__PURE__ */mi(/* #__PURE__ */He("$optionsLoadingCounter > 0",/* #__PURE__ */si("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),/* #__PURE__ */bi(/* #__PURE__ */yi(/* #__PURE__ */xi(),/* #__PURE__ */Si(/* #__PURE__ */si("close")))),/* #__PURE__ */Ii(/* #__PURE__ */Wi(/* #__PURE__ */Yi("$sourceEmptyMessage")),/* #__PURE__ */Ai(/* #__PURE__ */He("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",/* #__PURE__ */si("selected")),/* #__PURE__ */Ci("$option.label")),/* #__PURE__ */Di(/* #__PURE__ */He("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */Ti(/* #__PURE__ */He("$state.loading",/* #__PURE__ */si("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),/* #__PURE__ */Bi(/* #__PURE__ */Hi(/* #__PURE__ */Ni("$ui.addAllValues.value"),/* #__PURE__ */si("fastForward")),/* #__PURE__ */Pi(/* #__PURE__ */Ni("$ui.addSelectedValues.value"),/* #__PURE__ */si("moveRight")),/* #__PURE__ */Ri(/* #__PURE__ */Ni("$ui.removeSelectedValues.value"),/* #__PURE__ */si("moveLeft")),/* #__PURE__ */Ki(/* #__PURE__ */Ni("$ui.removeAllValues.value"),/* #__PURE__ */si("rewind"))),/* #__PURE__ */Ei(/* #__PURE__ */Oi(/* #__PURE__ */$i(),/* #__PURE__ */gi("$fns.getTargetItemCount($selectedTargetItems)")),/* #__PURE__ */ki(/* #__PURE__ */wi(/* #__PURE__ */_i(),/* #__PURE__ */Li(/* #__PURE__ */si("close")))),/* #__PURE__ */Mi(/* #__PURE__ */Ui(/* #__PURE__ */He("$state.loading !== true",/* #__PURE__ */Yi("$targetEmptyMessage"))),/* #__PURE__ */Vi(/* #__PURE__ */He("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",/* #__PURE__ */si("selected")),/* #__PURE__ */Fi(/* #__PURE__ */He("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),/* #__PURE__ */ii(/* #__PURE__ */di("$message.value")))),type:"input",props:[],features:[
|
|
49
49
|
/* #__PURE__ */$("moveRight","right"),
|
|
50
50
|
/* #__PURE__ */$("moveLeft","left"),
|
|
51
51
|
/* #__PURE__ */$("fastForward","fastForward"),
|
|
@@ -58,8 +58,8 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
|
|
|
58
58
|
/* #__PURE__ */g("addAllValues"),
|
|
59
59
|
/* #__PURE__ */g("addSelectedValues"),
|
|
60
60
|
/* #__PURE__ */g("removeSelectedValues"),
|
|
61
|
-
/* #__PURE__ */g("removeAllValues"),b,function(e){!function(e){e.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption","targetSearchable","targetInputText"]),e.props.loadMoreOption={label:"Load more",value:Ri},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=It.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.searchable=r(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.targetSearchable=r(e.props.targetSearchable),e.props.targetSearchable&&(e.props.targetInputText=""),e.props.clearOnSelect=r(e.props.clearOnSelect),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>$t(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(yt(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),zi(e)),"function"==typeof e.props.optionLoader?Gi(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),td(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),zi(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,zi(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,Ki.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===Ri)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>n($t(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,e.props.sourceListOrigin=!0,Ki.delete(e),od(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,Ni.delete(e),od(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&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.props.skipSetActiveValue=!0,zi(e))}))}(e)}]};const sd=/* #__PURE__ */Me("sl"),{outer:ad,wrapper:ld,inner:pd,icon:id,prefix:dd,suffix:cd,help:ud,messages:fd,message:vd}=/* #__PURE__ */Ve(sd),hd=sd("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),md=sd("chart",(()=>({$el:"div",if:"$chart"}))),$d=sd("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),gd=sd("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),bd=sd("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),yd=sd("trackWrapper",(()=>({$el:"div"}))),xd=sd("trackInner",(()=>({$el:"div"}))),wd=sd("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),_d=sd("linkedValues",(()=>({$el:"div"}))),kd=sd("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),Sd=sd("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Ld=sd("marks",(()=>({$el:"div",if:"$marks"}))),Ad=sd("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),Id=sd("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Cd=sd("handles",(()=>({$el:"ul"}))),Dd=sd("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Td=sd("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Ed=sd("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Od=sd("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Md=sd("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),Vd=sd("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Fd={schema:/* #__PURE__ */ad(/* #__PURE__ */ld(/* #__PURE__ */hd("$label"),/* #__PURE__ */ud("$help"),/* #__PURE__ */gd(/* #__PURE__ */id("prefix"),/* #__PURE__ */dd(),/* #__PURE__ */bd(/* #__PURE__ */md(/* #__PURE__ */$d()),/* #__PURE__ */yd(/* #__PURE__ */xd(/* #__PURE__ */wd(),/* #__PURE__ */Ld(/* #__PURE__ */Ad(/* #__PURE__ */Id())),/* #__PURE__ */Cd(/* #__PURE__ */Td(/* #__PURE__ */Vd(),/* #__PURE__ */Ed()),/* #__PURE__ */Dd(/* #__PURE__ */Md(),/* #__PURE__ */Od()))))),/* #__PURE__ */cd(),/* #__PURE__ */id("suffix"),/* #__PURE__ */Be("$showInput && $isMulti === false",/* #__PURE__ */kd())),/* #__PURE__ */Be("$showInput && $isMulti",/* #__PURE__ */_d(/* #__PURE__ */Sd(),/* #__PURE__ */kd())),/* #__PURE__ */fd(/* #__PURE__ */vd("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){let t,o,a;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const l={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};let p=!1;function i(){const e=document.activeElement;if(e instanceof HTMLInputElement){const t=e.value;e.value="",e.value=t}}function d(e){if(!e)return;const t={disabled:e.props.disabled,min:"number"==typeof e.props.min?e.props.min:0,max:"number"==typeof e.props.max?e.props.max:void 0,step:e.props.step||1};e.props.minInputAttrs=Object.assign(e.props.minInputAttrs||{},t),e.props.maxInputAttrs=Object.assign(e.props.maxInputAttrs||{},t),e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(e.props.inputAttrs,t):t,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs}function c(t){const{min:o,max:n,intervals:r}=e.props;if(t=Math.min(Math.max(t,0),100),!r||0===r.length){x();const r=o+t/100*(n-o);return e.props.scalingFunction.reverse(r,o,n)}const s=f(r,o,n);for(let e=0;e<s.length;e++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[e];if(t>=r&&t<=r+a){const e=o+(t-r)/a*l*n,s=e%n;return g(s<n/2?e-s:e+(n-s))}}return t>100?n:t<0?o:void 0}function u(t,o=e.props.min,n=e.props.max){const r=e.props.intervals;if(!r||0===r.length){x();return(e.props.scalingFunction.forward(t,o,n)-o)/(n-o)*100}const s=f(r,o,n);for(let e=0;e<s.length;e++){const{value:o,step:r,left:a,width:l,stepsInInterval:p}=s[e],i=e<s.length-1?s[e+1].value:n;if(t>=o&&t<=i){return 100*((a+(t-o)/r/p*l)/100)}}return 100}function f(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,p=s/r*100;return s+=l,{value:e.value,step:e.step,left:p,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function v(){const t=parseFloat(`${e.props.min}`),o=parseFloat(`${e.props.max}`);let n,r=0;if(Array.isArray(e._value)){const t=[...e._value].sort(h);r=parseFloat(`${t[0]}`),n=parseFloat(`${t[1]}`)}else n=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${u(n,t,o)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${u(r,t,o)}%`},e.props.fillStyles={left:`${u(r,t,o)}%`,width:u(n,t,o)-u(r,t,o)+"%"}):e.props.fillStyles={left:"0%",width:`${u(n,t,o)}%`}}function h(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function m(o,n=!0){if(e.props.disabled)return;let r;if(void 0===o){if(e.props.isMulti)e.input([b(e.props.min),b(e.props.max)]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(b(t))}return void v()}if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(o)){const n="min"===e.props.lastHandleInteraction?0:1;e._value[n]=o;const[s,a]=[...e._value];if(s>=a){const o=null==t?void 0:t.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==o||o.focus()}r=b([...e._value].sort(h))}else Array.isArray(o)?r=b(o):(r=b(o),r=isNaN(r)?e.props.min:r);e.props.snapToMarks&&(r=y(r));const s=b($(r));n&&e.input(s),v()}function $(t){return e.props.isMulti&&Array.isArray(t)?[$(t[0]),$(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function g(t){return parseFloat(t.toFixed(e.props.decimals))}function b(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>g(Math.round(t/e.props.step)*e.props.step))):g(Math.round(t/e.props.step)*e.props.step);const o=f(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return g(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return g(n.value+Math.round((t-n.value)/n.step)*n.step)}}function y(t){if(Array.isArray(t))return t[0]=y(t[0]),t[1]=y(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}function x(){if(p)return;r(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=l[e.props.scalingFunction]||l.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...l.linear,...e.props.scalingFunction}):e.props.scalingFunction=l.linear,p=!0}e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.on("created",(()=>{var l;x(),e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(l=e.props.step.toString().split(".")[1])||void 0===l?void 0:l.length)||0,e.props.min=e.props.min?parseFloat(`${e.props.min}`):0,e.props.max=e.props.max?parseFloat(`${e.props.max}`):100;const p=r(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":p;const g=r(e.props.marks);if(e.props.marks=!!g&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=r(e.props.markLabels),e.props.snapToMarks=r(e.props.snapToMarks),e.props.showInput=r(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar,d(e),s(`track-${e.props.id}`,(()=>{var o;t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`track-${e.props.id}`),m(e.value,!1),v()}),e.props.__root),e.context){let r=0,s="";const l=e.context.handlers.blur;e.context.handlers.blur=t=>{l(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!t)return;e.props.dragging=!1;const{left:n,width:r}=t.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[t,o]=e.value,n=Math.abs(t-s*e.props.max)<Math.abs(o-s*e.props.max)?"min":"max",r="min"===n?0:1;e.props.lastHandleInteraction=n,e.value[r]=c(100*s),m(e._value)}else m(c(100*s))},e.context.handlers.focus=o=>{if(!t)return;const n=o.target.dataset.handle;n&&(e.props.lastHandleInteraction=n)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1,m(e._value)},e.context.handlers.startDrag=o=>{if(!t)return;e.props.dragging=!0;const n="touchstart"===o.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";e.props.lastHandleInteraction=o.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(r,_,{passive:!1}),document.addEventListener(s,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(r,_),n&&o.target instanceof HTMLElement&&o.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),s+=t.key;const e="-"===s?-1:1;r=window.setTimeout((()=>{"-"!==s?(m(parseFloat(s)*e),s=""):s=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,n=Array.isArray(e._value)?e._value[o]:e._value,r=function(t,o){if(!e.props.intervals)return e.props.step;const n=f(e.props.intervals);if(t>=e.props.max)return n[n.length-1].step;let r=n.find(((o,r)=>{var s;return t>=o.value&&t<((null===(s=n[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!r)return e.props.step;if(-1===o){t-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=y(n),r=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,l=Math.min(Math.max(0,s+a),e.props.marks.length-1);return void m(e.props.marks[l].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?m(e.props.min):m(e.props.max));if("Home"===t.key)return void m(e.props.min);if("End"===t.key)return void m(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){m(n+(t.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?m(n+10*r):"PageDown"===t.key&&m(n-10*r)}},e.context.handlers.maxNode=t=>{a=t,t.hook.commit(((o,r)=>{if(n(t.value,o))return r(o);if(`${t.value}`.includes(".")&&!`${o}`.includes(".")&&i(),e.props.isMulti&&Array.isArray(e.value)){m([e.value[0],o])}else m(o);return r($(o))}))},e.context.handlers.minNode=t=>{o=t,t.hook.commit(((o,r)=>{if(n(t.value,o))return r(o);if(`${t.value}`.includes(".")&&!`${o}`.includes(".")&&i(),e.props.isMulti&&Array.isArray(e.value)){m([o,e.value[1]])}else m(o);return r($(o))}))},e.context.handlers.inputBlur=()=>{if(e.props.isMulti&&Array.isArray(e._value)){m([...e._value].sort(h))}},e.context.fns.calculateMarkPosition=t=>u(t,e.props.min,e.props.max)}let w;function _(o){var n;if(!t||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:a}=t.getBoundingClientRect(),l=b(c((r-s)/a*100));w!==l&&(w=l,m(l))}m(e.value)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||m(t,!1):e.value!==t&&m(t,!1),function(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,n]=[...e._value];o&&o.input(g(t)),a&&a.input(g(n))}else a&&a.input(e._value)}()})),e.on("prop:max",(()=>{e.props.max=e.props.max?parseFloat(`${e.props.max}`):100,m(e.value),d(e)})),e.on("prop:min",(()=>{e.props.min=e.props.min?parseFloat(`${e.props.min}`):0,m(e.value),d(e)}))}]},Bd=/* #__PURE__ */Me("cp"),{outer:Pd,wrapper:Hd,inner:Rd,label:Kd,prefix:Nd,suffix:Wd,help:Ud,messages:Yd,message:jd,icon:zd}=/* #__PURE__ */Ve(Bd),Zd=Bd("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),qd=Bd("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),Gd=Bd("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),Xd=Bd("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),Jd=Bd("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),Qd=Bd("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),ec=Bd("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),tc=Bd("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),oc=Bd("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),nc=Bd("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),rc=Bd("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),sc=Bd("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha",style:{opacity:{if:"$alpha",then:"1",else:"0.5"},cursor:{if:"$alpha",then:"",else:"not-allowed"},filter:{if:"$alpha",then:"",else:"grayscale(1)"}}}}))),ac=Bd("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true",style:{pointerEvents:{if:"$alpha",then:"auto",else:"none"}}}}))),lc=Bd("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled || $alpha === undefined",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"',pointerEvents:{if:"$alpha",then:"auto",else:"none"}},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),pc=Bd("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),ic=Bd("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),dc=Bd("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),cc=Bd("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),uc=Bd("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),fc=Bd("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),vc=Bd("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),hc=Bd("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),mc=Bd("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),$c=Bd("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),gc=Bd("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled || $alpha === undefined",autocomplete:"off",style:{opacity:{if:"$alpha",then:"1",else:"0.33"},cursor:{if:"$alpha",then:void 0,else:"not-allowed"}},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"}},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel",style:{opacity:{if:"$alpha",then:"1",else:"0.33"}}}}]}))),bc=Bd("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),yc=Bd("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),xc=Bd("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),wc=Bd("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),_c=Bd("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),kc=Bd("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),Sc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Lc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function Ac(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Ic(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),p=Math.min(r,s,a);let i,d=0;const c=(l+p)/2;if(l===p)d=i=0;else{const e=l-p;switch(i=c>.5?e/(2-l-p):e/(l+p),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*i,255*c,n]}(t,o,n,r)}(e);return[...Dc(t,o,n,r)]}function Cc(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,Ac(255*t,2),Ac(255*a,2),n]}function Dc(e,t,o,n=1){const r=Ac(t/255,4),s=Ac(o/255,4);if(1===s)return[e,0,100,n];const a=Ac(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,Ac(l,2),Ac(100*a,2),n]}function Tc(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let p=0,i=0,d=0;return[p,i,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],p=Math.round(255*(p+l)),i=Math.round(255*(i+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(p,0),255),Math.min(Math.max(i,0),255),Math.min(Math.max(d,0),255),n]}function Ec(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),p=Math.min(r,s,a);let i=0;const d=l,c=l-p,u=0===l?0:c/l;if(l!==p){switch(l){case r:i=(s-a)/c+(s<a?6:0);break;case s:i=(a-r)/c+2;break;case a:i=(r-s)/c+4}i/=6}return[360*i,100*u,100*d,n]}function Oc(e,t,o,n=1){const[r,s,a,l]=Tc(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Mc(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Vc(e){if(e){if(Mc(e))return Ic(e);if(e.startsWith("rgb")){const t=e.match(Sc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Ec(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(Lc);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Dc(o,Ac(255*n,2),Ac(255*r,2),s)}}}function Fc(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Bc(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Pc(e){return!1!==e&&"false"!==e}function Hc(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const Rc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const Kc={schema:/* #__PURE__ */Pd(/* #__PURE__ */Hd(/* #__PURE__ */Kd("$label"),/* #__PURE__ */Be("$inline && $help",/* #__PURE__ */Ud("$help")),/* #__PURE__ */Rd(/* #__PURE__ */Be("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */zd("prefix","label")),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Nd()),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Zd(/* #__PURE__ */dc(),/* #__PURE__ */Be("$showValue",/* #__PURE__ */qd()))),/* #__PURE__ */Be("$inline || $expanded)",/* #__PURE__ */Gd(/* #__PURE__ */Be("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */Xd(/* #__PURE__ */zd("close"))),/* #__PURE__ */Be("$panelControls",/* #__PURE__ */Jd(/* #__PURE__ */Qd(/* #__PURE__ */ec(),/* #__PURE__ */tc()),/* #__PURE__ */pc(/* #__PURE__ */ic()),/* #__PURE__ */oc(/* #__PURE__ */nc(),/* #__PURE__ */rc()),/* #__PURE__ */sc(/* #__PURE__ */ac(),/* #__PURE__ */lc()),/* #__PURE__ */Be("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */cc(/* #__PURE__ */zd("eyeDropper"))))),/* #__PURE__ */Be("$panelFormat",/* #__PURE__ */uc(/* #__PURE__ */fc(/* #__PURE__ */Be('$panelActiveFormat === "hex"',/* #__PURE__ */vc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */hc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */mc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */$c()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */bc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */yc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */xc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */gc())),/* #__PURE__ */wc(/* #__PURE__ */zd("switch")))),/* #__PURE__ */Be("$options",/* #__PURE__ */_c(/* #__PURE__ */kc())))),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Wd()),/* #__PURE__ */Be("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */zd("suffix"))),/* #__PURE__ */Be("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */Ud("$help"))),/* #__PURE__ */Yd(/* #__PURE__ */jd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","alpha","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){let t,o=null,n=null,a=null,l=null,p=null,i=null,d=null,c=0;const u=["hex","rgba","hsla"],f=Bc((function(){if(!n)return;const t=n.getContext("2d");if(!t)return;const{width:o,height:r}=n,s=e.props.h||0;t.fillStyle=`hsl(${s}, 100%, 50%)`,t.fillRect(0,0,o,r);const a=t.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=a,t.fillRect(0,0,o,r);const l=t.createLinearGradient(0,0,0,r);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=l,t.fillRect(0,0,o,r)}),2),v=Bc((function(){if(!l)return;const t=l.getContext("2d");if(!t)return;const o=Math.round(l.width),n=Math.round(l.height);t.clearRect(0,0,o,n),F(l,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,p=t.createLinearGradient(0,0,o,0);p.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),p.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=p,t.fillRect(0,0,o,n)}),2),h=Bc(C,2),m=Bc(D,2),$=Bc(H,2),g=Bc(B,10,!1);function b(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(o&&o.contains(s)){const o=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Mc(o)&&!Sc.test(o)&&!Lc.test(o))return;(Mc(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),y(o))}}function y(t){var o;if(!t)return;const n=Vc(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Ac(o,2)===e.props.h&&Ac(r,2)===e.props.s&&Ac(s,2)===e.props.v&&Ac(a,2)===e.props.a)||(e.props.alpha&&(e.props.a=Ac(a,2)),H(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=Vc(n.value);if(t){const[o,n,r,s]=t;e.props.alpha&&(e.props.a=Ac(s,2)),H(o,n,r)}else H(e.props.h,e.props.s,e.props.v)}else H(e.props.h,e.props.s,e.props.v)}}function x(t){if(!e.context||!d)return;const o=d[t];o&&(e.props.focusedSwatch=o.dataset.color)}function w(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function _(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),s(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=Ic(t.sRGBHex);e.props.alpha&&(e.props.a=1),H(n,r,s)}))}),e.props.__root))}function k(){S("canvas-ls",(e=>{n=e}),f,O),S("canvas-hue",(e=>{a=e}),I,M),S("canvas-alpha",(e=>{l=e}),v,V),L(`canvas-preview-${e.props.id}`,(e=>{p=e,C()}),h),L(`canvas-swatch-preview-${e.props.id}`,(e=>{i=e,D()}),m),A()}function S(o,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",i),document.removeEventListener("touchend",c)},p=e=>{1===e.buttons&&t&&s(e)},i=e=>{t&&s(e)},d=()=>{t=void 0,l()},c=()=>{t=void 0,l()};L(`${o}-${e.props.id}`,(e=>{const l=e.nextElementSibling;n(e),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,s),a||function(e,t){a=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(l,e),e.addEventListener("mousedown",(e=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),t=Rc[o],s(e),document.addEventListener("mousemove",p),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),t=Rc[o],document.addEventListener("touchmove",i),document.addEventListener("touchend",c)}))}),r)}function L(t,o,n){s(t,(()=>{var r;const s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(t);s&&(o(s),n&&w(s,n))}),e.props.__root)}function A(){s(`swatches-${e.props.id}`,(()=>{var t,o,n;d=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),d.forEach((e=>{w(e,T)})),e.props.focusedSwatch=null===(n=null===(o=d[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,B()}),e.props.__root)}function I(){if(!a)return;const e=a.getContext("2d");if(!e)return;const t=a.width,o=a.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function C(){if(!p)return;const t=p.getContext("2d");if(!t)return;F(p,p.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,p.width,p.height)}function D(){if(!i)return;const t=i.getContext("2d");if(!t)return;F(i,i.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,i.width,i.height)}function T(e){if(!e)return;const t=e.getContext("2d");if(!t)return;F(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Fc(o),[l,p,i,d]=Cc(n,r,s,a);t.fillStyle=`hsla(${l}, ${p/255*100}%, ${i/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function E(e,o,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{if(!o)return;const t=o.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-t.left,s=e.touches[0].clientY-t.top):(r=e.clientX-t.left,s=e.clientY-t.top),r=Math.min(Math.max(r,0),t.width),s=Math.min(Math.max(s,0),t.height),n(r,s)}))};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},p=()=>{t=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",p)},i=()=>{t=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",i)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",i)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",p))}function O(t){E(t,n,((t,o)=>{const r=t/n.width*100,s=100-o/n.height*100;$(e.props.hue,r,s)}))}function M(t){E(t,a,((t,o)=>{if(!a)return;const n=a.width,r=Math.floor(t/n*360);e.props.h=r,$(e.props.h,e.props.s,e.props.v)}))}function V(t){e.props.alpha&&E(t,l,((t,o)=>{const n=t/l.width*100/100;e.props.a=n,$(e.props.hue,e.props.s,e.props.v)}))}function F(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function B(){var t,o;if(!e.context||!e.props.options||!d)return;const{h:n,s:r,v:s,a:a}=e.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${Ac(0===o||100===o&&0===t?0:e,0)}-${Ac(r,0)}-${Ac(o,0)}-${Ac(n,2)}`}(n,r,s,a);let p=!1,i=!1;d.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(i=!0);const u=e.parentElement;i||t===l?(u.dataset.active="true",e.ariaSelected="true",i=!1,!p&&d&&(x(d.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=d[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function P(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function H(t,n,r,s=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:Ac(Math.max(Math.min(t,360),0),2),e.props.s=void 0===n||isNaN(n)?e.props.s:Ac(Math.max(Math.min(n,100),0),2),e.props.v=void 0===r||isNaN(r)?e.props.v:Ac(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:p,a:i}=e.props,[d,c,u]=Cc(a,l,p),[f,v,h]=Tc(a,l,p),m=e.props.hexInputFocused?e.props.hex:Oc(a,l,p,i),$=Ac(i,2);e.props.hsla={h:a,s:c,l:u,a:$},e.props.hslaPercent={h:Ac(a,0),s:100===p&&0===l?0:Ac(0===p?c/255:Math.max(Math.min(c/255*100,100),0),0),l:Ac(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:$},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${$})`,e.props.hslaStringPrecise=`hsla(${a}, ${Ac(0===p?c/255:c/255*100,2)}%, ${Ac(u/255*100,2)}%, ${$})`,e.props.rgba={r:f,g:v,b:h,a:$},e.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,P(m),setTimeout((()=>{var t;R(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),g(),o||"undefined"==typeof window||(o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const b=e.props.valueFormat?e.props.valueFormat:e.props.format;s||("hex"===b?e.input(e.props.hex):"rgba"===b?e.input(e.props.rgbaString):"hsla"===b&&e.input(e.props.hslaStringPrecise))}function R(){f(),v(),h(),m()}e.addProps(["expanded","h","s","v","a","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.a=e.props.a||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",b)})),e.on("created",(()=>{var t,n;e.context&&("undefined"!=typeof window&&document.addEventListener("paste",b),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||u[0],e.props.panelControls=Pc(e.props.panelControls),e.props.eyeDropper=Pc(e.props.eyeDropper),e.props.panelFormat=Pc(e.props.panelFormat),e.props.showValue=Pc(e.props.showValue),e.props.allowPaste=Pc(e.props.allowPaste),e.props.inline=r(e.props.inline),e.props.disabled=r(e.props.disabled),e.props.format=e.props.format||"hex",e.props.alpha=r(null===(n=null===(t=e.props)||void 0===t?void 0:t.alpha)||void 0===n||n),e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=r(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},H(0,0,0,!0)):y(`${e.value}`),e.on("input",(({payload:t})=>{o&&void 0!==e.props.__root&&!o.contains(e.props.__root.activeElement)&&y(t)})),setTimeout((()=>{_()}),5),k(),e.on("prop:expanded",(()=>{var t;if(e.props.expanded)_(),k(),A(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}function o(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=Vc(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${Ac(n,t)}-${Ac(r,t)}-${Ac(s,t)}-${Ac(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.expanded=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(u.indexOf(e.props.panelActiveFormat)+t+u.length)%u.length;e.props.panelActiveFormat=u[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.expanded){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Hc),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":H(o,n-s,r);break;case"ArrowRight":H(o,n+s,r);break;case"ArrowUp":H(o,n,r+s);break;case"ArrowDown":H(o,n,r-s);break;case"PageUp":H(o,n,r+10);break;case"PageDown":H(o,n,r-10);break;case"Home":H(o,n-10,r);break;case"End":H(o,n+10,r)}R()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":H(o-s,n,r);break;case"ArrowRight":case"ArrowUp":H(o+s,n,r);break;case"PageUp":H(o+10,n,r);break;case"PageDown":H(o-10,n,r);break;case"Home":H(0,n,r);break;case"End":H(360,n,r)}R()}},e.context.handlers.alphaControlKeydown=t=>{if(e.props.alpha&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,a:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.a=Ac(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.a=Ac(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.a=Ac(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.a=Ac(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.a=0;break;case"End":e.props.a=1}H(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=e.props.alpha?r:r.slice(0,7),Mc(r)){const[t,o,n,s]=Ic(r);e.props.alpha&&(e.props.a=s),P(r),H(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!Mc(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,p=a?s.substring(6,8):"",i=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.key){case"ArrowUp":c=(parseInt(l,16)+i)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-i+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${p}`:`#${r}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;Mc(o)&&P(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.context)return;const l=a.target;if(l.value.endsWith("."))return;const p=Math.max(Math.min(Number(l.value),n),o);l.value=`${p}`;const i=l.id;if("hsla"===t){switch(i){case`h-${e.props.id}`:e.props.h=p;break;case`s-${e.props.id}`:e.props.hslaPercent.s=p;break;case`l-${e.props.id}`:e.props.hslaPercent.l=p}const[t,o,n]=Dc(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);H(t,o,n)}else if("rgba"===t){switch(i){case`r-${e.props.id}`:e.props.rgba.r=p;break;case`g-${e.props.id}`:e.props.rgba.g=p;break;case`b-${e.props.id}`:e.props.rgba.b=p}const[t,o,n]=Ec(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);H(t,o,n)}else"alpha"==t&&e.props.alpha&&(e.props.a=p,H())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),p=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+p,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-p,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=Fc(o.dataset.colorPrecise);e.props.alpha&&(e.props.a=s),H(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,n,r,s;if(!e.context||!d||!d.length)return;const a=d.indexOf(t.currentTarget);let l=null;const p=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),p=s.width+l;return Math.floor(n/p)}(d),i=d.length;let u=0,f=i,v=!1;const h=d[a].dataset.group;if(void 0!==h){const e=d.filter((e=>e.dataset.group===h));u=d.indexOf(e[0]),f=d.indexOf(e[e.length-1])}const m=(a-u)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,c=m,x(a)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void d.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),c=m,e.context.handlers.swatchClick(t),void x(a);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":l=Math.max(a-p,a-(p-(c-m))),v=!0;break;case"ArrowDown":l=Math.max(a+p,a+(p+(c-m))),v=!0;break;case"ArrowLeft":l=a-1,c=(l-u)%p;break;case"ArrowRight":l=a+1,c=(l-u)%p}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=d[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=d[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=d.filter((e=>e.dataset.group===h)),i=d.filter((t=>t.dataset.group===e)),v=(a-u)%p,m=t.length%p||p,$=a>=u+t.length-m;if(l<u){const e=i.length%p||p;l=u-e+Math.min(Math.max(v,c),e-1)}else l>f&&(l=$?Math.min(f+Math.max(v,c)+1,d.indexOf(i[i.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<i){x(l),d.forEach((e=>{delete e.parentElement.dataset.focused}));const e=d[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},Ko,b,
|
|
61
|
+
/* #__PURE__ */g("removeAllValues"),b,function(e){!function(e){e.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption","targetSearchable","targetInputText"]),e.props.loadMoreOption={label:"Load more",value:ji},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=Dt.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.searchable=r(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.targetSearchable=r(e.props.targetSearchable),e.props.targetSearchable&&(e.props.targetInputText=""),e.props.clearOnSelect=r(e.props.clearOnSelect),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>bt(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(wt(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Qi(e)),"function"==typeof e.props.optionLoader?od(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),ld(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Qi(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Qi(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,zi.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===ji)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>n(bt(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,e.props.sourceListOrigin=!0,zi.delete(e),pd(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,Zi.delete(e),pd(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(St)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(St),e.props.skipSetActiveValue=!0,Qi(e))}))}(e)}]};const cd=/* #__PURE__ */Fe("sl"),{outer:ud,wrapper:fd,inner:vd,icon:hd,prefix:md,suffix:$d,help:gd,messages:bd,message:yd}=/* #__PURE__ */Be(cd),xd=cd("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),wd=cd("chart",(()=>({$el:"div",if:"$chart"}))),_d=cd("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),kd=cd("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),Sd=cd("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),Ld=cd("trackWrapper",(()=>({$el:"div"}))),Id=cd("trackInner",(()=>({$el:"div"}))),Ad=cd("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Cd=cd("linkedValues",(()=>({$el:"div"}))),Dd=cd("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),Td=cd("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Ed=cd("marks",(()=>({$el:"div",if:"$marks"}))),Od=cd("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),Md=cd("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Vd=cd("handles",(()=>({$el:"ul"}))),Fd=cd("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Bd=cd("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Pd=cd("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Hd=cd("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Rd=cd("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),Kd=cd("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Nd={schema:/* #__PURE__ */ud(/* #__PURE__ */fd(/* #__PURE__ */xd("$label"),/* #__PURE__ */gd("$help"),/* #__PURE__ */kd(/* #__PURE__ */hd("prefix"),/* #__PURE__ */md(),/* #__PURE__ */Sd(/* #__PURE__ */wd(/* #__PURE__ */_d()),/* #__PURE__ */Ld(/* #__PURE__ */Id(/* #__PURE__ */Ad(),/* #__PURE__ */Ed(/* #__PURE__ */Od(/* #__PURE__ */Md())),/* #__PURE__ */Vd(/* #__PURE__ */Bd(/* #__PURE__ */Kd(),/* #__PURE__ */Pd()),/* #__PURE__ */Fd(/* #__PURE__ */Rd(),/* #__PURE__ */Hd()))))),/* #__PURE__ */$d(),/* #__PURE__ */hd("suffix"),/* #__PURE__ */He("$showInput && $isMulti === false",/* #__PURE__ */Dd())),/* #__PURE__ */He("$showInput && $isMulti",/* #__PURE__ */Cd(/* #__PURE__ */Td(),/* #__PURE__ */Dd())),/* #__PURE__ */bd(/* #__PURE__ */yd("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){let t,o,a;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const l={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};let p=!1;function i(){const e=document.activeElement;if(e instanceof HTMLInputElement){const t=e.value;e.value="",e.value=t}}function d(e){if(!e)return;const t={disabled:e.props.disabled,min:"number"==typeof e.props.min?e.props.min:0,max:"number"==typeof e.props.max?e.props.max:void 0,step:e.props.step||1};e.props.minInputAttrs=Object.assign(e.props.minInputAttrs||{},t),e.props.maxInputAttrs=Object.assign(e.props.maxInputAttrs||{},t),e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(e.props.inputAttrs,t):t,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs}function c(t){const{min:o,max:n,intervals:r}=e.props;if(t=Math.min(Math.max(t,0),100),!r||0===r.length){x();const r=o+t/100*(n-o);return e.props.scalingFunction.reverse(r,o,n)}const s=f(r,o,n);for(let e=0;e<s.length;e++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[e];if(t>=r&&t<=r+a){const e=o+(t-r)/a*l*n,s=e%n;return g(s<n/2?e-s:e+(n-s))}}return t>100?n:t<0?o:void 0}function u(t,o=e.props.min,n=e.props.max){const r=e.props.intervals;if(!r||0===r.length){x();return(e.props.scalingFunction.forward(t,o,n)-o)/(n-o)*100}const s=f(r,o,n);for(let e=0;e<s.length;e++){const{value:o,step:r,left:a,width:l,stepsInInterval:p}=s[e],i=e<s.length-1?s[e+1].value:n;if(t>=o&&t<=i){return 100*((a+(t-o)/r/p*l)/100)}}return 100}function f(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,p=s/r*100;return s+=l,{value:e.value,step:e.step,left:p,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function v(){const t=parseFloat(`${e.props.min}`),o=parseFloat(`${e.props.max}`);let n,r=0;if(Array.isArray(e._value)){const t=[...e._value].sort(h);r=parseFloat(`${t[0]}`),n=parseFloat(`${t[1]}`)}else n=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${u(n,t,o)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${u(r,t,o)}%`},e.props.fillStyles={left:`${u(r,t,o)}%`,width:u(n,t,o)-u(r,t,o)+"%"}):e.props.fillStyles={left:"0%",width:`${u(n,t,o)}%`}}function h(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function m(o,n=!0){if(e.props.disabled)return;let r;if(void 0===o){if(e.props.isMulti)e.input([b(e.props.min),b(e.props.max)]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(b(t))}return void v()}if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(o)){const n="min"===e.props.lastHandleInteraction?0:1;e._value[n]=o;const[s,a]=[...e._value];if(s>=a){const o=null==t?void 0:t.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==o||o.focus()}r=b([...e._value].sort(h))}else Array.isArray(o)?r=b(o):(r=b(o),r=isNaN(r)?e.props.min:r);e.props.snapToMarks&&(r=y(r));const s=b($(r));n&&e.input(s),v()}function $(t){return e.props.isMulti&&Array.isArray(t)?[$(t[0]),$(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function g(t){return parseFloat(t.toFixed(e.props.decimals))}function b(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>g(Math.round(t/e.props.step)*e.props.step))):g(Math.round(t/e.props.step)*e.props.step);const o=f(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return g(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return g(n.value+Math.round((t-n.value)/n.step)*n.step)}}function y(t){if(Array.isArray(t))return t[0]=y(t[0]),t[1]=y(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}function x(){if(p)return;r(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=l[e.props.scalingFunction]||l.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...l.linear,...e.props.scalingFunction}):e.props.scalingFunction=l.linear,p=!0}e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.on("created",(()=>{var l;x(),e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(l=e.props.step.toString().split(".")[1])||void 0===l?void 0:l.length)||0,e.props.min=e.props.min?parseFloat(`${e.props.min}`):0,e.props.max=e.props.max?parseFloat(`${e.props.max}`):100;const p=r(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":p;const g=r(e.props.marks);if(e.props.marks=!!g&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=r(e.props.markLabels),e.props.snapToMarks=r(e.props.snapToMarks),e.props.showInput=r(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar,d(e),s(`track-${e.props.id}`,(()=>{var o;t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`track-${e.props.id}`),m(e.value,!1),v()}),e.props.__root),e.context){let r=0,s="";const l=e.context.handlers.blur;e.context.handlers.blur=t=>{l(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!t)return;e.props.dragging=!1;const{left:n,width:r}=t.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[t,o]=e.value,n=Math.abs(t-s*e.props.max)<Math.abs(o-s*e.props.max)?"min":"max",r="min"===n?0:1;e.props.lastHandleInteraction=n,e.value[r]=c(100*s),m(e._value)}else m(c(100*s))},e.context.handlers.focus=o=>{if(!t)return;const n=o.target.dataset.handle;n&&(e.props.lastHandleInteraction=n)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1,m(e._value)},e.context.handlers.startDrag=o=>{if(!t)return;e.props.dragging=!0;const n="touchstart"===o.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";e.props.lastHandleInteraction=o.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(r,_,{passive:!1}),document.addEventListener(s,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(r,_),n&&o.target instanceof HTMLElement&&o.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),s+=t.key;const e="-"===s?-1:1;r=window.setTimeout((()=>{"-"!==s?(m(parseFloat(s)*e),s=""):s=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,n=Array.isArray(e._value)?e._value[o]:e._value,r=function(t,o){if(!e.props.intervals)return e.props.step;const n=f(e.props.intervals);if(t>=e.props.max)return n[n.length-1].step;let r=n.find(((o,r)=>{var s;return t>=o.value&&t<((null===(s=n[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!r)return e.props.step;if(-1===o){t-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=y(n),r=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,l=Math.min(Math.max(0,s+a),e.props.marks.length-1);return void m(e.props.marks[l].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?m(e.props.min):m(e.props.max));if("Home"===t.key)return void m(e.props.min);if("End"===t.key)return void m(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){m(n+(t.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?m(n+10*r):"PageDown"===t.key&&m(n-10*r)}},e.context.handlers.maxNode=t=>{a=t,t.hook.commit(((o,r)=>{if(n(t.value,o))return r(o);if(`${t.value}`.includes(".")&&!`${o}`.includes(".")&&i(),e.props.isMulti&&Array.isArray(e.value)){m([e.value[0],o])}else m(o);return r($(o))}))},e.context.handlers.minNode=t=>{o=t,t.hook.commit(((o,r)=>{if(n(t.value,o))return r(o);if(`${t.value}`.includes(".")&&!`${o}`.includes(".")&&i(),e.props.isMulti&&Array.isArray(e.value)){m([o,e.value[1]])}else m(o);return r($(o))}))},e.context.handlers.inputBlur=()=>{if(e.props.isMulti&&Array.isArray(e._value)){m([...e._value].sort(h))}},e.context.fns.calculateMarkPosition=t=>u(t,e.props.min,e.props.max)}let w;function _(o){var n;if(!t||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:a}=t.getBoundingClientRect(),l=b(c((r-s)/a*100));w!==l&&(w=l,m(l))}m(e.value)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||m(t,!1):e.value!==t&&m(t,!1),function(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,n]=[...e._value];o&&o.input(g(t)),a&&a.input(g(n))}else a&&a.input(e._value)}()})),e.on("prop:max",(()=>{e.props.max=e.props.max?parseFloat(`${e.props.max}`):100,m(e.value),d(e)})),e.on("prop:min",(()=>{e.props.min=e.props.min?parseFloat(`${e.props.min}`):0,m(e.value),d(e)}))}]},Wd=/* #__PURE__ */Fe("cp"),{outer:Ud,wrapper:Yd,inner:jd,label:zd,prefix:Zd,suffix:qd,help:Gd,messages:Xd,message:Jd,icon:Qd}=/* #__PURE__ */Be(Wd),ec=Wd("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),tc=Wd("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),oc=Wd("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),nc=Wd("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),rc=Wd("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),sc=Wd("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),ac=Wd("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),lc=Wd("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),pc=Wd("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),ic=Wd("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),dc=Wd("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),cc=Wd("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha",style:{opacity:{if:"$alpha",then:"1",else:"0.5"},cursor:{if:"$alpha",then:"",else:"not-allowed"},filter:{if:"$alpha",then:"",else:"grayscale(1)"}}}}))),uc=Wd("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true",style:{pointerEvents:{if:"$alpha",then:"auto",else:"none"}}}}))),fc=Wd("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled || $alpha === undefined",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"',pointerEvents:{if:"$alpha",then:"auto",else:"none"}},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),vc=Wd("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),hc=Wd("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),mc=Wd("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),$c=Wd("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),gc=Wd("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),bc=Wd("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),yc=Wd("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),xc=Wd("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),wc=Wd("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),_c=Wd("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),kc=Wd("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled || $alpha === undefined",autocomplete:"off",style:{opacity:{if:"$alpha",then:"1",else:"0.33"},cursor:{if:"$alpha",then:void 0,else:"not-allowed"}},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"}},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel",style:{opacity:{if:"$alpha",then:"1",else:"0.33"}}}}]}))),Sc=Wd("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),Lc=Wd("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),Ic=Wd("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),Ac=Wd("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),Cc=Wd("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Dc=Wd("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),Tc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Ec=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function Oc(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Mc(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),p=Math.min(r,s,a);let i,d=0;const c=(l+p)/2;if(l===p)d=i=0;else{const e=l-p;switch(i=c>.5?e/(2-l-p):e/(l+p),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*i,255*c,n]}(t,o,n,r)}(e);return[...Fc(t,o,n,r)]}function Vc(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,Oc(255*t,2),Oc(255*a,2),n]}function Fc(e,t,o,n=1){const r=Oc(t/255,4),s=Oc(o/255,4);if(1===s)return[e,0,100,n];const a=Oc(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,Oc(l,2),Oc(100*a,2),n]}function Bc(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let p=0,i=0,d=0;return[p,i,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],p=Math.round(255*(p+l)),i=Math.round(255*(i+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(p,0),255),Math.min(Math.max(i,0),255),Math.min(Math.max(d,0),255),n]}function Pc(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),p=Math.min(r,s,a);let i=0;const d=l,c=l-p,u=0===l?0:c/l;if(l!==p){switch(l){case r:i=(s-a)/c+(s<a?6:0);break;case s:i=(a-r)/c+2;break;case a:i=(r-s)/c+4}i/=6}return[360*i,100*u,100*d,n]}function Hc(e,t,o,n=1){const[r,s,a,l]=Bc(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Rc(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Kc(e){if(e){if(Rc(e))return Mc(e);if(e.startsWith("rgb")){const t=e.match(Tc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Pc(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(Ec);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Fc(o,Oc(255*n,2),Oc(255*r,2),s)}}}function Nc(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Wc(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Uc(e){return!1!==e&&"false"!==e}function Yc(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const jc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const zc={schema:/* #__PURE__ */Ud(/* #__PURE__ */Yd(/* #__PURE__ */zd("$label"),/* #__PURE__ */He("$inline && $help",/* #__PURE__ */Gd("$help")),/* #__PURE__ */jd(/* #__PURE__ */He("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */Qd("prefix","label")),/* #__PURE__ */He("$inline === undefined || $inline === false",/* #__PURE__ */Zd()),/* #__PURE__ */He("$inline === undefined || $inline === false",/* #__PURE__ */ec(/* #__PURE__ */mc(),/* #__PURE__ */He("$showValue",/* #__PURE__ */tc()))),/* #__PURE__ */He("$inline || $expanded)",/* #__PURE__ */oc(/* #__PURE__ */He("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */nc(/* #__PURE__ */Qd("close"))),/* #__PURE__ */He("$panelControls",/* #__PURE__ */rc(/* #__PURE__ */sc(/* #__PURE__ */ac(),/* #__PURE__ */lc()),/* #__PURE__ */vc(/* #__PURE__ */hc()),/* #__PURE__ */pc(/* #__PURE__ */ic(),/* #__PURE__ */dc()),/* #__PURE__ */cc(/* #__PURE__ */uc(),/* #__PURE__ */fc()),/* #__PURE__ */He("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */$c(/* #__PURE__ */Qd("eyeDropper"))))),/* #__PURE__ */He("$panelFormat",/* #__PURE__ */gc(/* #__PURE__ */bc(/* #__PURE__ */He('$panelActiveFormat === "hex"',/* #__PURE__ */yc()),/* #__PURE__ */He('$panelActiveFormat === "rgba"',/* #__PURE__ */xc()),/* #__PURE__ */He('$panelActiveFormat === "rgba"',/* #__PURE__ */wc()),/* #__PURE__ */He('$panelActiveFormat === "rgba"',/* #__PURE__ */_c()),/* #__PURE__ */He('$panelActiveFormat === "hsla"',/* #__PURE__ */Sc()),/* #__PURE__ */He('$panelActiveFormat === "hsla"',/* #__PURE__ */Lc()),/* #__PURE__ */He('$panelActiveFormat === "hsla"',/* #__PURE__ */Ic()),/* #__PURE__ */He('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */kc())),/* #__PURE__ */Ac(/* #__PURE__ */Qd("switch")))),/* #__PURE__ */He("$options",/* #__PURE__ */Cc(/* #__PURE__ */Dc())))),/* #__PURE__ */He("$inline === undefined || $inline === false",/* #__PURE__ */qd()),/* #__PURE__ */He("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */Qd("suffix"))),/* #__PURE__ */He("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */Gd("$help"))),/* #__PURE__ */Xd(/* #__PURE__ */Jd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","alpha","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){let t,o=null,n=null,a=null,l=null,p=null,i=null,d=null,c=0;const u=["hex","rgba","hsla"],f=Wc((function(){if(!n)return;const t=n.getContext("2d");if(!t)return;const{width:o,height:r}=n,s=e.props.h||0;t.fillStyle=`hsl(${s}, 100%, 50%)`,t.fillRect(0,0,o,r);const a=t.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=a,t.fillRect(0,0,o,r);const l=t.createLinearGradient(0,0,0,r);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=l,t.fillRect(0,0,o,r)}),2),v=Wc((function(){if(!l)return;const t=l.getContext("2d");if(!t)return;const o=Math.round(l.width),n=Math.round(l.height);t.clearRect(0,0,o,n),F(l,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,p=t.createLinearGradient(0,0,o,0);p.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),p.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=p,t.fillRect(0,0,o,n)}),2),h=Wc(C,2),m=Wc(D,2),$=Wc(H,2),g=Wc(B,10,!1);function b(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(o&&o.contains(s)){const o=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Rc(o)&&!Tc.test(o)&&!Ec.test(o))return;(Rc(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),y(o))}}function y(t){var o;if(!t)return;const n=Kc(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Oc(o,2)===e.props.h&&Oc(r,2)===e.props.s&&Oc(s,2)===e.props.v&&Oc(a,2)===e.props.a)||(e.props.alpha&&(e.props.a=Oc(a,2)),H(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=Kc(n.value);if(t){const[o,n,r,s]=t;e.props.alpha&&(e.props.a=Oc(s,2)),H(o,n,r)}else H(e.props.h,e.props.s,e.props.v)}else H(e.props.h,e.props.s,e.props.v)}}function x(t){if(!e.context||!d)return;const o=d[t];o&&(e.props.focusedSwatch=o.dataset.color)}function w(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function _(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),s(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=Mc(t.sRGBHex);e.props.alpha&&(e.props.a=1),H(n,r,s)}))}),e.props.__root))}function k(){S("canvas-ls",(e=>{n=e}),f,O),S("canvas-hue",(e=>{a=e}),A,M),S("canvas-alpha",(e=>{l=e}),v,V),L(`canvas-preview-${e.props.id}`,(e=>{p=e,C()}),h),L(`canvas-swatch-preview-${e.props.id}`,(e=>{i=e,D()}),m),I()}function S(o,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",i),document.removeEventListener("touchend",c)},p=e=>{1===e.buttons&&t&&s(e)},i=e=>{t&&s(e)},d=()=>{t=void 0,l()},c=()=>{t=void 0,l()};L(`${o}-${e.props.id}`,(e=>{const l=e.nextElementSibling;n(e),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,s),a||function(e,t){a=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(l,e),e.addEventListener("mousedown",(e=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),t=jc[o],s(e),document.addEventListener("mousemove",p),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),t=jc[o],document.addEventListener("touchmove",i),document.addEventListener("touchend",c)}))}),r)}function L(t,o,n){s(t,(()=>{var r;const s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(t);s&&(o(s),n&&w(s,n))}),e.props.__root)}function I(){s(`swatches-${e.props.id}`,(()=>{var t,o,n;d=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),d.forEach((e=>{w(e,T)})),e.props.focusedSwatch=null===(n=null===(o=d[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,B()}),e.props.__root)}function A(){if(!a)return;const e=a.getContext("2d");if(!e)return;const t=a.width,o=a.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function C(){if(!p)return;const t=p.getContext("2d");if(!t)return;F(p,p.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,p.width,p.height)}function D(){if(!i)return;const t=i.getContext("2d");if(!t)return;F(i,i.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,i.width,i.height)}function T(e){if(!e)return;const t=e.getContext("2d");if(!t)return;F(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Nc(o),[l,p,i,d]=Vc(n,r,s,a);t.fillStyle=`hsla(${l}, ${p/255*100}%, ${i/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function E(e,o,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{if(!o)return;const t=o.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-t.left,s=e.touches[0].clientY-t.top):(r=e.clientX-t.left,s=e.clientY-t.top),r=Math.min(Math.max(r,0),t.width),s=Math.min(Math.max(s,0),t.height),n(r,s)}))};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},p=()=>{t=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",p)},i=()=>{t=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",i)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",i)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",p))}function O(t){E(t,n,((t,o)=>{const r=t/n.width*100,s=100-o/n.height*100;$(e.props.hue,r,s)}))}function M(t){E(t,a,((t,o)=>{if(!a)return;const n=a.width,r=Math.floor(t/n*360);e.props.h=r,$(e.props.h,e.props.s,e.props.v)}))}function V(t){e.props.alpha&&E(t,l,((t,o)=>{const n=t/l.width*100/100;e.props.a=n,$(e.props.hue,e.props.s,e.props.v)}))}function F(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function B(){var t,o;if(!e.context||!e.props.options||!d)return;const{h:n,s:r,v:s,a:a}=e.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${Oc(0===o||100===o&&0===t?0:e,0)}-${Oc(r,0)}-${Oc(o,0)}-${Oc(n,2)}`}(n,r,s,a);let p=!1,i=!1;d.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(i=!0);const u=e.parentElement;i||t===l?(u.dataset.active="true",e.ariaSelected="true",i=!1,!p&&d&&(x(d.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=d[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function P(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function H(t,n,r,s=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:Oc(Math.max(Math.min(t,360),0),2),e.props.s=void 0===n||isNaN(n)?e.props.s:Oc(Math.max(Math.min(n,100),0),2),e.props.v=void 0===r||isNaN(r)?e.props.v:Oc(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:p,a:i}=e.props,[d,c,u]=Vc(a,l,p),[f,v,h]=Bc(a,l,p),m=e.props.hexInputFocused?e.props.hex:Hc(a,l,p,i),$=Oc(i,2);e.props.hsla={h:a,s:c,l:u,a:$},e.props.hslaPercent={h:Oc(a,0),s:100===p&&0===l?0:Oc(0===p?c/255:Math.max(Math.min(c/255*100,100),0),0),l:Oc(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:$},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${$})`,e.props.hslaStringPrecise=`hsla(${a}, ${Oc(0===p?c/255:c/255*100,2)}%, ${Oc(u/255*100,2)}%, ${$})`,e.props.rgba={r:f,g:v,b:h,a:$},e.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,P(m),setTimeout((()=>{var t;R(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),g(),o||"undefined"==typeof window||(o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const b=e.props.valueFormat?e.props.valueFormat:e.props.format;s||("hex"===b?e.input(e.props.hex):"rgba"===b?e.input(e.props.rgbaString):"hsla"===b&&e.input(e.props.hslaStringPrecise))}function R(){f(),v(),h(),m()}e.addProps(["expanded","h","s","v","a","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.a=e.props.a||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",b)})),e.on("created",(()=>{var t,n;e.context&&("undefined"!=typeof window&&document.addEventListener("paste",b),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||u[0],e.props.panelControls=Uc(e.props.panelControls),e.props.eyeDropper=Uc(e.props.eyeDropper),e.props.panelFormat=Uc(e.props.panelFormat),e.props.showValue=Uc(e.props.showValue),e.props.allowPaste=Uc(e.props.allowPaste),e.props.inline=r(e.props.inline),e.props.disabled=r(e.props.disabled),e.props.format=e.props.format||"hex",e.props.alpha=r(null===(n=null===(t=e.props)||void 0===t?void 0:t.alpha)||void 0===n||n),e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=r(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},H(0,0,0,!0)):y(`${e.value}`),e.on("input",(({payload:t})=>{o&&void 0!==e.props.__root&&!o.contains(e.props.__root.activeElement)&&y(t)})),setTimeout((()=>{_()}),5),k(),e.on("prop:expanded",(()=>{var t;if(e.props.expanded)_(),k(),I(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}function o(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=Kc(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${Oc(n,t)}-${Oc(r,t)}-${Oc(s,t)}-${Oc(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.expanded=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(u.indexOf(e.props.panelActiveFormat)+t+u.length)%u.length;e.props.panelActiveFormat=u[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.expanded){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Yc),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":H(o,n-s,r);break;case"ArrowRight":H(o,n+s,r);break;case"ArrowUp":H(o,n,r+s);break;case"ArrowDown":H(o,n,r-s);break;case"PageUp":H(o,n,r+10);break;case"PageDown":H(o,n,r-10);break;case"Home":H(o,n-10,r);break;case"End":H(o,n+10,r)}R()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":H(o-s,n,r);break;case"ArrowRight":case"ArrowUp":H(o+s,n,r);break;case"PageUp":H(o+10,n,r);break;case"PageDown":H(o-10,n,r);break;case"Home":H(0,n,r);break;case"End":H(360,n,r)}R()}},e.context.handlers.alphaControlKeydown=t=>{if(e.props.alpha&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,a:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.a=Oc(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.a=Oc(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.a=Oc(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.a=Oc(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.a=0;break;case"End":e.props.a=1}H(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=e.props.alpha?r:r.slice(0,7),Rc(r)){const[t,o,n,s]=Mc(r);e.props.alpha&&(e.props.a=s),P(r),H(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!Rc(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,p=a?s.substring(6,8):"",i=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.key){case"ArrowUp":c=(parseInt(l,16)+i)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-i+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${p}`:`#${r}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;Rc(o)&&P(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.context)return;const l=a.target;if(l.value.endsWith("."))return;const p=Math.max(Math.min(Number(l.value),n),o);l.value=`${p}`;const i=l.id;if("hsla"===t){switch(i){case`h-${e.props.id}`:e.props.h=p;break;case`s-${e.props.id}`:e.props.hslaPercent.s=p;break;case`l-${e.props.id}`:e.props.hslaPercent.l=p}const[t,o,n]=Fc(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);H(t,o,n)}else if("rgba"===t){switch(i){case`r-${e.props.id}`:e.props.rgba.r=p;break;case`g-${e.props.id}`:e.props.rgba.g=p;break;case`b-${e.props.id}`:e.props.rgba.b=p}const[t,o,n]=Pc(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);H(t,o,n)}else"alpha"==t&&e.props.alpha&&(e.props.a=p,H())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),p=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+p,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-p,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=Nc(o.dataset.colorPrecise);e.props.alpha&&(e.props.a=s),H(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,n,r,s;if(!e.context||!d||!d.length)return;const a=d.indexOf(t.currentTarget);let l=null;const p=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),p=s.width+l;return Math.floor(n/p)}(d),i=d.length;let u=0,f=i,v=!1;const h=d[a].dataset.group;if(void 0!==h){const e=d.filter((e=>e.dataset.group===h));u=d.indexOf(e[0]),f=d.indexOf(e[e.length-1])}const m=(a-u)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,c=m,x(a)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void d.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),c=m,e.context.handlers.swatchClick(t),void x(a);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":l=Math.max(a-p,a-(p-(c-m))),v=!0;break;case"ArrowDown":l=Math.max(a+p,a+(p+(c-m))),v=!0;break;case"ArrowLeft":l=a-1,c=(l-u)%p;break;case"ArrowRight":l=a+1,c=(l-u)%p}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=d[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=d[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=d.filter((e=>e.dataset.group===h)),i=d.filter((t=>t.dataset.group===e)),v=(a-u)%p,m=t.length%p||p,$=a>=u+t.length-m;if(l<u){const e=i.length%p||p;l=u-e+Math.min(Math.max(v,c),e-1)}else l>f&&(l=$?Math.min(f+Math.max(v,c)+1,d.indexOf(i[i.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<i){x(l),d.forEach((e=>{delete e.parentElement.dataset.focused}));const e=d[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},Wo,b,
|
|
62
62
|
/* #__PURE__ */$("eyeDropper","color"),
|
|
63
63
|
/* #__PURE__ */$("close","close"),
|
|
64
64
|
/* #__PURE__ */g("close"),
|
|
65
|
-
/* #__PURE__ */g("next")]},Nc=/* #__PURE__ */Me("tb"),{outer:Wc,inner:Uc,wrapper:Yc,prefix:jc,suffix:zc,help:Zc,messages:qc,message:Gc,icon:Xc}=/* #__PURE__ */Ve(Nc),Jc=Nc("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),Qc=Nc("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),eu=Nc("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),tu=Nc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),ou=Nc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),nu=Nc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function ru(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>n(e,t))).length>0:void 0!==t?n(e.value,t):(e.props._isChecked=n(e.value,e.props.onValue),e.props._isChecked)}const su={schema:/* #__PURE__ */Wc(/* #__PURE__ */Be("$options",/* #__PURE__ */Yc(/* #__PURE__ */Jc("$label"),/* #__PURE__ */ou(/* #__PURE__ */nu(/* #__PURE__ */eu(/* #__PURE__ */Be("$fns.isChecked($option) === true",/* #__PURE__ */tu("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */tu("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */Yc(/* #__PURE__ */Be("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */Jc("$label")),/* #__PURE__ */Qc(/* #__PURE__ */Xc("prefix"),/* #__PURE__ */jc(),/* #__PURE__ */Be("$_isChecked === true",/* #__PURE__ */tu("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */tu("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */zc(),/* #__PURE__ */Xc("suffix")))),/* #__PURE__ */Zc("$help"),/* #__PURE__ */qc(/* #__PURE__ */Gc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,s,a;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=r(e.props.enforced),e.props.multiple=r(e.props.multiple),e.props.vertical=r(e.props.vertical),e.props.disabled=r(e.props.disabled),null!==(t=(s=e.props).onValue)&&void 0!==t||(s.onValue=!0),null!==(o=(a=e.props).offValue)&&void 0!==o||(a.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=ru(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>ru(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?$t(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],r=o.findIndex((e=>n(e,t)));r>-1&&(!e.props.enforced||o.length>1)?o.splice(r,1):-1===r&&o.push(t),e.input(o)}else n(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(n(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},b]},au=/* #__PURE__ */Me("ut"),{outer:lu,inner:pu,wrapper:iu,label:du,prefix:cu,suffix:uu,help:fu,messages:vu,message:hu,icon:mu}=/* #__PURE__ */Ve(au),$u=au("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));function gu(e){let t=null,o=!1;function n(n){var r,s,a;const i=(`${n}`.match(/\-/g)||[]).length%2==1;n=function(o){o=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${o}`),isNaN(o)&&(o=o.split(t.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(o=o.replace(/[^0-9\.]/g,""),o.includes(".")){const t=o.split(".");0===e.props.decimals?o=t[0]:(t[1]=t[1].padEnd(c(),"0").slice(0,c()),o=t.join("."))}return o}(n);const d={};"unit"===l()&&(d.minimumFractionDigits=n.includes(".")?1:0),d.maximumFractionDigits=c(),e.props.minDecimals&&(d.minimumFractionDigits=e.props.minDecimals,n.includes(".")||(n+=".".padEnd(e.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&n.includes(".")&&(n=n.split(".")[0]);let u="";isNaN(n)||""===n.trim()||(n=i?`-${n}`:n,e.props.max&&!isNaN(e.props.max)&&(n=Number(n)>e.props.max?`${e.props.max}`:n),e.props.min&&!isNaN(e.props.min)&&(n=Number(n)<e.props.min?`${e.props.min}`:n),n.includes(".")?n=n.split(".")[0].padStart(1,"0")+"."+(null!==(r=n.split(".")[1])&&void 0!==r?r:"0"):d.maximumFractionDigits=null!==(s=d.minimumFractionDigits)&&void 0!==s?s:0,u=p(e.props.displayLocale,d).format(n));let f,v=n.split(".");v=v[0]+(null!==(a=v[1])&&void 0!==a?a:"").padEnd(c(),"0"),v.length>1&&(v=v.replace(/^0+/,""),v=""!==n&&""===v?"0":v),e.props.valueStore={number:n,integer:v,string:u},o=!0,e.props.valueStore&&(f=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(""===f?void 0:f).then((()=>(o=!1,Promise.resolve())))}function r(){s(`${e.props.id}`,(t=>{var o,n;t instanceof HTMLInputElement&&(t.value=null!==(n=null===(o=e.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),e.props.__root)}function a(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function l(){return e.props.currency?"currency":"unit"}function p(t,o={}){const n=l(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return r[n]=e.props[n],new Intl.NumberFormat(t,r)}function i(){var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`#${e.props.id}_inner input`);if(s){s.dataset.placeholder||(s.dataset.placeholder=null!==(n=s.getAttribute("placeholder"))&&void 0!==n?n:"");const e=((t.unitLeft?`${t.unit} `:"")+(null!==(r=s.dataset.placeholder)&&void 0!==r?r:"")+(t.unitLeft?"":` ${t.unit}`)).trim();s.setAttribute("placeholder",e)}}function d(o){var n;const r=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input`);if(!r)return;const s=t.unit.length+t.literal.length;o=t.unitLeft?Math.max(o,s):Math.min(o,a().length-s),r.setSelectionRange(o,o)}function c(){return void 0!==e.props.decimals?e.props.decimals:void 0!==e.props.minDecimals&&e.props.minDecimals>t.fractionLength?e.props.minDecimals:t.fractionLength}e.props.valueStore=null,e.on("input",(({payload:e})=>{o||(n(e),r())})),e.on("mounted",(()=>{i()})),e.context&&(e.context.handlers.setPlaceholder=i,e.context.handlers.init=(o=null)=>{var s;!function(){var o,n,r,s,a,l,i;const d=p(e.props.displayLocale).formatToParts(12345678.12345678);t={decimal:null===(o=d.find((e=>"decimal"==e.type)))||void 0===o?void 0:o.value,group:null===(n=d.find((e=>"group"==e.type)))||void 0===n?void 0:n.value,unit:null===(r=d.find((e=>["unit","currency"].includes(e.type))))||void 0===r?void 0:r.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(s=d.find((e=>"literal"==e.type)))||void 0===s?void 0:s.value)&&void 0!==a?a:"",fractionLength:null!==(i=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==i?i:0}}();let a=null!==(s=null!=o?o:e._value)&&void 0!==s?s:"";e.props.valueStore?a=e.props.valueStore.number:"integer"===e.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=c())&&void 0!==t?t:0)).toString().replace(".",c())}(`${null!=a?a:""}`)),n(a),r()},e.context.handlers.handleBeforeInput=o=>{var r,s,a,l,p,i,c,u,f;if(!e.props.inExecCommand&&(o.preventDefault(),o.stopPropagation(),o.target instanceof HTMLInputElement)){const v=o.target,h=null!==(r=o.data)&&void 0!==r?r:"",m=null!==(s=o.target.value)&&void 0!==s?s:"",$=null!==(a=o.target.selectionStart)&&void 0!==a?a:0,g=null!==(l=o.target.selectionEnd)&&void 0!==l?l:0,b=g-$,y=m.indexOf(t.decimal);let x=(null!==(p=o.target.selectionStart)&&void 0!==p?p:0)+(o.data?0:-1),w=m,_=1;if(m.includes(t.decimal)&&h===t.decimal)return h===t.decimal&&(x=w.indexOf(t.decimal)+1),void d(x);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===h)return;if(h.match(/[a-zA-Z]/))return;if(h===t.decimal&&0===e.props.decimals)return;if("deleteByCut"===o.inputType&&b>0&&(w=w.slice(0,$)+w.slice(g),x=g),"insertFromPaste"===o.inputType){const e=null!==(i=o.data)&&void 0!==i?i:"";w=w.slice(0,$)+e+w.slice(g)}if("deleteContentBackward"===o.inputType&&m[$-1]===t.group?(_+=1,x-=1):"deleteContentForward"===o.inputType&&m[$]===t.group&&(_+=1,x+=1),-1!==y&&x>y&&"insertText"===o.inputType?w=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(w,x,null!==(c=o.data)&&void 0!==c?c:"0"):"insertText"===o.inputType?(x=g,w=w.slice(0,$)+o.data+w.slice(g)):"deleteContentForward"===o.inputType?(x+=2,w=0===b?w.slice(0,$)+w.slice(g+_):w.slice(0,$)+w.slice(g)):"deleteContentBackward"===o.inputType&&(x+=1,0===b?w=w.slice(0,Math.max($-_,0))+w.slice(g):b>0&&(w=w.slice(0,$)+w.slice(g))),"deleteContentForward"===o.inputType&&m[$]===t.decimal){const e=w.slice($-1);w=w.slice(0,$),e.includes(t.unit)&&(w+=" "+t.unit)}else if("deleteContentBackward"===o.inputType&&m[$-1]===t.decimal){const e=w.slice($-1);w=w.slice(0,$-1),e.includes(t.unit)&&(w+=" "+t.unit)}n(w),w=null!==(f=null===(u=e.props.valueStore)||void 0===u?void 0:u.string)&&void 0!==f?f:"",x=w.length-m.length+x,w.length===m.length&&(x+=o.inputType.includes("delete")?-1:1),v.setSelectionRange(0,m.length),e.props.inExecCommand=!0,document.execCommand("insertText",void 0,w),e.props.inExecCommand=!1,h===t.decimal?x=w.indexOf(t.decimal)+1:m.includes(t.decimal)&&!w.includes(t.decimal)&&(x=w.length),d(Math.max(0,x))}},e.context.handlers.handleInput=t=>{t.target instanceof HTMLInputElement&&(e.props.inputText=t.target.value,n(t.target.value))},e.context.handlers.handleKeyDown=t=>{var o,s;if(t.target instanceof HTMLInputElement&&("ArrowUp"===t.key||"ArrowDown"===t.key)){const l="ArrowUp"===t.key?1*e.props.step:-1*e.props.step;n(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let p=null!==(o=a[0])&&void 0!==o?o:"0",i=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(p+=d.padEnd(u,"0"),i+=c.padEnd(u,"0"));const f=BigInt(BigInt(p)+BigInt(i)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(s=null===(o=e.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==s?s:0,l)),r(),setTimeout((()=>{d(a().length)}),1)}})}const bu={schema:/* #__PURE__ */lu(/* #__PURE__ */iu(/* #__PURE__ */du("$label"),/* #__PURE__ */pu(/* #__PURE__ */mu("prefix"),/* #__PURE__ */cu(),/* #__PURE__ */$u(),/* #__PURE__ */uu(),/* #__PURE__ */mu("suffix"))),/* #__PURE__ */fu("$help"),/* #__PURE__ */vu(/* #__PURE__ */hu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,p,i,d,c,u,f,v,h,m;const $=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps($),null!==(t=(i=e.props).displayLocale)&&void 0!==t||(i.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).decimals)&&void 0!==o||(d.decimals=null),null!==(n=(c=e.props).minDecimals)&&void 0!==n||(c.minDecimals=null),null!==(r=(u=e.props).min)&&void 0!==r||(u.min=null),null!==(s=(f=e.props).max)&&void 0!==s||(f.max=null),null!==(a=(v=e.props).step)&&void 0!==a||(v.step=1),null!==(l=(h=e.props).unit)&&void 0!==l||(h.unit=e.props.unit||"percent"),-1===["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"].indexOf(e.props.unit)&&(e.props.unit="percent"),null!==(p=(m=e.props).valueFormat)&&void 0!==p||(m.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(gu(e),e.context.handlers.init(),$.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},b]},yu=/* #__PURE__ */Me("cr"),{outer:xu,inner:wu,wrapper:_u,label:ku,prefix:Su,suffix:Lu,help:Au,messages:Iu,message:Cu,icon:Du}=/* #__PURE__ */Ve(yu),Tu=yu("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));const Eu={schema:/* #__PURE__ */xu(/* #__PURE__ */_u(/* #__PURE__ */ku("$label"),/* #__PURE__ */wu(/* #__PURE__ */Du("prefix"),/* #__PURE__ */Su(),/* #__PURE__ */Tu(),/* #__PURE__ */Lu(),/* #__PURE__ */Du("suffix"))),/* #__PURE__ */Au("$help"),/* #__PURE__ */Iu(/* #__PURE__ */Cu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,p;const i=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(i),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(p=e.props).valueFormat)&&void 0!==r||(p.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(gu(e),e.context.handlers.init(),i.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.setPlaceholder(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.init()}))})))}))}]};var Ou=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:cs,colorpicker:Kc,currency:Eu,datepicker:tp,dropdown:No,mask:Zp,rating:Lr,repeater:Kn,slider:Fd,taglist:kp,toggle:pn,togglebuttons:su,transferlist:rd,unit:bu});const Mu="undefined"!=typeof window?setInterval:()=>0,Vu=new WeakSet;function Fu(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Vu.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:le(13919),children:`${le(451228594)}${le(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){me[e]?me[e].add(t):me[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!te.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),p=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(p))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Vu.add(o),o.define({...r,schema:n(e)})}Mu((()=>ce.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}export{Be as $if,cs as autocomplete,Kc as colorpicker,Ve as createBaseSections,Fu as createProPlugin,Me as createSectionFactory,Eu as currency,tp as datepicker,No as dropdown,Ou as inputs,Zp as mask,Lr as rating,Kn as repeater,Fd as slider,kp as taglist,pn as toggle,su as togglebuttons,rd as transferlist,bu as unit};
|
|
65
|
+
/* #__PURE__ */g("next")]},Zc=/* #__PURE__ */Fe("tb"),{outer:qc,inner:Gc,wrapper:Xc,prefix:Jc,suffix:Qc,help:eu,messages:tu,message:ou,icon:nu}=/* #__PURE__ */Be(Zc),ru=Zc("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),su=Zc("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),au=Zc("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),lu=Zc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),pu=Zc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),iu=Zc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function du(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>n(e,t))).length>0:void 0!==t?n(e.value,t):(e.props._isChecked=n(e.value,e.props.onValue),e.props._isChecked)}const cu={schema:/* #__PURE__ */qc(/* #__PURE__ */He("$options",/* #__PURE__ */Xc(/* #__PURE__ */ru("$label"),/* #__PURE__ */pu(/* #__PURE__ */iu(/* #__PURE__ */au(/* #__PURE__ */He("$fns.isChecked($option) === true",/* #__PURE__ */lu("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */lu("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */Xc(/* #__PURE__ */He("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */ru("$label")),/* #__PURE__ */su(/* #__PURE__ */nu("prefix"),/* #__PURE__ */Jc(),/* #__PURE__ */He("$_isChecked === true",/* #__PURE__ */lu("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */lu("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */Qc(),/* #__PURE__ */nu("suffix")))),/* #__PURE__ */eu("$help"),/* #__PURE__ */tu(/* #__PURE__ */ou("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,s,a;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=r(e.props.enforced),e.props.multiple=r(e.props.multiple),e.props.vertical=r(e.props.vertical),e.props.disabled=r(e.props.disabled),null!==(t=(s=e.props).onValue)&&void 0!==t||(s.onValue=!0),null!==(o=(a=e.props).offValue)&&void 0!==o||(a.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=du(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>du(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?bt(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],r=o.findIndex((e=>n(e,t)));r>-1&&(!e.props.enforced||o.length>1)?o.splice(r,1):-1===r&&o.push(t),e.input(o)}else n(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(n(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},b]},uu=/* #__PURE__ */Fe("ut"),{outer:fu,inner:vu,wrapper:hu,label:mu,prefix:$u,suffix:gu,help:bu,messages:yu,message:xu,icon:wu}=/* #__PURE__ */Be(uu),_u=uu("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));function ku(e){let t=null,o=!1;function n(n){var r,s,a;const i=(`${n}`.match(/\-/g)||[]).length%2==1;n=function(o){o=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${o}`),isNaN(o)&&(o=o.split(t.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(o=o.replace(/[^0-9\.]/g,""),o.includes(".")){const t=o.split(".");0===e.props.decimals?o=t[0]:(t[1]=t[1].padEnd(c(),"0").slice(0,c()),o=t.join("."))}return o}(n);const d={};"unit"===l()&&(d.minimumFractionDigits=n.includes(".")?1:0),d.maximumFractionDigits=c(),e.props.minDecimals&&(d.minimumFractionDigits=e.props.minDecimals,n.includes(".")||(n+=".".padEnd(e.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&n.includes(".")&&(n=n.split(".")[0]);let u="";isNaN(n)||""===n.trim()||(n=i?`-${n}`:n,e.props.max&&!isNaN(e.props.max)&&(n=Number(n)>e.props.max?`${e.props.max}`:n),e.props.min&&!isNaN(e.props.min)&&(n=Number(n)<e.props.min?`${e.props.min}`:n),n.includes(".")?n=n.split(".")[0].padStart(1,"0")+"."+(null!==(r=n.split(".")[1])&&void 0!==r?r:"0"):d.maximumFractionDigits=null!==(s=d.minimumFractionDigits)&&void 0!==s?s:0,u=p(e.props.displayLocale,d).format(n));let f,v=n.split(".");v=v[0]+(null!==(a=v[1])&&void 0!==a?a:"").padEnd(c(),"0"),v.length>1&&(v=v.replace(/^0+/,""),v=""!==n&&""===v?"0":v),e.props.valueStore={number:n,integer:v,string:u},o=!0,e.props.valueStore&&(f=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(""===f?void 0:f).then((()=>(o=!1,Promise.resolve())))}function r(){s(`${e.props.id}`,(t=>{var o,n;t instanceof HTMLInputElement&&(t.value=null!==(n=null===(o=e.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),e.props.__root)}function a(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function l(){return e.props.currency?"currency":"unit"}function p(t,o={}){const n=l(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return r[n]=e.props[n],new Intl.NumberFormat(t,r)}function i(){var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`#${e.props.id}_inner input`);if(s){s.dataset.placeholder||(s.dataset.placeholder=null!==(n=s.getAttribute("placeholder"))&&void 0!==n?n:"");const e=((t.unitLeft?`${t.unit} `:"")+(null!==(r=s.dataset.placeholder)&&void 0!==r?r:"")+(t.unitLeft?"":` ${t.unit}`)).trim();s.setAttribute("placeholder",e)}}function d(o){var n;const r=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input`);if(!r)return;const s=t.unit.length+t.literal.length;o=t.unitLeft?Math.max(o,s):Math.min(o,a().length-s),r.setSelectionRange(o,o)}function c(){return void 0!==e.props.decimals?e.props.decimals:void 0!==e.props.minDecimals&&e.props.minDecimals>t.fractionLength?e.props.minDecimals:t.fractionLength}e.props.valueStore=null,e.on("input",(({payload:e})=>{o||(n(e),r())})),e.on("mounted",(()=>{i()})),e.context&&(e.context.handlers.setPlaceholder=i,e.context.handlers.init=(o=null)=>{var s;!function(){var o,n,r,s,a,l,i;const d=p(e.props.displayLocale).formatToParts(12345678.12345678);t={decimal:null===(o=d.find((e=>"decimal"==e.type)))||void 0===o?void 0:o.value,group:null===(n=d.find((e=>"group"==e.type)))||void 0===n?void 0:n.value,unit:null===(r=d.find((e=>["unit","currency"].includes(e.type))))||void 0===r?void 0:r.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(s=d.find((e=>"literal"==e.type)))||void 0===s?void 0:s.value)&&void 0!==a?a:"",fractionLength:null!==(i=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==i?i:0}}();let a=null!==(s=null!=o?o:e._value)&&void 0!==s?s:"";e.props.valueStore?a=e.props.valueStore.number:"integer"===e.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=c())&&void 0!==t?t:0)).toString().replace(".",c())}(`${null!=a?a:""}`)),n(a),r()},e.context.handlers.handleBeforeInput=o=>{var r,s,a,l,p,i,c,u,f;if(!e.props.inExecCommand&&(o.preventDefault(),o.stopPropagation(),o.target instanceof HTMLInputElement)){const v=o.target,h=null!==(r=o.data)&&void 0!==r?r:"",m=null!==(s=o.target.value)&&void 0!==s?s:"",$=null!==(a=o.target.selectionStart)&&void 0!==a?a:0,g=null!==(l=o.target.selectionEnd)&&void 0!==l?l:0,b=g-$,y=m.indexOf(t.decimal);let x=(null!==(p=o.target.selectionStart)&&void 0!==p?p:0)+(o.data?0:-1),w=m,_=1;if(m.includes(t.decimal)&&h===t.decimal)return h===t.decimal&&(x=w.indexOf(t.decimal)+1),void d(x);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===h)return;if(h.match(/[a-zA-Z]/))return;if(h===t.decimal&&0===e.props.decimals)return;if("deleteByCut"===o.inputType&&b>0&&(w=w.slice(0,$)+w.slice(g),x=g),"insertFromPaste"===o.inputType){const e=null!==(i=o.data)&&void 0!==i?i:"";w=w.slice(0,$)+e+w.slice(g)}if("deleteContentBackward"===o.inputType&&m[$-1]===t.group?(_+=1,x-=1):"deleteContentForward"===o.inputType&&m[$]===t.group&&(_+=1,x+=1),-1!==y&&x>y&&"insertText"===o.inputType?w=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(w,x,null!==(c=o.data)&&void 0!==c?c:"0"):"insertText"===o.inputType?(x=g,w=w.slice(0,$)+o.data+w.slice(g)):"deleteContentForward"===o.inputType?(x+=2,w=0===b?w.slice(0,$)+w.slice(g+_):w.slice(0,$)+w.slice(g)):"deleteContentBackward"===o.inputType&&(x+=1,0===b?w=w.slice(0,Math.max($-_,0))+w.slice(g):b>0&&(w=w.slice(0,$)+w.slice(g))),"deleteContentForward"===o.inputType&&m[$]===t.decimal){const e=w.slice($-1);w=w.slice(0,$),e.includes(t.unit)&&(w+=" "+t.unit)}else if("deleteContentBackward"===o.inputType&&m[$-1]===t.decimal){const e=w.slice($-1);w=w.slice(0,$-1),e.includes(t.unit)&&(w+=" "+t.unit)}n(w),w=null!==(f=null===(u=e.props.valueStore)||void 0===u?void 0:u.string)&&void 0!==f?f:"",x=w.length-m.length+x,w.length===m.length&&(x+=o.inputType.includes("delete")?-1:1),v.setSelectionRange(0,m.length),e.props.inExecCommand=!0,document.execCommand("insertText",void 0,w),e.props.inExecCommand=!1,h===t.decimal?x=w.indexOf(t.decimal)+1:m.includes(t.decimal)&&!w.includes(t.decimal)&&(x=w.length),d(Math.max(0,x))}},e.context.handlers.handleInput=t=>{t.target instanceof HTMLInputElement&&(e.props.inputText=t.target.value,n(t.target.value))},e.context.handlers.handleKeyDown=t=>{var o,s;if(t.target instanceof HTMLInputElement&&("ArrowUp"===t.key||"ArrowDown"===t.key)){const l="ArrowUp"===t.key?1*e.props.step:-1*e.props.step;n(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let p=null!==(o=a[0])&&void 0!==o?o:"0",i=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(p+=d.padEnd(u,"0"),i+=c.padEnd(u,"0"));const f=BigInt(BigInt(p)+BigInt(i)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(s=null===(o=e.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==s?s:0,l)),r(),setTimeout((()=>{d(a().length)}),1)}})}const Su={schema:/* #__PURE__ */fu(/* #__PURE__ */hu(/* #__PURE__ */mu("$label"),/* #__PURE__ */vu(/* #__PURE__ */wu("prefix"),/* #__PURE__ */$u(),/* #__PURE__ */_u(),/* #__PURE__ */gu(),/* #__PURE__ */wu("suffix"))),/* #__PURE__ */bu("$help"),/* #__PURE__ */yu(/* #__PURE__ */xu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,p,i,d,c,u,f,v,h,m;const $=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps($),null!==(t=(i=e.props).displayLocale)&&void 0!==t||(i.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).decimals)&&void 0!==o||(d.decimals=null),null!==(n=(c=e.props).minDecimals)&&void 0!==n||(c.minDecimals=null),null!==(r=(u=e.props).min)&&void 0!==r||(u.min=null),null!==(s=(f=e.props).max)&&void 0!==s||(f.max=null),null!==(a=(v=e.props).step)&&void 0!==a||(v.step=1),null!==(l=(h=e.props).unit)&&void 0!==l||(h.unit=e.props.unit||"percent"),-1===["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"].indexOf(e.props.unit)&&(e.props.unit="percent"),null!==(p=(m=e.props).valueFormat)&&void 0!==p||(m.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(ku(e),e.context.handlers.init(),$.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},b]},Lu=/* #__PURE__ */Fe("cr"),{outer:Iu,inner:Au,wrapper:Cu,label:Du,prefix:Tu,suffix:Eu,help:Ou,messages:Mu,message:Vu,icon:Fu}=/* #__PURE__ */Be(Lu),Bu=Lu("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));const Pu={schema:/* #__PURE__ */Iu(/* #__PURE__ */Cu(/* #__PURE__ */Du("$label"),/* #__PURE__ */Au(/* #__PURE__ */Fu("prefix"),/* #__PURE__ */Tu(),/* #__PURE__ */Bu(),/* #__PURE__ */Eu(),/* #__PURE__ */Fu("suffix"))),/* #__PURE__ */Ou("$help"),/* #__PURE__ */Mu(/* #__PURE__ */Vu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,p;const i=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(i),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(p=e.props).valueFormat)&&void 0!==r||(p.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(ku(e),e.context.handlers.init(),i.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.setPlaceholder(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.init()}))})))}))}]};var Hu=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:fs,colorpicker:zc,currency:Pu,datepicker:lp,dropdown:Uo,mask:ei,rating:Ar,repeater:Wn,slider:Nd,taglist:Dp,toggle:cn,togglebuttons:cu,transferlist:dd,unit:Su});const Ru="undefined"!=typeof window?setInterval:()=>0,Ku=new WeakSet;function Nu(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Ku.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:ie(13919),children:`${ie(451228594)}${ie(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){ge[e]?ge[e].add(t):ge[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!ne.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),p=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(p))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Ku.add(o),o.define({...r,schema:n(e)})}Ru((()=>fe.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}export{He as $if,fs as autocomplete,zc as colorpicker,Be as createBaseSections,Nu as createProPlugin,Fe as createSectionFactory,Pu as currency,lp as datepicker,Uo as dropdown,Hu as inputs,ei as mask,Ar as rating,Wn as repeater,Nd as slider,Dp as taglist,cn as toggle,cu as togglebuttons,dd as transferlist,Su as unit};
|