@w6w/embed 0.2.28 → 0.2.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/{ConfirmModal-Pv2-A_3U.js → ConfirmModal-WqBfWftD.js} +100 -83
  2. package/dist/{ConfirmModal-Pv2-A_3U.js.map → ConfirmModal-WqBfWftD.js.map} +1 -1
  3. package/dist/{CreateFunctionModal-B3LpcuI9.js → CreateFunctionModal-CCYi9deY.js} +2 -2
  4. package/dist/{CreateFunctionModal-B3LpcuI9.js.map → CreateFunctionModal-CCYi9deY.js.map} +1 -1
  5. package/dist/{DocumentFormModal-DieWYFi4.js → DocumentFormModal-CCIgA7pR.js} +2 -2
  6. package/dist/{DocumentFormModal-DieWYFi4.js.map → DocumentFormModal-CCIgA7pR.js.map} +1 -1
  7. package/dist/{ImportSpecModal-xwTzj4KB.js → ImportSpecModal-DoxsVxru.js} +2 -2
  8. package/dist/{ImportSpecModal-xwTzj4KB.js.map → ImportSpecModal-DoxsVxru.js.map} +1 -1
  9. package/dist/{ModelRoutesManager-DtByS4mE.js → ModelRoutesManager-DqeY1mdP.js} +110 -106
  10. package/dist/ModelRoutesManager-DqeY1mdP.js.map +1 -0
  11. package/dist/{WorkflowEditor-CvWkVmFn.js → WorkflowEditor-CBUwh85L.js} +3 -3
  12. package/dist/{WorkflowEditor-CvWkVmFn.js.map → WorkflowEditor-CBUwh85L.js.map} +1 -1
  13. package/dist/chrome/CallFromCodeButton.d.ts +12 -0
  14. package/dist/chrome/index.d.ts +1 -1
  15. package/dist/{editor-tools-CVYTsVFN.js → editor-tools--Y3wlBZE.js} +3 -3
  16. package/dist/{editor-tools-CVYTsVFN.js.map → editor-tools--Y3wlBZE.js.map} +1 -1
  17. package/dist/editor.mjs +1 -1
  18. package/dist/editors.mjs +6 -6
  19. package/dist/forms.mjs +321 -297
  20. package/dist/forms.mjs.map +1 -1
  21. package/dist/lists.mjs +948 -909
  22. package/dist/lists.mjs.map +1 -1
  23. package/dist/rail.mjs +1 -1
  24. package/dist/repos/connections.d.ts +1 -0
  25. package/package.json +4 -4
  26. package/dist/ModelRoutesManager-DtByS4mE.js.map +0 -1
package/dist/forms.mjs CHANGED
@@ -1,37 +1,37 @@
1
1
  "use client";
2
- import { C as Je, a as He } from "./CreateFunctionModal-B3LpcuI9.js";
3
- import { jsx as t, jsxs as l, Fragment as ne } from "react/jsx-runtime";
2
+ import { C as _e, a as Je } from "./CreateFunctionModal-CCYi9deY.js";
3
+ import { jsx as t, jsxs as l, Fragment as te } from "react/jsx-runtime";
4
4
  import { ApiError as I } from "@w6w/sdk";
5
- import { EmptyState as P, DataTable as U, EditButton as T, DeleteButton as A, useEnterSubmit as V, BudgetMeter as se } from "@w6w/ui";
5
+ import { EmptyState as A, DataTable as P, RowActionsMenu as U, useEnterSubmit as T, BudgetMeter as ie } from "@w6w/ui";
6
6
  import { useState as m } from "react";
