@camstack/addon-benchmark 1.1.13 → 1.1.15
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/{MaskShapeCanvas-DwXCR2iE.mjs → MaskShapeCanvas-BDvrLf-K.mjs} +37 -37
- package/dist/{MotionZonesSettings-D-sZCPy7.mjs → MotionZonesSettings-DR5v-Kms.mjs} +123 -123
- package/dist/{PrivacyMaskSettings-D7V1HFBh.mjs → PrivacyMaskSettings-CNmV82I5.mjs} +22 -22
- package/dist/{ReactKonva-xvRRqI5S.mjs → ReactKonva-DXzDAU1q.mjs} +21 -21
- package/dist/_stub.js +4948 -4580
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_benchmark_page-CIe_UAOU.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_benchmark_page-CTkwHery.mjs} +4 -4
- package/dist/_virtual_mf___mfe_internal__addon_benchmark_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CfDgveTk.mjs +26 -0
- package/dist/{_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.js-Bnj8XQnA.mjs → _virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.js-GeuxDuzQ.mjs} +1 -1
- package/dist/addon-benchmark.css +1 -1
- package/dist/{hostInit-DjfrVkUv.mjs → hostInit-DxlhjEqQ.mjs} +3 -3
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{player-overlays-D1-hCqsW.mjs → player-overlays-BPYk8orA.mjs} +30 -30
- package/dist/remoteEntry.js +1 -1
- package/dist/{trash-2-DiN5J6s4.mjs → trash-2-B0VQvfAb.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_benchmark_page__remoteEntry_js-DZI5N5Y0.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_benchmark_page__remoteEntry_js-CInHNBsV.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_benchmark_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DBUeUEtt.mjs +0 -26
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as e,
|
|
1
|
+
import { a as e, c as t, g as n, h as r, u as i, x as a } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.js-GeuxDuzQ.mjs";
|
|
2
2
|
import { n as o, r as s } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-SOU_VnTj.mjs";
|
|
3
|
-
import { a as c, c as l, i as u, l as d, n as f, o as p, r as m, s as h } from "./ReactKonva-
|
|
3
|
+
import { a as c, c as l, i as u, l as d, n as f, o as p, r as m, s as h } from "./ReactKonva-DXzDAU1q.mjs";
|
|
4
4
|
//#region ../ui-library/src/composites/cap-settings/MaskShapeCanvas.tsx
|
|
5
|
-
|
|
5
|
+
a();
|
|
6
6
|
var g = {
|
|
7
7
|
rect: "#ef4444",
|
|
8
8
|
polygon: "#3b82f6",
|
|
@@ -52,12 +52,12 @@ function j(e, t) {
|
|
|
52
52
|
function M(e) {
|
|
53
53
|
return e.kind === "polygon" || e.kind === "line";
|
|
54
54
|
}
|
|
55
|
-
function N({ items: e, selectedId:
|
|
56
|
-
let P =
|
|
55
|
+
function N({ items: e, selectedId: a, onSelect: u, onShapeChange: d, onDrawComplete: f, drawingKind: m, supportedShapes: h, transparent: _ = !1, backdrop: v, polygonVertices: A, grid: N }) {
|
|
56
|
+
let P = r(null), [F, z] = n({
|
|
57
57
|
w: 800,
|
|
58
58
|
h: 450
|
|
59
|
-
}), [B, V] =
|
|
60
|
-
|
|
59
|
+
}), [B, V] = n([]), [H, U] = n(null), [W, G] = n(null), [K, q] = n(null), J = m !== null && h.includes(m);
|
|
60
|
+
i(() => {
|
|
61
61
|
if (!K) return;
|
|
62
62
|
let t = e.find((e) => e.id === K.itemId);
|
|
63
63
|
if (!t || !M(t.shape)) {
|
|
@@ -65,7 +65,7 @@ function N({ items: e, selectedId: t, onSelect: u, onShapeChange: d, onDrawCompl
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
j(t.shape.points, K.points) && q(null);
|
|
68
|
-
}, [e, K]),
|
|
68
|
+
}, [e, K]), i(() => {
|
|
69
69
|
let e = P.current;
|
|
70
70
|
if (!e) return;
|
|
71
71
|
let t = new ResizeObserver((e) => {
|
|
@@ -81,12 +81,12 @@ function N({ items: e, selectedId: t, onSelect: u, onShapeChange: d, onDrawCompl
|
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
return t.observe(e), () => t.disconnect();
|
|
84
|
-
}, [_]),
|
|
84
|
+
}, [_]), i(() => {
|
|
85
85
|
!J && H !== null && U(null);
|
|
86
86
|
}, [J, H]);
|
|
87
|
-
let Y =
|
|
87
|
+
let Y = t((e) => {
|
|
88
88
|
f(e), V([]);
|
|
89
|
-
}, [f]), X =
|
|
89
|
+
}, [f]), X = t((e) => {
|
|
90
90
|
if (!J || m === null) {
|
|
91
91
|
u(null);
|
|
92
92
|
return;
|
|
@@ -153,7 +153,7 @@ function N({ items: e, selectedId: t, onSelect: u, onShapeChange: d, onDrawCompl
|
|
|
153
153
|
N,
|
|
154
154
|
Y,
|
|
155
155
|
u
|
|
156
|
-
]), ee =
|
|
156
|
+
]), ee = t((e) => {
|
|
157
157
|
!J || m !== "polygon" || B.length < b || (e.cancelBubble = !0, Y({
|
|
158
158
|
kind: "polygon",
|
|
159
159
|
points: B
|
|
@@ -163,17 +163,17 @@ function N({ items: e, selectedId: t, onSelect: u, onShapeChange: d, onDrawCompl
|
|
|
163
163
|
m,
|
|
164
164
|
B,
|
|
165
165
|
Y
|
|
166
|
-
]), Z =
|
|
167
|
-
|
|
166
|
+
]), Z = r(null), Q = r(null);
|
|
167
|
+
i(() => () => {
|
|
168
168
|
Z.current !== null && cancelAnimationFrame(Z.current);
|
|
169
169
|
}, []);
|
|
170
|
-
let te =
|
|
170
|
+
let te = t((e) => {
|
|
171
171
|
if (!J) return;
|
|
172
172
|
let t = e.target.getStage();
|
|
173
173
|
t && (Q.current = t.getPointerPosition() ?? null, Z.current === null && (Z.current = requestAnimationFrame(() => {
|
|
174
174
|
Z.current = null, U(Q.current);
|
|
175
175
|
})));
|
|
176
|
-
}, [J]), ne =
|
|
176
|
+
}, [J]), ne = r(!1), re = r(!0), ie = r(/* @__PURE__ */ new Set()), ae = t((e, t, n, r) => {
|
|
177
177
|
let i = t.gridWidth * t.gridHeight;
|
|
178
178
|
if (n < 0 || n >= i || t.cells[n] === r) return;
|
|
179
179
|
let a = [...t.cells];
|
|
@@ -253,14 +253,14 @@ function N({ items: e, selectedId: t, onSelect: u, onShapeChange: d, onDrawCompl
|
|
|
253
253
|
}), $]
|
|
254
254
|
}),
|
|
255
255
|
/* @__PURE__ */ o(c, { children: e.map((e) => {
|
|
256
|
-
let
|
|
256
|
+
let t = e.id === a, n = e.enabled === !1, r = k(e), i = t && !J && !n;
|
|
257
257
|
if (e.shape.kind === "rect") return /* @__PURE__ */ o(I, {
|
|
258
258
|
item: e,
|
|
259
259
|
shape: e.shape,
|
|
260
|
-
color:
|
|
261
|
-
selected:
|
|
262
|
-
dimmed:
|
|
263
|
-
editable:
|
|
260
|
+
color: r,
|
|
261
|
+
selected: t,
|
|
262
|
+
dimmed: n,
|
|
263
|
+
editable: i,
|
|
264
264
|
isDrawing: J,
|
|
265
265
|
size: F,
|
|
266
266
|
onSelect: u,
|
|
@@ -269,9 +269,9 @@ function N({ items: e, selectedId: t, onSelect: u, onShapeChange: d, onDrawCompl
|
|
|
269
269
|
if (e.shape.kind === "grid") return /* @__PURE__ */ o(L, {
|
|
270
270
|
item: e,
|
|
271
271
|
shape: e.shape,
|
|
272
|
-
color:
|
|
273
|
-
dimmed:
|
|
274
|
-
editable:
|
|
272
|
+
color: r,
|
|
273
|
+
dimmed: n,
|
|
274
|
+
editable: i,
|
|
275
275
|
size: F,
|
|
276
276
|
onSelect: u,
|
|
277
277
|
paintingRef: ne,
|
|
@@ -283,10 +283,10 @@ function N({ items: e, selectedId: t, onSelect: u, onShapeChange: d, onDrawCompl
|
|
|
283
283
|
return /* @__PURE__ */ o(R, {
|
|
284
284
|
item: e,
|
|
285
285
|
shape: e.shape,
|
|
286
|
-
color:
|
|
287
|
-
selected:
|
|
288
|
-
dimmed:
|
|
289
|
-
editable:
|
|
286
|
+
color: r,
|
|
287
|
+
selected: t,
|
|
288
|
+
dimmed: n,
|
|
289
|
+
editable: i,
|
|
290
290
|
isLine: s,
|
|
291
291
|
isDrawing: J,
|
|
292
292
|
size: F,
|
|
@@ -361,14 +361,14 @@ var P = .02;
|
|
|
361
361
|
function F(e, t) {
|
|
362
362
|
return Math.abs(e.x - t.x) < 1e-6 && Math.abs(e.y - t.y) < 1e-6 && Math.abs(e.width - t.width) < 1e-6 && Math.abs(e.height - t.height) < 1e-6;
|
|
363
363
|
}
|
|
364
|
-
function I({ item: e, shape: t, color:
|
|
365
|
-
let [b, x] =
|
|
364
|
+
function I({ item: e, shape: t, color: r, selected: a, dimmed: c, editable: l, isDrawing: f, size: p, onSelect: g, onShapeChange: y }) {
|
|
365
|
+
let [b, x] = n(null), S = {
|
|
366
366
|
x: t.x,
|
|
367
367
|
y: t.y,
|
|
368
368
|
width: t.width,
|
|
369
369
|
height: t.height
|
|
370
370
|
};
|
|
371
|
-
|
|
371
|
+
i(() => {
|
|
372
372
|
b && F(S, b) && x(null);
|
|
373
373
|
}, [
|
|
374
374
|
t.x,
|
|
@@ -377,7 +377,7 @@ function I({ item: e, shape: t, color: n, selected: i, dimmed: c, editable: l, i
|
|
|
377
377
|
t.height,
|
|
378
378
|
b
|
|
379
379
|
]);
|
|
380
|
-
let C = b ?? S, w = C.x * p.w, T = C.y * p.h, E = C.width * p.w, D = C.height * p.h, k = c ? .35 :
|
|
380
|
+
let C = b ?? S, w = C.x * p.w, T = C.y * p.h, E = C.width * p.w, D = C.height * p.h, k = c ? .35 : a ? 1 : .85, A = (t) => {
|
|
381
381
|
x(t), y(e.id, {
|
|
382
382
|
kind: "rect",
|
|
383
383
|
x: t.x,
|
|
@@ -425,9 +425,9 @@ function I({ item: e, shape: t, color: n, selected: i, dimmed: c, editable: l, i
|
|
|
425
425
|
y: T,
|
|
426
426
|
width: E,
|
|
427
427
|
height: D,
|
|
428
|
-
fill:
|
|
429
|
-
stroke:
|
|
430
|
-
strokeWidth:
|
|
428
|
+
fill: r + (a ? v : _),
|
|
429
|
+
stroke: r,
|
|
430
|
+
strokeWidth: a ? 2.5 : 1.5,
|
|
431
431
|
opacity: k
|
|
432
432
|
}),
|
|
433
433
|
e.label ? /* @__PURE__ */ o(d, {
|
|
@@ -435,7 +435,7 @@ function I({ item: e, shape: t, color: n, selected: i, dimmed: c, editable: l, i
|
|
|
435
435
|
y: T - 16,
|
|
436
436
|
text: e.label,
|
|
437
437
|
fontSize: 12,
|
|
438
|
-
fill:
|
|
438
|
+
fill: r,
|
|
439
439
|
stroke: "#000000",
|
|
440
440
|
strokeWidth: 3,
|
|
441
441
|
fillAfterStrokeEnabled: !0,
|
|
@@ -446,7 +446,7 @@ function I({ item: e, shape: t, color: n, selected: i, dimmed: c, editable: l, i
|
|
|
446
446
|
x: w + E,
|
|
447
447
|
y: T + D,
|
|
448
448
|
radius: 6,
|
|
449
|
-
fill:
|
|
449
|
+
fill: r,
|
|
450
450
|
stroke: "#ffffff",
|
|
451
451
|
strokeWidth: 1.5,
|
|
452
452
|
draggable: !0,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as e, g as t, h as n, p as r, u as i, x as a } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.js-GeuxDuzQ.mjs";
|
|
2
2
|
import { n as o, r as s, t as c } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-SOU_VnTj.mjs";
|
|
3
|
-
import { a as l, f as u, i as
|
|
4
|
-
import { MaskShapeCanvas as h } from "./MaskShapeCanvas-
|
|
5
|
-
var
|
|
3
|
+
import { a as l, f as u, i as ee, p as d, s as f, t as p, u as m } from "./player-overlays-BPYk8orA.mjs";
|
|
4
|
+
import { MaskShapeCanvas as h } from "./MaskShapeCanvas-BDvrLf-K.mjs";
|
|
5
|
+
var te = m("grid-2x2", [
|
|
6
6
|
["path", {
|
|
7
7
|
d: "M12 3v18",
|
|
8
8
|
key: "108xh3"
|
|
@@ -22,180 +22,180 @@ var g = m("grid-2x2", [
|
|
|
22
22
|
]);
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region ../ui-library/src/composites/cap-settings/MotionZonesSettings.tsx
|
|
25
|
-
|
|
26
|
-
var
|
|
25
|
+
a();
|
|
26
|
+
var ne = 110, g = "motion-zones", _ = 0, re = [
|
|
27
27
|
1,
|
|
28
28
|
2,
|
|
29
29
|
3
|
|
30
|
-
],
|
|
31
|
-
function
|
|
30
|
+
], 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";
|
|
31
|
+
function x(e, t, n) {
|
|
32
32
|
let r = t * n, i = Array.from({ length: r });
|
|
33
33
|
for (let t = 0; t < r; t += 1) i[t] = e[t] === !0;
|
|
34
34
|
return i;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function S(e, t) {
|
|
37
37
|
if (e.length !== t.length) return !1;
|
|
38
38
|
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
39
39
|
return !0;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function C(e, t) {
|
|
42
42
|
return Math.ceil(e / t);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function w(e, t, n) {
|
|
45
45
|
return Math.min(n - 1, Math.floor((e + .5) / t * n));
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let i =
|
|
47
|
+
function T(e, t, n, r) {
|
|
48
|
+
let i = C(t, r), a = C(n, r), o = Array.from({ length: i * a }, () => !1);
|
|
49
49
|
for (let r = 0; r < n; r += 1) {
|
|
50
|
-
let s =
|
|
51
|
-
for (let n = 0; n < t; n += 1) e[r * t + n] === !0 && (o[s * i +
|
|
50
|
+
let s = w(r, n, a);
|
|
51
|
+
for (let n = 0; n < t; n += 1) e[r * t + n] === !0 && (o[s * i + w(n, t, i)] = !0);
|
|
52
52
|
}
|
|
53
53
|
return o;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
let i =
|
|
55
|
+
function E(e, t, n, r) {
|
|
56
|
+
let i = C(t, r), a = C(n, r), o = Array.from({ length: t * n }, () => !1);
|
|
57
57
|
for (let r = 0; r < n; r += 1) {
|
|
58
|
-
let s =
|
|
59
|
-
for (let n = 0; n < t; n += 1) o[r * t + n] = e[s * i +
|
|
58
|
+
let s = w(r, n, a);
|
|
59
|
+
for (let n = 0; n < t; n += 1) o[r * t + n] = e[s * i + w(n, t, i)] === !0;
|
|
60
60
|
}
|
|
61
61
|
return o;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
let m = l(
|
|
65
|
-
|
|
63
|
+
function D({ deviceId: a }) {
|
|
64
|
+
let m = l(f().trpcClient, a), [w, D] = t(null), [O, k] = t(!1), [A, j] = t(null), [M, N] = t(null), [P, F] = t(v), [I, L] = t(!1), [R, z] = t(!1), B = n(!1);
|
|
65
|
+
i(() => {
|
|
66
66
|
if (!m) return;
|
|
67
67
|
let e = !1;
|
|
68
|
-
return
|
|
68
|
+
return B.current = !1, D(null), k(!1), j(null), N(null), F(v), z(!1), (async () => {
|
|
69
69
|
try {
|
|
70
70
|
let t = await m.motionZones?.getOptions({});
|
|
71
71
|
if (e) return;
|
|
72
72
|
if (!t) throw Error("device proxy not ready");
|
|
73
|
-
if (
|
|
73
|
+
if (D(t), B.current) return;
|
|
74
74
|
let n = await m.motionZones?.getStatus({});
|
|
75
75
|
if (e) return;
|
|
76
76
|
if (!n) throw Error("device proxy not ready");
|
|
77
|
-
|
|
78
|
-
let r = n.regions.find((e) => e.shape.kind === "grid"), i =
|
|
79
|
-
|
|
77
|
+
B.current = !0;
|
|
78
|
+
let r = n.regions.find((e) => e.shape.kind === "grid"), i = x(r ? r.shape.cells : [], t.grid.width, t.grid.height);
|
|
79
|
+
N(i), j(T(i, t.grid.width, t.grid.height, v));
|
|
80
80
|
} catch (t) {
|
|
81
81
|
if (e) return;
|
|
82
|
-
|
|
82
|
+
d(t) ? k(!0) : console.error("Motion Zones load failed", t);
|
|
83
83
|
}
|
|
84
84
|
})(), () => {
|
|
85
85
|
e = !0;
|
|
86
86
|
};
|
|
87
87
|
}, [m]);
|
|
88
|
-
let
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
let V = w ? w.grid.width : 0, H = w ? w.grid.height : 0, U = C(V, P), W = C(H, P), G = r(() => A && w ? E(A, V, H, P) : null, [
|
|
89
|
+
A,
|
|
90
|
+
w,
|
|
91
|
+
V,
|
|
91
92
|
H,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
N && T && M(E(N, H, U, F));
|
|
93
|
+
P
|
|
94
|
+
]), K = r(() => G !== null && M !== null && !S(G, M), [G, M]), q = r(() => G ? G.reduce((e, t) => t ? e + 1 : e, 0) : 0, [G]), J = V * H, Y = U * W, X = e((e) => {
|
|
95
|
+
Y > 0 && j(Array.from({ length: Y }, () => e));
|
|
96
|
+
}, [Y]), Z = e(() => {
|
|
97
|
+
j((e) => e && e.map((e) => !e));
|
|
98
|
+
}, []), ie = e(() => {
|
|
99
|
+
M && w && j(T(M, V, H, P));
|
|
100
100
|
}, [
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
M,
|
|
102
|
+
w,
|
|
103
|
+
V,
|
|
103
104
|
H,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return I(e), n;
|
|
105
|
+
P
|
|
106
|
+
]), ae = e((e) => {
|
|
107
|
+
e === P || !w || j((t) => {
|
|
108
|
+
if (!t) return F(e), t;
|
|
109
|
+
let n = T(E(t, V, H, P), V, H, e);
|
|
110
|
+
return F(e), n;
|
|
111
111
|
});
|
|
112
112
|
}, [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
]), Q =
|
|
118
|
-
id:
|
|
113
|
+
P,
|
|
114
|
+
w,
|
|
115
|
+
V,
|
|
116
|
+
H
|
|
117
|
+
]), Q = r(() => w && A ? [{
|
|
118
|
+
id: _,
|
|
119
119
|
shape: {
|
|
120
120
|
kind: "grid",
|
|
121
|
-
gridWidth:
|
|
122
|
-
gridHeight:
|
|
123
|
-
cells: [...
|
|
121
|
+
gridWidth: U,
|
|
122
|
+
gridHeight: W,
|
|
123
|
+
cells: [...A]
|
|
124
124
|
}
|
|
125
125
|
}] : [], [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
]), $ =
|
|
131
|
-
t.kind === "grid" &&
|
|
132
|
-
}, []), oe =
|
|
133
|
-
if (!(!m || !
|
|
134
|
-
|
|
126
|
+
w,
|
|
127
|
+
A,
|
|
128
|
+
U,
|
|
129
|
+
W
|
|
130
|
+
]), $ = e((e, t) => {
|
|
131
|
+
t.kind === "grid" && j(t.cells);
|
|
132
|
+
}, []), oe = e(async () => {
|
|
133
|
+
if (!(!m || !A || !w)) {
|
|
134
|
+
L(!0);
|
|
135
135
|
try {
|
|
136
|
-
let e =
|
|
136
|
+
let e = E(A, w.grid.width, w.grid.height, P), t = {
|
|
137
137
|
kind: "grid",
|
|
138
|
-
gridWidth:
|
|
139
|
-
gridHeight:
|
|
138
|
+
gridWidth: w.grid.width,
|
|
139
|
+
gridHeight: w.grid.height,
|
|
140
140
|
cells: e
|
|
141
141
|
};
|
|
142
142
|
await m.motionZones?.setZone({ patch: { regions: [{
|
|
143
|
-
id:
|
|
143
|
+
id: _,
|
|
144
144
|
enabled: !0,
|
|
145
145
|
shape: t
|
|
146
146
|
}] } });
|
|
147
147
|
let n = await m.motionZones?.getStatus({});
|
|
148
148
|
if (n) {
|
|
149
|
-
let e = n.regions.find((e) => e.shape.kind === "grid"), t =
|
|
150
|
-
|
|
149
|
+
let e = n.regions.find((e) => e.shape.kind === "grid"), t = x(e ? e.shape.cells : [], w.grid.width, w.grid.height);
|
|
150
|
+
N(t), j(T(t, w.grid.width, w.grid.height, P));
|
|
151
151
|
}
|
|
152
152
|
} catch (e) {
|
|
153
153
|
console.error("Motion Zones save failed", e);
|
|
154
154
|
} finally {
|
|
155
|
-
|
|
155
|
+
L(!1);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
}, [
|
|
159
159
|
m,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
A,
|
|
161
|
+
w,
|
|
162
|
+
P
|
|
163
163
|
]);
|
|
164
|
-
return p(
|
|
165
|
-
id:
|
|
166
|
-
order:
|
|
164
|
+
return p(r(() => R && !O && w && A ? {
|
|
165
|
+
id: g,
|
|
166
|
+
order: ne,
|
|
167
167
|
node: /* @__PURE__ */ o(h, {
|
|
168
168
|
transparent: !0,
|
|
169
169
|
items: Q,
|
|
170
170
|
supportedShapes: ["grid"],
|
|
171
171
|
grid: {
|
|
172
|
-
width:
|
|
173
|
-
height:
|
|
172
|
+
width: U,
|
|
173
|
+
height: W
|
|
174
174
|
},
|
|
175
|
-
selectedId:
|
|
175
|
+
selectedId: _,
|
|
176
176
|
onSelect: () => {},
|
|
177
177
|
onShapeChange: $,
|
|
178
178
|
onDrawComplete: () => {},
|
|
179
179
|
drawingKind: null
|
|
180
180
|
})
|
|
181
181
|
} : null, [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
R,
|
|
183
|
+
O,
|
|
184
|
+
w,
|
|
185
|
+
A,
|
|
186
186
|
Q,
|
|
187
187
|
$,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
])), m ? /* @__PURE__ */ o(
|
|
188
|
+
U,
|
|
189
|
+
W
|
|
190
|
+
])), m ? /* @__PURE__ */ o(ee, {
|
|
191
191
|
title: "Motion Zones",
|
|
192
|
-
icon: /* @__PURE__ */ o(
|
|
192
|
+
icon: /* @__PURE__ */ o(te, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
|
|
193
193
|
children: /* @__PURE__ */ o("div", {
|
|
194
194
|
className: "flex flex-col gap-3",
|
|
195
|
-
children:
|
|
195
|
+
children: O ? /* @__PURE__ */ o("p", {
|
|
196
196
|
className: `${u} leading-relaxed`,
|
|
197
197
|
children: "This camera doesn't expose an on-board motion zones grid."
|
|
198
|
-
}) : !
|
|
198
|
+
}) : !O && w !== null && A !== null ? /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ s("p", {
|
|
199
199
|
className: `${u} leading-relaxed`,
|
|
200
200
|
children: [
|
|
201
201
|
"Toggle ",
|
|
@@ -215,9 +215,9 @@ function O({ deviceId: e }) {
|
|
|
215
215
|
children: "Cell size"
|
|
216
216
|
}),
|
|
217
217
|
" for quicker, broad-stroke painting — it's resampled to the camera's native ",
|
|
218
|
-
|
|
218
|
+
w.grid.width,
|
|
219
219
|
"×",
|
|
220
|
-
|
|
220
|
+
w.grid.height,
|
|
221
221
|
" grid on save (×1 is the finest)."
|
|
222
222
|
]
|
|
223
223
|
}), /* @__PURE__ */ s("div", {
|
|
@@ -225,31 +225,31 @@ function O({ deviceId: e }) {
|
|
|
225
225
|
children: [
|
|
226
226
|
/* @__PURE__ */ o("button", {
|
|
227
227
|
type: "button",
|
|
228
|
-
onClick: () =>
|
|
229
|
-
disabled:
|
|
230
|
-
"aria-pressed":
|
|
231
|
-
className:
|
|
232
|
-
children:
|
|
228
|
+
onClick: () => z((e) => !e),
|
|
229
|
+
disabled: I,
|
|
230
|
+
"aria-pressed": R,
|
|
231
|
+
className: R ? b : y,
|
|
232
|
+
children: R ? "Done editing" : "Edit grid"
|
|
233
233
|
}),
|
|
234
234
|
/* @__PURE__ */ o("button", {
|
|
235
235
|
type: "button",
|
|
236
|
-
onClick: () =>
|
|
237
|
-
disabled:
|
|
238
|
-
className:
|
|
236
|
+
onClick: () => X(!0),
|
|
237
|
+
disabled: I,
|
|
238
|
+
className: y,
|
|
239
239
|
children: "All on"
|
|
240
240
|
}),
|
|
241
241
|
/* @__PURE__ */ o("button", {
|
|
242
242
|
type: "button",
|
|
243
|
-
onClick: () =>
|
|
244
|
-
disabled:
|
|
245
|
-
className:
|
|
243
|
+
onClick: () => X(!1),
|
|
244
|
+
disabled: I,
|
|
245
|
+
className: y,
|
|
246
246
|
children: "All off"
|
|
247
247
|
}),
|
|
248
248
|
/* @__PURE__ */ o("button", {
|
|
249
249
|
type: "button",
|
|
250
|
-
onClick:
|
|
251
|
-
disabled:
|
|
252
|
-
className:
|
|
250
|
+
onClick: Z,
|
|
251
|
+
disabled: I,
|
|
252
|
+
className: y,
|
|
253
253
|
children: "Invert"
|
|
254
254
|
}),
|
|
255
255
|
/* @__PURE__ */ s("div", {
|
|
@@ -259,43 +259,43 @@ function O({ deviceId: e }) {
|
|
|
259
259
|
children: [/* @__PURE__ */ o("span", {
|
|
260
260
|
className: `${u} mr-0.5`,
|
|
261
261
|
children: "Cell size"
|
|
262
|
-
}),
|
|
262
|
+
}), re.map((e) => /* @__PURE__ */ s("button", {
|
|
263
263
|
type: "button",
|
|
264
264
|
onClick: () => ae(e),
|
|
265
|
-
disabled:
|
|
266
|
-
"aria-pressed":
|
|
267
|
-
title: e === 1 ? `Camera grid ${
|
|
268
|
-
className:
|
|
265
|
+
disabled: I,
|
|
266
|
+
"aria-pressed": P === e,
|
|
267
|
+
title: e === 1 ? `Camera grid ${V}×${H} (finest)` : `${C(V, e)}×${C(H, e)} painting grid · cells ×${e} bigger`,
|
|
268
|
+
className: P === e ? b : y,
|
|
269
269
|
children: ["×", e]
|
|
270
270
|
}, e))]
|
|
271
271
|
}),
|
|
272
272
|
/* @__PURE__ */ s("span", {
|
|
273
273
|
className: `${u} ml-1 tabular-nums`,
|
|
274
274
|
children: [
|
|
275
|
-
|
|
275
|
+
q,
|
|
276
276
|
" / ",
|
|
277
|
-
|
|
277
|
+
J,
|
|
278
278
|
" cells · ",
|
|
279
|
-
|
|
279
|
+
w.grid.width,
|
|
280
280
|
"×",
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
w.grid.height,
|
|
282
|
+
P === 1 ? "" : ` · paint ${U}×${W}`
|
|
283
283
|
]
|
|
284
284
|
}),
|
|
285
285
|
/* @__PURE__ */ o("span", { className: "flex-1" }),
|
|
286
286
|
/* @__PURE__ */ o("button", {
|
|
287
287
|
type: "button",
|
|
288
288
|
onClick: ie,
|
|
289
|
-
disabled:
|
|
289
|
+
disabled: I || !K,
|
|
290
290
|
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",
|
|
291
291
|
children: "Revert"
|
|
292
292
|
}),
|
|
293
293
|
/* @__PURE__ */ o("button", {
|
|
294
294
|
type: "button",
|
|
295
295
|
onClick: () => void oe(),
|
|
296
|
-
disabled:
|
|
297
|
-
className:
|
|
298
|
-
children:
|
|
296
|
+
disabled: I || !K,
|
|
297
|
+
className: b,
|
|
298
|
+
children: I ? "Saving…" : "Save"
|
|
299
299
|
})
|
|
300
300
|
]
|
|
301
301
|
})] }) : /* @__PURE__ */ o("p", {
|
|
@@ -306,4 +306,4 @@ function O({ deviceId: e }) {
|
|
|
306
306
|
}) : null;
|
|
307
307
|
}
|
|
308
308
|
//#endregion
|
|
309
|
-
export {
|
|
309
|
+
export { D as MotionZonesSettings };
|