@kaitranntt/ccs 7.77.1-dev.1 → 7.77.1-dev.3

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 (63) hide show
  1. package/dist/auth/account-profile-diagnostics.d.ts +21 -0
  2. package/dist/auth/account-profile-diagnostics.d.ts.map +1 -0
  3. package/dist/auth/account-profile-diagnostics.js +130 -0
  4. package/dist/auth/account-profile-diagnostics.js.map +1 -0
  5. package/dist/auth/auth-commands.d.ts.map +1 -1
  6. package/dist/auth/auth-commands.js +12 -8
  7. package/dist/auth/auth-commands.js.map +1 -1
  8. package/dist/auth/commands/create-command.d.ts.map +1 -1
  9. package/dist/auth/commands/create-command.js +7 -1
  10. package/dist/auth/commands/create-command.js.map +1 -1
  11. package/dist/auth/commands/show-command.d.ts.map +1 -1
  12. package/dist/auth/commands/show-command.js +42 -0
  13. package/dist/auth/commands/show-command.js.map +1 -1
  14. package/dist/auth/commands/types.d.ts +20 -0
  15. package/dist/auth/commands/types.d.ts.map +1 -1
  16. package/dist/auth/commands/types.js.map +1 -1
  17. package/dist/proxy/upstream-url.d.ts.map +1 -1
  18. package/dist/proxy/upstream-url.js +8 -0
  19. package/dist/proxy/upstream-url.js.map +1 -1
  20. package/dist/shared/provider-preset-catalog.d.ts +1 -1
  21. package/dist/shared/provider-preset-catalog.d.ts.map +1 -1
  22. package/dist/shared/provider-preset-catalog.js +1 -1
  23. package/dist/shared/provider-preset-catalog.js.map +1 -1
  24. package/dist/ui/assets/accounts-PYdWScEG.js +1 -0
  25. package/dist/ui/assets/{alert-dialog-C6npAhT0.js → alert-dialog-C5km8Mr2.js} +1 -1
  26. package/dist/ui/assets/{api-DZosWVkR.js → api-DyqNEbc3.js} +1 -1
  27. package/dist/ui/assets/{auth-section-D4MZkgcP.js → auth-section-bEevgiYG.js} +1 -1
  28. package/dist/ui/assets/{backups-section-DvMJrmHH.js → backups-section-D2xYCD_5.js} +1 -1
  29. package/dist/ui/assets/{channels-BVftYfOn.js → channels-BC2C8bYa.js} +1 -1
  30. package/dist/ui/assets/{checkbox-BLRznRTO.js → checkbox-DgzstwxZ.js} +1 -1
  31. package/dist/ui/assets/{claude-extension-C6OeBQ73.js → claude-extension-BcKfLTXZ.js} +1 -1
  32. package/dist/ui/assets/{cliproxy-ai-providers-BAJ78pUc.js → cliproxy-ai-providers-BjoutZZO.js} +1 -1
  33. package/dist/ui/assets/{cliproxy-control-panel-XEvUMVJe.js → cliproxy-control-panel-lYLoiV9f.js} +1 -1
  34. package/dist/ui/assets/{cliproxy-B3Jyu3r9.js → cliproxy-fm0VYc-7.js} +1 -1
  35. package/dist/ui/assets/{codex-CY2vikqX.js → codex-Bdvmcwzt.js} +1 -1
  36. package/dist/ui/assets/{confirm-dialog-DjLHh1qX.js → confirm-dialog-BvtBhg50.js} +1 -1
  37. package/dist/ui/assets/{copilot-afee2lL9.js → copilot-D4noBxJX.js} +1 -1
  38. package/dist/ui/assets/{cursor-DuWy60wp.js → cursor-CSVuplSL.js} +1 -1
  39. package/dist/ui/assets/{droid-FlceoQ6k.js → droid-BU4DgcGo.js} +1 -1
  40. package/dist/ui/assets/{globalenv-section-DpJ7unxC.js → globalenv-section-DpY3-sT2.js} +1 -1
  41. package/dist/ui/assets/{health-BEMgcKD3.js → health-DNtnCuU2.js} +1 -1
  42. package/dist/ui/assets/{icons-DQFHtVq5.js → icons-Ce9So20E.js} +1 -1
  43. package/dist/ui/assets/{index-Cq9VySs6.js → index-BtXFodks.js} +1 -1
  44. package/dist/ui/assets/{index-DOC7_hun.js → index-CCOT49QL.js} +1 -1
  45. package/dist/ui/assets/{index-0GkznW41.js → index-CMGQKWf9.js} +1 -1
  46. package/dist/ui/assets/index-Cm0qoAXb.css +1 -0
  47. package/dist/ui/assets/{index-Ba4ysocb.js → index-DCzk2IIO.js} +1 -1
  48. package/dist/ui/assets/{index-Cj7EjEq6.js → index-DVwLJ_IR.js} +1 -1
  49. package/dist/ui/assets/{index-BRtgic66.js → index-PqtYNGNs.js} +19 -19
  50. package/dist/ui/assets/{index-0n_43sCZ.js → index-eLlSQvI4.js} +1 -1
  51. package/dist/ui/assets/{logs-Dth4naJl.js → logs-zi0sqSKN.js} +1 -1
  52. package/dist/ui/assets/{masked-input-DL6pJ8pE.js → masked-input-BZNVruOb.js} +1 -1
  53. package/dist/ui/assets/{proxy-status-widget-DW4cPFeD.js → proxy-status-widget-is1EjfwJ.js} +1 -1
  54. package/dist/ui/assets/{raw-json-settings-editor-panel-Dcumu3Qi.js → raw-json-settings-editor-panel-B1-yuQmO.js} +1 -1
  55. package/dist/ui/assets/{searchable-select-CWL2D5Ft.js → searchable-select-RdyLh0wy.js} +1 -1
  56. package/dist/ui/assets/{separator-Do_vqTQD.js → separator-DPjqb8vr.js} +1 -1
  57. package/dist/ui/assets/{shared-CwWuZx24.js → shared-RoP2uryw.js} +1 -1
  58. package/dist/ui/assets/{table-BP6nBZzg.js → table-M-kDRvQt.js} +1 -1
  59. package/dist/ui/assets/{updates-BTHJZ7Rk.js → updates-BWU5VmTL.js} +1 -1
  60. package/dist/ui/index.html +3 -3
  61. package/package.json +1 -1
  62. package/dist/ui/assets/accounts-CybVGDsm.js +0 -1
  63. package/dist/ui/assets/index-6xrth3Oz.css +0 -1
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-nu4wz29m.js";import{r as C,e as ve}from"./react-vendor-Bjx91N7w.js";import{u as Ce,a as $,b as F,e as ke,f as ee,g as we}from"./tanstack-bhJxV1h8.js";import{T as Pe,a as Ae,b as te,c as De,d as _e,e as Te}from"./table-BP6nBZzg.js";import{a as P,Y as z,ah as de,ai as ue,aj as xe,ak as me,al as he,L as S,I as V,x as _,aD as Se,d as b,B as A,C as O,b as R,e as Ge,f as Me,g as Oe,n as Re,j as I,k as q,_ as Q}from"./index-BRtgic66.js";import{A as ze,a as $e,b as Fe,c as Le,d as Ke,e as He,f as Ie,g as qe}from"./alert-dialog-C6npAhT0.js";import{t as k}from"./notifications-B4_o8bcr.js";import{b1 as W,b2 as E,b3 as pe,aH as ge,_ as fe,b4 as Ee,b5 as Ue,m as Y,at as Be,Q as Qe,a6 as U,T as J,x as Ze,$ as Xe,o as se,U as Ve,a9 as ae,Z as ne}from"./icons-DQFHtVq5.js";import{C as re}from"./checkbox-BLRznRTO.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./code-highlight-D4E79GKQ.js";function Z(a){return Array.from(a).sort((c,t)=>c.localeCompare(t))}function We(a){const c=new Map;for(const n of a){if(n.context_mode!=="shared")continue;const p=n.context_group||"default",m=c.get(p)??{group:p,sharedCount:0,deeperCount:0,accountNames:[]};m.sharedCount+=1,m.accountNames.push(n.name),n.continuity_mode==="deeper"&&(m.deeperCount+=1),c.set(p,m)}const t=Array.from(c.values()).sort((n,p)=>n.group.localeCompare(p.group)),o=a.map(n=>{if(n.context_mode!=="shared")return{...n,sameGroupPeerCount:0,sameGroupDeeperPeerCount:0};const p=n.context_group||"default",m=c.get(p),y=Math.max((m?.sharedCount??1)-1,0),x=Math.max((m?.deeperCount??0)-(n.continuity_mode==="deeper"?1:0),0);return{...n,sameGroupPeerCount:y,sameGroupDeeperPeerCount:x}}),s=o.filter(n=>n.context_mode==="shared").length,u=o.filter(n=>n.context_mode==="shared"&&n.continuity_mode==="deeper").length,l=o.filter(n=>n.context_inferred).length,h=o.filter(n=>n.context_mode==="shared"&&n.continuity_mode!=="deeper"&&n.continuity_inferred).length;return{accounts:o,sharedCount:s,sharedStandardCount:Math.max(s-u,0),deeperSharedCount:u,isolatedCount:o.length-s,legacyContextCount:l,legacyContinuityCount:h,sharedAloneCount:o.filter(n=>n.context_mode==="shared"&&n.sameGroupPeerCount===0).length,sharedPeerAccountCount:o.filter(n=>n.sameGroupPeerCount>0).length,deeperReadyAccountCount:o.filter(n=>n.continuity_mode==="deeper"&&n.sameGroupDeeperPeerCount>0).length,sharedPeerGroups:Z(t.filter(n=>n.sharedCount>=2).map(n=>n.group)),deeperReadyGroups:Z(t.filter(n=>n.deeperCount>=2).map(n=>n.group)),sharedGroups:Z(t.map(n=>n.group)),groupSummaries:t}}function Ye(){return Ce({queryKey:["accounts"],queryFn:()=>z.accounts.list(),select:a=>{const c=a.accounts.filter(u=>u.type!=="cliproxy"),t=We(c),o=a.accounts.length-c.length,s=t.accounts.some(u=>u.name===a.default)?a.default:null;return{accounts:t.accounts,default:s,cliproxyCount:o,legacyContextCount:t.legacyContextCount,legacyContinuityCount:t.legacyContinuityCount,sharedCount:t.sharedCount,sharedStandardCount:t.sharedStandardCount,deeperSharedCount:t.deeperSharedCount,isolatedCount:t.isolatedCount,sharedAloneCount:t.sharedAloneCount,sharedPeerAccountCount:t.sharedPeerAccountCount,deeperReadyAccountCount:t.deeperReadyAccountCount,sharedPeerGroups:t.sharedPeerGroups,deeperReadyGroups:t.deeperReadyGroups,sharedGroups:t.sharedGroups,groupSummaries:t.groupSummaries,plainCcsLane:a.plain_ccs_lane??null}}})}function Je(){const a=$(),{t:c}=P();return F({mutationFn:t=>z.accounts.setDefault(t),onSuccess:(t,o)=>{a.invalidateQueries({queryKey:["accounts"]}),k.success(c("toasts.defaultAccountSet",{name:o}))},onError:t=>{k.error(t.message)}})}function et(){const a=$(),{t:c}=P();return F({mutationFn:()=>z.accounts.resetDefault(),onSuccess:()=>{a.invalidateQueries({queryKey:["accounts"]}),k.success(c("toasts.defaultAccountReset"))},onError:t=>{k.error(t.message)}})}function tt(){const a=$(),{t:c}=P();return F({mutationFn:t=>z.accounts.delete(t),onSuccess:(t,o)=>{a.invalidateQueries({queryKey:["accounts"]}),k.success(c("toasts.accountDeleted",{name:o}))},onError:t=>{k.error(t.message)}})}function be(){const a=$(),{t:c}=P();return F({mutationFn:({name:t,context_mode:o,context_group:s,continuity_mode:u})=>z.accounts.updateContext(t,{context_mode:o,context_group:s,continuity_mode:u}),onSuccess:(t,o)=>{a.invalidateQueries({queryKey:["accounts"]});const s=(o.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-"),u=o.context_mode==="shared"?o.continuity_mode==="deeper"?`${c("accountsPage.sharedDeeper")} (${s})`:`${c("accountsPage.sharedStandard")} (${s})`:c("accountsPage.isolated");k.success(c("toasts.contextUpdated",{name:o.name,summary:u}))},onError:t=>{k.error(t.message)}})}function st(){const a=$(),{t:c}=P();return F({mutationFn:async t=>{const o=t.filter(l=>l.context_inferred||l.continuity_inferred),u=(await Promise.allSettled(o.map(l=>{const h=l.context_mode==="shared";return z.accounts.updateContext(l.name,{context_mode:h?"shared":"isolated",context_group:h?l.context_group||"default":void 0,continuity_mode:h?l.continuity_mode==="deeper"?"deeper":"standard":void 0})}))).filter(l=>l.status==="rejected").length;return{updatedCount:o.length-u,failedCount:u}},onSuccess:({updatedCount:t,failedCount:o})=>{if(a.invalidateQueries({queryKey:["accounts"]}),o>0&&t>0){k.error(c("toasts.legacyConfirmPartial",{updated:t,failed:o}));return}if(o>0){k.error(c("toasts.legacyConfirmAllFailed",{failed:o}));return}if(t>0){k.success(c("toasts.legacyConfirmSuccess",{count:t}));return}k.info(c("toasts.noLegacyAccounts"))},onError:t=>{a.invalidateQueries({queryKey:["accounts"]}),k.error(t.message)}})}const oe=64,at=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function nt({account:a,groupSummaries:c,plainCcsLane:t,onClose:o}){const{t:s}=P(),u=be(),[l,h]=C.useState(a.context_mode==="shared"?"shared":"isolated"),[n,p]=C.useState(a.context_group||"default"),[m,y]=C.useState(a.continuity_mode==="deeper"?"deeper":"standard"),x=C.useMemo(()=>n.trim().toLowerCase().replace(/\s+/g,"-"),[n]),i=C.useMemo(()=>c.find(g=>g.group===x),[c,x]),N=x.length>0&&x.length<=oe&&at.test(x),r=l==="isolated"||N,d=l==="shared"?Math.max((i?.sharedCount??0)-(a.context_mode==="shared"&&a.context_group===x?1:0),0):0,f=l==="shared"?Math.max((i?.deeperCount??0)-(a.continuity_mode==="deeper"&&a.context_group===x?1:0),0):0,v=t?.account_name===a.name,j=!!t&&!v,G=`ccs auth default ${a.name}`,T=`ccs auth backup ${a.name}`,w=(g,K,M,H)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(g.key))return;g.preventDefault();const je=M.indexOf(K),ye=g.key==="ArrowLeft"||g.key==="ArrowUp"?-1:1,Ne=(je+ye+M.length)%M.length;H(M[Ne])},L=t?t.kind==="native"?s("continuityOverview.lane.native"):t.kind==="account-default"?s("continuityOverview.lane.accountDefault",{name:t.account_name||""}):t.kind==="account-inherited"?s("continuityOverview.lane.accountInherited",{name:t.account_name||""}):t.kind==="profile-default"?s("continuityOverview.lane.profileDefault",{name:t.profile_name||"default"}):t.label:"",D=()=>{r&&u.mutate({name:a.name,context_mode:l,context_group:l==="shared"?x:void 0,continuity_mode:l==="shared"?m:void 0},{onSuccess:()=>{o()}})},B=g=>{g||o()};return e.jsx(de,{open:!0,onOpenChange:B,children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsxs(xe,{children:[e.jsx(me,{children:s("editAccountContext.title")}),e.jsx(he,{children:s("editAccountContext.description",{name:a.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.syncMode")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.syncMode"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":l==="isolated",tabIndex:l==="isolated"?0:-1,onClick:()=>h("isolated"),onKeyDown:g=>w(g,l,["isolated","shared"],h),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${l==="isolated"?"bg-background text-blue-600 dark:text-blue-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(W,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.isolatedOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":l==="shared",tabIndex:l==="shared"?0:-1,onClick:()=>h("shared"),onKeyDown:g=>w(g,l,["isolated","shared"],h),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${l==="shared"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(E,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(l==="isolated"?"editAccountContext.isolatedModeHint":"editAccountContext.sharedModeHint")})]}),l==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"context-group",children:s("editAccountContext.historySyncGroup")}),e.jsx(V,{id:"context-group",value:n,onChange:g=>p(g.target.value),placeholder:s("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.groupHint",{max:oe})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:s("editAccountContext.invalidGroup")})]}),l==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.continuityDepth")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.continuityDepth"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":m==="standard",tabIndex:m==="standard"?0:-1,onClick:()=>y("standard"),onKeyDown:g=>w(g,m,["standard","deeper"],y),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${m==="standard"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(E,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.standardOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":m==="deeper",tabIndex:m==="deeper"?0:-1,onClick:()=>y("deeper"),onKeyDown:g=>w(g,m,["standard","deeper"],y),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${m==="deeper"?"bg-background text-indigo-600 dark:text-indigo-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(pe,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(m==="standard"?"editAccountContext.standardHint":"editAccountContext.deeperHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.credentialsIsolated")}),j&&e.jsx("div",{className:"rounded-[14px] border border-amber-200 bg-amber-50/50 p-4 text-xs shadow-sm dark:border-amber-900/40 dark:bg-amber-900/10",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:s("continuityOverview.plainLaneDescription",{lane:L||"plain ccs",name:a.name})}),e.jsxs("div",{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 -r"}),e.jsx(_,{value:"ccs -r",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 auth backup default"}),e.jsx(_,{value:"ccs auth backup default",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:T}),e.jsx(_,{value:T,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:G}),e.jsx(_,{value:G,size:"icon"})]})]})]})}),e.jsx("div",{className:`rounded-[14px] border p-4 text-xs shadow-sm transition-colors ${l==="isolated"?"bg-blue-50/50 border-blue-200 dark:bg-blue-900/10 dark:border-blue-800/40":"bg-muted/40 border-border/60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[l==="isolated"?e.jsx(ge,{className:"h-4 w-4 text-blue-500 mt-0.5 shrink-0"}):e.jsx(fe,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"space-y-1.5 flex-1 text-muted-foreground leading-relaxed",children:[l==="isolated"?e.jsx("p",{className:"text-foreground font-medium selection:bg-blue-200",children:s("editAccountContext.isolatedImplication")}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:s("editAccountContext.sameGroupRule",{group:x})})," ",d>0?s("editAccountContext.sameGroupPeerCount",{count:d}):s("editAccountContext.noSameGroupPeer")]}),m==="deeper"&&e.jsx("p",{children:f>0?s("editAccountContext.deeperReady",{count:f}):e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:s("editAccountContext.deeperNeedsPeers")})})]}),e.jsx("p",{className:`pt-1.5 text-[11px] ${l==="isolated"?"text-blue-700/70 dark:text-blue-300/60":"text-muted-foreground/70"}`,children:s("editAccountContext.resumeOriginalWarning")})]})]})})]}),e.jsxs(Se,{children:[e.jsx(b,{variant:"outline",onClick:o,disabled:u.isPending,children:s("editAccountContext.cancel")}),e.jsx(b,{onClick:D,disabled:!r||u.isPending,children:u.isPending?s("editAccountContext.saving"):s("editAccountContext.save")})]})]})})}function ce({data:a,defaultAccount:c,groupSummaries:t,plainCcsLane:o}){const{t:s}=P(),u=Je(),l=tt(),h=et(),n=be(),[p,m]=C.useState(null),[y,x]=C.useState(null),i=[{accessorKey:"name",header:s("accountsTable.name"),size:200,cell:({row:r})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:r.original.name}),r.original.name===c&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:s("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:s("accountsTable.type"),size:100,cell:({row:r})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:r.original.type||"oauth"})},{accessorKey:"created",header:s("accountsTable.created"),size:150,cell:({row:r})=>{const d=new Date(r.original.created);return e.jsx("span",{className:"text-muted-foreground",children:d.toLocaleDateString()})}},{accessorKey:"last_used",header:s("accountsTable.lastUsed"),size:150,cell:({row:r})=>{if(!r.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const d=new Date(r.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:d.toLocaleDateString()})}},{id:"context",header:s("accountsTable.historySync"),size:170,cell:({row:r})=>{if(r.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((r.original.context_mode||"isolated")==="shared"){const f=r.original.context_group||"default",v=r.original.continuity_mode==="deeper";return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(A,{variant:"outline",className:`font-mono text-[10px] uppercase px-1.5 py-0 border ${v?"text-indigo-700 border-indigo-300/60 bg-indigo-50/50 dark:text-indigo-300 dark:border-indigo-900/40 dark:bg-indigo-900/20":"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20"}`,children:s(v?"accountsTable.badges.deeper":"accountsTable.badges.shared")}),e.jsx("span",{className:"text-xs font-semibold text-foreground/80",children:f})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:r.original.sameGroupPeerCount>0?s("accountsTable.sameGroupPeerCount",{count:r.original.sameGroupPeerCount}):s("accountsTable.noSameGroupPeer")})]})}return r.original.context_inferred?e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(A,{variant:"outline",className:"text-amber-700 border-amber-300/60 bg-amber-50/50 dark:text-amber-400 dark:border-amber-900/40 dark:bg-amber-900/20 font-mono text-[10px] uppercase px-1.5 py-0",children:s("accountsTable.badges.legacy")}),e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]}):e.jsx("div",{className:"flex flex-col items-start gap-1.5",children:e.jsx(A,{variant:"secondary",className:"font-mono text-[10px] uppercase px-1.5 py-0 text-muted-foreground bg-muted/60 border-transparent shadow-none",children:s("accountsTable.badges.isolated")})})}},{id:"actions",header:s("accountsTable.actions"),size:220,cell:({row:r})=>{const d=r.original.name===c,f=u.isPending||l.isPending||n.isPending,v=r.original.type==="cliproxy",j=r.original.context_inferred||r.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!v&&e.jsxs(b,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:f,onClick:()=>x(r.original),title:s("accountsTable.syncTitle"),children:[e.jsx(Ee,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sync")]}),!v&&j&&e.jsxs(b,{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:f,onClick:()=>n.mutate({name:r.original.name,context_mode:r.original.context_mode==="shared"?"shared":"isolated",context_group:r.original.context_mode==="shared"?r.original.context_group||"default":void 0,continuity_mode:r.original.context_mode==="shared"?r.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:s("accountsTable.confirmLegacyTitle"),children:[e.jsx(Ue,{className:"w-3 h-3 mr-1"}),s("accountsTable.confirm")]}),e.jsxs(b,{variant:d?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:d||f,onClick:()=>u.mutate(r.original.name),children:[e.jsx(Y,{className:`w-3 h-3 mr-1 ${d?"opacity-50":""}`}),s(d?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(b,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:d||f,onClick:()=>m(r.original.name),title:s(d?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(Be,{className:"w-4 h-4"})})]})}}],N=ke({data:a,columns:i,getCoreRowModel:we()});return a.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s("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(Pe,{children:[e.jsx(Ae,{children:N.getHeaderGroups().map(r=>e.jsx(te,{children:r.headers.map(d=>{const f={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",context:"w-[170px]",actions:"w-[290px]"}[d.id]||"w-auto";return e.jsx(De,{className:f,children:d.isPlaceholder?null:ee(d.column.columnDef.header,d.getContext())},d.id)})},r.id))}),e.jsx(_e,{children:N.getRowModel().rows.map(r=>e.jsx(te,{children:r.getVisibleCells().map(d=>e.jsx(Te,{children:ee(d.column.columnDef.cell,d.getContext())},d.id))},r.id))})]})}),c&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,children:[e.jsx(Qe,{className:"w-4 h-4 mr-2"}),s("accountsTable.resetToDefault")]})})]}),y&&e.jsx(nt,{account:y,groupSummaries:t,plainCcsLane:o,onClose:()=>x(null)}),e.jsx(ze,{open:!!p,onOpenChange:r=>!r&&m(null),children:e.jsxs($e,{children:[e.jsxs(Fe,{children:[e.jsx(Le,{children:s("accountsTable.deleteDialogTitle")}),e.jsx(Ke,{children:s("accountsTable.deleteDialogDesc",{name:p??""})})]}),e.jsxs(He,{children:[e.jsx(Ie,{children:s("accountsTable.cancel")}),e.jsx(qe,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{p&&(l.mutate(p),m(null))},children:s("accountsTable.delete")})]})]})})]})}const X=({titleKey:a,descKey:c})=>{const{t}=P();return e.jsxs(Ge,{children:[e.jsx(Me,{asChild:!0,children:e.jsx(b,{variant:"ghost",size:"icon","aria-label":t(a),className:"h-5 w-5 rounded-full hover:bg-muted text-muted-foreground/70 transition-colors",children:e.jsx(fe,{className:"h-3 w-3"})})}),e.jsxs(Oe,{className:"w-72 p-4 rounded-xl shadow-lg border-border/50 text-sm",side:"top",align:"center",children:[e.jsx("p",{className:"font-semibold tracking-tight",children:t(a)}),e.jsx("p",{className:"mt-1.5 text-muted-foreground leading-relaxed",children:t(c)})]})]})};function le({totalAccounts:a,primaryAccountName:c,isolatedCount:t,sharedStandardCount:o,deeperSharedCount:s,sharedAloneCount:u,sharedPeerAccountCount:l,deeperReadyAccountCount:h,sharedPeerGroups:n,deeperReadyGroups:p,legacyTargetCount:m,cliproxyCount:y,plainCcsLane:x}){const{t:i}=P(),N=x?x.kind==="native"?i("continuityOverview.lane.native"):x.kind==="account-default"?i("continuityOverview.lane.accountDefault",{name:x.account_name||""}):x.kind==="account-inherited"?i("continuityOverview.lane.accountInherited",{name:x.account_name||""}):x.kind==="profile-default"?i("continuityOverview.lane.profileDefault",{name:x.profile_name||"default"}):x.label:"",r=a<2?"single":n.length===0?t===a?"isolated":"shared-alone":p.length===0?"shared-standard":t>0||u>0||h<l||p.length<n.length?"partial":"ready",d=p[0]||n[0]||"default",f=p.length>0&&(t>0||o>0||n.length>p.length),j={ready:e.jsx(Ze,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}),"shared-standard":e.jsx(E,{className:"h-6 w-6 text-blue-600 dark:text-blue-400"}),single:e.jsx(ge,{className:"h-6 w-6 text-stone-400"}),isolated:e.jsx(W,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),"shared-alone":e.jsx(J,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),partial:e.jsx(J,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}[r],G=!!c&&x?.account_name===c,T=a>0&&!!x&&(!c||!G),w=a>1&&r!=="ready";return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(O,{className:"flex flex-col justify-between overflow-hidden relative group p-0 border-border bg-card shadow-sm hover:shadow-md transition-shadow duration-300",children:e.jsxs(R,{className:"p-6 flex flex-col h-full bg-gradient-to-br from-card to-muted/20 space-y-4",children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[e.jsx("div",{className:"rounded-2xl bg-background p-3 shadow-sm ring-1 ring-border/50 self-start shrink-0",children:j}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:i(`continuityReadiness.messages.${r}.title`,{group:d})}),e.jsx(A,{variant:r==="ready"?"default":"secondary",className:"rounded-full px-2.5 py-0.5 font-medium shadow-sm",children:i(`continuityReadiness.state.${r}`)})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg leading-relaxed",children:i(`continuityReadiness.messages.${r}.description`,{group:d,count:u})})]})]})}),e.jsxs("div",{className:"mt-auto pt-4 flex flex-wrap items-center gap-2",children:[y>0&&e.jsx(A,{variant:"outline",className:"text-blue-700 bg-blue-50/50 border-blue-200/60 dark:border-blue-900/40 dark:bg-blue-900/20 dark:text-blue-300",children:i("historySyncLearningMap.cliproxyManaged",{count:y})}),m>0&&e.jsx(A,{variant:"outline",className:"text-amber-700 bg-amber-50/50 border-amber-200/60 dark:border-amber-900/40 dark:bg-amber-900/20 dark:text-amber-300",children:i("historySyncLearningMap.legacyConfirmation",{count:m})}),n.length>0&&p.length===0&&e.jsx(A,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:i("continuityOverview.recommendBadge",{group:d})}),f&&e.jsx(A,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:i("continuityOverview.partialBadge",{group:d})})]})]})}),(T||w)&&e.jsx(O,{className:"border-dashed",children:e.jsxs(R,{className:"p-5 space-y-4",children:[T&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:i("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i("continuityOverview.plainLaneDescription",{lane:N||"plain ccs"})})]}),e.jsxs("div",{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 -r"}),e.jsx(_,{value:"ccs -r",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 auth backup default"}),e.jsx(_,{value:"ccs auth backup default",size:"icon"})]}),c?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 default ${c}`}),e.jsx(_,{value:`ccs auth default ${c}`,size:"icon"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:i("continuityOverview.setDefaultHint")})]})]}),w&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:i("continuityReadiness.stepsTitle")}),e.jsxs("ol",{className:"space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:i("continuityReadiness.steps.syncBoth")}),e.jsx("li",{children:i("continuityReadiness.steps.sameGroup",{group:d})}),e.jsx("li",{children:i("continuityReadiness.steps.enableDeeper")}),e.jsx("li",{children:i("continuityReadiness.steps.resumeOriginal")})]})]})]})}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-3",children:[e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-blue-300/40 bg-blue-50/50 dark:border-blue-900/30 dark:bg-blue-900/10 shadow-sm transition-colors hover:bg-blue-100/40 dark:hover:bg-blue-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{className:"h-4 w-4 text-blue-700/80 dark:text-blue-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-900 dark:text-blue-200",children:i("historySyncLearningMap.isolated")}),e.jsx(X,{titleKey:"accountsPage.isolated",descKey:"accountsPage.isolatedDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-blue-900 dark:text-blue-200",children:t})]}),e.jsx(U,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-emerald-300/40 bg-emerald-50/50 dark:border-emerald-900/30 dark:bg-emerald-900/10 shadow-sm transition-colors hover:bg-emerald-100/40 dark:hover:bg-emerald-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{className:"h-4 w-4 text-emerald-700/80 dark:text-emerald-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-900 dark:text-emerald-200",children:i("historySyncLearningMap.shared")}),e.jsx(X,{titleKey:"accountsPage.sharedStandard",descKey:"accountsPage.sharedStandardDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-emerald-900 dark:text-emerald-200",children:o})]}),e.jsx(U,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-indigo-300/40 bg-indigo-50/50 dark:border-indigo-900/30 dark:bg-indigo-900/10 shadow-sm transition-colors hover:bg-indigo-100/40 dark:hover:bg-indigo-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{className:"h-4 w-4 text-indigo-700/80 dark:text-indigo-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-indigo-900 dark:text-indigo-200",children:i("historySyncLearningMap.deeper")}),e.jsx(X,{titleKey:"accountsPage.sharedDeeper",descKey:"accountsPage.sharedDeeperDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-indigo-900 dark:text-indigo-200",children:s})]})]})]})}const ie=64;function rt({open:a,onClose:c}){const{t}=P(),[o,s]=C.useState(""),[u,l]=C.useState(!1),[h,n]=C.useState(""),[p,m]=C.useState(!1),[y,x]=C.useState(!1),i=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(o),N=h.trim().toLowerCase().replace(/\s+/g,"-"),r=N.length===0||N.length<=ie&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(N),d=o&&i?[`ccs auth create ${o}`,u?N.length>0?`--context-group ${N}`:"--share-context":"",u&&p?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),f=async()=>{!i||u&&!r||(await navigator.clipboard.writeText(d),x(!0),setTimeout(()=>x(!1),2e3))},v=()=>{s(""),l(!1),n(""),m(!1),x(!1),c()};return e.jsx(de,{open:a,onOpenChange:j=>!j&&v(),children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsxs(xe,{children:[e.jsx(me,{children:t("createAuthProfileDialog.title")}),e.jsx(he,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(V,{id:"profile-name",value:o,onChange:j=>s(j.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),o&&!i&&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(re,{id:"share-context",checked:u,onCheckedChange:j=>l(j===!0)}),e.jsx(S,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),u&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(S,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(V,{id:"context-group",value:h,onChange:j=>n(j.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(re,{id:"deeper-continuity",checked:p,onCheckedChange:j=>m(j===!0)}),e.jsx(S,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),h.trim().length>0&&!r&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ie})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{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(Xe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:d}),e.jsx(b,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:f,disabled:!i||u&&!r,children:y?e.jsx(Y,{className:"w-4 h-4 text-green-500"}):e.jsx(se,{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(b,{variant:"ghost",onClick:v,children:t("createAuthProfileDialog.close")}),e.jsx(b,{onClick:f,disabled:!i||u&&!r,children:y?e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function bt(){const{t:a}=P(),c=ve(),{data:t,isLoading:o}=Ye(),s=st(),[u,l]=C.useState(!1),h=t?.accounts||[],n=t?.cliproxyCount||0,p=t?.legacyContextCount||0,m=t?.legacyContinuityCount||0,y=t?.sharedCount||0,x=t?.sharedStandardCount||0,i=t?.deeperSharedCount||0,N=t?.isolatedCount||0,r=t?.sharedAloneCount||0,d=t?.sharedPeerAccountCount||0,f=t?.deeperReadyAccountCount||0,v=t?.sharedPeerGroups||[],j=t?.deeperReadyGroups||[],G=t?.sharedGroups||[],T=t?.groupSummaries||[],w=t?.plainCcsLane||null,L=h.filter(H=>H.context_inferred||H.continuity_inferred),D=L.length,B=D>0,g=()=>c("/cliproxy?provider=claude"),K=()=>c("/cliproxy?provider=claude&action=auth"),M=()=>s.mutate(L);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(Ve,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:a("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.manageSuffix")]})]}),e.jsx(Re,{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:a("accountsPage.primaryActions")}),e.jsxs(b,{size:"sm",className:"w-full justify-start",onClick:()=>l(!0),children:[e.jsx(ae,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(b,{size:"sm",className:"w-full justify-start",onClick:K,children:[e.jsx(ne,{className:"w-4 h-4 mr-2"}),a("accountsPage.authClaudeInPool")]}),e.jsxs(b,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:g,children:[a("accountsPage.openClaudePoolSettings"),e.jsx(U,{className:"w-4 h-4 ml-auto"})]})]}),B?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("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(J,{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:[p>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContextPending",{count:p})}),m>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContinuityPending",{count:m})})]})]}),e.jsx(b,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:M,disabled:s.isPending||D===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:D})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:a("accountsPage.noLegacyFollowup")}),e.jsxs(O,{children:[e.jsxs(I,{className:"pb-2",children:[e.jsx(q,{className:"text-sm",children:a("accountsPage.quickCommands")}),e.jsx(Q,{children:a("accountsPage.quickCommandsDesc")})]}),e.jsxs(R,{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(_,{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(_,{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(A,{variant:"outline",children:a("accountsPage.workspaceBadge")}),e.jsx(A,{variant:"secondary",children:a("accountsPage.historySyncBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:a("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[a("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:a("accountsTable.sync")}),a("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(le,{totalAccounts:h.length,primaryAccountName:h.length===1?h[0]?.name:null,isolatedCount:N,sharedStandardCount:x,deeperSharedCount:i,sharedAloneCount:r,sharedPeerAccountCount:d,deeperReadyAccountCount:f,sharedGroups:G,sharedPeerGroups:v,deeperReadyGroups:j,legacyTargetCount:D,cliproxyCount:n,plainCcsLane:w}),e.jsxs(O,{className:"flex flex-col",children:[e.jsxs(I,{className:"pb-3",children:[e.jsx(q,{className:"text-lg",children:a("accountsPage.accountMatrix")}),e.jsx(Q,{children:a("accountsPage.sharedTotalDesc",{count:y})})]}),e.jsx(R,{children:o?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ce,{data:h,defaultAccount:t?.default??null,groupSummaries:T,plainCcsLane:w})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(O,{children:[e.jsxs(I,{children:[e.jsx(q,{className:"text-lg",children:a("accountsPage.title")}),e.jsxs(Q,{children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.mobileManageSuffix")]})]}),e.jsxs(R,{className:"space-y-2",children:[e.jsxs(b,{className:"w-full",onClick:()=>l(!0),children:[e.jsx(ae,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(b,{variant:"outline",className:"w-full",onClick:g,children:[a("accountsPage.openCliProxyClaudePool"),e.jsx(U,{className:"w-4 h-4 ml-2"})]}),e.jsxs(b,{variant:"outline",className:"w-full",onClick:K,children:[a("accountsPage.authClaudeInPool"),e.jsx(ne,{className:"w-4 h-4 ml-2"})]}),e.jsx(b,{variant:"outline",className:"w-full",onClick:M,disabled:s.isPending||D===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:D})})]})]}),e.jsx(le,{totalAccounts:h.length,primaryAccountName:h.length===1?h[0]?.name:null,isolatedCount:N,sharedStandardCount:x,deeperSharedCount:i,sharedAloneCount:r,sharedPeerAccountCount:d,deeperReadyAccountCount:f,sharedGroups:G,sharedPeerGroups:v,deeperReadyGroups:j,legacyTargetCount:D,cliproxyCount:n,plainCcsLane:w}),e.jsxs(O,{children:[e.jsx(I,{className:"pb-3",children:e.jsx(q,{className:"text-base",children:a("accountsPage.accountMatrix")})}),e.jsx(R,{children:o?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ce,{data:h,defaultAccount:t?.default??null,groupSummaries:T,plainCcsLane:w})})]})]}),e.jsx(rt,{open:u,onClose:()=>l(!1)})]})}export{bt as AccountsPage};