7
- import { C as O, a as re, M as R } from "./ConfirmModal-Pv2-A_3U.js";
8
- import { u as ae } from "./project-context-Tvp-La7A.js";
9
- import { i as oe, d as de, b as ce, h as ue, f as me, c as he, u as ge, g as ve } from "./vault-BSEWhMYC.js";
10
- import { M as ze } from "./ModelRoutesManager-DtByS4mE.js";
11
- import { N as be, K as pe, J as fe, Q as ye, M as Ne } from "./models-CI0vLJ6o.js";
12
- const Ce = ["string", "number", "boolean", "json"];
13
- function Z(e) {
7
+ import { a as se, C as V, M as R } from "./ConfirmModal-WqBfWftD.js";
8
+ import { u as ne } from "./project-context-Tvp-La7A.js";
9
+ import { i as re, d as oe, b as de, h as ce, f as ue, c as me, u as he, g as ge } from "./vault-BSEWhMYC.js";
10
+ import { M as Ye } from "./ModelRoutesManager-DqeY1mdP.js";
11
+ import { N as be, K as ve, J as pe, Q as fe, M as ye } from "./models-CI0vLJ6o.js";
12
+ const Ne = ["string", "number", "boolean", "json"];
13
+ function X(e) {
14
14
  if (e.type === "boolean" || e.type === "number" || e.type === "string") return String(e.value);
15
15
  const n = JSON.stringify(e.value);
16
16
  return n.length > 80 ? `${n.slice(0, 80)}…` : n;
17
17
  }
18
- function Ke(e) {
19
- var w;
20
- const n = e.slots, a = ae(e.project), [h, i] = m(null), [f, o] = m(null), g = oe(a ?? void 0, a != null), b = de(), y = a != null, p = () => {
21
- a != null && i({ mode: "create" });
22
- }, N = (n == null ? void 0 : n.header) === void 0 ? /* @__PURE__ */ t("h3", { children: "Variables" }) : n.header, C = n == null ? void 0 : n.actions, S = C === void 0 ? /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !y, onClick: p, children: "+ Add variable" }) : typeof C == "function" ? C({ openCreate: p, canCreate: y }) : C, s = (n == null ? void 0 : n.empty) === void 0 ? /* @__PURE__ */ t(P, { testId: "vars-manager-empty", children: "No variables yet." }) : n.empty, c = [
18
+ function Oe(e) {
19
+ var k;
20
+ const n = e.slots, a = ne(e.project), [h, s] = m(null), [p, d] = m(null), [f, b] = m(null), g = re(a ?? void 0, a != null), v = oe(), y = a != null, C = () => {
21
+ a != null && s({ mode: "create" });
22
+ }, N = (n == null ? void 0 : n.header) === void 0 ? /* @__PURE__ */ t("h3", { children: "Variables" }) : n.header, i = n == null ? void 0 : n.actions, u = i === void 0 ? /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !y, onClick: C, children: "+ Add variable" }) : typeof i == "function" ? i({ openCreate: C, canCreate: y }) : i, S = (n == null ? void 0 : n.empty) === void 0 ? /* @__PURE__ */ t(A, { testId: "vars-manager-empty", children: "No variables yet." }) : n.empty, M = [
23
23
  {
24
24
  key: "name",
25
25
  header: "Variable",
26
- render: (u) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
27
- /* @__PURE__ */ t("strong", { className: "list-name", title: u.name, children: u.name }),
26
+ render: (r) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
27
+ /* @__PURE__ */ t("strong", { className: "list-name", title: r.name, children: r.name }),
28
28
  " ",
29
- /* @__PURE__ */ t("span", { className: "tag", children: u.type }),
30
- /* @__PURE__ */ l("div", { className: "muted small list-preview", title: Z(u), children: [
31
- Z(u),
32
- u.description && /* @__PURE__ */ l(ne, { children: [
29
+ /* @__PURE__ */ t("span", { className: "tag", children: r.type }),
30
+ /* @__PURE__ */ l("div", { className: "muted small list-preview", title: X(r), children: [
31
+ X(r),
32
+ r.description && /* @__PURE__ */ l(te, { children: [
33
33
  " · ",
34
- u.description
34
+ r.description
35
35
  ] })
36
36
  ] })
37
37
  ] })
@@ -42,32 +42,41 @@ function Ke(e) {
42
42
  align: "right",
43
43
  link: !1,
44
44
  actions: !0,
45
- render: (u) => /* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", whiteSpace: "nowrap" }, children: [
46
- /* @__PURE__ */ t(re, { resource: { kind: "var", name: u.name } }),
47
- /* @__PURE__ */ t(
48
- T,
49
- {
50
- label: "Edit",
51
- onClick: () => i({ mode: "edit", v: u }),
52
- "data-testid": `var-edit-${u.id}`
53
- }
54
- ),
55
- /* @__PURE__ */ t(
56
- A,
57
- {
58
- label: "Delete",
59
- onClick: () => o(u),
60
- disabled: b.isPending,
61
- "data-testid": `var-delete-${u.id}`
62
- }
63
- )
64
- ] })
45
+ render: (r) => /* @__PURE__ */ t(
46
+ U,
47
+ {
48
+ label: `Actions for ${r.name}`,
49
+ "data-testid": `var-actions-${r.id}`,
50
+ actions: [
51
+ {
52
+ label: "Call from code",
53
+ icon: "code",
54
+ onSelect: () => b(r.name),
55
+ "data-testid": `var-code-${r.id}`
56
+ },
57
+ {
58
+ label: "Edit",
59
+ icon: "edit",
60
+ onSelect: () => s({ mode: "edit", v: r }),
61
+ "data-testid": `var-edit-${r.id}`
62
+ },
63
+ {
64
+ label: "Delete",
65
+ icon: "delete",
66
+ danger: !0,
67
+ disabled: v.isPending,
68
+ onSelect: () => d(r),
69
+ "data-testid": `var-delete-${r.id}`
70
+ }
71
+ ]
72
+ }
73
+ )
65
74
  }
66
75
  ];
67
76
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
68
- (N != null || S != null) && /* @__PURE__ */ l("div", { className: "section-head", children: [
77
+ (N != null || u != null) && /* @__PURE__ */ l("div", { className: "section-head", children: [
69
78
  N,
70
- S
79
+ u
71
80
  ] }),
72
81
  (n == null ? void 0 : n.header) === void 0 && /* @__PURE__ */ l("p", { className: "muted small", children: [
73
82
  "User-defined typed values addressable by name. Plaintext — use ",
@@ -76,85 +85,92 @@ function Ke(e) {
76
85
  "for sensitive values."
77
86
  ] }),
78
87
  g.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
79
- ((w = g.data) == null ? void 0 : w.length) === 0 && s,
88
+ ((k = g.data) == null ? void 0 : k.length) === 0 && S,
80
89
  g.data != null && g.data.length > 0 && /* @__PURE__ */ t(
81
- U,
90
+ P,
82
91
  {
83
92
  className: "w6w-data-table-rows",
84
- columns: c,
93
+ columns: M,
85
94
  rows: g.data,
86
- rowKey: (u) => u.id
95
+ rowKey: (r) => r.id
87
96
  }
88
97
  ),
89
98
  h && a != null && /* @__PURE__ */ t(
90
- Se,
99
+ Ce,
91
100
  {
92
101
  project: a,
93
102
  initial: h.mode === "edit" ? h.v : void 0,
94
- onClose: () => i(null),
95
- onSaved: () => i(null)
103
+ onClose: () => s(null),
104
+ onSaved: () => s(null)
105
+ }
106
+ ),
107
+ f != null && /* @__PURE__ */ t(
108
+ se,
109
+ {
110
+ resource: { kind: "var", name: f },
111
+ onClose: () => b(null)
96
112
  }
97
113
  ),
98
- f && a != null && /* @__PURE__ */ t(
99
- O,
114
+ p && a != null && /* @__PURE__ */ t(
115
+ V,
100
116
  {
101
117
  title: "Delete variable",
102
- message: `Delete the variable "${f.name}"? This cannot be undone.`,
118
+ message: `Delete the variable "${p.name}"? This cannot be undone.`,
103
119
  confirmLabel: "Delete",
104
120
  onConfirm: () => {
105
- b.mutate({ id: f.id, project: a }), o(null);
121
+ v.mutate({ id: p.id, project: a }), d(null);
106
122
  },
107
- onClose: () => o(null)
123
+ onClose: () => d(null)
108
124
  }
109
125
  )
110
126
  ] }) });
111
127
  }
