@kaitranntt/ccs 7.66.0-dev.2 → 7.66.0-dev.4

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 (60) hide show
  1. package/dist/cliproxy/auth/oauth-handler.d.ts +1 -4
  2. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  3. package/dist/cliproxy/auth/oauth-handler.js +2 -33
  4. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  5. package/dist/cliproxy/auth/oauth-process.d.ts +13 -0
  6. package/dist/cliproxy/auth/oauth-process.d.ts.map +1 -1
  7. package/dist/cliproxy/auth/oauth-process.js +56 -36
  8. package/dist/cliproxy/auth/oauth-process.js.map +1 -1
  9. package/dist/cliproxy/auth/token-manager.d.ts +9 -0
  10. package/dist/cliproxy/auth/token-manager.d.ts.map +1 -1
  11. package/dist/cliproxy/auth/token-manager.js +104 -58
  12. package/dist/cliproxy/auth/token-manager.js.map +1 -1
  13. package/dist/commands/docker/up-subcommand.js +1 -1
  14. package/dist/commands/docker/up-subcommand.js.map +1 -1
  15. package/dist/ui/assets/{accounts-l__hcQUq.js → accounts-BUBaJvX6.js} +1 -1
  16. package/dist/ui/assets/{alert-dialog-BtM3eP43.js → alert-dialog-BSHMTH4-.js} +1 -1
  17. package/dist/ui/assets/{api-Ddwn7EXC.js → api-ChLCuNLU.js} +1 -1
  18. package/dist/ui/assets/{auth-section-BnYn1EA3.js → auth-section-BhmOD3zG.js} +1 -1
  19. package/dist/ui/assets/{backups-section-M4jx3HzK.js → backups-section-Bi22P9k4.js} +1 -1
  20. package/dist/ui/assets/{channels-D9ywyAj3.js → channels-BzYyOP0U.js} +1 -1
  21. package/dist/ui/assets/{checkbox-Df-yoPbe.js → checkbox-DXj-4eLk.js} +1 -1
  22. package/dist/ui/assets/{claude-extension-Cxg0a-Ee.js → claude-extension-Bh9pF8rf.js} +1 -1
  23. package/dist/ui/assets/{cliproxy-ai-providers-DtW-6cPc.js → cliproxy-ai-providers-C5Kw8KgM.js} +1 -1
  24. package/dist/ui/assets/{cliproxy-control-panel-0TyLDMf7.js → cliproxy-control-panel-DLLoW9yz.js} +1 -1
  25. package/dist/ui/assets/{cliproxy-DPFdpIHy.js → cliproxy-oJmvPKpC.js} +1 -1
  26. package/dist/ui/assets/{codex-BtPojOrJ.js → codex-CNDtlY6P.js} +1 -1
  27. package/dist/ui/assets/{confirm-dialog-BMwFBq5G.js → confirm-dialog-CF5EDIrm.js} +1 -1
  28. package/dist/ui/assets/{copilot-BG3BnHxa.js → copilot-DcsWzY5x.js} +1 -1
  29. package/dist/ui/assets/{cursor-BfDO73Lu.js → cursor-D35uxPJ3.js} +1 -1
  30. package/dist/ui/assets/{droid-iW-Vtuhy.js → droid-cwS_m2Fj.js} +1 -1
  31. package/dist/ui/assets/{globalenv-section-d9h23hIf.js → globalenv-section-B7amS8JA.js} +1 -1
  32. package/dist/ui/assets/{health-BPPMFQMR.js → health-BMb4MU3S.js} +1 -1
  33. package/dist/ui/assets/{index-BPyp9RJE.js → index-BBHJt5Yt.js} +1 -1
  34. package/dist/ui/assets/{index-wIy8qzU9.js → index-Bmd4gqsh.js} +15 -15
  35. package/dist/ui/assets/{index-CeP2Pr2w.js → index-C90qrEFO.js} +1 -1
  36. package/dist/ui/assets/{index-DYY3wcwk.js → index-CQSl6vEt.js} +1 -1
  37. package/dist/ui/assets/{index-DusmDwkD.js → index-Cnp8oH1Z.js} +1 -1
  38. package/dist/ui/assets/{index-B6Y8wFQ0.css → index-Cw_d3NZ2.css} +1 -1
  39. package/dist/ui/assets/{index-CctYE17X.js → index-osM0SZ9h.js} +1 -1
  40. package/dist/ui/assets/{masked-input-DWNtAEKs.js → masked-input-DUqplFGl.js} +1 -1
  41. package/dist/ui/assets/{proxy-status-widget-GS3qroms.js → proxy-status-widget-IxTsEDhP.js} +1 -1
  42. package/dist/ui/assets/{raw-json-settings-editor-panel-e3Ziu5B1.js → raw-json-settings-editor-panel-eQGtUD6M.js} +1 -1
  43. package/dist/ui/assets/{searchable-select-D2G6gg3h.js → searchable-select-D_SVA6pH.js} +1 -1
  44. package/dist/ui/assets/{separator-CR1SGLxF.js → separator-Cuk1ilZb.js} +1 -1
  45. package/dist/ui/assets/{shared-BpB5GiWS.js → shared-BaW8OUvz.js} +1 -1
  46. package/dist/ui/assets/{table-BMbwptG_.js → table-BKS_LAxP.js} +1 -1
  47. package/dist/ui/assets/{updates-iC3kvbKP.js → updates-CunZLYFy.js} +1 -1
  48. package/dist/ui/index.html +2 -2
  49. package/dist/web-server/routes/auth-routes.js +11 -11
  50. package/dist/web-server/routes/auth-routes.js.map +1 -1
  51. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  52. package/dist/web-server/routes/cliproxy-auth-routes.js +2 -69
  53. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  54. package/dist/web-server/routes/index.d.ts.map +1 -1
  55. package/dist/web-server/routes/index.js +18 -0
  56. package/dist/web-server/routes/index.js.map +1 -1
  57. package/dist/web-server/usage/routes.d.ts.map +1 -1
  58. package/dist/web-server/usage/routes.js +11 -0
  59. package/dist/web-server/usage/routes.js.map +1 -1
  60. package/package.json +1 -1
@@ -29,9 +29,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  return result;
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.ensureTokenValid = exports.displayAuthStatus = exports.registerAccountFromToken = exports.clearAuth = exports.getAllAuthStatus = exports.getAuthStatus = exports.isAuthenticated = exports.isTokenFileForProvider = exports.getProviderTokenDir = void 0;
32
+ exports.ensureTokenValid = exports.displayAuthStatus = exports.registerAccountFromToken = exports.clearAuth = exports.getAllAuthStatus = exports.getAuthStatus = exports.isAuthenticated = exports.findNewTokenSnapshotForAuthAttempt = exports.findNewTokenSnapshot = exports.listProviderTokenSnapshots = exports.isTokenFileForProvider = exports.getProviderTokenDir = void 0;
33
33
  const fs = __importStar(require("fs"));
34
34
  const path = __importStar(require("path"));
35
+ const crypto_1 = require("crypto");
35
36
  const profile_detector_1 = require("../../auth/profile-detector");
36
37
  const config_generator_1 = require("../config-generator");
37
38
  const account_manager_1 = require("../account-manager");
@@ -62,6 +63,107 @@ function isTokenFileForProvider(filePath, provider) {
62
63
  }
63
64
  }
64
65
  exports.isTokenFileForProvider = isTokenFileForProvider;
