@hot-updater/console 0.12.7 → 0.13.0

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.
@@ -0,0 +1,27 @@
1
+ var of=Object.defineProperty;var ba=e=>{throw TypeError(e)};var sf=(e,t,n)=>t in e?of(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Re=(e,t,n)=>sf(e,typeof t!="symbol"?t+"":t,n),Pi=(e,t,n)=>t.has(e)||ba("Cannot "+n);var E=(e,t,n)=>(Pi(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?ba("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,r)=>(Pi(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ue=(e,t,n)=>(Pi(e,t,"access private method"),n);var Lr=(e,t,n,r)=>({set _(i){q(e,t,i,n)},get _(){return E(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const ee={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Sa(this.context.count)},getNextContextId(){return Sa(this.context.count++)}};function Sa(e){const t=String(e),n=t.length-1;return ee.context.id+(n?String.fromCharCode(96+n):"")+t}function ir(e){ee.context=e}const af=(e,t)=>e===t,ot=Symbol("solid-proxy"),Eu=typeof Proxy=="function",fo=Symbol("solid-track"),Zr={equals:af};let Ru=Fu;const st=1,dr=2,Pu={owned:null,cleanups:null,context:null,owner:null},Ii={};var se=null;let G=null,lf=null,ge=null,ke=null,De=null,si=0;function ln(e,t){const n=ge,r=se,i=e.length===0,o=t===void 0?r:t,s=i?Pu:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=i?e:()=>e(()=>Me(()=>zt(s)));se=s,ge=null;try{return He(a,!0)}finally{ge=n,se=r}}function B(e,t){t=t?Object.assign({},Zr,t):Zr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(G&&G.running&&G.sources.has(n)?i=i(n.tValue):i=i(n.value)),Mu(n,i));return[Iu.bind(n),r]}function Mt(e,t,n){const r=ui(e,t,!0,st);zn(r)}function Ke(e,t,n){const r=ui(e,t,!1,st);zn(r)}function U(e,t,n){Ru=pf;const r=ui(e,t,!1,st),i=un&&me(un);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),De?De.push(r):zn(r)}function K(e,t,n){n=n?Object.assign({},Zr,n):Zr;const r=ui(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,zn(r),Iu.bind(r)}function uf(e){return e&&typeof e=="object"&&"then"in e}function cf(e,t,n){let r,i,o;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,i=e,o=t):(r=e,i=t,o={});let s=null,a=Ii,u=null,l=!1,c=!1,d="initialValue"in o,f=typeof r=="function"&&K(r);const h=new Set,[g,p]=(o.storage||B)(o.initialValue),[y,w]=B(void 0),[m,v]=B(void 0,{equals:!1}),[x,C]=B(d?"ready":"unresolved");ee.context&&(u=ee.getNextContextId(),o.ssrLoadFrom==="initial"?a=o.initialValue:ee.load&&ee.has(u)&&(a=ee.load(u)));function O(V,N,z,oe){return s===V&&(s=null,oe!==void 0&&(d=!0),(V===a||N===a)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(oe,{value:N})),a=Ii,G&&V&&l?(G.promises.delete(V),l=!1,He(()=>{G.running=!0,L(N,z)},!1)):L(N,z)),N}function L(V,N){He(()=>{N===void 0&&p(()=>V),C(N!==void 0?"errored":d?"ready":"unresolved"),w(N);for(const z of h.keys())z.decrement();h.clear()},!1)}function _(){const V=un&&me(un),N=g(),z=y();if(z!==void 0&&!s)throw z;return ge&&!ge.user&&V&&Mt(()=>{m(),s&&(V.resolved&&G&&l?G.promises.add(s):h.has(V)||(V.increment(),h.add(V)))}),N}function T(V=!0){if(V!==!1&&c)return;c=!1;const N=f?f():r;if(l=G&&G.running,N==null||N===!1){O(s,Me(g));return}G&&s&&G.promises.delete(s);const z=a!==Ii?a:Me(()=>i(N,{value:g(),refetching:V}));return uf(z)?(s=z,"value"in z?(z.status==="success"?O(s,z.value,void 0,N):O(s,void 0,go(z.value),N),z):(c=!0,queueMicrotask(()=>c=!1),He(()=>{C(d?"refreshing":"pending"),v()},!1),z.then(oe=>O(z,oe,void 0,N),oe=>O(z,void 0,go(oe),N)))):(O(s,z,void 0,N),z)}return Object.defineProperties(_,{state:{get:()=>x()},error:{get:()=>y()},loading:{get(){const V=x();return V==="pending"||V==="refreshing"}},latest:{get(){if(!d)return _();const V=y();if(V&&!s)throw V;return g()}}}),f?Mt(()=>T(!1)):T(!1),[_,{refetch:T,mutate:p}]}function ai(e){return He(e,!1)}function Me(e){if(ge===null)return e();const t=ge;ge=null;try{return e()}finally{ge=t}}function Ce(e,t,n){const r=Array.isArray(e);let i,o=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let l=0;l<e.length;l++)a[l]=e[l]()}else a=e();if(o)return o=!1,s;const u=Me(()=>t(a,i,s));return i=a,u}}function Bn(e){U(()=>Me(e))}function W(e){return se===null||(se.cleanups===null?se.cleanups=[e]:se.cleanups.push(e)),e}function ho(){return ge}function fr(){return se}function ts(e,t){const n=se,r=ge;se=e,ge=null;try{return He(t,!0)}catch(i){ns(i)}finally{se=n,ge=r}}function df(e){if(G&&G.running)return e(),G.done;const t=ge,n=se;return Promise.resolve().then(()=>{ge=t,se=n;let r;return un&&(r=G||(G={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(i=>r.resolve=i)),r.running=!0),He(e,!1),ge=se=null,r?r.done:void 0})}const[mS,xa]=B(!1);function ff(e){De.push.apply(De,e),e.length=0}function we(e,t){const n=Symbol("context");return{id:n,Provider:mf(n),defaultValue:e}}function me(e){let t;return se&&se.context&&(t=se.context[e.id])!==void 0?t:e.defaultValue}function li(e){const t=K(e),n=K(()=>po(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let un;function hf(){return un||(un=we())}function Iu(){const e=G&&G.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===st)zn(this);else{const t=ke;ke=null,He(()=>ei(this),!1),ke=t}if(ge){const t=this.observers?this.observers.length:0;ge.sources?(ge.sources.push(this),ge.sourceSlots.push(t)):(ge.sources=[this],ge.sourceSlots=[t]),this.observers?(this.observers.push(ge),this.observerSlots.push(ge.sources.length-1)):(this.observers=[ge],this.observerSlots=[ge.sources.length-1])}return e&&G.sources.has(this)?this.tValue:this.value}function Mu(e,t,n){let r=G&&G.running&&G.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(G){const i=G.running;(i||!n&&G.sources.has(e))&&(G.sources.add(e),e.tValue=t),i||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&He(()=>{for(let i=0;i<e.observers.length;i+=1){const o=e.observers[i],s=G&&G.running;s&&G.disposed.has(o)||((s?!o.tState:!o.state)&&(o.pure?ke.push(o):De.push(o),o.observers&&Au(o)),s?o.tState=st:o.state=st)}if(ke.length>1e6)throw ke=[],new Error},!1)}return t}function zn(e){if(!e.fn)return;zt(e);const t=si;Ca(e,G&&G.running&&G.sources.has(e)?e.tValue:e.value,t),G&&!G.running&&G.sources.has(e)&&queueMicrotask(()=>{He(()=>{G&&(G.running=!0),ge=se=e,Ca(e,e.tValue,t),ge=se=null},!1)})}function Ca(e,t,n){let r;const i=se,o=ge;ge=se=e;try{r=e.fn(t)}catch(s){return e.pure&&(G&&G.running?(e.tState=st,e.tOwned&&e.tOwned.forEach(zt),e.tOwned=void 0):(e.state=st,e.owned&&e.owned.forEach(zt),e.owned=null)),e.updatedAt=n+1,ns(s)}finally{ge=o,se=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Mu(e,r,!0):G&&G.running&&e.pure?(G.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function ui(e,t,n,r=st,i){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:se,context:se?se.context:null,pure:n};return G&&G.running&&(o.state=0,o.tState=r),se===null||se!==Pu&&(G&&G.running&&se.pure?se.tOwned?se.tOwned.push(o):se.tOwned=[o]:se.owned?se.owned.push(o):se.owned=[o]),o}function Jr(e){const t=G&&G.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===dr)return ei(e);if(e.suspense&&Me(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<si);){if(t&&G.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let i=e,o=n[r+1];for(;(i=i.owner)&&i!==o;)if(G.disposed.has(i))return}if((t?e.tState:e.state)===st)zn(e);else if((t?e.tState:e.state)===dr){const i=ke;ke=null,He(()=>ei(e,n[0]),!1),ke=i}}}function He(e,t){if(ke)return e();let n=!1;t||(ke=[]),De?n=!0:De=[],si++;try{const r=e();return gf(n),r}catch(r){n||(De=null),ke=null,ns(r)}}function gf(e){if(ke&&(Fu(ke),ke=null),e)return;let t;if(G){if(!G.promises.size&&!G.queue.size){const r=G.sources,i=G.disposed;De.push.apply(De,G.effects),t=G.resolve;for(const o of De)"tState"in o&&(o.state=o.tState),delete o.tState;G=null,He(()=>{for(const o of i)zt(o);for(const o of r){if(o.value=o.tValue,o.owned)for(let s=0,a=o.owned.length;s<a;s++)zt(o.owned[s]);o.tOwned&&(o.owned=o.tOwned),delete o.tValue,delete o.tOwned,o.tState=0}xa(!1)},!1)}else if(G.running){G.running=!1,G.effects.push.apply(G.effects,De),De=null,xa(!0);return}}const n=De;De=null,n.length&&He(()=>Ru(n),!1),t&&t()}function Fu(e){for(let t=0;t<e.length;t++)Jr(e[t])}function pf(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jr(r)}if(ee.context){if(ee.count){ee.effects||(ee.effects=[]),ee.effects.push(...e.slice(0,n));return}ir()}for(ee.effects&&(ee.done||!ee.count)&&(e=[...ee.effects,...e],n+=ee.effects.length,delete ee.effects),t=0;t<n;t++)Jr(e[t])}function ei(e,t){const n=G&&G.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const i=e.sources[r];if(i.sources){const o=n?i.tState:i.state;o===st?i!==t&&(!i.updatedAt||i.updatedAt<si)&&Jr(i):o===dr&&ei(i,t)}}}function Au(e){const t=G&&G.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=dr:r.state=dr,r.pure?ke.push(r):De.push(r),r.observers&&Au(r))}}function zt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const o=i.pop(),s=n.observerSlots.pop();r<i.length&&(o.sourceSlots[s]=r,i[r]=o,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)zt(e.tOwned[t]);delete e.tOwned}if(G&&G.running&&e.pure)$u(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)zt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}G&&G.running?e.tState=0:e.state=0}function $u(e,t){if(t||(e.tState=0,G.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)$u(e.owned[n])}function go(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ns(e,t=se){throw go(e)}function po(e){if(typeof e=="function"&&!e.length)return po(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=po(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function mf(e,t){return function(r){let i;return Ke(()=>i=Me(()=>(se.context={...se.context,[e]:r.value},li(()=>r.children))),void 0),i}}const yf=Symbol("fallback");function Ea(e){for(let t=0;t<e.length;t++)e[t]()}function vf(e,t,n={}){let r=[],i=[],o=[],s=0,a=t.length>1?[]:null;return W(()=>Ea(o)),()=>{let u=e()||[],l=u.length,c,d;return u[fo],Me(()=>{let h,g,p,y,w,m,v,x,C;if(l===0)s!==0&&(Ea(o),o=[],r=[],i=[],s=0,a&&(a=[])),n.fallback&&(r=[yf],i[0]=ln(O=>(o[0]=O,n.fallback())),s=1);else if(s===0){for(i=new Array(l),d=0;d<l;d++)r[d]=u[d],i[d]=ln(f);s=l}else{for(p=new Array(l),y=new Array(l),a&&(w=new Array(l)),m=0,v=Math.min(s,l);m<v&&r[m]===u[m];m++);for(v=s-1,x=l-1;v>=m&&x>=m&&r[v]===u[x];v--,x--)p[x]=i[v],y[x]=o[v],a&&(w[x]=a[v]);for(h=new Map,g=new Array(x+1),d=x;d>=m;d--)C=u[d],c=h.get(C),g[d]=c===void 0?-1:c,h.set(C,d);for(c=m;c<=v;c++)C=r[c],d=h.get(C),d!==void 0&&d!==-1?(p[d]=i[c],y[d]=o[c],a&&(w[d]=a[c]),d=g[d],h.set(C,d)):o[c]();for(d=m;d<l;d++)d in p?(i[d]=p[d],o[d]=y[d],a&&(a[d]=w[d],a[d](d))):i[d]=ln(f);i=i.slice(0,s=l),r=u.slice(0)}return i});function f(h){if(o[d]=h,a){const[g,p]=B(d);return a[d]=p,t(u[d],g)}return t(u[d])}}}function b(e,t){return Me(()=>e(t||{}))}function _r(){return!0}const mo={get(e,t,n){return t===ot?n:e.get(t)},has(e,t){return t===ot?!0:e.has(t)},set:_r,deleteProperty:_r,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:_r,deleteProperty:_r}},ownKeys(e){return e.keys()}};function Mi(e){return(e=typeof e=="function"?e():e)?e:{}}function wf(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function A(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&ot in a,e[s]=typeof a=="function"?(t=!0,K(a)):a}if(Eu&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const u=Mi(e[a])[s];if(u!==void 0)return u}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Mi(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Mi(e[a])));return[...new Set(s)]}},mo);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const u=Object.getOwnPropertyNames(a);for(let l=u.length-1;l>=0;l--){const c=u[l];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:wf.bind(n[c]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[c];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},o=Object.keys(r);for(let s=o.length-1;s>=0;s--){const a=o[s],u=r[a];u&&u.get?Object.defineProperty(i,a,u):i[a]=u?u.value:void 0}return i}function k(e,...t){if(Eu&&ot in e){const i=new Set(t.length>1?t.flat():t[0]),o=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},mo));return o.push(new Proxy({get(s){return i.has(s)?void 0:e[s]},has(s){return i.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!i.has(s))}},mo)),o}const n={},r=t.map(()=>({}));for(const i of Object.getOwnPropertyNames(e)){const o=Object.getOwnPropertyDescriptor(e,i),s=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let a=!1,u=0;for(const l of t)l.includes(i)&&(a=!0,s?r[u][i]=o.value:Object.defineProperty(r[u],i,o)),++u;a||(s?n[i]=o.value:Object.defineProperty(n,i,o))}return[...r,n]}let bf=0;function Ee(){return ee.context?ee.getNextContextId():`cl-${bf++}`}const Sf=e=>`Stale read from <${e}>.`;function nt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return K(vf(()=>e.each,e.children,t||void 0))}function Se(e){const t=e.keyed,n=K(()=>e.when,void 0,{equals:(r,i)=>t?r===i:!r==!i});return K(()=>{const r=n();if(r){const i=e.children;return typeof i=="function"&&i.length>0?Me(()=>i(t?r:()=>{if(!Me(n))throw Sf("Show");return e.when})):i}return e.fallback},void 0,void 0)}const xf=we();function Cf(e){let t=0,n,r,i,o,s;const[a,u]=B(!1),l=hf(),c={increment:()=>{++t===1&&u(!0)},decrement:()=>{--t===0&&u(!1)},inFallback:a,effects:[],resolved:!1},d=fr();if(ee.context&&ee.load){const g=ee.getContextId();let p=ee.load(g);if(p&&(typeof p!="object"||p.status!=="success"?i=p:ee.gather(g)),i&&i!=="$$f"){const[y,w]=B(void 0,{equals:!1});o=y,i.then(()=>{if(ee.done)return w();ee.gather(g),ir(r),w(),ir()},m=>{s=m,w()})}}const f=me(xf);f&&(n=f.register(c.inFallback));let h;return W(()=>h&&h()),b(l.Provider,{value:c,get children(){return K(()=>{if(s)throw s;if(r=ee.context,o)return o(),o=void 0;r&&i==="$$f"&&ir();const g=K(()=>e.children);return K(p=>{const y=c.inFallback(),{showContent:w=!0,showFallback:m=!0}=n?n():{};if((!y||i&&i!=="$$f")&&w)return c.resolved=!0,h&&h(),h=r=i=void 0,ff(c.effects),g();if(m)return h?p:ln(v=>(h=v,r&&(ir({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const Ef=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Rf=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Ef]),Pf=new Set(["innerHTML","textContent","innerText","children"]),If=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Mf=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Ff(e,t){const n=Mf[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Af=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),$f=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Of={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Tf(e,t,n){let r=n.length,i=t.length,o=r,s=0,a=0,u=t[i-1].nextSibling,l=null;for(;s<i||a<o;){if(t[s]===n[a]){s++,a++;continue}for(;t[i-1]===n[o-1];)i--,o--;if(i===s){const c=o<r?a?n[a-1].nextSibling:n[o-a]:u;for(;a<o;)e.insertBefore(n[a++],c)}else if(o===a)for(;s<i;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[o-1]&&n[a]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--o],c),t[i]=n[o]}else{if(!l){l=new Map;let d=a;for(;d<o;)l.set(n[d],d++)}const c=l.get(t[s]);if(c!=null)if(a<c&&c<o){let d=s,f=1,h;for(;++d<i&&d<o&&!((h=l.get(t[d]))==null||h!==c+f);)f++;if(f>c-a){const g=t[s];for(;a<c;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Ra="_$DX_DELEGATE";function Df(e,t,n,r={}){let i;return ln(o=>{i=o,t===document?e():fe(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function he(e,t,n){let r;const i=()=>{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},o=()=>(r||(r=i())).cloneNode(!0);return o.cloneNode=o,o}function Ou(e,t=window.document){const n=t[Ra]||(t[Ra]=new Set);for(let r=0,i=e.length;r<i;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Gf))}}function Nn(e,t,n){gn(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Lf(e,t,n,r){gn(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function _f(e,t,n){gn(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function Tu(e,t){gn(e)||(t==null?e.removeAttribute("class"):e.className=t)}function kf(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=o=>i.call(e,n[1],o))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Vf(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,s;for(o=0,s=i.length;o<s;o++){const a=i[o];!a||a==="undefined"||t[a]||(Pa(e,a,!1),delete n[a])}for(o=0,s=r.length;o<s;o++){const a=r[o],u=!!t[a];!a||a==="undefined"||n[a]===u||!u||(Pa(e,a,!0),n[a]=u)}return n}function Nf(e,t,n){if(!t)return n?Nn(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,o;for(o in n)t[o]==null&&r.removeProperty(o),delete n[o];for(o in t)i=t[o],i!==n[o]&&(r.setProperty(o,i),n[o]=i);return n}function at(e,t={},n,r){const i={};return r||Ke(()=>i.children=hr(e,t.children,i.children)),Ke(()=>typeof t.ref=="function"&&Kf(t.ref,e)),Ke(()=>jf(e,t,n,!0,i,!0)),i}function Kf(e,t,n){return Me(()=>e(t,n))}function fe(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return hr(e,t,r,n);Ke(i=>hr(e,t(),i,n),r)}function jf(e,t,n,r,i={},o=!1){t||(t={});for(const s in i)if(!(s in t)){if(s==="children")continue;i[s]=Ia(e,s,null,i[s],n,o,t)}for(const s in t){if(s==="children")continue;const a=t[s];i[s]=Ia(e,s,a,i[s],n,o,t)}}function Bf(e){let t,n;return!gn()||!(t=ee.registry.get(n=Hf()))?e():(ee.completed&&ee.completed.add(t),ee.registry.delete(n),t)}function gn(e){return!!ee.context&&!ee.done&&(!e||e.isConnected)}function zf(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Pa(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i<o;i++)e.classList.toggle(r[i],n)}function Ia(e,t,n,r,i,o,s){let a,u,l,c,d;if(t==="style")return Nf(e,n,r);if(t==="classList")return Vf(e,n,r);if(n===r)return r;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=Af.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(kf(e,f,n,h),h&&Ou([f]))}else if(t.slice(0,5)==="attr:")Nn(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")_f(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=Pf.has(t))||!i&&((c=Ff(t,e.tagName))||(u=Rf.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(d)t=t.slice(5),u=!0;else if(gn(e))return n;t==="class"||t==="className"?Tu(e,n):a&&!u&&!l?e[zf(t)]=n:e[c||t]=n}else{const f=i&&t.indexOf(":")>-1&&Of[t.split(":")[0]];f?Lf(e,f,t,n):Nn(e,If[t]||t,n)}return n}function Gf(e){if(ee.registry&&ee.events&&ee.events.find(([u,l])=>l===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,o=u=>Object.defineProperty(e,"target",{configurable:!0,value:u}),s=()=>{const u=t[n];if(u&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?u.call(t,l,e):u.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),ee.registry&&!ee.done&&(ee.done=_$HY.done=!0),e.composedPath){const u=e.composedPath();o(u[0]);for(let l=0;l<u.length-2&&(t=u[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===i)break}}else a();o(r)}function hr(e,t,n,r,i){const o=gn(e);if(o){!n&&(n=[...e.childNodes]);let u=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():u.push(c)}n=u}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(o||s==="number"&&(t=t.toString(),t===n))return n;if(a){let u=n[0];u&&u.nodeType===3?u.data!==t&&(u.data=t):u=document.createTextNode(t),n=yn(e,n,r,u)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(o)return n;n=yn(e,n,r)}else{if(s==="function")return Ke(()=>{let u=t();for(;typeof u=="function";)u=u();n=hr(e,u,n,r)}),()=>n;if(Array.isArray(t)){const u=[],l=n&&Array.isArray(n);if(yo(u,t,n,i))return Ke(()=>n=hr(e,u,n,r,!0)),()=>n;if(o){if(!u.length)return n;if(r===void 0)return n=[...e.childNodes];let c=u[0];if(c.parentNode!==e)return n;const d=[c];for(;(c=c.nextSibling)!==r;)d.push(c);return n=d}if(u.length===0){if(n=yn(e,n,r),a)return n}else l?n.length===0?Ma(e,u,r):Tf(e,n,u):(n&&yn(e),Ma(e,u));n=u}else if(t.nodeType){if(o&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=yn(e,n,r,t);yn(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function yo(e,t,n,r){let i=!1;for(let o=0,s=t.length;o<s;o++){let a=t[o],u=n&&n[e.length],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))i=yo(e,a,u)||i;else if(l==="function")if(r){for(;typeof a=="function";)a=a();i=yo(e,Array.isArray(a)?a:[a],Array.isArray(u)?u:[u])||i}else e.push(a),i=!0;else{const c=String(a);u&&u.nodeType===3&&u.data===c?e.push(u):e.push(document.createTextNode(c))}}return i}function Ma(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function yn(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let o=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(i!==a){const u=a.parentNode===e;!o&&!s?u?e.replaceChild(i,a):e.insertBefore(i,n):u&&a.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function Hf(){return ee.getNextContextId()}const Uf=!1,qf="http://www.w3.org/2000/svg";function Du(e,t=!1){return t?document.createElementNS(qf,e):document.createElement(e)}function rs(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=fr();let o,s=!!ee.context;return U(()=>{s&&(fr().user=s=!1),o||(o=ts(i,()=>K(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[u,l]=B(!1),c=()=>l(!0);ln(d=>fe(a,()=>u()?d():o(),null)),W(c)}else{const u=Du(e.isSVG?"g":"div",e.isSVG),l=t&&u.attachShadow?u.attachShadow({mode:"open"}):u;Object.defineProperty(u,"_$host",{get(){return n.parentNode},configurable:!0}),fe(l,o),a.appendChild(u),e.ref&&e.ref(u),W(()=>a.removeChild(u))}},void 0,{render:!s}),n}function Lu(e){const[t,n]=k(e,["component"]),r=K(()=>t.component);return K(()=>{const i=r();switch(typeof i){case"function":return Me(()=>i(n));case"string":const o=$f.has(i),s=ee.context?Bf():Du(i,o);return at(s,n,o),s}})}const _u=we(),Wf=["title","meta"],Fa=[],Aa=["name","http-equiv","content","charset","media"].concat(["property"]),$a=(e,t)=>{const n=Object.fromEntries(Object.entries(e.props).filter(([r])=>t.includes(r)).sort());return(Object.hasOwn(n,"name")||Object.hasOwn(n,"property"))&&(n.name=n.name||n.property,delete n.property),e.tag+JSON.stringify(n)};function Xf(){if(!ee.context){const n=document.head.querySelectorAll("[data-sm]");Array.prototype.forEach.call(n,r=>r.parentNode.removeChild(r))}const e=new Map;function t(n){if(n.ref)return n.ref;let r=document.querySelector(`[data-sm="${n.id}"]`);return r?(r.tagName.toLowerCase()!==n.tag&&(r.parentNode&&r.parentNode.removeChild(r),r=document.createElement(n.tag)),r.removeAttribute("data-sm")):r=document.createElement(n.tag),r}return{addTag(n){if(Wf.indexOf(n.tag)!==-1){const o=n.tag==="title"?Fa:Aa,s=$a(n,o);e.has(s)||e.set(s,[]);let a=e.get(s),u=a.length;a=[...a,n],e.set(s,a);let l=t(n);n.ref=l,at(l,n.props);let c=null;for(var r=u-1;r>=0;r--)if(a[r]!=null){c=a[r];break}return l.parentNode!=document.head&&document.head.appendChild(l),c&&c.ref&&c.ref.parentNode&&document.head.removeChild(c.ref),u}let i=t(n);return n.ref=i,at(i,n.props),i.parentNode!=document.head&&document.head.appendChild(i),-1},removeTag(n,r){const i=n.tag==="title"?Fa:Aa,o=$a(n,i);if(n.ref){const s=e.get(o);if(s){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let a=r-1;a>=0;a--)s[a]!=null&&document.head.appendChild(s[a].ref)}s[r]=null,e.set(o,s)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const Qf=e=>{const t=Xf();return b(_u.Provider,{value:t,get children(){return e.children}})},Yf=(e,t,n)=>(Zf({tag:e,props:t,setting:n,id:Ee(),get name(){return t.name||t.property}}),null);function Zf(e){const t=me(_u);if(!t)throw new Error("<MetaProvider /> should be in the tree");Ke(()=>{const n=t.addTag(e);W(()=>t.removeTag(e,n))})}const Jf=e=>Yf("title",e,{escape:!0,close:!0});function ku(){let e=new Set;function t(i){return e.add(i),()=>e.delete(i)}let n=!1;function r(i,o){if(n)return!(n=!1);const s={to:i,options:o,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of e)a.listener({...s,from:a.location,retry:u=>{u&&(n=!0),a.navigate(i,{...o,resolve:!1})}});return!s.defaultPrevented}return{subscribe:t,confirm:r}}let vo;function is(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),vo=window.history.state._depth}is();function eh(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function th(e,t){let n=!1;return()=>{const r=vo;is();const i=r==null?null:vo-r;if(n){n=!1;return}i&&t(i)?(n=!0,window.history.go(-i)):e()}}const nh=/^(?:[a-z0-9]+:)?\/\//i,rh=/^\/+|(\/)\/+$/g,Vu="http://sr";function ur(e,t=!1){const n=e.replace(rh,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function Qr(e,t,n){if(nh.test(t))return;const r=ur(e),i=n&&ur(n);let o="";return!i||t.startsWith("/")?o=r:i.toLowerCase().indexOf(r.toLowerCase())!==0?o=r+i:o=i,(o||"/")+ur(t,!o)}function ih(e,t){if(e==null)throw new Error(t);return e}function oh(e,t){return ur(e).replace(/\/*(\*.*)?$/g,"")+ur(t)}function Nu(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function sh(e,t,n){const[r,i]=e.split("/*",2),o=r.split("/").filter(Boolean),s=o.length;return a=>{const u=a.split("/").filter(Boolean),l=u.length-s;if(l<0||l>0&&i===void 0&&!t)return null;const c={path:s?"":"/",params:{}},d=f=>n===void 0?void 0:n[f];for(let f=0;f<s;f++){const h=o[f],g=h[0]===":",p=g?u[f]:u[f].toLowerCase(),y=g?h.slice(1):h.toLowerCase();if(g&&Fi(p,d(y)))c.params[y]=p;else if(g||!Fi(p,y))return null;c.path+=`/${p}`}if(i){const f=l?u.slice(-l).join("/"):"";if(Fi(f,d(i)))c.params[i]=f;else return null}return c}}function Fi(e,t){const n=r=>r===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function ah(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((i,o)=>i+(o.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function Ku(e){const t=new Map,n=fr();return new Proxy({},{get(r,i){return t.has(i)||ts(n,()=>t.set(i,K(()=>e()[i]))),t.get(i)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function lh(e,t){const n=new URLSearchParams(e);Object.entries(t).forEach(([i,o])=>{o==null||o===""||o instanceof Array&&!o.length?n.delete(i):o instanceof Array?(n.delete(i),o.forEach(s=>{n.append(i,String(s))})):n.set(i,String(o))});const r=n.toString();return r?`?${r}`:""}function ju(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const i=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)i.push(n+=t[1]),r=r.slice(t[0].length);return ju(r).reduce((o,s)=>[...o,...i.map(a=>a+s)],[])}const uh=100,Bu=we(),zu=we(),Gu=()=>ih(me(Bu),"<A> and 'use' router primitives can be only used inside a Route."),ch=()=>Gu().navigatorFactory(),dh=()=>Gu().location,fh=()=>{const e=dh(),t=ch(),n=(r,i)=>{const o=Me(()=>lh(e.search,r)+e.hash);t(o,{scroll:!1,resolve:!1,...i})};return[e.query,n]};function hh(e,t=""){const{component:n,preload:r,load:i,children:o,info:s}=e,a=!o||Array.isArray(o)&&!o.length,u={key:e,component:n,preload:r||i,info:s};return Hu(e.path).reduce((l,c)=>{for(const d of ju(c)){const f=oh(t,d);let h=a?f:f.split("/*",1)[0];h=h.split("/").map(g=>g.startsWith(":")||g.startsWith("*")?g:encodeURIComponent(g)).join("/"),l.push({...u,originalPath:c,pattern:h,matcher:sh(h,!a,e.matchFilters)})}return l},[])}function gh(e,t=0){return{routes:e,score:ah(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let i=e.length-1;i>=0;i--){const o=e[i],s=o.matcher(n);if(!s)return null;r.unshift({...s,route:o})}return r}}}function Hu(e){return Array.isArray(e)?e:[e]}function Uu(e,t="",n=[],r=[]){const i=Hu(e);for(let o=0,s=i.length;o<s;o++){const a=i[o];if(a&&typeof a=="object"){a.hasOwnProperty("path")||(a.path="");const u=hh(a,t);for(const l of u){n.push(l);const c=Array.isArray(a.children)&&a.children.length===0;if(a.children&&!c)Uu(a.children,l.pattern,n,r);else{const d=gh([...n],r.length);r.push(d)}n.pop()}}}return n.length?r:r.sort((o,s)=>s.score-o.score)}function Ai(e,t){for(let n=0,r=e.length;n<r;n++){const i=e[n].matcher(t);if(i)return i}return[]}function ph(e,t,n){const r=new URL(Vu),i=K(c=>{const d=e();try{return new URL(d,r)}catch{return console.error(`Invalid path ${d}`),c}},r,{equals:(c,d)=>c.href===d.href}),o=K(()=>i().pathname),s=K(()=>i().search,!0),a=K(()=>i().hash),u=()=>"",l=Ce(s,()=>Nu(i()));return{get pathname(){return o()},get search(){return s()},get hash(){return a()},get state(){return t()},get key(){return u()},query:n?n(l):Ku(l)}}let Zt;function mh(){return Zt}function yh(e,t,n,r={}){const{signal:[i,o],utils:s={}}=e,a=s.parsePath||(P=>P),u=s.renderPath||(P=>P),l=s.beforeLeave||ku(),c=Qr("",r.base||"");if(c===void 0)throw new Error(`${c} is not a valid base path`);c&&!i().value&&o({value:c,replace:!0,scroll:!1});const[d,f]=B(!1);let h;const g=(P,R)=>{R.value===p()&&R.state===w()||(h===void 0&&f(!0),Zt=P,h=R,df(()=>{h===R&&(y(h.value),m(h.state),C[1]([]))}).finally(()=>{h===R&&ai(()=>{Zt=void 0,P==="navigate"&&z(h),f(!1),h=void 0})}))},[p,y]=B(i().value),[w,m]=B(i().state),v=ph(p,w,s.queryWrapper),x=[],C=B([]),O=K(()=>typeof r.transformUrl=="function"?Ai(t(),r.transformUrl(v.pathname)):Ai(t(),v.pathname)),L=()=>{const P=O(),R={};for(let S=0;S<P.length;S++)Object.assign(R,P[S].params);return R},_=s.paramsWrapper?s.paramsWrapper(L,t):Ku(L),T={pattern:c,path:()=>c,outlet:()=>null,resolvePath(P){return Qr(c,P)}};return Ke(Ce(i,P=>g("native",P),{defer:!0})),{base:T,location:v,params:_,isRouting:d,renderPath:u,parsePath:a,navigatorFactory:N,matches:O,beforeLeave:l,preloadRoute:oe,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:C};function V(P,R,S){Me(()=>{if(typeof R=="number"){R&&(s.go?s.go(R):console.warn("Router integration does not support relative routing"));return}const I=!R||R[0]==="?",{replace:M,resolve:F,scroll:D,state:j}={replace:!1,resolve:!I,scroll:!0,...S},H=F?P.resolvePath(R):Qr(I&&v.pathname||"",R);if(H===void 0)throw new Error(`Path '${R}' is not a routable path`);if(x.length>=uh)throw new Error("Too many redirects");const X=p();(H!==X||j!==w())&&(Uf||l.confirm(H,S)&&(x.push({value:X,replace:M,scroll:D,state:w()}),g("navigate",{value:H,state:j})))})}function N(P){return P=P||me(zu)||T,(R,S)=>V(P,R,S)}function z(P){const R=x[0];R&&(o({...P,replace:R.replace,scroll:R.scroll}),x.length=0)}function oe(P,R){const S=Ai(t(),P.pathname),I=Zt;Zt="preload";for(let M in S){const{route:F,params:D}=S[M];F.component&&F.component.preload&&F.component.preload();const{preload:j}=F;R&&j&&ts(n(),()=>j({params:D,location:{pathname:P.pathname,search:P.search,hash:P.hash,query:Nu(P),state:null,key:""},intent:"preload"}))}Zt=I}}function vh(e,t,n,r){const{base:i,location:o,params:s}=e,{pattern:a,component:u,preload:l}=r().route,c=K(()=>r().path);u&&u.preload&&u.preload();const d=l?l({params:s,location:o,intent:Zt||"initial"}):void 0;return{parent:t,pattern:a,path:c,outlet:()=>u?b(u,{params:s,location:o,data:d,get children(){return n()}}):n(),resolvePath(h){return Qr(i.path(),h,c())}}}const wh=e=>t=>{const{base:n}=t,r=li(()=>t.children),i=K(()=>Uu(r(),t.base||""));let o;const s=yh(e,i,()=>o,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(s),b(Bu.Provider,{value:s,get children(){return b(bh,{routerState:s,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[K(()=>(o=fr())&&null),b(Sh,{routerState:s,get branches(){return i()}})]}})}})};function bh(e){const t=e.routerState.location,n=e.routerState.params,r=K(()=>e.preload&&Me(()=>{e.preload({params:n,location:t,intent:mh()||"initial"})}));return b(Se,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:i=>b(i,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function Sh(e){const t=[];let n;const r=K(Ce(e.routerState.matches,(i,o,s)=>{let a=o&&i.length===o.length;const u=[];for(let l=0,c=i.length;l<c;l++){const d=o&&o[l],f=i[l];s&&d&&f.route.key===d.route.key?u[l]=s[l]:(a=!1,t[l]&&t[l](),ln(h=>{t[l]=h,u[l]=vh(e.routerState,u[l-1]||e.routerState.base,Oa(()=>r()[l+1]),()=>e.routerState.matches()[l])}))}return t.splice(i.length).forEach(l=>l()),s&&a?s:(n=u[0],u)}));return Oa(()=>r()&&n)()}const Oa=e=>()=>b(Se,{get when(){return e()},keyed:!0,children:t=>b(zu.Provider,{value:t,get children(){return t.outlet()}})}),xh=e=>{const t=li(()=>e.children);return A(e,{get children(){return t()}})};function Ch([e,t],n,r){return[e,i=>t(r(i))]}function Eh(e){let t=!1;const n=i=>typeof i=="string"?{value:i}:i,r=Ch(B(n(e.get()),{equals:(i,o)=>i.value===o.value&&i.state===o.state}),void 0,i=>(!t&&e.set(i),ee.registry&&!ee.done&&(ee.done=!0),i));return e.init&&W(e.init((i=e.get())=>{t=!0,r[1](n(i)),t=!1})),wh({signal:r,create:e.create,utils:e.utils})}function Rh(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Ph(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Ih=new Map;function Mh(e=!0,t=!1,n="/_server",r){return i=>{const o=i.base.path(),s=i.navigatorFactory(i.base);let a,u;function l(p){return p.namespaceURI==="http://www.w3.org/2000/svg"}function c(p){if(p.defaultPrevented||p.button!==0||p.metaKey||p.altKey||p.ctrlKey||p.shiftKey)return;const y=p.composedPath().find(O=>O instanceof Node&&O.nodeName.toUpperCase()==="A");if(!y||t&&!y.hasAttribute("link"))return;const w=l(y),m=w?y.href.baseVal:y.href;if((w?y.target.baseVal:y.target)||!m&&!y.hasAttribute("state"))return;const x=(y.getAttribute("rel")||"").split(/\s+/);if(y.hasAttribute("download")||x&&x.includes("external"))return;const C=w?new URL(m,document.baseURI):new URL(m);if(!(C.origin!==window.location.origin||o&&C.pathname&&!C.pathname.toLowerCase().startsWith(o.toLowerCase())))return[y,C]}function d(p){const y=c(p);if(!y)return;const[w,m]=y,v=i.parsePath(m.pathname+m.search+m.hash),x=w.getAttribute("state");p.preventDefault(),s(v,{resolve:!1,replace:w.hasAttribute("replace"),scroll:!w.hasAttribute("noscroll"),state:x?JSON.parse(x):void 0})}function f(p){const y=c(p);if(!y)return;const[w,m]=y;r&&(m.pathname=r(m.pathname)),i.preloadRoute(m,w.getAttribute("preload")!=="false")}function h(p){clearTimeout(a);const y=c(p);if(!y)return u=null;const[w,m]=y;u!==w&&(r&&(m.pathname=r(m.pathname)),a=setTimeout(()=>{i.preloadRoute(m,w.getAttribute("preload")!=="false"),u=w},20))}function g(p){if(p.defaultPrevented)return;let y=p.submitter&&p.submitter.hasAttribute("formaction")?p.submitter.getAttribute("formaction"):p.target.getAttribute("action");if(!y)return;if(!y.startsWith("https://action/")){const m=new URL(y,Vu);if(y=i.parsePath(m.pathname+m.search),!y.startsWith(n))return}if(p.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const w=Ih.get(y);if(w){p.preventDefault();const m=new FormData(p.target,p.submitter);w.call({r:i,f:p.target},p.target.enctype==="multipart/form-data"?m:new URLSearchParams(m))}}Ou(["click","submit"]),document.addEventListener("click",d),e&&(document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("focusin",f,{passive:!0}),document.addEventListener("touchstart",f,{passive:!0})),document.addEventListener("submit",g),W(()=>{document.removeEventListener("click",d),e&&(document.removeEventListener("mousemove",h),document.removeEventListener("focusin",f),document.removeEventListener("touchstart",f)),document.removeEventListener("submit",g)})}}function Fh(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,i=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:i}},n=ku();return Eh({get:t,set({value:r,replace:i,scroll:o,state:s}){i?window.history.replaceState(eh(s),"",r):window.history.pushState(s,"",r),Ph(decodeURIComponent(window.location.hash.slice(1)),o),is()},init:r=>Rh(window,"popstate",th(r,i=>{if(i&&i<0)return!n.confirm(i);{const o=t();return!n.confirm(o.value,{state:o.state})}})),create:Mh(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const wo=Symbol("store-raw"),xn=Symbol("store-node"),Rt=Symbol("store-has"),qu=Symbol("store-self");function Wu(e){let t=e[ot];if(!t&&(Object.defineProperty(e,ot,{value:t=new Proxy(e,Oh)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function Gt(e){let t;return e!=null&&typeof e=="object"&&(e[ot]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function cn(e,t=new Set){let n,r,i,o;if(n=e!=null&&e[wo])return n;if(!Gt(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)i=e[s],(r=cn(i,t))!==i&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let u=0,l=s.length;u<l;u++)o=s[u],!a[o].get&&(i=e[o],(r=cn(i,t))!==i&&(e[o]=r))}return e}function ti(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function gr(e,t,n){if(e[t])return e[t];const[r,i]=B(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function Ah(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===ot||t===xn||(delete n.value,delete n.writable,n.get=()=>e[ot][t]),n}function Xu(e){ho()&&gr(ti(e,xn),qu)()}function $h(e){return Xu(e),Reflect.ownKeys(e)}const Oh={get(e,t,n){if(t===wo)return e;if(t===ot)return n;if(t===fo)return Xu(e),n;const r=ti(e,xn),i=r[t];let o=i?i():e[t];if(t===xn||t===Rt||t==="__proto__")return o;if(!i){const s=Object.getOwnPropertyDescriptor(e,t);ho()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(o=gr(r,t,o)())}return Gt(o)?Wu(o):o},has(e,t){return t===wo||t===ot||t===fo||t===xn||t===Rt||t==="__proto__"?!0:(ho()&&gr(ti(e,Rt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:$h,getOwnPropertyDescriptor:Ah};function Qe(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],o=e.length;n===void 0?(delete e[t],e[Rt]&&e[Rt][t]&&i!==void 0&&e[Rt][t].$()):(e[t]=n,e[Rt]&&e[Rt][t]&&i===void 0&&e[Rt][t].$());let s=ti(e,xn),a;if((a=gr(s,t,i))&&a.$(()=>n),Array.isArray(e)&&e.length!==o){for(let u=e.length;u<o;u++)(a=s[u])&&a.$();(a=gr(s,"length",o))&&a.$(e.length)}(a=s[qu])&&a.$()}function Qu(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];Qe(e,i,t[i])}}function Th(e,t){if(typeof t=="function"&&(t=t(e)),t=cn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const i=t[n];e[n]!==i&&Qe(e,n,i)}Qe(e,"length",r)}else Qu(e,t)}function or(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let u=0;u<r.length;u++)or(e,[r[u]].concat(t),n);return}else if(a&&s==="function"){for(let u=0;u<e.length;u++)r(e[u],u)&&or(e,[u].concat(t),n);return}else if(a&&s==="object"){const{from:u=0,to:l=e.length-1,by:c=1}=r;for(let d=u;d<=l;d+=c)or(e,[d].concat(t),n);return}else if(t.length>1){or(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let o=t[0];typeof o=="function"&&(o=o(i,n),o===i)||r===void 0&&o==null||(o=cn(o),r===void 0||Gt(i)&&Gt(o)&&!Array.isArray(o)?Qu(i,o):Qe(e,r,o))}function ci(...[e,t]){const n=cn(e||{}),r=Array.isArray(n),i=Wu(n);function o(...s){ai(()=>{r&&s.length===1?Th(n,s[0]):or(n,s)})}return[i,o]}const bo=Symbol("store-root");function wn(e,t,n,r,i){const o=t[n];if(e===o)return;const s=Array.isArray(e);if(n!==bo&&(!Gt(e)||!Gt(o)||s!==Array.isArray(o)||i&&e[i]!==o[i])){Qe(t,n,e);return}if(s){if(e.length&&o.length&&(!r||i&&e[0]&&e[0][i]!=null)){let l,c,d,f,h,g,p,y;for(d=0,f=Math.min(o.length,e.length);d<f&&(o[d]===e[d]||i&&o[d]&&e[d]&&o[d][i]===e[d][i]);d++)wn(e[d],o,d,r,i);const w=new Array(e.length),m=new Map;for(f=o.length-1,h=e.length-1;f>=d&&h>=d&&(o[f]===e[h]||i&&o[d]&&e[d]&&o[f][i]===e[h][i]);f--,h--)w[h]=o[f];if(d>h||d>f){for(c=d;c<=h;c++)Qe(o,c,e[c]);for(;c<e.length;c++)Qe(o,c,w[c]),wn(e[c],o,c,r,i);o.length>e.length&&Qe(o,"length",e.length);return}for(p=new Array(h+1),c=h;c>=d;c--)g=e[c],y=i&&g?g[i]:g,l=m.get(y),p[c]=l===void 0?-1:l,m.set(y,c);for(l=d;l<=f;l++)g=o[l],y=i&&g?g[i]:g,c=m.get(y),c!==void 0&&c!==-1&&(w[c]=o[l],c=p[c],m.set(y,c));for(c=d;c<e.length;c++)c in w?(Qe(o,c,w[c]),wn(e[c],o,c,r,i)):Qe(o,c,e[c])}else for(let l=0,c=e.length;l<c;l++)wn(e[l],o,l,r,i);o.length>e.length&&Qe(o,"length",e.length);return}const a=Object.keys(e);for(let l=0,c=a.length;l<c;l++)wn(e[a[l]],o,a[l],r,i);const u=Object.keys(o);for(let l=0,c=u.length;l<c;l++)e[u[l]]===void 0&&Qe(o,u[l],void 0)}function Yu(e,t={}){const{merge:n,key:r="id"}=t,i=cn(e);return o=>{if(!Gt(o)||!Gt(i))return i;const s=wn(i,{[bo]:o},bo,n,r);return s===void 0?o:s}}const Dh="/assets/logo-BYNFyja1.png";var Lh=he('<main class="w-full space-y-2.5"><div class="flex flex-row items-center gap-1"><img alt="Hot Updater Console"class="w-12 h-12"><a href=https://github.com/gronxb/hot-updater target=_blank class="text-2xl font-light"rel=noreferrer>Hot Updater Console');function _h({children:e}){return(()=>{var t=Lh(),n=t.firstChild,r=n.firstChild;return Nn(r,"src",Dh),fe(t,e,null),t})()}var Ir=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Kn=typeof window>"u"||"Deno"in globalThis;function Ye(){}function kh(e,t){return typeof e=="function"?e(t):e}function So(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Cn(e,t){return typeof e=="function"?e(t):e}function rt(e,t){return typeof e=="function"?e(t):e}function Ta(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==os(s,t.options))return!1}else if(!mr(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function Da(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(pr(t.options.mutationKey)!==pr(o))return!1}else if(!mr(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function os(e,t){return((t==null?void 0:t.queryKeyHashFn)||pr)(e)}function pr(e){return JSON.stringify(e,(t,n)=>Co(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function mr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!mr(e[n],t[n])):!1}function Ju(e,t){if(e===t)return e;const n=La(e)&&La(t);if(n||Co(e)&&Co(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let u=0;for(let l=0;l<s;l++){const c=n?l:o[l];(!n&&r.includes(c)||n)&&e[c]===void 0&&t[c]===void 0?(a[c]=void 0,u++):(a[c]=Ju(e[c],t[c]),a[c]===e[c]&&e[c]!==void 0&&u++)}return i===s&&u===i?e:a}return t}function xo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function La(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Co(e){if(!_a(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_a(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _a(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vh(e){return new Promise(t=>{setTimeout(t,e)})}function Eo(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ju(e,t):t}function Nh(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Kh(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ss=Symbol();function ec(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ss?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Jt,Lt,Pn,pu,jh=(pu=class extends Ir{constructor(){super();J(this,Jt);J(this,Lt);J(this,Pn);q(this,Pn,t=>{if(!Kn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){E(this,Lt)||this.setEventListener(E(this,Pn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Lt))==null||t.call(this),q(this,Lt,void 0))}setEventListener(t){var n;q(this,Pn,t),(n=E(this,Lt))==null||n.call(this),q(this,Lt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,Jt)!==t&&(q(this,Jt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,Jt)=="boolean"?E(this,Jt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jt=new WeakMap,Lt=new WeakMap,Pn=new WeakMap,pu),as=new jh,In,_t,Mn,mu,Bh=(mu=class extends Ir{constructor(){super();J(this,In,!0);J(this,_t);J(this,Mn);q(this,Mn,t=>{if(!Kn&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){E(this,_t)||this.setEventListener(E(this,Mn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,_t))==null||t.call(this),q(this,_t,void 0))}setEventListener(t){var n;q(this,Mn,t),(n=E(this,_t))==null||n.call(this),q(this,_t,t(this.setOnline.bind(this)))}setOnline(t){E(this,In)!==t&&(q(this,In,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return E(this,In)}},In=new WeakMap,_t=new WeakMap,Mn=new WeakMap,mu),ni=new Bh;function Ro(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function zh(e){return Math.min(1e3*2**e,3e4)}function tc(e){return(e??"online")==="online"?ni.isOnline():!0}var nc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $i(e){return e instanceof nc}function rc(e){let t=!1,n=0,r=!1,i;const o=Ro(),s=p=>{var y;r||(f(new nc(p)),(y=e.abort)==null||y.call(e))},a=()=>{t=!0},u=()=>{t=!1},l=()=>as.isFocused()&&(e.networkMode==="always"||ni.isOnline())&&e.canRun(),c=()=>tc(e.networkMode)&&e.canRun(),d=p=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,p),i==null||i(),o.resolve(p))},f=p=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,p),i==null||i(),o.reject(p))},h=()=>new Promise(p=>{var y;i=w=>{(r||l())&&p(w)},(y=e.onPause)==null||y.call(e)}).then(()=>{var p;i=void 0,r||(p=e.onContinue)==null||p.call(e)}),g=()=>{if(r)return;let p;const y=n===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(w){p=Promise.reject(w)}Promise.resolve(p).then(d).catch(w=>{var O;if(r)return;const m=e.retry??(Kn?0:3),v=e.retryDelay??zh,x=typeof v=="function"?v(n,w):v,C=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,w);if(t||!C){f(w);return}n++,(O=e.onFail)==null||O.call(e,n,w),Vh(x).then(()=>l()?void 0:h()).then(()=>{t?f(w):g()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:a,continueRetry:u,canStart:c,start:()=>(c()?g():h().then(g),o)}}function Gh(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(u=>{n(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||s()}return u},batchCalls:a=>(...u)=>{o(()=>{a(...u)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Le=Gh(),en,yu,ic=(yu=class{constructor(){J(this,en)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),So(this.gcTime)&&q(this,en,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kn?1/0:5*60*1e3))}clearGcTimeout(){E(this,en)&&(clearTimeout(E(this,en)),q(this,en,void 0))}},en=new WeakMap,yu),Fn,An,Xe,tn,Oe,Cr,nn,et,Ct,vu,Hh=(vu=class extends ic{constructor(t){super();J(this,et);J(this,Fn);J(this,An);J(this,Xe);J(this,tn);J(this,Oe);J(this,Cr);J(this,nn);q(this,nn,!1),q(this,Cr,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,tn,t.client),q(this,Xe,E(this,tn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Fn,Uh(this.options)),this.state=t.state??E(this,Fn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=E(this,Oe))==null?void 0:t.promise}setOptions(t){this.options={...E(this,Cr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Xe).remove(this)}setData(t,n){const r=Eo(this.state.data,t,this.options);return ue(this,et,Ct).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ue(this,et,Ct).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=E(this,Oe))==null?void 0:r.promise;return(i=E(this,Oe))==null||i.cancel(t),n?n.then(Ye).catch(Ye):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,Fn))}isActive(){return this.observers.some(t=>rt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ss||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Zu(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,Oe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,Oe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Xe).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(E(this,Oe)&&(E(this,nn)?E(this,Oe).cancel({revert:!0}):E(this,Oe).cancelRetry()),this.scheduleGc()),E(this,Xe).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,et,Ct).call(this,{type:"invalidate"})}fetch(t,n){var u,l,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(E(this,Oe))return E(this,Oe).continueRetry(),E(this,Oe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(q(this,nn,!0),r.signal)})},o=()=>{const d=ec(this.options,n),f={client:E(this,tn),queryKey:this.queryKey,meta:this.meta};return i(f),q(this,nn,!1),this.options.persister?this.options.persister(d,f,this):d(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,tn),state:this.state,fetchFn:o};i(s),(u=this.options.behavior)==null||u.onFetch(s,this),q(this,An,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=s.fetchOptions)==null?void 0:l.meta))&&ue(this,et,Ct).call(this,{type:"fetch",meta:(c=s.fetchOptions)==null?void 0:c.meta});const a=d=>{var f,h,g,p;$i(d)&&d.silent||ue(this,et,Ct).call(this,{type:"error",error:d}),$i(d)||((h=(f=E(this,Xe).config).onError)==null||h.call(f,d,this),(p=(g=E(this,Xe).config).onSettled)==null||p.call(g,this.state.data,d,this)),this.scheduleGc()};return q(this,Oe,rc({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,g,p;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){a(y);return}(h=(f=E(this,Xe).config).onSuccess)==null||h.call(f,d,this),(p=(g=E(this,Xe).config).onSettled)==null||p.call(g,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{ue(this,et,Ct).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{ue(this,et,Ct).call(this,{type:"pause"})},onContinue:()=>{ue(this,et,Ct).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),E(this,Oe).start()}},Fn=new WeakMap,An=new WeakMap,Xe=new WeakMap,tn=new WeakMap,Oe=new WeakMap,Cr=new WeakMap,nn=new WeakMap,et=new WeakSet,Ct=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...oc(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return $i(i)&&i.revert&&E(this,An)?{...E(this,An),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Le.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),E(this,Xe).notify({query:this,type:"updated",action:t})})},vu);function oc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Uh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ct,wu,qh=(wu=class extends Ir{constructor(t={}){super();J(this,ct);this.config=t,q(this,ct,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??os(i,n);let s=this.get(o);return s||(s=new Hh({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){E(this,ct).has(t.queryHash)||(E(this,ct).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=E(this,ct).get(t.queryHash);n&&(t.destroy(),n===t&&E(this,ct).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Le.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,ct).get(t)}getAll(){return[...E(this,ct).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ta(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ta(t,r)):n}notify(t){Le.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Le.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Le.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ct=new WeakMap,wu),dt,Ve,rn,ft,Dt,bu,Wh=(bu=class extends ic{constructor(t){super();J(this,ft);J(this,dt);J(this,Ve);J(this,rn);this.mutationId=t.mutationId,q(this,Ve,t.mutationCache),q(this,dt,[]),this.state=t.state||Xh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,dt).includes(t)||(E(this,dt).push(t),this.clearGcTimeout(),E(this,Ve).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,dt,E(this,dt).filter(n=>n!==t)),this.scheduleGc(),E(this,Ve).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,dt).length||(this.state.status==="pending"?this.scheduleGc():E(this,Ve).remove(this))}continue(){var t;return((t=E(this,rn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,u,l,c,d,f,h,g,p,y,w,m,v,x,C,O,L;q(this,rn,rc({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,T)=>{ue(this,ft,Dt).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{ue(this,ft,Dt).call(this,{type:"pause"})},onContinue:()=>{ue(this,ft,Dt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,Ve).canRun(this)}));const n=this.state.status==="pending",r=!E(this,rn).canStart();try{if(!n){ue(this,ft,Dt).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=E(this,Ve).config).onMutate)==null?void 0:o.call(i,t,this));const T=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));T!==this.state.context&&ue(this,ft,Dt).call(this,{type:"pending",context:T,variables:t,isPaused:r})}const _=await E(this,rn).start();return await((l=(u=E(this,Ve).config).onSuccess)==null?void 0:l.call(u,_,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,_,t,this.state.context)),await((h=(f=E(this,Ve).config).onSettled)==null?void 0:h.call(f,_,null,this.state.variables,this.state.context,this)),await((p=(g=this.options).onSettled)==null?void 0:p.call(g,_,null,t,this.state.context)),ue(this,ft,Dt).call(this,{type:"success",data:_}),_}catch(_){try{throw await((w=(y=E(this,Ve).config).onError)==null?void 0:w.call(y,_,t,this.state.context,this)),await((v=(m=this.options).onError)==null?void 0:v.call(m,_,t,this.state.context)),await((C=(x=E(this,Ve).config).onSettled)==null?void 0:C.call(x,void 0,_,this.state.variables,this.state.context,this)),await((L=(O=this.options).onSettled)==null?void 0:L.call(O,void 0,_,t,this.state.context)),_}finally{ue(this,ft,Dt).call(this,{type:"error",error:_})}}finally{E(this,Ve).runNext(this)}}},dt=new WeakMap,Ve=new WeakMap,rn=new WeakMap,ft=new WeakSet,Dt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Le.batch(()=>{E(this,dt).forEach(r=>{r.onMutationUpdate(t)}),E(this,Ve).notify({mutation:this,type:"updated",action:t})})},bu);function Xh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It,tt,Er,Su,Qh=(Su=class extends Ir{constructor(t={}){super();J(this,It);J(this,tt);J(this,Er);this.config=t,q(this,It,new Set),q(this,tt,new Map),q(this,Er,0)}build(t,n,r){const i=new Wh({mutationCache:this,mutationId:++Lr(this,Er)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){E(this,It).add(t);const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n);r?r.push(t):E(this,tt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,It).delete(t)){const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&E(this,tt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=kr(t);if(typeof n=="string"){const i=(r=E(this,tt).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Le.batch(()=>{E(this,It).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,It).clear(),E(this,tt).clear()})}getAll(){return Array.from(E(this,It))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Da(n,r))}findAll(t={}){return this.getAll().filter(n=>Da(t,n))}notify(t){Le.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Le.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ye))))}},It=new WeakMap,tt=new WeakMap,Er=new WeakMap,Su);function kr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function ka(e){return{onFetch:(t,n)=>{var c,d,f,h,g;const r=t.options,i=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],s=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const l=async()=>{let p=!1;const y=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},w=ec(t.options,t.fetchOptions),m=async(v,x,C)=>{if(p)return Promise.reject();if(x==null&&v.pages.length)return Promise.resolve(v);const O={client:t.client,queryKey:t.queryKey,pageParam:x,direction:C?"backward":"forward",meta:t.options.meta};y(O);const L=await w(O),{maxPages:_}=t.options,T=C?Kh:Nh;return{pages:T(v.pages,L,_),pageParams:T(v.pageParams,x,_)}};if(i&&o.length){const v=i==="backward",x=v?Yh:Va,C={pages:o,pageParams:s},O=x(r,C);a=await m(C,O,v)}else{const v=e??o.length;do{const x=u===0?s[0]??r.initialPageParam:Va(r,a);if(u>0&&x==null)break;a=await m(a,x),u++}while(u<v)}return a};t.options.persister?t.fetchFn=()=>{var p,y;return(y=(p=t.options).persister)==null?void 0:y.call(p,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function Va(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Yh(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var xe,kt,Vt,$n,On,Nt,Tn,Dn,xu,Zh=(xu=class{constructor(t={}){J(this,xe);J(this,kt);J(this,Vt);J(this,$n);J(this,On);J(this,Nt);J(this,Tn);J(this,Dn);q(this,xe,t.queryCache||new qh),q(this,kt,t.mutationCache||new Qh),q(this,Vt,t.defaultOptions||{}),q(this,$n,new Map),q(this,On,new Map),q(this,Nt,0)}mount(){Lr(this,Nt)._++,E(this,Nt)===1&&(q(this,Tn,as.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,xe).onFocus())})),q(this,Dn,ni.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,xe).onOnline())})))}unmount(){var t,n;Lr(this,Nt)._--,E(this,Nt)===0&&((t=E(this,Tn))==null||t.call(this),q(this,Tn,void 0),(n=E(this,Dn))==null||n.call(this),q(this,Dn,void 0))}isFetching(t){return E(this,xe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return E(this,kt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,xe).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=E(this,xe).build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Cn(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(t){return E(this,xe).findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.defaultQueryOptions({queryKey:t}),o=E(this,xe).get(i.queryHash),s=o==null?void 0:o.state.data,a=kh(n,s);if(a!==void 0)return E(this,xe).build(this,i).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Le.batch(()=>E(this,xe).findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,xe).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=E(this,xe);Le.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=E(this,xe),i={type:"active",...t};return Le.batch(()=>(r.findAll(t).forEach(o=>{o.reset()}),this.refetchQueries(i,n)))}cancelQueries(t,n={}){const r={revert:!0,...n},i=Le.batch(()=>E(this,xe).findAll(t).map(o=>o.cancel(r)));return Promise.all(i).then(Ye).catch(Ye)}invalidateQueries(t,n={}){return Le.batch(()=>{if(E(this,xe).findAll(t).forEach(i=>{i.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const r={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(r,n)})}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=Le.batch(()=>E(this,xe).findAll(t).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,r);return r.throwOnError||(s=s.catch(Ye)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(i).then(Ye)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=E(this,xe).build(this,n);return r.isStaleByTime(Cn(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ye).catch(Ye)}fetchInfiniteQuery(t){return t.behavior=ka(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ye).catch(Ye)}ensureInfiniteQueryData(t){return t.behavior=ka(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return ni.isOnline()?E(this,kt).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,xe)}getMutationCache(){return E(this,kt)}getDefaultOptions(){return E(this,Vt)}setDefaultOptions(t){q(this,Vt,t)}setQueryDefaults(t,n){E(this,$n).set(pr(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...E(this,$n).values()],r={};return n.forEach(i=>{mr(t,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(t,n){E(this,On).set(pr(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...E(this,On).values()];let r={};return n.forEach(i=>{mr(t,i.mutationKey)&&(r={...r,...i.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...E(this,Vt).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=os(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===ss&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...E(this,Vt).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){E(this,xe).clear(),E(this,kt).clear()}},xe=new WeakMap,kt=new WeakMap,Vt=new WeakMap,$n=new WeakMap,On=new WeakMap,Nt=new WeakMap,Tn=new WeakMap,Dn=new WeakMap,xu),je,ce,Rr,Ne,on,Ln,Kt,ht,Pr,_n,kn,sn,an,jt,Vn,pe,sr,Po,Io,Mo,Fo,Ao,$o,Oo,sc,Cu,Jh=(Cu=class extends Ir{constructor(t,n){super();J(this,pe);J(this,je);J(this,ce);J(this,Rr);J(this,Ne);J(this,on);J(this,Ln);J(this,Kt);J(this,ht);J(this,Pr);J(this,_n);J(this,kn);J(this,sn);J(this,an);J(this,jt);J(this,Vn,new Set);this.options=n,q(this,je,t),q(this,ht,null),q(this,Kt,Ro()),this.options.experimental_prefetchInRender||E(this,Kt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,ce).addObserver(this),Na(E(this,ce),this.options)?ue(this,pe,sr).call(this):this.updateResult(),ue(this,pe,Fo).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return To(E(this,ce),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return To(E(this,ce),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,pe,Ao).call(this),ue(this,pe,$o).call(this),E(this,ce).removeObserver(this)}setOptions(t,n){const r=this.options,i=E(this,ce);if(this.options=E(this,je).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rt(this.options.enabled,E(this,ce))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,pe,Oo).call(this),E(this,ce).setOptions(this.options),r._defaulted&&!xo(this.options,r)&&E(this,je).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,ce),observer:this});const o=this.hasListeners();o&&Ka(E(this,ce),i,this.options,r)&&ue(this,pe,sr).call(this),this.updateResult(n),o&&(E(this,ce)!==i||rt(this.options.enabled,E(this,ce))!==rt(r.enabled,E(this,ce))||Cn(this.options.staleTime,E(this,ce))!==Cn(r.staleTime,E(this,ce)))&&ue(this,pe,Po).call(this);const s=ue(this,pe,Io).call(this);o&&(E(this,ce)!==i||rt(this.options.enabled,E(this,ce))!==rt(r.enabled,E(this,ce))||s!==E(this,jt))&&ue(this,pe,Mo).call(this,s)}getOptimisticResult(t){const n=E(this,je).getQueryCache().build(E(this,je),t),r=this.createResult(n,t);return tg(this,r)&&(q(this,Ne,r),q(this,Ln,this.options),q(this,on,E(this,ce).state)),r}getCurrentResult(){return E(this,Ne)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){E(this,Vn).add(t)}getCurrentQuery(){return E(this,ce)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,je).defaultQueryOptions(t),r=E(this,je).getQueryCache().build(E(this,je),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,pe,sr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Ne)))}createResult(t,n){var _;const r=E(this,ce),i=this.options,o=E(this,Ne),s=E(this,on),a=E(this,Ln),l=t!==r?t.state:E(this,Rr),{state:c}=t;let d={...c},f=!1,h;if(n._optimisticResults){const T=this.hasListeners(),V=!T&&Na(t,n),N=T&&Ka(t,r,n,i);(V||N)&&(d={...d,...oc(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:y}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===E(this,Pr))h=E(this,_n);else try{q(this,Pr,n.select),h=n.select(d.data),h=Eo(o==null?void 0:o.data,h,n),q(this,_n,h),q(this,ht,null)}catch(T){q(this,ht,T)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&y==="pending"){let T;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=o.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((_=E(this,kn))==null?void 0:_.state.data,E(this,kn)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),q(this,ht,null)}catch(V){q(this,ht,V)}T!==void 0&&(y="success",h=Eo(o==null?void 0:o.data,T,n),f=!0)}E(this,ht)&&(g=E(this,ht),h=E(this,_n),p=Date.now(),y="error");const w=d.fetchStatus==="fetching",m=y==="pending",v=y==="error",x=m&&w,C=h!==void 0,L={status:y,fetchStatus:d.fetchStatus,isPending:m,isSuccess:y==="success",isError:v,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!m,isLoadingError:v&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:v&&C,isStale:ls(t,n),refetch:this.refetch,promise:E(this,Kt)};if(this.options.experimental_prefetchInRender){const T=z=>{L.status==="error"?z.reject(L.error):L.data!==void 0&&z.resolve(L.data)},V=()=>{const z=q(this,Kt,L.promise=Ro());T(z)},N=E(this,Kt);switch(N.status){case"pending":t.queryHash===r.queryHash&&T(N);break;case"fulfilled":(L.status==="error"||L.data!==N.value)&&V();break;case"rejected":(L.status!=="error"||L.error!==N.reason)&&V();break}}return L}updateResult(t){const n=E(this,Ne),r=this.createResult(E(this,ce),this.options);if(q(this,on,E(this,ce).state),q(this,Ln,this.options),E(this,on).data!==void 0&&q(this,kn,E(this,ce)),xo(r,n))return;q(this,Ne,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!E(this,Vn).size)return!0;const u=new Set(a??E(this,Vn));return this.options.throwOnError&&u.add("error"),Object.keys(E(this,Ne)).some(l=>{const c=l;return E(this,Ne)[c]!==n[c]&&u.has(c)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),ue(this,pe,sc).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,pe,Fo).call(this)}},je=new WeakMap,ce=new WeakMap,Rr=new WeakMap,Ne=new WeakMap,on=new WeakMap,Ln=new WeakMap,Kt=new WeakMap,ht=new WeakMap,Pr=new WeakMap,_n=new WeakMap,kn=new WeakMap,sn=new WeakMap,an=new WeakMap,jt=new WeakMap,Vn=new WeakMap,pe=new WeakSet,sr=function(t){ue(this,pe,Oo).call(this);let n=E(this,ce).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ye)),n},Po=function(){ue(this,pe,Ao).call(this);const t=Cn(this.options.staleTime,E(this,ce));if(Kn||E(this,Ne).isStale||!So(t))return;const r=Zu(E(this,Ne).dataUpdatedAt,t)+1;q(this,sn,setTimeout(()=>{E(this,Ne).isStale||this.updateResult()},r))},Io=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,ce)):this.options.refetchInterval)??!1},Mo=function(t){ue(this,pe,$o).call(this),q(this,jt,t),!(Kn||rt(this.options.enabled,E(this,ce))===!1||!So(E(this,jt))||E(this,jt)===0)&&q(this,an,setInterval(()=>{(this.options.refetchIntervalInBackground||as.isFocused())&&ue(this,pe,sr).call(this)},E(this,jt)))},Fo=function(){ue(this,pe,Po).call(this),ue(this,pe,Mo).call(this,ue(this,pe,Io).call(this))},Ao=function(){E(this,sn)&&(clearTimeout(E(this,sn)),q(this,sn,void 0))},$o=function(){E(this,an)&&(clearInterval(E(this,an)),q(this,an,void 0))},Oo=function(){const t=E(this,je).getQueryCache().build(E(this,je),this.options);if(t===E(this,ce))return;const n=E(this,ce);q(this,ce,t),q(this,Rr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},sc=function(t){Le.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(E(this,Ne))}),E(this,je).getQueryCache().notify({query:E(this,ce),type:"observerResultsUpdated"})})},Cu);function eg(e,t){return rt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Na(e,t){return eg(e,t)||e.state.data!==void 0&&To(e,t,t.refetchOnMount)}function To(e,t,n){if(rt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ls(e,t)}return!1}function Ka(e,t,n,r){return(e!==t||rt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ls(e,n)}function ls(e,t){return rt(t.enabled,e)!==!1&&e.isStaleByTime(Cn(t.staleTime,e))}function tg(e,t){return!xo(e.getCurrentResult(),t)}function ng(e){return e}function rg(e,t,n){var u;if(typeof t!="object"||t===null)return;const r=e.getMutationCache(),i=e.getQueryCache(),o=((u=e.getDefaultOptions().hydrate)==null?void 0:u.deserializeData)??ng,s=t.mutations||[],a=t.queries||[];s.forEach(({state:l,...c})=>{var d,f;r.build(e,{...(d=e.getDefaultOptions().hydrate)==null?void 0:d.mutations,...(f=n==null?void 0:n.defaultOptions)==null?void 0:f.mutations,...c},l)}),a.forEach(({queryKey:l,state:c,queryHash:d,meta:f,promise:h})=>{var y,w;let g=i.get(d);const p=c.data===void 0?c.data:o(c.data);if(g){if(g.state.dataUpdatedAt<c.dataUpdatedAt){const{fetchStatus:m,...v}=c;g.setState({...v,data:p})}}else g=i.build(e,{...(y=e.getDefaultOptions().hydrate)==null?void 0:y.queries,...(w=n==null?void 0:n.defaultOptions)==null?void 0:w.queries,queryKey:l,queryHash:d,meta:f},{...c,data:p,fetchStatus:"idle"});if(h){const m=Promise.resolve(h).then(o);g.fetch(void 0,{initialPromise:m})}})}var ig=class extends Zh{constructor(e={}){super(e)}},ac=we(void 0),lc=e=>{const t=me(ac);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},og=e=>(Ke(t=>(t==null||t(),e.client.mount(),e.client.unmount.bind(e.client))),W(()=>e.client.unmount()),b(ac.Provider,{value:()=>e.client,get children(){return e.children}}));function sg(e,t){return typeof e=="function"?e(...t):!!e}var uc=we(()=>!1),ag=()=>me(uc);uc.Provider;function lg(e,t,n,r){if(n===!1)return t;if(typeof n=="function"){const s=n(e.data,t.data);return{...t,data:s}}let i=t.data;if(e.data===void 0)try{i=structuredClone(i)}catch{}const o=Yu(i,{key:n})(e.data);return{...t,data:o}}var ug=(e,t)=>t;function cg(e,t,n){const r=K(()=>lc()),i=ag(),o=K(()=>{const x=r().defaultQueryOptions(e());return x._optimisticResults=i()?"isRestoring":"optimistic",x.structuralSharing=!1,x}),s=o(),[a,u]=B(new t(r(),o()));let l=a().getOptimisticResult(o());const[c,d]=ci(l),f=()=>a().subscribe(C=>{l=C,queueMicrotask(()=>{p&&m()})});function h(x){const C=a().options,O=C.reconcile;d(L=>lg(L,x,O===void 0?!1:O,C.queryHash))}function g(){return[()=>c,x=>{const C=cn(c);if(typeof x=="function"&&(x=x(C)),x!=null&&x.hydrationData){const{hydrationData:O,...L}=x;x=L}h(x)}]}let p=null,y=null;const[w,{refetch:m}]=cf(()=>{const x=a();return new Promise((C,O)=>{if(y=C,!p&&!i()&&(p=f()),x.updateResult(),l.isError&&!l.isFetching&&!i()&&sg(x.options.throwOnError,[l.error,x.getCurrentQuery()]))return h(l),O(l.error);if(!l.isLoading)return y=null,C(ug(x.getCurrentQuery(),l));h(l)})},{storage:g,get deferStream(){return e().deferStream},onHydrated(x,C){if(C.value&&"hydrationData"in C.value&&rg(r(),{queries:[{...C.value.hydrationData}]}),p)return;const O={...s};(s.staleTime||!s.initialData)&&C.value&&(O.refetchOnMount=!1),a().setOptions(O),h(a().getOptimisticResult(O)),p=f()}});Mt(Ce(r,x=>{p&&p();const C=new t(x,o());p=f(),u(C)},{defer:!0})),Mt(Ce(i,x=>{x||m()},{defer:!0})),W(()=>{p&&(p(),p=null),y&&(y(l),y=null)}),Mt(Ce([a,o],([x,C])=>{x.setOptions(C),h(x.getOptimisticResult(C)),m()},{defer:!0}));const v={get(x,C){var O,L;return C==="data"?c.data!==void 0?(O=w.latest)==null?void 0:O.data:(L=w())==null?void 0:L.data:Reflect.get(x,C)}};return new Proxy(c,v)}function di(e,t){return cg(K(()=>e()),Jh)}function dg(e){return(...t)=>{for(const n of e)n&&n(...t)}}var $=e=>typeof e=="function"&&!e.length?e():e,ja=e=>Array.isArray(e)?e:e?[e]:[];function fg(e,...t){return typeof e=="function"?e(...t):e}var hg=W;function gg(e,t,n,r){return e.addEventListener(t,n,r),hg(e.removeEventListener.bind(e,t,n,r))}function pg(e,t,n,r){const i=()=>{ja($(e)).forEach(o=>{o&&ja($(t)).forEach(s=>gg(o,s,n,r))})};typeof e=="function"?U(i):Ke(i)}var mg=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Ba(e){const t={};let n;for(;n=mg.exec(e);)t[n[1]]=n[2];return t}function yt(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Ba(e)}else typeof t=="string"&&(t=Ba(t));return{...e,...t}}function ye(...e){return dg(e)}function yg(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Do(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function vg(e){return typeof e=="number"}function bn(e){return Object.prototype.toString.call(e)==="[object String]"}function us(e){return typeof e=="function"}function vt(e){return t=>`${e()}-${t}`}function _e(e,t){return e?e===t||e.contains(t):!1}function ar(e,t=!1){const{activeElement:n}=Ze(e);if(!(n!=null&&n.nodeName))return null;if(dc(n)&&n.contentDocument)return ar(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Ze(n).getElementById(r);if(i)return i}}return n}function cc(e){return Ze(e).defaultView||window}function Ze(e){return e?e.ownerDocument||e:document}function dc(e){return e.tagName==="IFRAME"}var cs=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(cs||{});function ds(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function fi(){return ds(/^Mac/i)}function wg(){return ds(/^iPhone/i)}function bg(){return ds(/^iPad/i)||fi()&&navigator.maxTouchPoints>1}function Sg(){return wg()||bg()}function xg(){return fi()||Sg()}function ie(e,t){return t&&(us(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function be(e){return t=>{for(const n of e)ie(t,n)}}function Cg(e){return fi()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ie(e){if(e)if(Eg())e.focus({preventScroll:!0});else{const t=Rg(e);e.focus(),Pg(t)}}var Vr=null;function Eg(){if(Vr==null){Vr=!1;try{document.createElement("div").focus({get preventScroll(){return Vr=!0,!0}})}catch{}}return Vr}function Rg(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Pg(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var fc=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Ig=[...fc,'[tabindex]:not([tabindex="-1"]):not([disabled])'],fs=`${fc.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Mg=Ig.join(':not([hidden]):not([tabindex="-1"]),');function hc(e,t){const r=Array.from(e.querySelectorAll(fs)).filter(za);return t&&za(e)&&r.unshift(e),r.forEach((i,o)=>{if(dc(i)&&i.contentDocument){const s=i.contentDocument.body,a=hc(s,!1);r.splice(o,1,...a)}}),r}function za(e){return gc(e)&&!Fg(e)}function gc(e){return e.matches(fs)&&hs(e)}function Fg(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function hs(e,t){return e.nodeName!=="#comment"&&Ag(e)&&$g(e,t)&&(!e.parentElement||hs(e.parentElement,e))}function Ag(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:o,visibility:s}=i(e);r=o!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function $g(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Og(e,t,n){const r=t!=null&&t.tabbable?Mg:fs,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){var s;return(s=t==null?void 0:t.from)!=null&&s.contains(o)?NodeFilter.FILTER_REJECT:o.matches(r)&&hs(o)&&(!(t!=null&&t.accept)||t.accept(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function Ga(e){let t=e;for(;t&&!Tg(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Tg(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Dg(){}function Lg(e,t){const[n,r]=e;let i=!1;const o=t.length;for(let s=o,a=0,u=s-1;a<s;u=a++){const[l,c]=t[a],[d,f]=t[u],[,h]=t[u===0?s-1:u-1]||[0,0],g=(c-f)*(n-l)-(l-d)*(r-c);if(f<c){if(r>=f&&r<c){if(g===0)return!0;g>0&&(r===f?r>h&&(i=!i):i=!i)}}else if(c<f){if(r>c&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(i=!i):i=!i)}}else if(r===c&&(n>=d&&n<=l||n>=l&&n<=d))return!0}return i}function Z(e,t){return A(e,t)}var Yn=new Map,Ha=new Set;function Ua(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Yn.get(n.target);r||(r=new Set,Yn.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Yn.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Yn.delete(n.target)),Yn.size===0)){for(const i of Ha)i();Ha.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Ua():document.addEventListener("DOMContentLoaded",Ua));function Lo(e,t){const n=qa(e,t,"left"),r=qa(e,t,"top"),i=t.offsetWidth,o=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const u=s+e.offsetWidth,l=a+e.offsetHeight;n<=s?s=n:n+i>u&&(s+=n+i-u),r<=a?a=r:r+o>l&&(a+=r+o-l),e.scrollLeft=s,e.scrollTop=a}function qa(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function _g(e,t){var n,r;if(document.contains(e)){const i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let s=Ga(e);for(;e&&s&&e!==i&&s!==i;)Lo(s,e),e=s,s=Ga(e)}else{const{left:s,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:u,top:l}=e.getBoundingClientRect();(Math.abs(s-u)>1||Math.abs(a-l)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var pc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},yr="data-kb-top-layer",mc,_o=!1,Ft=[];function vr(e){return Ft.findIndex(t=>t.node===e)}function kg(e){return Ft[vr(e)]}function Vg(e){return Ft[Ft.length-1].node===e}function yc(){return Ft.filter(e=>e.isPointerBlocking)}function Ng(){return[...yc()].slice(-1)[0]}function gs(){return yc().length>0}function vc(e){var n;const t=vr((n=Ng())==null?void 0:n.node);return vr(e)<t}function Kg(e){Ft.push(e)}function jg(e){const t=vr(e);t<0||Ft.splice(t,1)}function Bg(){for(const{node:e}of Ft)e.style.pointerEvents=vc(e)?"none":"auto"}function zg(e){if(gs()&&!_o){const t=Ze(e);mc=document.body.style.pointerEvents,t.body.style.pointerEvents="none",_o=!0}}function Gg(e){if(gs())return;const t=Ze(e);t.body.style.pointerEvents=mc,t.body.style.length===0&&t.body.removeAttribute("style"),_o=!1}var ze={layers:Ft,isTopMostLayer:Vg,hasPointerBlockingLayer:gs,isBelowPointerBlockingLayer:vc,addLayer:Kg,removeLayer:jg,indexOf:vr,find:kg,assignPointerEventToLayers:Bg,disableBodyPointerEvents:zg,restoreBodyPointerEvents:Gg};function hi(e,t){const[n,r]=B(Wa(t==null?void 0:t()));return U(()=>{var i;r(((i=e())==null?void 0:i.tagName.toLowerCase())||Wa(t==null?void 0:t()))}),n}function Wa(e){return bn(e)?e:void 0}function ae(e){const[t,n]=k(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return b(Lu,A(n,{get component(){return t.as}}))}var Hg=Object.defineProperty,Xt=(e,t)=>{for(var n in t)Hg(e,n,{get:t[n],enumerable:!0})},Ug={};Xt(Ug,{Button:()=>Xg,Root:()=>wt});var qg=["button","color","file","image","reset","submit"];function Wg(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?qg.indexOf(e.type)!==-1:!1}function wt(e){let t;const n=Z({type:"button"},e),[r,i]=k(n,["ref","type","disabled"]),o=hi(()=>t,()=>"button"),s=K(()=>{const l=o();return l==null?!1:Wg({tagName:l,type:r.type})}),a=K(()=>o()==="input"),u=K(()=>o()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return b(ae,A({as:"button",ref(l){var c=ye(d=>t=d,r.ref);typeof c=="function"&&c(l)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!u()?"button":void 0},get tabIndex(){return!s()&&!u()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var Xg=wt;function Be(e){return t=>(e(t),()=>e(void 0))}var Te=e=>typeof e=="function"?e():e,Qg=e=>{const t=K(()=>{const s=Te(e.element);if(s)return getComputedStyle(s)}),n=()=>{var s;return((s=t())==null?void 0:s.animationName)??"none"},[r,i]=B(Te(e.show)?"present":"hidden");let o="none";return U(s=>{const a=Te(e.show);return Me(()=>{var c;if(s===a)return a;const u=o,l=n();a?i("present"):l==="none"||((c=t())==null?void 0:c.display)==="none"?i("hidden"):i(s===!0&&u!==l?"hiding":"hidden")}),a}),U(()=>{const s=Te(e.element);if(!s)return;const a=l=>{l.target===s&&(o=n())},u=l=>{const d=n().includes(l.animationName);l.target===s&&d&&r()==="hiding"&&i("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",u),s.addEventListener("animationend",u),W(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",u),s.removeEventListener("animationend",u)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:i}},Yg=Qg,wr=Yg,Zg={};Xt(Zg,{CloseButton:()=>ps,Description:()=>ms,List:()=>vs,ProgressFill:()=>Sc,ProgressTrack:()=>xc,Region:()=>bs,Root:()=>Ss,Title:()=>xs,Toast:()=>pp,toaster:()=>Cs});var wc=we();function gi(){const e=me(wc);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function ps(e){const t=gi(),[n,r]=k(e,["aria-label","onClick"]);return b(wt,A({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:o=>{ie(o,n.onClick),t.close()}},r))}function ms(e){const t=gi(),n=Z({id:t.generateId("description")},e),[r,i]=k(n,["id"]);return U(()=>W(t.registerDescriptionId(r.id))),b(ae,A({as:"div",get id(){return r.id}},i))}var bc=we();function ys(){const e=me(bc);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function vs(e){let t;const n=ys(),[r,i]=k(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),o=l=>{ie(l,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},s=l=>{ie(l,r.onFocusOut),_e(t,l.relatedTarget)||n.resumeAllTimer()},a=l=>{ie(l,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},u=l=>{ie(l,r.onPointerLeave),_e(t,Ze(t).activeElement)||n.resumeAllTimer()};return U(Ce([()=>t,()=>n.hotkey()],([l,c])=>{if(!l)return;const d=Ze(l),f=h=>{c.every(p=>h[p]||h.code===p)&&Ie(l)};d.addEventListener("keydown",f),W(()=>d.removeEventListener("keydown",f))})),U(()=>{if(!n.pauseOnPageIdle())return;const l=cc(t);l.addEventListener("blur",n.pauseAllTimer),l.addEventListener("focus",n.resumeAllTimer),W(()=>{l.removeEventListener("blur",n.pauseAllTimer),l.removeEventListener("focus",n.resumeAllTimer)})}),b(ae,A({as:"ol",ref(l){var c=ye(d=>t=d,r.ref);typeof c=="function"&&c(l)},tabIndex:-1,onFocusIn:o,onFocusOut:s,onPointerMove:a,onPointerLeave:u},i,{get children(){return b(nt,{get each(){return n.toasts()},children:l=>l.toastComponent({get toastId(){return l.id}})})}}))}function Sc(e){const t=ys(),n=gi(),[r,i]=k(e,["style"]),[o,s]=B(100);let a=0;return U(()=>{if(t.isPaused()||n.isPersistent())return;const u=setInterval(()=>{const l=new Date().getTime()-n.closeTimerStartTime()+a,c=Math.trunc(100-l/n.duration()*100);s(c<0?0:c)});W(()=>{a+=new Date().getTime()-n.closeTimerStartTime(),clearInterval(u)})}),b(ae,A({as:"div",get style(){return yt({"--kb-toast-progress-fill-width":`${o()}%`},r.style)}},i))}function xc(e){return b(ae,A({as:"div","aria-hidden":"true",role:"presentation"},e))}var[ws,Mr]=ci({toasts:[]});function Jg(e){Mr("toasts",t=>[...t,e])}function ep(e){return ws.toasts.find(t=>t.id===e)}function tp(e,t){const n=ws.toasts.findIndex(r=>r.id===e);n!==-1&&Mr("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function np(e){Mr("toasts",t=>t.id===e,"dismiss",!0)}function rp(e){Mr("toasts",t=>t.filter(n=>n.id!==e))}function ip(){Mr("toasts",[])}var dn={toasts:()=>ws.toasts,add:Jg,get:ep,update:tp,dismiss:np,remove:rp,clear:ip},Xa="{hotkey}",op={close:"Close"},sp={notifications:e=>`Notifications (${e})`};function bs(e){const t=Z({id:`toast-region-${Ee()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:sp},e),[n,r]=k(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),i=K(()=>dn.toasts().filter(f=>f.region===n.regionId&&f.dismiss===!1).slice(0,n.limit)),[o,s]=B(!1),a=()=>i().length>0,u=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),l=()=>(n["aria-label"]||n.translations.notifications(Xa)).replace(Xa,u()),c=()=>({[yr]:n.topLayer?"":void 0}),d={isPaused:o,toasts:i,hotkey:()=>n.hotkey,duration:()=>n.duration,swipeDirection:()=>n.swipeDirection,swipeThreshold:()=>n.swipeThreshold,pauseOnInteraction:()=>n.pauseOnInteraction,pauseOnPageIdle:()=>n.pauseOnPageIdle,pauseAllTimer:()=>s(!0),resumeAllTimer:()=>s(!1),generateId:vt(()=>r.id)};return b(bc.Provider,{value:d,get children(){return b(ae,A({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return l()},get style(){return yt({"pointer-events":a()?n.topLayer?"auto":void 0:"none"},n.style)}},c,r))}})}var ap="toast.swipeStart",lp="toast.swipeMove",up="toast.swipeCancel",cp="toast.swipeEnd";function Ss(e){const t=ys(),n=Z({id:`toast-${Ee()}`,priority:"high",translations:op},e),[r,i]=k(n,["ref","translations","toastId","style","priority","duration","persistent","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","onEscapeKeyDown","onKeyDown","onPointerDown","onPointerMove","onPointerUp"]),[o,s]=B(!0),[a,u]=B(),[l,c]=B(),[d,f]=B(!0),[h,g]=B(),{present:p}=wr({show:o,element:()=>h()??null}),y=K(()=>r.duration||t.duration());let w,m=0,v=y(),x=null,C=null;const O=()=>{s(!1),f(!0)},L=()=>{dn.remove(r.toastId)},_=S=>{!S||r.persistent||(window.clearTimeout(w),m=new Date().getTime(),w=window.setTimeout(O,S))},T=()=>{var S;_(v),(S=r.onResume)==null||S.call(r)},V=()=>{var I;const S=new Date().getTime()-m;v=v-S,window.clearTimeout(w),(I=r.onPause)==null||I.call(r)},N=S=>{var I;ie(S,r.onKeyDown),S.key==="Escape"&&((I=r.onEscapeKeyDown)==null||I.call(r,S),S.defaultPrevented||O())},z=S=>{ie(S,r.onPointerDown),S.button===0&&(x={x:S.clientX,y:S.clientY})},oe=S=>{if(ie(S,r.onPointerMove),!x)return;const I=S.clientX-x.x,M=S.clientY-x.y,F=!!C,D=["left","right"].includes(t.swipeDirection()),j=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,H=D?j(0,I):0,X=D?0:j(0,M),le=S.pointerType==="touch"?10:2,ne={x:H,y:X},Ae={originalEvent:S,delta:ne};if(F){C=ne,Nr(lp,r.onSwipeMove,Ae);const{x:Je,y:te}=ne;S.currentTarget.setAttribute("data-swipe","move"),S.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${Je}px`),S.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${te}px`)}else Qa(ne,t.swipeDirection(),le)?(C=ne,Nr(ap,r.onSwipeStart,Ae),S.currentTarget.setAttribute("data-swipe","start"),S.target.setPointerCapture(S.pointerId)):(Math.abs(I)>le||Math.abs(M)>le)&&(x=null)},P=S=>{ie(S,r.onPointerUp);const I=C,M=S.target;if(M.hasPointerCapture(S.pointerId)&&M.releasePointerCapture(S.pointerId),C=null,x=null,I){const F=S.currentTarget,D={originalEvent:S,delta:I};if(Qa(I,t.swipeDirection(),t.swipeThreshold())){Nr(cp,r.onSwipeEnd,D);const{x:j,y:H}=I;S.currentTarget.setAttribute("data-swipe","end"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),S.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${j}px`),S.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${H}px`),O()}else Nr(up,r.onSwipeCancel,D),S.currentTarget.setAttribute("data-swipe","cancel"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),S.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");F.addEventListener("click",j=>j.preventDefault(),{once:!0})}};Bn(()=>{t.toasts().find(S=>S.id===r.toastId&&S.update)&&f(!1)}),U(Ce(()=>t.isPaused(),S=>{S?V():T()},{defer:!0})),U(Ce([o,y],([S,I])=>{S&&!t.isPaused()&&_(I)})),U(Ce(()=>{var S;return(S=dn.get(r.toastId))==null?void 0:S.dismiss},S=>S&&O())),U(Ce(()=>p(),S=>!S&&L()));const R={translations:()=>r.translations,close:O,duration:y,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>m,generateId:vt(()=>i.id),registerTitleId:Be(u),registerDescriptionId:Be(c)};return b(Se,{get when(){return p()},get children(){return b(wc.Provider,{value:R,get children(){return b(ae,A({as:"li",ref(S){var I=ye(g,r.ref);typeof I=="function"&&I(S)},role:"status",tabIndex:0,get style(){return yt({animation:d()?void 0:"none","user-select":"none","touch-action":"none"},r.style)},get"aria-live"(){return r.priority==="high"?"assertive":"polite"},"aria-atomic":"true",get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-opened"(){return o()?"":void 0},get"data-closed"(){return o()?void 0:""},get"data-swipe-direction"(){return t.swipeDirection()},onKeyDown:N,onPointerDown:z,onPointerMove:oe,onPointerUp:P},i))}})}})}function Qa(e,t,n=0){const r=Math.abs(e.x),i=Math.abs(e.y),o=r>i;return t==="left"||t==="right"?o&&r>n:!o&&i>n}function Nr(e,t,n){const r=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function xs(e){const t=gi(),n=Z({id:t.generateId("title")},e),[r,i]=k(n,["id"]);return U(()=>W(t.registerTitleId(r.id))),b(ae,A({as:"div",get id(){return r.id}},i))}var dp=0;function Cc(e,t){const n=dp++;return dn.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t==null?void 0:t.region}),n}function ko(e,t){dn.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function fp(e,t,n){const r=Cc(i=>t({get toastId(){return i.toastId},state:"pending"}),n);return(us(e)?e():e).then(i=>ko(r,o=>t({get toastId(){return o.toastId},state:"fulfilled",data:i}))).catch(i=>ko(r,o=>t({get toastId(){return o.toastId},state:"rejected",error:i}))),r}function hp(e){return dn.dismiss(e),e}function gp(){dn.clear()}var Cs={show:Cc,update:ko,promise:fp,dismiss:hp,clear:gp},pp=Object.assign(Ss,{CloseButton:ps,Description:ms,List:vs,ProgressFill:Sc,ProgressTrack:xc,Region:bs,Title:xs,toaster:Cs});function Ec(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ec(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function mp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ec(e))&&(r&&(r+=" "),r+=t);return r}const Ya=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Za=mp,Fr=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Za(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(l=>{const c=n==null?void 0:n[l],d=o==null?void 0:o[l];if(c===null)return null;const f=Ya(c)||Ya(d);return i[l][f]}),a=n&&Object.entries(n).reduce((l,c)=>{let[d,f]=c;return f===void 0||(l[d]=f),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(g=>{let[p,y]=g;return Array.isArray(y)?y.includes({...o,...a}[p]):{...o,...a}[p]===y})?[...l,d,f]:l},[]);return Za(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)};function Rc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Rc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yp(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Rc(e))&&(r&&(r+=" "),r+=t);return r}const Es="-",vp=e=>{const t=bp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Es);return a[0]===""&&a.length!==1&&a.shift(),Pc(a,t)||wp(s)},getConflictingClassGroupIds:(s,a)=>{const u=n[s]||[];return a&&r[s]?[...u,...r[s]]:u}}},Pc=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Pc(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Es);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},Ja=/^\[(.+)\]$/,wp=e=>{if(Ja.test(e)){const t=Ja.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},bp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return xp(Object.entries(e.classGroups),n).forEach(([o,s])=>{Vo(s,r,o,t)}),r},Vo=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:el(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Sp(i)){Vo(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{Vo(s,el(t,o),n,r)})})},el=(e,t)=>{let n=e;return t.split(Es).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Sp=e=>e.isThemeGetter,xp=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e,Cp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},Ic="!",Ep=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=a=>{const u=[];let l=0,c=0,d;for(let y=0;y<a.length;y++){let w=a[y];if(l===0){if(w===i&&(r||a.slice(y,y+o)===t)){u.push(a.slice(c,y)),c=y+o;continue}if(w==="/"){d=y;continue}}w==="["?l++:w==="]"&&l--}const f=u.length===0?a:a.substring(c),h=f.startsWith(Ic),g=h?f.substring(1):f,p=d&&d>c?d-c:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},Rp=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Pp=e=>({cache:Cp(e.cacheSize),parseClassName:Ep(e),...vp(e)}),Ip=/\s+/,Mp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(Ip);let a="";for(let u=s.length-1;u>=0;u-=1){const l=s[u],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(l);let g=!!h,p=r(g?f.substring(0,h):f);if(!p){if(!g){a=l+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=l+(a.length>0?" "+a:a);continue}g=!1}const y=Rp(c).join(":"),w=d?y+Ic:y,m=w+p;if(o.includes(m))continue;o.push(m);const v=i(p,g);for(let x=0;x<v.length;++x){const C=v[x];o.push(w+C)}a=l+(a.length>0?" "+a:a)}return a};function Fp(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Mc(t))&&(r&&(r+=" "),r+=n);return r}const Mc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ap(e,...t){let n,r,i,o=s;function s(u){const l=t.reduce((c,d)=>d(c),e());return n=Pp(l),r=n.cache.get,i=n.cache.set,o=a,a(u)}function a(u){const l=r(u);if(l)return l;const c=Mp(u,n);return i(u,c),c}return function(){return o(Fp.apply(null,arguments))}}const ve=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Fc=/^\[(?:([a-z-]+):)?(.+)\]$/i,$p=/^\d+\/\d+$/,Op=new Set(["px","full","screen"]),Tp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dp=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Lp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_p=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kp=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>En(e)||Op.has(e)||$p.test(e),Ot=e=>Gn(e,"length",Hp),En=e=>!!e&&!Number.isNaN(Number(e)),Oi=e=>Gn(e,"number",En),Zn=e=>!!e&&Number.isInteger(Number(e)),Vp=e=>e.endsWith("%")&&En(e.slice(0,-1)),re=e=>Fc.test(e),Tt=e=>Tp.test(e),Np=new Set(["length","size","percentage"]),Kp=e=>Gn(e,Np,Ac),jp=e=>Gn(e,"position",Ac),Bp=new Set(["image","url"]),zp=e=>Gn(e,Bp,qp),Gp=e=>Gn(e,"",Up),Jn=()=>!0,Gn=(e,t,n)=>{const r=Fc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Hp=e=>Dp.test(e)&&!Lp.test(e),Ac=()=>!1,Up=e=>_p.test(e),qp=e=>kp.test(e),Wp=()=>{const e=ve("colors"),t=ve("spacing"),n=ve("blur"),r=ve("brightness"),i=ve("borderColor"),o=ve("borderRadius"),s=ve("borderSpacing"),a=ve("borderWidth"),u=ve("contrast"),l=ve("grayscale"),c=ve("hueRotate"),d=ve("invert"),f=ve("gap"),h=ve("gradientColorStops"),g=ve("gradientColorStopPositions"),p=ve("inset"),y=ve("margin"),w=ve("opacity"),m=ve("padding"),v=ve("saturate"),x=ve("scale"),C=ve("sepia"),O=ve("skew"),L=ve("space"),_=ve("translate"),T=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",re,t],z=()=>[re,t],oe=()=>["",xt,Ot],P=()=>["auto",En,re],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],S=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",re],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[En,re];return{cacheSize:500,separator:":",theme:{colors:[Jn],spacing:[xt,Ot],blur:["none","",Tt,re],brightness:j(),borderColor:[e],borderRadius:["none","","full",Tt,re],borderSpacing:z(),borderWidth:oe(),contrast:j(),grayscale:F(),hueRotate:j(),invert:F(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[Vp,Ot],inset:N(),margin:N(),opacity:j(),padding:z(),saturate:j(),scale:j(),sepia:F(),skew:j(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Tt]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),re]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zn,re]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Zn,re]}],"grid-cols":[{"grid-cols":[Jn]}],"col-start-end":[{col:["auto",{span:["full",Zn,re]},re]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Jn]}],"row-start-end":[{row:["auto",{span:[Zn,re]},re]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[Tt]},Tt]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Tt,Ot]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oi]}],"font-family":[{font:[Jn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",En,Oi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xt,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...S(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xt,Ot]}],"underline-offset":[{"underline-offset":["auto",xt,re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),jp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kp]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zp]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...S(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:S()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...S()]}],"outline-offset":[{"outline-offset":[xt,re]}],"outline-w":[{outline:[xt,Ot]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[xt,Ot]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tt,Gp]}],"shadow-color":[{shadow:[Jn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Tt,re]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Zn,re]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[xt,Ot,Oi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Xp=Ap(Wp);function de(...e){return Xp(yp(e))}var Qp=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),Yp=he('<div class="grid gap-1">');const Zp=Fr("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--kb-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--kb-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[opened]:animate-in data-[closed]:animate-out data-[swipe=end]:animate-out data-[closed]:fade-out-80 data-[closed]:slide-out-to-right-full data-[opened]:slide-in-from-top-full data-[opened]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"success border-success-foreground bg-success text-success-foreground",warning:"warning border-warning-foreground bg-warning text-warning-foreground",error:"error border-error-foreground bg-error text-error-foreground"}},defaultVariants:{variant:"default"}}),Jp=e=>{const[t,n]=k(e,["class"]);return b(rs,{get children(){return b(bs,{get children(){return b(vs,A({get class(){return de("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t.class)}},n))}})}})},em=e=>{const[t,n]=k(e,["class","variant"]);return b(Ss,A({get class(){return de(Zp({variant:t.variant}),t.class)}},n))},tm=e=>{const[t,n]=k(e,["class"]);return b(ps,A({get class(){return de("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground group-[.error]:text-error-foreground group-[.success]:text-success-foreground group-[.warning]:text-warning-foreground",t.class)}},n,{get children(){return Qp()}}))},nm=e=>{const[t,n]=k(e,["class"]);return b(xs,A({get class(){return de("text-sm font-semibold",t.class)}},n))},rm=e=>{const[t,n]=k(e,["class"]);return b(ms,A({get class(){return de("text-sm opacity-90",t.class)}},n))};function tl(e){Cs.show(t=>b(em,{get toastId(){return t.toastId},get variant(){return e.variant},get duration(){return e.duration},get children(){return[(()=>{var n=Yp();return fe(n,(()=>{var r=K(()=>!!e.title);return()=>r()&&b(nm,{get children(){return e.title}})})(),null),fe(n,(()=>{var r=K(()=>!!e.description);return()=>r()&&b(rm,{get children(){return e.description}})})(),null),n})(),b(tm,{})]}}))}var Ti="focusScope.autoFocusOnMount",Di="focusScope.autoFocusOnUnmount",nl={bubbles:!1,cancelable:!0},rl={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Do(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Do(this.stack,e),(t=this.active())==null||t.resume()}};function $c(e,t){const[n,r]=B(!1),i={pause(){r(!0)},resume(){r(!1)}};let o=null;const s=g=>{var p;return(p=e.onMountAutoFocus)==null?void 0:p.call(e,g)},a=g=>{var p;return(p=e.onUnmountAutoFocus)==null?void 0:p.call(e,g)},u=()=>Ze(t()),l=()=>{const g=u().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,pc),g},c=()=>{const g=t();return g?hc(g,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const g=c();return g.length>0?g[0]:null},f=()=>{const g=c();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const p=ar(g);return!p||_e(g,p)?!1:gc(p)};U(()=>{const g=t();if(!g)return;rl.add(i);const p=ar(g);if(!_e(g,p)){const w=new CustomEvent(Ti,nl);g.addEventListener(Ti,s),g.dispatchEvent(w),w.defaultPrevented||setTimeout(()=>{Ie(d()),ar(g)===p&&Ie(g)},0)}W(()=>{g.removeEventListener(Ti,s),setTimeout(()=>{const w=new CustomEvent(Di,nl);h()&&w.preventDefault(),g.addEventListener(Di,a),g.dispatchEvent(w),w.defaultPrevented||Ie(p??u().body),g.removeEventListener(Di,a),rl.remove(i)},0)})}),U(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=w=>{const m=w.target;m!=null&&m.closest(`[${yr}]`)||(_e(g,m)?o=m:Ie(o))},y=w=>{const v=w.relatedTarget??ar(g);v!=null&&v.closest(`[${yr}]`)||_e(g,v)||Ie(o)};u().addEventListener("focusin",p),u().addEventListener("focusout",y),W(()=>{u().removeEventListener("focusin",p),u().removeEventListener("focusout",y)})}),U(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=l();g.insertAdjacentElement("afterbegin",p);const y=l();g.insertAdjacentElement("beforeend",y);function w(v){const x=d(),C=f();v.relatedTarget===x?Ie(C):Ie(x)}p.addEventListener("focusin",w),y.addEventListener("focusin",w);const m=new MutationObserver(v=>{for(const x of v)x.previousSibling===y&&(y.remove(),g.insertAdjacentElement("beforeend",y)),x.nextSibling===p&&(p.remove(),g.insertAdjacentElement("afterbegin",p))});m.observe(g,{childList:!0,subtree:!1}),W(()=>{p.removeEventListener("focusin",w),y.removeEventListener("focusin",w),p.remove(),y.remove(),m.disconnect()})})}var im="data-live-announcer";function Oc(e){U(()=>{$(e.isDisabled)||W(om($(e.targets),$(e.root)))})}var er=new WeakMap,We=[];function om(e,t=document.body){const n=new Set(e),r=new Set,i=u=>{for(const f of u.querySelectorAll(`[${im}], [${yr}]`))n.add(f);const l=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(u,NodeFilter.SHOW_ELEMENT,{acceptNode:l}),d=l(u);if(d===NodeFilter.FILTER_ACCEPT&&o(u),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)o(f),f=c.nextNode()}},o=u=>{const l=er.get(u)??0;u.getAttribute("aria-hidden")==="true"&&l===0||(l===0&&u.setAttribute("aria-hidden","true"),r.add(u),er.set(u,l+1))};We.length&&We[We.length-1].disconnect(),i(t);const s=new MutationObserver(u=>{for(const l of u)if(!(l.type!=="childList"||l.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(l.target))){for(const c of l.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of l.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&i(c)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return We.push(a),()=>{s.disconnect();for(const u of r){const l=er.get(u);if(l==null)return;l===1?(u.removeAttribute("aria-hidden"),er.delete(u)):er.set(u,l-1)}a===We[We.length-1]?(We.pop(),We.length&&We[We.length-1].observe()):We.splice(We.indexOf(a),1)}}function sm(e){const t=n=>{var r;n.key===cs.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};U(()=>{var r;if($(e.isDisabled))return;const n=((r=e.ownerDocument)==null?void 0:r.call(e))??Ze();n.addEventListener("keydown",t),W(()=>{n.removeEventListener("keydown",t)})})}var il="interactOutside.pointerDownOutside",ol="interactOutside.focusOutside";function Tc(e,t){let n,r=Dg;const i=()=>Ze(t()),o=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},s=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},u=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${yr}]`)||!_e(i(),f)||_e(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},l=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!u(d))return;const p=be([o,a]);g.addEventListener(il,p,{once:!0});const y=new CustomEvent(il,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||Cg(d)&&d.button===0}});g.dispatchEvent(y)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!u(d))return;const g=be([s,a]);h.addEventListener(ol,g,{once:!0});const p=new CustomEvent(ol,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(p)};U(()=>{$(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",l,!0)},0),i().addEventListener("focusin",c,!0),W(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",l,!0),i().removeEventListener("focusin",c,!0)}))})}var Dc=we();function am(){return me(Dc)}function Rs(e){let t;const n=am(),[r,i]=k(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),o=new Set([]),s=d=>{o.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{o.delete(d),f==null||f()}};Tc({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>_e(h(),d)))||[...o].some(h=>_e(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||ze.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!ze.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),sm({ownerDocument:()=>Ze(t),onEscapeKeyDown:d=>{var f;!t||!ze.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Bn(()=>{if(!t)return;ze.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);ze.assignPointerEventToLayers(),ze.disableBodyPointerEvents(t),W(()=>{t&&(ze.removeLayer(t),d==null||d(),ze.assignPointerEventToLayers(),ze.restoreBodyPointerEvents(t))})}),U(Ce([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=ze.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,ze.assignPointerEventToLayers()),f&&ze.disableBodyPointerEvents(d),W(()=>{ze.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:s};return b(Dc.Provider,{value:c,get children(){return b(ae,A({as:"div",ref(d){var f=ye(h=>t=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function pt(e){var s;const[t,n]=B((s=e.defaultValue)==null?void 0:s.call(e)),r=K(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),i=K(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[i,a=>{Me(()=>{var l;const u=fg(a,i());return Object.is(u,i())||(r()||n(u),(l=e.onChange)==null||l.call(e,u)),u})}]}function Lc(e){const[t,n]=pt(e);return[()=>t()??!1,n]}function lm(e){const[t,n]=pt(e);return[()=>t()??[],n]}function Ps(e={}){const[t,n]=Lc({value:()=>$(e.open),defaultValue:()=>!!$(e.defaultOpen),onChange:s=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,s)}}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}var No=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Kr=new Map,um=e=>{U(()=>{const t=Te(e.style)??{},n=Te(e.properties)??[],r={};for(const o in t)r[o]=e.element.style[o];const i=Kr.get(e.key);i?i.activeCount++:Kr.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(o=>o.key)}),Object.assign(e.element.style,e.style);for(const o of n)e.element.style.setProperty(o.key,o.value);W(()=>{var s;const o=Kr.get(e.key);if(o){if(o.activeCount!==1){o.activeCount--;return}Kr.delete(e.key);for(const[a,u]of Object.entries(o.originalStyles))e.element.style[a]=u;for(const a of o.properties)e.element.style.removeProperty(a);e.element.style.length===0&&e.element.removeAttribute("style"),(s=e.cleanup)==null||s.call(e)}})})},sl=um,cm=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},dm=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},fm=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,o=0,s=0,a=!1;do{const[u,l,c]=cm(i,t),d=c-u-r*l;(l!==0||d!==0)&&dm(i,t)&&(o+=d,s+=l),i===(n??document.documentElement)?a=!0:i=i._$host??i.parentElement}while(i&&!a);return[o,s]},[al,ll]=B([]),hm=e=>al().indexOf(e)===al().length-1,gm=e=>{const t=A({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ee();let r=[0,0],i=null,o=null;U(()=>{Te(t.enabled)&&(ll(l=>[...l,n]),W(()=>{ll(l=>l.filter(c=>c!==n))}))}),U(()=>{if(!Te(t.enabled)||!Te(t.hideScrollbar))return;const{body:l}=document,c=window.innerWidth-l.offsetWidth;if(Te(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(Te(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(l).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(l).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,g=window.scrollX;sl({key:"prevent-scroll",element:l,style:d,properties:f,cleanup:()=>{Te(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else sl({key:"prevent-scroll",element:l,style:{overflow:"hidden"}})}),U(()=>{!hm(n)||!Te(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",u,{passive:!1}),W(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",u)}))});const s=l=>{r=ul(l),i=null,o=null},a=l=>{const c=l.target,d=Te(t.element),f=pm(l),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],p=cl(c,h,g,d);let y;d&&No(d,c)?y=!p:y=!0,y&&l.cancelable&&l.preventDefault()},u=l=>{const c=Te(t.element),d=l.target;let f;if(l.touches.length===2)f=!Te(t.allowPinchZoom);else{if(i==null||o===null){const h=ul(l).map((p,y)=>r[y]-p),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=g,o=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=cl(d,i,o,c);c&&No(c,d)?f=!h:f=!0}}f&&l.cancelable&&l.preventDefault()}},pm=e=>[e.deltaX,e.deltaY],ul=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],cl=(e,t,n,r)=>{const i=r!==null&&No(r,e),[o,s]=fm(e,t,i?r:void 0);return!(n>0&&Math.abs(o)<=1||n<0&&Math.abs(s)<1)},mm=gm,_c=mm,ym={};Xt(ym,{CloseButton:()=>Is,Content:()=>Ms,Description:()=>Fs,Dialog:()=>vm,Overlay:()=>As,Portal:()=>$s,Root:()=>Os,Title:()=>Ts,Trigger:()=>Vc});var kc=we();function pn(){const e=me(kc);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function Is(e){const t=pn(),[n,r]=k(e,["aria-label","onClick"]);return b(wt,A({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:o=>{ie(o,n.onClick),t.close()}},r))}function Ms(e){let t;const n=pn(),r=Z({id:n.generateId("content")},e),[i,o]=k(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const u=f=>{var h;(h=i.onPointerDownOutside)==null||h.call(i,f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},l=f=>{var h;(h=i.onFocusOutside)==null||h.call(i,f),n.modal()&&f.preventDefault()},c=f=>{var h;(h=i.onInteractOutside)==null||h.call(i,f),!n.modal()&&(f.defaultPrevented||(s=!0,f.detail.originalEvent.type==="pointerdown"&&(a=!0)),_e(n.triggerRef(),f.target)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&a&&f.preventDefault())},d=f=>{var h;(h=i.onCloseAutoFocus)==null||h.call(i,f),n.modal()?(f.preventDefault(),Ie(n.triggerRef())):(f.defaultPrevented||(s||Ie(n.triggerRef()),f.preventDefault()),s=!1,a=!1)};return Oc({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),_c({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),$c({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),U(()=>W(n.registerContentId(o.id))),b(Se,{get when(){return n.contentPresent()},get children(){return b(Rs,A({ref(f){var h=ye(g=>{n.setContentRef(g),t=g},i.ref);typeof h=="function"&&h(f)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return K(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:c,get onDismiss(){return n.close}},o))}})}function Fs(e){const t=pn(),n=Z({id:t.generateId("description")},e),[r,i]=k(n,["id"]);return U(()=>W(t.registerDescriptionId(r.id))),b(ae,A({as:"p",get id(){return r.id}},i))}function As(e){const t=pn(),[n,r]=k(e,["ref","style","onPointerDown"]),i=o=>{ie(o,n.onPointerDown),o.target===o.currentTarget&&o.preventDefault()};return b(Se,{get when(){return t.overlayPresent()},get children(){return b(ae,A({as:"div",ref(o){var s=ye(t.setOverlayRef,n.ref);typeof s=="function"&&s(o)},get style(){return yt({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:i},r))}})}function $s(e){const t=pn();return b(Se,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return b(rs,e)}})}var dl={dismiss:"Dismiss"};function Os(e){const t=`dialog-${Ee()}`,n=Z({id:t,modal:!0,translations:dl},e),[r,i]=B(),[o,s]=B(),[a,u]=B(),[l,c]=B(),[d,f]=B(),[h,g]=B(),p=Ps({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:x=>{var C;return(C=n.onOpenChange)==null?void 0:C.call(n,x)}}),y=()=>n.forceMount||p.isOpen(),{present:w}=wr({show:y,element:()=>l()??null}),{present:m}=wr({show:y,element:()=>d()??null}),v={translations:()=>n.translations??dl,isOpen:p.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??v.modal(),contentId:r,titleId:o,descriptionId:a,triggerRef:h,overlayRef:l,setOverlayRef:c,contentRef:d,setContentRef:f,overlayPresent:w,contentPresent:m,close:p.close,toggle:p.toggle,setTriggerRef:g,generateId:vt(()=>n.id),registerContentId:Be(i),registerTitleId:Be(s),registerDescriptionId:Be(u)};return b(kc.Provider,{value:v,get children(){return n.children}})}function Ts(e){const t=pn(),n=Z({id:t.generateId("title")},e),[r,i]=k(n,["id"]);return U(()=>W(t.registerTitleId(r.id))),b(ae,A({as:"h2",get id(){return r.id}},i))}function Vc(e){const t=pn(),[n,r]=k(e,["ref","onClick"]);return b(wt,A({ref(o){var s=ye(t.setTriggerRef,n.ref);typeof s=="function"&&s(o)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return K(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:o=>{ie(o,n.onClick),t.toggle()}},r))}var vm=Object.assign(Os,{CloseButton:Is,Content:Ms,Description:Fs,Overlay:As,Portal:$s,Title:Ts,Trigger:Vc}),Nc=he("<div>"),wm=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),bm=he("<span class=sr-only>Close");const Sm=Os,xm=Fr("fixed inset-0 z-50 flex",{variants:{position:{top:"items-start",bottom:"items-end",left:"justify-start",right:"justify-end"}},defaultVariants:{position:"right"}}),Cm=e=>{const[t,n]=k(e,["position","children"]);return b($s,A(n,{get children(){var r=Nc();return fe(r,()=>t.children),Ke(()=>Tu(r,xm({position:t.position}))),r}}))},Em=e=>{const[t,n]=k(e,["class"]);return b(As,A({get class(){return de("fixed inset-0 z-50 bg-black/80 data-[expanded=]:animate-in data-[closed=]:animate-out data-[closed=]:fade-out-0 data-[expanded=]:fade-in-0",t.class)}},n))},Rm=Fr("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[closed=]:duration-300 data-[expanded=]:duration-500 data-[expanded=]:animate-in data-[closed=]:animate-out",{variants:{position:{top:"inset-x-0 top-0 border-b data-[closed=]:slide-out-to-top data-[expanded=]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[closed=]:slide-out-to-bottom data-[expanded=]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[closed=]:slide-out-to-left data-[expanded]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[closed=]:slide-out-to-right data-[expanded=]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{position:"right"}}),Pm=e=>{const[t,n]=k(e,["position","class","children"]);return b(Cm,{get position(){return t.position},get children(){return[b(Em,{}),b(Ms,A({get class(){return de(Rm({position:t.position}),t.class,"max-h-screen overflow-y-auto")}},n,{get children(){return[K(()=>t.children),b(Is,{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",get children(){return[wm(),bm()]}})]}}))]}})},Im=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Nc();return at(r,A({get class(){return de("flex flex-col space-y-2 text-center sm:text-left",t.class)}},n),!1,!1),r})()},Mm=e=>{const[t,n]=k(e,["class"]);return b(Ts,A({get class(){return de("text-lg font-semibold text-foreground",t.class)}},n))},Fm=e=>{const[t,n]=k(e,["class"]);return b(Fs,A({get class(){return de("text-sm text-muted-foreground",t.class)}},n))},Kc=()=>{const[e,t]=fh(),n=K(()=>(e==null?void 0:e.bundleId)??null),r=K(()=>(e==null?void 0:e.channel)??null),i=K(()=>(e==null?void 0:e.platform)??null);return{bundleIdFilter:n,channelFilter:r,platformFilter:i,setBundleIdFilter:o=>{t({bundleId:o??void 0})},setChannelFilter:o=>{t({channel:o??void 0})},setPlatformFilter:o=>{t({platform:o??void 0})}}},Am=e=>{const t=e.split("-").join("").slice(0,12);return Number.parseInt(t,16)};function jc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yr={exports:{}},$m=Yr.exports,fl;function Om(){return fl||(fl=1,function(e,t){(function(n,r){e.exports=r()})($m,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",u="hour",l="day",c="week",d="month",f="quarter",h="year",g="date",p="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var R=["th","st","nd","rd"],S=P%100;return"["+P+(R[(S-20)%10]||R[S]||R[0])+"]"}},v=function(P,R,S){var I=String(P);return!I||I.length>=R?P:""+Array(R+1-I.length).join(S)+P},x={s:v,z:function(P){var R=-P.utcOffset(),S=Math.abs(R),I=Math.floor(S/60),M=S%60;return(R<=0?"+":"-")+v(I,2,"0")+":"+v(M,2,"0")},m:function P(R,S){if(R.date()<S.date())return-P(S,R);var I=12*(S.year()-R.year())+(S.month()-R.month()),M=R.clone().add(I,d),F=S-M<0,D=R.clone().add(I+(F?-1:1),d);return+(-(I+(S-M)/(F?M-D:D-M))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:h,w:c,d:l,D:g,h:u,m:a,s,ms:o,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},C="en",O={};O[C]=m;var L="$isDayjsObject",_=function(P){return P instanceof z||!(!P||!P[L])},T=function P(R,S,I){var M;if(!R)return C;if(typeof R=="string"){var F=R.toLowerCase();O[F]&&(M=F),S&&(O[F]=S,M=F);var D=R.split("-");if(!M&&D.length>1)return P(D[0])}else{var j=R.name;O[j]=R,M=j}return!I&&M&&(C=M),M||!I&&C},V=function(P,R){if(_(P))return P.clone();var S=typeof R=="object"?R:{};return S.date=P,S.args=arguments,new z(S)},N=x;N.l=T,N.i=_,N.w=function(P,R){return V(P,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=function(){function P(S){this.$L=T(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[L]=!0}var R=P.prototype;return R.parse=function(S){this.$d=function(I){var M=I.date,F=I.utc;if(M===null)return new Date(NaN);if(N.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var D=M.match(y);if(D){var j=D[2]-1||0,H=(D[7]||"0").substring(0,3);return F?new Date(Date.UTC(D[1],j,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)):new Date(D[1],j,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)}}return new Date(M)}(S),this.init()},R.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},R.$utils=function(){return N},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(S,I){var M=V(S);return this.startOf(I)<=M&&M<=this.endOf(I)},R.isAfter=function(S,I){return V(S)<this.startOf(I)},R.isBefore=function(S,I){return this.endOf(I)<V(S)},R.$g=function(S,I,M){return N.u(S)?this[I]:this.set(M,S)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(S,I){var M=this,F=!!N.u(I)||I,D=N.p(S),j=function(Fe,Pe){var $t=N.w(M.$u?Date.UTC(M.$y,Pe,Fe):new Date(M.$y,Pe,Fe),M);return F?$t:$t.endOf(l)},H=function(Fe,Pe){return N.w(M.toDate()[Fe].apply(M.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(Pe)),M)},X=this.$W,le=this.$M,ne=this.$D,Ae="set"+(this.$u?"UTC":"");switch(D){case h:return F?j(1,0):j(31,11);case d:return F?j(1,le):j(0,le+1);case c:var Je=this.$locale().weekStart||0,te=(X<Je?X+7:X)-Je;return j(F?ne-te:ne+(6-te),le);case l:case g:return H(Ae+"Hours",0);case u:return H(Ae+"Minutes",1);case a:return H(Ae+"Seconds",2);case s:return H(Ae+"Milliseconds",3);default:return this.clone()}},R.endOf=function(S){return this.startOf(S,!1)},R.$set=function(S,I){var M,F=N.p(S),D="set"+(this.$u?"UTC":""),j=(M={},M[l]=D+"Date",M[g]=D+"Date",M[d]=D+"Month",M[h]=D+"FullYear",M[u]=D+"Hours",M[a]=D+"Minutes",M[s]=D+"Seconds",M[o]=D+"Milliseconds",M)[F],H=F===l?this.$D+(I-this.$W):I;if(F===d||F===h){var X=this.clone().set(g,1);X.$d[j](H),X.init(),this.$d=X.set(g,Math.min(this.$D,X.daysInMonth())).$d}else j&&this.$d[j](H);return this.init(),this},R.set=function(S,I){return this.clone().$set(S,I)},R.get=function(S){return this[N.p(S)]()},R.add=function(S,I){var M,F=this;S=Number(S);var D=N.p(I),j=function(le){var ne=V(F);return N.w(ne.date(ne.date()+Math.round(le*S)),F)};if(D===d)return this.set(d,this.$M+S);if(D===h)return this.set(h,this.$y+S);if(D===l)return j(1);if(D===c)return j(7);var H=(M={},M[a]=r,M[u]=i,M[s]=n,M)[D]||1,X=this.$d.getTime()+S*H;return N.w(X,this)},R.subtract=function(S,I){return this.add(-1*S,I)},R.format=function(S){var I=this,M=this.$locale();if(!this.isValid())return M.invalidDate||p;var F=S||"YYYY-MM-DDTHH:mm:ssZ",D=N.z(this),j=this.$H,H=this.$m,X=this.$M,le=M.weekdays,ne=M.months,Ae=M.meridiem,Je=function(Pe,$t,Qn,Dr){return Pe&&(Pe[$t]||Pe(I,F))||Qn[$t].slice(0,Dr)},te=function(Pe){return N.s(j%12||12,Pe,"0")},Fe=Ae||function(Pe,$t,Qn){var Dr=Pe<12?"AM":"PM";return Qn?Dr.toLowerCase():Dr};return F.replace(w,function(Pe,$t){return $t||function(Qn){switch(Qn){case"YY":return String(I.$y).slice(-2);case"YYYY":return N.s(I.$y,4,"0");case"M":return X+1;case"MM":return N.s(X+1,2,"0");case"MMM":return Je(M.monthsShort,X,ne,3);case"MMMM":return Je(ne,X);case"D":return I.$D;case"DD":return N.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return Je(M.weekdaysMin,I.$W,le,2);case"ddd":return Je(M.weekdaysShort,I.$W,le,3);case"dddd":return le[I.$W];case"H":return String(j);case"HH":return N.s(j,2,"0");case"h":return te(1);case"hh":return te(2);case"a":return Fe(j,H,!0);case"A":return Fe(j,H,!1);case"m":return String(H);case"mm":return N.s(H,2,"0");case"s":return String(I.$s);case"ss":return N.s(I.$s,2,"0");case"SSS":return N.s(I.$ms,3,"0");case"Z":return D}return null}(Pe)||D.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(S,I,M){var F,D=this,j=N.p(I),H=V(S),X=(H.utcOffset()-this.utcOffset())*r,le=this-H,ne=function(){return N.m(D,H)};switch(j){case h:F=ne()/12;break;case d:F=ne();break;case f:F=ne()/3;break;case c:F=(le-X)/6048e5;break;case l:F=(le-X)/864e5;break;case u:F=le/i;break;case a:F=le/r;break;case s:F=le/n;break;default:F=le}return M?F:N.a(F)},R.daysInMonth=function(){return this.endOf(d).$D},R.$locale=function(){return O[this.$L]},R.locale=function(S,I){if(!S)return this.$L;var M=this.clone(),F=T(S,I,!0);return F&&(M.$L=F),M},R.clone=function(){return N.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},P}(),oe=z.prototype;return V.prototype=oe,[["$ms",o],["$s",s],["$m",a],["$H",u],["$W",l],["$M",d],["$y",h],["$D",g]].forEach(function(P){oe[P[1]]=function(R){return this.$g(R,P[0],P[1])}}),V.extend=function(P,R){return P.$i||(P(R,z,V),P.$i=!0),V},V.locale=T,V.isDayjs=_,V.unix=function(P){return V(1e3*P)},V.en=O[C],V.Ls=O,V.p={},V})}(Yr)),Yr.exports}var Tm=Om();const Dm=jc(Tm);/**
2
+ * @license lucide-solid v0.454.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */var Lm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},vn=Lm,_m=he("<svg>"),km=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vm=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Nm=e=>{const[t,n]=k(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var r=_m();return at(r,A(vn,{get width(){return t.size??vn.width},get height(){return t.size??vn.height},get stroke(){return t.color??vn.stroke},get"stroke-width"(){return K(()=>!!t.absoluteStrokeWidth)()?Number(t.strokeWidth??vn["stroke-width"])*24/Number(t.size):Number(t.strokeWidth??vn["stroke-width"])},get class(){return Vm("lucide","lucide-icon",t.name!=null?`lucide-${km(t==null?void 0:t.name)}`:void 0,t.class!=null?t.class:"")}},n),!0,!0),fe(r,b(nt,{get each(){return t.iconNode},children:([i,o])=>b(Lu,A({component:i},o))})),r})()},Ds=Nm,Km=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jm=e=>b(Ds,A(e,{name:"Check",iconNode:Km})),hl=jm,Bm=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zm=e=>b(Ds,A(e,{name:"LoaderCircle",iconNode:Bm})),Gm=zm,Hm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Um=e=>b(Ds,A(e,{name:"X",iconNode:Hm})),gl=Um,jr=he('<div class="flex flex-row items-center">');const qm=[{accessorKey:"id",header:"ID",cell:e=>e.getValue()},{accessorKey:"channel",header:"Channel",cell:e=>e.getValue()},{accessorKey:"platform",header:"Platform",cell:e=>{switch(e.getValue()){case"ios":return"iOS";case"android":return"Android"}}},{accessorKey:"targetAppVersion",header:"Target App Version",cell:e=>e.getValue()},{accessorKey:"enabled",header:"Enabled",cell:e=>e.getValue()?(()=>{var t=jr();return fe(t,b(hl,{class:"text-green-500"})),t})():(()=>{var t=jr();return fe(t,b(gl,{class:"text-red-500"})),t})()},{accessorKey:"shouldForceUpdate",header:"Force Update",cell:e=>e.getValue()?(()=>{var t=jr();return fe(t,b(hl,{class:"text-green-500"})),t})():(()=>{var t=jr();return fe(t,b(gl,{class:"text-red-500"})),t})()},{accessorKey:"message",header:"Message",cell:e=>e.getValue()},{accessorKey:"id",header:"Created At",cell:e=>Dm(Am(String(e.getValue()))).format("YYYY-MM-DD HH:mm:ss")}];function Wm(e){const[t,n]=B(0),[r,i]=B(0);U(()=>{const a=e();if(!a)return;s(a);const u=new ResizeObserver(o);u.observe(a),W(()=>{u.disconnect()})});const o=a=>{for(const u of a)u.target===e()&&s(u.target)},s=a=>{i(a.offsetWidth),n(a.offsetHeight)};return{width:r,height:t}}var Xm=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Qm=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Ym(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return Xm.has(n)}const t=e.split("-")[0];return Qm.has(t)}function Zm(e){return Ym(e)?"rtl":"ltr"}function Bc(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Zm(e)}}var Ko=Bc(),lr=new Set;function pl(){Ko=Bc();for(const e of lr)e(Ko)}function Jm(){const[e,t]=B(Ko),n=K(()=>e());return Bn(()=>{lr.size===0&&window.addEventListener("languagechange",pl),lr.add(t),W(()=>{lr.delete(t),lr.size===0&&window.removeEventListener("languagechange",pl)})}),{locale:()=>n().locale,direction:()=>n().direction}}var ey=we();function Qt(){const e=Jm();return me(ey)||e}var Li=new Map;function ty(e){const{locale:t}=Qt(),n=K(()=>t()+Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join());return K(()=>{const r=n();let i;return Li.has(r)&&(i=Li.get(r)),i||(i=new Intl.Collator(t(),e),Li.set(r,i)),i})}const ny=["top","right","bottom","left"],Ht=Math.min,Ge=Math.max,ri=Math.round,Br=Math.floor,gt=e=>({x:e,y:e}),ry={left:"right",right:"left",bottom:"top",top:"bottom"},iy={start:"end",end:"start"};function jo(e,t,n){return Ge(e,Ht(t,n))}function mn(e,t){return typeof e=="function"?e(t):e}function Ut(e){return e.split("-")[0]}function Hn(e){return e.split("-")[1]}function zc(e){return e==="x"?"y":"x"}function Ls(e){return e==="y"?"height":"width"}function fn(e){return["top","bottom"].includes(Ut(e))?"y":"x"}function _s(e){return zc(fn(e))}function oy(e,t,n){n===void 0&&(n=!1);const r=Hn(e),i=_s(e),o=Ls(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=ii(s)),[s,ii(s)]}function sy(e){const t=ii(e);return[Bo(e),t,Bo(t)]}function Bo(e){return e.replace(/start|end/g,t=>iy[t])}function ay(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function ly(e,t,n,r){const i=Hn(e);let o=ay(Ut(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Bo)))),o}function ii(e){return e.replace(/left|right|bottom|top/g,t=>ry[t])}function uy(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gc(e){return typeof e!="number"?uy(e):{top:e,right:e,bottom:e,left:e}}function oi(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ml(e,t,n){let{reference:r,floating:i}=e;const o=fn(t),s=_s(t),a=Ls(s),u=Ut(t),l=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let h;switch(u){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Hn(t)){case"start":h[s]-=f*(n&&l?-1:1);break;case"end":h[s]+=f*(n&&l?-1:1);break}return h}const cy=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=ml(l,r,u),f=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:y,fn:w}=a[p],{x:m,y:v,data:x,reset:C}=await w({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:l,platform:s,elements:{reference:e,floating:t}});c=m??c,d=v??d,h={...h,[y]:{...h[y],...x}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(l=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:c,y:d}=ml(l,f,u)),p=-1)}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=mn(t,e),g=Gc(h),y=a[f?d==="floating"?"reference":"floating":d],w=oi(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:c,strategy:u})),m=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),x=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},C=oi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:v,strategy:u}):m);return{top:(w.top-C.top+g.top)/x.y,bottom:(C.bottom-w.bottom+g.bottom)/x.y,left:(w.left-C.left+g.left)/x.x,right:(C.right-w.right+g.right)/x.x}}const dy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:u}=t,{element:l,padding:c=0}=mn(e,t)||{};if(l==null)return{};const d=Gc(c),f={x:n,y:r},h=_s(i),g=Ls(h),p=await s.getDimensions(l),y=h==="y",w=y?"top":"left",m=y?"bottom":"right",v=y?"clientHeight":"clientWidth",x=o.reference[g]+o.reference[h]-f[h]-o.floating[g],C=f[h]-o.reference[h],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let L=O?O[v]:0;(!L||!await(s.isElement==null?void 0:s.isElement(O)))&&(L=a.floating[v]||o.floating[g]);const _=x/2-C/2,T=L/2-p[g]/2-1,V=Ht(d[w],T),N=Ht(d[m],T),z=V,oe=L-p[g]-N,P=L/2-p[g]/2+_,R=jo(z,P,oe),S=!u.arrow&&Hn(i)!=null&&P!==R&&o.reference[g]/2-(P<z?V:N)-p[g]/2<0,I=S?P<z?P-z:P-oe:0;return{[h]:f[h]+I,data:{[h]:R,centerOffset:P-R-I,...S&&{alignmentOffset:I}},reset:S}}}),fy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...y}=mn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=Ut(i),m=fn(a),v=Ut(a)===a,x=await(u.isRTL==null?void 0:u.isRTL(l.floating)),C=f||(v||!p?[ii(a)]:sy(a)),O=g!=="none";!f&&O&&C.push(...ly(a,p,g,x));const L=[a,...C],_=await br(t,y),T=[];let V=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&T.push(_[w]),d){const P=oy(i,s,x);T.push(_[P[0]],_[P[1]])}if(V=[...V,{placement:i,overflows:T}],!T.every(P=>P<=0)){var N,z;const P=(((N=o.flip)==null?void 0:N.index)||0)+1,R=L[P];if(R)return{data:{index:P,overflows:V},reset:{placement:R}};let S=(z=V.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:z.placement;if(!S)switch(h){case"bestFit":{var oe;const I=(oe=V.filter(M=>{if(O){const F=fn(M.placement);return F===m||F==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(F=>F>0).reduce((F,D)=>F+D,0)]).sort((M,F)=>M[1]-F[1])[0])==null?void 0:oe[0];I&&(S=I);break}case"initialPlacement":S=a;break}if(i!==S)return{reset:{placement:S}}}return{}}}};function yl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vl(e){return ny.some(t=>e[t]>=0)}const hy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=mn(e,t);switch(r){case"referenceHidden":{const o=await br(t,{...i,elementContext:"reference"}),s=yl(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:vl(s)}}}case"escaped":{const o=await br(t,{...i,altBoundary:!0}),s=yl(o,n.floating);return{data:{escapedOffsets:s,escaped:vl(s)}}}default:return{}}}}};async function gy(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Ut(n),a=Hn(n),u=fn(n)==="y",l=["left","top"].includes(s)?-1:1,c=o&&u?-1:1,d=mn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),u?{x:h*c,y:f*l}:{x:f*l,y:h*c}}const py=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,u=await gy(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},my=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:w,y:m}=y;return{x:w,y:m}}},...u}=mn(e,t),l={x:n,y:r},c=await br(t,u),d=fn(Ut(i)),f=zc(d);let h=l[f],g=l[d];if(o){const y=f==="y"?"top":"left",w=f==="y"?"bottom":"right",m=h+c[y],v=h-c[w];h=jo(m,h,v)}if(s){const y=d==="y"?"top":"left",w=d==="y"?"bottom":"right",m=g+c[y],v=g-c[w];g=jo(m,g,v)}const p=a.fn({...t,[f]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:o,[d]:s}}}}}},yy=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:u=()=>{},...l}=mn(e,t),c=await br(t,l),d=Ut(i),f=Hn(i),h=fn(i)==="y",{width:g,height:p}=o.floating;let y,w;d==="top"||d==="bottom"?(y=d,w=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,y=f==="end"?"top":"bottom");const m=p-c.top-c.bottom,v=g-c.left-c.right,x=Ht(p-c[y],m),C=Ht(g-c[w],v),O=!t.middlewareData.shift;let L=x,_=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=m),O&&!f){const V=Ge(c.left,0),N=Ge(c.right,0),z=Ge(c.top,0),oe=Ge(c.bottom,0);h?_=g-2*(V!==0||N!==0?V+N:Ge(c.left,c.right)):L=p-2*(z!==0||oe!==0?z+oe:Ge(c.top,c.bottom))}await u({...t,availableWidth:_,availableHeight:L});const T=await s.getDimensions(a.floating);return g!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function pi(){return typeof window<"u"}function Un(e){return Hc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bt(e){var t;return(t=(Hc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hc(e){return pi()?e instanceof Node||e instanceof Ue(e).Node:!1}function lt(e){return pi()?e instanceof Element||e instanceof Ue(e).Element:!1}function mt(e){return pi()?e instanceof HTMLElement||e instanceof Ue(e).HTMLElement:!1}function wl(e){return!pi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ue(e).ShadowRoot}function Ar(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function vy(e){return["table","td","th"].includes(Un(e))}function mi(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ks(e){const t=Vs(),n=lt(e)?ut(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function wy(e){let t=qt(e);for(;mt(t)&&!jn(t);){if(ks(t))return t;if(mi(t))return null;t=qt(t)}return null}function Vs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jn(e){return["html","body","#document"].includes(Un(e))}function ut(e){return Ue(e).getComputedStyle(e)}function yi(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wl(e)&&e.host||bt(e);return wl(t)?t.host:t}function Uc(e){const t=qt(e);return jn(t)?e.ownerDocument?e.ownerDocument.body:e.body:mt(t)&&Ar(t)?t:Uc(t)}function Sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Uc(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Ue(i);if(o){const a=zo(s);return t.concat(s,s.visualViewport||[],Ar(i)?i:[],a&&n?Sr(a):[])}return t.concat(i,Sr(i,[],n))}function zo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qc(e){const t=ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=mt(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=ri(n)!==o||ri(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Ns(e){return lt(e)?e:e.contextElement}function Rn(e){const t=Ns(e);if(!mt(t))return gt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=qc(t);let s=(o?ri(n.width):n.width)/r,a=(o?ri(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const by=gt(0);function Wc(e){const t=Ue(e);return!Vs()||!t.visualViewport?by:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ue(e)?!1:t}function hn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ns(e);let s=gt(1);t&&(r?lt(r)&&(s=Rn(r)):s=Rn(e));const a=Sy(o,n,r)?Wc(o):gt(0);let u=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const f=Ue(o),h=r&&lt(r)?Ue(r):r;let g=f,p=zo(g);for(;p&&r&&h!==g;){const y=Rn(p),w=p.getBoundingClientRect(),m=ut(p),v=w.left+(p.clientLeft+parseFloat(m.paddingLeft))*y.x,x=w.top+(p.clientTop+parseFloat(m.paddingTop))*y.y;u*=y.x,l*=y.y,c*=y.x,d*=y.y,u+=v,l+=x,g=Ue(p),p=zo(g)}}return oi({width:c,height:d,x:u,y:l})}function Ks(e,t){const n=yi(e).scrollLeft;return t?t.left+n:hn(bt(e)).left+n}function Xc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Ks(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function xy(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=bt(r),a=t?mi(t.floating):!1;if(r===s||a&&o)return n;let u={scrollLeft:0,scrollTop:0},l=gt(1);const c=gt(0),d=mt(r);if((d||!d&&!o)&&((Un(r)!=="body"||Ar(s))&&(u=yi(r)),mt(r))){const h=hn(r);l=Rn(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=s&&!d&&!o?Xc(s,u,!0):gt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x+f.x,y:n.y*l.y-u.scrollTop*l.y+c.y+f.y}}function Cy(e){return Array.from(e.getClientRects())}function Ey(e){const t=bt(e),n=yi(e),r=e.ownerDocument.body,i=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ks(e);const a=-n.scrollTop;return ut(r).direction==="rtl"&&(s+=Ge(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Ry(e,t){const n=Ue(e),r=bt(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,u=0;if(i){o=i.width,s=i.height;const l=Vs();(!l||l&&t==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:a,y:u}}function Py(e,t){const n=hn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=mt(e)?Rn(e):gt(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,u=i*o.x,l=r*o.y;return{width:s,height:a,x:u,y:l}}function bl(e,t,n){let r;if(t==="viewport")r=Ry(e,n);else if(t==="document")r=Ey(bt(e));else if(lt(t))r=Py(t,n);else{const i=Wc(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return oi(r)}function Qc(e,t){const n=qt(e);return n===t||!lt(n)||jn(n)?!1:ut(n).position==="fixed"||Qc(n,t)}function Iy(e,t){const n=t.get(e);if(n)return n;let r=Sr(e,[],!1).filter(a=>lt(a)&&Un(a)!=="body"),i=null;const o=ut(e).position==="fixed";let s=o?qt(e):e;for(;lt(s)&&!jn(s);){const a=ut(s),u=ks(s);!u&&a.position==="fixed"&&(i=null),(o?!u&&!i:!u&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ar(s)&&!u&&Qc(e,s))?r=r.filter(c=>c!==s):i=a,s=qt(s)}return t.set(e,r),r}function My(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?mi(t)?[]:Iy(t,this._c):[].concat(n),r],a=s[0],u=s.reduce((l,c)=>{const d=bl(t,c,i);return l.top=Ge(d.top,l.top),l.right=Ht(d.right,l.right),l.bottom=Ht(d.bottom,l.bottom),l.left=Ge(d.left,l.left),l},bl(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Fy(e){const{width:t,height:n}=qc(e);return{width:t,height:n}}function Ay(e,t,n){const r=mt(t),i=bt(t),o=n==="fixed",s=hn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const u=gt(0);if(r||!r&&!o)if((Un(t)!=="body"||Ar(i))&&(a=yi(t)),r){const f=hn(t,!0,o,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else i&&(u.x=Ks(i));const l=i&&!r&&!o?Xc(i,a):gt(0),c=s.left+a.scrollLeft-u.x-l.x,d=s.top+a.scrollTop-u.y-l.y;return{x:c,y:d,width:s.width,height:s.height}}function _i(e){return ut(e).position==="static"}function Sl(e,t){if(!mt(e)||ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bt(e)===n&&(n=n.ownerDocument.body),n}function Yc(e,t){const n=Ue(e);if(mi(e))return n;if(!mt(e)){let i=qt(e);for(;i&&!jn(i);){if(lt(i)&&!_i(i))return i;i=qt(i)}return n}let r=Sl(e,t);for(;r&&vy(r)&&_i(r);)r=Sl(r,t);return r&&jn(r)&&_i(r)&&!ks(r)?n:r||wy(e)||n}const $y=async function(e){const t=this.getOffsetParent||Yc,n=this.getDimensions,r=await n(e.floating);return{reference:Ay(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Oy(e){return ut(e).direction==="rtl"}const Zc={convertOffsetParentRelativeRectToViewportRelativeRect:xy,getDocumentElement:bt,getClippingRect:My,getOffsetParent:Yc,getElementRects:$y,getClientRects:Cy,getDimensions:Fy,getScale:Rn,isElement:lt,isRTL:Oy};function Ty(e,t){let n=null,r;const i=bt(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),o();const{left:l,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Br(c),g=Br(i.clientWidth-(l+d)),p=Br(i.clientHeight-(c+f)),y=Br(l),m={rootMargin:-h+"px "+-g+"px "+-p+"px "+-y+"px",threshold:Ge(0,Ht(1,u))||1};let v=!0;function x(C){const O=C[0].intersectionRatio;if(O!==u){if(!v)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(x,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,m)}n.observe(e)}return s(!0),o}function Dy(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Ns(e),c=i||o?[...l?Sr(l):[],...Sr(t)]:[];c.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const d=l&&a?Ty(l,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(w=>{let[m]=w;m&&m.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let g,p=u?hn(e):null;u&&y();function y(){const w=hn(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,g=requestAnimationFrame(y)}return n(),()=>{var w;c.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,u&&cancelAnimationFrame(g)}}const Ly=py,_y=my,ky=fy,Vy=yy,Ny=hy,Ky=dy,jy=(e,t,n)=>{const r=new Map,i={platform:Zc,...n},o={...i.platform,_c:r};return cy(e,t,{...i,platform:o})};var By=he('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),js=we();function Bs(){const e=me(js);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var Go=30,xl=Go/2,zy={top:180,right:-90,bottom:0,left:90};function Jc(e){const t=Bs(),n=Z({size:Go},e),[r,i]=k(n,["ref","style","size"]),o=()=>t.currentPlacement().split("-")[0],s=Gy(t.contentRef),a=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue("background-color"))||"none"},u=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue(`border-${o()}-color`))||"none"},l=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue(`border-${o()}-width`))||"0px"},c=()=>Number.parseInt(l())*2*(Go/r.size),d=()=>`rotate(${zy[o()]} ${xl} ${xl}) translate(0 2)`;return b(ae,A({as:"div",ref(f){var h=ye(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return yt({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:u(),"stroke-width":c()},r.style)}},i,{get children(){var f=By(),h=f.firstChild,g=h.firstChild;return g.nextSibling,Ke(()=>Nn(h,"transform",d())),f}}))}function Gy(e){const[t,n]=B();return U(()=>{const r=e();r&&n(cc(r).getComputedStyle(r))}),t}function Hy(e){const t=Bs(),[n,r]=k(e,["ref","style"]);return b(ae,A({as:"div",ref(i){var o=ye(t.setPositionerRef,n.ref);typeof o=="function"&&o(i)},"data-popper-positioner":"",get style(){return yt({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Cl(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const o={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...o,toJSON:()=>o}}function Uy(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Cl(r):e?e.getBoundingClientRect():Cl()}}}function qy(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Wy={top:"bottom",right:"left",bottom:"top",left:"right"};function Xy(e,t){const[n,r]=e.split("-"),i=Wy[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function Qy(e){const t=Z({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=B(),[i,o]=B(),[s,a]=B(t.placement),u=()=>{var f;return Uy((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:l}=Qt();async function c(){var O,L;const f=u(),h=n(),g=i();if(!f||!h)return;const p=((g==null?void 0:g.clientHeight)||0)/2,y=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const w=[Ly(({placement:_})=>{const T=!!_.split("-")[1];return{mainAxis:y,crossAxis:T?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const _=typeof t.flip=="string"?t.flip.split(" "):void 0;if(_!==void 0&&!_.every(qy))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(ky({padding:t.overflowPadding,fallbackPlacements:_}))}(t.slide||t.overlap)&&w.push(_y({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(Vy({padding:t.overflowPadding,apply({availableWidth:_,availableHeight:T,rects:V}){const N=Math.round(V.reference.width);_=Math.floor(_),T=Math.floor(T),h.style.setProperty("--kb-popper-anchor-width",`${N}px`),h.style.setProperty("--kb-popper-content-available-width",`${_}px`),h.style.setProperty("--kb-popper-content-available-height",`${T}px`),t.sameWidth&&(h.style.width=`${N}px`),t.fitViewport&&(h.style.maxWidth=`${_}px`,h.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&w.push(Ny({padding:t.detachedPadding})),g&&w.push(Ky({element:g,padding:t.arrowPadding}));const m=await jy(f,h,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...Zc,isRTL:()=>l()==="rtl"}});if(a(m.placement),(O=t.onCurrentPlacementChange)==null||O.call(t,m.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",Xy(m.placement,l()));const v=Math.round(m.x),x=Math.round(m.y);let C;if(t.hideWhenDetached&&(C=(L=m.middlewareData.hide)!=null&&L.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${v}px, ${x}px, 0)`,visibility:C}),g&&m.middlewareData.arrow){const{x:_,y:T}=m.middlewareData.arrow,V=m.placement.split("-")[0];Object.assign(g.style,{left:_!=null?`${_}px`:"",top:T!=null?`${T}px`:"",[V]:"100%"})}}U(()=>{const f=u(),h=n();if(!f||!h)return;const g=Dy(f,h,c,{elementResize:typeof ResizeObserver=="function"});W(g)}),U(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:s,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:o};return b(js.Provider,{value:d,get children(){return t.children}})}var vi=Object.assign(Qy,{Arrow:Jc,Context:js,usePopperContext:Bs,Positioner:Hy}),ed=we();function td(){return me(ed)}function Yy(){const e=td();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function nd(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Zy(e,t){var i;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const o=(i=e[r])==null?void 0:i.ref();if(o&&nd(o,n))return r+1}return 0}function Jy(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[o,s])=>{const a=i.ref(),u=s.ref();return a===u||!a||!u?0:nd(a,u)?(r>o&&(n=!0),-1):(r<o&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function rd(e,t){const n=Jy(e);e!==n&&t(n)}function ev(e){var i,o;const t=e[0],n=(i=e[e.length-1])==null?void 0:i.ref();let r=(o=t==null?void 0:t.ref())==null?void 0:o.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Ze(r).body}function tv(e,t){U(()=>{const n=setTimeout(()=>{rd(e(),t)});W(()=>clearTimeout(n))})}function nv(e,t){if(typeof IntersectionObserver!="function"){tv(e,t);return}let n=[];U(()=>{const r=()=>{const s=!!n.length;n=e(),s&&rd(e(),t)},i=ev(e()),o=new IntersectionObserver(r,{root:i});for(const s of e()){const a=s.ref();a&&o.observe(a)}W(()=>o.disconnect())})}function rv(e={}){const[t,n]=lm({value:()=>$(e.items),onChange:o=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,o)}});nv(t,n);const r=o=>(n(s=>{const a=Zy(s,o);return yg(s,o,a)}),()=>{n(s=>{const a=s.filter(u=>u.ref()!==o.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:o=>b(ed.Provider,{value:{registerItem:r},get children(){return o.children}})}}function iv(e){const t=Yy(),n=Z({shouldRegisterItem:!0},e);U(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());W(r)})}function id(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],i=u=>{if(u==null)return"";const l=e.getKey??"key",c=bn(l)?u[l]:l(u);return c!=null?String(c):""},o=u=>{if(u==null)return"";const l=e.getTextValue??"textValue",c=bn(l)?u[l]:l(u);return c!=null?String(c):""},s=u=>{if(u==null)return!1;const l=e.getDisabled??"disabled";return(bn(l)?u[l]:l(u))??!1},a=u=>{var l;if(u!=null)return bn(e.getSectionChildren)?u[e.getSectionChildren]:(l=e.getSectionChildren)==null?void 0:l.call(e,u)};for(const u of e.dataSource){if(bn(u)||vg(u)){r.push({type:"item",rawValue:u,key:String(u),textValue:String(u),disabled:s(u),level:n,index:t}),t++;continue}if(a(u)!=null){r.push({type:"section",rawValue:u,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const l=a(u)??[];if(l.length>0){const c=id({dataSource:l,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...c),t+=c.length}}else r.push({type:"item",rawValue:u,key:i(u),textValue:o(u),disabled:s(u),level:n,index:t}),t++}return r}function ov(e,t=[]){return K(()=>{const n=id({dataSource:$(e.dataSource),getKey:$(e.getKey),getTextValue:$(e.getTextValue),getDisabled:$(e.getDisabled),getSectionChildren:$(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Pt=class od extends Set{constructor(n,r,i){super(n);Re(this,"anchorKey");Re(this,"currentKey");n instanceof od?(this.anchorKey=r||n.anchorKey,this.currentKey=i||n.currentKey):(this.anchorKey=r,this.currentKey=i)}};function sv(e){const[t,n]=pt(e);return[()=>t()??new Pt,n]}function sd(e){return xg()?e.altKey:e.ctrlKey}function Sn(e){return fi()?e.metaKey:e.ctrlKey}function El(e){return new Pt(e)}function av(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function lv(e){const t=Z({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=B(!1),[i,o]=B(),s=K(()=>{const p=$(t.selectedKeys);return p!=null?El(p):p}),a=K(()=>{const p=$(t.defaultSelectedKeys);return p!=null?El(p):new Pt}),[u,l]=sv({value:s,defaultValue:a,onChange:p=>{var y;return(y=t.onSelectionChange)==null?void 0:y.call(t,p)}}),[c,d]=B($(t.selectionBehavior)),f=()=>$(t.selectionMode),h=()=>$(t.disallowEmptySelection)??!1,g=p=>{($(t.allowDuplicateSelectionEvents)||!av(p,u()))&&l(p)};return U(()=>{const p=u();$(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),U(()=>{d($(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:o,selectedKeys:u,setSelectedKeys:g}}function uv(e){const[t,n]=B(""),[r,i]=B(-1);return{typeSelectHandlers:{onKeyDown:s=>{var f;if($(e.isDisabled))return;const a=$(e.keyboardDelegate),u=$(e.selectionManager);if(!a.getKeyForSearch)return;const l=cv(s.key);if(!l||s.ctrlKey||s.metaKey)return;l===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let c=n(h=>h+l),d=a.getKeyForSearch(c,u.focusedKey())??a.getKeyForSearch(c);d==null&&dv(c)&&(c=c[0],d=a.getKeyForSearch(c,u.focusedKey())??a.getKeyForSearch(c)),d!=null&&(u.setFocusedKey(d),(f=e.onTypeSelect)==null||f.call(e,d)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function cv(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function dv(e){return e.split("").every(t=>t===e[0])}function fv(e,t,n){const i=A({selectOnFocus:()=>$(e.selectionManager).selectionBehavior()==="replace"},e),o=()=>t(),{direction:s}=Qt();let a={top:0,left:0};pg(()=>$(i.isVirtualized)?void 0:o(),"scroll",()=>{const y=o();y&&(a={top:y.scrollTop,left:y.scrollLeft})});const{typeSelectHandlers:u}=uv({isDisabled:()=>$(i.disallowTypeAhead),keyboardDelegate:()=>$(i.keyboardDelegate),selectionManager:()=>$(i.selectionManager)}),l=()=>$(i.orientation)??"vertical",c=y=>{var _,T,V,N,z,oe,P,R;ie(y,u.onKeyDown),y.altKey&&y.key==="Tab"&&y.preventDefault();const w=t();if(!(w!=null&&w.contains(y.target)))return;const m=$(i.selectionManager),v=$(i.selectOnFocus),x=S=>{S!=null&&(m.setFocusedKey(S),y.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):v&&!sd(y)&&m.replaceSelection(S))},C=$(i.keyboardDelegate),O=$(i.shouldFocusWrap),L=m.focusedKey();switch(y.key){case(l()==="vertical"?"ArrowDown":"ArrowRight"):{if(C.getKeyBelow){y.preventDefault();let S;L!=null?S=C.getKeyBelow(L):S=(_=C.getFirstKey)==null?void 0:_.call(C),S==null&&O&&(S=(T=C.getFirstKey)==null?void 0:T.call(C,L)),x(S)}break}case(l()==="vertical"?"ArrowUp":"ArrowLeft"):{if(C.getKeyAbove){y.preventDefault();let S;L!=null?S=C.getKeyAbove(L):S=(V=C.getLastKey)==null?void 0:V.call(C),S==null&&O&&(S=(N=C.getLastKey)==null?void 0:N.call(C,L)),x(S)}break}case(l()==="vertical"?"ArrowLeft":"ArrowUp"):{if(C.getKeyLeftOf){y.preventDefault();const S=s()==="rtl";let I;L!=null?I=C.getKeyLeftOf(L):I=S?(z=C.getFirstKey)==null?void 0:z.call(C):(oe=C.getLastKey)==null?void 0:oe.call(C),x(I)}break}case(l()==="vertical"?"ArrowRight":"ArrowDown"):{if(C.getKeyRightOf){y.preventDefault();const S=s()==="rtl";let I;L!=null?I=C.getKeyRightOf(L):I=S?(P=C.getLastKey)==null?void 0:P.call(C):(R=C.getFirstKey)==null?void 0:R.call(C),x(I)}break}case"Home":if(C.getFirstKey){y.preventDefault();const S=C.getFirstKey(L,Sn(y));S!=null&&(m.setFocusedKey(S),Sn(y)&&y.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):v&&m.replaceSelection(S))}break;case"End":if(C.getLastKey){y.preventDefault();const S=C.getLastKey(L,Sn(y));S!=null&&(m.setFocusedKey(S),Sn(y)&&y.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):v&&m.replaceSelection(S))}break;case"PageDown":if(C.getKeyPageBelow&&L!=null){y.preventDefault();const S=C.getKeyPageBelow(L);x(S)}break;case"PageUp":if(C.getKeyPageAbove&&L!=null){y.preventDefault();const S=C.getKeyPageAbove(L);x(S)}break;case"a":Sn(y)&&m.selectionMode()==="multiple"&&$(i.disallowSelectAll)!==!0&&(y.preventDefault(),m.selectAll());break;case"Escape":y.defaultPrevented||(y.preventDefault(),$(i.disallowEmptySelection)||m.clearSelection());break;case"Tab":if(!$(i.allowsTabNavigation)){if(y.shiftKey)w.focus();else{const S=Og(w,{tabbable:!0});let I,M;do M=S.lastChild(),M&&(I=M);while(M);I&&!I.contains(document.activeElement)&&Ie(I)}break}}},d=y=>{var x,C;const w=$(i.selectionManager),m=$(i.keyboardDelegate),v=$(i.selectOnFocus);if(w.isFocused()){y.currentTarget.contains(y.target)||w.setFocused(!1);return}if(y.currentTarget.contains(y.target)){if(w.setFocused(!0),w.focusedKey()==null){const O=_=>{_!=null&&(w.setFocusedKey(_),v&&w.replaceSelection(_))},L=y.relatedTarget;L&&y.currentTarget.compareDocumentPosition(L)&Node.DOCUMENT_POSITION_FOLLOWING?O(w.lastSelectedKey()??((x=m.getLastKey)==null?void 0:x.call(m))):O(w.firstSelectedKey()??((C=m.getFirstKey)==null?void 0:C.call(m)))}else if(!$(i.isVirtualized)){const O=o();if(O){O.scrollTop=a.top,O.scrollLeft=a.left;const L=O.querySelector(`[data-key="${w.focusedKey()}"]`);L&&(Ie(L),Lo(O,L))}}}},f=y=>{const w=$(i.selectionManager);y.currentTarget.contains(y.relatedTarget)||w.setFocused(!1)},h=y=>{o()===y.target&&y.preventDefault()},g=()=>{var O,L;const y=$(i.autoFocus);if(!y)return;const w=$(i.selectionManager),m=$(i.keyboardDelegate);let v;y==="first"&&(v=(O=m.getFirstKey)==null?void 0:O.call(m)),y==="last"&&(v=(L=m.getLastKey)==null?void 0:L.call(m));const x=w.selectedKeys();x.size&&(v=x.values().next().value),w.setFocused(!0),w.setFocusedKey(v);const C=t();C&&v==null&&!$(i.shouldUseVirtualFocus)&&Ie(C)};return Bn(()=>{i.deferAutoFocus?setTimeout(g,0):g()}),U(Ce([o,()=>$(i.isVirtualized),()=>$(i.selectionManager).focusedKey()],y=>{var x;const[w,m,v]=y;if(m)v&&((x=i.scrollToKey)==null||x.call(i,v));else if(v&&w){const C=w.querySelector(`[data-key="${v}"]`);C&&Lo(w,C)}})),{tabIndex:K(()=>{if(!$(i.shouldUseVirtualFocus))return $(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function ad(e,t){const n=()=>$(e.selectionManager),r=()=>$(e.key),i=()=>$(e.shouldUseVirtualFocus),o=m=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):m!=null&&m.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Sn(m)||"pointerType"in m&&m.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>$(e.disabled)||n().isDisabled(r()),u=()=>!a()&&n().canSelectItem(r());let l=null;const c=m=>{u()&&(l=m.pointerType,m.pointerType==="mouse"&&m.button===0&&!$(e.shouldSelectOnPressUp)&&o(m))},d=m=>{u()&&m.pointerType==="mouse"&&m.button===0&&$(e.shouldSelectOnPressUp)&&$(e.allowsDifferentPressOrigin)&&o(m)},f=m=>{u()&&($(e.shouldSelectOnPressUp)&&!$(e.allowsDifferentPressOrigin)||l!=="mouse")&&o(m)},h=m=>{!u()||!["Enter"," "].includes(m.key)||(sd(m)?n().toggleSelection(r()):o(m))},g=m=>{a()&&m.preventDefault()},p=m=>{const v=t();i()||a()||!v||m.target===v&&n().setFocusedKey(r())},y=K(()=>{if(!(i()||a()))return r()===n().focusedKey()?0:-1}),w=K(()=>$(e.virtualized)?void 0:r());return U(Ce([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([m,v,x,C,O])=>{m&&v===C&&O&&!x&&document.activeElement!==m&&(e.focus?e.focus():Ie(m))})),{isSelected:s,isDisabled:a,allowsSelection:u,tabIndex:y,dataKey:w,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:p}}var hv=class{constructor(e,t){Re(this,"collection");Re(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Pt(n,r,t);for(const o of this.getKeyRange(r,n.currentKey||t))i.delete(o);for(const o of this.getKeyRange(t,r))this.canSelectItem(o)&&i.add(o);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Pt(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Pt([t],t,t):new Pt;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Pt;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Pt)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Rl=class{constructor(e){Re(this,"keyMap",new Map);Re(this,"iterable");Re(this,"firstKey");Re(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function gv(e){const t=lv(e),r=ov({dataSource:()=>$(e.dataSource),getKey:()=>$(e.getKey),getTextValue:()=>$(e.getTextValue),getDisabled:()=>$(e.getDisabled),getSectionChildren:()=>$(e.getSectionChildren),factory:o=>e.filter?new Rl(e.filter(o)):new Rl(o)},[()=>e.filter]),i=new hv(r,t);return Mt(()=>{const o=t.focusedKey();o!=null&&!r().getItem(o)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var pv=class{constructor(e,t,n){Re(this,"collection");Re(this,"ref");Re(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n;return((n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))??null}getKeyPageAbove(e){var o;const t=(o=this.ref)==null?void 0:o.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){var o;const t=(o=this.ref)==null?void 0:o.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){var i;const n=(i=this.collator)==null?void 0:i.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const o=this.collection().getItem(r);if(o){const s=o.textValue.slice(0,e.length);if(o.textValue&&n.compare(s,e)===0)return r}r=this.getKeyBelow(r)}}};function mv(e,t,n){const r=ty({usage:"search",sensitivity:"base"}),i=K(()=>{const o=$(e.keyboardDelegate);return o||new pv(e.collection,t,r)});return fv({selectionManager:()=>$(e.selectionManager),keyboardDelegate:i,autoFocus:()=>$(e.autoFocus),deferAutoFocus:()=>$(e.deferAutoFocus),shouldFocusWrap:()=>$(e.shouldFocusWrap),disallowEmptySelection:()=>$(e.disallowEmptySelection),selectOnFocus:()=>$(e.selectOnFocus),disallowTypeAhead:()=>$(e.disallowTypeAhead),shouldUseVirtualFocus:()=>$(e.shouldUseVirtualFocus),allowsTabNavigation:()=>$(e.allowsTabNavigation),isVirtualized:()=>$(e.isVirtualized),scrollToKey:o=>{var s;return(s=$(e.scrollToKey))==null?void 0:s(o)},orientation:()=>$(e.orientation)},t)}function ld(e={}){const[t,n]=Lc({value:()=>$(e.isSelected),defaultValue:()=>!!$(e.defaultIsSelected),onChange:o=>{var s;return(s=e.onSelectedChange)==null?void 0:s.call(e,o)}});return{isSelected:t,setIsSelected:o=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(o)},toggle:()=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(!t())}}}var ud=we();function wi(){return me(ud)}function At(){const e=wi();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var cd=we();function zs(){const e=me(cd);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var dd=we();function St(){const e=me(dd);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function Gs(e){let t;const n=St(),r=At(),i=Z({id:n.generateId(`item-${Ee()}`)},e),[o,s]=k(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,u]=B(),[l,c]=B(),[d,f]=B(),h=()=>r.listState().selectionManager(),g=()=>s.id,p=()=>h().focusedKey()===g(),y=()=>{var T;(T=o.onSelect)==null||T.call(o),o.closeOnSelect&&setTimeout(()=>{r.close(!0)})};iv({getItem:()=>{var T;return{ref:()=>t,type:"item",key:g(),textValue:o.textValue??((T=d())==null?void 0:T.textContent)??(t==null?void 0:t.textContent)??"",disabled:o.disabled??!1}}});const w=ad({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>t),m=T=>{ie(T,o.onPointerMove),T.pointerType==="mouse"&&(o.disabled?r.onItemLeave(T):(r.onItemEnter(T),T.defaultPrevented||(Ie(T.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},v=T=>{ie(T,o.onPointerLeave),T.pointerType==="mouse"&&r.onItemLeave(T)},x=T=>{ie(T,o.onPointerUp),!o.disabled&&T.button===0&&y()},C=T=>{if(ie(T,o.onKeyDown),!T.repeat&&!o.disabled)switch(T.key){case"Enter":case" ":y();break}},O=K(()=>{if(o.indeterminate)return"mixed";if(o.checked!=null)return o.checked}),L=K(()=>({"data-indeterminate":o.indeterminate?"":void 0,"data-checked":o.checked&&!o.indeterminate?"":void 0,"data-disabled":o.disabled?"":void 0,"data-highlighted":p()?"":void 0})),_={isChecked:()=>o.checked,dataset:L,setLabelRef:f,generateId:vt(()=>s.id),registerLabel:Be(u),registerDescription:Be(c)};return b(cd.Provider,{value:_,get children(){return b(ae,A({as:"div",ref(T){var V=ye(N=>t=N,o.ref);typeof V=="function"&&V(T)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return o.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-key"(){return w.dataKey()},get onPointerDown(){return be([o.onPointerDown,w.onPointerDown])},get onPointerUp(){return be([x,w.onPointerUp])},get onClick(){return be([o.onClick,w.onClick])},get onKeyDown(){return be([C,w.onKeyDown])},get onMouseDown(){return be([o.onMouseDown,w.onMouseDown])},get onFocus(){return be([o.onFocus,w.onFocus])},onPointerMove:m,onPointerLeave:v},L,s))}})}function yv(e){const t=Z({closeOnSelect:!1},e),[n,r]=k(t,["checked","defaultChecked","onChange","onSelect"]),i=ld({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>{var a;return(a=n.onChange)==null?void 0:a.call(n,s)},isDisabled:()=>r.disabled});return b(Gs,A({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{var s;(s=n.onSelect)==null||s.call(n),i.toggle()}},r))}var fd=we();function $r(){return me(fd)}function qn(){const e=$r();if(e===void 0)throw new Error("[kobalte]: `useMenubarContext` must be used within a `Menubar` component");return e}var xr={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>xr.next(e==="ltr"?"rtl":"ltr",t)},Pl={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function Il(e){const t=St(),n=At(),r=$r(),{direction:i}=Qt(),o=Z({id:t.generateId("trigger")},e),[s,a]=k(o,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let u=()=>t.value();r!==void 0&&(u=()=>t.value()??s.id,r.lastValue()===void 0&&r.setLastValue(u));const l=hi(()=>n.triggerRef(),()=>"button"),c=K(()=>{var w;return l()==="a"&&((w=n.triggerRef())==null?void 0:w.getAttribute("href"))!=null});U(Ce(()=>r==null?void 0:r.value(),w=>{var m;c()&&w===u()&&((m=n.triggerRef())==null||m.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===u()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=w=>{ie(w,s.onPointerDown),w.currentTarget.dataset.pointerType=w.pointerType,!s.disabled&&w.pointerType!=="touch"&&w.button===0&&d()},h=w=>{ie(w,s.onClick),s.disabled||w.currentTarget.dataset.pointerType==="touch"&&d()},g=w=>{if(ie(w,s.onKeyDown),!s.disabled){if(c())switch(w.key){case"Enter":case" ":return}switch(w.key){case"Enter":case" ":case Pl.first(t.orientation()):w.stopPropagation(),w.preventDefault(),_g(w.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(u);break;case Pl.last(t.orientation()):w.stopPropagation(),w.preventDefault(),n.open("last");break;case xr.next(i(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.nextMenu();break;case xr.previous(i(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.previousMenu();break}}},p=w=>{var m;ie(w,s.onMouseOver),((m=n.triggerRef())==null?void 0:m.dataset.pointerType)!=="touch"&&!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(u)},y=w=>{ie(w,s.onFocus),r!==void 0&&w.currentTarget.dataset.pointerType!=="touch"&&r.setValue(u)};return U(()=>W(n.registerTriggerId(s.id))),b(wt,A({ref(w){var m=ye(n.setTriggerRef,s.ref);typeof m=="function"&&m(w)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return K(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return u()!==void 0&&(r==null?void 0:r.value())===u()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===u()||r.lastValue()===u()?0:-1:void 0},onPointerDown:f,onMouseOver:p,onClick:h,onKeyDown:g,onFocus:y,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var hd=we();function Hs(){return me(hd)}function Or(){const e=Hs();if(e===void 0)throw new Error("[kobalte]: `useNavigationMenuContext` must be used within a `NavigationMenu` component");return e}function gd(e){let t;const n=St(),r=At(),i=$r(),o=Hs(),{direction:s}=Qt(),a=Z({id:n.generateId(`content-${Ee()}`)},e),[u,l]=k(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),f=mv({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);$c({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:v=>{var x;i===void 0&&((x=u.onOpenAutoFocus)==null||x.call(u,v))},onUnmountAutoFocus:u.onCloseAutoFocus},()=>t);const h=v=>{if(_e(v.currentTarget,v.target)&&(v.key==="Tab"&&r.isOpen()&&v.preventDefault(),i!==void 0&&v.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(v.key){case xr.next(s(),n.orientation()):v.stopPropagation(),v.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case xr.previous(s(),n.orientation()):if(v.currentTarget.hasAttribute("data-closed"))break;v.stopPropagation(),v.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},g=v=>{var x;(x=u.onEscapeKeyDown)==null||x.call(u,v),i==null||i.setAutoFocusMenu(!1),r.close(!0)},p=v=>{var x;(x=u.onFocusOutside)==null||x.call(u,v),n.isModal()&&v.preventDefault()},y=v=>{var x,C;ie(v,u.onPointerEnter),r.isOpen()&&((x=r.parentMenuContext())==null||x.listState().selectionManager().setFocused(!1),(C=r.parentMenuContext())==null||C.listState().selectionManager().setFocusedKey(void 0))},w=v=>{if(ie(v,u.onPointerMove),v.pointerType!=="mouse")return;const x=v.target,C=c!==v.clientX;_e(v.currentTarget,x)&&C&&(r.setPointerDir(v.clientX>c?"right":"left"),c=v.clientX)};U(()=>W(r.registerContentId(u.id))),W(()=>r.setContentRef(void 0));const m={ref:ye(v=>{r.setContentRef(v),t=v},u.ref),role:"menu",get id(){return u.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:be([u.onKeyDown,f.onKeyDown,h]),onMouseDown:be([u.onMouseDown,f.onMouseDown]),onFocusIn:be([u.onFocusIn,f.onFocusIn]),onFocusOut:be([u.onFocusOut,f.onFocusOut]),onPointerEnter:y,onPointerMove:w,get"data-orientation"(){return n.orientation()}};return b(Se,{get when(){return r.contentPresent()},get children(){return b(Se,{get when(){return o===void 0||r.parentMenuContext()!=null},get fallback(){return b(ae,A({as:"div"},()=>r.dataset(),m,l))},get children(){return b(vi.Positioner,{get children(){return b(Rs,A({get disableOutsidePointerEvents(){return K(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return yt({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},u.style)},onEscapeKeyDown:g,onFocusOutside:p,get onDismiss(){return r.close}},()=>r.dataset(),m,l))}})}})}})}function vv(e){let t;const n=St(),r=At(),[i,o]=k(e,["ref"]);return _c({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),b(gd,A({ref(s){var a=ye(u=>{t=u},i.ref);typeof a=="function"&&a(s)}},o))}var pd=we();function wv(){const e=me(pd);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function md(e){const t=St(),n=Z({id:t.generateId(`group-${Ee()}`)},e),[r,i]=B(),o={generateId:vt(()=>n.id),registerLabelId:Be(i)};return b(pd.Provider,{value:o,get children(){return b(ae,A({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function bv(e){const t=wv(),n=Z({id:t.generateId("label")},e),[r,i]=k(n,["id"]);return U(()=>W(t.registerLabelId(r.id))),b(ae,A({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function yd(e){const t=At(),n=Z({children:"▼"},e);return b(ae,A({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function Sv(e){return b(Gs,A({role:"menuitem",closeOnSelect:!0},e))}function xv(e){const t=zs(),n=Z({id:t.generateId("description")},e),[r,i]=k(n,["id"]);return U(()=>W(t.registerDescription(r.id))),b(ae,A({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function Cv(e){const t=zs(),n=Z({id:t.generateId("indicator")},e),[r,i]=k(n,["forceMount"]);return b(Se,{get when(){return r.forceMount||t.isChecked()},get children(){return b(ae,A({as:"div"},()=>t.dataset(),i))}})}function Ev(e){const t=zs(),n=Z({id:t.generateId("label")},e),[r,i]=k(n,["ref","id"]);return U(()=>W(t.registerLabel(r.id))),b(ae,A({as:"div",ref(o){var s=ye(t.setLabelRef,r.ref);typeof s=="function"&&s(o)},get id(){return r.id}},()=>t.dataset(),i))}function Rv(e){const t=At();return b(Se,{get when(){return t.contentPresent()},get children(){return b(rs,e)}})}var vd=we();function Pv(){const e=me(vd);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Iv(e){const n=St().generateId(`radiogroup-${Ee()}`),r=Z({id:n},e),[i,o]=k(r,["value","defaultValue","onChange","disabled"]),[s,a]=pt({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:l=>{var c;return(c=i.onChange)==null?void 0:c.call(i,l)}}),u={isDisabled:()=>i.disabled,isSelectedValue:l=>l===s(),setSelectedValue:a};return b(vd.Provider,{value:u,get children(){return b(md,o)}})}function Mv(e){const t=Pv(),n=Z({closeOnSelect:!1},e),[r,i]=k(n,["value","onSelect"]);return b(Gs,A({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var s;(s=r.onSelect)==null||s.call(r),t.setSelectedValue(r.value)}},i))}function Fv(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),o=[],s=t.clientX,a=t.clientY;switch(r){case"top":o.push([s,a+5]),o.push([i.left,i.bottom]),o.push([i.left,i.top]),o.push([i.right,i.top]),o.push([i.right,i.bottom]);break;case"right":o.push([s-5,a]),o.push([i.left,i.top]),o.push([i.right,i.top]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]);break;case"bottom":o.push([s,a-5]),o.push([i.right,i.top]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]),o.push([i.left,i.top]);break;case"left":o.push([s+5,a]),o.push([i.right,i.bottom]),o.push([i.left,i.bottom]),o.push([i.left,i.top]),o.push([i.right,i.top]);break}return o}function Av(e,t){return t?Lg([e.clientX,e.clientY],t):!1}function wd(e){const t=St(),n=td(),r=wi(),i=$r(),o=Hs(),s=Z({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,u]=k(s,["open","defaultOpen","onOpenChange"]);let l=0,c=null,d="right";const[f,h]=B(),[g,p]=B(),[y,w]=B(),[m,v]=B(),[x,C]=B(!0),[O,L]=B(u.placement),[_,T]=B([]),[V,N]=B([]),{DomCollectionProvider:z}=rv({items:V,onItemsChange:N}),oe=Ps({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:te=>{var Fe;return(Fe=a.onOpenChange)==null?void 0:Fe.call(a,te)}}),{present:P}=wr({show:()=>t.forceMount()||oe.isOpen(),element:()=>m()??null}),R=gv({selectionMode:"none",dataSource:V}),S=te=>{C(te),oe.open()},I=(te=!1)=>{oe.close(),te&&r&&r.close(!0)},M=te=>{C(te),oe.toggle()},F=()=>{const te=m();te&&(Ie(te),R.selectionManager().setFocused(!0),R.selectionManager().setFocusedKey(void 0))},D=()=>{o!=null?setTimeout(()=>F()):F()},j=te=>{T(Pe=>[...Pe,te]);const Fe=r==null?void 0:r.registerNestedMenu(te);return()=>{T(Pe=>Do(Pe,te)),Fe==null||Fe()}},H=te=>d===(c==null?void 0:c.side)&&Av(te,c==null?void 0:c.area),X=te=>{H(te)&&te.preventDefault()},le=te=>{H(te)||D()},ne=te=>{H(te)&&te.preventDefault()};Oc({isDisabled:()=>!(r==null&&oe.isOpen()&&t.isModal()),targets:()=>[m(),..._()].filter(Boolean)}),U(()=>{const te=m();if(!te||!r)return;const Fe=r.registerNestedMenu(te);W(()=>{Fe()})}),U(()=>{r===void 0&&(i==null||i.registerMenu(t.value(),[m(),..._()]))}),U(()=>{var te;r!==void 0||i===void 0||(i.value()===t.value()?((te=y())==null||te.focus(),i.autoFocusMenu()&&S(!0)):I())}),U(()=>{r!==void 0||i===void 0||oe.isOpen()&&i.setValue(t.value())}),W(()=>{r===void 0&&(i==null||i.unregisterMenu(t.value()))});const Je={dataset:K(()=>({"data-expanded":oe.isOpen()?"":void 0,"data-closed":oe.isOpen()?void 0:""})),isOpen:oe.isOpen,contentPresent:P,nestedMenus:_,currentPlacement:O,pointerGraceTimeoutId:()=>l,autoFocus:x,listState:()=>R,parentMenuContext:()=>r,triggerRef:y,contentRef:m,triggerId:f,contentId:g,setTriggerRef:w,setContentRef:v,open:S,close:I,toggle:M,focusContent:D,onItemEnter:X,onItemLeave:le,onTriggerLeave:ne,setPointerDir:te=>d=te,setPointerGraceTimeoutId:te=>l=te,setPointerGraceIntent:te=>c=te,registerNestedMenu:j,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Be(h),registerContentId:Be(p)};return b(z,{get children(){return b(ud.Provider,{value:Je,get children(){return b(Se,{when:o===void 0,get fallback(){return u.children},get children(){return b(vi,A({anchorRef:y,contentRef:m,onCurrentPlacementChange:L},u))}})}})}})}function $v(e){const{direction:t}=Qt();return b(wd,A({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Ov={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Tv(e){const t=At(),n=St(),[r,i]=k(e,["onFocusOutside","onKeyDown"]),{direction:o}=Qt();return b(gd,A({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;_e(t.triggerRef(),d)||t.close()},onKeyDown:c=>{ie(c,r.onKeyDown);const d=_e(c.currentTarget,c.target),f=Ov.close(o(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Ie(t.triggerRef()))}},i))}var Ml=["Enter"," "],Dv={open:(e,t)=>e==="ltr"?[...Ml,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Ml,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Lv(e){let t;const n=St(),r=At(),i=Z({id:n.generateId(`sub-trigger-${Ee()}`)},e),[o,s]=k(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const u=()=>{a&&window.clearTimeout(a),a=null},{direction:l}=Qt(),c=()=>o.id,d=()=>{const v=r.parentMenuContext();if(v==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return v.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),g=ad({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>o.disabled},()=>t),p=v=>{ie(v,o.onClick),!r.isOpen()&&!o.disabled&&r.open(!0)},y=v=>{var C;if(ie(v,o.onPointerMove),v.pointerType!=="mouse")return;const x=r.parentMenuContext();if(x==null||x.onItemEnter(v),!v.defaultPrevented){if(o.disabled){x==null||x.onItemLeave(v);return}!r.isOpen()&&!a&&((C=r.parentMenuContext())==null||C.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),u()},100)),x==null||x.onItemEnter(v),v.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Ie(v.currentTarget),x==null||x.listState().selectionManager().setFocused(!0),x==null||x.listState().selectionManager().setFocusedKey(c()))}},w=v=>{if(ie(v,o.onPointerLeave),v.pointerType!=="mouse")return;u();const x=r.parentMenuContext(),C=r.contentRef();if(C){x==null||x.setPointerGraceIntent({area:Fv(r.currentPlacement(),v,C),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(x==null?void 0:x.pointerGraceTimeoutId());const O=window.setTimeout(()=>{x==null||x.setPointerGraceIntent(null)},300);x==null||x.setPointerGraceTimeoutId(O)}else{if(x==null||x.onTriggerLeave(v),v.defaultPrevented)return;x==null||x.setPointerGraceIntent(null)}x==null||x.onItemLeave(v)},m=v=>{ie(v,o.onKeyDown),!v.repeat&&(o.disabled||Dv.open(l(),n.orientation()).includes(v.key)&&(v.stopPropagation(),v.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return U(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const v=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:o.textValue??(t==null?void 0:t.textContent)??"",disabled:o.disabled??!1});W(v)}),U(Ce(()=>{var v;return(v=r.parentMenuContext())==null?void 0:v.pointerGraceTimeoutId()},v=>{W(()=>{var x;window.clearTimeout(v),(x=r.parentMenuContext())==null||x.setPointerGraceIntent(null)})})),U(()=>W(r.registerTriggerId(o.id))),W(()=>{u()}),b(ae,A({as:"div",ref(v){var x=ye(C=>{r.setTriggerRef(C),t=C},o.ref);typeof x=="function"&&x(v)},get id(){return o.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return K(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return o.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return o.disabled?"":void 0},get onPointerDown(){return be([o.onPointerDown,g.onPointerDown])},get onPointerUp(){return be([o.onPointerUp,g.onPointerUp])},get onClick(){return be([p,g.onClick])},get onKeyDown(){return be([m,g.onKeyDown])},get onMouseDown(){return be([o.onMouseDown,g.onMouseDown])},get onFocus(){return be([o.onFocus,g.onFocus])},onPointerMove:y,onPointerLeave:w},()=>r.dataset(),s))}function _v(e){const t=$r(),n=`menu-${Ee()}`,r=Z({id:n,modal:!0},e),[i,o]=k(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=Ps({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:u=>{var l;return(l=i.onOpenChange)==null?void 0:l.call(i,u)}}),a={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??a.isModal(),forceMount:()=>i.forceMount??!1,generateId:vt(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??(t==null?void 0:t.orientation())??"horizontal"};return b(dd.Provider,{value:a,get children(){return b(wd,A({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},o))}})}function bd(e){const t=qn(),n=Z({modal:!1},e),[r,i]=k(n,["value"]),o=Ee(),s=t.generateId(`menubar-menu-${o}`),a=Z({id:s},i);return b(_v,A({get value(){return r.value??o}},a))}function kv(e){let t;const n=`menubar-${Ee()}`,r=Z({id:n,loop:!0,orientation:"horizontal"},e),[i,o]=k(r,["ref","value","defaultValue","onValueChange","loop","focusOnAlt","autoFocusMenu","onAutoFocusMenuChange","orientation"]),[s,a]=pt({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:m=>{var v;return(v=i.onValueChange)==null?void 0:v.call(i,m)}}),[u,l]=B(),[c,d]=B(new Map),[f,h]=pt({value:()=>i.autoFocusMenu,defaultValue:()=>!1,onChange:i.onAutoFocusMenuChange}),g=()=>{var m;return s()&&f()&&!((m=s())!=null&&m.includes("link-trigger-"))},y={dataset:K(()=>({"data-expanded":g()?"":void 0,"data-closed":g()?void 0:""})),value:s,setValue:a,lastValue:u,setLastValue:l,menus:()=>new Set([...c().keys()]),menuRefs:()=>[...c().values()].flat(),menuRefMap:()=>c(),registerMenu:(m,v)=>{d(x=>{const C=new Map;return x.forEach((O,L)=>C.set(L,O)),C.set(m,v),C})},unregisterMenu:m=>{d(v=>{v.delete(m);const x=new Map;return v.forEach((C,O)=>x.set(O,C)),x})},nextMenu:()=>{const m=[...c().keys()];if(s()==null){a(m[0]);return}const v=m.indexOf(s());if(v===m.length-1){i.loop&&a(m[0]);return}a(m[v+1])},previousMenu:()=>{const m=[...c().keys()];if(s()==null){a(m[0]);return}const v=m.indexOf(s());if(v===0){i.loop&&a(m[m.length-1]);return}a(m[v-1])},closeMenu:()=>{h(!1),a(void 0)},autoFocusMenu:()=>f(),setAutoFocusMenu:h,generateId:vt(()=>o.id),orientation:()=>i.orientation};U(()=>{s()==null&&h(!1)}),Tc({onInteractOutside:()=>{y.closeMenu(),setTimeout(()=>y.closeMenu())},shouldExcludeElement:m=>[t,...c().values()].flat().some(v=>_e(v,m))},()=>t);const w=m=>{m.key==="Alt"&&(m.preventDefault(),m.stopPropagation(),y.value()===void 0?y.nextMenu():y.closeMenu())};return U(()=>{i.focusOnAlt?window.addEventListener("keydown",w):window.removeEventListener("keydown",w),W(()=>{window.removeEventListener("keydown",w)})}),U(()=>{s()!=null&&l(s())}),b(fd.Provider,{value:y,get children(){return b(ae,A({as:"div",ref(m){var v=ye(x=>t=x,i.ref);typeof v=="function"&&v(m)},role:"menubar",get"data-orientation"(){return i.orientation},get"aria-orientation"(){return i.orientation}},o))}})}function Vv(e){const t=qn();if(wi()===void 0&&Object.hasOwn(e,"href")){const r=t.generateId("link-trigger-")+Ee();return b(bd,{value:r,get children(){return b(Il,e)}})}return Il(e)}var Nv={};Xt(Nv,{Root:()=>Us,Separator:()=>Kv});function Us(e){let t;const n=Z({orientation:"horizontal"},e),[r,i]=k(n,["ref","orientation"]),o=hi(()=>t,()=>"hr");return b(ae,A({as:"hr",ref(s){var a=ye(u=>t=u,r.ref);typeof a=="function"&&a(s)},get role(){return o()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var Kv=Us,Sd=he("<li role=presentation>"),jv=he("<nav>");function Bv(e){let t;const n=qn(),r=Z({size:15},e),[i,o]=k(r,["ref"]),[s,a]=B(0),u=()=>n.orientation()==="horizontal";return U(Ce(n.value,l=>{setTimeout(()=>{if(!l||l.includes("link-trigger-"))return;const c=document.querySelector(`[data-kb-menu-value-trigger="${l}"]`);if(!c||!t)return;const d=c.getBoundingClientRect()[u()?"x":"y"]+c.getBoundingClientRect()[u()?"width":"height"]/2,f=window.getComputedStyle(t),h=t.getBoundingClientRect()[u()?"x":"y"]+t.getBoundingClientRect()[u()?"width":"height"]/2-Number.parseFloat(f.transform.split(",")[u()?4:5]);a(d-h)})})),b(Jc,A({ref(l){var c=ye(d=>t=d,i.ref);typeof c=="function"&&c(l)},get style(){return{transform:`translate${u()?"X":"Y"}(${s()}px)`,color:"red"}}},o))}function xd(e){const t=Or(),n=qn(),r=St(),[i,o]=B(),[s,a]=k(e,["onPointerEnter","onPointerLeave"]),u=c=>{ie(c,s.onPointerEnter),t.cancelLeaveTimer()},l=c=>{ie(c,s.onPointerLeave),t.startLeaveTimer()};return U(Ce(n.value,c=>{ai(()=>{if(!c||c.includes("link-trigger-")){t.setPreviousMenu(void 0);return}if(c===r.value()){if(t.previousMenu()!=null){const g=[...n.menus()],p=g.indexOf(t.previousMenu()),y=g.indexOf(c);p<y?o("from-end"):o("from-start")}else o(void 0);t.setPreviousMenu(c);return}const d=[...n.menus()],f=d.indexOf(t.previousMenu()),h=d.indexOf(c);f>h?o("to-end"):o("to-start")})})),b(vv,A({as:"ul",onPointerEnter:u,onPointerLeave:l,onInteractOutside:()=>{t.setAutoFocusMenu(!1)},get"data-motion"(){return i()}},a))}function Cd(e){return(()=>{var t=Sd();return fe(t,b(Sv,A({as:"a"},e))),t})()}function Ed(e){const t=qn(),n=Or(),[r,i]=k(e,["value"]),o=Ee(),s=t.generateId(`navigation-menu-menu-${o}`),a=Z({id:s},i),u=()=>r.value??o,[l,c]=B(!1),d=()=>{var f,h;t.value()!==u()&&c(!1),(f=n.viewportRef())==null||f.removeEventListener("animationend",d),(h=n.viewportRef())==null||h.removeEventListener("animationcancel",d)};return U(Ce(t.value,f=>{if(f===u())c(!0);else{const h=n.viewportRef();if(!h||["","none"].includes(window.getComputedStyle(h).animationName)){c(!1);return}h.addEventListener("animationend",d)}})),b(bd,A({get forceMount(){return l()},get value(){return u()}},a))}function Rd(e){const t=Or(),n=At(),[r,i]=k(e,["ref"]);return b(Se,{get when(){return t.viewportPresent()},get children(){return b(Rv,A({ref(o){var s=ye(a=>{a&&a.setAttribute("role","presentation")},r.ref);typeof s=="function"&&s(o)},get mount(){return K(()=>n.parentMenuContext()==null)()?t.viewportRef():void 0}},i))}})}function Pd(e){const t=Z({delayDuration:200,skipDelayDuration:300},e),[n,r,i]=k(t,["ref","delayDuration","skipDelayDuration","autoFocusMenu","onAutoFocusMenuChange","defaultValue","value","onValueChange","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"]),[o,s]=pt({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:T=>{var V;return(V=n.onValueChange)==null?void 0:V.call(n,T)}}),[a,u]=pt({value:()=>n.autoFocusMenu,defaultValue:()=>!1,onChange:n.onAutoFocusMenuChange}),[l,c]=B(),[d,f]=B(),[h,g]=B(r.placement??i.orientation==="vertical"?"right":"bottom");U(()=>{g(i.orientation==="vertical"?"right":"bottom")});let p;const[y,w]=B(),[m,v]=B(!1),[x,C]=B(!1);U(()=>{o()&&!o().includes("link-trigger-")&&a()?ai(()=>{C(!0),v(!0)}):(C(!1),v(!1))});const O=K(()=>({"data-expanded":x()?"":void 0,"data-closed":x()?void 0:""})),{present:L}=wr({show:()=>n.forceMount||m()||x(),element:()=>l()??null});U(()=>{L()||_.setPreviousMenu(void 0)});const _={dataset:O,delayDuration:()=>n.delayDuration,skipDelayDuration:()=>n.skipDelayDuration,autoFocusMenu:a,setAutoFocusMenu:u,startLeaveTimer:()=>{p=window.setTimeout(()=>{_.setAutoFocusMenu(!1),s(void 0)},_.skipDelayDuration())},cancelLeaveTimer:()=>{p&&clearTimeout(p)},rootRef:d,setRootRef:f,viewportRef:l,setViewportRef:c,viewportPresent:L,currentPlacement:h,previousMenu:y,setPreviousMenu:w};return b(hd.Provider,{value:_,get children(){return b(vi,A({anchorRef:d,contentRef:l,get placement(){return h()},onCurrentPlacementChange:g},r,{get children(){var T=jv();return fe(T,b(kv,A({as:"ul",ref(V){var N=ye(_.setRootRef,n.ref);typeof N=="function"&&N(V)},get value(){return o()??null},onValueChange:s,get autoFocusMenu(){return a()},onAutoFocusMenuChange:u},i))),T}}))}})}function Id(e){const t=Or(),n=wi(),[r,i]=k(e,["onPointerEnter","onPointerLeave","onClick"]);let o;const s=l=>{ie(l,r.onClick),o&&clearTimeout(o)},a=l=>{ie(l,r.onPointerEnter),l.pointerType!=="touch"&&(t.cancelLeaveTimer(),t.dataset()["data-expanded"]!==""&&(o=window.setTimeout(()=>{var c;(c=n==null?void 0:n.triggerRef())==null||c.focus(),setTimeout(()=>{t.setAutoFocusMenu(!0)})},t.delayDuration())))},u=l=>{ie(l,r.onPointerLeave),l.pointerType!=="touch"&&(t.startLeaveTimer(),o&&clearTimeout(o))};return(()=>{var l=Sd();return fe(l,b(Vv,A({onClick:s,onPointerEnter:a,onPointerLeave:u},i))),l})()}function Md(e){const t=Or(),n=qn(),[r,i]=B(),[o,s]=k(e,["ref","style","onEscapeKeyDown"]),a=()=>{n.setAutoFocusMenu(!1),n.closeMenu()},u=f=>{a()},l=Wm(r);U(Ce(()=>n.value()?n.menuRefMap().get(n.value()):void 0,f=>{f===void 0||f[0]===void 0||i(f[0])}));const c=K(f=>{if(!(r()===void 0||!t.viewportPresent()))return l.height()===0?f:l.height()}),d=K(f=>{if(!(r()===void 0||!t.viewportPresent()))return l.width()===0?f:l.width()});return b(Se,{get when(){return t.viewportPresent()},get children(){return b(vi.Positioner,{role:"presentation",get children(){return b(Rs,A({as:"li",ref(f){var h=ye(t.setViewportRef,o.ref);typeof h=="function"&&h(f)},get excludedElements(){return[t.rootRef]},bypassTopMostLayerCheck:!0,get style(){return yt({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)","--kb-navigation-menu-viewport-height":c()?`${c()}px`:void 0,"--kb-navigation-menu-viewport-width":d()?`${d()}px`:void 0,position:"relative"},o.style)},get onEscapeKeyDown(){return be([o.onEscapeKeyDown,u])},onDismiss:a,get"data-orientation"(){return n.orientation()}},()=>t.dataset(),s))}})}})}Object.assign(Pd,{Arrow:Bv,CheckboxItem:yv,Content:xd,Group:md,GroupLabel:bv,Icon:yd,Item:Cd,ItemDescription:xv,ItemIndicator:Cv,ItemLabel:Ev,Portal:Rd,RadioGroup:Iv,RadioItem:Mv,Menu:Ed,Separator:Us,Sub:$v,SubContent:Tv,SubTrigger:Lv,Trigger:Id,Viewport:Md});var zv=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class="relative top-px ml-1 size-3 transition duration-200 group-data-[expanded]/trigger:rotate-180 group-data-[orientation=vertical]/menu:-rotate-90 group-data-[orientation=vertical]/menu:group-data-[expanded]/trigger:rotate-90"><path d="M6 9l6 6l6 -6">');const Fl=Ed,Al=e=>{const[t,n]=k(e,["class","children"]);return b(Pd,A({gutter:6,get class(){return de("group/menu flex w-max flex-1 list-none items-center justify-center data-[orientation=vertical]:flex-col [&>li]:w-full",t.class)}},n,{get children(){return[K(()=>t.children),b(Gv,{})]}}))},$l=e=>{const[t,n]=k(e,["class"]);return b(Id,A({get class(){return de("group/trigger inline-flex h-10 w-full items-center justify-center whitespace-nowrap rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[expanded]:bg-accent/50",t.class)}},n))},Ol=()=>b(yd,{"aria-hidden":"true",get children(){return zv()}}),Gv=e=>{const[t,n]=k(e,["class"]);return b(Md,A({get class(){return de("pointer-events-none z-[1000] flex h-[var(--kb-navigation-menu-viewport-height)] w-[var(--kb-navigation-menu-viewport-width)] origin-[var(--kb-menu-content-transform-origin)] items-center justify-center overflow-x-clip overflow-y-visible rounded-md border bg-popover opacity-0 shadow-lg data-[expanded]:pointer-events-auto data-[orientation=vertical]:overflow-y-clip data-[orientation=vertical]:overflow-x-visible data-[expanded]:rounded-md","animate-content-hide transition-[width,height] duration-200 ease-in data-[expanded]:animate-content-show data-[expanded]:opacity-100 data-[expanded]:ease-out",t.class)}},n))},Tl=e=>{const[t,n]=k(e,["class"]);return b(Rd,{get children(){return b(xd,A({get class(){return de("pointer-events-none absolute left-0 top-0 box-border p-1 focus:outline-none data-[expanded]:pointer-events-auto","data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out","data-[orientation=horizontal]:data-[motion=from-start]:slide-in-from-left-52 data-[orientation=horizontal]:data-[motion=to-end]:slide-out-to-right-52","data-[orientation=horizontal]:data-[motion=from-end]:slide-in-from-right-52 data-[orientation=horizontal]:data-[motion=to-start]:slide-out-to-left-52","data-[orientation=vertical]:data-[motion=from-start]:slide-in-from-top-52 data-[orientation=vertical]:data-[motion=to-end]:slide-out-to-bottom-52","data-[orientation=vertical]:data-[motion=from-end]:slide-in-from-bottom-52 data-[orientation=vertical]:data-[motion=to-start]:slide-out-to-bottom-52",t.class)}},n))}})},Dl=e=>{const[t,n]=k(e,["class"]);return b(Cd,A({get class(){return de("text-sm block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",t.class)}},n))};/**
7
+ * table-core
8
+ *
9
+ * Copyright (c) TanStack
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE.md file in the root directory of this source tree.
13
+ *
14
+ * @license MIT
15
+ */function Bt(e,t){return typeof e=="function"?e(t):e}function qe(e,t){return n=>{t.setState(r=>({...r,[e]:Bt(n,r[e])}))}}function bi(e){return e instanceof Function}function Hv(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Uv(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function Q(e,t,n){let r=[],i;return o=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(o);if(!(a.length!==r.length||a.some((c,d)=>r[d]!==c)))return i;r=a;let l;if(n.key&&n.debug&&(l=Date.now()),i=t(...a),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-l)*100)/100,f=d/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(d,5)} /${h(c,5)} ms`,`
16
+ font-size: .6rem;
17
+ font-weight: bold;
18
+ color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Y(e,t,n,r){return{debug:()=>{var i;return(i=e==null?void 0:e.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function qv(e,t,n,r){const i=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Q(()=>[e,n,t,o],(s,a,u,l)=>({table:s,column:a,row:u,cell:l,getValue:l.getValue,renderValue:l.renderValue}),Y(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}function Wv(e,t,n,r){var i,o;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let l=(i=(o=a.id)!=null?o:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,c;if(a.accessorFn?c=a.accessorFn:u&&(u.includes(".")?c=f=>{let h=f;for(const p of u.split(".")){var g;h=(g=h)==null?void 0:g[p]}return h}:c=f=>f[a.accessorKey]),!l)throw new Error;let d={id:`${String(l)}`,accessorFn:c,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Q(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},Y(e.options,"debugColumns")),getLeafColumns:Q(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=d.columns)!=null&&h.length){let g=d.columns.flatMap(p=>p.getLeafColumns());return f(g)}return[d]},Y(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const $e="debugHeaders";function Ll(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),s.push(u)};return a(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const Xv={createTable:e=>{e.getHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,s;const a=(o=r==null?void 0:r.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?o:[],u=(s=i==null?void 0:i.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?s:[],l=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(i!=null&&i.includes(d.id)));return zr(t,[...a,...l,...u],e)},Y(e.options,$e)),e.getCenterHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),zr(t,n,e,"center")),Y(e.options,$e)),e.getLeftHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return zr(t,o,e,"left")},Y(e.options,$e)),e.getRightHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return zr(t,o,e,"right")},Y(e.options,$e)),e.getFooterGroups=Q(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getLeftFooterGroups=Q(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getCenterFooterGroups=Q(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getRightFooterGroups=Q(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getFlatHeaders=Q(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getLeftFlatHeaders=Q(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getCenterFlatHeaders=Q(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getRightFlatHeaders=Q(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getCenterLeafHeaders=Q(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getLeftLeafHeaders=Q(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getRightLeafHeaders=Q(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getLeafHeaders=Q(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,s,a,u,l;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(u=(l=r[0])==null?void 0:l.headers)!=null?u:[]].map(c=>c.getLeafHeaders()).flat()},Y(e.options,$e))}};function zr(e,t,n,r){var i,o;let s=0;const a=function(f,h){h===void 0&&(h=1),s=Math.max(s,h),f.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let u=[];const l=(f,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(y=>{const w=[...p].reverse()[0],m=y.column.depth===g.depth;let v,x=!1;if(m&&y.column.parent?v=y.column.parent:(v=y.column,x=!0),w&&(w==null?void 0:w.column)===v)w.subHeaders.push(y);else{const C=Ll(n,v,{id:[r,h,v.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:x,placeholderId:x?`${p.filter(O=>O.column===v).length}`:void 0,depth:h,index:p.length});C.subHeaders.push(y),p.push(C)}g.headers.push(y),y.headerGroup=g}),u.push(g),h>0&&l(p,h-1)},c=t.map((f,h)=>Ll(n,f,{depth:s,index:h}));l(c,s-1),u.reverse();const d=f=>f.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,y=0,w=[0];g.subHeaders&&g.subHeaders.length?(w=[],d(g.subHeaders).forEach(v=>{let{colSpan:x,rowSpan:C}=v;p+=x,w.push(C)})):p=1;const m=Math.min(...w);return y=y+m,g.colSpan=p,g.rowSpan=y,{colSpan:p,rowSpan:y}});return d((i=(o=u[0])==null?void 0:o.headers)!=null?i:[]),u}const qs=(e,t,n,r,i,o,s)=>{let a={id:t,index:r,original:n,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return a._valuesCache[u]=l.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return l.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=l.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var l;return(l=a.getValue(u))!=null?l:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Uv(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],l=a;for(;;){const c=l.getParentRow();if(!c)break;u.push(c),l=c}return u.reverse()},getAllCells:Q(()=>[e.getAllLeafColumns()],u=>u.map(l=>qv(e,a,l,l.id)),Y(e.options,"debugRows")),_getAllCellsByColumnId:Q(()=>[a.getAllCells()],u=>u.reduce((l,c)=>(l[c.column.id]=c,l),{}),Y(e.options,"debugRows"))};for(let u=0;u<e._features.length;u++){const l=e._features[u];l==null||l.createRow==null||l.createRow(a,e)}return a},Qv={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Fd=(e,t,n)=>{var r,i;const o=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(o))};Fd.autoRemove=e=>it(e);const Ad=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ad.autoRemove=e=>it(e);const $d=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};$d.autoRemove=e=>it(e);const Od=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Od.autoRemove=e=>it(e)||!(e!=null&&e.length);const Td=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});Td.autoRemove=e=>it(e)||!(e!=null&&e.length);const Dd=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});Dd.autoRemove=e=>it(e)||!(e!=null&&e.length);const Ld=(e,t,n)=>e.getValue(t)===n;Ld.autoRemove=e=>it(e);const _d=(e,t,n)=>e.getValue(t)==n;_d.autoRemove=e=>it(e);const Ws=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};Ws.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(i)?1/0:i;if(o>s){const a=o;o=s,s=a}return[o,s]};Ws.autoRemove=e=>it(e)||it(e[0])&&it(e[1]);const Et={includesString:Fd,includesStringSensitive:Ad,equalsString:$d,arrIncludes:Od,arrIncludesAll:Td,arrIncludesSome:Dd,equals:Ld,weakEquals:_d,inNumberRange:Ws};function it(e){return e==null||e===""}const Yv={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:qe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Et.includesString:typeof r=="number"?Et.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Et.equals:Array.isArray(r)?Et.arrIncludes:Et.weakEquals},e.getFilterFn=()=>{var n,r;return bi(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Et[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r==null?void 0:r.find(c=>c.id===e.id),s=Bt(n,o?o.value:void 0);if(_l(i,s,e)){var a;return(a=r==null?void 0:r.filter(c=>c.id!==e.id))!=null?a:[]}const u={id:e.id,value:s};if(o){var l;return(l=r==null?void 0:r.map(c=>c.id===e.id?u:c))!=null?l:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=Bt(t,i))==null?void 0:o.filter(s=>{const a=n.find(u=>u.id===s.id);if(a){const u=a.getFilterFn();if(_l(u,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function _l(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Zv=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),Jv=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},ew=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},tw=(e,t,n)=>{let r,i;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=i=s):(r>s&&(r=s),i<s&&(i=s)))}),[r,i]},nw=(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},rw=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!Hv(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,s)=>o-s);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},iw=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),ow=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,sw=(e,t)=>t.length,ki={sum:Zv,min:Jv,max:ew,extent:tw,mean:nw,median:rw,unique:iw,uniqueCount:ow,count:sw},aw={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:qe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return ki.sum;if(Object.prototype.toString.call(r)==="[object Date]")return ki.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return bi(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:ki[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function lw(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const uw={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:qe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Q(n=>[cr(t,n)],n=>n.findIndex(r=>r.id===e.id),Y(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=cr(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=cr(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Q(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const s=[...t],a=[...i];for(;a.length&&s.length;){const u=s.shift(),l=a.findIndex(c=>c.id===u);l>-1&&o.push(a.splice(l,1)[0])}o=[...o,...a]}return lw(o,n,r)},Y(e.options,"debugTable"))}},Vi=()=>({left:[],right:[]}),cw={getInitialState:e=>({columnPinning:Vi(),...e}),getDefaultOptions:e=>({onColumnPinningChange:qe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,s;if(n==="right"){var a,u;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((u=i==null?void 0:i.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var l,c;return{left:[...((l=i==null?void 0:i.left)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((c=i==null?void 0:i.right)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=i==null?void 0:i.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,s;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(s=>!o.includes(s.column.id))},Y(t.options,"debugRows")),e.getLeftVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Y(t.options,"debugRows")),e.getRightVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Y(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Vi():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Vi())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Y(e.options,"debugColumns")),e.getRightLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Y(e.options,"debugColumns")),e.getCenterLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},Y(e.options,"debugColumns"))}},Gr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ni=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),dw={getDefaultColumnDef:()=>Gr,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ni(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:qe("columnSizing",e),onColumnSizingInfoChange:qe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Gr.minSize,(r=o??e.columnDef.size)!=null?r:Gr.size),(i=e.columnDef.maxSize)!=null?i:Gr.maxSize)},e.getStart=Q(n=>[n,cr(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Y(t.options,"debugColumns")),e.getAfter=Q(n=>[n,cr(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Y(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r==null?void 0:r.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),Ki(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=Ki(o)?Math.round(o.touches[0].clientX):o.clientX,l={},c=(w,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(v=>{var x,C;const O=t.options.columnResizeDirection==="rtl"?-1:1,L=(m-((x=v==null?void 0:v.startOffset)!=null?x:0))*O,_=Math.max(L/((C=v==null?void 0:v.startSize)!=null?C:0),-.999999);return v.columnSizingStart.forEach(T=>{let[V,N]=T;l[V]=Math.round(Math.max(N+N*_,0)*100)/100}),{...v,deltaOffset:L,deltaPercentage:_}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(v=>({...v,...l})))},d=w=>c("move",w),f=w=>{c("end",w),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,g={moveHandler:w=>d(w.clientX),upHandler:w=>{h==null||h.removeEventListener("mousemove",g.moveHandler),h==null||h.removeEventListener("mouseup",g.upHandler),f(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),d(w.touches[0].clientX),!1),upHandler:w=>{var m;h==null||h.removeEventListener("touchmove",p.moveHandler),h==null||h.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((m=w.touches[0])==null?void 0:m.clientX)}},y=fw()?{passive:!1}:!1;Ki(o)?(h==null||h.addEventListener("touchmove",p.moveHandler,y),h==null||h.addEventListener("touchend",p.upHandler,y)):(h==null||h.addEventListener("mousemove",g.moveHandler,y),h==null||h.addEventListener("mouseup",g.upHandler,y)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Ni():(n=e.initialState.columnSizingInfo)!=null?n:Ni())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let Hr=null;function fw(){if(typeof Hr=="boolean")return Hr;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Hr=e,Hr}function Ki(e){return e.type==="touchstart"}const hw={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:qe("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Q(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Y(t.options,"debugRows")),e.getVisibleCells=Q(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Y(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Q(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Y(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function cr(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const gw={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},pw={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:qe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Et.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return bi(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Et[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},mw={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:qe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(i=n)!=null?i:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:a,...u}=s;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Ho=0,Uo=10,ji=()=>({pageIndex:Ho,pageSize:Uo}),yw={getInitialState:e=>({...e,pagination:{...ji(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:qe("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>Bt(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?ji():(i=e.initialState.pagination)!=null?i:ji())},e.setPageIndex=r=>{e.setPagination(i=>{let o=Bt(r,i.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?Ho:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:Ho)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?Uo:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:Uo)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,Bt(r,i.pageSize)),s=i.pageSize*i.pageIndex,a=Math.floor(s/o);return{...i,pageIndex:a,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let s=Bt(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=Q(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,s)=>s)),i},Y(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Bi=()=>({top:[],bottom:[]}),vw={getInitialState:e=>({rowPinning:Bi(),...e}),getDefaultOptions:e=>({onRowPinningChange:qe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(u=>{let{id:l}=u;return l}):[],s=i?e.getParentRows().map(u=>{let{id:l}=u;return l}):[],a=new Set([...s,e.id,...o]);t.setRowPinning(u=>{var l,c;if(n==="bottom"){var d,f;return{top:((d=u==null?void 0:u.top)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((f=u==null?void 0:u.bottom)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=u==null?void 0:u.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=u==null?void 0:u.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((l=u==null?void 0:u.top)!=null?l:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((c=u==null?void 0:u.bottom)!=null?c:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Bi():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Bi())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Y(e.options,"debugRows")),e.getBottomRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Y(e.options,"debugRows")),e.getCenterRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},Y(e.options,"debugRows"))}},ww={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:qe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{qo(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?zi(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getFilteredSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?zi(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getGroupedSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?zi(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const a={...o};return qo(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Xs(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Wo(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Wo(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},qo=(e,t,n,r,i)=>{var o;const s=i.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>qo(e,a.id,n,r,i))};function zi(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(s,a){return s.map(u=>{var l;const c=Xs(u,n);if(c&&(r.push(u),i[u.id]=u),(l=u.subRows)!=null&&l.length&&(u={...u,subRows:o(u.subRows)}),c)return u}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function Xs(e,t){var n;return(n=t[e.id])!=null?n:!1}function Wo(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!i)&&(s.getCanSelect()&&(Xs(s,t)?o=!0:i=!1),s.subRows&&s.subRows.length)){const a=Wo(s,t);a==="all"?o=!0:(a==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const Xo=/([0-9]+)/gm,bw=(e,t,n)=>kd(Wt(e.getValue(n)).toLowerCase(),Wt(t.getValue(n)).toLowerCase()),Sw=(e,t,n)=>kd(Wt(e.getValue(n)),Wt(t.getValue(n))),xw=(e,t,n)=>Qs(Wt(e.getValue(n)).toLowerCase(),Wt(t.getValue(n)).toLowerCase()),Cw=(e,t,n)=>Qs(Wt(e.getValue(n)),Wt(t.getValue(n))),Ew=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},Rw=(e,t,n)=>Qs(e.getValue(n),t.getValue(n));function Qs(e,t){return e===t?0:e>t?1:-1}function Wt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function kd(e,t){const n=e.split(Xo).filter(Boolean),r=t.split(Xo).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),s=parseInt(i,10),a=parseInt(o,10),u=[s,a].sort();if(isNaN(u[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(u[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const tr={alphanumeric:bw,alphanumericCaseSensitive:Sw,text:xw,textCaseSensitive:Cw,datetime:Ew,basic:Rw},Pw={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:qe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return tr.datetime;if(typeof o=="string"&&(r=!0,o.split(Xo).length>1))return tr.alphanumeric}return r?tr.text:tr.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return bi(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:tr[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),u=s==null?void 0:s.findIndex(h=>h.id===e.id);let l=[],c,d=o?n:i==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?c="toggle":c="add":s!=null&&s.length&&u!==s.length-1?c="replace":a?c="toggle":c="replace",c==="toggle"&&(o||i||(c="remove")),c==="add"){var f;l=[...s,{id:e.id,desc:d}],l.splice(0,l.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else c==="toggle"?l=s.map(h=>h.id===e.id?{...h,desc:d}:h):c==="remove"?l=s.filter(h=>h.id!==e.id):l=[{id:e.id,desc:d}];return l})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Iw=[Xv,hw,uw,cw,Qv,Yv,gw,pw,Pw,aw,mw,yw,vw,ww,dw];function Mw(e){var t,n;const r=[...Iw,...(t=e._features)!=null?t:[]];let i={_features:r};const o=i._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(i)),{}),s=f=>i.options.mergeOptions?i.options.mergeOptions(o,f):{...o,...f};let u={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(f=>{var h;u=(h=f.getInitialState==null?void 0:f.getInitialState(u))!=null?h:u});const l=[];let c=!1;const d={_features:r,options:{...o,...e},initialState:u,_queue:f=>{l.push(f),c||(c=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();c=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{i.setState(i.initialState)},setOptions:f=>{const h=Bt(f,i.options);i.options=s(h)},getState:()=>i.options.state,setState:f=>{i.options.onStateChange==null||i.options.onStateChange(f)},_getRowId:(f,h,g)=>{var p;return(p=i.options.getRowId==null?void 0:i.options.getRowId(f,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(f,h)=>{let g=(h?i.getPrePaginationRowModel():i.getRowModel()).rowsById[f];if(!g&&(g=i.getCoreRowModel().rowsById[f],!g))throw new Error;return g},_getDefaultColumnDef:Q(()=>[i.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,y;return(p=(y=g.renderValue())==null||y.toString==null?void 0:y.toString())!=null?p:null},...i._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},Y(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:Q(()=>[i._getColumnDefs()],f=>{const h=function(g,p,y){return y===void 0&&(y=0),g.map(w=>{const m=Wv(i,w,y,p),v=w;return m.columns=v.columns?h(v.columns,m,y+1):[],m})};return h(f)},Y(e,"debugColumns")),getAllFlatColumns:Q(()=>[i.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),Y(e,"debugColumns")),_getAllFlatColumnsById:Q(()=>[i.getAllFlatColumns()],f=>f.reduce((h,g)=>(h[g.id]=g,h),{}),Y(e,"debugColumns")),getAllLeafColumns:Q(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(f,h)=>{let g=f.flatMap(p=>p.getLeafColumns());return h(g)},Y(e,"debugColumns")),getColumn:f=>i._getAllFlatColumnsById()[f]};Object.assign(i,d);for(let f=0;f<i._features.length;f++){const h=i._features[f];h==null||h.createTable==null||h.createTable(i)}return i}function Fw(){return e=>Q(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,s){o===void 0&&(o=0);const a=[];for(let l=0;l<i.length;l++){const c=qs(e,e._getRowId(i[l],l,s),i[l],l,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows){var u;c.originalSubRows=e.options.getSubRows(i[l],l),(u=c.originalSubRows)!=null&&u.length&&(c.subRows=r(c.originalSubRows,o+1,c))}}return a};return n.rows=r(t),n},Y(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Aw(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function $w(e,t,n){return n.options.filterFromLeafRows?Ow(e,t,n):Tw(e,t,n)}function Ow(e,t,n){var r;const i=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,l){l===void 0&&(l=0);const c=[];for(let f=0;f<u.length;f++){var d;let h=u[f];const g=qs(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(d=h.subRows)!=null&&d.length&&l<s){if(g.subRows=a(h.subRows,l+1),h=g,t(h)&&!g.subRows.length){c.push(h),o[h.id]=h,i.push(h);continue}if(t(h)||g.subRows.length){c.push(h),o[h.id]=h,i.push(h);continue}}else h=g,t(h)&&(c.push(h),o[h.id]=h,i.push(h))}return c};return{rows:a(e),flatRows:i,rowsById:o}}function Tw(e,t,n){var r;const i=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,l){l===void 0&&(l=0);const c=[];for(let f=0;f<u.length;f++){let h=u[f];if(t(h)){var d;if((d=h.subRows)!=null&&d.length&&l<s){const p=qs(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);p.subRows=a(h.subRows,l+1),h=p}c.push(h),i.push(h),o[h.id]=h}}return c};return{rows:a(e),flatRows:i,rowsById:o}}function Dw(){return e=>Q(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const i=[],o=[];(n??[]).forEach(f=>{var h;const g=e.getColumn(f.id);if(!g)return;const p=g.getFilterFn();p&&i.push({id:f.id,filterFn:p,resolvedValue:(h=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?h:f.value})});const s=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&u.length&&(s.push("__global__"),u.forEach(f=>{var h;o.push({id:f.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?h:r})}));let l,c;for(let f=0;f<t.flatRows.length;f++){const h=t.flatRows[f];if(h.columnFilters={},i.length)for(let g=0;g<i.length;g++){l=i[g];const p=l.id;h.columnFilters[p]=l.filterFn(h,p,l.resolvedValue,y=>{h.columnFiltersMeta[p]=y})}if(o.length){for(let g=0;g<o.length;g++){c=o[g];const p=c.id;if(c.filterFn(h,p,c.resolvedValue,y=>{h.columnFiltersMeta[p]=y})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const d=f=>{for(let h=0;h<s.length;h++)if(f.columnFilters[s[h]]===!1)return!1;return!0};return $w(t.rows,d,e)},Y(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Lw(e){return t=>Q(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:s,flatRows:a,rowsById:u}=r;const l=i*o,c=l+i;s=s.slice(l,c);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:u}:d=Aw({rows:s,flatRows:a,rowsById:u}),d.flatRows=[];const f=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(f)};return d.rows.forEach(f),d},Y(t.options,"debugTable"))}/**
19
+ * solid-table
20
+ *
21
+ * Copyright (c) TanStack
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE.md file in the root directory of this source tree.
25
+ *
26
+ * @license MIT
27
+ */function kl(e,t){return e?typeof e=="function"?b(e,t):e:null}function _w(e){const t=A({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(o,s)=>A(o,s)},e),n=Mw(t),[r,i]=ci(n.initialState);return Mt(()=>{n.setOptions(o=>A(o,e,{state:A(r,e.state||{}),onStateChange:s=>{i(s),e.onStateChange==null||e.onStateChange(s)}}))}),n}var Si=he("<li>"),kw=he("<ul>"),Vw={};Xt(Vw,{Ellipsis:()=>Ys,Item:()=>Zs,Items:()=>Js,Next:()=>ea,Pagination:()=>Nw,Previous:()=>ta,Root:()=>na});function Ys(e){return(()=>{var t=Si();return fe(t,b(ae,A({as:"div"},e))),t})()}var Vd=we();function xi(){const e=me(Vd);if(e===void 0)throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");return e}function Zs(e){const t=xi(),[n,r]=k(e,["page","onClick"]),i=()=>t.page()===n.page,o=()=>{t.setPage(n.page)};return(()=>{var s=Si();return fe(s,b(wt,A({get"aria-current"(){return i()?"page":void 0},get"data-current"(){return i()?"":void 0},get onClick(){return be([n.onClick,o])}},r))),s})()}function Js(e){const t=xi(),n=K(()=>{const{count:r,siblingCount:i,page:o,fixedItems:s,showFirst:a,showLast:u}=t,l=r()<2*i()+(s()?6:4);if(l)return{renderItemsDirectly:l};const c=a()&&o()-1>i(),d=u()&&r()-o()>i();let f=o()-(a()?2:1)>i(),h=r()-o()-(u()?1:0)>i(),g=Math.min(o()-1,i()),p=Math.min(r()-o(),i());if(s()!==!1){const y=g,w=p;g+=Math.max(i()-w,0),p+=Math.max(i()-y,0),c||p++,d||g++,s()===!0&&(f||p++,h||g++),o()-g-(a()?2:1)===1&&(f=!1,g++),r()-o()-p-(u()?1:0)===1&&(h=!1,p++)}return{showFirst:c,showLast:d,showFirstEllipsis:f,showLastEllipsis:h,previousSiblingCount:g,nextSiblingCount:p,renderItemsDirectly:l}});return b(Se,{get when(){return n().renderItemsDirectly},get fallback(){return[b(Se,{get when(){return n().showFirst},get children(){return t.renderItem(1)}}),b(Se,{get when(){return n().showFirstEllipsis},get children(){return t.renderEllipsis()}}),b(nt,{get each(){return[...Array(n().previousSiblingCount).keys()].reverse()},children:r=>K(()=>t.renderItem(t.page()-(r+1)))}),K(()=>t.renderItem(t.page())),b(nt,{get each(){return[...Array(n().nextSiblingCount).keys()]},children:r=>K(()=>t.renderItem(t.page()+(r+1)))}),b(Se,{get when(){return n().showLastEllipsis},get children(){return t.renderEllipsis()}}),b(Se,{get when(){return n().showLast},get children(){return t.renderItem(t.count())}})]},get children(){return b(nt,{get each(){return[...Array(t.count()).keys()]},children:r=>K(()=>t.renderItem(r+1))})}})}function ea(e){const t=xi(),[n,r]=k(e,["onClick"]),i=()=>{t.setPage(t.page()+1)},o=()=>t.page()===t.count();return(()=>{var s=Si();return fe(s,b(wt,A({get tabIndex(){return o()||t.page()===t.count()?-1:void 0},get disabled(){return o()},get"aria-disabled"(){return o()||void 0},get"data-disabled"(){return o()?"":void 0},get onClick(){return be([n.onClick,i])}},r))),s})()}function ta(e){const t=xi(),[n,r]=k(e,["onClick"]),i=()=>{t.setPage(t.page()-1)},o=()=>t.page()===1;return(()=>{var s=Si();return fe(s,b(wt,A({get tabIndex(){return o()||t.page()===1?-1:void 0},get disabled(){return o()},get"aria-disabled"(){return o()||void 0},get"data-disabled"(){return o()?"":void 0},get onClick(){return be([n.onClick,i])}},r))),s})()}function na(e){const t=`pagination-${Ee()}`,n=Z({id:t},e),[r,i]=k(n,["page","defaultPage","onPageChange","count","siblingCount","showFirst","showLast","fixedItems","itemComponent","ellipsisComponent","disabled","children"]),o=pt({defaultValue:()=>r.defaultPage??1,onChange:r.onPageChange,value:()=>r.page}),s={count:()=>r.count,siblingCount:()=>r.siblingCount??1,showFirst:()=>r.showFirst??!0,showLast:()=>r.showLast??!0,fixedItems:()=>r.fixedItems??!1,isDisabled:()=>r.disabled??!1,renderItem:a=>r.itemComponent({page:a}),renderEllipsis:r.ellipsisComponent,page:()=>Math.min(o[0]()??1,r.count),setPage:o[1]};return b(Vd.Provider,{value:s,get children(){return b(ae,A({as:"nav",get"data-disabled"(){return r.disabled?"":void 0}},i,{get children(){var a=kw();return fe(a,()=>r.children),a}}))}})}var Nw=Object.assign(na,{Ellipsis:Ys,Item:Zs,Items:Js,Next:ea,Previous:ta});const Ci=Fr("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Vl=e=>{const[t,n]=k(e,["variant","size","class"]);return b(wt,A({get class(){return de(Ci({variant:t.variant,size:t.size}),t.class)}},n))};var Kw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><circle cx=12 cy=12 r=1></circle><circle cx=19 cy=12 r=1></circle><circle cx=5 cy=12 r=1>'),jw=he("<span class=sr-only>More pages"),Bw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M15 6l-6 6l6 6">'),zw=he("<span>Previous"),Gw=he("<span>Next"),Hw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M9 6l6 6l-6 6">');const Uw=Js,qw=e=>{const[t,n]=k(e,["class"]);return b(na,A({get class(){return de("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1",t.class)}},n))},Ww=e=>{const[t,n]=k(e,["class"]);return b(Zs,A({get class(){return de(Ci({variant:"ghost"}),"size-10 data-[current]:border",t.class)}},n))},Xw=e=>{const[t,n]=k(e,["class"]);return b(Ys,A({get class(){return de("flex size-10 items-center justify-center",t.class)}},n,{get children(){return[Kw(),jw()]}}))},Qw=e=>{const[t,n]=k(e,["class","children"]);return b(ta,A({get class(){return de(Ci({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[Bw(),zw()]}}))},Yw=e=>{const[t,n]=k(e,["class","children"]);return b(ea,A({get class(){return de(Ci({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[Gw(),Hw()]}}))};var Zw=he('<div class="relative w-full overflow-auto"><table>'),Jw=he("<thead>"),eb=he("<tbody>"),tb=he("<tr>"),nb=he("<th>"),rb=he("<td>");const ib=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Zw(),i=r.firstChild;return at(i,A({get class(){return de("w-full caption-bottom text-sm",t.class)}},n),!1,!1),r})()},ob=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Jw();return at(r,A({get class(){return de("[&_tr]:border-b",t.class)}},n),!1,!1),r})()},sb=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=eb();return at(r,A({get class(){return de(t.class)}},n),!1,!1),r})()},Gi=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=tb();return at(r,A({get class(){return de("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t.class)}},n),!1,!1),r})()},ab=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=nb();return at(r,A({get class(){return de("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()},Nl=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=rb();return at(r,A({get class(){return de("p-4 align-middle [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()};var lb=(e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if(n.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}if(n&&typeof n.maxAge=="number"&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+=`; Max-Age=${Math.floor(n.maxAge)}`}if(n.domain&&n.prefix!=="host"&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r},ub=(e,t,n)=>(t=encodeURIComponent(t),lb(e,t,n)),cb=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),Qo=(e,t)=>{for(const[n,r]of Object.entries(t)){const i=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(i,r?`/${r}`:"")}return e},db=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},fb=e=>/^https?:\/\/[^\/]+?\/index$/.test(e)?e.replace(/\/index$/,"/"):e.replace(/\/index$/,"");function Ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Nd(e,t){if(!Ur(e)&&!Ur(t))return t;const n={...e};for(const r in t){const i=t[r];Ur(n[r])&&Ur(i)?n[r]=Nd(n[r],i):n[r]=i}return n}var Kd=(e,t)=>new Proxy(()=>{},{get(r,i){if(!(typeof i!="string"||i==="then"))return Kd(e,[...t,i])},apply(r,i,o){return e({path:t,args:o})}}),hb=class{constructor(e,t){Re(this,"url");Re(this,"method");Re(this,"queryParams");Re(this,"pathParams",{});Re(this,"rBody");Re(this,"cType");Re(this,"fetch",async(e,t)=>{if(e){if(e.query){for(const[a,u]of Object.entries(e.query))if(u!==void 0)if(this.queryParams||(this.queryParams=new URLSearchParams),Array.isArray(u))for(const l of u)this.queryParams.append(a,l);else this.queryParams.set(a,u)}if(e.form){const a=new FormData;for(const[u,l]of Object.entries(e.form))if(Array.isArray(l))for(const c of l)a.append(u,c);else a.append(u,l);this.rBody=a}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...(e==null?void 0:e.header)??{},...typeof(t==null?void 0:t.headers)=="function"?await t.headers():t!=null&&t.headers?t.headers:{}};if(e!=null&&e.cookie){const a=[];for(const[u,l]of Object.entries(e.cookie))a.push(ub(u,l,{path:"/"}));r.Cookie=a.join(",")}this.cType&&(r["Content-Type"]=this.cType);const i=new Headers(r);let o=this.url;o=fb(o),o=Qo(o,this.pathParams),this.queryParams&&(o=o+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const s=!(n==="GET"||n==="HEAD");return((t==null?void 0:t.fetch)||fetch)(o,{body:s?this.rBody:void 0,method:n,headers:i,...t==null?void 0:t.init})});this.url=e,this.method=t}},gb=(e,t)=>Kd(function n(r){var l;const i=[...r.path];if(i[i.length-1]==="toString")return i[i.length-2]==="name"?i[i.length-3]||"":n.toString();if(i[i.length-1]==="valueOf")return i[i.length-2]==="name"?i[i.length-3]||"":n;let o="";if(/^\$/.test(i[i.length-1])){const c=i.pop();c&&(o=c.replace(/^\$/,""))}const s=i.join("/"),a=cb(e,s);if(o==="url")return r.args[0]&&r.args[0].param?new URL(Qo(a,r.args[0].param)):new URL(a);if(o==="ws"){const c=db(r.args[0]&&r.args[0].param?Qo(a,r.args[0].param):a,"ws"),d=new URL(c),f=(l=r.args[0])==null?void 0:l.query;return f&&Object.entries(f).forEach(([g,p])=>{Array.isArray(p)?p.forEach(y=>d.searchParams.append(g,y)):d.searchParams.set(g,p)}),((...g)=>(t==null?void 0:t.webSocket)!==void 0&&typeof t.webSocket=="function"?t.webSocket(...g):new WebSocket(...g))(d.toString())}const u=new hb(a,o);if(o){t??(t={});const c=Nd(t,{...r.args[1]??{}});return u.fetch(r.args[0],c)}return u},[]);const Tr=gb("/rpc"),Hi="production",pb=e=>di(()=>({queryKey:["bundles",e()],queryFn:async()=>(await Tr.bundles.$get({query:e()})).json(),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),mb=e=>di(()=>({queryKey:["bundle",e],queryFn:()=>Tr.bundles[":bundleId"].$get({param:{bundleId:e}}).then(t=>t.json()),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),yb=()=>di(()=>({queryKey:["config"],queryFn:()=>Tr.config.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1})),vb=()=>di(()=>({queryKey:["channels"],queryFn:()=>Tr.channels.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1,select:e=>!e||e.length===0?null:e.includes(Hi)?[Hi,...e.filter(t=>t!==Hi)]:e}));var wb=he('<div class="transition-opacity duration-300"><div class="flex flex-row justify-end p-3"><div class="flex items-center gap-4"><div class="text-sm text-muted-foreground">Platform:</div><div class="text-sm text-muted-foreground">Channel:</div></div></div><div class="border rounded-md">');const bb=20,[nr,Sb]=B({pageIndex:0,pageSize:bb});function xb(e){const[t]=k(e,["columns","onRowClick"]),{channelFilter:n,platformFilter:r,setPlatformFilter:i,setChannelFilter:o}=Kc(),s=K(()=>({channel:n()??void 0,platform:r()??void 0,limit:nr().pageSize.toString(),offset:(nr().pageIndex*nr().pageSize).toString()})),a=pb(s),u=K(()=>a.data??[]),l=_w({get data(){return u()},columns:t.columns,getCoreRowModel:Fw(),getPaginationRowModel:Lw(),getFilteredRowModel:Dw(),state:{get pagination(){return nr()},get globalFilter(){return r()}},onPaginationChange:Sb,globalFilterFn:(f,h,g)=>g?f.original.platform.toLowerCase()===g:!0,manualPagination:!1}),c=f=>()=>{t.onRowClick(f.original)},d=vb();return U(()=>{d.isFetched&&d.data&&n()===null&&o(d.data[0])}),(()=>{var f=wb(),h=f.firstChild,g=h.firstChild,p=g.firstChild,y=p.nextSibling,w=h.nextSibling;return fe(g,b(Al,{get children(){return b(Fl,{get children(){return[b($l,{class:"w-[100px]",get children(){return[K(()=>K(()=>!!r())()?r():"All"),b(Ol,{})]}}),b(Tl,{get children(){return b(nt,{each:[{label:"All",value:null},{label:"iOS",value:"ios"},{label:"Android",value:"android"}],children:m=>b(Dl,{get classList(){return{"bg-primary text-primary-foreground":m.value===r()}},onClick:()=>i(m.value),get children(){return m.label}})})}})]}})}}),y),fe(g,b(Al,{get children(){return b(Fl,{get children(){return[b($l,{class:"w-[100px]",get children(){return[K(()=>n()),b(Ol,{})]}}),b(Tl,{get children(){return b(nt,{get each(){return d.data},children:m=>b(Dl,{get classList(){return{"bg-primary text-primary-foreground":m===n()}},onClick:()=>o(m),children:m})})}})]}})}}),null),fe(w,b(ib,{get children(){return[b(ob,{get children(){return b(nt,{get each(){return l.getHeaderGroups()},children:m=>b(Gi,{get children(){return b(nt,{get each(){return m.headers},children:v=>b(ab,{get children(){return K(()=>!!v.isPlaceholder)()?null:kl(v.column.columnDef.header,v.getContext())}})})}})})}}),b(sb,{get children(){return K(()=>{var m;return!!(a.isFetched&&((m=l.getRowModel().rows)==null?void 0:m.length)===0)})()?b(Gi,{get children(){return b(Nl,{get colSpan(){return t.columns.length},class:"h-full text-center",children:"No results."})}}):b(nt,{get each(){return l.getRowModel().rows},children:m=>b(Gi,{get"data-state"(){return m.getIsSelected()&&"selected"},class:"cursor-pointer",get onClick(){return c(m)},get children(){return b(nt,{get each(){return m.getVisibleCells()},children:v=>b(Nl,{get children(){return kl(v.column.columnDef.cell,v.getContext())}})})}})})}})]}})),fe(f,b(qw,{class:"mt-2.5 w-full [&>ul]:justify-center",itemComponent:m=>b(Ww,{get page(){return m.page},onClick:()=>l.setPageIndex(m.page-1),get children(){return m.page}}),ellipsisComponent:()=>b(Xw,{}),get count(){var m;return Math.ceil((((m=u())==null?void 0:m.length)??0)/nr().pageSize)},get children(){return[b(Qw,{onClick:()=>l.previousPage(),get disabled(){return!l.getCanPreviousPage()}}),b(Uw,{}),b(Yw,{onClick:()=>l.nextPage(),get disabled(){return!l.getCanNextPage()}})]}}),null),Ke(m=>{var v=!!a.isFetching,x=!!a.isFetching;return v!==m.e&&f.classList.toggle("opacity-50",m.e=v),x!==m.t&&w.classList.toggle("min-h-[400px]",m.t=x),m},{e:void 0,t:void 0}),f})()}var Cb={};Xt(Cb,{Root:()=>ra,Skeleton:()=>Eb});function ra(e){const t=`skeleton-${Ee()}`,n=Z({visible:!0,animate:!0,id:t},e),[r,i]=k(n,["style","radius","animate","height","width","visible","circle"]);return b(ae,A({as:"div",role:"group",get"data-animate"(){return r.animate||void 0},get"data-visible"(){return r.visible||void 0},get style(){return yt({"border-radius":r.circle?"9999px":r.radius?`${r.radius}px`:void 0,width:r.circle?`${r.height}px`:r.width?`${r.width}px`:"100%",height:r.height?`${r.height}px`:"auto"},r.style)}},i))}var Eb=ra;const Rb=e=>{const[t,n]=k(e,["class"]);return b(ra,A({get class(){return de("bg-primary/10 data-[animate='true']:animate-pulse",t.class)}},n))};var jd=["id","name","validationState","required","disabled","readOnly"];function Bd(e){const t=`form-control-${Ee()}`,n=Z({id:t},e),[r,i]=B(),[o,s]=B(),[a,u]=B(),[l,c]=B(),d=(p,y,w)=>{const m=w!=null||r()!=null;return[w,r(),m&&y!=null?p:void 0].filter(Boolean).join(" ")||void 0},f=p=>[a(),l(),p].filter(Boolean).join(" ")||void 0,h=K(()=>({"data-valid":$(n.validationState)==="valid"?"":void 0,"data-invalid":$(n.validationState)==="invalid"?"":void 0,"data-required":$(n.required)?"":void 0,"data-disabled":$(n.disabled)?"":void 0,"data-readonly":$(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>$(n.name)??$(n.id),dataset:h,validationState:()=>$(n.validationState),isRequired:()=>$(n.required),isDisabled:()=>$(n.disabled),isReadOnly:()=>$(n.readOnly),labelId:r,fieldId:o,descriptionId:a,errorMessageId:l,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:vt(()=>$(n.id)),registerLabel:Be(i),registerField:Be(s),registerDescription:Be(u),registerErrorMessage:Be(c)}}}var ia=we();function Yt(){const e=me(ia);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function oa(e){const t=Yt(),n=Z({id:t.generateId("description")},e);return U(()=>W(t.registerDescription(n.id))),b(ae,A({as:"div"},()=>t.dataset(),n))}function sa(e){const t=Yt(),n=Z({id:t.generateId("error-message")},e),[r,i]=k(n,["forceMount"]),o=()=>t.validationState()==="invalid";return U(()=>{o()&&W(t.registerErrorMessage(i.id))}),b(Se,{get when(){return r.forceMount||o()},get children(){return b(ae,A({as:"div"},()=>t.dataset(),i))}})}function Ei(e){let t;const n=Yt(),r=Z({id:n.generateId("label")},e),[i,o]=k(r,["ref"]),s=hi(()=>t,()=>"label");return U(()=>W(n.registerLabel(o.id))),b(ae,A({as:"label",ref(a){var u=ye(l=>t=l,i.ref);typeof u=="function"&&u(a)},get for(){return K(()=>s()==="label")()?n.fieldId():void 0}},()=>n.dataset(),o))}var zd=["id","aria-label","aria-labelledby","aria-describedby"];function Gd(e){const t=Yt(),n=Z({id:t.generateId("field")},e);return U(()=>W(t.registerField($(n.id)))),{fieldProps:{id:()=>$(n.id),ariaLabel:()=>$(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy($(n.id),$(n["aria-label"]),$(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy($(n["aria-describedby"]))}}}function Hd(e,t){U(Ce(e,n=>{if(n==null)return;const r=Pb(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),W(()=>{r.removeEventListener("reset",t)}))}))}function Pb(e){return Ib(e)?e.form:e.closest("form")}function Ib(e){return e.matches("textarea, input, select, button")}var Mb={};Xt(Mb,{Control:()=>aa,Description:()=>qd,ErrorMessage:()=>Wd,Input:()=>la,Label:()=>ua,Root:()=>ca,Switch:()=>Ab,Thumb:()=>da});var Ud=we();function Wn(){const e=me(Ud);if(e===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return e}function aa(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("control")},e),[i,o]=k(r,["onClick","onKeyDown"]);return b(ae,A({as:"div",onClick:u=>{var l;ie(u,i.onClick),n.toggle(),(l=n.inputRef())==null||l.focus()},onKeyDown:u=>{var l;ie(u,i.onKeyDown),u.key===cs.Space&&(n.toggle(),(l=n.inputRef())==null||l.focus())}},()=>t.dataset(),()=>n.dataset(),o))}function qd(e){const t=Wn();return b(oa,A(()=>t.dataset(),e))}function Wd(e){const t=Wn();return b(sa,A(()=>t.dataset(),e))}function la(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("input")},e),[i,o,s]=k(r,["ref","style","onChange","onFocus","onBlur"],zd),{fieldProps:a}=Gd(o);return b(ae,A({as:"input",ref(d){var f=ye(n.setInputRef,i.ref);typeof f=="function"&&f(d)},type:"checkbox",role:"switch",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get checked(){return n.checked()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return yt({...pc},i.style)},get"aria-checked"(){return n.checked()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},onChange:d=>{ie(d,i.onChange),d.stopPropagation();const f=d.target;n.setIsChecked(f.checked),f.checked=n.checked()},onFocus:d=>{ie(d,i.onFocus),n.setIsFocused(!0)},onBlur:d=>{ie(d,i.onBlur),n.setIsFocused(!1)}},()=>t.dataset(),()=>n.dataset(),s))}function ua(e){const t=Wn();return b(Ei,A(()=>t.dataset(),e))}function ca(e){let t;const n=`switch-${Ee()}`,r=Z({value:"on",id:n},e),[i,o,s]=k(r,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],jd),[a,u]=B(),[l,c]=B(!1),{formControlContext:d}=Bd(o),f=ld({isSelected:()=>i.checked,defaultIsSelected:()=>i.defaultChecked,onSelectedChange:y=>{var w;return(w=i.onChange)==null?void 0:w.call(i,y)},isDisabled:()=>d.isDisabled(),isReadOnly:()=>d.isReadOnly()});Hd(()=>t,()=>f.setIsSelected(i.defaultChecked??!1));const h=y=>{ie(y,i.onPointerDown),l()&&y.preventDefault()},g=K(()=>({"data-checked":f.isSelected()?"":void 0})),p={value:()=>i.value,dataset:g,checked:()=>f.isSelected(),inputRef:a,generateId:vt(()=>$(o.id)),toggle:()=>f.toggle(),setIsChecked:y=>f.setIsSelected(y),setIsFocused:c,setInputRef:u};return b(ia.Provider,{value:d,get children(){return b(Ud.Provider,{value:p,get children(){return b(ae,A({as:"div",ref(y){var w=ye(m=>t=m,i.ref);typeof w=="function"&&w(y)},role:"group",get id(){return $(o.id)},onPointerDown:h},()=>d.dataset(),g,s,{get children(){return b(Fb,{state:p,get children(){return i.children}})}}))}})}})}function Fb(e){const t=li(()=>{const n=e.children;return us(n)?n(e.state):n});return K(t)}function da(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("thumb")},e);return b(ae,A({as:"div"},()=>t.dataset(),()=>n.dataset(),r))}var Ab=Object.assign(ca,{Control:aa,Description:qd,ErrorMessage:Wd,Input:la,Label:ua,Thumb:da});const Kl=ca,jl=e=>{const[t,n]=k(e,["class","children"]);return[b(la,{get class(){return de("[&:focus-visible+div]:outline-none [&:focus-visible+div]:ring-2 [&:focus-visible+div]:ring-ring [&:focus-visible+div]:ring-offset-2 [&:focus-visible+div]:ring-offset-background",t.class)}}),b(aa,A({get class(){return de("inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input transition-[color,background-color,box-shadow] data-[disabled]:cursor-not-allowed data-[checked]:bg-primary data-[disabled]:opacity-50",t.class)}},n,{get children(){return t.children}}))]},Bl=e=>{const[t,n]=k(e,["class"]);return b(da,A({get class(){return de("pointer-events-none block size-5 translate-x-0 rounded-full bg-background shadow-lg ring-0 transition-transform data-[checked]:translate-x-5",t.class)}},n))},zl=e=>{const[t,n]=k(e,["class"]);return b(ua,A({get class(){return de("text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",t.class)}},n))};var $b={};Xt($b,{Description:()=>oa,ErrorMessage:()=>sa,Input:()=>fa,Label:()=>Ei,Root:()=>ha,TextArea:()=>Zd,TextField:()=>Tb});var Xd=we();function Qd(){const e=me(Xd);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function fa(e){return b(Yd,A({type:"text"},e))}function Yd(e){const t=Yt(),n=Qd(),r=Z({id:n.generateId("input")},e),[i,o,s]=k(r,["onInput"],zd),{fieldProps:a}=Gd(o);return b(ae,A({as:"input",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return be([i.onInput,n.onInput])}},()=>t.dataset(),s))}function ha(e){let t;const n=`textfield-${Ee()}`,r=Z({id:n},e),[i,o,s]=k(r,["ref","value","defaultValue","onChange"],jd),a=i.value,[u,l]=pt({value:()=>a===void 0?void 0:i.value??"",defaultValue:()=>i.defaultValue,onChange:h=>{var g;return(g=i.onChange)==null?void 0:g.call(i,h)}}),{formControlContext:c}=Bd(o);Hd(()=>t,()=>l(i.defaultValue??""));const d=h=>{if(c.isReadOnly()||c.isDisabled())return;const g=h.target;l(g.value),g.value=u()??""},f={value:u,generateId:vt(()=>$(o.id)),onInput:d};return b(ia.Provider,{value:c,get children(){return b(Xd.Provider,{value:f,get children(){return b(ae,A({as:"div",ref(h){var g=ye(p=>t=p,i.ref);typeof g=="function"&&g(h)},role:"group",get id(){return $(o.id)}},()=>c.dataset(),s))}})}})}function Zd(e){let t;const n=Qd(),r=Z({id:n.generateId("textarea")},e),[i,o]=k(r,["ref","autoResize","submitOnEnter","onKeyPress"]);U(Ce([()=>t,()=>i.autoResize,()=>n.value()],([a,u])=>{!a||!u||Ob(a)}));const s=a=>{t&&i.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return b(Yd,A({as:"textarea",get"aria-multiline"(){return i.submitOnEnter?"false":void 0},get onKeyPress(){return be([i.onKeyPress,s])},ref(a){var u=ye(l=>t=l,i.ref);typeof u=="function"&&u(a)}},o))}function Ob(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var Tb=Object.assign(ha,{Description:oa,ErrorMessage:sa,Input:fa,Label:Ei,TextArea:Zd});const Gl=ha,Hl=e=>{const[t,n]=k(e,["type","class"]);return b(fa,A({get type(){return t.type},get class(){return de("flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t.class)}},n))},Db=Fr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{variant:{label:"data-[invalid]:text-destructive",description:"text-destructive",error:"font-normal text-red-500"}},defaultVariants:{variant:"label"}}),Ul=e=>{const[t,n]=k(e,["class"]);return b(Ei,A({get class(){return de(Db(),t.class)}},n))};class Jd{constructor(t,n){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=r=>{var i,o;this.listeners.add(r);const s=(o=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:o.call(i,r,this);return()=>{this.listeners.delete(r),s==null||s()}},this.setState=r=>{var i,o,s;const a=this.state;this.state=(i=this.options)!=null&&i.updateFn?this.options.updateFn(a)(r):r(a),(s=(o=this.options)==null?void 0:o.onUpdate)==null||s.call(o),this._flush()},this._flush=()=>{if(this._batching)return;const r=++this._flushing;this.listeners.forEach(i=>{this._flushing===r&&i()})},this.batch=r=>{if(this._batching)return r();this._batching=!0,r(),this._batching=!1,this._flush()},this.state=t,this.options=n}}function ga(e,t){return typeof e=="function"?e(t):e}function ef(e,t){return pa(t).reduce((r,i)=>{if(r===null)return null;if(typeof r<"u")return r[i]},e)}function Ui(e,t,n){const r=pa(t);function i(o){if(!r.length)return ga(n,o);const s=r.shift();if(typeof s=="string")return typeof o=="object"?(o===null&&(o={}),{...o,[s]:i(o[s])}):{[s]:i()};if(Array.isArray(o)&&s!==void 0){const a=o.slice(0,s);return[...a.length?a:new Array(s),i(o[s]),...o.slice(s+1)]}return[...new Array(s),i()]}return i(e)}function Lb(e,t){const n=pa(t);function r(i){if(!i)return;if(n.length===1){const s=n[0];if(Array.isArray(i)&&typeof s=="number")return i.filter((l,c)=>c!==s);const{[s]:a,...u}=i;return u}const o=n.shift();if(typeof o=="string"&&typeof i=="object")return{...i,[o]:r(i[o])};if(typeof o=="number"&&Array.isArray(i)){if(o>=i.length)return i;const s=i.slice(0,o);return[...s.length?s:new Array(o),r(i[o]),...i.slice(o+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return r(e)}const _b=/^(\d*)$/gm,kb=/\.(\d*)\./gm,Vb=/^(\d*)\./gm,Nb=/\.(\d*$)/gm,Kb=/\.{2,}/gm,Yo="__int__",qr=`${Yo}$1`;function pa(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replaceAll("[",".").replaceAll("]","").replace(_b,qr).replace(kb,`.${qr}.`).replace(Vb,`${qr}.`).replace(Nb,`.${qr}`).replace(Kb,".").split(".").map(t=>t.indexOf(Yo)===0?parseInt(t.substring(Yo.length),10):t)}function jb(e){return!(Array.isArray(e)&&e.length===0)}function Zo(e,t){const{asyncDebounceMs:n}=t,{onChangeAsync:r,onBlurAsync:i,onSubmitAsync:o,onBlurAsyncDebounceMs:s,onChangeAsyncDebounceMs:a}=t.validators||{},u=n??0,l={cause:"change",validate:r,debounceMs:a??u},c={cause:"blur",validate:i,debounceMs:s??u},d={cause:"submit",validate:o,debounceMs:0},f=h=>({...h,debounceMs:0});switch(e){case"submit":return[f(l),f(c),d];case"blur":return[c];case"change":return[l];case"server":default:return[]}}function Jo(e,t){const{onChange:n,onBlur:r,onSubmit:i}=t.validators||{},o={cause:"change",validate:n},s={cause:"blur",validate:r},a={cause:"submit",validate:i},u={cause:"server",validate:()=>{}};switch(e){case"submit":return[o,s,a,u];case"server":return[u];case"blur":return[s,u];case"change":default:return[o,u]}}function qi(e){return{values:e.values??{},errors:e.errors??[],errorMap:e.errorMap??{},fieldMeta:e.fieldMeta??{},canSubmit:e.canSubmit??!0,isFieldsValid:e.isFieldsValid??!1,isFieldsValidating:e.isFieldsValidating??!1,isFormValid:e.isFormValid??!1,isFormValidating:e.isFormValidating??!1,isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isTouched:e.isTouched??!1,isBlurred:e.isBlurred??!1,isPristine:e.isPristine??!0,isDirty:e.isDirty??!1,isValid:e.isValid??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}}}const Bb=e=>typeof e=="object";class zb{constructor(t){var n;this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const{onMount:r}=this.options.validators||{};if(!r)return;const i=this.runValidator({validate:r,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"});i&&this.store.setState(o=>({...o,errorMap:{...o.errorMap,onMount:i}}))},this.update=r=>{if(!r)return;const i=this.options;this.options=r,this.store.batch(()=>{const o=r.defaultValues&&r.defaultValues!==i.defaultValues&&!this.state.isTouched,s=r.defaultState!==i.defaultState&&!this.state.isTouched;this.store.setState(()=>qi(Object.assign({},this.state,s?r.defaultState:{},o?{values:r.defaultValues}:{})))})},this.reset=()=>{const{fieldMeta:r}=this.state,i=this.resetFieldMeta(r);this.store.setState(()=>{var o;return qi({...this.options.defaultState,values:this.options.defaultValues??((o=this.options.defaultState)==null?void 0:o.values),fieldMeta:i})})},this.validateAllFields=async r=>{const i=[];return this.store.batch(()=>{Object.values(this.fieldInfo).forEach(s=>{if(!s.instance)return;const a=s.instance;i.push(Promise.resolve().then(()=>a.validate(r))),s.instance.state.meta.isTouched||s.instance.setMeta(u=>({...u,isTouched:!0})),s.instance.state.meta.isBlurred||s.instance.setMeta(u=>({...u,isBlurred:!0}))})}),(await Promise.all(i)).flat()},this.validateArrayFieldsStartingFrom=async(r,i,o)=>{const s=this.getFieldValue(r),a=Array.isArray(s)?Math.max(s.length-1,0):null,u=[`${r}[${i}]`];for(let f=i+1;f<=(a??0);f++)u.push(`${r}[${f}]`);const l=Object.keys(this.fieldInfo).filter(f=>u.some(h=>f.startsWith(h))),c=[];return this.store.batch(()=>{l.forEach(f=>{c.push(Promise.resolve().then(()=>this.validateField(f,o)))})}),(await Promise.all(c)).flat()},this.validateField=(r,i)=>{var o;const s=(o=this.fieldInfo[r])==null?void 0:o.instance;return s?(s.state.meta.isTouched||s.setMeta(a=>({...a,isTouched:!0})),s.state.meta.isBlurred||s.setMeta(a=>({...a,isBlurred:!0})),s.validate(i)):[]},this.validateSync=r=>{const i=Jo(r,this.options);let o=!1;const s={};this.store.batch(()=>{for(const u of i){if(!u.validate)continue;const l=this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:c,fieldErrors:d}=es(l),f=Wr(u.cause);if(d)for(const[h,g]of Object.entries(d)){const y={...s[h]||{},[f]:g};s[h]=y;const w=this.getFieldMeta(h);w&&w.errorMap[f]!==g&&this.setFieldMeta(h,m=>({...m,errorMap:{...m.errorMap,[f]:g}}))}this.state.errorMap[f]!==c&&this.store.setState(h=>({...h,errorMap:{...h.errorMap,[f]:c}})),(c||d)&&(o=!0)}});const a=Wr("submit");return this.state.errorMap[a]&&r!=="submit"&&!o&&this.store.setState(u=>({...u,errorMap:{...u.errorMap,[a]:void 0}})),{hasErrored:o,fieldsErrorMap:s}},this.validateAsync=async r=>{const i=Zo(r,this.options);this.state.isFormValidating||this.store.setState(l=>({...l,isFormValidating:!0}));const o=[];let s;for(const l of i){if(!l.validate)continue;const c=Wr(l.cause),d=this.state.validationMetaMap[c];d==null||d.lastAbortController.abort();const f=new AbortController;this.state.validationMetaMap[c]={lastAbortController:f},o.push(new Promise(async h=>{let g;try{g=await new Promise((m,v)=>{setTimeout(async()=>{if(f.signal.aborted)return m(void 0);try{m(await this.runValidator({validate:l.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:f.signal},type:"validateAsync"}))}catch(x){v(x)}},l.debounceMs)})}catch(m){g=m}const{formError:p,fieldErrors:y}=es(g);y&&(s=s?{...s,...y}:y);const w=Wr(l.cause);if(s)for(const[m,v]of Object.entries(s)){const x=this.getFieldMeta(m);x&&x.errorMap[w]!==v&&this.setFieldMeta(m,C=>({...C,errorMap:{...C.errorMap,[w]:v}}))}this.store.setState(m=>({...m,errorMap:{...m.errorMap,[w]:p}})),h(s?{fieldErrors:s,errorMapKey:w}:void 0)}))}let a=[];const u={};if(o.length){a=await Promise.all(o);for(const l of a)if(l!=null&&l.fieldErrors){const{errorMapKey:c}=l;for(const[d,f]of Object.entries(l.fieldErrors)){const g={...u[d]||{},[c]:f};u[d]=g}}}return this.store.setState(l=>({...l,isFormValidating:!1})),u},this.validate=r=>{const{hasErrored:i,fieldsErrorMap:o}=this.validateSync(r);return i&&!this.options.asyncAlways?o:this.validateAsync(r)},this.handleSubmit=async()=>{var r,i,o,s,a,u;if(this.store.setState(c=>({...c,isSubmitted:!1,submissionAttempts:c.submissionAttempts+1})),!this.state.canSubmit)return;this.store.setState(c=>({...c,isSubmitting:!0}));const l=()=>{this.store.setState(c=>({...c,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){l(),(i=(r=this.options).onSubmitInvalid)==null||i.call(r,{value:this.state.values,formApi:this});return}if(await this.validate("submit"),!this.state.isValid){l(),(s=(o=this.options).onSubmitInvalid)==null||s.call(o,{value:this.state.values,formApi:this});return}try{await((u=(a=this.options).onSubmit)==null?void 0:u.call(a,{value:this.state.values,formApi:this})),this.store.batch(()=>{this.store.setState(c=>({...c,isSubmitted:!0})),l()})}catch(c){throw l(),c}},this.getFieldValue=r=>ef(this.state.values,r),this.getFieldMeta=r=>this.state.fieldMeta[r],this.getFieldInfo=r=>{var i;return(i=this.fieldInfo)[r]||(i[r]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}})},this.setFieldMeta=(r,i)=>{this.store.setState(o=>({...o,fieldMeta:{...o.fieldMeta,[r]:ga(i,o.fieldMeta[r])}}))},this.resetFieldMeta=r=>Object.keys(r).reduce((i,o)=>{const s=o;return i[s]={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{}},i},{}),this.setFieldValue=(r,i,o)=>{const s=(o==null?void 0:o.dontUpdateMeta)??!1;this.store.batch(()=>{s||this.setFieldMeta(r,a=>({...a,isTouched:!0,isBlurred:!0,isDirty:!0})),this.store.setState(a=>({...a,values:Ui(a.values,r,i)}))})},this.deleteField=r=>{this.store.setState(i=>{const o={...i};return o.values=Lb(o.values,r),delete o.fieldMeta[r],o}),delete this.fieldInfo[r]},this.pushFieldValue=(r,i,o)=>{this.setFieldValue(r,s=>[...Array.isArray(s)?s:[],i],o),this.validateField(r,"change")},this.insertFieldValue=async(r,i,o,s)=>{this.setFieldValue(r,a=>[...a.slice(0,i),o,...a.slice(i)],s),await this.validateField(r,"change")},this.replaceFieldValue=async(r,i,o,s)=>{this.setFieldValue(r,a=>a.map((u,l)=>l===i?o:u),s),await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,i,"change")},this.removeFieldValue=async(r,i,o)=>{const s=this.getFieldValue(r),a=Array.isArray(s)?Math.max(s.length-1,0):null;if(this.setFieldValue(r,u=>u.filter((l,c)=>c!==i),o),a!==null){const u=`${r}[${a}]`;Object.keys(this.fieldInfo).filter(c=>c.startsWith(u)).forEach(c=>this.deleteField(c))}await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,i,"change")},this.swapFieldValues=(r,i,o,s)=>{this.setFieldValue(r,a=>{const u=a[i],l=a[o];return Ui(Ui(a,`${i}`,l),`${o}`,u)},s),this.validateField(r,"change"),this.validateField(`${r}[${i}]`,"change"),this.validateField(`${r}[${o}]`,"change")},this.moveFieldValues=(r,i,o,s)=>{this.setFieldValue(r,a=>(a.splice(o,0,a.splice(i,1)[0]),a),s),this.validateField(r,"change"),this.validateField(`${r}[${i}]`,"change"),this.validateField(`${r}[${o}]`,"change")},this.store=new Jd(qi({...t==null?void 0:t.defaultState,values:(t==null?void 0:t.defaultValues)??((n=t==null?void 0:t.defaultState)==null?void 0:n.values),isFormValid:!0}),{onUpdate:()=>{var r,i;let{state:o}=this.store;const s=Object.values(o.fieldMeta),a=s.some(v=>v==null?void 0:v.isValidating),u=!s.some(v=>(v==null?void 0:v.errorMap)&&jb(Object.values(v.errorMap).filter(Boolean))),l=s.some(v=>v==null?void 0:v.isTouched),c=s.some(v=>v==null?void 0:v.isBlurred),d=s.some(v=>v==null?void 0:v.isDirty),f=!d,h=a||o.isFormValidating;o.errors=Object.values(o.errorMap).reduce((v,x)=>x===void 0?v:typeof x=="string"?(v.push(x),v):(x&&Bb(x)&&v.push(x.form),v),[]);const g=o.errors.length===0,p=u&&g,y=o.submissionAttempts===0&&!l||!h&&!o.isSubmitting&&p;o={...o,isFieldsValidating:a,isFieldsValid:u,isFormValid:g,isValid:p,canSubmit:y,isTouched:l,isBlurred:c,isPristine:f,isDirty:d},this.state=o,this.store.state=this.state;const w=((r=this.options.transform)==null?void 0:r.deps)??[];(w.length!==this.prevTransformArray.length||w.some((v,x)=>v!==this.prevTransformArray[x]))&&((i=this.options.transform)==null||i.fn(this),this.store.state=this.state,this.prevTransformArray=w)}}),this.state=this.store.state,this.update(t||{})}runValidator(t){const n=this.options.validatorAdapter;return n&&typeof t.validate!="function"?n()[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.store.setState(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function es(e){if(e){if(typeof e=="object"){const t=es(e.form).formError,n=e.fields;return{formError:t,fieldErrors:n}}return typeof e!="string"?{formError:"Invalid Form Values"}:{formError:e}}return{formError:void 0}}function Wr(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}class Gb{constructor(t){this.options={},this.mount=()=>{const n=this.getInfo();n.instance=this;const r=this.form.store.subscribe(()=>{this.store.batch(()=>{const o=this.getValue(),s=this.getMeta();o!==this.state.value&&this.store.setState(a=>({...a,value:o})),s!==this.state.meta&&this.store.setState(a=>({...a,meta:s}))})});this.update(this.options);const{onMount:i}=this.options.validators||{};if(i){const o=this.runValidator({validate:i,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});o&&this.setMeta(s=>({...s,errorMap:{...s==null?void 0:s.errorMap,onMount:o}}))}return()=>{r()}},this.update=n=>{if(this.state.value===void 0){const r=ef(n.form.options.defaultValues,n.name);n.defaultValue!==void 0?this.setValue(n.defaultValue,{dontUpdateMeta:!0}):r!==void 0&&this.setValue(r,{dontUpdateMeta:!0})}this._getMeta()===void 0&&this.setMeta(this.state.meta),this.options=n},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(n,r)=>{this.form.setFieldValue(this.name,n,r),this.validate("change")},this._getMeta=()=>this.form.getFieldMeta(this.name),this.getMeta=()=>this._getMeta()??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...this.options.defaultMeta},this.setMeta=n=>this.form.setFieldMeta(this.name,n),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(n,r)=>this.form.pushFieldValue(this.name,n,r),this.insertValue=(n,r,i)=>this.form.insertFieldValue(this.name,n,r,i),this.replaceValue=(n,r,i)=>this.form.replaceFieldValue(this.name,n,r,i),this.removeValue=(n,r)=>this.form.removeFieldValue(this.name,n,r),this.swapValues=(n,r,i)=>this.form.swapFieldValues(this.name,n,r,i),this.moveValue=(n,r,i)=>this.form.moveFieldValues(this.name,n,r,i),this.getLinkedFields=n=>{const r=Object.values(this.form.fieldInfo),i=[];for(const o of r){if(!o.instance)continue;const{onChangeListenTo:s,onBlurListenTo:a}=o.instance.options.validators||{};n==="change"&&(s!=null&&s.includes(this.name))&&i.push(o.instance),n==="blur"&&(a!=null&&a.includes(this.name))&&i.push(o.instance)}return i},this.validateSync=(n,r)=>{const i=Jo(n,this.options),s=this.getLinkedFields(n).reduce((l,c)=>{const d=Jo(n,c.options);return d.forEach(f=>{f.field=c}),l.concat(d)},[]);let a=!1;this.form.store.batch(()=>{const l=(c,d)=>{const f=rr(d.cause),h=d.validate?ql(c.runValidator({validate:d.validate,value:{value:c.getValue(),validationSource:"field",fieldApi:c},type:"validate"})):r[f];c.state.meta.errorMap[f]!==h&&c.setMeta(g=>({...g,errorMap:{...g.errorMap,[rr(d.cause)]:h||r[f]}})),(h||r[f])&&(a=!0)};for(const c of i)l(this,c);for(const c of s)c.validate&&l(c.field,c)});const u=rr("submit");return this.state.meta.errorMap[u]&&n!=="submit"&&!a&&this.setMeta(l=>({...l,errorMap:{...l.errorMap,[u]:void 0}})),{hasErrored:a}},this.validateAsync=async(n,r)=>{const i=Zo(n,this.options),o=await r,s=this.getLinkedFields(n),a=s.reduce((f,h)=>{const g=Zo(n,h.options);return g.forEach(p=>{p.field=h}),f.concat(g)},[]);this.state.meta.isValidating||this.setMeta(f=>({...f,isValidating:!0}));for(const f of s)f.setMeta(h=>({...h,isValidating:!0}));const u=[],l=[],c=(f,h,g)=>{const p=rr(h.cause),y=f.getInfo().validationMetaMap[p];y==null||y.lastAbortController.abort();const w=new AbortController;this.getInfo().validationMetaMap[p]={lastAbortController:w},g.push(new Promise(async m=>{var v;let x;try{x=await new Promise((_,T)=>{this.timeoutIds[h.cause]&&clearTimeout(this.timeoutIds[h.cause]),this.timeoutIds[h.cause]=setTimeout(async()=>{if(w.signal.aborted)return _(void 0);try{_(await this.runValidator({validate:h.validate,value:{value:f.getValue(),fieldApi:f,signal:w.signal,validationSource:"field"},type:"validateAsync"}))}catch(V){T(V)}},h.debounceMs)})}catch(_){x=_}if(w.signal.aborted)return m(void 0);const C=ql(x),O=(v=o[this.name])==null?void 0:v[p],L=C||O;f.setMeta(_=>({..._,errorMap:{..._==null?void 0:_.errorMap,[p]:L}})),m(L)}))};for(const f of i)f.validate&&c(this,f,u);for(const f of a)f.validate&&c(f.field,f,l);let d=[];(u.length||l.length)&&(d=await Promise.all(u),await Promise.all(l)),this.setMeta(f=>({...f,isValidating:!1}));for(const f of s)f.setMeta(h=>({...h,isValidating:!1}));return d.filter(Boolean)},this.validate=n=>{var r;if(!this.state.meta.isTouched)return[];let i={},o=Promise.resolve({});try{const a=this.form.validate(n);if(a instanceof Promise)o=a;else{const u=a[this.name];u&&(i=u)}}catch{}const{hasErrored:s}=this.validateSync(n,i);return s&&!this.options.asyncAlways?((r=this.getInfo().validationMetaMap[rr(n)])==null||r.lastAbortController.abort(),this.state.meta.errors):this.validateAsync(n,o)},this.handleChange=n=>{this.setValue(n)},this.handleBlur=()=>{this.state.meta.isTouched||(this.setMeta(r=>({...r,isTouched:!0})),this.validate("change")),this.state.meta.isBlurred||this.setMeta(r=>({...r,isBlurred:!0})),this.validate("blur")},this.form=t.form,this.name=t.name,this.timeoutIds={},t.defaultValue!==void 0&&this.form.setFieldValue(this.name,t.defaultValue,{dontUpdateMeta:!0}),this.store=new Jd({value:this.getValue(),meta:this._getMeta()??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...t.defaultMeta}},{onUpdate:()=>{const n=this.store.state;n.meta.errors=Object.values(n.meta.errorMap).filter(r=>r!==void 0),n.meta.isPristine=!n.meta.isDirty,this.prevState=n,this.state=n}}),this.state=this.store.state,this.prevState=this.state,this.options=t}runValidator(t){const n=[this.form.options.validatorAdapter,this.options.validatorAdapter];for(const r of n)if(r&&typeof t.validate!="function")return r()[t.type](t.value,t.validate);return t.validate(t.value)}setErrorMap(t){this.setMeta(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function ql(e){if(e)return typeof e!="string"?"Invalid Form Values":e}function rr(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}function Wl(e,t=n=>n){const[n,r]=ci({value:t(e.state)}),i=e.subscribe(()=>{const o=t(e.state);r("value",Yu(o))});return W(()=>{i()}),()=>n.value}function Hb(e){const[t,n]=B(!1),r=K(()=>[t(),e]),i=e.store.subscribe(()=>n(o=>!o));return W(i),()=>r()[1]}function tf(e){const t=e(),n=new Gb(t),r=n;return r.Field=nf,Mt(()=>n.update(e())),Bn(()=>W(n.mount())),Hb(r)}function nf(e){const t=tf(()=>{const{children:n,...r}=e;return r});return K(()=>b(()=>e.children(t),{}))}function Ub(e){const t=e==null?void 0:e(),n=new zb(t),r=n;return r.Field=i=>b(nf,A(i,{form:n})),r.createField=i=>tf(()=>({...i(),form:n})),r.useStore=i=>Wl(n.store,i),r.Subscribe=i=>ga(i.children,Wl(n.store,i.selector)),Bn(n.mount),Mt(()=>n.update(e==null?void 0:e())),r}var Wi,Xl;function qb(){if(Xl)return Wi;Xl=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,r)}return this}}return Wi=e,Wi}var Xi,Ql;function ma(){if(Ql)return Xi;Ql=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Xi=r=>r?typeof r!="object"?e:r:t,Xi}var Xr={exports:{}},Qi,Yl;function ya(){if(Yl)return Qi;Yl=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=t-6;return Qi={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Qi}var Yi,Zl;function Ri(){if(Zl)return Yi;Zl=1;var e={};return Yi=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},Yi}var Jl;function va(){return Jl||(Jl=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=ya(),o=Ri();t=e.exports={};const s=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[d,r]],h=p=>{for(const[y,w]of f)p=p.split(`${y}*`).join(`${y}{0,${w}}`).split(`${y}+`).join(`${y}{1,${w}}`);return p},g=(p,y,w)=>{const m=h(y),v=c++;o(p,v,y),l[p]=v,u[v]=y,s[v]=new RegExp(y,w?"g":void 0),a[v]=new RegExp(m,w?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),g("FULL",`^${u[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),g("LOOSE",`^${u[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),g("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[l.COERCE],!0),g("COERCERTLFULL",u[l.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Xr,Xr.exports)),Xr.exports}var Zi,eu;function Wb(){if(eu)return Zi;eu=1;const e=/^[0-9]+$/,t=(r,i)=>{const o=e.test(r),s=e.test(i);return o&&s&&(r=+r,i=+i),r===i?0:o&&!s?-1:s&&!o?1:r<i?-1:1};return Zi={compareIdentifiers:t,rcompareIdentifiers:(r,i)=>t(i,r)},Zi}var Ji,tu;function wa(){if(tu)return Ji;tu=1;const e=Ri(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=ya(),{safeRe:r,t:i}=va(),o=ma(),{compareIdentifiers:s}=Wb();class a{constructor(l,c){if(c=o(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const d=l.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(f=>{if(/^[0-9]+$/.test(f)){const h=+f;if(h>=0&&h<n)return h}return f}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof a)){if(typeof l=="string"&&l===this.version)return 0;l=new a(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof a||(l=new a(l,this.options)),s(this.major,l.major)||s(this.minor,l.minor)||s(this.patch,l.patch)}comparePre(l){if(l instanceof a||(l=new a(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{const d=this.prerelease[c],f=l.prerelease[c];if(e("prerelease compare",c,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++c)}compareBuild(l){l instanceof a||(l=new a(l,this.options));let c=0;do{const d=this.build[c],f=l.build[c];if(e("build compare",c,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++c)}inc(l,c,d){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,d),this.inc("pre",c,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,d),this.inc("pre",c,d);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const f=Number(d)?1:0;if(!c&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[f];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(f)}}if(c){let h=[c,f];d===!1&&(h=[c]),s(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ji=a,Ji}var eo,nu;function Xn(){if(nu)return eo;nu=1;const e=wa();return eo=(n,r,i)=>new e(n,i).compare(new e(r,i)),eo}var to,ru;function Xb(){if(ru)return to;ru=1;const e=Xn();return to=(n,r,i)=>e(n,r,i)===0,to}var no,iu;function Qb(){if(iu)return no;iu=1;const e=Xn();return no=(n,r,i)=>e(n,r,i)!==0,no}var ro,ou;function Yb(){if(ou)return ro;ou=1;const e=Xn();return ro=(n,r,i)=>e(n,r,i)>0,ro}var io,su;function Zb(){if(su)return io;su=1;const e=Xn();return io=(n,r,i)=>e(n,r,i)>=0,io}var oo,au;function Jb(){if(au)return oo;au=1;const e=Xn();return oo=(n,r,i)=>e(n,r,i)<0,oo}var so,lu;function eS(){if(lu)return so;lu=1;const e=Xn();return so=(n,r,i)=>e(n,r,i)<=0,so}var ao,uu;function tS(){if(uu)return ao;uu=1;const e=Xb(),t=Qb(),n=Yb(),r=Zb(),i=Jb(),o=eS();return ao=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return r(a,l,c);case"<":return i(a,l,c);case"<=":return o(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},ao}var lo,cu;function nS(){if(cu)return lo;cu=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,d){if(d=n(d),c instanceof t){if(c.loose===!!d.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,d),this.options=d,this.loose=!!d.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const d=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],f=c.match(d);if(!f)throw new TypeError(`Invalid comparator: ${c}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,d){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,d).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,d).test(c.semver):(d=n(d),d.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,d)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,d)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}lo=t;const n=ma(),{safeRe:r,t:i}=va(),o=tS(),s=Ri(),a=wa(),u=rf();return lo}var uo,du;function rf(){if(du)return uo;du=1;const e=/\s+/g;class t{constructor(R,S){if(S=i(S),R instanceof t)return R.loose===!!S.loose&&R.includePrerelease===!!S.includePrerelease?R:new t(R.raw,S);if(R instanceof o)return this.raw=R.value,this.set=[[R]],this.formatted=void 0,this;if(this.options=S,this.loose=!!S.loose,this.includePrerelease=!!S.includePrerelease,this.raw=R.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(M=>!p(M[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const M of this.set)if(M.length===1&&y(M[0])){this.set=[M];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let R=0;R<this.set.length;R++){R>0&&(this.formatted+="||");const S=this.set[R];for(let I=0;I<S.length;I++)I>0&&(this.formatted+=" "),this.formatted+=S[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(R){const I=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+R,M=r.get(I);if(M)return M;const F=this.options.loose,D=F?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];R=R.replace(D,z(this.options.includePrerelease)),s("hyphen replace",R),R=R.replace(u[l.COMPARATORTRIM],c),s("comparator trim",R),R=R.replace(u[l.TILDETRIM],d),s("tilde trim",R),R=R.replace(u[l.CARETTRIM],f),s("caret trim",R);let j=R.split(" ").map(ne=>m(ne,this.options)).join(" ").split(/\s+/).map(ne=>N(ne,this.options));F&&(j=j.filter(ne=>(s("loose invalid filter",ne,this.options),!!ne.match(u[l.COMPARATORLOOSE])))),s("range list",j);const H=new Map,X=j.map(ne=>new o(ne,this.options));for(const ne of X){if(p(ne))return[ne];H.set(ne.value,ne)}H.size>1&&H.has("")&&H.delete("");const le=[...H.values()];return r.set(I,le),le}intersects(R,S){if(!(R instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>w(I,S)&&R.set.some(M=>w(M,S)&&I.every(F=>M.every(D=>F.intersects(D,S)))))}test(R){if(!R)return!1;if(typeof R=="string")try{R=new a(R,this.options)}catch{return!1}for(let S=0;S<this.set.length;S++)if(oe(this.set[S],R,this.options))return!0;return!1}}uo=t;const n=qb(),r=new n,i=ma(),o=nS(),s=Ri(),a=wa(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=va(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=ya(),p=P=>P.value==="<0.0.0-0",y=P=>P.value==="",w=(P,R)=>{let S=!0;const I=P.slice();let M=I.pop();for(;S&&I.length;)S=I.every(F=>M.intersects(F,R)),M=I.pop();return S},m=(P,R)=>(s("comp",P,R),P=O(P,R),s("caret",P),P=x(P,R),s("tildes",P),P=_(P,R),s("xrange",P),P=V(P,R),s("stars",P),P),v=P=>!P||P.toLowerCase()==="x"||P==="*",x=(P,R)=>P.trim().split(/\s+/).map(S=>C(S,R)).join(" "),C=(P,R)=>{const S=R.loose?u[l.TILDELOOSE]:u[l.TILDE];return P.replace(S,(I,M,F,D,j)=>{s("tilde",P,I,M,F,D,j);let H;return v(M)?H="":v(F)?H=`>=${M}.0.0 <${+M+1}.0.0-0`:v(D)?H=`>=${M}.${F}.0 <${M}.${+F+1}.0-0`:j?(s("replaceTilde pr",j),H=`>=${M}.${F}.${D}-${j} <${M}.${+F+1}.0-0`):H=`>=${M}.${F}.${D} <${M}.${+F+1}.0-0`,s("tilde return",H),H})},O=(P,R)=>P.trim().split(/\s+/).map(S=>L(S,R)).join(" "),L=(P,R)=>{s("caret",P,R);const S=R.loose?u[l.CARETLOOSE]:u[l.CARET],I=R.includePrerelease?"-0":"";return P.replace(S,(M,F,D,j,H)=>{s("caret",P,M,F,D,j,H);let X;return v(F)?X="":v(D)?X=`>=${F}.0.0${I} <${+F+1}.0.0-0`:v(j)?F==="0"?X=`>=${F}.${D}.0${I} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.0${I} <${+F+1}.0.0-0`:H?(s("replaceCaret pr",H),F==="0"?D==="0"?X=`>=${F}.${D}.${j}-${H} <${F}.${D}.${+j+1}-0`:X=`>=${F}.${D}.${j}-${H} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.${j}-${H} <${+F+1}.0.0-0`):(s("no pr"),F==="0"?D==="0"?X=`>=${F}.${D}.${j}${I} <${F}.${D}.${+j+1}-0`:X=`>=${F}.${D}.${j}${I} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.${j} <${+F+1}.0.0-0`),s("caret return",X),X})},_=(P,R)=>(s("replaceXRanges",P,R),P.split(/\s+/).map(S=>T(S,R)).join(" ")),T=(P,R)=>{P=P.trim();const S=R.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return P.replace(S,(I,M,F,D,j,H)=>{s("xRange",P,I,M,F,D,j,H);const X=v(F),le=X||v(D),ne=le||v(j),Ae=ne;return M==="="&&Ae&&(M=""),H=R.includePrerelease?"-0":"",X?M===">"||M==="<"?I="<0.0.0-0":I="*":M&&Ae?(le&&(D=0),j=0,M===">"?(M=">=",le?(F=+F+1,D=0,j=0):(D=+D+1,j=0)):M==="<="&&(M="<",le?F=+F+1:D=+D+1),M==="<"&&(H="-0"),I=`${M+F}.${D}.${j}${H}`):le?I=`>=${F}.0.0${H} <${+F+1}.0.0-0`:ne&&(I=`>=${F}.${D}.0${H} <${F}.${+D+1}.0-0`),s("xRange return",I),I})},V=(P,R)=>(s("replaceStars",P,R),P.trim().replace(u[l.STAR],"")),N=(P,R)=>(s("replaceGTE0",P,R),P.trim().replace(u[R.includePrerelease?l.GTE0PRE:l.GTE0],"")),z=P=>(R,S,I,M,F,D,j,H,X,le,ne,Ae)=>(v(I)?S="":v(M)?S=`>=${I}.0.0${P?"-0":""}`:v(F)?S=`>=${I}.${M}.0${P?"-0":""}`:D?S=`>=${S}`:S=`>=${S}${P?"-0":""}`,v(X)?H="":v(le)?H=`<${+X+1}.0.0-0`:v(ne)?H=`<${X}.${+le+1}.0-0`:Ae?H=`<=${X}.${le}.${ne}-${Ae}`:P?H=`<${X}.${le}.${+ne+1}-0`:H=`<=${H}`,`${S} ${H}`.trim()),oe=(P,R,S)=>{for(let I=0;I<P.length;I++)if(!P[I].test(R))return!1;if(R.prerelease.length&&!S.includePrerelease){for(let I=0;I<P.length;I++)if(s(P[I].semver),P[I].semver!==o.ANY&&P[I].semver.prerelease.length>0){const M=P[I].semver;if(M.major===R.major&&M.minor===R.minor&&M.patch===R.patch)return!0}return!1}return!0};return uo}var co,fu;function rS(){if(fu)return co;fu=1;const e=rf();return co=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},co}var iS=rS();const hu=jc(iS);var oS=he('<form class="flex flex-col gap-3"><div></div><div></div><div><div class="flex items-center space-x-2"></div><p class="text-xs text-muted-foreground mt-[2px]">When disabled, this update will not be available to your users.</p></div><div><div class="flex items-center space-x-2"></div><p class="text-xs text-muted-foreground mt-[2px]">When enabled, this update will require users to update before continuing to use the application.</p></div><div class="flex justify-end">'),sS=he('<em class="text-xs text-red-500">'),aS=he('<em class="text-xs text-muted-foreground">'),lS=he('<a target=_blank rel=noreferrer class="text-xs text-muted-foreground">Commit Hash: '),uS=he('<p class="text-xs text-muted-foreground">Commit Hash: ');const cS=({bundleId:e,onClose:t})=>{const n=mb(e);return b(Pm,{class:"flex flex-col h-full",get children(){return[b(Im,{class:"mb-4",get children(){return b(Mm,{get children(){return["Edit ",e]}})}}),b(Se,{get when(){return n.data},get fallback(){return K(()=>!!n.isFetched)()?b(Fm,{get children(){return["No update bundle found for bundle id ",e]}}):b(Rb,{height:374,radius:10})},children:r=>b(dS,{get bundle(){return r()},onEditSuccess:t})})]}})},dS=({bundle:e,onEditSuccess:t})=>{const n=lc(),r=yb(),[i,o]=B(!1),s=K(()=>{var c,d;return((d=(c=r.data)==null?void 0:c.console)==null?void 0:d.gitUrl)??null}),a=K(()=>e.gitCommitHash),u=Ub(()=>({defaultValues:{message:e.message,targetAppVersion:e.targetAppVersion,enabled:e.enabled,shouldForceUpdate:e.shouldForceUpdate},onSubmit:async({value:c})=>{o(!0);try{const d=await Tr.bundles[":bundleId"].$patch({param:{bundleId:e.id},json:c});if(d.status!==200){const f=await d.json();tl({title:"Error",description:f.error,variant:"error"})}}catch(d){d instanceof Error&&tl({title:"Error",description:d.message,variant:"error"})}finally{o(!1),n.invalidateQueries({queryKey:["bundle",e.id]}),n.invalidateQueries({queryKey:["bundles"]}),t()}}})),l=u.useStore(c=>c.isValid);return(()=>{var c=oS(),d=c.firstChild,f=d.nextSibling,h=f.nextSibling,g=h.firstChild,p=h.nextSibling,y=p.firstChild,w=p.nextSibling;return c.addEventListener("submit",m=>{m.preventDefault(),m.stopPropagation(),u.handleSubmit()}),fe(d,b(Gl,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ul,{for:"message",children:"Message"}),b(u.Field,{name:"message",children:m=>b(Hl,{type:"text",id:"message",placeholder:"Message",get name(){return m().name},get value(){return m().state.value??""},get onBlur(){return m().handleBlur},onInput:v=>m().handleChange(v.currentTarget.value)})})]}})),fe(f,b(Gl,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ul,{for:"targetAppVersion",children:"Target App Version"}),b(u.Field,{name:"targetAppVersion",validators:{onChange:({value:m})=>{if((m==null?void 0:m.length)===0||!hu(m))return"Invalid target app version"}},children:m=>[b(Hl,{type:"text",id:"targetAppVersion",get class(){return de(m().state.meta.errors.length>0&&"border-red-500 focus-visible:ring-red-500")},placeholder:"Target App Version",get name(){return m().name},get value(){return m().state.value??""},get onBlur(){return m().handleBlur},onInput:v=>m().handleChange(v.currentTarget.value)}),K(()=>K(()=>m().state.meta.errors.length>0)()?(()=>{var v=sS();return fe(v,()=>m().state.meta.errors.join(", ")),v})():(()=>{var v=aS();return fe(v,()=>hu(m().state.value)),v})())]})]}})),fe(g,b(u.Field,{name:"enabled",children:m=>b(Kl,{class:"flex items-center space-x-2",get checked(){return m().state.value},get name(){return m().name},onChange:v=>m().handleChange(v),get children(){return[b(jl,{get children(){return b(Bl,{})}}),b(zl,{children:"Enabled"})]}})})),fe(y,b(u.Field,{name:"shouldForceUpdate",children:m=>b(Kl,{class:"flex items-center space-x-2",get checked(){return m().state.value},get name(){return m().name},onChange:v=>m().handleChange(v),get children(){return[b(jl,{get children(){return b(Bl,{})}}),b(zl,{children:"Force Update"})]}})})),fe(c,b(Se,{get when(){return!i()},get fallback(){return b(Vl,{type:"submit",class:"mt-4",disabled:!0,get children(){return b(Gm,{class:"animate-spin"})}})},get children(){return b(Vl,{type:"submit",class:"mt-4",get disabled(){return!l()},children:"Save"})}}),w),fe(w,b(Se,{get when(){return a()},children:m=>s()?(()=>{var v=lS();return v.firstChild,fe(v,()=>m().slice(0,8),null),Ke(()=>Nn(v,"href",`${s()}/commit/${m}`)),v})():(()=>{var v=uS();return v.firstChild,fe(v,()=>m().slice(0,8),null),v})()})),c})()};function fS(){const{bundleIdFilter:e,setBundleIdFilter:t}=Kc(),n=K(()=>e()!==null),r=()=>{t(null)};return b(Sm,{get open(){return n()},onOpenChange:i=>{i||t(null)},get children(){return[b(xb,{columns:qm,onRowClick:i=>{t(i.id)}}),b(Se,{get when(){return e()},get children(){return b(Cf,{get children(){return b(cS,{get bundleId(){return e()},onClose:r})}})}})]}})}const hS=new ig;function gS(){return b(og,{client:hS,get children(){return[b(Fh,{root:e=>b(Qf,{get children(){return[b(Jf,{children:"HotUpdater Console"}),b(_h,{get children(){return e.children}})]}}),get children(){return b(xh,{path:"/",component:fS})}}),b(Jp,{})]}})}const gu=document.getElementById("root");gu&&Df(()=>b(gS,{}),gu);