@dmrlzz/davecode 0.4.0 → 0.5.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/{ChatApp-BO7QMBWD.js → ChatApp-CJBICQGA.js} +6 -6
- package/dist/{account-UGNLJPQ4.js → account-QWDPJWAA.js} +3 -3
- package/dist/{accounts-NM7IWP53.js → accounts-IQMR72FC.js} +5 -5
- package/dist/{budget-INAW6FXD.js → budget-XANOUVWO.js} +4 -4
- package/dist/{chat-U4QJQ7M6.js → chat-KDDRNC5V.js} +8 -8
- package/dist/{chunk-CWBVNS3L.js → chunk-44AFJL2X.js} +4 -4
- package/dist/{chunk-MOK5D3XJ.js → chunk-AZKACMME.js} +2 -2
- package/dist/{chunk-DZ2FDABF.js → chunk-FYPMA55O.js} +2 -2
- package/dist/{chunk-3Q2KCXLN.js → chunk-HSBJDV3O.js} +2 -2
- package/dist/{chunk-3Q2KCXLN.js.map → chunk-HSBJDV3O.js.map} +1 -1
- package/dist/{chunk-ROIUTNQV.js → chunk-JLATEHS7.js} +2 -2
- package/dist/{chunk-GZJ6JSO7.js → chunk-PGAJIGUF.js} +3 -3
- package/dist/{chunk-GHDOUII5.js → chunk-W7GPBEBZ.js} +2 -2
- package/dist/{chunk-Z6NQDJEN.js → chunk-WQ7MEWDF.js} +3 -3
- package/dist/{config-YEAPBMBX.js → config-YTUPIYZT.js} +3 -3
- package/dist/dashboard/assets/Accounts-cq8RLMoI.js +1 -0
- package/dist/dashboard/assets/{Badge-CGY6DgGx.js → Badge-Z4RBdO9j.js} +2 -2
- package/dist/dashboard/assets/Callout-w8BTYh4k.js +1 -0
- package/dist/dashboard/assets/Field-Cmpgg_1z.js +1 -0
- package/dist/dashboard/assets/Goals-Bw02to72.js +1 -0
- package/dist/dashboard/assets/Library-DK7mlpRb.js +1 -0
- package/dist/dashboard/assets/{Markdown-Xhao3sgL.js → Markdown-DCZ4Awcc.js} +2 -2
- package/dist/dashboard/assets/Panes-_KTf8pbZ.js +8 -0
- package/dist/dashboard/assets/Panes-kHJ-D0s7.css +1 -0
- package/dist/dashboard/assets/RoutesPage-QV0oPRW9.js +4 -0
- package/dist/dashboard/assets/Runner-CkHBLQl0.js +1 -0
- package/dist/dashboard/assets/Settings-BLz2gTBR.js +1 -0
- package/dist/dashboard/assets/Switch-DPYlLseH.js +1 -0
- package/dist/dashboard/assets/Tasks-BiUQSTpt.js +2 -0
- package/dist/dashboard/assets/Traffic-BVfBuC70.js +1 -0
- package/dist/dashboard/assets/Workspace-CJTgiiU5.js +1 -0
- package/dist/dashboard/assets/arrow-up-DjhzZprp.js +1 -0
- package/dist/dashboard/assets/cn-BwE4cei0.js +1 -0
- package/dist/dashboard/assets/forms-DVIUAxAc.js +1 -0
- package/dist/dashboard/assets/index-BDBa5cb0.js +104 -0
- package/dist/dashboard/assets/index-BEmBgsbP.css +2 -0
- package/dist/dashboard/assets/task-errors-Daqwi0ue.js +1 -0
- package/dist/dashboard/assets/trash-BTuDcSaQ.js +1 -0
- package/dist/dashboard/index.html +4 -4
- package/dist/{dist-RRQGUBL3.js → dist-37VQSHHA.js} +2 -2
- package/dist/{doctor-MQYK44S2.js → doctor-PYUQRRCB.js} +3 -3
- package/dist/{goal-6NUX4AIT.js → goal-SXZUDUCL.js} +3 -3
- package/dist/index.js +31 -31
- package/dist/{init-AXYIWAB3.js → init-Z2AFQEEP.js} +3 -3
- package/dist/{run-QRTLHFB3.js → run-AOS7L3RT.js} +3 -3
- package/dist/runtime.js +2 -2
- package/dist/{start-O5I5TSO2.js → start-CEPXKZUE.js} +3 -3
- package/dist/{status-LEA3RVUX.js → status-WNJ3GGKU.js} +4 -4
- package/dist/{tasks-XOTVICVZ.js → tasks-TFUTUMWB.js} +4 -4
- package/package.json +4 -4
- package/dist/dashboard/assets/Accounts-CeVyX4a3.js +0 -1
- package/dist/dashboard/assets/Callout-DauCk_cW.js +0 -1
- package/dist/dashboard/assets/Field-OXMnT9Tb.js +0 -1
- package/dist/dashboard/assets/Goals-DH-KDh8M.js +0 -1
- package/dist/dashboard/assets/Library-C15szLjZ.js +0 -1
- package/dist/dashboard/assets/Panel-Du40pM7n.js +0 -1
- package/dist/dashboard/assets/RoutesPage-Cj1OelGO.js +0 -4
- package/dist/dashboard/assets/Runner-BK1-ZF7h.js +0 -1
- package/dist/dashboard/assets/Settings-C1nzQQhe.js +0 -1
- package/dist/dashboard/assets/Switch-bwtIJ00H.js +0 -1
- package/dist/dashboard/assets/Tasks-x4s8IiPG.js +0 -2
- package/dist/dashboard/assets/Traffic-CV7TaTid.js +0 -1
- package/dist/dashboard/assets/Workspace-DAL-MBc0.js +0 -1
- package/dist/dashboard/assets/arrow-up-goM9r-I9.js +0 -1
- package/dist/dashboard/assets/forms-DtpfI65-.js +0 -1
- package/dist/dashboard/assets/index-BCi-Vuvh.js +0 -104
- package/dist/dashboard/assets/index-CcJFhc98.css +0 -2
- package/dist/dashboard/assets/task-errors-B2pgjUGN.js +0 -1
- package/dist/dashboard/assets/trash-BVojETtF.js +0 -1
- /package/dist/{ChatApp-BO7QMBWD.js.map → ChatApp-CJBICQGA.js.map} +0 -0
- /package/dist/{account-UGNLJPQ4.js.map → account-QWDPJWAA.js.map} +0 -0
- /package/dist/{accounts-NM7IWP53.js.map → accounts-IQMR72FC.js.map} +0 -0
- /package/dist/{budget-INAW6FXD.js.map → budget-XANOUVWO.js.map} +0 -0
- /package/dist/{chat-U4QJQ7M6.js.map → chat-KDDRNC5V.js.map} +0 -0
- /package/dist/{chunk-CWBVNS3L.js.map → chunk-44AFJL2X.js.map} +0 -0
- /package/dist/{chunk-MOK5D3XJ.js.map → chunk-AZKACMME.js.map} +0 -0
- /package/dist/{chunk-DZ2FDABF.js.map → chunk-FYPMA55O.js.map} +0 -0
- /package/dist/{chunk-ROIUTNQV.js.map → chunk-JLATEHS7.js.map} +0 -0
- /package/dist/{chunk-GZJ6JSO7.js.map → chunk-PGAJIGUF.js.map} +0 -0
- /package/dist/{chunk-GHDOUII5.js.map → chunk-W7GPBEBZ.js.map} +0 -0
- /package/dist/{chunk-Z6NQDJEN.js.map → chunk-WQ7MEWDF.js.map} +0 -0
- /package/dist/{config-YEAPBMBX.js.map → config-YTUPIYZT.js.map} +0 -0
- /package/dist/{dist-RRQGUBL3.js.map → dist-37VQSHHA.js.map} +0 -0
- /package/dist/{doctor-MQYK44S2.js.map → doctor-PYUQRRCB.js.map} +0 -0
- /package/dist/{goal-6NUX4AIT.js.map → goal-SXZUDUCL.js.map} +0 -0
- /package/dist/{init-AXYIWAB3.js.map → init-Z2AFQEEP.js.map} +0 -0
- /package/dist/{run-QRTLHFB3.js.map → run-AOS7L3RT.js.map} +0 -0
- /package/dist/{start-O5I5TSO2.js.map → start-CEPXKZUE.js.map} +0 -0
- /package/dist/{status-LEA3RVUX.js.map → status-WNJ3GGKU.js.map} +0 -0
- /package/dist/{tasks-XOTVICVZ.js.map → tasks-TFUTUMWB.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
brandLogo
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HSBJDV3O.js";
|
|
4
4
|
|
|
5
5
|
// src/ui/banner.ts
|
|
6
6
|
function brandBanner(theme, text, columns = 80, minColumns = 56) {
|
|
@@ -17,4 +17,4 @@ function brandBanner(theme, text, columns = 80, minColumns = 56) {
|
|
|
17
17
|
export {
|
|
18
18
|
brandBanner
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-JLATEHS7.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
detectProjectRoot,
|
|
15
15
|
findGateway,
|
|
16
16
|
targetFor
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FYPMA55O.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-7XVXEO7U.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
QUOTA_WINDOWS,
|
|
23
23
|
createEngine,
|
|
24
24
|
loadConfig
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-HSBJDV3O.js";
|
|
26
26
|
|
|
27
27
|
// src/commands/status.ts
|
|
28
28
|
function emptyUsage(accountId) {
|
|
@@ -210,4 +210,4 @@ export {
|
|
|
210
210
|
renderStatus,
|
|
211
211
|
statusCommand
|
|
212
212
|
};
|
|
213
|
-
//# sourceMappingURL=chunk-
|
|
213
|
+
//# sourceMappingURL=chunk-PGAJIGUF.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
AccountStore,
|
|
8
8
|
accountService,
|
|
9
9
|
startAccountLogin
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HSBJDV3O.js";
|
|
11
11
|
|
|
12
12
|
// src/lib/browser.ts
|
|
13
13
|
import { spawn } from "child_process";
|
|
@@ -141,4 +141,4 @@ export {
|
|
|
141
141
|
accountCommand,
|
|
142
142
|
chatAccountActions
|
|
143
143
|
};
|
|
144
|
-
//# sourceMappingURL=chunk-
|
|
144
|
+
//# sourceMappingURL=chunk-W7GPBEBZ.js.map
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
accountCreateSchema,
|
|
3
3
|
accountPatchSchema,
|
|
4
4
|
findGateway
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FYPMA55O.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
8
|
} from "./chunk-7XVXEO7U.js";
|
|
9
9
|
import {
|
|
10
10
|
createEngine
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HSBJDV3O.js";
|
|
12
12
|
|
|
13
13
|
// src/lib/accounts-backend.ts
|
|
14
14
|
import { z } from "zod";
|
|
@@ -177,4 +177,4 @@ export {
|
|
|
177
177
|
openAccounts,
|
|
178
178
|
resolveAccount
|
|
179
179
|
};
|
|
180
|
-
//# sourceMappingURL=chunk-
|
|
180
|
+
//# sourceMappingURL=chunk-WQ7MEWDF.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-QA3O6RA2.js";
|
|
7
7
|
import {
|
|
8
8
|
detectProjectRoot
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FYPMA55O.js";
|
|
10
10
|
import {
|
|
11
11
|
CliError,
|
|
12
12
|
EXIT
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
globalPaths,
|
|
16
16
|
loadConfig,
|
|
17
17
|
projectPaths
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HSBJDV3O.js";
|
|
19
19
|
import "./chunk-MC7RIPL7.js";
|
|
20
20
|
|
|
21
21
|
// src/commands/config.ts
|
|
@@ -155,4 +155,4 @@ export {
|
|
|
155
155
|
configPath,
|
|
156
156
|
configShow
|
|
157
157
|
};
|
|
158
|
-
//# sourceMappingURL=config-
|
|
158
|
+
//# sourceMappingURL=config-YTUPIYZT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,r,t as i}from"./cn-BwE4cei0.js";import{E as a,F as o,R as s,_ as c,d as l,ft as u,h as d,ot as f,p,pt as m,st as h,t as g,u as _,v,x as y,y as b}from"./Badge-Z4RBdO9j.js";import{n as x,t as S}from"./Switch-DPYlLseH.js";import{a as C,c as w,i as ee,l as T,n as te,o as ne,r as re,s as ie,t as ae}from"./forms-DVIUAxAc.js";import{t as E}from"./Callout-w8BTYh4k.js";import{t as D}from"./trash-BTuDcSaQ.js";import{C as O,I as k,J as A,O as j,R as M,_ as N,a as P,d as F,f as I,g as L,i as R,j as z,k as B,m as V,n as H,o as U,p as W,r as G,s as K,t as q,u as J,w as Y,z as oe}from"./index-BDBa5cb0.js";import{n as X,t as Z}from"./Field-Cmpgg_1z.js";var se={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};se.node;var ce=t(se),le={name:`shield-alert`,size:24,node:[[`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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};le.node;var ue=t(le),Q=n(e(),1),$=r(),de=3e5,fe={connected:{tone:`ok`,label:`Connected`},not_connected:{tone:`warn`,label:`Not connected`},unknown:{tone:`neutral`,label:`Unknown`}};function pe({status:e}){let{tone:t,label:n}=fe[e];return(0,$.jsx)(g,{tone:t,dot:!0,children:n})}function me({account:e}){let[t,n]=(0,Q.useState)(null),r=v(e.id,t!==null),i=c(),a=r.data,o=a?.status===`connected`;return(0,Q.useEffect)(()=>{if(!t)return;if(o){n(null),O({tone:`ok`,title:`Subscription connected`,description:e.label});return}let r=window.setTimeout(()=>n(null),de);return()=>window.clearTimeout(r)},[t,o,e.label]),(0,$.jsxs)(`section`,{"aria-label":`Connection`,className:`flex flex-col gap-2.5 rounded-md border border-line bg-raised p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`p`,{className:`text-[12px] font-medium text-fg-2`,children:`Connection`}),a?(0,$.jsx)(pe,{status:a.status}):r.isError?(0,$.jsx)(g,{tone:`err`,children:`Check failed`}):(0,$.jsx)(g,{children:`Checking…`}),(0,$.jsx)(Y,{variant:`ghost`,size:`sm`,icon:M,iconOnly:!0,"aria-label":`Check again`,className:`ml-auto`,loading:r.isFetching&&!t,onClick:()=>r.refetch()})]}),a?.detail&&(0,$.jsx)(`p`,{className:`text-2xs leading-5 text-muted`,children:a.detail}),r.isError&&(0,$.jsx)(`p`,{className:`text-2xs leading-5 text-err`,children:u(r.error)}),a?.method===`cli-login`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(Y,{variant:o?`secondary`:`primary`,size:`sm`,icon:ce,loading:i.isPending,onClick:async()=>{try{n(await i.mutateAsync(e.id))}catch(e){O({tone:`err`,title:`Could not start the sign-in`,description:u(e)})}},children:o?`Sign in again`:`Connect subscription`}),(0,$.jsx)(`span`,{className:`text-2xs text-muted`,children:`Opens the vendor’s official sign-in. DaveCode never sees your password.`})]}),t&&(0,$.jsxs)(E,{tone:`info`,title:t.launched?`Waiting for the sign-in…`:`Run the sign-in on the gateway machine`,children:[(0,$.jsx)(`p`,{children:t.message}),!t.launched&&(0,$.jsx)(W,{command:t.command,className:`mt-2`})]}),!t&&!o&&a.loginCommand&&(0,$.jsx)(W,{command:a.loginCommand})]})]})}function he({account:e,usage:t,onClose:n}){return(0,$.jsx)(I,{open:!!e,onClose:n,title:e?.label??`Account`,description:e&&(0,$.jsx)(`span`,{className:`font-mono`,children:e.id}),width:`w-[min(560px,100vw)]`,children:e&&(0,$.jsx)(ge,{account:e,usage:t,onDone:n},e.id)})}function ge({account:e,usage:t,onDone:n}){let r=o(),i=y(),a=h(e.provider),s=Array.isArray(e.config.models)?e.config.models.join(`, `):``,[c,d]=(0,Q.useState)(e.label),[f,p]=(0,Q.useState)(String(e.priority)),[m,g]=(0,Q.useState)(String(e.weight)),[_,v]=(0,Q.useState)(C(e.limits)),[b,x]=(0,Q.useState)(T(e.subscription)),[S,k]=(0,Q.useState)({}),[A,j]=(0,Q.useState)(typeof e.config.baseUrl==`string`?e.config.baseUrl:``),[M,I]=(0,Q.useState)(s),[R,z]=(0,Q.useState)(``),[B,V]=(0,Q.useState)({}),[H,W]=(0,Q.useState)({}),[G,K]=(0,Q.useState)(null),[q,J]=(0,Q.useState)(!1);return(0,$.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),K(null);let i={};c.trim()||(i.label=`Label cannot be empty.`);let a=Number(f);(!Number.isInteger(a)||a<0)&&(i.priority=`Whole number, 0 or more.`);let o=Number(m);(!Number.isFinite(o)||o<=0)&&(i.weight=`Number above 0.`),e.provider===`openai-compatible`&&!ee(A.trim())&&(i.baseUrl=`Enter an http(s) URL.`);let s=ne(_),l=w(b);if(V(i),W(s.errors),k(l.errors),Object.values(i).some(Boolean)||Object.keys(s.errors).length||Object.keys(l.errors).length)return;let d={};if(c.trim()!==e.label&&(d.label=c.trim()),a!==e.priority&&(d.priority=a),o!==e.weight&&(d.weight=o),JSON.stringify(s.limits)!==JSON.stringify(e.limits)&&(d.limits=s.limits),JSON.stringify(l.subscription??null)!==JSON.stringify(e.subscription??null)&&(d.subscription=l.subscription??null),e.provider===`openai-compatible`){let t=ie(M),n={...e.config,baseUrl:A.trim(),models:t.length?t:void 0};JSON.stringify(n)!==JSON.stringify(e.config)&&(d.config=n)}if(R.trim()&&(d.secret=R.trim()),Object.keys(d).length===0)n();else try{await r.mutateAsync({id:e.id,patch:d}),z(``),O({tone:`ok`,title:`Account updated`,description:e.label}),n()}catch(e){z(``),K(u(e))}},noValidate:!0,className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-3 rounded-md border border-line bg-raised p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,$.jsx)(N,{provider:e.provider,size:`lg`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-[13px] font-medium text-fg`,children:a.label}),(0,$.jsxs)(`p`,{className:`font-mono text-2xs text-muted`,children:[e.provider,` · updated `,l(Date.parse(e.updatedAt))]})]}),(0,$.jsx)(L,{account:e})]}),e.lastError&&e.status!==`active`&&(0,$.jsx)(`p`,{className:`rounded border border-line bg-panel px-2 py-1.5 font-mono text-2xs text-fg-2`,children:e.lastError}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(U,{label:`1m`,usage:t?.windows[`1m`]}),(0,$.jsx)(U,{label:`5h`,usage:t?.windows[`5h`]}),(0,$.jsx)(U,{label:`24h`,usage:t?.windows[`24h`]}),(0,$.jsx)(P,{className:`pl-9`})]})]}),(0,$.jsx)(me,{account:e}),(0,$.jsx)(Z,{label:`Label`,required:!0,error:B.label,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(X,{id:e,value:c,onChange:e=>d(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0})}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,$.jsx)(Z,{label:`Priority`,error:B.priority,hint:`Lower is tried first.`,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(X,{id:e,inputMode:`numeric`,value:f,onChange:e=>p(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`tnum font-mono`})}),(0,$.jsx)(Z,{label:`Weight`,error:B.weight,hint:`Share among equal priorities.`,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(X,{id:e,inputMode:`decimal`,value:m,onChange:e=>g(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`tnum font-mono`})})]}),e.provider===`openai-compatible`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Z,{label:`Base URL`,required:!0,error:B.baseUrl,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(X,{id:e,type:`url`,value:A,onChange:e=>j(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`font-mono`})}),(0,$.jsx)(Z,{label:`Models`,hint:`Comma-separated allow-list.`,children:({id:e,describedBy:t})=>(0,$.jsx)(X,{id:e,value:M,onChange:e=>I(e.target.value),"aria-describedby":t,className:`font-mono`})})]}),(a.auth===`api-key`||a.auth===`optional-key`)&&(0,$.jsx)(Z,{label:`Replace ${(a.secretLabel??`secret`).replace(` (optional)`,``)}`,hint:e.hasSecret===!1?`No secret stored yet. Write-only: it is encrypted at rest and never displayed.`:`A secret is stored. Write-only: leave empty to keep it; it is never displayed.`,children:({id:e,describedBy:t})=>(0,$.jsx)(te,{id:e,value:R,onChange:z,placeholder:`••••••••••••`,describedBy:t})}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`legend`,{className:`mb-2 text-[12px] font-medium text-fg-2`,children:`Quota limits`}),(0,$.jsx)(ae,{value:_,onChange:v,errors:H})]}),(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`legend`,{className:`mb-1 text-[12px] font-medium text-fg-2`,children:`Subscription`}),(0,$.jsx)(`p`,{className:`mb-1 text-2xs text-muted`,children:`What you pay for this account. Entered by hand; DaveCode never reads billing pages. Agents see the plan, renewal and remaining budget, never secrets.`}),(0,$.jsx)(re,{value:b,onChange:x,errors:S})]}),Object.keys(e.config).length>0&&e.provider!==`openai-compatible`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`p`,{className:`text-[12px] font-medium text-fg-2`,children:`Provider config`}),(0,$.jsx)(`pre`,{className:`overflow-x-auto rounded-md border border-line bg-raised p-2.5 font-mono text-2xs leading-5 text-fg-2`,children:JSON.stringify(e.config,null,2)})]}),G&&(0,$.jsx)(E,{tone:`err`,title:`Request failed`,children:G}),(0,$.jsxs)(`div`,{className:`sticky -bottom-4 -mx-5 -mb-4 flex items-center gap-2 border-t border-line bg-panel px-5 py-3`,children:[(0,$.jsx)(Y,{variant:`danger`,icon:D,onClick:()=>J(!0),children:`Delete`}),(0,$.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[(0,$.jsx)(Y,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,$.jsx)(Y,{type:`submit`,variant:`primary`,loading:r.isPending,children:`Save changes`})]})]}),(0,$.jsx)(F,{open:q,onClose:()=>J(!1),title:`Delete ${e.label}?`,description:`The account and its encrypted secret are removed from the gateway. Requests already served stay in the usage history.`,footer:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Y,{variant:`ghost`,onClick:()=>J(!1),children:`Keep account`}),(0,$.jsx)(Y,{variant:`danger`,icon:D,loading:i.isPending,onClick:async()=>{try{await i.mutateAsync(e.id),O({tone:`ok`,title:`Account removed`,description:e.label}),J(!1),n()}catch(e){J(!1),K(u(e))}},children:`Delete account`})]}),children:(0,$.jsx)(`p`,{className:`font-mono text-[12px] text-muted`,children:e.id})})]})}var _e={"claude-cli":{binary:`claude`,env:`CLAUDE_CONFIG_DIR`},"codex-cli":{binary:`codex`,env:`CODEX_HOME`},"gemini-cli":{binary:`gemini`,env:`GEMINI_CLI_HOME`}};function ve({open:e,onClose:t}){return(0,$.jsx)(I,{open:e,onClose:t,title:`Add account`,description:`Secrets are encrypted at rest with AES-256-GCM and are never shown again after saving.`,width:`w-[min(560px,100vw)]`,children:e&&(0,$.jsx)(ye,{onDone:t})})}function ye({onDone:e}){let t=a(),n=p(),r=b(),o=t.data?.experimental.geminiWeb??!1,s=t.data?.experimental.multiAccountRotation??!1,[c,l]=(0,Q.useState)(`anthropic`),[d,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(``),[y,x]=(0,Q.useState)(``),[S,w]=(0,Q.useState)(``),[T,re]=(0,Q.useState)(``),[D,k]=(0,Q.useState)(`100`),[A,j]=(0,Q.useState)(`1`),[M,P]=(0,Q.useState)(C()),[F,I]=(0,Q.useState)(!1),[L,R]=(0,Q.useState)({}),[z,B]=(0,Q.useState)(null),V=h(c),H=(n.data??[]).filter(e=>e.provider===c),U=V.subscription&&H.length>0&&!s,G=c===`gemini-web`&&!o;return(0,$.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),B(null);let n={};d.trim()||(n.label=`Give the account a name you will recognise in logs.`),V.auth===`api-key`&&!_.trim()&&(n.secret=`${V.secretLabel??`Secret`} is required.`),c===`openai-compatible`&&!ee(y.trim())&&(n.baseUrl=`Enter an http(s) URL ending in the /v1 base, e.g. http://127.0.0.1:11434/v1`);let i=Number(D);(!Number.isInteger(i)||i<0)&&(n.priority=`Whole number, 0 or more.`);let a=Number(A);(!Number.isFinite(a)||a<=0)&&(n.weight=`Number above 0.`),c===`gemini-web`&&!F&&(n.ack=`Confirm that you accept the risk.`);let o=ne(M);if(Object.keys(o.errors).length&&(n.limits=o.errors),R(n),Object.keys(n).length||G)return;let s={};if(c===`openai-compatible`){s.baseUrl=y.trim();let e=ie(S);e.length&&(s.models=e)}V.auth===`cli`&&T.trim()&&(s.binaryPath=T.trim());let l={provider:c,label:d.trim(),priority:i,weight:a,...Object.keys(o.limits).length&&{limits:o.limits},...Object.keys(s).length&&{config:s},..._.trim()&&{secret:_.trim()}};try{let t=await r.mutateAsync(l);v(``),O({tone:`ok`,title:`Account added`,description:`${t.label} (${t.id})`}),e()}catch(e){v(``),B(m(e)&&e.code===`experimental_disabled`?`The gateway refused this provider: experimental.geminiWeb is off in config.json.`:u(e))}},noValidate:!0,className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`fieldset`,{children:[(0,$.jsx)(`legend`,{className:`mb-2 text-[12px] font-medium text-fg-2`,children:`Provider`}),(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:f.map(e=>{let t=h(e),n=e===`gemini-web`&&!o,r=c===e;return(0,$.jsxs)(`label`,{className:i(`relative flex cursor-pointer items-start gap-2.5 rounded-md border p-2.5 transition-colors duration-150`,`has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-accent`,r?`border-accent/60 bg-accent-soft`:`border-line hover:border-line-strong hover:bg-hover`,n&&!r&&`opacity-60`),children:[(0,$.jsx)(`input`,{type:`radio`,name:`provider`,value:e,checked:r,onChange:()=>{l(e),R({}),B(null)},className:`sr-only`}),(0,$.jsx)(N,{provider:e}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px] font-medium text-fg`,children:[t.label,t.experimental&&(0,$.jsx)(`span`,{className:`rounded border border-warn/30 px-1 text-2xs font-medium text-warn`,children:n?`off`:`experimental`})]}),(0,$.jsx)(`span`,{className:`block font-mono text-2xs text-muted`,children:e})]})]},e)})}),(0,$.jsx)(`p`,{className:`mt-2 text-[12px] text-muted`,children:V.blurb})]}),c===`gemini-web`&&(0,$.jsxs)(E,{tone:`warn`,title:`Terms of Service risk`,children:[(0,$.jsx)(`p`,{children:`This provider automates a consumer Gemini web session through Chromium. That likely violates Google's Terms of Service and the account can be rate-limited or suspended.`}),o?(0,$.jsxs)(`label`,{className:`mt-2 flex items-start gap-2 text-fg`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:F,onChange:e=>I(e.target.checked),className:`mt-0.5 accent-accent`,"aria-describedby":L.ack?`ack-error`:void 0}),`I understand the risk and want to add this account anyway.`]}):(0,$.jsxs)(`p`,{className:`mt-1.5`,children:[`It is disabled on this gateway. To opt in, set`,` `,(0,$.jsxs)(`code`,{className:`font-mono text-fg`,children:[`"experimental": `,`{ "geminiWeb": true }`]}),` `,`in `,(0,$.jsx)(`code`,{className:`font-mono text-fg`,children:`~/.davecode/config.json`}),` and restart.`]}),L.ack&&(0,$.jsx)(`p`,{id:`ack-error`,role:`alert`,className:`mt-1 text-err`,children:L.ack})]}),U&&(0,$.jsxs)(E,{tone:`info`,title:`Multi-account rotation is off`,children:[`You already have a `,V.label,` account. Without`,` `,(0,$.jsx)(`code`,{className:`font-mono text-fg`,children:`experimental.multiAccountRotation`}),` the router uses only one subscription login per provider; the others act as manual fallbacks.`]}),!G&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Z,{label:`Label`,required:!0,error:L.label,hint:`Shown in the dashboard, logs and events.`,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(X,{id:e,value:d,placeholder:c===`openai-compatible`?`OpenRouter`:`${V.label} — work`,onChange:e=>g(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,"aria-required":!0})}),c===`openai-compatible`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Z,{label:`Base URL`,required:!0,error:L.baseUrl,hint:`The OpenAI-compatible root, including /v1.`,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(X,{id:e,type:`url`,value:y,placeholder:`http://127.0.0.1:11434/v1`,onChange:e=>x(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`font-mono`})}),(0,$.jsx)(Z,{label:`Models`,hint:`Comma-separated allow-list. Leave empty to discover via /v1/models.`,children:({id:e,describedBy:t})=>(0,$.jsx)(X,{id:e,value:S,placeholder:`Provider model IDs`,onChange:e=>w(e.target.value),"aria-describedby":t,className:`font-mono`})})]}),V.auth===`cli`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(Z,{label:`CLI binary`,hint:`Optional path; defaults to the binary on your PATH.`,children:({id:e,describedBy:t})=>(0,$.jsx)(X,{id:e,value:T,placeholder:_e[c]?.binary??`claude`,onChange:e=>re(e.target.value),"aria-describedby":t,className:`font-mono`})}),(0,$.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[`No secret is needed here. After adding, open the account and press`,` `,(0,$.jsx)(`span`,{className:`text-fg-2`,children:`Connect subscription`}),`: it runs the vendor’s official sign-in inside the account’s own sandbox (`,_e[c]?.env,`). DaveCode never sees your password. From a terminal:`]}),(0,$.jsx)(W,{command:`davecode add-account --provider ${c}`})]}):V.auth===`browser`?null:(0,$.jsx)(Z,{label:V.secretLabel??`Secret`,required:V.auth===`api-key`,error:L.secret,hint:`Write-only. Encrypted at rest; no endpoint ever returns it.`,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(te,{id:e,value:_,onChange:v,placeholder:V.secretPlaceholder,describedBy:t,invalid:n})}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,$.jsx)(Z,{label:`Priority`,error:L.priority,hint:`Lower is tried first.`,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(X,{id:e,inputMode:`numeric`,value:D,onChange:e=>k(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`tnum font-mono`})}),(0,$.jsx)(Z,{label:`Weight`,error:L.weight,hint:`Share among equal priorities.`,children:({id:e,describedBy:t,invalid:n})=>(0,$.jsx)(X,{id:e,inputMode:`decimal`,value:A,onChange:e=>j(e.target.value),"aria-describedby":t,"aria-invalid":n||void 0,className:`tnum font-mono`})})]}),(0,$.jsxs)(`details`,{className:`group rounded-md border border-line`,children:[(0,$.jsxs)(`summary`,{className:`flex items-center justify-between px-3 py-2 text-[12px] font-medium text-fg-2 select-none hover:text-fg`,children:[`Quota limits`,(0,$.jsx)(`span`,{className:`text-2xs font-normal text-muted group-open:hidden`,children:`optional · unlimited by default`})]}),(0,$.jsx)(`div`,{className:`border-t border-line p-3`,children:(0,$.jsx)(ae,{value:M,onChange:P,errors:L.limits??{}})})]})]}),z&&(0,$.jsx)(E,{tone:`err`,title:`Could not add the account`,children:z}),(0,$.jsxs)(`div`,{className:`sticky -bottom-4 -mx-5 -mb-4 flex items-center justify-end gap-2 border-t border-line bg-panel px-5 py-3`,children:[(0,$.jsx)(Y,{variant:`ghost`,onClick:e,children:`Cancel`}),(0,$.jsx)(Y,{type:`submit`,variant:`primary`,loading:r.isPending,disabled:G,icon:G?ue:void 0,children:G?`Disabled by config`:`Add account`})]})]})}function be(e){if(!e)return;let t=e.price?`${e.price.amount} ${e.price.currency}/${e.price.period===`month`?`mo`:`yr`}`:void 0;return[e.plan,t].filter(Boolean).join(` · `)||void 0}function xe({days:e}){return e===void 0?(0,$.jsx)(`span`,{className:`text-faint`,children:`—`}):e<0?(0,$.jsxs)(g,{tone:`err`,children:[`overdue `,-e,`d`]}):(0,$.jsx)(g,{tone:e<=3?`warn`:`neutral`,mono:!0,children:e===0?`today`:`in ${e}d`})}function Se({budget:e}){if(e.remaining===null)return(0,$.jsx)(`span`,{className:`text-2xs text-faint`,children:`no limit known`});let t=e.remaining,n=t<=.1?`bg-err`:t<=.15?`bg-warn`:`bg-meter`;return(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`div`,{role:`meter`,"aria-label":`${e.label} remaining budget`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(t*100),className:`relative h-1.5 min-w-16 flex-1 rounded-full bg-track`,children:(0,$.jsx)(`div`,{className:i(`absolute inset-y-0 left-0 rounded-full transition-[width] duration-500 ease-snappy`,n),style:{width:`${Math.min(100,t*100)}%`}})}),(0,$.jsx)(`span`,{className:`tnum w-9 shrink-0 text-right font-mono text-2xs text-fg-2`,children:_(t)}),(0,$.jsx)(`span`,{className:`w-14 shrink-0 font-mono text-2xs text-muted`,children:e.tightestWindow??`provider`})]})}function Ce(){let e=d(),[t,n]=(0,Q.useState)(!1),r=e.data?.accounts??[],a=r.filter(e=>e.enabled),o=a.filter(e=>e.available).length;return(0,$.jsxs)(G,{"aria-labelledby":`budget-title`,children:[(0,$.jsx)(R,{id:`budget-title`,title:`Budget`,meta:e.data?`${o} of ${a.length} enabled accounts available · plans are entered by hand`:void 0,actions:(0,$.jsx)(Y,{size:`sm`,variant:`ghost`,icon:A,"aria-expanded":t,onClick:()=>n(e=>!e),children:`What agents see`})}),e.isPending?(0,$.jsx)(J,{rows:3}):e.isError?(0,$.jsx)(`p`,{className:`px-3.5 py-3 text-[12px] text-err`,children:u(e.error)}):(0,$.jsxs)($.Fragment,{children:[t&&(0,$.jsxs)(`div`,{className:`relative border-b border-line bg-raised px-3.5 py-3`,children:[(0,$.jsx)(V,{value:e.data.context,label:`Copy agent budget context`,className:`absolute top-2 right-2`}),(0,$.jsx)(`pre`,{className:`overflow-x-auto pr-8 font-mono text-2xs leading-5 whitespace-pre-wrap text-fg-2`,children:e.data.context||`No enabled accounts: agents get no budget context.`})]}),(0,$.jsx)(`ul`,{className:`divide-y divide-line`,children:r.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>j(`account`,e.accountId),className:i(`grid w-full grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1.5 px-3.5 py-2.5 text-left transition-colors duration-150 hover:bg-hover/60 md:grid-cols-[minmax(0,1.3fr)_minmax(0,1fr)_5.5rem_minmax(0,1.2fr)_minmax(0,1fr)]`,!e.enabled&&`text-muted`),children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(N,{provider:e.provider}),(0,$.jsx)(`span`,{className:`truncate text-[13px] font-medium`,children:e.label})]}),(0,$.jsx)(`span`,{className:`truncate text-[12px] text-fg-2`,children:be(e.subscription)??(0,$.jsx)(`span`,{className:`text-faint`,children:`no plan`})}),(0,$.jsx)(`span`,{className:`justify-self-end md:justify-self-start`,children:(0,$.jsx)(xe,{days:e.renewsInDays})}),(0,$.jsx)(`span`,{className:`col-span-2 md:col-span-1`,children:(0,$.jsx)(Se,{budget:e})}),(0,$.jsx)(`span`,{className:`truncate text-[12px] md:text-right`,children:e.available?(0,$.jsx)(g,{tone:`ok`,dot:!0,children:`available`}):(0,$.jsx)(`span`,{className:`text-warn`,title:e.unavailableReason,children:e.unavailableReason??`unavailable`})})]})},e.accountId))})]})]})}function we(){let e=p(),t=s(),n=o(),{params:r}=B(),[a,c]=(0,Q.useState)(``),[l,d]=(0,Q.useState)(`all`),f=r.get(`account`),m=r.get(`new`)===`1`,g=(0,Q.useMemo)(()=>new Map((t.data??[]).map(e=>[e.accountId,e])),[t.data]),_=(0,Q.useMemo)(()=>[...e.data??[]].sort((e,t)=>e.priority-t.priority||e.label.localeCompare(t.label)),[e.data]),v=(0,Q.useMemo)(()=>{let e={all:_.length,active:0,cooldown:0,disabled:0,error:0};for(let t of _)e[t.status]+=1;return e},[_]),y=a.trim().toLowerCase(),b=_.filter(e=>(l===`all`||e.status===l)&&(!y||e.label.toLowerCase().includes(y)||e.id.toLowerCase().includes(y)||e.provider.includes(y))),C=_.find(e=>e.id===f),w=(e,t)=>{n.mutate({id:e.id,patch:{enabled:t}},{onError:n=>O({tone:`err`,title:`Could not ${t?`enable`:`disable`} ${e.label}`,description:u(n)})})};return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsx)(H,{title:`Accounts`,description:`Provider accounts the router balances across. Lower priority numbers are tried first.`,actions:(0,$.jsx)(Y,{variant:`primary`,icon:oe,onClick:()=>j(`new`,`1`),children:`Add account`})}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`relative w-full sm:w-64`,children:[(0,$.jsx)(k,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,$.jsx)(X,{type:`search`,"aria-label":`Filter accounts`,placeholder:`Filter by label, id or provider`,value:a,onChange:e=>c(e.target.value),className:`pl-8`,"data-filter-input":!0})]}),(0,$.jsx)(q,{label:`Status`,value:l,onChange:d,options:[{value:`all`,label:`All`,count:v.all},{value:`active`,label:`Active`,count:v.active},{value:`cooldown`,label:`Cooldown`,count:v.cooldown},{value:`disabled`,label:`Disabled`,count:v.disabled},{value:`error`,label:`Error`,count:v.error}]}),(0,$.jsx)(P,{className:`ml-auto hidden lg:flex`})]}),e.isError&&(0,$.jsx)(E,{tone:`err`,title:`Could not load accounts`,children:u(e.error)}),(0,$.jsx)(G,{children:e.isPending?(0,$.jsx)(J,{rows:5}):_.length===0?(0,$.jsx)(K,{icon:z,title:`No accounts yet`,description:`Add an API key, a local OpenAI-compatible server or a CLI login. The router starts using it immediately.`,command:`davecode add-account`,action:(0,$.jsx)(Y,{variant:`primary`,icon:oe,onClick:()=>j(`new`,`1`),children:`Add account`})}):b.length===0?(0,$.jsx)(K,{icon:k,title:`No matching accounts`,description:`Try a different filter.`}):(0,$.jsx)(`div`,{className:`overflow-x-auto`,children:(0,$.jsxs)(`table`,{className:`w-full min-w-[880px] text-[13px]`,children:[(0,$.jsx)(`caption`,{className:`sr-only`,children:`Accounts`}),(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-line text-left text-[12px] text-muted`,children:[(0,$.jsx)(`th`,{scope:`col`,className:`w-[32%] px-3.5 py-2 font-medium`,children:`Account`}),(0,$.jsx)(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:`Status`}),(0,$.jsx)(`th`,{scope:`col`,className:`w-20 px-3 py-2 text-right font-medium`,children:`Priority`}),(0,$.jsx)(`th`,{scope:`col`,className:`w-20 px-3 py-2 text-right font-medium`,children:`Weight`}),(0,$.jsx)(`th`,{scope:`col`,className:`w-[30%] px-3 py-2 font-medium`,children:`Quota`}),(0,$.jsx)(`th`,{scope:`col`,className:`w-20 px-3 py-2 font-medium`,children:`Enabled`}),(0,$.jsx)(`th`,{scope:`col`,className:`w-10 px-2 py-2`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Details`})})]})}),(0,$.jsx)(`tbody`,{children:b.map(e=>{let t=g.get(e.id),n=h(e.provider);return(0,$.jsxs)(`tr`,{onClick:()=>j(`account`,e.id),className:i(`group cursor-pointer border-b border-line transition-colors duration-150 last:border-b-0 hover:bg-hover/60`,f===e.id&&`bg-hover/60`,!e.enabled&&`text-muted`),children:[(0,$.jsx)(`td`,{className:`max-w-0 px-3.5 py-2.5`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,$.jsx)(N,{provider:e.provider}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),j(`account`,e.id)},className:`block max-w-full truncate text-left font-medium text-fg hover:underline focus-visible:underline`,children:e.label}),(0,$.jsxs)(`p`,{className:`truncate font-mono text-2xs text-muted`,children:[e.id,` · `,n.label,n.experimental&&(0,$.jsx)(`span`,{className:`text-warn`,children:` · experimental`})]})]})]})}),(0,$.jsx)(`td`,{className:`px-3 py-2.5`,children:(0,$.jsx)(L,{account:e})}),(0,$.jsx)(`td`,{className:`tnum px-3 py-2.5 text-right font-mono`,children:e.priority}),(0,$.jsx)(`td`,{className:`tnum px-3 py-2.5 text-right font-mono`,children:e.weight}),(0,$.jsx)(`td`,{className:`px-3 py-2`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(U,{label:`1m`,usage:t?.windows[`1m`]}),(0,$.jsx)(U,{label:`5h`,usage:t?.windows[`5h`]}),(0,$.jsx)(U,{label:`24h`,usage:t?.windows[`24h`]})]})}),(0,$.jsx)(`td`,{className:`px-3 py-2.5`,children:(0,$.jsx)(S,{checked:e.enabled,onChange:t=>w(e,t),label:`${e.enabled?`Disable`:`Enable`} ${e.label}`})}),(0,$.jsx)(`td`,{className:`px-2 py-2.5 text-muted`,children:(0,$.jsx)(x,{"aria-hidden":!0,className:`size-4 transition-transform duration-150 group-hover:translate-x-0.5`,strokeWidth:1.75})})]},e.id)})})]})})}),_.length>0&&(0,$.jsx)(Ce,{}),(0,$.jsx)(ve,{open:m,onClose:()=>j(`new`,null)}),(0,$.jsx)(he,{account:C,usage:C?g.get(C.id):void 0,onClose:()=>j(`account`,null)})]})}export{we as Accounts};
|