@snagset/server 0.1.64 → 0.1.66
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/mail/account.js +65 -0
- package/dist/mail/account.js.map +1 -0
- package/dist/mail/assigned.js +44 -7
- package/dist/mail/assigned.js.map +1 -1
- package/dist/mail/digest.js +37 -5
- package/dist/mail/digest.js.map +1 -1
- package/dist/mail/html.js +147 -0
- package/dist/mail/html.js.map +1 -0
- package/dist/mail/notify.js +39 -13
- package/dist/mail/notify.js.map +1 -1
- package/dist/mail/unsubscribe.js +5 -1
- package/dist/mail/unsubscribe.js.map +1 -1
- package/dist/routes/instance.js +3 -6
- package/dist/routes/instance.js.map +1 -1
- package/dist/routes/invites.js +3 -6
- package/dist/routes/invites.js.map +1 -1
- package/dist/routes/passwordReset.js +2 -17
- package/dist/routes/passwordReset.js.map +1 -1
- package/package.json +1 -1
- package/static/dashboard/assets/{CompositeItem-CNlNRLwm.js → CompositeItem-DUU2dBBI.js} +1 -1
- package/static/dashboard/assets/{CompositeList-CDfO6SCy.js → CompositeList-nzDbuttJ.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-B5-FUf01.js → ConfirmDialog-CHFBH7e-.js} +1 -1
- package/static/dashboard/assets/{CopyButton-CDVY09FZ.js → CopyButton-U3SFd-HD.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-D_hbvXzX.js → FieldItemContext-Ctu8Sx36.js} +1 -1
- package/static/dashboard/assets/{InstallTag-DutQruP1.js → InstallTag-Dv3gaL4O.js} +1 -1
- package/static/dashboard/assets/{InstanceRows-BrXrOXxa.js → InstanceRows-DPIpELtc.js} +1 -1
- package/static/dashboard/assets/{McpTokens-BnhNB_C0.js → McpTokens-yimU884S.js} +1 -1
- package/static/dashboard/assets/{Picker-BvdKGeU8.js → Picker-CCAp0603.js} +1 -1
- package/static/dashboard/assets/{SaveState-DrWU77oO.js → SaveState-zj94ZTUn.js} +1 -1
- package/static/dashboard/assets/_-C2HgkYw_.js +1 -0
- package/static/dashboard/assets/{_app-MqqZ5rHF.js → _app-Boi8G11t.js} +1 -1
- package/static/dashboard/assets/{_app-DalVfhNg.js → _app-CPD7sbIv.js} +1 -1
- package/static/dashboard/assets/_app-Cy8QntP-.js +1 -0
- package/static/dashboard/assets/{activity-B1fOkSrs.js → activity-BXgHGBG-.js} +1 -1
- package/static/dashboard/assets/{arrow-left-B4-bJVcO.js → arrow-left-BWxLUUtR.js} +1 -1
- package/static/dashboard/assets/{avatar-B-4Lv0hf.js → avatar-C272UWe3.js} +1 -1
- package/static/dashboard/assets/{badge-Cwf-GPv8.js → badge-CYPTl0cy.js} +1 -1
- package/static/dashboard/assets/{check-26YOtWVN.js → check-2F6z9BBy.js} +1 -1
- package/static/dashboard/assets/{chevron-down-OinKSKsq.js → chevron-down-Co3oKci1.js} +1 -1
- package/static/dashboard/assets/{chevron-right-Dh7TD2kW.js → chevron-right-DMXTfy_h.js} +1 -1
- package/static/dashboard/assets/{copy-DqhiNOHN.js → copy-B-mCACcx.js} +1 -1
- package/static/dashboard/assets/{createBaseUIEventDetails-BlUeVOHL.js → createBaseUIEventDetails-67bayC1B.js} +1 -1
- package/static/dashboard/assets/{dialog-CjX41K4h.js → dialog-l22OkYXh.js} +1 -1
- package/static/dashboard/assets/{dropdown-menu-BejmUTVa.js → dropdown-menu-CIJhCtDQ.js} +1 -1
- package/static/dashboard/assets/{forgot-Cv_EPbZy.js → forgot-ykPZ1Kdg.js} +1 -1
- package/static/dashboard/assets/{getPseudoElementBounds-087ogDm1.js → getPseudoElementBounds-D9YqITSR.js} +1 -1
- package/static/dashboard/assets/{image-off-BsOmKpjU.js → image-off-BkVnePLU.js} +1 -1
- package/static/dashboard/assets/{index-CUBD0DcL.js → index-BC1mWQy8.js} +12 -12
- package/static/dashboard/assets/{inertValue-BxLh7N1J.js → inertValue-Dy4HJtbg.js} +1 -1
- package/static/dashboard/assets/{invite-DrxWT0UW.js → invite-DDvCZ3v_.js} +1 -1
- package/static/dashboard/assets/{label-BoGrNcZ0.js → label-Des6lF0o.js} +1 -1
- package/static/dashboard/assets/{layout-grid-D1FcD4G3.js → layout-grid-ojTM11RH.js} +1 -1
- package/static/dashboard/assets/me-DWKKjc2l.js +1 -0
- package/static/dashboard/assets/{plus-ChodljzA.js → plus-CqHIH0K8.js} +1 -1
- package/static/dashboard/assets/{reset-DoB5fAkF.js → reset-GkTsanrN.js} +1 -1
- package/static/dashboard/assets/{s._site-Xu1MbYF_.js → s._site-DuFqROtI.js} +1 -1
- package/static/dashboard/assets/{s._site.comments-63OF736E.js → s._site.comments-DwPDdi_u.js} +1 -1
- package/static/dashboard/assets/{s._site.reviewers-BZ6tbe9V.js → s._site.reviewers-BdujL59q.js} +1 -1
- package/static/dashboard/assets/{s._site.settings-Bx21kvsO.js → s._site.settings-0uXBXAn-.js} +1 -1
- package/static/dashboard/assets/{setup-AHjI1DnF.js → setup-CGKTYRhS.js} +1 -1
- package/static/dashboard/assets/{sign-in-D-Y_lran.js → sign-in-BFx4q3Vl.js} +1 -1
- package/static/dashboard/assets/{sign-up-B8RiXKrs.js → sign-up-BeS3OqBr.js} +1 -1
- package/static/dashboard/assets/{sites-BcEIT4Tw.js → sites-DWQtdLHK.js} +1 -1
- package/static/dashboard/assets/{studio-Dg6dFTZ5.js → studio-DxClsYRz.js} +1 -1
- package/static/dashboard/assets/studio-gXJp7MI3.js +1 -0
- package/static/dashboard/assets/{studio.index-N5sIdor3.js → studio.index-BKeRxtvS.js} +1 -1
- package/static/dashboard/assets/{studio.integrations-ZAlVFGVw.js → studio.integrations-BDKRHU8R.js} +1 -1
- package/static/dashboard/assets/{studio.members-r1I_P9vv.js → studio.members-Dnw8MvSM.js} +1 -1
- package/static/dashboard/assets/{studio.plan-B5CWlvB1.js → studio.plan-CV9lR0OF.js} +1 -1
- package/static/dashboard/assets/{sun-B2KoVsUv.js → sun-BDbnQON-.js} +1 -1
- package/static/dashboard/assets/{switch-DmO3bJxP.js → switch-BQZZEckg.js} +1 -1
- package/static/dashboard/assets/{table-D3lWzaas.js → table-B41i9RfM.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-BVVmb5Zj.js → useAriaLabelledBy-hDZ_Qzgg.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-BBU42uTr.js → useBaseQuery-Di_lHTAg.js} +1 -1
- package/static/dashboard/assets/{useCompositeItem-BZX9S0sx.js → useCompositeItem-R43gS2Zb.js} +1 -1
- package/static/dashboard/assets/useQuery-B1QbR4lk.js +1 -0
- package/static/dashboard/assets/useRender-bF5mRtl9.js +1 -0
- package/static/dashboard/assets/{useScrollLock-DV4rQnvf.js → useScrollLock-DV1FkBvY.js} +1 -1
- package/static/dashboard/assets/{useValueChanged-BcwdNwDJ.js → useValueChanged-CxAXjLUw.js} +1 -1
- package/static/dashboard/assets/{users-BxyUqa0S.js → users-jxEArjZq.js} +1 -1
- package/static/dashboard/assets/{welcome-9qfwvdaq.js → welcome-D7cMtm0u.js} +1 -1
- package/static/dashboard/assets/{widget-signin-x6glMrne.js → widget-signin-BtBII7zp.js} +1 -1
- package/static/dashboard/assets/{you-C3HTpoDt.js → you-DcgRgPxz.js} +1 -1
- package/static/dashboard/assets/{zod-qyf6R6J-.js → zod-DxcG0x06.js} +1 -1
- package/static/dashboard/index.html +1 -1
- 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/_-DwwKoA7B.js +0 -1
- package/static/dashboard/assets/_app-CYfFCBBL.js +0 -1
- package/static/dashboard/assets/me-DeblO6Os.js +0 -1
- package/static/dashboard/assets/studio-BxUhJp0u.js +0 -1
- package/static/dashboard/assets/useQuery-CGx36E5q.js +0 -1
- package/static/dashboard/assets/useRender-CNreHlDo.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as U,r as f,ah as y,v,ai as j,ad as S,j as e,ac as k,a7 as w,B as x,F as A,H as M}from"./index-
|
|
1
|
+
import{d as U,r as f,ah as y,v,ai as j,ad as S,j as e,ac as k,a7 as w,B as x,F as A,H as M}from"./index-BC1mWQy8.js";import{u as L}from"./useQuery-B1QbR4lk.js";import{i as B,j as K,l as R,k as I,m as P,n as E}from"./dialog-l22OkYXh.js";import{L as C,I as N}from"./label-Des6lF0o.js";import{C as z}from"./ConfirmDialog-CHFBH7e-.js";import{u as _}from"./me-DWKKjc2l.js";function Y({owner:t}){const a=L(A.instance()),l=U(),s=()=>l.invalidateQueries({queryKey:A.instance().queryKey}),[g,m]=f.useState(!1),[b,h]=f.useState(!1),[p,u]=f.useState(null),d=y({mutationFn:v.disconnectStorage,onSuccess:()=>void s(),onError:c=>j.error(S(c))}),n=y({mutationFn:v.disconnectMail,onSuccess:()=>void s(),onError:c=>j.error(S(c))}),i=y({mutationFn:v.testMail,onSuccess:c=>j.success(`Sent to ${c.to}`),onError:c=>j.error(S(c))}),r=a.data?.storage,o=a.data?.mail;return e.jsxs(e.Fragment,{children:[e.jsxs(k,{title:"Storage",description:"The bucket screenshots and files go to. Without one the widget runs in annotation mode.",children:[!a.data&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:a.isError?"Could not read it.":"Reading…"}),r&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{tone:r.connected?"ok":r.unreadable?"bad":"off",text:r.connected?`Connected · ${r.bucket} at ${(r.endpoint??"").replace(/^https?:\/\//,"")}${r.connectedAt?` · since ${w(r.connectedAt)}`:""}`:r.unreadable?"A bucket is stored but its keys will not decrypt — the secret key changed. Connect it again.":"Not connected — annotation mode. Comments and anchors work; screenshots are not offered."}),e.jsx(O,{}),r.source==="env"?e.jsx(F,{what:"SNAGSET_STORAGE_S3_*"}):t?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"outline",size:"sm",onClick:()=>m(!0),children:r.connected||r.unreadable?"Replace…":"Connect a bucket…"}),(r.connected||r.unreadable)&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>u("storage"),children:"Disconnect"})]}):null]})]}),e.jsx(k,{title:"Mail",description:"How notifications go out. Without a transport they are off, and the instance says so.",children:o&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{tone:o.configured?"ok":o.unreadable?"bad":"off",text:o.configured?`${o.scheme==="resend"?"Resend":`SMTP · ${o.host??""}`} · from ${o.from}${o.updatedAt?` · since ${w(o.updatedAt)}`:""}`:o.unreadable?"A transport is stored but its secret will not decrypt — the secret key changed. Connect it again.":"No transport — notifications are off."}),o.source==="env"?e.jsx(F,{what:"SNAGSET_MAIL_URL"}):t?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(x,{variant:"outline",size:"sm",onClick:()=>h(!0),children:o.configured||o.unreadable?"Replace…":"Connect a transport…"}),o.configured&&e.jsx(x,{variant:"outline",size:"sm",loading:i.isPending,onClick:()=>i.mutate(),children:i.isPending?"Sending…":"Send a test email"}),(o.configured||o.unreadable)&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>u("mail"),children:"Disconnect"})]}):(o.configured&&t===!1,null)]})}),e.jsx(q,{open:g,onOpenChange:m,onDone:()=>void s()}),e.jsx(G,{open:b,onOpenChange:h,onDone:()=>void s()}),e.jsx(z,{open:p!==null,onOpenChange:c=>!c&&u(null),title:p==="storage"?"Disconnect the bucket?":"Disconnect the mail transport?",description:p==="storage"?"Screenshots stop being offered. Nothing in the bucket is deleted, and reconnecting the same bucket brings the pictures back.":"Notifications stop going out until a transport is connected again.",confirmLabel:"Disconnect",busy:d.isPending||n.isPending,onConfirm:async()=>{p==="storage"?await d.mutateAsync():await n.mutateAsync(),u(null)}})]})}function T(){const{storage:t}=_().limits;return t.limit===null?null:`${$(t.used)} of ${$(t.limit)} used across the studio's sites.`}function O(){const t=T();return t===null?null:e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:t})}function Z(){const t=T();return t===null?null:e.jsx(k,{title:"Storage",description:"Screenshots and files, against the studio's plan.",children:e.jsx("p",{className:"m-0 text-[13px]",children:t})})}function D({tone:t,text:a}){return e.jsxs("p",{className:"m-0 flex items-center gap-2 text-[13px]",children:[e.jsx("span",{className:`size-2 shrink-0 rounded-full ${t==="ok"?"bg-ok":t==="bad"?"bg-destructive":"bg-line-strong"}`,"aria-hidden":"true"}),e.jsx("span",{children:a})]})}function F({what:t}){return e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["Set by the environment (",e.jsx("code",{className:"font-mono",children:t}),"). Change it there; the dashboard shows it and does not offer to edit it."]})}function q({open:t,onOpenChange:a,onDone:l}){const[s,g]=f.useState({endpoint:"",bucket:"",region:"",accessKeyId:"",secretAccessKey:"",publicBaseUrl:""}),[m,b]=f.useState(""),h=y({mutationFn:v.connectStorage}),p=n=>i=>g({...s,[n]:i.target.value}),u=async n=>{n.preventDefault(),b("");try{await h.mutateAsync({endpoint:s.endpoint.trim(),bucket:s.bucket.trim(),accessKeyId:s.accessKeyId.trim(),secretAccessKey:s.secretAccessKey,...s.region.trim()?{region:s.region.trim()}:{},...s.publicBaseUrl.trim()?{publicBaseUrl:s.publicBaseUrl.trim()}:{}}),g({endpoint:"",bucket:"",region:"",accessKeyId:"",secretAccessKey:"",publicBaseUrl:""}),a(!1),l(),j.success("Bucket connected — screenshots are on")}catch(i){b(i instanceof M?i.message:"Could not reach the server.")}},d=(n,i,r,o="text",c)=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:`st-${n}`,children:i}),e.jsx(N,{id:`st-${n}`,type:o,placeholder:r,value:s[n],onChange:p(n),autoComplete:"off"}),c&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:c})]});return e.jsx(B,{open:t,onOpenChange:a,children:e.jsx(K,{children:e.jsxs("form",{onSubmit:n=>void u(n),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(I,{children:"Connect a bucket"}),e.jsx(P,{children:"Any S3-compatible bucket. It is probed — write, read, delete — before anything is saved, and the keys are stored encrypted with this instance's secret key."})]}),m&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:m}),d("endpoint","Endpoint","https://ams3.digitaloceanspaces.com"),d("bucket","Bucket","snagset"),d("region","Region","auto","text","Leave empty for providers that do not use one."),d("accessKeyId","Access key ID",""),d("secretAccessKey","Secret access key","","password"),d("publicBaseUrl","Public base URL","","text","Optional — only if the bucket is served from a CDN address."),e.jsxs(E,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:h.isPending,children:h.isPending?"Probing…":"Connect"})]})]})})})}function G({open:t,onOpenChange:a,onDone:l}){const[s,g]=f.useState(""),[m,b]=f.useState(""),[h,p]=f.useState(""),u=y({mutationFn:v.connectMail}),d=async n=>{n.preventDefault(),p("");try{await u.mutateAsync({url:s.trim(),from:m.trim()}),g(""),b(""),a(!1),l(),j.success("Transport connected — send a test email to be sure")}catch(i){p(i instanceof M?i.message:"Could not reach the server.")}};return e.jsx(B,{open:t,onOpenChange:a,children:e.jsx(K,{children:e.jsxs("form",{onSubmit:n=>void d(n),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(I,{children:"Connect a mail transport"}),e.jsx(P,{children:"Resend is the easy one — the provider owns SPF and DKIM. SMTP works with any provider. The URL is stored encrypted with this instance's secret key."})]}),h&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:h}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mail-url",children:"Transport"}),e.jsx(N,{id:"mail-url",type:"password",placeholder:"resend://re_… or smtp://user:pass@host:587",value:s,onChange:n=>g(n.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mail-from",children:"From"}),e.jsx(N,{id:"mail-from",placeholder:"Snagset <review@kilnwork.studio>",value:m,onChange:n=>b(n.target.value)}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"The address every notification is sent from. Resend needs a verified domain for it."})]}),e.jsxs(E,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:u.isPending,disabled:!s.trim()||!m.trim(),children:u.isPending?"Saving…":"Connect"})]})]})})})}function $(t){const a=["B","KB","MB","GB","TB"];let l=t,s=0;for(;l>=1024&&s<a.length-1;)l/=1024,s+=1;return`${s===0?l:l.toFixed(l>=10?0:1)} ${a[s]}`}export{Y as I,Z as S,$ as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as Q,r as p,ah as P,j as e,ac as H,a5 as J,a7 as K,B as b,ai as A,ad as D,F as M,v as R,am as z,H as G}from"./index-CUBD0DcL.js";import{P as E}from"./Picker-BvdKGeU8.js";import{u as W}from"./useQuery-CGx36E5q.js";import{B as O}from"./badge-Cwf-GPv8.js";import{i as F,j as _,l as B,k as $,m as I,n as q}from"./dialog-CjX41K4h.js";import{L as C,I as U}from"./label-BoGrNcZ0.js";import{S as Y}from"./switch-DmO3bJxP.js";import{C as V}from"./ConfirmDialog-B5-FUf01.js";import{C as w}from"./CopyButton-CDVY09FZ.js";function ce({owner:n,instanceOwner:i,operator:g,sites:v,mine:h=!1}){const o=Q(),a=W(M.mcpTokens()),[x,u]=p.useState(!1),[l,m]=p.useState(null),[c,j]=p.useState(null),k=P({mutationFn:t=>R.revokeMcpToken(t),onSuccess:()=>{j(null),o.invalidateQueries({queryKey:["mcp-tokens"]})},onError:t=>A.error(D(t))}),f=a.data?.data??[],N=f.filter(t=>!t.revokedAt),d=a.data?.http??null,y=P({mutationFn:t=>R.setMcpHttp(t),onSuccess:(t,s)=>{o.setQueryData(M.instance().queryKey,t),o.invalidateQueries({queryKey:["mcp-tokens"]}),A.success(s?"Remote transport on — the token dialog shows its config":"Remote transport off — the endpoint answers 404 again")},onError:t=>A.error(D(t))}),S=t=>{const s=new Set(t),r=s.has("comments:write")||s.has("threads:write");return!r&&!s.has("context:read")?"Read-only":r?`Writes: ${[s.has("comments:write")?"reply":"",s.has("threads:write")?"mark ready":""].filter(Boolean).join(", ")}`:"Read-only, with capture context"};return e.jsxs(H,{title:h?"Your agent tokens":"MCP",description:"A coding agent — Claude Code, Cursor, any MCP client — reads the same brief this dashboard copies, maps a comment to the file in its checkout, and can reply or mark a fix ready. It never resolves: whoever reported a snag decides when it is fixed. A token per agent, shown once, revocable here.",children:[a.isPending&&e.jsx(J,{rows:2}),d&&e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"mcp-http-on",className:"text-[13px] font-medium",children:"Remote transport"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:[d.enabled?e.jsxs(e.Fragment,{children:["On. An agent anywhere talks to this studio at ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," with a token as a bearer. No source mapping there; a write needs a token minted for it."]}):e.jsxs(e.Fragment,{children:["Off. Agents reach this studio only from a machine with the checkout. On, ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," serves the same tools to an agent anywhere, with a token as a bearer."]}),d.source==="env"?" Set by the environment (SNAGSET_MCP_HTTP_ENABLED).":i?"":g?" Only an owner can switch it.":" Only whoever runs this server can switch it."]})]}),e.jsx(Y,{id:"mcp-http-on","aria-label":"Remote transport",checked:d.enabled,disabled:!i||d.source==="env"||y.isPending,onCheckedChange:t=>y.mutate(t)})]}),a.isSuccess&&N.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(O,{variant:"outline",children:f.length>0?"No active tokens":"No tokens"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:h?"You have no agent tokens yet.":"No agent can read this studio yet."})]}),f.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Agent tokens",children:f.map(t=>e.jsxs("li",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px] ${t.revokedAt?"opacity-60":""}`,children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("code",{className:"font-mono text-[12.5px] text-muted-foreground",children:[t.prefix,"…"]}),e.jsx(O,{variant:"outline",className:t.revokedAt?"":"border-ok text-ok",children:t.revokedAt?"Revoked":S(t.scopes)}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.site?t.site.name:"All sites"," · ",t.lastUsedAt?`last used ${K(t.lastUsedAt)}`:"never used",t.expiresAt&&!t.revokedAt?` · expires ${new Date(t.expiresAt).toLocaleDateString()}`:"",t.createdBy?` · by ${t.createdBy}`:""]}),t.canRevoke&&e.jsx("span",{className:"ml-auto flex gap-1",children:e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>j(t),children:"Revoke"})})]},t.id))}),n&&e.jsx("div",{children:e.jsx(b,{variant:"outline",size:"sm",onClick:()=>u(!0),children:"New token…"})}),e.jsx(X,{open:x,onOpenChange:u,sites:v,http:a.data?.http??null,onDone:t=>{o.invalidateQueries({queryKey:["mcp-tokens"]}),m(t)}}),e.jsx(Z,{state:l,http:a.data?.http??null,onClose:()=>m(null)}),e.jsx(V,{open:c!==null,onOpenChange:t=>!t&&j(null),title:`Revoke “${c?.name??""}”?`,description:e.jsx(e.Fragment,{children:"The agent holding it loses access on its next request. Its past replies stay, under its name. This cannot be undone — mint a new token instead."}),confirmLabel:"Revoke",busy:k.isPending,onConfirm:async()=>{c&&await k.mutateAsync(c.id)}})]})}function X({open:n,onOpenChange:i,sites:g,http:v,onDone:h}){const[o,a]=p.useState(""),[x,u]=p.useState(""),[l,m]=p.useState(["threads:read","source:map"]),[c,j]=p.useState(""),[k,f]=p.useState(!1),[N,d]=p.useState(""),y=P({mutationFn:()=>R.mintMcpToken({name:o.trim(),...x?{site:x}:{},scopes:l,...c?{expiresInDays:Number(c)}:{},...k?{allowRemoteWrites:!0}:{}})}),S=(s,r)=>m(T=>r?[...new Set([...T,s])]:T.filter(L=>L!==s)),t=async s=>{s.preventDefault(),d("");try{const r=await y.mutateAsync();a(""),u(""),m(["threads:read","source:map"]),j(""),f(!1),i(!1),h(r)}catch(r){d(r instanceof G?r.message:"Could not reach the server.")}};return e.jsx(F,{open:n,onOpenChange:i,children:e.jsx(_,{children:e.jsxs("form",{onSubmit:s=>void t(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(B,{children:[e.jsx($,{children:"New agent token"}),e.jsx(I,{children:"Read-only by default, plus mapping a comment to a file in the agent's own checkout. Tick more only for an agent you want writing here — and it still cannot resolve anything."})]}),N&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:N}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-name",children:"Name"}),e.jsx(U,{id:"mcp-name",placeholder:"Claude Code",value:o,onChange:s=>a(s.target.value),autoComplete:"off",maxLength:80}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"What a client sees on the agent's replies, so name the agent, not the person."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-site",children:"Site"}),e.jsx(E,{id:"mcp-site",value:x,onChange:u,options:[{value:"",label:"All sites"},...g.map(s=>({value:s.uid,label:s.name}))]})]}),e.jsxs("fieldset",{className:"m-0 flex flex-col gap-2 border-0 p-0",children:[e.jsx("legend",{className:"mb-1 text-[13px] font-medium",children:"Scopes"}),z.map(s=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:l.includes(s.scope),onChange:r=>S(s.scope,r.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s.hint})]})]},s.scope))]}),v?.enabled&&(l.includes("comments:write")||l.includes("threads:write"))&&e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:k,onChange:s=>f(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"May write over the remote transport"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Over POST /mcp the agent is not on a machine you can see; a write there is a decision."})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-expires",children:"Expires"}),e.jsx(E,{id:"mcp-expires",value:c,onChange:j,options:[{value:"",label:"Never"},{value:"30",label:"In 30 days"},{value:"90",label:"In 90 days"},{value:"365",label:"In a year"}]})]}),e.jsxs(q,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(b,{type:"submit",loading:y.isPending,disabled:!o.trim()||l.length===0,children:y.isPending?"Minting…":"Create token"})]})]})})})}function Z({state:n,http:i,onClose:g}){const v=typeof location<"u"?location.origin:"",h={SNAGSET_MCP_TOKEN:n?.secret??"",SNAGSET_MCP_HOST:v,...n?.token.site?{SNAGSET_MCP_PROJECT:n.token.site.uid}:{}},o=JSON.stringify({mcpServers:{snagset:{command:"npx",args:["-y","@snagset/mcp"],env:h}}},null,2),a=["claude mcp add snagset",...Object.entries(h).map(([m,c])=>`-e ${m}=${c}`),"--","npx -y @snagset/mcp"].join(" "),x=`Bearer ${n?.secret??""}`,u=["claude mcp add","--transport http","snagset",i?.url??"",`--header "Authorization: ${x}"`].join(" "),l=JSON.stringify({mcpServers:{snagset:{type:"http",url:i?.url??"",headers:{Authorization:x}}}},null,2);return e.jsx(F,{open:n!==null,onOpenChange:m=>!m&&g(),children:e.jsxs(_,{className:"sm:max-w-xl",children:[e.jsxs(B,{children:[e.jsxs($,{children:["Token for “",n?.token.name??"","”"]}),e.jsx(I,{children:"Shown this once — only its hash is stored. Put it in the agent's config, then start the agent from the site's checkout so it can map comments to files."})]}),n&&e.jsxs("div",{className:"flex flex-col gap-4 text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"mcp-token",children:n.secret}),e.jsx(w,{text:n.secret,label:"Copy the token"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Claude Code"}),e.jsx(w,{text:a,label:"Copy the Claude Code command"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:a})]}),i?.enabled&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Remote — an agent that is not on a machine with the checkout"}),e.jsx(w,{text:l,label:"Copy the remote config"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:u}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:l}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No source mapping there — nothing to search. Writes need the token minted with remote writes allowed."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Cursor, Claude Desktop, any MCP client"}),e.jsx(w,{text:o,label:"Copy the JSON config"})]}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:o}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Cursor reads it from .cursor/mcp.json in the project; Claude Desktop from its claude_desktop_config.json."})]})]}),e.jsx(q,{children:e.jsx(b,{type:"button",onClick:g,children:"Done"})})]})})}export{ce as M};
|
|
1
|
+
import{d as Q,r as p,ah as P,j as e,ac as H,a5 as J,a7 as K,B as b,ai as A,ad as D,F as M,v as R,am as z,H as G}from"./index-BC1mWQy8.js";import{P as E}from"./Picker-CCAp0603.js";import{u as W}from"./useQuery-B1QbR4lk.js";import{B as O}from"./badge-CYPTl0cy.js";import{i as F,j as _,l as B,k as $,m as I,n as q}from"./dialog-l22OkYXh.js";import{L as C,I as U}from"./label-Des6lF0o.js";import{S as Y}from"./switch-BQZZEckg.js";import{C as V}from"./ConfirmDialog-CHFBH7e-.js";import{C as w}from"./CopyButton-U3SFd-HD.js";function ce({owner:n,instanceOwner:i,operator:g,sites:v,mine:h=!1}){const o=Q(),a=W(M.mcpTokens()),[x,u]=p.useState(!1),[l,m]=p.useState(null),[c,j]=p.useState(null),k=P({mutationFn:t=>R.revokeMcpToken(t),onSuccess:()=>{j(null),o.invalidateQueries({queryKey:["mcp-tokens"]})},onError:t=>A.error(D(t))}),f=a.data?.data??[],N=f.filter(t=>!t.revokedAt),d=a.data?.http??null,y=P({mutationFn:t=>R.setMcpHttp(t),onSuccess:(t,s)=>{o.setQueryData(M.instance().queryKey,t),o.invalidateQueries({queryKey:["mcp-tokens"]}),A.success(s?"Remote transport on — the token dialog shows its config":"Remote transport off — the endpoint answers 404 again")},onError:t=>A.error(D(t))}),S=t=>{const s=new Set(t),r=s.has("comments:write")||s.has("threads:write");return!r&&!s.has("context:read")?"Read-only":r?`Writes: ${[s.has("comments:write")?"reply":"",s.has("threads:write")?"mark ready":""].filter(Boolean).join(", ")}`:"Read-only, with capture context"};return e.jsxs(H,{title:h?"Your agent tokens":"MCP",description:"A coding agent — Claude Code, Cursor, any MCP client — reads the same brief this dashboard copies, maps a comment to the file in its checkout, and can reply or mark a fix ready. It never resolves: whoever reported a snag decides when it is fixed. A token per agent, shown once, revocable here.",children:[a.isPending&&e.jsx(J,{rows:2}),d&&e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(C,{htmlFor:"mcp-http-on",className:"text-[13px] font-medium",children:"Remote transport"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:[d.enabled?e.jsxs(e.Fragment,{children:["On. An agent anywhere talks to this studio at ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," with a token as a bearer. No source mapping there; a write needs a token minted for it."]}):e.jsxs(e.Fragment,{children:["Off. Agents reach this studio only from a machine with the checkout. On, ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," serves the same tools to an agent anywhere, with a token as a bearer."]}),d.source==="env"?" Set by the environment (SNAGSET_MCP_HTTP_ENABLED).":i?"":g?" Only an owner can switch it.":" Only whoever runs this server can switch it."]})]}),e.jsx(Y,{id:"mcp-http-on","aria-label":"Remote transport",checked:d.enabled,disabled:!i||d.source==="env"||y.isPending,onCheckedChange:t=>y.mutate(t)})]}),a.isSuccess&&N.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(O,{variant:"outline",children:f.length>0?"No active tokens":"No tokens"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:h?"You have no agent tokens yet.":"No agent can read this studio yet."})]}),f.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Agent tokens",children:f.map(t=>e.jsxs("li",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px] ${t.revokedAt?"opacity-60":""}`,children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("code",{className:"font-mono text-[12.5px] text-muted-foreground",children:[t.prefix,"…"]}),e.jsx(O,{variant:"outline",className:t.revokedAt?"":"border-ok text-ok",children:t.revokedAt?"Revoked":S(t.scopes)}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.site?t.site.name:"All sites"," · ",t.lastUsedAt?`last used ${K(t.lastUsedAt)}`:"never used",t.expiresAt&&!t.revokedAt?` · expires ${new Date(t.expiresAt).toLocaleDateString()}`:"",t.createdBy?` · by ${t.createdBy}`:""]}),t.canRevoke&&e.jsx("span",{className:"ml-auto flex gap-1",children:e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>j(t),children:"Revoke"})})]},t.id))}),n&&e.jsx("div",{children:e.jsx(b,{variant:"outline",size:"sm",onClick:()=>u(!0),children:"New token…"})}),e.jsx(X,{open:x,onOpenChange:u,sites:v,http:a.data?.http??null,onDone:t=>{o.invalidateQueries({queryKey:["mcp-tokens"]}),m(t)}}),e.jsx(Z,{state:l,http:a.data?.http??null,onClose:()=>m(null)}),e.jsx(V,{open:c!==null,onOpenChange:t=>!t&&j(null),title:`Revoke “${c?.name??""}”?`,description:e.jsx(e.Fragment,{children:"The agent holding it loses access on its next request. Its past replies stay, under its name. This cannot be undone — mint a new token instead."}),confirmLabel:"Revoke",busy:k.isPending,onConfirm:async()=>{c&&await k.mutateAsync(c.id)}})]})}function X({open:n,onOpenChange:i,sites:g,http:v,onDone:h}){const[o,a]=p.useState(""),[x,u]=p.useState(""),[l,m]=p.useState(["threads:read","source:map"]),[c,j]=p.useState(""),[k,f]=p.useState(!1),[N,d]=p.useState(""),y=P({mutationFn:()=>R.mintMcpToken({name:o.trim(),...x?{site:x}:{},scopes:l,...c?{expiresInDays:Number(c)}:{},...k?{allowRemoteWrites:!0}:{}})}),S=(s,r)=>m(T=>r?[...new Set([...T,s])]:T.filter(L=>L!==s)),t=async s=>{s.preventDefault(),d("");try{const r=await y.mutateAsync();a(""),u(""),m(["threads:read","source:map"]),j(""),f(!1),i(!1),h(r)}catch(r){d(r instanceof G?r.message:"Could not reach the server.")}};return e.jsx(F,{open:n,onOpenChange:i,children:e.jsx(_,{children:e.jsxs("form",{onSubmit:s=>void t(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(B,{children:[e.jsx($,{children:"New agent token"}),e.jsx(I,{children:"Read-only by default, plus mapping a comment to a file in the agent's own checkout. Tick more only for an agent you want writing here — and it still cannot resolve anything."})]}),N&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:N}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-name",children:"Name"}),e.jsx(U,{id:"mcp-name",placeholder:"Claude Code",value:o,onChange:s=>a(s.target.value),autoComplete:"off",maxLength:80}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"What a client sees on the agent's replies, so name the agent, not the person."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-site",children:"Site"}),e.jsx(E,{id:"mcp-site",value:x,onChange:u,options:[{value:"",label:"All sites"},...g.map(s=>({value:s.uid,label:s.name}))]})]}),e.jsxs("fieldset",{className:"m-0 flex flex-col gap-2 border-0 p-0",children:[e.jsx("legend",{className:"mb-1 text-[13px] font-medium",children:"Scopes"}),z.map(s=>e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:l.includes(s.scope),onChange:r=>S(s.scope,r.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s.hint})]})]},s.scope))]}),v?.enabled&&(l.includes("comments:write")||l.includes("threads:write"))&&e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:k,onChange:s=>f(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"May write over the remote transport"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Over POST /mcp the agent is not on a machine you can see; a write there is a decision."})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-expires",children:"Expires"}),e.jsx(E,{id:"mcp-expires",value:c,onChange:j,options:[{value:"",label:"Never"},{value:"30",label:"In 30 days"},{value:"90",label:"In 90 days"},{value:"365",label:"In a year"}]})]}),e.jsxs(q,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(b,{type:"submit",loading:y.isPending,disabled:!o.trim()||l.length===0,children:y.isPending?"Minting…":"Create token"})]})]})})})}function Z({state:n,http:i,onClose:g}){const v=typeof location<"u"?location.origin:"",h={SNAGSET_MCP_TOKEN:n?.secret??"",SNAGSET_MCP_HOST:v,...n?.token.site?{SNAGSET_MCP_PROJECT:n.token.site.uid}:{}},o=JSON.stringify({mcpServers:{snagset:{command:"npx",args:["-y","@snagset/mcp"],env:h}}},null,2),a=["claude mcp add snagset",...Object.entries(h).map(([m,c])=>`-e ${m}=${c}`),"--","npx -y @snagset/mcp"].join(" "),x=`Bearer ${n?.secret??""}`,u=["claude mcp add","--transport http","snagset",i?.url??"",`--header "Authorization: ${x}"`].join(" "),l=JSON.stringify({mcpServers:{snagset:{type:"http",url:i?.url??"",headers:{Authorization:x}}}},null,2);return e.jsx(F,{open:n!==null,onOpenChange:m=>!m&&g(),children:e.jsxs(_,{className:"sm:max-w-xl",children:[e.jsxs(B,{children:[e.jsxs($,{children:["Token for “",n?.token.name??"","”"]}),e.jsx(I,{children:"Shown this once — only its hash is stored. Put it in the agent's config, then start the agent from the site's checkout so it can map comments to files."})]}),n&&e.jsxs("div",{className:"flex flex-col gap-4 text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"mcp-token",children:n.secret}),e.jsx(w,{text:n.secret,label:"Copy the token"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Claude Code"}),e.jsx(w,{text:a,label:"Copy the Claude Code command"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:a})]}),i?.enabled&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Remote — an agent that is not on a machine with the checkout"}),e.jsx(w,{text:l,label:"Copy the remote config"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:u}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:l}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No source mapping there — nothing to search. Writes need the token minted with remote writes allowed."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Cursor, Claude Desktop, any MCP client"}),e.jsx(w,{text:o,label:"Copy the JSON config"})]}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:o}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Cursor reads it from .cursor/mcp.json in the project; Claude Desktop from its claude_desktop_config.json."})]})]}),e.jsx(q,{children:e.jsx(b,{type:"button",onClick:g,children:"Done"})})]})})}export{ce as M};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Xt,av as Lt,e as xe,l as Gt,r as s,i as vt,j as h,aT as At,f as He,m as ht,E as Kt,ay as Jt,aw as Nt,k as Te,g as ft,h as Fe}from"./index-
|
|
1
|
+
import{c as Xt,av as Lt,e as xe,l as Gt,r as s,i as vt,j as h,aT as At,f as He,m as ht,E as Kt,ay as Jt,aw as Nt,k as Te,g as ft,h as Fe}from"./index-BC1mWQy8.js";import{C as Ot}from"./chevron-down-Co3oKci1.js";import{C as Zt}from"./check-2F6z9BBy.js";import{E as Qt,a2 as en,P as tn,R as nn,a3 as c,l as Ht,g as on,F as sn,v as rn,r as ln,m as nt,a4 as an,$ as cn,t as un,J as dn,K as fn,L as pn,y as gn,a as mn,I as hn,q as xn,a5 as bn}from"./useScrollLock-DV1FkBvY.js";import{i as Sn}from"./isElementDisabled-CwHw_lZC.js";import{w as vn,e as yn,h as Ft,A as Dt,k as Ct,l as Rn,x as wn,s as In,c as Ie,n as st,j as Tn,f as Mn,o as xt,a as pt,z as En,B as An,r as gt}from"./createBaseUIEventDetails-67bayC1B.js";import{a as yt,u as it,i as Cn,d as Pn,t as Rt,C as Vn}from"./inertValue-Dy4HJtbg.js";import{s as bt}from"./serializeValue-B8e3iXO-.js";import{u as jn}from"./useValueChanged-CxAXjLUw.js";import{d as Ln,h as Nn,e as On,f as Hn,i as Fn,c as Dn,u as kn,a as Un,b as Bn,p as _n,r as zn,g as Wn}from"./getPseudoElementBounds-D9YqITSR.js";import{C as Yn,a as $n,u as qn}from"./CompositeList-nzDbuttJ.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e,al as o}from"./index-
|
|
1
|
+
import{r,j as e,al as o}from"./index-BC1mWQy8.js";function u({saving:s,savedAt:t}){const[i,a]=r.useState(!1);return r.useEffect(()=>{if(!t)return;a(!0);const n=setTimeout(()=>a(!1),1800);return()=>clearTimeout(n)},[t]),s?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12.5px] text-muted-foreground","aria-live":"polite",children:[e.jsx(o,{className:"size-3.5 animate-spin","aria-hidden":"true"}),"Saving"]}):e.jsx("span",{className:"text-[12.5px] text-muted-foreground","aria-live":"polite",children:i?"Saved":""})}export{u as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as o}from"./index-BC1mWQy8.js";const n=o;export{n as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as ft,a as xt,b as mt,c as O,d as je,r as o,e as L,f as ce,g as bt,j as e,B as Z,h as w,i as ne,m as ye,E as vt,k as Se,l as fe,n as jt,o as yt,p as ae,q as K,S as St,s as wt,t as Nt,v as ee,w as $e,x as Ct,L as _,y as kt,M as Tt,z as Pt,A as Rt,C as Mt,D as Et,F as Be,O as Ot}from"./index-
|
|
1
|
+
import{u as ft,a as xt,b as mt,c as O,d as je,r as o,e as L,f as ce,g as bt,j as e,B as Z,h as w,i as ne,m as ye,E as vt,k as Se,l as fe,n as jt,o as yt,p as ae,q as K,S as St,s as wt,t as Nt,v as ee,w as $e,x as Ct,L as _,y as kt,M as Tt,z as Pt,A as Rt,C as Mt,D as Et,F as Be,O as Ot}from"./index-BC1mWQy8.js";import{u as we}from"./useQuery-B1QbR4lk.js";import{D as Dt,a as It,b as At,X as _t,c as zt,d as Ht,e as Lt,f as $t,p as Bt,g as Ft,h as Ut,i as Fe,j as Ue,k as qe,l as qt,m as Vt,n as Gt}from"./dialog-l22OkYXh.js";import{T as Kt,i as Ve,a as Yt,R as Wt,b as Xt,P as Qt,f as Jt,u as Zt,c as es,d as ts,e as ss,g as ns,h as as,j as rs,k as os,l as is,m as ls,t as ds,n as cs,o as us,F as ps,p as gs,q as hs}from"./useScrollLock-DV1FkBvY.js";import{c as B,n as Ge,g as fs,a as xe,t as xs,d as ms,i as bs,u as vs,b as ue}from"./createBaseUIEventDetails-67bayC1B.js";import{g as me,u as js,a as ys,b as Ss,s as ws,c as Ns,d as Cs,S as Ke,E as J,D as re,e as oe,f as ie,h as Ne,i as te,j as I,k as G,l as ks,m as pe}from"./dropdown-menu-CIJhCtDQ.js";import{u as Ts,a as Ps,g as Rs}from"./getPseudoElementBounds-D9YqITSR.js";import{u as Ms}from"./inertValue-Dy4HJtbg.js";import{u as Ye}from"./useRender-bF5mRtl9.js";import{A as Es,a as Os}from"./avatar-C272UWe3.js";import{L as Ds,I as Is}from"./label-Des6lF0o.js";import{u as le}from"./me-DWKKjc2l.js";import{L as se}from"./layout-grid-ojTM11RH.js";import{U as be}from"./users-jxEArjZq.js";import{c as As}from"./update-duXzIzFS.js";import{P as We}from"./plus-CqHIH0K8.js";import{M as _s,S as zs,a as Hs}from"./sun-BDbnQON-.js";import"./useBaseQuery-Di_lHTAg.js";import"./check-2F6z9BBy.js";import"./CompositeList-nzDbuttJ.js";import"./CompositeItem-DUU2dBBI.js";import"./useCompositeItem-R43gS2Zb.js";import"./useValueChanged-CxAXjLUw.js";function Ls(t){const s=ft({warn:t?.router===void 0}),n=t?.router||s;return xt(n.stores.__store,mt(t,n))}/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,u as n,G as a,B as r}from"./index-
|
|
1
|
+
import{j as e,u as n,G as a,B as r}from"./index-BC1mWQy8.js";function i({error:s}){const t=n(),o=s instanceof Error?s.message:"Something went wrong.";return e.jsx(a,{children:e.jsxs("div",{className:"flex flex-col items-start gap-3",children:[e.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Could not load the dashboard"}),e.jsx("p",{className:"m-0 text-muted-foreground",children:o}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>void t.invalidate(),children:"Try again"})]})})}const m=({error:s})=>e.jsx(i,{error:s});export{m as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as o}from"./index-BC1mWQy8.js";const t=o;export{t as notFoundComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as p,a2 as g,a3 as f,p as v,j as e,a4 as N,B as x,a5 as P,L as j,a6 as y,a7 as b,a8 as w,a9 as R,S}from"./index-
|
|
1
|
+
import{a1 as p,a2 as g,a3 as f,p as v,j as e,a4 as N,B as x,a5 as P,L as j,a6 as y,a7 as b,a8 as w,a9 as R,S}from"./index-BC1mWQy8.js";import{P as E}from"./Picker-CCAp0603.js";import{Q as k,u as F}from"./useBaseQuery-Di_lHTAg.js";import{u as M}from"./me-DWKKjc2l.js";import"./chevron-down-Co3oKci1.js";import"./check-2F6z9BBy.js";import"./useScrollLock-DV1FkBvY.js";import"./inertValue-Dy4HJtbg.js";import"./createBaseUIEventDetails-67bayC1B.js";import"./isElementDisabled-CwHw_lZC.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-CxAXjLUw.js";import"./getPseudoElementBounds-D9YqITSR.js";import"./CompositeList-nzDbuttJ.js";var A=class extends k{constructor(s,n){super(s,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,n){const{state:r}=s,l=super.createResult(s,n),{isFetching:o,isRefetching:i,isError:u,isRefetchError:d}=l,t=r.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",m=u&&t==="backward",h=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:g(n,r.data),hasPreviousPage:p(n,r.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:m,isFetchingPreviousPage:h,isRefetchError:d&&!c&&!m,isRefetching:i&&!a&&!h}}};function C(s,n){return F(s,A)}const D=[{value:"unresolved",label:"Needs attention"},...R.map(s=>({value:s,label:S[s]})),{value:"all",label:"Everything"}];function L(s,n=new Date){const r=new Date(s),l=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),o=Math.round((l(n)-l(r))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?r.toLocaleDateString(void 0,{weekday:"long"}):r.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function K(){const s=M(),{status:n="unresolved",site:r}=f.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),i=C(w(n,r)),u=i.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=L(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(N,{title:"Activity",sub:`Every site, newest first${r?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[D.map(t=>e.jsx(x,{size:"sm",variant:n===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsx(E,{"aria-label":"Site",size:"sm",className:"w-auto min-w-40 text-foreground",value:r??"",onChange:t=>o({site:t||void 0}),options:[{value:"",label:"All sites"},...s.projects.map(t=>({value:t.uid,label:t.name}))]})]})]}),i.isPending&&e.jsx(P,{rows:4}),i.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),i.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:n==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":n==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(j,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(y,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:b(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),i.hasNextPage&&e.jsx("div",{children:e.jsx(x,{variant:"outline",size:"sm",disabled:i.isFetchingNextPage,onClick:()=>void i.fetchNextPage(),children:i.isFetchingNextPage?"Reading…":"Show older"})})]})}export{K as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,i as b,k as f,j as d,h as m}from"./index-
|
|
1
|
+
import{r as a,i as b,k as f,j as d,h as m}from"./index-BC1mWQy8.js";import{m as A}from"./useScrollLock-DV1FkBvY.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 M({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,M as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as a,h as n,o}from"./index-
|
|
1
|
+
import{m as a,h as n,o}from"./index-BC1mWQy8.js";import{u as d}from"./useRender-bF5mRtl9.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,ax as o,i as R,E as v,bo as w,av as C,f as T,e as m,l as h,bj as D}from"./index-
|
|
1
|
+
import{r,ax as o,i as R,E as v,bo as w,av as C,f as T,e as m,l as h,bj as D}from"./index-BC1mWQy8.js";function k(e){return e?.ownerDocument||document}const x={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},F={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},S={disabled:!1,...F},B={valid(e){return e===null?null:e?{"data-valid":""}:{"data-invalid":""}}},y={invalid:void 0,name:void 0,validityData:{state:x,errors:[],error:"",value:"",initialValue:null},setValidityData:o,disabled:void 0,setTouched:o,setDirty:o,setFilled:o,setFocused:o,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:S,registerFieldControl:o,validation:{getValidationProps:(e,t=v)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:o,getInputControl:()=>null,commit:async()=>{},change:o}},L=r.createContext(y);function A(e=!0){const t=r.useContext(L);if(t.setValidityData===o&&!e)throw new Error(R(28));return t}const P=r.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:o,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function $(){return r.useContext(P)}let E=0;function _(e,t="mui"){const[n,s]=r.useState(e),i=e||n;return r.useEffect(()=>{n==null&&(E+=1,s(`${t}-${E}`))},[n,t]),i}const b=w.useId;function M(e,t){if(b!==void 0){const n=b();return e??(t?`${t}-${n}`:n)}return _(e,t)}function O(e){return M(e,"base-ui")}const U=r.createContext({controlId:void 0,registerControlId:o,labelId:void 0,setLabelId:o,messageIds:[],setMessageIds:o,getDescriptionProps:e=>e});function V(){return r.useContext(U)}function z(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:l}=V(),a=O(t),u=n?i:void 0,c=C(()=>Symbol()),d=r.useRef(!1),I=r.useRef(t!=null),g=T(()=>{!d.current||l===o||(d.current=!1,l(c.current,void 0))});return m(()=>{if(l===o)return;let f;if(n){const p=s?.current;h(p)&&p.closest("label")!=null?f=t??null:f=u??a}else if(t!=null)I.current=!0,f=t;else if(I.current)f=a;else{g();return}if(f===void 0){g();return}d.current=!0,l(c.current,f)},[t,s,u,l,n,a,c,g]),r.useEffect(()=>g,[g]),i??a}function j(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Y(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&D(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function q(e){return"composedPath"in e?e.composedPath()[0]:e.target}function G({controlled:e,default:t,name:n,state:s="value"}){const{current:i}=r.useRef(e!==void 0),[l,a]=r.useState(t),u=i?e:l,c=r.useCallback(d=>{i||a(d)},[]);return[u,c]}function H(e,t,n,s,i=!0,l){const{registerFieldControl:a}=A(),u=C(()=>Symbol());m(()=>{const c=u.current;if(!i){a(c,void 0);return}a(c,{controlRef:e,getValue:s,id:t,name:l,value:n})},[e,i,s,t,l,a,u,n]),m(()=>{const c=u.current;return()=>{a(c,void 0)}},[a,u])}const J="none",K="trigger-press",W="trigger-hover",X="trigger-focus",Q="outside-press",Z="item-press",ee="close-press",te="focus-out",ne="escape-key",se="list-navigation",oe="cancel-open",ae="sibling-open",re="disabled",ie="missing",le="initial",ue="imperative-action",ce="window-resize";function de(e,t,n,s){let i=!1,l=!1;const a=s??v;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){l=!0},get isCanceled(){return i},get isPropagationAllowed(){return l},trigger:n,...a}}export{z as A,ce as B,le as C,ie as D,ee as E,Y as a,W as b,de as c,re as d,$ as e,B as f,q as g,A as h,ue as i,V as j,G as k,H as l,j as m,J as n,k as o,X as p,ne as q,Z as r,Q as s,K as t,O as u,ae as v,M as w,te as x,se as y,oe as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as q,r as g,i as A,k as I,aw as X,E as N,j as a,e as G,B as _,h as O}from"./index-
|
|
1
|
+
import{c as q,r as g,i as A,k as I,aw as X,E as N,j as a,e as G,B as _,h as O}from"./index-BC1mWQy8.js";import{p as Q,a2 as z,P as L,q as Z,ai as ee,F as te,I as ne,J as oe,L as se,g as ae,ag as re,h as ie,R as le,S as ue,u as de,aj as pe,c as ce,d as ge,e as fe}from"./useScrollLock-DV1FkBvY.js";import{c as V,E as me,u as H,g as xe,a as Pe,i as Ce}from"./createBaseUIEventDetails-67bayC1B.js";import{t as Se,u as he,C as De,i as Oe}from"./inertValue-Dy4HJtbg.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ut,r as a,k as me,ax as lt,g as _t,l as ue,aS as dt,av as ft,f as de,e as ve,n as _e,i as Ee,az as Ut,aw as pt,m as Me,ay as Gt,j as D,E as Le,aT as Vt,aU as Yt,aV as Xt,aW as Kt,h as Ie}from"./index-
|
|
1
|
+
import{c as ut,r as a,k as me,ax as lt,g as _t,l as ue,aS as dt,av as ft,f as de,e as ve,n as _e,i as Ee,az as Ut,aw as pt,m as Me,ay as Gt,j as D,E as Le,aT as Vt,aU as Yt,aV as Xt,aW as Kt,h as Ie}from"./index-BC1mWQy8.js";import{C as zt}from"./check-2F6z9BBy.js";import{i as Ue,s as Wt,m as Re,w as ke,x as gt,y as $t,a as le,z as qt,A as Fe,B as Qt,C as Jt,T as Ge,D as Ke,E as ze,G as Zt,H as Ve,l as Ce,I as en,p as tn,J as nn,K as on,o as rn,L as sn,M as an,R as cn,N as mt,P as un,f as ln,O as ht,c as dn,d as fn,Q as pn,S as gn,U as mn,g as hn,V as vn,F as bn,h as En,e as Rn,W as xn,X as yn,Y as Cn,Z as Tn,_ as Mn,j as Pn,k as In,$ as nt,a0 as ot,a1 as Sn}from"./useScrollLock-DV1FkBvY.js";import{m as rt,o as be,a as ee,c as Z,p as Pe,g as Ae,t as vt,q as bt,b as ie,r as We,u as je,s as On,v as Te,k as wn,w as st,x as Ye,y as kn,i as Fn,z as Nn}from"./createBaseUIEventDetails-67bayC1B.js";import{u as Et,C as Dn,a as Ln}from"./CompositeList-nzDbuttJ.js";import{b as An,g as jn,u as Hn,c as Bn,a as _n,d as Un,e as Gn,f as Vn,i as Yn,h as Xn}from"./getPseudoElementBounds-D9YqITSR.js";import{p as Kn,g as zn}from"./dialog-l22OkYXh.js";import{C as Wn}from"./CompositeItem-DUU2dBBI.js";import{b as $n,t as qn,u as Rt,C as Qn,c as Jn,i as Zn,a as eo}from"./inertValue-Dy4HJtbg.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,v as h,H as p,j as e,G as m,L as d,B as f,I as g,J as j}from"./index-
|
|
1
|
+
import{r as l,v as h,H as p,j as e,G as m,L as d,B as f,I as g,J as j}from"./index-BC1mWQy8.js";import{u as N,a as b}from"./zod-DxcG0x06.js";import{L as k,I as y}from"./label-Des6lF0o.js";import"./createBaseUIEventDetails-67bayC1B.js";const v=g({email:j().trim().email("An email address")});function F(){const[s,r]=l.useState(""),[n,a]=l.useState(""),{register:c,handleSubmit:x,formState:t}=N({resolver:b(v)}),u=x(async({email:i})=>{r("");try{await h.requestReset(i),a(i)}catch(o){r(o instanceof p?o.message:"Could not reach the server. Try again.")}});return n?e.jsx(m,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Check your mail"}),e.jsxs("p",{className:"m-0 text-muted-foreground",children:["If ",e.jsx("span",{className:"text-foreground",children:n})," has an account here, a link is on its way. It works once and expires in an hour."]}),e.jsxs("p",{className:"m-0 text-[13px] text-muted-foreground",children:["Nothing after a minute? Check the spelling and the spam folder, or"," ",e.jsx("button",{type:"button",className:"text-foreground underline underline-offset-4",onClick:()=>a(""),children:"try another address"}),"."]}),e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(d,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Back to sign in"})})]})}):e.jsx(m,{children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Forgot your password?"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Enter your email. A link is sent to it, and the link lets you choose a new password."})]}),s&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:s}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"email",children:"Email"}),e.jsx(y,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!t.errors.email,...c("email")}),t.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:t.errors.email.message})]}),e.jsx(f,{type:"submit",size:"lg",loading:t.isSubmitting,children:t.isSubmitting?"Sending…":"Send me the link"}),e.jsx("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:e.jsx(d,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Back to sign in"})})]})})}export{F as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as w,E as tn,l as U,a$ as we,aS as pe,b0 as xe,g as se,b1 as Et,aV as Ze,aU as bt,b2 as Cn,b3 as nn,b4 as Pn,b5 as St,b6 as on,b7 as it,b8 as vt,b9 as _t,ba as rn,n as Mn,e as q,f as ie,aT as Tn,k as Ln}from"./index-CUBD0DcL.js";import{d as Ot,e as Bt,g as ht,f as Ht,h as je,j as Dn,k as kn}from"./inertValue-BxLh7N1J.js";import{m as sn,i as pt,B as In,a6 as cn,D as ln,a4 as Fn,a7 as Wn,l as ue,E as Vn,a8 as $n,a9 as fe,y as _n,a5 as Bn,aa as st,ab as ct,ac as an,ad as Ct,ae as Hn,af as zn,q as Nn,ag as Kn,ah as Yn}from"./useScrollLock-DV4rQnvf.js";import{t as Xn,g as fn,c as Je,m as xt,o as et,a as He,y as zt,x as jn}from"./createBaseUIEventDetails-BlUeVOHL.js";import{u as qn}from"./useValueChanged-BcwdNwDJ.js";import{a as Un}from"./CompositeList-CDfO6SCy.js";const Le=Math.min,de=Math.max,tt=Math.round,qe=Math.floor,me=e=>({x:e,y:e}),Gn={left:"right",right:"left",bottom:"top",top:"bottom"};function un(e,t,n){return de(e,Le(t,n))}function ye(e,t){return typeof e=="function"?e(t):e}function Q(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function Pt(e){return e==="x"?"y":"x"}function Mt(e){return e==="y"?"height":"width"}function J(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tt(e){return Pt(J(e))}function Jn(e,t,n){n===void 0&&(n=!1);const o=Re(e),r=Tt(e),i=Mt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=nt(s)),[s,nt(s)]}function Qn(e){const t=nt(e);return[At(e),t,At(t)]}function At(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Nt=["left","right"],Kt=["right","left"],Zn=["top","bottom"],eo=["bottom","top"];function to(e,t,n){switch(e){case"top":case"bottom":return n?t?Kt:Nt:t?Nt:Kt;case"left":case"right":return t?Zn:eo;default:return[]}}function no(e,t,n,o){const r=Re(e);let i=to(Q(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(At)))),i}function nt(e){const t=Q(e);return Gn[t]+e.slice(t.length)}function oo(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 dn(e){return typeof e!="number"?oo(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function dr(e,t={}){const{enabled:n=!0,event:o="click",toggle:r=!0,ignoreMouse:i=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=Xn}=t,a="rootStore"in e?e.rootStore:e,u=a.context.dataRef,f=w.useRef(void 0),g=Ot(),m=sn(),d=w.useMemo(()=>{function p(x,y,E,R){const v=Je(l,y,E);x&&R==="touch"&&c>0?m.start(c,()=>{a.setOpen(!0,v)}):a.setOpen(x,v)}function h(x,y,E){const R=u.current.openEvent,v=a.select("domReferenceElement")!==y;return x&&v||!x||!r?!0:R&&s?!E(R.type):!1}return{onPointerDown(x){f.current=pt(x.pointerType,!0)&&cn(x.nativeEvent)?"virtual":x.pointerType},onMouseDown(x){const y=f.current,E=x.nativeEvent,R=a.select("open");if(x.button!==0||o==="click"||pt(y,!0)&&i)return;const v=h(R,x.currentTarget,O=>O==="click"||O==="mousedown"),S=fn(E);if(In(S)){p(v,E,S,y);return}const P=x.currentTarget;g.request(()=>{p(v,E,P,y)})},onClick(x){if(o==="mousedown-only")return;const y=f.current;if(o==="mousedown"&&y){f.current=void 0;return}if(pt(y,!0)&&i)return;const E=a.select("open"),R=h(E,x.currentTarget,v=>v==="click"||v==="mousedown"||v==="keydown"||v==="keyup");p(R,x.nativeEvent,x.currentTarget,y)},onKeyDown(){f.current=void 0}}},[u,o,i,l,a,s,r,g,m,c]);return w.useMemo(()=>n?{reference:d}:tn,[n,d])}function Yt(e,t,n){let{reference:o,floating:r}=e;const i=J(t),s=Tt(t),c=Mt(s),l=Q(t),a=i==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let m;switch(l){case"top":m={x:u,y:o.y-r.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:f};break;case"left":m={x:o.x-r.width,y:f};break;default:m={x:o.x,y:o.y}}const d=Re(t);return d&&(m[s]+=g*(d==="end"?1:-1)*(n&&a?-1:1)),m}async function ro(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:g=!1,padding:m=0}=ye(t,e),d=dn(m),h=c[g?f==="floating"?"reference":"floating":f],x=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:u,strategy:l})),y=f==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},v=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:E,strategy:l}):y);return{top:(x.top-v.top+d.top)/R.y,bottom:(v.bottom-x.bottom+d.bottom)/R.y,left:(x.left-v.left+d.left)/R.x,right:(v.right-x.right+d.right)/R.x}}const io=50,so=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:ro},l=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Yt(a,o,l),g=o,m=0;const d={};for(let p=0;p<i.length;p++){const h=i[p];if(!h)continue;const{name:x,fn:y}=h,{x:E,y:R,data:v,reset:S}=await y({x:u,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:d,rects:a,platform:c,elements:{reference:e,floating:t}});u=E??u,f=R??f,d[x]={...d[x],...v},S&&m<io&&(m++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(a=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:u,y:f}=Yt(a,g,l)),p=-1)}return{x:u,y:f,placement:g,strategy:r,middlewareData:d}},co=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0,...h}=ye(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Q(r),y=J(c),E=Q(c)===c,R=await(l.isRTL==null?void 0:l.isRTL(a.floating)),v=g||(E||!p?[nt(c)]:Qn(c)),S=d!=="none";!g&&S&&v.push(...no(c,p,d,R));const P=[c,...v],O=await l.detectOverflow(t,h),D=[];let L=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&D.push(O[x]),f){const T=Jn(r,s,R);D.push(O[T[0]],O[T[1]])}if(L=[...L,{placement:r,overflows:D}],!D.every(T=>T<=0)){var k,K;const T=(((k=i.flip)==null?void 0:k.index)||0)+1,$=P[T];if($&&(!(f==="alignment"?y!==J($):!1)||L.every(b=>J(b.placement)===y?b.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:$}};let F=(K=L.filter(W=>W.overflows[0]<=0).sort((W,b)=>W.overflows[1]-b.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(m){case"bestFit":{var z;const W=(z=L.filter(b=>{if(S){const _=J(b.placement);return _===y||_==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(_=>_>0).reduce((_,B)=>_+B,0)]).sort((b,_)=>b[1]-_[1])[0])==null?void 0:z[0];W&&(F=W);break}case"initialPlacement":F=c;break}if(r!==F)return{reset:{placement:F}}}return{}}}},mn=new Set(["left","top"]);async function lo(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Q(n),c=Re(n),l=J(n)==="y",a=mn.has(s)?-1:1,u=i&&l?-1:1,f=ye(t,e);let{mainAxis:g,crossAxis:m,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof d=="number"&&(m=c==="end"?d*-1:d),l?{x:m*u,y:g*a}:{x:g*a,y:m*u}}const ao=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await lo(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},fo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x:E,y:R}=y;return{x:E,y:R}}},...a}=ye(e,t),u={x:n,y:o},f=await i.detectOverflow(t,a),g=J(r),m=Pt(g);let d=u[m],p=u[g];const h=(y,E)=>un(E+f[y==="y"?"top":"left"],E,E-f[y==="y"?"bottom":"right"]);s&&(d=h(m,d)),c&&(p=h(g,p));const x=l.fn({...t,[m]:d,[g]:p});return{...x,data:{x:x.x-n,y:x.y-o,enabled:{[m]:s,[g]:c}}}}}},uo=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:i,placement:s,rects:c,middlewareData:l}=t,{offset:a=0,mainAxis:u=!0,crossAxis:f=!0}=ye(e,t),g={x:r,y:i},m=J(s),d=Pt(m);let p=g[d],h=g[m];const x=ye(a,t),y=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(o=x.crossAxis)!=null?o:0};if(u){const v=d==="y"?"height":"width",S=c.reference[d]-c.floating[v]+y.mainAxis,P=c.reference[d]+c.reference[v]-y.mainAxis;p<S?p=S:p>P&&(p=P)}if(f){var E,R;const v=d==="y"?"width":"height",S=mn.has(Q(s)),P=c.reference[m]-c.floating[v]+(S&&((E=l.offset)==null?void 0:E[m])||0)+(S?0:y.crossAxis),O=c.reference[m]+c.reference[v]+(S?0:((R=l.offset)==null?void 0:R[m])||0)-(S?y.crossAxis:0);h<P?h=P:h>O&&(h=O)}return{[d]:p,[m]:h}}}},mo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...c}=ye(e,t),l=await r.detectOverflow(t,c),a=Q(n),u=Re(n),f=J(n)==="y",{width:g,height:m}=o.floating;let d,p;a==="top"||a==="bottom"?(d=a,p=u===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(p=a,d=u==="end"?"top":"bottom");const h=m-l.top-l.bottom,x=g-l.left-l.right,y=Le(m-l[d],h),E=Le(g-l[p],x),R=t.middlewareData.shift,v=!R;let S=y,P=E;R!=null&&R.enabled.x&&(P=x),R!=null&&R.enabled.y&&(S=h),v&&!u&&(f?P=g-2*de(l.left,l.right):S=m-2*de(l.top,l.bottom)),await s({...t,availableWidth:P,availableHeight:S});const O=await r.getDimensions(i.floating);return g!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function gn(e){const t=xe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=pe(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=tt(n)!==i||tt(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function Lt(e){return U(e)?e:e.contextElement}function Te(e){const t=Lt(e);if(!pe(t))return me(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=gn(t);let s=(i?tt(n.width):n.width)/o,c=(i?tt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const go=me(0);function hn(e){const t=se(e);return!rn()||!t.visualViewport?go:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ho(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===se(e)}function Oe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Lt(e);let s=me(1);t&&(o?U(o)&&(s=Te(o)):s=Te(e));const c=ho(i,n,o)?hn(i):me(0);let l=(r.left+c.x)/s.x,a=(r.top+c.y)/s.y,u=r.width/s.x,f=r.height/s.y;if(i&&o){const g=se(i),m=U(o)?se(o):o;let d=g,p=_t(d);for(;p&&m!==d;){const h=Te(p),x=p.getBoundingClientRect(),y=xe(p),E=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*h.x,R=x.top+(p.clientTop+parseFloat(y.paddingTop))*h.y;l*=h.x,a*=h.y,u*=h.x,f*=h.y,l+=E,a+=R,d=se(p),p=_t(d)}}return ot({width:u,height:f,x:l,y:a})}function lt(e,t){const n=it(e).scrollLeft;return t?t.left+n:Oe(we(e)).left+n}function pn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-lt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function po(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=we(o),c=t?Et(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=me(1);const u=me(0),f=pe(o);if((f||!i)&&((St(o)!=="body"||on(s))&&(l=it(o)),f)){const m=Oe(o);a=Te(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}const g=s&&!f&&!i?pn(s,l):me(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+u.x+g.x,y:n.y*a.y-l.scrollTop*a.y+u.y+g.y}}function xo(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function yo(e){const t=it(e),n=e.ownerDocument.body,o=de(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=de(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+lt(e);const s=-t.scrollTop;return xe(n).direction==="rtl"&&(i+=de(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}const wo=25;function Ro(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=se(e),i=we(e),s=r.visualViewport;let c=i.clientWidth,l=i.clientHeight,a=0,u=0;if(s){const g=!rn()||t==="fixed";o?g||(a=-s.offsetLeft,u=-s.offsetTop):(c=s.width,l=s.height,g&&(a=s.offsetLeft,u=s.offsetTop))}if(lt(i)<=0){const g=i.ownerDocument,m=g.body,d=getComputedStyle(m),p=g.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(i.clientWidth-m.clientWidth-p),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?h/2:h;x<=wo&&(c-=x)}return{width:c,height:l,x:a,y:u}}function bo(e,t){const n=Oe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Te(e),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,a=o*i.y;return{width:s,height:c,x:l,y:a}}function Xt(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Ro(e,n,t);else if(t==="document")o=yo(we(e));else if(U(t))o=bo(t,n);else{const r=hn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ot(o)}function vo(e,t){const n=t.get(e);if(n)return n;let o=vt(e,[],!1).filter(c=>U(c)&&St(c)!=="body"),r=null;const i=xe(e).position==="fixed";let s=i?Ze(e):e;for(;U(s)&&!bt(s);){const c=xe(s),l=nn(s),a=r?r.position:i?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(f=>f!==s):r=c,s=Ze(s)}return t.set(e,o),o}function Oo(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Et(t)?[]:vo(t,this._c):[].concat(n),o],c=Xt(t,s[0],r);let l=c.top,a=c.right,u=c.bottom,f=c.left;for(let g=1;g<s.length;g++){const m=Xt(t,s[g],r);l=de(m.top,l),a=Le(m.right,a),u=Le(m.bottom,u),f=de(m.left,f)}return{width:a-f,height:u-l,x:f,y:l}}function Ao(e){const{width:t,height:n}=gn(e);return{width:t,height:n}}function Eo(e,t,n){const o=pe(t),r=we(t),i=n==="fixed",s=Oe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=me(0);if((o||!i)&&((St(t)!=="body"||on(r))&&(c=it(t)),o)){const g=Oe(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}!o&&r&&(l.x=lt(r));const a=r&&!o&&!i?pn(r,c):me(0),u=s.left+c.scrollLeft-l.x-a.x,f=s.top+c.scrollTop-l.y-a.y;return{x:u,y:f,width:s.width,height:s.height}}function yt(e){return xe(e).position==="static"}function jt(e,t){if(!pe(e)||xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function xn(e,t){const n=se(e);if(Et(e))return n;if(!pe(e)){let r=Ze(e);for(;r&&!bt(r);){if(U(r)&&!yt(r))return r;r=Ze(r)}return n}let o=jt(e,t);for(;o&&Cn(o)&&yt(o);)o=jt(o,t);return o&&bt(o)&&yt(o)&&!nn(o)?n:o||Pn(e)||n}const So=async function(e){const t=this.getOffsetParent||xn,n=this.getDimensions,o=await n(e.floating);return{reference:Eo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Co(e){return xe(e).direction==="rtl"}const Po={convertOffsetParentRelativeRectToViewportRelativeRect:po,getDocumentElement:we,getClippingRect:Oo,getOffsetParent:xn,getElementRects:So,getClientRects:xo,getDimensions:Ao,getScale:Te,isElement:U,isRTL:Co};function yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mo(e,t,n){let o=null,r;const i=we(e);function s(){var u;clearTimeout(r),(u=o)==null||u.disconnect(),o=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();const g=e.getBoundingClientRect(),{left:m,top:d,width:p,height:h}=g;if(u||t(),!p||!h)return;const x=qe(d),y=qe(i.clientWidth-(m+p)),E=qe(i.clientHeight-(d+h)),R=qe(m),S={rootMargin:-x+"px "+-y+"px "+-E+"px "+-R+"px",threshold:de(0,Le(1,f))||1};let P=!0;function O(D){const L=D[0].intersectionRatio;if(!yn(g,e.getBoundingClientRect()))return c();if(L!==f){if(!P)return c();L?c(!1,L):r=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(O,{...S,root:i.ownerDocument})}catch{o=new IntersectionObserver(O,S)}o.observe(e)}const l=se(e),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),s()}}function qt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Lt(e),u=r||i?[...a?vt(a):[],...t?vt(t):[]]:[];u.forEach(x=>{r&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const f=a&&c?Mo(a,n,i):null;let g=-1,m=null;s&&(m=new ResizeObserver(x=>{let[y]=x;y&&y.target===a&&m&&t&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),n()}),a&&!l&&m.observe(a),t&&m.observe(t));let d,p=l?Oe(e):null;l&&h();function h(){const x=Oe(e);p&&!yn(p,x)&&n(),p=x,d=requestAnimationFrame(h)}return n(),()=>{var x;u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const To=ao,Lo=fo,Do=co,ko=mo,Io=uo,Fo=(e,t,n)=>{const o=new Map,r=n??{},i={...Po,...r.platform,_c:o};return so(e,t,{...r,platform:i})};var Wo=typeof document<"u",Vo=function(){},Qe=Wo?w.useLayoutEffect:Vo;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!rt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!rt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function wn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ut(e,t){const n=wn(e);return Math.round(t*n)/n}function wt(e){const t=w.useRef(e);return Qe(()=>{t.current=e}),t}function $o(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[u,f]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,m]=w.useState(o);rt(g,o)||m(o);const[d,p]=w.useState(null),[h,x]=w.useState(null),y=w.useCallback(b=>{b!==S.current&&(S.current=b,p(b))},[]),E=w.useCallback(b=>{b!==P.current&&(P.current=b,x(b))},[]),R=i||d,v=s||h,S=w.useRef(null),P=w.useRef(null),O=w.useRef(u),D=l!=null,L=wt(l),k=wt(r),K=wt(a),z=w.useCallback(()=>{if(!S.current||!P.current)return;const b={placement:t,strategy:n,middleware:g};k.current&&(b.platform=k.current),Fo(S.current,P.current,b).then(_=>{const B={..._,isPositioned:K.current!==!1};T.current&&!rt(O.current,B)&&(O.current=B,Mn.flushSync(()=>{f(B)}))})},[g,t,n,k,K]);Qe(()=>{a===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(b=>({...b,isPositioned:!1})))},[a]);const T=w.useRef(!1);Qe(()=>(T.current=!0,()=>{T.current=!1}),[]),Qe(()=>{if(R&&(S.current=R),v&&(P.current=v),R&&v){if(L.current)return L.current(R,v,z);z()}},[R,v,z,L,D]);const $=w.useMemo(()=>({reference:S,floating:P,setReference:y,setFloating:E}),[y,E]),F=w.useMemo(()=>({reference:R,floating:v}),[R,v]),W=w.useMemo(()=>{const b={position:n,left:0,top:0};if(!F.floating)return b;const _=Ut(F.floating,u.x),B=Ut(F.floating,u.y);return c?{...b,transform:"translate("+_+"px, "+B+"px)",...wn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:B}},[n,c,F.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:z,refs:$,elements:F,floatingStyles:W}),[u,z,$,F,W])}const _o=(e,t)=>{const n=To(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bo=(e,t)=>{const n=Lo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ho=(e,t)=>({fn:Io(e).fn,options:[e,t]}),zo=(e,t)=>{const n=Do(e);return{name:n.name,fn:n.fn,options:[e,t]}},No=(e,t)=>{const n=ko(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Ko(e){return Yo(e,e.rootContext)}function Yo(e,t){const{nodeId:n,externalTree:o}=e,r=t.useState("referenceElement"),i=t.useState("floatingElement"),s=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[a,u]=w.useState(null),[f,g]=w.useState(void 0),[m,d]=w.useState(void 0),p=w.useRef(null),h=ln(o),x=w.useMemo(()=>({reference:r,floating:i,domReference:s}),[r,i,s]),y=$o({...e,elements:{...x,...a&&{reference:a}}}),E=U(f)?f:null,R=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?s:E),t.useSyncedValue("floatingElement",R);const v=w.useCallback(k=>{const K=U(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),getClientRects:()=>k.getClientRects(),contextElement:k}:k;u(K),y.refs.setReference(K)},[y.refs]),S=w.useCallback(k=>{(U(k)||k===null)&&(p.current=k,g(k)),(U(y.refs.reference.current)||y.refs.reference.current===null||k!==null&&!U(k))&&y.refs.setReference(k)},[y.refs,g]),P=w.useCallback(k=>{d(k),y.refs.setFloating(k)},[y.refs]),O=w.useMemo(()=>({...y.refs,setReference:S,setFloating:P,setPositionReference:v,domReference:p}),[y.refs,S,P,v]),D=w.useMemo(()=>({...y.elements,domReference:s}),[y.elements,s]),L=w.useMemo(()=>({...y,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:O,elements:D,nodeId:n,rootStore:t}),[y,O,D,n,t,c,l]);return q(()=>{s&&(p.current=s)},[s]),q(()=>{t.context.dataRef.current.floatingContext=L;const k=h?.nodesRef.current.find(K=>K.id===n);k&&(k.context=L)}),w.useMemo(()=>({...y,context:L,refs:O,elements:D,rootStore:t}),[y,O,D,L,t])}const Xo="Escape";function Gt(e){return _n&&e.movementX===0&&e.movementY===0}function at(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ue(e,t){return at(t,e===an||e===Ct,e===st||e===ct)}function Rt(e,t,n){return at(t,e===Ct,n?e===st:e===ct)||e==="Enter"||e===" "||e===""}function jo(e,t,n){return at(t,n?e===st:e===ct,e===Ct)}function qo(e,t,n,o){const r=n?e===ct:e===st,i=e===an;return t==="both"||t==="horizontal"&&o?e===Xo:at(t,r,i)}function mr(e,t){const{listRef:n,activeIndex:o,onNavigate:r=()=>{},enabled:i=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:a=!1,rtl:u=!1,virtual:f=!1,focusItemOnOpen:g="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:d=!0,disabledIndices:p=void 0,orientation:h="vertical",parentOrientation:x,id:y,resetOnPointerLeave:E=!0,externalTree:R,grid:v}=t,S=v!=null,P="rootStore"in e?e.rootStore:e,O=P.useState("open"),D=P.useState("floatingElement"),L=P.useState("domReferenceElement"),k=P.context.dataRef,K=Fn(D),z=Wn(L),T=ue(K),$=Vn(),F=ln(R),W=w.useRef(g),b=w.useRef(s??-1),_=w.useRef(null),B=w.useRef(!0),N=ie(A=>{r(b.current===-1?null:b.current,A)}),be=w.useRef(!!D),H=w.useRef(O),X=w.useRef(!1),Ae=w.useRef(!1),De=w.useRef(null),ft=ue(p),Ee=ue(O),ee=ue(s),ce=ue(E),ke=Ot(),Se=Ot(),Ie=ie(()=>{function A(V){f?F?.events.emit("virtualfocus",V):De.current=$n(V,{sync:X.current,preventScroll:!0})}const C=n.current[b.current],Y=Ae.current;C&&A(C),(X.current?V=>V():V=>ke.request(V))(()=>{const V=n.current[b.current]||C;if(!V)return;C||A(V),Ce&&(Y||!B.current)&&V.scrollIntoView?.({block:"nearest",inline:"nearest"})})});q(()=>{k.current.orientation=h},[k,h]),q(()=>{i&&(O&&D?(b.current=s??-1,W.current&&s!=null&&(Ae.current=!0,N())):be.current&&(b.current=-1,N()))},[i,O,D,s,N]),q(()=>{if(i){if(!O){X.current=!1;return}if(D)if(o==null){if(X.current=!1,ee.current!=null)return;if(be.current&&(b.current=-1,Ie()),(!H.current||!be.current)&&W.current&&(_.current!=null||W.current===!0&&_.current==null)){let A=0;const C=()=>{n.current[0]==null?(A<2&&(A?M=>Se.request(M):queueMicrotask)(C),A+=1):(b.current=_.current==null||Rt(_.current,h,u)||a?ht(n):Ht(n),_.current=null,N())};C()}}else Bt(n.current,o)||(b.current=o,Ie(),Ae.current=!1)}},[i,O,D,o,ee,a,n,h,u,N,Ie,Se]),q(()=>{if(!i||D||!F||f||!be.current)return;const A=F.nodesRef.current,C=A.find(V=>V.id===$)?.context?.elements.floating,Y=xt(et(L??C??null)),M=A.some(V=>V.context&&He(V.context.elements.floating,Y));C&&!M&&B.current&&C.focus({preventScroll:!0})},[i,D,L,F,$,f]),q(()=>{H.current=O,be.current=!!D}),q(()=>{O||(_.current=null,W.current=g)},[O,g]);const ze=o!=null,te=ie(A=>{if(!Ee.current)return;const C=n.current.indexOf(A.currentTarget);C!==-1&&(b.current!==C||o!==C)&&(b.current=C,N(A))}),ve=ie(()=>x??F?.nodesRef.current.find(A=>A.id===$)?.context?.dataRef?.current.orientation),Fe=ie(()=>ht(n,ft.current)),ge=ie(A=>{if(B.current=!1,X.current=!0,A.which===229||!Ee.current&&A.currentTarget===T.current)return;if(a&&qo(A.key,h,u,S)){Ue(A.key,ve())||fe(A),P.setOpen(!1,Je(zt,A.nativeEvent)),pe(L)&&(f?F?.events.emit("virtualfocus",L):L.focus());return}const C=b.current,Y=ht(n,p),M=Ht(n,p);if(z||(A.key==="Home"&&(fe(A),b.current=Y,N(A)),A.key==="End"&&(fe(A),b.current=M,N(A))),v!=null){const V=v(A,b.current,n,h,l,u,p,Y,M);if(V!=null&&(b.current=V,N(A)),h==="both")return}if(Ue(A.key,h)){if(fe(A),O&&!f&&xt(A.currentTarget.ownerDocument)===A.currentTarget){b.current=Rt(A.key,h,u)?Y:M,N(A);return}Rt(A.key,h,u)?l?C>=M?c&&C!==n.current.length?b.current=-1:(X.current=!1,b.current=Y):b.current=je(n.current,{startingIndex:C,disabledIndices:p}):b.current=Math.min(M,je(n.current,{startingIndex:C,disabledIndices:p})):l?C<=Y?c&&C!==-1?b.current=n.current.length:(X.current=!1,b.current=M):b.current=je(n.current,{startingIndex:C,decrement:!0,disabledIndices:p}):b.current=Math.max(Y,je(n.current,{startingIndex:C,decrement:!0,disabledIndices:p})),Bt(n.current,b.current)&&(b.current=-1),N(A)}}),Ce=w.useMemo(()=>({onFocus(C){X.current=!0,te(C)},onClick:({currentTarget:C})=>C.focus({preventScroll:!0}),onMouseMove(C){Gt(C)||(X.current=!0,Ae.current=!1,m&&te(C))},onPointerLeave(C){if(!Ee.current||!B.current||C.pointerType==="touch")return;X.current=!0;const Y=C.relatedTarget;if(!(!m||n.current.includes(Y))&&ce.current&&(De.current?.(),De.current=null,b.current=-1,N(C),!f)){const M=T.current,V=xt(et(M));M&&He(M,V)&&M.focus({preventScroll:!0})}}}),[te,Ee,T,m,n,N,ce,f]),he=w.useMemo(()=>f&&O&&ze&&{"aria-activedescendant":`${y}-${o}`},[f,O,ze,y,o]),le=w.useMemo(()=>({"aria-orientation":h==="both"?void 0:h,...z?{}:he,onKeyDown(A){if(A.key==="Tab"&&A.shiftKey&&O&&!f){const C=fn(A.nativeEvent);if(C&&!He(T.current,C))return;fe(A),P.setOpen(!1,Je(jn,A.nativeEvent)),pe(L)&&L.focus();return}ge(A)},onPointerMove(A){Gt(A)||(B.current=!0)}}),[he,ge,T,h,z,P,O,f,L]),ne=w.useMemo(()=>{function A(M){P.setOpen(!0,Je(zt,M.nativeEvent,M.currentTarget))}function C(M){g==="auto"&&Bn(M.nativeEvent)&&(W.current=!f)}function Y(M){W.current=g,g==="auto"&&cn(M.nativeEvent)&&(W.current=!0)}return{onKeyDown(M){const V=P.select("open");B.current=!1;const Z=M.key.startsWith("Arrow"),Ve=jo(M.key,ve(),u),$e=Ue(M.key,h),Ne=(a?Ve:$e)||M.key==="Enter"||M.key.trim()==="";if(f&&V)return ge(M);if(!(!V&&!d&&Z)){if(Ne){const Pe=Ue(M.key,ve());_.current=a&&Pe?null:M.key}if(a){Ve&&(fe(M),V?(b.current=Fe(),N(M)):A(M));return}$e&&(ee.current!=null&&(b.current=ee.current),fe(M),!V&&d?A(M):ge(M),V&&N(M))}},onFocus(M){P.select("open")&&!f&&(b.current=-1,N(M))},onPointerDown:Y,onPointerEnter:Y,onMouseDown:C,onClick:C}},[ge,g,Fe,a,N,P,d,h,ve,u,ee,f]),We=w.useMemo(()=>({...he,...ne}),[he,ne]);return w.useMemo(()=>i?{reference:We,floating:le,item:Ce,trigger:ne}:{},[i,We,le,ne,Ce])}function gr(e,t){const{listRef:n,elementsRef:o,activeIndex:r,onMatch:i,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:a=750,selectedIndex:u=null}=t,f="rootStore"in e?e.rootStore:e,g=f.useState("open"),m=sn(),d=w.useRef(""),p=w.useRef(u??r??-1),h=w.useRef(null),x=ie(R=>{function v(T){return o?.current[T]}function S(T){const $=v(T);return $&&!Dn($)||$?.matches(":disabled")?!1:s==null||!kn(Tn,T,s)}function P(T,$,F=0){if(T.length===0)return-1;const W=(F%T.length+T.length)%T.length,b=$.toLowerCase();for(let _=0;_<T.length;_+=1){const B=(W+_)%T.length;if(!(!T[B]?.toLowerCase().startsWith(b)||!S(B)))return B}return-1}const O=n.current;if(d.current.length>0&&R.key===" "&&(fe(R),c?.(!0)),d.current.length>0&&d.current[0]!==" "&&P(O,d.current)===-1&&R.key!==" "&&c?.(!1),O==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(fe(R),c?.(!0));const D=d.current==="";D&&(p.current=u??r??-1),O.every((T,$)=>T&&S($)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&d.current===R.key&&(d.current="",p.current=h.current),d.current+=R.key,m.start(a,()=>{d.current="",p.current=h.current,c?.(!1)});const K=((D?u??r??-1:p.current)??0)+1,z=P(O,d.current,K);z!==-1?(i?.(z),h.current=z):R.key!==" "&&(d.current="",c?.(!1))}),y=ie(R=>{const v=R.relatedTarget,S=f.select("domReferenceElement"),P=f.select("floatingElement");He(S,v)||He(P,v)||(m.clear(),d.current="",p.current=h.current,c?.(!1))});q(()=>{!g&&u!==null||(m.clear(),h.current=null,d.current!==""&&(d.current=""))},[g,u,m]);const E=w.useMemo(()=>({onKeyDown:x,onBlur:y}),[x,y]);return w.useMemo(()=>l?{reference:E,floating:E}:{},[l,E])}function Uo(e){const t=w.useRef(""),n=w.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:w.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 Go(e,t){const n=ie((i,s)=>{(typeof e=="function"?e():e)||t(s||(Hn?"touch":""))}),{onClick:o,onPointerDown:r}=Uo(n);return w.useMemo(()=>({onClick:o,onPointerDown:r}),[o,r])}function hr(e){const[t,n]=w.useState(null),o=Go(e,n);return qn(e,r=>{r&&!e&&n(null)}),w.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const Jo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:a,padding:u=0,offsetParent:f="real"}=ye(e,t)||{};if(a==null)return{};const g=dn(u),m={x:n,y:o},d=Tt(r),p=Mt(d),h=await s.getDimensions(a),x=d==="y",y=x?"top":"left",E=x?"bottom":"right",R=x?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[d]-m[d]-i.floating[p],S=m[d]-i.reference[d],P=f==="real"?await s.getOffsetParent?.(a):c.floating;let O=c.floating[R]||i.floating[p];(!O||!await s.isElement?.(P))&&(O=c.floating[R]||i.floating[p]);const D=v/2-S/2,L=O/2-h[p]/2-1,k=Math.min(g[y],L),K=Math.min(g[E],L),z=k,T=O-h[p]-K,$=O/2-h[p]/2+D,F=un(z,$,T),W=!l.arrow&&Re(r)!=null&&$!==F&&i.reference[p]/2-($<z?k:K)-h[p]/2<0,b=W?$<z?$-z:$-T:0;return{[d]:m[d]+b,data:{[d]:F,centerOffset:$-F-b,...W&&{alignmentOffset:b}},reset:W}}}),Qo=(e,t)=>({...Jo(e),options:[e,t]}),Zo={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,i=t===0&&n===0&&o===0&&r===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-n>=0||s.right-t>=0||s.bottom-n>=0||s.left-t>=0||i}}}},er={sideX:"left",sideY:"top"},Jt="--available-width",Qt="--available-height";function Rn(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 Zt(e,t,n){const{rects:o,placement:r}=e;return{side:Rn(t,Q(r),n),align:Re(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function pr(e){return tr(e,Ko)}function tr(e,t){const{anchor:n,positionMethod:o="absolute",side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:a=5,sticky:u=!1,arrowPadding:f=5,disableAnchorTracking:g=!1,inline:m,keepMounted:d=!1,floatingRootContext:p,mounted:h,collisionAvoidance:x,shift:y,nodeId:E,adaptiveOrigin:R,lazyFlip:v=!1,externalTree:S}=e,[P,O]=w.useState(null);!h&&P!==null&&O(null);const D=x.side||"flip",L=x.align||"flip",k=x.fallbackAxisSide||"end",K=y?.crossAxis??!1,z=y?.rootBoundary,T=typeof n=="function"?n:void 0,$=ie(T),F=T?$:n,W=ue(n),b=ue(h),B=Un()==="rtl",N=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],be=s==="center"?N:`${N}-${s}`;let H=a;typeof H=="number"?H={top:H,right:H,bottom:H,left:H}:H&&(H={top:H.top||0,right:H.right||0,bottom:H.bottom||0,left:H.left||0});const X=1,Ae=r==="bottom"?X:0,De=r==="top"?X:0,ft=r==="right"?X:0,Ee=r==="left"?X:0,ee={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:H},ce=w.useRef(null),ke=ue(i),Se=ue(c),Ie=typeof i!="function"?i:0,ze=typeof c!="function"?c:0,te=[];m&&te.push(m),te.push(_o(I=>{const G=Zt(I,r,B),oe=typeof ke.current=="function"?ke.current(G):ke.current,j=typeof Se.current=="function"?Se.current(G):Se.current;return{mainAxis:oe,crossAxis:j,alignmentAxis:j}},[Ie,ze,B,r]));const ve=L==="none"&&D!=="shift",Fe=!ve&&(u||K||D==="shift"),ge=D==="none"?null:zo({...ee,padding:{top:H.top+X+Ae,right:H.right+X+Ee,bottom:H.bottom+X+De,left:H.left+X+ft},mainAxis:!K&&D==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:k}),Ce=ve?null:Bo({...ee,rootBoundary:z,mainAxis:L!=="none",crossAxis:Fe,limiter:u||K?void 0:Ho(I=>{if(!ce.current)return{};const{width:G,height:oe}=ce.current.getBoundingClientRect(),j=J(Q(I.placement)),ae=j==="y"?G:oe,re=j==="y"?H.left+H.right:H.top+H.bottom;return{offset:ae/2+re/2}})},[ee,u,K,z,H,L]);D==="shift"||L==="shift"||s==="center"?te.push(Ce,ge):te.push(ge,Ce),te.push(No({...ee,apply({elements:{floating:I},availableWidth:G,availableHeight:oe,rects:j}){if(!b.current)return;const ae=I.style;ae.setProperty(Jt,`${G}px`),ae.setProperty(Qt,`${oe}px`);const re=se(I).devicePixelRatio||1,{x:_e,y:Ye,width:Xe,height:ut}=j.reference,dt=(Math.round((_e+Xe)*re)-Math.round(_e*re))/re,mt=(Math.round((Ye+ut)*re)-Math.round(Ye*re))/re;ae.setProperty("--anchor-width",`${dt}px`),ae.setProperty("--anchor-height",`${mt}px`)}}),Qo(I=>({element:ce.current||et(I.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(I){const{elements:G,middlewareData:oe,placement:j,rects:ae,y:re}=I,_e=Q(j),Ye=J(_e),Xe=ce.current,ut=oe.arrow?.x||0,dt=oe.arrow?.y||0,mt=Xe?.clientWidth||0,bn=Xe?.clientHeight||0,gt=ut+mt/2,$t=dt+bn/2,vn=Math.abs(oe.shift?.y||0),On=ae.reference.height/2,Be=typeof i=="function"?i(Zt(I,r,B)):i,An=vn>Be,En={top:`${gt}px calc(100% + ${Be}px)`,bottom:`${gt}px ${-Be}px`,left:`calc(100% + ${Be}px) ${$t}px`,right:`${-Be}px ${$t}px`}[_e],Sn=`${gt}px ${ae.reference.y+On-re}px`;return G.floating.style.setProperty("--transform-origin",Fe&&Ye==="y"&&An?Sn:En),{}}},Zo,R),q(()=>{!h&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,p]);const he=w.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:le,elements:ne,x:We,y:A,middlewareData:C,update:Y,placement:M,context:V,isPositioned:Z,floatingStyles:Ve}=t({rootContext:p,open:d?h:void 0,placement:be,middleware:te,strategy:o,whileElementsMounted:d?void 0:(...I)=>qt(...I,he),nodeId:E,externalTree:S}),{sideX:$e,sideY:Ne}=C.adaptiveOrigin||er,Pe=Z?o:"fixed",Dt=w.useMemo(()=>{let I;return Z?R?I={position:Pe,[$e]:We,[Ne]:A}:I={...Ve,position:Pe}:I={position:Pe,top:0,left:0},I[Jt]="100vw",I[Qt]="100vh",Z||(I.opacity=0),I},[R,Pe,$e,We,Ne,A,Ve,Z]),Ke=w.useRef(null);q(()=>{if(!h)return;const I=W.current,G=typeof I=="function"?I():I,j=(en(G)?G.current:G)||null||null;j!==Ke.current&&(le.setPositionReference(j),Ke.current=j)},[h,le,F,W]),w.useEffect(()=>{if(!h)return;const I=W.current;typeof I!="function"&&en(I)&&I.current!==Ke.current&&(le.setPositionReference(I.current),Ke.current=I.current)},[h,le,F,W]),w.useEffect(()=>{if(d&&h&&ne.reference&&ne.floating)return qt(ne.reference,ne.floating,Y,he)},[d,h,ne,Y,he]);const Me=Q(M),kt=Rn(r,Me,B),It=Re(M)||"center",Ft=!!C.hide?.referenceHidden;q(()=>{v&&h&&Z&&Me!==N&&O(Me)},[v,h,Z,Me,N]);const Wt=w.useMemo(()=>({position:"absolute",top:C.arrow?.y,left:C.arrow?.x}),[C.arrow]),Vt=C.arrow?.centerOffset!==0;return w.useMemo(()=>({positionerStyles:Dt,arrowStyles:Wt,arrowRef:ce,arrowUncentered:Vt,side:kt,align:It,physicalSide:Me,anchorHidden:Ft,refs:le,context:V,isPositioned:Z,update:Y}),[Dt,Wt,ce,Vt,kt,It,Me,Ft,le,V,Z,Y])}function en(e){return e!=null&&"current"in e}function nr(e){return e==="starting"?zn:tn}function xr(e,t,{styles:n,transitionStatus:o,props:r,refs:i,hidden:s,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),Ln("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:s,style:l},nr(o),r],stateAttributesMapping:Nn})}const or=w.createContext(void 0);function yr(e){return w.useContext(or)}const rr=20;function wr(e,t,n,o){const[r,i]=w.useState(!1);q(()=>{if(!e||!t||n==null){i(!1);return}const s=et(n).documentElement.clientWidth,c=n.offsetWidth;i(s>0&&c>0&&c>=s-rr)},[e,t,n]),Kn(e&&(!t||r),o)}const Ge=5;function Rr(e,t){const n=ir(t);return e.clientX>=n.left-Ge&&e.clientX<=n.right+Ge&&e.clientY>=n.top-Ge&&e.clientY<=n.bottom+Ge}function ir(e){const t=e.getBoundingClientRect(),n=se(e);if(Yn)return t;const o=n.getComputedStyle(e,"::before"),r=n.getComputedStyle(e,"::after");if(!(o.content!=="none"||r.content!=="none"))return t;const s=parseFloat(o.width)||0,c=parseFloat(o.height)||0,l=parseFloat(r.width)||0,a=parseFloat(r.height)||0,u=Math.max(t.width,s,l),f=Math.max(t.height,c,a),g=u-t.width,m=f-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-m/2,bottom:t.bottom+m/2}}export{xr as a,yr as b,wr as c,hr as d,mr as e,gr as f,nr as g,dr as h,Rr as i,Po as p,ot as r,pr as u};
|
|
1
|
+
import{r as w,E as tn,l as U,a$ as we,aS as pe,b0 as xe,g as se,b1 as Et,aV as Ze,aU as bt,b2 as Cn,b3 as nn,b4 as Pn,b5 as St,b6 as on,b7 as it,b8 as vt,b9 as _t,ba as rn,n as Mn,e as q,f as ie,aT as Tn,k as Ln}from"./index-BC1mWQy8.js";import{d as Ot,e as Bt,g as ht,f as Ht,h as je,j as Dn,k as kn}from"./inertValue-Dy4HJtbg.js";import{m as sn,i as pt,B as In,a6 as cn,D as ln,a4 as Fn,a7 as Wn,l as ue,E as Vn,a8 as $n,a9 as fe,y as _n,a5 as Bn,aa as st,ab as ct,ac as an,ad as Ct,ae as Hn,af as zn,q as Nn,ag as Kn,ah as Yn}from"./useScrollLock-DV1FkBvY.js";import{t as Xn,g as fn,c as Je,m as xt,o as et,a as He,y as zt,x as jn}from"./createBaseUIEventDetails-67bayC1B.js";import{u as qn}from"./useValueChanged-CxAXjLUw.js";import{a as Un}from"./CompositeList-nzDbuttJ.js";const Le=Math.min,de=Math.max,tt=Math.round,qe=Math.floor,me=e=>({x:e,y:e}),Gn={left:"right",right:"left",bottom:"top",top:"bottom"};function un(e,t,n){return de(e,Le(t,n))}function ye(e,t){return typeof e=="function"?e(t):e}function Q(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function Pt(e){return e==="x"?"y":"x"}function Mt(e){return e==="y"?"height":"width"}function J(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Tt(e){return Pt(J(e))}function Jn(e,t,n){n===void 0&&(n=!1);const o=Re(e),r=Tt(e),i=Mt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=nt(s)),[s,nt(s)]}function Qn(e){const t=nt(e);return[At(e),t,At(t)]}function At(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Nt=["left","right"],Kt=["right","left"],Zn=["top","bottom"],eo=["bottom","top"];function to(e,t,n){switch(e){case"top":case"bottom":return n?t?Kt:Nt:t?Nt:Kt;case"left":case"right":return t?Zn:eo;default:return[]}}function no(e,t,n,o){const r=Re(e);let i=to(Q(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(At)))),i}function nt(e){const t=Q(e);return Gn[t]+e.slice(t.length)}function oo(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 dn(e){return typeof e!="number"?oo(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function dr(e,t={}){const{enabled:n=!0,event:o="click",toggle:r=!0,ignoreMouse:i=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=Xn}=t,a="rootStore"in e?e.rootStore:e,u=a.context.dataRef,f=w.useRef(void 0),g=Ot(),m=sn(),d=w.useMemo(()=>{function p(x,y,E,R){const v=Je(l,y,E);x&&R==="touch"&&c>0?m.start(c,()=>{a.setOpen(!0,v)}):a.setOpen(x,v)}function h(x,y,E){const R=u.current.openEvent,v=a.select("domReferenceElement")!==y;return x&&v||!x||!r?!0:R&&s?!E(R.type):!1}return{onPointerDown(x){f.current=pt(x.pointerType,!0)&&cn(x.nativeEvent)?"virtual":x.pointerType},onMouseDown(x){const y=f.current,E=x.nativeEvent,R=a.select("open");if(x.button!==0||o==="click"||pt(y,!0)&&i)return;const v=h(R,x.currentTarget,O=>O==="click"||O==="mousedown"),S=fn(E);if(In(S)){p(v,E,S,y);return}const P=x.currentTarget;g.request(()=>{p(v,E,P,y)})},onClick(x){if(o==="mousedown-only")return;const y=f.current;if(o==="mousedown"&&y){f.current=void 0;return}if(pt(y,!0)&&i)return;const E=a.select("open"),R=h(E,x.currentTarget,v=>v==="click"||v==="mousedown"||v==="keydown"||v==="keyup");p(R,x.nativeEvent,x.currentTarget,y)},onKeyDown(){f.current=void 0}}},[u,o,i,l,a,s,r,g,m,c]);return w.useMemo(()=>n?{reference:d}:tn,[n,d])}function Yt(e,t,n){let{reference:o,floating:r}=e;const i=J(t),s=Tt(t),c=Mt(s),l=Q(t),a=i==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let m;switch(l){case"top":m={x:u,y:o.y-r.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:f};break;case"left":m={x:o.x-r.width,y:f};break;default:m={x:o.x,y:o.y}}const d=Re(t);return d&&(m[s]+=g*(d==="end"?1:-1)*(n&&a?-1:1)),m}async function ro(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:g=!1,padding:m=0}=ye(t,e),d=dn(m),h=c[g?f==="floating"?"reference":"floating":f],x=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:u,strategy:l})),y=f==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},v=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:E,strategy:l}):y);return{top:(x.top-v.top+d.top)/R.y,bottom:(v.bottom-x.bottom+d.bottom)/R.y,left:(x.left-v.left+d.left)/R.x,right:(v.right-x.right+d.right)/R.x}}const io=50,so=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:ro},l=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Yt(a,o,l),g=o,m=0;const d={};for(let p=0;p<i.length;p++){const h=i[p];if(!h)continue;const{name:x,fn:y}=h,{x:E,y:R,data:v,reset:S}=await y({x:u,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:d,rects:a,platform:c,elements:{reference:e,floating:t}});u=E??u,f=R??f,d[x]={...d[x],...v},S&&m<io&&(m++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(a=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:u,y:f}=Yt(a,g,l)),p=-1)}return{x:u,y:f,placement:g,strategy:r,middlewareData:d}},co=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0,...h}=ye(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Q(r),y=J(c),E=Q(c)===c,R=await(l.isRTL==null?void 0:l.isRTL(a.floating)),v=g||(E||!p?[nt(c)]:Qn(c)),S=d!=="none";!g&&S&&v.push(...no(c,p,d,R));const P=[c,...v],O=await l.detectOverflow(t,h),D=[];let L=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&D.push(O[x]),f){const T=Jn(r,s,R);D.push(O[T[0]],O[T[1]])}if(L=[...L,{placement:r,overflows:D}],!D.every(T=>T<=0)){var k,K;const T=(((k=i.flip)==null?void 0:k.index)||0)+1,$=P[T];if($&&(!(f==="alignment"?y!==J($):!1)||L.every(b=>J(b.placement)===y?b.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:$}};let F=(K=L.filter(W=>W.overflows[0]<=0).sort((W,b)=>W.overflows[1]-b.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(m){case"bestFit":{var z;const W=(z=L.filter(b=>{if(S){const _=J(b.placement);return _===y||_==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(_=>_>0).reduce((_,B)=>_+B,0)]).sort((b,_)=>b[1]-_[1])[0])==null?void 0:z[0];W&&(F=W);break}case"initialPlacement":F=c;break}if(r!==F)return{reset:{placement:F}}}return{}}}},mn=new Set(["left","top"]);async function lo(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Q(n),c=Re(n),l=J(n)==="y",a=mn.has(s)?-1:1,u=i&&l?-1:1,f=ye(t,e);let{mainAxis:g,crossAxis:m,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof d=="number"&&(m=c==="end"?d*-1:d),l?{x:m*u,y:g*a}:{x:g*a,y:m*u}}const ao=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await lo(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},fo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x:E,y:R}=y;return{x:E,y:R}}},...a}=ye(e,t),u={x:n,y:o},f=await i.detectOverflow(t,a),g=J(r),m=Pt(g);let d=u[m],p=u[g];const h=(y,E)=>un(E+f[y==="y"?"top":"left"],E,E-f[y==="y"?"bottom":"right"]);s&&(d=h(m,d)),c&&(p=h(g,p));const x=l.fn({...t,[m]:d,[g]:p});return{...x,data:{x:x.x-n,y:x.y-o,enabled:{[m]:s,[g]:c}}}}}},uo=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:i,placement:s,rects:c,middlewareData:l}=t,{offset:a=0,mainAxis:u=!0,crossAxis:f=!0}=ye(e,t),g={x:r,y:i},m=J(s),d=Pt(m);let p=g[d],h=g[m];const x=ye(a,t),y=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:(n=x.mainAxis)!=null?n:0,crossAxis:(o=x.crossAxis)!=null?o:0};if(u){const v=d==="y"?"height":"width",S=c.reference[d]-c.floating[v]+y.mainAxis,P=c.reference[d]+c.reference[v]-y.mainAxis;p<S?p=S:p>P&&(p=P)}if(f){var E,R;const v=d==="y"?"width":"height",S=mn.has(Q(s)),P=c.reference[m]-c.floating[v]+(S&&((E=l.offset)==null?void 0:E[m])||0)+(S?0:y.crossAxis),O=c.reference[m]+c.reference[v]+(S?0:((R=l.offset)==null?void 0:R[m])||0)-(S?y.crossAxis:0);h<P?h=P:h>O&&(h=O)}return{[d]:p,[m]:h}}}},mo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...c}=ye(e,t),l=await r.detectOverflow(t,c),a=Q(n),u=Re(n),f=J(n)==="y",{width:g,height:m}=o.floating;let d,p;a==="top"||a==="bottom"?(d=a,p=u===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(p=a,d=u==="end"?"top":"bottom");const h=m-l.top-l.bottom,x=g-l.left-l.right,y=Le(m-l[d],h),E=Le(g-l[p],x),R=t.middlewareData.shift,v=!R;let S=y,P=E;R!=null&&R.enabled.x&&(P=x),R!=null&&R.enabled.y&&(S=h),v&&!u&&(f?P=g-2*de(l.left,l.right):S=m-2*de(l.top,l.bottom)),await s({...t,availableWidth:P,availableHeight:S});const O=await r.getDimensions(i.floating);return g!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function gn(e){const t=xe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=pe(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=tt(n)!==i||tt(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function Lt(e){return U(e)?e:e.contextElement}function Te(e){const t=Lt(e);if(!pe(t))return me(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=gn(t);let s=(i?tt(n.width):n.width)/o,c=(i?tt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const go=me(0);function hn(e){const t=se(e);return!rn()||!t.visualViewport?go:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ho(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===se(e)}function Oe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Lt(e);let s=me(1);t&&(o?U(o)&&(s=Te(o)):s=Te(e));const c=ho(i,n,o)?hn(i):me(0);let l=(r.left+c.x)/s.x,a=(r.top+c.y)/s.y,u=r.width/s.x,f=r.height/s.y;if(i&&o){const g=se(i),m=U(o)?se(o):o;let d=g,p=_t(d);for(;p&&m!==d;){const h=Te(p),x=p.getBoundingClientRect(),y=xe(p),E=x.left+(p.clientLeft+parseFloat(y.paddingLeft))*h.x,R=x.top+(p.clientTop+parseFloat(y.paddingTop))*h.y;l*=h.x,a*=h.y,u*=h.x,f*=h.y,l+=E,a+=R,d=se(p),p=_t(d)}}return ot({width:u,height:f,x:l,y:a})}function lt(e,t){const n=it(e).scrollLeft;return t?t.left+n:Oe(we(e)).left+n}function pn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-lt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function po(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=we(o),c=t?Et(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=me(1);const u=me(0),f=pe(o);if((f||!i)&&((St(o)!=="body"||on(s))&&(l=it(o)),f)){const m=Oe(o);a=Te(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}const g=s&&!f&&!i?pn(s,l):me(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+u.x+g.x,y:n.y*a.y-l.scrollTop*a.y+u.y+g.y}}function xo(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function yo(e){const t=it(e),n=e.ownerDocument.body,o=de(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=de(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+lt(e);const s=-t.scrollTop;return xe(n).direction==="rtl"&&(i+=de(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}const wo=25;function Ro(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=se(e),i=we(e),s=r.visualViewport;let c=i.clientWidth,l=i.clientHeight,a=0,u=0;if(s){const g=!rn()||t==="fixed";o?g||(a=-s.offsetLeft,u=-s.offsetTop):(c=s.width,l=s.height,g&&(a=s.offsetLeft,u=s.offsetTop))}if(lt(i)<=0){const g=i.ownerDocument,m=g.body,d=getComputedStyle(m),p=g.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(i.clientWidth-m.clientWidth-p),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?h/2:h;x<=wo&&(c-=x)}return{width:c,height:l,x:a,y:u}}function bo(e,t){const n=Oe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Te(e),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,a=o*i.y;return{width:s,height:c,x:l,y:a}}function Xt(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Ro(e,n,t);else if(t==="document")o=yo(we(e));else if(U(t))o=bo(t,n);else{const r=hn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ot(o)}function vo(e,t){const n=t.get(e);if(n)return n;let o=vt(e,[],!1).filter(c=>U(c)&&St(c)!=="body"),r=null;const i=xe(e).position==="fixed";let s=i?Ze(e):e;for(;U(s)&&!bt(s);){const c=xe(s),l=nn(s),a=r?r.position:i?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(f=>f!==s):r=c,s=Ze(s)}return t.set(e,o),o}function Oo(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Et(t)?[]:vo(t,this._c):[].concat(n),o],c=Xt(t,s[0],r);let l=c.top,a=c.right,u=c.bottom,f=c.left;for(let g=1;g<s.length;g++){const m=Xt(t,s[g],r);l=de(m.top,l),a=Le(m.right,a),u=Le(m.bottom,u),f=de(m.left,f)}return{width:a-f,height:u-l,x:f,y:l}}function Ao(e){const{width:t,height:n}=gn(e);return{width:t,height:n}}function Eo(e,t,n){const o=pe(t),r=we(t),i=n==="fixed",s=Oe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=me(0);if((o||!i)&&((St(t)!=="body"||on(r))&&(c=it(t)),o)){const g=Oe(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}!o&&r&&(l.x=lt(r));const a=r&&!o&&!i?pn(r,c):me(0),u=s.left+c.scrollLeft-l.x-a.x,f=s.top+c.scrollTop-l.y-a.y;return{x:u,y:f,width:s.width,height:s.height}}function yt(e){return xe(e).position==="static"}function jt(e,t){if(!pe(e)||xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function xn(e,t){const n=se(e);if(Et(e))return n;if(!pe(e)){let r=Ze(e);for(;r&&!bt(r);){if(U(r)&&!yt(r))return r;r=Ze(r)}return n}let o=jt(e,t);for(;o&&Cn(o)&&yt(o);)o=jt(o,t);return o&&bt(o)&&yt(o)&&!nn(o)?n:o||Pn(e)||n}const So=async function(e){const t=this.getOffsetParent||xn,n=this.getDimensions,o=await n(e.floating);return{reference:Eo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Co(e){return xe(e).direction==="rtl"}const Po={convertOffsetParentRelativeRectToViewportRelativeRect:po,getDocumentElement:we,getClippingRect:Oo,getOffsetParent:xn,getElementRects:So,getClientRects:xo,getDimensions:Ao,getScale:Te,isElement:U,isRTL:Co};function yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mo(e,t,n){let o=null,r;const i=we(e);function s(){var u;clearTimeout(r),(u=o)==null||u.disconnect(),o=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();const g=e.getBoundingClientRect(),{left:m,top:d,width:p,height:h}=g;if(u||t(),!p||!h)return;const x=qe(d),y=qe(i.clientWidth-(m+p)),E=qe(i.clientHeight-(d+h)),R=qe(m),S={rootMargin:-x+"px "+-y+"px "+-E+"px "+-R+"px",threshold:de(0,Le(1,f))||1};let P=!0;function O(D){const L=D[0].intersectionRatio;if(!yn(g,e.getBoundingClientRect()))return c();if(L!==f){if(!P)return c();L?c(!1,L):r=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(O,{...S,root:i.ownerDocument})}catch{o=new IntersectionObserver(O,S)}o.observe(e)}const l=se(e),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),s()}}function qt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=Lt(e),u=r||i?[...a?vt(a):[],...t?vt(t):[]]:[];u.forEach(x=>{r&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const f=a&&c?Mo(a,n,i):null;let g=-1,m=null;s&&(m=new ResizeObserver(x=>{let[y]=x;y&&y.target===a&&m&&t&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),n()}),a&&!l&&m.observe(a),t&&m.observe(t));let d,p=l?Oe(e):null;l&&h();function h(){const x=Oe(e);p&&!yn(p,x)&&n(),p=x,d=requestAnimationFrame(h)}return n(),()=>{var x;u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const To=ao,Lo=fo,Do=co,ko=mo,Io=uo,Fo=(e,t,n)=>{const o=new Map,r=n??{},i={...Po,...r.platform,_c:o};return so(e,t,{...r,platform:i})};var Wo=typeof document<"u",Vo=function(){},Qe=Wo?w.useLayoutEffect:Vo;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!rt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!rt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function wn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ut(e,t){const n=wn(e);return Math.round(t*n)/n}function wt(e){const t=w.useRef(e);return Qe(()=>{t.current=e}),t}function $o(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[u,f]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,m]=w.useState(o);rt(g,o)||m(o);const[d,p]=w.useState(null),[h,x]=w.useState(null),y=w.useCallback(b=>{b!==S.current&&(S.current=b,p(b))},[]),E=w.useCallback(b=>{b!==P.current&&(P.current=b,x(b))},[]),R=i||d,v=s||h,S=w.useRef(null),P=w.useRef(null),O=w.useRef(u),D=l!=null,L=wt(l),k=wt(r),K=wt(a),z=w.useCallback(()=>{if(!S.current||!P.current)return;const b={placement:t,strategy:n,middleware:g};k.current&&(b.platform=k.current),Fo(S.current,P.current,b).then(_=>{const B={..._,isPositioned:K.current!==!1};T.current&&!rt(O.current,B)&&(O.current=B,Mn.flushSync(()=>{f(B)}))})},[g,t,n,k,K]);Qe(()=>{a===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(b=>({...b,isPositioned:!1})))},[a]);const T=w.useRef(!1);Qe(()=>(T.current=!0,()=>{T.current=!1}),[]),Qe(()=>{if(R&&(S.current=R),v&&(P.current=v),R&&v){if(L.current)return L.current(R,v,z);z()}},[R,v,z,L,D]);const $=w.useMemo(()=>({reference:S,floating:P,setReference:y,setFloating:E}),[y,E]),F=w.useMemo(()=>({reference:R,floating:v}),[R,v]),W=w.useMemo(()=>{const b={position:n,left:0,top:0};if(!F.floating)return b;const _=Ut(F.floating,u.x),B=Ut(F.floating,u.y);return c?{...b,transform:"translate("+_+"px, "+B+"px)",...wn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:B}},[n,c,F.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:z,refs:$,elements:F,floatingStyles:W}),[u,z,$,F,W])}const _o=(e,t)=>{const n=To(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bo=(e,t)=>{const n=Lo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ho=(e,t)=>({fn:Io(e).fn,options:[e,t]}),zo=(e,t)=>{const n=Do(e);return{name:n.name,fn:n.fn,options:[e,t]}},No=(e,t)=>{const n=ko(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Ko(e){return Yo(e,e.rootContext)}function Yo(e,t){const{nodeId:n,externalTree:o}=e,r=t.useState("referenceElement"),i=t.useState("floatingElement"),s=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[a,u]=w.useState(null),[f,g]=w.useState(void 0),[m,d]=w.useState(void 0),p=w.useRef(null),h=ln(o),x=w.useMemo(()=>({reference:r,floating:i,domReference:s}),[r,i,s]),y=$o({...e,elements:{...x,...a&&{reference:a}}}),E=U(f)?f:null,R=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?s:E),t.useSyncedValue("floatingElement",R);const v=w.useCallback(k=>{const K=U(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),getClientRects:()=>k.getClientRects(),contextElement:k}:k;u(K),y.refs.setReference(K)},[y.refs]),S=w.useCallback(k=>{(U(k)||k===null)&&(p.current=k,g(k)),(U(y.refs.reference.current)||y.refs.reference.current===null||k!==null&&!U(k))&&y.refs.setReference(k)},[y.refs,g]),P=w.useCallback(k=>{d(k),y.refs.setFloating(k)},[y.refs]),O=w.useMemo(()=>({...y.refs,setReference:S,setFloating:P,setPositionReference:v,domReference:p}),[y.refs,S,P,v]),D=w.useMemo(()=>({...y.elements,domReference:s}),[y.elements,s]),L=w.useMemo(()=>({...y,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:O,elements:D,nodeId:n,rootStore:t}),[y,O,D,n,t,c,l]);return q(()=>{s&&(p.current=s)},[s]),q(()=>{t.context.dataRef.current.floatingContext=L;const k=h?.nodesRef.current.find(K=>K.id===n);k&&(k.context=L)}),w.useMemo(()=>({...y,context:L,refs:O,elements:D,rootStore:t}),[y,O,D,L,t])}const Xo="Escape";function Gt(e){return _n&&e.movementX===0&&e.movementY===0}function at(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ue(e,t){return at(t,e===an||e===Ct,e===st||e===ct)}function Rt(e,t,n){return at(t,e===Ct,n?e===st:e===ct)||e==="Enter"||e===" "||e===""}function jo(e,t,n){return at(t,n?e===st:e===ct,e===Ct)}function qo(e,t,n,o){const r=n?e===ct:e===st,i=e===an;return t==="both"||t==="horizontal"&&o?e===Xo:at(t,r,i)}function mr(e,t){const{listRef:n,activeIndex:o,onNavigate:r=()=>{},enabled:i=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:a=!1,rtl:u=!1,virtual:f=!1,focusItemOnOpen:g="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:d=!0,disabledIndices:p=void 0,orientation:h="vertical",parentOrientation:x,id:y,resetOnPointerLeave:E=!0,externalTree:R,grid:v}=t,S=v!=null,P="rootStore"in e?e.rootStore:e,O=P.useState("open"),D=P.useState("floatingElement"),L=P.useState("domReferenceElement"),k=P.context.dataRef,K=Fn(D),z=Wn(L),T=ue(K),$=Vn(),F=ln(R),W=w.useRef(g),b=w.useRef(s??-1),_=w.useRef(null),B=w.useRef(!0),N=ie(A=>{r(b.current===-1?null:b.current,A)}),be=w.useRef(!!D),H=w.useRef(O),X=w.useRef(!1),Ae=w.useRef(!1),De=w.useRef(null),ft=ue(p),Ee=ue(O),ee=ue(s),ce=ue(E),ke=Ot(),Se=Ot(),Ie=ie(()=>{function A(V){f?F?.events.emit("virtualfocus",V):De.current=$n(V,{sync:X.current,preventScroll:!0})}const C=n.current[b.current],Y=Ae.current;C&&A(C),(X.current?V=>V():V=>ke.request(V))(()=>{const V=n.current[b.current]||C;if(!V)return;C||A(V),Ce&&(Y||!B.current)&&V.scrollIntoView?.({block:"nearest",inline:"nearest"})})});q(()=>{k.current.orientation=h},[k,h]),q(()=>{i&&(O&&D?(b.current=s??-1,W.current&&s!=null&&(Ae.current=!0,N())):be.current&&(b.current=-1,N()))},[i,O,D,s,N]),q(()=>{if(i){if(!O){X.current=!1;return}if(D)if(o==null){if(X.current=!1,ee.current!=null)return;if(be.current&&(b.current=-1,Ie()),(!H.current||!be.current)&&W.current&&(_.current!=null||W.current===!0&&_.current==null)){let A=0;const C=()=>{n.current[0]==null?(A<2&&(A?M=>Se.request(M):queueMicrotask)(C),A+=1):(b.current=_.current==null||Rt(_.current,h,u)||a?ht(n):Ht(n),_.current=null,N())};C()}}else Bt(n.current,o)||(b.current=o,Ie(),Ae.current=!1)}},[i,O,D,o,ee,a,n,h,u,N,Ie,Se]),q(()=>{if(!i||D||!F||f||!be.current)return;const A=F.nodesRef.current,C=A.find(V=>V.id===$)?.context?.elements.floating,Y=xt(et(L??C??null)),M=A.some(V=>V.context&&He(V.context.elements.floating,Y));C&&!M&&B.current&&C.focus({preventScroll:!0})},[i,D,L,F,$,f]),q(()=>{H.current=O,be.current=!!D}),q(()=>{O||(_.current=null,W.current=g)},[O,g]);const ze=o!=null,te=ie(A=>{if(!Ee.current)return;const C=n.current.indexOf(A.currentTarget);C!==-1&&(b.current!==C||o!==C)&&(b.current=C,N(A))}),ve=ie(()=>x??F?.nodesRef.current.find(A=>A.id===$)?.context?.dataRef?.current.orientation),Fe=ie(()=>ht(n,ft.current)),ge=ie(A=>{if(B.current=!1,X.current=!0,A.which===229||!Ee.current&&A.currentTarget===T.current)return;if(a&&qo(A.key,h,u,S)){Ue(A.key,ve())||fe(A),P.setOpen(!1,Je(zt,A.nativeEvent)),pe(L)&&(f?F?.events.emit("virtualfocus",L):L.focus());return}const C=b.current,Y=ht(n,p),M=Ht(n,p);if(z||(A.key==="Home"&&(fe(A),b.current=Y,N(A)),A.key==="End"&&(fe(A),b.current=M,N(A))),v!=null){const V=v(A,b.current,n,h,l,u,p,Y,M);if(V!=null&&(b.current=V,N(A)),h==="both")return}if(Ue(A.key,h)){if(fe(A),O&&!f&&xt(A.currentTarget.ownerDocument)===A.currentTarget){b.current=Rt(A.key,h,u)?Y:M,N(A);return}Rt(A.key,h,u)?l?C>=M?c&&C!==n.current.length?b.current=-1:(X.current=!1,b.current=Y):b.current=je(n.current,{startingIndex:C,disabledIndices:p}):b.current=Math.min(M,je(n.current,{startingIndex:C,disabledIndices:p})):l?C<=Y?c&&C!==-1?b.current=n.current.length:(X.current=!1,b.current=M):b.current=je(n.current,{startingIndex:C,decrement:!0,disabledIndices:p}):b.current=Math.max(Y,je(n.current,{startingIndex:C,decrement:!0,disabledIndices:p})),Bt(n.current,b.current)&&(b.current=-1),N(A)}}),Ce=w.useMemo(()=>({onFocus(C){X.current=!0,te(C)},onClick:({currentTarget:C})=>C.focus({preventScroll:!0}),onMouseMove(C){Gt(C)||(X.current=!0,Ae.current=!1,m&&te(C))},onPointerLeave(C){if(!Ee.current||!B.current||C.pointerType==="touch")return;X.current=!0;const Y=C.relatedTarget;if(!(!m||n.current.includes(Y))&&ce.current&&(De.current?.(),De.current=null,b.current=-1,N(C),!f)){const M=T.current,V=xt(et(M));M&&He(M,V)&&M.focus({preventScroll:!0})}}}),[te,Ee,T,m,n,N,ce,f]),he=w.useMemo(()=>f&&O&&ze&&{"aria-activedescendant":`${y}-${o}`},[f,O,ze,y,o]),le=w.useMemo(()=>({"aria-orientation":h==="both"?void 0:h,...z?{}:he,onKeyDown(A){if(A.key==="Tab"&&A.shiftKey&&O&&!f){const C=fn(A.nativeEvent);if(C&&!He(T.current,C))return;fe(A),P.setOpen(!1,Je(jn,A.nativeEvent)),pe(L)&&L.focus();return}ge(A)},onPointerMove(A){Gt(A)||(B.current=!0)}}),[he,ge,T,h,z,P,O,f,L]),ne=w.useMemo(()=>{function A(M){P.setOpen(!0,Je(zt,M.nativeEvent,M.currentTarget))}function C(M){g==="auto"&&Bn(M.nativeEvent)&&(W.current=!f)}function Y(M){W.current=g,g==="auto"&&cn(M.nativeEvent)&&(W.current=!0)}return{onKeyDown(M){const V=P.select("open");B.current=!1;const Z=M.key.startsWith("Arrow"),Ve=jo(M.key,ve(),u),$e=Ue(M.key,h),Ne=(a?Ve:$e)||M.key==="Enter"||M.key.trim()==="";if(f&&V)return ge(M);if(!(!V&&!d&&Z)){if(Ne){const Pe=Ue(M.key,ve());_.current=a&&Pe?null:M.key}if(a){Ve&&(fe(M),V?(b.current=Fe(),N(M)):A(M));return}$e&&(ee.current!=null&&(b.current=ee.current),fe(M),!V&&d?A(M):ge(M),V&&N(M))}},onFocus(M){P.select("open")&&!f&&(b.current=-1,N(M))},onPointerDown:Y,onPointerEnter:Y,onMouseDown:C,onClick:C}},[ge,g,Fe,a,N,P,d,h,ve,u,ee,f]),We=w.useMemo(()=>({...he,...ne}),[he,ne]);return w.useMemo(()=>i?{reference:We,floating:le,item:Ce,trigger:ne}:{},[i,We,le,ne,Ce])}function gr(e,t){const{listRef:n,elementsRef:o,activeIndex:r,onMatch:i,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:a=750,selectedIndex:u=null}=t,f="rootStore"in e?e.rootStore:e,g=f.useState("open"),m=sn(),d=w.useRef(""),p=w.useRef(u??r??-1),h=w.useRef(null),x=ie(R=>{function v(T){return o?.current[T]}function S(T){const $=v(T);return $&&!Dn($)||$?.matches(":disabled")?!1:s==null||!kn(Tn,T,s)}function P(T,$,F=0){if(T.length===0)return-1;const W=(F%T.length+T.length)%T.length,b=$.toLowerCase();for(let _=0;_<T.length;_+=1){const B=(W+_)%T.length;if(!(!T[B]?.toLowerCase().startsWith(b)||!S(B)))return B}return-1}const O=n.current;if(d.current.length>0&&R.key===" "&&(fe(R),c?.(!0)),d.current.length>0&&d.current[0]!==" "&&P(O,d.current)===-1&&R.key!==" "&&c?.(!1),O==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(fe(R),c?.(!0));const D=d.current==="";D&&(p.current=u??r??-1),O.every((T,$)=>T&&S($)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&d.current===R.key&&(d.current="",p.current=h.current),d.current+=R.key,m.start(a,()=>{d.current="",p.current=h.current,c?.(!1)});const K=((D?u??r??-1:p.current)??0)+1,z=P(O,d.current,K);z!==-1?(i?.(z),h.current=z):R.key!==" "&&(d.current="",c?.(!1))}),y=ie(R=>{const v=R.relatedTarget,S=f.select("domReferenceElement"),P=f.select("floatingElement");He(S,v)||He(P,v)||(m.clear(),d.current="",p.current=h.current,c?.(!1))});q(()=>{!g&&u!==null||(m.clear(),h.current=null,d.current!==""&&(d.current=""))},[g,u,m]);const E=w.useMemo(()=>({onKeyDown:x,onBlur:y}),[x,y]);return w.useMemo(()=>l?{reference:E,floating:E}:{},[l,E])}function Uo(e){const t=w.useRef(""),n=w.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:w.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 Go(e,t){const n=ie((i,s)=>{(typeof e=="function"?e():e)||t(s||(Hn?"touch":""))}),{onClick:o,onPointerDown:r}=Uo(n);return w.useMemo(()=>({onClick:o,onPointerDown:r}),[o,r])}function hr(e){const[t,n]=w.useState(null),o=Go(e,n);return qn(e,r=>{r&&!e&&n(null)}),w.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const Jo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:a,padding:u=0,offsetParent:f="real"}=ye(e,t)||{};if(a==null)return{};const g=dn(u),m={x:n,y:o},d=Tt(r),p=Mt(d),h=await s.getDimensions(a),x=d==="y",y=x?"top":"left",E=x?"bottom":"right",R=x?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[d]-m[d]-i.floating[p],S=m[d]-i.reference[d],P=f==="real"?await s.getOffsetParent?.(a):c.floating;let O=c.floating[R]||i.floating[p];(!O||!await s.isElement?.(P))&&(O=c.floating[R]||i.floating[p]);const D=v/2-S/2,L=O/2-h[p]/2-1,k=Math.min(g[y],L),K=Math.min(g[E],L),z=k,T=O-h[p]-K,$=O/2-h[p]/2+D,F=un(z,$,T),W=!l.arrow&&Re(r)!=null&&$!==F&&i.reference[p]/2-($<z?k:K)-h[p]/2<0,b=W?$<z?$-z:$-T:0;return{[d]:m[d]+b,data:{[d]:F,centerOffset:$-F-b,...W&&{alignmentOffset:b}},reset:W}}}),Qo=(e,t)=>({...Jo(e),options:[e,t]}),Zo={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,i=t===0&&n===0&&o===0&&r===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-n>=0||s.right-t>=0||s.bottom-n>=0||s.left-t>=0||i}}}},er={sideX:"left",sideY:"top"},Jt="--available-width",Qt="--available-height";function Rn(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 Zt(e,t,n){const{rects:o,placement:r}=e;return{side:Rn(t,Q(r),n),align:Re(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function pr(e){return tr(e,Ko)}function tr(e,t){const{anchor:n,positionMethod:o="absolute",side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:a=5,sticky:u=!1,arrowPadding:f=5,disableAnchorTracking:g=!1,inline:m,keepMounted:d=!1,floatingRootContext:p,mounted:h,collisionAvoidance:x,shift:y,nodeId:E,adaptiveOrigin:R,lazyFlip:v=!1,externalTree:S}=e,[P,O]=w.useState(null);!h&&P!==null&&O(null);const D=x.side||"flip",L=x.align||"flip",k=x.fallbackAxisSide||"end",K=y?.crossAxis??!1,z=y?.rootBoundary,T=typeof n=="function"?n:void 0,$=ie(T),F=T?$:n,W=ue(n),b=ue(h),B=Un()==="rtl",N=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],be=s==="center"?N:`${N}-${s}`;let H=a;typeof H=="number"?H={top:H,right:H,bottom:H,left:H}:H&&(H={top:H.top||0,right:H.right||0,bottom:H.bottom||0,left:H.left||0});const X=1,Ae=r==="bottom"?X:0,De=r==="top"?X:0,ft=r==="right"?X:0,Ee=r==="left"?X:0,ee={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:H},ce=w.useRef(null),ke=ue(i),Se=ue(c),Ie=typeof i!="function"?i:0,ze=typeof c!="function"?c:0,te=[];m&&te.push(m),te.push(_o(I=>{const G=Zt(I,r,B),oe=typeof ke.current=="function"?ke.current(G):ke.current,j=typeof Se.current=="function"?Se.current(G):Se.current;return{mainAxis:oe,crossAxis:j,alignmentAxis:j}},[Ie,ze,B,r]));const ve=L==="none"&&D!=="shift",Fe=!ve&&(u||K||D==="shift"),ge=D==="none"?null:zo({...ee,padding:{top:H.top+X+Ae,right:H.right+X+Ee,bottom:H.bottom+X+De,left:H.left+X+ft},mainAxis:!K&&D==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:k}),Ce=ve?null:Bo({...ee,rootBoundary:z,mainAxis:L!=="none",crossAxis:Fe,limiter:u||K?void 0:Ho(I=>{if(!ce.current)return{};const{width:G,height:oe}=ce.current.getBoundingClientRect(),j=J(Q(I.placement)),ae=j==="y"?G:oe,re=j==="y"?H.left+H.right:H.top+H.bottom;return{offset:ae/2+re/2}})},[ee,u,K,z,H,L]);D==="shift"||L==="shift"||s==="center"?te.push(Ce,ge):te.push(ge,Ce),te.push(No({...ee,apply({elements:{floating:I},availableWidth:G,availableHeight:oe,rects:j}){if(!b.current)return;const ae=I.style;ae.setProperty(Jt,`${G}px`),ae.setProperty(Qt,`${oe}px`);const re=se(I).devicePixelRatio||1,{x:_e,y:Ye,width:Xe,height:ut}=j.reference,dt=(Math.round((_e+Xe)*re)-Math.round(_e*re))/re,mt=(Math.round((Ye+ut)*re)-Math.round(Ye*re))/re;ae.setProperty("--anchor-width",`${dt}px`),ae.setProperty("--anchor-height",`${mt}px`)}}),Qo(I=>({element:ce.current||et(I.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(I){const{elements:G,middlewareData:oe,placement:j,rects:ae,y:re}=I,_e=Q(j),Ye=J(_e),Xe=ce.current,ut=oe.arrow?.x||0,dt=oe.arrow?.y||0,mt=Xe?.clientWidth||0,bn=Xe?.clientHeight||0,gt=ut+mt/2,$t=dt+bn/2,vn=Math.abs(oe.shift?.y||0),On=ae.reference.height/2,Be=typeof i=="function"?i(Zt(I,r,B)):i,An=vn>Be,En={top:`${gt}px calc(100% + ${Be}px)`,bottom:`${gt}px ${-Be}px`,left:`calc(100% + ${Be}px) ${$t}px`,right:`${-Be}px ${$t}px`}[_e],Sn=`${gt}px ${ae.reference.y+On-re}px`;return G.floating.style.setProperty("--transform-origin",Fe&&Ye==="y"&&An?Sn:En),{}}},Zo,R),q(()=>{!h&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,p]);const he=w.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:le,elements:ne,x:We,y:A,middlewareData:C,update:Y,placement:M,context:V,isPositioned:Z,floatingStyles:Ve}=t({rootContext:p,open:d?h:void 0,placement:be,middleware:te,strategy:o,whileElementsMounted:d?void 0:(...I)=>qt(...I,he),nodeId:E,externalTree:S}),{sideX:$e,sideY:Ne}=C.adaptiveOrigin||er,Pe=Z?o:"fixed",Dt=w.useMemo(()=>{let I;return Z?R?I={position:Pe,[$e]:We,[Ne]:A}:I={...Ve,position:Pe}:I={position:Pe,top:0,left:0},I[Jt]="100vw",I[Qt]="100vh",Z||(I.opacity=0),I},[R,Pe,$e,We,Ne,A,Ve,Z]),Ke=w.useRef(null);q(()=>{if(!h)return;const I=W.current,G=typeof I=="function"?I():I,j=(en(G)?G.current:G)||null||null;j!==Ke.current&&(le.setPositionReference(j),Ke.current=j)},[h,le,F,W]),w.useEffect(()=>{if(!h)return;const I=W.current;typeof I!="function"&&en(I)&&I.current!==Ke.current&&(le.setPositionReference(I.current),Ke.current=I.current)},[h,le,F,W]),w.useEffect(()=>{if(d&&h&&ne.reference&&ne.floating)return qt(ne.reference,ne.floating,Y,he)},[d,h,ne,Y,he]);const Me=Q(M),kt=Rn(r,Me,B),It=Re(M)||"center",Ft=!!C.hide?.referenceHidden;q(()=>{v&&h&&Z&&Me!==N&&O(Me)},[v,h,Z,Me,N]);const Wt=w.useMemo(()=>({position:"absolute",top:C.arrow?.y,left:C.arrow?.x}),[C.arrow]),Vt=C.arrow?.centerOffset!==0;return w.useMemo(()=>({positionerStyles:Dt,arrowStyles:Wt,arrowRef:ce,arrowUncentered:Vt,side:kt,align:It,physicalSide:Me,anchorHidden:Ft,refs:le,context:V,isPositioned:Z,update:Y}),[Dt,Wt,ce,Vt,kt,It,Me,Ft,le,V,Z,Y])}function en(e){return e!=null&&"current"in e}function nr(e){return e==="starting"?zn:tn}function xr(e,t,{styles:n,transitionStatus:o,props:r,refs:i,hidden:s,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),Ln("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:s,style:l},nr(o),r],stateAttributesMapping:Nn})}const or=w.createContext(void 0);function yr(e){return w.useContext(or)}const rr=20;function wr(e,t,n,o){const[r,i]=w.useState(!1);q(()=>{if(!e||!t||n==null){i(!1);return}const s=et(n).documentElement.clientWidth,c=n.offsetWidth;i(s>0&&c>0&&c>=s-rr)},[e,t,n]),Kn(e&&(!t||r),o)}const Ge=5;function Rr(e,t){const n=ir(t);return e.clientX>=n.left-Ge&&e.clientX<=n.right+Ge&&e.clientY>=n.top-Ge&&e.clientY<=n.bottom+Ge}function ir(e){const t=e.getBoundingClientRect(),n=se(e);if(Yn)return t;const o=n.getComputedStyle(e,"::before"),r=n.getComputedStyle(e,"::after");if(!(o.content!=="none"||r.content!=="none"))return t;const s=parseFloat(o.width)||0,c=parseFloat(o.height)||0,l=parseFloat(r.width)||0,a=parseFloat(r.height)||0,u=Math.max(t.width,s,l),f=Math.max(t.height,c,a),g=u-t.width,m=f-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-m/2,bottom:t.bottom+m/2}}export{xr as a,yr as b,wr as c,hr as d,mr as e,gr as f,nr as g,dr as h,Rr as i,Po as p,ot as r,pr as u};
|