@nathanstephenson/flow 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +122 -640
  2. package/build/backend-worker-chunks/chunk-J2DBNTL7.mjs +94 -0
  3. package/build/backend-worker-chunks/chunk-MLOUI3ZM.mjs +19752 -0
  4. package/build/backend-worker-chunks/chunk-UQDH2COY.mjs +15296 -0
  5. package/build/backend-worker-chunks/claude-GTW5KHY5.mjs +30778 -0
  6. package/build/backend-worker-chunks/pi-M4OA2FGL.mjs +5730 -0
  7. package/build/backend-worker.mjs +4401 -0
  8. package/dist/backend/fake/index.js +2 -0
  9. package/dist/backend/mcp.js +34 -15
  10. package/dist/backend/pi/state.js +18 -0
  11. package/dist/backend/registry.js +2 -1
  12. package/dist/backend/worker/claude-state.js +24 -3
  13. package/dist/backend/worker/entry.js +70 -13
  14. package/dist/backend/worker/frames.js +34 -0
  15. package/dist/backend/worker/index.js +139 -16
  16. package/dist/backend/worker/launcher.js +22 -3
  17. package/dist/backend/worker/sandbox-mcp.js +86 -0
  18. package/dist/build-id +1 -1
  19. package/dist/cli/bootstrap.js +7 -6
  20. package/dist/cli/install-guard.js +1 -1
  21. package/dist/cli/main.js +3 -6
  22. package/dist/cli/update.js +3 -3
  23. package/dist/cli/web-update.js +9 -6
  24. package/dist/client/connection.js +5 -2
  25. package/dist/client/diff.js +6 -9
  26. package/dist/client/reduce.js +19 -0
  27. package/dist/client/tool-chains.js +12 -4
  28. package/dist/daemon/config-store.js +21 -14
  29. package/dist/daemon/config.js +48 -5
  30. package/dist/daemon/git.js +47 -0
  31. package/dist/daemon/host.js +208 -29
  32. package/dist/daemon/models.js +27 -24
  33. package/dist/daemon/release-checker.js +48 -34
  34. package/dist/daemon/runtime.js +10 -4
  35. package/dist/daemon/server.js +13 -1
  36. package/dist/daemon/shell.js +2 -1
  37. package/dist/daemon/skills.js +34 -31
  38. package/dist/daemon/summariser.js +33 -14
  39. package/dist/daemon/timings.js +14 -0
  40. package/dist/daemon/workflow-authoring-scope-checks.js +5 -26
  41. package/dist/daemon/workflow-authoring-scope-reader.js +20 -9
  42. package/dist/daemon/workflow-builder-files.js +5 -5
  43. package/dist/daemon/workflow-builder-guidance.js +3 -3
  44. package/dist/daemon/workflow-builder-reader.js +21 -10
  45. package/dist/daemon/workflow-builder.js +66 -8
  46. package/dist/daemon/workflow-executions.js +10 -10
  47. package/dist/daemon/workflow-mcp-authoring-routes.js +18 -6
  48. package/dist/daemon/workflow-mcp-authoring.js +50 -23
  49. package/dist/isolation/filesystem.js +8 -9
  50. package/dist/isolation/sandbox-supervisor.js +50 -0
  51. package/dist/isolation/sandbox.js +165 -0
  52. package/dist/isolation/shared-sandbox.js +77 -0
  53. package/dist/workflows/executors.js +16 -4
  54. package/dist/workflows/json-schema.js +14 -4
  55. package/package.json +7 -4
  56. package/web/dist/assets/index-CiEgCpiO.js +40 -0
  57. package/web/dist/assets/index-ClwLFMZN.css +2 -0
  58. package/web/dist/assets/settings-mcp-CoRWT-D_.js +1 -0
  59. package/web/dist/assets/settings-secrets-BIO_hXZ1.js +1 -0
  60. package/web/dist/assets/settings-workflows-BXbj0TKs.js +23 -0
  61. package/web/dist/assets/switch-DIogWclb.js +1 -0
  62. package/web/dist/assets/workflow-api-BfExddae.js +6 -0
  63. package/web/dist/assets/workflow-editors-CsbVx4WJ.js +139 -0
  64. package/web/dist/assets/workflows-Bv0sj7d0.js +7 -0
  65. package/web/dist/assets/workflows-pane-C_Yg4pgr.js +1 -0
  66. package/web/dist/index.html +5 -5
  67. package/web/dist/assets/index-C_M0oDHN.js +0 -38
  68. package/web/dist/assets/index-D8CGXp1X.css +0 -2
  69. package/web/dist/assets/input-D9fbSfQF.js +0 -6
  70. package/web/dist/assets/settings-mcp-BvSvGrcs.js +0 -1
  71. package/web/dist/assets/settings-secrets-DlkU6W_Z.js +0 -1
  72. package/web/dist/assets/settings-workflows-DNGE-b_U.js +0 -23
  73. package/web/dist/assets/switch-DEvHojwW.js +0 -1
  74. package/web/dist/assets/workflow-editors-D6XT6pcb.js +0 -137
  75. package/web/dist/assets/workflows-LSCnXIxN.js +0 -7
  76. package/web/dist/assets/workflows-pane-BIlp7uyg.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{$ as t,$n as n,At as r,Bn as i,Bt as a,C as o,Cn as s,Ct as c,Dt as l,E as u,En as d,Et as f,Ft as p,Gn as m,Gt as h,Hn as g,Ht as _,In as v,It as y,J as b,Jt as x,Kn as S,Kt as C,Lt as w,M as T,Mt as E,N as ee,Nt as D,O,On as k,Or as A,Ot as j,Pt as M,Qn as N,Qt as P,Rn as F,Rt as I,Sn as L,St as R,T as te,Tn as z,Tt as B,U as V,Un as H,Ut as U,V as W,Vn as G,Vt as K,W as q,Wn as ne,Wt as re,X as ie,Xn as ae,Xt as oe,Y as J,Yn as se,Yt as ce,Z as le,Zn as Y,Zt as ue,_r as de,_t as fe,a as pe,an as me,ar as he,at as ge,bn as _e,c as ve,cn as ye,cr as be,ct as xe,dn as Se,dr as Ce,dt as we,en as Te,er as Ee,et as De,fn as Oe,fr as ke,ft as Ae,gn as je,gr as Me,gt as Ne,h as Pe,hr as Fe,ir as Ie,it as Le,jt as Re,kr as ze,kt as Be,l as Ve,ln as He,lr as Ue,lt as We,mr as Ge,nn as Ke,nr as qe,nt as Je,o as Ye,on as X,or as Xe,ot as Ze,p as Qe,pn as $e,pr as et,pt as tt,qt as nt,rn as rt,rr as it,s as at,sn as ot,sr as st,st as ct,tr as lt,u as ut,un as dt,ur as ft,ut as pt,vn as mt,vt as ht,w as gt,wn as _t,wr as vt,wt as yt,xn as bt,xt,yt as St,z as Ct,zt as wt}from"./workflow-api-BfExddae.js";var Z=e(ze(),1),Tt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Et=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Dt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ot=e=>{let t=Dt(e);return t.charAt(0).toUpperCase()+t.slice(1)},kt={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},At=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},jt=(0,Z.createContext)({}),Mt=()=>(0,Z.useContext)(jt),Nt=(0,Z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Mt()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,Z.createElement)(`svg`,{ref:c,...kt,width:t??l??kt.width,height:t??l??kt.height,stroke:e??f,strokeWidth:m,className:Tt(`lucide`,p,i),...!a&&!At(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,Z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Pt=(e,t)=>{let n=(0,Z.forwardRef)(({className:n,...r},i)=>(0,Z.createElement)(Nt,{ref:i,iconNode:t,className:Tt(`lucide-${Et(Ot(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ot(e),n},Ft=Pt(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),It=Pt(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Lt=Pt(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);function Rt(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Rt(e,t.id,n)])}function zt(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}var Bt=e(A(),1),Q=vt();function Vt(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Ht(e){let t=n(Ut,e).current;return t.next=e,Y(t.effect),t}function Ut(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Wt=0;function Gt(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Wt);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),g;let o=requestAnimationFrame(a);return Wt=o,()=>{Wt===o&&(cancelAnimationFrame(o),Wt=0)}}var Kt={inert:new WeakMap,"aria-hidden":new WeakMap},qt=`data-base-ui-inert`,Jt={inert:new WeakSet,"aria-hidden":new WeakSet},Yt=new WeakMap,Xt=0;function Zt(e){return Jt[e]}function Qt(e){return e?Ge(e)?e.host:Qt(e.parentNode):null}var $t=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Qt(t);return e.contains(n)?n:null}).filter(e=>e!=null),en=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},tn=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{Ie(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function nn(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=$t(t,e),l=i?tn(t,en(c),new Set(c)):[],u=[],d=[];if(a){let e=Kt[a],n=Zt(a);s=n,o=e;let r=$t(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);tn(t,en(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Yt.get(e)||0)+1;Yt.set(e,t),d.push(e),t===1&&e.setAttribute(qt,``)}),Xt+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Yt.get(e)||0)-1;Yt.set(e,t),t||e.removeAttribute(qt)}),--Xt,Xt||(Kt.inert=new WeakMap,Kt[`aria-hidden`]=new WeakMap,Jt.inert=new WeakSet,Jt[`aria-hidden`]=new WeakSet,Yt=new WeakMap)}}function rn(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=S(e[0]).body;return nn(e,a,n,r,{mark:i})}function an(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var on=class{nodesRef={current:[]};events=an();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},sn=Z.createContext(null),cn=Z.createContext(null),ln=()=>Z.useContext(sn)?.id||null,un=e=>{let t=Z.useContext(cn);return e??t};function dn(e){let t=le(),n=un(e),r=ln();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fn(e){let{children:t,id:n}=e,r=ln();return(0,Q.jsx)(sn.Provider,{value:Z.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function pn(e){let{children:t,externalTree:r}=e,i=n(()=>r??new on).current;return(0,Q.jsx)(cn.Provider,{value:i,children:t})}function mn(e,t){let n=be(ot(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var hn=20,gn=[];function _n(){gn=gn.filter(e=>e.deref()?.isConnected)}function vn(e){_n(),e&&Ie(e)!==`body`&&(gn.push(new WeakRef(e)),gn.length>hn&&(gn=gn.slice(-20)))}function yn(){return _n(),gn[gn.length-1]?.deref()}function bn(e){return e?fe(e)?e:ht(e)[0]||e:null}function xn(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=we(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return fe(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Sn(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:l=!0,closeOnFocusOut:d=!0,openInteractionType:f=``,nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:g,getInsideElements:_}=e,v=`rootStore`in t?t.rootStore:t,y=v.useState(`open`),b=v.useState(`domReferenceElement`),C=v.useState(`floatingElement`),{events:w,dataRef:T}=v.context,E=N(()=>T.current.floatingContext?.nodeId),D=i===!1,O=Ke(b)&&D,k=Ht(i),A=Ht(a),j=Ht(f),M=Ht(y),P=un(g),F=gt(),I=Z.useRef(!1),L=Z.useRef(!1),R=Z.useRef(!1),B=Z.useRef(null),V=Z.useRef(``),U=Z.useRef(``),W=Z.useRef(null),G=Z.useRef(null),K=H(W,h,F?.beforeInsideRef),q=H(G,F?.afterInsideRef),ne=bt(),re=bt(),ie=s(),ae=F!=null,J=ue(C),se=N((e=J)=>e?ht(e):[]),le=N(()=>_?.().filter(e=>e!=null)??[]);Z.useEffect(()=>{if(r||!l)return;function e(e){e.key===`Tab`&&X(J,me(S(J)))&&se().length===0&&!O&&oe(e)}let t=S(J);return _t(t,`keydown`,e)},[r,J,l,O,se]),Z.useEffect(()=>{if(r||!y)return;let e=S(J);function t(){R.current=!1}function n(e){let t=ot(e),n=le(),r=X(C,t)||X(b,t)||X(F?.portalNode,t)||n.some(e=>e===t||X(e,t));R.current=!r,U.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(L.current=!0,re.start(0,()=>{L.current=!1}))}function i(){U.current=`keyboard`}return z(_t(e,`pointerdown`,n,!0),_t(e,`pointerup`,t,!0),_t(e,`pointercancel`,t,!0),_t(e,`keydown`,i,!0),t)},[r,C,b,J,y,F,re,le]),Z.useEffect(()=>{if(r||!d)return;let e=S(J);function t(){L.current=!0,re.start(0,()=>{L.current=!1})}function n(e){let t=ot(e);fe(t)&&(B.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=ot(t);l&&n==null&&i!=null&&X(C,i)&&vn(i),queueMicrotask(()=>{let a=E(),s=v.context.triggerElements,d=le(),f=n?.hasAttribute(te(`focus-guard`))&&[W.current,G.current,F?.beforeInsideRef.current,F?.afterInsideRef.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,Le(m),Le(p)].includes(n),h=!(X(b,n)||X(C,n)||X(n,C)||X(F?.portalNode,n)||d.some(e=>e===n||X(e,n))||s.hasMatchingElement(e=>X(e,n))||f||P&&(Rt(P.nodesRef.current,a).find(e=>X(e.context?.elements.floating,n)||X(e.context?.elements.domReference,n))||zt(P.nodesRef.current,a).find(e=>[e.context?.elements.floating,ue(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===b&&J&&xn(J),o&&r!==b&&!c(i)&&me(e)===e.body){if(Ce(J)&&(J.focus(),o===`popup`)){ie.request(()=>{J.focus()});return}let e=se(),t=B.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||J;Ce(n)&&n.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(O||!l)&&n&&h&&!L.current&&(O||n!==yn())&&(I.current=!0,v.setOpen(!1,u(ee,t)))})}function a(){R.current||(T.current.insideReactTree=!0,ne.start(0,()=>{T.current.insideReactTree=!1}))}let s=Ce(b)?b:null;if(!(!C&&!s))return z(s&&_t(s,`focusout`,i),s&&_t(s,`pointerdown`,t),C&&_t(C,`focusin`,n),C&&_t(C,`focusout`,i),C&&F&&_t(C,`focusout`,a,!0))},[r,b,C,J,l,P,F,v,d,o,se,O,E,T,ne,re,ie,p,m,le]),Z.useEffect(()=>{if(r||!C||!y)return;let e=Array.from(F?.portalNode?.querySelectorAll(`[${te(`portal`)}]`)||[]),t=(P?zt(P.nodesRef.current,E()):[]).find(e=>Ke(e.context?.elements.domReference||null))?.context?.elements.domReference,n=rn([C,...e,W.current,G.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,...le(),t,Le(m),Le(p),O?b:null].filter(e=>e!=null),{ariaHidden:l||O,mark:!1}),i=rn([C,...e].filter(e=>e!=null));return()=>{i(),n()}},[y,r,b,C,l,F,O,P,E,p,m,le]),Y(()=>{if(!y||r||!Ce(J))return;V.current=``,U.current=``;let e=S(J),t=me(e);queueMicrotask(()=>{let n=k.current,r=typeof n==`function`?n(j.current||``):n;if(r===void 0||r===!1||X(J,t))return;let i=null,a=()=>(i??=se(J),i[0]||J),o;o=r===!0||r===null?a():Le(r),o||=a();let s=X(J,me(e));Gt(o,{preventScroll:o===J,shouldFocus(){if(!M.current)return!1;if(s)return!0;let t=me(e);return!(t!==o&&X(J,t))}})})},[r,y,J,se,k,j,M]),Y(()=>{if(r||!J)return;let e=S(J),t=me(e),n=j.current==null;vn(t);function i(e){if(e.open||(V.current=mn(e.nativeEvent,U.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(I.current=!0),e.reason===`outside-press`){if(e.nested)I.current=!1;else if(x(e.nativeEvent)||ce(e.nativeEvent))I.current=!1;else{let e=!1;S(J).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?I.current=!1:I.current=!0}}}w.on(`openchange`,i);function a(e){let r=A.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=b?.isConnected?b:null,o=t?.isConnected&&Ie(t)!==`body`?t:null,s=n?o||a:a||o;return s||=yn()||null,typeof i==`boolean`?s:Le(i)||s||null}return()=>{w.off(`openchange`,i);let t=me(e),n=le(),r=X(C,t)||n.some(e=>e===t||X(e,t))||P&&Rt(P.nodesRef.current,E(),!1).some(e=>X(e.context?.elements.floating,t)),o=A.current,s=V.current,c=a(s);queueMicrotask(()=>{let n=bn(c),i=typeof o!=`boolean`;if(o&&!I.current&&Ce(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}I.current=!1})}},[r,C,J,A,j,w,P,b,E,le]),Y(()=>{if(!je||y||!C)return;let e=me(S(C));!Ce(e)||!rt(e)||X(C,e)&&e.blur()},[y,C]),Y(()=>{if(!(r||!F))return F.setFocusManagerState({modal:l,closeOnFocusOut:d,open:y,onOpenChange:v.setOpen,domReference:b}),()=>{F.setFocusManagerState(null)}},[r,F,l,y,v,d,b]),Y(()=>{if(!(r||!J))return xn(J),()=>{queueMicrotask(_n)}},[r,J]);let de=!r&&(!l||!O)&&(ae||l);return(0,Q.jsxs)(Z.Fragment,{children:[de&&(0,Q.jsx)(xe,{"data-type":`inside`,ref:K,onFocus:e=>{if(l){let e=se();Gt(e[e.length-1])}else F?.portalNode&&(I.current=!1,Ne(e,F.portalNode)?Ae(b)?.focus():Le(m??F.beforeOutsideRef)?.focus())}}),n,de&&(0,Q.jsx)(xe,{"data-type":`inside`,ref:q,onFocus:e=>{l?Gt(se()[0]):F?.portalNode&&(d&&(I.current=!0),Ne(e,F.portalNode)?tt(b)?.focus():Le(p??F.afterOutsideRef)?.focus())}})]})}function Cn(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:c=0,reason:l=J}=t,d=`rootStore`in e?e.rootStore:e,f=d.context.dataRef,p=Z.useRef(void 0),m=s(),h=bt(),g=Z.useMemo(()=>{function e(e,t,n,r){let i=u(l,t,n);e&&r===`touch`&&c>0?h.start(c,()=>{d.setOpen(!0,i)}):d.setOpen(e,i)}function t(e,t,n){let r=f.current.openEvent,a=d.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){p.current=C(e.pointerType,!0)&&ce(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=p.current,o=n.nativeEvent,s=d.select(`open`);if(n.button!==0||r===`click`||C(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),l=ot(o);if(rt(l)){e(c,o,l,i);return}let u=n.currentTarget;m.request(()=>{e(c,o,u,i)})},onClick(n){if(r===`mousedown-only`)return;let i=p.current;if(r===`mousedown`&&i){p.current=void 0;return}C(i,!0)&&a||e(t(d.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){p.current=void 0}}},[f,r,a,l,d,o,i,m,h,c]);return Z.useMemo(()=>n?{reference:g}:G,[n,g])}function wn(){return!1}function Tn(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function En(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=wn,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,d=l.useState(`open`),f=l.useState(`floatingElement`),{dataRef:p}=l.context,m=un(c),h=N(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=N(()=>a),{escapeKey:y,outsidePress:b}=Tn(s),x=Z.useRef(!1),C=Z.useRef(!1),w=Z.useRef(!1),E=Z.useRef(!1),ee=Z.useRef(``),D=Z.useRef(null),O=bt(),k=bt(),A=N(()=>{k.clear(),p.current.insideReactTree=!1}),j=N(e=>{let t=p.current.floatingContext?.nodeId;return(m?Rt(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=N(e=>P(e,l.select(`floatingElement`))||P(e,l.select(`domReferenceElement`))),F=N(e=>{o()&&l.setOpen(!1,u(J,e.nativeEvent))}),I=N(e=>{if(!d||!n||!r||e.key!==`Escape`||E.current||!y&&j(`__escapeKeyBubbles`))return;let t=nt(e)?e.nativeEvent:e,i=u(T,t);l.setOpen(!1,i),i.isCanceled||e.preventDefault(),!y&&!i.isPropagationAllowed&&e.stopPropagation()}),L=N(()=>{p.current.insideReactTree=!0,k.start(0,A)}),R=N(e=>{if(!d||!n||e.button!==0)return;let t=ot(e.nativeEvent);X(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,C.current=!1))}),B=N(e=>{!d||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(C.current=!0)});Z.useEffect(()=>{if(!d||!n)return A;p.current.__escapeKeyBubbles=y,p.current.__outsidePressBubbles=b;let e=new _e,t=new _e;function i(){e.clear(),E.current=!0}function a(){e.start(je?5:0,()=>{E.current=!1})}function o(){w.current=!0,t.start(0,()=>{w.current=!1})}function s(){x.current=!1,C.current=!1}function c(){let e=ee.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function T(e){let t=p.current.floatingContext?.nodeId,n=m&&Rt(m.nodesRef.current,t).some(t=>P(e,t.context?.elements.floating));return M(e)||n}function k(e){if(h(e)){e.type!==`click`&&!M(e)&&(t.clear(),w.current=!1),A();return}if(p.current.insideReactTree){A();return}let n=ot(e),r=`[${te(`inert`)}]`,i=ft(n)?n.getRootNode():null,a=Array.from((Ge(i)?i:S(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>X(e,n))))return;let s=ft(n)?n:null;for(;s&&!ke(s);){let e=st(s);if(ke(e)||!ft(e))break;s=e}if(!(a.length&&ft(n)&&!Te(n)&&!X(n,l.select(`floatingElement`))&&a.every(e=>!X(s,e)))){if(Ce(n)&&!(`touches`in e)){let t=ke(n),r=Ee(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!T(e)){if(c()===`intentional`&&w.current){t.clear(),w.current=!1;return}typeof g==`function`&&!g(e)||j(`__outsidePressBubbles`)||(l.setOpen(!1,u(q,e)),A())}}}function N(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||M(e)||k(e)}function F(e){if(c()!==`sloppy`||!l.select(`open`)||!n||M(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=ot(e);if(!n)return;let r=_t(n,e.type,()=>{t(e),r()})}function R(e){ee.current=`touch`,L(e,F)}function B(e){O.clear(),e.type===`pointerdown`&&(ee.current=e.pointerType),!(e.type===`mousedown`&&D.current&&!D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?N(e):k(e)})}function V(e){if(!x.current)return;let n=C.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!T(e)){if(n){o();return}typeof g==`function`&&!g(e)||(t.clear(),w.current=!0,A())}}}function H(e){if(c()!==`sloppy`||!D.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function U(e){L(e,H)}function W(e){c()!==`sloppy`||!D.current||M(e)||(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function G(e){L(e,W)}let K=S(f),ne=z(r&&z(_t(K,`keydown`,I),_t(K,`compositionstart`,i),_t(K,`compositionend`,a)),_&&z(_t(K,`click`,B,!0),_t(K,`pointerdown`,B,!0),_t(K,`pointerup`,V,!0),_t(K,`pointercancel`,V,!0),_t(K,`mousedown`,B,!0),_t(K,`mouseup`,V,!0),_t(K,`touchstart`,R,!0),_t(K,`touchmove`,U,!0),_t(K,`touchend`,G,!0)));return()=>{ne(),e.clear(),t.clear(),s(),w.current=!1,A()}},[p,f,r,_,g,d,n,y,b,I,A,v,j,M,m,l,O]);let V=Z.useMemo(()=>({onKeyDown:I,onPointerDown:F,onClick:F}),[I,F]),H=Z.useMemo(()=>({onKeyDown:I,onPointerDown:B,onMouseDown:B,onClickCapture:L,onMouseDownCapture(e){L(),R(e)},onPointerDownCapture(e){L(),R(e)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[I,L,R,B]);return Z.useMemo(()=>n?{reference:V,floating:H,trigger:V}:{},[n,V,H])}function Dn(e,t,n){let{reference:i,floating:o}=e,s=a(t),c=Re(t),l=D(c),u=wt(t),d=s===`y`,f=i.x+i.width/2-o.width/2,p=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,h;switch(u){case`top`:h={x:f,y:i.y-o.height};break;case`bottom`:h={x:f,y:i.y+i.height};break;case`right`:h={x:i.x+i.width,y:p};break;case`left`:h={x:i.x-o.width,y:p};break;default:h={x:i.x,y:i.y}}let g=r(t);return g&&(h[c]+=m*(g===`end`?1:-1)*(n&&d?-1:1)),h}async function On(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=j(t,e),p=I(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=U(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=U(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var kn=50,An=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:On},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Dn(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<kn&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Dn(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},jn=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:o,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0,...g}=j(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let _=wt(r),v=a(s),b=wt(s)===s,x=await(c.isRTL==null?void 0:c.isRTL(l.floating)),S=f||(b||!h?[w(s)]:M(s)),C=m!==`none`;!f&&C&&S.push(...y(s,h,m,x));let T=[s,...S],ee=await c.detectOverflow(t,g),D=[],O=i.flip?.overflows||[];if(u&&D.push(ee[_]),d){let e=E(r,o,x);D.push(ee[e[0]],ee[e[1]])}if(O=[...O,{placement:r,overflows:D}],!D.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=T[e];if(t&&(d!==`alignment`||v===a(t)||O.every(e=>a(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:O},reset:{placement:t}};let n=O.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(p){case`bestFit`:{let e=O.filter(e=>{if(C){let t=a(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Mn=new Set([`left`,`top`]);async function Nn(e,t){let{placement:n,platform:i,elements:o}=e,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),c=wt(n),l=r(n),u=a(n)===`y`,d=Mn.has(c)?-1:1,f=s&&u?-1:1,p=j(t,e),{mainAxis:m,crossAxis:h,alignmentAxis:g}=typeof p==`number`?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof g==`number`&&(h=l===`end`?g*-1:g),u?{x:h*f,y:m*d}:{x:m*d,y:h*f}}var Pn=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Nn(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Fn=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=j(e,t),d={x:n,y:r},m=await o.detectOverflow(t,u),h=a(i),g=p(h),_=d[g],v=d[h],y=(e,t)=>f(t+m[e===`y`?`top`:`left`],t,t-m[e===`y`?`bottom`:`right`]);s&&(_=y(g,_)),c&&(v=y(h,v));let b=l.fn({...t,[g]:_,[h]:v});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[g]:s,[h]:c}}}}}},In=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=j(e,t),d={x:n,y:r},f=a(i),m=p(f),h=d[m],g=d[f],_=j(c,t),v=typeof _==`number`?{mainAxis:_,crossAxis:0}:{mainAxis:_.mainAxis??0,crossAxis:_.crossAxis??0};if(l){let e=m===`y`?`height`:`width`,t=o.reference[m]-o.floating[e]+v.mainAxis,n=o.reference[m]+o.reference[e]-v.mainAxis;h<t?h=t:h>n&&(h=n)}if(u){let e=m===`y`?`width`:`height`,t=Mn.has(wt(i)),n=o.reference[f]-o.floating[e]+(t&&s.offset?.[f]||0)+(t?0:v.crossAxis),r=o.reference[f]+o.reference[e]+(t?0:s.offset?.[f]||0)-(t?v.crossAxis:0);g<n?g=n:g>r&&(g=r)}return{[m]:h,[f]:g}}}},Ln=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:i,platform:o,elements:s}=t,{apply:c=()=>{},...l}=j(e,t),u=await o.detectOverflow(t,l),d=wt(n),f=r(n),p=a(n)===`y`,{width:m,height:h}=i.floating,g,v;d===`top`||d===`bottom`?(g=d,v=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(v=d,g=f===`end`?`top`:`bottom`);let y=h-u.top-u.bottom,b=m-u.left-u.right,x=_(h-u[g],y),S=_(m-u[v],b),C=t.middlewareData.shift,w=!C,T=x,E=S;C!=null&&C.enabled.x&&(E=b),C!=null&&C.enabled.y&&(T=y),w&&!f&&(p?E=m-2*K(u.left,u.right):T=h-2*K(u.top,u.bottom)),await c({...t,availableWidth:E,availableHeight:T});let ee=await o.getDimensions(s.floating);return m!==ee.width||h!==ee.height?{reset:{rects:!0}}:{}}}};function Rn(e){let t=Ee(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ce(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=re(n)!==a||re(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function zn(e){return ft(e)?e:e.contextElement}function Bn(e){let t=zn(e);if(!Ce(t))return l(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Rn(t),o=(a?re(n.width):n.width)/r,s=(a?re(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Vn=l(0);function Hn(e){let t=be(e);return!de()||!t.visualViewport?Vn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Un(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===be(e)}function Wn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=zn(e),o=l(1);t&&(r?ft(r)&&(o=Bn(r)):o=Bn(e));let s=Un(a,n,r)?Hn(a):l(0),c=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a&&r){let e=be(a),t=ft(r)?be(r):r,n=e,i=it(n);for(;i&&t!==n;){let e=Bn(i),t=i.getBoundingClientRect(),r=Ee(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=o,n=be(i),i=it(n)}}return U({width:d,height:f,x:c,y:u})}function Gn(e,t){let n=he(e).scrollLeft;return t?t.left+n:Wn(qe(e)).left+n}function Kn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Gn(e,n),y:n.top+t.scrollTop}}function qn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=qe(r),s=t?Me(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},u=l(1),d=l(0),f=Ce(r);if((f||!a)&&((Ie(r)!==`body`||et(o))&&(c=he(r)),f)){let e=Wn(r);u=Bn(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=o&&!f&&!a?Kn(o,c):l(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-c.scrollTop*u.y+d.y+p.y}}function Jn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Yn(e){let t=he(e),n=e.ownerDocument.body,r=K(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=K(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Gn(e),o=-t.scrollTop;return Ee(n).direction===`rtl`&&(a+=K(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Xn=25;function Zn(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=be(e),a=qe(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!de()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Gn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Xn&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Qn(e,t){let n=Wn(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Bn(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $n(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Zn(e,n,t);else if(t===`document`)r=Yn(qe(e));else if(ft(t))r=Qn(t,n);else{let n=Hn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return U(r)}function er(e,t){let n=t.get(e);if(n)return n;let r=Xe(e,[],!1).filter(e=>ft(e)&&Ie(e)!==`body`),i=null,a=Ee(e).position===`fixed`,o=a?st(e):e;for(;ft(o)&&!ke(o);){let e=Ee(o),t=Ue(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=st(o)}return t.set(e,r),r}function tr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Me(t)?[]:er(t,this._c):[].concat(n),r],o=$n(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=$n(t,a[e],i);s=K(n.top,s),c=_(n.right,c),l=_(n.bottom,l),u=K(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function nr(e){let{width:t,height:n}=Rn(e);return{width:t,height:n}}function rr(e,t,n){let r=Ce(t),i=qe(t),a=n===`fixed`,o=Wn(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=l(0);if((r||!a)&&((Ie(t)!==`body`||et(i))&&(s=he(t)),r)){let e=Wn(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Gn(i));let u=i&&!r&&!a?Kn(i,s):l(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ir(e){return Ee(e).position===`static`}function ar(e,t){if(!Ce(e)||Ee(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return qe(e)===n&&(n=n.ownerDocument.body),n}function or(e,t){let n=be(e);if(Me(e))return n;if(!Ce(e)){let t=st(e);for(;t&&!ke(t);){if(ft(t)&&!ir(t))return t;t=st(t)}return n}let r=ar(e,t);for(;r&&Fe(r)&&ir(r);)r=ar(r,t);return r&&ke(r)&&ir(r)&&!Ue(r)?n:r||lt(e)||n}var sr=async function(e){let t=this.getOffsetParent||or,n=this.getDimensions,r=await n(e.floating);return{reference:rr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cr(e){return Ee(e).direction===`rtl`}var lr={convertOffsetParentRelativeRectToViewportRelativeRect:qn,getDocumentElement:qe,getClippingRect:tr,getOffsetParent:or,getElementRects:sr,getClientRects:Jn,getDimensions:nr,getScale:Bn,isElement:ft,isRTL:cr};function ur(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dr(e,t,n){let r=null,i,a=qe(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Be(d),h=Be(a.clientWidth-(u+f)),g=Be(a.clientHeight-(d+p)),v=Be(u),y={rootMargin:-m+`px `+-h+`px `+-g+`px `+-v+`px`,threshold:K(0,_(1,c))||1},b=!0;function x(t){let n=t[0].intersectionRatio;if(!ur(l,e.getBoundingClientRect()))return s();if(n!==c){if(!b)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}b=!1}try{r=new IntersectionObserver(x,{...y,root:a.ownerDocument})}catch{r=new IntersectionObserver(x,y)}r.observe(e)}let c=be(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function fr(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=zn(e),u=i||a?[...l?Xe(l):[],...t?Xe(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?dr(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Wn(e):null;c&&g();function g(){let t=Wn(e);h&&!ur(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var pr=Pn,mr=Fn,hr=jn,gr=Ln,_r=In,vr=(e,t,n)=>{let r=new Map,i=n??{},a={...lr,...i.platform,_c:r};return An(e,t,{...i,platform:a})},yr=typeof document<`u`?Z.useLayoutEffect:function(){};function br(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!br(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!br(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sr(e,t){let n=xr(e);return Math.round(t*n)/n}function Cr(e){let t=Z.useRef(e);return yr(()=>{t.current=e}),t}function wr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Z.useState(r);br(f,r)||p(r);let[m,h]=Z.useState(null),[g,_]=Z.useState(null),v=Z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Z.useRef(null),C=Z.useRef(null),w=Z.useRef(u),T=c!=null,E=Cr(c),ee=Cr(i),D=Cr(l),O=Z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),vr(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};k.current&&!br(w.current,t)&&(w.current=t,Bt.flushSync(()=>{d(t)}))})},[f,t,n,ee,D]);yr(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=Z.useRef(!1);yr(()=>(k.current=!0,()=>{k.current=!1}),[]),yr(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let A=Z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=Z.useMemo(()=>({reference:b,floating:x}),[b,x]),M=Z.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Sr(j.floating,u.x),r=Sr(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xr(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return Z.useMemo(()=>({...u,update:O,refs:A,elements:j,floatingStyles:M}),[u,O,A,j,M])}var Tr=(e,t)=>{let n=pr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Er=(e,t)=>{let n=mr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dr=(e,t)=>({fn:_r(e).fn,options:[e,t]}),Or=(e,t)=>{let n=hr(e);return{name:n.name,fn:n.fn,options:[e,t]}},kr=(e,t)=>{let n=gr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ar={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},jr=class extends d{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:an(),nested:n,triggerElements:i},Ar),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&h(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Mr(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=Z.useRef(null);r===void 0&&f.current===null&&(f.current=new jr({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ft(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Nr(e,t=!1,n=!1){let[r,i]=Z.useState(e&&t?`idle`:void 0),[a,o]=Z.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Y(()=>{if(!e&&a&&r!==`ending`&&n){let e=L.request(()=>{i(`ending`)});return()=>{L.cancel(e)}}},[e,a,r,n]),Y(()=>{if(!e||t)return;let n=L.request(()=>{i(void 0)});return()=>{L.cancel(n)}},[t,e]),Y(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=L.request(()=>{i(`idle`)});return()=>{L.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}var Pr={tabIndex:-1,[Oe]:``};function Fr(e){return t=>t!==`touch`||e.current}function Ir(e,t=!1){let r=le(),i=ln()!=null,a=n(()=>e(r,i)).current;return Mr({popupStore:a,treatPopupAsFloatingElement:t,floatingRootContext:a.state.floatingRootContext,floatingId:r,nested:i,onOpenChange:a.setOpen}),a}function Lr({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function Rr(e,t){let n=Z.useRef(null),r=Z.useRef(null);return Z.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function zr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Br(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Vr(e,t,n,r={}){let i=n.reason,a=i===b,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Br(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),zr(i,t,n.trigger,c()),e.update(i)};a?Bt.flushSync(l):l()}function Hr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Rr(e,n),o=N(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=Z.useCallback(e=>{a(e),e&&o(e)},[a,o]);return Y(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Ur(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=Z.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=u(V);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Wr(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Nr(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=N(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Je({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function Gr(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:G,inactiveTriggerProps:G,popupProps:G})},[e])}function Kr(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var qr=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Jr(e){let{open:t=!1,onOpenChange:r,elements:i={}}=e,a=le(),o=ln()!=null,s=n(()=>new jr({open:t,transitionStatus:void 0,onOpenChange:r,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new qr,floatingId:a,syncOnly:!1,nested:o})).current;return Y(()=>{let e={open:t,floatingId:a};i.reference!==void 0&&(e.referenceElement=i.reference,e.domReferenceElement=ft(i.reference)?i.reference:null),i.floating!==void 0&&(e.floatingElement=i.floating),s.update(e)},[t,a,i.reference,i.floating,s]),s.context.onOpenChange=r,s.context.nested=o,s}function Yr(e){return Xr(e,e.rootContext)}function Xr(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=Z.useState(null),[d,f]=Z.useState(void 0),[p,m]=Z.useState(void 0),h=Z.useRef(null),g=un(r),_=Z.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=wr({...e,elements:{..._,...l&&{reference:l}}}),y=ft(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=Z.useCallback(e=>{let t=ft(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=Z.useCallback(e=>{(ft(e)||e===null)&&(h.current=e,f(e)),(ft(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!ft(e))&&v.refs.setReference(e)},[v.refs,f]),C=Z.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=Z.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=Z.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=Z.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Y(()=>{o&&(h.current=o)},[o]),Y(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),Z.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var Zr=`Escape`;function Qr(e){return je&&e.movementX===0&&e.movementY===0}function $r(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function ei(e,t){return $r(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function ti(e,t,n){return $r(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function ni(e,t,n){return $r(t,n?e===He:e===dt,e===ye)}function ri(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Zr:$r(t,n?e===dt:e===He,e===Se)}function ii(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:c=!1,loopFocus:l=!1,nested:d=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:m=`auto`,focusItemOnHover:h=!0,openOnArrowKeyDown:g=!0,disabledIndices:_=void 0,orientation:v=`vertical`,parentOrientation:y,id:b,resetOnPointerLeave:C=!0,externalTree:w,grid:T}=t,E=T!=null,D=`rootStore`in e?e.rootStore:e,O=D.useState(`open`),k=D.useState(`floatingElement`),A=D.useState(`domReferenceElement`),j=D.context.dataRef,M=ue(k),P=Ke(A),F=Ht(M),I=ln(),L=un(w),te=Z.useRef(m),z=Z.useRef(o??-1),B=Z.useRef(null),V=Z.useRef(!0),H=N(e=>{i(z.current===-1?null:z.current,e)}),U=Z.useRef(!!k),G=Z.useRef(O),K=Z.useRef(!1),q=Z.useRef(!1),ne=Z.useRef(null),re=Ht(_),ie=Ht(O),ae=Ht(o),J=Ht(C),se=s(),le=s(),de=N(()=>{function e(e){p?L?.events.emit(`virtualfocus`,e):ne.current=Gt(e,{sync:K.current,preventScroll:!0})}let t=n.current[z.current],r=q.current;t&&e(t),(K.current?e=>e():e=>se.request(e))(()=>{let i=n.current[z.current]||t;i&&(t||e(i),ve&&(r||!V.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{j.current.orientation=v},[j,v]),Y(()=>{a&&(O&&k?(z.current=o??-1,te.current&&o!=null&&(q.current=!0,H())):U.current&&(z.current=-1,H()))},[a,O,k,o,H]),Y(()=>{if(a){if(!O){K.current=!1;return}if(k){if(r==null){if(K.current=!1,ae.current!=null)return;if(U.current&&(z.current=-1,de()),(!G.current||!U.current)&&te.current&&(B.current!=null||te.current===!0&&B.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>le.request(e):queueMicrotask)(t),e+=1):(z.current=B.current==null||ti(B.current,v,f)||d?R(n):xt(n),B.current=null,H())};t()}}else yt(n.current,r)||(z.current=r,de(),q.current=!1)}}},[a,O,k,r,ae,d,n,v,f,H,de,le]),Y(()=>{if(!a||k||!L||p||!U.current)return;let e=L.nodesRef.current,t=e.find(e=>e.id===I)?.context?.elements.floating,n=me(S(A??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&V.current&&t.focus({preventScroll:!0})},[a,k,A,L,I,p]),Y(()=>{G.current=O,U.current=!!k}),Y(()=>{O||(B.current=null,te.current=m)},[O,m]);let fe=r!=null,pe=N(e=>{if(!ie.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(z.current!==t||r!==t)&&(z.current=t,H(e))}),he=N(()=>y??L?.nodesRef.current.find(e=>e.id===I)?.context?.dataRef?.current.orientation),ge=N(()=>R(n,re.current)),_e=N(e=>{if(V.current=!1,K.current=!0,e.which===229||!ie.current&&e.currentTarget===F.current)return;if(d&&ri(e.key,v,f,E)){ei(e.key,he())||oe(e),D.setOpen(!1,u(W,e.nativeEvent)),Ce(A)&&(p?L?.events.emit(`virtualfocus`,A):A.focus());return}let t=z.current,r=R(n,_),i=xt(n,_);if(P||(e.key===`Home`&&(oe(e),z.current=r,H(e)),e.key===`End`&&(oe(e),z.current=i,H(e))),T!=null){let t=T(e,z.current,n,v,l,f,_,r,i);if(t!=null&&(z.current=t,H(e)),v===`both`)return}if(ei(e.key,v)){if(oe(e),O&&!p&&me(e.currentTarget.ownerDocument)===e.currentTarget){z.current=ti(e.key,v,f)?r:i,H(e);return}ti(e.key,v,f)?l?t>=i?c&&t!==n.current.length?z.current=-1:(K.current=!1,z.current=r):z.current=St(n.current,{startingIndex:t,disabledIndices:_}):z.current=Math.min(i,St(n.current,{startingIndex:t,disabledIndices:_})):l?t<=r?c&&t!==-1?z.current=n.current.length:(K.current=!1,z.current=i):z.current=St(n.current,{startingIndex:t,decrement:!0,disabledIndices:_}):z.current=Math.max(r,St(n.current,{startingIndex:t,decrement:!0,disabledIndices:_})),yt(n.current,z.current)&&(z.current=-1),H(e)}}),ve=Z.useMemo(()=>({onFocus(e){K.current=!0,pe(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Qr(e)||(K.current=!0,q.current=!1,h&&pe(e))},onPointerLeave(e){if(!ie.current||!V.current||e.pointerType===`touch`)return;K.current=!0;let t=e.relatedTarget;if(!(!h||n.current.includes(t))&&J.current&&(ne.current?.(),ne.current=null,z.current=-1,H(e),!p)){let e=F.current,t=me(S(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[pe,ie,F,h,n,H,J,p]),ye=Z.useMemo(()=>p&&O&&fe&&{"aria-activedescendant":`${b}-${r}`},[p,O,fe,b,r]),be=Z.useMemo(()=>({"aria-orientation":v===`both`?void 0:v,...P?{}:ye,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&O&&!p){let t=ot(e.nativeEvent);if(t&&!X(F.current,t))return;oe(e),D.setOpen(!1,u(ee,e.nativeEvent)),Ce(A)&&A.focus();return}_e(e)},onPointerMove(e){Qr(e)||(V.current=!0)}}),[ye,_e,F,v,P,D,O,p,A]),xe=Z.useMemo(()=>{function e(e){D.setOpen(!0,u(W,e.nativeEvent,e.currentTarget))}function t(e){m===`auto`&&x(e.nativeEvent)&&(te.current=!p)}function n(e){te.current=m,m===`auto`&&ce(e.nativeEvent)&&(te.current=!0)}return{onKeyDown(t){let n=D.select(`open`);V.current=!1;let r=t.key.startsWith(`Arrow`),i=ni(t.key,he(),f),a=ei(t.key,v),o=(d?i:a)||t.key===`Enter`||t.key.trim()===``;if(p&&n)return _e(t);if(!(!n&&!g&&r)){if(o){let e=ei(t.key,he());B.current=d&&e?null:t.key}if(d){i&&(oe(t),n?(z.current=ge(),H(t)):e(t));return}a&&(ae.current!=null&&(z.current=ae.current),oe(t),!n&&g?e(t):_e(t),n&&H(t))}},onFocus(e){D.select(`open`)&&!p&&(z.current=-1,H(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[_e,m,ge,d,H,D,g,v,he,f,ae,p]),Se=Z.useMemo(()=>({...ye,...xe}),[ye,xe]);return Z.useMemo(()=>a?{reference:Se,floating:be,item:ve,trigger:xe}:{},[a,Se,be,xe,ve])}function ai(e,t){let{listRef:n,elementsRef:r,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:l,enabled:u=!0,resetMs:d=750,selectedIndex:f=null}=t,p=`rootStore`in e?e.rootStore:e,m=p.useState(`open`),h=bt(),g=Z.useRef(``),_=Z.useRef(f??a??-1),v=Z.useRef(null),y=N(e=>{function t(e){return r?.current[e]}function u(e){let n=t(e);return n&&!c(n)||n?.matches(`:disabled`)?!1:s==null||!B(i,e,s)}function p(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!u(n)))return n}return-1}let y=n.current;if(g.current.length>0&&e.key===` `&&(oe(e),l?.(!0)),g.current.length>0&&g.current[0]!==` `&&p(y,g.current)===-1&&e.key!==` `&&l?.(!1),y==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;m&&e.key!==` `&&(oe(e),l?.(!0));let b=g.current===``;b&&(_.current=f??a??-1),y.every((e,t)=>e&&u(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&g.current===e.key&&(g.current=``,_.current=v.current),g.current+=e.key,h.start(d,()=>{g.current=``,_.current=v.current,l?.(!1)});let x=((b?f??a??-1:_.current)??0)+1,S=p(y,g.current,x);S===-1?e.key!==` `&&(g.current=``,l?.(!1)):(o?.(S),v.current=S)}),b=N(e=>{let t=e.relatedTarget,n=p.select(`domReferenceElement`),r=p.select(`floatingElement`);X(n,t)||X(r,t)||(h.clear(),g.current=``,_.current=v.current,l?.(!1))});Y(()=>{!m&&f!==null||(h.clear(),v.current=null,g.current!==``&&(g.current=``))},[m,f,h]);let x=Z.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return Z.useMemo(()=>u?{reference:x,floating:x}:{},[u,x])}var oi=Z.createContext(void 0);function si(){return Z.useContext(oi)?.direction??`ltr`}var ci=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:i,placement:a,rects:o,platform:s,elements:c,middlewareData:l}=t,{element:u,padding:d=0,offsetParent:p=`real`}=j(e,t)||{};if(u==null)return{};let m=I(d),h={x:n,y:i},g=Re(a),_=D(g),v=await s.getDimensions(u),y=g===`y`,b=y?`top`:`left`,x=y?`bottom`:`right`,S=y?`clientHeight`:`clientWidth`,C=o.reference[_]+o.reference[g]-h[g]-o.floating[_],w=h[g]-o.reference[g],T=p===`real`?await s.getOffsetParent?.(u):c.floating,E=c.floating[S]||o.floating[_];(!E||!await s.isElement?.(T))&&(E=c.floating[S]||o.floating[_]);let ee=C/2-w/2,O=E/2-v[_]/2-1,k=Math.min(m[b],O),A=Math.min(m[x],O),M=k,N=E-v[_]-A,P=E/2-v[_]/2+ee,F=f(M,P,N),L=!l.arrow&&r(a)!=null&&P!==F&&o.reference[_]/2-(P<M?k:A)-v[_]/2<0,R=L?P<M?P-M:P-N:0;return{[g]:h[g]+R,data:{[g]:F,centerOffset:P-F-R,...L&&{alignmentOffset:R}},reset:L}}}),li=(e,t)=>({...ci(e),options:[e,t]}),ui={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},di={sideX:`left`,sideY:`top`},fi=`--available-width`,pi=`--available-height`;function mi(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function hi(e,t,n){let{rects:i,placement:a}=e;return{side:mi(t,wt(a),n),align:r(a)||`center`,anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function gi(e){return _i(e,Yr)}function _i(e,t){let{anchor:n,positionMethod:i=`absolute`,side:o=`bottom`,sideOffset:s=0,align:c=`center`,alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:f=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:h,keepMounted:g=!1,floatingRootContext:_,mounted:v,collisionAvoidance:y,shift:b,nodeId:x,adaptiveOrigin:C,lazyFlip:w=!1,externalTree:T}=e,[E,ee]=Z.useState(null);!v&&E!==null&&ee(null);let D=y.side||`flip`,O=y.align||`flip`,k=y.fallbackAxisSide||`end`,A=b?.crossAxis??!1,j=b?.rootBoundary,M=typeof n==`function`?n:void 0,P=N(M),F=M?P:n,I=Ht(n),L=Ht(v),R=si()===`rtl`,te=E||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":R?`left`:`right`,"inline-start":R?`right`:`left`}[o],z=c===`center`?te:`${te}-${c}`,B=d;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let V=+(o===`bottom`),H=+(o===`top`),U=+(o===`right`),W=+(o===`left`),G={boundary:u===`clipping-ancestors`?`clippingAncestors`:u,padding:B},K=Z.useRef(null),q=Ht(s),ne=Ht(l),re=typeof s==`function`?0:s,ie=typeof l==`function`?0:l,ae=[];h&&ae.push(h),ae.push(Tr(e=>{let t=hi(e,o,R),n=typeof q.current==`function`?q.current(t):q.current,r=typeof ne.current==`function`?ne.current(t):ne.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[re,ie,R,o]));let oe=O===`none`&&D!==`shift`,J=!oe&&(f||A||D===`shift`),se=D===`none`?null:Or({...G,padding:{top:B.top+1+V,right:B.right+1+W,bottom:B.bottom+1+H,left:B.left+1+U},mainAxis:!A&&D===`flip`,crossAxis:O===`flip`&&`alignment`,fallbackAxisSideDirection:k}),ce=oe?null:Er({...G,rootBoundary:j,mainAxis:O!==`none`,crossAxis:J,limiter:f||A?void 0:Dr(e=>{if(!K.current)return{};let{width:t,height:n}=K.current.getBoundingClientRect(),r=a(wt(e.placement)),i=r===`y`?t:n,o=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+o/2}})},[G,f,A,j,B,O]);D===`shift`||O===`shift`||c===`center`?ae.push(ce,se):ae.push(se,ce),ae.push(kr({...G,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!L.current)return;let i=e.style;i.setProperty(fi,`${t}px`),i.setProperty(pi,`${n}px`);let a=be(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),li(e=>({element:K.current||S(e.elements.floating).createElement(`div`),padding:p,offsetParent:`floating`}),[p]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:i,y:c}=e,l=wt(r),u=a(l),d=K.current,f=n.arrow?.x||0,p=n.arrow?.y||0,m=d?.clientWidth||0,h=d?.clientHeight||0,g=f+m/2,_=p+h/2,v=Math.abs(n.shift?.y||0),y=i.reference.height/2,b=typeof s==`function`?s(hi(e,o,R)):s,x=v>b,S={top:`${g}px calc(100% + ${b}px)`,bottom:`${g}px ${-b}px`,left:`calc(100% + ${b}px) ${_}px`,right:`${-b}px ${_}px`}[l],C=`${g}px ${i.reference.y+y-c}px`;return t.floating.style.setProperty(`--transform-origin`,J&&u===`y`&&x?C:S),{}}},ui,C),Y(()=>{!v&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,_]);let le=Z.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<`u`,layoutShift:!m&&typeof IntersectionObserver<`u`}),[m]),{refs:ue,elements:de,x:fe,y:pe,middlewareData:me,update:he,placement:ge,context:_e,isPositioned:ve,floatingStyles:ye}=t({rootContext:_,open:g?v:void 0,placement:z,middleware:ae,strategy:i,whileElementsMounted:g?void 0:(...e)=>fr(...e,le),nodeId:x,externalTree:T}),{sideX:xe,sideY:Se}=me.adaptiveOrigin||di,Ce=ve?i:`fixed`,we=Z.useMemo(()=>{let e;return e=ve?C?{position:Ce,[xe]:fe,[Se]:pe}:{...ye,position:Ce}:{position:Ce,top:0,left:0},e[fi]=`100vw`,e[pi]=`100vh`,ve||(e.opacity=0),e},[C,Ce,xe,fe,Se,pe,ye,ve]),Te=Z.useRef(null);Y(()=>{if(!v)return;let e=I.current,t=typeof e==`function`?e():e,n=(vi(t)?t.current:t)||null;n!==Te.current&&(ue.setPositionReference(n),Te.current=n)},[v,ue,F,I]),Z.useEffect(()=>{if(!v)return;let e=I.current;typeof e!=`function`&&vi(e)&&e.current!==Te.current&&(ue.setPositionReference(e.current),Te.current=e.current)},[v,ue,F,I]),Z.useEffect(()=>{if(g&&v&&de.reference&&de.floating)return fr(de.reference,de.floating,he,le)},[g,v,de,he,le]);let Ee=wt(ge),De=mi(o,Ee,R),Oe=r(ge)||`center`,ke=!!me.hide?.referenceHidden;Y(()=>{w&&v&&ve&&Ee!==te&&ee(Ee)},[w,v,ve,Ee,te]);let Ae=Z.useMemo(()=>({position:`absolute`,top:me.arrow?.y,left:me.arrow?.x}),[me.arrow]),je=me.arrow?.centerOffset!==0;return Z.useMemo(()=>({positionerStyles:we,arrowStyles:Ae,arrowRef:K,arrowUncentered:je,side:De,align:Oe,physicalSide:Ee,anchorHidden:ke,refs:ue,context:_e,isPositioned:ve,update:he}),[we,Ae,K,je,De,Oe,Ee,ke,ue,_e,ve,he])}function vi(e){return e!=null&&`current`in e}(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=ge.startingStyle]=`startingStyle`,e[e.endingStyle=ge.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var yi={"data-popup-open":``},bi={"data-popup-open":``,"data-pressed":``},xi={"data-open":``},Si={"data-closed":``},Ci={"data-anchor-hidden":``},wi={open(e){return e?yi:null}},Ti={open(e){return e?bi:null}},Ei={open(e){return e?xi:Si},anchorHidden(e){return e?Ci:null}},Di={...Ei,...Ze};function Oi(e){return e===`starting`?t:G}function ki(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),F(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Oi(r),i],stateAttributesMapping:Ei})}function Ai(e,t,n,r=!0,i){let[a,o]=Z.useState(),s=Ve(i?`${i}-label`:void 0),c=e??t??a;return Y(()=>{let i=e||t||!r?void 0:ji(n.current,s);a!==i&&o(i)}),c}function ji(e,t){let n=Mi(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Mi(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Ni=`ArrowUp`,Pi=`ArrowDown`,Fi=`ArrowLeft`,Ii=`ArrowRight`,Li=`Home`,Ri=new Set([Ni,Pi,Fi,Ii,Li,`End`]),zi=[`Shift`,`Control`,`Alt`,`Meta`];function Bi(e){return Ce(e)&&e.tagName===`INPUT`}function Vi(e){return!!(Bi(e)&&e.selectionStart!=null||Ce(e)&&e.tagName===`TEXTAREA`)}function Hi(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Ui(e,t,`left`),a=Wi(e),o=Wi(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Ui(e,t,`top`),r=Wi(e),i=Wi(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Ui(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Wi(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Gi=Z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Ki={},qi={},Ji=``;function Yi(e,t){return et(e)?e:t}function Xi(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Yi(t,n)).overflowY)}function Zi(e){if(typeof document>`u`)return!1;let t=S(e);return be(t).innerWidth-t.documentElement.clientWidth>0}function Qi(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=S(e),n=t.documentElement,r=t.body,i=Yi(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function $i(e){let t=S(e),n=t.documentElement,r=t.body,i=Yi(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function ea(e){let t=S(e),n=t.documentElement,r=t.body,i=be(n),a=0,o=0,s=!1,c=L.create();if(je&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Ki={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ji=n.style.scrollBehavior,qi={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Yi(n,r);if(s=Qi(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Ki),Object.assign(r.style,qi),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Ji)}function d(){u(),c.request(l)}l();let f=_t(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ta=new class{lockCount=0;restore=null;timeoutLock=_e.create();timeoutUnlock=_e.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=S(e),n=t.documentElement,r=t.body,i=be(n);if(Xi(i,n,r)){let t=new i.MutationObserver(()=>{Xi(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=mt||!Zi(e);this.restore=a?$i(e):ea(e)}};function na(e=!0,t=null){Y(()=>{if(e)return ta.acquire(t)},[e,t])}function ra(e){let t=Z.useRef(``),n=Z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function ia(e,t){let n=Z.useRef(e),r=N(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function aa(e,t){let{onClick:n,onPointerDown:r}=ra(N((n,r)=>{(typeof e==`function`?e():e)||t(r||(mt?`touch`:``))}));return Z.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function oa(e){let[t,n]=Z.useState(null),r=aa(e,n);return ia(e,t=>{t&&!e&&n(null)}),Z.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var sa=Z.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ca(){return Z.useContext(sa)}function la(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=ca(),u=Z.useRef(-1),[d,f]=Z.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=Z.useRef(null),h=Z.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var ua=Z.createContext(void 0);function da(e){let t=Z.useContext(ua);if(t===void 0&&!e)throw Error(se(69));return t}function fa(e){let{children:t,elementsRef:r,labelsRef:i,onMapChange:a}=e,o=N(a),[,s]=Z.useState(!1),c=n(ma).current,l=n(pa).current,u=Z.useRef(0),d=Z.useRef(!0),f=Z.useRef([]),p=Z.useRef(null),m=N(()=>{d.current||(d.current=!0,s(e=>!e))}),h=N((e,t)=>{l.set(e,t),m()}),g=N(e=>{l.delete(e),m()}),_=N(e=>{let t=new Map;return r.current.length=0,i&&(i.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),r.current[e.index]=e.element,i&&(i.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),u.current=r.current.length,t});function v(e){if(p.current?.disconnect(),p.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!_a(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&va(r,n)>0){t.disconnect(),m();return}r=n}});p.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=ga(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=N(()=>{let[e,t]=ha(l),n=_(e);v(t),f.current=e,d.current=!1,c.forEach(e=>e(n)),o(n)});Y(()=>(d.current||_(f.current),()=>{r.current=[],i&&(i.current=[])}),[r,i,_]),Y(()=>{d.current&&y()}),Y(()=>()=>{p.current?.disconnect(),d.current=!0},[]);let b=N(e=>(c.add(e),()=>{c.delete(e)})),x=Z.useMemo(()=>({register:h,unregister:g,subscribeMapChange:b,nextIndexRef:u}),[h,g,b,u]);return(0,Q.jsx)(sa.Provider,{value:x,children:t})}function pa(){return new Map}function ma(){return new Set}function ha(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>va(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function ga(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function _a(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function va(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var ya=20;function ba(e,t,n,r){let[i,a]=Z.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=S(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-ya)},[e,t,n]),na(e&&(!t||i),r)}var xa=5;function Sa(e,t){let n=Ca(t);return e.clientX>=n.left-xa&&e.clientX<=n.right+xa&&e.clientY>=n.top-xa&&e.clientY<=n.bottom+xa}function Ca(e){let t=e.getBoundingClientRect(),n=be(e);if($e)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function wa(e){let[t,n]=Z.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function Ta(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Ea(e){let t=Z.useRef(!0);t.current&&(t.current=!1,e())}var Da=Z.createContext(null);function Oa(){let e=Z.useContext(Da);if(e===null)throw Error(se(60));return e}var ka=(e,t)=>Object.is(e,t);function Aa(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function ja(e,t,n){return!e||e.length===0?!1:e.some(e=>e!==void 0&&Aa(t,e,n))}function Ma(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&Aa(e,t,n))}function Na(e,t,n,r){let i=Ma(e,r&&Array.isArray(t)?t[t.length-1]:t,n);return i===-1?null:i}function Pa(e,t,n){return e.filter(e=>!Aa(t,e,n))}function Fa(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Ia(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function La(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Ia(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Ra(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Fa(e)}function za(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Fa(e.value):Fa(e)}function Ba(e,t,n){function r(){return Ra(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=Ia(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Va(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Q.jsx)(Z.Fragment,{children:Ba(r,t,n)},i)),e),[])}var $={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:za(t,r)!==``},hasNullItemLabel:(e,t)=>t?La(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>Aa(t,e,n)):Aa(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Ha(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Ua(e,t){return Math.max(0,e-t)}function Wa(e,t){if(t<=0)return 0;let n=Vt(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function Ga(e){let{id:t,value:r,defaultValue:a=null,onValueChange:o,open:s,defaultOpen:c=!1,onOpenChange:l,name:f,form:p,autoComplete:m,disabled:h=!1,readOnly:g=!1,required:_=!1,modal:v=!0,actionsRef:y,inputRef:b,onOpenChangeComplete:x,items:S,multiple:C=!1,itemToStringLabel:w,itemToStringValue:T,isItemEqualToValue:E=ka,highlightItemOnHover:ee=!0,children:D}=e,{clearErrors:O}=ut(),{setDirty:A,setTouched:j,setFocused:M,validityData:P,setFilled:F,name:I,disabled:L,validation:R,validationMode:te}=Qe(),z=at({id:t}),B=L||h,U=I??f,[W,K]=Ye({controlled:r,default:C?a??i:a,name:`Select`,state:`value`}),[q,ne]=Ye({controlled:s,default:c,name:`Select`,state:`open`}),re=Z.useRef([]),ie=Z.useRef([]),oe=Z.useRef(null),J=Z.useRef(null),se=Z.useRef(0),ce=Z.useRef(null),le=Z.useRef([]),ue=Z.useRef(!1),de=Z.useRef(null),fe=Z.useRef(null),me=Z.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),he=Z.useRef(!1),{mounted:ge,setMounted:_e,transitionStatus:ve}=Nr(q),{openMethod:ye,triggerProps:be}=oa(q),xe=n(()=>new d({id:z,labelId:void 0,modal:v,multiple:C,itemToStringLabel:w,itemToStringValue:T,isItemEqualToValue:E,value:W,open:q,mounted:ge,transitionStatus:ve,items:S,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Se=k(xe,$.activeIndex),Ce=k(xe,$.selectedIndex),we=k(xe,$.triggerElement),Te=k(xe,$.positionerElement),Ee=wa(ye),De=ye??Ee,Oe=Z.useMemo(()=>C?``:za(W,T),[C,W,T]),ke=Z.useMemo(()=>C&&Array.isArray(W)?W.map(e=>za(e,T)):za(W,T),[C,W,T]),Ae=Ht(we),je=N(()=>ke);pe(Ae,z,W,je,!B,f);let Me=Z.useRef(W),Ne=C?Array.isArray(W)&&W.length>0:W!=null&&Oe!==``;Y(()=>{F(Ne)},[Ne,F]),Y(function(){let e=W,t=!1;if(C){let n=Array.isArray(W)?W:[];t=n.length===0,e=n[n.length-1]}let n=t?-1:Ma(le.current,e,E),r=n===-1?null:n;r===null&&(fe.current=null),!q&&xe.set(`selectedIndex`,r)},[C,q,W,E,xe]);function Pe(e){let t=P.initialValue;return Array.isArray(e)&&Array.isArray(t)?!Ha(e,t,(e,t)=>Aa(e,t,E)):e!==t}ia(W,()=>{O(U),A(Pe(W)),R.change(W)});let Fe=N((e,t)=>{l?.(e,t),!t.isCanceled&&(ne(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(j(!0),M(!1),te===`onBlur`&&R.commit(W)))}),Ie=N(()=>{_e(!1),xe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),x?.(!1)});Je({enabled:!y,open:q,ref:oe,onComplete(){q||Ie()}}),Z.useImperativeHandle(y,()=>({unmount:Ie}),[Ie]);let Le=N((e,t)=>{o?.(e,t),!t.isCanceled&&K(e)}),Re=N(e=>{let t=Ua(e.scrollHeight,e.clientHeight),n=Wa(e.scrollTop,t),r=n>0,i=n<t;xe.set(`scrollUpArrowVisible`,r),xe.set(`scrollDownArrowVisible`,i)}),ze=Jr({open:q,onOpenChange:Fe,elements:{reference:we,floating:Te}}),Be=Cn(ze,{enabled:!g&&!B,event:`mousedown`}),Ve=En(ze),He=ii(ze,{enabled:!g&&!B,listRef:re,activeIndex:Se,selectedIndex:Ce,disabledIndices:i,onNavigate(e){e===null&&!q||xe.set(`activeIndex`,e)},focusItemOnHover:ee}),Ue=ai(ze,{enabled:!g&&!B&&(q||!C),listRef:ie,activeIndex:Se,selectedIndex:Ce,disabledIndices:e=>Ta(re.current[e]),onMatch(e){q?xe.set(`activeIndex`,e):Le(le.current[e],u(V))},onTyping(e){ue.current=e}}),Ge=Z.useMemo(()=>ae(Ue.reference,He.reference,Ve.reference,Be.reference,be),[Be.reference,Ue.reference,He.reference,Ve.reference,be]),Ke=Z.useMemo(()=>ae(Pr,Ue.floating,He.floating,Ve.floating),[Ue.floating,He.floating,Ve.floating]),qe=He.item??G;Ea(()=>{xe.update({popupProps:Ke,triggerProps:Ge})}),xe.useSyncedValues({id:z,modal:v,multiple:C,value:W,open:q,mounted:ge,transitionStatus:ve,popupProps:Ke,triggerProps:Ge,items:S,itemToStringLabel:w,itemToStringValue:T,isItemEqualToValue:E,openMethod:De});let X=Z.useMemo(()=>({store:xe,floatingContext:ze,required:_,disabled:B,readOnly:g,multiple:C,highlightItemOnHover:ee,setValue:Le,setOpen:Fe,listRef:re,popupRef:oe,scrollHandlerRef:J,handleScrollArrowVisibility:Re,scrollArrowsMountedCountRef:se,itemProps:qe,valueRef:ce,valuesRef:le,labelsRef:ie,typingRef:ue,selectionRef:me,firstItemTextRef:de,selectedItemTextRef:fe,validation:R,onOpenChangeComplete:x,alignItemWithTriggerActiveRef:he,initialValueRef:Me}),[xe,ze,_,B,g,C,ee,Le,Fe,qe,R,x,Re]),Xe=H(b,R.inputRef),Ze=C?void 0:U,$e=Z.useMemo(()=>!C||!Array.isArray(W)||!U?null:W.map(e=>{let t=za(e,T);return(0,Q.jsx)(`input`,{type:`hidden`,form:p,name:U,value:t,disabled:B},t)}),[C,W,p,U,T,B]);return(0,Q.jsxs)(Da.Provider,{value:X,children:[D,(0,Q.jsx)(`input`,{...R.getValidationProps(B,{onFocus(){xe.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||B||g)return;let t=e.currentTarget.value,n=u(V,e.nativeEvent);function r(){if(C)return;let e=t.toLowerCase(),r=le.current.findIndex(t=>za(t,T).toLowerCase()===e||Ra(t,w).toLowerCase()===e);r===-1&&(r=le.current.findIndex((t,n)=>{let r=ie.current[n];return r!=null&&r.toLowerCase()===e}));let i=le.current[r];i!=null&&Le(i,n)}xe.set(`forceMount`,!0),queueMicrotask(r)}}),id:z&&Ze==null?`${z}-hidden-input`:void 0,form:p,name:Ze,autoComplete:m,value:Oe,disabled:B,required:_&&!(C&&Ne),readOnly:g,ref:Xe,style:U?pt:We,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),$e]})}function Ka(e,t){return e??t}var qa=400,Ja={...Ti,...Pe,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Ya=Z.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:d,validationMode:f,state:p,disabled:m}=Qe(),{labelId:h}=ve(),{store:g,setOpen:_,selectionRef:v,validation:y,readOnly:b,required:x,alignItemWithTriggerActiveRef:C,disabled:w}=Oa(),T=m||w||a,E=k(g,$.open),ee=k(g,$.mounted),D=k(g,$.value),A=k(g,$.triggerProps),j=k(g,$.positionerElement),M=k(g,$.listElement),N=k(g,$.popupSide),P=k(g,$.id),I=k(g,$.labelId),L=k(g,$.hasSelectedValue),R=ee&&j?N:null,te=i??P,z=Ka(h,I);at({id:te});let B=Ht(j),H=Z.useRef(null),{getButtonProps:U,buttonRef:W}=ne({disabled:T,native:o}),G=g.useStateSetter(`triggerElement`),K=bt(),q=bt(),re=bt();Z.useEffect(()=>{if(E)return re.start(qa,()=>{v.current.allowUnselectedMouseUp=!0,v.current.allowSelectedMouseUp=!0}),()=>{re.clear()};v.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},q.clear()},[E,v,q,re]);let ie=ae(A,{id:te,role:`combobox`,"aria-expanded":E,"aria-haspopup":`listbox`,"aria-controls":E?M?.id??ue(j)?.id:void 0,"aria-labelledby":z,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:T?-1:0,onFocus(e){d(!0),E&&C.current&&_(!1,u(V,e.nativeEvent)),K.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){X(j,e.relatedTarget)||(l(!0),d(!1),f===`onBlur`&&y.commit(D))},onMouseDown(e){if(E)return;let t=S(e.currentTarget);function n(e){if(!H.current)return;let t=e.target;X(H.current,t)||X(B.current,t)||Sa(e,H.current)||_(!1,u(O,e))}q.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,U),oe=y.getValidationProps(T,ie);oe.role=`combobox`;let J={...p,open:E,disabled:T,value:D,readOnly:b,popupSide:R,placeholder:!L};return F(`button`,e,{ref:[t,H,W,G],state:J,stateAttributesMapping:Ja,props:oe})}),Xa={value:()=>null},Za=Z.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=Oa(),u=k(c,$.value),d=k(c,$.items),f=k(c,$.itemToStringLabel),p=k(c,$.hasSelectedValue),m=!p&&a!=null&&i==null,h=k(c,$.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?Va(u,d,f):Ba(u,d,f)),F(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:Xa})}),Qa=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=Oa(),s={open:k(o,$.open)};return F(`span`,e,{state:s,ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:wi})}),$a=Z.forwardRef(function(e,t){let{store:n}=Oa(),r=k(n,$.mounted),i=k(n,$.forceMount);return r||i?(0,Q.jsx)(o,{ref:t,...e}):null}),eo=Z.createContext(void 0);function to(){let e=Z.useContext(eo);if(!e)throw Error(se(59));return e}function no(e,t){e&&Object.assign(e.style,t)}var ro={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},io={position:`fixed`},ao=Z.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h,alignItemWithTrigger:g=!0,collisionAvoidance:_=De,style:v,...y}=e,{store:b,listRef:x,labelsRef:S,alignItemWithTriggerActiveRef:C,selectedItemTextRef:w,valuesRef:T,initialValueRef:E,popupRef:ee,setValue:D,floatingContext:O}=Oa(),A=k(b,$.open),j=k(b,$.mounted),M=k(b,$.modal),P=k(b,$.value),F=k(b,$.openMethod),I=k(b,$.positionerElement),L=k(b,$.triggerElement),R=k(b,$.isItemEqualToValue),te=k(b,$.transitionStatus),z=Z.useRef(null),B=Z.useRef(null),[H,U]=Z.useState(g),W=j&&H&&F!==`touch`;!j&&H!==g&&U(g),Z.useImperativeHandle(C,()=>W),ba((W||M)&&A,F===`touch`,I,L);let G=gi({anchor:n,floatingRootContext:O,positionMethod:a,mounted:j,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h??W,collisionAvoidance:_,keepMounted:!0}),K=W?`none`:G.side,q=W?io:G.positionerStyles,ne={open:A,side:K,align:G.align,anchorHidden:G.anchorHidden};Y(()=>{b.set(`popupSide`,G.side)},[b,G.side]);let re=ki(e,ne,{styles:q,transitionStatus:te,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!j,inert:!A}),ie=Z.useRef(0),ae=N(e=>{if(T.current.length===0)return;let t=ie.current;if(ie.current=e.size,e.size===t)return;let n=u(V);if(t!==0&&!b.state.multiple&&P!==null&&Ma(T.current,P,R)===-1){let e=E.current,t=e!=null&&Ma(T.current,e,R)!==-1?e:null;D(t,n),t===null&&(b.set(`selectedIndex`,null),w.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(P)){let e=P.filter(e=>Ma(T.current,e,R)!==-1);e.length!==P.length&&(D(e,n),e.length===0&&(b.set(`selectedIndex`,null),w.current=null))}if(A&&W){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};no(I,e),no(ee.current,e)}}),oe=Z.useMemo(()=>({...G,side:K,alignItemWithTriggerActive:W,setControlledAlignItemWithTrigger:U,scrollUpArrowRef:z,scrollDownArrowRef:B}),[G,K,W,U]);return(0,Q.jsx)(fa,{elementsRef:x,labelsRef:S,onMapChange:ae,children:(0,Q.jsxs)(eo.Provider,{value:oe,children:[j&&M&&(0,Q.jsx)(Gi,{inert:ct(!A),cutout:L}),re]})})}),oo=`base-ui-disable-scrollbar`,so={className:oo,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:oo,precedence:`base-ui:low`,children:`.${oo}{scrollbar-width:none}.${oo}::-webkit-scrollbar{display:none}`})}},co=Z.createContext(void 0),lo={disableStyleElements:!1};function uo(){return Z.useContext(co)??lo}var fo={...Ei,...Ze},po=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:c,popupRef:l,onOpenChangeComplete:d,setOpen:f,valueRef:p,firstItemTextRef:m,selectedItemTextRef:h,multiple:g,handleScrollArrowVisibility:_,scrollHandlerRef:v,listRef:y,highlightItemOnHover:b,floatingContext:x}=Oa(),{side:C,align:w,alignItemWithTriggerActive:T,isPositioned:E,setControlledAlignItemWithTrigger:ee}=to(),D=da(!0)!=null,O=si(),{nonce:A,disableStyleElements:j}=uo(),M=k(c,$.id),P=k(c,$.open),I=k(c,$.openMethod),L=k(c,$.mounted),R=k(c,$.popupProps),te=k(c,$.transitionStatus),z=k(c,$.triggerElement),B=k(c,$.positionerElement),V=k(c,$.listElement),H=Z.useRef(!1),U=Z.useRef(!1),W=Z.useRef({}),G=s(),K=N(e=>{if(!B||!l.current||!U.current)return;let t=B.style.top===`0px`,n=B.style.bottom===`0px`;if(H.current||!T||!t&&!n){_(e);return}let r=go(B),i=_o(B.getBoundingClientRect().height,`y`,r),a=S(B),o=be(B),s=o.getComputedStyle(B),c=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=mo(o.getComputedStyle(l.current)),f=Math.min(a.documentElement.clientHeight-c-u,d),p=e.scrollTop,m=ho(e),h=null,g=e=>{B.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=Vt(v,0,f-i);n>0&&g(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(H.current=!0),_(e);return}f-y>1?h=t?1/0:0:n&&p<m&&(h=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&g(b),h!=null){let t=Vt(h,0,ho(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(H.current=!0),_(e)});Z.useImperativeHandle(v,()=>K,[K]),Je({open:P,ref:l,onComplete(){P&&d?.(!0)}});let q={open:P,transitionStatus:te,side:C,align:w};Y(()=>{!B||!l.current||Object.keys(W.current).length||(W.current={top:B.style.top||`0`,left:B.style.left||`0`,right:B.style.right,height:B.style.height,bottom:B.style.bottom,minHeight:B.style.minHeight,maxHeight:B.style.maxHeight,marginTop:B.style.marginTop,marginBottom:B.style.marginBottom})},[l,B]),Y(()=>{P||T||(U.current=!1,H.current=!1,no(B,W.current))},[P,T,B,l]),Y(()=>{let e=l.current;if(!P||!z||!B||!e||T&&!E||c.state.transitionStatus===`ending`)return;if(U.current=!0,e.style.removeProperty(`--transform-origin`),!T){G.request(()=>_(V||e));return}let t=bo(e);try{let t=h.current;t?.isConnected||(t=!$.hasSelectedValue(c.state)&&m.current?.isConnected?m.current:null);let n=p.current,r=be(B),i=r.getComputedStyle(B),a=r.getComputedStyle(e),o=S(z),s=go(z),l=vo(z.getBoundingClientRect(),s),u=vo(B.getBoundingClientRect(),s),d=l.height,f=V||e,g=f.scrollHeight,v=parseFloat(a.borderBottomWidth),x=parseFloat(i.marginTop)||10,C=parseFloat(i.marginBottom)||10,w=parseFloat(i.minHeight)||100,T=mo(a),E=o.documentElement.clientHeight-x-C,D=o.documentElement.clientWidth,k=E-l.bottom+d,A,j=O===`rtl`?l.right-u.width:l.left,M=0;if(t&&n){let e=vo(n.getBoundingClientRect(),s);A=vo(t.getBoundingClientRect(),s),j=u.left+(O===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-l.top+e.height/2;M=A.top-u.top+A.height/2-r}let N=k+M+C+v,P=Math.min(E,N),F=E-x-C,I=N-P,L=D-5;B.style.left=`${Vt(j,5,L-u.width)}px`,B.style.height=`${P}px`,B.style.maxHeight=`none`,B.style.marginTop=`${x}px`,B.style.marginBottom=`${C}px`,e.style.height=`100%`;let R=ho(f),te=I>=R-1;te&&(P=Math.min(E,u.height)-(I-R));let U=l.top<20||l.bottom>E-20||Math.ceil(P)+1<Math.min(g,w),G=(r.visualViewport?.scale??1)!==1&&je;if(U||G){no(B,W.current),ee(!1);return}let K=Math.max(w,P);if(te){let e=Math.max(0,E-N);B.style.top=u.height>=F?`0`:`${e}px`,B.style.height=`${P}px`,f.scrollTop=ho(f)}else B.style.bottom=`0`,f.scrollTop=I;if(A){let t=u.top,n=u.height,r=A.top+A.height/2,i=Vt(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(K===E||P>=T)&&(H.current=!0),_(f),b&&c.state.selectedIndex===null&&c.state.activeIndex===null&&y.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,P,B,z,p,m,h,l,_,T,ee,G,V,y,b,O,E]),Z.useEffect(()=>{if(!T||!B||!P)return;let e=be(B);function t(e){f(!1,u(ie,e))}return _t(e,`resize`,t)},[f,T,B,P]);let ne={...V?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":g||void 0,id:`${M}-list`},onKeyDown(e){D&&Ri.has(e.key)&&e.stopPropagation()},onScroll(e){V||K(e.currentTarget)},...T&&{style:V?{height:`100%`}:ro},className:!V&&T?so.className:void 0},re=F(`div`,e,{ref:[t,l],state:q,stateAttributesMapping:fo,props:[R,ne,Oi(te),o]});return(0,Q.jsxs)(Z.Fragment,{children:[!j&&so.getElement(A),(0,Q.jsx)(Sn,{context:x,modal:!1,disabled:!L,openInteractionType:I,returnFocus:a,restoreFocus:!0,children:re})]})});function mo(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function ho(e){return Ua(e.scrollHeight,e.clientHeight)}function go(e){return lr.getScale(e)}function _o(e,t,n){return e/n[t]}function vo(e,t){return U({x:_o(e.x,`x`,t),y:_o(e.y,`y`,t),width:_o(e.width,`x`,t),height:_o(e.height,`y`,t)})}var yo=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function bo(e){let{style:t}=e,n={};for(let[e,r]of yo)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of yo){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var xo=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s,multiple:c}=Oa(),{alignItemWithTriggerActive:l}=to(),u=k(o,$.hasScrollArrows),d=k(o,$.openMethod),f={id:`${k(o,$.id)}-list`,role:`listbox`,"aria-multiselectable":c||void 0,onScroll(e){s.current?.(e.currentTarget)},...l&&{style:ro},className:u&&d!==`touch`?so.className:void 0},p=o.useStateSetter(`listElement`);return F(`div`,e,{ref:[t,p],props:[f,a]})}),So=Z.createContext(void 0);function Co(){let e=Z.useContext(So);if(!e)throw Error(se(57));return e}var wo=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,d=Z.useRef(null),f=la({guess:!0,label:o,textRef:d}),{store:p,itemProps:m,setOpen:h,setValue:g,selectionRef:_,typingRef:v,valuesRef:y,multiple:b,selectedItemTextRef:S,disabled:C,readOnly:w}=Oa(),T=C||s,E=k(p,$.isActive,f.index),ee=k(p,$.open),D=k(p,$.isSelected,a),O=k(p,$.isSelectedByFocus,f.index),A=k(p,$.isItemEqualToValue),j=f.index,M=Z.useRef(null);Y(()=>{let e=y.current;return e[j]=a,()=>{delete e[j]}},[j,a,y]),Y(()=>{let e=p.state.value,t=e;b&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),t!==void 0&&Aa(a,t,A)&&(p.set(`selectedIndex`,j),d.current&&(S.current=d.current))},[j,b,A,p,a,S]);let N=Z.useRef(`mouse`),P=Z.useRef(!1),{getButtonProps:I,buttonRef:L}=ne({disabled:T,focusableWhenDisabled:!0,native:c,composite:!0}),R={disabled:T,selected:D,highlighted:E};function te(e){if(C||w)return;let t=p.state.value;if(b){let n=Array.isArray(t)?t:[],r=D?Pa(n,a,A):[...n,a];g(r,u(Ct,e))}else g(a,u(Ct,e)),h(!1,u(Ct,e))}function z(){_.current.dragY=0}let B={role:`option`,"aria-selected":D,tabIndex:ee&&E?0:-1,onKeyDown(e){p.set(`activeIndex`,j),e.key===` `&&v.current&&e.preventDefault()},onClick(e){let t=N.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&x(e.nativeEvent)&&(n!==void 0||E),i=t&&!r&&!P.current;P.current=!1,!(T||i)&&te(e.nativeEvent)},onPointerEnter(e){N.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=_.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){N.current=e.pointerType,P.current=!0,z()},onMouseUp(){if(z(),T||N.current===`touch`||P.current)return;let e=!_.current.allowSelectedMouseUp&&D,t=!_.current.allowUnselectedMouseUp&&!D;e||t||(P.current=!0,M.current?.click(),P.current=!1)}},V=F(`div`,e,{ref:[L,t,f.ref,M],state:R,props:[m,B,l,I]}),H=Z.useMemo(()=>({selected:D,index:j,textRef:d,selectedByFocus:O}),[D,j,d,O]);return(0,Q.jsx)(So.Provider,{value:H,children:V})})),To=Z.forwardRef(function(e,t){let{selected:n}=Co();return e.keepMounted||n?(0,Q.jsx)(Eo,{...e,ref:t}):null}),Eo=Z.memo(Z.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=Co(),c=Z.useRef(null),{transitionStatus:l,setMounted:u}=Nr(s),d=F(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:Ze});return Je({open:s,ref:c,onComplete(){s||u(!1)}}),d})),Do=Z.memo(Z.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=Co(),{firstItemTextRef:a,selectedItemTextRef:o}=Oa(),{render:s,className:c,style:l,...u}=e,d=Z.useCallback(e=>{e&&(n===0&&(a.current=e),i&&(o.current=e))},[a,o,n,i]);return F(`div`,e,{ref:[d,t,r],props:u})})),Oo=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=Oa(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=to(),_=c?$.scrollUpArrowVisible:$.scrollDownArrowVisible,v=k(l,_),y=k(l,$.openMethod),b=v&&y!==`touch`,x=bt(),S=c?g:h,{mounted:C,transitionStatus:w,setMounted:T}=Nr(b);Y(()=>(p.current+=1,l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.set(`hasScrollArrows`,!1)}),[l,p]),Je({open:b,ref:S,onComplete(){b||T(!1)}});let E=F(`div`,e,{ref:[t,S],state:{direction:a,visible:b,side:m,transitionStatus:w},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||x.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f(e);let n=Ua(e.scrollHeight,e.clientHeight),r=Wa(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),i){x.clear();return}if(a.length>0){let t=S.current?.offsetHeight||0;e.scrollTop=ko(a,c,r,e.clientHeight,t,n)}x.start(40,t)}x.start(40,t)},onMouseLeave(){x.clear()}},s],stateAttributesMapping:Ze});return C||o?E:null});function ko(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?Wa(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?Wa(l.offsetTop+l.offsetHeight-r+i,a):a}var Ao=Z.forwardRef(function(e,t){return(0,Q.jsx)(Oo,{...e,ref:t,direction:`down`})}),jo=Z.forwardRef(function(e,t){return(0,Q.jsx)(Oo,{...e,ref:t,direction:`up`})}),Mo=Z.createContext(void 0);function No(){let e=Z.useContext(Mo);if(e===void 0)throw Error(se(56));return e}var Po=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Z.useState(),c=Z.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=F(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,Q.jsx)(Mo.Provider,{value:c,children:l})}),Fo=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=No(),c=Ve(a);return Y(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),F(`div`,e,{ref:t,props:[{id:c},o]})}),Io=Ga;function Lo({className:e,...t}){return(0,Q.jsx)(Po,{"data-slot":`select-group`,className:v(`scroll-my-1.5 p-1`,e),...t})}function Ro({className:e,...t}){return(0,Q.jsx)(Za,{"data-slot":`select-value`,className:v(`flex flex-1 text-left`,e),...t})}function zo({className:e,size:t=`default`,children:n,...r}){return(0,Q.jsxs)(Ya,{"data-slot":`select-trigger`,"data-size":t,className:v(`relative flex w-fit items-center justify-between gap-1.5 rounded-2xl border border-transparent bg-input/50 px-3 py-2 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] duration-200 outline-none hover:bg-input focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,Q.jsx)(Qa,{render:(0,Q.jsx)(It,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Bo({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,Q.jsx)($a,{children:(0,Q.jsx)(ao,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,Q.jsxs)(po,{"data-slot":`select-content`,"data-align-trigger":o,className:v(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl bg-popover text-popover-foreground shadow-lg ring-1 ring-foreground/5 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,Q.jsx)(Uo,{}),(0,Q.jsx)(xo,{children:t}),(0,Q.jsx)(Wo,{})]})})})}function Vo({className:e,...t}){return(0,Q.jsx)(Fo,{"data-slot":`select-label`,className:v(`px-2 py-1 text-xs text-muted-foreground`,e),...t})}function Ho({className:e,children:t,...n}){return(0,Q.jsxs)(wo,{"data-slot":`select-item`,className:v(`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Q.jsx)(Do,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,Q.jsx)(To,{render:(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,Q.jsx)(Ft,{className:`pointer-events-none`})})]})}function Uo({className:e,...t}){return(0,Q.jsx)(jo,{"data-slot":`select-scroll-up-button`,className:v(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Q.jsx)(Lt,{})})}function Wo({className:e,...t}){return(0,Q.jsx)(Ao,{"data-slot":`select-scroll-down-button`,className:v(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Q.jsx)(It,{})})}var Go=Z.createContext(void 0);function Ko(){let e=Z.useContext(Go);if(e===void 0)throw Error(se(63));return e}var qo={...Pe,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},Jo=Z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:d=!1,onCheckedChange:f,readOnly:p=!1,required:h=!1,disabled:g=!1,render:_,uncheckedValue:v,value:y,style:b,...x}=e,{clearErrors:S}=ut(),{state:C,setTouched:w,setDirty:T,validityData:E,setFilled:ee,setFocused:D,validationMode:O,disabled:k,name:A,validation:j}=Qe(),{labelId:M}=ve(),N=k||g,P=A??l,I=Z.useRef(null),L=H(I,c,j.inputRef),R=Z.useRef(null),te=Ve(),z=at({id:s,implicit:!1,controlRef:R}),B=d?void 0:z,[U,W]=Ye({controlled:n,default:!!i,name:`Switch`,state:`checked`});pe(R,te,U,void 0,!N,l),Y(()=>{I.current&&ee(I.current.checked)},[ee]),ia(U,()=>{S(P),T(U!==E.initialValue),ee(U),j.change(U)});let{getButtonProps:K,buttonRef:q}=ne({disabled:N,native:d}),re=Ai(a,M,I,!d,B),ie={id:d?z:te,role:`switch`,"aria-checked":U,"aria-readonly":p||void 0,"aria-required":h||void 0,"aria-labelledby":re,onFocus(){N||D(!0)},onBlur(){let e=I.current;!e||N||(w(!0),D(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){if(p||N)return;e.preventDefault();let t=I.current;t&&m(t,e)}},ae={...j.getValidationProps(N),checked:U,disabled:N,form:o,id:B,name:P,required:h,style:P?pt:We,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:L,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(p){e.preventDefault();return}let t=e.currentTarget.checked,n=u(V,e.nativeEvent);f?.(t,n),!n.isCanceled&&W(t)},onClick(e){e.stopPropagation()},onFocus(){R.current?.focus()},...y===void 0?G:{value:y}},oe=Z.useMemo(()=>({...C,checked:U,disabled:N,readOnly:p,required:h}),[C,U,N,p,h]),J=F(`span`,e,{state:oe,ref:[t,R,q],props:[ie,x,K,e=>j.getValidationProps(N,e)],stateAttributesMapping:qo});return(0,Q.jsxs)(Go.Provider,{value:oe,children:[J,!U&&P&&v!==void 0&&(0,Q.jsx)(`input`,{type:`hidden`,form:o,name:P,value:v,disabled:N}),(0,Q.jsx)(`input`,{...ae,suppressHydrationWarning:!0})]})}),Yo=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Ko();return F(`span`,e,{state:o,ref:t,stateAttributesMapping:qo,props:a})});function Xo({className:e,size:t=`default`,...n}){return(0,Q.jsx)(Jo,{"data-slot":`switch`,"data-size":t,className:v(`peer group/switch relative inline-flex shrink-0 items-center rounded-2xl border-2 transition-all outline-none group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-5 data-[size=default]:w-8 data-[size=sm]:h-4 data-[size=sm]:w-6 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary group-has-[:focus-visible]/field-label:data-checked:border-primary data-unchecked:border-transparent data-unchecked:bg-input/90 group-has-[:focus-visible]/field-label:data-unchecked:border-transparent data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,Q.jsx)(Yo,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-2xl bg-background shadow-sm ring-0 transition-transform not-dark:bg-clip-padding group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-checked:translate-x-[calc(100%-4px)] dark:data-checked:bg-primary-foreground data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}export{ai as $,la as A,It as At,Ri as B,ja as C,pn as Ct,ba as D,on as Dt,Sa as E,un as Et,Gi as F,ki as G,zi as H,Pi as I,Di as J,Oi as K,Fi as L,aa as M,Pt as Mt,ia as N,fa as O,Ht as Ot,na as P,si as Q,Ii as R,Pa as S,fn as St,Ta as T,ln as Tt,Vi as U,Li as V,Hi as W,wi as X,Ti as Y,gi as Z,za as _,Mr as _t,Ho as a,Vr as at,Ma as b,Cn as bt,Ro as c,zr as ct,Ha as d,Gr as dt,ii as et,La as f,Ir as ft,Ra as g,Nr as gt,Ba as h,Rr as ht,Lo as i,Lr as it,oa as j,Ft as jt,da as k,Rt as kt,uo as l,Ur as lt,Va as m,Hr as mt,Io as n,qr as nt,Vo as o,Br as ot,Ia as p,Kr as pt,Ei as q,Bo as r,Pr as rt,zo as s,Fr as st,Xo as t,Jr as tt,Ka as u,Wr as ut,Aa as v,jr as vt,Ea as w,dn as wt,Na as x,Sn as xt,ka as y,En as yt,Ni as z};
@@ -0,0 +1,6 @@
1
+ import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},te={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=te,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),a=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=e(r(),1),s=e(a(),1),c=500,l=8e3,u=45e3,d=new Set([401,403,404]);function f(e){let t=e.token?{authorization:`Bearer ${e.token}`}:{},n=e.token?{}:{credentials:`same-origin`};return{async command(r){let i=await fetch(`${e.url}/api/command`,{method:`POST`,headers:{...t,"content-type":`application/json`},...n,body:JSON.stringify(r)});return await h(i,e.token,e.authenticationRequired),(await i.json()).result},async listSessions(){let r=await fetch(`${e.url}/api/sessions`,{headers:t,...n});return await h(r,e.token,e.authenticationRequired),await r.json()},async branches(r){let i=`${e.url}/api/branches?scope=${encodeURIComponent(r)}`,a=await fetch(i,{headers:t,...n});return await h(a,e.token,e.authenticationRequired),await a.json()},async readPresentation(r,i,a){let o=await fetch(`${e.url}/api/sessions/${encodeURIComponent(r)}/presentation?before=${i}&limit=400`,{headers:t,...n,...a?{signal:a}:{}});return await h(o,e.token,e.authenticationRequired),await o.json()},subscribePresentation({sessionId:r,start:i,onSnapshot:a,onUpdate:o,onError:s,onLink:l,silenceMs:f}){let h=`${e.url}/api/sessions/${encodeURIComponent(r)}/presentation/events`,_=!1,v,y,b=0;return(async()=>{for(;!_;){l?.(`connecting`);let r=new AbortController;v=r;let x=!1,S=()=>setTimeout(()=>{x=!0,r.abort()},f??u),C=S(),w=()=>{clearTimeout(C),C=S()},T=Date.now();try{let c=i(),u=await fetch(`${h}?limit=400${c===void 0?``:`&start=${c}`}`,{headers:t,...n,signal:r.signal});if(!u.ok||!u.body){let t=await g(u,e.token,e.authenticationRequired);if(d.has(u.status)){l?.(`gone`),s?.(t);return}throw t}let f=!1;for await(let e of m(u.body,w)){if(_)return;if(e.type===`snapshot`)a(e),f=!0,l?.(`live`);else{if(!f)throw Error(`Presentation stream did not begin with a snapshot`);o(e)}}}catch(e){if(_)return;x||s?.(e instanceof Error?e:Error(String(e)))}finally{clearTimeout(C)}if(_)return;b=Date.now()-T>=c?1:b+1,l?.(`retrying`),await new Promise(e=>{let t=setTimeout(e,p(b));y=()=>{clearTimeout(t),e()}}),y=void 0}})(),()=>{_=!0,v?.abort(),y?.()}},subscribe({sessionId:r,since:i,onEntry:a,onError:o,onLink:s,silenceMs:l}){let f=`${e.url}/api/sessions/${encodeURIComponent(r)}/events`,h=l??u,_=i,v=0,y=!1,b,x;return(async()=>{for(;!y;){s?.(`connecting`);let r=new AbortController;b=r;let i=!1,l=()=>setTimeout(()=>{i=!0,r.abort()},h),u=l(),S=Date.now();try{let i=await fetch(`${f}?since=${_}`,{headers:t,...n,signal:r.signal});if(!i.ok||!i.body){let t=await g(i,e.token,e.authenticationRequired);if(d.has(i.status)){s?.(`gone`),o?.(t);return}throw t}s?.(`live`);for await(let e of m(i.body))clearTimeout(u),u=l(),e.seq>_&&(_=e.seq),a(e)}catch(e){if(y)return;i||o?.(e instanceof Error?e:Error(String(e)))}finally{clearTimeout(u)}if(y)return;v=Date.now()-S>=c?1:v+1,s?.(`retrying`),await new Promise(e=>{let t=setTimeout(e,p(v));x=()=>{clearTimeout(t),e()}}),x=void 0}})(),()=>{y=!0,b?.abort(),x?.()}}}}function p(e){let t=Math.min(l,c*2**(e-1));return Math.round(t*(.5+Math.random()/2))}async function*m(e,t){let n=new TextDecoder,r=``;for await(let i of e){t?.(),r+=n.decode(i,{stream:!0});let e=r.indexOf(`
2
+
3
+ `);for(;e!==-1;){let t=r.slice(0,e);r=r.slice(e+2);let n=t.split(`
4
+ `).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(``);n&&(yield JSON.parse(n)),e=r.indexOf(`
5
+
6
+ `)}}}async function h(e,t,n){if(!e.ok)throw await g(e,t,n)}async function g(e,t,n){t||n?.(e);let r=await e.clone().json().then(e=>e?.code,()=>void 0),i=Error(await _(e));return typeof r==`string`?Object.assign(i,{code:r}):i}async function _(e){let t=await e.text().catch(()=>``);if(e.status===524)return`524 Proxy timed out. Accepted commands may still be running. Check their status before retrying.`;let n=`${e.status} ${v(e.statusText)}`.trim(),r=e.headers.get(`content-type`)?.split(`;`,1)[0]?.trim().toLowerCase();if(r===`text/html`||r===`application/xhtml+xml`)return n;let i=``;try{let e=JSON.parse(t);e&&typeof e==`object`&&`error`in e&&typeof e.error==`string`&&(i=v(e.error))}catch{(!r||r===`text/plain`)&&(i=v(t))}return i?`${n}: ${i}`:n}function v(e){if(/[<>]/.test(e))return``;let t=e.replace(/[\u0000-\u001f\u007f]/g,` `).replace(/\s+/g,` `).trim();return t.length>240?`${t.slice(0,239)}…`:t}async function y(e,t){let n=await fetch(e,{credentials:`same-origin`,...t});return x(n),n}var b=!1;function x(e){let t=e.headers.get(`x-flow-login`);return e.status!==401||!t?!1:(C(t),!0)}function S(e){e===4001&&C(`/oauth/login`)}function C(e){if(b)return;b=!0;let t=globalThis,n=`${t.location.pathname}${t.location.search}${t.location.hash}`,r=e.includes(`?`)?`&`:`?`;t.location.assign(`${e}${r}return_to=${encodeURIComponent(n)}`)}var w=f({url:``,authenticationRequired:x}),T=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),E=t(((e,t)=>{t.exports=T()})),D=E(),O=`'Inter Variable', sans-serif`,ee=`'MesloLGS NF', 'JetBrainsMono Nerd Font', 'FiraCode Nerd Font', 'Hack Nerd Font', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`;function k(){return{chrome:O,monospace:ee}}function A(e){return M(e).map(e=>N(e.trim())).filter(e=>e.length>0)}function j(e){return M(e).map(e=>e.trim()).filter(e=>e.length>0).map(e=>P(e)?`"${N(e)}"`:e)}function M(e){let t=[],n=``,r;for(let i of e){if(r){i===r&&(r=void 0),n+=i;continue}if(i===`'`||i===`"`){r=i,n+=i;continue}if(i===`,`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function N(e){return/^(['"])(.*)\1$/.exec(e)?.[2]??e}function P(e){return/^['"]/.test(e)?!0:!F.has(e.toLowerCase())&&!/^[A-Za-z_-][\w-]*$/.test(e)}var F=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`math`,`emoji`,`fangsong`,`inherit`,`initial`,`revert`,`revert-layer`,`unset`]),te=k();function I(e){let t={chrome:e?.chrome?.trim()||te.chrome,monospace:e?.monospace?.trim()||te.monospace},n=document.documentElement;return n.style.setProperty(`--font-sans`,t.chrome),n.style.setProperty(`--font-mono`,t.monospace),t}async function ne(e){try{await Promise.allSettled(j(e).map(e=>document.fonts.load(`13px ${e}`))),await document.fonts.ready}catch{}}var re=w,L=(0,o.createContext)(void 0);function R(){let e=(0,o.useContext)(L);if(!e)throw Error(`useHost outside HostProvider`);return e}function ie({children:e}){let[t,n]=(0,o.useState)({state:`loading`});(0,o.useEffect)(()=>{let e=new AbortController;return(async()=>{try{let t=await y(`/api/config`,{signal:e.signal});if(t.status===401||t.status===403){n({state:`unauthorized`});return}let r=await t.json();I(r.fonts),n({state:`ready`,config:r})}catch{e.signal.aborted||n({state:`loading`})}})(),()=>e.abort()},[]);let r=(0,o.useCallback)(async()=>{let e=await y(`/api/config`);if(!e.ok)return;let t=await e.json();I(t.fonts),n(e=>e.state===`ready`?{state:`ready`,config:t}:e)},[]),i=(0,o.useCallback)(async e=>{let t=await y(`/api/config`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}),r=await t.json();if(!t.ok)throw Error(r.error??`Could not save the Settings (${t.status})`);return I(r.fonts),n(e=>e.state===`ready`?{state:`ready`,config:{...e.config,fonts:r.fonts,retention:r.retention,mcp:r.mcp,filesystemIsolation:r.filesystemIsolation,filesystemIsolationStatus:r.filesystemIsolationStatus,sandboxSharing:r.sandboxSharing,...r.projects===void 0?{projects:void 0}:{projects:r.projects},...r.permissions===void 0?{permissions:void 0}:{permissions:r.permissions},...r.providers===void 0?{providers:void 0}:{providers:r.providers}}}:e),r},[]);return t.state===`unauthorized`?(0,D.jsx)(ae,{}):t.state===`loading`?(0,D.jsx)(z,{}):(0,D.jsx)(L.Provider,{value:{connection:re,config:t.config,saveSettings:i,refresh:r},children:e})}function ae(){return(0,D.jsxs)(`main`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold`,children:`This browser is not authorised`}),(0,D.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:`The Session Host prints a handoff URL when it starts. Open it once in this browser and it sets the cookie every request after that carries.`}),(0,D.jsx)(`code`,{className:`rounded-md border bg-muted px-2 py-1 font-mono text-sm text-foreground`,children:`/auth?token=…`}),(0,D.jsx)(`p`,{className:`max-w-md text-xs text-muted-foreground`,children:`Use the URL as printed. Under the dev server, use the one the dev handoff printed instead — 127.0.0.1 and localhost are different cookie hosts.`})]})}function z(){return(0,D.jsx)(`main`,{className:`flex h-full items-center justify-center`,children:(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reaching the Session Host…`})})}function oe(){return typeof window<`u`}function B(e){return se(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((se(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function se(e){return oe()?e instanceof Node||e instanceof V(e).Node:!1}function ce(e){return oe()?e instanceof Element||e instanceof V(e).Element:!1}function U(e){return oe()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function le(e){return!oe()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function ue(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=xe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function de(e){return/^(table|td|th)$/.test(B(e))}function fe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var pe=/transform|translate|scale|rotate|perspective|filter/,me=/paint|layout|strict|content/,he=e=>!!e&&e!==`none`,ge;function _e(e){let t=ce(e)?xe(e):e;return he(t.transform)||he(t.translate)||he(t.scale)||he(t.rotate)||he(t.perspective)||!ye()&&(he(t.backdropFilter)||he(t.filter))||pe.test(t.willChange||``)||me.test(t.contain||``)}function ve(e){let t=Ce(e);for(;U(t)&&!be(t);){if(_e(t))return t;if(fe(t))return null;t=Ce(t)}return null}function ye(){return ge??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ge}function be(e){return/^(html|body|#document)$/.test(B(e))}function xe(e){return V(e).getComputedStyle(e)}function Se(e){return ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ce(e){if(B(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||le(e)&&e.host||H(e);return le(t)?t.host:t}function we(e){let t=Ce(e);return be(t)?(e.ownerDocument||e).body:U(t)&&ue(t)?t:we(t)}function Te(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=we(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=Ee(a);return t.concat(a,a.visualViewport||[],ue(r)?r:[],e&&n?Te(e):[])}return t.concat(r,Te(r,[],n))}function Ee(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var De={...o},Oe={};function W(e,t){let n=o.useRef(Oe);return n.current===Oe&&(n.current=e(t)),n}var ke=De.useInsertionEffect,Ae=ke&&ke!==De.useLayoutEffect?ke:e=>e();function G(e){let t=W(je).current;return t.next=e,Ae(t.effect),t.trampoline}function je(){let e={next:void 0,callback:Me,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Me(){}var K=typeof document<`u`?o.useLayoutEffect:()=>{};function Ne(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Pe={};function Fe(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Le(t);let a=Le(e);return t&&(a=Re(a,t)),n&&(a=Re(a,n)),r&&(a=Re(a,r)),i&&(a=Re(a,i)),a}function Ie(e){if(e.length===0)return Pe;if(e.length===1)return Le(e[0]);let t=Le(e[0]);for(let n=1;n<e.length;n+=1)t=Re(t,e[n]);return t}function Le(e){return He(e)?{...Ue(e,Pe)}:ze(e)}function Re(e,t){return He(t)?Ue(t,e):Be(e,t)}function ze(e){let t={...e};for(let e in t){let n=t[e];Ve(e,n)&&(t[e]=Ge(n))}return t}function Be(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Ne(e.style,r);break;case`className`:e[n]=qe(e.className,r);break;default:e[n]=Ve(n,r)?We(e[n],r):r}}return e}function Ve(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function He(e){return typeof e==`function`}function Ue(e,t){return He(e)?e(t):e??Pe}function We(e,t){return t?e?(...n)=>{let r=n[0];if(Je(r)){let i=r;Ke(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ge(t):e}function Ge(e){return e&&((...t)=>{let n=t[0];return Je(n)&&Ke(n),e(...t)})}function Ke(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function qe(e,t){return t?e?t+` `+e:t:e}function Je(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Ye(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Xe=Ye(`https://base-ui.com/production-error`,`Base UI`),Ze=o.createContext(void 0);function Qe(e=!1){let t=o.useContext(Ze);if(t===void 0&&!e)throw Error(Xe(16));return t}function $e(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,s=r&&t!==!1,c=r&&t===!1;return{props:o.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||s)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||c)&&(e.disabled=n),e},[r,n,t,s,c,a,i])}}function q(e){return e?.ownerDocument||document}function et(e,t,{detail:n=0}={}){e.dispatchEvent(new(V(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function tt(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,s=o.useRef(null),c=Qe(!0),l=a??c!==void 0,{props:u}=$e({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:i}),d=o.useCallback(()=>{let e=s.current;nt(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return K(d,[d]),{getButtonProps:o.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...c}=e;return Fe({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Ke(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=nt(r),s=!i&&rt(r),c=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&l&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),et(r,e));return}if(!c||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),et(r,e)))},onKeyUp(e){if(!t){if(Ke(e),a?.(e),e.target===e.currentTarget&&i&&l&&nt(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),et(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},u,c)},[t,u,l,i]),buttonRef:G(e=>{s.current=e,d()})}}function nt(e){return U(e)&&e.tagName===`BUTTON`}function rt(e){return U(e)&&e.tagName===`A`&&!!e.href}function it(e,t,n,r){let i=W(ot).current;return st(i,e,t,n,r)&&lt(i,[e,t,n,r]),i.callback}function at(e){let t=W(ot).current;return ct(t,e)&&lt(t,e),t.callback}function ot(){return{callback:null,cleanup:null,refs:[]}}function st(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function ct(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function lt(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var ut=19;function dt(e){return ut>=e}function ft(e){if(!o.isValidElement(e))return null;let t=e,n=t.props;return(dt(19)?n?.ref:t.ref)??null}function J(){}var pt=Object.freeze([]),mt=Object.freeze({});function ht(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function gt(e,t){return typeof e==`function`?e(t):e}function _t(e,t){return typeof e==`function`?e(t):e}function vt(e,t,n={}){let r=t.render,i=yt(t,n);return n.enabled===!1?null:St(e,r,i,n.state??mt)}function yt(e,t={}){let{className:n,style:r,render:i}=e,{state:a=mt,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?gt(n,a):void 0,d=l?_t(r,a):void 0,f=l?ht(a,c):mt,p=l&&s?bt(s):void 0,m=l?Ne(f,p)??{}:mt;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?at([m.ref,ft(i),...o]):it(m.ref,ft(i),o):it(null,null)),l?(u!==void 0&&(m.className=qe(m.className,u)),d!==void 0&&(m.style=Ne(m.style,d)),m):mt}function bt(e){return Array.isArray(e)?Ie(e):Fe(void 0,e)}var xt=Symbol.for(`react.lazy`);function St(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Fe(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===xt&&(i=o.Children.toArray(t)[0]),o.cloneElement(i,e)}if(e&&typeof e==`string`)return Ct(e,n);throw Error(Xe(8))}function Ct(e,t){return e===`button`?(0,o.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,o.createElement)(`img`,{alt:``,...t,key:t.key}):o.createElement(e,t)}var wt=o.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=tt({disabled:i,focusableWhenDisabled:a,native:o});return vt(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function Tt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Tt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Et(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Tt(e))&&(r&&(r+=` `),r+=t);return r}var Dt=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ot=Et,kt=(e,t)=>n=>{if(t?.variants==null)return Ot(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Dt(t)||Dt(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ot(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},At=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},jt=(e,t)=>({classGroupId:e,validator:t}),Mt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Nt=`-`,Pt=[],Ft=`arbitrary..`,It=e=>{let t=zt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Rt(e);let n=e.split(Nt);return Lt(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?At(i,t):t:i||Pt}return n[e]||Pt}}},Lt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Lt(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Nt):e.slice(t).join(Nt),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Rt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ft+r:void 0})(),zt=e=>{let{theme:t,classGroups:n}=e;return Bt(n,t)},Bt=(e,t)=>{let n=Mt();for(let r in e){let i=e[r];Vt(i,n,r,t)}return n},Vt=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ht(i,t,n,r)}},Ht=(e,t,n,r)=>{if(typeof e==`string`){Ut(e,t,n);return}if(typeof e==`function`){Wt(e,t,n,r);return}Gt(e,t,n,r)},Ut=(e,t,n)=>{let r=e===``?t:Kt(t,e);r.classGroupId=n},Wt=(e,t,n,r)=>{if(qt(e)){Vt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(jt(n,e))},Gt=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Vt(o,Kt(t,a),n,r)}},Kt=(e,t)=>{let n=e,r=t.split(Nt),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Mt(),n.nextPart.set(t,i)),n=i}return n},qt=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Jt=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Yt=`!`,Xt=`:`,Zt=[],Qt=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),$t=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Xt){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Yt)?(c=s.slice(0,-1),l=!0):s.startsWith(Yt)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Qt(t,l,c,u)};if(t){let e=t+Xt,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Qt(Zt,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},en=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},tn=e=>({cache:Jt(e.cacheSize),parseClassName:$t(e),sortModifiers:en(e),postfixLookupClassGroupIds:nn(e),...It(e)}),nn=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},rn=/\s+/,an=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(rn),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Yt:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},on=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=sn(n))&&(i&&(i+=` `),i+=r);return i},sn=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=sn(e[r]))&&(n&&(n+=` `),n+=t);return n},cn=(e,...t)=>{let n,r,i,a,o=o=>(n=tn(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=an(e,n);return i(e,a),a};return a=o,(...e)=>a(on(...e))},ln=[],Y=e=>{let t=t=>t[e]||ln;return t.isThemeGetter=!0,t},un=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,hn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_n=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=e=>fn.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),yn=e=>!!e&&Number.isInteger(Number(e)),bn=e=>e.endsWith(`%`)&&X(e.slice(0,-1)),xn=e=>pn.test(e),Sn=()=>!0,Cn=e=>mn.test(e)&&!hn.test(e),wn=()=>!1,Tn=e=>gn.test(e),En=e=>_n.test(e),Dn=e=>!Z(e)&&!Q(e),On=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),kn=e=>Wn(e,Jn,wn),Z=e=>un.test(e),An=e=>Wn(e,Yn,Cn),jn=e=>Wn(e,Xn,X),Mn=e=>Wn(e,Qn,Sn),Nn=e=>Wn(e,Zn,wn),Pn=e=>Wn(e,Kn,wn),Fn=e=>Wn(e,qn,En),In=e=>Wn(e,$n,Tn),Q=e=>dn.test(e),Ln=e=>Gn(e,Yn),Rn=e=>Gn(e,Zn),zn=e=>Gn(e,Kn),Bn=e=>Gn(e,Jn),Vn=e=>Gn(e,qn),Hn=e=>Gn(e,$n,!0),Un=e=>Gn(e,Qn,!0),Wn=(e,t,n)=>{let r=un.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Gn=(e,t,n=!1)=>{let r=dn.exec(e);return r?r[1]?t(r[1]):n:!1},Kn=e=>e===`position`||e===`percentage`,qn=e=>e===`image`||e===`url`,Jn=e=>e===`length`||e===`size`||e===`bg-size`,Yn=e=>e===`length`,Xn=e=>e===`number`,Zn=e=>e===`family-name`,Qn=e=>e===`number`||e===`weight`,$n=e=>e===`shadow`,er=cn(()=>{let e=Y(`color`),t=Y(`font`),n=Y(`text`),r=Y(`font-weight`),i=Y(`tracking`),a=Y(`leading`),o=Y(`breakpoint`),s=Y(`container`),c=Y(`spacing`),l=Y(`radius`),u=Y(`shadow`),d=Y(`inset-shadow`),f=Y(`text-shadow`),p=Y(`drop-shadow`),m=Y(`blur`),h=Y(`perspective`),g=Y(`aspect`),_=Y(`ease`),v=Y(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Q,Z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Q,Z,c],T=()=>[vn,`full`,`auto`,...w()],E=()=>[yn,`none`,`subgrid`,Q,Z],D=()=>[`auto`,{span:[`full`,yn,Q,Z]},yn,Q,Z],O=()=>[yn,`auto`,Q,Z],ee=()=>[`auto`,`min`,`max`,`fr`,Q,Z],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[vn,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[vn,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],P=()=>[vn,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,Q,Z],te=()=>[...b(),zn,Pn,{position:[Q,Z]}],I=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ne=()=>[`auto`,`cover`,`contain`,Bn,kn,{size:[Q,Z]}],re=()=>[bn,Ln,An],L=()=>[``,`none`,`full`,l,Q,Z],R=()=>[``,X,Ln,An],ie=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[X,bn,zn,Pn],oe=()=>[``,`none`,m,Q,Z],B=()=>[`none`,X,Q,Z],V=()=>[`none`,X,Q,Z],H=()=>[X,Q,Z],se=()=>[vn,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[xn],breakpoint:[xn],color:[Sn],container:[xn],"drop-shadow":[xn],ease:[`in`,`out`,`in-out`],font:[Dn],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[xn],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[xn],shadow:[xn],spacing:[`px`,X],text:[xn],"text-shadow":[xn],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,vn,Z,Q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Q,Z]}],"container-named":[On],columns:[{columns:[X,Z,Q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[yn,`auto`,Q,Z]}],basis:[{basis:[vn,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[X,vn,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,X,Q,Z]}],shrink:[{shrink:[``,X,Q,Z]}],order:[{order:[yn,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...N()]}],"min-inline-size":[{"min-inline":[`auto`,...N()]}],"max-inline-size":[{"max-inline":[`none`,...N()]}],"block-size":[{block:[`auto`,...P()]}],"min-block-size":[{"min-block":[`auto`,...P()]}],"max-block-size":[{"max-block":[`none`,...P()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,...M()]}],"font-size":[{text:[`base`,n,Ln,An]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Un,Mn]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,bn,Z]}],"font-family":[{font:[Rn,Nn,t]}],"font-features":[{"font-features":[Z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Q,Z]}],"line-clamp":[{"line-clamp":[X,`none`,Q,jn]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ie(),`wavy`]}],"text-decoration-thickness":[{decoration:[X,`from-font`,`auto`,Q,An]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[X,`auto`,Q,Z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[yn,Q,Z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Q,Z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},yn,Q,Z],radial:[``,Q,Z],conic:[yn,Q,Z]},Vn,Fn]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ie(),`hidden`,`none`]}],"divide-style":[{divide:[...ie(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ie(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[X,Q,Z]}],"outline-w":[{outline:[``,X,Ln,An]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,Hn,In]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,Hn,In]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[X,An]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,Hn,In]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[X,Q,Z]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:oe()}],brightness:[{brightness:[X,Q,Z]}],contrast:[{contrast:[X,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Hn,In]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,X,Q,Z]}],"hue-rotate":[{"hue-rotate":[X,Q,Z]}],invert:[{invert:[``,X,Q,Z]}],saturate:[{saturate:[X,Q,Z]}],sepia:[{sepia:[``,X,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[X,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[X,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,X,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,X,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[X,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[X,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,X,Q,Z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[X,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[X,Q,Z]}],animate:[{animate:[`none`,v,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:B()}],"rotate-x":[{"rotate-x":B()}],"rotate-y":[{"rotate-y":B()}],"rotate-z":[{"rotate-z":B()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":[`scale-3d`],skew:[{skew:H()}],"skew-x":[{"skew-x":H()}],"skew-y":[{"skew-y":H()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":[`translate-none`],zoom:[{zoom:[yn,Q,Z]}],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Q,Z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Q,Z]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[X,Ln,An,jn]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function tr(...e){return er(Et(e))}var nr=`[&_svg]:transition-[filter] [&_svg]:duration-150 hover:[&_svg]:drop-shadow-[0_0_4px_color-mix(in_srgb,currentColor_70%,transparent)] motion-reduce:[&_svg]:transition-none`,rr=kt(`relative group/button inline-flex shrink-0 items-center justify-center rounded-2xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`,xs:`h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-9 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:tr(`size-8`,nr),"icon-xs":tr(`size-6 [&_svg:not([class*='size-'])]:size-3`,nr),"icon-sm":tr(`size-7`,nr),"icon-lg":tr(`size-9`,nr)}},defaultVariants:{variant:`default`,size:`default`}});function ir({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,D.jsx)(wt,{"data-slot":`button`,className:tr(rr({variant:t,size:n,className:e})),...r})}function ar(e){o.useEffect(e,pt)}var or=o.createContext(void 0);function sr(){let e=o.useContext(or);if(!e)throw Error(Xe(73));return e}var cr=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),lr=t(((e,t)=>{t.exports=cr()})),ur=t((e=>{var t=r(),n=lr();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),dr=t(((e,t)=>{t.exports=ur()})),fr=lr(),pr=e(dr(),1),mr=[],hr=void 0;function gr(){return hr}function _r(e){mr.push(e)}function vr(e){let t=(t,n)=>{let r=W(br).current,i;try{hr=r;for(let e of mr)e.before(r);i=e(t,n);for(let e of mr)e.after(r);r.didInitialize=!0}finally{hr=void 0}return i};return t.displayName=e.displayName||e.name,t}function yr(e){return o.forwardRef(vr(e))}function br(){return{didInitialize:!1}}var xr=dt(19)?wr:Tr;function Sr(e,t,n,r,i){return xr(e,t,n,r,i)}function Cr(e,t,n,r,i){let a=o.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,fr.useSyncExternalStore)(e.subscribe,a,a)}_r({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,fr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function wr(e,t,n,r,i){let a=gr();if(!a)return Cr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Tr(e,t,n,r,i){return(0,pr.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Er=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Sr(this,e,t,n,r)}},Dr=class extends Er{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){o.useDebugValue(e);let n=this;K(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;K(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;K(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){o.useDebugValue(e);let n=this,r=t!==void 0;K(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return o.useDebugValue(e),Sr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){o.useDebugValue(e);let n=G(t??J);this.context[e]=n}useStateSetter(e){let t=o.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Or(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function kr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Ar=null;globalThis.requestAnimationFrame;var jr=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Mr=class e{static create(){return new e}static request(e){return jr.request(e)}static cancel(e){return jr.cancel(e)}currentId=Ar;request(e){this.cancel(),this.currentId=jr.request(()=>{this.currentId=Ar,e()})}cancel=()=>{this.currentId!==Ar&&(jr.cancel(this.currentId),this.currentId=Ar)};disposeEffect=()=>this.cancel};function Nr(){let e=W(Mr.create).current;return ar(e.disposeEffect),e}var Pr=0,Fr=class e{static create(){return new e}currentId=Pr;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Pr,t()},e)}isStarted(){return this.currentId!==Pr}clear=()=>{this.currentId!==Pr&&(clearTimeout(this.currentId),this.currentId=Pr)};disposeEffect=()=>this.clear};function Ir(){let e=W(Fr.create).current;return ar(e.disposeEffect),e}var Lr=0;function Rr(e){return Lr+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Lr}`}function zr(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function Br(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Vr,platform:Hr,maxTouchPoints:Ur}=Br(),Wr=Vr.toLowerCase(),Gr=Hr.toLowerCase(),Kr=/^i(os$|p)/.test(Gr)||Gr===`macintel`&&Ur>1,qr=`android`,Jr=Gr===qr||Wr.includes(qr),Yr=!Kr&&Gr.startsWith(`mac`);Gr.startsWith(`win`),!Jr&&/^(linux|chrome os)/.test(Gr);var Xr=Yr||Kr,Zr=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),Qr=!Zr&&Wr.includes(`firefox`);!Zr&&Wr.includes(`chrom`);var $r=Xr,ei=/jsdom|happydom/.test(Wr),ti=`data-base-ui-focusable`,ni=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ri=`ArrowLeft`,ii=`ArrowRight`,ai=`ArrowUp`,oi=`ArrowDown`;function si(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ci(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&le(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function li(e){return`composedPath`in e?e.composedPath()[0]:e.target}function ui(e,t){if(!ce(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(ci(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function di(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function fi(e){return e.matches(`html,body`)}function pi(e){return U(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function mi(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ni}`)!=null}function hi(e){return e?e.getAttribute(`role`)===`combobox`&&pi(e):!1}function gi(e){if(!e||ei)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function _i(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function vi(e){e.preventDefault(),e.stopPropagation()}function yi(e){return`nativeEvent`in e}function bi(e){return e.pointerType===``&&e.isTrusted?!0:Jr&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function xi(e){return ei?!1:!Jr&&e.width===0&&e.height===0||Jr&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Si(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Ci(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var wi=Math.min,Ti=Math.max,Ei=Math.round,Di=Math.floor,Oi=e=>({x:e,y:e}),ki={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ai(e,t,n){return Ti(e,wi(t,n))}function ji(e,t){return typeof e==`function`?e(t):e}function Mi(e){return e.split(`-`)[0]}function Ni(e){return e.split(`-`)[1]}function Pi(e){return e===`x`?`y`:`x`}function Fi(e){return e===`y`?`height`:`width`}function Ii(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Li(e){return Pi(Ii(e))}function Ri(e,t,n){n===void 0&&(n=!1);let r=Ni(e),i=Li(e),a=Fi(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qi(o)),[o,qi(o)]}function zi(e){let t=qi(e);return[Bi(e),t,Bi(t)]}function Bi(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Vi=[`left`,`right`],Hi=[`right`,`left`],Ui=[`top`,`bottom`],Wi=[`bottom`,`top`];function Gi(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Hi:Vi:t?Vi:Hi;case`left`:case`right`:return t?Ui:Wi;default:return[]}}function Ki(e,t,n,r){let i=Ni(e),a=Gi(Mi(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Bi)))),a}function qi(e){let t=Mi(e);return ki[t]+e.slice(t.length)}function Ji(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Yi(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ji(e)}function Xi(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Zi(e,t,n){return Math.floor(e/t)!==n}function Qi(e,t){return t<0||t>=e.length}function $i(e,t){return $(e.current,{disabledIndices:t})}function ea(e,t){return $(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&na(e,a,r));return a}function ta(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!na(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Di(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!na(e,r,s))return r}};d&&vi(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=$(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=$(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Qi(e,f)&&(f=u)}if(n===`both`){let n=Di(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&vi(t),u%o===o-1?r&&(f=$(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=$(e,{startingIndex:u,disabledIndices:s}),r&&Zi(f,o,n)&&(f=$(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Zi(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&vi(t),u%o===0?r&&(f=$(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=$(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Zi(f,o,n)&&(f=$(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Zi(f,o,n)&&(f=u));let c=Di(l/o)===n;Qi(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:$(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function na(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!ia(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function ra(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ia(e,t=e?xe(e):null){return!e||!e.isConnected||!t||ra(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var aa=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function oa(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return le(n)?n.host:null}function sa(e){for(let t of Array.from(e.children))if(B(t)===`summary`)return t;return null}function ca(e,t){let n=sa(t);return!!n&&(e===n||ci(n,e))}function la(e){let t=e?B(e):``;return e!=null&&e.matches(aa)&&(t!==`summary`||e.parentElement!=null&&B(e.parentElement)===`details`&&sa(e.parentElement)===e)&&(t!==`details`||sa(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ua(e){if(!la(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=oa(t)){let n=t!==e,r=B(t)===`slot`;if(t.hasAttribute(`inert`)||n&&B(t)===`details`&&!t.open&&!ca(e,t)||t.hasAttribute(`hidden`)||!r&&!da(t,n))return!1}return!0}function da(e,t){let n=xe(e);return t?n.display!==`none`:ia(e,n)}function fa(e){let t=e.tabIndex;if(t<0){let t=B(e);if(t===`details`||t===`audio`||t===`video`||U(e)&&e.isContentEditable)return 0}return t}function pa(e){if(B(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function ma(e,t){let n=pa(e);if(!n)return!0;let r=t.find(e=>{let t=pa(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=pa(e);return t?.name===n.name&&t.form===n.form})===n}function ha(e){if(U(e)&&B(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return U(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ga(e,t){ha(e).forEach(e=>{la(e)&&t.push(e),ga(e,t)})}function _a(e,t,n){ha(e).forEach(e=>{U(e)&&e.matches(t)&&n.push(e),_a(e,t,n)})}function va(e){return ua(e)&&fa(e)>=0}function ya(e){let t=[];return ga(e,t),t.filter(ua)}function ba(e){let t=ya(e);return t.filter(e=>fa(e)>=0&&ma(e,t))}function xa(e,t){let n=ba(e),r=n.length;if(r===0)return;let i=si(q(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Sa(e){return xa(q(e).body,1)||e}function Ca(e){return xa(q(e).body,-1)||e}function wa(e,t){if(!e)return null;let n=ba(q(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Ta(e){return wa(e,1)}function Ea(e){return wa(e,-1)}function Da(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!ci(n,r)}function Oa(e){ba(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ka(e){let t=[];_a(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Aa(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function ja(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var Ma={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},Na=class extends Dr{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Aa(e.toasts)},{},Ma)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=ja(this.state.toasts,t);r.toasts=e,r.toastMetadata=Aa(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=Ma.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||Rr(`toast`);if(e.id){let t=Ma.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(ja(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),Ma.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=Ma.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;if(!d&&f){this.clearTimer(e);return}d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),Ma.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=Ma.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=ja(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=zr(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=zr(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=zr(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Fr.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=li(e);ci(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=Ma.expandedOrOutOfFocus(this.state)?void 0:Fr.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:Aa(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=si(q(this.state.viewport));if(!this.state.viewport||!ci(this.state.viewport,t)||!gi(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=Ma.toasts(this.state),r=Ma.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},a=i(r+1,1)??i(r-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}},Pa=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=W(()=>new Na({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return ar(a.disposeEffect),o.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,D.jsxs)(or.Provider,{value:a,children:[(0,D.jsx)(Fa,{store:a,timeout:n,limit:r}),t]})};function Fa(e){let{store:t,timeout:n,limit:r}=e;return K(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var Ia={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},La={...Ia,position:`fixed`,top:0,left:0},Ra={...Ia,position:`absolute`},za=o.forwardRef(function(e,t){let[n,r]=o.useState();K(()=>{$r&&Zr&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,D.jsx)(`span`,{...e,ref:t,style:La,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Ba=o.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...s}=e,c=sr(),l=Ir(),u=o.useRef(!1),d=o.useRef(!1),f=o.useRef(!1),p=c.useState(`isEmpty`),m=c.useState(`toasts`),h=c.useState(`focused`),g=c.useState(`expanded`),_=c.useState(`prevFocusElement`),v=m[0]?.height,y=m.some(e=>e.transitionStatus===`ending`),b=m.filter(e=>e.priority===`high`);o.useEffect(()=>{let e=c.state.viewport;if(!e||p)return;let t=V(e),n=q(e);function r(t){t.key===`F6`&&li(t)!==e&&(t.preventDefault(),c.set(`prevFocusElement`,si(n)),e?.focus({preventScroll:!0}),c.pauseTimers(),c.set(`focused`,!0))}function i(e){li(e)===t&&(c.set(`isWindowFocused`,!1),c.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=li(n),i=si(q(e));(r===t||!ci(e,r)||!gi(i))&&c.resumeTimers(),l.start(0,()=>c.set(`isWindowFocused`,!0))}return Or(kr(t,`keydown`,r),kr(t,`blur`,i,!0),kr(t,`focus`,a,!0),kr(n,`pointerdown`,c.handleDocumentPointerDown,!0))},[c,l,p]);function x(e){u.current=!0;let t=e.relatedTarget===c.state.viewport?m.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():c.restoreFocusToPrevElement()}function S(e){e.key===`Tab`&&e.shiftKey&&li(e.nativeEvent)===c.state.viewport&&(e.preventDefault(),c.restoreFocusToPrevElement())}function C(){c.state.toasts.some(e=>e.transitionStatus===`ending`)||f.current||!d.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set(`hovering`,!1),d.current=!1)}o.useEffect(C,[y,c]);function w(){c.pauseTimers(),c.set(`hovering`,!0),d.current=!1}function T(){c.state.isWindowFocused&&c.resumeTimers()}function E(){d.current=!0,C()}function O(e){e.pointerType===`touch`&&(f.current=!0)}function ee(e){e.pointerType===`touch`&&(f.current=!1,C())}function k(){if(u.current){u.current=!1;return}h||gi(si(q(c.state.viewport)))&&(c.set(`focused`,!0),c.pauseTimers())}function A(e){!h||ci(c.state.viewport,e.relatedTarget)||(c.set(`focused`,!1),T())}let j={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:w,onMouseMove:w,onMouseLeave:E,onFocus:k,onBlur:A,onKeyDown:S,onClick:k,onPointerDown:O,onPointerUp:ee,onPointerCancel:ee,style:{"--toast-frontmost-height":v?`${v}px`:void 0}},M={expanded:g},N=!p&&_&&(0,D.jsx)(za,{onFocus:x}),P=vt(`div`,e,{ref:[t,c.setViewport],state:M,props:[j,s,{children:(0,D.jsxs)(o.Fragment,{children:[N,a,N]})}]});return(0,D.jsxs)(o.Fragment,{children:[N,P,!h&&b.length>0&&(0,D.jsx)(`div`,{style:La,children:b.map(e=>(0,D.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,D.jsx)(`div`,{children:e.title}),(0,D.jsx)(`div`,{children:e.description})]},e.id))})]})});function Va(e){return dt(19)?e:e?`true`:void 0}var Ha=o.createContext(void 0);function Ua(){let e=o.useContext(Ha);if(!e)throw Error(Xe(66));return e}var Wa=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Ga={"data-starting-style":``},Ka={"data-ending-style":``},qa={transitionStatus(e){return e===`starting`?Ga:e===`ending`?Ka:null}};function Ja(e){return e==null?e:`current`in e?e.current:e}function Ya(e,t=!1){let n=Nr();return G((r,i=null)=>{n.cancel();let a=Ja(e);if(a==null)return;let o=a,c=()=>{s.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function l(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||c()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(l);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),l())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(l)})}function Xa(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=G(i),s=Ya(r,n);o.useEffect(()=>{if(!t)return;let e=new AbortController;return s(a,e.signal),()=>{e.abort()}},[t,n,a,s])}var Za={style:{transition:`none`}},Qa=`data-base-ui-click-trigger`,$a=`data-base-ui-swipe-ignore`,eo=`data-swipe-ignore`,to=`[${$a}]`,no=`[${eo}]`,ro={fallbackAxisSide:`none`},io={fallbackAxisSide:`end`},ao={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function oo(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function so(e){let t=V(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var co={...qa,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},lo=40,uo=10,fo=.5,po=1,mo=`${to},${no}`,ho=o.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:c,...l}=e,u=n.positionerProps?.anchor!==void 0,d=[];u||(d=Array.isArray(a)?a:[a]);let f=d.length>0,p=sr(),[m,h]=o.useState(void 0),[g,_]=o.useState(!1),[v,y]=o.useState(!1),[b,x]=o.useState({x:0,y:0}),[S,C]=o.useState({x:0,y:0,scale:1}),[w,T]=o.useState(),[E,O]=o.useState(),[ee,k]=o.useState(null),A=o.useRef(null),j=o.useRef(void 0),M=o.useRef({x:0,y:0}),N=o.useRef({x:0,y:0,scale:1}),P=o.useRef(void 0),F=o.useRef(0),te=o.useRef(!1),I=o.useRef({x:0,y:0}),ne=o.useRef(!1),re=o.useRef({x:0,y:0}),L=o.useRef(null),R=o.useRef(null),ie=p.useState(`toastIndex`,n.id),ae=p.useState(`toastVisibleIndex`,n.id),z=p.useState(`toastOffsetY`,n.id),oe=p.useState(`focused`),B=p.useState(`expanded`);Xa({open:n.transitionStatus!==`ending`,ref:A,onComplete(){n.transitionStatus===`ending`&&p.removeToast(n.id)}});let V=G((e=!1)=>{let t=A.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){p.updateToastInternal(n.id,{ref:A,height:i,transitionStatus:void 0})}e?s.flushSync(a):a()});K(()=>{let e=j.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(h(void 0),C({x:0,y:0,scale:1}),H({x:0,y:0})),j.current=n.id,V())},[V,n.id,n.transitionStatus]);function H(e){re.current=e,x(e)}K(()=>()=>{R.current?.abort()},[]);function se(e,t){let n=e=>e>0?e**fo:-(Math.abs(e)**fo),r=e>0&&!d.includes(`right`)||e<0&&!d.includes(`left`),i=t>0&&!d.includes(`down`)||t<0&&!d.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let ce=G(e=>{if(e.pointerId!==L.current)return;L.current=null,R.current?.abort(),R.current=null,_(!1),y(!1),k(null);let t=N.current;if(e.type===`pointercancel`||te.current){H({x:t.x,y:t.y}),h(void 0);return}let r=re.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of d)if(oo(e,i,a)>lo){o=e;break}o?(h(o),p.closeToast(n.id)):(H({x:t.x,y:t.y}),h(void 0))});function U(e){if(e.button!==0||(e.pointerType===`touch`&&p.pauseTimers(),li(e.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${mo}`)))return;te.current=!1,P.current=void 0,F.current=0,L.current=e.pointerId,M.current={x:e.clientX,y:e.clientY},I.current=M.current;let t=e.currentTarget,n=so(t);N.current=n,C(n),H({x:n.x,y:n.y}),p.set(`hovering`,!0),_(!0),y(!1),k(null),ne.current=!0,R.current?.abort();let r=new AbortController;R.current=r;let i=q(t);i.addEventListener(`pointerup`,ce,{signal:r.signal}),i.addEventListener(`pointercancel`,ce,{signal:r.signal}),t.setPointerCapture?.(e.pointerId)}function le(e){if(e.pointerId!==L.current)return;e.preventDefault(),ne.current&&=(M.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>I.current.y||i>0&&t<I.current.y)&&(I.current={x:I.current.x,y:t}),(r<0&&n>I.current.x||r>0&&n<I.current.x)&&(I.current={x:n,y:I.current.y});let a=n-M.current.x,o=t-M.current.y,s=t-I.current.y,c=n-I.current.x,l=ee;if(!v&&Math.sqrt(a*a+o*o)>=po){y(!0);let e=d.includes(`left`)||d.includes(`right`),t=d.includes(`up`)||d.includes(`down`);e&&t&&(l=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,k(l))}let u;if(!P.current)l===`vertical`?o>0?u=`down`:o<0&&(u=`up`):l===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&d.includes(u)&&(P.current=u,F.current=oo(u,a,o),h(u));else{let e=P.current,t=oo(e,c,s);t>lo?(te.current=!1,h(e)):!(d.includes(`left`)&&d.includes(`right`))&&!(d.includes(`up`)&&d.includes(`down`))&&F.current-t>=uo&&(te.current=!0)}let f=se(a,o),p=N.current.x,m=N.current.y,g=d.includes(`left`)||d.includes(`right`),_=d.includes(`up`)||d.includes(`down`);l!==`vertical`&&g&&(p+=f.x),l!==`horizontal`&&_&&(m+=f.y),H({x:p,y:m})}function ue(e){if(e.key===`Escape`){if(!A.current||!ci(A.current,si(q(A.current))))return;p.closeToast(n.id)}}o.useEffect(()=>{let e=A.current;if(!f||!e)return;function t(t){L.current===null||!ci(e,li(t))||t.preventDefault()}return kr(e,`touchmove`,t,{passive:!1})},[f]);function de(){let e=b.x-S.x,t=b.y-S.y;return{transition:g?`none`:void 0,transform:g?`translateX(${b.x}px) translateY(${b.y}px) scale(${S.scale})`:void 0,"--toast-swipe-movement-x":`${e}px`,"--toast-swipe-movement-y":`${t}px`}}let fe=n.priority===`high`,pe={role:fe?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":E,"aria-hidden":fe&&!oe?!0:void 0,onPointerDown:f?U:void 0,onPointerMove:f?le:void 0,onPointerUp:f?ce:void 0,onPointerCancel:f?ce:void 0,onKeyDown:ue,inert:Va(n.limited),style:{...de(),"--toast-index":n.transitionStatus===`ending`?ie:ae,"--toast-offset-y":`${z}px`,"--toast-height":n.height?`${n.height}px`:void 0}},me=o.useMemo(()=>({toast:n,setTitleId:T,setDescriptionId:O,recalculateHeight:V,visibleIndex:ae,expanded:B}),[n,T,O,V,ae,B]),he={transitionStatus:n.transitionStatus,expanded:B,limited:n.limited||!1,type:n.type,swiping:g,swipeDirection:m},ge=vt(`div`,e,{ref:[t,A],state:he,stateAttributesMapping:co,props:[pe,l]});return(0,D.jsx)(Ha.Provider,{value:me,children:ge})}),go=0;function _o(e,t=`mui`){let[n,r]=o.useState(e),i=e||n;return o.useEffect(()=>{n??(go+=1,r(`${t}-${go}`))},[n,t]),i}var vo=De.useId;function yo(e,t){if(vo!==void 0){let n=vo();return e??(t?`${t}-${n}`:n)}return _o(e,t)}function bo(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(bo)}function xo(e){return o.isValidElement(e)&&bo(e.props.children)}function So(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=Ua(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:yo(e),children:s,type:r.type,setId:o}}function Co(e,t,n){let r=xo(e);return K(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var wo=o.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=So(a,o,`description`);return Co(vt(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),To=o.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=So(a,o,`title`);return Co(vt(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Eo=o.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:s=!0,...c}=e,l=sr(),{toast:u,expanded:d}=Ua(),[f,p]=o.useState(!1),{getButtonProps:m,buttonRef:h}=tt({disabled:a,native:s}),g={type:u.type};return vt(`button`,e,{ref:[t,h],state:g,props:[{"aria-hidden":!d&&!f,onClick(){l.closeToast(u.id)},onFocus(){p(!0)},onBlur(){p(!1)}},c,m]})}),Do=`none`,Oo=`trigger-press`,ko=`trigger-hover`,Ao=`trigger-focus`,jo=`outside-press`,Mo=`item-press`,No=`close-press`,Po=`clear-press`,Fo=`input-change`,Io=`input-clear`,Lo=`input-press`,Ro=`focus-out`,zo=`escape-key`,Bo=`list-navigation`,Vo=`keyboard`,Ho=`pointer`,Uo=`cancel-open`,Wo=`sibling-open`,Go=`disabled`,Ko=`missing`,qo=`initial`,Jo=`imperative-action`,Yo=`window-resize`;function Xo(e,t,n,r){let i=!1,a=!1,o=r??mt;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Zo(e,t,n){let r=n??mt;return{reason:e,event:t??new Event(`base-ui`),...r}}function Qo(e){return`data-base-ui-${e}`}var $o=o.createContext(null),es=()=>o.useContext($o),ts=Qo(`portal`);function ns(e={}){let{ref:t,container:n,componentProps:r=mt,elementProps:i}=e,a=yo(),c=es()?.portalNode,[l,u]=o.useState(null),[d,f]=o.useState(null),p=G(e=>{e!==null&&f(e)}),m=o.useRef(null);K(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(se(n)?n:n.current))??c??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,c]);let h=vt(`div`,r,{ref:[t,p],props:[{id:a,[ts]:``},i]}),g=l&&h?s.createPortal(h,l):null;return{node:d,nodeId:o.isValidElement(h)?h.props.id:void 0,subtree:g}}var rs=o.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:c,...l}=e,{node:u,nodeId:d,subtree:f}=ns({container:c,ref:t,componentProps:e,elementProps:l}),p=o.useRef(null),m=o.useRef(null),h=o.useRef(null),g=o.useRef(null),[_,v]=o.useState(null),y=o.useRef(!1),b=_?.modal,x=_?.open,S=!!_&&!_.modal&&_.open&&!!u;o.useEffect(()=>{if(!u||b)return;function e(e){u&&e.relatedTarget&&Da(e)&&(e.type===`focusin`?y.current&&=(ka(u),!1):(Oa(u),y.current=!0))}return Or(kr(u,`focusin`,e,!0),kr(u,`focusout`,e,!0))},[u,b]),K(()=>{!u||x!==!0||!y.current||(ka(u),y.current=!1)},[x,u]);let C=o.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:u,setFocusManagerState:v}),[u]);return(0,D.jsxs)(o.Fragment,{children:[f,(0,D.jsxs)($o.Provider,{value:C,children:[S&&u&&(0,D.jsx)(za,{"data-type":`outside`,ref:p,onFocus:e=>{Da(e,u)?h.current?.focus():Ca(_?_.domReference:null)?.focus()}}),S&&u&&(0,D.jsx)(`span`,{"aria-owns":d,style:ao}),u&&s.createPortal(a,u),S&&u&&(0,D.jsx)(za,{"data-type":`outside`,ref:m,onFocus:e=>{Da(e,u)?g.current?.focus():(Sa(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,Xo(`focus-out`,e.nativeEvent)))}})]})]})}),is=o.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:c,...l}=e,{node:u,subtree:d}=ns({container:r,ref:t,componentProps:e,elementProps:l});return!d&&!u?null:(0,D.jsxs)(o.Fragment,{children:[d,u&&s.createPortal(n,u)]})}),as=o.forwardRef(function(e,t){return(0,D.jsx)(is,{ref:t,...e})});function os(){let e=sr(),t=e.useState(`toasts`);return o.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function ss(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||Rr(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var cs=ss(),ls={error(e,t){cs.add({title:e,...t===void 0?{}:{description:t},type:`error`,timeout:8e3})},info(e,t){cs.add({title:e,...t===void 0?{}:{description:t},type:`info`})}};function us(){let{toasts:e}=os();return(0,D.jsx)(D.Fragment,{children:e.map(e=>(0,D.jsxs)(ho,{toast:e,className:`relative mb-2 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-lg`,style:{borderColor:e.type===`error`?`var(--destructive)`:void 0},children:[(0,D.jsx)(To,{className:`text-sm font-medium`}),(0,D.jsx)(wo,{className:`mt-1 text-sm break-words text-muted-foreground`}),(0,D.jsx)(Eo,{className:`absolute top-2 right-2 px-1 text-sm text-muted-foreground hover:text-foreground`,"aria-label":`Dismiss`,children:`×`})]},e.id))})}function ds(){return(0,D.jsx)(Pa,{toastManager:cs,children:(0,D.jsx)(as,{children:(0,D.jsx)(Ba,{className:`fixed right-4 bottom-4 z-50 flex w-72 flex-col items-end`,children:(0,D.jsx)(us,{})})})})}function fs({title:e,description:t,children:n}){return(0,D.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,D.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,D.jsx)(`h2`,{className:`text-sm font-semibold`,children:e}),t===void 0?null:(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]}),n]})}function ps({label:e,children:t}){return(0,D.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 border-b py-1.5 last:border-b-0`,children:[(0,D.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e}),(0,D.jsx)(`span`,{className:`min-w-0 truncate text-right font-mono text-xs`,children:t})]})}function ms(){let{saveSettings:e}=R(),[t,n]=(0,o.useState)(!1);return{save:(0,o.useCallback)(async(t,r)=>{n(!0);try{return await e(t),ls.info(r),!0}catch(e){return ls.error(e instanceof Error?e.message:`Could not save the Settings`),!1}finally{n(!1)}},[e]),saving:t}}function hs({dirty:e,saving:t,saveDisabled:n=!1,onSave:r,onReset:i}){return(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(ir,{size:`sm`,disabled:!e||t||n,onClick:r,children:t?`Saving…`:`Save`}),(0,D.jsx)(ir,{size:`sm`,variant:`ghost`,disabled:!e||t,onClick:i,children:`Discard`})]})}var gs={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},_s={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},vs={disabled:!1,..._s},ys={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},bs={invalid:void 0,name:void 0,validityData:{state:gs,errors:[],error:``,value:``,initialValue:null},setValidityData:J,disabled:void 0,setTouched:J,setDirty:J,setFilled:J,setFocused:J,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:vs,registerFieldControl:J,validation:{getValidationProps:(e,t=mt)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:J,getInputControl:()=>null,commit:async()=>{},change:J}},xs=o.createContext(bs);function Ss(e=!0){let t=o.useContext(xs);if(t.setValidityData===J&&!e)throw Error(Xe(28));return t}var Cs=o.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:J,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function ws(){return o.useContext(Cs)}function Ts(e){return yo(e,`base-ui`)}var Es=o.createContext({controlId:void 0,registerControlId:J,labelId:void 0,setLabelId:J,messageIds:[],setMessageIds:J,getDescriptionProps:e=>e});function Ds(){return o.useContext(Es)}function Os(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=Ds(),s=Ts(t),c=n?i:void 0,l=W(()=>Symbol()),u=o.useRef(!1),d=o.useRef(t!=null),f=G(()=>{!u.current||a===J||(u.current=!1,a(l.current,void 0))});return K(()=>{if(a===J)return;let e;if(n){let n=r?.current;e=ce(n)&&n.closest(`label`)!=null?t??null:c??s}else if(t!=null)d.current=!0,e=t;else if(d.current)e=s;else{f();return}if(e===void 0){f();return}u.current=!0,a(l.current,e)},[t,r,c,a,n,s,l,f]),o.useEffect(()=>f,[f]),i??s}function ks({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=o.useRef(e!==void 0),[a,s]=o.useState(t);return[i?e:a,o.useCallback(e=>{i||s(e)},[])]}function As(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Ss(),s=W(()=>Symbol());K(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),K(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var js=o.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:s,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFocused:b,setFilled:x,validationMode:S,validation:C}=Ss(),{clearErrors:w}=ws(),T=g||c,E=h??a,D={...m,disabled:T},{labelId:O}=Ds(),ee=Os({id:i});K(()=>{let e=s!=null;C.inputRef.current?.value||e&&s!==``?x(!0):e&&s===``&&x(!1)},[C.inputRef,x,s]);let k=o.useRef(null);K(()=>{d&&k.current===si(q(k.current))&&b(!0)},[d,b]);let[A]=ks({controlled:s,default:u,name:`FieldControl`,state:`value`}),j=s!==void 0,M=j?A:void 0,N=G(()=>C.inputRef.current?.value);return As(C.inputRef,ee,M,N,!T,a),vt(`input`,e,{ref:[t,k],state:D,props:[{id:ee,disabled:T,name:E,ref:C.inputRef,"aria-labelledby":O,autoFocus:d,...j?{value:M}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;l?.(t,Xo(Do,e.nativeEvent)),v(t!==(y.initialValue??``)),x(t!==``),e.nativeEvent.defaultPrevented||(w(E),C.change(t))},onFocus(){b(!0)},onBlur(e){_(!0),b(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(_(!0),C.commit(e.currentTarget.value))}},p,e=>C.getValidationProps(T,e)],stateAttributesMapping:ys})}),Ms=o.forwardRef(function(e,t){return(0,D.jsx)(js,{ref:t,...e})});function Ns({className:e,type:t,...n}){return(0,D.jsx)(Ms,{type:t,"data-slot":`input`,className:tr(`h-8 w-full min-w-0 rounded-2xl border border-transparent bg-input/50 px-2.5 py-1 text-base transition-[color,box-shadow] duration-200 outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}async function Ps(e,t=`GET`,n,r){let i=await y(e,{method:t,signal:r,headers:n===void 0?void 0:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)}),a=await i.json();if(!i.ok)throw Error(a.error??`Request failed (${i.status})`);return a}async function Fs(e,t){let n=new AbortController,r,i,a=new Promise((e,a)=>{i=()=>{a(t.reason),n.abort()},t.addEventListener(`abort`,i,{once:!0}),r=setTimeout(()=>{a(Error(`MCP metadata request timed out after 15 seconds. Retry the request.`)),n.abort()},15e3),t.aborted&&i()});try{return await Promise.race([a,Ps(e,`GET`,void 0,n.signal)])}finally{clearTimeout(r),t.removeEventListener(`abort`,i)}}function Is(e,t=3e3){let[n,r]=(0,o.useState)(),[i,a]=(0,o.useState)(``);return(0,o.useEffect)(()=>{if(r(void 0),a(``),!e)return;let n=new AbortController,i,o=async()=>{try{let t=await Ps(e,`GET`,void 0,n.signal);n.signal.aborted||(r({path:e,data:t}),a(``))}catch(e){n.signal.aborted||a(String(e))}n.signal.aborted||(i=setTimeout(o,t))};return o(),()=>{n.abort(),clearTimeout(i)}},[e,t]),{data:n?.path===e?n?.data:void 0,error:i}}export{Za as $,W as $n,mi as $t,No as A,yr as An,Ni as At,Vo as B,pt as Bn,Ii as Bt,rs as C,Nr as Cn,k as Cr,ia as Ct,Zo as D,Er as Dn,S as Dr,Oi as Dt,Xo as E,Dr as En,y as Er,Ai as Et,qo as F,nr as Fn,Pi as Ft,Ho as G,et as Gn,Ci as Gt,Ko as H,J as Hn,wi as Ht,Fo as I,tr as In,Ki as It,ko as J,Qe as Jn,bi as Jt,Wo as K,q as Kn,Si as Kt,Io as L,kt as Ln,qi as Lt,zo as M,lr as Mn,Ri as Mt,Ro as N,ar as Nn,Fi as Nt,Uo as O,Sr as On,a as Or,ji as Ot,Jo as P,ir as Pn,zi as Pt,Qa as Q,G as Qn,di as Qt,Lo as R,vt as Rn,Yi as Rt,is as S,Mr as Sn,A as Sr,$i as St,Qo as T,Or as Tn,w as Tr,na as Tt,Do as U,it as Un,Xi as Ut,Bo as V,mt as Vn,Ti as Vt,jo as W,tt as Wn,Ei as Wt,Yo as X,Fe as Xn,vi as Xt,Oo as Y,Xe as Yn,xi as Yt,yo as Z,K as Zn,_i as Zt,ps as _,Jr as _n,ye as _r,va as _t,As as a,si as an,Se as ar,Wa as at,ds as b,Fr as bn,te as br,ta as bt,Ds as c,oi as cn,V as cr,za as ct,bs as d,ai as dn,U as dr,ya as dt,fi as en,xe as er,ro as et,xs as f,ti as fn,be as fr,Sa as ft,hs as g,Zr as gn,fe as gr,Da as gt,ys as h,Qr as hn,de as hr,Ea as ht,Ns as i,gi as in,B as ir,Ja as it,Go as j,dr as jn,Li as jt,Po as k,vr as kn,r as kr,Di as kt,Ts as l,ri as ln,_e as lr,La as lt,_s as m,$r as mn,le as mr,Ta as mt,Ps as n,hi as nn,H as nr,Xa as nt,ks as o,ci as on,Te as or,qa as ot,Ss as p,ei as pn,ue as pr,Ca as pt,Ao as q,Ze as qn,yi as qt,Fs as r,pi as rn,Ee as rr,Ya as rt,Os as s,li as sn,Ce as sr,Va as st,Is as t,ui as tn,ve as tr,io as tt,ws as u,ii as un,ce as ur,Ra as ut,fs as v,Kr as vn,ie as vr,ba as vt,es as w,kr as wn,E as wr,Qi as wt,ls as x,Ir as xn,ne as xr,ea as xt,ms as y,Yr as yn,R as yr,$ as yt,Mo as z,_t as zn,Mi as zt};