@chenpu17/cc-gw 0.17.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/package.json +5 -5
  2. package/src/web/dist/assets/{About-D2m94wu2.js → About-DmIV-sHO.js} +1 -1
  3. package/src/web/dist/assets/{ApiKeys-Bt-otGF_.js → ApiKeys-BNr4zbD6.js} +1 -1
  4. package/src/web/dist/assets/{ConfirmDialog-CRSbmgE7.js → ConfirmDialog-_CIYYtzo.js} +1 -1
  5. package/src/web/dist/assets/{Dashboard-81qp43jm.js → Dashboard-Hg4OZNAc.js} +1 -1
  6. package/src/web/dist/assets/{DialogShell-DxWKa5oR.js → DialogShell-D1T4HXtd.js} +1 -1
  7. package/src/web/dist/assets/Events-CO2wWiEK.js +1 -0
  8. package/src/web/dist/assets/{Help-XaAZ__Kz.js → Help-CafNfXfx.js} +1 -1
  9. package/src/web/dist/assets/{Login-atwWPGzz.js → Login-C04-poiG.js} +1 -1
  10. package/src/web/dist/assets/Logs-CqaIXvR0.js +1 -0
  11. package/src/web/dist/assets/{PageSection-CC5EhfMe.js → PageSection-Dd2-9G6C.js} +1 -1
  12. package/src/web/dist/assets/{PageState-XybOeENt.js → PageState-Bbhr4fy6.js} +1 -1
  13. package/src/web/dist/assets/{PageToolbar-CnLp4aWt.js → PageToolbar-GyUQBhmq.js} +1 -1
  14. package/src/web/dist/assets/{ProvidersPage-CFCY2xSG.js → ProvidersPage-CHvyCANH.js} +1 -1
  15. package/src/web/dist/assets/{RoutingPage-35o5ZSMg.js → RoutingPage-fVr25VKF.js} +1 -1
  16. package/src/web/dist/assets/{Settings-DC1TPeS9.js → Settings-DfaIYHsa.js} +1 -1
  17. package/src/web/dist/assets/{Setup-CnQPVK9X.js → Setup-DUEpie5k.js} +1 -1
  18. package/src/web/dist/assets/{TargetCombobox-DkVdA04_.js → TargetCombobox-CSnHZqDY.js} +1 -1
  19. package/src/web/dist/assets/{apiKeys-CMk2nxB_.js → apiKeys-B5Os17Qm.js} +1 -1
  20. package/src/web/dist/assets/app-DZpd2fu9.js +61 -0
  21. package/src/web/dist/assets/{badge-eRkhnmCs.js → badge-CWbm9P64.js} +1 -1
  22. package/src/web/dist/assets/{chartTheme-Cx-0Jiew.js → chartTheme-ChTod603.js} +1 -1
  23. package/src/web/dist/assets/{charts-core-BOHudNiN.js → charts-core-BuoE1ECx.js} +1 -1
  24. package/src/web/dist/assets/{charts-engine-BhFpDbO0.js → charts-engine-DHIzBJl6.js} +1 -1
  25. package/src/web/dist/assets/{charts-react-CPWg-GRD.js → charts-react-BLOapElb.js} +1 -1
  26. package/src/web/dist/assets/{currency-Bx141-XL.js → currency-DffG4uWM.js} +2 -2
  27. package/src/web/dist/assets/{disclosure-CU-KJc8C.js → disclosure-W_XtxMJz.js} +1 -1
  28. package/src/web/dist/assets/{gateway-DyhqzHSh.js → gateway-DxaHzVOF.js} +1 -1
  29. package/src/web/dist/assets/{global-BLUcvOa8.js → global-BCYo_xAt.js} +1 -1
  30. package/src/web/dist/assets/global-CP6wBbWu.css +1 -0
  31. package/src/web/dist/assets/{i18n-v60Yn7Ls.js → i18n-ClvfZhYc.js} +1 -1
  32. package/src/web/dist/assets/{label-CdbE1ezd.js → label-09axTkPo.js} +1 -1
  33. package/src/web/dist/assets/{landing-BQdbaG8s.js → landing-BsX2AKvc.js} +3 -3
  34. package/src/web/dist/assets/{modelManagement-DwdbGu0o.js → modelManagement-Dc7L1tJw.js} +1 -1
  35. package/src/web/dist/assets/package-DgoCoO-z.js +1 -0
  36. package/src/web/dist/assets/{popover-CuM9b3U7.js → popover-CX5HRHKk.js} +1 -1
  37. package/src/web/dist/assets/{query-CvboQrUT.js → query-1Ng1fzmE.js} +1 -1
  38. package/src/web/dist/assets/{radix-d0BukFWM.js → radix-DONH6gHT.js} +1 -1
  39. package/src/web/dist/assets/{router-CqUBCAsx.js → router-Bkbjq53m.js} +1 -1
  40. package/src/web/dist/assets/{segmented-control-5mZhY1KZ.js → segmented-control-Cxe6ZLHe.js} +1 -1
  41. package/src/web/dist/assets/{shared-zfHsnBTk.js → shared-DG0AgdnU.js} +1 -1
  42. package/src/web/dist/assets/{switch-CZn1nypU.js → switch-C58zWdHT.js} +1 -1
  43. package/src/web/dist/assets/{tabs-CrNMQMmG.js → tabs-BIz291zK.js} +1 -1
  44. package/src/web/dist/assets/{useAppMutation-B29oVzxS.js → useAppMutation-CsoNTPQ7.js} +1 -1
  45. package/src/web/dist/assets/{useEventStream-DN2DYBVS.js → useEventStream-CvopQT4p.js} +1 -1
  46. package/src/web/dist/assets/{useProviderForm-DIuM3Z2u.js → useProviderForm-B_wmywxX.js} +1 -1
  47. package/src/web/dist/assets/{vendor-JUtelXU0.js → vendor-C-lQMZp3.js} +94 -84
  48. package/src/web/dist/index.html +14 -11
  49. package/src/web/dist/landing.html +5 -5
  50. package/src/web/dist/assets/Events-BQ4Dkqon.js +0 -1
  51. package/src/web/dist/assets/Logs-BYFIK_hM.js +0 -1
  52. package/src/web/dist/assets/app-CRxPj2SJ.js +0 -61
  53. package/src/web/dist/assets/global-BQq8O0Tv.css +0 -1
  54. package/src/web/dist/assets/package-Dmrvm3RO.js +0 -1
