{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split(\"-\");\"0\"===r&&0===s&&c===`${a}`&&(p=!0);const u=e.parentElement;p||t===l?(u.dataset.active=\"true\",e.ariaSelected=\"true\",p=!1,!i&&d&&(x(d.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected=\"false\")})),i||(e.props.focusedSwatch=null===(o=null===(t=d[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function P(t){t=t.replace(\"#\",\"\"),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function H(t,n,r,s=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:$c(Math.max(Math.min(t,360),0),2),e.props.s=void 0===n||isNaN(n)?e.props.s:$c(Math.max(Math.min(n,100),0),2),e.props.v=void 0===r||isNaN(r)?e.props.v:$c(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,a:p}=e.props,[d,c,u]=yc(a,l,i),[f,v,h]=wc(a,l,i),m=e.props.hexInputFocused?e.props.hex:kc(a,l,i,p),g=$c(p,2);e.props.hsla={h:a,s:c,l:u,a:g},e.props.hslaPercent={h:$c(a,0),s:100===i&&0===l?0:$c(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:$c(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:g},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${g})`,e.props.hslaStringPrecise=`hsla(${a}, ${$c(0===i?c/255:c/255*100,2)}%, ${$c(u/255*100,2)}%, ${g})`,e.props.rgba={r:f,g:v,b:h,a:g},e.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${g})`,P(m),setTimeout((()=>{var t;R(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),$(),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||'',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=Ac(e.props.panelControls),e.props.eyeDropper=Ac(e.props.eyeDropper),e.props.panelFormat=Ac(e.props.panelFormat),e.props.showValue=Ac(e.props.showValue),e.props.allowPaste=Ac(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=Lc(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),`${$c(n,t)}-${$c(r,t)}-${$c(s,t)}-${$c(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(Cc),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=$c(Math.min(Math.max(s-a,0),1),2);break;case\"ArrowRight\":case\"ArrowUp\":e.props.a=$c(Math.min(Math.max(s+a,0),1),2);break;case\"PageUp\":e.props.a=$c(Math.min(Math.max(s+.1,0),1),2);break;case\"PageDown\":e.props.a=$c(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),Sc(r)){const[t,o,n,s]=bc(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(!Sc(n))return;const s=n.startsWith(\"#\")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):\"\",p=t.shiftKey?10:1,d=16777215;let c;if([\"ArrowUp\",\"ArrowDown\",\"PageUp\",\"PageDown\",\"Home\",\"End\"].includes(t.key))switch(t.preventDefault(),t.key){case\"ArrowUp\":c=(parseInt(l,16)+p)%16777216;break;case\"ArrowDown\":c=(parseInt(l,16)-p+d+1)%16777216;break;case\"PageUp\":c=(parseInt(l,16)+10)%16777216;break;case\"PageDown\":c=(parseInt(l,16)-10+d+1)%16777216;break;case\"Home\":c=0;break;case\"End\":c=d}void 0!==c&&(r=c.toString(16).padStart(6,\"0\").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;Sc(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 i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if(\"hsla\"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=xc(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);H(t,o,n)}else if(\"rgba\"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=_c(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=i,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),i=s.shiftKey?10*r:r;switch(s.key){case\"ArrowUp\":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case\"ArrowDown\":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case\"PageUp\":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case\"PageDown\":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case\"Home\":s.preventDefault(),a.value=`${o}`;break;case\"End\":s.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=Ic(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 i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(d),p=d.length;let u=0,f=p,v=!1;const h=d[a].dataset.group;if(void 0!==h){const e=d.filter((e=>e.dataset.group===h));u=d.indexOf(e[0]),f=d.indexOf(e[e.length-1])}const m=(a-u)%i;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-i,a-(i-(c-m))),v=!0;break;case\"ArrowDown\":l=Math.max(a+i,a+(i+(c-m))),v=!0;break;case\"ArrowLeft\":l=a-1,c=(l-u)%i;break;case\"ArrowRight\":l=a+1,c=(l-u)%i}if(v&&null!==l&&(lf)){let e;e=le.dataset.group===h)),p=d.filter((t=>t.dataset.group===e)),v=(a-u)%i,m=t.length%i||i,g=a>=u+t.length-m;if(lf&&(l=g?Math.min(f+Math.max(v,c)+1,d.indexOf(p[p.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l{delete e.parentElement.dataset.focused}));const e=d[l],t=e.parentElement;e.focus(),t.dataset.focused=\"true\"}})}))},Do,b,\n/* #__PURE__ */g(\"eyeDropper\",\"color\"),\n/* #__PURE__ */g(\"close\",\"close\"),\n/* #__PURE__ */$(\"close\"),\n/* #__PURE__ */$(\"next\")]},Oc=/* #__PURE__ */xe(\"tb\"),{outer:Mc,inner:Vc,wrapper:Fc,prefix:Bc,suffix:Pc,help:Hc,messages:Rc,message:Nc,icon:Kc}=/* #__PURE__ */we(Oc),Wc=Oc(\"label\",(()=>({if:\"$label\",$el:\"label\",attrs:{id:\"$id + '_label'\"}}))),Uc=Oc(\"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\"}}))),Yc=Oc(\"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\"}}))),jc=Oc(\"inputInner\",(()=>({bind:\"$attrs\",$el:\"span\"}))),qc=Oc(\"options\",(()=>({$el:\"ul\",attrs:{id:\"$id\",\"data-vertical\":'$vertical && \"true\" || \"false\"',\"aria-labelledby\":\"$id\"}}))),zc=Oc(\"option\",(()=>({$el:\"li\",for:[\"option\",\"index\",\"$options\"],attrs:{key:\"$option.value\",\"data-index\":\"$index\"}})));function Zc(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 Gc={schema:/* #__PURE__ */Mc(/* #__PURE__ */ke(\"$options\",/* #__PURE__ */Fc(/* #__PURE__ */Wc(\"$label\"),/* #__PURE__ */qc(/* #__PURE__ */zc(/* #__PURE__ */Yc(/* #__PURE__ */ke(\"$fns.isChecked($option) === true\",/* #__PURE__ */jc(\"$slots.default || $slots.on || $option.onLabel || $option.label\"),/* #__PURE__ */jc(\"$slots.default || $slots.off || $option.offLabel || $option.label\")))))),/* #__PURE__ */Fc(/* #__PURE__ */ke(\"$label && ($slots.default || $slots.on || $onLabel)\",/* #__PURE__ */Wc(\"$label\")),/* #__PURE__ */Uc(/* #__PURE__ */Kc(\"prefix\"),/* #__PURE__ */Bc(),/* #__PURE__ */ke(\"$_isChecked === true\",/* #__PURE__ */jc(\"$slots.default || $slots.on || $onLabel || $label\"),/* #__PURE__ */jc(\"$slots.default || $slots.off || $offLabel || $label\")),/* #__PURE__ */Pc(),/* #__PURE__ */Kc(\"suffix\")))),/* #__PURE__ */Hc(\"$help\"),/* #__PURE__ */Rc(/* #__PURE__ */Nc(\"$message.value\"))),type:\"input\",family:\"button\",props:[\"options\"],features:[function(e){var t,o,s,a;e.addProps([\"enforced\",\"multiple\",\"offLabel\",\"offValue\",\"disabled\",\"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),\"disabled\"in e.props&&(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=Zc(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=>Zc(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?rt(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]},Xc=/* #__PURE__ */xe(\"ut\"),{outer:Jc,inner:Qc,wrapper:eu,label:tu,prefix:ou,suffix:nu,help:ru,messages:su,message:au,icon:lu}=/* #__PURE__ */we(Xc),iu=Xc(\"input\",(()=>({$el:\"input\",bind:\"$attrs\",attrs:{name:\"$node.name\",autocomplete:\"$attrs.autocomplete || off\",id:\"$id\",onChange:\"$handlers.handleInput\",onBlur:\"$handlers.unitBlur\",onInput:\"$handlers.handleInput\",onKeydown:\"$handlers.handleKeyDown\",onBeforeinput:\"$handlers.handleBeforeInput\",readonly:\"$readonly\",inputmode:\"decimal\",placeholder:\"$placeholder || $unitParts.unit\",disabled:\"$disabled\",\"data-unit\":\"$unit\",\"data-currency\":\"$currency\",\"data-display-locale\":\"$displayLocale\",\"data-value-locale\":\"$valueLocale\",\"data-decimals\":\"$decimals\",\"data-trailing\":\"$trailingZeros\",\"data-numeric-value\":\"$_numericValue\",\"data-align\":\"$_valueAlignAuto\",\"aria-required\":\"$state.required || undefined\"}}))),pu={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,\"mile-scandinavian\":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,\"mile-scandinavian\":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,\"mile-scandinavian\":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,\"mile-scandinavian\":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,\"mile-scandinavian\":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,\"mile-scandinavian\":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,\"mile-scandinavian\":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,\"mile-scandinavian\":254e-8},\"mile-scandinavian\":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,\"mile-scandinavian\":1}},du={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},cu={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},uu={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},fu={liter:{liter:1,milliliter:1e3,gallon:.264172,\"fluid-ounce\":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,\"fluid-ounce\":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,\"fluid-ounce\":128},\"fluid-ounce\":{liter:.0295735,milliliter:29.5735,gallon:.0078125,\"fluid-ounce\":1}},vu={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},hu={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function mu(e){let t=!1;function o(o){var n,r,s;const i=(`${o}`.match(/\\-/g)||[]).length%2==1;o=function(t){t=function(e){return e.replace(/[\\u0660-\\u0669\\u06f0-\\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${t}`),isNaN(t)&&(t=t.split(e.props.unitParts.decimal).map((e=>e.replace(/[^0-9]/g,\"\"))).join(\".\"));if(t=t.replace(/[^0-9\\.]/g,\"\"),t.includes(\".\")){const o=t.split(\".\");0===e.props.decimals?t=o[0]:\"currency\"===e.props.type&&(o[1]=o[1].padEnd(p(),\"0\").slice(0,p()),t=o.join(\".\"))}return t}(o);const d={};\"unit\"!==a()&&\"decimal\"!==a()||(d.minimumFractionDigits=o.includes(\".\")?1:0),d.maximumFractionDigits=\"currency\"===e.props.type?p():e.props.decimals,e.props.minDecimals&&(d.minimumFractionDigits=e.props.minDecimals,o&&!o.includes(\".\")&&(o+=\".\".padEnd(e.props.minDecimals+1,\"0\"))),0===d.maximumFractionDigits&&o.includes(\".\")&&(o=o.split(\".\")[0]);let c=\"\";if(!isNaN(o)&&\"\"!==o.trim()&&(o=i?`-${o}`:o,e.props.max&&!isNaN(e.props.max)&&(o=Number(o)>e.props.max?`${e.props.max}`:o),e.props.min&&!isNaN(e.props.min)&&(o=Number(o)1&&(f=f.replace(/^0+/,\"\"),f=\"\"!==o&&\"\"===f?\"0\":f)),e.props.valueStore={number:o,integer:f,string:c},t=!0,e.props.valueStore&&(u=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(\"\"===u?void 0:u).then((()=>(t=!1,Promise.resolve())))}function n(){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 r(){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 a(){return e.props.currency?\"currency\":e.props.unit?\"unit\":\"decimal\"}function l(t,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:\"trunc\"},o);return\"unit\"===e.props.type&&(r.unitDisplay=e.props.unitDisplay),\"currency\"===e.props.type&&(r.currencyDisplay=e.props.currencyDisplay),r[n]=e.props[n],new Intl.NumberFormat(t,r)}function i(t,o){var n,s,a,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(s=e.props.unitParts.unit)||void 0===s?void 0:s.length)&&void 0!==a?a:0)+(null!==(i=null===(l=e.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);e.props.unitParts.unitLeft?t=Math.max(t,d):(t=Math.min(t,r().length-d),\"insertText\"===o&&0===t&&(t=1)),p.setSelectionRange(t,t)}function p(){return void 0!==e.props.decimals?e.props.decimals:void 0!==e.props.minDecimals&&e.props.minDecimals>e.props.unitParts.fractionLength?e.props.minDecimals:e.props.unitParts.fractionLength}e.props.valueStore=null,e.on(\"input\",(({payload:e})=>{t||(o(e),n())})),e.context&&(e.context.handlers.init=(t=null)=>{var r;e.props.skipInit?e.props.skipInit=!1:function(){var t,o,n,r,s,a,i;e.props.skipInit=!0;const p=l(e.props.displayLocale).formatToParts(12345678.12345678);e.props.unitParts={decimal:null===(t=p.find((e=>\"decimal\"==e.type)))||void 0===t?void 0:t.value,group:null===(o=p.find((e=>\"group\"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=p.find((e=>[\"unit\",\"currency\"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:[\"unit\",\"currency\"].includes(p[0].type),literal:null!==(s=null===(r=p.find((e=>\"literal\"==e.type)))||void 0===r?void 0:r.value)&&void 0!==s?s:\"\",fractionLength:null!==(i=null===(a=p.find((e=>\"fraction\"==e.type)))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(r=null!=t?t:e._value)&&void 0!==r?r:\"\";e.props.valueStore?s=e.props.valueStore.number:\"integer\"===e.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(\".\",p())}(`${null!=s?s:\"\"}`)),\"unit\"===e.props.type&&e.props.valueUnit&&e.props.unit&&e.props.valueUnit!==e.props.unit&&e.hook.input(((t,o)=>{const n=function(e,t,o){if(pu[e]&&pu[e][o])return t*pu[e][o];if(du[e]&&du[e][o])return du[e][o](t);if(cu[e]&&cu[e][o])return t*cu[e][o];if(uu[e]&&uu[e][o])return t*uu[e][o];if(fu[e]&&fu[e][o])return t*fu[e][o];if(vu[e]&&vu[e][o])return t*vu[e][o];if(hu[e]&&hu[e][o])return t*hu[e][o];throw new Error(\"Conversion not supported\")}(e.props.unit,t,e.props.valueUnit);return isNaN(n)?o(t):o(+n.toFixed(Number(e.props.valueDecimals)||2))})),o(s),n()},e.context.handlers.handleBeforeInput=t=>{var n,r,s,a,l,p,d,c,u;if(!e.props.inExecCommand&&\"insertLineBreak\"!==t.inputType&&(t.preventDefault(),t.stopPropagation(),t.target instanceof HTMLInputElement)){const f=t.target,v=null!==(n=t.data)&&void 0!==n?n:\"\",h=null!==(r=t.target.value)&&void 0!==r?r:\"\",m=null!==(s=t.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=t.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(e.props.unitParts.decimal);let y=(null!==(l=t.target.selectionStart)&&void 0!==l?l:0)+(t.data?0:-1),x=h,w=1;if(h.includes(e.props.unitParts.decimal)&&v===e.props.unitParts.decimal)return v===e.props.unitParts.decimal&&(y=x.indexOf(e.props.unitParts.decimal)+1),void i(y);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&\"-\"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===e.props.unitParts.decimal&&0===e.props.decimals)return;if(\"deleteByCut\"===t.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),\"insertFromPaste\"===t.inputType){const e=null!==(p=t.data)&&void 0!==p?p:\"\";x=x.slice(0,m)+e+x.slice(g)}if(\"deleteContentBackward\"===t.inputType&&h[m-1]===e.props.unitParts.group?(w+=1,y-=1):\"deleteContentForward\"===t.inputType&&h[m]===e.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&\"insertText\"===t.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=t.data)&&void 0!==d?d:\"0\"):\"insertText\"===t.inputType?(y=g,x=x.slice(0,m)+t.data+x.slice(g)):\"deleteContentForward\"===t.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):\"deleteContentBackward\"===t.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),\"deleteContentForward\"===t.inputType&&h[m]===e.props.unitParts.decimal){const t=x.slice(m-1);x=x.slice(0,m),t.includes(e.props.unitParts.unit)&&(x+=\" \"+e.props.unitParts.unit)}else if(\"deleteContentBackward\"===t.inputType&&h[m-1]===e.props.unitParts.decimal){const t=x.slice(m-1);x=x.slice(0,m-1),t.includes(e.props.unitParts.unit)&&(x+=\" \"+e.props.unitParts.unit)}if(o(x),x=(null===(c=e.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=e.props.valueStore)||void 0===u?void 0:u.number)||\"\",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=t.inputType.includes(\"delete\")?-1:1),f.setSelectionRange(0,h.length),e.props.inExecCommand=!0,document.execCommand(\"insertText\",void 0,x),e.props.inExecCommand=!1,v===e.props.unitParts.decimal?y=x.indexOf(e.props.unitParts.decimal)+1:h.includes(e.props.unitParts.decimal)&&!x.includes(e.props.unitParts.decimal)&&(y=x.length),\"insertText\"===t.inputType&&e.props.minDecimals&&(!e.value||0===m&&g===h.length||-1===b&&e.props.minDecimals&&h)){let t=0;t=e.props.unitParts.unit?e.props.unitParts.unit.length+1:0,y-=e.props.minDecimals,e.props.unitParts.unitLeft?y-=t-1:y-=t+1}i(Math.max(0,y),t.inputType)}},e.context.handlers.handleInput=t=>{e.emit(\"dom-input-event\",t),t.target instanceof HTMLInputElement&&(e.props.inputText=t.target.value,o(t.target.value))},e.context.handlers.handleKeyDown=t=>{var s,a;if(t.target instanceof HTMLInputElement&&(\"ArrowUp\"===t.key||\"ArrowDown\"===t.key)){const l=\"ArrowUp\"===t.key?1*e.props.step:-1*e.props.step;o(function(e,t){var o,n,r,s;const a=`${e}`.split(\".\"),l=`${t}`.split(\".\");let i=null!==(o=a[0])&&void 0!==o?o:\"0\",p=null!==(n=l[0])&&void 0!==n?n:\"0\";const d=null!==(r=a[1])&&void 0!==r?r:\"\",c=null!==(s=l[1])&&void 0!==s?s:\"\",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,\"0\"),p+=c.padEnd(u,\"0\"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+\".\"+f.slice(-1*u):f}(null!==(a=null===(s=e.props.valueStore)||void 0===s?void 0:s.number)&&void 0!==a?a:0,l)),n(),setTimeout((()=>{i(r().length)}),1)}})}const gu={schema:/* #__PURE__ */Jc(/* #__PURE__ */eu(/* #__PURE__ */tu(\"$label\"),/* #__PURE__ */Qc(/* #__PURE__ */lu(\"prefix\"),/* #__PURE__ */ou(),/* #__PURE__ */iu(),/* #__PURE__ */nu(),/* #__PURE__ */lu(\"suffix\"))),/* #__PURE__ */ru(\"$help\"),/* #__PURE__ */su(/* #__PURE__ */au(\"$message.value\"))),type:\"input\",family:\"text\",features:[function(e){var t,o,n,r,s,a;const l=[\"unit\",\"decimals\",\"minDecimals\",\"displayLocale\",\"min\",\"max\",\"step\",\"valueFormat\",\"unitDisplay\",\"placeholder\",\"unitParts\",\"valueUnit\",\"valueDecimals\"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||\"en-US\"),e.props.unitDisplay=e.props.unitDisplay||\"short\",\"false\"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat=\"number\"),-1===[\"string\",\"number\"].indexOf(e.props.valueFormat)&&(e.props.valueFormat=\"number\"),e.on(\"created\",(()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\\d+\\,\\s*%?$/;return/\\d+\\.\\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,\"\"),t.target.value=o),e.context&&e.context.handlers.blur(t)},mu(e),e.context.handlers.init(),l.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]},$u=/* #__PURE__ */xe(\"cr\"),{outer:bu,inner:yu,wrapper:xu,label:wu,prefix:_u,suffix:ku,help:Su,messages:Lu,message:Iu,icon:Du}=/* #__PURE__ */we($u),Au=$u(\"input\",(()=>({$el:\"input\",bind:\"$attrs\",attrs:{name:\"$node.name\",autocomplete:\"$attrs.autocomplete || off\",id:\"$id\",onChange:\"$handlers.handleInput\",onBlur:\"$handlers.blur\",onInput:\"$handlers.handleInput\",onKeydown:\"$handlers.handleKeyDown\",onBeforeinput:\"$handlers.handleBeforeInput\",readonly:\"$readonly\",disabled:\"$disabled\",placeholder:\"$placeholder || $unitParts.unit\",inputmode:\"decimal\",\"data-unit\":\"$unit\",\"data-currency\":\"$currency\",\"data-display-locale\":\"$displayLocale\",\"data-value-locale\":\"$valueLocale\",\"data-decimals\":\"$decimals\",\"data-trailing\":\"$trailingZeros\",\"data-numeric-value\":\"$_numericValue\",\"data-align\":\"$_valueAlignAuto\",\"aria-required\":\"$state.required || undefined\"}})));const Cu={schema:/* #__PURE__ */bu(/* #__PURE__ */xu(/* #__PURE__ */wu(\"$label\"),/* #__PURE__ */yu(/* #__PURE__ */Du(\"prefix\"),/* #__PURE__ */_u(),/* #__PURE__ */Au(),/* #__PURE__ */ku(),/* #__PURE__ */Du(\"suffix\"))),/* #__PURE__ */Su(\"$help\"),/* #__PURE__ */Lu(/* #__PURE__ */Iu(\"$message.value\"))),type:\"input\",family:\"text\",props:[\"options\"],features:[function(e){var t,o,n,r,s,a,l,i;const p=[\"currency\",\"decimals\",\"maxDecimals\",\"minDecimals\",\"displayLocale\",\"min\",\"max\",\"step\",\"valueFormat\",\"currencyDisplay\",\"placeholder\",\"unitParts\"];e.addProps(p),e.addProps([\"inputText\"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||\"en-US\"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||\"USD\"),\"false\"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat=\"number\"),-1===[\"string\",\"number\",\"integer\"].indexOf(e.props.valueFormat)&&(e.props.valueFormat=\"number\"),e.on(\"created\",(()=>{e.context&&(mu(e),e.context.handlers.init(),p.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]};var Tu=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:Jr,colorpicker:Ec,currency:Cu,datepicker:jl,dropdown:Ao,mask:Hi,rating:fr,repeater:Dn,slider:Id,taglist:hi,toggle:Zo,togglebuttons:Gc,transferlist:Zp,unit:gu});const Eu=new WeakSet;function Ou(e,t={}){const o=e;try{if(!o)throw new Error(\"FormKitNoKey\");function n(e){}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!J.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Eu.add(o),o.define({...r,schema:n(e)})}},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{ke as $if,Jr as autocomplete,Ec as colorpicker,we as createBaseSections,Ou as createProPlugin,xe as createSectionFactory,Cu as currency,jl as datepicker,Ao as dropdown,Tu as inputs,Hi as mask,fr as rating,Dn as repeater,Id as slider,hi as taglist,Zo as toggle,Gc as togglebuttons,Zp as transferlist,gu as unit};\n","import { FORMKIT_VERSION } from '@formkit/core';\n\n// packages/themes/src/index.ts\nfunction generateClasses(classes) {\n const classesBySectionKey = {};\n Object.keys(classes).forEach((type) => {\n Object.keys(classes[type]).forEach((sectionKey) => {\n if (!classesBySectionKey[sectionKey]) {\n classesBySectionKey[sectionKey] = {\n [type]: classes[type][sectionKey]\n };\n } else {\n classesBySectionKey[sectionKey][type] = classes[type][sectionKey];\n }\n });\n });\n Object.keys(classesBySectionKey).forEach((sectionKey) => {\n const classesObject = classesBySectionKey[sectionKey];\n classesBySectionKey[sectionKey] = function(node, sectionKey2) {\n return addClassesBySection(node, sectionKey2, classesObject);\n };\n });\n return classesBySectionKey;\n}\nfunction addClassesBySection(node, _sectionKey, classesByType) {\n const type = node.props.type;\n const family = node.props.family;\n let classList = \"\";\n if (classesByType.global) {\n classList += classesByType.global + \" \";\n }\n if (classesByType[`family:${family}`]) {\n classList += classesByType[`family:${family}`] + \" \";\n }\n if (classesByType[type]) {\n classList += classesByType[type];\n }\n const listParts = classList.split(\"$reset\");\n if (listParts.length > 1) {\n return `$reset ${listParts[listParts.length - 1].trim()}`;\n }\n return listParts[0].trim();\n}\nvar documentStyles = void 0;\nvar documentThemeLinkTag = null;\nvar themeDidLoad;\nvar themeHasLoaded = false;\nvar themeWasRequested = false;\nvar themeLoaded = /* @__PURE__ */ new Promise((res) => {\n themeDidLoad = () => {\n themeHasLoaded = true;\n res();\n };\n});\nvar isClient = typeof window !== \"undefined\" && typeof fetch !== \"undefined\";\ndocumentStyles = isClient ? /* @__PURE__ */ getComputedStyle(document.documentElement) : void 0;\nvar iconRegistry = {};\nvar iconRequests = {};\nfunction createThemePlugin(theme, icons, iconLoaderUrl, iconLoader) {\n if (icons) {\n Object.assign(iconRegistry, icons);\n }\n if (isClient && !themeWasRequested && documentStyles?.getPropertyValue(\"--formkit-theme\")) {\n themeDidLoad();\n themeWasRequested = true;\n } else if (theme && !themeWasRequested && isClient) {\n loadTheme(theme);\n } else if (!themeWasRequested && isClient) {\n themeDidLoad();\n }\n const themePlugin = function themePlugin2(node) {\n node.addProps([\"iconLoader\", \"iconLoaderUrl\"]);\n node.props.iconHandler = createIconHandler(\n node.props?.iconLoader ? node.props.iconLoader : iconLoader,\n node.props?.iconLoaderUrl ? node.props.iconLoaderUrl : iconLoaderUrl\n );\n loadIconPropIcons(node, node.props.iconHandler);\n node.on(\"created\", () => {\n if (node?.context?.handlers) {\n node.context.handlers.iconClick = (sectionKey) => {\n const clickHandlerProp = `on${sectionKey.charAt(0).toUpperCase()}${sectionKey.slice(1)}IconClick`;\n const handlerFunction = node.props[clickHandlerProp];\n if (handlerFunction && typeof handlerFunction === \"function\") {\n return (e) => {\n return handlerFunction(node, e);\n };\n }\n return void 0;\n };\n }\n if (node?.context?.fns) {\n node.context.fns.iconRole = (sectionKey) => {\n const clickHandlerProp = `on${sectionKey.charAt(0).toUpperCase()}${sectionKey.slice(1)}IconClick`;\n return typeof node.props[clickHandlerProp] === \"function\" ? \"button\" : null;\n };\n }\n });\n };\n themePlugin.iconHandler = createIconHandler(iconLoader, iconLoaderUrl);\n return themePlugin;\n}\nfunction loadTheme(theme) {\n if (!theme || !isClient || typeof getComputedStyle !== \"function\") {\n return;\n }\n themeWasRequested = true;\n documentThemeLinkTag = document.getElementById(\"formkit-theme\");\n if (theme && // if we have a window object\n isClient && // we don't have an existing theme OR the theme being set up is different\n (!documentStyles?.getPropertyValue(\"--formkit-theme\") && !documentThemeLinkTag || documentThemeLinkTag?.getAttribute(\"data-theme\") && documentThemeLinkTag?.getAttribute(\"data-theme\") !== theme)) {\n const formkitVersion = FORMKIT_VERSION.startsWith(\"__\") ? \"latest\" : FORMKIT_VERSION;\n const themeUrl = `https://cdn.jsdelivr.net/npm/@formkit/themes@${formkitVersion}/dist/${theme}/theme.css`;\n const link = document.createElement(\"link\");\n link.type = \"text/css\";\n link.rel = \"stylesheet\";\n link.id = \"formkit-theme\";\n link.setAttribute(\"data-theme\", theme);\n link.onload = () => {\n documentStyles = getComputedStyle(document.documentElement);\n themeDidLoad();\n };\n document.head.appendChild(link);\n link.href = themeUrl;\n if (documentThemeLinkTag) {\n documentThemeLinkTag.remove();\n }\n }\n}\nfunction createIconHandler(iconLoader, iconLoaderUrl) {\n return (iconName) => {\n if (typeof iconName !== \"string\")\n return;\n if (iconName.startsWith(\"