@kaitranntt/ccs 8.9.0 → 8.10.0-dev.2
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/README.md +3 -3
- package/dist/cliproxy/accounts/drain-order.d.ts +9 -1
- package/dist/cliproxy/accounts/drain-order.d.ts.map +1 -1
- package/dist/cliproxy/accounts/drain-order.js +15 -1
- package/dist/cliproxy/accounts/drain-order.js.map +1 -1
- package/dist/cliproxy/ai-providers/codex-plan-compatibility.js +2 -2
- package/dist/cliproxy/ai-providers/codex-plan-compatibility.js.map +1 -1
- package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts +1 -1
- package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts.map +1 -1
- package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js +4 -2
- package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js.map +1 -1
- package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts +1 -1
- package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts.map +1 -1
- package/dist/cliproxy/ai-providers/model-id-normalizer.js +5 -1
- package/dist/cliproxy/ai-providers/model-id-normalizer.js.map +1 -1
- package/dist/cliproxy/binary/install-lifecycle-lock.d.ts +2 -0
- package/dist/cliproxy/binary/install-lifecycle-lock.d.ts.map +1 -0
- package/dist/cliproxy/binary/install-lifecycle-lock.js +63 -0
- package/dist/cliproxy/binary/install-lifecycle-lock.js.map +1 -0
- package/dist/cliproxy/binary/installer.d.ts +13 -1
- package/dist/cliproxy/binary/installer.d.ts.map +1 -1
- package/dist/cliproxy/binary/installer.js +81 -42
- package/dist/cliproxy/binary/installer.js.map +1 -1
- package/dist/cliproxy/binary/lifecycle.d.ts +6 -1
- package/dist/cliproxy/binary/lifecycle.d.ts.map +1 -1
- package/dist/cliproxy/binary/lifecycle.js +13 -10
- package/dist/cliproxy/binary/lifecycle.js.map +1 -1
- package/dist/cliproxy/binary/platform-detector.d.ts.map +1 -1
- package/dist/cliproxy/binary/platform-detector.js +5 -4
- package/dist/cliproxy/binary/platform-detector.js.map +1 -1
- package/dist/cliproxy/binary/version-checker.d.ts +2 -0
- package/dist/cliproxy/binary/version-checker.d.ts.map +1 -1
- package/dist/cliproxy/binary/version-checker.js +5 -1
- package/dist/cliproxy/binary/version-checker.js.map +1 -1
- package/dist/cliproxy/binary-manager.d.ts +2 -0
- package/dist/cliproxy/binary-manager.d.ts.map +1 -1
- package/dist/cliproxy/binary-manager.js +31 -29
- package/dist/cliproxy/binary-manager.js.map +1 -1
- package/dist/cliproxy/config/extended-context-config.d.ts.map +1 -1
- package/dist/cliproxy/config/extended-context-config.js +38 -1
- package/dist/cliproxy/config/extended-context-config.js.map +1 -1
- package/dist/cliproxy/config/thinking-config.d.ts.map +1 -1
- package/dist/cliproxy/config/thinking-config.js +5 -5
- package/dist/cliproxy/config/thinking-config.js.map +1 -1
- package/dist/cliproxy/executor/env-resolver.js +1 -1
- package/dist/cliproxy/executor/env-resolver.js.map +1 -1
- package/dist/cliproxy/executor/launch-settings.d.ts.map +1 -1
- package/dist/cliproxy/executor/launch-settings.js +9 -2
- package/dist/cliproxy/executor/launch-settings.js.map +1 -1
- package/dist/cliproxy/model-catalog.d.ts +6 -0
- package/dist/cliproxy/model-catalog.d.ts.map +1 -1
- package/dist/cliproxy/model-catalog.js +56 -3
- package/dist/cliproxy/model-catalog.js.map +1 -1
- package/dist/cliproxy/routing/routing-strategy.d.ts +4 -5
- package/dist/cliproxy/routing/routing-strategy.d.ts.map +1 -1
- package/dist/cliproxy/routing/routing-strategy.js +18 -13
- package/dist/cliproxy/routing/routing-strategy.js.map +1 -1
- package/dist/cliproxy/services/binary-service.d.ts.map +1 -1
- package/dist/cliproxy/services/binary-service.js +24 -20
- package/dist/cliproxy/services/binary-service.js.map +1 -1
- package/dist/cliproxy/services/catalog-cache.d.ts.map +1 -1
- package/dist/cliproxy/services/catalog-cache.js +2 -0
- package/dist/cliproxy/services/catalog-cache.js.map +1 -1
- package/dist/cliproxy/types/binary-types.d.ts +1 -0
- package/dist/cliproxy/types/binary-types.d.ts.map +1 -1
- package/dist/commands/cliproxy/order-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/order-subcommand.js +21 -0
- package/dist/commands/cliproxy/order-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand/format-helpers.js +1 -1
- package/dist/commands/cliproxy/quota-subcommand/handlers.js +1 -1
- package/dist/commands/cliproxy/quota-subcommand/handlers.js.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.js +1 -1
- package/dist/commands/cliproxy/quota-subcommand/sections/claude.js.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.js +1 -1
- package/dist/commands/cliproxy/quota-subcommand/sections/codex.js.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js +1 -1
- package/dist/commands/cliproxy/quota-subcommand/sections/gemini-cli.js.map +1 -1
- package/dist/commands/cliproxy/variant-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/variant-subcommand.js +5 -1
- package/dist/commands/cliproxy/variant-subcommand.js.map +1 -1
- package/dist/delegation/delegation-handler.d.ts.map +1 -1
- package/dist/delegation/delegation-handler.js +12 -2
- package/dist/delegation/delegation-handler.js.map +1 -1
- package/dist/management/shared-manager/diverged-file-adopter.d.ts.map +1 -1
- package/dist/management/shared-manager/diverged-file-adopter.js +106 -76
- package/dist/management/shared-manager/diverged-file-adopter.js.map +1 -1
- package/dist/shared/extended-context-utils.d.ts +17 -1
- package/dist/shared/extended-context-utils.d.ts.map +1 -1
- package/dist/shared/extended-context-utils.js +37 -3
- package/dist/shared/extended-context-utils.js.map +1 -1
- package/dist/shared/provider-preset-catalog.d.ts +3 -2
- package/dist/shared/provider-preset-catalog.d.ts.map +1 -1
- package/dist/shared/provider-preset-catalog.js +19 -2
- package/dist/shared/provider-preset-catalog.js.map +1 -1
- package/dist/ui/assets/{Trans-dQ5QXCeL.js → Trans-BFurXtDk.js} +1 -1
- package/dist/ui/assets/{accounts-DMMNI7g4.js → accounts-B_ik6YOD.js} +1 -1
- package/dist/ui/assets/{alert-dialog-BIWuuEiP.js → alert-dialog-C6fhMbXC.js} +1 -1
- package/dist/ui/assets/{api-BKTghVxS.js → api-CxCFoBC0.js} +1 -1
- package/dist/ui/assets/{auth-section-BKDcPs0P.js → auth-section-CtmO77JA.js} +1 -1
- package/dist/ui/assets/{backups-section-DB1N4X1P.js → backups-section-BYKnAWUa.js} +1 -1
- package/dist/ui/assets/{channels-dhk_rRcA.js → channels-3uR41jWp.js} +1 -1
- package/dist/ui/assets/{checkbox-h1pwW_6m.js → checkbox-fCmjUiDn.js} +1 -1
- package/dist/ui/assets/{claude-extension-WLOGl6eK.js → claude-extension-BplTVbCF.js} +1 -1
- package/dist/ui/assets/cliproxy-BdW2ctsn.js +4 -0
- package/dist/ui/assets/{cliproxy-ai-providers-DVkAmHVF.js → cliproxy-ai-providers-D4OTiwA3.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-D25OT5u5.js → cliproxy-control-panel-DCyhsdm1.js} +1 -1
- package/dist/ui/assets/{codex-Bqc25al7.js → codex-BGF20GsK.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BnAIV9ZB.js → confirm-dialog-BtMwDW6c.js} +1 -1
- package/dist/ui/assets/{copilot-BdjZjuRs.js → copilot-r1b0KLFf.js} +1 -1
- package/dist/ui/assets/{cursor-DTbIQ-d7.js → cursor-BhVKTiz1.js} +1 -1
- package/dist/ui/assets/{droid-DAjrpAjP.js → droid-lol9hAdK.js} +1 -1
- package/dist/ui/assets/{globalenv-section-BzirfKtN.js → globalenv-section-B0gg-kuR.js} +1 -1
- package/dist/ui/assets/{health-CDCop1Et.js → health-Bu6RFYCP.js} +1 -1
- package/dist/ui/assets/{index-vdkPayvk.js → index-BbPI5sU_.js} +1 -1
- package/dist/ui/assets/{index-DMGiMF5C.js → index-BmjgsjcO.js} +1 -1
- package/dist/ui/assets/{index-BF4hYrQf.js → index-Djse8iLV.js} +1 -1
- package/dist/ui/assets/{index-bC8F80OC.js → index-Pn_n_HFQ.js} +1 -1
- package/dist/ui/assets/{index-BhGdNER3.js → index-awbhDVzL.js} +1 -1
- package/dist/ui/assets/{index-B4yjQknk.js → index-pHOoeHgY.js} +36 -36
- package/dist/ui/assets/{index-Dkee4NQG.js → index-ptYEAEzZ.js} +1 -1
- package/dist/ui/assets/{logs-Bb1BaiFq.js → logs-B5Sbi4IG.js} +1 -1
- package/dist/ui/assets/{masked-input-DxWhb6sQ.js → masked-input-BnrL_TdT.js} +1 -1
- package/dist/ui/assets/proxy-status-widget-ColaQQXh.js +1 -0
- package/dist/ui/assets/{raw-json-settings-editor-panel-BeZJbsnO.js → raw-json-settings-editor-panel-PStRjNEl.js} +1 -1
- package/dist/ui/assets/{searchable-select-CcXdAHJm.js → searchable-select-BDpwwNsP.js} +1 -1
- package/dist/ui/assets/{separator-O1g2RdCE.js → separator-CJCyWDRS.js} +1 -1
- package/dist/ui/assets/{shared-Ct6UqE0N.js → shared-6BrToCad.js} +1 -1
- package/dist/ui/assets/{table-D4ZJKsoh.js → table-CnZev3Iu.js} +1 -1
- package/dist/ui/assets/{updates-jnNBispr.js → updates-BiS0o8aM.js} +1 -1
- package/dist/ui/assets/{use-accounts-DXwh5f2t.js → use-accounts-89FOqhFc.js} +1 -1
- package/dist/ui/icons/orcarouter.svg +1 -0
- package/dist/ui/index.html +1 -1
- package/dist/utils/hooks/image-analysis-backend-resolver.d.ts.map +1 -1
- package/dist/utils/hooks/image-analysis-backend-resolver.js +6 -0
- package/dist/utils/hooks/image-analysis-backend-resolver.js.map +1 -1
- package/dist/utils/hooks/image-analysis-runtime-status.d.ts.map +1 -1
- package/dist/utils/hooks/image-analysis-runtime-status.js +8 -3
- package/dist/utils/hooks/image-analysis-runtime-status.js.map +1 -1
- package/dist/utils/package-manager-detector.d.ts.map +1 -1
- package/dist/utils/package-manager-detector.js +6 -2
- package/dist/utils/package-manager-detector.js.map +1 -1
- package/dist/utils/websearch/agy.d.ts +3 -1
- package/dist/utils/websearch/agy.d.ts.map +1 -1
- package/dist/utils/websearch/agy.js +33 -23
- package/dist/utils/websearch/agy.js.map +1 -1
- package/dist/utils/websearch/gemini-cli.d.ts +3 -1
- package/dist/utils/websearch/gemini-cli.d.ts.map +1 -1
- package/dist/utils/websearch/gemini-cli.js +33 -23
- package/dist/utils/websearch/gemini-cli.js.map +1 -1
- package/dist/utils/websearch/grok-cli.d.ts +3 -1
- package/dist/utils/websearch/grok-cli.d.ts.map +1 -1
- package/dist/utils/websearch/grok-cli.js +33 -23
- package/dist/utils/websearch/grok-cli.js.map +1 -1
- package/dist/utils/websearch/opencode-cli.d.ts +3 -1
- package/dist/utils/websearch/opencode-cli.d.ts.map +1 -1
- package/dist/utils/websearch/opencode-cli.js +33 -23
- package/dist/utils/websearch/opencode-cli.js.map +1 -1
- package/dist/utils/websearch/status.d.ts +4 -1
- package/dist/utils/websearch/status.d.ts.map +1 -1
- package/dist/utils/websearch/status.js +47 -25
- package/dist/utils/websearch/status.js.map +1 -1
- package/dist/web-server/model-pricing.d.ts.map +1 -1
- package/dist/web-server/model-pricing.js +50 -11
- package/dist/web-server/model-pricing.js.map +1 -1
- package/dist/web-server/services/cliproxy-dashboard-install-service.d.ts +5 -0
- package/dist/web-server/services/cliproxy-dashboard-install-service.d.ts.map +1 -1
- package/dist/web-server/services/cliproxy-dashboard-install-service.js +53 -36
- package/dist/web-server/services/cliproxy-dashboard-install-service.js.map +1 -1
- package/dist/web-server/usage/aggregator.d.ts.map +1 -1
- package/dist/web-server/usage/aggregator.js +36 -2
- package/dist/web-server/usage/aggregator.js.map +1 -1
- package/package.json +4 -1
- package/scripts/dev-release.sh +1 -1
- package/dist/ui/assets/cliproxy-CE_mZIGU.js +0 -4
- package/dist/ui/assets/proxy-status-widget-Dj_46CdP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregator.js","sourceRoot":"","sources":["../../../src/web-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AAG,KAAK,CAAC;gBACvB,CAAC,CAAC,CAAC;YACP,CAAC;YAED,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;QAC3D,CAAC;QAED,+EAA+E;QAC/E,OAAO,CAAC,GAAG,CAAC,IAAA,SAAI,EAAC,uCAAuC,CAAC,CAAC,CAAC;QAC3D,MAAM,0BAA0B,EAAE,CAAC;QAEnC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,IAAA,OAAE,EAAC,sBAAsB,OAAO,KAAK,CAAC,CAAC,CAAC;QACpD,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC7D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAA,SAAI,EAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QACnF,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAzED,8CAyEC;AAED;;GAEG;AACH,SAAgB,uBAAuB;IACrC,IAAA,wCAAgB,GAAE,CAAC;AACrB,CAAC;AAFD,0DAEC;AAED;;;GAGG;AACI,KAAK,UAAU,iBAAiB;IACrC,0DAA0D;IAC1D,IAAA,yCAAiB,GAAE,CAAC;IACpB,MAAM,0BAA0B,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAJD,8CAIC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaitranntt/ccs",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0-dev.2",
|
|
4
4
|
"description": "Claude Codex Switch - Instant profile switching between Claude, GLM, Kimi, and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"url": "git+https://github.com/kaitranntt/ccs.git"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
22
25
|
"author": {
|
|
23
26
|
"name": "Tam Nhu Tran (Kai)",
|
|
24
27
|
"email": "kaitranntt@users.noreply.github.com"
|
package/scripts/dev-release.sh
CHANGED
|
@@ -115,7 +115,7 @@ PACKAGE_NAME=$(jq -r '.name' package.json)
|
|
|
115
115
|
if npm view "${PACKAGE_NAME}@${VERSION}" version >/dev/null 2>&1; then
|
|
116
116
|
log_info "npm already has ${PACKAGE_NAME}@${VERSION}, skipping publish"
|
|
117
117
|
else
|
|
118
|
-
npm publish --tag dev
|
|
118
|
+
npm publish --tag dev --access public
|
|
119
119
|
log_info "Published to npm with @dev tag"
|
|
120
120
|
fi
|
|
121
121
|
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as u}from"./react-vendor-Bjx91N7w.js";import{a as Tt,u as os,b as Os}from"./tanstack-bhJxV1h8.js";import{a9 as Ls,a as Q,e as G,C as ds,b as ls,aa as cs,ab as us,c as W,P as Ne,B as H,ac as he,L as ee,I as ce,j as _e,k as Fe,l as qe,m as Ue,n as je,ad as ms,ae as ps,af as _s,ag as Fs,ah as qs,u as xs,ai as Dt,aj as Et,ak as It,al as Rt,Y as fe,am as hs,an as Qt,ao as Us,ap as Gs,aq as Ge,ar as fs,_ as st,as as Ks,at as Wt,au as Jt,av as Hs,aw as zs,ax as Bs,ay as Vs,az as $s,aA as Qs,aB as Ws,aC as Js,aD as Xt,aE as Ot,aF as Xs,z as gs,aG as Ys,x as Lt,aH as Zs,aI as _t,aJ as Yt,aK as ea,w as ta,aL as sa,aM as aa,T as kt,o as yt,p as wt,q as Ct,aN as na,aO as ia,aP as ra,aQ as ft,aR as oa,aS as da,aT as la,aU as ca,aV as ua,aW as ma,U as pa,V as xa,W as Zt,X as es,aX as ha,aY as fa,aZ as ga,a_ as va,a$ as ja,b0 as ba,b1 as Na,b2 as ka,b3 as ya,b4 as wa,b5 as Ca,b6 as Xe,b7 as Aa,S as Sa}from"./index-B4yjQknk.js";import{C as At}from"./default-ports-1QQSffYX.js";import{t as V}from"./notifications-B4_o8bcr.js";import{C as vs,L as ue,q as Me,a0 as Ma,n as Pe,p as js,aH as Ft,R as lt,r as Ke,ab as qt,T as rt,a8 as ts,aI as bs,aG as Pa,D as Ut,Z as He,$ as Ns,i as Ta,v as ks,aJ as Da,av as Ea,X as Gt,aa as ct,N as ys,I as ws,aK as Ia,au as Cs,aL as Ra,ay as Oa,aM as ot}from"./icons-DSLG1YsC.js";import{R as at,A as ss,D as gt,i as La,a as _a}from"./antigravity-responsibility-constants-Bvh4Ybz0.js";import{C as nt}from"./checkbox-h1pwW_6m.js";import{C as Fa}from"./confirm-dialog-BnAIV9ZB.js";import{S as Kt}from"./separator-O1g2RdCE.js";import{S as qa}from"./searchable-select-CcXdAHJm.js";import{P as Ua}from"./proxy-status-widget-Dj_46CdP.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";import"./alert-dialog-BIWuuEiP.js";import"./Trans-dQ5QXCeL.js";const ne="gemini-3.1-pro-high",Ee="gemini-3.1-pro-low",Ga=Object.freeze({"gemini-3-pro-high":ne,"gemini-3.1-pro-high":ne,"gemini-3-pro-low":Ee,"gemini-3.1-pro-low":Ee,"gemini-3-pro-preview":ne,"gemini-3-pro-preview-customtools":ne,"gemini-3.1-pro-preview":ne,"gemini-3.1-pro-preview-customtools":ne,"gemini-3-1-pro-preview":ne,"gemini-3-1-pro-preview-customtools":ne}),As=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"}),Ka=/^gemini-(\d+(?:[.-]\d+)*)-(pro|flash)-preview(-customtools)?$/i,Ha=["agy/","gcli/"];function $(t){return Ls(t).toLowerCase()}function za(t){const a=t.trim(),s=a.toLowerCase();for(const n of Ha)if(s.startsWith(n))return a.slice(n.length);return a}function Ba(t){return t.replace(/-customtools$/i,"")}function Va(t){return Ga[$(t)]}function dt(t){const a=$(t),s=a.match(Ka);if(!s)return null;const[,n,i,o]=s;return{normalizedId:a,version:n.split(/[.-]/).map(d=>Number(d)),family:i,customtools:!!o,dottedVersion:n.includes(".")}}function Ss(t,a){const s=Math.max(t.length,a.length);for(let n=0;n<s;n+=1){const i=t[n]??0,o=a[n]??0;if(i!==o)return i>o?1:-1}return 0}function $a(t,a,s){if(t.customtools!==a.customtools)return t.customtools?1:-1;const n=Ss(t.version,a.version);if(n!==0)return n>0?-1:1;const i=+(t.dottedVersion===s.dottedVersion),o=+(a.dottedVersion===s.dottedVersion);return i!==o?o-i:t.normalizedId.localeCompare(a.normalizedId)}function as(t,a){const s=$(a);return t.find(n=>$(n.id)===s)?.id}function Qa(t,a){const s=dt(t);return!s||a.length===0?void 0:a.map(i=>{const o=dt(i.id);return!o||o.family!==s.family?null:{id:i.id,info:o}}).filter(i=>!!i).sort((i,o)=>$a(i.info,o.info,s))[0]?.id}const ke={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:ne,name:"Gemini Pro High",description:"Current Antigravity Gemini Pro route with higher reasoning budget",extendedContext:!0,presetMapping:{default:ne,opus:ne,sonnet:ne,haiku:"gemini-3-1-flash-preview"}},{id:Ee,name:"Gemini Pro Low",description:"Current Antigravity Gemini Pro route with the lighter quota tier",extendedContext:!0,presetMapping:{default:Ee,opus:Ee,sonnet:Ee,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:ne,sonnet:ne,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.4",models:[{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",description:"Latest frontier agentic coding model.",codexMaxEffort:"xhigh",codexEfforts:["low","medium","high","xhigh"],codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.6-sol",opus:"gpt-5.6-sol",sonnet:"gpt-5.6-sol",haiku:"gpt-5.4-mini"}},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",description:"Balanced agentic coding model for everyday work.",codexMaxEffort:"xhigh",codexEfforts:["low","medium","high","xhigh"],codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.6-terra",opus:"gpt-5.6-terra",sonnet:"gpt-5.6-terra",haiku:"gpt-5.4-mini"}},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",description:"Fast and affordable agentic coding model.",codexMaxEffort:"xhigh",codexEfforts:["low","medium","high","xhigh"],codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.6-luna",opus:"gpt-5.6-luna",sonnet:"gpt-5.6-luna",haiku:"gpt-5.4-mini"}},{id:"gpt-5.5",name:"GPT-5.5",tier:"paid",description:"Newest Codex-released GPT-5 family model; falls back to GPT-5.4 on free plans",codexMaxEffort:"xhigh",codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.5",opus:"gpt-5.5",sonnet:"gpt-5.5",haiku:"gpt-5.4-mini"}},{id:"gpt-5.4",name:"GPT-5.4",description:"Recommended Codex default for most coding and agentic tasks",codexMaxEffort:"xhigh",codexServiceTiers:["fast"],presetMapping:{default:"gpt-5.4",opus:"gpt-5.4",sonnet:"gpt-5.4",haiku:"gpt-5.4-mini"}},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",description:"Fast, lower-cost Codex option for lighter tasks and haiku-tier routing",codexMaxEffort:"high",presetMapping:{default:"gpt-5.4-mini",opus:"gpt-5.4",sonnet:"gpt-5.4",haiku:"gpt-5.4-mini"}},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",tier:"paid",description:"Previous flagship coding model whose capabilities now power GPT-5.4",codexMaxEffort:"xhigh",presetMapping:{default:"gpt-5.3-codex",opus:"gpt-5.3-codex",sonnet:"gpt-5.3-codex",haiku:"gpt-5.4-mini"}},{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",tier:"paid",description:"Research preview model for ChatGPT Pro subscribers, optimized for near-instant coding iteration",codexMaxEffort:"xhigh",presetMapping:{default:"gpt-5.3-codex-spark",opus:"gpt-5.3-codex",sonnet:"gpt-5.3-codex",haiku:"gpt-5.4-mini"}},{id:"gpt-5.2",name:"GPT-5.2",description:"Previous general-purpose Codex model",codexMaxEffort:"xhigh",presetMapping:{default:"gpt-5.2",opus:"gpt-5.2",sonnet:"gpt-5.2",haiku:"gpt-5.4-mini"}}]},xai:{provider:"xai",displayName:"xAI (Grok)",defaultModel:"grok-build-0.1",models:[{id:"grok-build-0.1",name:"Grok Build 0.1",description:"Fast coding model for agentic software engineering workflows",presetMapping:{default:"grok-build-0.1",opus:"grok-4.5",sonnet:"grok-build-0.1",haiku:"grok-composer-2.5-fast"}},{id:"grok-4.5",name:"Grok 4.5",description:"Frontier model for coding, engineering, and agentic workflows",reasoningLevels:["low","medium","high"]},{id:"grok-4.3",name:"Grok 4.3",description:"General-purpose Grok model with a one-million-token context window",reasoningLevels:["none","low","medium","high"]},{id:"grok-4.20-0309-reasoning",name:"Grok 4.20 0309 Reasoning",description:"Reasoning model with a two-million-token context window"},{id:"grok-4.20-0309-non-reasoning",name:"Grok 4.20 0309 Non Reasoning",description:"Non-reasoning model with a two-million-token context window"},{id:"grok-4.20-multi-agent-0309",name:"Grok 4.20 Multi Agent 0309",description:"Multi-agent model with a two-million-token context window"},{id:"grok-3-mini",name:"Grok 3 Mini",description:"Compact reasoning model"},{id:"grok-3-mini-fast",name:"Grok 3 Mini Fast",description:"Faster compact reasoning model"},{id:"grok-composer-2.5-fast",name:"Grok Composer 2.5 Fast",description:"Fast Composer model for lightweight coding tasks"}]},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"}]},qoder:{provider:"qoder",displayName:"Qoder",defaultModel:"qoder/auto",models:[{id:"qoder/auto",name:"Qoder Auto",description:"Auto selects the best Qoder model for your prompt",presetMapping:{default:"qoder/auto",opus:"qoder/auto",sonnet:"qoder/auto",haiku:"qoder/auto"}},{id:"qoder/ultimate",name:"Qoder Ultimate",description:"Highest quality Qoder tier",presetMapping:{default:"qoder/ultimate",opus:"qoder/ultimate",sonnet:"qoder/ultimate",haiku:"qoder/ultimate"}},{id:"qoder/performance",name:"Qoder Performance",description:"Balanced quality and speed",presetMapping:{default:"qoder/performance",opus:"qoder/performance",sonnet:"qoder/performance",haiku:"qoder/performance"}},{id:"qoder/efficient",name:"Qoder Efficient",description:"Cost-efficient Qoder tier",presetMapping:{default:"qoder/efficient",opus:"qoder/efficient",sonnet:"qoder/efficient",haiku:"qoder/efficient"}},{id:"qoder/lite",name:"Qoder Lite",description:"Fastest and most affordable Qoder tier",presetMapping:{default:"qoder/lite",opus:"qoder/lite",sonnet:"qoder/lite",haiku:"qoder/lite"}},{id:"qoder/qmodel",name:"Qwen 3.6 Plus (via Qoder)",description:"Qwen 3.6 Plus frontier model",presetMapping:{default:"qoder/qmodel",opus:"qoder/qmodel",sonnet:"qoder/qmodel",haiku:"qoder/qmodel"}},{id:"qoder/dmodel",name:"DeepSeek V4 Pro (via Qoder)",description:"DeepSeek V4 Pro frontier model",presetMapping:{default:"qoder/dmodel",opus:"qoder/dmodel",sonnet:"qoder/dmodel",haiku:"qoder/dfmodel"}},{id:"qoder/dfmodel",name:"DeepSeek V4 Flash (via Qoder)",description:"DeepSeek V4 Flash frontier model"},{id:"qoder/gm51model",name:"GLM 5.1 (via Qoder)",description:"GLM 5.1 frontier model",presetMapping:{default:"qoder/gm51model",opus:"qoder/gm51model",sonnet:"qoder/gm51model",haiku:"qoder/gm51model"}},{id:"qoder/kmodel",name:"Kimi K2.6 (via Qoder)",description:"Kimi K2.6 frontier model",presetMapping:{default:"qoder/kmodel",opus:"qoder/kmodel",sonnet:"qoder/kmodel",haiku:"qoder/kmodel"}},{id:"qoder/mmodel",name:"MiniMax M2.7 (via Qoder)",description:"MiniMax M2.7 frontier model",presetMapping:{default:"qoder/mmodel",opus:"qoder/mmodel",sonnet:"qoder/mmodel",haiku:"qoder/mmodel"}}]},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-5",models:[{id:"claude-sonnet-5",name:"Claude Sonnet 5",description:"Anthropic Claude Sonnet 5 via GitHub Copilot",extendedContext:!0,presetMapping:{default:"claude-sonnet-5",opus:"claude-opus-4.8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4.5"}},{id:"claude-opus-4.8",name:"Claude Opus 4.8",description:"Anthropic Claude Opus 4.8 via GitHub Copilot",extendedContext:!0,presetMapping:{default:"claude-opus-4.8",opus:"claude-opus-4.8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4.5"}},{id:"claude-opus-4.8-fast-mode",name:"Claude Opus 4.8 Fast Mode",description:"Anthropic Claude Opus 4.8 preview fast mode via GitHub Copilot",extendedContext:!0},{id:"claude-opus-4.7",name:"Claude Opus 4.7",description:"Anthropic Claude Opus 4.7 via GitHub Copilot",extendedContext:!0},{id:"claude-opus-4.6",name:"Claude Opus 4.6",description:"Anthropic Claude Opus 4.6 via GitHub Copilot",extendedContext:!0},{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.6",name:"Claude Sonnet 4.6",description:"Anthropic Claude Sonnet 4.6 via GitHub Copilot",extendedContext:!0,presetMapping:{default:"claude-sonnet-4.6",opus:"claude-opus-4.7",sonnet:"claude-sonnet-4.6",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-haiku-4.5",name:"Claude Haiku 4.5",description:"Anthropic Claude Haiku 4.5 via GitHub Copilot"},{id:"claude-fable-5",name:"Claude Fable 5",description:"Anthropic Claude Fable 5 via GitHub Copilot",extendedContext:!0},{id:"gpt-5.5",name:"GPT-5.5",description:"OpenAI GPT-5.5 via GitHub Copilot",extendedContext:!0,presetMapping:{default:"gpt-5.5",opus:"gpt-5.5",sonnet:"gpt-5.4",haiku:"gpt-5.4-mini"}},{id:"gpt-5.4",name:"GPT-5.4",description:"OpenAI GPT-5.4 via GitHub Copilot",extendedContext:!0},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",description:"OpenAI GPT-5.4 Mini via GitHub Copilot"},{id:"gpt-5.4-nano",name:"GPT-5.4 Nano",description:"OpenAI GPT-5.4 Nano via GitHub Copilot"},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",description:"OpenAI GPT-5.3 Codex via GitHub Copilot",extendedContext:!0,presetMapping:{default:"gpt-5.3-codex",opus:"gpt-5.3-codex",sonnet:"gpt-5.3-codex",haiku:"gpt-5-mini"}},{id:"gpt-5-mini",name:"GPT-5 Mini",description:"OpenAI GPT-5 Mini via GitHub Copilot"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Google Gemini 2.5 Pro via GitHub Copilot"},{id:"gemini-3-flash",name:"Gemini 3 Flash",description:"Google Gemini 3 Flash via GitHub Copilot"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",description:"Google Gemini 3.1 Pro via GitHub Copilot"},{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",description:"Google Gemini 3.5 Flash via GitHub Copilot"},{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",description:"Moonshot Kimi K2.7 Code via GitHub Copilot"},{id:"mai-code-1-flash",name:"MAI-Code-1-Flash",description:"Microsoft MAI-Code-1-Flash via GitHub Copilot"},{id:"raptor-mini",name:"Raptor Mini",description:"Microsoft Raptor Mini via GitHub Copilot"}]},claude:{provider:"claude",displayName:"Claude (Anthropic)",defaultModel:"claude-sonnet-5",models:[{id:"claude-sonnet-5",name:"Claude Sonnet 5",description:"Latest Sonnet model",extendedContext:!0,presetMapping:{default:"claude-sonnet-5",opus:"claude-opus-4-8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-fable-5",name:"Claude Fable 5",description:"Most powerful model",extendedContext:!0,presetMapping:{default:"claude-fable-5",opus:"claude-fable-5",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-5",name:"Claude Opus 5",description:"Latest premium model",extendedContext:!0,presetMapping:{default:"claude-opus-5",opus:"claude-opus-5",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-4-8",name:"Claude Opus 4.8",description:"Latest flagship model",extendedContext:!0,presetMapping:{default:"claude-opus-4-8",opus:"claude-opus-4-8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-4-7",name:"Claude Opus 4.7",description:"Previous flagship model",extendedContext:!0,presetMapping:{default:"claude-opus-4-7",opus:"claude-opus-4-7",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5-20251001"}},{id:"claude-opus-4-6",name:"Claude Opus 4.6",description:"Older 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 Re(t,a){if(!t)return;const s=$(a);if(t.provider==="agy"){const d=Va(s);if(d){const c=t.models.find(r=>r.id===d);if(c)return c}}const n=As[s.toLowerCase()],i=t.models.find(d=>d.id===s||d.id===n);if(i)return i;const o=dt(s);if(o)return t.models.map(d=>({model:d,info:dt(d.id)})).filter(d=>!!(d.info&&d.info.family===o.family)).sort((d,c)=>Ss(c.info.version,d.info.version))[0]?.model}function Wa(t){if(t==="free")return"free";if(typeof t=="string"&&t.trim().length>0)return"paid"}function Ja(t,a){const s=t.toLowerCase(),n=ke[s];if(!a||a.models.length===0)return n;const i=a.models.map(l=>({id:l.id,owned_by:a.provider})),o=a.models.map(l=>{const g=Re(n,l.id);return{...l,name:l.name||g?.name||l.id,tier:g?.tier??Wa(l.tier),description:l.description??g?.description,broken:g?.broken,issueUrl:g?.issueUrl,deprecated:g?.deprecated,deprecationReason:g?.deprecationReason,extendedContext:s==="xai"?void 0:l.extendedContext??g?.extendedContext,presetMapping:g?.presetMapping,reasoningLevels:l.reasoningLevels??g?.reasoningLevels,codexMaxEffort:l.codexMaxEffort??g?.codexMaxEffort,codexEfforts:l.codexEfforts??g?.codexEfforts,codexServiceTiers:l.codexServiceTiers??g?.codexServiceTiers}}),d=n?.defaultModel?Ie(n.defaultModel,i):void 0,c=typeof d=="string"&&i.some(l=>$(l.id)===$(d)),r=i.some(l=>$(l.id)===$(a.defaultModel)),m=c?d:r?a.defaultModel:o[0]?.id??"";return{provider:a.provider,displayName:a.displayName||n?.displayName||t,defaultModel:m,models:o}}function Ht(t){const a={},s=new Set([...Object.keys(ke),...Object.keys(t??{})]);for(const n of s){const i=Ja(n,t?.[n]);i&&(a[n]=i)}return a}function ze(t,a,s){const n=Re(s,a);return n||Re(ke[t.toLowerCase()],a)}function Ie(t,a=[]){const s=$(t),n=Qa(s,a);if(n)return n;const i=as(a,s);if(i)return i;const o=As[s];return(o?as(a,o):void 0)??s}function Xa(t,a=[]){return{default:Ie(t.default,a),opus:Ie(t.opus,a),sonnet:Ie(t.sonnet,a),haiku:Ie(t.haiku,a)}}function zt(t,a=[]){if(!t)return[];const s=ke[t.provider.toLowerCase()]??t,n=new Set;return s.models.map(i=>{const o=Ie(i.id,a),d=i.presetMapping?Xa(i.presetMapping,a):void 0,c=t.models.find(r=>$(r.id)===$(o));return{...i,id:o,name:c?.name||i.name,description:c?.description??i.description,presetMapping:d}}).filter(i=>n.has(i.id)?!1:(n.add(i.id),!0))}function Ya(t,a,s=[]){const n=t.trim().toLowerCase();if(!a||!n)return[];const i=ke[n]??a,o=zt(a,s),d=new Set(o.map(l=>$(l.id))),c=new Set(o.map(l=>Re(i,l.id)?.id).filter(l=>!!l).map(l=>$(l))),r=new Set,m=new Set(s.map(l=>$(l.id)));return s.filter(l=>{const g=$(l.id),h=za(l.id),b=Ba(h),k=Re(i,h)??Re(i,b);if(d.has($(h))||g!==$(h)&&m.has($(h)))return!1;const C=$(b);if(C!==$(h)&&m.has(C))return!1;const L=k?$(k.id):C;return k&&c.has(L)||r.has(L)||!k&&n==="agy"?!1:(r.add(L),!0)})}function Za(t,a,s){return t.toLowerCase()==="xai"?!1:ze(t,a,s)?.extendedContext===!0}const vt="ccs-internal-managed";async function en(){try{const t=await fetch("/api/settings/auth/tokens/raw");return t.ok?(await t.json())?.apiKey?.value??vt:vt}catch{return vt}}async function tn(t,a){if(a)return a;try{const s=await fetch("/api/cliproxy/catalog");if(!s.ok)return ke[t];const n=await s.json();return Ht(n.catalogs)[t]??ke[t]}catch{return ke[t]}}async function St(t,a,s){const n=await tn(t,s);if(!n)return{success:!1};const i=n.models.find(l=>l.id===n.defaultModel)||n.models[0],o=i?.id??n.defaultModel,d=i?.presetMapping||{default:o,opus:o,sonnet:o,haiku:o},c=await en(),m={env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${At}/api/provider/${t}`,ANTHROPIC_AUTH_TOKEN:c,ANTHROPIC_MODEL:d.default,ANTHROPIC_DEFAULT_OPUS_MODEL:d.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:d.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:d.haiku}};try{return{success:(await fetch(`/api/settings/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:m})})).ok,presetName:i?.name||n.defaultModel}}catch{return{success:!1}}}function sn({currentProgress:t,allSteps:a}){return e.jsx("div",{className:"flex justify-center gap-1 pt-2",children:a.map((s,n)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${t>=n?"bg-primary":"bg-muted"}`},s))})}function an({providers:t,onSelect:a}){return e.jsx("div",{className:"grid gap-2",children:t.map(s=>e.jsxs("button",{onClick:()=>a(s.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:s.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.description})]}),e.jsx(vs,{className:"w-4 h-4 text-muted-foreground"})]},s.id))})}function nn({selectedProvider:t,providers:a,authCommand:s,isRefreshing:n,isPending:i,onBack:o,onStartAuth:d,onRefresh:c}){const{t:r}=Q(),[m,l]=u.useState(!1),g=async h=>{await navigator.clipboard.writeText(h),l(!0),setTimeout(()=>l(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:r("setupWizard.authStep.authenticateWith",{provider:a.find(h=>h.id===t)?.name})}),e.jsx(G,{onClick:d,disabled:i,className:"w-full gap-2",size:"lg",children:i?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 animate-spin"}),r("setupWizard.authStep.authenticating")]}):e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"w-4 h-4"}),r("setupWizard.authStep.authenticateInBrowser")]})}),i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:r("setupWizard.authStep.completeOAuth")})]}),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:r("setupWizard.authStep.orUseTerminal")})})]}),e.jsx(ds,{children:e.jsxs(ls,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ma,{className:"w-4 h-4"}),r("setupWizard.authStep.runCommandHint")]}),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:s}),e.jsx(G,{variant:"outline",size:"icon",onClick:()=>g(s),children:m?e.jsx(Pe,{className:"w-4 h-4 text-green-500"}):e.jsx(js,{className:"w-4 h-4"})})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(G,{variant:"ghost",onClick:o,disabled:i,children:[e.jsx(Ft,{className:"w-4 h-4 mr-2"}),r("setupWizard.authStep.back")]}),e.jsxs(G,{variant:"outline",onClick:c,disabled:n||i,children:[e.jsx(lt,{className:`w-4 h-4 mr-2 ${n?"animate-spin":""}`}),r(n?"setupWizard.authStep.checking":"setupWizard.authStep.refreshStatus")]})]})]})}function rn({accounts:t,privacyMode:a,onSelect:s,onAddNew:n,onBack:i}){const{t:o}=Q();return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:o("setupWizard.accountStep.selectAccount",{count:t.length})}),e.jsx("div",{className:"grid gap-2 max-h-[320px] overflow-y-auto pr-1",children:t.map(d=>{const c=cs(d.id,d.email,d.tokenFile),r=d.provider?.toLowerCase()==="codex"?us(c):null;return e.jsxs("button",{type:"button",onClick:()=>s(d),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:W("font-medium",a&&Ne),children:c.email}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[r?.label?e.jsx(H,{variant:"outline",className:W("text-[10px] h-4 px-1.5 border-transparent",a&&Ne,r.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":r.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:r.label}):c.audienceLabel?e.jsx(H,{variant:"outline",className:W("text-[10px] h-4 px-1.5 border-transparent",a&&Ne,c.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":c.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:c.audienceLabel}):null,!r?.label&&c.detailLabel&&e.jsx(H,{variant:"outline",className:W("text-[10px] h-4 px-1.5",a&&Ne),children:c.detailLabel}),d.isDefault&&e.jsx("span",{className:"text-xs text-muted-foreground",children:o("setupWizard.accountStep.defaultAccount")})]})]})]}),e.jsx(vs,{className:"w-4 h-4 text-muted-foreground"})]},d.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:o("setupWizard.accountStep.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(Me,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-primary",children:o("setupWizard.accountStep.addNewAccount")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:o("setupWizard.accountStep.addNewAccountDesc")})]})]}),e.jsx("div",{className:"flex items-center justify-between pt-2",children:e.jsxs(G,{variant:"ghost",onClick:i,children:[e.jsx(Ft,{className:"w-4 h-4 mr-2"}),o("setupWizard.accountStep.back")]})})]})}const ns="__custom__";function on({selectedProvider:t,catalog:a,selectedAccount:s,variantName:n,modelName:i,isPending:o,privacyMode:d,onVariantNameChange:c,onModelChange:r,onBack:m,onSkip:l,onCreate:g}){const{t:h}=Q(),b=a||ke[t],k=b?.models||[],C=i&&!k.some(v=>v.id===i),[L,P]=u.useState(C),S=t==="agy"&&i.trim().length>0?he(i):!1,A=s?cs(s.id,s.email,s.tokenFile):null,j=t==="codex"&&A?us(A):null,D=v=>{v===ns?(P(!0),r("")):(P(!1),r(v))};return e.jsxs("div",{className:"space-y-4",children:[s&&e.jsxs("div",{className:"flex min-w-0 items-start gap-2 rounded-md bg-muted/50 p-2 text-sm",children:[e.jsx(Ke,{className:"w-4 h-4 shrink-0"}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("span",{children:[h("setupVariant.using")," ",e.jsx("span",{className:W("break-all",d&&Ne),children:A?.email})]}),(A?.audienceLabel||A?.detailLabel)&&e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[j?.label?e.jsx(H,{variant:"outline",className:W("text-[10px] h-4 px-1.5 border-transparent",d&&Ne,j.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":j.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:j.label}):A?.audienceLabel?e.jsx(H,{variant:"outline",className:W("text-[10px] h-4 px-1.5 border-transparent",d&&Ne,A.audience==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":A.audience==="free"?"bg-slate-200/70 text-slate-700 dark:bg-slate-700/40 dark:text-slate-200":"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"),children:A.audienceLabel}):null,!j?.label&&A?.detailLabel&&e.jsx(H,{variant:"outline",className:W("text-[10px] h-4 px-1.5",d&&Ne),children:A.detailLabel})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"variant-name",children:h("setupVariant.variantNameRequired")}),e.jsx(ce,{id:"variant-name",value:n,onChange:v=>c(v.target.value),placeholder:h("setupVariant.variantNamePlaceholder")}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[h("setupVariant.invokeHintPrefix")," ccs ",n||"<name>",' "prompt"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{children:h("setupVariant.model")}),L?e.jsxs("div",{className:"space-y-2",children:[e.jsx(ce,{value:i,onChange:v=>r(v.target.value),placeholder:h("setupVariant.modelPlaceholder")}),S&&e.jsx("p",{className:"text-xs text-destructive",children:h("providerEditor.agyDenylist")}),e.jsx("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>{P(!1),t==="agy"&&he(i)&&r("")},children:h("setupVariant.choosePresetInstead")})]}):e.jsxs(_e,{value:k.some(v=>v.id===i)?i:"",onValueChange:D,children:[e.jsx(Fe,{className:"min-w-0",children:e.jsx(qe,{placeholder:h("setupVariant.selectModel")})}),e.jsxs(Ue,{className:"max-w-[calc(100vw-2rem)]",children:[k.map(v=>e.jsx(je,{value:v.id,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate",children:v.name}),v.description&&e.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["- ",v.description]})]})},v.id)),e.jsx(je,{value:ns,children:e.jsx("span",{className:"text-primary",children:h("setupVariant.customModelName")})})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:L?h("setupVariant.enterAnyModel"):h("setupVariant.defaultModel",{model:b?.defaultModel||h("setupVariant.providerDefault")})})]}),e.jsxs("div",{className:"flex flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(G,{variant:"ghost",onClick:m,className:"justify-start",children:[e.jsx(Ft,{className:"w-4 h-4 mr-2"}),h("setupVariant.back")]}),e.jsxs("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center",children:[e.jsx(G,{variant:"ghost",onClick:l,children:h("setupVariant.skip")}),e.jsx(G,{onClick:g,disabled:!n||o||S,children:h(o?"setupVariant.creating":"setupVariant.createVariant")})]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:h("setupVariant.skipHint")})]})}function dn({variantName:t,onClose:a}){const{t:s}=Q();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(Pe,{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:s("setupWizard.successStep.title")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("setupWizard.successStep.subtitle")})]}),e.jsx(ds,{children:e.jsxs(ls,{className:"p-4 space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s("setupWizard.successStep.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(G,{onClick:a,className:"w-full",children:s("setupWizard.successStep.done")})]})}function ln({open:t,onClose:a}){const[s,n]=u.useState("provider"),[i,o]=u.useState(""),[d,c]=u.useState(null),[r,m]=u.useState(""),[l,g]=u.useState(""),[h,b]=u.useState(!1),[k,C]=u.useState(!1),{data:L,refetch:P}=ms(),{data:S}=ps(),A=_s(),j=Fs(),D=qs(),{privacyMode:v}=xs(),I=L?.authStatus.find(y=>y.provider===i),T=u.useMemo(()=>I?.accounts||[],[I?.accounts]),x=u.useMemo(()=>Ht(S?.catalogs),[S?.catalogs]),R=!!S;u.useEffect(()=>{if(!t){const y=setTimeout(()=>{n("provider"),o(""),c(null),m(""),g(""),C(!1)},0);return()=>clearTimeout(y)}},[t]),u.useEffect(()=>{if(s==="auth"&&T.length>0&&!k){const y=setTimeout(()=>{n("account")},0);return()=>clearTimeout(y)}},[s,T,k]);const M=async()=>{b(!0),await P(),b(!1)},B=()=>{const y=(I?.accounts?.length||0)===0;j.mutate({provider:i},{onSuccess:async Y=>{if(y){const N=await St(i,void 0,R?x[i]:void 0);N.success&&N.presetName?V.success(`Applied "${N.presetName}" preset`):N.success||V.warning(fe.t("commonToast.accountAddedPresetFailed"))}Y.account&&(c(Y.account),n("variant")),P()}})},p=y=>{o(y),(L?.authStatus.find(te=>te.provider===y)?.accounts||[]).length===0?n("auth"):n("account")},w=y=>{c(y),n("variant")},z=async()=>{if(!(!r||!i))try{await A.mutateAsync({name:r,provider:i,model:l||void 0,account:d?.id}),n("success")}catch(y){console.error("Failed to create variant:",y)}},_=`ccs ${i} --auth --add`,O=Gs(s),F=y=>{if(!y&&(j.isPending&&i&&D.mutate(i),s==="success"||s==="provider")){a();return}};return e.jsx(Dt,{open:t,onOpenChange:F,children:e.jsxs(Et,{className:"grid max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-lg grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden p-0 sm:max-w-lg",onPointerDownOutside:y=>{s!=="success"&&s!=="provider"&&y.preventDefault()},onEscapeKeyDown:y=>{(j.isPending||A.isPending)&&y.preventDefault()},children:[e.jsxs(It,{className:"min-w-0 px-6 pt-6 pr-12",children:[e.jsxs(Rt,{className:"flex min-w-0 items-center gap-2",children:[e.jsx(qt,{className:"w-5 h-5 text-primary"}),fe.t("setupWizard.title")]}),e.jsxs(hs,{children:[s==="provider"&&fe.t("setupWizard.stepProviderDesc"),s==="auth"&&fe.t("setupWizard.stepAuthDesc"),s==="account"&&fe.t("setupWizard.stepAccountDesc"),s==="variant"&&fe.t("setupWizard.stepVariantDesc"),s==="success"&&fe.t("setupWizard.stepSuccessDesc")]})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto px-6 py-4",children:[s==="provider"&&e.jsx(an,{providers:Qt,onSelect:p}),s==="auth"&&e.jsx(nn,{selectedProvider:i,providers:Qt,authCommand:_,isRefreshing:h,isPending:j.isPending,onBack:()=>n("provider"),onStartAuth:B,onRefresh:M}),s==="account"&&e.jsx(rn,{accounts:T,privacyMode:v,onSelect:w,onAddNew:()=>{C(!0),n("auth")},onBack:()=>n("provider")}),s==="variant"&&e.jsx(on,{selectedProvider:i,catalog:x[i],selectedAccount:d,variantName:r,modelName:l,isPending:A.isPending,privacyMode:v,onVariantNameChange:m,onModelChange:g,onBack:()=>T.length>0?n("account"):n("provider"),onSkip:a,onCreate:z}),s==="success"&&e.jsx(dn,{variantName:r,onClose:a})]}),e.jsx("div",{className:"px-6 pb-6",children:e.jsx(sn,{currentProgress:O,allSteps:Us})})]})})}const cn=3e3,un=300*1e3,mn=3;function jt(t){t.invalidateQueries({queryKey:["cliproxy-catalog"]}),t.invalidateQueries({queryKey:["cliproxy-models"]})}async function bt(t){const a=await t.text();if(!a)return{};try{return JSON.parse(a)}catch{const s=t.status>=400?`Request failed with status ${t.status}`:void 0;return s?{error:s}:{}}}function pn(t,a){const s=typeof t.message=="string"?t.message:typeof t.error=="string"?t.error:a,n=Array.isArray(t.hints)?t.hints.filter(i=>typeof i=="string"&&i.trim().length>0):[];return n.length>0?[s,...n].join(`
|
|
2
|
-
`):s}const we={provider:null,isAuthenticating:!1,error:null,authUrl:null,oauthState:null,isSubmittingCallback:!1,isDeviceCodeFlow:!1};function xn(){const{t}=Q(),[a,s]=u.useState(we),n=u.useRef(we),i=u.useRef(0),o=u.useRef(null),d=u.useRef(null),c=u.useRef(0),r=u.useRef(0),m=u.useRef(!1),l=Tt(),g=u.useCallback(P=>P===i.current,[]),h=u.useCallback(()=>{d.current&&(clearInterval(d.current),d.current=null),r.current=0},[]);u.useEffect(()=>()=>{o.current?.abort(),h(),m.current=!1},[h]),u.useEffect(()=>{n.current=a},[a]);const b=u.useCallback(async(P,S,A)=>{if(g(A)){if(Date.now()-c.current>un){h(),g(A)&&s(j=>({...j,isAuthenticating:!1,error:t("toasts.providerAuthTimeout")}));return}try{const j=await fetch(`/api/cliproxy/auth/${P}/status?state=${encodeURIComponent(S)}`);if(!g(A))return;const D=await j.json();if(r.current=0,D.status==="ok"){if(!(typeof D.account=="object"&&D.account!==null)){h();const I=t("toasts.providerAccountRegistrationFailed");V.error(I),s(T=>({...T,isAuthenticating:!1,error:I}));return}h(),l.invalidateQueries({queryKey:["cliproxy-auth"]}),l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["account-quota"]}),jt(l),V.success(t("toasts.providerAuthSuccess",{provider:P})),m.current=!1,s(we)}else if(D.status==="auth_url"){const v=D.url||D.auth_url;v&&(s(I=>({...I,authUrl:v})),m.current||(m.current=!0,window.open(v,"_blank")))}else if(D.status==="device_code"){h();const v=D.user_code&&D.verification_url?`Open ${D.verification_url} and enter code: ${D.user_code}`:"Switch to Device Code method and try again.";V.error(t("toasts.providerDeviceCodeInCallback")),s(I=>({...I,isAuthenticating:!1,error:v}))}else if(D.status==="error"){h();const v=D.error||"Authentication failed";V.error(v),s(I=>({...I,isAuthenticating:!1,error:v}))}}catch(j){if(!g(A)||(r.current+=1,r.current<mn))return;h();const D=j instanceof Error&&j.message.trim().length>0?j.message:t("toasts.providerLostStatusEndpoint");V.error(D),s(v=>({...v,isAuthenticating:!1,error:D}))}}},[g,l,h,t]),k=u.useCallback(async(P,S)=>{if(!Ge(P)){s({...we,error:t("toasts.providerUnknown",{provider:P})});return}o.current?.abort(),h(),m.current=!1,r.current=0;const A=new AbortController,j=i.current+1;i.current=j,o.current=A;const v=(S?.flowType||(fs(P)?"device_code":"authorization_code"))==="device_code",I=S?.startEndpoint||(v?"start":"start-url"),T={accountId:S?.accountId,nickname:S?.nickname,kiroMethod:S?.kiroMethod,kiroIDCStartUrl:S?.kiroIDCStartUrl,kiroIDCRegion:S?.kiroIDCRegion,kiroIDCFlow:S?.kiroIDCFlow,gitlabAuthMode:S?.gitlabAuthMode,gitlabBaseUrl:S?.gitlabBaseUrl,gitlabPersonalAccessToken:S?.gitlabPersonalAccessToken,riskAcknowledgement:S?.riskAcknowledgement};s({provider:P,isAuthenticating:!0,error:null,authUrl:null,oauthState:null,isSubmittingCallback:!1,isDeviceCodeFlow:v});try{if(I==="start")fetch(`/api/cliproxy/auth/${P}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T),signal:A.signal}).then(async x=>{if(!g(j))return;const R=await bt(x);if(!g(j))return;const M=R.success===!0,B=typeof R.account=="object"&&R.account!==null;if(x.ok&&M&&B)l.invalidateQueries({queryKey:["cliproxy-auth"]}),l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["account-quota"]}),jt(l),m.current=!1,s(we);else{const p=typeof R.error=="string"?R.error:t(M?"toasts.providerAccountRegistrationFailed":"auth.loginFailed");V.error(p),s(w=>({...w,isAuthenticating:!1,error:p}))}}).catch(x=>{if(!g(j)||x instanceof Error&&x.name==="AbortError")return;const R=x instanceof Error?x.message:"Authentication failed";V.error(R),s(M=>({...M,isAuthenticating:!1,error:R}))});else{const x=await fetch(`/api/cliproxy/auth/${P}/start-url`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T),signal:A.signal});if(!g(j))return;const R=await bt(x);if(!g(j))return;const M=R.success===!0;if(!x.ok||!M){const w=pn(R,t("toasts.providerStartOAuthFailed"));throw new Error(w)}const B=typeof R.authUrl=="string"?R.authUrl:null,p=typeof R.state=="string"?R.state:null;if(s(w=>({...w,authUrl:B,oauthState:p})),B&&(m.current=!0,window.open(B,"_blank")),p){if(c.current=Date.now(),!B){if(await b(P,p,j),!g(j))return;const w=n.current;if(!w.isAuthenticating||w.provider!==P)return}d.current=setInterval(()=>{b(P,p,j)},cn)}}}catch(x){if(!g(j))return;if(x instanceof Error&&x.name==="AbortError"){m.current=!1,s(we);return}const R=x instanceof Error?x.message:t("auth.loginFailed");V.error(R),s(M=>({...M,isAuthenticating:!1,error:R}))}},[g,b,h,l,t]),C=u.useCallback(()=>{const P=a.provider;i.current+=1,o.current?.abort(),h(),m.current=!1,s(we),P&&st.cliproxy.auth.cancel(P).catch(()=>{})},[a.provider,h]),L=u.useCallback(async P=>{if(!a.provider)return;const S=i.current,A=a.provider;s(j=>({...j,isSubmittingCallback:!0,error:null}));try{const j=await fetch(`/api/cliproxy/auth/${A}/submit-callback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUrl:P})});if(!g(S))return;const D=await bt(j);if(!g(S))return;const v=D.success===!0,I=D.status==="wait",T=typeof D.account=="object"&&D.account!==null;if(j.ok&&I)s(x=>({...x,isSubmittingCallback:!1,error:null}));else if(j.ok&&v&&T)h(),l.invalidateQueries({queryKey:["cliproxy-auth"]}),l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["account-quota"]}),jt(l),V.success(t("toasts.providerAuthSuccess",{provider:A})),s(we);else{const x=typeof D.error=="string"?D.error:t(v?"toasts.providerAccountRegistrationFailed":"toasts.providerCallbackFailed");throw new Error(x)}}catch(j){if(!g(S))return;const D=j instanceof Error?j.message:t("toasts.providerSubmitCallbackFailed");V.error(D),s(v=>({...v,isSubmittingCallback:!1,error:D}))}},[g,a.provider,l,h,t]);return u.useMemo(()=>({...a,startAuth:k,cancelAuth:C,submitCallback:L}),[a,k,C,L])}function Mt({className:t,compact:a=!1,showAcknowledgement:s=!1,acknowledgementPhrase:n=at,acknowledgementText:i="",onAcknowledgementTextChange:o,disabled:d=!1,showProxySettingsLink:c=!1}){const{t:r}=Q(),m=r("accountSafetyWarning.title"),l=r("accountSafetyWarning.subtitle"),g=r("accountSafetyWarning.firstLine"),h=r("accountSafetyWarning.secondLine"),b="https://github.com/kaitranntt/ccs/issues/509",k=r("accountSafetyWarning.issueLabel"),C=r("accountSafetyWarning.proxySettingsLabel");return a?e.jsx("section",{role:"alert",className:W("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(rt,{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:l})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:g}),e.jsx("p",{className:"text-xs font-medium leading-5 text-amber-900 dark:text-amber-200",children:h})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 lg:justify-end",children:[e.jsxs("a",{href:b,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:[k,e.jsx(Me,{className:"h-3 w-3"})]}),c?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(ts,{className:"h-3 w-3"}),C]}):null,e.jsx(H,{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:W("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(rt,{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:l})]})]}),e.jsx(H,{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:g}),e.jsx("p",{className:"font-medium text-amber-900 dark:text-amber-200",children:h}),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:b,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:[k,e.jsx(Me,{className:"h-3.5 w-3.5"})]}),c&&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(ts,{className:"h-3.5 w-3.5"}),C]}),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"})]}),s&&o&&e.jsxs("div",{className:"rounded-lg border border-amber-500/25 bg-amber-500/5 p-2.5",children:[e.jsxs(ee,{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:L=>o(L.target.value),placeholder:n,disabled:d,className:"mt-2 font-mono text-xs"})]})]})]})}function hn({className:t,value:a,onChange:s,disabled:n=!1}){const{t:i}=Q(),o=[a.reviewedIssue509,a.understandsBanRisk,a.acceptsFullResponsibility,a.typedPhrase.trim().replace(/\s+/g," ").toUpperCase()===ss].filter(Boolean).length,d=o/4*100,c=r=>{s({...a,...r})};return e.jsxs("section",{role:"alert",className:W("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(rt,{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(H,{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(Ks,{value:d,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(nt,{id:"agy-step-reviewed-issue",checked:a.reviewedIssue509,onCheckedChange:r=>c({reviewedIssue509:!!r}),disabled:n}),e.jsx(ee,{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(nt,{id:"agy-step-understands-risk",checked:a.understandsBanRisk,onCheckedChange:r=>c({understandsBanRisk:!!r}),disabled:n}),e.jsx(ee,{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(nt,{id:"agy-step-accept-responsibility",checked:a.acceptsFullResponsibility,onCheckedChange:r=>c({acceptsFullResponsibility:!!r}),disabled:n}),e.jsx(ee,{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(bs,{className:"h-3.5 w-3.5"}),"Step 4: Type exact phrase to continue"]}),e.jsx(ce,{value:a.typedPhrase,onChange:r=>c({typedPhrase:r.target.value}),placeholder:ss,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(Me,{className:"h-3.5 w-3.5"})]})})]})]})}function fn(t){return t.trim().replace(/\s+/g," ").toUpperCase()}function gn({open:t,onClose:a,provider:s,displayName:n,catalog:i,account:o,isFirstAccount:d=!1}){const[c,r]=u.useState(""),[m,l]=u.useState(""),[g,h]=u.useState(!1),[b,k]=u.useState(null),[C,L]=u.useState(""),[P,S]=u.useState(gt),[A,j]=u.useState(!1),[D,v]=u.useState(!1),[I,T]=u.useState(Wt),[x,R]=u.useState(""),[M,B]=u.useState(""),[p,w]=u.useState(Jt),[z,_]=u.useState("oauth"),[O,F]=u.useState(""),[y,Y]=u.useState(""),{t:N}=Q(),te=u.useRef(!1),se=u.useRef(0),me=u.useRef(!1),K=xn(),ie=Hs(),X=s==="kiro",Z=s==="gitlab",ae=s==="agy"||s==="gemini",pe=s==="gemini"&&!A,ge=s==="agy"&&!A,Ae=ae&&D,Se=La(P),f=fn(C)===at,q=fs(s),ye=zs(I),xe=X&&I==="idc",oe=X&&Vs(I),Te=X?Bs(I,p):void 0,Ve=X?Qs(I):void 0,mt=X?Te==="device_code":q,de=K.isAuthenticating||ie.isPending,pt=c.trim(),Oe=x.trim(),$e=M.trim(),Qe=O.trim(),Le=y.trim(),U=b||K.error,J=!!o,le=o?.email||o?.nickname||o?.id||n,De=u.useCallback(async()=>{const E=await fetch("/api/settings/auth/antigravity-risk");if(!E.ok)throw new Error("Failed to load power user mode setting");return(await E.json()).antigravityAckBypass===!0},[]),We=u.useCallback(async({pendingMessage:E=null,disabledMessage:ve=null}={})=>{const ht=++se.current;v(!0),E!==null&&k(E);try{const Je=await De();return se.current!==ht||(j(Je),ve?k(Je?null:ve):E!==null&&k(null)),Je}catch{return se.current!==ht||(j(!1),k(ve??N("addAccountDialog.powerUserLoadFailed")),me.current||(me.current=!0,V.error(N("addAccountDialog.powerUserLoadFailed")))),!1}finally{se.current===ht&&v(!1)}},[De,N]),xt=()=>{r(""),l(""),h(!1),k(null),L(""),S(gt),j(!1),v(!1),T(Wt),R(""),B(""),w(Jt),_("oauth"),F(""),Y(""),se.current+=1,me.current=!1,te.current=!1,a()};u.useEffect(()=>{t&&(L(""),S(gt),k(null))},[s,t]),u.useEffect(()=>()=>{se.current+=1},[]),u.useEffect(()=>{if(!t||!ae){se.current+=1,j(!1),v(!1);return}We()},[t,s,ae,We]),u.useEffect(()=>{if(!t||s!=="agy"||!K.error||!A)return;const E=K.error.toLowerCase();(E.includes("agy_risk_ack_required")||E.includes("responsibility acknowledgement")||E.includes("responsibility checklist"))&&We({pendingMessage:N("addAccountDialog.powerUserLoading"),disabledMessage:N("addAccountDialog.powerUserUnavailableRetry")})},[K.error,t,A,s,We,N]),u.useEffect(()=>{!K.isAuthenticating&&!K.error&&K.provider===null&&t&&te.current&&(te.current=!1,(async()=>{try{const ve=await St(s,void 0,i);ve.success&&ve.presetName&&d&&V.success(`Applied "${ve.presetName}" preset`)}catch{}xt()})())},[K.isAuthenticating,K.error,K.provider]);const $t=()=>{K.cancelAuth(),xt()},Ts=async()=>{K.authUrl&&(await navigator.clipboard.writeText(K.authUrl),h(!0),setTimeout(()=>h(!1),2e3))},Ds=()=>{m.trim()&&K.submitCallback(m.trim())},Es=()=>{if(Ae){k(N("addAccountDialog.powerUserLoading"));return}if(ge&&!Se){k("Complete all Antigravity responsibility steps before authenticating this provider.");return}if(pe&&!f){k(`Type "${at}" to acknowledge the account safety warning before authenticating this provider.`);return}if(k(null),xe&&!Oe){k("IDC Start URL is required for Kiro IAM Identity Center login.");return}if(Z&&z==="pat"&&!Le){k(N("addAccountDialog.gitlabPatRequired"));return}te.current=!0,K.startAuth(s,{accountId:o?.id,nickname:o?o.nickname:pt||void 0,kiroMethod:X?I:void 0,kiroIDCStartUrl:xe?Oe:void 0,kiroIDCRegion:xe&&$e?$e:void 0,kiroIDCFlow:xe?p:void 0,gitlabAuthMode:Z?z:void 0,gitlabBaseUrl:Z&&Qe?Qe:void 0,gitlabPersonalAccessToken:Z&&z==="pat"&&Le?Le:void 0,flowType:X?Te:void 0,startEndpoint:X?Ve:Z&&z==="pat"?"start":void 0,riskAcknowledgement:ge?{version:_a,reviewedIssue509:P.reviewedIssue509,understandsBanRisk:P.understandsBanRisk,acceptsFullResponsibility:P.acceptsFullResponsibility,typedPhrase:P.typedPhrase}:void 0})},Is=()=>{te.current=!0,ie.mutate(void 0,{onSuccess:async()=>{const E=await St("kiro",void 0,i);E.success&&E.presetName&&d&&V.success(`Applied "${E.presetName}" preset`),xt()}})},Rs=E=>{E||$t()},re=K.isAuthenticating;return e.jsx(Dt,{open:t,onOpenChange:Rs,children:e.jsxs(Et,{className:"grid max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-md grid-rows-[auto_minmax(0,1fr)] overflow-hidden p-0 sm:max-w-md",onInteractOutside:E=>{re&&E.preventDefault()},children:[e.jsxs(It,{className:"min-w-0 px-6 pt-6 pr-12",children:[e.jsx(Rt,{children:J?`Reauthenticate ${n}`:N("addAccountDialog.title",{displayName:n})}),e.jsx(hs,{children:J?`Refresh credentials for ${le}.`:N(X?"addAccountDialog.descKiro":mt?"addAccountDialog.descDeviceCode":"addAccountDialog.descOauth")})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto px-6 py-4",children:[ge&&!re&&e.jsx(hn,{value:P,onChange:E=>{S(E),k(null)},disabled:de}),ae&&A&&!re&&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(bs,{className:"h-3.5 w-3.5"}),N("addAccountDialog.powerUserEnabled")]}),N("addAccountDialog.powerUserSkipped")]}),pe&&!re&&e.jsx(Mt,{showAcknowledgement:!0,acknowledgementPhrase:at,acknowledgementText:C,onAcknowledgementTextChange:E=>{L(E),k(null)},disabled:de}),X&&!re&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"kiro-auth-method",children:N("addAccountDialog.authMethod")}),e.jsxs(_e,{value:I,onValueChange:E=>{T(E),k(null)},children:[e.jsx(Fe,{id:"kiro-auth-method",children:e.jsx(qe,{placeholder:N("addAccountDialog.selectKiroAuthMethod")})}),e.jsx(Ue,{children:$s.map(E=>e.jsx(je,{value:E.id,children:E.label},E.id))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:ye.description}),oe&&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."]})]}),xe&&!re&&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(ee,{htmlFor:"kiro-idc-start-url",children:"IDC Start URL"}),e.jsx(ce,{id:"kiro-idc-start-url",value:x,onChange:E=>{R(E.target.value),k(null)},placeholder:"https://d-xxx.awsapps.com/start",disabled:de}),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(ee,{htmlFor:"kiro-idc-region",children:"IDC Region"}),e.jsx(ce,{id:"kiro-idc-region",value:M,onChange:E=>{B(E.target.value),k(null)},placeholder:"us-east-1",disabled:de}),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(ee,{htmlFor:"kiro-idc-flow",children:"IDC Flow"}),e.jsxs(_e,{value:p,onValueChange:E=>{w(E),k(null)},children:[e.jsx(Fe,{id:"kiro-idc-flow",children:e.jsx(qe,{placeholder:"{/* TODO i18n: missing key */}Select IDC flow"})}),e.jsxs(Ue,{children:[e.jsx(je,{value:"authcode",children:"Authorization Code"}),e.jsx(je,{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."})]})]}),Z&&!re&&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(ee,{htmlFor:"gitlab-auth-mode",children:N("addAccountDialog.gitlabAuthMethod")}),e.jsxs(_e,{value:z,onValueChange:E=>{_(E),k(null)},children:[e.jsx(Fe,{id:"gitlab-auth-mode",children:e.jsx(qe,{placeholder:N("addAccountDialog.selectGitlabAuthMethod")})}),e.jsxs(Ue,{children:[e.jsx(je,{value:"oauth",children:N("addAccountDialog.gitlabAuthOAuth")}),e.jsx(je,{value:"pat",children:N("addAccountDialog.gitlabAuthPat")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:N("addAccountDialog.gitlabAuthHint")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"gitlab-base-url",children:N("addAccountDialog.gitlabUrl")}),e.jsx(ce,{id:"gitlab-base-url",value:O,onChange:E=>{F(E.target.value),k(null)},placeholder:N("addAccountDialog.gitlabUrlPlaceholder"),disabled:de}),e.jsx("p",{className:"text-xs text-muted-foreground",children:N("addAccountDialog.gitlabUrlHint")})]}),z==="pat"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"gitlab-pat",children:N("addAccountDialog.gitlabPat")}),e.jsx(ce,{id:"gitlab-pat",type:"password",value:y,onChange:E=>{Y(E.target.value),k(null)},placeholder:N("addAccountDialog.gitlabPatPlaceholder"),disabled:de}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[N("addAccountDialog.gitlabPatHint")," ",e.jsx("span",{className:"font-mono",children:"api"})," and"," ",e.jsx("span",{className:"font-mono",children:"read_user"})," scopes."]})]})]}),!re&&J&&e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2 text-sm",children:[e.jsx("div",{className:"font-medium",children:le}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"This sign-in updates the selected account instead of creating another account."})]}),!re&&!J&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"nickname",children:N("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:E=>{r(E.target.value),k(null)},placeholder:N("addAccountDialog.nicknamePlaceholder"),disabled:de,className:"flex-1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:N("addAccountDialog.nicknameOptionalHint")})]}),re&&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(ue,{className:"w-4 h-4 inline mr-2 animate-spin"}),N("addAccountDialog.waitingForAuth")]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:K.isDeviceCodeFlow?N("addAccountDialog.deviceCodeHint"):oe?"Complete sign-in in your browser. If it does not return automatically, paste the final kiro:// callback URL below.":N("addAccountDialog.browserHint")})]}),K.authUrl&&!K.isDeviceCodeFlow&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{className:"text-xs",children:N("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:K.authUrl}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(G,{variant:"outline",size:"sm",onClick:Ts,children:g?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"w-3 h-3 mr-1"}),N("addAccountDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(js,{className:"w-3 h-3 mr-1"}),N("addAccountDialog.copy")]})}),e.jsxs(G,{variant:"outline",size:"sm",onClick:()=>{if(!K.authUrl)return;const E=window.open(K.authUrl,"_blank");(!E||E.closed||typeof E.closed>"u")&&V.warning(N("addAccountDialog.popupBlocked"),{duration:5e3})},children:[e.jsx(Me,{className:"w-3 h-3 mr-1"}),N("addAccountDialog.open")]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"callback-url",className:"text-xs",children:oe?"Browser did not return? Paste the final kiro:// callback URL:":N("addAccountDialog.redirectPasteLabel")}),e.jsx(ce,{id:"callback-url",value:m,onChange:E=>l(E.target.value),placeholder:oe?"kiro://kiro.kiroAgent/authenticate-success?code=...&state=...":N("addAccountDialog.callbackPlaceholder"),className:"font-mono text-xs"}),e.jsx(G,{variant:"secondary",size:"sm",onClick:Ds,disabled:!m.trim()||K.isSubmittingCallback,children:K.isSubmittingCallback?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-3 h-3 mr-1 animate-spin"}),N("addAccountDialog.submitting")]}):N("addAccountDialog.submitCallback")})]})]}),!K.authUrl&&!K.isDeviceCodeFlow&&e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:oe?"Preparing the Kiro sign-in URL. If it does not open automatically, it will appear here shortly.":N("addAccountDialog.preparingUrl")})]}),U&&e.jsx("p",{className:"text-xs text-center text-destructive whitespace-pre-line",children:U}),ie.isPending&&e.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:[e.jsx(ue,{className:"w-4 h-4 inline mr-2 animate-spin"}),N("addAccountDialog.importingToken")]}),e.jsxs("div",{className:"flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:items-center sm:justify-end",children:[e.jsx(G,{variant:"ghost",onClick:$t,className:"w-full sm:w-auto",children:N("addAccountDialog.cancel")}),X&&!re&&e.jsx(G,{variant:"outline",onClick:Is,disabled:de,className:"w-full sm:w-auto",children:ie.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 mr-2 animate-spin"}),N("addAccountDialog.importing")]}):e.jsxs(e.Fragment,{children:[e.jsx(Pa,{className:"w-4 h-4 mr-2"}),N("addAccountDialog.importFromIde")]})}),!re&&e.jsxs(G,{onClick:Es,className:"w-full sm:w-auto",disabled:de||Ae||ge&&!Se||pe&&!f,children:[e.jsx(Me,{className:"w-4 h-4 mr-2"}),J?"Reauthenticate":N("addAccountDialog.authenticate")]})]})]})]})})}const vn=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"];function jn(t){const a=t?.env||{};return vn.filter(s=>!a[s]?.trim())}function bn(t,a){const[s,n]=u.useState(null),[i,o]=u.useState(!1),d=Tt(),{data:c,isLoading:r,refetch:m}=os({queryKey:["settings",t],queryFn:async()=>{const p=await fetch(`/api/settings/${t}/raw`);if(!p.ok){const w=t==="cursor"?`~/.ccs/cliproxy/providers/${t}.settings.json`:Ge(t)?`~/.ccs/${t}.settings.json`:`~/.ccs/profiles/${t}/settings.json`;return{profile:t,settings:{env:{}},mtime:Date.now(),path:w}}return p.json()}}),l=c?.settings,g=u.useMemo(()=>s!==null?s:l?JSON.stringify(l,null,2):`{
|
|
3
|
-
"env": {}
|
|
4
|
-
}`,[s,l]),h=u.useCallback(p=>{n(p)},[]),b=u.useMemo(()=>{try{return JSON.parse(g)}catch{return l||{env:{}}}},[g,l]),k=b?.env?.ANTHROPIC_MODEL,C=b?.env?.ANTHROPIC_DEFAULT_OPUS_MODEL,L=b?.env?.ANTHROPIC_DEFAULT_SONNET_MODEL,P=b?.env?.ANTHROPIC_DEFAULT_HAIKU_MODEL,S=b?.env?.ANTHROPIC_DEFAULT_FABLE_MODEL,A=u.useMemo(()=>Ws(b?.env||{}),[b]),j=u.useCallback((p,w)=>Js(p,w,{supportsExtendedContext:z=>Za(t,z,a)}),[a,t]),D=u.useCallback((p,w)=>{const z={...b?.env||{},[p]:w},_=Xt(p)?j(z,A):z;delete _.CCS_EXTENDED_CONTEXT;const O={...b,env:_};n(JSON.stringify(O,null,2))},[j,b,A]),v=u.useCallback(p=>{const w=b?.env||{},z=j(w,p);delete z.CCS_EXTENDED_CONTEXT;const _={...b,env:z};n(JSON.stringify(_,null,2))},[j,b]),I=u.useCallback(p=>{const w={...b?.env||{},...p},_=Object.keys(p).some(Xt)?j(w,A):w;delete _.CCS_EXTENDED_CONTEXT;const O={...b,env:_};n(JSON.stringify(O,null,2))},[j,b,A]),T=u.useMemo(()=>{try{return JSON.parse(g),!0}catch{return!1}},[g]),x=u.useMemo(()=>s===null?!1:s!==JSON.stringify(l,null,2),[s,l]),R=u.useMemo(()=>jn(b),[b]),M=Os({mutationFn:async()=>{const p=JSON.parse(g),w=await fetch(`/api/settings/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:p,expectedMtime:c?.mtime})});if(w.status===409)throw new Error("CONFLICT");if(!w.ok)throw new Error("Failed to save");return w.json()},onSuccess:p=>{d.invalidateQueries({queryKey:["settings",t]}),n(null),p?.warning?V.success(fe.t("settings.saved"),{description:p.warning}):V.success(fe.t("settings.saved"))},onError:p=>{p.message==="CONFLICT"?o(!0):V.error(p.message)}}),B=async p=>{o(!1),p?(await m(),M.mutate()):n(null)};return{data:c,isLoading:r,refetch:m,rawJsonContent:g,rawJsonEdits:s,isRawJsonValid:T,hasChanges:x,currentSettings:b,currentModel:k,opusModel:C,sonnetModel:L,haikuModel:P,fableModel:S,extendedContextEnabled:A,toggleExtendedContext:v,handleRawJsonChange:h,updateEnvValue:D,updateEnvValues:I,saveMutation:{mutate:()=>M.mutate(),isPending:M.isPending},conflictDialog:i,setConflictDialog:o,handleConflictResolve:B,missingRequiredFields:R}}const Nn=/-(minimal|low|medium|high|xhigh|fast)$/i,it=["minimal","low","medium","high","xhigh"];function kn(t){return t?.trim()??""}function Be(t){let a=kn(t),s,n;for(let i=0;i<2;i+=1){const o=a.match(Nn);if(!o?.[1])break;const d=o[1].toLowerCase();if(d==="fast"){if(n)break;n="fast"}else{if(s)break;s=d}a=a.slice(0,-o[0].length)}return{baseModel:a,effort:s,serviceTier:n}}function ut(t){return Be(t).effort}function Bt(t){return Be(t).serviceTier}function Vt(t){return Be(t).baseModel}function Pt(t,a){const s=Be(t),n=s.baseModel;return!n||!a?s.serviceTier?`${n}-${s.serviceTier}`:n:[n,a,s.serviceTier].filter(Boolean).join("-")}function yn(t,a){const s=Be(t);return s.baseModel?[s.baseModel,s.effort,a?"fast":void 0].filter(Boolean).join("-"):s.baseModel}function wn(t,a,s=[],n){if(!a){const c=ut(t);return[Pt(t,c)]}const i=Vt(t),o=[],d=c=>{const r=c?Pt(i,c):i;o.push(r);for(const m of s)o.push(`${r}-${m}`)};d(void 0);for(const c of n??it)if(d(c),!n&&c===a)break;return o}function Cn(t,a){if(a?.length)return[...a];if(!t)return[...it];const s=it.indexOf(t);return it.slice(0,s+1)}function An(t,a){if(!t)return null;const s=ut(t);return s?{label:`Pinned ${s}`,explicit:!0}:{label:"Auto effort",explicit:!1}}const Ms=/\(([a-z]+)\)$/i;function Sn(t){return t?.trim().match(Ms)?.[1]?.toLowerCase()}function Ps(t){return t?.trim().replace(Ms,"")??""}function Mn(t,a){const s=Ps(t);return!s||!a?s:`${s}(${a})`}const Pn={parse:t=>ut(t),strip:t=>Vt(t),apply:(t,a)=>Pt(t,a),getOptions:(t,a)=>{const s=t?ze(a.provider,t,a):void 0;return Cn(s?.codexMaxEffort,s?.codexEfforts)}},Tn={parse:Sn,strip:Ps,apply:Mn,getOptions:(t,a)=>{if(!t)return null;const s=ze(a.provider,t,a)?.reasoningLevels;return s?.length?[...s]:null}},Dn={codex:Pn,xai:Tn};function En(t){return t?Dn[t.toLowerCase()]:void 0}const In=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]*$/,Rn=/[._:/-]/;function On(t){const a=t.trim();return In.test(a)&&Rn.test(a)}function Ln({label:t}){return e.jsx(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:t})}function Ye({modelId:t}){const a=An(t);return a?e.jsx(H,{variant:a.explicit?"secondary":"outline",className:"text-[9px] h-4 px-1 uppercase",children:a.label}):null}function Ze({modelId:t}){const a=Bt(t);return a?e.jsx(H,{variant:"secondary",className:"text-[9px] h-4 px-1 uppercase",children:a}):null}function et(t,a){if(!t)return"";if(!a?.prefix)return t;const s=`${a.prefix}/`;return t.startsWith(s)?t.slice(s.length):t}function tt(t,a){return a?.recommendedModelId??t}function Nt(t,a,s,n,i){return i?wn(n,t,s,a):[n]}function _n(t,a){return a?Bt(t)?"codex-fast":ut(t)?"codex-reasoning":"recommended":"recommended"}function be({label:t,description:a,value:s,onChange:n,catalog:i,allModels:o,routing:d,disabled:c}){const{t:r}=Q(),m=i?.provider==="codex",l=u.useMemo(()=>zt(i,o),[o,i]),g=u.useMemo(()=>Ya(i?.provider??"",i,o),[o,i]),h=new Set(l.map(p=>p.id)),b=u.useMemo(()=>new Map((d?.models??[]).map(p=>[p.modelId.toLowerCase(),p])),[d]),k=u.useMemo(()=>new Set(l.flatMap(p=>Nt(p.codexMaxEffort,p.codexEfforts,p.codexServiceTiers,tt(p.id,b.get(p.id.toLowerCase())),m))),[m,l,b]),C=u.useMemo(()=>b.get(et(s,d).toLowerCase()),[d,b,s]),L=p=>{const w=p.trim();return On(w)?{value:w,groupKey:"custom",searchText:w,triggerContent:e.jsx("span",{className:"truncate font-mono text-xs",children:w}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:w}),e.jsx(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.customModel")})]})}:null},P=l.flatMap(p=>{const w=b.get(p.id.toLowerCase());return Nt(p.codexMaxEffort,p.codexEfforts,p.codexServiceTiers,tt(p.id,w),m).map(_=>({value:_,groupKey:_n(_,m),searchText:`${_} ${p.id} ${p.name} ${w?.recommendedModelId??""}`,keywords:[p.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:_}),w?.pinnedAvailable?e.jsx(H,{variant:"secondary",className:"text-[9px] h-4 px-1 uppercase",children:w.prefix}):null,m&&e.jsx(Ye,{modelId:_}),m&&e.jsx(Ze,{modelId:_})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:_}),p.tier==="paid"&&e.jsx(Ln,{label:r("providerModelSelector.paid")}),w?.unprefixedStatus==="shadowed"?e.jsx(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.shadowed")}):null,w?.unprefixedStatus==="prefix-only"?e.jsx(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.prefixOnly")}):null,m&&e.jsx(Ye,{modelId:_}),m&&e.jsx(Ze,{modelId:_})]})}))}),S=g.filter(p=>!h.has(p.id)).filter(p=>!k.has(tt(p.id,b.get(p.id.toLowerCase())))).flatMap(p=>{const w=b.get(p.id.toLowerCase());return Nt(void 0,void 0,void 0,tt(p.id,w),m).map(_=>({value:_,groupKey:"all",searchText:`${_} ${p.id} ${w?.recommendedModelId??""}`,keywords:[p.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:_}),w?.pinnedAvailable?e.jsx(H,{variant:"secondary",className:"text-[9px] h-4 px-1 uppercase",children:w.prefix}):null,m&&e.jsx(Ye,{modelId:_}),m&&e.jsx(Ze,{modelId:_})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:_}),w?.unprefixedStatus==="shadowed"?e.jsx(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.shadowed")}):null,w?.unprefixedStatus==="prefix-only"?e.jsx(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.prefixOnly")}):null,m&&e.jsx(Ye,{modelId:_}),m&&e.jsx(Ze,{modelId:_})]})}))}),A=!!s&&!P.some(p=>p.value===s)&&!S.some(p=>p.value===s),j=s?{value:s,groupKey:"current",searchText:s,triggerContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:s}),e.jsx(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.current")})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:s}),e.jsx(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:r("providerModelSelector.current")})]})}:null,D=P.length+S.length>0,v=En(i?.provider),I=v?.parse(s),T=v&&i?v.getOptions(v.strip(et(s,d)),i):null,x=T&&I&&!T.includes(I)?[...T,I]:T,R=m?Bt(s):void 0,M=m&&i&&s?ze(i.provider,Vt(et(s,d)),i):void 0,B=m&&(M?.codexServiceTiers?.includes("fast")===!0||R==="fast");return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium",children:t}),a&&e.jsx("p",{className:"text-[10px] text-muted-foreground",children:a})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(qa,{value:s||void 0,onChange:n,disabled:c,placeholder:r("providerModelSelector.selectModel"),searchPlaceholder:r("searchableSelect.searchModels"),emptyText:r(D?"searchableSelect.noResults":"providerModelSelector.noModelsAvailable"),className:"min-w-0 flex-1",triggerClassName:"h-9",createOption:L,groups:[...A&&j?[{key:"current",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.currentValue")})}]:[],{key:"recommended",label:e.jsx("span",{className:"text-xs text-primary",children:r("providerModelSelector.recommended")})},...m?[{key:"codex-reasoning",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.codexReasoningVariants")})},{key:"codex-fast",label:e.jsx("span",{className:"text-xs text-amber-600",children:r("providerModelSelector.codexFastVariants")})}]:[],...S.length>0?[{key:"all",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.allModelsCount",{count:S.length})})}]:[],{key:"custom",label:e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.customModel")})}],options:[...A&&j?[j]:[],...P,...S]}),v&&x&&e.jsxs(_e,{value:I??"auto",onValueChange:p=>n(v.apply(s,p==="auto"?void 0:p)),disabled:c||!s,children:[e.jsx(Fe,{className:"h-9 w-28 shrink-0","aria-label":r("providerModelSelector.effortLabel"),children:e.jsx(qe,{})}),e.jsxs(Ue,{children:[e.jsx(je,{value:"auto",children:r("providerModelSelector.effortAuto")}),x.map(p=>e.jsx(je,{value:p,children:p},p))]})]}),B&&e.jsxs("label",{className:"flex h-9 shrink-0 items-center gap-1.5",children:[e.jsx(Ot,{checked:R==="fast",onCheckedChange:p=>n(yn(s,p)),disabled:c||!s,"aria-label":r("providerModelSelector.fastTier")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:r("providerModelSelector.fastTier")})]})]}),C?e.jsxs("div",{className:W("rounded-md border px-2.5 py-2 text-[11px]",C.unprefixedStatus==="safe"?"border-border/70 bg-muted/25 text-muted-foreground":"border-amber-300/60 bg-amber-50 text-amber-900 dark:border-amber-500/30 dark:bg-amber-950/25 dark:text-amber-100"),children:[e.jsxs("div",{className:"font-medium",children:[C.pinnedAvailable?r("providerModelSelector.preferredPinnedModel"):r("providerModelSelector.pinnedRouteStatus")," ",e.jsx("code",{children:C.pinnedAvailable?C.recommendedModelId:C.pinnedModelId})]}),e.jsx("p",{className:"mt-1 leading-5",children:C.summary})]}):null,s&&!C&&et(s,d)!==s?e.jsx("div",{className:"rounded-md border border-amber-300/60 bg-amber-50 px-2.5 py-2 text-[11px] text-amber-900 dark:border-amber-500/30 dark:bg-amber-950/25 dark:text-amber-100",children:r("providerModelSelector.pinnedModelNotAdvertised",{model:s})}):null]})}function is(t,a){const s=n=>a?.models.find(o=>o.modelId.toLowerCase()===n.toLowerCase())?.recommendedModelId??n;return{default:s(t.default),opus:s(t.opus),sonnet:s(t.sonnet),haiku:s(t.haiku)}}function Fn({open:t,onClose:a,currentValues:s,onApply:n,onSave:i,isSaving:o,catalog:d,allModels:c,routing:r}){const{t:m}=Q(),[l,g]=u.useState(is(s,r)),[h,b]=u.useState(""),k=C=>{C?(g(is(s,r)),b("")):a()};return e.jsx(Dt,{open:t,onOpenChange:k,children:e.jsxs(Et,{className:"sm:max-w-md",children:[e.jsx(It,{children:e.jsxs(Rt,{className:"flex items-center gap-2",children:[e.jsx(qt,{className:"w-4 h-4"}),m("customPresetDialog.title")]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"preset-name",children:m("customPresetDialog.presetNameOptional")}),e.jsx(ce,{id:"preset-name",value:h,onChange:C=>b(C.target.value),placeholder:m("customPresetDialog.presetNamePlaceholder"),className:"text-sm"})]}),e.jsx(Kt,{}),d?.provider==="codex"&&e.jsxs("p",{className:"text-[11px] text-muted-foreground rounded-md border bg-muted/30 px-2.5 py-2",children:[m("customPresetDialog.codexTipPrefix")," ",e.jsx("code",{children:"-medium"}),", ",e.jsx("code",{children:"-high"}),", and"," ",e.jsx("code",{children:"-xhigh"})," ",m("customPresetDialog.codexTipSuffix")]}),e.jsx(be,{label:m("customPresetDialog.defaultModel"),description:m("customPresetDialog.defaultModelDesc"),value:l.default,onChange:C=>g({...l,default:C}),catalog:d,allModels:c,routing:r}),e.jsx(be,{label:m("customPresetDialog.opusModel"),description:m("customPresetDialog.opusModelDesc"),value:l.opus,onChange:C=>g({...l,opus:C}),catalog:d,allModels:c,routing:r}),e.jsx(be,{label:m("customPresetDialog.sonnetModel"),description:m("customPresetDialog.sonnetModelDesc"),value:l.sonnet,onChange:C=>g({...l,sonnet:C}),catalog:d,allModels:c,routing:r}),e.jsx(be,{label:m("customPresetDialog.haikuModel"),description:m("customPresetDialog.haikuModelDesc"),value:l.haiku,onChange:C=>g({...l,haiku:C}),catalog:d,allModels:c,routing:r})]}),e.jsxs(Xs,{className:"gap-2 sm:gap-0",children:[e.jsx(G,{variant:"outline",onClick:a,children:m("customPresetDialog.cancel")}),i&&e.jsxs(G,{variant:"secondary",onClick:()=>i(l,h||void 0),disabled:o||!h.trim(),children:[o?e.jsx(ue,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(Ut,{className:"w-4 h-4 mr-1"}),m("customPresetDialog.savePreset")]}),e.jsxs(G,{onClick:()=>n(l,h||void 0),children:[e.jsx(He,{className:"w-4 h-4 mr-1"}),m("customPresetDialog.applyPreset")]})]})]})})}function Ce({label:t,command:a}){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:a}),e.jsx(gs,{value:a,size:"icon",className:"h-6 w-6"})]})]})}function qn({provider:t,displayName:a,baseProvider:s,defaultTarget:n,data:i,authStatus:o,supportsModelConfig:d=!1}){const{t:c}=Q(),r=n||"claude",m=r==="droid",l=t==="codex",g=s||o.provider||t,h=Ys(g),b=r==="claude"?`ccs ${t}`:`ccs ${t} --target claude`,k=`${b} --config`,C=`${b} --auth --add`,L=`${b} --accounts`;return e.jsx(Lt,{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(Ns,{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:c("providerEditor.provider")}),e.jsx("span",{className:"font-mono",children:a})]}),i&&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:c("providerEditor.filePath")}),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:i.path}),e.jsx(gs,{value:i.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:c("providerEditor.lastModified")}),e.jsx("span",{className:"text-xs",children:new Date(i.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:c("providerEditor.status")}),o.authenticated?e.jsxs(H,{variant:"outline",className:"w-fit text-green-600 border-green-200 bg-green-50",children:[e.jsx(Ta,{className:"w-3 h-3 mr-1"}),"Authenticated"]}):e.jsx(H,{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:c("providerEditor.defaultTarget")}),e.jsx("span",{className:"font-mono",children:r})]}),h&&e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-start",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:c("providerConfig.trackLabel")}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"font-mono",children:c(h.labelKey)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[c(h.hintKey),Zs(g)?` ${c("providerConfig.plusTrackNote")}`:""]})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:c("providerEditor.quickUsage")}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsx(Ce,{label:"Run with prompt",command:`ccs ${t} "your prompt"`}),l&&e.jsxs(e.Fragment,{children:[e.jsx(Ce,{label:"Run on native Codex (shortcut)",command:'ccsxp "your prompt"'}),e.jsx(Ce,{label:"Run on native Codex (--target)",command:`ccs ${t} --target codex "your prompt"`})]}),e.jsx(Ce,{label:m?"Droid alias (explicit)":"Run on Droid",command:`ccs-droid ${t} "your prompt"`}),e.jsx(Ce,{label:m?"Override to Claude":"Run on Droid (--target)",command:`ccs ${t} --target ${m?"claude":"droid"} "your prompt"`}),d&&e.jsx(Ce,{label:r==="claude"?"Change model":"Change model (Claude target)",command:k}),e.jsx(Ce,{label:r==="claude"?"Add account":"Add account (Claude target)",command:C}),e.jsx(Ce,{label:r==="claude"?"List accounts":"List accounts (Claude target)",command:L}),r!=="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 Un(t){const a=t.replace(/\\/g,"/"),n=a.lastIndexOf("/cliproxy/providers/");return n!==-1?a.slice(n+1):a.replace(/^.*\//,"")}function Gn({displayName:t,logoProvider:a,provider:s,data:n,isLoading:i,hasChanges:o,isRawJsonValid:d,isSaving:c,isRemoteMode:r,port:m,onRefetch:l,onSave:g}){const{t:h}=Q();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(_t,{provider:a||s,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(H,{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(ks,{className:"w-3 h-3"}),"Remote"]}),m&&e.jsxs(H,{variant:"outline",className:"text-xs gap-1 font-mono",children:[e.jsx(Da,{className:"w-3 h-3"}),":",m]}),!r&&n?.path&&e.jsx(H,{variant:"outline",className:"text-xs",children:Un(n.path)})]}),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:[h("providerEditor.lastModified"),": ",new Date(n.mtime).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{variant:"ghost",size:"sm",onClick:l,disabled:i,children:e.jsx(lt,{className:`w-4 h-4 ${i?"animate-spin":""}`})}),e.jsx(G,{size:"sm",onClick:g,disabled:c||!o||!d,children:c?e.jsxs(e.Fragment,{children:[e.jsx(ue,{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 Kn({models:t,provider:a,enabled:s,onToggle:n,disabled:i,className:o}){const{t:d}=Q();if(t.length===0)return null;const c=t.some(l=>Yt(l.id)),r=t.some(l=>!Yt(l.id));let m="Compatible mappings stay on standard context unless you turn this on.";return c&&r?m="Gemini-compatible mappings can use 1M automatically. Claude mappings stay plain unless you turn this on.":c&&(m="Gemini-compatible mappings can use 1M by default. Turn this off to keep standard context."),e.jsxs("div",{className:W("rounded-lg border p-3 space-y-2",s?"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(He,{className:W("w-4 h-4",s?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"text-sm font-medium",children:d("extendedContext.extendedContext")}),e.jsx(H,{variant:s?"default":"secondary",className:"text-[10px] h-5 px-1.5",children:"1M tokens"})]}),e.jsx(Ot,{checked:s,onCheckedChange:n,disabled:i})]}),e.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[e.jsx(Ns,{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:m}),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 Hn(t,a){const s=t.presetMapping||{default:t.id,opus:t.id,sonnet:t.id,haiku:t.id};return{ANTHROPIC_MODEL:a(s.default),ANTHROPIC_DEFAULT_OPUS_MODEL:a(s.opus),ANTHROPIC_DEFAULT_SONNET_MODEL:a(s.sonnet),ANTHROPIC_DEFAULT_HAIKU_MODEL:a(s.haiku)}}function zn({catalog:t,savedPresets:a,currentModel:s,opusModel:n,sonnetModel:i,haikuModel:o,fableModel:d,providerModels:c,routing:r,provider:m,extendedContextEnabled:l,onExtendedContextToggle:g,onApplyPreset:h,onUpdateEnvValue:b,onOpenCustomPreset:k,onDeletePreset:C,isDeletePending:L}){const{t:P}=Q(),S=(r?.models??[]).some(x=>x.pinnedAvailable),A=u.useMemo(()=>new Map((r?.models??[]).map(x=>[x.modelId.toLowerCase(),x])),[r]),j=x=>A.get(x.toLowerCase())?.recommendedModelId??x,D=u.useMemo(()=>{if(!t)return[];const x=[s,n,i,o,d].filter(M=>!!M).map(M=>ea(M));return[...new Set(x)].map(M=>ze(t.provider,M,t)).filter(M=>!!M?.extendedContext)},[t,s,n,i,o,d]),v=u.useMemo(()=>zt(t,c),[t,c]),I=u.useMemo(()=>{const x=v.filter(M=>M.presetMapping);return x.length===0?[]:x.some(M=>M.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:x.filter(M=>M.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:x.filter(M=>M.tier==="paid")}].filter(M=>M.models.length>0):[{key:"default",models:x.slice(0,4)}]},[v]),T=I.length>0||a.length>0;return e.jsxs(e.Fragment,{children:[T&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(qt,{className:"w-4 h-4"}),"Presets"]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:P("providerEditor.presets")}),e.jsxs("div",{className:"space-y-4",children:[I.map(x=>e.jsxs("div",{children:["label"in x&&x.label&&e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(H,{variant:"outline",className:x.badgeClassName,children:x.label}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:x.description})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:x.models.map(R=>e.jsxs(G,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>h(Hn(R,j)),children:[e.jsx(He,{className:`w-3 h-3 ${"iconClassName"in x?x.iconClassName:""}`}),R.name]},R.id))})]},x.key)),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.map(x=>e.jsxs("div",{className:"group relative",children:[e.jsxs(G,{variant:"secondary",size:"sm",className:"text-xs h-7 gap-1 pr-6",onClick:()=>{h({ANTHROPIC_MODEL:j(x.default),ANTHROPIC_DEFAULT_OPUS_MODEL:j(x.opus),ANTHROPIC_DEFAULT_SONNET_MODEL:j(x.sonnet),ANTHROPIC_DEFAULT_HAIKU_MODEL:j(x.haiku)})},children:[e.jsx(Ut,{className:"w-3 h-3 fill-current"}),x.name]}),e.jsx(G,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-7 w-5 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:R=>{R.stopPropagation(),C(x.name)},disabled:L,children:e.jsx(Gt,{className:"w-3 h-3"})})]},x.name)),e.jsxs(G,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1 border-primary/50 text-primary hover:bg-primary/10 hover:border-primary",onClick:k,children:[e.jsx(ct,{className:"w-3 h-3"}),"Custom"]})]})]})]}),e.jsx(Kt,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-2",children:P("providerEditor.modelMapping")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Configure which models to use for each tier"}),r?e.jsx("p",{className:"text-[11px] text-muted-foreground mb-3 rounded-md border bg-muted/30 px-2.5 py-2",children:S?e.jsxs(e.Fragment,{children:["Preferred pinned model names use the ",e.jsxs("code",{children:[r.prefix,"/"]})," prefix. Unprefixed names can still resolve to a different backend when providers overlap."]}):e.jsxs(e.Fragment,{children:["Managed pinning for ",e.jsxs("code",{children:[r.prefix,"/"]})," is not currently advertised by the proxy. Unprefixed names may still be ambiguous until prefix repair completes."]})}):null,m==="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:"-minimal"}),", ",e.jsx("code",{children:"-low"}),", ",e.jsx("code",{children:"-medium"}),","," ",e.jsx("code",{children:"-high"}),", and ",e.jsx("code",{children:"-xhigh"})," pin reasoning effort. ",e.jsx("code",{children:"-fast"})," ","enables the Codex fast service tier on models that support it, including combined forms such as ",e.jsx("code",{children:"gpt-5.4-high-fast"}),"."]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(be,{label:"Default Model",description:"Used when no specific tier is requested",value:s,onChange:x=>b("ANTHROPIC_MODEL",x),catalog:t,allModels:c,routing:r}),D.length>0&&g&&e.jsx(Kn,{models:D,provider:m,enabled:l??!1,onToggle:g}),e.jsx(be,{label:"Fable (Frontier)",description:"Maps the fable subagent tier; leave empty to keep the native Claude Fable model",value:d,onChange:x=>b("ANTHROPIC_DEFAULT_FABLE_MODEL",x),catalog:t,allModels:c,routing:r}),e.jsx(be,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:n,onChange:x=>b("ANTHROPIC_DEFAULT_OPUS_MODEL",x),catalog:t,allModels:c,routing:r}),e.jsx(be,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:i,onChange:x=>b("ANTHROPIC_DEFAULT_SONNET_MODEL",x),catalog:t,allModels:c,routing:r}),e.jsx(be,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:o,onChange:x=>b("ANTHROPIC_DEFAULT_HAIKU_MODEL",x),catalog:t,allModels:c,routing:r})]})]})]})}function Bn(t,a,s){return t?e.jsx(kt,{children:e.jsxs(yt,{children:[e.jsx(wt,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ra,{className:"w-3 h-3","aria-hidden":"true"}),e.jsx("span",{className:W("font-mono max-w-[180px] truncate",a&&Ne),title:t,children:t})]})}),e.jsx(Ct,{side:"bottom",children:e.jsx("p",{className:"text-xs",children:s("providerEditor.gcpProjectIdReadonly")})})]})}):e.jsx(kt,{children:e.jsxs(yt,{children:[e.jsx(wt,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600 dark:text-amber-500",children:[e.jsx(rt,{className:"w-3 h-3","aria-label":"Warning"}),e.jsx("span",{children:s("providerEditor.projectIdNA")})]})}),e.jsx(Ct,{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:s("providerEditor.missingProjectId")}),e.jsx("p",{children:s("providerEditor.missingProjectIdHint")})]})})]})})}function Vn({account:t,onSetDefault:a,onRemove:s,onReauth:n,onPauseToggle:i,isRemoving:o,isPausingAccount:d,privacyMode:c,showQuota:r,selectable:m,selected:l,onSelectChange:g}){const{t:h}=Q(),b=t.provider.toLowerCase(),{data:k}=ta(r),{data:C,isLoading:L}=sa(b,t.id,r),P=aa(k,t)?.lastUsedAt,S=m||i?e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[m&&e.jsx("button",{type:"button",onClick:()=>g?.(!l),className:W("flex items-center justify-center w-5 h-5 rounded border-2 transition-colors shrink-0",l?"bg-primary border-primary text-primary-foreground":"border-muted-foreground/30 hover:border-primary/50"),"aria-label":l?"Deselect account":"Select account",children:l&&e.jsx(Pe,{className:"w-3 h-3"})}),i&&e.jsx(kt,{children:e.jsxs(yt,{children:[e.jsx(wt,{asChild:!0,children:e.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:()=>i(!t.paused),disabled:d,children:d?e.jsx(ue,{className:"w-4 h-4 animate-spin"}):t.paused?e.jsx(ys,{className:"w-4 h-4 text-emerald-500"}):e.jsx(ws,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})}),e.jsx(Ct,{side:"top",children:t.paused?"Resume account":"Pause account"})]})})]}):void 0,A=e.jsxs(na,{children:[e.jsx(ia,{asChild:!0,children:e.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",children:e.jsx(Ia,{className:"w-4 h-4"})})}),e.jsxs(ra,{align:"end",children:[!t.isDefault&&e.jsxs(ft,{onClick:a,children:[e.jsx(Ut,{className:"w-4 h-4 mr-2"}),"Set as default"]}),n&&e.jsxs(ft,{onClick:n,children:[e.jsx(lt,{className:"w-4 h-4 mr-2"}),"Reauthenticate"]}),e.jsxs(ft,{className:"text-destructive focus:text-destructive",onClick:s,disabled:o,children:[e.jsx(Cs,{className:"w-4 h-4 mr-2"}),o?"Removing...":"Remove account"]})]})]});return e.jsx("div",{className:W("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",l&&"ring-2 ring-primary/50 bg-primary/5"),children:e.jsx(oa,{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:r,quota:C,quotaLoading:L,runtimeLastUsed:P,beforeIdentity:S,headerEnd:A,bodySlot:t.provider==="agy"?Bn(t.projectId,c,h):null,quotaInsetClassName:"pl-11"})})}function $n({selectedCount:t,onPauseSelected:a,onResumeSelected:s,onClearSelection:n,isPausing:i,isResuming:o}){if(t<1)return null;const d=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(G,{variant:"ghost",size:"sm",className:"text-xs h-6 px-2",onClick:n,disabled:d,children:"Clear"}),e.jsxs("div",{className:"flex gap-2 ml-auto",children:[e.jsxs(G,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:a,disabled:d,children:[i?e.jsx(ue,{className:"w-3 h-3 animate-spin"}):e.jsx(ws,{className:"w-3 h-3"}),"Pause Selected"]}),e.jsxs(G,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:s,disabled:d,children:[o?e.jsx(ue,{className:"w-3 h-3 animate-spin"}):e.jsx(ys,{className:"w-3 h-3"}),"Resume Selected"]})]})]})}function Qn({accounts:t,onAddAccount:a,onReauthAccount:s,onSetDefault:n,onRemoveAccount:i,onPauseToggle:o,onSoloMode:d,onBulkPause:c,onBulkResume:r,isRemovingAccount:m,isPausingAccount:l,isSoloingAccount:g,isBulkPausing:h,isBulkResuming:b,privacyMode:k,showQuota:C,isKiro:L,kiroNoIncognito:P,onKiroNoIncognitoChange:S,kiroSettingsLoading:A}){const{t:j}=Q(),[D,v]=u.useState(new Set),I=u.useMemo(()=>new Set(t.map(y=>y.id)),[t]),T=u.useMemo(()=>new Set([...D].filter(y=>I.has(y))),[D,I]),x=!!(c&&r),R=T.size,M=t.length>0&&T.size===t.length,B=T.size>0&&T.size<t.length,p=u.useCallback(y=>{v(Y=>{const N=new Set(Y);return N.has(y)?N.delete(y):N.add(y),N})},[]),w=u.useCallback(()=>{v(new Set(t.map(y=>y.id)))},[t]),z=u.useCallback(()=>{v(new Set)},[]),_=u.useCallback(()=>{M?z():w()},[M,w,z]),O=u.useCallback(()=>{c&&T.size>0&&(c(Array.from(T)),v(new Set))},[c,T]),F=u.useCallback(()=>{r&&T.size>0&&(r(Array.from(T)),v(new Set))},[r,T]);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:[x&&t.length>0&&e.jsx(nt,{checked:M,onCheckedChange:_,"aria-label":"Select all accounts",className:B?"data-[state=checked]:bg-primary/50":"",...B?{"data-state":"indeterminate"}:{}}),e.jsx(Ke,{className:"w-4 h-4"}),j("providerEditor.accounts"),t.length>0&&e.jsx(H,{variant:"secondary",className:"text-xs",children:t.length})]}),e.jsxs(G,{variant:"default",size:"sm",className:"h-7 text-xs gap-1",onClick:a,children:[e.jsx(ct,{className:"w-3 h-3"}),j("providerEditor.addAccount")]})]}),x&&R>0&&e.jsx($n,{selectedCount:R,onPauseSelected:O,onResumeSelected:F,onClearSelection:z,isPausing:!!h,isResuming:!!b}),t.length>0?e.jsx("div",{className:"space-y-2",children:t.map(y=>e.jsx(Vn,{account:y,onSetDefault:()=>n(y.id),onRemove:()=>i(y.id),onReauth:s?()=>s(y):void 0,onPauseToggle:o?Y=>o(y.id,Y):void 0,onSoloMode:d?()=>d(y.id):void 0,isRemoving:m,isPausingAccount:l,isSoloingAccount:g,privacyMode:k,showQuota:C,selectable:x,selected:T.has(y.id),onSelectChange:()=>p(y.id)},y.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:j("providerEditor.noAccountsConnected")}),e.jsx("p",{className:"text-xs opacity-70",children:j("providerEditor.addAccountToStart")})]}),L&&S&&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(ks,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:j("providerEditor.useIncognito")})]}),e.jsx(Ot,{checked:!P,onCheckedChange:y=>S(!y),disabled:A,className:"scale-90"})]})})]})}function Wn({provider:t,catalog:a,savedPresets:s,currentModel:n,opusModel:i,sonnetModel:o,haikuModel:d,fableModel:c,providerModels:r,routing:m,extendedContextEnabled:l,onExtendedContextToggle:g,onApplyPreset:h,onUpdateEnvValue:b,onOpenCustomPreset:k,onDeletePreset:C,isDeletePending:L,accounts:P,onAddAccount:S,onReauthAccount:A,onSetDefault:j,onRemoveAccount:D,onPauseToggle:v,onSoloMode:I,onBulkPause:T,onBulkResume:x,isRemovingAccount:R,isPausingAccount:M,isSoloingAccount:B,isBulkPausing:p,isBulkResuming:w,privacyMode:z,isRemoteMode:_}){const O=t.toLowerCase(),F=(da.includes(O)||["anthropic","antigravity","gemini-cli","copilot","github-copilot"].includes(O))&&!_,y=t==="kiro",[Y,N]=u.useState(!0),[te,se]=u.useState(!0),[me,K]=u.useState(!1),ie=u.useCallback(async()=>{if(y)try{se(!0);const ae=(await st.config.get()).cliproxy;N(ae?.kiro_no_incognito??!0)}catch{N(!0)}finally{se(!1)}},[y]),X=u.useCallback(async Z=>{N(Z),K(!0);try{const ae=await st.config.get(),pe=ae.cliproxy??{};await st.config.update({...ae,cliproxy:{...pe,kiro_no_incognito:Z}})}catch{N(!Z)}finally{K(!1)}},[]);return u.useEffect(()=>{ie()},[ie]),e.jsx(Lt,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsx(zn,{catalog:a,savedPresets:s,currentModel:n,opusModel:i,sonnetModel:o,haikuModel:d,fableModel:c,providerModels:r,routing:m,provider:t,extendedContextEnabled:l,onExtendedContextToggle:g,onApplyPreset:h,onUpdateEnvValue:b,onOpenCustomPreset:k,onDeletePreset:C,isDeletePending:L}),e.jsx(Kt,{}),e.jsx(Qn,{accounts:P,onAddAccount:S,onReauthAccount:A,onSetDefault:j,onRemoveAccount:D,onPauseToggle:v,onSoloMode:I,onBulkPause:T,onBulkResume:x,isRemovingAccount:R,isPausingAccount:M,isSoloingAccount:B,isBulkPausing:p,isBulkResuming:w,privacyMode:z,showQuota:F,isKiro:y,kiroNoIncognito:Y,onKiroNoIncognitoChange:X,kiroSettingsLoading:te||me})]})})}function rs({provider:t,displayName:a,authStatus:s,catalog:n,routing:i,logoProvider:o,baseProvider:d,isRemoteMode:c,port:r,defaultTarget:m,topNotice:l,onAddAccount:g,onReauthAccount:h,onSetDefault:b,onRemoveAccount:k,onPauseToggle:C,onSoloMode:L,onBulkPause:P,onBulkResume:S,isRemovingAccount:A,isPausingAccount:j,isSoloingAccount:D,isBulkPausing:v,isBulkResuming:I}){const[T,x]=u.useState(!1),{privacyMode:R}=xs(),{t:M}=Q(),{data:B}=la(),{data:p}=ca(t),w=ua(),z=ma(),_=d||t,O=_.toLowerCase()==="agy",F=u.useMemo(()=>{const U=p?.presets||[];return O?U.filter(J=>!he(J.default)&&!he(J.opus)&&!he(J.sonnet)&&!he(J.haiku)):U},[O,p?.presets]),y=u.useMemo(()=>{if(!B?.models)return[];const J={gemini:["google"],agy:["antigravity"],codex:["openai"],cursor:["cursor"],gitlab:["gitlab","duo"],codebuddy:["codebuddy"],qwen:["alibaba","qwen"],iflow:["iflow"],kilo:["kilo"],qoder:["qoder"],kiro:["kiro","aws"],ghcp:["github","copilot"],kimi:["kimi","moonshot"]}[_.toLowerCase()]||[_.toLowerCase()];return B.models.filter(le=>J.some(De=>le.owned_by.toLowerCase().includes(De))?O?!he(le.id):!0:!1)},[O,B,_]),Y=(d||t).toLowerCase(),{data:N,isLoading:te,refetch:se,rawJsonContent:me,rawJsonEdits:K,isRawJsonValid:ie,hasChanges:X,currentModel:Z,opusModel:ae,sonnetModel:pe,haikuModel:ge,fableModel:Ae,extendedContextEnabled:Se,toggleExtendedContext:f,handleRawJsonChange:q,updateEnvValue:ye,updateEnvValues:xe,saveMutation:oe,conflictDialog:Te,handleConflictResolve:Ve,missingRequiredFields:mt}=bn(t,n),de=u.useMemo(()=>(s.accounts||[]).map(U=>({...U,provider:U.provider||d||t})),[s.accounts,d,t]),{data:pt}=os({queryKey:["auth-tokens-raw"],queryFn:async()=>{const U=await fetch("/api/settings/auth/tokens/raw");return U.ok?U.json():{apiKey:{value:"ccs-internal-managed"}}},staleTime:6e4}),Oe=pt?.apiKey?.value??"ccs-internal-managed",$e=U=>{if(O&&[U.ANTHROPIC_MODEL,U.ANTHROPIC_DEFAULT_OPUS_MODEL,U.ANTHROPIC_DEFAULT_SONNET_MODEL,U.ANTHROPIC_DEFAULT_HAIKU_MODEL].some(le=>typeof le=="string"&&he(le))){V.error(M("providerEditor.agyDenylist"));return}xe({ANTHROPIC_BASE_URL:`http://127.0.0.1:${r??At}/api/provider/${Y}`,ANTHROPIC_AUTH_TOKEN:Oe,...U}),V.success(`Applied "${U.ANTHROPIC_MODEL?.split("/").pop()||"preset"}" preset`)},Qe=(U,J)=>{if(O&&[U.default,U.opus,U.sonnet,U.haiku].some(De=>he(De))){V.error(M("providerEditor.agyDenylist"));return}xe({ANTHROPIC_BASE_URL:`http://127.0.0.1:${r??At}/api/provider/${Y}`,ANTHROPIC_AUTH_TOKEN:Oe,ANTHROPIC_MODEL:U.default,ANTHROPIC_DEFAULT_OPUS_MODEL:U.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:U.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:U.haiku}),V.success(`Applied ${J?`"${J}"`:"custom"} preset`),x(!1)},Le=(U,J)=>{if(!J){V.error(fe.t("commonToast.enterPresetName"));return}if(O&&[U.default,U.opus,U.sonnet,U.haiku].some(le=>he(le))){V.error(M("providerEditor.agyDenylist"));return}w.mutate({profile:t,data:{name:J,...U}}),x(!1)};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(Gn,{provider:t,displayName:a,logoProvider:o,data:N,isLoading:te,hasChanges:X,isRawJsonValid:ie,isSaving:oe.isPending,isRemoteMode:c,port:r,onRefetch:se,onSave:()=>oe.mutate()}),l?e.jsx("div",{className:"border-b bg-muted/10 px-4 py-3",children:l}):null,te?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(ue,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:M("providerEditor.loadingSettings")})]}):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(pa,{defaultValue:"config",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(xa,{className:"w-full",children:[e.jsx(Zt,{value:"config",className:"flex-1",children:"Model Config"}),e.jsx(Zt,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsx(es,{value:"config",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx(Wn,{provider:t,catalog:n,savedPresets:F,currentModel:Z,opusModel:ae,sonnetModel:pe,haikuModel:ge,fableModel:Ae,providerModels:y,routing:i,extendedContextEnabled:Se,onExtendedContextToggle:f,onApplyPreset:$e,onUpdateEnvValue:ye,onOpenCustomPreset:()=>x(!0),onDeletePreset:U=>z.mutate({profile:t,name:U}),isDeletePending:z.isPending,accounts:de,onAddAccount:g,onReauthAccount:h,onSetDefault:b,onRemoveAccount:k,onPauseToggle:C,onSoloMode:L,onBulkPause:P,onBulkResume:S,isRemovingAccount:A,isPausingAccount:j,isSoloingAccount:D,isBulkPausing:v,isBulkResuming:I,privacyMode:R,isRemoteMode:c})}),e.jsx(es,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(qn,{provider:t,displayName:a,baseProvider:d,defaultTarget:m,data:N,authStatus:s,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(Oa,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:[M("rawEditorSection.rawConfig")," (JSON)"]})]}),e.jsx(ha,{rawJsonContent:me,isRawJsonValid:ie,rawJsonEdits:K,onRawJsonChange:q,profileEnv:N?.settings?.env,missingRequiredFields:mt})]})]}),e.jsx(Fa,{open:Te,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>Ve(!0),onCancel:()=>Ve(!1)}),e.jsx(Fn,{open:T,onClose:()=>x(!1),currentValues:{default:Z||"",opus:ae||"",sonnet:pe||"",haiku:ge||""},onApply:Qe,onSave:Le,isSaving:w.isPending,catalog:n,allModels:y,routing:i})]})}function Jn({status:t,isSelected:a,onSelect:s}){const{t:n}=Q(),i=t.accounts?.length||0;return e.jsxs("button",{className:W("w-full flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors cursor-pointer text-left",a?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:s,children:[e.jsx(_t,{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(H,{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(Pe,{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(Gt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n("cliproxyPage.notConnected")})]})})]})]})}function Xn({variant:t,parentAuth:a,isSelected:s,onSelect:n,onDelete:i,isDeleting:o}){const{t:d}=Q(),c=()=>{n()};return e.jsxs("div",{role:"button",tabIndex:0,className:W("group w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors cursor-pointer text-left pl-6",s?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:c,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),c())},children:[e.jsxs("div",{className:"relative",children:[e.jsx(_t,{provider:t.provider,size:"sm"}),e.jsx(ot,{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(H,{variant:"outline",className:"text-[9px] h-4 px-1",children:d("cliproxyPage.variant")}),e.jsx(H,{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:a?.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"w-3 h-3 text-green-600"}),e.jsx("span",{className:"text-xs text-muted-foreground truncate",children:d("cliproxyPage.viaProvider",{provider:t.provider})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Gt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:d("cliproxyPage.parentNotConnected")})]})})]}),e.jsx(G,{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(Cs,{className:"w-3 h-3"})})]})}function Yn({onAddAccount:t,onCreateVariant:a}){const{t:s}=Q();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(He,{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("div",{className:"flex flex-col justify-center gap-2 sm:flex-row",children:[e.jsxs(G,{onClick:t,className:"gap-2",children:[e.jsx(ct,{className:"w-4 h-4"}),s("cliproxyPage.addAccount")]}),e.jsxs(G,{onClick:a,variant:"outline",className:"gap-2",children:[e.jsx(ot,{className:"w-4 h-4"}),s("cliproxyPage.advancedVariant")]})]})]})})}function gi(){const{t}=Q(),a=Tt(),{data:s,isLoading:n}=ms(),{data:i,isFetching:o}=fa(),{data:d}=ps(),{data:c}=ga(),r=va(),m=ja(),l=ba(),g=Na(),h=ka(),b=ya(),k=wa(),C=Ca(),[L,P]=u.useState(()=>{if(typeof window<"u"){const q=new URLSearchParams(window.location.search).get("provider")?.trim().toLowerCase();return q&&Ge(q)?q:localStorage.getItem("cliproxy-selected-provider")}return null}),[S,A]=u.useState(null),[j,D]=u.useState(!1),[v,I]=u.useState(()=>{if(typeof window>"u")return null;const f=new URLSearchParams(window.location.search),q=f.get("provider")?.trim().toLowerCase();return f.get("action")!=="auth"||!q||!Ge(q)?null:{provider:q,displayName:Xe(q),isFirstAccount:!1}}),T=u.useMemo(()=>s?.authStatus||[],[s?.authStatus]),x=u.useMemo(()=>Aa(T,f=>f.provider),[T]),R=s?.source==="remote",M=u.useMemo(()=>i?.variants||[],[i?.variants]),B=u.useMemo(()=>Ht(d?.catalogs),[d?.catalogs]),p=d?.routing??{},w=!!d,z=f=>{P(f),f&&localStorage.setItem("cliproxy-selected-provider",f)},_=u.useMemo(()=>S?null:L&&T.some(f=>f.provider===L)?L:T.length>0&&(T.find(q=>(q.accounts?.length||0)>0)?.provider||T[0]?.provider)||null,[L,S,T]),O=T.find(f=>f.provider===_),F=M.find(f=>f.name===S),y=F?T.find(f=>f.provider===F.provider):void 0,Y=F&&y?{provider:F.provider,displayName:y.displayName,accountCount:y.accounts?.length||0}:O?{provider:O.provider,displayName:O.displayName,accountCount:O.accounts?.length||0}:null,N=F?{provider:F.provider,displayName:Xe(F.provider),accountCount:0}:L&&Ge(L)?{provider:L,displayName:Xe(L),accountCount:0}:{provider:"gemini",displayName:Xe("gemini"),accountCount:0},te=Y??N,se=(F?.provider||O?.provider||"").toLowerCase().trim(),me=se==="gemini"||se==="agy",K=()=>{a.invalidateQueries({queryKey:["cliproxy"]}),a.invalidateQueries({queryKey:["cliproxy-auth"]}),a.invalidateQueries({queryKey:["cliproxy-catalog"]}),a.invalidateQueries({queryKey:["cliproxy-models"]})},ie=(f,q,ye)=>{l.isPending||g.isPending||(ye?l.mutate({provider:f,accountId:q}):g.mutate({provider:f,accountId:q}))},X=(f,q)=>{h.isPending||h.mutate({provider:f,accountId:q})},Z=(f,q)=>{b.isPending||b.mutate({provider:f,accountIds:q})},ae=(f,q)=>{k.isPending||k.mutate({provider:f,accountIds:q})},pe=f=>{z(f),A(null)},ge=f=>{A(f),z(null)},Ae=()=>{I({provider:te.provider,displayName:te.displayName,isFirstAccount:te.accountCount===0})},Se=(f,q,ye,xe)=>{const oe=ye?.find(Te=>Te.id===xe);oe&&I({provider:f,displayName:q,isFirstAccount:!1,account:oe})};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(He,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:c?.backendLabel??"CLIProxy"})]}),e.jsx(G,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:K,disabled:o,children:e.jsx(lt,{className:W("w-4 h-4",o&&"animate-spin")})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:t("cliproxyPage.accountManagement")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(G,{variant:"default",size:"sm",className:"w-full gap-2",onClick:Ae,children:[e.jsx(ct,{className:"w-4 h-4"}),t("cliproxyPage.addAccount")]}),e.jsxs(G,{variant:"outline",size:"sm",className:"w-full gap-2",onClick:()=>D(!0),children:[e.jsx(ot,{className:"w-4 h-4"}),t("cliproxyPage.advancedVariant")]}),e.jsx("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:t("cliproxyPage.setupActionsHint")})]})]}),e.jsx(Lt,{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(f=>e.jsx(Sa,{className:"h-14 w-full rounded-lg"},f))}):e.jsx("div",{className:"space-y-4",children:x.map(f=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"px-3",children:[e.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t(f.labelKey)}),e.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:t(f.hintKey)})]}),e.jsx("div",{className:"space-y-1",children:f.items.map(q=>e.jsx(Jn,{status:q,isSelected:_===q.provider,onSelect:()=>pe(q.provider)},q.provider))})]},f.id))}),M.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(ot,{className:"w-3 h-3"}),t("cliproxyPage.variants")]}),e.jsx("div",{className:"space-y-1",children:M.map(f=>e.jsx(Xn,{variant:f,parentAuth:T.find(q=>q.provider===f.provider),isSelected:S===f.name,onSelect:()=>ge(f.name),onDelete:()=>C.mutate(f.name),isDeleting:C.isPending},f.name))})]})]})}),e.jsx("div",{className:"p-3 border-t",children:e.jsx(Ua,{})}),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:T.length})}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Pe,{className:"w-3 h-3 text-green-600"}),t("cliproxyPage.connectedCount",{count:T.filter(f=>f.authenticated).length})]})]})})]}),e.jsx("div",{className:"flex-1 flex min-w-0 flex-col overflow-hidden bg-background",children:F&&y?e.jsx(e.Fragment,{children:e.jsx(rs,{provider:F.name,displayName:t("cliproxyPage.variantDisplay",{name:F.name,provider:F.provider}),authStatus:y,catalog:B[F.provider],routing:p[F.provider],logoProvider:F.provider,baseProvider:F.provider,defaultTarget:F.target,isRemoteMode:R,port:F.port,topNotice:me?e.jsx(Mt,{compact:!0,showProxySettingsLink:!0}):void 0,onAddAccount:()=>I({provider:F.provider,displayName:y.displayName,isFirstAccount:(y.accounts?.length||0)===0}),onReauthAccount:f=>Se(F.provider,y.displayName,y.accounts,f.id),onSetDefault:f=>r.mutate({provider:F.provider,accountId:f}),onRemoveAccount:f=>m.mutate({provider:F.provider,accountId:f}),onPauseToggle:(f,q)=>ie(F.provider,f,q),onSoloMode:f=>X(F.provider,f),onBulkPause:f=>Z(F.provider,f),onBulkResume:f=>ae(F.provider,f),isRemovingAccount:m.isPending,isPausingAccount:l.isPending||g.isPending,isSoloingAccount:h.isPending,isBulkPausing:b.isPending,isBulkResuming:k.isPending})}):O?e.jsx(e.Fragment,{children:e.jsx(rs,{provider:O.provider,displayName:O.displayName,authStatus:O,catalog:B[O.provider],routing:p[O.provider],isRemoteMode:R,topNotice:me?e.jsx(Mt,{compact:!0,showProxySettingsLink:!0}):void 0,onAddAccount:()=>I({provider:O.provider,displayName:O.displayName,isFirstAccount:(O.accounts?.length||0)===0}),onReauthAccount:f=>Se(O.provider,O.displayName,O.accounts,f.id),onSetDefault:f=>r.mutate({provider:O.provider,accountId:f}),onRemoveAccount:f=>m.mutate({provider:O.provider,accountId:f}),onPauseToggle:(f,q)=>ie(O.provider,f,q),onSoloMode:f=>X(O.provider,f),onBulkPause:f=>Z(O.provider,f),onBulkResume:f=>ae(O.provider,f),isRemovingAccount:m.isPending,isPausingAccount:l.isPending||g.isPending,isSoloingAccount:h.isPending,isBulkPausing:b.isPending,isBulkResuming:k.isPending})}):e.jsx(Yn,{onAddAccount:Ae,onCreateVariant:()=>D(!0)})}),e.jsx(ln,{open:j,onClose:()=>D(!1)}),e.jsx(gn,{open:v!==null,onClose:()=>I(null),provider:v?.provider||"",displayName:v?.displayName||"",catalog:w&&v?.provider?B[v.provider]:void 0,isFirstAccount:v?.isFirstAccount||!1,account:v?.account})]})}export{gi as CliproxyPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-nu4wz29m.js";import{r as x}from"./react-vendor-Bjx91N7w.js";import{a as z,bG as Ce,bH as Re,c as h,B as k,e as q,bC as ke,aZ as Ae,bI as Ge,bJ as Te,bK as Pe,bL as We,bM as Ve,bN as _e,bO as Ie,bP as De,bQ as Ee,T as Oe,O as $e,R as Ue,j as Le,k as Me,l as Fe,m as qe,n as Be,o as He,p as ze,q as Ke,_ as Qe}from"./index-B4yjQknk.js";import{A as Ye,a as Je,b as Xe,c as Ze,d as et,e as tt,f as st,g as nt}from"./alert-dialog-BIWuuEiP.js";import{u as he,a as rt,b as at,h as ot}from"./tanstack-bhJxV1h8.js";import{t as ne}from"./notifications-B4_o8bcr.js";import{bg as ge,R as F,u as it,t as lt,v as dt,A as ct,bh as ut,bi as xt,bj as gt,X as mt,e as pt,bk as ft,bl as bt,U as ht,w as yt,n as jt,x as vt,aG as Nt,T as re,aQ as St}from"./icons-DSLG1YsC.js";import{T as me}from"./Trans-dQ5QXCeL.js";async function wt(){const t=await fetch("/api/cliproxy/sync/status");if(!t.ok){let s="Failed to fetch sync status";try{const n=await t.json();s=n.error||n.message||s}catch{}throw new Error(s)}return t.json()}async function Ct(){const t=new AbortController,s=setTimeout(()=>t.abort(),3e4);try{const n=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.signal});if(!n.ok){let a="Sync failed";try{const o=await n.json();a=o.error||o.message||a}catch{}throw new Error(a)}return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):n}finally{clearTimeout(s)}}function Rt(){return he({queryKey:["cliproxy-sync-status"],queryFn:wt,refetchInterval:3e4,retry:1,staleTime:1e4})}function kt(){const t=rt(),{t:s}=z();return at({mutationFn:Ct,onSuccess:n=>{t.invalidateQueries({queryKey:["cliproxy-sync-status"]}),t.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?ne.info(s("toasts.noProfilesToSync")):ne.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{ne.error(s("toasts.syncFailed",{error:n.message}))}})}function pe(t){const s=t.trim().replace(/^v/,""),[n,a="0"]=s.split("-",2),[o=0,u=0,c=0]=n.split(".").map(y=>Number.parseInt(y,10)||0),p=/^\d+$/.test(a)&&Number.parseInt(a,10)||0;return{major:o,minor:u,patch:c,forkRelease:p}}function Y(t,s){return t>s?1:t<s?-1:0}function le(t,s){const n=pe(t),a=pe(s);return Y(n.major,a.major)||Y(n.minor,a.minor)||Y(n.patch,a.patch)||Y(n.forkRelease,a.forkRelease)}function ae(t,s){return le(t,s)>0}function oe(t,s,n){return le(t,s)>=0&&le(t,n)<=0}function fe(t){if(!/^\d+$/.test(t))return null;const s=Number(t);return Number.isSafeInteger(s)?s:null}function At(){const{t}=z(),s=Ce(),n=Re(),a=s.data?.request_retry??0,o=s.data?.max_retry_interval??0,u=s.data?.manageable!==!1,c=s.isLoading||s.isError||n.isPending||!u,p=s.error?.message??s.data?.message;return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:t("routingGuidance.retryTitle")}),e.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[t("routingGuidance.retryHint"),s.data?` · ${s.data.source} · ${s.data.target}`:""]})]}),e.jsx(Gt,{requestRetry:a,maxRetryInterval:o,disabled:c,onUpdate:(y,r)=>n.mutate({request_retry:y,max_retry_interval:r})},`${a}:${o}`)]}),p?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:p}):null]})}function Gt({requestRetry:t,maxRetryInterval:s,disabled:n,onUpdate:a}){const{t:o}=z(),[u,c]=x.useState(String(t)),[p,y]=x.useState(String(s)),[r,j]=x.useState(null),g=()=>{if(n)return;const m=fe(u.trim()),w=fe(p.trim());if(m===null||w===null){j(o("routingGuidance.retryRangeError")),c(String(t)),y(String(s));return}j(null),(m!==t||w!==s)&&a(m,w)};return e.jsxs("div",{className:"flex flex-col items-end gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{"aria-label":o("routingGuidance.requestRetryLabel"),inputMode:"numeric",className:"h-6 w-10 rounded border border-border/70 bg-background px-1.5 text-[10px] text-foreground",value:u,onChange:m=>c(m.target.value),onBlur:g,disabled:n}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"/"}),e.jsx("input",{"aria-label":o("routingGuidance.maxRetryIntervalLabel"),inputMode:"numeric",className:"h-6 w-10 rounded border border-border/70 bg-background px-1.5 text-[10px] text-foreground",value:p,onChange:m=>y(m.target.value),onBlur:g,disabled:n})]}),r?e.jsx("div",{className:"text-[10px] text-destructive",children:r}):null]})}const ie={"round-robin":{title:"Round Robin",description:"Spread requests across matching accounts for even usage."},"fill-first":{title:"Fill First",description:"Drain one healthy account first and keep backups untouched until needed."}};function be({className:t,compact:s=!1,state:n,sessionAffinityState:a,isLoading:o,isSaving:u,error:c,onApply:p,onApplyAffinity:y}){const{t:r}=z(),j=n?.strategy??"round-robin",g=n?.poolRouting?.enabled??!1,m=n?.poolRouting?.maxRetryCredentials,w=n?.poolRouting?.manageable??!0,C=!w,E=n?.poolRouting?.message??r("routingGuidance.poolRoutingLocalOnly"),R=a?.enabled??!1,f=a?.ttl??"1h",b=a?.manageable??!0,[v,B]=x.useState(j),[W,_]=x.useState(R),[A,I]=x.useState(f),[N,X]=x.useState(!1),Z=n?.source==="live"?"Live CLIProxy":"Saved startup default",O=o||u||!n||v===j,$=N?"Hide details":"Show details",V=o||u||!!c||!b,D=r(b?W?"routingGuidance.disableSessionAffinity":"routingGuidance.enableSessionAffinity":"routingGuidance.sessionAffinityUnavailable"),G=x.useRef(null),U=x.useRef(!1);x.useEffect(()=>{B(j)},[j]),x.useEffect(()=>{_(R),I(f)},[R,f]),x.useEffect(()=>{if(u||!G.current)return;const l=G.current;l.enabled===R&&l.ttl===f||(_(R),I(f)),G.current=null},[u,R,f]);const K=()=>{if(!b)return;const l=!W,d=A.trim()||"1h";G.current={enabled:l,ttl:d},_(l),y({enabled:l,ttl:d})},T=()=>{if(!b||c)return;if(U.current){U.current=!1;return}const l=A.trim()||"1h";l!==f&&(G.current={enabled:W,ttl:l},y({enabled:W,ttl:l}))};if(s){const l=d=>{B(d),d!==j&&p(d)};return e.jsxs("div",{className:h("group/routing mt-1 space-y-2 -mx-1 rounded-lg p-1",t),children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg transition-colors hover:bg-primary/5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-1 text-xs font-medium text-foreground",children:[e.jsxs("div",{className:"relative flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background border border-border/60 text-muted-foreground shadow-sm overflow-hidden transition-all duration-300 group-hover/routing:border-primary/40 group-hover/routing:text-primary group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.1)]",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/10 translate-y-full group-hover/routing:translate-y-0 transition-transform duration-300 ease-out"}),e.jsx(ge,{className:"relative z-10 h-3.5 w-3.5 transition-transform duration-300 group-hover/routing:scale-110"})]}),e.jsx("span",{className:"tracking-tight transition-colors duration-300 group-hover/routing:text-primary group-hover/routing:font-semibold",children:"Routing"}),u&&e.jsx(F,{className:"ml-1 h-3 w-3 shrink-0 animate-spin text-primary"})]}),e.jsxs("div",{className:"relative grid grid-cols-2 p-0.5 gap-0.5 rounded-lg border border-border/60 bg-muted/30 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] transition-colors duration-300 group-hover/routing:border-primary/20 group-hover/routing:bg-primary/5",children:[e.jsx("div",{className:h("absolute inset-y-0.5 left-0.5 w-[calc(50%-0.1875rem)] rounded bg-background shadow-[0_1px_3px_rgba(0,0,0,0.1),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-black/5 dark:ring-white/10 transition-all duration-300",v==="fill-first"?"translate-x-[calc(100%+0.125rem)]":"translate-x-0","group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.1)] group-hover/routing:ring-primary/30"),style:{transitionTimingFunction:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"}}),Object.entries(ie).map(([d,S])=>{const H=v===d;return e.jsx("button",{type:"button",className:h("relative z-10 flex items-center justify-center rounded px-2.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-colors duration-200",H?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>l(d),disabled:o||u||!!c,title:S.description,children:S.title},d)})]})]}),g&&w?e.jsx("div",{role:"status",className:"rounded-lg border border-amber-500/40 bg-amber-500/10 px-2 py-1.5 text-[10px] leading-4 text-amber-700 dark:text-amber-300",children:r("routingGuidance.poolRoutingApplyWarning")}):null,e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:r("routingGuidance.poolRouting")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:C?E:r(g?"routingGuidance.drainOrderHint":"routingGuidance.poolRoutingOffHint")})]}),e.jsx(k,{variant:C?"outline":g?"secondary":"outline",title:C?E:r(g?"routingGuidance.poolRoutingManaged":"routingGuidance.poolRoutingOffHint"),children:C?r("routingGuidance.localOnly"):g?`${r("routingGuidance.poolRoutingOn")} · ${r("routingGuidance.poolMaxRetry",{count:m??0})}`:r("routingGuidance.poolRoutingOff")})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-medium text-foreground",children:r("routingGuidance.sessionAffinity")}),e.jsx("div",{className:"text-[10px] text-muted-foreground",children:b?r("routingGuidance.ttlBadge",{ttl:f}):r("routingGuidance.localOnlySetting")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[b?e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-6 w-14 rounded border border-border/70 bg-background px-2 text-[10px] text-foreground",value:A,onChange:d=>I(d.target.value),onBlur:T,disabled:V}):null,e.jsx("button",{type:"button","aria-label":D,className:h("rounded border px-2 py-1 text-[10px] font-medium transition-colors",b?"border-border/70 bg-background text-foreground hover:border-primary/40 hover:text-primary":"border-border/60 bg-muted/40 text-muted-foreground"),onMouseDown:()=>{U.current=!0},onClick:K,disabled:V,title:a?.message,children:r(b?W?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff":"routingGuidance.sessionAffinityUnavailable")})]})]}),a?.message?e.jsx("div",{className:"rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5 text-[10px] text-muted-foreground",children:a.message}):null,e.jsx(At,{})]})}return e.jsx("section",{className:h("rounded-xl border border-border/70 bg-background",t),children:e.jsxs("div",{className:"grid gap-3 px-4 py-3 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-muted text-primary",children:e.jsx(ge,{className:"h-4 w-4"})}),e.jsx("div",{className:"text-sm font-medium",children:r("routingGuidance.routingStrategy")}),e.jsx(k,{variant:"secondary",children:j}),n?e.jsx(k,{variant:"outline",children:Z}):null,n?e.jsx(k,{variant:"outline",children:n.target}):null,n?e.jsxs(k,{variant:C?"outline":g?"secondary":"outline",title:C?E:r(g?"routingGuidance.poolRoutingManaged":"routingGuidance.poolRoutingOffHint"),children:[r("routingGuidance.poolRouting"),":"," ",r(C?"routingGuidance.localOnly":g?"routingGuidance.poolRoutingOn":"routingGuidance.poolRoutingOff"),!C&&g&&m!==void 0?` · ${r("routingGuidance.poolMaxRetry",{count:m})}`:""]}):null]}),e.jsx("p",{className:"max-w-3xl text-xs leading-5 text-muted-foreground",children:"Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly change it."}),e.jsx("p",{className:"max-w-3xl text-[11px] leading-5 text-muted-foreground",children:r("routingGuidance.drainOrderHint")})]}),e.jsxs("div",{className:"flex flex-col gap-2 xl:items-end",children:[e.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-border/70 bg-muted/35 p-1",children:Object.entries(ie).map(([l,d])=>{const S=v===l;return e.jsx("button",{type:"button",className:h("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",S?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>B(l),disabled:o||u||!!c,children:d.title},l)})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(q,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>X(l=>!l),children:[N?e.jsx(it,{className:"mr-1 h-3.5 w-3.5"}):e.jsx(lt,{className:"mr-1 h-3.5 w-3.5"}),$]}),e.jsx(q,{size:"sm",onClick:()=>p(v),disabled:O||!!c,children:u?"Saving...":`Use ${v}`})]}),g&&w?e.jsx("p",{role:"status",className:"max-w-xs text-[11px] leading-4 text-amber-700 dark:text-amber-400 xl:text-right",children:r("routingGuidance.poolRoutingApplyWarning")}):null]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground xl:col-span-2",children:[e.jsx("span",{children:r("routingGuidance.roundRobin")}),e.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),e.jsx("span",{children:r("routingGuidance.fillFirst")})]}),e.jsxs("div",{className:"grid gap-3 rounded-lg border border-border/70 bg-muted/20 px-3 py-3 xl:col-span-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:r("routingGuidance.sessionAffinity")}),e.jsx(k,{variant:"secondary",children:r(W?"routingGuidance.sessionAffinityOn":"routingGuidance.sessionAffinityOff")}),a?.ttl?e.jsx(k,{variant:"outline",children:r("routingGuidance.ttlBadge",{ttl:f})}):null,b?null:e.jsx(k,{variant:"outline",children:r("routingGuidance.localOnly")})]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:r("routingGuidance.sessionAffinityDescription")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("input",{"aria-label":"Session affinity TTL",className:"h-9 w-24 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground",value:A,onChange:l=>I(l.target.value),onBlur:T,disabled:V}),e.jsx(q,{type:"button",variant:"outline",onMouseDown:()=>{U.current=!0},onClick:K,disabled:V,"aria-label":D,children:D})]}),a?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-background/70 px-3 py-2 text-xs text-muted-foreground",children:a.message}):null]}),c?e.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-3 py-2 text-sm xl:col-span-2",children:c.message}):null,!c&&n?.message?e.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs text-muted-foreground xl:col-span-2",children:n.message}):null,N?e.jsxs("div",{className:"grid gap-4 border-t border-border/60 pt-3 md:grid-cols-2 xl:col-span-2",children:[Object.entries(ie).map(([l,d])=>{const S=j===l;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium",children:d.title}),S?e.jsx(k,{variant:"secondary",children:"Current"}):null]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:d.description})]},l)}),e.jsxs("div",{className:"space-y-1 md:col-span-2",children:[e.jsx("div",{className:"text-sm font-medium",children:r("routingGuidance.sessionRecognitionTitle")}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:r("routingGuidance.sessionRecognitionDescription")})]})]}):null]})})}function Tt(t){if(!t)return"";const s=new Date(t).getTime(),a=Date.now()-s,o=Math.floor(a/(1e3*60*60)),u=Math.floor(a%(1e3*60*60)/(1e3*60));return o>0?`${o}h ${u}m`:`${u}m`}function Pt(t,s){if(!t)return"";const n=Date.now()-t,a=Math.floor(n/(1e3*60)),o=Math.floor(n/(1e3*60*60));return a<1?s("proxyStatusWidget.justNow"):a<60?s("proxyStatusWidget.minutesAgo",{count:a}):s("proxyStatusWidget.hoursAgo",{count:o})}function J({icon:t,tooltip:s,onClick:n,disabled:a,isPending:o,className:u,variant:c="ghost"}){return e.jsxs(He,{children:[e.jsx(ze,{asChild:!0,children:e.jsx(q,{variant:c==="destructive-ghost"?"ghost":c,size:"sm",className:h("h-7 w-7 p-0",c==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",u),onClick:n,disabled:a,children:o?e.jsx(F,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(t,{className:"w-3.5 h-3.5"})})}),e.jsx(Ke,{side:"bottom",className:"text-xs",children:s})]})}function Ut(){const{t}=z(),{data:s,isLoading:n}=ke(),{data:a}=Ae(),{data:o,isLoading:u}=Ge(),{data:c,isLoading:p,error:y}=Te(),r=Pe(),{data:j,isLoading:g,error:m}=We(),w=Ve(),C=r.isPending||w.isPending,E=y instanceof Error?y:null,R=_e(),f=Ie(),b=De(),v=Ee(),{data:B}=Rt(),{mutate:W,isPending:_}=kt(),[A,I]=x.useState(!1),[N,X]=x.useState(""),[Z,O]=x.useState(!1),[$,V]=x.useState(null),[D,G]=x.useState(null),{data:U}=he({queryKey:["cliproxy-server-config"],queryFn:()=>Qe.cliproxyServer.get(),staleTime:3e4}),K=ot({mutationKey:["update-backend"]})>0,T=U?.remote,l=T?.enabled&&T?.host,d=j??(m instanceof Error?{source:"unsupported",target:c?.target??(l?"remote":"local"),reachable:!1,manageable:!1,message:m.message}:void 0),S=s?.running??!1,H=R.isPending||f.isPending||b.isPending||v.isPending||K||_,ye=a?.hasUpdate??!1,L=a?.isStable===!1,de=a?.currentVersion,Q=B?.configured??!1,je=t(Q?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),ee=L?a?.maxStableVersion||o?.latestStable:a?.latestVersion,ce=o?.maxStableVersion||a?.maxStableVersion||"6.6.80",M=o?.faultyRange,ve=M&&`${M.min.replace(/-\d+$/,"")}-${M.max.replace(/-\d+$/,"")}`,te=(i,P)=>{V(i),G(P),O(!0)},ue=async i=>{if(!i)return;const P=ae(i,ce);if(M!==void 0&&oe(i,M.min,M.max)){te(i,"faulty");return}if(P){te(i,"experimental");return}try{const xe=await v.mutateAsync({version:i});xe.requiresConfirmation&&te(i,xe.isFaulty?"faulty":"experimental")}catch{}},Ne=()=>{$&&v.mutate({version:$,force:!0}),O(!1),V(null),G(null)},Se=()=>{O(!1),V(null),G(null)},we=l?(()=>{const i=T.protocol||"http",P=T.port||(i==="https"?443:80);return i==="https"&&P===443||i==="http"&&P===80?T.host:`${T.host}:${P}`})():null;return l?e.jsxs("div",{className:h("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(dt,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:t("proxyStatusWidget.remoteProxy")}),e.jsx(k,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:t("proxyStatusWidget.active")})]}),e.jsx(ct,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:we})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:t("proxyStatusWidget.trafficAutoRouted")})]}),e.jsx(be,{compact:!0,className:"mt-3",state:c,sessionAffinityState:d,isLoading:p||g,isSaving:C,error:E,onApply:i=>r.mutate(i),onApplyAffinity:i=>w.mutate(i)},`remote:${c?.strategy??"round-robin"}:${d?.enabled??"na"}:${d?.ttl??"na"}:${d?.manageable??"na"}`)]}):e.jsx(Oe,{delayDuration:300,children:e.jsxs("div",{className:h("rounded-lg border p-3 transition-colors",S?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:h("w-2 h-2 rounded-full",S?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:a?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(F,{className:"w-3 h-3 animate-spin text-muted-foreground"}):S?e.jsxs(e.Fragment,{children:[e.jsx(J,{icon:_?F:ut,tooltip:t("proxyStatusWidget.tooltipSync"),onClick:()=>W(),disabled:!Q||H,isPending:_}),e.jsx(J,{icon:xt,tooltip:t("proxyStatusWidget.tooltipRestart"),onClick:()=>b.mutate(),disabled:H,isPending:b.isPending}),e.jsx(J,{icon:gt,tooltip:t("proxyStatusWidget.tooltipStop"),onClick:()=>f.mutate(),disabled:H,isPending:f.isPending,variant:"destructive-ghost"})]}):null,e.jsx(J,{icon:A?mt:pt,tooltip:t(A?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>I(!A),className:A?"bg-muted":void 0})]})]}),de&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:h("text-xs font-mono text-muted-foreground",L&&"text-amber-600 dark:text-amber-400"),children:["v",de]}),(ye||L)&&ee&&e.jsxs(k,{variant:"secondary",className:h("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",L?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>void ue(ee),title:t(L?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[L?e.jsx(ft,{className:"w-2.5 h-2.5"}):e.jsx(bt,{className:"w-2.5 h-2.5"}),ee]})]}),S&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsx("span",{className:"flex items-center gap-1",children:t("proxyStatusWidget.port",{port:s.port})}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ht,{className:"w-3 h-3"}),t("proxyStatusWidget.sessionCount",{count:s.sessionCount})]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(yt,{className:"w-3 h-3"}),Tt(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[Q?e.jsx(jt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(vt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:h("text-xs",Q?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:je})]}),e.jsx(be,{compact:!0,className:"mt-3",state:c,sessionAffinityState:d,isLoading:p||g,isSaving:C,error:E,onApply:i=>r.mutate(i),onApplyAffinity:i=>w.mutate(i)},`local:${c?.strategy??"round-robin"}:${d?.enabled??"na"}:${d?.ttl??"na"}:${d?.manageable??"na"}`),e.jsx($e,{open:A,onOpenChange:I,children:e.jsxs(Ue,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:t("proxyStatusWidget.versionManagement")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Le,{value:N,onValueChange:X,disabled:u,children:[e.jsx(Me,{className:"h-8 text-xs flex-1",children:e.jsx(Fe,{placeholder:t("proxyStatusWidget.selectVersionPlaceholder")})}),e.jsx(qe,{children:o?.versions.slice(0,20).map(i=>{const P=o?.maxStableVersion&&ae(i,o.maxStableVersion),se=o?.faultyRange&&oe(i,o.faultyRange.min,o.faultyRange.max);return e.jsx(Be,{value:i,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",i,i===o.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:t("proxyStatusWidget.stable")}),(se||P)&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},i)})})]}),e.jsxs(q,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void ue(N),disabled:v.isPending||!N,children:[v.isPending?e.jsx(F,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Nt,{className:"w-3.5 h-3.5"}),t("proxyStatusWidget.install")]})]}),N&&o?.maxStableVersion&&ae(N,o.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(re,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsAboveUnstable",{version:o.maxStableVersion})})]}),N&&o?.faultyRange&&oe(N,o.faultyRange.min,o.faultyRange.max)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(re,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{children:t("proxyStatusWidget.versionsKnownIssues",{version:N})})]}),a?.checkedAt&&e.jsx("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:t("proxyStatusWidget.lastChecked",{time:Pt(a.checkedAt,t)})})]})}),!S&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:t("proxyStatusWidget.notRunning")}),e.jsxs(q,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>R.mutate(),disabled:R.isPending,children:[R.isPending?e.jsx(F,{className:"w-3 h-3 animate-spin"}):e.jsx(St,{className:"w-3 h-3"}),t("proxyStatusWidget.start")]})]}),e.jsx(Ye,{open:Z,onOpenChange:O,children:e.jsxs(Je,{children:[e.jsxs(Xe,{children:[e.jsxs(Ze,{className:"flex items-center gap-2",children:[e.jsx(re,{className:"w-5 h-5 text-amber-500"}),t(D==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),e.jsxs(et,{className:"space-y-2",children:[D==="faulty"?e.jsx("p",{children:e.jsx(me,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:$??"",range:ve||""},components:{strong:e.jsx("strong",{})}})}):e.jsx("p",{children:e.jsx(me,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:$??"",maxStable:ce},components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:t(D==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),e.jsx("p",{children:t("proxyStatusWidget.installUnstableConfirm")})]})]}),e.jsxs(tt,{children:[e.jsx(st,{onClick:Se,children:t("proxyStatusWidget.cancel")}),e.jsx(nt,{onClick:Ne,className:"bg-amber-500 hover:bg-amber-600 text-white",children:t("proxyStatusWidget.installAnyway")})]})]})})]})})}export{Ut as P};
|