@@ -1,4 +1,4 @@
1
- import{B as v,c as g}from"./global-BLUcvOa8.js";import{r as u,j as e,ae as O,ak as L,al as N,am as p,an as b,ao as j,V as K,ap as T,aq as R,ar as P,as as E,at as D,au as q,av as k,aj as U,u as B}from"./vendor-JUtelXU0.js";import{c as A}from"./clipboard-DqvcglYs.js";import{p as G}from"./package-Dmrvm3RO.js";const S="/assets/live-dashboard-B7vLOY_S.png",_="/assets/live-logs-PRpgTV6S.png",F="/assets/live-model-management-xkBDeuLk.png",W="/assets/live-api-keys-CJUuaCev.png",C="/assets/live-en-dashboard-CJoX7IQT.png",Y="/assets/live-en-logs-BGGL53ab.png",H="/assets/live-en-model-management-BpjNblfR.png",$="/assets/live-en-api-keys-Bx8N-eoh.png",w=G.version,Q=(o,a)=>a[o],t={nav:{why:{zh:"现状",en:"The mess"},how:{zh:"怎么用",en:"How"},debug:{zh:"排查",en:"Debug"},local:{zh:"本地优先",en:"Local-first"},start:{zh:"开始",en:"Start"},faq:{zh:"FAQ",en:"FAQ"}},ctaConsole:{zh:"打开控制台",en:"Open console"},ctaInstall:{zh:"立即安装",en:"Install now"},ctaPreview:{zh:"看看控制台长什么样",en:"Preview the console"},hero:{badge:{zh:"v"+w+" · Rust 内核 · 完全开源",en:"v"+w+" · Rust core · Open source"},h1Top:{zh:"你的 API Key",en:"Your API key"},h1Bottom:{zh:"不该躺在 30 个 .env 里",en:"shouldn’t live in 30 .env files"},lead:{zh:"cc-gw 在你的机器上跑一个本地网关。Claude Code、OpenAI SDK、Anthropic SDK 全部指向同一个地址。换模型、换 provider、查日志,再也不用翻业务代码。",en:"cc-gw runs a small gateway right on your machine. Point Claude Code, the OpenAI SDK, and the Anthropic SDK at one address — then swap models, switch providers, and trace requests without touching your app code."},note:{zh:"不需要本机有 Rust 环境,npm 自动拉对应平台的预编译二进制。",en:"No Rust toolchain needed — npm pulls the right prebuilt binary for your platform."},proof:[{zh:"一条命令装好,本机就能跑",en:"One command to install, runs on your laptop"},{zh:"客户端只改 baseURL,不动业务逻辑",en:"Clients only change baseURL — your code stays put"},{zh:"所有数据都在 ~/.cc-gw 下,不走云",en:"Everything lives under ~/.cc-gw — nothing leaves your box"}],works:{zh:"已经在以下客户端里跑通",en:"Tested with"}},why:{eyebrow:{zh:"现状",en:"The mess"},title:{zh:"AI 接进来不难,难的是接进来之后",en:"Wiring up AI is easy. Living with it isn’t."},description:{zh:"你大概率已经踩过下面这三件事里的至少两件。这就是为什么有了 cc-gw。",en:"You’ve probably hit at least two of these. That’s why cc-gw exists."},cards:[{title:{zh:"Key 散在各个 .env 里",en:"Keys scattered across .env files"},body:{zh:"每个项目自己一份 baseURL、自己一份 key、自己一份模型名。时间一长,没人敢动,也没人记得清。",en:"Every project keeps its own baseURL, its own key, its own model name. Six months in, nobody dares touch it."},sample:`OPENAI_BASE_URL=https://...
1
+ import{B as v,c as g}from"./global-BCYo_xAt.js";import{r as u,j as e,ai as O,ao as L,ap as N,aq as p,ar as b,as as w,V as K,at as T,au as R,av as P,aw as E,ac as D,ax as q,ay as k,an as U,u as B}from"./vendor-C-lQMZp3.js";import{c as A}from"./clipboard-DqvcglYs.js";import{p as G}from"./package-DgoCoO-z.js";const S="/assets/live-dashboard-B7vLOY_S.png",_="/assets/live-logs-PRpgTV6S.png",F="/assets/live-model-management-xkBDeuLk.png",W="/assets/live-api-keys-CJUuaCev.png",C="/assets/live-en-dashboard-CJoX7IQT.png",Y="/assets/live-en-logs-BGGL53ab.png",H="/assets/live-en-model-management-BpjNblfR.png",$="/assets/live-en-api-keys-Bx8N-eoh.png",j=G.version,Q=(o,a)=>a[o],t={nav:{why:{zh:"现状",en:"The mess"},how:{zh:"怎么用",en:"How"},debug:{zh:"排查",en:"Debug"},local:{zh:"本地优先",en:"Local-first"},start:{zh:"开始",en:"Start"},faq:{zh:"FAQ",en:"FAQ"}},ctaConsole:{zh:"打开控制台",en:"Open console"},ctaInstall:{zh:"立即安装",en:"Install now"},ctaPreview:{zh:"看看控制台长什么样",en:"Preview the console"},hero:{badge:{zh:"v"+j+" · Rust 内核 · 完全开源",en:"v"+j+" · Rust core · Open source"},h1Top:{zh:"你的 API Key",en:"Your API key"},h1Bottom:{zh:"不该躺在 30 个 .env 里",en:"shouldn’t live in 30 .env files"},lead:{zh:"cc-gw 在你的机器上跑一个本地网关。Claude Code、OpenAI SDK、Anthropic SDK 全部指向同一个地址。换模型、换 provider、查日志,再也不用翻业务代码。",en:"cc-gw runs a small gateway right on your machine. Point Claude Code, the OpenAI SDK, and the Anthropic SDK at one address — then swap models, switch providers, and trace requests without touching your app code."},note:{zh:"不需要本机有 Rust 环境,npm 自动拉对应平台的预编译二进制。",en:"No Rust toolchain needed — npm pulls the right prebuilt binary for your platform."},proof:[{zh:"一条命令装好,本机就能跑",en:"One command to install, runs on your laptop"},{zh:"客户端只改 baseURL,不动业务逻辑",en:"Clients only change baseURL — your code stays put"},{zh:"所有数据都在 ~/.cc-gw 下,不走云",en:"Everything lives under ~/.cc-gw — nothing leaves your box"}],works:{zh:"已经在以下客户端里跑通",en:"Tested with"}},why:{eyebrow:{zh:"现状",en:"The mess"},title:{zh:"AI 接进来不难,难的是接进来之后",en:"Wiring up AI is easy. Living with it isn’t."},description:{zh:"你大概率已经踩过下面这三件事里的至少两件。这就是为什么有了 cc-gw。",en:"You’ve probably hit at least two of these. That’s why cc-gw exists."},cards:[{title:{zh:"Key 散在各个 .env 里",en:"Keys scattered across .env files"},body:{zh:"每个项目自己一份 baseURL、自己一份 key、自己一份模型名。时间一长,没人敢动,也没人记得清。",en:"Every project keeps its own baseURL, its own key, its own model name. Six months in, nobody dares touch it."},sample:`OPENAI_BASE_URL=https://...
2
2
  ANTHROPIC_API_KEY=sk-ant-...
3
3
  MODEL=gpt-4o-2024-08-06`},{title:{zh:"出错只能猜",en:"Debugging is just guessing"},body:{zh:"是 payload 错?协议不对?上游挂了?key 被收回了?没有统一日志,只能 curl 一遍试一遍。",en:"Bad payload? Wrong protocol? Upstream down? Key revoked? Without one log to look at, you curl your way through every theory."},sample:`$ curl ... 401
4
4
  # 是 key 过期?还是 endpoint 写错了?
@@ -13,5 +13,5 @@ OPENAI_BASE_URL='http://127.0.0.1:4100/openai/v1'`}]},console:{eyebrow:{zh:"控
13
13
  │ └── gateway.db # SQLite (WAL) — 直接 sqlite3 打开
14
14
  └── logs/
15
15
  └── cc-gw.log`,y=[{id:"dashboard",shot:{zh:S,en:C},label:{zh:"总览",en:"Dashboard"},blurb:{zh:"今天的请求量、延迟、健康状态,一屏看完。",en:"Today’s request volume, latency, and health — at a glance."}},{id:"logs",shot:{zh:_,en:Y},label:{zh:"请求日志",en:"Logs"},blurb:{zh:"按 endpoint / Key / 状态码筛,几秒定位。",en:"Filter by endpoint, key, or status. Find issues in seconds."}},{id:"routing",shot:{zh:F,en:H},label:{zh:"模型路由",en:"Routing"},blurb:{zh:"别名、通配匹配、fallback 链全在 UI 里维护。",en:"Aliases, wildcards, and fallback chains — all in the UI."}},{id:"keys",shot:{zh:W,en:$},label:{zh:"API Keys",en:"API Keys"},blurb:{zh:"按客户端发独立 Key,可设并发上限。",en:"Per-client keys with concurrency caps."}}];function X(o){if(o.trim().startsWith("#"))return e.jsx("span",{className:"text-muted-foreground",children:o});if(o.startsWith("$ "))return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"select-none text-primary",children:"$ "}),e.jsx("span",{className:"text-foreground",children:o.slice(2)})]});const a=o.match(/^(\s*)([A-Z_][\w]*)(\s*=\s*)(.+)$/);if(a){const[,l,x,h,i]=a,s=i.startsWith("'")||i.startsWith('"');return e.jsxs(e.Fragment,{children:[e.jsx("span",{children:l}),e.jsx("span",{className:"text-foreground",children:x}),e.jsx("span",{className:"text-muted-foreground",children:h}),e.jsx("span",{className:s?"text-primary":"text-foreground",children:i})]})}return e.jsx("span",{className:"text-foreground",children:o})}function ee({code:o,label:a,className:l,copyLabel:x,copiedLabel:h}){const[i,s]=u.useState(!1);async function c(){try{await A(o),s(!0),window.setTimeout(()=>s(!1),1800)}catch{}}return e.jsxs("div",{className:g("relative min-w-0",l),children:[e.jsxs("button",{type:"button","aria-label":`Copy ${a}`,onClick:c,className:"absolute right-3 top-3 z-10 inline-flex items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 py-1 text-[11px] font-medium text-foreground transition hover:bg-secondary",children:[i?e.jsx(b,{className:"h-3.5 w-3.5"}):e.jsx(k,{className:"h-3.5 w-3.5"}),i?h:x]}),e.jsx("pre",{className:"max-w-full overflow-x-auto rounded-2xl border border-border bg-secondary p-5 font-mono text-[13px] leading-7 text-foreground",children:e.jsx("code",{children:o.split(`
16
- `).map((f,r)=>e.jsx("span",{className:"block",children:X(f)??" "},r))})})]})}function se(){const[o,a]=u.useState(!1),l="npm install -g @chenpu17/cc-gw";async function x(){try{await A(l),a(!0),window.setTimeout(()=>a(!1),1800)}catch{}}return e.jsxs("div",{className:"inline-flex w-full max-w-md items-center gap-2 rounded-2xl border border-border bg-card py-2 pl-4 pr-2",children:[e.jsx("span",{className:"select-none font-mono text-primary",children:"$"}),e.jsx("span",{className:"select-all truncate font-mono text-sm text-foreground",children:l}),e.jsx("button",{type:"button","aria-label":"Copy install command",onClick:x,className:"ml-auto inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-secondary text-foreground transition hover:bg-muted",children:o?e.jsx(b,{className:"h-3.5 w-3.5 text-primary"}):e.jsx(k,{className:"h-3.5 w-3.5"})})]})}function m({eyebrow:o,title:a,description:l}){return e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("div",{className:"font-mono text-xs font-semibold uppercase tracking-[0.22em] text-primary",children:o}),e.jsx("h2",{className:"mt-4 text-3xl font-semibold tracking-[-0.02em] text-foreground sm:text-4xl",children:a}),e.jsx("p",{className:"mt-4 text-base leading-8 text-muted-foreground sm:text-lg",children:l})]})}function te(){const[o,a]=u.useState("zh"),[l,x]=u.useState(y[0].id),[h,i]=u.useState(0),s=r=>Q(o,r),c=y.find(r=>r.id===l)??y[0],f=[{href:"#why",label:s(t.nav.why)},{href:"#how",label:s(t.nav.how)},{href:"#debug",label:s(t.nav.debug)},{href:"#local",label:s(t.nav.local)},{href:"#start",label:s(t.nav.start)},{href:"#faq",label:s(t.nav.faq)}];return e.jsxs("div",{className:"min-h-screen bg-background text-foreground antialiased",children:[e.jsxs("header",{className:"sticky top-0 z-30 border-b border-border bg-card",children:[e.jsxs("div",{className:"mx-auto flex w-full max-w-6xl items-center justify-between gap-4 px-6 py-3.5 sm:px-8 lg:px-10",children:[e.jsxs("a",{href:"#top",className:"flex items-center gap-2.5",children:[e.jsx(v,{className:"h-9 w-9",title:"cc-gw"}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("div",{className:"text-[15px] font-semibold tracking-tight",children:"cc-gw"}),e.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"local-first ai gateway"})]})]}),e.jsx("nav",{className:"hidden items-center gap-1 lg:flex",children:f.map(r=>e.jsx("a",{href:r.href,className:"rounded-lg px-3 py-1.5 text-sm text-muted-foreground transition hover:bg-secondary hover:text-foreground",children:r.label},r.href))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>a(o==="zh"?"en":"zh"),"aria-label":"Toggle language",className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 py-1.5 text-xs font-semibold text-foreground transition hover:border-primary",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),o==="zh"?"EN":"中文"]}),e.jsx("a",{href:"/ui/",className:"hidden rounded-lg border border-border bg-card px-3.5 py-1.5 text-sm font-medium text-foreground transition hover:border-primary hover:text-foreground sm:inline-flex",children:s(t.ctaConsole)}),e.jsxs("a",{href:"https://github.com/chenpu17/cc-gw2",className:"inline-flex items-center gap-1.5 rounded-lg bg-foreground px-3.5 py-1.5 text-sm font-medium text-background transition hover:bg-muted",children:[e.jsx(L,{className:"h-4 w-4"}),"GitHub"]})]})]}),e.jsx("nav",{"aria-label":"Mobile section navigation",className:"flex gap-1.5 overflow-x-auto border-t border-border px-4 py-2 lg:hidden",children:[...f,{href:"/ui/",label:s(t.ctaConsole)}].map(r=>e.jsx("a",{href:r.href,className:"shrink-0 rounded-lg bg-secondary px-3 py-1 text-xs font-medium text-foreground",children:r.label},r.href))})]}),e.jsxs("main",{id:"top",children:[e.jsx("section",{className:"relative overflow-hidden bg-foreground text-background",children:e.jsxs("div",{className:"relative mx-auto w-full max-w-6xl px-6 pb-24 pt-20 sm:px-8 lg:px-10 lg:pt-28",children:[e.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3.5 py-1 text-xs font-medium text-foreground",children:[e.jsx("span",{"aria-hidden":"true",className:"inline-flex h-1.5 w-1.5 rounded-full bg-success"}),s(t.hero.badge)]}),e.jsxs("h1",{className:"mt-7 text-[2.4rem] font-bold leading-[1.05] tracking-[-0.035em] sm:text-6xl",children:[s(t.hero.h1Top),e.jsx("span",{className:"mt-2 block text-primary",children:s(t.hero.h1Bottom)})]}),e.jsx("p",{className:"mx-auto mt-6 max-w-2xl text-base leading-8 text-background/80 sm:text-lg",children:s(t.hero.lead)}),e.jsxs("div",{className:"mt-9 flex flex-col items-center justify-center gap-3 sm:flex-row",children:[e.jsxs("a",{href:"#start",className:"group inline-flex items-center justify-center gap-2 rounded-xl bg-background px-5 py-3 text-sm font-semibold text-foreground transition hover:bg-secondary",children:[e.jsx(N,{className:"h-4 w-4"}),s(t.ctaInstall),e.jsx(p,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5"})]}),e.jsx("a",{href:"#console",className:"inline-flex items-center justify-center gap-2 rounded-xl border border-border bg-transparent px-5 py-3 text-sm font-semibold text-background transition hover:bg-background hover:text-foreground",children:s(t.ctaPreview)})]}),e.jsxs("div",{className:"mt-7 flex flex-col items-center gap-2",children:[e.jsx(se,{}),e.jsx("p",{className:"font-mono text-[11px] text-background/60",children:s(t.hero.note)})]}),e.jsx("ul",{className:"mt-10 grid gap-3 text-left sm:grid-cols-3",children:t.hero.proof.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-2 rounded-xl border border-border bg-card px-4 py-3 text-[13px] leading-6 text-foreground",children:[e.jsx(b,{className:"mt-0.5 h-4 w-4 shrink-0 text-success"}),e.jsx("span",{children:s(r)})]},n))})]}),e.jsx("div",{className:"relative mx-auto mt-16 max-w-5xl",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border bg-secondary p-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border px-4 py-2.5",children:[e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("div",{className:"ml-3 flex-1 truncate rounded-md bg-card px-3 py-1 text-center font-mono text-[11px] text-muted-foreground",children:"127.0.0.1:4100/ui/"})]}),e.jsx("img",{src:o==="en"?C:S,alt:"cc-gw dashboard screenshot",className:"block w-full rounded-b-xl",loading:"eager"})]})}),e.jsxs("div",{className:"mt-16",children:[e.jsx("p",{className:"text-center font-mono text-[11px] uppercase tracking-[0.22em] text-background/60",children:s(t.hero.works)}),e.jsx("div",{className:"mt-5 flex flex-wrap items-center justify-center gap-2",children:M.map(r=>e.jsx("span",{className:"rounded-lg border border-border bg-card px-3.5 py-1.5 text-sm text-foreground",children:r},r))})]})]})}),e.jsxs("section",{id:"why",className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.why.eyebrow),title:s(t.why.title),description:s(t.why.description)}),e.jsx("div",{className:"mt-12 grid gap-5 md:grid-cols-3",children:t.why.cards.map(r=>e.jsxs("div",{className:"group relative overflow-hidden rounded-2xl border border-border bg-card p-6 transition hover:border-primary",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"h-4 w-4 text-error"}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:s(r.title)})]}),e.jsx("p",{className:"mt-3 text-sm leading-7 text-muted-foreground",children:s(r.body)}),e.jsx("pre",{className:"mt-5 overflow-hidden rounded-lg bg-secondary p-3 font-mono text-[11.5px] leading-6 text-muted-foreground ring-1 ring-border",children:r.sample})]},r.title.en))})]}),e.jsx("section",{id:"how",className:"border-y border-border bg-secondary",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.how.eyebrow),title:s(t.how.title),description:s(t.how.description)}),e.jsxs("div",{className:"mt-12 grid gap-6 lg:grid-cols-[1fr_auto_1fr_auto_1fr] lg:items-stretch",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:s(t.how.diagramLabels.clients)}),e.jsxs("ul",{className:"mt-3 space-y-2 text-sm text-foreground",children:[e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"Claude Code"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"OpenAI SDK"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"Anthropic SDK"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2 text-muted-foreground",children:"cURL · LangChain · …"})]})]}),e.jsx("div",{className:"hidden flex-col items-center justify-center text-muted-foreground lg:flex",children:e.jsx(p,{className:"h-6 w-6"})}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.18em] text-primary",children:s(t.how.diagramLabels.gateway)}),e.jsx("div",{className:"mt-3 rounded-xl bg-foreground px-4 py-3 font-mono text-[12px] text-background",children:"127.0.0.1:4100"}),e.jsx("ul",{className:"mt-3 space-y-1.5 text-[13px] text-foreground",children:t.how.flowSteps.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"mt-1 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-lg bg-primary font-mono text-[10px] font-semibold text-primary-foreground",children:n+1}),e.jsx("span",{children:s(r)})]},n))})]}),e.jsx("div",{className:"hidden flex-col items-center justify-center text-muted-foreground lg:flex",children:e.jsx(p,{className:"h-6 w-6"})}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:s(t.how.diagramLabels.providers)}),e.jsxs("ul",{className:"mt-3 space-y-2 text-sm text-foreground",children:[e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"OpenAI"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"Anthropic"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"Azure / Bedrock"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2 text-muted-foreground",children:s(Z)})]})]})]}),e.jsx("div",{className:"mt-14 overflow-hidden rounded-3xl border border-border bg-card",children:e.jsxs("div",{className:"grid gap-0 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)]",children:[e.jsxs("div",{className:"border-b border-border p-8 lg:border-b-0 lg:border-r lg:p-10",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.22em] text-primary",children:s(t.how.differentiator.eyebrow)}),e.jsx("h3",{className:"mt-3 text-2xl font-semibold tracking-[-0.01em] text-foreground",children:s(t.how.differentiator.title)}),e.jsx("p",{className:"mt-4 text-sm leading-7 text-muted-foreground",children:s(t.how.differentiator.body)})]}),e.jsxs("div",{className:"bg-secondary p-8 lg:p-10",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:s(t.how.differentiator.example)}),e.jsx("ul",{className:"mt-4 space-y-3",children:J.map(r=>e.jsxs("li",{className:"flex items-center gap-3 rounded-xl bg-card px-4 py-3 ring-1 ring-border",children:[e.jsx("span",{className:"rounded-md bg-secondary px-2 py-1 font-mono text-xs text-foreground",children:r.client}),e.jsx(p,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"rounded-md bg-foreground px-2 py-1 font-mono text-xs text-background",children:s(r.upstream)})]},r.client))})]})]})})]})}),e.jsxs("section",{id:"debug",className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.debug.eyebrow),title:s(t.debug.title),description:s(t.debug.description)}),e.jsx("div",{className:"mt-12 grid gap-px overflow-hidden rounded-2xl bg-border ring-1 ring-border md:grid-cols-3",children:t.debug.pillars.map(({icon:r,title:n,body:d})=>e.jsxs("div",{className:"bg-card p-7",children:[e.jsx("div",{className:"inline-flex h-10 w-10 items-center justify-center rounded-xl bg-secondary text-foreground",children:e.jsx(r,{className:"h-5 w-5"})}),e.jsx("h3",{className:"mt-5 text-base font-semibold text-foreground",children:s(n)}),e.jsx("p",{className:"mt-2 text-sm leading-7 text-muted-foreground",children:s(d)})]},n.en))}),e.jsxs("div",{className:"mt-10 overflow-hidden rounded-2xl border border-border bg-secondary p-8",children:[e.jsx("h3",{className:"text-xl font-semibold text-foreground",children:s(t.debug.payload.title)}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-7 text-muted-foreground",children:s(t.debug.payload.body)}),e.jsx("div",{className:"mt-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:t.debug.payload.stages.map((r,n)=>{const d=n===0||n===3;return e.jsxs("div",{className:g("rounded-xl border px-4 py-4",d?"border-border bg-card":"border-border bg-muted"),children:[e.jsxs("div",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:["payload [",n+1,"/4]"]}),e.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:s(r)}),e.jsx("div",{className:"mt-1 font-mono text-[11px] text-muted-foreground",children:s(d?t.debug.payload.clientSide:t.debug.payload.upstreamSide)})]},n)})})]})]}),e.jsx("section",{id:"local",className:"border-y border-border bg-secondary",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.local.eyebrow),title:s(t.local.title),description:s(t.local.description)}),e.jsxs("div",{className:"mt-12 grid gap-8 lg:grid-cols-[minmax(0,1.05fr)_minmax(0,0.95fr)] lg:items-start",children:[e.jsx("div",{className:"grid gap-px overflow-hidden rounded-2xl bg-border ring-1 ring-border sm:grid-cols-2",children:t.local.pillars.map(({icon:r,title:n,body:d})=>e.jsxs("div",{className:"bg-card p-6",children:[e.jsx("div",{className:"inline-flex h-10 w-10 items-center justify-center rounded-xl bg-secondary text-foreground",children:e.jsx(r,{className:"h-5 w-5"})}),e.jsx("h3",{className:"mt-4 text-base font-semibold text-foreground",children:s(n)}),e.jsx("p",{className:"mt-2 text-sm leading-7 text-muted-foreground",children:s(d)})]},n.en))}),e.jsxs("div",{children:[e.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border bg-secondary p-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2",children:[e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("div",{className:"ml-3 flex-1 truncate rounded-md bg-card px-3 py-1 font-mono text-[11px] text-muted-foreground",children:"~/.cc-gw"})]}),e.jsx("pre",{className:"overflow-x-auto px-5 pb-5 pt-2 font-mono text-[12.5px] leading-7 text-foreground",children:e.jsx("code",{children:V.split(`
17
- `).map((r,n)=>e.jsx("span",{className:"block",children:r.includes("#")?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.slice(0,r.indexOf("#"))}),e.jsx("span",{className:"text-muted-foreground",children:r.slice(r.indexOf("#"))})]}):r},n))})})]}),e.jsx("p",{className:"mt-4 px-1 text-sm leading-7 text-muted-foreground",children:s(t.local.treeCaption)})]})]})]})}),e.jsxs("section",{id:"start",className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.start.eyebrow),title:s(t.start.title),description:s(t.start.description)}),e.jsx("ol",{className:"mt-12 grid gap-5 md:grid-cols-2",children:t.start.steps.map((r,n)=>e.jsxs("li",{className:"flex flex-col rounded-2xl border border-border bg-card p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex h-8 min-w-[2rem] items-center justify-center rounded-lg bg-foreground px-2 font-mono text-xs font-semibold text-background",children:String(n+1).padStart(2,"0")}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:s(r.title)})]}),e.jsx("p",{className:"mt-3 text-sm leading-7 text-muted-foreground",children:s(r.body)}),e.jsx("div",{className:"mt-5",children:e.jsx(ee,{label:`step ${n+1}: ${r.title.en}`,code:r.code,copyLabel:s(z.copy),copiedLabel:s(z.copied)})})]},r.title.en))})]}),e.jsx("section",{id:"console",className:"border-y border-border bg-secondary",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.console.eyebrow),title:s(t.console.title),description:s(t.console.description)}),e.jsxs("div",{className:"mt-12 grid gap-8 lg:grid-cols-[280px_minmax(0,1fr)]",children:[e.jsx("div",{role:"tablist","aria-orientation":"vertical",className:"flex flex-col gap-1.5",children:y.map(r=>{const n=r.id===l;return e.jsxs("button",{type:"button",role:"tab",id:`console-tab-${r.id}`,"aria-selected":n,"aria-controls":`console-panel-${r.id}`,onClick:()=>x(r.id),className:g("rounded-xl border px-4 py-3 text-left transition",n?"border-primary bg-card":"border-transparent bg-transparent hover:bg-secondary"),children:[e.jsx("div",{className:g("text-sm font-semibold",n?"text-foreground":"text-muted-foreground"),children:s(r.label)}),e.jsx("div",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:s(r.blurb)})]},r.id)})}),e.jsxs("div",{role:"tabpanel",id:`console-panel-${c.id}`,"aria-labelledby":`console-tab-${c.id}`,className:"overflow-hidden rounded-2xl border border-border bg-secondary p-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2",children:[e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsxs("div",{className:"ml-3 flex-1 truncate rounded-md bg-card px-3 py-1 font-mono text-[11px] text-muted-foreground",children:["127.0.0.1:4100/ui/",c.id]})]}),e.jsx("img",{src:s(c.shot),alt:`${s(c.label)} screenshot`,className:"block w-full rounded-b-xl"},c.id+o)]})]})]})}),e.jsxs("section",{id:"fit",className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.fit.eyebrow),title:s(t.fit.title),description:s(t.fit.description)}),e.jsxs("div",{className:"mt-12 grid gap-5 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-success-bg p-7",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-success-bg text-success",children:e.jsx(b,{className:"h-4 w-4"})}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:s(t.fit.yesTitle)})]}),e.jsx("ul",{className:"mt-5 space-y-3",children:t.fit.yes.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm leading-7 text-foreground",children:[e.jsx(b,{className:"mt-1 h-4 w-4 shrink-0 text-success"}),s(r)]},n))})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-7",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:e.jsx(j,{className:"h-4 w-4"})}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:s(t.fit.noTitle)})]}),e.jsx("ul",{className:"mt-5 space-y-3",children:t.fit.no.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm leading-7 text-muted-foreground",children:[e.jsx(j,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}),s(r)]},n))})]})]})]}),e.jsx("section",{id:"faq",className:"border-y border-border bg-secondary",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.faq.eyebrow),title:s(t.faq.title),description:s(t.faq.description)}),e.jsx("div",{className:"mx-auto mt-12 max-w-3xl divide-y divide-border rounded-2xl border border-border bg-card",children:t.faq.items.map((r,n)=>{const d=h===n;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:()=>i(d?null:n),"aria-expanded":d,className:"flex w-full items-center justify-between gap-6 px-6 py-5 text-left",children:[e.jsx("span",{className:"text-base font-semibold text-foreground",children:s(r.q)}),e.jsx(q,{className:g("h-5 w-5 shrink-0 text-muted-foreground transition-transform",d&&"rotate-180 text-foreground")})]}),d&&e.jsx("div",{className:"px-6 pb-6 text-sm leading-7 text-muted-foreground",children:s(r.a)})]},n)})})]})}),e.jsx("section",{className:"px-6 py-24 sm:px-8 lg:px-10",children:e.jsx("div",{className:"relative mx-auto w-full max-w-6xl overflow-hidden rounded-3xl bg-foreground px-8 py-14 text-background sm:px-12",children:e.jsxs("div",{className:"relative grid gap-10 lg:grid-cols-[1.2fr_auto] lg:items-end",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-[-0.02em] sm:text-4xl",children:s(t.cta.title)}),e.jsx("p",{className:"mt-5 max-w-xl text-base leading-8 text-background/80",children:s(t.cta.body)})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row lg:flex-col lg:items-end",children:[e.jsxs("a",{href:"https://www.npmjs.com/package/@chenpu17/cc-gw",className:"inline-flex items-center justify-center gap-2 rounded-xl bg-background px-5 py-3 text-sm font-semibold text-foreground transition hover:bg-secondary",children:[e.jsx(N,{className:"h-4 w-4"}),s(t.ctaInstall)]}),e.jsxs("a",{href:"/ui/",className:"inline-flex items-center justify-center gap-2 rounded-xl border border-border bg-transparent px-5 py-3 text-sm font-semibold text-background transition hover:bg-background hover:text-foreground",children:[s(t.ctaConsole),e.jsx(p,{className:"h-4 w-4"})]})]})]})})})]}),e.jsx("footer",{className:"border-t border-border bg-card",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-4 px-6 py-10 text-sm text-muted-foreground sm:px-8 lg:flex-row lg:items-center lg:justify-between lg:px-10",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"h-7 w-7",title:"cc-gw"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-foreground",children:s(t.footer.tagline)}),e.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground",children:["v",w]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-5",children:[e.jsx("a",{href:"/ui/",className:"hover:text-foreground",children:s(t.footer.console)}),e.jsx("a",{href:"https://www.npmjs.com/package/@chenpu17/cc-gw",className:"hover:text-foreground",children:"npm"}),e.jsx("a",{href:"https://github.com/chenpu17/cc-gw2",className:"hover:text-foreground",children:"GitHub"}),e.jsx("a",{href:"https://github.com/chenpu17/cc-gw2/releases",className:"hover:text-foreground",children:s(t.footer.changelog)})]})]})})]})}const I=document.getElementById("landing-root");if(!I)throw new Error("Root element #landing-root not found");U.createRoot(I).render(e.jsx(B.StrictMode,{children:e.jsx(te,{})}));
16
+ `).map((f,r)=>e.jsx("span",{className:"block",children:X(f)??" "},r))})})]})}function se(){const[o,a]=u.useState(!1),l="npm install -g @chenpu17/cc-gw";async function x(){try{await A(l),a(!0),window.setTimeout(()=>a(!1),1800)}catch{}}return e.jsxs("div",{className:"inline-flex w-full max-w-md items-center gap-2 rounded-2xl border border-border bg-card py-2 pl-4 pr-2",children:[e.jsx("span",{className:"select-none font-mono text-primary",children:"$"}),e.jsx("span",{className:"select-all truncate font-mono text-sm text-foreground",children:l}),e.jsx("button",{type:"button","aria-label":"Copy install command",onClick:x,className:"ml-auto inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-secondary text-foreground transition hover:bg-muted",children:o?e.jsx(b,{className:"h-3.5 w-3.5 text-primary"}):e.jsx(k,{className:"h-3.5 w-3.5"})})]})}function m({eyebrow:o,title:a,description:l}){return e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("div",{className:"font-mono text-xs font-semibold uppercase tracking-[0.22em] text-primary",children:o}),e.jsx("h2",{className:"mt-4 text-3xl font-semibold tracking-[-0.02em] text-foreground sm:text-4xl",children:a}),e.jsx("p",{className:"mt-4 text-base leading-8 text-muted-foreground sm:text-lg",children:l})]})}function te(){const[o,a]=u.useState("zh"),[l,x]=u.useState(y[0].id),[h,i]=u.useState(0),s=r=>Q(o,r),c=y.find(r=>r.id===l)??y[0],f=[{href:"#why",label:s(t.nav.why)},{href:"#how",label:s(t.nav.how)},{href:"#debug",label:s(t.nav.debug)},{href:"#local",label:s(t.nav.local)},{href:"#start",label:s(t.nav.start)},{href:"#faq",label:s(t.nav.faq)}];return e.jsxs("div",{className:"min-h-screen bg-background text-foreground antialiased",children:[e.jsxs("header",{className:"sticky top-0 z-30 border-b border-border bg-card",children:[e.jsxs("div",{className:"mx-auto flex w-full max-w-6xl items-center justify-between gap-4 px-6 py-3.5 sm:px-8 lg:px-10",children:[e.jsxs("a",{href:"#top",className:"flex items-center gap-2.5",children:[e.jsx(v,{className:"h-9 w-9",title:"cc-gw"}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("div",{className:"text-[15px] font-semibold tracking-tight",children:"cc-gw"}),e.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"local-first ai gateway"})]})]}),e.jsx("nav",{className:"hidden items-center gap-1 lg:flex",children:f.map(r=>e.jsx("a",{href:r.href,className:"rounded-lg px-3 py-1.5 text-sm text-muted-foreground transition hover:bg-secondary hover:text-foreground",children:r.label},r.href))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>a(o==="zh"?"en":"zh"),"aria-label":"Toggle language",className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 py-1.5 text-xs font-semibold text-foreground transition hover:border-primary",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),o==="zh"?"EN":"中文"]}),e.jsx("a",{href:"/ui/",className:"hidden rounded-lg border border-border bg-card px-3.5 py-1.5 text-sm font-medium text-foreground transition hover:border-primary hover:text-foreground sm:inline-flex",children:s(t.ctaConsole)}),e.jsxs("a",{href:"https://github.com/chenpu17/cc-gw2",className:"inline-flex items-center gap-1.5 rounded-lg bg-foreground px-3.5 py-1.5 text-sm font-medium text-background transition hover:bg-muted",children:[e.jsx(L,{className:"h-4 w-4"}),"GitHub"]})]})]}),e.jsx("nav",{"aria-label":"Mobile section navigation",className:"flex gap-1.5 overflow-x-auto border-t border-border px-4 py-2 lg:hidden",children:[...f,{href:"/ui/",label:s(t.ctaConsole)}].map(r=>e.jsx("a",{href:r.href,className:"shrink-0 rounded-lg bg-secondary px-3 py-1 text-xs font-medium text-foreground",children:r.label},r.href))})]}),e.jsxs("main",{id:"top",children:[e.jsx("section",{className:"relative overflow-hidden bg-foreground text-background",children:e.jsxs("div",{className:"relative mx-auto w-full max-w-6xl px-6 pb-24 pt-20 sm:px-8 lg:px-10 lg:pt-28",children:[e.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3.5 py-1 text-xs font-medium text-foreground",children:[e.jsx("span",{"aria-hidden":"true",className:"inline-flex h-1.5 w-1.5 rounded-full bg-success"}),e.jsx("span",{"data-visual-volatile":"text",children:s(t.hero.badge)})]}),e.jsxs("h1",{className:"mt-7 text-[2.4rem] font-bold leading-[1.05] tracking-[-0.035em] sm:text-6xl",children:[s(t.hero.h1Top),e.jsx("span",{className:"mt-2 block text-primary",children:s(t.hero.h1Bottom)})]}),e.jsx("p",{className:"mx-auto mt-6 max-w-2xl text-base leading-8 text-background/80 sm:text-lg",children:s(t.hero.lead)}),e.jsxs("div",{className:"mt-9 flex flex-col items-center justify-center gap-3 sm:flex-row",children:[e.jsxs("a",{href:"#start",className:"group inline-flex items-center justify-center gap-2 rounded-xl bg-background px-5 py-3 text-sm font-semibold text-foreground transition hover:bg-secondary",children:[e.jsx(N,{className:"h-4 w-4"}),s(t.ctaInstall),e.jsx(p,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5"})]}),e.jsx("a",{href:"#console",className:"inline-flex items-center justify-center gap-2 rounded-xl border border-border bg-transparent px-5 py-3 text-sm font-semibold text-background transition hover:bg-background hover:text-foreground",children:s(t.ctaPreview)})]}),e.jsxs("div",{className:"mt-7 flex flex-col items-center gap-2",children:[e.jsx(se,{}),e.jsx("p",{className:"font-mono text-[11px] text-background/60",children:s(t.hero.note)})]}),e.jsx("ul",{className:"mt-10 grid gap-3 text-left sm:grid-cols-3",children:t.hero.proof.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-2 rounded-xl border border-border bg-card px-4 py-3 text-[13px] leading-6 text-foreground",children:[e.jsx(b,{className:"mt-0.5 h-4 w-4 shrink-0 text-success"}),e.jsx("span",{children:s(r)})]},n))})]}),e.jsx("div",{className:"relative mx-auto mt-16 max-w-5xl",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border bg-secondary p-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border px-4 py-2.5",children:[e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("div",{className:"ml-3 flex-1 truncate rounded-md bg-card px-3 py-1 text-center font-mono text-[11px] text-muted-foreground",children:"127.0.0.1:4100/ui/"})]}),e.jsx("img",{src:o==="en"?C:S,alt:"cc-gw dashboard screenshot",className:"block w-full rounded-b-xl",loading:"eager"})]})}),e.jsxs("div",{className:"mt-16",children:[e.jsx("p",{className:"text-center font-mono text-[11px] uppercase tracking-[0.22em] text-background/60",children:s(t.hero.works)}),e.jsx("div",{className:"mt-5 flex flex-wrap items-center justify-center gap-2",children:M.map(r=>e.jsx("span",{className:"rounded-lg border border-border bg-card px-3.5 py-1.5 text-sm text-foreground",children:r},r))})]})]})}),e.jsxs("section",{id:"why",className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.why.eyebrow),title:s(t.why.title),description:s(t.why.description)}),e.jsx("div",{className:"mt-12 grid gap-5 md:grid-cols-3",children:t.why.cards.map(r=>e.jsxs("div",{className:"group relative overflow-hidden rounded-2xl border border-border bg-card p-6 transition hover:border-primary",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"h-4 w-4 text-error"}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:s(r.title)})]}),e.jsx("p",{className:"mt-3 text-sm leading-7 text-muted-foreground",children:s(r.body)}),e.jsx("pre",{className:"mt-5 overflow-hidden rounded-lg bg-secondary p-3 font-mono text-[11.5px] leading-6 text-muted-foreground ring-1 ring-border",children:r.sample})]},r.title.en))})]}),e.jsx("section",{id:"how",className:"border-y border-border bg-secondary",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.how.eyebrow),title:s(t.how.title),description:s(t.how.description)}),e.jsxs("div",{className:"mt-12 grid gap-6 lg:grid-cols-[1fr_auto_1fr_auto_1fr] lg:items-stretch",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:s(t.how.diagramLabels.clients)}),e.jsxs("ul",{className:"mt-3 space-y-2 text-sm text-foreground",children:[e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"Claude Code"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"OpenAI SDK"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"Anthropic SDK"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2 text-muted-foreground",children:"cURL · LangChain · …"})]})]}),e.jsx("div",{className:"hidden flex-col items-center justify-center text-muted-foreground lg:flex",children:e.jsx(p,{className:"h-6 w-6"})}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.18em] text-primary",children:s(t.how.diagramLabels.gateway)}),e.jsx("div",{className:"mt-3 rounded-xl bg-foreground px-4 py-3 font-mono text-[12px] text-background",children:"127.0.0.1:4100"}),e.jsx("ul",{className:"mt-3 space-y-1.5 text-[13px] text-foreground",children:t.how.flowSteps.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"mt-1 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-lg bg-primary font-mono text-[10px] font-semibold text-primary-foreground",children:n+1}),e.jsx("span",{children:s(r)})]},n))})]}),e.jsx("div",{className:"hidden flex-col items-center justify-center text-muted-foreground lg:flex",children:e.jsx(p,{className:"h-6 w-6"})}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:s(t.how.diagramLabels.providers)}),e.jsxs("ul",{className:"mt-3 space-y-2 text-sm text-foreground",children:[e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"OpenAI"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"Anthropic"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2",children:"Azure / Bedrock"}),e.jsx("li",{className:"rounded-lg bg-secondary px-3 py-2 text-muted-foreground",children:s(Z)})]})]})]}),e.jsx("div",{className:"mt-14 overflow-hidden rounded-3xl border border-border bg-card",children:e.jsxs("div",{className:"grid gap-0 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)]",children:[e.jsxs("div",{className:"border-b border-border p-8 lg:border-b-0 lg:border-r lg:p-10",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.22em] text-primary",children:s(t.how.differentiator.eyebrow)}),e.jsx("h3",{className:"mt-3 text-2xl font-semibold tracking-[-0.01em] text-foreground",children:s(t.how.differentiator.title)}),e.jsx("p",{className:"mt-4 text-sm leading-7 text-muted-foreground",children:s(t.how.differentiator.body)})]}),e.jsxs("div",{className:"bg-secondary p-8 lg:p-10",children:[e.jsx("div",{className:"font-mono text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:s(t.how.differentiator.example)}),e.jsx("ul",{className:"mt-4 space-y-3",children:J.map(r=>e.jsxs("li",{className:"flex items-center gap-3 rounded-xl bg-card px-4 py-3 ring-1 ring-border",children:[e.jsx("span",{className:"rounded-md bg-secondary px-2 py-1 font-mono text-xs text-foreground",children:r.client}),e.jsx(p,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"rounded-md bg-foreground px-2 py-1 font-mono text-xs text-background",children:s(r.upstream)})]},r.client))})]})]})})]})}),e.jsxs("section",{id:"debug",className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.debug.eyebrow),title:s(t.debug.title),description:s(t.debug.description)}),e.jsx("div",{className:"mt-12 grid gap-px overflow-hidden rounded-2xl bg-border ring-1 ring-border md:grid-cols-3",children:t.debug.pillars.map(({icon:r,title:n,body:d})=>e.jsxs("div",{className:"bg-card p-7",children:[e.jsx("div",{className:"inline-flex h-10 w-10 items-center justify-center rounded-xl bg-secondary text-foreground",children:e.jsx(r,{className:"h-5 w-5"})}),e.jsx("h3",{className:"mt-5 text-base font-semibold text-foreground",children:s(n)}),e.jsx("p",{className:"mt-2 text-sm leading-7 text-muted-foreground",children:s(d)})]},n.en))}),e.jsxs("div",{className:"mt-10 overflow-hidden rounded-2xl border border-border bg-secondary p-8",children:[e.jsx("h3",{className:"text-xl font-semibold text-foreground",children:s(t.debug.payload.title)}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-7 text-muted-foreground",children:s(t.debug.payload.body)}),e.jsx("div",{className:"mt-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:t.debug.payload.stages.map((r,n)=>{const d=n===0||n===3;return e.jsxs("div",{className:g("rounded-xl border px-4 py-4",d?"border-border bg-card":"border-border bg-muted"),children:[e.jsxs("div",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:["payload [",n+1,"/4]"]}),e.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:s(r)}),e.jsx("div",{className:"mt-1 font-mono text-[11px] text-muted-foreground",children:s(d?t.debug.payload.clientSide:t.debug.payload.upstreamSide)})]},n)})})]})]}),e.jsx("section",{id:"local",className:"border-y border-border bg-secondary",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.local.eyebrow),title:s(t.local.title),description:s(t.local.description)}),e.jsxs("div",{className:"mt-12 grid gap-8 lg:grid-cols-[minmax(0,1.05fr)_minmax(0,0.95fr)] lg:items-start",children:[e.jsx("div",{className:"grid gap-px overflow-hidden rounded-2xl bg-border ring-1 ring-border sm:grid-cols-2",children:t.local.pillars.map(({icon:r,title:n,body:d})=>e.jsxs("div",{className:"bg-card p-6",children:[e.jsx("div",{className:"inline-flex h-10 w-10 items-center justify-center rounded-xl bg-secondary text-foreground",children:e.jsx(r,{className:"h-5 w-5"})}),e.jsx("h3",{className:"mt-4 text-base font-semibold text-foreground",children:s(n)}),e.jsx("p",{className:"mt-2 text-sm leading-7 text-muted-foreground",children:s(d)})]},n.en))}),e.jsxs("div",{children:[e.jsxs("div",{className:"overflow-hidden rounded-2xl border border-border bg-secondary p-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2",children:[e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("div",{className:"ml-3 flex-1 truncate rounded-md bg-card px-3 py-1 font-mono text-[11px] text-muted-foreground",children:"~/.cc-gw"})]}),e.jsx("pre",{className:"overflow-x-auto px-5 pb-5 pt-2 font-mono text-[12.5px] leading-7 text-foreground",children:e.jsx("code",{children:V.split(`
17
+ `).map((r,n)=>e.jsx("span",{className:"block",children:r.includes("#")?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r.slice(0,r.indexOf("#"))}),e.jsx("span",{className:"text-muted-foreground",children:r.slice(r.indexOf("#"))})]}):r},n))})})]}),e.jsx("p",{className:"mt-4 px-1 text-sm leading-7 text-muted-foreground",children:s(t.local.treeCaption)})]})]})]})}),e.jsxs("section",{id:"start",className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.start.eyebrow),title:s(t.start.title),description:s(t.start.description)}),e.jsx("ol",{className:"mt-12 grid gap-5 md:grid-cols-2",children:t.start.steps.map((r,n)=>e.jsxs("li",{className:"flex flex-col rounded-2xl border border-border bg-card p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex h-8 min-w-[2rem] items-center justify-center rounded-lg bg-foreground px-2 font-mono text-xs font-semibold text-background",children:String(n+1).padStart(2,"0")}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:s(r.title)})]}),e.jsx("p",{className:"mt-3 text-sm leading-7 text-muted-foreground",children:s(r.body)}),e.jsx("div",{className:"mt-5",children:e.jsx(ee,{label:`step ${n+1}: ${r.title.en}`,code:r.code,copyLabel:s(z.copy),copiedLabel:s(z.copied)})})]},r.title.en))})]}),e.jsx("section",{id:"console",className:"border-y border-border bg-secondary",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.console.eyebrow),title:s(t.console.title),description:s(t.console.description)}),e.jsxs("div",{className:"mt-12 grid gap-8 lg:grid-cols-[280px_minmax(0,1fr)]",children:[e.jsx("div",{role:"tablist","aria-orientation":"vertical",className:"flex flex-col gap-1.5",children:y.map(r=>{const n=r.id===l;return e.jsxs("button",{type:"button",role:"tab",id:`console-tab-${r.id}`,"aria-selected":n,"aria-controls":`console-panel-${r.id}`,onClick:()=>x(r.id),className:g("rounded-xl border px-4 py-3 text-left transition",n?"border-primary bg-card":"border-transparent bg-transparent hover:bg-secondary"),children:[e.jsx("div",{className:g("text-sm font-semibold",n?"text-foreground":"text-muted-foreground"),children:s(r.label)}),e.jsx("div",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:s(r.blurb)})]},r.id)})}),e.jsxs("div",{role:"tabpanel",id:`console-panel-${c.id}`,"aria-labelledby":`console-tab-${c.id}`,className:"overflow-hidden rounded-2xl border border-border bg-secondary p-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2",children:[e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 rounded-full bg-muted-foreground"}),e.jsxs("div",{className:"ml-3 flex-1 truncate rounded-md bg-card px-3 py-1 font-mono text-[11px] text-muted-foreground",children:["127.0.0.1:4100/ui/",c.id]})]}),e.jsx("img",{src:s(c.shot),alt:`${s(c.label)} screenshot`,className:"block w-full rounded-b-xl"},c.id+o)]})]})]})}),e.jsxs("section",{id:"fit",className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.fit.eyebrow),title:s(t.fit.title),description:s(t.fit.description)}),e.jsxs("div",{className:"mt-12 grid gap-5 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-success-bg p-7",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-success-bg text-success",children:e.jsx(b,{className:"h-4 w-4"})}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:s(t.fit.yesTitle)})]}),e.jsx("ul",{className:"mt-5 space-y-3",children:t.fit.yes.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm leading-7 text-foreground",children:[e.jsx(b,{className:"mt-1 h-4 w-4 shrink-0 text-success"}),s(r)]},n))})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-7",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:e.jsx(w,{className:"h-4 w-4"})}),e.jsx("h3",{className:"text-base font-semibold text-foreground",children:s(t.fit.noTitle)})]}),e.jsx("ul",{className:"mt-5 space-y-3",children:t.fit.no.map((r,n)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm leading-7 text-muted-foreground",children:[e.jsx(w,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}),s(r)]},n))})]})]})]}),e.jsx("section",{id:"faq",className:"border-y border-border bg-secondary",children:e.jsxs("div",{className:"mx-auto w-full max-w-6xl px-6 py-20 sm:px-8 lg:px-10 lg:py-24",children:[e.jsx(m,{eyebrow:s(t.faq.eyebrow),title:s(t.faq.title),description:s(t.faq.description)}),e.jsx("div",{className:"mx-auto mt-12 max-w-3xl divide-y divide-border rounded-2xl border border-border bg-card",children:t.faq.items.map((r,n)=>{const d=h===n;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:()=>i(d?null:n),"aria-expanded":d,className:"flex w-full items-center justify-between gap-6 px-6 py-5 text-left",children:[e.jsx("span",{className:"text-base font-semibold text-foreground",children:s(r.q)}),e.jsx(q,{className:g("h-5 w-5 shrink-0 text-muted-foreground transition-transform",d&&"rotate-180 text-foreground")})]}),d&&e.jsx("div",{className:"px-6 pb-6 text-sm leading-7 text-muted-foreground",children:s(r.a)})]},n)})})]})}),e.jsx("section",{className:"px-6 py-24 sm:px-8 lg:px-10",children:e.jsx("div",{className:"relative mx-auto w-full max-w-6xl overflow-hidden rounded-3xl bg-foreground px-8 py-14 text-background sm:px-12",children:e.jsxs("div",{className:"relative grid gap-10 lg:grid-cols-[1.2fr_auto] lg:items-end",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-3xl font-semibold tracking-[-0.02em] sm:text-4xl",children:s(t.cta.title)}),e.jsx("p",{className:"mt-5 max-w-xl text-base leading-8 text-background/80",children:s(t.cta.body)})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row lg:flex-col lg:items-end",children:[e.jsxs("a",{href:"https://www.npmjs.com/package/@chenpu17/cc-gw",className:"inline-flex items-center justify-center gap-2 rounded-xl bg-background px-5 py-3 text-sm font-semibold text-foreground transition hover:bg-secondary",children:[e.jsx(N,{className:"h-4 w-4"}),s(t.ctaInstall)]}),e.jsxs("a",{href:"/ui/",className:"inline-flex items-center justify-center gap-2 rounded-xl border border-border bg-transparent px-5 py-3 text-sm font-semibold text-background transition hover:bg-background hover:text-foreground",children:[s(t.ctaConsole),e.jsx(p,{className:"h-4 w-4"})]})]})]})})})]}),e.jsx("footer",{className:"border-t border-border bg-card",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-4 px-6 py-10 text-sm text-muted-foreground sm:px-8 lg:flex-row lg:items-center lg:justify-between lg:px-10",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"h-7 w-7",title:"cc-gw"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-foreground",children:s(t.footer.tagline)}),e.jsxs("div",{className:"font-mono text-[11px] text-muted-foreground",children:["v",j]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-5",children:[e.jsx("a",{href:"/ui/",className:"hover:text-foreground",children:s(t.footer.console)}),e.jsx("a",{href:"https://www.npmjs.com/package/@chenpu17/cc-gw",className:"hover:text-foreground",children:"npm"}),e.jsx("a",{href:"https://github.com/chenpu17/cc-gw2",className:"hover:text-foreground",children:"GitHub"}),e.jsx("a",{href:"https://github.com/chenpu17/cc-gw2/releases",className:"hover:text-foreground",children:s(t.footer.changelog)})]})]})})]})}const I=document.getElementById("landing-root");if(!I)throw new Error("Root element #landing-root not found");U.createRoot(I).render(e.jsx(B.StrictMode,{children:e.jsx(te,{})}));
@@ -1 +1 @@
1
- import{r as d}from"./vendor-JUtelXU0.js";import{u as v}from"./query-CvboQrUT.js";import{u as R,b as M,q as y,f as E,e as p,d as c}from"./app-CRxPj2SJ.js";import{g as S}from"./gateway-DyhqzHSh.js";import{u as C}from"./i18n-v60Yn7Ls.js";const x=["claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929-thinking","claude-sonnet-4-20250514","claude-opus-4-1-20250805","claude-opus-4-1-20250805-thinking","claude-haiku-4-5-20251001","claude-haiku-4-5-20251001-thinking","claude-3-5-haiku-20241022"],N=["gpt-4o-mini","gpt-4o","o4-mini","o4-large","gpt-5-codex"];function k(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2,10)}function l(e,t){var r;return(r=e==null?void 0:e.customEndpoints)!=null&&r.length?e.customEndpoints:t}function m(e){return e?Object.entries(e).map(([t,r])=>({id:k(),source:t,target:r})):[]}function G(e,t){var o,a,i;if(!e)return{};const r={},n=e.endpointRouting??{};r.anthropic=m(((o=n.anthropic)==null?void 0:o.modelRoutes)??e.modelRoutes??{}),r.openai=m(((a=n.openai)==null?void 0:a.modelRoutes)??{});for(const s of l(e,t))(i=s.routing)!=null&&i.modelRoutes?r[s.id]=m(s.routing.modelRoutes):r[s.id]=[];return r}function D(e,t,r){var a,i,s;const n=l(e,t).find(u=>u.id===r);if(n)return((a=n.routing)==null?void 0:a.modelRoutes)??{};const o=e.endpointRouting??{};return r==="anthropic"?((i=o.anthropic)==null?void 0:i.modelRoutes)??e.modelRoutes??{}:r==="openai"?((s=o.openai)==null?void 0:s.modelRoutes)??{}:{}}function f(e,t,r){var o,a,i;if(r==="anthropic"||r==="openai")return((a=(o=e.endpointRouting)==null?void 0:o[r])==null?void 0:a.defaults)??e.defaults;const n=l(e,t).find(s=>s.id===r);return((i=n==null?void 0:n.routing)==null?void 0:i.defaults)??{completion:null,reasoning:null,background:null,longContextThreshold:e.defaults.longContextThreshold}}function L(e,t){if(!e)return{};const r={anthropic:f(e,t,"anthropic"),openai:f(e,t,"openai")};for(const n of l(e,t))r[n.id]=f(e,t,n.id);return r}function $(e){const t={};for(const r of e){const n=r.source.trim(),o=r.target.trim();n&&o&&(t[n]=o)}return t}function Q(e,t){return JSON.stringify($(e))!==JSON.stringify(t)}function _(e,t,r){var o,a,i;if(!t)return;if(e==="anthropic"||e==="openai")return(a=(o=t.endpointRouting)==null?void 0:o[e])==null?void 0:a.compatibility;const n=l(t,r).find(s=>s.id===e);return(i=n==null?void 0:n.routing)==null?void 0:i.compatibility}function j(e,t){var n,o;const r={anthropic:((n=e.routingPresets)==null?void 0:n.anthropic)??[],openai:((o=e.routingPresets)==null?void 0:o.openai)??[]};for(const a of l(e,t))r[a.id]=a.routingPresets??[];return r}function P(e,t){const r=[{key:"providers",label:e("modelManagement.tabs.providers"),description:e("modelManagement.tabs.providersDesc"),isSystem:!0,canDelete:!1},{key:"anthropic",label:e("modelManagement.tabs.anthropic"),description:e("modelManagement.tabs.anthropicDesc"),isSystem:!0,canDelete:!1,protocols:["anthropic"]},{key:"openai",label:e("modelManagement.tabs.openai"),description:e("modelManagement.tabs.openaiDesc"),isSystem:!0,canDelete:!1,protocols:["openai-auto","openai-chat","openai-responses"]}],n=t.map(o=>{let a=e("modelManagement.tabs.customEndpoint"),i=[];if(o.paths&&o.paths.length>0)a=`${e("modelManagement.tabs.customEndpoint")}: ${o.paths.map(s=>`${s.path} (${s.protocol})`).join(", ")}`,i=[...new Set(o.paths.map(s=>s.protocol))];else if(o.path){const s=o.protocol||"anthropic";a=`${e("modelManagement.tabs.customEndpoint")}: ${o.path} (${s})`,i=[s]}return{key:o.id,label:o.label||o.id,description:a,isSystem:!1,canDelete:o.deletable!==!1,protocols:i}});return[...r,...n]}function w(e){return e.label&&e.label.trim().length>0?`${e.label} (${e.id})`:e.id}function g(e,t){if(!e)return!1;const[r]=e.split(":");return r===t||e===t}function T(e,t,r){if(!e)return[];const n=["anthropic","openai",...l(e,t).map(a=>a.id)],o=[];for(const a of n){const i=D(e,t,a);for(const[s,u]of Object.entries(i))g(u,r)&&o.push({endpoint:a,source:s,target:u})}return o}function O(e,t,r){return T(e,t,r).length}function J(e,t,r){if(!e)return{routes:0,defaults:0,aggregateMembers:0};const n=["anthropic","openai",...l(e,t).map(i=>i.id)];let o=0;for(const i of n){const s=f(e,t,i);for(const u of[s.completion,s.reasoning,s.background])u&&g(u,r)&&(o+=1)}let a=0;for(const i of e.providers??[])if(i.type==="aggregate")for(const s of i.models??[])for(const u of s.members??[])g(u.target,r)&&(a+=1);return{routes:O(e,t,r),defaults:o,aggregateMembers:a}}function K(){var h;const{t:e}=C(),{pushToast:t}=R(),r=M(y.config.full(),S.configRequest()),n=v({queryKey:y.customEndpoints.all(),queryFn:E.list,refetchInterval:1e4}),o=d.useMemo(()=>{var b;return((b=n.data)==null?void 0:b.endpoints)??[]},[(h=n.data)==null?void 0:h.endpoints]),a=d.useMemo(()=>P(e,o),[o,e]),[i,s]=d.useState(null);return d.useEffect(()=>{r.data&&s(r.data)},[r.data]),d.useEffect(()=>{!r.isError||!r.error||t({title:e("providers.toast.loadFailure",{message:r.error.message}),variant:"error"})},[r.error,r.isError,t,e]),{t:e,pushToast:t,config:i,setConfig:s,configQuery:r,customEndpoints:o,customEndpointsQuery:n,tabs:a,ensureConfig:()=>i?!0:(t({title:e("settings.toast.missingConfig"),variant:"error"}),r.refetch(),!1)}}const z={savePreset(e,t){return p(c.post(`/api/routing-presets/${e}`,{name:t}))},applyPreset(e,t){return p(c.post(`/api/routing-presets/${e}/apply`,{name:t}))},deletePreset(e,t){return p(c.delete(`/api/routing-presets/${e}/${encodeURIComponent(t)}`))},testProvider(e,t){return p(c.post(`/api/providers/${e}/test`,t??{}))},probeModels(e,t){return p(c.post(`/api/providers/${e}/models/probe`,t?{provider:t}:{}))},backendsHealth(){return p(c.get("/api/providers/backends/health"))}};export{x as C,N as O,g as a,Q as b,L as c,G as d,f as e,j as f,D as g,k as h,_ as i,z as m,w as r,J as s,K as u};
1
+ import{r as d}from"./vendor-C-lQMZp3.js";import{u as v}from"./query-1Ng1fzmE.js";import{u as R,b as M,q as y,f as E,e as p,d as c}from"./app-DZpd2fu9.js";import{g as S}from"./gateway-DxaHzVOF.js";import{u as C}from"./i18n-ClvfZhYc.js";const x=["claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929-thinking","claude-sonnet-4-20250514","claude-opus-4-1-20250805","claude-opus-4-1-20250805-thinking","claude-haiku-4-5-20251001","claude-haiku-4-5-20251001-thinking","claude-3-5-haiku-20241022"],N=["gpt-4o-mini","gpt-4o","o4-mini","o4-large","gpt-5-codex"];function k(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2,10)}function l(e,t){var r;return(r=e==null?void 0:e.customEndpoints)!=null&&r.length?e.customEndpoints:t}function m(e){return e?Object.entries(e).map(([t,r])=>({id:k(),source:t,target:r})):[]}function G(e,t){var o,a,i;if(!e)return{};const r={},n=e.endpointRouting??{};r.anthropic=m(((o=n.anthropic)==null?void 0:o.modelRoutes)??e.modelRoutes??{}),r.openai=m(((a=n.openai)==null?void 0:a.modelRoutes)??{});for(const s of l(e,t))(i=s.routing)!=null&&i.modelRoutes?r[s.id]=m(s.routing.modelRoutes):r[s.id]=[];return r}function D(e,t,r){var a,i,s;const n=l(e,t).find(u=>u.id===r);if(n)return((a=n.routing)==null?void 0:a.modelRoutes)??{};const o=e.endpointRouting??{};return r==="anthropic"?((i=o.anthropic)==null?void 0:i.modelRoutes)??e.modelRoutes??{}:r==="openai"?((s=o.openai)==null?void 0:s.modelRoutes)??{}:{}}function f(e,t,r){var o,a,i;if(r==="anthropic"||r==="openai")return((a=(o=e.endpointRouting)==null?void 0:o[r])==null?void 0:a.defaults)??e.defaults;const n=l(e,t).find(s=>s.id===r);return((i=n==null?void 0:n.routing)==null?void 0:i.defaults)??{completion:null,reasoning:null,background:null,longContextThreshold:e.defaults.longContextThreshold}}function L(e,t){if(!e)return{};const r={anthropic:f(e,t,"anthropic"),openai:f(e,t,"openai")};for(const n of l(e,t))r[n.id]=f(e,t,n.id);return r}function $(e){const t={};for(const r of e){const n=r.source.trim(),o=r.target.trim();n&&o&&(t[n]=o)}return t}function Q(e,t){return JSON.stringify($(e))!==JSON.stringify(t)}function _(e,t,r){var o,a,i;if(!t)return;if(e==="anthropic"||e==="openai")return(a=(o=t.endpointRouting)==null?void 0:o[e])==null?void 0:a.compatibility;const n=l(t,r).find(s=>s.id===e);return(i=n==null?void 0:n.routing)==null?void 0:i.compatibility}function j(e,t){var n,o;const r={anthropic:((n=e.routingPresets)==null?void 0:n.anthropic)??[],openai:((o=e.routingPresets)==null?void 0:o.openai)??[]};for(const a of l(e,t))r[a.id]=a.routingPresets??[];return r}function P(e,t){const r=[{key:"providers",label:e("modelManagement.tabs.providers"),description:e("modelManagement.tabs.providersDesc"),isSystem:!0,canDelete:!1},{key:"anthropic",label:e("modelManagement.tabs.anthropic"),description:e("modelManagement.tabs.anthropicDesc"),isSystem:!0,canDelete:!1,protocols:["anthropic"]},{key:"openai",label:e("modelManagement.tabs.openai"),description:e("modelManagement.tabs.openaiDesc"),isSystem:!0,canDelete:!1,protocols:["openai-auto","openai-chat","openai-responses"]}],n=t.map(o=>{let a=e("modelManagement.tabs.customEndpoint"),i=[];if(o.paths&&o.paths.length>0)a=`${e("modelManagement.tabs.customEndpoint")}: ${o.paths.map(s=>`${s.path} (${s.protocol})`).join(", ")}`,i=[...new Set(o.paths.map(s=>s.protocol))];else if(o.path){const s=o.protocol||"anthropic";a=`${e("modelManagement.tabs.customEndpoint")}: ${o.path} (${s})`,i=[s]}return{key:o.id,label:o.label||o.id,description:a,isSystem:!1,canDelete:o.deletable!==!1,protocols:i}});return[...r,...n]}function w(e){return e.label&&e.label.trim().length>0?`${e.label} (${e.id})`:e.id}function g(e,t){if(!e)return!1;const[r]=e.split(":");return r===t||e===t}function T(e,t,r){if(!e)return[];const n=["anthropic","openai",...l(e,t).map(a=>a.id)],o=[];for(const a of n){const i=D(e,t,a);for(const[s,u]of Object.entries(i))g(u,r)&&o.push({endpoint:a,source:s,target:u})}return o}function O(e,t,r){return T(e,t,r).length}function J(e,t,r){if(!e)return{routes:0,defaults:0,aggregateMembers:0};const n=["anthropic","openai",...l(e,t).map(i=>i.id)];let o=0;for(const i of n){const s=f(e,t,i);for(const u of[s.completion,s.reasoning,s.background])u&&g(u,r)&&(o+=1)}let a=0;for(const i of e.providers??[])if(i.type==="aggregate")for(const s of i.models??[])for(const u of s.members??[])g(u.target,r)&&(a+=1);return{routes:O(e,t,r),defaults:o,aggregateMembers:a}}function K(){var h;const{t:e}=C(),{pushToast:t}=R(),r=M(y.config.full(),S.configRequest()),n=v({queryKey:y.customEndpoints.all(),queryFn:E.list,refetchInterval:1e4}),o=d.useMemo(()=>{var b;return((b=n.data)==null?void 0:b.endpoints)??[]},[(h=n.data)==null?void 0:h.endpoints]),a=d.useMemo(()=>P(e,o),[o,e]),[i,s]=d.useState(null);return d.useEffect(()=>{r.data&&s(r.data)},[r.data]),d.useEffect(()=>{!r.isError||!r.error||t({title:e("providers.toast.loadFailure",{message:r.error.message}),variant:"error"})},[r.error,r.isError,t,e]),{t:e,pushToast:t,config:i,setConfig:s,configQuery:r,customEndpoints:o,customEndpointsQuery:n,tabs:a,ensureConfig:()=>i?!0:(t({title:e("settings.toast.missingConfig"),variant:"error"}),r.refetch(),!1)}}const z={savePreset(e,t){return p(c.post(`/api/routing-presets/${e}`,{name:t}))},applyPreset(e,t){return p(c.post(`/api/routing-presets/${e}/apply`,{name:t}))},deletePreset(e,t){return p(c.delete(`/api/routing-presets/${e}/${encodeURIComponent(t)}`))},testProvider(e,t){return p(c.post(`/api/providers/${e}/test`,t??{}))},probeModels(e,t){return p(c.post(`/api/providers/${e}/models/probe`,t?{provider:t}:{}))},backendsHealth(){return p(c.get("/api/providers/backends/health"))}};export{x as C,N as O,g as a,Q as b,L as c,G as d,f as e,j as f,D as g,k as h,_ as i,z as m,w as r,J as s,K as u};
@@ -0,0 +1 @@
1
+ const o="0.17.1",s={version:o};export{s as p};
@@ -1 +1 @@
1
- import{r as n,j as o}from"./vendor-JUtelXU0.js";import{q as i,r as p,s as c,t as a,A as l}from"./radix-d0BukFWM.js";import{c as m}from"./global-BLUcvOa8.js";const b=i,h=p,x=l,f=n.forwardRef(({className:t,align:e="center",sideOffset:r=4,...s},d)=>o.jsx(c,{children:o.jsx(a,{ref:d,align:e,sideOffset:r,className:m("z-50 w-72 rounded-xl border border-[color:var(--surface-border)] bg-popover/[var(--surface-alpha)] surface-blur p-4 text-popover-foreground shadow-[var(--surface-shadow-lg)] outline-none data-[state=open]:animate-in data-[state=closed]:pointer-events-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));f.displayName=a.displayName;export{b as P,h as a,f as b,x as c};
1
+ import{r as n,j as o}from"./vendor-C-lQMZp3.js";import{q as i,r as p,s as c,t as a,A as l}from"./radix-DONH6gHT.js";import{c as m}from"./global-BCYo_xAt.js";const b=i,h=p,x=l,f=n.forwardRef(({className:t,align:e="center",sideOffset:r=4,...s},d)=>o.jsx(c,{children:o.jsx(a,{ref:d,align:e,sideOffset:r,className:m("z-50 w-72 rounded-xl border border-[color:var(--surface-border)] bg-popover/[var(--surface-alpha)] surface-blur p-4 text-popover-foreground shadow-[var(--surface-shadow-lg)] outline-none data-[state=open]:animate-in data-[state=closed]:pointer-events-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));f.displayName=a.displayName;export{b as P,h as a,f as b,x as c};
@@ -1 +1 @@
1
- import{r as o,j as w,s as m,n as v,a as C,i as Q,Q as I,M as T}from"./vendor-JUtelXU0.js";var b=o.createContext(void 0),x=e=>{const s=o.useContext(b);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},L=({client:e,children:s})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(b.Provider,{value:e,children:s})),p=o.createContext(!1),O=()=>o.useContext(p);p.Provider;function P(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var N=o.createContext(P()),d=()=>o.useContext(N),B=(e,s,a)=>{const r=a!=null&&a.state.error&&typeof e.throwOnError=="function"?m(e.throwOnError,[a.state.error,a]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(s.isReset()||(e.retryOnMount=!1))},k=e=>{o.useEffect(()=>{e.clearReset()},[e])},U=({result:e,errorResetBoundary:s,throwOnError:a,query:r,suspense:n})=>e.isError&&!s.isReset()&&!e.isFetching&&r&&(n&&e.data===void 0||m(a,[e.error,r])),j=e=>{if(e.suspense){const a=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>a(r(...n)):a(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},F=(e,s)=>e.isLoading&&e.isFetching&&!s,H=(e,s)=>(e==null?void 0:e.suspense)&&s.isPending,g=(e,s,a)=>s.fetchOptimistic(e).catch(()=>{a.clearReset()});function D(e,s,a){var E,R,h,S;const r=O(),n=d(),i=x(),t=i.defaultQueryOptions(e);(R=(E=i.getDefaultOptions().queries)==null?void 0:E._experimental_beforeQuery)==null||R.call(E,t);const c=i.getQueryCache().get(t.queryHash);t._optimisticResults=r?"isRestoring":"optimistic",j(t),B(t,n,c),k(n);const M=!i.getQueryCache().get(t.queryHash),[u]=o.useState(()=>new s(i,t)),l=u.getOptimisticResult(t),y=!r&&e.subscribed!==!1;if(o.useSyncExternalStore(o.useCallback(f=>{const _=y?u.subscribe(v.batchCalls(f)):C;return u.updateResult(),_},[u,y]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),o.useEffect(()=>{u.setOptions(t)},[t,u]),H(t,l))throw g(t,u,n);if(U({result:l,errorResetBoundary:n,throwOnError:t.throwOnError,query:c,suspense:t.suspense}))throw l.error;if((S=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||S.call(h,t,l),t.experimental_prefetchInRender&&!Q&&F(l,r)){const f=M?g(t,u,n):c==null?void 0:c.promise;f==null||f.catch(C).finally(()=>{u.updateResult()})}return t.notifyOnChangeProps?l:u.trackResult(l)}function V(e,s){return D(e,I)}function q(e,s){const a=x(),[r]=o.useState(()=>new T(a,e));o.useEffect(()=>{r.setOptions(e)},[r,e]);const n=o.useSyncExternalStore(o.useCallback(t=>r.subscribe(v.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=o.useCallback((t,c)=>{r.mutate(t,c).catch(C)},[r]);if(n.error&&m(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:i,mutateAsync:n.mutate}}export{L as Q,x as a,q as b,V as u};
1
+ import{r as o,j as w,s as m,n as v,a as C,i as Q,Q as I,M as T}from"./vendor-C-lQMZp3.js";var b=o.createContext(void 0),x=e=>{const s=o.useContext(b);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},L=({client:e,children:s})=>(o.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(b.Provider,{value:e,children:s})),p=o.createContext(!1),O=()=>o.useContext(p);p.Provider;function P(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var N=o.createContext(P()),d=()=>o.useContext(N),B=(e,s,a)=>{const r=a!=null&&a.state.error&&typeof e.throwOnError=="function"?m(e.throwOnError,[a.state.error,a]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(s.isReset()||(e.retryOnMount=!1))},k=e=>{o.useEffect(()=>{e.clearReset()},[e])},U=({result:e,errorResetBoundary:s,throwOnError:a,query:r,suspense:n})=>e.isError&&!s.isReset()&&!e.isFetching&&r&&(n&&e.data===void 0||m(a,[e.error,r])),j=e=>{if(e.suspense){const a=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>a(r(...n)):a(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},F=(e,s)=>e.isLoading&&e.isFetching&&!s,H=(e,s)=>(e==null?void 0:e.suspense)&&s.isPending,g=(e,s,a)=>s.fetchOptimistic(e).catch(()=>{a.clearReset()});function D(e,s,a){var E,R,h,S;const r=O(),n=d(),i=x(),t=i.defaultQueryOptions(e);(R=(E=i.getDefaultOptions().queries)==null?void 0:E._experimental_beforeQuery)==null||R.call(E,t);const c=i.getQueryCache().get(t.queryHash);t._optimisticResults=r?"isRestoring":"optimistic",j(t),B(t,n,c),k(n);const M=!i.getQueryCache().get(t.queryHash),[u]=o.useState(()=>new s(i,t)),l=u.getOptimisticResult(t),y=!r&&e.subscribed!==!1;if(o.useSyncExternalStore(o.useCallback(f=>{const _=y?u.subscribe(v.batchCalls(f)):C;return u.updateResult(),_},[u,y]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),o.useEffect(()=>{u.setOptions(t)},[t,u]),H(t,l))throw g(t,u,n);if(U({result:l,errorResetBoundary:n,throwOnError:t.throwOnError,query:c,suspense:t.suspense}))throw l.error;if((S=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||S.call(h,t,l),t.experimental_prefetchInRender&&!Q&&F(l,r)){const f=M?g(t,u,n):c==null?void 0:c.promise;f==null||f.catch(C).finally(()=>{u.updateResult()})}return t.notifyOnChangeProps?l:u.trackResult(l)}function V(e,s){return D(e,I)}function q(e,s){const a=x(),[r]=o.useState(()=>new T(a,e));o.useEffect(()=>{r.setOptions(e)},[r,e]);const n=o.useSyncExternalStore(o.useCallback(t=>r.subscribe(v.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=o.useCallback((t,c)=>{r.mutate(t,c).catch(C)},[r]);if(n.error&&m(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:i,mutateAsync:n.mutate}}export{L as Q,x as a,q as b,V as u};
@@ -1,4 +1,4 @@
1
- import{r as s,j as d,R as Ht,t as Wt,u as Ce,v as ws,w as Cs,x as ys,y as bs,z as Es,B as Ss,C as Ps,D as Rs,F as Is,G as Ts,H as st,J as at}from"./vendor-JUtelXU0.js";function pn(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function ue(...e){return n=>{let t=!1;const o=e.map(r=>{const a=pn(r,n);return!t&&typeof a=="function"&&(t=!0),a});if(t)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():pn(e[r],null)}}}}function $(...e){return s.useCallback(ue(...e),e)}var _s=Symbol.for("react.lazy"),et=Ht[" use ".trim().toString()];function Ms(e){return typeof e=="object"&&e!==null&&"then"in e}function Rn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===_s&&"_payload"in e&&Ms(e._payload)}function In(e){const n=As(e),t=s.forwardRef((o,r)=>{let{children:a,...i}=o;Rn(a)&&typeof et=="function"&&(a=et(a._payload));const c=s.Children.toArray(a),l=c.find(Ds);if(l){const u=l.props.children,f=c.map(p=>p===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:p);return d.jsx(n,{...i,ref:r,children:s.isValidElement(u)?s.cloneElement(u,void 0,f):null})}return d.jsx(n,{...i,ref:r,children:a})});return t.displayName=`${e}.Slot`,t}var El=In("Slot");function As(e){const n=s.forwardRef((t,o)=>{let{children:r,...a}=t;if(Rn(r)&&typeof et=="function"&&(r=et(r._payload)),s.isValidElement(r)){const i=js(r),c=Os(a,r.props);return r.type!==s.Fragment&&(c.ref=o?ue(o,i):i),s.cloneElement(r,c)}return s.Children.count(r)>1?s.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Ns=Symbol("radix.slottable");function Ds(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ns}function Os(e,n){const t={...n};for(const o in n){const r=e[o],a=n[o];/^on[A-Z]/.test(o)?r&&a?t[o]=(...c)=>{const l=a(...c);return r(...c),l}:r&&(t[o]=r):o==="style"?t[o]={...r,...a}:o==="className"&&(t[o]=[r,a].filter(Boolean).join(" "))}return{...e,...t}}function js(e){var o,r;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}function S(e,n,{checkForDefaultPrevented:t=!0}={}){return function(r){if(e==null||e(r),t===!1||!r.defaultPrevented)return n==null?void 0:n(r)}}function ks(e,n){const t=s.createContext(n),o=a=>{const{children:i,...c}=a,l=s.useMemo(()=>c,Object.values(c));return d.jsx(t.Provider,{value:l,children:i})};o.displayName=e+"Provider";function r(a){const i=s.useContext(t);if(i)return i;if(n!==void 0)return n;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function ie(e,n=[]){let t=[];function o(a,i){const c=s.createContext(i),l=t.length;t=[...t,i];const u=p=>{var b;const{scope:v,children:h,...C}=p,m=((b=v==null?void 0:v[e])==null?void 0:b[l])||c,g=s.useMemo(()=>C,Object.values(C));return d.jsx(m.Provider,{value:g,children:h})};u.displayName=a+"Provider";function f(p,v){var m;const h=((m=v==null?void 0:v[e])==null?void 0:m[l])||c,C=s.useContext(h);if(C)return C;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[u,f]}const r=()=>{const a=t.map(i=>s.createContext(i));return function(c){const l=(c==null?void 0:c[e])||a;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,Fs(r,...n)]}function Fs(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const i=o.reduce((c,{useScope:l,scopeName:u})=>{const p=l(a)[`__scope${u}`];return{...c,...p}},{});return s.useMemo(()=>({[`__scope${n.scopeName}`]:i}),[i])}};return t.scopeName=n.scopeName,t}var te=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},Ls=Ht[" useInsertionEffect ".trim().toString()]||te;function fe({prop:e,defaultProp:n,onChange:t=()=>{},caller:o}){const[r,a,i]=$s({defaultProp:n,onChange:t}),c=e!==void 0,l=c?e:r;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const p=f.current;p!==c&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,o])}const u=s.useCallback(f=>{var p;if(c){const v=Bs(f)?f(e):f;v!==e&&((p=i.current)==null||p.call(i,v))}else a(f)},[c,e,a,i]);return[l,u]}function $s({defaultProp:e,onChange:n}){const[t,o]=s.useState(e),r=s.useRef(t),a=s.useRef(n);return Ls(()=>{a.current=n},[n]),s.useEffect(()=>{var i;r.current!==t&&((i=a.current)==null||i.call(a,t),r.current=t)},[t,r]),[t,o,a]}function Bs(e){return typeof e=="function"}function ye(e){const n=Us(e),t=s.forwardRef((o,r)=>{const{children:a,...i}=o,c=s.Children.toArray(a),l=c.find(Vs);if(l){const u=l.props.children,f=c.map(p=>p===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:p);return d.jsx(n,{...i,ref:r,children:s.isValidElement(u)?s.cloneElement(u,void 0,f):null})}return d.jsx(n,{...i,ref:r,children:a})});return t.displayName=`${e}.Slot`,t}function Us(e){const n=s.forwardRef((t,o)=>{const{children:r,...a}=t;if(s.isValidElement(r)){const i=Hs(r),c=Gs(a,r.props);return r.type!==s.Fragment&&(c.ref=o?ue(o,i):i),s.cloneElement(r,c)}return s.Children.count(r)>1?s.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Tn=Symbol("radix.slottable");function Ks(e){const n=({children:t})=>d.jsx(d.Fragment,{children:t});return n.displayName=`${e}.Slottable`,n.__radixId=Tn,n}function Vs(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tn}function Gs(e,n){const t={...n};for(const o in n){const r=e[o],a=n[o];/^on[A-Z]/.test(o)?r&&a?t[o]=(...c)=>{const l=a(...c);return r(...c),l}:r&&(t[o]=r):o==="style"?t[o]={...r,...a}:o==="className"&&(t[o]=[r,a].filter(Boolean).join(" "))}return{...e,...t}}function Hs(e){var o,r;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var Ws=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],N=Ws.reduce((e,n)=>{const t=ye(`Primitive.${n}`),o=s.forwardRef((r,a)=>{const{asChild:i,...c}=r,l=i?t:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...c,ref:a})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function _n(e,n){e&&Wt.flushSync(()=>e.dispatchEvent(n))}function zt(e){const n=e+"CollectionProvider",[t,o]=ie(n),[r,a]=t(n,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:b}=m,w=Ce.useRef(null),y=Ce.useRef(new Map).current;return d.jsx(r,{scope:g,itemMap:y,collectionRef:w,children:b})};i.displayName=n;const c=e+"CollectionSlot",l=ye(c),u=Ce.forwardRef((m,g)=>{const{scope:b,children:w}=m,y=a(c,b),R=$(g,y.collectionRef);return d.jsx(l,{ref:R,children:w})});u.displayName=c;const f=e+"CollectionItemSlot",p="data-radix-collection-item",v=ye(f),h=Ce.forwardRef((m,g)=>{const{scope:b,children:w,...y}=m,R=Ce.useRef(null),j=$(g,R),M=a(f,b);return Ce.useEffect(()=>(M.itemMap.set(R,{ref:R,...y}),()=>void M.itemMap.delete(R))),d.jsx(v,{[p]:"",ref:j,children:w})});h.displayName=f;function C(m){const g=a(e+"CollectionConsumer",m);return Ce.useCallback(()=>{const w=g.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((M,P)=>y.indexOf(M.ref.current)-y.indexOf(P.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},C,o]}var zs=s.createContext(void 0);function it(e){const n=s.useContext(zs);return e||n||"ltr"}function de(e){const n=s.useRef(e);return s.useEffect(()=>{n.current=e}),s.useMemo(()=>(...t)=>{var o;return(o=n.current)==null?void 0:o.call(n,...t)},[])}function Ys(e,n=globalThis==null?void 0:globalThis.document){const t=de(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&t(r)};return n.addEventListener("keydown",o,{capture:!0}),()=>n.removeEventListener("keydown",o,{capture:!0})},[t,n])}var Xs="DismissableLayer",Dt="dismissableLayer.update",qs="dismissableLayer.pointerDownOutside",Zs="dismissableLayer.focusOutside",vn,Mn=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ne=s.forwardRef((e,n)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:c,...l}=e,u=s.useContext(Mn),[f,p]=s.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=s.useState({}),C=$(n,P=>p(P)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(g),w=f?m.indexOf(f):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,R=w>=b,j=ea(P=>{const F=P.target,H=[...u.branches].some(G=>G.contains(F));!R||H||(r==null||r(P),i==null||i(P),P.defaultPrevented||c==null||c())},v),M=ta(P=>{const F=P.target;[...u.branches].some(G=>G.contains(F))||(a==null||a(P),i==null||i(P),P.defaultPrevented||c==null||c())},v);return Ys(P=>{w===u.layers.size-1&&(o==null||o(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},v),s.useEffect(()=>{if(f)return t&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(vn=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),mn(),()=>{t&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=vn)}},[f,v,t,u]),s.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),mn())},[f,u]),s.useEffect(()=>{const P=()=>h({});return document.addEventListener(Dt,P),()=>document.removeEventListener(Dt,P)},[]),d.jsx(N.div,{...l,ref:C,style:{pointerEvents:y?R?"auto":"none":void 0,...e.style},onFocusCapture:S(e.onFocusCapture,M.onFocusCapture),onBlurCapture:S(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:S(e.onPointerDownCapture,j.onPointerDownCapture)})});Ne.displayName=Xs;var Js="DismissableLayerBranch",Qs=s.forwardRef((e,n)=>{const t=s.useContext(Mn),o=s.useRef(null),r=$(n,o);return s.useEffect(()=>{const a=o.current;if(a)return t.branches.add(a),()=>{t.branches.delete(a)}},[t.branches]),d.jsx(N.div,{...e,ref:r})});Qs.displayName=Js;function ea(e,n=globalThis==null?void 0:globalThis.document){const t=de(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=c=>{if(c.target&&!o.current){let l=function(){An(qs,t,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(n.removeEventListener("click",r.current),r.current=l,n.addEventListener("click",r.current,{once:!0})):l()}else n.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{n.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),n.removeEventListener("pointerdown",a),n.removeEventListener("click",r.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function ta(e,n=globalThis==null?void 0:globalThis.document){const t=de(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&An(Zs,t,{originalEvent:a},{discrete:!1})};return n.addEventListener("focusin",r),()=>n.removeEventListener("focusin",r)},[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function mn(){const e=new CustomEvent(Dt);document.dispatchEvent(e)}function An(e,n,t,{discrete:o}){const r=t.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&r.addEventListener(e,n,{once:!0}),o?_n(r,a):r.dispatchEvent(a)}var Rt=0;function ct(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hn()),document.body.insertAdjacentElement("beforeend",e[1]??hn()),Rt++,()=>{Rt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Rt--}},[])}function hn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var It="focusScope.autoFocusOnMount",Tt="focusScope.autoFocusOnUnmount",gn={bubbles:!1,cancelable:!0},na="FocusScope",Ge=s.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...i}=e,[c,l]=s.useState(null),u=de(r),f=de(a),p=s.useRef(null),v=$(n,m=>l(m)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let m=function(y){if(h.paused||!c)return;const R=y.target;c.contains(R)?p.current=R:pe(p.current,{select:!0})},g=function(y){if(h.paused||!c)return;const R=y.relatedTarget;R!==null&&(c.contains(R)||pe(p.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const j of y)j.removedNodes.length>0&&pe(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const w=new MutationObserver(b);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),w.disconnect()}}},[o,c,h.paused]),s.useEffect(()=>{if(c){wn.add(h);const m=document.activeElement;if(!c.contains(m)){const b=new CustomEvent(It,gn);c.addEventListener(It,u),c.dispatchEvent(b),b.defaultPrevented||(oa(ca(Nn(c)),{select:!0}),document.activeElement===m&&pe(c))}return()=>{c.removeEventListener(It,u),setTimeout(()=>{const b=new CustomEvent(Tt,gn);c.addEventListener(Tt,f),c.dispatchEvent(b),b.defaultPrevented||pe(m??document.body,{select:!0}),c.removeEventListener(Tt,f),wn.remove(h)},0)}}},[c,u,f,h]);const C=s.useCallback(m=>{if(!t&&!o||h.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(g&&b){const w=m.currentTarget,[y,R]=ra(w);y&&R?!m.shiftKey&&b===R?(m.preventDefault(),t&&pe(y,{select:!0})):m.shiftKey&&b===y&&(m.preventDefault(),t&&pe(R,{select:!0})):b===w&&m.preventDefault()}},[t,o,h.paused]);return d.jsx(N.div,{tabIndex:-1,...i,ref:v,onKeyDown:C})});Ge.displayName=na;function oa(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(pe(o,{select:n}),document.activeElement!==t)return}function ra(e){const n=Nn(e),t=xn(n,e),o=xn(n.reverse(),e);return[t,o]}function Nn(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function xn(e,n){for(const t of e)if(!sa(t,{upTo:n}))return t}function sa(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function aa(e){return e instanceof HTMLInputElement&&"select"in e}function pe(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&aa(e)&&n&&e.select()}}var wn=ia();function ia(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=Cn(e,n),e.unshift(n)},remove(n){var t;e=Cn(e,n),(t=e[0])==null||t.resume()}}}function Cn(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function ca(e){return e.filter(n=>n.tagName!=="A")}var la=Ht[" useId ".trim().toString()]||(()=>{}),ua=0;function ee(e){const[n,t]=s.useState(la());return te(()=>{t(o=>o??String(ua++))},[e]),e||(n?`radix-${n}`:"")}var da="Arrow",Dn=s.forwardRef((e,n)=>{const{children:t,width:o=10,height:r=5,...a}=e;return d.jsx(N.svg,{...a,ref:n,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?t:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dn.displayName=da;var fa=Dn;function On(e){const[n,t]=s.useState(void 0);return te(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let i,c;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,c=u.blockSize}else i=e.offsetWidth,c=e.offsetHeight;t({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0)},[e]),n}var Yt="Popper",[jn,me]=ie(Yt),[pa,kn]=jn(Yt),Fn=e=>{const{__scopePopper:n,children:t}=e,[o,r]=s.useState(null);return d.jsx(pa,{scope:n,anchor:o,onAnchorChange:r,children:t})};Fn.displayName=Yt;var Ln="PopperAnchor",$n=s.forwardRef((e,n)=>{const{__scopePopper:t,virtualRef:o,...r}=e,a=kn(Ln,t),i=s.useRef(null),c=$(n,i),l=s.useRef(null);return s.useEffect(()=>{const u=l.current;l.current=(o==null?void 0:o.current)||i.current,u!==l.current&&a.onAnchorChange(l.current)}),o?null:d.jsx(N.div,{...r,ref:c})});$n.displayName=Ln;var Xt="PopperContent",[va,ma]=jn(Xt),Bn=s.forwardRef((e,n)=>{var E,D,O,L,U,K;const{__scopePopper:t,side:o="bottom",sideOffset:r=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:h="optimized",onPlaced:C,...m}=e,g=kn(Xt,t),[b,w]=s.useState(null),y=$(n,oe=>w(oe)),[R,j]=s.useState(null),M=On(R),P=(M==null?void 0:M.width)??0,F=(M==null?void 0:M.height)??0,H=o+(a!=="center"?"-"+a:""),G=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},Y=Array.isArray(u)?u:[u],q=Y.length>0,Z={padding:G,boundary:Y.filter(ga),altBoundary:q},{refs:W,floatingStyles:X,placement:B,isPositioned:J,middlewareData:V}=ws({strategy:"fixed",placement:H,whileElementsMounted:(...oe)=>Rs(...oe,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[Cs({mainAxis:r+F,alignmentAxis:i}),l&&ys({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Is():void 0,...Z}),l&&bs({...Z}),Es({...Z,apply:({elements:oe,rects:le,availableWidth:je,availableHeight:ke})=>{const{width:Fe,height:xs}=le.reference,Je=oe.floating.style;Je.setProperty("--radix-popper-available-width",`${je}px`),Je.setProperty("--radix-popper-available-height",`${ke}px`),Je.setProperty("--radix-popper-anchor-width",`${Fe}px`),Je.setProperty("--radix-popper-anchor-height",`${xs}px`)}}),R&&Ss({element:R,padding:c}),xa({arrowWidth:P,arrowHeight:F}),v&&Ps({strategy:"referenceHidden",...Z})]}),[T,Q]=Vn(B),z=de(C);te(()=>{J&&(z==null||z())},[J,z]);const x=(E=V.arrow)==null?void 0:E.x,_=(D=V.arrow)==null?void 0:D.y,A=((O=V.arrow)==null?void 0:O.centerOffset)!==0,[I,k]=s.useState();return te(()=>{b&&k(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:J?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:I,"--radix-popper-transform-origin":[(L=V.transformOrigin)==null?void 0:L.x,(U=V.transformOrigin)==null?void 0:U.y].join(" "),...((K=V.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(va,{scope:t,placedSide:T,onArrowChange:j,arrowX:x,arrowY:_,shouldHideArrow:A,children:d.jsx(N.div,{"data-side":T,"data-align":Q,...m,ref:y,style:{...m.style,animation:J?void 0:"none"}})})})});Bn.displayName=Xt;var Un="PopperArrow",ha={top:"bottom",right:"left",bottom:"top",left:"right"},Kn=s.forwardRef(function(n,t){const{__scopePopper:o,...r}=n,a=ma(Un,o),i=ha[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(fa,{...r,ref:t,style:{...r.style,display:"block"}})})});Kn.displayName=Un;function ga(e){return e!==null}var xa=e=>({name:"transformOrigin",options:e,fn(n){var g,b,w;const{placement:t,rects:o,middlewareData:r}=n,i=((g=r.arrow)==null?void 0:g.centerOffset)!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,f]=Vn(t),p={start:"0%",center:"50%",end:"100%"}[f],v=(((b=r.arrow)==null?void 0:b.x)??0)+c/2,h=(((w=r.arrow)==null?void 0:w.y)??0)+l/2;let C="",m="";return u==="bottom"?(C=i?p:`${v}px`,m=`${-l}px`):u==="top"?(C=i?p:`${v}px`,m=`${o.floating.height+l}px`):u==="right"?(C=`${-l}px`,m=i?p:`${h}px`):u==="left"&&(C=`${o.floating.width+l}px`,m=i?p:`${h}px`),{data:{x:C,y:m}}}});function Vn(e){const[n,t="center"]=e.split("-");return[n,t]}var lt=Fn,He=$n,ut=Bn,dt=Kn,wa="Portal",De=s.forwardRef((e,n)=>{var c;const{container:t,...o}=e,[r,a]=s.useState(!1);te(()=>a(!0),[]);const i=t||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?Ts.createPortal(d.jsx(N.div,{...o,ref:n}),i):null});De.displayName=wa;function Ca(e,n){return s.useReducer((t,o)=>n[t][o]??t,e)}var re=e=>{const{present:n,children:t}=e,o=ya(n),r=typeof t=="function"?t({present:o.isPresent}):s.Children.only(t),a=$(o.ref,ba(r));return typeof t=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};re.displayName="Presence";function ya(e){const[n,t]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),i=e?"mounted":"unmounted",[c,l]=Ca(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const u=Qe(o.current);a.current=c==="mounted"?u:"none"},[c]),te(()=>{const u=o.current,f=r.current;if(f!==e){const v=a.current,h=Qe(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&v!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),te(()=>{if(n){let u;const f=n.ownerDocument.defaultView??window,p=h=>{const m=Qe(o.current).includes(CSS.escape(h.animationName));if(h.target===n&&m&&(l("ANIMATION_END"),!r.current)){const g=n.style.animationFillMode;n.style.animationFillMode="forwards",u=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=g)})}},v=h=>{h.target===n&&(a.current=Qe(o.current))};return n.addEventListener("animationstart",v),n.addEventListener("animationcancel",p),n.addEventListener("animationend",p),()=>{f.clearTimeout(u),n.removeEventListener("animationstart",v),n.removeEventListener("animationcancel",p),n.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(u=>{o.current=u?getComputedStyle(u):null,t(u)},[])}}function Qe(e){return(e==null?void 0:e.animationName)||"none"}function ba(e){var o,r;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var _t="rovingFocusGroup.onEntryFocus",Ea={bubbles:!1,cancelable:!0},We="RovingFocusGroup",[Ot,Gn,Sa]=zt(We),[Pa,ft]=ie(We,[Sa]),[Ra,Ia]=Pa(We),Hn=s.forwardRef((e,n)=>d.jsx(Ot.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Ot.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Ta,{...e,ref:n})})}));Hn.displayName=We;var Ta=s.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,orientation:o,loop:r=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=e,v=s.useRef(null),h=$(n,v),C=it(a),[m,g]=fe({prop:i,defaultProp:c??null,onChange:l,caller:We}),[b,w]=s.useState(!1),y=de(u),R=Gn(t),j=s.useRef(!1),[M,P]=s.useState(0);return s.useEffect(()=>{const F=v.current;if(F)return F.addEventListener(_t,y),()=>F.removeEventListener(_t,y)},[y]),d.jsx(Ra,{scope:t,orientation:o,dir:C,loop:r,currentTabStopId:m,onItemFocus:s.useCallback(F=>g(F),[g]),onItemShiftTab:s.useCallback(()=>w(!0),[]),onFocusableItemAdd:s.useCallback(()=>P(F=>F+1),[]),onFocusableItemRemove:s.useCallback(()=>P(F=>F-1),[]),children:d.jsx(N.div,{tabIndex:b||M===0?-1:0,"data-orientation":o,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:S(e.onMouseDown,()=>{j.current=!0}),onFocus:S(e.onFocus,F=>{const H=!j.current;if(F.target===F.currentTarget&&H&&!b){const G=new CustomEvent(_t,Ea);if(F.currentTarget.dispatchEvent(G),!G.defaultPrevented){const Y=R().filter(B=>B.focusable),q=Y.find(B=>B.active),Z=Y.find(B=>B.id===m),X=[q,Z,...Y].filter(Boolean).map(B=>B.ref.current);Yn(X,f)}}j.current=!1}),onBlur:S(e.onBlur,()=>w(!1))})})}),Wn="RovingFocusGroupItem",zn=s.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,focusable:o=!0,active:r=!1,tabStopId:a,children:i,...c}=e,l=ee(),u=a||l,f=Ia(Wn,t),p=f.currentTabStopId===u,v=Gn(t),{onFocusableItemAdd:h,onFocusableItemRemove:C,currentTabStopId:m}=f;return s.useEffect(()=>{if(o)return h(),()=>C()},[o,h,C]),d.jsx(Ot.ItemSlot,{scope:t,id:u,focusable:o,active:r,children:d.jsx(N.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:S(e.onMouseDown,g=>{o?f.onItemFocus(u):g.preventDefault()}),onFocus:S(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:S(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const b=Aa(g,f.orientation,f.dir);if(b!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=v().filter(R=>R.focusable).map(R=>R.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const R=y.indexOf(g.currentTarget);y=f.loop?Na(y,R+1):y.slice(R+1)}setTimeout(()=>Yn(y))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:m!=null}):i})})});zn.displayName=Wn;var _a={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ma(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Aa(e,n,t){const o=Ma(e.key,t);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return _a[o]}function Yn(e,n=!1){const t=document.activeElement;for(const o of e)if(o===t||(o.focus({preventScroll:n}),document.activeElement!==t))return}function Na(e,n){return e.map((t,o)=>e[(n+o)%e.length])}var Xn=Hn,qn=zn,jt=["Enter"," "],Da=["ArrowDown","PageUp","Home"],Zn=["ArrowUp","PageDown","End"],Oa=[...Da,...Zn],ja={ltr:[...jt,"ArrowRight"],rtl:[...jt,"ArrowLeft"]},ka={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ze="Menu",[Ue,Fa,La]=zt(ze),[Re,Jn]=ie(ze,[La,me,ft]),pt=me(),Qn=ft(),[$a,Ie]=Re(ze),[Ba,Ye]=Re(ze),eo=e=>{const{__scopeMenu:n,open:t=!1,children:o,dir:r,onOpenChange:a,modal:i=!0}=e,c=pt(n),[l,u]=s.useState(null),f=s.useRef(!1),p=de(a),v=it(r);return s.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),d.jsx(lt,{...c,children:d.jsx($a,{scope:n,open:t,onOpenChange:p,content:l,onContentChange:u,children:d.jsx(Ba,{scope:n,onClose:s.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:v,modal:i,children:o})})})};eo.displayName=ze;var Ua="MenuAnchor",qt=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e,r=pt(t);return d.jsx(He,{...r,...o,ref:n})});qt.displayName=Ua;var Zt="MenuPortal",[Ka,to]=Re(Zt,{forceMount:void 0}),no=e=>{const{__scopeMenu:n,forceMount:t,children:o,container:r}=e,a=Ie(Zt,n);return d.jsx(Ka,{scope:n,forceMount:t,children:d.jsx(re,{present:t||a.open,children:d.jsx(De,{asChild:!0,container:r,children:o})})})};no.displayName=Zt;var se="MenuContent",[Va,Jt]=Re(se),oo=s.forwardRef((e,n)=>{const t=to(se,e.__scopeMenu),{forceMount:o=t.forceMount,...r}=e,a=Ie(se,e.__scopeMenu),i=Ye(se,e.__scopeMenu);return d.jsx(Ue.Provider,{scope:e.__scopeMenu,children:d.jsx(re,{present:o||a.open,children:d.jsx(Ue.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(Ga,{...r,ref:n}):d.jsx(Ha,{...r,ref:n})})})})}),Ga=s.forwardRef((e,n)=>{const t=Ie(se,e.__scopeMenu),o=s.useRef(null),r=$(n,o);return s.useEffect(()=>{const a=o.current;if(a)return at(a)},[]),d.jsx(Qt,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Ha=s.forwardRef((e,n)=>{const t=Ie(se,e.__scopeMenu);return d.jsx(Qt,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Wa=ye("MenuContent.ScrollLock"),Qt=s.forwardRef((e,n)=>{const{__scopeMenu:t,loop:o=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:v,onDismiss:h,disableOutsideScroll:C,...m}=e,g=Ie(se,t),b=Ye(se,t),w=pt(t),y=Qn(t),R=Fa(t),[j,M]=s.useState(null),P=s.useRef(null),F=$(n,P,g.onContentChange),H=s.useRef(0),G=s.useRef(""),Y=s.useRef(0),q=s.useRef(null),Z=s.useRef("right"),W=s.useRef(0),X=C?st:s.Fragment,B=C?{as:Wa,allowPinchZoom:!0}:void 0,J=T=>{var E,D;const Q=G.current+T,z=R().filter(O=>!O.disabled),x=document.activeElement,_=(E=z.find(O=>O.ref.current===x))==null?void 0:E.textValue,A=z.map(O=>O.textValue),I=ri(A,Q,_),k=(D=z.find(O=>O.textValue===I))==null?void 0:D.ref.current;(function O(L){G.current=L,window.clearTimeout(H.current),L!==""&&(H.current=window.setTimeout(()=>O(""),1e3))})(Q),k&&setTimeout(()=>k.focus())};s.useEffect(()=>()=>window.clearTimeout(H.current),[]),ct();const V=s.useCallback(T=>{var z,x;return Z.current===((z=q.current)==null?void 0:z.side)&&ai(T,(x=q.current)==null?void 0:x.area)},[]);return d.jsx(Va,{scope:t,searchRef:G,onItemEnter:s.useCallback(T=>{V(T)&&T.preventDefault()},[V]),onItemLeave:s.useCallback(T=>{var Q;V(T)||((Q=P.current)==null||Q.focus(),M(null))},[V]),onTriggerLeave:s.useCallback(T=>{V(T)&&T.preventDefault()},[V]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:s.useCallback(T=>{q.current=T},[]),children:d.jsx(X,{...B,children:d.jsx(Ge,{asChild:!0,trapped:r,onMountAutoFocus:S(a,T=>{var Q;T.preventDefault(),(Q=P.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(Ne,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:v,onDismiss:h,children:d.jsx(Xn,{asChild:!0,...y,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:j,onCurrentTabStopIdChange:M,onEntryFocus:S(l,T=>{b.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(ut,{role:"menu","aria-orientation":"vertical","data-state":Co(g.open),"data-radix-menu-content":"",dir:b.dir,...w,...m,ref:F,style:{outline:"none",...m.style},onKeyDown:S(m.onKeyDown,T=>{const z=T.target.closest("[data-radix-menu-content]")===T.currentTarget,x=T.ctrlKey||T.altKey||T.metaKey,_=T.key.length===1;z&&(T.key==="Tab"&&T.preventDefault(),!x&&_&&J(T.key));const A=P.current;if(T.target!==A||!Oa.includes(T.key))return;T.preventDefault();const k=R().filter(E=>!E.disabled).map(E=>E.ref.current);Zn.includes(T.key)&&k.reverse(),ni(k)}),onBlur:S(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(H.current),G.current="")}),onPointerMove:S(e.onPointerMove,Ke(T=>{const Q=T.target,z=W.current!==T.clientX;if(T.currentTarget.contains(Q)&&z){const x=T.clientX>W.current?"right":"left";Z.current=x,W.current=T.clientX}}))})})})})})})});oo.displayName=se;var za="MenuGroup",en=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return d.jsx(N.div,{role:"group",...o,ref:n})});en.displayName=za;var Ya="MenuLabel",ro=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return d.jsx(N.div,{...o,ref:n})});ro.displayName=Ya;var tt="MenuItem",yn="menu.itemSelect",vt=s.forwardRef((e,n)=>{const{disabled:t=!1,onSelect:o,...r}=e,a=s.useRef(null),i=Ye(tt,e.__scopeMenu),c=Jt(tt,e.__scopeMenu),l=$(n,a),u=s.useRef(!1),f=()=>{const p=a.current;if(!t&&p){const v=new CustomEvent(yn,{bubbles:!0,cancelable:!0});p.addEventListener(yn,h=>o==null?void 0:o(h),{once:!0}),_n(p,v),v.defaultPrevented?u.current=!1:i.onClose()}};return d.jsx(so,{...r,ref:l,disabled:t,onClick:S(e.onClick,f),onPointerDown:p=>{var v;(v=e.onPointerDown)==null||v.call(e,p),u.current=!0},onPointerUp:S(e.onPointerUp,p=>{var v;u.current||(v=p.currentTarget)==null||v.click()}),onKeyDown:S(e.onKeyDown,p=>{const v=c.searchRef.current!=="";t||v&&p.key===" "||jt.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});vt.displayName=tt;var so=s.forwardRef((e,n)=>{const{__scopeMenu:t,disabled:o=!1,textValue:r,...a}=e,i=Jt(tt,t),c=Qn(t),l=s.useRef(null),u=$(n,l),[f,p]=s.useState(!1),[v,h]=s.useState("");return s.useEffect(()=>{const C=l.current;C&&h((C.textContent??"").trim())},[a.children]),d.jsx(Ue.ItemSlot,{scope:t,disabled:o,textValue:r??v,children:d.jsx(qn,{asChild:!0,...c,focusable:!o,children:d.jsx(N.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:u,onPointerMove:S(e.onPointerMove,Ke(C=>{o?i.onItemLeave(C):(i.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,Ke(C=>i.onItemLeave(C))),onFocus:S(e.onFocus,()=>p(!0)),onBlur:S(e.onBlur,()=>p(!1))})})})}),Xa="MenuCheckboxItem",ao=s.forwardRef((e,n)=>{const{checked:t=!1,onCheckedChange:o,...r}=e;return d.jsx(fo,{scope:e.__scopeMenu,checked:t,children:d.jsx(vt,{role:"menuitemcheckbox","aria-checked":nt(t)?"mixed":t,...r,ref:n,"data-state":nn(t),onSelect:S(r.onSelect,()=>o==null?void 0:o(nt(t)?!0:!t),{checkForDefaultPrevented:!1})})})});ao.displayName=Xa;var io="MenuRadioGroup",[qa,Za]=Re(io,{value:void 0,onValueChange:()=>{}}),co=s.forwardRef((e,n)=>{const{value:t,onValueChange:o,...r}=e,a=de(o);return d.jsx(qa,{scope:e.__scopeMenu,value:t,onValueChange:a,children:d.jsx(en,{...r,ref:n})})});co.displayName=io;var lo="MenuRadioItem",uo=s.forwardRef((e,n)=>{const{value:t,...o}=e,r=Za(lo,e.__scopeMenu),a=t===r.value;return d.jsx(fo,{scope:e.__scopeMenu,checked:a,children:d.jsx(vt,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":nn(a),onSelect:S(o.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,t)},{checkForDefaultPrevented:!1})})})});uo.displayName=lo;var tn="MenuItemIndicator",[fo,Ja]=Re(tn,{checked:!1}),po=s.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:o,...r}=e,a=Ja(tn,t);return d.jsx(re,{present:o||nt(a.checked)||a.checked===!0,children:d.jsx(N.span,{...r,ref:n,"data-state":nn(a.checked)})})});po.displayName=tn;var Qa="MenuSeparator",vo=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return d.jsx(N.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});vo.displayName=Qa;var ei="MenuArrow",mo=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e,r=pt(t);return d.jsx(dt,{...r,...o,ref:n})});mo.displayName=ei;var ti="MenuSub",[Sl,ho]=Re(ti),$e="MenuSubTrigger",go=s.forwardRef((e,n)=>{const t=Ie($e,e.__scopeMenu),o=Ye($e,e.__scopeMenu),r=ho($e,e.__scopeMenu),a=Jt($e,e.__scopeMenu),i=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},f=s.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return s.useEffect(()=>f,[f]),s.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),l(null)}},[c,l]),d.jsx(qt,{asChild:!0,...u,children:d.jsx(so,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":Co(t.open),...e,ref:ue(n,r.onTriggerChange),onClick:p=>{var v;(v=e.onClick)==null||v.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,Ke(p=>{a.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!t.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{t.onOpenChange(!0),f()},100))})),onPointerLeave:S(e.onPointerLeave,Ke(p=>{var h,C;f();const v=(h=t.content)==null?void 0:h.getBoundingClientRect();if(v){const m=(C=t.content)==null?void 0:C.dataset.side,g=m==="right",b=g?-5:5,w=v[g?"left":"right"],y=v[g?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:w,y:v.top},{x:y,y:v.top},{x:y,y:v.bottom},{x:w,y:v.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,p=>{var h;const v=a.searchRef.current!=="";e.disabled||v&&p.key===" "||ja[o.dir].includes(p.key)&&(t.onOpenChange(!0),(h=t.content)==null||h.focus(),p.preventDefault())})})})});go.displayName=$e;var xo="MenuSubContent",wo=s.forwardRef((e,n)=>{const t=to(se,e.__scopeMenu),{forceMount:o=t.forceMount,...r}=e,a=Ie(se,e.__scopeMenu),i=Ye(se,e.__scopeMenu),c=ho(xo,e.__scopeMenu),l=s.useRef(null),u=$(n,l);return d.jsx(Ue.Provider,{scope:e.__scopeMenu,children:d.jsx(re,{present:o||a.open,children:d.jsx(Ue.Slot,{scope:e.__scopeMenu,children:d.jsx(Qt,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;i.isUsingKeyboardRef.current&&((p=l.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:S(e.onFocusOutside,f=>{f.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:S(e.onKeyDown,f=>{var h;const p=f.currentTarget.contains(f.target),v=ka[i.dir].includes(f.key);p&&v&&(a.onOpenChange(!1),(h=c.trigger)==null||h.focus(),f.preventDefault())})})})})})});wo.displayName=xo;function Co(e){return e?"open":"closed"}function nt(e){return e==="indeterminate"}function nn(e){return nt(e)?"indeterminate":e?"checked":"unchecked"}function ni(e){const n=document.activeElement;for(const t of e)if(t===n||(t.focus(),document.activeElement!==n))return}function oi(e,n){return e.map((t,o)=>e[(n+o)%e.length])}function ri(e,n,t){const r=n.length>1&&Array.from(n).every(u=>u===n[0])?n[0]:n,a=t?e.indexOf(t):-1;let i=oi(e,Math.max(a,0));r.length===1&&(i=i.filter(u=>u!==t));const l=i.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==t?l:void 0}function si(e,n){const{x:t,y:o}=e;let r=!1;for(let a=0,i=n.length-1;a<n.length;i=a++){const c=n[a],l=n[i],u=c.x,f=c.y,p=l.x,v=l.y;f>o!=v>o&&t<(p-u)*(o-f)/(v-f)+u&&(r=!r)}return r}function ai(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return si(t,n)}function Ke(e){return n=>n.pointerType==="mouse"?e(n):void 0}var ii=eo,ci=qt,li=no,ui=oo,di=en,fi=ro,pi=vt,vi=ao,mi=co,hi=uo,gi=po,xi=vo,wi=mo,Ci=go,yi=wo,mt="DropdownMenu",[bi]=ie(mt,[Jn]),ne=Jn(),[Ei,yo]=bi(mt),bo=e=>{const{__scopeDropdownMenu:n,children:t,dir:o,open:r,defaultOpen:a,onOpenChange:i,modal:c=!0}=e,l=ne(n),u=s.useRef(null),[f,p]=fe({prop:r,defaultProp:a??!1,onChange:i,caller:mt});return d.jsx(Ei,{scope:n,triggerId:ee(),triggerRef:u,contentId:ee(),open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(v=>!v),[p]),modal:c,children:d.jsx(ii,{...l,open:f,onOpenChange:p,dir:o,modal:c,children:t})})};bo.displayName=mt;var Eo="DropdownMenuTrigger",So=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,disabled:o=!1,...r}=e,a=yo(Eo,t),i=ne(t);return d.jsx(ci,{asChild:!0,...i,children:d.jsx(N.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:ue(n,a.triggerRef),onPointerDown:S(e.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(a.onOpenToggle(),a.open||c.preventDefault())}),onKeyDown:S(e.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&a.onOpenToggle(),c.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});So.displayName=Eo;var Si="DropdownMenuPortal",Po=e=>{const{__scopeDropdownMenu:n,...t}=e,o=ne(n);return d.jsx(li,{...o,...t})};Po.displayName=Si;var Ro="DropdownMenuContent",Io=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=yo(Ro,t),a=ne(t),i=s.useRef(!1);return d.jsx(ui,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...o,ref:n,onCloseAutoFocus:S(e.onCloseAutoFocus,c=>{var l;i.current||(l=r.triggerRef.current)==null||l.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:S(e.onInteractOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Io.displayName=Ro;var Pi="DropdownMenuGroup",Ri=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(di,{...r,...o,ref:n})});Ri.displayName=Pi;var Ii="DropdownMenuLabel",To=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(fi,{...r,...o,ref:n})});To.displayName=Ii;var Ti="DropdownMenuItem",_o=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(pi,{...r,...o,ref:n})});_o.displayName=Ti;var _i="DropdownMenuCheckboxItem",Mo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(vi,{...r,...o,ref:n})});Mo.displayName=_i;var Mi="DropdownMenuRadioGroup",Ao=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(mi,{...r,...o,ref:n})});Ao.displayName=Mi;var Ai="DropdownMenuRadioItem",No=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(hi,{...r,...o,ref:n})});No.displayName=Ai;var Ni="DropdownMenuItemIndicator",Do=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(gi,{...r,...o,ref:n})});Do.displayName=Ni;var Di="DropdownMenuSeparator",Oo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(xi,{...r,...o,ref:n})});Oo.displayName=Di;var Oi="DropdownMenuArrow",ji=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(wi,{...r,...o,ref:n})});ji.displayName=Oi;var ki="DropdownMenuSubTrigger",jo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(Ci,{...r,...o,ref:n})});jo.displayName=ki;var Fi="DropdownMenuSubContent",ko=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(yi,{...r,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ko.displayName=Fi;var Pl=bo,Rl=So,Il=Po,Tl=Io,_l=To,Ml=_o,Al=Mo,Nl=Ao,Dl=No,Ol=Do,jl=Oo,kl=jo,Fl=ko,Fo=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Li="VisuallyHidden",Lo=s.forwardRef((e,n)=>d.jsx(N.span,{...e,ref:n,style:{...Fo,...e.style}}));Lo.displayName=Li;var $i=Lo,[ht]=ie("Tooltip",[me]),gt=me(),$o="TooltipProvider",Bi=700,kt="tooltip.open",[Ui,on]=ht($o),Bo=e=>{const{__scopeTooltip:n,delayDuration:t=Bi,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:a}=e,i=s.useRef(!0),c=s.useRef(!1),l=s.useRef(0);return s.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),d.jsx(Ui,{scope:n,isOpenDelayedRef:i,delayDuration:t,onOpen:s.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:a})};Bo.displayName=$o;var Ve="Tooltip",[Ki,Xe]=ht(Ve),Uo=e=>{const{__scopeTooltip:n,children:t,open:o,defaultOpen:r,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,l=on(Ve,e.__scopeTooltip),u=gt(n),[f,p]=s.useState(null),v=ee(),h=s.useRef(0),C=i??l.disableHoverableContent,m=c??l.delayDuration,g=s.useRef(!1),[b,w]=fe({prop:o,defaultProp:r??!1,onChange:P=>{P?(l.onOpen(),document.dispatchEvent(new CustomEvent(kt))):l.onClose(),a==null||a(P)},caller:Ve}),y=s.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),R=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,w(!0)},[w]),j=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),M=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,w(!0),h.current=0},m)},[m,w]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),d.jsx(lt,{...u,children:d.jsx(Ki,{scope:n,contentId:v,open:b,stateAttribute:y,trigger:f,onTriggerChange:p,onTriggerEnter:s.useCallback(()=>{l.isOpenDelayedRef.current?M():R()},[l.isOpenDelayedRef,M,R]),onTriggerLeave:s.useCallback(()=>{C?j():(window.clearTimeout(h.current),h.current=0)},[j,C]),onOpen:R,onClose:j,disableHoverableContent:C,children:t})})};Uo.displayName=Ve;var Ft="TooltipTrigger",Ko=s.forwardRef((e,n)=>{const{__scopeTooltip:t,...o}=e,r=Xe(Ft,t),a=on(Ft,t),i=gt(t),c=s.useRef(null),l=$(n,c,r.onTriggerChange),u=s.useRef(!1),f=s.useRef(!1),p=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.jsx(He,{asChild:!0,...i,children:d.jsx(N.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:S(e.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:S(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:S(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:S(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:S(e.onBlur,r.onClose),onClick:S(e.onClick,r.onClose)})})});Ko.displayName=Ft;var rn="TooltipPortal",[Vi,Gi]=ht(rn,{forceMount:void 0}),Vo=e=>{const{__scopeTooltip:n,forceMount:t,children:o,container:r}=e,a=Xe(rn,n);return d.jsx(Vi,{scope:n,forceMount:t,children:d.jsx(re,{present:t||a.open,children:d.jsx(De,{asChild:!0,container:r,children:o})})})};Vo.displayName=rn;var Me="TooltipContent",Go=s.forwardRef((e,n)=>{const t=Gi(Me,e.__scopeTooltip),{forceMount:o=t.forceMount,side:r="top",...a}=e,i=Xe(Me,e.__scopeTooltip);return d.jsx(re,{present:o||i.open,children:i.disableHoverableContent?d.jsx(Ho,{side:r,...a,ref:n}):d.jsx(Hi,{side:r,...a,ref:n})})}),Hi=s.forwardRef((e,n)=>{const t=Xe(Me,e.__scopeTooltip),o=on(Me,e.__scopeTooltip),r=s.useRef(null),a=$(n,r),[i,c]=s.useState(null),{trigger:l,onClose:u}=t,f=r.current,{onPointerInTransitChange:p}=o,v=s.useCallback(()=>{c(null),p(!1)},[p]),h=s.useCallback((C,m)=>{const g=C.currentTarget,b={x:C.clientX,y:C.clientY},w=qi(b,g.getBoundingClientRect()),y=Zi(b,w),R=Ji(m.getBoundingClientRect()),j=ec([...y,...R]);c(j),p(!0)},[p]);return s.useEffect(()=>()=>v(),[v]),s.useEffect(()=>{if(l&&f){const C=g=>h(g,f),m=g=>h(g,l);return l.addEventListener("pointerleave",C),f.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",C),f.removeEventListener("pointerleave",m)}}},[l,f,h,v]),s.useEffect(()=>{if(i){const C=m=>{const g=m.target,b={x:m.clientX,y:m.clientY},w=(l==null?void 0:l.contains(g))||(f==null?void 0:f.contains(g)),y=!Qi(b,i);w?v():y&&(v(),u())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[l,f,i,u,v]),d.jsx(Ho,{...e,ref:a})}),[Wi,zi]=ht(Ve,{isInside:!1}),Yi=Ks("TooltipContent"),Ho=s.forwardRef((e,n)=>{const{__scopeTooltip:t,children:o,"aria-label":r,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,l=Xe(Me,t),u=gt(t),{onClose:f}=l;return s.useEffect(()=>(document.addEventListener(kt,f),()=>document.removeEventListener(kt,f)),[f]),s.useEffect(()=>{if(l.trigger){const p=v=>{const h=v.target;h!=null&&h.contains(l.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,f]),d.jsx(Ne,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:d.jsxs(ut,{"data-state":l.stateAttribute,...u,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(Yi,{children:o}),d.jsx(Wi,{scope:t,isInside:!0,children:d.jsx($i,{id:l.contentId,role:"tooltip",children:r||o})})]})})});Go.displayName=Me;var Wo="TooltipArrow",Xi=s.forwardRef((e,n)=>{const{__scopeTooltip:t,...o}=e,r=gt(t);return zi(Wo,t).isInside?null:d.jsx(dt,{...r,...o,ref:n})});Xi.displayName=Wo;function qi(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),a=Math.abs(n.left-e.x);switch(Math.min(t,o,r,a)){case a:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zi(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function Ji(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Qi(e,n){const{x:t,y:o}=e;let r=!1;for(let a=0,i=n.length-1;a<n.length;i=a++){const c=n[a],l=n[i],u=c.x,f=c.y,p=l.x,v=l.y;f>o!=v>o&&t<(p-u)*(o-f)/(v-f)+u&&(r=!r)}return r}function ec(e){const n=e.slice();return n.sort((t,o)=>t.x<o.x?-1:t.x>o.x?1:t.y<o.y?-1:t.y>o.y?1:0),tc(n)}function tc(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o<e.length;o++){const r=e[o];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var Ll=Bo,$l=Uo,Bl=Ko,Ul=Vo,Kl=Go,xt="Dialog",[zo]=ie(xt),[nc,ce]=zo(xt),Yo=e=>{const{__scopeDialog:n,children:t,open:o,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,c=s.useRef(null),l=s.useRef(null),[u,f]=fe({prop:o,defaultProp:r??!1,onChange:a,caller:xt});return d.jsx(nc,{scope:n,triggerRef:c,contentRef:l,contentId:ee(),titleId:ee(),descriptionId:ee(),open:u,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(p=>!p),[f]),modal:i,children:t})};Yo.displayName=xt;var Xo="DialogTrigger",oc=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(Xo,t),a=$(n,r.triggerRef);return d.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":cn(r.open),...o,ref:a,onClick:S(e.onClick,r.onOpenToggle)})});oc.displayName=Xo;var sn="DialogPortal",[rc,qo]=zo(sn,{forceMount:void 0}),Zo=e=>{const{__scopeDialog:n,forceMount:t,children:o,container:r}=e,a=ce(sn,n);return d.jsx(rc,{scope:n,forceMount:t,children:s.Children.map(o,i=>d.jsx(re,{present:t||a.open,children:d.jsx(De,{asChild:!0,container:r,children:i})}))})};Zo.displayName=sn;var ot="DialogOverlay",Jo=s.forwardRef((e,n)=>{const t=qo(ot,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,a=ce(ot,e.__scopeDialog);return a.modal?d.jsx(re,{present:o||a.open,children:d.jsx(ac,{...r,ref:n})}):null});Jo.displayName=ot;var sc=ye("DialogOverlay.RemoveScroll"),ac=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(ot,t);return d.jsx(st,{as:sc,allowPinchZoom:!0,shards:[r.contentRef],children:d.jsx(N.div,{"data-state":cn(r.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),be="DialogContent",Qo=s.forwardRef((e,n)=>{const t=qo(be,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,a=ce(be,e.__scopeDialog);return d.jsx(re,{present:o||a.open,children:a.modal?d.jsx(ic,{...r,ref:n}):d.jsx(cc,{...r,ref:n})})});Qo.displayName=be;var ic=s.forwardRef((e,n)=>{const t=ce(be,e.__scopeDialog),o=s.useRef(null),r=$(n,t.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return at(a)},[]),d.jsx(er,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:S(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=t.triggerRef.current)==null||i.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:S(e.onFocusOutside,a=>a.preventDefault())})}),cc=s.forwardRef((e,n)=>{const t=ce(be,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return d.jsx(er,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(o.current||(c=t.triggerRef.current)==null||c.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;((u=t.triggerRef.current)==null?void 0:u.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),er=s.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,c=ce(be,t),l=s.useRef(null),u=$(n,l);return ct(),d.jsxs(d.Fragment,{children:[d.jsx(Ge,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:d.jsx(Ne,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":cn(c.open),...i,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(lc,{titleId:c.titleId}),d.jsx(dc,{contentRef:l,descriptionId:c.descriptionId})]})]})}),an="DialogTitle",tr=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(an,t);return d.jsx(N.h2,{id:r.titleId,...o,ref:n})});tr.displayName=an;var nr="DialogDescription",or=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(nr,t);return d.jsx(N.p,{id:r.descriptionId,...o,ref:n})});or.displayName=nr;var rr="DialogClose",sr=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(rr,t);return d.jsx(N.button,{type:"button",...o,ref:n,onClick:S(e.onClick,()=>r.onOpenChange(!1))})});sr.displayName=rr;function cn(e){return e?"open":"closed"}var ar="DialogTitleWarning",[Vl,ir]=ks(ar,{contentName:be,titleName:an,docsSlug:"dialog"}),lc=({titleId:e})=>{const n=ir(ar),t=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
1
+ import{r as s,j as d,R as Ht,t as Wt,u as Ce,v as ws,w as Cs,x as ys,y as bs,z as Es,B as Ss,C as Ps,D as Rs,F as Is,G as Ts,H as st,J as at}from"./vendor-C-lQMZp3.js";function pn(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function ue(...e){return n=>{let t=!1;const o=e.map(r=>{const a=pn(r,n);return!t&&typeof a=="function"&&(t=!0),a});if(t)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():pn(e[r],null)}}}}function $(...e){return s.useCallback(ue(...e),e)}var _s=Symbol.for("react.lazy"),et=Ht[" use ".trim().toString()];function Ms(e){return typeof e=="object"&&e!==null&&"then"in e}function Rn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===_s&&"_payload"in e&&Ms(e._payload)}function In(e){const n=As(e),t=s.forwardRef((o,r)=>{let{children:a,...i}=o;Rn(a)&&typeof et=="function"&&(a=et(a._payload));const c=s.Children.toArray(a),l=c.find(Ds);if(l){const u=l.props.children,f=c.map(p=>p===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:p);return d.jsx(n,{...i,ref:r,children:s.isValidElement(u)?s.cloneElement(u,void 0,f):null})}return d.jsx(n,{...i,ref:r,children:a})});return t.displayName=`${e}.Slot`,t}var El=In("Slot");function As(e){const n=s.forwardRef((t,o)=>{let{children:r,...a}=t;if(Rn(r)&&typeof et=="function"&&(r=et(r._payload)),s.isValidElement(r)){const i=js(r),c=Os(a,r.props);return r.type!==s.Fragment&&(c.ref=o?ue(o,i):i),s.cloneElement(r,c)}return s.Children.count(r)>1?s.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Ns=Symbol("radix.slottable");function Ds(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ns}function Os(e,n){const t={...n};for(const o in n){const r=e[o],a=n[o];/^on[A-Z]/.test(o)?r&&a?t[o]=(...c)=>{const l=a(...c);return r(...c),l}:r&&(t[o]=r):o==="style"?t[o]={...r,...a}:o==="className"&&(t[o]=[r,a].filter(Boolean).join(" "))}return{...e,...t}}function js(e){var o,r;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}function S(e,n,{checkForDefaultPrevented:t=!0}={}){return function(r){if(e==null||e(r),t===!1||!r.defaultPrevented)return n==null?void 0:n(r)}}function ks(e,n){const t=s.createContext(n),o=a=>{const{children:i,...c}=a,l=s.useMemo(()=>c,Object.values(c));return d.jsx(t.Provider,{value:l,children:i})};o.displayName=e+"Provider";function r(a){const i=s.useContext(t);if(i)return i;if(n!==void 0)return n;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function ie(e,n=[]){let t=[];function o(a,i){const c=s.createContext(i),l=t.length;t=[...t,i];const u=p=>{var b;const{scope:v,children:h,...C}=p,m=((b=v==null?void 0:v[e])==null?void 0:b[l])||c,g=s.useMemo(()=>C,Object.values(C));return d.jsx(m.Provider,{value:g,children:h})};u.displayName=a+"Provider";function f(p,v){var m;const h=((m=v==null?void 0:v[e])==null?void 0:m[l])||c,C=s.useContext(h);if(C)return C;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[u,f]}const r=()=>{const a=t.map(i=>s.createContext(i));return function(c){const l=(c==null?void 0:c[e])||a;return s.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,Fs(r,...n)]}function Fs(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const i=o.reduce((c,{useScope:l,scopeName:u})=>{const p=l(a)[`__scope${u}`];return{...c,...p}},{});return s.useMemo(()=>({[`__scope${n.scopeName}`]:i}),[i])}};return t.scopeName=n.scopeName,t}var te=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},Ls=Ht[" useInsertionEffect ".trim().toString()]||te;function fe({prop:e,defaultProp:n,onChange:t=()=>{},caller:o}){const[r,a,i]=$s({defaultProp:n,onChange:t}),c=e!==void 0,l=c?e:r;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const p=f.current;p!==c&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,o])}const u=s.useCallback(f=>{var p;if(c){const v=Bs(f)?f(e):f;v!==e&&((p=i.current)==null||p.call(i,v))}else a(f)},[c,e,a,i]);return[l,u]}function $s({defaultProp:e,onChange:n}){const[t,o]=s.useState(e),r=s.useRef(t),a=s.useRef(n);return Ls(()=>{a.current=n},[n]),s.useEffect(()=>{var i;r.current!==t&&((i=a.current)==null||i.call(a,t),r.current=t)},[t,r]),[t,o,a]}function Bs(e){return typeof e=="function"}function ye(e){const n=Us(e),t=s.forwardRef((o,r)=>{const{children:a,...i}=o,c=s.Children.toArray(a),l=c.find(Vs);if(l){const u=l.props.children,f=c.map(p=>p===l?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:p);return d.jsx(n,{...i,ref:r,children:s.isValidElement(u)?s.cloneElement(u,void 0,f):null})}return d.jsx(n,{...i,ref:r,children:a})});return t.displayName=`${e}.Slot`,t}function Us(e){const n=s.forwardRef((t,o)=>{const{children:r,...a}=t;if(s.isValidElement(r)){const i=Hs(r),c=Gs(a,r.props);return r.type!==s.Fragment&&(c.ref=o?ue(o,i):i),s.cloneElement(r,c)}return s.Children.count(r)>1?s.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Tn=Symbol("radix.slottable");function Ks(e){const n=({children:t})=>d.jsx(d.Fragment,{children:t});return n.displayName=`${e}.Slottable`,n.__radixId=Tn,n}function Vs(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tn}function Gs(e,n){const t={...n};for(const o in n){const r=e[o],a=n[o];/^on[A-Z]/.test(o)?r&&a?t[o]=(...c)=>{const l=a(...c);return r(...c),l}:r&&(t[o]=r):o==="style"?t[o]={...r,...a}:o==="className"&&(t[o]=[r,a].filter(Boolean).join(" "))}return{...e,...t}}function Hs(e){var o,r;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var Ws=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],N=Ws.reduce((e,n)=>{const t=ye(`Primitive.${n}`),o=s.forwardRef((r,a)=>{const{asChild:i,...c}=r,l=i?t:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...c,ref:a})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function _n(e,n){e&&Wt.flushSync(()=>e.dispatchEvent(n))}function zt(e){const n=e+"CollectionProvider",[t,o]=ie(n),[r,a]=t(n,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:b}=m,w=Ce.useRef(null),y=Ce.useRef(new Map).current;return d.jsx(r,{scope:g,itemMap:y,collectionRef:w,children:b})};i.displayName=n;const c=e+"CollectionSlot",l=ye(c),u=Ce.forwardRef((m,g)=>{const{scope:b,children:w}=m,y=a(c,b),R=$(g,y.collectionRef);return d.jsx(l,{ref:R,children:w})});u.displayName=c;const f=e+"CollectionItemSlot",p="data-radix-collection-item",v=ye(f),h=Ce.forwardRef((m,g)=>{const{scope:b,children:w,...y}=m,R=Ce.useRef(null),j=$(g,R),M=a(f,b);return Ce.useEffect(()=>(M.itemMap.set(R,{ref:R,...y}),()=>void M.itemMap.delete(R))),d.jsx(v,{[p]:"",ref:j,children:w})});h.displayName=f;function C(m){const g=a(e+"CollectionConsumer",m);return Ce.useCallback(()=>{const w=g.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((M,P)=>y.indexOf(M.ref.current)-y.indexOf(P.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},C,o]}var zs=s.createContext(void 0);function it(e){const n=s.useContext(zs);return e||n||"ltr"}function de(e){const n=s.useRef(e);return s.useEffect(()=>{n.current=e}),s.useMemo(()=>(...t)=>{var o;return(o=n.current)==null?void 0:o.call(n,...t)},[])}function Ys(e,n=globalThis==null?void 0:globalThis.document){const t=de(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&t(r)};return n.addEventListener("keydown",o,{capture:!0}),()=>n.removeEventListener("keydown",o,{capture:!0})},[t,n])}var Xs="DismissableLayer",Dt="dismissableLayer.update",qs="dismissableLayer.pointerDownOutside",Zs="dismissableLayer.focusOutside",vn,Mn=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ne=s.forwardRef((e,n)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:c,...l}=e,u=s.useContext(Mn),[f,p]=s.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=s.useState({}),C=$(n,P=>p(P)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(g),w=f?m.indexOf(f):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,R=w>=b,j=ea(P=>{const F=P.target,H=[...u.branches].some(G=>G.contains(F));!R||H||(r==null||r(P),i==null||i(P),P.defaultPrevented||c==null||c())},v),M=ta(P=>{const F=P.target;[...u.branches].some(G=>G.contains(F))||(a==null||a(P),i==null||i(P),P.defaultPrevented||c==null||c())},v);return Ys(P=>{w===u.layers.size-1&&(o==null||o(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))},v),s.useEffect(()=>{if(f)return t&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(vn=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),mn(),()=>{t&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=vn)}},[f,v,t,u]),s.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),mn())},[f,u]),s.useEffect(()=>{const P=()=>h({});return document.addEventListener(Dt,P),()=>document.removeEventListener(Dt,P)},[]),d.jsx(N.div,{...l,ref:C,style:{pointerEvents:y?R?"auto":"none":void 0,...e.style},onFocusCapture:S(e.onFocusCapture,M.onFocusCapture),onBlurCapture:S(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:S(e.onPointerDownCapture,j.onPointerDownCapture)})});Ne.displayName=Xs;var Js="DismissableLayerBranch",Qs=s.forwardRef((e,n)=>{const t=s.useContext(Mn),o=s.useRef(null),r=$(n,o);return s.useEffect(()=>{const a=o.current;if(a)return t.branches.add(a),()=>{t.branches.delete(a)}},[t.branches]),d.jsx(N.div,{...e,ref:r})});Qs.displayName=Js;function ea(e,n=globalThis==null?void 0:globalThis.document){const t=de(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=c=>{if(c.target&&!o.current){let l=function(){An(qs,t,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(n.removeEventListener("click",r.current),r.current=l,n.addEventListener("click",r.current,{once:!0})):l()}else n.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{n.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),n.removeEventListener("pointerdown",a),n.removeEventListener("click",r.current)}},[n,t]),{onPointerDownCapture:()=>o.current=!0}}function ta(e,n=globalThis==null?void 0:globalThis.document){const t=de(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&An(Zs,t,{originalEvent:a},{discrete:!1})};return n.addEventListener("focusin",r),()=>n.removeEventListener("focusin",r)},[n,t]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function mn(){const e=new CustomEvent(Dt);document.dispatchEvent(e)}function An(e,n,t,{discrete:o}){const r=t.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&r.addEventListener(e,n,{once:!0}),o?_n(r,a):r.dispatchEvent(a)}var Rt=0;function ct(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hn()),document.body.insertAdjacentElement("beforeend",e[1]??hn()),Rt++,()=>{Rt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Rt--}},[])}function hn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var It="focusScope.autoFocusOnMount",Tt="focusScope.autoFocusOnUnmount",gn={bubbles:!1,cancelable:!0},na="FocusScope",Ge=s.forwardRef((e,n)=>{const{loop:t=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...i}=e,[c,l]=s.useState(null),u=de(r),f=de(a),p=s.useRef(null),v=$(n,m=>l(m)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let m=function(y){if(h.paused||!c)return;const R=y.target;c.contains(R)?p.current=R:pe(p.current,{select:!0})},g=function(y){if(h.paused||!c)return;const R=y.relatedTarget;R!==null&&(c.contains(R)||pe(p.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const j of y)j.removedNodes.length>0&&pe(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const w=new MutationObserver(b);return c&&w.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),w.disconnect()}}},[o,c,h.paused]),s.useEffect(()=>{if(c){wn.add(h);const m=document.activeElement;if(!c.contains(m)){const b=new CustomEvent(It,gn);c.addEventListener(It,u),c.dispatchEvent(b),b.defaultPrevented||(oa(ca(Nn(c)),{select:!0}),document.activeElement===m&&pe(c))}return()=>{c.removeEventListener(It,u),setTimeout(()=>{const b=new CustomEvent(Tt,gn);c.addEventListener(Tt,f),c.dispatchEvent(b),b.defaultPrevented||pe(m??document.body,{select:!0}),c.removeEventListener(Tt,f),wn.remove(h)},0)}}},[c,u,f,h]);const C=s.useCallback(m=>{if(!t&&!o||h.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(g&&b){const w=m.currentTarget,[y,R]=ra(w);y&&R?!m.shiftKey&&b===R?(m.preventDefault(),t&&pe(y,{select:!0})):m.shiftKey&&b===y&&(m.preventDefault(),t&&pe(R,{select:!0})):b===w&&m.preventDefault()}},[t,o,h.paused]);return d.jsx(N.div,{tabIndex:-1,...i,ref:v,onKeyDown:C})});Ge.displayName=na;function oa(e,{select:n=!1}={}){const t=document.activeElement;for(const o of e)if(pe(o,{select:n}),document.activeElement!==t)return}function ra(e){const n=Nn(e),t=xn(n,e),o=xn(n.reverse(),e);return[t,o]}function Nn(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function xn(e,n){for(const t of e)if(!sa(t,{upTo:n}))return t}function sa(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function aa(e){return e instanceof HTMLInputElement&&"select"in e}function pe(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&aa(e)&&n&&e.select()}}var wn=ia();function ia(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=Cn(e,n),e.unshift(n)},remove(n){var t;e=Cn(e,n),(t=e[0])==null||t.resume()}}}function Cn(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function ca(e){return e.filter(n=>n.tagName!=="A")}var la=Ht[" useId ".trim().toString()]||(()=>{}),ua=0;function ee(e){const[n,t]=s.useState(la());return te(()=>{t(o=>o??String(ua++))},[e]),e||(n?`radix-${n}`:"")}var da="Arrow",Dn=s.forwardRef((e,n)=>{const{children:t,width:o=10,height:r=5,...a}=e;return d.jsx(N.svg,{...a,ref:n,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?t:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});Dn.displayName=da;var fa=Dn;function On(e){const[n,t]=s.useState(void 0);return te(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let i,c;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,c=u.blockSize}else i=e.offsetWidth,c=e.offsetHeight;t({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0)},[e]),n}var Yt="Popper",[jn,me]=ie(Yt),[pa,kn]=jn(Yt),Fn=e=>{const{__scopePopper:n,children:t}=e,[o,r]=s.useState(null);return d.jsx(pa,{scope:n,anchor:o,onAnchorChange:r,children:t})};Fn.displayName=Yt;var Ln="PopperAnchor",$n=s.forwardRef((e,n)=>{const{__scopePopper:t,virtualRef:o,...r}=e,a=kn(Ln,t),i=s.useRef(null),c=$(n,i),l=s.useRef(null);return s.useEffect(()=>{const u=l.current;l.current=(o==null?void 0:o.current)||i.current,u!==l.current&&a.onAnchorChange(l.current)}),o?null:d.jsx(N.div,{...r,ref:c})});$n.displayName=Ln;var Xt="PopperContent",[va,ma]=jn(Xt),Bn=s.forwardRef((e,n)=>{var E,D,O,L,U,K;const{__scopePopper:t,side:o="bottom",sideOffset:r=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:h="optimized",onPlaced:C,...m}=e,g=kn(Xt,t),[b,w]=s.useState(null),y=$(n,oe=>w(oe)),[R,j]=s.useState(null),M=On(R),P=(M==null?void 0:M.width)??0,F=(M==null?void 0:M.height)??0,H=o+(a!=="center"?"-"+a:""),G=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},Y=Array.isArray(u)?u:[u],q=Y.length>0,Z={padding:G,boundary:Y.filter(ga),altBoundary:q},{refs:W,floatingStyles:X,placement:B,isPositioned:J,middlewareData:V}=ws({strategy:"fixed",placement:H,whileElementsMounted:(...oe)=>Rs(...oe,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[Cs({mainAxis:r+F,alignmentAxis:i}),l&&ys({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Is():void 0,...Z}),l&&bs({...Z}),Es({...Z,apply:({elements:oe,rects:le,availableWidth:je,availableHeight:ke})=>{const{width:Fe,height:xs}=le.reference,Je=oe.floating.style;Je.setProperty("--radix-popper-available-width",`${je}px`),Je.setProperty("--radix-popper-available-height",`${ke}px`),Je.setProperty("--radix-popper-anchor-width",`${Fe}px`),Je.setProperty("--radix-popper-anchor-height",`${xs}px`)}}),R&&Ss({element:R,padding:c}),xa({arrowWidth:P,arrowHeight:F}),v&&Ps({strategy:"referenceHidden",...Z})]}),[T,Q]=Vn(B),z=de(C);te(()=>{J&&(z==null||z())},[J,z]);const x=(E=V.arrow)==null?void 0:E.x,_=(D=V.arrow)==null?void 0:D.y,A=((O=V.arrow)==null?void 0:O.centerOffset)!==0,[I,k]=s.useState();return te(()=>{b&&k(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:J?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:I,"--radix-popper-transform-origin":[(L=V.transformOrigin)==null?void 0:L.x,(U=V.transformOrigin)==null?void 0:U.y].join(" "),...((K=V.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(va,{scope:t,placedSide:T,onArrowChange:j,arrowX:x,arrowY:_,shouldHideArrow:A,children:d.jsx(N.div,{"data-side":T,"data-align":Q,...m,ref:y,style:{...m.style,animation:J?void 0:"none"}})})})});Bn.displayName=Xt;var Un="PopperArrow",ha={top:"bottom",right:"left",bottom:"top",left:"right"},Kn=s.forwardRef(function(n,t){const{__scopePopper:o,...r}=n,a=ma(Un,o),i=ha[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(fa,{...r,ref:t,style:{...r.style,display:"block"}})})});Kn.displayName=Un;function ga(e){return e!==null}var xa=e=>({name:"transformOrigin",options:e,fn(n){var g,b,w;const{placement:t,rects:o,middlewareData:r}=n,i=((g=r.arrow)==null?void 0:g.centerOffset)!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,f]=Vn(t),p={start:"0%",center:"50%",end:"100%"}[f],v=(((b=r.arrow)==null?void 0:b.x)??0)+c/2,h=(((w=r.arrow)==null?void 0:w.y)??0)+l/2;let C="",m="";return u==="bottom"?(C=i?p:`${v}px`,m=`${-l}px`):u==="top"?(C=i?p:`${v}px`,m=`${o.floating.height+l}px`):u==="right"?(C=`${-l}px`,m=i?p:`${h}px`):u==="left"&&(C=`${o.floating.width+l}px`,m=i?p:`${h}px`),{data:{x:C,y:m}}}});function Vn(e){const[n,t="center"]=e.split("-");return[n,t]}var lt=Fn,He=$n,ut=Bn,dt=Kn,wa="Portal",De=s.forwardRef((e,n)=>{var c;const{container:t,...o}=e,[r,a]=s.useState(!1);te(()=>a(!0),[]);const i=t||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?Ts.createPortal(d.jsx(N.div,{...o,ref:n}),i):null});De.displayName=wa;function Ca(e,n){return s.useReducer((t,o)=>n[t][o]??t,e)}var re=e=>{const{present:n,children:t}=e,o=ya(n),r=typeof t=="function"?t({present:o.isPresent}):s.Children.only(t),a=$(o.ref,ba(r));return typeof t=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};re.displayName="Presence";function ya(e){const[n,t]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),i=e?"mounted":"unmounted",[c,l]=Ca(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const u=Qe(o.current);a.current=c==="mounted"?u:"none"},[c]),te(()=>{const u=o.current,f=r.current;if(f!==e){const v=a.current,h=Qe(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&v!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),te(()=>{if(n){let u;const f=n.ownerDocument.defaultView??window,p=h=>{const m=Qe(o.current).includes(CSS.escape(h.animationName));if(h.target===n&&m&&(l("ANIMATION_END"),!r.current)){const g=n.style.animationFillMode;n.style.animationFillMode="forwards",u=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=g)})}},v=h=>{h.target===n&&(a.current=Qe(o.current))};return n.addEventListener("animationstart",v),n.addEventListener("animationcancel",p),n.addEventListener("animationend",p),()=>{f.clearTimeout(u),n.removeEventListener("animationstart",v),n.removeEventListener("animationcancel",p),n.removeEventListener("animationend",p)}}else l("ANIMATION_END")},[n,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:s.useCallback(u=>{o.current=u?getComputedStyle(u):null,t(u)},[])}}function Qe(e){return(e==null?void 0:e.animationName)||"none"}function ba(e){var o,r;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var _t="rovingFocusGroup.onEntryFocus",Ea={bubbles:!1,cancelable:!0},We="RovingFocusGroup",[Ot,Gn,Sa]=zt(We),[Pa,ft]=ie(We,[Sa]),[Ra,Ia]=Pa(We),Hn=s.forwardRef((e,n)=>d.jsx(Ot.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Ot.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Ta,{...e,ref:n})})}));Hn.displayName=We;var Ta=s.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,orientation:o,loop:r=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=e,v=s.useRef(null),h=$(n,v),C=it(a),[m,g]=fe({prop:i,defaultProp:c??null,onChange:l,caller:We}),[b,w]=s.useState(!1),y=de(u),R=Gn(t),j=s.useRef(!1),[M,P]=s.useState(0);return s.useEffect(()=>{const F=v.current;if(F)return F.addEventListener(_t,y),()=>F.removeEventListener(_t,y)},[y]),d.jsx(Ra,{scope:t,orientation:o,dir:C,loop:r,currentTabStopId:m,onItemFocus:s.useCallback(F=>g(F),[g]),onItemShiftTab:s.useCallback(()=>w(!0),[]),onFocusableItemAdd:s.useCallback(()=>P(F=>F+1),[]),onFocusableItemRemove:s.useCallback(()=>P(F=>F-1),[]),children:d.jsx(N.div,{tabIndex:b||M===0?-1:0,"data-orientation":o,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:S(e.onMouseDown,()=>{j.current=!0}),onFocus:S(e.onFocus,F=>{const H=!j.current;if(F.target===F.currentTarget&&H&&!b){const G=new CustomEvent(_t,Ea);if(F.currentTarget.dispatchEvent(G),!G.defaultPrevented){const Y=R().filter(B=>B.focusable),q=Y.find(B=>B.active),Z=Y.find(B=>B.id===m),X=[q,Z,...Y].filter(Boolean).map(B=>B.ref.current);Yn(X,f)}}j.current=!1}),onBlur:S(e.onBlur,()=>w(!1))})})}),Wn="RovingFocusGroupItem",zn=s.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,focusable:o=!0,active:r=!1,tabStopId:a,children:i,...c}=e,l=ee(),u=a||l,f=Ia(Wn,t),p=f.currentTabStopId===u,v=Gn(t),{onFocusableItemAdd:h,onFocusableItemRemove:C,currentTabStopId:m}=f;return s.useEffect(()=>{if(o)return h(),()=>C()},[o,h,C]),d.jsx(Ot.ItemSlot,{scope:t,id:u,focusable:o,active:r,children:d.jsx(N.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:S(e.onMouseDown,g=>{o?f.onItemFocus(u):g.preventDefault()}),onFocus:S(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:S(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const b=Aa(g,f.orientation,f.dir);if(b!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=v().filter(R=>R.focusable).map(R=>R.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const R=y.indexOf(g.currentTarget);y=f.loop?Na(y,R+1):y.slice(R+1)}setTimeout(()=>Yn(y))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:m!=null}):i})})});zn.displayName=Wn;var _a={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ma(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Aa(e,n,t){const o=Ma(e.key,t);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return _a[o]}function Yn(e,n=!1){const t=document.activeElement;for(const o of e)if(o===t||(o.focus({preventScroll:n}),document.activeElement!==t))return}function Na(e,n){return e.map((t,o)=>e[(n+o)%e.length])}var Xn=Hn,qn=zn,jt=["Enter"," "],Da=["ArrowDown","PageUp","Home"],Zn=["ArrowUp","PageDown","End"],Oa=[...Da,...Zn],ja={ltr:[...jt,"ArrowRight"],rtl:[...jt,"ArrowLeft"]},ka={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ze="Menu",[Ue,Fa,La]=zt(ze),[Re,Jn]=ie(ze,[La,me,ft]),pt=me(),Qn=ft(),[$a,Ie]=Re(ze),[Ba,Ye]=Re(ze),eo=e=>{const{__scopeMenu:n,open:t=!1,children:o,dir:r,onOpenChange:a,modal:i=!0}=e,c=pt(n),[l,u]=s.useState(null),f=s.useRef(!1),p=de(a),v=it(r);return s.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),d.jsx(lt,{...c,children:d.jsx($a,{scope:n,open:t,onOpenChange:p,content:l,onContentChange:u,children:d.jsx(Ba,{scope:n,onClose:s.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:v,modal:i,children:o})})})};eo.displayName=ze;var Ua="MenuAnchor",qt=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e,r=pt(t);return d.jsx(He,{...r,...o,ref:n})});qt.displayName=Ua;var Zt="MenuPortal",[Ka,to]=Re(Zt,{forceMount:void 0}),no=e=>{const{__scopeMenu:n,forceMount:t,children:o,container:r}=e,a=Ie(Zt,n);return d.jsx(Ka,{scope:n,forceMount:t,children:d.jsx(re,{present:t||a.open,children:d.jsx(De,{asChild:!0,container:r,children:o})})})};no.displayName=Zt;var se="MenuContent",[Va,Jt]=Re(se),oo=s.forwardRef((e,n)=>{const t=to(se,e.__scopeMenu),{forceMount:o=t.forceMount,...r}=e,a=Ie(se,e.__scopeMenu),i=Ye(se,e.__scopeMenu);return d.jsx(Ue.Provider,{scope:e.__scopeMenu,children:d.jsx(re,{present:o||a.open,children:d.jsx(Ue.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(Ga,{...r,ref:n}):d.jsx(Ha,{...r,ref:n})})})})}),Ga=s.forwardRef((e,n)=>{const t=Ie(se,e.__scopeMenu),o=s.useRef(null),r=$(n,o);return s.useEffect(()=>{const a=o.current;if(a)return at(a)},[]),d.jsx(Qt,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),Ha=s.forwardRef((e,n)=>{const t=Ie(se,e.__scopeMenu);return d.jsx(Qt,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),Wa=ye("MenuContent.ScrollLock"),Qt=s.forwardRef((e,n)=>{const{__scopeMenu:t,loop:o=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:v,onDismiss:h,disableOutsideScroll:C,...m}=e,g=Ie(se,t),b=Ye(se,t),w=pt(t),y=Qn(t),R=Fa(t),[j,M]=s.useState(null),P=s.useRef(null),F=$(n,P,g.onContentChange),H=s.useRef(0),G=s.useRef(""),Y=s.useRef(0),q=s.useRef(null),Z=s.useRef("right"),W=s.useRef(0),X=C?st:s.Fragment,B=C?{as:Wa,allowPinchZoom:!0}:void 0,J=T=>{var E,D;const Q=G.current+T,z=R().filter(O=>!O.disabled),x=document.activeElement,_=(E=z.find(O=>O.ref.current===x))==null?void 0:E.textValue,A=z.map(O=>O.textValue),I=ri(A,Q,_),k=(D=z.find(O=>O.textValue===I))==null?void 0:D.ref.current;(function O(L){G.current=L,window.clearTimeout(H.current),L!==""&&(H.current=window.setTimeout(()=>O(""),1e3))})(Q),k&&setTimeout(()=>k.focus())};s.useEffect(()=>()=>window.clearTimeout(H.current),[]),ct();const V=s.useCallback(T=>{var z,x;return Z.current===((z=q.current)==null?void 0:z.side)&&ai(T,(x=q.current)==null?void 0:x.area)},[]);return d.jsx(Va,{scope:t,searchRef:G,onItemEnter:s.useCallback(T=>{V(T)&&T.preventDefault()},[V]),onItemLeave:s.useCallback(T=>{var Q;V(T)||((Q=P.current)==null||Q.focus(),M(null))},[V]),onTriggerLeave:s.useCallback(T=>{V(T)&&T.preventDefault()},[V]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:s.useCallback(T=>{q.current=T},[]),children:d.jsx(X,{...B,children:d.jsx(Ge,{asChild:!0,trapped:r,onMountAutoFocus:S(a,T=>{var Q;T.preventDefault(),(Q=P.current)==null||Q.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(Ne,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:v,onDismiss:h,children:d.jsx(Xn,{asChild:!0,...y,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:j,onCurrentTabStopIdChange:M,onEntryFocus:S(l,T=>{b.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(ut,{role:"menu","aria-orientation":"vertical","data-state":Co(g.open),"data-radix-menu-content":"",dir:b.dir,...w,...m,ref:F,style:{outline:"none",...m.style},onKeyDown:S(m.onKeyDown,T=>{const z=T.target.closest("[data-radix-menu-content]")===T.currentTarget,x=T.ctrlKey||T.altKey||T.metaKey,_=T.key.length===1;z&&(T.key==="Tab"&&T.preventDefault(),!x&&_&&J(T.key));const A=P.current;if(T.target!==A||!Oa.includes(T.key))return;T.preventDefault();const k=R().filter(E=>!E.disabled).map(E=>E.ref.current);Zn.includes(T.key)&&k.reverse(),ni(k)}),onBlur:S(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(H.current),G.current="")}),onPointerMove:S(e.onPointerMove,Ke(T=>{const Q=T.target,z=W.current!==T.clientX;if(T.currentTarget.contains(Q)&&z){const x=T.clientX>W.current?"right":"left";Z.current=x,W.current=T.clientX}}))})})})})})})});oo.displayName=se;var za="MenuGroup",en=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return d.jsx(N.div,{role:"group",...o,ref:n})});en.displayName=za;var Ya="MenuLabel",ro=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return d.jsx(N.div,{...o,ref:n})});ro.displayName=Ya;var tt="MenuItem",yn="menu.itemSelect",vt=s.forwardRef((e,n)=>{const{disabled:t=!1,onSelect:o,...r}=e,a=s.useRef(null),i=Ye(tt,e.__scopeMenu),c=Jt(tt,e.__scopeMenu),l=$(n,a),u=s.useRef(!1),f=()=>{const p=a.current;if(!t&&p){const v=new CustomEvent(yn,{bubbles:!0,cancelable:!0});p.addEventListener(yn,h=>o==null?void 0:o(h),{once:!0}),_n(p,v),v.defaultPrevented?u.current=!1:i.onClose()}};return d.jsx(so,{...r,ref:l,disabled:t,onClick:S(e.onClick,f),onPointerDown:p=>{var v;(v=e.onPointerDown)==null||v.call(e,p),u.current=!0},onPointerUp:S(e.onPointerUp,p=>{var v;u.current||(v=p.currentTarget)==null||v.click()}),onKeyDown:S(e.onKeyDown,p=>{const v=c.searchRef.current!=="";t||v&&p.key===" "||jt.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});vt.displayName=tt;var so=s.forwardRef((e,n)=>{const{__scopeMenu:t,disabled:o=!1,textValue:r,...a}=e,i=Jt(tt,t),c=Qn(t),l=s.useRef(null),u=$(n,l),[f,p]=s.useState(!1),[v,h]=s.useState("");return s.useEffect(()=>{const C=l.current;C&&h((C.textContent??"").trim())},[a.children]),d.jsx(Ue.ItemSlot,{scope:t,disabled:o,textValue:r??v,children:d.jsx(qn,{asChild:!0,...c,focusable:!o,children:d.jsx(N.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:u,onPointerMove:S(e.onPointerMove,Ke(C=>{o?i.onItemLeave(C):(i.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,Ke(C=>i.onItemLeave(C))),onFocus:S(e.onFocus,()=>p(!0)),onBlur:S(e.onBlur,()=>p(!1))})})})}),Xa="MenuCheckboxItem",ao=s.forwardRef((e,n)=>{const{checked:t=!1,onCheckedChange:o,...r}=e;return d.jsx(fo,{scope:e.__scopeMenu,checked:t,children:d.jsx(vt,{role:"menuitemcheckbox","aria-checked":nt(t)?"mixed":t,...r,ref:n,"data-state":nn(t),onSelect:S(r.onSelect,()=>o==null?void 0:o(nt(t)?!0:!t),{checkForDefaultPrevented:!1})})})});ao.displayName=Xa;var io="MenuRadioGroup",[qa,Za]=Re(io,{value:void 0,onValueChange:()=>{}}),co=s.forwardRef((e,n)=>{const{value:t,onValueChange:o,...r}=e,a=de(o);return d.jsx(qa,{scope:e.__scopeMenu,value:t,onValueChange:a,children:d.jsx(en,{...r,ref:n})})});co.displayName=io;var lo="MenuRadioItem",uo=s.forwardRef((e,n)=>{const{value:t,...o}=e,r=Za(lo,e.__scopeMenu),a=t===r.value;return d.jsx(fo,{scope:e.__scopeMenu,checked:a,children:d.jsx(vt,{role:"menuitemradio","aria-checked":a,...o,ref:n,"data-state":nn(a),onSelect:S(o.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,t)},{checkForDefaultPrevented:!1})})})});uo.displayName=lo;var tn="MenuItemIndicator",[fo,Ja]=Re(tn,{checked:!1}),po=s.forwardRef((e,n)=>{const{__scopeMenu:t,forceMount:o,...r}=e,a=Ja(tn,t);return d.jsx(re,{present:o||nt(a.checked)||a.checked===!0,children:d.jsx(N.span,{...r,ref:n,"data-state":nn(a.checked)})})});po.displayName=tn;var Qa="MenuSeparator",vo=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e;return d.jsx(N.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})});vo.displayName=Qa;var ei="MenuArrow",mo=s.forwardRef((e,n)=>{const{__scopeMenu:t,...o}=e,r=pt(t);return d.jsx(dt,{...r,...o,ref:n})});mo.displayName=ei;var ti="MenuSub",[Sl,ho]=Re(ti),$e="MenuSubTrigger",go=s.forwardRef((e,n)=>{const t=Ie($e,e.__scopeMenu),o=Ye($e,e.__scopeMenu),r=ho($e,e.__scopeMenu),a=Jt($e,e.__scopeMenu),i=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},f=s.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return s.useEffect(()=>f,[f]),s.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),l(null)}},[c,l]),d.jsx(qt,{asChild:!0,...u,children:d.jsx(so,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":r.contentId,"data-state":Co(t.open),...e,ref:ue(n,r.onTriggerChange),onClick:p=>{var v;(v=e.onClick)==null||v.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,Ke(p=>{a.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!t.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{t.onOpenChange(!0),f()},100))})),onPointerLeave:S(e.onPointerLeave,Ke(p=>{var h,C;f();const v=(h=t.content)==null?void 0:h.getBoundingClientRect();if(v){const m=(C=t.content)==null?void 0:C.dataset.side,g=m==="right",b=g?-5:5,w=v[g?"left":"right"],y=v[g?"right":"left"];a.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:w,y:v.top},{x:y,y:v.top},{x:y,y:v.bottom},{x:w,y:v.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(p),p.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,p=>{var h;const v=a.searchRef.current!=="";e.disabled||v&&p.key===" "||ja[o.dir].includes(p.key)&&(t.onOpenChange(!0),(h=t.content)==null||h.focus(),p.preventDefault())})})})});go.displayName=$e;var xo="MenuSubContent",wo=s.forwardRef((e,n)=>{const t=to(se,e.__scopeMenu),{forceMount:o=t.forceMount,...r}=e,a=Ie(se,e.__scopeMenu),i=Ye(se,e.__scopeMenu),c=ho(xo,e.__scopeMenu),l=s.useRef(null),u=$(n,l);return d.jsx(Ue.Provider,{scope:e.__scopeMenu,children:d.jsx(re,{present:o||a.open,children:d.jsx(Ue.Slot,{scope:e.__scopeMenu,children:d.jsx(Qt,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;i.isUsingKeyboardRef.current&&((p=l.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:S(e.onFocusOutside,f=>{f.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:S(e.onKeyDown,f=>{var h;const p=f.currentTarget.contains(f.target),v=ka[i.dir].includes(f.key);p&&v&&(a.onOpenChange(!1),(h=c.trigger)==null||h.focus(),f.preventDefault())})})})})})});wo.displayName=xo;function Co(e){return e?"open":"closed"}function nt(e){return e==="indeterminate"}function nn(e){return nt(e)?"indeterminate":e?"checked":"unchecked"}function ni(e){const n=document.activeElement;for(const t of e)if(t===n||(t.focus(),document.activeElement!==n))return}function oi(e,n){return e.map((t,o)=>e[(n+o)%e.length])}function ri(e,n,t){const r=n.length>1&&Array.from(n).every(u=>u===n[0])?n[0]:n,a=t?e.indexOf(t):-1;let i=oi(e,Math.max(a,0));r.length===1&&(i=i.filter(u=>u!==t));const l=i.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==t?l:void 0}function si(e,n){const{x:t,y:o}=e;let r=!1;for(let a=0,i=n.length-1;a<n.length;i=a++){const c=n[a],l=n[i],u=c.x,f=c.y,p=l.x,v=l.y;f>o!=v>o&&t<(p-u)*(o-f)/(v-f)+u&&(r=!r)}return r}function ai(e,n){if(!n)return!1;const t={x:e.clientX,y:e.clientY};return si(t,n)}function Ke(e){return n=>n.pointerType==="mouse"?e(n):void 0}var ii=eo,ci=qt,li=no,ui=oo,di=en,fi=ro,pi=vt,vi=ao,mi=co,hi=uo,gi=po,xi=vo,wi=mo,Ci=go,yi=wo,mt="DropdownMenu",[bi]=ie(mt,[Jn]),ne=Jn(),[Ei,yo]=bi(mt),bo=e=>{const{__scopeDropdownMenu:n,children:t,dir:o,open:r,defaultOpen:a,onOpenChange:i,modal:c=!0}=e,l=ne(n),u=s.useRef(null),[f,p]=fe({prop:r,defaultProp:a??!1,onChange:i,caller:mt});return d.jsx(Ei,{scope:n,triggerId:ee(),triggerRef:u,contentId:ee(),open:f,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(v=>!v),[p]),modal:c,children:d.jsx(ii,{...l,open:f,onOpenChange:p,dir:o,modal:c,children:t})})};bo.displayName=mt;var Eo="DropdownMenuTrigger",So=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,disabled:o=!1,...r}=e,a=yo(Eo,t),i=ne(t);return d.jsx(ci,{asChild:!0,...i,children:d.jsx(N.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:ue(n,a.triggerRef),onPointerDown:S(e.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(a.onOpenToggle(),a.open||c.preventDefault())}),onKeyDown:S(e.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&a.onOpenToggle(),c.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});So.displayName=Eo;var Si="DropdownMenuPortal",Po=e=>{const{__scopeDropdownMenu:n,...t}=e,o=ne(n);return d.jsx(li,{...o,...t})};Po.displayName=Si;var Ro="DropdownMenuContent",Io=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=yo(Ro,t),a=ne(t),i=s.useRef(!1);return d.jsx(ui,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...o,ref:n,onCloseAutoFocus:S(e.onCloseAutoFocus,c=>{var l;i.current||(l=r.triggerRef.current)==null||l.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:S(e.onInteractOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Io.displayName=Ro;var Pi="DropdownMenuGroup",Ri=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(di,{...r,...o,ref:n})});Ri.displayName=Pi;var Ii="DropdownMenuLabel",To=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(fi,{...r,...o,ref:n})});To.displayName=Ii;var Ti="DropdownMenuItem",_o=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(pi,{...r,...o,ref:n})});_o.displayName=Ti;var _i="DropdownMenuCheckboxItem",Mo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(vi,{...r,...o,ref:n})});Mo.displayName=_i;var Mi="DropdownMenuRadioGroup",Ao=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(mi,{...r,...o,ref:n})});Ao.displayName=Mi;var Ai="DropdownMenuRadioItem",No=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(hi,{...r,...o,ref:n})});No.displayName=Ai;var Ni="DropdownMenuItemIndicator",Do=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(gi,{...r,...o,ref:n})});Do.displayName=Ni;var Di="DropdownMenuSeparator",Oo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(xi,{...r,...o,ref:n})});Oo.displayName=Di;var Oi="DropdownMenuArrow",ji=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(wi,{...r,...o,ref:n})});ji.displayName=Oi;var ki="DropdownMenuSubTrigger",jo=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(Ci,{...r,...o,ref:n})});jo.displayName=ki;var Fi="DropdownMenuSubContent",ko=s.forwardRef((e,n)=>{const{__scopeDropdownMenu:t,...o}=e,r=ne(t);return d.jsx(yi,{...r,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ko.displayName=Fi;var Pl=bo,Rl=So,Il=Po,Tl=Io,_l=To,Ml=_o,Al=Mo,Nl=Ao,Dl=No,Ol=Do,jl=Oo,kl=jo,Fl=ko,Fo=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Li="VisuallyHidden",Lo=s.forwardRef((e,n)=>d.jsx(N.span,{...e,ref:n,style:{...Fo,...e.style}}));Lo.displayName=Li;var $i=Lo,[ht]=ie("Tooltip",[me]),gt=me(),$o="TooltipProvider",Bi=700,kt="tooltip.open",[Ui,on]=ht($o),Bo=e=>{const{__scopeTooltip:n,delayDuration:t=Bi,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:a}=e,i=s.useRef(!0),c=s.useRef(!1),l=s.useRef(0);return s.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),d.jsx(Ui,{scope:n,isOpenDelayedRef:i,delayDuration:t,onOpen:s.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:a})};Bo.displayName=$o;var Ve="Tooltip",[Ki,Xe]=ht(Ve),Uo=e=>{const{__scopeTooltip:n,children:t,open:o,defaultOpen:r,onOpenChange:a,disableHoverableContent:i,delayDuration:c}=e,l=on(Ve,e.__scopeTooltip),u=gt(n),[f,p]=s.useState(null),v=ee(),h=s.useRef(0),C=i??l.disableHoverableContent,m=c??l.delayDuration,g=s.useRef(!1),[b,w]=fe({prop:o,defaultProp:r??!1,onChange:P=>{P?(l.onOpen(),document.dispatchEvent(new CustomEvent(kt))):l.onClose(),a==null||a(P)},caller:Ve}),y=s.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),R=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,w(!0)},[w]),j=s.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),M=s.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,w(!0),h.current=0},m)},[m,w]);return s.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),d.jsx(lt,{...u,children:d.jsx(Ki,{scope:n,contentId:v,open:b,stateAttribute:y,trigger:f,onTriggerChange:p,onTriggerEnter:s.useCallback(()=>{l.isOpenDelayedRef.current?M():R()},[l.isOpenDelayedRef,M,R]),onTriggerLeave:s.useCallback(()=>{C?j():(window.clearTimeout(h.current),h.current=0)},[j,C]),onOpen:R,onClose:j,disableHoverableContent:C,children:t})})};Uo.displayName=Ve;var Ft="TooltipTrigger",Ko=s.forwardRef((e,n)=>{const{__scopeTooltip:t,...o}=e,r=Xe(Ft,t),a=on(Ft,t),i=gt(t),c=s.useRef(null),l=$(n,c,r.onTriggerChange),u=s.useRef(!1),f=s.useRef(!1),p=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.jsx(He,{asChild:!0,...i,children:d.jsx(N.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:S(e.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:S(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:S(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:S(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:S(e.onBlur,r.onClose),onClick:S(e.onClick,r.onClose)})})});Ko.displayName=Ft;var rn="TooltipPortal",[Vi,Gi]=ht(rn,{forceMount:void 0}),Vo=e=>{const{__scopeTooltip:n,forceMount:t,children:o,container:r}=e,a=Xe(rn,n);return d.jsx(Vi,{scope:n,forceMount:t,children:d.jsx(re,{present:t||a.open,children:d.jsx(De,{asChild:!0,container:r,children:o})})})};Vo.displayName=rn;var Me="TooltipContent",Go=s.forwardRef((e,n)=>{const t=Gi(Me,e.__scopeTooltip),{forceMount:o=t.forceMount,side:r="top",...a}=e,i=Xe(Me,e.__scopeTooltip);return d.jsx(re,{present:o||i.open,children:i.disableHoverableContent?d.jsx(Ho,{side:r,...a,ref:n}):d.jsx(Hi,{side:r,...a,ref:n})})}),Hi=s.forwardRef((e,n)=>{const t=Xe(Me,e.__scopeTooltip),o=on(Me,e.__scopeTooltip),r=s.useRef(null),a=$(n,r),[i,c]=s.useState(null),{trigger:l,onClose:u}=t,f=r.current,{onPointerInTransitChange:p}=o,v=s.useCallback(()=>{c(null),p(!1)},[p]),h=s.useCallback((C,m)=>{const g=C.currentTarget,b={x:C.clientX,y:C.clientY},w=qi(b,g.getBoundingClientRect()),y=Zi(b,w),R=Ji(m.getBoundingClientRect()),j=ec([...y,...R]);c(j),p(!0)},[p]);return s.useEffect(()=>()=>v(),[v]),s.useEffect(()=>{if(l&&f){const C=g=>h(g,f),m=g=>h(g,l);return l.addEventListener("pointerleave",C),f.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",C),f.removeEventListener("pointerleave",m)}}},[l,f,h,v]),s.useEffect(()=>{if(i){const C=m=>{const g=m.target,b={x:m.clientX,y:m.clientY},w=(l==null?void 0:l.contains(g))||(f==null?void 0:f.contains(g)),y=!Qi(b,i);w?v():y&&(v(),u())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[l,f,i,u,v]),d.jsx(Ho,{...e,ref:a})}),[Wi,zi]=ht(Ve,{isInside:!1}),Yi=Ks("TooltipContent"),Ho=s.forwardRef((e,n)=>{const{__scopeTooltip:t,children:o,"aria-label":r,onEscapeKeyDown:a,onPointerDownOutside:i,...c}=e,l=Xe(Me,t),u=gt(t),{onClose:f}=l;return s.useEffect(()=>(document.addEventListener(kt,f),()=>document.removeEventListener(kt,f)),[f]),s.useEffect(()=>{if(l.trigger){const p=v=>{const h=v.target;h!=null&&h.contains(l.trigger)&&f()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,f]),d.jsx(Ne,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:f,children:d.jsxs(ut,{"data-state":l.stateAttribute,...u,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(Yi,{children:o}),d.jsx(Wi,{scope:t,isInside:!0,children:d.jsx($i,{id:l.contentId,role:"tooltip",children:r||o})})]})})});Go.displayName=Me;var Wo="TooltipArrow",Xi=s.forwardRef((e,n)=>{const{__scopeTooltip:t,...o}=e,r=gt(t);return zi(Wo,t).isInside?null:d.jsx(dt,{...r,...o,ref:n})});Xi.displayName=Wo;function qi(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),a=Math.abs(n.left-e.x);switch(Math.min(t,o,r,a)){case a:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zi(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function Ji(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Qi(e,n){const{x:t,y:o}=e;let r=!1;for(let a=0,i=n.length-1;a<n.length;i=a++){const c=n[a],l=n[i],u=c.x,f=c.y,p=l.x,v=l.y;f>o!=v>o&&t<(p-u)*(o-f)/(v-f)+u&&(r=!r)}return r}function ec(e){const n=e.slice();return n.sort((t,o)=>t.x<o.x?-1:t.x>o.x?1:t.y<o.y?-1:t.y>o.y?1:0),tc(n)}function tc(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o<e.length;o++){const r=e[o];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(r.y-i.y)>=(a.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var Ll=Bo,$l=Uo,Bl=Ko,Ul=Vo,Kl=Go,xt="Dialog",[zo]=ie(xt),[nc,ce]=zo(xt),Yo=e=>{const{__scopeDialog:n,children:t,open:o,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,c=s.useRef(null),l=s.useRef(null),[u,f]=fe({prop:o,defaultProp:r??!1,onChange:a,caller:xt});return d.jsx(nc,{scope:n,triggerRef:c,contentRef:l,contentId:ee(),titleId:ee(),descriptionId:ee(),open:u,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(p=>!p),[f]),modal:i,children:t})};Yo.displayName=xt;var Xo="DialogTrigger",oc=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(Xo,t),a=$(n,r.triggerRef);return d.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":cn(r.open),...o,ref:a,onClick:S(e.onClick,r.onOpenToggle)})});oc.displayName=Xo;var sn="DialogPortal",[rc,qo]=zo(sn,{forceMount:void 0}),Zo=e=>{const{__scopeDialog:n,forceMount:t,children:o,container:r}=e,a=ce(sn,n);return d.jsx(rc,{scope:n,forceMount:t,children:s.Children.map(o,i=>d.jsx(re,{present:t||a.open,children:d.jsx(De,{asChild:!0,container:r,children:i})}))})};Zo.displayName=sn;var ot="DialogOverlay",Jo=s.forwardRef((e,n)=>{const t=qo(ot,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,a=ce(ot,e.__scopeDialog);return a.modal?d.jsx(re,{present:o||a.open,children:d.jsx(ac,{...r,ref:n})}):null});Jo.displayName=ot;var sc=ye("DialogOverlay.RemoveScroll"),ac=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(ot,t);return d.jsx(st,{as:sc,allowPinchZoom:!0,shards:[r.contentRef],children:d.jsx(N.div,{"data-state":cn(r.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})}),be="DialogContent",Qo=s.forwardRef((e,n)=>{const t=qo(be,e.__scopeDialog),{forceMount:o=t.forceMount,...r}=e,a=ce(be,e.__scopeDialog);return d.jsx(re,{present:o||a.open,children:a.modal?d.jsx(ic,{...r,ref:n}):d.jsx(cc,{...r,ref:n})})});Qo.displayName=be;var ic=s.forwardRef((e,n)=>{const t=ce(be,e.__scopeDialog),o=s.useRef(null),r=$(n,t.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return at(a)},[]),d.jsx(er,{...e,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:S(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=t.triggerRef.current)==null||i.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:S(e.onFocusOutside,a=>a.preventDefault())})}),cc=s.forwardRef((e,n)=>{const t=ce(be,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return d.jsx(er,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,c;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(o.current||(c=t.triggerRef.current)==null||c.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;((u=t.triggerRef.current)==null?void 0:u.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),er=s.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,c=ce(be,t),l=s.useRef(null),u=$(n,l);return ct(),d.jsxs(d.Fragment,{children:[d.jsx(Ge,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:d.jsx(Ne,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":cn(c.open),...i,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(lc,{titleId:c.titleId}),d.jsx(dc,{contentRef:l,descriptionId:c.descriptionId})]})]})}),an="DialogTitle",tr=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(an,t);return d.jsx(N.h2,{id:r.titleId,...o,ref:n})});tr.displayName=an;var nr="DialogDescription",or=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(nr,t);return d.jsx(N.p,{id:r.descriptionId,...o,ref:n})});or.displayName=nr;var rr="DialogClose",sr=s.forwardRef((e,n)=>{const{__scopeDialog:t,...o}=e,r=ce(rr,t);return d.jsx(N.button,{type:"button",...o,ref:n,onClick:S(e.onClick,()=>r.onOpenChange(!1))})});sr.displayName=rr;function cn(e){return e?"open":"closed"}var ar="DialogTitleWarning",[Vl,ir]=ks(ar,{contentName:be,titleName:an,docsSlug:"dialog"}),lc=({titleId:e})=>{const n=ir(ar),t=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
2
2
 
3
3
  If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
4
4
 
@@ -1,4 +1,4 @@
1
- import{r as a,b as O,I as he,c as R,d as V,g as K,e as $,A as pe,p as me,m as ge,f as ye,h as X,k as Ee,l as Ce,E as xe,R as Re,o as we,q as Y}from"./vendor-JUtelXU0.js";/**
1
+ import{r as a,b as O,I as he,c as R,d as V,g as K,e as $,A as pe,p as me,m as ge,f as ye,h as X,k as Ee,l as Ce,E as xe,R as Re,o as we,q as Y}from"./vendor-C-lQMZp3.js";/**
2
2
  * React Router v6.30.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
@@ -1 +1 @@
1
- import{j as t}from"./vendor-JUtelXU0.js";import{c as a}from"./global-BLUcvOa8.js";function x({value:n,onChange:s,options:l,className:o,block:i,"aria-label":c}){return t.jsx("div",{role:"group","aria-label":c,className:a("flex items-center gap-1 bg-secondary p-1",o),children:l.map(e=>{const r=e.value===n;return t.jsxs("button",{type:"button",onClick:()=>s(e.value),"aria-pressed":r,className:a("inline-flex h-8 items-center justify-center gap-1.5 whitespace-nowrap px-3.5 text-xs font-medium transition-all",i?"flex-1":"shrink-0",r?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:[e.icon,e.label]},e.value)})})}export{x as S};
1
+ import{j as t}from"./vendor-C-lQMZp3.js";import{c as a}from"./global-BCYo_xAt.js";function x({value:n,onChange:s,options:l,className:o,block:i,"aria-label":c}){return t.jsx("div",{role:"group","aria-label":c,className:a("flex items-center gap-1 bg-secondary p-1",o),children:l.map(e=>{const r=e.value===n;return t.jsxs("button",{type:"button",onClick:()=>s(e.value),"aria-pressed":r,className:a("inline-flex h-8 items-center justify-center gap-1.5 whitespace-nowrap px-3.5 text-xs font-medium transition-all",i?"flex-1":"shrink-0",r?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:[e.icon,e.label]},e.value)})})}export{x as S};
@@ -1 +1 @@
1
- import{r as u,j as e}from"./vendor-JUtelXU0.js";import{b as p,q as m}from"./app-CRxPj2SJ.js";import{a as b}from"./apiKeys-CMk2nxB_.js";import{u as x}from"./i18n-v60Yn7Ls.js";const j=[{value:1,labelKey:"apiKeys.analytics.range.today"},{value:7,labelKey:"apiKeys.analytics.range.week"},{value:30,labelKey:"apiKeys.analytics.range.month"}];function v(){var a;const l=[{id:"anthropic",label:"Anthropic"},{id:"openai",label:"OpenAI"}],n=p(m.customEndpoints.all(),b.customEndpointOptionsRequest());return u.useMemo(()=>{var t;const s=(((t=n.data)==null?void 0:t.endpoints)??[]).map(o=>({id:o.id,label:o.label||o.id}));return[...l,...s]},[(a=n.data)==null?void 0:a.endpoints])}function N({available:l,hint:n,onChange:a,selected:s}){const{t}=x(),o=s.length===0,c=()=>{a([])},d=r=>{if(s.includes(r)){a(s.filter(i=>i!==r));return}a([...s,r])};return e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"rounded-lg border border-border bg-secondary px-3 py-3 text-xs text-muted-foreground",children:n}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-lg border border-border bg-card px-3 py-2.5 transition-colors hover:border-foreground/30 hover:bg-accent/50",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:c,className:"h-4 w-4 rounded border-input accent-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:t("apiKeys.allEndpoints")})]}),e.jsx("div",{className:"grid max-h-40 gap-1 overflow-y-auto",children:l.map(r=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-lg border border-border bg-card px-3 py-2.5 transition-colors hover:border-foreground/30 hover:bg-accent/50",children:[e.jsx("input",{type:"checkbox",checked:!o&&s.includes(r.id),onChange:()=>d(r.id),className:"h-4 w-4 rounded border-input accent-foreground"}),e.jsx("span",{className:"text-sm",children:r.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",r.id,")"]})]},r.id))})]})}export{N as E,j as R,v as u};
1
+ import{r as u,j as e}from"./vendor-C-lQMZp3.js";import{b as p,q as m}from"./app-DZpd2fu9.js";import{a as b}from"./apiKeys-B5Os17Qm.js";import{u as x}from"./i18n-ClvfZhYc.js";const j=[{value:1,labelKey:"apiKeys.analytics.range.today"},{value:7,labelKey:"apiKeys.analytics.range.week"},{value:30,labelKey:"apiKeys.analytics.range.month"}];function v(){var a;const l=[{id:"anthropic",label:"Anthropic"},{id:"openai",label:"OpenAI"}],n=p(m.customEndpoints.all(),b.customEndpointOptionsRequest());return u.useMemo(()=>{var t;const s=(((t=n.data)==null?void 0:t.endpoints)??[]).map(o=>({id:o.id,label:o.label||o.id}));return[...l,...s]},[(a=n.data)==null?void 0:a.endpoints])}function N({available:l,hint:n,onChange:a,selected:s}){const{t}=x(),o=s.length===0,c=()=>{a([])},d=r=>{if(s.includes(r)){a(s.filter(i=>i!==r));return}a([...s,r])};return e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"rounded-lg border border-border bg-secondary px-3 py-3 text-xs text-muted-foreground",children:n}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-lg border border-border bg-card px-3 py-2.5 transition-colors hover:border-foreground/30 hover:bg-accent/50",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:c,className:"h-4 w-4 rounded border-input accent-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:t("apiKeys.allEndpoints")})]}),e.jsx("div",{className:"grid max-h-40 gap-1 overflow-y-auto",children:l.map(r=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-lg border border-border bg-card px-3 py-2.5 transition-colors hover:border-foreground/30 hover:bg-accent/50",children:[e.jsx("input",{type:"checkbox",checked:!o&&s.includes(r.id),onChange:()=>d(r.id),className:"h-4 w-4 rounded border-input accent-foreground"}),e.jsx("span",{className:"text-sm",children:r.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",r.id,")"]})]},r.id))})]})}export{N as E,j as R,v as u};
@@ -1 +1 @@
1
- import{r as n,j as e}from"./vendor-JUtelXU0.js";import{z as s,B as i}from"./radix-d0BukFWM.js";import{c as r}from"./global-BLUcvOa8.js";const c=n.forwardRef(({className:t,...o},a)=>e.jsx(s,{className:r("peer inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-foreground data-[state=unchecked]:bg-input",t),...o,ref:a,children:e.jsx(i,{className:r("pointer-events-none block h-6 w-6 rounded-full bg-background ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));c.displayName=s.displayName;export{c as S};
1
+ import{r as n,j as e}from"./vendor-C-lQMZp3.js";import{z as s,B as i}from"./radix-DONH6gHT.js";import{c as r}from"./global-BCYo_xAt.js";const c=n.forwardRef(({className:t,...o},a)=>e.jsx(s,{className:r("peer inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-foreground data-[state=unchecked]:bg-input",t),...o,ref:a,children:e.jsx(i,{className:r("pointer-events-none block h-6 w-6 rounded-full bg-background ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));c.displayName=s.displayName;export{c as S};
@@ -1 +1 @@
1
- import{r as a,j as i}from"./vendor-JUtelXU0.js";import{u as d,v as r,w as n,x as f}from"./radix-d0BukFWM.js";import{c as o}from"./global-BLUcvOa8.js";const u=d,c=a.forwardRef(({className:e,...s},t)=>i.jsx(r,{ref:t,className:o("inline-flex h-9 items-center gap-1 border-b border-border text-muted-foreground",e),...s}));c.displayName=r.displayName;const b=a.forwardRef(({className:e,...s},t)=>i.jsx(n,{ref:t,className:o("inline-flex items-center justify-center whitespace-nowrap border-b-2 border-transparent px-3 pb-2.5 pt-2 text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-foreground data-[state=active]:text-foreground data-[state=active]:font-semibold data-[state=inactive]:hover:text-foreground",e),...s}));b.displayName=n.displayName;const l=a.forwardRef(({className:e,...s},t)=>i.jsx(f,{ref:t,className:o("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...s}));l.displayName=f.displayName;export{u as T,c as a,b,l as c};
1
+ import{r as a,j as i}from"./vendor-C-lQMZp3.js";import{u as d,v as r,w as n,x as f}from"./radix-DONH6gHT.js";import{c as o}from"./global-BCYo_xAt.js";const u=d,c=a.forwardRef(({className:e,...s},t)=>i.jsx(r,{ref:t,className:o("inline-flex h-9 items-center gap-1 border-b border-border text-muted-foreground",e),...s}));c.displayName=r.displayName;const b=a.forwardRef(({className:e,...s},t)=>i.jsx(n,{ref:t,className:o("inline-flex items-center justify-center whitespace-nowrap border-b-2 border-transparent px-3 pb-2.5 pt-2 text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-foreground data-[state=active]:text-foreground data-[state=active]:font-semibold data-[state=inactive]:hover:text-foreground",e),...s}));b.displayName=n.displayName;const l=a.forwardRef(({className:e,...s},t)=>i.jsx(f,{ref:t,className:o("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...s}));l.displayName=f.displayName;export{u as T,c as a,b,l as c};
@@ -1 +1 @@
1
- import{a as o,b as q}from"./query-CvboQrUT.js";import{u as x,t as y}from"./app-CRxPj2SJ.js";function j({mutationFn:C,successToast:a,errorToast:p,invalidateKeys:u,onSuccess:m,onError:f,...M}){const Q=o(),{pushToast:A}=x();return q({...M,mutationFn:async t=>{try{return await C(t)}catch(i){throw y(i)}},onSuccess:async(t,i,w,h)=>{u!=null&&u.length&&await Promise.all(u.map(g=>Q.invalidateQueries({queryKey:g})));const n=a==null?void 0:a(t,i);n&&A({...n,variant:"success"}),await(m==null?void 0:m(t,i,w,h))},onError:async(t,i,w,h)=>{const n=p==null?void 0:p(t,i);n&&A({...n,variant:"error"}),await(f==null?void 0:f(t,i,w,h))}})}export{j as u};
1
+ import{a as o,b as q}from"./query-1Ng1fzmE.js";import{u as x,t as y}from"./app-DZpd2fu9.js";function j({mutationFn:C,successToast:a,errorToast:p,invalidateKeys:u,onSuccess:m,onError:f,...M}){const Q=o(),{pushToast:A}=x();return q({...M,mutationFn:async t=>{try{return await C(t)}catch(i){throw y(i)}},onSuccess:async(t,i,w,h)=>{u!=null&&u.length&&await Promise.all(u.map(g=>Q.invalidateQueries({queryKey:g})));const n=a==null?void 0:a(t,i);n&&A({...n,variant:"success"}),await(m==null?void 0:m(t,i,w,h))},onError:async(t,i,w,h)=>{const n=p==null?void 0:p(t,i);n&&A({...n,variant:"error"}),await(f==null?void 0:f(t,i,w,h))}})}export{j as u};