@kaitranntt/ccs 7.67.0-dev.1 → 7.67.0-dev.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.
- package/dist/api/services/index.d.ts +1 -0
- package/dist/api/services/index.d.ts.map +1 -1
- package/dist/api/services/index.js +3 -1
- package/dist/api/services/index.js.map +1 -1
- package/dist/api/services/local-runtime-readiness.d.ts +14 -0
- package/dist/api/services/local-runtime-readiness.d.ts.map +1 -0
- package/dist/api/services/local-runtime-readiness.js +89 -0
- package/dist/api/services/local-runtime-readiness.js.map +1 -0
- package/dist/cliproxy/accounts/types.d.ts +1 -1
- package/dist/cliproxy/accounts/types.d.ts.map +1 -1
- package/dist/cliproxy/catalog-routing.d.ts +12 -0
- package/dist/cliproxy/catalog-routing.d.ts.map +1 -0
- package/dist/cliproxy/catalog-routing.js +19 -0
- package/dist/cliproxy/catalog-routing.js.map +1 -0
- package/dist/cliproxy/gemini-cli-quota-normalizer.js +1 -1
- package/dist/cliproxy/gemini-cli-quota-normalizer.js.map +1 -1
- package/dist/cliproxy/managed-model-prefixes.d.ts +7 -0
- package/dist/cliproxy/managed-model-prefixes.d.ts.map +1 -0
- package/dist/cliproxy/managed-model-prefixes.js +116 -0
- package/dist/cliproxy/managed-model-prefixes.js.map +1 -0
- package/dist/cliproxy/model-catalog.d.ts.map +1 -1
- package/dist/cliproxy/model-catalog.js +19 -4
- package/dist/cliproxy/model-catalog.js.map +1 -1
- package/dist/cliproxy/provider-entitlement-evidence.d.ts +17 -0
- package/dist/cliproxy/provider-entitlement-evidence.d.ts.map +1 -0
- package/dist/cliproxy/provider-entitlement-evidence.js +55 -0
- package/dist/cliproxy/provider-entitlement-evidence.js.map +1 -0
- package/dist/cliproxy/provider-entitlement-types.d.ts +16 -0
- package/dist/cliproxy/provider-entitlement-types.d.ts.map +1 -0
- package/dist/cliproxy/provider-entitlement-types.js +3 -0
- package/dist/cliproxy/provider-entitlement-types.js.map +1 -0
- package/dist/cliproxy/quota-fetcher-gemini-cli.d.ts.map +1 -1
- package/dist/cliproxy/quota-fetcher-gemini-cli.js +50 -12
- package/dist/cliproxy/quota-fetcher-gemini-cli.js.map +1 -1
- package/dist/cliproxy/quota-fetcher.d.ts +10 -0
- package/dist/cliproxy/quota-fetcher.d.ts.map +1 -1
- package/dist/cliproxy/quota-fetcher.js +116 -21
- package/dist/cliproxy/quota-fetcher.js.map +1 -1
- package/dist/cliproxy/quota-types.d.ts +3 -0
- package/dist/cliproxy/quota-types.d.ts.map +1 -1
- package/dist/commands/api-command/create-command.d.ts +3 -0
- package/dist/commands/api-command/create-command.d.ts.map +1 -1
- package/dist/commands/api-command/create-command.js +20 -6
- package/dist/commands/api-command/create-command.js.map +1 -1
- package/dist/commands/api-command/help.d.ts.map +1 -1
- package/dist/commands/api-command/help.js +1 -0
- package/dist/commands/api-command/help.js.map +1 -1
- package/dist/commands/cliproxy/catalog-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/catalog-subcommand.js +60 -6
- package/dist/commands/cliproxy/catalog-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/help-subcommand.js +3 -2
- package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand.d.ts +2 -0
- package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand.js +8 -1
- package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/variant-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/variant-subcommand.js +44 -3
- package/dist/commands/cliproxy/variant-subcommand.js.map +1 -1
- package/dist/commands/update-command.d.ts +20 -5
- package/dist/commands/update-command.d.ts.map +1 -1
- package/dist/commands/update-command.js +169 -119
- package/dist/commands/update-command.js.map +1 -1
- package/dist/shared/agy-gemini-pro-compatibility.d.ts +15 -0
- package/dist/shared/agy-gemini-pro-compatibility.d.ts.map +1 -0
- package/dist/shared/agy-gemini-pro-compatibility.js +18 -0
- package/dist/shared/agy-gemini-pro-compatibility.js.map +1 -0
- package/dist/shared/cliproxy-model-routing.d.ts +45 -0
- package/dist/shared/cliproxy-model-routing.d.ts.map +1 -0
- package/dist/shared/cliproxy-model-routing.js +144 -0
- package/dist/shared/cliproxy-model-routing.js.map +1 -0
- package/dist/shared/provider-preset-catalog.d.ts +3 -1
- package/dist/shared/provider-preset-catalog.d.ts.map +1 -1
- package/dist/shared/provider-preset-catalog.js +16 -0
- package/dist/shared/provider-preset-catalog.js.map +1 -1
- package/dist/ui/assets/{accounts-cuFTYYRt.js → accounts-DjL3iVZW.js} +1 -1
- package/dist/ui/assets/{alert-dialog-SgZxEXpw.js → alert-dialog-Tc_D1a_B.js} +1 -1
- package/dist/ui/assets/api-CUtkvXmX.js +4 -0
- package/dist/ui/assets/{auth-section-C4y85pIC.js → auth-section-CuKWQHC7.js} +1 -1
- package/dist/ui/assets/{backups-section-BERNcZpv.js → backups-section-BKW2pbb9.js} +1 -1
- package/dist/ui/assets/{channels-DBLp0DUg.js → channels-DvWJMdaq.js} +1 -1
- package/dist/ui/assets/{checkbox-B-cTEUE0.js → checkbox-B0hZxMK5.js} +1 -1
- package/dist/ui/assets/{claude-extension-CiqXZCUX.js → claude-extension-Dfqu-rev.js} +1 -1
- package/dist/ui/assets/cliproxy-C9RxW-I8.js +3 -0
- package/dist/ui/assets/cliproxy-ai-providers-BXLuuxNf.js +15 -0
- package/dist/ui/assets/{cliproxy-control-panel-Dg15tkqi.js → cliproxy-control-panel-aQ7cCc2U.js} +1 -1
- package/dist/ui/assets/{codex-CbEo9E_j.js → codex-aq4RI6_n.js} +9 -9
- package/dist/ui/assets/{confirm-dialog-DJpEIfS_.js → confirm-dialog-CpDk6eu4.js} +1 -1
- package/dist/ui/assets/{copilot-B8fIS-vF.js → copilot-CQRpGXvY.js} +2 -2
- package/dist/ui/assets/{cursor-DCN2ypJD.js → cursor-BpXPf6qi.js} +1 -1
- package/dist/ui/assets/{droid-CKRz_GOK.js → droid-Cgx-yLjy.js} +2 -2
- package/dist/ui/assets/{globalenv-section-CZCiD-lk.js → globalenv-section-DsNqG1yB.js} +1 -1
- package/dist/ui/assets/{health-CDd5on8I.js → health-BY-O-JcA.js} +1 -1
- package/dist/ui/assets/icons-KVCk4_U8.js +1 -0
- package/dist/ui/assets/index-BmSzf0T9.js +72 -0
- package/dist/ui/assets/{index-kTxwXQ5y.js → index-CLGiPB3A.js} +1 -1
- package/dist/ui/assets/{index-BGqBqww_.js → index-Cet36v1V.js} +1 -1
- package/dist/ui/assets/{index-CoUGuS5J.js → index-DH6L6ybH.js} +1 -1
- package/dist/ui/assets/{index-8IL3kgiJ.js → index-DsCjnpco.js} +1 -1
- package/dist/ui/assets/{index-Ywy20w8T.js → index-TQFuDZdB.js} +1 -1
- package/dist/ui/assets/index-teLjoh2T.css +1 -0
- package/dist/ui/assets/{logs-ecr4mQMK.js → logs-D5ro-pc7.js} +1 -1
- package/dist/ui/assets/{masked-input-bSAouyU5.js → masked-input-h0XkMSwB.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-BVdcjMn7.js → proxy-status-widget-yBdrFeb7.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-CJnuNmCM.js → raw-json-settings-editor-panel-Cb7ZInQV.js} +1 -1
- package/dist/ui/assets/{searchable-select-DvFzk1D1.js → searchable-select-D4xr5xKS.js} +1 -1
- package/dist/ui/assets/{separator-DgeSGH_l.js → separator-gw5BjIpP.js} +1 -1
- package/dist/ui/assets/{shared-D5HUP-Vv.js → shared-C-VeA1Z9.js} +1 -1
- package/dist/ui/assets/{table-8dkohJBd.js → table-Bd4isC18.js} +1 -1
- package/dist/ui/assets/{updates-8zMjNZyg.js → updates-DiK8I67C.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/utils/hooks/image-analysis-runtime-status.d.ts.map +1 -1
- package/dist/utils/hooks/image-analysis-runtime-status.js +5 -1
- package/dist/utils/hooks/image-analysis-runtime-status.js.map +1 -1
- package/dist/utils/package-manager-detector.d.ts +30 -4
- package/dist/utils/package-manager-detector.d.ts.map +1 -1
- package/dist/utils/package-manager-detector.js +247 -60
- package/dist/utils/package-manager-detector.js.map +1 -1
- package/dist/utils/update-checker.d.ts +1 -1
- package/dist/utils/update-checker.d.ts.map +1 -1
- package/dist/web-server/index.d.ts.map +1 -1
- package/dist/web-server/index.js +9 -0
- package/dist/web-server/index.js.map +1 -1
- package/dist/web-server/routes/catalog-routes.d.ts.map +1 -1
- package/dist/web-server/routes/catalog-routes.js +3 -2
- package/dist/web-server/routes/catalog-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +23 -2
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
- package/dist/web-server/routes/profile-routes.js +8 -0
- package/dist/web-server/routes/profile-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/api-DQs1Ldow.js +0 -4
- package/dist/ui/assets/cliproxy-DlQkkQVp.js +0 -3
- package/dist/ui/assets/cliproxy-ai-providers-wBfCEEze.js +0 -21
- package/dist/ui/assets/icons-C4EMu2PL.js +0 -1
- package/dist/ui/assets/index-2X6A__Ih.css +0 -1
- package/dist/ui/assets/index-CUOLpSIB.js +0 -69
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as l}from"./react-vendor-CNOkPC89.js";import{a as rt,u as Rt,b as is}from"./tanstack-CrmUhA7Z.js";import{a8 as rs,d as _,C as Et,b as Ot,a9 as Lt,c as Q,P as ot,B,a as re,aa as ie,L as J,I as ce,r as $e,s as Qe,t as Je,v as We,w as we,ab as _t,ac as Ft,ad as os,ae as ls,af as cs,u as Ut,ag as lt,ah as ct,ai as dt,aj as ut,ak as Kt,al as bt,am as ds,an as us,W as qt,ao as Xe,ap as Ht,Y as Oe,aq as ms,ar as Nt,as as yt,at as ps,au as xs,av as hs,aw as gs,ax as fs,ay as vs,az as js,aA as bs,aB as wt,aC as Ns,x as Gt,n as mt,aD as pt,aE as kt,aF as Vt,aG as ys,m as ws,aH as ks,aI as Cs,aJ as Ye,T as Ze,p as et,q as tt,aK as As,aL as Ss,aM as Ps,aN as Ct,aO as Ms,aP as Ds,aQ as Ts,aR as Is,aS as Rs,aT as Es,Q as Os,R as Ls,U as At,V as St,aU as _s,aV as Fs,aW as Us,aX as Ks,aY as qs,aZ as Hs,a_ as Gs,a$ as Vs,b0 as Bs,b1 as zs,b2 as $s,b3 as Qs,S as Js}from"./index-CUOLpSIB.js";import{C as st}from"./default-ports-1QQSffYX.js";import{t as H}from"./notifications-B2HqRBj7.js";import{C as Bt,L as ee,p as ge,_ as Ws,m as ve,o as zt,aB as xt,R as ht,q as ke,a9 as Ce,T as Fe,a6 as Pt,aC as $t,aA as Xs,z as gt,Z as Ae,Y as Qt,i as Ys,u as Jt,aD as Zs,as as ea,X as ft,a8 as Wt,J as Xt,D as Yt,aE as ta,ar as Zt,aF as sa,av as aa,aG as es}from"./icons-C4EMu2PL.js";import{R as Le,A as Mt,D as Ve,i as na,a as ia}from"./antigravity-responsibility-constants-Bvh4Ybz0.js";import{C as _e}from"./checkbox-B-cTEUE0.js";import{C as ra}from"./confirm-dialog-DJpEIfS_.js";import{S as vt}from"./separator-DgeSGH_l.js";import{S as oa}from"./searchable-select-DvFzk1D1.js";import{P as la}from"./proxy-status-widget-BVdcjMn7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";import"./alert-dialog-SgZxEXpw.js";const ts=Object.freeze({"gemini-3-pro-preview":"gemini-3.1-pro-preview","gemini-3.1-pro-preview":"gemini-3-pro-preview","gemini-3-flash-preview":"gemini-3.1-flash-preview","gemini-3.1-flash-preview":"gemini-3-flash-preview"}),ca=/^gemini-(\d+(?:[.-]\d+)*)-(pro|flash)-preview(-customtools)?$/i;function fe(t){return rs(t).toLowerCase()}function Ue(t){const s=fe(t),a=s.match(ca);if(!a)return null;const[,n,i,o]=a;return{normalizedId:s,version:n.split(/[.-]/).map(c=>Number(c)),family:i,customtools:!!o,dottedVersion:n.includes(".")}}function ss(t,s){const a=Math.max(t.length,s.length);for(let n=0;n<a;n+=1){const i=t[n]??0,o=s[n]??0;if(i!==o)return i>o?1:-1}return 0}function da(t,s,a){if(t.customtools!==s.customtools)return t.customtools?1:-1;const n=ss(t.version,s.version);if(n!==0)return n>0?-1:1;const i=+(t.dottedVersion===a.dottedVersion),o=+(s.dottedVersion===a.dottedVersion);return i!==o?o-i:t.normalizedId.localeCompare(s.normalizedId)}function Dt(t,s){const a=fe(s);return t.find(n=>fe(n.id)===a)?.id}function ua(t,s){const a=Ue(t);return!a||s.length===0?void 0:s.map(i=>{const o=Ue(i.id);return!o||o.family!==a.family?null:{id:i.id,info:o}}).filter(i=>!!i).sort((i,o)=>da(i.info,o.info,a))[0]?.id}const he={agy:{provider:"agy",displayName:"Antigravity",defaultModel:"claude-opus-4-6-thinking",models:[{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",description:"Latest flagship, extended thinking",extendedContext:!1,presetMapping:{default:"claude-opus-4-6-thinking",opus:"claude-opus-4-6-thinking",sonnet:"claude-sonnet-4-6",haiku:"claude-sonnet-4-6"}},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",description:"Latest Sonnet with thinking budget support",presetMapping:{default:"claude-sonnet-4-6",opus:"claude-opus-4-6-thinking",sonnet:"claude-sonnet-4-6",haiku:"claude-sonnet-4-6"}},{id:"gemini-3.1-pro-preview",name:"Gemini Pro",description:"Resolves to the best advertised Gemini Pro preview via Antigravity",extendedContext:!0,presetMapping:{default:"gemini-3.1-pro-preview",opus:"gemini-3.1-pro-preview",sonnet:"gemini-3.1-pro-preview",haiku:"gemini-3-1-flash-preview"}},{id:"gemini-3-1-flash-preview",name:"Gemini Flash",description:"Resolves to the best advertised Gemini Flash preview via Antigravity",extendedContext:!0,presetMapping:{default:"gemini-3-1-flash-preview",opus:"gemini-3.1-pro-preview",sonnet:"gemini-3.1-pro-preview",haiku:"gemini-3-1-flash-preview"}}]},gemini:{provider:"gemini",displayName:"Gemini",defaultModel:"gemini-2.5-pro",models:[{id:"gemini-3.1-pro-preview",name:"Gemini Pro",tier:"paid",description:"Uses the best advertised Gemini Pro preview when Google exposes one",extendedContext:!0,presetMapping:{default:"gemini-3.1-pro-preview",opus:"gemini-3.1-pro-preview",sonnet:"gemini-3.1-pro-preview",haiku:"gemini-3-flash-preview"}},{id:"gemini-3-flash-preview",name:"Gemini Flash",tier:"paid",description:"Uses the best advertised Gemini Flash preview when Google exposes one",extendedContext:!0,presetMapping:{default:"gemini-3-flash-preview",opus:"gemini-3.1-pro-preview",sonnet:"gemini-3.1-pro-preview",haiku:"gemini-3-flash-preview"}},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Stable, works with free Google account",extendedContext:!0,presetMapping:{default:"gemini-2.5-pro",opus:"gemini-2.5-pro",sonnet:"gemini-2.5-pro",haiku:"gemini-2.5-flash"}}]},codex:{provider:"codex",displayName:"Codex",defaultModel:"gpt-5-codex",models:[{id:"gpt-5-codex",name:"GPT-5 Codex",description:"Cross-plan safe Codex default",presetMapping:{default:"gpt-5-codex",opus:"gpt-5-codex",sonnet:"gpt-5-codex",haiku:"gpt-5-codex-mini"}},{id:"gpt-5-codex-mini",name:"GPT-5 Codex Mini",description:"Faster and cheaper Codex option",presetMapping:{default:"gpt-5-codex-mini",opus:"gpt-5-codex",sonnet:"gpt-5-codex",haiku:"gpt-5-codex-mini"}},{id:"gpt-5-mini",name:"GPT-5 Mini",description:"Legacy mini model ID kept for backwards compatibility",presetMapping:{default:"gpt-5-mini",opus:"gpt-5-codex",sonnet:"gpt-5-mini",haiku:"gpt-5-mini"}},{id:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini",description:"Legacy fast Codex mini model",presetMapping:{default:"gpt-5.1-codex-mini",opus:"gpt-5.1-codex-max",sonnet:"gpt-5.1-codex-max",haiku:"gpt-5.1-codex-mini"}},{id:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",description:"Higher-effort Codex model with xhigh support",presetMapping:{default:"gpt-5.1-codex-max",opus:"gpt-5.1-codex-max",sonnet:"gpt-5.1-codex-max",haiku:"gpt-5.1-codex-mini"}},{id:"gpt-5.2-codex",name:"GPT-5.2 Codex",description:"Cross-plan Codex model with xhigh support",presetMapping:{default:"gpt-5.2-codex",opus:"gpt-5.2-codex",sonnet:"gpt-5.2-codex",haiku:"gpt-5-codex-mini"}},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",tier:"paid",description:"Paid Codex plans only",presetMapping:{default:"gpt-5.3-codex",opus:"gpt-5.3-codex",sonnet:"gpt-5.3-codex",haiku:"gpt-5-codex-mini"}},{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",tier:"paid",description:"Paid Codex plans only, ultra-fast coding model",presetMapping:{default:"gpt-5.3-codex-spark",opus:"gpt-5.3-codex",sonnet:"gpt-5.3-codex",haiku:"gpt-5-codex-mini"}},{id:"gpt-5.4",name:"GPT-5.4",tier:"paid",description:"Paid Codex plans only, latest GPT-5 family model",presetMapping:{default:"gpt-5.4",opus:"gpt-5.4",sonnet:"gpt-5.4",haiku:"gpt-5-codex-mini"}}]},qwen:{provider:"qwen",displayName:"Qwen",defaultModel:"qwen3-coder-plus",models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus",description:"Code-focused model (1M context)",presetMapping:{default:"qwen3-coder-plus",opus:"qwen3-max",sonnet:"qwen3-coder-plus",haiku:"qwen3-coder-flash"}},{id:"qwen3-max",name:"Qwen3 Max",description:"Flagship model (256K context)",presetMapping:{default:"qwen3-max",opus:"qwen3-max",sonnet:"qwen3-coder-plus",haiku:"qwen3-coder-flash"}},{id:"qwen3-max-preview",name:"Qwen3 Max Preview",description:"Preview with thinking support (256K)",presetMapping:{default:"qwen3-max-preview",opus:"qwen3-max-preview",sonnet:"qwen3-max",haiku:"qwen3-coder-flash"}},{id:"qwen3-235b",name:"Qwen3 235B",description:"Large 235B A22B model",presetMapping:{default:"qwen3-235b",opus:"qwen3-max",sonnet:"qwen3-235b",haiku:"qwen3-coder-flash"}},{id:"qwen3-vl-plus",name:"Qwen3 VL Plus",description:"Vision-language multimodal"},{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash",description:"Fast code generation"},{id:"qwen3-32b",name:"Qwen3 32B",description:"Qwen3 32B model"}]},iflow:{provider:"iflow",displayName:"iFlow",defaultModel:"qwen3-coder-plus",models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus",description:"Recommended default for iFlow accounts",presetMapping:{default:"qwen3-coder-plus",opus:"qwen3-coder-plus",sonnet:"qwen3-coder-plus",haiku:"qwen3-coder-plus"}},{id:"qwen3-max",name:"Qwen3 Max",description:"Flagship Qwen model via iFlow"},{id:"kimi-k2",name:"Kimi K2",description:"Kimi model currently available via iFlow"},{id:"deepseek-v3.2",name:"DeepSeek V3.2",description:"Current DeepSeek V3.2 model via iFlow"},{id:"deepseek-r1",name:"DeepSeek R1",description:"Reasoning-focused DeepSeek model"},{id:"glm-4.6",name:"GLM 4.6",description:"Zhipu GLM 4.6 via iFlow"},{id:"qwen3-vl-plus",name:"Qwen3 VL Plus",description:"Vision-language model"}]},kimi:{provider:"kimi",displayName:"Kimi (Moonshot)",defaultModel:"kimi-k2.5",models:[{id:"kimi-k2.5",name:"Kimi K2.5",description:"Latest multimodal model (262K context)",presetMapping:{default:"kimi-k2.5",opus:"kimi-k2.5",sonnet:"kimi-k2-thinking",haiku:"kimi-k2"}},{id:"kimi-k2-thinking",name:"Kimi K2 Thinking",description:"Extended reasoning model",presetMapping:{default:"kimi-k2-thinking",opus:"kimi-k2.5",sonnet:"kimi-k2-thinking",haiku:"kimi-k2"}},{id:"kimi-k2",name:"Kimi K2",description:"Flagship coding model"}]},kiro:{provider:"kiro",displayName:"Kiro (AWS)",defaultModel:"kiro-claude-sonnet-4-6",models:[{id:"kiro-claude-opus-4-6",name:"Kiro Claude Opus 4.6",description:"Claude Opus 4.6 via Kiro (2.2x credit)",presetMapping:{default:"kiro-claude-opus-4-6",opus:"kiro-claude-opus-4-6",sonnet:"kiro-claude-sonnet-4-6",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-sonnet-4-6",name:"Kiro Claude Sonnet 4.6",description:"Claude Sonnet 4.6 via Kiro (1.3x credit)",presetMapping:{default:"kiro-claude-sonnet-4-6",opus:"kiro-claude-opus-4-6",sonnet:"kiro-claude-sonnet-4-6",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-opus-4-5",name:"Kiro Claude Opus 4.5",description:"Claude Opus 4.5 via Kiro (2.2x credit)",presetMapping:{default:"kiro-claude-opus-4-5",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4-5",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-sonnet-4-5",name:"Kiro Claude Sonnet 4.5",description:"Claude Sonnet 4.5 via Kiro (1.3x credit)",presetMapping:{default:"kiro-claude-sonnet-4-5",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4-5",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-sonnet-4",name:"Kiro Claude Sonnet 4",description:"Claude Sonnet 4 via Kiro (1.3x credit)",presetMapping:{default:"kiro-claude-sonnet-4",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-haiku-4-5",name:"Kiro Claude Haiku 4.5",description:"Claude Haiku 4.5 via Kiro (0.4x credit)"}]},ghcp:{provider:"ghcp",displayName:"GitHub Copilot (OAuth)",defaultModel:"claude-sonnet-4.5",models:[{id:"claude-opus-4.5",name:"Claude Opus 4.5",description:"Anthropic Claude Opus 4.5 via GitHub Copilot",presetMapping:{default:"claude-opus-4.5",opus:"claude-opus-4.5",sonnet:"claude-sonnet-4.5",haiku:"claude-haiku-4.5"}},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",description:"Anthropic Claude Sonnet 4.5 via GitHub Copilot",presetMapping:{default:"claude-sonnet-4.5",opus:"claude-opus-4.5",sonnet:"claude-sonnet-4.5",haiku:"claude-haiku-4.5"}},{id:"claude-sonnet-4",name:"Claude Sonnet 4",description:"Anthropic Claude Sonnet 4 via GitHub Copilot"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",description:"Anthropic Claude Haiku 4.5 via GitHub Copilot"},{id:"gpt-5.2",name:"GPT-5.2",description:"OpenAI GPT-5.2 via GitHub Copilot",presetMapping:{default:"gpt-5.2",opus:"gpt-5.2",sonnet:"gpt-5.1",haiku:"gpt-5-mini"}},{id:"gpt-5.1",name:"GPT-5.1",description:"OpenAI GPT-5.1 via GitHub Copilot"},{id:"gpt-5",name:"GPT-5",description:"OpenAI GPT-5 via GitHub Copilot"},{id:"gpt-5-mini",name:"GPT-5 Mini",description:"OpenAI GPT-5 Mini via GitHub Copilot"},{id:"gemini-3-pro",name:"Gemini 3 Pro",description:"Google Gemini 3 Pro via GitHub Copilot"}]},claude:{provider:"claude",displayName:"Claude (Anthropic)",defaultModel:"claude-sonnet-4-6",models:[{id:"claude-opus-4-6",name:"Claude Opus 4.6",description:"Latest flagship model",extendedContext:!0,presetMapping:{default:"claude-opus-4-6",opus:"claude-opus-4-6",sonnet:"claude-sonnet-4-6",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",description:"Balanced performance and speed",extendedContext:!0,presetMapping:{default:"claude-sonnet-4-6",opus:"claude-opus-4-6",sonnet:"claude-sonnet-4-6",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5",description:"Most capable Claude model",extendedContext:!0,presetMapping:{default:"claude-opus-4-5-20251101",opus:"claude-opus-4-5-20251101",sonnet:"claude-sonnet-4-5-20250929",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-sonnet-4-5-20250929",name:"Claude Sonnet 4.5",description:"Balanced performance and speed",extendedContext:!0,presetMapping:{default:"claude-sonnet-4-5-20250929",opus:"claude-opus-4-5-20251101",sonnet:"claude-sonnet-4-5-20250929",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",description:"Previous generation Sonnet",extendedContext:!0,presetMapping:{default:"claude-sonnet-4-20250514",opus:"claude-opus-4-5-20251101",sonnet:"claude-sonnet-4-20250514",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",description:"Fast and efficient"}]}};function at(t,s){if(!t)return;const a=fe(s),n=ts[a.toLowerCase()],i=t.models.find(c=>c.id===a||c.id===n);if(i)return i;const o=Ue(a);if(o)return t.models.map(c=>({model:c,info:Ue(c.id)})).filter(c=>!!(c.info&&c.info.family===o.family)).sort((c,u)=>ss(u.info.version,c.info.version))[0]?.model}function ma(t){if(t==="free")return"free";if(typeof t=="string"&&t.trim().length>0)return"paid"}function pa(t,s){const a=he[t.toLowerCase()];if(!s||s.models.length===0)return a;const n=s.models.map(u=>({id:u.id,owned_by:s.provider})),i=s.models.map(u=>{const r=at(a,u.id);return{...u,name:u.name||r?.name||u.id,tier:r?.tier??ma(u.tier),description:u.description??r?.description,broken:r?.broken,issueUrl:r?.issueUrl,deprecated:r?.deprecated,deprecationReason:r?.deprecationReason,extendedContext:u.extendedContext??r?.extendedContext,presetMapping:r?.presetMapping}}),o=a?.defaultModel?je(a.defaultModel,n):void 0,c=typeof o=="string"&&n.some(u=>fe(u.id)===fe(o));return{provider:s.provider,displayName:s.displayName||a?.displayName||t,defaultModel:c?o:s.defaultModel,models:i}}function jt(t){const s={},a=new Set([...Object.keys(he),...Object.keys(t??{})]);for(const n of a){const i=pa(n,t?.[n]);i&&(s[n]=i)}return s}function as(t,s,a){const n=at(a,s);return n||at(he[t.toLowerCase()],s)}function je(t,s=[]){const a=fe(t),n=ua(a,s);if(n)return n;const i=Dt(s,a);if(i)return i;const o=ts[a];return(o?Dt(s,o):void 0)??a}function xa(t,s=[]){return{default:je(t.default,s),opus:je(t.opus,s),sonnet:je(t.sonnet,s),haiku:je(t.haiku,s)}}function ns(t,s=[]){if(!t)return[];const a=new Set;return t.models.map(n=>{const i=je(n.id,s),o=n.presetMapping?xa(n.presetMapping,s):void 0;return{...n,id:i,presetMapping:o}}).filter(n=>a.has(n.id)?!1:(a.add(n.id),!0))}function ha(t,s,a){return as(t,s,a)?.extendedContext===!0}const Be="ccs-internal-managed";async function ga(){try{const t=await fetch("/api/settings/auth/tokens/raw");return t.ok?(await t.json())?.apiKey?.value??Be:Be}catch{return Be}}async function fa(t,s){if(s)return s;try{const a=await fetch("/api/cliproxy/catalog");if(!a.ok)return he[t];const n=await a.json();return jt(n.catalogs)[t]??he[t]}catch{return he[t]}}async function nt(t,s,a){const n=await fa(t,a);if(!n)return{success:!1};const i=n.models.find(m=>m.id===n.defaultModel)||n.models[0],o=i?.presetMapping||{default:n.defaultModel,opus:n.defaultModel,sonnet:n.defaultModel,haiku:n.defaultModel},c=await ga(),r={env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${st}/api/provider/${t}`,ANTHROPIC_AUTH_TOKEN:c,ANTHROPIC_MODEL:o.default,ANTHROPIC_DEFAULT_OPUS_MODEL:o.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:o.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:o.haiku}};try{return{success:(await fetch(`/api/settings/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:r})})).ok,presetName:i?.name||n.defaultModel}}catch{return{success:!1}}}function va({currentProgress:t,allSteps:s}){return e.jsx("div",{className:"flex justify-center gap-1 pt-2",children:s.map((a,n)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${t>=n?"bg-primary":"bg-muted"}`},a))})}function ja({providers:t,onSelect:s}){return e.jsx("div",{className:"grid gap-2",children:t.map(a=>e.jsxs("button",{onClick:()=>s(a.id),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:a.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:a.description})]}),e.jsx(Bt,{className:"w-4 h-4 text-muted-foreground"})]},a.id))})}function ba({selectedProvider:t,providers:s,authCommand:a,isRefreshing:n,isPending:i,onBack:o,onStartAuth:c,onRefresh:u}){const[r,m]=l.useState(!1),v=async h=>{await navigator.clipboard.writeText(h),m(!0),setTimeout(()=>m(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Authenticate with ",s.find(h=>h.id===t)?.name," to add an account"]}),e.jsx(_,{onClick:c,disabled:i,className:"w-full gap-2",size:"lg",children:i?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 animate-spin"}),"Authenticating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"w-4 h-4"}),"Authenticate in Browser"]})}),i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Complete the OAuth flow in your browser..."})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or use terminal"})})]}),e.jsx(Et,{children:e.jsxs(Ot,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ws,{className:"w-4 h-4"}),"Run this command in your terminal:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:a}),e.jsx(_,{variant:"outline",size:"icon",onClick:()=>v(a),children:r?e.jsx(ve,{className:"w-4 h-4 text-green-500"}):e.jsx(zt,{className:"w-4 h-4"})})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(_,{variant:"ghost",onClick:o,disabled:i,children:[e.jsx(xt,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs(_,{variant:"outline",onClick:u,disabled:n||i,children:[e.jsx(ht,{className:`w-4 h-4 mr-2 ${n?"animate-spin":""}`}),n?"Checking...":"Refresh Status"]})]})]})}function Na({accounts:t,privacyMode:s,onSelect:a,onAddNew:n,onBack:i}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Select an account (",t.length,")"]}),e.jsx("div",{className:"grid gap-2 max-h-[320px] overflow-y-auto pr-1",children:t.map(o=>{const c=Lt(o.id,o.email,o.tokenFile);return e.jsxs("button",{type:"button",onClick:()=>a(o),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center",children:e.jsx(ke,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:Q("font-medium",s&&ot),children:c.email}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[c.audienceLabel&&e.jsx(B,{variant:"outline",className:Q("text-[10px] h-4 px-1.5 border-transparent",c.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:c.audienceLabel}),c.detailLabel&&e.jsx(B,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:c.detailLabel}),o.isDefault&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Default account"})]})]})]}),e.jsx(Bt,{className:"w-4 h-4 text-muted-foreground"})]},o.id)})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or"})})]}),e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 p-3 border-2 border-dashed border-primary/50 rounded-lg hover:border-primary hover:bg-primary/5 transition-colors text-left",onClick:n,children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(ge,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-primary",children:"Add new account"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Authenticate with a different account"})]})]}),e.jsx("div",{className:"flex items-center justify-between pt-2",children:e.jsxs(_,{variant:"ghost",onClick:i,children:[e.jsx(xt,{className:"w-4 h-4 mr-2"}),"Back"]})})]})}const Tt="__custom__";function ya({selectedProvider:t,catalog:s,selectedAccount:a,variantName:n,modelName:i,isPending:o,privacyMode:c,onVariantNameChange:u,onModelChange:r,onBack:m,onSkip:v,onCreate:h}){const{t:N}=re(),g=s||he[t],f=g?.models||[],F=i&&!f.some(x=>x.id===i),[y,D]=l.useState(F),S=t==="agy"&&i.trim().length>0?ie(i):!1,d=a?Lt(a.id,a.email,a.tokenFile):null,b=x=>{x===Tt?(D(!0),r("")):(D(!1),r(x))};return e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs("div",{className:"flex items-start gap-2 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx(ke,{className:"w-4 h-4"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{children:[N("setupVariant.using")," ",e.jsx("span",{className:Q(c&&ot),children:d?.email})]}),(d?.audienceLabel||d?.detailLabel)&&e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[d?.audienceLabel&&e.jsx(B,{variant:"outline",className:Q("text-[10px] h-4 px-1.5 border-transparent",d.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:d.audienceLabel}),d?.detailLabel&&e.jsx(B,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:d.detailLabel})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{htmlFor:"variant-name",children:N("setupVariant.variantNameRequired")}),e.jsx(ce,{id:"variant-name",value:n,onChange:x=>u(x.target.value),placeholder:N("setupVariant.variantNamePlaceholder")}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[N("setupVariant.invokeHintPrefix")," ccs ",n||"<name>",' "prompt"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{children:N("setupVariant.model")}),y?e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{value:i,onChange:x=>r(x.target.value),placeholder:N("setupVariant.modelPlaceholder")}),S&&e.jsx("p",{className:"text-xs text-destructive",children:"Antigravity denylist: Claude Opus 4.5 and Claude Sonnet 4.5 are deprecated."}),e.jsx("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>{D(!1),t==="agy"&&ie(i)&&r("")},children:N("setupVariant.choosePresetInstead")})]}):e.jsxs($e,{value:f.some(x=>x.id===i)?i:"",onValueChange:b,children:[e.jsx(Qe,{children:e.jsx(Je,{placeholder:N("setupVariant.selectModel")})}),e.jsxs(We,{children:[f.map(x=>e.jsx(we,{value:x.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:x.name}),x.description&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["- ",x.description]})]})},x.id)),e.jsx(we,{value:Tt,children:e.jsx("span",{className:"text-primary",children:N("setupVariant.customModelName")})})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:y?N("setupVariant.enterAnyModel"):N("setupVariant.defaultModel",{model:g?.defaultModel||N("setupVariant.providerDefault")})})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsxs(_,{variant:"ghost",onClick:m,children:[e.jsx(xt,{className:"w-4 h-4 mr-2"}),N("setupVariant.back")]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"ghost",onClick:v,children:N("setupVariant.skip")}),e.jsx(_,{onClick:h,disabled:!n||o||S,children:N(o?"setupVariant.creating":"setupVariant.createVariant")})]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:N("setupVariant.skipHint")})]})}function wa({variantName:t,onClose:s}){return e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center",children:e.jsx(ve,{className:"w-8 h-8 text-green-600 dark:text-green-400"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-lg",children:"Variant Created!"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Your custom variant is ready to use"})]}),e.jsx(Et,{children:e.jsxs(Ot,{className:"p-4 space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Usage:"}),e.jsxs("code",{className:"block px-3 py-2 bg-muted rounded-md font-mono text-sm",children:["ccs ",t,' "your prompt here"']})]})}),e.jsx(_,{onClick:s,className:"w-full",children:"Done"})]})}function ka({open:t,onClose:s}){const[a,n]=l.useState("provider"),[i,o]=l.useState(""),[c,u]=l.useState(null),[r,m]=l.useState(""),[v,h]=l.useState(""),[N,g]=l.useState(!1),[f,F]=l.useState(!1),{data:y,refetch:D}=_t(),{data:S}=Ft(),d=os(),b=ls(),x=cs(),{privacyMode:w}=Ut(),U=y?.authStatus.find(R=>R.provider===i),k=l.useMemo(()=>U?.accounts||[],[U?.accounts]),T=l.useMemo(()=>jt(S?.catalogs),[S?.catalogs]),q=!!S;l.useEffect(()=>{if(!t){const R=setTimeout(()=>{n("provider"),o(""),u(null),m(""),h(""),F(!1)},0);return()=>clearTimeout(R)}},[t]),l.useEffect(()=>{if(a==="auth"&&k.length>0&&!f){const R=setTimeout(()=>{n("account")},0);return()=>clearTimeout(R)}},[a,k,f]);const G=async()=>{g(!0),await D(),g(!1)},C=()=>{const R=(U?.accounts?.length||0)===0;b.mutate({provider:i},{onSuccess:async V=>{if(R){const z=await nt(i,void 0,q?T[i]:void 0);z.success&&z.presetName?H.success(`Applied "${z.presetName}" preset`):z.success||H.warning(qt.t("commonToast.accountAddedPresetFailed"))}V.account&&(u(V.account),n("variant")),D()}})},I=R=>{o(R),(y?.authStatus.find(W=>W.provider===R)?.accounts||[]).length===0?n("auth"):n("account")},j=R=>{u(R),n("variant")},E=async()=>{if(!(!r||!i))try{await d.mutateAsync({name:r,provider:i,model:v||void 0,account:c?.id}),n("success")}catch(R){console.error("Failed to create variant:",R)}},M=`ccs ${i} --auth --add`,O=us(a),A=R=>{if(!R&&(b.isPending&&i&&x.mutate(i),a==="success"||a==="provider")){s();return}};return e.jsx(lt,{open:t,onOpenChange:A,children:e.jsxs(ct,{className:"sm:max-w-lg",onPointerDownOutside:R=>{a!=="success"&&a!=="provider"&&R.preventDefault()},onEscapeKeyDown:R=>{(b.isPending||d.isPending)&&R.preventDefault()},children:[e.jsxs(dt,{children:[e.jsxs(ut,{className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"w-5 h-5 text-primary"}),"Quick Setup Wizard"]}),e.jsxs(Kt,{children:[a==="provider"&&"Select a provider to get started",a==="auth"&&"Authenticate with your provider",a==="account"&&"Select which account to use",a==="variant"&&"Create your custom variant",a==="success"&&"Setup complete!"]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[a==="provider"&&e.jsx(ja,{providers:bt,onSelect:I}),a==="auth"&&e.jsx(ba,{selectedProvider:i,providers:bt,authCommand:M,isRefreshing:N,isPending:b.isPending,onBack:()=>n("provider"),onStartAuth:C,onRefresh:G}),a==="account"&&e.jsx(Na,{accounts:k,privacyMode:w,onSelect:j,onAddNew:()=>{F(!0),n("auth")},onBack:()=>n("provider")}),a==="variant"&&e.jsx(ya,{selectedProvider:i,catalog:T[i],selectedAccount:c,variantName:r,modelName:v,isPending:d.isPending,privacyMode:w,onVariantNameChange:m,onModelChange:h,onBack:()=>k.length>0?n("account"):n("provider"),onSkip:s,onCreate:E}),a==="success"&&e.jsx(wa,{variantName:r,onClose:s})]}),e.jsx(va,{currentProgress:O,allSteps:ds})]})})}const Ca=3e3,Aa=300*1e3,Sa=3;async function ze(t){const s=await t.text();if(!s)return{};try{return JSON.parse(s)}catch{const a=t.status>=400?`Request failed with status ${t.status}`:void 0;return a?{error:a}:{}}}const de={provider:null,isAuthenticating:!1,error:null,authUrl:null,oauthState:null,isSubmittingCallback:!1,isDeviceCodeFlow:!1};function Pa(){const[t,s]=l.useState(de),a=l.useRef(de),n=l.useRef(0),i=l.useRef(null),o=l.useRef(null),c=l.useRef(0),u=l.useRef(0),r=l.useRef(!1),m=rt(),v=l.useCallback(y=>y===n.current,[]),h=l.useCallback(()=>{o.current&&(clearInterval(o.current),o.current=null),u.current=0},[]);l.useEffect(()=>()=>{i.current?.abort(),h(),r.current=!1},[h]),l.useEffect(()=>{a.current=t},[t]);const N=l.useCallback(async(y,D,S)=>{if(v(S)){if(Date.now()-c.current>Aa){h(),v(S)&&s(d=>({...d,isAuthenticating:!1,error:"Authentication timed out. Please try again."}));return}try{const d=await fetch(`/api/cliproxy/auth/${y}/status?state=${encodeURIComponent(D)}`);if(!v(S))return;const b=await d.json();if(u.current=0,b.status==="ok"){if(!(typeof b.account=="object"&&b.account!==null)){h();const w="Authenticated account could not be registered";H.error(w),s(U=>({...U,isAuthenticating:!1,error:w}));return}h(),m.invalidateQueries({queryKey:["cliproxy-auth"]}),m.invalidateQueries({queryKey:["cliproxy-accounts"]}),m.invalidateQueries({queryKey:["account-quota"]}),H.success(`${y} authentication successful`),r.current=!1,s(de)}else if(b.status==="auth_url"){const x=b.url||b.auth_url;x&&(s(w=>({...w,authUrl:x})),r.current||(r.current=!0,window.open(x,"_blank")))}else if(b.status==="device_code"){h();const x=b.user_code&&b.verification_url?`Open ${b.verification_url} and enter code: ${b.user_code}`:"Switch to Device Code method and try again.";H.error("Provider returned Device Code flow in callback mode"),s(w=>({...w,isAuthenticating:!1,error:x}))}else if(b.status==="error"){h();const x=b.error||"Authentication failed";H.error(x),s(w=>({...w,isAuthenticating:!1,error:x}))}}catch(d){if(!v(S)||(u.current+=1,u.current<Sa))return;h();const b=d instanceof Error&&d.message.trim().length>0?d.message:"Lost contact with the auth status endpoint";H.error(b),s(x=>({...x,isAuthenticating:!1,error:b}))}}},[v,m,h]),g=l.useCallback(async(y,D)=>{if(!Xe(y)){s({...de,error:`Unknown provider: ${y}`});return}i.current?.abort(),h(),r.current=!1,u.current=0;const S=new AbortController,d=n.current+1;n.current=d,i.current=S;const x=(D?.flowType||(Ht(y)?"device_code":"authorization_code"))==="device_code",w=D?.startEndpoint||(x?"start":"start-url"),U={nickname:D?.nickname,kiroMethod:D?.kiroMethod,kiroIDCStartUrl:D?.kiroIDCStartUrl,kiroIDCRegion:D?.kiroIDCRegion,kiroIDCFlow:D?.kiroIDCFlow,riskAcknowledgement:D?.riskAcknowledgement};s({provider:y,isAuthenticating:!0,error:null,authUrl:null,oauthState:null,isSubmittingCallback:!1,isDeviceCodeFlow:x});try{if(w==="start")fetch(`/api/cliproxy/auth/${y}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U),signal:S.signal}).then(async k=>{if(!v(d))return;const T=await ze(k);if(!v(d))return;const q=T.success===!0,G=typeof T.account=="object"&&T.account!==null;if(k.ok&&q&&G)m.invalidateQueries({queryKey:["cliproxy-auth"]}),m.invalidateQueries({queryKey:["cliproxy-accounts"]}),m.invalidateQueries({queryKey:["account-quota"]}),r.current=!1,s(de);else{const C=typeof T.error=="string"?T.error:q?"Authenticated account could not be registered":"Authentication failed";H.error(C),s(I=>({...I,isAuthenticating:!1,error:C}))}}).catch(k=>{if(!v(d)||k instanceof Error&&k.name==="AbortError")return;const T=k instanceof Error?k.message:"Authentication failed";H.error(T),s(q=>({...q,isAuthenticating:!1,error:T}))});else{const k=await fetch(`/api/cliproxy/auth/${y}/start-url`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U),signal:S.signal});if(!v(d))return;const T=await ze(k);if(!v(d))return;const q=T.success===!0;if(!k.ok||!q){const I=typeof T.error=="string"?T.error:"Failed to start OAuth";throw new Error(I)}const G=typeof T.authUrl=="string"?T.authUrl:null,C=typeof T.state=="string"?T.state:null;if(s(I=>({...I,authUrl:G,oauthState:C})),G&&(r.current=!0,window.open(G,"_blank")),C){if(c.current=Date.now(),!G){if(await N(y,C,d),!v(d))return;const I=a.current;if(!I.isAuthenticating||I.provider!==y)return}o.current=setInterval(()=>{N(y,C,d)},Ca)}}}catch(k){if(!v(d))return;if(k instanceof Error&&k.name==="AbortError"){r.current=!1,s(de);return}const T=k instanceof Error?k.message:"Authentication failed";H.error(T),s(q=>({...q,isAuthenticating:!1,error:T}))}},[v,N,h,m]),f=l.useCallback(()=>{const y=t.provider;n.current+=1,i.current?.abort(),h(),r.current=!1,s(de),y&&Oe.cliproxy.auth.cancel(y).catch(()=>{})},[t.provider,h]),F=l.useCallback(async y=>{if(!t.provider)return;const D=n.current,S=t.provider;s(d=>({...d,isSubmittingCallback:!0,error:null}));try{const d=await fetch(`/api/cliproxy/auth/${S}/submit-callback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUrl:y})});if(!v(D))return;const b=await ze(d);if(!v(D))return;const x=b.success===!0,w=b.status==="wait",U=typeof b.account=="object"&&b.account!==null;if(d.ok&&w)s(k=>({...k,isSubmittingCallback:!1,error:null}));else if(d.ok&&x&&U)h(),m.invalidateQueries({queryKey:["cliproxy-auth"]}),m.invalidateQueries({queryKey:["cliproxy-accounts"]}),m.invalidateQueries({queryKey:["account-quota"]}),H.success(`${S} authentication successful`),s(de);else{const k=typeof b.error=="string"?b.error:x?"Authenticated account could not be registered":"Callback submission failed";throw new Error(k)}}catch(d){if(!v(D))return;const b=d instanceof Error?d.message:"Failed to submit callback";H.error(b),s(x=>({...x,isSubmittingCallback:!1,error:b}))}},[v,t.provider,m,h]);return l.useMemo(()=>({...t,startAuth:g,cancelAuth:f,submitCallback:F}),[t,g,f,F])}function it({className:t,compact:s=!1,showAcknowledgement:a=!1,acknowledgementPhrase:n=Le,acknowledgementText:i="",onAcknowledgementTextChange:o,disabled:c=!1,showProxySettingsLink:u=!1}){const{t:r}=re(),m=r("accountSafetyWarning.title"),v=r("accountSafetyWarning.subtitle"),h=r("accountSafetyWarning.firstLine"),N=r("accountSafetyWarning.secondLine"),g="https://github.com/kaitranntt/ccs/issues/509",f=r("accountSafetyWarning.issueLabel"),F=r("accountSafetyWarning.proxySettingsLabel");return s?e.jsx("section",{role:"alert",className:Q("border-b border-amber-200/70 bg-amber-50/45 dark:bg-amber-950/5",t),children:e.jsxs("div",{className:"flex flex-col gap-3 px-6 py-3 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"min-w-0 flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 inline-flex h-6 w-6 items-center justify-center rounded-md bg-amber-500/12 text-amber-700 dark:text-amber-300",children:e.jsx(Fe,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-xs font-semibold leading-5",children:m}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:v})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:h}),e.jsx("p",{className:"text-xs font-medium leading-5 text-amber-900 dark:text-amber-200",children:N})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 lg:justify-end",children:[e.jsxs("a",{href:g,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md border border-amber-500/25 bg-background/90 px-2 py-1 text-[11px] font-medium text-amber-800 transition-colors hover:bg-amber-500/10 dark:text-amber-200",children:[f,e.jsx(ge,{className:"h-3 w-3"})]}),u?e.jsxs("a",{href:"/settings?tab=proxy",className:"inline-flex items-center gap-1 rounded-md border border-amber-500/25 bg-background/90 px-2 py-1 text-[11px] font-medium text-amber-800 transition-colors hover:bg-amber-500/10 dark:text-amber-200",children:[e.jsx(Pt,{className:"h-3 w-3"}),F]}):null,e.jsx(B,{variant:"outline",className:"border-amber-500/40 text-[10px] text-amber-700 dark:text-amber-300",children:"High Risk"})]})]})}):e.jsxs("section",{role:"alert",className:Q("relative overflow-hidden rounded-xl border border-amber-500/30 bg-gradient-to-br from-amber-50 via-background to-rose-50/70 shadow-sm dark:from-amber-950/20 dark:to-rose-950/20",t),children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-amber-500 via-orange-500 to-rose-500"}),e.jsxs("div",{className:"space-y-3 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"mt-0.5 inline-flex h-7 w-7 items-center justify-center rounded-md bg-amber-500/15 text-amber-700 dark:text-amber-400",children:e.jsx(Fe,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold leading-5",children:m}),e.jsx("p",{className:"text-xs text-muted-foreground",children:v})]})]}),e.jsx(B,{variant:"outline",className:"border-amber-500/40 text-amber-700 dark:text-amber-300",children:"High Risk"})]}),e.jsxs("div",{className:"space-y-2 text-sm leading-relaxed",children:[e.jsx("p",{children:h}),e.jsx("p",{className:"font-medium text-amber-900 dark:text-amber-200",children:N}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"CCS is provided as-is and does not take responsibility for suspension, bans, or access loss from upstream providers."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("a",{href:g,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-xs font-medium text-amber-800 transition-colors hover:bg-amber-500/15 dark:text-amber-200",children:[f,e.jsx(ge,{className:"h-3.5 w-3.5"})]}),u&&e.jsxs("a",{href:"/settings?tab=proxy",className:"inline-flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-xs font-medium text-amber-800 transition-colors hover:bg-amber-500/15 dark:text-amber-200",children:[e.jsx(Pt,{className:"h-3.5 w-3.5"}),F]}),e.jsx("span",{className:"rounded-md border border-border/70 bg-muted/60 px-2.5 py-1 text-xs text-muted-foreground",children:"Applies to CLI and dashboard auth"})]}),a&&o&&e.jsxs("div",{className:"rounded-lg border border-amber-500/25 bg-amber-500/5 p-2.5",children:[e.jsxs(J,{htmlFor:"account-risk-ack-text",className:"text-xs leading-5",children:["Type exact phrase to continue:"," ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:n})]}),e.jsx(ce,{id:"account-risk-ack-text",value:i,onChange:y=>o(y.target.value),placeholder:n,disabled:c,className:"mt-2 font-mono text-xs"})]})]})]})}function Ma({className:t,value:s,onChange:a,disabled:n=!1}){const{t:i}=re(),o=[s.reviewedIssue509,s.understandsBanRisk,s.acceptsFullResponsibility,s.typedPhrase.trim().replace(/\s+/g," ").toUpperCase()===Mt].filter(Boolean).length,c=o/4*100,u=r=>{a({...s,...r})};return e.jsxs("section",{role:"alert",className:Q("relative overflow-hidden rounded-xl border border-rose-500/35 bg-gradient-to-br from-rose-50 via-background to-amber-50/70 p-4 shadow-sm dark:from-rose-950/20 dark:to-amber-950/20",t),children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-0.5 bg-gradient-to-r from-rose-500 via-orange-500 to-amber-500"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx("div",{className:"mt-0.5 inline-flex h-7 w-7 items-center justify-center rounded-md bg-rose-500/15 text-rose-700 dark:text-rose-300",children:e.jsx(Fe,{className:"h-4 w-4"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-semibold leading-5",children:i("antigravityChecklist.title")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i("antigravityChecklist.subtitle")})]})]}),e.jsx(B,{variant:"outline",className:"border-rose-500/40 text-rose-700 dark:text-rose-300",children:i("antigravityChecklist.mandatory")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:i("antigravityChecklist.completion")}),e.jsx("span",{children:i("antigravityChecklist.stepsCount",{current:o})})]}),e.jsx(ms,{value:c,className:"h-2"})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border border-rose-500/20 bg-rose-500/5 p-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(_e,{id:"agy-step-reviewed-issue",checked:s.reviewedIssue509,onCheckedChange:r=>u({reviewedIssue509:!!r}),disabled:n}),e.jsx(J,{htmlFor:"agy-step-reviewed-issue",className:"text-xs leading-5",children:"Step 1: I reviewed issue #509 and understand AGY OAuth can trigger account bans/suspensions."})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(_e,{id:"agy-step-understands-risk",checked:s.understandsBanRisk,onCheckedChange:r=>u({understandsBanRisk:!!r}),disabled:n}),e.jsx(J,{htmlFor:"agy-step-understands-risk",className:"text-xs leading-5",children:"Step 2: I understand this OAuth action is my own decision and I accept the upstream risk."})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(_e,{id:"agy-step-accept-responsibility",checked:s.acceptsFullResponsibility,onCheckedChange:r=>u({acceptsFullResponsibility:!!r}),disabled:n}),e.jsx(J,{htmlFor:"agy-step-accept-responsibility",className:"text-xs leading-5",children:"Step 3: I accept full responsibility. CCS is not liable for suspension, bans, or access loss."})]})]}),e.jsxs("div",{className:"space-y-2 rounded-lg border border-amber-500/25 bg-amber-500/5 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-amber-800 dark:text-amber-200",children:[e.jsx($t,{className:"h-3.5 w-3.5"}),"Step 4: Type exact phrase to continue"]}),e.jsx(ce,{value:s.typedPhrase,onChange:r=>u({typedPhrase:r.target.value}),placeholder:Mt,disabled:n,className:"font-mono text-xs"})]}),e.jsx("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:e.jsxs("a",{href:"https://github.com/kaitranntt/ccs/issues/509",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-md border border-rose-500/30 bg-rose-500/10 px-2.5 py-1 font-medium text-rose-800 transition-colors hover:bg-rose-500/15 dark:text-rose-200",children:["Read issue #509",e.jsx(ge,{className:"h-3.5 w-3.5"})]})})]})]})}function Da(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function Ta({open:t,onClose:s,provider:a,displayName:n,catalog:i,isFirstAccount:o=!1}){const[c,u]=l.useState(""),[r,m]=l.useState(""),[v,h]=l.useState(!1),[N,g]=l.useState(null),[f,F]=l.useState(""),[y,D]=l.useState(Ve),[S,d]=l.useState(!1),[b,x]=l.useState(!1),[w,U]=l.useState(Nt),[k,T]=l.useState(""),[q,G]=l.useState(""),[C,I]=l.useState(yt),{t:j}=re(),E=l.useRef(!1),M=l.useRef(0),O=l.useRef(!1),A=Pa(),R=ps(),V=a==="kiro",z=a==="agy"||a==="gemini",W=a==="gemini"&&!S,X=a==="agy"&&!S,oe=z&&b,Y=na(y),Z=Da(f)===Le,p=Ht(a),K=xs(w),te=V&&w==="idc",pe=V&&gs(w),Se=V?hs(w,C):void 0,Ke=V?vs(w):void 0,Pe=V?Se==="device_code":p,se=A.isAuthenticating||R.isPending,qe=c.trim(),be=k.trim(),Me=q.trim(),De=N||A.error,Te=l.useCallback(async()=>{const P=await fetch("/api/settings/auth/antigravity-risk");if(!P.ok)throw new Error("Failed to load power user mode setting");return(await P.json()).antigravityAckBypass===!0},[]),xe=l.useCallback(async({pendingMessage:P=null,disabledMessage:le=null}={})=>{const Ge=++M.current;x(!0),P!==null&&g(P);try{const Re=await Te();return M.current!==Ge||(d(Re),le?g(Re?null:le):P!==null&&g(null)),Re}catch{return M.current!==Ge||(d(!1),g(le??j("addAccountDialog.powerUserLoadFailed")),O.current||(O.current=!0,H.error(j("addAccountDialog.powerUserLoadFailed")))),!1}finally{M.current===Ge&&x(!1)}},[Te,j]),Ne=()=>{u(""),m(""),h(!1),g(null),F(""),D(Ve),d(!1),x(!1),U(Nt),T(""),G(""),I(yt),M.current+=1,O.current=!1,E.current=!1,s()};l.useEffect(()=>{t&&(F(""),D(Ve),g(null))},[a,t]),l.useEffect(()=>()=>{M.current+=1},[]),l.useEffect(()=>{if(!t||!z){M.current+=1,d(!1),x(!1);return}xe()},[t,a,z,xe]),l.useEffect(()=>{if(!t||a!=="agy"||!A.error||!S)return;const P=A.error.toLowerCase();(P.includes("agy_risk_ack_required")||P.includes("responsibility acknowledgement")||P.includes("responsibility checklist"))&&xe({pendingMessage:j("addAccountDialog.powerUserLoading"),disabledMessage:j("addAccountDialog.powerUserUnavailableRetry")})},[A.error,t,S,a,xe,j]),l.useEffect(()=>{!A.isAuthenticating&&!A.error&&A.provider===null&&t&&E.current&&(E.current=!1,(async()=>{try{const le=await nt(a,void 0,i);le.success&&le.presetName&&o&&H.success(`Applied "${le.presetName}" preset`)}catch{}Ne()})())},[A.isAuthenticating,A.error,A.provider]);const Ie=()=>{A.cancelAuth(),Ne()},He=async()=>{A.authUrl&&(await navigator.clipboard.writeText(A.authUrl),h(!0),setTimeout(()=>h(!1),2e3))},L=()=>{r.trim()&&A.submitCallback(r.trim())},$=()=>{if(oe){g(j("addAccountDialog.powerUserLoading"));return}if(X&&!Y){g("Complete all Antigravity responsibility steps before authenticating this provider.");return}if(W&&!Z){g(`Type "${Le}" to acknowledge the account safety warning before authenticating this provider.`);return}if(g(null),te&&!be){g("IDC Start URL is required for Kiro IAM Identity Center login.");return}E.current=!0,A.startAuth(a,{nickname:qe||void 0,kiroMethod:V?w:void 0,kiroIDCStartUrl:te?be:void 0,kiroIDCRegion:te&&Me?Me:void 0,kiroIDCFlow:te?C:void 0,flowType:V?Se:void 0,startEndpoint:V?Ke:void 0,riskAcknowledgement:X?{version:ia,reviewedIssue509:y.reviewedIssue509,understandsBanRisk:y.understandsBanRisk,acceptsFullResponsibility:y.acceptsFullResponsibility,typedPhrase:y.typedPhrase}:void 0})},ae=()=>{E.current=!0,R.mutate(void 0,{onSuccess:async()=>{const P=await nt("kiro",void 0,i);P.success&&P.presetName&&o&&H.success(`Applied "${P.presetName}" preset`),Ne()}})},ye=P=>{P||Ie()},ne=A.isAuthenticating;return e.jsx(lt,{open:t,onOpenChange:ye,children:e.jsxs(ct,{className:"sm:max-w-md",onInteractOutside:P=>{ne&&P.preventDefault()},children:[e.jsxs(dt,{children:[e.jsx(ut,{children:j("addAccountDialog.title",{displayName:n})}),e.jsx(Kt,{children:j(V?"addAccountDialog.descKiro":Pe?"addAccountDialog.descDeviceCode":"addAccountDialog.descOauth")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[X&&!ne&&e.jsx(Ma,{value:y,onChange:P=>{D(P),g(null)},disabled:se}),z&&S&&!ne&&e.jsxs("div",{className:"rounded-lg border border-amber-400/35 bg-amber-50/70 p-3 text-xs text-amber-900 dark:border-amber-800/60 dark:bg-amber-950/25 dark:text-amber-100",children:[e.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 font-semibold",children:[e.jsx($t,{className:"h-3.5 w-3.5"}),j("addAccountDialog.powerUserEnabled")]}),j("addAccountDialog.powerUserSkipped")]}),W&&!ne&&e.jsx(it,{showAcknowledgement:!0,acknowledgementPhrase:Le,acknowledgementText:f,onAcknowledgementTextChange:P=>{F(P),g(null)},disabled:se}),V&&!ne&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{htmlFor:"kiro-auth-method",children:j("addAccountDialog.authMethod")}),e.jsxs($e,{value:w,onValueChange:P=>{U(P),g(null)},children:[e.jsx(Qe,{id:"kiro-auth-method",children:e.jsx(Je,{placeholder:j("addAccountDialog.selectKiroAuthMethod")})}),e.jsx(We,{children:fs.map(P=>e.jsx(we,{value:P.id,children:P.label},P.id))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:K.description}),pe&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["If your browser does not return automatically after login, CCS can accept the final",e.jsx("span",{className:"mx-1 rounded bg-muted px-1.5 py-0.5 font-mono text-[11px]",children:"kiro://..."}),"callback URL in the next step."]})]}),te&&!ne&&e.jsxs("div",{className:"space-y-4 rounded-lg border border-border/60 bg-muted/20 p-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{htmlFor:"kiro-idc-start-url",children:"IDC Start URL"}),e.jsx(ce,{id:"kiro-idc-start-url",value:k,onChange:P=>{T(P.target.value),g(null)},placeholder:"https://d-xxx.awsapps.com/start",disabled:se}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for organization IAM Identity Center login."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{htmlFor:"kiro-idc-region",children:"IDC Region"}),e.jsx(ce,{id:"kiro-idc-region",value:q,onChange:P=>{G(P.target.value),g(null)},placeholder:"us-east-1",disabled:se}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Leave blank to use the upstream default region."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{htmlFor:"kiro-idc-flow",children:"IDC Flow"}),e.jsxs($e,{value:C,onValueChange:P=>{I(P),g(null)},children:[e.jsx(Qe,{id:"kiro-idc-flow",children:e.jsx(Je,{placeholder:"Select IDC flow"})}),e.jsxs(We,{children:[e.jsx(we,{value:"authcode",children:"Authorization Code"}),e.jsx(we,{value:"device",children:"Device Code"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Auth Code opens a browser and may need the final callback URL pasted back. Device Code shows a verification code instead."})]})]}),!ne&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{htmlFor:"nickname",children:j("addAccountDialog.nicknameOptional")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(ce,{id:"nickname",value:c,onChange:P=>{u(P.target.value),g(null)},placeholder:j("addAccountDialog.nicknamePlaceholder"),disabled:se,className:"flex-1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:j("addAccountDialog.nicknameOptionalHint")})]}),ne&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx(ee,{className:"w-4 h-4 inline mr-2 animate-spin"}),j("addAccountDialog.waitingForAuth")]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:A.isDeviceCodeFlow?j("addAccountDialog.deviceCodeHint"):pe?"Complete sign-in in your browser. If it does not return automatically, paste the final kiro:// callback URL below.":j("addAccountDialog.browserHint")})]}),A.authUrl&&!A.isDeviceCodeFlow&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{className:"text-xs",children:j("addAccountDialog.openUrlLabel")}),e.jsxs("div",{className:"p-3 bg-muted rounded-md",children:[e.jsx("p",{className:"text-xs text-muted-foreground break-all font-mono line-clamp-3",children:A.authUrl}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(_,{variant:"outline",size:"sm",onClick:He,children:v?e.jsxs(e.Fragment,{children:[e.jsx(ve,{className:"w-3 h-3 mr-1"}),j("addAccountDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-3 h-3 mr-1"}),j("addAccountDialog.copy")]})}),e.jsxs(_,{variant:"outline",size:"sm",onClick:()=>{if(!A.authUrl)return;const P=window.open(A.authUrl,"_blank");(!P||P.closed||typeof P.closed>"u")&&H.warning(j("addAccountDialog.popupBlocked"),{duration:5e3})},children:[e.jsx(ge,{className:"w-3 h-3 mr-1"}),j("addAccountDialog.open")]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{htmlFor:"callback-url",className:"text-xs",children:pe?"Browser did not return? Paste the final kiro:// callback URL:":j("addAccountDialog.redirectPasteLabel")}),e.jsx(ce,{id:"callback-url",value:r,onChange:P=>m(P.target.value),placeholder:pe?"kiro://kiro.kiroAgent/authenticate-success?code=...&state=...":j("addAccountDialog.callbackPlaceholder"),className:"font-mono text-xs"}),e.jsx(_,{variant:"secondary",size:"sm",onClick:L,disabled:!r.trim()||A.isSubmittingCallback,children:A.isSubmittingCallback?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-3 h-3 mr-1 animate-spin"}),j("addAccountDialog.submitting")]}):j("addAccountDialog.submitCallback")})]})]}),!A.authUrl&&!A.isDeviceCodeFlow&&e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:pe?"Preparing the Kiro sign-in URL. If it does not open automatically, it will appear here shortly.":j("addAccountDialog.preparingUrl")})]}),De&&e.jsx("p",{className:"text-xs text-center text-destructive",children:De}),R.isPending&&e.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:[e.jsx(ee,{className:"w-4 h-4 inline mr-2 animate-spin"}),j("addAccountDialog.importingToken")]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[e.jsx(_,{variant:"ghost",onClick:Ie,children:j("addAccountDialog.cancel")}),V&&!ne&&e.jsx(_,{variant:"outline",onClick:ae,disabled:se,children:R.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-2 animate-spin"}),j("addAccountDialog.importing")]}):e.jsxs(e.Fragment,{children:[e.jsx(Xs,{className:"w-4 h-4 mr-2"}),j("addAccountDialog.importFromIde")]})}),!ne&&e.jsxs(_,{onClick:$,disabled:se||oe||X&&!Y||W&&!Z,children:[e.jsx(ge,{className:"w-4 h-4 mr-2"}),j("addAccountDialog.authenticate")]})]})]})]})})}const Ia=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"];function Ra(t){const s=t?.env||{};return Ia.filter(a=>!s[a]?.trim())}function Ea(t,s){const[a,n]=l.useState(null),[i,o]=l.useState(!1),c=rt(),{data:u,isLoading:r,refetch:m}=Rt({queryKey:["settings",t],queryFn:async()=>{const C=await fetch(`/api/settings/${t}/raw`);return C.ok?C.json():{profile:t,settings:{env:{}},mtime:Date.now(),path:`~/.ccs/profiles/${t}/settings.json`}}}),v=u?.settings,h=l.useMemo(()=>a!==null?a:v?JSON.stringify(v,null,2):`{
|
|
2
|
-
"env": {}
|
|
3
|
-
}`,[a,v]),N=l.useCallback(C=>{n(C)},[]),g=l.useMemo(()=>{try{return JSON.parse(h)}catch{return v||{env:{}}}},[h,v]),f=g?.env?.ANTHROPIC_MODEL,F=g?.env?.ANTHROPIC_DEFAULT_OPUS_MODEL,y=g?.env?.ANTHROPIC_DEFAULT_SONNET_MODEL,D=g?.env?.ANTHROPIC_DEFAULT_HAIKU_MODEL,S=l.useMemo(()=>js(g?.env||{}),[g]),d=l.useCallback((C,I)=>bs(C,I,{supportsExtendedContext:j=>ha(t,j,s)}),[s,t]),b=l.useCallback((C,I)=>{const j={...g?.env||{},[C]:I},E=wt(C)?d(j,S):j;delete E.CCS_EXTENDED_CONTEXT;const M={...g,env:E};n(JSON.stringify(M,null,2))},[d,g,S]),x=l.useCallback(C=>{const I=g?.env||{},j=d(I,C);delete j.CCS_EXTENDED_CONTEXT;const E={...g,env:j};n(JSON.stringify(E,null,2))},[d,g]),w=l.useCallback(C=>{const I={...g?.env||{},...C},E=Object.keys(C).some(wt)?d(I,S):I;delete E.CCS_EXTENDED_CONTEXT;const M={...g,env:E};n(JSON.stringify(M,null,2))},[d,g,S]),U=l.useMemo(()=>{try{return JSON.parse(h),!0}catch{return!1}},[h]),k=l.useMemo(()=>a===null?!1:a!==JSON.stringify(v,null,2),[a,v]),T=l.useMemo(()=>Ra(g),[g]),q=is({mutationFn:async()=>{const C=JSON.parse(h),I=await fetch(`/api/settings/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:C,expectedMtime:u?.mtime})});if(I.status===409)throw new Error("CONFLICT");if(!I.ok)throw new Error("Failed to save");return I.json()},onSuccess:C=>{c.invalidateQueries({queryKey:["settings",t]}),n(null),C?.warning?H.success("Settings saved",{description:C.warning}):H.success("Settings saved")},onError:C=>{C.message==="CONFLICT"?o(!0):H.error(C.message)}}),G=async C=>{o(!1),C?(await m(),q.mutate()):n(null)};return{data:u,isLoading:r,refetch:m,rawJsonContent:h,rawJsonEdits:a,isRawJsonValid:U,hasChanges:k,currentSettings:g,currentModel:f,opusModel:F,sonnetModel:y,haikuModel:D,extendedContextEnabled:S,toggleExtendedContext:x,handleRawJsonChange:N,updateEnvValue:b,updateEnvValues:w,saveMutation:{mutate:()=>q.mutate(),isPending:q.isPending},conflictDialog:i,setConflictDialog:o,handleConflictResolve:G,missingRequiredFields:T}}const Oa=/-(medium|high|xhigh)$/i;function La(t){if(!t)return;const s=t.trim().match(Oa);if(s?.[1])return s[1].toLowerCase()}function _a(t){if(!t)return null;const s=La(t);return s?{label:`Pinned ${s}`,explicit:!0}:{label:"Auto effort",explicit:!1}}function Fa({label:t}){return e.jsx(B,{variant:"outline",className:"text-[9px] h-4 px-1",children:t})}function Ee({modelId:t}){const s=_a(t);return s?e.jsx(B,{variant:s.explicit?"secondary":"outline",className:"text-[9px] h-4 px-1 uppercase",children:s.label}):null}function me({label:t,description:s,value:a,onChange:n,catalog:i,allModels:o,disabled:c}){const{t:u}=re(),r=i?.provider==="codex",m=l.useMemo(()=>ns(i,o),[o,i]),v=new Set(m.map(f=>f.id)),h=m.map(f=>({value:f.id,groupKey:"recommended",searchText:`${f.id} ${f.name}`,keywords:[f.tier??"",i?.provider??""],triggerContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:f.id}),r&&e.jsx(Ee,{modelId:f.id})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:f.id}),f.tier==="paid"&&e.jsx(Fa,{label:u("providerModelSelector.paid")}),r&&e.jsx(Ee,{modelId:f.id})]})})),N=o.filter(f=>!v.has(f.id)).map(f=>({value:f.id,groupKey:"all",searchText:f.id,keywords:[f.owned_by],triggerContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:f.id}),r&&e.jsx(Ee,{modelId:f.id})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:f.id}),r&&e.jsx(Ee,{modelId:f.id})]})})),g=h.length+N.length>0;return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium",children:t}),s&&e.jsx("p",{className:"text-[10px] text-muted-foreground",children:s})]}),e.jsx(oa,{value:a||void 0,onChange:n,disabled:c,placeholder:u("providerModelSelector.selectModel"),searchPlaceholder:u("searchableSelect.searchModels"),emptyText:u(g?"searchableSelect.noResults":"providerModelSelector.noModelsAvailable"),triggerClassName:"h-9",groups:[{key:"recommended",label:e.jsx("span",{className:"text-xs text-primary",children:u("providerModelSelector.recommended")})},{key:"all",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:u("providerModelSelector.allModelsCount",{count:o.length})})}],options:[...h,...N]})]})}function Ua({open:t,onClose:s,currentValues:a,onApply:n,onSave:i,isSaving:o,catalog:c,allModels:u}){const{t:r}=re(),[m,v]=l.useState(a),[h,N]=l.useState(""),g=f=>{f?(v(a),N("")):s()};return e.jsx(lt,{open:t,onOpenChange:g,children:e.jsxs(ct,{className:"sm:max-w-md",children:[e.jsx(dt,{children:e.jsxs(ut,{className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"w-4 h-4"}),r("customPresetDialog.title")]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(J,{htmlFor:"preset-name",children:r("customPresetDialog.presetNameOptional")}),e.jsx(ce,{id:"preset-name",value:h,onChange:f=>N(f.target.value),placeholder:r("customPresetDialog.presetNamePlaceholder"),className:"text-sm"})]}),e.jsx(vt,{}),c?.provider==="codex"&&e.jsxs("p",{className:"text-[11px] text-muted-foreground rounded-md border bg-muted/30 px-2.5 py-2",children:[r("customPresetDialog.codexTipPrefix")," ",e.jsx("code",{children:"-medium"}),", ",e.jsx("code",{children:"-high"}),", and"," ",e.jsx("code",{children:"-xhigh"})," ",r("customPresetDialog.codexTipSuffix")]}),e.jsx(me,{label:r("customPresetDialog.defaultModel"),description:r("customPresetDialog.defaultModelDesc"),value:m.default,onChange:f=>v({...m,default:f}),catalog:c,allModels:u}),e.jsx(me,{label:r("customPresetDialog.opusModel"),description:r("customPresetDialog.opusModelDesc"),value:m.opus,onChange:f=>v({...m,opus:f}),catalog:c,allModels:u}),e.jsx(me,{label:r("customPresetDialog.sonnetModel"),description:r("customPresetDialog.sonnetModelDesc"),value:m.sonnet,onChange:f=>v({...m,sonnet:f}),catalog:c,allModels:u}),e.jsx(me,{label:r("customPresetDialog.haikuModel"),description:r("customPresetDialog.haikuModelDesc"),value:m.haiku,onChange:f=>v({...m,haiku:f}),catalog:c,allModels:u})]}),e.jsxs(Ns,{className:"gap-2 sm:gap-0",children:[e.jsx(_,{variant:"outline",onClick:s,children:r("customPresetDialog.cancel")}),i&&e.jsxs(_,{variant:"secondary",onClick:()=>i(m,h||void 0),disabled:o||!h.trim(),children:[o?e.jsx(ee,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(gt,{className:"w-4 h-4 mr-1"}),r("customPresetDialog.savePreset")]}),e.jsxs(_,{onClick:()=>n(m,h||void 0),children:[e.jsx(Ae,{className:"w-4 h-4 mr-1"}),r("customPresetDialog.applyPreset")]})]})]})})}function ue({label:t,command:s}){return e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:t}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsx("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:s}),e.jsx(Gt,{value:s,size:"icon",className:"h-6 w-6"})]})]})}function Ka({provider:t,displayName:s,defaultTarget:a,data:n,authStatus:i,supportsModelConfig:o=!1}){const c=a||"claude",u=c==="droid",r=t==="codex",m=c==="claude"?`ccs ${t}`:`ccs ${t} --target claude`,v=`${m} --config`,h=`${m} --auth --add`,N=`${m} --accounts`;return e.jsx(mt,{className:"h-full",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2 mb-3",children:[e.jsx(Qt,{className:"w-4 h-4"}),"Provider Information"]}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Provider"}),e.jsx("span",{className:"font-mono",children:s})]}),n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"File Path"}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs break-all",children:n.path}),e.jsx(Gt,{value:n.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Last Modified"}),e.jsx("span",{className:"text-xs",children:new Date(n.mtime).toLocaleString()})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Status"}),i.authenticated?e.jsxs(B,{variant:"outline",className:"w-fit text-green-600 border-green-200 bg-green-50",children:[e.jsx(Ys,{className:"w-3 h-3 mr-1"}),"Authenticated"]}):e.jsx(B,{variant:"outline",className:"w-fit text-muted-foreground",children:"Not connected"})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Default Target"}),e.jsx("span",{className:"font-mono",children:c})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:"Quick Usage"}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsx(ue,{label:"Run with prompt",command:`ccs ${t} "your prompt"`}),r&&e.jsxs(e.Fragment,{children:[e.jsx(ue,{label:"Run on native Codex (shortcut)",command:'ccsxp "your prompt"'}),e.jsx(ue,{label:"Run on native Codex (--target)",command:`ccs ${t} --target codex "your prompt"`})]}),e.jsx(ue,{label:u?"Droid alias (explicit)":"Run on Droid",command:`ccs-droid ${t} "your prompt"`}),e.jsx(ue,{label:u?"Override to Claude":"Run on Droid (--target)",command:`ccs ${t} --target ${u?"claude":"droid"} "your prompt"`}),o&&e.jsx(ue,{label:c==="claude"?"Change model":"Change model (Claude target)",command:v}),e.jsx(ue,{label:c==="claude"?"Add account":"Add account (Claude target)",command:h}),e.jsx(ue,{label:c==="claude"?"List accounts":"List accounts (Claude target)",command:N}),c!=="claude"&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Account and model-management flags stay on Claude target. Codex and Droid runtime launches reject those CLIProxy management commands."})]})]})]})})}function qa({displayName:t,logoProvider:s,provider:a,data:n,isLoading:i,hasChanges:o,isRawJsonValid:c,isSaving:u,isRemoteMode:r,port:m,onRefetch:v,onSave:h}){return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(pt,{provider:s||a,size:"lg"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:t}),r&&e.jsxs(B,{variant:"secondary",className:"text-xs gap-1 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:[e.jsx(Jt,{className:"w-3 h-3"}),"Remote"]}),m&&e.jsxs(B,{variant:"outline",className:"text-xs gap-1 font-mono",children:[e.jsx(Zs,{className:"w-3 h-3"}),":",m]}),!r&&n?.path&&e.jsx(B,{variant:"outline",className:"text-xs",children:n.path.replace(/^.*[\\/]/,"")})]}),r?e.jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400 mt-0.5",children:"Traffic auto-routed to remote server"}):n&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",new Date(n.mtime).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"ghost",size:"sm",onClick:v,disabled:i,children:e.jsx(ht,{className:`w-4 h-4 ${i?"animate-spin":""}`})}),e.jsx(_,{size:"sm",onClick:h,disabled:u||!o||!c,children:u?e.jsxs(e.Fragment,{children:[e.jsx(ee,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ea,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Ha({models:t,provider:s,enabled:a,onToggle:n,disabled:i,className:o}){if(t.length===0)return null;const c=t.some(m=>kt(m.id)),u=t.some(m=>!kt(m.id));let r="Compatible mappings stay on standard context unless you turn this on.";return c&&u?r="Gemini-compatible mappings can use 1M automatically. Claude mappings stay plain unless you turn this on.":c&&(r="Gemini-compatible mappings can use 1M by default. Turn this off to keep standard context."),e.jsxs("div",{className:Q("rounded-lg border p-3 space-y-2",a?"border-primary/50 bg-primary/5":"border-border bg-muted/30",o),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ae,{className:Q("w-4 h-4",a?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"text-sm font-medium",children:"Extended Context"}),e.jsx(B,{variant:a?"default":"secondary",className:"text-[10px] h-5 px-1.5",children:"1M tokens"})]}),e.jsx(Vt,{checked:a,onCheckedChange:n,disabled:i})]}),e.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[e.jsx(Qt,{className:"w-3.5 h-3.5 mt-0.5 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{children:["Applies the explicit ",e.jsx("code",{children:"[1m]"})," long-context suffix to compatible saved mappings."]}),e.jsx("p",{className:"text-[10px]",children:r}),e.jsxs("p",{className:"text-amber-600 dark:text-amber-500",children:["CCS only saves ",e.jsx("code",{children:"[1m]"}),". Provider pricing and entitlement are separate, and some accounts can still return 429 extra-usage errors for long-context requests."]})]})]})]})}function Ga(t){const s=t.presetMapping||{default:t.id,opus:t.id,sonnet:t.id,haiku:t.id};return{ANTHROPIC_MODEL:s.default,ANTHROPIC_DEFAULT_OPUS_MODEL:s.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:s.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:s.haiku}}function Va({catalog:t,savedPresets:s,currentModel:a,opusModel:n,sonnetModel:i,haikuModel:o,providerModels:c,provider:u,extendedContextEnabled:r,onExtendedContextToggle:m,onApplyPreset:v,onUpdateEnvValue:h,onOpenCustomPreset:N,onDeletePreset:g,isDeletePending:f}){const F=l.useMemo(()=>{if(!t)return[];const d=[a,n,i,o].filter(x=>!!x).map(x=>ys(x));return[...new Set(d)].map(x=>as(t.provider,x,t)).filter(x=>!!x?.extendedContext)},[t,a,n,i,o]),y=l.useMemo(()=>ns(t,c),[t,c]),D=l.useMemo(()=>{const d=y.filter(x=>x.presetMapping);return d.length===0?[]:d.some(x=>x.tier==="paid")?[{key:"free",label:"Free Tier",description:"Available on free or paid plans",badgeClassName:"text-[10px] bg-green-100 text-green-700 border-green-200",iconClassName:"text-green-600",models:d.filter(x=>x.tier!=="paid")},{key:"paid",label:"Paid Tier",description:"Requires paid access",badgeClassName:"text-[10px] bg-amber-100 text-amber-700 border-amber-200",iconClassName:"text-amber-700",models:d.filter(x=>x.tier==="paid")}].filter(x=>x.models.length>0):[{key:"default",models:d.slice(0,4)}]},[y]),S=D.length>0||s.length>0;return e.jsxs(e.Fragment,{children:[S&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(Ce,{className:"w-4 h-4"}),"Presets"]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Apply pre-configured model mappings"}),e.jsxs("div",{className:"space-y-4",children:[D.map(d=>e.jsxs("div",{children:["label"in d&&d.label&&e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(B,{variant:"outline",className:d.badgeClassName,children:d.label}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:d.description})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:d.models.map(b=>e.jsxs(_,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>v(Ga(b)),children:[e.jsx(Ae,{className:`w-3 h-3 ${"iconClassName"in d?d.iconClassName:""}`}),b.name]},b.id))})]},d.key)),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.map(d=>e.jsxs("div",{className:"group relative",children:[e.jsxs(_,{variant:"secondary",size:"sm",className:"text-xs h-7 gap-1 pr-6",onClick:()=>{v({ANTHROPIC_MODEL:d.default,ANTHROPIC_DEFAULT_OPUS_MODEL:d.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:d.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:d.haiku})},children:[e.jsx(gt,{className:"w-3 h-3 fill-current"}),d.name]}),e.jsx(_,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-7 w-5 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:b=>{b.stopPropagation(),g(d.name)},disabled:f,children:e.jsx(ft,{className:"w-3 h-3"})})]},d.name)),e.jsxs(_,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1 border-primary/50 text-primary hover:bg-primary/10 hover:border-primary",onClick:N,children:[e.jsx(Wt,{className:"w-3 h-3"}),"Custom"]})]})]})]}),e.jsx(vt,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-2",children:"Model Mapping"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Configure which models to use for each tier"}),u==="codex"&&e.jsxs("p",{className:"text-[11px] text-muted-foreground mb-3 rounded-md border bg-muted/30 px-2.5 py-2",children:["Codex tip: suffixes ",e.jsx("code",{children:"-medium"}),", ",e.jsx("code",{children:"-high"}),", and ",e.jsx("code",{children:"-xhigh"})," ","pin reasoning effort. Unsuffixed models use Thinking settings."]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(me,{label:"Default Model",description:"Used when no specific tier is requested",value:a,onChange:d=>h("ANTHROPIC_MODEL",d),catalog:t,allModels:c}),F.length>0&&m&&e.jsx(Ha,{models:F,provider:u,enabled:r??!1,onToggle:m}),e.jsx(me,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:n,onChange:d=>h("ANTHROPIC_DEFAULT_OPUS_MODEL",d),catalog:t,allModels:c}),e.jsx(me,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:i,onChange:d=>h("ANTHROPIC_DEFAULT_SONNET_MODEL",d),catalog:t,allModels:c}),e.jsx(me,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:o,onChange:d=>h("ANTHROPIC_DEFAULT_HAIKU_MODEL",d),catalog:t,allModels:c})]})]})]})}function Ba(t,s){return t?e.jsx(Ye,{children:e.jsxs(Ze,{children:[e.jsx(et,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(sa,{className:"w-3 h-3","aria-hidden":"true"}),e.jsx("span",{className:Q("font-mono max-w-[180px] truncate",s&&ot),title:t,children:t})]})}),e.jsx(tt,{side:"bottom",children:e.jsx("p",{className:"text-xs",children:"GCP Project ID (read-only)"})})]})}):e.jsx(Ye,{children:e.jsxs(Ze,{children:[e.jsx(et,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600 dark:text-amber-500",children:[e.jsx(Fe,{className:"w-3 h-3","aria-label":"Warning"}),e.jsx("span",{children:"Project ID: N/A"})]})}),e.jsx(tt,{side:"bottom",className:"max-w-[250px]",children:e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsx("p",{className:"font-medium text-amber-600",children:"Missing Project ID"}),e.jsx("p",{children:"This may cause errors. Remove the account and re-add it to fetch the project ID."})]})})]})})}function za({account:t,onSetDefault:s,onRemove:a,onPauseToggle:n,isRemoving:i,isPausingAccount:o,privacyMode:c,showQuota:u,selectable:r,selected:m,onSelectChange:v}){const h=t.provider.toLowerCase(),{data:N}=ws(u),{data:g,isLoading:f}=ks(h,t.id,u),F=Cs(N,t)?.lastUsedAt,y=r||n?e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r&&e.jsx("button",{type:"button",onClick:()=>v?.(!m),className:Q("flex items-center justify-center w-5 h-5 rounded border-2 transition-colors shrink-0",m?"bg-primary border-primary text-primary-foreground":"border-muted-foreground/30 hover:border-primary/50"),"aria-label":m?"Deselect account":"Select account",children:m&&e.jsx(ve,{className:"w-3 h-3"})}),n&&e.jsx(Ye,{children:e.jsxs(Ze,{children:[e.jsx(et,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:()=>n(!t.paused),disabled:o,children:o?e.jsx(ee,{className:"w-4 h-4 animate-spin"}):t.paused?e.jsx(Xt,{className:"w-4 h-4 text-emerald-500"}):e.jsx(Yt,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})}),e.jsx(tt,{side:"top",children:t.paused?"Resume account":"Pause account"})]})})]}):void 0,D=e.jsxs(As,{children:[e.jsx(Ss,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",children:e.jsx(ta,{className:"w-4 h-4"})})}),e.jsxs(Ps,{align:"end",children:[!t.isDefault&&e.jsxs(Ct,{onClick:s,children:[e.jsx(gt,{className:"w-4 h-4 mr-2"}),"Set as default"]}),e.jsxs(Ct,{className:"text-destructive focus:text-destructive",onClick:a,disabled:i,children:[e.jsx(Zt,{className:"w-4 h-4 mr-2"}),i?"Removing...":"Remove account"]})]})]});return e.jsx("div",{className:Q("rounded-lg border p-3 transition-colors overflow-hidden",t.isDefault?"border-primary/30 bg-primary/5":"border-border hover:bg-muted/30",t.paused&&"opacity-75",m&&"ring-2 ring-primary/50 bg-primary/5"),children:e.jsx(Ms,{mode:"detailed",provider:t.provider,accountId:t.id,email:t.email,displayEmail:t.email||t.id,tokenFile:t.tokenFile,tier:t.tier,isDefault:t.isDefault,paused:t.paused,privacyMode:c,showQuota:u,quota:g,quotaLoading:f,runtimeLastUsed:F,beforeIdentity:y,headerEnd:D,bodySlot:t.provider==="agy"?Ba(t.projectId,c):null,quotaInsetClassName:"pl-11"})})}function $a({selectedCount:t,onPauseSelected:s,onResumeSelected:a,onClearSelection:n,isPausing:i,isResuming:o}){if(t<1)return null;const c=i||o;return e.jsxs("div",{className:"flex items-center gap-3 p-2 bg-muted/50 rounded-lg border mt-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[t," selected"]}),e.jsx(_,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:n,disabled:c,children:"Clear"}),e.jsxs("div",{className:"flex gap-2 ml-auto",children:[e.jsxs(_,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:s,disabled:c,children:[i?e.jsx(ee,{className:"w-3 h-3 animate-spin"}):e.jsx(Yt,{className:"w-3 h-3"}),"Pause Selected"]}),e.jsxs(_,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:a,disabled:c,children:[o?e.jsx(ee,{className:"w-3 h-3 animate-spin"}):e.jsx(Xt,{className:"w-3 h-3"}),"Resume Selected"]})]})]})}function Qa({accounts:t,onAddAccount:s,onSetDefault:a,onRemoveAccount:n,onPauseToggle:i,onSoloMode:o,onBulkPause:c,onBulkResume:u,isRemovingAccount:r,isPausingAccount:m,isSoloingAccount:v,isBulkPausing:h,isBulkResuming:N,privacyMode:g,showQuota:f,isKiro:F,kiroNoIncognito:y,onKiroNoIncognitoChange:D,kiroSettingsLoading:S}){const[d,b]=l.useState(new Set),x=l.useMemo(()=>new Set(t.map(O=>O.id)),[t]),w=l.useMemo(()=>new Set([...d].filter(O=>x.has(O))),[d,x]),U=!!(c&&u),k=w.size,T=t.length>0&&w.size===t.length,q=w.size>0&&w.size<t.length,G=l.useCallback(O=>{b(A=>{const R=new Set(A);return R.has(O)?R.delete(O):R.add(O),R})},[]),C=l.useCallback(()=>{b(new Set(t.map(O=>O.id)))},[t]),I=l.useCallback(()=>{b(new Set)},[]),j=l.useCallback(()=>{T?I():C()},[T,C,I]),E=l.useCallback(()=>{c&&w.size>0&&(c(Array.from(w)),b(new Set))},[c,w]),M=l.useCallback(()=>{u&&w.size>0&&(u(Array.from(w)),b(new Set))},[u,w]);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[U&&t.length>0&&e.jsx(_e,{checked:T,onCheckedChange:j,"aria-label":"Select all accounts",className:q?"data-[state=checked]:bg-primary/50":"",...q?{"data-state":"indeterminate"}:{}}),e.jsx(ke,{className:"w-4 h-4"}),"Accounts",t.length>0&&e.jsx(B,{variant:"secondary",className:"text-xs",children:t.length})]}),e.jsxs(_,{variant:"default",size:"sm",className:"h-7 text-xs gap-1",onClick:s,children:[e.jsx(Wt,{className:"w-3 h-3"}),"Add"]})]}),U&&k>0&&e.jsx($a,{selectedCount:k,onPauseSelected:E,onResumeSelected:M,onClearSelection:I,isPausing:!!h,isResuming:!!N}),t.length>0?e.jsx("div",{className:"space-y-2",children:t.map(O=>e.jsx(za,{account:O,onSetDefault:()=>a(O.id),onRemove:()=>n(O.id),onPauseToggle:i?A=>i(O.id,A):void 0,onSoloMode:o?()=>o(O.id):void 0,isRemoving:r,isPausingAccount:m,isSoloingAccount:v,privacyMode:g,showQuota:f,selectable:U,selected:w.has(O.id),onSelectChange:()=>G(O.id)},O.id))}):e.jsxs("div",{className:"py-6 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed",children:[e.jsx(ke,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No accounts connected"}),e.jsx("p",{className:"text-xs opacity-70",children:"Add an account to get started"})]}),F&&D&&e.jsx("div",{className:"mt-3 pt-3 border-t border-dashed",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Jt,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Use incognito"})]}),e.jsx(Vt,{checked:!y,onCheckedChange:O=>D(!O),disabled:S,className:"scale-90"})]})})]})}function Ja({provider:t,catalog:s,savedPresets:a,currentModel:n,opusModel:i,sonnetModel:o,haikuModel:c,providerModels:u,extendedContextEnabled:r,onExtendedContextToggle:m,onApplyPreset:v,onUpdateEnvValue:h,onOpenCustomPreset:N,onDeletePreset:g,isDeletePending:f,accounts:F,onAddAccount:y,onSetDefault:D,onRemoveAccount:S,onPauseToggle:d,onSoloMode:b,onBulkPause:x,onBulkResume:w,isRemovingAccount:U,isPausingAccount:k,isSoloingAccount:T,isBulkPausing:q,isBulkResuming:G,privacyMode:C,isRemoteMode:I}){const j=t.toLowerCase(),E=(Ds.includes(j)||["anthropic","antigravity","gemini-cli","copilot","github-copilot"].includes(j))&&!I,M=t==="kiro",[O,A]=l.useState(!0),[R,V]=l.useState(!0),[z,W]=l.useState(!1),X=l.useCallback(async()=>{if(M)try{V(!0);const Z=(await Oe.config.get()).cliproxy;A(Z?.kiro_no_incognito??!0)}catch{A(!0)}finally{V(!1)}},[M]),oe=l.useCallback(async Y=>{A(Y),W(!0);try{const Z=await Oe.config.get(),p=Z.cliproxy??{};await Oe.config.update({...Z,cliproxy:{...p,kiro_no_incognito:Y}})}catch{A(!Y)}finally{W(!1)}},[]);return l.useEffect(()=>{X()},[X]),e.jsx(mt,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsx(Va,{catalog:s,savedPresets:a,currentModel:n,opusModel:i,sonnetModel:o,haikuModel:c,providerModels:u,provider:t,extendedContextEnabled:r,onExtendedContextToggle:m,onApplyPreset:v,onUpdateEnvValue:h,onOpenCustomPreset:N,onDeletePreset:g,isDeletePending:f}),e.jsx(vt,{}),e.jsx(Qa,{accounts:F,onAddAccount:y,onSetDefault:D,onRemoveAccount:S,onPauseToggle:d,onSoloMode:b,onBulkPause:x,onBulkResume:w,isRemovingAccount:U,isPausingAccount:k,isSoloingAccount:T,isBulkPausing:q,isBulkResuming:G,privacyMode:C,showQuota:E,isKiro:M,kiroNoIncognito:O,onKiroNoIncognitoChange:oe,kiroSettingsLoading:R||z})]})})}function It({provider:t,displayName:s,authStatus:a,catalog:n,logoProvider:i,baseProvider:o,isRemoteMode:c,port:u,defaultTarget:r,topNotice:m,onAddAccount:v,onSetDefault:h,onRemoveAccount:N,onPauseToggle:g,onSoloMode:f,onBulkPause:F,onBulkResume:y,isRemovingAccount:D,isPausingAccount:S,isSoloingAccount:d,isBulkPausing:b,isBulkResuming:x}){const[w,U]=l.useState(!1),{privacyMode:k}=Ut(),{data:T}=Ts(),{data:q}=Is(t),G=Rs(),C=Es(),I=o||t,j=I.toLowerCase()==="agy",E=l.useMemo(()=>{const L=q?.presets||[];return j?L.filter($=>!ie($.default)&&!ie($.opus)&&!ie($.sonnet)&&!ie($.haiku)):L},[j,q?.presets]),M=l.useMemo(()=>{if(!T?.models)return[];const $={gemini:["google"],agy:["antigravity"],codex:["openai"],qwen:["alibaba","qwen"],iflow:["iflow"],kiro:["kiro","aws"],ghcp:["github","copilot"],kimi:["kimi","moonshot"]}[I.toLowerCase()]||[I.toLowerCase()];return T.models.filter(ae=>$.some(ye=>ae.owned_by.toLowerCase().includes(ye))?j?!ie(ae.id):!0:!1)},[j,T,I]),O=(o||t).toLowerCase(),{data:A,isLoading:R,refetch:V,rawJsonContent:z,rawJsonEdits:W,isRawJsonValid:X,hasChanges:oe,currentModel:Y,opusModel:Z,sonnetModel:p,haikuModel:K,extendedContextEnabled:te,toggleExtendedContext:pe,handleRawJsonChange:Se,updateEnvValue:Ke,updateEnvValues:Pe,saveMutation:se,conflictDialog:qe,handleConflictResolve:be,missingRequiredFields:Me}=Ea(t,n),De=l.useMemo(()=>(a.accounts||[]).map(L=>({...L,provider:L.provider||o||t})),[a.accounts,o,t]),{data:Te}=Rt({queryKey:["auth-tokens-raw"],queryFn:async()=>{const L=await fetch("/api/settings/auth/tokens/raw");return L.ok?L.json():{apiKey:{value:"ccs-internal-managed"}}},staleTime:6e4}),xe=Te?.apiKey?.value??"ccs-internal-managed",Ne=L=>{if(j&&[L.ANTHROPIC_MODEL,L.ANTHROPIC_DEFAULT_OPUS_MODEL,L.ANTHROPIC_DEFAULT_SONNET_MODEL,L.ANTHROPIC_DEFAULT_HAIKU_MODEL].some(ae=>typeof ae=="string"&&ie(ae))){H.error("Antigravity denylist: Claude Opus 4.5 and Claude Sonnet 4.5 are deprecated.");return}Pe({ANTHROPIC_BASE_URL:`http://127.0.0.1:${u??st}/api/provider/${O}`,ANTHROPIC_AUTH_TOKEN:xe,...L}),H.success(`Applied "${L.ANTHROPIC_MODEL?.split("/").pop()||"preset"}" preset`)},Ie=(L,$)=>{if(j&&[L.default,L.opus,L.sonnet,L.haiku].some(ye=>ie(ye))){H.error("Antigravity denylist: Claude Opus 4.5 and Claude Sonnet 4.5 are deprecated.");return}Pe({ANTHROPIC_BASE_URL:`http://127.0.0.1:${u??st}/api/provider/${O}`,ANTHROPIC_AUTH_TOKEN:xe,ANTHROPIC_MODEL:L.default,ANTHROPIC_DEFAULT_OPUS_MODEL:L.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:L.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:L.haiku}),H.success(`Applied ${$?`"${$}"`:"custom"} preset`),U(!1)},He=(L,$)=>{if(!$){H.error(qt.t("commonToast.enterPresetName"));return}if(j&&[L.default,L.opus,L.sonnet,L.haiku].some(ae=>ie(ae))){H.error("Antigravity denylist: Claude Opus 4.5 and Claude Sonnet 4.5 are deprecated.");return}G.mutate({profile:t,data:{name:$,...L}}),U(!1)};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(qa,{provider:t,displayName:s,logoProvider:i,data:A,isLoading:R,hasChanges:oe,isRawJsonValid:X,isSaving:se.isPending,isRemoteMode:c,port:u,onRefetch:V,onSave:()=>se.mutate()}),m?e.jsx("div",{className:"border-b bg-muted/10 px-4 py-3",children:m}):null,R?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(ee,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):e.jsxs("div",{className:"min-h-0 flex-1 grid grid-cols-[40%_60%] divide-x overflow-hidden",children:[e.jsx("div",{className:"flex min-h-0 min-w-0 flex-col overflow-hidden bg-muted/5",children:e.jsxs(Os,{defaultValue:"config",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(Ls,{className:"w-full",children:[e.jsx(At,{value:"config",className:"flex-1",children:"Model Config"}),e.jsx(At,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsx(St,{value:"config",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx(Ja,{provider:t,catalog:n,savedPresets:E,currentModel:Y,opusModel:Z,sonnetModel:p,haikuModel:K,providerModels:M,extendedContextEnabled:te,onExtendedContextToggle:pe,onApplyPreset:Ne,onUpdateEnvValue:Ke,onOpenCustomPreset:()=>U(!0),onDeletePreset:L=>C.mutate({profile:t,name:L}),isDeletePending:C.isPending,accounts:De,onAddAccount:v,onSetDefault:h,onRemoveAccount:N,onPauseToggle:g,onSoloMode:f,onBulkPause:F,onBulkResume:y,isRemovingAccount:D,isPausingAccount:S,isSoloingAccount:d,isBulkPausing:b,isBulkResuming:x,privacyMode:k,isRemoteMode:c})}),e.jsx(St,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(Ka,{provider:t,displayName:s,defaultTarget:r,data:A,authStatus:a,supportsModelConfig:!!n})})]})]})}),e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-2 bg-muted/30 border-b flex items-center gap-2 shrink-0 h-[45px]",children:[e.jsx(aa,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Raw Configuration (JSON)"})]}),e.jsx(_s,{rawJsonContent:z,isRawJsonValid:X,rawJsonEdits:W,onRawJsonChange:Se,profileEnv:A?.settings?.env,missingRequiredFields:Me})]})]}),e.jsx(ra,{open:qe,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>be(!0),onCancel:()=>be(!1)}),e.jsx(Ua,{open:w,onClose:()=>U(!1),currentValues:{default:Y||"",opus:Z||"",sonnet:p||"",haiku:K||""},onApply:Ie,onSave:He,isSaving:G.isPending,catalog:n,allModels:M})]})}function Wa({status:t,isSelected:s,onSelect:a}){const{t:n}=re(),i=t.accounts?.length||0;return e.jsxs("button",{className:Q("w-full flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors cursor-pointer text-left",s?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:a,children:[e.jsx(pt,{provider:t.provider,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:t.displayName}),i>0&&e.jsx(B,{variant:"secondary",className:"text-[10px] h-4 px-1",children:i})]}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:t.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(ve,{className:"w-3 h-3 text-green-600"}),e.jsx("span",{className:"text-xs text-green-600",children:n("cliproxyPage.connected")})]}):e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n("cliproxyPage.notConnected")})]})})]})]})}function Xa({variant:t,parentAuth:s,isSelected:a,onSelect:n,onDelete:i,isDeleting:o}){const{t:c}=re(),u=()=>{n()};return e.jsxs("div",{role:"button",tabIndex:0,className:Q("group w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors cursor-pointer text-left pl-6",a?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:u,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),u())},children:[e.jsxs("div",{className:"relative",children:[e.jsx(pt,{provider:t.provider,size:"sm"}),e.jsx(es,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-muted-foreground"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:t.name}),e.jsx(B,{variant:"outline",className:"text-[9px] h-4 px-1",children:c("cliproxyPage.variant")}),e.jsx(B,{variant:"outline",className:"text-[9px] h-4 px-1 uppercase",children:t.target||"claude"})]}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:s?.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(ve,{className:"w-3 h-3 text-green-600"}),e.jsx("span",{className:"text-xs text-muted-foreground truncate",children:c("cliproxyPage.viaProvider",{provider:t.provider})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ft,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:c("cliproxyPage.parentNotConnected")})]})})]}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:r=>{r.stopPropagation(),i()},disabled:o,children:e.jsx(Zt,{className:"w-3 h-3"})})]})}function Ya({onSetup:t}){const{t:s}=re();return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20",children:e.jsxs("div",{className:"text-center max-w-md px-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mx-auto mb-6",children:e.jsx(Ae,{className:"w-8 h-8 text-muted-foreground"})}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:s("cliproxyPage.emptyTitle")}),e.jsx("p",{className:"text-muted-foreground mb-4",children:s("cliproxyPage.emptyDesc")}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-6",children:[s("cliproxyPage.emptyControlPanelPrefix")," ",e.jsx("a",{href:"/cliproxy/control-panel",className:"text-primary hover:underline",children:s("cliproxyPage.controlPanel")}),"."]}),e.jsxs(_,{onClick:t,className:"gap-2",children:[e.jsx(Ce,{className:"w-4 h-4"}),s("cliproxyPage.quickSetup")]})]})})}function fn(){const{t}=re(),s=rt(),{data:a,isLoading:n}=_t(),{data:i,isFetching:o}=Fs(),{data:c}=Ft(),{data:u}=Us(),r=Ks(),m=qs(),v=Hs(),h=Gs(),N=Vs(),g=Bs(),f=zs(),F=$s(),[y,D]=l.useState(()=>{if(typeof window<"u"){const K=new URLSearchParams(window.location.search).get("provider")?.trim().toLowerCase();return K&&Xe(K)?K:localStorage.getItem("cliproxy-selected-provider")}return null}),[S,d]=l.useState(null),[b,x]=l.useState(!1),[w,U]=l.useState(()=>{if(typeof window>"u")return null;const p=new URLSearchParams(window.location.search),K=p.get("provider")?.trim().toLowerCase();return p.get("action")!=="auth"||!K||!Xe(K)?null:{provider:K,displayName:Qs(K),isFirstAccount:!1}}),k=l.useMemo(()=>a?.authStatus||[],[a?.authStatus]),T=a?.source==="remote",q=l.useMemo(()=>i?.variants||[],[i?.variants]),G=l.useMemo(()=>jt(c?.catalogs),[c?.catalogs]),C=!!c,I=p=>{D(p),p&&localStorage.setItem("cliproxy-selected-provider",p)},j=l.useMemo(()=>S?null:y&&k.some(p=>p.provider===y)?y:k.length>0&&(k.find(K=>(K.accounts?.length||0)>0)?.provider||k[0]?.provider)||null,[y,S,k]),E=k.find(p=>p.provider===j),M=q.find(p=>p.name===S),O=M?k.find(p=>p.provider===M.provider):void 0,A=(M?.provider||E?.provider||"").toLowerCase().trim(),R=A==="gemini"||A==="agy",V=()=>{s.invalidateQueries({queryKey:["cliproxy"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]}),s.invalidateQueries({queryKey:["cliproxy-catalog"]})},z=(p,K,te)=>{v.isPending||h.isPending||(te?v.mutate({provider:p,accountId:K}):h.mutate({provider:p,accountId:K}))},W=(p,K)=>{N.isPending||N.mutate({provider:p,accountId:K})},X=(p,K)=>{g.isPending||g.mutate({provider:p,accountIds:K})},oe=(p,K)=>{f.isPending||f.mutate({provider:p,accountIds:K})},Y=p=>{I(p),d(null)},Z=p=>{d(p),I(null)};return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ae,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:u?.backendLabel??"CLIProxy"})]}),e.jsx(_,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:V,disabled:o,children:e.jsx(ht,{className:Q("w-4 h-4",o&&"animate-spin")})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:t("cliproxyPage.accountManagement")}),e.jsxs(_,{variant:"default",size:"sm",className:"w-full gap-2",onClick:()=>x(!0),children:[e.jsx(Ce,{className:"w-4 h-4"}),t("cliproxyPage.quickSetup")]})]}),e.jsx(mt,{className:"flex-1",children:e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3 py-2",children:t("cliproxyPage.providers")}),n?e.jsx("div",{className:"space-y-2 px-2",children:[1,2,3,4].map(p=>e.jsx(Js,{className:"h-14 w-full rounded-lg"},p))}):e.jsx("div",{className:"space-y-1",children:k.map(p=>e.jsx(Wa,{status:p,isSelected:j===p.provider,onSelect:()=>Y(p.provider)},p.provider))}),q.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3 py-2 mt-4 flex items-center gap-1.5",children:[e.jsx(es,{className:"w-3 h-3"}),t("cliproxyPage.variants")]}),e.jsx("div",{className:"space-y-1",children:q.map(p=>e.jsx(Xa,{variant:p,parentAuth:k.find(K=>K.provider===p.provider),isSelected:S===p.name,onSelect:()=>Z(p.name),onDelete:()=>F.mutate(p.name),isDeleting:F.isPending},p.name))})]})]})}),e.jsx("div",{className:"p-3 border-t",children:e.jsx(la,{})}),e.jsx("div",{className:"p-3 border-t bg-background text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:t("cliproxyPage.providerCount",{count:k.length})}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ve,{className:"w-3 h-3 text-green-600"}),t("cliproxyPage.connectedCount",{count:k.filter(p=>p.authenticated).length})]})]})})]}),e.jsx("div",{className:"flex-1 flex min-w-0 flex-col overflow-hidden bg-background",children:M&&O?e.jsx(e.Fragment,{children:e.jsx(It,{provider:M.name,displayName:t("cliproxyPage.variantDisplay",{name:M.name,provider:M.provider}),authStatus:O,catalog:G[M.provider],logoProvider:M.provider,baseProvider:M.provider,defaultTarget:M.target,isRemoteMode:T,port:M.port,topNotice:R?e.jsx(it,{compact:!0,showProxySettingsLink:!0}):void 0,onAddAccount:()=>U({provider:M.provider,displayName:O.displayName,isFirstAccount:(O.accounts?.length||0)===0}),onSetDefault:p=>r.mutate({provider:M.provider,accountId:p}),onRemoveAccount:p=>m.mutate({provider:M.provider,accountId:p}),onPauseToggle:(p,K)=>z(M.provider,p,K),onSoloMode:p=>W(M.provider,p),onBulkPause:p=>X(M.provider,p),onBulkResume:p=>oe(M.provider,p),isRemovingAccount:m.isPending,isPausingAccount:v.isPending||h.isPending,isSoloingAccount:N.isPending,isBulkPausing:g.isPending,isBulkResuming:f.isPending})}):E?e.jsx(e.Fragment,{children:e.jsx(It,{provider:E.provider,displayName:E.displayName,authStatus:E,catalog:G[E.provider],isRemoteMode:T,topNotice:R?e.jsx(it,{compact:!0,showProxySettingsLink:!0}):void 0,onAddAccount:()=>U({provider:E.provider,displayName:E.displayName,isFirstAccount:(E.accounts?.length||0)===0}),onSetDefault:p=>r.mutate({provider:E.provider,accountId:p}),onRemoveAccount:p=>m.mutate({provider:E.provider,accountId:p}),onPauseToggle:(p,K)=>z(E.provider,p,K),onSoloMode:p=>W(E.provider,p),onBulkPause:p=>X(E.provider,p),onBulkResume:p=>oe(E.provider,p),isRemovingAccount:m.isPending,isPausingAccount:v.isPending||h.isPending,isSoloingAccount:N.isPending,isBulkPausing:g.isPending,isBulkResuming:f.isPending})}):e.jsx(Ya,{onSetup:()=>x(!0)})}),e.jsx(ka,{open:b,onClose:()=>x(!1)}),e.jsx(Ta,{open:w!==null,onClose:()=>U(null),provider:w?.provider||"",displayName:w?.displayName||"",catalog:C&&w?.provider?G[w.provider]:void 0,isFirstAccount:w?.isFirstAccount||!1})]})}export{fn as CliproxyPage};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as m,u as qe,h as Ke}from"./react-vendor-CNOkPC89.js";import{c as $,aD as me,b4 as ue,B as h,ag as $e,ah as He,ai as Be,aj as De,ak as Fe,L as A,I as k,M as Ge,N as Ve,O as Je,aC as ze,d as f,Y as ae,S as fe,n as ee,Q as ve,R as ye,U as W,V as X,b5 as be,b6 as _e}from"./index-CUOLpSIB.js";import{P as Qe}from"./proxy-status-widget-BVdcjMn7.js";import{C as We}from"./confirm-dialog-DJpEIfS_.js";import{l as Xe,w as Pe,m as Ae,n as pe,aw as se,s as Ye,R as le,Z as Ze,a8 as Se,p as Ie,aH as es,O as ss,ar as ts,as as rs,Y as je,aI as Ue,aJ as Le,ag as Me,av as as,aK as ns}from"./icons-C4EMu2PL.js";import{u as is,a as xe,b as he}from"./tanstack-CrmUhA7Z.js";import{t as G}from"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";import"./alert-dialog-SgZxEXpw.js";function ls(t){switch(t){case"ready":return{icon:Ae,text:"Ready",className:"text-green-600"};case"partial":return{icon:Pe,text:"Needs attention",className:"text-amber-600"};default:return{icon:Xe,text:"Not configured",className:"text-muted-foreground"}}}function os({families:t,selectedFamily:s,onSelect:r}){return e.jsx("div",{className:"space-y-1",children:t.map(a=>{const i=a.id===s,o=ls(a.status),d=o.icon;return e.jsx("button",{type:"button",onClick:()=>r(a.id),className:$("w-full cursor-pointer rounded-lg border px-3 py-2.5 text-left transition-colors",i?"border-primary/20 bg-primary/10":"border-transparent hover:bg-muted/70"),children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(me,{provider:ue(a.id),size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:a.displayName}),a.entries.length>0&&e.jsx(h,{variant:"secondary",className:"h-4 px-1 text-[10px]",children:a.entries.length})]}),e.jsxs("div",{className:$("mt-0.5 flex items-center gap-1.5 text-xs",o.className),children:[e.jsx(d,{className:"h-3 w-3"}),e.jsx("span",{children:o.text})]})]}),e.jsx(h,{variant:"outline",className:"h-5 px-1.5 text-[9px] uppercase tracking-wide",children:a.authMode})]})},a.id)})})}function ds(t){switch(t){case"gemini-api-key":return{familyName:"Gemini",description:"Store the Gemini key here so CLIProxy can route Gemini requests without creating a separate CCS API Profile.",requiredNow:["Paste the Gemini API key.","Leave Base URL empty unless you use a custom Gemini host."],optionalLater:["Model mappings only when requested names and Gemini names differ.","Headers only when your provider setup requires them."],keyLabel:"Gemini API Key",keyPlaceholder:"AIza...",keyHelper:"This is the only field most Gemini setups need.",baseUrlPlaceholder:"https://generativelanguage.googleapis.com",baseUrlHelper:"Optional. Leave blank to keep the default Gemini endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=gemini-2.5-pro",aliasesHelper:"Format: requested=upstream. Leave this blank unless the upstream Gemini model name differs.",headersPlaceholder:"X-Goog-User-Project: your-project"};case"codex-api-key":return{familyName:"Codex",description:"Store the Codex or OpenAI key here so CLIProxy can route Codex requests without duplicating the setup in API Profiles.",requiredNow:["Paste the Codex or OpenAI API key.","Leave Base URL empty unless this route should target another OpenAI-style endpoint."],optionalLater:["Model mappings only when the upstream model ID differs.","Headers only when org or project routing needs them."],keyLabel:"Codex API Key",keyPlaceholder:"sk-...",keyHelper:"This is the only field most Codex setups need.",baseUrlPlaceholder:"https://api.openai.com/v1",baseUrlHelper:"Optional. Leave blank to keep the default Codex endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=gpt-5",aliasesHelper:"Format: requested=upstream. Add a mapping only when the upstream model name differs.",headersPlaceholder:"OpenAI-Organization: org_..."};case"claude-api-key":return{familyName:"Claude",description:"Store the Anthropic or compatible key here for CLIProxy-managed Claude routing. Save the key first, then add rewrites only if this route needs them.",requiredNow:["Paste the Claude or Anthropic-compatible API key.","Leave Base URL empty unless this route should target another compatible endpoint."],optionalLater:["Model mappings only when the requested and upstream Claude model IDs differ.","Proxy, prefix, exclusions, and headers only for advanced routing cases."],keyLabel:"Claude API Key",keyPlaceholder:"sk-ant-...",keyHelper:"Most Claude routes can start with the key only.",baseUrlPlaceholder:"https://api.anthropic.com",baseUrlHelper:"Optional. Leave blank to keep the default Claude-compatible endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=claude-3-7-sonnet-latest",aliasesHelper:"Format: requested=upstream. Add a mapping only when the upstream model ID should differ.",headersPlaceholder:"X-Project: internal-routing"};case"vertex-api-key":return{familyName:"Vertex",description:"Store the Vertex key here so CLIProxy can route Vertex traffic without creating a separate CCS API Profile.",requiredNow:["Paste the Vertex API key.","Leave Base URL empty unless a regional or gateway endpoint is required."],optionalLater:["Model mappings only when the upstream name differs.","Headers only when the provider expects extra routing context."],keyLabel:"Vertex API Key",keyPlaceholder:"AIza...",keyHelper:"Most Vertex routes only need the key.",baseUrlPlaceholder:"https://vertex.googleapis.com",baseUrlHelper:"Optional. Leave blank to keep the default Vertex endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=gemini-2.5-pro",aliasesHelper:"Format: requested=upstream. Leave blank unless the upstream model name differs.",headersPlaceholder:"X-Goog-User-Project: your-project"};case"openai-compatibility":return{familyName:"OpenAI-Compatible Connector",description:"Create a named connector for OpenRouter, Together, or any OpenAI-style endpoint. This page owns the connector setup directly inside CLIProxy.",requiredNow:["Pick a connector name such as openrouter or together.","Set the connector Base URL.","Add at least one API key before saving."],optionalLater:["Model mappings only when requested and upstream model names differ.","Headers only when the connector requires provider-specific auth or routing."],keyLabel:"API Keys",keyPlaceholder:"sk-...",keyHelper:"Add one key per line. Most connectors start with a single key.",connectorPlaceholder:"openrouter",connectorHelper:"This becomes the connector label in the saved entries list.",baseUrlPlaceholder:"https://openrouter.ai/api/v1",baseUrlHelper:"Required for connectors. This is the upstream OpenAI-style endpoint.",aliasesPlaceholder:"claude-sonnet-4-5=gpt-4.1",aliasesHelper:"Format: requested=upstream. Leave blank unless the connector expects a different model ID.",headersPlaceholder:"HTTP-Referer: https://your-app.example"}}}function Ne(t){return t.split(`
|
|
2
|
-
`).map(s=>s.trim()).filter(s=>s.length>0)}function cs(t){return t.split(`
|
|
3
|
-
`).map(s=>s.trim()).filter(s=>s.length>0).map(s=>{const r=s.includes(":")?":":"=",[a,...i]=s.split(r);return{key:a.trim(),value:i.join(r).trim()}}).filter(s=>s.key.length>0)}function ms(t){return t.split(`
|
|
4
|
-
`).map(s=>s.trim()).filter(s=>s.length>0).map(s=>{const r=s.indexOf("=");return r===-1?{name:s.trim(),alias:""}:{name:s.slice(0,r).trim(),alias:s.slice(r+1).trim()}}).filter(s=>s.name.length>0||s.alias.length>0)}function Y({value:t,onChange:s,placeholder:r,rows:a=4}){return e.jsx("textarea",{rows:a,value:t,onChange:i=>s(i.target.value),placeholder:r,className:"flex min-h-24 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"})}function us(t){return(t?.headers||[]).map(s=>`${s.key}: ${s.value}`).join(`
|
|
5
|
-
`)}function ps(t){return(t?.excludedModels||[]).join(`
|
|
6
|
-
`)}function xs(t){return(t?.models||[]).map(s=>s.alias.trim()?`${s.name}=${s.alias}`:s.name).join(`
|
|
7
|
-
`)}function we({title:t,items:s,icon:r}){return e.jsxs("div",{className:"rounded-xl border bg-background/80 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[r,t]}),e.jsx("div",{className:"mt-3 space-y-3",children:s.map((a,i)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border bg-muted/40 text-[11px] font-semibold text-muted-foreground",children:i+1}),e.jsx("div",{className:"text-sm leading-6 text-muted-foreground",children:a})]},`${t}:${a}`))})]})}function hs({family:t,entry:s,open:r,onOpenChange:a,onSubmit:i,isSaving:o}){const d=m.useMemo(()=>ds(t),[t]),l=!!s,c=t==="openai-compatibility",v=t==="claude-api-key",[S,E]=m.useState(()=>s?.name||""),[b,T]=m.useState(()=>s?.baseUrl||""),[j,O]=m.useState(()=>s?.proxyUrl||""),[I,z]=m.useState(()=>s?.prefix||""),[N,U]=m.useState(""),[y,p]=m.useState(""),[L,w]=m.useState(()=>us(s)),[q,H]=m.useState(()=>ps(s)),[B,g]=m.useState(()=>xs(s)),[R,P]=m.useState(()=>!!(s?.headers.length||s?.excludedModels.length||s?.proxyUrl||s?.prefix)),D=m.useMemo(()=>!l||!s?.secretConfigured?null:c?"Leave API keys blank to keep the stored connector secrets.":"Leave the API key blank to keep the stored secret.",[s?.secretConfigured,l,c]),F=async()=>{const n=N.trim(),K=Ne(y),C=l&&s?.secretConfigured&&!n.length&&K.length===0,ie={name:c?S:void 0,baseUrl:b,proxyUrl:v?j:void 0,prefix:v?I:void 0,headers:cs(L),excludedModels:v?Ne(q):void 0,models:ms(B),preserveSecrets:C,...c?K.length>0?{apiKeys:K}:{}:n.length>0?{apiKey:n}:{}};await i(ie)};return e.jsx($e,{open:r,onOpenChange:a,children:e.jsx(He,{className:"overflow-hidden p-0 sm:max-w-3xl",children:e.jsxs("div",{className:"max-h-[85vh] overflow-y-auto",children:[e.jsx("div",{className:"border-b bg-muted/20 px-6 py-5",children:e.jsxs(Be,{className:"gap-4 text-left",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl border bg-background",children:e.jsx(me,{provider:ue(t),size:"md"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(De,{children:l?`Edit ${d.familyName}`:`Set up ${d.familyName}`}),e.jsx(h,{variant:"outline",className:"uppercase text-[11px]",children:c?"connector":"api-key"})]}),e.jsx(Fe,{className:"mt-1 max-w-2xl leading-6",children:d.description})]})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(we,{title:"Required now",items:d.requiredNow,icon:e.jsx(pe,{className:"h-4 w-4 text-primary"})}),e.jsx(we,{title:"Optional later",items:d.optionalLater,icon:e.jsx(se,{className:"h-4 w-4 text-primary"})})]}),D?e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-800",children:D}):null]})}),e.jsxs("div",{className:"space-y-6 px-6 py-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold",children:"Required setup"}),e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"Save the smallest working configuration first."})]}),c?e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{htmlFor:"connector-name",children:"Connector Name"}),e.jsx(k,{id:"connector-name",value:S,onChange:n=>E(n.target.value),placeholder:d.connectorPlaceholder}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d.connectorHelper})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{htmlFor:"base-url",children:"Base URL"}),e.jsx(k,{id:"base-url",value:b,onChange:n=>T(n.target.value),placeholder:d.baseUrlPlaceholder}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d.baseUrlHelper})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{children:"API Keys"}),e.jsx(Y,{value:y,onChange:p,rows:4,placeholder:`${d.keyPlaceholder}
|
|
8
|
-
${d.keyPlaceholder}`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d.keyHelper})]})]}):e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{htmlFor:"api-key",children:d.keyLabel}),e.jsx(k,{id:"api-key",type:"password",value:N,onChange:n=>U(n.target.value),placeholder:d.keyPlaceholder}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d.keyHelper})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold",children:"Optional routing"}),e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"Only fill these when the route needs more than the default behavior."})]}),c?null:e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{htmlFor:"base-url",children:"Base URL"}),e.jsx(k,{id:"base-url",value:b,onChange:n=>T(n.target.value),placeholder:d.baseUrlPlaceholder}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d.baseUrlHelper})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{children:"Model Mappings"}),e.jsx(Y,{value:B,onChange:g,rows:4,placeholder:d.aliasesPlaceholder}),e.jsx("p",{className:"text-xs text-muted-foreground",children:d.aliasesHelper})]})]}),e.jsx(Ge,{open:R,onOpenChange:P,children:e.jsxs("div",{className:"rounded-xl border",children:[e.jsx(Ve,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-4 px-4 py-4 text-left",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(se,{className:"h-4 w-4 text-primary"}),"Advanced routing"]}),e.jsxs("div",{className:"mt-1 text-sm text-muted-foreground",children:["Headers",v?", proxy, prefix, and exclusions.":" and provider-specific overrides."]})]}),e.jsx(Ye,{className:$("h-4 w-4 text-muted-foreground transition-transform",R&&"rotate-180")})]})}),e.jsx(Je,{className:"border-t px-4 py-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{children:"Headers"}),e.jsx(Y,{value:L,onChange:w,rows:3,placeholder:d.headersPlaceholder}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use headers only when the provider requires extra routing or auth context."})]}),v?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{htmlFor:"prefix",children:"Prefix"}),e.jsx(k,{id:"prefix",value:I,onChange:n=>z(n.target.value),placeholder:"glm-"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Prepends model names before routing."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{htmlFor:"proxy-url",children:"Proxy URL"}),e.jsx(k,{id:"proxy-url",value:j,onChange:n=>O(n.target.value),placeholder:"http://127.0.0.1:8080"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Sends requests through an intermediate proxy."})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(A,{children:"Excluded Models"}),e.jsx(Y,{value:q,onChange:H,rows:3,placeholder:"claude-opus-4-1\\nclaude-sonnet-4-5"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. One model ID per line when this route should reject specific upstream models."})]})]}):null]})})]})})]}),e.jsxs(ze,{className:"border-t bg-muted/10 px-6 py-4",children:[e.jsx(f,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e.jsx(f,{type:"button",onClick:()=>void F(),disabled:o,children:o?"Saving...":c?l?"Save Connector":"Create Connector":"Save Entry"})]})]})})})}const ne=["cliproxy-ai-providers"];function gs(){return is({queryKey:ne,queryFn:()=>ae.cliproxy.aiProviders.list()})}function fs(){const t=xe();return he({mutationFn:({family:s,data:r})=>ae.cliproxy.aiProviders.create(s,r),onSuccess:()=>{t.invalidateQueries({queryKey:ne}),G.success("Provider entry created")},onError:s=>{G.error(s.message)}})}function vs(){const t=xe();return he({mutationFn:({family:s,entryId:r,data:a})=>ae.cliproxy.aiProviders.update(s,r,a),onSuccess:()=>{t.invalidateQueries({queryKey:ne}),G.success("Provider entry updated")},onError:s=>{G.error(s.message)}})}function ys(){const t=xe();return he({mutationFn:({family:s,entryId:r})=>ae.cliproxy.aiProviders.delete(s,r),onSuccess:()=>{t.invalidateQueries({queryKey:ne}),G.success("Provider entry removed")},onError:s=>{G.error(s.message)}})}function _({label:t,value:s,hint:r}){return e.jsxs("div",{className:"rounded-lg border bg-background p-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("div",{className:"mt-1 break-all text-sm font-medium leading-5",children:s}),r?e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:r}):null]})}function bs(t){switch(t){case"ready":return{label:"Ready",className:"bg-emerald-50 text-emerald-700 hover:bg-emerald-50"};case"partial":return{label:"Needs attention",className:"bg-amber-50 text-amber-700 hover:bg-amber-50"};default:return{label:"Empty",className:"bg-muted text-muted-foreground hover:bg-muted"}}}function de(t){return t.proxyUrl?"Proxy override":t.prefix?"Prefixed route":t.baseUrl?"Direct upstream":"Default runtime"}function Te(t){return t.filter(s=>s.alias.trim().length>0).length}function Re(t){return t.filter(s=>s.name.trim().length>0&&s.alias.trim().length===0).length}function te(t){const s=Te(t),r=Re(t),a=[];return s>0&&a.push(`${s} mapped`),r>0&&a.push(`${r} direct`),a.length>0?a.join(" + "):"No model rules"}function ce({configured:t}){return e.jsx(h,{variant:"secondary",className:$("border-transparent text-[10px]",t?"bg-emerald-50 text-emerald-700 hover:bg-emerald-50":"bg-muted text-muted-foreground hover:bg-muted"),children:t?"Configured":"Missing secret"})}const V="<stored in CLIProxy>";function Ee(t){switch(t.id){case"gemini-api-key":return{requiredNow:["Save the Gemini API key.","Leave Base URL blank unless you use a custom Gemini gateway.","Add model mappings only when Gemini model names differ from the requested ones."],optionalLater:["Headers for provider-specific project routing.","Base URL override for a proxy or regional endpoint.","Mappings such as claude-sonnet-4-5 -> gemini-2.5-pro."],emptyStateSummary:[`Requests to ${t.routePath} use CLIProxy-managed Gemini credentials.`,"The default upstream is enough for most Gemini setups.","Model mappings and headers are optional, not step one."],profileBoundary:"Use API Profiles when you want a CCS-native Anthropic-compatible profile instead of this CLIProxy-managed Gemini route.",editPrompts:[{label:"Base URL",hint:"Change it only for a custom Gemini gateway or regional endpoint."},{label:"Model mappings",hint:"Add them only when requested names and Gemini names differ."},{label:"Headers",hint:"Keep them empty unless the provider requires project or org routing."}]};case"codex-api-key":return{requiredNow:["Save the Codex or OpenAI API key.","Leave Base URL blank unless this route should hit a different OpenAI-style host.","Add mappings only when the upstream model name differs from what CCS requests."],optionalLater:["Base URL override for a gateway, proxy, or self-hosted endpoint.","Headers for org or project routing.","Mappings such as claude-sonnet-4-5 -> gpt-5."],emptyStateSummary:[`Requests to ${t.routePath} use CLIProxy-managed Codex credentials.`,"Most setups can keep the default upstream and skip extra routing.","Mappings are only needed when the upstream model naming does not match the requested one."],profileBoundary:"Use API Profiles when you want a CCS-native Anthropic-compatible profile rather than this CLIProxy-managed Codex route.",editPrompts:[{label:"Base URL",hint:"Change it only when Codex should resolve through another OpenAI-style endpoint."},{label:"Model mappings",hint:"Map requested model names to the exact upstream model ID only when needed."},{label:"Headers",hint:"Use headers sparingly for project routing or extra auth."}]};case"claude-api-key":return{requiredNow:["Save the Anthropic or compatible API key.","Leave Base URL blank unless this route should point at a custom Claude-compatible endpoint.","Add mappings only when the upstream model ID differs from the requested Claude model name."],optionalLater:["Prefix or proxy overrides for advanced route rewriting.","Excluded models when a route should block specific model IDs.","Headers for project-scoped routing."],emptyStateSummary:[`Requests to ${t.routePath} use a CLIProxy-managed Claude-compatible key.`,"Base URL, proxy, and prefix rewrites are advanced options, not the minimum setup.","Most users can start with a key only, then add mappings or filters if routing needs it."],profileBoundary:"Use API Profiles when you want a CCS-native Anthropic-compatible profile or preset instead of this CLIProxy-managed Claude route.",editPrompts:[{label:"Base URL",hint:"Change it only when Claude traffic should target another compatible endpoint."},{label:"Mappings",hint:"Add them only when the requested Claude model name should route to a different upstream ID."},{label:"Advanced routing",hint:"Proxy, prefix, headers, and exclusions are for edge cases. Leave them blank when unsure."}]};case"vertex-api-key":return{requiredNow:["Save the Vertex API key.","Leave Base URL blank unless a regional or gateway endpoint is required.","Add mappings only when the upstream model name differs from the requested name."],optionalLater:["Base URL override for a regional gateway.","Headers for provider-specific routing.","Mappings for translating requested names to Vertex model IDs."],emptyStateSummary:[`Requests to ${t.routePath} use CLIProxy-managed Vertex credentials.`,"Most setups start with the key only and keep the default endpoint.","Mappings and headers are optional follow-up steps."],profileBoundary:"Use API Profiles when you need a CCS-native Anthropic-compatible profile rather than this CLIProxy-managed Vertex route.",editPrompts:[{label:"Base URL",hint:"Use it only for a regional gateway or managed Vertex endpoint."},{label:"Model mappings",hint:"Add them only when the requested names need translating upstream."},{label:"Headers",hint:"Keep them empty unless the provider requires extra routing context."}]};case"openai-compatibility":return{requiredNow:["Name the connector, for example openrouter or together.","Set the connector Base URL.","Add at least one API key before saving."],optionalLater:["Headers for provider-specific auth or project routing.","Model mappings such as claude-sonnet-4-5 -> gpt-4.1.","Additional API keys for the same connector."],emptyStateSummary:[`Requests to ${t.routePath} resolve through a named OpenAI-compatible connector.`,"This flow needs a connector name, a Base URL, and one or more API keys.","Headers and mappings come after the connector is already working."],profileBoundary:"Use API Profiles when you want a CCS-native Anthropic-compatible profile, preset, or provider outside the CLIProxy connector flow.",editPrompts:[{label:"Connector identity",hint:"Keep the connector name and Base URL stable once clients depend on it."},{label:"Model mappings",hint:"Only add them when the connector expects a different upstream model ID."},{label:"Headers",hint:"Use them for provider-specific auth or project routing, not as a default."}]}}}function J(t){return t.split(`
|
|
9
|
-
`).map(s=>s.trim()).filter(s=>s.length>0)}function re(t){return t.split(`
|
|
10
|
-
`).map(s=>s.trim()).filter(s=>s.length>0).map(s=>{const r=s.includes(":")?":":"=",[a,...i]=s.split(r);return{key:a.trim(),value:i.join(r).trim()}}).filter(s=>s.key.length>0)}function Q(t){return t.split(`
|
|
11
|
-
`).map(s=>s.trim()).filter(s=>s.length>0).map(s=>{const r=s.indexOf("=");return r===-1?{name:s.trim(),alias:""}:{name:s.slice(0,r).trim(),alias:s.slice(r+1).trim()}}).filter(s=>s.name.length>0||s.alias.length>0)}function js(t){return(t?.headers||[]).map(s=>`${s.key}: ${s.value}`).join(`
|
|
12
|
-
`)}function Ns(t){return(t?.excludedModels||[]).join(`
|
|
13
|
-
`)}function ws(t){return(t?.models||[]).map(s=>s.alias.trim()?`${s.name}=${s.alias}`:s.name).join(`
|
|
14
|
-
`)}function oe(t){return{name:t.name||"",baseUrl:t.baseUrl||"",proxyUrl:t.proxyUrl||"",prefix:t.prefix||"",headersText:js(t),excludedModelsText:Ns(t),modelAliasesText:ws(t),apiKey:"",apiKeysText:""}}function Cs(t){const s=re(t);if(s.length!==0)return Object.fromEntries(s.map(r=>[r.key,r.value]))}function ks(t){const s=Q(t).map(r=>r.alias.trim()?{name:r.name,alias:r.alias}:{name:r.name});return s.length>0?s:void 0}function Ps(t){const s=J(t);return s.length>0?s:void 0}function Ce(t,s,r){const a=Cs(r.headersText),i=ks(r.modelAliasesText),o=Ps(r.excludedModelsText),d=r.apiKey.trim()||(s.secretConfigured?V:"");if(t.id==="openai-compatibility"){const l=J(r.apiKeysText),c=s.apiKeysMasked?.length||1;return{name:r.name.trim()||s.name||"connector","base-url":r.baseUrl.trim(),...a?{headers:a}:{},"api-key-entries":l.length>0?l.map(v=>({"api-key":v})):s.secretConfigured?Array.from({length:c},()=>({"api-key":V})):[],...i?{models:i}:{}}}return{"api-key":d,...r.baseUrl.trim()?{"base-url":r.baseUrl.trim()}:{},...r.proxyUrl.trim()?{"proxy-url":r.proxyUrl.trim()}:{},...r.prefix.trim()?{prefix:r.prefix.trim()}:{},...a?{headers:a}:{},...o?{"excluded-models":o}:{},...i?{models:i}:{}}}function As(t,s,r){const a=JSON.parse(r);if(!a||typeof a!="object"||Array.isArray(a))throw new Error("Raw config must be a JSON object.");if(t.id==="openai-compatibility"){const o=a,l=(Array.isArray(o["api-key-entries"])?o["api-key-entries"]:[]).map(c=>typeof c=="string"?c:c&&typeof c=="object"&&typeof c["api-key"]=="string"?c["api-key"]:"").filter(c=>c&&c!==V);return{name:typeof o.name=="string"?o.name:s.name||"",baseUrl:typeof o["base-url"]=="string"?o["base-url"]:"",proxyUrl:"",prefix:"",headersText:o.headers&&typeof o.headers=="object"&&!Array.isArray(o.headers)?Object.entries(o.headers).map(([c,v])=>`${c}: ${v}`).join(`
|
|
15
|
-
`):"",excludedModelsText:"",modelAliasesText:Array.isArray(o.models)?o.models.map(c=>c.alias?.trim()?`${c.name?.trim()||""}=${c.alias.trim()}`:c.name?.trim()||"").filter(Boolean).join(`
|
|
16
|
-
`):"",apiKey:"",apiKeysText:l.join(`
|
|
17
|
-
`)}}const i=a;return{name:"",baseUrl:typeof i["base-url"]=="string"?i["base-url"]:"",proxyUrl:typeof i["proxy-url"]=="string"?i["proxy-url"]:"",prefix:typeof i.prefix=="string"?i.prefix:"",headersText:i.headers&&typeof i.headers=="object"&&!Array.isArray(i.headers)?Object.entries(i.headers).map(([o,d])=>`${o}: ${d}`).join(`
|
|
18
|
-
`):"",excludedModelsText:Array.isArray(i["excluded-models"])?i["excluded-models"].join(`
|
|
19
|
-
`):"",modelAliasesText:Array.isArray(i.models)?i.models.map(o=>o.alias?.trim()?`${o.name?.trim()||""}=${o.alias.trim()}`:o.name?.trim()||"").filter(Boolean).join(`
|
|
20
|
-
`):"",apiKey:typeof i["api-key"]=="string"&&i["api-key"]!==V?i["api-key"]:"",apiKeysText:""}}function Ss(t,s,r){if(t.id==="openai-compatibility"){const o=J(r.apiKeysText),d=s.secretConfigured&&o.length===0;return{name:r.name.trim(),baseUrl:r.baseUrl.trim(),headers:re(r.headersText),models:Q(r.modelAliasesText),preserveSecrets:d,...o.length>0?{apiKeys:o}:{}}}const a=r.apiKey.trim(),i=s.secretConfigured&&a.length===0;return{baseUrl:r.baseUrl.trim(),proxyUrl:r.proxyUrl.trim(),prefix:r.prefix.trim(),headers:re(r.headersText),excludedModels:J(r.excludedModelsText),models:Q(r.modelAliasesText),preserveSecrets:i,...a.length>0?{apiKey:a}:{}}}function Is(t,s,r){const a={ANTHROPIC_BASE_URL:`${r.target}${t.routePath}`,ANTHROPIC_AUTH_TOKEN:"ccs-internal-managed"},i=Q(s.modelAliasesText).find(o=>o.name.trim());return i?.name&&(a.ANTHROPIC_MODEL=i.name),{env:a}}function ke({badge:t,title:s,items:r}){return e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(h,{variant:"secondary",className:"text-[11px]",children:t}),e.jsx("div",{className:"text-sm font-medium",children:s})]}),e.jsx("div",{className:"mt-4 space-y-3",children:r.map((a,i)=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/10 px-3 py-3",children:[e.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border bg-background text-[11px] font-semibold text-muted-foreground",children:i+1}),e.jsx("div",{className:"text-sm leading-6 text-muted-foreground",children:a})]},`${s}:${a}`))})]})}function M({label:t,helper:s,children:r}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),r,s?e.jsx("div",{className:"text-xs leading-5 text-muted-foreground",children:s}):null]})}function Z({value:t,onChange:s,placeholder:r,rows:a=4}){return e.jsx("textarea",{rows:a,value:t,onChange:i=>s(i.target.value),placeholder:r,className:"flex min-h-24 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"})}function Us({family:t,entry:s,source:r,isSaving:a,onSave:i,onDelete:o}){const d=Ee(t),[l,c]=m.useState(()=>oe(s)),[v,S]=m.useState(null),[E,b]=m.useState(!0),[T,j]=m.useState(null),[O,I]=m.useState("config"),[z,N]=m.useState("raw"),U=m.useMemo(()=>JSON.stringify(Ce(t,s,oe(s)),null,2),[s,t]),y=m.useMemo(()=>JSON.stringify(Ce(t,s,l),null,2),[l,s,t]),p=v??y,L=m.useMemo(()=>Is(t,l,r),[l,t,r]),w=m.useMemo(()=>Q(l.modelAliasesText),[l.modelAliasesText]),q=m.useMemo(()=>re(l.headersText),[l.headersText]),H=m.useMemo(()=>J(l.excludedModelsText),[l.excludedModelsText]),B=m.useMemo(()=>JSON.stringify(L,null,2),[L]),g=Te(w),R=Re(w),P=q.length+H.length+(l.proxyUrl.trim()?1:0)+(l.prefix.trim()?1:0),D=t.id==="openai-compatibility"?l.headersText.trim().length>0:!!(l.proxyUrl.trim()||l.prefix.trim()||l.headersText.trim()||l.excludedModelsText.trim()),F=v!==null?v!==U:y!==U,n=m.useMemo(()=>{if(t.id==="openai-compatibility"){const u=[];return l.name.trim()||u.push("name"),l.baseUrl.trim()||u.push("base-url"),!s.secretConfigured&&J(l.apiKeysText).length===0&&u.push("api-key-entries"),u}return!s.secretConfigured&&!l.apiKey.trim()?["api-key"]:[]},[l.apiKey,l.apiKeysText,l.baseUrl,l.name,s.secretConfigured,t.id]),K=E&&n.length===0&&F,C=u=>{c(x=>u(x)),S(null),b(!0),j(null)},ie=u=>{S(u);try{const x=As(t,s,u);c(x),b(!0),j(null)}catch(x){b(!1),j(x instanceof Error?x.message:"Invalid JSON")}},Oe=()=>{c(oe(s)),S(null),b(!0),j(null)},ge=u=>{C(x=>u==="minimal"?t.id==="openai-compatibility"?{...x,headersText:"",modelAliasesText:""}:{...x,baseUrl:"",proxyUrl:"",prefix:"",headersText:"",excludedModelsText:"",modelAliasesText:""}:{...x,proxyUrl:"",prefix:"",headersText:"",excludedModelsText:t.id==="openai-compatibility"?x.excludedModelsText:""})};return e.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(360px,0.44fr)_minmax(0,0.56fr)] divide-x overflow-hidden rounded-b-xl border-x border-b bg-card",children:[e.jsx("div",{className:"min-h-0 overflow-hidden bg-muted/5",children:e.jsxs(ve,{value:O,onValueChange:I,className:"flex h-full flex-col",children:[e.jsxs("div",{className:"border-b bg-background px-4 pt-4",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"truncate text-lg font-semibold",children:s.label}),e.jsx(ce,{configured:s.secretConfigured}),e.jsx(h,{variant:"outline",className:"uppercase",children:t.authMode})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(h,{variant:"outline",className:"font-mono text-[11px]",children:t.routePath}),e.jsx(h,{variant:"outline",className:"text-[11px]",children:de(s)}),e.jsx(h,{variant:"outline",className:"text-[11px]",children:r.label})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(f,{type:"button",size:"sm",variant:"outline",onClick:Oe,disabled:!F,children:[e.jsx(ss,{className:"mr-1 h-3.5 w-3.5"}),"Reset"]}),e.jsxs(f,{type:"button",size:"sm",variant:"outline",onClick:o,children:[e.jsx(ts,{className:"mr-1 h-3.5 w-3.5"}),"Remove"]}),e.jsxs(f,{type:"button",size:"sm",onClick:()=>void i(Ss(t,s,l)),disabled:!K||a,children:[e.jsx(rs,{className:"mr-1 h-3.5 w-3.5"}),a?"Saving...":"Save"]})]})]}),e.jsxs(ye,{className:"grid w-full grid-cols-2",children:[e.jsxs(W,{value:"config",className:"gap-2 text-xs",children:[e.jsx(se,{className:"h-3.5 w-3.5"}),"Config"]}),e.jsxs(W,{value:"usage",className:"gap-2 text-xs",children:[e.jsx(je,{className:"h-3.5 w-3.5"}),"Info & Usage"]})]})]}),e.jsx(X,{value:"config",className:"mt-0 min-h-0 flex-1 overflow-hidden data-[state=inactive]:hidden",children:e.jsx(ee,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 p-5",children:[e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm font-medium",children:"Workspace presets"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Keep the route lean by default, then layer routing only when this entry actually needs it."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(f,{type:"button",size:"sm",variant:"outline",onClick:()=>ge("minimal"),children:"Minimal setup"}),e.jsx(f,{type:"button",size:"sm",variant:"outline",onClick:()=>ge("clean-routing"),children:"Clear routing noise"})]})]}),e.jsxs("div",{className:"mt-4 grid gap-3 2xl:grid-cols-3",children:[e.jsx(_,{label:"Secret",value:s.secretConfigured?"Stored in CLIProxy":"Missing",hint:s.secretConfigured?"Rotate only when needed":"Required to save"}),e.jsx(_,{label:"Model Rules",value:w.length>0?te(w):"No model rules",hint:"Requested model names stay direct unless remapped"}),e.jsx(_,{label:"Advanced",value:P>0?`${P} active`:"Optional",hint:"Proxy, prefix, headers, and exclusions"})]})]}),n.length>0?e.jsxs("div",{className:"rounded-xl border border-amber-200 bg-amber-50/80 p-4 text-sm text-amber-900",children:["Missing required fields:"," ",e.jsx("span",{className:"font-mono",children:n.join(", ")})]}):null,e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2 text-sm font-medium",children:[e.jsx(pe,{className:"h-4 w-4 text-primary"}),"Connection"]}),e.jsxs("div",{className:"grid gap-4 2xl:grid-cols-2",children:[t.id==="openai-compatibility"?e.jsx(M,{label:"Connector Name",helper:"This is the saved connector label shown in the entry switcher.",children:e.jsx(k,{value:l.name,onChange:u=>C(x=>({...x,name:u.target.value})),placeholder:"openrouter"})}):e.jsx(M,{label:`${t.displayName} API Key`,helper:s.secretConfigured?"Leave blank to keep the stored secret. Enter a new value only to rotate it.":"Required before this route can authenticate.",children:e.jsx(k,{type:"password",value:l.apiKey,onChange:u=>C(x=>({...x,apiKey:u.target.value})),placeholder:s.secretConfigured?s.apiKeyMasked||V:"Paste provider API key"})}),t.id==="openai-compatibility"?e.jsx(M,{label:"API Keys",helper:s.secretConfigured?"One key per line. Leave empty to preserve the stored connector keys.":"Add one key per line. A connector needs at least one key.",children:e.jsx(Z,{value:l.apiKeysText,onChange:u=>C(x=>({...x,apiKeysText:u})),placeholder:"sk-...",rows:4})}):null,e.jsx(M,{label:"Base URL",helper:t.id==="openai-compatibility"?"Required for connectors. This is the upstream OpenAI-style endpoint.":"Leave blank unless this route should target another upstream host.",children:e.jsx(k,{value:l.baseUrl,onChange:u=>C(x=>({...x,baseUrl:u.target.value})),placeholder:t.id==="codex-api-key"?"https://api.openai.com/v1":t.id==="claude-api-key"?"https://api.anthropic.com":t.id==="openai-compatibility"?"https://openrouter.ai/api/v1":"https://provider.example.com"})}),t.id!=="openai-compatibility"?e.jsx(M,{label:"Proxy URL",helper:"Optional intermediary endpoint. Leave blank for direct routing.",children:e.jsx(k,{value:l.proxyUrl,onChange:u=>C(x=>({...x,proxyUrl:u.target.value})),placeholder:"https://proxy.example.com/v1"})}):null,t.id!=="openai-compatibility"?e.jsx(M,{label:"Prefix",helper:"Optional model prefix rewrite for advanced routing only.",children:e.jsx(k,{value:l.prefix,onChange:u=>C(x=>({...x,prefix:u.target.value})),placeholder:"provider/"})}):null]})]}),e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Ue,{className:"h-4 w-4 text-primary"}),"Model rules"]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[g>0?e.jsxs(h,{variant:"outline",children:[g," mapped"]}):null,R>0?e.jsxs(h,{variant:"outline",children:[R," direct"]}):null,w.length===0?e.jsx(h,{variant:"outline",children:"Optional"}):null]})]}),e.jsx(M,{label:"Requested [= Upstream]",helper:"Use requested=upstream for remaps. Use a plain model name when you want the route to expose that model directly.",children:e.jsx(Z,{value:l.modelAliasesText,onChange:u=>C(x=>({...x,modelAliasesText:u})),placeholder:`claude-sonnet-4-5=gpt-5
|
|
21
|
-
glm-5`,rows:6})})]}),e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(se,{className:"h-4 w-4 text-primary"}),"Advanced routing"]}),e.jsx(h,{variant:"outline",children:D?`${P} active`:"Optional"})]}),e.jsxs("div",{className:"grid gap-4 2xl:grid-cols-2",children:[e.jsx(M,{label:"Headers",helper:"One header per line. Use only when the upstream expects org, project, or secondary auth headers.",children:e.jsx(Z,{value:l.headersText,onChange:u=>C(x=>({...x,headersText:u})),placeholder:"OpenAI-Organization: org_...",rows:5})}),t.id!=="openai-compatibility"?e.jsx(M,{label:"Excluded Models",helper:"One model ID per line. These models will be blocked for this entry.",children:e.jsx(Z,{value:l.excludedModelsText,onChange:u=>C(x=>({...x,excludedModelsText:u})),placeholder:"claude-opus-4-1",rows:5})}):e.jsx("div",{className:"rounded-xl border border-dashed bg-muted/10 p-4 text-sm text-muted-foreground",children:"OpenAI-compatible connectors keep advanced routing lean. Add headers or model mappings first before introducing extra route layers elsewhere."})]})]})]})})}),e.jsx(X,{value:"usage",className:"mt-0 min-h-0 flex-1 overflow-hidden data-[state=inactive]:hidden",children:e.jsx(ee,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 p-5",children:[e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Le,{className:"h-4 w-4 text-primary"}),"How this route behaves"]}),e.jsxs("div",{className:"mt-3 space-y-3 text-sm leading-6 text-muted-foreground",children:[e.jsxs("div",{className:"rounded-lg border bg-muted/10 p-4",children:["Calls to ",e.jsx("span",{className:"font-mono",children:t.routePath})," use this saved entry inside CLIProxy."]}),e.jsx("div",{className:"rounded-lg border bg-muted/10 p-4",children:l.baseUrl.trim()?`Traffic resolves to ${l.baseUrl.trim()} unless you layer another proxy in front.`:"Traffic keeps the family default upstream unless you add a custom base URL."}),e.jsx("div",{className:"rounded-lg border bg-muted/10 p-4",children:w.length>0?`${te(w)} rule${w.length===1?"":"s"} active for this entry.`:"Requested model names pass through unchanged until you add explicit model rules."})]})]}),e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(je,{className:"h-4 w-4 text-primary"}),"When API Profiles fits better"]}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:d.profileBoundary})]}),e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Me,{className:"h-4 w-4 text-primary"}),"Editing rule of thumb"]}),e.jsx("div",{className:"mt-3 space-y-3",children:d.editPrompts.map(u=>e.jsxs("div",{className:"rounded-lg border bg-muted/10 p-4",children:[e.jsx("div",{className:"text-sm font-medium",children:u.label}),e.jsx("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:u.hint})]},u.label))})]})]})})})]})}),e.jsx("div",{className:"min-h-0 overflow-hidden",children:e.jsxs(ve,{value:z,onValueChange:N,className:"flex h-full flex-col",children:[e.jsxs("div",{className:"border-b bg-background px-4 pt-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-sm font-medium",children:"Raw configuration"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Target ",e.jsx("span",{className:"font-mono",children:r.target})]})]}),e.jsxs(ye,{className:"grid w-full grid-cols-2",children:[e.jsxs(W,{value:"raw",className:"gap-2 text-xs",children:[e.jsx(as,{className:"h-3.5 w-3.5"}),"Raw Entry Config"]}),e.jsxs(W,{value:"preview",className:"gap-2 text-xs",children:[e.jsx(ns,{className:"h-3.5 w-3.5"}),"settings.json Preview"]})]})]}),e.jsx(X,{value:"raw",className:"mt-0 min-h-0 flex-1 overflow-hidden data-[state=inactive]:hidden",children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"border-b bg-muted/10 px-6 py-3 text-sm text-muted-foreground",children:s.secretConfigured?`Stored secrets are shown as ${V}. Replace the placeholder only when you want to rotate the secret.`:"Add secrets directly in the JSON or use the form on the left."}),T?e.jsx("div",{className:"mx-6 mt-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:T}):null,e.jsx("div",{className:"min-h-0 flex-1 px-6 pb-4 pt-4",children:e.jsx("div",{className:"h-full overflow-hidden rounded-md border bg-background",children:e.jsx(be,{value:p,onChange:ie,language:"json",minHeight:"100%",heightMode:"fill-parent"})})})]})}),e.jsx(X,{value:"preview",className:"mt-0 min-h-0 flex-1 overflow-hidden data-[state=inactive]:hidden",children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"border-b bg-muted/10 px-6 py-3 text-sm text-muted-foreground",children:"Derived preview for a CCS profile that points to this CLIProxy route. The route stays local; the upstream key remains managed here."}),e.jsx("div",{className:"min-h-0 flex-1 px-6 pb-4 pt-4",children:e.jsx("div",{className:"h-full overflow-hidden rounded-md border bg-background",children:e.jsx(be,{value:B,onChange:()=>{},language:"json",readonly:!0,minHeight:"100%",heightMode:"fill-parent"})})}),e.jsx("div",{className:"mx-6 mb-4 overflow-hidden rounded-md border",children:e.jsx(_e,{profileEnv:L.env})})]})})]})})]})}function Ls({family:t,onAddEntry:s,onOpenControlPanel:r,onOpenProfiles:a}){const i=Ee(t),o=t.supportsNamedEntries?"Create connector":`Add ${t.displayName} entry`;return e.jsx("div",{className:"space-y-5",children:e.jsxs("div",{className:"grid gap-5 2xl:grid-cols-[minmax(0,1fr)_320px]",children:[e.jsxs("div",{className:"rounded-xl border bg-card",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b px-5 py-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-muted",children:e.jsx(pe,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold",children:["Set up ",t.displayName]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Start with the smallest working setup. Add routing rules only after the route is already working."})]})]}),e.jsxs(f,{type:"button",onClick:s,children:[e.jsx(Se,{className:"mr-1 h-4 w-4"}),o]})]}),e.jsxs("div",{className:"space-y-4 p-5",children:[e.jsxs("div",{className:"rounded-xl border bg-muted/10 p-4",children:[e.jsx("div",{className:"text-sm font-medium",children:"Recommended setup flow"}),e.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"Finish the left section first. Treat the right section as optional follow-up."}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsx(ke,{badge:"Do this first",title:"Minimum working setup",items:i.requiredNow}),e.jsx(ke,{badge:"Only if needed",title:"Optional later",items:i.optionalLater})]})]}),e.jsxs("div",{className:"rounded-xl border bg-muted/15 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Me,{className:"h-4 w-4 text-emerald-600"}),"Need the other pages?"]}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Use Overview or Control Panel for OAuth sign-ins. Use API Profiles only for CCS-native Anthropic-compatible profiles and presets."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx(f,{type:"button",size:"sm",variant:"outline",onClick:r,children:"Control Panel"}),e.jsxs(f,{type:"button",size:"sm",variant:"outline",onClick:a,children:["API Profiles",e.jsx(Ie,{className:"ml-1 h-3.5 w-3.5"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-xl border bg-card p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Le,{className:"h-4 w-4 text-primary"}),"What this route does"]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx(h,{variant:"outline",className:"font-mono text-[11px]",children:t.routePath}),e.jsx(h,{variant:"outline",className:"uppercase text-[11px]",children:t.authMode})]}),e.jsx("div",{className:"mt-4 space-y-3",children:i.emptyStateSummary.map(d=>e.jsx("div",{className:"rounded-lg border bg-muted/10 p-4 text-sm leading-6 text-muted-foreground",children:d},d))})]}),e.jsxs("div",{className:"rounded-xl border bg-card p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsx(Ue,{className:"h-4 w-4 text-primary"}),"When API Profiles is the better fit"]}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:i.profileBoundary})]})]})]})})}function Gs(){const t=qe(),s=Ke(),{data:r,error:a,isLoading:i,isFetching:o,refetch:d}=gs(),l=fs(),c=vs(),v=ys(),[S,E]=m.useState(!1),[b,T]=m.useState(null),[j,O]=m.useState(null),[I,z]=m.useState(null),N=m.useMemo(()=>r?.families??[],[r?.families]),U=m.useMemo(()=>new URLSearchParams(t.search).get("family")||null,[t.search]),y=m.useMemo(()=>U&&N.some(n=>n.id===U)?U:N[0]?.id??"gemini-api-key",[N,U]),p=m.useMemo(()=>N.find(n=>n.id===y)||null,[N,y]),L=m.useMemo(()=>{const n=p?.entries??[];return n.length===0?null:I&&n.some(K=>K.id===I)?I:n[0]?.id??null},[I,p?.entries]),w=n=>{s({pathname:t.pathname,search:`?family=${n}`},{replace:!0})},q=()=>{T(null),E(!0)};if(i)return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsx(fe,{className:"h-full w-80 rounded-none"}),e.jsx(fe,{className:"h-full flex-1 rounded-none"})]});if(a||!r||!p){const n=a instanceof Error?a.message:"Failed to load CLIProxy AI providers. Check the local server and try again.";return e.jsx("div",{className:"flex h-full min-h-0 items-center justify-center bg-muted/10 p-6",children:e.jsx("div",{className:"w-full max-w-2xl rounded-xl border bg-card p-6 shadow-sm",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-lg bg-destructive/10",children:e.jsx(Pe,{className:"h-5 w-5 text-destructive"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-lg font-semibold",children:"Unable to load AI Providers"}),e.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:n}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsxs(f,{type:"button",onClick:()=>void d(),children:[e.jsx(le,{className:"mr-2 h-4 w-4"}),"Retry"]}),e.jsx(f,{type:"button",variant:"outline",onClick:()=>s("/cliproxy/control-panel"),children:"Control Panel"}),e.jsx(f,{type:"button",variant:"outline",onClick:()=>s("/providers"),children:"API Profiles"})]})]})]})})})}const H=p.entries.filter(n=>n.secretConfigured),B=N.filter(n=>n.status==="ready").length,g=p.entries.find(n=>n.id===L)??null,R=p.entries.length>1,P=bs(p.status),D=p.entries.length>0,F=e.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"Setup status"}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:p.routePath})]}),e.jsx(h,{variant:"secondary",className:P.className,children:P.label})]}),e.jsxs("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:[e.jsx(_,{label:"Entries",value:`${p.entries.length}`,hint:"configured rows"}),e.jsx(_,{label:"Secrets",value:`${H.length}/${p.entries.length||0}`,hint:"stored in CLIProxy"})]}),e.jsx("div",{className:"mt-3 rounded-lg border bg-muted/15 p-3 text-xs leading-5 text-muted-foreground",children:"Overview handles OAuth sign-ins. This page stores CLIProxy-managed keys and connectors. API Profiles remains for CCS-native Anthropic-compatible profiles."})]});return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"flex w-80 flex-col border-r bg-muted/30",children:[e.jsxs("div",{className:"border-b bg-background p-4",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ze,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"CLIProxy Plus"})]}),e.jsx(f,{variant:"ghost",size:"icon",className:"h-8 w-8",type:"button",onClick:()=>void d(),disabled:o,children:e.jsx(le,{className:$("h-4 w-4",o&&"animate-spin")})})]}),e.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"AI Providers"}),e.jsxs(f,{variant:"default",size:"sm",className:"w-full gap-2",type:"button",onClick:q,children:[e.jsx(Se,{className:"h-4 w-4"}),p.supportsNamedEntries?"Create Connector":`Add ${p.displayName} Entry`]})]}),e.jsx(ee,{className:"flex-1",children:e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"px-3 py-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Provider Families"}),e.jsx(os,{families:N,selectedFamily:y,onSelect:w})]})}),e.jsx("div",{className:"border-t p-3",children:e.jsx(Qe,{})}),e.jsx("div",{className:"border-t bg-background p-3 text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[N.length," families"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ae,{className:"h-3 w-3 text-emerald-600"}),B," ready"]})]})})]}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col bg-background",children:[e.jsx("div",{className:"shrink-0 border-b bg-background px-6 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(me,{provider:ue(p.id),size:"lg"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:p.displayName}),e.jsx(h,{variant:"secondary",className:P.className,children:P.label}),e.jsx(h,{variant:"outline",className:"uppercase",children:p.authMode}),e.jsx(h,{variant:"outline",className:"font-mono text-[11px]",children:p.routePath})]}),e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p.description})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(f,{type:"button",variant:"ghost",size:"sm",onClick:()=>void d(),disabled:o,children:e.jsx(le,{className:$("h-4 w-4",o&&"animate-spin")})}),e.jsx(f,{type:"button",variant:"outline",onClick:()=>s("/cliproxy/control-panel"),children:"Control Panel"}),e.jsxs(f,{type:"button",variant:"outline",onClick:()=>s("/providers"),children:["API Profiles",e.jsx(Ie,{className:"ml-1 h-3.5 w-3.5"})]})]})]})}),D?e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 border-b bg-muted/5 px-6 py-4",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[e.jsx(es,{className:"h-3 w-3"}),R?"Saved entries":"Saved entry"]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(h,{variant:"outline",className:"text-[11px]",children:[p.entries.length," entries"]}),e.jsxs(h,{variant:"outline",className:"text-[11px]",children:[H.length,"/",p.entries.length," secrets stored"]})]})]}),R?e.jsx("div",{className:"flex flex-wrap gap-3",children:p.entries.map(n=>e.jsxs("button",{type:"button",onClick:()=>z(n.id),className:$("min-w-[220px] max-w-[280px] flex-1 rounded-xl border bg-background px-4 py-3 text-left transition-colors",n.id===L?"border-primary/30 bg-primary/5 shadow-sm":"border-border/60 hover:bg-muted/50"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:n.label}),e.jsx(ce,{configured:n.secretConfigured})]}),e.jsx("div",{className:"mt-2 truncate text-xs text-muted-foreground",children:n.baseUrl||p.routePath}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.jsx(h,{variant:"outline",className:"text-[10px]",children:de(n)}),n.models.length>0?e.jsx(h,{variant:"outline",className:"text-[10px]",children:te(n.models)}):null,e.jsxs(h,{variant:"outline",className:"text-[10px]",children:[n.headers.length," hdr"]})]})]},n.id))}):g?e.jsx("div",{className:"rounded-xl border bg-background px-4 py-3",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:g.label}),e.jsx(ce,{configured:g.secretConfigured})]}),e.jsx("div",{className:"mt-1 truncate text-xs text-muted-foreground",children:g.baseUrl||p.routePath})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx(h,{variant:"outline",className:"text-[10px]",children:de(g)}),g.models.length>0?e.jsx(h,{variant:"outline",className:"text-[10px]",children:te(g.models)}):null,e.jsxs(h,{variant:"outline",className:"text-[10px]",children:[g.headers.length," hdr"]})]})]})}):null]}),g?e.jsx(Us,{family:p,entry:g,source:r.source,isSaving:c.isPending,onSave:async n=>{await c.mutateAsync({family:y,entryId:g.id,data:n}),d()},onDelete:()=>O(g)},g.id):null]}):e.jsx(ee,{className:"flex-1",children:e.jsxs("div",{className:"space-y-6 p-6",children:[F,e.jsx(Ls,{family:p,onAddEntry:q,onOpenControlPanel:()=>s("/cliproxy/control-panel"),onOpenProfiles:()=>s("/providers")})]})})]}),e.jsx(hs,{family:y,entry:b,open:S,onOpenChange:E,onSubmit:async n=>{b?await c.mutateAsync({family:y,entryId:b.id,data:n}):await l.mutateAsync({family:y,data:n}),E(!1),T(null),d()},isSaving:l.isPending||c.isPending},`${y}:${b?.id??"new"}:${S?"open":"closed"}`),e.jsx(We,{open:j!==null,title:"Remove provider entry?",description:j?`This removes ${j.label} from ${p.displayName}.`:"",confirmText:"Remove",variant:"destructive",onConfirm:async()=>{j&&(await v.mutateAsync({family:y,entryId:j.id}),O(null))},onCancel:()=>O(null)})]})}export{Gs as CliproxyAiProvidersPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d}from"./react-vendor-CNOkPC89.js";const M=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,c)=>c?c.toUpperCase():o.toLowerCase()),s=t=>{const e=_(t);return e.charAt(0).toUpperCase()+e.slice(1)},k=(...t)=>t.filter((e,o,c)=>!!e&&e.trim()!==""&&c.indexOf(e)===o).join(" ").trim(),v=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var m={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=d.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:n="",children:h,iconNode:p,...y},r)=>d.createElement("svg",{ref:r,...m,width:e,height:e,stroke:t,strokeWidth:c?Number(o)*24/Number(e):o,className:k("lucide",n),...!h&&!v(y)&&{"aria-hidden":"true"},...y},[...p.map(([i,l])=>d.createElement(i,l)),...Array.isArray(h)?h:[h]]));const a=(t,e)=>{const o=d.forwardRef(({className:c,...n},h)=>d.createElement(x,{ref:h,iconNode:e,className:k(`lucide-${M(s(t))}`,`lucide-${t}`,c),...n}));return o.displayName=s(t),o};const g=[["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"}]],K2=a("activity",g);const f=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],X2=a("archive",f);const w=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],Q2=a("arrow-down-left",w);const $=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],J2=a("arrow-down-right",$);const N=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Y2=a("arrow-down",N);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],a0=a("arrow-left",u);const b=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],e0=a("arrow-right-left",b);const z=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],t0=a("arrow-right",z);const q=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],o0=a("arrow-up-right",q);const C=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],c0=a("arrow-up",C);const A=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],h0=a("book-open",A);const j=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],d0=a("bot",j);const H=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],n0=a("box",H);const L=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],y0=a("brain-circuit",L);const V=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],s0=a("brain",V);const S=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],k0=a("bug",S);const P=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],p0=a("calendar-clock",P);const F=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],r0=a("calendar",F);const R=[["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"}]],i0=a("chart-column",R);const B=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],l0=a("chart-pie",B);const U=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],M0=a("check-check",U);const Z=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_0=a("check",Z);const D=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],v0=a("chevron-down",D);const E=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],m0=a("chevron-left",E);const T=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],x0=a("chevron-right",T);const W=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],g0=a("chevron-up",W);const O=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],f0=a("chevrons-up-down",O);const G=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],w0=a("circle-alert",G);const I=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],$0=a("circle-check-big",I);const K=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],N0=a("circle-check",K);const X=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],u0=a("circle-question-mark",X);const Q=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],b0=a("circle-x",Q);const J=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],z0=a("circle",J);const Y=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],q0=a("clock",Y);const a1=[["path",{d:"m10.852 19.772-.383.924",key:"r7sl7d"}],["path",{d:"m13.148 14.228.383-.923",key:"1d5zpm"}],["path",{d:"M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1ydik7"}],["path",{d:"m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1m1vsf"}],["path",{d:"m14.772 15.852.923-.383",key:"660p6e"}],["path",{d:"m14.772 18.148.923.383",key:"hrcpis"}],["path",{d:"M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2",key:"j2q98n"}],["path",{d:"m9.228 15.852-.923-.383",key:"1p9ong"}],["path",{d:"m9.228 18.148-.923.383",key:"6558rz"}]],C0=a("cloud-cog",a1);const e1=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],A0=a("cloud",e1);const t1=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],j0=a("code-xml",t1);const o1=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],H0=a("code",o1);const c1=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],L0=a("coins",c1);const h1=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],V0=a("command",h1);const d1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],S0=a("copy",d1);const n1=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],P0=a("cpu",n1);const y1=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],F0=a("database",y1);const s1=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],R0=a("dollar-sign",s1);const k1=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],B0=a("download",k1);const p1=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],U0=a("ellipsis",p1);const r1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Z0=a("external-link",r1);const i1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],D0=a("eye-off",i1);const l1=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],E0=a("eye",l1);const M1=[["path",{d:"M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6",key:"14cnrg"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1",key:"sr0ebq"}],["path",{d:"M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1",key:"w793db"}]],T0=a("file-braces-corner",M1);const _1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],W0=a("file-braces",_1);const v1=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],O0=a("file-code-corner",v1);const m1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],G0=a("file-code",m1);const x1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],I0=a("file-down",x1);const g1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],K0=a("file-exclamation-point",g1);const f1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],X0=a("file-text",f1);const w1=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],Q0=a("fingerprint-pattern",w1);const $1=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"m9 13 2 2 4-4",key:"6343dt"}]],J0=a("folder-check",$1);const N1=[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]],Y0=a("folder-code",N1);const u1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],aa=a("folder-open",u1);const b1=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ea=a("folder",b1);const z1=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],ta=a("funnel",z1);const q1=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],oa=a("gauge",q1);const C1=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ca=a("git-branch",C1);const A1=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],ha=a("github",A1);const j1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],da=a("globe",j1);const H1=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],na=a("grip-horizontal",H1);const L1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],ya=a("grip-vertical",L1);const V1=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],sa=a("heart",V1);const S1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ka=a("history",S1);const P1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],pa=a("house",P1);const F1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ra=a("image",F1);const R1=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],ia=a("inbox",R1);const B1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],la=a("info",B1);const U1=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ma=a("key-round",U1);const Z1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],_a=a("key",Z1);const D1=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],va=a("laptop",D1);const E1=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],ma=a("layers",E1);const T1=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],xa=a("link-2",T1);const W1=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],ga=a("list-filter",W1);const O1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fa=a("loader-circle",O1);const G1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],wa=a("lock",G1);const I1=[["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"}]],$a=a("log-out",I1);const K1=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],Na=a("megaphone",K1);const X1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],ua=a("message-square",X1);const Q1=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],ba=a("monitor-smartphone",Q1);const J1=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],za=a("monitor",J1);const Y1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],qa=a("moon",Y1);const a2=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Ca=a("network",a2);const e2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Aa=a("panel-left",e2);const t2=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ja=a("pause",t2);const o2=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Ha=a("pen-line",o2);const c2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],La=a("pencil",c2);const h2=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Va=a("play",h2);const d2=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],Sa=a("plug-zap",d2);const n2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pa=a("plus",n2);const y2=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Fa=a("power-off",y2);const s2=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Ra=a("power",s2);const k2=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Ba=a("puzzle",k2);const p2=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Ua=a("radio",p2);const r2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Za=a("refresh-cw",r2);const i2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Da=a("rotate-ccw",i2);const l2=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Ea=a("rotate-cw",l2);const M2=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],Ta=a("route",M2);const _2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Wa=a("save",_2);const v2=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Oa=a("scroll-text",v2);const m2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ga=a("search",m2);const x2=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ia=a("server",x2);const g2=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Ka=a("settings-2",g2);const f2=[["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"}]],Xa=a("settings",f2);const w2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Qa=a("shield-alert",w2);const $2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ja=a("shield-check",$2);const N2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Ya=a("shield",N2);const u2=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],ae=a("sliders-horizontal",u2);const b2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ee=a("sparkles",b2);const z2=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],te=a("square-terminal",z2);const q2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],oe=a("square",q2);const C2=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],ce=a("star",C2);const A2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],he=a("sun",A2);const j2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],de=a("terminal",j2);const H2=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]],ne=a("timer-reset",H2);const L2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ye=a("trash-2",L2);const V2=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],se=a("trending-up",V2);const S2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ke=a("triangle-alert",S2);const P2=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],pe=a("unlink",P2);const F2=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],re=a("upload",F2);const R2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ie=a("user",R2);const B2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],le=a("users",B2);const U2=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Me=a("wand-sparkles",U2);const Z2=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],_e=a("waves",Z2);const D2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ve=a("wifi-off",D2);const E2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],me=a("wifi",E2);const T2=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],xe=a("workflow",T2);const W2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],ge=a("wrench",W2);const O2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fe=a("x",O2);const G2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],we=a("zap",G2);export{H0 as $,K2 as A,h0 as B,x0 as C,ja as D,D0 as E,aa as F,oa as G,pa as H,b0 as I,Va as J,_a as K,fa as L,qa as M,ya as N,Da as O,Aa as P,Ua as Q,Za as R,te as S,ke as T,le as U,P0 as V,ve as W,fe as X,la as Y,we as Z,de as _,i0 as a,xa as a$,o0 as a0,Q2 as a1,X0 as a2,K0 as a3,na as a4,t0 as a5,Ka as a6,ra as a7,Pa as a8,ee as a9,B0 as aA,a0 as aB,Qa as aC,Ca as aD,U0 as aE,Y0 as aF,ca as aG,ga as aH,xe as aI,Ta as aJ,T0 as aK,Ra as aL,Fa as aM,f0 as aN,Sa as aO,ma as aP,J0 as aQ,Ha as aR,ka as aS,O0 as aT,ea as aU,y0 as aV,Q0 as aW,ia as aX,ta as aY,ne as aZ,pe as a_,ua as aa,s0 as ab,Ia as ac,X2 as ad,G0 as ae,m0 as af,Ja as ag,ba as ah,wa as ai,V0 as aj,R0 as ak,F0 as al,J2 as am,r0 as an,L0 as ao,se as ap,l0 as aq,ye as ar,Wa as as,Ga as at,Me as au,j0 as av,ae as aw,C0 as ax,re as ay,W0 as az,ha as b,_e as b0,La as b1,M0 as b2,ge as b3,za as b4,d0 as b5,p0 as b6,Na as b7,A0 as b8,va as b9,n0 as ba,k0 as bb,e0 as bc,I0 as bd,Ea as be,oe as bf,Y2 as bg,c0 as bh,Ba as c,Oa as d,Xa as e,he as f,E0 as g,me as h,Ya as i,sa as j,$0 as k,z0 as l,_0 as m,Ma as n,S0 as o,Z0 as p,ie as q,$a as r,v0 as s,g0 as t,da as u,q0 as v,w0 as w,N0 as x,u0 as y,ce as z};
|