cliproxyui 0.0.0-stage → 0.1.0-nightly.10

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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -2
  3. package/dist/assets/_app-BsCjy3g7.js +1 -0
  4. package/dist/assets/_app-D5CbDZLR.js +1 -0
  5. package/dist/assets/alert-B0ybaOxH.js +1 -0
  6. package/dist/assets/api-Dh4YY48y.js +1 -0
  7. package/dist/assets/app-sidebar-Dd10AKfw.js +1 -0
  8. package/dist/assets/arrow-up-BOaaXbgn.js +1 -0
  9. package/dist/assets/badge-CUuJqx6i.js +1 -0
  10. package/dist/assets/blocks-BEaO1JQq.js +1 -0
  11. package/dist/assets/boxes-B0dHEgRb.js +1 -0
  12. package/dist/assets/browser-CraaQKji.js +105 -0
  13. package/dist/assets/card-BX9IPNXi.js +1 -0
  14. package/dist/assets/chevron-down-DFGWnYiP.js +1 -0
  15. package/dist/assets/circle-alert-CRwTIVa0.js +1 -0
  16. package/dist/assets/common-C0aFgyuv.js +1 -0
  17. package/dist/assets/connect-JDFmQh6o.js +10 -0
  18. package/dist/assets/credentials-C6V3bsZ3.js +1 -0
  19. package/dist/assets/dialog-Da1GOL-m.js +1 -0
  20. package/dist/assets/empty--HGjuOPR.js +1 -0
  21. package/dist/assets/es2015-BI7c_gk7.js +41 -0
  22. package/dist/assets/field-BnGIqhMu.js +1 -0
  23. package/dist/assets/file-text-CBWR-980.js +1 -0
  24. package/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  25. package/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  26. package/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  27. package/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  28. package/dist/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  29. package/dist/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  30. package/dist/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  31. package/dist/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  32. package/dist/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  33. package/dist/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  34. package/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  35. package/dist/assets/index-09oWu5UQ.js +11 -0
  36. package/dist/assets/index-CbLsEeq-.css +2 -0
  37. package/dist/assets/input-B6q4dbec.js +1 -0
  38. package/dist/assets/input-group-Tv6llsKW.js +1 -0
  39. package/dist/assets/key-round-CzHhkCDw.js +1 -0
  40. package/dist/assets/keys-Df1K5nfA.js +1 -0
  41. package/dist/assets/label-BCe4MLwg.js +1 -0
  42. package/dist/assets/lib-CTx28Bxk.js +4 -0
  43. package/dist/assets/link-DifxDKVd.js +1 -0
  44. package/dist/assets/login-Do1MxrsO.js +1 -0
  45. package/dist/assets/logs-TpU5wbNj.js +5 -0
  46. package/dist/assets/pencil-CUS-sKJh.js +1 -0
  47. package/dist/assets/play-D1dietBH.js +1 -0
  48. package/dist/assets/playground-BCi_jqgv.js +2 -0
  49. package/dist/assets/plus-CiLD8kty.js +1 -0
  50. package/dist/assets/popover-oT1QZa3S.js +1 -0
  51. package/dist/assets/preload-helper-BbFIP6dB.js +1 -0
  52. package/dist/assets/progress-BlADJtC3.js +6 -0
  53. package/dist/assets/providers-BOh3nCgP.js +1 -0
  54. package/dist/assets/providers-DSpQOBhq.js +1 -0
  55. package/dist/assets/queries-BJ9EwxPS.js +1 -0
  56. package/dist/assets/root-CDpNo7ef.js +1 -0
  57. package/dist/assets/rotate-ccw-Bztf64MW.js +1 -0
  58. package/dist/assets/routing-4-uPvHXY.js +1 -0
  59. package/dist/assets/search-B60kTDSq.js +1 -0
  60. package/dist/assets/select-CQa41TBk.js +1 -0
  61. package/dist/assets/separator-wLF5huu0.js +1 -0
  62. package/dist/assets/settings-DqDBTko_.js +3 -0
  63. package/dist/assets/setup-Bp9l_4gL.js +1 -0
  64. package/dist/assets/sheet-3lVMxWZH.js +1 -0
  65. package/dist/assets/shield-check-B_3I1Kyr.js +1 -0
  66. package/dist/assets/square-CyS5pyrL.js +1 -0
  67. package/dist/assets/status-CF3JPMcL.js +2 -0
  68. package/dist/assets/switch-SBNIH4hq.js +1 -0
  69. package/dist/assets/table-Dm6XApvR.js +1 -0
  70. package/dist/assets/toggle-group-D_DLvkDY.js +1 -0
  71. package/dist/assets/usage-BtAoMWr1.js +1 -0
  72. package/dist/assets/usage-charts-wT1QhVGK.js +65 -0
  73. package/dist/assets/use-now-DT6ekvIA.js +1 -0
  74. package/dist/assets/use-stick-to-bottom-I26ZKlJ-.js +1 -0
  75. package/dist/assets/useMatch-D_hq8QlA.js +1 -0
  76. package/dist/assets/useNavigate-BAHKKgya.js +1 -0
  77. package/dist/assets/useRouter-DgLsKaZI.js +1 -0
  78. package/dist/favicon.svg +1 -0
  79. package/dist/index.html +22 -0
  80. package/dist-server/app.js +257 -0
  81. package/dist-server/auth.js +68 -0
  82. package/dist-server/binary.js +121 -0
  83. package/dist-server/cli.js +72 -0
  84. package/dist-server/cpa-config.js +75 -0
  85. package/dist-server/env.js +29 -0
  86. package/dist-server/index.js +46 -0
  87. package/dist-server/limits.js +41 -0
  88. package/dist-server/service.js +205 -0
  89. package/dist-server/state.js +19 -0
  90. package/dist-server/supervisor.js +175 -0
  91. package/dist-server/urls.js +12 -0
  92. package/dist-server/usage.js +191 -0
  93. package/package.json +73 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 wynn-dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,91 @@
