@hot-updater/console 0.12.6 → 0.12.7

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,585 @@
1
+ var tf=Object.defineProperty;var ya=e=>{throw TypeError(e)};var nf=(e,t,n)=>t in e?tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=(e,t,n)=>nf(e,typeof t!="symbol"?t+"":t,n),Po=(e,t,n)=>t.has(e)||ya("Cannot "+n);var E=(e,t,n)=>(Po(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?ya("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,r)=>(Po(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ue=(e,t,n)=>(Po(e,t,"access private method"),n);var Tr=(e,t,n,r)=>({set _(o){q(e,t,o,n)},get _(){return E(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const ee={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return va(this.context.count)},getNextContextId(){return va(this.context.count++)}};function va(e){const t=String(e),n=t.length-1;return ee.context.id+(n?String.fromCharCode(96+n):"")+t}function or(e){ee.context=e}const rf=(e,t)=>e===t,ot=Symbol("solid-proxy"),mu=typeof Proxy=="function",ds=Symbol("solid-track"),Yr={equals:rf};let yu=Su;const st=1,dr=2,vu={owned:null,cleanups:null,context:null,owner:null},Io={};var ie=null;let G=null,of=null,fe=null,ke=null,De=null,oo=0;function un(e,t){const n=fe,r=ie,o=e.length===0,s=t===void 0?r:t,i=o?vu:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=o?e:()=>e(()=>Ae(()=>Gt(i)));ie=i,fe=null;try{return He(a,!0)}finally{fe=n,ie=r}}function j(e,t){t=t?Object.assign({},Yr,t):Yr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(G&&G.running&&G.sources.has(n)?o=o(n.tValue):o=o(n.value)),bu(n,o));return[wu.bind(n),r]}function At(e,t,n){const r=ao(e,t,!0,st);Gn(r)}function Be(e,t,n){const r=ao(e,t,!1,st);Gn(r)}function U(e,t,n){yu=ff;const r=ao(e,t,!1,st),o=cn&&ye(cn);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),De?De.push(r):Gn(r)}function K(e,t,n){n=n?Object.assign({},Yr,n):Yr;const r=ao(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Gn(r),wu.bind(r)}function sf(e){return e&&typeof e=="object"&&"then"in e}function af(e,t,n){let r,o,s;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,s=t):(r=e,o=t,s={});let i=null,a=Io,l=null,u=!1,c=!1,d="initialValue"in s,f=typeof r=="function"&&K(r);const h=new Set,[g,p]=(s.storage||j)(s.initialValue),[m,w]=j(void 0),[y,v]=j(void 0,{equals:!1}),[x,C]=j(d?"ready":"unresolved");ee.context&&(l=ee.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:ee.load&&ee.has(l)&&(a=ee.load(l)));function O(k,V,z,se){return i===k&&(i=null,se!==void 0&&(d=!0),(k===a||V===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(se,{value:V})),a=Io,G&&k&&u?(G.promises.delete(k),u=!1,He(()=>{G.running=!0,L(V,z)},!1)):L(V,z)),V}function L(k,V){He(()=>{V===void 0&&p(()=>k),C(V!==void 0?"errored":d?"ready":"unresolved"),w(V);for(const z of h.keys())z.decrement();h.clear()},!1)}function _(){const k=cn&&ye(cn),V=g(),z=m();if(z!==void 0&&!i)throw z;return fe&&!fe.user&&k&&At(()=>{y(),i&&(k.resolved&&G&&u?G.promises.add(i):h.has(k)||(k.increment(),h.add(k)))}),V}function T(k=!0){if(k!==!1&&c)return;c=!1;const V=f?f():r;if(u=G&&G.running,V==null||V===!1){O(i,Ae(g));return}G&&i&&G.promises.delete(i);const z=a!==Io?a:Ae(()=>o(V,{value:g(),refetching:k}));return sf(z)?(i=z,"value"in z?(z.status==="success"?O(i,z.value,void 0,V):O(i,void 0,hs(z.value),V),z):(c=!0,queueMicrotask(()=>c=!1),He(()=>{C(d?"refreshing":"pending"),v()},!1),z.then(se=>O(z,se,void 0,V),se=>O(z,void 0,hs(se),V)))):(O(i,z,void 0,V),z)}return Object.defineProperties(_,{state:{get:()=>x()},error:{get:()=>m()},loading:{get(){const k=x();return k==="pending"||k==="refreshing"}},latest:{get(){if(!d)return _();const k=m();if(k&&!i)throw k;return g()}}}),f?At(()=>T(!1)):T(!1),[_,{refetch:T,mutate:p}]}function so(e){return He(e,!1)}function Ae(e){if(fe===null)return e();const t=fe;fe=null;try{return e()}finally{fe=t}}function Ee(e,t,n){const r=Array.isArray(e);let o,s=n&&n.defer;return i=>{let a;if(r){a=Array(e.length);for(let u=0;u<e.length;u++)a[u]=e[u]()}else a=e();if(s)return s=!1,i;const l=Ae(()=>t(a,o,i));return o=a,l}}function zn(e){U(()=>Ae(e))}function W(e){return ie===null||(ie.cleanups===null?ie.cleanups=[e]:ie.cleanups.push(e)),e}function fs(){return fe}function fr(){return ie}function ti(e,t){const n=ie,r=fe;ie=e,fe=null;try{return He(t,!0)}catch(o){ni(o)}finally{ie=n,fe=r}}function lf(e){if(G&&G.running)return e(),G.done;const t=fe,n=ie;return Promise.resolve().then(()=>{fe=t,ie=n;let r;return cn&&(r=G||(G={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),He(e,!1),fe=ie=null,r?r.done:void 0})}const[dS,wa]=j(!1);function uf(e){De.push.apply(De,e),e.length=0}function be(e,t){const n=Symbol("context");return{id:n,Provider:hf(n),defaultValue:e}}function ye(e){let t;return ie&&ie.context&&(t=ie.context[e.id])!==void 0?t:e.defaultValue}function io(e){const t=K(e),n=K(()=>gs(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let cn;function cf(){return cn||(cn=be())}function wu(){const e=G&&G.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===st)Gn(this);else{const t=ke;ke=null,He(()=>Zr(this),!1),ke=t}if(fe){const t=this.observers?this.observers.length:0;fe.sources?(fe.sources.push(this),fe.sourceSlots.push(t)):(fe.sources=[this],fe.sourceSlots=[t]),this.observers?(this.observers.push(fe),this.observerSlots.push(fe.sources.length-1)):(this.observers=[fe],this.observerSlots=[fe.sources.length-1])}return e&&G.sources.has(this)?this.tValue:this.value}function bu(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 o=G.running;(o||!n&&G.sources.has(e))&&(G.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&He(()=>{for(let o=0;o<e.observers.length;o+=1){const s=e.observers[o],i=G&&G.running;i&&G.disposed.has(s)||((i?!s.tState:!s.state)&&(s.pure?ke.push(s):De.push(s),s.observers&&xu(s)),i?s.tState=st:s.state=st)}if(ke.length>1e6)throw ke=[],new Error},!1)}return t}function Gn(e){if(!e.fn)return;Gt(e);const t=oo;ba(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),fe=ie=e,ba(e,e.tValue,t),fe=ie=null},!1)})}function ba(e,t,n){let r;const o=ie,s=fe;fe=ie=e;try{r=e.fn(t)}catch(i){return e.pure&&(G&&G.running?(e.tState=st,e.tOwned&&e.tOwned.forEach(Gt),e.tOwned=void 0):(e.state=st,e.owned&&e.owned.forEach(Gt),e.owned=null)),e.updatedAt=n+1,ni(i)}finally{fe=s,ie=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?bu(e,r,!0):G&&G.running&&e.pure?(G.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function ao(e,t,n,r=st,o){const s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ie,context:ie?ie.context:null,pure:n};return G&&G.running&&(s.state=0,s.tState=r),ie===null||ie!==vu&&(G&&G.running&&ie.pure?ie.tOwned?ie.tOwned.push(s):ie.tOwned=[s]:ie.owned?ie.owned.push(s):ie.owned=[s]),s}function Qr(e){const t=G&&G.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===dr)return Zr(e);if(e.suspense&&Ae(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<oo);){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 o=e,s=n[r+1];for(;(o=o.owner)&&o!==s;)if(G.disposed.has(o))return}if((t?e.tState:e.state)===st)Gn(e);else if((t?e.tState:e.state)===dr){const o=ke;ke=null,He(()=>Zr(e,n[0]),!1),ke=o}}}function He(e,t){if(ke)return e();let n=!1;t||(ke=[]),De?n=!0:De=[],oo++;try{const r=e();return df(n),r}catch(r){n||(De=null),ke=null,ni(r)}}function df(e){if(ke&&(Su(ke),ke=null),e)return;let t;if(G){if(!G.promises.size&&!G.queue.size){const r=G.sources,o=G.disposed;De.push.apply(De,G.effects),t=G.resolve;for(const s of De)"tState"in s&&(s.state=s.tState),delete s.tState;G=null,He(()=>{for(const s of o)Gt(s);for(const s of r){if(s.value=s.tValue,s.owned)for(let i=0,a=s.owned.length;i<a;i++)Gt(s.owned[i]);s.tOwned&&(s.owned=s.tOwned),delete s.tValue,delete s.tOwned,s.tState=0}wa(!1)},!1)}else if(G.running){G.running=!1,G.effects.push.apply(G.effects,De),De=null,wa(!0);return}}const n=De;De=null,n.length&&He(()=>yu(n),!1),t&&t()}function Su(e){for(let t=0;t<e.length;t++)Qr(e[t])}function ff(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Qr(r)}if(ee.context){if(ee.count){ee.effects||(ee.effects=[]),ee.effects.push(...e.slice(0,n));return}or()}for(ee.effects&&(ee.done||!ee.count)&&(e=[...ee.effects,...e],n+=ee.effects.length,delete ee.effects),t=0;t<n;t++)Qr(e[t])}function Zr(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 o=e.sources[r];if(o.sources){const s=n?o.tState:o.state;s===st?o!==t&&(!o.updatedAt||o.updatedAt<oo)&&Qr(o):s===dr&&Zr(o,t)}}}function xu(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&&xu(r))}}function Gt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const s=o.pop(),i=n.observerSlots.pop();r<o.length&&(s.sourceSlots[i]=r,o[r]=s,n.observerSlots[r]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Gt(e.tOwned[t]);delete e.tOwned}if(G&&G.running&&e.pure)Cu(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Gt(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 Cu(e,t){if(t||(e.tState=0,G.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)Cu(e.owned[n])}function hs(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ni(e,t=ie){throw hs(e)}function gs(e){if(typeof e=="function"&&!e.length)return gs(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=gs(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function hf(e,t){return function(r){let o;return Be(()=>o=Ae(()=>(ie.context={...ie.context,[e]:r.value},io(()=>r.children))),void 0),o}}const gf=Symbol("fallback");function Sa(e){for(let t=0;t<e.length;t++)e[t]()}function pf(e,t,n={}){let r=[],o=[],s=[],i=0,a=t.length>1?[]:null;return W(()=>Sa(s)),()=>{let l=e()||[],u=l.length,c,d;return l[ds],Ae(()=>{let h,g,p,m,w,y,v,x,C;if(u===0)i!==0&&(Sa(s),s=[],r=[],o=[],i=0,a&&(a=[])),n.fallback&&(r=[gf],o[0]=un(O=>(s[0]=O,n.fallback())),i=1);else if(i===0){for(o=new Array(u),d=0;d<u;d++)r[d]=l[d],o[d]=un(f);i=u}else{for(p=new Array(u),m=new Array(u),a&&(w=new Array(u)),y=0,v=Math.min(i,u);y<v&&r[y]===l[y];y++);for(v=i-1,x=u-1;v>=y&&x>=y&&r[v]===l[x];v--,x--)p[x]=o[v],m[x]=s[v],a&&(w[x]=a[v]);for(h=new Map,g=new Array(x+1),d=x;d>=y;d--)C=l[d],c=h.get(C),g[d]=c===void 0?-1:c,h.set(C,d);for(c=y;c<=v;c++)C=r[c],d=h.get(C),d!==void 0&&d!==-1?(p[d]=o[c],m[d]=s[c],a&&(w[d]=a[c]),d=g[d],h.set(C,d)):s[c]();for(d=y;d<u;d++)d in p?(o[d]=p[d],s[d]=m[d],a&&(a[d]=w[d],a[d](d))):o[d]=un(f);o=o.slice(0,i=u),r=l.slice(0)}return o});function f(h){if(s[d]=h,a){const[g,p]=j(d);return a[d]=p,t(l[d],g)}return t(l[d])}}}function S(e,t){return Ae(()=>e(t||{}))}function Dr(){return!0}const ps={get(e,t,n){return t===ot?n:e.get(t)},has(e,t){return t===ot?!0:e.has(t)},set:Dr,deleteProperty:Dr,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Dr,deleteProperty:Dr}},ownKeys(e){return e.keys()}};function Mo(e){return(e=typeof e=="function"?e():e)?e:{}}function mf(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function F(...e){let t=!1;for(let i=0;i<e.length;i++){const a=e[i];t=t||!!a&&ot in a,e[i]=typeof a=="function"?(t=!0,K(a)):a}if(mu&&t)return new Proxy({get(i){for(let a=e.length-1;a>=0;a--){const l=Mo(e[a])[i];if(l!==void 0)return l}},has(i){for(let a=e.length-1;a>=0;a--)if(i in Mo(e[a]))return!0;return!1},keys(){const i=[];for(let a=0;a<e.length;a++)i.push(...Object.keys(Mo(e[a])));return[...new Set(i)]}},ps);const n={},r=Object.create(null);for(let i=e.length-1;i>=0;i--){const a=e[i];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let u=l.length-1;u>=0;u--){const c=l[u];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:mf.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 o={},s=Object.keys(r);for(let i=s.length-1;i>=0;i--){const a=s[i],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function N(e,...t){if(mu&&ot in e){const o=new Set(t.length>1?t.flat():t[0]),s=t.map(i=>new Proxy({get(a){return i.includes(a)?e[a]:void 0},has(a){return i.includes(a)&&a in e},keys(){return i.filter(a=>a in e)}},ps));return s.push(new Proxy({get(i){return o.has(i)?void 0:e[i]},has(i){return o.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!o.has(i))}},ps)),s}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const s=Object.getOwnPropertyDescriptor(e,o),i=!s.get&&!s.set&&s.enumerable&&s.writable&&s.configurable;let a=!1,l=0;for(const u of t)u.includes(o)&&(a=!0,i?r[l][o]=s.value:Object.defineProperty(r[l],o,s)),++l;a||(i?n[o]=s.value:Object.defineProperty(n,o,s))}return[...r,n]}let yf=0;function Re(){return ee.context?ee.getNextContextId():`cl-${yf++}`}const vf=e=>`Stale read from <${e}>.`;function Mt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return K(pf(()=>e.each,e.children,t||void 0))}function xe(e){const t=e.keyed,n=K(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return K(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Ae(()=>o(t?r:()=>{if(!Ae(n))throw vf("Show");return e.when})):o}return e.fallback},void 0,void 0)}const wf=be();function Eu(e){let t=0,n,r,o,s,i;const[a,l]=j(!1),u=cf(),c={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!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"?o=p:ee.gather(g)),o&&o!=="$$f"){const[m,w]=j(void 0,{equals:!1});s=m,o.then(()=>{if(ee.done)return w();ee.gather(g),or(r),w(),or()},y=>{i=y,w()})}}const f=ye(wf);f&&(n=f.register(c.inFallback));let h;return W(()=>h&&h()),S(u.Provider,{value:c,get children(){return K(()=>{if(i)throw i;if(r=ee.context,s)return s(),s=void 0;r&&o==="$$f"&&or();const g=K(()=>e.children);return K(p=>{const m=c.inFallback(),{showContent:w=!0,showFallback:y=!0}=n?n():{};if((!m||o&&o!=="$$f")&&w)return c.resolved=!0,h&&h(),h=r=o=void 0,uf(c.effects),g();if(y)return h?p:un(v=>(h=v,r&&(or({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const bf=["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"],Sf=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...bf]),xf=new Set(["innerHTML","textContent","innerText","children"]),Cf=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Ef=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 Rf(e,t){const n=Ef[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Pf=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),If=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"]),Mf={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Af(e,t,n){let r=n.length,o=t.length,s=r,i=0,a=0,l=t[o-1].nextSibling,u=null;for(;i<o||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===i){const c=s<r?a?n[a-1].nextSibling:n[s-a]:l;for(;a<s;)e.insertBefore(n[a++],c)}else if(s===a)for(;i<o;)(!u||!u.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[a]===t[o-1]){const c=t[--o].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--s],c),t[o]=n[s]}else{if(!u){u=new Map;let d=a;for(;d<s;)u.set(n[d],d++)}const c=u.get(t[i]);if(c!=null)if(a<c&&c<s){let d=i,f=1,h;for(;++d<o&&d<s&&!((h=u.get(t[d]))==null||h!==c+f);)f++;if(f>c-a){const g=t[i];for(;a<c;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[i++])}else i++;else t[i++].remove()}}}const xa="_$DX_DELEGATE";function Ff(e,t,n,r={}){let o;return un(s=>{o=s,t===document?e():he(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function pe(e,t,n){let r;const o=()=>{const i=document.createElement("template");return i.innerHTML=e,i.content.firstChild},s=()=>(r||(r=o())).cloneNode(!0);return s.cloneNode=s,s}function ri(e,t=window.document){const n=t[xa]||(t[xa]=new Set);for(let r=0,o=e.length;r<o;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,Kf))}}function dn(e,t,n){mn(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function $f(e,t,n,r){mn(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Of(e,t,n){mn(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function Ru(e,t){mn(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Tf(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 o=n[0];e.addEventListener(t,n[0]=s=>o.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Df(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let s,i;for(s=0,i=o.length;s<i;s++){const a=o[s];!a||a==="undefined"||t[a]||(Ca(e,a,!1),delete n[a])}for(s=0,i=r.length;s<i;s++){const a=r[s],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Ca(e,a,!0),n[a]=l)}return n}function Lf(e,t,n){if(!t)return n?dn(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 o,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)o=t[s],o!==n[s]&&(r.setProperty(s,o),n[s]=o);return n}function it(e,t={},n,r){const o={};return r||Be(()=>o.children=hr(e,t.children,o.children)),Be(()=>typeof t.ref=="function"&&_f(t.ref,e)),Be(()=>kf(e,t,n,!0,o,!0)),o}function _f(e,t,n){return Ae(()=>e(t,n))}function he(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return hr(e,t,r,n);Be(o=>hr(e,t(),o,n),r)}function kf(e,t,n,r,o={},s=!1){t||(t={});for(const i in o)if(!(i in t)){if(i==="children")continue;o[i]=Ea(e,i,null,o[i],n,s,t)}for(const i in t){if(i==="children")continue;const a=t[i];o[i]=Ea(e,i,a,o[i],n,s,t)}}function Vf(e){let t,n;return!mn()||!(t=ee.registry.get(n=jf()))?e():(ee.completed&&ee.completed.add(t),ee.registry.delete(n),t)}function mn(e){return!!ee.context&&!ee.done&&(!e||e.isConnected)}function Nf(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Ca(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,s=r.length;o<s;o++)e.classList.toggle(r[o],n)}function Ea(e,t,n,r,o,s,i){let a,l,u,c,d;if(t==="style")return Lf(e,n,r);if(t==="classList")return Df(e,n,r);if(n===r)return r;if(t==="ref")s||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=Pf.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(Tf(e,f,n,h),h&&ri([f]))}else if(t.slice(0,5)==="attr:")dn(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")Of(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=xf.has(t))||!o&&((c=Rf(t,e.tagName))||(l=Sf.has(t)))||(a=e.nodeName.includes("-")||"is"in i)){if(d)t=t.slice(5),l=!0;else if(mn(e))return n;t==="class"||t==="className"?Ru(e,n):a&&!l&&!u?e[Nf(t)]=n:e[c||t]=n}else{const f=o&&t.indexOf(":")>-1&&Mf[t.split(":")[0]];f?$f(e,f,t,n):dn(e,Cf[t]||t,n)}return n}function Kf(e){if(ee.registry&&ee.events&&ee.events.find(([l,u])=>u===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),i=()=>{const l=t[n];if(l&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?l.call(t,u,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;i()&&(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 l=e.composedPath();s(l[0]);for(let u=0;u<l.length-2&&(t=l[u],!!i());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();s(r)}function hr(e,t,n,r,o){const s=mn(e);if(s){!n&&(n=[...e.childNodes]);let l=[];for(let u=0;u<n.length;u++){const c=n[u];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():l.push(c)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(s||i==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=wn(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(s)return n;n=wn(e,n,r)}else{if(i==="function")return Be(()=>{let l=t();for(;typeof l=="function";)l=l();n=hr(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],u=n&&Array.isArray(n);if(ms(l,t,n,o))return Be(()=>n=hr(e,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let c=l[0];if(c.parentNode!==e)return n;const d=[c];for(;(c=c.nextSibling)!==r;)d.push(c);return n=d}if(l.length===0){if(n=wn(e,n,r),a)return n}else u?n.length===0?Ra(e,l,r):Af(e,n,l):(n&&wn(e),Ra(e,l));n=l}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=wn(e,n,r,t);wn(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function ms(e,t,n,r){let o=!1;for(let s=0,i=t.length;s<i;s++){let a=t[s],l=n&&n[e.length],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=ms(e,a,l)||o;else if(u==="function")if(r){for(;typeof a=="function";)a=a();o=ms(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const c=String(a);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c))}}return o}function Ra(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function wn(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let s=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const l=a.parentNode===e;!s&&!i?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else s=!0}}else e.insertBefore(o,n);return[o]}function jf(){return ee.getNextContextId()}const Bf=!1,zf="http://www.w3.org/2000/svg";function Pu(e,t=!1){return t?document.createElementNS(zf,e):document.createElement(e)}function oi(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=fr();let s,i=!!ee.context;return U(()=>{i&&(fr().user=i=!1),s||(s=ti(o,()=>K(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,u]=j(!1),c=()=>u(!0);un(d=>he(a,()=>l()?d():s(),null)),W(c)}else{const l=Pu(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),he(u,s),a.appendChild(l),e.ref&&e.ref(l),W(()=>a.removeChild(l))}},void 0,{render:!i}),n}function Iu(e){const[t,n]=N(e,["component"]),r=K(()=>t.component);return K(()=>{const o=r();switch(typeof o){case"function":return Ae(()=>o(n));case"string":const s=If.has(o),i=ee.context?Vf():Pu(o,s);return it(i,n,s),i}})}const Mu=be(),Gf=["title","meta"],Pa=[],Ia=["name","http-equiv","content","charset","media"].concat(["property"]),Ma=(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 Hf(){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(Gf.indexOf(n.tag)!==-1){const s=n.tag==="title"?Pa:Ia,i=Ma(n,s);e.has(i)||e.set(i,[]);let a=e.get(i),l=a.length;a=[...a,n],e.set(i,a);let u=t(n);n.ref=u,it(u,n.props);let c=null;for(var r=l-1;r>=0;r--)if(a[r]!=null){c=a[r];break}return u.parentNode!=document.head&&document.head.appendChild(u),c&&c.ref&&c.ref.parentNode&&document.head.removeChild(c.ref),l}let o=t(n);return n.ref=o,it(o,n.props),o.parentNode!=document.head&&document.head.appendChild(o),-1},removeTag(n,r){const o=n.tag==="title"?Pa:Ia,s=Ma(n,o);if(n.ref){const i=e.get(s);if(i){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let a=r-1;a>=0;a--)i[a]!=null&&document.head.appendChild(i[a].ref)}i[r]=null,e.set(s,i)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const Uf=e=>{const t=Hf();return S(Mu.Provider,{value:t,get children(){return e.children}})},qf=(e,t,n)=>(Wf({tag:e,props:t,setting:n,id:Re(),get name(){return t.name||t.property}}),null);function Wf(e){const t=ye(Mu);if(!t)throw new Error("<MetaProvider /> should be in the tree");Be(()=>{const n=t.addTag(e);W(()=>t.removeTag(e,n))})}const Xf=e=>qf("title",e,{escape:!0,close:!0});function Au(){let e=new Set;function t(o){return e.add(o),()=>e.delete(o)}let n=!1;function r(o,s){if(n)return!(n=!1);const i={to:o,options:s,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0};for(const a of e)a.listener({...i,from:a.location,retry:l=>{l&&(n=!0),a.navigate(o,{...s,resolve:!1})}});return!i.defaultPrevented}return{subscribe:t,confirm:r}}let ys;function si(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),ys=window.history.state._depth}si();function Yf(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function Qf(e,t){let n=!1;return()=>{const r=ys;si();const o=r==null?null:ys-r;if(n){n=!1;return}o&&t(o)?(n=!0,window.history.go(-o)):e()}}const Zf=/^(?:[a-z0-9]+:)?\/\//i,Jf=/^\/+|(\/)\/+$/g,Fu="http://sr";function ur(e,t=!1){const n=e.replace(Jf,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function Wr(e,t,n){if(Zf.test(t))return;const r=ur(e),o=n&&ur(n);let s="";return!o||t.startsWith("/")?s=r:o.toLowerCase().indexOf(r.toLowerCase())!==0?s=r+o:s=o,(s||"/")+ur(t,!s)}function eh(e,t){if(e==null)throw new Error(t);return e}function th(e,t){return ur(e).replace(/\/*(\*.*)?$/g,"")+ur(t)}function $u(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 nh(e,t,n){const[r,o]=e.split("/*",2),s=r.split("/").filter(Boolean),i=s.length;return a=>{const l=a.split("/").filter(Boolean),u=l.length-i;if(u<0||u>0&&o===void 0&&!t)return null;const c={path:i?"":"/",params:{}},d=f=>n===void 0?void 0:n[f];for(let f=0;f<i;f++){const h=s[f],g=h[0]===":",p=g?l[f]:l[f].toLowerCase(),m=g?h.slice(1):h.toLowerCase();if(g&&Ao(p,d(m)))c.params[m]=p;else if(g||!Ao(p,m))return null;c.path+=`/${p}`}if(o){const f=u?l.slice(-u).join("/"):"";if(Ao(f,d(o)))c.params[o]=f;else return null}return c}}function Ao(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 rh(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((o,s)=>o+(s.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function Ou(e){const t=new Map,n=fr();return new Proxy({},{get(r,o){return t.has(o)||ti(n,()=>t.set(o,K(()=>e()[o]))),t.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function Tu(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 o=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)o.push(n+=t[1]),r=r.slice(t[0].length);return Tu(r).reduce((s,i)=>[...s,...o.map(a=>a+i)],[])}const oh=100,Du=be(),Lu=be(),_u=()=>eh(ye(Du),"<A> and 'use' router primitives can be only used inside a Route."),sh=()=>_u().navigatorFactory(),ih=()=>_u().params;function ah(e,t=""){const{component:n,preload:r,load:o,children:s,info:i}=e,a=!s||Array.isArray(s)&&!s.length,l={key:e,component:n,preload:r||o,info:i};return ku(e.path).reduce((u,c)=>{for(const d of Tu(c)){const f=th(t,d);let h=a?f:f.split("/*",1)[0];h=h.split("/").map(g=>g.startsWith(":")||g.startsWith("*")?g:encodeURIComponent(g)).join("/"),u.push({...l,originalPath:c,pattern:h,matcher:nh(h,!a,e.matchFilters)})}return u},[])}function lh(e,t=0){return{routes:e,score:rh(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let o=e.length-1;o>=0;o--){const s=e[o],i=s.matcher(n);if(!i)return null;r.unshift({...i,route:s})}return r}}}function ku(e){return Array.isArray(e)?e:[e]}function Vu(e,t="",n=[],r=[]){const o=ku(e);for(let s=0,i=o.length;s<i;s++){const a=o[s];if(a&&typeof a=="object"){a.hasOwnProperty("path")||(a.path="");const l=ah(a,t);for(const u of l){n.push(u);const c=Array.isArray(a.children)&&a.children.length===0;if(a.children&&!c)Vu(a.children,u.pattern,n,r);else{const d=lh([...n],r.length);r.push(d)}n.pop()}}}return n.length?r:r.sort((s,i)=>i.score-s.score)}function Fo(e,t){for(let n=0,r=e.length;n<r;n++){const o=e[n].matcher(t);if(o)return o}return[]}function uh(e,t,n){const r=new URL(Fu),o=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}),s=K(()=>o().pathname),i=K(()=>o().search,!0),a=K(()=>o().hash),l=()=>"",u=Ee(i,()=>$u(o()));return{get pathname(){return s()},get search(){return i()},get hash(){return a()},get state(){return t()},get key(){return l()},query:n?n(u):Ou(u)}}let Jt;function ch(){return Jt}function dh(e,t,n,r={}){const{signal:[o,s],utils:i={}}=e,a=i.parsePath||(P=>P),l=i.renderPath||(P=>P),u=i.beforeLeave||Au(),c=Wr("",r.base||"");if(c===void 0)throw new Error(`${c} is not a valid base path`);c&&!o().value&&s({value:c,replace:!0,scroll:!1});const[d,f]=j(!1);let h;const g=(P,R)=>{R.value===p()&&R.state===w()||(h===void 0&&f(!0),Jt=P,h=R,lf(()=>{h===R&&(m(h.value),y(h.state),C[1]([]))}).finally(()=>{h===R&&so(()=>{Jt=void 0,P==="navigate"&&z(h),f(!1),h=void 0})}))},[p,m]=j(o().value),[w,y]=j(o().state),v=uh(p,w,i.queryWrapper),x=[],C=j([]),O=K(()=>typeof r.transformUrl=="function"?Fo(t(),r.transformUrl(v.pathname)):Fo(t(),v.pathname)),L=()=>{const P=O(),R={};for(let b=0;b<P.length;b++)Object.assign(R,P[b].params);return R},_=i.paramsWrapper?i.paramsWrapper(L,t):Ou(L),T={pattern:c,path:()=>c,outlet:()=>null,resolvePath(P){return Wr(c,P)}};return Be(Ee(o,P=>g("native",P),{defer:!0})),{base:T,location:v,params:_,isRouting:d,renderPath:l,parsePath:a,navigatorFactory:V,matches:O,beforeLeave:u,preloadRoute:se,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:C};function k(P,R,b){Ae(()=>{if(typeof R=="number"){R&&(i.go?i.go(R):console.warn("Router integration does not support relative routing"));return}const I=!R||R[0]==="?",{replace:M,resolve:A,scroll:D,state:B}={replace:!1,resolve:!I,scroll:!0,...b},H=A?P.resolvePath(R):Wr(I&&v.pathname||"",R);if(H===void 0)throw new Error(`Path '${R}' is not a routable path`);if(x.length>=oh)throw new Error("Too many redirects");const X=p();(H!==X||B!==w())&&(Bf||u.confirm(H,b)&&(x.push({value:X,replace:M,scroll:D,state:w()}),g("navigate",{value:H,state:B})))})}function V(P){return P=P||ye(Lu)||T,(R,b)=>k(P,R,b)}function z(P){const R=x[0];R&&(s({...P,replace:R.replace,scroll:R.scroll}),x.length=0)}function se(P,R){const b=Fo(t(),P.pathname),I=Jt;Jt="preload";for(let M in b){const{route:A,params:D}=b[M];A.component&&A.component.preload&&A.component.preload();const{preload:B}=A;R&&B&&ti(n(),()=>B({params:D,location:{pathname:P.pathname,search:P.search,hash:P.hash,query:$u(P),state:null,key:""},intent:"preload"}))}Jt=I}}function fh(e,t,n,r){const{base:o,location:s,params:i}=e,{pattern:a,component:l,preload:u}=r().route,c=K(()=>r().path);l&&l.preload&&l.preload();const d=u?u({params:i,location:s,intent:Jt||"initial"}):void 0;return{parent:t,pattern:a,path:c,outlet:()=>l?S(l,{params:i,location:s,data:d,get children(){return n()}}):n(),resolvePath(h){return Wr(o.path(),h,c())}}}const hh=e=>t=>{const{base:n}=t,r=io(()=>t.children),o=K(()=>Vu(r(),t.base||""));let s;const i=dh(e,o,()=>s,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(i),S(Du.Provider,{value:i,get children(){return S(gh,{routerState:i,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[K(()=>(s=fr())&&null),S(ph,{routerState:i,get branches(){return o()}})]}})}})};function gh(e){const t=e.routerState.location,n=e.routerState.params,r=K(()=>e.preload&&Ae(()=>{e.preload({params:n,location:t,intent:ch()||"initial"})}));return S(xe,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>S(o,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function ph(e){const t=[];let n;const r=K(Ee(e.routerState.matches,(o,s,i)=>{let a=s&&o.length===s.length;const l=[];for(let u=0,c=o.length;u<c;u++){const d=s&&s[u],f=o[u];i&&d&&f.route.key===d.route.key?l[u]=i[u]:(a=!1,t[u]&&t[u](),un(h=>{t[u]=h,l[u]=fh(e.routerState,l[u-1]||e.routerState.base,Aa(()=>r()[u+1]),()=>e.routerState.matches()[u])}))}return t.splice(o.length).forEach(u=>u()),i&&a?i:(n=l[0],l)}));return Aa(()=>r()&&n)()}const Aa=e=>()=>S(xe,{get when(){return e()},keyed:!0,children:t=>S(Lu.Provider,{value:t,get children(){return t.outlet()}})}),Fa=e=>{const t=io(()=>e.children);return F(e,{get children(){return t()}})};function mh([e,t],n,r){return[e,o=>t(r(o))]}function yh(e){let t=!1;const n=o=>typeof o=="string"?{value:o}:o,r=mh(j(n(e.get()),{equals:(o,s)=>o.value===s.value&&o.state===s.state}),void 0,o=>(!t&&e.set(o),ee.registry&&!ee.done&&(ee.done=!0),o));return e.init&&W(e.init((o=e.get())=>{t=!0,r[1](n(o)),t=!1})),hh({signal:r,create:e.create,utils:e.utils})}function vh(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function wh(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const bh=new Map;function Sh(e=!0,t=!1,n="/_server",r){return o=>{const s=o.base.path(),i=o.navigatorFactory(o.base);let a,l;function u(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 m=p.composedPath().find(O=>O instanceof Node&&O.nodeName.toUpperCase()==="A");if(!m||t&&!m.hasAttribute("link"))return;const w=u(m),y=w?m.href.baseVal:m.href;if((w?m.target.baseVal:m.target)||!y&&!m.hasAttribute("state"))return;const x=(m.getAttribute("rel")||"").split(/\s+/);if(m.hasAttribute("download")||x&&x.includes("external"))return;const C=w?new URL(y,document.baseURI):new URL(y);if(!(C.origin!==window.location.origin||s&&C.pathname&&!C.pathname.toLowerCase().startsWith(s.toLowerCase())))return[m,C]}function d(p){const m=c(p);if(!m)return;const[w,y]=m,v=o.parsePath(y.pathname+y.search+y.hash),x=w.getAttribute("state");p.preventDefault(),i(v,{resolve:!1,replace:w.hasAttribute("replace"),scroll:!w.hasAttribute("noscroll"),state:x?JSON.parse(x):void 0})}function f(p){const m=c(p);if(!m)return;const[w,y]=m;r&&(y.pathname=r(y.pathname)),o.preloadRoute(y,w.getAttribute("preload")!=="false")}function h(p){clearTimeout(a);const m=c(p);if(!m)return l=null;const[w,y]=m;l!==w&&(r&&(y.pathname=r(y.pathname)),a=setTimeout(()=>{o.preloadRoute(y,w.getAttribute("preload")!=="false"),l=w},20))}function g(p){if(p.defaultPrevented)return;let m=p.submitter&&p.submitter.hasAttribute("formaction")?p.submitter.getAttribute("formaction"):p.target.getAttribute("action");if(!m)return;if(!m.startsWith("https://action/")){const y=new URL(m,Fu);if(m=o.parsePath(y.pathname+y.search),!m.startsWith(n))return}if(p.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const w=bh.get(m);if(w){p.preventDefault();const y=new FormData(p.target,p.submitter);w.call({r:o,f:p.target},p.target.enctype==="multipart/form-data"?y:new URLSearchParams(y))}}ri(["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 xh(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,o=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:o}},n=Au();return yh({get:t,set({value:r,replace:o,scroll:s,state:i}){o?window.history.replaceState(Yf(i),"",r):window.history.pushState(i,"",r),wh(decodeURIComponent(window.location.hash.slice(1)),s),si()},init:r=>vh(window,"popstate",Qf(r,o=>{if(o&&o<0)return!n.confirm(o);{const s=t();return!n.confirm(s.value,{state:s.state})}})),create:Sh(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const vs=Symbol("store-raw"),En=Symbol("store-node"),Rt=Symbol("store-has"),Nu=Symbol("store-self");function Ku(e){let t=e[ot];if(!t&&(Object.defineProperty(e,ot,{value:t=new Proxy(e,Rh)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,s=n.length;o<s;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function Ht(e){let t;return e!=null&&typeof e=="object"&&(e[ot]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function fn(e,t=new Set){let n,r,o,s;if(n=e!=null&&e[vs])return n;if(!Ht(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,a=e.length;i<a;i++)o=e[i],(r=fn(o,t))!==o&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,u=i.length;l<u;l++)s=i[l],!a[s].get&&(o=e[s],(r=fn(o,t))!==o&&(e[s]=r))}return e}function Jr(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,o]=j(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Ch(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===ot||t===En||(delete n.value,delete n.writable,n.get=()=>e[ot][t]),n}function ju(e){fs()&&gr(Jr(e,En),Nu)()}function Eh(e){return ju(e),Reflect.ownKeys(e)}const Rh={get(e,t,n){if(t===vs)return e;if(t===ot)return n;if(t===ds)return ju(e),n;const r=Jr(e,En),o=r[t];let s=o?o():e[t];if(t===En||t===Rt||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t);fs()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=gr(r,t,s)())}return Ht(s)?Ku(s):s},has(e,t){return t===vs||t===ot||t===ds||t===En||t===Rt||t==="__proto__"?!0:(fs()&&gr(Jr(e,Rt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Eh,getOwnPropertyDescriptor:Ch};function Ye(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],s=e.length;n===void 0?(delete e[t],e[Rt]&&e[Rt][t]&&o!==void 0&&e[Rt][t].$()):(e[t]=n,e[Rt]&&e[Rt][t]&&o===void 0&&e[Rt][t].$());let i=Jr(e,En),a;if((a=gr(i,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let l=e.length;l<s;l++)(a=i[l])&&a.$();(a=gr(i,"length",s))&&a.$(e.length)}(a=i[Nu])&&a.$()}function Bu(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Ye(e,o,t[o])}}function Ph(e,t){if(typeof t=="function"&&(t=t(e)),t=fn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&Ye(e,n,o)}Ye(e,"length",r)}else Bu(e,t)}function sr(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)sr(e,[r[l]].concat(t),n);return}else if(a&&i==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&sr(e,[l].concat(t),n);return}else if(a&&i==="object"){const{from:l=0,to:u=e.length-1,by:c=1}=r;for(let d=l;d<=u;d+=c)sr(e,[d].concat(t),n);return}else if(t.length>1){sr(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let s=t[0];typeof s=="function"&&(s=s(o,n),s===o)||r===void 0&&s==null||(s=fn(s),r===void 0||Ht(o)&&Ht(s)&&!Array.isArray(s)?Bu(o,s):Ye(e,r,s))}function lo(...[e,t]){const n=fn(e||{}),r=Array.isArray(n),o=Ku(n);function s(...i){so(()=>{r&&i.length===1?Ph(n,i[0]):sr(n,i)})}return[o,s]}const ws=Symbol("store-root");function Sn(e,t,n,r,o){const s=t[n];if(e===s)return;const i=Array.isArray(e);if(n!==ws&&(!Ht(e)||!Ht(s)||i!==Array.isArray(s)||o&&e[o]!==s[o])){Ye(t,n,e);return}if(i){if(e.length&&s.length&&(!r||o&&e[0]&&e[0][o]!=null)){let u,c,d,f,h,g,p,m;for(d=0,f=Math.min(s.length,e.length);d<f&&(s[d]===e[d]||o&&s[d]&&e[d]&&s[d][o]===e[d][o]);d++)Sn(e[d],s,d,r,o);const w=new Array(e.length),y=new Map;for(f=s.length-1,h=e.length-1;f>=d&&h>=d&&(s[f]===e[h]||o&&s[d]&&e[d]&&s[f][o]===e[h][o]);f--,h--)w[h]=s[f];if(d>h||d>f){for(c=d;c<=h;c++)Ye(s,c,e[c]);for(;c<e.length;c++)Ye(s,c,w[c]),Sn(e[c],s,c,r,o);s.length>e.length&&Ye(s,"length",e.length);return}for(p=new Array(h+1),c=h;c>=d;c--)g=e[c],m=o&&g?g[o]:g,u=y.get(m),p[c]=u===void 0?-1:u,y.set(m,c);for(u=d;u<=f;u++)g=s[u],m=o&&g?g[o]:g,c=y.get(m),c!==void 0&&c!==-1&&(w[c]=s[u],c=p[c],y.set(m,c));for(c=d;c<e.length;c++)c in w?(Ye(s,c,w[c]),Sn(e[c],s,c,r,o)):Ye(s,c,e[c])}else for(let u=0,c=e.length;u<c;u++)Sn(e[u],s,u,r,o);s.length>e.length&&Ye(s,"length",e.length);return}const a=Object.keys(e);for(let u=0,c=a.length;u<c;u++)Sn(e[a[u]],s,a[u],r,o);const l=Object.keys(s);for(let u=0,c=l.length;u<c;u++)e[l[u]]===void 0&&Ye(s,l[u],void 0)}function zu(e,t={}){const{merge:n,key:r="id"}=t,o=fn(e);return s=>{if(!Ht(s)||!Ht(o))return o;const i=Sn(o,{[ws]:s},ws,n,r);return i===void 0?s:i}}const Gu="/assets/logo-BYNFyja1.png";var Ih=pe('<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 Mh({children:e}){return(()=>{var t=Ih(),n=t.firstChild,r=n.firstChild;return dn(r,"src",Gu),he(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(){}},jn=typeof window>"u"||"Deno"in globalThis;function Qe(){}function Ah(e,t){return typeof e=="function"?e(t):e}function bs(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Rn(e,t){return typeof e=="function"?e(t):e}function nt(e,t){return typeof e=="function"?e(t):e}function $a(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==ii(i,t.options))return!1}else if(!mr(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Oa(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(pr(t.options.mutationKey)!==pr(s))return!1}else if(!mr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ii(e,t){return((t==null?void 0:t.queryKeyHashFn)||pr)(e)}function pr(e){return JSON.stringify(e,(t,n)=>xs(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],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 Uu(e,t){if(e===t)return e;const n=Ta(e)&&Ta(t);if(n||xs(e)&&xs(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let u=0;u<i;u++){const c=n?u:s[u];(!n&&r.includes(c)||n)&&e[c]===void 0&&t[c]===void 0?(a[c]=void 0,l++):(a[c]=Uu(e[c],t[c]),a[c]===e[c]&&e[c]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function Ss(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 Ta(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xs(e){if(!Da(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Da(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Da(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fh(e){return new Promise(t=>{setTimeout(t,e)})}function Cs(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Uu(e,t):t}function $h(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Oh(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ai=Symbol();function qu(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ai?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var en,_t,Mn,au,Th=(au=class extends Ir{constructor(){super();J(this,en);J(this,_t);J(this,Mn);q(this,Mn,t=>{if(!jn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}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(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,en)!==t&&(q(this,en,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,en)=="boolean"?E(this,en):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},en=new WeakMap,_t=new WeakMap,Mn=new WeakMap,au),li=new Th,An,kt,Fn,lu,Dh=(lu=class extends Ir{constructor(){super();J(this,An,!0);J(this,kt);J(this,Fn);q(this,Fn,t=>{if(!jn&&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,kt)||this.setEventListener(E(this,Fn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,kt))==null||t.call(this),q(this,kt,void 0))}setEventListener(t){var n;q(this,Fn,t),(n=E(this,kt))==null||n.call(this),q(this,kt,t(this.setOnline.bind(this)))}setOnline(t){E(this,An)!==t&&(q(this,An,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return E(this,An)}},An=new WeakMap,kt=new WeakMap,Fn=new WeakMap,lu),eo=new Dh;function Es(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Lh(e){return Math.min(1e3*2**e,3e4)}function Wu(e){return(e??"online")==="online"?eo.isOnline():!0}var Xu=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $o(e){return e instanceof Xu}function Yu(e){let t=!1,n=0,r=!1,o;const s=Es(),i=p=>{var m;r||(f(new Xu(p)),(m=e.abort)==null||m.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>li.isFocused()&&(e.networkMode==="always"||eo.isOnline())&&e.canRun(),c=()=>Wu(e.networkMode)&&e.canRun(),d=p=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,p),o==null||o(),s.resolve(p))},f=p=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,p),o==null||o(),s.reject(p))},h=()=>new Promise(p=>{var m;o=w=>{(r||u())&&p(w)},(m=e.onPause)==null||m.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),g=()=>{if(r)return;let p;const m=n===0?e.initialPromise:void 0;try{p=m??e.fn()}catch(w){p=Promise.reject(w)}Promise.resolve(p).then(d).catch(w=>{var O;if(r)return;const y=e.retry??(jn?0:3),v=e.retryDelay??Lh,x=typeof v=="function"?v(n,w):v,C=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,w);if(t||!C){f(w);return}n++,(O=e.onFail)==null||O.call(e,n,w),Fh(x).then(()=>u()?void 0:h()).then(()=>{t?f(w):g()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?g():h().then(g),s)}}function _h(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Le=_h(),tn,uu,Qu=(uu=class{constructor(){J(this,tn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),bs(this.gcTime)&&q(this,tn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(jn?1/0:5*60*1e3))}clearGcTimeout(){E(this,tn)&&(clearTimeout(E(this,tn)),q(this,tn,void 0))}},tn=new WeakMap,uu),$n,On,Xe,nn,Oe,Cr,rn,et,Ct,cu,kh=(cu=class extends Qu{constructor(t){super();J(this,et);J(this,$n);J(this,On);J(this,Xe);J(this,nn);J(this,Oe);J(this,Cr);J(this,rn);q(this,rn,!1),q(this,Cr,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,nn,t.client),q(this,Xe,E(this,nn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,$n,Vh(this.options)),this.state=t.state??E(this,$n),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=Cs(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,o;const n=(r=E(this,Oe))==null?void 0:r.promise;return(o=E(this,Oe))==null||o.cancel(t),n?n.then(Qe).catch(Qe):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,$n))}isActive(){return this.observers.some(t=>nt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ai||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||!Hu(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,rn)?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 l,u,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,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(q(this,rn,!0),r.signal)})},s=()=>{const d=qu(this.options,n),f={client:E(this,nn),queryKey:this.queryKey,meta:this.meta};return o(f),q(this,rn,!1),this.options.persister?this.options.persister(d,f,this):d(f)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,nn),state:this.state,fetchFn:s};o(i),(l=this.options.behavior)==null||l.onFetch(i,this),q(this,On,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ue(this,et,Ct).call(this,{type:"fetch",meta:(c=i.fetchOptions)==null?void 0:c.meta});const a=d=>{var f,h,g,p;$o(d)&&d.silent||ue(this,et,Ct).call(this,{type:"error",error:d}),$o(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,Yu({initialPromise:n==null?void 0:n.initialPromise,fn:i.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(m){a(m);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:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),E(this,Oe).start()}},$n=new WeakMap,On=new WeakMap,Xe=new WeakMap,nn=new WeakMap,Oe=new WeakMap,Cr=new WeakMap,rn=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,...Zu(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 o=t.error;return $o(o)&&o.revert&&E(this,On)?{...E(this,On),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,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})})},cu);function Zu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Vh(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,du,Nh=(du=class extends Ir{constructor(t={}){super();J(this,ct);this.config=t,q(this,ct,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??ii(o,n);let i=this.get(s);return i||(i=new kh({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}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=>$a(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$a(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,du),dt,Ve,on,ft,Lt,fu,Kh=(fu=class extends Qu{constructor(t){super();J(this,ft);J(this,dt);J(this,Ve);J(this,on);this.mutationId=t.mutationId,q(this,Ve,t.mutationCache),q(this,dt,[]),this.state=t.state||jh(),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,on))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,a,l,u,c,d,f,h,g,p,m,w,y,v,x,C,O,L;q(this,on,Yu({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,T)=>{ue(this,ft,Lt).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{ue(this,ft,Lt).call(this,{type:"pause"})},onContinue:()=>{ue(this,ft,Lt).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,on).canStart();try{if(!n){ue(this,ft,Lt).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=E(this,Ve).config).onMutate)==null?void 0:s.call(o,t,this));const T=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));T!==this.state.context&&ue(this,ft,Lt).call(this,{type:"pending",context:T,variables:t,isPaused:r})}const _=await E(this,on).start();return await((u=(l=E(this,Ve).config).onSuccess)==null?void 0:u.call(l,_,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,Lt).call(this,{type:"success",data:_}),_}catch(_){try{throw await((w=(m=E(this,Ve).config).onError)==null?void 0:w.call(m,_,t,this.state.context,this)),await((v=(y=this.options).onError)==null?void 0:v.call(y,_,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,Lt).call(this,{type:"error",error:_})}}finally{E(this,Ve).runNext(this)}}},dt=new WeakMap,Ve=new WeakMap,on=new WeakMap,ft=new WeakSet,Lt=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})})},fu);function jh(){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,hu,Bh=(hu=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 o=new Kh({mutationCache:this,mutationId:++Tr(this,Er)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){E(this,It).add(t);const n=Lr(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=Lr(t);if(typeof n=="string"){const r=E(this,tt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&E(this,tt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Lr(t);if(typeof n=="string"){const r=E(this,tt).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Lr(t);if(typeof n=="string"){const o=(r=E(this,tt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.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=>Oa(n,r))}findAll(t={}){return this.getAll().filter(n=>Oa(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(Qe))))}},It=new WeakMap,tt=new WeakMap,Er=new WeakMap,hu);function Lr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function La(e){return{onFetch:(t,n)=>{var c,d,f,h,g;const r=t.options,o=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],i=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const m=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},w=qu(t.options,t.fetchOptions),y=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};m(O);const L=await w(O),{maxPages:_}=t.options,T=C?Oh:$h;return{pages:T(v.pages,L,_),pageParams:T(v.pageParams,x,_)}};if(o&&s.length){const v=o==="backward",x=v?zh:_a,C={pages:s,pageParams:i},O=x(r,C);a=await y(C,O,v)}else{const v=e??s.length;do{const x=l===0?i[0]??r.initialPageParam:_a(r,a);if(l>0&&x==null)break;a=await y(a,x),l++}while(l<v)}return a};t.options.persister?t.fetchFn=()=>{var p,m;return(m=(p=t.options).persister)==null?void 0:m.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function _a(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 zh(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 Ce,Vt,Nt,Tn,Dn,Kt,Ln,_n,gu,Gh=(gu=class{constructor(t={}){J(this,Ce);J(this,Vt);J(this,Nt);J(this,Tn);J(this,Dn);J(this,Kt);J(this,Ln);J(this,_n);q(this,Ce,t.queryCache||new Nh),q(this,Vt,t.mutationCache||new Bh),q(this,Nt,t.defaultOptions||{}),q(this,Tn,new Map),q(this,Dn,new Map),q(this,Kt,0)}mount(){Tr(this,Kt)._++,E(this,Kt)===1&&(q(this,Ln,li.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,Ce).onFocus())})),q(this,_n,eo.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,Ce).onOnline())})))}unmount(){var t,n;Tr(this,Kt)._--,E(this,Kt)===0&&((t=E(this,Ln))==null||t.call(this),q(this,Ln,void 0),(n=E(this,_n))==null||n.call(this),q(this,_n,void 0))}isFetching(t){return E(this,Ce).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return E(this,Vt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,Ce).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=E(this,Ce).build(this,n),o=r.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Rn(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(t){return E(this,Ce).findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.defaultQueryOptions({queryKey:t}),s=E(this,Ce).get(o.queryHash),i=s==null?void 0:s.state.data,a=Ah(n,i);if(a!==void 0)return E(this,Ce).build(this,o).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Le.batch(()=>E(this,Ce).findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,Ce).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=E(this,Ce);Le.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=E(this,Ce),o={type:"active",...t};return Le.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries(o,n)))}cancelQueries(t,n={}){const r={revert:!0,...n},o=Le.batch(()=>E(this,Ce).findAll(t).map(s=>s.cancel(r)));return Promise.all(o).then(Qe).catch(Qe)}invalidateQueries(t,n={}){return Le.batch(()=>{if(E(this,Ce).findAll(t).forEach(o=>{o.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},o=Le.batch(()=>E(this,Ce).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Qe)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(o).then(Qe)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=E(this,Ce).build(this,n);return r.isStaleByTime(Rn(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Qe).catch(Qe)}fetchInfiniteQuery(t){return t.behavior=La(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Qe).catch(Qe)}ensureInfiniteQueryData(t){return t.behavior=La(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return eo.isOnline()?E(this,Vt).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Ce)}getMutationCache(){return E(this,Vt)}getDefaultOptions(){return E(this,Nt)}setDefaultOptions(t){q(this,Nt,t)}setQueryDefaults(t,n){E(this,Tn).set(pr(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...E(this,Tn).values()],r={};return n.forEach(o=>{mr(t,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(t,n){E(this,Dn).set(pr(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...E(this,Dn).values()];let r={};return n.forEach(o=>{mr(t,o.mutationKey)&&(r={...r,...o.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...E(this,Nt).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=ii(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===ai&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...E(this,Nt).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){E(this,Ce).clear(),E(this,Vt).clear()}},Ce=new WeakMap,Vt=new WeakMap,Nt=new WeakMap,Tn=new WeakMap,Dn=new WeakMap,Kt=new WeakMap,Ln=new WeakMap,_n=new WeakMap,gu),Ke,ce,Rr,Ne,sn,kn,jt,ht,Pr,Vn,Nn,an,ln,Bt,Kn,me,ir,Rs,Ps,Is,Ms,As,Fs,$s,Ju,pu,Hh=(pu=class extends Ir{constructor(t,n){super();J(this,me);J(this,Ke);J(this,ce);J(this,Rr);J(this,Ne);J(this,sn);J(this,kn);J(this,jt);J(this,ht);J(this,Pr);J(this,Vn);J(this,Nn);J(this,an);J(this,ln);J(this,Bt);J(this,Kn,new Set);this.options=n,q(this,Ke,t),q(this,ht,null),q(this,jt,Es()),this.options.experimental_prefetchInRender||E(this,jt).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),ka(E(this,ce),this.options)?ue(this,me,ir).call(this):this.updateResult(),ue(this,me,Ms).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Os(E(this,ce),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Os(E(this,ce),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,me,As).call(this),ue(this,me,Fs).call(this),E(this,ce).removeObserver(this)}setOptions(t,n){const r=this.options,o=E(this,ce);if(this.options=E(this,Ke).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof nt(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,me,$s).call(this),E(this,ce).setOptions(this.options),r._defaulted&&!Ss(this.options,r)&&E(this,Ke).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,ce),observer:this});const s=this.hasListeners();s&&Va(E(this,ce),o,this.options,r)&&ue(this,me,ir).call(this),this.updateResult(n),s&&(E(this,ce)!==o||nt(this.options.enabled,E(this,ce))!==nt(r.enabled,E(this,ce))||Rn(this.options.staleTime,E(this,ce))!==Rn(r.staleTime,E(this,ce)))&&ue(this,me,Rs).call(this);const i=ue(this,me,Ps).call(this);s&&(E(this,ce)!==o||nt(this.options.enabled,E(this,ce))!==nt(r.enabled,E(this,ce))||i!==E(this,Bt))&&ue(this,me,Is).call(this,i)}getOptimisticResult(t){const n=E(this,Ke).getQueryCache().build(E(this,Ke),t),r=this.createResult(n,t);return qh(this,r)&&(q(this,Ne,r),q(this,kn,this.options),q(this,sn,E(this,ce).state)),r}getCurrentResult(){return E(this,Ne)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){E(this,Kn).add(t)}getCurrentQuery(){return E(this,ce)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,Ke).defaultQueryOptions(t),r=E(this,Ke).getQueryCache().build(E(this,Ke),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,me,ir).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Ne)))}createResult(t,n){var _;const r=E(this,ce),o=this.options,s=E(this,Ne),i=E(this,sn),a=E(this,kn),u=t!==r?t.state:E(this,Rr),{state:c}=t;let d={...c},f=!1,h;if(n._optimisticResults){const T=this.hasListeners(),k=!T&&ka(t,n),V=T&&Va(t,r,n,o);(k||V)&&(d={...d,...Zu(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:m}=d;if(n.select&&d.data!==void 0)if(s&&d.data===(i==null?void 0:i.data)&&n.select===E(this,Pr))h=E(this,Vn);else try{q(this,Pr,n.select),h=n.select(d.data),h=Cs(s==null?void 0:s.data,h,n),q(this,Vn,h),q(this,ht,null)}catch(T){q(this,ht,T)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&m==="pending"){let T;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=s.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((_=E(this,Nn))==null?void 0:_.state.data,E(this,Nn)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),q(this,ht,null)}catch(k){q(this,ht,k)}T!==void 0&&(m="success",h=Cs(s==null?void 0:s.data,T,n),f=!0)}E(this,ht)&&(g=E(this,ht),h=E(this,Vn),p=Date.now(),m="error");const w=d.fetchStatus==="fetching",y=m==="pending",v=m==="error",x=y&&w,C=h!==void 0,L={status:m,fetchStatus:d.fetchStatus,isPending:y,isSuccess:m==="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>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!y,isLoadingError:v&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:v&&C,isStale:ui(t,n),refetch:this.refetch,promise:E(this,jt)};if(this.options.experimental_prefetchInRender){const T=z=>{L.status==="error"?z.reject(L.error):L.data!==void 0&&z.resolve(L.data)},k=()=>{const z=q(this,jt,L.promise=Es());T(z)},V=E(this,jt);switch(V.status){case"pending":t.queryHash===r.queryHash&&T(V);break;case"fulfilled":(L.status==="error"||L.data!==V.value)&&k();break;case"rejected":(L.status!=="error"||L.error!==V.reason)&&k();break}}return L}updateResult(t){const n=E(this,Ne),r=this.createResult(E(this,ce),this.options);if(q(this,sn,E(this,ce).state),q(this,kn,this.options),E(this,sn).data!==void 0&&q(this,Nn,E(this,ce)),Ss(r,n))return;q(this,Ne,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!E(this,Kn).size)return!0;const l=new Set(a??E(this,Kn));return this.options.throwOnError&&l.add("error"),Object.keys(E(this,Ne)).some(u=>{const c=u;return E(this,Ne)[c]!==n[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),ue(this,me,Ju).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,me,Ms).call(this)}},Ke=new WeakMap,ce=new WeakMap,Rr=new WeakMap,Ne=new WeakMap,sn=new WeakMap,kn=new WeakMap,jt=new WeakMap,ht=new WeakMap,Pr=new WeakMap,Vn=new WeakMap,Nn=new WeakMap,an=new WeakMap,ln=new WeakMap,Bt=new WeakMap,Kn=new WeakMap,me=new WeakSet,ir=function(t){ue(this,me,$s).call(this);let n=E(this,ce).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Qe)),n},Rs=function(){ue(this,me,As).call(this);const t=Rn(this.options.staleTime,E(this,ce));if(jn||E(this,Ne).isStale||!bs(t))return;const r=Hu(E(this,Ne).dataUpdatedAt,t)+1;q(this,an,setTimeout(()=>{E(this,Ne).isStale||this.updateResult()},r))},Ps=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,ce)):this.options.refetchInterval)??!1},Is=function(t){ue(this,me,Fs).call(this),q(this,Bt,t),!(jn||nt(this.options.enabled,E(this,ce))===!1||!bs(E(this,Bt))||E(this,Bt)===0)&&q(this,ln,setInterval(()=>{(this.options.refetchIntervalInBackground||li.isFocused())&&ue(this,me,ir).call(this)},E(this,Bt)))},Ms=function(){ue(this,me,Rs).call(this),ue(this,me,Is).call(this,ue(this,me,Ps).call(this))},As=function(){E(this,an)&&(clearTimeout(E(this,an)),q(this,an,void 0))},Fs=function(){E(this,ln)&&(clearInterval(E(this,ln)),q(this,ln,void 0))},$s=function(){const t=E(this,Ke).getQueryCache().build(E(this,Ke),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))},Ju=function(t){Le.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(E(this,Ne))}),E(this,Ke).getQueryCache().notify({query:E(this,ce),type:"observerResultsUpdated"})})},pu);function Uh(e,t){return nt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ka(e,t){return Uh(e,t)||e.state.data!==void 0&&Os(e,t,t.refetchOnMount)}function Os(e,t,n){if(nt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ui(e,t)}return!1}function Va(e,t,n,r){return(e!==t||nt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ui(e,n)}function ui(e,t){return nt(t.enabled,e)!==!1&&e.isStaleByTime(Rn(t.staleTime,e))}function qh(e,t){return!Ss(e.getCurrentResult(),t)}function Wh(e){return e}function Xh(e,t,n){var l;if(typeof t!="object"||t===null)return;const r=e.getMutationCache(),o=e.getQueryCache(),s=((l=e.getDefaultOptions().hydrate)==null?void 0:l.deserializeData)??Wh,i=t.mutations||[],a=t.queries||[];i.forEach(({state:u,...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},u)}),a.forEach(({queryKey:u,state:c,queryHash:d,meta:f,promise:h})=>{var m,w;let g=o.get(d);const p=c.data===void 0?c.data:s(c.data);if(g){if(g.state.dataUpdatedAt<c.dataUpdatedAt){const{fetchStatus:y,...v}=c;g.setState({...v,data:p})}}else g=o.build(e,{...(m=e.getDefaultOptions().hydrate)==null?void 0:m.queries,...(w=n==null?void 0:n.defaultOptions)==null?void 0:w.queries,queryKey:u,queryHash:d,meta:f},{...c,data:p,fetchStatus:"idle"});if(h){const y=Promise.resolve(h).then(s);g.fetch(void 0,{initialPromise:y})}})}var Yh=class extends Gh{constructor(e={}){super(e)}},ec=be(void 0),tc=e=>{const t=ye(ec);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},Qh=e=>(Be(t=>(t==null||t(),e.client.mount(),e.client.unmount.bind(e.client))),W(()=>e.client.unmount()),S(ec.Provider,{value:()=>e.client,get children(){return e.children}}));function Zh(e,t){return typeof e=="function"?e(...t):!!e}var nc=be(()=>!1),Jh=()=>ye(nc);nc.Provider;function eg(e,t,n,r){if(n===!1)return t;if(typeof n=="function"){const i=n(e.data,t.data);return{...t,data:i}}let o=t.data;if(e.data===void 0)try{o=structuredClone(o)}catch{}const s=zu(o,{key:n})(e.data);return{...t,data:s}}var tg=(e,t)=>t;function ng(e,t,n){const r=K(()=>tc()),o=Jh(),s=K(()=>{const x=r().defaultQueryOptions(e());return x._optimisticResults=o()?"isRestoring":"optimistic",x.structuralSharing=!1,x}),i=s(),[a,l]=j(new t(r(),s()));let u=a().getOptimisticResult(s());const[c,d]=lo(u),f=()=>a().subscribe(C=>{u=C,queueMicrotask(()=>{p&&y()})});function h(x){const C=a().options,O=C.reconcile;d(L=>eg(L,x,O===void 0?!1:O,C.queryHash))}function g(){return[()=>c,x=>{const C=fn(c);if(typeof x=="function"&&(x=x(C)),x!=null&&x.hydrationData){const{hydrationData:O,...L}=x;x=L}h(x)}]}let p=null,m=null;const[w,{refetch:y}]=af(()=>{const x=a();return new Promise((C,O)=>{if(m=C,!p&&!o()&&(p=f()),x.updateResult(),u.isError&&!u.isFetching&&!o()&&Zh(x.options.throwOnError,[u.error,x.getCurrentQuery()]))return h(u),O(u.error);if(!u.isLoading)return m=null,C(tg(x.getCurrentQuery(),u));h(u)})},{storage:g,get deferStream(){return e().deferStream},onHydrated(x,C){if(C.value&&"hydrationData"in C.value&&Xh(r(),{queries:[{...C.value.hydrationData}]}),p)return;const O={...i};(i.staleTime||!i.initialData)&&C.value&&(O.refetchOnMount=!1),a().setOptions(O),h(a().getOptimisticResult(O)),p=f()}});At(Ee(r,x=>{p&&p();const C=new t(x,s());p=f(),l(C)},{defer:!0})),At(Ee(o,x=>{x||y()},{defer:!0})),W(()=>{p&&(p(),p=null),m&&(m(u),m=null)}),At(Ee([a,s],([x,C])=>{x.setOptions(C),h(x.getOptimisticResult(C)),y()},{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 ci(e,t){return ng(K(()=>e()),Hh)}var rg=pe('<div class="fixed inset-0 flex items-center justify-center bg-white"><div class="w-32 h-32 md:w-48 md:h-48 relative"><img alt="Hot Updater Console"class="w-full h-full object-contain">');const og=()=>(()=>{var e=rg(),t=e.firstChild,n=t.firstChild;return dn(n,"src",Gu),e})();function sg(e){return(...t)=>{for(const n of e)n&&n(...t)}}var $=e=>typeof e=="function"&&!e.length?e():e,Na=e=>Array.isArray(e)?e:e?[e]:[];function ig(e,...t){return typeof e=="function"?e(...t):e}var ag=W;function lg(e,t,n,r){return e.addEventListener(t,n,r),ag(e.removeEventListener.bind(e,t,n,r))}function ug(e,t,n,r){const o=()=>{Na($(e)).forEach(s=>{s&&Na($(t)).forEach(i=>lg(s,i,n,r))})};typeof e=="function"?U(o):Be(o)}var cg=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Ka(e){const t={};let n;for(;n=cg.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=Ka(e)}else typeof t=="string"&&(t=Ka(t));return{...e,...t}}function ve(...e){return sg(e)}function dg(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Ts(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fg(e){return typeof e=="number"}function xn(e){return Object.prototype.toString.call(e)==="[object String]"}function di(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(oc(n)&&n.contentDocument)return ar(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ze(n).getElementById(r);if(o)return o}}return n}function rc(e){return Ze(e).defaultView||window}function Ze(e){return e?e.ownerDocument||e:document}function oc(e){return e.tagName==="IFRAME"}var fi=(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))(fi||{});function hi(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 uo(){return hi(/^Mac/i)}function hg(){return hi(/^iPhone/i)}function gg(){return hi(/^iPad/i)||uo()&&navigator.maxTouchPoints>1}function pg(){return hg()||gg()}function mg(){return uo()||pg()}function oe(e,t){return t&&(di(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function Se(e){return t=>{for(const n of e)oe(t,n)}}function yg(e){return uo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ie(e){if(e)if(vg())e.focus({preventScroll:!0});else{const t=wg(e);e.focus(),bg(t)}}var _r=null;function vg(){if(_r==null){_r=!1;try{document.createElement("div").focus({get preventScroll(){return _r=!0,!0}})}catch{}}return _r}function wg(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 bg(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var sc=["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'])"],Sg=[...sc,'[tabindex]:not([tabindex="-1"]):not([disabled])'],gi=`${sc.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,xg=Sg.join(':not([hidden]):not([tabindex="-1"]),');function ic(e,t){const r=Array.from(e.querySelectorAll(gi)).filter(ja);return t&&ja(e)&&r.unshift(e),r.forEach((o,s)=>{if(oc(o)&&o.contentDocument){const i=o.contentDocument.body,a=ic(i,!1);r.splice(s,1,...a)}}),r}function ja(e){return ac(e)&&!Cg(e)}function ac(e){return e.matches(gi)&&pi(e)}function Cg(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function pi(e,t){return e.nodeName!=="#comment"&&Eg(e)&&Rg(e,t)&&(!e.parentElement||pi(e.parentElement,e))}function Eg(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:o}=e.ownerDocument.defaultView,{display:s,visibility:i}=o(e);r=s!=="none"&&i!=="hidden"&&i!=="collapse"}return r}function Rg(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Pg(e,t,n){const r=t!=null&&t.tabbable?xg:gi,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){var i;return(i=t==null?void 0:t.from)!=null&&i.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&pi(s)&&(!(t!=null&&t.accept)||t.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(o.currentNode=t.from),o}function Ba(e){let t=e;for(;t&&!Ig(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Ig(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Mg(){}function Ag(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=s,a=0,l=i-1;a<i;l=a++){const[u,c]=t[a],[d,f]=t[l],[,h]=t[l===0?i-1:l-1]||[0,0],g=(c-f)*(n-u)-(u-d)*(r-c);if(f<c){if(r>=f&&r<c){if(g===0)return!0;g>0&&(r===f?r>h&&(o=!o):o=!o)}}else if(c<f){if(r>c&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(o=!o):o=!o)}}else if(r===c&&(n>=d&&n<=u||n>=u&&n<=d))return!0}return o}function Z(e,t){return F(e,t)}var Zn=new Map,za=new Set;function Ga(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Zn.get(n.target);r||(r=new Set,Zn.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Zn.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Zn.delete(n.target)),Zn.size===0)){for(const o of za)o();za.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Ga():document.addEventListener("DOMContentLoaded",Ga));function Ds(e,t){const n=Ha(e,t,"left"),r=Ha(e,t,"top"),o=t.offsetWidth,s=t.offsetHeight;let i=e.scrollLeft,a=e.scrollTop;const l=i+e.offsetWidth,u=a+e.offsetHeight;n<=i?i=n:n+o>l&&(i+=n+o-l),r<=a?a=r:r+s>u&&(a+=r+s-u),e.scrollLeft=i,e.scrollTop=a}function Ha(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function Fg(e,t){var n,r;if(document.contains(e)){const o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let i=Ba(e);for(;e&&i&&e!==o&&i!==o;)Ds(i,e),e=i,i=Ba(e)}else{const{left:i,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:u}=e.getBoundingClientRect();(Math.abs(i-l)>1||Math.abs(a-u)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var lc={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",uc,Ls=!1,Ft=[];function vr(e){return Ft.findIndex(t=>t.node===e)}function $g(e){return Ft[vr(e)]}function Og(e){return Ft[Ft.length-1].node===e}function cc(){return Ft.filter(e=>e.isPointerBlocking)}function Tg(){return[...cc()].slice(-1)[0]}function mi(){return cc().length>0}function dc(e){var n;const t=vr((n=Tg())==null?void 0:n.node);return vr(e)<t}function Dg(e){Ft.push(e)}function Lg(e){const t=vr(e);t<0||Ft.splice(t,1)}function _g(){for(const{node:e}of Ft)e.style.pointerEvents=dc(e)?"none":"auto"}function kg(e){if(mi()&&!Ls){const t=Ze(e);uc=document.body.style.pointerEvents,t.body.style.pointerEvents="none",Ls=!0}}function Vg(e){if(mi())return;const t=Ze(e);t.body.style.pointerEvents=uc,t.body.style.length===0&&t.body.removeAttribute("style"),Ls=!1}var ze={layers:Ft,isTopMostLayer:Og,hasPointerBlockingLayer:mi,isBelowPointerBlockingLayer:dc,addLayer:Dg,removeLayer:Lg,indexOf:vr,find:$g,assignPointerEventToLayers:_g,disableBodyPointerEvents:kg,restoreBodyPointerEvents:Vg};function co(e,t){const[n,r]=j(Ua(t==null?void 0:t()));return U(()=>{var o;r(((o=e())==null?void 0:o.tagName.toLowerCase())||Ua(t==null?void 0:t()))}),n}function Ua(e){return xn(e)?e:void 0}function ae(e){const[t,n]=N(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return S(Iu,F(n,{get component(){return t.as}}))}var Ng=Object.defineProperty,Yt=(e,t)=>{for(var n in t)Ng(e,n,{get:t[n],enumerable:!0})},Kg={};Yt(Kg,{Button:()=>zg,Root:()=>wt});var jg=["button","color","file","image","reset","submit"];function Bg(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?jg.indexOf(e.type)!==-1:!1}function wt(e){let t;const n=Z({type:"button"},e),[r,o]=N(n,["ref","type","disabled"]),s=co(()=>t,()=>"button"),i=K(()=>{const u=s();return u==null?!1:Bg({tagName:u,type:r.type})}),a=K(()=>s()==="input"),l=K(()=>s()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return S(ae,F({as:"button",ref(u){var c=ve(d=>t=d,r.ref);typeof c=="function"&&c(u)},get type(){return i()||a()?r.type:void 0},get role(){return!i()&&!l()?"button":void 0},get tabIndex(){return!i()&&!l()&&!r.disabled?0:void 0},get disabled(){return i()||a()?r.disabled:void 0},get"aria-disabled"(){return!i()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var zg=wt;function je(e){return t=>(e(t),()=>e(void 0))}var Te=e=>typeof e=="function"?e():e,Gg=e=>{const t=K(()=>{const i=Te(e.element);if(i)return getComputedStyle(i)}),n=()=>{var i;return((i=t())==null?void 0:i.animationName)??"none"},[r,o]=j(Te(e.show)?"present":"hidden");let s="none";return U(i=>{const a=Te(e.show);return Ae(()=>{var c;if(i===a)return a;const l=s,u=n();a?o("present"):u==="none"||((c=t())==null?void 0:c.display)==="none"?o("hidden"):o(i===!0&&l!==u?"hiding":"hidden")}),a}),U(()=>{const i=Te(e.element);if(!i)return;const a=u=>{u.target===i&&(s=n())},l=u=>{const d=n().includes(u.animationName);u.target===i&&d&&r()==="hiding"&&o("hidden")};i.addEventListener("animationstart",a),i.addEventListener("animationcancel",l),i.addEventListener("animationend",l),W(()=>{i.removeEventListener("animationstart",a),i.removeEventListener("animationcancel",l),i.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},Hg=Gg,wr=Hg,Ug={};Yt(Ug,{CloseButton:()=>hc,Description:()=>gc,List:()=>vi,ProgressFill:()=>mc,ProgressTrack:()=>yc,Region:()=>bi,Root:()=>vc,Title:()=>wc,Toast:()=>up,toaster:()=>Sc});var fc=be();function fo(){const e=ye(fc);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function hc(e){const t=fo(),[n,r]=N(e,["aria-label","onClick"]);return S(wt,F({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:s=>{oe(s,n.onClick),t.close()}},r))}function gc(e){const t=fo(),n=Z({id:t.generateId("description")},e),[r,o]=N(n,["id"]);return U(()=>W(t.registerDescriptionId(r.id))),S(ae,F({as:"div",get id(){return r.id}},o))}var pc=be();function yi(){const e=ye(pc);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function vi(e){let t;const n=yi(),[r,o]=N(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),s=u=>{oe(u,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},i=u=>{oe(u,r.onFocusOut),_e(t,u.relatedTarget)||n.resumeAllTimer()},a=u=>{oe(u,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},l=u=>{oe(u,r.onPointerLeave),_e(t,Ze(t).activeElement)||n.resumeAllTimer()};return U(Ee([()=>t,()=>n.hotkey()],([u,c])=>{if(!u)return;const d=Ze(u),f=h=>{c.every(p=>h[p]||h.code===p)&&Ie(u)};d.addEventListener("keydown",f),W(()=>d.removeEventListener("keydown",f))})),U(()=>{if(!n.pauseOnPageIdle())return;const u=rc(t);u.addEventListener("blur",n.pauseAllTimer),u.addEventListener("focus",n.resumeAllTimer),W(()=>{u.removeEventListener("blur",n.pauseAllTimer),u.removeEventListener("focus",n.resumeAllTimer)})}),S(ae,F({as:"ol",ref(u){var c=ve(d=>t=d,r.ref);typeof c=="function"&&c(u)},tabIndex:-1,onFocusIn:s,onFocusOut:i,onPointerMove:a,onPointerLeave:l},o,{get children(){return S(Mt,{get each(){return n.toasts()},children:u=>u.toastComponent({get toastId(){return u.id}})})}}))}function mc(e){const t=yi(),n=fo(),[r,o]=N(e,["style"]),[s,i]=j(100);let a=0;return U(()=>{if(t.isPaused()||n.isPersistent())return;const l=setInterval(()=>{const u=new Date().getTime()-n.closeTimerStartTime()+a,c=Math.trunc(100-u/n.duration()*100);i(c<0?0:c)});W(()=>{a+=new Date().getTime()-n.closeTimerStartTime(),clearInterval(l)})}),S(ae,F({as:"div",get style(){return yt({"--kb-toast-progress-fill-width":`${s()}%`},r.style)}},o))}function yc(e){return S(ae,F({as:"div","aria-hidden":"true",role:"presentation"},e))}var[wi,Mr]=lo({toasts:[]});function qg(e){Mr("toasts",t=>[...t,e])}function Wg(e){return wi.toasts.find(t=>t.id===e)}function Xg(e,t){const n=wi.toasts.findIndex(r=>r.id===e);n!==-1&&Mr("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function Yg(e){Mr("toasts",t=>t.id===e,"dismiss",!0)}function Qg(e){Mr("toasts",t=>t.filter(n=>n.id!==e))}function Zg(){Mr("toasts",[])}var hn={toasts:()=>wi.toasts,add:qg,get:Wg,update:Xg,dismiss:Yg,remove:Qg,clear:Zg},qa="{hotkey}",Jg={close:"Close"},ep={notifications:e=>`Notifications (${e})`};function bi(e){const t=Z({id:`toast-region-${Re()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:ep},e),[n,r]=N(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),o=K(()=>hn.toasts().filter(f=>f.region===n.regionId&&f.dismiss===!1).slice(0,n.limit)),[s,i]=j(!1),a=()=>o().length>0,l=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),u=()=>(n["aria-label"]||n.translations.notifications(qa)).replace(qa,l()),c=()=>({[yr]:n.topLayer?"":void 0}),d={isPaused:s,toasts:o,hotkey:()=>n.hotkey,duration:()=>n.duration,swipeDirection:()=>n.swipeDirection,swipeThreshold:()=>n.swipeThreshold,pauseOnInteraction:()=>n.pauseOnInteraction,pauseOnPageIdle:()=>n.pauseOnPageIdle,pauseAllTimer:()=>i(!0),resumeAllTimer:()=>i(!1),generateId:vt(()=>r.id)};return S(pc.Provider,{value:d,get children(){return S(ae,F({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return u()},get style(){return yt({"pointer-events":a()?n.topLayer?"auto":void 0:"none"},n.style)}},c,r))}})}var tp="toast.swipeStart",np="toast.swipeMove",rp="toast.swipeCancel",op="toast.swipeEnd";function vc(e){const t=yi(),n=Z({id:`toast-${Re()}`,priority:"high",translations:Jg},e),[r,o]=N(n,["ref","translations","toastId","style","priority","duration","persistent","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","onEscapeKeyDown","onKeyDown","onPointerDown","onPointerMove","onPointerUp"]),[s,i]=j(!0),[a,l]=j(),[u,c]=j(),[d,f]=j(!0),[h,g]=j(),{present:p}=wr({show:s,element:()=>h()??null}),m=K(()=>r.duration||t.duration());let w,y=0,v=m(),x=null,C=null;const O=()=>{i(!1),f(!0)},L=()=>{hn.remove(r.toastId)},_=b=>{!b||r.persistent||(window.clearTimeout(w),y=new Date().getTime(),w=window.setTimeout(O,b))},T=()=>{var b;_(v),(b=r.onResume)==null||b.call(r)},k=()=>{var I;const b=new Date().getTime()-y;v=v-b,window.clearTimeout(w),(I=r.onPause)==null||I.call(r)},V=b=>{var I;oe(b,r.onKeyDown),b.key==="Escape"&&((I=r.onEscapeKeyDown)==null||I.call(r,b),b.defaultPrevented||O())},z=b=>{oe(b,r.onPointerDown),b.button===0&&(x={x:b.clientX,y:b.clientY})},se=b=>{if(oe(b,r.onPointerMove),!x)return;const I=b.clientX-x.x,M=b.clientY-x.y,A=!!C,D=["left","right"].includes(t.swipeDirection()),B=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,H=D?B(0,I):0,X=D?0:B(0,M),le=b.pointerType==="touch"?10:2,ne={x:H,y:X},Fe={originalEvent:b,delta:ne};if(A){C=ne,kr(np,r.onSwipeMove,Fe);const{x:Je,y:te}=ne;b.currentTarget.setAttribute("data-swipe","move"),b.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${Je}px`),b.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${te}px`)}else Wa(ne,t.swipeDirection(),le)?(C=ne,kr(tp,r.onSwipeStart,Fe),b.currentTarget.setAttribute("data-swipe","start"),b.target.setPointerCapture(b.pointerId)):(Math.abs(I)>le||Math.abs(M)>le)&&(x=null)},P=b=>{oe(b,r.onPointerUp);const I=C,M=b.target;if(M.hasPointerCapture(b.pointerId)&&M.releasePointerCapture(b.pointerId),C=null,x=null,I){const A=b.currentTarget,D={originalEvent:b,delta:I};if(Wa(I,t.swipeDirection(),t.swipeThreshold())){kr(op,r.onSwipeEnd,D);const{x:B,y:H}=I;b.currentTarget.setAttribute("data-swipe","end"),b.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),b.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),b.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${B}px`),b.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${H}px`),O()}else kr(rp,r.onSwipeCancel,D),b.currentTarget.setAttribute("data-swipe","cancel"),b.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),b.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),b.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),b.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");A.addEventListener("click",B=>B.preventDefault(),{once:!0})}};zn(()=>{t.toasts().find(b=>b.id===r.toastId&&b.update)&&f(!1)}),U(Ee(()=>t.isPaused(),b=>{b?k():T()},{defer:!0})),U(Ee([s,m],([b,I])=>{b&&!t.isPaused()&&_(I)})),U(Ee(()=>{var b;return(b=hn.get(r.toastId))==null?void 0:b.dismiss},b=>b&&O())),U(Ee(()=>p(),b=>!b&&L()));const R={translations:()=>r.translations,close:O,duration:m,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>y,generateId:vt(()=>o.id),registerTitleId:je(l),registerDescriptionId:je(c)};return S(xe,{get when(){return p()},get children(){return S(fc.Provider,{value:R,get children(){return S(ae,F({as:"li",ref(b){var I=ve(g,r.ref);typeof I=="function"&&I(b)},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 u()},get"data-opened"(){return s()?"":void 0},get"data-closed"(){return s()?void 0:""},get"data-swipe-direction"(){return t.swipeDirection()},onKeyDown:V,onPointerDown:z,onPointerMove:se,onPointerUp:P},o))}})}})}function Wa(e,t,n=0){const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n}function kr(e,t,n){const r=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(o)}function wc(e){const t=fo(),n=Z({id:t.generateId("title")},e),[r,o]=N(n,["id"]);return U(()=>W(t.registerTitleId(r.id))),S(ae,F({as:"div",get id(){return r.id}},o))}var sp=0;function bc(e,t){const n=sp++;return hn.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t==null?void 0:t.region}),n}function _s(e,t){hn.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function ip(e,t,n){const r=bc(o=>t({get toastId(){return o.toastId},state:"pending"}),n);return(di(e)?e():e).then(o=>_s(r,s=>t({get toastId(){return s.toastId},state:"fulfilled",data:o}))).catch(o=>_s(r,s=>t({get toastId(){return s.toastId},state:"rejected",error:o}))),r}function ap(e){return hn.dismiss(e),e}function lp(){hn.clear()}var Sc={show:bc,update:_s,promise:ip,dismiss:ap,clear:lp},up=Object.assign(vc,{CloseButton:hc,Description:gc,List:vi,ProgressFill:mc,ProgressTrack:yc,Region:bi,Title:wc,toaster:Sc});function xc(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=xc(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function cp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=xc(e))&&(r&&(r+=" "),r+=t);return r}const Xa=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Ya=cp,ho=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ya(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const f=Xa(c)||Xa(d);return o[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(g=>{let[p,m]=g;return Array.isArray(m)?m.includes({...s,...a}[p]):{...s,...a}[p]===m})?[...u,d,f]:u},[]);return Ya(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)};function Cc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Cc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function dp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Cc(e))&&(r&&(r+=" "),r+=t);return r}const Si="-",fp=e=>{const t=gp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Si);return a[0]===""&&a.length!==1&&a.shift(),Ec(a,t)||hp(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Ec=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ec(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Si);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Qa=/^\[(.+)\]$/,hp=e=>{if(Qa.test(e)){const t=Qa.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return mp(Object.entries(e.classGroups),n).forEach(([s,i])=>{ks(i,r,s,t)}),r},ks=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Za(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(pp(o)){ks(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{ks(i,Za(t,s),n,r)})})},Za=(e,t)=>{let n=e;return t.split(Si).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},pp=e=>e.isThemeGetter,mp=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,yp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},Rc="!",vp=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let u=0,c=0,d;for(let m=0;m<a.length;m++){let w=a[m];if(u===0){if(w===o&&(r||a.slice(m,m+s)===t)){l.push(a.slice(c,m)),c=m+s;continue}if(w==="/"){d=m;continue}}w==="["?u++:w==="]"&&u--}const f=l.length===0?a:a.substring(c),h=f.startsWith(Rc),g=h?f.substring(1):f,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:i}):i},wp=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},bp=e=>({cache:yp(e.cacheSize),parseClassName:vp(e),...fp(e)}),Sp=/\s+/,xp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(Sp);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let g=!!h,p=r(g?f.substring(0,h):f);if(!p){if(!g){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}g=!1}const m=wp(c).join(":"),w=d?m+Rc:m,y=w+p;if(s.includes(y))continue;s.push(y);const v=o(p,g);for(let x=0;x<v.length;++x){const C=v[x];s.push(w+C)}a=u+(a.length>0?" "+a:a)}return a};function Cp(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Pc(t))&&(r&&(r+=" "),r+=n);return r}const Pc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Pc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ep(e,...t){let n,r,o,s=i;function i(l){const u=t.reduce((c,d)=>d(c),e());return n=bp(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=xp(l,n);return o(l,c),c}return function(){return s(Cp.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ic=/^\[(?:([a-z-]+):)?(.+)\]$/i,Rp=/^\d+\/\d+$/,Pp=new Set(["px","full","screen"]),Ip=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mp=/\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$/,Ap=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Fp=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$p=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>Pn(e)||Pp.has(e)||Rp.test(e),Tt=e=>Hn(e,"length",Np),Pn=e=>!!e&&!Number.isNaN(Number(e)),Oo=e=>Hn(e,"number",Pn),Jn=e=>!!e&&Number.isInteger(Number(e)),Op=e=>e.endsWith("%")&&Pn(e.slice(0,-1)),re=e=>Ic.test(e),Dt=e=>Ip.test(e),Tp=new Set(["length","size","percentage"]),Dp=e=>Hn(e,Tp,Mc),Lp=e=>Hn(e,"position",Mc),_p=new Set(["image","url"]),kp=e=>Hn(e,_p,jp),Vp=e=>Hn(e,"",Kp),er=()=>!0,Hn=(e,t,n)=>{const r=Ic.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Np=e=>Mp.test(e)&&!Ap.test(e),Mc=()=>!1,Kp=e=>Fp.test(e),jp=e=>$p.test(e),Bp=()=>{const e=we("colors"),t=we("spacing"),n=we("blur"),r=we("brightness"),o=we("borderColor"),s=we("borderRadius"),i=we("borderSpacing"),a=we("borderWidth"),l=we("contrast"),u=we("grayscale"),c=we("hueRotate"),d=we("invert"),f=we("gap"),h=we("gradientColorStops"),g=we("gradientColorStopPositions"),p=we("inset"),m=we("margin"),w=we("opacity"),y=we("padding"),v=we("saturate"),x=we("scale"),C=we("sepia"),O=we("skew"),L=we("space"),_=we("translate"),T=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",re,t],z=()=>[re,t],se=()=>["",xt,Tt],P=()=>["auto",Pn,re],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],b=()=>["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"],A=()=>["","0",re],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Pn,re];return{cacheSize:500,separator:":",theme:{colors:[er],spacing:[xt,Tt],blur:["none","",Dt,re],brightness:B(),borderColor:[e],borderRadius:["none","","full",Dt,re],borderSpacing:z(),borderWidth:se(),contrast:B(),grayscale:A(),hueRotate:B(),invert:A(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[Op,Tt],inset:V(),margin:V(),opacity:B(),padding:z(),saturate:B(),scale:B(),sepia:A(),skew:B(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Dt]}],"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:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],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",Jn,re]}],basis:[{basis:V()}],"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:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",Jn,re]}],"grid-cols":[{"grid-cols":[er]}],"col-start-end":[{col:["auto",{span:["full",Jn,re]},re]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[er]}],"row-start-end":[{row:["auto",{span:[Jn,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:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"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:[Dt]},Dt]}],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",Dt,Tt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oo]}],"font-family":[{font:[er]}],"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",Pn,Oo]}],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:[...b(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xt,Tt]}],"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(),Lp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dp]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kp]}],"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:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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:[...b(),"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:b()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...b()]}],"outline-offset":[{"outline-offset":[xt,re]}],"outline-w":[{outline:[xt,Tt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[xt,Tt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Dt,Vp]}],"shadow-color":[{shadow:[er]}],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:[l]}],"drop-shadow":[{"drop-shadow":["","none",Dt,re]}],grayscale:[{grayscale:[u]}],"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":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"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":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:B()}],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:[Jn,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,Tt,Oo]}],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"]}}},zp=Ep(Bp);function ge(...e){return zp(dp(e))}const Gp=e=>new Promise(t=>setTimeout(t,e)),Hp=e=>{const[t,n]=N(e,["class"]);return S(oi,{get children(){return S(bi,{get children(){return S(vi,F({get class(){return ge("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))}})}})};var To="focusScope.autoFocusOnMount",Do="focusScope.autoFocusOnUnmount",Ja={bubbles:!1,cancelable:!0},el={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Ts(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Ts(this.stack,e),(t=this.active())==null||t.resume()}};function Ac(e,t){const[n,r]=j(!1),o={pause(){r(!0)},resume(){r(!1)}};let s=null;const i=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)},l=()=>Ze(t()),u=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,lc),g},c=()=>{const g=t();return g?ic(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:ac(p)};U(()=>{const g=t();if(!g)return;el.add(o);const p=ar(g);if(!_e(g,p)){const w=new CustomEvent(To,Ja);g.addEventListener(To,i),g.dispatchEvent(w),w.defaultPrevented||setTimeout(()=>{Ie(d()),ar(g)===p&&Ie(g)},0)}W(()=>{g.removeEventListener(To,i),setTimeout(()=>{const w=new CustomEvent(Do,Ja);h()&&w.preventDefault(),g.addEventListener(Do,a),g.dispatchEvent(w),w.defaultPrevented||Ie(p??l().body),g.removeEventListener(Do,a),el.remove(o)},0)})}),U(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=w=>{const y=w.target;y!=null&&y.closest(`[${yr}]`)||(_e(g,y)?s=y:Ie(s))},m=w=>{const v=w.relatedTarget??ar(g);v!=null&&v.closest(`[${yr}]`)||_e(g,v)||Ie(s)};l().addEventListener("focusin",p),l().addEventListener("focusout",m),W(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",m)})}),U(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=u();g.insertAdjacentElement("afterbegin",p);const m=u();g.insertAdjacentElement("beforeend",m);function w(v){const x=d(),C=f();v.relatedTarget===x?Ie(C):Ie(x)}p.addEventListener("focusin",w),m.addEventListener("focusin",w);const y=new MutationObserver(v=>{for(const x of v)x.previousSibling===m&&(m.remove(),g.insertAdjacentElement("beforeend",m)),x.nextSibling===p&&(p.remove(),g.insertAdjacentElement("afterbegin",p))});y.observe(g,{childList:!0,subtree:!1}),W(()=>{p.removeEventListener("focusin",w),m.removeEventListener("focusin",w),p.remove(),m.remove(),y.disconnect()})})}var Up="data-live-announcer";function Fc(e){U(()=>{$(e.isDisabled)||W(qp($(e.targets),$(e.root)))})}var tr=new WeakMap,We=[];function qp(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const f of l.querySelectorAll(`[${Up}], [${yr}]`))n.add(f);const u=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(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)s(f),f=c.nextNode()}},s=l=>{const u=tr.get(l)??0;l.getAttribute("aria-hidden")==="true"&&u===0||(u===0&&l.setAttribute("aria-hidden","true"),r.add(l),tr.set(l,u+1))};We.length&&We[We.length-1].disconnect(),o(t);const i=new MutationObserver(l=>{for(const u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(const c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&o(c)}});i.observe(t,{childList:!0,subtree:!0});const a={observe(){i.observe(t,{childList:!0,subtree:!0})},disconnect(){i.disconnect()}};return We.push(a),()=>{i.disconnect();for(const l of r){const u=tr.get(l);if(u==null)return;u===1?(l.removeAttribute("aria-hidden"),tr.delete(l)):tr.set(l,u-1)}a===We[We.length-1]?(We.pop(),We.length&&We[We.length-1].observe()):We.splice(We.indexOf(a),1)}}function Wp(e){const t=n=>{var r;n.key===fi.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 tl="interactOutside.pointerDownOutside",nl="interactOutside.focusOutside";function $c(e,t){let n,r=Mg;const o=()=>Ze(t()),s=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},i=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)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${yr}]`)||!_e(o(),f)||_e(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},u=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!l(d))return;const p=Se([s,a]);g.addEventListener(tl,p,{once:!0});const m=new CustomEvent(tl,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||yg(d)&&d.button===0}});g.dispatchEvent(m)}d.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const g=Se([i,a]);h.addEventListener(nl,g,{once:!0});const p=new CustomEvent(nl,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(p)};U(()=>{$(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",u,!0)},0),o().addEventListener("focusin",c,!0),W(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",u,!0),o().removeEventListener("focusin",c,!0)}))})}var Oc=be();function Xp(){return ye(Oc)}function xi(e){let t;const n=Xp(),[r,o]=N(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),i=d=>{s.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{s.delete(d),f==null||f()}};$c({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>_e(h(),d)))||[...s].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),Wp({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()))}}),zn(()=>{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(Ee([()=>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:i};return S(Oc.Provider,{value:c,get children(){return S(ae,F({as:"div",ref(d){var f=ve(h=>t=h,r.ref);typeof f=="function"&&f(d)}},o))}})}function pt(e){var i;const[t,n]=j((i=e.defaultValue)==null?void 0:i.call(e)),r=K(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),o=K(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[o,a=>{Ae(()=>{var u;const l=ig(a,o());return Object.is(l,o())||(r()||n(l),(u=e.onChange)==null||u.call(e,l)),l})}]}function Tc(e){const[t,n]=pt(e);return[()=>t()??!1,n]}function Yp(e){const[t,n]=pt(e);return[()=>t()??[],n]}function Ci(e={}){const[t,n]=Tc({value:()=>$(e.open),defaultValue:()=>!!$(e.defaultOpen),onChange:i=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,i)}}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var Vs=(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},Vr=new Map,Qp=e=>{U(()=>{const t=Te(e.style)??{},n=Te(e.properties)??[],r={};for(const s in t)r[s]=e.element.style[s];const o=Vr.get(e.key);o?o.activeCount++:Vr.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(s=>s.key)}),Object.assign(e.element.style,e.style);for(const s of n)e.element.style.setProperty(s.key,s.value);W(()=>{var i;const s=Vr.get(e.key);if(s){if(s.activeCount!==1){s.activeCount--;return}Vr.delete(e.key);for(const[a,l]of Object.entries(s.originalStyles))e.element.style[a]=l;for(const a of s.properties)e.element.style.removeProperty(a);e.element.style.length===0&&e.element.removeAttribute("style"),(i=e.cleanup)==null||i.call(e)}})})},rl=Qp,Zp=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Jp=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},em=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,s=0,i=0,a=!1;do{const[l,u,c]=Zp(o,t),d=c-l-r*u;(u!==0||d!==0)&&Jp(o,t)&&(s+=d,i+=u),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[s,i]},[ol,sl]=j([]),tm=e=>ol().indexOf(e)===ol().length-1,nm=e=>{const t=F({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Re();let r=[0,0],o=null,s=null;U(()=>{Te(t.enabled)&&(sl(u=>[...u,n]),W(()=>{sl(u=>u.filter(c=>c!==n))}))}),U(()=>{if(!Te(t.enabled)||!Te(t.hideScrollbar))return;const{body:u}=document,c=window.innerWidth-u.offsetWidth;if(Te(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(Te(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(u).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(u).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,g=window.scrollX;rl({key:"prevent-scroll",element:u,style:d,properties:f,cleanup:()=>{Te(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else rl({key:"prevent-scroll",element:u,style:{overflow:"hidden"}})}),U(()=>{!tm(n)||!Te(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",i,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),W(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",i),document.removeEventListener("touchmove",l)}))});const i=u=>{r=il(u),o=null,s=null},a=u=>{const c=u.target,d=Te(t.element),f=rm(u),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],p=al(c,h,g,d);let m;d&&Vs(d,c)?m=!p:m=!0,m&&u.cancelable&&u.preventDefault()},l=u=>{const c=Te(t.element),d=u.target;let f;if(u.touches.length===2)f=!Te(t.allowPinchZoom);else{if(o==null||s===null){const h=il(u).map((p,m)=>r[m]-p),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";o=g,s=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=al(d,o,s,c);c&&Vs(c,d)?f=!h:f=!0}}f&&u.cancelable&&u.preventDefault()}},rm=e=>[e.deltaX,e.deltaY],il=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],al=(e,t,n,r)=>{const o=r!==null&&Vs(r,e),[s,i]=em(e,t,o?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(i)<1)},om=nm,Dc=om,sm={};Yt(sm,{CloseButton:()=>Ei,Content:()=>Ri,Description:()=>Pi,Dialog:()=>im,Overlay:()=>Ii,Portal:()=>Mi,Root:()=>Ai,Title:()=>Fi,Trigger:()=>_c});var Lc=be();function yn(){const e=ye(Lc);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function Ei(e){const t=yn(),[n,r]=N(e,["aria-label","onClick"]);return S(wt,F({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:s=>{oe(s,n.onClick),t.close()}},r))}function Ri(e){let t;const n=yn(),r=Z({id:n.generateId("content")},e),[o,s]=N(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let i=!1,a=!1;const l=f=>{var h;(h=o.onPointerDownOutside)==null||h.call(o,f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},u=f=>{var h;(h=o.onFocusOutside)==null||h.call(o,f),n.modal()&&f.preventDefault()},c=f=>{var h;(h=o.onInteractOutside)==null||h.call(o,f),!n.modal()&&(f.defaultPrevented||(i=!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=o.onCloseAutoFocus)==null||h.call(o,f),n.modal()?(f.preventDefault(),Ie(n.triggerRef())):(f.defaultPrevented||(i||Ie(n.triggerRef()),f.preventDefault()),i=!1,a=!1)};return Fc({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),Dc({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),Ac({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:o.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),U(()=>W(n.registerContentId(s.id))),S(xe,{get when(){return n.contentPresent()},get children(){return S(xi,F({ref(f){var h=ve(g=>{n.setContentRef(g),t=g},o.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:l,onFocusOutside:u,onInteractOutside:c,get onDismiss(){return n.close}},s))}})}function Pi(e){const t=yn(),n=Z({id:t.generateId("description")},e),[r,o]=N(n,["id"]);return U(()=>W(t.registerDescriptionId(r.id))),S(ae,F({as:"p",get id(){return r.id}},o))}function Ii(e){const t=yn(),[n,r]=N(e,["ref","style","onPointerDown"]),o=s=>{oe(s,n.onPointerDown),s.target===s.currentTarget&&s.preventDefault()};return S(xe,{get when(){return t.overlayPresent()},get children(){return S(ae,F({as:"div",ref(s){var i=ve(t.setOverlayRef,n.ref);typeof i=="function"&&i(s)},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:o},r))}})}function Mi(e){const t=yn();return S(xe,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return S(oi,e)}})}var ll={dismiss:"Dismiss"};function Ai(e){const t=`dialog-${Re()}`,n=Z({id:t,modal:!0,translations:ll},e),[r,o]=j(),[s,i]=j(),[a,l]=j(),[u,c]=j(),[d,f]=j(),[h,g]=j(),p=Ci({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:x=>{var C;return(C=n.onOpenChange)==null?void 0:C.call(n,x)}}),m=()=>n.forceMount||p.isOpen(),{present:w}=wr({show:m,element:()=>u()??null}),{present:y}=wr({show:m,element:()=>d()??null}),v={translations:()=>n.translations??ll,isOpen:p.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??v.modal(),contentId:r,titleId:s,descriptionId:a,triggerRef:h,overlayRef:u,setOverlayRef:c,contentRef:d,setContentRef:f,overlayPresent:w,contentPresent:y,close:p.close,toggle:p.toggle,setTriggerRef:g,generateId:vt(()=>n.id),registerContentId:je(o),registerTitleId:je(i),registerDescriptionId:je(l)};return S(Lc.Provider,{value:v,get children(){return n.children}})}function Fi(e){const t=yn(),n=Z({id:t.generateId("title")},e),[r,o]=N(n,["id"]);return U(()=>W(t.registerTitleId(r.id))),S(ae,F({as:"h2",get id(){return r.id}},o))}function _c(e){const t=yn(),[n,r]=N(e,["ref","onClick"]);return S(wt,F({ref(s){var i=ve(t.setTriggerRef,n.ref);typeof i=="function"&&i(s)},"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:s=>{oe(s,n.onClick),t.toggle()}},r))}var im=Object.assign(Ai,{CloseButton:Ei,Content:Ri,Description:Pi,Overlay:Ii,Portal:Mi,Title:Fi,Trigger:_c}),kc=pe("<div>"),am=pe('<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">'),lm=pe("<span class=sr-only>Close");const um=Ai,cm=ho("fixed inset-0 z-50 flex",{variants:{position:{top:"items-start",bottom:"items-end",left:"justify-start",right:"justify-end"}},defaultVariants:{position:"right"}}),dm=e=>{const[t,n]=N(e,["position","children"]);return S(Mi,F(n,{get children(){var r=kc();return he(r,()=>t.children),Be(()=>Ru(r,cm({position:t.position}))),r}}))},fm=e=>{const[t,n]=N(e,["class"]);return S(Ii,F({get class(){return ge("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))},hm=ho("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"}}),gm=e=>{const[t,n]=N(e,["position","class","children"]);return S(dm,{get position(){return t.position},get children(){return[S(fm,{}),S(Ri,F({get class(){return ge(hm({position:t.position}),t.class,"max-h-screen overflow-y-auto")}},n,{get children(){return[K(()=>t.children),S(Ei,{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[am(),lm()]}})]}}))]}})},pm=e=>{const[t,n]=N(e,["class"]);return(()=>{var r=kc();return it(r,F({get class(){return ge("flex flex-col space-y-2 text-center sm:text-left",t.class)}},n),!1,!1),r})()},mm=e=>{const[t,n]=N(e,["class"]);return S(Fi,F({get class(){return ge("text-lg font-semibold text-foreground",t.class)}},n))},ym=e=>{const[t,n]=N(e,["class"]);return S(Pi,F({get class(){return ge("text-sm text-muted-foreground",t.class)}},n))};var vm=(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},wm=(e,t,n)=>(t=encodeURIComponent(t),vm(e,t,n)),bm=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),Ns=(e,t)=>{for(const[n,r]of Object.entries(t)){const o=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(o,r?`/${r}`:"")}return e},Sm=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},xm=e=>/^https?:\/\/[^\/]+?\/index$/.test(e)?e.replace(/\/index$/,"/"):e.replace(/\/index$/,"");function Nr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Vc(e,t){if(!Nr(e)&&!Nr(t))return t;const n={...e};for(const r in t){const o=t[r];Nr(n[r])&&Nr(o)?n[r]=Vc(n[r],o):n[r]=o}return n}var Nc=(e,t)=>new Proxy(()=>{},{get(r,o){if(!(typeof o!="string"||o==="then"))return Nc(e,[...t,o])},apply(r,o,s){return e({path:t,args:s})}}),Cm=class{constructor(e,t){de(this,"url");de(this,"method");de(this,"queryParams");de(this,"pathParams",{});de(this,"rBody");de(this,"cType");de(this,"fetch",async(e,t)=>{if(e){if(e.query){for(const[a,l]of Object.entries(e.query))if(l!==void 0)if(this.queryParams||(this.queryParams=new URLSearchParams),Array.isArray(l))for(const u of l)this.queryParams.append(a,u);else this.queryParams.set(a,l)}if(e.form){const a=new FormData;for(const[l,u]of Object.entries(e.form))if(Array.isArray(u))for(const c of u)a.append(l,c);else a.append(l,u);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[l,u]of Object.entries(e.cookie))a.push(wm(l,u,{path:"/"}));r.Cookie=a.join(",")}this.cType&&(r["Content-Type"]=this.cType);const o=new Headers(r);let s=this.url;s=xm(s),s=Ns(s,this.pathParams),this.queryParams&&(s=s+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const i=!(n==="GET"||n==="HEAD");return((t==null?void 0:t.fetch)||fetch)(s,{body:i?this.rBody:void 0,method:n,headers:o,...t==null?void 0:t.init})});this.url=e,this.method=t}},Em=(e,t)=>Nc(function n(r){var u;const o=[...r.path];if(o[o.length-1]==="toString")return o[o.length-2]==="name"?o[o.length-3]||"":n.toString();if(o[o.length-1]==="valueOf")return o[o.length-2]==="name"?o[o.length-3]||"":n;let s="";if(/^\$/.test(o[o.length-1])){const c=o.pop();c&&(s=c.replace(/^\$/,""))}const i=o.join("/"),a=bm(e,i);if(s==="url")return r.args[0]&&r.args[0].param?new URL(Ns(a,r.args[0].param)):new URL(a);if(s==="ws"){const c=Sm(r.args[0]&&r.args[0].param?Ns(a,r.args[0].param):a,"ws"),d=new URL(c),f=(u=r.args[0])==null?void 0:u.query;return f&&Object.entries(f).forEach(([g,p])=>{Array.isArray(p)?p.forEach(m=>d.searchParams.append(g,m)):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 l=new Cm(a,s);if(s){t??(t={});const c=Vc(t,{...r.args[1]??{}});return l.fetch(r.args[0],c)}return l},[]);const go=Em("/rpc"),Rm=()=>ci(()=>({queryKey:["getBundles"],queryFn:()=>go.getBundles.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY})),Pm=()=>ci(()=>({queryKey:["getConfig"],queryFn:()=>go.getConfig.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY})),Im=e=>ci(()=>({queryKey:["getBundle",e],queryFn:()=>go.getBundleById.$get({query:{bundleId:e}}).then(t=>t.json()),staleTime:Number.POSITIVE_INFINITY})),Mm=e=>{const t=e.split("-").join("").slice(0,12);return Number.parseInt(t,16)};function Kc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xr={exports:{}},Am=Xr.exports,ul;function Fm(){return ul||(ul=1,function(e,t){(function(n,r){e.exports=r()})(Am,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",l="hour",u="day",c="week",d="month",f="quarter",h="year",g="date",p="Invalid Date",m=/^(\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,y={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"],b=P%100;return"["+P+(R[(b-20)%10]||R[b]||R[0])+"]"}},v=function(P,R,b){var I=String(P);return!I||I.length>=R?P:""+Array(R+1-I.length).join(b)+P},x={s:v,z:function(P){var R=-P.utcOffset(),b=Math.abs(R),I=Math.floor(b/60),M=b%60;return(R<=0?"+":"-")+v(I,2,"0")+":"+v(M,2,"0")},m:function P(R,b){if(R.date()<b.date())return-P(b,R);var I=12*(b.year()-R.year())+(b.month()-R.month()),M=R.clone().add(I,d),A=b-M<0,D=R.clone().add(I+(A?-1:1),d);return+(-(I+(b-M)/(A?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:u,D:g,h:l,m:a,s:i,ms:s,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},C="en",O={};O[C]=y;var L="$isDayjsObject",_=function(P){return P instanceof z||!(!P||!P[L])},T=function P(R,b,I){var M;if(!R)return C;if(typeof R=="string"){var A=R.toLowerCase();O[A]&&(M=A),b&&(O[A]=b,M=A);var D=R.split("-");if(!M&&D.length>1)return P(D[0])}else{var B=R.name;O[B]=R,M=B}return!I&&M&&(C=M),M||!I&&C},k=function(P,R){if(_(P))return P.clone();var b=typeof R=="object"?R:{};return b.date=P,b.args=arguments,new z(b)},V=x;V.l=T,V.i=_,V.w=function(P,R){return k(P,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=function(){function P(b){this.$L=T(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[L]=!0}var R=P.prototype;return R.parse=function(b){this.$d=function(I){var M=I.date,A=I.utc;if(M===null)return new Date(NaN);if(V.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(m);if(D){var B=D[2]-1||0,H=(D[7]||"0").substring(0,3);return A?new Date(Date.UTC(D[1],B,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)):new Date(D[1],B,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)}}return new Date(M)}(b),this.init()},R.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},R.$utils=function(){return V},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(b,I){var M=k(b);return this.startOf(I)<=M&&M<=this.endOf(I)},R.isAfter=function(b,I){return k(b)<this.startOf(I)},R.isBefore=function(b,I){return this.endOf(I)<k(b)},R.$g=function(b,I,M){return V.u(b)?this[I]:this.set(M,b)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(b,I){var M=this,A=!!V.u(I)||I,D=V.p(b),B=function(Me,Pe){var Ot=V.w(M.$u?Date.UTC(M.$y,Pe,Me):new Date(M.$y,Pe,Me),M);return A?Ot:Ot.endOf(u)},H=function(Me,Pe){return V.w(M.toDate()[Me].apply(M.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(Pe)),M)},X=this.$W,le=this.$M,ne=this.$D,Fe="set"+(this.$u?"UTC":"");switch(D){case h:return A?B(1,0):B(31,11);case d:return A?B(1,le):B(0,le+1);case c:var Je=this.$locale().weekStart||0,te=(X<Je?X+7:X)-Je;return B(A?ne-te:ne+(6-te),le);case u:case g:return H(Fe+"Hours",0);case l:return H(Fe+"Minutes",1);case a:return H(Fe+"Seconds",2);case i:return H(Fe+"Milliseconds",3);default:return this.clone()}},R.endOf=function(b){return this.startOf(b,!1)},R.$set=function(b,I){var M,A=V.p(b),D="set"+(this.$u?"UTC":""),B=(M={},M[u]=D+"Date",M[g]=D+"Date",M[d]=D+"Month",M[h]=D+"FullYear",M[l]=D+"Hours",M[a]=D+"Minutes",M[i]=D+"Seconds",M[s]=D+"Milliseconds",M)[A],H=A===u?this.$D+(I-this.$W):I;if(A===d||A===h){var X=this.clone().set(g,1);X.$d[B](H),X.init(),this.$d=X.set(g,Math.min(this.$D,X.daysInMonth())).$d}else B&&this.$d[B](H);return this.init(),this},R.set=function(b,I){return this.clone().$set(b,I)},R.get=function(b){return this[V.p(b)]()},R.add=function(b,I){var M,A=this;b=Number(b);var D=V.p(I),B=function(le){var ne=k(A);return V.w(ne.date(ne.date()+Math.round(le*b)),A)};if(D===d)return this.set(d,this.$M+b);if(D===h)return this.set(h,this.$y+b);if(D===u)return B(1);if(D===c)return B(7);var H=(M={},M[a]=r,M[l]=o,M[i]=n,M)[D]||1,X=this.$d.getTime()+b*H;return V.w(X,this)},R.subtract=function(b,I){return this.add(-1*b,I)},R.format=function(b){var I=this,M=this.$locale();if(!this.isValid())return M.invalidDate||p;var A=b||"YYYY-MM-DDTHH:mm:ssZ",D=V.z(this),B=this.$H,H=this.$m,X=this.$M,le=M.weekdays,ne=M.months,Fe=M.meridiem,Je=function(Pe,Ot,Qn,Or){return Pe&&(Pe[Ot]||Pe(I,A))||Qn[Ot].slice(0,Or)},te=function(Pe){return V.s(B%12||12,Pe,"0")},Me=Fe||function(Pe,Ot,Qn){var Or=Pe<12?"AM":"PM";return Qn?Or.toLowerCase():Or};return A.replace(w,function(Pe,Ot){return Ot||function(Qn){switch(Qn){case"YY":return String(I.$y).slice(-2);case"YYYY":return V.s(I.$y,4,"0");case"M":return X+1;case"MM":return V.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 V.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(B);case"HH":return V.s(B,2,"0");case"h":return te(1);case"hh":return te(2);case"a":return Me(B,H,!0);case"A":return Me(B,H,!1);case"m":return String(H);case"mm":return V.s(H,2,"0");case"s":return String(I.$s);case"ss":return V.s(I.$s,2,"0");case"SSS":return V.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(b,I,M){var A,D=this,B=V.p(I),H=k(b),X=(H.utcOffset()-this.utcOffset())*r,le=this-H,ne=function(){return V.m(D,H)};switch(B){case h:A=ne()/12;break;case d:A=ne();break;case f:A=ne()/3;break;case c:A=(le-X)/6048e5;break;case u:A=(le-X)/864e5;break;case l:A=le/o;break;case a:A=le/r;break;case i:A=le/n;break;default:A=le}return M?A:V.a(A)},R.daysInMonth=function(){return this.endOf(d).$D},R.$locale=function(){return O[this.$L]},R.locale=function(b,I){if(!b)return this.$L;var M=this.clone(),A=T(b,I,!0);return A&&(M.$L=A),M},R.clone=function(){return V.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}(),se=z.prototype;return k.prototype=se,[["$ms",s],["$s",i],["$m",a],["$H",l],["$W",u],["$M",d],["$y",h],["$D",g]].forEach(function(P){se[P[1]]=function(R){return this.$g(R,P[0],P[1])}}),k.extend=function(P,R){return P.$i||(P(R,z,k),P.$i=!0),k},k.locale=T,k.isDayjs=_,k.unix=function(P){return k(1e3*P)},k.en=O[C],k.Ls=O,k.p={},k})}(Xr)),Xr.exports}var $m=Fm();const Om=Kc($m);/**
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 Tm={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"},bn=Tm,Dm=pe("<svg>"),Lm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_m=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),km=e=>{const[t,n]=N(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var r=Dm();return it(r,F(bn,{get width(){return t.size??bn.width},get height(){return t.size??bn.height},get stroke(){return t.color??bn.stroke},get"stroke-width"(){return K(()=>!!t.absoluteStrokeWidth)()?Number(t.strokeWidth??bn["stroke-width"])*24/Number(t.size):Number(t.strokeWidth??bn["stroke-width"])},get class(){return _m("lucide","lucide-icon",t.name!=null?`lucide-${Lm(t==null?void 0:t.name)}`:void 0,t.class!=null?t.class:"")}},n),!0,!0),he(r,S(Mt,{get each(){return t.iconNode},children:([o,s])=>S(Iu,F({component:o},s))})),r})()},$i=km,Vm=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Nm=e=>S($i,F(e,{name:"Check",iconNode:Vm})),cl=Nm,Km=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],jm=e=>S($i,F(e,{name:"LoaderCircle",iconNode:Km})),Bm=jm,zm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Gm=e=>S($i,F(e,{name:"X",iconNode:zm})),dl=Gm,Kr=pe('<div class="flex flex-row items-center">');const Hm=[{accessorKey:"id",header:"ID",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=Kr();return he(t,S(cl,{class:"text-green-500"})),t})():(()=>{var t=Kr();return he(t,S(dl,{class:"text-red-500"})),t})()},{accessorKey:"shouldForceUpdate",header:"Force Update",cell:e=>e.getValue()?(()=>{var t=Kr();return he(t,S(cl,{class:"text-green-500"})),t})():(()=>{var t=Kr();return he(t,S(dl,{class:"text-red-500"})),t})()},{accessorKey:"message",header:"Message",cell:e=>e.getValue()},{accessorKey:"id",header:"Created At",cell:e=>Om(Mm(String(e.getValue()))).format("YYYY-MM-DD HH:mm:ss")}];function Um(e){const[t,n]=j(0),[r,o]=j(0);U(()=>{const a=e();if(!a)return;i(a);const l=new ResizeObserver(s);l.observe(a),W(()=>{l.disconnect()})});const s=a=>{for(const l of a)l.target===e()&&i(l.target)},i=a=>{o(a.offsetWidth),n(a.offsetHeight)};return{width:r,height:t}}var qm=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Wm=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Xm(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return qm.has(n)}const t=e.split("-")[0];return Wm.has(t)}function Ym(e){return Xm(e)?"rtl":"ltr"}function jc(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Ym(e)}}var Ks=jc(),lr=new Set;function fl(){Ks=jc();for(const e of lr)e(Ks)}function Qm(){const[e,t]=j(Ks),n=K(()=>e());return zn(()=>{lr.size===0&&window.addEventListener("languagechange",fl),lr.add(t),W(()=>{lr.delete(t),lr.size===0&&window.removeEventListener("languagechange",fl)})}),{locale:()=>n().locale,direction:()=>n().direction}}var Zm=be();function Qt(){const e=Qm();return ye(Zm)||e}var Lo=new Map;function Jm(e){const{locale:t}=Qt(),n=K(()=>t()+Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join());return K(()=>{const r=n();let o;return Lo.has(r)&&(o=Lo.get(r)),o||(o=new Intl.Collator(t(),e),Lo.set(r,o)),o})}const ey=["top","right","bottom","left"],Ut=Math.min,Ge=Math.max,to=Math.round,jr=Math.floor,gt=e=>({x:e,y:e}),ty={left:"right",right:"left",bottom:"top",top:"bottom"},ny={start:"end",end:"start"};function js(e,t,n){return Ge(e,Ut(t,n))}function vn(e,t){return typeof e=="function"?e(t):e}function qt(e){return e.split("-")[0]}function Un(e){return e.split("-")[1]}function Bc(e){return e==="x"?"y":"x"}function Oi(e){return e==="y"?"height":"width"}function gn(e){return["top","bottom"].includes(qt(e))?"y":"x"}function Ti(e){return Bc(gn(e))}function ry(e,t,n){n===void 0&&(n=!1);const r=Un(e),o=Ti(e),s=Oi(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=no(i)),[i,no(i)]}function oy(e){const t=no(e);return[Bs(e),t,Bs(t)]}function Bs(e){return e.replace(/start|end/g,t=>ny[t])}function sy(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function iy(e,t,n,r){const o=Un(e);let s=sy(qt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Bs)))),s}function no(e){return e.replace(/left|right|bottom|top/g,t=>ty[t])}function ay(e){return{top:0,right:0,bottom:0,left:0,...e}}function zc(e){return typeof e!="number"?ay(e):{top:e,right:e,bottom:e,left:e}}function ro(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function hl(e,t,n){let{reference:r,floating:o}=e;const s=gn(t),i=Ti(t),a=Oi(i),l=qt(t),u=s==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-o.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-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Un(t)){case"start":h[i]-=f*(n&&u?-1:1);break;case"end":h[i]+=f*(n&&u?-1:1);break}return h}const ly=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=hl(u,r,l),f=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:w}=a[p],{x:y,y:v,data:x,reset:C}=await w({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});c=y??c,d=v??d,h={...h,[m]:{...h[m],...x}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:c,y:d}=hl(u,f,l)),p=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=vn(t,e),g=zc(h),m=a[f?d==="floating"?"reference":"floating":d],w=ro(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),y=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},C=ro(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);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 uy=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=vn(e,t)||{};if(u==null)return{};const d=zc(c),f={x:n,y:r},h=Ti(o),g=Oi(h),p=await i.getDimensions(u),m=h==="y",w=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",x=s.reference[g]+s.reference[h]-f[h]-s.floating[g],C=f[h]-s.reference[h],O=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let L=O?O[v]:0;(!L||!await(i.isElement==null?void 0:i.isElement(O)))&&(L=a.floating[v]||s.floating[g]);const _=x/2-C/2,T=L/2-p[g]/2-1,k=Ut(d[w],T),V=Ut(d[y],T),z=k,se=L-p[g]-V,P=L/2-p[g]/2+_,R=js(z,P,se),b=!l.arrow&&Un(o)!=null&&P!==R&&s.reference[g]/2-(P<z?k:V)-p[g]/2<0,I=b?P<z?P-z:P-se:0;return{[h]:f[h]+I,data:{[h]:R,centerOffset:P-R-I,...b&&{alignmentOffset:I}},reset:b}}}),cy=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=vn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=qt(o),y=gn(a),v=qt(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=f||(v||!p?[no(a)]:oy(a)),O=g!=="none";!f&&O&&C.push(...iy(a,p,g,x));const L=[a,...C],_=await br(t,m),T=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(c&&T.push(_[w]),d){const P=ry(o,i,x);T.push(_[P[0]],_[P[1]])}if(k=[...k,{placement:o,overflows:T}],!T.every(P=>P<=0)){var V,z;const P=(((V=s.flip)==null?void 0:V.index)||0)+1,R=L[P];if(R)return{data:{index:P,overflows:k},reset:{placement:R}};let b=(z=k.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:z.placement;if(!b)switch(h){case"bestFit":{var se;const I=(se=k.filter(M=>{if(O){const A=gn(M.placement);return A===y||A==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(A=>A>0).reduce((A,D)=>A+D,0)]).sort((M,A)=>M[1]-A[1])[0])==null?void 0:se[0];I&&(b=I);break}case"initialPlacement":b=a;break}if(o!==b)return{reset:{placement:b}}}return{}}}};function gl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pl(e){return ey.some(t=>e[t]>=0)}const dy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=vn(e,t);switch(r){case"referenceHidden":{const s=await br(t,{...o,elementContext:"reference"}),i=gl(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:pl(i)}}}case"escaped":{const s=await br(t,{...o,altBoundary:!0}),i=gl(s,n.floating);return{data:{escapedOffsets:i,escaped:pl(i)}}}default:return{}}}}};async function fy(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=qt(n),a=Un(n),l=gn(n)==="y",u=["left","top"].includes(i)?-1:1,c=s&&l?-1:1,d=vn(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),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const hy=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await fy(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},gy=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:m=>{let{x:w,y}=m;return{x:w,y}}},...l}=vn(e,t),u={x:n,y:r},c=await br(t,l),d=gn(qt(o)),f=Bc(d);let h=u[f],g=u[d];if(s){const m=f==="y"?"top":"left",w=f==="y"?"bottom":"right",y=h+c[m],v=h-c[w];h=js(y,h,v)}if(i){const m=d==="y"?"top":"left",w=d==="y"?"bottom":"right",y=g+c[m],v=g-c[w];g=js(y,g,v)}const p=a.fn({...t,[f]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:s,[d]:i}}}}}},py=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=vn(e,t),c=await br(t,u),d=qt(o),f=Un(o),h=gn(o)==="y",{width:g,height:p}=s.floating;let m,w;d==="top"||d==="bottom"?(m=d,w=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,m=f==="end"?"top":"bottom");const y=p-c.top-c.bottom,v=g-c.left-c.right,x=Ut(p-c[m],y),C=Ut(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=y),O&&!f){const k=Ge(c.left,0),V=Ge(c.right,0),z=Ge(c.top,0),se=Ge(c.bottom,0);h?_=g-2*(k!==0||V!==0?k+V:Ge(c.left,c.right)):L=p-2*(z!==0||se!==0?z+se:Ge(c.top,c.bottom))}await l({...t,availableWidth:_,availableHeight:L});const T=await i.getDimensions(a.floating);return g!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function po(){return typeof window<"u"}function qn(e){return Gc(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=(Gc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Gc(e){return po()?e instanceof Node||e instanceof Ue(e).Node:!1}function at(e){return po()?e instanceof Element||e instanceof Ue(e).Element:!1}function mt(e){return po()?e instanceof HTMLElement||e instanceof Ue(e).HTMLElement:!1}function ml(e){return!po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ue(e).ShadowRoot}function Ar(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=lt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function my(e){return["table","td","th"].includes(qn(e))}function mo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Di(e){const t=Li(),n=at(e)?lt(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 yy(e){let t=Wt(e);for(;mt(t)&&!Bn(t);){if(Di(t))return t;if(mo(t))return null;t=Wt(t)}return null}function Li(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Bn(e){return["html","body","#document"].includes(qn(e))}function lt(e){return Ue(e).getComputedStyle(e)}function yo(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wt(e){if(qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ml(e)&&e.host||bt(e);return ml(t)?t.host:t}function Hc(e){const t=Wt(e);return Bn(t)?e.ownerDocument?e.ownerDocument.body:e.body:mt(t)&&Ar(t)?t:Hc(t)}function Sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Hc(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ue(o);if(s){const a=zs(i);return t.concat(i,i.visualViewport||[],Ar(o)?o:[],a&&n?Sr(a):[])}return t.concat(o,Sr(o,[],n))}function zs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Uc(e){const t=lt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=mt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=to(n)!==s||to(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function _i(e){return at(e)?e:e.contextElement}function In(e){const t=_i(e);if(!mt(t))return gt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Uc(t);let i=(s?to(n.width):n.width)/r,a=(s?to(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const vy=gt(0);function qc(e){const t=Ue(e);return!Li()||!t.visualViewport?vy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wy(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ue(e)?!1:t}function pn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=_i(e);let i=gt(1);t&&(r?at(r)&&(i=In(r)):i=In(e));const a=wy(s,n,r)?qc(s):gt(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,c=o.width/i.x,d=o.height/i.y;if(s){const f=Ue(s),h=r&&at(r)?Ue(r):r;let g=f,p=zs(g);for(;p&&r&&h!==g;){const m=In(p),w=p.getBoundingClientRect(),y=lt(p),v=w.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,x=w.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,u*=m.y,c*=m.x,d*=m.y,l+=v,u+=x,g=Ue(p),p=zs(g)}}return ro({width:c,height:d,x:l,y:u})}function ki(e,t){const n=yo(e).scrollLeft;return t?t.left+n:pn(bt(e)).left+n}function Wc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ki(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function by(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=bt(r),a=t?mo(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=gt(1);const c=gt(0),d=mt(r);if((d||!d&&!s)&&((qn(r)!=="body"||Ar(i))&&(l=yo(r)),mt(r))){const h=pn(r);u=In(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=i&&!d&&!s?Wc(i,l,!0):gt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function Sy(e){return Array.from(e.getClientRects())}function xy(e){const t=bt(e),n=yo(e),r=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ki(e);const a=-n.scrollTop;return lt(r).direction==="rtl"&&(i+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Cy(e,t){const n=Ue(e),r=bt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=Li();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}function Ey(e,t){const n=pn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=mt(e)?In(e):gt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function yl(e,t,n){let r;if(t==="viewport")r=Cy(e,n);else if(t==="document")r=xy(bt(e));else if(at(t))r=Ey(t,n);else{const o=qc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ro(r)}function Xc(e,t){const n=Wt(e);return n===t||!at(n)||Bn(n)?!1:lt(n).position==="fixed"||Xc(n,t)}function Ry(e,t){const n=t.get(e);if(n)return n;let r=Sr(e,[],!1).filter(a=>at(a)&&qn(a)!=="body"),o=null;const s=lt(e).position==="fixed";let i=s?Wt(e):e;for(;at(i)&&!Bn(i);){const a=lt(i),l=Di(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ar(i)&&!l&&Xc(e,i))?r=r.filter(c=>c!==i):o=a,i=Wt(i)}return t.set(e,r),r}function Py(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?mo(t)?[]:Ry(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,c)=>{const d=yl(t,c,o);return u.top=Ge(d.top,u.top),u.right=Ut(d.right,u.right),u.bottom=Ut(d.bottom,u.bottom),u.left=Ge(d.left,u.left),u},yl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Iy(e){const{width:t,height:n}=Uc(e);return{width:t,height:n}}function My(e,t,n){const r=mt(t),o=bt(t),s=n==="fixed",i=pn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=gt(0);if(r||!r&&!s)if((qn(t)!=="body"||Ar(o))&&(a=yo(t)),r){const f=pn(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=ki(o));const u=o&&!r&&!s?Wc(o,a):gt(0),c=i.left+a.scrollLeft-l.x-u.x,d=i.top+a.scrollTop-l.y-u.y;return{x:c,y:d,width:i.width,height:i.height}}function _o(e){return lt(e).position==="static"}function vl(e,t){if(!mt(e)||lt(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(mo(e))return n;if(!mt(e)){let o=Wt(e);for(;o&&!Bn(o);){if(at(o)&&!_o(o))return o;o=Wt(o)}return n}let r=vl(e,t);for(;r&&my(r)&&_o(r);)r=vl(r,t);return r&&Bn(r)&&_o(r)&&!Di(r)?n:r||yy(e)||n}const Ay=async function(e){const t=this.getOffsetParent||Yc,n=this.getDimensions,r=await n(e.floating);return{reference:My(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fy(e){return lt(e).direction==="rtl"}const Qc={convertOffsetParentRelativeRectToViewportRelativeRect:by,getDocumentElement:bt,getClippingRect:Py,getOffsetParent:Yc,getElementRects:Ay,getClientRects:Sy,getDimensions:Iy,getScale:In,isElement:at,isRTL:Fy};function $y(e,t){let n=null,r;const o=bt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=jr(c),g=jr(o.clientWidth-(u+d)),p=jr(o.clientHeight-(c+f)),m=jr(u),y={rootMargin:-h+"px "+-g+"px "+-p+"px "+-m+"px",threshold:Ge(0,Ut(1,l))||1};let v=!0;function x(C){const O=C[0].intersectionRatio;if(O!==l){if(!v)return i();O?i(!1,O):r=setTimeout(()=>{i(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(x,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,y)}n.observe(e)}return i(!0),s}function Oy(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=_i(e),c=o||s?[...u?Sr(u):[],...Sr(t)]:[];c.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const d=u&&a?$y(u,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g,p=l?pn(e):null;l&&m();function m(){const w=pn(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,g=requestAnimationFrame(m)}return n(),()=>{var w;c.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const Ty=hy,Dy=gy,Ly=cy,_y=py,ky=dy,Vy=uy,Ny=(e,t,n)=>{const r=new Map,o={platform:Qc,...n},s={...o.platform,_c:r};return ly(e,t,{...o,platform:s})};var Ky=pe('<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>'),Vi=be();function Ni(){const e=ye(Vi);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var Gs=30,wl=Gs/2,jy={top:180,right:-90,bottom:0,left:90};function Zc(e){const t=Ni(),n=Z({size:Gs},e),[r,o]=N(n,["ref","style","size"]),s=()=>t.currentPlacement().split("-")[0],i=By(t.contentRef),a=()=>{var f;return((f=i())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=i())==null?void 0:f.getPropertyValue(`border-${s()}-color`))||"none"},u=()=>{var f;return((f=i())==null?void 0:f.getPropertyValue(`border-${s()}-width`))||"0px"},c=()=>Number.parseInt(u())*2*(Gs/r.size),d=()=>`rotate(${jy[s()]} ${wl} ${wl}) translate(0 2)`;return S(ae,F({as:"div",ref(f){var h=ve(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:l(),"stroke-width":c()},r.style)}},o,{get children(){var f=Ky(),h=f.firstChild,g=h.firstChild;return g.nextSibling,Be(()=>dn(h,"transform",d())),f}}))}function By(e){const[t,n]=j();return U(()=>{const r=e();r&&n(rc(r).getComputedStyle(r))}),t}function zy(e){const t=Ni(),[n,r]=N(e,["ref","style"]);return S(ae,F({as:"div",ref(o){var s=ve(t.setPositionerRef,n.ref);typeof s=="function"&&s(o)},"data-popper-positioner":"",get style(){return yt({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function bl(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const s={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...s,toJSON:()=>s}}function Gy(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?bl(r):e?e.getBoundingClientRect():bl()}}}function Hy(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Uy={top:"bottom",right:"left",bottom:"top",left:"right"};function qy(e,t){const[n,r]=e.split("-"),o=Uy[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function Wy(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]=j(),[o,s]=j(),[i,a]=j(t.placement),l=()=>{var f;return Gy((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:u}=Qt();async function c(){var O,L;const f=l(),h=n(),g=o();if(!f||!h)return;const p=((g==null?void 0:g.clientHeight)||0)/2,m=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=[Ty(({placement:_})=>{const T=!!_.split("-")[1];return{mainAxis:m,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(Hy))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(Ly({padding:t.overflowPadding,fallbackPlacements:_}))}(t.slide||t.overlap)&&w.push(Dy({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(_y({padding:t.overflowPadding,apply({availableWidth:_,availableHeight:T,rects:k}){const V=Math.round(k.reference.width);_=Math.floor(_),T=Math.floor(T),h.style.setProperty("--kb-popper-anchor-width",`${V}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=`${V}px`),t.fitViewport&&(h.style.maxWidth=`${_}px`,h.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&w.push(ky({padding:t.detachedPadding})),g&&w.push(Vy({element:g,padding:t.arrowPadding}));const y=await Ny(f,h,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...Qc,isRTL:()=>u()==="rtl"}});if(a(y.placement),(O=t.onCurrentPlacementChange)==null||O.call(t,y.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",qy(y.placement,u()));const v=Math.round(y.x),x=Math.round(y.y);let C;if(t.hideWhenDetached&&(C=(L=y.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&&y.middlewareData.arrow){const{x:_,y:T}=y.middlewareData.arrow,k=y.placement.split("-")[0];Object.assign(g.style,{left:_!=null?`${_}px`:"",top:T!=null?`${T}px`:"",[k]:"100%"})}}U(()=>{const f=l(),h=n();if(!f||!h)return;const g=Oy(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:i,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:s};return S(Vi.Provider,{value:d,get children(){return t.children}})}var vo=Object.assign(Wy,{Arrow:Zc,Context:Vi,usePopperContext:Ni,Positioner:zy}),Jc=be();function ed(){return ye(Jc)}function Xy(){const e=ed();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function td(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Yy(e,t){var o;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const s=(o=e[r])==null?void 0:o.ref();if(s&&td(s,n))return r+1}return 0}function Qy(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[s,i])=>{const a=o.ref(),l=i.ref();return a===l||!a||!l?0:td(a,l)?(r>s&&(n=!0),-1):(r<s&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function nd(e,t){const n=Qy(e);e!==n&&t(n)}function Zy(e){var o,s;const t=e[0],n=(o=e[e.length-1])==null?void 0:o.ref();let r=(s=t==null?void 0:t.ref())==null?void 0:s.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Ze(r).body}function Jy(e,t){U(()=>{const n=setTimeout(()=>{nd(e(),t)});W(()=>clearTimeout(n))})}function ev(e,t){if(typeof IntersectionObserver!="function"){Jy(e,t);return}let n=[];U(()=>{const r=()=>{const i=!!n.length;n=e(),i&&nd(e(),t)},o=Zy(e()),s=new IntersectionObserver(r,{root:o});for(const i of e()){const a=i.ref();a&&s.observe(a)}W(()=>s.disconnect())})}function tv(e={}){const[t,n]=Yp({value:()=>$(e.items),onChange:s=>{var i;return(i=e.onItemsChange)==null?void 0:i.call(e,s)}});ev(t,n);const r=s=>(n(i=>{const a=Yy(i,s);return dg(i,s,a)}),()=>{n(i=>{const a=i.filter(l=>l.ref()!==s.ref());return i.length===a.length?i:a})});return{DomCollectionProvider:s=>S(Jc.Provider,{value:{registerItem:r},get children(){return s.children}})}}function nv(e){const t=Xy(),n=Z({shouldRegisterItem:!0},e);U(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());W(r)})}function rd(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const u=e.getKey??"key",c=xn(u)?l[u]:u(l);return c!=null?String(c):""},s=l=>{if(l==null)return"";const u=e.getTextValue??"textValue",c=xn(u)?l[u]:u(l);return c!=null?String(c):""},i=l=>{if(l==null)return!1;const u=e.getDisabled??"disabled";return(xn(u)?l[u]:u(l))??!1},a=l=>{var u;if(l!=null)return xn(e.getSectionChildren)?l[e.getSectionChildren]:(u=e.getSectionChildren)==null?void 0:u.call(e,l)};for(const l of e.dataSource){if(xn(l)||fg(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:i(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const u=a(l)??[];if(u.length>0){const c=rd({dataSource:u,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:l,key:o(l),textValue:s(l),disabled:i(l),level:n,index:t}),t++}return r}function rv(e,t=[]){return K(()=>{const n=rd({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,o){super(n);de(this,"anchorKey");de(this,"currentKey");n instanceof od?(this.anchorKey=r||n.anchorKey,this.currentKey=o||n.currentKey):(this.anchorKey=r,this.currentKey=o)}};function ov(e){const[t,n]=pt(e);return[()=>t()??new Pt,n]}function sd(e){return mg()?e.altKey:e.ctrlKey}function Cn(e){return uo()?e.metaKey:e.ctrlKey}function Sl(e){return new Pt(e)}function sv(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function iv(e){const t=Z({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=j(!1),[o,s]=j(),i=K(()=>{const p=$(t.selectedKeys);return p!=null?Sl(p):p}),a=K(()=>{const p=$(t.defaultSelectedKeys);return p!=null?Sl(p):new Pt}),[l,u]=ov({value:i,defaultValue:a,onChange:p=>{var m;return(m=t.onSelectionChange)==null?void 0:m.call(t,p)}}),[c,d]=j($(t.selectionBehavior)),f=()=>$(t.selectionMode),h=()=>$(t.disallowEmptySelection)??!1,g=p=>{($(t.allowDuplicateSelectionEvents)||!sv(p,l()))&&u(p)};return U(()=>{const p=l();$(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:o,setFocusedKey:s,selectedKeys:l,setSelectedKeys:g}}function av(e){const[t,n]=j(""),[r,o]=j(-1);return{typeSelectHandlers:{onKeyDown:i=>{var f;if($(e.isDisabled))return;const a=$(e.keyboardDelegate),l=$(e.selectionManager);if(!a.getKeyForSearch)return;const u=lv(i.key);if(!u||i.ctrlKey||i.metaKey)return;u===" "&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n(h=>h+u),d=a.getKeyForSearch(c,l.focusedKey())??a.getKeyForSearch(c);d==null&&uv(c)&&(c=c[0],d=a.getKeyForSearch(c,l.focusedKey())??a.getKeyForSearch(c)),d!=null&&(l.setFocusedKey(d),(f=e.onTypeSelect)==null||f.call(e,d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function lv(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function uv(e){return e.split("").every(t=>t===e[0])}function cv(e,t,n){const o=F({selectOnFocus:()=>$(e.selectionManager).selectionBehavior()==="replace"},e),s=()=>t(),{direction:i}=Qt();let a={top:0,left:0};ug(()=>$(o.isVirtualized)?void 0:s(),"scroll",()=>{const m=s();m&&(a={top:m.scrollTop,left:m.scrollLeft})});const{typeSelectHandlers:l}=av({isDisabled:()=>$(o.disallowTypeAhead),keyboardDelegate:()=>$(o.keyboardDelegate),selectionManager:()=>$(o.selectionManager)}),u=()=>$(o.orientation)??"vertical",c=m=>{var _,T,k,V,z,se,P,R;oe(m,l.onKeyDown),m.altKey&&m.key==="Tab"&&m.preventDefault();const w=t();if(!(w!=null&&w.contains(m.target)))return;const y=$(o.selectionManager),v=$(o.selectOnFocus),x=b=>{b!=null&&(y.setFocusedKey(b),m.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(b):v&&!sd(m)&&y.replaceSelection(b))},C=$(o.keyboardDelegate),O=$(o.shouldFocusWrap),L=y.focusedKey();switch(m.key){case(u()==="vertical"?"ArrowDown":"ArrowRight"):{if(C.getKeyBelow){m.preventDefault();let b;L!=null?b=C.getKeyBelow(L):b=(_=C.getFirstKey)==null?void 0:_.call(C),b==null&&O&&(b=(T=C.getFirstKey)==null?void 0:T.call(C,L)),x(b)}break}case(u()==="vertical"?"ArrowUp":"ArrowLeft"):{if(C.getKeyAbove){m.preventDefault();let b;L!=null?b=C.getKeyAbove(L):b=(k=C.getLastKey)==null?void 0:k.call(C),b==null&&O&&(b=(V=C.getLastKey)==null?void 0:V.call(C,L)),x(b)}break}case(u()==="vertical"?"ArrowLeft":"ArrowUp"):{if(C.getKeyLeftOf){m.preventDefault();const b=i()==="rtl";let I;L!=null?I=C.getKeyLeftOf(L):I=b?(z=C.getFirstKey)==null?void 0:z.call(C):(se=C.getLastKey)==null?void 0:se.call(C),x(I)}break}case(u()==="vertical"?"ArrowRight":"ArrowDown"):{if(C.getKeyRightOf){m.preventDefault();const b=i()==="rtl";let I;L!=null?I=C.getKeyRightOf(L):I=b?(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){m.preventDefault();const b=C.getFirstKey(L,Cn(m));b!=null&&(y.setFocusedKey(b),Cn(m)&&m.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(b):v&&y.replaceSelection(b))}break;case"End":if(C.getLastKey){m.preventDefault();const b=C.getLastKey(L,Cn(m));b!=null&&(y.setFocusedKey(b),Cn(m)&&m.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(b):v&&y.replaceSelection(b))}break;case"PageDown":if(C.getKeyPageBelow&&L!=null){m.preventDefault();const b=C.getKeyPageBelow(L);x(b)}break;case"PageUp":if(C.getKeyPageAbove&&L!=null){m.preventDefault();const b=C.getKeyPageAbove(L);x(b)}break;case"a":Cn(m)&&y.selectionMode()==="multiple"&&$(o.disallowSelectAll)!==!0&&(m.preventDefault(),y.selectAll());break;case"Escape":m.defaultPrevented||(m.preventDefault(),$(o.disallowEmptySelection)||y.clearSelection());break;case"Tab":if(!$(o.allowsTabNavigation)){if(m.shiftKey)w.focus();else{const b=Pg(w,{tabbable:!0});let I,M;do M=b.lastChild(),M&&(I=M);while(M);I&&!I.contains(document.activeElement)&&Ie(I)}break}}},d=m=>{var x,C;const w=$(o.selectionManager),y=$(o.keyboardDelegate),v=$(o.selectOnFocus);if(w.isFocused()){m.currentTarget.contains(m.target)||w.setFocused(!1);return}if(m.currentTarget.contains(m.target)){if(w.setFocused(!0),w.focusedKey()==null){const O=_=>{_!=null&&(w.setFocusedKey(_),v&&w.replaceSelection(_))},L=m.relatedTarget;L&&m.currentTarget.compareDocumentPosition(L)&Node.DOCUMENT_POSITION_FOLLOWING?O(w.lastSelectedKey()??((x=y.getLastKey)==null?void 0:x.call(y))):O(w.firstSelectedKey()??((C=y.getFirstKey)==null?void 0:C.call(y)))}else if(!$(o.isVirtualized)){const O=s();if(O){O.scrollTop=a.top,O.scrollLeft=a.left;const L=O.querySelector(`[data-key="${w.focusedKey()}"]`);L&&(Ie(L),Ds(O,L))}}}},f=m=>{const w=$(o.selectionManager);m.currentTarget.contains(m.relatedTarget)||w.setFocused(!1)},h=m=>{s()===m.target&&m.preventDefault()},g=()=>{var O,L;const m=$(o.autoFocus);if(!m)return;const w=$(o.selectionManager),y=$(o.keyboardDelegate);let v;m==="first"&&(v=(O=y.getFirstKey)==null?void 0:O.call(y)),m==="last"&&(v=(L=y.getLastKey)==null?void 0:L.call(y));const x=w.selectedKeys();x.size&&(v=x.values().next().value),w.setFocused(!0),w.setFocusedKey(v);const C=t();C&&v==null&&!$(o.shouldUseVirtualFocus)&&Ie(C)};return zn(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),U(Ee([s,()=>$(o.isVirtualized),()=>$(o.selectionManager).focusedKey()],m=>{var x;const[w,y,v]=m;if(y)v&&((x=o.scrollToKey)==null||x.call(o,v));else if(v&&w){const C=w.querySelector(`[data-key="${v}"]`);C&&Ds(w,C)}})),{tabIndex:K(()=>{if(!$(o.shouldUseVirtualFocus))return $(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function id(e,t){const n=()=>$(e.selectionManager),r=()=>$(e.key),o=()=>$(e.shouldUseVirtualFocus),s=y=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):y!=null&&y.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Cn(y)||"pointerType"in y&&y.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},i=()=>n().isSelected(r()),a=()=>$(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let u=null;const c=y=>{l()&&(u=y.pointerType,y.pointerType==="mouse"&&y.button===0&&!$(e.shouldSelectOnPressUp)&&s(y))},d=y=>{l()&&y.pointerType==="mouse"&&y.button===0&&$(e.shouldSelectOnPressUp)&&$(e.allowsDifferentPressOrigin)&&s(y)},f=y=>{l()&&($(e.shouldSelectOnPressUp)&&!$(e.allowsDifferentPressOrigin)||u!=="mouse")&&s(y)},h=y=>{!l()||!["Enter"," "].includes(y.key)||(sd(y)?n().toggleSelection(r()):s(y))},g=y=>{a()&&y.preventDefault()},p=y=>{const v=t();o()||a()||!v||y.target===v&&n().setFocusedKey(r())},m=K(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),w=K(()=>$(e.virtualized)?void 0:r());return U(Ee([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([y,v,x,C,O])=>{y&&v===C&&O&&!x&&document.activeElement!==y&&(e.focus?e.focus():Ie(y))})),{isSelected:i,isDisabled:a,allowsSelection:l,tabIndex:m,dataKey:w,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:p}}var dv=class{constructor(e,t){de(this,"collection");de(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,o=new Pt(n,r,t);for(const s of this.getKeyRange(r,n.currentKey||t))o.delete(s);for(const s of this.getKeyRange(t,r))this.canSelectItem(s)&&o.add(s);this.state.setSelectedKeys(o)}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 o=this.collection().getItem(r);if(o&&o.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}},xl=class{constructor(e){de(this,"keyMap",new Map);de(this,"iterable");de(this,"firstKey");de(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,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),o.type==="item"&&(o.index=n++),t=o,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 fv(e){const t=iv(e),r=rv({dataSource:()=>$(e.dataSource),getKey:()=>$(e.getKey),getTextValue:()=>$(e.getTextValue),getDisabled:()=>$(e.getDisabled),getSectionChildren:()=>$(e.getSectionChildren),factory:s=>e.filter?new xl(e.filter(s)):new xl(s)},[()=>e.filter]),o=new dv(r,t);return At(()=>{const s=t.focusedKey();s!=null&&!r().getItem(s)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}var hv=class{constructor(e,t,n){de(this,"collection");de(this,"ref");de(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 s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=o!=null?this.getItem(o):null;return o}getKeyPageBelow(e){var s;const t=(s=this.ref)==null?void 0:s.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=o!=null?this.getItem(o):null;return o}getKeyForSearch(e,t){var o;const n=(o=this.collator)==null?void 0:o.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const s=this.collection().getItem(r);if(s){const i=s.textValue.slice(0,e.length);if(s.textValue&&n.compare(i,e)===0)return r}r=this.getKeyBelow(r)}}};function gv(e,t,n){const r=Jm({usage:"search",sensitivity:"base"}),o=K(()=>{const s=$(e.keyboardDelegate);return s||new hv(e.collection,t,r)});return cv({selectionManager:()=>$(e.selectionManager),keyboardDelegate:o,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:s=>{var i;return(i=$(e.scrollToKey))==null?void 0:i(s)},orientation:()=>$(e.orientation)},t)}function ad(e={}){const[t,n]=Tc({value:()=>$(e.isSelected),defaultValue:()=>!!$(e.defaultIsSelected),onChange:s=>{var i;return(i=e.onSelectedChange)==null?void 0:i.call(e,s)}});return{isSelected:t,setIsSelected:s=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(s)},toggle:()=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(!t())}}}var ld=be();function wo(){return ye(ld)}function $t(){const e=wo();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var ud=be();function Ki(){const e=ye(ud);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var cd=be();function St(){const e=ye(cd);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function ji(e){let t;const n=St(),r=$t(),o=Z({id:n.generateId(`item-${Re()}`)},e),[s,i]=N(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=j(),[u,c]=j(),[d,f]=j(),h=()=>r.listState().selectionManager(),g=()=>i.id,p=()=>h().focusedKey()===g(),m=()=>{var T;(T=s.onSelect)==null||T.call(s),s.closeOnSelect&&setTimeout(()=>{r.close(!0)})};nv({getItem:()=>{var T;return{ref:()=>t,type:"item",key:g(),textValue:s.textValue??((T=d())==null?void 0:T.textContent)??(t==null?void 0:t.textContent)??"",disabled:s.disabled??!1}}});const w=id({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),y=T=>{oe(T,s.onPointerMove),T.pointerType==="mouse"&&(s.disabled?r.onItemLeave(T):(r.onItemEnter(T),T.defaultPrevented||(Ie(T.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},v=T=>{oe(T,s.onPointerLeave),T.pointerType==="mouse"&&r.onItemLeave(T)},x=T=>{oe(T,s.onPointerUp),!s.disabled&&T.button===0&&m()},C=T=>{if(oe(T,s.onKeyDown),!T.repeat&&!s.disabled)switch(T.key){case"Enter":case" ":m();break}},O=K(()=>{if(s.indeterminate)return"mixed";if(s.checked!=null)return s.checked}),L=K(()=>({"data-indeterminate":s.indeterminate?"":void 0,"data-checked":s.checked&&!s.indeterminate?"":void 0,"data-disabled":s.disabled?"":void 0,"data-highlighted":p()?"":void 0})),_={isChecked:()=>s.checked,dataset:L,setLabelRef:f,generateId:vt(()=>i.id),registerLabel:je(l),registerDescription:je(c)};return S(ud.Provider,{value:_,get children(){return S(ae,F({as:"div",ref(T){var k=ve(V=>t=V,s.ref);typeof k=="function"&&k(T)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return s.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return u()},get"data-key"(){return w.dataKey()},get onPointerDown(){return Se([s.onPointerDown,w.onPointerDown])},get onPointerUp(){return Se([x,w.onPointerUp])},get onClick(){return Se([s.onClick,w.onClick])},get onKeyDown(){return Se([C,w.onKeyDown])},get onMouseDown(){return Se([s.onMouseDown,w.onMouseDown])},get onFocus(){return Se([s.onFocus,w.onFocus])},onPointerMove:y,onPointerLeave:v},L,i))}})}function pv(e){const t=Z({closeOnSelect:!1},e),[n,r]=N(t,["checked","defaultChecked","onChange","onSelect"]),o=ad({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:i=>{var a;return(a=n.onChange)==null?void 0:a.call(n,i)},isDisabled:()=>r.disabled});return S(ji,F({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{var i;(i=n.onSelect)==null||i.call(n),o.toggle()}},r))}var dd=be();function Fr(){return ye(dd)}function Wn(){const e=Fr();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)},Cl={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function El(e){const t=St(),n=$t(),r=Fr(),{direction:o}=Qt(),s=Z({id:t.generateId("trigger")},e),[i,a]=N(s,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??i.id,r.lastValue()===void 0&&r.setLastValue(l));const u=co(()=>n.triggerRef(),()=>"button"),c=K(()=>{var w;return u()==="a"&&((w=n.triggerRef())==null?void 0:w.getAttribute("href"))!=null});U(Ee(()=>r==null?void 0:r.value(),w=>{var y;c()&&w===l()&&((y=n.triggerRef())==null||y.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=w=>{oe(w,i.onPointerDown),w.currentTarget.dataset.pointerType=w.pointerType,!i.disabled&&w.pointerType!=="touch"&&w.button===0&&d()},h=w=>{oe(w,i.onClick),i.disabled||w.currentTarget.dataset.pointerType==="touch"&&d()},g=w=>{if(oe(w,i.onKeyDown),!i.disabled){if(c())switch(w.key){case"Enter":case" ":return}switch(w.key){case"Enter":case" ":case Cl.first(t.orientation()):w.stopPropagation(),w.preventDefault(),Fg(w.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case Cl.last(t.orientation()):w.stopPropagation(),w.preventDefault(),n.open("last");break;case xr.next(o(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.nextMenu();break;case xr.previous(o(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.previousMenu();break}}},p=w=>{var y;oe(w,i.onMouseOver),((y=n.triggerRef())==null?void 0:y.dataset.pointerType)!=="touch"&&!i.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},m=w=>{oe(w,i.onFocus),r!==void 0&&w.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return U(()=>W(n.registerTriggerId(i.id))),S(wt,F({ref(w){var y=ve(n.setTriggerRef,i.ref);typeof y=="function"&&y(w)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return i.id},get disabled(){return i.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 l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:f,onMouseOver:p,onClick:h,onKeyDown:g,onFocus:m,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var fd=be();function Bi(){return ye(fd)}function $r(){const e=Bi();if(e===void 0)throw new Error("[kobalte]: `useNavigationMenuContext` must be used within a `NavigationMenu` component");return e}function hd(e){let t;const n=St(),r=$t(),o=Fr(),s=Bi(),{direction:i}=Qt(),a=Z({id:n.generateId(`content-${Re()}`)},e),[l,u]=N(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),f=gv({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);Ac({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:v=>{var x;o===void 0&&((x=l.onOpenAutoFocus)==null||x.call(l,v))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=v=>{if(_e(v.currentTarget,v.target)&&(v.key==="Tab"&&r.isOpen()&&v.preventDefault(),o!==void 0&&v.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(v.key){case xr.next(i(),n.orientation()):v.stopPropagation(),v.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case xr.previous(i(),n.orientation()):if(v.currentTarget.hasAttribute("data-closed"))break;v.stopPropagation(),v.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},g=v=>{var x;(x=l.onEscapeKeyDown)==null||x.call(l,v),o==null||o.setAutoFocusMenu(!1),r.close(!0)},p=v=>{var x;(x=l.onFocusOutside)==null||x.call(l,v),n.isModal()&&v.preventDefault()},m=v=>{var x,C;oe(v,l.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(oe(v,l.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(l.id))),W(()=>r.setContentRef(void 0));const y={ref:ve(v=>{r.setContentRef(v),t=v},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:Se([l.onKeyDown,f.onKeyDown,h]),onMouseDown:Se([l.onMouseDown,f.onMouseDown]),onFocusIn:Se([l.onFocusIn,f.onFocusIn]),onFocusOut:Se([l.onFocusOut,f.onFocusOut]),onPointerEnter:m,onPointerMove:w,get"data-orientation"(){return n.orientation()}};return S(xe,{get when(){return r.contentPresent()},get children(){return S(xe,{get when(){return s===void 0||r.parentMenuContext()!=null},get fallback(){return S(ae,F({as:"div"},()=>r.dataset(),y,u))},get children(){return S(vo.Positioner,{get children(){return S(xi,F({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"},l.style)},onEscapeKeyDown:g,onFocusOutside:p,get onDismiss(){return r.close}},()=>r.dataset(),y,u))}})}})}})}function mv(e){let t;const n=St(),r=$t(),[o,s]=N(e,["ref"]);return Dc({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),S(hd,F({ref(i){var a=ve(l=>{t=l},o.ref);typeof a=="function"&&a(i)}},s))}var gd=be();function yv(){const e=ye(gd);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function pd(e){const t=St(),n=Z({id:t.generateId(`group-${Re()}`)},e),[r,o]=j(),s={generateId:vt(()=>n.id),registerLabelId:je(o)};return S(gd.Provider,{value:s,get children(){return S(ae,F({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function vv(e){const t=yv(),n=Z({id:t.generateId("label")},e),[r,o]=N(n,["id"]);return U(()=>W(t.registerLabelId(r.id))),S(ae,F({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function md(e){const t=$t(),n=Z({children:"▼"},e);return S(ae,F({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function wv(e){return S(ji,F({role:"menuitem",closeOnSelect:!0},e))}function bv(e){const t=Ki(),n=Z({id:t.generateId("description")},e),[r,o]=N(n,["id"]);return U(()=>W(t.registerDescription(r.id))),S(ae,F({as:"div",get id(){return r.id}},()=>t.dataset(),o))}function Sv(e){const t=Ki(),n=Z({id:t.generateId("indicator")},e),[r,o]=N(n,["forceMount"]);return S(xe,{get when(){return r.forceMount||t.isChecked()},get children(){return S(ae,F({as:"div"},()=>t.dataset(),o))}})}function xv(e){const t=Ki(),n=Z({id:t.generateId("label")},e),[r,o]=N(n,["ref","id"]);return U(()=>W(t.registerLabel(r.id))),S(ae,F({as:"div",ref(s){var i=ve(t.setLabelRef,r.ref);typeof i=="function"&&i(s)},get id(){return r.id}},()=>t.dataset(),o))}function Cv(e){const t=$t();return S(xe,{get when(){return t.contentPresent()},get children(){return S(oi,e)}})}var yd=be();function Ev(){const e=ye(yd);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Rv(e){const n=St().generateId(`radiogroup-${Re()}`),r=Z({id:n},e),[o,s]=N(r,["value","defaultValue","onChange","disabled"]),[i,a]=pt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:u=>{var c;return(c=o.onChange)==null?void 0:c.call(o,u)}}),l={isDisabled:()=>o.disabled,isSelectedValue:u=>u===i(),setSelectedValue:a};return S(yd.Provider,{value:l,get children(){return S(pd,s)}})}function Pv(e){const t=Ev(),n=Z({closeOnSelect:!1},e),[r,o]=N(n,["value","onSelect"]);return S(ji,F({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var i;(i=r.onSelect)==null||i.call(r),t.setSelectedValue(r.value)}},o))}function Iv(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),s=[],i=t.clientX,a=t.clientY;switch(r){case"top":s.push([i,a+5]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]);break;case"right":s.push([i-5,a]),s.push([o.left,o.top]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]);break;case"bottom":s.push([i,a-5]),s.push([o.right,o.top]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([o.left,o.top]);break;case"left":s.push([i+5,a]),s.push([o.right,o.bottom]),s.push([o.left,o.bottom]),s.push([o.left,o.top]),s.push([o.right,o.top]);break}return s}function Mv(e,t){return t?Ag([e.clientX,e.clientY],t):!1}function vd(e){const t=St(),n=ed(),r=wo(),o=Fr(),s=Bi(),i=Z({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=N(i,["open","defaultOpen","onOpenChange"]);let u=0,c=null,d="right";const[f,h]=j(),[g,p]=j(),[m,w]=j(),[y,v]=j(),[x,C]=j(!0),[O,L]=j(l.placement),[_,T]=j([]),[k,V]=j([]),{DomCollectionProvider:z}=tv({items:k,onItemsChange:V}),se=Ci({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:te=>{var Me;return(Me=a.onOpenChange)==null?void 0:Me.call(a,te)}}),{present:P}=wr({show:()=>t.forceMount()||se.isOpen(),element:()=>y()??null}),R=fv({selectionMode:"none",dataSource:k}),b=te=>{C(te),se.open()},I=(te=!1)=>{se.close(),te&&r&&r.close(!0)},M=te=>{C(te),se.toggle()},A=()=>{const te=y();te&&(Ie(te),R.selectionManager().setFocused(!0),R.selectionManager().setFocusedKey(void 0))},D=()=>{s!=null?setTimeout(()=>A()):A()},B=te=>{T(Pe=>[...Pe,te]);const Me=r==null?void 0:r.registerNestedMenu(te);return()=>{T(Pe=>Ts(Pe,te)),Me==null||Me()}},H=te=>d===(c==null?void 0:c.side)&&Mv(te,c==null?void 0:c.area),X=te=>{H(te)&&te.preventDefault()},le=te=>{H(te)||D()},ne=te=>{H(te)&&te.preventDefault()};Fc({isDisabled:()=>!(r==null&&se.isOpen()&&t.isModal()),targets:()=>[y(),..._()].filter(Boolean)}),U(()=>{const te=y();if(!te||!r)return;const Me=r.registerNestedMenu(te);W(()=>{Me()})}),U(()=>{r===void 0&&(o==null||o.registerMenu(t.value(),[y(),..._()]))}),U(()=>{var te;r!==void 0||o===void 0||(o.value()===t.value()?((te=m())==null||te.focus(),o.autoFocusMenu()&&b(!0)):I())}),U(()=>{r!==void 0||o===void 0||se.isOpen()&&o.setValue(t.value())}),W(()=>{r===void 0&&(o==null||o.unregisterMenu(t.value()))});const Je={dataset:K(()=>({"data-expanded":se.isOpen()?"":void 0,"data-closed":se.isOpen()?void 0:""})),isOpen:se.isOpen,contentPresent:P,nestedMenus:_,currentPlacement:O,pointerGraceTimeoutId:()=>u,autoFocus:x,listState:()=>R,parentMenuContext:()=>r,triggerRef:m,contentRef:y,triggerId:f,contentId:g,setTriggerRef:w,setContentRef:v,open:b,close:I,toggle:M,focusContent:D,onItemEnter:X,onItemLeave:le,onTriggerLeave:ne,setPointerDir:te=>d=te,setPointerGraceTimeoutId:te=>u=te,setPointerGraceIntent:te=>c=te,registerNestedMenu:B,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:je(h),registerContentId:je(p)};return S(z,{get children(){return S(ld.Provider,{value:Je,get children(){return S(xe,{when:s===void 0,get fallback(){return l.children},get children(){return S(vo,F({anchorRef:m,contentRef:y,onCurrentPlacementChange:L},l))}})}})}})}function Av(e){const{direction:t}=Qt();return S(vd,F({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Fv={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function $v(e){const t=$t(),n=St(),[r,o]=N(e,["onFocusOutside","onKeyDown"]),{direction:s}=Qt();return S(hd,F({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=>{oe(c,r.onKeyDown);const d=_e(c.currentTarget,c.target),f=Fv.close(s(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Ie(t.triggerRef()))}},o))}var Rl=["Enter"," "],Ov={open:(e,t)=>e==="ltr"?[...Rl,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Rl,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Tv(e){let t;const n=St(),r=$t(),o=Z({id:n.generateId(`sub-trigger-${Re()}`)},e),[s,i]=N(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:u}=Qt(),c=()=>s.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=id({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>s.disabled},()=>t),p=v=>{oe(v,s.onClick),!r.isOpen()&&!s.disabled&&r.open(!0)},m=v=>{var C;if(oe(v,s.onPointerMove),v.pointerType!=="mouse")return;const x=r.parentMenuContext();if(x==null||x.onItemEnter(v),!v.defaultPrevented){if(s.disabled){x==null||x.onItemLeave(v);return}!r.isOpen()&&!a&&((C=r.parentMenuContext())==null||C.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},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(oe(v,s.onPointerLeave),v.pointerType!=="mouse")return;l();const x=r.parentMenuContext(),C=r.contentRef();if(C){x==null||x.setPointerGraceIntent({area:Iv(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)},y=v=>{oe(v,s.onKeyDown),!v.repeat&&(s.disabled||Ov.open(u(),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:s.textValue??(t==null?void 0:t.textContent)??"",disabled:s.disabled??!1});W(v)}),U(Ee(()=>{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(s.id))),W(()=>{l()}),S(ae,F({as:"div",ref(v){var x=ve(C=>{r.setTriggerRef(C),t=C},s.ref);typeof x=="function"&&x(v)},get id(){return s.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 s.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return s.disabled?"":void 0},get onPointerDown(){return Se([s.onPointerDown,g.onPointerDown])},get onPointerUp(){return Se([s.onPointerUp,g.onPointerUp])},get onClick(){return Se([p,g.onClick])},get onKeyDown(){return Se([y,g.onKeyDown])},get onMouseDown(){return Se([s.onMouseDown,g.onMouseDown])},get onFocus(){return Se([s.onFocus,g.onFocus])},onPointerMove:m,onPointerLeave:w},()=>r.dataset(),i))}function Dv(e){const t=Fr(),n=`menu-${Re()}`,r=Z({id:n,modal:!0},e),[o,s]=N(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=Ci({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:l=>{var u;return(u=o.onOpenChange)==null?void 0:u.call(o,l)}}),a={isModal:()=>o.modal??!0,preventScroll:()=>o.preventScroll??a.isModal(),forceMount:()=>o.forceMount??!1,generateId:vt(()=>o.id),value:()=>o.value,orientation:()=>o.orientation??(t==null?void 0:t.orientation())??"horizontal"};return S(cd.Provider,{value:a,get children(){return S(vd,F({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},s))}})}function wd(e){const t=Wn(),n=Z({modal:!1},e),[r,o]=N(n,["value"]),s=Re(),i=t.generateId(`menubar-menu-${s}`),a=Z({id:i},o);return S(Dv,F({get value(){return r.value??s}},a))}function Lv(e){let t;const n=`menubar-${Re()}`,r=Z({id:n,loop:!0,orientation:"horizontal"},e),[o,s]=N(r,["ref","value","defaultValue","onValueChange","loop","focusOnAlt","autoFocusMenu","onAutoFocusMenuChange","orientation"]),[i,a]=pt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:y=>{var v;return(v=o.onValueChange)==null?void 0:v.call(o,y)}}),[l,u]=j(),[c,d]=j(new Map),[f,h]=pt({value:()=>o.autoFocusMenu,defaultValue:()=>!1,onChange:o.onAutoFocusMenuChange}),g=()=>{var y;return i()&&f()&&!((y=i())!=null&&y.includes("link-trigger-"))},m={dataset:K(()=>({"data-expanded":g()?"":void 0,"data-closed":g()?void 0:""})),value:i,setValue:a,lastValue:l,setLastValue:u,menus:()=>new Set([...c().keys()]),menuRefs:()=>[...c().values()].flat(),menuRefMap:()=>c(),registerMenu:(y,v)=>{d(x=>{const C=new Map;return x.forEach((O,L)=>C.set(L,O)),C.set(y,v),C})},unregisterMenu:y=>{d(v=>{v.delete(y);const x=new Map;return v.forEach((C,O)=>x.set(O,C)),x})},nextMenu:()=>{const y=[...c().keys()];if(i()==null){a(y[0]);return}const v=y.indexOf(i());if(v===y.length-1){o.loop&&a(y[0]);return}a(y[v+1])},previousMenu:()=>{const y=[...c().keys()];if(i()==null){a(y[0]);return}const v=y.indexOf(i());if(v===0){o.loop&&a(y[y.length-1]);return}a(y[v-1])},closeMenu:()=>{h(!1),a(void 0)},autoFocusMenu:()=>f(),setAutoFocusMenu:h,generateId:vt(()=>s.id),orientation:()=>o.orientation};U(()=>{i()==null&&h(!1)}),$c({onInteractOutside:()=>{m.closeMenu(),setTimeout(()=>m.closeMenu())},shouldExcludeElement:y=>[t,...c().values()].flat().some(v=>_e(v,y))},()=>t);const w=y=>{y.key==="Alt"&&(y.preventDefault(),y.stopPropagation(),m.value()===void 0?m.nextMenu():m.closeMenu())};return U(()=>{o.focusOnAlt?window.addEventListener("keydown",w):window.removeEventListener("keydown",w),W(()=>{window.removeEventListener("keydown",w)})}),U(()=>{i()!=null&&u(i())}),S(dd.Provider,{value:m,get children(){return S(ae,F({as:"div",ref(y){var v=ve(x=>t=x,o.ref);typeof v=="function"&&v(y)},role:"menubar",get"data-orientation"(){return o.orientation},get"aria-orientation"(){return o.orientation}},s))}})}function _v(e){const t=Wn();if(wo()===void 0&&Object.hasOwn(e,"href")){const r=t.generateId("link-trigger-")+Re();return S(wd,{value:r,get children(){return S(El,e)}})}return El(e)}var kv={};Yt(kv,{Root:()=>zi,Separator:()=>Vv});function zi(e){let t;const n=Z({orientation:"horizontal"},e),[r,o]=N(n,["ref","orientation"]),s=co(()=>t,()=>"hr");return S(ae,F({as:"hr",ref(i){var a=ve(l=>t=l,r.ref);typeof a=="function"&&a(i)},get role(){return s()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}var Vv=zi,bd=pe("<li role=presentation>"),Nv=pe("<nav>");function Kv(e){let t;const n=Wn(),r=Z({size:15},e),[o,s]=N(r,["ref"]),[i,a]=j(0),l=()=>n.orientation()==="horizontal";return U(Ee(n.value,u=>{setTimeout(()=>{if(!u||u.includes("link-trigger-"))return;const c=document.querySelector(`[data-kb-menu-value-trigger="${u}"]`);if(!c||!t)return;const d=c.getBoundingClientRect()[l()?"x":"y"]+c.getBoundingClientRect()[l()?"width":"height"]/2,f=window.getComputedStyle(t),h=t.getBoundingClientRect()[l()?"x":"y"]+t.getBoundingClientRect()[l()?"width":"height"]/2-Number.parseFloat(f.transform.split(",")[l()?4:5]);a(d-h)})})),S(Zc,F({ref(u){var c=ve(d=>t=d,o.ref);typeof c=="function"&&c(u)},get style(){return{transform:`translate${l()?"X":"Y"}(${i()}px)`,color:"red"}}},s))}function Sd(e){const t=$r(),n=Wn(),r=St(),[o,s]=j(),[i,a]=N(e,["onPointerEnter","onPointerLeave"]),l=c=>{oe(c,i.onPointerEnter),t.cancelLeaveTimer()},u=c=>{oe(c,i.onPointerLeave),t.startLeaveTimer()};return U(Ee(n.value,c=>{so(()=>{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()),m=g.indexOf(c);p<m?s("from-end"):s("from-start")}else s(void 0);t.setPreviousMenu(c);return}const d=[...n.menus()],f=d.indexOf(t.previousMenu()),h=d.indexOf(c);f>h?s("to-end"):s("to-start")})})),S(mv,F({as:"ul",onPointerEnter:l,onPointerLeave:u,onInteractOutside:()=>{t.setAutoFocusMenu(!1)},get"data-motion"(){return o()}},a))}function xd(e){return(()=>{var t=bd();return he(t,S(wv,F({as:"a"},e))),t})()}function Cd(e){const t=Wn(),n=$r(),[r,o]=N(e,["value"]),s=Re(),i=t.generateId(`navigation-menu-menu-${s}`),a=Z({id:i},o),l=()=>r.value??s,[u,c]=j(!1),d=()=>{var f,h;t.value()!==l()&&c(!1),(f=n.viewportRef())==null||f.removeEventListener("animationend",d),(h=n.viewportRef())==null||h.removeEventListener("animationcancel",d)};return U(Ee(t.value,f=>{if(f===l())c(!0);else{const h=n.viewportRef();if(!h||["","none"].includes(window.getComputedStyle(h).animationName)){c(!1);return}h.addEventListener("animationend",d)}})),S(wd,F({get forceMount(){return u()},get value(){return l()}},a))}function Ed(e){const t=$r(),n=$t(),[r,o]=N(e,["ref"]);return S(xe,{get when(){return t.viewportPresent()},get children(){return S(Cv,F({ref(s){var i=ve(a=>{a&&a.setAttribute("role","presentation")},r.ref);typeof i=="function"&&i(s)},get mount(){return K(()=>n.parentMenuContext()==null)()?t.viewportRef():void 0}},o))}})}function Rd(e){const t=Z({delayDuration:200,skipDelayDuration:300},e),[n,r,o]=N(t,["ref","delayDuration","skipDelayDuration","autoFocusMenu","onAutoFocusMenuChange","defaultValue","value","onValueChange","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"]),[s,i]=pt({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:T=>{var k;return(k=n.onValueChange)==null?void 0:k.call(n,T)}}),[a,l]=pt({value:()=>n.autoFocusMenu,defaultValue:()=>!1,onChange:n.onAutoFocusMenuChange}),[u,c]=j(),[d,f]=j(),[h,g]=j(r.placement??o.orientation==="vertical"?"right":"bottom");U(()=>{g(o.orientation==="vertical"?"right":"bottom")});let p;const[m,w]=j(),[y,v]=j(!1),[x,C]=j(!1);U(()=>{s()&&!s().includes("link-trigger-")&&a()?so(()=>{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||y()||x(),element:()=>u()??null});U(()=>{L()||_.setPreviousMenu(void 0)});const _={dataset:O,delayDuration:()=>n.delayDuration,skipDelayDuration:()=>n.skipDelayDuration,autoFocusMenu:a,setAutoFocusMenu:l,startLeaveTimer:()=>{p=window.setTimeout(()=>{_.setAutoFocusMenu(!1),i(void 0)},_.skipDelayDuration())},cancelLeaveTimer:()=>{p&&clearTimeout(p)},rootRef:d,setRootRef:f,viewportRef:u,setViewportRef:c,viewportPresent:L,currentPlacement:h,previousMenu:m,setPreviousMenu:w};return S(fd.Provider,{value:_,get children(){return S(vo,F({anchorRef:d,contentRef:u,get placement(){return h()},onCurrentPlacementChange:g},r,{get children(){var T=Nv();return he(T,S(Lv,F({as:"ul",ref(k){var V=ve(_.setRootRef,n.ref);typeof V=="function"&&V(k)},get value(){return s()??null},onValueChange:i,get autoFocusMenu(){return a()},onAutoFocusMenuChange:l},o))),T}}))}})}function Pd(e){const t=$r(),n=wo(),[r,o]=N(e,["onPointerEnter","onPointerLeave","onClick"]);let s;const i=u=>{oe(u,r.onClick),s&&clearTimeout(s)},a=u=>{oe(u,r.onPointerEnter),u.pointerType!=="touch"&&(t.cancelLeaveTimer(),t.dataset()["data-expanded"]!==""&&(s=window.setTimeout(()=>{var c;(c=n==null?void 0:n.triggerRef())==null||c.focus(),setTimeout(()=>{t.setAutoFocusMenu(!0)})},t.delayDuration())))},l=u=>{oe(u,r.onPointerLeave),u.pointerType!=="touch"&&(t.startLeaveTimer(),s&&clearTimeout(s))};return(()=>{var u=bd();return he(u,S(_v,F({onClick:i,onPointerEnter:a,onPointerLeave:l},o))),u})()}function Id(e){const t=$r(),n=Wn(),[r,o]=j(),[s,i]=N(e,["ref","style","onEscapeKeyDown"]),a=()=>{n.setAutoFocusMenu(!1),n.closeMenu()},l=f=>{a()},u=Um(r);U(Ee(()=>n.value()?n.menuRefMap().get(n.value()):void 0,f=>{f===void 0||f[0]===void 0||o(f[0])}));const c=K(f=>{if(!(r()===void 0||!t.viewportPresent()))return u.height()===0?f:u.height()}),d=K(f=>{if(!(r()===void 0||!t.viewportPresent()))return u.width()===0?f:u.width()});return S(xe,{get when(){return t.viewportPresent()},get children(){return S(vo.Positioner,{role:"presentation",get children(){return S(xi,F({as:"li",ref(f){var h=ve(t.setViewportRef,s.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"},s.style)},get onEscapeKeyDown(){return Se([s.onEscapeKeyDown,l])},onDismiss:a,get"data-orientation"(){return n.orientation()}},()=>t.dataset(),i))}})}})}Object.assign(Rd,{Arrow:Kv,CheckboxItem:pv,Content:Sd,Group:pd,GroupLabel:vv,Icon:md,Item:xd,ItemDescription:bv,ItemIndicator:Sv,ItemLabel:xv,Portal:Ed,RadioGroup:Rv,RadioItem:Pv,Menu:Cd,Separator:zi,Sub:Av,SubContent:$v,SubTrigger:Tv,Trigger:Pd,Viewport:Id});var jv=pe('<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 Bv=Cd,zv=e=>{const[t,n]=N(e,["class","children"]);return S(Rd,F({gutter:6,get class(){return ge("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),S(Uv,{})]}}))},Gv=e=>{const[t,n]=N(e,["class"]);return S(Pd,F({get class(){return ge("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))},Hv=()=>S(md,{"aria-hidden":"true",get children(){return jv()}}),Uv=e=>{const[t,n]=N(e,["class"]);return S(Id,F({get class(){return ge("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))},qv=e=>{const[t,n]=N(e,["class"]);return S(Ed,{get children(){return S(Sd,F({get class(){return ge("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))}})},ko=e=>{const[t,n]=N(e,["class"]);return S(xd,F({get class(){return ge("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 zt(e,t){return typeof e=="function"?e(t):e}function qe(e,t){return n=>{t.setState(r=>({...r,[e]:zt(n,r[e])}))}}function bo(e){return e instanceof Function}function Wv(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Xv(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function Y(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((c,d)=>r[d]!==c)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-i)*100)/100,d=Math.round((Date.now()-u)*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 o}}function Q(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function Yv(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Y(()=>[e,n,t,s],(i,a,l,u)=>({table:i,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),Q(e.options,"debugCells"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Qv(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(o=(s=a.id)!=null?s:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,c;if(a.accessorFn?c=a.accessorFn:l&&(l.includes(".")?c=f=>{let h=f;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p]}return h}:c=f=>f[a.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:c,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Y(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},Q(e.options,"debugColumns")),getLeafColumns:Y(()=>[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]},Q(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const $e="debugHeaders";function Pl(e,t,n){var r;let s={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 i=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),i.push(l)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const Zv={createTable:e=>{e.getHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?s:[],l=(i=o==null?void 0:o.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?i:[],u=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Br(t,[...a,...u,...l],e)},Q(e.options,$e)),e.getCenterHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),Br(t,n,e,"center")),Q(e.options,$e)),e.getLeftHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Br(t,s,e,"left")},Q(e.options,$e)),e.getRightHeaderGroups=Y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return Br(t,s,e,"right")},Q(e.options,$e)),e.getFooterGroups=Y(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Q(e.options,$e)),e.getLeftFooterGroups=Y(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Q(e.options,$e)),e.getCenterFooterGroups=Y(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Q(e.options,$e)),e.getRightFooterGroups=Y(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Q(e.options,$e)),e.getFlatHeaders=Y(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,$e)),e.getLeftFlatHeaders=Y(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,$e)),e.getCenterFlatHeaders=Y(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,$e)),e.getRightFlatHeaders=Y(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Q(e.options,$e)),e.getCenterLeafHeaders=Y(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,$e)),e.getLeftLeafHeaders=Y(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,$e)),e.getRightLeafHeaders=Y(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Q(e.options,$e)),e.getLeafHeaders=Y(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,l,u;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(c=>c.getLeafHeaders()).flat()},Q(e.options,$e))}};function Br(e,t,n,r){var o,s;let i=0;const a=function(f,h){h===void 0&&(h=1),i=Math.max(i,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 l=[];const u=(f,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(m=>{const w=[...p].reverse()[0],y=m.column.depth===g.depth;let v,x=!1;if(y&&m.column.parent?v=m.column.parent:(v=m.column,x=!0),w&&(w==null?void 0:w.column)===v)w.subHeaders.push(m);else{const C=Pl(n,v,{id:[r,h,v.id,m==null?void 0:m.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(m),p.push(C)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&u(p,h-1)},c=t.map((f,h)=>Pl(n,f,{depth:i,index:h}));u(c,i-1),l.reverse();const d=f=>f.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=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 y=Math.min(...w);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return d((o=(s=l[0])==null?void 0:s.headers)!=null?o:[]),l}const Gi=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Xv(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const c=u.getParentRow();if(!c)break;l.push(c),u=c}return l.reverse()},getAllCells:Y(()=>[e.getAllLeafColumns()],l=>l.map(u=>Yv(e,a,u,u.id)),Q(e.options,"debugRows")),_getAllCellsByColumnId:Y(()=>[a.getAllCells()],l=>l.reduce((u,c)=>(u[c.column.id]=c,u),{}),Q(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const u=e._features[l];u==null||u.createRow==null||u.createRow(a,e)}return a},Jv={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()}}},Md=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};Md.autoRemove=e=>rt(e);const Ad=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ad.autoRemove=e=>rt(e);const Fd=(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())};Fd.autoRemove=e=>rt(e);const $d=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};$d.autoRemove=e=>rt(e)||!(e!=null&&e.length);const Od=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Od.autoRemove=e=>rt(e)||!(e!=null&&e.length);const Td=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Td.autoRemove=e=>rt(e)||!(e!=null&&e.length);const Dd=(e,t,n)=>e.getValue(t)===n;Dd.autoRemove=e=>rt(e);const Ld=(e,t,n)=>e.getValue(t)==n;Ld.autoRemove=e=>rt(e);const Hi=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};Hi.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]};Hi.autoRemove=e=>rt(e)||rt(e[0])&&rt(e[1]);const Et={includesString:Md,includesStringSensitive:Ad,equalsString:Fd,arrIncludes:$d,arrIncludesAll:Od,arrIncludesSome:Td,equals:Dd,weakEquals:Ld,inNumberRange:Hi};function rt(e){return e==null||e===""}const ew={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 bo(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,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!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(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(c=>c.id===e.id),i=zt(n,s?s.value:void 0);if(Il(o,i,e)){var a;return(a=r==null?void 0:r.filter(c=>c.id!==e.id))!=null?a:[]}const l={id:e.id,value:i};if(s){var u;return(u=r==null?void 0:r.map(c=>c.id===e.id?l:c))!=null?u:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=zt(t,o))==null?void 0:s.filter(i=>{const a=n.find(l=>l.id===i.id);if(a){const l=a.getFilterFn();if(Il(l,i.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 Il(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const tw=(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),nw=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},rw=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},ow=(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},sw=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},iw=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!Wv(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},aw=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),lw=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,uw=(e,t)=>t.length,Vo={sum:tw,min:nw,max:rw,extent:ow,mean:sw,median:iw,unique:aw,uniqueCount:lw,count:uw},cw={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 Vo.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Vo.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return bo(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:Vo[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 o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function dw(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const fw={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:qe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Y(n=>[cr(t,n)],n=>n.findIndex(r=>r.id===e.id),Q(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 o=cr(t,n);return((r=o[o.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=Y(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const l=i.shift(),u=a.findIndex(c=>c.id===l);u>-1&&s.push(a.splice(u,1)[0])}s=[...s,...a]}return dw(s,n,r)},Q(e.options,"debugTable"))}},No=()=>({left:[],right:[]}),hw={getInitialState:e=>({columnPinning:No(),...e}),getDefaultOptions:e=>({onColumnPinningChange:qe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var u,c;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((c=o==null?void 0:o.right)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},Q(t.options,"debugRows")),e.getLeftVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),Q(t.options,"debugRows")),e.getRightVisibleCells=Y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),Q(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?No():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:No())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Q(e.options,"debugColumns")),e.getRightLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Q(e.options,"debugColumns")),e.getCenterLeafColumns=Y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},Q(e.options,"debugColumns"))}},zr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ko=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),gw={getDefaultColumnDef:()=>zr,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ko(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:qe("columnSizing",e),onColumnSizingInfoChange:qe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:zr.minSize,(r=s??e.columnDef.size)!=null?r:zr.size),(o=e.columnDef.maxSize)!=null?o:zr.maxSize)},e.getStart=Y(n=>[n,cr(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),Q(t.options,"debugColumns")),e.getAfter=Y(n=>[n,cr(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),Q(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},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=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s: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),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),jo(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=jo(s)?Math.round(s.touches[0].clientX):s.clientX,u={},c=(w,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(v=>{var x,C;const O=t.options.columnResizeDirection==="rtl"?-1:1,L=(y-((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[k,V]=T;u[k]=Math.round(Math.max(V+V*_,0)*100)/100}),{...v,deltaOffset:L,deltaPercentage:_}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(v=>({...v,...u})))},d=w=>c("move",w),f=w=>{c("end",w),t.setColumnSizingInfo(y=>({...y,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 y;h==null||h.removeEventListener("touchmove",p.moveHandler),h==null||h.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((y=w.touches[0])==null?void 0:y.clientX)}},m=pw()?{passive:!1}:!1;jo(s)?(h==null||h.addEventListener("touchmove",p.moveHandler,m),h==null||h.addEventListener("touchend",p.upHandler,m)):(h==null||h.addEventListener("mousemove",g.moveHandler,m),h==null||h.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:i,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?Ko():(n=e.initialState.columnSizingInfo)!=null?n:Ko())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Gr=null;function pw(){if(typeof Gr=="boolean")return Gr;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 Gr=e,Gr}function jo(e){return e.type==="touchstart"}const mw={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 o=e.columns;return(n=o.length?o.some(s=>s.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=Y(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Q(t.options,"debugRows")),e.getVisibleCells=Y(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Q(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Y(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),Q(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((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.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 yw={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()}}},vw={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,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Et.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return bo(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)}}},ww={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:qe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o: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 o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},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(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.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 o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...l}=i;return l}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,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.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()}}}},Hs=0,Us=10,Bo=()=>({pageIndex:Hs,pageSize:Us}),bw={getInitialState:e=>({...e,pagination:{...Bo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:qe("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>zt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Bo():(o=e.initialState.pagination)!=null?o:Bo())},e.setPageIndex=r=>{e.setPagination(o=>{let s=zt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?Hs:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:Hs)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?Us:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:Us)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,zt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=zt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=Y(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},Q(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-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}}},zo=()=>({top:[],bottom:[]}),Sw={getInitialState:e=>({rowPinning:zo(),...e}),getDefaultOptions:e=>({onRowPinningChange:qe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],i=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(l=>{var u,c;if(n==="bottom"){var d,f;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l==null?void 0:l.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((u=l==null?void 0:l.top)!=null?u:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((c=l==null?void 0:l.bottom)!=null?c:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.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?zo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:zo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Q(e.options,"debugRows")),e.getBottomRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Q(e.options,"debugRows")),e.getCenterRows=Y(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},Q(e.options,"debugRows"))}},xw={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},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{qs(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable")),e.getFilteredSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Q(e.options,"debugTable")),e.getGroupedSelectedRowModel=Y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Q(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(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.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 o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return qs(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Ui(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Ws(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Ws(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 o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},qs=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>qs(e,a.id,n,r,o))};function Go(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(l=>{var u;const c=Ui(l,n);if(c&&(r.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:s(l.subRows)}),c)return l}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function Ui(e,t){var n;return(n=t[e.id])!=null?n:!1}function Ws(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(Ui(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=Ws(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Xs=/([0-9]+)/gm,Cw=(e,t,n)=>_d(Xt(e.getValue(n)).toLowerCase(),Xt(t.getValue(n)).toLowerCase()),Ew=(e,t,n)=>_d(Xt(e.getValue(n)),Xt(t.getValue(n))),Rw=(e,t,n)=>qi(Xt(e.getValue(n)).toLowerCase(),Xt(t.getValue(n)).toLowerCase()),Pw=(e,t,n)=>qi(Xt(e.getValue(n)),Xt(t.getValue(n))),Iw=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Mw=(e,t,n)=>qi(e.getValue(n),t.getValue(n));function qi(e,t){return e===t?0:e>t?1:-1}function Xt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function _d(e,t){const n=e.split(Xs).filter(Boolean),r=t.split(Xs).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),l=[i,a].sort();if(isNaN(l[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(l[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const nr={alphanumeric:Cw,alphanumericCaseSensitive:Ew,text:Rw,textCaseSensitive:Pw,datetime:Iw,basic:Mw},Aw={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 o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return nr.datetime;if(typeof s=="string"&&(r=!0,s.split(Xs).length>1))return nr.alphanumeric}return r?nr.text:nr.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 bo(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:nr[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(h=>h.id===e.id),l=i==null?void 0:i.findIndex(h=>h.id===e.id);let u=[],c,d=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?c="toggle":c="add":i!=null&&i.length&&l!==i.length-1?c="replace":a?c="toggle":c="replace",c==="toggle"&&(s||o||(c="remove")),c==="add"){var f;u=[...i,{id:e.id,desc:d}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else c==="toggle"?u=i.map(h=>h.id===e.id?{...h,desc:d}:h):c==="remove"?u=i.filter(h=>h.id!==e.id):u=[{id:e.id,desc:d}];return u})},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,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},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(o=>o.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(o=>o.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())}},Fw=[Zv,mw,fw,hw,Jv,ew,yw,vw,Aw,cw,ww,bw,Sw,xw,gw];function $w(e){var t,n;const r=[...Fw,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),i=f=>o.options.mergeOptions?o.options.mergeOptions(s,f):{...s,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var h;l=(h=f.getInitialState==null?void 0:f.getInitialState(l))!=null?h:l});const u=[];let c=!1;const d={_features:r,options:{...s,...e},initialState:l,_queue:f=>{u.push(f),c||(c=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();c=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const h=zt(f,o.options);o.options=i(h)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(f,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!g&&(g=o.getCoreRowModel().rowsById[f],!g))throw new Error;return g},_getDefaultColumnDef:Y(()=>[o.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,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},Q(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Y(()=>[o._getColumnDefs()],f=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(w=>{const y=Qv(o,w,m,p),v=w;return y.columns=v.columns?h(v.columns,y,m+1):[],y})};return h(f)},Q(e,"debugColumns")),getAllFlatColumns:Y(()=>[o.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),Q(e,"debugColumns")),_getAllFlatColumnsById:Y(()=>[o.getAllFlatColumns()],f=>f.reduce((h,g)=>(h[g.id]=g,h),{}),Q(e,"debugColumns")),getAllLeafColumns:Y(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,h)=>{let g=f.flatMap(p=>p.getLeafColumns());return h(g)},Q(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,d);for(let f=0;f<o._features.length;f++){const h=o._features[f];h==null||h.createTable==null||h.createTable(o)}return o}function Ow(){return e=>Y(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let u=0;u<o.length;u++){const c=Gi(e,e._getRowId(o[u],u,i),o[u],u,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows){var l;c.originalSubRows=e.options.getSubRows(o[u],u),(l=c.originalSubRows)!=null&&l.length&&(c.subRows=r(c.originalSubRows,s+1,c))}}return a};return n.rows=r(t),n},Q(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Tw(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Dw(e,t,n){return n.options.filterFromLeafRows?Lw(e,t,n):_w(e,t,n)}function Lw(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,u){u===void 0&&(u=0);const c=[];for(let f=0;f<l.length;f++){var d;let h=l[f];const g=Gi(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(d=h.subRows)!=null&&d.length&&u<i){if(g.subRows=a(h.subRows,u+1),h=g,t(h)&&!g.subRows.length){c.push(h),s[h.id]=h,o.push(h);continue}if(t(h)||g.subRows.length){c.push(h),s[h.id]=h,o.push(h);continue}}else h=g,t(h)&&(c.push(h),s[h.id]=h,o.push(h))}return c};return{rows:a(e),flatRows:o,rowsById:s}}function _w(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,u){u===void 0&&(u=0);const c=[];for(let f=0;f<l.length;f++){let h=l[f];if(t(h)){var d;if((d=h.subRows)!=null&&d.length&&u<i){const p=Gi(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);p.subRows=a(h.subRows,u+1),h=p}c.push(h),o.push(h),s[h.id]=h}}return c};return{rows:a(e),flatRows:o,rowsById:s}}function kw(){return e=>Y(()=>[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 o=[],s=[];(n??[]).forEach(f=>{var h;const g=e.getColumn(f.id);if(!g)return;const p=g.getFilterFn();p&&o.push({id:f.id,filterFn:p,resolvedValue:(h=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?h:f.value})});const i=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&l.length&&(i.push("__global__"),l.forEach(f=>{var h;s.push({id:f.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?h:r})}));let u,c;for(let f=0;f<t.flatRows.length;f++){const h=t.flatRows[f];if(h.columnFilters={},o.length)for(let g=0;g<o.length;g++){u=o[g];const p=u.id;h.columnFilters[p]=u.filterFn(h,p,u.resolvedValue,m=>{h.columnFiltersMeta[p]=m})}if(s.length){for(let g=0;g<s.length;g++){c=s[g];const p=c.id;if(c.filterFn(h,p,c.resolvedValue,m=>{h.columnFiltersMeta[p]=m})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const d=f=>{for(let h=0;h<i.length;h++)if(f.columnFilters[i[h]]===!1)return!1;return!0};return Dw(t.rows,d,e)},Q(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Vw(e){return t=>Y(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:s}=n;let{rows:i,flatRows:a,rowsById:l}=r;const u=o*s,c=u+o;i=i.slice(u,c);let d;t.options.paginateExpandedRows?d={rows:i,flatRows:a,rowsById:l}:d=Tw({rows:i,flatRows:a,rowsById:l}),d.flatRows=[];const f=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(f)};return d.rows.forEach(f),d},Q(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 Ml(e,t){return e?typeof e=="function"?S(e,t):e:null}function Nw(e){const t=F({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(s,i)=>F(s,i)},e),n=$w(t),[r,o]=lo(n.initialState);return At(()=>{n.setOptions(s=>F(s,e,{state:F(r,e.state||{}),onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}}))}),n}var So=pe("<li>"),Kw=pe("<ul>"),jw={};Yt(jw,{Ellipsis:()=>Wi,Item:()=>Xi,Items:()=>Yi,Next:()=>Qi,Pagination:()=>Bw,Previous:()=>Zi,Root:()=>Ji});function Wi(e){return(()=>{var t=So();return he(t,S(ae,F({as:"div"},e))),t})()}var kd=be();function xo(){const e=ye(kd);if(e===void 0)throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");return e}function Xi(e){const t=xo(),[n,r]=N(e,["page","onClick"]),o=()=>t.page()===n.page,s=()=>{t.setPage(n.page)};return(()=>{var i=So();return he(i,S(wt,F({get"aria-current"(){return o()?"page":void 0},get"data-current"(){return o()?"":void 0},get onClick(){return Se([n.onClick,s])}},r))),i})()}function Yi(e){const t=xo(),n=K(()=>{const{count:r,siblingCount:o,page:s,fixedItems:i,showFirst:a,showLast:l}=t,u=r()<2*o()+(i()?6:4);if(u)return{renderItemsDirectly:u};const c=a()&&s()-1>o(),d=l()&&r()-s()>o();let f=s()-(a()?2:1)>o(),h=r()-s()-(l()?1:0)>o(),g=Math.min(s()-1,o()),p=Math.min(r()-s(),o());if(i()!==!1){const m=g,w=p;g+=Math.max(o()-w,0),p+=Math.max(o()-m,0),c||p++,d||g++,i()===!0&&(f||p++,h||g++),s()-g-(a()?2:1)===1&&(f=!1,g++),r()-s()-p-(l()?1:0)===1&&(h=!1,p++)}return{showFirst:c,showLast:d,showFirstEllipsis:f,showLastEllipsis:h,previousSiblingCount:g,nextSiblingCount:p,renderItemsDirectly:u}});return S(xe,{get when(){return n().renderItemsDirectly},get fallback(){return[S(xe,{get when(){return n().showFirst},get children(){return t.renderItem(1)}}),S(xe,{get when(){return n().showFirstEllipsis},get children(){return t.renderEllipsis()}}),S(Mt,{get each(){return[...Array(n().previousSiblingCount).keys()].reverse()},children:r=>K(()=>t.renderItem(t.page()-(r+1)))}),K(()=>t.renderItem(t.page())),S(Mt,{get each(){return[...Array(n().nextSiblingCount).keys()]},children:r=>K(()=>t.renderItem(t.page()+(r+1)))}),S(xe,{get when(){return n().showLastEllipsis},get children(){return t.renderEllipsis()}}),S(xe,{get when(){return n().showLast},get children(){return t.renderItem(t.count())}})]},get children(){return S(Mt,{get each(){return[...Array(t.count()).keys()]},children:r=>K(()=>t.renderItem(r+1))})}})}function Qi(e){const t=xo(),[n,r]=N(e,["onClick"]),o=()=>{t.setPage(t.page()+1)},s=()=>t.page()===t.count();return(()=>{var i=So();return he(i,S(wt,F({get tabIndex(){return s()||t.page()===t.count()?-1:void 0},get disabled(){return s()},get"aria-disabled"(){return s()||void 0},get"data-disabled"(){return s()?"":void 0},get onClick(){return Se([n.onClick,o])}},r))),i})()}function Zi(e){const t=xo(),[n,r]=N(e,["onClick"]),o=()=>{t.setPage(t.page()-1)},s=()=>t.page()===1;return(()=>{var i=So();return he(i,S(wt,F({get tabIndex(){return s()||t.page()===1?-1:void 0},get disabled(){return s()},get"aria-disabled"(){return s()||void 0},get"data-disabled"(){return s()?"":void 0},get onClick(){return Se([n.onClick,o])}},r))),i})()}function Ji(e){const t=`pagination-${Re()}`,n=Z({id:t},e),[r,o]=N(n,["page","defaultPage","onPageChange","count","siblingCount","showFirst","showLast","fixedItems","itemComponent","ellipsisComponent","disabled","children"]),s=pt({defaultValue:()=>r.defaultPage??1,onChange:r.onPageChange,value:()=>r.page}),i={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(s[0]()??1,r.count),setPage:s[1]};return S(kd.Provider,{value:i,get children(){return S(ae,F({as:"nav",get"data-disabled"(){return r.disabled?"":void 0}},o,{get children(){var a=Kw();return he(a,()=>r.children),a}}))}})}var Bw=Object.assign(Ji,{Ellipsis:Wi,Item:Xi,Items:Yi,Next:Qi,Previous:Zi});const Co=ho("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"}}),Al=e=>{const[t,n]=N(e,["variant","size","class"]);return S(wt,F({get class(){return ge(Co({variant:t.variant,size:t.size}),t.class)}},n))};var zw=pe('<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>'),Gw=pe("<span class=sr-only>More pages"),Hw=pe('<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">'),Uw=pe("<span>Previous"),qw=pe("<span>Next"),Ww=pe('<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 Xw=Yi,Yw=e=>{const[t,n]=N(e,["class"]);return S(Ji,F({get class(){return ge("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1",t.class)}},n))},Qw=e=>{const[t,n]=N(e,["class"]);return S(Xi,F({get class(){return ge(Co({variant:"ghost"}),"size-10 data-[current]:border",t.class)}},n))},Zw=e=>{const[t,n]=N(e,["class"]);return S(Wi,F({get class(){return ge("flex size-10 items-center justify-center",t.class)}},n,{get children(){return[zw(),Gw()]}}))},Jw=e=>{const[t,n]=N(e,["class","children"]);return S(Zi,F({get class(){return ge(Co({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[Hw(),Uw()]}}))},eb=e=>{const[t,n]=N(e,["class","children"]);return S(Qi,F({get class(){return ge(Co({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[qw(),Ww()]}}))};var tb=pe('<div class="relative w-full overflow-auto"><table>'),nb=pe("<thead>"),rb=pe("<tbody>"),ob=pe("<tr>"),sb=pe("<th>"),ib=pe("<td>");const ab=e=>{const[t,n]=N(e,["class"]);return(()=>{var r=tb(),o=r.firstChild;return it(o,F({get class(){return ge("w-full caption-bottom text-sm",t.class)}},n),!1,!1),r})()},lb=e=>{const[t,n]=N(e,["class"]);return(()=>{var r=nb();return it(r,F({get class(){return ge("[&_tr]:border-b",t.class)}},n),!1,!1),r})()},ub=e=>{const[t,n]=N(e,["class"]);return(()=>{var r=rb();return it(r,F({get class(){return ge("[&_tr:last-child]:border-0",t.class)}},n),!1,!1),r})()},Ho=e=>{const[t,n]=N(e,["class"]);return(()=>{var r=ob();return it(r,F({get class(){return ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t.class)}},n),!1,!1),r})()},cb=e=>{const[t,n]=N(e,["class"]);return(()=>{var r=sb();return it(r,F({get class(){return ge("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()},Fl=e=>{const[t,n]=N(e,["class"]);return(()=>{var r=ib();return it(r,F({get class(){return ge("p-4 align-middle [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()};var db=pe('<div><div class="flex flex-row justify-end p-3"></div><div class="border rounded-md">');const fb=20;function hb(e){const[t]=N(e,["columns","data","onRowClick"]),[n,r]=j(null),[o,s]=j({pageIndex:0,pageSize:fb}),i=Nw({get data(){return t.data()||[]},columns:t.columns,getCoreRowModel:Ow(),getPaginationRowModel:Vw(),getFilteredRowModel:kw(),state:{get pagination(){return o()},get globalFilter(){return n()}},onPaginationChange:s,globalFilterFn:(l,u,c)=>c?l.original.platform.toLowerCase()===c:!0,manualPagination:!1}),a=l=>()=>{t.onRowClick(l.original)};return(()=>{var l=db(),u=l.firstChild,c=u.nextSibling;return he(u,S(zv,{get children(){return S(Bv,{get children(){return[S(Gv,{get children(){return[K(()=>K(()=>!!n())()?n():"All"),S(Hv,{})]}}),S(qv,{get children(){return[S(ko,{onClick:()=>r(null),children:"All"}),S(ko,{onClick:()=>r("ios"),children:"iOS"}),S(ko,{onClick:()=>r("android"),children:"Android"})]}})]}})}})),he(c,S(ab,{get children(){return[S(lb,{get children(){return S(Mt,{get each(){return i.getHeaderGroups()},children:d=>S(Ho,{get children(){return S(Mt,{get each(){return d.headers},children:f=>S(cb,{get children(){return K(()=>!!f.isPlaceholder)()?null:Ml(f.column.columnDef.header,f.getContext())}})})}})})}}),S(ub,{get children(){return K(()=>{var d;return!!((d=i.getRowModel().rows)!=null&&d.length)})()?S(Mt,{get each(){return i.getRowModel().rows},children:d=>S(Ho,{get"data-state"(){return d.getIsSelected()&&"selected"},class:"cursor-pointer",get onClick(){return a(d)},get children(){return S(Mt,{get each(){return d.getVisibleCells()},children:f=>S(Fl,{get children(){return Ml(f.column.columnDef.cell,f.getContext())}})})}})}):S(Ho,{get children(){return S(Fl,{get colSpan(){return t.columns.length},class:"h-24 text-center",children:"No results."})}})}})]}})),he(l,S(Yw,{class:"mt-2.5 w-full [&>ul]:justify-center",itemComponent:d=>S(Qw,{get page(){return d.page},onClick:()=>i.setPageIndex(d.page-1),get children(){return d.page}}),ellipsisComponent:()=>S(Zw,{}),get count(){var d;return Math.ceil((((d=t.data())==null?void 0:d.length)??0)/o().pageSize)},get children(){return[S(Jw,{onClick:()=>i.previousPage(),get disabled(){return!i.getCanPreviousPage()}}),S(Xw,{}),S(eb,{onClick:()=>i.nextPage(),get disabled(){return!i.getCanNextPage()}})]}}),null),l})()}var gb={};Yt(gb,{Root:()=>ea,Skeleton:()=>pb});function ea(e){const t=`skeleton-${Re()}`,n=Z({visible:!0,animate:!0,id:t},e),[r,o]=N(n,["style","radius","animate","height","width","visible","circle"]);return S(ae,F({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)}},o))}var pb=ea;const mb=e=>{const[t,n]=N(e,["class"]);return S(ea,F({get class(){return ge("bg-primary/10 data-[animate='true']:animate-pulse",t.class)}},n))};var Vd=["id","name","validationState","required","disabled","readOnly"];function Nd(e){const t=`form-control-${Re()}`,n=Z({id:t},e),[r,o]=j(),[s,i]=j(),[a,l]=j(),[u,c]=j(),d=(p,m,w)=>{const y=w!=null||r()!=null;return[w,r(),y&&m!=null?p:void 0].filter(Boolean).join(" ")||void 0},f=p=>[a(),u(),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:s,descriptionId:a,errorMessageId:u,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:vt(()=>$(n.id)),registerLabel:je(o),registerField:je(i),registerDescription:je(l),registerErrorMessage:je(c)}}}var ta=be();function Zt(){const e=ye(ta);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function na(e){const t=Zt(),n=Z({id:t.generateId("description")},e);return U(()=>W(t.registerDescription(n.id))),S(ae,F({as:"div"},()=>t.dataset(),n))}function ra(e){const t=Zt(),n=Z({id:t.generateId("error-message")},e),[r,o]=N(n,["forceMount"]),s=()=>t.validationState()==="invalid";return U(()=>{s()&&W(t.registerErrorMessage(o.id))}),S(xe,{get when(){return r.forceMount||s()},get children(){return S(ae,F({as:"div"},()=>t.dataset(),o))}})}function Eo(e){let t;const n=Zt(),r=Z({id:n.generateId("label")},e),[o,s]=N(r,["ref"]),i=co(()=>t,()=>"label");return U(()=>W(n.registerLabel(s.id))),S(ae,F({as:"label",ref(a){var l=ve(u=>t=u,o.ref);typeof l=="function"&&l(a)},get for(){return K(()=>i()==="label")()?n.fieldId():void 0}},()=>n.dataset(),s))}var Kd=["id","aria-label","aria-labelledby","aria-describedby"];function jd(e){const t=Zt(),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 Bd(e,t){U(Ee(e,n=>{if(n==null)return;const r=yb(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),W(()=>{r.removeEventListener("reset",t)}))}))}function yb(e){return vb(e)?e.form:e.closest("form")}function vb(e){return e.matches("textarea, input, select, button")}var wb={};Yt(wb,{Control:()=>oa,Description:()=>Gd,ErrorMessage:()=>Hd,Input:()=>sa,Label:()=>ia,Root:()=>aa,Switch:()=>Sb,Thumb:()=>la});var zd=be();function Xn(){const e=ye(zd);if(e===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return e}function oa(e){const t=Zt(),n=Xn(),r=Z({id:n.generateId("control")},e),[o,s]=N(r,["onClick","onKeyDown"]);return S(ae,F({as:"div",onClick:l=>{var u;oe(l,o.onClick),n.toggle(),(u=n.inputRef())==null||u.focus()},onKeyDown:l=>{var u;oe(l,o.onKeyDown),l.key===fi.Space&&(n.toggle(),(u=n.inputRef())==null||u.focus())}},()=>t.dataset(),()=>n.dataset(),s))}function Gd(e){const t=Xn();return S(na,F(()=>t.dataset(),e))}function Hd(e){const t=Xn();return S(ra,F(()=>t.dataset(),e))}function sa(e){const t=Zt(),n=Xn(),r=Z({id:n.generateId("input")},e),[o,s,i]=N(r,["ref","style","onChange","onFocus","onBlur"],Kd),{fieldProps:a}=jd(s);return S(ae,F({as:"input",ref(d){var f=ve(n.setInputRef,o.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({...lc},o.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=>{oe(d,o.onChange),d.stopPropagation();const f=d.target;n.setIsChecked(f.checked),f.checked=n.checked()},onFocus:d=>{oe(d,o.onFocus),n.setIsFocused(!0)},onBlur:d=>{oe(d,o.onBlur),n.setIsFocused(!1)}},()=>t.dataset(),()=>n.dataset(),i))}function ia(e){const t=Xn();return S(Eo,F(()=>t.dataset(),e))}function aa(e){let t;const n=`switch-${Re()}`,r=Z({value:"on",id:n},e),[o,s,i]=N(r,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],Vd),[a,l]=j(),[u,c]=j(!1),{formControlContext:d}=Nd(s),f=ad({isSelected:()=>o.checked,defaultIsSelected:()=>o.defaultChecked,onSelectedChange:m=>{var w;return(w=o.onChange)==null?void 0:w.call(o,m)},isDisabled:()=>d.isDisabled(),isReadOnly:()=>d.isReadOnly()});Bd(()=>t,()=>f.setIsSelected(o.defaultChecked??!1));const h=m=>{oe(m,o.onPointerDown),u()&&m.preventDefault()},g=K(()=>({"data-checked":f.isSelected()?"":void 0})),p={value:()=>o.value,dataset:g,checked:()=>f.isSelected(),inputRef:a,generateId:vt(()=>$(s.id)),toggle:()=>f.toggle(),setIsChecked:m=>f.setIsSelected(m),setIsFocused:c,setInputRef:l};return S(ta.Provider,{value:d,get children(){return S(zd.Provider,{value:p,get children(){return S(ae,F({as:"div",ref(m){var w=ve(y=>t=y,o.ref);typeof w=="function"&&w(m)},role:"group",get id(){return $(s.id)},onPointerDown:h},()=>d.dataset(),g,i,{get children(){return S(bb,{state:p,get children(){return o.children}})}}))}})}})}function bb(e){const t=io(()=>{const n=e.children;return di(n)?n(e.state):n});return K(t)}function la(e){const t=Zt(),n=Xn(),r=Z({id:n.generateId("thumb")},e);return S(ae,F({as:"div"},()=>t.dataset(),()=>n.dataset(),r))}var Sb=Object.assign(aa,{Control:oa,Description:Gd,ErrorMessage:Hd,Input:sa,Label:ia,Thumb:la});const $l=aa,Ol=e=>{const[t,n]=N(e,["class","children"]);return[S(sa,{get class(){return ge("[&: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)}}),S(oa,F({get class(){return ge("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}}))]},Tl=e=>{const[t,n]=N(e,["class"]);return S(la,F({get class(){return ge("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))},Dl=e=>{const[t,n]=N(e,["class"]);return S(ia,F({get class(){return ge("text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",t.class)}},n))};var xb={};Yt(xb,{Description:()=>na,ErrorMessage:()=>ra,Input:()=>ua,Label:()=>Eo,Root:()=>ca,TextArea:()=>Xd,TextField:()=>Eb});var Ud=be();function qd(){const e=ye(Ud);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function ua(e){return S(Wd,F({type:"text"},e))}function Wd(e){const t=Zt(),n=qd(),r=Z({id:n.generateId("input")},e),[o,s,i]=N(r,["onInput"],Kd),{fieldProps:a}=jd(s);return S(ae,F({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 Se([o.onInput,n.onInput])}},()=>t.dataset(),i))}function ca(e){let t;const n=`textfield-${Re()}`,r=Z({id:n},e),[o,s,i]=N(r,["ref","value","defaultValue","onChange"],Vd),a=o.value,[l,u]=pt({value:()=>a===void 0?void 0:o.value??"",defaultValue:()=>o.defaultValue,onChange:h=>{var g;return(g=o.onChange)==null?void 0:g.call(o,h)}}),{formControlContext:c}=Nd(s);Bd(()=>t,()=>u(o.defaultValue??""));const d=h=>{if(c.isReadOnly()||c.isDisabled())return;const g=h.target;u(g.value),g.value=l()??""},f={value:l,generateId:vt(()=>$(s.id)),onInput:d};return S(ta.Provider,{value:c,get children(){return S(Ud.Provider,{value:f,get children(){return S(ae,F({as:"div",ref(h){var g=ve(p=>t=p,o.ref);typeof g=="function"&&g(h)},role:"group",get id(){return $(s.id)}},()=>c.dataset(),i))}})}})}function Xd(e){let t;const n=qd(),r=Z({id:n.generateId("textarea")},e),[o,s]=N(r,["ref","autoResize","submitOnEnter","onKeyPress"]);U(Ee([()=>t,()=>o.autoResize,()=>n.value()],([a,l])=>{!a||!l||Cb(a)}));const i=a=>{t&&o.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return S(Wd,F({as:"textarea",get"aria-multiline"(){return o.submitOnEnter?"false":void 0},get onKeyPress(){return Se([o.onKeyPress,i])},ref(a){var l=ve(u=>t=u,o.ref);typeof l=="function"&&l(a)}},s))}function Cb(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 Eb=Object.assign(ca,{Description:na,ErrorMessage:ra,Input:ua,Label:Eo,TextArea:Xd});const Ll=ca,_l=e=>{const[t,n]=N(e,["type","class"]);return S(ua,F({get type(){return t.type},get class(){return ge("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))},Rb=ho("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"}}),kl=e=>{const[t,n]=N(e,["class"]);return S(Eo,F({get class(){return ge(Rb(),t.class)}},n))};class Yd{constructor(t,n){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=r=>{var o,s;this.listeners.add(r);const i=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),i==null||i()}},this.setState=r=>{var o,s,i;const a=this.state;this.state=(o=this.options)!=null&&o.updateFn?this.options.updateFn(a)(r):r(a),(i=(s=this.options)==null?void 0:s.onUpdate)==null||i.call(s),this._flush()},this._flush=()=>{if(this._batching)return;const r=++this._flushing;this.listeners.forEach(o=>{this._flushing===r&&o()})},this.batch=r=>{if(this._batching)return r();this._batching=!0,r(),this._batching=!1,this._flush()},this.state=t,this.options=n}}function da(e,t){return typeof e=="function"?e(t):e}function Qd(e,t){return fa(t).reduce((r,o)=>{if(r===null)return null;if(typeof r<"u")return r[o]},e)}function Uo(e,t,n){const r=fa(t);function o(s){if(!r.length)return da(n,s);const i=r.shift();if(typeof i=="string")return typeof s=="object"?(s===null&&(s={}),{...s,[i]:o(s[i])}):{[i]:o()};if(Array.isArray(s)&&i!==void 0){const a=s.slice(0,i);return[...a.length?a:new Array(i),o(s[i]),...s.slice(i+1)]}return[...new Array(i),o()]}return o(e)}function Pb(e,t){const n=fa(t);function r(o){if(!o)return;if(n.length===1){const i=n[0];if(Array.isArray(o)&&typeof i=="number")return o.filter((u,c)=>c!==i);const{[i]:a,...l}=o;return l}const s=n.shift();if(typeof s=="string"&&typeof o=="object")return{...o,[s]:r(o[s])};if(typeof s=="number"&&Array.isArray(o)){if(s>=o.length)return o;const i=o.slice(0,s);return[...i.length?i:new Array(s),r(o[s]),...o.slice(s+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return r(e)}const Ib=/^(\d*)$/gm,Mb=/\.(\d*)\./gm,Ab=/^(\d*)\./gm,Fb=/\.(\d*$)/gm,$b=/\.{2,}/gm,Ys="__int__",Hr=`${Ys}$1`;function fa(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replaceAll("[",".").replaceAll("]","").replace(Ib,Hr).replace(Mb,`.${Hr}.`).replace(Ab,`${Hr}.`).replace(Fb,`.${Hr}`).replace($b,".").split(".").map(t=>t.indexOf(Ys)===0?parseInt(t.substring(Ys.length),10):t)}function Ob(e){return!(Array.isArray(e)&&e.length===0)}function Qs(e,t){const{asyncDebounceMs:n}=t,{onChangeAsync:r,onBlurAsync:o,onSubmitAsync:s,onBlurAsyncDebounceMs:i,onChangeAsyncDebounceMs:a}=t.validators||{},l=n??0,u={cause:"change",validate:r,debounceMs:a??l},c={cause:"blur",validate:o,debounceMs:i??l},d={cause:"submit",validate:s,debounceMs:0},f=h=>({...h,debounceMs:0});switch(e){case"submit":return[f(u),f(c),d];case"blur":return[c];case"change":return[u];case"server":default:return[]}}function Zs(e,t){const{onChange:n,onBlur:r,onSubmit:o}=t.validators||{},s={cause:"change",validate:n},i={cause:"blur",validate:r},a={cause:"submit",validate:o},l={cause:"server",validate:()=>{}};switch(e){case"submit":return[s,i,a,l];case"server":return[l];case"blur":return[i,l];case"change":default:return[s,l]}}function qo(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 Tb=e=>typeof e=="object";class Db{constructor(t){var n;this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const{onMount:r}=this.options.validators||{};if(!r)return;const o=this.runValidator({validate:r,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"});o&&this.store.setState(s=>({...s,errorMap:{...s.errorMap,onMount:o}}))},this.update=r=>{if(!r)return;const o=this.options;this.options=r,this.store.batch(()=>{const s=r.defaultValues&&r.defaultValues!==o.defaultValues&&!this.state.isTouched,i=r.defaultState!==o.defaultState&&!this.state.isTouched;this.store.setState(()=>qo(Object.assign({},this.state,i?r.defaultState:{},s?{values:r.defaultValues}:{})))})},this.reset=()=>{const{fieldMeta:r}=this.state,o=this.resetFieldMeta(r);this.store.setState(()=>{var s;return qo({...this.options.defaultState,values:this.options.defaultValues??((s=this.options.defaultState)==null?void 0:s.values),fieldMeta:o})})},this.validateAllFields=async r=>{const o=[];return this.store.batch(()=>{Object.values(this.fieldInfo).forEach(i=>{if(!i.instance)return;const a=i.instance;o.push(Promise.resolve().then(()=>a.validate(r))),i.instance.state.meta.isTouched||i.instance.setMeta(l=>({...l,isTouched:!0})),i.instance.state.meta.isBlurred||i.instance.setMeta(l=>({...l,isBlurred:!0}))})}),(await Promise.all(o)).flat()},this.validateArrayFieldsStartingFrom=async(r,o,s)=>{const i=this.getFieldValue(r),a=Array.isArray(i)?Math.max(i.length-1,0):null,l=[`${r}[${o}]`];for(let f=o+1;f<=(a??0);f++)l.push(`${r}[${f}]`);const u=Object.keys(this.fieldInfo).filter(f=>l.some(h=>f.startsWith(h))),c=[];return this.store.batch(()=>{u.forEach(f=>{c.push(Promise.resolve().then(()=>this.validateField(f,s)))})}),(await Promise.all(c)).flat()},this.validateField=(r,o)=>{var s;const i=(s=this.fieldInfo[r])==null?void 0:s.instance;return i?(i.state.meta.isTouched||i.setMeta(a=>({...a,isTouched:!0})),i.state.meta.isBlurred||i.setMeta(a=>({...a,isBlurred:!0})),i.validate(o)):[]},this.validateSync=r=>{const o=Zs(r,this.options);let s=!1;const i={};this.store.batch(()=>{for(const l of o){if(!l.validate)continue;const u=this.runValidator({validate:l.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:c,fieldErrors:d}=Js(u),f=Ur(l.cause);if(d)for(const[h,g]of Object.entries(d)){const m={...i[h]||{},[f]:g};i[h]=m;const w=this.getFieldMeta(h);w&&w.errorMap[f]!==g&&this.setFieldMeta(h,y=>({...y,errorMap:{...y.errorMap,[f]:g}}))}this.state.errorMap[f]!==c&&this.store.setState(h=>({...h,errorMap:{...h.errorMap,[f]:c}})),(c||d)&&(s=!0)}});const a=Ur("submit");return this.state.errorMap[a]&&r!=="submit"&&!s&&this.store.setState(l=>({...l,errorMap:{...l.errorMap,[a]:void 0}})),{hasErrored:s,fieldsErrorMap:i}},this.validateAsync=async r=>{const o=Qs(r,this.options);this.state.isFormValidating||this.store.setState(u=>({...u,isFormValidating:!0}));const s=[];let i;for(const u of o){if(!u.validate)continue;const c=Ur(u.cause),d=this.state.validationMetaMap[c];d==null||d.lastAbortController.abort();const f=new AbortController;this.state.validationMetaMap[c]={lastAbortController:f},s.push(new Promise(async h=>{let g;try{g=await new Promise((y,v)=>{setTimeout(async()=>{if(f.signal.aborted)return y(void 0);try{y(await this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:f.signal},type:"validateAsync"}))}catch(x){v(x)}},u.debounceMs)})}catch(y){g=y}const{formError:p,fieldErrors:m}=Js(g);m&&(i=i?{...i,...m}:m);const w=Ur(u.cause);if(i)for(const[y,v]of Object.entries(i)){const x=this.getFieldMeta(y);x&&x.errorMap[w]!==v&&this.setFieldMeta(y,C=>({...C,errorMap:{...C.errorMap,[w]:v}}))}this.store.setState(y=>({...y,errorMap:{...y.errorMap,[w]:p}})),h(i?{fieldErrors:i,errorMapKey:w}:void 0)}))}let a=[];const l={};if(s.length){a=await Promise.all(s);for(const u of a)if(u!=null&&u.fieldErrors){const{errorMapKey:c}=u;for(const[d,f]of Object.entries(u.fieldErrors)){const g={...l[d]||{},[c]:f};l[d]=g}}}return this.store.setState(u=>({...u,isFormValidating:!1})),l},this.validate=r=>{const{hasErrored:o,fieldsErrorMap:s}=this.validateSync(r);return o&&!this.options.asyncAlways?s:this.validateAsync(r)},this.handleSubmit=async()=>{var r,o,s,i,a,l;if(this.store.setState(c=>({...c,isSubmitted:!1,submissionAttempts:c.submissionAttempts+1})),!this.state.canSubmit)return;this.store.setState(c=>({...c,isSubmitting:!0}));const u=()=>{this.store.setState(c=>({...c,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){u(),(o=(r=this.options).onSubmitInvalid)==null||o.call(r,{value:this.state.values,formApi:this});return}if(await this.validate("submit"),!this.state.isValid){u(),(i=(s=this.options).onSubmitInvalid)==null||i.call(s,{value:this.state.values,formApi:this});return}try{await((l=(a=this.options).onSubmit)==null?void 0:l.call(a,{value:this.state.values,formApi:this})),this.store.batch(()=>{this.store.setState(c=>({...c,isSubmitted:!0})),u()})}catch(c){throw u(),c}},this.getFieldValue=r=>Qd(this.state.values,r),this.getFieldMeta=r=>this.state.fieldMeta[r],this.getFieldInfo=r=>{var o;return(o=this.fieldInfo)[r]||(o[r]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}})},this.setFieldMeta=(r,o)=>{this.store.setState(s=>({...s,fieldMeta:{...s.fieldMeta,[r]:da(o,s.fieldMeta[r])}}))},this.resetFieldMeta=r=>Object.keys(r).reduce((o,s)=>{const i=s;return o[i]={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{}},o},{}),this.setFieldValue=(r,o,s)=>{const i=(s==null?void 0:s.dontUpdateMeta)??!1;this.store.batch(()=>{i||this.setFieldMeta(r,a=>({...a,isTouched:!0,isBlurred:!0,isDirty:!0})),this.store.setState(a=>({...a,values:Uo(a.values,r,o)}))})},this.deleteField=r=>{this.store.setState(o=>{const s={...o};return s.values=Pb(s.values,r),delete s.fieldMeta[r],s}),delete this.fieldInfo[r]},this.pushFieldValue=(r,o,s)=>{this.setFieldValue(r,i=>[...Array.isArray(i)?i:[],o],s),this.validateField(r,"change")},this.insertFieldValue=async(r,o,s,i)=>{this.setFieldValue(r,a=>[...a.slice(0,o),s,...a.slice(o)],i),await this.validateField(r,"change")},this.replaceFieldValue=async(r,o,s,i)=>{this.setFieldValue(r,a=>a.map((l,u)=>u===o?s:l),i),await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.removeFieldValue=async(r,o,s)=>{const i=this.getFieldValue(r),a=Array.isArray(i)?Math.max(i.length-1,0):null;if(this.setFieldValue(r,l=>l.filter((u,c)=>c!==o),s),a!==null){const l=`${r}[${a}]`;Object.keys(this.fieldInfo).filter(c=>c.startsWith(l)).forEach(c=>this.deleteField(c))}await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.swapFieldValues=(r,o,s,i)=>{this.setFieldValue(r,a=>{const l=a[o],u=a[s];return Uo(Uo(a,`${o}`,u),`${s}`,l)},i),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${s}]`,"change")},this.moveFieldValues=(r,o,s,i)=>{this.setFieldValue(r,a=>(a.splice(s,0,a.splice(o,1)[0]),a),i),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${s}]`,"change")},this.store=new Yd(qo({...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,o;let{state:s}=this.store;const i=Object.values(s.fieldMeta),a=i.some(v=>v==null?void 0:v.isValidating),l=!i.some(v=>(v==null?void 0:v.errorMap)&&Ob(Object.values(v.errorMap).filter(Boolean))),u=i.some(v=>v==null?void 0:v.isTouched),c=i.some(v=>v==null?void 0:v.isBlurred),d=i.some(v=>v==null?void 0:v.isDirty),f=!d,h=a||s.isFormValidating;s.errors=Object.values(s.errorMap).reduce((v,x)=>x===void 0?v:typeof x=="string"?(v.push(x),v):(x&&Tb(x)&&v.push(x.form),v),[]);const g=s.errors.length===0,p=l&&g,m=s.submissionAttempts===0&&!u||!h&&!s.isSubmitting&&p;s={...s,isFieldsValidating:a,isFieldsValid:l,isFormValid:g,isValid:p,canSubmit:m,isTouched:u,isBlurred:c,isPristine:f,isDirty:d},this.state=s,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]))&&((o=this.options.transform)==null||o.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 Js(e){if(e){if(typeof e=="object"){const t=Js(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 Ur(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 Lb{constructor(t){this.options={},this.mount=()=>{const n=this.getInfo();n.instance=this;const r=this.form.store.subscribe(()=>{this.store.batch(()=>{const s=this.getValue(),i=this.getMeta();s!==this.state.value&&this.store.setState(a=>({...a,value:s})),i!==this.state.meta&&this.store.setState(a=>({...a,meta:i}))})});this.update(this.options);const{onMount:o}=this.options.validators||{};if(o){const s=this.runValidator({validate:o,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});s&&this.setMeta(i=>({...i,errorMap:{...i==null?void 0:i.errorMap,onMount:s}}))}return()=>{r()}},this.update=n=>{if(this.state.value===void 0){const r=Qd(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,o)=>this.form.insertFieldValue(this.name,n,r,o),this.replaceValue=(n,r,o)=>this.form.replaceFieldValue(this.name,n,r,o),this.removeValue=(n,r)=>this.form.removeFieldValue(this.name,n,r),this.swapValues=(n,r,o)=>this.form.swapFieldValues(this.name,n,r,o),this.moveValue=(n,r,o)=>this.form.moveFieldValues(this.name,n,r,o),this.getLinkedFields=n=>{const r=Object.values(this.form.fieldInfo),o=[];for(const s of r){if(!s.instance)continue;const{onChangeListenTo:i,onBlurListenTo:a}=s.instance.options.validators||{};n==="change"&&(i!=null&&i.includes(this.name))&&o.push(s.instance),n==="blur"&&(a!=null&&a.includes(this.name))&&o.push(s.instance)}return o},this.validateSync=(n,r)=>{const o=Zs(n,this.options),i=this.getLinkedFields(n).reduce((u,c)=>{const d=Zs(n,c.options);return d.forEach(f=>{f.field=c}),u.concat(d)},[]);let a=!1;this.form.store.batch(()=>{const u=(c,d)=>{const f=rr(d.cause),h=d.validate?Vl(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 o)u(this,c);for(const c of i)c.validate&&u(c.field,c)});const l=rr("submit");return this.state.meta.errorMap[l]&&n!=="submit"&&!a&&this.setMeta(u=>({...u,errorMap:{...u.errorMap,[l]:void 0}})),{hasErrored:a}},this.validateAsync=async(n,r)=>{const o=Qs(n,this.options),s=await r,i=this.getLinkedFields(n),a=i.reduce((f,h)=>{const g=Qs(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 i)f.setMeta(h=>({...h,isValidating:!0}));const l=[],u=[],c=(f,h,g)=>{const p=rr(h.cause),m=f.getInfo().validationMetaMap[p];m==null||m.lastAbortController.abort();const w=new AbortController;this.getInfo().validationMetaMap[p]={lastAbortController:w},g.push(new Promise(async y=>{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(k){T(k)}},h.debounceMs)})}catch(_){x=_}if(w.signal.aborted)return y(void 0);const C=Vl(x),O=(v=s[this.name])==null?void 0:v[p],L=C||O;f.setMeta(_=>({..._,errorMap:{..._==null?void 0:_.errorMap,[p]:L}})),y(L)}))};for(const f of o)f.validate&&c(this,f,l);for(const f of a)f.validate&&c(f.field,f,u);let d=[];(l.length||u.length)&&(d=await Promise.all(l),await Promise.all(u)),this.setMeta(f=>({...f,isValidating:!1}));for(const f of i)f.setMeta(h=>({...h,isValidating:!1}));return d.filter(Boolean)},this.validate=n=>{var r;if(!this.state.meta.isTouched)return[];let o={},s=Promise.resolve({});try{const a=this.form.validate(n);if(a instanceof Promise)s=a;else{const l=a[this.name];l&&(o=l)}}catch{}const{hasErrored:i}=this.validateSync(n,o);return i&&!this.options.asyncAlways?((r=this.getInfo().validationMetaMap[rr(n)])==null||r.lastAbortController.abort(),this.state.meta.errors):this.validateAsync(n,s)},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 Yd({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 Vl(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 Nl(e,t=n=>n){const[n,r]=lo({value:t(e.state)}),o=e.subscribe(()=>{const s=t(e.state);r("value",zu(s))});return W(()=>{o()}),()=>n.value}function _b(e){const[t,n]=j(!1),r=K(()=>[t(),e]),o=e.store.subscribe(()=>n(s=>!s));return W(o),()=>r()[1]}function Zd(e){const t=e(),n=new Lb(t),r=n;return r.Field=Jd,At(()=>n.update(e())),zn(()=>W(n.mount())),_b(r)}function Jd(e){const t=Zd(()=>{const{children:n,...r}=e;return r});return K(()=>S(()=>e.children(t),{}))}function kb(e){const t=e==null?void 0:e(),n=new Db(t),r=n;return r.Field=o=>S(Jd,F(o,{form:n})),r.createField=o=>Zd(()=>({...o(),form:n})),r.useStore=o=>Nl(n.store,o),r.Subscribe=o=>da(o.children,Nl(n.store,o.selector)),zn(n.mount),At(()=>n.update(e==null?void 0:e())),r}var Wo,Kl;function Vb(){if(Kl)return Wo;Kl=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 s=this.map.keys().next().value;this.delete(s)}this.map.set(n,r)}return this}}return Wo=e,Wo}var Xo,jl;function ha(){if(jl)return Xo;jl=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Xo=r=>r?typeof r!="object"?e:r:t,Xo}var qr={exports:{}},Yo,Bl;function ga(){if(Bl)return Yo;Bl=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return Yo={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Yo}var Qo,zl;function Ro(){if(zl)return Qo;zl=1;var e={};return Qo=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},Qo}var Gl;function pa(){return Gl||(Gl=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=ga(),s=Ro();t=e.exports={};const i=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[d,r]],h=p=>{for(const[m,w]of f)p=p.split(`${m}*`).join(`${m}{0,${w}}`).split(`${m}+`).join(`${m}{1,${w}}`);return p},g=(p,m,w)=>{const y=h(m),v=c++;s(p,v,m),u[p]=v,l[v]=m,i[v]=new RegExp(m,w?"g":void 0),a[v]=new RegExp(y,w?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),g("FULL",`^${l[u.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),g("LOOSE",`^${l[u.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),g("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[u.COERCE],!0),g("COERCERTLFULL",l[u.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(qr,qr.exports)),qr.exports}var Zo,Hl;function Nb(){if(Hl)return Zo;Hl=1;const e=/^[0-9]+$/,t=(r,o)=>{const s=e.test(r),i=e.test(o);return s&&i&&(r=+r,o=+o),r===o?0:s&&!i?-1:i&&!s?1:r<o?-1:1};return Zo={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Zo}var Jo,Ul;function ma(){if(Ul)return Jo;Ul=1;const e=Ro(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=ga(),{safeRe:r,t:o}=pa(),s=ha(),{compareIdentifiers:i}=Nb();class a{constructor(u,c){if(c=s(c),u instanceof a){if(u.loose===!!c.loose&&u.includePrerelease===!!c.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const d=u.trim().match(c.loose?r[o.LOOSE]:r[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,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(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),i(this.major,u.major)||i(this.minor,u.minor)||i(this.patch,u.patch)}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let c=0;do{const d=this.prerelease[c],f=u.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 i(d,f)}while(++c)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let c=0;do{const d=this.build[c],f=u.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 i(d,f)}while(++c)}inc(u,c,d){switch(u){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]),i(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Jo=a,Jo}var es,ql;function Yn(){if(ql)return es;ql=1;const e=ma();return es=(n,r,o)=>new e(n,o).compare(new e(r,o)),es}var ts,Wl;function Kb(){if(Wl)return ts;Wl=1;const e=Yn();return ts=(n,r,o)=>e(n,r,o)===0,ts}var ns,Xl;function jb(){if(Xl)return ns;Xl=1;const e=Yn();return ns=(n,r,o)=>e(n,r,o)!==0,ns}var rs,Yl;function Bb(){if(Yl)return rs;Yl=1;const e=Yn();return rs=(n,r,o)=>e(n,r,o)>0,rs}var os,Ql;function zb(){if(Ql)return os;Ql=1;const e=Yn();return os=(n,r,o)=>e(n,r,o)>=0,os}var ss,Zl;function Gb(){if(Zl)return ss;Zl=1;const e=Yn();return ss=(n,r,o)=>e(n,r,o)<0,ss}var is,Jl;function Hb(){if(Jl)return is;Jl=1;const e=Yn();return is=(n,r,o)=>e(n,r,o)<=0,is}var as,eu;function Ub(){if(eu)return as;eu=1;const e=Kb(),t=jb(),n=Bb(),r=zb(),o=Gb(),s=Hb();return as=(a,l,u,c)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,c);case"!=":return t(a,u,c);case">":return n(a,u,c);case">=":return r(a,u,c);case"<":return o(a,u,c);case"<=":return s(a,u,c);default:throw new TypeError(`Invalid operator: ${l}`)}},as}var ls,tu;function qb(){if(tu)return ls;tu=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(" "),i("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,i("comp",this)}parse(c){const d=this.options.loose?r[o.COMPARATORLOOSE]:r[o.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(i("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 s(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 l(c.value,d).test(this.value):c.operator===""?c.value===""?!0:new l(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("=")||s(this.semver,"<",c.semver,d)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,d)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}ls=t;const n=ha(),{safeRe:r,t:o}=pa(),s=Ub(),i=Ro(),a=ma(),l=ef();return ls}var us,nu;function ef(){if(nu)return us;nu=1;const e=/\s+/g;class t{constructor(R,b){if(b=o(b),R instanceof t)return R.loose===!!b.loose&&R.includePrerelease===!!b.includePrerelease?R:new t(R.raw,b);if(R instanceof s)return this.raw=R.value,this.set=[[R]],this.formatted=void 0,this;if(this.options=b,this.loose=!!b.loose,this.includePrerelease=!!b.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&&m(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 b=this.set[R];for(let I=0;I<b.length;I++)I>0&&(this.formatted+=" "),this.formatted+=b[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 A=this.options.loose,D=A?l[u.HYPHENRANGELOOSE]:l[u.HYPHENRANGE];R=R.replace(D,z(this.options.includePrerelease)),i("hyphen replace",R),R=R.replace(l[u.COMPARATORTRIM],c),i("comparator trim",R),R=R.replace(l[u.TILDETRIM],d),i("tilde trim",R),R=R.replace(l[u.CARETTRIM],f),i("caret trim",R);let B=R.split(" ").map(ne=>y(ne,this.options)).join(" ").split(/\s+/).map(ne=>V(ne,this.options));A&&(B=B.filter(ne=>(i("loose invalid filter",ne,this.options),!!ne.match(l[u.COMPARATORLOOSE])))),i("range list",B);const H=new Map,X=B.map(ne=>new s(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,b){if(!(R instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>w(I,b)&&R.set.some(M=>w(M,b)&&I.every(A=>M.every(D=>A.intersects(D,b)))))}test(R){if(!R)return!1;if(typeof R=="string")try{R=new a(R,this.options)}catch{return!1}for(let b=0;b<this.set.length;b++)if(se(this.set[b],R,this.options))return!0;return!1}}us=t;const n=Vb(),r=new n,o=ha(),s=qb(),i=Ro(),a=ma(),{safeRe:l,t:u,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=pa(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=ga(),p=P=>P.value==="<0.0.0-0",m=P=>P.value==="",w=(P,R)=>{let b=!0;const I=P.slice();let M=I.pop();for(;b&&I.length;)b=I.every(A=>M.intersects(A,R)),M=I.pop();return b},y=(P,R)=>(i("comp",P,R),P=O(P,R),i("caret",P),P=x(P,R),i("tildes",P),P=_(P,R),i("xrange",P),P=k(P,R),i("stars",P),P),v=P=>!P||P.toLowerCase()==="x"||P==="*",x=(P,R)=>P.trim().split(/\s+/).map(b=>C(b,R)).join(" "),C=(P,R)=>{const b=R.loose?l[u.TILDELOOSE]:l[u.TILDE];return P.replace(b,(I,M,A,D,B)=>{i("tilde",P,I,M,A,D,B);let H;return v(M)?H="":v(A)?H=`>=${M}.0.0 <${+M+1}.0.0-0`:v(D)?H=`>=${M}.${A}.0 <${M}.${+A+1}.0-0`:B?(i("replaceTilde pr",B),H=`>=${M}.${A}.${D}-${B} <${M}.${+A+1}.0-0`):H=`>=${M}.${A}.${D} <${M}.${+A+1}.0-0`,i("tilde return",H),H})},O=(P,R)=>P.trim().split(/\s+/).map(b=>L(b,R)).join(" "),L=(P,R)=>{i("caret",P,R);const b=R.loose?l[u.CARETLOOSE]:l[u.CARET],I=R.includePrerelease?"-0":"";return P.replace(b,(M,A,D,B,H)=>{i("caret",P,M,A,D,B,H);let X;return v(A)?X="":v(D)?X=`>=${A}.0.0${I} <${+A+1}.0.0-0`:v(B)?A==="0"?X=`>=${A}.${D}.0${I} <${A}.${+D+1}.0-0`:X=`>=${A}.${D}.0${I} <${+A+1}.0.0-0`:H?(i("replaceCaret pr",H),A==="0"?D==="0"?X=`>=${A}.${D}.${B}-${H} <${A}.${D}.${+B+1}-0`:X=`>=${A}.${D}.${B}-${H} <${A}.${+D+1}.0-0`:X=`>=${A}.${D}.${B}-${H} <${+A+1}.0.0-0`):(i("no pr"),A==="0"?D==="0"?X=`>=${A}.${D}.${B}${I} <${A}.${D}.${+B+1}-0`:X=`>=${A}.${D}.${B}${I} <${A}.${+D+1}.0-0`:X=`>=${A}.${D}.${B} <${+A+1}.0.0-0`),i("caret return",X),X})},_=(P,R)=>(i("replaceXRanges",P,R),P.split(/\s+/).map(b=>T(b,R)).join(" ")),T=(P,R)=>{P=P.trim();const b=R.loose?l[u.XRANGELOOSE]:l[u.XRANGE];return P.replace(b,(I,M,A,D,B,H)=>{i("xRange",P,I,M,A,D,B,H);const X=v(A),le=X||v(D),ne=le||v(B),Fe=ne;return M==="="&&Fe&&(M=""),H=R.includePrerelease?"-0":"",X?M===">"||M==="<"?I="<0.0.0-0":I="*":M&&Fe?(le&&(D=0),B=0,M===">"?(M=">=",le?(A=+A+1,D=0,B=0):(D=+D+1,B=0)):M==="<="&&(M="<",le?A=+A+1:D=+D+1),M==="<"&&(H="-0"),I=`${M+A}.${D}.${B}${H}`):le?I=`>=${A}.0.0${H} <${+A+1}.0.0-0`:ne&&(I=`>=${A}.${D}.0${H} <${A}.${+D+1}.0-0`),i("xRange return",I),I})},k=(P,R)=>(i("replaceStars",P,R),P.trim().replace(l[u.STAR],"")),V=(P,R)=>(i("replaceGTE0",P,R),P.trim().replace(l[R.includePrerelease?u.GTE0PRE:u.GTE0],"")),z=P=>(R,b,I,M,A,D,B,H,X,le,ne,Fe)=>(v(I)?b="":v(M)?b=`>=${I}.0.0${P?"-0":""}`:v(A)?b=`>=${I}.${M}.0${P?"-0":""}`:D?b=`>=${b}`:b=`>=${b}${P?"-0":""}`,v(X)?H="":v(le)?H=`<${+X+1}.0.0-0`:v(ne)?H=`<${X}.${+le+1}.0-0`:Fe?H=`<=${X}.${le}.${ne}-${Fe}`:P?H=`<${X}.${le}.${+ne+1}-0`:H=`<=${H}`,`${b} ${H}`.trim()),se=(P,R,b)=>{for(let I=0;I<P.length;I++)if(!P[I].test(R))return!1;if(R.prerelease.length&&!b.includePrerelease){for(let I=0;I<P.length;I++)if(i(P[I].semver),P[I].semver!==s.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 us}var cs,ru;function Wb(){if(ru)return cs;ru=1;const e=ef();return cs=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},cs}var Xb=Wb();const ou=Kc(Xb);function Yb(e,{insertAt:t}={}){if(typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Yb(`:where(html[dir=ltr]),
28
+ :where([data-sonner-toaster][dir=ltr]) {
29
+ --toast-icon-margin-start: -3px;
30
+ --toast-icon-margin-end: 4px;
31
+ --toast-svg-margin-start: -1px;
32
+ --toast-svg-margin-end: 0px;
33
+ --toast-button-margin-start: auto;
34
+ --toast-button-margin-end: 0;
35
+ --toast-close-button-start: 0;
36
+ --toast-close-button-end: unset;
37
+ --toast-close-button-transform: translate(-35%, -35%);
38
+ }
39
+ :where(html[dir=rtl]),
40
+ :where([data-sonner-toaster][dir=rtl]) {
41
+ --toast-icon-margin-start: 4px;
42
+ --toast-icon-margin-end: -3px;
43
+ --toast-svg-margin-start: 0px;
44
+ --toast-svg-margin-end: -1px;
45
+ --toast-button-margin-start: 0;
46
+ --toast-button-margin-end: auto;
47
+ --toast-close-button-start: unset;
48
+ --toast-close-button-end: 0;
49
+ --toast-close-button-transform: translate(35%, -35%);
50
+ }
51
+ :where([data-sonner-toaster]) {
52
+ position: fixed;
53
+ width: var(--width);
54
+ font-family:
55
+ ui-sans-serif,
56
+ system-ui,
57
+ -apple-system,
58
+ BlinkMacSystemFont,
59
+ Segoe UI,
60
+ Roboto,
61
+ Helvetica Neue,
62
+ Arial,
63
+ Noto Sans,
64
+ sans-serif,
65
+ Apple Color Emoji,
66
+ Segoe UI Emoji,
67
+ Segoe UI Symbol,
68
+ Noto Color Emoji;
69
+ --gray1: hsl(0, 0%, 99%);
70
+ --gray2: hsl(0, 0%, 97.3%);
71
+ --gray3: hsl(0, 0%, 95.1%);
72
+ --gray4: hsl(0, 0%, 93%);
73
+ --gray5: hsl(0, 0%, 90.9%);
74
+ --gray6: hsl(0, 0%, 88.7%);
75
+ --gray7: hsl(0, 0%, 85.8%);
76
+ --gray8: hsl(0, 0%, 78%);
77
+ --gray9: hsl(0, 0%, 56.1%);
78
+ --gray10: hsl(0, 0%, 52.3%);
79
+ --gray11: hsl(0, 0%, 43.5%);
80
+ --gray12: hsl(0, 0%, 9%);
81
+ --border-radius: 8px;
82
+ box-sizing: border-box;
83
+ padding: 0;
84
+ margin: 0;
85
+ list-style: none;
86
+ outline: none;
87
+ z-index: 999999999;
88
+ }
89
+ :where([data-sonner-toaster][data-x-position=right]) {
90
+ right: max(var(--offset), env(safe-area-inset-right));
91
+ }
92
+ :where([data-sonner-toaster][data-x-position=left]) {
93
+ left: max(var(--offset), env(safe-area-inset-left));
94
+ }
95
+ :where([data-sonner-toaster][data-x-position=center]) {
96
+ left: 50%;
97
+ transform: translateX(-50%);
98
+ }
99
+ :where([data-sonner-toaster][data-y-position=top]) {
100
+ top: max(var(--offset), env(safe-area-inset-top));
101
+ }
102
+ :where([data-sonner-toaster][data-y-position=bottom]) {
103
+ bottom: max(var(--offset), env(safe-area-inset-bottom));
104
+ }
105
+ :where([data-sonner-toast]) {
106
+ --y: translateY(100%);
107
+ --lift-amount: calc(var(--lift) * var(--gap));
108
+ z-index: var(--z-index);
109
+ position: absolute;
110
+ opacity: 0;
111
+ transform: var(--y);
112
+ filter: blur(0);
113
+ touch-action: none;
114
+ transition:
115
+ transform 400ms,
116
+ opacity 400ms,
117
+ height 400ms,
118
+ box-shadow 200ms;
119
+ box-sizing: border-box;
120
+ outline: none;
121
+ overflow-wrap: anywhere;
122
+ }
123
+ :where([data-sonner-toast][data-styled=true]) {
124
+ padding: 16px;
125
+ background: var(--normal-bg);
126
+ border: 1px solid var(--normal-border);
127
+ color: var(--normal-text);
128
+ border-radius: var(--border-radius);
129
+ box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
130
+ width: var(--width);
131
+ font-size: 13px;
132
+ display: flex;
133
+ align-items: center;
134
+ gap: 6px;
135
+ }
136
+ :where([data-sonner-toast]:focus-visible) {
137
+ box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.2);
138
+ }
139
+ :where([data-sonner-toast][data-y-position=top]) {
140
+ top: 0;
141
+ --y: translateY(-100%);
142
+ --lift: 1;
143
+ --lift-amount: calc(1 * var(--gap));
144
+ }
145
+ :where([data-sonner-toast][data-y-position=bottom]) {
146
+ bottom: 0;
147
+ --y: translateY(100%);
148
+ --lift: -1;
149
+ --lift-amount: calc(var(--lift) * var(--gap));
150
+ }
151
+ :where([data-sonner-toast]) :where([data-description]) {
152
+ font-weight: 400;
153
+ line-height: 1.4;
154
+ color: inherit;
155
+ }
156
+ :where([data-sonner-toast]) :where([data-title]) {
157
+ font-weight: 500;
158
+ line-height: 1.5;
159
+ color: inherit;
160
+ }
161
+ :where([data-sonner-toast]) :where([data-icon]) {
162
+ display: flex;
163
+ height: 16px;
164
+ width: 16px;
165
+ position: relative;
166
+ justify-content: flex-start;
167
+ align-items: center;
168
+ flex-shrink: 0;
169
+ margin-left: var(--toast-icon-margin-start);
170
+ margin-right: var(--toast-icon-margin-end);
171
+ }
172
+ :where([data-sonner-toast][data-promise=true]) :where([data-icon]) > svg {
173
+ opacity: 0;
174
+ transform: scale(0.8);
175
+ transform-origin: center;
176
+ animation: sonner-fade-in 300ms ease forwards;
177
+ }
178
+ :where([data-sonner-toast]) :where([data-icon]) > * {
179
+ flex-shrink: 0;
180
+ }
181
+ :where([data-sonner-toast]) :where([data-icon]) svg {
182
+ margin-left: var(--toast-svg-margin-start);
183
+ margin-right: var(--toast-svg-margin-end);
184
+ }
185
+ :where([data-sonner-toast]) :where([data-content]) {
186
+ display: flex;
187
+ flex-direction: column;
188
+ gap: 2px;
189
+ }
190
+ [data-sonner-toast][data-styled=true] [data-button] {
191
+ border-radius: 4px;
192
+ padding-left: 8px;
193
+ padding-right: 8px;
194
+ height: 24px;
195
+ font-size: 12px;
196
+ color: var(--normal-bg);
197
+ background: var(--normal-text);
198
+ margin-left: var(--toast-button-margin-start);
199
+ margin-right: var(--toast-button-margin-end);
200
+ border: none;
201
+ cursor: pointer;
202
+ outline: none;
203
+ display: flex;
204
+ align-items: center;
205
+ flex-shrink: 0;
206
+ transition: opacity 400ms, box-shadow 200ms;
207
+ }
208
+ :where([data-sonner-toast]) :where([data-button]):focus-visible {
209
+ box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
210
+ }
211
+ :where([data-sonner-toast]) :where([data-button]):first-of-type {
212
+ margin-left: var(--toast-button-margin-start);
213
+ margin-right: var(--toast-button-margin-end);
214
+ }
215
+ :where([data-sonner-toast]) :where([data-cancel]) {
216
+ color: var(--normal-text);
217
+ background: rgba(0, 0, 0, 0.08);
218
+ }
219
+ :where([data-sonner-toast][data-theme=dark]) :where([data-cancel]) {
220
+ background: rgba(255, 255, 255, 0.3);
221
+ }
222
+ :where([data-sonner-toast]) :where([data-close-button]) {
223
+ position: absolute;
224
+ left: var(--toast-close-button-start);
225
+ right: var(--toast-close-button-end);
226
+ top: 0;
227
+ height: 20px;
228
+ width: 20px;
229
+ display: flex;
230
+ justify-content: center;
231
+ align-items: center;
232
+ padding: 0;
233
+ background: var(--gray1);
234
+ color: var(--gray12);
235
+ border: 1px solid var(--gray4);
236
+ transform: var(--toast-close-button-transform);
237
+ border-radius: 50%;
238
+ cursor: pointer;
239
+ z-index: 1;
240
+ transition:
241
+ opacity 100ms,
242
+ background 200ms,
243
+ border-color 200ms;
244
+ }
245
+ :where([data-sonner-toast]) :where([data-close-button]):focus-visible {
246
+ box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 0, 0, 0.2);
247
+ }
248
+ :where([data-sonner-toast]) :where([data-disabled=true]) {
249
+ cursor: not-allowed;
250
+ }
251
+ :where([data-sonner-toast]):hover :where([data-close-button]):hover {
252
+ background: var(--gray2);
253
+ border-color: var(--gray5);
254
+ }
255
+ :where([data-sonner-toast][data-swiping=true])::before {
256
+ content: "";
257
+ position: absolute;
258
+ left: 0;
259
+ right: 0;
260
+ height: 100%;
261
+ z-index: -1;
262
+ }
263
+ :where([data-sonner-toast][data-y-position=top][data-swiping=true])::before {
264
+ bottom: 50%;
265
+ transform: scaleY(3) translateY(50%);
266
+ }
267
+ :where([data-sonner-toast][data-y-position=bottom][data-swiping=true])::before {
268
+ top: 50%;
269
+ transform: scaleY(3) translateY(-50%);
270
+ }
271
+ :where([data-sonner-toast][data-swiping=false][data-removed=true])::before {
272
+ content: "";
273
+ position: absolute;
274
+ inset: 0;
275
+ transform: scaleY(2);
276
+ }
277
+ :where([data-sonner-toast])::after {
278
+ content: "";
279
+ position: absolute;
280
+ left: 0;
281
+ height: calc(var(--gap) + 1px);
282
+ bottom: 100%;
283
+ width: 100%;
284
+ }
285
+ :where([data-sonner-toast][data-mounted=true]) {
286
+ --y: translateY(0);
287
+ opacity: 1;
288
+ }
289
+ :where([data-sonner-toast][data-expanded=false][data-front=false]) {
290
+ --scale: var(--toasts-before) * 0.05 + 1;
291
+ --y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));
292
+ height: var(--front-toast-height);
293
+ }
294
+ :where([data-sonner-toast]) > * {
295
+ transition: opacity 400ms;
296
+ }
297
+ :where([data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]) > * {
298
+ opacity: 0;
299
+ }
300
+ :where([data-sonner-toast][data-visible=false]) {
301
+ opacity: 0;
302
+ pointer-events: none;
303
+ }
304
+ :where([data-sonner-toast][data-mounted=true][data-expanded=true]) {
305
+ --y: translateY(calc(var(--lift) * var(--offset)));
306
+ height: var(--initial-height);
307
+ }
308
+ :where([data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]) {
309
+ --y: translateY(calc(var(--lift) * -100%));
310
+ opacity: 0;
311
+ }
312
+ :where([data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]) {
313
+ --y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));
314
+ opacity: 0;
315
+ }
316
+ :where([data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]) {
317
+ --y: translateY(40%);
318
+ opacity: 0;
319
+ transition: transform 500ms, opacity 200ms;
320
+ }
321
+ :where([data-sonner-toast][data-removed=true][data-front=false])::before {
322
+ height: calc(var(--initial-height) + 20%);
323
+ }
324
+ [data-sonner-toast][data-swiping=true] {
325
+ transform: var(--y) translateY(var(--swipe-amount, 0px));
326
+ transition: none;
327
+ }
328
+ [data-sonner-toast][data-swipe-out=true][data-y-position=bottom],
329
+ [data-sonner-toast][data-swipe-out=true][data-y-position=top] {
330
+ animation: swipe-out 200ms ease-out forwards;
331
+ }
332
+ @keyframes swipe-out {
333
+ from {
334
+ transform: translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));
335
+ opacity: 1;
336
+ }
337
+ to {
338
+ transform: translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));
339
+ opacity: 0;
340
+ }
341
+ }
342
+ @media (max-width: 600px) {
343
+ [data-sonner-toaster] {
344
+ position: fixed;
345
+ --mobile-offset: 16px;
346
+ right: var(--mobile-offset);
347
+ left: var(--mobile-offset);
348
+ width: 100%;
349
+ }
350
+ [data-sonner-toaster] [data-sonner-toast] {
351
+ left: 0;
352
+ right: 0;
353
+ width: calc(100% - var(--mobile-offset) * 2);
354
+ }
355
+ [data-sonner-toaster][data-x-position=left] {
356
+ left: var(--mobile-offset);
357
+ }
358
+ [data-sonner-toaster][data-y-position=bottom] {
359
+ bottom: 20px;
360
+ }
361
+ [data-sonner-toaster][data-y-position=top] {
362
+ top: 20px;
363
+ }
364
+ [data-sonner-toaster][data-x-position=center] {
365
+ left: var(--mobile-offset);
366
+ right: var(--mobile-offset);
367
+ transform: none;
368
+ }
369
+ }
370
+ [data-sonner-toaster][data-theme=light] {
371
+ --normal-bg: #fff;
372
+ --normal-border: var(--gray4);
373
+ --normal-text: var(--gray12);
374
+ --success-bg: hsl(143, 85%, 96%);
375
+ --success-border: hsl(145, 92%, 91%);
376
+ --success-text: hsl(140, 100%, 27%);
377
+ --info-bg: hsl(208, 100%, 97%);
378
+ --info-border: hsl(221, 91%, 91%);
379
+ --info-text: hsl(210, 92%, 45%);
380
+ --warning-bg: hsl(49, 100%, 97%);
381
+ --warning-border: hsl(49, 91%, 91%);
382
+ --warning-text: hsl(31, 92%, 45%);
383
+ --error-bg: hsl(359, 100%, 97%);
384
+ --error-border: hsl(359, 100%, 94%);
385
+ --error-text: hsl(360, 100%, 45%);
386
+ }
387
+ [data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true] {
388
+ --normal-bg: #000;
389
+ --normal-border: hsl(0, 0%, 20%);
390
+ --normal-text: var(--gray1);
391
+ }
392
+ [data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true] {
393
+ --normal-bg: #fff;
394
+ --normal-border: var(--gray3);
395
+ --normal-text: var(--gray12);
396
+ }
397
+ [data-sonner-toaster][data-theme=dark] {
398
+ --normal-bg: #000;
399
+ --normal-border: hsl(0, 0%, 20%);
400
+ --normal-text: var(--gray1);
401
+ --success-bg: hsl(150, 100%, 6%);
402
+ --success-border: hsl(147, 100%, 12%);
403
+ --success-text: hsl(150, 86%, 65%);
404
+ --info-bg: hsl(215, 100%, 6%);
405
+ --info-border: hsl(223, 100%, 12%);
406
+ --info-text: hsl(216, 87%, 65%);
407
+ --warning-bg: hsl(64, 100%, 6%);
408
+ --warning-border: hsl(60, 100%, 12%);
409
+ --warning-text: hsl(46, 87%, 65%);
410
+ --error-bg: hsl(358, 76%, 10%);
411
+ --error-border: hsl(357, 89%, 16%);
412
+ --error-text: hsl(358, 100%, 81%);
413
+ }
414
+ [data-rich-colors=true] [data-sonner-toast][data-type=success] {
415
+ background: var(--success-bg);
416
+ border-color: var(--success-border);
417
+ color: var(--success-text);
418
+ }
419
+ [data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button] {
420
+ background: var(--success-bg);
421
+ border-color: var(--success-border);
422
+ color: var(--success-text);
423
+ }
424
+ [data-rich-colors=true] [data-sonner-toast][data-type=info] {
425
+ background: var(--info-bg);
426
+ border-color: var(--info-border);
427
+ color: var(--info-text);
428
+ }
429
+ [data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button] {
430
+ background: var(--info-bg);
431
+ border-color: var(--info-border);
432
+ color: var(--info-text);
433
+ }
434
+ [data-rich-colors=true] [data-sonner-toast][data-type=warning] {
435
+ background: var(--warning-bg);
436
+ border-color: var(--warning-border);
437
+ color: var(--warning-text);
438
+ }
439
+ [data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button] {
440
+ background: var(--warning-bg);
441
+ border-color: var(--warning-border);
442
+ color: var(--warning-text);
443
+ }
444
+ [data-rich-colors=true] [data-sonner-toast][data-type=error] {
445
+ background: var(--error-bg);
446
+ border-color: var(--error-border);
447
+ color: var(--error-text);
448
+ }
449
+ [data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button] {
450
+ background: var(--error-bg);
451
+ border-color: var(--error-border);
452
+ color: var(--error-text);
453
+ }
454
+ .sonner-loading-wrapper {
455
+ --size: 16px;
456
+ height: var(--size);
457
+ width: var(--size);
458
+ position: absolute;
459
+ inset: 0;
460
+ z-index: 10;
461
+ }
462
+ .sonner-loading-wrapper[data-visible=false] {
463
+ transform-origin: center;
464
+ animation: sonner-fade-out 0.2s ease forwards;
465
+ }
466
+ .sonner-spinner {
467
+ position: relative;
468
+ top: 50%;
469
+ left: 50%;
470
+ height: var(--size);
471
+ width: var(--size);
472
+ }
473
+ .sonner-loading-bar {
474
+ animation: sonner-spin 1.2s linear infinite;
475
+ background: var(--gray11);
476
+ border-radius: 6px;
477
+ height: 8%;
478
+ left: -10%;
479
+ position: absolute;
480
+ top: -3.9%;
481
+ width: 24%;
482
+ }
483
+ .sonner-loading-bar:nth-child(1) {
484
+ animation-delay: -1.2s;
485
+ transform: rotate(0.0001deg) translate(146%);
486
+ }
487
+ .sonner-loading-bar:nth-child(2) {
488
+ animation-delay: -1.1s;
489
+ transform: rotate(30deg) translate(146%);
490
+ }
491
+ .sonner-loading-bar:nth-child(3) {
492
+ animation-delay: -1s;
493
+ transform: rotate(60deg) translate(146%);
494
+ }
495
+ .sonner-loading-bar:nth-child(4) {
496
+ animation-delay: -0.9s;
497
+ transform: rotate(90deg) translate(146%);
498
+ }
499
+ .sonner-loading-bar:nth-child(5) {
500
+ animation-delay: -0.8s;
501
+ transform: rotate(120deg) translate(146%);
502
+ }
503
+ .sonner-loading-bar:nth-child(6) {
504
+ animation-delay: -0.7s;
505
+ transform: rotate(150deg) translate(146%);
506
+ }
507
+ .sonner-loading-bar:nth-child(7) {
508
+ animation-delay: -0.6s;
509
+ transform: rotate(180deg) translate(146%);
510
+ }
511
+ .sonner-loading-bar:nth-child(8) {
512
+ animation-delay: -0.5s;
513
+ transform: rotate(210deg) translate(146%);
514
+ }
515
+ .sonner-loading-bar:nth-child(9) {
516
+ animation-delay: -0.4s;
517
+ transform: rotate(240deg) translate(146%);
518
+ }
519
+ .sonner-loading-bar:nth-child(10) {
520
+ animation-delay: -0.3s;
521
+ transform: rotate(270deg) translate(146%);
522
+ }
523
+ .sonner-loading-bar:nth-child(11) {
524
+ animation-delay: -0.2s;
525
+ transform: rotate(300deg) translate(146%);
526
+ }
527
+ .sonner-loading-bar:nth-child(12) {
528
+ animation-delay: -0.1s;
529
+ transform: rotate(330deg) translate(146%);
530
+ }
531
+ @keyframes sonner-fade-in {
532
+ 0% {
533
+ opacity: 0;
534
+ transform: scale(0.8);
535
+ }
536
+ 100% {
537
+ opacity: 1;
538
+ transform: scale(1);
539
+ }
540
+ }
541
+ @keyframes sonner-fade-out {
542
+ 0% {
543
+ opacity: 1;
544
+ transform: scale(1);
545
+ }
546
+ 100% {
547
+ opacity: 0;
548
+ transform: scale(0.8);
549
+ }
550
+ }
551
+ @keyframes sonner-spin {
552
+ 0% {
553
+ opacity: 1;
554
+ }
555
+ 100% {
556
+ opacity: 0.15;
557
+ }
558
+ }
559
+ @media (prefers-reduced-motion) {
560
+ [data-sonner-toast],
561
+ [data-sonner-toast] > *,
562
+ .sonner-loading-bar {
563
+ transition: none !important;
564
+ animation: none !important;
565
+ }
566
+ }
567
+ .sonner-loader {
568
+ position: absolute;
569
+ top: 50%;
570
+ left: 50%;
571
+ transform: translate(-50%, -50%);
572
+ transform-origin: center;
573
+ transition: opacity 200ms, transform 200ms;
574
+ }
575
+ .sonner-loader[data-visible=false] {
576
+ opacity: 0;
577
+ transform: scale(0.8) translate(-50%, -50%);
578
+ }
579
+ `);Array(12).fill(0);var ei=0,Qb=class{constructor(){de(this,"subscribers");de(this,"toasts");de(this,"subscribe",e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}));de(this,"publish",e=>{this.subscribers.forEach(t=>t(e))});de(this,"addToast",e=>{this.publish(e),this.toasts=[...this.toasts,e]});de(this,"create",e=>{var s;const{message:t,...n}=e,r=typeof(e==null?void 0:e.id)=="number"||e.id&&((s=e.id)==null?void 0:s.length)>0?e.id:ei++;return this.toasts.find(i=>i.id===r)?this.toasts=this.toasts.map(i=>i.id===r?(this.publish({...i,...e,id:r,title:t}),{...i,...e,id:r,title:t}):i):this.addToast({title:t,...n,id:r}),r});de(this,"dismiss",e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e));de(this,"message",(e,t)=>this.create({...t,message:e}));de(this,"error",(e,t)=>this.create({...t,message:e,type:"error"}));de(this,"success",(e,t)=>this.create({...t,type:"success",message:e}));de(this,"info",(e,t)=>this.create({...t,type:"info",message:e}));de(this,"warning",(e,t)=>this.create({...t,type:"warning",message:e}));de(this,"promise",(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading}));const r=e instanceof Promise?e:e();let o=n!==void 0;return r.then(s=>{if(s&&typeof s.ok=="boolean"&&!s.ok){o=!1;const i=typeof t.error=="function"?t.error(`HTTP error! status: ${s.status}`):t.error;this.create({id:n,type:"error",message:i})}else if(t.success!==void 0){o=!1;const i=typeof t.success=="function"?t.success(s):t.success;this.create({id:n,type:"success",message:i})}}).catch(s=>{if(t.error!==void 0){o=!1;const i=typeof t.error=="function"?t.error(s):t.error;this.create({id:n,type:"error",message:i})}}).finally(()=>{var s;o&&(this.dismiss(n),n=void 0),(s=t.finally)==null||s.call(t)}),n});de(this,"loading",(e,t)=>this.create({...t,type:"loading",message:e}));de(this,"custom",(e,t)=>{const n=(t==null?void 0:t.id)||ei++;return this.publish({jsx:e(n),id:n,...t}),n});this.subscribers=[],this.toasts=[]}},ut=new Qb;function Zb(e,t){const n=(t==null?void 0:t.id)||ei++;return ut.addToast({title:e,...t,id:n}),n}var Jb=Zb,eS=Object.assign(Jb,{success:ut.success,info:ut.info,warning:ut.warning,error:ut.error,custom:ut.custom,message:ut.message,promise:ut.promise,dismiss:ut.dismiss,loading:ut.loading});/*!
580
+ * Original code by Emil Kowalski
581
+ * MIT Licensed, Copyright 2023 Emil Kowalski, see https://github.com/emilkowalski/sonner/blob/main/LICENSE.md for details
582
+ *
583
+ * Credits:
584
+ * https://github.com/emilkowalski/sonner/blob/main/src/index.tsx
585
+ */ri(["pointerdown","pointerup","pointermove","click","mousemove"]);var tS=pe('<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">'),nS=pe('<em class="text-xs text-red-500">'),rS=pe('<em class="text-xs text-muted-foreground">'),oS=pe('<a target=_blank rel=noreferrer class="text-xs text-muted-foreground">Commit Hash: '),sS=pe('<p class="text-xs text-muted-foreground">Commit Hash: ');const iS=({bundleId:e,onClose:t})=>{const n=Im(e);return S(gm,{class:"flex flex-col h-full",get children(){return[S(pm,{class:"mb-4",get children(){return S(mm,{get children(){return["Edit ",e]}})}}),S(xe,{get when(){return n.data},get fallback(){return K(()=>!!n.isFetched)()?S(ym,{get children(){return["No update bundle found for bundle id ",e]}}):S(mb,{height:374,radius:10})},children:r=>S(aS,{get bundle(){return r()},onEditSuccess:t})})]}})},aS=({bundle:e,onEditSuccess:t})=>{const n=tc(),r=Pm(),[o,s]=j(!1),i=K(()=>{var c,d;return((d=(c=r.data)==null?void 0:c.console)==null?void 0:d.gitUrl)??null}),a=K(()=>e.gitCommitHash),l=kb(()=>({defaultValues:{message:e.message,targetAppVersion:e.targetAppVersion,enabled:e.enabled,shouldForceUpdate:e.shouldForceUpdate},onSubmit:async({value:c})=>{s(!0);try{await go.updateBundle.$post({json:{targetBundleId:e.id,bundle:c}})}catch(d){d instanceof Error&&eS(d.message)}finally{s(!1),n.invalidateQueries({queryKey:["getBundle",e.id]}),n.invalidateQueries({queryKey:["getBundles"]}),t()}}})),u=l.useStore(c=>c.isValid);return(()=>{var c=tS(),d=c.firstChild,f=d.nextSibling,h=f.nextSibling,g=h.firstChild,p=h.nextSibling,m=p.firstChild,w=p.nextSibling;return c.addEventListener("submit",y=>{y.preventDefault(),y.stopPropagation(),l.handleSubmit()}),he(d,S(Ll,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[S(kl,{for:"message",children:"Message"}),S(l.Field,{name:"message",children:y=>S(_l,{type:"text",id:"message",placeholder:"Message",get name(){return y().name},get value(){return y().state.value??""},get onBlur(){return y().handleBlur},onInput:v=>y().handleChange(v.currentTarget.value)})})]}})),he(f,S(Ll,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[S(kl,{for:"targetAppVersion",children:"Target App Version"}),S(l.Field,{name:"targetAppVersion",validators:{onChange:({value:y})=>{if((y==null?void 0:y.length)===0||!ou(y))return"Invalid target app version"}},children:y=>[S(_l,{type:"text",id:"targetAppVersion",get class(){return ge(y().state.meta.errors.length>0&&"border-red-500 focus-visible:ring-red-500")},placeholder:"Target App Version",get name(){return y().name},get value(){return y().state.value??""},get onBlur(){return y().handleBlur},onInput:v=>y().handleChange(v.currentTarget.value)}),K(()=>K(()=>y().state.meta.errors.length>0)()?(()=>{var v=nS();return he(v,()=>y().state.meta.errors.join(", ")),v})():(()=>{var v=rS();return he(v,()=>ou(y().state.value)),v})())]})]}})),he(g,S(l.Field,{name:"enabled",children:y=>S($l,{class:"flex items-center space-x-2",get checked(){return y().state.value},get name(){return y().name},onChange:v=>y().handleChange(v),get children(){return[S(Ol,{get children(){return S(Tl,{})}}),S(Dl,{children:"Enabled"})]}})})),he(m,S(l.Field,{name:"shouldForceUpdate",children:y=>S($l,{class:"flex items-center space-x-2",get checked(){return y().state.value},get name(){return y().name},onChange:v=>y().handleChange(v),get children(){return[S(Ol,{get children(){return S(Tl,{})}}),S(Dl,{children:"Force Update"})]}})})),he(c,S(xe,{get when(){return!o()},get fallback(){return S(Al,{type:"submit",class:"mt-4",disabled:!0,get children(){return S(Bm,{class:"animate-spin"})}})},get children(){return S(Al,{type:"submit",class:"mt-4",get disabled(){return!u()},children:"Save"})}}),w),he(w,S(xe,{get when(){return a()},children:y=>i()?(()=>{var v=oS();return v.firstChild,he(v,()=>y().slice(0,8),null),Be(()=>dn(v,"href",`${i()}/commit/${y}`)),v})():(()=>{var v=sS();return v.firstChild,he(v,()=>y().slice(0,8),null),v})()})),c})()};function su(){const e=ih(),t=sh(),n=e.bundleId,r=Rm(),[o,s]=j(n);U(()=>{if(!o()){t("/",{replace:!0});return}t(`/${o()}`,{replace:!0})}),U(()=>{a()||Gp(500).then(()=>s(null))});const i=K(()=>r.data||[]),[a,l]=j(!0),u=()=>{l(!1)};return S(um,{get open(){return a()},onOpenChange:l,get children(){return[S(hb,{columns:Hm,data:i,onRowClick:c=>{s(c.id)}}),S(xe,{get when(){return o()},get children(){return S(Eu,{get children(){return S(iS,{get bundleId(){return o()},onClose:u})}})}})]}})}const lS=new Yh;function uS(){return S(Qh,{client:lS,get children(){return[S(xh,{root:e=>S(Uf,{get children(){return[S(Xf,{children:"HotUpdater Console"}),S(Eu,{get fallback(){return S(og,{})},get children(){return S(Mh,{get children(){return e.children}})}})]}}),get children(){return[S(Fa,{path:"/",component:su}),S(Fa,{path:"/:bundleId",component:su})]}}),S(Hp,{})]}})}const iu=document.getElementById("root");iu&&Ff(()=>S(uS,{}),iu);