112
- function Se(e) {
113
- var k, v, E;
114
- const n = !!e.initial, [a, h] = m(((k = e.initial) == null ? void 0 : k.name) ?? ""), [i, f] = m(((v = e.initial) == null ? void 0 : v.type) ?? "string"), [o, g] = m(() => e.initial ? e.initial.type === "string" ? String(e.initial.value ?? "") : JSON.stringify(e.initial.value, null, 2) : ""), [b, y] = m(((E = e.initial) == null ? void 0 : E.description) ?? ""), [p, N] = m(null);
128
+ function Ce(e) {
129
+ var k, r, E;
130
+ const n = !!e.initial, [a, h] = m(((k = e.initial) == null ? void 0 : k.name) ?? ""), [s, p] = m(((r = e.initial) == null ? void 0 : r.type) ?? "string"), [d, f] = m(() => e.initial ? e.initial.type === "string" ? String(e.initial.value ?? "") : JSON.stringify(e.initial.value, null, 2) : ""), [b, g] = m(((E = e.initial) == null ? void 0 : E.description) ?? ""), [v, y] = m(null);
115
131
  function C() {
116
- if (i === "string") return { ok: !0, value: o };
117
- if (i === "boolean")
118
- return o === "true" ? { ok: !0, value: !0 } : o === "false" ? { ok: !0, value: !1 } : { ok: !1, error: "Value must be `true` or `false`." };
119
- if (i === "number") {
120
- const d = Number(o);
121
- return Number.isFinite(d) ? { ok: !0, value: d } : { ok: !1, error: "Value must be a finite number." };
132
+ if (s === "string") return { ok: !0, value: d };
133
+ if (s === "boolean")
134
+ return d === "true" ? { ok: !0, value: !0 } : d === "false" ? { ok: !0, value: !1 } : { ok: !1, error: "Value must be `true` or `false`." };
135
+ if (s === "number") {
136
+ const c = Number(d);
137
+ return Number.isFinite(c) ? { ok: !0, value: c } : { ok: !1, error: "Value must be a finite number." };
122
138
  }
123
139
  try {
124
- return { ok: !0, value: JSON.parse(o) };
125
- } catch (d) {
126
- return { ok: !1, error: `Invalid JSON: ${d.message}` };
140
+ return { ok: !0, value: JSON.parse(d) };
141
+ } catch (c) {
142
+ return { ok: !1, error: `Invalid JSON: ${c.message}` };
127
143
  }
128
144
  }
129
- const S = ce(), s = ue(), c = S.isPending || s.isPending;
130
- function w() {
131
- const d = C();
132
- if (!d.ok) {
133
- N(d.error);
145
+ const N = de(), i = ce(), u = N.isPending || i.isPending;
146
+ function S() {
147
+ const c = C();
148
+ if (!c.ok) {
149
+ y(c.error);
134
150
  return;
135
151
  }
136
- N(null);
137
- const j = {
152
+ y(null);
153
+ const $ = {
138
154
  onSuccess: () => e.onSaved(),
139
- onError: (M) => N((M instanceof I, M.message))
155
+ onError: (w) => y((w instanceof I, w.message))
140
156
  };
141
157
  if (e.initial) {
142
- s.mutate(
158
+ i.mutate(
143
159
  {
144
160
  id: e.initial.id,
145
- patch: { type: i, value: d.value, description: b },
161
+ patch: { type: s, value: c.value, description: b },
146
162
  project: e.project
147
163
  },
148
- j
164
+ $
149
165
  );
150
166
  return;
151
167
  }
152
- S.mutate(
153
- { input: { name: a, type: i, value: d.value, description: b }, project: e.project },
154
- j
168
+ N.mutate(
169
+ { input: { name: a, type: s, value: c.value, description: b }, project: e.project },
170
+ $
155
171
  );
156
172
  }
157
- const u = V(w, { enabled: !!a && !c });
173
+ const M = T(S, { enabled: !!a && !u });
158
174
  return /* @__PURE__ */ l(
159
175
  R,
160
176
  {
@@ -170,41 +186,41 @@ function Se(e) {
170
186
  type: "text",
171
187
  value: a,
172
188
  disabled: n,
173
- onChange: (d) => h(d.target.value),
189
+ onChange: (c) => h(c.target.value),
174
190
  placeholder: "e.g. api_base_url",
175
191
  maxLength: 64,
176
- ...u
192
+ ...M
177
193
  }
178
194
  ),
179
195
  !n && /* @__PURE__ */ t("span", { className: "hint", children: "Letters, digits, and underscores. Must start with a letter or underscore. Case-sensitive." })
180
196
  ] }),
181
197
  /* @__PURE__ */ l("label", { className: "field", children: [
182
198
  /* @__PURE__ */ t("span", { children: "Type" }),
183
- /* @__PURE__ */ t("select", { value: i, onChange: (d) => f(d.target.value), children: Ce.map((d) => /* @__PURE__ */ t("option", { value: d, children: d }, d)) })
199
+ /* @__PURE__ */ t("select", { value: s, onChange: (c) => p(c.target.value), children: Ne.map((c) => /* @__PURE__ */ t("option", { value: c, children: c }, c)) })
184
200
  ] }),
185
201
  /* @__PURE__ */ l("label", { className: "field", htmlFor: "var-value", children: [
186
202
  /* @__PURE__ */ t("span", { children: "Value" }),
187
- i === "boolean" ? /* @__PURE__ */ l("select", { id: "var-value", value: o || "true", onChange: (d) => g(d.target.value), children: [
203
+ s === "boolean" ? /* @__PURE__ */ l("select", { id: "var-value", value: d || "true", onChange: (c) => f(c.target.value), children: [
188
204
  /* @__PURE__ */ t("option", { value: "true", children: "true" }),
189
205
  /* @__PURE__ */ t("option", { value: "false", children: "false" })
190
- ] }) : i === "number" ? /* @__PURE__ */ t(
206
+ ] }) : s === "number" ? /* @__PURE__ */ t(
191
207
  "input",
192
208
  {
193
209
  id: "var-value",
194
210
  type: "number",
195
- value: o,
196
- onChange: (d) => g(d.target.value),
211
+ value: d,
212
+ onChange: (c) => f(c.target.value),
197
213
  placeholder: "0",
198
- ...u
214
+ ...M
199
215
  }
200
- ) : i === "json" ? /* @__PURE__ */ t(
216
+ ) : s === "json" ? /* @__PURE__ */ t(
201
217
  "textarea",
202
218
  {
203
219
  id: "var-value",
204
220
  className: "code",
205
221
  rows: 6,
206
- value: o,
207
- onChange: (d) => g(d.target.value),
222
+ value: d,
223
+ onChange: (c) => f(c.target.value),
208
224
  placeholder: '{"key": "value"}'
209
225
  }
210
226
  ) : /* @__PURE__ */ t(
@@ -212,10 +228,10 @@ function Se(e) {
212
228
  {
213
229
  id: "var-value",
214
230
  type: "text",
215
- value: o,
216
- onChange: (d) => g(d.target.value),
231
+ value: d,
232
+ onChange: (c) => f(c.target.value),
217
233
  placeholder: "",
218
- ...u
234
+ ...M
219
235
  }
220
236
  )
221
237
  ] }),
@@ -226,39 +242,39 @@ function Se(e) {
226
242
  {
227
243
  type: "text",
228
244
  value: b,
229
- onChange: (d) => y(d.target.value),
245
+ onChange: (c) => g(c.target.value),
230
246
  placeholder: "Optional",
231
- ...u
247
+ ...M
232
248
  }
233
249
  )
234
250
  ] }),
235
- p && /* @__PURE__ */ t("div", { className: "result error", children: p })
251
+ v && /* @__PURE__ */ t("div", { className: "result error", children: v })
236
252
  ] }),
237
253
  /* @__PURE__ */ l("div", { className: "modal-actions", children: [
238
254
  /* @__PURE__ */ t("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
239
- /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !a || c, onClick: w, children: c ? "Saving…" : n ? "Save changes" : "Save variable" })
255
+ /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !a || u, onClick: S, children: u ? "Saving…" : n ? "Save changes" : "Save variable" })
240
256
  ] })