1
- # Temporary Holding Version
1
+ # CPA Console
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A self-contained web console for [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI). One command downloads
4
+ CPA, runs it as a supervised process and gives you a polished UI to manage it. You don't install CPA separately.
5
+
6
+ - **Process management**: installs the latest CPA release for your platform (checksum-verified), restarts it if it
7
+ crashes, and updates it in one click.
8
+ - **Usage analytics**: CPA only keeps per-request usage for a few minutes. The console drains it continuously into
9
+ SQLite, so you get history by model, credential, client key and provider, with tokens, latency and failures.
10
+ - **Accounts at a glance**: every Claude and Codex account with its 5-hour, weekly and Fable limits, how full each is
11
+ and when it resets.
12
+ - **Credentials**: Claude and Codex sign-in, file uploads, enable/disable, cooldowns, per-credential traffic and bulk actions.
13
+ - **API providers & client keys**: structured editors instead of raw YAML.
14
+ - **Settings**: documented forms for routing, retries, networking and logging, plus a YAML editor with diff review.
15
+ - **Logs & playground**: live log tail, CPA process output, request and error logs, and a streaming chat tester.
16
+
17
+ ## Quick start
18
+
19
+ Requires Node.js 22.13 or newer.
20
+
21
+ ```sh
22
+ npx cliproxyui
23
+ ```
24
+
25
+ The console prints a setup link (and opens it if it can). Open it and pick the proxy port. The management key is
26
+ pre-generated, so save it, then click **Start CLIProxyAPI**. CPA is already downloading in the background while you
27
+ fill in the form.
28
+
29
+ Clients then connect straight to CPA, e.g. `http://<server>:8317/v1`, using the client key shown on the Overview page.
30
+ For Claude Code, the Connect page has the commands ready to paste, with your address and key filled in.
31
+
32
+ ### Keep it running
33
+
34
+ ```sh
35
+ npx cliproxyui service install
36
+ ```
37
+
38
+ This installs a background service that starts at boot: systemd on Linux (a user service, or a system service when
39
+ run as root) and launchd on macOS. It installs the latest nightly into the data directory, so it never depends on the
40
+ npx cache. `service status` and `service uninstall` do what you'd expect; uninstalling keeps your data.
41
+
42
+ ### Updating
43
+
44
+ The console is a rolling nightly: every merge to `main` publishes a new build to npm under the default `latest` tag.
45
+ When a newer build exists, the console's sidebar shows **Update available** with the exact command, including any
46
+ `--data`, `--port` or `--host` options the console runs with. For a service, that re-runs `service install`, which
47
+ reinstalls the latest nightly and keeps your data. For a foreground run, stop the console and run the npx command
48
+ again; npx fetches the new build. CLIProxyAPI itself updates from the Overview page.
49
+
50
+ ### Options
51
+
52
+ ```
53
+ cliproxyui [start] [--port 8320] [--host 0.0.0.0] [--data ~/.cpa-console] [--no-open]
54
+ cliproxyui service install|uninstall|status [same options]
55
+ ```
56
+
57
+ | Flag | Env | Default | |
58
+ | --- | --- | --- | --- |
59
+ | `--port` | `PORT` | `8320` | Console port |
60
+ | `--host` | `HOST` | `0.0.0.0` | Bind address. Use `127.0.0.1` behind a reverse proxy or SSH tunnel |
61
+ | `--data` | `CPA_CONSOLE_DATA` | `~/.cpa-console` | CPA binary, `config.yaml`, auth files, logs, usage database |
62
+ | | `TRUST_PROXY` | | Set to `1` behind a reverse proxy, so failed-login limits apply per client (from `X-Forwarded-For`) |
63
+ | | `USAGE_RETENTION_DAYS` | `90` | How long request history is kept |
64
+ | | `GITHUB_TOKEN` | | Optional; avoids GitHub API rate limits when checking for CPA releases |
65
+
66
+ ## Security notes
67
+
68
+ - The setup link contains a one-time token. Until setup is done, anyone with the link can claim the instance, so
69
+ finish setup right away.
70
+ - The console serves plain HTTP. To reach it over the internet, put it behind a TLS-terminating reverse proxy
71
+ (Caddy, nginx), with `HOST=127.0.0.1` and `TRUST_PROXY=1`, or use an SSH tunnel.
72
+ - Five wrong keys from one address lock that address out for 15 minutes.
73
+ - The console checks the management key itself before forwarding anything to CPA. CPA's remote management stays
74
+ disabled, because the console reaches it over localhost.
75
+
76
+ ## Development
77
+
78
+ ```sh
79
+ pnpm install # also builds, via `prepare`
80
+ CPA_CONSOLE_DATA=/tmp/cpa-dev pnpm dev
81
+ ```
82
+
83
+ `pnpm dev` runs the console server on `:8320` in watch mode and Vite on `:5173`. Open the Vite URL; the setup link
84
+ printed by the server works there too if you change its port to 5173.
85
+
86
+ Stack: Vite, React 19, TanStack Router / Query / Table, shadcn/ui (Radix, Tailwind v4) and Recharts; the server is
87
+ Hono on Node, with `node:sqlite` for usage history.
88
+
89
+ ## License
90
+
91
+ MIT
@@ -0,0 +1 @@
1
+ import{F as e,L as t,j as n,o as r,r as i}from"./api-Dh4YY48y.js";import{O as a,T as o,a as s,c,d as l,f as u,l as d,m as f,n as p,o as m,p as h,s as g}from"./common-C0aFgyuv.js";import{a as _,n as v,t as y}from"./queries-BJ9EwxPS.js";import{t as b}from"./link-DifxDKVd.js";import{n as ee,o as x,s as te}from"./app-sidebar-Dd10AKfw.js";import{c as ne,l as S,n as re,r as ie,s as ae,u as C}from"./usage-charts-wT1QhVGK.js";import{t as oe}from"./play-D1dietBH.js";import{t as se}from"./square-CyS5pyrL.js";import{t as ce}from"./progress-BlADJtC3.js";import{X as le,_ as w,f as ue,g as T,h as de,m as E,p as D,yt as fe}from"./index-09oWu5UQ.js";import{i as O,n as k,o as A,r as j,s as M,t as N}from"./card-BX9IPNXi.js";import{i as P,r as F,t as I}from"./alert-B0ybaOxH.js";import{r as L}from"./providers-DSpQOBhq.js";import{t as R}from"./badge-CUuJqx6i.js";import{i as z,n as B,s as V}from"./status-CF3JPMcL.js";import{t as H}from"./use-now-DT6ekvIA.js";import{a as pe,i as me,n as he,r as U}from"./routing-4-uPvHXY.js";var W={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};W.node;var ge=e(W),G={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};G.node;var K=e(G),q=e=>{let t=Number(e);return e!=null&&e.trim()!==``&&Number.isFinite(t)?t:void 0},J={"5h":`5h`,"7d":`Weekly`,"7d_oi":`Fable`};function _e(e,t){return e?Math.abs(e-10080)<60?`Weekly`:e%1440==0?`${e/1440}d`:e>=60?`${Math.round(e/60)}h`:`${e}m`:t===`primary`?`5h`:`Weekly`}var ve=e=>e.replace(/(^|-)([a-z])/g,(e,t,n)=>(t?` `:``)+n.toUpperCase()),Y=e=>!!e&&Object.keys(e.signals??{}).length>0;function ye(e,t,n){if(!Y(t))return[];let r=Object.fromEntries(Object.entries(t.signals).map(([e,t])=>[e.toLowerCase(),t])),i=Date.parse(t.observed_at??``)||n,a=[],o=e=>{let t=e.resetsAt!==void 0&&e.resetsAt<=n,r=t?0:Math.min(1,Math.max(0,e.used)),i=t?`ok`:e.rejected||e.used>=1?`exhausted`:e.warned||e.used>=.8?`warning`:`ok`;a.push({id:e.id,label:e.label,used:r,resetsAt:t?void 0:e.resetsAt,reset:t,level:i})};if(e===`claude`){let e=`anthropic-ratelimit-unified-`,t=Object.keys(r).filter(t=>t.startsWith(e)&&t.endsWith(`-utilization`)).map(e=>e.slice(28,-12)).filter(e=>e!==`overage`),n=e=>e in J?Object.keys(J).indexOf(e):99;for(let i of t.sort((e,t)=>n(e)-n(t)||e.localeCompare(t))){let t=q(r[`${e}${i}-utilization`]);if(t===void 0)continue;let n=q(r[`${e}${i}-reset`]),a=r[`${e}${i}-status`];o({id:i,label:J[i]??i,used:t,resetsAt:n?n*1e3:void 0,rejected:a===`rejected`,warned:a===`allowed_warning`})}}else if(e===`codex`){let e=[];for(let t of Object.keys(r)){let n=/^x-codex-(?:(.+)-)?(primary|secondary)-used-percent$/.exec(t);n&&e.push({scope:n[1]??``,slot:n[2]})}e.sort((e,t)=>e.scope.localeCompare(t.scope)||e.slot.localeCompare(t.slot));for(let{scope:t,slot:n}of e){let e=`x-codex-${t?`${t}-`:``}${n}-`,a=q(r[`${e}used-percent`]);if(a===void 0)continue;let s=q(r[`${e}reset-at`]),c=q(r[`${e}reset-after-seconds`]),l=_e(q(r[`${e}window-minutes`]),n),u=t&&(r[`x-codex-${t}-limit-name`]||ve(t.replace(/^additional-/,``)));o({id:`${t}:${n}`,label:u?`${u} · ${l}`:l,used:a/100,resetsAt:s?s*1e3:c===void 0?void 0:i+c*1e3})}}return a}var X=t(),Z=[`claude`,`codex`];function be(e,t){let n=e=>Z.includes(e.provider)?Z.indexOf(e.provider):Z.length;return n(e)-n(t)||e.provider.localeCompare(t.provider)||(t.priority??0)-(e.priority??0)||(e.id<t.id?-1:+(e.id>t.id))}function xe(e){let t=Math.max(1,Math.round(e/6e4)),n=Math.floor(t/1440),r=Math.floor(t%1440/60);return n?`${n}d ${r}h`:r?`${r}h ${t%60}m`:`${t}m`}function Se({running:e}){let t=H(3e4),n=a({...y.credentials(),enabled:e}),i=a({...y.limits(),enabled:e}),s=a({...y.config(),enabled:e}),c=[...n.data?.files??[]].sort(be),l=me(s.data),u=he(c)&&!U(l);return(0,X.jsxs)(N,{children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Accounts`}),(0,X.jsx)(O,{children:`Usage limits as each provider last reported them.`}),(0,X.jsx)(k,{children:(0,X.jsx)(r,{variant:`ghost`,size:`sm`,asChild:!0,children:(0,X.jsxs)(b,{to:`/credentials`,children:[`Manage `,(0,X.jsx)(K,{})]})})})]}),(0,X.jsx)(j,{children:e?n.isPending?(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(o,{className:`h-12 w-full`}),(0,X.jsx)(o,{className:`h-12 w-full`})]}):c.length===0?(0,X.jsxs)(Q,{children:[`No accounts yet.`,` `,(0,X.jsx)(b,{to:`/credentials`,className:`text-foreground underline underline-offset-4`,children:`Add one`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`ul`,{className:`divide-y`,children:c.map(e=>(0,X.jsx)(Ce,{account:e,reading:Y(e.quota)?e.quota:i.data?.[e.name],now:t},e.id))}),s.data&&(0,X.jsxs)(`p`,{className:`mt-4 flex flex-wrap items-center gap-x-2 gap-y-1 border-t pt-3 text-xs text-muted-foreground`,children:[(0,X.jsxs)(R,{variant:`outline`,className:`gap-1.5 font-normal`,children:[u&&(0,X.jsx)(m,{tone:`warn`}),pe(l.strategy),l.affinity&&` · sticky sessions`]}),u?`Conversations can move between accounts and lose their prompt cache.`:U(l)?`One account is used until it runs out, and each conversation stays on its account.`:`How requests are spread across accounts.`,(0,X.jsx)(b,{to:`/settings`,className:`text-foreground underline underline-offset-4`,children:u?`Fix in Settings`:`Routing settings`})]})]}):(0,X.jsx)(Q,{children:`Start CLIProxyAPI to see your accounts.`})})]})}function Q({children:e}){return(0,X.jsx)(`div`,{className:`rounded-lg border border-dashed p-6 text-center text-sm text-muted-foreground`,children:e})}function Ce({account:e,reading:t,now:n}){let r=ye(e.provider,t,n),i=e.recent_requests.at(-1),a=V(e)===`active`&&!!i&&i.success+i.failed>0,o=t?.observed_at?Date.parse(t.observed_at):void 0;return(0,X.jsxs)(`li`,{className:`grid items-start gap-x-8 gap-y-3 py-4 first:pt-0 last:pb-0 lg:grid-cols-[minmax(0,17rem)_minmax(0,1fr)]`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm font-medium`,children:z(e)}),(0,X.jsx)(R,{variant:`secondary`,className:`h-4.5 px-1.5 text-[11px]`,children:L(e.provider)}),e.id_token?.plan_type&&(0,X.jsx)(R,{variant:`outline`,className:`h-4.5 px-1.5 text-[11px] capitalize`,children:e.id_token.plan_type})]}),(0,X.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:V(e)===`active`?(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,X.jsx)(m,{tone:`good`,pulse:a}),a?`In use`:`Ready`]}):(0,X.jsx)(B,{credential:e})})]}),r.length?(0,X.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-3 xl:grid-cols-4`,children:r.map(e=>(0,X.jsx)(Te,{window:e,now:n,observedAt:o},e.id))}):(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground lg:pt-0.5`,children:[`claude`,`codex`].includes(e.provider)?`No reading yet. Limits appear after this account's next request.`:`This provider does not report usage limits.`})]})}var we={ok:{track:`bg-chart-1/15`,fill:`bg-chart-1`},warning:{track:`bg-warning/25`,fill:`bg-warning`},exhausted:{track:`bg-critical/20`,fill:`bg-critical`}};function Te({window:e,now:t,observedAt:r}){let i=Math.round(e.used*100),a=we[e.level],o=e.resetsAt?`resets in ${xe(e.resetsAt-t)}`:void 0,s=e.reset?`Reset, unused since`:e.level===`exhausted`?[`Limit reached`,o].filter(Boolean).join(` · `):o;return(0,X.jsxs)(ue,{children:[(0,X.jsx)(E,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`min-w-0 cursor-default space-y-1.5`,role:`meter`,"aria-label":`${e.label} limit`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,children:[(0,X.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-xs`,children:[(0,X.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.label}),(0,X.jsxs)(`span`,{className:`font-medium tabular`,children:[i,`%`]})]}),(0,X.jsx)(`div`,{className:n(`h-1.5 overflow-hidden rounded-full`,a.track),children:(0,X.jsx)(`div`,{className:n(`h-full rounded-full`,a.fill),style:{width:`${i}%`,minWidth:i>0?4:0}})}),(0,X.jsx)(`div`,{className:`text-[11px] text-muted-foreground first-letter:uppercase`,children:s??`\xA0`})]})}),(0,X.jsxs)(D,{children:[(0,X.jsxs)(`div`,{className:`font-medium`,children:[e.label,`: `,i,`% used`]}),e.resetsAt&&(0,X.jsxs)(`div`,{children:[`Resets `,new Date(e.resetsAt).toLocaleString(void 0,{weekday:`short`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})]}),e.reset&&(0,X.jsx)(`div`,{children:`This window has reset since the last reading.`}),r&&(0,X.jsxs)(`div`,{className:`opacity-80`,children:[`Reported `,g(r)]})]})]})}function Ee(e,t){let n=e.replace(/^v/,``).split(`.`).map(Number),r=t.replace(/^v/,``).split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=(n[e]??0)-(r[e]??0);if(t)return t}return 0}function De(){let e=H(6e4),{data:t}=a(y.status()),n=t?.process.state===`running`,i=a(v.summary({from:e-864e5,to:e})),c=i.data?.totals;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p,{title:`Overview`,description:`Health of your CLIProxyAPI instance and the last 24 hours of traffic.`,actions:(0,X.jsx)(r,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(b,{to:`/connect`,children:[(0,X.jsx)(x,{}),`Connect Claude Code`]})})}),(0,X.jsx)(Oe,{status:t}),(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-4`,children:[(0,X.jsx)(s,{label:`Requests · 24h`,icon:ae,loading:!i.data,value:h(c?.requests),hint:c?.failed?`${h(c.failed)} failed`:`No failures`}),(0,X.jsx)(s,{label:`Success rate`,icon:C,loading:!i.data,value:c?.requests?f(1-c.failed/c.requests):`—`,hint:`Across all credentials`}),(0,X.jsx)(s,{label:`Tokens · 24h`,icon:S,loading:!i.data,value:d(c?.total),hint:c?.total?`${d(c.input)} in · ${d(c.output)} out · ${d(c.cached)} cached`:void 0}),(0,X.jsx)(s,{label:`Avg latency`,icon:ne,loading:!i.data,value:u(c?.avgLatency),hint:c?.avgTtft?`${u(c.avgTtft)} to first token`:void 0})]}),(0,X.jsx)(Se,{running:n}),(0,X.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,X.jsxs)(N,{className:`lg:col-span-2`,children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Requests`}),(0,X.jsx)(O,{children:`Last 24 hours`}),(0,X.jsx)(k,{children:(0,X.jsx)(r,{variant:`ghost`,size:`sm`,asChild:!0,children:(0,X.jsxs)(b,{to:`/usage`,children:[`Usage `,(0,X.jsx)(K,{})]})})})]}),(0,X.jsx)(j,{children:i.data?(0,X.jsx)(ie,{series:i.data.series,bucketMs:i.data.bucketMs}):(0,X.jsx)(o,{className:`h-64 w-full`})})]}),(0,X.jsxs)(N,{children:[(0,X.jsxs)(A,{children:[(0,X.jsx)(M,{children:`Top models`}),(0,X.jsx)(O,{children:`By requests, last 24 hours`})]}),(0,X.jsx)(j,{children:(0,X.jsx)(re,{items:(i.data?.byModel??[]).slice(0,6).map(e=>({key:e.key,label:e.key||`unknown`,value:e.requests,hint:`${d(e.total)} tok`}))})})]})]})]})}function Oe({status:e}){let t=fe(),n=a(y.latestRelease()),s=_({mutationFn:e=>i(`/process/${e}`,{method:`POST`}),onSettled:()=>t.invalidateQueries({queryKey:[`console`,`status`]})}),u=_({mutationFn:e=>i(`/release/install`,{body:{tag:e}}),onError:e=>de.error(`Could not install CLIProxyAPI`,{description:e.message}),onSettled:()=>t.invalidateQueries({queryKey:[`console`,`status`]})});if(!e)return(0,X.jsx)(o,{className:`h-36 w-full rounded-xl`});let{process:d,cpa:f}=e,p=ee[d.state],h=f.install,v=h&&![`done`,`error`].includes(h.phase),b=n.data&&f.version&&Ee(n.data.tag,f.version)>0,x=s.isPending||d.state===`starting`||d.state===`stopping`||!!v;return(0,X.jsxs)(N,{children:[(0,X.jsxs)(A,{children:[(0,X.jsxs)(M,{className:`flex items-center gap-2.5`,children:[`CLIProxyAPI`,(0,X.jsxs)(R,{variant:`outline`,className:`gap-1.5`,children:[(0,X.jsx)(m,{tone:p.tone,pulse:d.state===`starting`}),p.label]})]}),(0,X.jsxs)(O,{children:[`Managed by this console · data in `,e.dataDir]}),(0,X.jsx)(k,{className:`flex gap-2`,children:d.state===`running`||d.state===`starting`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(r,{variant:`outline`,size:`sm`,disabled:x,onClick:()=>s.mutate(`restart`),children:[s.isPending&&s.variables===`restart`?(0,X.jsx)(w,{}):(0,X.jsx)(le,{}),`Restart`]}),(0,X.jsxs)(r,{variant:`outline`,size:`sm`,disabled:x,onClick:()=>T({title:`Stop CLIProxyAPI?`,description:`Clients will get connection errors until you start it again. It stays stopped across console restarts.`,confirmLabel:`Stop`,destructive:!0,onConfirm:()=>s.mutateAsync(`stop`)}),children:[(0,X.jsx)(se,{}),`Stop`]})]}):f.version?(0,X.jsxs)(r,{size:`sm`,disabled:x,onClick:()=>s.mutate(`start`),children:[s.isPending?(0,X.jsx)(w,{}):(0,X.jsx)(oe,{}),`Start`]}):(0,X.jsxs)(r,{size:`sm`,disabled:!!v||u.isPending,onClick:()=>u.mutate(void 0),children:[v||u.isPending?(0,X.jsx)(w,{}):(0,X.jsx)(ge,{}),`Install CLIProxyAPI`]})})]}),(0,X.jsxs)(j,{className:`space-y-4`,children:[(0,X.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-6 gap-y-3 text-sm sm:grid-cols-4`,children:[(0,X.jsx)($,{label:`Version`,value:f.version??`Not installed`}),(0,X.jsx)($,{label:`Uptime`,value:d.startedAt?l(Date.now()-d.startedAt):`—`}),(0,X.jsx)($,{label:`Listening on`,value:e.config?`${e.config.host||`0.0.0.0`}:${d.port??e.config.port}`:`—`}),(0,X.jsx)($,{label:`Crash restarts`,value:d.restarts?String(d.restarts):`None`})]}),d.state===`running`&&e.config&&d.port&&e.config.port!==d.port&&(0,X.jsxs)(I,{children:[(0,X.jsx)(P,{children:`Restart to apply the new port`}),(0,X.jsxs)(F,{children:[`config.yaml now uses port `,e.config.port,`, but CLIProxyAPI is still listening on `,d.port,`.`]})]}),d.lastError&&d.state!==`running`&&(0,X.jsxs)(I,{variant:`destructive`,children:[(0,X.jsx)(P,{children:`Last error`}),(0,X.jsx)(F,{className:`font-mono text-xs`,children:d.lastError})]}),v&&h&&(0,X.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-muted/40 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,X.jsx)(w,{}),` Installing `,h.tag,` · `,h.phase]}),h.total>0&&(0,X.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular`,children:[c(h.received),` / `,c(h.total)]})]}),(0,X.jsx)(ce,{value:h.total?h.received/h.total*100:50})]}),h?.phase===`error`&&(0,X.jsxs)(I,{variant:`destructive`,children:[(0,X.jsxs)(P,{children:[`Update to `,h.tag,` failed`]}),(0,X.jsx)(F,{children:h.error})]}),b&&!v&&n.data&&(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-lg border border-chart-1/30 bg-chart-1/5 p-3 text-sm`,children:[(0,X.jsx)(te,{className:`size-4 text-chart-1`}),(0,X.jsxs)(`span`,{className:`flex-1`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:n.data.tag}),` is available`,(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · released `,g(n.data.publishedAt),` · `]}),(0,X.jsx)(`a`,{href:n.data.url,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-4`,children:`Release notes`})]}),(0,X.jsx)(r,{size:`sm`,onClick:()=>T({title:`Update to ${n.data.tag}?`,description:`The release is downloaded and checksum-verified first. CLIProxyAPI then restarts, which interrupts in-flight requests for a moment.`,confirmLabel:`Update`,onConfirm:()=>u.mutateAsync(n.data.tag)}),children:`Update`})]})]})]})}function $({label:e,value:t}){return(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,X.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`truncate font-medium tabular`,children:t})]})}export{De as component};
@@ -0,0 +1 @@
1
+ import{L as e,R as t,V as n,o as r}from"./api-Dh4YY48y.js";import{O as i}from"./common-C0aFgyuv.js";import{t as a}from"./queries-BJ9EwxPS.js";import{t as o}from"./link-DifxDKVd.js";import{t as s}from"./useNavigate-BAHKKgya.js";import{a as c,i as l,r as u,t as d}from"./app-sidebar-Dd10AKfw.js";import{$ as f,J as p,O as m}from"./index-09oWu5UQ.js";var h=n(t()),g=e();function _(){let e=s(),{data:t}=i(a.status());(0,h.useEffect)(()=>{let t=()=>e({to:`/login`});return window.addEventListener(`cpa-console:logout`,t),()=>window.removeEventListener(`cpa-console:logout`,t)},[e]);let n=t?.process.state;return(0,g.jsxs)(l,{children:[(0,g.jsx)(d,{}),(0,g.jsxs)(u,{className:`min-w-0`,children:[(0,g.jsxs)(`header`,{className:`sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 rounded-t-xl border-b bg-background/80 px-4 backdrop-blur`,children:[(0,g.jsx)(c,{className:`-ml-1`}),(0,g.jsx)(`div`,{className:`flex-1`}),(0,g.jsx)(m,{})]}),(n===`stopped`||n===`crashed`)&&(0,g.jsxs)(`div`,{className:`flex items-center gap-3 border-b bg-critical/10 px-6 py-2.5 text-sm`,children:[(0,g.jsx)(p,{className:`size-4 shrink-0 text-critical`}),(0,g.jsxs)(`span`,{className:`flex-1`,children:[`CLIProxyAPI is `,n,`. Management pages are unavailable until it runs.`,t?.process.lastError&&(0,g.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,t.process.lastError]})]}),(0,g.jsx)(r,{size:`sm`,variant:`outline`,asChild:!0,children:(0,g.jsx)(o,{to:`/`,children:`Go to overview`})})]}),(0,g.jsx)(`div`,{className:`mx-auto w-full max-w-7xl flex-1 space-y-6 p-4 md:p-6 lg:p-8`,children:(0,g.jsx)(f,{})})]})]})}export{_ as component};
@@ -0,0 +1 @@
1
+ import{L as e,M as t,R as n,j as r}from"./api-Dh4YY48y.js";n();var i=e(),a=t(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function o({className:e,variant:t,...n}){return(0,i.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:r(a({variant:t}),e),...n})}function s({className:e,...t}){return(0,i.jsx)(`div`,{"data-slot":`alert-title`,className:r(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function c({className:e,...t}){return(0,i.jsx)(`div`,{"data-slot":`alert-description`,className:r(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function l({className:e,...t}){return(0,i.jsx)(`div`,{"data-slot":`alert-action`,className:r(`absolute top-2 right-2`,e),...t})}export{s as i,l as n,c as r,o as t};
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var ee={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ee,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=l(d(),1),_=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function v(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:_(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var y=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},b=e=>{let t=y(e);return t.charAt(0).toUpperCase()+t.slice(1)},x=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),S={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function C(e){return e!=null}function w(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??S.width,a=e.size??e.height??S.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?x(...c):x(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??S[`stroke-width`])*Number(e.size??e.width??S.width)/Number(t.size??t.width??S.width):t.strokeWidth??S[`stroke-width`];return[`svg`,{...Object.entries(S).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&C(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&C(t.width)&&{[r(`width`)]:t.width},...`height`in t&&C(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function T(e,t={}){return w(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var E=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},D=(0,g.createContext)({}),O=()=>(0,g.useContext)(D),k=(0,g.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=O()??{},b=!!c||E(d),[S,C,w=[]]=T(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??_,className:x(y,s),hasA11yProp:b,attributes:d});return(0,g.createElement)(S,{ref:f,...C},[...w.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function A(e,t=[],n=[]){let r=typeof e==`string`?v(e,t,n):e,i=(0,g.forwardRef)(({className:e,...t},n)=>(0,g.createElement)(k,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=b(r.name)),i}var j={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};j.node;var M=A(j),N=p(),P=l(h(),1);function F(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=F(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function I(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=F(e))&&(r&&(r+=` `),r+=t);return r}var L=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,R=I,z=(e,t)=>n=>{if(t?.variants==null)return R(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=L(t)||L(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return R(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ee=48,B=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-ee-t;return n},te=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},V=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-ee;n+=i>>>1^-(i&1),t[r]=n}return t},H=384,ne=[],U=te(B(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),re=te(B(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),ie=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,ae=(()=>{let e=U.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=U[n];i<U[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(U[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=U[i];a<U[i+1];a++)n[r++]=e,e+=t[e]}return n})(),oe=B(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),se=te(B(`123333359346463635126536711576`)),ce=B(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),le=B(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ue=V(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),de=(()=>{let e=new Int32Array(319).fill(-1),t=V(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=V(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),fe=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),pe=V(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),me=V(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),he=V(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),ge=new Int32Array(995),_e=new Int32Array(995),ve=new Int32Array(995),ye=``,be=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<pe.length;r++)for(let i of fe[he[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),be[a*2]=ye.length,be[a*2+1]=i.length,ye+=i),ge[n]=pe[r],_e[n]=me[r],ve[n]=a,n++}}var xe=V(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),Se=te(B(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Ce=V(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),we=B(`ij`),Te=B(`—`),Ee=B(`1`),De={GROUP_COUNT:H,customValidatorNames:ne,edgeStart:U,labelStart:re,labelText:ie,edgeTarget:ae,nodeGroup:oe,nodeVlist:de,vlistPat:se,vlistOps:ce,vlistRef:le,vlistGroup:ue,litAnchor:ge,litGroup:_e,litPool:ve,poolOffsets:be,poolText:ye,adjGid:xe,adjStart:Se,adjTgt:Ce,patGid:we,patTgt:Te,postfixLookupGroups:Ee,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Oe=`line`in Error(),ke=-1,Ae=-1,je=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Me=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Ne=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(je(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(je(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,ee=n.prefix??e.prefix??``,B=ee===``?``:ee+`:`,te=B.length,V=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),H=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ne=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,U=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,re=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=0,ae=-1,oe=-1,se=-1,ce=-1,le=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(e,t,n)=>{if(ie=0,ae=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ie=1;else if(r===40&&i===41)ie=2;else return;se=t+1,ce=n-1;let a=t+1;if(le(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!le(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(ae=t+1,oe=a,se=a+1)}},fe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],be=(e,t,n,r)=>{if(e>=10){if(e>=25)return V[e-25](t.slice(n,r));let i=e-10;if(ie!==_e[i])return!1;if(ae>=0){for(let e of ve[i])if(fe(t,ae,oe,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(se,ce);return H.test(e)&&!ne.test(e)}case 3:return he(t.slice(se,ce));case 4:return re.test(t.slice(se,ce));default:return U.test(t.slice(se,ce))}}switch(e){case 0:return!0;case 1:return ie===0;case 2:return ie===1;case 3:return ie===2;case 4:return pe.test(t.slice(n,r));case 5:return he(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},xe=new Set(typeof E==`string`?E.split(` `):E),Se=(e,t,n,r,i,a)=>{let o=je(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ce=new Map,we=new Map,Te=2,Ee=4096,De=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||xe.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=we.get(s);return c===void 0&&we.set(s,c=Te++),c},Ne=new Map,Pe=r,Fe=r+4096,Le=()=>Pe++,Re=2097152,ze=8192,Be=new Int32Array(ze),Ve=Array(ze).fill(null),He=new Int32Array(ze),Ue=new Int32Array(ze),We=new Uint8Array(ze),Ge=0,Ke=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ve[e]!==null){if(Ve[e|1]===null)c=e|1;else if(!(Ge++&3))c=e|Ge>>2&1;else return}Ve[c]=t.slice(n,r),Be[c]=i,He[c]=a,Ue[c]=o,We[c]=s},qe=()=>Ve.fill(null),W=256,Je=[new Int32Array(W),new Int32Array(W),new Int32Array(W),new Int32Array(W)],[G,Ye,Xe,Ze]=Je,Qe=new Uint8Array(W),$e=new Uint8Array(W),et=()=>{W*=2,Je=Je.map(e=>{let t=new Int32Array(W);return t.set(e),t}),[G,Ye,Xe,Ze]=Je;let e=new Uint8Array(W);e.set(Qe),Qe=e,$e=new Uint8Array(W)},tt=64,nt=new Int32Array(tt),rt=new Int32Array(tt),it=new Int32Array(r),at=2048,ot=21,st=new Float64Array(at),ct=new Int32Array(at),K=0,lt=(e,t)=>{if(e===0&&t<r)return it[t]===K?1:(it[t]=K,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>ot;for(;ct[i]===K;){if(st[i]===n)return 1;i=i+1&at-1}return st[i]=n,ct[i]=K,0},ut=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?ke:Se(Ne,e,t+1,r,0,Le)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=rt[t];if(r>n)continue;let i=nt[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(be(d[t],e,r,n))return p[h+t]}return ke},dt=e=>{let t=e.length,n=0,c=0,u=!1;(Te>Ee||Ce.size>Ee)&&(Ce=new Map,we=new Map,Te=2,qe()),Pe>Fe&&(Ne=new Map,Pe=r,qe());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===W&&et();let _=n++;G[_]=p,Ye[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Be[y]===v&&Ve[y]!==null&&Ve[y].length===g?t=y:Be[y|1]===v&&Ve[y|1]!==null&&Ve[y|1].length===g&&(t=y|1),t>=0){let n=Ve[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Xe[_]=He[t],Ze[_]=Ue[t],Qe[_]=We[t];continue}}}let b=p;if(te!==0){if(h-p<=te||!e.startsWith(B,p)){Xe[_]=ke,Ke(y,e,p,h,v,ke,0,0);continue}b=p+te}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(nt[0]=0,rt[0]=M,R=1);let z=Ae,ee=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Ae:P,ee=R),P!==Ae){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Ae;else{let e=i[P],t=i[P+1],c=Ae;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===tt){tt*=2;let e=new Int32Array(tt);e.set(nt),nt=e;let t=new Int32Array(tt);t.set(rt),rt=t}nt[R]=r,rt[R]=t+2,R++}}A===D&&(z=F<I?Ae:P,ee=R);let V=F<I?Ae:P,H,ne=!1;if(A>=0){if(ne=!0,H=ut(e,E,A,z,ee),H!==ke&&H<r&&j[H]){let t=ut(e,E,D,V,R);t!==ke&&t!==H&&(H=t,ne=!1)}else H===ke&&(H=ut(e,E,D,V,R),ne=!1)}else H=ut(e,E,D,V,R);let U=0,re=0;H===ke?Xe[_]=ke:(re=+!!ne,U=b>=C?+!!O:Se(Ce,e,b,C,+!!O,e=>De(e,O)),Xe[_]=H,Qe[_]=re,Ze[_]=U),Ke(y,e,p,h,v,H,U,re)}if(n===0)return``;if(n===1)return G[0]===0&&Ye[0]===t?e:e.slice(G[0],Ye[0]);if(n*k>at){for(;n*k>at;)at<<=1,ot--;st=new Float64Array(at),ct=new Int32Array(at)}if(Te>=Re||Pe>=Re)throw Error(`cn: too many distinct classes in one merge`);K=K+1|0,K===0&&(it.fill(0),ct.fill(0),K=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Xe[e];if(t===ke){$e[e]=1;continue}let n=Ze[e];if(lt(n,t)===1)$e[e]=0,f=!0;else if($e[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)lt(n,x[e]);if(Qe[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&lt(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!$e[m]){m++;continue}let t=G[m],r=Ye[m],i=m+1;for(;i<n&&$e[i]&&G[i]===r+1&&e.charCodeAt(r)===32;)r=Ye[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},q=16384,ft=new Int32Array(q*2),J=0,Y=1,pt=Object.create(null),mt=Object.create(null),ht=new Map,gt=new Map,_t=0,vt=0,yt=()=>{J^=q,Y=Y+1|0,vt=0},bt=e=>{let t=pt[e];if(t!==void 0)return t;let n=Me(e,0,e.length),r=(n&16383)+J,i=ft[r]===(n^Y)||ft[r^q]===(n^Y-1);return i&&(t=mt[e],t!==void 0)?(pt[e]=t,t):(t=dt(e),i?(pt[e]=t,++_t>z&&(_t=0,mt=pt,pt=Object.create(null),yt())):(ft[r]=n^Y,++vt>q&&yt()),t)},xt=e=>{let t=ht.get(e);if(t!==void 0)return t;let n=Me(e,0,e.length),r=(n&16383)+J,i=ft[r]===(n^Y)||ft[r^q]===(n^Y-1);return i&&(t=gt.get(e),t!==void 0)?(ht.set(e,t),t):(t=dt(e),i?(ht.set(e,t),++_t>z&&(_t=0,gt=ht,ht=new Map,yt())):(ft[r]=n^Y,++vt>q&&yt()),t)},St=e=>{let t=Me(e,0,e.length),n=(t&16383)+J;return ft[n]===(t^Y)||ft[n^q]===(t^Y-1)||(ft[n]=t^Y,++vt>q&&yt(),!1)},X=z===0?dt:Oe?e=>{let t=ht.get(e);return t===void 0?xt(e):t}:bt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?X(arguments[0]):X(Ie.apply(null,arguments))},mergeString:X,seenBefore:z===0?()=>!1:St,mergeUncached:dt}},Pe=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Pe(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Fe=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Pe(i,t);a&&(n&&(n+=` `),n+=a)}return n},Ie=function(){return Fe(arguments,!1)},Le=256,Re=16,ze=1024,Be=4096,Ve=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Be).fill(``),l=Array(Be).fill(``),u=Array(Be).fill(``));let i=Me(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Pe(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Re&&(_.miss=Re,_.skip=ze,_.e.length=0,_.at=0);let u=_.e;u.length<Le?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Pe(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},He=Ne(De),Ue=Ve(He.mergeString,He);He.merge;var We=Object.defineProperty,Ge=(e,t)=>We(e,`name`,{value:t,configurable:!0});function Ke(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ge(Ke,`setRef`);function qe(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ke(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ke(e[t],null)}}}}Ge(qe,`composeRefs`);function W(...e){return g.useCallback(qe(...e),e)}Ge(W,`useComposedRefs`);var Je=Object.defineProperty,G=(e,t)=>Je(e,`name`,{value:t,configurable:!0});function Ye(e){let t=g.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];it(r)&&typeof K==`function`&&(r=K(r._payload)),g.Children.forEach(r,e=>{if(nt(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;it(n)&&typeof K==`function`&&(n=K(n._payload)),a=$e(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=g.cloneElement(a,void 0,s):!o&&g.Children.count(r)===1&&g.isValidElement(r)&&(a=r);let c=a?tt(a):void 0,l=W(n,c);if(!a){if(r||r===0)throw Error(o?ct(e):st(e));return r}let u=et(i,a.props??{});return a.type!==g.Fragment&&(u.ref=n?l:c),g.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}G(Ye,`createSlot`);var Xe=Ye(`Slot`),Ze=Symbol.for(`radix.slottable`);function Qe(e){let t=G(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ze,t}G(Qe,`createSlottable`);var $e=G((e,t)=>{if(`child`in e.props){let t=e.props.child;return g.isValidElement(t)?g.cloneElement(t,void 0,e.props.children(t.props.children)):null}return g.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function et(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=ot(a,i))}return{...e,...n}}G(et,`mergeProps`);function tt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}G(tt,`getElementRef`);function nt(e){return g.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ze}G(nt,`isSlottable`);var rt=Symbol.for(`react.lazy`);function it(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===rt&&`_payload`in e&&at(e._payload)}G(it,`isLazyComponent`);function at(e){return typeof e==`object`&&!!e&&`then`in e}G(at,`isPromiseLike`);function ot(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}G(ot,`concatAriaDescribedby`);var st=G(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ct=G(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),K=g.use,lt=Object.defineProperty,ut=(e,t)=>lt(e,`name`,{value:t,configurable:!0}),dt=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ye(`Primitive.${t}`),r=g.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,N.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function q(e,t){e&&P.flushSync(()=>e.dispatchEvent(t))}ut(q,`dispatchDiscreteCustomEvent`);var ft=Object.defineProperty,J=(e,t)=>ft(e,`name`,{value:t,configurable:!0});function Y(e,t){let n=g.createContext(t);n.displayName=e+`Context`;let r=J(e=>{let{children:t,...r}=e,i=g.useMemo(()=>r,Object.values(r));return(0,N.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=g.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return J(i,`useContext`),[r,i]}J(Y,`createContext`);function pt(e,t=[]){let n=[];function r(t,r){let i=g.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=J(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=g.useMemo(()=>o,Object.values(o));return(0,N.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=g.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return J(s,`useContext`),[o,s]}J(r,`createContext`);let i=J(()=>{let t=n.map(e=>g.createContext(e));return J(function(n){let r=n?.[e]||t;return g.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,mt(i,...t)]}J(pt,`createContextScope`);function mt(...e){let t=e[0];if(e.length===1)return t;let n=J(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return J(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}J(mt,`composeContextScopes`);var ht=Object.defineProperty,gt=(e,t)=>ht(e,`name`,{value:t,configurable:!0}),_t=!!(typeof window<`u`&&window.document&&window.document.createElement);function vt(e,t,{checkForDefaultPrevented:n=!0}={}){return gt(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}gt(vt,`composeEventHandlers`);function yt(e){if(!_t)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}gt(yt,`getOwnerWindow`);function bt(e){if(!_t)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}gt(bt,`getOwnerDocument`);function xt(e,t=!1){let{activeElement:n}=bt(e);if(!n?.nodeName)return null;if(St(n)&&n.contentDocument)return xt(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=bt(n).getElementById(e);if(t)return t}}return n}gt(xt,`getActiveElement`);function St(e){return e.tagName===`IFRAME`}gt(St,`isFrame`);var X=globalThis?.document?g.useLayoutEffect:()=>{},Ct=Object.defineProperty,wt=(e,t)=>Ct(e,`name`,{value:t,configurable:!0}),Tt=g.useEffectEvent,Et=g.useInsertionEffect;function Dt(e){if(typeof Tt==`function`)return Tt(e);let t=g.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Et==`function`?Et(()=>{t.current=e}):X(()=>{t.current=e}),g.useMemo(()=>((...e)=>t.current?.(...e)),[])}wt(Dt,`useEffectEvent`);var Ot=Object.defineProperty,kt=(e,t)=>Ot(e,`name`,{value:t,configurable:!0}),At=g.useInsertionEffect||X;function jt({prop:e,defaultProp:t,onChange:n=kt(()=>{},`onChange`),caller:r}){let[i,a,o]=Mt({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,g.useCallback(t=>{if(s){let n=Nt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}kt(jt,`useControllableState`);function Mt({defaultProp:e,onChange:t}){let[n,r]=g.useState(e),i=g.useRef(n),a=g.useRef(t);return At(()=>{a.current=t},[t]),g.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}kt(Mt,`useUncontrolledState`);function Nt(e){return typeof e==`function`}kt(Nt,`isFunction`);var Pt=Symbol(`RADIX:SYNC_STATE`);function Ft(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Dt(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=g.useReducer((t,n)=>{if(n.type===Pt)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=g.useRef(p);g.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=g.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return g.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Pt,state:i})},[i,d.state,c]),[h,f]}kt(Ft,`useControllableStateReducer`);var It=Object.defineProperty,Lt=(e,t)=>It(e,`name`,{value:t,configurable:!0});function Rt(e,t){return g.useReducer((e,n)=>t[e][n]??e,e)}Lt(Rt,`useStateMachine`);var zt=Lt(e=>{let{present:t,children:n}=e,r=Bt(t),i=typeof n==`function`?n({present:r.isPresent}):g.Children.only(n),a=Ht(r.ref,Wt(i));return typeof n==`function`||r.isPresent?g.cloneElement(i,{ref:a}):null},`Presence`);function Bt(e){let[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),a=g.useRef(`none`),o=g.useRef(void 0),[s,c]=Rt(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return g.useEffect(()=>{s===`mounted`?(a.current=o.current??Ut(r.current),o.current=void 0):a.current=`none`},[s]),X(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Ut(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),X(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Lt(a=>{let o=Ut(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Lt(e=>{e.target===t&&(a.current=Ut(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:g.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Ut(t)}else r.current=null;n(e)},[])}}Lt(Bt,`usePresence`);function Vt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Lt(Vt,`setRef`);function Ht(...e){let t=g.useRef(e);return t.current=e,g.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Vt(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Vt(n[e],null)}}},[])}Lt(Ht,`useStableComposedRefs`);function Ut(e){return e?.animationName||`none`}Lt(Ut,`getAnimationName`);function Wt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Lt(Wt,`getElementRef`);var Gt=Object.defineProperty,Kt=(e,t)=>Gt(e,`name`,{value:t,configurable:!0}),qt=g.useId||(()=>void 0),Jt=0;function Yt(e){let[t,n]=g.useState(qt());return X(()=>{e||n(e=>e??String(Jt++))},[e]),e||(t?`radix-${t}`:``)}Kt(Yt,`useId`);var Xt=Object.defineProperty,Zt=(e,t)=>Xt(e,`name`,{value:t,configurable:!0});function Qt(e){let t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>((...e)=>t.current?.(...e)),[])}Zt(Qt,`useCallbackRef`);var $t=Object.defineProperty,Z=(e,t)=>$t(e,`name`,{value:t,configurable:!0}),en=`dismissableLayer.update`,tn=`dismissableLayer.pointerDownOutside`,nn=`dismissableLayer.focusOutside`,rn,an=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),on=g.forwardRef(Z(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=g.useContext(an),[d,f]=g.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=g.useState({}),h=W(t,f),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=g.useRef(!1),w=ln(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=un(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===_.length-1:!1,D=Qt(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return g.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),g.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rn=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),dn(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=rn))}},[d,p,n,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),dn())},[d,u]),g.useEffect(()=>{let e=Z(()=>m({}),`handleUpdate`);return document.addEventListener(en,e),()=>document.removeEventListener(en,e)},[]),(0,N.jsx)(dt.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:vt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:vt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:vt(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function sn(){let e=g.useContext(an),[t,n]=g.useState(null);return g.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Z(sn,`useDismissableLayerSurface`);var cn=Z(()=>!0,`IS_TRUE`);function ln(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=cn}=t,s=Qt(e),c=g.useRef(!1),l=g.useRef(!1),u=g.useRef(new Map),d=g.useRef(()=>{});return g.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Z(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Z(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Z(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Z(p,`handleInteractionBubble`);let m=Z(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||fn(tn,s,p,{discrete:!0})};if(Z(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Z(()=>c.current=!0,`onPointerDownCapture`)}}Z(ln,`usePointerDownOutside`);function un(e,t=globalThis?.document){let n=Qt(e),r=g.useRef(!1);return g.useEffect(()=>{let e=Z(e=>{e.target&&!r.current&&fn(nn,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Z(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Z(()=>r.current=!1,`onBlurCapture`)}}Z(un,`useFocusOutside`);function dn(){let e=new CustomEvent(en);document.dispatchEvent(e)}Z(dn,`dispatchUpdate`);function fn(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?q(i,a):i.dispatchEvent(a)}Z(fn,`handleAndDispatchCustomEvent`);var pn=Object.defineProperty,mn=g.forwardRef(((e,t)=>pn(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=g.useState(!1);X(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?P.createPortal((0,N.jsx)(dt.div,{...r,ref:t}),o):null},`Portal`)),hn=Object.defineProperty,gn=(e,t)=>hn(e,`name`,{value:t,configurable:!0});function _n(e){let[t,n]=g.useState(void 0);return X(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}gn(_n,`useSize`);var vn=[`top`,`right`,`bottom`,`left`],yn=Math.min,bn=Math.max,xn=Math.round,Sn=Math.floor,Cn=e=>({x:e,y:e}),wn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Tn(e,t,n){return bn(e,yn(t,n))}function En(e,t){return typeof e==`function`?e(t):e}function Dn(e){return e.split(`-`)[0]}function On(e){return e.split(`-`)[1]}function kn(e){return e===`x`?`y`:`x`}function An(e){return e===`y`?`height`:`width`}function Q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function jn(e){return kn(Q(e))}function Mn(e,t,n){n===void 0&&(n=!1);let r=On(e),i=jn(e),a=An(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Vn(o)),[o,Vn(o)]}function Nn(e){let t=Vn(e);return[Pn(e),t,Pn(t)]}function Pn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Fn=[`left`,`right`],In=[`right`,`left`],Ln=[`top`,`bottom`],Rn=[`bottom`,`top`];function zn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?In:Fn:t?Fn:In;case`left`:case`right`:return t?Ln:Rn;default:return[]}}function Bn(e,t,n,r){let i=On(e),a=zn(Dn(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Pn)))),a}function Vn(e){let t=Dn(e);return wn[t]+e.slice(t.length)}function Hn(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Un(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Hn(e)}function Wn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Gn(e,t,n){let{reference:r,floating:i}=e,a=Q(t),o=jn(t),s=An(o),c=Dn(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=On(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Kn(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=En(t,e),p=Un(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Wn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Wn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var qn=50,Jn=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Kn},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Gn(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<qn&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Gn(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Yn=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=En(e,t)||{};if(l==null)return{};let d=Un(u),f={x:n,y:r},p=jn(i),m=An(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=yn(d[_],T),D=yn(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Tn(E,k,O),j=!c.arrow&&On(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Xn=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=En(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Dn(r),_=Q(o),v=Dn(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Vn(o)]:Nn(o)),x=p!==`none`;!d&&x&&b.push(...Bn(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Mn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Q(t)||T.every(e=>Q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Q(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Zn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qn(e){return vn.some(t=>e[t]>=0)}var $n=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=En(e,t);switch(i){case`referenceHidden`:{let e=Zn(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Qn(e)}}}case`escaped`:{let e=Zn(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Qn(e)}}}default:return{}}}}},er=new Set([`left`,`top`]);async function tr(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Dn(n),s=On(n),c=Q(n)===`y`,l=er.has(o)?-1:1,u=a&&c?-1:1,d=En(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var nr=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await tr(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},rr=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=En(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Q(i),p=kn(f),m=u[p],h=u[f],g=(e,t)=>Tn(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ir=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=En(e,t),u={x:n,y:r},d=Q(i),f=kn(d),p=u[f],m=u[d],h=En(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=er.has(Dn(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ar=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=En(e,t),c=await i.detectOverflow(t,s),l=Dn(n),u=On(n),d=Q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=yn(p-c[m],g),y=yn(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*bn(c.left,c.right):S=p-2*bn(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function or(){return typeof window<`u`}function sr(e){return lr(e)?(e.nodeName||``).toLowerCase():`#document`}function $(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cr(e){return((lr(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function lr(e){return or()?e instanceof Node||e instanceof $(e).Node:!1}function ur(e){return or()?e instanceof Element||e instanceof $(e).Element:!1}function dr(e){return or()?e instanceof HTMLElement||e instanceof $(e).HTMLElement:!1}function fr(e){return!or()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof $(e).ShadowRoot}function pr(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=wr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function mr(e){return/^(table|td|th)$/.test(sr(e))}function hr(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var gr=/transform|translate|scale|rotate|perspective|filter/,_r=/paint|layout|strict|content/,vr=e=>!!e&&e!==`none`,yr;function br(e){let t=ur(e)?wr(e):e;return vr(t.transform)||vr(t.translate)||vr(t.scale)||vr(t.rotate)||vr(t.perspective)||!Sr()&&(vr(t.backdropFilter)||vr(t.filter))||gr.test(t.willChange||``)||_r.test(t.contain||``)}function xr(e){let t=Er(e);for(;dr(t)&&!Cr(t);){if(br(t))return t;if(hr(t))return null;t=Er(t)}return null}function Sr(){return yr??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),yr}function Cr(e){return/^(html|body|#document)$/.test(sr(e))}function wr(e){return $(e).getComputedStyle(e)}function Tr(e){return ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Er(e){if(sr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fr(e)&&e.host||cr(e);return fr(t)?t.host:t}function Dr(e){let t=Er(e);return Cr(t)?(e.ownerDocument||e).body:dr(t)&&pr(t)?t:Dr(t)}function Or(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Dr(e),i=r===e.ownerDocument?.body,a=$(r);if(i){let e=kr(a);return t.concat(a,a.visualViewport||[],pr(r)?r:[],e&&n?Or(e):[])}return t.concat(r,Or(r,[],n))}function kr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ar(e){let t=wr(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=dr(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=xn(n)!==a||xn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function jr(e){return ur(e)?e:e.contextElement}function Mr(e){let t=jr(e);if(!dr(t))return Cn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ar(t),o=(a?xn(n.width):n.width)/r,s=(a?xn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Nr=Cn(0);function Pr(e){let t=$(e);return!Sr()||!t.visualViewport?Nr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Fr(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===$(e)}function Ir(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=jr(e),o=Cn(1);t&&(r?ur(r)&&(o=Mr(r)):o=Mr(e));let s=Fr(a,n,r)?Pr(a):Cn(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=$(a),t=ur(r)?$(r):r,n=e,i=kr(n);for(;i&&t!==n;){let e=Mr(i),t=i.getBoundingClientRect(),r=wr(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=$(i),i=kr(n)}}return Wn({width:u,height:d,x:c,y:l})}function Lr(e,t){let n=Tr(e).scrollLeft;return t?t.left+n:Ir(cr(e)).left+n}function Rr(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Lr(e,n),y:n.top+t.scrollTop}}function zr(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=cr(r),s=t?hr(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Cn(1),u=Cn(0),d=dr(r);if((d||!a)&&((sr(r)!==`body`||pr(o))&&(c=Tr(r)),d)){let e=Ir(r);l=Mr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Rr(o,c):Cn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Br(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Vr(e){let t=Tr(e),n=e.ownerDocument.body,r=bn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=bn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Lr(e),o=-t.scrollTop;return wr(n).direction===`rtl`&&(a+=bn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Hr=25;function Ur(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=$(e),a=cr(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Sr()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Lr(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Hr&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Wr(e,t){let n=Ir(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Mr(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Gr(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ur(e,n,t);else if(t===`document`)r=Vr(cr(e));else if(ur(t))r=Wr(t,n);else{let n=Pr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wn(r)}function Kr(e,t){let n=t.get(e);if(n)return n;let r=Or(e,[],!1).filter(e=>ur(e)&&sr(e)!==`body`),i=null,a=wr(e).position===`fixed`,o=a?Er(e):e;for(;ur(o)&&!Cr(o);){let e=wr(o),t=br(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Er(o)}return t.set(e,r),r}function qr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?hr(t)?[]:Kr(t,this._c):[].concat(n),r],o=Gr(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Gr(t,a[e],i);s=bn(n.top,s),c=yn(n.right,c),l=yn(n.bottom,l),u=bn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Jr(e){let{width:t,height:n}=Ar(e);return{width:t,height:n}}function Yr(e,t,n){let r=dr(t),i=cr(t),a=n===`fixed`,o=Ir(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Cn(0);if((r||!a)&&((sr(t)!==`body`||pr(i))&&(s=Tr(t)),r)){let e=Ir(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Lr(i));let l=i&&!r&&!a?Rr(i,s):Cn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Xr(e){return wr(e).position===`static`}function Zr(e,t){if(!dr(e)||wr(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return cr(e)===n&&(n=n.ownerDocument.body),n}function Qr(e,t){let n=$(e);if(hr(e))return n;if(!dr(e)){let t=Er(e);for(;t&&!Cr(t);){if(ur(t)&&!Xr(t))return t;t=Er(t)}return n}let r=Zr(e,t);for(;r&&mr(r)&&Xr(r);)r=Zr(r,t);return r&&Cr(r)&&Xr(r)&&!br(r)?n:r||xr(e)||n}var $r=async function(e){let t=this.getOffsetParent||Qr,n=this.getDimensions,r=await n(e.floating);return{reference:Yr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ei(e){return wr(e).direction===`rtl`}var ti={convertOffsetParentRelativeRectToViewportRelativeRect:zr,getDocumentElement:cr,getClippingRect:qr,getOffsetParent:Qr,getElementRects:$r,getClientRects:Br,getDimensions:Jr,getScale:Mr,isElement:ur,isRTL:ei};function ni(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ri(e,t,n){let r=null,i,a=cr(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Sn(d),h=Sn(a.clientWidth-(u+f)),g=Sn(a.clientHeight-(d+p)),_=Sn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:bn(0,yn(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ni(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=$(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function ii(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=jr(e),u=i||a?[...l?Or(l):[],...t?Or(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ri(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ir(e):null;c&&g();function g(){let t=Ir(e);h&&!ni(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ai=nr,oi=rr,si=Xn,ci=ar,li=$n,ui=Yn,di=ir,fi=(e,t,n)=>{let r=new Map,i=n??{},a={...ti,...i.platform,_c:r};return Jn(e,t,{...i,platform:a})},pi=typeof document<`u`?g.useLayoutEffect:function(){};function mi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mi(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!mi(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function hi(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gi(e,t){let n=hi(e);return Math.round(t*n)/n}function _i(e){let t=g.useRef(e);return pi(()=>{t.current=e}),t}function vi(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);mi(f,r)||p(r);let[m,h]=g.useState(null),[_,v]=g.useState(null),y=g.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=g.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||_,C=g.useRef(null),w=g.useRef(null),T=g.useRef(u),E=c!=null,D=_i(c),O=_i(i),k=_i(l),A=g.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),fi(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!mi(T.current,t)&&(T.current=t,P.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);pi(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=g.useRef(!1);pi(()=>(j.current=!0,()=>{j.current=!1}),[]),pi(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=g.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=g.useMemo(()=>({reference:x,floating:S}),[x,S]),F=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=gi(N.floating,u.x),r=gi(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...hi(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:F}),[u,A,M,N,F])}var yi=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ui({element:r.current,padding:i}).fn(n):r?ui({element:r,padding:i}).fn(n):{}}}},bi=(e,t)=>{let n=ai(e);return{name:n.name,fn:n.fn,options:[e,t]}},xi=(e,t)=>{let n=oi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Si=(e,t)=>({fn:di(e).fn,options:[e,t]}),Ci=(e,t)=>{let n=si(e);return{name:n.name,fn:n.fn,options:[e,t]}},wi=(e,t)=>{let n=ci(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ti=(e,t)=>{let n=li(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ei=(e,t)=>{let n=yi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Di=Object.defineProperty,Oi=g.forwardRef(((e,t)=>Di(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,N.jsx)(dt.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,N.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),ki=Object.defineProperty,Ai=(e,t)=>ki(e,`name`,{value:t,configurable:!0}),ji={Partial:`partial`,Always:`always`},Mi={Optimized:`optimized`,Always:`always`},Ni=`Popper`,[Pi,Fi]=pt(Ni),[Ii,Li]=Pi(Ni),Ri=Ai(e=>{let{__scopePopper:t,children:n}=e,[r,i]=g.useState(null),[a,o]=g.useState(void 0);return(0,N.jsx)(Ii,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),zi=`PopperAnchor`,Bi=g.forwardRef(Ai(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Li(zi,n),o=g.useRef(null),s=a.onAnchorChange,c=W(t,g.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=g.useRef(null);g.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Xi(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,N.jsx)(dt.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Vi=`PopperContent`,[Hi,Ui]=Pi(Vi),Wi=g.forwardRef(Ai(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=ji.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=Mi.Optimized,onPlaced:m,...h}=e,_=Li(Vi,n),[v,y]=g.useState(null),b=W(t,y),[x,S]=g.useState(null),C=_n(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Ji),altBoundary:k},{refs:j,floatingStyles:M,placement:P,isPositioned:F,middlewareData:I}=vi({strategy:`fixed`,placement:E,whileElementsMounted:Ai((...e)=>ii(...e,{animationFrame:p===Mi.Always}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[bi({mainAxis:i+T,alignmentAxis:o}),c&&xi({mainAxis:!0,crossAxis:!1,limiter:d===ji.Partial?Si():void 0,...A}),c&&Ci({...A}),wi({...A,apply:Ai(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Ei({element:x,padding:s}),Yi({arrowWidth:w,arrowHeight:T}),f&&Ti({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),L=_.setPlacementState;X(()=>(L(P),()=>{L(void 0)}),[P,L]);let[R,z]=Xi(P),ee=Qt(m);X(()=>{F&&ee?.()},[F,ee]);let B=I.arrow?.x,te=I.arrow?.y,V=I.arrow?.centerOffset!==0,[H,ne]=g.useState();return X(()=>{v&&ne(window.getComputedStyle(v).zIndex)},[v]),(0,N.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:F?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:H,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,N.jsx)(Hi,{scope:n,placedSide:R,placedAlign:z,onArrowChange:S,arrowX:B,arrowY:te,shouldHideArrow:V,children:(0,N.jsx)(dt.div,{"data-side":R,"data-align":z,...h,ref:b,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`)),Gi=`PopperArrow`,Ki={top:`bottom`,right:`left`,bottom:`top`,left:`right`},qi=g.forwardRef(Ai(function(e,t){let{__scopePopper:n,...r}=e,i=Ui(Gi,n),a=Ki[i.placedSide];return(0,N.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,N.jsx)(Oi,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Ji(e){return e!==null}Ai(Ji,`isNotNull`);var Yi=Ai(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Xi(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Xi(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ai(Xi,`getSideAndAlignFromPlacement`);var Zi=z(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Qi({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Xe:`button`;return(0,N.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:Ue(Zi({variant:t,size:n,className:e})),...i})}var $i=`cpa-console.key`,ea={get:()=>localStorage.getItem($i)??void 0,set:e=>localStorage.setItem($i,e),clear:()=>localStorage.removeItem($i)},ta=class extends Error{status;body;constructor(e,t,n){super(t),this.status=e,this.body=n}};function na(e,t){if(e&&typeof e==`object`){let t=e;if(t.message&&t.error)return`${t.message} (${t.error})`;if(t.message||t.error)return t.message||t.error}return typeof e==`string`&&e.trim()?e.trim():`Request failed with HTTP ${t}`}async function ra(e,t={}){let n=new URL(e,window.location.origin);for(let[e,r]of Object.entries(t.query??{}))r!=null&&r!==``&&n.searchParams.set(e,String(r));let r={...t.headers},i=t.key??ea.get();i&&(r.Authorization=`Bearer ${i}`);let a,o=t.body;o instanceof FormData||o instanceof Blob||typeof o==`string`?a=o:o!==void 0&&(a=JSON.stringify(o),r[`Content-Type`]=`application/json`);let s=await fetch(n,{method:t.method??(a?`POST`:`GET`),headers:r,body:a});if(t.raw&&s.ok)return s;let c=await s.text(),l=c;if(s.headers.get(`content-type`)?.includes(`json`)&&c)try{l=JSON.parse(c)}catch{}if(!s.ok)throw s.status===401&&!t.key&&(ea.clear(),window.dispatchEvent(new Event(`cpa-console:logout`))),new ta(s.status,na(l,s.status),l);return l}var ia=(e,t)=>ra(`/v8/management${e}`,t),aa=(e,t)=>ra(`/console/api${e}`,t);async function oa(e,t){let n=await(await ia(e,{raw:!0})).blob(),r=document.createElement(`a`);r.href=URL.createObjectURL(n),r.download=t,r.click(),URL.revokeObjectURL(r.href)}export{W as A,s as B,pt as C,Ye as D,Xe as E,A as F,h as I,p as L,z as M,I as N,Qe as O,M as P,d as R,vt as S,q as T,l as V,Qt as _,ia as a,jt as b,Ri as c,Wi as d,Fi as f,sn as g,on as h,oa as i,Ue as j,qe as k,Bi as l,mn as m,ea as n,Qi as o,_n as p,aa as r,Zi as s,ta as t,qi as u,Yt as v,dt as w,X as x,zt as y,o as z};
@@ -0,0 +1 @@
1
+ import{E as e,F as t,L as n,M as r,R as i,V as a,j as o,n as s,o as c,r as l}from"./api-Dh4YY48y.js";import{O as u,o as d,t as f}from"./common-C0aFgyuv.js";import{t as p}from"./queries-BJ9EwxPS.js";import{n as m,t as h}from"./link-DifxDKVd.js";import{n as g}from"./useMatch-D_hq8QlA.js";import{t as _}from"./useRouter-DgLsKaZI.js";import{t as ee}from"./useNavigate-BAHKKgya.js";import{t as te}from"./blocks-BEaO1JQq.js";import{t as ne}from"./key-round-CzHhkCDw.js";import{t as re}from"./shield-check-B_3I1Kyr.js";import{a as ie,n as ae,o as oe,r as se,s as ce,t as v}from"./dialog-Da1GOL-m.js";import"./separator-wLF5huu0.js";import{D as y,Y as b,f as x,m as S,p as C,yt as w}from"./index-09oWu5UQ.js";import"./input-B6q4dbec.js";import{a as T,n as le,o as ue,r as de,t as fe}from"./sheet-3lVMxWZH.js";function pe(e){let t=_();return m(t.stores.location,g(e,t))}var E={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};E.node;var D=t(E),O={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};O.node;var k=t(O),A={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};A.node;var j=t(A),M={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};M.node;var N=t(M),P={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};P.node;var F=t(P),I={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};I.node;var L=t(I),R={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};R.node;var z=t(R),B={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};B.node;var V=t(B),H={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};H.node;var me=t(H),U=n(),W=e=>Number(e.match(/-nightly\.(\d+)$/)?.[1]??NaN);function he({version:e}){let{data:t}=u({queryKey:[`console`,`latest`],queryFn:()=>l(`/console/latest`),staleTime:18e5,retry:!1});return t&&W(t.latest)>W(t.current)?(0,U.jsxs)(v,{children:[(0,U.jsx)(ce,{asChild:!0,children:(0,U.jsxs)(`button`,{className:`flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-xs text-chart-1 hover:bg-sidebar-accent group-data-[collapsible=icon]:hidden`,children:[(0,U.jsx)(j,{className:`size-3.5`}),(0,U.jsx)(`span`,{className:`flex-1`,children:`Update available`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:t.latest.replace(/^.*-nightly\./,`#`)})]})}),(0,U.jsxs)(ae,{children:[(0,U.jsxs)(ie,{children:[(0,U.jsx)(oe,{children:`Update CPA Console`}),(0,U.jsxs)(se,{children:[`You're on `,t.current,`; the latest nightly is `,t.latest,`.`,` `,t.service?`Run this on the server. It reinstalls the service with the latest nightly and keeps your data and CLIProxyAPI settings.`:`Stop the console, then run this on the server to start the latest nightly.`]})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`pre`,{className:`overflow-x-auto rounded-lg border bg-muted/40 p-3 pr-10 font-mono text-xs leading-relaxed whitespace-pre-wrap break-all`,children:t.command}),(0,U.jsx)(f,{value:t.command,className:`absolute top-1.5 right-1.5`})]})]})]}):(0,U.jsxs)(`span`,{className:`flex items-center gap-2 px-2 py-1 text-xs text-muted-foreground group-data-[collapsible=icon]:hidden`,children:[(0,U.jsx)(D,{className:`size-3.5`}),`Console `,e??``]})}var G=a(i(),1),K=768;function q(){let[e,t]=G.useState(void 0);return G.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<K)};return e.addEventListener(`change`,n),t(window.innerWidth<K),()=>e.removeEventListener(`change`,n)},[]),!!e}var ge=`sidebar_state`,_e=604800,ve=`16rem`,ye=`18rem`,be=`3rem`,xe=`b`,J=G.createContext(null);function Y(){let e=G.useContext(J);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Se({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...s}){let c=q(),[l,u]=G.useState(!1),[d,f]=G.useState(e),p=t??d,m=G.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${ge}=${t}; path=/; max-age=${_e}`},[n,p]),h=G.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);G.useEffect(()=>{let e=e=>{e.key===xe&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=G.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,U.jsx)(J.Provider,{value:_,children:(0,U.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":ve,"--sidebar-width-icon":be,...i},className:o(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...s,children:a})})}function Ce({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...s}){let{isMobile:c,state:l,openMobile:u,setOpenMobile:d}=Y();return n===`none`?(0,U.jsx)(`div`,{"data-slot":`sidebar`,className:o(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...s,children:i}):c?(0,U.jsx)(fe,{open:u,onOpenChange:d,...s,children:(0,U.jsxs)(le,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":ye},side:e,children:[(0,U.jsxs)(T,{className:`sr-only`,children:[(0,U.jsx)(ue,{children:`Sidebar`}),(0,U.jsx)(de,{children:`Displays the mobile sidebar.`})]}),(0,U.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,U.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":l,"data-collapsible":l===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,U.jsx)(`div`,{"data-slot":`sidebar-gap`,className:o(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,U.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:o(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...s,children:(0,U.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function we({className:e,onClick:t,...n}){let{toggleSidebar:r}=Y();return(0,U.jsxs)(c,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:o(e),onClick:e=>{t?.(e),r()},...n,children:[(0,U.jsx)(z,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Te({className:e,...t}){return(0,U.jsx)(`main`,{"data-slot":`sidebar-inset`,className:o(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function Ee({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:o(`flex flex-col gap-2 p-2`,e),...t})}function De({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:o(`flex flex-col gap-2 p-2`,e),...t})}function Oe({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:o(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function ke({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:o(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function Ae({className:t,asChild:n=!1,...r}){let i=n?e:`div`;return(0,U.jsx)(i,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:o(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,t),...r})}function je({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:o(`w-full text-sm`,e),...t})}function X({className:e,...t}){return(0,U.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:o(`flex w-full min-w-0 flex-col gap-0`,e),...t})}function Z({className:e,...t}){return(0,U.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:o(`group/menu-item relative`,e),...t})}var Me=r(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function Q({asChild:t=!1,isActive:n=!1,variant:r=`default`,size:i=`default`,tooltip:a,className:s,...c}){let l=t?e:`button`,{isMobile:u,state:d}=Y(),f=(0,U.jsx)(l,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":i,"data-active":n,className:o(Me({variant:r,size:i}),s),...c});return a?(typeof a==`string`&&(a={children:a}),(0,U.jsxs)(x,{children:[(0,U.jsx)(S,{asChild:!0,children:f}),(0,U.jsx)(C,{side:`right`,align:`center`,hidden:d!==`collapsed`||u,...a})]})):f}var Ne=[{label:`Monitor`,items:[{to:`/`,label:`Overview`,icon:F},{to:`/usage`,label:`Usage`,icon:k},{to:`/logs`,label:`Logs`,icon:b}]},{label:`Manage`,items:[{to:`/credentials`,label:`Credentials`,icon:re},{to:`/providers`,label:`API providers`,icon:te},{to:`/keys`,label:`Client keys`,icon:ne},{to:`/settings`,label:`Settings`,icon:me}]},{label:`Tools`,items:[{to:`/connect`,label:`Connect`,icon:V},{to:`/playground`,label:`Playground`,icon:N}]}],$={running:{label:`Running`,tone:`good`},starting:{label:`Starting`,tone:`warn`},stopping:{label:`Stopping`,tone:`warn`},stopped:{label:`Stopped`,tone:`idle`},crashed:{label:`Crashed`,tone:`bad`}};function Pe(){let{data:e}=u(p.status()),t=w(),n=ee(),r=pe({select:e=>e.pathname}),i=e?.process.state,a=i?$[i]:void 0;return(0,U.jsxs)(Ce,{variant:`inset`,collapsible:`icon`,children:[(0,U.jsx)(Ee,{children:(0,U.jsx)(X,{children:(0,U.jsx)(Z,{children:(0,U.jsx)(Q,{size:`lg`,asChild:!0,children:(0,U.jsxs)(h,{to:`/`,children:[(0,U.jsx)(y,{className:`size-8 shrink-0`}),(0,U.jsxs)(`div`,{className:`grid flex-1 text-left leading-tight`,children:[(0,U.jsx)(`span`,{className:`truncate font-semibold`,children:`CPA Console`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate text-xs text-muted-foreground`,children:[a&&(0,U.jsx)(d,{tone:a.tone,pulse:i===`starting`}),a?`${a.label} · ${e?.cpa.version??`not installed`}`:`Connecting…`]})]})]})})})})}),(0,U.jsx)(Oe,{children:Ne.map(e=>(0,U.jsxs)(ke,{children:[(0,U.jsx)(Ae,{children:e.label}),(0,U.jsx)(je,{children:(0,U.jsx)(X,{children:e.items.map(e=>(0,U.jsx)(Z,{children:(0,U.jsx)(Q,{asChild:!0,tooltip:e.label,isActive:e.to===`/`?r===`/`:r.startsWith(e.to),children:(0,U.jsxs)(h,{to:e.to,children:[(0,U.jsx)(e.icon,{}),(0,U.jsx)(`span`,{children:e.label})]})})},e.to))})})]},e.label))}),(0,U.jsx)(De,{children:(0,U.jsxs)(X,{children:[(0,U.jsx)(Z,{children:(0,U.jsxs)(Q,{tooltip:`Sign out`,onClick:()=>{s.clear(),t.clear(),n({to:`/login`})},children:[(0,U.jsx)(L,{}),(0,U.jsx)(`span`,{children:`Sign out`})]})}),(0,U.jsx)(Z,{children:(0,U.jsx)(he,{version:e?.consoleVersion})})]})})]})}export{we as a,Se as i,$ as n,V as o,Te as r,j as s,Pe as t};
@@ -0,0 +1 @@
1
+ import{F as e}from"./api-Dh4YY48y.js";var t={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{E as e,L as t,M as n,R as r,j as i}from"./api-Dh4YY48y.js";r();var a=t(),o=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function s({className:t,variant:n=`default`,asChild:r=!1,...s}){let c=r?e:`span`;return(0,a.jsx)(c,{"data-slot":`badge`,"data-variant":n,className:i(o({variant:n}),t),...s})}export{s as t};
@@ -0,0 +1 @@
1
+ import{F as e}from"./api-Dh4YY48y.js";var t={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ import{F as e}from"./api-Dh4YY48y.js";var t={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};t.node;var n=e(t);export{n as t};