@snagset/server 0.1.39 → 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.
- package/dist/app.js +79 -2
- package/dist/app.js.map +1 -1
- package/dist/config.generated.js +3 -1
- package/dist/config.generated.js.map +1 -1
- package/dist/db/migrations/0014_password_resets.sql +69 -0
- package/dist/email.js +29 -0
- package/dist/email.js.map +1 -0
- package/dist/instance/settings.js +30 -2
- package/dist/instance/settings.js.map +1 -1
- package/dist/jobs/reaper.js +13 -6
- package/dist/jobs/reaper.js.map +1 -1
- package/dist/orgs.js +42 -12
- package/dist/orgs.js.map +1 -1
- package/dist/routes/assignees.js +2 -1
- package/dist/routes/assignees.js.map +1 -1
- package/dist/routes/instance.js +50 -1
- package/dist/routes/instance.js.map +1 -1
- package/dist/routes/integrations.js +2 -1
- package/dist/routes/integrations.js.map +1 -1
- package/dist/routes/invites.js +3 -3
- package/dist/routes/invites.js.map +1 -1
- package/dist/routes/orgs.js +8 -3
- package/dist/routes/orgs.js.map +1 -1
- package/dist/routes/owner.js +52 -9
- package/dist/routes/owner.js.map +1 -1
- package/dist/routes/passwordReset.js +302 -0
- package/dist/routes/passwordReset.js.map +1 -0
- package/package.json +4 -4
- package/static/dashboard/assets/CompositeItem-B_Ebe9qQ.js +1 -0
- package/static/dashboard/assets/CompositeList-CDAPQTbv.js +1 -0
- package/static/dashboard/assets/{ConfirmDialog-D6hyhISD.js → ConfirmDialog-D1II2uNE.js} +1 -1
- package/static/dashboard/assets/{CopyButton-hyiQh1Zr.js → CopyButton-qbA2ZHWn.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-Gb3Lo5Ci.js → FieldItemContext-BM_KzVUj.js} +1 -1
- package/static/dashboard/assets/InstallTag-DTpNoMn9.js +1 -0
- package/static/dashboard/assets/InstanceRows-B1z-L92-.js +1 -0
- package/static/dashboard/assets/McpTokens-DE2t0iiS.js +1 -0
- package/static/dashboard/assets/{SaveState-CmcJ4unZ.js → SaveState-QQHqDSgx.js} +1 -1
- package/static/dashboard/assets/_app-B_DiSFIt.js +61 -0
- package/static/dashboard/assets/{_app-Dsd1bbNv.js → _app-CaDt6CPJ.js} +1 -1
- package/static/dashboard/assets/{activity-DG1e6z-2.js → activity-CzEy_J8-.js} +1 -1
- package/static/dashboard/assets/{arrow-left-CWiSdgA-.js → arrow-left-RqdORgcq.js} +1 -1
- package/static/dashboard/assets/avatar-D8S5EME4.js +1 -0
- package/static/dashboard/assets/{badge-DEvpNOzs.js → badge-anHWhPFa.js} +1 -1
- package/static/dashboard/assets/{card--8RLEIGP.js → card-C01exIzZ.js} +1 -1
- package/static/dashboard/assets/{check-XHwuM5zg.js → check-Gm9Xu4rH.js} +1 -1
- package/static/dashboard/assets/chevron-down-C-pVPOKU.js +6 -0
- package/static/dashboard/assets/{chevron-right-CG2rSUns.js → chevron-right-BQmYcugl.js} +1 -1
- package/static/dashboard/assets/{copy-eakuUTpI.js → copy-Ckk__4oN.js} +1 -1
- package/static/dashboard/assets/{dialog-D0b9dX2m.js → dialog-D5G50pSW.js} +2 -2
- package/static/dashboard/assets/dropdown-menu-Bm_opJ2p.js +11 -0
- package/static/dashboard/assets/forgot-R7JqXxs5.js +1 -0
- package/static/dashboard/assets/{image-off-DZOyJVTM.js → image-off-BtbHLgOM.js} +1 -1
- package/static/dashboard/assets/index-CoiIx5MR.css +1 -0
- package/static/dashboard/assets/index-p-qD6BlY.js +162 -0
- package/static/dashboard/assets/invite-9eotNL9V.js +1 -0
- package/static/dashboard/assets/label-CuvYMIVd.js +1 -0
- package/static/dashboard/assets/{labels-CUVq_Uf0.js → labels-DLMjYGNJ.js} +1 -1
- package/static/dashboard/assets/{layout-grid-BXWirugp.js → layout-grid-D5ek58h7.js} +1 -1
- package/static/dashboard/assets/{parts-B46j7QJi.js → parts-CN1uQywE.js} +1 -1
- package/static/dashboard/assets/{plus-yZPLf0r6.js → plus-BsxOLtMA.js} +1 -1
- package/static/dashboard/assets/reset-8K76tpdp.js +1 -0
- package/static/dashboard/assets/s._site-egkPDOj9.js +1 -0
- package/static/dashboard/assets/s._site.comments-DmrtKLHb.js +49 -0
- package/static/dashboard/assets/s._site.reviewers-CGKj-NQo.js +1 -0
- package/static/dashboard/assets/s._site.settings-DvWbfMac.js +1 -0
- package/static/dashboard/assets/serializeValue-DRMAHja_.js +1 -0
- package/static/dashboard/assets/{setup-CefvYWGy.js → setup-BDZJmgIB.js} +1 -1
- package/static/dashboard/assets/sign-in-BmweKwDv.js +1 -0
- package/static/dashboard/assets/{sign-up-nsUll0Gy.js → sign-up-C06mQl-c.js} +1 -1
- package/static/dashboard/assets/sites-CkGgns1o.js +1 -0
- package/static/dashboard/assets/studio-BHpeuJSq.js +1 -0
- package/static/dashboard/assets/studio-CG1QMBSK.js +1 -0
- package/static/dashboard/assets/studio.index-BOkmM7I5.js +1 -0
- package/static/dashboard/assets/studio.integrations-BBik3DdK.js +1 -0
- package/static/dashboard/assets/studio.members-CEKrbJHp.js +11 -0
- package/static/dashboard/assets/studio.plan-CkOzUaJM.js +1 -0
- package/static/dashboard/assets/{sun-Djjj3CUF.js → sun-DXwtJyi5.js} +1 -1
- package/static/dashboard/assets/{switch-WMRF6OK1.js → switch-cgJL6ATv.js} +1 -1
- package/static/dashboard/assets/{table-CgakQRAC.js → table-B8VTYpZO.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-obWCIEg1.js → useAriaLabelledBy-BT5NtL2E.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-DG87f6yY.js → useBaseQuery-DaFWLbWu.js} +1 -1
- package/static/dashboard/assets/useQuery-D-9vXtOo.js +1 -0
- package/static/dashboard/assets/useRender-BBzDGtxq.js +1 -0
- package/static/dashboard/assets/{useValueChanged-CHzVruZ0.js → useValueChanged-cwqHWzY1.js} +1 -1
- package/static/dashboard/assets/{users-BvfczmcS.js → users-CGY0g3mg.js} +1 -1
- package/static/dashboard/assets/{welcome-D5mKF-J3.js → welcome-CNtwDQMd.js} +3 -3
- package/static/dashboard/assets/{widget-signin-BmCBYJgF.js → widget-signin-BOUMPGXt.js} +1 -1
- package/static/dashboard/assets/you-DH4QMiND.js +1 -0
- package/static/dashboard/assets/{zod-D7wsVto4.js → zod-DfHlfdUJ.js} +1 -1
- package/static/dashboard/index.html +2 -2
- package/static/widget/build.json +2 -2
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +1 -1
- package/static/dashboard/assets/CompositeItem-Yi3wWYM7.js +0 -1
- package/static/dashboard/assets/InstallTag-BRvgfS91.js +0 -1
- package/static/dashboard/assets/McpTokens--C1TeZqq.js +0 -1
- package/static/dashboard/assets/_app-CBnYJfLp.js +0 -56
- package/static/dashboard/assets/avatar-nrKPMD7A.js +0 -1
- package/static/dashboard/assets/dropdown-menu-BMIst4Wj.js +0 -11
- package/static/dashboard/assets/index-COORBw3J.js +0 -169
- package/static/dashboard/assets/index-CpG77B7f.css +0 -1
- package/static/dashboard/assets/invite-Df7qdHBL.js +0 -1
- package/static/dashboard/assets/label-Ds2CYKth.js +0 -1
- package/static/dashboard/assets/s._site-BQiiE9w4.js +0 -1
- package/static/dashboard/assets/s._site.comments-CQYkPWo4.js +0 -54
- package/static/dashboard/assets/s._site.reviewers-BCQWB5GA.js +0 -1
- package/static/dashboard/assets/s._site.settings-D9Qix9dj.js +0 -1
- package/static/dashboard/assets/sign-in-Q4AWMmvk.js +0 -1
- package/static/dashboard/assets/sites-BKsg9Pla.js +0 -1
- package/static/dashboard/assets/studio-CSGo60dt.js +0 -1
- package/static/dashboard/assets/studio-ytRb_WCk.js +0 -1
- package/static/dashboard/assets/studio.index-Cul4Sj15.js +0 -1
- package/static/dashboard/assets/studio.integrations-CC61jGXL.js +0 -1
- package/static/dashboard/assets/studio.members-DEM1MjLy.js +0 -6
- package/static/dashboard/assets/useQuery-DT3w11tR.js +0 -1
- package/static/dashboard/assets/useRender-Bu6Vyu1g.js +0 -1
- package/static/dashboard/assets/you-Dsp9kUVS.js +0 -1
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import{u as gt,a as ft,b as ht,c as I,d as ve,r as o,e as L,f as de,g as xt,j as e,B as Z,h as w,i as ne,m as je,E as mt,k as ye,l as fe,n as bt,o as vt,p as ae,q as K,S as jt,s as ee,t as yt,L as H,v as St,M as wt,w as Nt,x as Ct,y as kt,z as Tt,O as Pt}from"./index-COORBw3J.js";import{u as Le}from"./useQuery-DT3w11tR.js";import{T as Rt,i as $e,a as Mt,D as Et,b as Ot,c as Dt,X as It,d as At,e as _t,f as Ht,g as zt,R as Lt,p as $t,h as Bt,j as Ft,k as Ut,P as qt,l as Gt,u as Vt,m as Kt,n as Yt,o as Wt,q as Xt,r as Qt,s as Jt,t as Zt,v as es,w as ts,x as ss,y as ns,z as as,A as rs,F as os,B as is,C as ls,E as Be,G as Fe,H as Ue,I as ds,J as cs,K as us}from"./dialog-D0b9dX2m.js";import{c as B,n as qe,g as ps,a as he,t as gs,d as fs,i as hs,u as xs,b as ce,L as ms,I as bs}from"./label-Ds2CYKth.js";import{g as xe,u as vs,a as js,b as ys,s as Ss,c as ws,d as Ns,e as Cs,f as ks,h as Ts,S as Ge,E as J,D as re,i as oe,j as ie,k as Se,l as te,m as D,n as V,o as Ps,p as ue}from"./dropdown-menu-BMIst4Wj.js";import{u as Ve}from"./useRender-Bu6Vyu1g.js";import{A as Rs,a as Ms}from"./avatar-nrKPMD7A.js";import{u as we,S as Es,i as Os,a as Ds}from"./labels-CUVq_Uf0.js";import{L as se}from"./layout-grid-BXWirugp.js";import{U as me}from"./users-BvfczmcS.js";import{c as Is}from"./update-duXzIzFS.js";import{P as Ke}from"./plus-yZPLf0r6.js";import{M as As,S as _s,a as Hs}from"./sun-Djjj3CUF.js";import"./useBaseQuery-DG87f6yY.js";import"./check-XHwuM5zg.js";import"./CompositeItem-Yi3wWYM7.js";import"./useValueChanged-CHzVruZ0.js";function zs(t){const s=gt({warn:t?.router===void 0}),n=t?.router||s;return ft(n.stores.__store,ht(t,n))}/**
|
|
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 Ls=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ye=I("activity",Ls);/**
|
|
7
|
-
* @license lucide-react v1.39.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const $s=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],We=I("blocks",$s);/**
|
|
12
|
-
* @license lucide-react v1.39.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Bs=[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]],Xe=I("book-open",Bs);/**
|
|
17
|
-
* @license lucide-react v1.39.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Fs=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],Ne=I("building-2",Fs);/**
|
|
22
|
-
* @license lucide-react v1.39.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const Us=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Ce=I("chevrons-up-down",Us);/**
|
|
27
|
-
* @license lucide-react v1.39.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const qs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Gs=I("circle-question-mark",qs);/**
|
|
32
|
-
* @license lucide-react v1.39.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const Vs=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Ks=I("log-out",Vs);/**
|
|
37
|
-
* @license lucide-react v1.39.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const Ys=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],be=I("message-square",Ys);/**
|
|
42
|
-
* @license lucide-react v1.39.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Ws=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Xs=I("panel-left",Ws);/**
|
|
47
|
-
* @license lucide-react v1.39.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const Qs=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Qe=I("sliders-horizontal",Qs);/**
|
|
52
|
-
* @license lucide-react v1.39.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const Js=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Je=I("user",Js),Zs=[["mcp-tokens"],["instance"],["integrations"],["invites"],["members"]];function en(){const t=we().user.role,s=ve(),n=o.useRef(t);o.useEffect(()=>{if(n.current!==t){n.current=t;for(const a of Zs)s.resetQueries({queryKey:a})}},[t,s])}const pe=768;function tn(){const[t,s]=o.useState(void 0);return o.useEffect(()=>{const n=window.matchMedia(`(max-width: ${pe-1}px)`),a=()=>{s(window.innerWidth<pe)};return n.addEventListener("change",a),s(window.innerWidth<pe),()=>n.removeEventListener("change",a)},[]),!!t}const sn=o.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Rt,currentIdRef:{current:null},currentContextRef:{current:null}});function nn(t,s){t.current=s.current}function an(t,s={open:!1}){const{open:n}=s,a="rootStore"in t?t.rootStore:t,r=a.useState("floatingId"),p=o.useContext(sn),{currentIdRef:d,delayRef:l,timeoutMs:x,initialDelayRef:c,currentContextRef:g,hasProvider:b,timeout:h}=p,[j,i]=o.useState(!1),S=o.useRef(n);return L(()=>{S.current=n},[n]),L(()=>{function f(){g.current?.setIsInstantPhase(!1),d.current=null,g.current=null,l.current=c.current,h.clear()}if(d.current&&!n&&d.current===r){if(i(!1),x){const m=r;return h.start(x,()=>{a.select("open")||d.current&&d.current!==m||f()}),()=>{(S.current||d.current!==m)&&h.clear()}}f()}},[n,r,d,l,x,c,g,h,a]),L(()=>{if(!n)return;const f=g.current,m=d.current;h.clear(),g.current={onOpenChange:a.setOpen,setIsInstantPhase:i},d.current=r,l.current={open:0,close:xe(c.current,"close")},m!==null&&m!==r?(i(!0),f?.setIsInstantPhase(!0),f?.onOpenChange(!1,B(qe))):(i(!1),f?.setIsInstantPhase(!1))},[n,r,a,d,l,c,g,h]),L(()=>()=>{if(d.current===r){if(g.current=null,!S.current)return;d.current=null,nn(l,c),h.clear()}},[g,d,l,r,c,h]),o.useMemo(()=>({hasProvider:b,delayRef:l,isInstantPhase:j}),[b,l,j])}function rn(t,s){let n=null,a=null,r=!1;return{contextElement:t||void 0,getBoundingClientRect(){const p=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=s.axis==="x"||s.axis==="both",l=s.axis==="y"||s.axis==="both",x=["mouseenter","mousemove"].includes(s.dataRef.current.openEvent?.type||"")&&s.pointerType!=="touch";let c=p.width,g=p.height,b=p.x,h=p.y;return n==null&&s.x&&d&&(n=p.x-s.x),a==null&&s.y&&l&&(a=p.y-s.y),b-=n||0,h-=a||0,c=0,g=0,!r||x?(c=s.axis==="y"?p.width:0,g=s.axis==="x"?p.height:0,b=d&&s.x!=null?s.x:b,h=l&&s.y!=null?s.y:h):r&&!x&&(g=s.axis==="x"?p.height:g,c=s.axis==="y"?p.width:c),r=!0,{width:c,height:g,x:b,y:h,top:h,right:b+c,bottom:h+g,left:b}}}}function Ie(t){return t!=null&&t.clientX!=null}function on(t,s={}){const{enabled:n=!0,axis:a="both"}=s,r="rootStore"in t?t.rootStore:t,p=r.useState("open"),d=r.useState("floatingElement"),l=r.useState("domReferenceElement"),x=r.context.dataRef,c=o.useRef(!1),g=o.useRef(null),[b,h]=o.useState(),[j,i]=o.useState([]),S=de(v=>{r.set("positionReference",v)}),f=de((v,y,R)=>{c.current||x.current.openEvent&&!Ie(x.current.openEvent)||r.set("positionReference",rn(R??l,{x:v,y,axis:a,dataRef:x,pointerType:b}))}),m=de(v=>{p?g.current||(f(v.clientX,v.clientY,v.currentTarget),i([])):f(v.clientX,v.clientY,v.currentTarget)}),C=$e(b)?d:p;o.useEffect(()=>{if(!n){S(l);return}if(!C)return;function v(){g.current?.(),g.current=null}const y=xt(d);function R(P){const u=ps(P);he(d,u)?v():f(P.clientX,P.clientY)}return!x.current.openEvent||Ie(x.current.openEvent)?g.current=Mt(y,"mousemove",R):S(l),v},[C,n,d,x,l,r,f,S,j]),o.useEffect(()=>()=>{r.set("positionReference",null)},[r]),o.useEffect(()=>{n&&!d&&(c.current=!1)},[n,d]),o.useEffect(()=>{!n&&p&&(c.current=!0)},[n,p]);const N=o.useMemo(()=>{function v(y){h(y.pointerType)}return{onPointerDown:v,onPointerEnter:v,onMouseMove:m,onMouseEnter:m}},[m]);return o.useMemo(()=>n?{reference:N,trigger:N}:{},[n,N])}function ln({...t}){return e.jsx(Et,{"data-slot":"sheet",...t})}function dn({...t}){return e.jsx(Ht,{"data-slot":"sheet-portal",...t})}function cn({className:t,...s}){return e.jsx(zt,{"data-slot":"sheet-overlay",className:w("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",t),...s})}function un({className:t,children:s,side:n="right",showCloseButton:a=!0,...r}){return e.jsxs(dn,{children:[e.jsx(cn,{}),e.jsxs(Ot,{"data-slot":"sheet-content","data-side":n,className:w("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...r,children:[s,a&&e.jsxs(Dt,{"data-slot":"sheet-close",render:e.jsx(Z,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[e.jsx(It,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function pn({className:t,...s}){return e.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-0.5 p-4",t),...s})}function gn({className:t,...s}){return e.jsx(At,{"data-slot":"sheet-title",className:w("font-heading text-base font-medium text-foreground",t),...s})}function fn({className:t,...s}){return e.jsx(_t,{"data-slot":"sheet-description",className:w("text-sm text-muted-foreground",t),...s})}const Ze=o.createContext(void 0);function Y(t){const s=o.useContext(Ze);if(s===void 0&&!t)throw new Error(ne(72));return s}const hn={...$t,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class xn extends Lt{constructor(s,n,a){const r=new qt;super(mn(s,r,n,a),bn(r),hn)}setOpen=(s,n)=>{Bt(this,s,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(s){this.state.floatingRootContext.dispatchOpenChange(!1,B(gs,s))}}function mn(t,s,n,a=!1){const r={...Ft(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t};return r.floatingRootContext=Ut(s,n,a),r}function bn(t){return{popupRef:o.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const vn=Gt(function(s){const{disabled:n=!1,defaultOpen:a=!1,open:r,disableHoverablePopup:p=!1,trackCursorAxis:d="none",actionsRef:l,onOpenChange:x,onOpenChangeComplete:c,handle:g,triggerId:b,defaultTriggerId:h=null,children:j}=s,i=Vt(($,F)=>new xn({open:a,openProp:r,activeTriggerId:h,triggerIdProp:b},$,F));i.useControlledProp("openProp",r),i.useControlledProp("triggerIdProp",b),i.useContextCallback("onOpenChange",x),i.useContextCallback("onOpenChangeComplete",c);const S=i.useState("open"),f=!n&&S,m=i.useState("activeTriggerId"),C=i.useState("mounted"),N=i.useState("payload");i.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:p,disabled:n}),Kt(i,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:v,transitionStatus:y}=Yt(f,i),R=i.useState("isInstantPhase"),P=i.useState("instantType"),u=i.useState("lastOpenChangeReason"),k=o.useRef(null);L(()=>{S&&n&&i.setOpen(!1,B(fs))},[S,n,i]),L(()=>{y==="ending"&&u===qe||y!=="ending"&&R?(P!=="delay"&&(k.current=P),i.set("instantType","delay")):k.current!==null&&(i.set("instantType",k.current),k.current=null)},[y,R,u,P,i]),L(()=>{f&&m==null&&i.set("payload",void 0)},[i,m,f]),o.useImperativeHandle(l,()=>({unmount:v,close:()=>i.setOpen(!1,B(hs))}),[v,i]);const A=f||C||!n&&d!=="none";return e.jsxs(Ze.Provider,{value:i,children:[g&&e.jsx(Wt,{handle:g,store:i}),A&&e.jsx(jn,{store:i,disabled:n,trackCursorAxis:d}),typeof j=="function"?j({payload:N}):j]})});function jn({store:t,disabled:s,trackCursorAxis:n}){const a=t.useState("floatingRootContext"),r=Xt(a,{enabled:!s,referencePress:()=>t.select("closeOnClick")}),p=on(a,{enabled:!s&&n!=="none",axis:n==="none"?void 0:n}),d=o.useMemo(()=>je(p.reference,r.reference),[p.reference,r.reference]);return Qt(t,{activeTriggerProps:d,inactiveTriggerProps:d,popupProps:r.floating??mt}),null}const yn=o.createContext(void 0);function Sn(){return o.useContext(yn)}const Ae=600,et="data-base-ui-tooltip-trigger";function _e(t){if("composedPath"in t){const n=t.composedPath();for(let a=0;a<n.length;a+=1){const r=n[a];if(fe(r))return r}}const s=t.target;return fe(s)?s:null}function wn(t){let s=t;for(;s;){const n=s.closest(`[${et}]`);if(n)return n;const a=s.getRootNode();s="host"in a&&fe(a.host)?a.host:null}return null}const Nn=Jt(function(s,n){const{render:a,className:r,style:p,handle:d,payload:l,disabled:x,delay:c,closeOnClick:g=!0,closeDelay:b,id:h,...j}=s,i=Y(!0),f=vs(d)??i;if(!f)throw new Error(ne(82));const m=xs(h),C=f.useState("isTriggerActive",m),N=f.useState("isOpenedByTrigger",m),v=f.useState("floatingRootContext"),y=o.useRef(null),R=c??Ae,P=b??0,{registerTrigger:u,isMountedByThisTrigger:k}=Zt(m,y,f,{payload:l,closeOnClick:g,closeDelay:P}),A=Sn(),{delayRef:$,isInstantPhase:F,hasProvider:M}=an(v,{open:N}),U=js(v);f.useSyncedValue("isInstantPhase",F);const le=f.useState("disabled"),q=x??le,Te=es(q),Pe=f.useState("trackCursorAxis"),ot=f.useState("disableHoverablePopup"),G=o.useRef(!1),W=ts(),X=o.useRef(void 0);function Re(){return M?xe($.current,"open")===0?0:c??A??Ae:R}function Me(T){const _=y.current;if(!_||!T)return!1;const z=wn(T);return z!==null&&z!==_&&he(_,z)}function it(T){const _=Me(T);return G.current=_,_&&(U.openChangeTimeout.clear(),U.restTimeout.clear(),U.restTimeoutPending=!1,W.clear()),_}const lt=ys(v,{enabled:!q,mouseOnly:!0,move:!1,handleClose:!ot&&Pe!=="both"?Ss():null,restMs:Re,delay(){return b==null&&M?{close:xe($.current,"close")}:{close:P}},triggerElementRef:y,isActiveTrigger:C,isClosing:()=>f.select("transitionStatus")==="ending",shouldOpen(){return!G.current}}),dt=ws(v,{enabled:!q}).reference,ct=T=>{const _=G.current,z=_e(T),Ee=it(z),Q=y.current,pt=Q&&z&&he(Q,z);if(Ee&&f.select("open")&&f.select("lastOpenChangeReason")===ce){f.setOpen(!1,B(ce,T));return}if(_&&!Ee&&pt&&!Te.current&&!f.select("open")&&Q&&$e(X.current)){const Oe=()=>{!G.current&&!Te.current&&!f.select("open")&&f.setOpen(!0,B(ce,T,Q))},De=Re();De===0?(W.clear(),Oe()):W.start(De,Oe)}},ut=f.useState("triggerProps",k);return ye("button",s,{state:{open:N},ref:[n,u,y],props:[lt,dt,k||Pe!=="none"?ut:void 0,{onMouseOver(T){ct(T.nativeEvent)},onFocus(T){Me(_e(T.nativeEvent))&&T.preventBaseUIHandler()},onMouseLeave(){G.current=!1,W.clear(),X.current=void 0},onPointerEnter(T){X.current=T.pointerType},onPointerDown(T){X.current=T.pointerType,f.set("closeOnClick",g),g&&!f.select("open")&&f.cancelPendingOpen(T.nativeEvent)},onClick(T){g&&!f.select("open")&&f.cancelPendingOpen(T.nativeEvent)},id:m,"data-trigger-disabled":q?"":void 0,[et]:q?void 0:""},j],stateAttributesMapping:ss})}),tt=o.createContext(void 0);function Cn(){const t=o.useContext(tt);if(t===void 0)throw new Error(ne(70));return t}const kn=o.forwardRef(function(s,n){const{children:a,container:r,className:p,render:d,style:l,...x}=s,{node:c,subtree:g}=ns({container:r,ref:n,componentProps:s,elementProps:x});return!g&&!c?null:e.jsxs(o.Fragment,{children:[g,c&&bt.createPortal(a,c)]})}),Tn=o.forwardRef(function(s,n){const{keepMounted:a=!1,...r}=s;return Y().useState("mounted")||a?e.jsx(tt.Provider,{value:a,children:e.jsx(kn,{ref:n,...r})}):null}),st=o.createContext(void 0);function nt(){const t=o.useContext(st);if(t===void 0)throw new Error(ne(71));return t}const Pn=o.forwardRef(function(s,n){const{render:a,className:r,anchor:p,positionMethod:d="absolute",side:l="top",align:x="center",sideOffset:c=0,alignOffset:g=0,collisionBoundary:b="clipping-ancestors",collisionPadding:h=5,arrowPadding:j=5,sticky:i=!1,disableAnchorTracking:S=!1,collisionAvoidance:f=as,style:m,...C}=s,N=Y(),v=Cn(),y=N.useState("open"),R=N.useState("mounted"),P=N.useState("trackCursorAxis"),u=N.useState("disableHoverablePopup"),k=N.useState("floatingRootContext"),A=N.useState("instantType"),$=N.useState("transitionStatus"),F=N.useState("adaptiveOrigin"),M=Ns({anchor:p,positionMethod:d,floatingRootContext:k,mounted:R,side:l,sideOffset:c,align:x,alignOffset:g,collisionBoundary:b,collisionPadding:h,sticky:i,arrowPadding:j,disableAnchorTracking:S,keepMounted:v,collisionAvoidance:f,adaptiveOrigin:F}),U=o.useMemo(()=>({open:y,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:P!=="none"?"tracking-cursor":A}),[y,M.side,M.align,M.anchorHidden,P,A]),le=Cs(s,U,{styles:M.positionerStyles,transitionStatus:$,props:C,refs:[n,N.useStateSetter("positionerElement")],hidden:!R,inert:!y||P==="both"||u});return e.jsx(st.Provider,{value:M,children:le})}),Rn=o.forwardRef(function(s,n){const{render:a,className:r,style:p,...d}=s,l=Y(),{side:x,align:c}=nt(),g=l.useState("open"),b=l.useState("instantType"),h=l.useState("transitionStatus"),j=l.useState("popupProps"),i=l.useState("floatingRootContext"),S=l.useState("disabled"),f=l.useState("closeDelay");rs({open:g,ref:l.context.popupRef,onComplete(){g&&l.context.onOpenChangeComplete?.(!0)}}),ks(i,{enabled:!S,closeDelay:f});const m=l.useStateSetter("popupElement");return ye("div",s,{state:{open:g,side:x,align:c,instant:b,transitionStatus:h},ref:[n,l.context.popupRef,m],props:[os,j,Ts(h),d],stateAttributesMapping:is})}),Mn=o.forwardRef(function(s,n){const{render:a,className:r,style:p,...d}=s,l=Y(),{arrowRef:x,side:c,align:g,arrowUncentered:b,arrowStyles:h}=nt(),j=l.useState("open"),i=l.useState("instantType");return ye("div",s,{state:{open:j,side:c,align:g,uncentered:b,instant:i},ref:[n,x],props:[{style:h,"aria-hidden":!0},d],stateAttributesMapping:ls})});function En({...t}){return e.jsx(vn,{"data-slot":"tooltip",...t})}function On({...t}){return e.jsx(Nn,{"data-slot":"tooltip-trigger",...t})}function Dn({className:t,side:s="top",sideOffset:n=4,align:a="center",alignOffset:r=0,children:p,...d}){return e.jsx(Tn,{children:e.jsx(Pn,{align:a,alignOffset:r,side:s,sideOffset:n,className:"isolate z-50",children:e.jsxs(Rn,{"data-slot":"tooltip-content",className:w("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 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",t),...d,children:[p,e.jsx(Mn,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const In="sidebar_state",An=3600*24*7,_n="16rem",Hn="18rem",zn="3rem",Ln="b",at=o.createContext(null);function ke(){const t=o.useContext(at);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function $n({defaultOpen:t=!0,open:s,onOpenChange:n,className:a,style:r,children:p,...d}){const l=tn(),[x,c]=o.useState(!1),[g,b]=o.useState(t),h=s??g,j=o.useCallback(m=>{const C=typeof m=="function"?m(h):m;n?n(C):b(C),document.cookie=`${In}=${C}; path=/; max-age=${An}`},[n,h]),i=o.useCallback(()=>l?c(m=>!m):j(m=>!m),[l,j,c]);o.useEffect(()=>{const m=C=>{C.key===Ln&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),i())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i]);const S=h?"expanded":"collapsed",f=o.useMemo(()=>({state:S,open:h,setOpen:j,isMobile:l,openMobile:x,setOpenMobile:c,toggleSidebar:i}),[S,h,j,l,x,c,i]);return e.jsx(at.Provider,{value:f,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":_n,"--sidebar-width-icon":zn,...r},className:w("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...d,children:p})})}function Bn({side:t="left",variant:s="sidebar",collapsible:n="offcanvas",className:a,children:r,dir:p,...d}){const{isMobile:l,state:x,openMobile:c,setOpenMobile:g}=ke();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:w("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...d,children:r}):l?e.jsx(ln,{open:c,onOpenChange:g,...d,children:e.jsxs(un,{dir:p,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Hn},side:t,children:[e.jsxs(pn,{className:"sr-only",children:[e.jsx(gn,{children:"Sidebar"}),e.jsx(fn,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:r})]})}):e.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":x,"data-collapsible":x==="collapsed"?n:"","data-variant":s,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:w("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container","data-side":t,className:w("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...d,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:r})})]})}function Fn({className:t,onClick:s,...n}){const{toggleSidebar:a}=ke();return e.jsxs(Z,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:w(t),onClick:r=>{s?.(r),a()},...n,children:[e.jsx(Xs,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Un({className:t,...s}){return e.jsx("main",{"data-slot":"sidebar-inset",className:w("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...s})}function qn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:w("flex flex-col gap-2 p-2",t),...s})}function Gn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:w("flex flex-col gap-2 p-2",t),...s})}function Vn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:w("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s})}function He({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:w("relative flex w-full min-w-0 flex-col p-2",t),...s})}function Kn({className:t,render:s,...n}){return Ve({defaultTagName:"div",props:je({className:w("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",t)},n),render:s,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function ze({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:w("w-full text-sm",t),...s})}function ge({className:t,...s}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:w("flex w-full min-w-0 flex-col gap-0",t),...s})}function E({className:t,...s}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:w("group/menu-item relative",t),...s})}const Yn=vt("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function O({render:t,isActive:s=!1,variant:n="default",size:a="default",tooltip:r,className:p,...d}){const{isMobile:l,state:x}=ke(),c=Ve({defaultTagName:"button",props:je({className:w(Yn({variant:n,size:a}),p)},d),render:r?e.jsx(On,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:s}});return r?(typeof r=="string"&&(r={children:r}),e.jsxs(En,{children:[c,e.jsx(Dn,{side:"right",align:"center",hidden:x!=="collapsed"||l,...r})]})):c}function Wn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:w("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",t),...s})}function Xn({open:t,onOpenChange:s}){const n=we(),a=ae(),[r,p]=o.useState(""),[d,l]=o.useState(0),x=o.useRef(null),c=r.trim(),[g,b]=o.useState("");o.useEffect(()=>{const u=setTimeout(()=>b(c),180);return()=>clearTimeout(u)},[c]);const h=Le({queryKey:["activity","search",g],queryFn:()=>ee.activity({q:g,status:"all",limit:8}),enabled:t&&g.length>=2,staleTime:3e4});o.useEffect(()=>{t||(p(""),l(0))},[t]);const j=K(n.user.role,"settings"),i=o.useMemo(()=>[{id:"s:sites",label:"Sites",icon:e.jsx(se,{className:"size-4"}),go:()=>void a({to:"/sites"})},{id:"s:activity",label:"Activity",hint:"every site, newest first",icon:e.jsx(Ye,{className:"size-4"}),go:()=>void a({to:"/activity"})},...j?[{id:"s:members",label:"Members",icon:e.jsx(me,{className:"size-4"}),go:()=>void a({to:"/studio/members"})},{id:"s:integrations",label:"Integrations",icon:e.jsx(We,{className:"size-4"}),go:()=>void a({to:"/studio/integrations"})},{id:"s:studio",label:"Studio settings",icon:e.jsx(Ne,{className:"size-4"}),go:()=>void a({to:"/studio"})}]:[],{id:"s:you",label:"You",icon:e.jsx(Je,{className:"size-4"}),go:()=>void a({to:"/you"})}],[a,j]),S=o.useMemo(()=>n.projects.map(u=>({id:`p:${u.uid}`,label:u.name,hint:u.unresolved>0?`${u.unresolved} open`:"nothing open",icon:e.jsx(be,{className:"size-4"}),go:()=>void a({to:"/s/$site/comments",params:{site:u.uid}})})),[n.projects,a]),f=u=>!c||u.toLowerCase().includes(c.toLowerCase()),m=[],C=S.filter(u=>f(u.label)),N=i.filter(u=>f(u.label));C.length&&m.push({title:"Sites",items:C}),N.length&&m.push({title:"Go to",items:N});const v=(h.data?.data??[]).map(u=>({id:`t:${u.id}`,label:u.latest?.body?.trim()||u.route,hint:`${u.site.name} · ${Os(u.status)?Es[u.status]:u.status} · ${u.key}`,icon:e.jsx(be,{className:"size-4"}),go:()=>void a({to:"/s/$site/comments",params:{site:u.site.uid},search:{thread:u.key}})}));v.length&&m.push({title:"Comments",items:v});const y=m.flatMap(u=>u.items),R=Math.min(d,Math.max(0,y.length-1)),P=u=>{u&&(s(!1),u.go())};return o.useEffect(()=>{x.current?.querySelector(`[data-at="${R}"]`)?.scrollIntoView({block:"nearest"})},[R]),e.jsx(Be,{open:t,onOpenChange:s,children:e.jsxs(Fe,{showCloseButton:!1,className:"top-[15%] max-h-[70dvh] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-lg",children:[e.jsx(Ue,{className:"sr-only",children:"Search and go"}),e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[e.jsx(Ge,{className:"size-4 shrink-0 text-muted-foreground"}),e.jsx("input",{autoFocus:!0,value:r,onChange:u=>{p(u.target.value),l(0)},onKeyDown:u=>{u.key==="ArrowDown"?(u.preventDefault(),l(k=>Math.min(k+1,y.length-1))):u.key==="ArrowUp"?(u.preventDefault(),l(k=>Math.max(k-1,0))):u.key==="Enter"&&(u.preventDefault(),P(y[R]))},placeholder:"Go to a site or a screen, or search every comment…","aria-label":"Search and go",className:"h-11 w-full bg-transparent text-[14px] outline-none placeholder:text-muted-foreground"})]}),e.jsxs("div",{ref:x,className:"min-h-0 flex-1 overflow-auto py-1.5",children:[y.length===0&&e.jsx("p",{className:"m-0 px-3 py-6 text-center text-[13px] text-muted-foreground",children:h.isFetching?"Looking…":c?`Nothing matches “${c}”.`:"Nothing here."}),m.map(u=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:u.title}),u.items.map(k=>{const A=y.indexOf(k);return e.jsxs("button",{type:"button","data-at":A,onMouseMove:()=>l(A),onClick:()=>P(k),className:w("flex w-full items-center gap-2.5 border-0 bg-transparent px-3 py-2 text-left text-[13px] text-foreground",A===R&&"bg-muted"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:k.icon}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.label}),k.hint&&e.jsx("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:k.hint})]},k.id)})]},u.title)),h.isFetching&&y.length>0&&e.jsxs("p",{className:"m-0 flex items-center gap-1.5 px-3 py-1.5 text-[12px] text-muted-foreground",children:[e.jsx(jt,{className:"size-3"}),"Searching every site…"]})]})]})})}function Qn(){const[t,s]=o.useState(!1);return o.useEffect(()=>{const n=a=>{a.key.toLowerCase()!=="k"||!(a.metaKey||a.ctrlKey)||(a.preventDefault(),s(r=>!r))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),[t,s]}const rt="https://snagset.com/docs/",Jn="https://www.npmjs.com/package/@snagset/server?activeTab=versions",Zn="https://snagset.com/docs/self-hosting/#upgrade";function ea({children:t}){const s=we(),n=yt(s),[a,r]=Qn();return en(),e.jsxs($n,{children:[e.jsx(na,{me:s,site:n}),e.jsxs(Un,{className:"min-w-0",children:[e.jsx(la,{onSearch:()=>r(!0)}),e.jsx(ta,{names:s.pendingMigrations??[],owner:s.user.role==="owner"}),s.regionMismatch&&K(s.user.role,"settings")&&e.jsx(sa,{...s.regionMismatch}),e.jsx("div",{className:"min-h-0 flex-1",children:t})]}),e.jsx(Xn,{open:a,onOpenChange:r})]})}function ta({names:t,owner:s}){return t.length?e.jsxs("div",{role:"alert",className:"mx-7 mt-4 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:[e.jsxs("p",{className:"m-0 font-medium",children:["The database needs an update for this version (",t.length," ",t.length===1?"migration":"migrations",")."]}),e.jsx("p",{className:"m-0 mt-0.5",children:s?e.jsxs(e.Fragment,{children:["Run ",e.jsx("code",{className:"font-mono",children:"snagset migrate"})," with this instance's ",e.jsx("code",{className:"font-mono",children:"DATABASE_URL"})," — from the project, ",e.jsx("code",{className:"font-mono",children:"pnpm migrate"}),". Until then, parts of this version may fail."]}):"Ask the studio's owner to run snagset migrate. Until then, parts of this version may fail."})]}):null}function sa({functions:t,database:s,suggest:n}){return e.jsxs("div",{role:"status",className:"mx-7 mt-4 rounded-md border border-border bg-warn-soft px-3 py-2 text-[13px]",children:[e.jsxs("p",{className:"m-0 font-medium",children:["This server runs in ",t,", but its database is in ",s," — every page waits on that distance."]}),e.jsx("p",{className:"m-0 mt-0.5 text-muted-foreground",children:n?e.jsxs(e.Fragment,{children:["Add ",e.jsxs("code",{className:"font-mono",children:['"regions": ["',n,'"]']})," to ",e.jsx("code",{className:"font-mono",children:"vercel.json"})," and redeploy."]}):"Run the server in the same region as the database."})]})}function na({me:t,site:s}){const n=zs({select:p=>p.location.pathname}),a=p=>n===p||n.startsWith(p+"/"),r=K(t.user.role,"settings");return e.jsxs(Bn,{children:[e.jsx(qn,{className:"px-3 pb-1 pt-3",children:e.jsx(aa,{me:t})}),e.jsxs(Vn,{children:[e.jsxs(He,{children:[e.jsx(ra,{me:t,site:s}),s&&e.jsx(ze,{children:e.jsxs(ge,{children:[e.jsxs(E,{children:[e.jsxs(O,{isActive:a(`/s/${s.uid}/comments`),render:e.jsx(H,{to:"/s/$site/comments",params:{site:s.uid}}),children:[e.jsx(be,{}),e.jsx("span",{children:"Comments"})]}),s.unresolved>0&&e.jsx(Wn,{children:s.unresolved})]}),e.jsx(E,{children:e.jsxs(O,{isActive:a(`/s/${s.uid}/reviewers`),render:e.jsx(H,{to:"/s/$site/reviewers",params:{site:s.uid}}),children:[e.jsx(me,{}),e.jsx("span",{children:"Reviewers"})]})}),r&&e.jsx(E,{children:e.jsxs(O,{isActive:a(`/s/${s.uid}/settings`),render:e.jsx(H,{to:"/s/$site/settings",params:{site:s.uid}}),children:[e.jsx(Qe,{}),e.jsx("span",{children:"Settings"})]})})]})})]}),e.jsxs(He,{children:[e.jsx(Kn,{children:"Studio"}),e.jsx(ze,{children:e.jsxs(ge,{children:[e.jsx(E,{children:e.jsxs(O,{isActive:a("/sites"),render:e.jsx(H,{to:"/sites"}),children:[e.jsx(se,{}),e.jsx("span",{children:"Sites"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/activity"),render:e.jsx(H,{to:"/activity"}),children:[e.jsx(Ye,{}),e.jsx("span",{children:"Activity"})]})}),r&&e.jsxs(e.Fragment,{children:[e.jsx(E,{children:e.jsxs(O,{isActive:a("/studio/members"),render:e.jsx(H,{to:"/studio/members"}),children:[e.jsx(me,{}),e.jsx("span",{children:"Members"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/studio/integrations"),render:e.jsx(H,{to:"/studio/integrations"}),children:[e.jsx(We,{}),e.jsx("span",{children:"Integrations"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:n==="/studio",render:e.jsx(H,{to:"/studio"}),children:[e.jsx(Ne,{}),e.jsx("span",{children:"General"})]})})]})]})})]})]}),e.jsx(Gn,{children:e.jsxs(ge,{children:[e.jsx(E,{children:e.jsxs(O,{render:e.jsx("a",{href:rt,target:"_blank",rel:"noreferrer"}),children:[e.jsx(Xe,{}),e.jsx("span",{children:"Docs"}),e.jsx(J,{className:"ml-auto size-3.5 text-muted-foreground"})]})}),e.jsx(E,{children:e.jsx(oa,{})}),e.jsx(E,{children:e.jsx(ia,{me:t})})]})})]})}function aa({me:t}){const s=ae(),n=ve(),[a,r]=o.useState(!1),[p,d]=o.useState(""),[l,x]=o.useState(""),[c,g]=o.useState(!1),b=e.jsxs(e.Fragment,{children:[e.jsx(wt,{size:20}),e.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[e.jsx("span",{className:"block truncate text-[14px] font-semibold leading-tight tracking-tight",children:t.org.name}),e.jsx("span",{className:"block truncate text-[11.5px] text-muted-foreground",children:location.host})]})]}),h=K(t.user.role,"settings");if(t.orgs.length<=1&&!t.signupOpen)return h?e.jsx(H,{to:"/studio",className:"flex items-center gap-2.5 rounded-md px-1 py-0.5 text-foreground hover:bg-sidebar-accent","aria-label":`${t.org.name} — studio settings`,children:b}):e.jsx("div",{className:"flex items-center gap-2.5 px-1 py-0.5 text-foreground",children:b});const j=async i=>{g(!0),x("");try{await i(),n.clear(),r(!1),d(""),s({to:"/sites",replace:!0})}catch(S){x(S instanceof Error?S.message:"Something went wrong. Try again.")}finally{g(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsxs(oe,{render:e.jsx("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-md px-1 py-0.5 text-foreground hover:bg-sidebar-accent","aria-label":"Switch studio"}),children:[b,e.jsx(Ce,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),e.jsxs(ie,{align:"start",className:"w-[240px]",children:[e.jsxs(Se,{children:[e.jsx(te,{children:"Studios"}),t.orgs.map(i=>e.jsxs(D,{disabled:i.current,onClick:()=>void j(()=>ee.switchOrg(i.slug)),children:[e.jsx(Ne,{}),e.jsx("span",{className:"truncate",children:i.name}),i.current&&e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"current"})]},i.slug))]}),(h||t.signupOpen)&&e.jsx(V,{}),h&&e.jsxs(D,{onClick:()=>void s({to:"/studio"}),children:[e.jsx(Qe,{}),"Studio settings"]}),t.signupOpen&&e.jsxs(D,{onClick:()=>r(!0),children:[e.jsx(Ke,{}),"New studio…"]})]})]}),e.jsx(Be,{open:a,onOpenChange:i=>!c&&r(i),children:e.jsx(Fe,{className:"sm:max-w-[420px]",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:i=>{i.preventDefault(),j(()=>ee.createOrg(p.trim()||"My studio"))},children:[e.jsxs(ds,{children:[e.jsx(Ue,{children:"New studio"}),e.jsx(cs,{children:"Its own sites, members and settings. You are its owner, and you move to it now — this one stays in the menu."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(ms,{htmlFor:"new-studio-name",children:"Studio name"}),e.jsx(bs,{id:"new-studio-name",value:p,onChange:i=>d(i.target.value),placeholder:"My studio",autoFocus:!0})]}),l&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:l}),e.jsxs(us,{children:[e.jsx(Z,{type:"button",variant:"outline",onClick:()=>r(!1),disabled:c,children:"Cancel"}),e.jsx(Z,{type:"submit",loading:c,children:c?"Creating…":"Create studio"})]})]})})})]})}function ra({me:t,site:s}){const n=ae();return e.jsxs(re,{children:[e.jsxs(oe,{render:e.jsx("button",{type:"button",className:"mb-1 flex h-[34px] w-full items-center justify-between rounded-md border border-border bg-card px-2.5 text-[13px] font-semibold text-foreground","aria-label":"Switch site"}),children:[e.jsx("span",{className:"truncate",children:s?.name??"No sites yet"}),e.jsx(Ce,{className:"size-3.5 text-muted-foreground"})]}),e.jsxs(ie,{align:"start",className:"w-[240px]",children:[e.jsxs(Se,{children:[e.jsx(te,{children:"Sites"}),t.projects.map(a=>e.jsxs(D,{onClick:()=>void n({to:"/s/$site/comments",params:{site:a.uid}}),children:[e.jsx(se,{}),e.jsx("span",{className:"truncate",children:a.name}),a.uid===s?.uid&&e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"current"})]},a.uid))]}),e.jsx(V,{}),K(t.user.role,"settings")&&e.jsxs(D,{onClick:()=>void n({to:"/sites",search:{add:!0}}),children:[e.jsx(Ke,{}),"Add a site"]}),e.jsxs(D,{onClick:()=>void n({to:"/sites"}),children:[e.jsx(se,{}),"All sites"]})]})]})}function oa(){const t=Le(Tt.meta()),s=t.data?.version??"",[n,a]=o.useState({state:"idle"}),r=async()=>{a({state:"checking"});try{a({state:"done",result:await Is(s)})}catch{a({state:"failed"})}};return e.jsxs(re,{children:[e.jsxs(oe,{render:e.jsx(O,{}),children:[e.jsx(Gs,{}),e.jsx("span",{children:"Help"})]}),e.jsxs(ie,{align:"start",side:"top",className:"w-[240px]",children:[e.jsxs(D,{render:e.jsx("a",{href:rt,target:"_blank",rel:"noreferrer"}),children:[e.jsx(Xe,{}),"Docs",e.jsx(J,{className:"ml-auto size-3 text-muted-foreground"})]}),e.jsxs(D,{render:e.jsx("a",{href:Jn,target:"_blank",rel:"noreferrer"}),children:["Changelog",e.jsx(J,{className:"ml-auto size-3 text-muted-foreground"})]}),t.data?.sourceUrl&&e.jsxs(D,{render:e.jsx("a",{href:t.data.sourceUrl,target:"_blank",rel:"noreferrer"}),children:["Source · AGPL",e.jsx(J,{className:"ml-auto size-3 text-muted-foreground"})]}),e.jsx(V,{}),e.jsxs("div",{className:"px-2 py-1.5 text-[12px] text-muted-foreground",children:["Snagset ",s||"—",n.state==="idle"&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>void r(),children:"Check for updates"})]}),n.state==="checking"&&" · checking…",n.state==="failed"&&" · could not reach npm",n.state==="done"&&n.result&&e.jsxs(e.Fragment,{children:[" · ",n.result.newer?e.jsxs("a",{href:Zn,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:[n.result.latest," is out — how to upgrade"]}):"up to date"]})]})]})]})}function ia({me:t}){const s=ae(),n=ve(),[a,r]=o.useState(Nt),p=t.user.name||t.user.email,d=t.user.name?t.user.email:t.user.role,l=async()=>{await ee.logout().catch(()=>{}),kt("out"),n.clear(),s({to:"/sign-in",replace:!0})};return e.jsxs(re,{children:[e.jsxs(oe,{render:e.jsx(O,{size:"lg"}),children:[e.jsx(Rs,{className:"size-8 rounded-full",children:e.jsx(Ms,{className:"bg-primary text-[12px] font-semibold text-primary-foreground",children:Ds(t.user.name,t.user.email)})}),e.jsxs("div",{className:"min-w-0 flex-1 text-left leading-tight",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold",children:p}),e.jsx("div",{className:"truncate text-[11.5px] text-muted-foreground",children:d})]}),e.jsx(Ce,{className:"size-3.5 text-muted-foreground"})]}),e.jsxs(ie,{align:"start",side:"top",className:"w-[250px]",children:[e.jsx(Se,{children:e.jsxs(te,{className:"flex flex-col",children:[e.jsx("span",{className:"text-[13px] font-semibold",children:p}),e.jsx("span",{className:"text-[11.5px] font-normal text-muted-foreground",children:t.user.name?`${t.user.email} · ${t.user.role}`:t.user.role})]})}),e.jsx(V,{}),e.jsxs(Ps,{value:a,onValueChange:x=>{const c=x;Ct(c),r(c)},children:[e.jsx(te,{children:"Theme"}),e.jsxs(ue,{value:"system",children:[e.jsx(As,{}),"System"]}),e.jsxs(ue,{value:"light",children:[e.jsx(_s,{}),"Light"]}),e.jsxs(ue,{value:"dark",children:[e.jsx(Hs,{}),"Dark"]})]}),e.jsx(V,{}),e.jsxs(D,{onClick:()=>void s({to:"/you"}),children:[e.jsx(Je,{}),"You"]}),e.jsxs(D,{onClick:()=>void l(),children:[e.jsx(Ks,{}),"Sign out"]})]})]})}function la({onSearch:t}){const n=St().map(a=>a.loaderData?.crumb).filter(a=>typeof a=="string"&&a.length>0);return e.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx(Fn,{className:"-ml-1"}),e.jsx("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-[13.5px] font-medium text-muted-foreground",children:n.map((a,r)=>e.jsxs("span",{className:"flex items-center gap-2",children:[r>0&&e.jsx("span",{className:"text-line-strong",children:"/"}),e.jsx("span",{className:r===n.length-1?"text-foreground":void 0,children:a})]},r))}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:t,"aria-label":"Search and go",className:"flex h-7 items-center gap-2 rounded-md border border-border bg-card px-2 text-[12.5px] text-muted-foreground",children:[e.jsx(Ge,{className:"size-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Search"}),e.jsx("kbd",{className:"hidden rounded border border-border px-1 font-mono text-[11px] sm:inline",children:"⌘K"})]})]})}const Ra=()=>e.jsx(ea,{children:e.jsx(Pt,{})});export{Ra as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,i as b,k as f,j as d,h as m}from"./index-COORBw3J.js";import{w as A}from"./dialog-D0b9dX2m.js";const x=a.createContext(void 0);function k(){const e=a.useContext(x);if(e===void 0)throw new Error(b(13));return e}const g={imageLoadingStatus:()=>null},z=a.forwardRef(function(t,r){const{className:v,render:p,style:s,...c}=t,[n,o]=a.useState("idle"),i={imageLoadingStatus:n},u=a.useMemo(()=>({imageLoadingStatus:n,setImageLoadingStatus:o}),[n,o]),l=f("span",t,{state:i,ref:r,props:c,stateAttributesMapping:g});return d.jsx(x.Provider,{value:u,children:l})}),R=a.forwardRef(function(t,r){const{className:v,render:p,delay:s=0,style:c,...n}=t,{imageLoadingStatus:o}=k(),[i,u]=a.useState(s===0),l=A();return a.useEffect(()=>(s>0?l.start(s,()=>u(!0)):u(!0),l.clear),[l,s]),f("span",t,{state:{imageLoadingStatus:o},ref:r,props:n,stateAttributesMapping:g,enabled:o!=="loaded"&&(s===0||i)})});function h({className:e,size:t="default",...r}){return d.jsx(z,{"data-slot":"avatar","data-size":t,className:m("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),...r})}function w({className:e,...t}){return d.jsx(R,{"data-slot":"avatar-fallback",className:m("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{h as A,w as a};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{c as zn,r as u,k as Fe,E as tt,av as qt,l as se,aw as $e,g as Pe,ax as ke,ay as We,az as on,aA as lt,aB as Et,aC as Vo,aD as Un,aE as Wo,aF as rn,aG as Kn,aH as Dt,aI as Gn,aJ as En,n as Ct,aa as Yn,e as de,a8 as Xn,f as pe,aK as qn,i as ze,ac as jo,a9 as Qn,m as it,ab as $o,j as Q,aL as zo,h as ut}from"./index-COORBw3J.js";import{C as Uo}from"./check-XHwuM5zg.js";import{i as Je,Q as Qt,w as _e,S as Jn,U as Zn,V as Ko,W as ft,Y as Tt,Z as eo,_ as to,a as Te,$ as Go,a0 as Mt,a1 as Yo,a2 as Xo,T as Jt,a3 as Lt,a4 as qo,a5 as Zt,v as Re,a6 as Qo,a7 as Jo,a8 as Zo,a9 as Cn,aa as Ut,ab as Tn,ac as Ne,ad as mt,ae as er,af as Nt,ag as Ht,ah as no,ai as sn,aj as tr,ak as nr,al as or,am as rr,C as sr,O as ir,A as oo,an as cr,B as ar,ao as lr,ap as ur,aq as fr,ar as dr,as as pr,z as gr,at as mr,au as hr,av as xr,N as yr,R as vr,p as Rr,aw as ro,j as br,P as wr,l as Er,ax as so,m as Cr,n as Tr,ay as Mr,az as Or,aA as Sr,q as Pr,aB as Ir,F as Ar,r as kr,o as Fr,aC as Dr,aD as Lr,aE as Nr,aF as Hr,aG as Br,aH as _r,s as Vr,t as Wr,aI as Mn,aJ as On,aK as jr}from"./dialog-D0b9dX2m.js";import{t as cn,g as nt,c as ie,m as ct,o as Se,a as le,p as at,q as io,b as be,r as en,s as Ot,v as an,u as Bt,w as $r,x as st,k as zr,y as Sn,i as Ur,z as Kr}from"./label-Ds2CYKth.js";import{u as co,a as ao,C as Gr,b as Yr}from"./CompositeItem-Yi3wWYM7.js";import{u as Xr}from"./useValueChanged-CHzVruZ0.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 qr=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],cc=zn("external-link",qr);/**
|
|
7
|
-
* @license lucide-react v1.39.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Qr=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ac=zn("search",Qr),et=Math.min,He=Math.max,St=Math.round,ht=Math.floor,Be=e=>({x:e,y:e}),Jr={left:"right",right:"left",bottom:"top",top:"bottom"};function lo(e,t,n){return He(e,et(t,n))}function je(e,t){return typeof e=="function"?e(t):e}function Oe(e){return e.split("-")[0]}function Ue(e){return e.split("-")[1]}function ln(e){return e==="x"?"y":"x"}function un(e){return e==="y"?"height":"width"}function Me(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function fn(e){return ln(Me(e))}function Zr(e,t,n){n===void 0&&(n=!1);const o=Ue(e),r=fn(e),s=un(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Pt(i)),[i,Pt(i)]}function es(e){const t=Pt(e);return[tn(e),t,tn(t)]}function tn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Pn=["left","right"],In=["right","left"],ts=["top","bottom"],ns=["bottom","top"];function os(e,t,n){switch(e){case"top":case"bottom":return n?t?In:Pn:t?Pn:In;case"left":case"right":return t?ts:ns;default:return[]}}function rs(e,t,n,o){const r=Ue(e);let s=os(Oe(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(tn)))),s}function Pt(e){const t=Oe(e);return Jr[t]+e.slice(t.length)}function ss(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 uo(e){return typeof e!="number"?ss(e):{top:e,right:e,bottom:e,left:e}}function It(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}}const is=u.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",style:i,...c}=t;return Fe("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},c]})});function cs(e,t){return t!=null&&!Je(t)?0:typeof e=="function"?e():e}function nn(e,t,n){const o=cs(e,n);return typeof o=="number"?o:o?.[t]}function An(e){return typeof e=="function"?e():e}function fo(e,t){return t||e==="click"||e==="mousedown"}function as(e){return e?.includes("mouse")&&e!=="mousedown"}function ls(e,t={}){const{enabled:n=!0,event:o="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:i=!0,touchOpenDelay:c=0,reason:a=cn}=t,h="rootStore"in e?e.rootStore:e,d=h.context.dataRef,x=u.useRef(void 0),g=Qt(),p=_e(),v=u.useMemo(()=>{function m(y,R,l,C){const T=ie(a,R,l);y&&C==="touch"&&c>0?p.start(c,()=>{h.setOpen(!0,T)}):h.setOpen(y,T)}function b(y,R,l){const C=d.current.openEvent,T=h.select("domReferenceElement")!==R;return y&&T||!y||!r?!0:C&&i?!l(C.type):!1}return{onPointerDown(y){x.current=Je(y.pointerType,!0)&&Zn(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const R=x.current,l=y.nativeEvent,C=h.select("open");if(y.button!==0||o==="click"||Je(R,!0)&&s)return;const T=b(C,y.currentTarget,E=>E==="click"||E==="mousedown"),f=nt(l);if(Jn(f)){m(T,l,f,R);return}const O=y.currentTarget;g.request(()=>{m(T,l,O,R)})},onClick(y){if(o==="mousedown-only")return;const R=x.current;if(o==="mousedown"&&R){x.current=void 0;return}if(Je(R,!0)&&s)return;const l=h.select("open"),C=b(l,y.currentTarget,T=>T==="click"||T==="mousedown"||T==="keydown"||T==="keyup");m(C,y.nativeEvent,y.currentTarget,R)},onKeyDown(){x.current=void 0}}},[d,o,s,a,h,i,r,g,p,c]);return u.useMemo(()=>n?{reference:v}:tt,[n,v])}function kn(e,t,n){let{reference:o,floating:r}=e;const s=Me(t),i=fn(t),c=un(i),a=Oe(t),h=s==="y",d=o.x+o.width/2-r.width/2,x=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let p;switch(a){case"top":p={x:d,y:o.y-r.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:x};break;case"left":p={x:o.x-r.width,y:x};break;default:p={x:o.x,y:o.y}}const v=Ue(t);return v&&(p[i]+=g*(v==="end"?1:-1)*(n&&h?-1:1)),p}async function us(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:h="clippingAncestors",rootBoundary:d="viewport",elementContext:x="floating",altBoundary:g=!1,padding:p=0}=je(t,e),v=uo(p),b=c[g?x==="floating"?"reference":"floating":x],y=It(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:h,rootBoundary:d,strategy:a})),R=x==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,l=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),C=await(s.isElement==null?void 0:s.isElement(l))&&await(s.getScale==null?void 0:s.getScale(l))||{x:1,y:1},T=It(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:l,strategy:a}):R);return{top:(y.top-T.top+v.top)/C.y,bottom:(T.bottom-y.bottom+v.bottom)/C.y,left:(y.left-T.left+v.left)/C.x,right:(T.right-y.right+v.right)/C.x}}const fs=50,ds=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:us},a=await(i.isRTL==null?void 0:i.isRTL(t));let h=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:x}=kn(h,o,a),g=o,p=0;const v={};for(let m=0;m<s.length;m++){const b=s[m];if(!b)continue;const{name:y,fn:R}=b,{x:l,y:C,data:T,reset:f}=await R({x:d,y:x,initialPlacement:o,placement:g,strategy:r,middlewareData:v,rects:h,platform:c,elements:{reference:e,floating:t}});d=l??d,x=C??x,v[y]={...v[y],...T},f&&p<fs&&(p++,typeof f=="object"&&(f.placement&&(g=f.placement),f.rects&&(h=f.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):f.rects),{x:d,y:x}=kn(h,g,a)),m=-1)}return{x:d,y:x,placement:g,strategy:r,middlewareData:v}},ps=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:h}=t,{mainAxis:d=!0,crossAxis:x=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...b}=je(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Oe(r),R=Me(c),l=Oe(c)===c,C=await(a.isRTL==null?void 0:a.isRTL(h.floating)),T=g||(l||!m?[Pt(c)]:es(c)),f=v!=="none";!g&&f&&T.push(...rs(c,m,v,C));const O=[c,...T],E=await a.detectOverflow(t,b),k=[];let I=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&k.push(E[y]),x){const S=Zr(r,i,C);k.push(E[S[0]],E[S[1]])}if(I=[...I,{placement:r,overflows:k}],!k.every(S=>S<=0)){var F,H;const S=(((F=s.flip)==null?void 0:F.index)||0)+1,M=O[S];if(M&&(!(x==="alignment"?R!==Me(M):!1)||I.every(w=>Me(w.placement)===R?w.overflows[0]>0:!0)))return{data:{index:S,overflows:I},reset:{placement:M}};let P=(H=I.filter(A=>A.overflows[0]<=0).sort((A,w)=>A.overflows[1]-w.overflows[1])[0])==null?void 0:H.placement;if(!P)switch(p){case"bestFit":{var B;const A=(B=I.filter(w=>{if(f){const D=Me(w.placement);return D===R||D==="y"}return!0}).map(w=>[w.placement,w.overflows.filter(D=>D>0).reduce((D,K)=>D+K,0)]).sort((w,D)=>w[1]-D[1])[0])==null?void 0:B[0];A&&(P=A);break}case"initialPlacement":P=c;break}if(r!==P)return{reset:{placement:P}}}return{}}}},po=new Set(["left","top"]);async function gs(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Oe(n),c=Ue(n),a=Me(n)==="y",h=po.has(i)?-1:1,d=s&&a?-1:1,x=je(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return c&&typeof v=="number"&&(p=c==="end"?v*-1:v),a?{x:p*d,y:g*h}:{x:g*h,y:p*d}}const ms=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,a=await gs(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:s+a.y,data:{...a,placement:i}}}}},hs=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:R=>{let{x:l,y:C}=R;return{x:l,y:C}}},...h}=je(e,t),d={x:n,y:o},x=await s.detectOverflow(t,h),g=Me(r),p=ln(g);let v=d[p],m=d[g];const b=(R,l)=>lo(l+x[R==="y"?"top":"left"],l,l-x[R==="y"?"bottom":"right"]);i&&(v=b(p,v)),c&&(m=b(g,m));const y=a.fn({...t,[p]:v,[g]:m});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[p]:i,[g]:c}}}}}},xs=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:s,placement:i,rects:c,middlewareData:a}=t,{offset:h=0,mainAxis:d=!0,crossAxis:x=!0}=je(e,t),g={x:r,y:s},p=Me(i),v=ln(p);let m=g[v],b=g[p];const y=je(h,t),R=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(o=y.crossAxis)!=null?o:0};if(d){const T=v==="y"?"height":"width",f=c.reference[v]-c.floating[T]+R.mainAxis,O=c.reference[v]+c.reference[T]-R.mainAxis;m<f?m=f:m>O&&(m=O)}if(x){var l,C;const T=v==="y"?"width":"height",f=po.has(Oe(i)),O=c.reference[p]-c.floating[T]+(f&&((l=a.offset)==null?void 0:l[p])||0)+(f?0:R.crossAxis),E=c.reference[p]+c.reference[T]+(f?0:((C=a.offset)==null?void 0:C[p])||0)-(f?R.crossAxis:0);b<O?b=O:b>E&&(b=E)}return{[v]:m,[p]:b}}}},ys=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:s}=t,{apply:i=()=>{},...c}=je(e,t),a=await r.detectOverflow(t,c),h=Oe(n),d=Ue(n),x=Me(n)==="y",{width:g,height:p}=o.floating;let v,m;h==="top"||h==="bottom"?(v=h,m=d===(await(r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(m=h,v=d==="end"?"top":"bottom");const b=p-a.top-a.bottom,y=g-a.left-a.right,R=et(p-a[v],b),l=et(g-a[m],y),C=t.middlewareData.shift,T=!C;let f=R,O=l;C!=null&&C.enabled.x&&(O=y),C!=null&&C.enabled.y&&(f=b),T&&!d&&(x?O=g-2*He(a.left,a.right):f=p-2*He(a.top,a.bottom)),await i({...t,availableWidth:O,availableHeight:f});const E=await r.getDimensions(s.floating);return g!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function go(e){const t=We(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ke(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=St(n)!==s||St(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function dn(e){return se(e)?e:e.contextElement}function Ze(e){const t=dn(e);if(!ke(t))return Be(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=go(t);let i=(s?St(n.width):n.width)/o,c=(s?St(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const vs=Be(0);function mo(e){const t=Pe(e);return!Gn()||!t.visualViewport?vs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Pe(e)}function Xe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=dn(e);let i=Be(1);t&&(o?se(o)&&(i=Ze(o)):i=Ze(e));const c=Rs(s,n,o)?mo(s):Be(0);let a=(r.left+c.x)/i.x,h=(r.top+c.y)/i.y,d=r.width/i.x,x=r.height/i.y;if(s&&o){const g=Pe(s),p=se(o)?Pe(o):o;let v=g,m=En(v);for(;m&&p!==v;){const b=Ze(m),y=m.getBoundingClientRect(),R=We(m),l=y.left+(m.clientLeft+parseFloat(R.paddingLeft))*b.x,C=y.top+(m.clientTop+parseFloat(R.paddingTop))*b.y;a*=b.x,h*=b.y,d*=b.x,x*=b.y,a+=l,h+=C,v=Pe(m),m=En(v)}}return It({width:d,height:x,x:a,y:h})}function _t(e,t){const n=Dt(e).scrollLeft;return t?t.left+n:Xe($e(e)).left+n}function ho(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-_t(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function bs(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=$e(o),c=t?on(t.floating):!1;if(o===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},h=Be(1);const d=Be(0),x=ke(o);if((x||!s)&&((rn(o)!=="body"||Kn(i))&&(a=Dt(o)),x)){const p=Xe(o);h=Ze(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const g=i&&!x&&!s?ho(i,a):Be(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-a.scrollLeft*h.x+d.x+g.x,y:n.y*h.y-a.scrollTop*h.y+d.y+g.y}}function ws(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Es(e){const t=Dt(e),n=e.ownerDocument.body,o=He(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=He(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+_t(e);const i=-t.scrollTop;return We(n).direction==="rtl"&&(s+=He(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:s,y:i}}const Cs=25;function Ts(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=Pe(e),s=$e(e),i=r.visualViewport;let c=s.clientWidth,a=s.clientHeight,h=0,d=0;if(i){const g=!Gn()||t==="fixed";o?g||(h=-i.offsetLeft,d=-i.offsetTop):(c=i.width,a=i.height,g&&(h=i.offsetLeft,d=i.offsetTop))}if(_t(s)<=0){const g=s.ownerDocument,p=g.body,v=getComputedStyle(p),m=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(s.clientWidth-p.clientWidth-m),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?b/2:b;y<=Cs&&(c-=y)}return{width:c,height:a,x:h,y:d}}function Ms(e,t){const n=Xe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ze(e),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=r*s.x,h=o*s.y;return{width:i,height:c,x:a,y:h}}function Fn(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Ts(e,n,t);else if(t==="document")o=Es($e(e));else if(se(t))o=Ms(t,n);else{const r=mo(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return It(o)}function Os(e,t){const n=t.get(e);if(n)return n;let o=qt(e,[],!1).filter(c=>se(c)&&rn(c)!=="body"),r=null;const s=We(e).position==="fixed";let i=s?lt(e):e;for(;se(i)&&!Et(i);){const c=We(i),a=Un(i),h=r?r.position:s?"fixed":"";!a&&(h==="fixed"||h==="absolute"&&c.position==="static")?o=o.filter(x=>x!==i):r=c,i=lt(i)}return t.set(e,o),o}function Ss(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?on(t)?[]:Os(t,this._c):[].concat(n),o],c=Fn(t,i[0],r);let a=c.top,h=c.right,d=c.bottom,x=c.left;for(let g=1;g<i.length;g++){const p=Fn(t,i[g],r);a=He(p.top,a),h=et(p.right,h),d=et(p.bottom,d),x=He(p.left,x)}return{width:h-x,height:d-a,x,y:a}}function Ps(e){const{width:t,height:n}=go(e);return{width:t,height:n}}function Is(e,t,n){const o=ke(t),r=$e(t),s=n==="fixed",i=Xe(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=Be(0);if((o||!s)&&((rn(t)!=="body"||Kn(r))&&(c=Dt(t)),o)){const g=Xe(t,!0,s,t);a.x=g.x+t.clientLeft,a.y=g.y+t.clientTop}!o&&r&&(a.x=_t(r));const h=r&&!o&&!s?ho(r,c):Be(0),d=i.left+c.scrollLeft-a.x-h.x,x=i.top+c.scrollTop-a.y-h.y;return{x:d,y:x,width:i.width,height:i.height}}function Kt(e){return We(e).position==="static"}function Dn(e,t){if(!ke(e)||We(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $e(e)===n&&(n=n.ownerDocument.body),n}function xo(e,t){const n=Pe(e);if(on(e))return n;if(!ke(e)){let r=lt(e);for(;r&&!Et(r);){if(se(r)&&!Kt(r))return r;r=lt(r)}return n}let o=Dn(e,t);for(;o&&Vo(o)&&Kt(o);)o=Dn(o,t);return o&&Et(o)&&Kt(o)&&!Un(o)?n:o||Wo(e)||n}const As=async function(e){const t=this.getOffsetParent||xo,n=this.getDimensions,o=await n(e.floating);return{reference:Is(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ks(e){return We(e).direction==="rtl"}const Fs={convertOffsetParentRelativeRectToViewportRelativeRect:bs,getDocumentElement:$e,getClippingRect:Ss,getOffsetParent:xo,getElementRects:As,getClientRects:ws,getDimensions:Ps,getScale:Ze,isElement:se,isRTL:ks};function yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ds(e,t,n){let o=null,r;const s=$e(e);function i(){var d;clearTimeout(r),(d=o)==null||d.disconnect(),o=null}function c(d,x){d===void 0&&(d=!1),x===void 0&&(x=1),i();const g=e.getBoundingClientRect(),{left:p,top:v,width:m,height:b}=g;if(d||t(),!m||!b)return;const y=ht(v),R=ht(s.clientWidth-(p+m)),l=ht(s.clientHeight-(v+b)),C=ht(p),f={rootMargin:-y+"px "+-R+"px "+-l+"px "+-C+"px",threshold:He(0,et(1,x))||1};let O=!0;function E(k){const I=k[0].intersectionRatio;if(!yo(g,e.getBoundingClientRect()))return c();if(I!==x){if(!O)return c();I?c(!1,I):r=setTimeout(()=>{c(!1,1e-7)},1e3)}O=!1}try{o=new IntersectionObserver(E,{...f,root:s.ownerDocument})}catch{o=new IntersectionObserver(E,f)}o.observe(e)}const a=Pe(e),h=()=>c(n);return a.addEventListener("resize",h),c(!0),()=>{a.removeEventListener("resize",h),i()}}function Ln(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,h=dn(e),d=r||s?[...h?qt(h):[],...t?qt(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const x=h&&c?Ds(h,n,s):null;let g=-1,p=null;i&&(p=new ResizeObserver(y=>{let[R]=y;R&&R.target===h&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var l;(l=p)==null||l.observe(t)})),n()}),h&&!a&&p.observe(h),t&&p.observe(t));let v,m=a?Xe(e):null;a&&b();function b(){const y=Xe(e);m&&!yo(m,y)&&n(),m=y,v=requestAnimationFrame(b)}return n(),()=>{var y;d.forEach(R=>{r&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),x?.(),(y=p)==null||y.disconnect(),p=null,a&&cancelAnimationFrame(v)}}const Ls=ms,Ns=hs,Hs=ps,Bs=ys,_s=xs,Vs=(e,t,n)=>{const o=new Map,r=n??{},s={...Fs,...r.platform,_c:o};return ds(e,t,{...r,platform:s})};var Ws=typeof document<"u",js=function(){},wt=Ws?u.useLayoutEffect:js;function At(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(!At(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 s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!At(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function vo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Nn(e,t){const n=vo(e);return Math.round(t*n)/n}function Gt(e){const t=u.useRef(e);return wt(()=>{t.current=e}),t}function $s(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:h}=e,[d,x]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=u.useState(o);At(g,o)||p(o);const[v,m]=u.useState(null),[b,y]=u.useState(null),R=u.useCallback(w=>{w!==f.current&&(f.current=w,m(w))},[]),l=u.useCallback(w=>{w!==O.current&&(O.current=w,y(w))},[]),C=s||v,T=i||b,f=u.useRef(null),O=u.useRef(null),E=u.useRef(d),k=a!=null,I=Gt(a),F=Gt(r),H=Gt(h),B=u.useCallback(()=>{if(!f.current||!O.current)return;const w={placement:t,strategy:n,middleware:g};F.current&&(w.platform=F.current),Vs(f.current,O.current,w).then(D=>{const K={...D,isPositioned:H.current!==!1};S.current&&!At(E.current,K)&&(E.current=K,Ct.flushSync(()=>{x(K)}))})},[g,t,n,F,H]);wt(()=>{h===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,x(w=>({...w,isPositioned:!1})))},[h]);const S=u.useRef(!1);wt(()=>(S.current=!0,()=>{S.current=!1}),[]),wt(()=>{if(C&&(f.current=C),T&&(O.current=T),C&&T){if(I.current)return I.current(C,T,B);B()}},[C,T,B,I,k]);const M=u.useMemo(()=>({reference:f,floating:O,setReference:R,setFloating:l}),[R,l]),P=u.useMemo(()=>({reference:C,floating:T}),[C,T]),A=u.useMemo(()=>{const w={position:n,left:0,top:0};if(!P.floating)return w;const D=Nn(P.floating,d.x),K=Nn(P.floating,d.y);return c?{...w,transform:"translate("+D+"px, "+K+"px)",...vo(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:K}},[n,c,P.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:B,refs:M,elements:P,floatingStyles:A}),[d,B,M,P,A])}const zs=(e,t)=>{const n=Ls(e);return{name:n.name,fn:n.fn,options:[e,t]}},Us=(e,t)=>{const n=Ns(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ks=(e,t)=>({fn:_s(e).fn,options:[e,t]}),Gs=(e,t)=>{const n=Hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ys=(e,t)=>{const n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Xs(e){const t=u.useCallback(o=>e===void 0?Yn:e.subscribeStore(o),[e]),n=u.useCallback(()=>e===void 0?void 0:e.store,[e]);return Ko.useSyncExternalStore(t,n,()=>e?.serverStore)}function qs(e){return Qs(e,e.rootContext)}function Qs(e,t){const{nodeId:n,externalTree:o}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),i=t.useState("domReferenceElement"),c=t.useState("open"),a=t.useState("floatingId"),[h,d]=u.useState(null),[x,g]=u.useState(void 0),[p,v]=u.useState(void 0),m=u.useRef(null),b=ft(o),y=u.useMemo(()=>({reference:r,floating:s,domReference:i}),[r,s,i]),R=$s({...e,elements:{...y,...h&&{reference:h}}}),l=se(x)?x:null,C=p===void 0?t.state.floatingElement:p;t.useSyncedValue("referenceElement",x??null),t.useSyncedValue("domReferenceElement",x===void 0?i:l),t.useSyncedValue("floatingElement",C);const T=u.useCallback(F=>{const H=se(F)?{getBoundingClientRect:()=>F.getBoundingClientRect(),getClientRects:()=>F.getClientRects(),contextElement:F}:F;d(H),R.refs.setReference(H)},[R.refs]),f=u.useCallback(F=>{(se(F)||F===null)&&(m.current=F,g(F)),(se(R.refs.reference.current)||R.refs.reference.current===null||F!==null&&!se(F))&&R.refs.setReference(F)},[R.refs,g]),O=u.useCallback(F=>{v(F),R.refs.setFloating(F)},[R.refs]),E=u.useMemo(()=>({...R.refs,setReference:f,setFloating:O,setPositionReference:T,domReference:m}),[R.refs,f,O,T]),k=u.useMemo(()=>({...R.elements,domReference:i}),[R.elements,i]),I=u.useMemo(()=>({...R,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:a,refs:E,elements:k,nodeId:n,rootStore:t}),[R,E,k,n,t,c,a]);return de(()=>{i&&(m.current=i)},[i]),de(()=>{t.context.dataRef.current.floatingContext=I;const F=b?.nodesRef.current.find(H=>H.id===n);F&&(F.context=I)}),u.useMemo(()=>({...R,context:I,refs:E,elements:k,rootStore:t}),[R,E,k,I,t])}const Yt=eo&&to;function Js(e,t={}){const{enabled:n=!0,delay:o}=t,r="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=r.context,c=u.useRef(!1),a=u.useRef(null),h=u.useRef(!0),d=_e();u.useEffect(()=>{const g=r.select("domReferenceElement");if(!n)return;const p=Pe(g);function v(){const y=r.select("domReferenceElement");!r.select("open")&&ke(y)&&y===ct(Se(y))&&(c.current=!0)}function m(){h.current=!0}function b(){h.current=!1}return Tt(Te(p,"blur",v),Yt&&Te(p,"keydown",m,!0),Yt&&Te(p,"pointerdown",b,!0))},[r,n]),u.useEffect(()=>{if(!n)return;function g(p){if(p.reason===cn||p.reason===io){const v=r.select("domReferenceElement");se(v)&&(a.current=v,c.current=!0)}}return s.on("openchange",g),()=>{s.off("openchange",g)}},[s,n,r]);const x=u.useMemo(()=>{function g(){c.current=!1,a.current=null}return{onMouseLeave(){g()},onFocus(p){const v=p.currentTarget;if(c.current){if(a.current===v)return;g()}const m=nt(p.nativeEvent);if(se(m)){if(Yt&&!p.relatedTarget){if(!h.current&&!Jn(m))return}else if(!Yo(m))return}const b=Mt(p.relatedTarget,r.context.triggerElements),{nativeEvent:y,currentTarget:R}=p,l=typeof o=="function"?o():o;if(r.select("open")&&b||l===0||l===void 0){r.setOpen(!0,ie(at,y,R));return}d.start(l,()=>{c.current||r.setOpen(!0,ie(at,y,R))})},onBlur(p){g();const v=p.relatedTarget,m=p.nativeEvent,b=se(v)&&v.hasAttribute(Go("focus-guard"))&&v.getAttribute("data-type")==="outside";d.start(0,()=>{const y=r.select("domReferenceElement"),R=ct(Se(y));!v&&R===y||le(i.current.floatingContext?.refs.floating.current,R)||le(y,R)||b||Mt(v??R,r.context.triggerElements)||r.setOpen(!1,ie(at,m))})}}},[i,o,r,d]);return u.useMemo(()=>n?{reference:x,trigger:x}:{},[n,x])}class pn{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Jt,this.restTimeout=new Jt,this.handleCloseOptions=void 0}static create(){return new pn}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const kt=new WeakMap;function Ft(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&kt.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),kt.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ro(e,t){const{scopeElement:n,referenceElement:o,floatingElement:r}=t,s=kt.get(n);s&&s!==e&&Ft(s),Ft(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=o,e.pointerEventsFloatingElement=r,kt.set(n,e),n.style.pointerEvents="none",o.style.pointerEvents="auto",r.style.pointerEvents="auto"}function bo(e){const t=e.context.dataRef.current,n=Xn(()=>t.hoverInteractionState??pn.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),Xo(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Zs(e,t={}){const{enabled:n=!0,closeDelay:o=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),c=s.useState("floatingElement"),a=s.useState("domReferenceElement"),{dataRef:h}=s.context,d=ft(),x=Lt(),g=bo(s),p=_e(),v=pe(()=>fo(h.current.openEvent?.type,g.interactedInside)),m=pe(()=>as(h.current.openEvent?.type)),b=pe(()=>{Ft(g)});de(()=>{i||(g.pointerType=void 0,g.restTimeoutPending=!1,g.interactedInside=!1,b())},[i,g,b]),u.useEffect(()=>b,[b]),de(()=>{if(n&&i&&g.handleCloseOptions?.blockPointerEvents&&m()&&se(a)&&c){const y=a,R=c,l=Se(c),C=d?.nodesRef.current.find(E=>E.id===x)?.context?.elements.floating;C&&(C.style.pointerEvents="");const T=g.pointerEventsScopeElement!==R?g.pointerEventsScopeElement:null,f=C!==R?C:null,O=g.handleCloseOptions?.getScope?.()??T??f??y.closest("[data-rootownerid]")??l.body;return Ro(g,{scopeElement:O,referenceElement:y,floatingElement:R}),()=>{b()}}},[n,i,a,c,g,m,d,x,b]),u.useEffect(()=>{if(!n)return;function y(){return!!(d&&x&&Zt(d.nodesRef.current,x).length>0)}function R(E){const k=nn(o,"close",g.pointerType),I=()=>{s.setOpen(!1,ie(be,E)),d?.events.emit("floating.closed",E)};k?g.openChangeTimeout.start(k,I):(g.openChangeTimeout.clear(),I())}function l(E){const k=nt(E);if(!qo(k)){g.interactedInside=!1;return}g.interactedInside=k?.closest("[aria-haspopup]")!=null}function C(){g.openChangeTimeout.clear(),p.clear(),d?.events.off("floating.closed",f),b()}function T(E){if(y()&&d){d.events.on("floating.closed",f);return}if(Mt(E.relatedTarget,s.context.triggerElements))return;const k=h.current.floatingContext?.nodeId??r,I=E.relatedTarget;if(!(d&&k&&se(I)&&Zt(d.nodesRef.current,k,!1).some(H=>le(H.context?.elements.floating,I)))){if(g.handler){g.handler(E);return}b(),m()&&!v()&&R(E)}}function f(E){!d||!x||y()||p.start(0,()=>{d.events.off("floating.closed",f),s.setOpen(!1,ie(be,E)),d.events.emit("floating.closed",E)})}const O=c;return Tt(O&&Te(O,"mouseenter",C),O&&Te(O,"mouseleave",T),O&&Te(O,"pointerdown",l,!0),()=>{d?.events.off("floating.closed",f)})},[n,c,s,h,o,r,m,v,b,g,d,x,p])}const ei={current:null};function ti(e,t={}){const{enabled:n=!0,delay:o=0,handleClose:r=null,mouseOnly:s=!1,restMs:i=0,move:c=!0,triggerElementRef:a=ei,externalTree:h,isActiveTrigger:d=!0,getHandleCloseContext:x,isClosing:g,shouldOpen:p,guardStaleOpen:v=!1}=t,m="rootStore"in e?e.rootStore:e,{dataRef:b,events:y}=m.context,R=ft(h),l=bo(m),C=u.useRef(!1),T=Re(r),f=Re(o),O=Re(i),E=Re(n),k=Re(p),I=Re(g),F=pe(()=>fo(b.current.openEvent?.type,l.interactedInside)),H=pe(()=>k.current?.()!==!1),B=pe((P,A,w)=>{const D=m.context.triggerElements;if(D.hasElement(A))return!P||!le(P,A);if(!se(w))return!1;const K=w;return D.hasMatchingElement($=>le($,K))&&(!P||!le(P,K))}),S=pe(()=>{if(!l.handler)return;Se(m.select("domReferenceElement")).removeEventListener("mousemove",l.handler),l.handler=void 0}),M=pe(()=>{Ft(l)});return d&&(l.handleCloseOptions=T.current?.__options),u.useEffect(()=>S,[S]),u.useEffect(()=>{if(!n)return;function P(A){A.open?C.current=!1:(C.current=A.reason===be,S(),l.openChangeTimeout.clear(),l.restTimeout.clear(),l.blockMouseMove=!0,l.restTimeoutPending=!1)}return y.on("openchange",P),()=>{y.off("openchange",P)}},[n,y,l,S]),u.useEffect(()=>{if(!n)return;function P(z,j=!0){const V=nn(f.current,"close",l.pointerType);V?l.openChangeTimeout.start(V,()=>{m.setOpen(!1,ie(be,z)),R?.events.emit("floating.closed",z)}):j&&(l.openChangeTimeout.clear(),m.setOpen(!1,ie(be,z)),R?.events.emit("floating.closed",z))}const A=a.current??(d?m.select("domReferenceElement"):null);if(!se(A))return;function w(z){if(l.openChangeTimeout.clear(),l.blockMouseMove=!1,s&&!Je(l.pointerType))return;const j=An(O.current),V=nn(f.current,"open",l.pointerType),X=nt(z),W=z.currentTarget??null,te=m.select("domReferenceElement");let q=W;if(se(X)&&!m.context.triggerElements.hasElement(X)){for(const ye of m.context.triggerElements.elements())if(le(ye,X)){q=ye;break}}se(W)&&se(te)&&!m.context.triggerElements.hasElement(W)&&le(W,te)&&(q=te);const G=q==null?!1:B(te,q,X),Z=m.select("open"),re=I.current?.()??m.select("transitionStatus")==="ending",ce=!Z&&re&&C.current,ge=!G&&se(q)&&se(te)&&le(te,q)&&ce,we=j>0&&!V,me=G&&(Z||ce)||ge,ue=!Z||G;if(me){H()&&m.setOpen(!0,ie(be,z,q));return}we||(V?l.openChangeTimeout.start(V,()=>{ue&&H()&&m.setOpen(!0,ie(be,z,q))}):ue&&H()&&m.setOpen(!0,ie(be,z,q)))}function D(z){if(F()){M();return}S();const j=m.select("domReferenceElement"),V=Se(j);l.restTimeout.clear(),l.restTimeoutPending=!1;const X=b.current.floatingContext??x?.();if(Mt(z.relatedTarget,m.context.triggerElements))return;if(T.current&&X){m.select("open")||l.openChangeTimeout.clear();const te=a.current;l.handler=T.current({...X,tree:R,x:z.clientX,y:z.clientY,onClose(){M(),S(),E.current&&!F()&&te===m.select("domReferenceElement")&&P(z,!0)}}),V.addEventListener("mousemove",l.handler),l.handler(z);return}(l.pointerType==="touch"?!le(m.select("floatingElement"),z.relatedTarget):!0)&&P(z)}function K(z){le(A,z.relatedTarget)||(l.openChangeTimeout.clear(),l.restTimeout.clear(),l.restTimeoutPending=!1)}const $=v?Te(A,"mouseout",K):void 0;return c?Tt(Te(A,"mousemove",w,{once:!0}),Te(A,"mouseenter",w),Te(A,"mouseleave",D),$):Tt(Te(A,"mouseenter",w),Te(A,"mouseleave",D),$)},[S,M,b,f,m,n,T,l,d,B,F,s,c,O,a,R,E,x,I,H,v]),u.useMemo(()=>{if(!n)return;function P(A){l.pointerType=A.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(A){const{nativeEvent:w}=A,D=A.currentTarget,K=m.select("domReferenceElement"),$=m.select("open"),z=B(K,D,A.target);if(s&&!Je(l.pointerType))return;if($&&z&&l.handleCloseOptions?.blockPointerEvents){const X=m.select("floatingElement");if(X){const W=l.handleCloseOptions?.getScope?.()??D.ownerDocument.body;Ro(l,{scopeElement:W,referenceElement:D,floatingElement:X})}}const j=An(O.current);if($&&!z||j===0||!z&&l.restTimeoutPending&&A.movementX**2+A.movementY**2<2)return;l.restTimeout.clear();function V(){if(l.restTimeoutPending=!1,F())return;const X=m.select("open");!l.blockMouseMove&&(!X||z)&&H()&&m.setOpen(!0,ie(be,w,D))}l.pointerType==="touch"?Ct.flushSync(()=>{V()}):z&&$?V():(l.restTimeoutPending=!0,l.restTimeout.start(j,V))}}},[n,l,F,B,s,m,O,H])}const ni="Escape";function Hn(e){return to&&e.movementX===0&&e.movementY===0}function Vt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function xt(e,t){return Vt(t,e===no||e===sn,e===Nt||e===Ht)}function Xt(e,t,n){return Vt(t,e===sn,n?e===Nt:e===Ht)||e==="Enter"||e===" "||e===""}function oi(e,t,n){return Vt(t,n?e===Nt:e===Ht,e===sn)}function ri(e,t,n,o){const r=n?e===Ht:e===Nt,s=e===no;return t==="both"||t==="horizontal"&&o?e===ni:Vt(t,r,s)}function si(e,t){const{listRef:n,activeIndex:o,onNavigate:r=()=>{},enabled:s=!0,selectedIndex:i=null,allowEscape:c=!1,loopFocus:a=!1,nested:h=!1,rtl:d=!1,virtual:x=!1,focusItemOnOpen:g="auto",focusItemOnHover:p=!0,openOnArrowKeyDown:v=!0,disabledIndices:m=void 0,orientation:b="vertical",parentOrientation:y,id:R,resetOnPointerLeave:l=!0,externalTree:C,grid:T}=t,f=T!=null,O="rootStore"in e?e.rootStore:e,E=O.useState("open"),k=O.useState("floatingElement"),I=O.useState("domReferenceElement"),F=O.context.dataRef,H=Qo(k),B=Jo(I),S=Re(H),M=Lt(),P=ft(C),A=u.useRef(g),w=u.useRef(i??-1),D=u.useRef(null),K=u.useRef(!0),$=pe(N=>{r(w.current===-1?null:w.current,N)}),z=u.useRef(!!k),j=u.useRef(E),V=u.useRef(!1),X=u.useRef(!1),W=u.useRef(null),te=Re(m),q=Re(E),G=Re(i),Z=Re(l),re=Qt(),ce=Qt(),ge=pe(()=>{function N(L){x?P?.events.emit("virtualfocus",L):W.current=Zo(L,{sync:V.current,preventScroll:!0})}const _=n.current[w.current],ae=X.current;_&&N(_),(V.current?L=>L():L=>re.request(L))(()=>{const L=n.current[w.current]||_;if(!L)return;_||N(L),fe&&(ae||!K.current)&&L.scrollIntoView?.({block:"nearest",inline:"nearest"})})});de(()=>{F.current.orientation=b},[F,b]),de(()=>{s&&(E&&k?(w.current=i??-1,A.current&&i!=null&&(X.current=!0,$())):z.current&&(w.current=-1,$()))},[s,E,k,i,$]),de(()=>{if(s){if(!E){V.current=!1;return}if(k)if(o==null){if(V.current=!1,G.current!=null)return;if(z.current&&(w.current=-1,ge()),(!j.current||!z.current)&&A.current&&(D.current!=null||A.current===!0&&D.current==null)){let N=0;const _=()=>{n.current[0]==null?(N<2&&(N?U=>ce.request(U):queueMicrotask)(_),N+=1):(w.current=D.current==null||Xt(D.current,b,d)||h?Ut(n):Tn(n),D.current=null,$())};_()}}else Cn(n.current,o)||(w.current=o,ge(),X.current=!1)}},[s,E,k,o,G,h,n,b,d,$,ge,ce]),de(()=>{if(!s||k||!P||x||!z.current)return;const N=P.nodesRef.current,_=N.find(L=>L.id===M)?.context?.elements.floating,ae=ct(Se(I??_??null)),U=N.some(L=>L.context&&le(L.context.elements.floating,ae));_&&!U&&K.current&&_.focus({preventScroll:!0})},[s,k,I,P,M,x]),de(()=>{j.current=E,z.current=!!k}),de(()=>{E||(D.current=null,A.current=g)},[E,g]);const we=o!=null,me=pe(N=>{if(!q.current)return;const _=n.current.indexOf(N.currentTarget);_!==-1&&(w.current!==_||o!==_)&&(w.current=_,$(N))}),ue=pe(()=>y??P?.nodesRef.current.find(N=>N.id===M)?.context?.dataRef?.current.orientation),ye=pe(()=>Ut(n,te.current)),ve=pe(N=>{if(K.current=!1,V.current=!0,N.which===229||!q.current&&N.currentTarget===S.current)return;if(h&&ri(N.key,b,d,f)){xt(N.key,ue())||Ne(N),O.setOpen(!1,ie(en,N.nativeEvent)),ke(I)&&(x?P?.events.emit("virtualfocus",I):I.focus());return}const _=w.current,ae=Ut(n,m),U=Tn(n,m);if(B||(N.key==="Home"&&(Ne(N),w.current=ae,$(N)),N.key==="End"&&(Ne(N),w.current=U,$(N))),T!=null){const L=T(N,w.current,n,b,a,d,m,ae,U);if(L!=null&&(w.current=L,$(N)),b==="both")return}if(xt(N.key,b)){if(Ne(N),E&&!x&&ct(N.currentTarget.ownerDocument)===N.currentTarget){w.current=Xt(N.key,b,d)?ae:U,$(N);return}Xt(N.key,b,d)?a?_>=U?c&&_!==n.current.length?w.current=-1:(V.current=!1,w.current=ae):w.current=mt(n.current,{startingIndex:_,disabledIndices:m}):w.current=Math.min(U,mt(n.current,{startingIndex:_,disabledIndices:m})):a?_<=ae?c&&_!==-1?w.current=n.current.length:(V.current=!1,w.current=U):w.current=mt(n.current,{startingIndex:_,decrement:!0,disabledIndices:m}):w.current=Math.max(ae,mt(n.current,{startingIndex:_,decrement:!0,disabledIndices:m})),Cn(n.current,w.current)&&(w.current=-1),$(N)}}),fe=u.useMemo(()=>({onFocus(_){V.current=!0,me(_)},onClick:({currentTarget:_})=>_.focus({preventScroll:!0}),onMouseMove(_){Hn(_)||(V.current=!0,X.current=!1,p&&me(_))},onPointerLeave(_){if(!q.current||!K.current||_.pointerType==="touch")return;V.current=!0;const ae=_.relatedTarget;if(!(!p||n.current.includes(ae))&&Z.current&&(W.current?.(),W.current=null,w.current=-1,$(_),!x)){const U=S.current,L=ct(Se(U));U&&le(U,L)&&U.focus({preventScroll:!0})}}}),[me,q,S,p,n,$,Z,x]),J=u.useMemo(()=>x&&E&&we&&{"aria-activedescendant":`${R}-${o}`},[x,E,we,R,o]),Y=u.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...B?{}:J,onKeyDown(N){if(N.key==="Tab"&&N.shiftKey&&E&&!x){const _=nt(N.nativeEvent);if(_&&!le(S.current,_))return;Ne(N),O.setOpen(!1,ie(Ot,N.nativeEvent)),ke(I)&&I.focus();return}ve(N)},onPointerMove(N){Hn(N)||(K.current=!0)}}),[J,ve,S,b,B,O,E,x,I]),he=u.useMemo(()=>{function N(U){O.setOpen(!0,ie(en,U.nativeEvent,U.currentTarget))}function _(U){g==="auto"&&er(U.nativeEvent)&&(A.current=!x)}function ae(U){A.current=g,g==="auto"&&Zn(U.nativeEvent)&&(A.current=!0)}return{onKeyDown(U){const L=O.select("open");K.current=!1;const ne=U.key.startsWith("Arrow"),xe=oi(U.key,ue(),d),Ge=xt(U.key,b),Ve=(h?xe:Ge)||U.key==="Enter"||U.key.trim()==="";if(x&&L)return ve(U);if(!(!L&&!v&&ne)){if(Ve){const De=xt(U.key,ue());D.current=h&&De?null:U.key}if(h){xe&&(Ne(U),L?(w.current=ye(),$(U)):N(U));return}Ge&&(G.current!=null&&(w.current=G.current),Ne(U),!L&&v?N(U):ve(U),L&&$(U))}},onFocus(U){O.select("open")&&!x&&(w.current=-1,$(U))},onPointerDown:ae,onPointerEnter:ae,onMouseDown:_,onClick:_}},[ve,g,ye,h,$,O,v,b,ue,d,G,x]),Ke=u.useMemo(()=>({...J,...he}),[J,he]);return u.useMemo(()=>s?{reference:Ke,floating:Y,item:fe,trigger:he}:{},[s,Ke,Y,he,fe])}function ii(e,t){const{listRef:n,elementsRef:o,activeIndex:r,onMatch:s,disabledIndices:i,onTyping:c,enabled:a=!0,resetMs:h=750,selectedIndex:d=null}=t,x="rootStore"in e?e.rootStore:e,g=x.useState("open"),p=_e(),v=u.useRef(""),m=u.useRef(d??r??-1),b=u.useRef(null),y=pe(C=>{function T(S){return o?.current[S]}function f(S){const M=T(S);return M&&!tr(M)||M?.matches(":disabled")?!1:i==null||!nr(qn,S,i)}function O(S,M,P=0){if(S.length===0)return-1;const A=(P%S.length+S.length)%S.length,w=M.toLowerCase();for(let D=0;D<S.length;D+=1){const K=(A+D)%S.length;if(!(!S[K]?.toLowerCase().startsWith(w)||!f(K)))return K}return-1}const E=n.current;if(v.current.length>0&&C.key===" "&&(Ne(C),c?.(!0)),v.current.length>0&&v.current[0]!==" "&&O(E,v.current)===-1&&C.key!==" "&&c?.(!1),E==null||C.key.length!==1||C.ctrlKey||C.metaKey||C.altKey)return;g&&C.key!==" "&&(Ne(C),c?.(!0));const k=v.current==="";k&&(m.current=d??r??-1),E.every((S,M)=>S&&f(M)?S[0]?.toLowerCase()!==S[1]?.toLowerCase():!0)&&v.current===C.key&&(v.current="",m.current=b.current),v.current+=C.key,p.start(h,()=>{v.current="",m.current=b.current,c?.(!1)});const H=((k?d??r??-1:m.current)??0)+1,B=O(E,v.current,H);B!==-1?(s?.(B),b.current=B):C.key!==" "&&(v.current="",c?.(!1))}),R=pe(C=>{const T=C.relatedTarget,f=x.select("domReferenceElement"),O=x.select("floatingElement");le(f,T)||le(O,T)||(p.clear(),v.current="",m.current=b.current,c?.(!1))});de(()=>{!g&&d!==null||(p.clear(),b.current=null,v.current!==""&&(v.current=""))},[g,d,p]);const l=u.useMemo(()=>({onKeyDown:y,onBlur:R}),[y,R]);return u.useMemo(()=>a?{reference:l,floating:l}:{},[a,l])}const Bn=.1,ci=Bn*Bn,oe=.5;function yt(e,t,n,o,r,s){return o>=t!=s>=t&&e<=(r-n)*(t-o)/(s-o)+n}function vt(e,t,n,o,r,s,i,c,a,h){let d=!1;return yt(e,t,n,o,r,s)&&(d=!d),yt(e,t,r,s,i,c)&&(d=!d),yt(e,t,i,c,a,h)&&(d=!d),yt(e,t,a,h,n,o)&&(d=!d),d}function ai(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Rt(e,t,n,o,r,s){const i=Math.min(n,r),c=Math.max(n,r),a=Math.min(o,s),h=Math.max(o,s);return e>=i&&e<=c&&t>=a&&t<=h}function li(e={}){const{blockPointerEvents:t=!1}=e,n=new Jt,o=({x:r,y:s,placement:i,elements:c,onClose:a,nodeId:h,tree:d})=>{const x=i?.split("-")[0];let g=!1,p=null,v=null,m=typeof performance<"u"?performance.now():0;function b(R,l){const C=performance.now(),T=C-m;if(p===null||v===null||T===0)return p=R,v=l,m=C,!1;const f=R-p,O=l-v,E=f*f+O*O,k=T*T*ci;return p=R,v=l,m=C,E<k}function y(){n.clear(),a()}return function(l){n.clear();const C=c.domReference,T=c.floating;if(!C||!T||x==null||r==null||s==null)return;const{clientX:f,clientY:O}=l,E=nt(l),k=l.type==="mouseleave",I=le(T,E),F=le(C,E);if(I&&(g=!0,!k))return;if(F&&(g=!1,!k)){g=!0;return}if(k&&se(l.relatedTarget)&&le(T,l.relatedTarget))return;function H(){return!!(d&&Zt(d.nodesRef.current,h).length>0)}function B(){H()||y()}if(H())return;const S=C.getBoundingClientRect(),M=T.getBoundingClientRect(),P=r>M.right-M.width/2,A=s>M.bottom-M.height/2,w=M.width>S.width,D=M.height>S.height,K=(w?S:M).left,$=(w?S:M).right,z=(D?S:M).top,j=(D?S:M).bottom;if(x==="top"&&s>=S.bottom-1||x==="bottom"&&s<=S.top+1||x==="left"&&r>=S.right-1||x==="right"&&r<=S.left+1){B();return}let V=!1;switch(x){case"top":V=Rt(f,O,K,S.top+1,$,M.bottom-1);break;case"bottom":V=Rt(f,O,K,M.top+1,$,S.bottom-1);break;case"left":V=Rt(f,O,M.right-1,j,S.left+1,z);break;case"right":V=Rt(f,O,S.right-1,j,M.left+1,z);break}if(V)return;if(g&&!ai(f,O,S)){B();return}if(!k&&b(f,O)){B();return}let X=!1;switch(x){case"top":{const W=w?oe/2:oe*4,te=w||P?r+W:r-W,q=w?r-W:P?r+W:r-W,G=s+oe+1,Z=P||w?M.bottom-oe:M.top,re=P?w?M.bottom-oe:M.top:M.bottom-oe;X=vt(f,O,te,G,q,G,M.left,Z,M.right,re);break}case"bottom":{const W=w?oe/2:oe*4,te=w||P?r+W:r-W,q=w?r-W:P?r+W:r-W,G=s-oe,Z=P||w?M.top+oe:M.bottom,re=P?w?M.top+oe:M.bottom:M.top+oe;X=vt(f,O,te,G,q,G,M.left,Z,M.right,re);break}case"left":{const W=D?oe/2:oe*4,te=D||A?s+W:s-W,q=D?s-W:A?s+W:s-W,G=r+oe+1,Z=A||D?M.right-oe:M.left,re=A?D?M.right-oe:M.left:M.right-oe;X=vt(f,O,Z,M.top,re,M.bottom,G,te,G,q);break}case"right":{const W=D?oe/2:oe*4,te=D||A?s+W:s-W,q=D?s-W:A?s+W:s-W,G=r-oe,Z=A||D?M.left+oe:M.right,re=A?D?M.left+oe:M.right:M.left+oe;X=vt(f,O,G,te,G,q,Z,M.top,re,M.bottom);break}}X?g||n.start(40,B):B()}};return o.__options={...e,blockPointerEvents:t},o}function ui(e){const t=u.useRef(""),n=u.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:u.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 fi(e,t){const n=pe((s,i)=>{(typeof e=="function"?e():e)||t(i||(or?"touch":""))}),{onClick:o,onPointerDown:r}=ui(n);return u.useMemo(()=>({onClick:o,onPointerDown:r}),[o,r])}function di(e){const[t,n]=u.useState(null),o=fi(e,n);return Xr(e,r=>{r&&!e&&n(null)}),u.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const pi=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:h,padding:d=0,offsetParent:x="real"}=je(e,t)||{};if(h==null)return{};const g=uo(d),p={x:n,y:o},v=fn(r),m=un(v),b=await i.getDimensions(h),y=v==="y",R=y?"top":"left",l=y?"bottom":"right",C=y?"clientHeight":"clientWidth",T=s.reference[m]+s.reference[v]-p[v]-s.floating[m],f=p[v]-s.reference[v],O=x==="real"?await i.getOffsetParent?.(h):c.floating;let E=c.floating[C]||s.floating[m];(!E||!await i.isElement?.(O))&&(E=c.floating[C]||s.floating[m]);const k=T/2-f/2,I=E/2-b[m]/2-1,F=Math.min(g[R],I),H=Math.min(g[l],I),B=F,S=E-b[m]-H,M=E/2-b[m]/2+k,P=lo(B,M,S),A=!a.arrow&&Ue(r)!=null&&M!==P&&s.reference[m]/2-(M<B?F:H)-b[m]/2<0,w=A?M<B?M-B:M-S:0;return{[v]:p[v]+w,data:{[v]:P,centerOffset:M-P-w,...A&&{alignmentOffset:w}},reset:A}}}),gi=(e,t)=>({...pi(e),options:[e,t]}),mi={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-n>=0||i.right-t>=0||i.bottom-n>=0||i.left-t>=0||s}}}},hi={sideX:"left",sideY:"top"},_n="--available-width",Vn="--available-height";function wo(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 Wn(e,t,n){const{rects:o,placement:r}=e;return{side:wo(t,Oe(r),n),align:Ue(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function xi(e){return yi(e,qs)}function yi(e,t){const{anchor:n,positionMethod:o="absolute",side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,collisionBoundary:a,collisionPadding:h=5,sticky:d=!1,arrowPadding:x=5,disableAnchorTracking:g=!1,inline:p,keepMounted:v=!1,floatingRootContext:m,mounted:b,collisionAvoidance:y,shift:R,nodeId:l,adaptiveOrigin:C,lazyFlip:T=!1,externalTree:f}=e,[O,E]=u.useState(null);!b&&O!==null&&E(null);const k=y.side||"flip",I=y.align||"flip",F=y.fallbackAxisSide||"end",H=R?.crossAxis??!1,B=R?.rootBoundary,S=typeof n=="function"?n:void 0,M=pe(S),P=S?M:n,A=Re(n),w=Re(b),K=co()==="rtl",$=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":K?"left":"right","inline-start":K?"right":"left"}[r],z=i==="center"?$:`${$}-${i}`;let j=h;typeof j=="number"?j={top:j,right:j,bottom:j,left:j}:j&&(j={top:j.top||0,right:j.right||0,bottom:j.bottom||0,left:j.left||0});const V=1,X=r==="bottom"?V:0,W=r==="top"?V:0,te=r==="right"?V:0,q=r==="left"?V:0,G={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:j},Z=u.useRef(null),re=Re(s),ce=Re(c),ge=typeof s!="function"?s:0,we=typeof c!="function"?c:0,me=[];p&&me.push(p),me.push(zs(ee=>{const Ce=Wn(ee,r,K),Ie=typeof re.current=="function"?re.current(Ce):re.current,Ee=typeof ce.current=="function"?ce.current(Ce):ce.current;return{mainAxis:Ie,crossAxis:Ee,alignmentAxis:Ee}},[ge,we,K,r]));const ue=I==="none"&&k!=="shift",ye=!ue&&(d||H||k==="shift"),ve=k==="none"?null:Gs({...G,padding:{top:j.top+V+X,right:j.right+V+q,bottom:j.bottom+V+W,left:j.left+V+te},mainAxis:!H&&k==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),fe=ue?null:Us({...G,rootBoundary:B,mainAxis:I!=="none",crossAxis:ye,limiter:d||H?void 0:Ks(ee=>{if(!Z.current)return{};const{width:Ce,height:Ie}=Z.current.getBoundingClientRect(),Ee=Me(Oe(ee.placement)),Le=Ee==="y"?Ce:Ie,Ae=Ee==="y"?j.left+j.right:j.top+j.bottom;return{offset:Le/2+Ae/2}})},[G,d,H,B,j,I]);k==="shift"||I==="shift"||i==="center"?me.push(fe,ve):me.push(ve,fe),me.push(Ys({...G,apply({elements:{floating:ee},availableWidth:Ce,availableHeight:Ie,rects:Ee}){if(!w.current)return;const Le=ee.style;Le.setProperty(_n,`${Ce}px`),Le.setProperty(Vn,`${Ie}px`);const Ae=Pe(ee).devicePixelRatio||1,{x:ot,y:pt,width:gt,height:Wt}=Ee.reference,jt=(Math.round((ot+gt)*Ae)-Math.round(ot*Ae))/Ae,$t=(Math.round((pt+Wt)*Ae)-Math.round(pt*Ae))/Ae;Le.setProperty("--anchor-width",`${jt}px`),Le.setProperty("--anchor-height",`${$t}px`)}}),gi(ee=>({element:Z.current||Se(ee.elements.floating).createElement("div"),padding:x,offsetParent:"floating"}),[x]),{name:"transformOrigin",fn(ee){const{elements:Ce,middlewareData:Ie,placement:Ee,rects:Le,y:Ae}=ee,ot=Oe(Ee),pt=Me(ot),gt=Z.current,Wt=Ie.arrow?.x||0,jt=Ie.arrow?.y||0,$t=gt?.clientWidth||0,Do=gt?.clientHeight||0,zt=Wt+$t/2,wn=jt+Do/2,Lo=Math.abs(Ie.shift?.y||0),No=Le.reference.height/2,rt=typeof s=="function"?s(Wn(ee,r,K)):s,Ho=Lo>rt,Bo={top:`${zt}px calc(100% + ${rt}px)`,bottom:`${zt}px ${-rt}px`,left:`calc(100% + ${rt}px) ${wn}px`,right:`${-rt}px ${wn}px`}[ot],_o=`${zt}px ${Le.reference.y+No-Ae}px`;return Ce.floating.style.setProperty("--transform-origin",ye&&pt==="y"&&Ho?_o:Bo),{}}},mi,C),de(()=>{!b&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,m]);const J=u.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:Y,elements:he,x:Ke,y:N,middlewareData:_,update:ae,placement:U,context:L,isPositioned:ne,floatingStyles:xe}=t({rootContext:m,open:v?b:void 0,placement:z,middleware:me,strategy:o,whileElementsMounted:v?void 0:(...ee)=>Ln(...ee,J),nodeId:l,externalTree:f}),{sideX:Ge,sideY:Ve}=_.adaptiveOrigin||hi,De=ne?o:"fixed",dt=u.useMemo(()=>{let ee;return ne?C?ee={position:De,[Ge]:Ke,[Ve]:N}:ee={...xe,position:De}:ee={position:De,top:0,left:0},ee[_n]="100vw",ee[Vn]="100vh",ne||(ee.opacity=0),ee},[C,De,Ge,Ke,Ve,N,xe,ne]),Ye=u.useRef(null);de(()=>{if(!b)return;const ee=A.current,Ce=typeof ee=="function"?ee():ee,Ee=(jn(Ce)?Ce.current:Ce)||null||null;Ee!==Ye.current&&(Y.setPositionReference(Ee),Ye.current=Ee)},[b,Y,P,A]),u.useEffect(()=>{if(!b)return;const ee=A.current;typeof ee!="function"&&jn(ee)&&ee.current!==Ye.current&&(Y.setPositionReference(ee.current),Ye.current=ee.current)},[b,Y,P,A]),u.useEffect(()=>{if(v&&b&&he.reference&&he.floating)return Ln(he.reference,he.floating,ae,J)},[v,b,he,ae,J]);const Qe=Oe(U),xn=wo(r,Qe,K),yn=Ue(U)||"center",vn=!!_.hide?.referenceHidden;de(()=>{T&&b&&ne&&Qe!==$&&E(Qe)},[T,b,ne,Qe,$]);const Rn=u.useMemo(()=>({position:"absolute",top:_.arrow?.y,left:_.arrow?.x}),[_.arrow]),bn=_.arrow?.centerOffset!==0;return u.useMemo(()=>({positionerStyles:dt,arrowStyles:Rn,arrowRef:Z,arrowUncentered:bn,side:xn,align:yn,physicalSide:Qe,anchorHidden:vn,refs:Y,context:L,isPositioned:ne,update:ae}),[dt,Rn,Z,bn,xn,yn,Qe,vn,Y,L,ne,ae])}function jn(e){return e!=null&&"current"in e}function Eo(e){return e==="starting"?rr:tt}function vi(e,t,{styles:n,transitionStatus:o,props:r,refs:s,hidden:i,inert:c=!1}){const a={...n};return c&&(a.pointerEvents="none"),Fe("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:a},Eo(o),r],stateAttributesMapping:sr})}const Co=u.createContext(void 0);function gn(e){const t=u.useContext(Co);if(t===void 0&&!e)throw new Error(ze(33));return t}const To=u.createContext(void 0);function qe(e){const t=u.useContext(To);if(t===void 0&&!e)throw new Error(ze(36));return t}const Ri=u.createContext(void 0);function mn(e=!0){const t=u.useContext(Ri);if(t===void 0&&!e)throw new Error(ze(25));return t}function bi(e){const{closeOnClick:t,highlighted:n,id:o,nodeId:r,store:s,typingRef:i,itemRef:c,itemMetadata:a}=e,{events:h}=s.useState("floatingTreeRoot"),d=s.useState("open"),x=mn(!0),g=x!==void 0;return u.useMemo(()=>({id:o,role:"menuitem",tabIndex:d&&n?0:-1,onKeyDown(p){p.key===" "&&i?.current&&p.preventDefault()},onMouseMove(p){r&&h.emit("itemhover",{nodeId:r,target:p.currentTarget})},onClick(p){t&&h.emit("close",{domEvent:p,reason:an})},onMouseUp(p){if(x){const v=x.initialCursorPointRef.current;if(x.initialCursorPointRef.current=null,g&&v&&Math.abs(p.clientX-v.x)<=1&&Math.abs(p.clientY-v.y)<=1||g&&!eo&&p.button===2)return}c.current&&s.context.allowMouseUpTriggerRef.current&&(!g||p.button===2)&&a.type==="regular-item"&&jo(c.current,p,{detail:1})}}),[t,n,o,h,r,d,s,i,c,x,g,a])}const Mo={type:"regular-item"};function Oo(e){const{closeOnClick:t,disabled:n,highlighted:o,id:r,store:s,typingRef:i=s.context.typingRef,nativeButton:c,itemMetadata:a,nodeId:h}=e,d=u.useRef(null),{getButtonProps:x,buttonRef:g}=Qn({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),p=bi({closeOnClick:t,highlighted:o,id:r,nodeId:h,store:s,typingRef:i,itemRef:d,itemMetadata:a}),v=u.useCallback(b=>it(p,{onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()}},b,x),[p,x,a]),m=$o(d,g);return u.useMemo(()=>({getItemProps:v,itemRef:m}),[v,m])}let $n=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const So={checked(e){return e?{[$n.checked]:""}:{[$n.unchecked]:""}},...ir},hn=u.createContext(void 0);function wi(){const e=u.useContext(hn);if(e===void 0)throw new Error(ze(31));return e}const Ei=u.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,[c,a]=u.useState(void 0),h=Fe("div",t,{ref:n,props:{role:"group","aria-labelledby":c,...i}});return Q.jsx(hn.Provider,{value:a,children:h})}),Ci=u.forwardRef(function(t,n){const{render:o,className:r,style:s,id:i,...c}=t,a=Bt(i),h=wi();return de(()=>(h(a),()=>{h(d=>d===a?void 0:d)}),[h,a]),Fe("div",t,{ref:n,props:{id:a,role:"presentation",...c}})}),Ti=u.forwardRef(function(t,n){const{render:o,className:r,id:s,label:i,nativeButton:c=!1,disabled:a=!1,closeOnClick:h=!0,style:d,...x}=t,g=ao({guess:!0,label:i}),p=gn(!0),v=Bt(s),{store:m}=qe(),b=m.useState("disabled"),y=a||b,R=m.useState("isActive",g.index),l=m.useState("itemProps"),{getItemProps:C,itemRef:T}=Oo({closeOnClick:h,disabled:y,highlighted:R,id:v,store:m,nativeButton:c,nodeId:p?.context.nodeId,itemMetadata:Mo});return Fe("div",t,{state:{disabled:y,highlighted:R},props:[l,x,C],ref:[T,n,g.ref]})}),Mi=u.createContext(void 0);function Oi(e){return u.useContext(Mi)}const Si=u.forwardRef(function(t,n){const{render:o,className:r,style:s,finalFocus:i,...c}=t,{store:a}=qe(),{side:h,align:d}=gn(),x=Oi()!=null,g=a.useState("open"),p=a.useState("transitionStatus"),v=a.useState("popupProps"),m=a.useState("mounted"),b=a.useState("instantType"),y=a.useState("activeTriggerElement"),R=a.useState("parent"),l=a.useState("lastOpenChangeReason"),C=a.useState("rootId"),T=a.useState("floatingRootContext"),f=a.useState("floatingTreeRoot"),O=a.useState("closeDelay"),E=a.useState("hoverEnabled"),k=a.useState("disabled"),I=a.useState("openMethod"),F=R.type==="context-menu";oo({open:g,ref:a.context.popupRef,onComplete(){g&&a.context.onOpenChangeComplete?.(!0)}}),u.useEffect(()=>{function P(A){a.setOpen(!1,ie(A.reason,A.domEvent))}return f.events.on("close",P),()=>{f.events.off("close",P)}},[f.events,a]),Zs(T,{enabled:E&&!k&&!F&&R.type!=="menubar",closeDelay:O});const H=a.useStateSetter("popupElement"),B={transitionStatus:p,side:h,align:d,open:g,nested:R.type==="menu",instant:b},S=Fe("div",t,{state:B,ref:[n,a.context.popupRef,H],stateAttributesMapping:ar,props:[v,{onKeyDown(P){x&&lr.has(P.key)&&P.stopPropagation()}},Eo(p),c,{"data-rootownerid":C}]});let M=R.type===void 0||F;return(y||R.type==="menubar"&&l!==$r)&&(M=!0),Q.jsx(cr,{context:T,openInteractionType:I,modal:F,disabled:!m,returnFocus:i===void 0?M:i,initialFocus:R.type!=="menu",restoreFocus:!0,externalTree:R.type!=="menubar"?f:void 0,previousFocusableElement:y,nextFocusableElement:R.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:R.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:S})}),Po=u.createContext(void 0);function Pi(){const e=u.useContext(Po);if(e===void 0)throw new Error(ze(32));return e}const Ii=u.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=qe();return s.useState("mounted")||o?Q.jsx(Po.Provider,{value:o,children:Q.jsx(ur,{ref:n,...r})}):null}),Ai=20;function ki(e,t,n,o){const[r,s]=u.useState(!1);de(()=>{if(!e||!t||n==null){s(!1);return}const i=Se(n).documentElement.clientWidth,c=n.offsetWidth;s(i>0&&c>0&&c>=i-Ai)},[e,t,n]),fr(e&&(!t||r),o)}const Fi=u.forwardRef(function(t,n){const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:c,align:a,sideOffset:h=0,alignOffset:d=0,collisionBoundary:x="clipping-ancestors",collisionPadding:g=5,arrowPadding:p=5,sticky:v=!1,disableAnchorTracking:m=!1,collisionAvoidance:b=dr,style:y,...R}=t,{store:l}=qe(),C=Pi(),T=mn(!0),f=l.useState("parent"),O=l.useState("floatingRootContext"),E=l.useState("floatingTreeRoot"),k=l.useState("mounted"),I=l.useState("open"),F=l.useState("modal"),H=l.useState("openMethod"),B=l.useState("activeTriggerElement"),S=l.useState("transitionStatus"),M=l.useState("positionerElement"),P=l.useState("instantType"),A=l.useState("adaptiveOrigin"),w=l.useState("lastOpenChangeReason"),D=l.useState("floatingNodeId"),K=l.useState("floatingParentNodeId"),$=O.useState("domReferenceElement"),z=u.useRef(null),j=pr(M);let V=o,X=h,W=d,te=a,q=b;f.type==="context-menu"&&(V=o??f.context?.anchor,te=te??"start",!c&&te!=="center"&&(W=t.alignOffset??2,X=t.sideOffset??-5));let G=c,Z=te;f.type==="menu"?(G=G??"inline-end",Z=Z??"start",q=t.collisionAvoidance??gr):f.type==="menubar"&&(G=G??(f.context.orientation==="vertical"?"inline-end":"bottom"),Z=Z??"start");const re=f.type==="context-menu",ce=xi({anchor:V,floatingRootContext:O,positionMethod:T?"fixed":r,mounted:k,side:G,sideOffset:X,align:Z,alignOffset:W,arrowPadding:re?0:p,collisionBoundary:x,collisionPadding:g,sticky:v,nodeId:D,keepMounted:C,disableAnchorTracking:m,collisionAvoidance:q,shift:re?{crossAxis:!("side"in q&&q.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:E,adaptiveOrigin:A});u.useEffect(()=>{function J(Y){Y.open&&(Y.parentNodeId===D&&l.set("hoverEnabled",!1),Y.nodeId!==D&&Y.parentNodeId===l.select("floatingParentNodeId")&&l.setOpen(!1,ie(st)))}return E.events.on("menuopenchange",J),()=>{E.events.off("menuopenchange",J)}},[l,E.events,D]),u.useEffect(()=>{if(l.select("floatingParentNodeId")==null)return;function J(Y){if(Y.open||Y.nodeId!==l.select("floatingParentNodeId"))return;const he=Y.reason??st;l.setOpen(!1,ie(he))}return E.events.on("menuopenchange",J),()=>{E.events.off("menuopenchange",J)}},[E.events,l]);const ge=_e();u.useEffect(()=>{I||ge.clear()},[I,ge]),u.useEffect(()=>{function J(Y){if(!(!I||Y.nodeId!==l.select("floatingParentNodeId")))if(Y.target&&B&&B!==Y.target){const he=l.select("closeDelay");he>0?ge.isStarted()||ge.start(he,()=>{l.setOpen(!1,ie(st))}):l.setOpen(!1,ie(st))}else ge.clear()}return E.events.on("itemhover",J),()=>{E.events.off("itemhover",J)}},[E.events,I,B,l,ge]),u.useEffect(()=>{const J={open:I,nodeId:D,parentNodeId:K,reason:l.select("lastOpenChangeReason")};E.events.emit("menuopenchange",J)},[E.events,I,l,D,K]),de(()=>{const J=$,Y=z.current;if(J&&(z.current=J),Y&&J&&J!==Y){l.set("instantType",void 0);const he=new AbortController;return j(()=>{l.set("instantType","trigger-change")},he.signal),()=>{he.abort()}}},[$,j,l]);const we={open:I,side:ce.side,align:ce.align,anchorHidden:ce.anchorHidden,nested:f.type==="menu",instant:P},me=f.type==="menubar"&&f.context.modal;ki(I&&(me||F&&w!==be),H==="touch",M,B);const ye=vi(t,we,{styles:ce.positionerStyles,transitionStatus:S,props:R,refs:[n,l.useStateSetter("positionerElement")],hidden:!k,inert:!I}),ve=k&&f.type!=="menu"&&(f.type!=="menubar"&&F&&w!==be||f.type==="menubar"&&f.context.modal);let fe=null;return f.type==="menubar"?fe=f.context.contentElement:f.type===void 0&&(fe=B),Q.jsxs(Co.Provider,{value:ce,children:[ve&&Q.jsx(mr,{ref:f.type==="context-menu"||f.type==="nested-context-menu"?f.context.internalBackdropRef:null,inert:hr(!I),cutout:fe}),Q.jsx(xr,{id:D,children:Q.jsx(Gr,{elementsRef:l.context.itemDomElements,labelsRef:l.context.itemLabels,children:ye})})]})}),Io=u.createContext(void 0);function Di(){const e=u.useContext(Io);if(e===void 0)throw new Error(ze(34));return e}const Li=u.memo(u.forwardRef(function(t,n){const{render:o,className:r,value:s,defaultValue:i,onValueChange:c,disabled:a=!1,style:h,"aria-labelledby":d,...x}=t,[g,p]=u.useState(void 0),[v,m]=zr({controlled:s,default:i,name:"MenuRadioGroup"}),b=pe((C,T)=>{c?.(C,T),!T.isCanceled&&m(C)}),R=Fe("div",t,{state:{disabled:a},ref:n,props:{role:"group","aria-labelledby":d??g,"aria-disabled":a||void 0,...x}}),l=u.useMemo(()=>({value:v,setValue:b,disabled:a}),[v,b,a]);return Q.jsx(hn.Provider,{value:p,children:Q.jsx(Io.Provider,{value:l,children:R})})})),Ao=u.createContext(void 0);function Ni(){const e=u.useContext(Ao);if(e===void 0)throw new Error(ze(35));return e}const Hi=u.forwardRef(function(t,n){const{render:o,className:r,id:s,label:i,nativeButton:c=!1,disabled:a=!1,closeOnClick:h=!1,value:d,style:x,...g}=t,p=ao({guess:!0,label:i}),v=gn(!0),m=Bt(s),{store:b}=qe(),y=b.useState("isActive",p.index),R=b.useState("itemProps"),{value:l,setValue:C,disabled:T}=Di(),f=b.useState("disabled"),O=a||T||f,E=l===d,{getItemProps:k,itemRef:I}=Oo({closeOnClick:h,disabled:O,highlighted:y,id:m,store:b,nativeButton:c,nodeId:v?.context.nodeId,itemMetadata:Mo}),F=u.useMemo(()=>({disabled:O,highlighted:y,checked:E}),[O,y,E]);function H(S){const M=ie(an,S.nativeEvent,void 0,{preventUnmountOnClose:Yn});C(d,M)}const B=Fe("div",t,{state:F,stateAttributesMapping:So,props:[R,{role:"menuitemradio","aria-checked":E,onClick:H},g,k],ref:[I,n,p.ref]});return Q.jsx(Ao.Provider,{value:F,children:B})}),Bi=u.forwardRef(function(t,n){const{render:o,className:r,style:s,keepMounted:i=!1,...c}=t,a=Ni(),h=u.useRef(null),{transitionStatus:d,mounted:x,setMounted:g}=yr(a.checked);oo({open:a.checked,ref:h,onComplete(){a.checked||g(!1)}});const p={checked:a.checked,disabled:a.disabled,highlighted:a.highlighted,transitionStatus:d};return Fe("span",t,{state:p,stateAttributesMapping:So,ref:[n,h],props:{"aria-hidden":!0,...c},enabled:i||x})}),_i=u.createContext(null);function ko(e){return u.useContext(_i)}const Vi={...Rr,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class Wi extends vr{constructor(t){super({...$i(),...t},ji(),Vi),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let o=n.store.select("rootId"),r=n.store.select("floatingTreeRoot"),s=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const i=n.store.select("rootId"),c=n.store.select("floatingTreeRoot"),a=n.store.select("keyboardEventRelay");o===i&&r===c&&s===a||(o=i,r=c,s=a,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}unsubscribeParentListener=null}function ji(){return{positionerRef:u.createRef(),popupRef:u.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:u.createRef(),beforeContentFocusGuardRef:u.createRef(),onOpenChangeComplete:void 0,triggerElements:new wr}}function $i(){return{...br(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ro,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:tt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}const zi=u.createContext(void 0);function Ui(){return u.useContext(zi)}const Ki=Er(function(t){const{children:n,open:o,onOpenChange:r,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:c=!1,modal:a,loopFocus:h=!0,orientation:d="vertical",actionsRef:x,closeParentOnEsc:g=!1,handle:p,triggerId:v,defaultTriggerId:m=null,highlightItemOnHover:b=!0}=t,y=mn(!0),R=qe(!0),l=ko(!0),C=Ui(),T=u.useMemo(()=>C&&R?{type:"menu",store:R.store}:l?{type:"menubar",context:l}:y&&!R?{type:"context-menu",context:y}:{type:void 0},[y,R,l,C]),f=Gi({open:i,openProp:o,activeTriggerId:m,triggerIdProp:v,parent:T});f.useControlledProp("openProp",o),f.useControlledProp("triggerIdProp",v),f.useContextCallback("onOpenChangeComplete",s);const O=Sn(),E=Sn(),k=f.useState("floatingTreeRoot"),I=so(k),F=Lt(),H=f.useState("open"),B=f.useState("activeTriggerElement"),S=f.useState("positionerElement"),M=f.useState("hoverEnabled"),P=f.useState("disabled"),A=f.useState("lastOpenChangeReason"),w=f.useState("parent"),D=f.useState("activeIndex"),K=f.useState("payload"),$=f.useState("floatingParentNodeId"),z=u.useRef(null),j=u.useRef(w.type!=="context-menu"),V=_e(),X=u.useRef(!0),W=_e(),te=$!=null,{openMethod:q,triggerProps:G}=di(H);f.useSyncedValues({disabled:c,highlightItemOnHover:b,modal:w.type===void 0?a:void 0,openMethod:q,rootId:O}),Cr(f);const{forceUnmount:Z}=Tr(H,f,()=>{f.set("allowMouseEnter",!1)});de(()=>{y&&!R?f.update({parent:{type:"context-menu",context:y},floatingNodeId:I,floatingParentNodeId:F}):R&&f.update({floatingNodeId:I,floatingParentNodeId:F})},[y,R,I,F,f]),u.useEffect(()=>{if(H||(z.current=null),w.type==="context-menu"){if(!H){V.clear(),j.current=!1;return}V.start(500,()=>{j.current=!0})}},[V,H,w.type]),de(()=>{!H&&!M&&f.set("hoverEnabled",!0)},[H,M,f]);const re=pe((L,ne)=>{const xe=ne.reason;if(!L&&!f.select("open")||H===L&&ne.trigger===B&&A===xe)return;const Ge=Mr(ne);if(!L&&ne.trigger==null&&(ne.trigger=B??void 0),r?.(L,ne),ne.isCanceled)return;f.state.floatingRootContext.dispatchOpenChange(L,ne);const Ve=ne.event;if(L===!1&&Ve?.type==="click"&&Ve.pointerType==="touch"&&!X.current)return;L&&xe===at?(X.current=!1,W.start(300,()=>{X.current=!0})):(X.current=!0,W.clear());const De=(xe===cn||xe===an)&&Ve.detail===0,dt=!L&&(xe===io||xe==null),Ye={open:L,openChangeReason:xe};z.current=ne.event,Or(Ye,L,ne.trigger,Ge()),f.update(Ye),w.type==="menubar"&&(xe===at||xe===Ot||xe===be||xe===en||xe===st)?f.set("instantType","group"):De||dt?f.set("instantType",De?"click":"dismiss"):f.set("instantType",void 0)}),ce=Sr({popupStore:f,floatingId:E,nested:F!=null,onOpenChange:re}),ge=ce.context.events;de(()=>{const L=({open:ne,eventDetails:xe})=>re(ne,xe);return ge.on("setOpen",L),()=>{ge?.off("setOpen",L)}},[ge,re]);const we=u.useCallback(()=>{f.setOpen(!1,ie(Ur))},[f]);u.useImperativeHandle(x,()=>({unmount:Z,close:we}),[Z,we]);let me;w.type==="context-menu"&&(me=w.context),u.useImperativeHandle(me?.positionerRef,()=>S,[S]),u.useImperativeHandle(me?.actionsRef,()=>({setOpen:re}),[re]);const ue=Pr(ce,{enabled:!P,bubbles:{escapeKey:g&&w.type==="menu"},outsidePress(){return w.type!=="context-menu"||z.current?.type==="contextmenu"?!0:j.current},externalTree:te?k:void 0}),ye=co(),ve=u.useCallback(L=>{f.select("activeIndex")!==L&&f.set("activeIndex",L)},[f]),fe=si(ce,{enabled:!P,listRef:f.context.itemDomElements,activeIndex:D,nested:w.type!==void 0,loopFocus:h,orientation:d,parentOrientation:w.type==="menubar"?w.context.orientation:void 0,rtl:ye==="rtl",disabledIndices:qn,onNavigate:ve,openOnArrowKeyDown:w.type!=="context-menu",externalTree:te?k:void 0,focusItemOnHover:b}),J=u.useCallback(L=>{f.context.typingRef.current=L},[f]),Y=ii(ce,{enabled:!P,listRef:f.context.itemLabels,elementsRef:f.context.itemDomElements,activeIndex:D,resetMs:Ir,onMatch:L=>{H&&L!==D&&f.set("activeIndex",L)},onTyping:J}),he=u.useMemo(()=>{const L=it(Y.reference,fe.reference,ue.reference,{onMouseMove(){f.set("allowMouseEnter",!0)}},G);return L["aria-haspopup"]="menu",L["aria-expanded"]=H,L},[f,Y.reference,fe.reference,ue.reference,G,H]),Ke=u.useMemo(()=>{const L=it(fe.trigger,ue.trigger,G);return L["aria-haspopup"]="menu",L["aria-expanded"]=!1,L},[fe.trigger,ue.trigger,G]),N=u.useMemo(()=>it(Ar,{id:E,role:"menu","aria-labelledby":B?.id,onMouseMove(){f.set("allowMouseEnter",!0),w.type==="menu"&&f.set("hoverEnabled",!1)},onClick(){f.select("hoverEnabled")&&f.set("hoverEnabled",!1)},onKeyDown(L){const ne=f.select("keyboardEventRelay");ne&&!L.isPropagationStopped()&&ne(L)}},Y.floating,fe.floating,ue.floating),[B,E,w.type,f,Y.floating,fe.floating,ue.floating]),_=fe.item??tt;kr(f,{floatingRootContext:ce,activeTriggerProps:he,inactiveTriggerProps:Ke,popupProps:N,itemProps:_});const ae=u.useMemo(()=>({store:f,parent:T}),[f,T]),U=Q.jsxs(To.Provider,{value:ae,children:[p&&Q.jsx(Fr,{handle:p,store:f}),typeof n=="function"?n({payload:K}):n]});return w.type===void 0||w.type==="context-menu"?Q.jsx(Dr,{externalTree:k,children:U}):U});function Gi(e){return Xn(()=>new Wi(e)).current}const bt=5;function Yi(e,t){const n=Xi(t);return e.clientX>=n.left-bt&&e.clientX<=n.right+bt&&e.clientY>=n.top-bt&&e.clientY<=n.bottom+bt}function Xi(e){const t=e.getBoundingClientRect(),n=Pe(e);if(Lr)return t;const o=n.getComputedStyle(e,"::before"),r=n.getComputedStyle(e,"::after");if(!(o.content!=="none"||r.content!=="none"))return t;const i=parseFloat(o.width)||0,c=parseFloat(o.height)||0,a=parseFloat(r.width)||0,h=parseFloat(r.height)||0,d=Math.max(t.width,i,a),x=Math.max(t.height,c,h),g=d-t.width,p=x-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-p/2,bottom:t.bottom+p/2}}function Fo(e){if(ke(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Et(e))return Fo(lt(e))}function qi(e,t){const n=u.useRef(null);function o(s){Ct.flushSync(()=>{e.setOpen(!1,ie(Ot,s.nativeEvent,s.currentTarget))}),_r(n.current)?.focus()}function r(s){const i=e.select("positionerElement");if(i&&Nr(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{Ct.flushSync(()=>{e.setOpen(!1,ie(Ot,s.nativeEvent,s.currentTarget))});let c=Hr(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&le(i,c);){const a=c;if(c=Br(c),c===a)break}c?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:o,handleFocusTargetFocus:r}}function Qi(e){const{enabled:t=!0,mouseDownAction:n,open:o}=e,r=u.useRef(!1);return u.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!o||n==="close"&&o)&&(r.current=!0,Se(s.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:s=>{r.current&&(r.current=!1,s.preventBaseUIHandler())}}:tt,[t,n,o])}const Ji=Vr(function(t,n){const{render:o,className:r,style:s,disabled:i=!1,nativeButton:c=!0,id:a,openOnHover:h,delay:d=100,closeDelay:x=0,handle:g,payload:p,...v}=t,m=qe(!0),y=Xs(g)??m?.store;if(!y)throw new Error(ze(85));const R=Bt(a),l=y.useState("isTriggerActive",R),C=y.useState("floatingRootContext"),T=y.useState("isOpenedByTrigger",R),f=y.useState("triggerPopupId",R),O=u.useRef(null),E=ec(),k=zo(!0),I=ft(),F=u.useMemo(()=>I??new ro,[I]),H=so(F),B=Lt(),{registerTrigger:S,isMountedByThisTrigger:M}=Wr(R,O,y,{payload:p,closeDelay:x,parent:E,floatingTreeRoot:F,floatingNodeId:H,floatingParentNodeId:B,keyboardEventRelay:k?.relayKeyboardEvent}),P=E.type==="menubar",A=y.useState("disabled"),w=i||A||P&&E.context.disabled,{getButtonProps:D,buttonRef:K}=Qn({disabled:w,native:c});u.useEffect(()=>{!T&&E.type===void 0&&(y.context.allowMouseUpTriggerRef.current=!1)},[y,T,E.type]);const $=u.useRef(null),z=_e(),j=pe(J=>{if(!$.current)return;z.clear(),y.context.allowMouseUpTriggerRef.current=!1;const Y=J.target;le($.current,Y)||le(y.select("positionerElement"),Y)||Y===$.current||Y!=null&&Fo(Y)===y.select("rootId")||Yi(J,$.current)||F.events.emit("close",{domEvent:J,reason:Kr})});u.useEffect(()=>{T&&y.select("lastOpenChangeReason")===be&&Se($.current).addEventListener("mouseup",j,{once:!0})},[T,j,y]);const V=P&&E.context.hasSubmenuOpen,W=ti(C,{enabled:(h??V)&&!w&&(!P||V&&!M),handleClose:li({blockPointerEvents:!P}),mouseOnly:!0,move:!1,restMs:E.type===void 0?d:void 0,delay:{close:x},triggerElementRef:O,externalTree:F,isActiveTrigger:l,isClosing:()=>y.select("transitionStatus")==="ending"}),te=Zi(T,y.select("lastOpenChangeReason")),q=ls(C,{enabled:!w,event:T&&P?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:E.type===void 0?te:!1}),G=Js(C,{enabled:!w&&V}),Z=Qi({open:T,enabled:P,mouseDownAction:"open"}),re=u.useMemo(()=>it(G.reference,q.reference),[G.reference,q.reference]),ce=y.useState("triggerProps",M),{preFocusGuardRef:ge,handlePreFocusGuardFocus:we,handleFocusTargetFocus:me}=qi(y,O),ue={disabled:w,open:T},ye=[$,n,K,S,O],ve=[re,W??tt,ce,{"aria-haspopup":"menu","aria-controls":f,id:R,onMouseDown:J=>{if(y.select("open"))return;z.start(200,()=>{y.context.allowMouseUpTriggerRef.current=!0}),Se(J.currentTarget).addEventListener("mouseup",j,{once:!0})}},P?{role:"menuitem"}:{},Z,v,D],fe=Fe("button",t,{enabled:!P,stateAttributesMapping:Mn,state:ue,ref:ye,props:ve});return P?Q.jsx(Yr,{tag:"button",render:o,className:r,style:s,state:ue,refs:ye,props:ve,stateAttributesMapping:Mn}):T?Q.jsxs(u.Fragment,{children:[Q.jsx(On,{ref:ge,onFocus:we},`${R}-pre-focus-guard`),Q.jsx(u.Fragment,{children:fe},R),Q.jsx(On,{ref:y.context.triggerFocusTargetRef,onFocus:me},`${R}-post-focus-guard`)]}):Q.jsx(u.Fragment,{children:fe},R)});function Zi(e,t){const n=_e(),[o,r]=u.useState(!1);return de(()=>{e&&t===be?(r(!0),n.start(jr,()=>{r(!1)})):e||(n.clear(),r(!1))},[e,t,n]),o}function ec(){const e=ko();return u.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}function lc({...e}){return Q.jsx(Ki,{"data-slot":"dropdown-menu",...e})}function uc({...e}){return Q.jsx(Ji,{"data-slot":"dropdown-menu-trigger",...e})}function fc({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:o=4,className:r,...s}){return Q.jsx(Ii,{children:Q.jsx(Fi,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:o,children:Q.jsx(Si,{"data-slot":"dropdown-menu-content",className:ut("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",r),...s})})})}function dc({...e}){return Q.jsx(Ei,{"data-slot":"dropdown-menu-group",...e})}function pc({className:e,inset:t,...n}){return Q.jsx(Ci,{"data-slot":"dropdown-menu-label","data-inset":t,className:ut("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",e),...n})}function gc({className:e,inset:t,variant:n="default",...o}){return Q.jsx(Ti,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ut("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...o})}function mc({...e}){return Q.jsx(Li,{"data-slot":"dropdown-menu-radio-group",...e})}function hc({className:e,children:t,inset:n,...o}){return Q.jsxs(Hi,{"data-slot":"dropdown-menu-radio-item","data-inset":n,className:ut("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[Q.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:Q.jsx(Bi,{children:Q.jsx(Uo,{})})}),t]})}function xc({className:e,...t}){return Q.jsx(is,{"data-slot":"dropdown-menu-separator",className:ut("-mx-1 my-1 h-px bg-border",e),...t})}export{lc as D,cc as E,ac as S,bo as a,ti as b,Js as c,xi as d,vi as e,Zs as f,nn as g,Eo as h,uc as i,fc as j,dc as k,pc as l,gc as m,xc as n,mc as o,hc as p,li as s,Xs as u};
|