241
257
  ]
242
258
  }
243
259
  );
244
260
  }
245
- function We(e) {
246
- var s;
247
- const n = e.slots, [a, h] = m(null), [i, f] = m(null), o = me(), g = he(), b = () => h({ mode: "create" }), y = (n == null ? void 0 : n.header) === void 0 ? /* @__PURE__ */ t("h3", { children: "Secrets" }) : n.header, p = n == null ? void 0 : n.actions, N = p === void 0 ? /* @__PURE__ */ t("button", { type: "button", className: "btn", onClick: b, children: "+ Add secret" }) : typeof p == "function" ? p({ openCreate: b, canCreate: !0 }) : p, C = (n == null ? void 0 : n.empty) === void 0 ? /* @__PURE__ */ t(P, { testId: "secrets-manager-empty", children: "No secrets yet." }) : n.empty, S = [
261
+ function Fe(e) {
262
+ var i;
263
+ const n = e.slots, [a, h] = m(null), [s, p] = m(null), d = ue(), f = me(), b = () => h({ mode: "create" }), g = (n == null ? void 0 : n.header) === void 0 ? /* @__PURE__ */ t("h3", { children: "Secrets" }) : n.header, v = n == null ? void 0 : n.actions, y = v === void 0 ? /* @__PURE__ */ t("button", { type: "button", className: "btn", onClick: b, children: "+ Add secret" }) : typeof v == "function" ? v({ openCreate: b, canCreate: !0 }) : v, C = (n == null ? void 0 : n.empty) === void 0 ? /* @__PURE__ */ t(A, { testId: "secrets-manager-empty", children: "No secrets yet." }) : n.empty, N = [
248
264
  {
249
265
  key: "name",
250
266
  header: "Secret",
251
- render: (c) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
252
- /* @__PURE__ */ t("strong", { className: "list-name", title: c.name, children: c.name }),
267
+ render: (u) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
268
+ /* @__PURE__ */ t("strong", { className: "list-name", title: u.name, children: u.name }),
253
269
  " ",
254
270
  /* @__PURE__ */ t("code", { className: "muted small", children: "••••••••" }),
255
271
  /* @__PURE__ */ l("div", { className: "muted small list-preview", children: [
256
- c.description && /* @__PURE__ */ l(ne, { children: [
257
- c.description,
272
+ u.description && /* @__PURE__ */ l(te, { children: [
273
+ u.description,
258
274
  " · "
259
275
  ] }),
260
276
  "updated ",
261
- new Date(c.updatedAt).toLocaleString()
277
+ new Date(u.updatedAt).toLocaleString()
262
278
  ] })
263
279
  ] })
264
280
  },
@@ -268,93 +284,97 @@ function We(e) {
268
284
  align: "right",
269
285
  link: !1,
270
286
  actions: !0,
271
- render: (c) => /* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", whiteSpace: "nowrap" }, children: [
272
- /* @__PURE__ */ t(
273
- T,
274
- {
275
- label: "Rotate",
276
- onClick: () => h({ mode: "edit", s: c }),
277
- "data-testid": `secret-rotate-${c.id}`
278
- }
279
- ),
280
- /* @__PURE__ */ t(
281
- A,
282
- {
283
- label: "Delete",
284
- onClick: () => f(c),
285
- disabled: g.isPending,
286
- "data-testid": `secret-delete-${c.id}`
287
- }
288
- )
289
- ] })
287
+ render: (u) => /* @__PURE__ */ t(
288
+ U,
289
+ {
290
+ label: `Actions for ${u.name}`,
291
+ "data-testid": `secret-actions-${u.id}`,
292
+ actions: [
293
+ {
294
+ label: "Rotate",
295
+ icon: "edit",
296
+ onSelect: () => h({ mode: "edit", s: u }),
297
+ "data-testid": `secret-rotate-${u.id}`
298
+ },
299
+ {
300
+ label: "Delete",
301
+ icon: "delete",
302
+ danger: !0,
303
+ disabled: f.isPending,
304
+ onSelect: () => p(u),
305
+ "data-testid": `secret-delete-${u.id}`
306
+ }
307
+ ]
308
+ }
309
+ )
290
310
  }
291
311
  ];
292
312
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
293
- (y != null || N != null) && /* @__PURE__ */ l("div", { className: "section-head", children: [
294
- y,
295
- N
313
+ (g != null || y != null) && /* @__PURE__ */ l("div", { className: "section-head", children: [
314
+ g,
315
+ y
296
316
  ] }),
297
317
  (n == null ? void 0 : n.header) === void 0 && /* @__PURE__ */ t("p", { className: "muted small", children: "Secrets addressable by name. Stored encrypted at rest and never returned from the server — to change a secret, overwrite it." }),
298
- o.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
299
- ((s = o.data) == null ? void 0 : s.length) === 0 && C,
300
- o.data != null && o.data.length > 0 && /* @__PURE__ */ t(
301
- U,
318
+ d.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
319
+ ((i = d.data) == null ? void 0 : i.length) === 0 && C,
320
+ d.data != null && d.data.length > 0 && /* @__PURE__ */ t(
321
+ P,
302
322
  {
303
323
  className: "w6w-data-table-rows",
304
- columns: S,
305
- rows: o.data,
306
- rowKey: (c) => c.id
324
+ columns: N,
325
+ rows: d.data,
326
+ rowKey: (u) => u.id
307
327
  }
308
328
  ),
309
329
  a && /* @__PURE__ */ t(
310
- we,
330
+ Se,
311
331
  {
312
332
  initial: a.mode === "edit" ? a.s : void 0,
313
333
  onClose: () => h(null),
314
334
  onSaved: () => h(null)
315
335
  }
316
336
  ),
317
- i && /* @__PURE__ */ t(
318
- O,
337
+ s && /* @__PURE__ */ t(
338
+ V,
319
339
  {
320
340
  title: "Delete secret",
321
- message: `Delete the secret "${i.name}"? This cannot be undone.`,
341
+ message: `Delete the secret "${s.name}"? This cannot be undone.`,
322
342
  confirmLabel: "Delete",
323
343
  onConfirm: () => {
324
- g.mutate(i.id), f(null);
344
+ f.mutate(s.id), p(null);
325
345
  },
326
- onClose: () => f(null)
346
+ onClose: () => p(null)
327
347
  }
328
348
  )
329
349
  ] }) });
330
350
  }
