@snagset/server 0.1.40 → 0.1.41

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 (86) hide show
  1. package/dist/app.js +5 -0
  2. package/dist/app.js.map +1 -1
  3. package/dist/config.generated.js +2 -1
  4. package/dist/config.generated.js.map +1 -1
  5. package/package.json +1 -1
  6. package/static/dashboard/assets/CompositeItem-B_Ebe9qQ.js +1 -0
  7. package/static/dashboard/assets/CompositeList-CDAPQTbv.js +1 -0
  8. package/static/dashboard/assets/{ConfirmDialog-D7eZU5Z6.js → ConfirmDialog-D1II2uNE.js} +1 -1
  9. package/static/dashboard/assets/{CopyButton-_X7ITEaj.js → CopyButton-qbA2ZHWn.js} +1 -1
  10. package/static/dashboard/assets/{FieldItemContext-BgajCxI_.js → FieldItemContext-BM_KzVUj.js} +1 -1
  11. package/static/dashboard/assets/{InstallTag-Bxq5AWM0.js → InstallTag-DTpNoMn9.js} +1 -1
  12. package/static/dashboard/assets/InstanceRows-B1z-L92-.js +1 -0
  13. package/static/dashboard/assets/{McpTokens-D_0BEsPb.js → McpTokens-DE2t0iiS.js} +1 -1
  14. package/static/dashboard/assets/{SaveState-WYxHW3VJ.js → SaveState-QQHqDSgx.js} +1 -1
  15. package/static/dashboard/assets/_app-B_DiSFIt.js +61 -0
  16. package/static/dashboard/assets/{_app-Bv20PwQa.js → _app-CaDt6CPJ.js} +1 -1
  17. package/static/dashboard/assets/{activity-Ch0XQ9sf.js → activity-CzEy_J8-.js} +1 -1
  18. package/static/dashboard/assets/{arrow-left-BVcH0ZD5.js → arrow-left-RqdORgcq.js} +1 -1
  19. package/static/dashboard/assets/avatar-D8S5EME4.js +1 -0
  20. package/static/dashboard/assets/{badge-D4-0NV1D.js → badge-anHWhPFa.js} +1 -1
  21. package/static/dashboard/assets/{card-_fRmCPLn.js → card-C01exIzZ.js} +1 -1
  22. package/static/dashboard/assets/{check-BTd2LoGN.js → check-Gm9Xu4rH.js} +1 -1
  23. package/static/dashboard/assets/chevron-down-C-pVPOKU.js +6 -0
  24. package/static/dashboard/assets/{chevron-right-Co0UMSkz.js → chevron-right-BQmYcugl.js} +1 -1
  25. package/static/dashboard/assets/{copy-CEpGdeGb.js → copy-Ckk__4oN.js} +1 -1
  26. package/static/dashboard/assets/{dialog-C7r1DbuZ.js → dialog-D5G50pSW.js} +2 -2
  27. package/static/dashboard/assets/dropdown-menu-Bm_opJ2p.js +11 -0
  28. package/static/dashboard/assets/{forgot-nTWEgSRm.js → forgot-R7JqXxs5.js} +1 -1
  29. package/static/dashboard/assets/{image-off-DP5YbLdB.js → image-off-BtbHLgOM.js} +1 -1
  30. package/static/dashboard/assets/index-CoiIx5MR.css +1 -0
  31. package/static/dashboard/assets/{index-Ddw_j6S-.js → index-p-qD6BlY.js} +21 -21
  32. package/static/dashboard/assets/{invite-CHU_LQYP.js → invite-9eotNL9V.js} +1 -1
  33. package/static/dashboard/assets/label-CuvYMIVd.js +1 -0
  34. package/static/dashboard/assets/{labels-BuZpvtvw.js → labels-DLMjYGNJ.js} +1 -1
  35. package/static/dashboard/assets/{layout-grid-DpWj1k0D.js → layout-grid-D5ek58h7.js} +1 -1
  36. package/static/dashboard/assets/{parts-DuhvDJGT.js → parts-CN1uQywE.js} +1 -1
  37. package/static/dashboard/assets/{plus-fom7ulPf.js → plus-BsxOLtMA.js} +1 -1
  38. package/static/dashboard/assets/{reset-CQMD1ToU.js → reset-8K76tpdp.js} +1 -1
  39. package/static/dashboard/assets/s._site-egkPDOj9.js +1 -0
  40. package/static/dashboard/assets/s._site.comments-DmrtKLHb.js +49 -0
  41. package/static/dashboard/assets/s._site.reviewers-CGKj-NQo.js +1 -0
  42. package/static/dashboard/assets/s._site.settings-DvWbfMac.js +1 -0
  43. package/static/dashboard/assets/serializeValue-DRMAHja_.js +1 -0
  44. package/static/dashboard/assets/{setup-nee74nI7.js → setup-BDZJmgIB.js} +1 -1
  45. package/static/dashboard/assets/{sign-in-DJSdsL9I.js → sign-in-BmweKwDv.js} +1 -1
  46. package/static/dashboard/assets/{sign-up-DeQDeqC_.js → sign-up-C06mQl-c.js} +1 -1
  47. package/static/dashboard/assets/{sites-l8LQQwZW.js → sites-CkGgns1o.js} +1 -1
  48. package/static/dashboard/assets/{studio-CL5TjGsb.js → studio-BHpeuJSq.js} +1 -1
  49. package/static/dashboard/assets/studio-CG1QMBSK.js +1 -0
  50. package/static/dashboard/assets/studio.index-BOkmM7I5.js +1 -0
  51. package/static/dashboard/assets/{studio.integrations-BLkBekJf.js → studio.integrations-BBik3DdK.js} +1 -1
  52. package/static/dashboard/assets/studio.members-CEKrbJHp.js +11 -0
  53. package/static/dashboard/assets/studio.plan-CkOzUaJM.js +1 -0
  54. package/static/dashboard/assets/{sun-C6_OdtRI.js → sun-DXwtJyi5.js} +1 -1
  55. package/static/dashboard/assets/switch-cgJL6ATv.js +1 -0
  56. package/static/dashboard/assets/{table-WdFx8YPW.js → table-B8VTYpZO.js} +1 -1
  57. package/static/dashboard/assets/{useAriaLabelledBy-CYXdXCKz.js → useAriaLabelledBy-BT5NtL2E.js} +1 -1
  58. package/static/dashboard/assets/{useBaseQuery-bYBwKcW7.js → useBaseQuery-DaFWLbWu.js} +1 -1
  59. package/static/dashboard/assets/useQuery-D-9vXtOo.js +1 -0
  60. package/static/dashboard/assets/useRender-BBzDGtxq.js +1 -0
  61. package/static/dashboard/assets/{useValueChanged-DCX5-3sY.js → useValueChanged-cwqHWzY1.js} +1 -1
  62. package/static/dashboard/assets/{users-BSiXsvcu.js → users-CGY0g3mg.js} +1 -1
  63. package/static/dashboard/assets/{welcome-C96YFTXf.js → welcome-CNtwDQMd.js} +1 -1
  64. package/static/dashboard/assets/{widget-signin-DIvRFGYL.js → widget-signin-BOUMPGXt.js} +1 -1
  65. package/static/dashboard/assets/{you-CNN1L9wO.js → you-DH4QMiND.js} +1 -1
  66. package/static/dashboard/assets/{zod-BXAKx0ML.js → zod-DfHlfdUJ.js} +1 -1
  67. package/static/dashboard/index.html +2 -2
  68. package/static/widget/build.json +2 -2
  69. package/static/widget/snag.js +1 -1
  70. package/static/widget/snag.runtime.js +1 -1
  71. package/static/dashboard/assets/CompositeItem-CP7pxc5U.js +0 -1
  72. package/static/dashboard/assets/_app-C4LQnv_m.js +0 -56
  73. package/static/dashboard/assets/avatar-B4uC-2Rd.js +0 -1
  74. package/static/dashboard/assets/dropdown-menu-Clnp0fwC.js +0 -11
  75. package/static/dashboard/assets/index-Do3jpVIF.css +0 -1
  76. package/static/dashboard/assets/label-CeY5IHdJ.js +0 -1
  77. package/static/dashboard/assets/s._site-XzH7h0kY.js +0 -1
  78. package/static/dashboard/assets/s._site.comments-D_QbkDGk.js +0 -54
  79. package/static/dashboard/assets/s._site.reviewers-DKQj9ftE.js +0 -1
  80. package/static/dashboard/assets/s._site.settings-DGhg9pWK.js +0 -1
  81. package/static/dashboard/assets/studio-CLnwa1jr.js +0 -1
  82. package/static/dashboard/assets/studio.index-D4sAU91A.js +0 -1
  83. package/static/dashboard/assets/studio.members-KzPokmYW.js +0 -6
  84. package/static/dashboard/assets/switch-CGYNLqP6.js +0 -1
  85. package/static/dashboard/assets/useQuery-CaIu0ohN.js +0 -1
  86. package/static/dashboard/assets/useRender-Rh7x0Dwc.js +0 -1
