Files
Stackq/.svelte-kit/output/client/_app/immutable/chunks/Bac5Y1lX.js
T
eewing 6cc5928770
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m33s
Update dependencies and switch to @sveltejs/adapter-node for SvelteKit project
2026-02-17 14:25:23 -06:00

263 lines
148 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var ic=Object.defineProperty;var ac=Object.getPrototypeOf;var lc=Reflect.get;var la=n=>{throw TypeError(n)};var cc=(n,t,e)=>t in n?ic(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var S=(n,t,e)=>cc(n,typeof t!="symbol"?t+"":t,e),Bs=(n,t,e)=>t.has(n)||la("Cannot "+e);var a=(n,t,e)=>(Bs(n,t,"read from private field"),e?e.call(n):t.get(n)),y=(n,t,e)=>t.has(n)?la("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),V=(n,t,e,r)=>(Bs(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),nt=(n,t,e)=>(Bs(n,t,"access private method"),e);var ca=(n,t,e)=>lc(ac(n),e,t);import"./Bzak7iHL.js";import{h as Mn,i as za,j as uc,k as Ka,g as u,R as dc,H as fc,o as ua,m as da,p as Ls,N as ko,aw as hc,aT as gc,v as fa,G as vc,M as Hs,bi as pc,P as mc,ae as yc,b2 as bc,aS as Pi,bj as wc,z as Us,bk as xc,bl as _c,A as Pc,L as ha,bm as tn,I as Va,K as Ha,bn as Ws,bo as Sc,aQ as Cc,J as Oc,ax as Ac,D as G,c as z,F as ot,r as K,a as p,E as X,f as U,b0 as Z,a6 as fr,a7 as O,bp as ga,aA as rr,aZ as Ec,aY as va,a_ as Tc,ak as Fc,al as Kt,a1 as Mc,u as P,aW as Ic,bh as an,b as N,d as C,aX as kc,bq as Ua,s as D,br as Dc,bs as Nc,n as q,t as j,T as Pt,$ as Rc,ay as Bc}from"./m2dceAnU.js";import{c as qa,m as Lc,u as Wc,o as zc,s as Et}from"./Db3dOJqt.js";import{B as Kc,i as bt}from"./DcegSV8N.js";import{c as L}from"./CS4xyx6M.js";import{e as Vc,h as Hc,B as or}from"./D0oS5fvi.js";import{i as Uc,B as qc,f as Ya,g as T,h as Yc,t as Gc,j as Xc,k as jc,l as As,m as ce,n as Xn,o as Si,p as Ga,q as ln,r as Nt,s as In,u as Xa,v as Ne,w as Zc,x as Jc,y as Qc,L as Ae,I as sr,c as ja,e as Za,d as $c,C as tu,a as eu,b as nu}from"./Djw4YAFw.js";import{a as Tt,c as Zt,s as Y,r as Lo,d as Ja,e as pa,f as Qa,g as Do}from"./BtiMKAzw.js";import{p as b,b as On,r as st,s as xt}from"./CvosxF64.js";import{B as $a}from"./D4Z6sX8n.js";import{o as It}from"./DKU_2deH.js";const ru=Symbol("NaN");function ou(n,t,e){Mn&&za();var r=new Kc(n),o=!uc();Ka(()=>{var i=t();i!==i&&(i=ru),o&&i!==null&&typeof i=="object"&&(i={}),r.ensure(i,e)})}function hn(n,t){return t}function su(n,t,e){for(var r=[],o=t.length,i,s=t.length,l=0;l<o;l++){let f=t[l];Ha(f,()=>{if(i){if(i.pending.delete(f),i.done.add(f),i.pending.size===0){var v=n.outrogroups;qs(Pi(i.done)),v.delete(i),v.size===0&&(n.outrogroups=null)}}else s-=1},!1)}if(s===0){var c=r.length===0&&e!==null;if(c){var d=e,h=d.parentNode;Cc(h),h.append(d),n.items.clear()}qs(t,!c)}else i={pending:new Set(t),done:new Set},(n.outrogroups??(n.outrogroups=new Set)).add(i)}function qs(n,t=!0){for(var e=0;e<n.length;e++)Oc(n[e],t)}var ma;function en(n,t,e,r,o,i=null){var s=n,l=new Map;Mn&&za();var c=null,d=yc(()=>{var w=e();return bc(w)?w:w==null?[]:Pi(w)}),h,f=!0;function v(){g.fallback=c,iu(g,h,s,t,r),c!==null&&(h.length===0?(c.f&tn)===0?Va(c):(c.f^=tn,ur(c,null,s)):Ha(c,()=>{c=null}))}var m=Ka(()=>{h=u(d);var w=h.length;let x=!1;if(Mn){var _=dc(s)===fc;_!==(w===0)&&(s=ua(),da(s),Ls(!1),x=!0)}for(var E=new Set,I=vc,A=mc(),F=0;F<w;F+=1){Mn&&ko.nodeType===hc&&ko.data===gc&&(s=ko,x=!0,Ls(!1));var R=h[F],k=r(R,F),H=f?null:l.get(k);H?(H.v&&fa(H.v,R),H.i&&fa(H.i,F),A&&I.unskip_effect(H.e)):(H=au(l,f?s:ma??(ma=ha()),R,k,F,o,t,e),f||(H.e.f|=tn),l.set(k,H)),E.add(k)}if(w===0&&i&&!c&&(f?c=Hs(()=>i(s)):(c=Hs(()=>i(ma??(ma=ha()))),c.f|=tn)),w>E.size&&pc(),Mn&&w>0&&da(ua()),!f)if(A){for(const[rt,et]of l)E.has(rt)||I.skip_effect(et.e);I.oncommit(v),I.ondiscard(()=>{})}else v();x&&Ls(!0),u(d)}),g={effect:m,items:l,outrogroups:null,fallback:c};f=!1,Mn&&(s=ko)}function ir(n){for(;n!==null&&(n.f&Sc)===0;)n=n.next;return n}function iu(n,t,e,r,o){var H;var i=t.length,s=n.items,l=ir(n.effect.first),c,d=null,h=[],f=[],v,m,g,w;for(w=0;w<i;w+=1){if(v=t[w],m=o(v,w),g=s.get(m).e,n.outrogroups!==null)for(const rt of n.outrogroups)rt.pending.delete(g),rt.done.delete(g);if((g.f&tn)!==0)if(g.f^=tn,g===l)ur(g,null,e);else{var x=d?d.next:l;g===n.effect.last&&(n.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Ye(n,d,g),Ye(n,g,x),ur(g,x,e),d=g,h=[],f=[],l=ir(d.next);continue}if((g.f&Ws)!==0&&Va(g),g!==l){if(c!==void 0&&c.has(g)){if(h.length<f.length){var _=f[0],E;d=_.prev;var I=h[0],A=h[h.length-1];for(E=0;E<h.length;E+=1)ur(h[E],_,e);for(E=0;E<f.length;E+=1)c.delete(f[E]);Ye(n,I.prev,A.next),Ye(n,d,I),Ye(n,A,_),l=_,d=A,w-=1,h=[],f=[]}else c.delete(g),ur(g,l,e),Ye(n,g.prev,g.next),Ye(n,g,d===null?n.effect.first:d.next),Ye(n,d,g),d=g;continue}for(h=[],f=[];l!==null&&l!==g;)(c??(c=new Set)).add(l),f.push(l),l=ir(l.next);if(l===null)continue}(g.f&tn)===0&&h.push(g),d=g,l=ir(g.next)}if(n.outrogroups!==null){for(const rt of n.outrogroups)rt.pending.size===0&&(qs(Pi(rt.done)),(H=n.outrogroups)==null||H.delete(rt));n.outrogroups.size===0&&(n.outrogroups=null)}if(l!==null||c!==void 0){var F=[];if(c!==void 0)for(g of c)(g.f&Ws)===0&&F.push(g);for(;l!==null;)(l.f&Ws)===0&&l!==n.fallback&&F.push(l),l=ir(l.next);var R=F.length;if(R>0){var k=null;su(n,F,k)}}}function au(n,t,e,r,o,i,s,l){var c=(s&xc)!==0?(s&_c)===0?Pc(e,!1,!1):Us(e):null,d=(s&wc)!==0?Us(o):null;return{v:c,i:d,e:Hs(()=>(i(t,c??e,d??o,l),()=>{n.delete(r)}))}}function ur(n,t,e){if(n.nodes)for(var r=n.nodes.start,o=n.nodes.end,i=t&&(t.f&tn)===0?t.nodes.start:e;r!==null;){var s=Ac(r);if(i.before(r),r===o)return;r=s}}function Ye(n,t,e){t===null?n.effect.first=e:t.next=e,e===null?n.effect.last=t:e.prev=t}var lu=U('<div data-slot="table-container" class="relative w-full overflow-x-auto"><table><!></table></div>');function cu(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=lu(),i=z(o);Tt(i,l=>({"data-slot":"table",class:l,...r}),[()=>Zt("w-full caption-bottom text-sm",t.class)]);var s=z(i);Y(s,()=>t.children??ot),K(i),On(i,l=>e(l),()=>e()),K(o),p(n,o),X()}var uu=U("<tbody><!></tbody>");function du(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=uu();Tt(o,s=>({"data-slot":"table-body",class:s,...r}),[()=>Zt("[&_tr:last-child]:border-0",t.class)]);var i=z(o);Y(i,()=>t.children??ot),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}var fu=U("<td><!></td>");function zt(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=fu();Tt(o,s=>({"data-slot":"table-cell",class:s,...r}),[()=>Zt("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",t.class)]);var i=z(o);Y(i,()=>t.children??ot),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}var hu=U("<th><!></th>");function Ut(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=hu();Tt(o,s=>({"data-slot":"table-head",class:s,...r}),[()=>Zt("text-foreground h-10 bg-clip-padding px-2 text-start align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pe-0",t.class)]);var i=z(o);Y(i,()=>t.children??ot),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}var gu=U("<thead><!></thead>");function vu(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=gu();Tt(o,s=>({"data-slot":"table-header",class:s,...r}),[()=>Zt("[&_tr]:border-b",t.class)]);var i=z(o);Y(i,()=>t.children??ot),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}var pu=U("<tr><!></tr>");function zs(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=pu();Tt(o,s=>({"data-slot":"table-row",class:s,...r}),[()=>Zt("hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t.class)]);var i=z(o);Y(i,()=>t.children??ot),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}function An(n){let t=Z(fr(n));return{[qc]:!0,[Uc]:!0,get current(){return u(t)},set current(e){O(t,e,!0)}}}An.from=Ya;An.with=T;An.flatten=Yc;An.readonly=Gc;An.isBox=Xc;An.isWritableBox=jc;const tl=typeof window<"u"?window:void 0;function mu(n){let t=n.activeElement;for(;t!=null&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var ve,pe,Ee,ns,le,dr,Wo;const Vi=class Vi extends Map{constructor(e){super();y(this,le);y(this,ve,new Map);y(this,pe,Z(0));y(this,Ee,Z(0));y(this,ns,ga||-1);if(e){for(var[r,o]of e)super.set(r,o);a(this,Ee).v=super.size}}has(e){var r=a(this,ve),o=r.get(e);if(o===void 0){var i=super.get(e);if(i!==void 0)o=nt(this,le,dr).call(this,0),r.set(e,o);else return u(a(this,pe)),!1}return u(o),!0}forEach(e,r){nt(this,le,Wo).call(this),super.forEach(e,r)}get(e){var r=a(this,ve),o=r.get(e);if(o===void 0){var i=super.get(e);if(i!==void 0)o=nt(this,le,dr).call(this,0),r.set(e,o);else{u(a(this,pe));return}}return u(o),super.get(e)}set(e,r){var f;var o=a(this,ve),i=o.get(e),s=super.get(e),l=super.set(e,r),c=a(this,pe);if(i===void 0)i=nt(this,le,dr).call(this,0),o.set(e,i),O(a(this,Ee),super.size),rr(c);else if(s!==r){rr(i);var d=c.reactions===null?null:new Set(c.reactions),h=d===null||!((f=i.reactions)!=null&&f.every(v=>d.has(v)));h&&rr(c)}return l}delete(e){var r=a(this,ve),o=r.get(e),i=super.delete(e);return o!==void 0&&(r.delete(e),O(a(this,Ee),super.size),O(o,-1),rr(a(this,pe))),i}clear(){if(super.size!==0){super.clear();var e=a(this,ve);O(a(this,Ee),0);for(var r of e.values())O(r,-1);rr(a(this,pe)),e.clear()}}keys(){return u(a(this,pe)),super.keys()}values(){return nt(this,le,Wo).call(this),super.values()}entries(){return nt(this,le,Wo).call(this),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return u(a(this,Ee)),super.size}};ve=new WeakMap,pe=new WeakMap,Ee=new WeakMap,ns=new WeakMap,le=new WeakSet,dr=function(e){return ga===a(this,ns)?Z(e):Us(e)},Wo=function(){u(a(this,pe));var e=a(this,ve);if(a(this,Ee).v!==e.size){for(var r of ca(Vi.prototype,this,"keys").call(this))if(!e.has(r)){var o=nt(this,le,dr).call(this,0);e.set(r,o)}}for([,o]of a(this,ve))u(o)};let Ys=Vi;var Dn,pr;class yu{constructor(t={}){y(this,Dn);y(this,pr);const{window:e=tl,document:r=e==null?void 0:e.document}=t;e!==void 0&&(V(this,Dn,r),V(this,pr,qa(o=>{const i=It(e,"focusin",o),s=It(e,"focusout",o);return()=>{i(),s()}})))}get current(){var t;return(t=a(this,pr))==null||t.call(this),a(this,Dn)?mu(a(this,Dn)):null}}Dn=new WeakMap,pr=new WeakMap;new yu;function bu(n){return typeof n=="function"}var mr,Te;class cn{constructor(t){y(this,mr);y(this,Te);V(this,mr,t),V(this,Te,Symbol(t))}get key(){return a(this,Te)}exists(){return Ec(a(this,Te))}get(){const t=va(a(this,Te));if(t===void 0)throw new Error(`Context "${a(this,mr)}" not found`);return t}getOr(t){const e=va(a(this,Te));return e===void 0?t:e}set(t){return Tc(a(this,Te),t)}}mr=new WeakMap,Te=new WeakMap;function wu(n,t){switch(n){case"post":Kt(t);break;case"pre":Fc(t);break}}function el(n,t,e,r={}){const{lazy:o=!1}=r;let i=!o,s=Array.isArray(n)?[]:void 0;wu(t,()=>{const l=Array.isArray(n)?n.map(d=>d()):n();if(!i){i=!0,s=l;return}const c=Mc(()=>e(l,s));return s=l,c})}function Rt(n,t,e){el(n,"post",t,e)}function xu(n,t,e){el(n,"pre",t,e)}Rt.pre=xu;function ya(n){return bu(n)?n():n}var Ge,Nn,Rn,Bn,Xe,rs,os,Ln;class _u{constructor(t,e={box:"border-box"}){y(this,Ge,{width:0,height:0});y(this,Nn,!1);y(this,Rn);y(this,Bn);y(this,Xe);y(this,rs,P(()=>{var t;return(t=u(a(this,Ln)))==null||t(),this.getSize().width}));y(this,os,P(()=>{var t;return(t=u(a(this,Ln)))==null||t(),this.getSize().height}));y(this,Ln,P(()=>{const t=ya(a(this,Bn));if(t)return qa(e=>{if(!a(this,Xe))return;const r=new(a(this,Xe)).ResizeObserver(o=>{V(this,Nn,!0);for(const i of o){const s=a(this,Rn).box==="content-box"?i.contentBoxSize:i.borderBoxSize,l=Array.isArray(s)?s:[s];a(this,Ge).width=l.reduce((c,d)=>Math.max(c,d.inlineSize),0),a(this,Ge).height=l.reduce((c,d)=>Math.max(c,d.blockSize),0)}e()});return r.observe(t),()=>{V(this,Nn,!1),r.disconnect()}})}));V(this,Xe,e.window??tl),V(this,Rn,e),V(this,Bn,t),V(this,Ge,{width:0,height:0})}calculateSize(){const t=ya(a(this,Bn));if(!t||!a(this,Xe))return;const e=t.offsetWidth,r=t.offsetHeight;if(a(this,Rn).box==="border-box")return{width:e,height:r};const o=a(this,Xe).getComputedStyle(t),i=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),s=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom),l=parseFloat(o.borderLeftWidth)+parseFloat(o.borderRightWidth),c=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth),d=e-i-l,h=r-s-c;return{width:d,height:h}}getSize(){return a(this,Nn)?a(this,Ge):this.calculateSize()??a(this,Ge)}get current(){var t;return(t=u(a(this,Ln)))==null||t(),this.getSize()}get width(){return u(a(this,rs))}get height(){return u(a(this,os))}}Ge=new WeakMap,Nn=new WeakMap,Rn=new WeakMap,Bn=new WeakMap,Xe=new WeakMap,rs=new WeakMap,os=new WeakMap,Ln=new WeakMap;function Jn(n){Kt(()=>()=>{n()})}function Pu(n,t){return setTimeout(t,n)}function Re(n){Ic().then(n)}const Su=1,Cu=9,Ou=11;function Gs(n){return As(n)&&n.nodeType===Su&&typeof n.nodeName=="string"}function nl(n){return As(n)&&n.nodeType===Cu}function Au(n){var t;return As(n)&&((t=n.constructor)==null?void 0:t.name)==="VisualViewport"}function Eu(n){return As(n)&&n.nodeType!==void 0}function rl(n){return Eu(n)&&n.nodeType===Ou&&"host"in n}function Tu(n,t){var r;if(!n||!t||!Gs(n)||!Gs(t))return!1;const e=(r=t.getRootNode)==null?void 0:r.call(t);if(n===t||n.contains(t))return!0;if(e&&rl(e)){let o=t;for(;o;){if(n===o)return!0;o=o.parentNode||o.host}}return!1}function Fo(n){return nl(n)?n:Au(n)?n.document:(n==null?void 0:n.ownerDocument)??document}function Ci(n){var t;return rl(n)?Ci(n.host):nl(n)?n.defaultView??window:Gs(n)?((t=n.ownerDocument)==null?void 0:t.defaultView)??window:window}function Fu(n){let t=n.activeElement;for(;t!=null&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var yr;class Oi{constructor(t){S(this,"element");y(this,yr,P(()=>this.element.current?this.element.current.getRootNode()??document:document));S(this,"getDocument",()=>Fo(this.root));S(this,"getWindow",()=>this.getDocument().defaultView??window);S(this,"getActiveElement",()=>Fu(this.root));S(this,"isActiveElement",t=>t===this.getActiveElement());S(this,"querySelector",t=>this.root?this.root.querySelector(t):null);S(this,"querySelectorAll",t=>this.root?this.root.querySelectorAll(t):[]);S(this,"setTimeout",(t,e)=>this.getWindow().setTimeout(t,e));S(this,"clearTimeout",t=>this.getWindow().clearTimeout(t));typeof t=="function"?this.element=T(t):this.element=t}get root(){return u(a(this,yr))}set root(t){O(a(this,yr),t)}getElementById(t){return this.root.getElementById(t)}}yr=new WeakMap;const gr="ArrowDown",Ai="ArrowLeft",Ei="ArrowRight",Uo="ArrowUp",ol="End",Ti="Enter",Mu="Escape",sl="Home",Iu="PageDown",ku="PageUp",Es=" ",Du="Tab";function Nu(n){return window.getComputedStyle(n).getPropertyValue("direction")}function Ru(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Ai:Ei,vertical:gr}[t]}function Bu(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Ei:Ai,vertical:Uo}[t]}function Lu(n="ltr",t="horizontal"){return["ltr","rtl"].includes(n)||(n="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:Ru(n,t),prevKey:Bu(n,t)}}const il=typeof document<"u",ba=Wu();function Wu(){var n,t;return il&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Le(n){return n instanceof HTMLElement}function Xs(n){return n instanceof Element}function al(n){return n instanceof Element||n instanceof SVGElement}function zu(n){return n!==null}function Ku(n){return n instanceof HTMLInputElement&&"select"in n}var Lt,Fe;class Vu{constructor(t){y(this,Lt);y(this,Fe,An(null));V(this,Lt,t)}getCandidateNodes(){return a(this,Lt).rootNode.current?a(this,Lt).candidateSelector?Array.from(a(this,Lt).rootNode.current.querySelectorAll(a(this,Lt).candidateSelector)):a(this,Lt).candidateAttr?Array.from(a(this,Lt).rootNode.current.querySelectorAll(`[${a(this,Lt).candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){var e;const t=this.getCandidateNodes();t.length&&((e=t[0])==null||e.focus())}handleKeydown(t,e,r=!1){var g,w;const o=a(this,Lt).rootNode.current;if(!o||!t)return;const i=this.getCandidateNodes();if(!i.length)return;const s=i.indexOf(t),l=Nu(o),{nextKey:c,prevKey:d}=Lu(l,a(this,Lt).orientation.current),h=a(this,Lt).loop.current,f={[c]:s+1,[d]:s-1,[sl]:0,[ol]:i.length-1};if(r){const x=c===gr?Ei:gr,_=d===Uo?Ai:Uo;f[x]=s+1,f[_]=s-1}let v=f[e.key];if(v===void 0)return;e.preventDefault(),v<0&&h?v=i.length-1:v===i.length&&h&&(v=0);const m=i[v];if(m)return m.focus(),a(this,Fe).current=m.id,(w=(g=a(this,Lt)).onCandidateFocus)==null||w.call(g,m),m}getTabIndex(t){const e=this.getCandidateNodes(),r=a(this,Fe).current!==null;return t&&!r&&e[0]===t?(a(this,Fe).current=t.id,0):(t==null?void 0:t.id)===a(this,Fe).current?0:-1}setCurrentTabStopId(t){a(this,Fe).current=t}focusCurrentTabStop(){var r;const t=a(this,Fe).current;if(!t)return;const e=(r=a(this,Lt).rootNode.current)==null?void 0:r.querySelector(`#${t}`);!e||!Le(e)||e.focus()}}Lt=new WeakMap,Fe=new WeakMap;var Wn,gn,Be,js,zo;class Hu{constructor(t){y(this,Be);y(this,Wn);y(this,gn,null);V(this,Wn,t),Jn(()=>nt(this,Be,js).call(this))}run(t){nt(this,Be,js).call(this);const e=a(this,Wn).ref.current;if(e){if(typeof e.getAnimations!="function"){nt(this,Be,zo).call(this,t);return}V(this,gn,window.requestAnimationFrame(()=>{const r=e.getAnimations();if(r.length===0){nt(this,Be,zo).call(this,t);return}Promise.allSettled(r.map(o=>o.finished)).then(()=>{nt(this,Be,zo).call(this,t)})}))}}}Wn=new WeakMap,gn=new WeakMap,Be=new WeakSet,js=function(){a(this,gn)&&(window.cancelAnimationFrame(a(this,gn)),V(this,gn,null))},zo=function(t){const e=()=>{t()};a(this,Wn).afterTick?Re(e):e()};var me,br,wr,vn;class Zs{constructor(t){y(this,me);y(this,br);y(this,wr);y(this,vn,Z(!1));V(this,me,t),O(a(this,vn),t.open.current,!0),V(this,br,t.enabled??!0),V(this,wr,new Hu({ref:a(this,me).ref,afterTick:a(this,me).open})),Rt(()=>a(this,me).open.current,e=>{e&&O(a(this,vn),!0),a(this,br)&&a(this,wr).run(()=>{var r,o;e===a(this,me).open.current&&(a(this,me).open.current||O(a(this,vn),!1),(o=(r=a(this,me)).onComplete)==null||o.call(r))})})}get shouldRender(){return u(a(this,vn))}}me=new WeakMap,br=new WeakMap,wr=new WeakMap,vn=new WeakMap;function wt(){}const Uu=Ga({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),Pn=new cn("Dialog.Root | AlertDialog.Root");var xr,_r,Pr,Sr,Cr,Or,Ar,Er,Tr,Fr,Mr;const Hi=class Hi{constructor(t,e){S(this,"opts");y(this,xr,Z(null));y(this,_r,Z(null));y(this,Pr,Z(null));y(this,Sr,Z(null));y(this,Cr,Z(void 0));y(this,Or,Z(void 0));y(this,Ar,Z(void 0));y(this,Er,Z(void 0));y(this,Tr,Z(null));y(this,Fr,Z(0));S(this,"depth");S(this,"parent");S(this,"contentPresence");S(this,"overlayPresence");S(this,"getBitsAttr",t=>Uu.getAttr(t,this.opts.variant.current));y(this,Mr,P(()=>({"data-state":Si(this.opts.open.current)})));this.opts=t,this.parent=e,this.depth=e?e.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Zs({ref:T(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Zs({ref:T(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Rt(()=>this.opts.open.current,r=>{this.parent&&(r?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),Jn(()=>{var r;this.opts.open.current&&((r=this.parent)==null||r.decrementNested())})}static create(t){const e=Pn.getOr(null);return Pn.set(new Hi(t,e))}get triggerNode(){return u(a(this,xr))}set triggerNode(t){O(a(this,xr),t,!0)}get contentNode(){return u(a(this,_r))}set contentNode(t){O(a(this,_r),t,!0)}get overlayNode(){return u(a(this,Pr))}set overlayNode(t){O(a(this,Pr),t,!0)}get descriptionNode(){return u(a(this,Sr))}set descriptionNode(t){O(a(this,Sr),t,!0)}get contentId(){return u(a(this,Cr))}set contentId(t){O(a(this,Cr),t,!0)}get titleId(){return u(a(this,Or))}set titleId(t){O(a(this,Or),t,!0)}get triggerId(){return u(a(this,Ar))}set triggerId(t){O(a(this,Ar),t,!0)}get descriptionId(){return u(a(this,Er))}set descriptionId(t){O(a(this,Er),t,!0)}get cancelNode(){return u(a(this,Tr))}set cancelNode(t){O(a(this,Tr),t,!0)}get nestedOpenCount(){return u(a(this,Fr))}set nestedOpenCount(t){O(a(this,Fr),t,!0)}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}incrementNested(){var t;this.nestedOpenCount++,(t=this.parent)==null||t.incrementNested()}decrementNested(){var t;this.nestedOpenCount!==0&&(this.nestedOpenCount--,(t=this.parent)==null||t.decrementNested())}get sharedProps(){return u(a(this,Mr))}set sharedProps(t){O(a(this,Mr),t)}};xr=new WeakMap,_r=new WeakMap,Pr=new WeakMap,Sr=new WeakMap,Cr=new WeakMap,Or=new WeakMap,Ar=new WeakMap,Er=new WeakMap,Tr=new WeakMap,Fr=new WeakMap,Mr=new WeakMap;let Js=Hi;var Ir;const Ui=class Ui{constructor(t,e){S(this,"opts");S(this,"root");S(this,"attachment");y(this,Ir,P(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ce(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}static create(t){return new Ui(t,Pn.get())}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===Es||t.key===Ti)&&(t.preventDefault(),this.root.handleClose())}get props(){return u(a(this,Ir))}set props(t){O(a(this,Ir),t)}};Ir=new WeakMap;let Qs=Ui;var kr;const qi=class qi{constructor(t,e){S(this,"opts");S(this,"root");S(this,"attachment");y(this,kr,P(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.root.titleId=this.opts.id.current,this.attachment=ce(this.opts.ref),Rt.pre(()=>this.opts.id.current,r=>{this.root.titleId=r})}static create(t){return new qi(t,Pn.get())}get props(){return u(a(this,kr))}set props(t){O(a(this,kr),t)}};kr=new WeakMap;let $s=qi;var Dr;const Yi=class Yi{constructor(t,e){S(this,"opts");S(this,"root");S(this,"attachment");y(this,Dr,P(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.root.descriptionId=this.opts.id.current,this.attachment=ce(this.opts.ref,r=>{this.root.descriptionNode=r}),Rt.pre(()=>this.opts.id.current,r=>{this.root.descriptionId=r})}static create(t){return new Yi(t,Pn.get())}get props(){return u(a(this,Dr))}set props(t){O(a(this,Dr),t)}};Dr=new WeakMap;let ti=Yi;var Nr,Rr;const Gi=class Gi{constructor(t,e){S(this,"opts");S(this,"root");S(this,"attachment");y(this,Nr,P(()=>({open:this.root.opts.open.current})));y(this,Rr,P(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":Xn(this.root.nestedOpenCount>0),"data-nested":Xn(this.root.parent!==null),...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ce(this.opts.ref,r=>{this.root.contentNode=r,this.root.contentId=r==null?void 0:r.id})}static create(t){return new Gi(t,Pn.get())}get snippetProps(){return u(a(this,Nr))}set snippetProps(t){O(a(this,Nr),t)}get props(){return u(a(this,Rr))}set props(t){O(a(this,Rr),t)}get shouldRender(){return this.root.contentPresence.shouldRender}};Nr=new WeakMap,Rr=new WeakMap;let ei=Gi;var Br,Lr;const Xi=class Xi{constructor(t,e){S(this,"opts");S(this,"root");S(this,"attachment");y(this,Br,P(()=>({open:this.root.opts.open.current})));y(this,Lr,P(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":Xn(this.root.nestedOpenCount>0),"data-nested":Xn(this.root.parent!==null),...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ce(this.opts.ref,r=>this.root.overlayNode=r)}static create(t){return new Xi(t,Pn.get())}get snippetProps(){return u(a(this,Br))}set snippetProps(t){O(a(this,Br),t)}get props(){return u(a(this,Lr))}set props(t){O(a(this,Lr),t)}get shouldRender(){return this.root.overlayPresence.shouldRender}};Br=new WeakMap,Lr=new WeakMap;let ni=Xi;var qu=U("<div><!></div>");function Yu(n,t){const e=an();G(t,!0);let r=b(t,"id",19,()=>ln(e)),o=b(t,"ref",15,null),i=b(t,"level",3,2),s=st(t,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const l=$s.create({id:T(()=>r()),level:T(()=>i()),ref:T(()=>o(),m=>o(m))}),c=P(()=>Nt(s,l.props));var d=N(),h=C(d);{var f=m=>{var g=N(),w=C(g);Y(w,()=>t.child,()=>({props:u(c)})),p(m,g)},v=m=>{var g=qu();Tt(g,()=>({...u(c)}));var w=z(g);Y(w,()=>t.children??ot),K(g),p(m,g)};bt(h,m=>{t.child?m(f):m(v,!1)})}p(n,d),X()}function Gu(n,t){var e=N(),r=C(e);ou(r,()=>t.children,o=>{var i=N(),s=C(i);Y(s,()=>t.children??ot),p(o,i)}),p(n,e)}const Xu=new cn("BitsConfig");function ju(){const n=new Zu(null,{});return Xu.getOr(n).opts}class Zu{constructor(t,e){S(this,"opts");const r=Ju(t,e);this.opts={defaultPortalTo:r(o=>o.defaultPortalTo),defaultLocale:r(o=>o.defaultLocale)}}}function Ju(n,t){return e=>T(()=>{var i,s;const o=(i=e(t))==null?void 0:i.current;if(o!==void 0)return o;if(n!==null)return(s=e(n.opts))==null?void 0:s.current})}function Qu(n,t){return e=>{const r=ju();return T(()=>{const o=e();if(o!==void 0)return o;const i=n(r).current;return i!==void 0?i:t})}}const $u=Qu(n=>n.defaultPortalTo,"body");function ll(n,t){G(t,!0);const e=$u(()=>t.to),r=kc();let o=P(i);function i(){if(!il||t.disabled)return null;let f=null;return typeof e.current=="string"?f=document.querySelector(e.current):f=e.current,f}let s;function l(){s&&(Wc(s),s=null)}Rt([()=>u(o),()=>t.disabled],([f,v])=>{if(!f||v){l();return}return s=Lc(Gu,{target:f,props:{children:t.children},context:r}),()=>{l()}});var c=N(),d=C(c);{var h=f=>{var v=N(),m=C(v);Y(m,()=>t.children??ot),p(f,v)};bt(d,f=>{t.disabled&&f(h)})}p(n,c),X()}class td{constructor(t,e={bubbles:!0,cancelable:!0}){S(this,"eventName");S(this,"options");this.eventName=t,this.options=e}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,e){const r=this.createEvent(e);return t.dispatchEvent(r),r}listen(t,e,r){const o=i=>{e(i)};return It(t,this.eventName,o,r)}}function wa(n,t=500){let e=null;const r=(...o)=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{n(...o)},t)};return r.destroy=()=>{e!==null&&(clearTimeout(e),e=null)},r}function cl(n,t){return n===t||n.contains(t)}function ul(n){return(n==null?void 0:n.ownerDocument)??document}function ed(n,t){const{clientX:e,clientY:r}=n,o=t.getBoundingClientRect();return e<o.left||e>o.right||r<o.top||r>o.bottom}const nd=[Ti,Es],rd=[gr,ku,sl],dl=[Uo,Iu,ol],od=[...rd,...dl];function xa(n){return n.pointerType==="mouse"}function sd(n,{select:t=!1}={}){if(!n||!n.focus)return;const e=Fo(n);if(e.activeElement===n)return;const r=e.activeElement;n.focus({preventScroll:!0}),n!==r&&Ku(n)&&t&&n.select()}function id(n,{select:t=!1}={},e){const r=e();for(const o of n)if(sd(o,{select:t}),e()!==r)return!0}let ar=Z(!1);const te=class te{constructor(){Kt(()=>(te._refs===0&&(te._cleanup=Ua(()=>{const t=[],e=o=>{O(ar,!1)},r=o=>{O(ar,!0)};return t.push(It(document,"pointerdown",e,{capture:!0}),It(document,"pointermove",e,{capture:!0}),It(document,"keydown",r,{capture:!0})),In(...t)})),te._refs++,()=>{var t;te._refs--,te._refs===0&&(O(ar,!1),(t=te._cleanup)==null||t.call(te))}))}get current(){return u(ar)}set current(t){O(ar,t,!0)}};S(te,"_refs",0),S(te,"_cleanup");let ri=te;/*!
* tabbable 6.4.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/var fl=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],qo=fl.join(","),hl=typeof Element>"u",Sn=hl?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Yo=!hl&&Element.prototype.getRootNode?function(n){var t;return n==null||(t=n.getRootNode)===null||t===void 0?void 0:t.call(n)}:function(n){return n==null?void 0:n.ownerDocument},Go=function(t,e){var r;e===void 0&&(e=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||e&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Go(t.parentNode));return s},ad=function(t){var e,r=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return r===""||r==="true"},gl=function(t,e,r){if(Go(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(qo));return e&&Sn.call(t,qo)&&o.unshift(t),o=o.filter(r),o},Xo=function(t,e,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Go(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),c=l.length?l:s.children,d=Xo(c,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else{var h=Sn.call(s,qo);h&&r.filter(s)&&(e||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),v=!Go(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&v){var m=Xo(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return o},vl=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},pl=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ad(t))&&!vl(t)?0:t.tabIndex},ld=function(t,e){var r=pl(t);return r<0&&e&&!vl(t)?0:r},cd=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},ml=function(t){return t.tagName==="INPUT"},ud=function(t){return ml(t)&&t.type==="hidden"},dd=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return e},fd=function(t,e){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===e)return t[r]},hd=function(t){if(!t.name)return!0;var e=t.form||Yo(t),r=function(l){return e.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=fd(o,t.form);return!i||i===t},gd=function(t){return ml(t)&&t.type==="radio"},vd=function(t){return gd(t)&&!hd(t)},pd=function(t){var e,r=t&&Yo(t),o=(e=r)===null||e===void 0?void 0:e.host,i=!1;if(r&&r!==t){var s,l,c;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!i&&o;){var d,h,f;r=Yo(o),o=(d=r)===null||d===void 0?void 0:d.host,i=!!((h=o)!==null&&h!==void 0&&(f=h.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},_a=function(t){var e=t.getBoundingClientRect(),r=e.width,o=e.height;return r===0&&o===0},md=function(t,e){var r=e.displayCheck,o=e.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var s=Sn.call(t,"details>summary:first-of-type"),l=s?t.parentElement:t;if(Sn.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var d=t.parentElement,h=Yo(t);if(d&&!d.shadowRoot&&o(d)===!0)return _a(t);t.assignedSlot?t=t.assignedSlot:!d&&h!==t.ownerDocument?t=h.host:t=d}t=c}if(pd(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _a(t);return!1},yd=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var r=0;r<e.children.length;r++){var o=e.children.item(r);if(o.tagName==="LEGEND")return Sn.call(e,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}e=e.parentElement}return!1},jo=function(t,e){return!(e.disabled||ud(e)||md(e,t)||dd(e)||yd(e))},oi=function(t,e){return!(vd(e)||pl(e)<0||!jo(t,e))},bd=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},yl=function(t){var e=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,c=ld(l,s),d=s?yl(o.candidates):l;c===0?s?e.push.apply(e,d):e.push(l):r.push({documentOrder:i,tabIndex:c,item:o,isScope:s,content:d})}),r.sort(cd).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(e)},bl=function(t,e){e=e||{};var r;return e.getShadowRoot?r=Xo([t],e.includeContainer,{filter:oi.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:bd}):r=gl(t,e.includeContainer,oi.bind(null,e)),yl(r)},wl=function(t,e){e=e||{};var r;return e.getShadowRoot?r=Xo([t],e.includeContainer,{filter:jo.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):r=gl(t,e.includeContainer,jo.bind(null,e)),r},Fi=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return Sn.call(t,qo)===!1?!1:oi(e,t)},wd=fl.concat("iframe:not([inert]):not([inert] *)").join(","),xl=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return Sn.call(t,wd)===!1?!1:jo(e,t)};function hr(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function xd(n,t){if(!Fi(n,hr()))return _d(n,t);const e=Fo(n),r=bl(e.body,hr());t==="prev"&&r.reverse();const o=r.indexOf(n);return o===-1?e.body:r.slice(o+1)[0]}function _d(n,t){const e=Fo(n);if(!xl(n,hr()))return e.body;const r=wl(e.body,hr());t==="prev"&&r.reverse();const o=r.indexOf(n);return o===-1?e.body:r.slice(o+1).find(s=>Fi(s,hr()))??e.body}function _l(n,t,e){const r=t.toLowerCase();if(r.endsWith(" ")){const f=r.slice(0,-1);if(n.filter(w=>w.toLowerCase().startsWith(f)).length<=1)return _l(n,f,e);const m=e==null?void 0:e.toLowerCase();if(m&&m.startsWith(f)&&m.charAt(f.length)===" "&&t.trim()===f)return e;const g=n.filter(w=>w.toLowerCase().startsWith(r));if(g.length>0){const w=e?n.indexOf(e):-1;return Pa(g,Math.max(w,0)).find(E=>E!==e)||e}}const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=i.toLowerCase(),l=e?n.indexOf(e):-1;let c=Pa(n,Math.max(l,0));i.length===1&&(c=c.filter(f=>f!==e));const h=c.find(f=>f==null?void 0:f.toLowerCase().startsWith(s));return h!==e?h:void 0}function Pa(n,t){return n.map((e,r)=>n[(t+r)%n.length])}const Pd={afterMs:1e4,onChange:wt};function Pl(n,t){const{afterMs:e,onChange:r,getWindow:o}={...Pd,...t};let i=null,s=Z(fr(n));function l(){return o().setTimeout(()=>{O(s,n,!0),r==null||r(n)},e)}return Kt(()=>()=>{i&&o().clearTimeout(i)}),T(()=>u(s),c=>{O(s,c,!0),r==null||r(c),i&&o().clearTimeout(i),i=l()})}var Me,Ie,ss,is;class Sd{constructor(t){y(this,Me);y(this,Ie);y(this,ss,P(()=>a(this,Me).onMatch?a(this,Me).onMatch:t=>t.focus()));y(this,is,P(()=>a(this,Me).getCurrentItem?a(this,Me).getCurrentItem:a(this,Me).getActiveElement));V(this,Me,t),V(this,Ie,Pl("",{afterMs:1e3,getWindow:t.getWindow})),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,e){var c,d;if(!e.length)return;a(this,Ie).current=a(this,Ie).current+t;const r=u(a(this,is))(),o=((d=(c=e.find(h=>h===r))==null?void 0:c.textContent)==null?void 0:d.trim())??"",i=e.map(h=>{var f;return((f=h.textContent)==null?void 0:f.trim())??""}),s=_l(i,a(this,Ie).current,o),l=e.find(h=>{var f;return((f=h.textContent)==null?void 0:f.trim())===s});return l&&u(a(this,ss))(l),l}resetTypeahead(){a(this,Ie).current=""}get search(){return a(this,Ie).current}}Me=new WeakMap,Ie=new WeakMap,ss=new WeakMap,is=new WeakMap;var pn,Wr,zn,je,sn,si,ii;class Cd{constructor(t){y(this,sn);y(this,pn);y(this,Wr);y(this,zn);y(this,je,Z(null));V(this,pn,t),V(this,Wr,P(()=>a(this,pn).enabled())),V(this,zn,Pl(!1,{afterMs:t.transitTimeout??300,onChange:e=>{var r,o;u(a(this,Wr))&&((o=(r=a(this,pn)).setIsPointerInTransit)==null||o.call(r,e))},getWindow:()=>Ci(a(this,pn).triggerNode())})),Rt([t.triggerNode,t.contentNode,t.enabled],([e,r,o])=>{if(!e||!r||!o)return;const i=l=>{nt(this,sn,ii).call(this,l,r)},s=l=>{nt(this,sn,ii).call(this,l,e)};return In(It(e,"pointerleave",i),It(r,"pointerleave",s))}),Rt(()=>u(a(this,je)),()=>{const e=o=>{var d,h;if(!u(a(this,je)))return;const i=o.target;if(!Xs(i))return;const s={x:o.clientX,y:o.clientY},l=((d=t.triggerNode())==null?void 0:d.contains(i))||((h=t.contentNode())==null?void 0:h.contains(i)),c=!Td(s,u(a(this,je)));l?nt(this,sn,si).call(this):c&&(nt(this,sn,si).call(this),t.onPointerExit())},r=Fo(t.triggerNode()??t.contentNode());if(r)return It(r,"pointermove",e)})}}pn=new WeakMap,Wr=new WeakMap,zn=new WeakMap,je=new WeakMap,sn=new WeakSet,si=function(){O(a(this,je),null),a(this,zn).current=!1},ii=function(t,e){const r=t.currentTarget;if(!Le(r))return;const o={x:t.clientX,y:t.clientY},i=Od(o,r.getBoundingClientRect()),s=Ad(o,i),l=Ed(e.getBoundingClientRect()),c=Fd([...s,...l]);O(a(this,je),c,!0),a(this,zn).current=!0};function Od(n,t){const e=Math.abs(t.top-n.y),r=Math.abs(t.bottom-n.y),o=Math.abs(t.right-n.x),i=Math.abs(t.left-n.x);switch(Math.min(e,r,o,i)){case i:return"left";case o:return"right";case e:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ad(n,t,e=5){const r=e*1.5;switch(t){case"top":return[{x:n.x-e,y:n.y+e},{x:n.x,y:n.y-r},{x:n.x+e,y:n.y+e}];case"bottom":return[{x:n.x-e,y:n.y-e},{x:n.x,y:n.y+r},{x:n.x+e,y:n.y-e}];case"left":return[{x:n.x+e,y:n.y-e},{x:n.x-r,y:n.y},{x:n.x+e,y:n.y+e}];case"right":return[{x:n.x-e,y:n.y-e},{x:n.x+r,y:n.y},{x:n.x-e,y:n.y+e}]}}function Ed(n){const{top:t,right:e,bottom:r,left:o}=n;return[{x:o,y:t},{x:e,y:t},{x:e,y:r},{x:o,y:r}]}function Td(n,t){const{x:e,y:r}=n;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i].x,c=t[i].y,d=t[s].x,h=t[s].y;c>r!=h>r&&e<(d-l)*(r-c)/(h-c)+l&&(o=!o)}return o}function Fd(n){const t=n.slice();return t.sort((e,r)=>e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0),Md(t)}function Md(n){if(n.length<=1)return n.slice();const t=[];for(let r=0;r<n.length;r++){const o=n[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const e=[];for(let r=n.length-1;r>=0;r--){const o=n[r];for(;e.length>=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}return e.pop(),t.length===1&&e.length===1&&t[0].x===e[0].x&&t[0].y===e[0].y?t:t.concat(e)}const Id="data-context-menu-trigger",kd="data-context-menu-content",Dd=new cn("Menu.Root"),Mi=new cn("Menu.Root | Menu.Sub"),Sl=new cn("Menu.Content"),Nd=new td("bitsmenuopen",{bubbles:!1,cancelable:!0}),Rd=Ga({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});var zr,Kr;const ji=class ji{constructor(t){S(this,"opts");S(this,"isUsingKeyboard",new ri);y(this,zr,Z(!1));y(this,Kr,Z(!1));S(this,"getBitsAttr",t=>Rd.getAttr(t,this.opts.variant.current));this.opts=t}static create(t){const e=new ji(t);return Dd.set(e)}get ignoreCloseAutoFocus(){return u(a(this,zr))}set ignoreCloseAutoFocus(t){O(a(this,zr),t,!0)}get isPointerInTransit(){return u(a(this,Kr))}set isPointerInTransit(t){O(a(this,Kr),t,!0)}};zr=new WeakMap,Kr=new WeakMap;let ai=ji;var Vr,Hr;const Zi=class Zi{constructor(t,e,r){S(this,"opts");S(this,"root");S(this,"parentMenu");S(this,"contentId",T(()=>""));y(this,Vr,Z(null));S(this,"contentPresence");y(this,Hr,Z(null));this.opts=t,this.root=e,this.parentMenu=r,this.contentPresence=new Zs({ref:T(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&Rt(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}static create(t,e){return Mi.set(new Zi(t,e,null))}get contentNode(){return u(a(this,Vr))}set contentNode(t){O(a(this,Vr),t,!0)}get triggerNode(){return u(a(this,Hr))}set triggerNode(t){O(a(this,Hr),t,!0)}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}};Vr=new WeakMap,Hr=new WeakMap;let li=Zi;var Ur,qr,Yr,Gr,Xr,nn,Cl,Ko,jr,Zr;const Ji=class Ji{constructor(t,e){y(this,nn);S(this,"opts");S(this,"parentMenu");S(this,"rovingFocusGroup");S(this,"domContext");S(this,"attachment");y(this,Ur,Z(""));y(this,qr,0);y(this,Yr);y(this,Gr,Z(!1));y(this,Xr);S(this,"onCloseAutoFocus",t=>{var e,r;(r=(e=this.opts.onCloseAutoFocus).current)==null||r.call(e,t),!(t.defaultPrevented||a(this,Xr))&&this.parentMenu.triggerNode&&Fi(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())});y(this,jr,P(()=>({open:this.parentMenu.opts.open.current})));y(this,Zr,P(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Si(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment})));S(this,"popperProps",{onCloseAutoFocus:t=>this.onCloseAutoFocus(t)});this.opts=t,this.parentMenu=e,this.domContext=new Oi(t.ref),this.attachment=ce(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),e.contentId=t.id,V(this,Xr,t.isSub??!1),this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Cd({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>{var r;return this.parentMenu.opts.open.current&&!!((r=this.parentMenu.triggerNode)!=null&&r.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")))},onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),V(this,Yr,new Sd({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch),this.rovingFocusGroup=new Vu({rootNode:T(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:T(()=>"vertical")}),Rt(()=>this.parentMenu.contentNode,r=>{if(!r)return;const o=()=>{Re(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return Nd.listen(r,o)}),Kt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(a(this,qr))})}static create(t){return Sl.set(new Ji(t,Mi.get()))}get search(){return u(a(this,Ur))}set search(t){O(a(this,Ur),t,!0)}get mounted(){return u(a(this,Gr))}set mounted(t){O(a(this,Gr),t,!0)}handleTabKeyDown(t){let e=this.parentMenu;for(;e.parentMenu!==null;)e=e.parentMenu;if(!e.triggerNode)return;t.preventDefault();const r=xd(e.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,e.onClose(),Re(()=>{r.focus(),Re(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){var d,h;if(t.defaultPrevented)return;if(t.key===Du){this.handleTabKeyDown(t);return}const e=t.target,r=t.currentTarget;if(!Le(e)||!Le(r))return;const o=((d=e.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`))==null?void 0:d.id)===this.parentMenu.contentId.current,i=t.ctrlKey||t.altKey||t.metaKey,s=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(e,t)||t.code==="Space")return;const c=nt(this,nn,Cl).call(this);o&&!i&&s&&a(this,Yr).call(this,t.key,c),((h=t.target)==null?void 0:h.id)===this.parentMenu.contentId.current&&od.includes(t.key)&&(t.preventDefault(),dl.includes(t.key)&&c.reverse(),id(c,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){var e,r;Xs(t.currentTarget)&&Xs(t.target)&&((r=(e=t.currentTarget).contains)!=null&&r.call(e,t.target)||(this.domContext.getWindow().clearTimeout(a(this,qr)),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Re(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return nt(this,nn,Ko).call(this)}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||nt(this,nn,Ko).call(this)||this.parentMenu.root.isUsingKeyboard.current)return;const e=this.parentMenu.contentNode;e==null||e.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!nt(this,nn,Ko).call(this)}handleInteractOutside(t){var r;if(!al(t.target))return;const e=(r=this.parentMenu.triggerNode)==null?void 0:r.id;if(t.target.id===e){t.preventDefault();return}t.target.closest(`#${e}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}get snippetProps(){return u(a(this,jr))}set snippetProps(t){O(a(this,jr),t)}get props(){return u(a(this,Zr))}set props(t){O(a(this,Zr),t)}};Ur=new WeakMap,qr=new WeakMap,Yr=new WeakMap,Gr=new WeakMap,Xr=new WeakMap,nn=new WeakSet,Cl=function(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]},Ko=function(){return this.parentMenu.root.isPointerInTransit},jr=new WeakMap,Zr=new WeakMap;let ci=Ji;var Kn,Jr;class Bd{constructor(t,e){S(this,"opts");S(this,"content");S(this,"attachment");y(this,Kn,Z(!1));y(this,Jr,P(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":Xa(this.opts.disabled.current),"data-disabled":Xn(this.opts.disabled.current),"data-highlighted":u(a(this,Kn))?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment})));this.opts=t,this.content=e,this.attachment=ce(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&xa(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!Le(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||xa(t)&&this.content.onItemLeave(t)}onfocus(t){Re(()=>{t.defaultPrevented||this.opts.disabled.current||O(a(this,Kn),!0)})}onblur(t){Re(()=>{t.defaultPrevented||O(a(this,Kn),!1)})}get props(){return u(a(this,Jr))}set props(t){O(a(this,Jr),t)}}Kn=new WeakMap,Jr=new WeakMap;var Qr,as,Ol,$r;const Qi=class Qi{constructor(t,e){y(this,as);S(this,"opts");S(this,"item");S(this,"root");y(this,Qr,!1);y(this,$r,P(()=>Nt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown})));this.opts=t,this.item=e,this.root=e.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}static create(t){const e=new Bd(t,Sl.get());return new Qi(t,e)}onkeydown(t){const e=this.item.content.search!=="";if(!(this.item.opts.disabled.current||e&&t.key===Es)&&nd.includes(t.key)){if(!Le(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||nt(this,as,Ol).call(this)}onpointerup(t){var e;if(!t.defaultPrevented&&!a(this,Qr)){if(!Le(t.currentTarget))return;(e=t.currentTarget)==null||e.click()}}onpointerdown(t){V(this,Qr,!0)}get props(){return u(a(this,$r))}set props(t){O(a(this,$r),t)}};Qr=new WeakMap,as=new WeakSet,Ol=function(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()},$r=new WeakMap;let ui=Qi;var ls,to;const $i=class $i{constructor(t,e){S(this,"opts");S(this,"parentMenu");S(this,"attachment");S(this,"onclick",t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())});S(this,"onpointerdown",t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}});S(this,"onpointerup",t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())});S(this,"onkeydown",t=>{if(!this.opts.disabled.current){if(t.key===Es||t.key===Ti){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===gr&&(this.parentMenu.onOpen(),t.preventDefault())}});y(this,ls,P(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current}));y(this,to,P(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":Xa(this.parentMenu.opts.open.current),"aria-controls":u(a(this,ls)),"data-disabled":Xn(this.opts.disabled.current),"data-state":Si(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment})));this.opts=t,this.parentMenu=e,this.attachment=ce(this.opts.ref,r=>this.parentMenu.triggerNode=r)}static create(t){return new $i(t,Mi.get())}get props(){return u(a(this,to))}set props(t){O(a(this,to),t)}};ls=new WeakMap,to=new WeakMap;let di=$i;globalThis.bitsDismissableLayers??(globalThis.bitsDismissableLayers=new Map);var Vn,mn,Ze,Hn,Un,Je,eo,ke,cs,Zn,Al,us,qn,ds,fs,hs,gs,no,El,vs,ps;const ta=class ta{constructor(t){y(this,Zn);S(this,"opts");y(this,Vn);y(this,mn);y(this,Ze,{pointerdown:!1});y(this,Hn,!1);y(this,Un,!1);y(this,Je);y(this,eo);y(this,ke,wt);y(this,cs,t=>{t.defaultPrevented||this.opts.ref.current&&Re(()=>{var e,r;!this.opts.ref.current||a(this,gs).call(this,t.target)||t.target&&!a(this,Un)&&((r=(e=a(this,eo)).current)==null||r.call(e,t))})});y(this,us,t=>{let e=t;e.defaultPrevented&&(e=Sa(t)),a(this,Vn).current(t)});y(this,qn,wa(t=>{if(!this.opts.ref.current){a(this,ke).call(this);return}const e=this.opts.isValidEvent.current(t,this.opts.ref.current)||zd(t,this.opts.ref.current);if(!a(this,Hn)||nt(this,Zn,El).call(this)||!e){a(this,ke).call(this);return}let r=t;if(r.defaultPrevented&&(r=Sa(r)),a(this,mn).current!=="close"&&a(this,mn).current!=="defer-otherwise-close"){a(this,ke).call(this);return}t.pointerType==="touch"?(a(this,ke).call(this),V(this,ke,It(a(this,Je),"click",a(this,us),{once:!0}))):a(this,Vn).current(r)},10));y(this,ds,t=>{a(this,Ze)[t.type]=!0});y(this,fs,t=>{a(this,Ze)[t.type]=!1});y(this,hs,()=>{this.opts.ref.current&&V(this,Hn,Wd(this.opts.ref.current))});y(this,gs,t=>this.opts.ref.current?cl(this.opts.ref.current,t):!1);y(this,no,wa(()=>{for(const t in a(this,Ze))a(this,Ze)[t]=!1;V(this,Hn,!1)},20));y(this,vs,()=>{V(this,Un,!0)});y(this,ps,()=>{V(this,Un,!1)});S(this,"props",{onfocuscapture:a(this,vs),onblurcapture:a(this,ps)});this.opts=t,V(this,mn,t.interactOutsideBehavior),V(this,Vn,t.onInteractOutside),V(this,eo,t.onFocusOutside),Kt(()=>{V(this,Je,ul(this.opts.ref.current))});let e=wt;const r=()=>{a(this,no).call(this),globalThis.bitsDismissableLayers.delete(this),a(this,qn).destroy(),e()};Rt([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Pu(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,a(this,mn)),e(),e=nt(this,Zn,Al).call(this))}),r}),Jn(()=>{a(this,no).destroy(),globalThis.bitsDismissableLayers.delete(this),a(this,qn).destroy(),a(this,ke).call(this),e()})}static create(t){return new ta(t)}};Vn=new WeakMap,mn=new WeakMap,Ze=new WeakMap,Hn=new WeakMap,Un=new WeakMap,Je=new WeakMap,eo=new WeakMap,ke=new WeakMap,cs=new WeakMap,Zn=new WeakSet,Al=function(){return In(It(a(this,Je),"pointerdown",In(a(this,ds),a(this,hs)),{capture:!0}),It(a(this,Je),"pointerdown",In(a(this,fs),a(this,qn))),It(a(this,Je),"focusin",a(this,cs)))},us=new WeakMap,qn=new WeakMap,ds=new WeakMap,fs=new WeakMap,hs=new WeakMap,gs=new WeakMap,no=new WeakMap,El=function(){return Object.values(a(this,Ze)).some(Boolean)},vs=new WeakMap,ps=new WeakMap;let fi=ta;function Ld(n=[...globalThis.bitsDismissableLayers]){return n.findLast(([t,{current:e}])=>e==="close"||e==="ignore")}function Wd(n){const t=[...globalThis.bitsDismissableLayers],e=Ld(t);if(e)return e[0].opts.ref.current===n;const[r]=t[0];return r.opts.ref.current===n}function zd(n,t){const e=n.target;if(!al(e))return!1;const r=!!e.closest(`[${Id}]`);if("button"in n&&n.button>0&&!r)return!1;if("button"in n&&n.button===0&&r)return!0;const o=!!t.closest(`[${kd}]`);return r&&o?!1:ul(e).documentElement.contains(e)&&!cl(t,e)&&ed(n,t)}function Sa(n){const t=n.currentTarget,e=n.target;let r;n instanceof PointerEvent?r=new PointerEvent(n.type,n):r=new PointerEvent("pointerdown",n);let o=!1;return new Proxy(r,{get:(s,l)=>l==="currentTarget"?t:l==="target"?e:l==="preventDefault"?()=>{o=!0,typeof s.preventDefault=="function"&&s.preventDefault()}:l==="defaultPrevented"?o:l in s?s[l]:n[l]})}function Tl(n,t){G(t,!0);let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"onInteractOutside",3,wt),o=b(t,"onFocusOutside",3,wt),i=b(t,"isValidEvent",3,()=>!1);const s=fi.create({id:T(()=>t.id),interactOutsideBehavior:T(()=>e()),onInteractOutside:T(()=>r()),enabled:T(()=>t.enabled),onFocusOutside:T(()=>o()),isValidEvent:T(()=>i()),ref:t.ref});var l=N(),c=C(l);Y(c,()=>t.children??ot,()=>({props:s.props})),p(n,l),X()}globalThis.bitsEscapeLayers??(globalThis.bitsEscapeLayers=new Map);var ms,ys;const ea=class ea{constructor(t){S(this,"opts");S(this,"domContext");y(this,ms,()=>It(this.domContext.getDocument(),"keydown",a(this,ys),{passive:!1}));y(this,ys,t=>{if(t.key!==Mu||!Kd(this))return;const e=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(e)});this.opts=t,this.domContext=new Oi(this.opts.ref);let e=wt;Rt(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),e=a(this,ms).call(this)),()=>{e(),globalThis.bitsEscapeLayers.delete(this)}))}static create(t){return new ea(t)}};ms=new WeakMap,ys=new WeakMap;let hi=ea;function Kd(n){const t=[...globalThis.bitsEscapeLayers],e=t.findLast(([o,{current:i}])=>i==="close"||i==="ignore");if(e)return e[0]===n;const[r]=t[0];return r===n}function Fl(n,t){G(t,!0);let e=b(t,"escapeKeydownBehavior",3,"close"),r=b(t,"onEscapeKeydown",3,wt);hi.create({escapeKeydownBehavior:T(()=>e()),onEscapeKeydown:T(()=>r()),enabled:T(()=>t.enabled),ref:t.ref});var o=N(),i=C(o);Y(i,()=>t.children??ot),p(n,o),X()}var De,ro,yn;const bs=class bs{constructor(){y(this,De,Ne([]));y(this,ro,new WeakMap);y(this,yn,new WeakMap)}static getInstance(){return this.instance||(this.instance=new bs),this.instance}register(t){const e=this.getActive();e&&e!==t&&e.pause();const r=document.activeElement;r&&r!==document.body&&a(this,yn).set(t,r),a(this,De).current=a(this,De).current.filter(o=>o!==t),a(this,De).current.unshift(t)}unregister(t){a(this,De).current=a(this,De).current.filter(r=>r!==t);const e=this.getActive();e&&e.resume()}getActive(){return a(this,De).current[0]}setFocusMemory(t,e){a(this,ro).set(t,e)}getFocusMemory(t){return a(this,ro).get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,e){a(this,yn).set(t,e)}getPreFocusMemory(t){return a(this,yn).get(t)}clearPreFocusMemory(t){a(this,yn).delete(t)}};De=new WeakMap,ro=new WeakMap,yn=new WeakMap,S(bs,"instance");let gi=bs;var Qe,Wt,qt,bn,$e,Ft,Ml,Il,kl,Dl,pi,Vo,mi;const na=class na{constructor(t){y(this,Ft);y(this,Qe,!1);y(this,Wt,null);y(this,qt,gi.getInstance());y(this,bn,[]);y(this,$e);V(this,$e,t)}get paused(){return a(this,Qe)}pause(){V(this,Qe,!0)}resume(){V(this,Qe,!1)}mount(t){a(this,Wt)&&this.unmount(),V(this,Wt,t),a(this,qt).register(this),nt(this,Ft,Dl).call(this),nt(this,Ft,Il).call(this)}unmount(){a(this,Wt)&&(nt(this,Ft,Ml).call(this),nt(this,Ft,kl).call(this),a(this,qt).unregister(this),a(this,qt).clearPreFocusMemory(this),V(this,Wt,null))}static use(t){let e=null;return Rt([()=>t.ref.current,()=>t.enabled.current],([r,o])=>{r&&o?(e||(e=new na(t)),e.mount(r)):e&&(e.unmount(),e=null)}),Jn(()=>{e==null||e.unmount()}),{get props(){return{tabindex:-1}}}}};Qe=new WeakMap,Wt=new WeakMap,qt=new WeakMap,bn=new WeakMap,$e=new WeakMap,Ft=new WeakSet,Ml=function(){for(const t of a(this,bn))t();V(this,bn,[])},Il=function(){if(!a(this,Wt))return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});a(this,$e).onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!a(this,Wt))return;const e=nt(this,Ft,Vo).call(this);e?(e.focus(),a(this,qt).setFocusMemory(this,e)):a(this,Wt).focus()})},kl=function(){var e,r;const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if((r=(e=a(this,$e).onCloseAutoFocus).current)==null||r.call(e,t),!t.defaultPrevented){const o=a(this,qt).getPreFocusMemory(this);if(o&&document.contains(o))try{o.focus()}catch{document.body.focus()}}},Dl=function(){if(!a(this,Wt)||!a(this,$e).trap.current)return;const t=a(this,Wt),e=t.ownerDocument,r=s=>{if(a(this,Qe)||!a(this,qt).isActiveScope(this))return;const l=s.target;if(!l)return;if(t.contains(l))a(this,qt).setFocusMemory(this,l);else{const d=a(this,qt).getFocusMemory(this);if(d&&t.contains(d)&&xl(d))s.preventDefault(),d.focus();else{const h=nt(this,Ft,Vo).call(this),f=nt(this,Ft,mi).call(this)[0];(h||f||t).focus()}}},o=s=>{if(!a(this,$e).loop||a(this,Qe)||s.key!=="Tab"||!a(this,qt).isActiveScope(this))return;const l=nt(this,Ft,pi).call(this);if(l.length===0)return;const c=l[0],d=l[l.length-1];!s.shiftKey&&e.activeElement===d?(s.preventDefault(),c.focus()):s.shiftKey&&e.activeElement===c&&(s.preventDefault(),d.focus())};a(this,bn).push(It(e,"focusin",r,{capture:!0}),It(t,"keydown",o));const i=new MutationObserver(()=>{const s=a(this,qt).getFocusMemory(this);if(s&&!t.contains(s)){const l=nt(this,Ft,Vo).call(this),c=nt(this,Ft,mi).call(this)[0],d=l||c;d?(d.focus(),a(this,qt).setFocusMemory(this,d)):t.focus()}});i.observe(t,{childList:!0,subtree:!0}),a(this,bn).push(()=>i.disconnect())},pi=function(){return a(this,Wt)?bl(a(this,Wt),{includeContainer:!1,getShadowRoot:!0}):[]},Vo=function(){return nt(this,Ft,pi).call(this)[0]||null},mi=function(){return a(this,Wt)?wl(a(this,Wt),{includeContainer:!1,getShadowRoot:!0}):[]};let vi=na;function Nl(n,t){G(t,!0);let e=b(t,"enabled",3,!1),r=b(t,"trapFocus",3,!1),o=b(t,"loop",3,!1),i=b(t,"onCloseAutoFocus",3,wt),s=b(t,"onOpenAutoFocus",3,wt);const l=vi.use({enabled:T(()=>e()),trap:T(()=>r()),loop:o(),onCloseAutoFocus:T(()=>i()),onOpenAutoFocus:T(()=>s()),ref:t.ref});var c=N(),d=C(c);Y(d,()=>t.focusScope??ot,()=>({props:l.props})),p(n,c),X()}globalThis.bitsTextSelectionLayers??(globalThis.bitsTextSelectionLayers=new Map);var Yn,ws,Rl,xs,oo;const ra=class ra{constructor(t){y(this,ws);S(this,"opts");S(this,"domContext");y(this,Yn,wt);y(this,xs,t=>{const e=this.opts.ref.current,r=t.target;!Le(e)||!Le(r)||!this.opts.enabled.current||!Hd(this)||!Tu(e,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&V(this,Yn,Vd(e,this.domContext.getDocument().body)))});y(this,oo,()=>{a(this,Yn).call(this),V(this,Yn,wt)});this.opts=t,this.domContext=new Oi(t.ref);let e=wt;Rt(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),e(),e=nt(this,ws,Rl).call(this)),()=>{e(),a(this,oo).call(this),globalThis.bitsTextSelectionLayers.delete(this)}))}static create(t){return new ra(t)}};Yn=new WeakMap,ws=new WeakSet,Rl=function(){return In(It(this.domContext.getDocument(),"pointerdown",a(this,xs)),It(this.domContext.getDocument(),"pointerup",Zc(a(this,oo),this.opts.onPointerUp.current)))},xs=new WeakMap,oo=new WeakMap;let yi=ra;const Ca=n=>n.style.userSelect||n.style.webkitUserSelect;function Vd(n,t){const e=Ca(t),r=Ca(n);return No(t,"none"),No(n,"text"),()=>{No(t,e),No(n,r)}}function No(n,t){n.style.userSelect=t,n.style.webkitUserSelect=t}function Hd(n){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const e=t.at(-1);return e?e[0]===n:!1}function Bl(n,t){G(t,!0);let e=b(t,"preventOverflowTextSelection",3,!0),r=b(t,"onPointerDown",3,wt),o=b(t,"onPointerUp",3,wt);yi.create({id:T(()=>t.id),onPointerDown:T(()=>r()),onPointerUp:T(()=>o()),enabled:T(()=>t.enabled&&e()),ref:t.ref});var i=N(),s=C(i);Y(s,()=>t.children??ot),p(n,i),X()}globalThis.bitsIdCounter??(globalThis.bitsIdCounter={current:0});function Ii(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}var so,Gn,wn,xn,_s,Ll;class Ud{constructor(t){y(this,_s);y(this,so);y(this,Gn,0);y(this,wn,Z());y(this,xn);V(this,so,t)}get(...t){return V(this,Gn,a(this,Gn)+1),u(a(this,wn))===void 0&&V(this,xn,Ua(()=>{O(a(this,wn),a(this,so).call(this,...t),!0)})),Kt(()=>()=>{nt(this,_s,Ll).call(this)}),u(a(this,wn))}}so=new WeakMap,Gn=new WeakMap,wn=new WeakMap,xn=new WeakMap,_s=new WeakSet,Ll=function(){V(this,Gn,a(this,Gn)-1),a(this,xn)&&a(this,Gn)<=0&&(a(this,xn).call(this),O(a(this,wn),void 0),V(this,xn,void 0))};const Ho=new Ys;let Ro=Z(null),dn=null,lr=null,cr=!1;const Oa=T(()=>{for(const n of Ho.values())if(n)return!0;return!1});let Ks=null;const qd=new Ud(()=>{function n(){document.body.setAttribute("style",u(Ro)??""),document.body.style.removeProperty("--scrollbar-width"),ba&&(dn==null||dn()),O(Ro,null)}function t(){lr!==null&&(window.clearTimeout(lr),lr=null)}function e(o,i){t(),cr=!0,Ks=Date.now();const s=Ks,l=()=>{lr=null,Ks===s&&(Wl(Ho)?cr=!1:(cr=!1,i()))},c=o===null?24:o;lr=window.setTimeout(l,c)}function r(){u(Ro)===null&&Ho.size===0&&!cr&&O(Ro,document.body.getAttribute("style"),!0)}return Rt(()=>Oa.current,()=>{var h,f;if(!Oa.current)return;r(),cr=!1;const o=getComputedStyle(document.documentElement),i=getComputedStyle(document.body),s=((h=o.scrollbarGutter)==null?void 0:h.includes("stable"))||((f=i.scrollbarGutter)==null?void 0:f.includes("stable")),l=window.innerWidth-document.documentElement.clientWidth,d={padding:Number.parseInt(i.paddingRight??"0",10)+l,margin:Number.parseInt(i.marginRight??"0",10)};l>0&&!s&&(document.body.style.paddingRight=`${d.padding}px`,document.body.style.marginRight=`${d.margin}px`,document.body.style.setProperty("--scrollbar-width",`${l}px`)),document.body.style.overflow="hidden",ba&&(dn=It(document,"touchmove",v=>{v.target===document.documentElement&&(v.touches.length>1||v.preventDefault())},{passive:!1})),Re(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),Jn(()=>()=>{dn==null||dn()}),{get lockMap(){return Ho},resetBodyStyle:n,scheduleCleanupIfNoNewLocks:e,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});var _n,io,ao,Yt;class Yd{constructor(t,e=()=>null){y(this,_n,Ii());y(this,io);y(this,ao,()=>null);y(this,Yt);S(this,"locked");V(this,io,t),V(this,ao,e),V(this,Yt,qd.get()),a(this,Yt)&&(a(this,Yt).cancelPendingCleanup(),a(this,Yt).ensureInitialStyleCaptured(),a(this,Yt).lockMap.set(a(this,_n),a(this,io)??!1),this.locked=T(()=>a(this,Yt).lockMap.get(a(this,_n))??!1,r=>a(this,Yt).lockMap.set(a(this,_n),r)),Jn(()=>{if(a(this,Yt).lockMap.delete(a(this,_n)),Wl(a(this,Yt).lockMap))return;const r=a(this,ao).call(this);a(this,Yt).scheduleCleanupIfNoNewLocks(r,()=>{a(this,Yt).resetBodyStyle()})}))}}_n=new WeakMap,io=new WeakMap,ao=new WeakMap,Yt=new WeakMap;function Wl(n){for(const[t,e]of n)if(e)return!0;return!1}function Zo(n,t){G(t,!0);let e=b(t,"preventScroll",3,!0),r=b(t,"restoreScrollDelay",3,null);e()&&new Yd(e(),()=>r()),X()}var Gd=U("<div><!></div>");function Xd(n,t){const e=an();G(t,!0);let r=b(t,"id",19,()=>ln(e)),o=b(t,"forceMount",3,!1),i=b(t,"ref",15,null),s=st(t,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const l=ni.create({id:T(()=>r()),ref:T(()=>i(),v=>i(v))}),c=P(()=>Nt(s,l.props));var d=N(),h=C(d);{var f=v=>{var m=N(),g=C(m);{var w=_=>{var E=N(),I=C(E);{let A=P(()=>({props:Nt(u(c)),...l.snippetProps}));Y(I,()=>t.child,()=>u(A))}p(_,E)},x=_=>{var E=Gd();Tt(E,A=>({...A}),[()=>Nt(u(c))]);var I=z(E);Y(I,()=>t.children??ot,()=>l.snippetProps),K(E),p(_,E)};bt(g,_=>{t.child?_(w):_(x,!1)})}p(v,m)};bt(h,v=>{(l.shouldRender||o())&&v(f)})}p(n,d),X()}var jd=U("<div><!></div>");function Zd(n,t){const e=an();G(t,!0);let r=b(t,"id",19,()=>ln(e)),o=b(t,"ref",15,null),i=st(t,["$$slots","$$events","$$legacy","id","children","child","ref"]);const s=ti.create({id:T(()=>r()),ref:T(()=>o(),v=>o(v))}),l=P(()=>Nt(i,s.props));var c=N(),d=C(c);{var h=v=>{var m=N(),g=C(m);Y(g,()=>t.child,()=>({props:u(l)})),p(v,m)},f=v=>{var m=jd();Tt(m,()=>({...u(l)}));var g=z(m);Y(g,()=>t.children??ot),K(m),p(v,m)};bt(d,v=>{t.child?v(h):v(f,!1)})}p(n,c),X()}const Jd=["top","right","bottom","left"],rn=Math.min,Xt=Math.max,Jo=Math.round,Bo=Math.floor,be=n=>({x:n,y:n}),Qd={left:"right",right:"left",bottom:"top",top:"bottom"},$d={start:"end",end:"start"};function bi(n,t,e){return Xt(n,rn(t,e))}function We(n,t){return typeof n=="function"?n(t):n}function ze(n){return n.split("-")[0]}function Qn(n){return n.split("-")[1]}function ki(n){return n==="x"?"y":"x"}function Di(n){return n==="y"?"height":"width"}const tf=new Set(["top","bottom"]);function ye(n){return tf.has(ze(n))?"y":"x"}function Ni(n){return ki(ye(n))}function ef(n,t,e){e===void 0&&(e=!1);const r=Qn(n),o=Ni(n),i=Di(o);let s=o==="x"?r===(e?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Qo(s)),[s,Qo(s)]}function nf(n){const t=Qo(n);return[wi(n),t,wi(t)]}function wi(n){return n.replace(/start|end/g,t=>$d[t])}const Aa=["left","right"],Ea=["right","left"],rf=["top","bottom"],of=["bottom","top"];function sf(n,t,e){switch(n){case"top":case"bottom":return e?t?Ea:Aa:t?Aa:Ea;case"left":case"right":return t?rf:of;default:return[]}}function af(n,t,e,r){const o=Qn(n);let i=sf(ze(n),e==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(wi)))),i}function Qo(n){return n.replace(/left|right|bottom|top/g,t=>Qd[t])}function lf(n){return{top:0,right:0,bottom:0,left:0,...n}}function zl(n){return typeof n!="number"?lf(n):{top:n,right:n,bottom:n,left:n}}function $o(n){const{x:t,y:e,width:r,height:o}=n;return{width:r,height:o,top:e,left:t,right:t+r,bottom:e+o,x:t,y:e}}function Ta(n,t,e){let{reference:r,floating:o}=n;const i=ye(t),s=Ni(t),l=Di(s),c=ze(t),d=i==="y",h=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,v=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:h,y:r.y-o.height};break;case"bottom":m={x:h,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Qn(t)){case"start":m[s]-=v*(e&&d?-1:1);break;case"end":m[s]+=v*(e&&d?-1:1);break}return m}async function cf(n,t){var e;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:c}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:v=!1,padding:m=0}=We(t,n),g=zl(m),x=l[v?f==="floating"?"reference":"floating":f],_=$o(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(x)))==null||e?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:c})),E=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),A=await(i.isElement==null?void 0:i.isElement(I))?await(i.getScale==null?void 0:i.getScale(I))||{x:1,y:1}:{x:1,y:1},F=$o(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:I,strategy:c}):E);return{top:(_.top-F.top+g.top)/A.y,bottom:(F.bottom-_.bottom+g.bottom)/A.y,left:(_.left-F.left+g.left)/A.x,right:(F.right-_.right+g.right)/A.x}}const uf=async(n,t,e)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=e,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:n,floating:t,strategy:o}),{x:h,y:f}=Ta(d,r,c),v=r,m={},g=0;for(let x=0;x<l.length;x++){var w;const{name:_,fn:E}=l[x],{x:I,y:A,data:F,reset:R}=await E({x:h,y:f,initialPlacement:r,placement:v,strategy:o,middlewareData:m,rects:d,platform:{...s,detectOverflow:(w=s.detectOverflow)!=null?w:cf},elements:{reference:n,floating:t}});h=I??h,f=A??f,m={...m,[_]:{...m[_],...F}},R&&g<=50&&(g++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(d=R.rects===!0?await s.getElementRects({reference:n,floating:t,strategy:o}):R.rects),{x:h,y:f}=Ta(d,v,c)),x=-1)}return{x:h,y:f,placement:v,strategy:o,middlewareData:m}},df=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=We(n,t)||{};if(d==null)return{};const f=zl(h),v={x:e,y:r},m=Ni(o),g=Di(m),w=await s.getDimensions(d),x=m==="y",_=x?"top":"left",E=x?"bottom":"right",I=x?"clientHeight":"clientWidth",A=i.reference[g]+i.reference[m]-v[m]-i.floating[g],F=v[m]-i.reference[m],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let k=R?R[I]:0;(!k||!await(s.isElement==null?void 0:s.isElement(R)))&&(k=l.floating[I]||i.floating[g]);const H=A/2-F/2,rt=k/2-w[g]/2-1,et=rn(f[_],rt),pt=rn(f[E],rt),gt=et,St=k-w[g]-pt,lt=k/2-w[g]/2+H,it=bi(gt,lt,St),J=!c.arrow&&Qn(o)!=null&&lt!==it&&i.reference[g]/2-(lt<gt?et:pt)-w[g]/2<0,ct=J?lt<gt?lt-gt:lt-St:0;return{[m]:v[m]+ct,data:{[m]:it,centerOffset:lt-it-ct,...J&&{alignmentOffset:ct}},reset:J}}}),ff=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:v,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...x}=We(n,t);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const _=ze(o),E=ye(l),I=ze(l)===l,A=await(c.isRTL==null?void 0:c.isRTL(d.floating)),F=v||(I||!w?[Qo(l)]:nf(l)),R=g!=="none";!v&&R&&F.push(...af(l,w,g,A));const k=[l,...F],H=await c.detectOverflow(t,x),rt=[];let et=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&rt.push(H[_]),f){const lt=ef(o,s,A);rt.push(H[lt[0]],H[lt[1]])}if(et=[...et,{placement:o,overflows:rt}],!rt.every(lt=>lt<=0)){var pt,gt;const lt=(((pt=i.flip)==null?void 0:pt.index)||0)+1,it=k[lt];if(it&&(!(f==="alignment"?E!==ye(it):!1)||et.every(Q=>ye(Q.placement)===E?Q.overflows[0]>0:!0)))return{data:{index:lt,overflows:et},reset:{placement:it}};let J=(gt=et.filter(ct=>ct.overflows[0]<=0).sort((ct,Q)=>ct.overflows[1]-Q.overflows[1])[0])==null?void 0:gt.placement;if(!J)switch(m){case"bestFit":{var St;const ct=(St=et.filter(Q=>{if(R){const Ct=ye(Q.placement);return Ct===E||Ct==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(Ct=>Ct>0).reduce((Ct,Bt)=>Ct+Bt,0)]).sort((Q,Ct)=>Q[1]-Ct[1])[0])==null?void 0:St[0];ct&&(J=ct);break}case"initialPlacement":J=l;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function Fa(n,t){return{top:n.top-t.height,right:n.right-t.width,bottom:n.bottom-t.height,left:n.left-t.width}}function Ma(n){return Jd.some(t=>n[t]>=0)}const hf=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(t){const{rects:e,platform:r}=t,{strategy:o="referenceHidden",...i}=We(n,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),l=Fa(s,e.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Ma(l)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),l=Fa(s,e.floating);return{data:{escapedOffsets:l,escaped:Ma(l)}}}default:return{}}}}},Kl=new Set(["left","top"]);async function gf(n,t){const{placement:e,platform:r,elements:o}=n,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ze(e),l=Qn(e),c=ye(e)==="y",d=Kl.has(s)?-1:1,h=i&&c?-1:1,f=We(t,n);let{mainAxis:v,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*h,y:v*d}:{x:v*d,y:m*h}}const vf=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,r;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await gf(t,n);return s===((e=l.offset)==null?void 0:e.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},pf=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:_=>{let{x:E,y:I}=_;return{x:E,y:I}}},...d}=We(n,t),h={x:e,y:r},f=await i.detectOverflow(t,d),v=ye(ze(o)),m=ki(v);let g=h[m],w=h[v];if(s){const _=m==="y"?"top":"left",E=m==="y"?"bottom":"right",I=g+f[_],A=g-f[E];g=bi(I,g,A)}if(l){const _=v==="y"?"top":"left",E=v==="y"?"bottom":"right",I=w+f[_],A=w-f[E];w=bi(I,w,A)}const x=c.fn({...t,[m]:g,[v]:w});return{...x,data:{x:x.x-e,y:x.y-r,enabled:{[m]:s,[v]:l}}}}}},mf=function(n){return n===void 0&&(n={}),{options:n,fn(t){const{x:e,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=We(n,t),h={x:e,y:r},f=ye(o),v=ki(f);let m=h[v],g=h[f];const w=We(l,t),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const I=v==="y"?"height":"width",A=i.reference[v]-i.floating[I]+x.mainAxis,F=i.reference[v]+i.reference[I]-x.mainAxis;m<A?m=A:m>F&&(m=F)}if(d){var _,E;const I=v==="y"?"width":"height",A=Kl.has(ze(o)),F=i.reference[f]-i.floating[I]+(A&&((_=s.offset)==null?void 0:_[f])||0)+(A?0:x.crossAxis),R=i.reference[f]+i.reference[I]+(A?0:((E=s.offset)==null?void 0:E[f])||0)-(A?x.crossAxis:0);g<F?g=F:g>R&&(g=R)}return{[v]:m,[f]:g}}}},yf=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,r;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=We(n,t),h=await s.detectOverflow(t,d),f=ze(o),v=Qn(o),m=ye(o)==="y",{width:g,height:w}=i.floating;let x,_;f==="top"||f==="bottom"?(x=f,_=v===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=f,x=v==="end"?"top":"bottom");const E=w-h.top-h.bottom,I=g-h.left-h.right,A=rn(w-h[x],E),F=rn(g-h[_],I),R=!t.middlewareData.shift;let k=A,H=F;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(H=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=E),R&&!v){const et=Xt(h.left,0),pt=Xt(h.right,0),gt=Xt(h.top,0),St=Xt(h.bottom,0);m?H=g-2*(et!==0||pt!==0?et+pt:Xt(h.left,h.right)):k=w-2*(gt!==0||St!==0?gt+St:Xt(h.top,h.bottom))}await c({...t,availableWidth:H,availableHeight:k});const rt=await s.getDimensions(l.floating);return g!==rt.width||w!==rt.height?{reset:{rects:!0}}:{}}}};function Ts(){return typeof window<"u"}function $n(n){return Vl(n)?(n.nodeName||"").toLowerCase():"#document"}function jt(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function xe(n){var t;return(t=(Vl(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Vl(n){return Ts()?n instanceof Node||n instanceof jt(n).Node:!1}function ue(n){return Ts()?n instanceof Element||n instanceof jt(n).Element:!1}function we(n){return Ts()?n instanceof HTMLElement||n instanceof jt(n).HTMLElement:!1}function Ia(n){return!Ts()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof jt(n).ShadowRoot}const bf=new Set(["inline","contents"]);function Mo(n){const{overflow:t,overflowX:e,overflowY:r,display:o}=de(n);return/auto|scroll|overlay|hidden|clip/.test(t+r+e)&&!bf.has(o)}const wf=new Set(["table","td","th"]);function xf(n){return wf.has($n(n))}const _f=[":popover-open",":modal"];function Fs(n){return _f.some(t=>{try{return n.matches(t)}catch{return!1}})}const Pf=["transform","translate","scale","rotate","perspective"],Sf=["transform","translate","scale","rotate","perspective","filter"],Cf=["paint","layout","strict","content"];function Ri(n){const t=Bi(),e=ue(n)?de(n):n;return Pf.some(r=>e[r]?e[r]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||Sf.some(r=>(e.willChange||"").includes(r))||Cf.some(r=>(e.contain||"").includes(r))}function Of(n){let t=on(n);for(;we(t)&&!jn(t);){if(Ri(t))return t;if(Fs(t))return null;t=on(t)}return null}function Bi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Af=new Set(["html","body","#document"]);function jn(n){return Af.has($n(n))}function de(n){return jt(n).getComputedStyle(n)}function Ms(n){return ue(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function on(n){if($n(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Ia(n)&&n.host||xe(n);return Ia(t)?t.host:t}function Hl(n){const t=on(n);return jn(t)?n.ownerDocument?n.ownerDocument.body:n.body:we(t)&&Mo(t)?t:Hl(t)}function vr(n,t,e){var r;t===void 0&&(t=[]),e===void 0&&(e=!0);const o=Hl(n),i=o===((r=n.ownerDocument)==null?void 0:r.body),s=jt(o);if(i){const l=xi(s);return t.concat(s,s.visualViewport||[],Mo(o)?o:[],l&&e?vr(l):[])}return t.concat(o,vr(o,[],e))}function xi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Ul(n){const t=de(n);let e=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=we(n),i=o?n.offsetWidth:e,s=o?n.offsetHeight:r,l=Jo(e)!==i||Jo(r)!==s;return l&&(e=i,r=s),{width:e,height:r,$:l}}function Li(n){return ue(n)?n:n.contextElement}function kn(n){const t=Li(n);if(!we(t))return be(1);const e=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ul(t);let s=(i?Jo(e.width):e.width)/r,l=(i?Jo(e.height):e.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ef=be(0);function ql(n){const t=jt(n);return!Bi()||!t.visualViewport?Ef:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tf(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==jt(n)?!1:t}function Cn(n,t,e,r){t===void 0&&(t=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),i=Li(n);let s=be(1);t&&(r?ue(r)&&(s=kn(r)):s=kn(n));const l=Tf(i,e,r)?ql(i):be(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,h=o.width/s.x,f=o.height/s.y;if(i){const v=jt(i),m=r&&ue(r)?jt(r):r;let g=v,w=xi(g);for(;w&&r&&m!==g;){const x=kn(w),_=w.getBoundingClientRect(),E=de(w),I=_.left+(w.clientLeft+parseFloat(E.paddingLeft))*x.x,A=_.top+(w.clientTop+parseFloat(E.paddingTop))*x.y;c*=x.x,d*=x.y,h*=x.x,f*=x.y,c+=I,d+=A,g=jt(w),w=xi(g)}}return $o({width:h,height:f,x:c,y:d})}function Is(n,t){const e=Ms(n).scrollLeft;return t?t.left+e:Cn(xe(n)).left+e}function Yl(n,t){const e=n.getBoundingClientRect(),r=e.left+t.scrollLeft-Is(n,e),o=e.top+t.scrollTop;return{x:r,y:o}}function Ff(n){let{elements:t,rect:e,offsetParent:r,strategy:o}=n;const i=o==="fixed",s=xe(r),l=t?Fs(t.floating):!1;if(r===s||l&&i)return e;let c={scrollLeft:0,scrollTop:0},d=be(1);const h=be(0),f=we(r);if((f||!f&&!i)&&(($n(r)!=="body"||Mo(s))&&(c=Ms(r)),we(r))){const m=Cn(r);d=kn(r),h.x=m.x+r.clientLeft,h.y=m.y+r.clientTop}const v=s&&!f&&!i?Yl(s,c):be(0);return{width:e.width*d.x,height:e.height*d.y,x:e.x*d.x-c.scrollLeft*d.x+h.x+v.x,y:e.y*d.y-c.scrollTop*d.y+h.y+v.y}}function Mf(n){return Array.from(n.getClientRects())}function If(n){const t=xe(n),e=Ms(n),r=n.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-e.scrollLeft+Is(n);const l=-e.scrollTop;return de(r).direction==="rtl"&&(s+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}const ka=25;function kf(n,t){const e=jt(n),r=xe(n),o=e.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const h=Bi();(!h||h&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=Is(r);if(d<=0){const h=r.ownerDocument,f=h.body,v=getComputedStyle(f),m=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=ka&&(i-=g)}else d<=ka&&(i+=d);return{width:i,height:s,x:l,y:c}}const Df=new Set(["absolute","fixed"]);function Nf(n,t){const e=Cn(n,!0,t==="fixed"),r=e.top+n.clientTop,o=e.left+n.clientLeft,i=we(n)?kn(n):be(1),s=n.clientWidth*i.x,l=n.clientHeight*i.y,c=o*i.x,d=r*i.y;return{width:s,height:l,x:c,y:d}}function Da(n,t,e){let r;if(t==="viewport")r=kf(n,e);else if(t==="document")r=If(xe(n));else if(ue(t))r=Nf(t,e);else{const o=ql(n);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return $o(r)}function Gl(n,t){const e=on(n);return e===t||!ue(e)||jn(e)?!1:de(e).position==="fixed"||Gl(e,t)}function Rf(n,t){const e=t.get(n);if(e)return e;let r=vr(n,[],!1).filter(l=>ue(l)&&$n(l)!=="body"),o=null;const i=de(n).position==="fixed";let s=i?on(n):n;for(;ue(s)&&!jn(s);){const l=de(s),c=Ri(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&Df.has(o.position)||Mo(s)&&!c&&Gl(n,s))?r=r.filter(h=>h!==s):o=l,s=on(s)}return t.set(n,r),r}function Bf(n){let{element:t,boundary:e,rootBoundary:r,strategy:o}=n;const s=[...e==="clippingAncestors"?Fs(t)?[]:Rf(t,this._c):[].concat(e),r],l=s[0],c=s.reduce((d,h)=>{const f=Da(t,h,o);return d.top=Xt(f.top,d.top),d.right=rn(f.right,d.right),d.bottom=rn(f.bottom,d.bottom),d.left=Xt(f.left,d.left),d},Da(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Lf(n){const{width:t,height:e}=Ul(n);return{width:t,height:e}}function Wf(n,t,e){const r=we(t),o=xe(t),i=e==="fixed",s=Cn(n,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=be(0);function d(){c.x=Is(o)}if(r||!r&&!i)if(($n(t)!=="body"||Mo(o))&&(l=Ms(t)),r){const m=Cn(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&d();i&&!r&&o&&d();const h=o&&!r&&!i?Yl(o,l):be(0),f=s.left+l.scrollLeft-c.x-h.x,v=s.top+l.scrollTop-c.y-h.y;return{x:f,y:v,width:s.width,height:s.height}}function Vs(n){return de(n).position==="static"}function Na(n,t){if(!we(n)||de(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return xe(n)===e&&(e=e.ownerDocument.body),e}function Xl(n,t){const e=jt(n);if(Fs(n))return e;if(!we(n)){let o=on(n);for(;o&&!jn(o);){if(ue(o)&&!Vs(o))return o;o=on(o)}return e}let r=Na(n,t);for(;r&&xf(r)&&Vs(r);)r=Na(r,t);return r&&jn(r)&&Vs(r)&&!Ri(r)?e:r||Of(n)||e}const zf=async function(n){const t=this.getOffsetParent||Xl,e=this.getDimensions,r=await e(n.floating);return{reference:Wf(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Kf(n){return de(n).direction==="rtl"}const Vf={convertOffsetParentRelativeRectToViewportRelativeRect:Ff,getDocumentElement:xe,getClippingRect:Bf,getOffsetParent:Xl,getElementRects:zf,getClientRects:Mf,getDimensions:Lf,getScale:kn,isElement:ue,isRTL:Kf};function jl(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Hf(n,t){let e=null,r;const o=xe(n);function i(){var l;clearTimeout(r),(l=e)==null||l.disconnect(),e=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=n.getBoundingClientRect(),{left:h,top:f,width:v,height:m}=d;if(l||t(),!v||!m)return;const g=Bo(f),w=Bo(o.clientWidth-(h+v)),x=Bo(o.clientHeight-(f+m)),_=Bo(h),I={rootMargin:-g+"px "+-w+"px "+-x+"px "+-_+"px",threshold:Xt(0,rn(1,c))||1};let A=!0;function F(R){const k=R[0].intersectionRatio;if(k!==c){if(!A)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!jl(d,n.getBoundingClientRect())&&s(),A=!1}try{e=new IntersectionObserver(F,{...I,root:o.ownerDocument})}catch{e=new IntersectionObserver(F,I)}e.observe(n)}return s(!0),i}function Uf(n,t,e,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Li(n),h=o||i?[...d?vr(d):[],...vr(t)]:[];h.forEach(_=>{o&&_.addEventListener("scroll",e,{passive:!0}),i&&_.addEventListener("resize",e)});const f=d&&l?Hf(d,e):null;let v=-1,m=null;s&&(m=new ResizeObserver(_=>{let[E]=_;E&&E.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var I;(I=m)==null||I.observe(t)})),e()}),d&&!c&&m.observe(d),m.observe(t));let g,w=c?Cn(n):null;c&&x();function x(){const _=Cn(n);w&&!jl(w,_)&&e(),w=_,g=requestAnimationFrame(x)}return e(),()=>{var _;h.forEach(E=>{o&&E.removeEventListener("scroll",e),i&&E.removeEventListener("resize",e)}),f==null||f(),(_=m)==null||_.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const qf=vf,Yf=pf,Gf=ff,Xf=yf,jf=hf,Zf=df,Jf=mf,Qf=(n,t,e)=>{const r=new Map,o={platform:Vf,...e},i={...o.platform,_c:r};return uf(n,t,{...o,platform:i})};function fn(n){return typeof n=="function"?n():n}function Zl(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ra(n,t){const e=Zl(n);return Math.round(t*e)/e}function Ba(n){return{[`--bits-${n}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${n}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${n}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${n}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${n}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function $f(n){const t=n.whileElementsMounted,e=P(()=>fn(n.open)??!0),r=P(()=>fn(n.middleware)),o=P(()=>fn(n.transform)??!0),i=P(()=>fn(n.placement)??"bottom"),s=P(()=>fn(n.strategy)??"absolute"),l=P(()=>fn(n.sideOffset)??0),c=P(()=>fn(n.alignOffset)??0),d=n.reference;let h=Z(0),f=Z(0);const v=Ne(null);let m=Z(fr(u(s))),g=Z(fr(u(i))),w=Z(fr({})),x=Z(!1);const _=P(()=>{const k=v.current?Ra(v.current,u(h)):u(h),H=v.current?Ra(v.current,u(f)):u(f);return u(o)?{position:u(m),left:"0",top:"0",transform:`translate(${k}px, ${H}px)`,...v.current&&Zl(v.current)>=1.5&&{willChange:"transform"}}:{position:u(m),left:`${k}px`,top:`${H}px`}});let E;function I(){d.current===null||v.current===null||Qf(d.current,v.current,{middleware:u(r),placement:u(i),strategy:u(s)}).then(k=>{if(!u(e)&&u(h)!==0&&u(f)!==0){const H=Math.max(Math.abs(u(l)),Math.abs(u(c)),15);if(k.x<=H&&k.y<=H)return}O(h,k.x,!0),O(f,k.y,!0),O(m,k.strategy,!0),O(g,k.placement,!0),O(w,k.middlewareData,!0),O(x,!0)})}function A(){typeof E=="function"&&(E(),E=void 0)}function F(){if(A(),t===void 0){I();return}d.current===null||v.current===null||(E=t(d.current,v.current,I))}function R(){u(e)||O(x,!1)}return Kt(I),Kt(F),Kt(R),Kt(()=>A),{floating:v,reference:d,get strategy(){return u(m)},get placement(){return u(g)},get middlewareData(){return u(w)},get isPositioned(){return u(x)},get floatingStyles(){return u(_)},get update(){return I}}}const th={top:"bottom",right:"left",bottom:"top",left:"right"},Wi=new cn("Floating.Root"),La=new cn("Floating.Content"),zi=new cn("Floating.Root");class ts{constructor(){S(this,"anchorNode",Ne(null));S(this,"customAnchorNode",Ne(null));S(this,"triggerNode",Ne(null));Kt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}static create(t=!1){return t?zi.set(new ts):Wi.set(new ts)}}var lo,Ps,co,Ss,uo,Cs,fo,ho,go,vo,po,mo,yo,bo,wo,xo,_o,Po,So,Co,Oo,Ao,Eo,To;const Os=class Os{constructor(t,e){S(this,"opts");S(this,"root");S(this,"contentRef",Ne(null));S(this,"wrapperRef",Ne(null));S(this,"arrowRef",Ne(null));S(this,"contentAttachment",ce(this.contentRef));S(this,"wrapperAttachment",ce(this.wrapperRef));S(this,"arrowAttachment",ce(this.arrowRef));S(this,"arrowId",Ne(Ii()));y(this,lo,P(()=>{if(typeof this.opts.style=="string")return Jc(this.opts.style);if(!this.opts.style)return{}}));y(this,Ps);y(this,co,new _u(()=>this.arrowRef.current??void 0));y(this,Ss,P(()=>{var t;return((t=a(this,co))==null?void 0:t.width)??0}));y(this,uo,P(()=>{var t;return((t=a(this,co))==null?void 0:t.height)??0}));y(this,Cs,P(()=>{var t;return((t=this.opts.side)==null?void 0:t.current)+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:"")}));y(this,fo,P(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]));y(this,ho,P(()=>u(a(this,fo)).length>0));y(this,go,P(()=>({padding:this.opts.collisionPadding.current,boundary:u(a(this,fo)).filter(zu),altBoundary:this.hasExplicitBoundaries})));y(this,vo,Z(void 0));y(this,po,Z(void 0));y(this,mo,Z(void 0));y(this,yo,Z(void 0));y(this,bo,P(()=>[qf({mainAxis:this.opts.sideOffset.current+u(a(this,uo)),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&Yf({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?Jf():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&Gf({...this.detectOverflowOptions}),Xf({...this.detectOverflowOptions,apply:({rects:t,availableWidth:e,availableHeight:r})=>{const{width:o,height:i}=t.reference;O(a(this,vo),e,!0),O(a(this,po),r,!0),O(a(this,mo),o,!0),O(a(this,yo),i,!0)}}),this.arrowRef.current&&Zf({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),eh({arrowWidth:u(a(this,Ss)),arrowHeight:u(a(this,uo))}),this.opts.hideWhenDetached.current&&jf({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean)));S(this,"floating");y(this,wo,P(()=>nh(this.floating.placement)));y(this,xo,P(()=>rh(this.floating.placement)));y(this,_o,P(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.x)??0}));y(this,Po,P(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.y)??0}));y(this,So,P(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.centerOffset)!==0}));y(this,Co,Z());y(this,Oo,P(()=>th[this.placedSide]));y(this,Ao,P(()=>{var t,e,r;return{id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${(t=this.floating.middlewareData.transformOrigin)==null?void 0:t.x} ${(e=this.floating.middlewareData.transformOrigin)==null?void 0:e.y}`,"--bits-floating-available-width":`${u(a(this,vo))}px`,"--bits-floating-available-height":`${u(a(this,po))}px`,"--bits-floating-anchor-width":`${u(a(this,mo))}px`,"--bits-floating-anchor-height":`${u(a(this,yo))}px`,...((r=this.floating.middlewareData.hide)==null?void 0:r.referenceHidden)&&{visibility:"hidden","pointer-events":"none"},...u(a(this,lo))},dir:this.opts.dir.current,...this.wrapperAttachment}}));y(this,Eo,P(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Qc({...u(a(this,lo))}),...this.contentAttachment})));y(this,To,P(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0})));this.opts=t,this.root=e,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),Rt(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=$f({strategy:()=>this.opts.strategy.current,placement:()=>u(a(this,Cs)),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>{var i;return Uf(...r,{animationFrame:((i=a(this,Ps))==null?void 0:i.current)==="always"})},open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),Kt(()=>{var r;this.floating.isPositioned&&((r=this.opts.onPlaced)==null||r.current())}),Rt(()=>this.contentRef.current,r=>{if(!r)return;const o=Ci(r);this.contentZIndex=o.getComputedStyle(r).zIndex}),Kt(()=>{this.floating.floating.current=this.wrapperRef.current})}static create(t,e=!1){return e?La.set(new Os(t,zi.get())):La.set(new Os(t,Wi.get()))}get hasExplicitBoundaries(){return u(a(this,ho))}set hasExplicitBoundaries(t){O(a(this,ho),t)}get detectOverflowOptions(){return u(a(this,go))}set detectOverflowOptions(t){O(a(this,go),t)}get middleware(){return u(a(this,bo))}set middleware(t){O(a(this,bo),t)}get placedSide(){return u(a(this,wo))}set placedSide(t){O(a(this,wo),t)}get placedAlign(){return u(a(this,xo))}set placedAlign(t){O(a(this,xo),t)}get arrowX(){return u(a(this,_o))}set arrowX(t){O(a(this,_o),t)}get arrowY(){return u(a(this,Po))}set arrowY(t){O(a(this,Po),t)}get cannotCenterArrow(){return u(a(this,So))}set cannotCenterArrow(t){O(a(this,So),t)}get contentZIndex(){return u(a(this,Co))}set contentZIndex(t){O(a(this,Co),t,!0)}get arrowBaseSide(){return u(a(this,Oo))}set arrowBaseSide(t){O(a(this,Oo),t)}get wrapperProps(){return u(a(this,Ao))}set wrapperProps(t){O(a(this,Ao),t)}get props(){return u(a(this,Eo))}set props(t){O(a(this,Eo),t)}get arrowStyle(){return u(a(this,To))}set arrowStyle(t){O(a(this,To),t)}};lo=new WeakMap,Ps=new WeakMap,co=new WeakMap,Ss=new WeakMap,uo=new WeakMap,Cs=new WeakMap,fo=new WeakMap,ho=new WeakMap,go=new WeakMap,vo=new WeakMap,po=new WeakMap,mo=new WeakMap,yo=new WeakMap,bo=new WeakMap,wo=new WeakMap,xo=new WeakMap,_o=new WeakMap,Po=new WeakMap,So=new WeakMap,Co=new WeakMap,Oo=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,To=new WeakMap;let _i=Os;class es{constructor(t,e){S(this,"opts");S(this,"root");this.opts=t,this.root=e,t.virtualEl&&t.virtualEl.current?e.triggerNode=Ya(t.virtualEl.current):e.triggerNode=t.ref}static create(t,e=!1){return e?new es(t,zi.get()):new es(t,Wi.get())}}function eh(n){return{name:"transformOrigin",options:n,fn(t){var x,_,E;const{placement:e,rects:r,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,l=s?0:n.arrowWidth,c=s?0:n.arrowHeight,[d,h]=Ki(e),f={start:"0%",center:"50%",end:"100%"}[h],v=(((_=o.arrow)==null?void 0:_.x)??0)+l/2,m=(((E=o.arrow)==null?void 0:E.y)??0)+c/2;let g="",w="";return d==="bottom"?(g=s?f:`${v}px`,w=`${-c}px`):d==="top"?(g=s?f:`${v}px`,w=`${r.floating.height+c}px`):d==="right"?(g=`${-c}px`,w=s?f:`${m}px`):d==="left"&&(g=`${r.floating.width+c}px`,w=s?f:`${m}px`),{data:{x:g,y:w}}}}}function Ki(n){const[t,e="center"]=n.split("-");return[t,e]}function nh(n){return Ki(n)[0]}function rh(n){return Ki(n)[1]}function oh(n,t){G(t,!0);let e=b(t,"tooltip",3,!1);ts.create(e());var r=N(),o=C(r);Y(o,()=>t.children??ot),p(n,r),X()}function sh(n,t){G(t,!0);let e=b(t,"tooltip",3,!1);es.create({id:T(()=>t.id),virtualEl:T(()=>t.virtualEl),ref:t.ref},e());var r=N(),o=C(r);Y(o,()=>t.children??ot),p(n,r),X()}function ih(n,t){G(t,!0);let e=b(t,"side",3,"bottom"),r=b(t,"sideOffset",3,0),o=b(t,"align",3,"center"),i=b(t,"alignOffset",3,0),s=b(t,"arrowPadding",3,0),l=b(t,"avoidCollisions",3,!0),c=b(t,"collisionBoundary",19,()=>[]),d=b(t,"collisionPadding",3,0),h=b(t,"hideWhenDetached",3,!1),f=b(t,"onPlaced",3,()=>{}),v=b(t,"sticky",3,"partial"),m=b(t,"updatePositionStrategy",3,"optimized"),g=b(t,"strategy",3,"fixed"),w=b(t,"dir",3,"ltr"),x=b(t,"style",19,()=>({})),_=b(t,"wrapperId",19,Ii),E=b(t,"customAnchor",3,null),I=b(t,"tooltip",3,!1);const A=_i.create({side:T(()=>e()),sideOffset:T(()=>r()),align:T(()=>o()),alignOffset:T(()=>i()),id:T(()=>t.id),arrowPadding:T(()=>s()),avoidCollisions:T(()=>l()),collisionBoundary:T(()=>c()),collisionPadding:T(()=>d()),hideWhenDetached:T(()=>h()),onPlaced:T(()=>f()),sticky:T(()=>v()),updatePositionStrategy:T(()=>m()),strategy:T(()=>g()),dir:T(()=>w()),style:T(()=>x()),enabled:T(()=>t.enabled),wrapperId:T(()=>_()),customAnchor:T(()=>E())},I()),F=P(()=>Nt(A.wrapperProps,{style:{pointerEvents:"auto"}}));var R=N(),k=C(R);Y(k,()=>t.content??ot,()=>({props:A.props,wrapperProps:u(F)})),p(n,R),X()}function ah(n,t){G(t,!0),zc(()=>{var o;(o=t.onPlaced)==null||o.call(t)});var e=N(),r=C(e);Y(r,()=>t.content??ot,()=>({props:{},wrapperProps:{}})),p(n,e),X()}function lh(n,t){let e=b(t,"isStatic",3,!1),r=st(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var o=N(),i=C(o);{var s=c=>{ah(c,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},l=c=>{ih(c,xt({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};bt(i,c=>{e()?c(s):c(l,!1)})}p(n,o)}var ch=U("<!> <!>",1);function Jl(n,t){G(t,!0);let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=b(t,"tooltip",3,!1),c=b(t,"contentPointerEvents",3,"auto"),d=st(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);lh(n,{get isStatic(){return s()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get enabled(){return t.enabled},get tooltip(){return l()},content:(f,v)=>{let m=()=>v==null?void 0:v().props,g=()=>v==null?void 0:v().wrapperProps;var w=ch(),x=C(w);{var _=A=>{Zo(A,{get preventScroll(){return t.preventScroll}})},E=A=>{Zo(A,{get preventScroll(){return t.preventScroll}})};bt(x,A=>{t.forceMount&&t.enabled?A(_):t.forceMount||A(E,1)})}var I=D(x,2);Nl(I,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(F,R)=>{let k=()=>R==null?void 0:R().props;Fl(F,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(H,rt)=>{Tl(H,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return e()},get isValidEvent(){return o()},get enabled(){return t.enabled},get ref(){return t.ref},children:(pt,gt)=>{let St=()=>gt==null?void 0:gt().props;Bl(pt,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(lt,it)=>{var J=N(),ct=C(J);{let Q=P(()=>({props:Nt(d,m(),St(),k(),{style:{pointerEvents:c()}}),wrapperProps:g()}));Y(ct,()=>t.popper??ot,()=>u(Q))}p(lt,J)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),p(f,w)},$$slots:{content:!0}}),X()}function uh(n,t){let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=st(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var c=N(),d=C(c);{var h=f=>{Jl(f,xt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get isStatic(){return s()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return e()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>l))};bt(d,f=>{t.shouldRender&&f(h)})}p(n,c)}function dh(n,t){let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=st(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);Jl(n,xt({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return i()},get isStatic(){return s()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return e()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside}},()=>l,{forceMount:!0}))}var fh=U("<div><!></div>");function hh(n,t){const e=an();G(t,!0);let r=b(t,"ref",15,null),o=b(t,"id",19,()=>ln(e)),i=b(t,"disabled",3,!1),s=b(t,"onSelect",3,wt),l=b(t,"closeOnSelect",3,!0),c=st(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const d=ui.create({id:T(()=>o()),disabled:T(()=>i()),onSelect:T(()=>s()),ref:T(()=>r(),w=>r(w)),closeOnSelect:T(()=>l())}),h=P(()=>Nt(c,d.props));var f=N(),v=C(f);{var m=w=>{var x=N(),_=C(x);Y(_,()=>t.child,()=>({props:u(h)})),p(w,x)},g=w=>{var x=fh();Tt(x,()=>({...u(h)}));var _=z(x);Y(_,()=>t.children??ot),K(x),p(w,x)};bt(v,w=>{t.child?w(m):w(g,!1)})}p(n,f),X()}function gh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=b(t,"onOpenChange",3,wt),o=b(t,"onOpenChangeComplete",3,wt);Js.create({variant:T(()=>"dialog"),open:T(()=>e(),l=>{e(l),r()(l)}),onOpenChangeComplete:T(()=>o())});var i=N(),s=C(i);Y(s,()=>t.children??ot),p(n,i),X()}var vh=U("<button><!></button>");function ph(n,t){const e=an();G(t,!0);let r=b(t,"id",19,()=>ln(e)),o=b(t,"ref",15,null),i=b(t,"disabled",3,!1),s=st(t,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const l=Qs.create({variant:T(()=>"close"),id:T(()=>r()),ref:T(()=>o(),m=>o(m)),disabled:T(()=>!!i())}),c=P(()=>Nt(s,l.props));var d=N(),h=C(d);{var f=m=>{var g=N(),w=C(g);Y(w,()=>t.child,()=>({props:u(c)})),p(m,g)},v=m=>{var g=vh();Tt(g,()=>({...u(c)}));var w=z(g);Y(w,()=>t.children??ot),K(g),p(m,g)};bt(h,m=>{t.child?m(f):m(v,!1)})}p(n,d),X()}var mh=U("<!> <!>",1),yh=U("<!> <div><!></div>",1);function bh(n,t){const e=an();G(t,!0);let r=b(t,"id",19,()=>ln(e)),o=b(t,"ref",15,null),i=b(t,"forceMount",3,!1),s=b(t,"onCloseAutoFocus",3,wt),l=b(t,"onOpenAutoFocus",3,wt),c=b(t,"onEscapeKeydown",3,wt),d=b(t,"onInteractOutside",3,wt),h=b(t,"trapFocus",3,!0),f=b(t,"preventScroll",3,!0),v=b(t,"restoreScrollDelay",3,null),m=st(t,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const g=ei.create({id:T(()=>r()),ref:T(()=>o(),I=>o(I))}),w=P(()=>Nt(m,g.props));var x=N(),_=C(x);{var E=I=>{Nl(I,{get ref(){return g.opts.ref},loop:!0,get trapFocus(){return h()},get enabled(){return g.root.opts.open.current},get onOpenAutoFocus(){return l()},get onCloseAutoFocus(){return s()},focusScope:(F,R)=>{let k=()=>R==null?void 0:R().props;Fl(F,xt(()=>u(w),{get enabled(){return g.root.opts.open.current},get ref(){return g.opts.ref},onEscapeKeydown:H=>{c()(H),!H.defaultPrevented&&g.root.handleClose()},children:(H,rt)=>{Tl(H,xt(()=>u(w),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},onInteractOutside:et=>{d()(et),!et.defaultPrevented&&g.root.handleClose()},children:(et,pt)=>{Bl(et,xt(()=>u(w),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},children:(gt,St)=>{var lt=N(),it=C(lt);{var J=Q=>{var Ct=mh(),Bt=C(Ct);{var Gt=kt=>{Zo(kt,{get preventScroll(){return f()},get restoreScrollDelay(){return v()}})};bt(Bt,kt=>{g.root.opts.open.current&&kt(Gt)})}var Jt=D(Bt,2);{let kt=P(()=>({props:Nt(u(w),k()),...g.snippetProps}));Y(Jt,()=>t.child,()=>u(kt))}p(Q,Ct)},ct=Q=>{var Ct=yh(),Bt=C(Ct);Zo(Bt,{get preventScroll(){return f()}});var Gt=D(Bt,2);Tt(Gt,kt=>({...kt}),[()=>Nt(u(w),k())]);var Jt=z(Gt);Y(Jt,()=>t.children??ot),K(Gt),p(Q,Ct)};bt(it,Q=>{t.child?Q(J):Q(ct,!1)})}p(gt,lt)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};bt(_,I=>{(g.shouldRender||i())&&I(E)})}p(n,x),X()}function wh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=b(t,"dir",3,"ltr"),o=b(t,"onOpenChange",3,wt),i=b(t,"onOpenChangeComplete",3,wt),s=b(t,"_internal_variant",3,"dropdown-menu");const l=ai.create({variant:T(()=>s()),dir:T(()=>r()),onClose:()=>{e(!1),o()(!1)}});li.create({open:T(()=>e(),c=>{e(c),o()(c)}),onOpenChangeComplete:T(()=>i())},l),oh(n,{children:(c,d)=>{var h=N(),f=C(h);Y(f,()=>t.children??ot),p(c,h)},$$slots:{default:!0}}),X()}var xh=U("<div><div><!></div></div>"),_h=U("<div><div><!></div></div>");function Ph(n,t){const e=an();G(t,!0);let r=b(t,"id",19,()=>ln(e)),o=b(t,"ref",15,null),i=b(t,"loop",3,!0),s=b(t,"onInteractOutside",3,wt),l=b(t,"onEscapeKeydown",3,wt),c=b(t,"onCloseAutoFocus",3,wt),d=b(t,"forceMount",3,!1),h=b(t,"trapFocus",3,!1),f=st(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const v=ci.create({id:T(()=>r()),loop:T(()=>i()),ref:T(()=>o(),A=>o(A)),onCloseAutoFocus:T(()=>c())}),m=P(()=>Nt(f,v.props));function g(A){if(v.handleInteractOutside(A),!A.defaultPrevented&&(s()(A),!A.defaultPrevented)){if(A.target&&A.target instanceof Element){const F=`[${v.parentMenu.root.getBitsAttr("sub-content")}]`;if(A.target.closest(F))return}v.parentMenu.onClose()}}function w(A){l()(A),!A.defaultPrevented&&v.parentMenu.onClose()}var x=N(),_=C(x);{var E=A=>{dh(A,xt(()=>u(m),()=>v.popperProps,{get ref(){return v.opts.ref},get enabled(){return v.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:w,get trapFocus(){return h()},get loop(){return i()},forceMount:!0,get id(){return r()},get shouldRender(){return v.shouldRender},popper:(R,k)=>{let H=()=>k==null?void 0:k().props,rt=()=>k==null?void 0:k().wrapperProps;const et=P(()=>Nt(H(),{style:Ba("dropdown-menu")},{style:t.style}));var pt=N(),gt=C(pt);{var St=it=>{var J=N(),ct=C(J);{let Q=P(()=>({props:u(et),wrapperProps:rt(),...v.snippetProps}));Y(ct,()=>t.child,()=>u(Q))}p(it,J)},lt=it=>{var J=xh();Tt(J,()=>({...rt()}));var ct=z(J);Tt(ct,()=>({...u(et)}));var Q=z(ct);Y(Q,()=>t.children??ot),K(ct),K(J),p(it,J)};bt(gt,it=>{t.child?it(St):it(lt,!1)})}p(R,pt)},$$slots:{popper:!0}}))},I=A=>{uh(A,xt(()=>u(m),()=>v.popperProps,{get ref(){return v.opts.ref},get open(){return v.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:w,get trapFocus(){return h()},get loop(){return i()},forceMount:!1,get id(){return r()},get shouldRender(){return v.shouldRender},popper:(R,k)=>{let H=()=>k==null?void 0:k().props,rt=()=>k==null?void 0:k().wrapperProps;const et=P(()=>Nt(H(),{style:Ba("dropdown-menu")},{style:t.style}));var pt=N(),gt=C(pt);{var St=it=>{var J=N(),ct=C(J);{let Q=P(()=>({props:u(et),wrapperProps:rt(),...v.snippetProps}));Y(ct,()=>t.child,()=>u(Q))}p(it,J)},lt=it=>{var J=_h();Tt(J,()=>({...rt()}));var ct=z(J);Tt(ct,()=>({...u(et)}));var Q=z(ct);Y(Q,()=>t.children??ot),K(ct),K(J),p(it,J)};bt(gt,it=>{t.child?it(St):it(lt,!1)})}p(R,pt)},$$slots:{popper:!0}}))};bt(_,A=>{d()?A(E):d()||A(I,1)})}p(n,x),X()}var Sh=U("<button><!></button>");function Ch(n,t){const e=an();G(t,!0);let r=b(t,"id",19,()=>ln(e)),o=b(t,"ref",15,null),i=b(t,"disabled",3,!1),s=b(t,"type",3,"button"),l=st(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const c=di.create({id:T(()=>r()),disabled:T(()=>i()??!1),ref:T(()=>o(),h=>o(h))}),d=P(()=>Nt(l,c.props,{type:s()}));sh(n,{get id(){return r()},get ref(){return c.opts.ref},children:(h,f)=>{var v=N(),m=C(v);{var g=x=>{var _=N(),E=C(_);Y(E,()=>t.child,()=>({props:u(d)})),p(x,_)},w=x=>{var _=Sh();Tt(_,()=>({...u(d)}));var E=z(_);Y(E,()=>t.children??ot),K(_),p(x,_)};bt(m,x=>{t.child?x(g):x(w,!1)})}p(h,v)},$$slots:{default:!0}}),X()}function Oh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=st(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=C(o);L(i,()=>gh,(s,l)=>{l(s,xt(()=>r,{get open(){return e()},set open(c){e(c)}}))}),p(n,o),X()}function Ah(n,t){let e=st(t,["$$slots","$$events","$$legacy"]);var r=N(),o=C(r);L(o,()=>ll,(i,s)=>{s(i,xt(()=>e))}),p(n,r)}function Eh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=C(o);{let s=P(()=>Zt("text-lg leading-none font-semibold",t.class));L(i,()=>Yu,(l,c)=>{c(l,xt({"data-slot":"dialog-title",get class(){return u(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}var Th=U("<div><!></div>");function Fh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=Th();Tt(o,s=>({"data-slot":"dialog-header",class:s,...r}),[()=>Zt("flex flex-col gap-2 text-center sm:text-start",t.class)]);var i=z(o);Y(i,()=>t.children??ot),K(o),On(o,s=>e(s),()=>e()),p(n,o),X()}function Mh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=C(o);{let s=P(()=>Zt("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t.class));L(i,()=>Xd,(l,c)=>{c(l,xt({"data-slot":"dialog-overlay",get class(){return u(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}/**
* @license @lucide/svelte v0.561.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* ---
*
* The MIT License (MIT) (for portions derived from Feather)
*
* Copyright (c) 2013-2023 Cole Bemis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/const Ih={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"};var kh=Dc("<svg><!><!></svg>");function Io(n,t){G(t,!0);const e=b(t,"color",3,"currentColor"),r=b(t,"size",3,24),o=b(t,"strokeWidth",3,2),i=b(t,"absoluteStrokeWidth",3,!1),s=b(t,"iconNode",19,()=>[]),l=st(t,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var c=kh();Tt(c,f=>({...Ih,...l,width:r(),height:r(),stroke:e(),"stroke-width":f,class:["lucide-icon lucide",t.name&&`lucide-${t.name}`,t.class]}),[()=>i()?Number(o())*24/Number(r()):o()]);var d=z(c);en(d,17,s,hn,(f,v)=>{var m=P(()=>Nc(u(v),2));let g=()=>u(m)[0],w=()=>u(m)[1];var x=N(),_=C(x);Vc(_,g,!0,(E,I)=>{Tt(E,()=>({...w()}))}),p(f,x)});var h=D(d);Y(h,()=>t.children??ot),K(c),p(n,c),X()}function Dh(n,t){G(t,!0);/**
* @license @lucide/svelte v0.561.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* ---
*
* The MIT License (MIT) (for portions derived from Feather)
*
* Copyright (c) 2013-2023 Cole Bemis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/let e=st(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Io(n,xt({name:"x"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=C(s);Y(l,()=>t.children??ot),p(o,s)},$$slots:{default:!0}})),X()}var Nh=U('<!> <span class="sr-only">Close</span>',1),Rh=U("<!> <!>",1),Bh=U("<!> <!>",1);function Lh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"showCloseButton",3,!0),o=st(t,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);Ah(n,xt(()=>t.portalProps,{children:(i,s)=>{var l=Bh(),c=C(l);L(c,()=>Mh,(h,f)=>{f(h,{})});var d=D(c,2);{let h=P(()=>Zt("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t.class));L(d,()=>bh,(f,v)=>{v(f,xt({"data-slot":"dialog-content",get class(){return u(h)}},()=>o,{get ref(){return e()},set ref(m){e(m)},children:(m,g)=>{var w=Rh(),x=C(w);Y(x,()=>t.children??ot);var _=D(x,2);{var E=I=>{var A=N(),F=C(A);L(F,()=>ph,(R,k)=>{k(R,{class:"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:(H,rt)=>{var et=Nh(),pt=C(et);Dh(pt,{}),q(2),p(H,et)},$$slots:{default:!0}})}),p(I,A)};bt(_,I=>{r()&&I(E)})}p(m,w)},$$slots:{default:!0}}))})}p(i,l)},$$slots:{default:!0}})),X()}function Wh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=C(o);{let s=P(()=>Zt("text-muted-foreground text-sm",t.class));L(i,()=>Zd,(l,c)=>{c(l,xt({"data-slot":"dialog-description",get class(){return u(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}function zh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=st(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=C(o);L(i,()=>wh,(s,l)=>{l(s,xt(()=>r,{get open(){return e()},set open(c){e(c)}}))}),p(n,o),X()}function Ql(n,t){let e=st(t,["$$slots","$$events","$$legacy"]);var r=N(),o=C(r);L(o,()=>ll,(i,s)=>{s(i,xt(()=>e))}),p(n,r)}function Kh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"sideOffset",3,4),o=st(t,["$$slots","$$events","$$legacy","ref","sideOffset","portalProps","class"]);Ql(n,xt(()=>t.portalProps,{children:(i,s)=>{var l=N(),c=C(l);{let d=P(()=>Zt("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--bits-dropdown-menu-content-available-height) min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none",t.class));L(c,()=>Ph,(h,f)=>{f(h,xt({"data-slot":"dropdown-menu-content",get sideOffset(){return r()},get class(){return u(d)}},()=>o,{get ref(){return e()},set ref(v){e(v)}}))})}p(i,l)},$$slots:{default:!0}})),X()}function Wa(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"variant",3,"default"),o=st(t,["$$slots","$$events","$$legacy","ref","class","inset","variant"]);var i=N(),s=C(i);{let l=P(()=>Zt("data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t.class));L(s,()=>hh,(c,d)=>{d(c,xt({"data-slot":"dropdown-menu-item",get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return u(l)}},()=>o,{get ref(){return e()},set ref(h){e(h)}}))})}p(n,i),X()}function Vh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=st(t,["$$slots","$$events","$$legacy","ref"]);var o=N(),i=C(o);L(i,()=>Ch,(s,l)=>{l(s,xt({"data-slot":"dropdown-menu-trigger"},()=>r,{get ref(){return e()},set ref(c){e(c)}}))}),p(n,o),X()}const Hh=["EA","BX","CA","PK","PLT","LF"],Uh=["Framing","Insulation","Drywall","T-Bar","Painting","Masking","Misc"],qh=["ACT","Channel","Fasteners","Finishing Materials","Adhesives","Mud","Corner Bead","Sanding","Tape","Metal Studs","Metal Tracks","FRP","Gyp","Insulation","Paint","Weatherproofing","Misc"];var Yh=U('<input type="hidden" name="id"/>'),Gh=U("<option> </option>"),Xh=U("<option> </option>"),jh=U("<option> </option>"),Zh=U("<option> </option>"),Jh=U('<p class="text-destructive text-sm"> </p>'),Qh=U('<form method="POST" class="flex flex-col gap-4"><!> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <!></div> <div class="space-y-2"><!> <!></div></div> <div class="space-y-2"><!> <!></div> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <select id="UOM" name="UOM" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="space-y-2"><!> <!></div></div> <div class="space-y-2"><!> <!></div> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <select id="Catagory" name="Catagory" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="space-y-2"><!> <select id="Sub_Catagory" name="Sub_Catagory" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div></div> <div class="space-y-2"><!> <select id="Parent" name="Parent" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="flex flex-wrap gap-6"><label class="flex items-center gap-2 text-sm"><input type="checkbox" name="Has_Parent" value="on" class="border-input size-4 rounded"/> Has Parent</label> <label class="flex items-center gap-2 text-sm"><input type="checkbox" name="Stock" value="on" class="border-input size-4 rounded"/> Stock</label></div> <!> <div class="flex justify-end gap-2"><!></div></form>');function $h(n,t){G(t,!0);let e=b(t,"item",3,null),r=b(t,"itemsForParent",19,()=>[]);const o=P(()=>!!e()),i=P(()=>e()?r().filter(M=>M.id!==e().id):r()),s=P(()=>{var M;return((M=e())==null?void 0:M.Item)??""}),l=P(()=>{var M;return((M=e())==null?void 0:M.SKU)??""}),c=P(()=>{var M;return((M=e())==null?void 0:M.Description)??""}),d=P(()=>{var M;return((M=e())==null?void 0:M.UOM)??""}),h=P(()=>{var M;return((M=e())==null?void 0:M.Cost)!=null?String(e().Cost):""}),f=P(()=>{var M;return((M=e())==null?void 0:M.Vendor)??""}),v=P(()=>{var M,W;return Array.isArray((M=e())==null?void 0:M.Catagory)?e().Catagory[0]:((W=e())==null?void 0:W.Catagory)??""}),m=P(()=>{var M,W;return Array.isArray((M=e())==null?void 0:M.Sub_Catagory)?e().Sub_Catagory[0]:((W=e())==null?void 0:W.Sub_Catagory)??""}),g=P(()=>{var M;return((M=e())==null?void 0:M.Parent)??""}),w=P(()=>{var M;return!!((M=e())!=null&&M.Has_Parent)}),x=P(()=>{var M;return!!((M=e())!=null&&M.Stock)});var _=Qh(),E=z(_);{var I=M=>{var W=Yh();Lo(W),Pt(()=>Qa(W,e().id)),p(M,W)};bt(E,M=>{u(o)&&M(I)})}var A=D(E,2),F=z(A),R=z(F);Ae(R,{for:"Item",children:(M,W)=>{q();var B=j("Item");p(M,B)},$$slots:{default:!0}});var k=D(R,2);sr(k,{id:"Item",name:"Item",get value(){return u(s)},required:!0}),K(F);var H=D(F,2),rt=z(H);Ae(rt,{for:"SKU",children:(M,W)=>{q();var B=j("SKU");p(M,B)},$$slots:{default:!0}});var et=D(rt,2);sr(et,{id:"SKU",name:"SKU",get value(){return u(l)}}),K(H),K(A);var pt=D(A,2),gt=z(pt);Ae(gt,{for:"Description",children:(M,W)=>{q();var B=j("Description");p(M,B)},$$slots:{default:!0}});var St=D(gt,2);sr(St,{id:"Description",name:"Description",get value(){return u(c)}}),K(pt);var lt=D(pt,2),it=z(lt),J=z(it);Ae(J,{for:"UOM",children:(M,W)=>{q();var B=j("UOM");p(M,B)},$$slots:{default:!0}});var ct=D(J,2),Q=z(ct);Q.value=Q.__value="";var Ct=D(Q);en(Ct,17,()=>Hh,hn,(M,W)=>{var B=Gh(),Qt=z(B,!0);K(B);var $={};Pt(()=>{Do(B,u(d)===u(W)),Et(Qt,u(W)),$!==($=u(W))&&(B.value=(B.__value=u(W))??"")}),p(M,B)}),K(ct),K(it);var Bt=D(it,2),Gt=z(Bt);Ae(Gt,{for:"Cost",children:(M,W)=>{q();var B=j("Cost");p(M,B)},$$slots:{default:!0}});var Jt=D(Gt,2);sr(Jt,{id:"Cost",name:"Cost",type:"number",step:"any",get value(){return u(h)}}),K(Bt),K(lt);var kt=D(lt,2),En=z(kt);Ae(En,{for:"Vendor",children:(M,W)=>{q();var B=j("Vendor");p(M,B)},$$slots:{default:!0}});var ee=D(En,2);sr(ee,{id:"Vendor",name:"Vendor",get value(){return u(f)}}),K(kt);var ne=D(kt,2),re=z(ne),Ke=z(re);Ae(Ke,{for:"Catagory",children:(M,W)=>{q();var B=j("Catagory");p(M,B)},$$slots:{default:!0}});var Dt=D(Ke,2),fe=z(Dt);fe.value=fe.__value="";var Ve=D(fe);en(Ve,17,()=>Uh,hn,(M,W)=>{var B=Xh(),Qt=z(B,!0);K(B);var $={};Pt(()=>{Do(B,u(v)===u(W)),Et(Qt,u(W)),$!==($=u(W))&&(B.value=(B.__value=u(W))??"")}),p(M,B)}),K(Dt),K(re);var oe=D(re,2),at=z(oe);Ae(at,{for:"Sub_Catagory",children:(M,W)=>{q();var B=j("Sub_Catagory");p(M,B)},$$slots:{default:!0}});var he=D(at,2),_e=z(he);_e.value=_e.__value="";var Pe=D(_e);en(Pe,17,()=>qh,hn,(M,W)=>{var B=jh(),Qt=z(B,!0);K(B);var $={};Pt(()=>{Do(B,u(m)===u(W)),Et(Qt,u(W)),$!==($=u(W))&&(B.value=(B.__value=u(W))??"")}),p(M,B)}),K(he),K(oe),K(ne);var ge=D(ne,2),Se=z(ge);Ae(Se,{for:"Parent",children:(M,W)=>{q();var B=j("Parent");p(M,B)},$$slots:{default:!0}});var He=D(Se,2),se=z(He);se.value=se.__value="";var Ue=D(se);en(Ue,17,()=>u(i),hn,(M,W)=>{var B=Zh(),Qt=z(B,!0);K(B);var $={};Pt(()=>{Do(B,u(g)===u(W).id),Et(Qt,u(W).Item||u(W).SKU||u(W).id),$!==($=u(W).id)&&(B.value=(B.__value=u(W).id)??"")}),p(M,B)}),K(He),K(ge);var ie=D(ge,2),Ce=z(ie),qe=z(Ce);Lo(qe),q(),K(Ce);var un=D(Ce,2),ut=z(un);Lo(ut),q(),K(un),K(ie);var dt=D(ie,2);{var ft=M=>{var W=Jh(),B=z(W,!0);K(W),Pt(()=>Et(B,t.error)),p(M,W)};bt(dt,M=>{t.error&&M(ft)})}var Mt=D(dt,2),ht=z(Mt);$a(ht,{type:"submit",children:(M,W)=>{q();var B=j();Pt(()=>Et(B,t.submitLabel)),p(M,B)},$$slots:{default:!0}}),K(Mt),K(_),ja(_,(M,W)=>{var B;return(B=Za)==null?void 0:B(M,W)},()=>()=>async({update:M,result:W})=>{var B,Qt;await M(),W.type==="success"&&((B=W.data)!=null&&B.success)&&((Qt=t.onSuccess)==null||Qt.call(t))}),Pt(()=>{Ja(_,"action",t.action),pa(qe,u(w)),pa(ut,u(x))}),p(n,_),X()}function tg(n,t){G(t,!0);/**
* @license @lucide/svelte v0.561.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* ---
*
* The MIT License (MIT) (for portions derived from Feather)
*
* Copyright (c) 2013-2023 Cole Bemis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/let e=st(t,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];Io(n,xt({name:"ellipsis"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=C(s);Y(l,()=>t.children??ot),p(o,s)},$$slots:{default:!0}})),X()}function eg(n,t){G(t,!0);/**
* @license @lucide/svelte v0.561.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* ---
*
* The MIT License (MIT) (for portions derived from Feather)
*
* Copyright (c) 2013-2023 Cole Bemis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/let e=st(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];Io(n,xt({name:"pencil"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=C(s);Y(l,()=>t.children??ot),p(o,s)},$$slots:{default:!0}})),X()}function ng(n,t){G(t,!0);/**
* @license @lucide/svelte v0.561.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* ---
*
* The MIT License (MIT) (for portions derived from Feather)
*
* Copyright (c) 2013-2023 Cole Bemis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/let e=st(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Io(n,xt({name:"plus"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=C(s);Y(l,()=>t.children??ot),p(o,s)},$$slots:{default:!0}})),X()}function rg(n,t){G(t,!0);/**
* @license @lucide/svelte v0.561.0 - ISC
*
* ISC License
*
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* ---
*
* The MIT License (MIT) (for portions derived from Feather)
*
* Copyright (c) 2013-2023 Cole Bemis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/let e=st(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];Io(n,xt({name:"trash-2"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=C(s);Y(l,()=>t.children??ot),p(o,s)},$$slots:{default:!0}})),X()}var og=U("<!> New item",1),sg=U('<!> <p class="text-muted-foreground text-sm">PocketBase collection: full CRUD.</p>',1),ig=U("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),ag=U('<span class="text-muted-foreground">—</span>'),lg=U("<!> <!>",1),cg=U('<span class="text-muted-foreground">—</span>'),ug=U("<!> <!>",1),dg=U('<span class="text-muted-foreground">No</span>'),fg=U('<span class="font-mono text-xs"> </span>'),hg=U('<span class="text-muted-foreground">—</span>'),gg=U("<!> Edit",1),vg=U("<!> Delete",1),pg=U('<!> <form method="POST" action="?/delete" class="hidden"><input type="hidden" name="id"/></form> <!>',1),mg=U("<!> <!>",1),yg=U("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),bg=U("<!> <!>",1),wg=U("<!> <!>",1),xg=U("<!> <!>",1),_g=U("<!> <!>",1),Pg=U('<main class="container mx-auto flex flex-col gap-6 py-8"><div class="flex items-center justify-between"><h1 class="text-2xl font-semibold">Stackq Items</h1> <div class="flex items-center gap-2"><span class="text-muted-foreground text-sm"> </span> <!></div></div> <!> <!></main>');function Bg(n,t){G(t,!0);let e=Z(!1),r=Z(null),o=Z("create");const i=P(()=>{var F;return((F=t.data)==null?void 0:F.items)??[]}),s=P(()=>{var F;return((F=t.data)==null?void 0:F.itemsForParent)??[]});function l(F){return F==null?[]:Array.isArray(F)?F:[F]}function c(F){if(!F)return"—";try{return new Date(F).toLocaleDateString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return F}}function d(){O(r,null),O(o,"create"),O(e,!0)}function h(F){O(r,F,!0),O(o,"update"),O(e,!0)}function f(){O(e,!1),O(r,null)}const v=P(()=>{var F,R,k;return((F=t.data)==null?void 0:F.form)==="create"||((R=t.data)==null?void 0:R.form)==="update"?((k=t.data)==null?void 0:k.error)??null:null});Kt(()=>{var F,R;u(v)&&(((F=t.data)==null?void 0:F.form)==="create"||((R=t.data)==null?void 0:R.form)==="update")&&O(e,!0)});var m=Pg();Hc("1kn3tit",F=>{Rc(()=>{Bc.title="Items Stackq"})});var g=z(m),w=D(z(g),2),x=z(w),_=z(x);K(x);var E=D(x,2);$a(E,{onclick:d,children:(F,R)=>{var k=og(),H=C(k);ng(H,{class:"mr-2 size-4"}),q(),p(F,k)},$$slots:{default:!0}}),K(w),K(g);var I=D(g,2);$c(I,{children:(F,R)=>{var k=wg(),H=C(k);tu(H,{children:(et,pt)=>{var gt=sg(),St=C(gt);eu(St,{children:(lt,it)=>{q();var J=j("Stackq_Items");p(lt,J)},$$slots:{default:!0}}),q(2),p(et,gt)},$$slots:{default:!0}});var rt=D(H,2);nu(rt,{class:"p-0",children:(et,pt)=>{var gt=N(),St=C(gt);L(St,()=>cu,(lt,it)=>{it(lt,{children:(J,ct)=>{var Q=bg(),Ct=C(Q);L(Ct,()=>vu,(Gt,Jt)=>{Jt(Gt,{children:(kt,En)=>{var ee=N(),ne=C(ee);L(ne,()=>zs,(re,Ke)=>{Ke(re,{children:(Dt,fe)=>{var Ve=ig(),oe=C(Ve);L(oe,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("Item");p(ft,ht)},$$slots:{default:!0}})});var at=D(oe,2);L(at,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("SKU");p(ft,ht)},$$slots:{default:!0}})});var he=D(at,2);L(he,()=>Ut,(ut,dt)=>{dt(ut,{class:"max-w-[200px]",children:(ft,Mt)=>{q();var ht=j("Description");p(ft,ht)},$$slots:{default:!0}})});var _e=D(he,2);L(_e,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("UOM");p(ft,ht)},$$slots:{default:!0}})});var Pe=D(_e,2);L(Pe,()=>Ut,(ut,dt)=>{dt(ut,{class:"text-right",children:(ft,Mt)=>{q();var ht=j("Cost");p(ft,ht)},$$slots:{default:!0}})});var ge=D(Pe,2);L(ge,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("Vendor");p(ft,ht)},$$slots:{default:!0}})});var Se=D(ge,2);L(Se,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("Catagory");p(ft,ht)},$$slots:{default:!0}})});var He=D(Se,2);L(He,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("Sub_Catagory");p(ft,ht)},$$slots:{default:!0}})});var se=D(He,2);L(se,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("Has Parent");p(ft,ht)},$$slots:{default:!0}})});var Ue=D(se,2);L(Ue,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("Parent");p(ft,ht)},$$slots:{default:!0}})});var ie=D(Ue,2);L(ie,()=>Ut,(ut,dt)=>{dt(ut,{children:(ft,Mt)=>{q();var ht=j("Stock");p(ft,ht)},$$slots:{default:!0}})});var Ce=D(ie,2);L(Ce,()=>Ut,(ut,dt)=>{dt(ut,{class:"text-muted-foreground",children:(ft,Mt)=>{q();var ht=j("created");p(ft,ht)},$$slots:{default:!0}})});var qe=D(Ce,2);L(qe,()=>Ut,(ut,dt)=>{dt(ut,{class:"text-muted-foreground",children:(ft,Mt)=>{q();var ht=j("updated");p(ft,ht)},$$slots:{default:!0}})});var un=D(qe,2);L(un,()=>Ut,(ut,dt)=>{dt(ut,{class:"w-[70px]",children:(ft,Mt)=>{q();var ht=j("Actions");p(ft,ht)},$$slots:{default:!0}})}),p(Dt,Ve)},$$slots:{default:!0}})}),p(kt,ee)},$$slots:{default:!0}})});var Bt=D(Ct,2);L(Bt,()=>du,(Gt,Jt)=>{Jt(Gt,{children:(kt,En)=>{var ee=N(),ne=C(ee);{var re=Dt=>{var fe=N(),Ve=C(fe);L(Ve,()=>zs,(oe,at)=>{at(oe,{children:(he,_e)=>{var Pe=N(),ge=C(Pe);L(ge,()=>zt,(Se,He)=>{He(Se,{colspan:"14",class:"h-24 text-center text-muted-foreground",children:(se,Ue)=>{q();var ie=j("No items. Create one or check PocketBase collection name and auth.");p(se,ie)},$$slots:{default:!0}})}),p(he,Pe)},$$slots:{default:!0}})}),p(Dt,fe)},Ke=Dt=>{var fe=N(),Ve=C(fe);en(Ve,17,()=>u(i),oe=>oe.id,(oe,at)=>{var he=N(),_e=C(he);L(_e,()=>zs,(Pe,ge)=>{ge(Pe,{children:(Se,He)=>{var se=yg(),Ue=C(se);L(Ue,()=>zt,($,mt)=>{mt($,{class:"font-medium",children:(yt,Vt)=>{q();var tt=j();Pt(()=>Et(tt,u(at).Item??"—")),p(yt,tt)},$$slots:{default:!0}})});var ie=D(Ue,2);L(ie,()=>zt,($,mt)=>{mt($,{class:"font-mono text-xs",children:(yt,Vt)=>{q();var tt=j();Pt(()=>Et(tt,u(at).SKU??"—")),p(yt,tt)},$$slots:{default:!0}})});var Ce=D(ie,2);{let $=P(()=>u(at).Description??"");L(Ce,()=>zt,(mt,yt)=>{yt(mt,{class:"max-w-[200px] truncate",get title(){return u($)},children:(Vt,tt)=>{q();var Ot=j();Pt(()=>Et(Ot,u(at).Description??"—")),p(Vt,Ot)},$$slots:{default:!0}})})}var qe=D(Ce,2);L(qe,()=>zt,($,mt)=>{mt($,{children:(yt,Vt)=>{or(yt,{variant:"outline",children:(tt,Ot)=>{q();var Ht=j();Pt(()=>Et(Ht,u(at).UOM??"—")),p(tt,Ht)},$$slots:{default:!0}})},$$slots:{default:!0}})});var un=D(qe,2);L(un,()=>zt,($,mt)=>{mt($,{class:"text-right tabular-nums",children:(yt,Vt)=>{q();var tt=j();Pt(Ot=>Et(tt,Ot),[()=>u(at).Cost!=null?Number(u(at).Cost).toLocaleString():"—"]),p(yt,tt)},$$slots:{default:!0}})});var ut=D(un,2);L(ut,()=>zt,($,mt)=>{mt($,{class:"text-muted-foreground",children:(yt,Vt)=>{q();var tt=j();Pt(()=>Et(tt,u(at).Vendor??"—")),p(yt,tt)},$$slots:{default:!0}})});var dt=D(ut,2);L(dt,()=>zt,($,mt)=>{mt($,{children:(yt,Vt)=>{var tt=lg(),Ot=C(tt);en(Ot,17,()=>l(u(at).Catagory),hn,(vt,_t)=>{or(vt,{variant:"secondary",class:"mr-1 text-xs",children:($t,ks)=>{q();var Oe=j();Pt(()=>Et(Oe,u(_t))),p($t,Oe)},$$slots:{default:!0}})});var Ht=D(Ot,2);{var ae=vt=>{var _t=ag();p(vt,_t)},At=P(()=>l(u(at).Catagory).length===0);bt(Ht,vt=>{u(At)&&vt(ae)})}p(yt,tt)},$$slots:{default:!0}})});var ft=D(dt,2);L(ft,()=>zt,($,mt)=>{mt($,{children:(yt,Vt)=>{var tt=ug(),Ot=C(tt);en(Ot,17,()=>l(u(at).Sub_Catagory),hn,(vt,_t)=>{or(vt,{variant:"outline",class:"mr-1 text-xs",children:($t,ks)=>{q();var Oe=j();Pt(()=>Et(Oe,u(_t))),p($t,Oe)},$$slots:{default:!0}})});var Ht=D(Ot,2);{var ae=vt=>{var _t=cg();p(vt,_t)},At=P(()=>l(u(at).Sub_Catagory).length===0);bt(Ht,vt=>{u(At)&&vt(ae)})}p(yt,tt)},$$slots:{default:!0}})});var Mt=D(ft,2);L(Mt,()=>zt,($,mt)=>{mt($,{children:(yt,Vt)=>{var tt=N(),Ot=C(tt);{var Ht=At=>{or(At,{children:(vt,_t)=>{q();var $t=j("Yes");p(vt,$t)},$$slots:{default:!0}})},ae=At=>{var vt=dg();p(At,vt)};bt(Ot,At=>{u(at).Has_Parent?At(Ht):At(ae,!1)})}p(yt,tt)},$$slots:{default:!0}})});var ht=D(Mt,2);L(ht,()=>zt,($,mt)=>{mt($,{class:"text-muted-foreground",children:(yt,Vt)=>{var tt=N(),Ot=C(tt);{var Ht=vt=>{var _t=j();Pt(()=>Et(_t,u(at).expand.Parent.Item??u(at).expand.Parent.SKU??u(at).Parent)),p(vt,_t)},ae=vt=>{var _t=fg(),$t=z(_t,!0);K(_t),Pt(()=>Et($t,u(at).Parent)),p(vt,_t)},At=vt=>{var _t=j("—");p(vt,_t)};bt(Ot,vt=>{var _t;(_t=u(at).expand)!=null&&_t.Parent?vt(Ht):u(at).Parent?vt(ae,1):vt(At,!1)})}p(yt,tt)},$$slots:{default:!0}})});var M=D(ht,2);L(M,()=>zt,($,mt)=>{mt($,{children:(yt,Vt)=>{var tt=N(),Ot=C(tt);{var Ht=At=>{or(At,{variant:"default",children:(vt,_t)=>{q();var $t=j("Stock");p(vt,$t)},$$slots:{default:!0}})},ae=At=>{var vt=hg();p(At,vt)};bt(Ot,At=>{u(at).Stock?At(Ht):At(ae,!1)})}p(yt,tt)},$$slots:{default:!0}})});var W=D(M,2);L(W,()=>zt,($,mt)=>{mt($,{class:"text-muted-foreground text-xs",children:(yt,Vt)=>{q();var tt=j();Pt(Ot=>Et(tt,Ot),[()=>c(u(at).created)]),p(yt,tt)},$$slots:{default:!0}})});var B=D(W,2);L(B,()=>zt,($,mt)=>{mt($,{class:"text-muted-foreground text-xs",children:(yt,Vt)=>{q();var tt=j();Pt(Ot=>Et(tt,Ot),[()=>c(u(at).updated)]),p(yt,tt)},$$slots:{default:!0}})});var Qt=D(B,2);L(Qt,()=>zt,($,mt)=>{mt($,{children:(yt,Vt)=>{var tt=N(),Ot=C(tt);L(Ot,()=>zh,(Ht,ae)=>{ae(Ht,{children:(At,vt)=>{var _t=mg(),$t=C(_t);L($t,()=>Vh,(Oe,Ds)=>{Ds(Oe,{class:"border-0 bg-transparent hover:bg-muted inline-flex size-8 items-center justify-center rounded-md",children:(Ns,$l)=>{tg(Ns,{class:"size-4"})},$$slots:{default:!0}})});var ks=D($t,2);L(ks,()=>Ql,(Oe,Ds)=>{Ds(Oe,{children:(Ns,$l)=>{var oa=N(),tc=C(oa);L(tc,()=>Kh,(ec,nc)=>{nc(ec,{align:"end",children:(rc,Sg)=>{var sa=pg(),ia=C(sa);L(ia,()=>Wa,(er,Tn)=>{Tn(er,{onclick:()=>h(u(at)),children:(Fn,sc)=>{var nr=gg(),Rs=C(nr);eg(Rs,{class:"mr-2 size-4"}),q(),p(Fn,nr)},$$slots:{default:!0}})});var tr=D(ia,2),aa=z(tr);Lo(aa),K(tr),ja(tr,er=>{var Tn;return(Tn=Za)==null?void 0:Tn(er)});var oc=D(tr,2);L(oc,()=>Wa,(er,Tn)=>{Tn(er,{class:"text-destructive focus:text-destructive cursor-pointer",onclick:()=>{var Fn;confirm("Delete this item? This cannot be undone.")&&((Fn=document.getElementById("delete-form-"+u(at).id))==null||Fn.requestSubmit())},children:(Fn,sc)=>{var nr=vg(),Rs=C(nr);rg(Rs,{class:"mr-2 size-4"}),q(),p(Fn,nr)},$$slots:{default:!0}})}),Pt(()=>{Ja(tr,"id",`delete-form-${u(at).id??""}`),Qa(aa,u(at).id)}),p(rc,sa)},$$slots:{default:!0}})}),p(Ns,oa)},$$slots:{default:!0}})}),p(At,_t)},$$slots:{default:!0}})}),p(yt,tt)},$$slots:{default:!0}})}),p(Se,se)},$$slots:{default:!0}})}),p(oe,he)}),p(Dt,fe)};bt(ne,Dt=>{u(i).length===0?Dt(re):Dt(Ke,!1)})}p(kt,ee)},$$slots:{default:!0}})}),p(J,Q)},$$slots:{default:!0}})}),p(et,gt)},$$slots:{default:!0}}),p(F,k)},$$slots:{default:!0}});var A=D(I,2);L(A,()=>Oh,(F,R)=>{R(F,{get open(){return u(e)},set open(k){O(e,k,!0)},children:(k,H)=>{var rt=N(),et=C(rt);L(et,()=>Lh,(pt,gt)=>{gt(pt,{class:"max-h-[90vh] overflow-y-auto sm:max-w-[500px]",children:(St,lt)=>{var it=_g(),J=C(it);L(J,()=>Fh,(Q,Ct)=>{Ct(Q,{children:(Bt,Gt)=>{var Jt=xg(),kt=C(Jt);L(kt,()=>Eh,(ee,ne)=>{ne(ee,{children:(re,Ke)=>{q();var Dt=j();Pt(()=>Et(Dt,u(r)?"Edit item":"New item")),p(re,Dt)},$$slots:{default:!0}})});var En=D(kt,2);L(En,()=>Wh,(ee,ne)=>{ne(ee,{children:(re,Ke)=>{q();var Dt=j();Pt(()=>Et(Dt,u(r)?"Update the item below.":"Add a new Stackq item.")),p(re,Dt)},$$slots:{default:!0}})}),p(Bt,Jt)},$$slots:{default:!0}})});var ct=D(J,2);{let Q=P(()=>u(r)?"?/update":"?/create"),Ct=P(()=>u(r)?"Update":"Create"),Bt=P(()=>u(v)??null);$h(ct,{get item(){return u(r)},get itemsForParent(){return u(s)},get action(){return u(Q)},get submitLabel(){return u(Ct)},get error(){return u(Bt)},onSuccess:f})}p(St,it)},$$slots:{default:!0}})}),p(k,rt)},$$slots:{default:!0}})}),K(m),Pt(()=>Et(_,`${u(i).length??""} items`)),p(n,m),X()}export{Bg as default};