331
- function we(e) {
332
- var w, u, k;
333
- const n = !!e.initial, [a, h] = m(((w = e.initial) == null ? void 0 : w.name) ?? ""), [i, f] = m(""), [o, g] = m(((u = e.initial) == null ? void 0 : u.description) ?? ""), [b, y] = m(null), p = ge(), N = ve(((k = e.initial) == null ? void 0 : k.id) ?? ""), C = n ? N : p, S = !!a && (n || !!i) && !C.isPending;
334
- function s() {
335
- if (y(null), n) {
336
- N.mutate(
337
- { value: i === "" ? void 0 : i, description: o },
351
+ function Se(e) {
352
+ var S, M, k;
353
+ const n = !!e.initial, [a, h] = m(((S = e.initial) == null ? void 0 : S.name) ?? ""), [s, p] = m(""), [d, f] = m(((M = e.initial) == null ? void 0 : M.description) ?? ""), [b, g] = m(null), v = he(), y = ge(((k = e.initial) == null ? void 0 : k.id) ?? ""), C = n ? y : v, N = !!a && (n || !!s) && !C.isPending;
354
+ function i() {
355
+ if (g(null), n) {
356
+ y.mutate(
357
+ { value: s === "" ? void 0 : s, description: d },
338
358
  {
339
359
  onSuccess: () => e.onSaved(),
340
- onError: (v) => y((v instanceof I, v.message))
360
+ onError: (r) => g((r instanceof I, r.message))
341
361
  }
342
362
  );
343
363
  return;
344
364
  }
345
- if (i === "") {
346
- y("A secret value is required.");
365
+ if (s === "") {
366
+ g("A secret value is required.");
347
367
  return;
348
368
  }
349
- p.mutate(
350
- { name: a, value: i, description: o },
369
+ v.mutate(
370
+ { name: a, value: s, description: d },
351
371
  {
352
372
  onSuccess: () => e.onSaved(),
353
- onError: (v) => y((v instanceof I, v.message))
373
+ onError: (r) => g((r instanceof I, r.message))
354
374
  }
355
375
  );
356
376
  }
357
- const c = V(s, { enabled: S });
377
+ const u = T(i, { enabled: N });
358
378
  return /* @__PURE__ */ l(
359
379
  R,
360
380
  {
@@ -370,10 +390,10 @@ function we(e) {
370
390
  type: "text",
371
391
  value: a,
372
392
  disabled: n,
373
- onChange: (v) => h(v.target.value),
393
+ onChange: (r) => h(r.target.value),
374
394
  placeholder: "e.g. openai_api_key",
375
395
  maxLength: 64,
376
- ...c
396
+ ...u
377
397
  }
378
398
  ),
379
399
  !n && /* @__PURE__ */ t("span", { className: "hint", children: "Letters, digits, and underscores. Must start with a letter or underscore. Case-sensitive." })
@@ -385,8 +405,8 @@ function we(e) {
385
405
  {
386
406
  className: "code",
387
407
  rows: 3,
388
- value: i,
389
- onChange: (v) => f(v.target.value),
408
+ value: s,
409
+ onChange: (r) => p(r.target.value),
390
410
  placeholder: n ? "Leave blank to keep the current value" : "sk-…",
391
411
  autoComplete: "off",
392
412
  spellCheck: !1
@@ -400,10 +420,10 @@ function we(e) {
400
420
  "input",
401
421
  {
402
422
  type: "text",
403
- value: o,
404
- onChange: (v) => g(v.target.value),
423
+ value: d,
424
+ onChange: (r) => f(r.target.value),
405
425
  placeholder: "Optional",
406
- ...c
426
+ ...u
407
427
  }
408
428
  )
409
429
  ] }),
@@ -411,45 +431,45 @@ function we(e) {
411
431
  ] }),
412
432
  /* @__PURE__ */ l("div", { className: "modal-actions", children: [
413
433
  /* @__PURE__ */ t("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
414
- /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !S, onClick: s, children: C.isPending ? "Saving…" : n ? "Save changes" : "Save secret" })
434
+ /* @__PURE__ */ t("button", { type: "button", className: "btn", disabled: !N, onClick: i, children: C.isPending ? "Saving…" : n ? "Save changes" : "Save secret" })
415
435
  ] })
416
436
  ]
417
437
  }
418
438
  );
419
439
  }
420
- const ke = {
440
+ const Me = {
421
441
  costMinor: "Cost",
422
442
  tokens: "Tokens",
423
443
  requests: "Requests"
424
- }, Me = ["block", "warn"], ee = ["tenant", "account", "project", "route", "connection"], Ee = {
444
+ }, ke = ["block", "warn"], Z = ["tenant", "account", "project", "route", "connection"], we = {
425
445
  tenant: "Tenant",
426
446
  account: "Account",
427
447
  project: "Project",
428
448
  route: "Model route",
429
449
  connection: "Connection"
430
- }, je = (e) => e === "route" || e === "connection", te = ["day", "month"];
450
+ }, Ee = (e) => e === "route" || e === "connection", ee = ["day", "month"];
431
451
  function B(e) {
432
452
  return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
433
453
  }
