@camstack/addon-training 0.1.20 → 0.1.21

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/_stub.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./virtualExposes-0m8NqEDE.mjs";
2
- import { a as e, i as t, o as n, r } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-CacDWi0w.mjs";
2
+ import { a as e, i as t, o as n, r } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-C-uqIKLg.mjs";
3
3
  import { S as i, _ as a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, p as g, r as _, t as v, u as y, v as b, x, y as S } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs";
4
4
  import { _ as C, a as w, b as T, c as E, d as D, f as O, g as k, h as A, i as j, l as M, m as N, n as P, o as F, p as I, r as ee, s as te, t as ne, u as re, v as ie, y as L } from "./responsive-emJo3EdF.mjs";
5
5
  import { c as ae, d as oe, l as se, s as ce, u as le } from "./scene-monitor-copy-CcQxbRXa.mjs";
@@ -28158,29 +28158,47 @@ function NA({ open: e, onClose: t, title: n, icon: r, error: i, width: a = "lg",
28158
28158
  //#endregion
28159
28159
  //#region ../ui-library/src/hooks/use-url-query.ts
28160
28160
  i();
28161
- function PA(e) {
28161
+ var PA = "camstack:url-query";
28162
+ function FA(e) {
28162
28163
  return new URLSearchParams(window.location.search).get(e);
28163
28164
  }
28164
- function FA(e, t) {
28165
+ function IA() {
28166
+ window.dispatchEvent(new Event(PA));
28167
+ }
28168
+ function LA(e, t) {
28165
28169
  let n = new URLSearchParams(window.location.search);
28166
28170
  t === null || t === "" ? n.delete(e) : n.set(e, t);
28167
28171
  let r = n.toString(), i = r ? `${window.location.pathname}?${r}` : window.location.pathname;
28168
28172
  window.history.replaceState(null, "", i);
28169
28173
  }
28170
- function IA(e) {
28171
- let [t, n] = a(() => PA(e));
28174
+ var RA = !1;
28175
+ function zA() {
28176
+ if (RA || typeof window > "u") return;
28177
+ RA = !0;
28178
+ let e = window.history.replaceState.bind(window.history), t = window.history.pushState.bind(window.history);
28179
+ window.history.replaceState = (...t) => {
28180
+ e(...t), IA();
28181
+ }, window.history.pushState = (...e) => {
28182
+ t(...e), IA();
28183
+ };
28184
+ }
28185
+ function BA(e) {
28186
+ zA();
28187
+ let [t, n] = a(() => FA(e));
28172
28188
  return y(() => {
28173
- let t = () => n(PA(e));
28174
- return window.addEventListener("popstate", t), () => window.removeEventListener("popstate", t);
28189
+ let t = () => n(FA(e));
28190
+ return window.addEventListener("popstate", t), window.addEventListener(PA, t), () => {
28191
+ window.removeEventListener("popstate", t), window.removeEventListener(PA, t);
28192
+ };
28175
28193
  }, [e]), [t, s((t) => {
28176
- FA(e, t), n(t);
28194
+ LA(e, t), n(t);
28177
28195
  }, [e])];
28178
28196
  }
28179
28197
  //#endregion
28180
28198
  //#region ../ui-library/src/composites/use-item-form-url.ts
28181
28199
  i();
28182
- function LA(e = {}) {
28183
- let t = e.newKey ?? "new", n = e.editKey ?? "edit", [r, i] = IA(t), [a, o] = IA(n);
28200
+ function VA(e = {}) {
28201
+ let t = e.newKey ?? "new", n = e.editKey ?? "edit", [r, i] = BA(t), [a, o] = BA(n);
28184
28202
  return {
28185
28203
  state: m(() => a !== null && a !== "" ? {
28186
28204
  mode: "edit",
@@ -28202,7 +28220,7 @@ function LA(e = {}) {
28202
28220
  i(), i(), J(P, "min-w-0 max-w-full gap-1.5 py-1 pl-1 pr-2.5 text-xs font-normal", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"), J(ne, "font-medium"), i(), i(), i();
28203
28221
  //#endregion
28204
28222
  //#region ../ui-library/src/composites/stat-card.tsx
28205
- function RA({ value: e, label: t, icon: n, subtext: r, valueClassName: i, trend: a, className: o }) {
28223
+ function HA({ value: e, label: t, icon: n, subtext: r, valueClassName: i, trend: a, className: o }) {
28206
28224
  return /* @__PURE__ */ H("div", {
28207
28225
  className: J("rounded-lg border border-border bg-surface p-2 sm:p-2.5 min-w-0", o),
28208
28226
  children: [
@@ -28240,7 +28258,7 @@ function RA({ value: e, label: t, icon: n, subtext: r, valueClassName: i, trend:
28240
28258
  //#endregion
28241
28259
  //#region ../ui-library/src/composites/step-inspector/step-inspector-panel.tsx
28242
28260
  i(), i();
28243
- function zA({ dirtyCount: e, saving: t, status: n, error: r, onSave: i, onDiscard: a, scope: o }) {
28261
+ function UA({ dirtyCount: e, saving: t, status: n, error: r, onSave: i, onDiscard: a, scope: o }) {
28244
28262
  let s = e > 0, c = t ? "Saving…" : s ? `${e} unsaved change${e === 1 ? "" : "s"}` : n === "saved" ? "Saved" : n === "error" ? r ?? "Save failed" : "No unsaved changes";
28245
28263
  return /* @__PURE__ */ H("footer", {
28246
28264
  className: "shrink-0 space-y-2 border-t border-border bg-surface px-4 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] md:pb-2",
@@ -28313,16 +28331,16 @@ _(function({ title: e, subtitle: t, headerActions: n, headerExtra: r, leading: i
28313
28331
  className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-3",
28314
28332
  children: s
28315
28333
  }),
28316
- a !== void 0 && /* @__PURE__ */ V(zA, { ...a })
28334
+ a !== void 0 && /* @__PURE__ */ V(UA, { ...a })
28317
28335
  ]
28318
28336
  });
28319
28337
  }), i(), i(), i();
28320
28338
  //#endregion
28321
28339
  //#region ../ui-library/src/composites/device-picker/device-picker-model.ts
28322
- function BA(e, t) {
28340
+ function WA(e, t) {
28323
28341
  return typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
28324
28342
  }
28325
- function VA(e) {
28343
+ function GA(e) {
28326
28344
  return `${[
28327
28345
  e.name,
28328
28346
  e.location ?? "",
@@ -28330,29 +28348,29 @@ function VA(e) {
28330
28348
  e.detail ?? ""
28331
28349
  ].join(" ")} ${String(e.id)}`.toLowerCase();
28332
28350
  }
28333
- function HA(e) {
28351
+ function KA(e) {
28334
28352
  return e.trim().toLowerCase().split(/\s+/).filter((e) => e.length > 0);
28335
28353
  }
28336
- function UA(e, t) {
28337
- let n = HA(t);
28354
+ function qA(e, t) {
28355
+ let n = KA(t);
28338
28356
  return n.length === 0 ? e : e.filter((e) => {
28339
- let t = VA(e);
28357
+ let t = GA(e);
28340
28358
  return n.every((e) => t.includes(e));
28341
28359
  });
28342
28360
  }
28343
- function WA(e, t) {
28361
+ function JA(e, t) {
28344
28362
  return e === t ? 0 : e === null ? 1 : t === null ? -1 : e.localeCompare(t);
28345
28363
  }
28346
- function GA(e) {
28364
+ function YA(e) {
28347
28365
  return e == null || e.trim() === "" ? null : e;
28348
28366
  }
28349
- function KA(e, t) {
28367
+ function XA(e, t) {
28350
28368
  return `${e ?? ""}|${t ?? ""}`;
28351
28369
  }
28352
- function qA(e, t) {
28370
+ function ZA(e, t) {
28353
28371
  let n = new Set(t), r = /* @__PURE__ */ new Map();
28354
28372
  for (let t of e) {
28355
- let e = GA(t.type), n = GA(t.location), i = KA(e, n), a = r.get(i);
28373
+ let e = YA(t.type), n = YA(t.location), i = XA(e, n), a = r.get(i);
28356
28374
  a === void 0 ? r.set(i, {
28357
28375
  type: e,
28358
28376
  location: n,
@@ -28361,7 +28379,7 @@ function qA(e, t) {
28361
28379
  }
28362
28380
  let i = [];
28363
28381
  for (let [e, t] of r) {
28364
- let r = [...t.devices].sort((e, t) => e.name.localeCompare(t.name) || BA(e.id, t.id));
28382
+ let r = [...t.devices].sort((e, t) => e.name.localeCompare(t.name) || WA(e.id, t.id));
28365
28383
  i.push({
28366
28384
  key: e,
28367
28385
  type: t.type,
@@ -28370,16 +28388,16 @@ function qA(e, t) {
28370
28388
  selectedCount: r.filter((e) => n.has(e.id)).length
28371
28389
  });
28372
28390
  }
28373
- return i.sort((e, t) => WA(e.type, t.type) || WA(e.location, t.location));
28391
+ return i.sort((e, t) => JA(e.type, t.type) || JA(e.location, t.location));
28374
28392
  }
28375
- function JA(e, t, n) {
28393
+ function QA(e, t, n) {
28376
28394
  let r = t.get(e.key);
28377
28395
  return r === void 0 ? n || e.selectedCount > 0 ? !0 : e.devices.length <= 8 : r;
28378
28396
  }
28379
- function YA(e, t, n, r) {
28397
+ function $A(e, t, n, r) {
28380
28398
  let i = new Set(t), a = [];
28381
28399
  for (let t of e) {
28382
- let e = JA(t, n, r);
28400
+ let e = QA(t, n, r);
28383
28401
  if (a.push({
28384
28402
  kind: "header",
28385
28403
  key: `h:${t.key}`,
@@ -28395,19 +28413,19 @@ function YA(e, t, n, r) {
28395
28413
  }
28396
28414
  return a;
28397
28415
  }
28398
- function XA(e, t) {
28416
+ function ej(e, t) {
28399
28417
  return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
28400
28418
  }
28401
- function ZA(e, t) {
28419
+ function tj(e, t) {
28402
28420
  let n = [...e], r = new Set(e);
28403
28421
  for (let e of t.devices) r.has(e.id) || n.push(e.id);
28404
28422
  return n;
28405
28423
  }
28406
- function QA(e, t) {
28424
+ function nj(e, t) {
28407
28425
  let n = new Set(t.devices.map((e) => e.id));
28408
28426
  return e.filter((e) => !n.has(e));
28409
28427
  }
28410
- function $A(e, t) {
28428
+ function rj(e, t) {
28411
28429
  return t || e.length <= 6 ? {
28412
28430
  shown: e,
28413
28431
  hidden: 0
@@ -28416,51 +28434,51 @@ function $A(e, t) {
28416
28434
  hidden: e.length - 6
28417
28435
  };
28418
28436
  }
28419
- function ej(e, t) {
28437
+ function ij(e, t) {
28420
28438
  let n = Math.max(0, Math.min(e.length, t));
28421
28439
  return {
28422
28440
  rows: e.slice(0, n),
28423
28441
  remaining: e.length - n
28424
28442
  };
28425
28443
  }
28426
- var tj = [
28444
+ var aj = [
28427
28445
  "zone",
28428
28446
  "location",
28429
28447
  "none"
28430
- ], nj = "zone";
28431
- function rj(e) {
28432
- return e === "zone" || e === "location" || e === "none" ? e : nj;
28448
+ ], oj = "zone";
28449
+ function sj(e) {
28450
+ return e === "zone" || e === "location" || e === "none" ? e : oj;
28433
28451
  }
28434
- function ij(e) {
28452
+ function cj(e) {
28435
28453
  return e.trim().toLowerCase();
28436
28454
  }
28437
- var aj = 1, oj = 2;
28438
- function sj(e, t) {
28439
- return e.name.localeCompare(t.name) || BA(e.id, t.id);
28455
+ var lj = 1, uj = 2;
28456
+ function dj(e, t) {
28457
+ return e.name.localeCompare(t.name) || WA(e.id, t.id);
28440
28458
  }
28441
- function cj(e) {
28459
+ function fj(e) {
28442
28460
  return e.kind === "zone" || e.kind === "location" ? e.label : "";
28443
28461
  }
28444
- var lj = {
28462
+ var pj = {
28445
28463
  key: "-location",
28446
28464
  heading: { kind: "no-location" },
28447
- rank: oj
28448
- }, uj = {
28465
+ rank: uj
28466
+ }, mj = {
28449
28467
  key: "-zone",
28450
28468
  heading: { kind: "no-zone" },
28451
- rank: aj
28469
+ rank: lj
28452
28470
  };
28453
- function dj(e) {
28471
+ function hj(e) {
28454
28472
  let t = /* @__PURE__ */ new Map();
28455
28473
  for (let n of e) for (let e of n.locationKeys) {
28456
- let r = ij(e);
28474
+ let r = cj(e);
28457
28475
  t.has(r) || t.set(r, n);
28458
28476
  }
28459
28477
  return t;
28460
28478
  }
28461
- function fj(e) {
28462
- return e === null ? lj : {
28463
- key: `l:${ij(e)}`,
28479
+ function gj(e) {
28480
+ return e === null ? pj : {
28481
+ key: `l:${cj(e)}`,
28464
28482
  heading: {
28465
28483
  kind: "location",
28466
28484
  label: e.trim()
@@ -28468,10 +28486,10 @@ function fj(e) {
28468
28486
  rank: 0
28469
28487
  };
28470
28488
  }
28471
- function pj(e, t) {
28472
- if (e === null) return lj;
28473
- let n = t.get(ij(e));
28474
- return n === void 0 ? uj : {
28489
+ function _j(e, t) {
28490
+ if (e === null) return pj;
28491
+ let n = t.get(cj(e));
28492
+ return n === void 0 ? mj : {
28475
28493
  key: `z:${n.zoneKey}`,
28476
28494
  heading: {
28477
28495
  kind: "zone",
@@ -28480,8 +28498,8 @@ function pj(e, t) {
28480
28498
  rank: 0
28481
28499
  };
28482
28500
  }
28483
- function mj(e, t, n, r) {
28484
- let i = new Set(t), a = [...e].sort(sj), o = (e) => e.filter((e) => i.has(e.id)).length;
28501
+ function vj(e, t, n, r) {
28502
+ let i = new Set(t), a = [...e].sort(dj), o = (e) => e.filter((e) => i.has(e.id)).length;
28485
28503
  if (n === "none") return {
28486
28504
  groupBy: n,
28487
28505
  fallback: null,
@@ -28494,9 +28512,9 @@ function mj(e, t, n, r) {
28494
28512
  selectedCount: o(a)
28495
28513
  }]
28496
28514
  };
28497
- let s = n === "zone" && r.state !== "answered" ? r.state : null, c = s === null ? n : "location", l = r.state === "answered" ? dj(r.zones) : /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
28515
+ let s = n === "zone" && r.state !== "answered" ? r.state : null, c = s === null ? n : "location", l = r.state === "answered" ? hj(r.zones) : /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
28498
28516
  for (let e of a) {
28499
- let t = GA(e.location), n = c === "zone" ? pj(t, l) : fj(t), r = u.get(n.key);
28517
+ let t = YA(e.location), n = c === "zone" ? _j(t, l) : gj(t), r = u.get(n.key);
28500
28518
  r === void 0 ? u.set(n.key, {
28501
28519
  heading: n.heading,
28502
28520
  rank: n.rank,
@@ -28507,7 +28525,7 @@ function mj(e, t, n, r) {
28507
28525
  groupBy: c,
28508
28526
  fallback: s,
28509
28527
  flat: !1,
28510
- groups: [...u].sort(([, e], [, t]) => e.rank - t.rank || cj(e.heading).localeCompare(cj(t.heading))).map(([e, t]) => ({
28528
+ groups: [...u].sort(([, e], [, t]) => e.rank - t.rank || fj(e.heading).localeCompare(fj(t.heading))).map(([e, t]) => ({
28511
28529
  key: e,
28512
28530
  type: null,
28513
28531
  location: t.heading.kind === "location" ? t.heading.label : null,
@@ -28517,8 +28535,8 @@ function mj(e, t, n, r) {
28517
28535
  }))
28518
28536
  };
28519
28537
  }
28520
- function hj(e, t, n, r) {
28521
- if (!e.flat) return YA(e.groups, t, n, r);
28538
+ function yj(e, t, n, r) {
28539
+ if (!e.flat) return $A(e.groups, t, n, r);
28522
28540
  let i = new Set(t), a = [];
28523
28541
  for (let t of e.groups) for (let e of t.devices) a.push({
28524
28542
  kind: "device",
@@ -28529,53 +28547,53 @@ function hj(e, t, n, r) {
28529
28547
  });
28530
28548
  return a;
28531
28549
  }
28532
- function gj(e, t) {
28550
+ function bj(e, t) {
28533
28551
  return {
28534
- location: t === "location" ? null : GA(e.location),
28535
- type: GA(e.type)
28552
+ location: t === "location" ? null : YA(e.location),
28553
+ type: YA(e.type)
28536
28554
  };
28537
28555
  }
28538
- var _j = "(none)", vj = {
28556
+ var xj = "(none)", Sj = {
28539
28557
  query: "",
28540
28558
  types: [],
28541
28559
  zones: [],
28542
28560
  locations: []
28543
- }, yj = {
28544
- key: _j,
28561
+ }, Cj = {
28562
+ key: xj,
28545
28563
  label: null
28546
28564
  };
28547
- function bj(e, t, n) {
28565
+ function wj(e, t, n) {
28548
28566
  if (t === "type") {
28549
- let t = GA(e.type);
28550
- return t === null ? yj : {
28567
+ let t = YA(e.type);
28568
+ return t === null ? Cj : {
28551
28569
  key: t,
28552
28570
  label: t
28553
28571
  };
28554
28572
  }
28555
- let r = GA(e.location);
28556
- if (r === null) return yj;
28573
+ let r = YA(e.location);
28574
+ if (r === null) return Cj;
28557
28575
  if (t === "location") return {
28558
- key: ij(r),
28576
+ key: cj(r),
28559
28577
  label: r.trim()
28560
28578
  };
28561
- if (n.state !== "answered") return yj;
28562
- let i = dj(n.zones).get(ij(r));
28563
- return i === void 0 ? yj : {
28579
+ if (n.state !== "answered") return Cj;
28580
+ let i = hj(n.zones).get(cj(r));
28581
+ return i === void 0 ? Cj : {
28564
28582
  key: i.zoneKey,
28565
28583
  label: i.label
28566
28584
  };
28567
28585
  }
28568
- function xj(e, t, n) {
28569
- return bj(e, t, n).key;
28586
+ function Tj(e, t, n) {
28587
+ return wj(e, t, n).key;
28570
28588
  }
28571
- function Sj(e, t) {
28589
+ function Ej(e, t) {
28572
28590
  return e.key === "(none)" || t.key === "(none)" ? e.key === t.key ? 0 : e.key === "(none)" ? 1 : -1 : (e.label ?? "").localeCompare(t.label ?? "");
28573
28591
  }
28574
- function Cj(e, t, n, r) {
28592
+ function Dj(e, t, n, r) {
28575
28593
  if (t === "zone" && r.state !== "answered") return [];
28576
28594
  let i = /* @__PURE__ */ new Map();
28577
28595
  for (let n of e) {
28578
- let e = bj(n, t, r), a = i.get(e.key);
28596
+ let e = wj(n, t, r), a = i.get(e.key);
28579
28597
  a === void 0 ? i.set(e.key, {
28580
28598
  label: e.label,
28581
28599
  count: 1
@@ -28591,59 +28609,59 @@ function Cj(e, t, n, r) {
28591
28609
  label: t.label,
28592
28610
  count: t.count
28593
28611
  });
28594
- return a.sort(Sj);
28612
+ return a.sort(Ej);
28595
28613
  }
28596
- function wj(e, t) {
28614
+ function Oj(e, t) {
28597
28615
  return e.zones.length > 0 && t.state !== "answered";
28598
28616
  }
28599
- function Tj(e, t, n, r) {
28600
- return n.length === 0 ? e : e.filter((e) => n.includes(xj(e, t, r)));
28617
+ function kj(e, t, n, r) {
28618
+ return n.length === 0 ? e : e.filter((e) => n.includes(Tj(e, t, r)));
28601
28619
  }
28602
- function Ej(e, t, n) {
28603
- let r = Tj(UA(e, t.query), "type", t.types, n);
28604
- return Tj(n.state === "answered" ? Tj(r, "zone", t.zones, n) : r, "location", t.locations, n);
28620
+ function Aj(e, t, n) {
28621
+ let r = kj(qA(e, t.query), "type", t.types, n);
28622
+ return kj(n.state === "answered" ? kj(r, "zone", t.zones, n) : r, "location", t.locations, n);
28605
28623
  }
28606
- function Dj(e, t) {
28624
+ function jj(e, t) {
28607
28625
  return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
28608
28626
  }
28609
- function Oj(e) {
28627
+ function Mj(e) {
28610
28628
  return e.query.trim() !== "" || e.types.length > 0 || e.zones.length > 0 || e.locations.length > 0;
28611
28629
  }
28612
- function kj() {
28613
- return vj;
28630
+ function Nj() {
28631
+ return Sj;
28614
28632
  }
28615
- function Aj(e, t, n) {
28633
+ function Pj(e, t, n) {
28616
28634
  let r = new Set(t.map((e) => e.id)), i = new Set(n.map((e) => e.id));
28617
28635
  return e.filter((e) => r.has(e) && !i.has(e)).length;
28618
28636
  }
28619
- function jj(e, t) {
28637
+ function Fj(e, t) {
28620
28638
  return e.length >= 2 || t.length > 0;
28621
28639
  }
28622
28640
  //#endregion
28623
28641
  //#region ../ui-library/src/composites/device-picker/device-filter-bar.tsx
28624
28642
  i();
28625
- function Mj(e) {
28643
+ function Ij(e) {
28626
28644
  if (e === null) return "No type";
28627
28645
  let t = e.replaceAll("-", " ");
28628
28646
  return t.charAt(0).toUpperCase() + t.slice(1);
28629
28647
  }
28630
- var Nj = {
28648
+ var Lj = {
28631
28649
  zone: "Zone",
28632
28650
  location: "Location",
28633
28651
  none: "None"
28634
- }, Pj = {
28652
+ }, Rj = {
28635
28653
  type: "Type",
28636
28654
  zone: "Zone",
28637
28655
  location: "Location"
28638
- }, Fj = {
28656
+ }, zj = {
28639
28657
  type: "No type",
28640
28658
  zone: "No zone",
28641
28659
  location: "No location"
28642
28660
  };
28643
- function Ij(e, t) {
28644
- return t.key === "(none)" || t.label === null ? Fj[e] : e === "type" ? Mj(t.label) : t.label;
28661
+ function Bj(e, t) {
28662
+ return t.key === "(none)" || t.label === null ? zj[e] : e === "type" ? Ij(t.label) : t.label;
28645
28663
  }
28646
- function Lj({ grouping: e }) {
28664
+ function Vj({ grouping: e }) {
28647
28665
  return /* @__PURE__ */ H("div", {
28648
28666
  className: "mb-1.5",
28649
28667
  children: [/* @__PURE__ */ H("div", {
@@ -28653,7 +28671,7 @@ function Lj({ grouping: e }) {
28653
28671
  children: [/* @__PURE__ */ V("span", {
28654
28672
  className: "mr-1 font-semibold uppercase tracking-wide",
28655
28673
  children: "Group by"
28656
- }), tj.map((t) => {
28674
+ }), aj.map((t) => {
28657
28675
  let n = t === e.groupBy;
28658
28676
  return /* @__PURE__ */ V("button", {
28659
28677
  type: "button",
@@ -28661,7 +28679,7 @@ function Lj({ grouping: e }) {
28661
28679
  "aria-checked": n,
28662
28680
  onClick: () => e.onGroupByChange(t),
28663
28681
  className: n ? "rounded-md border border-primary bg-primary/10 px-1.5 py-0.5 text-[11px] text-primary" : "rounded-md border border-border px-1.5 py-0.5 text-[11px] text-foreground-subtle hover:bg-surface-hover",
28664
- children: Nj[t]
28682
+ children: Lj[t]
28665
28683
  }, t);
28666
28684
  })]
28667
28685
  }), e.fallback !== null && /* @__PURE__ */ V("p", {
@@ -28671,8 +28689,8 @@ function Lj({ grouping: e }) {
28671
28689
  })]
28672
28690
  });
28673
28691
  }
28674
- function Rj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disabled: a }) {
28675
- let o = Pj[e], s = i === void 0 ? n.length === 0 ? "All" : `${String(n.length)} selected` : i;
28692
+ function Hj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disabled: a }) {
28693
+ let o = Rj[e], s = i === void 0 ? n.length === 0 ? "All" : `${String(n.length)} selected` : i;
28676
28694
  return /* @__PURE__ */ V("div", {
28677
28695
  "data-testid": `picker-filter-${e}`,
28678
28696
  children: /* @__PURE__ */ H(gg, { children: [/* @__PURE__ */ H(_g, {
@@ -28686,13 +28704,13 @@ function Rj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disa
28686
28704
  }), /* @__PURE__ */ V(vg, {
28687
28705
  className: "min-w-[200px] max-h-[40vh] overflow-y-auto p-1",
28688
28706
  children: t.map((t) => {
28689
- let i = Ij(e, t);
28707
+ let i = Bj(e, t);
28690
28708
  return /* @__PURE__ */ H("label", {
28691
28709
  className: "flex cursor-pointer items-center gap-2 px-2 py-1 text-xs text-foreground hover:bg-surface-hover",
28692
28710
  children: [
28693
28711
  /* @__PURE__ */ V(ag, {
28694
28712
  checked: n.includes(t.key),
28695
- onChange: () => r(Dj(n, t.key)),
28713
+ onChange: () => r(jj(n, t.key)),
28696
28714
  "aria-label": i
28697
28715
  }),
28698
28716
  /* @__PURE__ */ V("span", {
@@ -28713,11 +28731,11 @@ function Rj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disa
28713
28731
  })] })
28714
28732
  });
28715
28733
  }
28716
- function zj(e) {
28734
+ function Uj(e) {
28717
28735
  if (e.state === "pending") return "loading zones…";
28718
28736
  if (e.state === "failed") return "zones unavailable";
28719
28737
  }
28720
- function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, locationOptions: i, zones: o, grouping: s, searchPlaceholder: c, searchLabel: l, disabled: d = !1 }) {
28738
+ function Wj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, locationOptions: i, zones: o, grouping: s, searchPlaceholder: c, searchLabel: l, disabled: d = !1 }) {
28721
28739
  let [f, p] = a(e.query), m = u({
28722
28740
  filters: e,
28723
28741
  onFiltersChange: t
@@ -28733,12 +28751,12 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28733
28751
  }), 200);
28734
28752
  return () => clearTimeout(e);
28735
28753
  }, [f]);
28736
- let h = zj(o), g = h !== void 0 || jj(r, e.zones), _ = Oj(e) || f.trim() !== "";
28754
+ let h = Uj(o), g = h !== void 0 || Fj(r, e.zones), _ = Mj(e) || f.trim() !== "";
28737
28755
  return /* @__PURE__ */ H("div", {
28738
28756
  className: "space-y-1.5",
28739
28757
  "data-testid": "device-filter-bar",
28740
28758
  children: [
28741
- s !== void 0 && /* @__PURE__ */ V(Lj, { grouping: s }),
28759
+ s !== void 0 && /* @__PURE__ */ V(Vj, { grouping: s }),
28742
28760
  /* @__PURE__ */ H("div", {
28743
28761
  className: pl,
28744
28762
  children: [/* @__PURE__ */ V(pi, { className: "h-3.5 w-3.5 shrink-0 text-foreground-subtle" }), /* @__PURE__ */ V("input", {
@@ -28753,7 +28771,7 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28753
28771
  /* @__PURE__ */ H("div", {
28754
28772
  className: "flex flex-wrap items-center gap-1",
28755
28773
  children: [
28756
- jj(n, e.types) && /* @__PURE__ */ V(Rj, {
28774
+ Fj(n, e.types) && /* @__PURE__ */ V(Hj, {
28757
28775
  facet: "type",
28758
28776
  options: n,
28759
28777
  chosen: e.types,
@@ -28763,7 +28781,7 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28763
28781
  }),
28764
28782
  disabled: d
28765
28783
  }),
28766
- g && /* @__PURE__ */ V(Rj, {
28784
+ g && /* @__PURE__ */ V(Hj, {
28767
28785
  facet: "zone",
28768
28786
  options: r,
28769
28787
  chosen: e.zones,
@@ -28774,7 +28792,7 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28774
28792
  ...h === void 0 ? {} : { unavailable: h },
28775
28793
  disabled: d
28776
28794
  }),
28777
- jj(i, e.locations) && /* @__PURE__ */ V(Rj, {
28795
+ Fj(i, e.locations) && /* @__PURE__ */ V(Hj, {
28778
28796
  facet: "location",
28779
28797
  options: i,
28780
28798
  chosen: e.locations,
@@ -28788,13 +28806,13 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28788
28806
  variant: "ghost",
28789
28807
  "data-testid": "picker-reset-filters",
28790
28808
  onClick: () => {
28791
- p(""), t(kj());
28809
+ p(""), t(Nj());
28792
28810
  },
28793
28811
  children: "Reset filters"
28794
28812
  })
28795
28813
  ]
28796
28814
  }),
28797
- wj(e, o) && /* @__PURE__ */ V("p", {
28815
+ Oj(e, o) && /* @__PURE__ */ V("p", {
28798
28816
  className: "text-[10px] text-foreground-subtle",
28799
28817
  "data-testid": "picker-zone-filter-paused",
28800
28818
  children: "Zone filter paused — zones not loaded"
@@ -28804,7 +28822,7 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28804
28822
  }
28805
28823
  //#endregion
28806
28824
  //#region ../ui-library/src/composites/device-picker/device-parent.ts
28807
- function Vj(e) {
28825
+ function Gj(e) {
28808
28826
  let t = /* @__PURE__ */ new Map();
28809
28827
  for (let n of e) t.set(n.id, n.name);
28810
28828
  let n = /* @__PURE__ */ new Map();
@@ -28814,19 +28832,19 @@ function Vj(e) {
28814
28832
  }
28815
28833
  return n;
28816
28834
  }
28817
- function Hj(e) {
28835
+ function Kj(e) {
28818
28836
  if (!(e === void 0 || e.length === 0)) return `in ${e}`;
28819
28837
  }
28820
- function Uj(e) {
28838
+ function qj(e) {
28821
28839
  let t = e.filter((e) => typeof e.id == "number");
28822
28840
  if (t.length === 0) return e;
28823
- let n = Vj(t.map((e) => ({
28841
+ let n = Gj(t.map((e) => ({
28824
28842
  id: e.id,
28825
28843
  name: e.name,
28826
28844
  parentDeviceId: e.parentDeviceId ?? null
28827
28845
  }))), r = !1, i = e.map((e) => {
28828
28846
  if (e.detail !== void 0 || typeof e.id != "number") return e;
28829
- let t = Hj(n.get(e.id));
28847
+ let t = Kj(n.get(e.id));
28830
28848
  return t === void 0 ? e : (r = !0, {
28831
28849
  ...e,
28832
28850
  detail: t
@@ -28837,34 +28855,34 @@ function Uj(e) {
28837
28855
  //#endregion
28838
28856
  //#region ../ui-library/src/composites/device-picker/device-picker-grouping.ts
28839
28857
  i();
28840
- var Wj = "camstack.admin.device-picker.group-by", Gj = [["deviceManager", "listSiteZones"], "device-picker"], Kj = 6e4;
28841
- function qj() {
28858
+ var Jj = "camstack.admin.device-picker.group-by", Yj = [["deviceManager", "listSiteZones"], "device-picker"], Xj = 6e4;
28859
+ function Zj() {
28842
28860
  try {
28843
28861
  let e = globalThis.localStorage?.getItem("camstack.admin.device-picker.group-by") ?? null;
28844
- return e === null ? nj : rj(e);
28862
+ return e === null ? oj : sj(e);
28845
28863
  } catch {
28846
- return nj;
28864
+ return oj;
28847
28865
  }
28848
28866
  }
28849
- function Jj(e) {
28867
+ function Qj(e) {
28850
28868
  try {
28851
- globalThis.localStorage?.setItem(Wj, e);
28869
+ globalThis.localStorage?.setItem(Jj, e);
28852
28870
  } catch {}
28853
28871
  }
28854
- function Yj() {
28855
- let [e, t] = a(qj);
28872
+ function $j() {
28873
+ let [e, t] = a(Zj);
28856
28874
  return {
28857
28875
  groupBy: e,
28858
28876
  setGroupBy: (e) => {
28859
- t(e), Jj(e);
28877
+ t(e), Qj(e);
28860
28878
  }
28861
28879
  };
28862
28880
  }
28863
- function Xj(e) {
28881
+ function eM(e) {
28864
28882
  let t = ie().trpcClient, { data: n, isError: r } = ft({
28865
- queryKey: Gj,
28883
+ queryKey: Yj,
28866
28884
  enabled: e,
28867
- staleTime: Kj,
28885
+ staleTime: Xj,
28868
28886
  queryFn: () => t.deviceManager.listSiteZones.query()
28869
28887
  });
28870
28888
  return m(() => n === void 0 ? r ? { state: "failed" } : { state: "pending" } : {
@@ -28874,10 +28892,10 @@ function Xj(e) {
28874
28892
  }
28875
28893
  //#endregion
28876
28894
  //#region ../ui-library/src/composites/device-picker/device-selection.ts
28877
- function Zj(e) {
28895
+ function tM(e) {
28878
28896
  return e.data === void 0 ? e.isError ? "failed" : "pending" : "answered";
28879
28897
  }
28880
- function Qj(e, t, n) {
28898
+ function nM(e, t, n) {
28881
28899
  if (n !== "answered" || t === void 0) return e.map((e) => ({
28882
28900
  id: e,
28883
28901
  removed: !1
@@ -28895,19 +28913,19 @@ function Qj(e, t, n) {
28895
28913
  };
28896
28914
  });
28897
28915
  }
28898
- function $j(e, t, n, r) {
28916
+ function rM(e, t, n, r) {
28899
28917
  let i = new Set((t ?? []).map((e) => e.id));
28900
- return Qj(e.filter((e) => !i.has(e)), n, r);
28918
+ return nM(e.filter((e) => !i.has(e)), n, r);
28901
28919
  }
28902
- function eM(e, t, n) {
28920
+ function iM(e, t, n) {
28903
28921
  return e === "answered" && t === 0 && n === 0;
28904
28922
  }
28905
- function tM(e, t, n) {
28923
+ function aM(e, t, n) {
28906
28924
  return e && t === 0 && n;
28907
28925
  }
28908
28926
  //#endregion
28909
28927
  //#region ../ui-library/src/composites/device-picker/device-selection-rows.tsx
28910
- var nM = {
28928
+ var oM = {
28911
28929
  camera: "cameras",
28912
28930
  device: "devices",
28913
28931
  node: "nodes",
@@ -28917,7 +28935,7 @@ var nM = {
28917
28935
  face: "faces",
28918
28936
  calendar: "calendars"
28919
28937
  };
28920
- function rM(e, t = "device") {
28938
+ function sM(e, t = "device") {
28921
28939
  let n = String(e.id);
28922
28940
  switch (t) {
28923
28941
  case "node": return e.removed ? `Node ${n} — unknown to the hub` : e.name ?? `Node ${n}`;
@@ -28930,7 +28948,7 @@ function rM(e, t = "device") {
28930
28948
  case "device": return e.removed ? `Device #${n} — removed` : e.name ?? `Device #${n}`;
28931
28949
  }
28932
28950
  }
28933
- function iM({ noun: e = "camera" }) {
28951
+ function cM({ noun: e = "camera" }) {
28934
28952
  return /* @__PURE__ */ H("p", {
28935
28953
  className: "mt-1 text-[11px] text-warning",
28936
28954
  "data-testid": "devices-widen-warning",
@@ -28938,12 +28956,12 @@ function iM({ noun: e = "camera" }) {
28938
28956
  "No ",
28939
28957
  e,
28940
28958
  " selected: the rule will apply to ALL ",
28941
- nM[e],
28959
+ oM[e],
28942
28960
  "."
28943
28961
  ]
28944
28962
  });
28945
28963
  }
28946
- function aM({ noun: e = "cameras" }) {
28964
+ function lM({ noun: e = "cameras" }) {
28947
28965
  return /* @__PURE__ */ H("p", {
28948
28966
  className: "text-[11px] text-foreground-subtle",
28949
28967
  children: [
@@ -28953,7 +28971,7 @@ function aM({ noun: e = "cameras" }) {
28953
28971
  ]
28954
28972
  });
28955
28973
  }
28956
- function oM({ noun: e = "devices" }) {
28974
+ function uM({ noun: e = "devices" }) {
28957
28975
  return /* @__PURE__ */ H("p", {
28958
28976
  className: "text-[11px] text-warning",
28959
28977
  children: [
@@ -28966,7 +28984,7 @@ function oM({ noun: e = "devices" }) {
28966
28984
  //#endregion
28967
28985
  //#region ../ui-library/src/composites/device-picker/DevicePicker.tsx
28968
28986
  i();
28969
- function sM(e) {
28987
+ function dM(e) {
28970
28988
  switch (e.kind) {
28971
28989
  case "zone":
28972
28990
  case "location": return e.label;
@@ -28974,14 +28992,14 @@ function sM(e) {
28974
28992
  case "no-location": return "No location";
28975
28993
  }
28976
28994
  }
28977
- function cM(e) {
28978
- return e.heading === void 0 ? `${Mj(e.type)} · ${e.location ?? "No room"}` : sM(e.heading);
28995
+ function fM(e) {
28996
+ return e.heading === void 0 ? `${Ij(e.type)} · ${e.location ?? "No room"}` : dM(e.heading);
28979
28997
  }
28980
- function lM(e) {
28998
+ function pM(e) {
28981
28999
  return e === "camera" || e === "device";
28982
29000
  }
28983
- function uM(e, t, n, r) {
28984
- let i = new Map(t.map((e) => [e.id, e.name])), a = new Map($j(e, t, n.devices, n.state).map((e) => [e.id, e]));
29001
+ function mM(e, t, n, r) {
29002
+ let i = new Map(t.map((e) => [e.id, e.name])), a = new Map(rM(e, t, n.devices, n.state).map((e) => [e.id, e]));
28985
29003
  return e.map((e) => {
28986
29004
  let t = i.get(e);
28987
29005
  if (t !== void 0) return {
@@ -28995,34 +29013,34 @@ function uM(e, t, n, r) {
28995
29013
  };
28996
29014
  return {
28997
29015
  id: e,
28998
- label: rM(n, r),
29016
+ label: sM(n, r),
28999
29017
  removed: n.removed
29000
29018
  };
29001
29019
  });
29002
29020
  }
29003
- function dM(e, t) {
29004
- let n = nM[e];
29021
+ function hM(e, t) {
29022
+ let n = oM[e];
29005
29023
  return t ? e === "camera" || e === "device" ? "No cameras available — the rule applies to all devices." : `No ${n} available — the rule applies to every ${e}.` : `No ${n} available.`;
29006
29024
  }
29007
- function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMeansAll: o = !1, savedHadDevices: s = !1, noun: c = "camera", groupTitle: l = cM, emptyLabel: u, annotate: d, disabled: f = !1, testId: p, showAll: h = !1 }) {
29008
- let g = m(() => Uj(e), [e]), _ = n ?? {
29025
+ function gM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMeansAll: o = !1, savedHadDevices: s = !1, noun: c = "camera", groupTitle: l = fM, emptyLabel: u, annotate: d, disabled: f = !1, testId: p, showAll: h = !1 }) {
29026
+ let g = m(() => qj(e), [e]), _ = n ?? {
29009
29027
  state: t,
29010
29028
  devices: t === "answered" ? g : void 0
29011
29029
  }, [v, y] = a(!1), [b, x] = a(!1), [S, C] = a(s || r.length > 0);
29012
29030
  r.length > 0 && !S && C(!0);
29013
- let w = uM(r, g, _, c), T = $A(w, b || h), E = v || h, D = tM(o, r.length, S), O = nM[c];
29014
- return t === "answered" && eM(t, g.length, r.length) ? /* @__PURE__ */ H("div", {
29031
+ let w = mM(r, g, _, c), T = rj(w, b || h), E = v || h, D = aM(o, r.length, S), O = oM[c];
29032
+ return t === "answered" && iM(t, g.length, r.length) ? /* @__PURE__ */ H("div", {
29015
29033
  "data-testid": p,
29016
29034
  children: [/* @__PURE__ */ V("p", {
29017
29035
  className: "text-[10px] text-foreground-subtle mt-0.5",
29018
- children: dM(c, o)
29019
- }), D && /* @__PURE__ */ V(iM, { noun: c })]
29036
+ children: hM(c, o)
29037
+ }), D && /* @__PURE__ */ V(cM, { noun: c })]
29020
29038
  }) : /* @__PURE__ */ H("div", {
29021
29039
  className: "mt-1 space-y-1.5",
29022
29040
  "data-testid": p,
29023
29041
  children: [
29024
- t === "pending" && /* @__PURE__ */ V(aM, { noun: O }),
29025
- t === "failed" && /* @__PURE__ */ V(oM, { noun: c === "camera" ? "devices" : O }),
29042
+ t === "pending" && /* @__PURE__ */ V(lM, { noun: O }),
29043
+ t === "failed" && /* @__PURE__ */ V(uM, { noun: c === "camera" ? "devices" : O }),
29026
29044
  /* @__PURE__ */ H("div", {
29027
29045
  className: "flex flex-wrap items-center gap-1",
29028
29046
  children: [
@@ -29061,7 +29079,7 @@ function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
29061
29079
  })
29062
29080
  ]
29063
29081
  }),
29064
- E && t === "answered" && (lM(c) ? /* @__PURE__ */ V(pM, {
29082
+ E && t === "answered" && (pM(c) ? /* @__PURE__ */ V(_M, {
29065
29083
  devices: g,
29066
29084
  value: r,
29067
29085
  onChange: i,
@@ -29070,7 +29088,7 @@ function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
29070
29088
  noun: c,
29071
29089
  disabled: f,
29072
29090
  showAll: h
29073
- }) : /* @__PURE__ */ V(gM, {
29091
+ }) : /* @__PURE__ */ V(bM, {
29074
29092
  devices: g,
29075
29093
  value: r,
29076
29094
  onChange: i,
@@ -29080,13 +29098,13 @@ function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
29080
29098
  disabled: f,
29081
29099
  showAll: h
29082
29100
  })),
29083
- D && /* @__PURE__ */ V(iM, { noun: c })
29101
+ D && /* @__PURE__ */ V(cM, { noun: c })
29084
29102
  ]
29085
29103
  });
29086
29104
  }
29087
- function pM(e) {
29088
- let { groupBy: t, setGroupBy: n } = Yj(), r = Xj(!0);
29089
- return /* @__PURE__ */ V(gM, {
29105
+ function _M(e) {
29106
+ let { groupBy: t, setGroupBy: n } = $j(), r = eM(!0);
29107
+ return /* @__PURE__ */ V(bM, {
29090
29108
  ...e,
29091
29109
  grouping: {
29092
29110
  groupBy: t,
@@ -29095,52 +29113,52 @@ function pM(e) {
29095
29113
  }
29096
29114
  });
29097
29115
  }
29098
- function mM(e) {
29116
+ function vM(e) {
29099
29117
  return e === "camera" || e === "device" ? "Search by name, room or type…" : e === "class" ? "Search by class or category…" : e === "zone" ? "Search by camera or zone…" : "Search by name or id…";
29100
29118
  }
29101
- var hM = {
29119
+ var yM = {
29102
29120
  state: "answered",
29103
29121
  zones: []
29104
29122
  };
29105
- function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, noun: o, disabled: s, showAll: c, grouping: l }) {
29106
- let [u, d] = a(vj), [f, p] = a(/* @__PURE__ */ new Map()), [h, g] = a(60), _ = c || HA(u.query).length > 0, v = l?.groupBy, y = l?.zones ?? hM, b = m(() => Ej(e, u, y), [
29123
+ function bM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, noun: o, disabled: s, showAll: c, grouping: l }) {
29124
+ let [u, d] = a(Sj), [f, p] = a(/* @__PURE__ */ new Map()), [h, g] = a(60), _ = c || KA(u.query).length > 0, v = l?.groupBy, y = l?.zones ?? yM, b = m(() => Aj(e, u, y), [
29107
29125
  e,
29108
29126
  u,
29109
29127
  y
29110
- ]), x = m(() => v === void 0 ? null : mj(b, t, v, y), [
29128
+ ]), x = m(() => v === void 0 ? null : vj(b, t, v, y), [
29111
29129
  b,
29112
29130
  t,
29113
29131
  v,
29114
29132
  y
29115
- ]), S = m(() => x === null ? YA(qA(b, t), t, f, _) : hj(x, t, f, _), [
29133
+ ]), S = m(() => x === null ? $A(ZA(b, t), t, f, _) : yj(x, t, f, _), [
29116
29134
  x,
29117
29135
  b,
29118
29136
  t,
29119
29137
  f,
29120
29138
  _
29121
- ]), C = x?.groupBy ?? null, w = m(() => Cj(e, "type", u.types, y), [
29139
+ ]), C = x?.groupBy ?? null, w = m(() => Dj(e, "type", u.types, y), [
29122
29140
  e,
29123
29141
  u.types,
29124
29142
  y
29125
- ]), T = m(() => Cj(e, "zone", u.zones, y), [
29143
+ ]), T = m(() => Dj(e, "zone", u.zones, y), [
29126
29144
  e,
29127
29145
  u.zones,
29128
29146
  y
29129
- ]), E = m(() => l === void 0 ? [] : Cj(e, "location", u.locations, y), [
29147
+ ]), E = m(() => l === void 0 ? [] : Dj(e, "location", u.locations, y), [
29130
29148
  e,
29131
29149
  u.locations,
29132
29150
  y,
29133
29151
  l
29134
- ]), D = m(() => Aj(t, e, b), [
29152
+ ]), D = m(() => Pj(t, e, b), [
29135
29153
  e,
29136
29154
  t,
29137
29155
  b
29138
- ]), O = ej(S, c ? S.length : h), k = (e, t) => p((n) => new Map([...n, [e.key, !t]]));
29156
+ ]), O = ij(S, c ? S.length : h), k = (e, t) => p((n) => new Map([...n, [e.key, !t]]));
29139
29157
  return /* @__PURE__ */ H("div", {
29140
29158
  className: "rounded-md border border-border bg-surface p-2",
29141
29159
  "data-testid": "device-picker-panel",
29142
29160
  children: [
29143
- /* @__PURE__ */ V(Bj, {
29161
+ /* @__PURE__ */ V(Wj, {
29144
29162
  filters: u,
29145
29163
  onFiltersChange: (e) => {
29146
29164
  d(e), g(60);
@@ -29154,8 +29172,8 @@ function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
29154
29172
  onGroupByChange: l.onGroupByChange,
29155
29173
  fallback: x?.fallback ?? null
29156
29174
  } },
29157
- searchPlaceholder: mM(o),
29158
- searchLabel: o === "camera" || o === "device" ? "Search devices" : `Search ${nM[o]}`,
29175
+ searchPlaceholder: vM(o),
29176
+ searchLabel: o === "camera" || o === "device" ? "Search devices" : `Search ${oM[o]}`,
29159
29177
  disabled: s
29160
29178
  }),
29161
29179
  /* @__PURE__ */ H("p", {
@@ -29175,7 +29193,7 @@ function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
29175
29193
  }) : /* @__PURE__ */ H("div", {
29176
29194
  className: c ? "mt-1" : "mt-1 max-h-72 overflow-y-auto",
29177
29195
  "data-testid": "device-picker-rows",
29178
- children: [O.rows.map((e) => /* @__PURE__ */ V(vM, {
29196
+ children: [O.rows.map((e) => /* @__PURE__ */ V(SM, {
29179
29197
  row: e,
29180
29198
  value: t,
29181
29199
  onChange: n,
@@ -29205,16 +29223,16 @@ function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
29205
29223
  ]
29206
29224
  });
29207
29225
  }
29208
- function _M(e, t) {
29226
+ function xM(e, t) {
29209
29227
  if (t === null) return e.detail;
29210
- let n = gj(e, t), r = [
29228
+ let n = bj(e, t), r = [
29211
29229
  n.location,
29212
- n.type === null ? null : Mj(n.type),
29230
+ n.type === null ? null : Ij(n.type),
29213
29231
  e.detail ?? null
29214
29232
  ].filter((e) => e !== null);
29215
29233
  return r.length > 0 ? r.join(" · ") : void 0;
29216
29234
  }
29217
- function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, groupTitle: a, groupBy: o, disabled: s }) {
29235
+ function SM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, groupTitle: a, groupBy: o, disabled: s }) {
29218
29236
  if (e.kind === "header") {
29219
29237
  let { group: i, expanded: o } = e;
29220
29238
  return /* @__PURE__ */ H("div", {
@@ -29248,20 +29266,20 @@ function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
29248
29266
  type: "button",
29249
29267
  disabled: s,
29250
29268
  className: "text-[10px] text-primary hover:underline disabled:opacity-50",
29251
- onClick: () => n(ZA(t, i)),
29269
+ onClick: () => n(tj(t, i)),
29252
29270
  children: "All"
29253
29271
  }),
29254
29272
  /* @__PURE__ */ V("button", {
29255
29273
  type: "button",
29256
29274
  disabled: s,
29257
29275
  className: "text-[10px] text-foreground-subtle hover:underline disabled:opacity-50",
29258
- onClick: () => n(QA(t, i)),
29276
+ onClick: () => n(nj(t, i)),
29259
29277
  children: "Clear"
29260
29278
  })
29261
29279
  ]
29262
29280
  });
29263
29281
  }
29264
- let c = i?.(e.device.id), l = _M(e.device, o);
29282
+ let c = i?.(e.device.id), l = xM(e.device, o);
29265
29283
  return /* @__PURE__ */ H("label", {
29266
29284
  className: "flex cursor-pointer items-center gap-2.5 px-3 py-1 text-xs text-foreground hover:bg-surface-hover",
29267
29285
  "data-testid": "device-picker-row",
@@ -29269,7 +29287,7 @@ function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
29269
29287
  type: "checkbox",
29270
29288
  checked: e.selected,
29271
29289
  disabled: s,
29272
- onChange: () => n(XA(t, e.device.id)),
29290
+ onChange: () => n(ej(t, e.device.id)),
29273
29291
  className: "accent-primary",
29274
29292
  "data-device-id": String(e.device.id)
29275
29293
  }), /* @__PURE__ */ H("span", {
@@ -29294,21 +29312,21 @@ function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
29294
29312
  i(), i(), L("camstack:zone-editing", null), i(), i(), i(), i(), i(), f(() => import("./MaskShapeCanvas-Kfg9dl6B.mjs").then((e) => ({ default: e.MaskShapeCanvas }))), f(() => import("./MotionZonesSettings-DflIL9ss.mjs").then((e) => ({ default: e.MotionZonesSettings }))), f(() => import("./SceneMonitorEditor-DnQJ7Hx3.mjs").then((e) => ({ default: e.SceneMonitorEditor }))), f(() => import("./PrivacyMaskSettings-Bo1S23wt.mjs").then((e) => ({ default: e.PrivacyMaskSettings })));
29295
29313
  //#endregion
29296
29314
  //#region src/page/frames/lib/retrain-assist-defaults.ts
29297
- var yM = "object-detection";
29298
- function bM(e, t) {
29315
+ var CM = "object-detection";
29316
+ function wM(e, t) {
29299
29317
  for (let n of e) {
29300
29318
  if (n.addonId === t) return n;
29301
- let e = n.children === void 0 ? void 0 : bM(n.children, t);
29319
+ let e = n.children === void 0 ? void 0 : wM(n.children, t);
29302
29320
  if (e !== void 0) return e;
29303
29321
  }
29304
29322
  }
29305
- function xM(e, t) {
29323
+ function TM(e, t) {
29306
29324
  for (let n of e.slots) {
29307
29325
  let e = n.addons.find((e) => e.id === t);
29308
29326
  if (e !== void 0) return e;
29309
29327
  }
29310
29328
  }
29311
- function SM(e) {
29329
+ function EM(e) {
29312
29330
  let { status: t, nodeDevices: n, schema: r, resolvedSteps: i } = e;
29313
29331
  if (t === void 0) return {
29314
29332
  kind: "unknown",
@@ -29332,7 +29350,7 @@ function SM(e) {
29332
29350
  kind: "unknown",
29333
29351
  gap: "device-unknown"
29334
29352
  };
29335
- let s = xM(r, yM);
29353
+ let s = TM(r, CM);
29336
29354
  if (s === void 0) return {
29337
29355
  kind: "unknown",
29338
29356
  gap: "step-unknown"
@@ -29340,8 +29358,8 @@ function SM(e) {
29340
29358
  let c = tg({
29341
29359
  catalog: s,
29342
29360
  device: o,
29343
- override: bM(i, yM)?.modelId,
29344
- base: o.steps?.[yM]?.modelId
29361
+ override: wM(i, CM)?.modelId,
29362
+ base: o.steps?.[CM]?.modelId
29345
29363
  });
29346
29364
  return c === void 0 ? {
29347
29365
  kind: "unknown",
@@ -29353,11 +29371,11 @@ function SM(e) {
29353
29371
  minScore: s.models.find((e) => e.id === c)?.defaultConfidence ?? s.defaultConfidence
29354
29372
  };
29355
29373
  }
29356
- function CM(e, t) {
29374
+ function DM(e, t) {
29357
29375
  let n = Math.max(0, Math.min(e.x + e.w, t.x + t.w) - Math.max(e.x, t.x)) * Math.max(0, Math.min(e.y + e.h, t.y + t.h) - Math.max(e.y, t.y)), r = e.w * e.h + t.w * t.h - n;
29358
29376
  return r > 0 ? n / r : 0;
29359
29377
  }
29360
- function wM(e, t) {
29378
+ function OM(e, t) {
29361
29379
  let n = e.nextKey;
29362
29380
  return {
29363
29381
  boxes: t.map((e) => {
@@ -29370,7 +29388,7 @@ function wM(e, t) {
29370
29388
  nextKey: n
29371
29389
  };
29372
29390
  }
29373
- function TM(e) {
29391
+ function kM(e) {
29374
29392
  return {
29375
29393
  bbox: e.bbox,
29376
29394
  macroClass: e.macroClass,
@@ -29383,7 +29401,7 @@ function TM(e) {
29383
29401
  draft: !1
29384
29402
  };
29385
29403
  }
29386
- function EM(e) {
29404
+ function AM(e) {
29387
29405
  return e.map((e) => ({
29388
29406
  bbox: e.bbox,
29389
29407
  macroClass: e.macroClass,
@@ -29397,23 +29415,23 @@ function EM(e) {
29397
29415
  note: e.basis === "subject-box" ? "The box the pipeline recorded on this very frame." : `The pipeline's track position ${String(Math.round(e.deltaMs))} ms from this frame.`
29398
29416
  }));
29399
29417
  }
29400
- var DM = {
29418
+ var jM = {
29401
29419
  boxes: [],
29402
29420
  selectedKey: null,
29403
29421
  nextKey: 0
29404
29422
  };
29405
- function OM(e, t) {
29406
- let n = wM(DM, e.map(TM));
29407
- return kM({
29423
+ function MM(e, t) {
29424
+ let n = OM(jM, e.map(kM));
29425
+ return NM({
29408
29426
  boxes: n.boxes,
29409
29427
  selectedKey: null,
29410
29428
  nextKey: n.nextKey
29411
- }, EM(t)).state;
29429
+ }, AM(t)).state;
29412
29430
  }
29413
- function kM(e, t) {
29431
+ function NM(e, t) {
29414
29432
  let n = [], r = 0;
29415
29433
  for (let i of t) {
29416
- if ([...e.boxes, ...n].some((e) => CM(e.bbox, i.bbox) >= .8)) {
29434
+ if ([...e.boxes, ...n].some((e) => DM(e.bbox, i.bbox) >= .8)) {
29417
29435
  r += 1;
29418
29436
  continue;
29419
29437
  }
@@ -29422,7 +29440,7 @@ function kM(e, t) {
29422
29440
  draft: !0
29423
29441
  });
29424
29442
  }
29425
- let i = wM(e, n);
29443
+ let i = OM(e, n);
29426
29444
  return {
29427
29445
  state: {
29428
29446
  ...e,
@@ -29432,8 +29450,8 @@ function kM(e, t) {
29432
29450
  skipped: r
29433
29451
  };
29434
29452
  }
29435
- function AM(e, t, n) {
29436
- let r = wM(e, [{
29453
+ function PM(e, t, n) {
29454
+ let r = OM(e, [{
29437
29455
  bbox: t,
29438
29456
  macroClass: n,
29439
29457
  kind: "subject",
@@ -29446,26 +29464,26 @@ function AM(e, t, n) {
29446
29464
  nextKey: r.nextKey
29447
29465
  };
29448
29466
  }
29449
- function jM(e, t, n) {
29467
+ function FM(e, t, n) {
29450
29468
  return {
29451
29469
  ...e,
29452
29470
  boxes: e.boxes.map((e) => e.key === t ? n(e) : e)
29453
29471
  };
29454
29472
  }
29455
- function MM(e, t, n) {
29456
- return jM(e, t, (e) => ({
29473
+ function IM(e, t, n) {
29474
+ return FM(e, t, (e) => ({
29457
29475
  ...e,
29458
29476
  ...n,
29459
29477
  draft: !1
29460
29478
  }));
29461
29479
  }
29462
- function NM(e, t) {
29463
- return jM(e, t, (e) => ({
29480
+ function LM(e, t) {
29481
+ return FM(e, t, (e) => ({
29464
29482
  ...e,
29465
29483
  draft: !1
29466
29484
  }));
29467
29485
  }
29468
- function PM(e) {
29486
+ function RM(e) {
29469
29487
  return {
29470
29488
  ...e,
29471
29489
  boxes: e.boxes.map((e) => e.draft ? {
@@ -29474,27 +29492,27 @@ function PM(e) {
29474
29492
  } : e)
29475
29493
  };
29476
29494
  }
29477
- function FM(e, t) {
29478
- return jM(e, t, (e) => ({
29495
+ function zM(e, t) {
29496
+ return FM(e, t, (e) => ({
29479
29497
  ...e,
29480
29498
  kind: e.kind === "model_error" ? "subject" : "model_error",
29481
29499
  draft: !1
29482
29500
  }));
29483
29501
  }
29484
- function IM(e, t) {
29502
+ function BM(e, t) {
29485
29503
  return {
29486
29504
  ...e,
29487
29505
  boxes: e.boxes.filter((e) => e.key !== t),
29488
29506
  selectedKey: e.selectedKey === t ? null : e.selectedKey
29489
29507
  };
29490
29508
  }
29491
- function LM(e, t) {
29509
+ function VM(e, t) {
29492
29510
  return {
29493
29511
  ...e,
29494
29512
  selectedKey: t
29495
29513
  };
29496
29514
  }
29497
- function RM(e, t) {
29515
+ function HM(e, t) {
29498
29516
  return {
29499
29517
  ...e,
29500
29518
  boxes: e.boxes.map((e) => {
@@ -29506,7 +29524,7 @@ function RM(e, t) {
29506
29524
  })
29507
29525
  };
29508
29526
  }
29509
- function zM(e, t) {
29527
+ function UM(e, t) {
29510
29528
  return new Map(e.map((e) => [e.ref, {
29511
29529
  verdict: e.verdict,
29512
29530
  reason: e.reason,
@@ -29514,16 +29532,16 @@ function zM(e, t) {
29514
29532
  ...e.suggestedClass === void 0 ? {} : { suggestedClass: e.suggestedClass }
29515
29533
  }]));
29516
29534
  }
29517
- function BM(e) {
29535
+ function WM(e) {
29518
29536
  return e.boxes.filter((e) => e.draft).length;
29519
29537
  }
29520
- function VM(e) {
29538
+ function GM(e) {
29521
29539
  let t = e?.trim();
29522
29540
  return t === void 0 || t === "" ? void 0 : t;
29523
29541
  }
29524
- function HM(e) {
29542
+ function KM(e) {
29525
29543
  return e.boxes.filter((e) => !e.draft).map((e) => {
29526
- let t = VM(e.label), n = VM(e.subLabel);
29544
+ let t = GM(e.label), n = GM(e.subLabel);
29527
29545
  return {
29528
29546
  bbox: e.bbox,
29529
29547
  macroClass: e.macroClass,
@@ -29538,29 +29556,29 @@ function HM(e) {
29538
29556
  }
29539
29557
  //#endregion
29540
29558
  //#region src/page/frames/RetrainAnnotationEditor.tsx
29541
- var UM = [
29559
+ var qM = [
29542
29560
  "person",
29543
29561
  "vehicle",
29544
29562
  "animal",
29545
29563
  "package",
29546
29564
  "face",
29547
29565
  "plate"
29548
- ], WM = new Set(UM), GM = {
29566
+ ], JM = new Set(qM), YM = {
29549
29567
  operator: "drawn",
29550
29568
  pipeline: "pipeline",
29551
29569
  assist: "detector",
29552
29570
  llm: "AI vision"
29553
29571
  };
29554
- function KM(e) {
29572
+ function XM(e) {
29555
29573
  let t = e?.trim().toLowerCase();
29556
- return t === void 0 || t === "" ? null : WM.has(t) ? `"${t}" is a macro class, not a label — person / postman / Marco are three different tiers` : null;
29574
+ return t === void 0 || t === "" ? null : JM.has(t) ? `"${t}" is a macro class, not a label — person / postman / Marco are three different tiers` : null;
29557
29575
  }
29558
- function qM(e) {
29576
+ function ZM(e) {
29559
29577
  if (e.source === "operator") return null;
29560
- let t = [GM[e.source]];
29578
+ let t = [YM[e.source]];
29561
29579
  return e.assistModelId !== void 0 && t.push(e.assistModelId), e.assistScore !== void 0 && t.push(e.assistScore.toFixed(2)), t.join(" · ");
29562
29580
  }
29563
- function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, onToggleModelError: a, onDelete: o }) {
29581
+ function QM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, onToggleModelError: a, onDelete: o }) {
29564
29582
  return e.length === 0 ? /* @__PURE__ */ H("p", {
29565
29583
  className: "text-[11px] text-foreground-subtle p-3",
29566
29584
  children: [
@@ -29572,7 +29590,7 @@ function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
29572
29590
  }) : /* @__PURE__ */ V("ul", {
29573
29591
  className: "divide-y divide-border",
29574
29592
  children: e.map((e) => {
29575
- let s = e.key === t, c = KM(e.label), l = KM(e.subLabel), u = qM(e);
29593
+ let s = e.key === t, c = XM(e.label), l = XM(e.subLabel), u = ZM(e);
29576
29594
  return /* @__PURE__ */ H("li", {
29577
29595
  "data-testid": `retrain-row-${e.key}`,
29578
29596
  className: `p-2.5 space-y-1.5 ${s ? "bg-surface-hover" : ""}`,
@@ -29590,12 +29608,12 @@ function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
29590
29608
  className: "w-28",
29591
29609
  "aria-label": "Class",
29592
29610
  value: e.macroClass,
29593
- options: UM.map((e) => ({
29611
+ options: qM.map((e) => ({
29594
29612
  value: e,
29595
29613
  label: e
29596
29614
  })),
29597
29615
  onChange: (t) => {
29598
- let n = UM.find((e) => e === t.target.value);
29616
+ let n = qM.find((e) => e === t.target.value);
29599
29617
  n !== void 0 && r(e.key, { macroClass: n });
29600
29618
  }
29601
29619
  }),
@@ -29687,15 +29705,15 @@ function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
29687
29705
  })
29688
29706
  });
29689
29707
  }
29690
- function YM(e) {
29691
- return e.filter((e) => !e.draft).every((e) => KM(e.label) === null && KM(e.subLabel) === null && WM.has(e.macroClass));
29708
+ function $M(e) {
29709
+ return e.filter((e) => !e.draft).every((e) => XM(e.label) === null && XM(e.subLabel) === null && JM.has(e.macroClass));
29692
29710
  }
29693
29711
  //#endregion
29694
29712
  //#region src/page/frames/lib/retrain-teacher.ts
29695
- var XM = .25;
29696
- function ZM(e, t) {
29713
+ var eN = .25;
29714
+ function tN(e, t) {
29697
29715
  if (e === void 0) return [];
29698
- let n = e.selectedEngine.format, r = e.slots.flatMap((e) => e.addons).find((e) => e.id === yM);
29716
+ let n = e.selectedEngine.format, r = e.slots.flatMap((e) => e.addons).find((e) => e.id === CM);
29699
29717
  if (r === void 0) return [];
29700
29718
  let i = r.models.filter((e) => e.legacy !== !0 && e.provider === void 0).flatMap((e) => {
29701
29719
  let t = e.formats[n];
@@ -29709,7 +29727,7 @@ function ZM(e, t) {
29709
29727
  }
29710
29728
  //#endregion
29711
29729
  //#region src/page/frames/frame-address.ts
29712
- function QM(e) {
29730
+ function nN(e) {
29713
29731
  return {
29714
29732
  deviceId: e.deviceId,
29715
29733
  ...e.trackId === void 0 ? {} : { trackId: e.trackId },
@@ -29719,7 +29737,7 @@ function QM(e) {
29719
29737
  //#endregion
29720
29738
  //#region src/page/frames/RetrainAssistPanel.tsx
29721
29739
  i();
29722
- var $M = [
29740
+ var rN = [
29723
29741
  {
29724
29742
  value: "teacher",
29725
29743
  label: "Bigger detector"
@@ -29732,19 +29750,19 @@ var $M = [
29732
29750
  value: "both",
29733
29751
  label: "Both"
29734
29752
  }
29735
- ], eN = [
29753
+ ], iN = [
29736
29754
  "person",
29737
29755
  "vehicle",
29738
29756
  "animal",
29739
29757
  "package"
29740
- ], tN = [
29758
+ ], aN = [
29741
29759
  "person",
29742
29760
  "vehicle",
29743
29761
  "animal",
29744
29762
  "package",
29745
29763
  "face",
29746
29764
  "plate"
29747
- ], nN = {
29765
+ ], oN = {
29748
29766
  "unknown-frame": "The frame is no longer in the dataset.",
29749
29767
  "unreadable-frame": "The frame copy could not be read.",
29750
29768
  "unknown-profile": "That AI profile no longer exists.",
@@ -29754,13 +29772,13 @@ var $M = [
29754
29772
  "llm-error": "The AI model call failed.",
29755
29773
  "malformed-answer": "The AI answered in a shape that cannot be trusted, so nothing was drawn."
29756
29774
  };
29757
- function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29758
- let o = sc({}, { retry: !1 }), s = nc(), c = cc(), [l, d] = a("teacher"), f = m(() => ZM(r, n.kind === "resolved" ? n.modelId : void 0), [r, n]), [p, h] = a(null), g = f.find((e) => e.modelId === p) ?? f[0], [_, v] = a(XM), [y, b] = a(null), x = (o.data ?? []).find((e) => e.id === y) ?? o.data?.[0], [S, C] = a(eN), [w, T] = a(!1), [E, D] = a(!1), O = u(t.editor);
29775
+ function sN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29776
+ let o = sc({}, { retry: !1 }), s = nc(), c = cc(), [l, d] = a("teacher"), f = m(() => tN(r, n.kind === "resolved" ? n.modelId : void 0), [r, n]), [p, h] = a(null), g = f.find((e) => e.modelId === p) ?? f[0], [_, v] = a(eN), [y, b] = a(null), x = (o.data ?? []).find((e) => e.id === y) ?? o.data?.[0], [S, C] = a(iN), [w, T] = a(!1), [E, D] = a(!1), O = u(t.editor);
29759
29777
  O.current = t.editor;
29760
29778
  let k = l !== "llm", A = l !== "teacher", j = n.kind === "resolved" && g !== void 0, M = x !== void 0 && S.length > 0, N = (!k || j) && (!A || M), P = async () => {
29761
29779
  if (n.kind !== "resolved" || g === void 0) return "";
29762
29780
  let r = await s.mutateAsync({
29763
- ...QM(e),
29781
+ ...nN(e),
29764
29782
  subject: {
29765
29783
  kind: "objects",
29766
29784
  modelId: g.modelId,
@@ -29769,7 +29787,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29769
29787
  nodeId: n.nodeId
29770
29788
  });
29771
29789
  if (r.kind === "refused") return `${g.name} refused: ${r.reason}${r.detail === void 0 ? "" : ` — ${r.detail}`}.`;
29772
- let i = kM(O.current, r.proposals.map((e) => ({
29790
+ let i = NM(O.current, r.proposals.map((e) => ({
29773
29791
  bbox: e.bbox,
29774
29792
  macroClass: e.macroClass,
29775
29793
  ...e.label === void 0 ? {} : { label: e.label },
@@ -29786,7 +29804,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29786
29804
  }, F = async (n) => {
29787
29805
  if (x === void 0) return "";
29788
29806
  let r = O.current, i = await c.mutateAsync({
29789
- ...QM(e),
29807
+ ...nN(e),
29790
29808
  profileId: x.id,
29791
29809
  classes: [...S],
29792
29810
  boxes: r.boxes.slice(0, 50).map((e) => ({
@@ -29797,7 +29815,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29797
29815
  })),
29798
29816
  allowCloud: n
29799
29817
  });
29800
- if (i.kind === "refused") return `${nN[i.reason] ?? i.reason}${i.detail === void 0 ? "" : ` (${i.detail})`}`;
29818
+ if (i.kind === "refused") return `${oN[i.reason] ?? i.reason}${i.detail === void 0 ? "" : ` (${i.detail})`}`;
29801
29819
  let a = i.proposals.map((e) => ({
29802
29820
  bbox: e.bbox,
29803
29821
  macroClass: e.macroClass,
@@ -29808,8 +29826,8 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29808
29826
  ...e.assistScore === void 0 ? {} : { assistScore: e.assistScore },
29809
29827
  draft: !0,
29810
29828
  note: `${i.model}: ${e.reason}`
29811
- })), o = zM(i.reviews, i.model), s = kM(O.current, a);
29812
- t.setEditor((e) => RM(kM(e, a).state, o));
29829
+ })), o = UM(i.reviews, i.model), s = NM(O.current, a);
29830
+ t.setEditor((e) => HM(NM(e, a).state, o));
29813
29831
  let l = i.proposals.length - s.skipped, u = i.reviews.filter((e) => e.verdict !== "confirmed").length;
29814
29832
  return `${x.name}: ${String(l)} new draft${l === 1 ? "" : "s"}, ${String(u)} box${u === 1 ? "" : "es"} questioned${i.rejected > 0 ? `, ${String(i.rejected)} unusable item${i.rejected === 1 ? "" : "s"} dropped` : ""}.`;
29815
29833
  }, I = async (e) => {
@@ -29838,12 +29856,12 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29838
29856
  className: "w-36",
29839
29857
  "aria-label": "Assist engine",
29840
29858
  value: l,
29841
- options: $M.map((e) => ({
29859
+ options: rN.map((e) => ({
29842
29860
  value: e.value,
29843
29861
  label: e.label
29844
29862
  })),
29845
29863
  onChange: (e) => {
29846
- let t = $M.find((t) => t.value === e.target.value);
29864
+ let t = rN.find((t) => t.value === e.target.value);
29847
29865
  t !== void 0 && d(t.value);
29848
29866
  }
29849
29867
  }),
@@ -29929,7 +29947,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29929
29947
  children: [/* @__PURE__ */ V("span", {
29930
29948
  className: "text-foreground-subtle",
29931
29949
  children: "Look for:"
29932
- }), tN.map((e) => {
29950
+ }), aN.map((e) => {
29933
29951
  let t = S.includes(e);
29934
29952
  return /* @__PURE__ */ V("button", {
29935
29953
  type: "button",
@@ -29965,7 +29983,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29965
29983
  }
29966
29984
  //#endregion
29967
29985
  //#region src/page/frames/lib/retrain-boxes.ts
29968
- function iN(e, t, n, r) {
29986
+ function cN(e, t, n, r) {
29969
29987
  if (!(e > 0) || !(t > 0) || !(n > 0) || !(r > 0)) return null;
29970
29988
  let i = Math.min(e / n, t / r), a = n * i, o = r * i;
29971
29989
  return {
@@ -29975,7 +29993,7 @@ function iN(e, t, n, r) {
29975
29993
  height: o
29976
29994
  };
29977
29995
  }
29978
- function aN(e, t) {
29996
+ function lN(e, t) {
29979
29997
  return {
29980
29998
  x: Math.min(e.x, t.x),
29981
29999
  y: Math.min(e.y, t.y),
@@ -29983,11 +30001,11 @@ function aN(e, t) {
29983
30001
  h: Math.abs(t.y - e.y)
29984
30002
  };
29985
30003
  }
29986
- var oN = .01;
29987
- function sN(e) {
30004
+ var uN = .01;
30005
+ function dN(e) {
29988
30006
  return e.w >= .01 && e.h >= .01;
29989
30007
  }
29990
- function cN(e, t) {
30008
+ function fN(e, t) {
29991
30009
  let n = -1, r = Infinity;
29992
30010
  return e.forEach((e, i) => {
29993
30011
  if (!(t.x >= e.x && t.x <= e.x + e.w && t.y >= e.y && t.y <= e.y + e.h)) return;
@@ -29995,7 +30013,7 @@ function cN(e, t) {
29995
30013
  a < r && (n = i, r = a);
29996
30014
  }), n;
29997
30015
  }
29998
- var lN = [
30016
+ var pN = [
29999
30017
  "nw",
30000
30018
  "n",
30001
30019
  "ne",
@@ -30005,7 +30023,7 @@ var lN = [
30005
30023
  "sw",
30006
30024
  "w"
30007
30025
  ];
30008
- function uN(e, t, n) {
30026
+ function mN(e, t, n) {
30009
30027
  return {
30010
30028
  x: Math.min(Math.max(0, e.x + t), Math.max(0, 1 - e.w)),
30011
30029
  y: Math.min(Math.max(0, e.y + n), Math.max(0, 1 - e.h)),
@@ -30013,9 +30031,9 @@ function uN(e, t, n) {
30013
30031
  h: e.h
30014
30032
  };
30015
30033
  }
30016
- function dN(e, t, n, r) {
30034
+ function hN(e, t, n, r) {
30017
30035
  if (n) {
30018
- let e = Math.min(Math.max(0, r), t - oN);
30036
+ let e = Math.min(Math.max(0, r), t - uN);
30019
30037
  return {
30020
30038
  start: e,
30021
30039
  size: t - e
@@ -30023,14 +30041,14 @@ function dN(e, t, n, r) {
30023
30041
  }
30024
30042
  return {
30025
30043
  start: e,
30026
- size: Math.max(Math.min(1, r), e + oN) - e
30044
+ size: Math.max(Math.min(1, r), e + uN) - e
30027
30045
  };
30028
30046
  }
30029
- function fN(e, t, n) {
30030
- let r = t.includes("w") || t.includes("e") ? dN(e.x, e.x + e.w, t.includes("w"), n.x) : {
30047
+ function gN(e, t, n) {
30048
+ let r = t.includes("w") || t.includes("e") ? hN(e.x, e.x + e.w, t.includes("w"), n.x) : {
30031
30049
  start: e.x,
30032
30050
  size: e.w
30033
- }, i = t.includes("n") || t.includes("s") ? dN(e.y, e.y + e.h, t.includes("n"), n.y) : {
30051
+ }, i = t.includes("n") || t.includes("s") ? hN(e.y, e.y + e.h, t.includes("n"), n.y) : {
30034
30052
  start: e.y,
30035
30053
  size: e.h
30036
30054
  };
@@ -30041,44 +30059,44 @@ function fN(e, t, n) {
30041
30059
  h: i.size
30042
30060
  };
30043
30061
  }
30044
- function pN(e, t) {
30062
+ function _N(e, t) {
30045
30063
  return {
30046
30064
  x: t.includes("w") ? e.x : t.includes("e") ? e.x + e.w : e.x + e.w / 2,
30047
30065
  y: t.includes("n") ? e.y : t.includes("s") ? e.y + e.h : e.y + e.h / 2
30048
30066
  };
30049
30067
  }
30050
- function mN(e, t, n) {
30068
+ function vN(e, t, n) {
30051
30069
  let r = (e, t, n) => Math.abs(e - t) <= n, i = r(t.x, e.x, n.x), a = r(t.x, e.x + e.w, n.x), o = r(t.y, e.y, n.y), s = r(t.y, e.y + e.h, n.y), c = t.x >= e.x - n.x && t.x <= e.x + e.w + n.x, l = t.y >= e.y - n.y && t.y <= e.y + e.h + n.y;
30052
30070
  return !c || !l ? null : o && i ? "nw" : o && a ? "ne" : s && i ? "sw" : s && a ? "se" : o ? "n" : s ? "s" : i ? "w" : a ? "e" : t.x >= e.x && t.x <= e.x + e.w && t.y >= e.y && t.y <= e.y + e.h ? "body" : null;
30053
30071
  }
30054
30072
  //#endregion
30055
30073
  //#region src/page/frames/lib/retrain-zoom.ts
30056
- var hN = {
30074
+ var yN = {
30057
30075
  x: 0,
30058
30076
  y: 0,
30059
30077
  w: 1,
30060
30078
  h: 1
30061
- }, gN = 1.5;
30062
- function _N(e, t, n) {
30079
+ }, bN = 1.5;
30080
+ function xN(e, t, n) {
30063
30081
  return e < t ? t : e > n ? n : e;
30064
30082
  }
30065
- function vN(e) {
30083
+ function SN(e) {
30066
30084
  return 1 / e.w;
30067
30085
  }
30068
- function yN(e, t, n, r) {
30086
+ function CN(e, t, n, r) {
30069
30087
  return {
30070
- x: _N(r.x + (e - n.left) / n.width * r.w, 0, 1),
30071
- y: _N(r.y + (t - n.top) / n.height * r.h, 0, 1)
30088
+ x: xN(r.x + (e - n.left) / n.width * r.w, 0, 1),
30089
+ y: xN(r.y + (t - n.top) / n.height * r.h, 0, 1)
30072
30090
  };
30073
30091
  }
30074
- function bN(e, t, n) {
30092
+ function wN(e, t, n) {
30075
30093
  return {
30076
30094
  x: t.left + (e.x - n.x) / n.w * t.width,
30077
30095
  y: t.top + (e.y - n.y) / n.h * t.height
30078
30096
  };
30079
30097
  }
30080
- function xN(e, t, n) {
30081
- let r = bN(e, t, n);
30098
+ function TN(e, t, n) {
30099
+ let r = wN(e, t, n);
30082
30100
  return {
30083
30101
  left: r.x,
30084
30102
  top: r.y,
@@ -30086,7 +30104,7 @@ function xN(e, t, n) {
30086
30104
  height: e.h / n.h * t.height
30087
30105
  };
30088
30106
  }
30089
- function SN(e, t) {
30107
+ function EN(e, t) {
30090
30108
  return {
30091
30109
  left: e.left - t.x / t.w * e.width,
30092
30110
  top: e.top - t.y / t.h * e.height,
@@ -30094,24 +30112,24 @@ function SN(e, t) {
30094
30112
  height: e.height / t.h
30095
30113
  };
30096
30114
  }
30097
- function CN(e, t, n) {
30098
- let r = _N(e.w / n, 1 / 16, 1), i = r / e.w;
30115
+ function DN(e, t, n) {
30116
+ let r = xN(e.w / n, 1 / 16, 1), i = r / e.w;
30099
30117
  return {
30100
- x: _N(t.x - (t.x - e.x) * i, 0, 1 - r),
30101
- y: _N(t.y - (t.y - e.y) * i, 0, 1 - r),
30118
+ x: xN(t.x - (t.x - e.x) * i, 0, 1 - r),
30119
+ y: xN(t.y - (t.y - e.y) * i, 0, 1 - r),
30102
30120
  w: r,
30103
30121
  h: r
30104
30122
  };
30105
30123
  }
30106
- function wN(e, t, n) {
30124
+ function ON(e, t, n) {
30107
30125
  return {
30108
- x: _N(e.x + t, 0, 1 - e.w),
30109
- y: _N(e.y + n, 0, 1 - e.h),
30126
+ x: xN(e.x + t, 0, 1 - e.w),
30127
+ y: xN(e.y + n, 0, 1 - e.h),
30110
30128
  w: e.w,
30111
30129
  h: e.h
30112
30130
  };
30113
30131
  }
30114
- function TN(e) {
30132
+ function kN(e) {
30115
30133
  return {
30116
30134
  x: e.x + e.w / 2,
30117
30135
  y: e.y + e.h / 2
@@ -30119,7 +30137,7 @@ function TN(e) {
30119
30137
  }
30120
30138
  //#endregion
30121
30139
  //#region src/page/frames/lib/retrain-shortcuts.ts
30122
- var EN = [
30140
+ var AN = [
30123
30141
  "person",
30124
30142
  "vehicle",
30125
30143
  "animal",
@@ -30127,12 +30145,12 @@ var EN = [
30127
30145
  "face",
30128
30146
  "plate"
30129
30147
  ];
30130
- function DN(e) {
30148
+ function jN(e) {
30131
30149
  if (typeof e != "object" || !e || !("tagName" in e)) return !1;
30132
30150
  let t = String(e.tagName).toUpperCase();
30133
30151
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" ? !0 : "isContentEditable" in e && e.isContentEditable === !0;
30134
30152
  }
30135
- function ON(e) {
30153
+ function MN(e) {
30136
30154
  let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
30137
30155
  if (t && !e.altKey) return n === "s" && !e.shiftKey ? { kind: "save" } : e.typing ? null : n === "z" ? e.shiftKey ? { kind: "redo" } : { kind: "undo" } : n === "y" && !e.shiftKey ? { kind: "redo" } : null;
30138
30156
  if (e.typing || t || e.altKey) return null;
@@ -30151,8 +30169,8 @@ function ON(e) {
30151
30169
  default: break;
30152
30170
  }
30153
30171
  let r = Number.parseInt(e.key, 10);
30154
- if (Number.isInteger(r) && r >= 1 && r <= EN.length) {
30155
- let e = EN[r - 1];
30172
+ if (Number.isInteger(r) && r >= 1 && r <= AN.length) {
30173
+ let e = AN[r - 1];
30156
30174
  return e === void 0 ? null : {
30157
30175
  kind: "set-class",
30158
30176
  macroClass: e
@@ -30160,7 +30178,7 @@ function ON(e) {
30160
30178
  }
30161
30179
  return n === "a" ? e.shiftKey ? { kind: "accept-all" } : { kind: "accept" } : n === "e" && !e.shiftKey ? { kind: "toggle-model-error" } : n === "c" && !e.shiftKey ? { kind: "toggle-complete" } : null;
30162
30180
  }
30163
- var kN = [
30181
+ var NN = [
30164
30182
  {
30165
30183
  keys: "← / →",
30166
30184
  does: "Previous / next frame"
@@ -30229,13 +30247,13 @@ var kN = [
30229
30247
  //#endregion
30230
30248
  //#region src/page/frames/RetrainCanvas.tsx
30231
30249
  i();
30232
- var AN = .0015, jN = {
30250
+ var PN = .0015, FN = {
30233
30251
  pipeline: "var(--color-foreground-muted)",
30234
30252
  assist: "var(--color-info)",
30235
30253
  llm: "var(--color-warning)",
30236
30254
  operator: "var(--color-success)"
30237
30255
  };
30238
- function MN(e, t) {
30256
+ function IN(e, t) {
30239
30257
  return e.kind === "model_error" ? {
30240
30258
  color: "var(--color-danger)",
30241
30259
  dashed: !0,
@@ -30245,7 +30263,7 @@ function MN(e, t) {
30245
30263
  dashed: e.draft,
30246
30264
  opacity: 1
30247
30265
  } : e.draft ? {
30248
- color: jN[e.source],
30266
+ color: FN[e.source],
30249
30267
  dashed: !0,
30250
30268
  opacity: .8
30251
30269
  } : {
@@ -30254,16 +30272,16 @@ function MN(e, t) {
30254
30272
  opacity: 1
30255
30273
  };
30256
30274
  }
30257
- function NN(e, t) {
30275
+ function LN(e, t) {
30258
30276
  return Math.hypot(e.x - t.x, e.y - t.y);
30259
30277
  }
30260
- function PN(e, t) {
30278
+ function RN(e, t) {
30261
30279
  return {
30262
30280
  x: (e.x + t.x) / 2,
30263
30281
  y: (e.y + t.y) / 2
30264
30282
  };
30265
30283
  }
30266
- function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey: i, viewport: o, onViewportChange: c, panMode: l, onSelect: d, onDraw: f, onGestureStart: p, onGestureBox: m, onGestureEnd: h }) {
30284
+ function zN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey: i, viewport: o, onViewportChange: c, panMode: l, onSelect: d, onDraw: f, onGestureStart: p, onGestureBox: m, onGestureEnd: h }) {
30267
30285
  let _ = u(null), [v, b] = a({
30268
30286
  w: 0,
30269
30287
  h: 0
@@ -30281,10 +30299,10 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30281
30299
  n.disconnect();
30282
30300
  };
30283
30301
  }, []);
30284
- let D = iN(v.w, v.h, t, n);
30302
+ let D = cN(v.w, v.h, t, n);
30285
30303
  y(() => {
30286
30304
  let e = (e) => {
30287
- e.key !== " " || DN(e.target) || (e.preventDefault(), w(!0));
30305
+ e.key !== " " || jN(e.target) || (e.preventDefault(), w(!0));
30288
30306
  }, t = (e) => {
30289
30307
  e.key === " " && w(!1);
30290
30308
  };
@@ -30309,7 +30327,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30309
30327
  if (n === null) return;
30310
30328
  t.preventDefault();
30311
30329
  let a = e.getBoundingClientRect();
30312
- i(CN(r, yN(t.clientX - a.left, t.clientY - a.top, n, r), Math.exp(-t.deltaY * AN)));
30330
+ i(DN(r, CN(t.clientX - a.left, t.clientY - a.top, n, r), Math.exp(-t.deltaY * PN)));
30313
30331
  };
30314
30332
  return e.addEventListener("wheel", t, { passive: !1 }), () => {
30315
30333
  e.removeEventListener("wheel", t);
@@ -30321,7 +30339,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30321
30339
  x: e.clientX - (t?.left ?? 0),
30322
30340
  y: e.clientY - (t?.top ?? 0)
30323
30341
  };
30324
- }, []), A = s((e) => D === null ? null : yN(e.x, e.y, D, o), [D, o]), j = s(() => {
30342
+ }, []), A = s((e) => D === null ? null : CN(e.x, e.y, D, o), [D, o]), j = s(() => {
30325
30343
  let e = E.current;
30326
30344
  (e.mode === "move" || e.mode === "resize") && h(), e.mode === "draw" && S(null), E.current = { mode: "none" };
30327
30345
  }, [h]), M = (e) => {
@@ -30331,11 +30349,11 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30331
30349
  j();
30332
30350
  let [e, t] = [...T.current.values()];
30333
30351
  if (e === void 0 || t === void 0) return;
30334
- let n = PN(e, t);
30352
+ let n = RN(e, t);
30335
30353
  E.current = {
30336
30354
  mode: "pinch",
30337
- startDistance: Math.max(1, NN(e, t)),
30338
- anchor: yN(n.x, n.y, D, o),
30355
+ startDistance: Math.max(1, LN(e, t)),
30356
+ anchor: CN(n.x, n.y, D, o),
30339
30357
  from: o
30340
30358
  };
30341
30359
  return;
@@ -30350,12 +30368,12 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30350
30368
  return;
30351
30369
  }
30352
30370
  if (e.button !== 0) return;
30353
- let n = yN(t.x, t.y, D, o), a = {
30371
+ let n = CN(t.x, t.y, D, o), a = {
30354
30372
  x: 12 / D.width * o.w,
30355
30373
  y: 12 / D.height * o.h
30356
30374
  }, s = r.find((e) => e.key === i);
30357
30375
  if (s !== void 0) {
30358
- let e = mN(s.bbox, n, a);
30376
+ let e = vN(s.bbox, n, a);
30359
30377
  if (e !== null && e !== "body") {
30360
30378
  p(), E.current = {
30361
30379
  mode: "resize",
@@ -30366,7 +30384,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30366
30384
  return;
30367
30385
  }
30368
30386
  }
30369
- let c = r[cN(r.map((e) => e.bbox), n)];
30387
+ let c = r[fN(r.map((e) => e.bbox), n)];
30370
30388
  if (c !== void 0) {
30371
30389
  c.key !== i && d(c.key), p(), E.current = {
30372
30390
  mode: "move",
@@ -30379,7 +30397,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30379
30397
  E.current = {
30380
30398
  mode: "draw",
30381
30399
  start: n
30382
- }, S(aN(n, n));
30400
+ }, S(lN(n, n));
30383
30401
  }, N = (e) => {
30384
30402
  if (!T.current.has(e.pointerId) || D === null) return;
30385
30403
  let t = k(e);
@@ -30389,28 +30407,28 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30389
30407
  case "pinch": {
30390
30408
  let [e, t] = [...T.current.values()];
30391
30409
  if (e === void 0 || t === void 0) return;
30392
- let r = CN(n.from, n.anchor, NN(e, t) / n.startDistance), i = PN(e, t), a = yN(i.x, i.y, D, r);
30393
- c(wN(r, n.anchor.x - a.x, n.anchor.y - a.y));
30410
+ let r = DN(n.from, n.anchor, LN(e, t) / n.startDistance), i = RN(e, t), a = CN(i.x, i.y, D, r);
30411
+ c(ON(r, n.anchor.x - a.x, n.anchor.y - a.y));
30394
30412
  return;
30395
30413
  }
30396
30414
  case "pan": {
30397
30415
  let e = (t.x - n.startPx.x) / D.width * n.from.w, r = (t.y - n.startPx.y) / D.height * n.from.h;
30398
- c(wN(n.from, -e, -r));
30416
+ c(ON(n.from, -e, -r));
30399
30417
  return;
30400
30418
  }
30401
30419
  case "move": {
30402
- let e = yN(t.x, t.y, D, o);
30403
- m(n.key, uN(n.from, e.x - n.start.x, e.y - n.start.y));
30420
+ let e = CN(t.x, t.y, D, o);
30421
+ m(n.key, mN(n.from, e.x - n.start.x, e.y - n.start.y));
30404
30422
  return;
30405
30423
  }
30406
30424
  case "resize": {
30407
- let e = yN(t.x, t.y, D, o);
30408
- m(n.key, fN(n.from, n.handle, e));
30425
+ let e = CN(t.x, t.y, D, o);
30426
+ m(n.key, gN(n.from, n.handle, e));
30409
30427
  return;
30410
30428
  }
30411
30429
  case "draw": {
30412
- let e = yN(t.x, t.y, D, o);
30413
- S(aN(n.start, e));
30430
+ let e = CN(t.x, t.y, D, o);
30431
+ S(lN(n.start, e));
30414
30432
  return;
30415
30433
  }
30416
30434
  default: return;
@@ -30424,12 +30442,12 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30424
30442
  return;
30425
30443
  }
30426
30444
  if (t.mode === "draw") {
30427
- let n = A(k(e)), r = n === null ? null : aN(t.start, n);
30428
- S(null), E.current = { mode: "none" }, r !== null && sN(r) ? f(r) : d(null);
30445
+ let n = A(k(e)), r = n === null ? null : lN(t.start, n);
30446
+ S(null), E.current = { mode: "none" }, r !== null && dN(r) ? f(r) : d(null);
30429
30447
  return;
30430
30448
  }
30431
30449
  j();
30432
- }, F = r.find((e) => e.key === i), I = C || l, ee = D === null ? null : SN(D, o);
30450
+ }, F = r.find((e) => e.key === i), I = C || l, ee = D === null ? null : EN(D, o);
30433
30451
  return /* @__PURE__ */ H("div", {
30434
30452
  ref: _,
30435
30453
  "data-testid": "retrain-canvas",
@@ -30448,7 +30466,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30448
30466
  style: ee
30449
30467
  }),
30450
30468
  D !== null && r.map((e) => {
30451
- let t = xN(e.bbox, D, o), n = e.key === i, r = MN(e, n);
30469
+ let t = TN(e.bbox, D, o), n = e.key === i, r = IN(e, n);
30452
30470
  return /* @__PURE__ */ V("div", {
30453
30471
  "data-testid": `retrain-box-${e.key}`,
30454
30472
  "data-draft": e.draft ? "true" : "false",
@@ -30474,8 +30492,8 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30474
30492
  })
30475
30493
  }, e.key);
30476
30494
  }),
30477
- D !== null && F !== void 0 && lN.map((e) => {
30478
- let t = bN(pN(F.bbox, e), D, o);
30495
+ D !== null && F !== void 0 && pN.map((e) => {
30496
+ let t = wN(_N(F.bbox, e), D, o);
30479
30497
  return /* @__PURE__ */ V("div", {
30480
30498
  "data-testid": `retrain-handle-${e}`,
30481
30499
  className: "absolute h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-sm border border-background bg-primary pointer-events-none",
@@ -30487,7 +30505,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30487
30505
  }),
30488
30506
  x !== null && D !== null && /* @__PURE__ */ V("div", {
30489
30507
  className: "absolute border border-dashed border-primary pointer-events-none",
30490
- style: xN(x, D, o)
30508
+ style: TN(x, D, o)
30491
30509
  })
30492
30510
  ]
30493
30511
  });
@@ -30495,19 +30513,19 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30495
30513
  //#endregion
30496
30514
  //#region src/page/frames/RetrainCanvasToolbar.tsx
30497
30515
  i();
30498
- function IN() {
30499
- let [e, t] = a(hN), [n, r] = a(!1);
30516
+ function BN() {
30517
+ let [e, t] = a(yN), [n, r] = a(!1);
30500
30518
  return {
30501
30519
  viewport: e,
30502
30520
  setViewport: t,
30503
30521
  zoomIn: s(() => {
30504
- t((e) => CN(e, TN(e), gN));
30522
+ t((e) => DN(e, kN(e), bN));
30505
30523
  }, []),
30506
30524
  zoomOut: s(() => {
30507
- t((e) => CN(e, TN(e), 1 / gN));
30525
+ t((e) => DN(e, kN(e), 1 / bN));
30508
30526
  }, []),
30509
30527
  fit: s(() => {
30510
- t(hN);
30528
+ t(yN);
30511
30529
  }, []),
30512
30530
  panMode: n,
30513
30531
  togglePan: s(() => {
@@ -30515,8 +30533,8 @@ function IN() {
30515
30533
  }, [])
30516
30534
  };
30517
30535
  }
30518
- function LN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
30519
- let a = vN(e.viewport);
30536
+ function VN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
30537
+ let a = SN(e.viewport);
30520
30538
  return /* @__PURE__ */ H("div", {
30521
30539
  className: "flex items-center gap-1 px-2 py-1 border-b border-border bg-surface",
30522
30540
  children: [
@@ -30582,7 +30600,7 @@ function LN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
30582
30600
  children: "Keyboard and gestures"
30583
30601
  }), /* @__PURE__ */ V("table", {
30584
30602
  className: "w-full text-[11px]",
30585
- children: /* @__PURE__ */ V("tbody", { children: kN.map((e) => /* @__PURE__ */ H("tr", {
30603
+ children: /* @__PURE__ */ V("tbody", { children: NN.map((e) => /* @__PURE__ */ H("tr", {
30586
30604
  className: "align-top",
30587
30605
  children: [/* @__PURE__ */ V("td", {
30588
30606
  className: "py-0.5 pr-2 font-mono whitespace-nowrap text-foreground",
@@ -30597,7 +30615,7 @@ function LN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
30597
30615
  ]
30598
30616
  });
30599
30617
  }
30600
- function RN(e) {
30618
+ function HN(e) {
30601
30619
  return {
30602
30620
  past: [],
30603
30621
  present: e,
@@ -30605,25 +30623,25 @@ function RN(e) {
30605
30623
  gestureBase: null
30606
30624
  };
30607
30625
  }
30608
- function zN(e, t) {
30626
+ function UN(e, t) {
30609
30627
  let n = [...e, t];
30610
30628
  return n.length > 100 ? n.slice(n.length - 100) : n;
30611
30629
  }
30612
- function BN(e, t) {
30630
+ function WN(e, t) {
30613
30631
  return t === e.present ? e : {
30614
- past: zN(e.past, e.present),
30632
+ past: UN(e.past, e.present),
30615
30633
  present: t,
30616
30634
  future: [],
30617
30635
  gestureBase: null
30618
30636
  };
30619
30637
  }
30620
- function VN(e, t) {
30638
+ function GN(e, t) {
30621
30639
  return {
30622
30640
  ...e,
30623
30641
  present: t
30624
30642
  };
30625
30643
  }
30626
- function HN(e) {
30644
+ function KN(e) {
30627
30645
  let t = e.past[e.past.length - 1];
30628
30646
  return t === void 0 ? e : {
30629
30647
  past: e.past.slice(0, -1),
@@ -30632,68 +30650,68 @@ function HN(e) {
30632
30650
  gestureBase: null
30633
30651
  };
30634
30652
  }
30635
- function UN(e) {
30653
+ function qN(e) {
30636
30654
  let [t, ...n] = e.future;
30637
30655
  return t === void 0 ? e : {
30638
- past: zN(e.past, e.present),
30656
+ past: UN(e.past, e.present),
30639
30657
  present: t,
30640
30658
  future: n,
30641
30659
  gestureBase: null
30642
30660
  };
30643
30661
  }
30644
- function WN(e) {
30662
+ function JN(e) {
30645
30663
  return {
30646
30664
  ...e,
30647
30665
  gestureBase: e.present
30648
30666
  };
30649
30667
  }
30650
- function GN(e, t) {
30668
+ function YN(e, t) {
30651
30669
  return {
30652
30670
  ...e,
30653
30671
  present: t
30654
30672
  };
30655
30673
  }
30656
- function KN(e) {
30674
+ function XN(e) {
30657
30675
  let t = e.gestureBase;
30658
30676
  return t === null ? e : t === e.present ? {
30659
30677
  ...e,
30660
30678
  gestureBase: null
30661
30679
  } : {
30662
- past: zN(e.past, t),
30680
+ past: UN(e.past, t),
30663
30681
  present: e.present,
30664
30682
  future: [],
30665
30683
  gestureBase: null
30666
30684
  };
30667
30685
  }
30668
- function qN(e) {
30686
+ function ZN(e) {
30669
30687
  return e.past.length > 0;
30670
30688
  }
30671
- function JN(e) {
30689
+ function QN(e) {
30672
30690
  return e.future.length > 0;
30673
30691
  }
30674
30692
  //#endregion
30675
30693
  //#region src/page/frames/use-retrain-editor-history.ts
30676
30694
  i();
30677
- function YN(e, t) {
30695
+ function $N(e, t) {
30678
30696
  return typeof e == "function" ? e(t) : e;
30679
30697
  }
30680
- function XN(e) {
30681
- let [t, n] = a(() => RN(e())), r = s((e) => {
30682
- n((t) => BN(t, YN(e, t.present)));
30698
+ function eP(e) {
30699
+ let [t, n] = a(() => HN(e())), r = s((e) => {
30700
+ n((t) => WN(t, $N(e, t.present)));
30683
30701
  }, []), i = s((e) => {
30684
- n(RN(e));
30702
+ n(HN(e));
30685
30703
  }, []), o = s((e) => {
30686
- n((t) => VN(t, YN(e, t.present)));
30704
+ n((t) => GN(t, $N(e, t.present)));
30687
30705
  }, []), c = s(() => {
30688
- n((e) => WN(e));
30706
+ n((e) => JN(e));
30689
30707
  }, []), l = s((e) => {
30690
- n((t) => GN(t, YN(e, t.present)));
30708
+ n((t) => YN(t, $N(e, t.present)));
30691
30709
  }, []), u = s(() => {
30692
- n((e) => KN(e));
30710
+ n((e) => XN(e));
30693
30711
  }, []), d = s(() => {
30694
- n((e) => HN(e));
30712
+ n((e) => KN(e));
30695
30713
  }, []), f = s(() => {
30696
- n((e) => UN(e));
30714
+ n((e) => qN(e));
30697
30715
  }, []);
30698
30716
  return {
30699
30717
  editor: t.present,
@@ -30705,20 +30723,20 @@ function XN(e) {
30705
30723
  endGesture: u,
30706
30724
  undo: d,
30707
30725
  redo: f,
30708
- canUndo: qN(t),
30709
- canRedo: JN(t)
30726
+ canUndo: ZN(t),
30727
+ canRedo: QN(t)
30710
30728
  };
30711
30729
  }
30712
30730
  //#endregion
30713
30731
  //#region src/page/frames/use-retrain-shortcuts.ts
30714
30732
  i();
30715
- function ZN(e, t) {
30733
+ function tP(e, t) {
30716
30734
  let n = e.boxes.length;
30717
30735
  if (n === 0) return null;
30718
30736
  let r = e.boxes.findIndex((t) => t.key === e.selectedKey), i = r < 0 ? t === 1 ? 0 : n - 1 : (r + t + n) % n;
30719
30737
  return e.boxes[i]?.key ?? null;
30720
30738
  }
30721
- function QN(e, t) {
30739
+ function nP(e, t) {
30722
30740
  let { history: n } = t, r = n.editor.selectedKey;
30723
30741
  switch (e.kind) {
30724
30742
  case "next-frame": return t.onNextFrame();
@@ -30730,39 +30748,39 @@ function QN(e, t) {
30730
30748
  case "zoom-in": return t.onZoomIn(), !0;
30731
30749
  case "zoom-out": return t.onZoomOut(), !0;
30732
30750
  case "zoom-fit": return t.onZoomFit(), !0;
30733
- case "accept-all": return n.setEditor((e) => PM(e)), !0;
30751
+ case "accept-all": return n.setEditor((e) => RM(e)), !0;
30734
30752
  case "select-next":
30735
30753
  case "select-prev": {
30736
- let t = ZN(n.editor, e.kind === "select-next" ? 1 : -1);
30737
- return t === null ? !1 : (n.selectOnly((e) => LM(e, t)), !0);
30754
+ let t = tP(n.editor, e.kind === "select-next" ? 1 : -1);
30755
+ return t === null ? !1 : (n.selectOnly((e) => VM(e, t)), !0);
30738
30756
  }
30739
- case "deselect": return r === null ? !1 : (n.selectOnly((e) => LM(e, null)), !0);
30757
+ case "deselect": return r === null ? !1 : (n.selectOnly((e) => VM(e, null)), !0);
30740
30758
  default: break;
30741
30759
  }
30742
30760
  if (r === null) return !1;
30743
30761
  switch (e.kind) {
30744
- case "delete": return n.setEditor((e) => IM(e, r)), !0;
30745
- case "set-class": return n.setEditor((t) => MM(t, r, { macroClass: e.macroClass })), !0;
30746
- case "accept": return n.setEditor((e) => NM(e, r)), !0;
30747
- case "toggle-model-error": return n.setEditor((e) => FM(e, r)), !0;
30762
+ case "delete": return n.setEditor((e) => BM(e, r)), !0;
30763
+ case "set-class": return n.setEditor((t) => IM(t, r, { macroClass: e.macroClass })), !0;
30764
+ case "accept": return n.setEditor((e) => LM(e, r)), !0;
30765
+ case "toggle-model-error": return n.setEditor((e) => zM(e, r)), !0;
30748
30766
  default: return !1;
30749
30767
  }
30750
30768
  }
30751
- function $N(e, t) {
30769
+ function rP(e, t) {
30752
30770
  let n = u(t);
30753
30771
  n.current = t, y(() => {
30754
30772
  if (!e) return;
30755
30773
  let t = (e) => {
30756
30774
  if (e.defaultPrevented || e.isComposing) return;
30757
- let t = ON({
30775
+ let t = MN({
30758
30776
  key: e.key,
30759
30777
  ctrlKey: e.ctrlKey,
30760
30778
  metaKey: e.metaKey,
30761
30779
  shiftKey: e.shiftKey,
30762
30780
  altKey: e.altKey,
30763
- typing: DN(e.target)
30781
+ typing: jN(e.target)
30764
30782
  });
30765
- t !== null && QN(t, n.current) && e.preventDefault();
30783
+ t !== null && nP(t, n.current) && e.preventDefault();
30766
30784
  };
30767
30785
  return window.addEventListener("keydown", t), () => {
30768
30786
  window.removeEventListener("keydown", t);
@@ -30772,7 +30790,7 @@ function $N(e, t) {
30772
30790
  //#endregion
30773
30791
  //#region src/page/frames/RetrainWorkbench.tsx
30774
30792
  i();
30775
- var eP = "person", tP = {
30793
+ var iP = "person", aP = {
30776
30794
  pending: "Reading which detector this camera runs…",
30777
30795
  "placement-unreadable": "The detection stage of this camera could not be read, so the model it runs is unknown — not absent.",
30778
30796
  "detection-off": "This camera runs no object detector, so there is no proposal to mirror.",
@@ -30781,8 +30799,8 @@ var eP = "person", tP = {
30781
30799
  "step-unknown": "That node carries no object-detection step in its catalog.",
30782
30800
  "no-model": "No object-detection model on that accelerator can be resolved for this camera."
30783
30801
  };
30784
- function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r, onSaved: i, setNotice: o }) {
30785
- let c = e.find((e) => e.frameId === t), l = c?.deviceId ?? null, d = XN(() => OM([], [])), { editor: f, setEditor: p, resetEditor: h, selectOnly: g } = d, _ = IN(), v = rc({ frameIds: [t] }), b = tc({ frameId: t }), x = nc(), S = ic(), C = oc(), w = _c({ deviceIds: l === null ? [] : [l] }, {
30802
+ function oP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r, onSaved: i, setNotice: o }) {
30803
+ let c = e.find((e) => e.frameId === t), l = c?.deviceId ?? null, d = eP(() => MM([], [])), { editor: f, setEditor: p, resetEditor: h, selectOnly: g } = d, _ = BN(), v = rc({ frameIds: [t] }), b = tc({ frameId: t }), x = nc(), S = ic(), C = oc(), w = _c({ deviceIds: l === null ? [] : [l] }, {
30786
30804
  enabled: l !== null,
30787
30805
  staleTime: 3e4
30788
30806
  }), T = w.data?.[0]?.detection?.nodeId ?? null, E = hc({ nodeId: T ?? "" }, {
@@ -30794,7 +30812,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30794
30812
  }), O = gc({ deviceId: l ?? 0 }, {
30795
30813
  enabled: l !== null,
30796
30814
  staleTime: 3e4
30797
- }), k = m(() => SM({
30815
+ }), k = m(() => EM({
30798
30816
  status: w.data?.[0],
30799
30817
  nodeDevices: E.data,
30800
30818
  schema: D.data,
@@ -30816,7 +30834,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30816
30834
  y(() => {
30817
30835
  _.fit();
30818
30836
  let { stored: e, copy: n } = A.current;
30819
- h(OM((e ?? []).filter((e) => e.mediaKey === t), n?.pipelineBoxes ?? []));
30837
+ h(MM((e ?? []).filter((e) => e.mediaKey === t), n?.pipelineBoxes ?? []));
30820
30838
  }, [
30821
30839
  t,
30822
30840
  v.dataUpdatedAt,
@@ -30826,7 +30844,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30826
30844
  ]);
30827
30845
  let M = s(async (e) => {
30828
30846
  c !== void 0 && (await C.mutateAsync({
30829
- ...QM(c),
30847
+ ...nN(c),
30830
30848
  complete: e
30831
30849
  }), await r());
30832
30850
  }, [
@@ -30836,11 +30854,11 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30836
30854
  ]), N = s(async (e) => {
30837
30855
  if (c === void 0) return;
30838
30856
  if (o(null), k.kind !== "resolved") {
30839
- o(tP[k.gap]);
30857
+ o(aP[k.gap]);
30840
30858
  return;
30841
30859
  }
30842
30860
  let t = await x.mutateAsync({
30843
- ...QM(c),
30861
+ ...nN(c),
30844
30862
  subject: e === "package" ? { kind: "package" } : {
30845
30863
  kind: "objects",
30846
30864
  modelId: k.modelId,
@@ -30852,7 +30870,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30852
30870
  o(t.reason === "no-zone" ? "A package proposal runs on the zone crop only — this camera has no zone, and running the detector on the whole frame at 0.35 proposes furniture." : `The pipeline refused: ${t.reason}${t.detail === void 0 ? "" : ` — ${t.detail}`}`);
30853
30871
  return;
30854
30872
  }
30855
- let n = kM(f, t.proposals.map((e) => ({
30873
+ let n = NM(f, t.proposals.map((e) => ({
30856
30874
  bbox: e.bbox,
30857
30875
  macroClass: e.macroClass,
30858
30876
  ...e.label === void 0 ? {} : { label: e.label },
@@ -30871,15 +30889,15 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30871
30889
  p,
30872
30890
  o
30873
30891
  ]), P = s((e) => {
30874
- p((t) => AM(t, e, eP));
30892
+ p((t) => PM(t, e, iP));
30875
30893
  }, [p]), [F, I] = a(!1), ee = s(async () => {
30876
30894
  if (c === void 0) return;
30877
- let e = BM(f);
30895
+ let e = WM(f);
30878
30896
  I(!0);
30879
30897
  try {
30880
30898
  await S.mutateAsync({
30881
- ...QM(c),
30882
- annotations: [...HM(f)]
30899
+ ...nN(c),
30900
+ annotations: [...KM(f)]
30883
30901
  }), await v.refetch();
30884
30902
  } finally {
30885
30903
  I(!1);
@@ -30892,11 +30910,11 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30892
30910
  v,
30893
30911
  i,
30894
30912
  o
30895
- ]), te = b.data, ne = YM(f.boxes) && c !== void 0, re = BM(f), ie = e.map((e) => e.frameId), L = (e) => {
30913
+ ]), te = b.data, ne = $M(f.boxes) && c !== void 0, re = WM(f), ie = e.map((e) => e.frameId), L = (e) => {
30896
30914
  let r = ie.indexOf(t), i = ie[r + e];
30897
30915
  return r < 0 || i === void 0 ? !1 : (n(i), !0);
30898
30916
  };
30899
- return $N(!F, {
30917
+ return rP(!F, {
30900
30918
  history: d,
30901
30919
  onNextFrame: () => L(1),
30902
30920
  onPrevFrame: () => L(-1),
@@ -30910,7 +30928,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30910
30928
  "aria-busy": F,
30911
30929
  children: [/* @__PURE__ */ H("div", {
30912
30930
  className: "rounded-md border border-border overflow-hidden flex flex-col",
30913
- children: [/* @__PURE__ */ V(LN, {
30931
+ children: [/* @__PURE__ */ V(VN, {
30914
30932
  view: _,
30915
30933
  canUndo: d.canUndo,
30916
30934
  canRedo: d.canRedo,
@@ -30919,7 +30937,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30919
30937
  }), te === void 0 ? /* @__PURE__ */ H("div", {
30920
30938
  className: "flex items-center gap-2 p-6 text-xs text-foreground-subtle",
30921
30939
  children: [/* @__PURE__ */ V(hr, { className: "h-3.5 w-3.5 animate-spin" }), "Loading the frame…"]
30922
- }) : /* @__PURE__ */ V(FN, {
30940
+ }) : /* @__PURE__ */ V(zN, {
30923
30941
  imageSrc: `data:image/jpeg;base64,${te.base64}`,
30924
30942
  imageWidth: te.width,
30925
30943
  imageHeight: te.height,
@@ -30929,12 +30947,12 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30929
30947
  onViewportChange: _.setViewport,
30930
30948
  panMode: _.panMode,
30931
30949
  onSelect: (e) => {
30932
- g((t) => LM(t, e));
30950
+ g((t) => VM(t, e));
30933
30951
  },
30934
30952
  onDraw: P,
30935
30953
  onGestureStart: d.beginGesture,
30936
30954
  onGestureBox: (e, t) => {
30937
- d.updateGesture((n) => MM(n, e, { bbox: t }));
30955
+ d.updateGesture((n) => IM(n, e, { bbox: t }));
30938
30956
  },
30939
30957
  onGestureEnd: d.endGesture
30940
30958
  })]
@@ -30976,9 +30994,9 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30976
30994
  }),
30977
30995
  /* @__PURE__ */ V("div", {
30978
30996
  className: "px-3 py-1 border-b border-border text-[11px] text-foreground-subtle",
30979
- children: k.kind === "resolved" ? `Proposals come from ${k.modelId} at ${k.minScore.toFixed(2)}, on ${k.nodeId} — what this camera really runs.` : tP[k.gap]
30997
+ children: k.kind === "resolved" ? `Proposals come from ${k.modelId} at ${k.minScore.toFixed(2)}, on ${k.nodeId} — what this camera really runs.` : aP[k.gap]
30980
30998
  }),
30981
- c !== void 0 && /* @__PURE__ */ V(rN, {
30999
+ c !== void 0 && /* @__PURE__ */ V(sN, {
30982
31000
  frame: c,
30983
31001
  history: d,
30984
31002
  detector: k,
@@ -30987,23 +31005,23 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30987
31005
  }),
30988
31006
  /* @__PURE__ */ V("div", {
30989
31007
  className: "flex-1 overflow-y-auto",
30990
- children: /* @__PURE__ */ V(JM, {
31008
+ children: /* @__PURE__ */ V(QM, {
30991
31009
  boxes: f.boxes,
30992
31010
  selectedKey: f.selectedKey,
30993
31011
  onSelect: (e) => {
30994
- g((t) => LM(t, e));
31012
+ g((t) => VM(t, e));
30995
31013
  },
30996
31014
  onChange: (e, t) => {
30997
- p((n) => MM(n, e, t));
31015
+ p((n) => IM(n, e, t));
30998
31016
  },
30999
31017
  onAccept: (e) => {
31000
- p((t) => NM(t, e));
31018
+ p((t) => LM(t, e));
31001
31019
  },
31002
31020
  onToggleModelError: (e) => {
31003
- p((t) => FM(t, e));
31021
+ p((t) => zM(t, e));
31004
31022
  },
31005
31023
  onDelete: (e) => {
31006
- p((t) => IM(t, e));
31024
+ p((t) => BM(t, e));
31007
31025
  }
31008
31026
  })
31009
31027
  }),
@@ -31036,7 +31054,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
31036
31054
  variant: "secondary",
31037
31055
  size: "sm",
31038
31056
  onClick: () => {
31039
- p((e) => PM(e));
31057
+ p((e) => RM(e));
31040
31058
  },
31041
31059
  children: [/* @__PURE__ */ V(Zt, { className: "h-3 w-3" }), /* @__PURE__ */ V("span", {
31042
31060
  className: "ml-1",
@@ -31063,7 +31081,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
31063
31081
  //#endregion
31064
31082
  //#region src/page/frames/CorpusAnnotateOverlay.tsx
31065
31083
  i();
31066
- function rP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i, onFramesChanged: o, onSaved: s }) {
31084
+ function sP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i, onFramesChanged: o, onSaved: s }) {
31067
31085
  let [c, l] = a(null);
31068
31086
  return y(() => {
31069
31087
  l(null);
@@ -31091,7 +31109,7 @@ function rP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i
31091
31109
  })
31092
31110
  }), /* @__PURE__ */ V(Fp, {
31093
31111
  className: "flex min-h-0 flex-1 flex-col overflow-y-auto p-3 sm:p-4",
31094
- children: /* @__PURE__ */ V(nP, {
31112
+ children: /* @__PURE__ */ V(oP, {
31095
31113
  frames: t,
31096
31114
  activeFrameId: n,
31097
31115
  onActiveFrame: r,
@@ -31106,7 +31124,7 @@ function rP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i
31106
31124
  //#endregion
31107
31125
  //#region src/page/frames/RetrainCollectionsList.tsx
31108
31126
  i();
31109
- function iP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: o, onDelete: s }) {
31127
+ function cP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: o, onDelete: s }) {
31110
31128
  let [c, l] = a(""), [u, d] = a(null), [f, p] = a(null), m = async () => {
31111
31129
  let e = await i(c);
31112
31130
  d(e), e === null && l("");
@@ -31214,19 +31232,19 @@ function iP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate
31214
31232
  }
31215
31233
  //#endregion
31216
31234
  //#region src/page/frames/CorpusCollectionsSection.tsx
31217
- var aP = {
31235
+ var lP = {
31218
31236
  "empty-name": "Give the collection a name.",
31219
31237
  "duplicate-name": "A collection with that name already exists.",
31220
31238
  "unknown-collection": "That collection no longer exists."
31221
31239
  };
31222
- function oP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: a, onDelete: o }) {
31240
+ function uP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: a, onDelete: o }) {
31223
31241
  return /* @__PURE__ */ V(Wg, {
31224
31242
  headingId: "corpus-collections-heading",
31225
31243
  title: "Collections",
31226
31244
  testId: "corpus-collections",
31227
31245
  children: /* @__PURE__ */ V("div", {
31228
31246
  className: w,
31229
- children: /* @__PURE__ */ V(iP, {
31247
+ children: /* @__PURE__ */ V(cP, {
31230
31248
  collections: e ?? [],
31231
31249
  isLoading: t,
31232
31250
  selectedId: n,
@@ -31240,8 +31258,8 @@ function oP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate
31240
31258
  }
31241
31259
  //#endregion
31242
31260
  //#region src/page/frames/lib/authed-download.ts
31243
- var sP = "camstack_admin_token", cP = 6e4;
31244
- function lP(e) {
31261
+ var dP = "camstack_admin_token", fP = 6e4;
31262
+ function pP(e) {
31245
31263
  if (e === null) return null;
31246
31264
  let t = /filename\*=UTF-8''([^;]+)/i.exec(e);
31247
31265
  if (t?.[1] !== void 0) try {
@@ -31249,20 +31267,20 @@ function lP(e) {
31249
31267
  } catch {}
31250
31268
  return /filename="?([^";]+)"?/i.exec(e)?.[1]?.trim() ?? null;
31251
31269
  }
31252
- async function uP(e, t) {
31253
- let n = localStorage.getItem(sP), r = {};
31270
+ async function mP(e, t) {
31271
+ let n = localStorage.getItem(dP), r = {};
31254
31272
  n !== null && (r.Authorization = `Bearer ${n}`);
31255
31273
  let i = await fetch(e, { headers: r });
31256
31274
  if (!i.ok) throw Error(`download failed: ${String(i.status)}`);
31257
- let a = await i.blob(), o = lP(i.headers.get("content-disposition")) ?? t, s = URL.createObjectURL(a), c = document.createElement("a");
31275
+ let a = await i.blob(), o = pP(i.headers.get("content-disposition")) ?? t, s = URL.createObjectURL(a), c = document.createElement("a");
31258
31276
  c.href = s, c.download = o, c.click(), setTimeout(() => {
31259
31277
  URL.revokeObjectURL(s);
31260
- }, cP);
31278
+ }, fP);
31261
31279
  }
31262
31280
  //#endregion
31263
31281
  //#region src/page/frames/CorpusFilterBar.tsx
31264
31282
  i();
31265
- var dP = [
31283
+ var hP = [
31266
31284
  {
31267
31285
  value: void 0,
31268
31286
  label: "All"
@@ -31279,7 +31297,7 @@ var dP = [
31279
31297
  value: "complete",
31280
31298
  label: "Complete"
31281
31299
  }
31282
- ], fP = [
31300
+ ], gP = [
31283
31301
  "person",
31284
31302
  "vehicle",
31285
31303
  "animal",
@@ -31287,10 +31305,10 @@ var dP = [
31287
31305
  "face",
31288
31306
  "plate"
31289
31307
  ];
31290
- function pP(e) {
31308
+ function _P(e) {
31291
31309
  return e ?? "all";
31292
31310
  }
31293
- function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, collections: i, collectionsPending: o }) {
31311
+ function vP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, collections: i, collectionsPending: o }) {
31294
31312
  let s = ac(m(() => ({
31295
31313
  ...e.workState === void 0 ? {} : { workState: e.workState },
31296
31314
  ...e.deviceIds.length > 0 ? { deviceIds: [...e.deviceIds] } : {},
@@ -31314,7 +31332,7 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31314
31332
  if (s.data !== void 0) {
31315
31333
  l(!0), d(null);
31316
31334
  try {
31317
- await uP(ae(s.data.url), "camstack-retrain-export.tar");
31335
+ await mP(ae(s.data.url), "camstack-retrain-export.tar");
31318
31336
  } catch (e) {
31319
31337
  d(e instanceof Error ? e.message : String(e));
31320
31338
  } finally {
@@ -31334,8 +31352,8 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31334
31352
  role: "group",
31335
31353
  "aria-label": "Work state",
31336
31354
  "data-testid": "corpus-work-state-filter",
31337
- children: dP.map((t) => {
31338
- let n = pP(e.workState) === pP(t.value);
31355
+ children: hP.map((t) => {
31356
+ let n = _P(e.workState) === _P(t.value);
31339
31357
  return /* @__PURE__ */ V("button", {
31340
31358
  type: "button",
31341
31359
  "aria-pressed": n,
@@ -31344,12 +31362,12 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31344
31362
  },
31345
31363
  className: J(P, "px-2", n ? ne : ee),
31346
31364
  children: t.label
31347
- }, pP(t.value));
31365
+ }, _P(t.value));
31348
31366
  })
31349
31367
  }),
31350
31368
  /* @__PURE__ */ V("div", {
31351
31369
  className: "min-w-0 flex-1 basis-full sm:basis-64",
31352
- children: /* @__PURE__ */ V(fM, {
31370
+ children: /* @__PURE__ */ V(gM, {
31353
31371
  devices: n,
31354
31372
  listState: r,
31355
31373
  value: e.deviceIds,
@@ -31395,7 +31413,7 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31395
31413
  role: "group",
31396
31414
  "aria-label": "Annotated classes",
31397
31415
  "data-testid": "corpus-class-filter",
31398
- children: fP.map((t) => {
31416
+ children: gP.map((t) => {
31399
31417
  let n = e.classes.includes(t);
31400
31418
  return /* @__PURE__ */ V("button", {
31401
31419
  type: "button",
@@ -31418,7 +31436,7 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31418
31436
  }
31419
31437
  //#endregion
31420
31438
  //#region src/page/frames/corpus-frame-badge.ts
31421
- function hP(e) {
31439
+ function yP(e) {
31422
31440
  switch (e) {
31423
31441
  case "unannotated": return {
31424
31442
  label: "To do",
@@ -31436,13 +31454,13 @@ function hP(e) {
31436
31454
  }
31437
31455
  //#endregion
31438
31456
  //#region src/page/frames/CorpusFrameGrid.tsx
31439
- var gP = [
31457
+ var bP = [
31440
31458
  25,
31441
31459
  50,
31442
31460
  100
31443
31461
  ];
31444
- function _P({ frame: e, cameraName: t, onOpen: n }) {
31445
- let r = tc({ frameId: e.frameId }), i = hP(e.workState), a = r.data === void 0 ? void 0 : `data:image/jpeg;base64,${r.data.base64}`;
31462
+ function xP({ frame: e, cameraName: t, onOpen: n }) {
31463
+ let r = tc({ frameId: e.frameId }), i = yP(e.workState), a = r.data === void 0 ? void 0 : `data:image/jpeg;base64,${r.data.base64}`;
31446
31464
  return /* @__PURE__ */ H("button", {
31447
31465
  type: "button",
31448
31466
  className: "group flex min-w-0 flex-col overflow-hidden rounded-md border border-border bg-surface text-left hover:border-primary/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/40",
@@ -31470,7 +31488,7 @@ function _P({ frame: e, cameraName: t, onOpen: n }) {
31470
31488
  })]
31471
31489
  });
31472
31490
  }
31473
- function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError: a, deviceNames: o, onPageChange: s, onPageSizeChange: c, onOpenFrame: l }) {
31491
+ function SP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError: a, deviceNames: o, onPageChange: s, onPageSizeChange: c, onOpenFrame: l }) {
31474
31492
  let u = e !== void 0 && t !== void 0;
31475
31493
  return /* @__PURE__ */ H("div", {
31476
31494
  className: "space-y-3",
@@ -31492,7 +31510,7 @@ function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
31492
31510
  }) : null,
31493
31511
  u && e.length > 0 ? /* @__PURE__ */ V("div", {
31494
31512
  className: "grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",
31495
- children: e.map((e) => /* @__PURE__ */ V(_P, {
31513
+ children: e.map((e) => /* @__PURE__ */ V(xP, {
31496
31514
  frame: e,
31497
31515
  cameraName: o.get(e.deviceId) ?? `Camera ${String(e.deviceId)}`,
31498
31516
  onOpen: () => {
@@ -31504,7 +31522,7 @@ function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
31504
31522
  className: "flex flex-wrap items-center justify-between gap-2",
31505
31523
  children: [/* @__PURE__ */ V(dA, {
31506
31524
  value: r,
31507
- options: gP,
31525
+ options: bP,
31508
31526
  onChange: c,
31509
31527
  ariaLabel: "Frames per page"
31510
31528
  }), /* @__PURE__ */ V(vd, {
@@ -31521,18 +31539,18 @@ function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
31521
31539
  //#endregion
31522
31540
  //#region src/page/frames/CorpusKpiBar.tsx
31523
31541
  i();
31524
- var yP = 8;
31525
- function bP(e, t) {
31542
+ var CP = 8;
31543
+ function wP(e, t) {
31526
31544
  return t.get(e) ?? `Camera ${String(e)}`;
31527
31545
  }
31528
- function xP(e) {
31546
+ function TP(e) {
31529
31547
  return e === null ? "—" : `${(e * 100).toFixed(0)}%`;
31530
31548
  }
31531
- function SP(e) {
31549
+ function EP(e) {
31532
31550
  return [...e].toSorted((e, t) => t.unannotated === e.unannotated ? e.deviceId - t.deviceId : t.unannotated - e.unannotated);
31533
31551
  }
31534
- function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera: i }) {
31535
- let [o, s] = a(!1), c = m(() => e === void 0 ? [] : SP(e.cameras), [e]), l = o ? c : c.slice(0, yP);
31552
+ function DP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera: i }) {
31553
+ let [o, s] = a(!1), c = m(() => e === void 0 ? [] : EP(e.cameras), [e]), l = o ? c : c.slice(0, CP);
31536
31554
  return /* @__PURE__ */ H("div", {
31537
31555
  className: "space-y-3",
31538
31556
  "data-testid": "corpus-kpi-bar",
@@ -31554,22 +31572,22 @@ function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
31554
31572
  e === void 0 ? null : /* @__PURE__ */ H("div", {
31555
31573
  className: j,
31556
31574
  children: [
31557
- /* @__PURE__ */ V(RA, {
31575
+ /* @__PURE__ */ V(HA, {
31558
31576
  icon: $n,
31559
31577
  label: "Total frames",
31560
31578
  value: e.total
31561
31579
  }),
31562
- /* @__PURE__ */ V(RA, {
31580
+ /* @__PURE__ */ V(HA, {
31563
31581
  icon: an,
31564
31582
  label: "Unannotated",
31565
31583
  value: e.unannotated
31566
31584
  }),
31567
- /* @__PURE__ */ V(RA, {
31585
+ /* @__PURE__ */ V(HA, {
31568
31586
  icon: Vr,
31569
31587
  label: "Annotated",
31570
31588
  value: e.annotated
31571
31589
  }),
31572
- /* @__PURE__ */ V(RA, {
31590
+ /* @__PURE__ */ V(HA, {
31573
31591
  icon: rn,
31574
31592
  label: "Complete",
31575
31593
  value: e.complete
@@ -31603,10 +31621,10 @@ function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
31603
31621
  className: "flex items-center justify-between gap-2",
31604
31622
  children: [/* @__PURE__ */ V("span", {
31605
31623
  className: "min-w-0 truncate font-medium text-foreground",
31606
- children: bP(e.deviceId, r)
31624
+ children: wP(e.deviceId, r)
31607
31625
  }), /* @__PURE__ */ V("span", {
31608
31626
  className: "shrink-0 text-foreground-muted",
31609
- children: xP(e.pctOfCorpus)
31627
+ children: TP(e.pctOfCorpus)
31610
31628
  })]
31611
31629
  }),
31612
31630
  /* @__PURE__ */ H("div", {
@@ -31629,7 +31647,7 @@ function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
31629
31647
  }) }, e.deviceId);
31630
31648
  })
31631
31649
  }),
31632
- !o && c.length > yP ? /* @__PURE__ */ H(X, {
31650
+ !o && c.length > CP ? /* @__PURE__ */ H(X, {
31633
31651
  type: "button",
31634
31652
  variant: "ghost",
31635
31653
  size: "sm",
@@ -31650,11 +31668,11 @@ function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
31650
31668
  }
31651
31669
  //#endregion
31652
31670
  //#region src/page/frames/corpus-filter-url.ts
31653
- var wP = new Set([
31671
+ var OP = new Set([
31654
31672
  "unannotated",
31655
31673
  "annotated",
31656
31674
  "complete"
31657
- ]), TP = new Set([
31675
+ ]), kP = new Set([
31658
31676
  "person",
31659
31677
  "vehicle",
31660
31678
  "animal",
@@ -31662,72 +31680,72 @@ var wP = new Set([
31662
31680
  "face",
31663
31681
  "plate"
31664
31682
  ]);
31665
- function EP(e) {
31683
+ function AP(e) {
31666
31684
  return e === null || e.trim() === "" ? [] : e.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
31667
31685
  }
31668
- function DP(e) {
31686
+ function jP(e) {
31669
31687
  let t = [];
31670
- for (let n of EP(e)) {
31688
+ for (let n of AP(e)) {
31671
31689
  let e = Number.parseInt(n, 10);
31672
31690
  Number.isInteger(e) && e > 0 && !t.includes(e) && t.push(e);
31673
31691
  }
31674
31692
  return t;
31675
31693
  }
31676
- function OP(e) {
31677
- return TP.has(e);
31694
+ function MP(e) {
31695
+ return kP.has(e);
31678
31696
  }
31679
- function kP(e) {
31680
- return wP.has(e);
31697
+ function NP(e) {
31698
+ return OP.has(e);
31681
31699
  }
31682
- function AP(e) {
31700
+ function PP(e) {
31683
31701
  let t = [];
31684
- for (let n of EP(e)) !OP(n) || t.includes(n) || t.push(n);
31702
+ for (let n of AP(e)) !MP(n) || t.includes(n) || t.push(n);
31685
31703
  return t;
31686
31704
  }
31687
- function jP(e) {
31688
- if (!(e === null || e === "")) return kP(e) ? e : void 0;
31705
+ function FP(e) {
31706
+ if (!(e === null || e === "")) return NP(e) ? e : void 0;
31689
31707
  }
31690
- function MP(e) {
31708
+ function IP(e) {
31691
31709
  if (e === null || e === "") return 1;
31692
31710
  let t = Number.parseInt(e, 10);
31693
31711
  return Number.isInteger(t) && t >= 1 ? t : 1;
31694
31712
  }
31695
- function NP(e) {
31713
+ function LP(e) {
31696
31714
  let t = e.get("collection")?.trim() ?? "";
31697
31715
  return {
31698
- workState: jP(e.get("workState")),
31699
- deviceIds: DP(e.get("camera")),
31716
+ workState: FP(e.get("workState")),
31717
+ deviceIds: jP(e.get("camera")),
31700
31718
  collectionId: t.length > 0 ? t : void 0,
31701
- classes: AP(e.get("class")),
31702
- page: MP(e.get("page"))
31719
+ classes: PP(e.get("class")),
31720
+ page: IP(e.get("page"))
31703
31721
  };
31704
31722
  }
31705
- function PP(e, t) {
31723
+ function RP(e, t) {
31706
31724
  t.workState === void 0 ? e.delete("workState") : e.set("workState", t.workState), t.deviceIds.length === 0 ? e.delete("camera") : e.set("camera", t.deviceIds.join(",")), t.collectionId === void 0 || t.collectionId === "" ? e.delete("collection") : e.set("collection", t.collectionId), t.classes.length === 0 ? e.delete("class") : e.set("class", t.classes.join(",")), t.page <= 1 ? e.delete("page") : e.set("page", String(t.page));
31707
31725
  }
31708
- function FP(e) {
31726
+ function zP(e) {
31709
31727
  if (typeof window > "u") return;
31710
31728
  let t = new URL(window.location.href);
31711
- PP(t.searchParams, e), window.history.replaceState({}, "", t.toString());
31729
+ RP(t.searchParams, e), window.history.replaceState({}, "", t.toString());
31712
31730
  }
31713
31731
  //#endregion
31714
31732
  //#region src/page/frames/FramesSection.tsx
31715
31733
  i();
31716
- var IP = [
31734
+ var BP = [
31717
31735
  25,
31718
31736
  50,
31719
31737
  100
31720
31738
  ];
31721
- function LP() {
31739
+ function VP() {
31722
31740
  return typeof window > "u" ? {
31723
31741
  workState: void 0,
31724
31742
  deviceIds: [],
31725
31743
  collectionId: void 0,
31726
31744
  classes: [],
31727
31745
  page: 1
31728
- } : NP(new URLSearchParams(window.location.search));
31746
+ } : LP(new URLSearchParams(window.location.search));
31729
31747
  }
31730
- function RP(e, t) {
31748
+ function HP(e, t) {
31731
31749
  return {
31732
31750
  page: e.page,
31733
31751
  pageSize: t,
@@ -31737,13 +31755,13 @@ function RP(e, t) {
31737
31755
  ...e.classes.length > 0 ? { classes: [...e.classes] } : {}
31738
31756
  };
31739
31757
  }
31740
- function zP() {
31741
- let [e, t] = a(LP), [n, r] = lA({
31758
+ function UP() {
31759
+ let [e, t] = a(VP), [n, r] = lA({
31742
31760
  storageKey: "training-corpus-page-size",
31743
- options: IP,
31761
+ options: BP,
31744
31762
  defaultSize: 50
31745
31763
  }), [i, o] = a(null), c = s((e) => {
31746
- t(e), FP(e);
31764
+ t(e), zP(e);
31747
31765
  }, []), l = Ws({
31748
31766
  projection: "slim",
31749
31767
  isCamera: !0
@@ -31756,7 +31774,7 @@ function zP() {
31756
31774
  name: e.name,
31757
31775
  type: e.type,
31758
31776
  location: typeof e.location == "string" ? e.location : null
31759
- })), [l.data]), f = Zj(l), p = ec({}), h = $s(RP(e, n)), g = uc({}), _ = lc(), v = dc(), b = fc();
31777
+ })), [l.data]), f = tM(l), p = ec({}), h = $s(HP(e, n)), g = uc({}), _ = lc(), v = dc(), b = fc();
31760
31778
  y(() => {
31761
31779
  let t = h.data?.total;
31762
31780
  if (t === void 0) return;
@@ -31779,7 +31797,7 @@ function zP() {
31779
31797
  });
31780
31798
  }, [e, c]), S = s(async (t) => {
31781
31799
  let n = await _.mutateAsync({ name: t });
31782
- return await g.refetch(), n.kind === "refused" ? aP[n.reason] ?? n.reason : (c({
31800
+ return await g.refetch(), n.kind === "refused" ? lP[n.reason] ?? n.reason : (c({
31783
31801
  ...e,
31784
31802
  collectionId: n.collection.id,
31785
31803
  page: 1
@@ -31794,7 +31812,7 @@ function zP() {
31794
31812
  id: e,
31795
31813
  name: t
31796
31814
  });
31797
- return await g.refetch(), n.kind === "refused" ? aP[n.reason] ?? n.reason : null;
31815
+ return await g.refetch(), n.kind === "refused" ? lP[n.reason] ?? n.reason : null;
31798
31816
  }, [v, g]), w = s(async (t) => {
31799
31817
  await b.mutateAsync({ id: t }), e.collectionId === t && c({
31800
31818
  ...e,
@@ -31817,14 +31835,14 @@ function zP() {
31817
31835
  className: "space-y-4",
31818
31836
  "data-testid": "frames-section",
31819
31837
  children: [
31820
- /* @__PURE__ */ V(CP, {
31838
+ /* @__PURE__ */ V(DP, {
31821
31839
  kpi: p.data,
31822
31840
  isLoading: p.isLoading,
31823
31841
  isError: p.isError,
31824
31842
  deviceNames: u,
31825
31843
  onSelectCamera: x
31826
31844
  }),
31827
- /* @__PURE__ */ V(oP, {
31845
+ /* @__PURE__ */ V(uP, {
31828
31846
  collections: g.data,
31829
31847
  isLoading: g.isLoading,
31830
31848
  selectedId: e.collectionId ?? null,
@@ -31839,7 +31857,7 @@ function zP() {
31839
31857
  onRename: C,
31840
31858
  onDelete: w
31841
31859
  }),
31842
- /* @__PURE__ */ V(mP, {
31860
+ /* @__PURE__ */ V(vP, {
31843
31861
  filter: e,
31844
31862
  onChange: c,
31845
31863
  cameraItems: d,
@@ -31847,7 +31865,7 @@ function zP() {
31847
31865
  collections: g.data,
31848
31866
  collectionsPending: g.isLoading && g.data === void 0
31849
31867
  }),
31850
- /* @__PURE__ */ V(vP, {
31868
+ /* @__PURE__ */ V(SP, {
31851
31869
  frames: h.data?.frames,
31852
31870
  total: h.data?.total,
31853
31871
  page: e.page,
@@ -31869,7 +31887,7 @@ function zP() {
31869
31887
  },
31870
31888
  onOpenFrame: T
31871
31889
  }),
31872
- i === null ? null : /* @__PURE__ */ V(rP, {
31890
+ i === null ? null : /* @__PURE__ */ V(sP, {
31873
31891
  open: !0,
31874
31892
  frames: D,
31875
31893
  activeFrameId: i,
@@ -31883,7 +31901,7 @@ function zP() {
31883
31901
  }
31884
31902
  //#endregion
31885
31903
  //#region src/page/view-model.ts
31886
- var BP = [
31904
+ var WP = [
31887
31905
  "uploading",
31888
31906
  "submitted",
31889
31907
  "starting",
@@ -31892,7 +31910,7 @@ var BP = [
31892
31910
  "ready",
31893
31911
  "registered",
31894
31912
  "canary"
31895
- ], VP = {
31913
+ ], GP = {
31896
31914
  queued: "Queued",
31897
31915
  uploading: "Uploading",
31898
31916
  submitted: "Submitted",
@@ -31908,7 +31926,7 @@ var BP = [
31908
31926
  lost: "Lost",
31909
31927
  expired: "Expired",
31910
31928
  discarded: "Discarded"
31911
- }, HP = new Set([
31929
+ }, KP = new Set([
31912
31930
  "ready",
31913
31931
  "registered",
31914
31932
  "canary",
@@ -31918,64 +31936,64 @@ var BP = [
31918
31936
  "expired",
31919
31937
  "discarded"
31920
31938
  ]);
31921
- function UP(e) {
31922
- return HP.has(e);
31939
+ function qP(e) {
31940
+ return KP.has(e);
31923
31941
  }
31924
- function WP(e) {
31925
- return e.some((e) => !UP(e.state));
31942
+ function JP(e) {
31943
+ return e.some((e) => !qP(e.state));
31926
31944
  }
31927
- function GP(e) {
31928
- let t = BP.indexOf(e.state);
31945
+ function YP(e) {
31946
+ let t = WP.indexOf(e.state);
31929
31947
  if (t >= 0) return t;
31930
- if (e.artifacts !== null || e.registeredModelIds.length > 0) return BP.indexOf("ready");
31948
+ if (e.artifacts !== null || e.registeredModelIds.length > 0) return WP.indexOf("ready");
31931
31949
  switch (e.provider.state) {
31932
- case "succeeded": return BP.indexOf("collecting");
31950
+ case "succeeded": return WP.indexOf("collecting");
31933
31951
  case "running":
31934
31952
  case "failed":
31935
- case "cancelled": return BP.indexOf("running");
31936
- case "starting": return BP.indexOf("starting");
31937
- case "pending": return BP.indexOf("submitted");
31953
+ case "cancelled": return WP.indexOf("running");
31954
+ case "starting": return WP.indexOf("starting");
31955
+ case "pending": return WP.indexOf("submitted");
31938
31956
  default: return 0;
31939
31957
  }
31940
31958
  }
31941
- function KP(e) {
31942
- if (e.state === "queued") return BP.map((e) => ({
31959
+ function XP(e) {
31960
+ if (e.state === "queued") return WP.map((e) => ({
31943
31961
  state: e,
31944
- label: VP[e],
31962
+ label: GP[e],
31945
31963
  status: "todo"
31946
31964
  }));
31947
- let t = !BP.includes(e.state), n = GP(e);
31948
- return BP.map((r, i) => {
31965
+ let t = !WP.includes(e.state), n = YP(e);
31966
+ return WP.map((r, i) => {
31949
31967
  let a = "todo";
31950
31968
  return i < n ? a = "done" : i === n && (a = t && e.state !== "expired" ? "failed" : "current"), {
31951
31969
  state: r,
31952
- label: VP[r],
31970
+ label: GP[r],
31953
31971
  status: a
31954
31972
  };
31955
31973
  });
31956
31974
  }
31957
- function qP(e, t) {
31975
+ function ZP(e, t) {
31958
31976
  let n = `$${e.toFixed(2)}`;
31959
31977
  return t ? `≈ ${n}` : n;
31960
31978
  }
31961
- function JP(e) {
31979
+ function QP(e) {
31962
31980
  let t = Math.max(0, Math.round(e));
31963
31981
  return t < 60 ? `${String(t)} s` : t < 3600 ? `${String(Math.floor(t / 60))} min ${String(t % 60)} s` : `${String(Math.floor(t / 3600))} h ${String(Math.floor(t % 3600 / 60))} min`;
31964
31982
  }
31965
- function YP(e) {
31983
+ function $P(e) {
31966
31984
  return e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : e < 1024 ** 3 ? `${(e / 1024 ** 2).toFixed(1)} MB` : `${(e / 1024 ** 3).toFixed(2)} GB`;
31967
31985
  }
31968
- function XP(e) {
31986
+ function eF(e) {
31969
31987
  return e == null ? "—" : `${(e * 100).toFixed(1)}%`;
31970
31988
  }
31971
- function ZP(e, t) {
31989
+ function tF(e, t) {
31972
31990
  let n = e.provider.startedAt;
31973
31991
  return n === null ? null : ((e.provider.endedAt ?? t) - n) / 1e3;
31974
31992
  }
31975
- function QP(e, t) {
31993
+ function nF(e, t) {
31976
31994
  return e?.classes[t] ?? null;
31977
31995
  }
31978
- function $P(e) {
31996
+ function rF(e) {
31979
31997
  let t = e.evaluation;
31980
31998
  return t === void 0 ? [] : [...new Set([
31981
31999
  ...Object.keys(t.baseline?.classes ?? {}),
@@ -31983,12 +32001,12 @@ function $P(e) {
31983
32001
  ...Object.keys(t.candidateInt8?.classes ?? {})
31984
32002
  ])].toSorted().map((e) => ({
31985
32003
  cls: e,
31986
- baseline: QP(t.baseline, e),
31987
- candidate: QP(t.candidate, e),
31988
- int8: QP(t.candidateInt8, e)
32004
+ baseline: nF(t.baseline, e),
32005
+ candidate: nF(t.candidate, e),
32006
+ int8: nF(t.candidateInt8, e)
31989
32007
  }));
31990
32008
  }
31991
- function eF(e) {
32009
+ function iF(e) {
31992
32010
  let t = e.evaluation?.recallDeltaByCamera ?? {}, n = [];
31993
32011
  for (let [e, r] of Object.entries(t)) for (let [t, i] of Object.entries(r)) {
31994
32012
  let r = i < -.01 ? "worse" : i > .01 ? "better" : "same";
@@ -32001,17 +32019,17 @@ function eF(e) {
32001
32019
  }
32002
32020
  return n.toSorted((e, t) => e.cls.localeCompare(t.cls) || e.deviceId - t.deviceId);
32003
32021
  }
32004
- function tF(e) {
32022
+ function aF(e) {
32005
32023
  return e === "ready" || e === "registered" || e === "canary" ? "success" : e === "failed" || e === "lost" ? "danger" : e === "cancelling" || e === "cancelled" || e === "expired" || e === "discarded" ? "default" : "info";
32006
32024
  }
32007
32025
  //#endregion
32008
32026
  //#region src/page/ComparisonTable.tsx
32009
- var nF = {
32027
+ var oF = {
32010
32028
  better: "text-success",
32011
32029
  worse: "text-danger",
32012
32030
  same: "text-foreground-muted"
32013
32031
  };
32014
- function rF({ c: e }) {
32032
+ function sF({ c: e }) {
32015
32033
  if (e === null) return /* @__PURE__ */ V("td", {
32016
32034
  className: "px-2 py-1 text-foreground-subtle",
32017
32035
  children: "—"
@@ -32021,26 +32039,26 @@ function rF({ c: e }) {
32021
32039
  className: "px-2 py-1 text-foreground",
32022
32040
  children: [
32023
32041
  "P ",
32024
- XP(e.precision),
32042
+ eF(e.precision),
32025
32043
  " · R ",
32026
- XP(e.recall),
32044
+ eF(e.recall),
32027
32045
  " · AP50 ",
32028
- XP(e.ap50),
32046
+ eF(e.ap50),
32029
32047
  /* @__PURE__ */ H("span", {
32030
32048
  className: "block text-xs text-foreground-subtle",
32031
32049
  children: [
32032
32050
  "floor ",
32033
32051
  e.floor === null ? "—" : e.floor.toFixed(2),
32034
32052
  " · night R ",
32035
- XP(t),
32053
+ eF(t),
32036
32054
  n
32037
32055
  ]
32038
32056
  })
32039
32057
  ]
32040
32058
  });
32041
32059
  }
32042
- function iF({ result: e, cameraName: t }) {
32043
- let n = $P(e), r = eF(e), i = n.some((e) => e.int8 !== null);
32060
+ function cF({ result: e, cameraName: t }) {
32061
+ let n = rF(e), r = iF(e), i = n.some((e) => e.int8 !== null);
32044
32062
  return n.length === 0 ? /* @__PURE__ */ V("p", {
32045
32063
  className: "text-sm text-foreground-muted",
32046
32064
  children: "No held-out evaluation in this result."
@@ -32081,16 +32099,16 @@ function iF({ result: e, cameraName: t }) {
32081
32099
  ")"
32082
32100
  ]
32083
32101
  }),
32084
- /* @__PURE__ */ V(rF, { c: e.baseline }),
32085
- /* @__PURE__ */ V(rF, { c: e.candidate }),
32086
- i && /* @__PURE__ */ V(rF, { c: e.int8 })
32102
+ /* @__PURE__ */ V(sF, { c: e.baseline }),
32103
+ /* @__PURE__ */ V(sF, { c: e.candidate }),
32104
+ i && /* @__PURE__ */ V(sF, { c: e.int8 })
32087
32105
  ]
32088
32106
  }, e.cls)) })]
32089
32107
  }), r.length > 0 && /* @__PURE__ */ V("ul", {
32090
32108
  className: "flex flex-wrap gap-x-4 gap-y-1 text-xs",
32091
32109
  "aria-label": "Recall change per camera",
32092
32110
  children: r.map((e) => /* @__PURE__ */ H("li", {
32093
- className: nF[e.tone],
32111
+ className: oF[e.tone],
32094
32112
  children: [
32095
32113
  t(e.deviceId),
32096
32114
  " ",
@@ -32107,10 +32125,10 @@ function iF({ result: e, cameraName: t }) {
32107
32125
  //#endregion
32108
32126
  //#region src/page/use-async.ts
32109
32127
  i();
32110
- function aF(e) {
32128
+ function lF(e) {
32111
32129
  return e instanceof Error ? e.message : String(e);
32112
32130
  }
32113
- function oF(e, t, n = {}) {
32131
+ function uF(e, t, n = {}) {
32114
32132
  let [r, i] = a({ status: "pending" }), [o, c] = a(0), l = u(e);
32115
32133
  l.current = e;
32116
32134
  let d = s(() => c((e) => e + 1), []);
@@ -32124,7 +32142,7 @@ function oF(e, t, n = {}) {
32124
32142
  }).catch((t) => {
32125
32143
  e && i({
32126
32144
  status: "error",
32127
- error: aF(t)
32145
+ error: lF(t)
32128
32146
  });
32129
32147
  }), () => {
32130
32148
  e = !1;
@@ -32148,13 +32166,13 @@ function oF(e, t, n = {}) {
32148
32166
  //#endregion
32149
32167
  //#region src/page/ResultPanel.tsx
32150
32168
  i();
32151
- function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32152
- let i = Wl(), o = oF(() => t.training.getJobResult.query({ id: e.id }), [e.id, e.state]), s = oF(async () => (await t.deviceManager.listAll.query({ slim: !0 })).filter((e) => e.type === "camera"), []), [c, l] = a([]), [u, d] = a(!1), [f, p] = a(null), m = async (e) => {
32169
+ function dF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32170
+ let i = Wl(), o = uF(() => t.training.getJobResult.query({ id: e.id }), [e.id, e.state]), s = uF(async () => (await t.deviceManager.listAll.query({ slim: !0 })).filter((e) => e.type === "camera"), []), [c, l] = a([]), [u, d] = a(!1), [f, p] = a(null), m = async (e) => {
32153
32171
  d(!0), p(null);
32154
32172
  try {
32155
32173
  await e(), n();
32156
32174
  } catch (e) {
32157
- p(aF(e));
32175
+ p(lF(e));
32158
32176
  } finally {
32159
32177
  d(!1);
32160
32178
  }
@@ -32196,7 +32214,7 @@ function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32196
32214
  className: "space-y-3 border-t border-border pt-3",
32197
32215
  "data-testid": "result-panel",
32198
32216
  children: [
32199
- /* @__PURE__ */ V(iF, {
32217
+ /* @__PURE__ */ V(cF, {
32200
32218
  result: y,
32201
32219
  cameraName: r
32202
32220
  }),
@@ -32223,7 +32241,7 @@ function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32223
32241
  children: [
32224
32242
  b.length,
32225
32243
  " files, ",
32226
- YP(b.reduce((e, t) => e + t.bytes, 0)),
32244
+ $P(b.reduce((e, t) => e + t.bytes, 0)),
32227
32245
  " · ",
32228
32246
  y.licence
32229
32247
  ]
@@ -32331,12 +32349,12 @@ function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32331
32349
  }
32332
32350
  //#endregion
32333
32351
  //#region src/page/Sparkline.tsx
32334
- function cF(e, t, n) {
32352
+ function fF(e, t, n) {
32335
32353
  if (e.length === 0) return "";
32336
32354
  let r = Math.max(...e, 1e-4), i = e.length > 1 ? t / (e.length - 1) : 0;
32337
32355
  return e.map((e, t) => `${t === 0 ? "M" : "L"}${(t * i).toFixed(1)},${(n - e / r * n).toFixed(1)}`).join(" ");
32338
32356
  }
32339
- function lF({ series: e, width: t = 160, height: n = 32 }) {
32357
+ function pF({ series: e, width: t = 160, height: n = 32 }) {
32340
32358
  let r = e.map((e) => e.map50 ?? 0);
32341
32359
  if (r.length < 2) return /* @__PURE__ */ V("span", {
32342
32360
  className: "text-xs text-foreground-subtle",
@@ -32352,7 +32370,7 @@ function lF({ series: e, width: t = 160, height: n = 32 }) {
32352
32370
  viewBox: `0 0 ${String(t)} ${String(n)}`,
32353
32371
  "aria-label": "mAP50 per epoch",
32354
32372
  children: /* @__PURE__ */ V("path", {
32355
- d: cF(r, t, n),
32373
+ d: fF(r, t, n),
32356
32374
  fill: "none",
32357
32375
  stroke: "currentColor",
32358
32376
  strokeWidth: 1.5
@@ -32366,13 +32384,13 @@ function lF({ series: e, width: t = 160, height: n = 32 }) {
32366
32384
  //#endregion
32367
32385
  //#region src/page/JobDetail.tsx
32368
32386
  i();
32369
- var uF = {
32387
+ var mF = {
32370
32388
  done: "bg-primary/15 text-primary",
32371
32389
  current: "bg-primary text-primary-foreground",
32372
32390
  failed: "bg-danger text-white",
32373
32391
  todo: "bg-surface-hover text-foreground-subtle"
32374
32392
  };
32375
- function dF({ lines: e }) {
32393
+ function hF({ lines: e }) {
32376
32394
  let t = u(null);
32377
32395
  return y(() => {
32378
32396
  t.current !== null && (t.current.scrollTop = t.current.scrollHeight);
@@ -32383,8 +32401,8 @@ function dF({ lines: e }) {
32383
32401
  children: e.join("\n")
32384
32402
  });
32385
32403
  }
32386
- function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
32387
- let a = ZP(e, Date.now()), { epoch: o, epochs: s, etaSec: c, series: l } = e.progress, u = e.state === "ready" || e.state === "registered" || e.state === "canary", d = e.request.selection.collectionIds.map((e) => i(e));
32404
+ function gF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
32405
+ let a = tF(e, Date.now()), { epoch: o, epochs: s, etaSec: c, series: l } = e.progress, u = e.state === "ready" || e.state === "registered" || e.state === "canary", d = e.request.selection.collectionIds.map((e) => i(e));
32388
32406
  return /* @__PURE__ */ H("section", {
32389
32407
  className: "space-y-3 rounded-lg border border-border bg-surface p-3 sm:p-4",
32390
32408
  "data-testid": `job-detail-${e.id}`,
@@ -32398,10 +32416,10 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32398
32416
  children: e.name
32399
32417
  }),
32400
32418
  /* @__PURE__ */ V(ll, {
32401
- variant: tF(e.state),
32402
- children: VP[e.state]
32419
+ variant: aF(e.state),
32420
+ children: GP[e.state]
32403
32421
  }),
32404
- e.stage !== null && !UP(e.state) && /* @__PURE__ */ V(ll, {
32422
+ e.stage !== null && !qP(e.state) && /* @__PURE__ */ V(ll, {
32405
32423
  variant: "info",
32406
32424
  children: e.stage
32407
32425
  }),
@@ -32426,10 +32444,10 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32426
32444
  /* @__PURE__ */ V("ol", {
32427
32445
  className: "flex flex-wrap gap-1",
32428
32446
  "aria-label": "Job progress",
32429
- children: KP(e).map((t) => /* @__PURE__ */ V("li", {
32430
- className: `rounded-full px-2 py-0.5 text-xs ${uF[t.status]}`,
32447
+ children: XP(e).map((t) => /* @__PURE__ */ V("li", {
32448
+ className: `rounded-full px-2 py-0.5 text-xs ${mF[t.status]}`,
32431
32449
  "aria-current": t.status === "current" ? "step" : void 0,
32432
- children: t.status === "failed" ? `${t.label} — ${VP[e.state]}` : t.label
32450
+ children: t.status === "failed" ? `${t.label} — ${GP[e.state]}` : t.label
32433
32451
  }, t.state))
32434
32452
  }),
32435
32453
  e.failure !== null && /* @__PURE__ */ H("p", {
@@ -32461,17 +32479,17 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32461
32479
  o,
32462
32480
  " / ",
32463
32481
  s,
32464
- c !== null && !UP(e.state) ? ` · about ${JP(c)} left` : ""
32482
+ c !== null && !qP(e.state) ? ` · about ${QP(c)} left` : ""
32465
32483
  ]
32466
32484
  })]
32467
32485
  }),
32468
- /* @__PURE__ */ V(lF, { series: l }),
32486
+ /* @__PURE__ */ V(pF, { series: l }),
32469
32487
  /* @__PURE__ */ H("p", {
32470
32488
  className: "text-xs text-foreground-muted",
32471
32489
  children: [
32472
- a !== null && `Ran ${JP(a)} · `,
32490
+ a !== null && `Ran ${QP(a)} · `,
32473
32491
  "Cost ",
32474
- qP(e.provider.costUsd, e.provider.costIsEstimate),
32492
+ ZP(e.provider.costUsd, e.provider.costIsEstimate),
32475
32493
  " of $",
32476
32494
  e.maxCostUsd.toFixed(2),
32477
32495
  " cap",
@@ -32479,8 +32497,8 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32479
32497
  e.artifacts !== null && ` · result kept on the hub until ${new Date(e.artifacts.expiresAt).toLocaleDateString()}`
32480
32498
  ]
32481
32499
  }),
32482
- /* @__PURE__ */ V(dF, { lines: e.logTail }),
32483
- u && /* @__PURE__ */ V(sF, {
32500
+ /* @__PURE__ */ V(hF, { lines: e.logTail }),
32501
+ u && /* @__PURE__ */ V(dF, {
32484
32502
  job: e,
32485
32503
  trpc: t,
32486
32504
  onChanged: n,
@@ -32492,18 +32510,18 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32492
32510
  //#endregion
32493
32511
  //#region src/page/JobsTable.tsx
32494
32512
  i();
32495
- var pF = {
32513
+ var _F = {
32496
32514
  searchText: (e) => [
32497
32515
  e.name,
32498
32516
  e.id,
32499
32517
  e.request.baseModelId,
32500
32518
  e.request.gpuType,
32501
- VP[e.state],
32519
+ GP[e.state],
32502
32520
  e.stage ?? ""
32503
32521
  ],
32504
32522
  facetValue: (e) => e.state
32505
32523
  };
32506
- function mF({ job: e }) {
32524
+ function vF({ job: e }) {
32507
32525
  let { epoch: t, epochs: n } = e.progress;
32508
32526
  return t === null || n === null ? /* @__PURE__ */ V("span", {
32509
32527
  className: "text-foreground-subtle",
@@ -32517,9 +32535,9 @@ function mF({ job: e }) {
32517
32535
  ]
32518
32536
  });
32519
32537
  }
32520
- function hF({ job: e, trpc: t, onChanged: n }) {
32538
+ function yF({ job: e, trpc: t, onChanged: n }) {
32521
32539
  let r = Wl(), [i, o] = a(null);
32522
- if (UP(e.state) || e.state === "cancelling") return null;
32540
+ if (qP(e.state) || e.state === "cancelling") return null;
32523
32541
  let s = async () => {
32524
32542
  if (await r({
32525
32543
  title: "Cancel this job?",
@@ -32529,7 +32547,7 @@ function hF({ job: e, trpc: t, onChanged: n }) {
32529
32547
  })) try {
32530
32548
  await t.training.cancelJob.mutate({ id: e.id }), n();
32531
32549
  } catch (e) {
32532
- o(aF(e));
32550
+ o(lF(e));
32533
32551
  }
32534
32552
  };
32535
32553
  return /* @__PURE__ */ H("div", {
@@ -32545,8 +32563,8 @@ function hF({ job: e, trpc: t, onChanged: n }) {
32545
32563
  })]
32546
32564
  });
32547
32565
  }
32548
- function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
32549
- let o = y_(e, pF), [s, c] = a(null);
32566
+ function bF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
32567
+ let o = y_(e, _F), [s, c] = a(null);
32550
32568
  y(() => {
32551
32569
  if (o.rows.length === 0) {
32552
32570
  c(null);
@@ -32583,9 +32601,9 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32583
32601
  render: (e) => /* @__PURE__ */ H("span", {
32584
32602
  className: "inline-flex flex-wrap items-center gap-1",
32585
32603
  children: [/* @__PURE__ */ V(ll, {
32586
- variant: tF(e.state),
32587
- children: VP[e.state]
32588
- }), e.stage !== null && !UP(e.state) && /* @__PURE__ */ V(ll, {
32604
+ variant: aF(e.state),
32605
+ children: GP[e.state]
32606
+ }), e.stage !== null && !qP(e.state) && /* @__PURE__ */ V(ll, {
32589
32607
  variant: "info",
32590
32608
  children: e.stage
32591
32609
  })]
@@ -32609,7 +32627,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32609
32627
  key: "progress",
32610
32628
  header: "Progress",
32611
32629
  sortValue: (e) => e.progress.epoch ?? -1,
32612
- render: (e) => /* @__PURE__ */ V(mF, { job: e })
32630
+ render: (e) => /* @__PURE__ */ V(vF, { job: e })
32613
32631
  },
32614
32632
  {
32615
32633
  key: "cost",
@@ -32619,7 +32637,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32619
32637
  render: (e) => /* @__PURE__ */ H("span", {
32620
32638
  className: "font-mono text-[11px] tabular-nums",
32621
32639
  children: [
32622
- qP(e.provider.costUsd, e.provider.costIsEstimate),
32640
+ ZP(e.provider.costUsd, e.provider.costIsEstimate),
32623
32641
  " / $",
32624
32642
  e.maxCostUsd.toFixed(2)
32625
32643
  ]
@@ -32637,7 +32655,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32637
32655
  {
32638
32656
  key: "actions",
32639
32657
  align: "right",
32640
- render: (e) => /* @__PURE__ */ V(hF, {
32658
+ render: (e) => /* @__PURE__ */ V(yF, {
32641
32659
  job: e,
32642
32660
  trpc: t,
32643
32661
  onChanged: n
@@ -32654,7 +32672,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32654
32672
  /* @__PURE__ */ V(v_, {
32655
32673
  state: o.state,
32656
32674
  facets: o.facets,
32657
- facetLabel: (e) => VP[e] ?? e,
32675
+ facetLabel: (e) => GP[e] ?? e,
32658
32676
  labels: {
32659
32677
  searchPlaceholder: "Search jobs…",
32660
32678
  searchLabel: "Search jobs",
@@ -32680,7 +32698,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32680
32698
  onRowClick: (e) => c(e.id),
32681
32699
  rowClassName: (e) => e.id === s ? "bg-primary/[0.04]" : void 0
32682
32700
  }),
32683
- l !== null && /* @__PURE__ */ V(fF, {
32701
+ l !== null && /* @__PURE__ */ V(gF, {
32684
32702
  job: l,
32685
32703
  trpc: t,
32686
32704
  onChanged: n,
@@ -32692,7 +32710,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32692
32710
  }
32693
32711
  //#endregion
32694
32712
  //#region src/page/cluster-root-model-rows.ts
32695
- function _F(e) {
32713
+ function xF(e) {
32696
32714
  for (let t of e.slots) for (let e of t.addons) if (e.id === "object-detection") return typeof e.defaultModelId != "string" || e.defaultModelId.length === 0 ? null : {
32697
32715
  defaultModelId: e.defaultModelId,
32698
32716
  ...e.defaultModelIdByFormat === void 0 ? {} : { defaultModelIdByFormat: e.defaultModelIdByFormat },
@@ -32705,10 +32723,10 @@ function _F(e) {
32705
32723
  };
32706
32724
  return null;
32707
32725
  }
32708
- function vF(e) {
32726
+ function SF(e) {
32709
32727
  let t = [];
32710
32728
  for (let n of e) {
32711
- let e = _F(n.schema);
32729
+ let e = xF(n.schema);
32712
32730
  e !== null && t.push({
32713
32731
  nodeId: n.nodeId,
32714
32732
  devices: n.devices,
@@ -32717,8 +32735,8 @@ function vF(e) {
32717
32735
  }
32718
32736
  return t;
32719
32737
  }
32720
- function yF(e, t) {
32721
- let n = $g(vF(t)), r = e_(n);
32738
+ function CF(e, t) {
32739
+ let n = $g(SF(t)), r = e_(n);
32722
32740
  return {
32723
32741
  models: e.map((e) => ({
32724
32742
  modelId: e.modelId,
@@ -32731,7 +32749,7 @@ function yF(e, t) {
32731
32749
  }
32732
32750
  //#endregion
32733
32751
  //#region src/page/PlanSummary.tsx
32734
- function bF({ plan: e, cameraName: t }) {
32752
+ function wF({ plan: e, cameraName: t }) {
32735
32753
  let { split: n, estimate: r } = e;
32736
32754
  return /* @__PURE__ */ H("div", {
32737
32755
  className: "space-y-2 text-sm",
@@ -32777,14 +32795,14 @@ function bF({ plan: e, cameraName: t }) {
32777
32795
  ] }),
32778
32796
  /* @__PURE__ */ H("span", { children: [
32779
32797
  "GPU time: ",
32780
- JP(r.gpuSecondsLow),
32798
+ QP(r.gpuSecondsLow),
32781
32799
  " –",
32782
32800
  " ",
32783
- JP(r.gpuSecondsHigh)
32801
+ QP(r.gpuSecondsHigh)
32784
32802
  ] }),
32785
32803
  /* @__PURE__ */ H("span", { children: [
32786
32804
  "Upload: about ",
32787
- YP(r.datasetBytes),
32805
+ $P(r.datasetBytes),
32788
32806
  ", ",
32789
32807
  r.uploadMinutesAt20Mbps,
32790
32808
  " min at 20 Mbit/s"
@@ -32804,16 +32822,16 @@ function bF({ plan: e, cameraName: t }) {
32804
32822
  }
32805
32823
  //#endregion
32806
32824
  //#region src/page/plan-form.ts
32807
- var xF = {
32825
+ var TF = {
32808
32826
  quick: "Quick — 15 epochs",
32809
32827
  standard: "Standard — 40 epochs",
32810
32828
  thorough: "Thorough — 80 epochs, nothing frozen"
32811
- }, SF = {
32829
+ }, EF = {
32812
32830
  complete: "Complete frames only",
32813
32831
  annotated_or_complete: "Annotated or complete",
32814
32832
  any_annotated: "Any annotated (incl. hard negatives)"
32815
32833
  };
32816
- function CF(e) {
32834
+ function DF(e) {
32817
32835
  let t = e.baseModelIds[0];
32818
32836
  if (e.collectionIds.length === 0 || e.entryId === "" || e.gpuType === "" || t === void 0) return null;
32819
32837
  let n = e.freeze.trim() === "" ? null : Number(e.freeze);
@@ -32831,7 +32849,7 @@ function CF(e) {
32831
32849
  holdoutCameras: e.holdoutCameras.length > 0 ? [...e.holdoutCameras] : null
32832
32850
  };
32833
32851
  }
32834
- function wF(e, t) {
32852
+ function OF(e, t) {
32835
32853
  return {
32836
32854
  ...e,
32837
32855
  entryId: t.entryId,
@@ -32839,7 +32857,7 @@ function wF(e, t) {
32839
32857
  region: t.defaults.region
32840
32858
  };
32841
32859
  }
32842
- var TF = {
32860
+ var kF = {
32843
32861
  collectionIds: [],
32844
32862
  workState: "complete",
32845
32863
  entryId: "",
@@ -32853,24 +32871,24 @@ var TF = {
32853
32871
  //#endregion
32854
32872
  //#region src/page/NewJobSection.tsx
32855
32873
  i();
32856
- function EF(e) {
32874
+ function AF(e) {
32857
32875
  if (typeof e != "object" || !e) return !1;
32858
32876
  let t = Reflect.get(e, "slots");
32859
32877
  return Array.isArray(t);
32860
32878
  }
32861
- function DF(e) {
32879
+ function jF(e) {
32862
32880
  if (typeof e != "object" || !e) return [];
32863
32881
  let t = Reflect.get(e, "devices");
32864
32882
  return Array.isArray(t) ? t.flatMap((e) => {
32865
- let t = OF(e);
32883
+ let t = MF(e);
32866
32884
  return t === null ? [] : [t];
32867
32885
  }) : [];
32868
32886
  }
32869
- function OF(e) {
32887
+ function MF(e) {
32870
32888
  if (typeof e != "object" || !e) return null;
32871
32889
  let t = Reflect.get(e, "key"), n = Reflect.get(e, "backend"), r = Reflect.get(e, "device"), i = Reflect.get(e, "enabled"), a = Reflect.get(e, "format");
32872
32890
  if (typeof t != "string" || typeof n != "string" || typeof r != "string" || typeof i != "boolean" || typeof a != "string") return null;
32873
- let o = Reflect.get(e, "defaultModelId"), s = kF(Reflect.get(e, "steps"));
32891
+ let o = Reflect.get(e, "defaultModelId"), s = NF(Reflect.get(e, "steps"));
32874
32892
  return {
32875
32893
  key: t,
32876
32894
  backend: n,
@@ -32881,7 +32899,7 @@ function OF(e) {
32881
32899
  ...s === void 0 ? {} : { steps: s }
32882
32900
  };
32883
32901
  }
32884
- function kF(e) {
32902
+ function NF(e) {
32885
32903
  if (typeof e != "object" || !e) return;
32886
32904
  let t = {};
32887
32905
  for (let [n, r] of Object.entries(e)) {
@@ -32891,8 +32909,8 @@ function kF(e) {
32891
32909
  }
32892
32910
  return t;
32893
32911
  }
32894
- function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName: i, onStarted: o }) {
32895
- let s = Wl(), { nodes: c } = ja(), l = m(() => c.filter((e) => e.isOnline).map((e) => e.id), [c]), u = l.join("\0"), [d, f] = a(TF), [p, h] = a(""), [g, _] = a(""), [v, b] = a(""), [x, S] = a(null), [C, T] = a(!1), [E, D] = a(!1), O = oF(async () => {
32912
+ function PF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName: i, onStarted: o }) {
32913
+ let s = Wl(), { nodes: c } = ja(), l = m(() => c.filter((e) => e.isOnline).map((e) => e.id), [c]), u = l.join("\0"), [d, f] = a(kF), [p, h] = a(""), [g, _] = a(""), [v, b] = a(""), [x, S] = a(null), [C, T] = a(!1), [E, D] = a(!1), O = uF(async () => {
32896
32914
  if (n.length === 0) return {
32897
32915
  models: [],
32898
32916
  clusterRootModelIds: []
@@ -32901,14 +32919,14 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32901
32919
  return await Promise.all(l.map(async (n) => {
32902
32920
  try {
32903
32921
  let [r, i] = await Promise.all([e.pipelineOrchestrator.getNodeInferenceDevices.query({ nodeId: n }), e.pipelineExecutor.getSchema.query({ nodeId: n })]);
32904
- if (!EF(i)) return;
32922
+ if (!AF(i)) return;
32905
32923
  t.push({
32906
32924
  nodeId: n,
32907
- devices: DF(r),
32925
+ devices: jF(r),
32908
32926
  schema: i
32909
32927
  });
32910
32928
  } catch {}
32911
- })), yF(n, t);
32929
+ })), CF(n, t);
32912
32930
  }, [u, n.map((e) => e.modelId).join("\0")]), k = O.state.status === "ok" ? O.state.data.models : n.map((e) => ({
32913
32931
  modelId: e.modelId,
32914
32932
  label: e.label,
@@ -32921,7 +32939,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32921
32939
  ...e,
32922
32940
  holdoutCameras: []
32923
32941
  }, r = t.find((e) => e.configured) ?? t[0];
32924
- return n.entryId === "" && r !== void 0 && (n = wF(n, r)), n;
32942
+ return n.entryId === "" && r !== void 0 && (n = OF(n, r)), n;
32925
32943
  });
32926
32944
  }, [t]), y(() => {
32927
32945
  if (E || O.state.status !== "ok") return;
@@ -32935,7 +32953,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32935
32953
  k,
32936
32954
  E
32937
32955
  ]);
32938
- let j = CF(d), M = oF(async () => j === null ? null : e.training.planJob.query(j), [JSON.stringify(j)]), N = M.state.status === "ok" ? M.state.data : null;
32956
+ let j = DF(d), M = uF(async () => j === null ? null : e.training.planJob.query(j), [JSON.stringify(j)]), N = M.state.status === "ok" ? M.state.data : null;
32939
32957
  y(() => {
32940
32958
  N?.defaults != null && (_(N.defaults.maxCostUsd.toFixed(2)), b((N.defaults.maxRuntimeSec / 3600).toFixed(1)));
32941
32959
  }, [N?.defaults?.maxCostUsd, N?.defaults?.maxRuntimeSec]);
@@ -32966,7 +32984,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32966
32984
  });
32967
32985
  t.kind === "refused" ? S(`Refused (${t.reason}): ${t.detail}`) : o();
32968
32986
  } catch (e) {
32969
- S(aF(e));
32987
+ S(lF(e));
32970
32988
  } finally {
32971
32989
  T(!1);
32972
32990
  }
@@ -32993,7 +33011,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32993
33011
  value: d.entryId,
32994
33012
  onChange: (e) => {
32995
33013
  let n = t.find((t) => t.entryId === e.target.value);
32996
- n !== void 0 && f((e) => wF(e, n));
33014
+ n !== void 0 && f((e) => OF(e, n));
32997
33015
  },
32998
33016
  options: t.map((e) => ({
32999
33017
  value: e.entryId,
@@ -33037,9 +33055,9 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
33037
33055
  let t = e.target.value;
33038
33056
  (t === "complete" || t === "annotated_or_complete" || t === "any_annotated") && ne({ workState: t });
33039
33057
  },
33040
- options: Object.keys(SF).map((e) => ({
33058
+ options: Object.keys(EF).map((e) => ({
33041
33059
  value: e,
33042
- label: SF[e]
33060
+ label: EF[e]
33043
33061
  }))
33044
33062
  })]
33045
33063
  }),
@@ -33064,7 +33082,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
33064
33082
  children: [/* @__PURE__ */ V("span", { children: "Preset" }), /* @__PURE__ */ V(nd, {
33065
33083
  value: d.preset,
33066
33084
  onChange: (e) => ne({ preset: e.target.value === "quick" ? "quick" : e.target.value === "thorough" ? "thorough" : "standard" }),
33067
- options: Object.entries(xF).map(([e, t]) => ({
33085
+ options: Object.entries(TF).map(([e, t]) => ({
33068
33086
  value: e,
33069
33087
  label: t
33070
33088
  }))
@@ -33119,7 +33137,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
33119
33137
  className: "text-sm text-danger",
33120
33138
  children: ["Could not plan: ", M.state.error]
33121
33139
  }),
33122
- N !== null && /* @__PURE__ */ V(bF, {
33140
+ N !== null && /* @__PURE__ */ V(wF, {
33123
33141
  plan: N,
33124
33142
  cameraName: i
33125
33143
  }),
@@ -33169,7 +33187,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
33169
33187
  }
33170
33188
  //#endregion
33171
33189
  //#region src/page/SectionState.tsx
33172
- function jF({ state: e, empty: t, emptyAction: n, children: r }) {
33190
+ function FF({ state: e, empty: t, emptyAction: n, children: r }) {
33173
33191
  return e.status === "pending" ? /* @__PURE__ */ V(rd, { className: "h-16 w-full" }) : e.status === "error" ? /* @__PURE__ */ H("p", {
33174
33192
  className: "text-sm text-danger",
33175
33193
  children: ["Could not load: ", e.error]
@@ -33185,12 +33203,12 @@ function jF({ state: e, empty: t, emptyAction: n, children: r }) {
33185
33203
  //#endregion
33186
33204
  //#region src/page/JobsSection.tsx
33187
33205
  i();
33188
- function MF(e) {
33206
+ function IF(e) {
33189
33207
  let t = new Map((e ?? []).map((e) => [e.id, e.name]));
33190
33208
  return (e) => t.get(e) ?? e;
33191
33209
  }
33192
- function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJobsReload: a, cameraName: o, depsPending: s, depsError: c }) {
33193
- let l = m(() => MF(r), [r]);
33210
+ function LF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJobsReload: a, cameraName: o, depsPending: s, depsError: c }) {
33211
+ let l = m(() => IF(r), [r]);
33194
33212
  return /* @__PURE__ */ H("div", {
33195
33213
  className: "space-y-4",
33196
33214
  children: [s ? /* @__PURE__ */ V(Wg, {
@@ -33213,7 +33231,7 @@ function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
33213
33231
  message: c ?? "Providers, base models, or collections are unavailable."
33214
33232
  })
33215
33233
  })
33216
- }) : /* @__PURE__ */ V(AF, {
33234
+ }) : /* @__PURE__ */ V(PF, {
33217
33235
  trpc: e,
33218
33236
  providers: t,
33219
33237
  baseModels: n,
@@ -33225,10 +33243,10 @@ function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
33225
33243
  title: "Jobs",
33226
33244
  children: /* @__PURE__ */ V("div", {
33227
33245
  className: `${w} space-y-3`,
33228
- children: /* @__PURE__ */ V(jF, {
33246
+ children: /* @__PURE__ */ V(FF, {
33229
33247
  state: i,
33230
33248
  empty: "No training job yet.",
33231
- children: (t) => /* @__PURE__ */ V(gF, {
33249
+ children: (t) => /* @__PURE__ */ V(bF, {
33232
33250
  jobs: t,
33233
33251
  trpc: e,
33234
33252
  onChanged: a,
@@ -33242,17 +33260,17 @@ function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
33242
33260
  }
33243
33261
  //#endregion
33244
33262
  //#region src/page/provider-icon-url.ts
33245
- function PF(e, t) {
33263
+ function RF(e, t) {
33246
33264
  let n = t.trim();
33247
33265
  return n.length === 0 || n.includes("..") ? null : ae(`/api/addon-assets/${encodeURIComponent(e)}/${n}`);
33248
33266
  }
33249
33267
  //#endregion
33250
33268
  //#region src/page/ProviderSection.tsx
33251
33269
  i();
33252
- function FF(e) {
33270
+ function zF(e) {
33253
33271
  return e.map((e) => `${e.typeId}\0${e.label}\0${e.addonId}\0${e.iconAsset}`).join("\n");
33254
33272
  }
33255
- function IF({ state: e }) {
33273
+ function BF({ state: e }) {
33256
33274
  if (e.kind === "idle") return null;
33257
33275
  if (e.kind === "running") return /* @__PURE__ */ V("span", {
33258
33276
  className: "text-xs text-foreground-subtle",
@@ -33271,7 +33289,7 @@ function IF({ state: e }) {
33271
33289
  children: [t.reason ?? "refused", t.detail === void 0 ? "" : `: ${t.detail}`]
33272
33290
  });
33273
33291
  }
33274
- function LF({ entry: e, trpc: t }) {
33292
+ function VF({ entry: e, trpc: t }) {
33275
33293
  let [n, r] = a({ kind: "idle" }), i = e.defaults, o = async () => {
33276
33294
  r({ kind: "running" });
33277
33295
  try {
@@ -33285,7 +33303,7 @@ function LF({ entry: e, trpc: t }) {
33285
33303
  } catch (e) {
33286
33304
  r({
33287
33305
  kind: "error",
33288
- message: aF(e)
33306
+ message: lF(e)
33289
33307
  });
33290
33308
  }
33291
33309
  };
@@ -33333,7 +33351,7 @@ function LF({ entry: e, trpc: t }) {
33333
33351
  disabled: !e.configured || n.kind === "running",
33334
33352
  onClick: () => void o(),
33335
33353
  children: "Test credentials"
33336
- }), /* @__PURE__ */ V(IF, { state: n })]
33354
+ }), /* @__PURE__ */ V(BF, { state: n })]
33337
33355
  })
33338
33356
  ]
33339
33357
  }), /* @__PURE__ */ H("section", {
@@ -33357,11 +33375,11 @@ function LF({ entry: e, trpc: t }) {
33357
33375
  ]
33358
33376
  })] });
33359
33377
  }
33360
- function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r }) {
33361
- let i = ed("training-provider"), o = Wl(), c = LA({
33378
+ function HF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r }) {
33379
+ let i = ed("training-provider"), o = Wl(), c = VA({
33362
33380
  editKey: "edit",
33363
33381
  newKey: "new"
33364
- }), [l, d] = a(!1), [f, p] = a(null), [h, g] = a(""), [_, v] = a(""), b = oF(() => e.trainingProvider.describe.query({}), []), x = oF(() => e.trainingProvider.describeTypes.query({}), []), S = x.state.status === "ok" ? x.state.data : null, C = S === null ? "" : FF(S), w = u(S);
33382
+ }), [l, d] = a(!1), [f, p] = a(null), [h, g] = a(""), [_, v] = a(""), b = uF(() => e.trainingProvider.describe.query({}), []), x = uF(() => e.trainingProvider.describeTypes.query({}), []), S = x.state.status === "ok" ? x.state.data : null, C = S === null ? "" : zF(S), w = u(S);
33365
33383
  w.current = S;
33366
33384
  let T = m(() => {
33367
33385
  let e = /* @__PURE__ */ new Map(), t = w.current;
@@ -33396,7 +33414,7 @@ function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
33396
33414
  });
33397
33415
  b.reload(), x.reload(), c.openEdit(n.entryId);
33398
33416
  } catch (e) {
33399
- p(aF(e));
33417
+ p(lF(e));
33400
33418
  } finally {
33401
33419
  d(!1);
33402
33420
  }
@@ -33432,7 +33450,7 @@ function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
33432
33450
  render: (e) => /* @__PURE__ */ H("div", {
33433
33451
  className: "flex min-w-0 items-center gap-2",
33434
33452
  children: [/* @__PURE__ */ V("img", {
33435
- src: PF(e.addonId, e.iconAsset),
33453
+ src: RF(e.addonId, e.iconAsset),
33436
33454
  alt: "",
33437
33455
  className: "h-4 w-4 shrink-0"
33438
33456
  }), /* @__PURE__ */ V("span", {
@@ -33583,7 +33601,7 @@ function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
33583
33601
  className: "text-xs text-foreground-muted",
33584
33602
  children: "Create stores the entry; settings and credentials open next."
33585
33603
  })
33586
- ] }) : O === null ? null : /* @__PURE__ */ V(LF, {
33604
+ ] }) : O === null ? null : /* @__PURE__ */ V(VF, {
33587
33605
  entry: O,
33588
33606
  trpc: e
33589
33607
  })
@@ -33593,24 +33611,24 @@ function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
33593
33611
  }
33594
33612
  //#endregion
33595
33613
  //#region src/page/training-tab.ts
33596
- function zF(e) {
33614
+ function UF(e) {
33597
33615
  let t = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get("tab");
33598
33616
  return t === "jobs" || t === "providers" || t === "frames" ? t : "frames";
33599
33617
  }
33600
33618
  //#endregion
33601
33619
  //#region src/page.tsx
33602
33620
  i();
33603
- var BF = 5e3;
33604
- function VF(e) {
33621
+ var WF = 5e3;
33622
+ function GF(e) {
33605
33623
  let t = new URL(window.location.href);
33606
33624
  t.searchParams.set("tab", e), window.history.replaceState({}, "", t.toString());
33607
33625
  }
33608
- function HF({ trpc: e, navigate: t }) {
33609
- let [n, r] = a(() => typeof window > "u" ? "frames" : zF(window.location.search)), [i, o] = a(!1), c = s((e) => {
33610
- r(e), VF(e);
33611
- }, []), l = oF(() => e.trainingProvider.describe.query({}), []), u = oF(() => e.training.listBaseModels.query({}), []), d = oF(() => e.pipelineAnalytics.listRetrainCollections.query({}), []), f = oF(() => e.deviceManager.listAll.query({ projection: "slim" }), []), p = oF(() => e.training.listJobs.query({}), [], {
33612
- pollMs: BF,
33613
- poll: WP
33626
+ function KF({ trpc: e, navigate: t }) {
33627
+ let [n, r] = a(() => typeof window > "u" ? "frames" : UF(window.location.search)), [i, o] = a(!1), c = s((e) => {
33628
+ r(e), GF(e);
33629
+ }, []), l = uF(() => e.trainingProvider.describe.query({}), []), u = uF(() => e.training.listBaseModels.query({}), []), d = uF(() => e.pipelineAnalytics.listRetrainCollections.query({}), []), f = uF(() => e.deviceManager.listAll.query({ projection: "slim" }), []), p = uF(() => e.training.listJobs.query({}), [], {
33630
+ pollMs: WF,
33631
+ poll: JP
33614
33632
  }), h = m(() => new Map(f.state.status === "ok" ? f.state.data.map((e) => [e.id, e.name]) : []), [f.state]), g = s((e) => h.get(e) ?? `#${String(e)}`, [h]), _ = l.state.status === "pending" || u.state.status === "pending" || d.state.status === "pending", v = (() => {
33615
33633
  let e = [];
33616
33634
  return l.state.status === "error" && e.push(`providers: ${l.state.error}`), u.state.status === "error" && e.push(`base models: ${u.state.error}`), d.state.status === "error" && e.push(`collections: ${d.state.error}`), e.length > 0 ? e.join("; ") : null;
@@ -33646,14 +33664,14 @@ function HF({ trpc: e, navigate: t }) {
33646
33664
  })
33647
33665
  ] })
33648
33666
  }),
33649
- n === "frames" ? /* @__PURE__ */ V(zP, {}) : null,
33650
- n === "providers" ? /* @__PURE__ */ V(RF, {
33667
+ n === "frames" ? /* @__PURE__ */ V(UP, {}) : null,
33668
+ n === "providers" ? /* @__PURE__ */ V(HF, {
33651
33669
  trpc: e,
33652
33670
  navigate: t,
33653
33671
  createRequested: i,
33654
33672
  onCreateConsumed: () => o(!1)
33655
33673
  }) : null,
33656
- n === "jobs" ? /* @__PURE__ */ V(NF, {
33674
+ n === "jobs" ? /* @__PURE__ */ V(LF, {
33657
33675
  trpc: e,
33658
33676
  providers: l.state.status === "ok" ? l.state.data : null,
33659
33677
  baseModels: u.state.status === "ok" ? u.state.data : null,
@@ -33668,4 +33686,4 @@ function HF({ trpc: e, navigate: t }) {
33668
33686
  });
33669
33687
  }
33670
33688
  //#endregion
33671
- export { BF as JOB_POLL_MS, HF as default, zF as readTrainingTab };
33689
+ export { WF as JOB_POLL_MS, KF as default, UF as readTrainingTab };