66
+ function buildTokenFingerprint(content) {
67
+ return (0, crypto_1.createHash)('sha256').update(content).digest('hex');
68
+ }
69
+ function listTokenCandidates(provider, tokenDir) {
70
+ if (!fs.existsSync(tokenDir)) {
71
+ return [];
72
+ }
73
+ const files = fs.readdirSync(tokenDir);
74
+ const jsonFiles = files.filter((file) => file.endsWith('.json'));
75
+ const existingAccounts = (0, account_manager_1.getProviderAccounts)(provider);
76
+ const rawCandidates = jsonFiles.flatMap((file) => {
77
+ const filePath = path.join(tokenDir, file);
78
+ if (!isTokenFileForProvider(filePath, provider)) {
79
+ return [];
80
+ }
81
+ const content = fs.readFileSync(filePath, 'utf-8');
82
+ const data = JSON.parse(content);
83
+ const email = data.email || undefined;
84
+ const projectId = data.project_id || undefined;
85
+ const stats = fs.statSync(filePath);
86
+ return [
87
+ {
88
+ file,
89
+ filePath,
90
+ content,
91
+ email,
92
+ projectId,
93
+ mtimeMs: stats.mtimeMs,
94
+ alreadyRegistered: existingAccounts.some((account) => account.tokenFile === file),
95
+ },
96
+ ];
97
+ });
98
+ const duplicateEmailCounts = new Map();
99
+ const duplicateEmailTokenSets = new Map();
100
+ for (const account of existingAccounts) {
101
+ if (!account.email)
102
+ continue;
103
+ const key = account.email.toLowerCase();
104
+ const tokenSet = duplicateEmailTokenSets.get(key) ?? new Set();
105
+ tokenSet.add(account.tokenFile);
106
+ duplicateEmailTokenSets.set(key, tokenSet);
107
+ }
108
+ for (const candidate of rawCandidates) {
109
+ if (!candidate.email)
110
+ continue;
111
+ const key = candidate.email.toLowerCase();
112
+ const tokenSet = duplicateEmailTokenSets.get(key) ?? new Set();
113
+ tokenSet.add(candidate.file);
114
+ duplicateEmailTokenSets.set(key, tokenSet);
115
+ }
116
+ for (const [key, tokenSet] of duplicateEmailTokenSets) {
117
+ duplicateEmailCounts.set(key, tokenSet.size);
118
+ }
119
+ return rawCandidates
120
+ .map((rawCandidate) => {
121
+ const duplicateEmailCount = rawCandidate.email
122
+ ? (duplicateEmailCounts.get(rawCandidate.email.toLowerCase()) ?? 1)
123
+ : 1;
124
+ const accountId = rawCandidate.email
125
+ ? (0, email_account_identity_1.buildEmailBackedAccountId)(provider, rawCandidate.file, rawCandidate.email, duplicateEmailCount)
126
+ : (0, token_file_ops_1.extractAccountIdFromTokenFile)(rawCandidate.file, rawCandidate.email);
127
+ return {
128
+ ...rawCandidate,
129
+ accountId,
130
+ fingerprint: buildTokenFingerprint(rawCandidate.content),
131
+ };
132
+ })
133
+ .sort((left, right) => right.mtimeMs - left.mtimeMs);
134
+ }
135
+ function listProviderTokenSnapshots(provider, tokenDir = getProviderTokenDir(provider)) {
136
+ return listTokenCandidates(provider, tokenDir).map((candidate) => ({
137
+ file: candidate.file,
138
+ mtimeMs: candidate.mtimeMs,
139
+ accountId: candidate.accountId,
140
+ fingerprint: candidate.fingerprint,
141
+ }));
142
+ }
143
+ exports.listProviderTokenSnapshots = listProviderTokenSnapshots;
144
+ function findNewTokenSnapshot(currentTokenFiles, knownTokenFiles, expectedAccountId) {
145
+ const knownSnapshotsByFile = new Map(knownTokenFiles.map((snapshot) => [snapshot.file, snapshot]));
146
+ return (currentTokenFiles.find((snapshot) => {
147
+ const knownSnapshot = knownSnapshotsByFile.get(snapshot.file);
148
+ if (!expectedAccountId) {
149
+ return !knownSnapshot;
150
+ }
151
+ const matchesExpectedAccount = snapshot.file === expectedAccountId || snapshot.accountId === expectedAccountId;
152
+ if (!matchesExpectedAccount) {
153
+ return false;
154
+ }
155
+ if (!knownSnapshot) {
156
+ return true;
157
+ }
158
+ return (snapshot.fingerprint !== knownSnapshot.fingerprint ||
159
+ snapshot.mtimeMs !== knownSnapshot.mtimeMs);
160
+ }) || null);
161
+ }
162
+ exports.findNewTokenSnapshot = findNewTokenSnapshot;
163
+ function findNewTokenSnapshotForAuthAttempt(provider, tokenDir, knownTokenFiles, expectedAccountId) {
164
+ return findNewTokenSnapshot(listProviderTokenSnapshots(provider, tokenDir), knownTokenFiles, expectedAccountId);
165
+ }
166
+ exports.findNewTokenSnapshotForAuthAttempt = findNewTokenSnapshotForAuthAttempt;
65
167
  /**
66
168
  * Check if provider has valid authentication
67
169
  * CLIProxyAPI stores OAuth tokens as JSON files in the auth directory.
@@ -204,64 +306,8 @@ function registerAccountFromToken(provider, tokenDir, nickname, verbose = false,
204
306
  const { registerAccount } = require('../account-manager');
205
307
  let selectedCandidate = null;
206
308
  try {
207
- const files = fs.readdirSync(tokenDir);
208
- const jsonFiles = files.filter((f) => f.endsWith('.json'));
309
+ const candidates = listTokenCandidates(provider, tokenDir);
209
310
  const existingAccounts = (0, account_manager_1.getProviderAccounts)(provider);
210
- const rawCandidates = jsonFiles.flatMap((file) => {
211
- const filePath = path.join(tokenDir, file);
212
- if (!isTokenFileForProvider(filePath, provider))
213
- return [];
214
- const content = fs.readFileSync(filePath, 'utf-8');
215
- const data = JSON.parse(content);
216
- const email = data.email || undefined;
217
- const projectId = data.project_id || undefined;
218
- const stats = fs.statSync(filePath);
219
- return [
220
- {
221
- file,
222
- filePath,
223
- email,
224
- projectId,
225
- mtimeMs: stats.mtimeMs,
226
- alreadyRegistered: existingAccounts.some((account) => account.tokenFile === file),
227
- },
228
- ];
229
- });
230
- const duplicateEmailCounts = new Map();
231
- const duplicateEmailTokenSets = new Map();
232
- for (const account of existingAccounts) {
233
- if (!account.email)
234
- continue;
235
- const key = account.email.toLowerCase();
236
- const tokenSet = duplicateEmailTokenSets.get(key) ?? new Set();
237
- tokenSet.add(account.tokenFile);
238
- duplicateEmailTokenSets.set(key, tokenSet);
239
- }
240
- for (const candidate of rawCandidates) {
241
- if (!candidate.email)
242
- continue;
243
- const key = candidate.email.toLowerCase();
244
- const tokenSet = duplicateEmailTokenSets.get(key) ?? new Set();
245
- tokenSet.add(candidate.file);
246
- duplicateEmailTokenSets.set(key, tokenSet);
247
- }
248
- for (const [key, tokenSet] of duplicateEmailTokenSets) {
249
- duplicateEmailCounts.set(key, tokenSet.size);
250
- }
251
- const candidates = rawCandidates
252
- .map((rawCandidate) => {
253
- const duplicateEmailCount = rawCandidate.email
254
- ? (duplicateEmailCounts.get(rawCandidate.email.toLowerCase()) ?? 1)
255
- : 1;
256
- const accountId = rawCandidate.email
257
- ? (0, email_account_identity_1.buildEmailBackedAccountId)(provider, rawCandidate.file, rawCandidate.email, duplicateEmailCount)
258
- : (0, token_file_ops_1.extractAccountIdFromTokenFile)(rawCandidate.file, rawCandidate.email);
259
- return {
260
- ...rawCandidate,
261
- accountId,
262
- };
263
- })
264
- .sort((a, b) => b.mtimeMs - a.mtimeMs);
265
311
  if (expectedAccountId) {
266
312
  selectedCandidate =
267
313
  candidates.find((candidate) => candidate.accountId === expectedAccountId) ||
@@ -1 +1 @@
1
- {"version":3,"file":"token-manager.js","sourceRoot":"","sources":["../../../src/cliproxy/auth/token-manager.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAE7B,kEAAgE;AAChE,0DAAyD;AACzD,wDAA4E;AAC5E,+DAA4F;AAC5F,+EAA+E;AAC/E,6CAKsB;AAEtB;;GAEG;AACH,SAAgB,mBAAmB,CAAC,QAA0B;IAC5D,OAAO,IAAA,qCAAkB,EAAC,QAAQ,CAAC,CAAC;AACtC,CAAC;AAFD,kDAEC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,QAAgB,EAAE,QAA0B;IACjF,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACj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F,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;AAC1D,CAAC;AAlBD,8CAkBC;AAED;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,gBAAgB,CACpC,QAA0B,EAC1B,OAAO,GAAG,KAAK;IAEf,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,EAAE,sBAAsB,EAAE,GAAG,wDAAa,wBAAwB,GAAC,CAAC;QAC1E,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,iFAAiF;IACjF,kEAAkE;IAClE,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAChE,CAAC;AAZD,4CAYC"}
@@ -30,7 +30,7 @@ async function handleUp(args) {
30
30
  console.log((0, ui_1.info)(`Dashboard port: ${port}`));
31
31
  console.log((0, ui_1.info)(`CLIProxy port: ${proxyPort}`));
32
32
  if (parsed.host) {
33
- console.log((0, ui_1.info)('Remote access requires dashboard auth. Run inside the container:\n docker exec -it ccs-cliproxy ccs config auth setup'));
33
+ console.log((0, ui_1.info)('Full remote management requires dashboard auth. Without it, remote access stays read-only.\nRun inside the container:\n docker exec -it ccs-cliproxy ccs config auth setup'));
34
34
  }
35
35
  }
36
36
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"up-subcommand.js","sourceRoot":"","sources":["../../../src/commands/docker/up-subcommand.ts"],"names":[],"mappings":";;;AAAA,yCAIsB;AACtB,uCAA6D;AAC7D,uCAA8E;AAE9E,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAU,CAAC;AAE3D,KAAK,UAAU,QAAQ,CAAC,IAAc;IAC3C,MAAM,IAAA,WAAM,GAAE,CAAC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,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CACX,IAAA,QAAG,EAAC,IAAA,SAAI,EAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;YAChE,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,CAAC;SACX,CAAC,CACH,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AA7CD,4BA6CC"}
@@ -1 +1 @@
1
- import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as C,h as ve}from"./react-vendor-CNOkPC89.js";import{u as Ce,a as $,b as F,e as ke,f as ee,g as we}from"./tanstack-DWm6aJ-G.js";import{T as Pe,a as Ae,b as te,c as De,d as _e,e as Te}from"./table-BMbwptG_.js";import{Y as O,a as z,af as de,ag as ue,ah as xe,ai as me,aj as he,L as T,I as X,x as D,aB as Se,d as b,B as P,C as M,b as R,e as Ge,f as Me,g as Re,n as Oe,j as I,k as q,_ as Z}from"./index-wIy8qzU9.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-BtM3eP43.js";import{t as k}from"./notifications-B2HqRBj7.js";import{aV as W,aW as B,aX as pe,aB as ge,V as fe,aY as Be,aZ as Ee,l as Y,ap as Ue,N as Ze,aw as E,T as J,w as Qe,Y as Ve,n as ae,U as Xe,a6 as se,Z as ne}from"./icons-BxSzn11s.js";import{C as re}from"./checkbox-Df-yoPbe.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Q(s){return Array.from(s).sort((r,t)=>r.localeCompare(t))}function We(s){const r=new Map;for(const n of s){if(n.context_mode!=="shared")continue;const h=n.context_group||"default",m=r.get(h)??{group:h,sharedCount:0,deeperCount:0,accountNames:[]};m.sharedCount+=1,m.accountNames.push(n.name),n.continuity_mode==="deeper"&&(m.deeperCount+=1),r.set(h,m)}const t=Array.from(r.values()).sort((n,h)=>n.group.localeCompare(h.group)),u=s.map(n=>{if(n.context_mode!=="shared")return{...n,sameGroupPeerCount:0,sameGroupDeeperPeerCount:0};const h=n.context_group||"default",m=r.get(h),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}}),a=u.filter(n=>n.context_mode==="shared").length,i=u.filter(n=>n.context_mode==="shared"&&n.continuity_mode==="deeper").length,c=u.filter(n=>n.context_inferred).length,p=u.filter(n=>n.context_mode==="shared"&&n.continuity_mode!=="deeper"&&n.continuity_inferred).length;return{accounts:u,sharedCount:a,sharedStandardCount:Math.max(a-i,0),deeperSharedCount:i,isolatedCount:u.length-a,legacyContextCount:c,legacyContinuityCount:p,sharedAloneCount:u.filter(n=>n.context_mode==="shared"&&n.sameGroupPeerCount===0).length,sharedPeerAccountCount:u.filter(n=>n.sameGroupPeerCount>0).length,deeperReadyAccountCount:u.filter(n=>n.continuity_mode==="deeper"&&n.sameGroupDeeperPeerCount>0).length,sharedPeerGroups:Q(t.filter(n=>n.sharedCount>=2).map(n=>n.group)),deeperReadyGroups:Q(t.filter(n=>n.deeperCount>=2).map(n=>n.group)),sharedGroups:Q(t.map(n=>n.group)),groupSummaries:t}}function Ye(){return Ce({queryKey:["accounts"],queryFn:()=>O.accounts.list(),select:s=>{const r=s.accounts.filter(i=>i.type!=="cliproxy"),t=We(r),u=s.accounts.length-r.length,a=t.accounts.some(i=>i.name===s.default)?s.default:null;return{accounts:t.accounts,default:a,cliproxyCount:u,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:s.plain_ccs_lane??null}}})}function Je(){const s=$();return F({mutationFn:r=>O.accounts.setDefault(r),onSuccess:(r,t)=>{s.invalidateQueries({queryKey:["accounts"]}),k.success(`Default account set to "${t}"`)},onError:r=>{k.error(r.message)}})}function et(){const s=$();return F({mutationFn:()=>O.accounts.resetDefault(),onSuccess:()=>{s.invalidateQueries({queryKey:["accounts"]}),k.success("Default account reset to CCS")},onError:r=>{k.error(r.message)}})}function tt(){const s=$();return F({mutationFn:r=>O.accounts.delete(r),onSuccess:(r,t)=>{s.invalidateQueries({queryKey:["accounts"]}),k.success(`Account "${t}" deleted`)},onError:r=>{k.error(r.message)}})}function be(){const s=$();return F({mutationFn:({name:r,context_mode:t,context_group:u,continuity_mode:a})=>O.accounts.updateContext(r,{context_mode:t,context_group:u,continuity_mode:a}),onSuccess:(r,t)=>{s.invalidateQueries({queryKey:["accounts"]});const u=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";k.success(`Updated "${t.name}" context to ${u}`)},onError:r=>{k.error(r.message)}})}function at(){const s=$();return F({mutationFn:async r=>{const t=r.filter(i=>i.context_inferred||i.continuity_inferred),a=(await Promise.allSettled(t.map(i=>{const c=i.context_mode==="shared";return O.accounts.updateContext(i.name,{context_mode:c?"shared":"isolated",context_group:c?i.context_group||"default":void 0,continuity_mode:c?i.continuity_mode==="deeper"?"deeper":"standard":void 0})}))).filter(i=>i.status==="rejected").length;return{updatedCount:t.length-a,failedCount:a}},onSuccess:({updatedCount:r,failedCount:t})=>{if(s.invalidateQueries({queryKey:["accounts"]}),t>0&&r>0){k.error(`Confirmed ${r} legacy account${r>1?"s":""}, but ${t} update${t>1?"s":""} failed. Refreshed account state.`);return}if(t>0){k.error(`Failed to confirm ${t} legacy account${t>1?"s":""}. Refreshed account state.`);return}if(r>0){k.success(`Confirmed explicit sync mode for ${r} legacy account${r>1?"s":""}`);return}k.info("No legacy accounts need confirmation")},onError:r=>{s.invalidateQueries({queryKey:["accounts"]}),k.error(r.message)}})}const oe=64,st=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function nt({account:s,groupSummaries:r,plainCcsLane:t,onClose:u}){const{t:a}=z(),i=be(),[c,p]=C.useState(s.context_mode==="shared"?"shared":"isolated"),[n,h]=C.useState(s.context_group||"default"),[m,y]=C.useState(s.continuity_mode==="deeper"?"deeper":"standard"),x=C.useMemo(()=>n.trim().toLowerCase().replace(/\s+/g,"-"),[n]),l=C.useMemo(()=>r.find(g=>g.group===x),[r,x]),N=x.length>0&&x.length<=oe&&st.test(x),o=c==="isolated"||N,d=c==="shared"?Math.max((l?.sharedCount??0)-(s.context_mode==="shared"&&s.context_group===x?1:0),0):0,f=c==="shared"?Math.max((l?.deeperCount??0)-(s.continuity_mode==="deeper"&&s.context_group===x?1:0),0):0,v=t?.account_name===s.name,j=!!t&&!v,S=`ccs auth default ${s.name}`,_=`ccs auth backup ${s.name}`,w=(g,K,G,H)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(g.key))return;g.preventDefault();const je=G.indexOf(K),ye=g.key==="ArrowLeft"||g.key==="ArrowUp"?-1:1,Ne=(je+ye+G.length)%G.length;H(G[Ne])},L=t?t.kind==="native"?a("continuityOverview.lane.native"):t.kind==="account-default"?a("continuityOverview.lane.accountDefault",{name:t.account_name||""}):t.kind==="account-inherited"?a("continuityOverview.lane.accountInherited",{name:t.account_name||""}):t.kind==="profile-default"?a("continuityOverview.lane.profileDefault",{name:t.profile_name||"default"}):t.label:"",A=()=>{o&&i.mutate({name:s.name,context_mode:c,context_group:c==="shared"?x:void 0,continuity_mode:c==="shared"?m:void 0},{onSuccess:()=>{u()}})},U=g=>{g||u()};return e.jsx(de,{open:!0,onOpenChange:U,children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsxs(xe,{children:[e.jsx(me,{children:a("editAccountContext.title")}),e.jsx(he,{children:a("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("div",{className:"flex items-center justify-between",children:e.jsx(T,{className:"text-sm font-semibold",children:a("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":a("editAccountContext.syncMode"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":c==="isolated",tabIndex:c==="isolated"?0:-1,onClick:()=>p("isolated"),onKeyDown:g=>w(g,c,["isolated","shared"],p),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 ${c==="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:a("editAccountContext.isolatedOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":c==="shared",tabIndex:c==="shared"?0:-1,onClick:()=>p("shared"),onKeyDown:g=>w(g,c,["isolated","shared"],p),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 ${c==="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(B,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:a("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:a(c==="isolated"?"editAccountContext.isolatedModeHint":"editAccountContext.sharedModeHint")})]}),c==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"context-group",children:a("editAccountContext.historySyncGroup")}),e.jsx(X,{id:"context-group",value:n,onChange:g=>h(g.target.value),placeholder:a("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a("editAccountContext.groupHint",{max:oe})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:a("editAccountContext.invalidGroup")})]}),c==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(T,{className:"text-sm font-semibold",children:a("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":a("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(B,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:a("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:a("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:a(m==="standard"?"editAccountContext.standardHint":"editAccountContext.deeperHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a("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:a("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:a("continuityOverview.plainLaneDescription",{lane:L||"plain ccs",name:s.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(D,{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(D,{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:_}),e.jsx(D,{value:_,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:S}),e.jsx(D,{value:S,size:"icon"})]})]})]})}),e.jsx("div",{className:`rounded-[14px] border p-4 text-xs shadow-sm transition-colors ${c==="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:[c==="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:[c==="isolated"?e.jsx("p",{className:"text-foreground font-medium selection:bg-blue-200",children:a("editAccountContext.isolatedImplication")}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:a("editAccountContext.sameGroupRule",{group:x})})," ",d>0?a("editAccountContext.sameGroupPeerCount",{count:d}):a("editAccountContext.noSameGroupPeer")]}),m==="deeper"&&e.jsx("p",{children:f>0?a("editAccountContext.deeperReady",{count:f}):e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:a("editAccountContext.deeperNeedsPeers")})})]}),e.jsx("p",{className:`pt-1.5 text-[11px] ${c==="isolated"?"text-blue-700/70 dark:text-blue-300/60":"text-muted-foreground/70"}`,children:a("editAccountContext.resumeOriginalWarning")})]})]})})]}),e.jsxs(Se,{children:[e.jsx(b,{variant:"outline",onClick:u,disabled:i.isPending,children:a("editAccountContext.cancel")}),e.jsx(b,{onClick:A,disabled:!o||i.isPending,children:i.isPending?a("editAccountContext.saving"):a("editAccountContext.save")})]})]})})}function ce({data:s,defaultAccount:r,groupSummaries:t,plainCcsLane:u}){const{t:a}=z(),i=Je(),c=tt(),p=et(),n=be(),[h,m]=C.useState(null),[y,x]=C.useState(null),l=[{accessorKey:"name",header:a("accountsTable.name"),size:200,cell:({row:o})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:o.original.name}),o.original.name===r&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:a("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:a("accountsTable.type"),size:100,cell:({row:o})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:o.original.type||"oauth"})},{accessorKey:"created",header:a("accountsTable.created"),size:150,cell:({row:o})=>{const d=new Date(o.original.created);return e.jsx("span",{className:"text-muted-foreground",children:d.toLocaleDateString()})}},{accessorKey:"last_used",header:a("accountsTable.lastUsed"),size:150,cell:({row:o})=>{if(!o.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const d=new Date(o.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:d.toLocaleDateString()})}},{id:"context",header:a("accountsTable.historySync"),size:170,cell:({row:o})=>{if(o.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((o.original.context_mode||"isolated")==="shared"){const f=o.original.context_group||"default",v=o.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(P,{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:a(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:o.original.sameGroupPeerCount>0?a("accountsTable.sameGroupPeerCount",{count:o.original.sameGroupPeerCount}):a("accountsTable.noSameGroupPeer")})]})}return o.original.context_inferred?e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(P,{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:a("accountsTable.badges.legacy")}),e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:a("accountsTable.legacyReview")})]}):e.jsx("div",{className:"flex flex-col items-start gap-1.5",children:e.jsx(P,{variant:"secondary",className:"font-mono text-[10px] uppercase px-1.5 py-0 text-muted-foreground bg-muted/60 border-transparent shadow-none",children:a("accountsTable.badges.isolated")})})}},{id:"actions",header:a("accountsTable.actions"),size:220,cell:({row:o})=>{const d=o.original.name===r,f=i.isPending||c.isPending||n.isPending,v=o.original.type==="cliproxy",j=o.original.context_inferred||o.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(o.original),title:a("accountsTable.syncTitle"),children:[e.jsx(Be,{className:"w-3.5 h-3.5 mr-1"}),a("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:o.original.name,context_mode:o.original.context_mode==="shared"?"shared":"isolated",context_group:o.original.context_mode==="shared"?o.original.context_group||"default":void 0,continuity_mode:o.original.context_mode==="shared"?o.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:a("accountsTable.confirmLegacyTitle"),children:[e.jsx(Ee,{className:"w-3 h-3 mr-1"}),a("accountsTable.confirm")]}),e.jsxs(b,{variant:d?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:d||f,onClick:()=>i.mutate(o.original.name),children:[e.jsx(Y,{className:`w-3 h-3 mr-1 ${d?"opacity-50":""}`}),a(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(o.original.name),title:a(d?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(Ue,{className:"w-4 h-4"})})]})}}],N=ke({data:s,columns:l,getCoreRowModel:we()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:a("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(o=>e.jsx(te,{children:o.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)})},o.id))}),e.jsx(_e,{children:N.getRowModel().rows.map(o=>e.jsx(te,{children:o.getVisibleCells().map(d=>e.jsx(Te,{children:ee(d.column.columnDef.cell,d.getContext())},d.id))},o.id))})]})}),r&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>p.mutate(),disabled:p.isPending,children:[e.jsx(Ze,{className:"w-4 h-4 mr-2"}),a("accountsTable.resetToDefault")]})})]}),y&&e.jsx(nt,{account:y,groupSummaries:t,plainCcsLane:u,onClose:()=>x(null)}),e.jsx(ze,{open:!!h,onOpenChange:o=>!o&&m(null),children:e.jsxs($e,{children:[e.jsxs(Fe,{children:[e.jsx(Le,{children:a("accountsTable.deleteDialogTitle")}),e.jsx(Ke,{children:a("accountsTable.deleteDialogDesc",{name:h??""})})]}),e.jsxs(He,{children:[e.jsx(Ie,{children:a("accountsTable.cancel")}),e.jsx(qe,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{h&&(c.mutate(h),m(null))},children:a("accountsTable.delete")})]})]})})]})}const V=({titleKey:s,descKey:r})=>{const{t}=z();return e.jsxs(Ge,{children:[e.jsx(Me,{asChild:!0,children:e.jsx(b,{variant:"ghost",size:"icon","aria-label":t(s),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(Re,{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(s)}),e.jsx("p",{className:"mt-1.5 text-muted-foreground leading-relaxed",children:t(r)})]})]})};function ie({totalAccounts:s,primaryAccountName:r,isolatedCount:t,sharedStandardCount:u,deeperSharedCount:a,sharedAloneCount:i,sharedPeerAccountCount:c,deeperReadyAccountCount:p,sharedPeerGroups:n,deeperReadyGroups:h,legacyTargetCount:m,cliproxyCount:y,plainCcsLane:x}){const{t:l}=z(),N=x?x.kind==="native"?l("continuityOverview.lane.native"):x.kind==="account-default"?l("continuityOverview.lane.accountDefault",{name:x.account_name||""}):x.kind==="account-inherited"?l("continuityOverview.lane.accountInherited",{name:x.account_name||""}):x.kind==="profile-default"?l("continuityOverview.lane.profileDefault",{name:x.profile_name||"default"}):x.label:"",o=s<2?"single":n.length===0?t===s?"isolated":"shared-alone":h.length===0?"shared-standard":t>0||i>0||p<c||h.length<n.length?"partial":"ready",d=h[0]||n[0]||"default",f=h.length>0&&(t>0||u>0||n.length>h.length),j={ready:e.jsx(Qe,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}),"shared-standard":e.jsx(B,{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"})}[o],S=!!r&&x?.account_name===r,_=s>0&&!!x&&(!r||!S),w=s>1&&o!=="ready";return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(M,{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:l(`continuityReadiness.messages.${o}.title`,{group:d})}),e.jsx(P,{variant:o==="ready"?"default":"secondary",className:"rounded-full px-2.5 py-0.5 font-medium shadow-sm",children:l(`continuityReadiness.state.${o}`)})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg leading-relaxed",children:l(`continuityReadiness.messages.${o}.description`,{group:d,count:i})})]})]})}),e.jsxs("div",{className:"mt-auto pt-4 flex flex-wrap items-center gap-2",children:[y>0&&e.jsx(P,{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:l("historySyncLearningMap.cliproxyManaged",{count:y})}),m>0&&e.jsx(P,{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:l("historySyncLearningMap.legacyConfirmation",{count:m})}),n.length>0&&h.length===0&&e.jsx(P,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:l("continuityOverview.recommendBadge",{group:d})}),f&&e.jsx(P,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:l("continuityOverview.partialBadge",{group:d})})]})]})}),(_||w)&&e.jsx(M,{className:"border-dashed",children:e.jsxs(R,{className:"p-5 space-y-4",children:[_&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:l("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l("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(D,{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(D,{value:"ccs auth backup default",size:"icon"})]}),r?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 ${r}`}),e.jsx(D,{value:`ccs auth default ${r}`,size:"icon"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:l("continuityOverview.setDefaultHint")})]})]}),w&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:l("continuityReadiness.stepsTitle")}),e.jsxs("ol",{className:"space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:l("continuityReadiness.steps.syncBoth")}),e.jsx("li",{children:l("continuityReadiness.steps.sameGroup",{group:d})}),e.jsx("li",{children:l("continuityReadiness.steps.enableDeeper")}),e.jsx("li",{children:l("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:l("historySyncLearningMap.isolated")}),e.jsx(V,{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(E,{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(B,{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:l("historySyncLearningMap.shared")}),e.jsx(V,{titleKey:"accountsPage.sharedStandard",descKey:"accountsPage.sharedStandardDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-emerald-900 dark:text-emerald-200",children:u})]}),e.jsx(E,{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:l("historySyncLearningMap.deeper")}),e.jsx(V,{titleKey:"accountsPage.sharedDeeper",descKey:"accountsPage.sharedDeeperDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-indigo-900 dark:text-indigo-200",children:a})]})]})]})}const le=64;function rt({open:s,onClose:r}){const{t}=z(),[u,a]=C.useState(""),[i,c]=C.useState(!1),[p,n]=C.useState(""),[h,m]=C.useState(!1),[y,x]=C.useState(!1),l=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(u),N=p.trim().toLowerCase().replace(/\s+/g,"-"),o=N.length===0||N.length<=le&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(N),d=u&&l?[`ccs auth create ${u}`,i?N.length>0?`--context-group ${N}`:"--share-context":"",i&&h?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),f=async()=>{!l||i&&!o||(await navigator.clipboard.writeText(d),x(!0),setTimeout(()=>x(!1),2e3))},v=()=>{a(""),c(!1),n(""),m(!1),x(!1),r()};return e.jsx(de,{open:s,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(T,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(X,{id:"profile-name",value:u,onChange:j=>a(j.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),u&&!l&&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:i,onCheckedChange:j=>c(j===!0)}),e.jsx(T,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),i&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(T,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(X,{id:"context-group",value:p,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:h,onCheckedChange:j=>m(j===!0)}),e.jsx(T,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),p.trim().length>0&&!o&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:le})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{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(Ve,{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:!l||i&&!o,children:y?e.jsx(Y,{className:"w-4 h-4 text-green-500"}):e.jsx(ae,{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:!l||i&&!o,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(ae,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function bt(){const{t:s}=z(),r=ve(),{data:t,isLoading:u}=Ye(),a=at(),[i,c]=C.useState(!1),p=t?.accounts||[],n=t?.cliproxyCount||0,h=t?.legacyContextCount||0,m=t?.legacyContinuityCount||0,y=t?.sharedCount||0,x=t?.sharedStandardCount||0,l=t?.deeperSharedCount||0,N=t?.isolatedCount||0,o=t?.sharedAloneCount||0,d=t?.sharedPeerAccountCount||0,f=t?.deeperReadyAccountCount||0,v=t?.sharedPeerGroups||[],j=t?.deeperReadyGroups||[],S=t?.sharedGroups||[],_=t?.groupSummaries||[],w=t?.plainCcsLane||null,L=p.filter(H=>H.context_inferred||H.continuity_inferred),A=L.length,U=A>0,g=()=>r("/cliproxy?provider=claude"),K=()=>r("/cliproxy?provider=claude&action=auth"),G=()=>a.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(Xe,{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(Oe,{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(b,{size:"sm",className:"w-full justify-start",onClick:()=>c(!0),children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),s("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"}),s("accountsPage.authClaudeInPool")]}),e.jsxs(b,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:g,children:[s("accountsPage.openClaudePoolSettings"),e.jsx(E,{className:"w-4 h-4 ml-auto"})]})]}),U?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(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:[h>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContextPending",{count:h})}),m>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContinuityPending",{count:m})})]})]}),e.jsx(b,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:G,disabled:a.isPending||A===0,children:a.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:A})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:s("accountsPage.noLegacyFollowup")}),e.jsxs(M,{children:[e.jsxs(I,{className:"pb-2",children:[e.jsx(q,{className:"text-sm",children:s("accountsPage.quickCommands")}),e.jsx(Z,{children:s("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(D,{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(D,{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(P,{variant:"outline",children:s("accountsPage.workspaceBadge")}),e.jsx(P,{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(ie,{totalAccounts:p.length,primaryAccountName:p.length===1?p[0]?.name:null,isolatedCount:N,sharedStandardCount:x,deeperSharedCount:l,sharedAloneCount:o,sharedPeerAccountCount:d,deeperReadyAccountCount:f,sharedGroups:S,sharedPeerGroups:v,deeperReadyGroups:j,legacyTargetCount:A,cliproxyCount:n,plainCcsLane:w}),e.jsxs(M,{className:"flex flex-col",children:[e.jsxs(I,{className:"pb-3",children:[e.jsx(q,{className:"text-lg",children:s("accountsPage.accountMatrix")}),e.jsx(Z,{children:s("accountsPage.sharedTotalDesc",{count:y})})]}),e.jsx(R,{children:u?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ce,{data:p,defaultAccount:t?.default??null,groupSummaries:_,plainCcsLane:w})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(M,{children:[e.jsxs(I,{children:[e.jsx(q,{className:"text-lg",children:s("accountsPage.title")}),e.jsxs(Z,{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(R,{className:"space-y-2",children:[e.jsxs(b,{className:"w-full",onClick:()=>c(!0),children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(b,{variant:"outline",className:"w-full",onClick:g,children:[s("accountsPage.openCliProxyClaudePool"),e.jsx(E,{className:"w-4 h-4 ml-2"})]}),e.jsxs(b,{variant:"outline",className:"w-full",onClick:K,children:[s("accountsPage.authClaudeInPool"),e.jsx(ne,{className:"w-4 h-4 ml-2"})]}),e.jsx(b,{variant:"outline",className:"w-full",onClick:G,disabled:a.isPending||A===0,children:a.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:A})})]})]}),e.jsx(ie,{totalAccounts:p.length,primaryAccountName:p.length===1?p[0]?.name:null,isolatedCount:N,sharedStandardCount:x,deeperSharedCount:l,sharedAloneCount:o,sharedPeerAccountCount:d,deeperReadyAccountCount:f,sharedGroups:S,sharedPeerGroups:v,deeperReadyGroups:j,legacyTargetCount:A,cliproxyCount:n,plainCcsLane:w}),e.jsxs(M,{children:[e.jsx(I,{className:"pb-3",children:e.jsx(q,{className:"text-base",children:s("accountsPage.accountMatrix")})}),e.jsx(R,{children:u?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ce,{data:p,defaultAccount:t?.default??null,groupSummaries:_,plainCcsLane:w})})]})]}),e.jsx(rt,{open:i,onClose:()=>c(!1)})]})}export{bt as AccountsPage};
1
+ import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as C,h as ve}from"./react-vendor-CNOkPC89.js";import{u as Ce,a as $,b as F,e as ke,f as ee,g as we}from"./tanstack-DWm6aJ-G.js";import{T as Pe,a as Ae,b as te,c as De,d as _e,e as Te}from"./table-BKS_LAxP.js";import{Y as O,a as z,af as de,ag as ue,ah as xe,ai as me,aj as he,L as T,I as X,x as D,aB as Se,d as b,B as P,C as M,b as R,e as Ge,f as Me,g as Re,n as Oe,j as I,k as q,_ as Z}from"./index-Bmd4gqsh.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-BSHMTH4-.js";import{t as k}from"./notifications-B2HqRBj7.js";import{aV as W,aW as B,aX as pe,aB as ge,V as fe,aY as Be,aZ as Ee,l as Y,ap as Ue,N as Ze,aw as E,T as J,w as Qe,Y as Ve,n as ae,U as Xe,a6 as se,Z as ne}from"./icons-BxSzn11s.js";import{C as re}from"./checkbox-DXj-4eLk.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Q(s){return Array.from(s).sort((r,t)=>r.localeCompare(t))}function We(s){const r=new Map;for(const n of s){if(n.context_mode!=="shared")continue;const h=n.context_group||"default",m=r.get(h)??{group:h,sharedCount:0,deeperCount:0,accountNames:[]};m.sharedCount+=1,m.accountNames.push(n.name),n.continuity_mode==="deeper"&&(m.deeperCount+=1),r.set(h,m)}const t=Array.from(r.values()).sort((n,h)=>n.group.localeCompare(h.group)),u=s.map(n=>{if(n.context_mode!=="shared")return{...n,sameGroupPeerCount:0,sameGroupDeeperPeerCount:0};const h=n.context_group||"default",m=r.get(h),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}}),a=u.filter(n=>n.context_mode==="shared").length,i=u.filter(n=>n.context_mode==="shared"&&n.continuity_mode==="deeper").length,c=u.filter(n=>n.context_inferred).length,p=u.filter(n=>n.context_mode==="shared"&&n.continuity_mode!=="deeper"&&n.continuity_inferred).length;return{accounts:u,sharedCount:a,sharedStandardCount:Math.max(a-i,0),deeperSharedCount:i,isolatedCount:u.length-a,legacyContextCount:c,legacyContinuityCount:p,sharedAloneCount:u.filter(n=>n.context_mode==="shared"&&n.sameGroupPeerCount===0).length,sharedPeerAccountCount:u.filter(n=>n.sameGroupPeerCount>0).length,deeperReadyAccountCount:u.filter(n=>n.continuity_mode==="deeper"&&n.sameGroupDeeperPeerCount>0).length,sharedPeerGroups:Q(t.filter(n=>n.sharedCount>=2).map(n=>n.group)),deeperReadyGroups:Q(t.filter(n=>n.deeperCount>=2).map(n=>n.group)),sharedGroups:Q(t.map(n=>n.group)),groupSummaries:t}}function Ye(){return Ce({queryKey:["accounts"],queryFn:()=>O.accounts.list(),select:s=>{const r=s.accounts.filter(i=>i.type!=="cliproxy"),t=We(r),u=s.accounts.length-r.length,a=t.accounts.some(i=>i.name===s.default)?s.default:null;return{accounts:t.accounts,default:a,cliproxyCount:u,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:s.plain_ccs_lane??null}}})}function Je(){const s=$();return F({mutationFn:r=>O.accounts.setDefault(r),onSuccess:(r,t)=>{s.invalidateQueries({queryKey:["accounts"]}),k.success(`Default account set to "${t}"`)},onError:r=>{k.error(r.message)}})}function et(){const s=$();return F({mutationFn:()=>O.accounts.resetDefault(),onSuccess:()=>{s.invalidateQueries({queryKey:["accounts"]}),k.success("Default account reset to CCS")},onError:r=>{k.error(r.message)}})}function tt(){const s=$();return F({mutationFn:r=>O.accounts.delete(r),onSuccess:(r,t)=>{s.invalidateQueries({queryKey:["accounts"]}),k.success(`Account "${t}" deleted`)},onError:r=>{k.error(r.message)}})}function be(){const s=$();return F({mutationFn:({name:r,context_mode:t,context_group:u,continuity_mode:a})=>O.accounts.updateContext(r,{context_mode:t,context_group:u,continuity_mode:a}),onSuccess:(r,t)=>{s.invalidateQueries({queryKey:["accounts"]});const u=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";k.success(`Updated "${t.name}" context to ${u}`)},onError:r=>{k.error(r.message)}})}function at(){const s=$();return F({mutationFn:async r=>{const t=r.filter(i=>i.context_inferred||i.continuity_inferred),a=(await Promise.allSettled(t.map(i=>{const c=i.context_mode==="shared";return O.accounts.updateContext(i.name,{context_mode:c?"shared":"isolated",context_group:c?i.context_group||"default":void 0,continuity_mode:c?i.continuity_mode==="deeper"?"deeper":"standard":void 0})}))).filter(i=>i.status==="rejected").length;return{updatedCount:t.length-a,failedCount:a}},onSuccess:({updatedCount:r,failedCount:t})=>{if(s.invalidateQueries({queryKey:["accounts"]}),t>0&&r>0){k.error(`Confirmed ${r} legacy account${r>1?"s":""}, but ${t} update${t>1?"s":""} failed. Refreshed account state.`);return}if(t>0){k.error(`Failed to confirm ${t} legacy account${t>1?"s":""}. Refreshed account state.`);return}if(r>0){k.success(`Confirmed explicit sync mode for ${r} legacy account${r>1?"s":""}`);return}k.info("No legacy accounts need confirmation")},onError:r=>{s.invalidateQueries({queryKey:["accounts"]}),k.error(r.message)}})}const oe=64,st=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function nt({account:s,groupSummaries:r,plainCcsLane:t,onClose:u}){const{t:a}=z(),i=be(),[c,p]=C.useState(s.context_mode==="shared"?"shared":"isolated"),[n,h]=C.useState(s.context_group||"default"),[m,y]=C.useState(s.continuity_mode==="deeper"?"deeper":"standard"),x=C.useMemo(()=>n.trim().toLowerCase().replace(/\s+/g,"-"),[n]),l=C.useMemo(()=>r.find(g=>g.group===x),[r,x]),N=x.length>0&&x.length<=oe&&st.test(x),o=c==="isolated"||N,d=c==="shared"?Math.max((l?.sharedCount??0)-(s.context_mode==="shared"&&s.context_group===x?1:0),0):0,f=c==="shared"?Math.max((l?.deeperCount??0)-(s.continuity_mode==="deeper"&&s.context_group===x?1:0),0):0,v=t?.account_name===s.name,j=!!t&&!v,S=`ccs auth default ${s.name}`,_=`ccs auth backup ${s.name}`,w=(g,K,G,H)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(g.key))return;g.preventDefault();const je=G.indexOf(K),ye=g.key==="ArrowLeft"||g.key==="ArrowUp"?-1:1,Ne=(je+ye+G.length)%G.length;H(G[Ne])},L=t?t.kind==="native"?a("continuityOverview.lane.native"):t.kind==="account-default"?a("continuityOverview.lane.accountDefault",{name:t.account_name||""}):t.kind==="account-inherited"?a("continuityOverview.lane.accountInherited",{name:t.account_name||""}):t.kind==="profile-default"?a("continuityOverview.lane.profileDefault",{name:t.profile_name||"default"}):t.label:"",A=()=>{o&&i.mutate({name:s.name,context_mode:c,context_group:c==="shared"?x:void 0,continuity_mode:c==="shared"?m:void 0},{onSuccess:()=>{u()}})},U=g=>{g||u()};return e.jsx(de,{open:!0,onOpenChange:U,children:e.jsxs(ue,{className:"sm:max-w-md",children:[e.jsxs(xe,{children:[e.jsx(me,{children:a("editAccountContext.title")}),e.jsx(he,{children:a("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("div",{className:"flex items-center justify-between",children:e.jsx(T,{className:"text-sm font-semibold",children:a("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":a("editAccountContext.syncMode"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":c==="isolated",tabIndex:c==="isolated"?0:-1,onClick:()=>p("isolated"),onKeyDown:g=>w(g,c,["isolated","shared"],p),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 ${c==="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:a("editAccountContext.isolatedOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":c==="shared",tabIndex:c==="shared"?0:-1,onClick:()=>p("shared"),onKeyDown:g=>w(g,c,["isolated","shared"],p),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 ${c==="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(B,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:a("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:a(c==="isolated"?"editAccountContext.isolatedModeHint":"editAccountContext.sharedModeHint")})]}),c==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{htmlFor:"context-group",children:a("editAccountContext.historySyncGroup")}),e.jsx(X,{id:"context-group",value:n,onChange:g=>h(g.target.value),placeholder:a("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a("editAccountContext.groupHint",{max:oe})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:a("editAccountContext.invalidGroup")})]}),c==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(T,{className:"text-sm font-semibold",children:a("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":a("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(B,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:a("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:a("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:a(m==="standard"?"editAccountContext.standardHint":"editAccountContext.deeperHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a("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:a("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:a("continuityOverview.plainLaneDescription",{lane:L||"plain ccs",name:s.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(D,{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(D,{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:_}),e.jsx(D,{value:_,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:S}),e.jsx(D,{value:S,size:"icon"})]})]})]})}),e.jsx("div",{className:`rounded-[14px] border p-4 text-xs shadow-sm transition-colors ${c==="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:[c==="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:[c==="isolated"?e.jsx("p",{className:"text-foreground font-medium selection:bg-blue-200",children:a("editAccountContext.isolatedImplication")}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:a("editAccountContext.sameGroupRule",{group:x})})," ",d>0?a("editAccountContext.sameGroupPeerCount",{count:d}):a("editAccountContext.noSameGroupPeer")]}),m==="deeper"&&e.jsx("p",{children:f>0?a("editAccountContext.deeperReady",{count:f}):e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:a("editAccountContext.deeperNeedsPeers")})})]}),e.jsx("p",{className:`pt-1.5 text-[11px] ${c==="isolated"?"text-blue-700/70 dark:text-blue-300/60":"text-muted-foreground/70"}`,children:a("editAccountContext.resumeOriginalWarning")})]})]})})]}),e.jsxs(Se,{children:[e.jsx(b,{variant:"outline",onClick:u,disabled:i.isPending,children:a("editAccountContext.cancel")}),e.jsx(b,{onClick:A,disabled:!o||i.isPending,children:i.isPending?a("editAccountContext.saving"):a("editAccountContext.save")})]})]})})}function ce({data:s,defaultAccount:r,groupSummaries:t,plainCcsLane:u}){const{t:a}=z(),i=Je(),c=tt(),p=et(),n=be(),[h,m]=C.useState(null),[y,x]=C.useState(null),l=[{accessorKey:"name",header:a("accountsTable.name"),size:200,cell:({row:o})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:o.original.name}),o.original.name===r&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:a("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:a("accountsTable.type"),size:100,cell:({row:o})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:o.original.type||"oauth"})},{accessorKey:"created",header:a("accountsTable.created"),size:150,cell:({row:o})=>{const d=new Date(o.original.created);return e.jsx("span",{className:"text-muted-foreground",children:d.toLocaleDateString()})}},{accessorKey:"last_used",header:a("accountsTable.lastUsed"),size:150,cell:({row:o})=>{if(!o.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const d=new Date(o.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:d.toLocaleDateString()})}},{id:"context",header:a("accountsTable.historySync"),size:170,cell:({row:o})=>{if(o.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((o.original.context_mode||"isolated")==="shared"){const f=o.original.context_group||"default",v=o.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(P,{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:a(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:o.original.sameGroupPeerCount>0?a("accountsTable.sameGroupPeerCount",{count:o.original.sameGroupPeerCount}):a("accountsTable.noSameGroupPeer")})]})}return o.original.context_inferred?e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(P,{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:a("accountsTable.badges.legacy")}),e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:a("accountsTable.legacyReview")})]}):e.jsx("div",{className:"flex flex-col items-start gap-1.5",children:e.jsx(P,{variant:"secondary",className:"font-mono text-[10px] uppercase px-1.5 py-0 text-muted-foreground bg-muted/60 border-transparent shadow-none",children:a("accountsTable.badges.isolated")})})}},{id:"actions",header:a("accountsTable.actions"),size:220,cell:({row:o})=>{const d=o.original.name===r,f=i.isPending||c.isPending||n.isPending,v=o.original.type==="cliproxy",j=o.original.context_inferred||o.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(o.original),title:a("accountsTable.syncTitle"),children:[e.jsx(Be,{className:"w-3.5 h-3.5 mr-1"}),a("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:o.original.name,context_mode:o.original.context_mode==="shared"?"shared":"isolated",context_group:o.original.context_mode==="shared"?o.original.context_group||"default":void 0,continuity_mode:o.original.context_mode==="shared"?o.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:a("accountsTable.confirmLegacyTitle"),children:[e.jsx(Ee,{className:"w-3 h-3 mr-1"}),a("accountsTable.confirm")]}),e.jsxs(b,{variant:d?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:d||f,onClick:()=>i.mutate(o.original.name),children:[e.jsx(Y,{className:`w-3 h-3 mr-1 ${d?"opacity-50":""}`}),a(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(o.original.name),title:a(d?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(Ue,{className:"w-4 h-4"})})]})}}],N=ke({data:s,columns:l,getCoreRowModel:we()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:a("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(o=>e.jsx(te,{children:o.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)})},o.id))}),e.jsx(_e,{children:N.getRowModel().rows.map(o=>e.jsx(te,{children:o.getVisibleCells().map(d=>e.jsx(Te,{children:ee(d.column.columnDef.cell,d.getContext())},d.id))},o.id))})]})}),r&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>p.mutate(),disabled:p.isPending,children:[e.jsx(Ze,{className:"w-4 h-4 mr-2"}),a("accountsTable.resetToDefault")]})})]}),y&&e.jsx(nt,{account:y,groupSummaries:t,plainCcsLane:u,onClose:()=>x(null)}),e.jsx(ze,{open:!!h,onOpenChange:o=>!o&&m(null),children:e.jsxs($e,{children:[e.jsxs(Fe,{children:[e.jsx(Le,{children:a("accountsTable.deleteDialogTitle")}),e.jsx(Ke,{children:a("accountsTable.deleteDialogDesc",{name:h??""})})]}),e.jsxs(He,{children:[e.jsx(Ie,{children:a("accountsTable.cancel")}),e.jsx(qe,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{h&&(c.mutate(h),m(null))},children:a("accountsTable.delete")})]})]})})]})}const V=({titleKey:s,descKey:r})=>{const{t}=z();return e.jsxs(Ge,{children:[e.jsx(Me,{asChild:!0,children:e.jsx(b,{variant:"ghost",size:"icon","aria-label":t(s),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(Re,{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(s)}),e.jsx("p",{className:"mt-1.5 text-muted-foreground leading-relaxed",children:t(r)})]})]})};function ie({totalAccounts:s,primaryAccountName:r,isolatedCount:t,sharedStandardCount:u,deeperSharedCount:a,sharedAloneCount:i,sharedPeerAccountCount:c,deeperReadyAccountCount:p,sharedPeerGroups:n,deeperReadyGroups:h,legacyTargetCount:m,cliproxyCount:y,plainCcsLane:x}){const{t:l}=z(),N=x?x.kind==="native"?l("continuityOverview.lane.native"):x.kind==="account-default"?l("continuityOverview.lane.accountDefault",{name:x.account_name||""}):x.kind==="account-inherited"?l("continuityOverview.lane.accountInherited",{name:x.account_name||""}):x.kind==="profile-default"?l("continuityOverview.lane.profileDefault",{name:x.profile_name||"default"}):x.label:"",o=s<2?"single":n.length===0?t===s?"isolated":"shared-alone":h.length===0?"shared-standard":t>0||i>0||p<c||h.length<n.length?"partial":"ready",d=h[0]||n[0]||"default",f=h.length>0&&(t>0||u>0||n.length>h.length),j={ready:e.jsx(Qe,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}),"shared-standard":e.jsx(B,{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"})}[o],S=!!r&&x?.account_name===r,_=s>0&&!!x&&(!r||!S),w=s>1&&o!=="ready";return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(M,{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:l(`continuityReadiness.messages.${o}.title`,{group:d})}),e.jsx(P,{variant:o==="ready"?"default":"secondary",className:"rounded-full px-2.5 py-0.5 font-medium shadow-sm",children:l(`continuityReadiness.state.${o}`)})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg leading-relaxed",children:l(`continuityReadiness.messages.${o}.description`,{group:d,count:i})})]})]})}),e.jsxs("div",{className:"mt-auto pt-4 flex flex-wrap items-center gap-2",children:[y>0&&e.jsx(P,{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:l("historySyncLearningMap.cliproxyManaged",{count:y})}),m>0&&e.jsx(P,{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:l("historySyncLearningMap.legacyConfirmation",{count:m})}),n.length>0&&h.length===0&&e.jsx(P,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:l("continuityOverview.recommendBadge",{group:d})}),f&&e.jsx(P,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:l("continuityOverview.partialBadge",{group:d})})]})]})}),(_||w)&&e.jsx(M,{className:"border-dashed",children:e.jsxs(R,{className:"p-5 space-y-4",children:[_&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:l("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l("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(D,{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(D,{value:"ccs auth backup default",size:"icon"})]}),r?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 ${r}`}),e.jsx(D,{value:`ccs auth default ${r}`,size:"icon"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:l("continuityOverview.setDefaultHint")})]})]}),w&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:l("continuityReadiness.stepsTitle")}),e.jsxs("ol",{className:"space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:l("continuityReadiness.steps.syncBoth")}),e.jsx("li",{children:l("continuityReadiness.steps.sameGroup",{group:d})}),e.jsx("li",{children:l("continuityReadiness.steps.enableDeeper")}),e.jsx("li",{children:l("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:l("historySyncLearningMap.isolated")}),e.jsx(V,{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(E,{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(B,{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:l("historySyncLearningMap.shared")}),e.jsx(V,{titleKey:"accountsPage.sharedStandard",descKey:"accountsPage.sharedStandardDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-emerald-900 dark:text-emerald-200",children:u})]}),e.jsx(E,{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:l("historySyncLearningMap.deeper")}),e.jsx(V,{titleKey:"accountsPage.sharedDeeper",descKey:"accountsPage.sharedDeeperDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-indigo-900 dark:text-indigo-200",children:a})]})]})]})}const le=64;function rt({open:s,onClose:r}){const{t}=z(),[u,a]=C.useState(""),[i,c]=C.useState(!1),[p,n]=C.useState(""),[h,m]=C.useState(!1),[y,x]=C.useState(!1),l=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(u),N=p.trim().toLowerCase().replace(/\s+/g,"-"),o=N.length===0||N.length<=le&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(N),d=u&&l?[`ccs auth create ${u}`,i?N.length>0?`--context-group ${N}`:"--share-context":"",i&&h?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),f=async()=>{!l||i&&!o||(await navigator.clipboard.writeText(d),x(!0),setTimeout(()=>x(!1),2e3))},v=()=>{a(""),c(!1),n(""),m(!1),x(!1),r()};return e.jsx(de,{open:s,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(T,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(X,{id:"profile-name",value:u,onChange:j=>a(j.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),u&&!l&&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:i,onCheckedChange:j=>c(j===!0)}),e.jsx(T,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),i&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(T,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(X,{id:"context-group",value:p,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:h,onCheckedChange:j=>m(j===!0)}),e.jsx(T,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),p.trim().length>0&&!o&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:le})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{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(Ve,{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:!l||i&&!o,children:y?e.jsx(Y,{className:"w-4 h-4 text-green-500"}):e.jsx(ae,{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:!l||i&&!o,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(ae,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function bt(){const{t:s}=z(),r=ve(),{data:t,isLoading:u}=Ye(),a=at(),[i,c]=C.useState(!1),p=t?.accounts||[],n=t?.cliproxyCount||0,h=t?.legacyContextCount||0,m=t?.legacyContinuityCount||0,y=t?.sharedCount||0,x=t?.sharedStandardCount||0,l=t?.deeperSharedCount||0,N=t?.isolatedCount||0,o=t?.sharedAloneCount||0,d=t?.sharedPeerAccountCount||0,f=t?.deeperReadyAccountCount||0,v=t?.sharedPeerGroups||[],j=t?.deeperReadyGroups||[],S=t?.sharedGroups||[],_=t?.groupSummaries||[],w=t?.plainCcsLane||null,L=p.filter(H=>H.context_inferred||H.continuity_inferred),A=L.length,U=A>0,g=()=>r("/cliproxy?provider=claude"),K=()=>r("/cliproxy?provider=claude&action=auth"),G=()=>a.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(Xe,{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(Oe,{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(b,{size:"sm",className:"w-full justify-start",onClick:()=>c(!0),children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),s("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"}),s("accountsPage.authClaudeInPool")]}),e.jsxs(b,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:g,children:[s("accountsPage.openClaudePoolSettings"),e.jsx(E,{className:"w-4 h-4 ml-auto"})]})]}),U?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(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:[h>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContextPending",{count:h})}),m>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContinuityPending",{count:m})})]})]}),e.jsx(b,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:G,disabled:a.isPending||A===0,children:a.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:A})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:s("accountsPage.noLegacyFollowup")}),e.jsxs(M,{children:[e.jsxs(I,{className:"pb-2",children:[e.jsx(q,{className:"text-sm",children:s("accountsPage.quickCommands")}),e.jsx(Z,{children:s("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(D,{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(D,{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(P,{variant:"outline",children:s("accountsPage.workspaceBadge")}),e.jsx(P,{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(ie,{totalAccounts:p.length,primaryAccountName:p.length===1?p[0]?.name:null,isolatedCount:N,sharedStandardCount:x,deeperSharedCount:l,sharedAloneCount:o,sharedPeerAccountCount:d,deeperReadyAccountCount:f,sharedGroups:S,sharedPeerGroups:v,deeperReadyGroups:j,legacyTargetCount:A,cliproxyCount:n,plainCcsLane:w}),e.jsxs(M,{className:"flex flex-col",children:[e.jsxs(I,{className:"pb-3",children:[e.jsx(q,{className:"text-lg",children:s("accountsPage.accountMatrix")}),e.jsx(Z,{children:s("accountsPage.sharedTotalDesc",{count:y})})]}),e.jsx(R,{children:u?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ce,{data:p,defaultAccount:t?.default??null,groupSummaries:_,plainCcsLane:w})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(M,{children:[e.jsxs(I,{children:[e.jsx(q,{className:"text-lg",children:s("accountsPage.title")}),e.jsxs(Z,{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(R,{className:"space-y-2",children:[e.jsxs(b,{className:"w-full",onClick:()=>c(!0),children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(b,{variant:"outline",className:"w-full",onClick:g,children:[s("accountsPage.openCliProxyClaudePool"),e.jsx(E,{className:"w-4 h-4 ml-2"})]}),e.jsxs(b,{variant:"outline",className:"w-full",onClick:K,children:[s("accountsPage.authClaudeInPool"),e.jsx(ne,{className:"w-4 h-4 ml-2"})]}),e.jsx(b,{variant:"outline",className:"w-full",onClick:G,disabled:a.isPending||A===0,children:a.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:A})})]})]}),e.jsx(ie,{totalAccounts:p.length,primaryAccountName:p.length===1?p[0]?.name:null,isolatedCount:N,sharedStandardCount:x,deeperSharedCount:l,sharedAloneCount:o,sharedPeerAccountCount:d,deeperReadyAccountCount:f,sharedGroups:S,sharedPeerGroups:v,deeperReadyGroups:j,legacyTargetCount:A,cliproxyCount:n,plainCcsLane:w}),e.jsxs(M,{children:[e.jsx(I,{className:"pb-3",children:e.jsx(q,{className:"text-base",children:s("accountsPage.accountMatrix")})}),e.jsx(R,{children:u?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ce,{data:p,defaultAccount:t?.default??null,groupSummaries:_,plainCcsLane:w})})]})]}),e.jsx(rt,{open:i,onClose:()=>c(!1)})]})}export{bt 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-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as o,bG as l}from"./index-wIy8qzU9.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 z({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,z 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-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as o,bG as l}from"./index-Bmd4gqsh.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 z({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,z as f,y as g};