434
- function De(e, n) {
454
+ function $e(e, n) {
435
455
  return e === "costMinor" ? (a) => `${n} ${(a / 100).toFixed(2)}` : B;
436
456
  }
437
- function xe(e) {
457
+ function je(e) {
438
458
  return e.costMinor != null ? "costMinor" : e.tokens != null ? "tokens" : e.requests != null ? "requests" : null;
439
459
  }
440
- function $e(e) {
460
+ function De(e) {
441
461
  return e.costMinor == null ? null : `${e.currency ?? "USD"} ${(e.costMinor / 100).toFixed(2)}`;
442
462
  }
443
- function Le(e) {
463
+ function xe(e) {
444
464
  const n = [];
445
465
  e.requests != null && n.push(`${B(e.requests)} requests`), e.tokens != null && n.push(`${B(e.tokens)} tokens`);
446
- const a = $e(e);
466
+ const a = De(e);
447
467
  return a != null && n.push(a), n.length === 0 ? "no limit" : n.join(" · ");
448
468
  }
449
469
  function L(e) {
450
470
  return e.scopeId == null ? `this ${e.scopeKind}` : `${e.scopeKind} ${e.scopeId}`;
451
471
  }
452
- function le(e) {
472
+ function ae(e) {
453
473
  return e instanceof I || e instanceof Error ? e.message : String(e);
454
474
  }
455
475
  function q(e) {
@@ -458,34 +478,34 @@ function q(e) {
458
478
  const a = Number(n);
459
479
  return Number.isFinite(a) ? a : null;
460
480
  }
461
- function Fe(e) {
462
- var S;
463
- const n = ae(e.projectId), [a, h] = m(null), [i, f] = m(null), [o, g] = m(null), b = be(n ?? void 0), y = pe(), p = b.data ?? [], N = n != null, C = [
481
+ function Ke(e) {
482
+ var N;
483
+ const n = ne(e.projectId), [a, h] = m(null), [s, p] = m(null), [d, f] = m(null), b = be(n ?? void 0), g = ve(), v = b.data ?? [], y = n != null, C = [
464
484
  {
465
485
  key: "scope",
466
486
  header: "Scope",
467
- render: (s) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
468
- /* @__PURE__ */ t("strong", { className: "list-name", title: L(s), children: s.scopeKind }),
487
+ render: (i) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
488
+ /* @__PURE__ */ t("strong", { className: "list-name", title: L(i), children: i.scopeKind }),
469
489
  " ",
470
- /* @__PURE__ */ t("span", { className: s.onBreach === "warn" ? "tag warn" : "tag", children: s.onBreach }),
471
- /* @__PURE__ */ t("div", { className: "muted small list-preview", title: L(s), children: s.scopeId == null ? `the whole ${s.scopeKind}` : s.scopeId })
490
+ /* @__PURE__ */ t("span", { className: i.onBreach === "warn" ? "tag warn" : "tag", children: i.onBreach }),
491
+ /* @__PURE__ */ t("div", { className: "muted small list-preview", title: L(i), children: i.scopeId == null ? `the whole ${i.scopeKind}` : i.scopeId })
472
492
  ] })
473
493
  },
474
494
  {
475
495
  key: "window",
476
496
  header: "Window",
477
- render: (s) => s.window
497
+ render: (i) => i.window
478
498
  },
479
499
  {
480
500
  key: "limits",
481
501
  header: "Limit",
482
- render: (s) => /* @__PURE__ */ t("span", { className: "muted small", children: Le(s.limits) })
502
+ render: (i) => /* @__PURE__ */ t("span", { className: "muted small", children: xe(i.limits) })
483
503
  },
484
504
  {
485
505
  key: "usage",
486
506
  header: "Used",
487
507
  // Rows only exist once the project-scoped query ran, so `project` is set here.
488
- render: (s) => n == null ? null : /* @__PURE__ */ t(Ie, { budget: s, projectId: n })
508
+ render: (i) => n == null ? null : /* @__PURE__ */ t(Le, { budget: i, projectId: n })
489
509
  },
490
510
  {
491
511
  key: "actions",
@@ -493,25 +513,29 @@ function Fe(e) {
493
513
  align: "right",
494
514
  link: !1,
495
515
  actions: !0,
496
- render: (s) => /* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)" }, children: [
497
- /* @__PURE__ */ t(
498
- T,
499
- {
500
- label: "Edit",
501
- onClick: () => h({ budget: s }),
502
- "data-testid": `model-budget-edit-${s.id}`
503
- }
504
- ),
505
- /* @__PURE__ */ t(
506
- A,
507
- {
508
- label: "Delete",
509
- onClick: () => f(s),
510
- disabled: y.isPending,
511
- "data-testid": `model-budget-delete-${s.id}`
512
- }
513
- )
514
- ] })
516
+ render: (i) => /* @__PURE__ */ t(
517
+ U,
518
+ {
519
+ label: "Budget actions",
520
+ "data-testid": `model-budget-actions-${i.id}`,
521
+ actions: [
522
+ {
523
+ label: "Edit",
524
+ icon: "edit",
525
+ onSelect: () => h({ budget: i }),
526
+ "data-testid": `model-budget-edit-${i.id}`
527
+ },
528
+ {
529
+ label: "Delete",
530
+ icon: "delete",
531
+ danger: !0,
532
+ disabled: g.isPending,
533
+ onSelect: () => p(i),
534
+ "data-testid": `model-budget-delete-${i.id}`
535
+ }
536
+ ]
537
+ }
538
+ )
515
539
  }
516
540
  ];
517
541
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
@@ -525,29 +549,29 @@ function Fe(e) {
525
549
  {
526
550
  type: "button",
527
551
  className: "btn",
528
- disabled: !N,
552
+ disabled: !y,
529
553
  onClick: () => h({}),
530
554
  "data-testid": "model-budget-add",
531
555
  children: "+ Add budget"
532
556
  }
533
557
  )
534
558
  ] }),
535
- o && /* @__PURE__ */ t("div", { className: "result error", role: "alert", "data-testid": "model-budget-delete-error", children: o }),
559
+ d && /* @__PURE__ */ t("div", { className: "result error", role: "alert", "data-testid": "model-budget-delete-error", children: d }),
536
560
  /* @__PURE__ */ l("div", { children: [
537
561
  b.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
538
- ((S = b.data) == null ? void 0 : S.length) === 0 && /* @__PURE__ */ t(P, { testId: "model-budgets-empty", children: "No model budgets yet. Add one to cap spend or request volume." }),
539
- p.length > 0 && /* @__PURE__ */ t(
540
- U,
562
+ ((N = b.data) == null ? void 0 : N.length) === 0 && /* @__PURE__ */ t(A, { testId: "model-budgets-empty", children: "No model budgets yet. Add one to cap spend or request volume." }),
563
+ v.length > 0 && /* @__PURE__ */ t(
564
+ P,
541
565
  {
542
566
  columns: C,
543
- rows: p,
544
- rowKey: (s) => s.id,
567
+ rows: v,
568
+ rowKey: (i) => i.id,
545
569
  testId: "model-budgets-table"
546
570
  }
547
571
  )
548
572
  ] }),
549
573
  a != null && n != null && /* @__PURE__ */ t(
550
- qe,
574
+ Ie,
551
575
  {
552
576
  project: n,
553
577
  initial: a.budget,
@@ -555,78 +579,78 @@ function Fe(e) {
555
579
  onSaved: () => h(null)
556
580
  }
557
581
  ),
558
- i != null && n != null && /* @__PURE__ */ t(
559
- O,
582
+ s != null && n != null && /* @__PURE__ */ t(
583
+ V,
560
584
  {
561
585
  title: "Delete model budget",
562
- message: `Delete the budget on ${L(i)}? Calls stop being capped by it immediately.`,
586
+ message: `Delete the budget on ${L(s)}? Calls stop being capped by it immediately.`,
563
587
  confirmLabel: "Delete",
564
588
  onConfirm: () => {
565
- const s = i;
566
- g(null), y.mutate(
567
- { project: n, id: s.id },
589
+ const i = s;
590
+ f(null), g.mutate(
591
+ { project: n, id: i.id },
568
592
  {
569
- onError: (c) => g(
570
- `Could not delete the budget on ${L(s)}: ${le(c)}`
593
+ onError: (u) => f(
594
+ `Could not delete the budget on ${L(i)}: ${ae(u)}`
571
595
  )
572
596
  }
573
- ), f(null);
597
+ ), p(null);
574
598
  },
575
- onClose: () => f(null)
599
+ onClose: () => p(null)
576
600
  }
577
601
  )
578
602
  ] }) });
