@camstack/addon-training 0.1.40 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/{MotionZonesSettings-DBtAXpEm.mjs → MotionZonesSettings-DZgoN8V_.mjs} +55 -55
  2. package/dist/{PrivacyMaskSettings-C3tyM8s9.mjs → PrivacyMaskSettings-7L2OX3dp.mjs} +82 -86
  3. package/dist/{SceneMonitorEditor-D6Q3z17B.mjs → SceneMonitorEditor-CwULmLkP.mjs} +318 -339
  4. package/dist/_stub.js +5170 -9054
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-CHYHBYUh.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-DzsEYUgl.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-LhaXEy4l.mjs +26 -0
  7. package/dist/addon-training.css +1 -1
  8. package/dist/chevron-right-D3StkdcR.mjs +10 -0
  9. package/dist/createLucideIcon-CPP1Jzoz.mjs +44 -0
  10. package/dist/{dist-CbTzxq0W.mjs → dist-BtEl1kYQ.mjs} +47970 -29426
  11. package/dist/{dist-CJXTMYT2.js → dist-wRpOWEq6.js} +47970 -29426
  12. package/dist/{grid-2x2-tkDBCRad.mjs → grid-2x2-Yngdckwo.mjs} +1 -1
  13. package/dist/{hostInit-GIXFhqMx.mjs → hostInit-1OJB0wPE.mjs} +2 -2
  14. package/dist/icons-C4_Ji5S0.mjs +27953 -0
  15. package/dist/index.js +1 -1
  16. package/dist/mic-off-DPNSd6G7.mjs +32 -0
  17. package/dist/orchestrator/training.addon.js +1 -1
  18. package/dist/orchestrator/training.addon.mjs +1 -1
  19. package/dist/{player-overlays-DMLlEwmn.mjs → player-overlays-CqD89xkd.mjs} +21 -28
  20. package/dist/providers/modal/training-modal.addon.js +1 -1
  21. package/dist/providers/modal/training-modal.addon.mjs +1 -1
  22. package/dist/remoteEntry.js +1 -1
  23. package/dist/responsive-Dwyuxd3q.mjs +84 -0
  24. package/dist/rotate-ccw-Dak-lXgZ.mjs +52 -0
  25. package/dist/{scene-monitor-copy-B-6xPmDm.mjs → scene-monitor-copy-DX2u-htD.mjs} +40 -91
  26. package/dist/settings-2-Cgiv3kQb.mjs +25 -0
  27. package/dist/{square-D49AvsjC.mjs → square-B_679zIX.mjs} +4 -29
  28. package/dist/{trash-2-BwTJ2h2p.mjs → trash-2-DC8LDYlI.mjs} +1 -1
  29. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-B3ZFopEz.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-D0zbWJUR.mjs} +1 -1
  30. package/dist/zoom-out-BJoVDYa3.mjs +2729 -0
  31. package/package.json +1 -1
  32. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-NCFNuw0Q.mjs +0 -26
  33. package/dist/responsive-C0tM8Z6S.mjs +0 -126
@@ -1,22 +1,22 @@
1
1
  import { S as e, _ as t, c as n, g as r, m as i, u as a } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs";
2
- import { f as o, h as s, m as ee, v as te } from "./responsive-C0tM8Z6S.mjs";
3
- import { r as c, t as l } from "./player-overlays-DMLlEwmn.mjs";
4
- import { t as ne } from "./grid-2x2-tkDBCRad.mjs";
5
- import { n as u, r as d, t as f } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
6
- import { MaskShapeCanvas as p } from "./MaskShapeCanvas-Kfg9dl6B.mjs";
2
+ import { t as o } from "./grid-2x2-Yngdckwo.mjs";
3
+ import { f as s, h as c, m as l, v as u } from "./responsive-Dwyuxd3q.mjs";
4
+ import { n as d, r as f, t as p } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
5
+ import { r as ee, t as m } from "./player-overlays-CqD89xkd.mjs";
6
+ import { MaskShapeCanvas as h } from "./MaskShapeCanvas-Kfg9dl6B.mjs";
7
7
  //#region ../ui-library/src/composites/cap-settings/MotionZonesSettings.tsx
8
8
  e();