@@ -1 +1 @@
1
- import{X as g,Y as f,Z as p,p as v,j as e,B as m,_ as N,L as j,$ as P}from"./index-Ddw_j6S-.js";import{Q as y,u as b}from"./useBaseQuery-bYBwKcW7.js";import{P as w,S}from"./parts-DuhvDJGT.js";import{u as R,b as E,c as k,S as F}from"./labels-BuZpvtvw.js";import"./card-_fRmCPLn.js";var M=class extends y{constructor(s,r){super(s,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,r){const{state:i}=s,l=super.createResult(s,r),{isFetching:o,isRefetching:n,isError:u,isRefetchError:d}=l,t=i.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",h=u&&t==="backward",x=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(r,i.data),hasPreviousPage:g(r,i.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:h,isFetchingPreviousPage:x,isRefetchError:d&&!c&&!h,isRefetching:n&&!a&&!x}}};function A(s,r){return b(s,M)}const C=[{value:"unresolved",label:"Needs attention"},...k.map(s=>({value:s,label:F[s]})),{value:"all",label:"Everything"}];function D(s,r=new Date){const i=new Date(s),l=n=>new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),o=Math.round((l(r)-l(i))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?i.toLocaleDateString(void 0,{weekday:"long"}):i.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function _(){const s=R(),{status:r="unresolved",site:i}=p.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),n=A(P(r,i)),u=n.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=D(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(w,{title:"Activity",sub:`Every site, newest first${i?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C.map(t=>e.jsx(m,{size:"sm",variant:r===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsxs("select",{"aria-label":"Site",value:i??"",onChange:t=>o({site:t.target.value||void 0}),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground",children:[e.jsx("option",{value:"",children:"All sites"}),s.projects.map(t=>e.jsx("option",{value:t.uid,children:t.name},t.uid))]})]})]}),n.isPending&&e.jsx(N,{rows:4}),n.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),n.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:r==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":r==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(j,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(S,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:E(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),n.hasNextPage&&e.jsx("div",{children:e.jsx(m,{variant:"outline",size:"sm",disabled:n.isFetchingNextPage,onClick:()=>void n.fetchNextPage(),children:n.isFetchingNextPage?"Reading…":"Show older"})})]})}export{_ as component};
1
+ import{X as g,Y as f,Z as p,p as v,j as e,B as m,_ as N,L as j,$ as P}from"./index-p-qD6BlY.js";import{Q as y,u as b}from"./useBaseQuery-DaFWLbWu.js";import{P as w,S}from"./parts-CN1uQywE.js";import{u as R,b as E,c as k,S as F}from"./labels-DLMjYGNJ.js";import"./card-C01exIzZ.js";var M=class extends y{constructor(s,r){super(s,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,r){const{state:i}=s,l=super.createResult(s,r),{isFetching:o,isRefetching:n,isError:u,isRefetchError:d}=l,t=i.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",h=u&&t==="backward",x=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(r,i.data),hasPreviousPage:g(r,i.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:h,isFetchingPreviousPage:x,isRefetchError:d&&!c&&!h,isRefetching:n&&!a&&!x}}};function A(s,r){return b(s,M)}const C=[{value:"unresolved",label:"Needs attention"},...k.map(s=>({value:s,label:F[s]})),{value:"all",label:"Everything"}];function D(s,r=new Date){const i=new Date(s),l=n=>new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),o=Math.round((l(r)-l(i))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?i.toLocaleDateString(void 0,{weekday:"long"}):i.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function _(){const s=R(),{status:r="unresolved",site:i}=p.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),n=A(P(r,i)),u=n.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=D(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(w,{title:"Activity",sub:`Every site, newest first${i?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C.map(t=>e.jsx(m,{size:"sm",variant:r===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsxs("select",{"aria-label":"Site",value:i??"",onChange:t=>o({site:t.target.value||void 0}),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground",children:[e.jsx("option",{value:"",children:"All sites"}),s.projects.map(t=>e.jsx("option",{value:t.uid,children:t.name},t.uid))]})]})]}),n.isPending&&e.jsx(N,{rows:4}),n.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),n.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:r==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":r==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(j,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(S,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:E(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),n.hasNextPage&&e.jsx("div",{children:e.jsx(m,{variant:"outline",size:"sm",disabled:n.isFetchingNextPage,onClick:()=>void n.fetchNextPage(),children:n.isFetchingNextPage?"Reading…":"Show older"})})]})}export{_ as component};
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Ddw_j6S-.js";/**
1
+ import{c as o}from"./index-p-qD6BlY.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{r as x,E as rn,l as q,aH as we,aD as pe,aI as xe,g as se,aJ as Et,aF as Ze,aE as bt,aK as kn,aL as sn,aM as Dn,aN as St,aO as cn,aP as it,aQ as vt,aR as _t,aS as ln,n as In,e as U,f as ie,a9 as Fn,k as Ct,i as Wn,j as Pt,h as an}from"./index-p-qD6BlY.js";import{$ as At,w as Mt,i as ht,aa as Vn,av as fn,ad as un,U as $n,aw as zn,v as ue,L as Hn,ax as Bn,ay as Nt,az as pt,aA as Kt,aB as fe,aC as Xe,a0 as _n,a4 as Nn,aD as st,aE as ct,aF as dn,aG as Tt,aH as Kn,aI as jn,aJ as Yn,aK as Xn,C as Un,aL as qn,aM as Gn}from"./dialog-D5G50pSW.js";import{t as Jn,g as mn,c as Je,x as xt,r as et,a as Be,B as jt,m as Qn}from"./label-CuvYMIVd.js";import{u as Zn}from"./useValueChanged-cwqHWzY1.js";import{u as eo}from"./CompositeList-CDAPQTbv.js";const Le=Math.min,de=Math.max,tt=Math.round,Ue=Math.floor,me=e=>({x:e,y:e}),to={left:"right",right:"left",bottom:"top",top:"bottom"};function gn(e,t,n){return de(e,Le(t,n))}function ye(e,t){return typeof e=="function"?e(t):e}function Q(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function Lt(e){return e==="x"?"y":"x"}function kt(e){return e==="y"?"height":"width"}function J(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Dt(e){return Lt(J(e))}function no(e,t,n){n===void 0&&(n=!1);const o=Re(e),r=Dt(e),i=kt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=nt(s)),[s,nt(s)]}function oo(e){const t=nt(e);return[Ot(e),t,Ot(t)]}function Ot(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Yt=["left","right"],Xt=["right","left"],ro=["top","bottom"],io=["bottom","top"];function so(e,t,n){switch(e){case"top":case"bottom":return n?t?Xt:Yt:t?Yt:Xt;case"left":case"right":return t?ro:io;default:return[]}}function co(e,t,n,o){const r=Re(e);let i=so(Q(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Ot)))),i}function nt(e){const t=Q(e);return to[t]+e.slice(t.length)}function lo(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function hn(e){return typeof e!="number"?lo(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function wr(e,t={}){const{enabled:n=!0,event:o="click",toggle:r=!0,ignoreMouse:i=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=Jn}=t,f="rootStore"in e?e.rootStore:e,u=f.context.dataRef,a=x.useRef(void 0),g=At(),d=Mt(),m=x.useMemo(()=>{function p(y,w,E,R){const v=Je(l,w,E);y&&R==="touch"&&c>0?d.start(c,()=>{f.setOpen(!0,v)}):f.setOpen(y,v)}function h(y,w,E){const R=u.current.openEvent,v=f.select("domReferenceElement")!==w;return y&&v||!y||!r?!0:R&&s?!E(R.type):!1}return{onPointerDown(y){a.current=ht(y.pointerType,!0)&&fn(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=a.current,E=y.nativeEvent,R=f.select("open");if(y.button!==0||o==="click"||ht(w,!0)&&i)return;const v=h(R,y.currentTarget,A=>A==="click"||A==="mousedown"),S=mn(E);if(Vn(S)){p(v,E,S,w);return}const P=y.currentTarget;g.request(()=>{p(v,E,P,w)})},onClick(y){if(o==="mousedown-only")return;const w=a.current;if(o==="mousedown"&&w){a.current=void 0;return}if(ht(w,!0)&&i)return;const E=f.select("open"),R=h(E,y.currentTarget,v=>v==="click"||v==="mousedown"||v==="keydown"||v==="keyup");p(R,y.nativeEvent,y.currentTarget,w)},onKeyDown(){a.current=void 0}}},[u,o,i,l,f,s,r,g,d,c]);return x.useMemo(()=>n?{reference:m}:rn,[n,m])}function Ut(e,t,n){let{reference:o,floating:r}=e;const i=J(t),s=Dt(t),c=kt(s),l=Q(t),f=i==="y",u=o.x+o.width/2-r.width/2,a=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let d;switch(l){case"top":d={x:u,y:o.y-r.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:a};break;case"left":d={x:o.x-r.width,y:a};break;default:d={x:o.x,y:o.y}}const m=Re(t);return m&&(d[s]+=g*(m==="end"?1:-1)*(n&&f?-1:1)),d}async function ao(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:a="floating",altBoundary:g=!1,padding:d=0}=ye(t,e),m=hn(d),h=c[g?a==="floating"?"reference":"floating":a],y=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:l})),w=a==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},v=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:E,strategy:l}):w);return{top:(y.top-v.top+m.top)/R.y,bottom:(v.bottom-y.bottom+m.bottom)/R.y,left:(y.left-v.left+m.left)/R.x,right:(v.right-y.right+m.right)/R.x}}const fo=50,uo=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:ao},l=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:a}=Ut(f,o,l),g=o,d=0;const m={};for(let p=0;p<i.length;p++){const h=i[p];if(!h)continue;const{name:y,fn:w}=h,{x:E,y:R,data:v,reset:S}=await w({x:u,y:a,initialPlacement:o,placement:g,strategy:r,middlewareData:m,rects:f,platform:c,elements:{reference:e,floating:t}});u=E??u,a=R??a,m[y]={...m[y],...v},S&&d<fo&&(d++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(f=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:u,y:a}=Ut(f,g,l)),p=-1)}return{x:u,y:a,placement:g,strategy:r,middlewareData:m}},mo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:f}=t,{mainAxis:u=!0,crossAxis:a=!0,fallbackPlacements:g,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...h}=ye(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Q(r),w=J(c),E=Q(c)===c,R=await(l.isRTL==null?void 0:l.isRTL(f.floating)),v=g||(E||!p?[nt(c)]:oo(c)),S=m!=="none";!g&&S&&v.push(...co(c,p,m,R));const P=[c,...v],A=await l.detectOverflow(t,h),k=[];let L=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&k.push(A[y]),a){const T=no(r,s,R);k.push(A[T[0]],A[T[1]])}if(L=[...L,{placement:r,overflows:k}],!k.every(T=>T<=0)){var D,K;const T=(((D=i.flip)==null?void 0:D.index)||0)+1,$=P[T];if($&&(!(a==="alignment"?w!==J($):!1)||L.every(b=>J(b.placement)===w?b.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:$}};let F=(K=L.filter(W=>W.overflows[0]<=0).sort((W,b)=>W.overflows[1]-b.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(d){case"bestFit":{var _;const W=(_=L.filter(b=>{if(S){const z=J(b.placement);return z===w||z==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(z=>z>0).reduce((z,H)=>z+H,0)]).sort((b,z)=>b[1]-z[1])[0])==null?void 0:_[0];W&&(F=W);break}case"initialPlacement":F=c;break}if(r!==F)return{reset:{placement:F}}}return{}}}},pn=new Set(["left","top"]);async function go(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Q(n),c=Re(n),l=J(n)==="y",f=pn.has(s)?-1:1,u=i&&l?-1:1,a=ye(t,e);let{mainAxis:g,crossAxis:d,alignmentAxis:m}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return c&&typeof m=="number"&&(d=c==="end"?m*-1:m),l?{x:d*u,y:g*f}:{x:g*f,y:d*u}}const ho=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await go(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},po=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:E,y:R}=w;return{x:E,y:R}}},...f}=ye(e,t),u={x:n,y:o},a=await i.detectOverflow(t,f),g=J(r),d=Lt(g);let m=u[d],p=u[g];const h=(w,E)=>gn(E+a[w==="y"?"top":"left"],E,E-a[w==="y"?"bottom":"right"]);s&&(m=h(d,m)),c&&(p=h(g,p));const y=l.fn({...t,[d]:m,[g]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[d]:s,[g]:c}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:i,placement:s,rects:c,middlewareData:l}=t,{offset:f=0,mainAxis:u=!0,crossAxis:a=!0}=ye(e,t),g={x:r,y:i},d=J(s),m=Lt(d);let p=g[m],h=g[d];const y=ye(f,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(o=y.crossAxis)!=null?o:0};if(u){const v=m==="y"?"height":"width",S=c.reference[m]-c.floating[v]+w.mainAxis,P=c.reference[m]+c.reference[v]-w.mainAxis;p<S?p=S:p>P&&(p=P)}if(a){var E,R;const v=m==="y"?"width":"height",S=pn.has(Q(s)),P=c.reference[d]-c.floating[v]+(S&&((E=l.offset)==null?void 0:E[d])||0)+(S?0:w.crossAxis),A=c.reference[d]+c.reference[v]+(S?0:((R=l.offset)==null?void 0:R[d])||0)-(S?w.crossAxis:0);h<P?h=P:h>A&&(h=A)}return{[m]:p,[d]:h}}}},yo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...c}=ye(e,t),l=await r.detectOverflow(t,c),f=Q(n),u=Re(n),a=J(n)==="y",{width:g,height:d}=o.floating;let m,p;f==="top"||f==="bottom"?(m=f,p=u===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(p=f,m=u==="end"?"top":"bottom");const h=d-l.top-l.bottom,y=g-l.left-l.right,w=Le(d-l[m],h),E=Le(g-l[p],y),R=t.middlewareData.shift,v=!R;let S=w,P=E;R!=null&&R.enabled.x&&(P=y),R!=null&&R.enabled.y&&(S=h),v&&!u&&(a?P=g-2*de(l.left,l.right):S=d-2*de(l.top,l.bottom)),await s({...t,availableWidth:P,availableHeight:S});const A=await r.getDimensions(i.floating);return g!==A.width||d!==A.height?{reset:{rects:!0}}:{}}}};function xn(e){const t=xe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=pe(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=tt(n)!==i||tt(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function It(e){return q(e)?e:e.contextElement}function Te(e){const t=It(e);if(!pe(t))return me(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=xn(t);let s=(i?tt(n.width):n.width)/o,c=(i?tt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const wo=me(0);function yn(e){const t=se(e);return!ln()||!t.visualViewport?wo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ro(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===se(e)}function Ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=It(e);let s=me(1);t&&(o?q(o)&&(s=Te(o)):s=Te(e));const c=Ro(i,n,o)?yn(i):me(0);let l=(r.left+c.x)/s.x,f=(r.top+c.y)/s.y,u=r.width/s.x,a=r.height/s.y;if(i&&o){const g=se(i),d=q(o)?se(o):o;let m=g,p=_t(m);for(;p&&d!==m;){const h=Te(p),y=p.getBoundingClientRect(),w=xe(p),E=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*h.x,R=y.top+(p.clientTop+parseFloat(w.paddingTop))*h.y;l*=h.x,f*=h.y,u*=h.x,a*=h.y,l+=E,f+=R,m=se(p),p=_t(m)}}return ot({width:u,height:a,x:l,y:f})}function lt(e,t){const n=it(e).scrollLeft;return t?t.left+n:Ae(we(e)).left+n}function wn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-lt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function bo(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=we(o),c=t?Et(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},f=me(1);const u=me(0),a=pe(o);if((a||!i)&&((St(o)!=="body"||cn(s))&&(l=it(o)),a)){const d=Ae(o);f=Te(o),u.x=d.x+o.clientLeft,u.y=d.y+o.clientTop}const g=s&&!a&&!i?wn(s,l):me(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+g.x,y:n.y*f.y-l.scrollTop*f.y+u.y+g.y}}function vo(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ao(e){const t=it(e),n=e.ownerDocument.body,o=de(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=de(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+lt(e);const s=-t.scrollTop;return xe(n).direction==="rtl"&&(i+=de(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}const Oo=25;function Eo(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=se(e),i=we(e),s=r.visualViewport;let c=i.clientWidth,l=i.clientHeight,f=0,u=0;if(s){const g=!ln()||t==="fixed";o?g||(f=-s.offsetLeft,u=-s.offsetTop):(c=s.width,l=s.height,g&&(f=s.offsetLeft,u=s.offsetTop))}if(lt(i)<=0){const g=i.ownerDocument,d=g.body,m=getComputedStyle(d),p=g.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(i.clientWidth-d.clientWidth-p),y=getComputedStyle(i).scrollbarGutter==="stable both-edges"?h/2:h;y<=Oo&&(c-=y)}return{width:c,height:l,x:f,y:u}}function So(e,t){const n=Ae(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Te(e),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,f=o*i.y;return{width:s,height:c,x:l,y:f}}function qt(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Eo(e,n,t);else if(t==="document")o=Ao(we(e));else if(q(t))o=So(t,n);else{const r=yn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ot(o)}function Co(e,t){const n=t.get(e);if(n)return n;let o=vt(e,[],!1).filter(c=>q(c)&&St(c)!=="body"),r=null;const i=xe(e).position==="fixed";let s=i?Ze(e):e;for(;q(s)&&!bt(s);){const c=xe(s),l=sn(s),f=r?r.position:i?"fixed":"";!l&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(a=>a!==s):r=c,s=Ze(s)}return t.set(e,o),o}function Po(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Et(t)?[]:Co(t,this._c):[].concat(n),o],c=qt(t,s[0],r);let l=c.top,f=c.right,u=c.bottom,a=c.left;for(let g=1;g<s.length;g++){const d=qt(t,s[g],r);l=de(d.top,l),f=Le(d.right,f),u=Le(d.bottom,u),a=de(d.left,a)}return{width:f-a,height:u-l,x:a,y:l}}function Mo(e){const{width:t,height:n}=xn(e);return{width:t,height:n}}function To(e,t,n){const o=pe(t),r=we(t),i=n==="fixed",s=Ae(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=me(0);if((o||!i)&&((St(t)!=="body"||cn(r))&&(c=it(t)),o)){const g=Ae(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}!o&&r&&(l.x=lt(r));const f=r&&!o&&!i?wn(r,c):me(0),u=s.left+c.scrollLeft-l.x-f.x,a=s.top+c.scrollTop-l.y-f.y;return{x:u,y:a,width:s.width,height:s.height}}function yt(e){return xe(e).position==="static"}function Gt(e,t){if(!pe(e)||xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function Rn(e,t){const n=se(e);if(Et(e))return n;if(!pe(e)){let r=Ze(e);for(;r&&!bt(r);){if(q(r)&&!yt(r))return r;r=Ze(r)}return n}let o=Gt(e,t);for(;o&&kn(o)&&yt(o);)o=Gt(o,t);return o&&bt(o)&&yt(o)&&!sn(o)?n:o||Dn(e)||n}const Lo=async function(e){const t=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(e.floating);return{reference:To(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ko(e){return xe(e).direction==="rtl"}const Do={convertOffsetParentRelativeRectToViewportRelativeRect:bo,getDocumentElement:we,getClippingRect:Po,getOffsetParent:Rn,getElementRects:Lo,getClientRects:vo,getDimensions:Mo,getScale:Te,isElement:q,isRTL:ko};function bn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Io(e,t,n){let o=null,r;const i=we(e);function s(){var u;clearTimeout(r),(u=o)==null||u.disconnect(),o=null}function c(u,a){u===void 0&&(u=!1),a===void 0&&(a=1),s();const g=e.getBoundingClientRect(),{left:d,top:m,width:p,height:h}=g;if(u||t(),!p||!h)return;const y=Ue(m),w=Ue(i.clientWidth-(d+p)),E=Ue(i.clientHeight-(m+h)),R=Ue(d),S={rootMargin:-y+"px "+-w+"px "+-E+"px "+-R+"px",threshold:de(0,Le(1,a))||1};let P=!0;function A(k){const L=k[0].intersectionRatio;if(!bn(g,e.getBoundingClientRect()))return c();if(L!==a){if(!P)return c();L?c(!1,L):r=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(A,{...S,root:i.ownerDocument})}catch{o=new IntersectionObserver(A,S)}o.observe(e)}const l=se(e),f=()=>c(n);return l.addEventListener("resize",f),c(!0),()=>{l.removeEventListener("resize",f),s()}}function Jt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=It(e),u=r||i?[...f?vt(f):[],...t?vt(t):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n),i&&y.addEventListener("resize",n)});const a=f&&c?Io(f,n,i):null;let g=-1,d=null;s&&(d=new ResizeObserver(y=>{let[w]=y;w&&w.target===f&&d&&t&&(d.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=d)==null||E.observe(t)})),n()}),f&&!l&&d.observe(f),t&&d.observe(t));let m,p=l?Ae(e):null;l&&h();function h(){const y=Ae(e);p&&!bn(p,y)&&n(),p=y,m=requestAnimationFrame(h)}return n(),()=>{var y;u.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),a?.(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const Fo=ho,Wo=po,Vo=mo,$o=yo,zo=xo,Ho=(e,t,n)=>{const o=new Map,r=n??{},i={...Do,...r.platform,_c:o};return uo(e,t,{...r,platform:i})};var Bo=typeof document<"u",_o=function(){},Qe=Bo?x.useLayoutEffect:_o;function rt(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!rt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!rt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function vn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qt(e,t){const n=vn(e);return Math.round(t*n)/n}function wt(e){const t=x.useRef(e);return Qe(()=>{t.current=e}),t}function No(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:f}=e,[u,a]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,d]=x.useState(o);rt(g,o)||d(o);const[m,p]=x.useState(null),[h,y]=x.useState(null),w=x.useCallback(b=>{b!==S.current&&(S.current=b,p(b))},[]),E=x.useCallback(b=>{b!==P.current&&(P.current=b,y(b))},[]),R=i||m,v=s||h,S=x.useRef(null),P=x.useRef(null),A=x.useRef(u),k=l!=null,L=wt(l),D=wt(r),K=wt(f),_=x.useCallback(()=>{if(!S.current||!P.current)return;const b={placement:t,strategy:n,middleware:g};D.current&&(b.platform=D.current),Ho(S.current,P.current,b).then(z=>{const H={...z,isPositioned:K.current!==!1};T.current&&!rt(A.current,H)&&(A.current=H,In.flushSync(()=>{a(H)}))})},[g,t,n,D,K]);Qe(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,a(b=>({...b,isPositioned:!1})))},[f]);const T=x.useRef(!1);Qe(()=>(T.current=!0,()=>{T.current=!1}),[]),Qe(()=>{if(R&&(S.current=R),v&&(P.current=v),R&&v){if(L.current)return L.current(R,v,_);_()}},[R,v,_,L,k]);const $=x.useMemo(()=>({reference:S,floating:P,setReference:w,setFloating:E}),[w,E]),F=x.useMemo(()=>({reference:R,floating:v}),[R,v]),W=x.useMemo(()=>{const b={position:n,left:0,top:0};if(!F.floating)return b;const z=Qt(F.floating,u.x),H=Qt(F.floating,u.y);return c?{...b,transform:"translate("+z+"px, "+H+"px)",...vn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:H}},[n,c,F.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:_,refs:$,elements:F,floatingStyles:W}),[u,_,$,F,W])}const Ko=(e,t)=>{const n=Fo(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=(e,t)=>{const n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yo=(e,t)=>({fn:zo(e).fn,options:[e,t]}),Xo=(e,t)=>{const n=Vo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uo=(e,t)=>{const n=$o(e);return{name:n.name,fn:n.fn,options:[e,t]}};function qo(e){return Go(e,e.rootContext)}function Go(e,t){const{nodeId:n,externalTree:o}=e,r=t.useState("referenceElement"),i=t.useState("floatingElement"),s=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[f,u]=x.useState(null),[a,g]=x.useState(void 0),[d,m]=x.useState(void 0),p=x.useRef(null),h=un(o),y=x.useMemo(()=>({reference:r,floating:i,domReference:s}),[r,i,s]),w=No({...e,elements:{...y,...f&&{reference:f}}}),E=q(a)?a:null,R=d===void 0?t.state.floatingElement:d;t.useSyncedValue("referenceElement",a??null),t.useSyncedValue("domReferenceElement",a===void 0?s:E),t.useSyncedValue("floatingElement",R);const v=x.useCallback(D=>{const K=q(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;u(K),w.refs.setReference(K)},[w.refs]),S=x.useCallback(D=>{(q(D)||D===null)&&(p.current=D,g(D)),(q(w.refs.reference.current)||w.refs.reference.current===null||D!==null&&!q(D))&&w.refs.setReference(D)},[w.refs,g]),P=x.useCallback(D=>{m(D),w.refs.setFloating(D)},[w.refs]),A=x.useMemo(()=>({...w.refs,setReference:S,setFloating:P,setPositionReference:v,domReference:p}),[w.refs,S,P,v]),k=x.useMemo(()=>({...w.elements,domReference:s}),[w.elements,s]),L=x.useMemo(()=>({...w,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:A,elements:k,nodeId:n,rootStore:t}),[w,A,k,n,t,c,l]);return U(()=>{s&&(p.current=s)},[s]),U(()=>{t.context.dataRef.current.floatingContext=L;const D=h?.nodesRef.current.find(K=>K.id===n);D&&(D.context=L)}),x.useMemo(()=>({...w,context:L,refs:A,elements:k,rootStore:t}),[w,A,k,L,t])}const Jo="Escape";function Zt(e){return _n&&e.movementX===0&&e.movementY===0}function at(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function qe(e,t){return at(t,e===dn||e===Tt,e===st||e===ct)}function Rt(e,t,n){return at(t,e===Tt,n?e===st:e===ct)||e==="Enter"||e===" "||e===""}function Qo(e,t,n){return at(t,n?e===st:e===ct,e===Tt)}function Zo(e,t,n,o){const r=n?e===ct:e===st,i=e===dn;return t==="both"||t==="horizontal"&&o?e===Jo:at(t,r,i)}function Rr(e,t){const{listRef:n,activeIndex:o,onNavigate:r=()=>{},enabled:i=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:f=!1,rtl:u=!1,virtual:a=!1,focusItemOnOpen:g="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:m=!0,disabledIndices:p=void 0,orientation:h="vertical",parentOrientation:y,id:w,resetOnPointerLeave:E=!0,externalTree:R,grid:v}=t,S=v!=null,P="rootStore"in e?e.rootStore:e,A=P.useState("open"),k=P.useState("floatingElement"),L=P.useState("domReferenceElement"),D=P.context.dataRef,K=$n(k),_=zn(L),T=ue(K),$=Hn(),F=un(R),W=x.useRef(g),b=x.useRef(s??-1),z=x.useRef(null),H=x.useRef(!0),N=ie(O=>{r(b.current===-1?null:b.current,O)}),be=x.useRef(!!k),B=x.useRef(A),Y=x.useRef(!1),Oe=x.useRef(!1),ke=x.useRef(null),ft=ue(p),Ee=ue(A),ee=ue(s),ce=ue(E),De=At(),Se=At(),Ie=ie(()=>{function O(V){a?F?.events.emit("virtualfocus",V):ke.current=Bn(V,{sync:Y.current,preventScroll:!0})}const C=n.current[b.current],j=Oe.current;C&&O(C),(Y.current?V=>V():V=>De.request(V))(()=>{const V=n.current[b.current]||C;if(!V)return;C||O(V),Ce&&(j||!H.current)&&V.scrollIntoView?.({block:"nearest",inline:"nearest"})})});U(()=>{D.current.orientation=h},[D,h]),U(()=>{i&&(A&&k?(b.current=s??-1,W.current&&s!=null&&(Oe.current=!0,N())):be.current&&(b.current=-1,N()))},[i,A,k,s,N]),U(()=>{if(i){if(!A){Y.current=!1;return}if(k)if(o==null){if(Y.current=!1,ee.current!=null)return;if(be.current&&(b.current=-1,Ie()),(!B.current||!be.current)&&W.current&&(z.current!=null||W.current===!0&&z.current==null)){let O=0;const C=()=>{n.current[0]==null?(O<2&&(O?M=>Se.request(M):queueMicrotask)(C),O+=1):(b.current=z.current==null||Rt(z.current,h,u)||f?pt(n):Kt(n),z.current=null,N())};C()}}else Nt(n.current,o)||(b.current=o,Ie(),Oe.current=!1)}},[i,A,k,o,ee,f,n,h,u,N,Ie,Se]),U(()=>{if(!i||k||!F||a||!be.current)return;const O=F.nodesRef.current,C=O.find(V=>V.id===$)?.context?.elements.floating,j=xt(et(L??C??null)),M=O.some(V=>V.context&&Be(V.context.elements.floating,j));C&&!M&&H.current&&C.focus({preventScroll:!0})},[i,k,L,F,$,a]),U(()=>{B.current=A,be.current=!!k}),U(()=>{A||(z.current=null,W.current=g)},[A,g]);const _e=o!=null,te=ie(O=>{if(!Ee.current)return;const C=n.current.indexOf(O.currentTarget);C!==-1&&(b.current!==C||o!==C)&&(b.current=C,N(O))}),ve=ie(()=>y??F?.nodesRef.current.find(O=>O.id===$)?.context?.dataRef?.current.orientation),Fe=ie(()=>pt(n,ft.current)),ge=ie(O=>{if(H.current=!1,Y.current=!0,O.which===229||!Ee.current&&O.currentTarget===T.current)return;if(f&&Zo(O.key,h,u,S)){qe(O.key,ve())||fe(O),P.setOpen(!1,Je(jt,O.nativeEvent)),pe(L)&&(a?F?.events.emit("virtualfocus",L):L.focus());return}const C=b.current,j=pt(n,p),M=Kt(n,p);if(_||(O.key==="Home"&&(fe(O),b.current=j,N(O)),O.key==="End"&&(fe(O),b.current=M,N(O))),v!=null){const V=v(O,b.current,n,h,l,u,p,j,M);if(V!=null&&(b.current=V,N(O)),h==="both")return}if(qe(O.key,h)){if(fe(O),A&&!a&&xt(O.currentTarget.ownerDocument)===O.currentTarget){b.current=Rt(O.key,h,u)?j:M,N(O);return}Rt(O.key,h,u)?l?C>=M?c&&C!==n.current.length?b.current=-1:(Y.current=!1,b.current=j):b.current=Xe(n.current,{startingIndex:C,disabledIndices:p}):b.current=Math.min(M,Xe(n.current,{startingIndex:C,disabledIndices:p})):l?C<=j?c&&C!==-1?b.current=n.current.length:(Y.current=!1,b.current=M):b.current=Xe(n.current,{startingIndex:C,decrement:!0,disabledIndices:p}):b.current=Math.max(j,Xe(n.current,{startingIndex:C,decrement:!0,disabledIndices:p})),Nt(n.current,b.current)&&(b.current=-1),N(O)}}),Ce=x.useMemo(()=>({onFocus(C){Y.current=!0,te(C)},onClick:({currentTarget:C})=>C.focus({preventScroll:!0}),onMouseMove(C){Zt(C)||(Y.current=!0,Oe.current=!1,d&&te(C))},onPointerLeave(C){if(!Ee.current||!H.current||C.pointerType==="touch")return;Y.current=!0;const j=C.relatedTarget;if(!(!d||n.current.includes(j))&&ce.current&&(ke.current?.(),ke.current=null,b.current=-1,N(C),!a)){const M=T.current,V=xt(et(M));M&&Be(M,V)&&M.focus({preventScroll:!0})}}}),[te,Ee,T,d,n,N,ce,a]),he=x.useMemo(()=>a&&A&&_e&&{"aria-activedescendant":`${w}-${o}`},[a,A,_e,w,o]),le=x.useMemo(()=>({"aria-orientation":h==="both"?void 0:h,..._?{}:he,onKeyDown(O){if(O.key==="Tab"&&O.shiftKey&&A&&!a){const C=mn(O.nativeEvent);if(C&&!Be(T.current,C))return;fe(O),P.setOpen(!1,Je(Qn,O.nativeEvent)),pe(L)&&L.focus();return}ge(O)},onPointerMove(O){Zt(O)||(H.current=!0)}}),[he,ge,T,h,_,P,A,a,L]),ne=x.useMemo(()=>{function O(M){P.setOpen(!0,Je(jt,M.nativeEvent,M.currentTarget))}function C(M){g==="auto"&&Nn(M.nativeEvent)&&(W.current=!a)}function j(M){W.current=g,g==="auto"&&fn(M.nativeEvent)&&(W.current=!0)}return{onKeyDown(M){const V=P.select("open");H.current=!1;const Z=M.key.startsWith("Arrow"),Ve=Qo(M.key,ve(),u),$e=qe(M.key,h),Ne=(f?Ve:$e)||M.key==="Enter"||M.key.trim()==="";if(a&&V)return ge(M);if(!(!V&&!m&&Z)){if(Ne){const Pe=qe(M.key,ve());z.current=f&&Pe?null:M.key}if(f){Ve&&(fe(M),V?(b.current=Fe(),N(M)):O(M));return}$e&&(ee.current!=null&&(b.current=ee.current),fe(M),!V&&m?O(M):ge(M),V&&N(M))}},onFocus(M){P.select("open")&&!a&&(b.current=-1,N(M))},onPointerDown:j,onPointerEnter:j,onMouseDown:C,onClick:C}},[ge,g,Fe,f,N,P,m,h,ve,u,ee,a]),We=x.useMemo(()=>({...he,...ne}),[he,ne]);return x.useMemo(()=>i?{reference:We,floating:le,item:Ce,trigger:ne}:{},[i,We,le,ne,Ce])}function br(e,t){const{listRef:n,elementsRef:o,activeIndex:r,onMatch:i,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:f=750,selectedIndex:u=null}=t,a="rootStore"in e?e.rootStore:e,g=a.useState("open"),d=Mt(),m=x.useRef(""),p=x.useRef(u??r??-1),h=x.useRef(null),y=ie(R=>{function v(T){return o?.current[T]}function S(T){const $=v(T);return $&&!Kn($)||$?.matches(":disabled")?!1:s==null||!jn(Fn,T,s)}function P(T,$,F=0){if(T.length===0)return-1;const W=(F%T.length+T.length)%T.length,b=$.toLowerCase();for(let z=0;z<T.length;z+=1){const H=(W+z)%T.length;if(!(!T[H]?.toLowerCase().startsWith(b)||!S(H)))return H}return-1}const A=n.current;if(m.current.length>0&&R.key===" "&&(fe(R),c?.(!0)),m.current.length>0&&m.current[0]!==" "&&P(A,m.current)===-1&&R.key!==" "&&c?.(!1),A==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(fe(R),c?.(!0));const k=m.current==="";k&&(p.current=u??r??-1),A.every((T,$)=>T&&S($)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&m.current===R.key&&(m.current="",p.current=h.current),m.current+=R.key,d.start(f,()=>{m.current="",p.current=h.current,c?.(!1)});const K=((k?u??r??-1:p.current)??0)+1,_=P(A,m.current,K);_!==-1?(i?.(_),h.current=_):R.key!==" "&&(m.current="",c?.(!1))}),w=ie(R=>{const v=R.relatedTarget,S=a.select("domReferenceElement"),P=a.select("floatingElement");Be(S,v)||Be(P,v)||(d.clear(),m.current="",p.current=h.current,c?.(!1))});U(()=>{!g&&u!==null||(d.clear(),h.current=null,m.current!==""&&(m.current=""))},[g,u,d]);const E=x.useMemo(()=>({onKeyDown:y,onBlur:w}),[y,w]);return x.useMemo(()=>l?{reference:E,floating:E}:{},[l,E])}function er(e){const t=x.useRef(""),n=x.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:x.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function tr(e,t){const n=ie((i,s)=>{(typeof e=="function"?e():e)||t(s||(Yn?"touch":""))}),{onClick:o,onPointerDown:r}=er(n);return x.useMemo(()=>({onClick:o,onPointerDown:r}),[o,r])}function vr(e){const[t,n]=x.useState(null),o=tr(e,n);return Zn(e,r=>{r&&!e&&n(null)}),x.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const nr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:f,padding:u=0,offsetParent:a="real"}=ye(e,t)||{};if(f==null)return{};const g=hn(u),d={x:n,y:o},m=Dt(r),p=kt(m),h=await s.getDimensions(f),y=m==="y",w=y?"top":"left",E=y?"bottom":"right",R=y?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[m]-d[m]-i.floating[p],S=d[m]-i.reference[m],P=a==="real"?await s.getOffsetParent?.(f):c.floating;let A=c.floating[R]||i.floating[p];(!A||!await s.isElement?.(P))&&(A=c.floating[R]||i.floating[p]);const k=v/2-S/2,L=A/2-h[p]/2-1,D=Math.min(g[w],L),K=Math.min(g[E],L),_=D,T=A-h[p]-K,$=A/2-h[p]/2+k,F=gn(_,$,T),W=!l.arrow&&Re(r)!=null&&$!==F&&i.reference[p]/2-($<_?D:K)-h[p]/2<0,b=W?$<_?$-_:$-T:0;return{[m]:d[m]+b,data:{[m]:F,centerOffset:$-F-b,...W&&{alignmentOffset:b}},reset:W}}}),or=(e,t)=>({...nr(e),options:[e,t]}),rr={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,i=t===0&&n===0&&o===0&&r===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-n>=0||s.right-t>=0||s.bottom-n>=0||s.left-t>=0||i}}}},ir={sideX:"left",sideY:"top"},en="--available-width",tn="--available-height";function An(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function nn(e,t,n){const{rects:o,placement:r}=e;return{side:An(t,Q(r),n),align:Re(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Ar(e){return sr(e,qo)}function sr(e,t){const{anchor:n,positionMethod:o="absolute",side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:f=5,sticky:u=!1,arrowPadding:a=5,disableAnchorTracking:g=!1,inline:d,keepMounted:m=!1,floatingRootContext:p,mounted:h,collisionAvoidance:y,shift:w,nodeId:E,adaptiveOrigin:R,lazyFlip:v=!1,externalTree:S}=e,[P,A]=x.useState(null);!h&&P!==null&&A(null);const k=y.side||"flip",L=y.align||"flip",D=y.fallbackAxisSide||"end",K=w?.crossAxis??!1,_=w?.rootBoundary,T=typeof n=="function"?n:void 0,$=ie(T),F=T?$:n,W=ue(n),b=ue(h),H=eo()==="rtl",N=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":H?"left":"right","inline-start":H?"right":"left"}[r],be=s==="center"?N:`${N}-${s}`;let B=f;typeof B=="number"?B={top:B,right:B,bottom:B,left:B}:B&&(B={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0});const Y=1,Oe=r==="bottom"?Y:0,ke=r==="top"?Y:0,ft=r==="right"?Y:0,Ee=r==="left"?Y:0,ee={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:B},ce=x.useRef(null),De=ue(i),Se=ue(c),Ie=typeof i!="function"?i:0,_e=typeof c!="function"?c:0,te=[];d&&te.push(d),te.push(Ko(I=>{const G=nn(I,r,H),oe=typeof De.current=="function"?De.current(G):De.current,X=typeof Se.current=="function"?Se.current(G):Se.current;return{mainAxis:oe,crossAxis:X,alignmentAxis:X}},[Ie,_e,H,r]));const ve=L==="none"&&k!=="shift",Fe=!ve&&(u||K||k==="shift"),ge=k==="none"?null:Xo({...ee,padding:{top:B.top+Y+Oe,right:B.right+Y+Ee,bottom:B.bottom+Y+ke,left:B.left+Y+ft},mainAxis:!K&&k==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),Ce=ve?null:jo({...ee,rootBoundary:_,mainAxis:L!=="none",crossAxis:Fe,limiter:u||K?void 0:Yo(I=>{if(!ce.current)return{};const{width:G,height:oe}=ce.current.getBoundingClientRect(),X=J(Q(I.placement)),ae=X==="y"?G:oe,re=X==="y"?B.left+B.right:B.top+B.bottom;return{offset:ae/2+re/2}})},[ee,u,K,_,B,L]);k==="shift"||L==="shift"||s==="center"?te.push(Ce,ge):te.push(ge,Ce),te.push(Uo({...ee,apply({elements:{floating:I},availableWidth:G,availableHeight:oe,rects:X}){if(!b.current)return;const ae=I.style;ae.setProperty(en,`${G}px`),ae.setProperty(tn,`${oe}px`);const re=se(I).devicePixelRatio||1,{x:ze,y:je,width:Ye,height:ut}=X.reference,dt=(Math.round((ze+Ye)*re)-Math.round(ze*re))/re,mt=(Math.round((je+ut)*re)-Math.round(je*re))/re;ae.setProperty("--anchor-width",`${dt}px`),ae.setProperty("--anchor-height",`${mt}px`)}}),or(I=>({element:ce.current||et(I.elements.floating).createElement("div"),padding:a,offsetParent:"floating"}),[a]),{name:"transformOrigin",fn(I){const{elements:G,middlewareData:oe,placement:X,rects:ae,y:re}=I,ze=Q(X),je=J(ze),Ye=ce.current,ut=oe.arrow?.x||0,dt=oe.arrow?.y||0,mt=Ye?.clientWidth||0,Sn=Ye?.clientHeight||0,gt=ut+mt/2,Bt=dt+Sn/2,Cn=Math.abs(oe.shift?.y||0),Pn=ae.reference.height/2,He=typeof i=="function"?i(nn(I,r,H)):i,Mn=Cn>He,Tn={top:`${gt}px calc(100% + ${He}px)`,bottom:`${gt}px ${-He}px`,left:`calc(100% + ${He}px) ${Bt}px`,right:`${-He}px ${Bt}px`}[ze],Ln=`${gt}px ${ae.reference.y+Pn-re}px`;return G.floating.style.setProperty("--transform-origin",Fe&&je==="y"&&Mn?Ln:Tn),{}}},rr,R),U(()=>{!h&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,p]);const he=x.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:le,elements:ne,x:We,y:O,middlewareData:C,update:j,placement:M,context:V,isPositioned:Z,floatingStyles:Ve}=t({rootContext:p,open:m?h:void 0,placement:be,middleware:te,strategy:o,whileElementsMounted:m?void 0:(...I)=>Jt(...I,he),nodeId:E,externalTree:S}),{sideX:$e,sideY:Ne}=C.adaptiveOrigin||ir,Pe=Z?o:"fixed",Ft=x.useMemo(()=>{let I;return Z?R?I={position:Pe,[$e]:We,[Ne]:O}:I={...Ve,position:Pe}:I={position:Pe,top:0,left:0},I[en]="100vw",I[tn]="100vh",Z||(I.opacity=0),I},[R,Pe,$e,We,Ne,O,Ve,Z]),Ke=x.useRef(null);U(()=>{if(!h)return;const I=W.current,G=typeof I=="function"?I():I,X=(on(G)?G.current:G)||null||null;X!==Ke.current&&(le.setPositionReference(X),Ke.current=X)},[h,le,F,W]),x.useEffect(()=>{if(!h)return;const I=W.current;typeof I!="function"&&on(I)&&I.current!==Ke.current&&(le.setPositionReference(I.current),Ke.current=I.current)},[h,le,F,W]),x.useEffect(()=>{if(m&&h&&ne.reference&&ne.floating)return Jt(ne.reference,ne.floating,j,he)},[m,h,ne,j,he]);const Me=Q(M),Wt=An(r,Me,H),Vt=Re(M)||"center",$t=!!C.hide?.referenceHidden;U(()=>{v&&h&&Z&&Me!==N&&A(Me)},[v,h,Z,Me,N]);const zt=x.useMemo(()=>({position:"absolute",top:C.arrow?.y,left:C.arrow?.x}),[C.arrow]),Ht=C.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Ft,arrowStyles:zt,arrowRef:ce,arrowUncentered:Ht,side:Wt,align:Vt,physicalSide:Me,anchorHidden:$t,refs:le,context:V,isPositioned:Z,update:j}),[Ft,zt,ce,Ht,Wt,Vt,Me,$t,le,V,Z,j])}function on(e){return e!=null&&"current"in e}function cr(e){return e==="starting"?Xn:rn}function Or(e,t,{styles:n,transitionStatus:o,props:r,refs:i,hidden:s,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),Ct("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:s,style:l},cr(o),r],stateAttributesMapping:Un})}const lr=x.createContext(void 0);function Er(e){return x.useContext(lr)}const ar=20;function Sr(e,t,n,o){const[r,i]=x.useState(!1);U(()=>{if(!e||!t||n==null){i(!1);return}const s=et(n).documentElement.clientWidth,c=n.offsetWidth;i(s>0&&c>0&&c>=s-ar)},[e,t,n]),qn(e&&(!t||r),o)}const Ge=5;function Cr(e,t){const n=fr(t);return e.clientX>=n.left-Ge&&e.clientX<=n.right+Ge&&e.clientY>=n.top-Ge&&e.clientY<=n.bottom+Ge}function fr(e){const t=e.getBoundingClientRect(),n=se(e);if(Gn)return t;const o=n.getComputedStyle(e,"::before"),r=n.getComputedStyle(e,"::after");if(!(o.content!=="none"||r.content!=="none"))return t;const s=parseFloat(o.width)||0,c=parseFloat(o.height)||0,l=parseFloat(r.width)||0,f=parseFloat(r.height)||0,u=Math.max(t.width,s,l),a=Math.max(t.height,c,f),g=u-t.width,d=a-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-d/2,bottom:t.bottom+d/2}}const On=x.createContext(void 0);function ur(){const e=x.useContext(On);if(e===void 0)throw new Error(Wn(13));return e}const En={imageLoadingStatus:()=>null},dr=x.forwardRef(function(t,n){const{className:o,render:r,style:i,...s}=t,[c,l]=x.useState("idle"),f={imageLoadingStatus:c},u=x.useMemo(()=>({imageLoadingStatus:c,setImageLoadingStatus:l}),[c,l]),a=Ct("span",t,{state:f,ref:n,props:s,stateAttributesMapping:En});return Pt.jsx(On.Provider,{value:u,children:a})}),mr=x.forwardRef(function(t,n){const{className:o,render:r,delay:i=0,style:s,...c}=t,{imageLoadingStatus:l}=ur(),[f,u]=x.useState(i===0),a=Mt();return x.useEffect(()=>(i>0?a.start(i,()=>u(!0)):u(!0),a.clear),[a,i]),Ct("span",t,{state:{imageLoadingStatus:l},ref:n,props:c,stateAttributesMapping:En,enabled:l!=="loaded"&&(i===0||f)})});function Pr({className:e,size:t="default",...n}){return Pt.jsx(dr,{"data-slot":"avatar","data-size":t,className:an("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...n})}function Mr({className:e,...t}){return Pt.jsx(mr,{"data-slot":"avatar-fallback",className:an("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}export{Pr as A,Or as a,Mr as b,vr as c,wr as d,Rr as e,br as f,cr as g,Sr as h,Cr as i,Er as j,Do as p,ot as r,Ar as u};
@@ -1 +1 @@
1
- import{m as a,h as n,o}from"./index-Ddw_j6S-.js";import{u as d}from"./useRender-Rh7x0Dwc.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
1
+ import{m as a,h as n,o}from"./index-p-qD6BlY.js";import{u as d}from"./useRender-BBzDGtxq.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
@@ -1 +1 @@
1
- import{j as s,h as t}from"./index-Ddw_j6S-.js";function c({className:a,size:d="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":d,className:t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...r})}export{c as C};
1
+ import{j as s,h as t}from"./index-p-qD6BlY.js";function c({className:a,size:d="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":d,className:t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...r})}export{c as C};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-Ddw_j6S-.js";/**
1
+ import{c}from"./index-p-qD6BlY.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,6 @@
1
+ import{c as o}from"./index-p-qD6BlY.js";/**
2
+ * @license lucide-react v1.39.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e=o("chevron-down",n);export{e as C};
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Ddw_j6S-.js";/**
1
+ import{c as o}from"./index-p-qD6BlY.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-Ddw_j6S-.js";/**
1
+ import{c}from"./index-p-qD6BlY.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
1
- import{c as zn,aD as Z,l as Pe,aE as mt,aL as oe,b2 as bt,r as l,aQ as Jn,ae as ke,f as q,n as Ze,e as N,i as zt,k as Ae,af as Qn,j as I,ag as Jt,E as ve,b3 as Zn,ah as Pt,g as et,aH as ot,aG as er,b4 as tr,b5 as Qt,b6 as nr,aM as rr,B as Zt,h as Fe}from"./index-Ddw_j6S-.js";import{a as A,o as U,m as ge,c as Se,B as or,u as en,s as tn,y as yt,b as nn,w as rn,g as Ee,t as on,q as sn,n as sr,p as ir,i as ar}from"./label-CeY5IHdJ.js";/**
1
+ import{c as zn,aD as Z,l as Pe,aI as mt,aN as oe,b3 as bt,r as l,a9 as Jn,a8 as ke,f as K,n as Ze,e as N,i as zt,k as Ae,ab as Qn,j as I,aj as Jt,E as ve,b4 as Zn,aa as Pt,g as et,aE as ot,aF as er,b5 as tr,b6 as Qt,b7 as nr,aO as rr,B as Zt,h as Fe}from"./index-p-qD6BlY.js";import{a as A,r as U,x as ge,c as Se,C as or,u as en,m as tn,e as yt,b as nn,o as rn,g as Ee,t as on,z as sn,n as sr,y as ir,i as ar}from"./label-CuvYMIVd.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const cr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ur=zn("x",cr);function lr(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:dr,platform:fr,maxTouchPoints:pr}=lr(),tt=dr.toLowerCase(),_e=fr.toLowerCase(),St=/^i(os$|p)/.test(_e)||_e==="macintel"&&pr>1,wt="android",lt=_e===wt||tt.includes(wt),gr=!St&&_e.startsWith("mac");_e.startsWith("win");const hr=gr||St,Me=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Me&&tt.includes("firefox");!Me&&tt.includes("chrom");const mr=hr,an=/jsdom|happydom/.test(tt),dt="data-base-ui-focusable",cn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",gs="ArrowLeft",hs="ArrowRight",ms="ArrowUp",bs="ArrowDown";function ys(e,t){if(!Pe(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(A(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function st(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function br(e){return e.matches("html,body")}function un(e){return Z(e)&&e.matches(cn)}function Ss(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${cn}`)!=null}function kt(e){return e?e.getAttribute("role")==="combobox"&&un(e):!1}function Es(e){if(!e||an)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function At(e){return e?e.hasAttribute(dt)?e:e.querySelector(`[${dt}]`)||e:null}function Ve(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...Ve(e,o.id,n)])}function Ft(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function yr(e){e.preventDefault(),e.stopPropagation()}function Sr(e){return"nativeEvent"in e}function Er(e){return e.pointerType===""&&e.isTrusted?!0:lt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Rr(e){return an?!1:!lt&&e.width===0&&e.height===0||lt&&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 Rs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Tr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ts(e,t){return t<0||t>=e.length}function xs(e,t){return ln(e.current,{disabledIndices:t})}function vs(e,t){return ln(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ln(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&xr(e,s,r));return s}function xr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!Et(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function vr(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Et(e,t=e?mt(e):null){return!e||!e.isConnected||!t||vr(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Cr='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Or(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return bt(n)?n.host:null}function ft(e){for(const t of Array.from(e.children))if(oe(t)==="summary")return t;return null}function Ir(e,t){const n=ft(t);return!!n&&(e===n||A(n,e))}function dn(e){const t=e?oe(e):"";return e!=null&&e.matches(Cr)&&(t!=="summary"||e.parentElement!=null&&oe(e.parentElement)==="details"&&ft(e.parentElement)===e)&&(t!=="details"||ft(e)==null)&&(t!=="input"||e.type!=="hidden")}function fn(e){if(!dn(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Or(t)){const n=t!==e,r=oe(t)==="slot";if(t.hasAttribute("inert")||n&&oe(t)==="details"&&!t.open&&!Ir(e,t)||t.hasAttribute("hidden")||!r&&!Pr(t,n))return!1}return!0}function Pr(e,t){const n=mt(e);return t?n.display!=="none":Et(e,n)}function pn(e){const t=e.tabIndex;if(t<0){const n=oe(e);if(n==="details"||n==="audio"||n==="video"||Z(e)&&e.isContentEditable)return 0}return t}function it(e){if(oe(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function wr(e,t){const n=it(e);if(!n)return!0;const r=t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form})===n}function gn(e){if(Z(e)&&oe(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Z(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hn(e,t){gn(e).forEach(n=>{dn(n)&&t.push(n),hn(n,t)})}function mn(e,t,n){gn(e).forEach(r=>{Z(r)&&r.matches(t)&&n.push(r),mn(r,t,n)})}function Rt(e){return fn(e)&&pn(e)>=0}function bn(e){const t=[];return hn(e,t),t.filter(fn)}function Ue(e){const t=bn(e);return t.filter(n=>pn(n)>=0&&wr(n,t))}function yn(e,t){const n=Ue(e),r=n.length;if(r===0)return;const o=ge(U(e)),s=n.indexOf(o),a=s===-1?t===1?0:r-1:s+t;return n[a]}function Sn(e){return yn(U(e).body,1)||e}function En(e){return yn(U(e).body,-1)||e}function Rn(e,t){if(!e)return null;const n=Ue(U(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Cs(e){return Rn(e,1)}function Os(e){return Rn(e,-1)}function We(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!A(n,r)}function kr(e){Ue(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Mt(e){const t=[];mn(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Tn(e){l.useEffect(e,Jn)}const Be=0;class Ce{static create(){return new Ce}currentId=Be;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Be,n()},t)}isStarted(){return this.currentId!==Be}clear=()=>{this.currentId!==Be&&(clearTimeout(this.currentId),this.currentId=Be)};disposeEffect=()=>this.clear}function ze(){const e=ke(Ce.create).current;return Tn(e.disposeEffect),e}const Ge=null;class Ar{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let qe=new Ar;class ue{static create(){return new ue}static request(t){return qe.request(t)}static cancel(t){return qe.cancel(t)}currentId=Ge;request(t){this.cancel(),this.currentId=qe.request(()=>{this.currentId=Ge,t()})}cancel=()=>{this.currentId!==Ge&&(qe.cancel(this.currentId),this.currentId=Ge)};disposeEffect=()=>this.cancel}function xn(){const e=ke(ue.create).current;return Tn(e.disposeEffect),e}function he(e){return e==null?e:"current"in e?e.current:e}function Fr(e,t=!1){const n=xn();return q((r,o=null)=>{n.cancel();const s=he(e);if(s==null)return;const a=s,c=()=>{Ze.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function u(){Promise.all(a.getAnimations().map(i=>i.finished)).then(()=>{o?.aborted||c()},()=>{if(o?.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){u();return}c()})}if(t){const i="data-starting-style";if(!a.hasAttribute(i)){n.request(u);return}const d=new MutationObserver(()=>{a.hasAttribute(i)||(d.disconnect(),u())});d.observe(a,{attributes:!0,attributeFilter:[i]}),o?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(u)})}function vn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=q(o),a=Fr(r,n);l.useEffect(()=>{if(!t)return;const c=new AbortController;return a(s,c.signal),()=>{c.abort()}},[t,n,s,a])}let Dt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Mr={"data-starting-style":""},Dr={"data-ending-style":""},Cn={transitionStatus(e){return e==="starting"?Mr:e==="ending"?Dr:null}};function Nr(e,t=!1,n=!1){const[r,o]=l.useState(e&&t?"idle":void 0),[s,a]=l.useState(e);return e&&!s&&(a(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),N(()=>{if(!e&&s&&r!=="ending"&&n){const c=ue.request(()=>{o("ending")});return()=>{ue.cancel(c)}}},[e,s,r,n]),N(()=>{if(!e||t)return;const c=ue.request(()=>{o(void 0)});return()=>{ue.cancel(c)}},[t,e]),N(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=ue.request(()=>{o("idle")});return()=>{ue.cancel(c)}},[t,e,s,r]),{mounted:s,setMounted:a,transitionStatus:r}}const On=l.createContext(void 0);function Oe(e){const t=l.useContext(On);if(!e&&t===void 0)throw new Error(zt(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Dt.startingStyle]="startingStyle",e[e.endingStyle=Dt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Lr={"data-popup-open":""},Br={"data-popup-open":"","data-pressed":""},Hr={"data-open":""},Wr={"data-closed":""},jr={"data-anchor-hidden":""},Is={open(e){return e?Lr:null}},Ps={open(e){return e?Br:null}},In={open(e){return e?Hr:Wr},anchorHidden(e){return e?jr:null}},_r={...In,...Cn},Vr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:a=!1,...c}=t,u=Oe(),i=u.useState("open"),d=u.useState("nested"),R=u.useState("mounted"),f=u.useState("transitionStatus");return Ae("div",t,{state:{open:i,transitionStatus:f},ref:[u.context.backdropRef,n],stateAttributesMapping:_r,props:[{role:"presentation",hidden:!R,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:a||!d})}),Pn=l.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:a=!1,nativeButton:c=!0,...u}=t,i=Oe(),d=i.useState("open"),{getButtonProps:R,buttonRef:f}=Qn({disabled:a,native:c}),g={disabled:a};function m(x){d&&i.setOpen(!1,Se(or,x.nativeEvent))}return Ae("button",t,{state:g,ref:[n,f],props:[{onClick:m},u,R]})}),Ur=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("descriptionElementId",i),Ae("p",t,{ref:n,props:[{id:i},c]})});function D(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function we(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ke(e){const t=ke(Yr,e).current;return t.next=e,N(t.effect),t}function Yr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const wn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Gr={...wn,position:"fixed",top:0,left:0},ws={...wn,position:"absolute"},Je=l.forwardRef(function(t,n){const[r,o]=l.useState();N(()=>{mr&&Me&&o("button")},[]);const s={tabIndex:0,role:r};return I.jsx("span",{...t,ref:n,style:Gr,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Qe(e){return`data-base-ui-${e}`}let $e=0;function at(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame($e);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Jt;const a=requestAnimationFrame(s);return $e=a,()=>{$e===a&&(cancelAnimationFrame(a),$e=0)}}const ct={inert:new WeakMap,"aria-hidden":new WeakMap},Nt="data-base-ui-inert",pt={inert:new WeakSet,"aria-hidden":new WeakSet};let He=new WeakMap,ut=0;function qr(e){return pt[e]}function kn(e){return e?bt(e)?e.host:kn(e.parentNode):null}const Lt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kn(n);return e.contains(r)?r:null}).filter(n=>n!=null),Bt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Ht=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{oe(a)!=="script"&&(t.has(a)?o(a):r.push(a))})};return o(e),r};function Kr(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,c=null;const u=Lt(t,e),i=o?Ht(t,Bt(u),new Set(u)):[],d=[],R=[];if(s){const f=ct[s],g=qr(s);c=g,a=f;const m=Lt(t,Array.from(t.querySelectorAll("[aria-live]"))),x=u.concat(m);Ht(t,Bt(x),new Set(x)).forEach(S=>{const b=S.getAttribute(s),Y=b!==null&&b!=="false",v=(f.get(S)||0)+1;f.set(S,v),d.push(S),v===1&&Y&&g.add(S),Y||S.setAttribute(s,s==="inert"?"":"true")})}return o&&i.forEach(f=>{const g=(He.get(f)||0)+1;He.set(f,g),R.push(f),g===1&&f.setAttribute(Nt,"")}),ut+=1,()=>{a&&d.forEach(f=>{const m=(a.get(f)||0)-1;a.set(f,m),m||(!c?.has(f)&&s&&f.removeAttribute(s),c?.delete(f))}),o&&R.forEach(f=>{const g=(He.get(f)||0)-1;He.set(f,g),g||f.removeAttribute(Nt)}),ut-=1,ut||(ct.inert=new WeakMap,ct["aria-hidden"]=new WeakMap,pt.inert=new WeakSet,pt["aria-hidden"]=new WeakSet,He=new WeakMap)}}function Wt(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=U(e[0]).body;return Kr(e,s,n,r,{mark:o})}const ks=500,As=500,Fs={style:{transition:"none"}},$r="data-base-ui-click-trigger",Ms={fallbackAxisSide:"none"},Ds={fallbackAxisSide:"end"},Xr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},An=l.createContext(null),Fn=()=>l.useContext(An),zr=Qe("portal");function Jr(e={}){const{ref:t,container:n,componentProps:r=ve,elementProps:o}=e,s=yt(),c=Fn()?.portalNode,[u,i]=l.useState(null),[d,R]=l.useState(null),f=q(y=>{y!==null&&R(y)}),g=l.useRef(null);N(()=>{if(n===null){g.current&&(g.current=null,R(null),i(null));return}const y=(n&&(Zn(n)?n:n.current))??c??document.body;if(y==null){g.current&&(g.current=null,R(null),i(null));return}g.current!==y&&(g.current=y,R(null),i(y))},[n,c]);const m=Ae("div",r,{ref:[t,f],props:[{id:s,[zr]:""},o]}),x=u&&m?Ze.createPortal(m,u):null;return{node:d,nodeId:l.isValidElement(m)?m.props.id:void 0,subtree:x}}const Qr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,children:a,container:c,...u}=t,{node:i,nodeId:d,subtree:R}=Jr({container:c,ref:n,componentProps:t,elementProps:u}),f=l.useRef(null),g=l.useRef(null),m=l.useRef(null),x=l.useRef(null),[y,S]=l.useState(null),b=l.useRef(!1),Y=y?.modal,v=y?.open,B=!!y&&!y.modal&&y.open&&!!i;l.useEffect(()=>{if(!i||Y)return;function F(W){i&&W.relatedTarget&&We(W)&&(W.type==="focusin"?b.current&&(Mt(i),b.current=!1):(kr(i),b.current=!0))}return we(D(i,"focusin",F,!0),D(i,"focusout",F,!0))},[i,Y]),N(()=>{!i||v!==!0||!b.current||(Mt(i),b.current=!1)},[v,i]);const K=l.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:m,afterInsideRef:x,portalNode:i,setFocusManagerState:S}),[i]);return I.jsxs(l.Fragment,{children:[R,I.jsxs(An.Provider,{value:K,children:[B&&i&&I.jsx(Je,{"data-type":"outside",ref:f,onFocus:F=>{if(We(F,i))m.current?.focus();else{const W=y?y.domReference:null;En(W)?.focus()}}}),B&&i&&I.jsx("span",{"aria-owns":d,style:Xr}),i&&Ze.createPortal(a,i),B&&i&&I.jsx(Je,{"data-type":"outside",ref:g,onFocus:F=>{if(We(F,i))x.current?.focus();else{const W=y?y.domReference:null;Sn(W)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Se(tn,F.nativeEvent))}}})]})]})});function Mn(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(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)}}}class Zr{nodesRef={current:[]};events=Mn();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Dn=l.createContext(null),Nn=l.createContext(null),Tt=()=>l.useContext(Dn)?.id||null,xt=e=>{const t=l.useContext(Nn);return e??t};function Ns(e){const t=yt(),n=xt(e),r=Tt();return N(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Ls(e){const{children:t,id:n}=e,r=Tt();return I.jsx(Dn.Provider,{value:l.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Bs(e){const{children:t,externalTree:n}=e,r=ke(()=>n??new Zr).current;return I.jsx(Nn.Provider,{value:r,children:t})}function eo(e,t){const n=et(Ee(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"):""}const jt=20;let ye=[];function vt(){ye=ye.filter(e=>e.deref()?.isConnected)}function _t(e){vt(),e&&oe(e)!=="body"&&(ye.push(new WeakRef(e)),ye.length>jt&&(ye=ye.slice(-jt)))}function Vt(){return vt(),ye[ye.length-1]?.deref()}function to(e){return e?Rt(e)?e:Ue(e)[0]||e:null}function Ut(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=bn(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Rt(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function no(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:i="",nextFocusableElement:d,previousFocusableElement:R,beforeContentFocusGuardRef:f,externalTree:g,getInsideElements:m}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),S=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:Y,dataRef:v}=x.context,B=q(()=>v.current.floatingContext?.nodeId),K=o===!1,F=kt(S)&&K,W=Ke(o),M=Ke(s),X=Ke(i),me=Ke(y),_=xt(g),P=Fn(),$=l.useRef(!1),le=l.useRef(!1),se=l.useRef(!1),ie=l.useRef(null),Re=l.useRef(""),be=l.useRef(""),Te=l.useRef(null),Ie=l.useRef(null),w=Pt(Te,f,P?.beforeInsideRef),ee=Pt(Ie,P?.afterInsideRef),de=ze(),fe=ze(),De=xn(),Ye=P!=null,C=At(b),ae=q((O=C)=>O?Ue(O):[]),re=q(()=>m?.().filter(O=>O!=null)??[]);l.useEffect(()=>{if(r||!c)return;function O(G){G.key==="Tab"&&A(C,ge(U(C)))&&ae().length===0&&!F&&yr(G)}const j=U(C);return D(j,"keydown",O)},[r,C,c,F,ae]),l.useEffect(()=>{if(r||!y)return;const O=U(C);function j(){se.current=!1}function G(te){const T=Ee(te),L=re(),E=A(b,T)||A(S,T)||A(P?.portalNode,T)||L.some(V=>V===T||A(V,T));se.current=!E,be.current=te.pointerType||"keyboard",T?.closest(`[${$r}]`)&&(le.current=!0,fe.start(0,()=>{le.current=!1}))}function z(){be.current="keyboard"}return we(D(O,"pointerdown",G,!0),D(O,"pointerup",j,!0),D(O,"pointercancel",j,!0),D(O,"keydown",z,!0),j)},[r,b,S,C,y,P,fe,re]),l.useEffect(()=>{if(r||!u)return;const O=U(C);function j(){le.current=!0,fe.start(0,()=>{le.current=!1})}function G(L){const E=Ee(L);Rt(E)&&(ie.current=E)}function z(L){const E=L.relatedTarget,V=L.currentTarget,J=Ee(L);c&&E==null&&J!=null&&A(b,J)&&_t(J),queueMicrotask(()=>{const H=B(),ne=x.context.triggerElements,p=re(),h=E?.hasAttribute(Qe("focus-guard"))&&[Te.current,Ie.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,he(R),he(d)].includes(E),Q=!(A(S,E)||A(b,E)||A(E,b)||A(P?.portalNode,E)||p.some(k=>k===E||A(k,E))||ne.hasMatchingElement(k=>A(k,E))||h||_&&(Ve(_.nodesRef.current,H).find(k=>A(k.context?.elements.floating,E)||A(k.context?.elements.domReference,E))||Ft(_.nodesRef.current,H).find(k=>[k.context?.elements.floating,At(k.context?.elements.floating)].includes(E)||k.context?.elements.domReference===E)));if(V===S&&C&&Ut(C),a&&V!==S&&!Et(J)&&ge(O)===O.body){if(Z(C)&&(C.focus(),a==="popup")){De.request(()=>{C.focus()});return}const k=ae(),pe=ie.current,Ne=(pe&&k.includes(pe)?pe:null)||k[k.length-1]||C;Z(Ne)&&Ne.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(F||!c)&&E&&Q&&!le.current&&(F||E!==Vt())&&($.current=!0,x.setOpen(!1,Se(tn,L)))})}function te(){se.current||(v.current.insideReactTree=!0,de.start(0,()=>{v.current.insideReactTree=!1}))}const T=Z(S)?S:null;if(!(!b&&!T))return we(T&&D(T,"focusout",z),T&&D(T,"pointerdown",j),b&&D(b,"focusin",G),b&&D(b,"focusout",z),b&&P&&D(b,"focusout",te,!0))},[r,S,b,C,c,_,P,x,u,a,ae,F,B,v,de,fe,De,d,R,re]),l.useEffect(()=>{if(r||!b||!y)return;const O=Array.from(P?.portalNode?.querySelectorAll(`[${Qe("portal")}]`)||[]),G=(_?Ft(_.nodesRef.current,B()):[]).find(V=>kt(V.context?.elements.domReference||null))?.context?.elements.domReference,te=[...[b,...O,Te.current,Ie.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...re()],G,he(R),he(d),F?S:null].filter(V=>V!=null),T=Wt(te,{ariaHidden:c||F,mark:!1}),L=[b,...O].filter(V=>V!=null),E=Wt(L);return()=>{E(),T()}},[y,r,S,b,c,P,F,_,B,d,R,re]),N(()=>{if(!y||r||!Z(C))return;Re.current="",be.current="";const O=U(C),j=ge(O);queueMicrotask(()=>{const G=W.current,z=typeof G=="function"?G(X.current||""):G;if(z===void 0||z===!1||A(C,j))return;let T=null;const L=()=>(T==null&&(T=ae(C)),T[0]||C);let E;z===!0||z===null?E=L():E=he(z),E=E||L();const V=A(C,ge(O));at(E,{preventScroll:E===C,shouldFocus(){if(!me.current)return!1;if(V)return!0;const J=ge(O);return!(J!==E&&A(C,J))}})})},[r,y,C,ae,W,X,me]),N(()=>{if(r||!C)return;const O=U(C),j=ge(O),G=X.current==null;_t(j);function z(T){if(T.open||(Re.current=eo(T.nativeEvent,be.current)),T.reason===nn&&T.nativeEvent.type==="mouseleave"&&($.current=!0),T.reason===rn)if(T.nested)$.current=!1;else if(Er(T.nativeEvent)||Rr(T.nativeEvent))$.current=!1;else{let L=!1;U(C).createElement("div").focus({get preventScroll(){return L=!0,!1}}),L?$.current=!1:$.current=!0}}Y.on("openchange",z);function te(T){const L=M.current;let E=typeof L=="function"?L(T):L;if(E===void 0||E===!1)return null;E===null&&(E=!0);const V=S?.isConnected?S:null,J=j?.isConnected&&oe(j)!=="body"?j:null;let H=G?J||V:V||J;return H||(H=Vt()||null),typeof E=="boolean"?H:he(E)||H||null}return()=>{Y.off("openchange",z);const T=ge(O),L=re(),E=A(b,T)||L.some(ne=>ne===T||A(ne,T))||_&&Ve(_.nodesRef.current,B(),!1).some(ne=>A(ne.context?.elements.floating,T)),V=M.current,J=Re.current,H=te(J);queueMicrotask(()=>{const ne=to(H),p=typeof V!="boolean";if(V&&!$.current&&Z(ne)&&(!(!p&&ne!==T&&T!==O.body)||E)){const h={preventScroll:!0};J==="keyboard"&&(h.focusVisible=!0),ne.focus(h)}$.current=!1})}},[r,b,C,M,X,Y,_,S,B,re]),N(()=>{if(!Me||y||!b)return;const O=ge(U(b));!Z(O)||!un(O)||A(b,O)&&O.blur()},[y,b]),N(()=>{if(!(r||!P))return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:y,onOpenChange:x.setOpen,domReference:S}),()=>{P.setFocusManagerState(null)}},[r,P,c,y,x,u,S]),N(()=>{if(!(r||!C))return Ut(C),()=>{queueMicrotask(vt)}},[r,C]);const xe=!r&&(c?!F:!0)&&(Ye||c);return I.jsxs(l.Fragment,{children:[xe&&I.jsx(Je,{"data-type":"inside",ref:w,onFocus:O=>{if(c){const j=ae();at(j[j.length-1])}else P?.portalNode&&($.current=!1,We(O,P.portalNode)?Sn(S)?.focus():he(R??P.beforeOutsideRef)?.focus())}}),n,xe&&I.jsx(Je,{"data-type":"inside",ref:ee,onFocus:O=>{c?at(ae()[0]):P?.portalNode&&(u&&($.current=!0),We(O,P.portalNode)?En(S)?.focus():he(d??P.afterOutsideRef)?.focus())}})]})}function ro(){return!1}function oo(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function so(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:a=ro,bubbles:c,externalTree:u}=t,i="rootStore"in e?e.rootStore:e,d=i.useState("open"),R=i.useState("floatingElement"),{dataRef:f}=i.context,g=xt(u),m=q(typeof o=="function"?o:()=>!1),x=typeof o=="function"?m:o,y=x!==!1,S=q(()=>s),{escapeKey:b,outsidePress:Y}=oo(c),v=l.useRef(!1),B=l.useRef(!1),K=l.useRef(!1),F=l.useRef(!1),W=l.useRef(""),M=l.useRef(null),X=ze(),me=ze(),_=q(()=>{me.clear(),f.current.insideReactTree=!1}),P=q(w=>{const ee=f.current.floatingContext?.nodeId;return(g?Ve(g.nodesRef.current,ee):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[w])}),$=q(w=>st(w,i.select("floatingElement"))||st(w,i.select("domReferenceElement"))),le=q(w=>{a()&&i.setOpen(!1,Se(on,w.nativeEvent))}),se=q(w=>{if(!d||!n||!r||w.key!=="Escape"||F.current||!b&&P("__escapeKeyBubbles"))return;const ee=Sr(w)?w.nativeEvent:w,de=Se(sn,ee);i.setOpen(!1,de),de.isCanceled||w.preventDefault(),!b&&!de.isPropagationAllowed&&w.stopPropagation()}),ie=q(()=>{f.current.insideReactTree=!0,me.start(0,_)}),Re=q(w=>{if(!d||!n||w.button!==0)return;const ee=Ee(w.nativeEvent);A(i.select("floatingElement"),ee)&&(v.current||(v.current=!0,B.current=!1))}),be=q(w=>{!d||!n||(w.defaultPrevented||w.nativeEvent.defaultPrevented)&&v.current&&(B.current=!0)});l.useEffect(()=>{if(!d||!n)return _;f.current.__escapeKeyBubbles=b,f.current.__outsidePressBubbles=Y;const w=new Ce,ee=new Ce;function de(){w.clear(),F.current=!0}function fe(){w.start(Me?5:0,()=>{F.current=!1})}function De(){K.current=!0,ee.start(0,()=>{K.current=!1})}function Ye(){v.current=!1,B.current=!1}function C(){const p=W.current,h=p==="pen"||!p?"mouse":p,Q=S(),k=typeof Q=="function"?Q():Q;return typeof k=="string"?k:k[h]}function ae(p){const h=C();return h==="intentional"&&p.type!=="click"||h==="sloppy"&&p.type==="click"}function re(p){const h=f.current.floatingContext?.nodeId,Q=g&&Ve(g.nodesRef.current,h).some(k=>st(p,k.context?.elements.floating));return $(p)||Q}function xe(p){if(ae(p)){p.type!=="click"&&!$(p)&&(ee.clear(),K.current=!1),_();return}if(f.current.insideReactTree){_();return}const h=Ee(p),Q=`[${Qe("inert")}]`,k=Pe(h)?h.getRootNode():null,pe=Array.from((bt(k)?k:U(i.select("floatingElement"))).querySelectorAll(Q)),Ne=i.context.triggerElements;if(h&&(Ne.hasElement(h)||Ne.hasMatchingElement(ce=>A(ce,h))))return;let Le=Pe(h)?h:null;for(;Le&&!ot(Le);){const ce=er(Le);if(ot(ce)||!Pe(ce))break;Le=ce}if(!(pe.length&&Pe(h)&&!br(h)&&!A(h,i.select("floatingElement"))&&pe.every(ce=>!A(Le,ce)))){if(Z(h)&&!("touches"in p)){const ce=ot(h),rt=mt(h),It=/auto|scroll/,Un=ce||It.test(rt.overflowX),Yn=ce||It.test(rt.overflowY),Gn=Un&&h.clientWidth>0&&h.scrollWidth>h.clientWidth,qn=Yn&&h.clientHeight>0&&h.scrollHeight>h.clientHeight,Kn=rt.direction==="rtl",$n=qn&&(Kn?p.offsetX<=h.offsetWidth-h.clientWidth:p.offsetX>h.clientWidth),Xn=Gn&&p.offsetY>h.clientHeight;if($n||Xn)return}if(!re(p)){if(C()==="intentional"&&K.current){ee.clear(),K.current=!1;return}typeof x=="function"&&!x(p)||P("__outsidePressBubbles")||(i.setOpen(!1,Se(rn,p)),_())}}}function O(p){C()!=="sloppy"||p.pointerType==="touch"||!i.select("open")||!n||$(p)||xe(p)}function j(p){if(C()!=="sloppy"||!i.select("open")||!n||$(p))return;const h=p.touches[0];h&&(M.current={startTime:Date.now(),startX:h.clientX,startY:h.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},X.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function G(p,h){const Q=Ee(p);if(!Q)return;const k=D(Q,p.type,()=>{h(p),k()})}function z(p){W.current="touch",G(p,j)}function te(p){X.clear(),p.type==="pointerdown"&&(W.current=p.pointerType),!(p.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&G(p,h=>{h.type==="pointerdown"?O(h):xe(h)})}function T(p){if(!v.current)return;const h=B.current;if(Ye(),C()==="intentional"){if(p.type==="pointercancel"){h&&De();return}if(!re(p)){if(h){De();return}typeof x=="function"&&!x(p)||(ee.clear(),K.current=!0,_())}}}function L(p){if(C()!=="sloppy"||!M.current||$(p))return;const h=p.touches[0];if(!h)return;const Q=Math.abs(h.clientX-M.current.startX),k=Math.abs(h.clientY-M.current.startY),pe=Math.sqrt(Q*Q+k*k);pe>5&&(M.current.dismissOnTouchEnd=!0),pe>10&&(xe(p),X.clear(),M.current=null)}function E(p){G(p,L)}function V(p){C()!=="sloppy"||!M.current||$(p)||(M.current.dismissOnTouchEnd&&xe(p),X.clear(),M.current=null)}function J(p){G(p,V)}const H=U(R),ne=we(r&&we(D(H,"keydown",se),D(H,"compositionstart",de),D(H,"compositionend",fe)),y&&we(D(H,"click",te,!0),D(H,"pointerdown",te,!0),D(H,"pointerup",T,!0),D(H,"pointercancel",T,!0),D(H,"mousedown",te,!0),D(H,"mouseup",T,!0),D(H,"touchstart",z,!0),D(H,"touchmove",E,!0),D(H,"touchend",J,!0)));return()=>{ne(),w.clear(),ee.clear(),Ye(),K.current=!1,_()}},[f,R,r,y,x,d,n,b,Y,se,_,S,P,$,g,i,X]);const Te=l.useMemo(()=>({onKeyDown:se,onPointerDown:le,onClick:le}),[se,le]),Ie=l.useMemo(()=>({onKeyDown:se,onPointerDown:be,onMouseDown:be,onClickCapture:ie,onMouseDownCapture(w){ie(),Re(w)},onPointerDownCapture(w){ie(),Re(w)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[se,ie,Re,be]);return l.useMemo(()=>n?{reference:Te,floating:Ie,trigger:Te}:{},[n,Te,Ie])}var Ln=tr();const gt=[];let ht;function io(){return ht}function ao(e){gt.push(e)}function co(e){const t=(n,r)=>{const o=ke(uo).current;let s;try{ht=o;for(const a of gt)a.before(o);s=e(n,r);for(const a of gt)a.after(o);o.didInitialize=!0}finally{ht=void 0}return s};return t.displayName=e.displayName||e.name,t}function Hs(e){return l.forwardRef(co(e))}function uo(){return{didInitialize:!1}}const lo=Qt(19),fo=lo?go:ho;function Bn(e,t,n,r,o){return fo(e,t,n,r,o)}function po(e,t,n,r,o){const s=l.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Ln.useSyncExternalStore(e.subscribe,s,s)}ao({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){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),Ln.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function go(e,t,n,r,o){const s=io();if(!s)return po(e,t,n,r,o);const a=s.syncIndex;s.syncIndex+=1;let c;return s.didInitialize?(c=s.syncHooks[a],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,o))&&(c.store!==e&&(s.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=o,c.value=t(e.getSnapshot(),n,r,o))):(c={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(c)),c.value}function ho(e,t,n,r,o){return nr.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class mo{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Bn(this,t,n,r,o)}}class Hn extends mo{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){l.useDebugValue(t);const r=this;N(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;N(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);N(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){l.useDebugValue(t);const r=this,o=n!==void 0;N(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return l.useDebugValue(t),Bn(this,this.selectors[t],n,r,o)}useContextCallback(t,n){l.useDebugValue(t);const r=q(n??Jt);this.context[t]=r}useStateSetter(t){const n=l.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const a=r(s);if(!Object.is(o,a)){const c=o;o=a,n(a,c,this)}})}}const bo={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};class Ct extends Hn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Mn(),nested:r,triggerElements:s},bo),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Tr(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function yo(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:a}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),i=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,R=a,f=l.useRef(null);r===void 0&&f.current===null&&(f.current=new Ct({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:i,triggerElements:d,onOpenChange:R,floatingId:o,syncOnly:!0,nested:s}));const g=r??f.current;return t.useSyncedValue("floatingId",o),N(()=>{const m={open:c,floatingId:o,referenceElement:u,floatingElement:i};Pe(u)&&(m.domReferenceElement=u),g.state.positionReference===g.state.referenceElement&&(m.positionReference=u),g.update(m)},[c,o,u,i,g]),g.context.onOpenChange=R,g.context.nested=s,g}const So={tabIndex:-1,[dt]:""};function Eo(e){return t=>t==="touch"?e.current:!0}function Ro(e,t=!1){const n=yt(),r=Tt()!=null,o=ke(()=>e(n,r)).current;return yo({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function To({handle:e,store:t}){return N(()=>e.attachStore(t),[e,t]),null}function xo(e,t){const n=l.useRef(null),r=l.useRef(null);return l.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const a=n.current,c=r.current,u=t.context.triggerElements.getById(a);c&&u===c&&(t.context.triggerElements.delete(a),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const a=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==a&&t.set("triggerCount",a)}},[t,e])}function Wn(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function vo(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ws(e,t,n,r={}){const o=n.reason,s=o===nn,a=t&&o===ir,c=!t&&(o===on||o===sn),u=vo(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const i=()=>{const d={...r.extraState,open:t};a?d.instantType="focus":c?d.instantType="dismiss":s&&(d.instantType=void 0),Wn(d,t,n.trigger,u()),e.update(d)};s?Ze.flushSync(i):i()}function js(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=xo(e,n),a=q(u=>{const i=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:u,...i?r:null});return}d==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})}),c=l.useCallback(u=>{s(u),u&&a(u)},[s,a]);return N(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:o}}function Co(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=l.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),a=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");N(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,i={};e.state.triggerCount!==u&&(i.triggerCount=u);const d=e.select("activeTriggerId");let R=null;if(d){const f=e.context.triggerElements.getById(d);if(f)r.current=d,f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f);else{for(const[g,m]of e.context.triggerElements.entries())if(m===e.state.activeTriggerElement){i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g;break}i.activeTriggerId===void 0&&(r.current===d?R=d:r.current=null)}}else r.current=null;if(!R&&!d&&u===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[g,m]=f.value;i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),R&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===R&&!e.context.triggerElements.getById(R)){const f=Se(sr);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,a,c,n])}function Oo(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Nr(e),a=t.useState("preventUnmountingOnClose"),c=e?!1:a;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:c});const u=q(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return vn({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:s}}function Io(e,t){e.useSyncedValues(t),N(()=>()=>{e.update({activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve})},[e])}function Po(e,t){N(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),N(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class jn{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function wo(){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new jn,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ko(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:wo(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve}}function Ao(e,t,n=!1){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const je=e=>e.triggerIdProp??e.activeTriggerId,Ot=e=>e.openProp??e.open,Yt=e=>(e.popupElement?.id??e.floatingId)||void 0;function _n(e,t){return t!==void 0&&Ot(e)&&je(e)===t}function Fo(e,t){return _n(e,t)?!0:t!==void 0&&Ot(e)&&je(e)==null&&e.triggerCount===1}const Mo={open:Ot,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:je,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Yt,isTriggerActive:(e,t)=>t!==void 0&&je(e)===t,isOpenedByTrigger:(e,t)=>_n(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&je(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Fo(e,t)?Yt(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},Vn=l.createContext(void 0);function Do(){const e=l.useContext(Vn);if(e===void 0)throw new Error(zt(26));return e}const No="ArrowUp",Lo="ArrowDown",Bo="ArrowLeft",Ho="ArrowRight",Wo="Home",jo="End",_o=new Set([No,Lo,Bo,Ho,Wo,jo]),Vo="Shift",_s=[Vo,"Control","Alt","Meta"];function Uo(e){return Z(e)&&e.tagName==="INPUT"}function Vs(e){return!!(Uo(e)&&e.selectionStart!=null||Z(e)&&e.tagName==="TEXTAREA")}function Us(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const a=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const u=Gt(e,t,"left"),i=Xe(e),d=Xe(t);n==="ltr"&&(u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight?o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight:u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft&&(o=u-d.scrollMarginLeft-i.scrollPaddingLeft)),n==="rtl"&&(u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft?o=u-d.scrollMarginLeft-i.scrollPaddingLeft:u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight&&(o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight))}if(c&&r!=="horizontal"){const u=Gt(e,t,"top"),i=Xe(e),d=Xe(t);u-d.scrollMarginTop<e.scrollTop+i.scrollPaddingTop?s=u-d.scrollMarginTop-i.scrollPaddingTop:u+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-i.scrollPaddingBottom&&(s=u+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+i.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function Gt(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function Xe(e){const 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}}const Yo={...In,...Cn,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Go=l.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:a,initialFocus:c,...u}=t,i=Oe(),d=i.useState("descriptionElementId"),R=i.useState("disablePointerDismissal"),f=i.useState("floatingRootContext"),g=i.useState("popupProps"),m=i.useState("modal"),x=i.useState("mounted"),y=i.useState("nested"),S=i.useState("nestedOpenDialogCount"),b=i.useState("open"),Y=i.useState("openMethod"),v=i.useState("titleElementId"),B=i.useState("transitionStatus"),K=i.useState("role"),F=f.useState("floatingId");Do(),vn({open:b,ref:i.context.popupRef,onComplete(){b&&i.context.onOpenChangeComplete?.(!0)}});const W=c===void 0?Eo(i.context.popupRef):c,M=S>0,X=i.useStateSetter("popupElement"),_=Ae("div",t,{state:{open:b,nested:y,transitionStatus:B,nestedDialogOpen:M},props:[g,{id:F,"aria-labelledby":v,"aria-describedby":d,role:K,...So,hidden:!x,onKeyDown(P){_o.has(P.key)&&P.stopPropagation()},style:{"--nested-dialogs":S}},u],ref:[n,i.context.popupRef,X],stateAttributesMapping:Yo});return I.jsx(no,{context:f,openInteractionType:Y,disabled:!x,closeOnFocusOut:!R,initialFocus:W,returnFocus:a,modal:m!==!1,restoreFocus:"popup",children:_})});function qo(e){return Qt(19)?e:e?"true":void 0}const Ko=l.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const a=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return I.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),$o=l.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=Oe(),a=s.useState("mounted"),c=s.useState("modal"),u=s.useState("open");return a||r?I.jsx(Vn.Provider,{value:r,children:I.jsxs(Qr,{ref:n,...o,children:[a&&c===!0&&I.jsx(Ko,{ref:s.context.internalBackdropRef,inert:qo(!u)}),t.children]})}):null});let qt={},Kt={},$t="";function nt(e,t){return rr(e)?e:t}function Xt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(nt(t,n)).overflowY)}function Xo(e){if(typeof document>"u")return!1;const t=U(e);return et(t).innerWidth-t.documentElement.clientWidth>0}function zo(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=U(e),r=n.documentElement,o=n.body,s=nt(r,o),a=s.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const i=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=c,u===i}function Jo(e){const t=U(e),n=t.documentElement,r=t.body,o=nt(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Qo(e){const t=U(e),n=t.documentElement,r=t.body,o=et(n);let s=0,a=0,c=!1;const u=ue.create();if(Me&&(o.visualViewport?.scale??1)!==1)return()=>{};function i(){const g=o.getComputedStyle(n),m=o.getComputedStyle(r),S=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,qt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},$t=n.style.scrollBehavior,Kt={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};const b=n.scrollHeight>n.clientHeight,Y=n.scrollWidth>n.clientWidth,v=g.overflowY==="scroll"||m.overflowY==="scroll",B=g.overflowX==="scroll"||m.overflowX==="scroll",K=Math.max(0,o.innerWidth-r.clientWidth),F=Math.max(0,o.innerHeight-r.clientHeight),W=parseFloat(m.marginTop)+parseFloat(m.marginBottom),M=parseFloat(m.marginLeft)+parseFloat(m.marginRight),X=nt(n,r);if(c=zo(e),c){n.style.scrollbarGutter=S,X.style.overflowY="hidden",X.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(b||v)&&(n.style.overflowY="scroll"),(Y||B)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:W||F?`calc(100dvh - ${W+F}px)`:"100dvh",width:M||K?`calc(100vw - ${M+K}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,qt),Object.assign(r.style,Kt),c||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=$t)}function R(){d(),u.request(i)}i();const f=D(o,"resize",R);return()=>{u.cancel(),d(),typeof o.removeEventListener=="function"&&f()}}class Zo{lockCount=0;restore=null;timeoutLock=Ce.create();timeoutUnlock=Ce.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=U(t),r=n.documentElement,o=n.body,s=et(r);if(Xt(s,r,o)){const c=new s.MutationObserver(()=>{Xt(s,r,o)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(o,u),this.restore=()=>c.disconnect();return}const a=St||!Xo(t);this.restore=a?Jo(t):Qo(t)}}const es=new Zo;function ts(e=!0,t=null){N(()=>{if(e)return es.acquire(t)},[e,t])}function ns({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),a=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,i]=l.useState(0),[d,R]=l.useState(0),f=u===0,g=so(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(m){if(!e.context.outsidePressEnabledRef.current||"button"in m&&m.button!==0)return!1;if("touches"in m){if(m.type==="touchend"){if(m.changedTouches.length!==1||m.touches.length!==0)return!1}else if(m.touches.length!==1)return!1}const x=Ee(m);if(f&&!o){if(s){const y=e.context.internalBackdropRef.current,S=e.context.backdropRef.current;return y||S?y===x||S===x||A(x,a)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:f});return ts(r&&s===!0,a),e.useContextCallback("onNestedDialogOpen",(m,x)=>{i(m),R(x)}),N(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,d,t]),Io(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:d}),null}const rs={...Mo,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class os extends Hn{constructor(t,n,r){const o=new jn,s=ss(t,o,n,r);super(s,is(o),rs)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};Wn(r,t,n.trigger),this.update(r)}}function ss(e,t,n,r=!1){const o={...ko(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=Ao(t,n,r),o}function is(e){return{popupRef:l.createRef(),backdropRef:l.createRef(),internalBackdropRef:l.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function as(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:i,handle:d,triggerId:R,defaultTriggerId:f=null}=t,g=e==="drawer",m=u,x=c,y="dialog",S=Oe(!0),b=S!=null,Y={modal:m,disablePointerDismissal:x,nested:b,role:y},v=Ro((X,me)=>new os({open:o,openProp:r,activeTriggerId:f,triggerIdProp:R,...Y},X,me),!0);v.useControlledProp("openProp",r),v.useControlledProp("triggerIdProp",R),v.useSyncedValues(Y),v.useContextCallback("onOpenChange",s),v.useContextCallback("onOpenChangeComplete",a);const B=v.useState("open"),K=v.useState("mounted"),F=v.useState("payload");Po(v,B),Co(v);const{forceUnmount:W}=Oo(B,v);l.useImperativeHandle(i,()=>({unmount:W,close:()=>v.setOpen(!1,Se(ar))}),[W,v]);const M=B||K;return I.jsxs(On.Provider,{value:v,children:[d&&I.jsx(To,{handle:d,store:v}),M&&I.jsx(ns,{store:v,parentContext:S?.context,isDrawer:g}),typeof n=="function"?n({payload:F}):n]})}function cs(e){return as("dialog",e)}const us=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("titleElementId",i),Ae("h2",t,{ref:n,props:[{id:i},c]})});function Ys({...e}){return I.jsx(cs,{"data-slot":"dialog",...e})}function ls({...e}){return I.jsx($o,{"data-slot":"dialog-portal",...e})}function ds({className:e,...t}){return I.jsx(Vr,{"data-slot":"dialog-overlay",className:Fe("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Gs({className:e,children:t,showCloseButton:n=!0,...r}){return I.jsxs(ls,{children:[I.jsx(ds,{}),I.jsxs(Go,{"data-slot":"dialog-content",className:Fe("fixed top-1/2 left-1/2 z-50 grid grid-cols-[minmax(0,1fr)] max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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),...r,children:[t,n&&I.jsxs(Pn,{"data-slot":"dialog-close",render:I.jsx(Zt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[I.jsx(ur,{}),I.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qs({className:e,...t}){return I.jsx("div",{"data-slot":"dialog-header",className:Fe("flex flex-col gap-2",e),...t})}function Ks({className:e,showCloseButton:t=!1,children:n,...r}){return I.jsxs("div",{"data-slot":"dialog-footer",className:Fe("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&I.jsx(Pn,{render:I.jsx(Zt,{variant:"outline"}),children:"Close"})]})}function $s({className:e,...t}){return I.jsx(us,{"data-slot":"dialog-title",className:Fe("font-heading text-base leading-none font-medium",e),...t})}function Xs({className:e,...t}){return I.jsx(Ur,{"data-slot":"dialog-description",className:Fe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}export{Qe as $,vn as A,_r as B,In as C,cs as D,Ys as E,So as F,Gs as G,$s as H,qs as I,Xs as J,Ks as K,ws as L,Gr as M,Nr as N,Cn as O,jn as P,xn as Q,Hn as R,un as S,Ce as T,Rr as U,Ln as V,xt as W,ur as X,we as Y,gr as Z,Me as _,D as a,ys as a0,Es as a1,Tn as a2,Tt as a3,Ss as a4,Ve as a5,At as a6,kt as a7,at as a8,Ts as a9,yo as aA,ks as aB,Bs as aC,an as aD,We as aE,Cs as aF,Sn as aG,Os as aH,Ps as aI,Je as aJ,As as aK,Us as aL,Wo as aM,jo as aN,Vs as aO,Lo as aP,No as aQ,Bo as aR,Ho as aS,_s as aT,Vo as aU,xs as aa,vs as ab,yr as ac,ln as ad,Er as ae,gs as af,hs as ag,ms as ah,bs as ai,Et as aj,xr as ak,St as al,Fs as am,no as an,_o as ao,Qr as ap,ts as aq,Ms as ar,Fr as as,Ko as at,qo as au,Ls as av,Zr as aw,Ns as ax,vo as ay,Wn as az,Go as b,Pn as c,us as d,Ur as e,$o as f,Vr as g,Ws as h,Rs as i,ko as j,Ao as k,co as l,Co as m,Oo as n,To as o,Mo as p,so as q,Io as r,Hs as s,js as t,Ro as u,Ke as v,ze as w,Is as x,Jr as y,Ds as z};
6
+ */const cr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ur=zn("x",cr);function lr(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:dr,platform:fr,maxTouchPoints:pr}=lr(),tt=dr.toLowerCase(),_e=fr.toLowerCase(),St=/^i(os$|p)/.test(_e)||_e==="macintel"&&pr>1,wt="android",lt=_e===wt||tt.includes(wt),gr=!St&&_e.startsWith("mac");_e.startsWith("win");const hr=gr||St,Me=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Me&&tt.includes("firefox");!Me&&tt.includes("chrom");const mr=hr,an=/jsdom|happydom/.test(tt),dt="data-base-ui-focusable",cn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",gs="ArrowLeft",hs="ArrowRight",ms="ArrowUp",bs="ArrowDown";function ys(e,t){if(!Pe(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(A(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function st(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function br(e){return e.matches("html,body")}function un(e){return Z(e)&&e.matches(cn)}function Ss(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${cn}`)!=null}function kt(e){return e?e.getAttribute("role")==="combobox"&&un(e):!1}function Es(e){if(!e||an)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function At(e){return e?e.hasAttribute(dt)?e:e.querySelector(`[${dt}]`)||e:null}function Ve(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...Ve(e,o.id,n)])}function Ft(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function yr(e){e.preventDefault(),e.stopPropagation()}function Sr(e){return"nativeEvent"in e}function Er(e){return e.pointerType===""&&e.isTrusted?!0:lt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Rr(e){return an?!1:!lt&&e.width===0&&e.height===0||lt&&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 Rs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Tr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ts(e,t){return t<0||t>=e.length}function xs(e,t){return ln(e.current,{disabledIndices:t})}function vs(e,t){return ln(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ln(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&xr(e,s,r));return s}function xr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!Et(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function vr(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Et(e,t=e?mt(e):null){return!e||!e.isConnected||!t||vr(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Cr='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Or(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return bt(n)?n.host:null}function ft(e){for(const t of Array.from(e.children))if(oe(t)==="summary")return t;return null}function Ir(e,t){const n=ft(t);return!!n&&(e===n||A(n,e))}function dn(e){const t=e?oe(e):"";return e!=null&&e.matches(Cr)&&(t!=="summary"||e.parentElement!=null&&oe(e.parentElement)==="details"&&ft(e.parentElement)===e)&&(t!=="details"||ft(e)==null)&&(t!=="input"||e.type!=="hidden")}function fn(e){if(!dn(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Or(t)){const n=t!==e,r=oe(t)==="slot";if(t.hasAttribute("inert")||n&&oe(t)==="details"&&!t.open&&!Ir(e,t)||t.hasAttribute("hidden")||!r&&!Pr(t,n))return!1}return!0}function Pr(e,t){const n=mt(e);return t?n.display!=="none":Et(e,n)}function pn(e){const t=e.tabIndex;if(t<0){const n=oe(e);if(n==="details"||n==="audio"||n==="video"||Z(e)&&e.isContentEditable)return 0}return t}function it(e){if(oe(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function wr(e,t){const n=it(e);if(!n)return!0;const r=t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form})===n}function gn(e){if(Z(e)&&oe(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Z(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hn(e,t){gn(e).forEach(n=>{dn(n)&&t.push(n),hn(n,t)})}function mn(e,t,n){gn(e).forEach(r=>{Z(r)&&r.matches(t)&&n.push(r),mn(r,t,n)})}function Rt(e){return fn(e)&&pn(e)>=0}function bn(e){const t=[];return hn(e,t),t.filter(fn)}function Ue(e){const t=bn(e);return t.filter(n=>pn(n)>=0&&wr(n,t))}function yn(e,t){const n=Ue(e),r=n.length;if(r===0)return;const o=ge(U(e)),s=n.indexOf(o),a=s===-1?t===1?0:r-1:s+t;return n[a]}function Sn(e){return yn(U(e).body,1)||e}function En(e){return yn(U(e).body,-1)||e}function Rn(e,t){if(!e)return null;const n=Ue(U(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Cs(e){return Rn(e,1)}function Os(e){return Rn(e,-1)}function He(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!A(n,r)}function kr(e){Ue(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Mt(e){const t=[];mn(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Tn(e){l.useEffect(e,Jn)}const Be=0;class Ce{static create(){return new Ce}currentId=Be;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Be,n()},t)}isStarted(){return this.currentId!==Be}clear=()=>{this.currentId!==Be&&(clearTimeout(this.currentId),this.currentId=Be)};disposeEffect=()=>this.clear}function ze(){const e=ke(Ce.create).current;return Tn(e.disposeEffect),e}const Ge=null;class Ar{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let Ke=new Ar;class ue{static create(){return new ue}static request(t){return Ke.request(t)}static cancel(t){return Ke.cancel(t)}currentId=Ge;request(t){this.cancel(),this.currentId=Ke.request(()=>{this.currentId=Ge,t()})}cancel=()=>{this.currentId!==Ge&&(Ke.cancel(this.currentId),this.currentId=Ge)};disposeEffect=()=>this.cancel}function xn(){const e=ke(ue.create).current;return Tn(e.disposeEffect),e}function he(e){return e==null?e:"current"in e?e.current:e}function Fr(e,t=!1){const n=xn();return K((r,o=null)=>{n.cancel();const s=he(e);if(s==null)return;const a=s,c=()=>{Ze.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function u(){Promise.all(a.getAnimations().map(i=>i.finished)).then(()=>{o?.aborted||c()},()=>{if(o?.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){u();return}c()})}if(t){const i="data-starting-style";if(!a.hasAttribute(i)){n.request(u);return}const d=new MutationObserver(()=>{a.hasAttribute(i)||(d.disconnect(),u())});d.observe(a,{attributes:!0,attributeFilter:[i]}),o?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(u)})}function vn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=K(o),a=Fr(r,n);l.useEffect(()=>{if(!t)return;const c=new AbortController;return a(s,c.signal),()=>{c.abort()}},[t,n,s,a])}let Dt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Mr={"data-starting-style":""},Dr={"data-ending-style":""},Cn={transitionStatus(e){return e==="starting"?Mr:e==="ending"?Dr:null}};function Nr(e,t=!1,n=!1){const[r,o]=l.useState(e&&t?"idle":void 0),[s,a]=l.useState(e);return e&&!s&&(a(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),N(()=>{if(!e&&s&&r!=="ending"&&n){const c=ue.request(()=>{o("ending")});return()=>{ue.cancel(c)}}},[e,s,r,n]),N(()=>{if(!e||t)return;const c=ue.request(()=>{o(void 0)});return()=>{ue.cancel(c)}},[t,e]),N(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=ue.request(()=>{o("idle")});return()=>{ue.cancel(c)}},[t,e,s,r]),{mounted:s,setMounted:a,transitionStatus:r}}const On=l.createContext(void 0);function Oe(e){const t=l.useContext(On);if(!e&&t===void 0)throw new Error(zt(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Dt.startingStyle]="startingStyle",e[e.endingStyle=Dt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Lr={"data-popup-open":""},Br={"data-popup-open":"","data-pressed":""},Wr={"data-open":""},Hr={"data-closed":""},jr={"data-anchor-hidden":""},Is={open(e){return e?Lr:null}},Ps={open(e){return e?Br:null}},In={open(e){return e?Wr:Hr},anchorHidden(e){return e?jr:null}},_r={...In,...Cn},Vr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:a=!1,...c}=t,u=Oe(),i=u.useState("open"),d=u.useState("nested"),R=u.useState("mounted"),f=u.useState("transitionStatus");return Ae("div",t,{state:{open:i,transitionStatus:f},ref:[u.context.backdropRef,n],stateAttributesMapping:_r,props:[{role:"presentation",hidden:!R,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:a||!d})}),Pn=l.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:a=!1,nativeButton:c=!0,...u}=t,i=Oe(),d=i.useState("open"),{getButtonProps:R,buttonRef:f}=Qn({disabled:a,native:c}),g={disabled:a};function m(x){d&&i.setOpen(!1,Se(or,x.nativeEvent))}return Ae("button",t,{state:g,ref:[n,f],props:[{onClick:m},u,R]})}),Ur=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("descriptionElementId",i),Ae("p",t,{ref:n,props:[{id:i},c]})});function D(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function we(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function $e(e){const t=ke(Yr,e).current;return t.next=e,N(t.effect),t}function Yr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const wn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Gr={...wn,position:"fixed",top:0,left:0},ws={...wn,position:"absolute"},Je=l.forwardRef(function(t,n){const[r,o]=l.useState();N(()=>{mr&&Me&&o("button")},[]);const s={tabIndex:0,role:r};return I.jsx("span",{...t,ref:n,style:Gr,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Qe(e){return`data-base-ui-${e}`}let qe=0;function at(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame(qe);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Jt;const a=requestAnimationFrame(s);return qe=a,()=>{qe===a&&(cancelAnimationFrame(a),qe=0)}}const ct={inert:new WeakMap,"aria-hidden":new WeakMap},Nt="data-base-ui-inert",pt={inert:new WeakSet,"aria-hidden":new WeakSet};let We=new WeakMap,ut=0;function Kr(e){return pt[e]}function kn(e){return e?bt(e)?e.host:kn(e.parentNode):null}const Lt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kn(n);return e.contains(r)?r:null}).filter(n=>n!=null),Bt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Wt=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{oe(a)!=="script"&&(t.has(a)?o(a):r.push(a))})};return o(e),r};function $r(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,c=null;const u=Lt(t,e),i=o?Wt(t,Bt(u),new Set(u)):[],d=[],R=[];if(s){const f=ct[s],g=Kr(s);c=g,a=f;const m=Lt(t,Array.from(t.querySelectorAll("[aria-live]"))),x=u.concat(m);Wt(t,Bt(x),new Set(x)).forEach(S=>{const b=S.getAttribute(s),Y=b!==null&&b!=="false",v=(f.get(S)||0)+1;f.set(S,v),d.push(S),v===1&&Y&&g.add(S),Y||S.setAttribute(s,s==="inert"?"":"true")})}return o&&i.forEach(f=>{const g=(We.get(f)||0)+1;We.set(f,g),R.push(f),g===1&&f.setAttribute(Nt,"")}),ut+=1,()=>{a&&d.forEach(f=>{const m=(a.get(f)||0)-1;a.set(f,m),m||(!c?.has(f)&&s&&f.removeAttribute(s),c?.delete(f))}),o&&R.forEach(f=>{const g=(We.get(f)||0)-1;We.set(f,g),g||f.removeAttribute(Nt)}),ut-=1,ut||(ct.inert=new WeakMap,ct["aria-hidden"]=new WeakMap,pt.inert=new WeakSet,pt["aria-hidden"]=new WeakSet,We=new WeakMap)}}function Ht(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=U(e[0]).body;return $r(e,s,n,r,{mark:o})}const ks=500,As=500,Fs={style:{transition:"none"}},qr="data-base-ui-click-trigger",Ms={fallbackAxisSide:"none"},Ds={fallbackAxisSide:"end"},Xr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},An=l.createContext(null),Fn=()=>l.useContext(An),zr=Qe("portal");function Jr(e={}){const{ref:t,container:n,componentProps:r=ve,elementProps:o}=e,s=yt(),c=Fn()?.portalNode,[u,i]=l.useState(null),[d,R]=l.useState(null),f=K(y=>{y!==null&&R(y)}),g=l.useRef(null);N(()=>{if(n===null){g.current&&(g.current=null,R(null),i(null));return}const y=(n&&(Zn(n)?n:n.current))??c??document.body;if(y==null){g.current&&(g.current=null,R(null),i(null));return}g.current!==y&&(g.current=y,R(null),i(y))},[n,c]);const m=Ae("div",r,{ref:[t,f],props:[{id:s,[zr]:""},o]}),x=u&&m?Ze.createPortal(m,u):null;return{node:d,nodeId:l.isValidElement(m)?m.props.id:void 0,subtree:x}}const Qr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,children:a,container:c,...u}=t,{node:i,nodeId:d,subtree:R}=Jr({container:c,ref:n,componentProps:t,elementProps:u}),f=l.useRef(null),g=l.useRef(null),m=l.useRef(null),x=l.useRef(null),[y,S]=l.useState(null),b=l.useRef(!1),Y=y?.modal,v=y?.open,B=!!y&&!y.modal&&y.open&&!!i;l.useEffect(()=>{if(!i||Y)return;function F(H){i&&H.relatedTarget&&He(H)&&(H.type==="focusin"?b.current&&(Mt(i),b.current=!1):(kr(i),b.current=!0))}return we(D(i,"focusin",F,!0),D(i,"focusout",F,!0))},[i,Y]),N(()=>{!i||v!==!0||!b.current||(Mt(i),b.current=!1)},[v,i]);const $=l.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:m,afterInsideRef:x,portalNode:i,setFocusManagerState:S}),[i]);return I.jsxs(l.Fragment,{children:[R,I.jsxs(An.Provider,{value:$,children:[B&&i&&I.jsx(Je,{"data-type":"outside",ref:f,onFocus:F=>{if(He(F,i))m.current?.focus();else{const H=y?y.domReference:null;En(H)?.focus()}}}),B&&i&&I.jsx("span",{"aria-owns":d,style:Xr}),i&&Ze.createPortal(a,i),B&&i&&I.jsx(Je,{"data-type":"outside",ref:g,onFocus:F=>{if(He(F,i))x.current?.focus();else{const H=y?y.domReference:null;Sn(H)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Se(tn,F.nativeEvent))}}})]})]})});function Mn(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(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)}}}class Zr{nodesRef={current:[]};events=Mn();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Dn=l.createContext(null),Nn=l.createContext(null),Tt=()=>l.useContext(Dn)?.id||null,xt=e=>{const t=l.useContext(Nn);return e??t};function Ns(e){const t=yt(),n=xt(e),r=Tt();return N(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Ls(e){const{children:t,id:n}=e,r=Tt();return I.jsx(Dn.Provider,{value:l.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Bs(e){const{children:t,externalTree:n}=e,r=ke(()=>n??new Zr).current;return I.jsx(Nn.Provider,{value:r,children:t})}function eo(e,t){const n=et(Ee(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"):""}const jt=20;let ye=[];function vt(){ye=ye.filter(e=>e.deref()?.isConnected)}function _t(e){vt(),e&&oe(e)!=="body"&&(ye.push(new WeakRef(e)),ye.length>jt&&(ye=ye.slice(-jt)))}function Vt(){return vt(),ye[ye.length-1]?.deref()}function to(e){return e?Rt(e)?e:Ue(e)[0]||e:null}function Ut(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=bn(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Rt(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function no(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:i="",nextFocusableElement:d,previousFocusableElement:R,beforeContentFocusGuardRef:f,externalTree:g,getInsideElements:m}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),S=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:Y,dataRef:v}=x.context,B=K(()=>v.current.floatingContext?.nodeId),$=o===!1,F=kt(S)&&$,H=$e(o),M=$e(s),X=$e(i),me=$e(y),_=xt(g),P=Fn(),q=l.useRef(!1),le=l.useRef(!1),se=l.useRef(!1),ie=l.useRef(null),Re=l.useRef(""),be=l.useRef(""),Te=l.useRef(null),Ie=l.useRef(null),w=Pt(Te,f,P?.beforeInsideRef),ee=Pt(Ie,P?.afterInsideRef),de=ze(),fe=ze(),De=xn(),Ye=P!=null,C=At(b),ae=K((O=C)=>O?Ue(O):[]),re=K(()=>m?.().filter(O=>O!=null)??[]);l.useEffect(()=>{if(r||!c)return;function O(G){G.key==="Tab"&&A(C,ge(U(C)))&&ae().length===0&&!F&&yr(G)}const j=U(C);return D(j,"keydown",O)},[r,C,c,F,ae]),l.useEffect(()=>{if(r||!y)return;const O=U(C);function j(){se.current=!1}function G(te){const T=Ee(te),L=re(),E=A(b,T)||A(S,T)||A(P?.portalNode,T)||L.some(V=>V===T||A(V,T));se.current=!E,be.current=te.pointerType||"keyboard",T?.closest(`[${qr}]`)&&(le.current=!0,fe.start(0,()=>{le.current=!1}))}function z(){be.current="keyboard"}return we(D(O,"pointerdown",G,!0),D(O,"pointerup",j,!0),D(O,"pointercancel",j,!0),D(O,"keydown",z,!0),j)},[r,b,S,C,y,P,fe,re]),l.useEffect(()=>{if(r||!u)return;const O=U(C);function j(){le.current=!0,fe.start(0,()=>{le.current=!1})}function G(L){const E=Ee(L);Rt(E)&&(ie.current=E)}function z(L){const E=L.relatedTarget,V=L.currentTarget,J=Ee(L);c&&E==null&&J!=null&&A(b,J)&&_t(J),queueMicrotask(()=>{const W=B(),ne=x.context.triggerElements,p=re(),h=E?.hasAttribute(Qe("focus-guard"))&&[Te.current,Ie.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,he(R),he(d)].includes(E),Q=!(A(S,E)||A(b,E)||A(E,b)||A(P?.portalNode,E)||p.some(k=>k===E||A(k,E))||ne.hasMatchingElement(k=>A(k,E))||h||_&&(Ve(_.nodesRef.current,W).find(k=>A(k.context?.elements.floating,E)||A(k.context?.elements.domReference,E))||Ft(_.nodesRef.current,W).find(k=>[k.context?.elements.floating,At(k.context?.elements.floating)].includes(E)||k.context?.elements.domReference===E)));if(V===S&&C&&Ut(C),a&&V!==S&&!Et(J)&&ge(O)===O.body){if(Z(C)&&(C.focus(),a==="popup")){De.request(()=>{C.focus()});return}const k=ae(),pe=ie.current,Ne=(pe&&k.includes(pe)?pe:null)||k[k.length-1]||C;Z(Ne)&&Ne.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(F||!c)&&E&&Q&&!le.current&&(F||E!==Vt())&&(q.current=!0,x.setOpen(!1,Se(tn,L)))})}function te(){se.current||(v.current.insideReactTree=!0,de.start(0,()=>{v.current.insideReactTree=!1}))}const T=Z(S)?S:null;if(!(!b&&!T))return we(T&&D(T,"focusout",z),T&&D(T,"pointerdown",j),b&&D(b,"focusin",G),b&&D(b,"focusout",z),b&&P&&D(b,"focusout",te,!0))},[r,S,b,C,c,_,P,x,u,a,ae,F,B,v,de,fe,De,d,R,re]),l.useEffect(()=>{if(r||!b||!y)return;const O=Array.from(P?.portalNode?.querySelectorAll(`[${Qe("portal")}]`)||[]),G=(_?Ft(_.nodesRef.current,B()):[]).find(V=>kt(V.context?.elements.domReference||null))?.context?.elements.domReference,te=[...[b,...O,Te.current,Ie.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...re()],G,he(R),he(d),F?S:null].filter(V=>V!=null),T=Ht(te,{ariaHidden:c||F,mark:!1}),L=[b,...O].filter(V=>V!=null),E=Ht(L);return()=>{E(),T()}},[y,r,S,b,c,P,F,_,B,d,R,re]),N(()=>{if(!y||r||!Z(C))return;Re.current="",be.current="";const O=U(C),j=ge(O);queueMicrotask(()=>{const G=H.current,z=typeof G=="function"?G(X.current||""):G;if(z===void 0||z===!1||A(C,j))return;let T=null;const L=()=>(T==null&&(T=ae(C)),T[0]||C);let E;z===!0||z===null?E=L():E=he(z),E=E||L();const V=A(C,ge(O));at(E,{preventScroll:E===C,shouldFocus(){if(!me.current)return!1;if(V)return!0;const J=ge(O);return!(J!==E&&A(C,J))}})})},[r,y,C,ae,H,X,me]),N(()=>{if(r||!C)return;const O=U(C),j=ge(O),G=X.current==null;_t(j);function z(T){if(T.open||(Re.current=eo(T.nativeEvent,be.current)),T.reason===nn&&T.nativeEvent.type==="mouseleave"&&(q.current=!0),T.reason===rn)if(T.nested)q.current=!1;else if(Er(T.nativeEvent)||Rr(T.nativeEvent))q.current=!1;else{let L=!1;U(C).createElement("div").focus({get preventScroll(){return L=!0,!1}}),L?q.current=!1:q.current=!0}}Y.on("openchange",z);function te(T){const L=M.current;let E=typeof L=="function"?L(T):L;if(E===void 0||E===!1)return null;E===null&&(E=!0);const V=S?.isConnected?S:null,J=j?.isConnected&&oe(j)!=="body"?j:null;let W=G?J||V:V||J;return W||(W=Vt()||null),typeof E=="boolean"?W:he(E)||W||null}return()=>{Y.off("openchange",z);const T=ge(O),L=re(),E=A(b,T)||L.some(ne=>ne===T||A(ne,T))||_&&Ve(_.nodesRef.current,B(),!1).some(ne=>A(ne.context?.elements.floating,T)),V=M.current,J=Re.current,W=te(J);queueMicrotask(()=>{const ne=to(W),p=typeof V!="boolean";if(V&&!q.current&&Z(ne)&&(!(!p&&ne!==T&&T!==O.body)||E)){const h={preventScroll:!0};J==="keyboard"&&(h.focusVisible=!0),ne.focus(h)}q.current=!1})}},[r,b,C,M,X,Y,_,S,B,re]),N(()=>{if(!Me||y||!b)return;const O=ge(U(b));!Z(O)||!un(O)||A(b,O)&&O.blur()},[y,b]),N(()=>{if(!(r||!P))return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:y,onOpenChange:x.setOpen,domReference:S}),()=>{P.setFocusManagerState(null)}},[r,P,c,y,x,u,S]),N(()=>{if(!(r||!C))return Ut(C),()=>{queueMicrotask(vt)}},[r,C]);const xe=!r&&(c?!F:!0)&&(Ye||c);return I.jsxs(l.Fragment,{children:[xe&&I.jsx(Je,{"data-type":"inside",ref:w,onFocus:O=>{if(c){const j=ae();at(j[j.length-1])}else P?.portalNode&&(q.current=!1,He(O,P.portalNode)?Sn(S)?.focus():he(R??P.beforeOutsideRef)?.focus())}}),n,xe&&I.jsx(Je,{"data-type":"inside",ref:ee,onFocus:O=>{c?at(ae()[0]):P?.portalNode&&(u&&(q.current=!0),He(O,P.portalNode)?En(S)?.focus():he(d??P.afterOutsideRef)?.focus())}})]})}function ro(){return!1}function oo(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function so(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:a=ro,bubbles:c,externalTree:u}=t,i="rootStore"in e?e.rootStore:e,d=i.useState("open"),R=i.useState("floatingElement"),{dataRef:f}=i.context,g=xt(u),m=K(typeof o=="function"?o:()=>!1),x=typeof o=="function"?m:o,y=x!==!1,S=K(()=>s),{escapeKey:b,outsidePress:Y}=oo(c),v=l.useRef(!1),B=l.useRef(!1),$=l.useRef(!1),F=l.useRef(!1),H=l.useRef(""),M=l.useRef(null),X=ze(),me=ze(),_=K(()=>{me.clear(),f.current.insideReactTree=!1}),P=K(w=>{const ee=f.current.floatingContext?.nodeId;return(g?Ve(g.nodesRef.current,ee):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[w])}),q=K(w=>st(w,i.select("floatingElement"))||st(w,i.select("domReferenceElement"))),le=K(w=>{a()&&i.setOpen(!1,Se(on,w.nativeEvent))}),se=K(w=>{if(!d||!n||!r||w.key!=="Escape"||F.current||!b&&P("__escapeKeyBubbles"))return;const ee=Sr(w)?w.nativeEvent:w,de=Se(sn,ee);i.setOpen(!1,de),de.isCanceled||w.preventDefault(),!b&&!de.isPropagationAllowed&&w.stopPropagation()}),ie=K(()=>{f.current.insideReactTree=!0,me.start(0,_)}),Re=K(w=>{if(!d||!n||w.button!==0)return;const ee=Ee(w.nativeEvent);A(i.select("floatingElement"),ee)&&(v.current||(v.current=!0,B.current=!1))}),be=K(w=>{!d||!n||(w.defaultPrevented||w.nativeEvent.defaultPrevented)&&v.current&&(B.current=!0)});l.useEffect(()=>{if(!d||!n)return _;f.current.__escapeKeyBubbles=b,f.current.__outsidePressBubbles=Y;const w=new Ce,ee=new Ce;function de(){w.clear(),F.current=!0}function fe(){w.start(Me?5:0,()=>{F.current=!1})}function De(){$.current=!0,ee.start(0,()=>{$.current=!1})}function Ye(){v.current=!1,B.current=!1}function C(){const p=H.current,h=p==="pen"||!p?"mouse":p,Q=S(),k=typeof Q=="function"?Q():Q;return typeof k=="string"?k:k[h]}function ae(p){const h=C();return h==="intentional"&&p.type!=="click"||h==="sloppy"&&p.type==="click"}function re(p){const h=f.current.floatingContext?.nodeId,Q=g&&Ve(g.nodesRef.current,h).some(k=>st(p,k.context?.elements.floating));return q(p)||Q}function xe(p){if(ae(p)){p.type!=="click"&&!q(p)&&(ee.clear(),$.current=!1),_();return}if(f.current.insideReactTree){_();return}const h=Ee(p),Q=`[${Qe("inert")}]`,k=Pe(h)?h.getRootNode():null,pe=Array.from((bt(k)?k:U(i.select("floatingElement"))).querySelectorAll(Q)),Ne=i.context.triggerElements;if(h&&(Ne.hasElement(h)||Ne.hasMatchingElement(ce=>A(ce,h))))return;let Le=Pe(h)?h:null;for(;Le&&!ot(Le);){const ce=er(Le);if(ot(ce)||!Pe(ce))break;Le=ce}if(!(pe.length&&Pe(h)&&!br(h)&&!A(h,i.select("floatingElement"))&&pe.every(ce=>!A(Le,ce)))){if(Z(h)&&!("touches"in p)){const ce=ot(h),rt=mt(h),It=/auto|scroll/,Un=ce||It.test(rt.overflowX),Yn=ce||It.test(rt.overflowY),Gn=Un&&h.clientWidth>0&&h.scrollWidth>h.clientWidth,Kn=Yn&&h.clientHeight>0&&h.scrollHeight>h.clientHeight,$n=rt.direction==="rtl",qn=Kn&&($n?p.offsetX<=h.offsetWidth-h.clientWidth:p.offsetX>h.clientWidth),Xn=Gn&&p.offsetY>h.clientHeight;if(qn||Xn)return}if(!re(p)){if(C()==="intentional"&&$.current){ee.clear(),$.current=!1;return}typeof x=="function"&&!x(p)||P("__outsidePressBubbles")||(i.setOpen(!1,Se(rn,p)),_())}}}function O(p){C()!=="sloppy"||p.pointerType==="touch"||!i.select("open")||!n||q(p)||xe(p)}function j(p){if(C()!=="sloppy"||!i.select("open")||!n||q(p))return;const h=p.touches[0];h&&(M.current={startTime:Date.now(),startX:h.clientX,startY:h.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},X.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function G(p,h){const Q=Ee(p);if(!Q)return;const k=D(Q,p.type,()=>{h(p),k()})}function z(p){H.current="touch",G(p,j)}function te(p){X.clear(),p.type==="pointerdown"&&(H.current=p.pointerType),!(p.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&G(p,h=>{h.type==="pointerdown"?O(h):xe(h)})}function T(p){if(!v.current)return;const h=B.current;if(Ye(),C()==="intentional"){if(p.type==="pointercancel"){h&&De();return}if(!re(p)){if(h){De();return}typeof x=="function"&&!x(p)||(ee.clear(),$.current=!0,_())}}}function L(p){if(C()!=="sloppy"||!M.current||q(p))return;const h=p.touches[0];if(!h)return;const Q=Math.abs(h.clientX-M.current.startX),k=Math.abs(h.clientY-M.current.startY),pe=Math.sqrt(Q*Q+k*k);pe>5&&(M.current.dismissOnTouchEnd=!0),pe>10&&(xe(p),X.clear(),M.current=null)}function E(p){G(p,L)}function V(p){C()!=="sloppy"||!M.current||q(p)||(M.current.dismissOnTouchEnd&&xe(p),X.clear(),M.current=null)}function J(p){G(p,V)}const W=U(R),ne=we(r&&we(D(W,"keydown",se),D(W,"compositionstart",de),D(W,"compositionend",fe)),y&&we(D(W,"click",te,!0),D(W,"pointerdown",te,!0),D(W,"pointerup",T,!0),D(W,"pointercancel",T,!0),D(W,"mousedown",te,!0),D(W,"mouseup",T,!0),D(W,"touchstart",z,!0),D(W,"touchmove",E,!0),D(W,"touchend",J,!0)));return()=>{ne(),w.clear(),ee.clear(),Ye(),$.current=!1,_()}},[f,R,r,y,x,d,n,b,Y,se,_,S,P,q,g,i,X]);const Te=l.useMemo(()=>({onKeyDown:se,onPointerDown:le,onClick:le}),[se,le]),Ie=l.useMemo(()=>({onKeyDown:se,onPointerDown:be,onMouseDown:be,onClickCapture:ie,onMouseDownCapture(w){ie(),Re(w)},onPointerDownCapture(w){ie(),Re(w)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[se,ie,Re,be]);return l.useMemo(()=>n?{reference:Te,floating:Ie,trigger:Te}:{},[n,Te,Ie])}var Ln=tr();const gt=[];let ht;function io(){return ht}function ao(e){gt.push(e)}function co(e){const t=(n,r)=>{const o=ke(uo).current;let s;try{ht=o;for(const a of gt)a.before(o);s=e(n,r);for(const a of gt)a.after(o);o.didInitialize=!0}finally{ht=void 0}return s};return t.displayName=e.displayName||e.name,t}function Ws(e){return l.forwardRef(co(e))}function uo(){return{didInitialize:!1}}const lo=Qt(19),fo=lo?go:ho;function Bn(e,t,n,r,o){return fo(e,t,n,r,o)}function po(e,t,n,r,o){const s=l.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Ln.useSyncExternalStore(e.subscribe,s,s)}ao({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){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),Ln.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function go(e,t,n,r,o){const s=io();if(!s)return po(e,t,n,r,o);const a=s.syncIndex;s.syncIndex+=1;let c;return s.didInitialize?(c=s.syncHooks[a],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,o))&&(c.store!==e&&(s.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=o,c.value=t(e.getSnapshot(),n,r,o))):(c={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(c)),c.value}function ho(e,t,n,r,o){return nr.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class mo{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Bn(this,t,n,r,o)}}class Wn extends mo{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){l.useDebugValue(t);const r=this;N(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;N(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);N(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){l.useDebugValue(t);const r=this,o=n!==void 0;N(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return l.useDebugValue(t),Bn(this,this.selectors[t],n,r,o)}useContextCallback(t,n){l.useDebugValue(t);const r=K(n??Jt);this.context[t]=r}useStateSetter(t){const n=l.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const a=r(s);if(!Object.is(o,a)){const c=o;o=a,n(a,c,this)}})}}const bo={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};class Ct extends Wn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Mn(),nested:r,triggerElements:s},bo),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Tr(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function yo(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:a}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),i=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,R=a,f=l.useRef(null);r===void 0&&f.current===null&&(f.current=new Ct({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:i,triggerElements:d,onOpenChange:R,floatingId:o,syncOnly:!0,nested:s}));const g=r??f.current;return t.useSyncedValue("floatingId",o),N(()=>{const m={open:c,floatingId:o,referenceElement:u,floatingElement:i};Pe(u)&&(m.domReferenceElement=u),g.state.positionReference===g.state.referenceElement&&(m.positionReference=u),g.update(m)},[c,o,u,i,g]),g.context.onOpenChange=R,g.context.nested=s,g}const So={tabIndex:-1,[dt]:""};function Eo(e){return t=>t==="touch"?e.current:!0}function Ro(e,t=!1){const n=yt(),r=Tt()!=null,o=ke(()=>e(n,r)).current;return yo({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function To({handle:e,store:t}){return N(()=>e.attachStore(t),[e,t]),null}function xo(e,t){const n=l.useRef(null),r=l.useRef(null);return l.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const a=n.current,c=r.current,u=t.context.triggerElements.getById(a);c&&u===c&&(t.context.triggerElements.delete(a),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const a=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==a&&t.set("triggerCount",a)}},[t,e])}function Hn(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function vo(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Hs(e,t,n,r={}){const o=n.reason,s=o===nn,a=t&&o===ir,c=!t&&(o===on||o===sn),u=vo(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const i=()=>{const d={...r.extraState,open:t};a?d.instantType="focus":c?d.instantType="dismiss":s&&(d.instantType=void 0),Hn(d,t,n.trigger,u()),e.update(d)};s?Ze.flushSync(i):i()}function js(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=xo(e,n),a=K(u=>{const i=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:u,...i?r:null});return}d==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})}),c=l.useCallback(u=>{s(u),u&&a(u)},[s,a]);return N(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:o}}function Co(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=l.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),a=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");N(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,i={};e.state.triggerCount!==u&&(i.triggerCount=u);const d=e.select("activeTriggerId");let R=null;if(d){const f=e.context.triggerElements.getById(d);if(f)r.current=d,f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f);else{for(const[g,m]of e.context.triggerElements.entries())if(m===e.state.activeTriggerElement){i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g;break}i.activeTriggerId===void 0&&(r.current===d?R=d:r.current=null)}}else r.current=null;if(!R&&!d&&u===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[g,m]=f.value;i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),R&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===R&&!e.context.triggerElements.getById(R)){const f=Se(sr);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,a,c,n])}function Oo(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Nr(e),a=t.useState("preventUnmountingOnClose"),c=e?!1:a;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:c});const u=K(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return vn({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:s}}function Io(e,t){e.useSyncedValues(t),N(()=>()=>{e.update({activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve})},[e])}function Po(e,t){N(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),N(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class jn{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function wo(){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new jn,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ko(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:wo(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve}}function Ao(e,t,n=!1){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const je=e=>e.triggerIdProp??e.activeTriggerId,Ot=e=>e.openProp??e.open,Yt=e=>(e.popupElement?.id??e.floatingId)||void 0;function _n(e,t){return t!==void 0&&Ot(e)&&je(e)===t}function Fo(e,t){return _n(e,t)?!0:t!==void 0&&Ot(e)&&je(e)==null&&e.triggerCount===1}const Mo={open:Ot,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:je,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Yt,isTriggerActive:(e,t)=>t!==void 0&&je(e)===t,isOpenedByTrigger:(e,t)=>_n(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&je(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Fo(e,t)?Yt(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},Vn=l.createContext(void 0);function Do(){const e=l.useContext(Vn);if(e===void 0)throw new Error(zt(26));return e}const No="ArrowUp",Lo="ArrowDown",Bo="ArrowLeft",Wo="ArrowRight",Ho="Home",jo="End",_o=new Set([No,Lo,Bo,Wo,Ho,jo]),Vo="Shift",_s=[Vo,"Control","Alt","Meta"];function Uo(e){return Z(e)&&e.tagName==="INPUT"}function Vs(e){return!!(Uo(e)&&e.selectionStart!=null||Z(e)&&e.tagName==="TEXTAREA")}function Us(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const a=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const u=Gt(e,t,"left"),i=Xe(e),d=Xe(t);n==="ltr"&&(u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight?o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight:u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft&&(o=u-d.scrollMarginLeft-i.scrollPaddingLeft)),n==="rtl"&&(u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft?o=u-d.scrollMarginLeft-i.scrollPaddingLeft:u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight&&(o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight))}if(c&&r!=="horizontal"){const u=Gt(e,t,"top"),i=Xe(e),d=Xe(t);u-d.scrollMarginTop<e.scrollTop+i.scrollPaddingTop?s=u-d.scrollMarginTop-i.scrollPaddingTop:u+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-i.scrollPaddingBottom&&(s=u+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+i.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function Gt(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function Xe(e){const 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}}const Yo={...In,...Cn,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Go=l.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:a,initialFocus:c,...u}=t,i=Oe(),d=i.useState("descriptionElementId"),R=i.useState("disablePointerDismissal"),f=i.useState("floatingRootContext"),g=i.useState("popupProps"),m=i.useState("modal"),x=i.useState("mounted"),y=i.useState("nested"),S=i.useState("nestedOpenDialogCount"),b=i.useState("open"),Y=i.useState("openMethod"),v=i.useState("titleElementId"),B=i.useState("transitionStatus"),$=i.useState("role"),F=f.useState("floatingId");Do(),vn({open:b,ref:i.context.popupRef,onComplete(){b&&i.context.onOpenChangeComplete?.(!0)}});const H=c===void 0?Eo(i.context.popupRef):c,M=S>0,X=i.useStateSetter("popupElement"),_=Ae("div",t,{state:{open:b,nested:y,transitionStatus:B,nestedDialogOpen:M},props:[g,{id:F,"aria-labelledby":v,"aria-describedby":d,role:$,...So,hidden:!x,onKeyDown(P){_o.has(P.key)&&P.stopPropagation()},style:{"--nested-dialogs":S}},u],ref:[n,i.context.popupRef,X],stateAttributesMapping:Yo});return I.jsx(no,{context:f,openInteractionType:Y,disabled:!x,closeOnFocusOut:!R,initialFocus:H,returnFocus:a,modal:m!==!1,restoreFocus:"popup",children:_})});function Ko(e){return Qt(19)?e:e?"true":void 0}const $o=l.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const a=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return I.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),qo=l.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=Oe(),a=s.useState("mounted"),c=s.useState("modal"),u=s.useState("open");return a||r?I.jsx(Vn.Provider,{value:r,children:I.jsxs(Qr,{ref:n,...o,children:[a&&c===!0&&I.jsx($o,{ref:s.context.internalBackdropRef,inert:Ko(!u)}),t.children]})}):null});let Kt={},$t={},qt="";function nt(e,t){return rr(e)?e:t}function Xt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(nt(t,n)).overflowY)}function Xo(e){if(typeof document>"u")return!1;const t=U(e);return et(t).innerWidth-t.documentElement.clientWidth>0}function zo(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=U(e),r=n.documentElement,o=n.body,s=nt(r,o),a=s.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const i=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=c,u===i}function Jo(e){const t=U(e),n=t.documentElement,r=t.body,o=nt(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Qo(e){const t=U(e),n=t.documentElement,r=t.body,o=et(n);let s=0,a=0,c=!1;const u=ue.create();if(Me&&(o.visualViewport?.scale??1)!==1)return()=>{};function i(){const g=o.getComputedStyle(n),m=o.getComputedStyle(r),S=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,Kt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},qt=n.style.scrollBehavior,$t={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};const b=n.scrollHeight>n.clientHeight,Y=n.scrollWidth>n.clientWidth,v=g.overflowY==="scroll"||m.overflowY==="scroll",B=g.overflowX==="scroll"||m.overflowX==="scroll",$=Math.max(0,o.innerWidth-r.clientWidth),F=Math.max(0,o.innerHeight-r.clientHeight),H=parseFloat(m.marginTop)+parseFloat(m.marginBottom),M=parseFloat(m.marginLeft)+parseFloat(m.marginRight),X=nt(n,r);if(c=zo(e),c){n.style.scrollbarGutter=S,X.style.overflowY="hidden",X.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(b||v)&&(n.style.overflowY="scroll"),(Y||B)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:H||F?`calc(100dvh - ${H+F}px)`:"100dvh",width:M||$?`calc(100vw - ${M+$}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,Kt),Object.assign(r.style,$t),c||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=qt)}function R(){d(),u.request(i)}i();const f=D(o,"resize",R);return()=>{u.cancel(),d(),typeof o.removeEventListener=="function"&&f()}}class Zo{lockCount=0;restore=null;timeoutLock=Ce.create();timeoutUnlock=Ce.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=U(t),r=n.documentElement,o=n.body,s=et(r);if(Xt(s,r,o)){const c=new s.MutationObserver(()=>{Xt(s,r,o)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(o,u),this.restore=()=>c.disconnect();return}const a=St||!Xo(t);this.restore=a?Jo(t):Qo(t)}}const es=new Zo;function ts(e=!0,t=null){N(()=>{if(e)return es.acquire(t)},[e,t])}function ns({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),a=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,i]=l.useState(0),[d,R]=l.useState(0),f=u===0,g=so(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(m){if(!e.context.outsidePressEnabledRef.current||"button"in m&&m.button!==0)return!1;if("touches"in m){if(m.type==="touchend"){if(m.changedTouches.length!==1||m.touches.length!==0)return!1}else if(m.touches.length!==1)return!1}const x=Ee(m);if(f&&!o){if(s){const y=e.context.internalBackdropRef.current,S=e.context.backdropRef.current;return y||S?y===x||S===x||A(x,a)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:f});return ts(r&&s===!0,a),e.useContextCallback("onNestedDialogOpen",(m,x)=>{i(m),R(x)}),N(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,d,t]),Io(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:d}),null}const rs={...Mo,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class os extends Wn{constructor(t,n,r){const o=new jn,s=ss(t,o,n,r);super(s,is(o),rs)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};Hn(r,t,n.trigger),this.update(r)}}function ss(e,t,n,r=!1){const o={...ko(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=Ao(t,n,r),o}function is(e){return{popupRef:l.createRef(),backdropRef:l.createRef(),internalBackdropRef:l.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function as(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:i,handle:d,triggerId:R,defaultTriggerId:f=null}=t,g=e==="drawer",m=u,x=c,y="dialog",S=Oe(!0),b=S!=null,Y={modal:m,disablePointerDismissal:x,nested:b,role:y},v=Ro((X,me)=>new os({open:o,openProp:r,activeTriggerId:f,triggerIdProp:R,...Y},X,me),!0);v.useControlledProp("openProp",r),v.useControlledProp("triggerIdProp",R),v.useSyncedValues(Y),v.useContextCallback("onOpenChange",s),v.useContextCallback("onOpenChangeComplete",a);const B=v.useState("open"),$=v.useState("mounted"),F=v.useState("payload");Po(v,B),Co(v);const{forceUnmount:H}=Oo(B,v);l.useImperativeHandle(i,()=>({unmount:H,close:()=>v.setOpen(!1,Se(ar))}),[H,v]);const M=B||$;return I.jsxs(On.Provider,{value:v,children:[d&&I.jsx(To,{handle:d,store:v}),M&&I.jsx(ns,{store:v,parentContext:S?.context,isDrawer:g}),typeof n=="function"?n({payload:F}):n]})}function cs(e){return as("dialog",e)}const us=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("titleElementId",i),Ae("h2",t,{ref:n,props:[{id:i},c]})});function Ys({...e}){return I.jsx(cs,{"data-slot":"dialog",...e})}function ls({...e}){return I.jsx(qo,{"data-slot":"dialog-portal",...e})}function ds({className:e,...t}){return I.jsx(Vr,{"data-slot":"dialog-overlay",className:Fe("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Gs({className:e,children:t,showCloseButton:n=!0,...r}){return I.jsxs(ls,{children:[I.jsx(ds,{}),I.jsxs(Go,{"data-slot":"dialog-content",className:Fe("fixed top-1/2 left-1/2 z-50 grid grid-cols-[minmax(0,1fr)] max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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),...r,children:[t,n&&I.jsxs(Pn,{"data-slot":"dialog-close",render:I.jsx(Zt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[I.jsx(ur,{}),I.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ks({className:e,...t}){return I.jsx("div",{"data-slot":"dialog-header",className:Fe("flex flex-col gap-2",e),...t})}function $s({className:e,showCloseButton:t=!1,children:n,...r}){return I.jsxs("div",{"data-slot":"dialog-footer",className:Fe("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&I.jsx(Pn,{render:I.jsx(Zt,{variant:"outline"}),children:"Close"})]})}function qs({className:e,...t}){return I.jsx(us,{"data-slot":"dialog-title",className:Fe("font-heading text-base leading-none font-medium",e),...t})}function Xs({className:e,...t}){return I.jsx(Ur,{"data-slot":"dialog-description",className:Fe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}export{xn as $,vn as A,_r as B,In as C,cs as D,Ys as E,So as F,Gs as G,qs as H,Ks as I,Xs as J,$s as K,Tt as L,Ct as M,Nr as N,Bn as O,jn as P,ws as Q,Wn as R,Gr as S,Ce as T,At as U,Ps as V,Qr as W,ur as X,Ms as Y,$o as Z,Ko as _,D as a,Me as a0,no as a1,Cn as a2,_o as a3,Er as a4,Ln as a5,we as a6,gr as a7,Qe as a8,ys as a9,vs as aA,yr as aB,ln as aC,gs as aD,hs as aE,ms as aF,bs as aG,Et as aH,xr as aI,St as aJ,Fs as aK,ts as aL,an as aM,Us as aN,Ho as aO,jo as aP,Vs as aQ,Lo as aR,No as aS,Bo as aT,Wo as aU,_s as aV,Vo as aW,un as aa,Es as ab,Tn as ac,xt as ad,Ss as ae,Ve as af,Fr as ag,Ls as ah,Zr as ai,Ns as aj,vo as ak,Hn as al,yo as am,ks as an,Bs as ao,He as ap,Cs as aq,Sn as ar,Os as as,Je as at,As as au,Rr as av,kt as aw,at as ax,Ts as ay,xs as az,Go as b,Pn as c,us as d,Ur as e,qo as f,Vr as g,Hs as h,Rs as i,ko as j,Ao as k,co as l,Co as m,Oo as n,To as o,Mo as p,so as q,Io as r,Ws as s,js as t,Ro as u,$e as v,ze as w,Is as x,Jr as y,Ds as z};