579
603
  }
580
- function Ie(e) {
581
- const n = Ne(e.budget.id, e.projectId);
604
+ function Le(e) {
605
+ const n = ye(e.budget.id, e.projectId);
582
606
  if (n.isLoading) return /* @__PURE__ */ t("span", { className: "muted small", children: "Loading…" });
583
607
  const a = n.data;
584
608
  if (a == null) return /* @__PURE__ */ t("span", { className: "muted small", children: "—" });
585
- const h = a.limits ?? e.budget.limits, i = xe(h);
586
- return i == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "no limit" }) : /* @__PURE__ */ t(
587
- se,
609
+ const h = a.limits ?? e.budget.limits, s = je(h);
610
+ return s == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "no limit" }) : /* @__PURE__ */ t(
611
+ ie,
588
612
  {
589
- label: ke[i],
590
- used: a.used[i],
591
- limit: h[i] ?? 0,
592
- reserved: a.reserved[i],
593
- format: De(i, h.currency ?? "USD"),
613
+ label: Me[s],
614
+ used: a.used[s],
615
+ limit: h[s] ?? 0,
616
+ reserved: a.reserved[s],
617
+ format: $e(s, h.currency ?? "USD"),
594
618
  testId: `model-budget-meter-${e.budget.id}`
595
619
  }
596
620
  );
597
621
  }