9
- var m = 110, h = "motion-zones", g = 0, _ = [
9
+ var g = 110, _ = "motion-zones", v = 0, te = [
10
10
  1,
11
11
  2,
12
12
  3
13
- ], v = 1, y = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors", b = "rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";
14
- function x(e, t, n) {
13
+ ], y = 1, b = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors", x = "rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";
14
+ function S(e, t, n) {
15
15
  let r = t * n, i = Array.from({ length: r });
16
16
  for (let t = 0; t < r; t += 1) i[t] = e[t] === !0;
17
17
  return i;
18
18
  }
19
- function S(e, t) {
19
+ function ne(e, t) {
20
20
  if (e.length !== t.length) return !1;
21
21
  for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
22
22
  return !0;
@@ -44,11 +44,11 @@ function E(e, t, n, r) {
44
44
  return o;
45
45
  }
46
46
  function D({ deviceId: e }) {
47
- let w = s(te().trpcClient, e), [D, O] = t(null), [k, A] = t(!1), [j, M] = t(null), [N, P] = t(null), [F, I] = t(v), [L, R] = t(!1), [z, B] = t(!1), V = r(!1);
47
+ let w = c(u().trpcClient, e), [D, O] = t(null), [k, A] = t(!1), [j, M] = t(null), [N, P] = t(null), [F, I] = t(y), [L, R] = t(!1), [z, B] = t(!1), V = r(!1);
48
48
  a(() => {
49
49
  if (!w) return;
50
50
  let e = !1;
51
- return V.current = !1, O(null), A(!1), M(null), P(null), I(v), B(!1), (async () => {
51
+ return V.current = !1, O(null), A(!1), M(null), P(null), I(y), B(!1), (async () => {
52
52
  try {
53
53
  let t = await w.motionZones?.getOptions({});
54
54
  if (e) return;
@@ -58,11 +58,11 @@ function D({ deviceId: e }) {
58
58
  if (e) return;
59
59
  if (!n) throw Error("device proxy not ready");
60
60
  V.current = !0;
61
- let r = n.regions.find((e) => e.shape.kind === "grid"), i = x(r ? r.shape.cells : [], t.grid.width, t.grid.height);
62
- P(i), M(T(i, t.grid.width, t.grid.height, v));
61
+ let r = n.regions.find((e) => e.shape.kind === "grid"), i = S(r ? r.shape.cells : [], t.grid.width, t.grid.height);
62
+ P(i), M(T(i, t.grid.width, t.grid.height, y));
63
63
  } catch (t) {
64
64
  if (e) return;
65
- ee(t) ? A(!0) : console.error("Motion Zones load failed", t);
65
+ l(t) ? A(!0) : console.error("Motion Zones load failed", t);
66
66
  }
67
67
  })(), () => {
68
68
  e = !0;
@@ -74,7 +74,7 @@ function D({ deviceId: e }) {
74
74
  H,
75
75
  U,
76
76
  F
77
- ]), q = i(() => K !== null && N !== null && !S(K, N), [K, N]), J = i(() => K ? K.reduce((e, t) => t ? e + 1 : e, 0) : 0, [K]), Y = H * U, X = W * G, Z = n((e) => {
77
+ ]), q = i(() => K !== null && N !== null && !ne(K, N), [K, N]), J = i(() => K ? K.reduce((e, t) => t ? e + 1 : e, 0) : 0, [K]), Y = H * U, X = W * G, Z = n((e) => {
78
78
  X > 0 && M(Array.from({ length: X }, () => e));
79
79
  }, [X]), re = n(() => {
80
80
  M((e) => e && e.map((e) => !e));
@@ -98,7 +98,7 @@ function D({ deviceId: e }) {
98
98
  H,
99
99
  U
100
100
  ]), Q = i(() => D && j ? [{
101
- id: g,
101
+ id: v,
102
102
  shape: {
103
103
  kind: "grid",
104
104
  gridWidth: W,
@@ -123,13 +123,13 @@ function D({ deviceId: e }) {
123
123
  cells: e
124
124
  };
125
125
  await w.motionZones?.setZone({ patch: { regions: [{
126
- id: g,
126
+ id: v,
127
127
  enabled: !0,
128
128
  shape: t
129
129
  }] } });
130
130
  let n = await w.motionZones?.getStatus({});
131
131
  if (n) {
132
- let e = n.regions.find((e) => e.shape.kind === "grid"), t = x(e ? e.shape.cells : [], D.grid.width, D.grid.height);
132
+ let e = n.regions.find((e) => e.shape.kind === "grid"), t = S(e ? e.shape.cells : [], D.grid.width, D.grid.height);
133
133
  P(t), M(T(t, D.grid.width, D.grid.height, F));
134
134
  }
135
135
  } catch (e) {
@@ -144,10 +144,10 @@ function D({ deviceId: e }) {
144
144
  D,
145
145
  F
146
146
  ]);
147
- return l(i(() => z && !k && D && j ? {
148
- id: h,
149
- order: m,
150
- node: /* @__PURE__ */ u(p, {
147
+ return m(i(() => z && !k && D && j ? {
148
+ id: _,
149
+ order: g,
150
+ node: /* @__PURE__ */ d(h, {
151
151
  transparent: !0,
152
152
  items: Q,
153
153
  supportedShapes: ["grid"],
@@ -155,7 +155,7 @@ function D({ deviceId: e }) {
155
155
  width: W,
156
156
  height: G
157
157
  },
158
- selectedId: g,
158
+ selectedId: v,
159
159
  onSelect: () => {},
160
160
  onShapeChange: $,
161
161
  onDrawComplete: () => {},
@@ -170,30 +170,30 @@ function D({ deviceId: e }) {
170
170
  $,
171
171
  W,
172
172
  G
173
- ])), w ? /* @__PURE__ */ u(c, {
173
+ ])), w ? /* @__PURE__ */ d(ee, {
174
174
  title: "Motion Zones",
175
- icon: /* @__PURE__ */ u(ne, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
176
- children: /* @__PURE__ */ u("div", {
175
+ icon: /* @__PURE__ */ d(o, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
176
+ children: /* @__PURE__ */ d("div", {
177
177
  className: "flex flex-col gap-3",
178
- children: k ? /* @__PURE__ */ u("p", {
179
- className: `${o} leading-relaxed`,
178
+ children: k ? /* @__PURE__ */ d("p", {
179
+ className: `${s} leading-relaxed`,
180
180
  children: "This camera doesn't expose an on-board motion zones grid."
181
- }) : !k && D !== null && j !== null ? /* @__PURE__ */ d(f, { children: [/* @__PURE__ */ d("p", {
182
- className: `${o} leading-relaxed`,
181
+ }) : !k && D !== null && j !== null ? /* @__PURE__ */ f(p, { children: [/* @__PURE__ */ f("p", {
182
+ className: `${s} leading-relaxed`,
183
183
  children: [
184
184
  "Toggle ",
185
- /* @__PURE__ */ u("strong", {
185
+ /* @__PURE__ */ d("strong", {
186
186
  className: "text-foreground",
187
187
  children: "Edit grid"
188
188
  }),
189
189
  " to paint the region directly on the live frame, then ",
190
- /* @__PURE__ */ u("strong", {
190
+ /* @__PURE__ */ d("strong", {
191
191
  className: "text-foreground",
192
192
  children: "Save"
193
193
  }),
194
194
  " to push the mask to the camera. Pick a bigger",
195
195
  " ",
196
- /* @__PURE__ */ u("strong", {
196
+ /* @__PURE__ */ d("strong", {
197
197
  className: "text-foreground",
198
198
  children: "Cell size"
199
199
  }),
@@ -203,57 +203,57 @@ function D({ deviceId: e }) {
203
203
  D.grid.height,
204
204
  " grid on save (×1 is the finest)."
205
205
  ]
206
- }), /* @__PURE__ */ d("div", {
206
+ }), /* @__PURE__ */ f("div", {
207
207
  className: "flex items-center gap-2 flex-wrap",
208
208
  children: [
209
- /* @__PURE__ */ u("button", {
209
+ /* @__PURE__ */ d("button", {
210
210
  type: "button",
211
211
  onClick: () => B((e) => !e),
212
212
  disabled: L,
213
213
  "aria-pressed": z,
214
- className: z ? b : y,
214
+ className: z ? x : b,
215
215
  children: z ? "Done editing" : "Edit grid"
216
216
  }),
217
- /* @__PURE__ */ u("button", {
217
+ /* @__PURE__ */ d("button", {
218
218
  type: "button",
219
219
  onClick: () => Z(!0),
220
220
  disabled: L,
221
- className: y,
221
+ className: b,
222
222
  children: "All on"
223
223
  }),
224
- /* @__PURE__ */ u("button", {
224
+ /* @__PURE__ */ d("button", {
225
225
  type: "button",
226
226
  onClick: () => Z(!1),
227
227
  disabled: L,
228
- className: y,
228
+ className: b,
229
229
  children: "All off"
230
230
  }),
231
- /* @__PURE__ */ u("button", {
231
+ /* @__PURE__ */ d("button", {
232
232
  type: "button",
233
233
  onClick: re,
234
234
  disabled: L,
235
- className: y,
235
+ className: b,
236
236
  children: "Invert"
237
237
  }),
238
- /* @__PURE__ */ d("div", {
238
+ /* @__PURE__ */ f("div", {
239
239
  className: "flex items-center gap-1 ml-1",
240
240
  role: "group",
241
241
  "aria-label": "Cell size",
242
- children: [/* @__PURE__ */ u("span", {
243
- className: `${o} mr-0.5`,
242
+ children: [/* @__PURE__ */ d("span", {
243
+ className: `${s} mr-0.5`,
244
244
  children: "Cell size"
245
- }), _.map((e) => /* @__PURE__ */ d("button", {
245
+ }), te.map((e) => /* @__PURE__ */ f("button", {
246
246
  type: "button",
247
247
  onClick: () => ae(e),
248
248
  disabled: L,
249
249
  "aria-pressed": F === e,
250
250
  title: e === 1 ? `Camera grid ${H}×${U} (finest)` : `${C(H, e)}×${C(U, e)} painting grid · cells ×${e} bigger`,
251
- className: F === e ? b : y,
251
+ className: F === e ? x : b,
252
252
  children: ["×", e]
253
253
  }, e))]
254
254
  }),
255
- /* @__PURE__ */ d("span", {
256
- className: `${o} ml-1 tabular-nums`,
255
+ /* @__PURE__ */ f("span", {
256
+ className: `${s} ml-1 tabular-nums`,
257
257
  children: [
258
258
  J,
259
259
  " / ",
@@ -265,24 +265,24 @@ function D({ deviceId: e }) {
265
265
  F === 1 ? "" : ` · paint ${W}×${G}`
266
266
  ]
267
267
  }),
268
- /* @__PURE__ */ u("span", { className: "flex-1" }),
269
- /* @__PURE__ */ u("button", {
268
+ /* @__PURE__ */ d("span", { className: "flex-1" }),
269
+ /* @__PURE__ */ d("button", {
270
270
  type: "button",
271
271
  onClick: ie,
272
272
  disabled: L || !q,
273
273
  className: "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",
274
274
  children: "Revert"
275
275
  }),
276
- /* @__PURE__ */ u("button", {
276
+ /* @__PURE__ */ d("button", {
277
277
  type: "button",
278
278
  onClick: () => void oe(),
279
279
  disabled: L || !q,
280
- className: b,
280
+ className: x,
281
281
  children: L ? "Saving…" : "Save"
282
282
  })
283
283
  ]
284
- })] }) : /* @__PURE__ */ u("p", {
285
- className: `${o} leading-relaxed`,
284
+ })] }) : /* @__PURE__ */ d("p", {
285
+ className: `${s} leading-relaxed`,
286
286
  children: "Loading the camera's grid…"
287
287
  })
288
288
  })
@@ -1,35 +1,31 @@
1
1
  import { S as e, _ as t, c as n, g as r, m as i, u as a } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs";
2
- import { b as o, f as s, h as ee, m as te, v as ne } from "./responsive-C0tM8Z6S.mjs";
3
- import { r as re, t as ie } from "./player-overlays-DMLlEwmn.mjs";
4
- import { i as ae, n as oe, r as se, t as c } from "./square-D49AvsjC.mjs";
5
- import { t as ce } from "./trash-2-BwTJ2h2p.mjs";
6
- import { n as l, r as u, t as le } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
7
- import { MaskShapeCanvas as ue } from "./MaskShapeCanvas-Kfg9dl6B.mjs";
8
- var de = o("hexagon", [["path", {
9
- 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",
10
- key: "yt0hxn"
11
- }]]);
12
- //#endregion
2
+ import { n as ee, r as te, t as ne } from "./square-B_679zIX.mjs";
3
+ import { n as re, t as ie } from "./mic-off-DPNSd6G7.mjs";
4
+ import { t as ae } from "./trash-2-DC8LDYlI.mjs";
5
+ import { f as o, h as oe, m as se, v as s } from "./responsive-Dwyuxd3q.mjs";
6
+ import { n as c, r as l, t as ce } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
7
+ import { r as le, t as ue } from "./player-overlays-CqD89xkd.mjs";
8
+ import { MaskShapeCanvas as de } from "./MaskShapeCanvas-Kfg9dl6B.mjs";
13
9
  //#region ../ui-library/src/composites/cap-settings/privacy-mask-audio.ts
14
10
  e();
15
- var d = "Microphone", f = "The camera encodes no audio at all — live view, recordings, exports and the audio analyzer are all silent.";
16
- function p(e) {
11
+ var u = "Microphone", d = "The camera encodes no audio at all — live view, recordings, exports and the audio analyzer are all silent.";
12
+ function fe(e) {
17
13
  let t = e.supportsAudioMute === !0, n = t ? e.audioEnabled : null, r = e.pendingOn ?? null;
18
14
  return {
19
- label: d,
15
+ label: u,
20
16
  supported: t,
21
17
  on: n === null ? null : r ?? n,
22
18
  available: t && n !== null,
23
- costWhenOff: f
19
+ costWhenOff: d
24
20
  };
25
21
  }
26
- function m(e) {
22
+ function f(e) {
27
23
  return !e.available || e.on === null ? null : { enabled: !e.on };
28
24
  }
29
25
  //#endregion
30
26
  //#region ../ui-library/src/composites/cap-settings/PrivacyMaskSettings.tsx
31
- var fe = 120, pe = "privacy-mask", h = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors", g = "rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";
32
- function _(e) {
27
+ var p = 120, pe = "privacy-mask", m = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors", h = "rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";
28
+ function g(e) {
33
29
  return e.kind === "rect" || e.kind === "polygon" ? e : null;
34
30
  }
35
31
  function me(e) {
@@ -42,18 +38,18 @@ function he(e, t) {
42
38
  for (let n = 0; n < e.length; n += 1) if (JSON.stringify(e[n]) !== JSON.stringify(t[n])) return !1;
43
39
  return !0;
44
40
  }
45
- function v({ deviceId: e }) {
46
- let o = ee(ne().trpcClient, e), [d, f] = t(null), [v, y] = t(!1), [b, x] = t(!1), [S, C] = t(null), [w, T] = t(null), [E, D] = t(!1), [O, k] = t(!1), [A, j] = t(null), [M, N] = t(null), [ge, P] = t(null), [F, I] = t(null), [L, R] = t(null), z = r(!1);
41
+ function _({ deviceId: e }) {
42
+ let u = oe(s().trpcClient, e), [d, _] = t(null), [v, y] = t(!1), [b, x] = t(!1), [S, C] = t(null), [w, T] = t(null), [E, D] = t(!1), [O, k] = t(!1), [A, j] = t(null), [M, N] = t(null), [ge, P] = t(null), [F, I] = t(null), [L, R] = t(null), z = r(!1);
47
43
  a(() => {
48
- if (!o) return;
44
+ if (!u) return;
49
45
  let e = !1;
50
- return z.current = !1, f(null), y(!1), x(!1), C(null), T(null), k(!1), j(null), N(null), P(null), I(null), R(null), (async () => {
46
+ return z.current = !1, _(null), y(!1), x(!1), C(null), T(null), k(!1), j(null), N(null), P(null), I(null), R(null), (async () => {
51
47
  try {
52
- let t = await o.privacyMask?.getOptions({});
48
+ let t = await u.privacyMask?.getOptions({});
53
49
  if (e) return;
54
50
  if (!t) throw Error("device proxy not ready");
55
- if (f(t), z.current) return;
56
- let n = await o.privacyMask?.getStatus({});
51
+ if (_(t), z.current) return;
52
+ let n = await u.privacyMask?.getStatus({});
57
53
  if (e) return;
58
54
  if (!n) throw Error("device proxy not ready");
59
55
  if (n.regions === null) {
@@ -68,12 +64,12 @@ function v({ deviceId: e }) {
68
64
  T(r), C(r), P(n.audioEnabled);
69
65
  } catch (t) {
70
66
  if (e) return;
71
- te(t) ? y(!0) : console.error("Privacy Mask load failed", t);
67
+ se(t) ? y(!0) : console.error("Privacy Mask load failed", t);
72
68
  }
73
69
  })(), () => {
74
70
  e = !0;
75
71
  };
76
- }, [o]);
72
+ }, [u]);
77
73
  let B = i(() => S !== null && w !== null && (S.enabled !== w.enabled || !he(S.regions, w.regions)), [S, w]), V = S ? S.regions.length : 0, H = d ? d.maxRegions : 0, U = r(0);
78
74
  a(() => {
79
75
  U.current = H;
@@ -91,7 +87,7 @@ function v({ deviceId: e }) {
91
87
  enabled: e.enabled,
92
88
  label: `Zone ${String(e.id)}`
93
89
  })) : [], [S]), q = n((e, t) => {
94
- let n = _(t);
90
+ let n = g(t);
95
91
  n && C((t) => t && {
96
92
  ...t,
97
93
  regions: t.regions.map((t) => t.id === e ? {
@@ -100,7 +96,7 @@ function v({ deviceId: e }) {
100
96
  } : t)
101
97
  });
102
98
  }, []), J = n((e) => {
103
- let t = _(e);
99
+ let t = g(e);
104
100
  t && (N(null), C((e) => {
105
101
  if (!e) return e;
106
102
  let n = U.current;
@@ -130,14 +126,14 @@ function v({ deviceId: e }) {
130
126
  regions: w.regions
131
127
  });
132
128
  }, [w]), be = n(async () => {
133
- if (!(!o || !S)) {
129
+ if (!(!u || !S)) {
134
130
  D(!0);
135
131
  try {
136
- await o.privacyMask?.setMask({ patch: {
132
+ await u.privacyMask?.setMask({ patch: {
137
133
  enabled: S.enabled,
138
134
  regions: [...S.regions]
139
135
  } });
140
- let e = await o.privacyMask?.getStatus({});
136
+ let e = await u.privacyMask?.getStatus({});
141
137
  if (e && e.regions !== null) {
142
138
  let t = {
143
139
  enabled: e.enabled,
@@ -151,17 +147,17 @@ function v({ deviceId: e }) {
151
147
  D(!1);
152
148
  }
153
149
  }
154
- }, [o, S]), Z = p({
150
+ }, [u, S]), Z = fe({
155
151
  supportsAudioMute: d === null ? null : d.supportsAudioMute,
156
152
  audioEnabled: ge,
157
153
  pendingOn: F
158
154
  }), xe = n(async () => {
159
- let e = m(Z);
160
- if (!(!o || e === null)) {
155
+ let e = f(Z);
156
+ if (!(!u || e === null)) {
161
157
  I(e.enabled), R(null);
162
158
  try {
163
- await o.privacyMask?.setAudioEnabled(e);
164
- let t = await o.privacyMask?.getStatus({});
159
+ await u.privacyMask?.setAudioEnabled(e);
160
+ let t = await u.privacyMask?.getStatus({});
165
161
  t && P(t.audioEnabled);
166
162
  } catch (e) {
167
163
  console.error("Privacy microphone write failed — reverting", e), R(e instanceof Error ? e.message : String(e));
@@ -169,13 +165,13 @@ function v({ deviceId: e }) {
169
165
  I(null);
170
166
  }
171
167
  }
172
- }, [o, Z]), Se = n(() => {
168
+ }, [u, Z]), Se = n(() => {
173
169
  k((e) => (e && (N(null), j(null)), !e));
174
170
  }, []), Q = d?.supportedShapes ?? [];
175
- ie(i(() => O && !v && d && S ? {
171
+ ue(i(() => O && !v && d && S ? {
176
172
  id: pe,
177
- order: fe,
178
- node: /* @__PURE__ */ l(ue, {
173
+ order: p,
174
+ node: /* @__PURE__ */ c(de, {
179
175
  transparent: !0,
180
176
  items: K,
181
177
  supportedShapes: Q,
@@ -200,73 +196,73 @@ function v({ deviceId: e }) {
200
196
  M
201
197
  ]));
202
198
  let Ce = d?.supportedShapes.includes("rect") ?? !1, we = d?.supportedShapes.includes("polygon") ?? !1, $ = d !== null && (d.maxRegions <= 0 || d.supportedShapes.length === 0);
203
- return o ? /* @__PURE__ */ l(re, {
199
+ return u ? /* @__PURE__ */ c(le, {
204
200
  title: "Privacy Mask",
205
- icon: /* @__PURE__ */ l(ae, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
206
- children: /* @__PURE__ */ u("div", {
201
+ icon: /* @__PURE__ */ c(te, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
202
+ children: /* @__PURE__ */ l("div", {
207
203
  className: "flex flex-col gap-3",
208
- children: [v || $ ? /* @__PURE__ */ l("p", {
209
- className: `${s} leading-relaxed`,
204
+ children: [v || $ ? /* @__PURE__ */ c("p", {
205
+ className: `${o} leading-relaxed`,
210
206
  children: "This camera doesn't support an on-board privacy mask."
211
- }) : b ? /* @__PURE__ */ l("p", {
212
- className: `${s} leading-relaxed`,
207
+ }) : b ? /* @__PURE__ */ c("p", {
208
+ className: `${o} leading-relaxed`,
213
209
  children: "This camera hasn't answered, so what it currently masks is unknown — the editor stays closed rather than showing an empty frame you could save over. A battery camera answers once it wakes; otherwise check that it is reachable."
214
- }) : !v && !$ && !b && d !== null && S !== null ? /* @__PURE__ */ u(le, { children: [
215
- /* @__PURE__ */ u("p", {
216
- className: `${s} leading-relaxed`,
210
+ }) : !v && !$ && !b && d !== null && S !== null ? /* @__PURE__ */ l(ce, { children: [
211
+ /* @__PURE__ */ l("p", {
212
+ className: `${o} leading-relaxed`,
217
213
  children: [
218
214
  "Toggle ",
219
- /* @__PURE__ */ l("strong", {
215
+ /* @__PURE__ */ c("strong", {
220
216
  className: "text-foreground",
221
217
  children: "Edit mask"
222
218
  }),
223
219
  " to draw blanked-out zones on the live frame, then ",
224
- /* @__PURE__ */ l("strong", {
220
+ /* @__PURE__ */ c("strong", {
225
221
  className: "text-foreground",
226
222
  children: "Save"
227
223
  }),
228
224
  " to push them to the camera. Drag a rectangle to move, its corner to resize; drag polygon vertices, click an edge midpoint to add one, or right-click a vertex to remove it."
229
225
  ]
230
226
  }),
231
- /* @__PURE__ */ u("div", {
227
+ /* @__PURE__ */ l("div", {
232
228
  className: "flex items-center gap-2 flex-wrap",
233
229
  children: [
234
- /* @__PURE__ */ l("button", {
230
+ /* @__PURE__ */ c("button", {
235
231
  type: "button",
236
232
  onClick: Se,
237
233
  disabled: E,
238
234
  "aria-pressed": O,
239
- className: O ? g : h,
235
+ className: O ? h : m,
240
236
  children: O ? "Done editing" : "Edit mask"
241
237
  }),
242
- /* @__PURE__ */ l("button", {
238
+ /* @__PURE__ */ c("button", {
243
239
  type: "button",
244
240
  onClick: _e,
245
241
  disabled: E,
246
242
  "aria-pressed": S.enabled,
247
- className: S.enabled ? g : h,
243
+ className: S.enabled ? h : m,
248
244
  children: S.enabled ? "Mask on" : "Mask off"
249
245
  }),
250
- Ce && /* @__PURE__ */ l("button", {
246
+ Ce && /* @__PURE__ */ c("button", {
251
247
  type: "button",
252
248
  onClick: () => Y("rect"),
253
249
  disabled: E || W,
254
250
  "aria-pressed": M === "rect",
255
- className: M === "rect" ? g : h,
251
+ className: M === "rect" ? h : m,
256
252
  title: W ? "Maximum zones reached" : "Add a rectangle zone",
257
253
  children: "+ Rect"
258
254
  }),
259
- we && /* @__PURE__ */ l("button", {
255
+ we && /* @__PURE__ */ c("button", {
260
256
  type: "button",
261
257
  onClick: () => Y("polygon"),
262
258
  disabled: E || W,
263
259
  "aria-pressed": M === "polygon",
264
- className: M === "polygon" ? g : h,
260
+ className: M === "polygon" ? h : m,
265
261
  title: W ? "Maximum zones reached" : "Add a polygon zone",
266
262
  children: "+ Polygon"
267
263
  }),
268
- /* @__PURE__ */ u("span", {
269
- className: `${s} ml-1 tabular-nums`,
264
+ /* @__PURE__ */ l("span", {
265
+ className: `${o} ml-1 tabular-nums`,
270
266
  children: [
271
267
  V,
272
268
  " / ",
@@ -274,60 +270,60 @@ function v({ deviceId: e }) {
274
270
  " zones"
275
271
  ]
276
272
  }),
277
- /* @__PURE__ */ l("span", { className: "flex-1" }),
278
- /* @__PURE__ */ l("button", {
273
+ /* @__PURE__ */ c("span", { className: "flex-1" }),
274
+ /* @__PURE__ */ c("button", {
279
275
  type: "button",
280
276
  onClick: ye,
281
277
  disabled: E || !B,
282
278
  className: "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",
283
279
  children: "Revert"
284
280
  }),
285
- /* @__PURE__ */ l("button", {
281
+ /* @__PURE__ */ c("button", {
286
282
  type: "button",
287
283
  onClick: () => void be(),
288
284
  disabled: E || !B,
289
- className: g,
285
+ className: h,
290
286
  children: E ? "Saving…" : "Save"
291
287
  })
292
288
  ]
293
289
  }),
294
- V > 0 ? /* @__PURE__ */ l("div", {
290
+ V > 0 ? /* @__PURE__ */ c("div", {
295
291
  className: "flex flex-col gap-1",
296
292
  children: S.regions.map((e) => {
297
- let t = A === e.id, n = e.shape.kind === "polygon" ? de : c;
298
- return /* @__PURE__ */ u("div", {
293
+ let t = A === e.id, n = e.shape.kind === "polygon" ? re : ne;
294
+ return /* @__PURE__ */ l("div", {
299
295
  className: `flex items-center gap-2 rounded-md border px-2 py-1 transition-colors ${t ? "border-primary/50 bg-primary/10" : "border-border bg-surface"}`,
300
- children: [/* @__PURE__ */ u("button", {
296
+ children: [/* @__PURE__ */ l("button", {
301
297
  type: "button",
302
298
  onClick: () => ve(e.id),
303
299
  disabled: E,
304
300
  className: "flex flex-1 items-center gap-2 text-left text-[11px] font-medium text-foreground-subtle hover:text-foreground disabled:opacity-40 transition-colors",
305
301
  children: [
306
- /* @__PURE__ */ l(n, { className: "h-3.5 w-3.5 shrink-0" }),
307
- /* @__PURE__ */ u("span", { children: ["Zone ", e.id] }),
308
- /* @__PURE__ */ l("span", {
302
+ /* @__PURE__ */ c(n, { className: "h-3.5 w-3.5 shrink-0" }),
303
+ /* @__PURE__ */ l("span", { children: ["Zone ", e.id] }),
304
+ /* @__PURE__ */ c("span", {
309
305
  className: "text-foreground-faint capitalize",
310
306
  children: e.shape.kind
311
307
  })
312
308
  ]
313
- }), /* @__PURE__ */ l("button", {
309
+ }), /* @__PURE__ */ c("button", {
314
310
  type: "button",
315
311
  onClick: () => X(e.id),
316
312
  disabled: E,
317
313
  "aria-label": `Delete zone ${String(e.id)}`,
318
314
  title: "Delete zone",
319
315
  className: "inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:border-red-400/40 hover:bg-red-500/10 hover:text-red-400 disabled:opacity-40 transition-colors",
320
- children: /* @__PURE__ */ l(ce, { className: "h-3.5 w-3.5" })
316
+ children: /* @__PURE__ */ c(ae, { className: "h-3.5 w-3.5" })
321
317
  })]
322
318
  }, e.id);
323
319
  })
324
320
  }) : null
325
- ] }) : /* @__PURE__ */ l("p", {
326
- className: `${s} leading-relaxed`,
321
+ ] }) : /* @__PURE__ */ c("p", {
322
+ className: `${o} leading-relaxed`,
327
323
  children: "Loading the camera's privacy mask…"
328
- }), Z.supported && /* @__PURE__ */ u("div", {
324
+ }), Z.supported && /* @__PURE__ */ l("div", {
329
325
  className: "flex items-start gap-3 rounded-md border border-border bg-surface px-2 py-2",
330
- children: [/* @__PURE__ */ l("button", {
326
+ children: [/* @__PURE__ */ c("button", {
331
327
  type: "button",
332
328
  role: "switch",
333
329
  "aria-label": Z.label,
@@ -335,12 +331,12 @@ function v({ deviceId: e }) {
335
331
  disabled: !Z.available || F !== null,
336
332
  onClick: () => void xe(),
337
333
  title: Z.on === null ? "Microphone — state unknown; the camera did not answer." : Z.on ? `The camera is capturing sound. Turning it off: ${Z.costWhenOff}` : `The camera is silent. ${Z.costWhenOff}`,
338
- className: Z.on === !1 || Z.on === null ? h : g,
339
- children: /* @__PURE__ */ u("span", {
334
+ className: Z.on === !1 || Z.on === null ? m : h,
335
+ children: /* @__PURE__ */ l("span", {
340
336
  className: "inline-flex items-center gap-1.5",
341
- children: [Z.on === !1 ? /* @__PURE__ */ l(se, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ l(oe, { className: "h-3.5 w-3.5" }), Z.on === null ? "Microphone unknown" : Z.on ? "Microphone on" : "Microphone off"]
337
+ children: [Z.on === !1 ? /* @__PURE__ */ c(ie, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ c(ee, { className: "h-3.5 w-3.5" }), Z.on === null ? "Microphone unknown" : Z.on ? "Microphone on" : "Microphone off"]
342
338
  })
343
- }), /* @__PURE__ */ l("p", {
339
+ }), /* @__PURE__ */ c("p", {
344
340
  className: "text-[10px] text-foreground-subtle flex-1 leading-relaxed",
345
341
  children: L === null ? Z.on === null ? "The camera did not report its microphone, so this state is unknown." : Z.costWhenOff : `Write failed: ${L}`
346
342
  })]
@@ -349,4 +345,4 @@ function v({ deviceId: e }) {
349
345
  }) : null;
350
346
  }
351
347
  //#endregion
352
- export { v as PrivacyMaskSettings };
348
+ export { _ as PrivacyMaskSettings };