@kvass/widgets 1.3.36 → 1.3.37

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/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import{q as tt,E as so,I as al,r as J,H as At,b as H,o as _,e as it,w as rt,G as Li,c as O,f as z,F as le,a as ut,m as ot,j as Et,a0 as br,d as q,O as yr,z as xr,v as lt,C as Ht,t as ct,A as kr,g as de,Q as ll,i as ge,D as Ei,n as qt,J as ul,y as ve,K as kt,L as Rt,N as Er,$ as cl,M as wr,P as dl,a9 as hl,k as rn,l as pl,B as Cr,a3 as fl,s as oo,R as An,S as gl,U as vl,V as ml,W as _r,a2 as bl,Y as yl,Z as xl}from"./_plugin-vue_export-helper.js";function Sr(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Sr(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}function kl(){for(var t,e,n=0,i="";n<arguments.length;)(t=arguments[n++])&&(e=Sr(t))&&(i&&(i+=" "),i+=e);return i}const ro=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,ao=kl,Ar=(t,e)=>n=>{var i;if(e?.variants==null)return ao(t,n?.class,n?.className);const{variants:s,defaultVariants:o}=e,r=Object.keys(s).map(c=>{const l=n?.[c],d=o?.[c];if(l===null)return null;const h=ro(l)||ro(d);return s[c][h]}),a=n&&Object.entries(n).reduce((c,l)=>{let[d,h]=l;return h===void 0||(c[d]=h),c},{}),u=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((c,l)=>{let{class:d,className:h,...p}=l;return Object.entries(p).every(g=>{let[f,y]=g;return Array.isArray(y)?y.includes({...o,...a}[f]):{...o,...a}[f]===y})?[...c,d,h]:c},[]);return ao(t,r,u,n?.class,n?.className)},an=/^[a-z0-9]+(-[a-z0-9]+)*$/,wi=(t,e,n,i="")=>{const s=t.split(":");if(t.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),u=s.pop(),c={provider:s.length>0?s[0]:i,prefix:u,name:a};return e&&!Vn(c)?null:c}const o=s[0],r=o.split("-");if(r.length>1){const a={provider:i,prefix:r.shift(),name:r.join("-")};return e&&!Vn(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:o};return e&&!Vn(a,n)?null:a}return null},Vn=(t,e)=>t?!!((t.provider===""||t.provider.match(an))&&(e&&t.prefix===""||t.prefix.match(an))&&t.name.match(an)):!1,Tr=Object.freeze({left:0,top:0,width:16,height:16}),Zn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ci=Object.freeze({...Tr,...Zn}),ls=Object.freeze({...Ci,body:"",hidden:!1});function El(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const i=((t.rotate||0)+(e.rotate||0))%4;return i&&(n.rotate=i),n}function lo(t,e){const n=El(t,e);for(const i in ls)i in Zn?i in t&&!(i in n)&&(n[i]=Zn[i]):i in e?n[i]=e[i]:i in t&&(n[i]=t[i]);return n}function wl(t,e){const n=t.icons,i=t.aliases||Object.create(null),s=Object.create(null);function o(r){if(n[r])return s[r]=[];if(!(r in s)){s[r]=null;const a=i[r]&&i[r].parent,u=a&&o(a);u&&(s[r]=[a].concat(u))}return s[r]}return(e||Object.keys(n).concat(Object.keys(i))).forEach(o),s}function Cl(t,e,n){const i=t.icons,s=t.aliases||Object.create(null);let o={};function r(a){o=lo(i[a]||s[a],o)}return r(e),n.forEach(r),lo(t,o)}function Ir(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(s=>{e(s,null),n.push(s)});const i=wl(t);for(const s in i){const o=i[s];o&&(e(s,Cl(t,s,o)),n.push(s))}return n}const _l={provider:"",aliases:{},not_found:{},...Tr};function Bi(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Dr(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!Bi(t,_l))return null;const n=e.icons;for(const s in n){const o=n[s];if(!s.match(an)||typeof o.body!="string"||!Bi(o,ls))return null}const i=e.aliases||Object.create(null);for(const s in i){const o=i[s],r=o.parent;if(!s.match(an)||typeof r!="string"||!n[r]&&!i[r]||!Bi(o,ls))return null}return e}const uo=Object.create(null);function Sl(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Te(t,e){const n=uo[t]||(uo[t]=Object.create(null));return n[e]||(n[e]=Sl(t,e))}function Os(t,e){return Dr(e)?Ir(e,(n,i)=>{i?t.icons[n]=i:t.missing.add(n)}):[]}function Al(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let bn=!1;function Fr(t){return typeof t=="boolean"&&(bn=t),bn}function Tl(t){const e=typeof t=="string"?wi(t,!0,bn):t;if(e){const n=Te(e.provider,e.prefix),i=e.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function Il(t,e){const n=wi(t,!0,bn);if(!n)return!1;const i=Te(n.provider,n.prefix);return Al(i,n.name,e)}function Dl(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),bn&&!e&&!t.prefix){let s=!1;return Dr(t)&&(t.prefix="",Ir(t,(o,r)=>{r&&Il(o,r)&&(s=!0)})),s}const n=t.prefix;if(!Vn({provider:e,prefix:n,name:"a"}))return!1;const i=Te(e,n);return!!Os(i,t)}const Or=Object.freeze({width:null,height:null}),Mr=Object.freeze({...Or,...Zn}),Fl=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ol=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function co(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const i=t.split(Fl);if(i===null||!i.length)return t;const s=[];let o=i.shift(),r=Ol.test(o);for(;;){if(r){const a=parseFloat(o);isNaN(a)?s.push(o):s.push(Math.ceil(a*e*n)/n)}else s.push(o);if(o=i.shift(),o===void 0)return s.join("");r=!r}}const Ml=t=>t==="unset"||t==="undefined"||t==="none";function Rl(t,e){const n={...Ci,...t},i={...Mr,...e},s={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,i].forEach(g=>{const f=[],y=g.hFlip,v=g.vFlip;let k=g.rotate;y?v?k+=2:(f.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),f.push("scale(-1 1)"),s.top=s.left=0):v&&(f.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),f.push("scale(1 -1)"),s.top=s.left=0);let w;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:w=s.height/2+s.top,f.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:f.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:w=s.width/2+s.left,f.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}k%2===1&&(s.left!==s.top&&(w=s.left,s.left=s.top,s.top=w),s.width!==s.height&&(w=s.width,s.width=s.height,s.height=w)),f.length&&(o='<g transform="'+f.join(" ")+'">'+o+"</g>")});const r=i.width,a=i.height,u=s.width,c=s.height;let l,d;r===null?(d=a===null?"1em":a==="auto"?c:a,l=co(d,u/c)):(l=r==="auto"?u:r,d=a===null?co(l,c/u):a==="auto"?c:a);const h={},p=(g,f)=>{Ml(f)||(h[g]=f.toString())};return p("width",l),p("height",d),h.viewBox=s.left.toString()+" "+s.top.toString()+" "+u.toString()+" "+c.toString(),{attributes:h,body:o}}const Pl=/\sid="(\S+)"/g,Ll="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Bl=0;function Nl(t,e=Ll){const n=[];let i;for(;i=Pl.exec(t);)n.push(i[1]);if(!n.length)return t;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const r=typeof e=="function"?e(o):e+(Bl++).toString(),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+s+"$3")}),t=t.replace(new RegExp(s,"g"),""),t}const us=Object.create(null);function jl(t,e){us[t]=e}function cs(t){return us[t]||us[""]}function Ms(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const Rs=Object.create(null),Tn=["https://api.simplesvg.com","https://api.unisvg.com"],ds=[];for(;Tn.length>0;)Tn.length===1||Math.random()>.5?ds.push(Tn.shift()):ds.push(Tn.pop());Rs[""]=Ms({resources:["https://api.iconify.design"].concat(ds)});function Rr(t,e){const n=Ms(e);return n===null?!1:(Rs[t]=n,!0)}function Ps(t){return Rs[t]}const Vl=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let ho=Vl();function $l(t,e){const n=Ps(t);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let s=0;n.resources.forEach(r=>{s=Math.max(s,r.length)});const o=e+".json?icons=";i=n.maxURL-s-n.path.length-o.length}return i}function zl(t){return t===404}const Hl=(t,e,n)=>{const i=[],s=$l(t,e),o="icons";let r={type:o,provider:t,prefix:e,icons:[]},a=0;return n.forEach((u,c)=>{a+=u.length+1,a>=s&&c>0&&(i.push(r),r={type:o,provider:t,prefix:e,icons:[]},a=u.length),r.icons.push(u)}),i.push(r),i};function Gl(t){if(typeof t=="string"){const e=Ps(t);if(e)return e.path}return"/"}const ql=(t,e,n)=>{if(!ho){n("abort",424);return}let i=Gl(e.provider);switch(e.type){case"icons":{const o=e.prefix,r=e.icons.join(","),a=new URLSearchParams({icons:r});i+=o+".json?"+a.toString();break}case"custom":{const o=e.uri;i+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let s=503;ho(t+i).then(o=>{const r=o.status;if(r!==200){setTimeout(()=>{n(zl(r)?"abort":"next",r)});return}return s=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",s)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",s)})},Ul={prepare:Hl,send:ql};function Wl(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((s,o)=>s.provider!==o.provider?s.provider.localeCompare(o.provider):s.prefix!==o.prefix?s.prefix.localeCompare(o.prefix):s.name.localeCompare(o.name));let i={provider:"",prefix:"",name:""};return t.forEach(s=>{if(i.name===s.name&&i.prefix===s.prefix&&i.provider===s.provider)return;i=s;const o=s.provider,r=s.prefix,a=s.name,u=n[o]||(n[o]=Object.create(null)),c=u[r]||(u[r]=Te(o,r));let l;a in c.icons?l=e.loaded:r===""||c.missing.has(a)?l=e.missing:l=e.pending;const d={provider:o,prefix:r,name:a};l.push(d)}),e}function Pr(t,e){t.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(s=>s.id!==e))})}function Xl(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const i=t.provider,s=t.prefix;e.forEach(o=>{const r=o.icons,a=r.pending.length;r.pending=r.pending.filter(u=>{if(u.prefix!==s)return!0;const c=u.name;if(t.icons[c])r.loaded.push({provider:i,prefix:s,name:c});else if(t.missing.has(c))r.missing.push({provider:i,prefix:s,name:c});else return n=!0,!0;return!1}),r.pending.length!==a&&(n||Pr([t],o.id),o.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),o.abort))})}))}let Yl=0;function Kl(t,e,n){const i=Yl++,s=Pr.bind(null,n,i);if(!e.pending.length)return s;const o={id:i,icons:e,callback:t,abort:s};return n.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(o)}),s}function Zl(t,e=!0,n=!1){const i=[];return t.forEach(s=>{const o=typeof s=="string"?wi(s,e,n):s;o&&i.push(o)}),i}var Jl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ql(t,e,n,i){const s=t.resources.length,o=t.random?Math.floor(Math.random()*s):t.index;let r;if(t.random){let D=t.resources.slice(0);for(r=[];D.length>1;){const W=Math.floor(Math.random()*D.length);r.push(D[W]),D=D.slice(0,W).concat(D.slice(W+1))}r=r.concat(D)}else r=t.resources.slice(o).concat(t.resources.slice(0,o));const a=Date.now();let u="pending",c=0,l,d=null,h=[],p=[];typeof i=="function"&&p.push(i);function g(){d&&(clearTimeout(d),d=null)}function f(){u==="pending"&&(u="aborted"),g(),h.forEach(D=>{D.status==="pending"&&(D.status="aborted")}),h=[]}function y(D,W){W&&(p=[]),typeof D=="function"&&p.push(D)}function v(){return{startTime:a,payload:e,status:u,queriesSent:c,queriesPending:h.length,subscribe:y,abort:f}}function k(){u="failed",p.forEach(D=>{D(void 0,l)})}function w(){h.forEach(D=>{D.status==="pending"&&(D.status="aborted")}),h=[]}function T(D,W,x){const b=W!=="success";switch(h=h.filter(m=>m!==D),u){case"pending":break;case"failed":if(b||!t.dataAfterTimeout)return;break;default:return}if(W==="abort"){l=x,k();return}if(b){l=x,h.length||(r.length?M():k());return}if(g(),w(),!t.random){const m=t.resources.indexOf(D.resource);m!==-1&&m!==t.index&&(t.index=m)}u="completed",p.forEach(m=>{m(x)})}function M(){if(u!=="pending")return;g();const D=r.shift();if(D===void 0){if(h.length){d=setTimeout(()=>{g(),u==="pending"&&(w(),k())},t.timeout);return}k();return}const W={status:"pending",resource:D,callback:(x,b)=>{T(W,x,b)}};h.push(W),c++,d=setTimeout(M,t.rotate),n(D,e,W.callback)}return setTimeout(M),v}function Lr(t){const e={...Jl,...t};let n=[];function i(){n=n.filter(r=>r().status==="pending")}function s(r,a,u){const c=Ql(e,r,a,(l,d)=>{i(),u&&u(l,d)});return n.push(c),c}function o(r){return n.find(a=>r(a))||null}return{query:s,find:o,setIndex:r=>{e.index=r},getIndex:()=>e.index,cleanup:i}}function po(){}const Ni=Object.create(null);function tu(t){if(!Ni[t]){const e=Ps(t);if(!e)return;const n=Lr(e),i={config:e,redundancy:n};Ni[t]=i}return Ni[t]}function eu(t,e,n){let i,s;if(typeof t=="string"){const o=cs(t);if(!o)return n(void 0,424),po;s=o.send;const r=tu(t);r&&(i=r.redundancy)}else{const o=Ms(t);if(o){i=Lr(o);const r=t.resources?t.resources[0]:"",a=cs(r);a&&(s=a.send)}}return!i||!s?(n(void 0,424),po):i.query(e,s,n)().abort}const fo="iconify2",yn="iconify",Br=yn+"-count",go=yn+"-version",Nr=36e5,nu=168;function hs(t,e){try{return t.getItem(e)}catch{}}function Ls(t,e,n){try{return t.setItem(e,n),!0}catch{}}function vo(t,e){try{t.removeItem(e)}catch{}}function ps(t,e){return Ls(t,Br,e.toString())}function fs(t){return parseInt(hs(t,Br))||0}const _i={local:!0,session:!0},jr={local:new Set,session:new Set};let Bs=!1;function iu(t){Bs=t}let In=typeof window>"u"?{}:window;function Vr(t){const e=t+"Storage";try{if(In&&In[e]&&typeof In[e].length=="number")return In[e]}catch{}_i[t]=!1}function $r(t,e){const n=Vr(t);if(!n)return;const i=hs(n,go);if(i!==fo){if(i){const a=fs(n);for(let u=0;u<a;u++)vo(n,yn+u.toString())}Ls(n,go,fo),ps(n,0);return}const s=Math.floor(Date.now()/Nr)-nu,o=a=>{const u=yn+a.toString(),c=hs(n,u);if(typeof c=="string"){try{const l=JSON.parse(c);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>s&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&e(l,a))return!0}catch{}vo(n,u)}};let r=fs(n);for(let a=r-1;a>=0;a--)o(a)||(a===r-1?(r--,ps(n,r)):jr[t].add(a))}function zr(){if(!Bs){iu(!0);for(const t in _i)$r(t,e=>{const n=e.data,i=e.provider,s=n.prefix,o=Te(i,s);if(!Os(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function su(t,e){const n=t.lastModifiedCached;if(n&&n>=e)return n===e;if(t.lastModifiedCached=e,n)for(const i in _i)$r(i,s=>{const o=s.data;return s.provider!==t.provider||o.prefix!==t.prefix||o.lastModified===e});return!0}function ou(t,e){Bs||zr();function n(i){let s;if(!_i[i]||!(s=Vr(i)))return;const o=jr[i];let r;if(o.size)o.delete(r=Array.from(o).shift());else if(r=fs(s),!ps(s,r+1))return;const a={cached:Math.floor(Date.now()/Nr),provider:t.provider,data:e};return Ls(s,yn+r.toString(),JSON.stringify(a))}e.lastModified&&!su(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),n("local")||n("session"))}function mo(){}function ru(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Xl(t)}))}function au(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:i}=t,s=t.iconsToLoad;delete t.iconsToLoad;let o;!s||!(o=cs(n))||o.prepare(n,i,s).forEach(r=>{eu(n,r,a=>{if(typeof a!="object")r.icons.forEach(u=>{t.missing.add(u)});else try{const u=Os(t,a);if(!u.length)return;const c=t.pendingIcons;c&&u.forEach(l=>{c.delete(l)}),ou(t,a)}catch(u){console.error(u)}ru(t)})})}))}const lu=(t,e)=>{const n=Zl(t,!0,Fr()),i=Wl(n);if(!i.pending.length){let u=!0;return e&&setTimeout(()=>{u&&e(i.loaded,i.missing,i.pending,mo)}),()=>{u=!1}}const s=Object.create(null),o=[];let r,a;return i.pending.forEach(u=>{const{provider:c,prefix:l}=u;if(l===a&&c===r)return;r=c,a=l,o.push(Te(c,l));const d=s[c]||(s[c]=Object.create(null));d[l]||(d[l]=[])}),i.pending.forEach(u=>{const{provider:c,prefix:l,name:d}=u,h=Te(c,l),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(d)||(p.add(d),s[c][l].push(d))}),o.forEach(u=>{const{provider:c,prefix:l}=u;s[c][l].length&&au(u,s[c][l])}),e?Kl(e,i,o):mo};function uu(t,e){const n={...t};for(const i in e){const s=e[i],o=typeof s;i in Or?(s===null||s&&(o==="string"||o==="number"))&&(n[i]=s):o===typeof n[i]&&(n[i]=i==="rotate"?s%4:s)}return n}const cu=/[\s,]+/;function du(t,e){e.split(cu).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function hu(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function i(s){for(;s<0;)s+=4;return s%4}if(n===""){const s=parseInt(t);return isNaN(s)?0:i(s)}else if(n!==t){let s=0;switch(n){case"%":s=25;break;case"deg":s=90}if(s){let o=parseFloat(t.slice(0,t.length-n.length));return isNaN(o)?0:(o=o/s,o%1===0?i(o):0)}}return e}function pu(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)n+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function fu(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function gu(t){return"data:image/svg+xml,"+fu(t)}function vu(t){return'url("'+gu(t)+'")'}const bo={...Mr,inline:!1},mu={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},bu={display:"inline-block"},gs={backgroundColor:"currentColor"},Hr={backgroundColor:"transparent"},yo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},xo={webkitMask:gs,mask:gs,background:Hr};for(const t in xo){const e=xo[t];for(const n in yo)e[t+n]=yo[n]}const $n={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";$n[t+"-flip"]=e,$n[t.slice(0,1)+"-flip"]=e,$n[t+"Flip"]=e});function ko(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const Eo=(t,e)=>{const n=uu(bo,e),i={...mu},s=e.mode||"svg",o={},r=e.style,a=typeof r=="object"&&!(r instanceof Array)?r:{};for(let f in e){const y=e[f];if(y!==void 0)switch(f){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[f]=y===!0||y==="true"||y===1;break;case"flip":typeof y=="string"&&du(n,y);break;case"color":o.color=y;break;case"rotate":typeof y=="string"?n[f]=hu(y):typeof y=="number"&&(n[f]=y);break;case"ariaHidden":case"aria-hidden":y!==!0&&y!=="true"&&delete i["aria-hidden"];break;default:{const v=$n[f];v?(y===!0||y==="true"||y===1)&&(n[v]=!0):bo[f]===void 0&&(i[f]=y)}}}const u=Rl(t,n),c=u.attributes;if(n.inline&&(o.verticalAlign="-0.125em"),s==="svg"){i.style={...o,...a},Object.assign(i,c);let f=0,y=e.id;return typeof y=="string"&&(y=y.replace(/-/g,"_")),i.innerHTML=Nl(u.body,y?()=>y+"ID"+f++:"iconifyVue"),oo("svg",i)}const{body:l,width:d,height:h}=t,p=s==="mask"||(s==="bg"?!1:l.indexOf("currentColor")!==-1),g=pu(l,{...c,width:d+"",height:h+""});return i.style={...o,"--svg":vu(g),width:ko(c.width),height:ko(c.height),...bu,...p?gs:Hr,...a},oo("span",i)};Fr(!0);jl("",Ul);if(typeof document<"u"&&typeof window<"u"){zr();const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Dl(i))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const i="IconifyProviders["+n+"] is invalid.";try{const s=e[n];if(typeof s!="object"||!s||s.resources===void 0)continue;Rr(n,s)||console.error(i)}catch{console.error(i)}}}}const yu={...Ci,body:""},ze=tt({inheritAttrs:!1,data(){return{iconMounted:!1,counter:0}},mounted(){this._name="",this._loadingIcon=null,this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(t,e){if(typeof t=="object"&&t!==null&&typeof t.body=="string")return this._name="",this.abortLoading(),{data:t};let n;if(typeof t!="string"||(n=wi(t,!1,!0))===null)return this.abortLoading(),null;const i=Tl(n);if(!i)return(!this._loadingIcon||this._loadingIcon.name!==t)&&(this.abortLoading(),this._name="",i!==null&&(this._loadingIcon={name:t,abort:lu([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==t&&(this._name=t,e&&e(t));const s=["iconify"];return n.prefix!==""&&s.push("iconify--"+n.prefix),n.provider!==""&&s.push("iconify--"+n.provider),{data:i,classes:s}}},render(){this.counter;const t=this.$attrs,e=this.iconMounted?this.getIcon(t.icon,t.onLoad):null;if(!e)return Eo(yu,t);let n=t;return e.classes&&(n={...t,class:(typeof t.class=="string"?t.class+" ":"")+e.classes.join(" ")}),Eo({...Ci,...e.data},n)}});Rr("",{resources:["https://icons.ui.kvass.no"]});function xu(t){return!t||typeof t!="object"?!1:typeof t.then=="function"&&typeof t.catch=="function"}const ku=["xxs","xs","sm","default","lg","xl","xxl","3xl","4xl"],Eu=(t,e)=>e==="default"?`var(--k-ui-${t})`:`var(--k-ui-${t}-${e})`,Jn=t=>{switch(t){case"start":case"end":return`flex-${t}`;default:return t}},Ns=(t,e="spacing")=>t.split(" ").map(n=>typeof n=="number"||typeof n=="string"&&n.match(/^\d+$/)?`${n}rem`:typeof n=="string"&&ku.includes(n)?Eu(e,n):n).join(" ");function wu(){var t=new Date().getTime(),e=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var i=Math.random()*16;return t>0?(i=(t+i)%16|0,t=Math.floor(t/16)):(i=(e+i)%16|0,e=Math.floor(e/16)),(n==="x"?i:i&3|8).toString(16)})}const Gr=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,i])=>[`--k-${t}-${n}`,i])),qr=tt({__name:"Spinner",props:{size:{default:"medium"}},setup(t){return(e,n)=>(_(),O("span",{class:qt(`k-spinner k-spinner--size-${e.size}`)},null,2))}}),Cu={class:"k-button__content"},_u={key:0,class:"k-button__icon k-button__icon--left"},Su={key:1,class:"k-button__icon k-button__icon--right"},Au={key:2,class:"k-button__confirm-label"},he=tt({__name:"Button",props:{variant:{default:"secondary"},size:{default:"medium"},loading:{type:Boolean},promise:{},confirm:{type:Boolean},is:{type:[String,Object,Function],default:"button"},stateTimeout:{default:1e3},confirmLabel:{default:"Are you sure?"},label:{},icon:{},iconLeft:{},iconRight:{}},emits:["idle","loading","success","error","confirm","click"],setup(t,{emit:e}){const n=t,i={success:"success",confirm:"warning",error:"danger",loading:null,idle:null},s=H(()=>!d.value||u.value==="loading"?n.variant:u.value=="confirm"?"warning":i[u.value]||n.variant),o=H(()=>n.loading||u.value==="loading"),r=J(),a=H(()=>{if(u.value)return["error","success"].includes(u.value)||o.value}),u=J("idle"),c=J(),l=J(),d=H(()=>u.value||o.value),h=H(()=>["error","success"].includes(u.value)),p=H(()=>u.value==="success"?"fa-pro-regular:check":"fa-pro-regular:exclamation-circle");function g(T){if(!T)return;f(),l.value=T,r.value=setTimeout(()=>u.value="loading",100);let M=D=>{f(),n.stateTimeout?(u.value=D,c.value=setTimeout(()=>{f(),e(D)},n.stateTimeout)):e(D)};l.value.then(()=>M("success")).catch(()=>M("error"))}function f(){r.value&&clearTimeout(r.value),c.value&&clearTimeout(c.value),l.value=null,u.value="idle"}At(()=>n.promise,T=>{T&&xu(T)&&g(T)});const y=J(),v=H(()=>u.value==="confirm");function k(T){if(n.confirm&&u.value!=="confirm")return u.value="confirm";f(),e("click",T)}const w=Ar("k-button",{variants:{variant:{primary:"k-button--variant-primary",secondary:"k-button--variant-secondary",tertiary:"k-button--variant-tertiary",danger:"k-button--variant-danger",warning:"k-button--variant-warning",success:"k-button--variant-success"},size:{small:"k-button--size-small",medium:"k-button--size-medium",large:"k-button--size-large"},isLoading:{true:"k-button--loading"},isBusy:{true:"k-button--busy"}}});return(T,M)=>(_(),it(de(T.is),ot({type:"button",class:lt(w)({variant:s.value,size:T.size,isLoading:o.value,isBusy:a.value}),"aria-busy":a.value,inert:a.value},T.$attrs,{onClick:k,ref_key:"rootElement",ref:y}),{default:rt(()=>[xr(ut("span",Cu,[T.icon||T.iconLeft||T.$slots.icon||T.$slots["icon-left"]?(_(),O("span",_u,[z(T.$slots,"icon-left",{},()=>[z(T.$slots,"icon",{},()=>[Et(lt(ze),{icon:T.icon||T.iconLeft},null,8,["icon"])])])])):q("",!0),z(T.$slots,"default",{},()=>[Ht(ct(T.label),1)]),T.iconRight||T.$slots["icon-right"]?(_(),O("span",Su,[z(T.$slots,"icon-right",{},()=>[Et(lt(ze),{icon:T.iconRight},null,8,["icon"])])])):q("",!0)],512),[[kr,!v.value]]),o.value?(_(),it(qr,{key:0})):q("",!0),h.value?(_(),it(lt(ze),{key:1,class:"k-button__state-indicator",icon:p.value},null,8,["icon"])):q("",!0),v.value?(_(),O("span",Au,ct(T.confirmLabel),1)):q("",!0)]),_:3},16,["class","aria-busy","inert"]))}});var ue=(t,e=[])=>({parts:(...n)=>{if(Tu(e))return ue(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>ue(t,[...e,...n]),rename:n=>ue(n,e),keys:()=>e,build:()=>[...new Set(e)].reduce((n,i)=>Object.assign(n,{[i]:{selector:[`&[data-scope="${Re(t)}"][data-part="${Re(i)}"]`,`& [data-scope="${Re(t)}"][data-part="${Re(i)}"]`].join(", "),attrs:{"data-scope":Re(t),"data-part":Re(i)}}}),{})}),Re=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Tu=t=>t.length===0,gt=t=>t?"":void 0,Dn=t=>t?"true":void 0;function Qn(t){return typeof t=="object"&&t?.nodeType===Node.ELEMENT_NODE&&typeof t?.nodeName=="string"}function ti(t,e){return!t||!e||!Qn(t)||!Qn(e)?!1:t===e||t.contains(e)}var Iu=t=>t.nodeType===Node.DOCUMENT_NODE?t:t.ownerDocument??document;function En(t){const e={getRootNode:n=>{var i;return((i=n.getRootNode)==null?void 0:i.call(n))??document},getDoc:n=>Iu(e.getRootNode(n)),getWin:n=>e.getDoc(n).defaultView??window,getActiveElement:n=>e.getDoc(n).activeElement,getById:(n,i)=>e.getRootNode(n).getElementById(i),setValue:(n,i)=>{n==null||i==null||(n.value=i.toString())}};return{...e,...t}}var Du=t=>t.nodeType===Node.DOCUMENT_NODE;function js(t){return Du(t)?t:t?.ownerDocument??document}function Fu(t){return t?.ownerDocument.defaultView??window}function ei(t){var e;return((e=t.composedPath)==null?void 0:e.call(t)[0])??t.target}var Ur=()=>typeof document<"u";function Ou(){const t=navigator.userAgentData;return t?.platform??navigator.platform}var Wr=t=>Ur()&&t.test(Ou()),Mu=()=>Ur()&&!!navigator.maxTouchPoints,Ru=()=>Wr(/^Mac/)&&!Mu(),Pu=()=>Wr(/mac|iphone|ipad|ipod/i),Lu=()=>Pu()&&!Ru();function Xr(t,e){return Array.from(t?.querySelectorAll(e)??[])}function Yr(t){const e=new Set;function n(i){const s=globalThis.requestAnimationFrame(i);e.add(()=>globalThis.cancelAnimationFrame(s))}return n(()=>n(t)),function(){e.forEach(i=>i())}}function xn(t){const e=globalThis.requestAnimationFrame(t);return()=>{globalThis.cancelAnimationFrame(e)}}var Kr={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};const Bu=Symbol(),wo=Object.getPrototypeOf,vs=new WeakMap,Nu=t=>t&&(vs.has(t)?vs.get(t):wo(t)===Object.prototype||wo(t)===Array.prototype),Zr=t=>Nu(t)&&t[Bu]||null,ni=(t,e=!0)=>{vs.set(t,e)};var ji=t=>typeof t=="object"&&t!==null,Ee=new WeakMap,tn=new WeakSet,ju=(t=Object.is,e=(c,l)=>new Proxy(c,l),n=c=>ji(c)&&!tn.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),i=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},s=new WeakMap,o=(c,l,d=i)=>{const h=s.get(c);if(h?.[0]===l)return h[1];const p=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return ni(p,!0),s.set(c,[l,p]),Reflect.ownKeys(c).forEach(g=>{const f=Reflect.get(c,g);tn.has(f)?(ni(f,!1),p[g]=f):f instanceof Promise?Object.defineProperty(p,g,{get(){return d(f)}}):Ee.has(f)?p[g]=Ue(f,d):p[g]=f}),Object.freeze(p)},r=new WeakMap,a=[1,1],u=c=>{if(!ji(c))throw new Error("object required");const l=r.get(c);if(l)return l;let d=a[0];const h=new Set,p=(x,b=++a[0])=>{d!==b&&(d=b,h.forEach(m=>m(x,b)))};let g=a[1];const f=(x=++a[1])=>(g!==x&&!h.size&&(g=x,v.forEach(([b])=>{const m=b[1](x);m>d&&(d=m)})),d),y=x=>(b,m)=>{const E=[...b];E[1]=[x,...E[1]],p(E,m)},v=new Map,k=(x,b)=>{if(h.size){const m=b[3](y(x));v.set(x,[b,m])}else v.set(x,[b])},w=x=>{var b;const m=v.get(x);m&&(v.delete(x),(b=m[1])==null||b.call(m))},T=x=>(h.add(x),h.size===1&&v.forEach(([b,m],E)=>{const F=b[3](y(E));v.set(E,[b,F])}),()=>{h.delete(x),h.size===0&&v.forEach(([b,m],E)=>{m&&(m(),v.set(E,[b]))})}),M=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),D=e(M,{deleteProperty(x,b){const m=Reflect.get(x,b);w(b);const E=Reflect.deleteProperty(x,b);return E&&p(["delete",[b],m]),E},set(x,b,m,E){var F;const $=Reflect.has(x,b),N=Reflect.get(x,b,E);if($&&(t(N,m)||r.has(m)&&t(N,r.get(m))))return!0;w(b),ji(m)&&(m=Zr(m)||m);let B=m;if(!((F=Object.getOwnPropertyDescriptor(x,b))!=null&&F.set))if(m instanceof Promise)m.then(P=>{m.status="fulfilled",m.value=P,p(["resolve",[b],P])}).catch(P=>{m.status="rejected",m.reason=P,p(["reject",[b],P])});else{!Ee.has(m)&&n(m)&&(B=Vs(m));const P=!tn.has(B)&&Ee.get(B);P&&k(b,P)}return Reflect.set(x,b,B,E),p(["set",[b],m,N]),!0}});r.set(c,D);const W=[M,f,o,T];return Ee.set(D,W),Reflect.ownKeys(c).forEach(x=>{const b=Object.getOwnPropertyDescriptor(c,x);b.get||b.set?Object.defineProperty(M,x,b):D[x]=c[x]}),D})=>[u,Ee,tn,t,e,n,i,s,o,r,a],[Vu]=ju();function Vs(t={}){return Vu(t)}function ms(t,e,n){const i=Ee.get(t);let s;const o=[],r=i[3];let a=!1;const u=r(c=>{if(o.push(c),n){e(o.splice(0));return}s||(s=Promise.resolve().then(()=>{s=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,u()}}function Ue(t,e){const n=Ee.get(t),[i,s,o]=n;return o(i,s(),e)}function Co(t){return tn.add(t),t}function $u(t,e){Object.keys(e).forEach(i=>{if(Object.getOwnPropertyDescriptor(t,i))throw new Error("object property already defined");const s=e[i],{get:o,set:r}=typeof s=="function"?{get:s}:s,a={};a.get=()=>o(Ue(n)),r&&(a.set=u=>r(n,u)),Object.defineProperty(t,i,a)});const n=Vs(t);return n}var zu=(t,e)=>Object.is(t,e);function _o(t,e,n,i,s){let o=Reflect.get(Ue(t),e);const r=s||zu;function a(){const u=Ue(t);r(o,u[e])||(n(u[e]),o=Reflect.get(u,e))}return ms(t,a,i)}function So(t,e,n){typeof n.value=="object"&&(n.value=_e(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function _e(t){if(typeof t!="object")return t;var e=0,n,i,s,o=Object.prototype.toString.call(t);if(o==="[object Object]"?s=Object.create(t.__proto__||null):o==="[object Array]"?s=Array(t.length):o==="[object Set]"?(s=new Set,t.forEach(function(r){s.add(_e(r))})):o==="[object Map]"?(s=new Map,t.forEach(function(r,a){s.set(_e(a),_e(r))})):o==="[object Date]"?s=new Date(+t):o==="[object RegExp]"?s=new RegExp(t.source,t.flags):o==="[object DataView]"?s=new t.constructor(_e(t.buffer)):o==="[object ArrayBuffer]"?s=t.slice(0):o.slice(-6)==="Array]"&&(s=new t.constructor(t)),s){for(i=Object.getOwnPropertySymbols(t);e<i.length;e++)So(s,i[e],Object.getOwnPropertyDescriptor(t,i[e]));for(e=0,i=Object.getOwnPropertyNames(t);e<i.length;e++)Object.hasOwnProperty.call(s,n=i[e])&&s[n]===t[n]||So(s,n,Object.getOwnPropertyDescriptor(t,n))}return s||t}var Hu=Object.defineProperty,Gu=(t,e,n)=>e in t?Hu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e,n)=>(Gu(t,typeof e!="symbol"?e+"":e,n),n);function qu(t){for(;t.length>0;)t.pop();return t}var Ao=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,Xt=t=>t,Vi=()=>{},Uu=(()=>{let t=0;return()=>(t++,t.toString(36))})(),ln=t=>Array.isArray(t),un=t=>!(t==null||typeof t!="object"||ln(t)),Wu=t=>typeof t=="number"&&!Number.isNaN(t),zt=t=>typeof t=="string",ii=t=>typeof t=="function";function si(t){if(!Xu(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(i=>typeof i=="string"),n={};for(const i of e){const s=t[i];s!==void 0&&(n[i]=si(s))}return n}var Xu=t=>t&&typeof t=="object"&&t.constructor===Object;function $i(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function zn(...t){const e=t.length===1?t[0]:t[1];t.length!==2||t[0]}function Jr(t,...e){for(const n of e){const i=si(n);for(const s in i)un(n[s])?(t[s]||(t[s]={}),Jr(t[s],n[s])):t[s]=n[s]}return t}function To(t){return _e(t)}function vt(t){return zt(t)?{type:t}:t}function ie(t){return t?ln(t)?t.slice():[t]:[]}function Qr(t){return un(t)&&t.predicate!=null}var Yu=()=>!0;function $s(t,e,n,i){return s=>{var o;return zt(s)?!!((o=t[s])!=null&&o.call(t,e,n,i)):ii(s)?s(e,n,i):s.predicate(t)(e,n,i)}}function Ku(...t){return{predicate:e=>(n,i,s)=>t.map($s(e,n,i,s)).some(Boolean)}}function Zu(...t){return{predicate:e=>(n,i,s)=>t.map($s(e,n,i,s)).every(Boolean)}}function Ju(t){return{predicate:e=>(n,i,s)=>!$s(e,n,i,s)(t)}}function Qu(...t){return(e,n,i)=>i.state.matches(...t)}var ta={or:Ku,and:Zu,not:Ju,stateIn:Qu};function ea(t,e){return t=t??Yu,(n,i,s)=>{if(zt(t)){const o=e[t];return ii(o)?o(n,i,s):o}return Qr(t)?t.predicate(e)(n,i,s):t?.(n,i,s)}}function zi(t,e){return(n,i,s)=>Qr(t)?t.predicate(e)(n,i,s):t}function tc(t){const e=t.computed??Xt({}),n=t.context??Xt({}),i=Vs({value:t.initial??"",previousValue:"",event:Xt({}),previousEvent:Xt({}),context:$u(n,e),done:!1,tags:[],hasTag(s){return this.tags.includes(s)},matches(...s){return s.includes(this.value)},can(s){return Xt(this).nextEvents.includes(s)},get nextEvents(){var s,o;const r=((o=(s=t.states)==null?void 0:s[this.value])==null?void 0:o.on)??{},a=t?.on??{};return Object.keys({...r,...a})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return Xt(i)}function Fn(t,e){return(n,i)=>{if(Wu(t))return t;if(ii(t))return t(n,i);if(zt(t)){const s=Number.parseFloat(t);if(!Number.isNaN(s))return s;if(e){const o=e?.[t];return zn(o==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${t}\`. It doesn't exist in \`options.delays\``),ii(o)?o(n,i):o}}}}function ec(t){return zt(t)?{target:t}:t}function nc(t,e){return(n,i,s)=>ie(t).map(ec).find(o=>ea(o.guard,e)(n,i,s)??o.target??o.actions)}var ic=class na{constructor(e,n){var i,s,o,r,a,u;A(this,"status","Not Started"),A(this,"state"),A(this,"initialState"),A(this,"initialContext"),A(this,"id"),A(this,"type","machine"),A(this,"activityEvents",new Map),A(this,"delayedEvents",new Map),A(this,"stateListeners",new Set),A(this,"contextListeners",new Set),A(this,"eventListeners",new Set),A(this,"doneListeners",new Set),A(this,"contextWatchers",new Set),A(this,"removeStateListener",Vi),A(this,"removeEventListener",Vi),A(this,"removeContextListener",Vi),A(this,"parent"),A(this,"children",new Map),A(this,"guardMap"),A(this,"actionMap"),A(this,"delayMap"),A(this,"activityMap"),A(this,"sync"),A(this,"options"),A(this,"config"),A(this,"start",l=>{if(this.state.value="",this.status==="Running")return this;this.status="Running",this.removeStateListener=ms(this.state,()=>{this.stateListeners.forEach(y=>{y(this.stateSnapshot)})},this.sync),this.removeEventListener=_o(this.state,"event",y=>{this.executeActions(this.config.onEvent,y),this.eventListeners.forEach(v=>{v(y)})},this.sync),this.removeContextListener=ms(this.state.context,()=>{this.log("Context:",this.contextSnapshot),this.contextListeners.forEach(y=>{y(this.contextSnapshot)})},this.sync||this.options.debug),this.setupContextWatchers(),this.executeActivities(vt("machine.start"),ie(this.config.activities),"machine.start"),this.executeActions(this.config.entry,vt("machine.start"));const d=vt("machine.init"),h=un(l)?l.value:l,p=un(l)?l.context:void 0;p&&this.setContext(p);const g={target:h??this.config.initial},f=this.getNextStateInfo(g,d);return this.initialState=f,this.performStateChangeEffects(this.state.value,f,d),this}),A(this,"setupContextWatchers",()=>{var l;for(const[d,h]of Object.entries(this.config.watch??{})){const p=(l=this.options.compareFns)==null?void 0:l[d],g=_o(this.state.context,d,()=>{this.executeActions(h,this.state.event)},this.sync,p);this.contextWatchers.add(g)}}),A(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,vt("machine.stop")),this.executeActions(this.config.exit,vt("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.stopEventListeners(),this.stopContextListeners(),this.status="Stopped",this}),A(this,"stopEventListeners",()=>{this.eventListeners.clear(),this.removeEventListener()}),A(this,"stopContextListeners",()=>{this.contextListeners.clear(),this.removeContextListener()}),A(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),A(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(l=>l()),this.contextWatchers.clear()}),A(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(l=>{l.forEach(d=>d())}),this.delayedEvents.clear()}),A(this,"stopActivities",l=>{var d,h;l?((d=this.activityEvents.get(l))==null||d.forEach(p=>p()),(h=this.activityEvents.get(l))==null||h.clear(),this.activityEvents.delete(l)):(this.activityEvents.forEach(p=>{p.forEach(g=>g()),p.clear()}),this.activityEvents.clear())}),A(this,"sendChild",(l,d)=>{const h=vt(l),p=Ao(d,this.contextSnapshot),g=this.children.get(p);g||zn(`[@zag-js/core] Cannot send '${h.type}' event to unknown child`),g.send(h)}),A(this,"stopChild",l=>{this.children.has(l)||zn(`[@zag-js/core > stop-child] Cannot stop unknown child ${l}`),this.children.get(l).stop(),this.children.delete(l)}),A(this,"removeChild",l=>{this.children.delete(l)}),A(this,"stopChildren",()=>{this.children.forEach(l=>l.stop()),this.children.clear()}),A(this,"setParent",l=>{this.parent=l}),A(this,"spawn",(l,d)=>{const h=Ao(l);return d&&(h.id=d),h.type="machine.actor",h.setParent(this),this.children.set(h.id,Xt(h)),h.onDone(()=>{this.removeChild(h.id)}).start(),Xt(Co(h))}),A(this,"addActivityCleanup",(l,d)=>{var h;l&&(this.activityEvents.has(l)?(h=this.activityEvents.get(l))==null||h.add(d):this.activityEvents.set(l,new Set([d])))}),A(this,"setState",l=>{this.state.previousValue=this.state.value,this.state.value=l;const d=this.getStateNode(l);l==null?qu(this.state.tags):this.state.tags=ie(d?.tags)}),A(this,"transformContext",l=>{var d,h;return(h=(d=this.options)==null?void 0:d.transformContext)==null||h.call(d,l),l}),A(this,"setContext",l=>{l&&Jr(this.state.context,this.transformContext(l))}),A(this,"withContext",l=>{const d=this.transformContext(l),h={...this.config.context,...si(d)};return new na({...this.config,context:h},this.options)}),A(this,"setOptions",l=>{const d=si(l);this.actionMap={...this.actionMap,...d.actions},this.delayMap={...this.delayMap,...d.delays},this.activityMap={...this.activityMap,...d.activities},this.guardMap={...this.guardMap,...d.guards}}),A(this,"getStateNode",l=>{var d;if(l)return(d=this.config.states)==null?void 0:d[l]}),A(this,"getNextStateInfo",(l,d)=>{const h=this.determineTransition(l,d),p=!(h!=null&&h.target),g=h?.target??this.state.value,f=this.state.value!==g,y=this.getStateNode(g),v={reenter:!p&&!f&&!(h!=null&&h.internal),transition:h,stateNode:y,target:g,changed:f};return this.log("NextState:",`[${d.type}]`,this.state.value,"---->",v.target),v}),A(this,"getActionFromDelayedTransition",l=>{const d=vt("machine.after"),h=Fn(l.delay,this.delayMap)(this.contextSnapshot,d);let p;return{entry:()=>{p=globalThis.setTimeout(()=>{const g=this.getNextStateInfo(l,d);this.performStateChangeEffects(this.state.value,g,d)},h)},exit:()=>{globalThis.clearTimeout(p)}}}),A(this,"getDelayedEventActions",l=>{const d=this.getStateNode(l),h=vt("machine.after");if(!d||!d.after)return;const p=[],g=[];if(ln(d.after)){const f=this.determineTransition(d.after,h);if(!f)return;const y=this.getActionFromDelayedTransition(f);p.push(y.entry),g.push(y.exit)}else if(un(d.after))for(const f in d.after){const y=d.after[f];let v={};if(ln(y)){const w=this.determineTransition(y,h);w&&(v=w)}else zt(y)?v={target:y,delay:f}:v={...y,delay:f};const k=this.getActionFromDelayedTransition(v);p.push(k.entry),g.push(k.exit)}return{entries:p,exits:g}}),A(this,"executeActions",(l,d)=>{var h;const p=zi(l,this.guardMap)(this.contextSnapshot,d,this.guardMeta);for(const g of ie(p)){const f=zt(g)?(h=this.actionMap)==null?void 0:h[g]:g;$i(zt(g)&&!f,`[@zag-js/core > execute-actions] No implementation found for action: \`${g}\``),f?.(this.state.context,d,this.meta)}}),A(this,"executeActivities",(l,d,h)=>{var p;for(const g of d){const f=zt(g)?(p=this.activityMap)==null?void 0:p[g]:g;if(!f){$i(`[@zag-js/core > execute-activity] No implementation found for activity: \`${g}\``);continue}const y=f(this.state.context,l,this.meta);y&&this.addActivityCleanup(h??this.state.value,y)}}),A(this,"createEveryActivities",(l,d)=>{if(!l)return;const h=vt("machine.every");if(ln(l)){const p=ie(l).find(f=>{const y=f.delay,v=Fn(y,this.delayMap)(this.contextSnapshot,h);return ea(f.guard,this.guardMap)(this.contextSnapshot,h,this.guardMeta)??v!=null});if(!p)return;const g=Fn(p.delay,this.delayMap)(this.contextSnapshot,h);d(()=>{const f=globalThis.setInterval(()=>{this.executeActions(p.actions,h)},g);return()=>{globalThis.clearInterval(f)}})}else for(const p in l){const g=l?.[p],f=Fn(p,this.delayMap)(this.contextSnapshot,h);d(()=>{const y=globalThis.setInterval(()=>{this.executeActions(g,h)},f);return()=>{globalThis.clearInterval(y)}})}}),A(this,"setEvent",l=>{this.state.previousEvent=this.state.event,this.state.event=Co(vt(l))}),A(this,"performExitEffects",(l,d)=>{const h=this.state.value;if(h==="")return;const p=l?this.getStateNode(l):void 0;this.stopActivities(h);const g=zi(p?.exit,this.guardMap)(this.contextSnapshot,d,this.guardMeta),f=ie(g),y=this.delayedEvents.get(h);y&&f.push(...y),this.executeActions(f,d),this.eventListeners.clear()}),A(this,"performEntryEffects",(l,d)=>{const h=this.getStateNode(l),p=ie(h?.activities);this.createEveryActivities(h?.every,v=>{p.unshift(v)}),p.length>0&&this.executeActivities(d,p);const g=zi(h?.entry,this.guardMap)(this.contextSnapshot,d,this.guardMeta),f=ie(g),y=this.getDelayedEventActions(l);h!=null&&h.after&&y&&(this.delayedEvents.set(l,y?.exits),f.push(...y.entries)),this.executeActions(f,d),h?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(v=>{v(this.stateSnapshot)}),this.stop())}),A(this,"performTransitionEffects",(l,d)=>{const h=this.determineTransition(l,d);this.executeActions(h?.actions,d)}),A(this,"performStateChangeEffects",(l,d,h)=>{this.setEvent(h);const p=d.changed||d.reenter;p&&this.performExitEffects(l,h),this.performTransitionEffects(d.transition,h),this.setState(d.target),p&&this.performEntryEffects(d.target,h)}),A(this,"determineTransition",(l,d)=>{const h=nc(l,this.guardMap);return h?.(this.contextSnapshot,d,this.guardMeta)}),A(this,"sendParent",l=>{var d;this.parent||zn("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const h=vt(l);(d=this.parent)==null||d.send(h)}),A(this,"log",(...l)=>{}),A(this,"send",l=>{const d=vt(l);this.transition(this.state.value,d)}),A(this,"transition",(l,d)=>{var h,p;const g=zt(l)?this.getStateNode(l):l?.stateNode,f=vt(d);if(!g&&!this.config.on){const k=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${l}, \`event\`: ${f.type}`;$i(k);return}const y=((h=g?.on)==null?void 0:h[f.type])??((p=this.config.on)==null?void 0:p[f.type]),v=this.getNextStateInfo(y,f);return this.performStateChangeEffects(this.state.value,v,f),v.stateNode}),A(this,"subscribe",l=>(this.stateListeners.add(l),this.status==="Running"&&l(this.stateSnapshot),()=>{this.stateListeners.delete(l)})),A(this,"onDone",l=>(this.doneListeners.add(l),this)),A(this,"onTransition",l=>(this.stateListeners.add(l),this.status==="Running"&&l(this.stateSnapshot),this)),A(this,"onChange",l=>(this.contextListeners.add(l),this)),A(this,"onEvent",l=>(this.eventListeners.add(l),this)),this.config=To(e),this.options=To(n??{}),this.id=this.config.id??`machine-${Uu()}`,this.guardMap=((i=this.options)==null?void 0:i.guards)??{},this.actionMap=((s=this.options)==null?void 0:s.actions)??{},this.delayMap=((o=this.options)==null?void 0:o.delays)??{},this.activityMap=((r=this.options)==null?void 0:r.activities)??{},this.sync=((a=this.options)==null?void 0:a.sync)??!1,this.state=tc(this.config),this.initialContext=Ue(this.state.context),this.transformContext(this.state.context);const c=vt("machine.created");this.executeActions((u=this.config)==null?void 0:u.created,c)}get stateSnapshot(){return Xt(Ue(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){var n;return((n=e.initialState)==null?void 0:n.target)??""}}}get meta(){var e;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((e=this.initialState)==null?void 0:e.target)??"",getState:()=>this.stateSnapshot,getAction:n=>this.actionMap[n],getGuard:n=>this.guardMap[n]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}},zs=(t,e)=>new ic(t,e);function sc(t,e,n){if(!t)return;const i=t.ownerDocument.defaultView||window,s=new i.MutationObserver(o=>{for(const r of o)r.type==="attributes"&&r.attributeName&&e.includes(r.attributeName)&&n(r)});return s.observe(t,{attributes:!0,attributeFilter:e}),()=>s.disconnect()}var Hs=t=>t.ownerDocument.defaultView||window;function ia(t,e){const{type:n="HTMLInputElement",property:i="value"}=e,s=Hs(t)[n].prototype;return Object.getOwnPropertyDescriptor(s,i)??{}}function oc(t,e,n={}){var i;(i=ia(t,n).set)==null||i.call(t,e)}function rc(t,e){var n;(n=ia(t,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(t,e)}function sa(t,e){const{value:n,bubbles:i=!0}=e;if(!t)return;const s=Hs(t);t instanceof s.HTMLInputElement&&(oc(t,`${n}`),t.dispatchEvent(new s.Event("input",{bubbles:i})))}function oa(t,e){const{checked:n,bubbles:i=!0}=e;if(!t)return;const s=Hs(t);t instanceof s.HTMLInputElement&&(rc(t,n),t.dispatchEvent(new s.Event("click",{bubbles:i})),t.dispatchEvent(new s.Event("change",{bubbles:i})))}function ac(t){return lc(t)?t.form:t.closest("form")}function lc(t){return t.matches("textarea, input, select, button")}function uc(t,e){if(!t)return;const n=ac(t);return n?.addEventListener("reset",e,{passive:!0}),()=>{n?.removeEventListener("reset",e)}}function cc(t,e){const n=t?.closest("fieldset");if(n)return e(n.disabled),sc(n,["disabled"],()=>e(n.disabled))}function ra(t,e){if(!t)return;const{onFieldsetDisabledChange:n,onFormReset:i}=e,s=[uc(t,i),cc(t,n)];return()=>{s.forEach(o=>o?.())}}var Io=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,Do=(...t)=>(...e)=>{t.forEach(function(n){n?.(...e)})},dc=t=>typeof t=="string";function Si(t){if(!hc(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(i=>typeof i=="string"),n={};for(const i of e){const s=t[i];s!==void 0&&(n[i]=Si(s))}return n}var hc=t=>t&&typeof t=="object"&&t.constructor===Object;function pc(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}var fc=ue("checkbox").parts("root","label","control"),Hi=fc.build(),xt=En({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`checkbox:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`checkbox:${t.id}:label`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`checkbox:${t.id}:control`},getHiddenInputId:t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`checkbox:${t.id}:hidden`},getRootEl:t=>xt.getById(t,xt.getRootId(t)),getHiddenInputEl:t=>xt.getById(t,xt.getHiddenInputId(t))});function gc(t,e,n){const i=t.context.isDisabled,s=!i&&t.context.focused,o=t.context.isChecked,r=t.context.isIndeterminate,a={"data-active":gt(t.context.active),"data-focus":gt(s),"data-hover":gt(t.context.hovered),"data-disabled":gt(i),"data-state":r?"indeterminate":t.context.checked?"checked":"unchecked","data-invalid":gt(t.context.invalid)};return{isChecked:o,isDisabled:i,isIndeterminate:r,isFocused:s,checkedState:t.context.checked,setChecked(u){e({type:"CHECKED.SET",checked:u,isTrusted:!1})},toggleChecked(){e({type:"CHECKED.TOGGLE",checked:o,isTrusted:!1})},rootProps:n.label({...Hi.root.attrs,...a,id:xt.getRootId(t.context),htmlFor:xt.getHiddenInputId(t.context),onPointerMove(){i||e({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){i||e({type:"CONTEXT.SET",context:{hovered:!1}})},onPointerDown(u){i||(s&&u.pointerType==="mouse"&&u.preventDefault(),e({type:"CONTEXT.SET",context:{active:!0}}))},onPointerUp(){i||e({type:"CONTEXT.SET",context:{active:!1}})},onClick(u){u.target===xt.getHiddenInputEl(t.context)&&u.stopPropagation()}}),labelProps:n.element({...Hi.label.attrs,...a,id:xt.getLabelId(t.context)}),controlProps:n.element({...Hi.control.attrs,...a,id:xt.getControlId(t.context),"aria-hidden":!0}),hiddenInputProps:n.input({id:xt.getHiddenInputId(t.context),type:"checkbox",required:t.context.required,defaultChecked:o,disabled:i,"data-disabled":gt(i),"aria-labelledby":xt.getLabelId(t.context),"aria-invalid":t.context.invalid,name:t.context.name,form:t.context.form,value:t.context.value,style:Kr,onChange(u){const c=u.currentTarget.checked;e({type:"CHECKED.SET",checked:c,isTrusted:!0})},onBlur(){e({type:"CONTEXT.SET",context:{focused:!1}})},onFocus(){e({type:"CONTEXT.SET",context:{focused:!0}})},onKeyDown(u){u.key===" "&&e({type:"CONTEXT.SET",context:{active:!0}})},onKeyUp(u){u.key===" "&&e({type:"CONTEXT.SET",context:{active:!1}})}})}}var{not:Fo}=ta;function vc(t){const e=Si(t);return zs({id:"checkbox",initial:"ready",context:{checked:!1,value:"on",disabled:!1,...e,fieldsetDisabled:!1},watch:{disabled:"removeFocusIfNeeded",checked:"syncInputElement"},activities:["trackFormControlState"],on:{"CHECKED.TOGGLE":[{guard:Fo("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Fo("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{isIndeterminate:n=>bs(n.checked),isChecked:n=>Oo(n.checked),isDisabled:n=>!!n.disabled||n.fieldsetDisabled},states:{ready:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackFormControlState(n,i,{send:s,initialContext:o}){return ra(xt.getHiddenInputEl(n),{onFieldsetDisabledChange(r){n.fieldsetDisabled=r},onFormReset(){s({type:"CHECKED.SET",checked:!!o.checked})}})}},actions:{setContext(n,i){Object.assign(n,i.context)},syncInputElement(n){const i=xt.getHiddenInputEl(n);i&&(i.checked=n.isChecked,i.indeterminate=n.isIndeterminate)},removeFocusIfNeeded(n){n.disabled&&n.focused&&(n.focused=!1)},setChecked(n,i){Mo.checked(n,i.checked)},toggleChecked(n){const i=bs(n.checked)?!0:!n.checked;Mo.checked(n,i)},dispatchChangeEvent(n){const i=xt.getHiddenInputEl(n);oa(i,{checked:Oo(n.checked)})}}})}function bs(t){return t==="indeterminate"}function Oo(t){return bs(t)?!1:!!t}var mc={change:t=>{var e;(e=t.onChange)==null||e.call(t,{checked:t.checked})}},Mo={checked:(t,e)=>{t.checked=e,mc.change(t)}};function bc(t){return new Proxy({},{get(){return t}})}function yc(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}var Ro={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"};function xc(t){return t in Ro?Ro[t]:t.startsWith("on")?`on${yc(t.substr(2))}`:t.toLowerCase()}var Ai=bc(t=>{const e={};for(const n in t){const i=t[n];n==="children"?typeof i=="string"&&(e.innerHTML=i):e[xc(n)]=t[n]}return e});function kc(t,e){const{actions:n,state:i,context:s}=e??{},o=typeof t=="function"?t():t,r=s?o.withContext(s.value):o;return ge(()=>{r.start(i),r.state.can("SETUP")&&r.send("SETUP"),Ei(()=>{r.stop()})}),Er(()=>{r.setOptions({actions:n})}),s&&At(s,r.setContext,{deep:!0}),r}function Ti(t,e){const n=kc(t,e),i=ll(n.state);return ge(()=>{const s=n.subscribe(o=>{i.value=o});Ei(()=>{s?.()})}),[i,n.send,n]}function Ie(t={}){const{prefix:e}=t,n=wu();return e?`${e}-${n}`:n}const Ec={class:"k-checkbox__label"},wc={key:0,class:"k-checkbox__help"},Po=tt({__name:"Checkbox",props:{modelValue:{type:[Boolean,Array]},value:{},label:{},disabled:{type:Boolean},help:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t;if(n.modelValue instanceof Array&&!n.value)throw new Error("props.value is required if props.modelValue is an array");const i=()=>{const{modelValue:c,value:l}=n;return c instanceof Array?c.some(d=>An(d)===An(l)):!!c};function s(c){const{modelValue:l,value:d}=n;if(!(l instanceof Array))return e("update:modelValue",typeof c=="boolean"?c:void 0);if(!(typeof c!="boolean"||!d))return c?e("update:modelValue",[...l,d]):e("update:modelValue",l.filter(h=>An(h)!==An(d)))}const o={id:Ie(),checked:i(),onChange:({checked:c})=>{if(i()!==c)return s(c)}},[r,a]=Ti(vc(o),{context:H(()=>({disabled:n.disabled}))}),u=H(()=>gc(r.value,a,Ai));return At(()=>n.modelValue,()=>{const c=i();if(u.value.isChecked!==c)return u.value.setChecked(c)}),(c,l)=>(_(),O("label",ot({class:"k-checkbox"},u.value.rootProps),[ut("div",kt(Rt(u.value.controlProps)),[u.value.isChecked?(_(),it(lt(ze),{key:0,icon:"fa-pro-solid:check"})):q("",!0)],16),ut("span",kt(Rt(u.value.labelProps)),[ut("span",Ec,[z(c.$slots,"default",{},()=>[Ht(ct(c.label),1)])]),c.$slots.help||c.help?(_(),O("span",wc,[z(c.$slots,"help",{},()=>[Ht(ct(c.help),1)])])):q("",!0)],16),ut("input",kt(Rt(u.value.hiddenInputProps)),null,16)],16))}}),Gs=Symbol("form-control"),Cc={class:"k-formcontrol"},_c=["for"],Sc={key:1,class:"k-formcontrol__error"},Ac={key:2,class:"k-formcontrol__help"},tg=tt({__name:"FormControl",props:{label:{},help:{},error:{}},setup(t){const e=t,n=Ie({prefix:"k-formcontrol"}),i=H(()=>`${n}_label`),s=H(()=>`${n}_help`);return cl(Gs,H(()=>({...e,id:n,labelId:i.value,helpId:s.value,invalid:!!e.error}))),(o,r)=>(_(),O("div",Cc,[o.$slots.label||o.label?(_(),O("label",{key:0,class:"k-formcontrol__label",for:lt(n)},[z(o.$slots,"label",{},()=>[Ht(ct(o.label),1)])],8,_c)):q("",!0),z(o.$slots,"default",{id:lt(n)}),o.$slots.error||o.error?(_(),O("span",Sc,[z(o.$slots,"error",{},()=>[Ht(ct(o.error),1)])])):q("",!0),o.$slots.help||o.help?(_(),O("span",Ac,[z(o.$slots,"help",{},()=>[Ht(ct(o.help),1)])])):q("",!0)]))}});function ce(t){return typeof t=="string"||t instanceof String}function Lo(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function aa(t,e){return Array.isArray(e)?aa(t,(n,i)=>e.includes(i)):Object.entries(t).reduce((n,i)=>{let[s,o]=i;return e(o,s)&&(n[s]=o),n},{})}const I={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Tc(t){switch(t){case I.LEFT:return I.FORCE_LEFT;case I.RIGHT:return I.FORCE_RIGHT;default:return t}}function Gi(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function oi(t,e){if(e===t)return!0;const n=Array.isArray(e),i=Array.isArray(t);let s;if(n&&i){if(e.length!=t.length)return!1;for(s=0;s<e.length;s++)if(!oi(e[s],t[s]))return!1;return!0}if(n!=i)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){const o=e instanceof Date,r=t instanceof Date;if(o&&r)return e.getTime()==t.getTime();if(o!=r)return!1;const a=e instanceof RegExp,u=t instanceof RegExp;if(a&&u)return e.toString()==t.toString();if(a!=u)return!1;const c=Object.keys(e);for(s=0;s<c.length;s++)if(!Object.prototype.hasOwnProperty.call(t,c[s]))return!1;for(s=0;s<c.length;s++)if(!oi(t[c[s]],e[c[s]]))return!1;return!0}else if(e&&t&&typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();return!1}class Ic{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?I.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?I.RIGHT:I.LEFT}}function V(t,e){return new V.InputMask(t,e)}function la(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?V.MaskedRegExp:ce(t)?V.MaskedPattern:t===Date?V.MaskedDate:t===Number?V.MaskedNumber:Array.isArray(t)||t===Array?V.MaskedDynamic:V.Masked&&t.prototype instanceof V.Masked?t:V.Masked&&t instanceof V.Masked?t.constructor:t instanceof Function?V.MaskedFunction:(console.warn("Mask not found for mask",t),V.Masked)}function ri(t){if(!t)throw new Error("Options in not defined");if(V.Masked){if(t.prototype instanceof V.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof V.Masked?{mask:t}:Lo(t)&&t.mask instanceof V.Masked?t:{};if(e){const i=e.mask;return{...aa(e,(s,o)=>!o.startsWith("_")),mask:e.constructor,_mask:i,...n}}}return Lo(t)?{...t}:{mask:t}}function De(t){if(V.Masked&&t instanceof V.Masked)return t;const e=ri(t),n=la(e.mask);if(!n)throw new Error("Masked class is not found for provided mask, appropriate module needs to be imported manually before creating mask.");return e.mask===n&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new n(e)}V.createMask=De;class qs{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,n){if(!(e==null||n==null||e===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(e,n)}catch{}}get isActive(){return!1}}V.MaskElement=qs;class Me extends qs{constructor(e){super(),this.input=e,this._handlers={}}get rootElement(){var e,n,i;return(e=(n=(i=this.input).getRootNode)==null?void 0:n.call(i))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){Object.keys(e).forEach(n=>this._toggleEventHandler(Me.EVENTS_MAP[n],e[n]))}unbindEvents(){Object.keys(this._handlers).forEach(e=>this._toggleEventHandler(e))}_toggleEventHandler(e,n){this._handlers[e]&&(this.input.removeEventListener(e,this._handlers[e]),delete this._handlers[e]),n&&(this.input.addEventListener(e,n),this._handlers[e]=n)}}Me.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"};V.HTMLMaskElement=Me;class Dc extends Me{constructor(e){super(e),this.input=e,this._handlers={}}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,n){this.input.setSelectionRange(e,n)}get value(){return this.input.value}set value(e){this.input.value=e}}V.HTMLMaskElement=Me;class ua extends Me{get _unsafeSelectionStart(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),i=n&&n.anchorOffset,s=n&&n.focusOffset;return s==null||i==null||i<s?i:s}get _unsafeSelectionEnd(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),i=n&&n.anchorOffset,s=n&&n.focusOffset;return s==null||i==null||i>s?i:s}_unsafeSelect(e,n){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,e),i.setEnd(this.input.lastChild||this.input,n);const s=this.rootElement,o=s.getSelection&&s.getSelection();o&&(o.removeAllRanges(),o.addRange(i))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}V.HTMLContenteditableMaskElement=ua;class Fc{constructor(e,n){this.el=e instanceof qs?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new ua(e):new Dc(e),this.masked=De(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var n;return e==null||((n=this.masked)==null?void 0:n.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof V.Masked)&&this.masked.constructor===la(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof V.Masked?e:De({mask:e});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(),this.alignCursor())}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(),this.alignCursor())}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,n){const i=this._listeners[e];i&&i.forEach(s=>s(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value}updateControl(){const e=this.masked.unmaskedValue,n=this.masked.value,i=this.displayValue,s=this.unmaskedValue!==e||this.value!==n;this._unmaskedValue=e,this._value=n,this.el.value!==i&&(this.el.value=i),s&&this._fireChangeEvents()}updateOptions(e){const{mask:n,...i}=e,s=!this.maskEquals(n),o=!oi(this.masked,i);s&&(this.mask=n),o&&this.masked.updateOptions(i),(s||o)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,I.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,n){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n),this}off(e,n){if(!this._listeners[e])return this;if(!n)return delete this._listeners[e],this;const i=this._listeners[e].indexOf(n);return i>=0&&this._listeners[e].splice(i,1),this}_onInput(e){if(this._inputEvent=e,this._abortUpdateCursor(),!this._selection)return this.updateValue();const n=new Ic({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,s=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,o=i===this.masked.rawInputValue?n.removeDirection:I.NONE;let r=this.masked.nearestInputPos(n.startChangePos+s,o);o!==I.NONE&&(r=this.masked.nearestInputPos(r,I.NONE)),this.updateControl(),this.updateCursor(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}V.InputMask=Fc;class Z{static normalize(e){return Array.isArray(e)?e:[e,new Z]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}aggregate(e){return this.rawInserted+=e.rawInserted,this.skip=this.skip||e.skip,this.inserted+=e.inserted,this.tailShift+=e.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}V.ChangeDetails=Z;class Kt{constructor(e,n,i){e===void 0&&(e=""),n===void 0&&(n=0),this.value=e,this.from=n,this.stop=i}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class Tt{constructor(e){this._value="",this._update({...Tt.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){Object.keys(e).length&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,n){n===void 0&&(n={input:!0}),this.reset(),this.append(e,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,n){return e}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-e)}extractInput(e,n,i){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(e,n)}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new Kt(this.extractInput(e,n),e)}appendTail(e){return ce(e)&&(e=new Kt(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new Z({inserted:e,rawInserted:e})):new Z}_appendChar(e,n,i){n===void 0&&(n={});const s=this.state;let o;if([e,o]=this.doPrepareChar(e,n),o=o.aggregate(this._appendCharRaw(e,n)),o.inserted){let r,a=this.doValidate(n)!==!1;if(a&&i!=null){const u=this.state;this.overwrite===!0&&(r=i.state,i.unshift(this.displayValue.length-o.tailShift));let c=this.appendTail(i);a=c.rawInserted===i.toString(),!(a&&c.inserted)&&this.overwrite==="shift"&&(this.state=u,r=i.state,i.shift(),c=this.appendTail(i),a=c.rawInserted===i.toString()),a&&c.inserted&&(this.state=u)}a||(o=new Z,this.state=s,i&&r&&(i.state=r))}return o}_appendPlaceholder(){return new Z}_appendEager(){return new Z}append(e,n,i){if(!ce(e))throw new Error("value should be string");const s=ce(i)?new Kt(String(i)):i;n!=null&&n.tail&&(n._beforeTailState=this.state);let o;[e,o]=this.doPrepare(e,n);for(let r=0;r<e.length;++r){const a=this._appendChar(e[r],n,s);if(!a.rawInserted&&!this.doSkipInvalid(e[r],n,s))break;o.aggregate(a)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&e&&o.aggregate(this._appendEager()),s!=null&&(o.tailShift+=this.appendTail(s).tailShift),o}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(n),new Z}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const n=this.rawInputValue,i=this.value,s=e();return this.rawInputValue=n,this.value&&this.value!==i&&i.indexOf(this.value)===0&&this.append(i.slice(this.displayValue.length),{},""),delete this._refreshing,s}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const n=this.state,i=e(this);return this.state=n,delete this._isolated,i}doSkipInvalid(e,n,i){return!!this.skipInvalid}doPrepare(e,n){return n===void 0&&(n={}),Z.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),Z.normalize(this.prepareChar?this.prepareChar(e,this,n):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,n,i,s,o){s===void 0&&(s=I.NONE),o===void 0&&(o={input:!0});const r=e+n,a=this.extractTail(r),u=this.eager===!0||this.eager==="remove";let c;u&&(s=Tc(s),c=this.extractInput(0,r,{raw:!0}));let l=e;const d=new Z;if(s!==I.NONE&&(l=this.nearestInputPos(e,n>1&&e!==0&&!u?I.NONE:s),d.tailShift=l-e),d.aggregate(this.remove(l)),u&&s!==I.NONE&&c===this.rawInputValue)if(s===I.FORCE_LEFT){let h;for(;c===this.rawInputValue&&(h=this.displayValue.length);)d.aggregate(new Z({tailShift:-1})).aggregate(this.remove(h-1))}else s===I.FORCE_RIGHT&&a.unshift();return d.aggregate(this.append(i,o,a))}maskEquals(e){return this.mask===e}typedValueEquals(e){const n=this.typedValue;return e===n||Tt.EMPTY_VALUES.includes(e)&&Tt.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}}Tt.DEFAULTS={skipInvalid:!0};Tt.EMPTY_VALUES=[void 0,null,""];V.Masked=Tt;class Se{constructor(e,n){e===void 0&&(e=[]),n===void 0&&(n=0),this.chunks=e,this.from=n}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=ce(e)?new Kt(String(e)):e;const n=this.chunks[this.chunks.length-1],i=n&&(n.stop===e.stop||e.stop==null)&&e.from===n.from+n.toString().length;if(e instanceof Kt)i?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof Se){if(e.stop==null){let s;for(;e.chunks.length&&e.chunks[0].stop==null;)s=e.chunks.shift(),s.from+=e.from,this.extend(s)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof V.MaskedPattern))return new Kt(this.toString()).appendTo(e);const n=new Z;for(let i=0;i<this.chunks.length&&!n.skip;++i){const s=this.chunks[i],o=e._mapPosToBlock(e.displayValue.length),r=s.stop;let a;if(r!=null&&(!o||o.index<=r)){if(s instanceof Se||e._stops.indexOf(r)>=0){const u=e._appendPlaceholder(r);n.aggregate(u)}a=s instanceof Se&&e._blocks[r]}if(a){const u=a.appendTail(s);u.skip=!1,n.aggregate(u),e._value+=u.inserted;const c=s.toString().slice(u.rawInserted.length);c&&n.aggregate(e.append(c,{tail:!0}))}else n.aggregate(e.append(s.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n,...i}=e;Object.assign(this,i),this.chunks=n.map(s=>{const o="chunks"in s?new Se:new Kt;return o.state=s,o})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const n=e!=null?e-this.from:e;let i=0;for(;i<this.chunks.length;){const s=this.chunks[i],o=s.unshift(n);if(s.toString()){if(!o)break;++i}else this.chunks.splice(i,1);if(o)return o}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e],i=n.shift();if(n.toString()){if(!i)break;--e}else this.chunks.splice(e,1);if(i)return i}return""}}class Oc{constructor(e,n){this.masked=e,this._log=[];const{offset:i,index:s}=e._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=s,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,I.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,I.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,I.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,I.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,I.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,I.NONE),!0})}}class ca{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(n),this._value||(this._isRawInput=!1),new Z}nearestInputPos(e,n){n===void 0&&(n=I.NONE);const i=0,s=this._value.length;switch(n){case I.LEFT:case I.FORCE_LEFT:return i;case I.NONE:case I.RIGHT:case I.FORCE_RIGHT:default:return s}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._isRawInput?n-e:0}extractInput(e,n,i){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),i===void 0&&(i={}),i.raw&&this._isRawInput&&this._value.slice(e,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,n){n===void 0&&(n={});const i=new Z;if(this.isFilled)return i;const s=this.eager===!0||this.eager==="append",o=this.char===e&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!s)&&!n.tail;return o&&(i.rawInserted=this.char),this._value=i.inserted=this.char,this._isRawInput=o&&(n.raw||n.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new Z;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new Kt("")}appendTail(e){return ce(e)&&(e=new Kt(String(e))),e.appendTo(this)}append(e,n,i){const s=this._appendChar(e[0],n);return i!=null&&(s.tailShift+=this.appendTail(i).tailShift),s}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}}class ai{constructor(e){const{parent:n,isOptional:i,placeholderChar:s,displayChar:o,lazy:r,eager:a,...u}=e;this.masked=De(u),Object.assign(this,{parent:n,isOptional:i,placeholderChar:s,displayChar:o,lazy:r,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),e===0&&n>=1?(this.isFilled=!1,this.masked.remove(e,n)):new Z}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,n){if(n===void 0&&(n={}),this.isFilled)return new Z;const i=this.masked.state,s=this.masked._appendChar(e,this.currentMaskFlags(n));return s.inserted&&this.doValidate(n)===!1&&(s.inserted=s.rawInserted="",this.masked.state=i),!s.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(s.inserted=this.placeholderChar),s.skip=!s.inserted&&!this.isOptional,this.isFilled=!!s.inserted,s}append(e,n,i){return this.masked.append(e,this.currentMaskFlags(n),i)}_appendPlaceholder(){const e=new Z;return this.isFilled||this.isOptional||(this.isFilled=!0,e.inserted=this.placeholderChar),e}_appendEager(){return new Z}extractTail(e,n){return this.masked.extractTail(e,n)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,n,i){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.masked.extractInput(e,n,i)}nearestInputPos(e,n){n===void 0&&(n=I.NONE);const i=0,s=this.value.length,o=Math.min(Math.max(e,i),s);switch(n){case I.LEFT:case I.FORCE_LEFT:return this.isComplete?o:i;case I.RIGHT:case I.FORCE_RIGHT:return this.isComplete?o:s;case I.NONE:default:return o}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.value.slice(e,n).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var n;return{...e,_beforeTailState:(e==null||(n=e._beforeTailState)==null?void 0:n.masked)||e?._beforeTailState}}}ai.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Mc extends Tt{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=i=>i.search(n)>=0),super._update(e)}}V.MaskedRegExp=Mc;class It extends Tt{constructor(e){super({...It.DEFAULTS,...e,definitions:Object.assign({},ai.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!e)return;let i=!1,s=!1;for(let o=0;o<n.length;++o){if(this.blocks){const c=n.slice(o),l=Object.keys(this.blocks).filter(h=>c.indexOf(h)===0);l.sort((h,p)=>p.length-h.length);const d=l[0];if(d){const{expose:h,...p}=ri(this.blocks[d]),g=De({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,...p,parent:this});g&&(this._blocks.push(g),h&&(this.exposeBlock=g),this._maskedBlocks[d]||(this._maskedBlocks[d]=[]),this._maskedBlocks[d].push(this._blocks.length-1)),o+=d.length-1;continue}}let r=n[o],a=r in e;if(r===It.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(r==="{"||r==="}"){i=!i;continue}if(r==="["||r==="]"){s=!s;continue}if(r===It.ESCAPE_CHAR){if(++o,r=n[o],!r)break;a=!1}const u=a?new ai({isOptional:s,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ri(e[r]),parent:this}):new ca({char:r,eager:this.eager,isUnmasking:i});this._blocks.push(u)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){const{_blocks:n,...i}=e;this._blocks.forEach((s,o)=>s.state=n[o]),super.state=i}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,n)=>e+=n.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(n),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,n)=>e+=n.value,"")}set value(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(n),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(n),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,n)=>e+=n.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const n=new Z;let i=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(i==null)return n;this._blocks[i].isFilled&&++i;for(let s=i;s<this._blocks.length;++s){const o=this._blocks[s]._appendEager();if(!o.inserted)break;n.aggregate(o)}return n}_appendCharRaw(e,n){n===void 0&&(n={});const i=this._mapPosToBlock(this.displayValue.length),s=new Z;if(!i)return s;for(let r=i.index;;++r){var o;const a=this._blocks[r];if(!a)break;const u=a._appendChar(e,{...n,_beforeTailState:(o=n._beforeTailState)==null||(o=o._blocks)==null?void 0:o[r]}),c=u.skip;if(s.aggregate(u),c||u.rawInserted)break}return s}extractTail(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const i=new Se;return e===n||this._forEachBlocksInRange(e,n,(s,o,r,a)=>{const u=s.extractTail(r,a);u.stop=this._findStopBefore(o),u.from=this._blockStartPos(o),u instanceof Se&&(u.blockIndex=o),i.extend(u)}),i}extractInput(e,n,i){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),i===void 0&&(i={}),e===n)return"";let s="";return this._forEachBlocksInRange(e,n,(o,r,a,u)=>{s+=o.extractInput(a,u,i)}),s}_findStopBefore(e){let n;for(let i=0;i<this._stops.length;++i){const s=this._stops[i];if(s<=e)n=s;else break}return n}_appendPlaceholder(e){const n=new Z;if(this.lazy&&e==null)return n;const i=this._mapPosToBlock(this.displayValue.length);if(!i)return n;const s=i.index,o=e??this._blocks.length;return this._blocks.slice(s,o).forEach(r=>{if(!r.lazy||e!=null){var a;const u=r._appendPlaceholder((a=r._blocks)==null?void 0:a.length);this._value+=u.inserted,n.aggregate(u)}}),n}_mapPosToBlock(e){let n="";for(let i=0;i<this._blocks.length;++i){const s=this._blocks[i],o=n.length;if(n+=s.displayValue,e<=n.length)return{index:i,offset:e-o}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((n,i)=>n+=i.displayValue.length,0)}_forEachBlocksInRange(e,n,i){n===void 0&&(n=this.displayValue.length);const s=this._mapPosToBlock(e);if(s){const o=this._mapPosToBlock(n),r=o&&s.index===o.index,a=s.offset,u=o&&r?o.offset:this._blocks[s.index].displayValue.length;if(i(this._blocks[s.index],s.index,a,u),o&&!r){for(let c=s.index+1;c<o.index;++c)i(this._blocks[c],c,0,this._blocks[c].displayValue.length);i(this._blocks[o.index],o.index,0,o.offset)}}}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const i=super.remove(e,n);return this._forEachBlocksInRange(e,n,(s,o,r,a)=>{i.aggregate(s.remove(r,a))}),i}nearestInputPos(e,n){if(n===void 0&&(n=I.NONE),!this._blocks.length)return 0;const i=new Oc(this,e);if(n===I.NONE)return i.pushRightBeforeInput()||(i.popState(),i.pushLeftBeforeInput())?i.pos:this.displayValue.length;if(n===I.LEFT||n===I.FORCE_LEFT){if(n===I.LEFT){if(i.pushRightBeforeFilled(),i.ok&&i.pos===e)return e;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),n===I.LEFT){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=e||(i.popState(),i.ok&&i.pos<=e))return i.pos;i.popState()}return i.ok?i.pos:n===I.FORCE_LEFT?0:(i.popState(),i.ok||(i.popState(),i.ok)?i.pos:0)}return n===I.RIGHT||n===I.FORCE_RIGHT?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:n===I.FORCE_RIGHT?this.displayValue.length:(i.popState(),i.ok||(i.popState(),i.ok)?i.pos:this.nearestInputPos(e,I.LEFT))):e}totalInputPositions(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);let i=0;return this._forEachBlocksInRange(e,n,(s,o,r,a)=>{i+=s.totalInputPositions(r,a)}),i}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const n=this._maskedBlocks[e];return n?n.map(i=>this._blocks[i]):[]}}It.DEFAULTS={lazy:!0,placeholderChar:"_"};It.STOP_CHAR="`";It.ESCAPE_CHAR="\\";It.InputDefinition=ai;It.FixedDefinition=ca;V.MaskedPattern=It;class Hn extends It{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:n=this.to||0,from:i=this.from||0,maxLength:s=this.maxLength||0,autofix:o=this.autofix,...r}=e;this.to=n,this.from=i,this.maxLength=Math.max(String(n).length,s),this.autofix=o;const a=String(this.from).padStart(this.maxLength,"0"),u=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<u.length&&u[c]===a[c];)++c;r.mask=u.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(r)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let n="",i="";const[,s,o]=e.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(n="0".repeat(s.length)+o,i="9".repeat(s.length)+o),n=n.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[n,i]}doPrepareChar(e,n){n===void 0&&(n={});let i;if([e,i]=super.doPrepareChar(e.replace(/\D/g,""),n),!this.autofix||!e)return[e,i];const s=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0"),r=this.value+e;if(r.length>this.maxLength)return["",i];const[a,u]=this.boundaries(r);return Number(u)<this.from?[s[r.length-1],i]:Number(a)>this.to?this.autofix==="pad"&&r.length<this.maxLength?["",i.aggregate(this.append(s[r.length-1]+e,n))]:[o[r.length-1],i]:[e,i]}doValidate(e){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,s]=this.boundaries(n);return this.from<=Number(s)&&Number(i)<=this.to&&super.doValidate(e)}}V.MaskedRange=Hn;class Ae extends It{constructor(e){const{mask:n,pattern:i,...s}={...Ae.DEFAULTS,...e};super({...s,mask:ce(n)?n:i})}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:i,blocks:s,...o}={...Ae.DEFAULTS,...e},r=Object.assign({},Ae.GET_DEFAULT_BLOCKS());e.min&&(r.Y.from=e.min.getFullYear()),e.max&&(r.Y.to=e.max.getFullYear()),e.min&&e.max&&r.Y.from===r.Y.to&&(r.m.from=e.min.getMonth()+1,r.m.to=e.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=e.min.getDate(),r.d.to=e.max.getDate())),Object.assign(r,this.blocks,s),Object.keys(r).forEach(a=>{const u=r[a];!("autofix"in u)&&"autofix"in e&&(u.autofix=e.autofix)}),super._update({...o,mask:ce(n)?n:i,blocks:r})}doValidate(e){const n=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}}Ae.GET_DEFAULT_BLOCKS=()=>({d:{mask:Hn,from:1,to:31,maxLength:2},m:{mask:Hn,from:1,to:12,maxLength:2},Y:{mask:Hn,from:1900,to:9999}});Ae.DEFAULTS={mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";const n=String(t.getDate()).padStart(2,"0"),i=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return[n,i,s].join(".")},parse:(t,e)=>{const[n,i,s]=t.split(".").map(Number);return new Date(s,i-1,n)}};V.MaskedDate=Ae;class wn extends Tt{constructor(e){super({...wn.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(n=>{const{expose:i,...s}=ri(n),o=De({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return i&&(this.exposeMask=o),o}):[])}_appendCharRaw(e,n){n===void 0&&(n={});const i=this._applyDispatch(e,n);return this.currentMask&&i.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(n))),i}_applyDispatch(e,n,i){e===void 0&&(e=""),n===void 0&&(n={}),i===void 0&&(i="");const s=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,o=this.rawInputValue,r=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:o,a=o.slice(r.length),u=this.currentMask,c=new Z,l=u?.state;if(this.currentMask=this.doDispatch(e,{...n},i),this.currentMask)if(this.currentMask!==u){if(this.currentMask.reset(),r){const d=this.currentMask.append(r,{raw:!0});c.tailShift=d.inserted.length-s.length}a&&(c.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)}else l&&(this.currentMask.state=l);return c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const n=new Z;return e&&n.aggregate(this._applyDispatch("",{},e)),n.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var n,i;return{...e,_beforeTailState:((n=e._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((i=e._beforeTailState)==null?void 0:i.currentMask)||e._beforeTailState}}doDispatch(e,n,i){return n===void 0&&(n={}),i===void 0&&(i=""),this.dispatch(e,this,n,i)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,n){n===void 0&&(n={});let[i,s]=super.doPrepare(e,n);if(this.currentMask){let o;[i,o]=super.doPrepare(i,this.currentMaskFlags(n)),s=s.aggregate(o)}return[i,s]}doPrepareChar(e,n){n===void 0&&(n={});let[i,s]=super.doPrepareChar(e,n);if(this.currentMask){let o;[i,o]=super.doPrepareChar(i,this.currentMaskFlags(n)),s=s.aggregate(o)}return[i,s]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(e);this.currentMask&&(this.currentMask.typedValue=e,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,n){const i=new Z;return this.currentMask&&i.aggregate(this.currentMask.remove(e,n)).aggregate(this._applyDispatch()),i}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:i,currentMask:s,...o}=e;n&&this.compiledMasks.forEach((r,a)=>r.state=n[a]),i!=null&&(this.currentMask=i,this.currentMask.state=s),super.state=o}extractInput(e,n,i){return this.currentMask?this.currentMask.extractInput(e,n,i):""}extractTail(e,n){return this.currentMask?this.currentMask.extractTail(e,n):super.extractTail(e,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,n){return this.currentMask?this.currentMask.nearestInputPos(e,n):super.nearestInputPos(e,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((n,i)=>{if(!e[i])return;const{mask:s,...o}=e[i];return oi(n,o)&&n.maskEquals(s)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}wn.DEFAULTS=void 0;wn.DEFAULTS={dispatch:(t,e,n,i)=>{if(!e.compiledMasks.length)return;const s=e.rawInputValue,o=e.compiledMasks.map((r,a)=>{const u=e.currentMask===r,c=u?r.displayValue.length:r.nearestInputPos(r.displayValue.length,I.FORCE_LEFT);return r.rawInputValue!==s?(r.reset(),r.append(s,{raw:!0})):u||r.remove(c),r.append(t,e.currentMaskFlags(n)),r.appendTail(i),{index:a,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(c,r.nearestInputPos(r.displayValue.length,I.FORCE_LEFT)))}});return o.sort((r,a)=>a.weight-r.weight||a.totalInputPositions-r.totalInputPositions),e.compiledMasks[o[0].index]}};V.MaskedDynamic=wn;class Rc extends It{constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:n,...i}=e;if(n){const s=n.map(a=>a.length),o=Math.min(...s),r=Math.max(...s)-o;i.mask="*".repeat(o),r&&(i.mask+="["+"*".repeat(r)+"]"),this.enum=n}super._update(i)}doValidate(e){return this.enum.some(n=>n.indexOf(this.unmaskedValue)===0)&&super.doValidate(e)}}V.MaskedEnum=Rc;class Pc extends Tt{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}V.MaskedFunction=Pc;class Mt extends Tt{constructor(e){super({...Mt.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",i=(this.scale?"("+Gi(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+i),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Gi).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Gi(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const n=e.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(e,n){n===void 0&&(n={});const[i,s]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),n);return e&&!i&&(s.skip=!0),i&&!this.allowPositive&&!this.value&&i!=="-"&&s.aggregate(this._appendChar("-")),[i,s]}_separatorsCount(e,n){n===void 0&&(n=!1);let i=0;for(let s=0;s<e;++s)this._value.indexOf(this.thousandsSeparator,s)===s&&(++i,n&&(e+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,n,i){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n),this._removeThousandsSeparators(super.extractInput(e,n,i))}_appendCharRaw(e,n){if(n===void 0&&(n={}),!this.thousandsSeparator)return super._appendCharRaw(e,n);const i=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);const o=super._appendCharRaw(e,n);this._value=this._insertThousandsSeparators(this._value);const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(r);return o.tailShift+=(a-s)*this.thousandsSeparator.length,o.skip=!o.rawInserted&&e===this.thousandsSeparator,o}_findSeparatorAround(e){if(this.thousandsSeparator){const n=e-this.thousandsSeparator.length+1,i=this.value.indexOf(this.thousandsSeparator,n);if(i<=e)return i}return-1}_adjustRangeWithSeparators(e,n){const i=this._findSeparatorAround(e);i>=0&&(e=i);const s=this._findSeparatorAround(n);return s>=0&&(n=s+this.thousandsSeparator.length),[e,n]}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n);const i=this.value.slice(0,e),s=this.value.slice(n),o=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+s));const r=this._separatorsCountFromSlice(i);return new Z({tailShift:(r-o)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case I.NONE:case I.LEFT:case I.FORCE_LEFT:{const i=this._findSeparatorAround(e-1);if(i>=0){const s=i+this.thousandsSeparator.length;if(e<s||this.value.length<=s||n===I.FORCE_LEFT)return i}break}case I.RIGHT:case I.FORCE_RIGHT:{const i=this._findSeparatorAround(e);if(i>=0)return i+this.thousandsSeparator.length}}return e}doValidate(e){let n=!!this._removeThousandsSeparators(this.value).match(this._numberRegExp);if(n){const i=this.number;n=n&&!isNaN(i)&&(this.min==null||this.min>=0||this.min<=this.number)&&(this.max==null||this.max<=0||this.number<=this.max)}return n&&super.doValidate(e)}doCommit(){if(this.value){const e=this.number;let n=e;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==e&&(this.unmaskedValue=this.format(n,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(e){const n=this._removeThousandsSeparators(e).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(i,s,o,r)=>s+r),e.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const n=e.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(e,n,i){n===void 0&&(n={});const s=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===Mt.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,n,i)&&!s}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Mt.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(Mt.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||Mt.EMPTY_VALUES.includes(e)&&Mt.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Mt.UNMASKED_RADIX=".";Mt.EMPTY_VALUES=[...Tt.EMPTY_VALUES,0];Mt.DEFAULTS={mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Mt.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};V.MaskedNumber=Mt;const ys={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function da(t,e,n){e===void 0&&(e=ys.MASKED),n===void 0&&(n=ys.MASKED);const i=De(t);return s=>i.runIsolated(o=>(o[e]=s,o[n]))}function Lc(t,e,n,i){return da(e,n,i)(t)}V.PIPE_TYPE=ys;V.createPipe=da;V.pipe=Lc;try{globalThis.IMask=V}catch{}function Bc(t,e){let{emit:n,onAccept:i,onComplete:s}=e===void 0?{}:e;const o=gl(t)?t:J(t),r=J(),a=J(),u=J(""),c=J(""),l=J(null);let d,h,p,g;function f(){g=l.value=a.value.typedValue,p=c.value=a.value.unmaskedValue,h=u.value=a.value.value,n&&(n("accept",h),n("accept:masked",h),n("accept:typed",g),n("accept:unmasked",p)),i&&i()}function y(){n&&(n("complete",h),n("complete:masked",h),n("complete:typed",g),n("complete:unmasked",p)),s&&s()}function v(){d=r.value;const w=o.value;!d||!(w!=null&&w.mask)||(a.value=V(d,w).on("accept",f).on("complete",y),f())}function k(){a.value&&(a.value.destroy(),a.value=void 0)}return ge(v),vl(k),At(c,()=>{a.value&&(p=a.value.unmaskedValue=c.value)}),At(u,()=>{a.value&&(h=a.value.value=u.value)}),At(l,()=>{a.value&&(g=a.value.typedValue=l.value)}),At([r,o],()=>{const w=r.value,T=o.value;(!(T!=null&&T.mask)||w!==d)&&k(),w&&(a.value?a.value.updateOptions(T):v())}),{el:r,mask:ml(a),masked:u,unmasked:c,typed:l}}const Nc={key:0,class:"k-input__prefix"},jc=["id","value","aria-labelledby","aria-describedby","type"],Vc={key:1,class:"k-input__suffix"},eg=tt({__name:"Input",props:{invalid:{type:Boolean},id:{},modelValue:{},prefix:{},suffix:{},mask:{},align:{default:"left"},type:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t;function i(u){e("update:modelValue",u.target.value)}const s=Ar("k-input",{variants:{invalid:{true:"k-input--invalid"},align:{left:"k-input--align-left",right:"k-input--align-right"}}}),o=wr(Gs,H(()=>({id:n.id,invalid:n.invalid}))),{el:r}=Bc(n.mask),a=H({get(){return n.modelValue?n.modelValue:""},set(u){var c;(n.type==="number"||((c=n.mask)==null?void 0:c.mask)===Number)&&(u=parseFloat(`${u}`)),e("update:modelValue",u)}});return(u,c)=>(_(),O("div",{class:qt(lt(s)({invalid:lt(o).invalid,align:u.align}))},[u.$slots.prefix||u.prefix?(_(),O("span",Nc,[z(u.$slots,"prefix",{},()=>[Ht(ct(u.prefix),1)])])):q("",!0),ut("input",ot({class:"k-input__input",id:lt(o).id,value:a.value,"aria-labelledby":lt(o).labelId,"aria-describedby":lt(o).helpId,onInput:i,ref_key:"el",ref:r,type:n.type},u.$attrs),null,16,jc),u.$slots.suffix||u.suffix?(_(),O("span",Vc,[z(u.$slots,"suffix",{},()=>[Ht(ct(u.suffix),1)])])):q("",!0)],2))}}),$c=["src","alt"],zc=tt({__name:"Image",props:{src:{},preview:{},alt:{},caption:{},captionVisibility:{default:"hover"},captionTheme:{default:"dark"},size:{default:"cover"},position:{default:"center"},width:{},height:{},aspectRatio:{}},emits:["loaded","error"],setup(t,{emit:e}){const n=t,i=J(),s=J(!1),o=J(!1),r=J(),a=H(()=>({"--k-image-size":n.size,"--k-image-preview":n.preview||"","--k-image-position":n.position,"--k-image-width":n.width||"initial","--k-image-height":n.height||"initial","--k-image-aspectratio":(n.aspectRatio==="natural"?r.value:n.aspectRatio)||"initial"}));function u(){s.value=!0;const{naturalWidth:l=0,naturalHeight:d=0}=i.value||{};r.value=`${l}/${d}`,e("loaded")}function c(){s.value=!0,o.value=!0,e("error")}return ge(()=>{var l;return((l=i.value)==null?void 0:l.complete)&&u()}),(l,d)=>(_(),O("figure",{class:qt(["k-image",[`k-image--size-${l.size}`,{"k-image--loaded":s.value,"k-image--loading":!s.value}]]),style:ve(a.value)},[s.value?q("",!0):(_(),it(qr,{key:0,size:"small"})),xr(ut("img",{src:l.src,alt:l.alt||l.caption,onLoad:u,onError:c,ref_key:"image",ref:i},null,40,$c),[[kr,!o.value]]),l.$slots.caption||l.caption?(_(),O("figcaption",{key:1,class:qt(`k-image__caption k-image__caption--visibility-${l.captionVisibility} k-image__caption--theme-${!s.value||o.value?"light":l.captionTheme}`)},[z(l.$slots,"caption",{},()=>[Ht(ct(l.caption),1)])],2)):q("",!0)],6))}}),Hc={key:1,class:"k-card__content"},Gc={key:0,class:"k-card__title"},qc={key:2,class:"k-card__footer"},Uc=tt({inheritAttrs:!1,__name:"Card",props:{is:{default:"div"},title:{},variant:{default:"border"},thumbnail:{},thumbnailSize:{default:"cover"},headerMinHeight:{}},setup(t){return(e,n)=>(_(),it(de(e.is),ot({class:`k-card k-card--variant-${e.variant}`,style:`--k-header-min-height: ${e.headerMinHeight||""}`},e.$attrs),{default:rt(()=>[e.$slots.header||e.thumbnail?(_(),O("div",{key:0,class:qt(["k-card__header",[{"k-card__header--has-thumbnail":!e.$slots.header&&e.thumbnail},`k-card__header--thumbnail-size-${e.thumbnailSize}`]])},[z(e.$slots,"header",{},()=>[e.thumbnail?(_(),it(zc,{key:0,class:"k-card__thumbnail",src:e.thumbnail,size:e.thumbnailSize},null,8,["src","size"])):q("",!0)])],2)):q("",!0),e.$slots.default||e.title?(_(),O("div",Hc,[e.title?(_(),O("div",Gc,ct(e.title),1)):q("",!0),z(e.$slots,"default")])):q("",!0),e.$slots.footer?(_(),O("div",qc,[z(e.$slots,"footer")])):q("",!0)]),_:3},16,["class","style"]))}}),ng=tt({__name:"Skeleton",props:{variant:{default:"shiny"},aspectRatio:{},width:{},height:{},rounding:{}},setup(t){const e=()=>t.rounding?t.rounding==="full"?"9999px":Ns(t.rounding,"rounding"):"initial",n=H(()=>({"--aspect-ratio":!t.aspectRatio||t.width&&t.height?"initial":t.aspectRatio,"--width":t.width||"initial","--height":t.height||"initial","--border-radius":e()}));return(i,s)=>(_(),O("span",{class:qt(["k-skeleton",`k-skeleton--variant-${i.variant}`]),style:ve(n.value)},[z(i.$slots,"default")],6))}});var xs=(t,e,n,i)=>{const s=typeof t=="function"?t():t;return s?.addEventListener(e,n,i),()=>{s?.removeEventListener(e,n,i)}},Wc=t=>t.button===2||Xc()&&t.ctrlKey&&t.button===0,Xc=()=>/Mac|iPod|iPhone|iPad/.test(window.navigator.platform);function Bo(t,e,n){if(!t)return;const i=t.ownerDocument.defaultView||window,s=new i.CustomEvent(e,n);return t.dispatchEvent(s)}function No(t){return Math.max(0,Math.min(1,t))}function ha(t,e){const{left:n,top:i,width:s,height:o}=e.getBoundingClientRect(),r={x:t.x-n,y:t.y-i},a={x:No(r.x/s),y:No(r.y/o)};function u(c={}){const{dir:l="ltr",orientation:d="horizontal",inverted:h}=c,p=typeof h=="object"?h.x:h,g=typeof h=="object"?h.y:h;return d==="horizontal"?l==="rtl"||p?1-a.x:a.x:g?1-a.y:a.y}return{offset:r,percent:a,getPercentValue:u}}function Yc(t,e,n){return Math.round((t-e)/n)*n+e}function Kc(t,e,n){return Math.min(Math.max(t,e),n)}function Zc(t,e,n){return(t-e)/(n-e)}function pa(t,e,n,i){const s=t*(n-e)+e,o=Yc(s,e,i);return Kc(o,e,n)}function ks(t,e){const n={min:t[0],max:t[1]},i={min:e[0],max:e[1]};return function(s){if(n.min===n.max||i.min===i.max)return i.min;const o=(i.max-i.min)/(n.max-n.min);return i.min+o*(s-n.min)}}var Jc=ue("slider").parts("root","label","thumb","output","track","range","control","markerGroup","marker");Jc.build();function Qc(t){const{height:e=0}=t.thumbSize??{},n=ks([t.min,t.max],[-e/2,e/2]);return parseFloat(n(t.value).toFixed(2))}function td(t){const{width:e=0}=t.thumbSize??{};if(t.isRtl){const i=ks([t.max,t.min],[-e/2,e/2]);return-1*parseFloat(i(t.value).toFixed(2))}const n=ks([t.min,t.max],[-e/2,e/2]);return parseFloat(n(t.value).toFixed(2))}function ed(t,e){if(t.thumbAlignment==="center")return`${e}%`;const n=t.isVertical?Qc(t):td(t);return`calc(${e}% - ${n}px)`}function Us(t){let e=Zc(t.value,t.min,t.max)*100;return ed(t,e)}function fa(t){let e="visible";return t.thumbAlignment==="contain"&&!t.hasMeasuredThumbSize&&(e="hidden"),e}function nd(t){const e=t.isVertical?"bottom":"insetInlineStart";return{visibility:fa(t),position:"absolute",transform:"var(--slider-thumb-transform)",[e]:"var(--slider-thumb-offset)"}}function id(t){let e="0%",n=`${100-t.valuePercent}%`;if(t.origin==="center"){const i=t.valuePercent<50;e=i?`${t.valuePercent}%`:"50%",n=i?"50%":n}return{start:e,end:n}}function sd(t){return t.isVertical?{position:"absolute",bottom:"var(--slider-range-start)",top:"var(--slider-range-end)"}:{position:"absolute",[t.isRtl?"right":"left"]:"var(--slider-range-start)",[t.isRtl?"left":"right"]:"var(--slider-range-end)"}}function od(){return{touchAction:"none",userSelect:"none",position:"relative"}}function rd(t){const e=id(t);return{"--slider-thumb-transform":t.isVertical?"translateY(50%)":t.isRtl?"translateX(50%)":"translateX(-50%)","--slider-thumb-offset":Us(t),"--slider-range-start":e.start,"--slider-range-end":e.end}}function ad(t,e){return{visibility:fa(t),position:"absolute",pointerEvents:"none",[t.isHorizontal?"insetInlineStart":"bottom"]:Us({...t,value:e}),translate:"var(--tx) var(--ty)","--tx":t.isHorizontal?t.isRtl?"50%":"-50%":"0%","--ty":t.isHorizontal?"0%":"50%"}}function ld(){return{userSelect:"none"}}function ud(){return{position:"relative"}}function cd(){return{userSelect:"none",pointerEvents:"none",position:"relative"}}var dd={getThumbOffset:Us,getControlStyle:od,getThumbStyle:nd,getRangeStyle:sd,getRootStyle:rd,getMarkerStyle:ad,getLabelStyle:ld,getTrackStyle:ud,getMarkerGroupStyle:cd},ft=En({...dd,getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`slider:${t.id}`},getThumbId:t=>{var e;return((e=t.ids)==null?void 0:e.thumb)??`slider:${t.id}:thumb`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`slider:${t.id}:control`},getHiddenInputId:t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`slider:${t.id}:input`},getOutputId:t=>{var e;return((e=t.ids)==null?void 0:e.output)??`slider:${t.id}:output`},getTrackId:t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}track`},getRangeId:t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}:range`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`slider:${t.id}:label`},getMarkerId:(t,e)=>`slider:${t.id}:marker:${e}`,getRootEl:t=>ft.getById(t,ft.getRootId(t)),getThumbEl:t=>ft.getById(t,ft.getThumbId(t)),getControlEl:t=>ft.getById(t,ft.getControlId(t)),getHiddenInputEl:t=>ft.getById(t,ft.getHiddenInputId(t)),getValueFromPoint(t,e){const n=ft.getControlEl(t);if(!n)return;const i=ha(e,n).getPercentValue({orientation:t.orientation,dir:t.dir,inverted:{y:!0}});return pa(i,t.min,t.max,t.step)},dispatchChangeEvent(t){const e=ft.getHiddenInputEl(t);e&&sa(e,{value:t.value})}}),hd=ue("range-slider").parts("root","label","thumb","output","track","range","control","markerGroup","marker");hd.build();function pd(t){const e=t[0],n=t[t.length-1];return[e,n]}function fd(t){const[e,n]=pd(t.valuePercent);return{start:`${e}%`,end:`${100-n}%`}}function gd(t){let e="visible";return t.thumbAlignment==="contain"&&!t.hasMeasuredThumbSize&&(e="hidden"),e}function vd(t,e){const n=t.isVertical?"bottom":"insetInlineStart";return{visibility:gd(t),position:"absolute",transform:"var(--slider-thumb-transform)",[n]:`var(--slider-thumb-offset-${e})`}}function md(t){const e=fd(t);return{...t.value.reduce((n,i,s)=>{const o=ft.getThumbOffset({...t,value:i});return{...n,[`--slider-thumb-offset-${s}`]:o}},{}),"--slider-thumb-transform":t.isVertical?"translateY(50%)":t.isRtl?"translateX(50%)":"translateX(-50%)","--slider-range-start":e.start,"--slider-range-end":e.end}}var bd={getRootStyle:md,getControlStyle:ft.getControlStyle,getThumbStyle:vd,getRangeStyle:ft.getRangeStyle,getMarkerStyle:ft.getMarkerStyle,getMarkerGroupStyle:ft.getMarkerGroupStyle},mt=En({...bd,getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`slider:${t.id}`},getThumbId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.thumb)==null?void 0:i.call(n,e))??`slider:${t.id}:thumb:${e}`},getHiddenInputId:(t,e)=>`slider:${t.id}:input:${e}`,getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`slider:${t.id}:control`},getTrackId:t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}:track`},getRangeId:t=>{var e;return((e=t.ids)==null?void 0:e.range)??`slider:${t.id}:range`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`slider:${t.id}:label`},getOutputId:t=>{var e;return((e=t.ids)==null?void 0:e.output)??`slider:${t.id}:output`},getMarkerId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.marker)==null?void 0:i.call(n,e))??`slider:${t.id}:marker:${e}`},getRootEl:t=>mt.getById(t,mt.getRootId(t)),getThumbEl:(t,e)=>mt.getById(t,mt.getThumbId(t,e)),getHiddenInputEl:(t,e)=>mt.getById(t,mt.getHiddenInputId(t,e)),getControlEl:t=>mt.getById(t,mt.getControlId(t)),getElements:t=>Xr(mt.getControlEl(t),"[role=slider]"),getFirstEl:t=>mt.getElements(t)[0],getRangeEl:t=>mt.getById(t,mt.getRangeId(t)),getValueFromPoint(t,e){const n=mt.getControlEl(t);if(!n)return;const i=ha(e,n).getPercentValue({orientation:t.orientation,dir:t.dir,inverted:{y:!0}});return pa(i,t.min,t.max,t.step)},dispatchChangeEvent(t){Array.from(t.value).forEach((e,n)=>{const i=mt.getHiddenInputEl(t,n);i&&sa(i,{value:e})})}});const Es=Math.min,He=Math.max,li=Math.round,On=Math.floor,pe=t=>({x:t,y:t}),yd={left:"right",right:"left",bottom:"top",top:"bottom"},xd={start:"end",end:"start"};function Ws(t,e){return typeof t=="function"?t(e):t}function We(t){return t.split("-")[0]}function Ii(t){return t.split("-")[1]}function kd(t){return t==="x"?"y":"x"}function ga(t){return t==="y"?"height":"width"}function Xs(t){return["top","bottom"].includes(We(t))?"y":"x"}function va(t){return kd(Xs(t))}function Ed(t,e,n){n===void 0&&(n=!1);const i=Ii(t),s=va(t),o=ga(s);let r=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=ui(r)),[r,ui(r)]}function wd(t){const e=ui(t);return[ws(t),e,ws(e)]}function ws(t){return t.replace(/start|end/g,e=>xd[e])}function Cd(t,e,n){const i=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:i:e?i:s;case"left":case"right":return e?o:r;default:return[]}}function _d(t,e,n,i){const s=Ii(t);let o=Cd(We(t),n==="start",i);return s&&(o=o.map(r=>r+"-"+s),e&&(o=o.concat(o.map(ws)))),o}function ui(t){return t.replace(/left|right|bottom|top/g,e=>yd[e])}function Sd(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ad(t){return typeof t!="number"?Sd(t):{top:t,right:t,bottom:t,left:t}}function ci(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function jo(t,e,n){let{reference:i,floating:s}=t;const o=Xs(e),r=va(e),a=ga(r),u=We(e),c=o==="y",l=i.x+i.width/2-s.width/2,d=i.y+i.height/2-s.height/2,h=i[a]/2-s[a]/2;let p;switch(u){case"top":p={x:l,y:i.y-s.height};break;case"bottom":p={x:l,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-s.width,y:d};break;default:p={x:i.x,y:i.y}}switch(Ii(e)){case"start":p[r]-=h*(n&&c?-1:1);break;case"end":p[r]+=h*(n&&c?-1:1);break}return p}const Td=async(t,e,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),u=await(r.isRTL==null?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:l,y:d}=jo(c,i,u),h=i,p={},g=0;for(let f=0;f<a.length;f++){const{name:y,fn:v}=a[f],{x:k,y:w,data:T,reset:M}=await v({x:l,y:d,initialPlacement:i,placement:h,strategy:s,middlewareData:p,rects:c,platform:r,elements:{reference:t,floating:e}});l=k??l,d=w??d,p={...p,[y]:{...p[y],...T}},M&&g<=50&&(g++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(c=M.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):M.rects),{x:l,y:d}=jo(c,h,u)),f=-1)}return{x:l,y:d,placement:h,strategy:s,middlewareData:p}};async function Id(t,e){var n;e===void 0&&(e={});const{x:i,y:s,platform:o,rects:r,elements:a,strategy:u}=t,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Ws(e,t),g=Ad(p),f=a[h?d==="floating"?"reference":"floating":d],y=ci(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(f)))==null||n?f:f.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:l,strategy:u})),v=d==="floating"?{...r.floating,x:i,y:s}:r.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},T=ci(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:u}):v);return{top:(y.top-T.top+g.top)/w.y,bottom:(T.bottom-y.bottom+g.bottom)/w.y,left:(y.left-T.left+g.left)/w.x,right:(T.right-y.right+g.right)/w.x}}const Dd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:u,elements:c}=e,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:f=!0,...y}=Ws(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=We(s),k=We(a)===a,w=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=h||(k||!f?[ui(a)]:wd(a));!h&&g!=="none"&&T.push(..._d(a,f,g,w));const M=[a,...T],D=await Id(e,y),W=[];let x=((i=o.flip)==null?void 0:i.overflows)||[];if(l&&W.push(D[v]),d){const F=Ed(s,r,w);W.push(D[F[0]],D[F[1]])}if(x=[...x,{placement:s,overflows:W}],!W.every(F=>F<=0)){var b,m;const F=(((b=o.flip)==null?void 0:b.index)||0)+1,$=M[F];if($)return{data:{index:F,overflows:x},reset:{placement:$}};let N=(m=x.filter(B=>B.overflows[0]<=0).sort((B,P)=>B.overflows[1]-P.overflows[1])[0])==null?void 0:m.placement;if(!N)switch(p){case"bestFit":{var E;const B=(E=x.map(P=>[P.placement,P.overflows.filter(X=>X>0).reduce((X,Vt)=>X+Vt,0)]).sort((P,X)=>P[1]-X[1])[0])==null?void 0:E[0];B&&(N=B);break}case"initialPlacement":N=a;break}if(s!==N)return{reset:{placement:N}}}return{}}}};async function Fd(t,e){const{placement:n,platform:i,elements:s}=t,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),r=We(n),a=Ii(n),u=Xs(n)==="y",c=["left","top"].includes(r)?-1:1,l=o&&u?-1:1,d=Ws(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),u?{x:p*l,y:h*c}:{x:h*c,y:p*l}}const Od=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:s,y:o,placement:r,middlewareData:a}=e,u=await Fd(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:r}}}}};function fe(t){return ma(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function te(t){var e;return(e=(ma(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ma(t){return t instanceof Node||t instanceof Dt(t).Node}function Jt(t){return t instanceof Element||t instanceof Dt(t).Element}function Ut(t){return t instanceof HTMLElement||t instanceof Dt(t).HTMLElement}function Vo(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function Cn(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=Pt(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(s)}function Md(t){return["table","td","th"].includes(fe(t))}function Ys(t){const e=Ks(),n=Pt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function ba(t){let e=Xe(t);for(;Ut(e)&&!Di(e);){if(Ys(e))return e;e=Xe(e)}return null}function Ks(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Di(t){return["html","body","#document"].includes(fe(t))}function Pt(t){return Dt(t).getComputedStyle(t)}function Fi(t){return Jt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Xe(t){if(fe(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Vo(t)&&t.host||te(t);return Vo(e)?e.host:e}function ya(t){const e=Xe(t);return Di(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ut(e)&&Cn(e)?e:ya(e)}function kn(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=ya(t),o=s===((i=t.ownerDocument)==null?void 0:i.body),r=Dt(s);return o?e.concat(r,r.visualViewport||[],Cn(s)?s:[],r.frameElement&&n?kn(r.frameElement):[]):e.concat(s,kn(s,[],n))}function xa(t){const e=Pt(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=Ut(t),o=s?t.offsetWidth:n,r=s?t.offsetHeight:i,a=li(n)!==o||li(i)!==r;return a&&(n=o,i=r),{width:n,height:i,$:a}}function Zs(t){return Jt(t)?t:t.contextElement}function Ge(t){const e=Zs(t);if(!Ut(e))return pe(1);const n=e.getBoundingClientRect(),{width:i,height:s,$:o}=xa(e);let r=(o?li(n.width):n.width)/i,a=(o?li(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Rd=pe(0);function ka(t){const e=Dt(t);return!Ks()||!e.visualViewport?Rd:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Pd(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Dt(t)?!1:e}function Fe(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),o=Zs(t);let r=pe(1);e&&(i?Jt(i)&&(r=Ge(i)):r=Ge(t));const a=Pd(o,n,i)?ka(o):pe(0);let u=(s.left+a.x)/r.x,c=(s.top+a.y)/r.y,l=s.width/r.x,d=s.height/r.y;if(o){const h=Dt(o),p=i&&Jt(i)?Dt(i):i;let g=h.frameElement;for(;g&&i&&p!==h;){const f=Ge(g),y=g.getBoundingClientRect(),v=Pt(g),k=y.left+(g.clientLeft+parseFloat(v.paddingLeft))*f.x,w=y.top+(g.clientTop+parseFloat(v.paddingTop))*f.y;u*=f.x,c*=f.y,l*=f.x,d*=f.y,u+=k,c+=w,g=Dt(g).frameElement}}return ci({width:l,height:d,x:u,y:c})}const Ld=[":popover-open",":modal"];function Ea(t){let e=!1,n=0,i=0;function s(o){try{e=e||t.matches(o)}catch{}}if(Ld.forEach(o=>{s(o)}),e){const o=ba(t);if(o){const r=o.getBoundingClientRect();n=r.x,i=r.y}}return[e,n,i]}function Bd(t){let{elements:e,rect:n,offsetParent:i,strategy:s}=t;const o=te(i),[r]=e?Ea(e.floating):[!1];if(i===o||r)return n;let a={scrollLeft:0,scrollTop:0},u=pe(1);const c=pe(0),l=Ut(i);if((l||!l&&s!=="fixed")&&((fe(i)!=="body"||Cn(o))&&(a=Fi(i)),Ut(i))){const d=Fe(i);u=Ge(i),c.x=d.x+i.clientLeft,c.y=d.y+i.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x,y:n.y*u.y-a.scrollTop*u.y+c.y}}function Nd(t){return Array.from(t.getClientRects())}function wa(t){return Fe(te(t)).left+Fi(t).scrollLeft}function jd(t){const e=te(t),n=Fi(t),i=t.ownerDocument.body,s=He(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=He(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+wa(t);const a=-n.scrollTop;return Pt(i).direction==="rtl"&&(r+=He(e.clientWidth,i.clientWidth)-s),{width:s,height:o,x:r,y:a}}function Vd(t,e){const n=Dt(t),i=te(t),s=n.visualViewport;let o=i.clientWidth,r=i.clientHeight,a=0,u=0;if(s){o=s.width,r=s.height;const c=Ks();(!c||c&&e==="fixed")&&(a=s.offsetLeft,u=s.offsetTop)}return{width:o,height:r,x:a,y:u}}function $d(t,e){const n=Fe(t,!0,e==="fixed"),i=n.top+t.clientTop,s=n.left+t.clientLeft,o=Ut(t)?Ge(t):pe(1),r=t.clientWidth*o.x,a=t.clientHeight*o.y,u=s*o.x,c=i*o.y;return{width:r,height:a,x:u,y:c}}function $o(t,e,n){let i;if(e==="viewport")i=Vd(t,n);else if(e==="document")i=jd(te(t));else if(Jt(e))i=$d(e,n);else{const s=ka(t);i={...e,x:e.x-s.x,y:e.y-s.y}}return ci(i)}function Ca(t,e){const n=Xe(t);return n===e||!Jt(n)||Di(n)?!1:Pt(n).position==="fixed"||Ca(n,e)}function zd(t,e){const n=e.get(t);if(n)return n;let i=kn(t,[],!1).filter(a=>Jt(a)&&fe(a)!=="body"),s=null;const o=Pt(t).position==="fixed";let r=o?Xe(t):t;for(;Jt(r)&&!Di(r);){const a=Pt(r),u=Ys(r);!u&&a.position==="fixed"&&(s=null),(o?!u&&!s:!u&&a.position==="static"&&s&&["absolute","fixed"].includes(s.position)||Cn(r)&&!u&&Ca(t,r))?i=i.filter(c=>c!==r):s=a,r=Xe(r)}return e.set(t,i),i}function Hd(t){let{element:e,boundary:n,rootBoundary:i,strategy:s}=t;const o=[...n==="clippingAncestors"?zd(e,this._c):[].concat(n),i],r=o[0],a=o.reduce((u,c)=>{const l=$o(e,c,s);return u.top=He(l.top,u.top),u.right=Es(l.right,u.right),u.bottom=Es(l.bottom,u.bottom),u.left=He(l.left,u.left),u},$o(e,r,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Gd(t){const{width:e,height:n}=xa(t);return{width:e,height:n}}function qd(t,e,n,i){const s=Ut(e),o=te(e),r=n==="fixed",a=Fe(t,!0,r,e);let u={scrollLeft:0,scrollTop:0};const c=pe(0);if(s||!s&&!r)if((fe(e)!=="body"||Cn(o))&&(u=Fi(e)),s){const f=Fe(e,!0,r,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else o&&(c.x=wa(o));let l=a.left+u.scrollLeft-c.x,d=a.top+u.scrollTop-c.y;const[h,p,g]=Ea(i);return h&&(l+=p,d+=g,s&&(l+=e.clientLeft,d+=e.clientTop)),{x:l,y:d,width:a.width,height:a.height}}function zo(t,e){return!Ut(t)||Pt(t).position==="fixed"?null:e?e(t):t.offsetParent}function _a(t,e){const n=Dt(t);if(!Ut(t))return n;let i=zo(t,e);for(;i&&Md(i)&&Pt(i).position==="static";)i=zo(i,e);return i&&(fe(i)==="html"||fe(i)==="body"&&Pt(i).position==="static"&&!Ys(i))?n:i||ba(t)||n}const Ud=async function(t){const e=this.getOffsetParent||_a,n=this.getDimensions;return{reference:qd(t.reference,await e(t.floating),t.strategy,t.floating),floating:{x:0,y:0,...await n(t.floating)}}};function Wd(t){return Pt(t).direction==="rtl"}const Cs={convertOffsetParentRelativeRectToViewportRelativeRect:Bd,getDocumentElement:te,getClippingRect:Hd,getOffsetParent:_a,getElementRects:Ud,getClientRects:Nd,getDimensions:Gd,getScale:Ge,isElement:Jt,isRTL:Wd};function Xd(t,e){let n=null,i;const s=te(t);function o(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function r(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),o();const{left:c,top:l,width:d,height:h}=t.getBoundingClientRect();if(a||e(),!d||!h)return;const p=On(l),g=On(s.clientWidth-(c+d)),f=On(s.clientHeight-(l+h)),y=On(c),v={rootMargin:-p+"px "+-g+"px "+-f+"px "+-y+"px",threshold:He(0,Es(1,u))||1};let k=!0;function w(T){const M=T[0].intersectionRatio;if(M!==u){if(!k)return r();M?r(!1,M):i=setTimeout(()=>{r(!1,1e-7)},100)}k=!1}try{n=new IntersectionObserver(w,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(t)}return r(!0),o}function Yd(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,c=Zs(t),l=s||o?[...c?kn(c):[],...kn(e)]:[];l.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=c&&a?Xd(c,n):null;let h=-1,p=null;r&&(p=new ResizeObserver(v=>{let[k]=v;k&&k.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(e)})),n()}),c&&!u&&p.observe(c),p.observe(e));let g,f=u?Fe(t):null;u&&y();function y(){const v=Fe(t);f&&(v.x!==f.x||v.y!==f.y||v.width!==f.width||v.height!==f.height)&&n(),f=v,g=requestAnimationFrame(y)}return n(),()=>{var v;l.forEach(k=>{s&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),d?.(),(v=p)==null||v.disconnect(),p=null,u&&cancelAnimationFrame(g)}}const Kd=Dd,Zd=(t,e,n)=>{const i=new Map,s={platform:Cs,...n},o={...s.platform,_c:i};return Td(t,e,{...s,platform:o})};function Jd(t,e){let n,i,s;const o=J(!0),r=()=>{o.value=!0,s()};At(t,r,{flush:"sync"});const a=typeof e=="function"?e:e.get,u=typeof e=="function"?void 0:e.set,c=dl((l,d)=>(i=l,s=d,{get(){return o.value&&(n=a(),o.value=!1),i(),n},set(h){u?.(h)}}));return Object.isExtensible(c)&&(c.trigger=r),c}function Sa(t){return yl()?(xl(t),!0):!1}function Aa(t){return typeof t=="function"?t():lt(t)}const Qd=typeof window<"u"&&typeof document<"u",th=Object.prototype.toString,eh=t=>th.call(t)==="[object Object]",nh=()=>{};function Ta(t){var e;const n=Aa(t);return(e=n?.$el)!=null?e:n}const Ia=Qd?window:void 0;function ih(...t){let e,n,i,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,s]=t,e=Ia):[e,n,i,s]=t,!e)return nh;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const o=[],r=()=>{o.forEach(l=>l()),o.length=0},a=(l,d,h,p)=>(l.addEventListener(d,h,p),()=>l.removeEventListener(d,h,p)),u=At(()=>[Ta(e),Aa(s)],([l,d])=>{if(r(),!l)return;const h=eh(d)?{...d}:d;o.push(...n.flatMap(p=>i.map(g=>a(l,p,g,h))))},{immediate:!0,flush:"post"}),c=()=>{u(),r()};return Sa(c),c}function sh(){const t=J(!1);return _r()&&ge(()=>{t.value=!0}),t}function oh(t){const e=sh();return H(()=>(e.value,!!t()))}function rh(t,e,n={}){const{window:i=Ia,...s}=n;let o;const r=oh(()=>i&&"MutationObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},u=At(()=>Ta(t),l=>{a(),r.value&&i&&l&&(o=new MutationObserver(e),o.observe(l,s))},{immediate:!0}),c=()=>{a(),u()};return Sa(c),{isSupported:r,stop:c}}function Da(){const t=_r(),e=Jd(()=>null,()=>t.proxy.$el);return ul(e.trigger),ge(e.trigger),e}function ah(t){return lh(t)}function qi(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function lh(t){for(let e=t;e;e=qi(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=qi(t);e;e=qi(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||n.filter!=="none"||e.tagName==="BODY"))return e}return null}const uh=tt({inheritAttrs:!1,__name:"Dropdown",props:{items:{},placement:{default:"bottom-start"},teleport:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},theme:{default:"border"},teleportTo:{default:"body"},variant:{},size:{},loading:{type:Boolean},promise:{},confirm:{type:Boolean},is:{},stateTimeout:{},confirmLabel:{},label:{},icon:{},iconLeft:{},iconRight:{default:"fa-pro-regular:angle-down"}},setup(t){const e=t,n=H(()=>{const{items:v,placement:k,teleport:w,keepOpen:T,...M}=e;return M}),i=J(!1),s=Da(),o=J(),r=J(),a=J({top:"",left:"",position:""});let u=()=>{};function c(){!o.value||!r.value||(u=Yd(o.value.$el,r.value,()=>{!o.value||!r.value||Zd(o.value.$el,r.value,{placement:e.placement,middleware:[Od(8),Kd()],platform:{...Cs,getOffsetParent:v=>Cs.getOffsetParent(v,ah)}}).then(({x:v,y:k})=>{a.value={top:`${k}px`,left:`${v}px`,position:"absolute"}})}))}Ei(u),Er(()=>{if(i.value)return c();u()});const l=({target:v},k="dom")=>{if(v instanceof Element&&!(!o.value||!r.value)){if(k==="dom")return[o.value.$el,r.value].some(w=>w&&(v===w||w.contains(v)))?void 0:h(!1);if(k==="shadow-dom"){const w=s.value.getRootNode();return v.shadowRoot===w?void 0:h(!1)}}},d=({key:v})=>v==="Escape"&&h(!1),h=(v=!i.value)=>(v?f():y(),i.value=v,!0),p=H(()=>s.value.getRootNode()),g=H(()=>p.value instanceof ShadowRoot);function f(){window.addEventListener("keydown",d),g.value?(p.value.addEventListener("click",v=>l(v)),window.addEventListener("click",v=>l(v,"shadow-dom"))):window.addEventListener("click",l)}function y(){window.removeEventListener("keydown",d),g.value?(p.value.removeEventListener("click",v=>l(v)),window.removeEventListener("click",v=>l(v,"shadow-dom"))):window.removeEventListener("click",l)}return(v,k)=>(_(),O(le,null,[Et(he,ot({...n.value,...v.$attrs},{onClick:k[0]||(k[0]=()=>h()),ref_key:"trigger",ref:o}),br({_:2},[v.$slots["icon-left"]?{name:"icon-left",fn:rt(()=>[z(v.$slots,"icon-left")]),key:"0"}:void 0,v.$slots.trigger?{name:"default",fn:rt(()=>[z(v.$slots,"trigger")]),key:"1"}:void 0,v.$slots["icon-right"]?{name:"icon-right",fn:rt(()=>[z(v.$slots,"icon-right")]),key:"2"}:void 0]),1040),(_(),it(yr,{to:v.teleportTo,disabled:!v.teleport},[Et(Cr,{name:"k-dropdown"},{default:rt(()=>[i.value?(_(),O("div",{key:0,class:qt(`k-dropdown k-dropdown--theme-${v.theme}`),style:ve(a.value),ref_key:"content",ref:r,onClick:k[1]||(k[1]=()=>!v.keepOpen&&h(!1))},[z(v.$slots,"default",{close:h.bind(null,!1)},()=>[(_(!0),O(le,null,rn(v.items,({action:w,icon:T,...M})=>(_(),it(he,ot(M,{variant:"tertiary","icon-right":M.iconRight||T,onClick:()=>w()}),null,16,["icon-right","onClick"]))),256))])],6)):q("",!0)]),_:3})],8,["to","disabled"]))],64))}}),ch={key:0,class:"k-datatable__row"},dh={key:0,class:"k-datatable__cell k-datatable__cell-select"},hh=["onClick"],ph=["innerHTML"],fh={key:1,class:"k-datatable__cell k-datatable__cell-actions"},gh={key:0,class:"k-datatable__cell k-datatable__cell-select"},vh={key:1,class:"k-datatable__cell k-datatable__cell-actions"},mh={key:0,class:"k-datatable__footer"},ig=tt({__name:"DataTable",props:{items:{},selected:{},theme:{default:"default"},header:{type:Boolean,default:!0},sticky:{type:[Boolean,String]},sortBy:{},sortableBy:{default:()=>[]},isDisabled:{type:Function,default:()=>!1},columns:{},labels:{default:()=>({selection:"Valgt",resetSelection:"Tilbakestill valg"})},cellWrapper:{type:Function,default:()=>({component:"div"})},rowWrapper:{type:Function,default:()=>({component:"div"})}},emits:["update:selected","update:sortBy"],setup(t,{emit:e}){const n=t,i=hl(),s=J([-1]),o=H(()=>n.items.filter(p=>!n.isDisabled(p))),r=H(()=>!!n.selected),a=H(()=>!!(Object.keys(n.sortBy||{}).length&&n.sortableBy.length)),u=H(()=>!!i.rowActions),c=H({get:()=>!!(o.value.length&&o.value.every(p=>n.selected&&n.selected.includes(p))),set:p=>e("update:selected",p?[...o.value]:[])}),l=H(()=>[r.value?"2.5rem":!1,...n.columns.filter(({disabled:p})=>!p).map(p=>p.size||"auto"),u.value?"0px":!1].filter(Boolean).join(" "));function d(p){var g;if(!a.value||!n.sortableBy.includes(p))return;let f=((g=n.sortBy)==null?void 0:g[p])||-1;e("update:sortBy",{[p]:f*-1})}function h(p,g){if(!(p.target instanceof HTMLInputElement))return;let f=s.value.slice(-1).pop()||-1,y=[];if(p.shiftKey){let v=f>g,k=f+(v?-1:1);for(;v?k>g:k<g;){let w=n.items[k];!(n.selected||[]).includes(w)&&!n.isDisabled(w)&&y.push(w),v?k--:k++}}p.target.checked?s.value.push(g):f===g&&s.value.pop(),e("update:selected",[...n.selected||[],...y])}return(p,g)=>(_(),O("div",{class:qt([`k-datatable k-datatable--${p.theme}`,{"k-datatable--sticky":!!p.sticky,"k-datatable--no-header":!p.header}]),style:ve(`--k-datatable-layout: ${l.value}; --k-datatable-sticky-top: ${typeof p.sticky=="string"?p.sticky:"0"}`)},[p.header?(_(),O("div",ch,[r.value?(_(),O("div",dh,[Et(Po,{class:"k-datatable__checkbox",modelValue:c.value,"onUpdate:modelValue":g[0]||(g[0]=f=>c.value=f),disabled:!p.items.length},null,8,["modelValue","disabled"])])):q("",!0),(_(!0),O(le,null,rn(p.columns.filter(({disabled:f})=>!f),f=>(_(),O("div",{class:qt(["k-datatable__cell",`k-datatable__cell--text-align-${f.align||"start"}`,{"k-datatable__cell-sort":a.value&&p.sortableBy.includes(f.id),"k-datatable__cell-sort--active":f.id in(p.sortBy||{})}]),key:f.id,onClick:y=>d(f.id)},[z(p.$slots,`${f.id}-label`,{item:f},()=>[ut("span",{innerHTML:f.label},null,8,ph)]),Et(lt(ze),{class:"k-datatable__cell-sort-icon",icon:(p.sortBy||{})[f.id]<0?"fa-pro-solid:caret-up":"fa-pro-solid:caret-down"},null,8,["icon"])],10,hh))),128)),u.value?(_(),O("div",fh)):q("",!0)])):q("",!0),(_(!0),O(le,null,rn(p.items,(f,y)=>(_(),O("div",{class:"k-datatable__row",key:y},[r.value?(_(),O("div",gh,[Et(Po,{class:"k-datatable__checkbox","model-value":p.selected||[],"onUpdate:modelValue":g[1]||(g[1]=v=>e("update:selected",v)),value:f,onClick:v=>h(v,y),onMousedown:g[2]||(g[2]=pl(()=>{},["prevent"])),disabled:p.isDisabled(f)},null,8,["model-value","value","onClick","disabled"])])):q("",!0),(_(),it(de(p.rowWrapper(f).component),ot({class:"k-datatable__row-wrapper"},p.rowWrapper(f).bind),{default:rt(()=>[(_(!0),O(le,null,rn(p.columns.filter(({disabled:v})=>!v),(v,k)=>(_(),it(de(p.cellWrapper(f,v).component),ot(p.cellWrapper(f,v).bind,{class:`k-datatable__cell k-datatable__cell--text-align-${v.align||"start"}`,key:`col-${v.id}`,"data-cell-id":v.id}),{default:rt(()=>[z(p.$slots,v.id,{item:f,column:v,rowIndex:y,colIndex:k})]),_:2},1040,["class","data-cell-id"]))),128))]),_:2},1040)),p.$slots["row-actions"]?(_(),O("div",vh,[z(p.$slots,"row-actions",{item:f})])):q("",!0)]))),128)),Et(Cr,{name:"k-datatable-footer"},{default:rt(()=>{var f,y;return[p.$slots.footer||(f=p.selected)!=null&&f.length?(_(),O("div",mh,[(y=p.selected)!=null&&y.length?(_(),it(uh,{key:0,label:`${p.labels.selection} (${p.selected.length})`,teleport:""},{default:rt(()=>[z(p.$slots,"select-actions"),Et(he,{label:p.labels.resetSelection,"icon-right":"fa-pro-light:times-square",variant:"tertiary",onClick:g[3]||(g[3]=v=>e("update:selected",[]))},null,8,["label"])]),_:3},8,["label"])):q("",!0),z(p.$slots,"footer")])):q("",!0)]}),_:3})],6))}});var _s,xe=new Map,bh=t=>t.getBoundingClientRect();function yh(t,e){const{scope:n="rect",getRect:i=bh,onChange:s}=e,o=xh({scope:n,getRect:i}),r=xe.get(t);return r?(r.callbacks.push(s),s(i(t))):(xe.set(t,{rect:{},callbacks:[s]}),xe.size===1&&(_s=requestAnimationFrame(o))),function(){const a=xe.get(t);if(!a)return;const u=a.callbacks.indexOf(s);u>-1&&a.callbacks.splice(u,1),a.callbacks.length===0&&(xe.delete(t),xe.size===0&&cancelAnimationFrame(_s))}}function xh(t){const{scope:e,getRect:n}=t,i=Eh(e);return function s(){const o=[];xe.forEach((r,a)=>{const u=n(a);i(r.rect,u)||(r.rect=u,o.push(r))}),o.forEach(r=>{r.callbacks.forEach(a=>a(r.rect))}),_s=requestAnimationFrame(s)}}var Fa=(t,e)=>t.width===e.width&&t.height===e.height,Oa=(t,e)=>t.top===e.top&&t.left===e.left,kh=(t,e)=>Fa(t,e)&&Oa(t,e);function Eh(t){return t==="size"?Fa:t==="position"?Oa:kh}var wh=ue("radio-group").parts("root","label","radio","radioLabel","radioControl","indicator"),Pe=wh.build(),G=En({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`radio-group:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`radio-group:${t.id}:label`},getRadioId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.radio)==null?void 0:i.call(n,e))??`radio-group:${t.id}:radio:${e}`},getRadioHiddenInputId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.radioHiddenInput)==null?void 0:i.call(n,e))??`radio-group:${t.id}:radio:input:${e}`},getRadioControlId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.radioControl)==null?void 0:i.call(n,e))??`radio-group:${t.id}:radio:control:${e}`},getRadioLabelId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.radioLabel)==null?void 0:i.call(n,e))??`radio-group:${t.id}:radio:label:${e}`},getIndicatorId:t=>{var e;return((e=t.ids)==null?void 0:e.indicator)??`radio-group:${t.id}:indicator`},getRootEl:t=>G.getById(t,G.getRootId(t)),getRadioHiddenInputEl:(t,e)=>G.getById(t,G.getRadioHiddenInputId(t,e)),getIndicatorEl:t=>G.getById(t,G.getIndicatorId(t)),getFirstEnabledInputEl:t=>{var e;return(e=G.getRootEl(t))==null?void 0:e.querySelector("input:not(:disabled)")},getFirstEnabledAndCheckedInputEl:t=>{var e;return(e=G.getRootEl(t))==null?void 0:e.querySelector("input:not(:disabled):checked")},getInputEls:t=>{const e=`input[type=radio][data-ownedby='${CSS.escape(G.getRootId(t))}']:not([disabled])`;return Xr(G.getRootEl(t),e)},getActiveRadioEl:t=>{if(t.value)return G.getById(t,G.getRadioId(t,t.value))},getOffsetRect:t=>({left:t?.offsetLeft??0,top:t?.offsetTop??0,width:t?.offsetWidth??0,height:t?.offsetHeight??0}),getRectById:(t,e)=>{const n=G.getById(t,G.getRadioId(t,e));if(n)return G.resolveRect(G.getOffsetRect(n))},resolveRect:t=>({width:`${t.width}px`,height:`${t.height}px`,left:`${t.left}px`,top:`${t.top}px`})});function Ch(t,e,n){const i=t.context.isDisabled;function s(a){const u={isInvalid:a.invalid,isDisabled:a.disabled||i,isChecked:t.context.value===a.value,isFocused:t.context.focusedId===a.value,isHovered:t.context.hoveredId===a.value,isActive:t.context.activeId===a.value};return{...u,isInteractive:!u.isDisabled}}function o(a){const u=s(a);return{"data-focus":gt(u.isFocused),"data-disabled":gt(u.isDisabled),"data-state":u.isChecked?"checked":"unchecked","data-hover":gt(u.isHovered),"data-invalid":gt(u.isInvalid),"data-orientation":t.context.orientation}}const r=()=>{const a=G.getFirstEnabledAndCheckedInputEl(t.context);if(a){a.focus();return}const u=G.getFirstEnabledInputEl(t.context);u?.focus()};return{value:t.context.value,setValue(a){e({type:"SET_VALUE",value:a,isTrusted:!1})},clearValue(){e({type:"SET_VALUE",value:null,isTrusted:!1})},focus:r,blur(){const a=G.getActiveElement(t.context);G.getInputEls(t.context).some(u=>u===a)&&a?.blur()},getRadioState:s,rootProps:n.element({...Pe.root.attrs,role:"radiogroup",id:G.getRootId(t.context),"aria-labelledby":G.getLabelId(t.context),"data-orientation":t.context.orientation,"data-disabled":gt(i),"aria-orientation":t.context.orientation,dir:t.context.dir}),labelProps:n.element({...Pe.label.attrs,"data-orientation":t.context.orientation,"data-disabled":gt(i),id:G.getLabelId(t.context),onClick:r}),getRadioProps(a){const u=s(a);return n.label({...Pe.radio.attrs,id:G.getRadioId(t.context,a.value),htmlFor:G.getRadioHiddenInputId(t.context,a.value),...o(a),onPointerMove(){u.isInteractive&&e({type:"SET_HOVERED",value:a.value,hovered:!0})},onPointerLeave(){u.isInteractive&&e({type:"SET_HOVERED",value:null})},onPointerDown(c){u.isInteractive&&(u.isFocused&&c.pointerType==="mouse"&&c.preventDefault(),e({type:"SET_ACTIVE",value:a.value,active:!0}))},onPointerUp(){u.isInteractive&&e({type:"SET_ACTIVE",value:null})}})},getRadioLabelProps(a){return n.element({...Pe.radioLabel.attrs,id:G.getRadioLabelId(t.context,a.value),...o(a)})},getRadioControlProps(a){const u=s(a);return n.element({...Pe.radioControl.attrs,id:G.getRadioControlId(t.context,a.value),"data-active":gt(u.isActive),"aria-hidden":!0,...o(a)})},getRadioHiddenInputProps(a){const u=s(a),c=a.required,l=u.isDisabled&&!a.focusable;return n.input({"data-ownedby":G.getRootId(t.context),id:G.getRadioHiddenInputId(t.context,a.value),type:"radio",name:t.context.name||t.context.id,form:t.context.form,value:a.value,onChange(d){u.isDisabled||d.target.checked&&e({type:"SET_VALUE",value:a.value,isTrusted:!0})},onBlur(){e({type:"SET_FOCUSED",value:null})},onFocus(){e({type:"SET_FOCUSED",value:a.value,focused:!0})},onKeyDown(d){d.key===" "&&e({type:"SET_ACTIVE",value:a.value,active:!0})},onKeyUp(d){d.key===" "&&e({type:"SET_ACTIVE",value:null})},disabled:l,required:c,defaultChecked:u.isChecked,"data-disabled":gt(u.isDisabled),"aria-required":Dn(c),"aria-invalid":Dn(u.isInvalid),"aria-disabled":Dn(l),"aria-checked":Dn(u.isChecked),style:Kr})},indicatorProps:n.element({id:G.getIndicatorId(t.context),...Pe.indicator.attrs,"data-disabled":gt(i),"data-orientation":t.context.orientation,style:{"--transition-duration":"150ms","--transition-property":"left, top, width, height",position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:t.context.canIndicatorTransition?"var(--transition-duration)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",...t.context.indicatorRect}})}}var{not:_h}=ta;function Sh(t){const e=Si(t);return zs({id:"radio",initial:"idle",context:{value:null,activeId:null,focusedId:null,hoveredId:null,disabled:!1,...e,indicatorRect:{},canIndicatorTransition:!1,fieldsetDisabled:!1},computed:{isDisabled:n=>!!n.disabled||n.fieldsetDisabled},entry:["syncIndicatorRect"],exit:["cleanupObserver"],activities:["trackFormControlState"],watch:{value:["setIndicatorTransition","syncIndicatorRect","syncInputElements"]},on:{SET_VALUE:[{guard:_h("isTrusted"),actions:["setValue","dispatchChangeEvent"]},{actions:["setValue"]}],SET_HOVERED:{actions:"setHovered"},SET_ACTIVE:{actions:"setActive"},SET_FOCUSED:{actions:"setFocused"}},states:{idle:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackFormControlState(n,i,{send:s,initialContext:o}){return ra(G.getRootEl(n),{onFieldsetDisabledChange(r){n.fieldsetDisabled=r},onFormReset(){s({type:"SET_VALUE",value:o.value})}})}},actions:{setValue(n,i){Th.value(n,i.value)},setHovered(n,i){n.hoveredId=i.value},setActive(n,i){n.activeId=i.value},setFocused(n,i){n.focusedId=i.value},syncInputElements(n){G.getInputEls(n).forEach(i=>{i.checked=i.value===n.value})},setIndicatorTransition(n){n.canIndicatorTransition=dc(n.value)},cleanupObserver(n){var i;(i=n.indicatorCleanup)==null||i.call(n)},syncIndicatorRect(n){var i;if((i=n.indicatorCleanup)==null||i.call(n),!G.getIndicatorEl(n))return;if(n.value==null){n.indicatorRect={};return}const s=G.getActiveRadioEl(n);s&&(n.indicatorCleanup=yh(s,{getRect(o){return G.getOffsetRect(o)},onChange(o){n.indicatorRect=G.resolveRect(o),Yr(()=>{n.canIndicatorTransition=!1})}}))},dispatchChangeEvent(n){G.getInputEls(n).forEach(i=>{const s=i.value===n.value;s!==i.checked&&oa(i,{checked:s})})}}})}var Ah={change:t=>{var e;t.value!=null&&((e=t.onChange)==null||e.call(t,{value:t.value}))}},Th={value:(t,e)=>{t.value=e,Ah.change(t)}};const Ih=["aria-describedby"],sg=tt({__name:"RadioGroup",props:{label:{},modelValue:{},items:{},variant:{default:"radio"},direction:{default:"vertical"},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=wr(Gs,H(()=>({label:""}))),s={id:Ie(),name:Ie(),...n,value:n.modelValue,onChange:({value:u})=>e("update:modelValue",u)},[o,r]=Ti(Sh(s),{context:H(()=>n)}),a=H(()=>Ch(o.value,r,Ai));return At(()=>n.modelValue,u=>a.value.setValue(u)),(u,c)=>(_(),O("div",ot({class:["k-radiogroup",`k-radiogroup--variant-${u.variant} k-radiogroup--direction-${u.direction}`]},a.value.rootProps,{"aria-describedby":lt(i).helpId}),[u.variant==="radio"&&(lt(i).label||u.label)?(_(),O("span",kt(ot({key:0},a.value.labelProps)),ct(lt(i).label||u.label),17)):q("",!0),u.variant==="segment"?(_(),O("div",kt(ot({key:1},a.value.indicatorProps)),null,16)):q("",!0),(_(!0),O(le,null,rn(u.items,l=>(_(),O("label",kt(Rt(a.value.getRadioProps({value:l.id}))),[ut("span",kt(Rt(a.value.getRadioLabelProps({value:l.id}))),ct(l.label),17),ut("input",kt(Rt(a.value.getRadioHiddenInputProps({value:l.id}))),null,16),ut("div",kt(Rt(a.value.getRadioControlProps({value:l.id}))),null,16)],16))),256))],16,Ih))}}),og=tt({__name:"Grid",props:{is:{type:[Object,Function],default:"div"},columns:{default:1},align:{},rows:{},gap:{default:"default"},areas:{}},setup(t){const e=t,n=(o,r)=>o?typeof o=="number"||typeof o=="string"&&o.match(/^\d+$/)?`repeat(${o}, 1fr)`:o.match(/^(\d+\s?)+$/)?o.split(" ").map(a=>`${a}fr`).join(" "):o:r,i=o=>{if(o)return Array.isArray(o)?o.map(r=>`"${r}"`).join(`
1
+ import{q as tt,E as so,I as al,r as J,H as At,b as H,o as _,e as it,w as rt,G as Li,c as O,f as z,F as le,a as ut,m as ot,j as Et,a0 as br,d as q,O as yr,z as xr,v as lt,C as Ht,t as ct,A as kr,g as de,Q as ll,i as ge,D as Ei,n as qt,J as ul,y as ve,K as kt,L as Rt,N as Er,$ as cl,M as wr,P as dl,k as rn,B as Cr,a9 as hl,l as pl,a3 as fl,s as oo,R as An,S as gl,U as vl,V as ml,W as _r,a2 as bl,Y as yl,Z as xl}from"./_plugin-vue_export-helper.js";function Sr(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Sr(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}function kl(){for(var t,e,n=0,i="";n<arguments.length;)(t=arguments[n++])&&(e=Sr(t))&&(i&&(i+=" "),i+=e);return i}const ro=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,ao=kl,Ar=(t,e)=>n=>{var i;if(e?.variants==null)return ao(t,n?.class,n?.className);const{variants:s,defaultVariants:o}=e,r=Object.keys(s).map(c=>{const l=n?.[c],d=o?.[c];if(l===null)return null;const h=ro(l)||ro(d);return s[c][h]}),a=n&&Object.entries(n).reduce((c,l)=>{let[d,h]=l;return h===void 0||(c[d]=h),c},{}),u=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((c,l)=>{let{class:d,className:h,...p}=l;return Object.entries(p).every(g=>{let[f,y]=g;return Array.isArray(y)?y.includes({...o,...a}[f]):{...o,...a}[f]===y})?[...c,d,h]:c},[]);return ao(t,r,u,n?.class,n?.className)},an=/^[a-z0-9]+(-[a-z0-9]+)*$/,wi=(t,e,n,i="")=>{const s=t.split(":");if(t.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),u=s.pop(),c={provider:s.length>0?s[0]:i,prefix:u,name:a};return e&&!Vn(c)?null:c}const o=s[0],r=o.split("-");if(r.length>1){const a={provider:i,prefix:r.shift(),name:r.join("-")};return e&&!Vn(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:o};return e&&!Vn(a,n)?null:a}return null},Vn=(t,e)=>t?!!((t.provider===""||t.provider.match(an))&&(e&&t.prefix===""||t.prefix.match(an))&&t.name.match(an)):!1,Tr=Object.freeze({left:0,top:0,width:16,height:16}),Zn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ci=Object.freeze({...Tr,...Zn}),ls=Object.freeze({...Ci,body:"",hidden:!1});function El(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const i=((t.rotate||0)+(e.rotate||0))%4;return i&&(n.rotate=i),n}function lo(t,e){const n=El(t,e);for(const i in ls)i in Zn?i in t&&!(i in n)&&(n[i]=Zn[i]):i in e?n[i]=e[i]:i in t&&(n[i]=t[i]);return n}function wl(t,e){const n=t.icons,i=t.aliases||Object.create(null),s=Object.create(null);function o(r){if(n[r])return s[r]=[];if(!(r in s)){s[r]=null;const a=i[r]&&i[r].parent,u=a&&o(a);u&&(s[r]=[a].concat(u))}return s[r]}return(e||Object.keys(n).concat(Object.keys(i))).forEach(o),s}function Cl(t,e,n){const i=t.icons,s=t.aliases||Object.create(null);let o={};function r(a){o=lo(i[a]||s[a],o)}return r(e),n.forEach(r),lo(t,o)}function Ir(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(s=>{e(s,null),n.push(s)});const i=wl(t);for(const s in i){const o=i[s];o&&(e(s,Cl(t,s,o)),n.push(s))}return n}const _l={provider:"",aliases:{},not_found:{},...Tr};function Bi(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Dr(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!Bi(t,_l))return null;const n=e.icons;for(const s in n){const o=n[s];if(!s.match(an)||typeof o.body!="string"||!Bi(o,ls))return null}const i=e.aliases||Object.create(null);for(const s in i){const o=i[s],r=o.parent;if(!s.match(an)||typeof r!="string"||!n[r]&&!i[r]||!Bi(o,ls))return null}return e}const uo=Object.create(null);function Sl(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Te(t,e){const n=uo[t]||(uo[t]=Object.create(null));return n[e]||(n[e]=Sl(t,e))}function Os(t,e){return Dr(e)?Ir(e,(n,i)=>{i?t.icons[n]=i:t.missing.add(n)}):[]}function Al(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let bn=!1;function Fr(t){return typeof t=="boolean"&&(bn=t),bn}function Tl(t){const e=typeof t=="string"?wi(t,!0,bn):t;if(e){const n=Te(e.provider,e.prefix),i=e.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function Il(t,e){const n=wi(t,!0,bn);if(!n)return!1;const i=Te(n.provider,n.prefix);return Al(i,n.name,e)}function Dl(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),bn&&!e&&!t.prefix){let s=!1;return Dr(t)&&(t.prefix="",Ir(t,(o,r)=>{r&&Il(o,r)&&(s=!0)})),s}const n=t.prefix;if(!Vn({provider:e,prefix:n,name:"a"}))return!1;const i=Te(e,n);return!!Os(i,t)}const Or=Object.freeze({width:null,height:null}),Mr=Object.freeze({...Or,...Zn}),Fl=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ol=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function co(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const i=t.split(Fl);if(i===null||!i.length)return t;const s=[];let o=i.shift(),r=Ol.test(o);for(;;){if(r){const a=parseFloat(o);isNaN(a)?s.push(o):s.push(Math.ceil(a*e*n)/n)}else s.push(o);if(o=i.shift(),o===void 0)return s.join("");r=!r}}const Ml=t=>t==="unset"||t==="undefined"||t==="none";function Rl(t,e){const n={...Ci,...t},i={...Mr,...e},s={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,i].forEach(g=>{const f=[],y=g.hFlip,v=g.vFlip;let k=g.rotate;y?v?k+=2:(f.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),f.push("scale(-1 1)"),s.top=s.left=0):v&&(f.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),f.push("scale(1 -1)"),s.top=s.left=0);let w;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:w=s.height/2+s.top,f.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:f.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:w=s.width/2+s.left,f.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}k%2===1&&(s.left!==s.top&&(w=s.left,s.left=s.top,s.top=w),s.width!==s.height&&(w=s.width,s.width=s.height,s.height=w)),f.length&&(o='<g transform="'+f.join(" ")+'">'+o+"</g>")});const r=i.width,a=i.height,u=s.width,c=s.height;let l,d;r===null?(d=a===null?"1em":a==="auto"?c:a,l=co(d,u/c)):(l=r==="auto"?u:r,d=a===null?co(l,c/u):a==="auto"?c:a);const h={},p=(g,f)=>{Ml(f)||(h[g]=f.toString())};return p("width",l),p("height",d),h.viewBox=s.left.toString()+" "+s.top.toString()+" "+u.toString()+" "+c.toString(),{attributes:h,body:o}}const Pl=/\sid="(\S+)"/g,Ll="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Bl=0;function Nl(t,e=Ll){const n=[];let i;for(;i=Pl.exec(t);)n.push(i[1]);if(!n.length)return t;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const r=typeof e=="function"?e(o):e+(Bl++).toString(),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+s+"$3")}),t=t.replace(new RegExp(s,"g"),""),t}const us=Object.create(null);function jl(t,e){us[t]=e}function cs(t){return us[t]||us[""]}function Ms(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const Rs=Object.create(null),Tn=["https://api.simplesvg.com","https://api.unisvg.com"],ds=[];for(;Tn.length>0;)Tn.length===1||Math.random()>.5?ds.push(Tn.shift()):ds.push(Tn.pop());Rs[""]=Ms({resources:["https://api.iconify.design"].concat(ds)});function Rr(t,e){const n=Ms(e);return n===null?!1:(Rs[t]=n,!0)}function Ps(t){return Rs[t]}const Vl=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}};let ho=Vl();function $l(t,e){const n=Ps(t);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let s=0;n.resources.forEach(r=>{s=Math.max(s,r.length)});const o=e+".json?icons=";i=n.maxURL-s-n.path.length-o.length}return i}function zl(t){return t===404}const Hl=(t,e,n)=>{const i=[],s=$l(t,e),o="icons";let r={type:o,provider:t,prefix:e,icons:[]},a=0;return n.forEach((u,c)=>{a+=u.length+1,a>=s&&c>0&&(i.push(r),r={type:o,provider:t,prefix:e,icons:[]},a=u.length),r.icons.push(u)}),i.push(r),i};function Gl(t){if(typeof t=="string"){const e=Ps(t);if(e)return e.path}return"/"}const ql=(t,e,n)=>{if(!ho){n("abort",424);return}let i=Gl(e.provider);switch(e.type){case"icons":{const o=e.prefix,r=e.icons.join(","),a=new URLSearchParams({icons:r});i+=o+".json?"+a.toString();break}case"custom":{const o=e.uri;i+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let s=503;ho(t+i).then(o=>{const r=o.status;if(r!==200){setTimeout(()=>{n(zl(r)?"abort":"next",r)});return}return s=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",s)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",s)})},Ul={prepare:Hl,send:ql};function Wl(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((s,o)=>s.provider!==o.provider?s.provider.localeCompare(o.provider):s.prefix!==o.prefix?s.prefix.localeCompare(o.prefix):s.name.localeCompare(o.name));let i={provider:"",prefix:"",name:""};return t.forEach(s=>{if(i.name===s.name&&i.prefix===s.prefix&&i.provider===s.provider)return;i=s;const o=s.provider,r=s.prefix,a=s.name,u=n[o]||(n[o]=Object.create(null)),c=u[r]||(u[r]=Te(o,r));let l;a in c.icons?l=e.loaded:r===""||c.missing.has(a)?l=e.missing:l=e.pending;const d={provider:o,prefix:r,name:a};l.push(d)}),e}function Pr(t,e){t.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(s=>s.id!==e))})}function Xl(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const i=t.provider,s=t.prefix;e.forEach(o=>{const r=o.icons,a=r.pending.length;r.pending=r.pending.filter(u=>{if(u.prefix!==s)return!0;const c=u.name;if(t.icons[c])r.loaded.push({provider:i,prefix:s,name:c});else if(t.missing.has(c))r.missing.push({provider:i,prefix:s,name:c});else return n=!0,!0;return!1}),r.pending.length!==a&&(n||Pr([t],o.id),o.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),o.abort))})}))}let Yl=0;function Kl(t,e,n){const i=Yl++,s=Pr.bind(null,n,i);if(!e.pending.length)return s;const o={id:i,icons:e,callback:t,abort:s};return n.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(o)}),s}function Zl(t,e=!0,n=!1){const i=[];return t.forEach(s=>{const o=typeof s=="string"?wi(s,e,n):s;o&&i.push(o)}),i}var Jl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ql(t,e,n,i){const s=t.resources.length,o=t.random?Math.floor(Math.random()*s):t.index;let r;if(t.random){let D=t.resources.slice(0);for(r=[];D.length>1;){const W=Math.floor(Math.random()*D.length);r.push(D[W]),D=D.slice(0,W).concat(D.slice(W+1))}r=r.concat(D)}else r=t.resources.slice(o).concat(t.resources.slice(0,o));const a=Date.now();let u="pending",c=0,l,d=null,h=[],p=[];typeof i=="function"&&p.push(i);function g(){d&&(clearTimeout(d),d=null)}function f(){u==="pending"&&(u="aborted"),g(),h.forEach(D=>{D.status==="pending"&&(D.status="aborted")}),h=[]}function y(D,W){W&&(p=[]),typeof D=="function"&&p.push(D)}function v(){return{startTime:a,payload:e,status:u,queriesSent:c,queriesPending:h.length,subscribe:y,abort:f}}function k(){u="failed",p.forEach(D=>{D(void 0,l)})}function w(){h.forEach(D=>{D.status==="pending"&&(D.status="aborted")}),h=[]}function T(D,W,x){const b=W!=="success";switch(h=h.filter(m=>m!==D),u){case"pending":break;case"failed":if(b||!t.dataAfterTimeout)return;break;default:return}if(W==="abort"){l=x,k();return}if(b){l=x,h.length||(r.length?M():k());return}if(g(),w(),!t.random){const m=t.resources.indexOf(D.resource);m!==-1&&m!==t.index&&(t.index=m)}u="completed",p.forEach(m=>{m(x)})}function M(){if(u!=="pending")return;g();const D=r.shift();if(D===void 0){if(h.length){d=setTimeout(()=>{g(),u==="pending"&&(w(),k())},t.timeout);return}k();return}const W={status:"pending",resource:D,callback:(x,b)=>{T(W,x,b)}};h.push(W),c++,d=setTimeout(M,t.rotate),n(D,e,W.callback)}return setTimeout(M),v}function Lr(t){const e={...Jl,...t};let n=[];function i(){n=n.filter(r=>r().status==="pending")}function s(r,a,u){const c=Ql(e,r,a,(l,d)=>{i(),u&&u(l,d)});return n.push(c),c}function o(r){return n.find(a=>r(a))||null}return{query:s,find:o,setIndex:r=>{e.index=r},getIndex:()=>e.index,cleanup:i}}function po(){}const Ni=Object.create(null);function tu(t){if(!Ni[t]){const e=Ps(t);if(!e)return;const n=Lr(e),i={config:e,redundancy:n};Ni[t]=i}return Ni[t]}function eu(t,e,n){let i,s;if(typeof t=="string"){const o=cs(t);if(!o)return n(void 0,424),po;s=o.send;const r=tu(t);r&&(i=r.redundancy)}else{const o=Ms(t);if(o){i=Lr(o);const r=t.resources?t.resources[0]:"",a=cs(r);a&&(s=a.send)}}return!i||!s?(n(void 0,424),po):i.query(e,s,n)().abort}const fo="iconify2",yn="iconify",Br=yn+"-count",go=yn+"-version",Nr=36e5,nu=168;function hs(t,e){try{return t.getItem(e)}catch{}}function Ls(t,e,n){try{return t.setItem(e,n),!0}catch{}}function vo(t,e){try{t.removeItem(e)}catch{}}function ps(t,e){return Ls(t,Br,e.toString())}function fs(t){return parseInt(hs(t,Br))||0}const _i={local:!0,session:!0},jr={local:new Set,session:new Set};let Bs=!1;function iu(t){Bs=t}let In=typeof window>"u"?{}:window;function Vr(t){const e=t+"Storage";try{if(In&&In[e]&&typeof In[e].length=="number")return In[e]}catch{}_i[t]=!1}function $r(t,e){const n=Vr(t);if(!n)return;const i=hs(n,go);if(i!==fo){if(i){const a=fs(n);for(let u=0;u<a;u++)vo(n,yn+u.toString())}Ls(n,go,fo),ps(n,0);return}const s=Math.floor(Date.now()/Nr)-nu,o=a=>{const u=yn+a.toString(),c=hs(n,u);if(typeof c=="string"){try{const l=JSON.parse(c);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>s&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&e(l,a))return!0}catch{}vo(n,u)}};let r=fs(n);for(let a=r-1;a>=0;a--)o(a)||(a===r-1?(r--,ps(n,r)):jr[t].add(a))}function zr(){if(!Bs){iu(!0);for(const t in _i)$r(t,e=>{const n=e.data,i=e.provider,s=n.prefix,o=Te(i,s);if(!Os(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function su(t,e){const n=t.lastModifiedCached;if(n&&n>=e)return n===e;if(t.lastModifiedCached=e,n)for(const i in _i)$r(i,s=>{const o=s.data;return s.provider!==t.provider||o.prefix!==t.prefix||o.lastModified===e});return!0}function ou(t,e){Bs||zr();function n(i){let s;if(!_i[i]||!(s=Vr(i)))return;const o=jr[i];let r;if(o.size)o.delete(r=Array.from(o).shift());else if(r=fs(s),!ps(s,r+1))return;const a={cached:Math.floor(Date.now()/Nr),provider:t.provider,data:e};return Ls(s,yn+r.toString(),JSON.stringify(a))}e.lastModified&&!su(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&(e=Object.assign({},e),delete e.not_found),n("local")||n("session"))}function mo(){}function ru(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Xl(t)}))}function au(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:i}=t,s=t.iconsToLoad;delete t.iconsToLoad;let o;!s||!(o=cs(n))||o.prepare(n,i,s).forEach(r=>{eu(n,r,a=>{if(typeof a!="object")r.icons.forEach(u=>{t.missing.add(u)});else try{const u=Os(t,a);if(!u.length)return;const c=t.pendingIcons;c&&u.forEach(l=>{c.delete(l)}),ou(t,a)}catch(u){console.error(u)}ru(t)})})}))}const lu=(t,e)=>{const n=Zl(t,!0,Fr()),i=Wl(n);if(!i.pending.length){let u=!0;return e&&setTimeout(()=>{u&&e(i.loaded,i.missing,i.pending,mo)}),()=>{u=!1}}const s=Object.create(null),o=[];let r,a;return i.pending.forEach(u=>{const{provider:c,prefix:l}=u;if(l===a&&c===r)return;r=c,a=l,o.push(Te(c,l));const d=s[c]||(s[c]=Object.create(null));d[l]||(d[l]=[])}),i.pending.forEach(u=>{const{provider:c,prefix:l,name:d}=u,h=Te(c,l),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(d)||(p.add(d),s[c][l].push(d))}),o.forEach(u=>{const{provider:c,prefix:l}=u;s[c][l].length&&au(u,s[c][l])}),e?Kl(e,i,o):mo};function uu(t,e){const n={...t};for(const i in e){const s=e[i],o=typeof s;i in Or?(s===null||s&&(o==="string"||o==="number"))&&(n[i]=s):o===typeof n[i]&&(n[i]=i==="rotate"?s%4:s)}return n}const cu=/[\s,]+/;function du(t,e){e.split(cu).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function hu(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function i(s){for(;s<0;)s+=4;return s%4}if(n===""){const s=parseInt(t);return isNaN(s)?0:i(s)}else if(n!==t){let s=0;switch(n){case"%":s=25;break;case"deg":s=90}if(s){let o=parseFloat(t.slice(0,t.length-n.length));return isNaN(o)?0:(o=o/s,o%1===0?i(o):0)}}return e}function pu(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)n+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function fu(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function gu(t){return"data:image/svg+xml,"+fu(t)}function vu(t){return'url("'+gu(t)+'")'}const bo={...Mr,inline:!1},mu={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},bu={display:"inline-block"},gs={backgroundColor:"currentColor"},Hr={backgroundColor:"transparent"},yo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},xo={webkitMask:gs,mask:gs,background:Hr};for(const t in xo){const e=xo[t];for(const n in yo)e[t+n]=yo[n]}const $n={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";$n[t+"-flip"]=e,$n[t.slice(0,1)+"-flip"]=e,$n[t+"Flip"]=e});function ko(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const Eo=(t,e)=>{const n=uu(bo,e),i={...mu},s=e.mode||"svg",o={},r=e.style,a=typeof r=="object"&&!(r instanceof Array)?r:{};for(let f in e){const y=e[f];if(y!==void 0)switch(f){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[f]=y===!0||y==="true"||y===1;break;case"flip":typeof y=="string"&&du(n,y);break;case"color":o.color=y;break;case"rotate":typeof y=="string"?n[f]=hu(y):typeof y=="number"&&(n[f]=y);break;case"ariaHidden":case"aria-hidden":y!==!0&&y!=="true"&&delete i["aria-hidden"];break;default:{const v=$n[f];v?(y===!0||y==="true"||y===1)&&(n[v]=!0):bo[f]===void 0&&(i[f]=y)}}}const u=Rl(t,n),c=u.attributes;if(n.inline&&(o.verticalAlign="-0.125em"),s==="svg"){i.style={...o,...a},Object.assign(i,c);let f=0,y=e.id;return typeof y=="string"&&(y=y.replace(/-/g,"_")),i.innerHTML=Nl(u.body,y?()=>y+"ID"+f++:"iconifyVue"),oo("svg",i)}const{body:l,width:d,height:h}=t,p=s==="mask"||(s==="bg"?!1:l.indexOf("currentColor")!==-1),g=pu(l,{...c,width:d+"",height:h+""});return i.style={...o,"--svg":vu(g),width:ko(c.width),height:ko(c.height),...bu,...p?gs:Hr,...a},oo("span",i)};Fr(!0);jl("",Ul);if(typeof document<"u"&&typeof window<"u"){zr();const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Dl(i))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const i="IconifyProviders["+n+"] is invalid.";try{const s=e[n];if(typeof s!="object"||!s||s.resources===void 0)continue;Rr(n,s)||console.error(i)}catch{console.error(i)}}}}const yu={...Ci,body:""},ze=tt({inheritAttrs:!1,data(){return{iconMounted:!1,counter:0}},mounted(){this._name="",this._loadingIcon=null,this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(t,e){if(typeof t=="object"&&t!==null&&typeof t.body=="string")return this._name="",this.abortLoading(),{data:t};let n;if(typeof t!="string"||(n=wi(t,!1,!0))===null)return this.abortLoading(),null;const i=Tl(n);if(!i)return(!this._loadingIcon||this._loadingIcon.name!==t)&&(this.abortLoading(),this._name="",i!==null&&(this._loadingIcon={name:t,abort:lu([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==t&&(this._name=t,e&&e(t));const s=["iconify"];return n.prefix!==""&&s.push("iconify--"+n.prefix),n.provider!==""&&s.push("iconify--"+n.provider),{data:i,classes:s}}},render(){this.counter;const t=this.$attrs,e=this.iconMounted?this.getIcon(t.icon,t.onLoad):null;if(!e)return Eo(yu,t);let n=t;return e.classes&&(n={...t,class:(typeof t.class=="string"?t.class+" ":"")+e.classes.join(" ")}),Eo({...Ci,...e.data},n)}});Rr("",{resources:["https://icons.ui.kvass.no"]});function xu(t){return!t||typeof t!="object"?!1:typeof t.then=="function"&&typeof t.catch=="function"}const ku=["xxs","xs","sm","default","lg","xl","xxl","3xl","4xl"],Eu=(t,e)=>e==="default"?`var(--k-ui-${t})`:`var(--k-ui-${t}-${e})`,Jn=t=>{switch(t){case"start":case"end":return`flex-${t}`;default:return t}},Ns=(t,e="spacing")=>t.split(" ").map(n=>typeof n=="number"||typeof n=="string"&&n.match(/^\d+$/)?`${n}rem`:typeof n=="string"&&ku.includes(n)?Eu(e,n):n).join(" ");function wu(){var t=new Date().getTime(),e=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var i=Math.random()*16;return t>0?(i=(t+i)%16|0,t=Math.floor(t/16)):(i=(e+i)%16|0,e=Math.floor(e/16)),(n==="x"?i:i&3|8).toString(16)})}const Gr=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,i])=>[`--k-${t}-${n}`,i])),qr=tt({__name:"Spinner",props:{size:{default:"medium"}},setup(t){return(e,n)=>(_(),O("span",{class:qt(`k-spinner k-spinner--size-${e.size}`)},null,2))}}),Cu={class:"k-button__content"},_u={key:0,class:"k-button__icon k-button__icon--left"},Su={key:1,class:"k-button__icon k-button__icon--right"},Au={key:2,class:"k-button__confirm-label"},he=tt({__name:"Button",props:{variant:{default:"secondary"},size:{default:"medium"},loading:{type:Boolean},promise:{},confirm:{type:Boolean},is:{type:[String,Object,Function],default:"button"},stateTimeout:{default:1e3},confirmLabel:{default:"Are you sure?"},label:{},icon:{},iconLeft:{},iconRight:{}},emits:["idle","loading","success","error","confirm","click"],setup(t,{emit:e}){const n=t,i={success:"success",confirm:"warning",error:"danger",loading:null,idle:null},s=H(()=>!d.value||u.value==="loading"?n.variant:u.value=="confirm"?"warning":i[u.value]||n.variant),o=H(()=>n.loading||u.value==="loading"),r=J(),a=H(()=>{if(u.value)return["error","success"].includes(u.value)||o.value}),u=J("idle"),c=J(),l=J(),d=H(()=>u.value||o.value),h=H(()=>["error","success"].includes(u.value)),p=H(()=>u.value==="success"?"fa-pro-regular:check":"fa-pro-regular:exclamation-circle");function g(T){if(!T)return;f(),l.value=T,r.value=setTimeout(()=>u.value="loading",100);let M=D=>{f(),n.stateTimeout?(u.value=D,c.value=setTimeout(()=>{f(),e(D)},n.stateTimeout)):e(D)};l.value.then(()=>M("success")).catch(()=>M("error"))}function f(){r.value&&clearTimeout(r.value),c.value&&clearTimeout(c.value),l.value=null,u.value="idle"}At(()=>n.promise,T=>{T&&xu(T)&&g(T)});const y=J(),v=H(()=>u.value==="confirm");function k(T){if(n.confirm&&u.value!=="confirm")return u.value="confirm";f(),e("click",T)}const w=Ar("k-button",{variants:{variant:{primary:"k-button--variant-primary",secondary:"k-button--variant-secondary",tertiary:"k-button--variant-tertiary",danger:"k-button--variant-danger",warning:"k-button--variant-warning",success:"k-button--variant-success"},size:{small:"k-button--size-small",medium:"k-button--size-medium",large:"k-button--size-large"},isLoading:{true:"k-button--loading"},isBusy:{true:"k-button--busy"}}});return(T,M)=>(_(),it(de(T.is),ot({type:"button",class:lt(w)({variant:s.value,size:T.size,isLoading:o.value,isBusy:a.value}),"aria-busy":a.value,inert:a.value},T.$attrs,{onClick:k,ref_key:"rootElement",ref:y}),{default:rt(()=>[xr(ut("span",Cu,[T.icon||T.iconLeft||T.$slots.icon||T.$slots["icon-left"]?(_(),O("span",_u,[z(T.$slots,"icon-left",{},()=>[z(T.$slots,"icon",{},()=>[Et(lt(ze),{icon:T.icon||T.iconLeft},null,8,["icon"])])])])):q("",!0),z(T.$slots,"default",{},()=>[Ht(ct(T.label),1)]),T.iconRight||T.$slots["icon-right"]?(_(),O("span",Su,[z(T.$slots,"icon-right",{},()=>[Et(lt(ze),{icon:T.iconRight},null,8,["icon"])])])):q("",!0)],512),[[kr,!v.value]]),o.value?(_(),it(qr,{key:0})):q("",!0),h.value?(_(),it(lt(ze),{key:1,class:"k-button__state-indicator",icon:p.value},null,8,["icon"])):q("",!0),v.value?(_(),O("span",Au,ct(T.confirmLabel),1)):q("",!0)]),_:3},16,["class","aria-busy","inert"]))}});var ue=(t,e=[])=>({parts:(...n)=>{if(Tu(e))return ue(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>ue(t,[...e,...n]),rename:n=>ue(n,e),keys:()=>e,build:()=>[...new Set(e)].reduce((n,i)=>Object.assign(n,{[i]:{selector:[`&[data-scope="${Re(t)}"][data-part="${Re(i)}"]`,`& [data-scope="${Re(t)}"][data-part="${Re(i)}"]`].join(", "),attrs:{"data-scope":Re(t),"data-part":Re(i)}}}),{})}),Re=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Tu=t=>t.length===0,gt=t=>t?"":void 0,Dn=t=>t?"true":void 0;function Qn(t){return typeof t=="object"&&t?.nodeType===Node.ELEMENT_NODE&&typeof t?.nodeName=="string"}function ti(t,e){return!t||!e||!Qn(t)||!Qn(e)?!1:t===e||t.contains(e)}var Iu=t=>t.nodeType===Node.DOCUMENT_NODE?t:t.ownerDocument??document;function En(t){const e={getRootNode:n=>{var i;return((i=n.getRootNode)==null?void 0:i.call(n))??document},getDoc:n=>Iu(e.getRootNode(n)),getWin:n=>e.getDoc(n).defaultView??window,getActiveElement:n=>e.getDoc(n).activeElement,getById:(n,i)=>e.getRootNode(n).getElementById(i),setValue:(n,i)=>{n==null||i==null||(n.value=i.toString())}};return{...e,...t}}var Du=t=>t.nodeType===Node.DOCUMENT_NODE;function js(t){return Du(t)?t:t?.ownerDocument??document}function Fu(t){return t?.ownerDocument.defaultView??window}function ei(t){var e;return((e=t.composedPath)==null?void 0:e.call(t)[0])??t.target}var Ur=()=>typeof document<"u";function Ou(){const t=navigator.userAgentData;return t?.platform??navigator.platform}var Wr=t=>Ur()&&t.test(Ou()),Mu=()=>Ur()&&!!navigator.maxTouchPoints,Ru=()=>Wr(/^Mac/)&&!Mu(),Pu=()=>Wr(/mac|iphone|ipad|ipod/i),Lu=()=>Pu()&&!Ru();function Xr(t,e){return Array.from(t?.querySelectorAll(e)??[])}function Yr(t){const e=new Set;function n(i){const s=globalThis.requestAnimationFrame(i);e.add(()=>globalThis.cancelAnimationFrame(s))}return n(()=>n(t)),function(){e.forEach(i=>i())}}function xn(t){const e=globalThis.requestAnimationFrame(t);return()=>{globalThis.cancelAnimationFrame(e)}}var Kr={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};const Bu=Symbol(),wo=Object.getPrototypeOf,vs=new WeakMap,Nu=t=>t&&(vs.has(t)?vs.get(t):wo(t)===Object.prototype||wo(t)===Array.prototype),Zr=t=>Nu(t)&&t[Bu]||null,ni=(t,e=!0)=>{vs.set(t,e)};var ji=t=>typeof t=="object"&&t!==null,Ee=new WeakMap,tn=new WeakSet,ju=(t=Object.is,e=(c,l)=>new Proxy(c,l),n=c=>ji(c)&&!tn.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),i=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},s=new WeakMap,o=(c,l,d=i)=>{const h=s.get(c);if(h?.[0]===l)return h[1];const p=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return ni(p,!0),s.set(c,[l,p]),Reflect.ownKeys(c).forEach(g=>{const f=Reflect.get(c,g);tn.has(f)?(ni(f,!1),p[g]=f):f instanceof Promise?Object.defineProperty(p,g,{get(){return d(f)}}):Ee.has(f)?p[g]=Ue(f,d):p[g]=f}),Object.freeze(p)},r=new WeakMap,a=[1,1],u=c=>{if(!ji(c))throw new Error("object required");const l=r.get(c);if(l)return l;let d=a[0];const h=new Set,p=(x,b=++a[0])=>{d!==b&&(d=b,h.forEach(m=>m(x,b)))};let g=a[1];const f=(x=++a[1])=>(g!==x&&!h.size&&(g=x,v.forEach(([b])=>{const m=b[1](x);m>d&&(d=m)})),d),y=x=>(b,m)=>{const E=[...b];E[1]=[x,...E[1]],p(E,m)},v=new Map,k=(x,b)=>{if(h.size){const m=b[3](y(x));v.set(x,[b,m])}else v.set(x,[b])},w=x=>{var b;const m=v.get(x);m&&(v.delete(x),(b=m[1])==null||b.call(m))},T=x=>(h.add(x),h.size===1&&v.forEach(([b,m],E)=>{const F=b[3](y(E));v.set(E,[b,F])}),()=>{h.delete(x),h.size===0&&v.forEach(([b,m],E)=>{m&&(m(),v.set(E,[b]))})}),M=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),D=e(M,{deleteProperty(x,b){const m=Reflect.get(x,b);w(b);const E=Reflect.deleteProperty(x,b);return E&&p(["delete",[b],m]),E},set(x,b,m,E){var F;const $=Reflect.has(x,b),N=Reflect.get(x,b,E);if($&&(t(N,m)||r.has(m)&&t(N,r.get(m))))return!0;w(b),ji(m)&&(m=Zr(m)||m);let B=m;if(!((F=Object.getOwnPropertyDescriptor(x,b))!=null&&F.set))if(m instanceof Promise)m.then(P=>{m.status="fulfilled",m.value=P,p(["resolve",[b],P])}).catch(P=>{m.status="rejected",m.reason=P,p(["reject",[b],P])});else{!Ee.has(m)&&n(m)&&(B=Vs(m));const P=!tn.has(B)&&Ee.get(B);P&&k(b,P)}return Reflect.set(x,b,B,E),p(["set",[b],m,N]),!0}});r.set(c,D);const W=[M,f,o,T];return Ee.set(D,W),Reflect.ownKeys(c).forEach(x=>{const b=Object.getOwnPropertyDescriptor(c,x);b.get||b.set?Object.defineProperty(M,x,b):D[x]=c[x]}),D})=>[u,Ee,tn,t,e,n,i,s,o,r,a],[Vu]=ju();function Vs(t={}){return Vu(t)}function ms(t,e,n){const i=Ee.get(t);let s;const o=[],r=i[3];let a=!1;const u=r(c=>{if(o.push(c),n){e(o.splice(0));return}s||(s=Promise.resolve().then(()=>{s=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,u()}}function Ue(t,e){const n=Ee.get(t),[i,s,o]=n;return o(i,s(),e)}function Co(t){return tn.add(t),t}function $u(t,e){Object.keys(e).forEach(i=>{if(Object.getOwnPropertyDescriptor(t,i))throw new Error("object property already defined");const s=e[i],{get:o,set:r}=typeof s=="function"?{get:s}:s,a={};a.get=()=>o(Ue(n)),r&&(a.set=u=>r(n,u)),Object.defineProperty(t,i,a)});const n=Vs(t);return n}var zu=(t,e)=>Object.is(t,e);function _o(t,e,n,i,s){let o=Reflect.get(Ue(t),e);const r=s||zu;function a(){const u=Ue(t);r(o,u[e])||(n(u[e]),o=Reflect.get(u,e))}return ms(t,a,i)}function So(t,e,n){typeof n.value=="object"&&(n.value=_e(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function _e(t){if(typeof t!="object")return t;var e=0,n,i,s,o=Object.prototype.toString.call(t);if(o==="[object Object]"?s=Object.create(t.__proto__||null):o==="[object Array]"?s=Array(t.length):o==="[object Set]"?(s=new Set,t.forEach(function(r){s.add(_e(r))})):o==="[object Map]"?(s=new Map,t.forEach(function(r,a){s.set(_e(a),_e(r))})):o==="[object Date]"?s=new Date(+t):o==="[object RegExp]"?s=new RegExp(t.source,t.flags):o==="[object DataView]"?s=new t.constructor(_e(t.buffer)):o==="[object ArrayBuffer]"?s=t.slice(0):o.slice(-6)==="Array]"&&(s=new t.constructor(t)),s){for(i=Object.getOwnPropertySymbols(t);e<i.length;e++)So(s,i[e],Object.getOwnPropertyDescriptor(t,i[e]));for(e=0,i=Object.getOwnPropertyNames(t);e<i.length;e++)Object.hasOwnProperty.call(s,n=i[e])&&s[n]===t[n]||So(s,n,Object.getOwnPropertyDescriptor(t,n))}return s||t}var Hu=Object.defineProperty,Gu=(t,e,n)=>e in t?Hu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e,n)=>(Gu(t,typeof e!="symbol"?e+"":e,n),n);function qu(t){for(;t.length>0;)t.pop();return t}var Ao=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,Xt=t=>t,Vi=()=>{},Uu=(()=>{let t=0;return()=>(t++,t.toString(36))})(),ln=t=>Array.isArray(t),un=t=>!(t==null||typeof t!="object"||ln(t)),Wu=t=>typeof t=="number"&&!Number.isNaN(t),zt=t=>typeof t=="string",ii=t=>typeof t=="function";function si(t){if(!Xu(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(i=>typeof i=="string"),n={};for(const i of e){const s=t[i];s!==void 0&&(n[i]=si(s))}return n}var Xu=t=>t&&typeof t=="object"&&t.constructor===Object;function $i(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function zn(...t){const e=t.length===1?t[0]:t[1];t.length!==2||t[0]}function Jr(t,...e){for(const n of e){const i=si(n);for(const s in i)un(n[s])?(t[s]||(t[s]={}),Jr(t[s],n[s])):t[s]=n[s]}return t}function To(t){return _e(t)}function vt(t){return zt(t)?{type:t}:t}function ie(t){return t?ln(t)?t.slice():[t]:[]}function Qr(t){return un(t)&&t.predicate!=null}var Yu=()=>!0;function $s(t,e,n,i){return s=>{var o;return zt(s)?!!((o=t[s])!=null&&o.call(t,e,n,i)):ii(s)?s(e,n,i):s.predicate(t)(e,n,i)}}function Ku(...t){return{predicate:e=>(n,i,s)=>t.map($s(e,n,i,s)).some(Boolean)}}function Zu(...t){return{predicate:e=>(n,i,s)=>t.map($s(e,n,i,s)).every(Boolean)}}function Ju(t){return{predicate:e=>(n,i,s)=>!$s(e,n,i,s)(t)}}function Qu(...t){return(e,n,i)=>i.state.matches(...t)}var ta={or:Ku,and:Zu,not:Ju,stateIn:Qu};function ea(t,e){return t=t??Yu,(n,i,s)=>{if(zt(t)){const o=e[t];return ii(o)?o(n,i,s):o}return Qr(t)?t.predicate(e)(n,i,s):t?.(n,i,s)}}function zi(t,e){return(n,i,s)=>Qr(t)?t.predicate(e)(n,i,s):t}function tc(t){const e=t.computed??Xt({}),n=t.context??Xt({}),i=Vs({value:t.initial??"",previousValue:"",event:Xt({}),previousEvent:Xt({}),context:$u(n,e),done:!1,tags:[],hasTag(s){return this.tags.includes(s)},matches(...s){return s.includes(this.value)},can(s){return Xt(this).nextEvents.includes(s)},get nextEvents(){var s,o;const r=((o=(s=t.states)==null?void 0:s[this.value])==null?void 0:o.on)??{},a=t?.on??{};return Object.keys({...r,...a})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return Xt(i)}function Fn(t,e){return(n,i)=>{if(Wu(t))return t;if(ii(t))return t(n,i);if(zt(t)){const s=Number.parseFloat(t);if(!Number.isNaN(s))return s;if(e){const o=e?.[t];return zn(o==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${t}\`. It doesn't exist in \`options.delays\``),ii(o)?o(n,i):o}}}}function ec(t){return zt(t)?{target:t}:t}function nc(t,e){return(n,i,s)=>ie(t).map(ec).find(o=>ea(o.guard,e)(n,i,s)??o.target??o.actions)}var ic=class na{constructor(e,n){var i,s,o,r,a,u;A(this,"status","Not Started"),A(this,"state"),A(this,"initialState"),A(this,"initialContext"),A(this,"id"),A(this,"type","machine"),A(this,"activityEvents",new Map),A(this,"delayedEvents",new Map),A(this,"stateListeners",new Set),A(this,"contextListeners",new Set),A(this,"eventListeners",new Set),A(this,"doneListeners",new Set),A(this,"contextWatchers",new Set),A(this,"removeStateListener",Vi),A(this,"removeEventListener",Vi),A(this,"removeContextListener",Vi),A(this,"parent"),A(this,"children",new Map),A(this,"guardMap"),A(this,"actionMap"),A(this,"delayMap"),A(this,"activityMap"),A(this,"sync"),A(this,"options"),A(this,"config"),A(this,"start",l=>{if(this.state.value="",this.status==="Running")return this;this.status="Running",this.removeStateListener=ms(this.state,()=>{this.stateListeners.forEach(y=>{y(this.stateSnapshot)})},this.sync),this.removeEventListener=_o(this.state,"event",y=>{this.executeActions(this.config.onEvent,y),this.eventListeners.forEach(v=>{v(y)})},this.sync),this.removeContextListener=ms(this.state.context,()=>{this.log("Context:",this.contextSnapshot),this.contextListeners.forEach(y=>{y(this.contextSnapshot)})},this.sync||this.options.debug),this.setupContextWatchers(),this.executeActivities(vt("machine.start"),ie(this.config.activities),"machine.start"),this.executeActions(this.config.entry,vt("machine.start"));const d=vt("machine.init"),h=un(l)?l.value:l,p=un(l)?l.context:void 0;p&&this.setContext(p);const g={target:h??this.config.initial},f=this.getNextStateInfo(g,d);return this.initialState=f,this.performStateChangeEffects(this.state.value,f,d),this}),A(this,"setupContextWatchers",()=>{var l;for(const[d,h]of Object.entries(this.config.watch??{})){const p=(l=this.options.compareFns)==null?void 0:l[d],g=_o(this.state.context,d,()=>{this.executeActions(h,this.state.event)},this.sync,p);this.contextWatchers.add(g)}}),A(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,vt("machine.stop")),this.executeActions(this.config.exit,vt("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.stopEventListeners(),this.stopContextListeners(),this.status="Stopped",this}),A(this,"stopEventListeners",()=>{this.eventListeners.clear(),this.removeEventListener()}),A(this,"stopContextListeners",()=>{this.contextListeners.clear(),this.removeContextListener()}),A(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),A(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(l=>l()),this.contextWatchers.clear()}),A(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(l=>{l.forEach(d=>d())}),this.delayedEvents.clear()}),A(this,"stopActivities",l=>{var d,h;l?((d=this.activityEvents.get(l))==null||d.forEach(p=>p()),(h=this.activityEvents.get(l))==null||h.clear(),this.activityEvents.delete(l)):(this.activityEvents.forEach(p=>{p.forEach(g=>g()),p.clear()}),this.activityEvents.clear())}),A(this,"sendChild",(l,d)=>{const h=vt(l),p=Ao(d,this.contextSnapshot),g=this.children.get(p);g||zn(`[@zag-js/core] Cannot send '${h.type}' event to unknown child`),g.send(h)}),A(this,"stopChild",l=>{this.children.has(l)||zn(`[@zag-js/core > stop-child] Cannot stop unknown child ${l}`),this.children.get(l).stop(),this.children.delete(l)}),A(this,"removeChild",l=>{this.children.delete(l)}),A(this,"stopChildren",()=>{this.children.forEach(l=>l.stop()),this.children.clear()}),A(this,"setParent",l=>{this.parent=l}),A(this,"spawn",(l,d)=>{const h=Ao(l);return d&&(h.id=d),h.type="machine.actor",h.setParent(this),this.children.set(h.id,Xt(h)),h.onDone(()=>{this.removeChild(h.id)}).start(),Xt(Co(h))}),A(this,"addActivityCleanup",(l,d)=>{var h;l&&(this.activityEvents.has(l)?(h=this.activityEvents.get(l))==null||h.add(d):this.activityEvents.set(l,new Set([d])))}),A(this,"setState",l=>{this.state.previousValue=this.state.value,this.state.value=l;const d=this.getStateNode(l);l==null?qu(this.state.tags):this.state.tags=ie(d?.tags)}),A(this,"transformContext",l=>{var d,h;return(h=(d=this.options)==null?void 0:d.transformContext)==null||h.call(d,l),l}),A(this,"setContext",l=>{l&&Jr(this.state.context,this.transformContext(l))}),A(this,"withContext",l=>{const d=this.transformContext(l),h={...this.config.context,...si(d)};return new na({...this.config,context:h},this.options)}),A(this,"setOptions",l=>{const d=si(l);this.actionMap={...this.actionMap,...d.actions},this.delayMap={...this.delayMap,...d.delays},this.activityMap={...this.activityMap,...d.activities},this.guardMap={...this.guardMap,...d.guards}}),A(this,"getStateNode",l=>{var d;if(l)return(d=this.config.states)==null?void 0:d[l]}),A(this,"getNextStateInfo",(l,d)=>{const h=this.determineTransition(l,d),p=!(h!=null&&h.target),g=h?.target??this.state.value,f=this.state.value!==g,y=this.getStateNode(g),v={reenter:!p&&!f&&!(h!=null&&h.internal),transition:h,stateNode:y,target:g,changed:f};return this.log("NextState:",`[${d.type}]`,this.state.value,"---->",v.target),v}),A(this,"getActionFromDelayedTransition",l=>{const d=vt("machine.after"),h=Fn(l.delay,this.delayMap)(this.contextSnapshot,d);let p;return{entry:()=>{p=globalThis.setTimeout(()=>{const g=this.getNextStateInfo(l,d);this.performStateChangeEffects(this.state.value,g,d)},h)},exit:()=>{globalThis.clearTimeout(p)}}}),A(this,"getDelayedEventActions",l=>{const d=this.getStateNode(l),h=vt("machine.after");if(!d||!d.after)return;const p=[],g=[];if(ln(d.after)){const f=this.determineTransition(d.after,h);if(!f)return;const y=this.getActionFromDelayedTransition(f);p.push(y.entry),g.push(y.exit)}else if(un(d.after))for(const f in d.after){const y=d.after[f];let v={};if(ln(y)){const w=this.determineTransition(y,h);w&&(v=w)}else zt(y)?v={target:y,delay:f}:v={...y,delay:f};const k=this.getActionFromDelayedTransition(v);p.push(k.entry),g.push(k.exit)}return{entries:p,exits:g}}),A(this,"executeActions",(l,d)=>{var h;const p=zi(l,this.guardMap)(this.contextSnapshot,d,this.guardMeta);for(const g of ie(p)){const f=zt(g)?(h=this.actionMap)==null?void 0:h[g]:g;$i(zt(g)&&!f,`[@zag-js/core > execute-actions] No implementation found for action: \`${g}\``),f?.(this.state.context,d,this.meta)}}),A(this,"executeActivities",(l,d,h)=>{var p;for(const g of d){const f=zt(g)?(p=this.activityMap)==null?void 0:p[g]:g;if(!f){$i(`[@zag-js/core > execute-activity] No implementation found for activity: \`${g}\``);continue}const y=f(this.state.context,l,this.meta);y&&this.addActivityCleanup(h??this.state.value,y)}}),A(this,"createEveryActivities",(l,d)=>{if(!l)return;const h=vt("machine.every");if(ln(l)){const p=ie(l).find(f=>{const y=f.delay,v=Fn(y,this.delayMap)(this.contextSnapshot,h);return ea(f.guard,this.guardMap)(this.contextSnapshot,h,this.guardMeta)??v!=null});if(!p)return;const g=Fn(p.delay,this.delayMap)(this.contextSnapshot,h);d(()=>{const f=globalThis.setInterval(()=>{this.executeActions(p.actions,h)},g);return()=>{globalThis.clearInterval(f)}})}else for(const p in l){const g=l?.[p],f=Fn(p,this.delayMap)(this.contextSnapshot,h);d(()=>{const y=globalThis.setInterval(()=>{this.executeActions(g,h)},f);return()=>{globalThis.clearInterval(y)}})}}),A(this,"setEvent",l=>{this.state.previousEvent=this.state.event,this.state.event=Co(vt(l))}),A(this,"performExitEffects",(l,d)=>{const h=this.state.value;if(h==="")return;const p=l?this.getStateNode(l):void 0;this.stopActivities(h);const g=zi(p?.exit,this.guardMap)(this.contextSnapshot,d,this.guardMeta),f=ie(g),y=this.delayedEvents.get(h);y&&f.push(...y),this.executeActions(f,d),this.eventListeners.clear()}),A(this,"performEntryEffects",(l,d)=>{const h=this.getStateNode(l),p=ie(h?.activities);this.createEveryActivities(h?.every,v=>{p.unshift(v)}),p.length>0&&this.executeActivities(d,p);const g=zi(h?.entry,this.guardMap)(this.contextSnapshot,d,this.guardMeta),f=ie(g),y=this.getDelayedEventActions(l);h!=null&&h.after&&y&&(this.delayedEvents.set(l,y?.exits),f.push(...y.entries)),this.executeActions(f,d),h?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(v=>{v(this.stateSnapshot)}),this.stop())}),A(this,"performTransitionEffects",(l,d)=>{const h=this.determineTransition(l,d);this.executeActions(h?.actions,d)}),A(this,"performStateChangeEffects",(l,d,h)=>{this.setEvent(h);const p=d.changed||d.reenter;p&&this.performExitEffects(l,h),this.performTransitionEffects(d.transition,h),this.setState(d.target),p&&this.performEntryEffects(d.target,h)}),A(this,"determineTransition",(l,d)=>{const h=nc(l,this.guardMap);return h?.(this.contextSnapshot,d,this.guardMeta)}),A(this,"sendParent",l=>{var d;this.parent||zn("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const h=vt(l);(d=this.parent)==null||d.send(h)}),A(this,"log",(...l)=>{}),A(this,"send",l=>{const d=vt(l);this.transition(this.state.value,d)}),A(this,"transition",(l,d)=>{var h,p;const g=zt(l)?this.getStateNode(l):l?.stateNode,f=vt(d);if(!g&&!this.config.on){const k=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${l}, \`event\`: ${f.type}`;$i(k);return}const y=((h=g?.on)==null?void 0:h[f.type])??((p=this.config.on)==null?void 0:p[f.type]),v=this.getNextStateInfo(y,f);return this.performStateChangeEffects(this.state.value,v,f),v.stateNode}),A(this,"subscribe",l=>(this.stateListeners.add(l),this.status==="Running"&&l(this.stateSnapshot),()=>{this.stateListeners.delete(l)})),A(this,"onDone",l=>(this.doneListeners.add(l),this)),A(this,"onTransition",l=>(this.stateListeners.add(l),this.status==="Running"&&l(this.stateSnapshot),this)),A(this,"onChange",l=>(this.contextListeners.add(l),this)),A(this,"onEvent",l=>(this.eventListeners.add(l),this)),this.config=To(e),this.options=To(n??{}),this.id=this.config.id??`machine-${Uu()}`,this.guardMap=((i=this.options)==null?void 0:i.guards)??{},this.actionMap=((s=this.options)==null?void 0:s.actions)??{},this.delayMap=((o=this.options)==null?void 0:o.delays)??{},this.activityMap=((r=this.options)==null?void 0:r.activities)??{},this.sync=((a=this.options)==null?void 0:a.sync)??!1,this.state=tc(this.config),this.initialContext=Ue(this.state.context),this.transformContext(this.state.context);const c=vt("machine.created");this.executeActions((u=this.config)==null?void 0:u.created,c)}get stateSnapshot(){return Xt(Ue(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){var n;return((n=e.initialState)==null?void 0:n.target)??""}}}get meta(){var e;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((e=this.initialState)==null?void 0:e.target)??"",getState:()=>this.stateSnapshot,getAction:n=>this.actionMap[n],getGuard:n=>this.guardMap[n]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}},zs=(t,e)=>new ic(t,e);function sc(t,e,n){if(!t)return;const i=t.ownerDocument.defaultView||window,s=new i.MutationObserver(o=>{for(const r of o)r.type==="attributes"&&r.attributeName&&e.includes(r.attributeName)&&n(r)});return s.observe(t,{attributes:!0,attributeFilter:e}),()=>s.disconnect()}var Hs=t=>t.ownerDocument.defaultView||window;function ia(t,e){const{type:n="HTMLInputElement",property:i="value"}=e,s=Hs(t)[n].prototype;return Object.getOwnPropertyDescriptor(s,i)??{}}function oc(t,e,n={}){var i;(i=ia(t,n).set)==null||i.call(t,e)}function rc(t,e){var n;(n=ia(t,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(t,e)}function sa(t,e){const{value:n,bubbles:i=!0}=e;if(!t)return;const s=Hs(t);t instanceof s.HTMLInputElement&&(oc(t,`${n}`),t.dispatchEvent(new s.Event("input",{bubbles:i})))}function oa(t,e){const{checked:n,bubbles:i=!0}=e;if(!t)return;const s=Hs(t);t instanceof s.HTMLInputElement&&(rc(t,n),t.dispatchEvent(new s.Event("click",{bubbles:i})),t.dispatchEvent(new s.Event("change",{bubbles:i})))}function ac(t){return lc(t)?t.form:t.closest("form")}function lc(t){return t.matches("textarea, input, select, button")}function uc(t,e){if(!t)return;const n=ac(t);return n?.addEventListener("reset",e,{passive:!0}),()=>{n?.removeEventListener("reset",e)}}function cc(t,e){const n=t?.closest("fieldset");if(n)return e(n.disabled),sc(n,["disabled"],()=>e(n.disabled))}function ra(t,e){if(!t)return;const{onFieldsetDisabledChange:n,onFormReset:i}=e,s=[uc(t,i),cc(t,n)];return()=>{s.forEach(o=>o?.())}}var Io=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,Do=(...t)=>(...e)=>{t.forEach(function(n){n?.(...e)})},dc=t=>typeof t=="string";function Si(t){if(!hc(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(i=>typeof i=="string"),n={};for(const i of e){const s=t[i];s!==void 0&&(n[i]=Si(s))}return n}var hc=t=>t&&typeof t=="object"&&t.constructor===Object;function pc(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}var fc=ue("checkbox").parts("root","label","control"),Hi=fc.build(),xt=En({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`checkbox:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`checkbox:${t.id}:label`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`checkbox:${t.id}:control`},getHiddenInputId:t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`checkbox:${t.id}:hidden`},getRootEl:t=>xt.getById(t,xt.getRootId(t)),getHiddenInputEl:t=>xt.getById(t,xt.getHiddenInputId(t))});function gc(t,e,n){const i=t.context.isDisabled,s=!i&&t.context.focused,o=t.context.isChecked,r=t.context.isIndeterminate,a={"data-active":gt(t.context.active),"data-focus":gt(s),"data-hover":gt(t.context.hovered),"data-disabled":gt(i),"data-state":r?"indeterminate":t.context.checked?"checked":"unchecked","data-invalid":gt(t.context.invalid)};return{isChecked:o,isDisabled:i,isIndeterminate:r,isFocused:s,checkedState:t.context.checked,setChecked(u){e({type:"CHECKED.SET",checked:u,isTrusted:!1})},toggleChecked(){e({type:"CHECKED.TOGGLE",checked:o,isTrusted:!1})},rootProps:n.label({...Hi.root.attrs,...a,id:xt.getRootId(t.context),htmlFor:xt.getHiddenInputId(t.context),onPointerMove(){i||e({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){i||e({type:"CONTEXT.SET",context:{hovered:!1}})},onPointerDown(u){i||(s&&u.pointerType==="mouse"&&u.preventDefault(),e({type:"CONTEXT.SET",context:{active:!0}}))},onPointerUp(){i||e({type:"CONTEXT.SET",context:{active:!1}})},onClick(u){u.target===xt.getHiddenInputEl(t.context)&&u.stopPropagation()}}),labelProps:n.element({...Hi.label.attrs,...a,id:xt.getLabelId(t.context)}),controlProps:n.element({...Hi.control.attrs,...a,id:xt.getControlId(t.context),"aria-hidden":!0}),hiddenInputProps:n.input({id:xt.getHiddenInputId(t.context),type:"checkbox",required:t.context.required,defaultChecked:o,disabled:i,"data-disabled":gt(i),"aria-labelledby":xt.getLabelId(t.context),"aria-invalid":t.context.invalid,name:t.context.name,form:t.context.form,value:t.context.value,style:Kr,onChange(u){const c=u.currentTarget.checked;e({type:"CHECKED.SET",checked:c,isTrusted:!0})},onBlur(){e({type:"CONTEXT.SET",context:{focused:!1}})},onFocus(){e({type:"CONTEXT.SET",context:{focused:!0}})},onKeyDown(u){u.key===" "&&e({type:"CONTEXT.SET",context:{active:!0}})},onKeyUp(u){u.key===" "&&e({type:"CONTEXT.SET",context:{active:!1}})}})}}var{not:Fo}=ta;function vc(t){const e=Si(t);return zs({id:"checkbox",initial:"ready",context:{checked:!1,value:"on",disabled:!1,...e,fieldsetDisabled:!1},watch:{disabled:"removeFocusIfNeeded",checked:"syncInputElement"},activities:["trackFormControlState"],on:{"CHECKED.TOGGLE":[{guard:Fo("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:Fo("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{isIndeterminate:n=>bs(n.checked),isChecked:n=>Oo(n.checked),isDisabled:n=>!!n.disabled||n.fieldsetDisabled},states:{ready:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackFormControlState(n,i,{send:s,initialContext:o}){return ra(xt.getHiddenInputEl(n),{onFieldsetDisabledChange(r){n.fieldsetDisabled=r},onFormReset(){s({type:"CHECKED.SET",checked:!!o.checked})}})}},actions:{setContext(n,i){Object.assign(n,i.context)},syncInputElement(n){const i=xt.getHiddenInputEl(n);i&&(i.checked=n.isChecked,i.indeterminate=n.isIndeterminate)},removeFocusIfNeeded(n){n.disabled&&n.focused&&(n.focused=!1)},setChecked(n,i){Mo.checked(n,i.checked)},toggleChecked(n){const i=bs(n.checked)?!0:!n.checked;Mo.checked(n,i)},dispatchChangeEvent(n){const i=xt.getHiddenInputEl(n);oa(i,{checked:Oo(n.checked)})}}})}function bs(t){return t==="indeterminate"}function Oo(t){return bs(t)?!1:!!t}var mc={change:t=>{var e;(e=t.onChange)==null||e.call(t,{checked:t.checked})}},Mo={checked:(t,e)=>{t.checked=e,mc.change(t)}};function bc(t){return new Proxy({},{get(){return t}})}function yc(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}var Ro={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"};function xc(t){return t in Ro?Ro[t]:t.startsWith("on")?`on${yc(t.substr(2))}`:t.toLowerCase()}var Ai=bc(t=>{const e={};for(const n in t){const i=t[n];n==="children"?typeof i=="string"&&(e.innerHTML=i):e[xc(n)]=t[n]}return e});function kc(t,e){const{actions:n,state:i,context:s}=e??{},o=typeof t=="function"?t():t,r=s?o.withContext(s.value):o;return ge(()=>{r.start(i),r.state.can("SETUP")&&r.send("SETUP"),Ei(()=>{r.stop()})}),Er(()=>{r.setOptions({actions:n})}),s&&At(s,r.setContext,{deep:!0}),r}function Ti(t,e){const n=kc(t,e),i=ll(n.state);return ge(()=>{const s=n.subscribe(o=>{i.value=o});Ei(()=>{s?.()})}),[i,n.send,n]}function Ie(t={}){const{prefix:e}=t,n=wu();return e?`${e}-${n}`:n}const Ec={class:"k-checkbox__label"},wc={key:0,class:"k-checkbox__help"},Po=tt({__name:"Checkbox",props:{modelValue:{type:[Boolean,Array]},value:{},label:{},disabled:{type:Boolean},help:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t;if(n.modelValue instanceof Array&&!n.value)throw new Error("props.value is required if props.modelValue is an array");const i=()=>{const{modelValue:c,value:l}=n;return c instanceof Array?c.some(d=>An(d)===An(l)):!!c};function s(c){const{modelValue:l,value:d}=n;if(!(l instanceof Array))return e("update:modelValue",typeof c=="boolean"?c:void 0);if(!(typeof c!="boolean"||!d))return c?e("update:modelValue",[...l,d]):e("update:modelValue",l.filter(h=>An(h)!==An(d)))}const o={id:Ie(),checked:i(),onChange:({checked:c})=>{if(i()!==c)return s(c)}},[r,a]=Ti(vc(o),{context:H(()=>({disabled:n.disabled}))}),u=H(()=>gc(r.value,a,Ai));return At(()=>n.modelValue,()=>{const c=i();if(u.value.isChecked!==c)return u.value.setChecked(c)}),(c,l)=>(_(),O("label",ot({class:"k-checkbox"},u.value.rootProps),[ut("div",kt(Rt(u.value.controlProps)),[u.value.isChecked?(_(),it(lt(ze),{key:0,icon:"fa-pro-solid:check"})):q("",!0)],16),ut("span",kt(Rt(u.value.labelProps)),[ut("span",Ec,[z(c.$slots,"default",{},()=>[Ht(ct(c.label),1)])]),c.$slots.help||c.help?(_(),O("span",wc,[z(c.$slots,"help",{},()=>[Ht(ct(c.help),1)])])):q("",!0)],16),ut("input",kt(Rt(u.value.hiddenInputProps)),null,16)],16))}}),Gs=Symbol("form-control"),Cc={class:"k-formcontrol"},_c=["for"],Sc={key:1,class:"k-formcontrol__error"},Ac={key:2,class:"k-formcontrol__help"},tg=tt({__name:"FormControl",props:{label:{},help:{},error:{}},setup(t){const e=t,n=Ie({prefix:"k-formcontrol"}),i=H(()=>`${n}_label`),s=H(()=>`${n}_help`);return cl(Gs,H(()=>({...e,id:n,labelId:i.value,helpId:s.value,invalid:!!e.error}))),(o,r)=>(_(),O("div",Cc,[o.$slots.label||o.label?(_(),O("label",{key:0,class:"k-formcontrol__label",for:lt(n)},[z(o.$slots,"label",{},()=>[Ht(ct(o.label),1)])],8,_c)):q("",!0),z(o.$slots,"default",{id:lt(n)}),o.$slots.error||o.error?(_(),O("span",Sc,[z(o.$slots,"error",{},()=>[Ht(ct(o.error),1)])])):q("",!0),o.$slots.help||o.help?(_(),O("span",Ac,[z(o.$slots,"help",{},()=>[Ht(ct(o.help),1)])])):q("",!0)]))}});function ce(t){return typeof t=="string"||t instanceof String}function Lo(t){var e;return typeof t=="object"&&t!=null&&(t==null||(e=t.constructor)==null?void 0:e.name)==="Object"}function aa(t,e){return Array.isArray(e)?aa(t,(n,i)=>e.includes(i)):Object.entries(t).reduce((n,i)=>{let[s,o]=i;return e(o,s)&&(n[s]=o),n},{})}const I={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Tc(t){switch(t){case I.LEFT:return I.FORCE_LEFT;case I.RIGHT:return I.FORCE_RIGHT;default:return t}}function Gi(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function oi(t,e){if(e===t)return!0;const n=Array.isArray(e),i=Array.isArray(t);let s;if(n&&i){if(e.length!=t.length)return!1;for(s=0;s<e.length;s++)if(!oi(e[s],t[s]))return!1;return!0}if(n!=i)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){const o=e instanceof Date,r=t instanceof Date;if(o&&r)return e.getTime()==t.getTime();if(o!=r)return!1;const a=e instanceof RegExp,u=t instanceof RegExp;if(a&&u)return e.toString()==t.toString();if(a!=u)return!1;const c=Object.keys(e);for(s=0;s<c.length;s++)if(!Object.prototype.hasOwnProperty.call(t,c[s]))return!1;for(s=0;s<c.length;s++)if(!oi(t[c[s]],e[c[s]]))return!1;return!0}else if(e&&t&&typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();return!1}class Ic{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?I.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?I.RIGHT:I.LEFT}}function V(t,e){return new V.InputMask(t,e)}function la(t){if(t==null)throw new Error("mask property should be defined");return t instanceof RegExp?V.MaskedRegExp:ce(t)?V.MaskedPattern:t===Date?V.MaskedDate:t===Number?V.MaskedNumber:Array.isArray(t)||t===Array?V.MaskedDynamic:V.Masked&&t.prototype instanceof V.Masked?t:V.Masked&&t instanceof V.Masked?t.constructor:t instanceof Function?V.MaskedFunction:(console.warn("Mask not found for mask",t),V.Masked)}function ri(t){if(!t)throw new Error("Options in not defined");if(V.Masked){if(t.prototype instanceof V.Masked)return{mask:t};const{mask:e=void 0,...n}=t instanceof V.Masked?{mask:t}:Lo(t)&&t.mask instanceof V.Masked?t:{};if(e){const i=e.mask;return{...aa(e,(s,o)=>!o.startsWith("_")),mask:e.constructor,_mask:i,...n}}}return Lo(t)?{...t}:{mask:t}}function De(t){if(V.Masked&&t instanceof V.Masked)return t;const e=ri(t),n=la(e.mask);if(!n)throw new Error("Masked class is not found for provided mask, appropriate module needs to be imported manually before creating mask.");return e.mask===n&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new n(e)}V.createMask=De;class qs{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,n){if(!(e==null||n==null||e===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(e,n)}catch{}}get isActive(){return!1}}V.MaskElement=qs;class Me extends qs{constructor(e){super(),this.input=e,this._handlers={}}get rootElement(){var e,n,i;return(e=(n=(i=this.input).getRootNode)==null?void 0:n.call(i))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){Object.keys(e).forEach(n=>this._toggleEventHandler(Me.EVENTS_MAP[n],e[n]))}unbindEvents(){Object.keys(this._handlers).forEach(e=>this._toggleEventHandler(e))}_toggleEventHandler(e,n){this._handlers[e]&&(this.input.removeEventListener(e,this._handlers[e]),delete this._handlers[e]),n&&(this.input.addEventListener(e,n),this._handlers[e]=n)}}Me.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"};V.HTMLMaskElement=Me;class Dc extends Me{constructor(e){super(e),this.input=e,this._handlers={}}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,n){this.input.setSelectionRange(e,n)}get value(){return this.input.value}set value(e){this.input.value=e}}V.HTMLMaskElement=Me;class ua extends Me{get _unsafeSelectionStart(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),i=n&&n.anchorOffset,s=n&&n.focusOffset;return s==null||i==null||i<s?i:s}get _unsafeSelectionEnd(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),i=n&&n.anchorOffset,s=n&&n.focusOffset;return s==null||i==null||i>s?i:s}_unsafeSelect(e,n){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,e),i.setEnd(this.input.lastChild||this.input,n);const s=this.rootElement,o=s.getSelection&&s.getSelection();o&&(o.removeAllRanges(),o.addRange(i))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}V.HTMLContenteditableMaskElement=ua;class Fc{constructor(e,n){this.el=e instanceof qs?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new ua(e):new Dc(e),this.masked=De(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var n;return e==null||((n=this.masked)==null?void 0:n.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof V.Masked)&&this.masked.constructor===la(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof V.Masked?e:De({mask:e});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(),this.alignCursor())}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(),this.alignCursor())}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,n){const i=this._listeners[e];i&&i.forEach(s=>s(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value}updateControl(){const e=this.masked.unmaskedValue,n=this.masked.value,i=this.displayValue,s=this.unmaskedValue!==e||this.value!==n;this._unmaskedValue=e,this._value=n,this.el.value!==i&&(this.el.value=i),s&&this._fireChangeEvents()}updateOptions(e){const{mask:n,...i}=e,s=!this.maskEquals(n),o=!oi(this.masked,i);s&&(this.mask=n),o&&this.masked.updateOptions(i),(s||o)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,I.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,n){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n),this}off(e,n){if(!this._listeners[e])return this;if(!n)return delete this._listeners[e],this;const i=this._listeners[e].indexOf(n);return i>=0&&this._listeners[e].splice(i,1),this}_onInput(e){if(this._inputEvent=e,this._abortUpdateCursor(),!this._selection)return this.updateValue();const n=new Ic({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,s=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,o=i===this.masked.rawInputValue?n.removeDirection:I.NONE;let r=this.masked.nearestInputPos(n.startChangePos+s,o);o!==I.NONE&&(r=this.masked.nearestInputPos(r,I.NONE)),this.updateControl(),this.updateCursor(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}V.InputMask=Fc;class Z{static normalize(e){return Array.isArray(e)?e:[e,new Z]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}aggregate(e){return this.rawInserted+=e.rawInserted,this.skip=this.skip||e.skip,this.inserted+=e.inserted,this.tailShift+=e.tailShift,this}get offset(){return this.tailShift+this.inserted.length}}V.ChangeDetails=Z;class Kt{constructor(e,n,i){e===void 0&&(e=""),n===void 0&&(n=0),this.value=e,this.from=n,this.stop=i}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class Tt{constructor(e){this._value="",this._update({...Tt.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){Object.keys(e).length&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,n){n===void 0&&(n={input:!0}),this.reset(),this.append(e,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,n){return e}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-e)}extractInput(e,n,i){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(e,n)}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new Kt(this.extractInput(e,n),e)}appendTail(e){return ce(e)&&(e=new Kt(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new Z({inserted:e,rawInserted:e})):new Z}_appendChar(e,n,i){n===void 0&&(n={});const s=this.state;let o;if([e,o]=this.doPrepareChar(e,n),o=o.aggregate(this._appendCharRaw(e,n)),o.inserted){let r,a=this.doValidate(n)!==!1;if(a&&i!=null){const u=this.state;this.overwrite===!0&&(r=i.state,i.unshift(this.displayValue.length-o.tailShift));let c=this.appendTail(i);a=c.rawInserted===i.toString(),!(a&&c.inserted)&&this.overwrite==="shift"&&(this.state=u,r=i.state,i.shift(),c=this.appendTail(i),a=c.rawInserted===i.toString()),a&&c.inserted&&(this.state=u)}a||(o=new Z,this.state=s,i&&r&&(i.state=r))}return o}_appendPlaceholder(){return new Z}_appendEager(){return new Z}append(e,n,i){if(!ce(e))throw new Error("value should be string");const s=ce(i)?new Kt(String(i)):i;n!=null&&n.tail&&(n._beforeTailState=this.state);let o;[e,o]=this.doPrepare(e,n);for(let r=0;r<e.length;++r){const a=this._appendChar(e[r],n,s);if(!a.rawInserted&&!this.doSkipInvalid(e[r],n,s))break;o.aggregate(a)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&e&&o.aggregate(this._appendEager()),s!=null&&(o.tailShift+=this.appendTail(s).tailShift),o}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(n),new Z}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const n=this.rawInputValue,i=this.value,s=e();return this.rawInputValue=n,this.value&&this.value!==i&&i.indexOf(this.value)===0&&this.append(i.slice(this.displayValue.length),{},""),delete this._refreshing,s}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const n=this.state,i=e(this);return this.state=n,delete this._isolated,i}doSkipInvalid(e,n,i){return!!this.skipInvalid}doPrepare(e,n){return n===void 0&&(n={}),Z.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),Z.normalize(this.prepareChar?this.prepareChar(e,this,n):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,n,i,s,o){s===void 0&&(s=I.NONE),o===void 0&&(o={input:!0});const r=e+n,a=this.extractTail(r),u=this.eager===!0||this.eager==="remove";let c;u&&(s=Tc(s),c=this.extractInput(0,r,{raw:!0}));let l=e;const d=new Z;if(s!==I.NONE&&(l=this.nearestInputPos(e,n>1&&e!==0&&!u?I.NONE:s),d.tailShift=l-e),d.aggregate(this.remove(l)),u&&s!==I.NONE&&c===this.rawInputValue)if(s===I.FORCE_LEFT){let h;for(;c===this.rawInputValue&&(h=this.displayValue.length);)d.aggregate(new Z({tailShift:-1})).aggregate(this.remove(h-1))}else s===I.FORCE_RIGHT&&a.unshift();return d.aggregate(this.append(i,o,a))}maskEquals(e){return this.mask===e}typedValueEquals(e){const n=this.typedValue;return e===n||Tt.EMPTY_VALUES.includes(e)&&Tt.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}}Tt.DEFAULTS={skipInvalid:!0};Tt.EMPTY_VALUES=[void 0,null,""];V.Masked=Tt;class Se{constructor(e,n){e===void 0&&(e=[]),n===void 0&&(n=0),this.chunks=e,this.from=n}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=ce(e)?new Kt(String(e)):e;const n=this.chunks[this.chunks.length-1],i=n&&(n.stop===e.stop||e.stop==null)&&e.from===n.from+n.toString().length;if(e instanceof Kt)i?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof Se){if(e.stop==null){let s;for(;e.chunks.length&&e.chunks[0].stop==null;)s=e.chunks.shift(),s.from+=e.from,this.extend(s)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof V.MaskedPattern))return new Kt(this.toString()).appendTo(e);const n=new Z;for(let i=0;i<this.chunks.length&&!n.skip;++i){const s=this.chunks[i],o=e._mapPosToBlock(e.displayValue.length),r=s.stop;let a;if(r!=null&&(!o||o.index<=r)){if(s instanceof Se||e._stops.indexOf(r)>=0){const u=e._appendPlaceholder(r);n.aggregate(u)}a=s instanceof Se&&e._blocks[r]}if(a){const u=a.appendTail(s);u.skip=!1,n.aggregate(u),e._value+=u.inserted;const c=s.toString().slice(u.rawInserted.length);c&&n.aggregate(e.append(c,{tail:!0}))}else n.aggregate(e.append(s.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n,...i}=e;Object.assign(this,i),this.chunks=n.map(s=>{const o="chunks"in s?new Se:new Kt;return o.state=s,o})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const n=e!=null?e-this.from:e;let i=0;for(;i<this.chunks.length;){const s=this.chunks[i],o=s.unshift(n);if(s.toString()){if(!o)break;++i}else this.chunks.splice(i,1);if(o)return o}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e],i=n.shift();if(n.toString()){if(!i)break;--e}else this.chunks.splice(e,1);if(i)return i}return""}}class Oc{constructor(e,n){this.masked=e,this._log=[];const{offset:i,index:s}=e._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=s,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((n=this.block)==null?void 0:n.displayValue.length)||0){var n;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,I.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,I.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,I.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,I.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,I.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,I.NONE),!0})}}class ca{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(n),this._value||(this._isRawInput=!1),new Z}nearestInputPos(e,n){n===void 0&&(n=I.NONE);const i=0,s=this._value.length;switch(n){case I.LEFT:case I.FORCE_LEFT:return i;case I.NONE:case I.RIGHT:case I.FORCE_RIGHT:default:return s}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._isRawInput?n-e:0}extractInput(e,n,i){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),i===void 0&&(i={}),i.raw&&this._isRawInput&&this._value.slice(e,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,n){n===void 0&&(n={});const i=new Z;if(this.isFilled)return i;const s=this.eager===!0||this.eager==="append",o=this.char===e&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!s)&&!n.tail;return o&&(i.rawInserted=this.char),this._value=i.inserted=this.char,this._isRawInput=o&&(n.raw||n.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new Z;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new Kt("")}appendTail(e){return ce(e)&&(e=new Kt(String(e))),e.appendTo(this)}append(e,n,i){const s=this._appendChar(e[0],n);return i!=null&&(s.tailShift+=this.appendTail(i).tailShift),s}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}}class ai{constructor(e){const{parent:n,isOptional:i,placeholderChar:s,displayChar:o,lazy:r,eager:a,...u}=e;this.masked=De(u),Object.assign(this,{parent:n,isOptional:i,placeholderChar:s,displayChar:o,lazy:r,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),e===0&&n>=1?(this.isFilled=!1,this.masked.remove(e,n)):new Z}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,n){if(n===void 0&&(n={}),this.isFilled)return new Z;const i=this.masked.state,s=this.masked._appendChar(e,this.currentMaskFlags(n));return s.inserted&&this.doValidate(n)===!1&&(s.inserted=s.rawInserted="",this.masked.state=i),!s.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(s.inserted=this.placeholderChar),s.skip=!s.inserted&&!this.isOptional,this.isFilled=!!s.inserted,s}append(e,n,i){return this.masked.append(e,this.currentMaskFlags(n),i)}_appendPlaceholder(){const e=new Z;return this.isFilled||this.isOptional||(this.isFilled=!0,e.inserted=this.placeholderChar),e}_appendEager(){return new Z}extractTail(e,n){return this.masked.extractTail(e,n)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,n,i){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.masked.extractInput(e,n,i)}nearestInputPos(e,n){n===void 0&&(n=I.NONE);const i=0,s=this.value.length,o=Math.min(Math.max(e,i),s);switch(n){case I.LEFT:case I.FORCE_LEFT:return this.isComplete?o:i;case I.RIGHT:case I.FORCE_RIGHT:return this.isComplete?o:s;case I.NONE:default:return o}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.value.slice(e,n).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var n;return{...e,_beforeTailState:(e==null||(n=e._beforeTailState)==null?void 0:n.masked)||e?._beforeTailState}}}ai.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Mc extends Tt{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=i=>i.search(n)>=0),super._update(e)}}V.MaskedRegExp=Mc;class It extends Tt{constructor(e){super({...It.DEFAULTS,...e,definitions:Object.assign({},ai.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!e)return;let i=!1,s=!1;for(let o=0;o<n.length;++o){if(this.blocks){const c=n.slice(o),l=Object.keys(this.blocks).filter(h=>c.indexOf(h)===0);l.sort((h,p)=>p.length-h.length);const d=l[0];if(d){const{expose:h,...p}=ri(this.blocks[d]),g=De({lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,...p,parent:this});g&&(this._blocks.push(g),h&&(this.exposeBlock=g),this._maskedBlocks[d]||(this._maskedBlocks[d]=[]),this._maskedBlocks[d].push(this._blocks.length-1)),o+=d.length-1;continue}}let r=n[o],a=r in e;if(r===It.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(r==="{"||r==="}"){i=!i;continue}if(r==="["||r==="]"){s=!s;continue}if(r===It.ESCAPE_CHAR){if(++o,r=n[o],!r)break;a=!1}const u=a?new ai({isOptional:s,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ri(e[r]),parent:this}):new ca({char:r,eager:this.eager,isUnmasking:i});this._blocks.push(u)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){const{_blocks:n,...i}=e;this._blocks.forEach((s,o)=>s.state=n[o]),super.state=i}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,n)=>e+=n.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(n),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,n)=>e+=n.value,"")}set value(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(n),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(n),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,n)=>e+=n.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const n=new Z;let i=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(i==null)return n;this._blocks[i].isFilled&&++i;for(let s=i;s<this._blocks.length;++s){const o=this._blocks[s]._appendEager();if(!o.inserted)break;n.aggregate(o)}return n}_appendCharRaw(e,n){n===void 0&&(n={});const i=this._mapPosToBlock(this.displayValue.length),s=new Z;if(!i)return s;for(let r=i.index;;++r){var o;const a=this._blocks[r];if(!a)break;const u=a._appendChar(e,{...n,_beforeTailState:(o=n._beforeTailState)==null||(o=o._blocks)==null?void 0:o[r]}),c=u.skip;if(s.aggregate(u),c||u.rawInserted)break}return s}extractTail(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const i=new Se;return e===n||this._forEachBlocksInRange(e,n,(s,o,r,a)=>{const u=s.extractTail(r,a);u.stop=this._findStopBefore(o),u.from=this._blockStartPos(o),u instanceof Se&&(u.blockIndex=o),i.extend(u)}),i}extractInput(e,n,i){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),i===void 0&&(i={}),e===n)return"";let s="";return this._forEachBlocksInRange(e,n,(o,r,a,u)=>{s+=o.extractInput(a,u,i)}),s}_findStopBefore(e){let n;for(let i=0;i<this._stops.length;++i){const s=this._stops[i];if(s<=e)n=s;else break}return n}_appendPlaceholder(e){const n=new Z;if(this.lazy&&e==null)return n;const i=this._mapPosToBlock(this.displayValue.length);if(!i)return n;const s=i.index,o=e??this._blocks.length;return this._blocks.slice(s,o).forEach(r=>{if(!r.lazy||e!=null){var a;const u=r._appendPlaceholder((a=r._blocks)==null?void 0:a.length);this._value+=u.inserted,n.aggregate(u)}}),n}_mapPosToBlock(e){let n="";for(let i=0;i<this._blocks.length;++i){const s=this._blocks[i],o=n.length;if(n+=s.displayValue,e<=n.length)return{index:i,offset:e-o}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((n,i)=>n+=i.displayValue.length,0)}_forEachBlocksInRange(e,n,i){n===void 0&&(n=this.displayValue.length);const s=this._mapPosToBlock(e);if(s){const o=this._mapPosToBlock(n),r=o&&s.index===o.index,a=s.offset,u=o&&r?o.offset:this._blocks[s.index].displayValue.length;if(i(this._blocks[s.index],s.index,a,u),o&&!r){for(let c=s.index+1;c<o.index;++c)i(this._blocks[c],c,0,this._blocks[c].displayValue.length);i(this._blocks[o.index],o.index,0,o.offset)}}}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const i=super.remove(e,n);return this._forEachBlocksInRange(e,n,(s,o,r,a)=>{i.aggregate(s.remove(r,a))}),i}nearestInputPos(e,n){if(n===void 0&&(n=I.NONE),!this._blocks.length)return 0;const i=new Oc(this,e);if(n===I.NONE)return i.pushRightBeforeInput()||(i.popState(),i.pushLeftBeforeInput())?i.pos:this.displayValue.length;if(n===I.LEFT||n===I.FORCE_LEFT){if(n===I.LEFT){if(i.pushRightBeforeFilled(),i.ok&&i.pos===e)return e;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),n===I.LEFT){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=e||(i.popState(),i.ok&&i.pos<=e))return i.pos;i.popState()}return i.ok?i.pos:n===I.FORCE_LEFT?0:(i.popState(),i.ok||(i.popState(),i.ok)?i.pos:0)}return n===I.RIGHT||n===I.FORCE_RIGHT?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:n===I.FORCE_RIGHT?this.displayValue.length:(i.popState(),i.ok||(i.popState(),i.ok)?i.pos:this.nearestInputPos(e,I.LEFT))):e}totalInputPositions(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);let i=0;return this._forEachBlocksInRange(e,n,(s,o,r,a)=>{i+=s.totalInputPositions(r,a)}),i}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const n=this._maskedBlocks[e];return n?n.map(i=>this._blocks[i]):[]}}It.DEFAULTS={lazy:!0,placeholderChar:"_"};It.STOP_CHAR="`";It.ESCAPE_CHAR="\\";It.InputDefinition=ai;It.FixedDefinition=ca;V.MaskedPattern=It;class Hn extends It{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:n=this.to||0,from:i=this.from||0,maxLength:s=this.maxLength||0,autofix:o=this.autofix,...r}=e;this.to=n,this.from=i,this.maxLength=Math.max(String(n).length,s),this.autofix=o;const a=String(this.from).padStart(this.maxLength,"0"),u=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<u.length&&u[c]===a[c];)++c;r.mask=u.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(r)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let n="",i="";const[,s,o]=e.match(/^(\D*)(\d*)(\D*)/)||[];return o&&(n="0".repeat(s.length)+o,i="9".repeat(s.length)+o),n=n.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[n,i]}doPrepareChar(e,n){n===void 0&&(n={});let i;if([e,i]=super.doPrepareChar(e.replace(/\D/g,""),n),!this.autofix||!e)return[e,i];const s=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0"),r=this.value+e;if(r.length>this.maxLength)return["",i];const[a,u]=this.boundaries(r);return Number(u)<this.from?[s[r.length-1],i]:Number(a)>this.to?this.autofix==="pad"&&r.length<this.maxLength?["",i.aggregate(this.append(s[r.length-1]+e,n))]:[o[r.length-1],i]:[e,i]}doValidate(e){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[i,s]=this.boundaries(n);return this.from<=Number(s)&&Number(i)<=this.to&&super.doValidate(e)}}V.MaskedRange=Hn;class Ae extends It{constructor(e){const{mask:n,pattern:i,...s}={...Ae.DEFAULTS,...e};super({...s,mask:ce(n)?n:i})}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:i,blocks:s,...o}={...Ae.DEFAULTS,...e},r=Object.assign({},Ae.GET_DEFAULT_BLOCKS());e.min&&(r.Y.from=e.min.getFullYear()),e.max&&(r.Y.to=e.max.getFullYear()),e.min&&e.max&&r.Y.from===r.Y.to&&(r.m.from=e.min.getMonth()+1,r.m.to=e.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=e.min.getDate(),r.d.to=e.max.getDate())),Object.assign(r,this.blocks,s),Object.keys(r).forEach(a=>{const u=r[a];!("autofix"in u)&&"autofix"in e&&(u.autofix=e.autofix)}),super._update({...o,mask:ce(n)?n:i,blocks:r})}doValidate(e){const n=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}}Ae.GET_DEFAULT_BLOCKS=()=>({d:{mask:Hn,from:1,to:31,maxLength:2},m:{mask:Hn,from:1,to:12,maxLength:2},Y:{mask:Hn,from:1900,to:9999}});Ae.DEFAULTS={mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";const n=String(t.getDate()).padStart(2,"0"),i=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return[n,i,s].join(".")},parse:(t,e)=>{const[n,i,s]=t.split(".").map(Number);return new Date(s,i-1,n)}};V.MaskedDate=Ae;class wn extends Tt{constructor(e){super({...wn.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(n=>{const{expose:i,...s}=ri(n),o=De({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return i&&(this.exposeMask=o),o}):[])}_appendCharRaw(e,n){n===void 0&&(n={});const i=this._applyDispatch(e,n);return this.currentMask&&i.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(n))),i}_applyDispatch(e,n,i){e===void 0&&(e=""),n===void 0&&(n={}),i===void 0&&(i="");const s=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,o=this.rawInputValue,r=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:o,a=o.slice(r.length),u=this.currentMask,c=new Z,l=u?.state;if(this.currentMask=this.doDispatch(e,{...n},i),this.currentMask)if(this.currentMask!==u){if(this.currentMask.reset(),r){const d=this.currentMask.append(r,{raw:!0});c.tailShift=d.inserted.length-s.length}a&&(c.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)}else l&&(this.currentMask.state=l);return c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const n=new Z;return e&&n.aggregate(this._applyDispatch("",{},e)),n.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var n,i;return{...e,_beforeTailState:((n=e._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((i=e._beforeTailState)==null?void 0:i.currentMask)||e._beforeTailState}}doDispatch(e,n,i){return n===void 0&&(n={}),i===void 0&&(i=""),this.dispatch(e,this,n,i)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,n){n===void 0&&(n={});let[i,s]=super.doPrepare(e,n);if(this.currentMask){let o;[i,o]=super.doPrepare(i,this.currentMaskFlags(n)),s=s.aggregate(o)}return[i,s]}doPrepareChar(e,n){n===void 0&&(n={});let[i,s]=super.doPrepareChar(e,n);if(this.currentMask){let o;[i,o]=super.doPrepareChar(i,this.currentMaskFlags(n)),s=s.aggregate(o)}return[i,s]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(e);this.currentMask&&(this.currentMask.typedValue=e,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,n){const i=new Z;return this.currentMask&&i.aggregate(this.currentMask.remove(e,n)).aggregate(this._applyDispatch()),i}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:i,currentMask:s,...o}=e;n&&this.compiledMasks.forEach((r,a)=>r.state=n[a]),i!=null&&(this.currentMask=i,this.currentMask.state=s),super.state=o}extractInput(e,n,i){return this.currentMask?this.currentMask.extractInput(e,n,i):""}extractTail(e,n){return this.currentMask?this.currentMask.extractTail(e,n):super.extractTail(e,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,n){return this.currentMask?this.currentMask.nearestInputPos(e,n):super.nearestInputPos(e,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((n,i)=>{if(!e[i])return;const{mask:s,...o}=e[i];return oi(n,o)&&n.maskEquals(s)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}wn.DEFAULTS=void 0;wn.DEFAULTS={dispatch:(t,e,n,i)=>{if(!e.compiledMasks.length)return;const s=e.rawInputValue,o=e.compiledMasks.map((r,a)=>{const u=e.currentMask===r,c=u?r.displayValue.length:r.nearestInputPos(r.displayValue.length,I.FORCE_LEFT);return r.rawInputValue!==s?(r.reset(),r.append(s,{raw:!0})):u||r.remove(c),r.append(t,e.currentMaskFlags(n)),r.appendTail(i),{index:a,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(c,r.nearestInputPos(r.displayValue.length,I.FORCE_LEFT)))}});return o.sort((r,a)=>a.weight-r.weight||a.totalInputPositions-r.totalInputPositions),e.compiledMasks[o[0].index]}};V.MaskedDynamic=wn;class Rc extends It{constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:n,...i}=e;if(n){const s=n.map(a=>a.length),o=Math.min(...s),r=Math.max(...s)-o;i.mask="*".repeat(o),r&&(i.mask+="["+"*".repeat(r)+"]"),this.enum=n}super._update(i)}doValidate(e){return this.enum.some(n=>n.indexOf(this.unmaskedValue)===0)&&super.doValidate(e)}}V.MaskedEnum=Rc;class Pc extends Tt{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}V.MaskedFunction=Pc;class Mt extends Tt{constructor(e){super({...Mt.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",i=(this.scale?"("+Gi(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+i),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Gi).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Gi(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const n=e.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(e,n){n===void 0&&(n={});const[i,s]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),n);return e&&!i&&(s.skip=!0),i&&!this.allowPositive&&!this.value&&i!=="-"&&s.aggregate(this._appendChar("-")),[i,s]}_separatorsCount(e,n){n===void 0&&(n=!1);let i=0;for(let s=0;s<e;++s)this._value.indexOf(this.thousandsSeparator,s)===s&&(++i,n&&(e+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,n,i){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n),this._removeThousandsSeparators(super.extractInput(e,n,i))}_appendCharRaw(e,n){if(n===void 0&&(n={}),!this.thousandsSeparator)return super._appendCharRaw(e,n);const i=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);const o=super._appendCharRaw(e,n);this._value=this._insertThousandsSeparators(this._value);const r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(r);return o.tailShift+=(a-s)*this.thousandsSeparator.length,o.skip=!o.rawInserted&&e===this.thousandsSeparator,o}_findSeparatorAround(e){if(this.thousandsSeparator){const n=e-this.thousandsSeparator.length+1,i=this.value.indexOf(this.thousandsSeparator,n);if(i<=e)return i}return-1}_adjustRangeWithSeparators(e,n){const i=this._findSeparatorAround(e);i>=0&&(e=i);const s=this._findSeparatorAround(n);return s>=0&&(n=s+this.thousandsSeparator.length),[e,n]}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n);const i=this.value.slice(0,e),s=this.value.slice(n),o=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+s));const r=this._separatorsCountFromSlice(i);return new Z({tailShift:(r-o)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case I.NONE:case I.LEFT:case I.FORCE_LEFT:{const i=this._findSeparatorAround(e-1);if(i>=0){const s=i+this.thousandsSeparator.length;if(e<s||this.value.length<=s||n===I.FORCE_LEFT)return i}break}case I.RIGHT:case I.FORCE_RIGHT:{const i=this._findSeparatorAround(e);if(i>=0)return i+this.thousandsSeparator.length}}return e}doValidate(e){let n=!!this._removeThousandsSeparators(this.value).match(this._numberRegExp);if(n){const i=this.number;n=n&&!isNaN(i)&&(this.min==null||this.min>=0||this.min<=this.number)&&(this.max==null||this.max<=0||this.number<=this.max)}return n&&super.doValidate(e)}doCommit(){if(this.value){const e=this.number;let n=e;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==e&&(this.unmaskedValue=this.format(n,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(e){const n=this._removeThousandsSeparators(e).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(i,s,o,r)=>s+r),e.length&&!/\d$/.test(n[0])&&(n[0]=n[0]+"0"),n.length>1&&(n[1]=n[1].replace(/0*$/,""),n[1].length||(n.length=1)),this._insertThousandsSeparators(n.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const n=e.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(e,n,i){n===void 0&&(n={});const s=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===Mt.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,n,i)&&!s}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,Mt.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(Mt.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||Mt.EMPTY_VALUES.includes(e)&&Mt.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Mt.UNMASKED_RADIX=".";Mt.EMPTY_VALUES=[...Tt.EMPTY_VALUES,0];Mt.DEFAULTS={mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Mt.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};V.MaskedNumber=Mt;const ys={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function da(t,e,n){e===void 0&&(e=ys.MASKED),n===void 0&&(n=ys.MASKED);const i=De(t);return s=>i.runIsolated(o=>(o[e]=s,o[n]))}function Lc(t,e,n,i){return da(e,n,i)(t)}V.PIPE_TYPE=ys;V.createPipe=da;V.pipe=Lc;try{globalThis.IMask=V}catch{}function Bc(t,e){let{emit:n,onAccept:i,onComplete:s}=e===void 0?{}:e;const o=gl(t)?t:J(t),r=J(),a=J(),u=J(""),c=J(""),l=J(null);let d,h,p,g;function f(){g=l.value=a.value.typedValue,p=c.value=a.value.unmaskedValue,h=u.value=a.value.value,n&&(n("accept",h),n("accept:masked",h),n("accept:typed",g),n("accept:unmasked",p)),i&&i()}function y(){n&&(n("complete",h),n("complete:masked",h),n("complete:typed",g),n("complete:unmasked",p)),s&&s()}function v(){d=r.value;const w=o.value;!d||!(w!=null&&w.mask)||(a.value=V(d,w).on("accept",f).on("complete",y),f())}function k(){a.value&&(a.value.destroy(),a.value=void 0)}return ge(v),vl(k),At(c,()=>{a.value&&(p=a.value.unmaskedValue=c.value)}),At(u,()=>{a.value&&(h=a.value.value=u.value)}),At(l,()=>{a.value&&(g=a.value.typedValue=l.value)}),At([r,o],()=>{const w=r.value,T=o.value;(!(T!=null&&T.mask)||w!==d)&&k(),w&&(a.value?a.value.updateOptions(T):v())}),{el:r,mask:ml(a),masked:u,unmasked:c,typed:l}}const Nc={key:0,class:"k-input__prefix"},jc=["id","value","aria-labelledby","aria-describedby","type"],Vc={key:1,class:"k-input__suffix"},eg=tt({__name:"Input",props:{invalid:{type:Boolean},id:{},modelValue:{},prefix:{},suffix:{},mask:{},align:{default:"left"},type:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t;function i(u){e("update:modelValue",u.target.value)}const s=Ar("k-input",{variants:{invalid:{true:"k-input--invalid"},align:{left:"k-input--align-left",right:"k-input--align-right"}}}),o=wr(Gs,H(()=>({id:n.id,invalid:n.invalid}))),{el:r}=Bc(n.mask),a=H({get(){return n.modelValue?n.modelValue:""},set(u){var c;(n.type==="number"||((c=n.mask)==null?void 0:c.mask)===Number)&&(u=parseFloat(`${u}`)),e("update:modelValue",u)}});return(u,c)=>(_(),O("div",{class:qt(lt(s)({invalid:lt(o).invalid,align:u.align}))},[u.$slots.prefix||u.prefix?(_(),O("span",Nc,[z(u.$slots,"prefix",{},()=>[Ht(ct(u.prefix),1)])])):q("",!0),ut("input",ot({class:"k-input__input",id:lt(o).id,value:a.value,"aria-labelledby":lt(o).labelId,"aria-describedby":lt(o).helpId,onInput:i,ref_key:"el",ref:r,type:n.type},u.$attrs),null,16,jc),u.$slots.suffix||u.suffix?(_(),O("span",Vc,[z(u.$slots,"suffix",{},()=>[Ht(ct(u.suffix),1)])])):q("",!0)],2))}}),$c=["src","alt"],zc=tt({__name:"Image",props:{src:{},preview:{},alt:{},caption:{},captionVisibility:{default:"hover"},captionTheme:{default:"dark"},size:{default:"cover"},position:{default:"center"},width:{},height:{},aspectRatio:{}},emits:["loaded","error"],setup(t,{emit:e}){const n=t,i=J(),s=J(!1),o=J(!1),r=J(),a=H(()=>({"--k-image-size":n.size,"--k-image-preview":n.preview||"","--k-image-position":n.position,"--k-image-width":n.width||"initial","--k-image-height":n.height||"initial","--k-image-aspectratio":(n.aspectRatio==="natural"?r.value:n.aspectRatio)||"initial"}));function u(){s.value=!0;const{naturalWidth:l=0,naturalHeight:d=0}=i.value||{};r.value=`${l}/${d}`,e("loaded")}function c(){s.value=!0,o.value=!0,e("error")}return ge(()=>{var l;return((l=i.value)==null?void 0:l.complete)&&u()}),(l,d)=>(_(),O("figure",{class:qt(["k-image",[`k-image--size-${l.size}`,{"k-image--loaded":s.value,"k-image--loading":!s.value}]]),style:ve(a.value)},[s.value?q("",!0):(_(),it(qr,{key:0,size:"small"})),xr(ut("img",{src:l.src,alt:l.alt||l.caption,onLoad:u,onError:c,ref_key:"image",ref:i},null,40,$c),[[kr,!o.value]]),l.$slots.caption||l.caption?(_(),O("figcaption",{key:1,class:qt(`k-image__caption k-image__caption--visibility-${l.captionVisibility} k-image__caption--theme-${!s.value||o.value?"light":l.captionTheme}`)},[z(l.$slots,"caption",{},()=>[Ht(ct(l.caption),1)])],2)):q("",!0)],6))}}),Hc={key:1,class:"k-card__content"},Gc={key:0,class:"k-card__title"},qc={key:2,class:"k-card__footer"},Uc=tt({inheritAttrs:!1,__name:"Card",props:{is:{default:"div"},title:{},variant:{default:"border"},thumbnail:{},thumbnailSize:{default:"cover"},headerMinHeight:{}},setup(t){return(e,n)=>(_(),it(de(e.is),ot({class:`k-card k-card--variant-${e.variant}`,style:`--k-header-min-height: ${e.headerMinHeight||""}`},e.$attrs),{default:rt(()=>[e.$slots.header||e.thumbnail?(_(),O("div",{key:0,class:qt(["k-card__header",[{"k-card__header--has-thumbnail":!e.$slots.header&&e.thumbnail},`k-card__header--thumbnail-size-${e.thumbnailSize}`]])},[z(e.$slots,"header",{},()=>[e.thumbnail?(_(),it(zc,{key:0,class:"k-card__thumbnail",src:e.thumbnail,size:e.thumbnailSize},null,8,["src","size"])):q("",!0)])],2)):q("",!0),e.$slots.default||e.title?(_(),O("div",Hc,[e.title?(_(),O("div",Gc,ct(e.title),1)):q("",!0),z(e.$slots,"default")])):q("",!0),e.$slots.footer?(_(),O("div",qc,[z(e.$slots,"footer")])):q("",!0)]),_:3},16,["class","style"]))}}),ng=tt({__name:"Skeleton",props:{variant:{default:"shiny"},aspectRatio:{},width:{},height:{},rounding:{}},setup(t){const e=()=>t.rounding?t.rounding==="full"?"9999px":Ns(t.rounding,"rounding"):"initial",n=H(()=>({"--aspect-ratio":!t.aspectRatio||t.width&&t.height?"initial":t.aspectRatio,"--width":t.width||"initial","--height":t.height||"initial","--border-radius":e()}));return(i,s)=>(_(),O("span",{class:qt(["k-skeleton",`k-skeleton--variant-${i.variant}`]),style:ve(n.value)},[z(i.$slots,"default")],6))}});var xs=(t,e,n,i)=>{const s=typeof t=="function"?t():t;return s?.addEventListener(e,n,i),()=>{s?.removeEventListener(e,n,i)}},Wc=t=>t.button===2||Xc()&&t.ctrlKey&&t.button===0,Xc=()=>/Mac|iPod|iPhone|iPad/.test(window.navigator.platform);function Bo(t,e,n){if(!t)return;const i=t.ownerDocument.defaultView||window,s=new i.CustomEvent(e,n);return t.dispatchEvent(s)}function No(t){return Math.max(0,Math.min(1,t))}function ha(t,e){const{left:n,top:i,width:s,height:o}=e.getBoundingClientRect(),r={x:t.x-n,y:t.y-i},a={x:No(r.x/s),y:No(r.y/o)};function u(c={}){const{dir:l="ltr",orientation:d="horizontal",inverted:h}=c,p=typeof h=="object"?h.x:h,g=typeof h=="object"?h.y:h;return d==="horizontal"?l==="rtl"||p?1-a.x:a.x:g?1-a.y:a.y}return{offset:r,percent:a,getPercentValue:u}}function Yc(t,e,n){return Math.round((t-e)/n)*n+e}function Kc(t,e,n){return Math.min(Math.max(t,e),n)}function Zc(t,e,n){return(t-e)/(n-e)}function pa(t,e,n,i){const s=t*(n-e)+e,o=Yc(s,e,i);return Kc(o,e,n)}function ks(t,e){const n={min:t[0],max:t[1]},i={min:e[0],max:e[1]};return function(s){if(n.min===n.max||i.min===i.max)return i.min;const o=(i.max-i.min)/(n.max-n.min);return i.min+o*(s-n.min)}}var Jc=ue("slider").parts("root","label","thumb","output","track","range","control","markerGroup","marker");Jc.build();function Qc(t){const{height:e=0}=t.thumbSize??{},n=ks([t.min,t.max],[-e/2,e/2]);return parseFloat(n(t.value).toFixed(2))}function td(t){const{width:e=0}=t.thumbSize??{};if(t.isRtl){const i=ks([t.max,t.min],[-e/2,e/2]);return-1*parseFloat(i(t.value).toFixed(2))}const n=ks([t.min,t.max],[-e/2,e/2]);return parseFloat(n(t.value).toFixed(2))}function ed(t,e){if(t.thumbAlignment==="center")return`${e}%`;const n=t.isVertical?Qc(t):td(t);return`calc(${e}% - ${n}px)`}function Us(t){let e=Zc(t.value,t.min,t.max)*100;return ed(t,e)}function fa(t){let e="visible";return t.thumbAlignment==="contain"&&!t.hasMeasuredThumbSize&&(e="hidden"),e}function nd(t){const e=t.isVertical?"bottom":"insetInlineStart";return{visibility:fa(t),position:"absolute",transform:"var(--slider-thumb-transform)",[e]:"var(--slider-thumb-offset)"}}function id(t){let e="0%",n=`${100-t.valuePercent}%`;if(t.origin==="center"){const i=t.valuePercent<50;e=i?`${t.valuePercent}%`:"50%",n=i?"50%":n}return{start:e,end:n}}function sd(t){return t.isVertical?{position:"absolute",bottom:"var(--slider-range-start)",top:"var(--slider-range-end)"}:{position:"absolute",[t.isRtl?"right":"left"]:"var(--slider-range-start)",[t.isRtl?"left":"right"]:"var(--slider-range-end)"}}function od(){return{touchAction:"none",userSelect:"none",position:"relative"}}function rd(t){const e=id(t);return{"--slider-thumb-transform":t.isVertical?"translateY(50%)":t.isRtl?"translateX(50%)":"translateX(-50%)","--slider-thumb-offset":Us(t),"--slider-range-start":e.start,"--slider-range-end":e.end}}function ad(t,e){return{visibility:fa(t),position:"absolute",pointerEvents:"none",[t.isHorizontal?"insetInlineStart":"bottom"]:Us({...t,value:e}),translate:"var(--tx) var(--ty)","--tx":t.isHorizontal?t.isRtl?"50%":"-50%":"0%","--ty":t.isHorizontal?"0%":"50%"}}function ld(){return{userSelect:"none"}}function ud(){return{position:"relative"}}function cd(){return{userSelect:"none",pointerEvents:"none",position:"relative"}}var dd={getThumbOffset:Us,getControlStyle:od,getThumbStyle:nd,getRangeStyle:sd,getRootStyle:rd,getMarkerStyle:ad,getLabelStyle:ld,getTrackStyle:ud,getMarkerGroupStyle:cd},ft=En({...dd,getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`slider:${t.id}`},getThumbId:t=>{var e;return((e=t.ids)==null?void 0:e.thumb)??`slider:${t.id}:thumb`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`slider:${t.id}:control`},getHiddenInputId:t=>{var e;return((e=t.ids)==null?void 0:e.hiddenInput)??`slider:${t.id}:input`},getOutputId:t=>{var e;return((e=t.ids)==null?void 0:e.output)??`slider:${t.id}:output`},getTrackId:t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}track`},getRangeId:t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}:range`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`slider:${t.id}:label`},getMarkerId:(t,e)=>`slider:${t.id}:marker:${e}`,getRootEl:t=>ft.getById(t,ft.getRootId(t)),getThumbEl:t=>ft.getById(t,ft.getThumbId(t)),getControlEl:t=>ft.getById(t,ft.getControlId(t)),getHiddenInputEl:t=>ft.getById(t,ft.getHiddenInputId(t)),getValueFromPoint(t,e){const n=ft.getControlEl(t);if(!n)return;const i=ha(e,n).getPercentValue({orientation:t.orientation,dir:t.dir,inverted:{y:!0}});return pa(i,t.min,t.max,t.step)},dispatchChangeEvent(t){const e=ft.getHiddenInputEl(t);e&&sa(e,{value:t.value})}}),hd=ue("range-slider").parts("root","label","thumb","output","track","range","control","markerGroup","marker");hd.build();function pd(t){const e=t[0],n=t[t.length-1];return[e,n]}function fd(t){const[e,n]=pd(t.valuePercent);return{start:`${e}%`,end:`${100-n}%`}}function gd(t){let e="visible";return t.thumbAlignment==="contain"&&!t.hasMeasuredThumbSize&&(e="hidden"),e}function vd(t,e){const n=t.isVertical?"bottom":"insetInlineStart";return{visibility:gd(t),position:"absolute",transform:"var(--slider-thumb-transform)",[n]:`var(--slider-thumb-offset-${e})`}}function md(t){const e=fd(t);return{...t.value.reduce((n,i,s)=>{const o=ft.getThumbOffset({...t,value:i});return{...n,[`--slider-thumb-offset-${s}`]:o}},{}),"--slider-thumb-transform":t.isVertical?"translateY(50%)":t.isRtl?"translateX(50%)":"translateX(-50%)","--slider-range-start":e.start,"--slider-range-end":e.end}}var bd={getRootStyle:md,getControlStyle:ft.getControlStyle,getThumbStyle:vd,getRangeStyle:ft.getRangeStyle,getMarkerStyle:ft.getMarkerStyle,getMarkerGroupStyle:ft.getMarkerGroupStyle},mt=En({...bd,getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`slider:${t.id}`},getThumbId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.thumb)==null?void 0:i.call(n,e))??`slider:${t.id}:thumb:${e}`},getHiddenInputId:(t,e)=>`slider:${t.id}:input:${e}`,getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`slider:${t.id}:control`},getTrackId:t=>{var e;return((e=t.ids)==null?void 0:e.track)??`slider:${t.id}:track`},getRangeId:t=>{var e;return((e=t.ids)==null?void 0:e.range)??`slider:${t.id}:range`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`slider:${t.id}:label`},getOutputId:t=>{var e;return((e=t.ids)==null?void 0:e.output)??`slider:${t.id}:output`},getMarkerId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.marker)==null?void 0:i.call(n,e))??`slider:${t.id}:marker:${e}`},getRootEl:t=>mt.getById(t,mt.getRootId(t)),getThumbEl:(t,e)=>mt.getById(t,mt.getThumbId(t,e)),getHiddenInputEl:(t,e)=>mt.getById(t,mt.getHiddenInputId(t,e)),getControlEl:t=>mt.getById(t,mt.getControlId(t)),getElements:t=>Xr(mt.getControlEl(t),"[role=slider]"),getFirstEl:t=>mt.getElements(t)[0],getRangeEl:t=>mt.getById(t,mt.getRangeId(t)),getValueFromPoint(t,e){const n=mt.getControlEl(t);if(!n)return;const i=ha(e,n).getPercentValue({orientation:t.orientation,dir:t.dir,inverted:{y:!0}});return pa(i,t.min,t.max,t.step)},dispatchChangeEvent(t){Array.from(t.value).forEach((e,n)=>{const i=mt.getHiddenInputEl(t,n);i&&sa(i,{value:e})})}});const Es=Math.min,He=Math.max,li=Math.round,On=Math.floor,pe=t=>({x:t,y:t}),yd={left:"right",right:"left",bottom:"top",top:"bottom"},xd={start:"end",end:"start"};function Ws(t,e){return typeof t=="function"?t(e):t}function We(t){return t.split("-")[0]}function Ii(t){return t.split("-")[1]}function kd(t){return t==="x"?"y":"x"}function ga(t){return t==="y"?"height":"width"}function Xs(t){return["top","bottom"].includes(We(t))?"y":"x"}function va(t){return kd(Xs(t))}function Ed(t,e,n){n===void 0&&(n=!1);const i=Ii(t),s=va(t),o=ga(s);let r=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=ui(r)),[r,ui(r)]}function wd(t){const e=ui(t);return[ws(t),e,ws(e)]}function ws(t){return t.replace(/start|end/g,e=>xd[e])}function Cd(t,e,n){const i=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:i:e?i:s;case"left":case"right":return e?o:r;default:return[]}}function _d(t,e,n,i){const s=Ii(t);let o=Cd(We(t),n==="start",i);return s&&(o=o.map(r=>r+"-"+s),e&&(o=o.concat(o.map(ws)))),o}function ui(t){return t.replace(/left|right|bottom|top/g,e=>yd[e])}function Sd(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ad(t){return typeof t!="number"?Sd(t):{top:t,right:t,bottom:t,left:t}}function ci(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function jo(t,e,n){let{reference:i,floating:s}=t;const o=Xs(e),r=va(e),a=ga(r),u=We(e),c=o==="y",l=i.x+i.width/2-s.width/2,d=i.y+i.height/2-s.height/2,h=i[a]/2-s[a]/2;let p;switch(u){case"top":p={x:l,y:i.y-s.height};break;case"bottom":p={x:l,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-s.width,y:d};break;default:p={x:i.x,y:i.y}}switch(Ii(e)){case"start":p[r]-=h*(n&&c?-1:1);break;case"end":p[r]+=h*(n&&c?-1:1);break}return p}const Td=async(t,e,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=n,a=o.filter(Boolean),u=await(r.isRTL==null?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:l,y:d}=jo(c,i,u),h=i,p={},g=0;for(let f=0;f<a.length;f++){const{name:y,fn:v}=a[f],{x:k,y:w,data:T,reset:M}=await v({x:l,y:d,initialPlacement:i,placement:h,strategy:s,middlewareData:p,rects:c,platform:r,elements:{reference:t,floating:e}});l=k??l,d=w??d,p={...p,[y]:{...p[y],...T}},M&&g<=50&&(g++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(c=M.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):M.rects),{x:l,y:d}=jo(c,h,u)),f=-1)}return{x:l,y:d,placement:h,strategy:s,middlewareData:p}};async function Id(t,e){var n;e===void 0&&(e={});const{x:i,y:s,platform:o,rects:r,elements:a,strategy:u}=t,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Ws(e,t),g=Ad(p),f=a[h?d==="floating"?"reference":"floating":d],y=ci(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(f)))==null||n?f:f.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:l,strategy:u})),v=d==="floating"?{...r.floating,x:i,y:s}:r.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},T=ci(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:u}):v);return{top:(y.top-T.top+g.top)/w.y,bottom:(T.bottom-y.bottom+g.bottom)/w.y,left:(y.left-T.left+g.left)/w.x,right:(T.right-y.right+g.right)/w.x}}const Dd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:u,elements:c}=e,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:f=!0,...y}=Ws(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=We(s),k=We(a)===a,w=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=h||(k||!f?[ui(a)]:wd(a));!h&&g!=="none"&&T.push(..._d(a,f,g,w));const M=[a,...T],D=await Id(e,y),W=[];let x=((i=o.flip)==null?void 0:i.overflows)||[];if(l&&W.push(D[v]),d){const F=Ed(s,r,w);W.push(D[F[0]],D[F[1]])}if(x=[...x,{placement:s,overflows:W}],!W.every(F=>F<=0)){var b,m;const F=(((b=o.flip)==null?void 0:b.index)||0)+1,$=M[F];if($)return{data:{index:F,overflows:x},reset:{placement:$}};let N=(m=x.filter(B=>B.overflows[0]<=0).sort((B,P)=>B.overflows[1]-P.overflows[1])[0])==null?void 0:m.placement;if(!N)switch(p){case"bestFit":{var E;const B=(E=x.map(P=>[P.placement,P.overflows.filter(X=>X>0).reduce((X,Vt)=>X+Vt,0)]).sort((P,X)=>P[1]-X[1])[0])==null?void 0:E[0];B&&(N=B);break}case"initialPlacement":N=a;break}if(s!==N)return{reset:{placement:N}}}return{}}}};async function Fd(t,e){const{placement:n,platform:i,elements:s}=t,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),r=We(n),a=Ii(n),u=Xs(n)==="y",c=["left","top"].includes(r)?-1:1,l=o&&u?-1:1,d=Ws(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),u?{x:p*l,y:h*c}:{x:h*c,y:p*l}}const Od=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:s,y:o,placement:r,middlewareData:a}=e,u=await Fd(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:r}}}}};function fe(t){return ma(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function te(t){var e;return(e=(ma(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ma(t){return t instanceof Node||t instanceof Dt(t).Node}function Jt(t){return t instanceof Element||t instanceof Dt(t).Element}function Ut(t){return t instanceof HTMLElement||t instanceof Dt(t).HTMLElement}function Vo(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function Cn(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=Pt(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(s)}function Md(t){return["table","td","th"].includes(fe(t))}function Ys(t){const e=Ks(),n=Pt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function ba(t){let e=Xe(t);for(;Ut(e)&&!Di(e);){if(Ys(e))return e;e=Xe(e)}return null}function Ks(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Di(t){return["html","body","#document"].includes(fe(t))}function Pt(t){return Dt(t).getComputedStyle(t)}function Fi(t){return Jt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Xe(t){if(fe(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Vo(t)&&t.host||te(t);return Vo(e)?e.host:e}function ya(t){const e=Xe(t);return Di(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ut(e)&&Cn(e)?e:ya(e)}function kn(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=ya(t),o=s===((i=t.ownerDocument)==null?void 0:i.body),r=Dt(s);return o?e.concat(r,r.visualViewport||[],Cn(s)?s:[],r.frameElement&&n?kn(r.frameElement):[]):e.concat(s,kn(s,[],n))}function xa(t){const e=Pt(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=Ut(t),o=s?t.offsetWidth:n,r=s?t.offsetHeight:i,a=li(n)!==o||li(i)!==r;return a&&(n=o,i=r),{width:n,height:i,$:a}}function Zs(t){return Jt(t)?t:t.contextElement}function Ge(t){const e=Zs(t);if(!Ut(e))return pe(1);const n=e.getBoundingClientRect(),{width:i,height:s,$:o}=xa(e);let r=(o?li(n.width):n.width)/i,a=(o?li(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Rd=pe(0);function ka(t){const e=Dt(t);return!Ks()||!e.visualViewport?Rd:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Pd(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Dt(t)?!1:e}function Fe(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),o=Zs(t);let r=pe(1);e&&(i?Jt(i)&&(r=Ge(i)):r=Ge(t));const a=Pd(o,n,i)?ka(o):pe(0);let u=(s.left+a.x)/r.x,c=(s.top+a.y)/r.y,l=s.width/r.x,d=s.height/r.y;if(o){const h=Dt(o),p=i&&Jt(i)?Dt(i):i;let g=h.frameElement;for(;g&&i&&p!==h;){const f=Ge(g),y=g.getBoundingClientRect(),v=Pt(g),k=y.left+(g.clientLeft+parseFloat(v.paddingLeft))*f.x,w=y.top+(g.clientTop+parseFloat(v.paddingTop))*f.y;u*=f.x,c*=f.y,l*=f.x,d*=f.y,u+=k,c+=w,g=Dt(g).frameElement}}return ci({width:l,height:d,x:u,y:c})}const Ld=[":popover-open",":modal"];function Ea(t){let e=!1,n=0,i=0;function s(o){try{e=e||t.matches(o)}catch{}}if(Ld.forEach(o=>{s(o)}),e){const o=ba(t);if(o){const r=o.getBoundingClientRect();n=r.x,i=r.y}}return[e,n,i]}function Bd(t){let{elements:e,rect:n,offsetParent:i,strategy:s}=t;const o=te(i),[r]=e?Ea(e.floating):[!1];if(i===o||r)return n;let a={scrollLeft:0,scrollTop:0},u=pe(1);const c=pe(0),l=Ut(i);if((l||!l&&s!=="fixed")&&((fe(i)!=="body"||Cn(o))&&(a=Fi(i)),Ut(i))){const d=Fe(i);u=Ge(i),c.x=d.x+i.clientLeft,c.y=d.y+i.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x,y:n.y*u.y-a.scrollTop*u.y+c.y}}function Nd(t){return Array.from(t.getClientRects())}function wa(t){return Fe(te(t)).left+Fi(t).scrollLeft}function jd(t){const e=te(t),n=Fi(t),i=t.ownerDocument.body,s=He(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=He(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+wa(t);const a=-n.scrollTop;return Pt(i).direction==="rtl"&&(r+=He(e.clientWidth,i.clientWidth)-s),{width:s,height:o,x:r,y:a}}function Vd(t,e){const n=Dt(t),i=te(t),s=n.visualViewport;let o=i.clientWidth,r=i.clientHeight,a=0,u=0;if(s){o=s.width,r=s.height;const c=Ks();(!c||c&&e==="fixed")&&(a=s.offsetLeft,u=s.offsetTop)}return{width:o,height:r,x:a,y:u}}function $d(t,e){const n=Fe(t,!0,e==="fixed"),i=n.top+t.clientTop,s=n.left+t.clientLeft,o=Ut(t)?Ge(t):pe(1),r=t.clientWidth*o.x,a=t.clientHeight*o.y,u=s*o.x,c=i*o.y;return{width:r,height:a,x:u,y:c}}function $o(t,e,n){let i;if(e==="viewport")i=Vd(t,n);else if(e==="document")i=jd(te(t));else if(Jt(e))i=$d(e,n);else{const s=ka(t);i={...e,x:e.x-s.x,y:e.y-s.y}}return ci(i)}function Ca(t,e){const n=Xe(t);return n===e||!Jt(n)||Di(n)?!1:Pt(n).position==="fixed"||Ca(n,e)}function zd(t,e){const n=e.get(t);if(n)return n;let i=kn(t,[],!1).filter(a=>Jt(a)&&fe(a)!=="body"),s=null;const o=Pt(t).position==="fixed";let r=o?Xe(t):t;for(;Jt(r)&&!Di(r);){const a=Pt(r),u=Ys(r);!u&&a.position==="fixed"&&(s=null),(o?!u&&!s:!u&&a.position==="static"&&s&&["absolute","fixed"].includes(s.position)||Cn(r)&&!u&&Ca(t,r))?i=i.filter(c=>c!==r):s=a,r=Xe(r)}return e.set(t,i),i}function Hd(t){let{element:e,boundary:n,rootBoundary:i,strategy:s}=t;const o=[...n==="clippingAncestors"?zd(e,this._c):[].concat(n),i],r=o[0],a=o.reduce((u,c)=>{const l=$o(e,c,s);return u.top=He(l.top,u.top),u.right=Es(l.right,u.right),u.bottom=Es(l.bottom,u.bottom),u.left=He(l.left,u.left),u},$o(e,r,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Gd(t){const{width:e,height:n}=xa(t);return{width:e,height:n}}function qd(t,e,n,i){const s=Ut(e),o=te(e),r=n==="fixed",a=Fe(t,!0,r,e);let u={scrollLeft:0,scrollTop:0};const c=pe(0);if(s||!s&&!r)if((fe(e)!=="body"||Cn(o))&&(u=Fi(e)),s){const f=Fe(e,!0,r,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else o&&(c.x=wa(o));let l=a.left+u.scrollLeft-c.x,d=a.top+u.scrollTop-c.y;const[h,p,g]=Ea(i);return h&&(l+=p,d+=g,s&&(l+=e.clientLeft,d+=e.clientTop)),{x:l,y:d,width:a.width,height:a.height}}function zo(t,e){return!Ut(t)||Pt(t).position==="fixed"?null:e?e(t):t.offsetParent}function _a(t,e){const n=Dt(t);if(!Ut(t))return n;let i=zo(t,e);for(;i&&Md(i)&&Pt(i).position==="static";)i=zo(i,e);return i&&(fe(i)==="html"||fe(i)==="body"&&Pt(i).position==="static"&&!Ys(i))?n:i||ba(t)||n}const Ud=async function(t){const e=this.getOffsetParent||_a,n=this.getDimensions;return{reference:qd(t.reference,await e(t.floating),t.strategy,t.floating),floating:{x:0,y:0,...await n(t.floating)}}};function Wd(t){return Pt(t).direction==="rtl"}const Cs={convertOffsetParentRelativeRectToViewportRelativeRect:Bd,getDocumentElement:te,getClippingRect:Hd,getOffsetParent:_a,getElementRects:Ud,getClientRects:Nd,getDimensions:Gd,getScale:Ge,isElement:Jt,isRTL:Wd};function Xd(t,e){let n=null,i;const s=te(t);function o(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function r(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),o();const{left:c,top:l,width:d,height:h}=t.getBoundingClientRect();if(a||e(),!d||!h)return;const p=On(l),g=On(s.clientWidth-(c+d)),f=On(s.clientHeight-(l+h)),y=On(c),v={rootMargin:-p+"px "+-g+"px "+-f+"px "+-y+"px",threshold:He(0,Es(1,u))||1};let k=!0;function w(T){const M=T[0].intersectionRatio;if(M!==u){if(!k)return r();M?r(!1,M):i=setTimeout(()=>{r(!1,1e-7)},100)}k=!1}try{n=new IntersectionObserver(w,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(w,v)}n.observe(t)}return r(!0),o}function Yd(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,c=Zs(t),l=s||o?[...c?kn(c):[],...kn(e)]:[];l.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=c&&a?Xd(c,n):null;let h=-1,p=null;r&&(p=new ResizeObserver(v=>{let[k]=v;k&&k.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(e)})),n()}),c&&!u&&p.observe(c),p.observe(e));let g,f=u?Fe(t):null;u&&y();function y(){const v=Fe(t);f&&(v.x!==f.x||v.y!==f.y||v.width!==f.width||v.height!==f.height)&&n(),f=v,g=requestAnimationFrame(y)}return n(),()=>{var v;l.forEach(k=>{s&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),d?.(),(v=p)==null||v.disconnect(),p=null,u&&cancelAnimationFrame(g)}}const Kd=Dd,Zd=(t,e,n)=>{const i=new Map,s={platform:Cs,...n},o={...s.platform,_c:i};return Td(t,e,{...s,platform:o})};function Jd(t,e){let n,i,s;const o=J(!0),r=()=>{o.value=!0,s()};At(t,r,{flush:"sync"});const a=typeof e=="function"?e:e.get,u=typeof e=="function"?void 0:e.set,c=dl((l,d)=>(i=l,s=d,{get(){return o.value&&(n=a(),o.value=!1),i(),n},set(h){u?.(h)}}));return Object.isExtensible(c)&&(c.trigger=r),c}function Sa(t){return yl()?(xl(t),!0):!1}function Aa(t){return typeof t=="function"?t():lt(t)}const Qd=typeof window<"u"&&typeof document<"u",th=Object.prototype.toString,eh=t=>th.call(t)==="[object Object]",nh=()=>{};function Ta(t){var e;const n=Aa(t);return(e=n?.$el)!=null?e:n}const Ia=Qd?window:void 0;function ih(...t){let e,n,i,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,s]=t,e=Ia):[e,n,i,s]=t,!e)return nh;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const o=[],r=()=>{o.forEach(l=>l()),o.length=0},a=(l,d,h,p)=>(l.addEventListener(d,h,p),()=>l.removeEventListener(d,h,p)),u=At(()=>[Ta(e),Aa(s)],([l,d])=>{if(r(),!l)return;const h=eh(d)?{...d}:d;o.push(...n.flatMap(p=>i.map(g=>a(l,p,g,h))))},{immediate:!0,flush:"post"}),c=()=>{u(),r()};return Sa(c),c}function sh(){const t=J(!1);return _r()&&ge(()=>{t.value=!0}),t}function oh(t){const e=sh();return H(()=>(e.value,!!t()))}function rh(t,e,n={}){const{window:i=Ia,...s}=n;let o;const r=oh(()=>i&&"MutationObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},u=At(()=>Ta(t),l=>{a(),r.value&&i&&l&&(o=new MutationObserver(e),o.observe(l,s))},{immediate:!0}),c=()=>{a(),u()};return Sa(c),{isSupported:r,stop:c}}function Da(){const t=_r(),e=Jd(()=>null,()=>t.proxy.$el);return ul(e.trigger),ge(e.trigger),e}function ah(t){return lh(t)}function qi(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function lh(t){for(let e=t;e;e=qi(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=qi(t);e;e=qi(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||n.filter!=="none"||e.tagName==="BODY"))return e}return null}const uh=tt({inheritAttrs:!1,__name:"Dropdown",props:{items:{},placement:{default:"bottom-start"},teleport:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},theme:{default:"border"},teleportTo:{default:"body"},variant:{},size:{},loading:{type:Boolean},promise:{},confirm:{type:Boolean},is:{},stateTimeout:{},confirmLabel:{},label:{},icon:{},iconLeft:{},iconRight:{default:"fa-pro-regular:angle-down"}},setup(t){const e=t,n=H(()=>{const{items:v,placement:k,teleport:w,keepOpen:T,...M}=e;return M}),i=J(!1),s=Da(),o=J(),r=J(),a=J({top:"",left:"",position:""});let u=()=>{};function c(){!o.value||!r.value||(u=Yd(o.value.$el,r.value,()=>{!o.value||!r.value||Zd(o.value.$el,r.value,{placement:e.placement,middleware:[Od(8),Kd()],platform:{...Cs,getOffsetParent:v=>Cs.getOffsetParent(v,ah)}}).then(({x:v,y:k})=>{a.value={top:`${k}px`,left:`${v}px`,position:"absolute"}})}))}Ei(u),Er(()=>{if(i.value)return c();u()});const l=({target:v},k="dom")=>{if(v instanceof Element&&!(!o.value||!r.value)){if(k==="dom")return[o.value.$el,r.value].some(w=>w&&(v===w||w.contains(v)))?void 0:h(!1);if(k==="shadow-dom"){const w=s.value.getRootNode();return v.shadowRoot===w?void 0:h(!1)}}},d=({key:v})=>v==="Escape"&&h(!1),h=(v=!i.value)=>(v?f():y(),i.value=v,!0),p=H(()=>s.value.getRootNode()),g=H(()=>p.value instanceof ShadowRoot);function f(){window.addEventListener("keydown",d),g.value?(p.value.addEventListener("click",v=>l(v)),window.addEventListener("click",v=>l(v,"shadow-dom"))):window.addEventListener("click",l)}function y(){window.removeEventListener("keydown",d),g.value?(p.value.removeEventListener("click",v=>l(v)),window.removeEventListener("click",v=>l(v,"shadow-dom"))):window.removeEventListener("click",l)}return(v,k)=>(_(),O(le,null,[Et(he,ot({...n.value,...v.$attrs},{onClick:k[0]||(k[0]=()=>h()),ref_key:"trigger",ref:o}),br({_:2},[v.$slots["icon-left"]?{name:"icon-left",fn:rt(()=>[z(v.$slots,"icon-left")]),key:"0"}:void 0,v.$slots.trigger?{name:"default",fn:rt(()=>[z(v.$slots,"trigger")]),key:"1"}:void 0,v.$slots["icon-right"]?{name:"icon-right",fn:rt(()=>[z(v.$slots,"icon-right")]),key:"2"}:void 0]),1040),(_(),it(yr,{to:v.teleportTo,disabled:!v.teleport},[Et(Cr,{name:"k-dropdown"},{default:rt(()=>[i.value?(_(),O("div",{key:0,class:qt(`k-dropdown k-dropdown--theme-${v.theme}`),style:ve(a.value),ref_key:"content",ref:r,onClick:k[1]||(k[1]=()=>!v.keepOpen&&h(!1))},[z(v.$slots,"default",{close:h.bind(null,!1)},()=>[(_(!0),O(le,null,rn(v.items,({action:w,icon:T,...M})=>(_(),it(he,ot(M,{variant:"tertiary","icon-right":M.iconRight||T,onClick:()=>w()}),null,16,["icon-right","onClick"]))),256))])],6)):q("",!0)]),_:3})],8,["to","disabled"]))],64))}}),ch={key:0,class:"k-datatable__row"},dh={key:0,class:"k-datatable__cell k-datatable__cell-select"},hh=["onClick"],ph=["innerHTML"],fh={key:1,class:"k-datatable__cell k-datatable__cell-actions"},gh={key:0,class:"k-datatable__cell k-datatable__cell-select"},vh={key:1,class:"k-datatable__cell k-datatable__cell-actions"},mh={key:0,class:"k-datatable__footer"},ig=tt({__name:"DataTable",props:{items:{},selected:{},theme:{default:"default"},header:{type:Boolean,default:!0},sticky:{type:[Boolean,String]},sortBy:{},sortableBy:{default:()=>[]},isDisabled:{type:Function,default:()=>!1},columns:{},labels:{default:()=>({selection:"Valgt",resetSelection:"Tilbakestill valg"})},cellWrapper:{type:Function,default:()=>({component:"div"})},rowWrapper:{type:Function,default:()=>({component:"div"})}},emits:["update:selected","update:sortBy"],setup(t,{emit:e}){const n=t,i=hl(),s=J([-1]),o=H(()=>n.items.filter(p=>!n.isDisabled(p))),r=H(()=>!!n.selected),a=H(()=>!!(Object.keys(n.sortBy||{}).length&&n.sortableBy.length)),u=H(()=>!!i.rowActions),c=H({get:()=>!!(o.value.length&&o.value.every(p=>n.selected&&n.selected.includes(p))),set:p=>e("update:selected",p?[...o.value]:[])}),l=H(()=>[r.value?"2.5rem":!1,...n.columns.filter(({disabled:p})=>!p).map(p=>p.size||"auto"),u.value?"0px":!1].filter(Boolean).join(" "));function d(p){var g;if(!a.value||!n.sortableBy.includes(p))return;let f=((g=n.sortBy)==null?void 0:g[p])||-1;e("update:sortBy",{[p]:f*-1})}function h(p,g){if(!(p.target instanceof HTMLInputElement))return;let f=s.value.slice(-1).pop()||-1,y=[];if(p.shiftKey){let v=f>g,k=f+(v?-1:1);for(;v?k>g:k<g;){let w=n.items[k];!(n.selected||[]).includes(w)&&!n.isDisabled(w)&&y.push(w),v?k--:k++}}p.target.checked?s.value.push(g):f===g&&s.value.pop(),e("update:selected",[...n.selected||[],...y])}return(p,g)=>(_(),O("div",{class:qt([`k-datatable k-datatable--${p.theme}`,{"k-datatable--sticky":!!p.sticky,"k-datatable--no-header":!p.header}]),style:ve(`--k-datatable-layout: ${l.value}; --k-datatable-sticky-top: ${typeof p.sticky=="string"?p.sticky:"0"}`)},[p.header?(_(),O("div",ch,[r.value?(_(),O("div",dh,[Et(Po,{class:"k-datatable__checkbox",modelValue:c.value,"onUpdate:modelValue":g[0]||(g[0]=f=>c.value=f),disabled:!p.items.length},null,8,["modelValue","disabled"])])):q("",!0),(_(!0),O(le,null,rn(p.columns.filter(({disabled:f})=>!f),f=>(_(),O("div",{class:qt(["k-datatable__cell",`k-datatable__cell--text-align-${f.align||"start"}`,{"k-datatable__cell-sort":a.value&&p.sortableBy.includes(f.id),"k-datatable__cell-sort--active":f.id in(p.sortBy||{})}]),key:f.id,onClick:y=>d(f.id)},[z(p.$slots,`${f.id}-label`,{item:f},()=>[ut("span",{innerHTML:f.label},null,8,ph)]),Et(lt(ze),{class:"k-datatable__cell-sort-icon",icon:(p.sortBy||{})[f.id]<0?"fa-pro-solid:caret-up":"fa-pro-solid:caret-down"},null,8,["icon"])],10,hh))),128)),u.value?(_(),O("div",fh)):q("",!0)])):q("",!0),(_(!0),O(le,null,rn(p.items,(f,y)=>(_(),O("div",{class:"k-datatable__row",key:y},[r.value?(_(),O("div",gh,[Et(Po,{class:"k-datatable__checkbox","model-value":p.selected||[],"onUpdate:modelValue":g[1]||(g[1]=v=>e("update:selected",v)),value:f,onClick:v=>h(v,y),onMousedown:g[2]||(g[2]=pl(()=>{},["prevent"])),disabled:p.isDisabled(f)},null,8,["model-value","value","onClick","disabled"])])):q("",!0),(_(),it(de(p.rowWrapper(f).component),ot({class:"k-datatable__row-wrapper"},p.rowWrapper(f).bind),{default:rt(()=>[(_(!0),O(le,null,rn(p.columns.filter(({disabled:v})=>!v),(v,k)=>(_(),it(de(p.cellWrapper(f,v).component),ot(p.cellWrapper(f,v).bind,{class:`k-datatable__cell k-datatable__cell--text-align-${v.align||"start"}`,key:`col-${v.id}`,"data-cell-id":v.id}),{default:rt(()=>[z(p.$slots,v.id,{item:f,column:v,rowIndex:y,colIndex:k})]),_:2},1040,["class","data-cell-id"]))),128))]),_:2},1040)),p.$slots["row-actions"]?(_(),O("div",vh,[z(p.$slots,"row-actions",{item:f})])):q("",!0)]))),128)),Et(Cr,{name:"k-datatable-footer"},{default:rt(()=>{var f,y;return[p.$slots.footer||(f=p.selected)!=null&&f.length?(_(),O("div",mh,[(y=p.selected)!=null&&y.length?(_(),it(uh,{key:0,label:`${p.labels.selection} (${p.selected.length})`,teleport:""},{default:rt(()=>[z(p.$slots,"select-actions"),Et(he,{label:p.labels.resetSelection,"icon-right":"fa-pro-light:times-square",variant:"tertiary",onClick:g[3]||(g[3]=v=>e("update:selected",[]))},null,8,["label"])]),_:3},8,["label"])):q("",!0),z(p.$slots,"footer")])):q("",!0)]}),_:3})],6))}});var _s,xe=new Map,bh=t=>t.getBoundingClientRect();function yh(t,e){const{scope:n="rect",getRect:i=bh,onChange:s}=e,o=xh({scope:n,getRect:i}),r=xe.get(t);return r?(r.callbacks.push(s),s(i(t))):(xe.set(t,{rect:{},callbacks:[s]}),xe.size===1&&(_s=requestAnimationFrame(o))),function(){const a=xe.get(t);if(!a)return;const u=a.callbacks.indexOf(s);u>-1&&a.callbacks.splice(u,1),a.callbacks.length===0&&(xe.delete(t),xe.size===0&&cancelAnimationFrame(_s))}}function xh(t){const{scope:e,getRect:n}=t,i=Eh(e);return function s(){const o=[];xe.forEach((r,a)=>{const u=n(a);i(r.rect,u)||(r.rect=u,o.push(r))}),o.forEach(r=>{r.callbacks.forEach(a=>a(r.rect))}),_s=requestAnimationFrame(s)}}var Fa=(t,e)=>t.width===e.width&&t.height===e.height,Oa=(t,e)=>t.top===e.top&&t.left===e.left,kh=(t,e)=>Fa(t,e)&&Oa(t,e);function Eh(t){return t==="size"?Fa:t==="position"?Oa:kh}var wh=ue("radio-group").parts("root","label","radio","radioLabel","radioControl","indicator"),Pe=wh.build(),G=En({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`radio-group:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`radio-group:${t.id}:label`},getRadioId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.radio)==null?void 0:i.call(n,e))??`radio-group:${t.id}:radio:${e}`},getRadioHiddenInputId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.radioHiddenInput)==null?void 0:i.call(n,e))??`radio-group:${t.id}:radio:input:${e}`},getRadioControlId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.radioControl)==null?void 0:i.call(n,e))??`radio-group:${t.id}:radio:control:${e}`},getRadioLabelId:(t,e)=>{var n,i;return((i=(n=t.ids)==null?void 0:n.radioLabel)==null?void 0:i.call(n,e))??`radio-group:${t.id}:radio:label:${e}`},getIndicatorId:t=>{var e;return((e=t.ids)==null?void 0:e.indicator)??`radio-group:${t.id}:indicator`},getRootEl:t=>G.getById(t,G.getRootId(t)),getRadioHiddenInputEl:(t,e)=>G.getById(t,G.getRadioHiddenInputId(t,e)),getIndicatorEl:t=>G.getById(t,G.getIndicatorId(t)),getFirstEnabledInputEl:t=>{var e;return(e=G.getRootEl(t))==null?void 0:e.querySelector("input:not(:disabled)")},getFirstEnabledAndCheckedInputEl:t=>{var e;return(e=G.getRootEl(t))==null?void 0:e.querySelector("input:not(:disabled):checked")},getInputEls:t=>{const e=`input[type=radio][data-ownedby='${CSS.escape(G.getRootId(t))}']:not([disabled])`;return Xr(G.getRootEl(t),e)},getActiveRadioEl:t=>{if(t.value)return G.getById(t,G.getRadioId(t,t.value))},getOffsetRect:t=>({left:t?.offsetLeft??0,top:t?.offsetTop??0,width:t?.offsetWidth??0,height:t?.offsetHeight??0}),getRectById:(t,e)=>{const n=G.getById(t,G.getRadioId(t,e));if(n)return G.resolveRect(G.getOffsetRect(n))},resolveRect:t=>({width:`${t.width}px`,height:`${t.height}px`,left:`${t.left}px`,top:`${t.top}px`})});function Ch(t,e,n){const i=t.context.isDisabled;function s(a){const u={isInvalid:a.invalid,isDisabled:a.disabled||i,isChecked:t.context.value===a.value,isFocused:t.context.focusedId===a.value,isHovered:t.context.hoveredId===a.value,isActive:t.context.activeId===a.value};return{...u,isInteractive:!u.isDisabled}}function o(a){const u=s(a);return{"data-focus":gt(u.isFocused),"data-disabled":gt(u.isDisabled),"data-state":u.isChecked?"checked":"unchecked","data-hover":gt(u.isHovered),"data-invalid":gt(u.isInvalid),"data-orientation":t.context.orientation}}const r=()=>{const a=G.getFirstEnabledAndCheckedInputEl(t.context);if(a){a.focus();return}const u=G.getFirstEnabledInputEl(t.context);u?.focus()};return{value:t.context.value,setValue(a){e({type:"SET_VALUE",value:a,isTrusted:!1})},clearValue(){e({type:"SET_VALUE",value:null,isTrusted:!1})},focus:r,blur(){const a=G.getActiveElement(t.context);G.getInputEls(t.context).some(u=>u===a)&&a?.blur()},getRadioState:s,rootProps:n.element({...Pe.root.attrs,role:"radiogroup",id:G.getRootId(t.context),"aria-labelledby":G.getLabelId(t.context),"data-orientation":t.context.orientation,"data-disabled":gt(i),"aria-orientation":t.context.orientation,dir:t.context.dir}),labelProps:n.element({...Pe.label.attrs,"data-orientation":t.context.orientation,"data-disabled":gt(i),id:G.getLabelId(t.context),onClick:r}),getRadioProps(a){const u=s(a);return n.label({...Pe.radio.attrs,id:G.getRadioId(t.context,a.value),htmlFor:G.getRadioHiddenInputId(t.context,a.value),...o(a),onPointerMove(){u.isInteractive&&e({type:"SET_HOVERED",value:a.value,hovered:!0})},onPointerLeave(){u.isInteractive&&e({type:"SET_HOVERED",value:null})},onPointerDown(c){u.isInteractive&&(u.isFocused&&c.pointerType==="mouse"&&c.preventDefault(),e({type:"SET_ACTIVE",value:a.value,active:!0}))},onPointerUp(){u.isInteractive&&e({type:"SET_ACTIVE",value:null})}})},getRadioLabelProps(a){return n.element({...Pe.radioLabel.attrs,id:G.getRadioLabelId(t.context,a.value),...o(a)})},getRadioControlProps(a){const u=s(a);return n.element({...Pe.radioControl.attrs,id:G.getRadioControlId(t.context,a.value),"data-active":gt(u.isActive),"aria-hidden":!0,...o(a)})},getRadioHiddenInputProps(a){const u=s(a),c=a.required,l=u.isDisabled&&!a.focusable;return n.input({"data-ownedby":G.getRootId(t.context),id:G.getRadioHiddenInputId(t.context,a.value),type:"radio",name:t.context.name||t.context.id,form:t.context.form,value:a.value,onChange(d){u.isDisabled||d.target.checked&&e({type:"SET_VALUE",value:a.value,isTrusted:!0})},onBlur(){e({type:"SET_FOCUSED",value:null})},onFocus(){e({type:"SET_FOCUSED",value:a.value,focused:!0})},onKeyDown(d){d.key===" "&&e({type:"SET_ACTIVE",value:a.value,active:!0})},onKeyUp(d){d.key===" "&&e({type:"SET_ACTIVE",value:null})},disabled:l,required:c,defaultChecked:u.isChecked,"data-disabled":gt(u.isDisabled),"aria-required":Dn(c),"aria-invalid":Dn(u.isInvalid),"aria-disabled":Dn(l),"aria-checked":Dn(u.isChecked),style:Kr})},indicatorProps:n.element({id:G.getIndicatorId(t.context),...Pe.indicator.attrs,"data-disabled":gt(i),"data-orientation":t.context.orientation,style:{"--transition-duration":"150ms","--transition-property":"left, top, width, height",position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:t.context.canIndicatorTransition?"var(--transition-duration)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",...t.context.indicatorRect}})}}var{not:_h}=ta;function Sh(t){const e=Si(t);return zs({id:"radio",initial:"idle",context:{value:null,activeId:null,focusedId:null,hoveredId:null,disabled:!1,...e,indicatorRect:{},canIndicatorTransition:!1,fieldsetDisabled:!1},computed:{isDisabled:n=>!!n.disabled||n.fieldsetDisabled},entry:["syncIndicatorRect"],exit:["cleanupObserver"],activities:["trackFormControlState"],watch:{value:["setIndicatorTransition","syncIndicatorRect","syncInputElements"]},on:{SET_VALUE:[{guard:_h("isTrusted"),actions:["setValue","dispatchChangeEvent"]},{actions:["setValue"]}],SET_HOVERED:{actions:"setHovered"},SET_ACTIVE:{actions:"setActive"},SET_FOCUSED:{actions:"setFocused"}},states:{idle:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackFormControlState(n,i,{send:s,initialContext:o}){return ra(G.getRootEl(n),{onFieldsetDisabledChange(r){n.fieldsetDisabled=r},onFormReset(){s({type:"SET_VALUE",value:o.value})}})}},actions:{setValue(n,i){Th.value(n,i.value)},setHovered(n,i){n.hoveredId=i.value},setActive(n,i){n.activeId=i.value},setFocused(n,i){n.focusedId=i.value},syncInputElements(n){G.getInputEls(n).forEach(i=>{i.checked=i.value===n.value})},setIndicatorTransition(n){n.canIndicatorTransition=dc(n.value)},cleanupObserver(n){var i;(i=n.indicatorCleanup)==null||i.call(n)},syncIndicatorRect(n){var i;if((i=n.indicatorCleanup)==null||i.call(n),!G.getIndicatorEl(n))return;if(n.value==null){n.indicatorRect={};return}const s=G.getActiveRadioEl(n);s&&(n.indicatorCleanup=yh(s,{getRect(o){return G.getOffsetRect(o)},onChange(o){n.indicatorRect=G.resolveRect(o),Yr(()=>{n.canIndicatorTransition=!1})}}))},dispatchChangeEvent(n){G.getInputEls(n).forEach(i=>{const s=i.value===n.value;s!==i.checked&&oa(i,{checked:s})})}}})}var Ah={change:t=>{var e;t.value!=null&&((e=t.onChange)==null||e.call(t,{value:t.value}))}},Th={value:(t,e)=>{t.value=e,Ah.change(t)}};const Ih=["aria-describedby"],sg=tt({__name:"RadioGroup",props:{label:{},modelValue:{},items:{},variant:{default:"radio"},direction:{default:"vertical"},disabled:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=wr(Gs,H(()=>({label:""}))),s={id:Ie(),name:Ie(),...n,value:n.modelValue,onChange:({value:u})=>e("update:modelValue",u)},[o,r]=Ti(Sh(s),{context:H(()=>n)}),a=H(()=>Ch(o.value,r,Ai));return At(()=>n.modelValue,u=>a.value.setValue(u)),(u,c)=>(_(),O("div",ot({class:["k-radiogroup",`k-radiogroup--variant-${u.variant} k-radiogroup--direction-${u.direction}`]},a.value.rootProps,{"aria-describedby":lt(i).helpId}),[u.variant==="radio"&&(lt(i).label||u.label)?(_(),O("span",kt(ot({key:0},a.value.labelProps)),ct(lt(i).label||u.label),17)):q("",!0),u.variant==="segment"?(_(),O("div",kt(ot({key:1},a.value.indicatorProps)),null,16)):q("",!0),(_(!0),O(le,null,rn(u.items,l=>(_(),O("label",kt(Rt(a.value.getRadioProps({value:l.id}))),[ut("span",kt(Rt(a.value.getRadioLabelProps({value:l.id}))),ct(l.label),17),ut("input",kt(Rt(a.value.getRadioHiddenInputProps({value:l.id}))),null,16),ut("div",kt(Rt(a.value.getRadioControlProps({value:l.id}))),null,16)],16))),256))],16,Ih))}}),og=tt({__name:"Grid",props:{is:{type:[Object,Function],default:"div"},columns:{default:1},align:{},rows:{},gap:{default:"default"},areas:{}},setup(t){const e=t,n=(o,r)=>o?typeof o=="number"||typeof o=="string"&&o.match(/^\d+$/)?`repeat(${o}, 1fr)`:o.match(/^(\d+\s?)+$/)?o.split(" ").map(a=>`${a}fr`).join(" "):o:r,i=o=>{if(o)return Array.isArray(o)?o.map(r=>`"${r}"`).join(`
2
2
  `):o.split("|").map(r=>r.trim()).map(r=>`"${r}"`).join(`
3
3
  `)},s=H(()=>Gr("grid",{columns:n(e.columns,"1fr"),align:Jn(e.align)||"initial",rows:n(e.rows,"auto"),gap:Ns(e.gap),areas:i(e.areas)||"unset"}));return(o,r)=>(_(),it(de(o.is),{class:"k-grid",style:ve(s.value)},{default:rt(()=>[z(o.$slots,"default")]),_:3},8,["style"]))}});function Ma(t){return t?t.flatMap(e=>{const{type:n,children:i}=e;return n===le?Ma(i):[e]}):[]}const rg=tt({props:{area:String,align:String},inheritAttrs:!1,setup({area:t,align:e},{slots:n}){return()=>{if(!n.default)return null;const[i]=Ma(n.default());if(!i)return null;const s=ot({style:{"--k-grid-item-area":t,"--k-grid-item-align-self":Jn(e)||"initial"}},i.props??{});return fl(i,s)}}}),Dh=tt({__name:"Flex",props:{is:{type:[Object,Function],default:"div"},gap:{default:"default"},justify:{},align:{},direction:{default:"row"},nowrap:{type:Boolean}},setup(t){const e=t,n=H(()=>Gr("flex",{justify:Jn(e.justify)||"initial",align:Jn(e.align)||"initial",wrap:e.nowrap?"nowrap":"wrap",gap:Ns(e.gap),direction:e.direction}));return(i,s)=>(_(),it(de(i.is),{class:"k-flex",style:ve(n.value)},{default:rt(()=>[z(i.$slots,"default")]),_:3},8,["style"]))}}),Fh={key:0,class:"k-scroller__indicator"},ag=tt({__name:"Scroller",props:{is:{type:[Object,Function],default:"div"},appearance:{default:"default"}},setup(t){const e=Ie({prefix:"k-scroller-"}),n=J({top:!1,right:!1,left:!1,bottom:!1}),i=H(()=>Object.entries(n.value).filter(([,o])=>o).map(([o])=>o)),s=o=>{const{scrollWidth:r,scrollHeight:a,clientWidth:u,clientHeight:c,scrollTop:l,scrollLeft:d}=o,h=r-u>=80,p=a-c>=80;n.value={top:p&&l<=80,left:h&&d<=80,bottom:p&&l>=a-c-80,right:h&&d>=r-u-80}};return ge(()=>{const o=document.getElementById(e);o&&(ih(o,"scroll",()=>s(o)),rh(o,()=>s(o),{childList:!0,subtree:!0}))}),(o,r)=>(_(),it(de(o.is),{id:lt(e),class:qt([`k-scroller k-scroller--appearance-${o.appearance}`,...i.value.map(a=>`k-scroller--scrolled-to-${a}`)])},{default:rt(()=>[o.appearance==="indicator"?(_(),O("div",Fh,[z(o.$slots,"indicator",{},()=>[Et(lt(ze),{icon:"fa-pro-thin:arrow-right"})])])):q("",!0),z(o.$slots,"default")]),_:3},8,["id","class"]))}});var Ze=new WeakMap,Ft=[];function Oh(t,e={}){const{rootEl:n}=e,i=t.filter(Boolean);if(i.length===0)return;const s=i[0].ownerDocument||document,o=s.defaultView??window,r=new Set(i),a=new Set,u=n??s.body;let c=p=>{for(let v of p.querySelectorAll("[data-live-announcer], [data-zag-top-layer]"))r.add(v);let g=v=>{if(r.has(v)||a.has(v.parentElement)&&v.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let k of r)if(v.contains(k))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},f=s.createTreeWalker(p,NodeFilter.SHOW_ELEMENT,{acceptNode:g}),y=g(p);if(y===NodeFilter.FILTER_ACCEPT&&l(p),y!==NodeFilter.FILTER_REJECT){let v=f.nextNode();for(;v!=null;)l(v),v=f.nextNode()}},l=p=>{let g=Ze.get(p)??0;p.getAttribute("aria-hidden")==="true"&&g===0||(g===0&&p.setAttribute("aria-hidden","true"),a.add(p),Ze.set(p,g+1))};Ft.length&&Ft[Ft.length-1].disconnect(),c(u);const d=new o.MutationObserver(p=>{for(let g of p)if(!(g.type!=="childList"||g.addedNodes.length===0)&&![...r,...a].some(f=>f.contains(g.target))){for(let f of g.removedNodes)f instanceof o.Element&&(r.delete(f),a.delete(f));for(let f of g.addedNodes)(f instanceof o.HTMLElement||f instanceof o.SVGElement)&&(f.dataset.liveAnnouncer==="true"||f.dataset.zagTopLayer==="true")?r.add(f):f instanceof o.Element&&c(f)}});d.observe(u,{childList:!0,subtree:!0});let h={observe(){d.observe(u,{childList:!0,subtree:!0})},disconnect(){d.disconnect()}};return Ft.push(h),()=>{d.disconnect();for(let p of a){let g=Ze.get(p);g===1?(p.removeAttribute("aria-hidden"),Ze.delete(p)):Ze.set(p,g-1)}h===Ft[Ft.length-1]?(Ft.pop(),Ft.length&&Ft[Ft.length-1].observe()):Ft.splice(Ft.indexOf(h),1)}}function Mh(t,e={}){const{defer:n}=e,i=n?xn:o=>o(),s=[];return s.push(i(()=>{const o=typeof t=="function"?t():t;s.push(Oh(o,e))})),()=>{s.forEach(o=>o?.())}}var Rh=t=>typeof t=="object"&&t!==null&&t.nodeType===1;function Ph(t){return Rh(t)?t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0:!1}var Lh="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Ra(t){return!t||t.closest("[inert]")?!1:t.matches(Lh)&&Ph(t)}function Bh(t){const e={each(n){var i;for(let s=0;s<((i=t.frames)==null?void 0:i.length);s+=1){const o=t.frames[s];o&&n(o)}},addEventListener(n,i,s){return e.each(o=>{try{o.document.addEventListener(n,i,s)}catch(r){console.warn(r)}}),()=>{try{e.removeEventListener(n,i,s)}catch(o){console.warn(o)}}},removeEventListener(n,i,s){e.each(o=>{try{o.document.removeEventListener(n,i,s)}catch(r){console.warn(r)}})}};return e}var Ho="pointerdown.outside",Go="focus.outside";function Nh(t){const e=t.composedPath()??[t.target];for(const n of e)if(Qn(n)&&Ra(n))return!0;return!1}var jh=t=>"clientY"in t;function Vh(t,e){if(!jh(e)||!t)return!1;const n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}function $h(t,e){const{exclude:n,onFocusOutside:i,onPointerDownOutside:s,onInteractOutside:o}=e;if(!t)return;const r=js(t),a=Fu(t),u=Bh(a);function c(f){const y=ei(f);return!Qn(y)||ti(t,y)||Vh(t,f)?!1:!(n!=null&&n(y))}let l;function d(f){function y(){if(!(!t||!c(f))){if(s||o){const v=Do(s,o);t.addEventListener(Ho,v,{once:!0})}Bo(t,Ho,{bubbles:!1,cancelable:!0,detail:{originalEvent:f,contextmenu:Wc(f),focusable:Nh(f)}})}}f.pointerType==="touch"?(u.removeEventListener("click",y),r.removeEventListener("click",y),l=y,r.addEventListener("click",y,{once:!0}),u.addEventListener("click",y,{once:!0})):y()}const h=new Set,p=setTimeout(()=>{h.add(u.addEventListener("pointerdown",d,!0)),h.add(xs(r,"pointerdown",d,!0))},0);function g(f){if(!(!t||!c(f))){if(i||o){const y=Do(i,o);t.addEventListener(Go,y,{once:!0})}Bo(t,Go,{bubbles:!1,cancelable:!0,detail:{originalEvent:f,contextmenu:!1,focusable:Ra(ei(f))}})}}return h.add(xs(r,"focusin",g,!0)),h.add(u.addEventListener("focusin",g,!0)),()=>{clearTimeout(p),l&&(u.removeEventListener("click",l),r.removeEventListener("click",l)),h.forEach(f=>f())}}function zh(t,e){const{defer:n}=e,i=n?xn:o=>o(),s=[];return s.push(i(()=>{const o=typeof t=="function"?t():t;s.push($h(o,e))})),()=>{s.forEach(o=>o?.())}}function Hh(t,e){const n=i=>{i.key==="Escape"&&e?.(i)};return xs(js(t),"keydown",n)}var Nt={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(t=>t.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(t){var e;const n=this.indexOf(t),i=this.topMostPointerBlockingLayer()?this.indexOf((e=this.topMostPointerBlockingLayer())==null?void 0:e.node):-1;return n<i},isTopMost(t){const e=this.layers[this.count()-1];return e?.node===t},getNestedLayers(t){return Array.from(this.layers).slice(this.indexOf(t)+1)},isInNestedLayer(t,e){return this.getNestedLayers(t).some(n=>ti(n.node,e))},isInBranch(t){return Array.from(this.branches).some(e=>ti(e,t))},add(t){this.layers.push(t)},addBranch(t){this.branches.push(t)},remove(t){const e=this.indexOf(t);e<0||(e<this.count()-1&&this.getNestedLayers(t).forEach(n=>n.dismiss()),this.layers.splice(e,1))},removeBranch(t){const e=this.branches.indexOf(t);e>=0&&this.branches.splice(e,1)},indexOf(t){return this.layers.findIndex(e=>e.node===t)},dismiss(t){var e;(e=this.layers[this.indexOf(t)])==null||e.dismiss()},clear(){this.remove(this.layers[0].node)}},qo;function Uo(){Nt.layers.forEach(({node:t})=>{t.style.pointerEvents=Nt.isBelowPointerBlockingLayer(t)?"none":"auto"})}function Gh(t){t.style.pointerEvents=""}var Ui="data-inert";function qh(t){const e=js(t);return Nt.hasPointerBlockingLayer()&&!e.body.hasAttribute(Ui)&&(qo=document.body.style.pointerEvents,e.body.style.pointerEvents="none",e.body.setAttribute(Ui,"")),()=>{Nt.hasPointerBlockingLayer()||(e.body.style.pointerEvents=qo,e.body.removeAttribute(Ui),e.body.style.length===0&&e.body.removeAttribute("style"))}}function Uh(t,e){if(!t){pc("[@zag-js/dismissable] node is `null` or `undefined`");return}const{onDismiss:n,pointerBlocking:i,exclude:s,debug:o}=e,r={dismiss:n,node:t,pointerBlocking:i};Nt.add(r),Uo();function a(h){var p,g;const f=ei(h.detail.originalEvent);Nt.isBelowPointerBlockingLayer(t)||Nt.isInBranch(f)||((p=e.onPointerDownOutside)==null||p.call(e,h),(g=e.onInteractOutside)==null||g.call(e,h),!h.defaultPrevented&&(o&&console.log("onPointerDownOutside:",h.detail.originalEvent),n?.()))}function u(h){var p,g;const f=ei(h.detail.originalEvent);Nt.isInBranch(f)||((p=e.onFocusOutside)==null||p.call(e,h),(g=e.onInteractOutside)==null||g.call(e,h),!h.defaultPrevented&&(o&&console.log("onFocusOutside:",h.detail.originalEvent),n?.()))}function c(h){var p;Nt.isTopMost(t)&&((p=e.onEscapeKeyDown)==null||p.call(e,h),!h.defaultPrevented&&n&&(h.preventDefault(),n()))}function l(h){if(!t)return!1;const p=typeof s=="function"?s():s;return(Array.isArray(p)?p:[p]).some(g=>ti(g,h))||Nt.isInNestedLayer(t,h)}const d=[i?qh(t):void 0,Hh(t,c),zh(t,{exclude:l,onFocusOutside:u,onPointerDownOutside:a})];return()=>{Nt.remove(t),Uo(),Gh(t),d.forEach(h=>h?.())}}function Wh(t,e){const{defer:n}=e,i=n?xn:o=>o(),s=[];return s.push(i(()=>{const o=typeof t=="function"?t():t;s.push(Uh(o,e))})),()=>{s.forEach(o=>o?.())}}var Wi="data-zag-scroll-lock";function Wo(t,e){if(!t)return;const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function Xh(t,e,n){if(!t)return;const i=t.style.getPropertyValue(e);return t.style.setProperty(e,n),()=>{i?t.style.setProperty(e,i):t.style.removeProperty(e)}}function Yh(t){const e=t.getBoundingClientRect().left;return Math.round(e)+t.scrollLeft?"paddingLeft":"paddingRight"}function Kh(t){const e=t??document,n=e.defaultView??window,{documentElement:i,body:s}=e;if(s.hasAttribute(Wi))return;s.setAttribute(Wi,"");const o=n.innerWidth-i.clientWidth,r=()=>Xh(i,"--scrollbar-width",`${o}px`),a=Yh(i),u=()=>Wo(s,{overflow:"hidden",[a]:`${o}px`}),c=()=>{const{scrollX:d,scrollY:h,visualViewport:p}=n,g=p?.offsetLeft??0,f=p?.offsetTop??0,y=Wo(s,{position:"fixed",overflow:"hidden",top:`${-(h-Math.floor(f))}px`,left:`${-(d-Math.floor(g))}px`,right:"0",[a]:`${o}px`});return()=>{y?.(),n.scrollTo(d,h)}},l=[r(),Lu()?c():u()];return()=>{l.forEach(d=>d?.()),s.removeAttribute(Wi)}}/*!
4
4
  * tabbable 6.2.0
@@ -11,4 +11,4 @@ import{q as tt,E as so,I as al,r as J,H as At,b as H,o as _,e as it,w as rt,G as
11
11
  * @author RubaXa <trash@rubaxa.org>
12
12
  * @author owenm <owen23355@gmail.com>
13
13
  * @license MIT
14
- */function tr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function Wt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tr(Object(n),!0).forEach(function(i){Bp(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Gn(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Gn=function(e){return typeof e}:Gn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gn(t)}function Bp(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qt(){return Qt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Qt.apply(this,arguments)}function Np(t,e){if(t==null)return{};var n={},i=Object.keys(t),s,o;for(o=0;o<i.length;o++)s=i[o],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function jp(t,e){if(t==null)return{};var n=Np(t,e),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(s=0;s<o.length;s++)i=o[s],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}var Vp="1.14.0";function Zt(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var ee=Zt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),_n=Zt(/Edge/i),er=Zt(/firefox/i),dn=Zt(/safari/i)&&!Zt(/chrome/i)&&!Zt(/android/i),$a=Zt(/iP(ad|od|hone)/i),$p=Zt(/chrome/i)&&Zt(/android/i),za={capture:!1,passive:!1};function Y(t,e,n){t.addEventListener(e,n,!ee&&za)}function U(t,e,n){t.removeEventListener(e,n,!ee&&za)}function gi(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function zp(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function $t(t,e,n,i){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&gi(t,e):gi(t,e))||i&&t===n)return t;if(t===n)break}while(t=zp(t))}return null}var nr=/\s+/g;function wt(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(nr," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(nr," ")}}function R(t,e,n){var i=t&&t.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in i)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),i[e]=n+(typeof n=="string"?"":"px")}}function qe(t,e){var n="";if(typeof t=="string")n=t;else do{var i=R(t,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!e&&(t=t.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function Ha(t,e,n){if(t){var i=t.getElementsByTagName(e),s=0,o=i.length;if(n)for(;s<o;s++)n(i[s],s);return i}return[]}function Gt(){var t=document.scrollingElement;return t||document.documentElement}function at(t,e,n,i,s){if(!(!t.getBoundingClientRect&&t!==window)){var o,r,a,u,c,l,d;if(t!==window&&t.parentNode&&t!==Gt()?(o=t.getBoundingClientRect(),r=o.top,a=o.left,u=o.bottom,c=o.right,l=o.height,d=o.width):(r=0,a=0,u=window.innerHeight,c=window.innerWidth,l=window.innerHeight,d=window.innerWidth),(e||n)&&t!==window&&(s=s||t.parentNode,!ee))do if(s&&s.getBoundingClientRect&&(R(s,"transform")!=="none"||n&&R(s,"position")!=="static")){var h=s.getBoundingClientRect();r-=h.top+parseInt(R(s,"border-top-width")),a-=h.left+parseInt(R(s,"border-left-width")),u=r+o.height,c=a+o.width;break}while(s=s.parentNode);if(i&&t!==window){var p=qe(s||t),g=p&&p.a,f=p&&p.d;p&&(r/=f,a/=g,d/=g,l/=f,u=r+l,c=a+d)}return{top:r,left:a,bottom:u,right:c,width:d,height:l}}}function ir(t,e,n){for(var i=ae(t,!0),s=at(t)[e];i;){var o=at(i)[n],r=void 0;if(n==="top"||n==="left"?r=s>=o:r=s<=o,!r)return i;if(i===Gt())break;i=ae(i,!1)}return!1}function Ye(t,e,n,i){for(var s=0,o=0,r=t.children;o<r.length;){if(r[o].style.display!=="none"&&r[o]!==L.ghost&&(i||r[o]!==L.dragged)&&$t(r[o],n.draggable,t,!1)){if(s===e)return r[o];s++}o++}return null}function Js(t,e){for(var n=t.lastElementChild;n&&(n===L.ghost||R(n,"display")==="none"||e&&!gi(n,e));)n=n.previousElementSibling;return n||null}function Ot(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==L.clone&&(!e||gi(t,e))&&n++;return n}function sr(t){var e=0,n=0,i=Gt();if(t)do{var s=qe(t),o=s.a,r=s.d;e+=t.scrollLeft*o,n+=t.scrollTop*r}while(t!==i&&(t=t.parentNode));return[e,n]}function Hp(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var i in e)if(e.hasOwnProperty(i)&&e[i]===t[n][i])return Number(n)}return-1}function ae(t,e){if(!t||!t.getBoundingClientRect)return Gt();var n=t,i=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=R(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Gt();if(i||e)return n;i=!0}}while(n=n.parentNode);return Gt()}function Gp(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Yi(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var hn;function Ga(t,e){return function(){if(!hn){var n=arguments,i=this;n.length===1?t.call(i,n[0]):t.apply(i,n),hn=setTimeout(function(){hn=void 0},e)}}}function qp(){clearTimeout(hn),hn=void 0}function qa(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Ua(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}var St="Sortable"+new Date().getTime();function Up(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(i){if(!(R(i,"display")==="none"||i===L.ghost)){t.push({target:i,rect:at(i)});var s=Wt({},t[t.length-1].rect);if(i.thisAnimationDuration){var o=qe(i,!0);o&&(s.top-=o.f,s.left-=o.e)}i.fromRect=s}})}},addAnimationState:function(n){t.push(n)},removeAnimationState:function(n){t.splice(Hp(t,{target:n}),1)},animateAll:function(n){var i=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var s=!1,o=0;t.forEach(function(r){var a=0,u=r.target,c=u.fromRect,l=at(u),d=u.prevFromRect,h=u.prevToRect,p=r.rect,g=qe(u,!0);g&&(l.top-=g.f,l.left-=g.e),u.toRect=l,u.thisAnimationDuration&&Yi(d,l)&&!Yi(c,l)&&(p.top-l.top)/(p.left-l.left)===(c.top-l.top)/(c.left-l.left)&&(a=Xp(p,d,h,i.options)),Yi(l,c)||(u.prevFromRect=c,u.prevToRect=l,a||(a=i.options.animation),i.animate(u,p,l,a)),a&&(s=!0,o=Math.max(o,a),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},a),u.thisAnimationDuration=a)}),clearTimeout(e),s?e=setTimeout(function(){typeof n=="function"&&n()},o):typeof n=="function"&&n(),t=[]},animate:function(n,i,s,o){if(o){R(n,"transition",""),R(n,"transform","");var r=qe(this.el),a=r&&r.a,u=r&&r.d,c=(i.left-s.left)/(a||1),l=(i.top-s.top)/(u||1);n.animatingX=!!c,n.animatingY=!!l,R(n,"transform","translate3d("+c+"px,"+l+"px,0)"),this.forRepaintDummy=Wp(n),R(n,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),R(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){R(n,"transition",""),R(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},o)}}}}function Wp(t){return t.offsetWidth}function Xp(t,e,n,i){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*i.animation}var Be=[],Ki={initializeByDefault:!0},Sn={mount:function(t){for(var e in Ki)Ki.hasOwnProperty(e)&&!(e in t)&&(t[e]=Ki[e]);Be.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Be.push(t)},pluginEvent:function(t,e,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var s=t+"Global";Be.forEach(function(o){e[o.pluginName]&&(e[o.pluginName][s]&&e[o.pluginName][s](Wt({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](Wt({sortable:e},n)))})},initializePlugins:function(t,e,n,i){Be.forEach(function(r){var a=r.pluginName;if(!(!t.options[a]&&!r.initializeByDefault)){var u=new r(t,e,t.options);u.sortable=t,u.options=t.options,t[a]=u,Qt(n,u.defaults)}});for(var s in t.options)if(t.options.hasOwnProperty(s)){var o=this.modifyOption(t,s,t.options[s]);typeof o<"u"&&(t.options[s]=o)}},getEventProperties:function(t,e){var n={};return Be.forEach(function(i){typeof i.eventProperties=="function"&&Qt(n,i.eventProperties.call(e[i.pluginName],t))}),n},modifyOption:function(t,e,n){var i;return Be.forEach(function(s){t[s.pluginName]&&s.optionListeners&&typeof s.optionListeners[e]=="function"&&(i=s.optionListeners[e].call(t[s.pluginName],n))}),i}};function Yp(t){var e=t.sortable,n=t.rootEl,i=t.name,s=t.targetEl,o=t.cloneEl,r=t.toEl,a=t.fromEl,u=t.oldIndex,c=t.newIndex,l=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[St],!!e){var f,y=e.options,v="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!ee&&!_n?f=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent(i,!0,!0)),f.to=r||n,f.from=a||n,f.item=s||n,f.clone=o,f.oldIndex=u,f.newIndex=c,f.oldDraggableIndex=l,f.newDraggableIndex=d,f.originalEvent=h,f.pullMode=p?p.lastPutMode:void 0;var k=Wt(Wt({},g),Sn.getEventProperties(i,e));for(var w in k)f[w]=k[w];n&&n.dispatchEvent(f),y[v]&&y[v].call(e,f)}}var Kp=["evt"],bt=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,s=jp(n,Kp);Sn.pluginEvent.bind(L)(t,e,Wt({dragEl:C,parentEl:et,ghostEl:j,rootEl:Q,nextEl:ke,lastDownEl:qn,cloneEl:nt,cloneHidden:re,dragStarted:en,putSortable:dt,activeSortable:L.active,originalEvent:i,oldIndex:$e,oldDraggableIndex:pn,newIndex:Ct,newDraggableIndex:oe,hideGhostForTarget:Ka,unhideGhostForTarget:Za,cloneNowHidden:function(){re=!0},cloneNowShown:function(){re=!1},dispatchSortableEvent:function(o){pt({sortable:e,name:o,originalEvent:i})}},s))};function pt(t){Yp(Wt({putSortable:dt,cloneEl:nt,targetEl:C,rootEl:Q,oldIndex:$e,oldDraggableIndex:pn,newIndex:Ct,newDraggableIndex:oe},t))}var C,et,j,Q,ke,qn,nt,re,$e,Ct,pn,oe,Rn,dt,Ve=!1,vi=!1,mi=[],be,Bt,Zi,Ji,or,rr,en,Ne,fn,gn=!1,Pn=!1,Un,ht,Qi=[],As=!1,bi=[],Mi=typeof document<"u",Ln=$a,ar=_n||ee?"cssFloat":"float",Zp=Mi&&!$p&&!$a&&"draggable"in document.createElement("div"),Wa=function(){if(Mi){if(ee)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Xa=function(t,e){var n=R(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),s=Ye(t,0,e),o=Ye(t,1,e),r=s&&R(s),a=o&&R(o),u=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+at(s).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+at(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&r.float&&r.float!=="none"){var l=r.float==="left"?"left":"right";return o&&(a.clear==="both"||a.clear===l)?"vertical":"horizontal"}return s&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||u>=i&&n[ar]==="none"||o&&n[ar]==="none"&&u+c>i)?"vertical":"horizontal"},Jp=function(t,e,n){var i=n?t.left:t.top,s=n?t.right:t.bottom,o=n?t.width:t.height,r=n?e.left:e.top,a=n?e.right:e.bottom,u=n?e.width:e.height;return i===r||s===a||i+o/2===r+u/2},Qp=function(t,e){var n;return mi.some(function(i){var s=i[St].options.emptyInsertThreshold;if(!(!s||Js(i))){var o=at(i),r=t>=o.left-s&&t<=o.right+s,a=e>=o.top-s&&e<=o.bottom+s;if(r&&a)return n=i}}),n},Ya=function(t){function e(s,o){return function(r,a,u,c){var l=r.options.group.name&&a.options.group.name&&r.options.group.name===a.options.group.name;if(s==null&&(o||l))return!0;if(s==null||s===!1)return!1;if(o&&s==="clone")return s;if(typeof s=="function")return e(s(r,a,u,c),o)(r,a,u,c);var d=(o?r:a).options.group.name;return s===!0||typeof s=="string"&&s===d||s.join&&s.indexOf(d)>-1}}var n={},i=t.group;(!i||Gn(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=e(i.pull,!0),n.checkPut=e(i.put),n.revertClone=i.revertClone,t.group=n},Ka=function(){!Wa&&j&&R(j,"display","none")},Za=function(){!Wa&&j&&R(j,"display","")};Mi&&document.addEventListener("click",function(t){if(vi)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),vi=!1,!1},!0);var ye=function(t){if(C){t=t.touches?t.touches[0]:t;var e=Qp(t.clientX,t.clientY);if(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[St]._onDragOver(n)}}},tf=function(t){C&&C.parentNode[St]._isOutsideThisEl(t.target)};function L(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Qt({},e),t[St]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xa(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:L.supportPointer!==!1&&"PointerEvent"in window&&!dn,emptyInsertThreshold:5};Sn.initializePlugins(this,t,n);for(var i in n)!(i in e)&&(e[i]=n[i]);Ya(e);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=e.forceFallback?!1:Zp,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Y(t,"pointerdown",this._onTapStart):(Y(t,"mousedown",this._onTapStart),Y(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Y(t,"dragover",this),Y(t,"dragenter",this)),mi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Qt(this,Up())}L.prototype={constructor:L,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Ne=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,C):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,s=i.preventOnFilter,o=t.type,r=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,a=(r||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=i.filter;if(uf(n),!C&&!(/mousedown|pointerdown/.test(o)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&dn&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=$t(a,i.draggable,n,!1),!(a&&a.animated)&&qn!==a)){if($e=Ot(a),pn=Ot(a,i.draggable),typeof c=="function"){if(c.call(this,t,a,this)){pt({sortable:e,rootEl:u,name:"filter",targetEl:a,toEl:n,fromEl:n}),bt("filter",e,{evt:t}),s&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(l){if(l=$t(u,l.trim(),n,!1),l)return pt({sortable:e,rootEl:l,name:"filter",targetEl:a,fromEl:n,toEl:n}),bt("filter",e,{evt:t}),!0}),c)){s&&t.cancelable&&t.preventDefault();return}i.handle&&!$t(u,i.handle,n,!1)||this._prepareDragStart(t,r,a)}}},_prepareDragStart:function(t,e,n){var i=this,s=i.el,o=i.options,r=s.ownerDocument,a;if(n&&!C&&n.parentNode===s){var u=at(n);if(Q=s,C=n,et=C.parentNode,ke=C.nextSibling,qn=n,Rn=o.group,L.dragged=C,be={target:C,clientX:(e||t).clientX,clientY:(e||t).clientY},or=be.clientX-u.left,rr=be.clientY-u.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,C.style["will-change"]="all",a=function(){if(bt("delayEnded",i,{evt:t}),L.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!er&&i.nativeDraggable&&(C.draggable=!0),i._triggerDragStart(t,e),pt({sortable:i,name:"choose",originalEvent:t}),wt(C,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){Ha(C,c.trim(),ts)}),Y(r,"dragover",ye),Y(r,"mousemove",ye),Y(r,"touchmove",ye),Y(r,"mouseup",i._onDrop),Y(r,"touchend",i._onDrop),Y(r,"touchcancel",i._onDrop),er&&this.nativeDraggable&&(this.options.touchStartThreshold=4,C.draggable=!0),bt("delayStart",this,{evt:t}),o.delay&&(!o.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(_n||ee))){if(L.eventCanceled){this._onDrop();return}Y(r,"mouseup",i._disableDelayedDrag),Y(r,"touchend",i._disableDelayedDrag),Y(r,"touchcancel",i._disableDelayedDrag),Y(r,"mousemove",i._delayedDragTouchMoveHandler),Y(r,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&Y(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(a,o.delay)}else a()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){C&&ts(C),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;U(t,"mouseup",this._disableDelayedDrag),U(t,"touchend",this._disableDelayedDrag),U(t,"touchcancel",this._disableDelayedDrag),U(t,"mousemove",this._delayedDragTouchMoveHandler),U(t,"touchmove",this._delayedDragTouchMoveHandler),U(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?Y(document,"pointermove",this._onTouchMove):e?Y(document,"touchmove",this._onTouchMove):Y(document,"mousemove",this._onTouchMove):(Y(C,"dragend",this),Y(Q,"dragstart",this._onDragStart));try{document.selection?Wn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Ve=!1,Q&&C){bt("dragStarted",this,{evt:e}),this.nativeDraggable&&Y(document,"dragover",tf);var n=this.options;!t&&wt(C,n.dragClass,!1),wt(C,n.ghostClass,!0),L.active=this,t&&this._appendGhost(),pt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Bt){this._lastX=Bt.clientX,this._lastY=Bt.clientY,Ka();for(var t=document.elementFromPoint(Bt.clientX,Bt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Bt.clientX,Bt.clientY),t!==e);)e=t;if(C.parentNode[St]._isOutsideThisEl(t),e)do{if(e[St]){var n=void 0;if(n=e[St]._onDragOver({clientX:Bt.clientX,clientY:Bt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Za()}},_onTouchMove:function(t){if(be){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,s=t.touches?t.touches[0]:t,o=j&&qe(j,!0),r=j&&o&&o.a,a=j&&o&&o.d,u=Ln&&ht&&sr(ht),c=(s.clientX-be.clientX+i.x)/(r||1)+(u?u[0]-Qi[0]:0)/(r||1),l=(s.clientY-be.clientY+i.y)/(a||1)+(u?u[1]-Qi[1]:0)/(a||1);if(!L.active&&!Ve){if(n&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(j){o?(o.e+=c-(Zi||0),o.f+=l-(Ji||0)):o={a:1,b:0,c:0,d:1,e:c,f:l};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");R(j,"webkitTransform",d),R(j,"mozTransform",d),R(j,"msTransform",d),R(j,"transform",d),Zi=c,Ji=l,Bt=s}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!j){var t=this.options.fallbackOnBody?document.body:Q,e=at(C,!0,Ln,!0,t),n=this.options;if(Ln){for(ht=t;R(ht,"position")==="static"&&R(ht,"transform")==="none"&&ht!==document;)ht=ht.parentNode;ht!==document.body&&ht!==document.documentElement?(ht===document&&(ht=Gt()),e.top+=ht.scrollTop,e.left+=ht.scrollLeft):ht=Gt(),Qi=sr(ht)}j=C.cloneNode(!0),wt(j,n.ghostClass,!1),wt(j,n.fallbackClass,!0),wt(j,n.dragClass,!0),R(j,"transition",""),R(j,"transform",""),R(j,"box-sizing","border-box"),R(j,"margin",0),R(j,"top",e.top),R(j,"left",e.left),R(j,"width",e.width),R(j,"height",e.height),R(j,"opacity","0.8"),R(j,"position",Ln?"absolute":"fixed"),R(j,"zIndex","100000"),R(j,"pointerEvents","none"),L.ghost=j,t.appendChild(j),R(j,"transform-origin",or/parseInt(j.style.width)*100+"% "+rr/parseInt(j.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,i=t.dataTransfer,s=n.options;if(bt("dragStart",this,{evt:t}),L.eventCanceled){this._onDrop();return}bt("setupClone",this),L.eventCanceled||(nt=Ua(C),nt.draggable=!1,nt.style["will-change"]="",this._hideClone(),wt(nt,this.options.chosenClass,!1),L.clone=nt),n.cloneId=Wn(function(){bt("clone",n),!L.eventCanceled&&(n.options.removeCloneOnHide||Q.insertBefore(nt,C),n._hideClone(),pt({sortable:n,name:"clone"}))}),!e&&wt(C,s.dragClass,!0),e?(vi=!0,n._loopId=setInterval(n._emulateDragOver,50)):(U(document,"mouseup",n._onDrop),U(document,"touchend",n._onDrop),U(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",s.setData&&s.setData.call(n,i,C)),Y(document,"drop",n),R(C,"transform","translateZ(0)")),Ve=!0,n._dragStartId=Wn(n._dragStarted.bind(n,e,t)),Y(document,"selectstart",n),en=!0,dn&&R(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,n=t.target,i,s,o,r=this.options,a=r.group,u=L.active,c=Rn===a,l=r.sort,d=dt||u,h,p=this,g=!1;if(As)return;function f(X,Vt){bt(X,p,Wt({evt:t,isOwner:c,axis:h?"vertical":"horizontal",revert:o,dragRect:i,targetRect:s,canSort:l,fromSortable:d,target:n,completed:v,onMove:function(ne,Lt){return Bn(Q,e,C,i,ne,at(ne),t,Lt)},changed:k},Vt))}function y(){f("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function v(X){return f("dragOverCompleted",{insertion:X}),X&&(c?u._hideClone():u._showClone(p),p!==d&&(wt(C,dt?dt.options.ghostClass:u.options.ghostClass,!1),wt(C,r.ghostClass,!0)),dt!==p&&p!==L.active?dt=p:p===L.active&&dt&&(dt=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){f("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===C&&!C.animated||n===e&&!n.animated)&&(Ne=null),!r.dragoverBubble&&!t.rootEl&&n!==document&&(C.parentNode[St]._isOutsideThisEl(t.target),!X&&ye(t)),!r.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function k(){Ct=Ot(C),oe=Ot(C,r.draggable),pt({sortable:p,name:"change",toEl:e,newIndex:Ct,newDraggableIndex:oe,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=$t(n,r.draggable,e,!0),f("dragOver"),L.eventCanceled)return g;if(C.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return v(!1);if(vi=!1,u&&!r.disabled&&(c?l||(o=et!==Q):dt===this||(this.lastPutMode=Rn.checkPull(this,u,C,t))&&a.checkPut(this,u,C,t))){if(h=this._getDirection(t,n)==="vertical",i=at(C),f("dragOverValid"),L.eventCanceled)return g;if(o)return et=Q,y(),this._hideClone(),f("revert"),L.eventCanceled||(ke?Q.insertBefore(C,ke):Q.appendChild(C)),v(!0);var w=Js(e,r.draggable);if(!w||of(t,h,this)&&!w.animated){if(w===C)return v(!1);if(w&&e===t.target&&(n=w),n&&(s=at(n)),Bn(Q,e,C,i,n,s,t,!!n)!==!1)return y(),e.appendChild(C),et=e,k(),v(!0)}else if(w&&sf(t,h,this)){var T=Ye(e,0,r,!0);if(T===C)return v(!1);if(n=T,s=at(n),Bn(Q,e,C,i,n,s,t,!1)!==!1)return y(),e.insertBefore(C,T),et=e,k(),v(!0)}else if(n.parentNode===e){s=at(n);var M=0,D,W=C.parentNode!==e,x=!Jp(C.animated&&C.toRect||i,n.animated&&n.toRect||s,h),b=h?"top":"left",m=ir(n,"top","top")||ir(C,"top","top"),E=m?m.scrollTop:void 0;Ne!==n&&(D=s[b],gn=!1,Pn=!x&&r.invertSwap||W),M=rf(t,n,s,h,x?1:r.swapThreshold,r.invertedSwapThreshold==null?r.swapThreshold:r.invertedSwapThreshold,Pn,Ne===n);var F;if(M!==0){var $=Ot(C);do $-=M,F=et.children[$];while(F&&(R(F,"display")==="none"||F===j))}if(M===0||F===n)return v(!1);Ne=n,fn=M;var N=n.nextElementSibling,B=!1;B=M===1;var P=Bn(Q,e,C,i,n,s,t,B);if(P!==!1)return(P===1||P===-1)&&(B=P===1),As=!0,setTimeout(nf,30),y(),B&&!N?e.appendChild(C):n.parentNode.insertBefore(C,B?N:n),m&&qa(m,0,E-m.scrollTop),et=C.parentNode,D!==void 0&&!Pn&&(Un=Math.abs(D-at(n)[b])),k(),v(!0)}if(e.contains(C))return v(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){U(document,"mousemove",this._onTouchMove),U(document,"touchmove",this._onTouchMove),U(document,"pointermove",this._onTouchMove),U(document,"dragover",ye),U(document,"mousemove",ye),U(document,"touchmove",ye)},_offUpEvents:function(){var t=this.el.ownerDocument;U(t,"mouseup",this._onDrop),U(t,"touchend",this._onDrop),U(t,"pointerup",this._onDrop),U(t,"touchcancel",this._onDrop),U(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(Ct=Ot(C),oe=Ot(C,n.draggable),bt("drop",this,{evt:t}),et=C&&C.parentNode,Ct=Ot(C),oe=Ot(C,n.draggable),L.eventCanceled){this._nulling();return}Ve=!1,Pn=!1,gn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ts(this.cloneId),Ts(this._dragStartId),this.nativeDraggable&&(U(document,"drop",this),U(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),dn&&R(document.body,"user-select",""),R(C,"transform",""),t&&(en&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),j&&j.parentNode&&j.parentNode.removeChild(j),(Q===et||dt&&dt.lastPutMode!=="clone")&&nt&&nt.parentNode&&nt.parentNode.removeChild(nt),C&&(this.nativeDraggable&&U(C,"dragend",this),ts(C),C.style["will-change"]="",en&&!Ve&&wt(C,dt?dt.options.ghostClass:this.options.ghostClass,!1),wt(C,this.options.chosenClass,!1),pt({sortable:this,name:"unchoose",toEl:et,newIndex:null,newDraggableIndex:null,originalEvent:t}),Q!==et?(Ct>=0&&(pt({rootEl:et,name:"add",toEl:et,fromEl:Q,originalEvent:t}),pt({sortable:this,name:"remove",toEl:et,originalEvent:t}),pt({rootEl:et,name:"sort",toEl:et,fromEl:Q,originalEvent:t}),pt({sortable:this,name:"sort",toEl:et,originalEvent:t})),dt&&dt.save()):Ct!==$e&&Ct>=0&&(pt({sortable:this,name:"update",toEl:et,originalEvent:t}),pt({sortable:this,name:"sort",toEl:et,originalEvent:t})),L.active&&((Ct==null||Ct===-1)&&(Ct=$e,oe=pn),pt({sortable:this,name:"end",toEl:et,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){bt("nulling",this),Q=C=et=j=ke=nt=qn=re=be=Bt=en=Ct=oe=$e=pn=Ne=fn=dt=Rn=L.dragged=L.ghost=L.clone=L.active=null,bi.forEach(function(t){t.checked=!0}),bi.length=Zi=Ji=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":C&&(this._onDragOver(t),ef(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,i=0,s=n.length,o=this.options;i<s;i++)e=n[i],$t(e,o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||lf(e));return t},sort:function(t,e){var n={},i=this.el;this.toArray().forEach(function(s,o){var r=i.children[o];$t(r,this.options.draggable,i,!1)&&(n[s]=r)},this),e&&this.captureAnimationState(),t.forEach(function(s){n[s]&&(i.removeChild(n[s]),i.appendChild(n[s]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return $t(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(e===void 0)return n[t];var i=Sn.modifyOption(this,t,e);typeof i<"u"?n[t]=i:n[t]=e,t==="group"&&Ya(n)},destroy:function(){bt("destroy",this);var t=this.el;t[St]=null,U(t,"mousedown",this._onTapStart),U(t,"touchstart",this._onTapStart),U(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(U(t,"dragover",this),U(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),mi.splice(mi.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!re){if(bt("hideClone",this),L.eventCanceled)return;R(nt,"display","none"),this.options.removeCloneOnHide&&nt.parentNode&&nt.parentNode.removeChild(nt),re=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(re){if(bt("showClone",this),L.eventCanceled)return;C.parentNode==Q&&!this.options.group.revertClone?Q.insertBefore(nt,C):ke?Q.insertBefore(nt,ke):Q.appendChild(nt),this.options.group.revertClone&&this.animate(C,nt),R(nt,"display",""),re=!1}}};function ef(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Bn(t,e,n,i,s,o,r,a){var u,c=t[St],l=c.options.onMove,d;return window.CustomEvent&&!ee&&!_n?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=e,u.from=t,u.dragged=n,u.draggedRect=i,u.related=s||e,u.relatedRect=o||at(e),u.willInsertAfter=a,u.originalEvent=r,t.dispatchEvent(u),l&&(d=l.call(c,u,r)),d}function ts(t){t.draggable=!1}function nf(){As=!1}function sf(t,e,n){var i=at(Ye(n.el,0,n.options,!0)),s=10;return e?t.clientX<i.left-s||t.clientY<i.top&&t.clientX<i.right:t.clientY<i.top-s||t.clientY<i.bottom&&t.clientX<i.left}function of(t,e,n){var i=at(Js(n.el,n.options.draggable)),s=10;return e?t.clientX>i.right+s||t.clientX<=i.right&&t.clientY>i.bottom&&t.clientX>=i.left:t.clientX>i.right&&t.clientY>i.top||t.clientX<=i.right&&t.clientY>i.bottom+s}function rf(t,e,n,i,s,o,r,a){var u=i?t.clientY:t.clientX,c=i?n.height:n.width,l=i?n.top:n.left,d=i?n.bottom:n.right,h=!1;if(!r){if(a&&Un<c*s){if(!gn&&(fn===1?u>l+c*o/2:u<d-c*o/2)&&(gn=!0),gn)h=!0;else if(fn===1?u<l+Un:u>d-Un)return-fn}else if(u>l+c*(1-s)/2&&u<d-c*(1-s)/2)return af(e)}return h=h||r,h&&(u<l+c*o/2||u>d-c*o/2)?u>l+c/2?1:-1:0}function af(t){return Ot(C)<Ot(t)?1:-1}function lf(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function uf(t){bi.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var i=e[n];i.checked&&bi.push(i)}}function Wn(t){return setTimeout(t,0)}function Ts(t){return clearTimeout(t)}Mi&&Y(document,"touchmove",function(t){(L.active||Ve)&&t.cancelable&&t.preventDefault()});L.utils={on:Y,off:U,css:R,find:Ha,is:function(t,e){return!!$t(t,e,t,!1)},extend:Gp,throttle:Ga,closest:$t,toggleClass:wt,clone:Ua,index:Ot,nextTick:Wn,cancelNextTick:Ts,detectDirection:Xa,getChild:Ye};L.get=function(t){return t[St]};L.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(L.utils=Wt(Wt({},L.utils),i.utils)),Sn.mount(i)})};L.create=function(t,e){return new L(t,e)};L.version=Vp;var st=[],nn,Is,Ds=!1,es,ns,yi,sn;function cf(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(e){var n=e.originalEvent;this.sortable.nativeDraggable?Y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Y(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Y(document,"touchmove",this._handleFallbackAutoScroll):Y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?U(document,"dragover",this._handleAutoScroll):(U(document,"pointermove",this._handleFallbackAutoScroll),U(document,"touchmove",this._handleFallbackAutoScroll),U(document,"mousemove",this._handleFallbackAutoScroll)),lr(),Xn(),qp()},nulling:function(){yi=Is=nn=Ds=sn=es=ns=null,st.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,n){var i=this,s=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(s,o);if(yi=e,n||this.options.forceAutoScrollFallback||_n||ee||dn){is(e,this.options,r,n);var a=ae(r,!0);Ds&&(!sn||s!==es||o!==ns)&&(sn&&lr(),sn=setInterval(function(){var u=ae(document.elementFromPoint(s,o),!0);u!==a&&(a=u,Xn()),is(e,i.options,u,n)},10),es=s,ns=o)}else{if(!this.options.bubbleScroll||ae(r,!0)===Gt()){Xn();return}is(e,this.options,ae(r,!1),!1)}}},Qt(t,{pluginName:"scroll",initializeByDefault:!0})}function Xn(){st.forEach(function(t){clearInterval(t.pid)}),st=[]}function lr(){clearInterval(sn)}var is=Ga(function(t,e,n,i){if(e.scroll){var s=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,r=e.scrollSensitivity,a=e.scrollSpeed,u=Gt(),c=!1,l;Is!==n&&(Is=n,Xn(),nn=e.scroll,l=e.scrollFn,nn===!0&&(nn=ae(n,!0)));var d=0,h=nn;do{var p=h,g=at(p),f=g.top,y=g.bottom,v=g.left,k=g.right,w=g.width,T=g.height,M=void 0,D=void 0,W=p.scrollWidth,x=p.scrollHeight,b=R(p),m=p.scrollLeft,E=p.scrollTop;p===u?(M=w<W&&(b.overflowX==="auto"||b.overflowX==="scroll"||b.overflowX==="visible"),D=T<x&&(b.overflowY==="auto"||b.overflowY==="scroll"||b.overflowY==="visible")):(M=w<W&&(b.overflowX==="auto"||b.overflowX==="scroll"),D=T<x&&(b.overflowY==="auto"||b.overflowY==="scroll"));var F=M&&(Math.abs(k-s)<=r&&m+w<W)-(Math.abs(v-s)<=r&&!!m),$=D&&(Math.abs(y-o)<=r&&E+T<x)-(Math.abs(f-o)<=r&&!!E);if(!st[d])for(var N=0;N<=d;N++)st[N]||(st[N]={});(st[d].vx!=F||st[d].vy!=$||st[d].el!==p)&&(st[d].el=p,st[d].vx=F,st[d].vy=$,clearInterval(st[d].pid),(F!=0||$!=0)&&(c=!0,st[d].pid=setInterval(function(){i&&this.layer===0&&L.active._onTouchMove(yi);var B=st[this.layer].vy?st[this.layer].vy*a:0,P=st[this.layer].vx?st[this.layer].vx*a:0;typeof l=="function"&&l.call(L.dragged.parentNode[St],P,B,t,yi,st[this.layer].el)!=="continue"||qa(st[this.layer].el,P,B)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==u&&(h=ae(h,!1)));Ds=c}},30),Ja=function(t){var e=t.originalEvent,n=t.putSortable,i=t.dragEl,s=t.activeSortable,o=t.dispatchSortableEvent,r=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var u=n||s;r();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,l=document.elementFromPoint(c.clientX,c.clientY);a(),u&&!u.el.contains(l)&&(o("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function Qs(){}Qs.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var i=Ye(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(e,i):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:Ja};Qt(Qs,{pluginName:"revertOnSpill"});function to(){}to.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,i=n||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:Ja};Qt(to,{pluginName:"removeOnSpill"});L.mount(new cf);L.mount(to,Qs);const df=["Start","Add","Remove","Update","End"],hf=["Choose","Unchoose","Sort","Filter","Clone"],pf=["Move"],ur={manage:pf,manageAndEmit:df,emit:hf};[...[...ur.manageAndEmit,...ur.emit].map(t=>t.toLowerCase())];var Yn=(t,e=[])=>({parts:(...n)=>{if(ff(e))return Yn(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Yn(t,[...e,...n]),rename:n=>Yn(n,e),keys:()=>e,build:()=>[...new Set(e)].reduce((n,i)=>Object.assign(n,{[i]:{selector:[`&[data-scope="${je(t)}"][data-part="${je(i)}"]`,`& [data-scope="${je(t)}"][data-part="${je(i)}"]`].join(", "),attrs:{"data-scope":je(t),"data-part":je(i)}}}),{})}),je=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),ff=t=>t.length===0,Qe=t=>t?"":void 0,gf=t=>t.nodeType===Node.DOCUMENT_NODE?t:t.ownerDocument??document;function vf(t){const e={getRootNode:n=>{var i;return((i=n.getRootNode)==null?void 0:i.call(n))??document},getDoc:n=>gf(e.getRootNode(n)),getWin:n=>e.getDoc(n).defaultView??window,getActiveElement:n=>e.getDoc(n).activeElement,isActiveElement:(n,i)=>i===e.getActiveElement(n),focus(n,i){i!=null&&(e.isActiveElement(n,i)||i.focus({preventScroll:!0}))},getById:(n,i)=>e.getRootNode(n).getElementById(i),setValue:(n,i)=>{if(n==null||i==null)return;const s=i.toString();n.value!==s&&(n.value=i.toString())}};return{...e,...t}}var mf={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},ss=t=>typeof t=="object"&&t!==null,Ce=new WeakMap,on=new WeakSet,bf=(t=Object.is,e=(c,l)=>new Proxy(c,l),n=c=>ss(c)&&!on.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),i=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},s=new WeakMap,o=(c,l,d=i)=>{const h=s.get(c);if(h?.[0]===l)return h[1];const p=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return ni(p,!0),s.set(c,[l,p]),Reflect.ownKeys(c).forEach(g=>{const f=Reflect.get(c,g);on.has(f)?(ni(f,!1),p[g]=f):f instanceof Promise?Object.defineProperty(p,g,{get(){return d(f)}}):Ce.has(f)?p[g]=Ke(f,d):p[g]=f}),Object.freeze(p)},r=new WeakMap,a=[1,1],u=c=>{if(!ss(c))throw new Error("object required");const l=r.get(c);if(l)return l;let d=a[0];const h=new Set,p=(x,b=++a[0])=>{d!==b&&(d=b,h.forEach(m=>m(x,b)))};let g=a[1];const f=(x=++a[1])=>(g!==x&&!h.size&&(g=x,v.forEach(([b])=>{const m=b[1](x);m>d&&(d=m)})),d),y=x=>(b,m)=>{const E=[...b];E[1]=[x,...E[1]],p(E,m)},v=new Map,k=(x,b)=>{if(h.size){const m=b[3](y(x));v.set(x,[b,m])}else v.set(x,[b])},w=x=>{var b;const m=v.get(x);m&&(v.delete(x),(b=m[1])==null||b.call(m))},T=x=>(h.add(x),h.size===1&&v.forEach(([b,m],E)=>{const F=b[3](y(E));v.set(E,[b,F])}),()=>{h.delete(x),h.size===0&&v.forEach(([b,m],E)=>{m&&(m(),v.set(E,[b]))})}),M=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),D=e(M,{deleteProperty(x,b){const m=Reflect.get(x,b);w(b);const E=Reflect.deleteProperty(x,b);return E&&p(["delete",[b],m]),E},set(x,b,m,E){var F;const $=Reflect.has(x,b),N=Reflect.get(x,b,E);if($&&(t(N,m)||r.has(m)&&t(N,r.get(m))))return!0;w(b),ss(m)&&(m=Zr(m)||m);let B=m;if(!((F=Object.getOwnPropertyDescriptor(x,b))!=null&&F.set))if(m instanceof Promise)m.then(P=>{m.status="fulfilled",m.value=P,p(["resolve",[b],P])}).catch(P=>{m.status="rejected",m.reason=P,p(["reject",[b],P])});else{!Ce.has(m)&&n(m)&&(B=eo(m));const P=!on.has(B)&&Ce.get(B);P&&k(b,P)}return Reflect.set(x,b,B,E),p(["set",[b],m,N]),!0}});r.set(c,D);const W=[M,f,o,T];return Ce.set(D,W),Reflect.ownKeys(c).forEach(x=>{const b=Object.getOwnPropertyDescriptor(c,x);b.get||b.set?Object.defineProperty(M,x,b):D[x]=c[x]}),D})=>[u,Ce,on,t,e,n,i,s,o,r,a],[yf]=bf();function eo(t={}){return yf(t)}function Fs(t,e,n){const i=Ce.get(t);let s;const o=[],r=i[3];let a=!1;const u=r(c=>{if(o.push(c),n){e(o.splice(0));return}s||(s=Promise.resolve().then(()=>{s=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,u()}}function Ke(t,e){const n=Ce.get(t),[i,s,o]=n;return o(i,s(),e)}function cr(t){return on.add(t),t}function xf(t,e){Object.keys(e).forEach(i=>{if(Object.getOwnPropertyDescriptor(t,i))throw new Error("object property already defined");const s=e[i],{get:o,set:r}=typeof s=="function"?{get:s}:s,a={};a.get=()=>o(Ke(n)),r&&(a.set=u=>r(n,u)),Object.defineProperty(t,i,a)});const n=eo(t);return n}var kf=(t,e)=>Object.is(t,e);function dr(t,e,n,i,s){let o=Reflect.get(Ke(t),e);const r=s||kf;function a(){const u=Ke(t);r(o,u[e])||(n(u[e]),o=Reflect.get(u,e))}return Fs(t,a,i)}var Ef=Object.defineProperty,wf=(t,e,n)=>e in t?Ef(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,S=(t,e,n)=>(wf(t,typeof e!="symbol"?e+"":e,n),n);function Cf(t){for(;t.length>0;)t.pop();return t}var hr=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,Yt=t=>t,os=()=>{},pr=(()=>{let t=0;return()=>(t++,t.toString(36))})(),vn=t=>Array.isArray(t),mn=t=>!(t==null||typeof t!="object"||vn(t)),_f=t=>typeof t=="number"&&!Number.isNaN(t),jt=t=>typeof t=="string",xi=t=>typeof t=="function";function ki(t){if(!Sf(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(i=>typeof i=="string"),n={};for(const i of e){const s=t[i];s!==void 0&&(n[i]=ki(s))}return n}var Sf=t=>t&&typeof t=="object"&&t.constructor===Object;function rs(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function Kn(...t){const e=t.length===1?t[0]:t[1];t.length!==2||t[0]}function Qa(t,...e){for(const n of e){const i=ki(n);for(const s in i)mn(n[s])?(t[s]||(t[s]={}),Qa(t[s],n[s])):t[s]=n[s]}return t}function fr(t){return _e(t)}function yt(t){return jt(t)?{type:t}:t}function se(t){return t?vn(t)?t.slice():[t]:[]}function tl(t){return mn(t)&&t.predicate!=null}var Af=()=>!0;function no(t,e,n,i){return s=>{var o;return jt(s)?!!((o=t[s])!=null&&o.call(t,e,n,i)):xi(s)?s(e,n,i):s.predicate(t)(e,n,i)}}function Tf(...t){return{predicate:e=>(n,i,s)=>t.map(no(e,n,i,s)).some(Boolean)}}function If(...t){return{predicate:e=>(n,i,s)=>t.map(no(e,n,i,s)).every(Boolean)}}function Df(t){return{predicate:e=>(n,i,s)=>!no(e,n,i,s)(t)}}function Ff(...t){return(e,n,i)=>i.state.matches(...t)}var Of={or:Tf,and:If,not:Df,stateIn:Ff};function el(t,e){return t=t??Af,(n,i,s)=>{if(jt(t)){const o=e[t];return xi(o)?o(n,i,s):o}return tl(t)?t.predicate(e)(n,i,s):t?.(n,i,s)}}function as(t,e){return(n,i,s)=>tl(t)?t.predicate(e)(n,i,s):t}function Mf(t){const e=t.computed??Yt({}),n=t.context??Yt({}),i=eo({value:t.initial??"",previousValue:"",event:Yt({}),previousEvent:Yt({}),context:xf(n,e),done:!1,tags:[],hasTag(s){return this.tags.includes(s)},matches(...s){return s.includes(this.value)},can(s){return Yt(this).nextEvents.includes(s)},get nextEvents(){var s,o;const r=((o=(s=t.states)==null?void 0:s[this.value])==null?void 0:o.on)??{},a=t?.on??{};return Object.keys({...r,...a})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return Yt(i)}function Nn(t,e){return(n,i)=>{if(_f(t))return t;if(xi(t))return t(n,i);if(jt(t)){const s=Number.parseFloat(t);if(!Number.isNaN(s))return s;if(e){const o=e?.[t];return Kn(o==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${t}\`. It doesn't exist in \`options.delays\``),xi(o)?o(n,i):o}}}}function Rf(t){return jt(t)?{target:t}:t}function Pf(t,e){return(n,i,s)=>se(t).map(Rf).find(o=>el(o.guard,e)(n,i,s)??o.target??o.actions)}var Lf=class nl{constructor(e,n){var i,s,o,r,a,u;S(this,"status","Not Started"),S(this,"state"),S(this,"initialState"),S(this,"initialContext"),S(this,"id"),S(this,"type","machine"),S(this,"activityEvents",new Map),S(this,"delayedEvents",new Map),S(this,"stateListeners",new Set),S(this,"contextListeners",new Set),S(this,"eventListeners",new Set),S(this,"doneListeners",new Set),S(this,"contextWatchers",new Set),S(this,"removeStateListener",os),S(this,"removeEventListener",os),S(this,"removeContextListener",os),S(this,"parent"),S(this,"children",new Map),S(this,"guardMap"),S(this,"actionMap"),S(this,"delayMap"),S(this,"activityMap"),S(this,"sync"),S(this,"options"),S(this,"config"),S(this,"start",l=>{if(this.state.value="",this.status==="Running")return this;this.status="Running",this.removeStateListener=Fs(this.state,()=>{this.stateListeners.forEach(y=>{y(this.stateSnapshot)})},this.sync),this.removeEventListener=dr(this.state,"event",y=>{this.executeActions(this.config.onEvent,y),this.eventListeners.forEach(v=>{v(y)})},this.sync),this.removeContextListener=Fs(this.state.context,()=>{this.log("Context:",this.contextSnapshot),this.contextListeners.forEach(y=>{y(this.contextSnapshot)})},this.sync||this.options.debug),this.setupContextWatchers(),this.executeActivities(yt("machine.start"),se(this.config.activities),"machine.start"),this.executeActions(this.config.entry,yt("machine.start"));const d=yt("machine.init"),h=mn(l)?l.value:l,p=mn(l)?l.context:void 0;p&&this.setContext(p);const g={target:h??this.config.initial},f=this.getNextStateInfo(g,d);return this.initialState=f,this.performStateChangeEffects(this.state.value,f,d),this}),S(this,"setupContextWatchers",()=>{var l;for(const[d,h]of Object.entries(this.config.watch??{})){const p=(l=this.options.compareFns)==null?void 0:l[d],g=dr(this.state.context,d,()=>{this.executeActions(h,this.state.event)},this.sync,p);this.contextWatchers.add(g)}}),S(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,yt("machine.stop")),this.executeActions(this.config.exit,yt("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.stopEventListeners(),this.stopContextListeners(),this.status="Stopped",this}),S(this,"stopEventListeners",()=>{this.eventListeners.clear(),this.removeEventListener()}),S(this,"stopContextListeners",()=>{this.contextListeners.clear(),this.removeContextListener()}),S(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),S(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(l=>l()),this.contextWatchers.clear()}),S(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(l=>{l.forEach(d=>d())}),this.delayedEvents.clear()}),S(this,"stopActivities",l=>{var d,h;l?((d=this.activityEvents.get(l))==null||d.forEach(p=>p()),(h=this.activityEvents.get(l))==null||h.clear(),this.activityEvents.delete(l)):(this.activityEvents.forEach(p=>{p.forEach(g=>g()),p.clear()}),this.activityEvents.clear())}),S(this,"sendChild",(l,d)=>{const h=yt(l),p=hr(d,this.contextSnapshot),g=this.children.get(p);g||Kn(`[@zag-js/core] Cannot send '${h.type}' event to unknown child`),g.send(h)}),S(this,"stopChild",l=>{this.children.has(l)||Kn(`[@zag-js/core > stop-child] Cannot stop unknown child ${l}`),this.children.get(l).stop(),this.children.delete(l)}),S(this,"removeChild",l=>{this.children.delete(l)}),S(this,"stopChildren",()=>{this.children.forEach(l=>l.stop()),this.children.clear()}),S(this,"setParent",l=>{this.parent=l}),S(this,"spawn",(l,d)=>{const h=hr(l);return d&&(h.id=d),h.type="machine.actor",h.setParent(this),this.children.set(h.id,Yt(h)),h.onDone(()=>{this.removeChild(h.id)}).start(),Yt(cr(h))}),S(this,"stopActivity",l=>{var d;if(!this.state.value)return;const h=this.activityEvents.get(this.state.value);(d=h?.get(l))==null||d(),h?.delete(l)}),S(this,"addActivityCleanup",(l,d,h)=>{var p;l&&(this.activityEvents.has(l)?(p=this.activityEvents.get(l))==null||p.set(d,h):this.activityEvents.set(l,new Map([[d,h]])))}),S(this,"setState",l=>{this.state.previousValue=this.state.value,this.state.value=l;const d=this.getStateNode(l);l==null?Cf(this.state.tags):this.state.tags=se(d?.tags)}),S(this,"transformContext",l=>{var d,h;return(h=(d=this.options)==null?void 0:d.transformContext)==null||h.call(d,l),l}),S(this,"setContext",l=>{l&&Qa(this.state.context,this.transformContext(l))}),S(this,"withContext",l=>{const d=this.transformContext(l),h={...this.config.context,...ki(d)};return new nl({...this.config,context:h},this.options)}),S(this,"setOptions",l=>{const d=ki(l);this.actionMap={...this.actionMap,...d.actions},this.delayMap={...this.delayMap,...d.delays},this.activityMap={...this.activityMap,...d.activities},this.guardMap={...this.guardMap,...d.guards}}),S(this,"getStateNode",l=>{var d;if(l)return(d=this.config.states)==null?void 0:d[l]}),S(this,"getNextStateInfo",(l,d)=>{const h=this.determineTransition(l,d),p=!(h!=null&&h.target),g=h?.target??this.state.value,f=this.state.value!==g,y=this.getStateNode(g),v={reenter:!p&&!f&&!(h!=null&&h.internal),transition:h,stateNode:y,target:g,changed:f};return this.log("NextState:",`[${d.type}]`,this.state.value,"---->",v.target),v}),S(this,"getActionFromDelayedTransition",l=>{const d=yt("machine.after"),h=Nn(l.delay,this.delayMap)(this.contextSnapshot,d);let p;return{entry:()=>{p=globalThis.setTimeout(()=>{const g=this.getNextStateInfo(l,d);this.performStateChangeEffects(this.state.value,g,d)},h)},exit:()=>{globalThis.clearTimeout(p)}}}),S(this,"getDelayedEventActions",l=>{const d=this.getStateNode(l),h=yt("machine.after");if(!d||!d.after)return;const p=[],g=[];if(vn(d.after)){const f=this.determineTransition(d.after,h);if(!f)return;const y=this.getActionFromDelayedTransition(f);p.push(y.entry),g.push(y.exit)}else if(mn(d.after))for(const f in d.after){const y=d.after[f];let v={};if(vn(y)){const w=this.determineTransition(y,h);w&&(v=w)}else jt(y)?v={target:y,delay:f}:v={...y,delay:f};const k=this.getActionFromDelayedTransition(v);p.push(k.entry),g.push(k.exit)}return{entries:p,exits:g}}),S(this,"executeActions",(l,d)=>{var h;const p=as(l,this.guardMap)(this.contextSnapshot,d,this.guardMeta);for(const g of se(p)){const f=jt(g)?(h=this.actionMap)==null?void 0:h[g]:g;rs(jt(g)&&!f,`[@zag-js/core > execute-actions] No implementation found for action: \`${g}\``),f?.(this.state.context,d,this.meta)}}),S(this,"executeActivities",(l,d,h)=>{var p;for(const g of d){const f=jt(g)?(p=this.activityMap)==null?void 0:p[g]:g;if(!f){rs(`[@zag-js/core > execute-activity] No implementation found for activity: \`${g}\``);continue}const y=f(this.state.context,l,this.meta);if(y){const v=jt(g)?g:g.name||pr();this.addActivityCleanup(h??this.state.value,v,y)}}}),S(this,"createEveryActivities",(l,d)=>{if(!l)return;const h=yt("machine.every");if(vn(l)){const p=se(l).find(f=>{const y=f.delay,v=Nn(y,this.delayMap)(this.contextSnapshot,h);return el(f.guard,this.guardMap)(this.contextSnapshot,h,this.guardMeta)??v!=null});if(!p)return;const g=Nn(p.delay,this.delayMap)(this.contextSnapshot,h);d(()=>{const f=globalThis.setInterval(()=>{this.executeActions(p.actions,h)},g);return()=>{globalThis.clearInterval(f)}})}else for(const p in l){const g=l?.[p],f=Nn(p,this.delayMap)(this.contextSnapshot,h);d(()=>{const y=globalThis.setInterval(()=>{this.executeActions(g,h)},f);return()=>{globalThis.clearInterval(y)}})}}),S(this,"setEvent",l=>{this.state.previousEvent=this.state.event,this.state.event=cr(yt(l))}),S(this,"performExitEffects",(l,d)=>{const h=this.state.value;if(h==="")return;const p=l?this.getStateNode(l):void 0;this.stopActivities(h);const g=as(p?.exit,this.guardMap)(this.contextSnapshot,d,this.guardMeta),f=se(g),y=this.delayedEvents.get(h);y&&f.push(...y),this.executeActions(f,d),this.eventListeners.clear()}),S(this,"performEntryEffects",(l,d)=>{const h=this.getStateNode(l),p=se(h?.activities);this.createEveryActivities(h?.every,v=>{p.unshift(v)}),p.length>0&&this.executeActivities(d,p);const g=as(h?.entry,this.guardMap)(this.contextSnapshot,d,this.guardMeta),f=se(g),y=this.getDelayedEventActions(l);h!=null&&h.after&&y&&(this.delayedEvents.set(l,y?.exits),f.push(...y.entries)),this.executeActions(f,d),h?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(v=>{v(this.stateSnapshot)}),this.stop())}),S(this,"performTransitionEffects",(l,d)=>{const h=this.determineTransition(l,d);this.executeActions(h?.actions,d)}),S(this,"performStateChangeEffects",(l,d,h)=>{this.setEvent(h);const p=d.changed||d.reenter;p&&this.performExitEffects(l,h),this.performTransitionEffects(d.transition,h),this.setState(d.target),p&&this.performEntryEffects(d.target,h)}),S(this,"determineTransition",(l,d)=>{const h=Pf(l,this.guardMap);return h?.(this.contextSnapshot,d,this.guardMeta)}),S(this,"sendParent",l=>{var d;this.parent||Kn("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const h=yt(l);(d=this.parent)==null||d.send(h)}),S(this,"log",(...l)=>{}),S(this,"send",l=>{const d=yt(l);this.transition(this.state.value,d)}),S(this,"transition",(l,d)=>{var h,p;const g=jt(l)?this.getStateNode(l):l?.stateNode,f=yt(d);if(!g&&!this.config.on){const k=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${l}, \`event\`: ${f.type}`;rs(k);return}const y=((h=g?.on)==null?void 0:h[f.type])??((p=this.config.on)==null?void 0:p[f.type]),v=this.getNextStateInfo(y,f);return this.performStateChangeEffects(this.state.value,v,f),v.stateNode}),S(this,"subscribe",l=>(this.stateListeners.add(l),this.status==="Running"&&l(this.stateSnapshot),()=>{this.stateListeners.delete(l)})),S(this,"onDone",l=>(this.doneListeners.add(l),this)),S(this,"onTransition",l=>(this.stateListeners.add(l),this.status==="Running"&&l(this.stateSnapshot),this)),S(this,"onChange",l=>(this.contextListeners.add(l),this)),S(this,"onEvent",l=>(this.eventListeners.add(l),this)),this.config=fr(e),this.options=fr(n??{}),this.id=this.config.id??`machine-${pr()}`,this.guardMap=((i=this.options)==null?void 0:i.guards)??{},this.actionMap=((s=this.options)==null?void 0:s.actions)??{},this.delayMap=((o=this.options)==null?void 0:o.delays)??{},this.activityMap=((r=this.options)==null?void 0:r.activities)??{},this.sync=((a=this.options)==null?void 0:a.sync)??!1,this.state=Mf(this.config),this.initialContext=Ke(this.state.context),this.transformContext(this.state.context);const c=yt("machine.created");this.executeActions((u=this.config)==null?void 0:u.created,c)}get stateSnapshot(){return Yt(Ke(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){var n;return((n=e.initialState)==null?void 0:n.target)??""}}}get meta(){var e;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((e=this.initialState)==null?void 0:e.target)??"",getState:()=>this.stateSnapshot,getAction:n=>this.actionMap[n],getGuard:n=>this.guardMap[n]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}},Bf=(t,e)=>new Lf(t,e);function Nf(t,e,n){if(!t)return;const i=t.ownerDocument.defaultView||window,s=new i.MutationObserver(o=>{for(const r of o)r.type==="attributes"&&r.attributeName&&e.includes(r.attributeName)&&n(r)});return s.observe(t,{attributes:!0,attributeFilter:e}),()=>s.disconnect()}var il=t=>t.ownerDocument.defaultView||window;function jf(t,e){const{type:n="HTMLInputElement",property:i="value"}=e,s=il(t)[n].prototype;return Object.getOwnPropertyDescriptor(s,i)??{}}function Vf(t,e){var n;(n=jf(t,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(t,e)}function $f(t,e){const{checked:n,bubbles:i=!0}=e;if(!t)return;const s=il(t);t instanceof s.HTMLInputElement&&(Vf(t,n),t.dispatchEvent(new s.Event("click",{bubbles:i})),t.dispatchEvent(new s.Event("change",{bubbles:i})))}function zf(t){return Hf(t)?t.form:t.closest("form")}function Hf(t){return t.matches("textarea, input, select, button")}function Gf(t,e){if(!t)return;const n=zf(t);return n?.addEventListener("reset",e,{passive:!0}),()=>{n?.removeEventListener("reset",e)}}function qf(t,e){const n=t?.closest("fieldset");if(n)return e(n.disabled),Nf(n,["disabled"],()=>e(n.disabled))}function Uf(t,e){if(!t)return;const{onFieldsetDisabledChange:n,onFormReset:i}=e,s=[Gf(t,i),qf(t,n)];return()=>{s.forEach(o=>o?.())}}var gr=t=>t?.constructor.name==="Array",sl=(t,e)=>{if(Object.is(t,e))return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(typeof t?.isEqual=="function"&&typeof e?.isEqual=="function")return t.isEqual(e);if(typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();if(gr(t)&&gr(e))return Array.from(t).toString()===Array.from(e).toString();if(typeof t!="object"||typeof e!="object")return!1;const n=Object.keys(e??Object.create(null)),i=n.length;for(let s=0;s<i;s++)if(!Reflect.has(t,n[s]))return!1;for(let s=0;s<i;s++){const o=n[s];if(!sl(t[o],e[o]))return!1}return!0};function ol(t){if(!Wf(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(i=>typeof i=="string"),n={};for(const i of e){const s=t[i];s!==void 0&&(n[i]=ol(s))}return n}var Wf=t=>t&&typeof t=="object"&&t.constructor===Object,Xf=Yn("switch").parts("root","label","control","thumb"),jn=Xf.build(),_t=vf({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`switch:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`switch:${t.id}:label`},getThumbId:t=>{var e;return((e=t.ids)==null?void 0:e.thumb)??`switch:${t.id}:thumb`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`switch:${t.id}:control`},getHiddenInputId:t=>{var e;return((e=t.ids)==null?void 0:e.input)??`switch:${t.id}:input`},getHiddenInputEl:t=>_t.getById(t,_t.getHiddenInputId(t))});function Yf(t,e,n){const i=t.context.isDisabled,s=!i&&t.context.focused,o=t.context.checked,r={"data-active":Qe(t.context.active),"data-focus":Qe(s),"data-hover":Qe(t.context.hovered),"data-disabled":Qe(i),"data-state":t.context.checked?"checked":"unchecked","data-invalid":Qe(t.context.invalid)};return{isChecked:o,isDisabled:i,isFocused:s,setChecked(a){e({type:"CHECKED.SET",checked:a,isTrusted:!1})},toggleChecked(){e({type:"CHECKED.TOGGLE",checked:o,isTrusted:!1})},rootProps:n.label({...jn.root.attrs,...r,dir:t.context.dir,id:_t.getRootId(t.context),htmlFor:_t.getHiddenInputId(t.context),onPointerMove(){i||e({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){i||e({type:"CONTEXT.SET",context:{hovered:!1}})},onPointerDown(a){i||(s&&a.preventDefault(),e({type:"CONTEXT.SET",context:{active:!0}}))},onPointerUp(){i||e({type:"CONTEXT.SET",context:{active:!1}})},onClick(a){a.target===_t.getHiddenInputEl(t.context)&&a.stopPropagation()}}),labelProps:n.element({...jn.label.attrs,...r,dir:t.context.dir,id:_t.getLabelId(t.context)}),thumbProps:n.element({...jn.thumb.attrs,...r,dir:t.context.dir,id:_t.getThumbId(t.context),"aria-hidden":!0}),controlProps:n.element({...jn.control.attrs,...r,dir:t.context.dir,id:_t.getControlId(t.context),"aria-hidden":!0}),hiddenInputProps:n.input({id:_t.getHiddenInputId(t.context),type:"checkbox",required:t.context.required,defaultChecked:o,disabled:i,"aria-labelledby":_t.getLabelId(t.context),"aria-invalid":t.context.invalid,name:t.context.name,form:t.context.form,value:t.context.value,style:mf,onChange(a){const u=a.currentTarget.checked;e({type:"CHECKED.SET",checked:u,isTrusted:!0})},onBlur(){e({type:"CONTEXT.SET",context:{focused:!1}})},onFocus(){e({type:"CONTEXT.SET",context:{focused:!0}})},onKeyDown(a){a.key===" "&&e({type:"CONTEXT.SET",context:{active:!0}})},onKeyUp(a){a.key===" "&&e({type:"CONTEXT.SET",context:{active:!1}})}})}}var{not:vr}=Of;function Kf(t){const e=ol(t);return Bf({id:"switch",initial:"ready",context:{checked:!1,label:"switch",value:"on",disabled:!1,...e,fieldsetDisabled:!1},computed:{isDisabled:n=>n.disabled||n.fieldsetDisabled},watch:{disabled:"removeFocusIfNeeded",checked:"syncInputElement"},activities:["trackFormControlState"],on:{"CHECKED.TOGGLE":[{guard:vr("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:vr("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},states:{ready:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackFormControlState(n,i,{send:s,initialContext:o}){return Uf(_t.getHiddenInputEl(n),{onFieldsetDisabledChange(r){n.fieldsetDisabled=r},onFormReset(){s({type:"CHECKED.SET",checked:!!o.checked,src:"form-reset"})}})}},actions:{setContext(n,i){Object.assign(n,i.context)},syncInputElement(n){const i=_t.getHiddenInputEl(n);i&&(i.checked=!!n.checked)},removeFocusIfNeeded(n){n.disabled&&n.focused&&(n.focused=!1)},setChecked(n,i){mr.checked(n,i.checked)},toggleChecked(n,i){mr.checked(n,!n.checked)},dispatchChangeEvent(n){const i=_t.getHiddenInputEl(n);$f(i,{checked:n.checked})}}})}var Zf={change:t=>{var e;(e=t.onCheckedChange)==null||e.call(t,{checked:t.checked})}},mr={checked:(t,e)=>{sl(t.checked,e)||(t.checked=e,Zf.change(t))}};const Jf={key:0,class:"k-switch__label"},lg=tt({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},labels:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i={id:Ie(),checked:n.modelValue,disabled:n.disabled,onCheckedChange:({checked:a})=>e("update:modelValue",a)},[s,o]=Ti(Kf(i),{}),r=H(()=>Yf(s.value,o,Ai));return At(()=>n.modelValue,()=>{if(r.value.isChecked!==n.modelValue)return r.value.setChecked(n.modelValue)}),(a,u)=>(_(),O("label",ot({class:"k-switch"},r.value.rootProps),[ut("input",kt(Rt(r.value.hiddenInputProps)),null,16),ut("span",kt(Rt(r.value.controlProps)),[ut("span",kt(Rt(r.value.thumbProps)),null,16)],16),ut("span",kt(Rt(r.value.labelProps)),[a.labels?(_(),O("span",Jf,ct(r.value.isChecked?a.labels.on:a.labels.off),1)):q("",!0)],16)],16))}}),ug=tt({__name:"LazyLoad",props:{wrapperTag:{default:"div"},threshold:{default:0},observerRoot:{default:null}},emits:["intersect"],setup(t,{emit:e}){const n=t,i=J(!1);function s(u){const c=u[0];c.isIntersecting&&(i.value=!0,bl(()=>{e("intersect",c),a()}))}const o=J(),r=J();ge(()=>{o.value=new IntersectionObserver(s,{root:n.observerRoot,threshold:n.threshold}),o.value.observe(r.value)}),Ei(()=>{a()});function a(){o.value&&o.value.disconnect()}return(u,c)=>(_(),it(de(u.wrapperTag),{ref_key:"rootRef",ref:r,class:"k-lazyload"},{default:rt(()=>[i.value?z(u.$slots,"default",{key:0}):z(u.$slots,"placeholder",{key:1})]),_:3},512))}});export{ze as C,rg as E,Po as G,he as I,Dp as L,ug as T,Dh as V,ag as _,ng as h,og as k,tg as l,eg as s,ig as v,lg as x,sg as y};
14
+ */function tr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,i)}return n}function Wt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tr(Object(n),!0).forEach(function(i){Bp(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Gn(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Gn=function(e){return typeof e}:Gn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gn(t)}function Bp(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qt(){return Qt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Qt.apply(this,arguments)}function Np(t,e){if(t==null)return{};var n={},i=Object.keys(t),s,o;for(o=0;o<i.length;o++)s=i[o],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function jp(t,e){if(t==null)return{};var n=Np(t,e),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(s=0;s<o.length;s++)i=o[s],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}var Vp="1.14.0";function Zt(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var ee=Zt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),_n=Zt(/Edge/i),er=Zt(/firefox/i),dn=Zt(/safari/i)&&!Zt(/chrome/i)&&!Zt(/android/i),$a=Zt(/iP(ad|od|hone)/i),$p=Zt(/chrome/i)&&Zt(/android/i),za={capture:!1,passive:!1};function Y(t,e,n){t.addEventListener(e,n,!ee&&za)}function U(t,e,n){t.removeEventListener(e,n,!ee&&za)}function gi(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function zp(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function $t(t,e,n,i){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&gi(t,e):gi(t,e))||i&&t===n)return t;if(t===n)break}while(t=zp(t))}return null}var nr=/\s+/g;function wt(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(nr," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(nr," ")}}function R(t,e,n){var i=t&&t.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in i)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),i[e]=n+(typeof n=="string"?"":"px")}}function qe(t,e){var n="";if(typeof t=="string")n=t;else do{var i=R(t,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!e&&(t=t.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function Ha(t,e,n){if(t){var i=t.getElementsByTagName(e),s=0,o=i.length;if(n)for(;s<o;s++)n(i[s],s);return i}return[]}function Gt(){var t=document.scrollingElement;return t||document.documentElement}function at(t,e,n,i,s){if(!(!t.getBoundingClientRect&&t!==window)){var o,r,a,u,c,l,d;if(t!==window&&t.parentNode&&t!==Gt()?(o=t.getBoundingClientRect(),r=o.top,a=o.left,u=o.bottom,c=o.right,l=o.height,d=o.width):(r=0,a=0,u=window.innerHeight,c=window.innerWidth,l=window.innerHeight,d=window.innerWidth),(e||n)&&t!==window&&(s=s||t.parentNode,!ee))do if(s&&s.getBoundingClientRect&&(R(s,"transform")!=="none"||n&&R(s,"position")!=="static")){var h=s.getBoundingClientRect();r-=h.top+parseInt(R(s,"border-top-width")),a-=h.left+parseInt(R(s,"border-left-width")),u=r+o.height,c=a+o.width;break}while(s=s.parentNode);if(i&&t!==window){var p=qe(s||t),g=p&&p.a,f=p&&p.d;p&&(r/=f,a/=g,d/=g,l/=f,u=r+l,c=a+d)}return{top:r,left:a,bottom:u,right:c,width:d,height:l}}}function ir(t,e,n){for(var i=ae(t,!0),s=at(t)[e];i;){var o=at(i)[n],r=void 0;if(n==="top"||n==="left"?r=s>=o:r=s<=o,!r)return i;if(i===Gt())break;i=ae(i,!1)}return!1}function Ye(t,e,n,i){for(var s=0,o=0,r=t.children;o<r.length;){if(r[o].style.display!=="none"&&r[o]!==L.ghost&&(i||r[o]!==L.dragged)&&$t(r[o],n.draggable,t,!1)){if(s===e)return r[o];s++}o++}return null}function Js(t,e){for(var n=t.lastElementChild;n&&(n===L.ghost||R(n,"display")==="none"||e&&!gi(n,e));)n=n.previousElementSibling;return n||null}function Ot(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==L.clone&&(!e||gi(t,e))&&n++;return n}function sr(t){var e=0,n=0,i=Gt();if(t)do{var s=qe(t),o=s.a,r=s.d;e+=t.scrollLeft*o,n+=t.scrollTop*r}while(t!==i&&(t=t.parentNode));return[e,n]}function Hp(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var i in e)if(e.hasOwnProperty(i)&&e[i]===t[n][i])return Number(n)}return-1}function ae(t,e){if(!t||!t.getBoundingClientRect)return Gt();var n=t,i=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=R(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Gt();if(i||e)return n;i=!0}}while(n=n.parentNode);return Gt()}function Gp(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Yi(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var hn;function Ga(t,e){return function(){if(!hn){var n=arguments,i=this;n.length===1?t.call(i,n[0]):t.apply(i,n),hn=setTimeout(function(){hn=void 0},e)}}}function qp(){clearTimeout(hn),hn=void 0}function qa(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Ua(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}var St="Sortable"+new Date().getTime();function Up(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(i){if(!(R(i,"display")==="none"||i===L.ghost)){t.push({target:i,rect:at(i)});var s=Wt({},t[t.length-1].rect);if(i.thisAnimationDuration){var o=qe(i,!0);o&&(s.top-=o.f,s.left-=o.e)}i.fromRect=s}})}},addAnimationState:function(n){t.push(n)},removeAnimationState:function(n){t.splice(Hp(t,{target:n}),1)},animateAll:function(n){var i=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var s=!1,o=0;t.forEach(function(r){var a=0,u=r.target,c=u.fromRect,l=at(u),d=u.prevFromRect,h=u.prevToRect,p=r.rect,g=qe(u,!0);g&&(l.top-=g.f,l.left-=g.e),u.toRect=l,u.thisAnimationDuration&&Yi(d,l)&&!Yi(c,l)&&(p.top-l.top)/(p.left-l.left)===(c.top-l.top)/(c.left-l.left)&&(a=Xp(p,d,h,i.options)),Yi(l,c)||(u.prevFromRect=c,u.prevToRect=l,a||(a=i.options.animation),i.animate(u,p,l,a)),a&&(s=!0,o=Math.max(o,a),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},a),u.thisAnimationDuration=a)}),clearTimeout(e),s?e=setTimeout(function(){typeof n=="function"&&n()},o):typeof n=="function"&&n(),t=[]},animate:function(n,i,s,o){if(o){R(n,"transition",""),R(n,"transform","");var r=qe(this.el),a=r&&r.a,u=r&&r.d,c=(i.left-s.left)/(a||1),l=(i.top-s.top)/(u||1);n.animatingX=!!c,n.animatingY=!!l,R(n,"transform","translate3d("+c+"px,"+l+"px,0)"),this.forRepaintDummy=Wp(n),R(n,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),R(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){R(n,"transition",""),R(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},o)}}}}function Wp(t){return t.offsetWidth}function Xp(t,e,n,i){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*i.animation}var Be=[],Ki={initializeByDefault:!0},Sn={mount:function(t){for(var e in Ki)Ki.hasOwnProperty(e)&&!(e in t)&&(t[e]=Ki[e]);Be.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Be.push(t)},pluginEvent:function(t,e,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var s=t+"Global";Be.forEach(function(o){e[o.pluginName]&&(e[o.pluginName][s]&&e[o.pluginName][s](Wt({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](Wt({sortable:e},n)))})},initializePlugins:function(t,e,n,i){Be.forEach(function(r){var a=r.pluginName;if(!(!t.options[a]&&!r.initializeByDefault)){var u=new r(t,e,t.options);u.sortable=t,u.options=t.options,t[a]=u,Qt(n,u.defaults)}});for(var s in t.options)if(t.options.hasOwnProperty(s)){var o=this.modifyOption(t,s,t.options[s]);typeof o<"u"&&(t.options[s]=o)}},getEventProperties:function(t,e){var n={};return Be.forEach(function(i){typeof i.eventProperties=="function"&&Qt(n,i.eventProperties.call(e[i.pluginName],t))}),n},modifyOption:function(t,e,n){var i;return Be.forEach(function(s){t[s.pluginName]&&s.optionListeners&&typeof s.optionListeners[e]=="function"&&(i=s.optionListeners[e].call(t[s.pluginName],n))}),i}};function Yp(t){var e=t.sortable,n=t.rootEl,i=t.name,s=t.targetEl,o=t.cloneEl,r=t.toEl,a=t.fromEl,u=t.oldIndex,c=t.newIndex,l=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[St],!!e){var f,y=e.options,v="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!ee&&!_n?f=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent(i,!0,!0)),f.to=r||n,f.from=a||n,f.item=s||n,f.clone=o,f.oldIndex=u,f.newIndex=c,f.oldDraggableIndex=l,f.newDraggableIndex=d,f.originalEvent=h,f.pullMode=p?p.lastPutMode:void 0;var k=Wt(Wt({},g),Sn.getEventProperties(i,e));for(var w in k)f[w]=k[w];n&&n.dispatchEvent(f),y[v]&&y[v].call(e,f)}}var Kp=["evt"],bt=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,s=jp(n,Kp);Sn.pluginEvent.bind(L)(t,e,Wt({dragEl:C,parentEl:et,ghostEl:j,rootEl:Q,nextEl:ke,lastDownEl:qn,cloneEl:nt,cloneHidden:re,dragStarted:en,putSortable:dt,activeSortable:L.active,originalEvent:i,oldIndex:$e,oldDraggableIndex:pn,newIndex:Ct,newDraggableIndex:oe,hideGhostForTarget:Ka,unhideGhostForTarget:Za,cloneNowHidden:function(){re=!0},cloneNowShown:function(){re=!1},dispatchSortableEvent:function(o){pt({sortable:e,name:o,originalEvent:i})}},s))};function pt(t){Yp(Wt({putSortable:dt,cloneEl:nt,targetEl:C,rootEl:Q,oldIndex:$e,oldDraggableIndex:pn,newIndex:Ct,newDraggableIndex:oe},t))}var C,et,j,Q,ke,qn,nt,re,$e,Ct,pn,oe,Rn,dt,Ve=!1,vi=!1,mi=[],be,Bt,Zi,Ji,or,rr,en,Ne,fn,gn=!1,Pn=!1,Un,ht,Qi=[],As=!1,bi=[],Mi=typeof document<"u",Ln=$a,ar=_n||ee?"cssFloat":"float",Zp=Mi&&!$p&&!$a&&"draggable"in document.createElement("div"),Wa=function(){if(Mi){if(ee)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Xa=function(t,e){var n=R(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),s=Ye(t,0,e),o=Ye(t,1,e),r=s&&R(s),a=o&&R(o),u=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+at(s).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+at(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&r.float&&r.float!=="none"){var l=r.float==="left"?"left":"right";return o&&(a.clear==="both"||a.clear===l)?"vertical":"horizontal"}return s&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||u>=i&&n[ar]==="none"||o&&n[ar]==="none"&&u+c>i)?"vertical":"horizontal"},Jp=function(t,e,n){var i=n?t.left:t.top,s=n?t.right:t.bottom,o=n?t.width:t.height,r=n?e.left:e.top,a=n?e.right:e.bottom,u=n?e.width:e.height;return i===r||s===a||i+o/2===r+u/2},Qp=function(t,e){var n;return mi.some(function(i){var s=i[St].options.emptyInsertThreshold;if(!(!s||Js(i))){var o=at(i),r=t>=o.left-s&&t<=o.right+s,a=e>=o.top-s&&e<=o.bottom+s;if(r&&a)return n=i}}),n},Ya=function(t){function e(s,o){return function(r,a,u,c){var l=r.options.group.name&&a.options.group.name&&r.options.group.name===a.options.group.name;if(s==null&&(o||l))return!0;if(s==null||s===!1)return!1;if(o&&s==="clone")return s;if(typeof s=="function")return e(s(r,a,u,c),o)(r,a,u,c);var d=(o?r:a).options.group.name;return s===!0||typeof s=="string"&&s===d||s.join&&s.indexOf(d)>-1}}var n={},i=t.group;(!i||Gn(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=e(i.pull,!0),n.checkPut=e(i.put),n.revertClone=i.revertClone,t.group=n},Ka=function(){!Wa&&j&&R(j,"display","none")},Za=function(){!Wa&&j&&R(j,"display","")};Mi&&document.addEventListener("click",function(t){if(vi)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),vi=!1,!1},!0);var ye=function(t){if(C){t=t.touches?t.touches[0]:t;var e=Qp(t.clientX,t.clientY);if(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[St]._onDragOver(n)}}},tf=function(t){C&&C.parentNode[St]._isOutsideThisEl(t.target)};function L(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Qt({},e),t[St]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xa(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:L.supportPointer!==!1&&"PointerEvent"in window&&!dn,emptyInsertThreshold:5};Sn.initializePlugins(this,t,n);for(var i in n)!(i in e)&&(e[i]=n[i]);Ya(e);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=e.forceFallback?!1:Zp,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Y(t,"pointerdown",this._onTapStart):(Y(t,"mousedown",this._onTapStart),Y(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Y(t,"dragover",this),Y(t,"dragenter",this)),mi.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Qt(this,Up())}L.prototype={constructor:L,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Ne=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,C):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,s=i.preventOnFilter,o=t.type,r=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,a=(r||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=i.filter;if(uf(n),!C&&!(/mousedown|pointerdown/.test(o)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&dn&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=$t(a,i.draggable,n,!1),!(a&&a.animated)&&qn!==a)){if($e=Ot(a),pn=Ot(a,i.draggable),typeof c=="function"){if(c.call(this,t,a,this)){pt({sortable:e,rootEl:u,name:"filter",targetEl:a,toEl:n,fromEl:n}),bt("filter",e,{evt:t}),s&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(l){if(l=$t(u,l.trim(),n,!1),l)return pt({sortable:e,rootEl:l,name:"filter",targetEl:a,fromEl:n,toEl:n}),bt("filter",e,{evt:t}),!0}),c)){s&&t.cancelable&&t.preventDefault();return}i.handle&&!$t(u,i.handle,n,!1)||this._prepareDragStart(t,r,a)}}},_prepareDragStart:function(t,e,n){var i=this,s=i.el,o=i.options,r=s.ownerDocument,a;if(n&&!C&&n.parentNode===s){var u=at(n);if(Q=s,C=n,et=C.parentNode,ke=C.nextSibling,qn=n,Rn=o.group,L.dragged=C,be={target:C,clientX:(e||t).clientX,clientY:(e||t).clientY},or=be.clientX-u.left,rr=be.clientY-u.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,C.style["will-change"]="all",a=function(){if(bt("delayEnded",i,{evt:t}),L.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!er&&i.nativeDraggable&&(C.draggable=!0),i._triggerDragStart(t,e),pt({sortable:i,name:"choose",originalEvent:t}),wt(C,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){Ha(C,c.trim(),ts)}),Y(r,"dragover",ye),Y(r,"mousemove",ye),Y(r,"touchmove",ye),Y(r,"mouseup",i._onDrop),Y(r,"touchend",i._onDrop),Y(r,"touchcancel",i._onDrop),er&&this.nativeDraggable&&(this.options.touchStartThreshold=4,C.draggable=!0),bt("delayStart",this,{evt:t}),o.delay&&(!o.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(_n||ee))){if(L.eventCanceled){this._onDrop();return}Y(r,"mouseup",i._disableDelayedDrag),Y(r,"touchend",i._disableDelayedDrag),Y(r,"touchcancel",i._disableDelayedDrag),Y(r,"mousemove",i._delayedDragTouchMoveHandler),Y(r,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&Y(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(a,o.delay)}else a()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){C&&ts(C),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;U(t,"mouseup",this._disableDelayedDrag),U(t,"touchend",this._disableDelayedDrag),U(t,"touchcancel",this._disableDelayedDrag),U(t,"mousemove",this._delayedDragTouchMoveHandler),U(t,"touchmove",this._delayedDragTouchMoveHandler),U(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?Y(document,"pointermove",this._onTouchMove):e?Y(document,"touchmove",this._onTouchMove):Y(document,"mousemove",this._onTouchMove):(Y(C,"dragend",this),Y(Q,"dragstart",this._onDragStart));try{document.selection?Wn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Ve=!1,Q&&C){bt("dragStarted",this,{evt:e}),this.nativeDraggable&&Y(document,"dragover",tf);var n=this.options;!t&&wt(C,n.dragClass,!1),wt(C,n.ghostClass,!0),L.active=this,t&&this._appendGhost(),pt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Bt){this._lastX=Bt.clientX,this._lastY=Bt.clientY,Ka();for(var t=document.elementFromPoint(Bt.clientX,Bt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Bt.clientX,Bt.clientY),t!==e);)e=t;if(C.parentNode[St]._isOutsideThisEl(t),e)do{if(e[St]){var n=void 0;if(n=e[St]._onDragOver({clientX:Bt.clientX,clientY:Bt.clientY,target:t,rootEl:e}),n&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Za()}},_onTouchMove:function(t){if(be){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,s=t.touches?t.touches[0]:t,o=j&&qe(j,!0),r=j&&o&&o.a,a=j&&o&&o.d,u=Ln&&ht&&sr(ht),c=(s.clientX-be.clientX+i.x)/(r||1)+(u?u[0]-Qi[0]:0)/(r||1),l=(s.clientY-be.clientY+i.y)/(a||1)+(u?u[1]-Qi[1]:0)/(a||1);if(!L.active&&!Ve){if(n&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(j){o?(o.e+=c-(Zi||0),o.f+=l-(Ji||0)):o={a:1,b:0,c:0,d:1,e:c,f:l};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");R(j,"webkitTransform",d),R(j,"mozTransform",d),R(j,"msTransform",d),R(j,"transform",d),Zi=c,Ji=l,Bt=s}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!j){var t=this.options.fallbackOnBody?document.body:Q,e=at(C,!0,Ln,!0,t),n=this.options;if(Ln){for(ht=t;R(ht,"position")==="static"&&R(ht,"transform")==="none"&&ht!==document;)ht=ht.parentNode;ht!==document.body&&ht!==document.documentElement?(ht===document&&(ht=Gt()),e.top+=ht.scrollTop,e.left+=ht.scrollLeft):ht=Gt(),Qi=sr(ht)}j=C.cloneNode(!0),wt(j,n.ghostClass,!1),wt(j,n.fallbackClass,!0),wt(j,n.dragClass,!0),R(j,"transition",""),R(j,"transform",""),R(j,"box-sizing","border-box"),R(j,"margin",0),R(j,"top",e.top),R(j,"left",e.left),R(j,"width",e.width),R(j,"height",e.height),R(j,"opacity","0.8"),R(j,"position",Ln?"absolute":"fixed"),R(j,"zIndex","100000"),R(j,"pointerEvents","none"),L.ghost=j,t.appendChild(j),R(j,"transform-origin",or/parseInt(j.style.width)*100+"% "+rr/parseInt(j.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,i=t.dataTransfer,s=n.options;if(bt("dragStart",this,{evt:t}),L.eventCanceled){this._onDrop();return}bt("setupClone",this),L.eventCanceled||(nt=Ua(C),nt.draggable=!1,nt.style["will-change"]="",this._hideClone(),wt(nt,this.options.chosenClass,!1),L.clone=nt),n.cloneId=Wn(function(){bt("clone",n),!L.eventCanceled&&(n.options.removeCloneOnHide||Q.insertBefore(nt,C),n._hideClone(),pt({sortable:n,name:"clone"}))}),!e&&wt(C,s.dragClass,!0),e?(vi=!0,n._loopId=setInterval(n._emulateDragOver,50)):(U(document,"mouseup",n._onDrop),U(document,"touchend",n._onDrop),U(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",s.setData&&s.setData.call(n,i,C)),Y(document,"drop",n),R(C,"transform","translateZ(0)")),Ve=!0,n._dragStartId=Wn(n._dragStarted.bind(n,e,t)),Y(document,"selectstart",n),en=!0,dn&&R(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,n=t.target,i,s,o,r=this.options,a=r.group,u=L.active,c=Rn===a,l=r.sort,d=dt||u,h,p=this,g=!1;if(As)return;function f(X,Vt){bt(X,p,Wt({evt:t,isOwner:c,axis:h?"vertical":"horizontal",revert:o,dragRect:i,targetRect:s,canSort:l,fromSortable:d,target:n,completed:v,onMove:function(ne,Lt){return Bn(Q,e,C,i,ne,at(ne),t,Lt)},changed:k},Vt))}function y(){f("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function v(X){return f("dragOverCompleted",{insertion:X}),X&&(c?u._hideClone():u._showClone(p),p!==d&&(wt(C,dt?dt.options.ghostClass:u.options.ghostClass,!1),wt(C,r.ghostClass,!0)),dt!==p&&p!==L.active?dt=p:p===L.active&&dt&&(dt=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){f("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===C&&!C.animated||n===e&&!n.animated)&&(Ne=null),!r.dragoverBubble&&!t.rootEl&&n!==document&&(C.parentNode[St]._isOutsideThisEl(t.target),!X&&ye(t)),!r.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function k(){Ct=Ot(C),oe=Ot(C,r.draggable),pt({sortable:p,name:"change",toEl:e,newIndex:Ct,newDraggableIndex:oe,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=$t(n,r.draggable,e,!0),f("dragOver"),L.eventCanceled)return g;if(C.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return v(!1);if(vi=!1,u&&!r.disabled&&(c?l||(o=et!==Q):dt===this||(this.lastPutMode=Rn.checkPull(this,u,C,t))&&a.checkPut(this,u,C,t))){if(h=this._getDirection(t,n)==="vertical",i=at(C),f("dragOverValid"),L.eventCanceled)return g;if(o)return et=Q,y(),this._hideClone(),f("revert"),L.eventCanceled||(ke?Q.insertBefore(C,ke):Q.appendChild(C)),v(!0);var w=Js(e,r.draggable);if(!w||of(t,h,this)&&!w.animated){if(w===C)return v(!1);if(w&&e===t.target&&(n=w),n&&(s=at(n)),Bn(Q,e,C,i,n,s,t,!!n)!==!1)return y(),e.appendChild(C),et=e,k(),v(!0)}else if(w&&sf(t,h,this)){var T=Ye(e,0,r,!0);if(T===C)return v(!1);if(n=T,s=at(n),Bn(Q,e,C,i,n,s,t,!1)!==!1)return y(),e.insertBefore(C,T),et=e,k(),v(!0)}else if(n.parentNode===e){s=at(n);var M=0,D,W=C.parentNode!==e,x=!Jp(C.animated&&C.toRect||i,n.animated&&n.toRect||s,h),b=h?"top":"left",m=ir(n,"top","top")||ir(C,"top","top"),E=m?m.scrollTop:void 0;Ne!==n&&(D=s[b],gn=!1,Pn=!x&&r.invertSwap||W),M=rf(t,n,s,h,x?1:r.swapThreshold,r.invertedSwapThreshold==null?r.swapThreshold:r.invertedSwapThreshold,Pn,Ne===n);var F;if(M!==0){var $=Ot(C);do $-=M,F=et.children[$];while(F&&(R(F,"display")==="none"||F===j))}if(M===0||F===n)return v(!1);Ne=n,fn=M;var N=n.nextElementSibling,B=!1;B=M===1;var P=Bn(Q,e,C,i,n,s,t,B);if(P!==!1)return(P===1||P===-1)&&(B=P===1),As=!0,setTimeout(nf,30),y(),B&&!N?e.appendChild(C):n.parentNode.insertBefore(C,B?N:n),m&&qa(m,0,E-m.scrollTop),et=C.parentNode,D!==void 0&&!Pn&&(Un=Math.abs(D-at(n)[b])),k(),v(!0)}if(e.contains(C))return v(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){U(document,"mousemove",this._onTouchMove),U(document,"touchmove",this._onTouchMove),U(document,"pointermove",this._onTouchMove),U(document,"dragover",ye),U(document,"mousemove",ye),U(document,"touchmove",ye)},_offUpEvents:function(){var t=this.el.ownerDocument;U(t,"mouseup",this._onDrop),U(t,"touchend",this._onDrop),U(t,"pointerup",this._onDrop),U(t,"touchcancel",this._onDrop),U(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;if(Ct=Ot(C),oe=Ot(C,n.draggable),bt("drop",this,{evt:t}),et=C&&C.parentNode,Ct=Ot(C),oe=Ot(C,n.draggable),L.eventCanceled){this._nulling();return}Ve=!1,Pn=!1,gn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ts(this.cloneId),Ts(this._dragStartId),this.nativeDraggable&&(U(document,"drop",this),U(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),dn&&R(document.body,"user-select",""),R(C,"transform",""),t&&(en&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),j&&j.parentNode&&j.parentNode.removeChild(j),(Q===et||dt&&dt.lastPutMode!=="clone")&&nt&&nt.parentNode&&nt.parentNode.removeChild(nt),C&&(this.nativeDraggable&&U(C,"dragend",this),ts(C),C.style["will-change"]="",en&&!Ve&&wt(C,dt?dt.options.ghostClass:this.options.ghostClass,!1),wt(C,this.options.chosenClass,!1),pt({sortable:this,name:"unchoose",toEl:et,newIndex:null,newDraggableIndex:null,originalEvent:t}),Q!==et?(Ct>=0&&(pt({rootEl:et,name:"add",toEl:et,fromEl:Q,originalEvent:t}),pt({sortable:this,name:"remove",toEl:et,originalEvent:t}),pt({rootEl:et,name:"sort",toEl:et,fromEl:Q,originalEvent:t}),pt({sortable:this,name:"sort",toEl:et,originalEvent:t})),dt&&dt.save()):Ct!==$e&&Ct>=0&&(pt({sortable:this,name:"update",toEl:et,originalEvent:t}),pt({sortable:this,name:"sort",toEl:et,originalEvent:t})),L.active&&((Ct==null||Ct===-1)&&(Ct=$e,oe=pn),pt({sortable:this,name:"end",toEl:et,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){bt("nulling",this),Q=C=et=j=ke=nt=qn=re=be=Bt=en=Ct=oe=$e=pn=Ne=fn=dt=Rn=L.dragged=L.ghost=L.clone=L.active=null,bi.forEach(function(t){t.checked=!0}),bi.length=Zi=Ji=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":C&&(this._onDragOver(t),ef(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,n=this.el.children,i=0,s=n.length,o=this.options;i<s;i++)e=n[i],$t(e,o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||lf(e));return t},sort:function(t,e){var n={},i=this.el;this.toArray().forEach(function(s,o){var r=i.children[o];$t(r,this.options.draggable,i,!1)&&(n[s]=r)},this),e&&this.captureAnimationState(),t.forEach(function(s){n[s]&&(i.removeChild(n[s]),i.appendChild(n[s]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return $t(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(e===void 0)return n[t];var i=Sn.modifyOption(this,t,e);typeof i<"u"?n[t]=i:n[t]=e,t==="group"&&Ya(n)},destroy:function(){bt("destroy",this);var t=this.el;t[St]=null,U(t,"mousedown",this._onTapStart),U(t,"touchstart",this._onTapStart),U(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(U(t,"dragover",this),U(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),mi.splice(mi.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!re){if(bt("hideClone",this),L.eventCanceled)return;R(nt,"display","none"),this.options.removeCloneOnHide&&nt.parentNode&&nt.parentNode.removeChild(nt),re=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(re){if(bt("showClone",this),L.eventCanceled)return;C.parentNode==Q&&!this.options.group.revertClone?Q.insertBefore(nt,C):ke?Q.insertBefore(nt,ke):Q.appendChild(nt),this.options.group.revertClone&&this.animate(C,nt),R(nt,"display",""),re=!1}}};function ef(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Bn(t,e,n,i,s,o,r,a){var u,c=t[St],l=c.options.onMove,d;return window.CustomEvent&&!ee&&!_n?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=e,u.from=t,u.dragged=n,u.draggedRect=i,u.related=s||e,u.relatedRect=o||at(e),u.willInsertAfter=a,u.originalEvent=r,t.dispatchEvent(u),l&&(d=l.call(c,u,r)),d}function ts(t){t.draggable=!1}function nf(){As=!1}function sf(t,e,n){var i=at(Ye(n.el,0,n.options,!0)),s=10;return e?t.clientX<i.left-s||t.clientY<i.top&&t.clientX<i.right:t.clientY<i.top-s||t.clientY<i.bottom&&t.clientX<i.left}function of(t,e,n){var i=at(Js(n.el,n.options.draggable)),s=10;return e?t.clientX>i.right+s||t.clientX<=i.right&&t.clientY>i.bottom&&t.clientX>=i.left:t.clientX>i.right&&t.clientY>i.top||t.clientX<=i.right&&t.clientY>i.bottom+s}function rf(t,e,n,i,s,o,r,a){var u=i?t.clientY:t.clientX,c=i?n.height:n.width,l=i?n.top:n.left,d=i?n.bottom:n.right,h=!1;if(!r){if(a&&Un<c*s){if(!gn&&(fn===1?u>l+c*o/2:u<d-c*o/2)&&(gn=!0),gn)h=!0;else if(fn===1?u<l+Un:u>d-Un)return-fn}else if(u>l+c*(1-s)/2&&u<d-c*(1-s)/2)return af(e)}return h=h||r,h&&(u<l+c*o/2||u>d-c*o/2)?u>l+c/2?1:-1:0}function af(t){return Ot(C)<Ot(t)?1:-1}function lf(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function uf(t){bi.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var i=e[n];i.checked&&bi.push(i)}}function Wn(t){return setTimeout(t,0)}function Ts(t){return clearTimeout(t)}Mi&&Y(document,"touchmove",function(t){(L.active||Ve)&&t.cancelable&&t.preventDefault()});L.utils={on:Y,off:U,css:R,find:Ha,is:function(t,e){return!!$t(t,e,t,!1)},extend:Gp,throttle:Ga,closest:$t,toggleClass:wt,clone:Ua,index:Ot,nextTick:Wn,cancelNextTick:Ts,detectDirection:Xa,getChild:Ye};L.get=function(t){return t[St]};L.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(L.utils=Wt(Wt({},L.utils),i.utils)),Sn.mount(i)})};L.create=function(t,e){return new L(t,e)};L.version=Vp;var st=[],nn,Is,Ds=!1,es,ns,yi,sn;function cf(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(e){var n=e.originalEvent;this.sortable.nativeDraggable?Y(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Y(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Y(document,"touchmove",this._handleFallbackAutoScroll):Y(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var n=e.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?U(document,"dragover",this._handleAutoScroll):(U(document,"pointermove",this._handleFallbackAutoScroll),U(document,"touchmove",this._handleFallbackAutoScroll),U(document,"mousemove",this._handleFallbackAutoScroll)),lr(),Xn(),qp()},nulling:function(){yi=Is=nn=Ds=sn=es=ns=null,st.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,n){var i=this,s=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,r=document.elementFromPoint(s,o);if(yi=e,n||this.options.forceAutoScrollFallback||_n||ee||dn){is(e,this.options,r,n);var a=ae(r,!0);Ds&&(!sn||s!==es||o!==ns)&&(sn&&lr(),sn=setInterval(function(){var u=ae(document.elementFromPoint(s,o),!0);u!==a&&(a=u,Xn()),is(e,i.options,u,n)},10),es=s,ns=o)}else{if(!this.options.bubbleScroll||ae(r,!0)===Gt()){Xn();return}is(e,this.options,ae(r,!1),!1)}}},Qt(t,{pluginName:"scroll",initializeByDefault:!0})}function Xn(){st.forEach(function(t){clearInterval(t.pid)}),st=[]}function lr(){clearInterval(sn)}var is=Ga(function(t,e,n,i){if(e.scroll){var s=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,r=e.scrollSensitivity,a=e.scrollSpeed,u=Gt(),c=!1,l;Is!==n&&(Is=n,Xn(),nn=e.scroll,l=e.scrollFn,nn===!0&&(nn=ae(n,!0)));var d=0,h=nn;do{var p=h,g=at(p),f=g.top,y=g.bottom,v=g.left,k=g.right,w=g.width,T=g.height,M=void 0,D=void 0,W=p.scrollWidth,x=p.scrollHeight,b=R(p),m=p.scrollLeft,E=p.scrollTop;p===u?(M=w<W&&(b.overflowX==="auto"||b.overflowX==="scroll"||b.overflowX==="visible"),D=T<x&&(b.overflowY==="auto"||b.overflowY==="scroll"||b.overflowY==="visible")):(M=w<W&&(b.overflowX==="auto"||b.overflowX==="scroll"),D=T<x&&(b.overflowY==="auto"||b.overflowY==="scroll"));var F=M&&(Math.abs(k-s)<=r&&m+w<W)-(Math.abs(v-s)<=r&&!!m),$=D&&(Math.abs(y-o)<=r&&E+T<x)-(Math.abs(f-o)<=r&&!!E);if(!st[d])for(var N=0;N<=d;N++)st[N]||(st[N]={});(st[d].vx!=F||st[d].vy!=$||st[d].el!==p)&&(st[d].el=p,st[d].vx=F,st[d].vy=$,clearInterval(st[d].pid),(F!=0||$!=0)&&(c=!0,st[d].pid=setInterval(function(){i&&this.layer===0&&L.active._onTouchMove(yi);var B=st[this.layer].vy?st[this.layer].vy*a:0,P=st[this.layer].vx?st[this.layer].vx*a:0;typeof l=="function"&&l.call(L.dragged.parentNode[St],P,B,t,yi,st[this.layer].el)!=="continue"||qa(st[this.layer].el,P,B)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==u&&(h=ae(h,!1)));Ds=c}},30),Ja=function(t){var e=t.originalEvent,n=t.putSortable,i=t.dragEl,s=t.activeSortable,o=t.dispatchSortableEvent,r=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var u=n||s;r();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,l=document.elementFromPoint(c.clientX,c.clientY);a(),u&&!u.el.contains(l)&&(o("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function Qs(){}Qs.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var i=Ye(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(e,i):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:Ja};Qt(Qs,{pluginName:"revertOnSpill"});function to(){}to.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable,i=n||this.sortable;i.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),i.animateAll()},drop:Ja};Qt(to,{pluginName:"removeOnSpill"});L.mount(new cf);L.mount(to,Qs);const df=["Start","Add","Remove","Update","End"],hf=["Choose","Unchoose","Sort","Filter","Clone"],pf=["Move"],ur={manage:pf,manageAndEmit:df,emit:hf};[...[...ur.manageAndEmit,...ur.emit].map(t=>t.toLowerCase())];var Yn=(t,e=[])=>({parts:(...n)=>{if(ff(e))return Yn(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Yn(t,[...e,...n]),rename:n=>Yn(n,e),keys:()=>e,build:()=>[...new Set(e)].reduce((n,i)=>Object.assign(n,{[i]:{selector:[`&[data-scope="${je(t)}"][data-part="${je(i)}"]`,`& [data-scope="${je(t)}"][data-part="${je(i)}"]`].join(", "),attrs:{"data-scope":je(t),"data-part":je(i)}}}),{})}),je=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),ff=t=>t.length===0,Qe=t=>t?"":void 0,gf=t=>t.nodeType===Node.DOCUMENT_NODE?t:t.ownerDocument??document;function vf(t){const e={getRootNode:n=>{var i;return((i=n.getRootNode)==null?void 0:i.call(n))??document},getDoc:n=>gf(e.getRootNode(n)),getWin:n=>e.getDoc(n).defaultView??window,getActiveElement:n=>e.getDoc(n).activeElement,isActiveElement:(n,i)=>i===e.getActiveElement(n),focus(n,i){i!=null&&(e.isActiveElement(n,i)||i.focus({preventScroll:!0}))},getById:(n,i)=>e.getRootNode(n).getElementById(i),setValue:(n,i)=>{if(n==null||i==null)return;const s=i.toString();n.value!==s&&(n.value=i.toString())}};return{...e,...t}}var mf={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},ss=t=>typeof t=="object"&&t!==null,Ce=new WeakMap,on=new WeakSet,bf=(t=Object.is,e=(c,l)=>new Proxy(c,l),n=c=>ss(c)&&!on.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),i=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},s=new WeakMap,o=(c,l,d=i)=>{const h=s.get(c);if(h?.[0]===l)return h[1];const p=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return ni(p,!0),s.set(c,[l,p]),Reflect.ownKeys(c).forEach(g=>{const f=Reflect.get(c,g);on.has(f)?(ni(f,!1),p[g]=f):f instanceof Promise?Object.defineProperty(p,g,{get(){return d(f)}}):Ce.has(f)?p[g]=Ke(f,d):p[g]=f}),Object.freeze(p)},r=new WeakMap,a=[1,1],u=c=>{if(!ss(c))throw new Error("object required");const l=r.get(c);if(l)return l;let d=a[0];const h=new Set,p=(x,b=++a[0])=>{d!==b&&(d=b,h.forEach(m=>m(x,b)))};let g=a[1];const f=(x=++a[1])=>(g!==x&&!h.size&&(g=x,v.forEach(([b])=>{const m=b[1](x);m>d&&(d=m)})),d),y=x=>(b,m)=>{const E=[...b];E[1]=[x,...E[1]],p(E,m)},v=new Map,k=(x,b)=>{if(h.size){const m=b[3](y(x));v.set(x,[b,m])}else v.set(x,[b])},w=x=>{var b;const m=v.get(x);m&&(v.delete(x),(b=m[1])==null||b.call(m))},T=x=>(h.add(x),h.size===1&&v.forEach(([b,m],E)=>{const F=b[3](y(E));v.set(E,[b,F])}),()=>{h.delete(x),h.size===0&&v.forEach(([b,m],E)=>{m&&(m(),v.set(E,[b]))})}),M=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),D=e(M,{deleteProperty(x,b){const m=Reflect.get(x,b);w(b);const E=Reflect.deleteProperty(x,b);return E&&p(["delete",[b],m]),E},set(x,b,m,E){var F;const $=Reflect.has(x,b),N=Reflect.get(x,b,E);if($&&(t(N,m)||r.has(m)&&t(N,r.get(m))))return!0;w(b),ss(m)&&(m=Zr(m)||m);let B=m;if(!((F=Object.getOwnPropertyDescriptor(x,b))!=null&&F.set))if(m instanceof Promise)m.then(P=>{m.status="fulfilled",m.value=P,p(["resolve",[b],P])}).catch(P=>{m.status="rejected",m.reason=P,p(["reject",[b],P])});else{!Ce.has(m)&&n(m)&&(B=eo(m));const P=!on.has(B)&&Ce.get(B);P&&k(b,P)}return Reflect.set(x,b,B,E),p(["set",[b],m,N]),!0}});r.set(c,D);const W=[M,f,o,T];return Ce.set(D,W),Reflect.ownKeys(c).forEach(x=>{const b=Object.getOwnPropertyDescriptor(c,x);b.get||b.set?Object.defineProperty(M,x,b):D[x]=c[x]}),D})=>[u,Ce,on,t,e,n,i,s,o,r,a],[yf]=bf();function eo(t={}){return yf(t)}function Fs(t,e,n){const i=Ce.get(t);let s;const o=[],r=i[3];let a=!1;const u=r(c=>{if(o.push(c),n){e(o.splice(0));return}s||(s=Promise.resolve().then(()=>{s=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,u()}}function Ke(t,e){const n=Ce.get(t),[i,s,o]=n;return o(i,s(),e)}function cr(t){return on.add(t),t}function xf(t,e){Object.keys(e).forEach(i=>{if(Object.getOwnPropertyDescriptor(t,i))throw new Error("object property already defined");const s=e[i],{get:o,set:r}=typeof s=="function"?{get:s}:s,a={};a.get=()=>o(Ke(n)),r&&(a.set=u=>r(n,u)),Object.defineProperty(t,i,a)});const n=eo(t);return n}var kf=(t,e)=>Object.is(t,e);function dr(t,e,n,i,s){let o=Reflect.get(Ke(t),e);const r=s||kf;function a(){const u=Ke(t);r(o,u[e])||(n(u[e]),o=Reflect.get(u,e))}return Fs(t,a,i)}var Ef=Object.defineProperty,wf=(t,e,n)=>e in t?Ef(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,S=(t,e,n)=>(wf(t,typeof e!="symbol"?e+"":e,n),n);function Cf(t){for(;t.length>0;)t.pop();return t}var hr=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,Yt=t=>t,os=()=>{},pr=(()=>{let t=0;return()=>(t++,t.toString(36))})(),vn=t=>Array.isArray(t),mn=t=>!(t==null||typeof t!="object"||vn(t)),_f=t=>typeof t=="number"&&!Number.isNaN(t),jt=t=>typeof t=="string",xi=t=>typeof t=="function";function ki(t){if(!Sf(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(i=>typeof i=="string"),n={};for(const i of e){const s=t[i];s!==void 0&&(n[i]=ki(s))}return n}var Sf=t=>t&&typeof t=="object"&&t.constructor===Object;function rs(...t){t.length===1?t[0]:t[1],t.length!==2||t[0]}function Kn(...t){const e=t.length===1?t[0]:t[1];t.length!==2||t[0]}function Qa(t,...e){for(const n of e){const i=ki(n);for(const s in i)mn(n[s])?(t[s]||(t[s]={}),Qa(t[s],n[s])):t[s]=n[s]}return t}function fr(t){return _e(t)}function yt(t){return jt(t)?{type:t}:t}function se(t){return t?vn(t)?t.slice():[t]:[]}function tl(t){return mn(t)&&t.predicate!=null}var Af=()=>!0;function no(t,e,n,i){return s=>{var o;return jt(s)?!!((o=t[s])!=null&&o.call(t,e,n,i)):xi(s)?s(e,n,i):s.predicate(t)(e,n,i)}}function Tf(...t){return{predicate:e=>(n,i,s)=>t.map(no(e,n,i,s)).some(Boolean)}}function If(...t){return{predicate:e=>(n,i,s)=>t.map(no(e,n,i,s)).every(Boolean)}}function Df(t){return{predicate:e=>(n,i,s)=>!no(e,n,i,s)(t)}}function Ff(...t){return(e,n,i)=>i.state.matches(...t)}var Of={or:Tf,and:If,not:Df,stateIn:Ff};function el(t,e){return t=t??Af,(n,i,s)=>{if(jt(t)){const o=e[t];return xi(o)?o(n,i,s):o}return tl(t)?t.predicate(e)(n,i,s):t?.(n,i,s)}}function as(t,e){return(n,i,s)=>tl(t)?t.predicate(e)(n,i,s):t}function Mf(t){const e=t.computed??Yt({}),n=t.context??Yt({}),i=eo({value:t.initial??"",previousValue:"",event:Yt({}),previousEvent:Yt({}),context:xf(n,e),done:!1,tags:[],hasTag(s){return this.tags.includes(s)},matches(...s){return s.includes(this.value)},can(s){return Yt(this).nextEvents.includes(s)},get nextEvents(){var s,o;const r=((o=(s=t.states)==null?void 0:s[this.value])==null?void 0:o.on)??{},a=t?.on??{};return Object.keys({...r,...a})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return Yt(i)}function Nn(t,e){return(n,i)=>{if(_f(t))return t;if(xi(t))return t(n,i);if(jt(t)){const s=Number.parseFloat(t);if(!Number.isNaN(s))return s;if(e){const o=e?.[t];return Kn(o==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${t}\`. It doesn't exist in \`options.delays\``),xi(o)?o(n,i):o}}}}function Rf(t){return jt(t)?{target:t}:t}function Pf(t,e){return(n,i,s)=>se(t).map(Rf).find(o=>el(o.guard,e)(n,i,s)??o.target??o.actions)}var Lf=class nl{constructor(e,n){var i,s,o,r,a,u;S(this,"status","Not Started"),S(this,"state"),S(this,"initialState"),S(this,"initialContext"),S(this,"id"),S(this,"type","machine"),S(this,"activityEvents",new Map),S(this,"delayedEvents",new Map),S(this,"stateListeners",new Set),S(this,"contextListeners",new Set),S(this,"eventListeners",new Set),S(this,"doneListeners",new Set),S(this,"contextWatchers",new Set),S(this,"removeStateListener",os),S(this,"removeEventListener",os),S(this,"removeContextListener",os),S(this,"parent"),S(this,"children",new Map),S(this,"guardMap"),S(this,"actionMap"),S(this,"delayMap"),S(this,"activityMap"),S(this,"sync"),S(this,"options"),S(this,"config"),S(this,"start",l=>{if(this.state.value="",this.status==="Running")return this;this.status="Running",this.removeStateListener=Fs(this.state,()=>{this.stateListeners.forEach(y=>{y(this.stateSnapshot)})},this.sync),this.removeEventListener=dr(this.state,"event",y=>{this.executeActions(this.config.onEvent,y),this.eventListeners.forEach(v=>{v(y)})},this.sync),this.removeContextListener=Fs(this.state.context,()=>{this.log("Context:",this.contextSnapshot),this.contextListeners.forEach(y=>{y(this.contextSnapshot)})},this.sync||this.options.debug),this.setupContextWatchers(),this.executeActivities(yt("machine.start"),se(this.config.activities),"machine.start"),this.executeActions(this.config.entry,yt("machine.start"));const d=yt("machine.init"),h=mn(l)?l.value:l,p=mn(l)?l.context:void 0;p&&this.setContext(p);const g={target:h??this.config.initial},f=this.getNextStateInfo(g,d);return this.initialState=f,this.performStateChangeEffects(this.state.value,f,d),this}),S(this,"setupContextWatchers",()=>{var l;for(const[d,h]of Object.entries(this.config.watch??{})){const p=(l=this.options.compareFns)==null?void 0:l[d],g=dr(this.state.context,d,()=>{this.executeActions(h,this.state.event)},this.sync,p);this.contextWatchers.add(g)}}),S(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,yt("machine.stop")),this.executeActions(this.config.exit,yt("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.stopEventListeners(),this.stopContextListeners(),this.status="Stopped",this}),S(this,"stopEventListeners",()=>{this.eventListeners.clear(),this.removeEventListener()}),S(this,"stopContextListeners",()=>{this.contextListeners.clear(),this.removeContextListener()}),S(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),S(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(l=>l()),this.contextWatchers.clear()}),S(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(l=>{l.forEach(d=>d())}),this.delayedEvents.clear()}),S(this,"stopActivities",l=>{var d,h;l?((d=this.activityEvents.get(l))==null||d.forEach(p=>p()),(h=this.activityEvents.get(l))==null||h.clear(),this.activityEvents.delete(l)):(this.activityEvents.forEach(p=>{p.forEach(g=>g()),p.clear()}),this.activityEvents.clear())}),S(this,"sendChild",(l,d)=>{const h=yt(l),p=hr(d,this.contextSnapshot),g=this.children.get(p);g||Kn(`[@zag-js/core] Cannot send '${h.type}' event to unknown child`),g.send(h)}),S(this,"stopChild",l=>{this.children.has(l)||Kn(`[@zag-js/core > stop-child] Cannot stop unknown child ${l}`),this.children.get(l).stop(),this.children.delete(l)}),S(this,"removeChild",l=>{this.children.delete(l)}),S(this,"stopChildren",()=>{this.children.forEach(l=>l.stop()),this.children.clear()}),S(this,"setParent",l=>{this.parent=l}),S(this,"spawn",(l,d)=>{const h=hr(l);return d&&(h.id=d),h.type="machine.actor",h.setParent(this),this.children.set(h.id,Yt(h)),h.onDone(()=>{this.removeChild(h.id)}).start(),Yt(cr(h))}),S(this,"stopActivity",l=>{var d;if(!this.state.value)return;const h=this.activityEvents.get(this.state.value);(d=h?.get(l))==null||d(),h?.delete(l)}),S(this,"addActivityCleanup",(l,d,h)=>{var p;l&&(this.activityEvents.has(l)?(p=this.activityEvents.get(l))==null||p.set(d,h):this.activityEvents.set(l,new Map([[d,h]])))}),S(this,"setState",l=>{this.state.previousValue=this.state.value,this.state.value=l;const d=this.getStateNode(l);l==null?Cf(this.state.tags):this.state.tags=se(d?.tags)}),S(this,"transformContext",l=>{var d,h;return(h=(d=this.options)==null?void 0:d.transformContext)==null||h.call(d,l),l}),S(this,"setContext",l=>{l&&Qa(this.state.context,this.transformContext(l))}),S(this,"withContext",l=>{const d=this.transformContext(l),h={...this.config.context,...ki(d)};return new nl({...this.config,context:h},this.options)}),S(this,"setOptions",l=>{const d=ki(l);this.actionMap={...this.actionMap,...d.actions},this.delayMap={...this.delayMap,...d.delays},this.activityMap={...this.activityMap,...d.activities},this.guardMap={...this.guardMap,...d.guards}}),S(this,"getStateNode",l=>{var d;if(l)return(d=this.config.states)==null?void 0:d[l]}),S(this,"getNextStateInfo",(l,d)=>{const h=this.determineTransition(l,d),p=!(h!=null&&h.target),g=h?.target??this.state.value,f=this.state.value!==g,y=this.getStateNode(g),v={reenter:!p&&!f&&!(h!=null&&h.internal),transition:h,stateNode:y,target:g,changed:f};return this.log("NextState:",`[${d.type}]`,this.state.value,"---->",v.target),v}),S(this,"getActionFromDelayedTransition",l=>{const d=yt("machine.after"),h=Nn(l.delay,this.delayMap)(this.contextSnapshot,d);let p;return{entry:()=>{p=globalThis.setTimeout(()=>{const g=this.getNextStateInfo(l,d);this.performStateChangeEffects(this.state.value,g,d)},h)},exit:()=>{globalThis.clearTimeout(p)}}}),S(this,"getDelayedEventActions",l=>{const d=this.getStateNode(l),h=yt("machine.after");if(!d||!d.after)return;const p=[],g=[];if(vn(d.after)){const f=this.determineTransition(d.after,h);if(!f)return;const y=this.getActionFromDelayedTransition(f);p.push(y.entry),g.push(y.exit)}else if(mn(d.after))for(const f in d.after){const y=d.after[f];let v={};if(vn(y)){const w=this.determineTransition(y,h);w&&(v=w)}else jt(y)?v={target:y,delay:f}:v={...y,delay:f};const k=this.getActionFromDelayedTransition(v);p.push(k.entry),g.push(k.exit)}return{entries:p,exits:g}}),S(this,"executeActions",(l,d)=>{var h;const p=as(l,this.guardMap)(this.contextSnapshot,d,this.guardMeta);for(const g of se(p)){const f=jt(g)?(h=this.actionMap)==null?void 0:h[g]:g;rs(jt(g)&&!f,`[@zag-js/core > execute-actions] No implementation found for action: \`${g}\``),f?.(this.state.context,d,this.meta)}}),S(this,"executeActivities",(l,d,h)=>{var p;for(const g of d){const f=jt(g)?(p=this.activityMap)==null?void 0:p[g]:g;if(!f){rs(`[@zag-js/core > execute-activity] No implementation found for activity: \`${g}\``);continue}const y=f(this.state.context,l,this.meta);if(y){const v=jt(g)?g:g.name||pr();this.addActivityCleanup(h??this.state.value,v,y)}}}),S(this,"createEveryActivities",(l,d)=>{if(!l)return;const h=yt("machine.every");if(vn(l)){const p=se(l).find(f=>{const y=f.delay,v=Nn(y,this.delayMap)(this.contextSnapshot,h);return el(f.guard,this.guardMap)(this.contextSnapshot,h,this.guardMeta)??v!=null});if(!p)return;const g=Nn(p.delay,this.delayMap)(this.contextSnapshot,h);d(()=>{const f=globalThis.setInterval(()=>{this.executeActions(p.actions,h)},g);return()=>{globalThis.clearInterval(f)}})}else for(const p in l){const g=l?.[p],f=Nn(p,this.delayMap)(this.contextSnapshot,h);d(()=>{const y=globalThis.setInterval(()=>{this.executeActions(g,h)},f);return()=>{globalThis.clearInterval(y)}})}}),S(this,"setEvent",l=>{this.state.previousEvent=this.state.event,this.state.event=cr(yt(l))}),S(this,"performExitEffects",(l,d)=>{const h=this.state.value;if(h==="")return;const p=l?this.getStateNode(l):void 0;this.stopActivities(h);const g=as(p?.exit,this.guardMap)(this.contextSnapshot,d,this.guardMeta),f=se(g),y=this.delayedEvents.get(h);y&&f.push(...y),this.executeActions(f,d),this.eventListeners.clear()}),S(this,"performEntryEffects",(l,d)=>{const h=this.getStateNode(l),p=se(h?.activities);this.createEveryActivities(h?.every,v=>{p.unshift(v)}),p.length>0&&this.executeActivities(d,p);const g=as(h?.entry,this.guardMap)(this.contextSnapshot,d,this.guardMeta),f=se(g),y=this.getDelayedEventActions(l);h!=null&&h.after&&y&&(this.delayedEvents.set(l,y?.exits),f.push(...y.entries)),this.executeActions(f,d),h?.type==="final"&&(this.state.done=!0,this.doneListeners.forEach(v=>{v(this.stateSnapshot)}),this.stop())}),S(this,"performTransitionEffects",(l,d)=>{const h=this.determineTransition(l,d);this.executeActions(h?.actions,d)}),S(this,"performStateChangeEffects",(l,d,h)=>{this.setEvent(h);const p=d.changed||d.reenter;p&&this.performExitEffects(l,h),this.performTransitionEffects(d.transition,h),this.setState(d.target),p&&this.performEntryEffects(d.target,h)}),S(this,"determineTransition",(l,d)=>{const h=Pf(l,this.guardMap);return h?.(this.contextSnapshot,d,this.guardMeta)}),S(this,"sendParent",l=>{var d;this.parent||Kn("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const h=yt(l);(d=this.parent)==null||d.send(h)}),S(this,"log",(...l)=>{}),S(this,"send",l=>{const d=yt(l);this.transition(this.state.value,d)}),S(this,"transition",(l,d)=>{var h,p;const g=jt(l)?this.getStateNode(l):l?.stateNode,f=yt(d);if(!g&&!this.config.on){const k=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${l}, \`event\`: ${f.type}`;rs(k);return}const y=((h=g?.on)==null?void 0:h[f.type])??((p=this.config.on)==null?void 0:p[f.type]),v=this.getNextStateInfo(y,f);return this.performStateChangeEffects(this.state.value,v,f),v.stateNode}),S(this,"subscribe",l=>(this.stateListeners.add(l),this.status==="Running"&&l(this.stateSnapshot),()=>{this.stateListeners.delete(l)})),S(this,"onDone",l=>(this.doneListeners.add(l),this)),S(this,"onTransition",l=>(this.stateListeners.add(l),this.status==="Running"&&l(this.stateSnapshot),this)),S(this,"onChange",l=>(this.contextListeners.add(l),this)),S(this,"onEvent",l=>(this.eventListeners.add(l),this)),this.config=fr(e),this.options=fr(n??{}),this.id=this.config.id??`machine-${pr()}`,this.guardMap=((i=this.options)==null?void 0:i.guards)??{},this.actionMap=((s=this.options)==null?void 0:s.actions)??{},this.delayMap=((o=this.options)==null?void 0:o.delays)??{},this.activityMap=((r=this.options)==null?void 0:r.activities)??{},this.sync=((a=this.options)==null?void 0:a.sync)??!1,this.state=Mf(this.config),this.initialContext=Ke(this.state.context),this.transformContext(this.state.context);const c=yt("machine.created");this.executeActions((u=this.config)==null?void 0:u.created,c)}get stateSnapshot(){return Yt(Ke(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){var n;return((n=e.initialState)==null?void 0:n.target)??""}}}get meta(){var e;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((e=this.initialState)==null?void 0:e.target)??"",getState:()=>this.stateSnapshot,getAction:n=>this.actionMap[n],getGuard:n=>this.guardMap[n]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}},Bf=(t,e)=>new Lf(t,e);function Nf(t,e,n){if(!t)return;const i=t.ownerDocument.defaultView||window,s=new i.MutationObserver(o=>{for(const r of o)r.type==="attributes"&&r.attributeName&&e.includes(r.attributeName)&&n(r)});return s.observe(t,{attributes:!0,attributeFilter:e}),()=>s.disconnect()}var il=t=>t.ownerDocument.defaultView||window;function jf(t,e){const{type:n="HTMLInputElement",property:i="value"}=e,s=il(t)[n].prototype;return Object.getOwnPropertyDescriptor(s,i)??{}}function Vf(t,e){var n;(n=jf(t,{type:"HTMLInputElement",property:"checked"}).set)==null||n.call(t,e)}function $f(t,e){const{checked:n,bubbles:i=!0}=e;if(!t)return;const s=il(t);t instanceof s.HTMLInputElement&&(Vf(t,n),t.dispatchEvent(new s.Event("click",{bubbles:i})),t.dispatchEvent(new s.Event("change",{bubbles:i})))}function zf(t){return Hf(t)?t.form:t.closest("form")}function Hf(t){return t.matches("textarea, input, select, button")}function Gf(t,e){if(!t)return;const n=zf(t);return n?.addEventListener("reset",e,{passive:!0}),()=>{n?.removeEventListener("reset",e)}}function qf(t,e){const n=t?.closest("fieldset");if(n)return e(n.disabled),Nf(n,["disabled"],()=>e(n.disabled))}function Uf(t,e){if(!t)return;const{onFieldsetDisabledChange:n,onFormReset:i}=e,s=[Gf(t,i),qf(t,n)];return()=>{s.forEach(o=>o?.())}}var gr=t=>t?.constructor.name==="Array",sl=(t,e)=>{if(Object.is(t,e))return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(typeof t?.isEqual=="function"&&typeof e?.isEqual=="function")return t.isEqual(e);if(typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();if(gr(t)&&gr(e))return Array.from(t).toString()===Array.from(e).toString();if(typeof t!="object"||typeof e!="object")return!1;const n=Object.keys(e??Object.create(null)),i=n.length;for(let s=0;s<i;s++)if(!Reflect.has(t,n[s]))return!1;for(let s=0;s<i;s++){const o=n[s];if(!sl(t[o],e[o]))return!1}return!0};function ol(t){if(!Wf(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(i=>typeof i=="string"),n={};for(const i of e){const s=t[i];s!==void 0&&(n[i]=ol(s))}return n}var Wf=t=>t&&typeof t=="object"&&t.constructor===Object,Xf=Yn("switch").parts("root","label","control","thumb"),jn=Xf.build(),_t=vf({getRootId:t=>{var e;return((e=t.ids)==null?void 0:e.root)??`switch:${t.id}`},getLabelId:t=>{var e;return((e=t.ids)==null?void 0:e.label)??`switch:${t.id}:label`},getThumbId:t=>{var e;return((e=t.ids)==null?void 0:e.thumb)??`switch:${t.id}:thumb`},getControlId:t=>{var e;return((e=t.ids)==null?void 0:e.control)??`switch:${t.id}:control`},getHiddenInputId:t=>{var e;return((e=t.ids)==null?void 0:e.input)??`switch:${t.id}:input`},getHiddenInputEl:t=>_t.getById(t,_t.getHiddenInputId(t))});function Yf(t,e,n){const i=t.context.isDisabled,s=!i&&t.context.focused,o=t.context.checked,r={"data-active":Qe(t.context.active),"data-focus":Qe(s),"data-hover":Qe(t.context.hovered),"data-disabled":Qe(i),"data-state":t.context.checked?"checked":"unchecked","data-invalid":Qe(t.context.invalid)};return{isChecked:o,isDisabled:i,isFocused:s,setChecked(a){e({type:"CHECKED.SET",checked:a,isTrusted:!1})},toggleChecked(){e({type:"CHECKED.TOGGLE",checked:o,isTrusted:!1})},rootProps:n.label({...jn.root.attrs,...r,dir:t.context.dir,id:_t.getRootId(t.context),htmlFor:_t.getHiddenInputId(t.context),onPointerMove(){i||e({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){i||e({type:"CONTEXT.SET",context:{hovered:!1}})},onPointerDown(a){i||(s&&a.preventDefault(),e({type:"CONTEXT.SET",context:{active:!0}}))},onPointerUp(){i||e({type:"CONTEXT.SET",context:{active:!1}})},onClick(a){a.target===_t.getHiddenInputEl(t.context)&&a.stopPropagation()}}),labelProps:n.element({...jn.label.attrs,...r,dir:t.context.dir,id:_t.getLabelId(t.context)}),thumbProps:n.element({...jn.thumb.attrs,...r,dir:t.context.dir,id:_t.getThumbId(t.context),"aria-hidden":!0}),controlProps:n.element({...jn.control.attrs,...r,dir:t.context.dir,id:_t.getControlId(t.context),"aria-hidden":!0}),hiddenInputProps:n.input({id:_t.getHiddenInputId(t.context),type:"checkbox",required:t.context.required,defaultChecked:o,disabled:i,"aria-labelledby":_t.getLabelId(t.context),"aria-invalid":t.context.invalid,name:t.context.name,form:t.context.form,value:t.context.value,style:mf,onChange(a){const u=a.currentTarget.checked;e({type:"CHECKED.SET",checked:u,isTrusted:!0})},onBlur(){e({type:"CONTEXT.SET",context:{focused:!1}})},onFocus(){e({type:"CONTEXT.SET",context:{focused:!0}})},onKeyDown(a){a.key===" "&&e({type:"CONTEXT.SET",context:{active:!0}})},onKeyUp(a){a.key===" "&&e({type:"CONTEXT.SET",context:{active:!1}})}})}}var{not:vr}=Of;function Kf(t){const e=ol(t);return Bf({id:"switch",initial:"ready",context:{checked:!1,label:"switch",value:"on",disabled:!1,...e,fieldsetDisabled:!1},computed:{isDisabled:n=>n.disabled||n.fieldsetDisabled},watch:{disabled:"removeFocusIfNeeded",checked:"syncInputElement"},activities:["trackFormControlState"],on:{"CHECKED.TOGGLE":[{guard:vr("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:vr("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},states:{ready:{}}},{guards:{isTrusted:(n,i)=>!!i.isTrusted},activities:{trackFormControlState(n,i,{send:s,initialContext:o}){return Uf(_t.getHiddenInputEl(n),{onFieldsetDisabledChange(r){n.fieldsetDisabled=r},onFormReset(){s({type:"CHECKED.SET",checked:!!o.checked,src:"form-reset"})}})}},actions:{setContext(n,i){Object.assign(n,i.context)},syncInputElement(n){const i=_t.getHiddenInputEl(n);i&&(i.checked=!!n.checked)},removeFocusIfNeeded(n){n.disabled&&n.focused&&(n.focused=!1)},setChecked(n,i){mr.checked(n,i.checked)},toggleChecked(n,i){mr.checked(n,!n.checked)},dispatchChangeEvent(n){const i=_t.getHiddenInputEl(n);$f(i,{checked:n.checked})}}})}var Zf={change:t=>{var e;(e=t.onCheckedChange)==null||e.call(t,{checked:t.checked})}},mr={checked:(t,e)=>{sl(t.checked,e)||(t.checked=e,Zf.change(t))}};const Jf={key:0,class:"k-switch__label"},lg=tt({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},labels:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i={id:Ie(),checked:n.modelValue,disabled:n.disabled,onCheckedChange:({checked:a})=>e("update:modelValue",a)},[s,o]=Ti(Kf(i),{}),r=H(()=>Yf(s.value,o,Ai));return At(()=>n.modelValue,()=>{if(r.value.isChecked!==n.modelValue)return r.value.setChecked(n.modelValue)}),(a,u)=>(_(),O("label",ot({class:"k-switch"},r.value.rootProps),[ut("input",kt(Rt(r.value.hiddenInputProps)),null,16),ut("span",kt(Rt(r.value.controlProps)),[ut("span",kt(Rt(r.value.thumbProps)),null,16)],16),ut("span",kt(Rt(r.value.labelProps)),[a.labels?(_(),O("span",Jf,ct(r.value.isChecked?a.labels.on:a.labels.off),1)):q("",!0)],16)],16))}}),ug=tt({__name:"LazyLoad",props:{wrapperTag:{default:"div"},threshold:{default:0},observerRoot:{default:null}},emits:["intersect"],setup(t,{emit:e}){const n=t,i=J(!1);function s(u){const c=u[0];c.isIntersecting&&(i.value=!0,bl(()=>{e("intersect",c),a()}))}const o=J(),r=J();ge(()=>{o.value=new IntersectionObserver(s,{root:n.observerRoot,threshold:n.threshold}),o.value.observe(r.value)}),Ei(()=>{a()});function a(){o.value&&o.value.disconnect()}return(u,c)=>(_(),it(de(u.wrapperTag),{ref_key:"rootRef",ref:r,class:"k-lazyload"},{default:rt(()=>[i.value?z(u.$slots,"default",{key:0}):z(u.$slots,"placeholder",{key:1})]),_:3},512))}});export{ze as C,rg as E,Po as G,he as I,Dp as L,ug as T,Dh as V,ag as _,uh as a,ng as h,og as k,tg as l,eg as s,ig as v,lg as x,sg as y};