@kaitranntt/ccs 7.52.2-dev.5 → 7.52.2-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/api/services/index.d.ts +3 -1
- package/dist/api/services/index.d.ts.map +1 -1
- package/dist/api/services/index.js +10 -1
- package/dist/api/services/index.js.map +1 -1
- package/dist/api/services/profile-lifecycle-service.d.ts +24 -0
- package/dist/api/services/profile-lifecycle-service.d.ts.map +1 -0
- package/dist/api/services/profile-lifecycle-service.js +364 -0
- package/dist/api/services/profile-lifecycle-service.js.map +1 -0
- package/dist/api/services/profile-lifecycle-validation.d.ts +11 -0
- package/dist/api/services/profile-lifecycle-validation.d.ts.map +1 -0
- package/dist/api/services/profile-lifecycle-validation.js +87 -0
- package/dist/api/services/profile-lifecycle-validation.js.map +1 -0
- package/dist/api/services/profile-types.d.ts +66 -0
- package/dist/api/services/profile-types.d.ts.map +1 -1
- package/dist/cliproxy/auth/gemini-token-refresh.d.ts.map +1 -1
- package/dist/cliproxy/auth/gemini-token-refresh.js +42 -14
- package/dist/cliproxy/auth/gemini-token-refresh.js.map +1 -1
- package/dist/cliproxy/quota-fetcher-codex.d.ts.map +1 -1
- package/dist/cliproxy/quota-fetcher-codex.js +199 -63
- package/dist/cliproxy/quota-fetcher-codex.js.map +1 -1
- package/dist/cliproxy/quota-fetcher.d.ts +12 -0
- package/dist/cliproxy/quota-fetcher.d.ts.map +1 -1
- package/dist/cliproxy/quota-fetcher.js +328 -260
- package/dist/cliproxy/quota-fetcher.js.map +1 -1
- package/dist/cliproxy/quota-types.d.ts +18 -4
- package/dist/cliproxy/quota-types.d.ts.map +1 -1
- package/dist/commands/api-command.d.ts.map +1 -1
- package/dist/commands/api-command.js +275 -1
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/help-command.d.ts.map +1 -1
- package/dist/commands/help-command.js +4 -0
- package/dist/commands/help-command.js.map +1 -1
- package/dist/ui/assets/accounts-C19R3bH_.js +1 -0
- package/dist/ui/assets/{alert-dialog-Cua4nIwu.js → alert-dialog-HJSnKjIs.js} +1 -1
- package/dist/ui/assets/api-DSqH5CNY.js +4 -0
- package/dist/ui/assets/auth-section-CYKSK386.js +1 -0
- package/dist/ui/assets/backups-section-DG3ZbzbF.js +1 -0
- package/dist/ui/assets/{checkbox-BHwnoAEc.js → checkbox-Du_1Cq1z.js} +1 -1
- package/dist/ui/assets/cliproxy-CrhOC0jn.js +3 -0
- package/dist/ui/assets/cliproxy-control-panel-DLzDKBdd.js +1 -0
- package/dist/ui/assets/{confirm-dialog-sXvRWo2S.js → confirm-dialog-D5ln-pf7.js} +1 -1
- package/dist/ui/assets/{copilot-CpoZ-JIF.js → copilot-Bhp7sQwN.js} +2 -2
- package/dist/ui/assets/{cursor-DPNnilw3.js → cursor-Dfn3jHV4.js} +1 -1
- package/dist/ui/assets/{droid-DK_cjIrQ.js → droid-Vjl6_n7D.js} +1 -1
- package/dist/ui/assets/globalenv-section-CcmKdM4g.js +1 -0
- package/dist/ui/assets/{health-Den6iwHL.js → health-3zy8jvwf.js} +1 -1
- package/dist/ui/assets/{icons-BYZM_9Gm.js → icons-D2eEmpHv.js} +1 -1
- package/dist/ui/assets/index-BusjPRWX.css +1 -0
- package/dist/ui/assets/index-CP_OIR4n.js +1 -0
- package/dist/ui/assets/index-DbxzdeHz.js +1 -0
- package/dist/ui/assets/index-f_yPeQQQ.js +1 -0
- package/dist/ui/assets/{index-CHfQZxYq.js → index-iOpyYqld.js} +1 -1
- package/dist/ui/assets/index-uTmtgDew.js +47 -0
- package/dist/ui/assets/proxy-status-widget-1lHBE3f2.js +1 -0
- package/dist/ui/assets/{separator-CMSZsZ-K.js → separator-CsVbirkY.js} +1 -1
- package/dist/ui/assets/shared-DGq6uQfx.js +8 -0
- package/dist/ui/assets/{switch-BAw-ZttB.js → switch-BR0F3O9R.js} +1 -1
- package/dist/ui/assets/{updates-BsJ2V6_I.js → updates-ZSQz4CLF.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts +12 -0
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.js +14 -0
- package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
- package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
- package/dist/web-server/routes/profile-routes.js +206 -9
- package/dist/web-server/routes/profile-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/accounts-BrujKA4_.js +0 -1
- package/dist/ui/assets/api-h_I7-lO7.js +0 -1
- package/dist/ui/assets/auth-section-DCxO2_eL.js +0 -1
- package/dist/ui/assets/backups-section-EE1TN60x.js +0 -1
- package/dist/ui/assets/cliproxy-Cccwn5Zy.js +0 -3
- package/dist/ui/assets/cliproxy-control-panel-CSWIAklH.js +0 -1
- package/dist/ui/assets/globalenv-section-hiOP8-EO.js +0 -1
- package/dist/ui/assets/index-7UOuuXPH.js +0 -1
- package/dist/ui/assets/index-BfTpnChw.js +0 -1
- package/dist/ui/assets/index-CWdqGG3Z.js +0 -1
- package/dist/ui/assets/index-DmXx1Pyv.js +0 -47
- package/dist/ui/assets/index-WBo504Wu.css +0 -1
- package/dist/ui/assets/proxy-status-widget-Cx62Adpq.js +0 -1
- package/dist/ui/assets/shared-Cjq_jPQd.js +0 -8
|
@@ -8,21 +8,35 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const express_1 = require("express");
|
|
10
10
|
const reserved_names_1 = require("../../config/reserved-names");
|
|
11
|
-
const
|
|
12
|
-
const profile_reader_1 = require("../../api/services/profile-reader");
|
|
11
|
+
const services_1 = require("../../api/services");
|
|
13
12
|
const droid_provider_1 = require("../../targets/droid-provider");
|
|
14
13
|
const route_helpers_1 = require("./route-helpers");
|
|
15
14
|
const router = (0, express_1.Router)();
|
|
16
15
|
function isDenylistError(message) {
|
|
17
16
|
return typeof message === 'string' && message.toLowerCase().includes('denylist');
|
|
18
17
|
}
|
|
18
|
+
function getUnknownKeys(payload, allowedKeys) {
|
|
19
|
+
const allowed = new Set(allowedKeys);
|
|
20
|
+
return Object.keys(payload).filter((key) => !allowed.has(key));
|
|
21
|
+
}
|
|
22
|
+
function validatePayloadShape(body, allowedKeys) {
|
|
23
|
+
if (!body || typeof body !== 'object' || Array.isArray(body)) {
|
|
24
|
+
return { ok: false, error: 'Request body must be a JSON object' };
|
|
25
|
+
}
|
|
26
|
+
const payload = body;
|
|
27
|
+
const unknownKeys = getUnknownKeys(payload, allowedKeys);
|
|
28
|
+
if (unknownKeys.length > 0) {
|
|
29
|
+
return { ok: false, error: `Unknown profile field(s): ${unknownKeys.join(', ')}` };
|
|
30
|
+
}
|
|
31
|
+
return { ok: true, payload };
|
|
32
|
+
}
|
|
19
33
|
// ==================== Profile CRUD ====================
|
|
20
34
|
/**
|
|
21
35
|
* GET /api/profiles - List all profiles
|
|
22
36
|
*/
|
|
23
37
|
router.get('/', (_req, res) => {
|
|
24
38
|
try {
|
|
25
|
-
const result = (0,
|
|
39
|
+
const result = (0, services_1.listApiProfiles)();
|
|
26
40
|
// Map isConfigured -> configured for UI compatibility
|
|
27
41
|
const profiles = result.profiles.map((p) => ({
|
|
28
42
|
name: p.name,
|
|
@@ -40,6 +54,22 @@ router.get('/', (_req, res) => {
|
|
|
40
54
|
* POST /api/profiles - Create new profile
|
|
41
55
|
*/
|
|
42
56
|
router.post('/', (req, res) => {
|
|
57
|
+
const shape = validatePayloadShape(req.body, [
|
|
58
|
+
'name',
|
|
59
|
+
'baseUrl',
|
|
60
|
+
'apiKey',
|
|
61
|
+
'model',
|
|
62
|
+
'opusModel',
|
|
63
|
+
'sonnetModel',
|
|
64
|
+
'haikuModel',
|
|
65
|
+
'target',
|
|
66
|
+
'droidProvider',
|
|
67
|
+
'provider',
|
|
68
|
+
]);
|
|
69
|
+
if (!shape.ok) {
|
|
70
|
+
res.status(400).json({ error: shape.error });
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
43
73
|
const { name, baseUrl, apiKey, model, opusModel, sonnetModel, haikuModel, target } = req.body;
|
|
44
74
|
const providerHint = req.body?.droidProvider ?? req.body?.provider;
|
|
45
75
|
const parsedProvider = (0, droid_provider_1.normalizeDroidProvider)(providerHint);
|
|
@@ -67,12 +97,12 @@ router.post('/', (req, res) => {
|
|
|
67
97
|
return;
|
|
68
98
|
}
|
|
69
99
|
// Check if profile already exists (uses unified config when available)
|
|
70
|
-
if ((0,
|
|
100
|
+
if ((0, services_1.apiProfileExists)(name)) {
|
|
71
101
|
res.status(409).json({ error: 'Profile already exists' });
|
|
72
102
|
return;
|
|
73
103
|
}
|
|
74
104
|
// Create profile using unified-config-aware service
|
|
75
|
-
const result = (0,
|
|
105
|
+
const result = (0, services_1.createApiProfile)(name, baseUrl, apiKey, {
|
|
76
106
|
default: model || '',
|
|
77
107
|
opus: opusModel || model || '',
|
|
78
108
|
sonnet: sonnetModel || model || '',
|
|
@@ -89,10 +119,177 @@ router.post('/', (req, res) => {
|
|
|
89
119
|
target: parsedTarget || 'claude',
|
|
90
120
|
});
|
|
91
121
|
});
|
|
122
|
+
/**
|
|
123
|
+
* GET /api/profiles/orphans - Discover orphan ~/.ccs/*.settings.json files
|
|
124
|
+
*/
|
|
125
|
+
router.get('/orphans', (_req, res) => {
|
|
126
|
+
try {
|
|
127
|
+
const result = (0, services_1.discoverApiProfileOrphans)();
|
|
128
|
+
res.json(result);
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
res.status(500).json({ error: error.message });
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
/**
|
|
135
|
+
* POST /api/profiles/orphans/register - Register discovered orphan settings
|
|
136
|
+
*/
|
|
137
|
+
router.post('/orphans/register', (req, res) => {
|
|
138
|
+
const shape = validatePayloadShape(req.body ?? {}, ['names', 'target', 'force']);
|
|
139
|
+
if (!shape.ok) {
|
|
140
|
+
res.status(400).json({ error: shape.error });
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const payload = shape.payload;
|
|
144
|
+
let names;
|
|
145
|
+
if (payload.names !== undefined) {
|
|
146
|
+
if (!Array.isArray(payload.names)) {
|
|
147
|
+
res.status(400).json({ error: 'names must be an array of profile names' });
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const invalidNameEntry = payload.names.find((value) => typeof value !== 'string' || value.trim().length === 0);
|
|
151
|
+
if (invalidNameEntry !== undefined) {
|
|
152
|
+
res.status(400).json({ error: 'names must contain non-empty strings only' });
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
names = payload.names.map((value) => value.trim());
|
|
156
|
+
const invalidName = names.find((name) => (0, services_1.validateApiName)(name) !== null);
|
|
157
|
+
if (invalidName) {
|
|
158
|
+
res.status(400).json({ error: `Invalid profile name in names: ${invalidName}` });
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const target = (0, route_helpers_1.parseTarget)(payload.target);
|
|
163
|
+
const force = payload.force === true;
|
|
164
|
+
if (payload.target !== undefined && target === null) {
|
|
165
|
+
res.status(400).json({ error: 'Invalid target. Expected: claude or droid' });
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
const result = (0, services_1.registerApiProfileOrphans)({
|
|
170
|
+
names,
|
|
171
|
+
target: target || 'claude',
|
|
172
|
+
force,
|
|
173
|
+
});
|
|
174
|
+
res.json(result);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
res.status(500).json({ error: error.message });
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
/**
|
|
181
|
+
* POST /api/profiles/:name/copy - Duplicate an API profile
|
|
182
|
+
*/
|
|
183
|
+
router.post('/:name/copy', (req, res) => {
|
|
184
|
+
const shape = validatePayloadShape(req.body, ['destination', 'target', 'force']);
|
|
185
|
+
if (!shape.ok) {
|
|
186
|
+
res.status(400).json({ error: shape.error });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const { name } = req.params;
|
|
190
|
+
const sourceNameError = (0, services_1.validateApiName)(name);
|
|
191
|
+
if (sourceNameError) {
|
|
192
|
+
res.status(400).json({ error: sourceNameError });
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const destination = shape.payload.destination;
|
|
196
|
+
const target = (0, route_helpers_1.parseTarget)(shape.payload.target);
|
|
197
|
+
const force = shape.payload.force === true;
|
|
198
|
+
if (typeof destination !== 'string' || destination.trim().length === 0) {
|
|
199
|
+
res.status(400).json({ error: 'destination is required' });
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (shape.payload.target !== undefined && target === null) {
|
|
203
|
+
res.status(400).json({ error: 'Invalid target. Expected: claude or droid' });
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const result = (0, services_1.copyApiProfile)(name, destination.trim(), { target: target || undefined, force });
|
|
207
|
+
if (!result.success) {
|
|
208
|
+
res.status(400).json({ error: result.error || 'Failed to copy profile' });
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
res.status(201).json(result);
|
|
212
|
+
});
|
|
213
|
+
/**
|
|
214
|
+
* POST /api/profiles/:name/export - Export profile as a portable bundle
|
|
215
|
+
*/
|
|
216
|
+
router.post('/:name/export', (req, res) => {
|
|
217
|
+
const shape = validatePayloadShape(req.body ?? {}, ['includeSecrets']);
|
|
218
|
+
if (!shape.ok) {
|
|
219
|
+
res.status(400).json({ error: shape.error });
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const { name } = req.params;
|
|
223
|
+
const profileNameError = (0, services_1.validateApiName)(name);
|
|
224
|
+
if (profileNameError) {
|
|
225
|
+
res.status(400).json({ error: profileNameError });
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const includeSecrets = shape.payload.includeSecrets === true;
|
|
229
|
+
const result = (0, services_1.exportApiProfile)(name, includeSecrets);
|
|
230
|
+
if (!result.success || !result.bundle) {
|
|
231
|
+
res.status(400).json({ error: result.error || 'Failed to export profile' });
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
res.json(result);
|
|
235
|
+
});
|
|
236
|
+
/**
|
|
237
|
+
* POST /api/profiles/import - Import profile bundle into local registry
|
|
238
|
+
*/
|
|
239
|
+
router.post('/import', (req, res) => {
|
|
240
|
+
const shape = validatePayloadShape(req.body, ['bundle', 'name', 'target', 'force']);
|
|
241
|
+
if (!shape.ok) {
|
|
242
|
+
res.status(400).json({ error: shape.error });
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const target = (0, route_helpers_1.parseTarget)(shape.payload.target);
|
|
246
|
+
if (shape.payload.target !== undefined && target === null) {
|
|
247
|
+
res.status(400).json({ error: 'Invalid target. Expected: claude or droid' });
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const bundle = shape.payload.bundle;
|
|
251
|
+
if (!bundle || typeof bundle !== 'object' || Array.isArray(bundle)) {
|
|
252
|
+
res.status(400).json({ error: 'bundle must be a JSON object' });
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const bundleTarget = bundle.profile?.target;
|
|
256
|
+
if (bundleTarget !== undefined && (0, route_helpers_1.parseTarget)(bundleTarget) === null) {
|
|
257
|
+
res.status(400).json({ error: 'Invalid bundle profile target. Expected: claude or droid' });
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const result = (0, services_1.importApiProfileBundle)(bundle, {
|
|
261
|
+
name: typeof shape.payload.name === 'string' ? shape.payload.name : undefined,
|
|
262
|
+
target: target || undefined,
|
|
263
|
+
force: shape.payload.force === true,
|
|
264
|
+
});
|
|
265
|
+
if (!result.success) {
|
|
266
|
+
res.status(400).json({
|
|
267
|
+
error: result.error || 'Failed to import profile',
|
|
268
|
+
validation: result.validation,
|
|
269
|
+
});
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
res.status(201).json(result);
|
|
273
|
+
});
|
|
92
274
|
/**
|
|
93
275
|
* PUT /api/profiles/:name - Update profile
|
|
94
276
|
*/
|
|
95
277
|
router.put('/:name', (req, res) => {
|
|
278
|
+
const shape = validatePayloadShape(req.body, [
|
|
279
|
+
'baseUrl',
|
|
280
|
+
'apiKey',
|
|
281
|
+
'model',
|
|
282
|
+
'opusModel',
|
|
283
|
+
'sonnetModel',
|
|
284
|
+
'haikuModel',
|
|
285
|
+
'target',
|
|
286
|
+
'droidProvider',
|
|
287
|
+
'provider',
|
|
288
|
+
]);
|
|
289
|
+
if (!shape.ok) {
|
|
290
|
+
res.status(400).json({ error: shape.error });
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
96
293
|
const { name } = req.params;
|
|
97
294
|
const { baseUrl, apiKey, model, opusModel, sonnetModel, haikuModel, target } = req.body;
|
|
98
295
|
const providerHint = req.body?.droidProvider ?? req.body?.provider;
|
|
@@ -109,7 +306,7 @@ router.put('/:name', (req, res) => {
|
|
|
109
306
|
return;
|
|
110
307
|
}
|
|
111
308
|
// Check if profile exists (uses unified config when available)
|
|
112
|
-
if (!(0,
|
|
309
|
+
if (!(0, services_1.apiProfileExists)(name)) {
|
|
113
310
|
res.status(404).json({ error: 'Profile not found' });
|
|
114
311
|
return;
|
|
115
312
|
}
|
|
@@ -147,7 +344,7 @@ router.put('/:name', (req, res) => {
|
|
|
147
344
|
});
|
|
148
345
|
}
|
|
149
346
|
if (hasTargetUpdate && parsedTarget) {
|
|
150
|
-
const targetUpdate = (0,
|
|
347
|
+
const targetUpdate = (0, services_1.updateApiProfileTarget)(name, parsedTarget);
|
|
151
348
|
if (!targetUpdate.success) {
|
|
152
349
|
res.status(500).json({ error: targetUpdate.error || 'Failed to update target' });
|
|
153
350
|
return;
|
|
@@ -170,12 +367,12 @@ router.put('/:name', (req, res) => {
|
|
|
170
367
|
router.delete('/:name', (req, res) => {
|
|
171
368
|
const { name } = req.params;
|
|
172
369
|
// Check if profile exists (uses unified config when available)
|
|
173
|
-
if (!(0,
|
|
370
|
+
if (!(0, services_1.apiProfileExists)(name)) {
|
|
174
371
|
res.status(404).json({ error: 'Profile not found' });
|
|
175
372
|
return;
|
|
176
373
|
}
|
|
177
374
|
// Remove profile using unified-config-aware service
|
|
178
|
-
const result = (0,
|
|
375
|
+
const result = (0, services_1.removeApiProfile)(name);
|
|
179
376
|
if (!result.success) {
|
|
180
377
|
res.status(500).json({ error: result.error || 'Failed to delete profile' });
|
|
181
378
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/profile-routes.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,qCAAoD;AACpD,gEAAqF;AACrF,sEAI2C;AAC3C,sEAAsF;AACtF,iEAAsE;AACtE,mDAAkE;AAElE,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAExB,SAAS,eAAe,CAAC,OAA2B;IAClD,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AACnF,CAAC;AAED,yDAAyD;AAEzD;;GAEG;AACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAa,EAAE,GAAa,EAAQ,EAAE;IACrD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,gCAAe,GAAE,CAAC;QACjC,sDAAsD;QACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,YAAY,EAAE,CAAC,CAAC,YAAY;YAC5B,UAAU,EAAE,CAAC,CAAC,YAAY;YAC1B,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC,CAAC,CAAC;QACJ,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf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GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,0BAA0B,EAAE,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-BR1vy4kf.js";import{r as f,h as je}from"./react-vendor-CNOkPC89.js";import{u as ye,a as M,b as z,d as be,f as B,g as Ne}from"./tanstack-e99Cjjy2.js";import{c as y,Y as _,a as G,a8 as oe,a9 as re,aa as le,ab as ie,ac as de,L as P,r as I,s as Z,t as Q,v as V,w as O,I as q,aq as Ce,d as u,C as S,j as k,k as D,_ as L,B as F,b as w,M as ue,N as xe,O as me,n as ve,x as X}from"./index-DmXx1Pyv.js";import{A as Pe,a as Ae,b as Se,c as ke,d as De,e as we,f as _e,g as Te}from"./alert-dialog-Cua4nIwu.js";import{t as b}from"./notifications-B2HqRBj7.js";import{aF as Le,aG as Me,k as $,ah as ze,z as Ge,N as Oe,m as W,aH as Fe,am as H,aI as He,aJ as Re,q as he,aK as qe,aL as $e,U as Ee,a1 as J,Z as Y,T as Ke}from"./icons-BYZM_9Gm.js";import{C as ee}from"./checkbox-BHwnoAEc.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function Ue({className:s,...a}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:y("w-full caption-bottom text-sm",s),...a})})}function Be({className:s,...a}){return e.jsx("thead",{"data-slot":"table-header",className:y("[&_tr]:border-b",s),...a})}function Ie({className:s,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:y("[&_tr:last-child]:border-0",s),...a})}function te({className:s,...a}){return e.jsx("tr",{"data-slot":"table-row",className:y("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...a})}function Ze({className:s,...a}){return e.jsx("th",{"data-slot":"table-head",className:y("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a})}function Qe({className:s,...a}){return e.jsx("td",{"data-slot":"table-cell",className:y("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...a})}function Ve(){return ye({queryKey:["accounts"],queryFn:()=>_.accounts.list(),select:s=>{const a=s.accounts.filter(l=>l.type!=="cliproxy"),t=s.accounts.length-a.length,c=a.filter(l=>l.context_mode==="shared").length,o=a.filter(l=>l.context_mode==="shared"&&l.continuity_mode==="deeper").length,x=Math.max(c-o,0),i=a.length-c,m=a.filter(l=>l.context_inferred).length,g=a.filter(l=>l.context_mode==="shared"&&l.continuity_mode!=="deeper"&&l.continuity_inferred).length,p=a.some(l=>l.name===s.default)?s.default:null;return{accounts:a,default:p,cliproxyCount:t,legacyContextCount:m,legacyContinuityCount:g,sharedCount:c,sharedStandardCount:x,deeperSharedCount:o,isolatedCount:i}}})}function Xe(){const s=M();return z({mutationFn:a=>_.accounts.setDefault(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),b.success(`Default account set to "${t}"`)},onError:a=>{b.error(a.message)}})}function We(){const s=M();return z({mutationFn:()=>_.accounts.resetDefault(),onSuccess:()=>{s.invalidateQueries({queryKey:["accounts"]}),b.success("Default account reset to CCS")},onError:a=>{b.error(a.message)}})}function Je(){const s=M();return z({mutationFn:a=>_.accounts.delete(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),b.success(`Account "${t}" deleted`)},onError:a=>{b.error(a.message)}})}function ge(){const s=M();return z({mutationFn:({name:a,context_mode:t,context_group:c,continuity_mode:o})=>_.accounts.updateContext(a,{context_mode:t,context_group:c,continuity_mode:o}),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]});const c=t.context_mode==="shared"?t.continuity_mode==="deeper"?`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, deeper continuity)`:`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, standard)`:"isolated";b.success(`Updated "${t.name}" context to ${c}`)},onError:a=>{b.error(a.message)}})}function Ye(){const s=M();return z({mutationFn:async a=>{const t=a.filter(c=>c.context_inferred||c.continuity_inferred);for(const c of t){const o=c.context_mode==="shared";await _.accounts.updateContext(c.name,{context_mode:o?"shared":"isolated",context_group:o?c.context_group||"default":void 0,continuity_mode:o?c.continuity_mode==="deeper"?"deeper":"standard":void 0})}return{updatedCount:t.length}},onSuccess:({updatedCount:a})=>{if(s.invalidateQueries({queryKey:["accounts"]}),a>0){b.success(`Confirmed explicit sync mode for ${a} legacy account${a>1?"s":""}`);return}b.info("No legacy accounts need confirmation")},onError:a=>{b.error(a.message)}})}const se=64,et=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function tt({account:s,onClose:a}){const{t}=G(),c=ge(),[o,x]=f.useState(s.context_mode==="shared"?"shared":"isolated"),[i,m]=f.useState(s.context_group||"default"),[g,p]=f.useState(s.continuity_mode==="deeper"?"deeper":"standard"),l=f.useMemo(()=>i.trim().toLowerCase().replace(/\s+/g,"-"),[i]),N=l.length>0&&l.length<=se&&et.test(l),j=o==="isolated"||N,n=()=>{j&&c.mutate({name:s.name,context_mode:o,context_group:o==="shared"?l:void 0,continuity_mode:o==="shared"?g:void 0},{onSuccess:()=>{a()}})},r=d=>{d||a()};return e.jsx(oe,{open:!0,onOpenChange:r,children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(le,{children:[e.jsx(ie,{children:t("editAccountContext.title")}),e.jsx(de,{children:t("editAccountContext.description",{name:s.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{htmlFor:"context-mode",children:t("editAccountContext.syncMode")}),e.jsxs(I,{value:o,onValueChange:d=>x(d),children:[e.jsx(Z,{id:"context-mode",children:e.jsx(Q,{placeholder:t("editAccountContext.selectContextMode")})}),e.jsxs(V,{children:[e.jsx(O,{value:"isolated",children:t("editAccountContext.isolatedOption")}),e.jsx(O,{value:"shared",children:t("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(o==="shared"?"editAccountContext.sharedModeHint":"editAccountContext.isolatedModeHint")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{htmlFor:"context-group",children:t("editAccountContext.historySyncGroup")}),e.jsx(q,{id:"context-group",value:i,onChange:d=>m(d.target.value),placeholder:t("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.groupHint",{max:se})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:t("editAccountContext.invalidGroup")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{htmlFor:"continuity-mode",children:t("editAccountContext.continuityDepth")}),e.jsxs(I,{value:g,onValueChange:d=>p(d),children:[e.jsx(Z,{id:"continuity-mode",children:e.jsx(Q,{placeholder:t("editAccountContext.selectContinuityDepth")})}),e.jsxs(V,{children:[e.jsx(O,{value:"standard",children:t("editAccountContext.standardOption")}),e.jsx(O,{value:"deeper",children:t("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(g==="deeper"?"editAccountContext.deeperHint":"editAccountContext.standardHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.credentialsIsolated")})]}),e.jsxs(Ce,{children:[e.jsx(u,{variant:"outline",onClick:a,disabled:c.isPending,children:t("editAccountContext.cancel")}),e.jsx(u,{onClick:n,disabled:!j||c.isPending,children:c.isPending?t("editAccountContext.saving"):t("editAccountContext.save")})]})]})})}function ae({data:s,defaultAccount:a}){const{t}=G(),c=Xe(),o=Je(),x=We(),i=ge(),[m,g]=f.useState(null),[p,l]=f.useState(null),N=[{accessorKey:"name",header:t("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===a&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:t("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:t("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:t("accountsTable.created"),size:150,cell:({row:n})=>{const r=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{accessorKey:"last_used",header:t("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const r=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{id:"context",header:t("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const d=n.original.context_group||"default";return n.original.continuity_mode==="deeper"?e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupDeeper",{group:d})}):n.original.continuity_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.sharedGroupLegacy",{group:d})}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupStandard",{group:d})})}return n.original.context_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.isolatedLegacy")}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.isolated")})}},{id:"actions",header:t("accountsTable.actions"),size:220,cell:({row:n})=>{const r=n.original.name===a,d=c.isPending||o.isPending||i.isPending,C=n.original.type==="cliproxy",A=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!C&&e.jsxs(u,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:d,onClick:()=>l(n.original),title:t("accountsTable.syncTitle"),children:[e.jsx(Le,{className:"w-3.5 h-3.5 mr-1"}),t("accountsTable.sync")]}),!C&&A&&e.jsxs(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:d,onClick:()=>i.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:t("accountsTable.confirmLegacyTitle"),children:[e.jsx(Me,{className:"w-3 h-3 mr-1"}),t("accountsTable.confirm")]}),e.jsxs(u,{variant:r?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:r||d,onClick:()=>c.mutate(n.original.name),children:[e.jsx($,{className:`w-3 h-3 mr-1 ${r?"opacity-50":""}`}),t(r?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:r||d,onClick:()=>g(n.original.name),title:t(r?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(ze,{className:"w-4 h-4"})})]})}}],j=be({data:s,columns:N,getCoreRowModel:Ne()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:t("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Ue,{children:[e.jsx(Be,{children:j.getHeaderGroups().map(n=>e.jsx(te,{children:n.headers.map(r=>{const d={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",context:"w-[170px]",actions:"w-[290px]"}[r.id]||"w-auto";return e.jsx(Ze,{className:d,children:r.isPlaceholder?null:B(r.column.columnDef.header,r.getContext())},r.id)})},n.id))}),e.jsx(Ie,{children:j.getRowModel().rows.map(n=>e.jsx(te,{children:n.getVisibleCells().map(r=>e.jsx(Qe,{children:B(r.column.columnDef.cell,r.getContext())},r.id))},n.id))})]})}),a&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(u,{variant:"outline",size:"sm",onClick:()=>x.mutate(),disabled:x.isPending,children:[e.jsx(Ge,{className:"w-4 h-4 mr-2"}),t("accountsTable.resetToDefault")]})})]}),p&&e.jsx(tt,{account:p,onClose:()=>l(null)}),e.jsx(Pe,{open:!!m,onOpenChange:n=>!n&&g(null),children:e.jsxs(Ae,{children:[e.jsxs(Se,{children:[e.jsx(ke,{children:t("accountsTable.deleteDialogTitle")}),e.jsx(De,{children:t("accountsTable.deleteDialogDesc",{name:m??""})})]}),e.jsxs(we,{children:[e.jsx(_e,{children:t("accountsTable.cancel")}),e.jsx(Te,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{m&&(o.mutate(m),g(null))},children:t("accountsTable.delete")})]})]})})]})}const ne=64;function st({open:s,onClose:a}){const{t}=G(),[c,o]=f.useState(""),[x,i]=f.useState(!1),[m,g]=f.useState(""),[p,l]=f.useState(!1),[N,j]=f.useState(!1),n=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(c),r=m.trim().toLowerCase().replace(/\s+/g,"-"),d=r.length===0||r.length<=ne&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r),C=c&&n?[`ccs auth create ${c}`,x?r.length>0?`--context-group ${r}`:"--share-context":"",x&&p?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),A=async()=>{!n||x&&!d||(await navigator.clipboard.writeText(C),j(!0),setTimeout(()=>j(!1),2e3))},T=()=>{o(""),i(!1),g(""),l(!1),j(!1),a()};return e.jsx(oe,{open:s,onOpenChange:h=>!h&&T(),children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(le,{children:[e.jsx(ie,{children:t("createAuthProfileDialog.title")}),e.jsx(de,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(q,{id:"profile-name",value:c,onChange:h=>o(h.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),c&&!n&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{id:"share-context",checked:x,onCheckedChange:h=>i(h===!0)}),e.jsx(P,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),x&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(P,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(q,{id:"context-group",value:m,onChange:h=>g(h.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(ee,{id:"deeper-continuity",checked:p,onCheckedChange:h=>l(h===!0)}),e.jsx(P,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),m.trim().length>0&&!d&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ne})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{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(Oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:C}),e.jsx(u,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:A,disabled:!n||x&&!d,children:N?e.jsx($,{className:"w-4 h-4 text-green-500"}):e.jsx(W,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(u,{variant:"ghost",onClick:T,children:t("createAuthProfileDialog.close")}),e.jsx(u,{onClick:A,disabled:!n||x&&!d,children:N?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function R({title:s,count:a,icon:t,tone:c}){const o={isolated:{border:"border-blue-300/60 bg-blue-50/40 dark:border-blue-900/40 dark:bg-blue-900/10",icon:"text-blue-700 dark:text-blue-400",count:"text-blue-700 dark:text-blue-400"},shared:{border:"border-emerald-300/60 bg-emerald-50/40 dark:border-emerald-900/40 dark:bg-emerald-900/10",icon:"text-emerald-700 dark:text-emerald-400",count:"text-emerald-700 dark:text-emerald-400"},deeper:{border:"border-indigo-300/60 bg-indigo-50/40 dark:border-indigo-900/40 dark:bg-indigo-900/10",icon:"text-indigo-700 dark:text-indigo-400",count:"text-indigo-700 dark:text-indigo-400"}};return e.jsxs("div",{className:y("rounded-md border p-2.5",o[c].border),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-semibold",children:s}),e.jsx(t,{className:y("h-3.5 w-3.5",o[c].icon)})]}),e.jsx("p",{className:y("mt-1 text-lg font-mono font-semibold",o[c].count),children:a})]})}function ce({isolatedCount:s,sharedStandardCount:a,deeperSharedCount:t,sharedGroups:c,legacyTargetCount:o,cliproxyCount:x}){const{t:i}=G(),[m,g]=f.useState(!1),p=c.length>0?c:["default"];return e.jsxs(S,{className:"border-dashed",children:[e.jsx(k,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(D,{className:"text-base",children:i("historySyncLearningMap.title")}),e.jsx(L,{className:"mt-1",children:i("historySyncLearningMap.description")})]}),e.jsx(F,{variant:"outline",children:i("historySyncLearningMap.learningMap")})]})}),e.jsxs(w,{className:"space-y-3",children:[x>0&&e.jsx("div",{className:"rounded-md border border-blue-300/60 bg-blue-50/40 px-3 py-2 text-xs text-blue-800 dark:border-blue-900/40 dark:bg-blue-900/10 dark:text-blue-300",children:i("historySyncLearningMap.cliproxyManaged",{count:x})}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_1fr_auto_1fr] sm:items-center",children:[e.jsx(R,{title:i("historySyncLearningMap.isolated"),count:s,icon:Fe,tone:"isolated"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(H,{className:"h-4 w-4"})}),e.jsx(R,{title:i("historySyncLearningMap.shared"),count:a,icon:He,tone:"shared"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(H,{className:"h-4 w-4"})}),e.jsx(R,{title:i("historySyncLearningMap.deeper"),count:t,icon:Re,tone:"deeper"})]}),e.jsxs(ue,{open:m,onOpenChange:g,children:[e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-8 w-full justify-between rounded-md px-2 text-xs text-muted-foreground hover:bg-muted/40 hover:text-foreground",children:[e.jsx("span",{children:i("historySyncLearningMap.showDetails")}),e.jsx(he,{className:y("h-4 w-4 transition-transform",m&&"rotate-180")})]})}),e.jsxs(me,{className:"pt-2",children:[e.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qe,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:i("historySyncLearningMap.modeSwitch")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:i("historySyncLearningMap.modeSwitchDesc")})]}),e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:i("historySyncLearningMap.historySyncGroup")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:i("historySyncLearningMap.historySyncGroupDesc")}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:p.map(l=>e.jsx(F,{variant:"outline",className:"font-mono text-[10px]",children:l},l))})]})]}),o>0&&e.jsxs("div",{className:"mt-2 rounded-md border border-amber-500/50 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-300",children:[o," legacy account",o>1?"s still need":" still needs"," explicit confirmation."]})]})]})]})]})}function ht(){const{t:s}=G(),a=je(),{data:t,isLoading:c}=Ve(),o=Ye(),[x,i]=f.useState(!1),[m,g]=f.useState(!1),p=t?.accounts||[],l=t?.cliproxyCount||0,N=t?.legacyContextCount||0,j=t?.legacyContinuityCount||0,n=t?.sharedCount||0,r=t?.sharedStandardCount||0,d=t?.deeperSharedCount||0,C=t?.isolatedCount||0,A=Array.from(new Set(p.filter(v=>v.context_mode==="shared").map(v=>v.context_group||"default"))).sort((v,fe)=>v.localeCompare(fe)),T=p.filter(v=>v.context_inferred||v.continuity_inferred),h=T.length,pe=h>0,E=()=>a("/cliproxy?provider=claude"),K=()=>a("/cliproxy?provider=claude&action=auth"),U=()=>o.mutate(T);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"h-[calc(100vh-100px)] hidden 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(Ee,{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(ve,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.primaryActions")}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:()=>i(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:K,children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),s("accountsPage.authClaudeInPool")]}),e.jsxs(u,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:E,children:[s("accountsPage.openClaudePoolSettings"),e.jsx(H,{className:"w-4 h-4 ml-auto"})]})]}),pe?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ke,{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:[N>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContextPending",{count:N})}),j>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContinuityPending",{count:j})})]})]}),e.jsx(u,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:U,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:s("accountsPage.noLegacyFollowup")}),e.jsx(ue,{open:m,onOpenChange:g,children:e.jsxs(S,{children:[e.jsx(k,{className:"pb-2",children:e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-auto w-full justify-between px-0 py-0",children:[e.jsxs("div",{className:"text-left",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.continuityGuide")}),e.jsx(L,{className:"mt-1",children:s("accountsPage.expandWhenNeeded")})]}),e.jsx(he,{className:y("h-4 w-4 transition-transform",m&&"rotate-180")})]})})}),e.jsx(me,{children:e.jsxs(w,{className:"space-y-3 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedStandard")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.sharedStandardDesc")})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedDeeper")}),e.jsxs("p",{className:"mt-1",children:[s("accountsPage.sharedDeeperPrefix")," ",e.jsx("code",{children:"session-env"}),","," ",e.jsx("code",{children:"file-history"}),", ",e.jsx("code",{children:"shell-snapshots"}),","," ",e.jsx("code",{children:"todos"}),"."]})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.isolated")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.isolatedDesc")})]})]})})]})}),e.jsxs(S,{children:[e.jsxs(k,{className:"pb-2",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.quickCommands")}),e.jsx(L,{children:s("accountsPage.quickCommandsDesc")})]}),e.jsxs(w,{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(X,{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(X,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{variant:"outline",children:s("accountsPage.workspaceBadge")}),e.jsx(F,{variant:"secondary",children:s("accountsPage.historySyncBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:s("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[s("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"Sync"}),s("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(ce,{isolatedCount:C,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:A,legacyTargetCount:h,cliproxyCount:l}),e.jsxs(S,{className:"flex flex-col",children:[e.jsxs(k,{className:"pb-3",children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.accountMatrix")}),e.jsx(L,{children:s("accountsPage.sharedTotalDesc",{count:n})})]}),e.jsx(w,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(S,{children:[e.jsxs(k,{children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.title")}),e.jsxs(L,{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(w,{className:"space-y-2",children:[e.jsxs(u,{className:"w-full",onClick:()=>i(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:E,children:[s("accountsPage.openCliProxyClaudePool"),e.jsx(H,{className:"w-4 h-4 ml-2"})]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:K,children:[s("accountsPage.authClaudeInPool"),e.jsx(Y,{className:"w-4 h-4 ml-2"})]}),e.jsx(u,{variant:"outline",className:"w-full",onClick:U,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}),e.jsx(ce,{isolatedCount:C,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:A,legacyTargetCount:h,cliproxyCount:l}),e.jsxs(S,{children:[e.jsx(k,{className:"pb-3",children:e.jsx(D,{className:"text-base",children:s("accountsPage.accountMatrix")})}),e.jsx(w,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]}),e.jsx(st,{open:x,onClose:()=>i(!1)})]})}export{ht as AccountsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-BR1vy4kf.js";import{r as x}from"./react-vendor-CNOkPC89.js";import{B as S,c as O,T as Re,p as De,q as Le,r as Ie,s as He,t as Ue,v as Fe,w as re,d as v,I as E,a as D,n as $,L as T,x as R,y as Ne,z as Ke,A as ze,D as Qe,E as $e,S as ne,F,G as X,H as ve,J as Je,K as Be,M as be,N as we,O as Ce,Q as qe,R as Ve,U as ie,V as le,W as K,X as Ye,Y as Ge,Z as se,C as oe,j as ce,k as de,_ as xe,b as me,$ as We,a0 as Xe,a1 as Ze,a2 as es}from"./index-DmXx1Pyv.js";import{a as ss,u as ts,b as ue}from"./tanstack-e99Cjjy2.js";import{C as Z}from"./confirm-dialog-sXvRWo2S.js";import{t as H}from"./notifications-B2HqRBj7.js";import{L as z,R as J,ah as ye,ai as as,E as rs,e as ns,a1 as Q,J as is,aj as ke,a2 as te,C as Pe,ak as ls,a0 as os,al as cs,n as ee,X as ds,Z as Te,am as he,an as Ee,l as xs,a5 as ms,a3 as Oe,ao as us,u as Se}from"./icons-BYZM_9Gm.js";import{S as pe}from"./separator-CMSZsZ-K.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";import"./alert-dialog-Cua4nIwu.js";function hs({className:s,showTooltip:t=!0}){const n=e.jsxs(S,{variant:"outline",className:O("bg-accent/10 border-accent/30 text-accent","dark:bg-accent/20 dark:border-accent/40 dark:text-accent-foreground",s),children:[e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"mr-1 h-3 w-3"}),"OpenRouter"]});return t?e.jsxs(Re,{children:[e.jsx(De,{asChild:!0,children:n}),e.jsx(Le,{children:e.jsx("p",{children:"Access 349+ models via OpenRouter"})})]}):n}function ge(s){return[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(n=>n.test(s))}function _e(s){return s?.env?(s.env.ANTHROPIC_BASE_URL||"").toLowerCase().includes("openrouter.ai"):!1}function ps(s){return{opus:s.ANTHROPIC_DEFAULT_OPUS_MODEL||void 0,sonnet:s.ANTHROPIC_DEFAULT_SONNET_MODEL||void 0,haiku:s.ANTHROPIC_DEFAULT_HAIKU_MODEL||void 0}}function gs(s,t){const n={...s};return t.opus?n.ANTHROPIC_DEFAULT_OPUS_MODEL=t.opus:delete n.ANTHROPIC_DEFAULT_OPUS_MODEL,t.sonnet?n.ANTHROPIC_DEFAULT_SONNET_MODEL=t.sonnet:delete n.ANTHROPIC_DEFAULT_SONNET_MODEL,t.haiku?n.ANTHROPIC_DEFAULT_HAIKU_MODEL=t.haiku:delete n.ANTHROPIC_DEFAULT_HAIKU_MODEL,n}function fs({profileName:s,target:t,data:n,settings:a,isLoading:l,isSaving:p,isTargetSaving:m,hasChanges:g,isRawJsonValid:r,onTargetChange:N,onRefresh:u,onDelete:f,onSave:k}){const b=p||m,j=l||b;return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),n?.path&&e.jsx(S,{variant:"outline",className:"text-xs",children:n.path.replace(/^.*\//,"")}),_e(a)&&e.jsx(hs,{className:"ml-1"})]}),n&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",new Date(n.mtime).toLocaleString()]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Default target:"}),e.jsxs(Ie,{value:t,onValueChange:w=>{j||N(w)},disabled:j,children:[e.jsx(He,{className:"h-7 w-[170px] text-xs",disabled:j,children:e.jsx(Ue,{})}),e.jsxs(Fe,{children:[e.jsx(re,{value:"claude",children:"Claude Code"}),e.jsx(re,{value:"droid",children:"Factory Droid"})]})]}),m&&e.jsx(z,{className:"w-3.5 h-3.5 animate-spin text-muted-foreground"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{variant:"ghost",size:"sm",onClick:u,disabled:j,children:e.jsx(J,{className:`w-4 h-4 ${l?"animate-spin":""}`})}),f&&e.jsx(v,{variant:"ghost",size:"sm",onClick:f,disabled:b,children:e.jsx(ye,{className:"w-4 h-4 text-destructive"})}),e.jsx(v,{size:"sm",onClick:k,disabled:b||!g||!r,children:p?e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(as,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Ae({label:s,...t}){const[n,a]=x.useState(!1);return e.jsxs("div",{className:"space-y-1",children:[s&&e.jsx("label",{className:"text-sm font-medium",children:s}),e.jsxs("div",{className:"relative",children:[e.jsx(E,{type:n?"text":"password",className:"pr-10 font-mono",...t}),e.jsx(v,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>a(!n),tabIndex:-1,children:n?e.jsx(rs,{className:"w-4 h-4"}):e.jsx(ns,{className:"w-4 h-4"})})]})]})}function js({currentSettings:s,newEnvKey:t,newEnvValue:n,onNewEnvKeyChange:a,onNewEnvValueChange:l,onEnvValueChange:p,onAddEnvVar:m}){const{t:g}=D();return e.jsxs(e.Fragment,{children:[e.jsx($,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-4",children:s?.env&&Object.keys(s.env).length>0?e.jsx(e.Fragment,{children:Object.entries(s.env).map(([r,N])=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(T,{className:"text-xs font-medium flex items-center gap-2 text-muted-foreground",children:[r,ge(r)&&e.jsx(S,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:g("envEditor.sensitive")})]}),ge(r)?e.jsx(Ae,{value:N,onChange:u=>p(r,u.target.value),className:"font-mono text-sm h-8"}):e.jsx(E,{value:N,onChange:u=>p(r,u.target.value),className:"font-mono text-sm h-8"})]},r))}):e.jsxs("div",{className:"py-8 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed text-sm",children:[e.jsx("p",{children:g("envEditor.none")}),e.jsx("p",{className:"text-xs mt-1 opacity-70",children:g("envEditor.noneHint")})]})})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(T,{className:"text-xs font-medium text-muted-foreground",children:g("envEditor.addVariable")}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(E,{placeholder:g("envEditor.keyPlaceholder"),value:t,onChange:r=>a(r.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:r=>r.key==="Enter"&&t.trim()&&m()}),e.jsx(E,{placeholder:g("envEditor.valuePlaceholder"),value:n,onChange:r=>l(r.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:r=>r.key==="Enter"&&t.trim()&&m()}),e.jsx(v,{variant:"outline",size:"sm",className:"h-8",onClick:m,disabled:!t.trim(),children:e.jsx(Q,{className:"w-4 h-4"})})]})]})]})}function Ns({profileName:s,target:t,data:n}){const{t:a}=D(),l=t==="droid";return e.jsx($,{className:"h-full",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2 mb-3",children:[e.jsx(is,{className:"w-4 h-4"}),a("profileEditor.profileInfo")]}),e.jsx("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:a("profileEditor.profileName")}),e.jsx("span",{className:"font-mono",children:n.profile})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:a("profileEditor.filePath")}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs break-all",children:n.path}),e.jsx(R,{value:n.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:a("profileEditor.lastModified")}),e.jsx("span",{className:"text-xs",children:new Date(n.mtime).toLocaleString()})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:a("profileEditor.defaultTarget")}),e.jsx("span",{className:"font-mono",children:t})]})]})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:a("profileEditor.quickUsage")}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:a("profileEditor.runWithProfile")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs ",s,' "prompt"']}),e.jsx(R,{value:`ccs ${s} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:a(l?"profileEditor.droidAliasExplicit":"profileEditor.runOnDroid")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsx("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:l?`ccsd ${s} "prompt"`:`ccs ${s} --target droid "prompt"`}),e.jsx(R,{value:l?`ccsd ${s} "prompt"`:`ccs ${s} --target droid "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:a(l?"profileEditor.overrideToClaude":"profileEditor.overrideToClaudeExplicit")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs ",s,' --target claude "prompt"']}),e.jsx(R,{value:`ccs ${s} --target claude "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:a("profileEditor.setAsDefault")}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs default ",s]}),e.jsx(R,{value:`ccs default ${s}`,size:"icon",className:"h-6 w-6"})]})]})]})]})]})})}function vs({value:s,onChange:t,placeholder:n="Search models...",className:a}){const[l,p]=x.useState(""),[m,g]=x.useState(null),{models:r,isLoading:N,isError:u,isFetching:f}=Ne(),k=Ke(),b=x.useMemo(()=>ze(r,l,{category:m??void 0}),[r,l,m]),j=x.useMemo(()=>Qe(r,2),[r]),w=!l.trim()&&!m,_=x.useMemo(()=>{const o={anthropic:[],openai:[],google:[],meta:[],mistral:[],opensource:[],other:[]};b.forEach(c=>{o[c.category].push(c)});for(const c of Object.keys(o))o[c]=$e(o[c]);return o},[b]),A=x.useCallback(()=>{k()},[k]),y=r.find(o=>o.id===s);return N&&r.length===0?e.jsxs("div",{className:O("space-y-2",a),children:[e.jsx(ne,{className:"h-10 w-full"}),e.jsx(ne,{className:"h-32 w-full"})]}):e.jsxs("div",{className:O("space-y-2 w-full min-w-0 overflow-hidden",a),children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ke,{className:"text-muted-foreground absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2"}),e.jsx(E,{value:l,onChange:o=>p(o.target.value),placeholder:n,className:"pl-9"})]}),e.jsx(v,{variant:"outline",size:"icon",onClick:A,disabled:f,title:"Refresh models",children:f?e.jsx(z,{className:"h-4 w-4 animate-spin"}):e.jsx(J,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs(S,{variant:m===null?"default":"outline",className:"cursor-pointer",onClick:()=>g(null),children:["All (",r.length,")"]}),Object.keys(F).map(o=>{const c=_[o].length;return c===0?null:e.jsxs(S,{variant:m===o?"default":"outline",className:"cursor-pointer",onClick:()=>g(o),children:[F[o]," (",c,")"]},o)})]}),y&&e.jsxs("div",{className:"bg-muted rounded-md p-2 text-sm",children:[e.jsx("span",{className:"font-medium",children:y.name}),e.jsxs("span",{className:"text-muted-foreground ml-2",children:[X(y.pricing)," |"," ",ve(y.context_length)]})]}),e.jsx($,{className:"h-72 w-full rounded-md border",children:u?e.jsxs("div",{className:"text-destructive p-4 text-center",children:["Failed to load models."," ",e.jsx(v,{variant:"link",onClick:A,children:"Retry"})]}):b.length===0?e.jsxs("div",{className:"text-muted-foreground p-4 text-center",children:['No models found matching "',l,'"']}):e.jsxs("div",{className:"space-y-6 p-3",children:[w&&j.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 flex items-center gap-1.5 py-1.5 text-xs font-semibold border-b pb-2",children:[e.jsx(te,{className:"h-3 w-3 text-accent"}),e.jsx("span",{children:"Newest Models"})]}),e.jsx("div",{className:"space-y-1",children:j.map(o=>e.jsx(fe,{model:o,isSelected:o.id===s,onClick:()=>t(o.id),showAge:!0},o.id))})]}),Object.keys(F).map(o=>{const c=_[o];return c.length===0?null:e.jsxs("div",{children:[e.jsx("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 py-1.5 text-xs font-semibold border-b pb-2",children:F[o]}),e.jsx("div",{className:"space-y-1",children:c.map(i=>e.jsx(fe,{model:i,isSelected:i.id===s,onClick:()=>t(i.id)},i.id))})]},o)})]})})]})}function fe({model:s,isSelected:t,onClick:n,showAge:a=!1}){return e.jsxs("button",{type:"button",onClick:n,className:O("group flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",t&&"bg-accent text-accent-foreground"),children:[e.jsx("span",{className:"flex-1 min-w-0 truncate font-medium",children:s.name}),e.jsxs("span",{className:O("flex shrink-0 items-center gap-1 text-xs whitespace-nowrap",t?"text-accent-foreground/80":"text-muted-foreground group-hover:text-accent-foreground/80"),children:[a&&s.created&&e.jsx(S,{variant:"outline",className:O("text-[10px] px-1",t?"border-accent-foreground/30 text-accent-foreground/80":"text-accent border-accent/30 group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30"),children:Je(s.created)}),s.isFree?e.jsx(S,{variant:"secondary",className:O("text-[10px] px-1",t?"bg-accent-foreground/20 text-accent-foreground":"group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground"),children:"Free"}):s.isExacto?e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",className:O("text-[10px] px-1 border-emerald-500/50 text-emerald-600",t?"border-accent-foreground/30 text-accent-foreground/80":"group-hover:border-accent-foreground/30 group-hover:text-accent-foreground/80"),children:"Exacto"}),e.jsx("span",{className:"tabular-nums",children:X(s.pricing)})]}):e.jsx("span",{className:"tabular-nums",children:X(s.pricing)}),e.jsx("span",{className:"tabular-nums",children:ve(s.context_length)})]})]})}function bs({selectedModel:s,value:t,onChange:n,className:a}){const{t:l}=D(),{models:p}=Ne(),m=x.useMemo(()=>s?Be(s,p):{},[s,p]),g=()=>{n(m)},r=(u,f)=>{n({...t,[u]:f||void 0})},N=s&&Object.keys(m).length>0;return e.jsxs(be,{className:O("group",a),children:[e.jsxs(we,{className:"flex items-center gap-2 text-sm font-medium hover:underline",children:[e.jsx(Pe,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),l("modelTierMapping.title"),e.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",l("modelTierMapping.advanced"),")"]})]}),e.jsxs(Ce,{className:"space-y-3 pt-3",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:l("modelTierMapping.description")}),N&&e.jsxs(v,{type:"button",variant:"outline",size:"sm",onClick:g,children:[e.jsx(ls,{className:"mr-1 h-4 w-4"}),l("modelTierMapping.autoSuggest",{provider:s?.split("/")[0]})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-opus",className:"text-right",children:"Opus"}),e.jsx(E,{id:"tier-opus",value:t.opus??"",onChange:u=>r("opus",u.target.value),placeholder:l("modelTierMapping.opusPlaceholder")})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-sonnet",className:"text-right",children:"Sonnet"}),e.jsx(E,{id:"tier-sonnet",value:t.sonnet??"",onChange:u=>r("sonnet",u.target.value),placeholder:l("modelTierMapping.sonnetPlaceholder")})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-haiku",className:"text-right",children:"Haiku"}),e.jsx(E,{id:"tier-haiku",value:t.haiku??"",onChange:u=>r("haiku",u.target.value),placeholder:l("modelTierMapping.haikuPlaceholder")})]})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:l("modelTierMapping.footer")})]})]})}function ws({profileName:s,target:t,data:n,currentSettings:a,newEnvKey:l,newEnvValue:p,onNewEnvKeyChange:m,onNewEnvValueChange:g,onEnvValueChange:r,onAddEnvVar:N,onEnvBulkChange:u}){const f=_e(a),k=a?.env,b=x.useMemo(()=>ps(k??{}),[k]),j=k??{},w=i=>{if(u){const P={...j,ANTHROPIC_MODEL:i,ANTHROPIC_DEFAULT_OPUS_MODEL:i,ANTHROPIC_DEFAULT_SONNET_MODEL:i,ANTHROPIC_DEFAULT_HAIKU_MODEL:i};u(P)}else r("ANTHROPIC_MODEL",i),r("ANTHROPIC_DEFAULT_OPUS_MODEL",i),r("ANTHROPIC_DEFAULT_SONNET_MODEL",i),r("ANTHROPIC_DEFAULT_HAIKU_MODEL",i);H.success(K.t("commonToast.appliedModelAllTiers"),{duration:2e3})},_=i=>{if(u){const P=gs(j,i);u(P)}else i.opus!==void 0&&r("ANTHROPIC_DEFAULT_OPUS_MODEL",i.opus||""),i.sonnet!==void 0&&r("ANTHROPIC_DEFAULT_SONNET_MODEL",i.sonnet||""),i.haiku!==void 0&&r("ANTHROPIC_DEFAULT_HAIKU_MODEL",i.haiku||"")},[A,y]=x.useState(!1),o=new Set(["ANTHROPIC_AUTH_TOKEN"]),c=Object.entries(j).filter(([i])=>!o.has(i));return e.jsx("div",{className:"h-full w-full min-w-0 flex flex-col",children:e.jsxs(qe,{defaultValue:"env",className:"h-full w-full min-w-0 flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(Ve,{className:"w-full",children:[e.jsx(ie,{value:"env",className:"flex-1",children:f?"Configuration":"Environment Variables"}),e.jsx(ie,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:[e.jsx(le,{value:"env",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden min-w-0",children:f?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsxs("div",{className:"h-full overflow-y-auto overflow-x-hidden p-4 space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{className:"text-sm font-medium",children:"Model Selection"}),e.jsx(vs,{value:j.ANTHROPIC_MODEL,onChange:w,placeholder:"Search OpenRouter models..."})]}),e.jsx(bs,{selectedModel:j.ANTHROPIC_MODEL,value:b,onChange:_}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"API Key"}),e.jsx(Ae,{value:j.ANTHROPIC_AUTH_TOKEN||"",onChange:i=>r("ANTHROPIC_AUTH_TOKEN",i.target.value),placeholder:"sk-or-v1-...",className:"font-mono text-sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Get your API key from"," ",e.jsx("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"openrouter.ai/keys"})]})]}),c.length>0&&e.jsxs(be,{open:A,onOpenChange:y,children:[e.jsxs(we,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors group",children:[e.jsx(Pe,{className:O("h-4 w-4 transition-transform",A&&"rotate-90")}),e.jsx(os,{className:"h-4 w-4"}),e.jsx("span",{children:"Additional Variables"}),e.jsxs("span",{className:"text-xs font-normal opacity-70",children:["(",c.length,")"]})]}),e.jsx(Ce,{className:"pt-4",children:e.jsx("div",{className:"space-y-3 border rounded-lg p-3 bg-muted/30",children:c.map(([i,P])=>e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:i}),e.jsx(E,{value:P,onChange:L=>r(i,L.target.value),className:"font-mono text-xs h-8"})]},i))})})]})]})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(T,{className:"text-xs font-medium text-muted-foreground",children:"Add Environment Variable"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(E,{placeholder:"VARIABLE_NAME",value:l,onChange:i=>m(i.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:i=>i.key==="Enter"&&l.trim()&&N()}),e.jsx(E,{placeholder:"value",value:p,onChange:i=>g(i.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:i=>i.key==="Enter"&&l.trim()&&N()}),e.jsx(v,{variant:"outline",size:"sm",className:"h-8",onClick:N,disabled:!l.trim(),children:e.jsx(Q,{className:"w-4 h-4"})})]})]})]}):e.jsx(js,{currentSettings:a,newEnvKey:l,newEnvValue:p,onNewEnvKeyChange:m,onNewEnvValueChange:g,onEnvValueChange:r,onAddEnvVar:N})}),e.jsx(le,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(Ns,{profileName:s,target:t,data:n})})]})]})})}function Cs({profileName:s,profileTarget:t,onDelete:n,onHasChangesUpdate:a}){const[l,p]=x.useState({}),[m,g]=x.useState(!1),[r,N]=x.useState(null),[u,f]=x.useState(""),[k,b]=x.useState(""),j=ss(),{data:w,isLoading:_,isError:A,refetch:y}=ts({queryKey:["settings",s],queryFn:async()=>{const d=await fetch(`/api/settings/${s}/raw`);if(!d.ok)throw new Error(`Failed to load settings: ${d.status}`);return d.json()}}),o=w?.settings,c=x.useMemo(()=>{if(r!==null)try{return JSON.parse(r)}catch{}if(o)return{...o,env:{...o.env,...l}}},[o,l,r]),i=x.useMemo(()=>r!==null?r:o?JSON.stringify(o,null,2):"",[r,o]),P=x.useCallback(d=>{N(d)},[]),L=(d,C)=>{const M={...c?.env||{},[d]:C};p(I=>({...I,[d]:C})),N(JSON.stringify({...c,env:M},null,2))},B=d=>{const C={...c?.env||{},...d};p(M=>({...M,...d})),N(JSON.stringify({...c,env:C},null,2))},q=()=>{if(!u.trim())return;const d=u.trim(),C=k,M={...c?.env||{},[d]:C};p(I=>({...I,[d]:C})),N(JSON.stringify({...c,env:M},null,2)),f(""),b("")},h=x.useMemo(()=>{try{return JSON.parse(i),!0}catch{return!1}},[i]),V=x.useMemo(()=>r!==null?r!==JSON.stringify(o,null,2):Object.keys(l).length>0,[r,l,o]),Me=x.useMemo(()=>{const d=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"],C=c?.env||{};return d.filter(M=>!C[M]?.trim())},[c]);x.useEffect(()=>{a?.(V)},[V,a]);const U=ue({mutationFn:async()=>{let d;try{d=JSON.parse(i)}catch{d={...w?.settings,env:{...w?.settings?.env,...l}}}const C=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:d,expectedMtime:w?.mtime})});if(C.status===409)throw new Error("CONFLICT");if(!C.ok)throw new Error("Failed to save");return C.json()},onSuccess:()=>{j.invalidateQueries({queryKey:["settings",s]}),j.invalidateQueries({queryKey:["profiles"]}),p({}),N(null),H.success(K.t("commonToast.settingsSaved"))},onError:d=>{d.message==="CONFLICT"?g(!0):H.error(d.message)}}),Y=ue({mutationFn:async d=>(await Ge.profiles.update(s,{target:d}),d),onSuccess:()=>{j.invalidateQueries({queryKey:["profiles"]}),H.success(K.t("commonToast.defaultTargetUpdated"))},onError:(d,C)=>{const M=C==="droid"?"Factory Droid":"Claude Code",I=d.message.trim()?`: ${d.message}`:"";H.error(K.t("commonToast.failedUpdateDefaultTarget",{target:M,suffix:I}))}}),G=t||"claude",W=U.isPending||Y.isPending,ae=async d=>{g(!1),d?(await y(),U.mutate()):(p({}),N(null))};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(fs,{profileName:s,target:G,data:w,settings:c,isLoading:_,isSaving:U.isPending,isTargetSaving:Y.isPending,hasChanges:V,isRawJsonValid:h,onTargetChange:d=>{W||d!==G&&Y.mutate(d)},onRefresh:()=>{W||y()},onDelete:n,onSave:()=>{W||U.mutate()}}),_?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(z,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):A?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load settings."}),e.jsxs(v,{variant:"outline",size:"sm",onClick:()=>y(),children:[e.jsx(J,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):e.jsxs("div",{className:"flex-1 grid grid-cols-[40%_60%] divide-x overflow-hidden",children:[e.jsx("div",{className:"flex flex-col overflow-hidden bg-muted/5 min-w-0",children:e.jsx(ws,{profileName:s,target:G,data:w,currentSettings:c,newEnvKey:u,newEnvValue:k,onNewEnvKeyChange:f,onNewEnvValueChange:b,onEnvValueChange:L,onEnvBulkChange:B,onAddEnvVar:q})}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-2 bg-muted/30 border-b flex items-center gap-2 shrink-0 h-[45px]",children:[e.jsx(cs,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Raw Configuration (JSON)"})]}),e.jsx(Ye,{rawJsonContent:i,isRawJsonValid:h,rawJsonEdits:r,settings:o,onChange:P,missingRequiredFields:Me})]})]}),e.jsx(Z,{open:m,title:"File Modified Externally",description:"Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>ae(!0),onCancel:()=>ae(!1)})]},s)}const je="ccs:openrouter-banner-dismissed";function ys({onCreateClick:s}){const[t,n]=x.useState(!0),{modelCount:a,isLoading:l}=se();x.useEffect(()=>{const m=localStorage.getItem(je)==="true";n(m)},[]);const p=()=>{localStorage.setItem(je,"true"),n(!0)};return t?null:e.jsx("div",{className:"bg-gradient-to-r from-accent to-accent/90 text-white px-4 py-3 relative shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 max-w-screen-xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"p-1.5 bg-white/20 rounded-md shrink-0",children:e.jsx(te,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm",children:"NEW: OpenRouter Integration"}),e.jsxs("p",{className:"text-xs text-white/80 truncate",children:["Browse ",l?"300+":`${a}+`," models from OpenAI, Anthropic, Google, Meta and more."]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s&&e.jsx(v,{size:"sm",variant:"secondary",onClick:s,className:"bg-white text-accent hover:bg-white/90 h-8",children:"Try it now"}),e.jsxs("a",{href:"https://openrouter.ai",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-white/80 hover:text-white hidden sm:flex items-center gap-1",children:["Learn more",e.jsx(ee,{className:"w-3 h-3"})]}),e.jsxs(v,{size:"icon",variant:"ghost",onClick:p,className:"h-7 w-7 text-white/70 hover:text-white hover:bg-white/20",children:[e.jsx(ds,{className:"w-4 h-4"}),e.jsx("span",{className:"sr-only",children:"Dismiss"})]})]})]})})}function ks({onOpenRouterClick:s,onAlibabaCodingPlanClick:t,onCustomClick:n}){const{t:a}=D(),{modelCount:l,isLoading:p}=se();return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20 p-8",children:e.jsxs("div",{className:"max-w-lg w-full space-y-6",children:[e.jsxs(oe,{className:"border-accent/30 dark:border-accent/40 bg-gradient-to-br from-accent/5 to-background dark:from-accent/10",children:[e.jsxs(ce,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-accent/10 dark:bg-accent/20",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"w-6 h-6"})}),e.jsx(S,{variant:"secondary",className:"bg-accent/10 text-accent dark:bg-accent/20 dark:text-accent-foreground",children:a("openrouterQuickStart.recommended")})]}),e.jsx(de,{className:"text-xl",children:a("openrouterQuickStart.title")}),e.jsx(xe,{className:"text-base",children:a("openrouterQuickStart.description",{modelCountLabel:p?"300+":`${l}+`})})]}),e.jsxs(me,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Te,{className:"w-4 h-4 text-accent"}),e.jsx("span",{children:a("openrouterQuickStart.featureOneApi")})]}),e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(te,{className:"w-4 h-4 text-accent"}),e.jsx("span",{children:a("openrouterQuickStart.featureTierMapping")})]})]}),e.jsxs(v,{onClick:s,className:"w-full bg-accent hover:bg-accent/90 text-white",size:"lg",children:[a("openrouterQuickStart.createOpenRouterProfile"),e.jsx(he,{className:"w-4 h-4 ml-2"})]}),e.jsxs("p",{className:"text-xs text-center text-muted-foreground",children:[a("openrouterQuickStart.getApiKeyAt")," ",e.jsxs("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:["openrouter.ai/keys",e.jsx(ee,{className:"w-3 h-3"})]})]})]})]}),e.jsxs(oe,{className:"border-orange-500/30 dark:border-orange-500/40 bg-gradient-to-br from-orange-500/5 to-background dark:from-orange-500/10",children:[e.jsxs(ce,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-orange-500/10 dark:bg-orange-500/20",children:e.jsx("img",{src:"/assets/providers/alibabacloud-color.svg",alt:"Alibaba Coding Plan",className:"w-6 h-6"})}),e.jsx(S,{variant:"secondary",className:"bg-orange-500/10 text-orange-700 dark:bg-orange-500/20 dark:text-orange-200",children:a("alibabaCodingPlanQuickStart.recommended")})]}),e.jsx(de,{className:"text-xl",children:a("alibabaCodingPlanQuickStart.title")}),e.jsx(xe,{className:"text-base",children:a("alibabaCodingPlanQuickStart.description")})]}),e.jsxs(me,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Ee,{className:"w-4 h-4 text-orange-600"}),e.jsx("span",{children:a("alibabaCodingPlanQuickStart.featureEndpoint")})]}),e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(xs,{className:"w-4 h-4 text-orange-600"}),e.jsx("span",{children:a("alibabaCodingPlanQuickStart.featureKeyFormat")})]})]}),e.jsxs(v,{onClick:t,className:"w-full bg-orange-600 hover:bg-orange-600/90 text-white",size:"lg",children:[a("alibabaCodingPlanQuickStart.createAlibabaProfile"),e.jsx(he,{className:"w-4 h-4 ml-2"})]}),e.jsxs("p",{className:"text-xs text-center text-muted-foreground",children:[a("alibabaCodingPlanQuickStart.readGuideAt")," ",e.jsxs("a",{href:"https://www.alibabacloud.com/help/en/model-studio/coding-plan",target:"_blank",rel:"noopener noreferrer",className:"text-orange-700 dark:text-orange-400 hover:underline inline-flex items-center gap-1",children:["Alibaba Cloud Model Studio",e.jsx(ee,{className:"w-3 h-3"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(pe,{className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:a("openrouterQuickStart.or")}),e.jsx(pe,{className:"flex-1"})]}),e.jsx(v,{variant:"outline",onClick:n,className:"w-full",children:a("openrouterQuickStart.createCustomProfile")})]})})}function Ps({onCreateClick:s}){const{modelCount:t,isLoading:n}=se();return e.jsx("div",{className:"p-3 border-t bg-gradient-to-r from-accent/5 to-accent/10 dark:from-accent/10 dark:to-accent/15",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-1.5 bg-accent/10 dark:bg-accent/20 rounded shrink-0",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"",className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-accent dark:text-accent-foreground",children:"OpenRouter"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground truncate",children:[n?"300+":`${t}+`," models available"]})]}),e.jsxs(v,{size:"sm",variant:"ghost",onClick:s,className:"h-7 px-2 text-accent hover:text-accent hover:bg-accent/10 dark:hover:bg-accent/20",children:[e.jsx(Te,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:"Add"})]})]})})}function Ts({onCreateClick:s}){const{t}=D();return e.jsx("div",{className:"p-3 border-t bg-gradient-to-r from-orange-500/5 to-orange-500/10 dark:from-orange-500/10 dark:to-orange-500/15",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-1.5 bg-orange-500/10 dark:bg-orange-500/20 rounded shrink-0",children:e.jsx("img",{src:"/assets/providers/alibabacloud-color.svg",alt:"",className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-orange-700 dark:text-orange-300",children:t("alibabaCodingPlanPromo.title")}),e.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:t("alibabaCodingPlanPromo.subtitle")})]}),e.jsxs(v,{size:"sm",variant:"ghost",onClick:s,className:"h-7 px-2 text-orange-700 dark:text-orange-300 hover:text-orange-700 hover:bg-orange-500/10 dark:hover:bg-orange-500/20",children:[e.jsx(Ee,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:t("alibabaCodingPlanPromo.add")})]})]})})}function Ks(){const{t:s}=D(),{data:t,isLoading:n,isError:a,refetch:l}=We(),p=Xe(),[m,g]=x.useState(null),[r,N]=x.useState(""),[u,f]=x.useState(!1),[k,b]=x.useState("normal"),[j,w]=x.useState(null),[_,A]=x.useState(!1),[y,o]=x.useState(null);Ze();const c=x.useMemo(()=>t?.profiles||[],[t?.profiles]),i=x.useMemo(()=>c.filter(h=>h.name.toLowerCase().includes(r.toLowerCase())),[c,r]),P=m?c.find(h=>h.name===m):null,L=h=>{p.mutate(h,{onSuccess:()=>{m===h&&g(null),w(null)}})},B=h=>{f(!1),_&&m!==null?o(h):g(h)},q=h=>{_&&m!==h?o(h):g(h)};return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex flex-col",children:[e.jsx(ys,{onCreateClick:()=>f(!0)}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ms,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("apiProfiles.title")})]}),e.jsxs(v,{size:"sm",onClick:()=>{f(!0)},children:[e.jsx(Q,{className:"w-4 h-4 mr-1"}),s("apiProfiles.new")]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ke,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(E,{placeholder:s("apiProfiles.searchPlaceholder"),className:"pl-8 h-9",value:r,onChange:h=>N(h.target.value)})]})]}),e.jsx($,{className:"flex-1",children:n?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("apiProfiles.loadingProfiles")}):a?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(Oe,{className:"w-12 h-12 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("apiProfiles.failedLoadTitle")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s("apiProfiles.failedLoadDesc")})]}),e.jsxs(v,{size:"sm",variant:"outline",onClick:()=>l(),children:[e.jsx(J,{className:"w-4 h-4 mr-1"}),s("apiProfiles.retry")]})]})}):i.length===0?e.jsx("div",{className:"p-4 text-center",children:c.length===0?e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(us,{className:"w-12 h-12 mx-auto text-muted-foreground/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("apiProfiles.noProfilesYet")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:s("apiProfiles.noProfilesDesc")})]}),e.jsxs(v,{size:"sm",variant:"outline",onClick:()=>{f(!0)},children:[e.jsx(Q,{className:"w-4 h-4 mr-1"}),s("apiProfiles.createProfile")]})]}):e.jsx("p",{className:"text-sm text-muted-foreground py-4",children:s("apiProfiles.noProfileMatch",{query:r})})}):e.jsx("div",{className:"p-2 space-y-1",children:i.map(h=>e.jsx(Es,{profile:h,isSelected:m===h.name,onSelect:()=>q(h.name),onDelete:()=>w(h.name)},h.name))})}),c.length>0&&e.jsx("div",{className:"p-3 border-t bg-background text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:s("apiProfiles.profileCount",{count:c.length})}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Se,{className:"w-3 h-3 text-green-600"}),s("apiProfiles.configuredCount",{count:c.filter(h=>h.configured).length})]})]})}),e.jsx(Ps,{onCreateClick:()=>{b("openrouter"),f(!0)}}),e.jsx(Ts,{onCreateClick:()=>{b("alibaba-coding-plan"),f(!0)}})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:P?e.jsx(Cs,{profileName:P.name,profileTarget:P.target,onDelete:()=>w(P.name),onHasChangesUpdate:A},P.name):e.jsx(ks,{onOpenRouterClick:()=>{b("openrouter"),f(!0)},onAlibabaCodingPlanClick:()=>{b("alibaba-coding-plan"),f(!0)},onCustomClick:()=>{b("normal"),f(!0)}})})]}),e.jsx(es,{open:u,onOpenChange:f,onSuccess:B,initialMode:k}),e.jsx(Z,{open:!!j,title:s("apiProfiles.deleteProfileTitle"),description:s("apiProfiles.deleteProfileDesc",{name:j??""}),confirmText:s("apiProfiles.delete"),variant:"destructive",onConfirm:()=>j&&L(j),onCancel:()=>w(null)}),e.jsx(Z,{open:!!y,title:s("apiProfiles.unsavedChangesTitle"),description:s("apiProfiles.unsavedChangesDesc",{current:m??"",next:y??""}),confirmText:s("apiProfiles.discardSwitch"),variant:"destructive",onConfirm:()=>{A(!1),g(y),o(null)},onCancel:()=>o(null)})]})}function Es({profile:s,isSelected:t,onSelect:n,onDelete:a}){return e.jsxs("div",{className:O("group flex items-center gap-2 px-3 py-2.5 rounded-md cursor-pointer transition-colors",t?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:n,children:[s.configured?e.jsx(Se,{className:"w-4 h-4 text-green-600 shrink-0"}):e.jsx(Oe,{className:"w-4 h-4 text-yellow-600 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsx(S,{variant:"outline",className:"text-[10px] h-4 px-1.5 uppercase",children:s.target||"claude"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("div",{className:"text-xs text-muted-foreground truncate flex-1",children:s.settingsPath}),e.jsx(R,{value:s.settingsPath,size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),e.jsx(v,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:l=>{l.stopPropagation(),a()},children:e.jsx(ye,{className:"w-3.5 h-3.5 text-destructive"})})]})}export{Ks as ApiPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-BR1vy4kf.js";import{r as n}from"./react-vendor-CNOkPC89.js";import{a as V,bg as W,b7 as X,b9 as Y,n as Z,I as C,d as c}from"./index-DmXx1Pyv.js";import{R as E,a3 as _,u as ee,l as se,E as K,e as T,k as R,m as z,aA as te,a2 as ae,z as ne,ai as re}from"./icons-BYZM_9Gm.js";import"./tanstack-e99Cjjy2.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function pe(){const{t:s}=V(),{fetchRawConfig:o}=W(),[a,D]=n.useState(null),[j,S]=n.useState(!0),[i,m]=n.useState(!1),[p,r]=n.useState(null),[g,f]=n.useState(null),[w,P]=n.useState(!1),[y,O]=n.useState(!1),[d,N]=n.useState(null),[u,v]=n.useState(null),[$,k]=n.useState(!1),[F,b]=n.useState(!1),h=n.useCallback(async()=>{try{S(!0),r(null);const t=await fetch("/api/settings/auth/tokens/raw");if(!t.ok)throw new Error(s("settingsAuth.failedFetchTokens"));const l=await t.json();D(l)}catch(t){r(t instanceof Error?t.message:s("settings.unknownError"))}finally{S(!1)}},[s]);n.useEffect(()=>{h(),o()},[h,o]),n.useEffect(()=>{if(g){const t=setTimeout(()=>f(null),3e3);return()=>clearTimeout(t)}},[g]),n.useEffect(()=>{if(p){const t=setTimeout(()=>r(null),5e3);return()=>clearTimeout(t)}},[p]);const I=async()=>{const t=d!==null&&d!==a?.apiKey.value,l=u!==null&&u!==a?.managementSecret.value;if(!(!t&&!l))try{m(!0),r(null);const x={};t&&(x.apiKey=d),l&&(x.managementSecret=u);const A=await fetch("/api/settings/auth/tokens",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!A.ok){const Q=await A.json();throw new Error(Q.error||s("settingsAuth.failedSaveTokens"))}f(s("settingsAuth.tokensUpdated")),N(null),v(null),await h(),await o()}catch(x){r(x instanceof Error?x.message:s("settings.unknownError"))}finally{m(!1)}},U=async()=>{try{m(!0),r(null);const t=await fetch("/api/settings/auth/tokens/regenerate-secret",{method:"POST"});if(!t.ok){const l=await t.json();throw new Error(l.error||s("settingsAuth.failedRegenerate"))}f(s("settingsAuth.secretRegenerated")),await h(),await o()}catch(t){r(t instanceof Error?t.message:s("settings.unknownError"))}finally{m(!1)}},B=async()=>{try{m(!0),r(null);const t=await fetch("/api/settings/auth/tokens/reset",{method:"POST"});if(!t.ok){const l=await t.json();throw new Error(l.error||s("settingsAuth.failedReset"))}f(s("settingsAuth.tokensReset")),N(null),v(null),await h(),await o()}catch(t){r(t instanceof Error?t.message:s("settings.unknownError"))}finally{m(!1)}},J=async()=>{a&&(await navigator.clipboard.writeText(a.apiKey.value),k(!0),setTimeout(()=>k(!1),2e3))},L=async()=>{a&&(await navigator.clipboard.writeText(a.managementSecret.value),b(!0),setTimeout(()=>b(!1),2e3))},q=async()=>{j||i||(r(null),f(null),await Promise.all([h(),o()]))};if(j||!a)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(E,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:s("settings.loading")})]})});const G=d??a.apiKey.value,H=u??a.managementSecret.value,M=d!==null&&d!==a.apiKey.value||u!==null&&u!==a.managementSecret.value;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${p||g?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[p&&e.jsxs(X,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(_,{className:"h-4 w-4"}),e.jsx(Y,{children:p})]}),g&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:g})]})]}),e.jsx(Z,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("settingsAuth.description")}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"w-4 h-4 text-primary"}),e.jsx("h3",{className:"text-base font-medium",children:s("settingsAuth.apiKey")}),a.apiKey.isCustom&&e.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",children:s("settingsAuth.custom")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("settingsAuth.apiKeyDesc")}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("div",{className:"relative flex-1",children:[e.jsx(C,{type:w?"text":"password",value:G,onChange:t=>N(t.target.value),placeholder:s("settingsAuth.apiKeyPlaceholder"),disabled:i,className:"pr-20 font-mono text-sm"}),e.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1",children:[e.jsx(c,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>P(!w),children:w?e.jsx(K,{className:"w-4 h-4"}):e.jsx(T,{className:"w-4 h-4"})}),e.jsx(c,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:J,disabled:!a.apiKey.value,children:$?e.jsx(R,{className:"w-4 h-4 text-green-600"}):e.jsx(z,{className:"w-4 h-4"})})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{className:"w-4 h-4 text-primary"}),e.jsx("h3",{className:"text-base font-medium",children:s("settingsAuth.managementSecret")}),a.managementSecret.isCustom&&e.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",children:s("settingsAuth.custom")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("settingsAuth.managementSecretDesc")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(C,{type:y?"text":"password",value:H,onChange:t=>v(t.target.value),placeholder:s("settingsAuth.managementSecretPlaceholder"),disabled:i,className:"pr-20 font-mono text-sm"}),e.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1",children:[e.jsx(c,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>O(!y),children:y?e.jsx(K,{className:"w-4 h-4"}):e.jsx(T,{className:"w-4 h-4"})}),e.jsx(c,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:L,disabled:!a.managementSecret.value,children:F?e.jsx(R,{className:"w-4 h-4 text-green-600"}):e.jsx(z,{className:"w-4 h-4"})})]})]}),e.jsx(c,{variant:"outline",size:"sm",onClick:U,disabled:i,title:s("settingsAuth.generateSecret"),children:e.jsx(ae,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"pt-4 border-t",children:[e.jsxs(c,{variant:"outline",size:"sm",onClick:B,disabled:i||!a.apiKey.isCustom&&!a.managementSecret.isCustom,className:"gap-2",children:[e.jsx(ne,{className:"w-4 h-4"}),s("settingsAuth.resetDefaults")]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:s("settingsAuth.resetDesc")})]})]})}),e.jsxs("div",{className:"p-4 border-t bg-background flex gap-2",children:[e.jsxs(c,{variant:"outline",size:"sm",onClick:q,disabled:j||i,className:"flex-1",children:[e.jsx(E,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),s("settings.refresh")]}),e.jsxs(c,{variant:"default",size:"sm",onClick:I,disabled:!M||i,className:"flex-1",children:[e.jsx(re,{className:`w-4 h-4 mr-2 ${i?"animate-pulse":""}`}),s(i?"settingsAuth.saving":"settingsAuth.save")]})]})]})}export{pe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-BR1vy4kf.js";import{r}from"./react-vendor-CNOkPC89.js";import{a as S,bg as E,n as k,S as n,C as g,b7 as R,b9 as D,B as T,d as C}from"./index-DmXx1Pyv.js";import{A as O,a as _,b as z,c as F,d as I,e as P,f as L,g as U}from"./alert-dialog-Cua4nIwu.js";import{a3 as $,u as H,a6 as y,t as M,z as Y,R as J}from"./icons-BYZM_9Gm.js";import"./tanstack-e99Cjjy2.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const q=3e3,G=5e3;function ae(){const{t}=S(),{fetchRawConfig:p}=E(),m=r.useRef(null),d=r.useRef(null),[j,v]=r.useState([]),[f,N]=r.useState(!0),[u,w]=r.useState(null),[i,l]=r.useState(null),[c,b]=r.useState(null),[x,h]=r.useState(null),o=r.useCallback(async()=>{m.current?.abort(),m.current=new AbortController;try{N(!0),l(null);const s=await fetch("/api/persist/backups",{signal:m.current.signal});if(!s.ok)throw new Error(t("settingsBackups.failedFetch"));const a=await s.json();v(a.backups||[])}catch(s){if(s instanceof Error&&s.name==="AbortError")return;l(s instanceof Error?s.message:t("settings.unknownError"))}finally{N(!1)}},[t]),A=r.useCallback(async s=>{d.current?.abort(),d.current=new AbortController;try{w(s),l(null);const a=await fetch("/api/persist/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timestamp:s}),signal:d.current.signal});if(!a.ok){const B=await a.json();throw new Error(B.error||t("settingsBackups.failedRestore"))}b(t("settingsBackups.restoreSuccess")),await o(),await p()}catch(a){if(a instanceof Error&&a.name==="AbortError")return;l(a instanceof Error?a.message:t("settings.unknownError"))}finally{w(null)}},[o,p,t]);return r.useEffect(()=>{o()},[o]),r.useEffect(()=>()=>{m.current?.abort(),d.current?.abort()},[]),r.useEffect(()=>{if(c){const s=setTimeout(()=>b(null),q);return()=>clearTimeout(s)}},[c]),r.useEffect(()=>{if(i){const s=setTimeout(()=>l(null),G);return()=>clearTimeout(s)}},[i]),f?e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{className:"h-6 w-40"}),e.jsx(n,{className:"h-4 w-full"})]}),[1,2,3].map(s=>e.jsx(g,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(n,{className:"h-4 w-32"}),e.jsx(n,{className:"h-3 w-48"})]}),e.jsx(n,{className:"h-8 w-20"})]})},s))]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsx(n,{className:"h-9 w-full"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${i||c?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[i&&e.jsxs(R,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx(D,{children:i})]}),c&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(H,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:c})]})]}),e.jsx(k,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(y,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold",children:t("settingsBackups.title")})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsBackups.description")})]}),j.length===0?e.jsx(g,{className:"p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"w-12 h-12 mx-auto mb-3 opacity-30 text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsBackups.none")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t("settingsBackups.noneHint")})]})}):e.jsx("div",{className:"space-y-2",children:j.map((s,a)=>e.jsx(g,{className:"p-4 hover:bg-muted/50 transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx(M,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-sm font-medium font-mono",children:s.timestamp}),a===0&&e.jsx(T,{variant:"secondary",className:"text-xs",children:t("settingsBackups.latest")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.date})]})]}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>h(s.timestamp),disabled:u!==null,className:"gap-2 shrink-0",children:[e.jsx(Y,{className:`w-4 h-4 ${u===s.timestamp?"animate-spin":""}`}),u===s.timestamp?t("settingsBackups.restoring"):t("settingsBackups.restore")]})]})},s.timestamp))})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>{o(),p()},disabled:f||u!==null,className:"w-full",children:[e.jsx(J,{className:`w-4 h-4 mr-2 ${f?"animate-spin":""}`}),t("settings.refresh")]})}),e.jsx(O,{open:!!x,onOpenChange:()=>h(null),children:e.jsxs(_,{children:[e.jsxs(z,{children:[e.jsx(F,{children:t("settingsBackups.restoreConfirmTitle")}),e.jsxs(I,{children:[t("settingsBackups.restoreConfirmPrefix")," ",e.jsx("code",{className:"font-mono bg-muted px-1.5 py-0.5 rounded text-foreground",children:x}),". ",t("settingsBackups.restoreConfirmSuffix")]})]}),e.jsxs(P,{children:[e.jsx(L,{children:t("settingsBackups.cancel")}),e.jsx(U,{onClick:()=>{x&&A(x),h(null)},children:t("settingsBackups.restore")})]})]})})]})}export{ae as default};
|