@camstack/addon-pipeline-orchestrator 1.2.645 → 1.2.646

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,13 +1,13 @@
1
1
  import { t as e } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-BiLBDmU5.mjs";
2
- import { n as t, r as n, t as r } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-nDsPG0Vk.mjs";
2
+ import { n as t, r as n, t as r } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CImRTRiM.mjs";
3
3
  import { a as i, c as a, i as o, n as s, o as c, r as l, s as u, t as d } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react__loadShare__.js-a8tvh93M.mjs";
4
- import { C as f, D as p, E as m, O as h, S as g, T as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as T, i as E, l as D, m as O, n as k, o as A, p as j, r as M, s as N, t as P, u as F, v as I, w as L, x as R, y as z } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DNaztdEQ.mjs";
5
- import { n as B, r as V, t as H } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-yD-rMaFX.mjs";
4
+ import { A as f, C as p, D as m, E as h, O as g, S as _, T as v, _ as y, a as b, b as x, c as S, d as C, f as w, g as T, h as E, i as D, k as O, l as k, m as A, n as j, o as M, p as N, r as P, s as F, t as I, u as L, v as R, w as z, x as ee, y as B } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CoZ9XX3X.mjs";
5
+ import { n as V, r as H, t as U } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-yD-rMaFX.mjs";
6
6
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
7
- var U = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), W = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), G = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ee = (e) => {
8
- let t = G(e);
7
+ var W = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), te = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ne = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), G = (e) => {
8
+ let t = ne(e);
9
9
  return t.charAt(0).toUpperCase() + t.slice(1);
10
- }, te = {
10
+ }, re = {
11
11
  xmlns: "http://www.w3.org/2000/svg",
12
12
  width: 24,
13
13
  height: 24,
@@ -17,34 +17,34 @@ var U = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
17
17
  strokeWidth: 2,
18
18
  strokeLinecap: "round",
19
19
  strokeLinejoin: "round"
20
- }, ne = (e) => {
20
+ }, ie = (e) => {
21
21
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
22
22
  return !1;
23
- }, re = s(({ color: e = "currentColor", size: t = 24, strokeWidth: n = 2, absoluteStrokeWidth: r, className: i = "", children: a, iconNode: o, ...s }, c) => d("svg", {
23
+ }, ae = s(({ color: e = "currentColor", size: t = 24, strokeWidth: n = 2, absoluteStrokeWidth: r, className: i = "", children: a, iconNode: o, ...s }, c) => d("svg", {
24
24
  ref: c,
25
- ...te,
25
+ ...re,
26
26
  width: t,
27
27
  height: t,
28
28
  stroke: e,
29
29
  strokeWidth: r ? Number(n) * 24 / Number(t) : n,
30
- className: U("lucide", i),
31
- ...!a && !ne(s) && { "aria-hidden": "true" },
30
+ className: W("lucide", i),
31
+ ...!a && !ie(s) && { "aria-hidden": "true" },
32
32
  ...s
33
33
  }, [...o.map(([e, t]) => d(e, t)), ...Array.isArray(a) ? a : [a]])), K = (e, t) => {
34
- let n = s(({ className: n, ...r }, i) => d(re, {
34
+ let n = s(({ className: n, ...r }, i) => d(ae, {
35
35
  ref: i,
36
36
  iconNode: t,
37
- className: U(`lucide-${W(ee(e))}`, `lucide-${e}`, n),
37
+ className: W(`lucide-${te(G(e))}`, `lucide-${e}`, n),
38
38
  ...r
39
39
  }));
40
- return n.displayName = ee(e), n;
41
- }, ie = K("activity", [["path", {
40
+ return n.displayName = G(e), n;
41
+ }, oe = K("activity", [["path", {
42
42
  d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
43
43
  key: "169zse"
44
- }]]), ae = K("check", [["path", {
44
+ }]]), se = K("check", [["path", {
45
45
  d: "M20 6 9 17l-5-5",
46
46
  key: "1gmf2c"
47
- }]]), oe = K("cpu", [
47
+ }]]), ce = K("cpu", [
48
48
  ["path", {
49
49
  d: "M12 20v2",
50
50
  key: "1lh1kg"
@@ -109,7 +109,7 @@ var U = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
109
109
  rx: "1",
110
110
  key: "z9xiuo"
111
111
  }]
112
- ]), se = K("eye", [["path", {
112
+ ]), le = K("eye", [["path", {
113
113
  d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
114
114
  key: "1nclc0"
115
115
  }], ["circle", {
@@ -117,25 +117,25 @@ var U = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
117
117
  cy: "12",
118
118
  r: "3",
119
119
  key: "1v7zrd"
120
- }]]), ce = K("gauge", [["path", {
120
+ }]]), ue = K("gauge", [["path", {
121
121
  d: "m12 14 4-4",
122
122
  key: "9kzdfg"
123
123
  }], ["path", {
124
124
  d: "M3.34 19a10 10 0 1 1 17.32 0",
125
125
  key: "19p75a"
126
- }]]), le = K("hexagon", [["path", {
126
+ }]]), de = K("hexagon", [["path", {
127
127
  d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",
128
128
  key: "yt0hxn"
129
- }]]), ue = K("minus", [["path", {
129
+ }]]), fe = K("minus", [["path", {
130
130
  d: "M5 12h14",
131
131
  key: "1ays0h"
132
- }]]), de = K("plus", [["path", {
132
+ }]]), pe = K("plus", [["path", {
133
133
  d: "M5 12h14",
134
134
  key: "1ays0h"
135
135
  }], ["path", {
136
136
  d: "M12 5v14",
137
137
  key: "s699le"
138
- }]]), fe = K("save", [
138
+ }]]), me = K("save", [
139
139
  ["path", {
140
140
  d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
141
141
  key: "1c8476"
@@ -169,7 +169,7 @@ var U = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
169
169
  d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
170
170
  key: "e791ji"
171
171
  }]
172
- ]), pe = K("video", [["path", {
172
+ ]), he = K("video", [["path", {
173
173
  d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
174
174
  key: "ftymec"
175
175
  }], ["rect", {
@@ -179,7 +179,7 @@ var U = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
179
179
  height: "12",
180
180
  rx: "2",
181
181
  key: "158x01"
182
- }]]), me = K("volume-2", [
182
+ }]]), ge = K("volume-2", [
183
183
  ["path", {
184
184
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
185
185
  key: "uqj9uw"
@@ -198,7 +198,7 @@ var U = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
198
198
  }], ["path", {
199
199
  d: "m6 6 12 12",
200
200
  key: "d8bk6v"
201
- }]]), { useT: Y, Trans: he, translate: X } = p("pipeline-orchestrator", {
201
+ }]]), { useT: Y, Trans: _e, translate: X } = O("pipeline-orchestrator", {
202
202
  en: {
203
203
  quickStats: {
204
204
  requiresDevice: "PipelineQuickStats requires a deviceId",
@@ -360,27 +360,27 @@ var U = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
360
360
  });
361
361
  //#endregion
362
362
  //#region src/widgets/PipelineQuickStats.tsx
363
- function ge(e) {
363
+ function ve(e) {
364
364
  let { t } = Y();
365
- return e.deviceId === void 0 ? /* @__PURE__ */ B("div", {
365
+ return e.deviceId === void 0 ? /* @__PURE__ */ V("div", {
366
366
  className: "rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",
367
367
  children: t("quickStats.requiresDevice")
368
- }) : /* @__PURE__ */ B(_e, { deviceId: e.deviceId });
368
+ }) : /* @__PURE__ */ V(ye, { deviceId: e.deviceId });
369
369
  }
370
- function _e({ deviceId: t }) {
371
- let { t: r } = Y(), i = x();
372
- M(["pipelineOrchestrator", "getPipelineAssignment"], [
370
+ function ye({ deviceId: t }) {
371
+ let { t: r } = Y(), i = S();
372
+ P(["pipelineOrchestrator", "getPipelineAssignment"], [
373
373
  "pipeline.camera-assigned",
374
374
  "pipeline.camera-unassigned",
375
375
  "pipeline.camera-updated"
376
- ]), M(["pipelineRunner", "getCameraMetrics"], ["pipeline.camera-metrics-snapshot"]);
377
- let { data: a } = E({ deviceId: t }, { staleTime: 3e4 }), o = a?.agentNodeId ?? null, s = typeof o == "string" && o.length > 0 && !o.startsWith("addon:") ? o : void 0, { data: c } = y({
376
+ ]), P(["pipelineRunner", "getCameraMetrics"], ["pipeline.camera-metrics-snapshot"]);
377
+ let { data: a } = D({ deviceId: t }, { staleTime: 3e4 }), o = a?.agentNodeId ?? null, s = typeof o == "string" && o.length > 0 && !o.startsWith("addon:") ? o : void 0, { data: c } = b({
378
378
  deviceId: t,
379
379
  ...s ? { nodeId: s } : {}
380
380
  }, {
381
381
  staleTime: 2e3,
382
382
  retry: !1
383
- }), l = N(), u = P(l.trpcClient, t), { data: d } = e({
383
+ }), l = F(), u = I(l.trpcClient, t), { data: d } = e({
384
384
  queryKey: [
385
385
  "device",
386
386
  t,
@@ -390,7 +390,7 @@ function _e({ deviceId: t }) {
390
390
  enabled: !!u,
391
391
  refetchInterval: 5e3,
392
392
  retry: !1
393
- }), { data: f } = e({
393
+ }), { data: p } = e({
394
394
  queryKey: [
395
395
  "device",
396
396
  t,
@@ -400,12 +400,12 @@ function _e({ deviceId: t }) {
400
400
  enabled: !!u,
401
401
  refetchInterval: 2e3,
402
402
  retry: !1
403
- }), { data: p } = e({
403
+ }), { data: m } = e({
404
404
  queryKey: ["recordingArchive.getStatus", t],
405
405
  queryFn: async () => await l.trpcClient.recordingArchive.getStatus.query({ deviceId: t }),
406
406
  refetchInterval: 5e3,
407
407
  retry: !1
408
- }), { data: m } = e({
408
+ }), { data: h } = e({
409
409
  queryKey: ["recordingArchive.getDeviceConfig", t],
410
410
  queryFn: async () => await l.trpcClient.recordingArchive.getDeviceConfig.query({ deviceId: t }),
411
411
  staleTime: 3e4,
@@ -422,51 +422,51 @@ function _e({ deviceId: t }) {
422
422
  }),
423
423
  staleTime: 3e4,
424
424
  retry: !1
425
- }), _ = n(g, "detectionMode"), v = typeof _ == "string" ? _ : null, b = c?.phase ?? null, C = v, w = Number(c?.actualFps ?? 0), T = Number(c?.configuredFps ?? 0), D = Number(c?.avgInferenceTimeMs ?? 0), O = Number(c?.queueDepth ?? 0), k = Number(c?.droppedFrames ?? 0), A = h(b ?? "watching", i), j = d?.length ?? 0, F = f?.level.dbfs ?? null, I = typeof F == "number" ? `${F.toFixed(1)} dBFS` : "—", L = p?.enabled ?? !1, z = p?.activeMode ?? "off", H = L && z !== "off", U = L ? z === "off" ? r("quickStats.rec.idle") : z === "continuous" ? r("quickStats.rec.continuous") : z === "onMotion" ? r("quickStats.rec.onMotion") : z === "onAudioThreshold" ? r("quickStats.rec.onAudio") : z : r("quickStats.rec.disabled"), W = (m?.profiles ?? []).join(", "), G = p ? `${ve(p.storageBytes ?? 0)}${W ? ` · ${W}` : ""}` : void 0;
426
- return /* @__PURE__ */ V("div", {
427
- className: S,
425
+ }), v = n(g, "detectionMode"), y = typeof v == "string" ? v : null, x = c?.phase ?? null, w = y, T = Number(c?.actualFps ?? 0), E = Number(c?.configuredFps ?? 0), O = Number(c?.avgInferenceTimeMs ?? 0), k = Number(c?.queueDepth ?? 0), A = Number(c?.droppedFrames ?? 0), j = f(x ?? "watching", i), M = d?.length ?? 0, N = p?.level.dbfs ?? null, L = typeof N == "number" ? `${N.toFixed(1)} dBFS` : "—", R = m?.enabled ?? !1, z = m?.activeMode ?? "off", ee = R && z !== "off", B = R ? z === "off" ? r("quickStats.rec.idle") : z === "continuous" ? r("quickStats.rec.continuous") : z === "onMotion" ? r("quickStats.rec.onMotion") : z === "onAudioThreshold" ? r("quickStats.rec.onAudio") : z : r("quickStats.rec.disabled"), U = (h?.profiles ?? []).join(", "), W = m ? `${be(m.storageBytes ?? 0)}${U ? ` · ${U}` : ""}` : void 0;
426
+ return /* @__PURE__ */ H("div", {
427
+ className: C,
428
428
  children: [
429
- /* @__PURE__ */ B(R, {
430
- icon: ie,
429
+ /* @__PURE__ */ V(_, {
430
+ icon: oe,
431
431
  label: r("quickStats.phase"),
432
- value: A.label,
433
- valueClassName: A.textColor,
434
- subtext: C ?? void 0
432
+ value: j.label,
433
+ valueClassName: j.textColor,
434
+ subtext: w ?? void 0
435
435
  }),
436
- /* @__PURE__ */ B(R, {
437
- icon: ce,
436
+ /* @__PURE__ */ V(_, {
437
+ icon: ue,
438
438
  label: r("quickStats.detectionFps"),
439
- value: `${w.toFixed(1)}`,
440
- subtext: T > 0 ? r("quickStats.target", { value: T }) : void 0
439
+ value: `${T.toFixed(1)}`,
440
+ subtext: E > 0 ? r("quickStats.target", { value: E }) : void 0
441
441
  }),
442
- /* @__PURE__ */ B(R, {
443
- icon: oe,
442
+ /* @__PURE__ */ V(_, {
443
+ icon: ce,
444
444
  label: r("quickStats.inference"),
445
- value: `${D.toFixed(1)} ms`,
446
- subtext: O > 0 ? r("quickStats.queue", { value: O }) : void 0
445
+ value: `${O.toFixed(1)} ms`,
446
+ subtext: k > 0 ? r("quickStats.queue", { value: k }) : void 0
447
447
  }),
448
- /* @__PURE__ */ B(R, {
449
- icon: se,
448
+ /* @__PURE__ */ V(_, {
449
+ icon: le,
450
450
  label: r("quickStats.activeTracks"),
451
- value: String(j),
452
- subtext: k > 0 ? r("quickStats.dropped", { value: k }) : void 0
451
+ value: String(M),
452
+ subtext: A > 0 ? r("quickStats.dropped", { value: A }) : void 0
453
453
  }),
454
- /* @__PURE__ */ B(R, {
455
- icon: me,
454
+ /* @__PURE__ */ V(_, {
455
+ icon: ge,
456
456
  label: r("quickStats.currentDb"),
457
- value: I
457
+ value: L
458
458
  }),
459
- /* @__PURE__ */ B(R, {
460
- icon: pe,
459
+ /* @__PURE__ */ V(_, {
460
+ icon: he,
461
461
  label: r("quickStats.recording"),
462
- value: U,
463
- valueClassName: H ? "text-success" : void 0,
464
- subtext: G
462
+ value: B,
463
+ valueClassName: ee ? "text-success" : void 0,
464
+ subtext: W
465
465
  })
466
466
  ]
467
467
  });
468
468
  }
469
- function ve(e) {
469
+ function be(e) {
470
470
  if (!Number.isFinite(e) || e <= 0) return "0 B";
471
471
  let t = [
472
472
  "B",
@@ -479,68 +479,72 @@ function ve(e) {
479
479
  }
480
480
  //#endregion
481
481
  //#region src/widgets/zone-editor/ZoneList.tsx
482
- var ye = {
482
+ var xe = {
483
483
  polygon: "bg-info/10 text-info",
484
484
  tripwire: "bg-warning/10 text-warning"
485
485
  };
486
- function be({ zones: e, selectedZoneId: t, drawingKind: n, onSelectZone: r, onDeleteZone: i, onStartDraw: a, onCancelDraw: o }) {
486
+ function Se({ zones: e, selectedZoneId: t, drawingKind: n, onSelectZone: r, onDeleteZone: i, onStartDraw: a, onCancelDraw: o }) {
487
487
  let { t: s } = Y();
488
- return /* @__PURE__ */ V("div", {
488
+ return /* @__PURE__ */ H("div", {
489
489
  className: "flex flex-col gap-2",
490
- children: [/* @__PURE__ */ B("div", {
490
+ children: [/* @__PURE__ */ V("div", {
491
491
  className: "flex items-center gap-1",
492
- children: n ? /* @__PURE__ */ V("button", {
492
+ children: n ? /* @__PURE__ */ H(v, {
493
+ variant: "unstyled",
493
494
  type: "button",
494
495
  onClick: o,
495
496
  className: "inline-flex items-center justify-center gap-1 rounded border border-amber-500/30 bg-amber-500/10 text-amber-400 hover:bg-amber-500/20 transition-colors h-8 px-3 text-[11px] font-medium",
496
497
  title: s("zoneList.cancelDrawing"),
497
- children: [/* @__PURE__ */ B(J, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ B("span", { children: s("zoneList.cancel") })]
498
- }) : /* @__PURE__ */ V(H, { children: [/* @__PURE__ */ B("button", {
498
+ children: [/* @__PURE__ */ V(J, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ V("span", { children: s("zoneList.cancel") })]
499
+ }) : /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ V(v, {
500
+ variant: "unstyled",
499
501
  type: "button",
500
502
  onClick: () => a("polygon"),
501
503
  className: "inline-flex items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors h-8 w-8",
502
504
  title: s("zoneList.addPolygon"),
503
505
  "aria-label": s("zoneList.addPolygon"),
504
- children: /* @__PURE__ */ B(le, { className: "h-4 w-4" })
505
- }), /* @__PURE__ */ B("button", {
506
+ children: /* @__PURE__ */ V(de, { className: "h-4 w-4" })
507
+ }), /* @__PURE__ */ V(v, {
508
+ variant: "unstyled",
506
509
  type: "button",
507
510
  onClick: () => a("tripwire"),
508
511
  className: "inline-flex items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors h-8 w-8",
509
512
  title: s("zoneList.addTripwire"),
510
513
  "aria-label": s("zoneList.addTripwire"),
511
- children: /* @__PURE__ */ B(ue, { className: "h-5 w-5 stroke-[2.5]" })
514
+ children: /* @__PURE__ */ V(fe, { className: "h-5 w-5 stroke-[2.5]" })
512
515
  })] })
513
- }), e.length === 0 ? /* @__PURE__ */ B("p", {
516
+ }), e.length === 0 ? /* @__PURE__ */ V("p", {
514
517
  className: "text-center text-[10px] text-foreground-subtle py-3 leading-tight",
515
518
  children: s("zoneList.empty")
516
- }) : /* @__PURE__ */ B("div", {
519
+ }) : /* @__PURE__ */ V("div", {
517
520
  className: "flex flex-col gap-1",
518
521
  children: e.map((e) => {
519
522
  let n = e.id === t;
520
- return /* @__PURE__ */ V("div", {
523
+ return /* @__PURE__ */ H("div", {
521
524
  className: ["flex items-center gap-1.5 rounded border px-1.5 py-1 cursor-pointer transition-colors", n ? "border-primary/50 bg-primary/10" : "border-border bg-surface hover:bg-surface-hover"].join(" "),
522
525
  onClick: () => r(n ? null : e.id),
523
526
  children: [
524
- /* @__PURE__ */ B("div", {
527
+ /* @__PURE__ */ V("div", {
525
528
  className: "h-2.5 w-2.5 rounded-sm flex-shrink-0",
526
529
  style: { backgroundColor: e.color }
527
530
  }),
528
- /* @__PURE__ */ B("span", {
531
+ /* @__PURE__ */ V("span", {
529
532
  className: "flex-1 truncate text-[11px] font-medium text-foreground",
530
533
  children: e.name
531
534
  }),
532
- /* @__PURE__ */ B("span", {
533
- className: `inline-flex items-center rounded-full px-1.5 py-0.5 text-[9px] font-medium flex-shrink-0 ${ye[e.kind]}`,
535
+ /* @__PURE__ */ V("span", {
536
+ className: `inline-flex items-center rounded-full px-1.5 py-0.5 text-[9px] font-medium flex-shrink-0 ${xe[e.kind]}`,
534
537
  children: e.kind === "tripwire" ? s("zone.kind.tripwire") : s("zone.kind.polygon")
535
538
  }),
536
- /* @__PURE__ */ B("button", {
539
+ /* @__PURE__ */ V(v, {
540
+ variant: "unstyled",
537
541
  type: "button",
538
542
  title: s("zoneList.deleteZone"),
539
543
  className: "p-0.5 text-foreground-subtle hover:text-danger rounded transition-colors flex-shrink-0",
540
544
  onClick: (t) => {
541
545
  t.stopPropagation(), i(e.id);
542
546
  },
543
- children: /* @__PURE__ */ B(q, { className: "h-3 w-3" })
547
+ children: /* @__PURE__ */ V(q, { className: "h-3 w-3" })
544
548
  })
545
549
  ]
546
550
  }, e.id);
@@ -550,7 +554,7 @@ function be({ zones: e, selectedZoneId: t, drawingKind: n, onSelectZone: r, onDe
550
554
  }
551
555
  //#endregion
552
556
  //#region src/widgets/zone-editor/ZoneForm.tsx
553
- var xe = [
557
+ var Ce = [
554
558
  "#3b82f6",
555
559
  "#10b981",
556
560
  "#f59e0b",
@@ -560,24 +564,24 @@ var xe = [
560
564
  "#f97316",
561
565
  "#ec4899"
562
566
  ];
563
- function Se({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
564
- let { t: i } = Y(), a = D(), o = (e) => a?.updateDraft({ name: e }), s = (e) => a?.updateDraft({ color: e });
565
- return /* @__PURE__ */ V("div", {
567
+ function we({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
568
+ let { t: i } = Y(), a = k(), o = (e) => a?.updateDraft({ name: e }), s = (e) => a?.updateDraft({ color: e });
569
+ return /* @__PURE__ */ H("div", {
566
570
  className: "flex flex-col gap-2",
567
571
  children: [
568
- /* @__PURE__ */ V("div", {
572
+ /* @__PURE__ */ H("div", {
569
573
  className: "flex items-center justify-between",
570
- children: [/* @__PURE__ */ B("h3", {
574
+ children: [/* @__PURE__ */ V("h3", {
571
575
  className: "text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider",
572
576
  children: i("zoneForm.editing")
573
- }), /* @__PURE__ */ B("span", {
577
+ }), /* @__PURE__ */ V("span", {
574
578
  className: "inline-flex items-center rounded-full px-1.5 py-0.5 text-[9px] font-medium bg-surface border border-border text-foreground-subtle",
575
579
  children: e.kind === "tripwire" ? i("zone.kind.tripwire") : i("zone.kind.polygon")
576
580
  })]
577
581
  }),
578
- /* @__PURE__ */ B("input", {
582
+ /* @__PURE__ */ V(T, {
579
583
  type: "text",
580
- className: O,
584
+ className: A,
581
585
  value: e.name,
582
586
  autoFocus: !0,
583
587
  onChange: (e) => o(e.target.value),
@@ -586,9 +590,10 @@ function Se({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
586
590
  },
587
591
  placeholder: i("zoneForm.namePlaceholder")
588
592
  }),
589
- /* @__PURE__ */ B("div", {
593
+ /* @__PURE__ */ V("div", {
590
594
  className: "flex flex-wrap gap-1",
591
- children: xe.map((t) => /* @__PURE__ */ B("button", {
595
+ children: Ce.map((t) => /* @__PURE__ */ V(v, {
596
+ variant: "unstyled",
592
597
  type: "button",
593
598
  title: t,
594
599
  className: ["h-4 w-4 rounded border-2 cursor-pointer transition-transform hover:scale-110", e.color === t ? "border-white scale-110" : "border-transparent"].join(" "),
@@ -596,53 +601,56 @@ function Se({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
596
601
  onClick: () => s(t)
597
602
  }, t))
598
603
  }),
599
- /* @__PURE__ */ V("div", {
604
+ /* @__PURE__ */ H("div", {
600
605
  className: "flex items-center gap-1.5",
601
- children: [/* @__PURE__ */ B("input", {
606
+ children: [/* @__PURE__ */ V(T, {
602
607
  type: "color",
603
608
  className: "h-6 w-6 rounded border border-border bg-background cursor-pointer p-0.5",
604
609
  value: e.color,
605
610
  onChange: (e) => s(e.target.value)
606
- }), /* @__PURE__ */ B("input", {
611
+ }), /* @__PURE__ */ V(T, {
607
612
  type: "text",
608
- className: `${O} font-mono`,
613
+ className: `${A} font-mono`,
609
614
  value: e.color,
610
615
  placeholder: "#000000",
611
616
  onChange: (e) => s(e.target.value)
612
617
  })]
613
618
  }),
614
- /* @__PURE__ */ V("p", {
619
+ /* @__PURE__ */ H("p", {
615
620
  className: "text-[9px] text-foreground-subtle leading-tight",
616
621
  children: [e.kind === "tripwire" ? i("zoneForm.twoPoints") : i("zoneForm.pointCount", { count: e.points.length }), e.points.length > 0 && ` ${i("zoneForm.dragHint")}`]
617
622
  }),
618
- /* @__PURE__ */ V("div", {
623
+ /* @__PURE__ */ H("div", {
619
624
  className: "flex items-center gap-1.5",
620
- children: [/* @__PURE__ */ V("button", {
625
+ children: [/* @__PURE__ */ H(v, {
626
+ variant: "unstyled",
621
627
  type: "button",
622
628
  onClick: t,
623
629
  className: "inline-flex items-center justify-center gap-1 rounded border border-primary/40 bg-primary/10 text-primary hover:bg-primary/20 transition-colors h-7 flex-1 text-[11px] font-medium",
624
630
  title: i("zoneForm.saveTitle"),
625
- children: [/* @__PURE__ */ B(ae, { className: "h-3 w-3" }), i("zoneForm.save")]
626
- }), /* @__PURE__ */ V("button", {
631
+ children: [/* @__PURE__ */ V(se, { className: "h-3 w-3" }), i("zoneForm.save")]
632
+ }), /* @__PURE__ */ H(v, {
633
+ variant: "unstyled",
627
634
  type: "button",
628
635
  onClick: n,
629
636
  className: "inline-flex items-center justify-center gap-1 rounded border border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors h-7 px-3 text-[11px] font-medium",
630
637
  title: i("zoneForm.discardTitle"),
631
- children: [/* @__PURE__ */ B(J, { className: "h-3 w-3" }), i("zoneForm.discard")]
638
+ children: [/* @__PURE__ */ V(J, { className: "h-3 w-3" }), i("zoneForm.discard")]
632
639
  })]
633
640
  }),
634
- /* @__PURE__ */ V("button", {
641
+ /* @__PURE__ */ H(v, {
642
+ variant: "unstyled",
635
643
  type: "button",
636
644
  onClick: r,
637
- className: `${j} w-full`,
638
- children: [/* @__PURE__ */ B(q, { className: "h-3 w-3" }), i("zoneForm.delete")]
645
+ className: `${N} w-full`,
646
+ children: [/* @__PURE__ */ V(q, { className: "h-3 w-3" }), i("zoneForm.delete")]
639
647
  })
640
648
  ]
641
649
  });
642
650
  }
643
651
  //#endregion
644
652
  //#region src/widgets/zone-editor/zone-rule-stage.ts
645
- function Ce(e) {
653
+ function Te(e) {
646
654
  switch (e) {
647
655
  case "motion": return X("rules.title.motion");
648
656
  case "detection": return X("rules.title.detection");
@@ -652,13 +660,13 @@ function Ce(e) {
652
660
  t.options;
653
661
  //#endregion
654
662
  //#region src/widgets/zone-editor/zone-rule-class-filter.ts
655
- var we = new Set(["detection"]);
656
- function Te(e) {
657
- return we.has(e);
663
+ var Ee = new Set(["detection"]);
664
+ function De(e) {
665
+ return Ee.has(e);
658
666
  }
659
667
  //#endregion
660
668
  //#region src/widgets/zone-editor/types.ts
661
- function Ee(e) {
669
+ function Oe(e) {
662
670
  let t = e.kind === "tripwire" ? {
663
671
  kind: "line",
664
672
  points: e.points
@@ -673,13 +681,13 @@ function Ee(e) {
673
681
  shape: t
674
682
  };
675
683
  }
676
- function De(e) {
684
+ function ke(e) {
677
685
  return e === "line" ? "tripwire" : "polygon";
678
686
  }
679
- function Oe(e) {
687
+ function Ae(e) {
680
688
  return e === "tripwire" ? "line" : "polygon";
681
689
  }
682
- function ke() {
690
+ function je() {
683
691
  if (typeof crypto.randomUUID == "function") return crypto.randomUUID();
684
692
  let e = crypto.getRandomValues(new Uint8Array(16));
685
693
  e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
@@ -688,11 +696,11 @@ function ke() {
688
696
  }
689
697
  //#endregion
690
698
  //#region src/widgets/zone-editor/ZoneRulesEditor.tsx
691
- var Ae = r.map((e) => ({
699
+ var Me = r.map((e) => ({
692
700
  id: e.id,
693
701
  label: e.name
694
702
  }));
695
- function je(e) {
703
+ function Ne(e) {
696
704
  return {
697
705
  id: e.id,
698
706
  name: e.name ?? "",
@@ -704,7 +712,7 @@ function je(e) {
704
712
  confirmWithLlm: e.confirmWithLlm === !0
705
713
  };
706
714
  }
707
- function Me(e, t) {
715
+ function Pe(e, t) {
708
716
  return {
709
717
  id: e.id,
710
718
  zoneIds: e.zoneIds,
@@ -718,10 +726,10 @@ function Me(e, t) {
718
726
  } : {}
719
727
  };
720
728
  }
721
- function Ne({ on: e, label: t, hint: n, onToggle: r }) {
722
- return /* @__PURE__ */ V("div", {
729
+ function Fe({ on: e, label: t, hint: n, onToggle: r }) {
730
+ return /* @__PURE__ */ H("div", {
723
731
  className: "flex items-center gap-1.5",
724
- children: [/* @__PURE__ */ B("button", {
732
+ children: [/* @__PURE__ */ V("button", {
725
733
  type: "button",
726
734
  role: "switch",
727
735
  "aria-checked": e,
@@ -729,21 +737,21 @@ function Ne({ on: e, label: t, hint: n, onToggle: r }) {
729
737
  title: n,
730
738
  onClick: r,
731
739
  className: ["inline-flex items-center justify-center h-5 w-9 rounded-full border transition-colors flex-shrink-0", e ? "border-primary/50 bg-primary/20 text-primary" : "border-border bg-surface text-foreground-subtle"].join(" "),
732
- children: /* @__PURE__ */ B("span", { className: ["h-3 w-3 rounded-full transition-transform", e ? "translate-x-1.5 bg-primary" : "-translate-x-1.5 bg-foreground-subtle"].join(" ") })
733
- }), /* @__PURE__ */ B("span", {
740
+ children: /* @__PURE__ */ V("span", { className: ["h-3 w-3 rounded-full transition-transform", e ? "translate-x-1.5 bg-primary" : "-translate-x-1.5 bg-foreground-subtle"].join(" ") })
741
+ }), /* @__PURE__ */ V("span", {
734
742
  className: "text-[10px] text-foreground leading-tight",
735
743
  children: t
736
744
  })]
737
745
  });
738
746
  }
739
747
  function Z({ dev: e, deviceId: t, stage: n, zones: r, title: a }) {
740
- let { t: o } = Y(), s = N(), l = k(e?.state.zoneRules), d = c(() => l?.[n] ?? [], [l, n]), [p, h] = u([]), [g, v] = u(!1), [y, b] = u(!1), [x, S] = u(null), w = Te(n);
748
+ let { t: o } = Y(), s = F(), l = j(e?.state.zoneRules), d = c(() => l?.[n] ?? [], [l, n]), [f, p] = u([]), [_, y] = u(!1), [b, x] = u(!1), [S, C] = u(null), D = De(n);
741
749
  i(() => {
742
- g || h(d.map(je));
743
- }, [d, g]);
744
- let E = () => {
745
- h((e) => [...e, {
746
- id: ke(),
750
+ _ || p(d.map(Ne));
751
+ }, [d, _]);
752
+ let O = () => {
753
+ p((e) => [...e, {
754
+ id: je(),
747
755
  name: "",
748
756
  zoneIds: r[0] ? [r[0].id] : [],
749
757
  mode: "exclude",
@@ -751,185 +759,193 @@ function Z({ dev: e, deviceId: t, stage: n, zones: r, title: a }) {
751
759
  enabled: !0,
752
760
  detectBySceneDifference: !1,
753
761
  confirmWithLlm: !1
754
- }]), v(!0);
755
- }, D = (e, t) => {
756
- h((n) => n.map((n, r) => {
762
+ }]), y(!0);
763
+ }, k = (e, t) => {
764
+ p((n) => n.map((n, r) => {
757
765
  if (r !== e) return n;
758
766
  let i = n.classFilter.includes(t) ? n.classFilter.filter((e) => e !== t) : [...n.classFilter, t];
759
767
  return {
760
768
  ...n,
761
769
  classFilter: i
762
770
  };
763
- })), v(!0);
764
- }, A = (e, t) => {
765
- h((n) => n.map((n, r) => {
771
+ })), y(!0);
772
+ }, M = (e, t) => {
773
+ p((n) => n.map((n, r) => {
766
774
  if (r !== e) return n;
767
775
  let i = n.zoneIds.includes(t) ? n.zoneIds.filter((e) => e !== t) : [...n.zoneIds, t];
768
776
  return {
769
777
  ...n,
770
778
  zoneIds: i
771
779
  };
772
- })), v(!0);
773
- }, j = (e) => {
774
- h((t) => t.filter((t, n) => n !== e)), v(!0);
775
- }, M = (e, t) => {
776
- h((n) => n.map((n, r) => r === e ? {
780
+ })), y(!0);
781
+ }, N = (e) => {
782
+ p((t) => t.filter((t, n) => n !== e)), y(!0);
783
+ }, P = (e, t) => {
784
+ p((n) => n.map((n, r) => r === e ? {
777
785
  ...n,
778
786
  ...t
779
- } : n)), v(!0);
780
- }, P = async () => {
781
- b(!0), S(null);
787
+ } : n)), y(!0);
788
+ }, I = async () => {
789
+ x(!0), C(null);
782
790
  try {
783
791
  await s.trpcClient.zoneRules.setRules.mutate({
784
792
  deviceId: t,
785
793
  stage: n,
786
- rules: p.map((e) => Me(e, n))
787
- }), v(!1);
794
+ rules: f.map((e) => Pe(e, n))
795
+ }), y(!1);
788
796
  } catch (e) {
789
- S(e instanceof Error ? e.message : String(e));
797
+ C(e instanceof Error ? e.message : String(e));
790
798
  } finally {
791
- b(!1);
799
+ x(!1);
792
800
  }
793
- }, F = g && !y;
794
- return /* @__PURE__ */ V("div", {
801
+ }, L = _ && !b;
802
+ return /* @__PURE__ */ H("div", {
795
803
  className: "rounded-md border border-border bg-surface/40 p-2.5",
796
804
  children: [
797
- /* @__PURE__ */ V("div", {
805
+ /* @__PURE__ */ H("div", {
798
806
  className: "flex items-center justify-between mb-2 gap-2",
799
- children: [/* @__PURE__ */ B("h3", {
800
- className: `${f} truncate`,
801
- children: a ?? Ce(n)
802
- }), /* @__PURE__ */ V("div", {
807
+ children: [/* @__PURE__ */ V("h3", {
808
+ className: `${z} truncate`,
809
+ children: a ?? Te(n)
810
+ }), /* @__PURE__ */ H("div", {
803
811
  className: "flex items-center gap-1 flex-shrink-0",
804
- children: [/* @__PURE__ */ V("button", {
812
+ children: [/* @__PURE__ */ H(v, {
813
+ variant: "unstyled",
805
814
  type: "button",
806
- onClick: E,
815
+ onClick: O,
807
816
  disabled: r.length === 0 || !e,
808
- className: C,
817
+ className: w,
809
818
  title: o("rules.add"),
810
819
  children: [
811
- /* @__PURE__ */ B(de, { className: "h-2.5 w-2.5" }),
820
+ /* @__PURE__ */ V(pe, { className: "h-2.5 w-2.5" }),
812
821
  " ",
813
822
  o("rules.addShort")
814
823
  ]
815
- }), /* @__PURE__ */ V("button", {
824
+ }), /* @__PURE__ */ H(v, {
825
+ variant: "unstyled",
816
826
  type: "button",
817
827
  onClick: () => {
818
- P();
828
+ I();
819
829
  },
820
- disabled: !F,
821
- className: T,
822
- children: [/* @__PURE__ */ B(fe, { className: "h-2.5 w-2.5" }), y ? "…" : o("rules.save")]
830
+ disabled: !L,
831
+ className: E,
832
+ children: [/* @__PURE__ */ V(me, { className: "h-2.5 w-2.5" }), b ? "…" : o("rules.save")]
823
833
  })]
824
834
  })]
825
835
  }),
826
- p.length === 0 ? /* @__PURE__ */ B("p", {
836
+ f.length === 0 ? /* @__PURE__ */ V("p", {
827
837
  className: "text-[10px] text-foreground-subtle italic px-1 py-1.5 leading-tight",
828
838
  children: r.length === 0 ? o("rules.noZones") : o("rules.empty")
829
- }) : /* @__PURE__ */ B("div", {
839
+ }) : /* @__PURE__ */ V("div", {
830
840
  className: "flex flex-col gap-1.5",
831
- children: p.map((e, t) => /* @__PURE__ */ V("div", {
841
+ children: f.map((e, t) => /* @__PURE__ */ H("div", {
832
842
  className: "rounded border border-border/50 bg-background/40 px-2 py-1.5 flex flex-col gap-1.5 overflow-hidden",
833
843
  children: [
834
- /* @__PURE__ */ V("div", {
844
+ /* @__PURE__ */ H("div", {
835
845
  className: "grid grid-cols-[auto_1fr_auto] items-center gap-1.5",
836
846
  children: [
837
- /* @__PURE__ */ B("button", {
847
+ /* @__PURE__ */ V(v, {
848
+ variant: "unstyled",
838
849
  type: "button",
839
850
  role: "switch",
840
851
  "aria-checked": e.enabled,
841
852
  "aria-label": e.enabled ? o("rules.disable") : o("rules.enable"),
842
853
  title: e.enabled ? o("rules.activeTitle") : o("rules.disabledTitle"),
843
- onClick: () => M(t, { enabled: !e.enabled }),
854
+ onClick: () => P(t, { enabled: !e.enabled }),
844
855
  className: ["inline-flex items-center justify-center h-5 w-9 rounded-full border transition-colors flex-shrink-0", e.enabled ? "border-primary/50 bg-primary/20 text-primary" : "border-border bg-surface text-foreground-subtle"].join(" "),
845
- children: /* @__PURE__ */ B("span", { className: ["h-3 w-3 rounded-full transition-transform", e.enabled ? "translate-x-1.5 bg-primary" : "-translate-x-1.5 bg-foreground-subtle"].join(" ") })
856
+ children: /* @__PURE__ */ V("span", { className: ["h-3 w-3 rounded-full transition-transform", e.enabled ? "translate-x-1.5 bg-primary" : "-translate-x-1.5 bg-foreground-subtle"].join(" ") })
846
857
  }),
847
- /* @__PURE__ */ B("input", {
848
- className: `${O} min-w-0`,
858
+ /* @__PURE__ */ V(T, {
859
+ className: `${A} min-w-0`,
849
860
  placeholder: o("rules.namePlaceholder"),
850
861
  value: e.name,
851
- onChange: (e) => M(t, { name: e.target.value })
862
+ onChange: (e) => P(t, { name: e.target.value })
852
863
  }),
853
- /* @__PURE__ */ B("button", {
864
+ /* @__PURE__ */ V(v, {
865
+ variant: "unstyled",
854
866
  type: "button",
855
867
  title: o("rules.remove"),
856
868
  "aria-label": o("rules.remove"),
857
- onClick: () => j(t),
869
+ onClick: () => N(t),
858
870
  className: "flex items-center justify-center h-6 w-6 rounded text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors flex-shrink-0",
859
- children: /* @__PURE__ */ B(q, { className: "h-3.5 w-3.5" })
871
+ children: /* @__PURE__ */ V(q, { className: "h-3.5 w-3.5" })
860
872
  })
861
873
  ]
862
874
  }),
863
- /* @__PURE__ */ V("div", {
875
+ /* @__PURE__ */ H("div", {
864
876
  className: "flex items-center gap-1.5 flex-wrap",
865
877
  children: [
866
- /* @__PURE__ */ B("span", {
878
+ /* @__PURE__ */ V("span", {
867
879
  className: "text-[9px] uppercase tracking-wider text-foreground-subtle w-12 sm:w-14 flex-shrink-0",
868
880
  children: o("rules.mode")
869
881
  }),
870
- /* @__PURE__ */ B("button", {
882
+ /* @__PURE__ */ V(v, {
883
+ variant: "unstyled",
871
884
  type: "button",
872
- onClick: () => M(t, { mode: "include" }),
873
- className: `${_} ${e.mode === "include" ? L : m}`,
885
+ onClick: () => P(t, { mode: "include" }),
886
+ className: `${m} ${e.mode === "include" ? h : g}`,
874
887
  children: o("rules.include")
875
888
  }),
876
- /* @__PURE__ */ B("button", {
889
+ /* @__PURE__ */ V(v, {
890
+ variant: "unstyled",
877
891
  type: "button",
878
- onClick: () => M(t, { mode: "exclude" }),
879
- className: `${_} ${e.mode === "exclude" ? L : m}`,
892
+ onClick: () => P(t, { mode: "exclude" }),
893
+ className: `${m} ${e.mode === "exclude" ? h : g}`,
880
894
  children: o("rules.exclude")
881
895
  })
882
896
  ]
883
897
  }),
884
- /* @__PURE__ */ V("div", {
898
+ /* @__PURE__ */ H("div", {
885
899
  className: "flex items-center gap-1.5 flex-wrap",
886
- children: [/* @__PURE__ */ B("span", {
900
+ children: [/* @__PURE__ */ V("span", {
887
901
  className: "text-[9px] uppercase tracking-wider text-foreground-subtle w-12 sm:w-14 flex-shrink-0",
888
902
  children: o("rules.zones")
889
- }), r.length === 0 ? /* @__PURE__ */ B("span", {
903
+ }), r.length === 0 ? /* @__PURE__ */ V("span", {
890
904
  className: "text-[10px] text-foreground-subtle italic",
891
905
  children: o("rules.noneZones")
892
- }) : r.map((n) => /* @__PURE__ */ V("button", {
906
+ }) : r.map((n) => /* @__PURE__ */ H(v, {
907
+ variant: "unstyled",
893
908
  type: "button",
894
- onClick: () => A(t, n.id),
895
- className: `${_} ${e.zoneIds.includes(n.id) ? L : m}`,
896
- children: [/* @__PURE__ */ B("span", {
909
+ onClick: () => M(t, n.id),
910
+ className: `${m} ${e.zoneIds.includes(n.id) ? h : g}`,
911
+ children: [/* @__PURE__ */ V("span", {
897
912
  className: "h-2 w-2 rounded-sm",
898
913
  style: { backgroundColor: n.color || "#3b82f6" }
899
- }), /* @__PURE__ */ B("span", {
914
+ }), /* @__PURE__ */ V("span", {
900
915
  className: "truncate max-w-[7rem]",
901
916
  children: n.name || n.id
902
917
  })]
903
918
  }, n.id))]
904
919
  }),
905
- n === "package" && /* @__PURE__ */ V("div", {
920
+ n === "package" && /* @__PURE__ */ H("div", {
906
921
  className: "flex flex-col gap-1",
907
- children: [/* @__PURE__ */ B(Ne, {
922
+ children: [/* @__PURE__ */ V(Fe, {
908
923
  on: e.detectBySceneDifference,
909
924
  label: o("rules.sceneDifference"),
910
925
  hint: o("rules.sceneDifferenceHint"),
911
- onToggle: () => M(t, { detectBySceneDifference: !e.detectBySceneDifference })
912
- }), /* @__PURE__ */ B(Ne, {
926
+ onToggle: () => P(t, { detectBySceneDifference: !e.detectBySceneDifference })
927
+ }), /* @__PURE__ */ V(Fe, {
913
928
  on: e.confirmWithLlm,
914
929
  label: o("rules.confirmLlm"),
915
930
  hint: o("rules.confirmLlmHint"),
916
- onToggle: () => M(t, { confirmWithLlm: !e.confirmWithLlm })
931
+ onToggle: () => P(t, { confirmWithLlm: !e.confirmWithLlm })
917
932
  })]
918
933
  }),
919
- w && /* @__PURE__ */ V("div", {
934
+ D && /* @__PURE__ */ H("div", {
920
935
  className: "flex items-center gap-1.5 flex-wrap",
921
936
  children: [
922
- /* @__PURE__ */ B("span", {
937
+ /* @__PURE__ */ V("span", {
923
938
  className: "text-[9px] uppercase tracking-wider text-foreground-subtle w-12 sm:w-14 flex-shrink-0",
924
939
  children: o("rules.class")
925
940
  }),
926
- Ae.map((n) => /* @__PURE__ */ B("button", {
941
+ Me.map((n) => /* @__PURE__ */ V(v, {
942
+ variant: "unstyled",
927
943
  type: "button",
928
- onClick: () => D(t, n.id),
929
- className: `${_} ${e.classFilter.includes(n.id) ? L : m}`,
944
+ onClick: () => k(t, n.id),
945
+ className: `${m} ${e.classFilter.includes(n.id) ? h : g}`,
930
946
  children: n.label
931
947
  }, n.id)),
932
- e.classFilter.length === 0 && /* @__PURE__ */ B("span", {
948
+ e.classFilter.length === 0 && /* @__PURE__ */ V("span", {
933
949
  className: "text-[10px] text-foreground-subtle italic ml-1",
934
950
  children: o("rules.anyClass")
935
951
  })
@@ -938,16 +954,16 @@ function Z({ dev: e, deviceId: t, stage: n, zones: r, title: a }) {
938
954
  ]
939
955
  }, e.id))
940
956
  }),
941
- x && /* @__PURE__ */ B("p", {
957
+ S && /* @__PURE__ */ V("p", {
942
958
  className: "mt-2 text-[10px] text-danger",
943
- children: x
959
+ children: S
944
960
  })
945
961
  ]
946
962
  });
947
963
  }
948
964
  //#endregion
949
965
  //#region src/widgets/zone-editor/ZoneOverlay.tsx
950
- var Pe = "#3b82f6", Fe = ["polygon", "line"], Q = [
966
+ var Ie = "#3b82f6", Le = ["polygon", "line"], Q = [
951
967
  "#3b82f6",
952
968
  "#10b981",
953
969
  "#f59e0b",
@@ -959,17 +975,17 @@ var Pe = "#3b82f6", Fe = ["polygon", "line"], Q = [
959
975
  "#8b5cf6",
960
976
  "#14b8a6"
961
977
  ];
962
- function Ie(e) {
978
+ function Re(e) {
963
979
  let t = new Set(e.map((e) => (e.color ?? "").toLowerCase()));
964
980
  for (let e of Q) if (!t.has(e.toLowerCase())) return e;
965
981
  return Q[e.length % Q.length];
966
982
  }
967
- function Le(e) {
983
+ function ze(e) {
968
984
  return {
969
985
  id: e.id,
970
986
  name: e.name,
971
987
  kind: e.kind,
972
- color: e.color || Pe,
988
+ color: e.color || Ie,
973
989
  points: [...e.polygon]
974
990
  };
975
991
  }
@@ -982,20 +998,20 @@ function $(e) {
982
998
  color: e.color
983
999
  };
984
1000
  }
985
- function Re({ deviceId: e }) {
986
- let t = N(), n = k(P(t.trpcClient, e)?.state.zones), r = c(() => n?.zones ?? [], [n]), i = D(), s = i?.drawingKind ?? null, l = i?.selectedZoneId ?? null, d = i?.editingDraft ?? null, f = c(() => r.map((e) => d && d.id === e.id ? {
1001
+ function Be({ deviceId: e }) {
1002
+ let t = F(), n = j(I(t.trpcClient, e)?.state.zones), r = c(() => n?.zones ?? [], [n]), i = k(), s = i?.drawingKind ?? null, l = i?.selectedZoneId ?? null, d = i?.editingDraft ?? null, f = c(() => r.map((e) => d && d.id === e.id ? {
987
1003
  id: d.id,
988
1004
  name: d.name,
989
1005
  kind: d.kind,
990
1006
  color: d.color,
991
1007
  points: [...d.points]
992
- } : Le(e)), [r, d]), p = c(() => f.map(Ee), [f]), [m, h] = u(null), g = o(async (n) => {
1008
+ } : ze(e)), [r, d]), p = c(() => f.map(Oe), [f]), [m, h] = u(null), g = o(async (n) => {
993
1009
  if (n.kind !== "polygon" && n.kind !== "line") return;
994
1010
  let r = {
995
- id: ke(),
1011
+ id: je(),
996
1012
  name: "",
997
- kind: De(n.kind),
998
- color: Ie(f),
1013
+ kind: ke(n.kind),
1014
+ color: Re(f),
999
1015
  points: [...n.points]
1000
1016
  };
1001
1017
  h(null);
@@ -1048,7 +1064,7 @@ function Re({ deviceId: e }) {
1048
1064
  i
1049
1065
  ]), v = o((e, t) => {
1050
1066
  typeof e == "string" && (t.kind !== "polygon" && t.kind !== "line" || _(e, t.points));
1051
- }, [_]), y = o((e) => {
1067
+ }, [_]), b = o((e) => {
1052
1068
  if (e === null) {
1053
1069
  i?.discardDraft(), i?.setSelectedZoneId(null);
1054
1070
  return;
@@ -1067,37 +1083,37 @@ function Re({ deviceId: e }) {
1067
1083
  points: t.points
1068
1084
  });
1069
1085
  }, [f, i]);
1070
- return f.length === 0 && s === null && m === null ? null : /* @__PURE__ */ V(a, {
1086
+ return f.length === 0 && s === null && m === null ? null : /* @__PURE__ */ H(a, {
1071
1087
  fallback: null,
1072
- children: [/* @__PURE__ */ B(w, {
1088
+ children: [/* @__PURE__ */ V(y, {
1073
1089
  transparent: !0,
1074
1090
  items: p,
1075
- supportedShapes: Fe,
1091
+ supportedShapes: Le,
1076
1092
  selectedId: l,
1077
- onSelect: y,
1093
+ onSelect: b,
1078
1094
  onShapeChange: v,
1079
1095
  onDrawComplete: (e) => {
1080
1096
  g(e);
1081
1097
  },
1082
- drawingKind: s === null ? null : Oe(s)
1083
- }), m !== null && /* @__PURE__ */ B("p", {
1098
+ drawingKind: s === null ? null : Ae(s)
1099
+ }), m !== null && /* @__PURE__ */ V("p", {
1084
1100
  role: "alert",
1085
1101
  className: "absolute inset-x-2 bottom-2 rounded-md border border-danger/40 bg-background-elevated px-2 py-1 text-xs text-danger",
1086
1102
  children: m
1087
1103
  })]
1088
1104
  });
1089
1105
  }
1090
- var ze = l(Re), Be = "#3b82f6";
1091
- function Ve(e) {
1106
+ var Ve = l(Be), He = "#3b82f6";
1107
+ function Ue(e) {
1092
1108
  return {
1093
1109
  id: e.id,
1094
1110
  name: e.name,
1095
1111
  kind: e.kind,
1096
- color: e.color || Be,
1112
+ color: e.color || He,
1097
1113
  points: [...e.polygon]
1098
1114
  };
1099
1115
  }
1100
- function He(e) {
1116
+ function We(e) {
1101
1117
  return {
1102
1118
  id: e.id,
1103
1119
  name: e.name,
@@ -1106,33 +1122,33 @@ function He(e) {
1106
1122
  color: e.color
1107
1123
  };
1108
1124
  }
1109
- function Ue({ deviceId: e }) {
1110
- let { t } = Y(), n = N(), r = P(n.trpcClient, e), i = k(r?.state.zones), a = c(() => i?.zones ?? [], [i]), s = c(() => a.map(Ve), [a]), [l, d] = u(null), p = D(), m = p?.drawingKind ?? null, h = p?.selectedZoneId ?? null, _ = p?.editingDraft ?? null;
1111
- A(c(() => ({
1125
+ function Ge({ deviceId: e }) {
1126
+ let { t } = Y(), n = F(), r = I(n.trpcClient, e), i = j(r?.state.zones), a = c(() => i?.zones ?? [], [i]), s = c(() => a.map(Ue), [a]), [l, d] = u(null), f = k(), m = f?.drawingKind ?? null, h = f?.selectedZoneId ?? null, g = f?.editingDraft ?? null;
1127
+ M(c(() => ({
1112
1128
  id: "zones",
1113
1129
  order: 100,
1114
- node: /* @__PURE__ */ B(ze, { deviceId: e })
1130
+ node: /* @__PURE__ */ V(Ve, { deviceId: e })
1115
1131
  }), [e]));
1116
- let y = o((e) => {
1132
+ let _ = o((e) => {
1117
1133
  if (e === null) {
1118
- p?.discardDraft(), p?.setSelectedZoneId(null);
1134
+ f?.discardDraft(), f?.setSelectedZoneId(null);
1119
1135
  return;
1120
1136
  }
1121
1137
  let t = s.find((t) => t.id === e);
1122
- t && p?.enterDraft({
1138
+ t && f?.enterDraft({
1123
1139
  id: t.id,
1124
1140
  kind: t.kind,
1125
1141
  name: t.name,
1126
1142
  color: t.color,
1127
1143
  points: t.points
1128
1144
  });
1129
- }, [s, p]), x = o(async () => {
1130
- let t = p?.editingDraft;
1145
+ }, [s, f]), v = o(async () => {
1146
+ let t = f?.editingDraft;
1131
1147
  if (t) {
1132
1148
  try {
1133
1149
  await n.trpcClient.zones.updateZone.mutate({
1134
1150
  deviceId: e,
1135
- zone: He({
1151
+ zone: We({
1136
1152
  id: t.id,
1137
1153
  kind: t.kind,
1138
1154
  name: t.name,
@@ -1143,15 +1159,15 @@ function Ue({ deviceId: e }) {
1143
1159
  } catch (e) {
1144
1160
  console.error("zones.updateZone failed", e), d(e instanceof Error ? e.message : String(e));
1145
1161
  }
1146
- p?.discardDraft(), p?.setSelectedZoneId(null);
1162
+ f?.discardDraft(), f?.setSelectedZoneId(null);
1147
1163
  }
1148
1164
  }, [
1149
1165
  n,
1150
1166
  e,
1151
- p
1152
- ]), S = o(() => {
1153
- p?.discardDraft(), p?.setSelectedZoneId(null);
1154
- }, [p]), C = o(async (t) => {
1167
+ f
1168
+ ]), y = o(() => {
1169
+ f?.discardDraft(), f?.setSelectedZoneId(null);
1170
+ }, [f]), b = o(async (t) => {
1155
1171
  try {
1156
1172
  await n.trpcClient.zones.removeZone.mutate({
1157
1173
  deviceId: e,
@@ -1160,82 +1176,82 @@ function Ue({ deviceId: e }) {
1160
1176
  } catch (e) {
1161
1177
  console.error("zones.removeZone failed", e), d(e instanceof Error ? e.message : String(e));
1162
1178
  }
1163
- p?.selectedZoneId === t && p.setSelectedZoneId(null), p?.editingDraft?.id === t && p.discardDraft();
1179
+ f?.selectedZoneId === t && f.setSelectedZoneId(null), f?.editingDraft?.id === t && f.discardDraft();
1164
1180
  }, [
1165
1181
  n,
1166
1182
  e,
1167
- p
1168
- ]), w = o((e) => {
1169
- p?.startDrawing(e);
1170
- }, [p]), T = o(() => {
1171
- p?.setDrawingKind(null);
1172
- }, [p]), E = c(() => !_ || !s.find((e) => e.id === _.id) ? null : {
1173
- id: _.id,
1174
- kind: _.kind,
1175
- name: _.name,
1176
- color: _.color,
1177
- points: [..._.points]
1178
- }, [s, _]);
1179
- return /* @__PURE__ */ V("div", {
1180
- className: b,
1181
- children: [/* @__PURE__ */ V("div", {
1182
- className: I,
1183
- children: [/* @__PURE__ */ B("div", {
1184
- className: z,
1185
- children: /* @__PURE__ */ V("div", {
1183
+ f
1184
+ ]), S = o((e) => {
1185
+ f?.startDrawing(e);
1186
+ }, [f]), C = o(() => {
1187
+ f?.setDrawingKind(null);
1188
+ }, [f]), w = c(() => !g || !s.find((e) => e.id === g.id) ? null : {
1189
+ id: g.id,
1190
+ kind: g.kind,
1191
+ name: g.name,
1192
+ color: g.color,
1193
+ points: [...g.points]
1194
+ }, [s, g]);
1195
+ return /* @__PURE__ */ H("div", {
1196
+ className: ee,
1197
+ children: [/* @__PURE__ */ H("div", {
1198
+ className: B,
1199
+ children: [/* @__PURE__ */ V("div", {
1200
+ className: x,
1201
+ children: /* @__PURE__ */ H("div", {
1186
1202
  className: "min-w-0",
1187
- children: [/* @__PURE__ */ B("h2", {
1188
- className: f,
1203
+ children: [/* @__PURE__ */ V("h2", {
1204
+ className: z,
1189
1205
  children: t("zonesTab.title")
1190
- }), /* @__PURE__ */ B("p", {
1191
- className: `${g} mt-0.5 leading-tight`,
1192
- children: /* @__PURE__ */ B(he, {
1206
+ }), /* @__PURE__ */ V("p", {
1207
+ className: `${p} mt-0.5 leading-tight`,
1208
+ children: /* @__PURE__ */ V(_e, {
1193
1209
  i18nKey: "zonesTab.hint",
1194
- components: { b: /* @__PURE__ */ B("strong", { className: "text-foreground" }) }
1210
+ components: { b: /* @__PURE__ */ V("strong", { className: "text-foreground" }) }
1195
1211
  })
1196
1212
  })]
1197
1213
  })
1198
- }), /* @__PURE__ */ V("div", {
1199
- className: `${v} flex flex-col gap-3`,
1214
+ }), /* @__PURE__ */ H("div", {
1215
+ className: `${R} flex flex-col gap-3`,
1200
1216
  children: [
1201
- /* @__PURE__ */ B(be, {
1217
+ /* @__PURE__ */ V(Se, {
1202
1218
  zones: s,
1203
1219
  selectedZoneId: h,
1204
1220
  drawingKind: m,
1205
- onSelectZone: y,
1206
- onDeleteZone: C,
1207
- onStartDraw: w,
1208
- onCancelDraw: T
1221
+ onSelectZone: _,
1222
+ onDeleteZone: b,
1223
+ onStartDraw: S,
1224
+ onCancelDraw: C
1209
1225
  }),
1210
- l !== null && /* @__PURE__ */ B("p", {
1226
+ l !== null && /* @__PURE__ */ V("p", {
1211
1227
  role: "alert",
1212
1228
  className: "text-xs text-danger",
1213
1229
  children: l
1214
1230
  }),
1215
- E && /* @__PURE__ */ V(H, { children: [/* @__PURE__ */ B("div", { className: "border-t border-border" }), /* @__PURE__ */ B(Se, {
1216
- zone: E,
1217
- onSave: x,
1218
- onDiscard: S,
1219
- onDelete: () => C(E.id)
1231
+ w && /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ V("div", { className: "border-t border-border" }), /* @__PURE__ */ V(we, {
1232
+ zone: w,
1233
+ onSave: v,
1234
+ onDiscard: y,
1235
+ onDelete: () => b(w.id)
1220
1236
  })] })
1221
1237
  ]
1222
1238
  })]
1223
- }), /* @__PURE__ */ V("div", {
1224
- className: `grid grid-cols-1 2xl:grid-cols-2 ${F}`,
1239
+ }), /* @__PURE__ */ H("div", {
1240
+ className: `grid grid-cols-1 2xl:grid-cols-2 ${L}`,
1225
1241
  children: [
1226
- /* @__PURE__ */ B(Z, {
1242
+ /* @__PURE__ */ V(Z, {
1227
1243
  dev: r,
1228
1244
  deviceId: e,
1229
1245
  stage: "motion",
1230
1246
  zones: a
1231
1247
  }),
1232
- /* @__PURE__ */ B(Z, {
1248
+ /* @__PURE__ */ V(Z, {
1233
1249
  dev: r,
1234
1250
  deviceId: e,
1235
1251
  stage: "detection",
1236
1252
  zones: a
1237
1253
  }),
1238
- /* @__PURE__ */ B(Z, {
1254
+ /* @__PURE__ */ V(Z, {
1239
1255
  dev: r,
1240
1256
  deviceId: e,
1241
1257
  stage: "package",
@@ -1247,18 +1263,18 @@ function Ue({ deviceId: e }) {
1247
1263
  }
1248
1264
  //#endregion
1249
1265
  //#region src/widgets/ZoneEditor.tsx
1250
- function We(e) {
1266
+ function Ke(e) {
1251
1267
  let { t } = Y();
1252
- return e.deviceId === void 0 ? /* @__PURE__ */ B("div", {
1268
+ return e.deviceId === void 0 ? /* @__PURE__ */ V("div", {
1253
1269
  className: "rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",
1254
1270
  children: t("zoneEditor.requiresDevice")
1255
- }) : /* @__PURE__ */ B(Ue, { deviceId: e.deviceId });
1271
+ }) : /* @__PURE__ */ V(Ge, { deviceId: e.deviceId });
1256
1272
  }
1257
1273
  //#endregion
1258
1274
  //#region src/widgets/index.tsx
1259
- var Ge = {
1260
- "pipeline-quick-stats": ge,
1261
- "zone-editor": We
1275
+ var qe = {
1276
+ "pipeline-quick-stats": ve,
1277
+ "zone-editor": Ke
1262
1278
  };
1263
1279
  //#endregion
1264
- export { Ge as default };
1280
+ export { qe as default };