@kaitranntt/ccs 7.21.0-dev.1 → 7.21.0
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 +1 -3
- package/dist/cliproxy/account-manager.d.ts.map +1 -1
- package/dist/cliproxy/account-manager.js +4 -33
- package/dist/cliproxy/account-manager.js.map +1 -1
- package/dist/cliproxy/auth/token-manager.d.ts.map +1 -1
- package/dist/cliproxy/auth/token-manager.js +1 -2
- package/dist/cliproxy/auth/token-manager.js.map +1 -1
- package/dist/ui/assets/{accounts-BUcnX5Y0.js → accounts-CBHdGCQd.js} +1 -1
- package/dist/ui/assets/{alert-dialog-Bg5o3Alj.js → alert-dialog-DsTxhlFk.js} +1 -1
- package/dist/ui/assets/{api-CpMMwav8.js → api-DFeR1iJt.js} +1 -1
- package/dist/ui/assets/{auth-section-DQKmNhEN.js → auth-section-Ve_TIR5H.js} +1 -1
- package/dist/ui/assets/{backups-section-CAKQf9nt.js → backups-section-CQtajr1G.js} +1 -1
- package/dist/ui/assets/cliproxy-C9-WQ2K1.js +3 -0
- package/dist/ui/assets/{cliproxy-control-panel-DAGDQIWu.js → cliproxy-control-panel-BHNeiJAP.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BkwrKQU-.js → confirm-dialog-DO64zZqj.js} +1 -1
- package/dist/ui/assets/{copilot-RcBRlgWE.js → copilot-MbZr8wG3.js} +3 -3
- package/dist/ui/assets/{globalenv-section-BnZYuxPb.js → globalenv-section-CSL8d808.js} +1 -1
- package/dist/ui/assets/{health-D23qstbb.js → health-DYJGIuhY.js} +1 -1
- package/dist/ui/assets/icons-B8zfgpli.js +1 -0
- package/dist/ui/assets/{index-bcsgnPfl.js → index-C1c994wt.js} +11 -11
- package/dist/ui/assets/{index-01cE8Y7q.js → index-D3SAzu5s.js} +1 -1
- package/dist/ui/assets/index-DZ9RMk63.css +1 -0
- package/dist/ui/assets/{index-CiTGfxdk.js → index-DzAtu2WP.js} +1 -1
- package/dist/ui/assets/{index-4JMryYp8.js → index-QzEXdM_L.js} +1 -1
- package/dist/ui/assets/{shared-DBaRgOZg.js → shared-BZUOuxLa.js} +1 -1
- package/dist/ui/assets/{switch-LDXs_uRr.js → switch-C7NO4S4-.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/package.json +1 -1
- package/dist/ui/assets/cliproxy-D7mwG-x5.js +0 -3
- package/dist/ui/assets/icons-v7BVCs0w.js +0 -1
- package/dist/ui/assets/index-CVpEoaQG.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DP8--cuX.js";import{r as i}from"./react-vendor-CNOkPC89.js";import{aO as ae,aP as oe,ao as M,I as E,X as re,Y as ne,Z as le,_ as ce,$ as H,b as B,aQ as de,aL as ie,aN as me,m as xe}from"./index-bcsgnPfl.js";import{S as A}from"./switch-LDXs_uRr.js";import{aD as U,a3 as D,e as ue,p as z,W as he,_ as pe,aE as ge,aF as fe}from"./icons-v7BVCs0w.js";import"./tanstack-C1q4365B.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";function ye(){const{state:t}=ae(),s=oe(),[n,c]=i.useState(null),[u,g]=i.useState(null),[h,m]=i.useState(null),[f,y]=i.useState(null),[j,b]=i.useState(null),v=i.useCallback(async()=>{try{s.setProxyLoading(!0),s.setProxyError(null);const l=await M.cliproxyServer.get();s.setProxyConfig(l)}catch(l){s.setProxyError(l.message)}finally{s.setProxyLoading(!1)}},[s]),N=i.useCallback(async l=>{const d=t.proxyConfig;if(!d)return;const x={remote:{...d.remote,...l.remote},fallback:{...d.fallback,...l.fallback},local:{...d.local,...l.local}};s.setProxyConfig(x),s.setProxyTestResult(null);try{s.setProxySaving(!0),s.setProxyError(null);const o=await M.cliproxyServer.update(l);s.setProxyConfig(o),s.setProxySuccess(!0),setTimeout(()=>s.setProxySuccess(!1),1500)}catch(o){s.setProxyConfig(d),s.setProxyError(o.message)}finally{s.setProxySaving(!1)}},[t.proxyConfig,s]),C=i.useCallback(async l=>{const{host:d,port:x,protocol:o,authToken:k}=l;if(!d){s.setProxyError("Host is required");return}try{s.setProxyTesting(!0),s.setProxyError(null),s.setProxyTestResult(null);const r=x?parseInt(x,10):void 0,P=await M.cliproxyServer.test({host:d,port:r||void 0,protocol:o,authToken:k||void 0});s.setProxyTestResult(P)}catch(r){s.setProxyError(r.message)}finally{s.setProxyTesting(!1)}},[s]);return{config:t.proxyConfig,loading:t.proxyLoading,saving:t.proxySaving,error:t.proxyError,success:t.proxySuccess,testResult:t.proxyTestResult,testing:t.proxyTesting,editedHost:n,setEditedHost:c,editedPort:u,setEditedPort:g,editedAuthToken:h,setEditedAuthToken:m,editedManagementKey:f,setEditedManagementKey:y,editedLocalPort:j,setEditedLocalPort:b,fetchConfig:v,saveConfig:N,testConnection:C}}function je({config:t,saving:s,displayLocalPort:n,setEditedLocalPort:c,onSaveLocalPort:u,onSaveConfig:g}){const h=t.local;return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Local Proxy"}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Port"}),e.jsx(E,{type:"number",value:n,onChange:m=>c(m.target.value),onBlur:u,placeholder:"8317",className:"font-mono max-w-32",disabled:s})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-start"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Start local proxy automatically when needed"})]}),e.jsx(A,{checked:h.auto_start??!0,onCheckedChange:m=>g({local:{...h,auto_start:m}}),disabled:s})]})]})]})}function be({config:t,saving:s,testing:n,testResult:c,displayHost:u,displayPort:g,displayAuthToken:h,displayManagementKey:m,setEditedHost:f,setEditedPort:y,setEditedAuthToken:j,setEditedManagementKey:b,onSaveHost:v,onSavePort:N,onSaveAuthToken:C,onSaveManagementKey:l,onSaveConfig:d,onTestConnection:x}){const o=t.remote,k=r=>r==="https"?443:8317;return e.jsxs("div",{className:"space-y-4 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("h4",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Remote Server Configuration"]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Host"}),e.jsx(E,{value:u,onChange:r=>f(r.target.value),onBlur:v,placeholder:"192.168.1.100 or proxy.example.com",className:"font-mono",disabled:s})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("label",{className:"text-sm text-muted-foreground",children:["Port"," ",e.jsxs("span",{className:"text-xs opacity-70",children:["(default: ",k(t.remote.protocol||"http"),")"]})]}),e.jsx(E,{type:"text",inputMode:"numeric",value:g,onChange:r=>y(r.target.value.replace(/\D/g,"")),onBlur:N,placeholder:`Leave empty for ${k(t.remote.protocol||"http")}`,className:"font-mono",disabled:s})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Protocol"}),e.jsxs(re,{value:t.remote.protocol||"http",onValueChange:r=>d({remote:{...o,protocol:r}}),disabled:s,children:[e.jsx(ne,{children:e.jsx(le,{})}),e.jsxs(ce,{children:[e.jsx(H,{value:"http",children:"HTTP"}),e.jsx(H,{value:"https",children:"HTTPS"})]})]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"API Key (optional)"}),e.jsx(E,{type:"password",value:h,onChange:r=>j(r.target.value),onBlur:C,placeholder:"For /v1/* API endpoints",className:"font-mono",disabled:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used for API requests to /v1/chat/completions"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Management Key (optional)"}),e.jsx(E,{type:"password",value:m,onChange:r=>b(r.target.value),onBlur:l,placeholder:"For /v0/management/* endpoints",className:"font-mono",disabled:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used for dashboard management APIs. Falls back to API Key if not set."})]}),e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsx(B,{onClick:x,disabled:n||!u,variant:"outline",className:"w-full",children:n?e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"w-4 h-4 mr-2 animate-spin"}),"Testing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 mr-2"}),"Test Connection"]})}),c&&e.jsx("div",{className:`p-3 rounded-md ${c.reachable?"bg-green-50 border border-green-200 dark:bg-green-900/20 dark:border-green-900/50":"bg-red-50 border border-red-200 dark:bg-red-900/20 dark:border-red-900/50"}`,children:e.jsx("div",{className:"flex items-center gap-2",children:c.reachable?e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),e.jsxs("span",{className:"text-sm font-medium text-green-700 dark:text-green-300",children:["Connected (",c.latencyMs,"ms)"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 text-red-600 dark:text-red-400"}),e.jsx("span",{className:"text-sm font-medium text-red-700 dark:text-red-300",children:c.error||"Connection failed"})]})})})]})]})}const $="ccs_debug_mode";function Ie(){const{config:t,loading:s,saving:n,error:c,success:u,testResult:g,testing:h,editedHost:m,setEditedHost:f,editedPort:y,setEditedPort:j,editedAuthToken:b,setEditedAuthToken:v,editedManagementKey:N,setEditedManagementKey:C,editedLocalPort:l,setEditedLocalPort:d,fetchConfig:x,saveConfig:o,testConnection:k}=ye(),{fetchRawConfig:r}=de(),[P,O]=i.useState(()=>{try{return localStorage.getItem($)==="true"}catch{return!1}}),W=a=>{O(a);try{localStorage.setItem($,String(a))}catch{}};if(i.useEffect(()=>{if(P&&t){const a={...t,remote:{...t.remote,auth_token:t.remote.auth_token?"[REDACTED]":void 0,management_key:t.remote.management_key?"[REDACTED]":void 0}};console.log("[CCS Debug] Debug mode enabled - proxy config:",a)}},[P,t]),i.useEffect(()=>{x(),r()},[x,r]),s||!t)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(D,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})});const p=t.remote.enabled??!1,S=t.remote,w=t.fallback,q=t.remote.host??"",V=t.remote.port!==void 0?t.remote.port.toString():"",Y=t.remote.auth_token??"",G=t.remote.management_key??"",Q=(t.local.port??8317).toString(),I=m??q,L=y??V,_=b??Y,R=N??G,K=l??Q,X=()=>{const a=m??I;a!==t.remote.host&&o({remote:{...S,host:a}}),f(null)},Z=()=>{const a=y??L,T=a===""?void 0:parseInt(a,10),F=T&&!isNaN(T)&&T>0?T:void 0;F!==t.remote.port&&o({remote:{...S,port:F}}),j(null)},J=()=>{const a=b??_;a!==t.remote.auth_token&&o({remote:{...S,auth_token:a}}),v(null)},ee=()=>{const a=N??R;a!==t.remote.management_key&&o({remote:{...S,management_key:a||void 0}}),C(null)},te=()=>{const a=parseInt(l??K,10);!isNaN(a)&&a!==t.local.port&&o({local:{...t.local,port:a}}),d(null)},se=()=>{k({host:I,port:L,protocol:t.remote.protocol||"http",authToken:_})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${c||u?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[c&&e.jsxs(ie,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(pe,{className:"h-4 w-4"}),e.jsx(me,{children:c})]}),u&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(xe,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure local or remote CLIProxy Plus connection for proxy-based profiles"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Connection Mode"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:()=>o({remote:{...S,enabled:!1}}),disabled:n,className:`p-4 rounded-lg border-2 text-left transition-all ${p?"border-border hover:border-muted-foreground/50":"border-primary bg-primary/5"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(ge,{className:`w-5 h-5 ${p?"text-muted-foreground":"text-primary"}`}),e.jsx("span",{className:"font-medium",children:"Local"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Run CLIProxy Plus binary on this machine"})]}),e.jsxs("button",{onClick:()=>o({remote:{...S,enabled:!0}}),disabled:n,className:`p-4 rounded-lg border-2 text-left transition-all ${p?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(U,{className:`w-5 h-5 ${p?"text-primary":"text-muted-foreground"}`}),e.jsx("span",{className:"font-medium",children:"Remote"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect to a remote CLIProxy Plus server"})]})]})]}),p&&e.jsx(be,{config:t,saving:n,testing:h,testResult:g,displayHost:I,displayPort:L,displayAuthToken:_,displayManagementKey:R,setEditedHost:f,setEditedPort:j,setEditedAuthToken:v,setEditedManagementKey:C,onSaveHost:X,onSavePort:Z,onSaveAuthToken:J,onSaveManagementKey:ee,onSaveConfig:o,onTestConnection:se}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Fallback Settings"}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Enable fallback to local"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use local proxy if remote is unreachable"})]}),e.jsx(A,{checked:w.enabled??!0,onCheckedChange:a=>o({fallback:{...w,enabled:a}}),disabled:n||!p})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-start local proxy"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically start local proxy on fallback"})]}),e.jsx(A,{checked:w.auto_start??!1,onCheckedChange:a=>o({fallback:{...w,auto_start:a}}),disabled:n||!p||!w.enabled})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"text-base font-medium flex items-center gap-2",children:[e.jsx(fe,{className:"w-4 h-4"}),"Advanced"]}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Debug Mode"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable developer diagnostics in browser console"})]}),e.jsx(A,{checked:P,onCheckedChange:W,disabled:n})]}),P&&e.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 pl-0.5",children:"Debug mode enabled. Check browser console for detailed logs."})]})]}),!p&&e.jsx(je,{config:t,saving:n,displayLocalPort:K,setEditedLocalPort:d,onSaveLocalPort:te,onSaveConfig:o})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(B,{variant:"outline",size:"sm",onClick:()=>{x(),r()},disabled:s||n,className:"w-full",children:[e.jsx(D,{className:`w-4 h-4 mr-2 ${s?"animate-spin":""}`}),"Refresh"]})})]})}export{Ie as default};
|
|
1
|
+
import{j as e}from"./radix-ui-DP8--cuX.js";import{r as i}from"./react-vendor-CNOkPC89.js";import{aO as ae,aP as oe,ao as M,I as E,X as re,Y as ne,Z as le,_ as ce,$ as F,b as B,aQ as de,aL as ie,aN as me,m as xe}from"./index-C1c994wt.js";import{S as A}from"./switch-C7NO4S4-.js";import{aC as U,a3 as D,e as ue,p as z,W as he,_ as pe,aD as ge,aE as fe}from"./icons-B8zfgpli.js";import"./tanstack-C1q4365B.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";function ye(){const{state:t}=ae(),s=oe(),[n,c]=i.useState(null),[u,g]=i.useState(null),[h,m]=i.useState(null),[f,y]=i.useState(null),[j,b]=i.useState(null),v=i.useCallback(async()=>{try{s.setProxyLoading(!0),s.setProxyError(null);const l=await M.cliproxyServer.get();s.setProxyConfig(l)}catch(l){s.setProxyError(l.message)}finally{s.setProxyLoading(!1)}},[s]),N=i.useCallback(async l=>{const d=t.proxyConfig;if(!d)return;const x={remote:{...d.remote,...l.remote},fallback:{...d.fallback,...l.fallback},local:{...d.local,...l.local}};s.setProxyConfig(x),s.setProxyTestResult(null);try{s.setProxySaving(!0),s.setProxyError(null);const o=await M.cliproxyServer.update(l);s.setProxyConfig(o),s.setProxySuccess(!0),setTimeout(()=>s.setProxySuccess(!1),1500)}catch(o){s.setProxyConfig(d),s.setProxyError(o.message)}finally{s.setProxySaving(!1)}},[t.proxyConfig,s]),C=i.useCallback(async l=>{const{host:d,port:x,protocol:o,authToken:k}=l;if(!d){s.setProxyError("Host is required");return}try{s.setProxyTesting(!0),s.setProxyError(null),s.setProxyTestResult(null);const r=x?parseInt(x,10):void 0,P=await M.cliproxyServer.test({host:d,port:r||void 0,protocol:o,authToken:k||void 0});s.setProxyTestResult(P)}catch(r){s.setProxyError(r.message)}finally{s.setProxyTesting(!1)}},[s]);return{config:t.proxyConfig,loading:t.proxyLoading,saving:t.proxySaving,error:t.proxyError,success:t.proxySuccess,testResult:t.proxyTestResult,testing:t.proxyTesting,editedHost:n,setEditedHost:c,editedPort:u,setEditedPort:g,editedAuthToken:h,setEditedAuthToken:m,editedManagementKey:f,setEditedManagementKey:y,editedLocalPort:j,setEditedLocalPort:b,fetchConfig:v,saveConfig:N,testConnection:C}}function je({config:t,saving:s,displayLocalPort:n,setEditedLocalPort:c,onSaveLocalPort:u,onSaveConfig:g}){const h=t.local;return e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Local Proxy"}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Port"}),e.jsx(E,{type:"number",value:n,onChange:m=>c(m.target.value),onBlur:u,placeholder:"8317",className:"font-mono max-w-32",disabled:s})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-start"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Start local proxy automatically when needed"})]}),e.jsx(A,{checked:h.auto_start??!0,onCheckedChange:m=>g({local:{...h,auto_start:m}}),disabled:s})]})]})]})}function be({config:t,saving:s,testing:n,testResult:c,displayHost:u,displayPort:g,displayAuthToken:h,displayManagementKey:m,setEditedHost:f,setEditedPort:y,setEditedAuthToken:j,setEditedManagementKey:b,onSaveHost:v,onSavePort:N,onSaveAuthToken:C,onSaveManagementKey:l,onSaveConfig:d,onTestConnection:x}){const o=t.remote,k=r=>r==="https"?443:8317;return e.jsxs("div",{className:"space-y-4 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("h4",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Remote Server Configuration"]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Host"}),e.jsx(E,{value:u,onChange:r=>f(r.target.value),onBlur:v,placeholder:"192.168.1.100 or proxy.example.com",className:"font-mono",disabled:s})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("label",{className:"text-sm text-muted-foreground",children:["Port"," ",e.jsxs("span",{className:"text-xs opacity-70",children:["(default: ",k(t.remote.protocol||"http"),")"]})]}),e.jsx(E,{type:"text",inputMode:"numeric",value:g,onChange:r=>y(r.target.value.replace(/\D/g,"")),onBlur:N,placeholder:`Leave empty for ${k(t.remote.protocol||"http")}`,className:"font-mono",disabled:s})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Protocol"}),e.jsxs(re,{value:t.remote.protocol||"http",onValueChange:r=>d({remote:{...o,protocol:r}}),disabled:s,children:[e.jsx(ne,{children:e.jsx(le,{})}),e.jsxs(ce,{children:[e.jsx(F,{value:"http",children:"HTTP"}),e.jsx(F,{value:"https",children:"HTTPS"})]})]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"API Key (optional)"}),e.jsx(E,{type:"password",value:h,onChange:r=>j(r.target.value),onBlur:C,placeholder:"For /v1/* API endpoints",className:"font-mono",disabled:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used for API requests to /v1/chat/completions"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-sm text-muted-foreground",children:"Management Key (optional)"}),e.jsx(E,{type:"password",value:m,onChange:r=>b(r.target.value),onBlur:l,placeholder:"For /v0/management/* endpoints",className:"font-mono",disabled:s}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used for dashboard management APIs. Falls back to API Key if not set."})]}),e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsx(B,{onClick:x,disabled:n||!u,variant:"outline",className:"w-full",children:n?e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"w-4 h-4 mr-2 animate-spin"}),"Testing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ue,{className:"w-4 h-4 mr-2"}),"Test Connection"]})}),c&&e.jsx("div",{className:`p-3 rounded-md ${c.reachable?"bg-green-50 border border-green-200 dark:bg-green-900/20 dark:border-green-900/50":"bg-red-50 border border-red-200 dark:bg-red-900/20 dark:border-red-900/50"}`,children:e.jsx("div",{className:"flex items-center gap-2",children:c.reachable?e.jsxs(e.Fragment,{children:[e.jsx(z,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),e.jsxs("span",{className:"text-sm font-medium text-green-700 dark:text-green-300",children:["Connected (",c.latencyMs,"ms)"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 text-red-600 dark:text-red-400"}),e.jsx("span",{className:"text-sm font-medium text-red-700 dark:text-red-300",children:c.error||"Connection failed"})]})})})]})]})}const $="ccs_debug_mode";function Ie(){const{config:t,loading:s,saving:n,error:c,success:u,testResult:g,testing:h,editedHost:m,setEditedHost:f,editedPort:y,setEditedPort:j,editedAuthToken:b,setEditedAuthToken:v,editedManagementKey:N,setEditedManagementKey:C,editedLocalPort:l,setEditedLocalPort:d,fetchConfig:x,saveConfig:o,testConnection:k}=ye(),{fetchRawConfig:r}=de(),[P,O]=i.useState(()=>{try{return localStorage.getItem($)==="true"}catch{return!1}}),W=a=>{O(a);try{localStorage.setItem($,String(a))}catch{}};if(i.useEffect(()=>{if(P&&t){const a={...t,remote:{...t.remote,auth_token:t.remote.auth_token?"[REDACTED]":void 0,management_key:t.remote.management_key?"[REDACTED]":void 0}};console.log("[CCS Debug] Debug mode enabled - proxy config:",a)}},[P,t]),i.useEffect(()=>{x(),r()},[x,r]),s||!t)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(D,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})});const p=t.remote.enabled??!1,S=t.remote,w=t.fallback,q=t.remote.host??"",V=t.remote.port!==void 0?t.remote.port.toString():"",Y=t.remote.auth_token??"",G=t.remote.management_key??"",Q=(t.local.port??8317).toString(),I=m??q,L=y??V,_=b??Y,R=N??G,K=l??Q,X=()=>{const a=m??I;a!==t.remote.host&&o({remote:{...S,host:a}}),f(null)},Z=()=>{const a=y??L,T=a===""?void 0:parseInt(a,10),H=T&&!isNaN(T)&&T>0?T:void 0;H!==t.remote.port&&o({remote:{...S,port:H}}),j(null)},J=()=>{const a=b??_;a!==t.remote.auth_token&&o({remote:{...S,auth_token:a}}),v(null)},ee=()=>{const a=N??R;a!==t.remote.management_key&&o({remote:{...S,management_key:a||void 0}}),C(null)},te=()=>{const a=parseInt(l??K,10);!isNaN(a)&&a!==t.local.port&&o({local:{...t.local,port:a}}),d(null)},se=()=>{k({host:I,port:L,protocol:t.remote.protocol||"http",authToken:_})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${c||u?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[c&&e.jsxs(ie,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(pe,{className:"h-4 w-4"}),e.jsx(me,{children:c})]}),u&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(xe,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure local or remote CLIProxy Plus connection for proxy-based profiles"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Connection Mode"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:()=>o({remote:{...S,enabled:!1}}),disabled:n,className:`p-4 rounded-lg border-2 text-left transition-all ${p?"border-border hover:border-muted-foreground/50":"border-primary bg-primary/5"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(ge,{className:`w-5 h-5 ${p?"text-muted-foreground":"text-primary"}`}),e.jsx("span",{className:"font-medium",children:"Local"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Run CLIProxy Plus binary on this machine"})]}),e.jsxs("button",{onClick:()=>o({remote:{...S,enabled:!0}}),disabled:n,className:`p-4 rounded-lg border-2 text-left transition-all ${p?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(U,{className:`w-5 h-5 ${p?"text-primary":"text-muted-foreground"}`}),e.jsx("span",{className:"font-medium",children:"Remote"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect to a remote CLIProxy Plus server"})]})]})]}),p&&e.jsx(be,{config:t,saving:n,testing:h,testResult:g,displayHost:I,displayPort:L,displayAuthToken:_,displayManagementKey:R,setEditedHost:f,setEditedPort:j,setEditedAuthToken:v,setEditedManagementKey:C,onSaveHost:X,onSavePort:Z,onSaveAuthToken:J,onSaveManagementKey:ee,onSaveConfig:o,onTestConnection:se}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Fallback Settings"}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Enable fallback to local"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Use local proxy if remote is unreachable"})]}),e.jsx(A,{checked:w.enabled??!0,onCheckedChange:a=>o({fallback:{...w,enabled:a}}),disabled:n||!p})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Auto-start local proxy"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically start local proxy on fallback"})]}),e.jsx(A,{checked:w.auto_start??!1,onCheckedChange:a=>o({fallback:{...w,auto_start:a}}),disabled:n||!p||!w.enabled})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"text-base font-medium flex items-center gap-2",children:[e.jsx(fe,{className:"w-4 h-4"}),"Advanced"]}),e.jsxs("div",{className:"space-y-3 p-4 rounded-lg border bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:"Debug Mode"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable developer diagnostics in browser console"})]}),e.jsx(A,{checked:P,onCheckedChange:W,disabled:n})]}),P&&e.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 pl-0.5",children:"Debug mode enabled. Check browser console for detailed logs."})]})]}),!p&&e.jsx(je,{config:t,saving:n,displayLocalPort:K,setEditedLocalPort:d,onSaveLocalPort:te,onSaveConfig:o})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(B,{variant:"outline",size:"sm",onClick:()=>{x(),r()},disabled:s||n,className:"w-full",children:[e.jsx(D,{className:`w-4 h-4 mr-2 ${s?"animate-spin":""}`}),"Refresh"]})})]})}export{Ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./radix-ui-DP8--cuX.js";import{r as l}from"./react-vendor-CNOkPC89.js";import{aJ as o,aK as m,aL as c,aM as x,aN as u,b as h,C as p,a as g}from"./index-
|
|
1
|
+
import{j as s}from"./radix-ui-DP8--cuX.js";import{r as l}from"./react-vendor-CNOkPC89.js";import{aJ as o,aK as m,aL as c,aM as x,aN as u,b as h,C as p,a as g}from"./index-C1c994wt.js";import{z as j,Y as f,aB as N,T as b}from"./icons-B8zfgpli.js";import"./tanstack-C1q4365B.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";function L(){const[t,i]=l.useState("commands"),{data:e}=o(),{data:n,isLoading:r}=m(t),d=[{id:"commands",label:"Commands",icon:j,count:e?.commands??0},{id:"skills",label:"Skills",icon:f,count:e?.skills??0},{id:"agents",label:"Agents",icon:N,count:e?.agents??0}];return s.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Shared Data"}),s.jsx("p",{className:"text-muted-foreground",children:"Commands, skills, and agents shared across Claude instances"})]}),e&&!e.symlinkStatus.valid&&s.jsxs(c,{variant:"warning",children:[s.jsx(b,{className:"h-4 w-4"}),s.jsx(x,{children:"Configuration Required"}),s.jsxs(u,{children:[e.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),s.jsx("div",{className:"flex gap-2 border-b pb-2",children:d.map(a=>s.jsxs(h,{variant:t===a.id?"default":"ghost",size:"sm",onClick:()=>i(a.id),className:"flex items-center gap-2",children:[s.jsx(a.icon,{className:"w-4 h-4"}),a.label," (",a.count,")"]},a.id))}),s.jsx("div",{className:"mt-4",children:r?s.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):n?.items.length===0?s.jsxs("div",{className:"text-muted-foreground",children:["No ",t," found"]}):s.jsx("div",{className:"grid gap-3",children:n?.items.map(a=>s.jsx(p,{children:s.jsxs(g,{children:[s.jsx("div",{className:"font-medium",children:a.name}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.description}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 font-mono truncate",children:a.path})]})},a.name))})})]})}export{L as SharedPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,a0 as s,a1 as n}from"./radix-ui-DP8--cuX.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-
|
|
1
|
+
import{j as a,a0 as s,a1 as n}from"./radix-ui-DP8--cuX.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-C1c994wt.js";function c({className:t,...r}){return a.jsx(s,{"data-slot":"switch",className:e("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:a.jsx(n,{"data-slot":"switch-thumb",className:e("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{c as S};
|
package/dist/ui/index.html
CHANGED
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap"
|
|
25
25
|
rel="stylesheet"
|
|
26
26
|
/>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-C1c994wt.js"></script>
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/react-vendor-CNOkPC89.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/radix-ui-DP8--cuX.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/tanstack-C1q4365B.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/notifications-B2HqRBj7.js">
|
|
32
|
-
<link rel="modulepreload" crossorigin href="/assets/icons-
|
|
32
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-B8zfgpli.js">
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/utils-CzKF5WmX.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/form-utils-C-pVd1--.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/code-highlight-BRUf_pqB.js">
|
|
36
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
36
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DZ9RMk63.css">
|
|
37
37
|
</head>
|
|
38
38
|
<body>
|
|
39
39
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DP8--cuX.js";import{r as p}from"./react-vendor-CNOkPC89.js";import{u as Qe,a as fe,b as fs}from"./tanstack-C1q4365B.js";import{b as w,C as Be,a as Je,c as D,P as ae,L as ne,I as je,X as ve,Y as Ne,Z as we,_ as be,$ as ie,a0 as We,a1 as js,a2 as Ye,a3 as Xe,u as Ze,a4 as ye,a5 as Ce,a6 as ke,a7 as Ae,a8 as es,a9 as vs,aa as Fe,ab as Ue,B as _,ac as Ns,q as ss,m as Se,l as ws,ad as bs,ae as ys,af as Cs,ag as B,T as J,o as W,p as Y,ah as ks,ai as As,aj as Ss,ak as de,al as Ps,am as Ms,an as Ds,ao as se,ap as Ts,aq as Os,ar as Is,as as Es,H as _s,J as Ls,K as He,M as Ve,at as Rs,au as Fs,av as Us,aw as Hs,ax as Vs,ay as Gs,az as Ks,aA as $s,E as qs,G as zs,aB as Qs,aC as Bs,aD as Js,aE as Ws,aF as Ys,aG as Xs,S as Zs}from"./index-bcsgnPfl.js";import{t as F}from"./notifications-B2HqRBj7.js";import{b as ts,L as q,m as Pe,v as et,j as z,l as st,ak as Me,a3 as $,n as Q,Y as Z,al as as,am as re,Z as oe,I as tt,f as at,$ as De,an as nt,ae as it,X as le,V as ns,ao as Ge,ap as rt,T as pe,s as te,aq as ot,ar as lt,ad as is,p as ct,as as dt,_ as mt,ah as ut,A as xt,at as pt,au as ht,S as gt,av as Ke,aw as ft,ax as jt,U as vt,ay as rs}from"./icons-v7BVCs0w.js";import{S as Te,C as Nt}from"./confirm-dialog-BkwrKQU-.js";import{S as wt}from"./switch-LDXs_uRr.js";import{A as bt,a as yt,b as Ct,c as kt,d as At,e as St,f as Pt,g as Mt}from"./alert-dialog-Bg5o3Alj.js";import"./utils-CzKF5WmX.js";import"./form-utils-C-pVd1--.js";import"./code-highlight-BRUf_pqB.js";const X={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"}]}},he=8317,me="ccs-internal-managed";async function Dt(){try{const s=await fetch("/api/settings/auth/tokens/raw");return s.ok?(await s.json())?.apiKey?.value??me:me}catch{return me}}async function ge(s,n){const t=X[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},l=await Dt(),u={env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${he}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:l,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:u})})).ok,presetName:a?.name||t.defaultModel}}catch{return{success:!1}}}const $e=[{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"}],os=["provider","auth","variant","success"];function Tt(s){return s==="account"?1:os.indexOf(s)}function Ot({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 It({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(ts,{className:"w-4 h-4 text-muted-foreground"})]},t.id))})}function Et({selectedProvider:s,providers:n,authCommand:t,isRefreshing:a,isPending:i,onBack:l,onStartAuth:c,onRefresh:u}){const[r,d]=p.useState(!1),h=async x=>{await navigator.clipboard.writeText(x),d(!0),setTimeout(()=>d(!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(x=>x.id===s)?.name," to add an account"]}),e.jsx(w,{onClick:c,disabled:i,className:"w-full gap-2",size:"lg",children:i?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 animate-spin"}),"Authenticating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Pe,{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(Be,{children:e.jsxs(Je,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(et,{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(w,{variant:"outline",size:"icon",onClick:()=>h(t),children:r?e.jsx(z,{className:"w-4 h-4 text-green-500"}):e.jsx(st,{className:"w-4 h-4"})})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(w,{variant:"ghost",onClick:l,disabled:i,children:[e.jsx(Me,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs(w,{variant:"outline",onClick:u,disabled:a||i,children:[e.jsx($,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),a?"Checking...":"Refresh Status"]})]})]})}function _t({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(l=>e.jsxs("button",{type:"button",onClick:()=>t(l),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(Q,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("div",{className:D("font-medium",n&&ae),children:l.email||l.id}),l.isDefault&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Default account"})]})]}),e.jsx(ts,{className:"w-4 h-4 text-muted-foreground"})]},l.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(Pe,{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(w,{variant:"ghost",onClick:i,children:[e.jsx(Me,{className:"w-4 h-4 mr-2"}),"Back"]})})]})}function Lt({selectedProvider:s,selectedAccount:n,variantName:t,modelName:a,isPending:i,privacyMode:l,onVariantNameChange:c,onModelChange:u,onBack:r,onSkip:d,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(Q,{className:"w-4 h-4"}),e.jsxs("span",{children:["Using:"," ",e.jsx("span",{className:D(l&&ae),children:n.email||n.id})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ne,{htmlFor:"variant-name",children:"Variant Name *"}),e.jsx(je,{id:"variant-name",value:t,onChange:x=>c(x.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(ne,{children:"Model"}),e.jsxs(ve,{value:a,onValueChange:u,children:[e.jsx(Ne,{children:e.jsx(we,{placeholder:"Select a model"})}),e.jsx(be,{children:X[s]?.models.map(x=>e.jsx(ie,{value:x.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:x.name}),x.description&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["- ",x.description]})]})},x.id))})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Default: ",X[s]?.defaultModel||"provider default"]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsxs(w,{variant:"ghost",onClick:r,children:[e.jsx(Me,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{variant:"ghost",onClick:d,children:"Skip"}),e.jsx(w,{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 Rt({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(z,{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(Be,{children:e.jsxs(Je,{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(w,{onClick:n,className:"w-full",children:"Done"})]})}function Ft({open:s,onClose:n}){const[t,a]=p.useState("provider"),[i,l]=p.useState(""),[c,u]=p.useState(null),[r,d]=p.useState(""),[h,x]=p.useState(""),[g,o]=p.useState(!1),[b,A]=p.useState(!1),{data:v,refetch:O}=We(),k=js(),T=Ye(),P=Xe(),{privacyMode:L}=Ze(),y=v?.authStatus.find(N=>N.provider===i),j=p.useMemo(()=>y?.accounts||[],[y?.accounts]);p.useEffect(()=>{if(!s){const N=setTimeout(()=>{a("provider"),l(""),u(null),d(""),x(""),A(!1)},0);return()=>clearTimeout(N)}},[s]),p.useEffect(()=>{if(t==="auth"&&j.length>0&&!b){const N=setTimeout(()=>{a("account")},0);return()=>clearTimeout(N)}},[t,j,b]);const f=async()=>{o(!0),await O(),o(!1)},S=()=>{const N=(y?.accounts?.length||0)===0;T.mutate({provider:i},{onSuccess:async H=>{if(N){const V=await ge(i);V.success&&V.presetName?F.success(`Applied "${V.presetName}" preset`):V.success||F.warning("Account added, but failed to apply default preset")}H.account&&(u(H.account),a("variant")),O()}})},I=N=>{l(N),(v?.authStatus.find(ce=>ce.provider===N)?.accounts||[]).length===0?a("auth"):a("account")},R=N=>{u(N),a("variant")},U=async()=>{if(!(!r||!i))try{await k.mutateAsync({name:r,provider:i,model:h||void 0,account:c?.id}),a("success")}catch(N){console.error("Failed to create variant:",N)}},m=`ccs ${i} --auth --add`,C=Tt(t),M=N=>{if(!N&&(T.isPending&&i&&P.mutate(i),t==="success"||t==="provider")){n();return}};return e.jsx(ye,{open:s,onOpenChange:M,children:e.jsxs(Ce,{className:"sm:max-w-lg",onPointerDownOutside:N=>{t!=="success"&&t!=="provider"&&N.preventDefault()},onEscapeKeyDown:N=>{(T.isPending||k.isPending)&&N.preventDefault()},children:[e.jsxs(ke,{children:[e.jsxs(Ae,{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"w-5 h-5 text-primary"}),"Quick Setup Wizard"]}),e.jsxs(es,{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(It,{providers:$e,onSelect:I}),t==="auth"&&e.jsx(Et,{selectedProvider:i,providers:$e,authCommand:m,isRefreshing:g,isPending:T.isPending,onBack:()=>a("provider"),onStartAuth:S,onRefresh:f}),t==="account"&&e.jsx(_t,{accounts:j,privacyMode:L,onSelect:R,onAddNew:()=>{A(!0),a("auth")},onBack:()=>a("provider")}),t==="variant"&&e.jsx(Lt,{selectedProvider:i,selectedAccount:c,variantName:r,modelName:h,isPending:k.isPending,privacyMode:L,onVariantNameChange:d,onModelChange:x,onBack:()=>j.length>0?a("account"):a("provider"),onSkip:n,onCreate:U}),t==="success"&&e.jsx(Rt,{variantName:r,onClose:n})]}),e.jsx(Ot,{currentProgress:C,allSteps:os})]})})}function Ut({open:s,onClose:n,provider:t,displayName:a,isFirstAccount:i=!1}){const[l,c]=p.useState(""),u=Ye(),r=vs(),d=Xe(),h=t==="kiro",x=u.isPending||r.isPending,g=()=>{x&&d.mutate(t),c(""),n()},o=()=>{u.mutate({provider:t,nickname:l.trim()||void 0},{onSuccess:async()=>{const v=await ge(t);v.success&&v.presetName?i&&F.success(`Applied "${v.presetName}" preset`):v.success||F.warning("Account added, but failed to apply default preset. You may need to configure settings manually."),c(""),n()}})},b=()=>{r.mutate(void 0,{onSuccess:async()=>{const v=await ge("kiro");v.success&&v.presetName&&i&&F.success(`Applied "${v.presetName}" preset`),c(""),n()}})},A=v=>{v||g()};return e.jsx(ye,{open:s,onOpenChange:A,children:e.jsxs(Ce,{className:"sm:max-w-md",children:[e.jsxs(ke,{children:[e.jsxs(Ae,{children:["Add ",a," Account"]}),e.jsx(es,{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(ne,{htmlFor:"nickname",children:"Nickname (optional)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(je,{id:"nickname",value:l,onChange:v=>c(v.target.value),placeholder:"e.g., work, personal",disabled:x,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(w,{variant:"ghost",onClick:g,children:"Cancel"}),h&&e.jsx(w,{variant:"outline",onClick:b,disabled:x,children:r.isPending?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-2 animate-spin"}),"Importing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(as,{className:"w-4 h-4 mr-2"}),"Import from IDE"]})}),e.jsx(w,{onClick:o,disabled:x,children:u.isPending?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-2 animate-spin"}),"Authenticating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"w-4 h-4 mr-2"}),"Authenticate"]})})]}),u.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 Ht=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"];function Vt(s){const n=s?.env||{};return Ht.filter(t=>!n[t]?.trim())}function Gt(s){const[n,t]=p.useState(null),[a,i]=p.useState(!1),l=Qe(),{data:c,isLoading:u,refetch:r}=fe({queryKey:["settings",s],queryFn:async()=>{const f=await fetch(`/api/settings/${s}/raw`);return f.ok?f.json():{profile:s,settings:{env:{}},mtime:Date.now(),path:`~/.ccs/profiles/${s}/settings.json`}}}),d=c?.settings,h=p.useMemo(()=>n!==null?n:d?JSON.stringify(d,null,2):`{
|
|
2
|
-
"env": {}
|
|
3
|
-
}`,[n,d]),x=p.useCallback(f=>{t(f)},[]),g=p.useMemo(()=>{try{return JSON.parse(h)}catch{return d||{env:{}}}},[h,d]),o=g?.env?.ANTHROPIC_MODEL,b=g?.env?.ANTHROPIC_DEFAULT_OPUS_MODEL,A=g?.env?.ANTHROPIC_DEFAULT_SONNET_MODEL,v=g?.env?.ANTHROPIC_DEFAULT_HAIKU_MODEL,O=p.useCallback((f,S)=>{const I={...g?.env||{},[f]:S},R={...g,env:I};t(JSON.stringify(R,null,2))},[g]),k=p.useCallback(f=>{const S={...g?.env||{},...f},I={...g,env:S};t(JSON.stringify(I,null,2))},[g]),T=p.useMemo(()=>{try{return JSON.parse(h),!0}catch{return!1}},[h]),P=p.useMemo(()=>n===null?!1:n!==JSON.stringify(d,null,2),[n,d]),L=p.useMemo(()=>Vt(g),[g]),y=fs({mutationFn:async()=>{const f=JSON.parse(h),S=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:f,expectedMtime:c?.mtime})});if(S.status===409)throw new Error("CONFLICT");if(!S.ok)throw new Error("Failed to save");return S.json()},onSuccess:f=>{l.invalidateQueries({queryKey:["settings",s]}),t(null),f?.warning?F.success("Settings saved",{description:f.warning}):F.success("Settings saved")},onError:f=>{f.message==="CONFLICT"?i(!0):F.error(f.message)}}),j=async f=>{i(!1),f?(await r(),y.mutate()):t(null)};return{data:c,isLoading:u,refetch:r,rawJsonContent:h,rawJsonEdits:n,isRawJsonValid:T,hasChanges:P,currentSettings:g,currentModel:o,opusModel:b,sonnetModel:A,haikuModel:v,handleRawJsonChange:x,updateEnvValue:O,updateEnvValues:k,saveMutation:{mutate:()=>y.mutate(),isPending:y.isPending},conflictDialog:a,setConflictDialog:i,handleConflictResolve:j,missingRequiredFields:L}}function K({label:s,description:n,value:t,onChange:a,catalog:i,allModels:l,disabled:c}){const u=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(ve,{value:t||"",onValueChange:a,disabled:c,children:[e.jsx(Ne,{className:"h-9",children:e.jsx(we,{placeholder:"Select model",children:t&&e.jsx("span",{className:"truncate font-mono text-xs",children:t})})}),e.jsxs(be,{className:"max-h-[300px]",children:[i&&i.models.length>0&&e.jsxs(Fe,{children:[e.jsx(Ue,{className:"text-xs text-primary",children:"Recommended"}),i.models.map(r=>e.jsx(ie,{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(_,{variant:"outline",className:"text-[9px] h-4 px-1",children:"PAID"}),t===r.id&&e.jsx(z,{className:"w-3 h-3 text-primary ml-auto"})]})},r.id))]}),l.length>0&&e.jsxs(Fe,{children:[e.jsxs(Ue,{className:"text-xs text-muted-foreground",children:["All Models (",l.length,")"]}),l.filter(r=>!u.has(r.id)).map(r=>e.jsx(ie,{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(z,{className:"w-3 h-3 text-primary ml-auto"})]})},r.id))]}),(!i||i.models.length===0)&&l.length===0&&e.jsx("div",{className:"py-2 px-3 text-xs text-muted-foreground",children:"No models available"})]})]})]})}function Kt({open:s,onClose:n,currentValues:t,onApply:a,onSave:i,isSaving:l,catalog:c,allModels:u}){const[r,d]=p.useState(t),[h,x]=p.useState(""),g=o=>{o?(d(t),x("")):n()};return e.jsx(ye,{open:s,onOpenChange:g,children:e.jsxs(Ce,{className:"sm:max-w-md",children:[e.jsx(ke,{children:e.jsxs(Ae,{className:"flex items-center gap-2",children:[e.jsx(Z,{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(ne,{htmlFor:"preset-name",children:"Preset Name (optional)"}),e.jsx(je,{id:"preset-name",value:h,onChange:o=>x(o.target.value),placeholder:"e.g., My Custom Config",className:"text-sm"})]}),e.jsx(Te,{}),e.jsx(K,{label:"Default Model",description:"Used when no specific tier is requested",value:r.default,onChange:o=>d({...r,default:o}),catalog:c,allModels:u}),e.jsx(K,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:r.opus,onChange:o=>d({...r,opus:o}),catalog:c,allModels:u}),e.jsx(K,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:r.sonnet,onChange:o=>d({...r,sonnet:o}),catalog:c,allModels:u}),e.jsx(K,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:r.haiku,onChange:o=>d({...r,haiku:o}),catalog:c,allModels:u})]}),e.jsxs(Ns,{className:"gap-2 sm:gap-0",children:[e.jsx(w,{variant:"outline",onClick:n,children:"Cancel"}),i&&e.jsxs(w,{variant:"secondary",onClick:()=>i(r,h||void 0),disabled:l||!h.trim(),children:[l?e.jsx(q,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(re,{className:"w-4 h-4 mr-1"}),"Save Preset"]}),e.jsxs(w,{onClick:()=>a(r,h||void 0),children:[e.jsx(oe,{className:"w-4 h-4 mr-1"}),"Apply Preset"]})]})]})})}function ee({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(ss,{value:n,size:"icon",className:"h-6 w-6"})]})]})}function $t({provider:s,displayName:n,data:t,authStatus:a}){return e.jsx(Se,{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(tt,{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(ss,{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(_,{variant:"outline",className:"w-fit text-green-600 border-green-200 bg-green-50",children:[e.jsx(at,{className:"w-3 h-3 mr-1"}),"Authenticated"]}):e.jsx(_,{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(ee,{label:"Run with prompt",command:`ccs ${s} "your prompt"`}),e.jsx(ee,{label:"Change model",command:`ccs ${s} --config`}),e.jsx(ee,{label:"Add account",command:`ccs ${s} --add`}),e.jsx(ee,{label:"List accounts",command:`ccs ${s} --accounts`})]})]})]})})}const qt={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"},zt={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"}},Qt={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 Oe({provider:s,className:n,size:t="md"}){const a=s.toLowerCase(),i=zt[a]||{text:"text-gray-600",letter:s[0]?.toUpperCase()||"?"},l=Qt[t],c=qt[a];return e.jsx("div",{className:D("flex items-center justify-center rounded-md",c&&"bg-white p-1",l.container,n),children:c?e.jsx("img",{src:c,alt:`${s} logo`,className:D(l.icon,"object-contain")}):e.jsx("span",{className:D("font-semibold",i.text,l.text),children:i.letter})})}function Bt({displayName:s,logoProvider:n,provider:t,data:a,isLoading:i,hasChanges:l,isRawJsonValid:c,isSaving:u,isRemoteMode:r,port:d,onRefetch:h,onSave:x}){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(Oe,{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(_,{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(De,{className:"w-3 h-3"}),"Remote"]}),d&&e.jsxs(_,{variant:"outline",className:"text-xs gap-1 font-mono",children:[e.jsx(nt,{className:"w-3 h-3"}),":",d]}),!r&&a?.path&&e.jsx(_,{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(w,{variant:"ghost",size:"sm",onClick:h,disabled:i,children:e.jsx($,{className:`w-4 h-4 ${i?"animate-spin":""}`})}),e.jsx(w,{size:"sm",onClick:x,disabled:u||!l||!c,children:u?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(it,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Jt({catalog:s,savedPresets:n,currentModel:t,opusModel:a,sonnetModel:i,haikuModel:l,providerModels:c,onApplyPreset:u,onUpdateEnvValue:r,onOpenCustomPreset:d,onDeletePreset:h,isDeletePending:x}){const g=s&&s.models.length>0||n.length>0;return e.jsxs(e.Fragment,{children:[g&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(Z,{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(o=>e.jsxs(w,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>{const b=o.presetMapping||{default:o.id,opus:o.id,sonnet:o.id,haiku:o.id};u({ANTHROPIC_MODEL:b.default,ANTHROPIC_DEFAULT_OPUS_MODEL:b.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:b.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:b.haiku})},children:[e.jsx(oe,{className:"w-3 h-3"}),o.name]},o.id)),n.map(o=>e.jsxs("div",{className:"group relative",children:[e.jsxs(w,{variant:"secondary",size:"sm",className:"text-xs h-7 gap-1 pr-6",onClick:()=>{u({ANTHROPIC_MODEL:o.default,ANTHROPIC_DEFAULT_OPUS_MODEL:o.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:o.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:o.haiku})},children:[e.jsx(re,{className:"w-3 h-3 fill-current"}),o.name]}),e.jsx(w,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-7 w-5 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:b=>{b.stopPropagation(),h(o.name)},disabled:x,children:e.jsx(le,{className:"w-3 h-3"})})]},o.name)),e.jsxs(w,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1 border-primary/50 text-primary hover:bg-primary/10 hover:border-primary",onClick:d,children:[e.jsx(ns,{className:"w-3 h-3"}),"Custom"]})]})]}),e.jsx(Te,{}),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(K,{label:"Default Model",description:"Used when no specific tier is requested",value:t,onChange:o=>r("ANTHROPIC_MODEL",o),catalog:s,allModels:c}),e.jsx(K,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:a,onChange:o=>r("ANTHROPIC_DEFAULT_OPUS_MODEL",o),catalog:s,allModels:c}),e.jsx(K,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:i,onChange:o=>r("ANTHROPIC_DEFAULT_SONNET_MODEL",o),catalog:s,allModels:c}),e.jsx(K,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:l,onChange:o=>r("ANTHROPIC_DEFAULT_HAIKU_MODEL",o),catalog:s,allModels:c})]})]})]})}function Wt(s){const n=Math.max(0,Math.min(100,s));return n<=20?"bg-destructive":n<=50?"bg-yellow-500":"bg-green-500"}function qe(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)),l=Math.floor(a/(1e3*60*60)),c=Math.floor(a/(1e3*60*60*24));return c>0?`${c}d ago`:l>0?`${l}h ago`:i>0?`${i}m ago`:"just now"}catch{return""}}function Yt(s){if(!s)return!1;try{const n=new Date(s);return new Date().getTime()-n.getTime()<3600*1e3}catch{return!1}}function Xt({account:s,onSetDefault:n,onRemove:t,onPauseToggle:a,isRemoving:i,isPausingAccount:l,privacyMode:c,showQuota:u}){const{data:r}=ws(u),{data:d,isLoading:h}=bs(s.provider,s.id,u),x=r?.accountStats?.[s.email||s.id]?.lastUsedAt,g=Yt(x),o=d?.success?ys(d.models):null,b=d?.success&&d.models.length>0?Cs(d.models):null;return e.jsxs("div",{className:D("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:D("flex items-center justify-center w-8 h-8 rounded-full",s.isDefault?"bg-primary/10":"bg-muted"),children:e.jsx(Q,{className:"w-4 h-4"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:D("font-medium text-sm",c&&ae),children:s.email||s.id}),s.isDefault&&e.jsxs(_,{variant:"secondary",className:"text-[10px] h-4 px-1.5 gap-0.5",children:[e.jsx(re,{className:"w-2.5 h-2.5 fill-current"}),"Default"]}),s.tier&&s.tier!=="unknown"&&e.jsx(_,{variant:"outline",className:D("text-[10px] h-4 px-1.5 uppercase",s.tier==="paid"&&"border-blue-500 text-blue-600",s.tier==="free"&&"border-gray-400 text-gray-500"),children:s.tier}),s.paused&&e.jsxs(_,{variant:"outline",className:"text-[10px] h-4 px-1.5 border-yellow-500 text-yellow-600",children:[e.jsx(Ge,{className:"w-2 h-2 mr-0.5"}),"Paused"]})]}),s.provider==="agy"&&e.jsx("div",{className:"flex items-center gap-1.5 mt-1",children:s.projectId?e.jsx(B,{children:e.jsxs(J,{children:[e.jsx(W,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(rt,{className:"w-3 h-3","aria-hidden":"true"}),e.jsx("span",{className:D("font-mono max-w-[180px] truncate",c&&ae),title:s.projectId,children:s.projectId})]})}),e.jsx(Y,{side:"bottom",children:e.jsx("p",{className:"text-xs",children:"GCP Project ID (read-only)"})})]})}):e.jsx(B,{children:e.jsxs(J,{children:[e.jsx(W,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600 dark:text-amber-500",children:[e.jsx(pe,{className:"w-3 h-3","aria-label":"Warning"}),e.jsx("span",{children:"Project ID: N/A"})]})}),e.jsx(Y,{side:"bottom",className:"max-w-[250px]",children:e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsx("p",{className:"font-medium text-amber-600",children:"Missing Project ID"}),e.jsx("p",{children:"This may cause errors. Remove the account and re-add it to fetch the project ID."})]})})]})})}),s.lastUsedAt&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mt-0.5",children:[e.jsx(te,{className:"w-3 h-3"}),"Last used: ",new Date(s.lastUsedAt).toLocaleDateString()]})]})]}),e.jsxs(ks,{children:[e.jsx(As,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon",className:"h-7 w-7",children:e.jsx(ot,{className:"w-4 h-4"})})}),e.jsxs(Ss,{align:"end",children:[!s.isDefault&&e.jsxs(de,{onClick:n,children:[e.jsx(re,{className:"w-4 h-4 mr-2"}),"Set as default"]}),a&&e.jsx(de,{onClick:()=>a(!s.paused),disabled:l,children:s.paused?e.jsxs(e.Fragment,{children:[e.jsx(lt,{className:"w-4 h-4 mr-2"}),l?"Resuming...":"Resume account"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"w-4 h-4 mr-2"}),l?"Pausing...":"Pause account"]})}),e.jsxs(de,{className:"text-destructive focus:text-destructive",onClick:t,disabled:i,children:[e.jsx(is,{className:"w-4 h-4 mr-2"}),i?"Removing...":"Remove account"]})]})]})]}),u&&e.jsx("div",{className:"pl-11",children:h?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(q,{className:"w-3 h-3 animate-spin"}),e.jsx("span",{children:"Loading quota..."})]}):o!==null?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:g?e.jsxs(e.Fragment,{children:[e.jsx(ct,{className:"w-3 h-3 text-emerald-500"}),e.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400",children:["Active · ",qe(x)]})]}):x?e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"w-3 h-3 text-muted-foreground"}),e.jsxs("span",{className:"text-muted-foreground",children:["Last used ",qe(x)]})]}):e.jsxs(e.Fragment,{children:[e.jsx(dt,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Not used yet"})]})}),e.jsx(B,{children:e.jsxs(J,{children:[e.jsx(W,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ps,{value:Math.max(0,Math.min(100,o)),className:"h-2 flex-1",indicatorClassName:Wt(o)}),e.jsxs("span",{className:"text-xs font-medium w-10 text-right",children:[o,"%"]})]})}),e.jsx(Y,{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:"}),Ms(d?.models||[]).map(A=>e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"truncate",children:A.displayName||A.name}),e.jsxs("span",{className:"font-mono",children:[A.percentage,"%"]})]},A.name)),b&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 pt-2 border-t border-border/50",children:[e.jsx(te,{className:"w-3 h-3 text-blue-400"}),e.jsxs("span",{className:"text-blue-400 font-medium",children:["Resets ",Ds(b)]})]})]})})]})})]}):d?.error||d&&!d.success?e.jsx(B,{children:e.jsxs(J,{children:[e.jsx(W,{asChild:!0,children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(_,{variant:"outline",className:"text-[10px] h-5 px-2 gap-1 border-muted-foreground/50 text-muted-foreground",children:[e.jsx(mt,{className:"w-3 h-3"}),"N/A"]})})}),e.jsx(Y,{side:"bottom",children:e.jsx("p",{className:"text-xs",children:d?.error||"Quota information unavailable"})})]})}):null})]})}function Zt({accounts:s,onAddAccount:n,onSetDefault:t,onRemoveAccount:a,onPauseToggle:i,isRemovingAccount:l,isPausingAccount:c,privacyMode:u,showQuota:r,isKiro:d,kiroNoIncognito:h,onKiroNoIncognitoChange:x,kiroSettingsLoading:g}){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(Q,{className:"w-4 h-4"}),"Accounts",s.length>0&&e.jsx(_,{variant:"secondary",className:"text-xs",children:s.length})]}),e.jsxs(w,{variant:"default",size:"sm",className:"h-7 text-xs gap-1",onClick:n,children:[e.jsx(ns,{className:"w-3 h-3"}),"Add"]})]}),s.length>0?e.jsx("div",{className:"space-y-2",children:s.map(o=>e.jsx(Xt,{account:o,onSetDefault:()=>t(o.id),onRemove:()=>a(o.id),onPauseToggle:i?b=>i(o.id,b):void 0,isRemoving:l,isPausingAccount:c,privacyMode:u,showQuota:r},o.id))}):e.jsxs("div",{className:"py-6 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed",children:[e.jsx(Q,{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&&x&&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(De,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Use incognito"})]}),e.jsx(wt,{checked:!h,onCheckedChange:o=>x(!o),disabled:g,className:"scale-90"})]})})]})}function ea({provider:s,catalog:n,savedPresets:t,currentModel:a,opusModel:i,sonnetModel:l,haikuModel:c,providerModels:u,onApplyPreset:r,onUpdateEnvValue:d,onOpenCustomPreset:h,onDeletePreset:x,isDeletePending:g,accounts:o,onAddAccount:b,onSetDefault:A,onRemoveAccount:v,onPauseToggle:O,isRemovingAccount:k,isPausingAccount:T,privacyMode:P,isRemoteMode:L}){const y=s==="kiro",[j,f]=p.useState(!0),[S,I]=p.useState(!0),[R,U]=p.useState(!1),m=p.useCallback(async()=>{if(y)try{I(!0);const N=(await se.config.get()).cliproxy;f(N?.kiro_no_incognito??!0)}catch{f(!0)}finally{I(!1)}},[y]),C=p.useCallback(async M=>{f(M),U(!0);try{const N=await se.config.get(),H=N.cliproxy??{};await se.config.update({...N,cliproxy:{...H,kiro_no_incognito:M}})}catch{f(!M)}finally{U(!1)}},[]);return p.useEffect(()=>{m()},[m]),e.jsx(Se,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsx(Jt,{catalog:n,savedPresets:t,currentModel:a,opusModel:i,sonnetModel:l,haikuModel:c,providerModels:u,onApplyPreset:r,onUpdateEnvValue:d,onOpenCustomPreset:h,onDeletePreset:x,isDeletePending:g}),e.jsx(Te,{}),e.jsx(Zt,{accounts:o,onAddAccount:b,onSetDefault:A,onRemoveAccount:v,onPauseToggle:O,isRemovingAccount:k,isPausingAccount:T,privacyMode:P,showQuota:s==="agy"&&!L,isKiro:y,kiroNoIncognito:j,onKiroNoIncognitoChange:C,kiroSettingsLoading:S||R})]})})}function ze({provider:s,displayName:n,authStatus:t,catalog:a,logoProvider:i,baseProvider:l,isRemoteMode:c,port:u,onAddAccount:r,onSetDefault:d,onRemoveAccount:h,onPauseToggle:x,isRemovingAccount:g,isPausingAccount:o}){const[b,A]=p.useState(!1),{privacyMode:v}=Ze(),{data:O}=Ts(),{data:k}=Os(s),T=Is(),P=Es(),L=k?.presets||[],y=l||s,j=p.useMemo(()=>{if(!O?.models)return[];const G={gemini:["google"],agy:["antigravity"],codex:["openai"],qwen:["alibaba","qwen"],iflow:["iflow"],kiro:["kiro","aws"],ghcp:["github","copilot"]}[y.toLowerCase()]||[y.toLowerCase()];return O.models.filter(Re=>G.some(gs=>Re.owned_by.toLowerCase().includes(gs)))},[O,y]),{data:f,isLoading:S,refetch:I,rawJsonContent:R,rawJsonEdits:U,isRawJsonValid:m,hasChanges:C,currentModel:M,opusModel:N,sonnetModel:H,haikuModel:V,handleRawJsonChange:ce,updateEnvValue:ls,updateEnvValues:Ie,saveMutation:Ee,conflictDialog:cs,handleConflictResolve:_e,missingRequiredFields:ds}=Gt(s),ms=t.accounts||[],{data:us}=fe({queryKey:["auth-tokens-raw"],queryFn:async()=>{const E=await fetch("/api/settings/auth/tokens/raw");return E.ok?E.json():{apiKey:{value:"ccs-internal-managed"}}},staleTime:6e4}),Le=us?.apiKey?.value??"ccs-internal-managed",xs=E=>{Ie({ANTHROPIC_BASE_URL:`http://127.0.0.1:${u??he}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:Le,...E}),F.success(`Applied "${E.ANTHROPIC_MODEL?.split("/").pop()||"preset"}" preset`)},ps=(E,G)=>{Ie({ANTHROPIC_BASE_URL:`http://127.0.0.1:${u??he}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:Le,ANTHROPIC_MODEL:E.default,ANTHROPIC_DEFAULT_OPUS_MODEL:E.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:E.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:E.haiku}),F.success(`Applied ${G?`"${G}"`:"custom"} preset`),A(!1)},hs=(E,G)=>{if(!G){F.error("Please enter a preset name to save");return}T.mutate({profile:s,data:{name:G,...E}}),A(!1)};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(Bt,{provider:s,displayName:n,logoProvider:i,data:f,isLoading:S,hasChanges:C,isRawJsonValid:m,isSaving:Ee.isPending,isRemoteMode:c,port:u,onRefetch:I,onSave:()=>Ee.mutate()}),S?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(q,{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(_s,{defaultValue:"config",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(Ls,{className:"w-full",children:[e.jsx(He,{value:"config",className:"flex-1",children:"Model Config"}),e.jsx(He,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsx(Ve,{value:"config",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx(ea,{provider:s,catalog:a,savedPresets:L,currentModel:M,opusModel:N,sonnetModel:H,haikuModel:V,providerModels:j,onApplyPreset:xs,onUpdateEnvValue:ls,onOpenCustomPreset:()=>A(!0),onDeletePreset:E=>P.mutate({profile:s,name:E}),isDeletePending:P.isPending,accounts:ms,onAddAccount:r,onSetDefault:d,onRemoveAccount:h,onPauseToggle:x,isRemovingAccount:g,isPausingAccount:o,privacyMode:v,isRemoteMode:c})}),e.jsx(Ve,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx($t,{provider:s,displayName:n,data:f,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(ut,{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(Rs,{rawJsonContent:R,isRawJsonValid:m,rawJsonEdits:U,onRawJsonChange:ce,profileEnv:f?.settings?.env,missingRequiredFields:ds})]})]}),e.jsx(Nt,{open:cs,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>_e(!0),onCancel:()=>_e(!1)}),e.jsx(Kt,{open:b,onClose:()=>A(!1),currentValues:{default:M||"",opus:N||"",sonnet:H||"",haiku:V||""},onApply:ps,onSave:hs,isSaving:T.isPending,catalog:a,allModels:j})]})}function ue(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 sa(s){if(!s)return"";const n=new Date(s).getTime(),a=Date.now()-n,i=Math.floor(a/(1e3*60*60)),l=Math.floor(a%(1e3*60*60)/(1e3*60));return i>0?`${i}h ${l}m`:`${l}m`}function ta(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 xe({icon:s,tooltip:n,onClick:t,disabled:a,isPending:i,className:l,variant:c="ghost"}){return e.jsxs(J,{children:[e.jsx(W,{asChild:!0,children:e.jsx(w,{variant:c==="destructive-ghost"?"ghost":c,size:"sm",className:D("h-7 w-7 p-0",c==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",l),onClick:t,disabled:a,children:i?e.jsx($,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(s,{className:"w-3.5 h-3.5"})})}),e.jsx(Y,{side:"bottom",className:"text-xs",children:n})]})}function aa(){const{data:s,isLoading:n}=Fs(),{data:t}=Us(),{data:a,isLoading:i}=Hs(),l=Vs(),c=Gs(),u=Ks(),r=$s(),[d,h]=p.useState(!1),[x,g]=p.useState(""),[o,b]=p.useState(!1),[A,v]=p.useState(null),{data:O}=fe({queryKey:["cliproxy-server-config"],queryFn:()=>se.cliproxyServer.get(),staleTime:3e4}),k=O?.remote,T=k?.enabled&&k?.host,P=s?.running??!1,L=l.isPending||c.isPending||u.isPending||r.isPending,y=t?.hasUpdate??!1,j=t?.isStable===!1,f=t?.currentVersion,S=j?t?.maxStableVersion||a?.latestStable:t?.latestVersion,I=C=>{if(!C)return;const M=a?.maxStableVersion||"6.6.80";if(ue(C,M)){v(C),b(!0);return}r.mutate({version:C})},R=()=>{A&&r.mutate({version:A,force:!0}),b(!1),v(null)},U=()=>{b(!1),v(null)},m=T?(()=>{const C=k.protocol||"http",M=k.port||(C==="https"?443:80);return C==="https"&&M===443||C==="http"&&M===80?k.host:`${k.host}:${M}`})():null;return T?e.jsxs("div",{className:D("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(De,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(_,{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(xt,{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:m})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsx(B,{delayDuration:300,children:e.jsxs("div",{className:D("rounded-lg border p-3 transition-colors",P?"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:D("w-2 h-2 rounded-full",P?"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($,{className:"w-3 h-3 animate-spin text-muted-foreground"}):P?e.jsxs(e.Fragment,{children:[e.jsx(xe,{icon:pt,tooltip:"Restart",onClick:()=>u.mutate(),disabled:L,isPending:u.isPending}),e.jsx(xe,{icon:ht,tooltip:"Stop",onClick:()=>c.mutate(),disabled:L,isPending:c.isPending,variant:"destructive-ghost"}),e.jsx(xe,{icon:d?le:gt,tooltip:d?"Close":"Version settings",onClick:()=>h(!d),className:d?"bg-muted":void 0})]}):e.jsx(Ke,{className:"w-3 h-3 text-muted-foreground"})})]}),f&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:D("text-xs font-mono text-muted-foreground",j&&"text-amber-600 dark:text-amber-400"),children:["v",f]}),(y||j)&&S&&e.jsxs(_,{variant:"secondary",className:D("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",j?"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:()=>I(S),title:`Click to ${j?"downgrade":"update"}`,children:[j?e.jsx(ft,{className:"w-2.5 h-2.5"}):e.jsx(jt,{className:"w-2.5 h-2.5"}),S]})]}),P&&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(vt,{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(te,{className:"w-3 h-3"}),sa(s.startedAt)]})]}),P&&e.jsx(qs,{open:d,onOpenChange:h,children:e.jsxs(zs,{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(ve,{value:x,onValueChange:g,disabled:i,children:[e.jsx(Ne,{className:"h-8 text-xs flex-1",children:e.jsx(we,{placeholder:"Select version to install..."})}),e.jsx(be,{children:a?.versions.slice(0,20).map(C=>{const M=a?.maxStableVersion&&ue(C,a.maxStableVersion);return e.jsx(ie,{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)"}),M&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},C)})})]}),e.jsxs(w,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>I(x),disabled:r.isPending||!x,children:[r.isPending?e.jsx($,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(as,{className:"w-3.5 h-3.5"}),"Install"]})]}),x&&a?.maxStableVersion&&ue(x,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(pe,{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 ",ta(t.checkedAt)]})]})}),!P&&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(w,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>l.mutate(),disabled:l.isPending,children:[l.isPending?e.jsx($,{className:"w-3 h-3 animate-spin"}):e.jsx(Ke,{className:"w-3 h-3"}),"Start"]})]}),e.jsx(bt,{open:o,onOpenChange:b,children:e.jsxs(yt,{children:[e.jsxs(Ct,{children:[e.jsxs(kt,{className:"flex items-center gap-2",children:[e.jsx(pe,{className:"w-5 h-5 text-amber-500"}),"Install Unstable Version?"]}),e.jsxs(At,{className:"space-y-2",children:[e.jsxs("p",{children:["You are about to install ",e.jsxs("strong",{children:["v",A]}),", 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(St,{children:[e.jsx(Pt,{onClick:U,children:"Cancel"}),e.jsx(Mt,{onClick:R,className:"bg-amber-500 hover:bg-amber-600 text-white",children:"Install Anyway"})]})]})})]})})}function na({status:s,isSelected:n,onSelect:t}){const a=s.accounts?.length||0;return e.jsxs("button",{className:D("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(Oe,{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(_,{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(z,{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(le,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not connected"})]})})]})]})}function ia({variant:s,parentAuth:n,isSelected:t,onSelect:a,onDelete:i,isDeleting:l}){return e.jsxs("button",{className:D("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(Oe,{provider:s.provider,size:"sm"}),e.jsx(rs,{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(_,{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(z,{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(le,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Parent not connected"})]})})]}),e.jsx(w,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:c=>{c.stopPropagation(),i()},disabled:l,children:e.jsx(is,{className:"w-3 h-3"})})]})}function ra({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(oe,{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(w,{onClick:s,className:"gap-2",children:[e.jsx(Z,{className:"w-4 h-4"}),"Quick Setup"]})]})})}function va(){const s=Qe(),{data:n,isLoading:t}=We(),{data:a,isFetching:i}=Qs(),l=Bs(),c=Js(),u=Ws(),r=Ys(),d=Xs(),[h,x]=p.useState(null),[g,o]=p.useState(null),[b,A]=p.useState(!1),[v,O]=p.useState(null),k=p.useMemo(()=>n?.authStatus||[],[n?.authStatus]),T=n?.source==="remote",P=p.useMemo(()=>a?.variants||[],[a?.variants]),L=p.useMemo(()=>g?null:h&&k.some(m=>m.provider===h)?h:k.length>0?k[0].provider:null,[h,g,k]),y=k.find(m=>m.provider===L),j=P.find(m=>m.name===g),f=j?k.find(m=>m.provider===j.provider):void 0,S=()=>{s.invalidateQueries({queryKey:["cliproxy"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]})},I=(m,C,M)=>{u.isPending||r.isPending||(M?u.mutate({provider:m,accountId:C}):r.mutate({provider:m,accountId:C}))},R=m=>{x(m),o(null)},U=m=>{o(m),x(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(oe,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"CLIProxy Plus"})]}),e.jsx(w,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:S,disabled:i,children:e.jsx($,{className:D("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(w,{variant:"default",size:"sm",className:"w-full gap-2",onClick:()=>A(!0),children:[e.jsx(Z,{className:"w-4 h-4"}),"Quick Setup"]})]}),e.jsx(Se,{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(m=>e.jsx(Zs,{className:"h-14 w-full rounded-lg"},m))}):e.jsx("div",{className:"space-y-1",children:k.map(m=>e.jsx(na,{status:m,isSelected:L===m.provider,onSelect:()=>R(m.provider)},m.provider))}),P.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(rs,{className:"w-3 h-3"}),"Variants"]}),e.jsx("div",{className:"space-y-1",children:P.map(m=>e.jsx(ia,{variant:m,parentAuth:k.find(C=>C.provider===m.provider),isSelected:g===m.name,onSelect:()=>U(m.name),onDelete:()=>d.mutate(m.name),isDeleting:d.isPending},m.name))})]})]})}),e.jsx("div",{className:"p-3 border-t",children:e.jsx(aa,{})}),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:[k.length," provider",k.length!==1?"s":""]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"w-3 h-3 text-green-600"}),k.filter(m=>m.authenticated).length," connected"]})]})})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background",children:j&&f?e.jsx(ze,{provider:j.name,displayName:`${j.name} (${j.provider} variant)`,authStatus:f,catalog:X[j.provider],logoProvider:j.provider,baseProvider:j.provider,isRemoteMode:T,port:j.port,onAddAccount:()=>O({provider:j.provider,displayName:f.displayName,isFirstAccount:(f.accounts?.length||0)===0}),onSetDefault:m=>l.mutate({provider:j.provider,accountId:m}),onRemoveAccount:m=>c.mutate({provider:j.provider,accountId:m}),onPauseToggle:(m,C)=>I(j.provider,m,C),isRemovingAccount:c.isPending,isPausingAccount:u.isPending||r.isPending}):y?e.jsx(ze,{provider:y.provider,displayName:y.displayName,authStatus:y,catalog:X[y.provider],isRemoteMode:T,onAddAccount:()=>O({provider:y.provider,displayName:y.displayName,isFirstAccount:(y.accounts?.length||0)===0}),onSetDefault:m=>l.mutate({provider:y.provider,accountId:m}),onRemoveAccount:m=>c.mutate({provider:y.provider,accountId:m}),onPauseToggle:(m,C)=>I(y.provider,m,C),isRemovingAccount:c.isPending,isPausingAccount:u.isPending||r.isPending}):e.jsx(ra,{onSetup:()=>A(!0)})}),e.jsx(Ft,{open:b,onClose:()=>A(!1)}),e.jsx(Ut,{open:v!==null,onClose:()=>O(null),provider:v?.provider||"",displayName:v?.displayName||"",isFirstAccount:v?.isFirstAccount||!1})]})}export{va as CliproxyPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as h}from"./react-vendor-CNOkPC89.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(),v=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 m=h.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:n,iconNode:k,...s},i)=>h.createElement("svg",{ref:i,...x,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:r("lucide",y),...!n&&!v(s)&&{"aria-hidden":"true"},...s},[...k.map(([p,l])=>h.createElement(p,l)),...Array.isArray(n)?n:[n]]));const e=(t,a)=>{const c=h.forwardRef(({className:o,...y},n)=>h.createElement(m,{ref:n,iconNode:a,className:r(`lucide-${_(d(t))}`,`lucide-${t}`,o),...y}));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"}]],r2=e("activity",f);const w=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],k2=e("archive",w);const g=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],i2=e("arrow-down-left",g);const $=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],p2=e("arrow-down-right",$);const u=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],l2=e("arrow-down",u);const N=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_2=e("arrow-left",N);const z=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],M2=e("arrow-right",z);const b=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],v2=e("arrow-up-right",b);const C=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],x2=e("arrow-up",C);const j=[["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"}]],m2=e("book-open",j);const q=[["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"}]],f2=e("bot",q);const A=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],w2=e("bug",A);const H=[["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"}]],g2=e("calendar",H);const V=[["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"}]],$2=e("chart-column",V);const L=[["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"}]],u2=e("chart-pie",L);const S=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],N2=e("check",S);const R=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],z2=e("chevron-down",R);const E=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],b2=e("chevron-left",E);const P=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],C2=e("chevron-right",P);const B=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],j2=e("chevron-up",B);const D=[["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"}]],q2=e("circle-alert",D);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"}]],A2=e("circle-check-big",U);const F=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],H2=e("circle-check",F);const G=[["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"}]],V2=e("circle-question-mark",G);const O=[["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"}]],L2=e("circle-x",O);const W=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],S2=e("circle",W);const T=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],R2=e("clock",T);const Z=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],E2=e("cloud",Z);const I=[["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"}]],P2=e("code-xml",I);const K=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],B2=e("code",K);const X=[["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"}]],D2=e("coins",X);const Q=[["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"}]],U2=e("copy",Q);const J=[["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"}]],F2=e("cpu",J);const Y=[["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"}]],G2=e("database",Y);const e1=[["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"}]],O2=e("dollar-sign",e1);const a1=[["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"}]],W2=e("download",a1);const t1=[["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"}]],T2=e("ellipsis",t1);const c1=[["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"}]],Z2=e("external-link",c1);const o1=[["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"}]],I2=e("eye-off",o1);const n1=[["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"}]],K2=e("eye",n1);const h1=[["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"}]],X2=e("file-braces",h1);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:"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"}]],Q2=e("file-code",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:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],J2=e("file-exclamation-point",s1);const d1=[["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"}]],Y2=e("file-text",d1);const r1=[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]],e0=e("folder-code",r1);const k1=[["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"}]],a0=e("folder-open",k1);const i1=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],t0=e("gauge",i1);const p1=[["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"}]],c0=e("git-branch",p1);const l1=[["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"}]],o0=e("github",l1);const _1=[["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"}]],n0=e("globe",_1);const M1=[["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"}]],h0=e("grip-horizontal",M1);const v1=[["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"}]],y0=e("grip-vertical",v1);const x1=[["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"}]],s0=e("heart",x1);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"}]],d0=e("house",m1);const f1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],r0=e("info",f1);const w1=[["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"}]],k0=e("key-round",w1);const g1=[["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"}]],i0=e("key",g1);const $1=[["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"}]],p0=e("laptop",$1);const u1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],l0=e("loader-circle",u1);const N1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],_0=e("lock",N1);const z1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],M0=e("log-out",z1);const b1=[["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"}]],v0=e("monitor",b1);const C1=[["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"}]],x0=e("moon",C1);const j1=[["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"}]],m0=e("network",j1);const q1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],f0=e("panel-left",q1);const A1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],w0=e("pause",A1);const H1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],g0=e("play",H1);const V1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$0=e("plus",V1);const L1=[["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"}]],u0=e("power-off",L1);const S1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],N0=e("power",S1);const R1=[["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"}]],z0=e("radio",R1);const E1=[["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"}]],b0=e("refresh-cw",E1);const P1=[["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"}]],C0=e("rotate-ccw",P1);const B1=[["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"}]],j0=e("rotate-cw",B1);const D1=[["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"}]],q0=e("save",D1);const U1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],A0=e("search",U1);const F1=[["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"}]],H0=e("server",F1);const G1=[["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",G1);const O1=[["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"}]],L0=e("settings",O1);const W1=[["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"}]],S0=e("shield-check",W1);const T1=[["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"}]],R0=e("shield",T1);const Z1=[["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"}]],E0=e("sparkles",Z1);const I1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],P0=e("square",I1);const K1=[["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"}]],B0=e("star",K1);const X1=[["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"}]],D0=e("sun",X1);const Q1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],U0=e("terminal",Q1);const J1=[["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"}]],F0=e("trash-2",J1);const Y1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],G0=e("trending-up",Y1);const e2=[["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"}]],O0=e("triangle-alert",e2);const a2=[["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"}]],W0=e("user",a2);const t2=[["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"}]],T0=e("users",t2);const c2=[["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"}]],Z0=e("wand-sparkles",c2);const o2=[["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"}]],I0=e("wifi-off",o2);const n2=[["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"}]],K0=e("wifi",n2);const h2=[["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"}]],X0=e("wrench",h2);const y2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Q0=e("x",y2);const s2=[["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"}]],J0=e("zap",s2);export{n0 as $,r2 as A,m2 as B,$2 as C,J2 as D,I2 as E,a0 as F,t0 as G,d0 as H,r0 as I,h0 as J,i0 as K,l0 as L,x0 as M,j2 as N,z2 as O,f0 as P,V0 as Q,C0 as R,L0 as S,O0 as T,T0 as U,$0 as V,I0 as W,Q0 as X,E0 as Y,J0 as Z,q2 as _,o0 as a,H0 as a0,k2 as a1,Q2 as a2,b0 as a3,b2 as a4,_0 as a5,O2 as a6,G2 as a7,p2 as a8,g2 as a9,X0 as aA,v0 as aB,f2 as aC,E2 as aD,p0 as aE,w2 as aF,S0 as aG,D2 as aa,G0 as ab,u2 as ac,F0 as ad,q0 as ae,A0 as af,Z0 as ag,P2 as ah,M2 as ai,X2 as aj,_2 as ak,W2 as al,B0 as am,m0 as an,w0 as ao,e0 as ap,T2 as aq,g0 as ar,V2 as as,j0 as at,P0 as au,N0 as av,l2 as aw,x2 as ax,c0 as ay,u0 as az,C2 as b,D0 as c,K2 as d,K0 as e,R0 as f,s0 as g,A2 as h,S2 as i,N2 as j,k0 as k,U2 as l,Z2 as m,W0 as n,M0 as o,H2 as p,L2 as q,y0 as r,R2 as s,z0 as t,F2 as u,U0 as v,B2 as w,v2 as x,i2 as y,Y2 as z};
|