@kaitranntt/ccs 7.14.0 → 7.15.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cliproxy/account-manager.d.ts +46 -1
- package/dist/cliproxy/account-manager.d.ts.map +1 -1
- package/dist/cliproxy/account-manager.js +175 -10
- package/dist/cliproxy/account-manager.js.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +65 -3
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/cliproxy/cliproxy-executor.d.ts.map +1 -1
- package/dist/cliproxy/cliproxy-executor.js +18 -23
- package/dist/cliproxy/cliproxy-executor.js.map +1 -1
- package/dist/cliproxy/quota-fetcher.d.ts +3 -1
- package/dist/cliproxy/quota-fetcher.d.ts.map +1 -1
- package/dist/cliproxy/quota-fetcher.js +98 -24
- package/dist/cliproxy/quota-fetcher.js.map +1 -1
- package/dist/cliproxy/quota-manager.d.ts +88 -0
- package/dist/cliproxy/quota-manager.d.ts.map +1 -0
- package/dist/cliproxy/quota-manager.js +278 -0
- package/dist/cliproxy/quota-manager.js.map +1 -0
- package/dist/commands/cliproxy-command.d.ts.map +1 -1
- package/dist/commands/cliproxy-command.js +191 -0
- package/dist/commands/cliproxy-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/config/unified-config-loader.d.ts.map +1 -1
- package/dist/config/unified-config-loader.js +22 -0
- package/dist/config/unified-config-loader.js.map +1 -1
- package/dist/config/unified-config-types.d.ts +62 -2
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +29 -2
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/ui/assets/{accounts-wkvC_Z1E.js → accounts-D31DF_DO.js} +1 -1
- package/dist/ui/assets/{alert-dialog--nlDi-Dj.js → alert-dialog-LCg4HaeZ.js} +1 -1
- package/dist/ui/assets/{api-DeyefOLW.js → api-Bmxcet5w.js} +1 -1
- package/dist/ui/assets/{auth-section-BQXfw1cb.js → auth-section-CRTokeZ8.js} +1 -1
- package/dist/ui/assets/{card-P5vPGo2D.js → card-BmnReIPp.js} +1 -1
- package/dist/ui/assets/cliproxy-BrJaxqVj.js +3 -0
- package/dist/ui/assets/{cliproxy-control-panel-Dbs8NAQa.js → cliproxy-control-panel-D7FGe5HL.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BM75Bkww.js → confirm-dialog-CzpGAyFB.js} +1 -1
- package/dist/ui/assets/{copilot-BwylIlO5.js → copilot-C2v-0P0m.js} +3 -3
- package/dist/ui/assets/{globalenv-section-Cgpz_NQ0.js → globalenv-section-Cx0L1Zte.js} +1 -1
- package/dist/ui/assets/{health-DWUjYWDI.js → health-BvZrzSJ3.js} +1 -1
- package/dist/ui/assets/icons-CZDQWWm2.js +1 -0
- package/dist/ui/assets/index-BX0IVNt5.css +1 -0
- package/dist/ui/assets/{index-CIWe-99u.js → index-CJrvk2Qf.js} +1 -1
- package/dist/ui/assets/{index-D8MFq-UJ.js → index-D8K1YCe7.js} +14 -14
- package/dist/ui/assets/{index-4Wd5fx72.js → index-fED9JOL0.js} +1 -1
- package/dist/ui/assets/{index-f_AuSs01.js → index-qAWtHsB9.js} +1 -1
- package/dist/ui/assets/{shared-I-pAdvVQ.js → shared-Do9VzQ5g.js} +1 -1
- package/dist/ui/assets/{switch-DHwS-NMF.js → switch-CmGBdPfU.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/web-server/index.d.ts.map +1 -1
- package/dist/web-server/index.js +8 -1
- package/dist/web-server/index.js.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +92 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/package.json +1 -1
- package/scripts/code-reviewer.ts +217 -0
- package/dist/ui/assets/cliproxy-CcMLaKpF.js +0 -3
- package/dist/ui/assets/icons-U9n5DGj9.js +0 -1
- package/dist/ui/assets/index-1g-Hy9VA.css +0 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* AI Code Reviewer for CCS CLI
|
|
4
|
+
*
|
|
5
|
+
* Fetches PR diff, calls Claude via CLIProxyAPI, posts review as comment.
|
|
6
|
+
* Runs on self-hosted runner with localhost access to CLIProxyAPI:8317.
|
|
7
|
+
* Posts as ccs-agy-reviewer[bot] via GitHub App token.
|
|
8
|
+
*
|
|
9
|
+
* Usage: bun run scripts/code-reviewer.ts <PR_NUMBER>
|
|
10
|
+
* Env: CLIPROXY_API_KEY, GITHUB_REPOSITORY, GH_TOKEN
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { $ } from 'bun';
|
|
14
|
+
|
|
15
|
+
// Types
|
|
16
|
+
interface PRContext {
|
|
17
|
+
number: number;
|
|
18
|
+
title: string;
|
|
19
|
+
body: string;
|
|
20
|
+
baseRef: string;
|
|
21
|
+
headRef: string;
|
|
22
|
+
files: Array<{ path: string; additions: number; deletions: number }>;
|
|
23
|
+
diff: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Config
|
|
27
|
+
const MAX_DIFF_LINES = 10000;
|
|
28
|
+
const CLIPROXY_URL = process.env.CLIPROXY_URL || 'http://localhost:8317';
|
|
29
|
+
const MODEL = process.env.REVIEW_MODEL || 'gemini-claude-opus-4-5-thinking';
|
|
30
|
+
|
|
31
|
+
// System prompt for code review - new style
|
|
32
|
+
const CODE_REVIEWER_SYSTEM_PROMPT = `You are the CCS AGY Code Reviewer, an expert AI assistant reviewing pull requests for the CCS CLI project.
|
|
33
|
+
|
|
34
|
+
## Review Guidelines
|
|
35
|
+
- Focus ONLY on changes in this PR - don't suggest unrelated improvements
|
|
36
|
+
- Be concise - no fluff, no excessive praise
|
|
37
|
+
- Provide specific file:line references for issues
|
|
38
|
+
- Verify claims before making them (check if patterns exist, check actual code)
|
|
39
|
+
- Avoid over-engineering suggestions for simple fixes
|
|
40
|
+
|
|
41
|
+
## Check For
|
|
42
|
+
1. **Bugs**: Logic errors, edge cases, null handling, race conditions
|
|
43
|
+
2. **Security**: Injection, auth bypass, secrets exposure, data leaks
|
|
44
|
+
3. **Performance**: N+1 queries, missing indexes, inefficient algorithms
|
|
45
|
+
4. **TypeScript**: Proper typing, no \`any\`, null safety
|
|
46
|
+
5. **Consistency**: Similar patterns exist elsewhere that need same fix?
|
|
47
|
+
|
|
48
|
+
## Output Format
|
|
49
|
+
Structure your response EXACTLY like this (no code fences, render as markdown):
|
|
50
|
+
|
|
51
|
+
## 🔍 Code Review
|
|
52
|
+
|
|
53
|
+
**Verdict**: [✅ Approve | ✅ Approve with suggestions | ⚠️ Request changes]
|
|
54
|
+
|
|
55
|
+
### Summary
|
|
56
|
+
[1-2 sentences on what the PR does and if it's correct]
|
|
57
|
+
|
|
58
|
+
### ✅ What's Good
|
|
59
|
+
- [Bullet points, 2-4 items max]
|
|
60
|
+
|
|
61
|
+
### ⚠️ Issues Found
|
|
62
|
+
| File:Line | Issue | Severity |
|
|
63
|
+
|-----------|-------|----------|
|
|
64
|
+
| \`file.ts:123\` | Description | 🔴 High / 🟡 Medium / 🟢 Low |
|
|
65
|
+
|
|
66
|
+
(If no issues, write "None - LGTM")
|
|
67
|
+
|
|
68
|
+
### 💡 Suggestions (Optional)
|
|
69
|
+
- [Only if truly valuable, max 2 items]
|
|
70
|
+
|
|
71
|
+
IMPORTANT: Output ONLY the markdown review. No JSON, no code blocks wrapping the review.`;
|
|
72
|
+
|
|
73
|
+
// Fetch PR context
|
|
74
|
+
async function getPRContext(prNumber: number, repo: string): Promise<PRContext> {
|
|
75
|
+
$.throws(true);
|
|
76
|
+
|
|
77
|
+
// Get PR metadata
|
|
78
|
+
const prJson =
|
|
79
|
+
await $`gh pr view ${prNumber} --repo ${repo} --json number,title,body,baseRefName,headRefName,files`.text();
|
|
80
|
+
const pr = JSON.parse(prJson);
|
|
81
|
+
|
|
82
|
+
// Get diff
|
|
83
|
+
let diff = await $`gh pr diff ${prNumber} --repo ${repo}`.text();
|
|
84
|
+
|
|
85
|
+
// Truncate if too large
|
|
86
|
+
const lines = diff.split('\n');
|
|
87
|
+
if (lines.length > MAX_DIFF_LINES) {
|
|
88
|
+
diff = lines.slice(0, MAX_DIFF_LINES).join('\n') + '\n\n[DIFF TRUNCATED - exceeded 10k lines]';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
number: pr.number,
|
|
93
|
+
title: pr.title,
|
|
94
|
+
body: pr.body || '',
|
|
95
|
+
baseRef: pr.baseRefName,
|
|
96
|
+
headRef: pr.headRefName,
|
|
97
|
+
files: pr.files || [],
|
|
98
|
+
diff,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Call Claude via CLIProxyAPI
|
|
103
|
+
async function callClaude(context: PRContext, repo: string): Promise<string> {
|
|
104
|
+
const apiKey = process.env.CLIPROXY_API_KEY;
|
|
105
|
+
if (!apiKey) throw new Error('CLIPROXY_API_KEY not set');
|
|
106
|
+
|
|
107
|
+
const userMessage = `REPO: ${repo}
|
|
108
|
+
PR NUMBER: ${context.number}
|
|
109
|
+
|
|
110
|
+
## Pull Request: ${context.title}
|
|
111
|
+
|
|
112
|
+
### Description
|
|
113
|
+
${context.body || '(No description provided)'}
|
|
114
|
+
|
|
115
|
+
### Changed Files
|
|
116
|
+
${context.files.map((f) => `- ${f.path} (+${f.additions}/-${f.deletions})`).join('\n')}
|
|
117
|
+
|
|
118
|
+
### Diff
|
|
119
|
+
\`\`\`diff
|
|
120
|
+
${context.diff}
|
|
121
|
+
\`\`\`
|
|
122
|
+
|
|
123
|
+
Review this PR following the guidelines. Refer to the project's CLAUDE.md and docs/ folder for conventions.`;
|
|
124
|
+
|
|
125
|
+
const response = await fetch(`${CLIPROXY_URL}/v1/messages`, {
|
|
126
|
+
method: 'POST',
|
|
127
|
+
headers: {
|
|
128
|
+
'x-api-key': apiKey,
|
|
129
|
+
'anthropic-version': '2023-06-01',
|
|
130
|
+
'content-type': 'application/json',
|
|
131
|
+
},
|
|
132
|
+
body: JSON.stringify({
|
|
133
|
+
model: MODEL,
|
|
134
|
+
max_tokens: 4096,
|
|
135
|
+
system: CODE_REVIEWER_SYSTEM_PROMPT,
|
|
136
|
+
messages: [{ role: 'user', content: userMessage }],
|
|
137
|
+
}),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
if (!response.ok) {
|
|
141
|
+
const error = await response.text();
|
|
142
|
+
throw new Error(`CLIProxyAPI error: ${response.status} - ${error}`);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const data = (await response.json()) as { content: Array<{ text: string }> };
|
|
146
|
+
const content = data.content[0]?.text;
|
|
147
|
+
|
|
148
|
+
if (!content) {
|
|
149
|
+
throw new Error('Empty response from Claude');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return content;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Post review as PR comment
|
|
156
|
+
async function postReview(prNumber: number, repo: string, reviewContent: string): Promise<void> {
|
|
157
|
+
// Use gh pr comment to post the review
|
|
158
|
+
await $`gh pr comment ${prNumber} --repo ${repo} --body ${reviewContent}`;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Check if already reviewed this PR (avoid spam)
|
|
162
|
+
async function hasRecentReview(prNumber: number, repo: string): Promise<boolean> {
|
|
163
|
+
try {
|
|
164
|
+
const comments =
|
|
165
|
+
await $`gh api repos/${repo}/issues/${prNumber}/comments --jq '[.[] | select(.body | contains("🔍 Code Review"))] | length'`.text();
|
|
166
|
+
return parseInt(comments.trim(), 10) > 0;
|
|
167
|
+
} catch {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Main
|
|
173
|
+
async function main() {
|
|
174
|
+
const prNumber = parseInt(process.argv[2], 10);
|
|
175
|
+
const repo = process.env.GITHUB_REPOSITORY || 'kaitranntt/ccs';
|
|
176
|
+
const forceReview = process.argv.includes('--force');
|
|
177
|
+
|
|
178
|
+
if (!prNumber || isNaN(prNumber)) {
|
|
179
|
+
console.error('Usage: bun run scripts/code-reviewer.ts <PR_NUMBER> [--force]');
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
console.log(`[i] Reviewing PR #${prNumber} in ${repo}`);
|
|
184
|
+
|
|
185
|
+
try {
|
|
186
|
+
// Check for existing review (avoid spam)
|
|
187
|
+
if (!forceReview && (await hasRecentReview(prNumber, repo))) {
|
|
188
|
+
console.log('[i] Already reviewed this PR. Use --force to review again.');
|
|
189
|
+
process.exit(0);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// 1. Get PR context
|
|
193
|
+
console.log('[i] Fetching PR context...');
|
|
194
|
+
const context = await getPRContext(prNumber, repo);
|
|
195
|
+
console.log(`[i] PR: "${context.title}" (${context.files.length} files changed)`);
|
|
196
|
+
|
|
197
|
+
const diffLines = context.diff.split('\n').length;
|
|
198
|
+
if (diffLines > MAX_DIFF_LINES) {
|
|
199
|
+
console.log(`[!] Diff too large (${diffLines} lines), truncated to ${MAX_DIFF_LINES}`);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// 2. Call Claude
|
|
203
|
+
console.log(`[i] Calling Claude (${MODEL}) for review...`);
|
|
204
|
+
const reviewContent = await callClaude(context, repo);
|
|
205
|
+
console.log('[i] Review generated');
|
|
206
|
+
|
|
207
|
+
// 3. Post review as comment
|
|
208
|
+
console.log('[i] Posting review to PR...');
|
|
209
|
+
await postReview(prNumber, repo, reviewContent);
|
|
210
|
+
console.log('[OK] Review posted successfully');
|
|
211
|
+
} catch (error) {
|
|
212
|
+
console.error('[X] Review failed:', error);
|
|
213
|
+
process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
main();
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e,W as ps,X as hs,Y as gs,Z as fs,_ as js}from"./radix-ui-CBgg0XeO.js";import{r as p}from"./react-vendor-B_CU-WTZ.js";import{u as Ve,a as de,b as vs}from"./tanstack-CxYN0q6L.js";import{a as v,c as O,P as me,L as ee,I as ue,O as xe,Q as pe,U as he,V as ge,W as se,X as Ge,Y as Ns,Z as Ke,_ as $e,u as qe,$ as fe,a0 as je,a1 as ve,a2 as Ne,a3 as ze,a4 as ws,a5 as Te,a6 as De,B as L,a7 as bs,m as Qe,i as we,h as ys,a8 as Cs,a9 as ks,aa as As,ab as Be,T as Je,k as We,ac as Ss,l as Ye,ad as Ps,ae as Ms,af as X,ag as Os,ah as Ts,ai as Ds,aj as _s,D as Is,E as Es,F as _e,G as Ie,ak as Ls,al as Rs,am as Fs,an as Us,ao as Hs,ap as Vs,aq as Gs,ar as Ks,y as $s,A as qs,as as zs,at as Qs,au as Bs,av as Js,S as Ws}from"./index-D8MFq-UJ.js";import{t as F}from"./notifications-dJQY2-U6.js";import{b as Xe,L as $,m as be,t as Ys,j as q,l as Xs,ag as ye,a0 as K,ah as z,Q as J,ai as Ze,aj as te,Z as ae,I as Zs,f as et,Y as Ce,ak as st,aa as tt,X as ne,O as es,q as Z,al as at,a9 as ss,n as nt,am as it,ad as rt,A as ot,an as lt,ao as ct,S as dt,ap as Ee,aq as mt,ar as ut,U as xt,T as Le,as as ts}from"./icons-U9n5DGj9.js";import{C as as,a as ns}from"./card-P5vPGo2D.js";import{S as ke,C as pt}from"./confirm-dialog-BM75Bkww.js";import{S as ht}from"./switch-DHwS-NMF.js";import{A as gt,a as ft,b as jt,c as vt,d as Nt,e as wt,f as bt,g as yt}from"./alert-dialog--nlDi-Dj.js";import"./utils-CzKF5WmX.js";import"./form-utils-kUVlZZAO.js";import"./code-highlight-DKN39ySy.js";const B={agy:{provider:"agy",displayName:"Antigravity",defaultModel:"gemini-claude-opus-4-5-thinking",models:[{id:"gemini-claude-opus-4-5-thinking",name:"Claude Opus 4.5 Thinking",description:"Most capable, extended thinking",presetMapping:{default:"gemini-claude-opus-4-5-thinking",opus:"gemini-claude-opus-4-5-thinking",sonnet:"gemini-claude-sonnet-4-5-thinking",haiku:"gemini-claude-sonnet-4-5"}},{id:"gemini-claude-sonnet-4-5-thinking",name:"Claude Sonnet 4.5 Thinking",description:"Balanced with extended thinking",presetMapping:{default:"gemini-claude-sonnet-4-5-thinking",opus:"gemini-claude-opus-4-5-thinking",sonnet:"gemini-claude-sonnet-4-5-thinking",haiku:"gemini-claude-sonnet-4-5"}},{id:"gemini-claude-sonnet-4-5",name:"Claude Sonnet 4.5",description:"Fast and capable",presetMapping:{default:"gemini-claude-sonnet-4-5",opus:"gemini-claude-opus-4-5-thinking",sonnet:"gemini-claude-sonnet-4-5",haiku:"gemini-claude-sonnet-4-5"}},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro",description:"Google latest model via Antigravity",presetMapping:{default:"gemini-3-pro-preview",opus:"gemini-3-pro-preview",sonnet:"gemini-3-pro-preview",haiku:"gemini-3-flash-preview"}},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash",description:"Fast Gemini model via Antigravity",presetMapping:{default:"gemini-3-flash-preview",opus:"gemini-3-pro-preview",sonnet:"gemini-3-pro-preview",haiku:"gemini-3-flash-preview"}}]},gemini:{provider:"gemini",displayName:"Gemini",defaultModel:"gemini-2.5-pro",models:[{id:"gemini-3-pro-preview",name:"Gemini 3 Pro",tier:"paid",description:"Latest model, requires paid Google account",presetMapping:{default:"gemini-3-pro-preview",opus:"gemini-3-pro-preview",sonnet:"gemini-3-pro-preview",haiku:"gemini-3-flash-preview"}},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash",tier:"paid",description:"Fast Gemini 3 model, requires paid Google account",presetMapping:{default:"gemini-3-flash-preview",opus:"gemini-3-pro-preview",sonnet:"gemini-3-pro-preview",haiku:"gemini-3-flash-preview"}},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Stable, works with free Google account",presetMapping:{default:"gemini-2.5-pro",opus:"gemini-2.5-pro",sonnet:"gemini-2.5-pro",haiku:"gemini-2.5-flash"}}]},codex:{provider:"codex",displayName:"Codex",defaultModel:"gpt-5.1-codex-max",models:[{id:"gpt-5.1-codex-max",name:"Codex Max (5.1)",description:"Most capable Codex model",presetMapping:{default:"gpt-5.1-codex-max",opus:"gpt-5.1-codex-max-high",sonnet:"gpt-5.1-codex-max",haiku:"gpt-5.1-codex-mini-high"}},{id:"gpt-5.2",name:"GPT 5.2",description:"Latest GPT model",presetMapping:{default:"gpt-5.2",opus:"gpt-5.2",sonnet:"gpt-5.2",haiku:"gpt-5.2"}},{id:"gpt-5.1-codex-mini",name:"Codex Mini",description:"Fast and efficient Codex model"}]},qwen:{provider:"qwen",displayName:"Qwen",defaultModel:"qwen-coder-plus",models:[{id:"qwen-coder-plus",name:"Qwen Coder Plus",description:"Alibaba code-focused model"},{id:"qwen-max",name:"Qwen Max",description:"Most capable Qwen model"}]},iflow:{provider:"iflow",displayName:"iFlow",defaultModel:"iflow-default",models:[{id:"iflow-default",name:"iFlow Default",description:"Default iFlow model"}]},kiro:{provider:"kiro",displayName:"Kiro (AWS)",defaultModel:"kiro-claude-sonnet-4-5",models:[{id:"kiro-claude-opus-4-5",name:"Kiro Claude Opus 4.5",description:"Claude Opus 4.5 via Kiro (2.2x credit)",presetMapping:{default:"kiro-claude-opus-4-5",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4-5",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-sonnet-4-5",name:"Kiro Claude Sonnet 4.5",description:"Claude Sonnet 4.5 via Kiro (1.3x credit)",presetMapping:{default:"kiro-claude-sonnet-4-5",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4-5",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-sonnet-4",name:"Kiro Claude Sonnet 4",description:"Claude Sonnet 4 via Kiro (1.3x credit)",presetMapping:{default:"kiro-claude-sonnet-4",opus:"kiro-claude-opus-4-5",sonnet:"kiro-claude-sonnet-4",haiku:"kiro-claude-haiku-4-5"}},{id:"kiro-claude-haiku-4-5",name:"Kiro Claude Haiku 4.5",description:"Claude Haiku 4.5 via Kiro (0.4x credit)"}]},ghcp:{provider:"ghcp",displayName:"GitHub Copilot (OAuth)",defaultModel:"claude-sonnet-4.5",models:[{id:"claude-opus-4.5",name:"Claude Opus 4.5",description:"Anthropic Claude Opus 4.5 via GitHub Copilot",presetMapping:{default:"claude-opus-4.5",opus:"claude-opus-4.5",sonnet:"claude-sonnet-4.5",haiku:"claude-haiku-4.5"}},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",description:"Anthropic Claude Sonnet 4.5 via GitHub Copilot",presetMapping:{default:"claude-sonnet-4.5",opus:"claude-opus-4.5",sonnet:"claude-sonnet-4.5",haiku:"claude-haiku-4.5"}},{id:"claude-sonnet-4",name:"Claude Sonnet 4",description:"Anthropic Claude Sonnet 4 via GitHub Copilot"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",description:"Anthropic Claude Haiku 4.5 via GitHub Copilot"},{id:"gpt-5.2",name:"GPT-5.2",description:"OpenAI GPT-5.2 via GitHub Copilot",presetMapping:{default:"gpt-5.2",opus:"gpt-5.2",sonnet:"gpt-5.1",haiku:"gpt-5-mini"}},{id:"gpt-5.1",name:"GPT-5.1",description:"OpenAI GPT-5.1 via GitHub Copilot"},{id:"gpt-5",name:"GPT-5",description:"OpenAI GPT-5 via GitHub Copilot"},{id:"gpt-5-mini",name:"GPT-5 Mini",description:"OpenAI GPT-5 Mini via GitHub Copilot"},{id:"gemini-3-pro",name:"Gemini 3 Pro",description:"Google Gemini 3 Pro via GitHub Copilot"}]}},le=8317,ie="ccs-internal-managed";async function Ct(){try{const s=await fetch("/api/settings/auth/tokens/raw");return s.ok?(await s.json())?.apiKey?.value??ie:ie}catch{return ie}}async function ce(s,n){const t=B[s];if(!t)return{success:!1};const a=t.models[0],i=a?.presetMapping||{default:t.defaultModel,opus:t.defaultModel,sonnet:t.defaultModel,haiku:t.defaultModel},o=await Ct(),d={env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${le}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:o,ANTHROPIC_MODEL:i.default,ANTHROPIC_DEFAULT_OPUS_MODEL:i.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:i.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:i.haiku}};try{return{success:(await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:d})})).ok,presetName:a?.name||t.defaultModel}}catch{return{success:!1}}}const Re=[{id:"gemini",name:"Google Gemini",description:"Gemini Pro/Flash models"},{id:"codex",name:"OpenAI Codex",description:"GPT-4 and codex models"},{id:"agy",name:"Antigravity",description:"Antigravity AI models"},{id:"qwen",name:"Alibaba Qwen",description:"Qwen Code models"},{id:"iflow",name:"iFlow",description:"iFlow AI models"},{id:"kiro",name:"Kiro (AWS)",description:"AWS CodeWhisperer models"},{id:"ghcp",name:"GitHub Copilot (OAuth)",description:"GitHub Copilot via OAuth"}],is=["provider","auth","variant","success"];function kt(s){return s==="account"?1:is.indexOf(s)}function At({currentProgress:s,allSteps:n}){return e.jsx("div",{className:"flex justify-center gap-1 pt-2",children:n.map((t,a)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${s>=a?"bg-primary":"bg-muted"}`},t))})}function St({providers:s,onSelect:n}){return e.jsx("div",{className:"grid gap-2",children:s.map(t=>e.jsxs("button",{onClick:()=>n(t.id),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t.description})]}),e.jsx(Xe,{className:"w-4 h-4 text-muted-foreground"})]},t.id))})}function Pt({selectedProvider:s,providers:n,authCommand:t,isRefreshing:a,isPending:i,onBack:o,onStartAuth:l,onRefresh:d}){const[r,u]=p.useState(!1),h=async m=>{await navigator.clipboard.writeText(m),u(!0),setTimeout(()=>u(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Authenticate with ",n.find(m=>m.id===s)?.name," to add an account"]}),e.jsx(v,{onClick:l,disabled:i,className:"w-full gap-2",size:"lg",children:i?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-4 h-4 animate-spin"}),"Authenticating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"w-4 h-4"}),"Authenticate in Browser"]})}),i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Complete the OAuth flow in your browser..."})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or use terminal"})})]}),e.jsx(as,{children:e.jsxs(ns,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ys,{className:"w-4 h-4"}),"Run this command in your terminal:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:t}),e.jsx(v,{variant:"outline",size:"icon",onClick:()=>h(t),children:r?e.jsx(q,{className:"w-4 h-4 text-green-500"}):e.jsx(Xs,{className:"w-4 h-4"})})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(v,{variant:"ghost",onClick:o,disabled:i,children:[e.jsx(ye,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs(v,{variant:"outline",onClick:d,disabled:a||i,children:[e.jsx(K,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),a?"Checking...":"Refresh Status"]})]})]})}function Mt({accounts:s,privacyMode:n,onSelect:t,onAddNew:a,onBack:i}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Select an account (",s.length,")"]}),e.jsx("div",{className:"grid gap-2",children:s.map(o=>e.jsxs("button",{type:"button",onClick:()=>t(o),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center",children:e.jsx(z,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("div",{className:O("font-medium",n&&me),children:o.email||o.id}),o.isDefault&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Default account"})]})]}),e.jsx(Xe,{className:"w-4 h-4 text-muted-foreground"})]},o.id))}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or"})})]}),e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 p-3 border-2 border-dashed border-primary/50 rounded-lg hover:border-primary hover:bg-primary/5 transition-colors text-left",onClick:a,children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(be,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-primary",children:"Add new account"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Authenticate with a different account"})]})]}),e.jsx("div",{className:"flex items-center justify-between pt-2",children:e.jsxs(v,{variant:"ghost",onClick:i,children:[e.jsx(ye,{className:"w-4 h-4 mr-2"}),"Back"]})})]})}function Ot({selectedProvider:s,selectedAccount:n,variantName:t,modelName:a,isPending:i,privacyMode:o,onVariantNameChange:l,onModelChange:d,onBack:r,onSkip:u,onCreate:h}){return e.jsxs("div",{className:"space-y-4",children:[n&&e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx(z,{className:"w-4 h-4"}),e.jsxs("span",{children:["Using:"," ",e.jsx("span",{className:O(o&&me),children:n.email||n.id})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"variant-name",children:"Variant Name *"}),e.jsx(ue,{id:"variant-name",value:t,onChange:m=>l(m.target.value),placeholder:"e.g., my-gemini, g3, flash"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Use this name to invoke: ccs ",t||"<name>",' "prompt"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{children:"Model"}),e.jsxs(xe,{value:a,onValueChange:d,children:[e.jsx(pe,{children:e.jsx(he,{placeholder:"Select a model"})}),e.jsx(ge,{children:B[s]?.models.map(m=>e.jsx(se,{value:m.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:m.name}),m.description&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["- ",m.description]})]})},m.id))})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Default: ",B[s]?.defaultModel||"provider default"]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsxs(v,{variant:"ghost",onClick:r,children:[e.jsx(ye,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{variant:"ghost",onClick:u,children:"Skip"}),e.jsx(v,{onClick:h,disabled:!t||i,children:i?"Creating...":"Create Variant"})]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Skip if you just wanted to add an account without creating a variant"})]})}function Tt({variantName:s,onClose:n}){return e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center",children:e.jsx(q,{className:"w-8 h-8 text-green-600 dark:text-green-400"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-lg",children:"Variant Created!"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Your custom variant is ready to use"})]}),e.jsx(as,{children:e.jsxs(ns,{className:"p-4 space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Usage:"}),e.jsxs("code",{className:"block px-3 py-2 bg-muted rounded-md font-mono text-sm",children:["ccs ",s,' "your prompt here"']})]})}),e.jsx(v,{onClick:n,className:"w-full",children:"Done"})]})}function Dt({open:s,onClose:n}){const[t,a]=p.useState("provider"),[i,o]=p.useState(""),[l,d]=p.useState(null),[r,u]=p.useState(""),[h,m]=p.useState(""),[f,c]=p.useState(!1),[w,S]=p.useState(!1),{data:g,refetch:_}=Ge(),A=Ns(),T=Ke(),N=$e(),{privacyMode:b}=qe(),k=g?.authStatus.find(y=>y.provider===i),P=p.useMemo(()=>k?.accounts||[],[k?.accounts]);p.useEffect(()=>{if(!s){const y=setTimeout(()=>{a("provider"),o(""),d(null),u(""),m(""),S(!1)},0);return()=>clearTimeout(y)}},[s]),p.useEffect(()=>{if(t==="auth"&&P.length>0&&!w){const y=setTimeout(()=>{a("account")},0);return()=>clearTimeout(y)}},[t,P,w]);const j=async()=>{c(!0),await _(),c(!1)},M=()=>{const y=(k?.accounts?.length||0)===0;T.mutate({provider:i},{onSuccess:async Q=>{if(y){const G=await ce(i);G.success&&G.presetName?F.success(`Applied "${G.presetName}" preset`):G.success||F.warning("Account added, but failed to apply default preset")}Q.account&&(d(Q.account),a("variant")),_()}})},x=y=>{o(y),(g?.authStatus.find(W=>W.provider===y)?.accounts||[]).length===0?a("auth"):a("account")},E=y=>{d(y),a("variant")},V=async()=>{if(!(!r||!i))try{await A.mutateAsync({name:r,provider:i,model:h||void 0,account:l?.id}),a("success")}catch(y){console.error("Failed to create variant:",y)}},R=`ccs ${i} --auth --add`,C=kt(t),I=y=>{if(!y&&(T.isPending&&i&&N.mutate(i),t==="success"||t==="provider")){n();return}};return e.jsx(fe,{open:s,onOpenChange:I,children:e.jsxs(je,{className:"sm:max-w-lg",onPointerDownOutside:y=>{t!=="success"&&t!=="provider"&&y.preventDefault()},onEscapeKeyDown:y=>{(T.isPending||A.isPending)&&y.preventDefault()},children:[e.jsxs(ve,{children:[e.jsxs(Ne,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-5 h-5 text-primary"}),"Quick Setup Wizard"]}),e.jsxs(ze,{children:[t==="provider"&&"Select a provider to get started",t==="auth"&&"Authenticate with your provider",t==="account"&&"Select which account to use",t==="variant"&&"Create your custom variant",t==="success"&&"Setup complete!"]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[t==="provider"&&e.jsx(St,{providers:Re,onSelect:x}),t==="auth"&&e.jsx(Pt,{selectedProvider:i,providers:Re,authCommand:R,isRefreshing:f,isPending:T.isPending,onBack:()=>a("provider"),onStartAuth:M,onRefresh:j}),t==="account"&&e.jsx(Mt,{accounts:P,privacyMode:b,onSelect:E,onAddNew:()=>{S(!0),a("auth")},onBack:()=>a("provider")}),t==="variant"&&e.jsx(Ot,{selectedProvider:i,selectedAccount:l,variantName:r,modelName:h,isPending:A.isPending,privacyMode:b,onVariantNameChange:u,onModelChange:m,onBack:()=>P.length>0?a("account"):a("provider"),onSkip:n,onCreate:V}),t==="success"&&e.jsx(Tt,{variantName:r,onClose:n})]}),e.jsx(At,{currentProgress:C,allSteps:is})]})})}function _t({open:s,onClose:n,provider:t,displayName:a,isFirstAccount:i=!1}){const[o,l]=p.useState(""),d=Ke(),r=ws(),u=$e(),h=t==="kiro",m=d.isPending||r.isPending,f=()=>{m&&u.mutate(t),l(""),n()},c=()=>{d.mutate({provider:t,nickname:o.trim()||void 0},{onSuccess:async()=>{const g=await ce(t);g.success&&g.presetName?i&&F.success(`Applied "${g.presetName}" preset`):g.success||F.warning("Account added, but failed to apply default preset. You may need to configure settings manually."),l(""),n()}})},w=()=>{r.mutate(void 0,{onSuccess:async()=>{const g=await ce("kiro");g.success&&g.presetName&&i&&F.success(`Applied "${g.presetName}" preset`),l(""),n()}})},S=g=>{g||f()};return e.jsx(fe,{open:s,onOpenChange:S,children:e.jsxs(je,{className:"sm:max-w-md",children:[e.jsxs(ve,{children:[e.jsxs(Ne,{children:["Add ",a," Account"]}),e.jsx(ze,{children:h?"Authenticate via browser or import an existing token from Kiro IDE.":"Click the button below to authenticate a new account. A browser window will open for OAuth."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"nickname",children:"Nickname (optional)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(ue,{id:"nickname",value:o,onChange:g=>l(g.target.value),placeholder:"e.g., work, personal",disabled:m,className:"flex-1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A friendly name to identify this account. Auto-generated from email if left empty."})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[e.jsx(v,{variant:"ghost",onClick:f,children:"Cancel"}),h&&e.jsx(v,{variant:"outline",onClick:w,disabled:m,children:r.isPending?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-4 h-4 mr-2 animate-spin"}),"Importing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ze,{className:"w-4 h-4 mr-2"}),"Import from IDE"]})}),e.jsx(v,{onClick:c,disabled:m,children:d.isPending?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-4 h-4 mr-2 animate-spin"}),"Authenticating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"w-4 h-4 mr-2"}),"Authenticate"]})})]}),d.isPending&&e.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Complete the OAuth flow in your browser..."}),r.isPending&&e.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Importing token from Kiro IDE..."})]})]})})}const It=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"];function Et(s){const n=s?.env||{};return It.filter(t=>!n[t]?.trim())}function Lt(s){const[n,t]=p.useState(null),[a,i]=p.useState(!1),o=Ve(),{data:l,isLoading:d,refetch:r}=de({queryKey:["settings",s],queryFn:async()=>{const j=await fetch(`/api/settings/${s}/raw`);return j.ok?j.json():{profile:s,settings:{env:{}},mtime:Date.now(),path:`~/.ccs/profiles/${s}/settings.json`}}}),u=l?.settings,h=p.useMemo(()=>n!==null?n:u?JSON.stringify(u,null,2):`{
|
|
2
|
-
"env": {}
|
|
3
|
-
}`,[n,u]),m=p.useCallback(j=>{t(j)},[]),f=p.useMemo(()=>{try{return JSON.parse(h)}catch{return u||{env:{}}}},[h,u]),c=f?.env?.ANTHROPIC_MODEL,w=f?.env?.ANTHROPIC_DEFAULT_OPUS_MODEL,S=f?.env?.ANTHROPIC_DEFAULT_SONNET_MODEL,g=f?.env?.ANTHROPIC_DEFAULT_HAIKU_MODEL,_=p.useCallback((j,M)=>{const x={...f?.env||{},[j]:M},E={...f,env:x};t(JSON.stringify(E,null,2))},[f]),A=p.useCallback(j=>{const M={...f?.env||{},...j},x={...f,env:M};t(JSON.stringify(x,null,2))},[f]),T=p.useMemo(()=>{try{return JSON.parse(h),!0}catch{return!1}},[h]),N=p.useMemo(()=>n===null?!1:n!==JSON.stringify(u,null,2),[n,u]),b=p.useMemo(()=>Et(f),[f]),k=vs({mutationFn:async()=>{const j=JSON.parse(h),M=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:j,expectedMtime:l?.mtime})});if(M.status===409)throw new Error("CONFLICT");if(!M.ok)throw new Error("Failed to save");return M.json()},onSuccess:j=>{o.invalidateQueries({queryKey:["settings",s]}),t(null),j?.warning?F.success("Settings saved",{description:j.warning}):F.success("Settings saved")},onError:j=>{j.message==="CONFLICT"?i(!0):F.error(j.message)}}),P=async j=>{i(!1),j?(await r(),k.mutate()):t(null)};return{data:l,isLoading:d,refetch:r,rawJsonContent:h,rawJsonEdits:n,isRawJsonValid:T,hasChanges:N,currentSettings:f,currentModel:c,opusModel:w,sonnetModel:S,haikuModel:g,handleRawJsonChange:m,updateEnvValue:_,updateEnvValues:A,saveMutation:{mutate:()=>k.mutate(),isPending:k.isPending},conflictDialog:a,setConflictDialog:i,handleConflictResolve:P,missingRequiredFields:b}}function H({label:s,description:n,value:t,onChange:a,catalog:i,allModels:o,disabled:l}){const d=new Set(i?.models.map(r=>r.id)||[]);return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium",children:s}),n&&e.jsx("p",{className:"text-[10px] text-muted-foreground",children:n})]}),e.jsxs(xe,{value:t||"",onValueChange:a,disabled:l,children:[e.jsx(pe,{className:"h-9",children:e.jsx(he,{placeholder:"Select model",children:t&&e.jsx("span",{className:"truncate font-mono text-xs",children:t})})}),e.jsxs(ge,{className:"max-h-[300px]",children:[i&&i.models.length>0&&e.jsxs(Te,{children:[e.jsx(De,{className:"text-xs text-primary",children:"Recommended"}),i.models.map(r=>e.jsx(se,{value:r.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:r.id}),r.tier==="paid"&&e.jsx(L,{variant:"outline",className:"text-[9px] h-4 px-1",children:"PAID"}),t===r.id&&e.jsx(q,{className:"w-3 h-3 text-primary ml-auto"})]})},r.id))]}),o.length>0&&e.jsxs(Te,{children:[e.jsxs(De,{className:"text-xs text-muted-foreground",children:["All Models (",o.length,")"]}),o.filter(r=>!d.has(r.id)).map(r=>e.jsx(se,{value:r.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:r.id}),t===r.id&&e.jsx(q,{className:"w-3 h-3 text-primary ml-auto"})]})},r.id))]}),(!i||i.models.length===0)&&o.length===0&&e.jsx("div",{className:"py-2 px-3 text-xs text-muted-foreground",children:"No models available"})]})]})]})}function Rt({open:s,onClose:n,currentValues:t,onApply:a,onSave:i,isSaving:o,catalog:l,allModels:d}){const[r,u]=p.useState(t),[h,m]=p.useState(""),f=c=>{c?(u(t),m("")):n()};return e.jsx(fe,{open:s,onOpenChange:f,children:e.jsxs(je,{className:"sm:max-w-md",children:[e.jsx(ve,{children:e.jsxs(Ne,{className:"flex items-center gap-2",children:[e.jsx(J,{className:"w-4 h-4"}),"Custom Preset"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ee,{htmlFor:"preset-name",children:"Preset Name (optional)"}),e.jsx(ue,{id:"preset-name",value:h,onChange:c=>m(c.target.value),placeholder:"e.g., My Custom Config",className:"text-sm"})]}),e.jsx(ke,{}),e.jsx(H,{label:"Default Model",description:"Used when no specific tier is requested",value:r.default,onChange:c=>u({...r,default:c}),catalog:l,allModels:d}),e.jsx(H,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:r.opus,onChange:c=>u({...r,opus:c}),catalog:l,allModels:d}),e.jsx(H,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:r.sonnet,onChange:c=>u({...r,sonnet:c}),catalog:l,allModels:d}),e.jsx(H,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:r.haiku,onChange:c=>u({...r,haiku:c}),catalog:l,allModels:d})]}),e.jsxs(bs,{className:"gap-2 sm:gap-0",children:[e.jsx(v,{variant:"outline",onClick:n,children:"Cancel"}),i&&e.jsxs(v,{variant:"secondary",onClick:()=>i(r,h||void 0),disabled:o||!h.trim(),children:[o?e.jsx($,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(te,{className:"w-4 h-4 mr-1"}),"Save Preset"]}),e.jsxs(v,{onClick:()=>a(r,h||void 0),children:[e.jsx(ae,{className:"w-4 h-4 mr-1"}),"Apply Preset"]})]})]})})}function Y({label:s,command:n}){return e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:s}),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:n}),e.jsx(Qe,{value:n,size:"icon",className:"h-6 w-6"})]})]})}function Ft({provider:s,displayName:n,data:t,authStatus:a}){return e.jsx(we,{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(Zs,{className:"w-4 h-4"}),"Provider Information"]}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Provider"}),e.jsx("span",{className:"font-mono",children:n})]}),t&&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:"File Path"}),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:t.path}),e.jsx(Qe,{value:t.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:"Last Modified"}),e.jsx("span",{className:"text-xs",children:new Date(t.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:"Status"}),a.authenticated?e.jsxs(L,{variant:"outline",className:"w-fit text-green-600 border-green-200 bg-green-50",children:[e.jsx(et,{className:"w-3 h-3 mr-1"}),"Authenticated"]}):e.jsx(L,{variant:"outline",className:"w-fit text-muted-foreground",children:"Not connected"})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:"Quick Usage"}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsx(Y,{label:"Run with prompt",command:`ccs ${s} "your prompt"`}),e.jsx(Y,{label:"Change model",command:`ccs ${s} --config`}),e.jsx(Y,{label:"Add account",command:`ccs ${s} --add`}),e.jsx(Y,{label:"List accounts",command:`ccs ${s} --accounts`})]})]})]})})}const Ut={gemini:"/assets/providers/gemini-color.svg",codex:"/assets/providers/openai.svg",agy:"/assets/providers/agy.png",qwen:"/assets/providers/qwen-color.svg",iflow:"/assets/providers/iflow.png",kiro:"/assets/providers/kiro.png",ghcp:"/assets/providers/copilot.svg"},Ht={gemini:{text:"text-blue-600",letter:"G"},claude:{text:"text-orange-600",letter:"C"},codex:{text:"text-emerald-600",letter:"X"},agy:{text:"text-violet-600",letter:"A"},qwen:{text:"text-cyan-600",letter:"Q"},iflow:{text:"text-indigo-600",letter:"i"},kiro:{text:"text-teal-600",letter:"K"},ghcp:{text:"text-green-600",letter:"C"}},Vt={sm:{container:"w-6 h-6",icon:"w-4 h-4",text:"text-xs"},md:{container:"w-8 h-8",icon:"w-5 h-5",text:"text-sm"},lg:{container:"w-12 h-12",icon:"w-8 h-8",text:"text-lg"}};function Ae({provider:s,className:n,size:t="md"}){const a=s.toLowerCase(),i=Ht[a]||{text:"text-gray-600",letter:s[0]?.toUpperCase()||"?"},o=Vt[t],l=Ut[a];return e.jsx("div",{className:O("flex items-center justify-center rounded-md",l&&"bg-white p-1",o.container,n),children:l?e.jsx("img",{src:l,alt:`${s} logo`,className:O(o.icon,"object-contain")}):e.jsx("span",{className:O("font-semibold",i.text,o.text),children:i.letter})})}function Gt({displayName:s,logoProvider:n,provider:t,data:a,isLoading:i,hasChanges:o,isRawJsonValid:l,isSaving:d,isRemoteMode:r,port:u,onRefetch:h,onSave:m}){return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ae,{provider:n||t,size:"lg"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),r&&e.jsxs(L,{variant:"secondary",className:"text-xs gap-1 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:[e.jsx(Ce,{className:"w-3 h-3"}),"Remote"]}),u&&e.jsxs(L,{variant:"outline",className:"text-xs gap-1 font-mono",children:[e.jsx(st,{className:"w-3 h-3"}),":",u]}),!r&&a?.path&&e.jsx(L,{variant:"outline",className:"text-xs",children:a.path.replace(/^.*[\\/]/,"")})]}),r?e.jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400 mt-0.5",children:"Traffic auto-routed to remote server"}):a&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",new Date(a.mtime).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{variant:"ghost",size:"sm",onClick:h,disabled:i,children:e.jsx(K,{className:`w-4 h-4 ${i?"animate-spin":""}`})}),e.jsx(v,{size:"sm",onClick:m,disabled:d||!o||!l,children:d?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(tt,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Kt({catalog:s,savedPresets:n,currentModel:t,opusModel:a,sonnetModel:i,haikuModel:o,providerModels:l,onApplyPreset:d,onUpdateEnvValue:r,onOpenCustomPreset:u,onDeletePreset:h,isDeletePending:m}){const f=s&&s.models.length>0||n.length>0;return e.jsxs(e.Fragment,{children:[f&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(J,{className:"w-4 h-4"}),"Presets"]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Apply pre-configured model mappings"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s?.models.slice(0,4).map(c=>e.jsxs(v,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>{const w=c.presetMapping||{default:c.id,opus:c.id,sonnet:c.id,haiku:c.id};d({ANTHROPIC_MODEL:w.default,ANTHROPIC_DEFAULT_OPUS_MODEL:w.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:w.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:w.haiku})},children:[e.jsx(ae,{className:"w-3 h-3"}),c.name]},c.id)),n.map(c=>e.jsxs("div",{className:"group relative",children:[e.jsxs(v,{variant:"secondary",size:"sm",className:"text-xs h-7 gap-1 pr-6",onClick:()=>{d({ANTHROPIC_MODEL:c.default,ANTHROPIC_DEFAULT_OPUS_MODEL:c.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:c.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:c.haiku})},children:[e.jsx(te,{className:"w-3 h-3 fill-current"}),c.name]}),e.jsx(v,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-7 w-5 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:w=>{w.stopPropagation(),h(c.name)},disabled:m,children:e.jsx(ne,{className:"w-3 h-3"})})]},c.name)),e.jsxs(v,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1 border-primary/50 text-primary hover:bg-primary/10 hover:border-primary",onClick:u,children:[e.jsx(es,{className:"w-3 h-3"}),"Custom"]})]})]}),e.jsx(ke,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-2",children:"Model Mapping"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Configure which models to use for each tier"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(H,{label:"Default Model",description:"Used when no specific tier is requested",value:t,onChange:c=>r("ANTHROPIC_MODEL",c),catalog:s,allModels:l}),e.jsx(H,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:a,onChange:c=>r("ANTHROPIC_DEFAULT_OPUS_MODEL",c),catalog:s,allModels:l}),e.jsx(H,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:i,onChange:c=>r("ANTHROPIC_DEFAULT_SONNET_MODEL",c),catalog:s,allModels:l}),e.jsx(H,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:o,onChange:c=>r("ANTHROPIC_DEFAULT_HAIKU_MODEL",c),catalog:s,allModels:l})]})]})]})}function $t({...s}){return e.jsx(ps,{"data-slot":"dropdown-menu",...s})}function qt({...s}){return e.jsx(hs,{"data-slot":"dropdown-menu-trigger",...s})}function zt({className:s,sideOffset:n=4,...t}){return e.jsx(gs,{children:e.jsx(fs,{"data-slot":"dropdown-menu-content",sideOffset:n,className:O("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",s),...t})})}function Fe({className:s,inset:n,variant:t="default",...a}){return e.jsx(js,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":t,className:O("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...a})}function Qt(s){return s<=20?"bg-destructive":s<=50?"bg-yellow-500":"bg-green-500"}function Ue(s){if(!s)return"";try{const n=new Date(s),a=new Date().getTime()-n.getTime();if(a<0)return"just now";const i=Math.floor(a/(1e3*60)),o=Math.floor(a/(1e3*60*60)),l=Math.floor(a/(1e3*60*60*24));return l>0?`${l}d ago`:o>0?`${o}h ago`:i>0?`${i}m ago`:"just now"}catch{return""}}function Bt(s){if(!s)return!1;try{const n=new Date(s);return new Date().getTime()-n.getTime()<3600*1e3}catch{return!1}}function Jt({account:s,onSetDefault:n,onRemove:t,isRemoving:a,privacyMode:i,showQuota:o}){const{data:l}=ys(o&&s.provider==="agy"),{data:d,isLoading:r}=Cs(s.provider,s.id,o&&s.provider==="agy"),u=l?.accountStats?.[s.email||s.id]?.lastUsedAt,h=Bt(u),m=d?.success?ks(d.models):null,f=d?.success&&d.models.length>0?As(d.models):null;return e.jsxs("div",{className:O("flex flex-col gap-2 p-3 rounded-lg border transition-colors",s.isDefault?"border-primary/30 bg-primary/5":"border-border hover:bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:O("flex items-center justify-center w-8 h-8 rounded-full",s.isDefault?"bg-primary/10":"bg-muted"),children:e.jsx(z,{className:"w-4 h-4"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:O("font-medium text-sm",i&&me),children:s.email||s.id}),s.isDefault&&e.jsxs(L,{variant:"secondary",className:"text-[10px] h-4 px-1.5 gap-0.5",children:[e.jsx(te,{className:"w-2.5 h-2.5 fill-current"}),"Default"]})]}),s.lastUsedAt&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mt-0.5",children:[e.jsx(Z,{className:"w-3 h-3"}),"Last used: ",new Date(s.lastUsedAt).toLocaleDateString()]})]})]}),e.jsxs($t,{children:[e.jsx(qt,{asChild:!0,children:e.jsx(v,{variant:"ghost",size:"icon",className:"h-7 w-7",children:e.jsx(at,{className:"w-4 h-4"})})}),e.jsxs(zt,{align:"end",children:[!s.isDefault&&e.jsxs(Fe,{onClick:n,children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Set as default"]}),e.jsxs(Fe,{className:"text-destructive focus:text-destructive",onClick:t,disabled:a,children:[e.jsx(ss,{className:"w-4 h-4 mr-2"}),a?"Removing...":"Remove account"]})]})]})]}),o&&s.provider==="agy"&&e.jsx("div",{className:"pl-11",children:r?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx($,{className:"w-3 h-3 animate-spin"}),e.jsx("span",{children:"Loading quota..."})]}):m!==null?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:h?e.jsxs(e.Fragment,{children:[e.jsx(nt,{className:"w-3 h-3 text-emerald-500"}),e.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400",children:["Active · ",Ue(u)]})]}):u?e.jsxs(e.Fragment,{children:[e.jsx(Z,{className:"w-3 h-3 text-muted-foreground"}),e.jsxs("span",{className:"text-muted-foreground",children:["Last used ",Ue(u)]})]}):e.jsxs(e.Fragment,{children:[e.jsx(it,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Not used yet"})]})}),e.jsx(Be,{children:e.jsxs(Je,{children:[e.jsx(We,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ss,{value:m,className:"h-2 flex-1",indicatorClassName:Qt(m)}),e.jsxs("span",{className:"text-xs font-medium w-10 text-right",children:[m,"%"]})]})}),e.jsx(Ye,{side:"bottom",className:"max-w-xs",children:e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsx("p",{className:"font-medium",children:"Model Quotas:"}),Ps(d?.models||[]).map(c=>e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"truncate",children:c.displayName||c.name}),e.jsxs("span",{className:"font-mono",children:[c.percentage,"%"]})]},c.name)),f&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 pt-2 border-t border-border/50",children:[e.jsx(Z,{className:"w-3 h-3 text-blue-400"}),e.jsxs("span",{className:"text-blue-400 font-medium",children:["Resets ",Ms(f)]})]})]})})]})})]}):d?.error?e.jsx("div",{className:"text-xs text-muted-foreground",children:d.error}):null})]})}function Wt({accounts:s,onAddAccount:n,onSetDefault:t,onRemoveAccount:a,isRemovingAccount:i,privacyMode:o,showQuota:l,isKiro:d,kiroNoIncognito:r,onKiroNoIncognitoChange:u,kiroSettingsLoading:h}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Accounts",s.length>0&&e.jsx(L,{variant:"secondary",className:"text-xs",children:s.length})]}),e.jsxs(v,{variant:"default",size:"sm",className:"h-7 text-xs gap-1",onClick:n,children:[e.jsx(es,{className:"w-3 h-3"}),"Add"]})]}),s.length>0?e.jsx("div",{className:"space-y-2",children:s.map(m=>e.jsx(Jt,{account:m,onSetDefault:()=>t(m.id),onRemove:()=>a(m.id),isRemoving:i,privacyMode:o,showQuota:l},m.id))}):e.jsxs("div",{className:"py-6 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed",children:[e.jsx(z,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No accounts connected"}),e.jsx("p",{className:"text-xs opacity-70",children:"Add an account to get started"})]}),d&&u&&e.jsx("div",{className:"mt-3 pt-3 border-t border-dashed",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ce,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Use incognito"})]}),e.jsx(ht,{checked:!r,onCheckedChange:m=>u(!m),disabled:h,className:"scale-90"})]})})]})}function Yt({provider:s,catalog:n,savedPresets:t,currentModel:a,opusModel:i,sonnetModel:o,haikuModel:l,providerModels:d,onApplyPreset:r,onUpdateEnvValue:u,onOpenCustomPreset:h,onDeletePreset:m,isDeletePending:f,accounts:c,onAddAccount:w,onSetDefault:S,onRemoveAccount:g,isRemovingAccount:_,privacyMode:A,isRemoteMode:T}){const N=s==="kiro",[b,k]=p.useState(!0),[P,j]=p.useState(!0),[M,x]=p.useState(!1),E=p.useCallback(async()=>{if(N)try{j(!0);const C=(await X.config.get()).cliproxy;k(C?.kiro_no_incognito??!0)}catch{k(!0)}finally{j(!1)}},[N]),V=p.useCallback(async R=>{k(R),x(!0);try{const C=await X.config.get(),I=C.cliproxy??{};await X.config.update({...C,cliproxy:{...I,kiro_no_incognito:R}})}catch{k(!R)}finally{x(!1)}},[]);return p.useEffect(()=>{E()},[E]),e.jsx(we,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsx(Kt,{catalog:n,savedPresets:t,currentModel:a,opusModel:i,sonnetModel:o,haikuModel:l,providerModels:d,onApplyPreset:r,onUpdateEnvValue:u,onOpenCustomPreset:h,onDeletePreset:m,isDeletePending:f}),e.jsx(ke,{}),e.jsx(Wt,{accounts:c,onAddAccount:w,onSetDefault:S,onRemoveAccount:g,isRemovingAccount:_,privacyMode:A,showQuota:s==="agy"&&!T,isKiro:N,kiroNoIncognito:b,onKiroNoIncognitoChange:V,kiroSettingsLoading:P||M})]})})}function He({provider:s,displayName:n,authStatus:t,catalog:a,logoProvider:i,baseProvider:o,isRemoteMode:l,port:d,onAddAccount:r,onSetDefault:u,onRemoveAccount:h,isRemovingAccount:m}){const[f,c]=p.useState(!1),{privacyMode:w}=qe(),{data:S}=Os(),{data:g}=Ts(s),_=Ds(),A=_s(),T=g?.presets||[],N=o||s,b=p.useMemo(()=>{if(!S?.models)return[];const U={gemini:["google"],agy:["antigravity"],codex:["openai"],qwen:["alibaba","qwen"],iflow:["iflow"],kiro:["kiro","aws"],ghcp:["github","copilot"]}[N.toLowerCase()]||[N.toLowerCase()];return S.models.filter(Oe=>U.some(xs=>Oe.owned_by.toLowerCase().includes(xs)))},[S,N]),{data:k,isLoading:P,refetch:j,rawJsonContent:M,rawJsonEdits:x,isRawJsonValid:E,hasChanges:V,currentModel:R,opusModel:C,sonnetModel:I,haikuModel:y,handleRawJsonChange:Q,updateEnvValue:G,updateEnvValues:W,saveMutation:Se,conflictDialog:rs,handleConflictResolve:Pe,missingRequiredFields:os}=Lt(s),ls=t.accounts||[],{data:cs}=de({queryKey:["auth-tokens-raw"],queryFn:async()=>{const D=await fetch("/api/settings/auth/tokens/raw");return D.ok?D.json():{apiKey:{value:"ccs-internal-managed"}}},staleTime:6e4}),Me=cs?.apiKey?.value??"ccs-internal-managed",ds=D=>{W({ANTHROPIC_BASE_URL:`http://127.0.0.1:${d??le}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:Me,...D}),F.success(`Applied "${D.ANTHROPIC_MODEL?.split("/").pop()||"preset"}" preset`)},ms=(D,U)=>{W({ANTHROPIC_BASE_URL:`http://127.0.0.1:${d??le}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:Me,ANTHROPIC_MODEL:D.default,ANTHROPIC_DEFAULT_OPUS_MODEL:D.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:D.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:D.haiku}),F.success(`Applied ${U?`"${U}"`:"custom"} preset`),c(!1)},us=(D,U)=>{if(!U){F.error("Please enter a preset name to save");return}_.mutate({profile:s,data:{name:U,...D}}),c(!1)};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(Gt,{provider:s,displayName:n,logoProvider:i,data:k,isLoading:P,hasChanges:V,isRawJsonValid:E,isSaving:Se.isPending,isRemoteMode:l,port:d,onRefetch:j,onSave:()=>Se.mutate()}),P?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx($,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):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",children:e.jsxs(Is,{defaultValue:"config",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(Es,{className:"w-full",children:[e.jsx(_e,{value:"config",className:"flex-1",children:"Model Config"}),e.jsx(_e,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsx(Ie,{value:"config",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx(Yt,{provider:s,catalog:a,savedPresets:T,currentModel:R,opusModel:C,sonnetModel:I,haikuModel:y,providerModels:b,onApplyPreset:ds,onUpdateEnvValue:G,onOpenCustomPreset:()=>c(!0),onDeletePreset:D=>A.mutate({profile:s,name:D}),isDeletePending:A.isPending,accounts:ls,onAddAccount:r,onSetDefault:u,onRemoveAccount:h,isRemovingAccount:m,privacyMode:w,isRemoteMode:l})}),e.jsx(Ie,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(Ft,{provider:s,displayName:n,data:k,authStatus:t})})]})]})}),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(rt,{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(Ls,{rawJsonContent:M,isRawJsonValid:E,rawJsonEdits:x,onRawJsonChange:Q,profileEnv:k?.settings?.env,missingRequiredFields:os})]})]}),e.jsx(pt,{open:rs,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>Pe(!0),onCancel:()=>Pe(!1)}),e.jsx(Rt,{open:f,onClose:()=>c(!1),currentValues:{default:R||"",opus:C||"",sonnet:I||"",haiku:y||""},onApply:ms,onSave:us,isSaving:_.isPending,catalog:a,allModels:b})]})}function re(s,n){const t=s.replace(/-\d+$/,"").split(".").map(Number),a=n.replace(/-\d+$/,"").split(".").map(Number);for(let i=0;i<3;i++){if((t[i]||0)>(a[i]||0))return!0;if((t[i]||0)<(a[i]||0))return!1}return!1}function Xt(s){if(!s)return"";const n=new Date(s).getTime(),a=Date.now()-n,i=Math.floor(a/(1e3*60*60)),o=Math.floor(a%(1e3*60*60)/(1e3*60));return i>0?`${i}h ${o}m`:`${o}m`}function Zt(s){if(!s)return"";const n=Date.now()-s,t=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return t<1?"just now":t<60?`${t}m ago`:`${a}h ago`}function oe({icon:s,tooltip:n,onClick:t,disabled:a,isPending:i,className:o,variant:l="ghost"}){return e.jsxs(Je,{children:[e.jsx(We,{asChild:!0,children:e.jsx(v,{variant:l==="destructive-ghost"?"ghost":l,size:"sm",className:O("h-7 w-7 p-0",l==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",o),onClick:t,disabled:a,children:i?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(s,{className:"w-3.5 h-3.5"})})}),e.jsx(Ye,{side:"bottom",className:"text-xs",children:n})]})}function ea(){const{data:s,isLoading:n}=Rs(),{data:t}=Fs(),{data:a,isLoading:i}=Us(),o=Hs(),l=Vs(),d=Gs(),r=Ks(),[u,h]=p.useState(!1),[m,f]=p.useState(""),[c,w]=p.useState(!1),[S,g]=p.useState(null),{data:_}=de({queryKey:["cliproxy-server-config"],queryFn:()=>X.cliproxyServer.get(),staleTime:3e4}),A=_?.remote,T=A?.enabled&&A?.host,N=s?.running??!1,b=o.isPending||l.isPending||d.isPending||r.isPending,k=t?.hasUpdate??!1,P=t?.isStable===!1,j=t?.currentVersion,M=P?t?.maxStableVersion||a?.latestStable:t?.latestVersion,x=C=>{if(!C)return;const I=a?.maxStableVersion||"6.6.80";if(re(C,I)){g(C),w(!0);return}r.mutate({version:C})},E=()=>{S&&r.mutate({version:S,force:!0}),w(!1),g(null)},V=()=>{w(!1),g(null)},R=T?(()=>{const C=A.protocol||"http",I=A.port||(C==="https"?443:80);return C==="https"&&I===443||C==="http"&&I===80?A.host:`${A.host}:${I}`})():null;return T?e.jsxs("div",{className:O("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(L,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:"Active"})]}),e.jsx(ot,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:R})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsx(Be,{delayDuration:300,children:e.jsxs("div",{className:O("rounded-lg border p-3 transition-colors",N?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:O("w-2 h-2 rounded-full",N?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:"CLIProxy Plus"})]}),e.jsx("div",{className:"flex items-center gap-1",children:n?e.jsx(K,{className:"w-3 h-3 animate-spin text-muted-foreground"}):N?e.jsxs(e.Fragment,{children:[e.jsx(oe,{icon:lt,tooltip:"Restart",onClick:()=>d.mutate(),disabled:b,isPending:d.isPending}),e.jsx(oe,{icon:ct,tooltip:"Stop",onClick:()=>l.mutate(),disabled:b,isPending:l.isPending,variant:"destructive-ghost"}),e.jsx(oe,{icon:u?ne:dt,tooltip:u?"Close":"Version settings",onClick:()=>h(!u),className:u?"bg-muted":void 0})]}):e.jsx(Ee,{className:"w-3 h-3 text-muted-foreground"})})]}),j&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:O("text-xs font-mono text-muted-foreground",P&&"text-amber-600 dark:text-amber-400"),children:["v",j]}),(k||P)&&M&&e.jsxs(L,{variant:"secondary",className:O("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",P?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>x(M),title:`Click to ${P?"downgrade":"update"}`,children:[P?e.jsx(mt,{className:"w-2.5 h-2.5"}):e.jsx(ut,{className:"w-2.5 h-2.5"}),M]})]}),N&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:["Port ",s.port]}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(xt,{className:"w-3 h-3"}),s.sessionCount," session",s.sessionCount!==1?"s":""]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Z,{className:"w-3 h-3"}),Xt(s.startedAt)]})]}),N&&e.jsx($s,{open:u,onOpenChange:h,children:e.jsxs(qs,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Version Management"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(xe,{value:m,onValueChange:f,disabled:i,children:[e.jsx(pe,{className:"h-8 text-xs flex-1",children:e.jsx(he,{placeholder:"Select version to install..."})}),e.jsx(ge,{children:a?.versions.slice(0,20).map(C=>{const I=a?.maxStableVersion&&re(C,a.maxStableVersion);return e.jsx(se,{value:C,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",C,C===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"(stable)"}),I&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},C)})})]}),e.jsxs(v,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>x(m),disabled:r.isPending||!m,children:[r.isPending?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Ze,{className:"w-3.5 h-3.5"}),"Install"]})]}),m&&a?.maxStableVersion&&re(m,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(Le,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:["Versions above ",a.maxStableVersion," have known issues"]})]}),t?.checkedAt&&e.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:["Last checked ",Zt(t.checkedAt)]})]})}),!N&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not running"}),e.jsxs(v,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>o.mutate(),disabled:o.isPending,children:[o.isPending?e.jsx(K,{className:"w-3 h-3 animate-spin"}):e.jsx(Ee,{className:"w-3 h-3"}),"Start"]})]}),e.jsx(gt,{open:c,onOpenChange:w,children:e.jsxs(ft,{children:[e.jsxs(jt,{children:[e.jsxs(vt,{className:"flex items-center gap-2",children:[e.jsx(Le,{className:"w-5 h-5 text-amber-500"}),"Install Unstable Version?"]}),e.jsxs(Nt,{className:"space-y-2",children:[e.jsxs("p",{children:["You are about to install ",e.jsxs("strong",{children:["v",S]}),", which is above the maximum stable version"," ",e.jsxs("strong",{children:["v",a?.maxStableVersion||"6.6.80"]}),"."]}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:"This version has known stability issues and may cause unexpected behavior."}),e.jsx("p",{children:"Are you sure you want to proceed?"})]})]}),e.jsxs(wt,{children:[e.jsx(bt,{onClick:V,children:"Cancel"}),e.jsx(yt,{onClick:E,className:"bg-amber-500 hover:bg-amber-600 text-white",children:"Install Anyway"})]})]})})]})})}function sa({status:s,isSelected:n,onSelect:t}){const a=s.accounts?.length||0;return e.jsxs("button",{className:O("w-full flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors cursor-pointer text-left",n?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:t,children:[e.jsx(Ae,{provider:s.provider,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:s.displayName}),a>0&&e.jsx(L,{variant:"secondary",className:"text-[10px] h-4 px-1",children:a})]}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:s.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-3 h-3 text-green-600"}),e.jsx("span",{className:"text-xs text-green-600",children:"Connected"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not connected"})]})})]})]})}function ta({variant:s,parentAuth:n,isSelected:t,onSelect:a,onDelete:i,isDeleting:o}){return e.jsxs("button",{className:O("group w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors cursor-pointer text-left pl-6",t?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:a,children:[e.jsxs("div",{className:"relative",children:[e.jsx(Ae,{provider:s.provider,size:"sm"}),e.jsx(ts,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-muted-foreground"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:s.name}),e.jsx(L,{variant:"outline",className:"text-[9px] h-4 px-1",children:"variant"})]}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:n?.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-3 h-3 text-green-600"}),e.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["via ",s.provider]})]}):e.jsxs(e.Fragment,{children:[e.jsx(ne,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Parent not connected"})]})})]}),e.jsx(v,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:l=>{l.stopPropagation(),i()},disabled:o,children:e.jsx(ss,{className:"w-3 h-3"})})]})}function aa({onSetup:s}){return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20",children:e.jsxs("div",{className:"text-center max-w-md px-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mx-auto mb-6",children:e.jsx(ae,{className:"w-8 h-8 text-muted-foreground"})}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"CCS Profile Manager"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Manage OAuth authentication, account preferences, and model selection for CLIProxy providers. Configure how CCS routes requests to different AI backends."}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-6",children:["For live usage stats and real-time monitoring, visit the"," ",e.jsx("a",{href:"/cliproxy/control-panel",className:"text-primary hover:underline",children:"Control Panel"}),"."]}),e.jsxs(v,{onClick:s,className:"gap-2",children:[e.jsx(J,{className:"w-4 h-4"}),"Quick Setup"]})]})})}function fa(){const s=Ve(),{data:n,isLoading:t}=Ge(),{data:a,isFetching:i}=zs(),o=Qs(),l=Bs(),d=Js(),[r,u]=p.useState(null),[h,m]=p.useState(null),[f,c]=p.useState(!1),[w,S]=p.useState(null),g=p.useMemo(()=>n?.authStatus||[],[n?.authStatus]),_=n?.source==="remote",A=p.useMemo(()=>a?.variants||[],[a?.variants]),T=p.useMemo(()=>h?null:r&&g.some(x=>x.provider===r)?r:g.length>0?g[0].provider:null,[r,h,g]),N=g.find(x=>x.provider===T),b=A.find(x=>x.name===h),k=b?g.find(x=>x.provider===b.provider):void 0,P=()=>{s.invalidateQueries({queryKey:["cliproxy"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]})},j=x=>{u(x),m(null)},M=x=>{m(x),u(null)};return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"CLIProxy Plus"})]}),e.jsx(v,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:P,disabled:i,children:e.jsx(K,{className:O("w-4 h-4",i&&"animate-spin")})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"CCS-level account management"}),e.jsxs(v,{variant:"default",size:"sm",className:"w-full gap-2",onClick:()=>c(!0),children:[e.jsx(J,{className:"w-4 h-4"}),"Quick Setup"]})]}),e.jsx(we,{className:"flex-1",children:e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3 py-2",children:"Providers"}),t?e.jsx("div",{className:"space-y-2 px-2",children:[1,2,3,4].map(x=>e.jsx(Ws,{className:"h-14 w-full rounded-lg"},x))}):e.jsx("div",{className:"space-y-1",children:g.map(x=>e.jsx(sa,{status:x,isSelected:T===x.provider,onSelect:()=>j(x.provider)},x.provider))}),A.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3 py-2 mt-4 flex items-center gap-1.5",children:[e.jsx(ts,{className:"w-3 h-3"}),"Variants"]}),e.jsx("div",{className:"space-y-1",children:A.map(x=>e.jsx(ta,{variant:x,parentAuth:g.find(E=>E.provider===x.provider),isSelected:h===x.name,onSelect:()=>M(x.name),onDelete:()=>d.mutate(x.name),isDeleting:d.isPending},x.name))})]})]})}),e.jsx("div",{className:"p-3 border-t",children:e.jsx(ea,{})}),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.jsxs("span",{children:[g.length," provider",g.length!==1?"s":""]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3 text-green-600"}),g.filter(x=>x.authenticated).length," connected"]})]})})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background",children:b&&k?e.jsx(He,{provider:b.name,displayName:`${b.name} (${b.provider} variant)`,authStatus:k,catalog:B[b.provider],logoProvider:b.provider,baseProvider:b.provider,isRemoteMode:_,port:b.port,onAddAccount:()=>S({provider:b.provider,displayName:k.displayName,isFirstAccount:(k.accounts?.length||0)===0}),onSetDefault:x=>o.mutate({provider:b.provider,accountId:x}),onRemoveAccount:x=>l.mutate({provider:b.provider,accountId:x}),isRemovingAccount:l.isPending}):N?e.jsx(He,{provider:N.provider,displayName:N.displayName,authStatus:N,catalog:B[N.provider],isRemoteMode:_,onAddAccount:()=>S({provider:N.provider,displayName:N.displayName,isFirstAccount:(N.accounts?.length||0)===0}),onSetDefault:x=>o.mutate({provider:N.provider,accountId:x}),onRemoveAccount:x=>l.mutate({provider:N.provider,accountId:x}),isRemovingAccount:l.isPending}):e.jsx(aa,{onSetup:()=>c(!0)})}),e.jsx(Dt,{open:f,onClose:()=>c(!1)}),e.jsx(_t,{open:w!==null,onClose:()=>S(null),provider:w?.provider||"",displayName:w?.displayName||"",isFirstAccount:w?.isFirstAccount||!1})]})}export{fa as CliproxyPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as y}from"./react-vendor-B_CU-WTZ.js";const _=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),M=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,c,o)=>o?o.toUpperCase():c.toLowerCase()),d=t=>{const a=M(t);return a.charAt(0).toUpperCase()+a.slice(1)},r=(...t)=>t.filter((a,c,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===c).join(" ").trim(),m=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var x={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const v=y.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:s="",children:n,iconNode:k,...h},i)=>y.createElement("svg",{ref:i,...x,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:r("lucide",s),...!n&&!m(h)&&{"aria-hidden":"true"},...h},[...k.map(([p,l])=>y.createElement(p,l)),...Array.isArray(n)?n:[n]]));const e=(t,a)=>{const c=y.forwardRef(({className:o,...s},n)=>y.createElement(v,{ref:n,iconNode:a,className:r(`lucide-${_(d(t))}`,`lucide-${t}`,o),...s}));return c.displayName=d(t),c};const f=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],c2=e("activity",f);const g=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],o2=e("arrow-down-left",g);const w=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],n2=e("arrow-down-right",w);const $=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],y2=e("arrow-down",$);const N=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],s2=e("arrow-left",N);const u=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],h2=e("arrow-right",u);const z=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],d2=e("arrow-up-right",z);const b=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],r2=e("arrow-up",b);const C=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],k2=e("book-open",C);const j=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],i2=e("bot",j);const q=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],p2=e("calendar",q);const A=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],l2=e("chart-column",A);const H=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],_2=e("chart-pie",H);const V=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],M2=e("check",V);const L=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],m2=e("chevron-down",L);const S=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],x2=e("chevron-left",S);const R=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],v2=e("chevron-right",R);const E=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],f2=e("chevron-up",E);const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],g2=e("circle-alert",P);const U=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],w2=e("circle-check-big",U);const B=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$2=e("circle-check",B);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],N2=e("circle-question-mark",D);const G=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],u2=e("circle-x",G);const O=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],z2=e("circle",O);const W=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],b2=e("clock",W);const F=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],C2=e("cloud",F);const T=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],j2=e("code-xml",T);const Z=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],q2=e("code",Z);const I=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],A2=e("coins",I);const K=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],H2=e("copy",K);const X=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],V2=e("cpu",X);const Q=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],L2=e("database",Q);const J=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],S2=e("dollar-sign",J);const Y=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],R2=e("download",Y);const e1=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],E2=e("ellipsis",e1);const a1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],P2=e("external-link",a1);const t1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],U2=e("eye-off",t1);const c1=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],B2=e("eye",c1);const o1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],D2=e("file-braces",o1);const n1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],G2=e("file-code",n1);const y1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],O2=e("file-exclamation-point",y1);const s1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],W2=e("file-text",s1);const h1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],F2=e("folder-open",h1);const d1=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],T2=e("gauge",d1);const r1=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Z2=e("git-branch",r1);const k1=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],I2=e("github",k1);const i1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],K2=e("globe",i1);const p1=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],X2=e("grip-horizontal",p1);const l1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Q2=e("grip-vertical",l1);const _1=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],J2=e("heart",_1);const M1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Y2=e("house",M1);const m1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],e0=e("info",m1);const x1=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],a0=e("key-round",x1);const v1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],t0=e("key",v1);const f1=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],c0=e("laptop",f1);const g1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],o0=e("loader-circle",g1);const w1=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],n0=e("monitor",w1);const $1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],y0=e("moon",$1);const N1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],s0=e("network",N1);const u1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],h0=e("panel-left",u1);const z1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],d0=e("plus",z1);const b1=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],r0=e("power-off",b1);const C1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],k0=e("power",C1);const j1=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],i0=e("radio",j1);const q1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],p0=e("refresh-cw",q1);const A1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],l0=e("rotate-ccw",A1);const H1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],_0=e("rotate-cw",H1);const V1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],M0=e("save",V1);const L1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],m0=e("search",L1);const S1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],x0=e("server",S1);const R1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],v0=e("settings-2",R1);const E1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],f0=e("settings",E1);const P1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],g0=e("shield-check",P1);const U1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],w0=e("shield",U1);const B1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],$0=e("sparkles",B1);const D1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],N0=e("square",D1);const G1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],u0=e("star",G1);const O1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],z0=e("sun",O1);const W1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],b0=e("terminal",W1);const F1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],C0=e("trash-2",F1);const T1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],j0=e("trending-up",T1);const Z1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],q0=e("triangle-alert",Z1);const I1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],A0=e("user",I1);const K1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],H0=e("users",K1);const X1=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],V0=e("wand-sparkles",X1);const Q1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],L0=e("wifi-off",Q1);const J1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],S0=e("wifi",J1);const Y1=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],R0=e("wrench",Y1);const e2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],E0=e("x",e2);const a2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],P0=e("zap",a2);export{G2 as $,c2 as A,k2 as B,l2 as C,f2 as D,U2 as E,F2 as F,T2 as G,Y2 as H,e0 as I,m2 as J,t0 as K,o0 as L,y0 as M,v0 as N,d0 as O,h0 as P,$0 as Q,l0 as R,f0 as S,q0 as T,H0 as U,g2 as V,L0 as W,E0 as X,K2 as Y,P0 as Z,x0 as _,I2 as a,p0 as a0,x2 as a1,S2 as a2,L2 as a3,n2 as a4,p2 as a5,A2 as a6,j0 as a7,_2 as a8,C0 as a9,M0 as aa,m0 as ab,V0 as ac,j2 as ad,h2 as ae,D2 as af,s2 as ag,A0 as ah,R2 as ai,u0 as aj,s0 as ak,E2 as al,N2 as am,_0 as an,N0 as ao,k0 as ap,y2 as aq,r2 as ar,Z2 as as,r0 as at,R0 as au,n0 as av,i2 as aw,C2 as ax,c0 as ay,g0 as az,v2 as b,z0 as c,B2 as d,S0 as e,w0 as f,J2 as g,w2 as h,z2 as i,M2 as j,a0 as k,H2 as l,P2 as m,$2 as n,u2 as o,Q2 as p,b2 as q,i0 as r,V2 as s,b0 as t,q2 as u,d2 as v,o2 as w,W2 as x,O2 as y,X2 as z};
|