@kaitranntt/ccs 7.65.3-dev.5 → 7.65.3-dev.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cliproxy/gemini-cli-quota-normalizer.d.ts +10 -0
  2. package/dist/cliproxy/gemini-cli-quota-normalizer.d.ts.map +1 -0
  3. package/dist/cliproxy/gemini-cli-quota-normalizer.js +122 -0
  4. package/dist/cliproxy/gemini-cli-quota-normalizer.js.map +1 -0
  5. package/dist/cliproxy/quota-fetcher-gemini-cli.d.ts.map +1 -1
  6. package/dist/cliproxy/quota-fetcher-gemini-cli.js +133 -92
  7. package/dist/cliproxy/quota-fetcher-gemini-cli.js.map +1 -1
  8. package/dist/cliproxy/quota-types.d.ts +8 -0
  9. package/dist/cliproxy/quota-types.d.ts.map +1 -1
  10. package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
  11. package/dist/commands/cliproxy/quota-subcommand.js +10 -1
  12. package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
  13. package/dist/ui/assets/{accounts-DydnQzgm.js → accounts-rvVKHaAe.js} +1 -1
  14. package/dist/ui/assets/{alert-dialog-DOUspkbq.js → alert-dialog-BbaHYket.js} +1 -1
  15. package/dist/ui/assets/{api-DNYsuq4x.js → api-CdjX3Px8.js} +1 -1
  16. package/dist/ui/assets/{auth-section-BvpD3RS7.js → auth-section-Ci-UJJLe.js} +1 -1
  17. package/dist/ui/assets/{backups-section-DURWDTac.js → backups-section-vJ7IO1sK.js} +1 -1
  18. package/dist/ui/assets/{channels-AbS1sN-W.js → channels-DwwSb-3J.js} +1 -1
  19. package/dist/ui/assets/{checkbox-B5Lit8QF.js → checkbox-DT-UFQJk.js} +1 -1
  20. package/dist/ui/assets/{claude-extension-B0dFOmKy.js → claude-extension-CKaWtTwW.js} +1 -1
  21. package/dist/ui/assets/{cliproxy-BCI5YlnL.js → cliproxy-CJMCkgVj.js} +1 -1
  22. package/dist/ui/assets/{cliproxy-ai-providers-DvUfCxgt.js → cliproxy-ai-providers-QGQv_Rm5.js} +1 -1
  23. package/dist/ui/assets/{cliproxy-control-panel-CR62auj_.js → cliproxy-control-panel-CzVY_5AR.js} +1 -1
  24. package/dist/ui/assets/{codex-DJ-5MYMn.js → codex-BGGeUuPT.js} +1 -1
  25. package/dist/ui/assets/{confirm-dialog-Bv5e6wLU.js → confirm-dialog-CnJqC2F2.js} +1 -1
  26. package/dist/ui/assets/{copilot-DKIYFMqy.js → copilot-D2RQe_Nq.js} +1 -1
  27. package/dist/ui/assets/{cursor-_cVBiFRo.js → cursor-BJueS_e3.js} +1 -1
  28. package/dist/ui/assets/{droid-CURy1J1B.js → droid-BZOw9xRf.js} +1 -1
  29. package/dist/ui/assets/{globalenv-section-hCoQyBd2.js → globalenv-section-C5exh7Ap.js} +1 -1
  30. package/dist/ui/assets/{health-BfalUDVT.js → health-CQid0fS9.js} +1 -1
  31. package/dist/ui/assets/{index-4Jsuc2f5.js → index-BXKbxfKP.js} +1 -1
  32. package/dist/ui/assets/{index-yL6O3RZK.js → index-B_kS_dTW.js} +1 -1
  33. package/dist/ui/assets/{index-Bla3ipXd.js → index-CABQHwxO.js} +1 -1
  34. package/dist/ui/assets/{index-xNbxbW9a.js → index-CBVdtvg-.js} +1 -1
  35. package/dist/ui/assets/{index-B0ldN0FQ.js → index-Cs8g45EE.js} +1 -1
  36. package/dist/ui/assets/{index-BryKrspY.js → index-UIwtTLLQ.js} +27 -27
  37. package/dist/ui/assets/{masked-input-C5Hs_PGA.js → masked-input-BVKU0MZm.js} +1 -1
  38. package/dist/ui/assets/{proxy-status-widget-tSM53-9w.js → proxy-status-widget-BqtEAZ_D.js} +1 -1
  39. package/dist/ui/assets/{raw-json-settings-editor-panel-B5NU6aU5.js → raw-json-settings-editor-panel-iUT3Xx_q.js} +1 -1
  40. package/dist/ui/assets/{searchable-select-TbG7cJnX.js → searchable-select-Bn68YiWQ.js} +1 -1
  41. package/dist/ui/assets/{separator-Dpow4cyX.js → separator-D1aCix7x.js} +1 -1
  42. package/dist/ui/assets/{shared-Dhtjjkgw.js → shared-Bnl_yFjp.js} +1 -1
  43. package/dist/ui/assets/{table-BdCALHGf.js → table-CL3tEvr_.js} +1 -1
  44. package/dist/ui/assets/{updates-D4PGHp-0.js → updates-D3G-92Wl.js} +1 -1
  45. package/dist/ui/index.html +1 -1
  46. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"quota-subcommand.js","sourceRoot":"","sources":["../../../src/commands/cliproxy/quota-subcommand.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,oEAMwC;AACxC,gEAAsE;AACtE,4EAAyE;AACzE,8EAA2E;AAC3E,oGAAuG;AACvG,sFAAkF;AAClF,0EAAuE;AAQvE,gEAA4D;AAE5D,gFAG8C;AAC9C,2FAA0F;AAC1F,uCAAoG;AAWpG,SAAS,gBAAgB,CAAC,IAAc;IACtC,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,KAAK,YAAY,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACxC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9B,CAAC;aAAM,IAAI,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5C,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3B,CAAC;aAAM,IAAI,GAAG,KAAK,WAAW,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC9C,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC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,OAAE,EAAC,oBAAoB,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,IAAA,SAAI,EAAC,yCAAyC,CAAC,CAAC,CAAC;IAC/D,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,IAAA,SAAI,EAAC,0BAA0B,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAjCD,kDAiCC"}
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-C98W0NRG.js";import{r as j,h as fe}from"./react-vendor-CNOkPC89.js";import{u as ye,a as L,b as z,e as be,f as B,g as Ne}from"./tanstack-CfKik0yL.js";import{T as Ce,a as ve,b as V,c as Pe,d as Ae,e as Se}from"./table-BdCALHGf.js";import{Y as T,a as G,af as oe,ag as re,ah as ie,ai as le,aj as de,L as v,r as Z,s as I,t as Q,v as X,w as O,I as $,ax as De,d as u,C as A,j as S,k as D,_ as w,B as F,b as k,M as ue,N as xe,c as M,O as me,n as ke,x as W}from"./index-BryKrspY.js";import{A as Te,a as _e,b as we,c as Me,d as Le,e as ze,f as Ge,g as Oe}from"./alert-dialog-DOUspkbq.js";import{t as y}from"./notifications-B2HqRBj7.js";import{aT as Fe,aU as He,l as q,am as Re,N as $e,Y as qe,n as Y,aV as Ee,at as H,aW as Ue,aX as Ke,r as he,aY as Be,aM as Ve,U as Ze,a6 as J,Z as ee,T as Ie}from"./icons-CeH5899d.js";import{C as te}from"./checkbox-B5Lit8QF.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Qe(){return ye({queryKey:["accounts"],queryFn:()=>T.accounts.list(),select:s=>{const a=s.accounts.filter(i=>i.type!=="cliproxy"),t=s.accounts.length-a.length,c=a.filter(i=>i.context_mode==="shared").length,o=a.filter(i=>i.context_mode==="shared"&&i.continuity_mode==="deeper").length,x=Math.max(c-o,0),l=a.length-c,m=a.filter(i=>i.context_inferred).length,g=a.filter(i=>i.context_mode==="shared"&&i.continuity_mode!=="deeper"&&i.continuity_inferred).length,p=a.some(i=>i.name===s.default)?s.default:null;return{accounts:a,default:p,cliproxyCount:t,legacyContextCount:m,legacyContinuityCount:g,sharedCount:c,sharedStandardCount:x,deeperSharedCount:o,isolatedCount:l}}})}function Xe(){const s=L();return z({mutationFn:a=>T.accounts.setDefault(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),y.success(`Default account set to "${t}"`)},onError:a=>{y.error(a.message)}})}function We(){const s=L();return z({mutationFn:()=>T.accounts.resetDefault(),onSuccess:()=>{s.invalidateQueries({queryKey:["accounts"]}),y.success("Default account reset to CCS")},onError:a=>{y.error(a.message)}})}function Ye(){const s=L();return z({mutationFn:a=>T.accounts.delete(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),y.success(`Account "${t}" deleted`)},onError:a=>{y.error(a.message)}})}function ge(){const s=L();return z({mutationFn:({name:a,context_mode:t,context_group:c,continuity_mode:o})=>T.accounts.updateContext(a,{context_mode:t,context_group:c,continuity_mode:o}),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]});const c=t.context_mode==="shared"?t.continuity_mode==="deeper"?`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, deeper continuity)`:`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, standard)`:"isolated";y.success(`Updated "${t.name}" context to ${c}`)},onError:a=>{y.error(a.message)}})}function Je(){const s=L();return z({mutationFn:async a=>{const t=a.filter(c=>c.context_inferred||c.continuity_inferred);for(const c of t){const o=c.context_mode==="shared";await T.accounts.updateContext(c.name,{context_mode:o?"shared":"isolated",context_group:o?c.context_group||"default":void 0,continuity_mode:o?c.continuity_mode==="deeper"?"deeper":"standard":void 0})}return{updatedCount:t.length}},onSuccess:({updatedCount:a})=>{if(s.invalidateQueries({queryKey:["accounts"]}),a>0){y.success(`Confirmed explicit sync mode for ${a} legacy account${a>1?"s":""}`);return}y.info("No legacy accounts need confirmation")},onError:a=>{y.error(a.message)}})}const se=64,et=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function tt({account:s,onClose:a}){const{t}=G(),c=ge(),[o,x]=j.useState(s.context_mode==="shared"?"shared":"isolated"),[l,m]=j.useState(s.context_group||"default"),[g,p]=j.useState(s.continuity_mode==="deeper"?"deeper":"standard"),i=j.useMemo(()=>l.trim().toLowerCase().replace(/\s+/g,"-"),[l]),b=i.length>0&&i.length<=se&&et.test(i),f=o==="isolated"||b,n=()=>{f&&c.mutate({name:s.name,context_mode:o,context_group:o==="shared"?i:void 0,continuity_mode:o==="shared"?g:void 0},{onSuccess:()=>{a()}})},r=d=>{d||a()};return e.jsx(oe,{open:!0,onOpenChange:r,children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsx(le,{children:t("editAccountContext.title")}),e.jsx(de,{children:t("editAccountContext.description",{name:s.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-mode",children:t("editAccountContext.syncMode")}),e.jsxs(Z,{value:o,onValueChange:d=>x(d),children:[e.jsx(I,{id:"context-mode",children:e.jsx(Q,{placeholder:t("editAccountContext.selectContextMode")})}),e.jsxs(X,{children:[e.jsx(O,{value:"isolated",children:t("editAccountContext.isolatedOption")}),e.jsx(O,{value:"shared",children:t("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(o==="shared"?"editAccountContext.sharedModeHint":"editAccountContext.isolatedModeHint")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-group",children:t("editAccountContext.historySyncGroup")}),e.jsx($,{id:"context-group",value:l,onChange:d=>m(d.target.value),placeholder:t("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.groupHint",{max:se})}),!b&&e.jsx("p",{className:"text-xs text-destructive",children:t("editAccountContext.invalidGroup")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"continuity-mode",children:t("editAccountContext.continuityDepth")}),e.jsxs(Z,{value:g,onValueChange:d=>p(d),children:[e.jsx(I,{id:"continuity-mode",children:e.jsx(Q,{placeholder:t("editAccountContext.selectContinuityDepth")})}),e.jsxs(X,{children:[e.jsx(O,{value:"standard",children:t("editAccountContext.standardOption")}),e.jsx(O,{value:"deeper",children:t("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(g==="deeper"?"editAccountContext.deeperHint":"editAccountContext.standardHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.credentialsIsolated")})]}),e.jsxs(De,{children:[e.jsx(u,{variant:"outline",onClick:a,disabled:c.isPending,children:t("editAccountContext.cancel")}),e.jsx(u,{onClick:n,disabled:!f||c.isPending,children:c.isPending?t("editAccountContext.saving"):t("editAccountContext.save")})]})]})})}function ae({data:s,defaultAccount:a}){const{t}=G(),c=Xe(),o=Ye(),x=We(),l=ge(),[m,g]=j.useState(null),[p,i]=j.useState(null),b=[{accessorKey:"name",header:t("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===a&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:t("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:t("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:t("accountsTable.created"),size:150,cell:({row:n})=>{const r=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{accessorKey:"last_used",header:t("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const r=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{id:"context",header:t("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const d=n.original.context_group||"default";return n.original.continuity_mode==="deeper"?e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupDeeper",{group:d})}):n.original.continuity_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.sharedGroupLegacy",{group:d})}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupStandard",{group:d})})}return n.original.context_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.isolatedLegacy")}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.isolated")})}},{id:"actions",header:t("accountsTable.actions"),size:220,cell:({row:n})=>{const r=n.original.name===a,d=c.isPending||o.isPending||l.isPending,N=n.original.type==="cliproxy",P=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!N&&e.jsxs(u,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:d,onClick:()=>i(n.original),title:t("accountsTable.syncTitle"),children:[e.jsx(Fe,{className:"w-3.5 h-3.5 mr-1"}),t("accountsTable.sync")]}),!N&&P&&e.jsxs(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:d,onClick:()=>l.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:t("accountsTable.confirmLegacyTitle"),children:[e.jsx(He,{className:"w-3 h-3 mr-1"}),t("accountsTable.confirm")]}),e.jsxs(u,{variant:r?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:r||d,onClick:()=>c.mutate(n.original.name),children:[e.jsx(q,{className:`w-3 h-3 mr-1 ${r?"opacity-50":""}`}),t(r?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:r||d,onClick:()=>g(n.original.name),title:t(r?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(Re,{className:"w-4 h-4"})})]})}}],f=be({data:s,columns:b,getCoreRowModel:Ne()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:t("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Ce,{children:[e.jsx(ve,{children:f.getHeaderGroups().map(n=>e.jsx(V,{children:n.headers.map(r=>{const d={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",context:"w-[170px]",actions:"w-[290px]"}[r.id]||"w-auto";return e.jsx(Pe,{className:d,children:r.isPlaceholder?null:B(r.column.columnDef.header,r.getContext())},r.id)})},n.id))}),e.jsx(Ae,{children:f.getRowModel().rows.map(n=>e.jsx(V,{children:n.getVisibleCells().map(r=>e.jsx(Se,{children:B(r.column.columnDef.cell,r.getContext())},r.id))},n.id))})]})}),a&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(u,{variant:"outline",size:"sm",onClick:()=>x.mutate(),disabled:x.isPending,children:[e.jsx($e,{className:"w-4 h-4 mr-2"}),t("accountsTable.resetToDefault")]})})]}),p&&e.jsx(tt,{account:p,onClose:()=>i(null)}),e.jsx(Te,{open:!!m,onOpenChange:n=>!n&&g(null),children:e.jsxs(_e,{children:[e.jsxs(we,{children:[e.jsx(Me,{children:t("accountsTable.deleteDialogTitle")}),e.jsx(Le,{children:t("accountsTable.deleteDialogDesc",{name:m??""})})]}),e.jsxs(ze,{children:[e.jsx(Ge,{children:t("accountsTable.cancel")}),e.jsx(Oe,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{m&&(o.mutate(m),g(null))},children:t("accountsTable.delete")})]})]})})]})}const ne=64;function st({open:s,onClose:a}){const{t}=G(),[c,o]=j.useState(""),[x,l]=j.useState(!1),[m,g]=j.useState(""),[p,i]=j.useState(!1),[b,f]=j.useState(!1),n=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(c),r=m.trim().toLowerCase().replace(/\s+/g,"-"),d=r.length===0||r.length<=ne&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r),N=c&&n?[`ccs auth create ${c}`,x?r.length>0?`--context-group ${r}`:"--share-context":"",x&&p?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),P=async()=>{!n||x&&!d||(await navigator.clipboard.writeText(N),f(!0),setTimeout(()=>f(!1),2e3))},_=()=>{o(""),l(!1),g(""),i(!1),f(!1),a()};return e.jsx(oe,{open:s,onOpenChange:h=>!h&&_(),children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsx(le,{children:t("createAuthProfileDialog.title")}),e.jsx(de,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx($,{id:"profile-name",value:c,onChange:h=>o(h.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),c&&!n&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{id:"share-context",checked:x,onCheckedChange:h=>l(h===!0)}),e.jsx(v,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),x&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(v,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx($,{id:"context-group",value:m,onChange:h=>g(h.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(te,{id:"deeper-continuity",checked:p,onCheckedChange:h=>i(h===!0)}),e.jsx(v,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),m.trim().length>0&&!d&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ne})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(qe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:N}),e.jsx(u,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:P,disabled:!n||x&&!d,children:b?e.jsx(q,{className:"w-4 h-4 text-green-500"}):e.jsx(Y,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(u,{variant:"ghost",onClick:_,children:t("createAuthProfileDialog.close")}),e.jsx(u,{onClick:P,disabled:!n||x&&!d,children:b?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function R({title:s,count:a,icon:t,tone:c}){const o={isolated:{border:"border-blue-300/60 bg-blue-50/40 dark:border-blue-900/40 dark:bg-blue-900/10",icon:"text-blue-700 dark:text-blue-400",count:"text-blue-700 dark:text-blue-400"},shared:{border:"border-emerald-300/60 bg-emerald-50/40 dark:border-emerald-900/40 dark:bg-emerald-900/10",icon:"text-emerald-700 dark:text-emerald-400",count:"text-emerald-700 dark:text-emerald-400"},deeper:{border:"border-indigo-300/60 bg-indigo-50/40 dark:border-indigo-900/40 dark:bg-indigo-900/10",icon:"text-indigo-700 dark:text-indigo-400",count:"text-indigo-700 dark:text-indigo-400"}};return e.jsxs("div",{className:M("rounded-md border p-2.5",o[c].border),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-semibold",children:s}),e.jsx(t,{className:M("h-3.5 w-3.5",o[c].icon)})]}),e.jsx("p",{className:M("mt-1 text-lg font-mono font-semibold",o[c].count),children:a})]})}function ce({isolatedCount:s,sharedStandardCount:a,deeperSharedCount:t,sharedGroups:c,legacyTargetCount:o,cliproxyCount:x}){const{t:l}=G(),[m,g]=j.useState(!1),p=c.length>0?c:["default"];return e.jsxs(A,{className:"border-dashed",children:[e.jsx(S,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(D,{className:"text-base",children:l("historySyncLearningMap.title")}),e.jsx(w,{className:"mt-1",children:l("historySyncLearningMap.description")})]}),e.jsx(F,{variant:"outline",children:l("historySyncLearningMap.learningMap")})]})}),e.jsxs(k,{className:"space-y-3",children:[x>0&&e.jsx("div",{className:"rounded-md border border-blue-300/60 bg-blue-50/40 px-3 py-2 text-xs text-blue-800 dark:border-blue-900/40 dark:bg-blue-900/10 dark:text-blue-300",children:l("historySyncLearningMap.cliproxyManaged",{count:x})}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_1fr_auto_1fr] sm:items-center",children:[e.jsx(R,{title:l("historySyncLearningMap.isolated"),count:s,icon:Ee,tone:"isolated"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(H,{className:"h-4 w-4"})}),e.jsx(R,{title:l("historySyncLearningMap.shared"),count:a,icon:Ue,tone:"shared"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(H,{className:"h-4 w-4"})}),e.jsx(R,{title:l("historySyncLearningMap.deeper"),count:t,icon:Ke,tone:"deeper"})]}),e.jsxs(ue,{open:m,onOpenChange:g,children:[e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-8 w-full justify-between rounded-md px-2 text-xs text-muted-foreground hover:bg-muted/40 hover:text-foreground",children:[e.jsx("span",{children:l("historySyncLearningMap.showDetails")}),e.jsx(he,{className:M("h-4 w-4 transition-transform",m&&"rotate-180")})]})}),e.jsxs(me,{className:"pt-2",children:[e.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:l("historySyncLearningMap.modeSwitch")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:l("historySyncLearningMap.modeSwitchDesc")})]}),e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:l("historySyncLearningMap.historySyncGroup")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:l("historySyncLearningMap.historySyncGroupDesc")}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:p.map(i=>e.jsx(F,{variant:"outline",className:"font-mono text-[10px]",children:i},i))})]})]}),o>0&&e.jsx("div",{className:"mt-2 rounded-md border border-amber-500/50 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-300",children:l("historySyncLearningMap.legacyConfirmation",{count:o})})]})]})]})]})}function gt(){const{t:s}=G(),a=fe(),{data:t,isLoading:c}=Qe(),o=Je(),[x,l]=j.useState(!1),[m,g]=j.useState(!1),p=t?.accounts||[],i=t?.cliproxyCount||0,b=t?.legacyContextCount||0,f=t?.legacyContinuityCount||0,n=t?.sharedCount||0,r=t?.sharedStandardCount||0,d=t?.deeperSharedCount||0,N=t?.isolatedCount||0,P=Array.from(new Set(p.filter(C=>C.context_mode==="shared").map(C=>C.context_group||"default"))).sort((C,je)=>C.localeCompare(je)),_=p.filter(C=>C.context_inferred||C.continuity_inferred),h=_.length,pe=h>0,E=()=>a("/cliproxy?provider=claude"),U=()=>a("/cliproxy?provider=claude&action=auth"),K=()=>o.mutate(_);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ze,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.manageSuffix")]})]}),e.jsx(ke,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.primaryActions")}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:()=>l(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:U,children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),s("accountsPage.authClaudeInPool")]}),e.jsxs(u,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:E,children:[s("accountsPage.openClaudePoolSettings"),e.jsx(H,{className:"w-4 h-4 ml-auto"})]})]}),pe?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ie,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContextPending",{count:b})}),f>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContinuityPending",{count:f})})]})]}),e.jsx(u,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:K,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:s("accountsPage.noLegacyFollowup")}),e.jsx(ue,{open:m,onOpenChange:g,children:e.jsxs(A,{children:[e.jsx(S,{className:"pb-2",children:e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-auto w-full justify-between px-0 py-0",children:[e.jsxs("div",{className:"text-left",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.continuityGuide")}),e.jsx(w,{className:"mt-1",children:s("accountsPage.expandWhenNeeded")})]}),e.jsx(he,{className:M("h-4 w-4 transition-transform",m&&"rotate-180")})]})})}),e.jsx(me,{children:e.jsxs(k,{className:"space-y-3 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedStandard")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.sharedStandardDesc")})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedDeeper")}),e.jsxs("p",{className:"mt-1",children:[s("accountsPage.sharedDeeperPrefix")," ",e.jsx("code",{children:"session-env"}),","," ",e.jsx("code",{children:"file-history"}),", ",e.jsx("code",{children:"shell-snapshots"}),","," ",e.jsx("code",{children:"todos"}),"."]})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.isolated")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.isolatedDesc")})]})]})})]})}),e.jsxs(A,{children:[e.jsxs(S,{className:"pb-2",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.quickCommands")}),e.jsx(w,{children:s("accountsPage.quickCommandsDesc")})]}),e.jsxs(k,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --context-group sprint-a --deeper-continuity"}),e.jsx(W,{value:"ccs auth create work --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(W,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{variant:"outline",children:s("accountsPage.workspaceBadge")}),e.jsx(F,{variant:"secondary",children:s("accountsPage.historySyncBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:s("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[s("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:s("accountsTable.sync")}),s("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(ce,{isolatedCount:N,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:P,legacyTargetCount:h,cliproxyCount:i}),e.jsxs(A,{className:"flex flex-col",children:[e.jsxs(S,{className:"pb-3",children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.accountMatrix")}),e.jsx(w,{children:s("accountsPage.sharedTotalDesc",{count:n})})]}),e.jsx(k,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(A,{children:[e.jsxs(S,{children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.title")}),e.jsxs(w,{children:[s("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.mobileManageSuffix")]})]}),e.jsxs(k,{className:"space-y-2",children:[e.jsxs(u,{className:"w-full",onClick:()=>l(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:E,children:[s("accountsPage.openCliProxyClaudePool"),e.jsx(H,{className:"w-4 h-4 ml-2"})]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:U,children:[s("accountsPage.authClaudeInPool"),e.jsx(ee,{className:"w-4 h-4 ml-2"})]}),e.jsx(u,{variant:"outline",className:"w-full",onClick:K,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}),e.jsx(ce,{isolatedCount:N,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:P,legacyTargetCount:h,cliproxyCount:i}),e.jsxs(A,{children:[e.jsx(S,{className:"pb-3",children:e.jsx(D,{className:"text-base",children:s("accountsPage.accountMatrix")})}),e.jsx(k,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]}),e.jsx(st,{open:x,onClose:()=>l(!1)})]})}export{gt as AccountsPage};
1
+ import{j as e}from"./radix-ui-C98W0NRG.js";import{r as j,h as fe}from"./react-vendor-CNOkPC89.js";import{u as ye,a as L,b as z,e as be,f as B,g as Ne}from"./tanstack-CfKik0yL.js";import{T as Ce,a as ve,b as V,c as Pe,d as Ae,e as Se}from"./table-CL3tEvr_.js";import{Y as T,a as G,af as oe,ag as re,ah as ie,ai as le,aj as de,L as v,r as Z,s as I,t as Q,v as X,w as O,I as $,ax as De,d as u,C as A,j as S,k as D,_ as w,B as F,b as k,M as ue,N as xe,c as M,O as me,n as ke,x as W}from"./index-UIwtTLLQ.js";import{A as Te,a as _e,b as we,c as Me,d as Le,e as ze,f as Ge,g as Oe}from"./alert-dialog-BbaHYket.js";import{t as y}from"./notifications-B2HqRBj7.js";import{aT as Fe,aU as He,l as q,am as Re,N as $e,Y as qe,n as Y,aV as Ee,at as H,aW as Ue,aX as Ke,r as he,aY as Be,aM as Ve,U as Ze,a6 as J,Z as ee,T as Ie}from"./icons-CeH5899d.js";import{C as te}from"./checkbox-DT-UFQJk.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Qe(){return ye({queryKey:["accounts"],queryFn:()=>T.accounts.list(),select:s=>{const a=s.accounts.filter(i=>i.type!=="cliproxy"),t=s.accounts.length-a.length,c=a.filter(i=>i.context_mode==="shared").length,o=a.filter(i=>i.context_mode==="shared"&&i.continuity_mode==="deeper").length,x=Math.max(c-o,0),l=a.length-c,m=a.filter(i=>i.context_inferred).length,g=a.filter(i=>i.context_mode==="shared"&&i.continuity_mode!=="deeper"&&i.continuity_inferred).length,p=a.some(i=>i.name===s.default)?s.default:null;return{accounts:a,default:p,cliproxyCount:t,legacyContextCount:m,legacyContinuityCount:g,sharedCount:c,sharedStandardCount:x,deeperSharedCount:o,isolatedCount:l}}})}function Xe(){const s=L();return z({mutationFn:a=>T.accounts.setDefault(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),y.success(`Default account set to "${t}"`)},onError:a=>{y.error(a.message)}})}function We(){const s=L();return z({mutationFn:()=>T.accounts.resetDefault(),onSuccess:()=>{s.invalidateQueries({queryKey:["accounts"]}),y.success("Default account reset to CCS")},onError:a=>{y.error(a.message)}})}function Ye(){const s=L();return z({mutationFn:a=>T.accounts.delete(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),y.success(`Account "${t}" deleted`)},onError:a=>{y.error(a.message)}})}function ge(){const s=L();return z({mutationFn:({name:a,context_mode:t,context_group:c,continuity_mode:o})=>T.accounts.updateContext(a,{context_mode:t,context_group:c,continuity_mode:o}),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]});const c=t.context_mode==="shared"?t.continuity_mode==="deeper"?`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, deeper continuity)`:`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, standard)`:"isolated";y.success(`Updated "${t.name}" context to ${c}`)},onError:a=>{y.error(a.message)}})}function Je(){const s=L();return z({mutationFn:async a=>{const t=a.filter(c=>c.context_inferred||c.continuity_inferred);for(const c of t){const o=c.context_mode==="shared";await T.accounts.updateContext(c.name,{context_mode:o?"shared":"isolated",context_group:o?c.context_group||"default":void 0,continuity_mode:o?c.continuity_mode==="deeper"?"deeper":"standard":void 0})}return{updatedCount:t.length}},onSuccess:({updatedCount:a})=>{if(s.invalidateQueries({queryKey:["accounts"]}),a>0){y.success(`Confirmed explicit sync mode for ${a} legacy account${a>1?"s":""}`);return}y.info("No legacy accounts need confirmation")},onError:a=>{y.error(a.message)}})}const se=64,et=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function tt({account:s,onClose:a}){const{t}=G(),c=ge(),[o,x]=j.useState(s.context_mode==="shared"?"shared":"isolated"),[l,m]=j.useState(s.context_group||"default"),[g,p]=j.useState(s.continuity_mode==="deeper"?"deeper":"standard"),i=j.useMemo(()=>l.trim().toLowerCase().replace(/\s+/g,"-"),[l]),b=i.length>0&&i.length<=se&&et.test(i),f=o==="isolated"||b,n=()=>{f&&c.mutate({name:s.name,context_mode:o,context_group:o==="shared"?i:void 0,continuity_mode:o==="shared"?g:void 0},{onSuccess:()=>{a()}})},r=d=>{d||a()};return e.jsx(oe,{open:!0,onOpenChange:r,children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsx(le,{children:t("editAccountContext.title")}),e.jsx(de,{children:t("editAccountContext.description",{name:s.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-mode",children:t("editAccountContext.syncMode")}),e.jsxs(Z,{value:o,onValueChange:d=>x(d),children:[e.jsx(I,{id:"context-mode",children:e.jsx(Q,{placeholder:t("editAccountContext.selectContextMode")})}),e.jsxs(X,{children:[e.jsx(O,{value:"isolated",children:t("editAccountContext.isolatedOption")}),e.jsx(O,{value:"shared",children:t("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(o==="shared"?"editAccountContext.sharedModeHint":"editAccountContext.isolatedModeHint")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-group",children:t("editAccountContext.historySyncGroup")}),e.jsx($,{id:"context-group",value:l,onChange:d=>m(d.target.value),placeholder:t("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.groupHint",{max:se})}),!b&&e.jsx("p",{className:"text-xs text-destructive",children:t("editAccountContext.invalidGroup")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"continuity-mode",children:t("editAccountContext.continuityDepth")}),e.jsxs(Z,{value:g,onValueChange:d=>p(d),children:[e.jsx(I,{id:"continuity-mode",children:e.jsx(Q,{placeholder:t("editAccountContext.selectContinuityDepth")})}),e.jsxs(X,{children:[e.jsx(O,{value:"standard",children:t("editAccountContext.standardOption")}),e.jsx(O,{value:"deeper",children:t("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(g==="deeper"?"editAccountContext.deeperHint":"editAccountContext.standardHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.credentialsIsolated")})]}),e.jsxs(De,{children:[e.jsx(u,{variant:"outline",onClick:a,disabled:c.isPending,children:t("editAccountContext.cancel")}),e.jsx(u,{onClick:n,disabled:!f||c.isPending,children:c.isPending?t("editAccountContext.saving"):t("editAccountContext.save")})]})]})})}function ae({data:s,defaultAccount:a}){const{t}=G(),c=Xe(),o=Ye(),x=We(),l=ge(),[m,g]=j.useState(null),[p,i]=j.useState(null),b=[{accessorKey:"name",header:t("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===a&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:t("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:t("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:t("accountsTable.created"),size:150,cell:({row:n})=>{const r=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{accessorKey:"last_used",header:t("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const r=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{id:"context",header:t("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const d=n.original.context_group||"default";return n.original.continuity_mode==="deeper"?e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupDeeper",{group:d})}):n.original.continuity_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.sharedGroupLegacy",{group:d})}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupStandard",{group:d})})}return n.original.context_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.isolatedLegacy")}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.isolated")})}},{id:"actions",header:t("accountsTable.actions"),size:220,cell:({row:n})=>{const r=n.original.name===a,d=c.isPending||o.isPending||l.isPending,N=n.original.type==="cliproxy",P=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!N&&e.jsxs(u,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:d,onClick:()=>i(n.original),title:t("accountsTable.syncTitle"),children:[e.jsx(Fe,{className:"w-3.5 h-3.5 mr-1"}),t("accountsTable.sync")]}),!N&&P&&e.jsxs(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:d,onClick:()=>l.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:t("accountsTable.confirmLegacyTitle"),children:[e.jsx(He,{className:"w-3 h-3 mr-1"}),t("accountsTable.confirm")]}),e.jsxs(u,{variant:r?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:r||d,onClick:()=>c.mutate(n.original.name),children:[e.jsx(q,{className:`w-3 h-3 mr-1 ${r?"opacity-50":""}`}),t(r?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:r||d,onClick:()=>g(n.original.name),title:t(r?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(Re,{className:"w-4 h-4"})})]})}}],f=be({data:s,columns:b,getCoreRowModel:Ne()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:t("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Ce,{children:[e.jsx(ve,{children:f.getHeaderGroups().map(n=>e.jsx(V,{children:n.headers.map(r=>{const d={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",context:"w-[170px]",actions:"w-[290px]"}[r.id]||"w-auto";return e.jsx(Pe,{className:d,children:r.isPlaceholder?null:B(r.column.columnDef.header,r.getContext())},r.id)})},n.id))}),e.jsx(Ae,{children:f.getRowModel().rows.map(n=>e.jsx(V,{children:n.getVisibleCells().map(r=>e.jsx(Se,{children:B(r.column.columnDef.cell,r.getContext())},r.id))},n.id))})]})}),a&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(u,{variant:"outline",size:"sm",onClick:()=>x.mutate(),disabled:x.isPending,children:[e.jsx($e,{className:"w-4 h-4 mr-2"}),t("accountsTable.resetToDefault")]})})]}),p&&e.jsx(tt,{account:p,onClose:()=>i(null)}),e.jsx(Te,{open:!!m,onOpenChange:n=>!n&&g(null),children:e.jsxs(_e,{children:[e.jsxs(we,{children:[e.jsx(Me,{children:t("accountsTable.deleteDialogTitle")}),e.jsx(Le,{children:t("accountsTable.deleteDialogDesc",{name:m??""})})]}),e.jsxs(ze,{children:[e.jsx(Ge,{children:t("accountsTable.cancel")}),e.jsx(Oe,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{m&&(o.mutate(m),g(null))},children:t("accountsTable.delete")})]})]})})]})}const ne=64;function st({open:s,onClose:a}){const{t}=G(),[c,o]=j.useState(""),[x,l]=j.useState(!1),[m,g]=j.useState(""),[p,i]=j.useState(!1),[b,f]=j.useState(!1),n=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(c),r=m.trim().toLowerCase().replace(/\s+/g,"-"),d=r.length===0||r.length<=ne&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r),N=c&&n?[`ccs auth create ${c}`,x?r.length>0?`--context-group ${r}`:"--share-context":"",x&&p?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),P=async()=>{!n||x&&!d||(await navigator.clipboard.writeText(N),f(!0),setTimeout(()=>f(!1),2e3))},_=()=>{o(""),l(!1),g(""),i(!1),f(!1),a()};return e.jsx(oe,{open:s,onOpenChange:h=>!h&&_(),children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsx(le,{children:t("createAuthProfileDialog.title")}),e.jsx(de,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx($,{id:"profile-name",value:c,onChange:h=>o(h.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),c&&!n&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{id:"share-context",checked:x,onCheckedChange:h=>l(h===!0)}),e.jsx(v,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),x&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(v,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx($,{id:"context-group",value:m,onChange:h=>g(h.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(te,{id:"deeper-continuity",checked:p,onCheckedChange:h=>i(h===!0)}),e.jsx(v,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),m.trim().length>0&&!d&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ne})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(qe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:N}),e.jsx(u,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:P,disabled:!n||x&&!d,children:b?e.jsx(q,{className:"w-4 h-4 text-green-500"}):e.jsx(Y,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(u,{variant:"ghost",onClick:_,children:t("createAuthProfileDialog.close")}),e.jsx(u,{onClick:P,disabled:!n||x&&!d,children:b?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function R({title:s,count:a,icon:t,tone:c}){const o={isolated:{border:"border-blue-300/60 bg-blue-50/40 dark:border-blue-900/40 dark:bg-blue-900/10",icon:"text-blue-700 dark:text-blue-400",count:"text-blue-700 dark:text-blue-400"},shared:{border:"border-emerald-300/60 bg-emerald-50/40 dark:border-emerald-900/40 dark:bg-emerald-900/10",icon:"text-emerald-700 dark:text-emerald-400",count:"text-emerald-700 dark:text-emerald-400"},deeper:{border:"border-indigo-300/60 bg-indigo-50/40 dark:border-indigo-900/40 dark:bg-indigo-900/10",icon:"text-indigo-700 dark:text-indigo-400",count:"text-indigo-700 dark:text-indigo-400"}};return e.jsxs("div",{className:M("rounded-md border p-2.5",o[c].border),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-semibold",children:s}),e.jsx(t,{className:M("h-3.5 w-3.5",o[c].icon)})]}),e.jsx("p",{className:M("mt-1 text-lg font-mono font-semibold",o[c].count),children:a})]})}function ce({isolatedCount:s,sharedStandardCount:a,deeperSharedCount:t,sharedGroups:c,legacyTargetCount:o,cliproxyCount:x}){const{t:l}=G(),[m,g]=j.useState(!1),p=c.length>0?c:["default"];return e.jsxs(A,{className:"border-dashed",children:[e.jsx(S,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(D,{className:"text-base",children:l("historySyncLearningMap.title")}),e.jsx(w,{className:"mt-1",children:l("historySyncLearningMap.description")})]}),e.jsx(F,{variant:"outline",children:l("historySyncLearningMap.learningMap")})]})}),e.jsxs(k,{className:"space-y-3",children:[x>0&&e.jsx("div",{className:"rounded-md border border-blue-300/60 bg-blue-50/40 px-3 py-2 text-xs text-blue-800 dark:border-blue-900/40 dark:bg-blue-900/10 dark:text-blue-300",children:l("historySyncLearningMap.cliproxyManaged",{count:x})}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_1fr_auto_1fr] sm:items-center",children:[e.jsx(R,{title:l("historySyncLearningMap.isolated"),count:s,icon:Ee,tone:"isolated"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(H,{className:"h-4 w-4"})}),e.jsx(R,{title:l("historySyncLearningMap.shared"),count:a,icon:Ue,tone:"shared"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(H,{className:"h-4 w-4"})}),e.jsx(R,{title:l("historySyncLearningMap.deeper"),count:t,icon:Ke,tone:"deeper"})]}),e.jsxs(ue,{open:m,onOpenChange:g,children:[e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-8 w-full justify-between rounded-md px-2 text-xs text-muted-foreground hover:bg-muted/40 hover:text-foreground",children:[e.jsx("span",{children:l("historySyncLearningMap.showDetails")}),e.jsx(he,{className:M("h-4 w-4 transition-transform",m&&"rotate-180")})]})}),e.jsxs(me,{className:"pt-2",children:[e.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:l("historySyncLearningMap.modeSwitch")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:l("historySyncLearningMap.modeSwitchDesc")})]}),e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:l("historySyncLearningMap.historySyncGroup")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:l("historySyncLearningMap.historySyncGroupDesc")}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:p.map(i=>e.jsx(F,{variant:"outline",className:"font-mono text-[10px]",children:i},i))})]})]}),o>0&&e.jsx("div",{className:"mt-2 rounded-md border border-amber-500/50 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-300",children:l("historySyncLearningMap.legacyConfirmation",{count:o})})]})]})]})]})}function gt(){const{t:s}=G(),a=fe(),{data:t,isLoading:c}=Qe(),o=Je(),[x,l]=j.useState(!1),[m,g]=j.useState(!1),p=t?.accounts||[],i=t?.cliproxyCount||0,b=t?.legacyContextCount||0,f=t?.legacyContinuityCount||0,n=t?.sharedCount||0,r=t?.sharedStandardCount||0,d=t?.deeperSharedCount||0,N=t?.isolatedCount||0,P=Array.from(new Set(p.filter(C=>C.context_mode==="shared").map(C=>C.context_group||"default"))).sort((C,je)=>C.localeCompare(je)),_=p.filter(C=>C.context_inferred||C.continuity_inferred),h=_.length,pe=h>0,E=()=>a("/cliproxy?provider=claude"),U=()=>a("/cliproxy?provider=claude&action=auth"),K=()=>o.mutate(_);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ze,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.manageSuffix")]})]}),e.jsx(ke,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.primaryActions")}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:()=>l(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:U,children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),s("accountsPage.authClaudeInPool")]}),e.jsxs(u,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:E,children:[s("accountsPage.openClaudePoolSettings"),e.jsx(H,{className:"w-4 h-4 ml-auto"})]})]}),pe?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ie,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContextPending",{count:b})}),f>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContinuityPending",{count:f})})]})]}),e.jsx(u,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:K,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:s("accountsPage.noLegacyFollowup")}),e.jsx(ue,{open:m,onOpenChange:g,children:e.jsxs(A,{children:[e.jsx(S,{className:"pb-2",children:e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-auto w-full justify-between px-0 py-0",children:[e.jsxs("div",{className:"text-left",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.continuityGuide")}),e.jsx(w,{className:"mt-1",children:s("accountsPage.expandWhenNeeded")})]}),e.jsx(he,{className:M("h-4 w-4 transition-transform",m&&"rotate-180")})]})})}),e.jsx(me,{children:e.jsxs(k,{className:"space-y-3 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedStandard")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.sharedStandardDesc")})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedDeeper")}),e.jsxs("p",{className:"mt-1",children:[s("accountsPage.sharedDeeperPrefix")," ",e.jsx("code",{children:"session-env"}),","," ",e.jsx("code",{children:"file-history"}),", ",e.jsx("code",{children:"shell-snapshots"}),","," ",e.jsx("code",{children:"todos"}),"."]})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.isolated")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.isolatedDesc")})]})]})})]})}),e.jsxs(A,{children:[e.jsxs(S,{className:"pb-2",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.quickCommands")}),e.jsx(w,{children:s("accountsPage.quickCommandsDesc")})]}),e.jsxs(k,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --context-group sprint-a --deeper-continuity"}),e.jsx(W,{value:"ccs auth create work --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(W,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{variant:"outline",children:s("accountsPage.workspaceBadge")}),e.jsx(F,{variant:"secondary",children:s("accountsPage.historySyncBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:s("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[s("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:s("accountsTable.sync")}),s("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(ce,{isolatedCount:N,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:P,legacyTargetCount:h,cliproxyCount:i}),e.jsxs(A,{className:"flex flex-col",children:[e.jsxs(S,{className:"pb-3",children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.accountMatrix")}),e.jsx(w,{children:s("accountsPage.sharedTotalDesc",{count:n})})]}),e.jsx(k,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(A,{children:[e.jsxs(S,{children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.title")}),e.jsxs(w,{children:[s("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.mobileManageSuffix")]})]}),e.jsxs(k,{className:"space-y-2",children:[e.jsxs(u,{className:"w-full",onClick:()=>l(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:E,children:[s("accountsPage.openCliProxyClaudePool"),e.jsx(H,{className:"w-4 h-4 ml-2"})]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:U,children:[s("accountsPage.authClaudeInPool"),e.jsx(ee,{className:"w-4 h-4 ml-2"})]}),e.jsx(u,{variant:"outline",className:"w-full",onClick:K,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}),e.jsx(ce,{isolatedCount:N,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:P,legacyTargetCount:h,cliproxyCount:i}),e.jsxs(A,{children:[e.jsx(S,{className:"pb-3",children:e.jsx(D,{className:"text-base",children:s("accountsPage.accountMatrix")})}),e.jsx(k,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]}),e.jsx(st,{open:x,onClose:()=>l(!1)})]})}export{gt as AccountsPage};
@@ -1 +1 @@
1
- import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-C98W0NRG.js";import"./react-vendor-CNOkPC89.js";import{c as o,bC as l}from"./index-BryKrspY.js";function A({...a}){return e.jsx(s,{"data-slot":"alert-dialog",...a})}function g({...a}){return e.jsx(u,{"data-slot":"alert-dialog-portal",...a})}function m({className:a,...t}){return e.jsx(f,{"data-slot":"alert-dialog-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...t})}function D({className:a,...t}){return e.jsxs(g,{children:[e.jsx(m,{}),e.jsx(r,{"data-slot":"alert-dialog-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...t})]})}function b({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",a),...t})}function N({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...t})}function v({className:a,...t}){return e.jsx(n,{"data-slot":"alert-dialog-title",className:o("text-lg font-semibold",a),...t})}function w({className:a,...t}){return e.jsx(i,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",a),...t})}function y({className:a,...t}){return e.jsx(c,{className:o(l(),a),...t})}function C({className:a,...t}){return e.jsx(d,{className:o(l({variant:"outline"}),a),...t})}export{A,D as a,b,v as c,w as d,N as e,C as f,y as g};
1
+ import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-C98W0NRG.js";import"./react-vendor-CNOkPC89.js";import{c as o,bC as l}from"./index-UIwtTLLQ.js";function A({...a}){return e.jsx(s,{"data-slot":"alert-dialog",...a})}function g({...a}){return e.jsx(u,{"data-slot":"alert-dialog-portal",...a})}function m({className:a,...t}){return e.jsx(f,{"data-slot":"alert-dialog-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...t})}function D({className:a,...t}){return e.jsxs(g,{children:[e.jsx(m,{}),e.jsx(r,{"data-slot":"alert-dialog-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...t})]})}function b({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",a),...t})}function N({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...t})}function v({className:a,...t}){return e.jsx(n,{"data-slot":"alert-dialog-title",className:o("text-lg font-semibold",a),...t})}function w({className:a,...t}){return e.jsx(i,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",a),...t})}function y({className:a,...t}){return e.jsx(c,{className:o(l(),a),...t})}function C({className:a,...t}){return e.jsx(d,{className:o(l({variant:"outline"}),a),...t})}export{A,D as a,b,v as c,w as d,N as e,C as f,y as g};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./radix-ui-C98W0NRG.js";import{r as u,h as Ke}from"./react-vendor-CNOkPC89.js";import{B as L,c as D,T as Je,p as Be,q as qe,r as Ve,s as Ye,t as We,v as Ge,w as me,d as v,a as B,n as ae,L as R,I as U,x as J,y as Oe,z as Xe,A as Ze,D as es,E as ss,S as je,F as Z,G as xe,H as Te,J as ts,K as as,M as Ee,N as Ae,O as _e,Q as rs,R as ns,U as Ne,V as ve,W as ee,X as is,Y as os,Z as ge,C as Re,b as Me,j as ls,k as cs,_ as ds,$ as ms,a0 as us,a1 as xs,a2 as hs,a3 as ps,a4 as gs,a5 as fs,a6 as js,a7 as Ns}from"./index-BryKrspY.js";import{a as vs,u as be,b as we}from"./tanstack-CfKik0yL.js";import{C as he}from"./confirm-dialog-Bv5e6wLU.js";import{t as T}from"./notifications-B2HqRBj7.js";import{L as se,R as G,am as De,an as bs,a6 as te,V as ws,ao as Le,a7 as fe,C as Ie,ap as Cs,a4 as ys,aq as Ps,o as pe,X as ks,Z as Fe,ar as Ce,m as ye,as as Ue,at as Ss,aa as Os,au as Ts,v as He,av as Es,w as Qe,n as As,aw as _s}from"./icons-CeH5899d.js";import{M as $e}from"./masked-input-C5Hs_PGA.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";import"./alert-dialog-DOUspkbq.js";function Rs({className:s,showTooltip:r=!0}){const n=e.jsxs(L,{variant:"outline",className:D("bg-accent/10 border-accent/30 text-accent","dark:bg-accent/20 dark:border-accent/40 dark:text-accent-foreground",s),children:[e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"mr-1 h-3 w-3"}),"OpenRouter"]});return r?e.jsxs(Je,{children:[e.jsx(Be,{asChild:!0,children:n}),e.jsx(qe,{children:e.jsx("p",{children:"Access 349+ models via OpenRouter"})})]}):n}function Pe(s){return[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(n=>n.test(s))}function ze(s){return s?.env?(s.env.ANTHROPIC_BASE_URL||"").toLowerCase().includes("openrouter.ai"):!1}function Ms(s){return{opus:s.ANTHROPIC_DEFAULT_OPUS_MODEL||void 0,sonnet:s.ANTHROPIC_DEFAULT_SONNET_MODEL||void 0,haiku:s.ANTHROPIC_DEFAULT_HAIKU_MODEL||void 0}}function Ds(s,r){const n={...s};return r.opus?n.ANTHROPIC_DEFAULT_OPUS_MODEL=r.opus:delete n.ANTHROPIC_DEFAULT_OPUS_MODEL,r.sonnet?n.ANTHROPIC_DEFAULT_SONNET_MODEL=r.sonnet:delete n.ANTHROPIC_DEFAULT_SONNET_MODEL,r.haiku?n.ANTHROPIC_DEFAULT_HAIKU_MODEL=r.haiku:delete n.ANTHROPIC_DEFAULT_HAIKU_MODEL,n}function Ls({profileName:s,target:r,data:n,settings:m,isLoading:c,isSaving:g,isTargetSaving:a,hasChanges:f,isRawJsonValid:t,onTargetChange:p,onRefresh:h,onDelete:b,onSave:w}){const k=g||a,j=c||k;return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),n?.path&&e.jsx(L,{variant:"outline",className:"text-xs",children:n.path.replace(/^.*\//,"")}),ze(m)&&e.jsx(Rs,{className:"ml-1"})]}),n&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",new Date(n.mtime).toLocaleString()]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Default target:"}),e.jsxs(Ve,{value:r,onValueChange:S=>{j||p(S)},disabled:j,children:[e.jsx(Ye,{className:"h-7 w-[170px] text-xs",disabled:j,children:e.jsx(We,{})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"claude",children:"Claude Code"}),e.jsx(me,{value:"droid",children:"Factory Droid"}),e.jsx(me,{value:"codex",children:"Codex CLI"})]})]}),a&&e.jsx(se,{className:"w-3.5 h-3.5 animate-spin text-muted-foreground"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{variant:"ghost",size:"sm",onClick:h,disabled:j,children:e.jsx(G,{className:`w-4 h-4 ${c?"animate-spin":""}`})}),b&&e.jsx(v,{variant:"ghost",size:"sm",onClick:b,disabled:k,children:e.jsx(De,{className:"w-4 h-4 text-destructive"})}),e.jsx(v,{size:"sm",onClick:w,disabled:k||!f||!t,children:g?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(bs,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Is({currentSettings:s,newEnvKey:r,newEnvValue:n,onNewEnvKeyChange:m,onNewEnvValueChange:c,onEnvValueChange:g,onAddEnvVar:a}){const{t:f}=B();return e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-4",children:s?.env&&Object.keys(s.env).length>0?e.jsx(e.Fragment,{children:Object.entries(s.env).map(([t,p])=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(R,{className:"text-xs font-medium flex items-center gap-2 text-muted-foreground",children:[t,Pe(t)&&e.jsx(L,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:f("envEditor.sensitive")})]}),Pe(t)?e.jsx($e,{value:p,onChange:h=>g(t,h.target.value),className:"font-mono text-sm h-8"}):e.jsx(U,{value:p,onChange:h=>g(t,h.target.value),className:"font-mono text-sm h-8"})]},t))}):e.jsxs("div",{className:"py-8 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed text-sm",children:[e.jsx("p",{children:f("envEditor.none")}),e.jsx("p",{className:"text-xs mt-1 opacity-70",children:f("envEditor.noneHint")})]})})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(R,{className:"text-xs font-medium text-muted-foreground",children:f("envEditor.addVariable")}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(U,{placeholder:f("envEditor.keyPlaceholder"),value:r,onChange:t=>m(t.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:t=>t.key==="Enter"&&r.trim()&&a()}),e.jsx(U,{placeholder:f("envEditor.valuePlaceholder"),value:n,onChange:t=>c(t.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:t=>t.key==="Enter"&&r.trim()&&a()}),e.jsx(v,{variant:"outline",size:"sm",className:"h-8",onClick:a,disabled:!r.trim(),children:e.jsx(te,{className:"w-4 h-4"})})]})]})]})}function Fs({profileName:s,target:r,data:n}){const{t:m}=B(),c=r==="droid";return e.jsx(ae,{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(ws,{className:"w-4 h-4"}),m("profileEditor.profileInfo")]}),e.jsx("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:m("profileEditor.profileName")}),e.jsx("span",{className:"font-mono",children:n.profile})]}),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:m("profileEditor.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:n.path}),e.jsx(J,{value:n.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:m("profileEditor.lastModified")}),e.jsx("span",{className:"text-xs",children:new Date(n.mtime).toLocaleString()})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:m("profileEditor.defaultTarget")}),e.jsx("span",{className:"font-mono",children:r})]})]})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:m("profileEditor.quickUsage")}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:m("profileEditor.runWithProfile")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs ",s,' "prompt"']}),e.jsx(J,{value:`ccs ${s} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:m(c?"profileEditor.droidAliasExplicit":"profileEditor.runOnDroid")}),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:`ccs-droid ${s} "prompt"`}),e.jsx(J,{value:`ccs-droid ${s} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:m(c?"profileEditor.overrideToClaude":"profileEditor.runOnDroidWithFlag")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs ",s," --target ",c?"claude":"droid",' "prompt"']}),e.jsx(J,{value:`ccs ${s} --target ${c?"claude":"droid"} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:m("profileEditor.setAsDefault")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs default ",s]}),e.jsx(J,{value:`ccs default ${s}`,size:"icon",className:"h-6 w-6"})]})]})]})]})]})})}function Us({value:s,onChange:r,placeholder:n="Search models...",className:m}){const[c,g]=u.useState(""),[a,f]=u.useState(null),{models:t,isLoading:p,isError:h,isFetching:b}=Oe(),w=Xe(),k=u.useMemo(()=>Ze(t,c,{category:a??void 0}),[t,c,a]),j=u.useMemo(()=>es(t,2),[t]),S=!c.trim()&&!a,H=u.useMemo(()=>{const d={anthropic:[],openai:[],google:[],meta:[],mistral:[],opensource:[],other:[]};k.forEach(x=>{d[x.category].push(x)});for(const x of Object.keys(d))d[x]=ss(d[x]);return d},[k]),C=u.useCallback(()=>{w()},[w]),M=t.find(d=>d.id===s);return p&&t.length===0?e.jsxs("div",{className:D("space-y-2",m),children:[e.jsx(je,{className:"h-10 w-full"}),e.jsx(je,{className:"h-32 w-full"})]}):e.jsxs("div",{className:D("space-y-2 w-full min-w-0 overflow-hidden",m),children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Le,{className:"text-muted-foreground absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2"}),e.jsx(U,{value:c,onChange:d=>g(d.target.value),placeholder:n,className:"pl-9"})]}),e.jsx(v,{variant:"outline",size:"icon",onClick:C,disabled:b,title:"Refresh models",children:b?e.jsx(se,{className:"h-4 w-4 animate-spin"}):e.jsx(G,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs(L,{variant:a===null?"default":"outline",className:"cursor-pointer",onClick:()=>f(null),children:["All (",t.length,")"]}),Object.keys(Z).map(d=>{const x=H[d].length;return x===0?null:e.jsxs(L,{variant:a===d?"default":"outline",className:"cursor-pointer",onClick:()=>f(d),children:[Z[d]," (",x,")"]},d)})]}),M&&e.jsxs("div",{className:"bg-muted rounded-md p-2 text-sm",children:[e.jsx("span",{className:"font-medium",children:M.name}),e.jsxs("span",{className:"text-muted-foreground ml-2",children:[xe(M.pricing)," |"," ",Te(M.context_length)]})]}),e.jsx(ae,{className:"h-72 w-full rounded-md border",children:h?e.jsxs("div",{className:"text-destructive p-4 text-center",children:["Failed to load models."," ",e.jsx(v,{variant:"link",onClick:C,children:"Retry"})]}):k.length===0?e.jsxs("div",{className:"text-muted-foreground p-4 text-center",children:['No models found matching "',c,'"']}):e.jsxs("div",{className:"space-y-6 p-3",children:[S&&j.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 flex items-center gap-1.5 py-1.5 text-xs font-semibold border-b pb-2",children:[e.jsx(fe,{className:"h-3 w-3 text-accent"}),e.jsx("span",{children:"Newest Models"})]}),e.jsx("div",{className:"space-y-1",children:j.map(d=>e.jsx(ke,{model:d,isSelected:d.id===s,onClick:()=>r(d.id),showAge:!0},d.id))})]}),Object.keys(Z).map(d=>{const x=H[d];return x.length===0?null:e.jsxs("div",{children:[e.jsx("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 py-1.5 text-xs font-semibold border-b pb-2",children:Z[d]}),e.jsx("div",{className:"space-y-1",children:x.map(l=>e.jsx(ke,{model:l,isSelected:l.id===s,onClick:()=>r(l.id)},l.id))})]},d)})]})})]})}function ke({model:s,isSelected:r,onClick:n,showAge:m=!1}){return e.jsxs("button",{type:"button",onClick:n,className:D("group flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent text-accent-foreground"),children:[e.jsx("span",{className:"flex-1 min-w-0 truncate font-medium",children:s.name}),e.jsxs("span",{className:D("flex shrink-0 items-center gap-1 text-xs whitespace-nowrap",r?"text-accent-foreground/80":"text-muted-foreground group-hover:text-accent-foreground/80"),children:[m&&s.created&&e.jsx(L,{variant:"outline",className:D("text-[10px] px-1",r?"border-accent-foreground/30 text-accent-foreground/80":"text-accent border-accent/30 group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30"),children:ts(s.created)}),s.isFree?e.jsx(L,{variant:"secondary",className:D("text-[10px] px-1",r?"bg-accent-foreground/20 text-accent-foreground":"group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground"),children:"Free"}):s.isExacto?e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"outline",className:D("text-[10px] px-1 border-emerald-500/50 text-emerald-600",r?"border-accent-foreground/30 text-accent-foreground/80":"group-hover:border-accent-foreground/30 group-hover:text-accent-foreground/80"),children:"Exacto"}),e.jsx("span",{className:"tabular-nums",children:xe(s.pricing)})]}):e.jsx("span",{className:"tabular-nums",children:xe(s.pricing)}),e.jsx("span",{className:"tabular-nums",children:Te(s.context_length)})]})]})}function Hs({selectedModel:s,value:r,onChange:n,className:m}){const{t:c}=B(),{models:g}=Oe(),a=u.useMemo(()=>s?as(s,g):{},[s,g]),f=()=>{n(a)},t=(h,b)=>{n({...r,[h]:b||void 0})},p=s&&Object.keys(a).length>0;return e.jsxs(Ee,{className:D("group",m),children:[e.jsxs(Ae,{className:"flex items-center gap-2 text-sm font-medium hover:underline",children:[e.jsx(Ie,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),c("modelTierMapping.title"),e.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",c("modelTierMapping.advanced"),")"]})]}),e.jsxs(_e,{className:"space-y-3 pt-3",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:c("modelTierMapping.description")}),p&&e.jsxs(v,{type:"button",variant:"outline",size:"sm",onClick:f,children:[e.jsx(Cs,{className:"mr-1 h-4 w-4"}),c("modelTierMapping.autoSuggest",{provider:s?.split("/")[0]})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(R,{htmlFor:"tier-opus",className:"text-right",children:"Opus"}),e.jsx(U,{id:"tier-opus",value:r.opus??"",onChange:h=>t("opus",h.target.value),placeholder:c("modelTierMapping.opusPlaceholder")})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(R,{htmlFor:"tier-sonnet",className:"text-right",children:"Sonnet"}),e.jsx(U,{id:"tier-sonnet",value:r.sonnet??"",onChange:h=>t("sonnet",h.target.value),placeholder:c("modelTierMapping.sonnetPlaceholder")})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(R,{htmlFor:"tier-haiku",className:"text-right",children:"Haiku"}),e.jsx(U,{id:"tier-haiku",value:r.haiku??"",onChange:h=>t("haiku",h.target.value),placeholder:c("modelTierMapping.haikuPlaceholder")})]})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:c("modelTierMapping.footer")})]})]})}function Qs({profileName:s,target:r,data:n,currentSettings:m,newEnvKey:c,newEnvValue:g,onNewEnvKeyChange:a,onNewEnvValueChange:f,onEnvValueChange:t,onAddEnvVar:p,onEnvBulkChange:h}){const b=ze(m),w=m?.env,k=u.useMemo(()=>Ms(w??{}),[w]),j=w??{},S=l=>{if(h){const Q={...j,ANTHROPIC_MODEL:l,ANTHROPIC_DEFAULT_OPUS_MODEL:l,ANTHROPIC_DEFAULT_SONNET_MODEL:l,ANTHROPIC_DEFAULT_HAIKU_MODEL:l};h(Q)}else t("ANTHROPIC_MODEL",l),t("ANTHROPIC_DEFAULT_OPUS_MODEL",l),t("ANTHROPIC_DEFAULT_SONNET_MODEL",l),t("ANTHROPIC_DEFAULT_HAIKU_MODEL",l);T.success(ee.t("commonToast.appliedModelAllTiers"),{duration:2e3})},H=l=>{if(h){const Q=Ds(j,l);h(Q)}else l.opus!==void 0&&t("ANTHROPIC_DEFAULT_OPUS_MODEL",l.opus||""),l.sonnet!==void 0&&t("ANTHROPIC_DEFAULT_SONNET_MODEL",l.sonnet||""),l.haiku!==void 0&&t("ANTHROPIC_DEFAULT_HAIKU_MODEL",l.haiku||"")},[C,M]=u.useState(!1),d=new Set(["ANTHROPIC_AUTH_TOKEN"]),x=Object.entries(j).filter(([l])=>!d.has(l));return e.jsx("div",{className:"h-full w-full min-w-0 flex flex-col",children:e.jsxs(rs,{defaultValue:"env",className:"h-full w-full min-w-0 flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(ns,{className:"w-full",children:[e.jsx(Ne,{value:"env",className:"flex-1",children:b?"Configuration":"Environment Variables"}),e.jsx(Ne,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:[e.jsx(ve,{value:"env",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden min-w-0",children:b?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsxs("div",{className:"h-full overflow-y-auto overflow-x-hidden p-4 space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(R,{className:"text-sm font-medium",children:"Model Selection"}),e.jsx(Us,{value:j.ANTHROPIC_MODEL,onChange:S,placeholder:"Search OpenRouter models..."})]}),e.jsx(Hs,{selectedModel:j.ANTHROPIC_MODEL,value:k,onChange:H}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{className:"text-sm font-medium",children:"API Key"}),e.jsx($e,{value:j.ANTHROPIC_AUTH_TOKEN||"",onChange:l=>t("ANTHROPIC_AUTH_TOKEN",l.target.value),placeholder:"sk-or-v1-...",className:"font-mono text-sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Get your API key from"," ",e.jsx("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"openrouter.ai/keys"})]})]}),x.length>0&&e.jsxs(Ee,{open:C,onOpenChange:M,children:[e.jsxs(Ae,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors group",children:[e.jsx(Ie,{className:D("h-4 w-4 transition-transform",C&&"rotate-90")}),e.jsx(ys,{className:"h-4 w-4"}),e.jsx("span",{children:"Additional Variables"}),e.jsxs("span",{className:"text-xs font-normal opacity-70",children:["(",x.length,")"]})]}),e.jsx(_e,{className:"pt-4",children:e.jsx("div",{className:"space-y-3 border rounded-lg p-3 bg-muted/30",children:x.map(([l,Q])=>e.jsxs("div",{className:"space-y-1",children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:l}),e.jsx(U,{value:Q,onChange:$=>t(l,$.target.value),className:"font-mono text-xs h-8"})]},l))})})]})]})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(R,{className:"text-xs font-medium text-muted-foreground",children:"Add Environment Variable"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(U,{placeholder:"VARIABLE_NAME",value:c,onChange:l=>a(l.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:l=>l.key==="Enter"&&c.trim()&&p()}),e.jsx(U,{placeholder:"value",value:g,onChange:l=>f(l.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:l=>l.key==="Enter"&&c.trim()&&p()}),e.jsx(v,{variant:"outline",size:"sm",className:"h-8",onClick:p,disabled:!c.trim(),children:e.jsx(te,{className:"w-4 h-4"})})]})]})]}):e.jsx(Is,{currentSettings:m,newEnvKey:c,newEnvValue:g,onNewEnvKeyChange:a,onNewEnvValueChange:f,onEnvValueChange:t,onAddEnvVar:p})}),e.jsx(ve,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(Fs,{profileName:s,target:r,data:n})})]})]})})}function $s({profileName:s,profileTarget:r,onDelete:n,onHasChangesUpdate:m}){const[c,g]=u.useState({}),[a,f]=u.useState(!1),[t,p]=u.useState(null),[h,b]=u.useState(""),[w,k]=u.useState(""),j=vs(),{data:S,isLoading:H,isError:C,refetch:M}=be({queryKey:["settings",s],queryFn:async()=>{const o=await fetch(`/api/settings/${s}/raw`);if(!o.ok)throw new Error(`Failed to load settings: ${o.status}`);return o.json()}}),d=S?.settings,x=u.useMemo(()=>{if(t!==null)try{return JSON.parse(t)}catch{}if(d)return{...d,env:{...d.env,...c}}},[d,c,t]),l=u.useMemo(()=>t!==null?t:d?JSON.stringify(d,null,2):"",[t,d]),Q=u.useCallback(o=>{p(o)},[]),$=u.useCallback(o=>{const N={...x??{}},A=N.ccs_image&&typeof N.ccs_image=="object"?{...N.ccs_image}:{};o?A.native_read=!0:delete A.native_read,Object.keys(A).length>0?N.ccs_image=A:delete N.ccs_image,p(JSON.stringify(N,null,2))},[x]),q=(o,N)=>{const A={...x?.env||{},[o]:N};g(W=>({...W,[o]:N})),p(JSON.stringify({...x,env:A},null,2))},K=o=>{const N={...x?.env||{},...o};g(A=>({...A,...o})),p(JSON.stringify({...x,env:N},null,2))},X=()=>{if(!h.trim())return;const o=h.trim(),N=w,A={...x?.env||{},[o]:N};g(W=>({...W,[o]:N})),p(JSON.stringify({...x,env:A},null,2)),b(""),k("")},y=u.useMemo(()=>{try{return JSON.parse(l),!0}catch{return!1}},[l]),I=u.useMemo(()=>t!==null?t!==JSON.stringify(d,null,2):Object.keys(c).length>0,[t,c,d]),O=u.useDeferredValue(l),z=u.useMemo(()=>{if(!I||!y)return null;try{return JSON.parse(O)}catch{return null}},[I,y,O]),{data:V,isFetching:re,isError:Y,isPlaceholderData:ne}=be({queryKey:["settings",s,"image-analysis-status-preview",O],enabled:z!==null,placeholderData:o=>o,queryFn:async()=>{const o=await fetch(`/api/settings/${s}/image-analysis-status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:z})});if(!o.ok)throw new Error(`Failed to preview image-analysis status: ${o.status}`);return o.json()}}),ie=I&&y&&!Y?V?.imageAnalysisStatus??S?.imageAnalysisStatus:S?.imageAnalysisStatus,oe=I&&y&&!Y&&V?.imageAnalysisStatus?"editor":"saved",le=I?y?Y?"saved":re&&(!V?.imageAnalysisStatus||ne)?"refreshing":"preview":"invalid":"saved",ce=x?.ccs_image?.native_read===!0,de=u.useMemo(()=>{const o=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"],N=x?.env||{};return o.filter(A=>!N[A]?.trim())},[x]);u.useEffect(()=>{m?.(I)},[I,m]);const i=we({mutationFn:async()=>{let o;try{o=JSON.parse(l)}catch{o={...S?.settings,env:{...S?.settings?.env,...c}}}const N=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:o,expectedMtime:S?.mtime})});if(N.status===409)throw new Error("CONFLICT");if(!N.ok)throw new Error("Failed to save");return N.json()},onSuccess:()=>{j.invalidateQueries({queryKey:["settings",s]}),j.invalidateQueries({queryKey:["profiles"]}),g({}),p(null),T.success(ee.t("commonToast.settingsSaved"))},onError:o=>{o.message==="CONFLICT"?f(!0):T.error(o.message)}}),E=we({mutationFn:async o=>(await os.profiles.update(s,{target:o}),o),onSuccess:()=>{j.invalidateQueries({queryKey:["profiles"]}),T.success(ee.t("commonToast.defaultTargetUpdated"))},onError:(o,N)=>{const A=N==="droid"?"Factory Droid":N==="codex"?"Codex CLI":"Claude Code",W=o.message.trim()?`: ${o.message}`:"";T.error(ee.t("commonToast.failedUpdateDefaultTarget",{target:A,suffix:W}))}}),P=r||"claude",F=i.isPending||E.isPending,_=async o=>{f(!1),o?(await M(),i.mutate()):(g({}),p(null))};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(Ls,{profileName:s,target:P,data:S,settings:x,isLoading:H,isSaving:i.isPending,isTargetSaving:E.isPending,hasChanges:I,isRawJsonValid:y,onTargetChange:o=>{F||o!==P&&E.mutate(o)},onRefresh:()=>{F||M()},onDelete:n,onSave:()=>{F||i.mutate()}}),H?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(se,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):C?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load settings."}),e.jsxs(v,{variant:"outline",size:"sm",onClick:()=>M(),children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):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.jsx(Qs,{profileName:s,target:P,data:S,currentSettings:x,newEnvKey:h,newEnvValue:w,onNewEnvKeyChange:b,onNewEnvValueChange:k,onEnvValueChange:q,onEnvBulkChange:K,onAddEnvVar:X})}),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(Ps,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Raw Configuration (JSON)"})]}),e.jsx(is,{rawJsonContent:l,isRawJsonValid:y,rawJsonEdits:t,settings:d,profileTarget:P,imageAnalysisStatus:ie,imageAnalysisStatusSource:oe,imageAnalysisStatusPreviewState:le,nativeReadPreferenceOverride:ce,onToggleNativeRead:$,onChange:Q,missingRequiredFields:de})]})]}),e.jsx(he,{open:a,title:"File Modified Externally",description:"Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>_(!0),onCancel:()=>_(!1)})]},s)}const Se="ccs:openrouter-banner-dismissed";function zs({onCreateClick:s}){const[r,n]=u.useState(!0),{modelCount:m,isLoading:c}=ge();u.useEffect(()=>{const a=localStorage.getItem(Se)==="true";n(a)},[]);const g=()=>{localStorage.setItem(Se,"true"),n(!0)};return r?null:e.jsx("div",{className:"bg-gradient-to-r from-accent to-accent/90 text-white px-4 py-3 relative shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 max-w-screen-xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"p-1.5 bg-white/20 rounded-md shrink-0",children:e.jsx(fe,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm",children:"NEW: OpenRouter Integration"}),e.jsxs("p",{className:"text-xs text-white/80 truncate",children:["Browse ",c?"300+":`${m}+`," models from OpenAI, Anthropic, Google, Meta and more."]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s&&e.jsx(v,{size:"sm",variant:"secondary",onClick:s,className:"bg-white text-accent hover:bg-white/90 h-8",children:"Try it now"}),e.jsxs("a",{href:"https://openrouter.ai",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-white/80 hover:text-white hidden sm:flex items-center gap-1",children:["Learn more",e.jsx(pe,{className:"w-3 h-3"})]}),e.jsxs(v,{size:"icon",variant:"ghost",onClick:g,className:"h-7 w-7 text-white/70 hover:text-white hover:bg-white/20",children:[e.jsx(ks,{className:"w-4 h-4"}),e.jsx("span",{className:"sr-only",children:"Dismiss"})]})]})]})})}function ue({badge:s,badgeClassName:r,className:n,title:m,description:c,visual:g,highlights:a,actionLabel:f,actionClassName:t,onAction:p,footer:h}){return e.jsxs(Re,{className:D("flex h-full flex-col border shadow-sm",n),children:[e.jsxs(ls,{className:"space-y-3 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[g,e.jsx(L,{variant:"secondary",className:r,children:s})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(cs,{className:"text-base",children:m}),e.jsx(ds,{className:"text-sm leading-6",children:c})]})]}),e.jsxs(Me,{className:"mt-auto flex flex-1 flex-col gap-4 pt-0",children:[e.jsx("div",{className:"space-y-2 text-xs text-muted-foreground",children:a.map(b=>e.jsxs("div",{className:"flex items-center gap-2",children:[b.icon,e.jsx("span",{children:b.label})]},b.label))}),e.jsxs(v,{onClick:p,className:t,children:[f,e.jsx(Ss,{className:"ml-2 h-4 w-4"})]}),h?e.jsx("div",{className:"text-xs text-muted-foreground",children:h}):null]})]})}function Ks({hasProfiles:s,profileCount:r,onOpenRouterClick:n,onAlibabaCodingPlanClick:m,onCliproxyClick:c,onCustomClick:g}){const{t:a}=B(),{modelCount:f,isLoading:t}=ge(),p=t?"300+":`${f}+`,h=s?a("openrouterQuickStart.profileCount",{count:r}):a("openrouterQuickStart.recommended"),b=a(s?"openrouterQuickStart.selectProfileTitle":"apiProfiles.noProfilesYet"),w=s?a("openrouterQuickStart.summaryDescriptionWithProfiles",{count:r}):a("openrouterQuickStart.summaryDescriptionNoProfiles");return e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-auto bg-muted/20 p-4 sm:p-6",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-4",children:[e.jsx(Re,{className:"border-dashed bg-background/90 shadow-sm",children:e.jsxs(Me,{className:"flex flex-col gap-4 p-5 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(L,{variant:"secondary",children:h}),e.jsx(L,{variant:"outline",children:a("openrouterQuickStart.openrouterModelsBadge",{modelCountLabel:p})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-xl font-semibold",children:b}),e.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:w})]})]}),e.jsx(v,{variant:"outline",onClick:g,className:"shrink-0",children:a("openrouterQuickStart.createCustomProfile")})]})}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx(ue,{badge:a("openrouterQuickStart.recommended"),title:a("openrouterQuickStart.title"),description:a("openrouterQuickStart.description",{modelCountLabel:p}),visual:e.jsx("div",{className:"rounded-lg bg-accent/10 p-2",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"h-5 w-5"})}),highlights:[{icon:e.jsx(Fe,{className:"h-3.5 w-3.5 text-accent"}),label:a("openrouterQuickStart.featureOneApi")},{icon:e.jsx(fe,{className:"h-3.5 w-3.5 text-accent"}),label:a("openrouterQuickStart.featureTierMapping")}],actionLabel:a("openrouterQuickStart.createOpenRouterProfile"),actionClassName:"w-full bg-accent text-white hover:bg-accent/90",onAction:n,footer:e.jsxs(e.Fragment,{children:[a("openrouterQuickStart.getApiKeyAt")," ",e.jsxs("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-accent hover:underline",children:["openrouter.ai/keys",e.jsx(pe,{className:"h-3 w-3"})]})]})}),e.jsx(ue,{badge:a("openrouterQuickStart.runtimeProviderBadge"),badgeClassName:"bg-emerald-500/10 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-200",title:a("openrouterQuickStart.runtimeProviderTitle"),description:a("openrouterQuickStart.runtimeProviderDescription"),visual:e.jsx("div",{className:"rounded-lg bg-emerald-500/10 p-2",children:e.jsx(Ce,{className:"h-5 w-5 text-emerald-700 dark:text-emerald-300"})}),highlights:[{icon:e.jsx(Ce,{className:"h-3.5 w-3.5 text-emerald-600"}),label:a("openrouterQuickStart.runtimeProviderFeatureConnectors")},{icon:e.jsx(ye,{className:"h-3.5 w-3.5 text-emerald-600"}),label:a("openrouterQuickStart.runtimeProviderFeatureSecrets")}],actionLabel:a("openrouterQuickStart.runtimeProviderTitle"),actionClassName:"w-full bg-emerald-600 text-white hover:bg-emerald-600/90",onAction:c,footer:e.jsx("span",{children:a("openrouterQuickStart.runtimeProviderFooter")})}),e.jsx(ue,{badge:a("alibabaCodingPlanQuickStart.recommended"),badgeClassName:"bg-orange-500/10 text-orange-700 dark:bg-orange-500/20 dark:text-orange-200",className:"lg:col-span-2",title:a("alibabaCodingPlanQuickStart.title"),description:a("alibabaCodingPlanQuickStart.description"),visual:e.jsx("div",{className:"rounded-lg bg-orange-500/10 p-2",children:e.jsx("img",{src:"/assets/providers/alibabacloud-color.svg",alt:"Alibaba Coding Plan",className:"h-5 w-5"})}),highlights:[{icon:e.jsx(Ue,{className:"h-3.5 w-3.5 text-orange-600"}),label:a("alibabaCodingPlanQuickStart.featureEndpoint")},{icon:e.jsx(ye,{className:"h-3.5 w-3.5 text-orange-600"}),label:a("alibabaCodingPlanQuickStart.featureKeyFormat")}],actionLabel:a("alibabaCodingPlanQuickStart.createAlibabaProfile"),actionClassName:"w-full bg-orange-600 text-white hover:bg-orange-600/90",onAction:m,footer:e.jsxs(e.Fragment,{children:[a("alibabaCodingPlanQuickStart.readGuideAt")," ",e.jsxs("a",{href:"https://www.alibabacloud.com/help/en/model-studio/coding-plan",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-orange-700 hover:underline dark:text-orange-400",children:["Alibaba Cloud Model Studio",e.jsx(pe,{className:"h-3 w-3"})]})]})})]})]})})}function Js({onCreateClick:s}){const{modelCount:r,isLoading:n}=ge();return e.jsx("div",{className:"p-3 border-t bg-gradient-to-r from-accent/5 to-accent/10 dark:from-accent/10 dark:to-accent/15",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-1.5 bg-accent/10 dark:bg-accent/20 rounded shrink-0",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"",className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-accent dark:text-accent-foreground",children:"OpenRouter"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground truncate",children:[n?"300+":`${r}+`," models available"]})]}),e.jsxs(v,{size:"sm",variant:"ghost",onClick:s,className:"h-7 px-2 text-accent hover:text-accent hover:bg-accent/10 dark:hover:bg-accent/20",children:[e.jsx(Fe,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:"Add"})]})]})})}function Bs({onCreateClick:s}){const{t:r}=B();return e.jsx("div",{className:"p-3 border-t bg-gradient-to-r from-orange-500/5 to-orange-500/10 dark:from-orange-500/10 dark:to-orange-500/15",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-1.5 bg-orange-500/10 dark:bg-orange-500/20 rounded shrink-0",children:e.jsx("img",{src:"/assets/providers/alibabacloud-color.svg",alt:"",className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-orange-700 dark:text-orange-300",children:r("alibabaCodingPlanPromo.title")}),e.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:r("alibabaCodingPlanPromo.subtitle")})]}),e.jsxs(v,{size:"sm",variant:"ghost",onClick:s,className:"h-7 px-2 text-orange-700 dark:text-orange-300 hover:text-orange-700 hover:bg-orange-500/10 dark:hover:bg-orange-500/20",children:[e.jsx(Ue,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:r("alibabaCodingPlanPromo.add")})]})]})})}function it(){const{t:s}=B(),r=Ke(),{data:n,isLoading:m,isError:c,refetch:g}=ms(),a=us(),f=xs(),t=hs(),p=ps(),h=gs(),b=fs(),[w,k]=u.useState(null),[j,S]=u.useState(""),[H,C]=u.useState(!1),[M,d]=u.useState("normal"),[x,l]=u.useState(null),[Q,$]=u.useState(!1),[q,K]=u.useState(null),X=u.useRef(null);js();const y=u.useMemo(()=>n?.profiles||[],[n?.profiles]),I=u.useMemo(()=>y.filter(i=>i.name.toLowerCase().includes(j.toLowerCase())),[y,j]),O=w?y.find(i=>i.name===w):null,z=i=>{Q&&w!==i?K(i):k(i)},V=i=>{a.mutate(i,{onSuccess:()=>{w===i&&(k(null),$(!1),K(null)),l(null)}})},re=i=>{C(!1),z(i)},Y=i=>{z(i)},ne=(i,E)=>{const P=JSON.stringify(E,null,2)+`
1
+ import{j as e}from"./radix-ui-C98W0NRG.js";import{r as u,h as Ke}from"./react-vendor-CNOkPC89.js";import{B as L,c as D,T as Je,p as Be,q as qe,r as Ve,s as Ye,t as We,v as Ge,w as me,d as v,a as B,n as ae,L as R,I as U,x as J,y as Oe,z as Xe,A as Ze,D as es,E as ss,S as je,F as Z,G as xe,H as Te,J as ts,K as as,M as Ee,N as Ae,O as _e,Q as rs,R as ns,U as Ne,V as ve,W as ee,X as is,Y as os,Z as ge,C as Re,b as Me,j as ls,k as cs,_ as ds,$ as ms,a0 as us,a1 as xs,a2 as hs,a3 as ps,a4 as gs,a5 as fs,a6 as js,a7 as Ns}from"./index-UIwtTLLQ.js";import{a as vs,u as be,b as we}from"./tanstack-CfKik0yL.js";import{C as he}from"./confirm-dialog-CnJqC2F2.js";import{t as T}from"./notifications-B2HqRBj7.js";import{L as se,R as G,am as De,an as bs,a6 as te,V as ws,ao as Le,a7 as fe,C as Ie,ap as Cs,a4 as ys,aq as Ps,o as pe,X as ks,Z as Fe,ar as Ce,m as ye,as as Ue,at as Ss,aa as Os,au as Ts,v as He,av as Es,w as Qe,n as As,aw as _s}from"./icons-CeH5899d.js";import{M as $e}from"./masked-input-BVKU0MZm.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";import"./alert-dialog-BbaHYket.js";function Rs({className:s,showTooltip:r=!0}){const n=e.jsxs(L,{variant:"outline",className:D("bg-accent/10 border-accent/30 text-accent","dark:bg-accent/20 dark:border-accent/40 dark:text-accent-foreground",s),children:[e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"mr-1 h-3 w-3"}),"OpenRouter"]});return r?e.jsxs(Je,{children:[e.jsx(Be,{asChild:!0,children:n}),e.jsx(qe,{children:e.jsx("p",{children:"Access 349+ models via OpenRouter"})})]}):n}function Pe(s){return[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(n=>n.test(s))}function ze(s){return s?.env?(s.env.ANTHROPIC_BASE_URL||"").toLowerCase().includes("openrouter.ai"):!1}function Ms(s){return{opus:s.ANTHROPIC_DEFAULT_OPUS_MODEL||void 0,sonnet:s.ANTHROPIC_DEFAULT_SONNET_MODEL||void 0,haiku:s.ANTHROPIC_DEFAULT_HAIKU_MODEL||void 0}}function Ds(s,r){const n={...s};return r.opus?n.ANTHROPIC_DEFAULT_OPUS_MODEL=r.opus:delete n.ANTHROPIC_DEFAULT_OPUS_MODEL,r.sonnet?n.ANTHROPIC_DEFAULT_SONNET_MODEL=r.sonnet:delete n.ANTHROPIC_DEFAULT_SONNET_MODEL,r.haiku?n.ANTHROPIC_DEFAULT_HAIKU_MODEL=r.haiku:delete n.ANTHROPIC_DEFAULT_HAIKU_MODEL,n}function Ls({profileName:s,target:r,data:n,settings:m,isLoading:c,isSaving:g,isTargetSaving:a,hasChanges:f,isRawJsonValid:t,onTargetChange:p,onRefresh:h,onDelete:b,onSave:w}){const k=g||a,j=c||k;return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),n?.path&&e.jsx(L,{variant:"outline",className:"text-xs",children:n.path.replace(/^.*\//,"")}),ze(m)&&e.jsx(Rs,{className:"ml-1"})]}),n&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",new Date(n.mtime).toLocaleString()]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Default target:"}),e.jsxs(Ve,{value:r,onValueChange:S=>{j||p(S)},disabled:j,children:[e.jsx(Ye,{className:"h-7 w-[170px] text-xs",disabled:j,children:e.jsx(We,{})}),e.jsxs(Ge,{children:[e.jsx(me,{value:"claude",children:"Claude Code"}),e.jsx(me,{value:"droid",children:"Factory Droid"}),e.jsx(me,{value:"codex",children:"Codex CLI"})]})]}),a&&e.jsx(se,{className:"w-3.5 h-3.5 animate-spin text-muted-foreground"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{variant:"ghost",size:"sm",onClick:h,disabled:j,children:e.jsx(G,{className:`w-4 h-4 ${c?"animate-spin":""}`})}),b&&e.jsx(v,{variant:"ghost",size:"sm",onClick:b,disabled:k,children:e.jsx(De,{className:"w-4 h-4 text-destructive"})}),e.jsx(v,{size:"sm",onClick:w,disabled:k||!f||!t,children:g?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(bs,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Is({currentSettings:s,newEnvKey:r,newEnvValue:n,onNewEnvKeyChange:m,onNewEnvValueChange:c,onEnvValueChange:g,onAddEnvVar:a}){const{t:f}=B();return e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-4",children:s?.env&&Object.keys(s.env).length>0?e.jsx(e.Fragment,{children:Object.entries(s.env).map(([t,p])=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(R,{className:"text-xs font-medium flex items-center gap-2 text-muted-foreground",children:[t,Pe(t)&&e.jsx(L,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:f("envEditor.sensitive")})]}),Pe(t)?e.jsx($e,{value:p,onChange:h=>g(t,h.target.value),className:"font-mono text-sm h-8"}):e.jsx(U,{value:p,onChange:h=>g(t,h.target.value),className:"font-mono text-sm h-8"})]},t))}):e.jsxs("div",{className:"py-8 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed text-sm",children:[e.jsx("p",{children:f("envEditor.none")}),e.jsx("p",{className:"text-xs mt-1 opacity-70",children:f("envEditor.noneHint")})]})})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(R,{className:"text-xs font-medium text-muted-foreground",children:f("envEditor.addVariable")}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(U,{placeholder:f("envEditor.keyPlaceholder"),value:r,onChange:t=>m(t.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:t=>t.key==="Enter"&&r.trim()&&a()}),e.jsx(U,{placeholder:f("envEditor.valuePlaceholder"),value:n,onChange:t=>c(t.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:t=>t.key==="Enter"&&r.trim()&&a()}),e.jsx(v,{variant:"outline",size:"sm",className:"h-8",onClick:a,disabled:!r.trim(),children:e.jsx(te,{className:"w-4 h-4"})})]})]})]})}function Fs({profileName:s,target:r,data:n}){const{t:m}=B(),c=r==="droid";return e.jsx(ae,{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(ws,{className:"w-4 h-4"}),m("profileEditor.profileInfo")]}),e.jsx("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:m("profileEditor.profileName")}),e.jsx("span",{className:"font-mono",children:n.profile})]}),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:m("profileEditor.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:n.path}),e.jsx(J,{value:n.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:m("profileEditor.lastModified")}),e.jsx("span",{className:"text-xs",children:new Date(n.mtime).toLocaleString()})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:m("profileEditor.defaultTarget")}),e.jsx("span",{className:"font-mono",children:r})]})]})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:m("profileEditor.quickUsage")}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:m("profileEditor.runWithProfile")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs ",s,' "prompt"']}),e.jsx(J,{value:`ccs ${s} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:m(c?"profileEditor.droidAliasExplicit":"profileEditor.runOnDroid")}),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:`ccs-droid ${s} "prompt"`}),e.jsx(J,{value:`ccs-droid ${s} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:m(c?"profileEditor.overrideToClaude":"profileEditor.runOnDroidWithFlag")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs ",s," --target ",c?"claude":"droid",' "prompt"']}),e.jsx(J,{value:`ccs ${s} --target ${c?"claude":"droid"} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:m("profileEditor.setAsDefault")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs default ",s]}),e.jsx(J,{value:`ccs default ${s}`,size:"icon",className:"h-6 w-6"})]})]})]})]})]})})}function Us({value:s,onChange:r,placeholder:n="Search models...",className:m}){const[c,g]=u.useState(""),[a,f]=u.useState(null),{models:t,isLoading:p,isError:h,isFetching:b}=Oe(),w=Xe(),k=u.useMemo(()=>Ze(t,c,{category:a??void 0}),[t,c,a]),j=u.useMemo(()=>es(t,2),[t]),S=!c.trim()&&!a,H=u.useMemo(()=>{const d={anthropic:[],openai:[],google:[],meta:[],mistral:[],opensource:[],other:[]};k.forEach(x=>{d[x.category].push(x)});for(const x of Object.keys(d))d[x]=ss(d[x]);return d},[k]),C=u.useCallback(()=>{w()},[w]),M=t.find(d=>d.id===s);return p&&t.length===0?e.jsxs("div",{className:D("space-y-2",m),children:[e.jsx(je,{className:"h-10 w-full"}),e.jsx(je,{className:"h-32 w-full"})]}):e.jsxs("div",{className:D("space-y-2 w-full min-w-0 overflow-hidden",m),children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Le,{className:"text-muted-foreground absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2"}),e.jsx(U,{value:c,onChange:d=>g(d.target.value),placeholder:n,className:"pl-9"})]}),e.jsx(v,{variant:"outline",size:"icon",onClick:C,disabled:b,title:"Refresh models",children:b?e.jsx(se,{className:"h-4 w-4 animate-spin"}):e.jsx(G,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs(L,{variant:a===null?"default":"outline",className:"cursor-pointer",onClick:()=>f(null),children:["All (",t.length,")"]}),Object.keys(Z).map(d=>{const x=H[d].length;return x===0?null:e.jsxs(L,{variant:a===d?"default":"outline",className:"cursor-pointer",onClick:()=>f(d),children:[Z[d]," (",x,")"]},d)})]}),M&&e.jsxs("div",{className:"bg-muted rounded-md p-2 text-sm",children:[e.jsx("span",{className:"font-medium",children:M.name}),e.jsxs("span",{className:"text-muted-foreground ml-2",children:[xe(M.pricing)," |"," ",Te(M.context_length)]})]}),e.jsx(ae,{className:"h-72 w-full rounded-md border",children:h?e.jsxs("div",{className:"text-destructive p-4 text-center",children:["Failed to load models."," ",e.jsx(v,{variant:"link",onClick:C,children:"Retry"})]}):k.length===0?e.jsxs("div",{className:"text-muted-foreground p-4 text-center",children:['No models found matching "',c,'"']}):e.jsxs("div",{className:"space-y-6 p-3",children:[S&&j.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 flex items-center gap-1.5 py-1.5 text-xs font-semibold border-b pb-2",children:[e.jsx(fe,{className:"h-3 w-3 text-accent"}),e.jsx("span",{children:"Newest Models"})]}),e.jsx("div",{className:"space-y-1",children:j.map(d=>e.jsx(ke,{model:d,isSelected:d.id===s,onClick:()=>r(d.id),showAge:!0},d.id))})]}),Object.keys(Z).map(d=>{const x=H[d];return x.length===0?null:e.jsxs("div",{children:[e.jsx("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 py-1.5 text-xs font-semibold border-b pb-2",children:Z[d]}),e.jsx("div",{className:"space-y-1",children:x.map(l=>e.jsx(ke,{model:l,isSelected:l.id===s,onClick:()=>r(l.id)},l.id))})]},d)})]})})]})}function ke({model:s,isSelected:r,onClick:n,showAge:m=!1}){return e.jsxs("button",{type:"button",onClick:n,className:D("group flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent text-accent-foreground"),children:[e.jsx("span",{className:"flex-1 min-w-0 truncate font-medium",children:s.name}),e.jsxs("span",{className:D("flex shrink-0 items-center gap-1 text-xs whitespace-nowrap",r?"text-accent-foreground/80":"text-muted-foreground group-hover:text-accent-foreground/80"),children:[m&&s.created&&e.jsx(L,{variant:"outline",className:D("text-[10px] px-1",r?"border-accent-foreground/30 text-accent-foreground/80":"text-accent border-accent/30 group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30"),children:ts(s.created)}),s.isFree?e.jsx(L,{variant:"secondary",className:D("text-[10px] px-1",r?"bg-accent-foreground/20 text-accent-foreground":"group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground"),children:"Free"}):s.isExacto?e.jsxs(e.Fragment,{children:[e.jsx(L,{variant:"outline",className:D("text-[10px] px-1 border-emerald-500/50 text-emerald-600",r?"border-accent-foreground/30 text-accent-foreground/80":"group-hover:border-accent-foreground/30 group-hover:text-accent-foreground/80"),children:"Exacto"}),e.jsx("span",{className:"tabular-nums",children:xe(s.pricing)})]}):e.jsx("span",{className:"tabular-nums",children:xe(s.pricing)}),e.jsx("span",{className:"tabular-nums",children:Te(s.context_length)})]})]})}function Hs({selectedModel:s,value:r,onChange:n,className:m}){const{t:c}=B(),{models:g}=Oe(),a=u.useMemo(()=>s?as(s,g):{},[s,g]),f=()=>{n(a)},t=(h,b)=>{n({...r,[h]:b||void 0})},p=s&&Object.keys(a).length>0;return e.jsxs(Ee,{className:D("group",m),children:[e.jsxs(Ae,{className:"flex items-center gap-2 text-sm font-medium hover:underline",children:[e.jsx(Ie,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),c("modelTierMapping.title"),e.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",c("modelTierMapping.advanced"),")"]})]}),e.jsxs(_e,{className:"space-y-3 pt-3",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:c("modelTierMapping.description")}),p&&e.jsxs(v,{type:"button",variant:"outline",size:"sm",onClick:f,children:[e.jsx(Cs,{className:"mr-1 h-4 w-4"}),c("modelTierMapping.autoSuggest",{provider:s?.split("/")[0]})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(R,{htmlFor:"tier-opus",className:"text-right",children:"Opus"}),e.jsx(U,{id:"tier-opus",value:r.opus??"",onChange:h=>t("opus",h.target.value),placeholder:c("modelTierMapping.opusPlaceholder")})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(R,{htmlFor:"tier-sonnet",className:"text-right",children:"Sonnet"}),e.jsx(U,{id:"tier-sonnet",value:r.sonnet??"",onChange:h=>t("sonnet",h.target.value),placeholder:c("modelTierMapping.sonnetPlaceholder")})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(R,{htmlFor:"tier-haiku",className:"text-right",children:"Haiku"}),e.jsx(U,{id:"tier-haiku",value:r.haiku??"",onChange:h=>t("haiku",h.target.value),placeholder:c("modelTierMapping.haikuPlaceholder")})]})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:c("modelTierMapping.footer")})]})]})}function Qs({profileName:s,target:r,data:n,currentSettings:m,newEnvKey:c,newEnvValue:g,onNewEnvKeyChange:a,onNewEnvValueChange:f,onEnvValueChange:t,onAddEnvVar:p,onEnvBulkChange:h}){const b=ze(m),w=m?.env,k=u.useMemo(()=>Ms(w??{}),[w]),j=w??{},S=l=>{if(h){const Q={...j,ANTHROPIC_MODEL:l,ANTHROPIC_DEFAULT_OPUS_MODEL:l,ANTHROPIC_DEFAULT_SONNET_MODEL:l,ANTHROPIC_DEFAULT_HAIKU_MODEL:l};h(Q)}else t("ANTHROPIC_MODEL",l),t("ANTHROPIC_DEFAULT_OPUS_MODEL",l),t("ANTHROPIC_DEFAULT_SONNET_MODEL",l),t("ANTHROPIC_DEFAULT_HAIKU_MODEL",l);T.success(ee.t("commonToast.appliedModelAllTiers"),{duration:2e3})},H=l=>{if(h){const Q=Ds(j,l);h(Q)}else l.opus!==void 0&&t("ANTHROPIC_DEFAULT_OPUS_MODEL",l.opus||""),l.sonnet!==void 0&&t("ANTHROPIC_DEFAULT_SONNET_MODEL",l.sonnet||""),l.haiku!==void 0&&t("ANTHROPIC_DEFAULT_HAIKU_MODEL",l.haiku||"")},[C,M]=u.useState(!1),d=new Set(["ANTHROPIC_AUTH_TOKEN"]),x=Object.entries(j).filter(([l])=>!d.has(l));return e.jsx("div",{className:"h-full w-full min-w-0 flex flex-col",children:e.jsxs(rs,{defaultValue:"env",className:"h-full w-full min-w-0 flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(ns,{className:"w-full",children:[e.jsx(Ne,{value:"env",className:"flex-1",children:b?"Configuration":"Environment Variables"}),e.jsx(Ne,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:[e.jsx(ve,{value:"env",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden min-w-0",children:b?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsxs("div",{className:"h-full overflow-y-auto overflow-x-hidden p-4 space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(R,{className:"text-sm font-medium",children:"Model Selection"}),e.jsx(Us,{value:j.ANTHROPIC_MODEL,onChange:S,placeholder:"Search OpenRouter models..."})]}),e.jsx(Hs,{selectedModel:j.ANTHROPIC_MODEL,value:k,onChange:H}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{className:"text-sm font-medium",children:"API Key"}),e.jsx($e,{value:j.ANTHROPIC_AUTH_TOKEN||"",onChange:l=>t("ANTHROPIC_AUTH_TOKEN",l.target.value),placeholder:"sk-or-v1-...",className:"font-mono text-sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Get your API key from"," ",e.jsx("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"openrouter.ai/keys"})]})]}),x.length>0&&e.jsxs(Ee,{open:C,onOpenChange:M,children:[e.jsxs(Ae,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors group",children:[e.jsx(Ie,{className:D("h-4 w-4 transition-transform",C&&"rotate-90")}),e.jsx(ys,{className:"h-4 w-4"}),e.jsx("span",{children:"Additional Variables"}),e.jsxs("span",{className:"text-xs font-normal opacity-70",children:["(",x.length,")"]})]}),e.jsx(_e,{className:"pt-4",children:e.jsx("div",{className:"space-y-3 border rounded-lg p-3 bg-muted/30",children:x.map(([l,Q])=>e.jsxs("div",{className:"space-y-1",children:[e.jsx(R,{className:"text-xs text-muted-foreground",children:l}),e.jsx(U,{value:Q,onChange:$=>t(l,$.target.value),className:"font-mono text-xs h-8"})]},l))})})]})]})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(R,{className:"text-xs font-medium text-muted-foreground",children:"Add Environment Variable"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(U,{placeholder:"VARIABLE_NAME",value:c,onChange:l=>a(l.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:l=>l.key==="Enter"&&c.trim()&&p()}),e.jsx(U,{placeholder:"value",value:g,onChange:l=>f(l.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:l=>l.key==="Enter"&&c.trim()&&p()}),e.jsx(v,{variant:"outline",size:"sm",className:"h-8",onClick:p,disabled:!c.trim(),children:e.jsx(te,{className:"w-4 h-4"})})]})]})]}):e.jsx(Is,{currentSettings:m,newEnvKey:c,newEnvValue:g,onNewEnvKeyChange:a,onNewEnvValueChange:f,onEnvValueChange:t,onAddEnvVar:p})}),e.jsx(ve,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(Fs,{profileName:s,target:r,data:n})})]})]})})}function $s({profileName:s,profileTarget:r,onDelete:n,onHasChangesUpdate:m}){const[c,g]=u.useState({}),[a,f]=u.useState(!1),[t,p]=u.useState(null),[h,b]=u.useState(""),[w,k]=u.useState(""),j=vs(),{data:S,isLoading:H,isError:C,refetch:M}=be({queryKey:["settings",s],queryFn:async()=>{const o=await fetch(`/api/settings/${s}/raw`);if(!o.ok)throw new Error(`Failed to load settings: ${o.status}`);return o.json()}}),d=S?.settings,x=u.useMemo(()=>{if(t!==null)try{return JSON.parse(t)}catch{}if(d)return{...d,env:{...d.env,...c}}},[d,c,t]),l=u.useMemo(()=>t!==null?t:d?JSON.stringify(d,null,2):"",[t,d]),Q=u.useCallback(o=>{p(o)},[]),$=u.useCallback(o=>{const N={...x??{}},A=N.ccs_image&&typeof N.ccs_image=="object"?{...N.ccs_image}:{};o?A.native_read=!0:delete A.native_read,Object.keys(A).length>0?N.ccs_image=A:delete N.ccs_image,p(JSON.stringify(N,null,2))},[x]),q=(o,N)=>{const A={...x?.env||{},[o]:N};g(W=>({...W,[o]:N})),p(JSON.stringify({...x,env:A},null,2))},K=o=>{const N={...x?.env||{},...o};g(A=>({...A,...o})),p(JSON.stringify({...x,env:N},null,2))},X=()=>{if(!h.trim())return;const o=h.trim(),N=w,A={...x?.env||{},[o]:N};g(W=>({...W,[o]:N})),p(JSON.stringify({...x,env:A},null,2)),b(""),k("")},y=u.useMemo(()=>{try{return JSON.parse(l),!0}catch{return!1}},[l]),I=u.useMemo(()=>t!==null?t!==JSON.stringify(d,null,2):Object.keys(c).length>0,[t,c,d]),O=u.useDeferredValue(l),z=u.useMemo(()=>{if(!I||!y)return null;try{return JSON.parse(O)}catch{return null}},[I,y,O]),{data:V,isFetching:re,isError:Y,isPlaceholderData:ne}=be({queryKey:["settings",s,"image-analysis-status-preview",O],enabled:z!==null,placeholderData:o=>o,queryFn:async()=>{const o=await fetch(`/api/settings/${s}/image-analysis-status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:z})});if(!o.ok)throw new Error(`Failed to preview image-analysis status: ${o.status}`);return o.json()}}),ie=I&&y&&!Y?V?.imageAnalysisStatus??S?.imageAnalysisStatus:S?.imageAnalysisStatus,oe=I&&y&&!Y&&V?.imageAnalysisStatus?"editor":"saved",le=I?y?Y?"saved":re&&(!V?.imageAnalysisStatus||ne)?"refreshing":"preview":"invalid":"saved",ce=x?.ccs_image?.native_read===!0,de=u.useMemo(()=>{const o=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"],N=x?.env||{};return o.filter(A=>!N[A]?.trim())},[x]);u.useEffect(()=>{m?.(I)},[I,m]);const i=we({mutationFn:async()=>{let o;try{o=JSON.parse(l)}catch{o={...S?.settings,env:{...S?.settings?.env,...c}}}const N=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:o,expectedMtime:S?.mtime})});if(N.status===409)throw new Error("CONFLICT");if(!N.ok)throw new Error("Failed to save");return N.json()},onSuccess:()=>{j.invalidateQueries({queryKey:["settings",s]}),j.invalidateQueries({queryKey:["profiles"]}),g({}),p(null),T.success(ee.t("commonToast.settingsSaved"))},onError:o=>{o.message==="CONFLICT"?f(!0):T.error(o.message)}}),E=we({mutationFn:async o=>(await os.profiles.update(s,{target:o}),o),onSuccess:()=>{j.invalidateQueries({queryKey:["profiles"]}),T.success(ee.t("commonToast.defaultTargetUpdated"))},onError:(o,N)=>{const A=N==="droid"?"Factory Droid":N==="codex"?"Codex CLI":"Claude Code",W=o.message.trim()?`: ${o.message}`:"";T.error(ee.t("commonToast.failedUpdateDefaultTarget",{target:A,suffix:W}))}}),P=r||"claude",F=i.isPending||E.isPending,_=async o=>{f(!1),o?(await M(),i.mutate()):(g({}),p(null))};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(Ls,{profileName:s,target:P,data:S,settings:x,isLoading:H,isSaving:i.isPending,isTargetSaving:E.isPending,hasChanges:I,isRawJsonValid:y,onTargetChange:o=>{F||o!==P&&E.mutate(o)},onRefresh:()=>{F||M()},onDelete:n,onSave:()=>{F||i.mutate()}}),H?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(se,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):C?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load settings."}),e.jsxs(v,{variant:"outline",size:"sm",onClick:()=>M(),children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):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.jsx(Qs,{profileName:s,target:P,data:S,currentSettings:x,newEnvKey:h,newEnvValue:w,onNewEnvKeyChange:b,onNewEnvValueChange:k,onEnvValueChange:q,onEnvBulkChange:K,onAddEnvVar:X})}),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(Ps,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Raw Configuration (JSON)"})]}),e.jsx(is,{rawJsonContent:l,isRawJsonValid:y,rawJsonEdits:t,settings:d,profileTarget:P,imageAnalysisStatus:ie,imageAnalysisStatusSource:oe,imageAnalysisStatusPreviewState:le,nativeReadPreferenceOverride:ce,onToggleNativeRead:$,onChange:Q,missingRequiredFields:de})]})]}),e.jsx(he,{open:a,title:"File Modified Externally",description:"Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>_(!0),onCancel:()=>_(!1)})]},s)}const Se="ccs:openrouter-banner-dismissed";function zs({onCreateClick:s}){const[r,n]=u.useState(!0),{modelCount:m,isLoading:c}=ge();u.useEffect(()=>{const a=localStorage.getItem(Se)==="true";n(a)},[]);const g=()=>{localStorage.setItem(Se,"true"),n(!0)};return r?null:e.jsx("div",{className:"bg-gradient-to-r from-accent to-accent/90 text-white px-4 py-3 relative shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 max-w-screen-xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"p-1.5 bg-white/20 rounded-md shrink-0",children:e.jsx(fe,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm",children:"NEW: OpenRouter Integration"}),e.jsxs("p",{className:"text-xs text-white/80 truncate",children:["Browse ",c?"300+":`${m}+`," models from OpenAI, Anthropic, Google, Meta and more."]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s&&e.jsx(v,{size:"sm",variant:"secondary",onClick:s,className:"bg-white text-accent hover:bg-white/90 h-8",children:"Try it now"}),e.jsxs("a",{href:"https://openrouter.ai",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-white/80 hover:text-white hidden sm:flex items-center gap-1",children:["Learn more",e.jsx(pe,{className:"w-3 h-3"})]}),e.jsxs(v,{size:"icon",variant:"ghost",onClick:g,className:"h-7 w-7 text-white/70 hover:text-white hover:bg-white/20",children:[e.jsx(ks,{className:"w-4 h-4"}),e.jsx("span",{className:"sr-only",children:"Dismiss"})]})]})]})})}function ue({badge:s,badgeClassName:r,className:n,title:m,description:c,visual:g,highlights:a,actionLabel:f,actionClassName:t,onAction:p,footer:h}){return e.jsxs(Re,{className:D("flex h-full flex-col border shadow-sm",n),children:[e.jsxs(ls,{className:"space-y-3 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[g,e.jsx(L,{variant:"secondary",className:r,children:s})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(cs,{className:"text-base",children:m}),e.jsx(ds,{className:"text-sm leading-6",children:c})]})]}),e.jsxs(Me,{className:"mt-auto flex flex-1 flex-col gap-4 pt-0",children:[e.jsx("div",{className:"space-y-2 text-xs text-muted-foreground",children:a.map(b=>e.jsxs("div",{className:"flex items-center gap-2",children:[b.icon,e.jsx("span",{children:b.label})]},b.label))}),e.jsxs(v,{onClick:p,className:t,children:[f,e.jsx(Ss,{className:"ml-2 h-4 w-4"})]}),h?e.jsx("div",{className:"text-xs text-muted-foreground",children:h}):null]})]})}function Ks({hasProfiles:s,profileCount:r,onOpenRouterClick:n,onAlibabaCodingPlanClick:m,onCliproxyClick:c,onCustomClick:g}){const{t:a}=B(),{modelCount:f,isLoading:t}=ge(),p=t?"300+":`${f}+`,h=s?a("openrouterQuickStart.profileCount",{count:r}):a("openrouterQuickStart.recommended"),b=a(s?"openrouterQuickStart.selectProfileTitle":"apiProfiles.noProfilesYet"),w=s?a("openrouterQuickStart.summaryDescriptionWithProfiles",{count:r}):a("openrouterQuickStart.summaryDescriptionNoProfiles");return e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-auto bg-muted/20 p-4 sm:p-6",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-4",children:[e.jsx(Re,{className:"border-dashed bg-background/90 shadow-sm",children:e.jsxs(Me,{className:"flex flex-col gap-4 p-5 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(L,{variant:"secondary",children:h}),e.jsx(L,{variant:"outline",children:a("openrouterQuickStart.openrouterModelsBadge",{modelCountLabel:p})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-xl font-semibold",children:b}),e.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:w})]})]}),e.jsx(v,{variant:"outline",onClick:g,className:"shrink-0",children:a("openrouterQuickStart.createCustomProfile")})]})}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx(ue,{badge:a("openrouterQuickStart.recommended"),title:a("openrouterQuickStart.title"),description:a("openrouterQuickStart.description",{modelCountLabel:p}),visual:e.jsx("div",{className:"rounded-lg bg-accent/10 p-2",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"h-5 w-5"})}),highlights:[{icon:e.jsx(Fe,{className:"h-3.5 w-3.5 text-accent"}),label:a("openrouterQuickStart.featureOneApi")},{icon:e.jsx(fe,{className:"h-3.5 w-3.5 text-accent"}),label:a("openrouterQuickStart.featureTierMapping")}],actionLabel:a("openrouterQuickStart.createOpenRouterProfile"),actionClassName:"w-full bg-accent text-white hover:bg-accent/90",onAction:n,footer:e.jsxs(e.Fragment,{children:[a("openrouterQuickStart.getApiKeyAt")," ",e.jsxs("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-accent hover:underline",children:["openrouter.ai/keys",e.jsx(pe,{className:"h-3 w-3"})]})]})}),e.jsx(ue,{badge:a("openrouterQuickStart.runtimeProviderBadge"),badgeClassName:"bg-emerald-500/10 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-200",title:a("openrouterQuickStart.runtimeProviderTitle"),description:a("openrouterQuickStart.runtimeProviderDescription"),visual:e.jsx("div",{className:"rounded-lg bg-emerald-500/10 p-2",children:e.jsx(Ce,{className:"h-5 w-5 text-emerald-700 dark:text-emerald-300"})}),highlights:[{icon:e.jsx(Ce,{className:"h-3.5 w-3.5 text-emerald-600"}),label:a("openrouterQuickStart.runtimeProviderFeatureConnectors")},{icon:e.jsx(ye,{className:"h-3.5 w-3.5 text-emerald-600"}),label:a("openrouterQuickStart.runtimeProviderFeatureSecrets")}],actionLabel:a("openrouterQuickStart.runtimeProviderTitle"),actionClassName:"w-full bg-emerald-600 text-white hover:bg-emerald-600/90",onAction:c,footer:e.jsx("span",{children:a("openrouterQuickStart.runtimeProviderFooter")})}),e.jsx(ue,{badge:a("alibabaCodingPlanQuickStart.recommended"),badgeClassName:"bg-orange-500/10 text-orange-700 dark:bg-orange-500/20 dark:text-orange-200",className:"lg:col-span-2",title:a("alibabaCodingPlanQuickStart.title"),description:a("alibabaCodingPlanQuickStart.description"),visual:e.jsx("div",{className:"rounded-lg bg-orange-500/10 p-2",children:e.jsx("img",{src:"/assets/providers/alibabacloud-color.svg",alt:"Alibaba Coding Plan",className:"h-5 w-5"})}),highlights:[{icon:e.jsx(Ue,{className:"h-3.5 w-3.5 text-orange-600"}),label:a("alibabaCodingPlanQuickStart.featureEndpoint")},{icon:e.jsx(ye,{className:"h-3.5 w-3.5 text-orange-600"}),label:a("alibabaCodingPlanQuickStart.featureKeyFormat")}],actionLabel:a("alibabaCodingPlanQuickStart.createAlibabaProfile"),actionClassName:"w-full bg-orange-600 text-white hover:bg-orange-600/90",onAction:m,footer:e.jsxs(e.Fragment,{children:[a("alibabaCodingPlanQuickStart.readGuideAt")," ",e.jsxs("a",{href:"https://www.alibabacloud.com/help/en/model-studio/coding-plan",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-orange-700 hover:underline dark:text-orange-400",children:["Alibaba Cloud Model Studio",e.jsx(pe,{className:"h-3 w-3"})]})]})})]})]})})}function Js({onCreateClick:s}){const{modelCount:r,isLoading:n}=ge();return e.jsx("div",{className:"p-3 border-t bg-gradient-to-r from-accent/5 to-accent/10 dark:from-accent/10 dark:to-accent/15",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-1.5 bg-accent/10 dark:bg-accent/20 rounded shrink-0",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"",className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-accent dark:text-accent-foreground",children:"OpenRouter"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground truncate",children:[n?"300+":`${r}+`," models available"]})]}),e.jsxs(v,{size:"sm",variant:"ghost",onClick:s,className:"h-7 px-2 text-accent hover:text-accent hover:bg-accent/10 dark:hover:bg-accent/20",children:[e.jsx(Fe,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:"Add"})]})]})})}function Bs({onCreateClick:s}){const{t:r}=B();return e.jsx("div",{className:"p-3 border-t bg-gradient-to-r from-orange-500/5 to-orange-500/10 dark:from-orange-500/10 dark:to-orange-500/15",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-1.5 bg-orange-500/10 dark:bg-orange-500/20 rounded shrink-0",children:e.jsx("img",{src:"/assets/providers/alibabacloud-color.svg",alt:"",className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-orange-700 dark:text-orange-300",children:r("alibabaCodingPlanPromo.title")}),e.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:r("alibabaCodingPlanPromo.subtitle")})]}),e.jsxs(v,{size:"sm",variant:"ghost",onClick:s,className:"h-7 px-2 text-orange-700 dark:text-orange-300 hover:text-orange-700 hover:bg-orange-500/10 dark:hover:bg-orange-500/20",children:[e.jsx(Ue,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:r("alibabaCodingPlanPromo.add")})]})]})})}function it(){const{t:s}=B(),r=Ke(),{data:n,isLoading:m,isError:c,refetch:g}=ms(),a=us(),f=xs(),t=hs(),p=ps(),h=gs(),b=fs(),[w,k]=u.useState(null),[j,S]=u.useState(""),[H,C]=u.useState(!1),[M,d]=u.useState("normal"),[x,l]=u.useState(null),[Q,$]=u.useState(!1),[q,K]=u.useState(null),X=u.useRef(null);js();const y=u.useMemo(()=>n?.profiles||[],[n?.profiles]),I=u.useMemo(()=>y.filter(i=>i.name.toLowerCase().includes(j.toLowerCase())),[y,j]),O=w?y.find(i=>i.name===w):null,z=i=>{Q&&w!==i?K(i):k(i)},V=i=>{a.mutate(i,{onSuccess:()=>{w===i&&(k(null),$(!1),K(null)),l(null)}})},re=i=>{C(!1),z(i)},Y=i=>{z(i)},ne=(i,E)=>{const P=JSON.stringify(E,null,2)+`
2
2
  `,F=new Blob([P],{type:"application/json"}),_=URL.createObjectURL(F),o=document.createElement("a");o.href=_,o.download=i,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(_)},ie=async()=>{try{const i=await f.mutateAsync();if(i.orphans.length===0){T.success("No orphan profile settings found");return}const E=i.orphans.filter(o=>o.validation.valid).length;if(!window.confirm(`Found ${i.orphans.length} orphan settings file(s). Register ${E} valid profile(s) now?`))return;const F=await t.mutateAsync({}),_=F.skipped.length>0?`, skipped ${F.skipped.length}`:"";T.success(`Registered ${F.registered.length} profile(s)${_}`)}catch(i){T.error(i.message)}},oe=async()=>{if(!O)return;const i=window.prompt(`Copy profile "${O.name}" to new profile name:`,`${O.name}-copy`);if(!i)return;const E=i.trim();if(!E){T.error("Destination profile name cannot be empty");return}try{const P=await p.mutateAsync({name:O.name,data:{destination:E}});z(E),P.warnings&&P.warnings.length>0&&T.info(P.warnings.join(`
3
3
  `))}catch(P){T.error(P.message)}},le=async()=>{if(O)try{const i=await h.mutateAsync({name:O.name});ne(`${O.name}.ccs-profile.json`,i.bundle),i.redacted?T.info("Export created with redacted token. Use include-secrets flow in CLI if needed."):T.success("Profile export downloaded")}catch(i){T.error(i.message)}},ce=()=>{X.current?.click()},de=async i=>{const E=i.target.files?.[0];if(i.target.value="",!!E)try{const P=await E.text(),F=JSON.parse(P),_=await b.mutateAsync({bundle:F});_.name&&z(_.name),_.warnings&&_.warnings.length>0&&T.info(_.warnings.join(`
4
4
  `))}catch(P){T.error(P.message||"Failed to import profile bundle")}};return e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[e.jsx(zs,{onCreateClick:()=>C(!0)}),e.jsxs("div",{className:"flex-1 flex 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-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Os,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("apiProfiles.title")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(v,{size:"sm",variant:"outline",onClick:()=>void ie(),disabled:f.isPending||t.isPending,"aria-label":"Discover orphan profiles",title:"Discover orphan profiles",children:e.jsx(G,{className:`w-4 h-4 ${f.isPending?"animate-spin":""}`})}),e.jsx(v,{size:"sm",variant:"outline",onClick:ce,disabled:b.isPending,"aria-label":"Import profile bundle",title:"Import profile bundle",children:e.jsx(Ts,{className:"w-4 h-4"})}),e.jsxs(v,{size:"sm",onClick:()=>{C(!0)},children:[e.jsx(te,{className:"w-4 h-4 mr-1"}),s("apiProfiles.new")]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(U,{placeholder:s("apiProfiles.searchPlaceholder"),className:"pl-8 h-9",value:j,onChange:i=>S(i.target.value)})]})]}),e.jsx(ae,{className:"flex-1 min-h-0",children:m?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("apiProfiles.loadingProfiles")}):c?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(He,{className:"w-12 h-12 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("apiProfiles.failedLoadTitle")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s("apiProfiles.failedLoadDesc")})]}),e.jsxs(v,{size:"sm",variant:"outline",onClick:()=>g(),children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s("apiProfiles.retry")]})]})}):I.length===0?e.jsx("div",{className:"p-4 text-center",children:y.length===0?e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(Es,{className:"w-12 h-12 mx-auto text-muted-foreground/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("apiProfiles.noProfilesYet")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s("apiProfiles.noProfilesDesc")})]}),e.jsxs(v,{size:"sm",variant:"outline",onClick:()=>{C(!0)},children:[e.jsx(te,{className:"w-4 h-4 mr-1"}),s("apiProfiles.createProfile")]})]}):e.jsx("p",{className:"text-sm text-muted-foreground py-4",children:s("apiProfiles.noProfileMatch",{query:j})})}):e.jsx("div",{className:"p-2 space-y-1",children:I.map(i=>e.jsx(qs,{profile:i,isSelected:w===i.name,onSelect:()=>Y(i.name),onDelete:()=>l(i.name)},i.name))})}),y.length>0&&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:s("apiProfiles.profileCount",{count:y.length})}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Qe,{className:"w-3 h-3 text-green-600"}),s("apiProfiles.configuredCount",{count:y.filter(i=>i.configured).length})]})]})}),e.jsx(Js,{onCreateClick:()=>{d("openrouter"),C(!0)}}),e.jsx(Bs,{onCreateClick:()=>{d("alibaba-coding-plan"),C(!0)}})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col min-w-0 overflow-hidden",children:O?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-4 py-2 border-b bg-background flex items-center justify-end gap-2",children:[e.jsxs(v,{size:"sm",variant:"outline",onClick:()=>void oe(),disabled:p.isPending,children:[e.jsx(As,{className:"w-4 h-4 mr-1"}),"Copy"]}),e.jsxs(v,{size:"sm",variant:"outline",onClick:()=>void le(),disabled:h.isPending,children:[e.jsx(_s,{className:"w-4 h-4 mr-1"}),"Export"]})]}),e.jsx($s,{profileName:O.name,profileTarget:O.target,onDelete:()=>l(O.name),onHasChangesUpdate:$},O.name)]}):e.jsx(Ks,{hasProfiles:y.length>0,profileCount:y.length,onCliproxyClick:()=>{r("/cliproxy/ai-providers")},onOpenRouterClick:()=>{d("openrouter"),C(!0)},onAlibabaCodingPlanClick:()=>{d("alibaba-coding-plan"),C(!0)},onCustomClick:()=>{d("normal"),C(!0)}})})]}),e.jsx("input",{ref:X,type:"file",accept:".json,application/json",className:"hidden",onChange:i=>void de(i)}),e.jsx(Ns,{open:H,onOpenChange:C,onSuccess:re,initialMode:M}),e.jsx(he,{open:!!x,title:s("apiProfiles.deleteProfileTitle"),description:s("apiProfiles.deleteProfileDesc",{name:x??""}),confirmText:s("apiProfiles.delete"),variant:"destructive",onConfirm:()=>x&&V(x),onCancel:()=>l(null)}),e.jsx(he,{open:!!q,title:s("apiProfiles.unsavedChangesTitle"),description:s("apiProfiles.unsavedChangesDesc",{current:w??"",next:q??""}),confirmText:s("apiProfiles.discardSwitch"),variant:"destructive",onConfirm:()=>{$(!1),k(q),K(null)},onCancel:()=>K(null)})]})}function qs({profile:s,isSelected:r,onSelect:n,onDelete:m}){return e.jsxs("div",{className:D("group flex items-center gap-2 px-3 py-2.5 rounded-md cursor-pointer transition-colors",r?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:n,children:[s.configured?e.jsx(Qe,{className:"w-4 h-4 text-green-600 shrink-0"}):e.jsx(He,{className:"w-4 h-4 text-yellow-600 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsx(L,{variant:"outline",className:"text-[10px] h-4 px-1.5 uppercase",children:s.target||"claude"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("div",{className:"text-xs text-muted-foreground truncate flex-1",children:s.settingsPath}),e.jsx(J,{value:s.settingsPath,size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),e.jsx(v,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:c=>{c.stopPropagation(),m()},children:e.jsx(De,{className:"w-3.5 h-3.5 text-destructive"})})]})}export{it as ApiPage};