598
- function qe(e) {
599
- var F, Q, _, J, H, Y, z, G;
600
- const n = !!e.initial, [a, h] = m(((F = e.initial) == null ? void 0 : F.scopeKind) ?? "project"), [i, f] = m(((Q = e.initial) == null ? void 0 : Q.scopeId) ?? ""), [o, g] = m(((_ = e.initial) == null ? void 0 : _.window) ?? "day"), [b, y] = m(
601
- ((J = e.initial) == null ? void 0 : J.limits.requests) != null ? String(e.initial.limits.requests) : ""
602
- ), [p, N] = m(
603
- ((H = e.initial) == null ? void 0 : H.limits.tokens) != null ? String(e.initial.limits.tokens) : ""
604
- ), [C, S] = m(
605
- ((Y = e.initial) == null ? void 0 : Y.limits.costMinor) != null ? String(e.initial.limits.costMinor / 100) : ""
606
- ), [s, c] = m(((z = e.initial) == null ? void 0 : z.limits.currency) ?? ""), [w, u] = m(((G = e.initial) == null ? void 0 : G.onBreach) ?? "warn"), [k, v] = m(null), E = fe(), d = ye(), j = E.isPending || d.isPending, M = je(a), K = !!a && !!o && (!M || n || i.trim() !== "") && !j;
607
- function ie() {
608
- const r = {}, x = q(b);
609
- x != null && (r.requests = x);
610
- const $ = q(p);
611
- $ != null && (r.tokens = $);
612
- const X = q(C);
613
- return X != null && (r.costMinor = Math.round(X * 100)), r.costMinor != null && s.trim() !== "" && (r.currency = s.trim()), Object.keys(r).length === 0 ? null : r;
622
+ function Ie(e) {
623
+ var K, W, Q, _, J, H, Y, z;
624
+ const n = !!e.initial, [a, h] = m(((K = e.initial) == null ? void 0 : K.scopeKind) ?? "project"), [s, p] = m(((W = e.initial) == null ? void 0 : W.scopeId) ?? ""), [d, f] = m(((Q = e.initial) == null ? void 0 : Q.window) ?? "day"), [b, g] = m(
625
+ ((_ = e.initial) == null ? void 0 : _.limits.requests) != null ? String(e.initial.limits.requests) : ""
626
+ ), [v, y] = m(
627
+ ((J = e.initial) == null ? void 0 : J.limits.tokens) != null ? String(e.initial.limits.tokens) : ""
628
+ ), [C, N] = m(
629
+ ((H = e.initial) == null ? void 0 : H.limits.costMinor) != null ? String(e.initial.limits.costMinor / 100) : ""
630
+ ), [i, u] = m(((Y = e.initial) == null ? void 0 : Y.limits.currency) ?? ""), [S, M] = m(((z = e.initial) == null ? void 0 : z.onBreach) ?? "warn"), [k, r] = m(null), E = pe(), c = fe(), $ = E.isPending || c.isPending, w = Ee(a), O = !!a && !!d && (!w || n || s.trim() !== "") && !$;
631
+ function le() {
632
+ const o = {}, D = q(b);
633
+ D != null && (o.requests = D);
634
+ const x = q(v);
635
+ x != null && (o.tokens = x);
636
+ const G = q(C);
637
+ return G != null && (o.costMinor = Math.round(G * 100)), o.costMinor != null && i.trim() !== "" && (o.currency = i.trim()), Object.keys(o).length === 0 ? null : o;
614
638
  }
615
- function W() {
616
- const r = ie();
617
- if (r == null) {
618
- v("Set at least one limit: requests, tokens or cost.");
639
+ function F() {
640
+ const o = le();
641
+ if (o == null) {
642
+ r("Set at least one limit: requests, tokens or cost.");
619
643
  return;
620
644
  }
621
- v(null);
622
- const x = {
645
+ r(null);
646
+ const D = {
623
647
  onSuccess: () => e.onSaved(),
624
- onError: ($) => v(le($))
648
+ onError: (x) => r(ae(x))
625
649
  };
626
650
  if (e.initial) {
627
- d.mutate(
628
- { project: e.project, id: e.initial.id, patch: { window: o, limits: r, onBreach: w } },
629
- x
651
+ c.mutate(
652
+ { project: e.project, id: e.initial.id, patch: { window: d, limits: o, onBreach: S } },
653
+ D
630
654
  );
631
655
  return;
632
656
  }
@@ -636,16 +660,16 @@ function qe(e) {
636
660
  input: {
637
661
  scopeKind: a,
638
662
  // Only route/connection budgets carry a scope id; the server refuses one elsewhere.
639
- ...M ? { scopeId: i.trim() } : {},
640
- window: o,
641
- limits: r,
642
- onBreach: w
663
+ ...w ? { scopeId: s.trim() } : {},
664
+ window: d,
665
+ limits: o,
666
+ onBreach: S
643
667
  }
644
668
  },
645
- x
669
+ D
646
670
  );
647
671
  }
648
- const D = V(W, { enabled: K });
672
+ const j = T(F, { enabled: O });
649
673
  return /* @__PURE__ */ l(R, { title: e.initial ? "Edit model budget" : "Add model budget", onClose: e.onClose, children: [
650
674
  /* @__PURE__ */ l("div", { className: "modal-body", children: [
651
675
  /* @__PURE__ */ l("label", { className: "field", children: [
@@ -655,17 +679,17 @@ function qe(e) {
655
679
  {
656
680
  value: a,
657
681
  disabled: n,
658
- onChange: (r) => h(r.target.value),
682
+ onChange: (o) => h(o.target.value),
659
683
  "data-testid": "model-budget-scope-kind",
660
684
  children: [
661
- !ee.includes(a) && /* @__PURE__ */ t("option", { value: a, children: a }),
662
- ee.map((r) => /* @__PURE__ */ t("option", { value: r, children: Ee[r] }, r))
685
+ !Z.includes(a) && /* @__PURE__ */ t("option", { value: a, children: a }),
686
+ Z.map((o) => /* @__PURE__ */ t("option", { value: o, children: we[o] }, o))
663
687
  ]
664
688
  }
665
689
  ),
666
690
  !n && /* @__PURE__ */ t("span", { className: "hint", children: "What the budget caps — this tenant, account or project as a whole, or one model route or connection. Fixed once created." })
667
691
  ] }),
668
- M && /* @__PURE__ */ l("label", { className: "field", children: [
692
+ w && /* @__PURE__ */ l("label", { className: "field", children: [
669
693
  /* @__PURE__ */ l("span", { children: [
670
694
  a === "route" ? "Route" : "Connection id",
671
695
  " *"
@@ -674,12 +698,12 @@ function qe(e) {
674
698
  "input",
675
699
  {
676
700
  type: "text",
677
- value: i,
701
+ value: s,
678
702
  disabled: n,
679
- onChange: (r) => f(r.target.value),
703
+ onChange: (o) => p(o.target.value),
680
704
  placeholder: a === "route" ? "e.g. fast" : "e.g. conn_…",
681
705
  "data-testid": "model-budget-scope-id",
682
- ...D
706
+ ...j
683
707
  }
684
708
  ),
685
709
  !n && /* @__PURE__ */ t("span", { className: "hint", children: a === "route" ? "The route's name or id. Required for a route budget." : "The model-provider connection's id. Required for a connection budget." })
@@ -689,12 +713,12 @@ function qe(e) {
689
713
  /* @__PURE__ */ l(
690
714
  "select",
691
715
  {
692
- value: o,
693
- onChange: (r) => g(r.target.value),
716
+ value: d,
717
+ onChange: (o) => f(o.target.value),
694
718
  "data-testid": "model-budget-window",
695
719
  children: [
696
- !te.includes(o) && /* @__PURE__ */ t("option", { value: o, children: o }),
697
- te.map((r) => /* @__PURE__ */ t("option", { value: r, children: r }, r))
720
+ !ee.includes(d) && /* @__PURE__ */ t("option", { value: d, children: d }),
721
+ ee.map((o) => /* @__PURE__ */ t("option", { value: o, children: o }, o))
698
722
  ]
699
723
  }
700
724
  ),
@@ -708,10 +732,10 @@ function qe(e) {
708
732
  type: "number",
709
733
  min: 0,
710
734
  value: b,
711
- onChange: (r) => y(r.target.value),
735
+ onChange: (o) => g(o.target.value),
712
736
  placeholder: "Unlimited",
713
737
  "data-testid": "model-budget-requests",
714
- ...D
738
+ ...j
715
739
  }
716
740
  )
717
741
  ] }),
@@ -722,11 +746,11 @@ function qe(e) {
722
746
  {
723
747
  type: "number",
724
748
  min: 0,
725
- value: p,
726
- onChange: (r) => N(r.target.value),
749
+ value: v,
750
+ onChange: (o) => y(o.target.value),
727
751
  placeholder: "Unlimited",
728
752
  "data-testid": "model-budget-tokens",
729
- ...D
753
+ ...j
730
754
  }
731
755
  )
732
756
  ] }),
@@ -739,10 +763,10 @@ function qe(e) {
739
763
  min: 0,
740
764
  step: "0.01",
741
765
  value: C,
742
- onChange: (r) => S(r.target.value),
766
+ onChange: (o) => N(o.target.value),
743
767
  placeholder: "Unlimited",
744
768
  "data-testid": "model-budget-cost",
745
- ...D
769
+ ...j
746
770
  }
747
771
  ),
748
772
  /* @__PURE__ */ t("span", { className: "hint", children: "In major units of the currency below (12.50 = 12.50 USD)." })
@@ -753,12 +777,12 @@ function qe(e) {
753
777
  "input",
754
778
  {
755
779
  type: "text",
756
- value: s,
757
- onChange: (r) => c(r.target.value),
780
+ value: i,
781
+ onChange: (o) => u(o.target.value),
758
782
  placeholder: "USD",
759
783
  maxLength: 8,
760
784
  "data-testid": "model-budget-currency",
761
- ...D
785
+ ...j
762
786
  }
763
787
  )
764
788
  ] }),
@@ -767,10 +791,10 @@ function qe(e) {
767
791
  /* @__PURE__ */ t(
768
792
  "select",
769
793
  {
770
- value: w,
771
- onChange: (r) => u(r.target.value),
794
+ value: S,
795
+ onChange: (o) => M(o.target.value),
772
796
  "data-testid": "model-budget-on-breach",
773
- children: Me.map((r) => /* @__PURE__ */ t("option", { value: r, children: r }, r))
797
+ children: ke.map((o) => /* @__PURE__ */ t("option", { value: o, children: o }, o))
774
798
  }
775
799
  ),
776
800
  /* @__PURE__ */ t("span", { className: "hint", children: "`block` refuses calls past the limit; `warn` lets them through and flags them." })
@@ -784,21 +808,21 @@ function qe(e) {
784
808
  {
785
809
  type: "button",
786
810
  className: "btn",
787
- disabled: !K,
788
- onClick: W,
811
+ disabled: !O,
812
+ onClick: F,
789
813
  "data-testid": "model-budget-save",
790
- children: j ? "Saving…" : n ? "Save changes" : "Save budget"
814
+ children: $ ? "Saving…" : n ? "Save changes" : "Save budget"
791
815
  }
792
816
  )
793
817
  ] })
794
818
  ] });
795
819
  }
796
820
  export {
797
- Je as CreateEndpointModal,
798
- He as CreateFunctionModal,
799
- Fe as ModelBudgetsManager,
800
- ze as ModelRoutesManager,
801
- We as SecretsManager,
802
- Ke as VarsManager
821
+ _e as CreateEndpointModal,
822
+ Je as CreateFunctionModal,
823
+ Ke as ModelBudgetsManager,
824
+ Ye as ModelRoutesManager,
825
+ Fe as SecretsManager,
826
+ Oe as VarsManager
803
827
  };
804
828
  //# sourceMappingURL=forms.mjs.map