@camstack/addon-pipeline 1.1.55 → 1.1.57

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 (46) hide show
  1. package/dist/audio-analyzer/index.js +2 -2
  2. package/dist/audio-analyzer/index.mjs +2 -2
  3. package/dist/detection-pipeline/index.js +92 -88
  4. package/dist/detection-pipeline/index.mjs +91 -87
  5. package/dist/{dist-DI57FC8K.js → dist-CK8Ur-OS.js} +1045 -43
  6. package/dist/{dist-RWGGPwVx.mjs → dist-CL531uVA.mjs} +1045 -43
  7. package/dist/motion-wasm/index.js +9 -41
  8. package/dist/motion-wasm/index.mjs +9 -41
  9. package/dist/pipeline-runner/index.js +338 -664
  10. package/dist/pipeline-runner/index.mjs +327 -655
  11. package/dist/recorder/index.js +2 -2
  12. package/dist/recorder/index.mjs +2 -2
  13. package/dist/remote-restream-BeHi78PZ.mjs +25 -0
  14. package/dist/remote-restream-CO36Sr30.js +36 -0
  15. package/dist/session-decode/decode-worker-child.js +5 -3
  16. package/dist/session-decode/decode-worker-child.mjs +5 -3
  17. package/dist/{step-definitions-CP9kVSml.mjs → step-definitions-1d3_vQ6S.mjs} +45 -3
  18. package/dist/{step-definitions-CNBFKjZe.js → step-definitions-DHAxruAQ.js} +45 -3
  19. package/dist/stream-broker/_stub.js +351 -291
  20. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-mDCPzmT3.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Cm_B-hQT.mjs} +2 -2
  21. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Ba7Eyd47.mjs +26 -0
  22. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Dn_pxzP-.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-TWCUWhCm.mjs} +2 -2
  23. package/dist/stream-broker/{hostInit-GM_CI22k.mjs → hostInit-DEaqJpGA.mjs} +2 -2
  24. package/dist/stream-broker/index.js +935 -38
  25. package/dist/stream-broker/index.mjs +932 -35
  26. package/dist/stream-broker/remoteEntry.js +1 -1
  27. package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-BChW0ntM.js → MaskShapeCanvas-DI4BY7W2-CZUzu3MF.js} +1 -1
  28. package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-DDzqEbSe.js → MotionZonesSettings-NcxxQN8r-CmZbzLQi.js} +1 -1
  29. package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-B879GXaf.js → PrivacyMaskSettings-APgPLF7p-BOKDrH0N.js} +1 -1
  30. package/embed-dist/assets/index-Bmpl9O1K.css +2 -0
  31. package/embed-dist/assets/index-DOsK8CZb.js +81 -0
  32. package/embed-dist/index.html +2 -2
  33. package/package.json +7 -5
  34. package/python/inference_pool.py +183 -29
  35. package/python/postprocessors/__init__.py +2 -0
  36. package/python/postprocessors/ssd.py +128 -0
  37. package/python/requirements-edgetpu.txt +23 -0
  38. package/python/test_inference_pool_layout.py +16 -1
  39. package/python/test_inference_pool_preprocess.py +65 -0
  40. package/dist/remote-source-plane-CHgvzzA6.js +0 -1030
  41. package/dist/remote-source-plane-DU0aRSPv.mjs +0 -1001
  42. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B3gTdHEh.mjs +0 -26
  43. package/embed-dist/assets/index-CC06JBcl.css +0 -2
  44. package/embed-dist/assets/index-CNjQ5rAE.js +0 -81
  45. package/dist/{model-download-service-C-IHWnXx-BPy6aoAx.mjs → model-download-service-C-IHWnXx-3Mmeob3l.mjs} +1 -1
  46. package/dist/{model-download-service-C-IHWnXx-BLXzxpRB.js → model-download-service-C-IHWnXx-D326YNnt.js} +1 -1
@@ -1,8 +1,8 @@
1
- import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Dn_pxzP-.mjs";
1
+ import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-TWCUWhCm.mjs";
2
2
  import { a as d, i as f, n as p, o as m, r as h, t as g } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare__react__loadShare__.js-C9j-2lBe.mjs";
3
3
  import { n as _, r as v, t as y } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-XO0-Pyu6.mjs";
4
4
  import { n as b, t as x } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-BO7TIbJV.mjs";
5
- import { t as S } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B3gTdHEh.mjs";
5
+ import { t as S } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Ba7Eyd47.mjs";
6
6
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
7
7
  var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), T = (e) => {
8
8
  let t = w(e);
@@ -37,19 +37,46 @@ var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) =
37
37
  ...r
38
38
  }));
39
39
  return n.displayName = T(e), n;
40
- }, j = A("chevron-down", [["path", {
40
+ }, j = A("check", [["path", {
41
+ d: "M20 6 9 17l-5-5",
42
+ key: "1gmf2c"
43
+ }]]), M = A("chevron-down", [["path", {
41
44
  d: "m6 9 6 6 6-6",
42
45
  key: "qrunsl"
43
- }]]), M = A("chevron-right", [["path", {
46
+ }]]), N = A("chevron-right", [["path", {
44
47
  d: "m9 18 6-6-6-6",
45
48
  key: "mthhwq"
46
- }]]), ee = A("plus", [["path", {
49
+ }]]), ee = A("circle-alert", [
50
+ ["circle", {
51
+ cx: "12",
52
+ cy: "12",
53
+ r: "10",
54
+ key: "1mglay"
55
+ }],
56
+ ["line", {
57
+ x1: "12",
58
+ x2: "12",
59
+ y1: "8",
60
+ y2: "12",
61
+ key: "1pkeuh"
62
+ }],
63
+ ["line", {
64
+ x1: "12",
65
+ x2: "12.01",
66
+ y1: "16",
67
+ y2: "16",
68
+ key: "4dfq90"
69
+ }]
70
+ ]), te = A("loader-circle", [["path", {
71
+ d: "M21 12a9 9 0 1 1-6.219-8.56",
72
+ key: "13zald"
73
+ }]]), ne = A("plus", [["path", {
47
74
  d: "M5 12h14",
48
75
  key: "1ays0h"
49
76
  }], ["path", {
50
77
  d: "M12 5v14",
51
78
  key: "s699le"
52
- }]]), N = A("radio", [
79
+ }]]), P = A("radio", [
53
80
  ["path", {
54
81
  d: "M4.9 19.1C1 15.2 1 8.8 4.9 4.9",
55
82
  key: "1vaf9d"
@@ -72,7 +99,7 @@ var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) =
72
99
  d: "M19.1 4.9C23 8.8 23 15.1 19.1 19",
73
100
  key: "10b0cb"
74
101
  }]
75
- ]), te = A("x", [["path", {
102
+ ]), re = A("x", [["path", {
76
103
  d: "M18 6 6 18",
77
104
  key: "1bl5f8"
78
105
  }], ["path", {
@@ -81,7 +108,7 @@ var C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) =
81
108
  }]]);
82
109
  //#endregion
83
110
  //#region src/stream-broker/widgets/GeometryBuilder.tsx
84
- function ne(e) {
111
+ function ie(e) {
85
112
  let t = [];
86
113
  if (e.crop && t.push(`crop=${e.crop.w}:${e.crop.h}:${e.crop.x}:${e.crop.y}`), e.targetAspect && e.width !== void 0 && e.height !== void 0) {
87
114
  let n = e.targetAspect.replace(":", "/");
@@ -89,7 +116,7 @@ function ne(e) {
89
116
  }
90
117
  return e.rotate === 90 ? t.push("transpose=1") : e.rotate === 270 ? t.push("transpose=2") : e.rotate === 180 && t.push("hflip", "vflip"), e.hflip && e.rotate !== 180 && t.push("hflip"), e.vflip && e.rotate !== 180 && t.push("vflip"), t.join(",");
91
118
  }
92
- function re(e, t) {
119
+ function ae(e, t) {
93
120
  let n = [];
94
121
  for (let t = 0; t < e.length; t++) {
95
122
  if (e[t] === "-vf") {
@@ -101,9 +128,9 @@ function re(e, t) {
101
128
  }
102
129
  return t.length > 0 && n.push("-vf", t), n;
103
130
  }
104
- var P = "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium";
105
- function ie({ outputArgs: e, onChange: t }) {
106
- let [n, r] = m(""), [i, a] = m("pad"), [o, s] = m("1920"), [c, l] = m("1080"), [u, d] = m(!1), [f, p] = m("0"), [h, g] = m("0"), [b, x] = m("0"), [S, C] = m("0"), [w, T] = m(0), [E, D] = m(!1), [O, k] = m(!1), A = ne((() => {
131
+ var F = "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium";
132
+ function oe({ outputArgs: e, onChange: t }) {
133
+ let [n, r] = m(""), [i, a] = m("pad"), [o, s] = m("1920"), [c, l] = m("1080"), [u, d] = m(!1), [f, p] = m("0"), [h, g] = m("0"), [b, x] = m("0"), [S, C] = m("0"), [w, T] = m(0), [E, D] = m(!1), [O, k] = m(!1), A = ie((() => {
107
134
  let e = {
108
135
  rotate: w,
109
136
  hflip: E,
@@ -122,14 +149,14 @@ function ie({ outputArgs: e, onChange: t }) {
122
149
  /* @__PURE__ */ v("div", {
123
150
  className: "flex items-center justify-between",
124
151
  children: [/* @__PURE__ */ v("span", {
125
- className: P,
152
+ className: F,
126
153
  children: ["Geometry / zoom", /* @__PURE__ */ _("span", {
127
154
  className: "ml-2 text-[10px] normal-case text-foreground-subtle italic",
128
155
  children: "composes a single -vf into output args"
129
156
  })]
130
157
  }), /* @__PURE__ */ _("button", {
131
158
  type: "button",
132
- onClick: () => t(re(e, A)),
159
+ onClick: () => t(ae(e, A)),
133
160
  className: "rounded-md border border-border bg-surface-hover px-2 py-0.5 text-[10px] font-medium text-foreground hover:bg-surface-hover/70 transition-colors",
134
161
  children: "Apply geometry"
135
162
  })]
@@ -138,7 +165,7 @@ function ie({ outputArgs: e, onChange: t }) {
138
165
  className: "flex flex-wrap items-center gap-2",
139
166
  children: [
140
167
  /* @__PURE__ */ _("label", {
141
- className: P,
168
+ className: F,
142
169
  htmlFor: "geom-aspect",
143
170
  children: "Aspect"
144
171
  }),
@@ -249,7 +276,7 @@ function ie({ outputArgs: e, onChange: t }) {
249
276
  className: "flex flex-wrap items-center gap-2",
250
277
  children: [
251
278
  /* @__PURE__ */ _("label", {
252
- className: P,
279
+ className: F,
253
280
  htmlFor: "geom-rotate",
254
281
  children: "Rotate"
255
282
  }),
@@ -307,7 +334,7 @@ function ie({ outputArgs: e, onChange: t }) {
307
334
  }
308
335
  //#endregion
309
336
  //#region src/stream-broker/widgets/FfmpegParamsField.tsx
310
- var ae = [
337
+ var se = [
311
338
  {
312
339
  group: "Demuxer",
313
340
  label: "-thread_queue_size 1024",
@@ -362,7 +389,7 @@ var ae = [
362
389
  args: ["-fflags", "+genpts+igndts"],
363
390
  description: "Generate PTS + ignore DTS"
364
391
  }
365
- ], oe = [
392
+ ], ce = [
366
393
  {
367
394
  group: "Muxer",
368
395
  label: "-flush_packets 1",
@@ -453,138 +480,152 @@ var ae = [
453
480
  args: ["-muxdelay", "0"],
454
481
  description: "No mux buffering delay"
455
482
  }
456
- ], se = {
483
+ ], le = {
457
484
  video: { codec: "copy" },
458
485
  audio: "passthrough"
459
- }, F = "w-full rounded border border-border bg-surface-2 px-2 py-1.5 text-[11px] font-mono text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 read-only:opacity-60 min-h-[60px] resize-y", I = "flex items-center justify-between gap-3 py-1.5", L = "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium", R = "rounded-lg border border-border bg-surface overflow-hidden", z = "border-b border-border px-3 py-1.5 flex items-center justify-between bg-surface-hover/30", B = "text-[11px] font-semibold text-foreground uppercase tracking-wider";
460
- function ce({ config: e, value: t, onSave: n }) {
461
- let [r, i] = m(!1), a = e.argsOnly === !0, o = t ?? se, [s, c] = m(() => (o.inputArgs ?? []).join("\n")), [l, u] = m(() => (o.outputArgs ?? []).join("\n")), f = d(o);
462
- f.current !== o && (f.current = o, c((o.inputArgs ?? []).join("\n")), u((o.outputArgs ?? []).join("\n")));
463
- let p = (e) => {
464
- n(e(o));
465
- }, h = (e) => p((t) => ({
486
+ }, I = "w-full rounded border border-border bg-surface-2 px-2 py-1.5 text-[11px] font-mono text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 read-only:opacity-60 min-h-[60px] resize-y", L = "flex items-center justify-between gap-3 py-1.5", R = "text-[11px] uppercase tracking-wider text-foreground-subtle font-medium", z = "rounded-lg border border-border bg-surface overflow-hidden", B = "border-b border-border px-3 py-1.5 flex items-center justify-between bg-surface-hover/30", V = "text-[11px] font-semibold text-foreground uppercase tracking-wider";
487
+ function ue({ config: e, value: t, onSave: n, saveStatus: r }) {
488
+ let [i, a] = m(!1), o = e.argsOnly === !0, s = t ?? le, [c, l] = m(() => (s.inputArgs ?? []).join("\n")), [u, f] = m(() => (s.outputArgs ?? []).join("\n")), p = d(s);
489
+ p.current !== s && (p.current = s, l((s.inputArgs ?? []).join("\n")), f((s.outputArgs ?? []).join("\n")));
490
+ let h = (e) => {
491
+ n(e(s));
492
+ }, g = (e) => h((t) => ({
466
493
  ...t,
467
494
  video: {
468
495
  ...t.video,
469
496
  codec: e
470
497
  }
471
- })), g = (e) => p((t) => ({
472
- ...t,
473
- video: {
474
- ...t.video,
475
- width: e
476
- }
477
- })), b = (e) => p((t) => ({
478
- ...t,
479
- video: {
480
- ...t.video,
481
- height: e
482
- }
483
- })), x = (e) => p((t) => ({
484
- ...t,
485
- video: {
486
- ...t.video,
487
- fps: e
488
- }
489
- })), S = (e) => p((t) => ({
490
- ...t,
491
- video: {
492
- ...t.video,
493
- bitrateKbps: e
494
- }
495
- })), C = () => p((e) => ({
498
+ })), b = (e) => {
499
+ !Number.isFinite(e) || e <= 0 || h((t) => ({
500
+ ...t,
501
+ video: {
502
+ ...t.video,
503
+ width: e
504
+ }
505
+ }));
506
+ }, x = (e) => {
507
+ !Number.isFinite(e) || e <= 0 || h((t) => ({
508
+ ...t,
509
+ video: {
510
+ ...t.video,
511
+ height: e
512
+ }
513
+ }));
514
+ }, S = (e) => {
515
+ !Number.isFinite(e) || e <= 0 || h((t) => ({
516
+ ...t,
517
+ video: {
518
+ ...t.video,
519
+ fps: e
520
+ }
521
+ }));
522
+ }, C = (e) => {
523
+ !Number.isFinite(e) || e <= 0 || h((t) => ({
524
+ ...t,
525
+ video: {
526
+ ...t.video,
527
+ bitrateKbps: e
528
+ }
529
+ }));
530
+ }, w = () => h((e) => ({
496
531
  ...e,
497
532
  audio: "passthrough"
498
- })), w = (e) => p((t) => ({
533
+ })), T = (e) => h((t) => ({
499
534
  ...t,
500
535
  audio: typeof t.audio == "object" ? {
501
536
  ...t.audio,
502
537
  codec: e
503
538
  } : { codec: e }
504
- })), T = (e) => p((t) => ({
505
- ...t,
506
- audio: typeof t.audio == "object" ? {
507
- ...t.audio,
508
- bitrateKbps: e
509
- } : {
510
- codec: "opus",
511
- bitrateKbps: e
512
- }
513
- })), E = (e) => p((t) => ({
539
+ })), E = (e) => {
540
+ !Number.isFinite(e) || e <= 0 || h((t) => ({
541
+ ...t,
542
+ audio: typeof t.audio == "object" ? {
543
+ ...t.audio,
544
+ bitrateKbps: e
545
+ } : {
546
+ codec: "opus",
547
+ bitrateKbps: e
548
+ }
549
+ }));
550
+ }, D = (e) => h((t) => ({
514
551
  ...t,
515
552
  inputArgs: e.split("\n").map((e) => e.trim()).filter((e) => e.length > 0)
516
- })), D = (e) => p((t) => ({
553
+ })), O = (e) => h((t) => ({
517
554
  ...t,
518
555
  outputArgs: e.split("\n").map((e) => e.trim()).filter((e) => e.length > 0)
519
- })), O = (e, t) => {
556
+ })), k = (e, t) => {
520
557
  let n = t.args.join(" ");
521
558
  if (e === "input") {
522
- let e = s.length === 0 ? n : `${s}\n${n}`;
523
- c(e), E(e);
559
+ let e = c.length === 0 ? n : `${c}\n${n}`;
560
+ l(e), D(e);
524
561
  } else {
525
- let e = l.length === 0 ? n : `${l}\n${n}`;
526
- u(e), D(e);
562
+ let e = u.length === 0 ? n : `${u}\n${n}`;
563
+ f(e), O(e);
527
564
  }
528
- }, k = /* @__PURE__ */ v("div", {
565
+ }, A = /* @__PURE__ */ v("div", {
529
566
  className: "space-y-1.5",
530
567
  children: [/* @__PURE__ */ v("div", {
531
568
  className: "flex items-center justify-between",
532
569
  children: [/* @__PURE__ */ v("label", {
533
570
  htmlFor: `${e.fieldKey}-input-args`,
534
- className: L,
571
+ className: R,
535
572
  children: ["Input args", /* @__PURE__ */ _("span", {
536
573
  className: "ml-2 text-[10px] normal-case text-foreground-subtle italic",
537
574
  children: "one per line · inserted between globals and -i"
538
575
  })]
539
- }), /* @__PURE__ */ _(V, {
576
+ }), /* @__PURE__ */ _(H, {
540
577
  id: `${e.fieldKey}-input-picker`,
541
578
  disabled: !1,
542
- catalogue: ae,
543
- onPick: (e) => O("input", e)
579
+ catalogue: se,
580
+ onPick: (e) => k("input", e)
544
581
  })]
545
582
  }), /* @__PURE__ */ _("textarea", {
546
583
  id: `${e.fieldKey}-input-args`,
547
- value: s,
548
- onChange: (e) => c(e.target.value),
549
- onBlur: (e) => E(e.target.value),
584
+ value: c,
585
+ onChange: (e) => l(e.target.value),
586
+ onBlur: (e) => D(e.target.value),
550
587
  placeholder: "-thread_queue_size 1024",
551
- className: F
588
+ className: I
552
589
  })]
553
- }), A = /* @__PURE__ */ v("div", {
590
+ }), j = /* @__PURE__ */ v("div", {
554
591
  className: "space-y-1.5",
555
592
  children: [/* @__PURE__ */ v("div", {
556
593
  className: "flex items-center justify-between",
557
594
  children: [/* @__PURE__ */ v("label", {
558
595
  htmlFor: `${e.fieldKey}-output-args`,
559
- className: L,
596
+ className: R,
560
597
  children: ["Output args", /* @__PURE__ */ _("span", {
561
598
  className: "ml-2 text-[10px] normal-case text-foreground-subtle italic",
562
599
  children: "one per line · inserted before the final muxer"
563
600
  })]
564
- }), /* @__PURE__ */ _(V, {
601
+ }), /* @__PURE__ */ _(H, {
565
602
  id: `${e.fieldKey}-output-picker`,
566
603
  disabled: !1,
567
- catalogue: oe,
568
- onPick: (e) => O("output", e)
604
+ catalogue: ce,
605
+ onPick: (e) => k("output", e)
569
606
  })]
570
607
  }), /* @__PURE__ */ _("textarea", {
571
608
  id: `${e.fieldKey}-output-args`,
572
- value: l,
573
- onChange: (e) => u(e.target.value),
574
- onBlur: (e) => D(e.target.value),
609
+ value: u,
610
+ onChange: (e) => f(e.target.value),
611
+ onBlur: (e) => O(e.target.value),
575
612
  placeholder: "-bsf:v h264_mp4toannexb",
576
- className: F
613
+ className: I
577
614
  })]
578
615
  });
579
616
  return /* @__PURE__ */ v("div", {
580
617
  className: "space-y-3",
581
618
  children: [
619
+ r !== void 0 && /* @__PURE__ */ _("div", {
620
+ className: "flex items-center justify-end",
621
+ children: /* @__PURE__ */ _(de, { status: r })
622
+ }),
582
623
  e.sourceParams !== void 0 && /* @__PURE__ */ v("div", {
583
- className: R,
624
+ className: z,
584
625
  children: [/* @__PURE__ */ v("div", {
585
- className: z,
626
+ className: B,
586
627
  children: [/* @__PURE__ */ _("h3", {
587
- className: B,
628
+ className: V,
588
629
  children: "Source (probed)"
589
630
  }), /* @__PURE__ */ _("span", {
590
631
  className: "text-[10px] text-foreground-subtle italic",
@@ -592,33 +633,33 @@ function ce({ config: e, value: t, onSave: n }) {
592
633
  })]
593
634
  }), /* @__PURE__ */ _("div", {
594
635
  className: "px-3 py-2 flex flex-wrap gap-1.5",
595
- children: /* @__PURE__ */ _(le, { profile: e.sourceParams })
636
+ children: /* @__PURE__ */ _(fe, { profile: e.sourceParams })
596
637
  })]
597
638
  }),
598
- !a && /* @__PURE__ */ _("div", {
639
+ !o && /* @__PURE__ */ _("div", {
599
640
  className: "@container",
600
641
  children: /* @__PURE__ */ v("div", {
601
642
  className: "grid grid-cols-1 @[480px]:grid-cols-2 gap-3",
602
643
  children: [/* @__PURE__ */ v("div", {
603
- className: R,
644
+ className: z,
604
645
  children: [/* @__PURE__ */ _("div", {
605
- className: z,
646
+ className: B,
606
647
  children: /* @__PURE__ */ _("h3", {
607
- className: B,
648
+ className: V,
608
649
  children: "Video"
609
650
  })
610
651
  }), /* @__PURE__ */ v("div", {
611
652
  className: "px-3 py-2 divide-y divide-border/30",
612
653
  children: [/* @__PURE__ */ v("div", {
613
- className: I,
654
+ className: L,
614
655
  children: [/* @__PURE__ */ _("label", {
615
656
  htmlFor: `${e.fieldKey}-video-codec`,
616
- className: L,
657
+ className: R,
617
658
  children: "Codec"
618
659
  }), /* @__PURE__ */ v("select", {
619
660
  id: `${e.fieldKey}-video-codec`,
620
- value: o.video.codec,
621
- onChange: (e) => h(e.target.value),
661
+ value: s.video.codec,
662
+ onChange: (e) => g(e.target.value),
622
663
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed appearance-none pr-6 min-w-[120px]",
623
664
  children: [
624
665
  /* @__PURE__ */ _("option", {
@@ -635,84 +676,84 @@ function ce({ config: e, value: t, onSave: n }) {
635
676
  })
636
677
  ]
637
678
  })]
638
- }), o.video.codec !== "copy" && /* @__PURE__ */ v(y, { children: [
679
+ }), s.video.codec !== "copy" && /* @__PURE__ */ v(y, { children: [
639
680
  /* @__PURE__ */ v("div", {
640
- className: I,
681
+ className: L,
641
682
  children: [/* @__PURE__ */ _("label", {
642
683
  htmlFor: `${e.fieldKey}-video-width`,
643
- className: L,
684
+ className: R,
644
685
  children: "Width"
645
686
  }), /* @__PURE__ */ _("input", {
646
687
  id: `${e.fieldKey}-video-width`,
647
688
  type: "number",
648
689
  "aria-label": "Width",
649
- value: o.video.width ?? "",
650
- onChange: (e) => g(Number(e.target.value)),
690
+ value: s.video.width ?? "",
691
+ onChange: (e) => b(Number(e.target.value)),
651
692
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
652
693
  })]
653
694
  }),
654
695
  /* @__PURE__ */ v("div", {
655
- className: I,
696
+ className: L,
656
697
  children: [/* @__PURE__ */ _("label", {
657
698
  htmlFor: `${e.fieldKey}-video-height`,
658
- className: L,
699
+ className: R,
659
700
  children: "Height"
660
701
  }), /* @__PURE__ */ _("input", {
661
702
  id: `${e.fieldKey}-video-height`,
662
703
  type: "number",
663
- value: o.video.height ?? "",
664
- onChange: (e) => b(Number(e.target.value)),
704
+ value: s.video.height ?? "",
705
+ onChange: (e) => x(Number(e.target.value)),
665
706
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
666
707
  })]
667
708
  }),
668
709
  /* @__PURE__ */ v("div", {
669
- className: I,
710
+ className: L,
670
711
  children: [/* @__PURE__ */ _("label", {
671
712
  htmlFor: `${e.fieldKey}-video-fps`,
672
- className: L,
713
+ className: R,
673
714
  children: "FPS"
674
715
  }), /* @__PURE__ */ _("input", {
675
716
  id: `${e.fieldKey}-video-fps`,
676
717
  type: "number",
677
- value: o.video.fps ?? "",
678
- onChange: (e) => x(Number(e.target.value)),
718
+ value: s.video.fps ?? "",
719
+ onChange: (e) => S(Number(e.target.value)),
679
720
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
680
721
  })]
681
722
  }),
682
723
  /* @__PURE__ */ v("div", {
683
- className: I,
724
+ className: L,
684
725
  children: [/* @__PURE__ */ _("label", {
685
726
  htmlFor: `${e.fieldKey}-video-bitrate`,
686
- className: L,
727
+ className: R,
687
728
  children: "Bitrate (kbps)"
688
729
  }), /* @__PURE__ */ _("input", {
689
730
  id: `${e.fieldKey}-video-bitrate`,
690
731
  type: "number",
691
- value: o.video.bitrateKbps ?? "",
692
- onChange: (e) => S(Number(e.target.value)),
732
+ value: s.video.bitrateKbps ?? "",
733
+ onChange: (e) => C(Number(e.target.value)),
693
734
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
694
735
  })]
695
736
  })
696
737
  ] })]
697
738
  })]
698
739
  }), /* @__PURE__ */ v("div", {
699
- className: R,
740
+ className: z,
700
741
  children: [/* @__PURE__ */ _("div", {
701
- className: z,
742
+ className: B,
702
743
  children: /* @__PURE__ */ _("h3", {
703
- className: B,
744
+ className: V,
704
745
  children: "Audio"
705
746
  })
706
747
  }), /* @__PURE__ */ _("div", {
707
748
  className: "px-3 py-2",
708
- children: o.audio === "passthrough" ? /* @__PURE__ */ v("div", {
749
+ children: s.audio === "passthrough" ? /* @__PURE__ */ v("div", {
709
750
  className: "flex items-center justify-between gap-3",
710
751
  children: [/* @__PURE__ */ _("span", {
711
752
  className: "text-[11px] text-foreground-subtle italic",
712
753
  children: "Source audio forwarded without re-encode."
713
754
  }), /* @__PURE__ */ _("button", {
714
755
  type: "button",
715
- onClick: () => w("opus"),
756
+ onClick: () => T("opus"),
716
757
  className: "rounded-md border border-border bg-surface-hover px-2 py-1 text-[11px] text-foreground hover:bg-surface-hover/70 transition-colors",
717
758
  children: "Switch to custom encode"
718
759
  })]
@@ -720,15 +761,15 @@ function ce({ config: e, value: t, onSave: n }) {
720
761
  className: "divide-y divide-border/30",
721
762
  children: [
722
763
  /* @__PURE__ */ v("div", {
723
- className: I,
764
+ className: L,
724
765
  children: [/* @__PURE__ */ _("label", {
725
766
  htmlFor: `${e.fieldKey}-audio-codec`,
726
- className: L,
767
+ className: R,
727
768
  children: "Codec"
728
769
  }), /* @__PURE__ */ v("select", {
729
770
  id: `${e.fieldKey}-audio-codec`,
730
- value: o.audio.codec,
731
- onChange: (e) => w(e.target.value),
771
+ value: s.audio.codec,
772
+ onChange: (e) => T(e.target.value),
732
773
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed appearance-none pr-6 min-w-[120px]",
733
774
  children: [
734
775
  /* @__PURE__ */ _("option", {
@@ -755,16 +796,16 @@ function ce({ config: e, value: t, onSave: n }) {
755
796
  })]
756
797
  }),
757
798
  /* @__PURE__ */ v("div", {
758
- className: I,
799
+ className: L,
759
800
  children: [/* @__PURE__ */ _("label", {
760
801
  htmlFor: `${e.fieldKey}-audio-bitrate`,
761
- className: L,
802
+ className: R,
762
803
  children: "Bitrate (kbps)"
763
804
  }), /* @__PURE__ */ _("input", {
764
805
  id: `${e.fieldKey}-audio-bitrate`,
765
806
  type: "number",
766
- value: o.audio.bitrateKbps ?? "",
767
- onChange: (e) => T(Number(e.target.value)),
807
+ value: s.audio.bitrateKbps ?? "",
808
+ onChange: (e) => E(Number(e.target.value)),
768
809
  className: "rounded border border-border bg-surface-2 px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 disabled:cursor-not-allowed read-only:opacity-60 read-only:cursor-not-allowed w-24 text-right"
769
810
  })]
770
811
  }),
@@ -772,7 +813,7 @@ function ce({ config: e, value: t, onSave: n }) {
772
813
  className: "pt-2",
773
814
  children: /* @__PURE__ */ _("button", {
774
815
  type: "button",
775
- onClick: C,
816
+ onClick: w,
776
817
  className: "text-[11px] text-foreground-subtle hover:text-foreground underline-offset-2 hover:underline",
777
818
  children: "Switch back to passthrough"
778
819
  })
@@ -783,61 +824,77 @@ function ce({ config: e, value: t, onSave: n }) {
783
824
  })]
784
825
  })
785
826
  }),
786
- a ? /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ v("div", {
787
- className: R,
827
+ o ? /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ v("div", {
828
+ className: z,
788
829
  children: [/* @__PURE__ */ _("div", {
789
- className: z,
830
+ className: B,
790
831
  children: /* @__PURE__ */ _("h3", {
791
- className: B,
832
+ className: V,
792
833
  children: "Input args"
793
834
  })
794
835
  }), /* @__PURE__ */ _("div", {
795
836
  className: "px-3 py-2",
796
- children: k
837
+ children: A
797
838
  })]
798
839
  }), /* @__PURE__ */ v("div", {
799
- className: R,
840
+ className: z,
800
841
  children: [/* @__PURE__ */ _("div", {
801
- className: z,
842
+ className: B,
802
843
  children: /* @__PURE__ */ _("h3", {
803
- className: B,
844
+ className: V,
804
845
  children: "Output args"
805
846
  })
806
847
  }), /* @__PURE__ */ _("div", {
807
848
  className: "px-3 py-2",
808
- children: A
849
+ children: j
809
850
  })]
810
851
  })] }) : /* @__PURE__ */ v("div", {
811
- className: R,
852
+ className: z,
812
853
  children: [/* @__PURE__ */ v("button", {
813
854
  type: "button",
814
- onClick: () => i((e) => !e),
855
+ onClick: () => a((e) => !e),
815
856
  className: "w-full px-3 py-1.5 flex items-center justify-between bg-surface-hover/30 hover:bg-surface-hover transition-colors",
816
857
  children: [/* @__PURE__ */ v("span", {
817
858
  className: "inline-flex items-center gap-1.5 text-[11px] font-semibold text-foreground uppercase tracking-wider",
818
- children: [_(r ? j : M, { className: "h-3 w-3" }), "Advanced — raw ffmpeg args"]
859
+ children: [_(i ? M : N, { className: "h-3 w-3" }), "Advanced — raw ffmpeg args"]
819
860
  }), /* @__PURE__ */ v("span", {
820
861
  className: "text-[10px] text-foreground-subtle italic",
821
- children: [(o.inputArgs?.length ?? 0) + (o.outputArgs?.length ?? 0), " args"]
862
+ children: [(s.inputArgs?.length ?? 0) + (s.outputArgs?.length ?? 0), " args"]
822
863
  })]
823
- }), r && /* @__PURE__ */ v("div", {
864
+ }), i && /* @__PURE__ */ v("div", {
824
865
  className: "px-3 py-2 space-y-3 border-t border-border/50",
825
866
  children: [
826
- k,
827
- /* @__PURE__ */ _(ie, {
828
- outputArgs: o.outputArgs ?? [],
867
+ A,
868
+ /* @__PURE__ */ _(oe, {
869
+ outputArgs: s.outputArgs ?? [],
829
870
  onChange: (e) => {
830
- u(e.join("\n")), D(e.join("\n"));
871
+ f(e.join("\n")), O(e.join("\n"));
831
872
  }
832
873
  }),
833
- A
874
+ j
834
875
  ]
835
876
  })]
836
877
  })
837
878
  ]
838
879
  });
839
880
  }
840
- function le({ profile: e }) {
881
+ function de({ status: e }) {
882
+ let t = "inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium border";
883
+ return e === "saving" ? /* @__PURE__ */ v("span", {
884
+ className: `${t} bg-accent/10 text-accent border-accent/30`,
885
+ children: [/* @__PURE__ */ _(te, { className: "h-2.5 w-2.5 animate-spin" }), "Saving…"]
886
+ }) : e === "saved" ? /* @__PURE__ */ v("span", {
887
+ className: `${t} bg-success/10 text-success border-success/30`,
888
+ children: [/* @__PURE__ */ _(j, { className: "h-2.5 w-2.5" }), "Saved"]
889
+ }) : e === "error" ? /* @__PURE__ */ v("span", {
890
+ className: `${t} bg-red-500/10 text-red-400 border-red-500/30`,
891
+ children: [/* @__PURE__ */ _(ee, { className: "h-2.5 w-2.5" }), "Save failed"]
892
+ }) : /* @__PURE__ */ _("span", {
893
+ className: `${t} bg-foreground-subtle/10 text-foreground-subtle border-border`,
894
+ children: "Autosaves"
895
+ });
896
+ }
897
+ function fe({ profile: e }) {
841
898
  let t = "inline-flex items-center gap-1 rounded-full bg-foreground-subtle/10 border border-border px-2 py-0.5 text-[11px] font-mono text-foreground-subtle", { video: n, audio: r } = e, i = n.width !== void 0 && n.height !== void 0 ? `${n.width}×${n.height}` : void 0;
842
899
  return /* @__PURE__ */ v(y, { children: [
843
900
  /* @__PURE__ */ v("span", {
@@ -918,8 +975,8 @@ function le({ profile: e }) {
918
975
  ] })
919
976
  ] });
920
977
  }
921
- function ue(e) {
922
- let t = e.config ?? {}, n = o(), [r, i] = m(() => t.initialValue), a = h((r) => {
978
+ function pe(e) {
979
+ let t = e.config ?? {}, n = c(), [r, i] = m(() => t.initialValue), a = h((r) => {
923
980
  if (i(r), e.deviceId === void 0) return;
924
981
  let a = t.writerCapName, o = t.writerAddonId, s = t.fieldKey;
925
982
  if (a === void 0 || o === void 0 || s === void 0) {
@@ -944,20 +1001,23 @@ function ue(e) {
944
1001
  className: "rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",
945
1002
  children: "ffmpeg-params: no deviceId in widget context — this widget only renders inside a device tab."
946
1003
  });
947
- let s = t.fieldKey;
948
- return s === void 0 || s.length === 0 ? /* @__PURE__ */ _("div", {
1004
+ let o = t.fieldKey;
1005
+ if (o === void 0 || o.length === 0) return /* @__PURE__ */ _("div", {
949
1006
  className: "rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",
950
1007
  children: "ffmpeg-params: widgetConfig.fieldKey is required — fix the contribution builder."
951
- }) : /* @__PURE__ */ _(ce, {
1008
+ });
1009
+ let s = n.isPending ? "saving" : n.isError ? "error" : n.isSuccess ? "saved" : "idle";
1010
+ return /* @__PURE__ */ _(ue, {
952
1011
  config: {
953
1012
  ...t,
954
- fieldKey: s
1013
+ fieldKey: o
955
1014
  },
956
1015
  value: r,
957
- onSave: a
1016
+ onSave: a,
1017
+ saveStatus: s
958
1018
  });
959
1019
  }
960
- function V({ id: e, disabled: t, catalogue: n, onPick: r }) {
1020
+ function H({ id: e, disabled: t, catalogue: n, onPick: r }) {
961
1021
  let [i, a] = m(!1), o = f(() => {
962
1022
  let e = /* @__PURE__ */ new Map();
963
1023
  for (let t of n) {
@@ -974,7 +1034,7 @@ function V({ id: e, disabled: t, catalogue: n, onPick: r }) {
974
1034
  disabled: t,
975
1035
  onClick: () => a((e) => !e),
976
1036
  className: "inline-flex items-center gap-1 rounded-md border border-border bg-surface-hover px-2 py-0.5 text-[10px] font-medium text-foreground-subtle hover:bg-surface-hover/70 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",
977
- children: [/* @__PURE__ */ _(ee, { className: "h-3 w-3" }), "Add flag…"]
1037
+ children: [/* @__PURE__ */ _(ne, { className: "h-3 w-3" }), "Add flag…"]
978
1038
  }), i && !t && /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ _("div", {
979
1039
  className: "fixed inset-0 z-40",
980
1040
  onClick: () => a(!1),
@@ -1007,36 +1067,36 @@ function V({ id: e, disabled: t, catalogue: n, onPick: r }) {
1007
1067
  }
1008
1068
  //#endregion
1009
1069
  //#region src/stream-broker/widgets/format-ua.ts
1010
- var H = 24;
1011
- function de(e) {
1070
+ var U = 24;
1071
+ function me(e) {
1012
1072
  return /\bEdg\b|\bEdgA\b|\bEdgiOS\b|Edge\//.test(e) ? "Edge" : /\bOPR\b|Opera/.test(e) ? "Opera" : /Firefox\/|\bFxiOS\b/.test(e) ? "Firefox" : /Chrome\/|\bCriOS\b/.test(e) ? "Chrome" : /Safari\//.test(e) ? "Safari" : null;
1013
1073
  }
1014
- function fe(e) {
1074
+ function he(e) {
1015
1075
  return /iPhone|iPad|iPod|\biOS\b|CriOS|FxiOS/.test(e) ? "iOS" : /Mac OS X|Macintosh/.test(e) ? "macOS" : /Windows/.test(e) ? "Windows" : /Android/.test(e) ? "Android" : /Linux/.test(e) ? "Linux" : null;
1016
1076
  }
1017
- function U(e) {
1077
+ function W(e) {
1018
1078
  let t = e.trim();
1019
1079
  if (t.length === 0) return "";
1020
- let n = de(t), r = fe(t);
1021
- return n && r ? `${n}/${r}` : n || r || (t.length > H ? `${t.slice(0, H)}…` : t);
1080
+ let n = me(t), r = he(t);
1081
+ return n && r ? `${n}/${r}` : n || r || (t.length > U ? `${t.slice(0, U)}…` : t);
1022
1082
  }
1023
1083
  //#endregion
1024
1084
  //#region src/stream-broker/widgets/StreamBrokerPanel.tsx
1025
- function pe(e) {
1085
+ function ge(e) {
1026
1086
  let t = Math.floor(e / 1e3);
1027
1087
  if (t < 60) return `${t}s`;
1028
1088
  let n = Math.floor(t / 60);
1029
1089
  return n < 60 ? `${n}m` : `${Math.floor(n / 60)}h ${n % 60}m`;
1030
1090
  }
1031
- var W = {
1091
+ var G = {
1032
1092
  high: "High",
1033
1093
  mid: "Mid",
1034
1094
  low: "Low"
1035
- }, G = [
1095
+ }, K = [
1036
1096
  "high",
1037
1097
  "mid",
1038
1098
  "low"
1039
- ], me = {
1099
+ ], _e = {
1040
1100
  alexa: "bg-blue-500/15 text-blue-400",
1041
1101
  homekit: "bg-purple-500/15 text-purple-400",
1042
1102
  "webrtc-browser": "bg-emerald-500/15 text-emerald-400",
@@ -1049,7 +1109,7 @@ var W = {
1049
1109
  snapshot: "bg-cyan-500/15 text-cyan-400",
1050
1110
  warmup: "bg-foreground-subtle/10 text-foreground-subtle",
1051
1111
  unknown: "bg-foreground-subtle/10 text-foreground-subtle"
1052
- }, K = {
1112
+ }, q = {
1053
1113
  alexa: "ALEXA",
1054
1114
  homekit: "HOMEKIT",
1055
1115
  "webrtc-browser": "BROWSER",
@@ -1063,35 +1123,35 @@ var W = {
1063
1123
  warmup: "WARMUP",
1064
1124
  unknown: "—"
1065
1125
  };
1066
- function he(e) {
1067
- return K[e] ?? e.toUpperCase().slice(0, 8);
1126
+ function ve(e) {
1127
+ return q[e] ?? e.toUpperCase().slice(0, 8);
1068
1128
  }
1069
- function ge(e) {
1070
- return K[e] ?? e;
1129
+ function ye(e) {
1130
+ return q[e] ?? e;
1071
1131
  }
1072
- function _e(e) {
1132
+ function be(e) {
1073
1133
  let t = e.config ?? {};
1074
1134
  return e.deviceId === void 0 ? /* @__PURE__ */ _("div", {
1075
1135
  className: "rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",
1076
1136
  children: "StreamBrokerPanel requires a deviceId"
1077
- }) : /* @__PURE__ */ _(ve, {
1137
+ }) : /* @__PURE__ */ _(xe, {
1078
1138
  deviceId: e.deviceId,
1079
1139
  title: t.title,
1080
1140
  variant: t.variant,
1081
1141
  hideEmpty: t.hideEmpty
1082
1142
  });
1083
1143
  }
1084
- function ve({ deviceId: n, title: r = "Stream Brokers", variant: i = "full", hideEmpty: a = !1 }) {
1085
- t(["streamBroker", "listAllProfileSlots"], [
1144
+ function xe({ deviceId: e, title: a = "Stream Brokers", variant: s = "full", hideEmpty: c = !1 }) {
1145
+ i(["streamBroker", "listAllProfileSlots"], [
1086
1146
  "device.streams-registered",
1087
1147
  "device.streams-unregistered",
1088
1148
  "device.registered",
1089
1149
  "device.unregistered"
1090
1150
  ]);
1091
- let { data: o } = s(void 0, { staleTime: 3e4 }), l = (o ?? []).filter((e) => e.deviceId === n && e.sourceCamStreamId !== null).slice().toSorted((e, t) => G.indexOf(e.profile) - G.indexOf(t.profile)), d = c(e().trpcClient, n), { data: f } = x({
1151
+ let { data: l } = r(void 0, { staleTime: 3e4 }), u = (l ?? []).filter((t) => t.deviceId === e && t.sourceCamStreamId !== null).slice().toSorted((e, t) => K.indexOf(e.profile) - K.indexOf(t.profile)), d = t(o().trpcClient, e), { data: f } = x({
1092
1152
  queryKey: [
1093
1153
  "device",
1094
- n,
1154
+ e,
1095
1155
  "cameraStreams.getCameraStreams"
1096
1156
  ],
1097
1157
  queryFn: () => d?.cameraStreams?.getCameraStreams({}) ?? [],
@@ -1099,10 +1159,10 @@ function ve({ deviceId: n, title: r = "Stream Brokers", variant: i = "full", hid
1099
1159
  staleTime: 3e4
1100
1160
  }), p = /* @__PURE__ */ new Map();
1101
1161
  for (let e of f ?? []) p.set(e.camStreamId, e);
1102
- let { data: m } = u({ deviceId: n }, { staleTime: 3e4 }), h = m?.assignment.sourceNodeId ?? null, g = new Set(l.map((e) => e.sourceCamStreamId).filter((e) => e !== null)), y = (f ?? []).filter((e) => !g.has(e.camStreamId)), b = l.length > 0, S = y.length > 0;
1103
- return a && !b && !S ? null : i === "compact" ? b ? /* @__PURE__ */ _("div", {
1162
+ let { data: m } = n({ deviceId: e }, { staleTime: 3e4 }), h = m?.assignment.sourceNodeId ?? null, g = new Set(u.map((e) => e.sourceCamStreamId).filter((e) => e !== null)), y = (f ?? []).filter((e) => !g.has(e.camStreamId)), b = u.length > 0, S = y.length > 0;
1163
+ return c && !b && !S ? null : s === "compact" ? b ? /* @__PURE__ */ _("div", {
1104
1164
  className: "divide-y divide-border/30",
1105
- children: l.map((e) => /* @__PURE__ */ _(J, {
1165
+ children: u.map((e) => /* @__PURE__ */ _(Y, {
1106
1166
  slot: e,
1107
1167
  camStreams: p,
1108
1168
  compact: !0
@@ -1117,45 +1177,45 @@ function ve({ deviceId: n, title: r = "Stream Brokers", variant: i = "full", hid
1117
1177
  className: "border-b border-border px-4 py-2 flex flex-wrap items-center justify-between gap-x-2 gap-y-1",
1118
1178
  children: [/* @__PURE__ */ _("h2", {
1119
1179
  className: "text-xs font-semibold text-foreground uppercase tracking-wider shrink-0",
1120
- children: r
1180
+ children: a
1121
1181
  }), /* @__PURE__ */ v("div", {
1122
1182
  className: "flex items-center gap-1.5 min-w-0",
1123
1183
  children: [h !== null && /* @__PURE__ */ v("span", {
1124
1184
  title: `Cluster node dialing this camera's source: ${h}`,
1125
1185
  className: "inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium bg-accent/10 text-accent border border-accent/30 min-w-0 max-w-full",
1126
- children: [/* @__PURE__ */ _(N, { className: "h-2.5 w-2.5 shrink-0" }), /* @__PURE__ */ _("span", {
1186
+ children: [/* @__PURE__ */ _(P, { className: "h-2.5 w-2.5 shrink-0" }), /* @__PURE__ */ _("span", {
1127
1187
  className: "truncate",
1128
1188
  children: h
1129
1189
  })]
1130
1190
  }), b && /* @__PURE__ */ v("span", {
1131
1191
  className: "inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium bg-foreground-subtle/10 text-foreground-subtle border border-border shrink-0 whitespace-nowrap",
1132
- children: [l.length, " assigned"]
1192
+ children: [u.length, " assigned"]
1133
1193
  })]
1134
1194
  })]
1135
1195
  }),
1136
1196
  b ? /* @__PURE__ */ _("div", {
1137
1197
  className: "divide-y divide-border/30",
1138
- children: l.map((e) => /* @__PURE__ */ _(J, {
1198
+ children: u.map((e) => /* @__PURE__ */ _(Y, {
1139
1199
  slot: e,
1140
1200
  camStreams: p,
1141
1201
  compact: !1
1142
1202
  }, e.brokerId))
1143
1203
  }) : /* @__PURE__ */ v("div", {
1144
1204
  className: "px-4 py-6 flex flex-col items-center text-center text-foreground-subtle",
1145
- children: [/* @__PURE__ */ _(N, { className: "h-5 w-5 mb-2 opacity-30" }), /* @__PURE__ */ _("p", {
1205
+ children: [/* @__PURE__ */ _(P, { className: "h-5 w-5 mb-2 opacity-30" }), /* @__PURE__ */ _("p", {
1146
1206
  className: "text-xs",
1147
1207
  children: "No profile slots assigned for this device"
1148
1208
  })]
1149
1209
  }),
1150
- S && /* @__PURE__ */ _(ye, {
1151
- deviceId: n,
1210
+ S && /* @__PURE__ */ _(Se, {
1211
+ deviceId: e,
1152
1212
  camStreamIds: y.map((e) => e.camStreamId),
1153
1213
  camStreams: p
1154
1214
  })
1155
1215
  ]
1156
1216
  });
1157
1217
  }
1158
- function ye({ deviceId: e, camStreamIds: t, camStreams: n }) {
1218
+ function Se({ deviceId: e, camStreamIds: t, camStreams: n }) {
1159
1219
  let [r, i] = m(!1);
1160
1220
  return /* @__PURE__ */ v("div", {
1161
1221
  className: "border-t border-border/50",
@@ -1165,14 +1225,14 @@ function ye({ deviceId: e, camStreamIds: t, camStreams: n }) {
1165
1225
  className: "w-full px-4 py-1.5 flex items-center justify-between bg-surface-hover/30 hover:bg-surface-hover transition-colors",
1166
1226
  children: [/* @__PURE__ */ v("span", {
1167
1227
  className: "inline-flex items-center gap-1.5 text-[11px] uppercase tracking-wider text-foreground-subtle",
1168
- children: [_(r ? j : M, { className: "h-3 w-3" }), "Other active streams"]
1228
+ children: [_(r ? M : N, { className: "h-3 w-3" }), "Other active streams"]
1169
1229
  }), /* @__PURE__ */ _("span", {
1170
1230
  className: "rounded-full px-2 py-0.5 text-[10px] font-medium bg-foreground-subtle/10 text-foreground-subtle border border-border",
1171
1231
  children: t.length
1172
1232
  })]
1173
1233
  }), r && /* @__PURE__ */ _("div", {
1174
1234
  className: "divide-y divide-border/30",
1175
- children: t.map((t) => /* @__PURE__ */ _(be, {
1235
+ children: t.map((t) => /* @__PURE__ */ _(Ce, {
1176
1236
  deviceId: e,
1177
1237
  camStreamId: t,
1178
1238
  camStreams: n
@@ -1180,8 +1240,8 @@ function ye({ deviceId: e, camStreamIds: t, camStreams: n }) {
1180
1240
  })]
1181
1241
  });
1182
1242
  }
1183
- function be({ deviceId: e, camStreamId: t, camStreams: n }) {
1184
- let r = S(e, t), a = i("stream-broker.metrics-snapshot", (e) => e.brokerId === r)?.stats, o = n.get(t), s = a?.status === "streaming";
1243
+ function Ce({ deviceId: e, camStreamId: t, camStreams: n }) {
1244
+ let r = S(e, t), i = u("stream-broker.metrics-snapshot", (e) => e.brokerId === r)?.stats, a = n.get(t), o = i?.status === "streaming";
1185
1245
  return /* @__PURE__ */ v("div", {
1186
1246
  className: "px-4 py-2",
1187
1247
  children: [/* @__PURE__ */ _("div", {
@@ -1189,26 +1249,26 @@ function be({ deviceId: e, camStreamId: t, camStreams: n }) {
1189
1249
  children: /* @__PURE__ */ v("div", {
1190
1250
  className: "flex items-center gap-1.5",
1191
1251
  children: [
1192
- /* @__PURE__ */ _("span", { className: `h-1.5 w-1.5 rounded-full ${s ? "bg-success" : "bg-foreground-subtle/40"}` }),
1252
+ /* @__PURE__ */ _("span", { className: `h-1.5 w-1.5 rounded-full ${o ? "bg-success" : "bg-foreground-subtle/40"}` }),
1193
1253
  /* @__PURE__ */ _("span", {
1194
1254
  className: "text-[11px] font-medium text-foreground",
1195
- children: o?.label ?? t
1255
+ children: a?.label ?? t
1196
1256
  }),
1197
- o?.resolution && /* @__PURE__ */ v("span", {
1257
+ a?.resolution && /* @__PURE__ */ v("span", {
1198
1258
  className: "text-[10px] text-foreground-subtle",
1199
1259
  children: [
1200
- o.resolution.width,
1260
+ a.resolution.width,
1201
1261
  "×",
1202
- o.resolution.height
1262
+ a.resolution.height
1203
1263
  ]
1204
1264
  }),
1205
1265
  /* @__PURE__ */ _("span", {
1206
- className: `text-[10px] ${s ? "text-success" : "text-foreground-subtle"}`,
1207
- children: a?.status ?? "idle"
1266
+ className: `text-[10px] ${o ? "text-success" : "text-foreground-subtle"}`,
1267
+ children: i?.status ?? "idle"
1208
1268
  })
1209
1269
  ]
1210
1270
  })
1211
- }), a && s && /* @__PURE__ */ v("div", {
1271
+ }), i && o && /* @__PURE__ */ v("div", {
1212
1272
  className: "flex flex-wrap gap-x-3 gap-y-1 text-[10px]",
1213
1273
  children: [
1214
1274
  /* @__PURE__ */ v("span", {
@@ -1218,7 +1278,7 @@ function be({ deviceId: e, camStreamId: t, camStreams: n }) {
1218
1278
  children: "FPS:"
1219
1279
  }), /* @__PURE__ */ _("span", {
1220
1280
  className: "text-foreground",
1221
- children: a.inputFps.toFixed(1)
1281
+ children: i.inputFps.toFixed(1)
1222
1282
  })]
1223
1283
  }),
1224
1284
  /* @__PURE__ */ v("span", {
@@ -1228,7 +1288,7 @@ function be({ deviceId: e, camStreamId: t, camStreams: n }) {
1228
1288
  children: "Bitrate:"
1229
1289
  }), /* @__PURE__ */ _("span", {
1230
1290
  className: "text-foreground",
1231
- children: a.bitrateKbps >= 1e3 ? `${(a.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${a.bitrateKbps} kbps`
1291
+ children: i.bitrateKbps >= 1e3 ? `${(i.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${i.bitrateKbps} kbps`
1232
1292
  })]
1233
1293
  }),
1234
1294
  /* @__PURE__ */ v("span", {
@@ -1238,7 +1298,7 @@ function be({ deviceId: e, camStreamId: t, camStreams: n }) {
1238
1298
  children: "Codec:"
1239
1299
  }), /* @__PURE__ */ _("span", {
1240
1300
  className: "text-foreground",
1241
- children: a.codec?.toUpperCase() ?? "—"
1301
+ children: i.codec?.toUpperCase() ?? "—"
1242
1302
  })]
1243
1303
  }),
1244
1304
  /* @__PURE__ */ v("span", {
@@ -1248,14 +1308,14 @@ function be({ deviceId: e, camStreamId: t, camStreams: n }) {
1248
1308
  children: "Pkts:"
1249
1309
  }), /* @__PURE__ */ _("span", {
1250
1310
  className: "text-foreground",
1251
- children: a.packetCount > 1e3 ? `${(a.packetCount / 1e3).toFixed(1)}k` : a.packetCount
1311
+ children: i.packetCount > 1e3 ? `${(i.packetCount / 1e3).toFixed(1)}k` : i.packetCount
1252
1312
  })]
1253
1313
  })
1254
1314
  ]
1255
1315
  })]
1256
1316
  });
1257
1317
  }
1258
- function q(e, t) {
1318
+ function J(e, t) {
1259
1319
  let n = (e) => {
1260
1320
  if (!e || typeof e != "object") return;
1261
1321
  let r = e;
@@ -1276,29 +1336,29 @@ function q(e, t) {
1276
1336
  if (t !== void 0) return t;
1277
1337
  }
1278
1338
  }
1279
- function J({ slot: e, camStreams: o, compact: s }) {
1280
- let c = b(), u = i("stream-broker.metrics-snapshot", (t) => t.brokerId === e.brokerId)?.stats;
1281
- t(["streamBroker", "listClients"], ["stream-broker.metrics-snapshot"]);
1282
- let { data: d } = r({ brokerId: e.brokerId }, {
1283
- enabled: u?.status === "streaming",
1339
+ function Y({ slot: t, camStreams: n, compact: r }) {
1340
+ let o = b(), c = u("stream-broker.metrics-snapshot", (e) => e.brokerId === t.brokerId)?.stats;
1341
+ i(["streamBroker", "listClients"], ["stream-broker.metrics-snapshot"]);
1342
+ let { data: d } = e({ brokerId: t.brokerId }, {
1343
+ enabled: c?.status === "streaming",
1284
1344
  staleTime: 2e3
1285
- }), { data: f } = l({ deviceId: e.deviceId }, { staleTime: 15e3 }), p = e.sourceCamStreamId ?? e.profile, m = !!(q(f, `preBufferEnabled:${p}`) ?? !0), g = q(f, `preBufferSec:${p}`), x = n({ onSuccess: () => {
1286
- c.invalidateQueries({ queryKey: [["streamBroker", "getDeviceSettingsContribution"]] });
1287
- } }), S = (t) => {
1345
+ }), { data: f } = a({ deviceId: t.deviceId }, { staleTime: 15e3 }), p = t.sourceCamStreamId ?? t.profile, m = !!(J(f, `preBufferEnabled:${p}`) ?? !0), g = J(f, `preBufferSec:${p}`), x = l({ onSuccess: () => {
1346
+ o.invalidateQueries({ queryKey: [["streamBroker", "getDeviceSettingsContribution"]] });
1347
+ } }), S = (e) => {
1288
1348
  x.mutate({
1289
- deviceId: e.deviceId,
1290
- patch: { [`preBufferEnabled:${p}`]: t }
1349
+ deviceId: t.deviceId,
1350
+ patch: { [`preBufferEnabled:${p}`]: e }
1291
1351
  });
1292
- }, C = a({ onSuccess: () => {
1293
- c.invalidateQueries({ queryKey: [["streamBroker", "listClients"]] });
1294
- } }), w = h((t) => {
1352
+ }, C = s({ onSuccess: () => {
1353
+ o.invalidateQueries({ queryKey: [["streamBroker", "listClients"]] });
1354
+ } }), w = h((e) => {
1295
1355
  C.mutate({
1296
- brokerId: e.brokerId,
1297
- ...t
1356
+ brokerId: t.brokerId,
1357
+ ...e
1298
1358
  });
1299
- }, [C, e.brokerId]), T = (e.sourceCamStreamId ? o.get(e.sourceCamStreamId) : void 0)?.resolution ?? e.resolution, E = u?.status === "streaming", D = T ? `${W[e.profile]} (${T.width}×${T.height})` : W[e.profile], O = u ? u.encodedSubscribers + u.decodedSubscribers + (u.rtspClients ?? 0) + (u.pipeClients ?? 0) : 0;
1359
+ }, [C, t.brokerId]), T = (t.sourceCamStreamId ? n.get(t.sourceCamStreamId) : void 0)?.resolution ?? t.resolution, E = c?.status === "streaming", D = T ? `${G[t.profile]} (${T.width}×${T.height})` : G[t.profile], O = c ? c.encodedSubscribers + c.decodedSubscribers + (c.rtspClients ?? 0) + (c.pipeClients ?? 0) : 0;
1300
1360
  return /* @__PURE__ */ v("div", {
1301
- className: `@container ${s ? "px-3 py-1.5" : "px-4 py-2"}`,
1361
+ className: `@container ${r ? "px-3 py-1.5" : "px-4 py-2"}`,
1302
1362
  style: { containerType: "inline-size" },
1303
1363
  children: [
1304
1364
  /* @__PURE__ */ v("div", {
@@ -1306,27 +1366,27 @@ function J({ slot: e, camStreams: o, compact: s }) {
1306
1366
  children: [/* @__PURE__ */ v("div", {
1307
1367
  className: "flex items-center gap-1.5 min-w-0",
1308
1368
  children: [
1309
- /* @__PURE__ */ _("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${E ? e.profile === "high" ? "bg-success" : e.profile === "mid" ? "bg-warning" : "bg-foreground-subtle" : "bg-foreground-subtle/40"}` }),
1369
+ /* @__PURE__ */ _("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${E ? t.profile === "high" ? "bg-success" : t.profile === "mid" ? "bg-warning" : "bg-foreground-subtle" : "bg-foreground-subtle/40"}` }),
1310
1370
  /* @__PURE__ */ _("span", {
1311
1371
  className: "text-[11px] font-medium text-foreground whitespace-nowrap shrink-0",
1312
1372
  children: D
1313
1373
  }),
1314
1374
  /* @__PURE__ */ _("span", {
1315
1375
  className: `text-[10px] shrink-0 ${E ? "text-success" : "text-foreground-subtle"}`,
1316
- children: u?.status ?? "loading"
1376
+ children: c?.status ?? "loading"
1317
1377
  }),
1318
- e.sourceCamStreamId && /* @__PURE__ */ v("span", {
1378
+ t.sourceCamStreamId && /* @__PURE__ */ v("span", {
1319
1379
  className: "text-[10px] text-foreground-subtle truncate min-w-0",
1320
- title: e.sourceCamStreamId,
1321
- children: ["← ", e.sourceCamStreamId]
1380
+ title: t.sourceCamStreamId,
1381
+ children: ["← ", t.sourceCamStreamId]
1322
1382
  })
1323
1383
  ]
1324
1384
  }), /* @__PURE__ */ _("span", {
1325
1385
  className: "text-[10px] text-foreground-subtle shrink-0 whitespace-nowrap",
1326
- children: u && u.uptimeMs > 0 ? pe(u.uptimeMs) : "—"
1386
+ children: c && c.uptimeMs > 0 ? ge(c.uptimeMs) : "—"
1327
1387
  })]
1328
1388
  }),
1329
- u && E ? s ? /* @__PURE__ */ v("div", {
1389
+ c && E ? r ? /* @__PURE__ */ v("div", {
1330
1390
  className: "flex flex-wrap gap-x-3 gap-y-0.5 text-[10px]",
1331
1391
  children: [
1332
1392
  /* @__PURE__ */ v("span", {
@@ -1337,9 +1397,9 @@ function J({ slot: e, camStreams: o, compact: s }) {
1337
1397
  }), /* @__PURE__ */ v("span", {
1338
1398
  className: "text-foreground",
1339
1399
  children: [
1340
- u.inputFps.toFixed(1),
1400
+ c.inputFps.toFixed(1),
1341
1401
  "/",
1342
- u.decodeFps.toFixed(1)
1402
+ c.decodeFps.toFixed(1)
1343
1403
  ]
1344
1404
  })]
1345
1405
  }),
@@ -1350,7 +1410,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1350
1410
  children: "Bitrate:"
1351
1411
  }), /* @__PURE__ */ _("span", {
1352
1412
  className: "text-foreground",
1353
- children: u.bitrateKbps >= 1e3 ? `${(u.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${u.bitrateKbps} kbps`
1413
+ children: c.bitrateKbps >= 1e3 ? `${(c.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${c.bitrateKbps} kbps`
1354
1414
  })]
1355
1415
  }),
1356
1416
  /* @__PURE__ */ v("span", {
@@ -1360,7 +1420,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1360
1420
  children: "Codec:"
1361
1421
  }), /* @__PURE__ */ _("span", {
1362
1422
  className: "text-foreground",
1363
- children: u.codec?.toUpperCase() ?? "—"
1423
+ children: c.codec?.toUpperCase() ?? "—"
1364
1424
  })]
1365
1425
  }),
1366
1426
  /* @__PURE__ */ v("span", {
@@ -1378,8 +1438,8 @@ function J({ slot: e, camStreams: o, compact: s }) {
1378
1438
  className: "text-foreground-subtle/70",
1379
1439
  children: "("
1380
1440
  }),
1381
- /* @__PURE__ */ _(we, {
1382
- count: u.encodedSubscribers + u.decodedSubscribers,
1441
+ /* @__PURE__ */ _(Oe, {
1442
+ count: c.encodedSubscribers + c.decodedSubscribers,
1383
1443
  clients: d,
1384
1444
  onKill: w
1385
1445
  }),
@@ -1387,8 +1447,8 @@ function J({ slot: e, camStreams: o, compact: s }) {
1387
1447
  className: "text-foreground-subtle/70",
1388
1448
  children: "·"
1389
1449
  }),
1390
- /* @__PURE__ */ _(Ee, {
1391
- count: u.rtspClients ?? 0,
1450
+ /* @__PURE__ */ _(Ae, {
1451
+ count: c.rtspClients ?? 0,
1392
1452
  clients: d,
1393
1453
  onKill: w
1394
1454
  }),
@@ -1396,7 +1456,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1396
1456
  className: "text-foreground-subtle/70",
1397
1457
  children: [
1398
1458
  "· pipe ",
1399
- u.pipeClients ?? 0,
1459
+ c.pipeClients ?? 0,
1400
1460
  ")"
1401
1461
  ]
1402
1462
  })
@@ -1413,7 +1473,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1413
1473
  children: "In:"
1414
1474
  }), /* @__PURE__ */ v("span", {
1415
1475
  className: "text-foreground",
1416
- children: [u.inputFps.toFixed(1), " fps"]
1476
+ children: [c.inputFps.toFixed(1), " fps"]
1417
1477
  })]
1418
1478
  }),
1419
1479
  /* @__PURE__ */ v("span", {
@@ -1423,7 +1483,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1423
1483
  children: "Dec:"
1424
1484
  }), /* @__PURE__ */ v("span", {
1425
1485
  className: "text-foreground",
1426
- children: [u.decodeFps.toFixed(1), " fps"]
1486
+ children: [c.decodeFps.toFixed(1), " fps"]
1427
1487
  })]
1428
1488
  }),
1429
1489
  /* @__PURE__ */ v("span", {
@@ -1433,7 +1493,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1433
1493
  children: "Bitrate:"
1434
1494
  }), /* @__PURE__ */ _("span", {
1435
1495
  className: "text-foreground",
1436
- children: u.bitrateKbps >= 1e3 ? `${(u.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${u.bitrateKbps} kbps`
1496
+ children: c.bitrateKbps >= 1e3 ? `${(c.bitrateKbps / 1e3).toFixed(1)} Mbps` : `${c.bitrateKbps} kbps`
1437
1497
  })]
1438
1498
  }),
1439
1499
  /* @__PURE__ */ v("span", {
@@ -1443,7 +1503,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1443
1503
  children: "IDR:"
1444
1504
  }), /* @__PURE__ */ _("span", {
1445
1505
  className: "text-foreground",
1446
- children: u.idrIntervalMs > 0 ? `${(u.idrIntervalMs / 1e3).toFixed(1)}s` : "—"
1506
+ children: c.idrIntervalMs > 0 ? `${(c.idrIntervalMs / 1e3).toFixed(1)}s` : "—"
1447
1507
  })]
1448
1508
  }),
1449
1509
  /* @__PURE__ */ v("span", {
@@ -1453,7 +1513,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1453
1513
  children: "Codec:"
1454
1514
  }), /* @__PURE__ */ _("span", {
1455
1515
  className: "text-foreground",
1456
- children: u.codec?.toUpperCase() ?? "—"
1516
+ children: c.codec?.toUpperCase() ?? "—"
1457
1517
  })]
1458
1518
  }),
1459
1519
  /* @__PURE__ */ v("span", {
@@ -1463,7 +1523,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1463
1523
  children: "Decoder:"
1464
1524
  }), /* @__PURE__ */ _("span", {
1465
1525
  className: "text-foreground font-mono truncate",
1466
- children: u.decoderNodeId ?? /* @__PURE__ */ _("span", {
1526
+ children: c.decoderNodeId ?? /* @__PURE__ */ _("span", {
1467
1527
  className: "text-foreground-subtle italic",
1468
1528
  children: "deferred"
1469
1529
  })
@@ -1476,7 +1536,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1476
1536
  children: "Pipe:"
1477
1537
  }), /* @__PURE__ */ _("span", {
1478
1538
  className: "text-foreground",
1479
- children: u.pipeClients ?? 0
1539
+ children: c.pipeClients ?? 0
1480
1540
  })]
1481
1541
  }),
1482
1542
  /* @__PURE__ */ v("span", {
@@ -1486,7 +1546,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1486
1546
  children: "Packets:"
1487
1547
  }), /* @__PURE__ */ _("span", {
1488
1548
  className: "text-foreground",
1489
- children: u.packetCount > 1e3 ? `${(u.packetCount / 1e3).toFixed(1)}k` : u.packetCount
1549
+ children: c.packetCount > 1e3 ? `${(c.packetCount / 1e3).toFixed(1)}k` : c.packetCount
1490
1550
  })]
1491
1551
  }),
1492
1552
  /* @__PURE__ */ v("span", {
@@ -1496,10 +1556,10 @@ function J({ slot: e, camStreams: o, compact: s }) {
1496
1556
  children: "Data:"
1497
1557
  }), /* @__PURE__ */ _("span", {
1498
1558
  className: "text-foreground",
1499
- children: u.totalBytes > 1048576 ? `${(u.totalBytes / 1048576).toFixed(1)} MB` : `${(u.totalBytes / 1024).toFixed(0)} KB`
1559
+ children: c.totalBytes > 1048576 ? `${(c.totalBytes / 1048576).toFixed(1)} MB` : `${(c.totalBytes / 1024).toFixed(0)} KB`
1500
1560
  })]
1501
1561
  }),
1502
- u.audio && /* @__PURE__ */ v("div", {
1562
+ c.audio && /* @__PURE__ */ v("div", {
1503
1563
  className: "basis-full flex flex-wrap items-center gap-x-1.5 gap-y-0.5",
1504
1564
  children: [
1505
1565
  /* @__PURE__ */ _("span", {
@@ -1511,7 +1571,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1511
1571
  children: [
1512
1572
  /* @__PURE__ */ _("span", {
1513
1573
  className: "text-foreground",
1514
- children: u.audio.codec.toUpperCase()
1574
+ children: c.audio.codec.toUpperCase()
1515
1575
  }),
1516
1576
  /* @__PURE__ */ _("span", {
1517
1577
  className: "text-foreground-subtle",
@@ -1519,7 +1579,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1519
1579
  }),
1520
1580
  /* @__PURE__ */ _("span", {
1521
1581
  className: "text-foreground",
1522
- children: u.audio.sampleRate >= 1e3 ? `${(u.audio.sampleRate / 1e3).toFixed(u.audio.sampleRate % 1e3 == 0 ? 0 : 1)}kHz` : `${u.audio.sampleRate}Hz`
1582
+ children: c.audio.sampleRate >= 1e3 ? `${(c.audio.sampleRate / 1e3).toFixed(c.audio.sampleRate % 1e3 == 0 ? 0 : 1)}kHz` : `${c.audio.sampleRate}Hz`
1523
1583
  }),
1524
1584
  /* @__PURE__ */ _("span", {
1525
1585
  className: "text-foreground-subtle",
@@ -1527,20 +1587,20 @@ function J({ slot: e, camStreams: o, compact: s }) {
1527
1587
  }),
1528
1588
  /* @__PURE__ */ _("span", {
1529
1589
  className: "text-foreground",
1530
- children: u.audio.channels === 1 ? "mono" : u.audio.channels === 2 ? "stereo" : `${u.audio.channels}ch`
1590
+ children: c.audio.channels === 1 ? "mono" : c.audio.channels === 2 ? "stereo" : `${c.audio.channels}ch`
1531
1591
  })
1532
1592
  ]
1533
1593
  }),
1534
1594
  /* @__PURE__ */ _("span", {
1535
- className: `px-1 py-px rounded text-[8px] font-medium whitespace-nowrap ${u.audio.supported ? "bg-success/15 text-success" : "bg-amber-500/15 text-amber-500"}`,
1536
- children: u.audio.supported ? "decoded" : "no decoder"
1595
+ className: `px-1 py-px rounded text-[8px] font-medium whitespace-nowrap ${c.audio.supported ? "bg-success/15 text-success" : "bg-amber-500/15 text-amber-500"}`,
1596
+ children: c.audio.supported ? "decoded" : "no decoder"
1537
1597
  })
1538
1598
  ]
1539
1599
  })
1540
1600
  ]
1541
- }), /* @__PURE__ */ _(Ce, {
1601
+ }), /* @__PURE__ */ _(De, {
1542
1602
  clients: d,
1543
- encodedCount: u.encodedSubscribers,
1603
+ encodedCount: c.encodedSubscribers,
1544
1604
  onKill: w
1545
1605
  })] }) : /* @__PURE__ */ _("p", {
1546
1606
  className: "text-[10px] text-foreground-subtle italic",
@@ -1553,7 +1613,7 @@ function J({ slot: e, camStreams: o, compact: s }) {
1553
1613
  className: "text-foreground-subtle",
1554
1614
  children: "Buffer:"
1555
1615
  }),
1556
- /* @__PURE__ */ _(Te, {
1616
+ /* @__PURE__ */ _(ke, {
1557
1617
  enabled: m,
1558
1618
  onToggle: (e) => S(e),
1559
1619
  disabled: x.isPending
@@ -1561,9 +1621,9 @@ function J({ slot: e, camStreams: o, compact: s }) {
1561
1621
  /* @__PURE__ */ v("span", {
1562
1622
  className: "text-foreground",
1563
1623
  children: [
1564
- g ?? u?.preBufferSec ?? 0,
1624
+ g ?? c?.preBufferSec ?? 0,
1565
1625
  "s",
1566
- u && E ? ` (${u.preBufferPackets}p)` : ""
1626
+ c && E ? ` (${c.preBufferPackets}p)` : ""
1567
1627
  ]
1568
1628
  })
1569
1629
  ]
@@ -1571,12 +1631,12 @@ function J({ slot: e, camStreams: o, compact: s }) {
1571
1631
  ]
1572
1632
  });
1573
1633
  }
1574
- var xe = 280, Se = 120;
1575
- function Y({ trigger: e, content: t, widthClass: n }) {
1634
+ var we = 280, Te = 120;
1635
+ function X({ trigger: e, content: t, widthClass: n }) {
1576
1636
  let r = d(null), i = d(null), [a, o] = m(!1), [s, c] = m(!1), l = h(() => {
1577
1637
  i.current &&= (clearTimeout(i.current), null);
1578
1638
  }, []), u = h(() => {
1579
- l(), i.current = setTimeout(() => o(!1), Se);
1639
+ l(), i.current = setTimeout(() => o(!1), Te);
1580
1640
  }, [l]);
1581
1641
  return /* @__PURE__ */ v("span", {
1582
1642
  ref: r,
@@ -1586,7 +1646,7 @@ function Y({ trigger: e, content: t, widthClass: n }) {
1586
1646
  let e = r.current;
1587
1647
  if (e) {
1588
1648
  let t = e.getBoundingClientRect(), n = window.innerHeight - t.bottom, r = t.top;
1589
- c(n < xe && r > n);
1649
+ c(n < we && r > n);
1590
1650
  }
1591
1651
  o(!0);
1592
1652
  }, [l]),
@@ -1599,17 +1659,17 @@ function Y({ trigger: e, content: t, widthClass: n }) {
1599
1659
  })]
1600
1660
  });
1601
1661
  }
1602
- function X(e) {
1662
+ function Z(e) {
1603
1663
  if (e < 1e3) return `${e}ms`;
1604
1664
  let t = Math.floor(e / 1e3);
1605
1665
  if (t < 60) return `${t}s`;
1606
1666
  let n = Math.floor(t / 60);
1607
1667
  return n < 60 ? `${n}m ${t % 60}s` : `${Math.floor(n / 60)}h ${n % 60}m`;
1608
1668
  }
1609
- function Z(e) {
1669
+ function Ee(e) {
1610
1670
  return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : e < 1073741824 ? `${(e / 1048576).toFixed(1)} MB` : `${(e / 1073741824).toFixed(2)} GB`;
1611
1671
  }
1612
- function Ce({ clients: e, encodedCount: t, onKill: n }) {
1672
+ function De({ clients: e, encodedCount: t, onKill: n }) {
1613
1673
  let r = e?.decoded ?? [], i = e?.audio ?? [], a = e?.rtsp ?? [], o = e?.encoded ?? [], s = r.length + i.length + a.length + o.length, [c, l] = m(!0);
1614
1674
  return s === 0 ? /* @__PURE__ */ _("div", {
1615
1675
  className: "mt-1.5 text-[10px] text-foreground-subtle italic",
@@ -1620,7 +1680,7 @@ function Ce({ clients: e, encodedCount: t, onKill: n }) {
1620
1680
  type: "button",
1621
1681
  onClick: () => l((e) => !e),
1622
1682
  className: "flex items-center gap-1 text-[10px] text-foreground-subtle hover:text-foreground transition-colors",
1623
- children: [_(c ? j : M, { className: "h-3 w-3" }), /* @__PURE__ */ v("span", {
1683
+ children: [_(c ? M : N, { className: "h-3 w-3" }), /* @__PURE__ */ v("span", {
1624
1684
  className: "uppercase tracking-wider",
1625
1685
  children: [
1626
1686
  "Subscribers (",
@@ -1665,12 +1725,12 @@ function Ce({ clients: e, encodedCount: t, onKill: n }) {
1665
1725
  return /* @__PURE__ */ _(Q, {
1666
1726
  kind: "RTSP",
1667
1727
  kindClass: "bg-warning/10 text-warning",
1668
- tag: e.userAgent ? U(e.userAgent) : e.remoteAddr,
1728
+ tag: e.userAgent ? W(e.userAgent) : e.remoteAddr,
1669
1729
  state: {
1670
1730
  text: i + (e.muted ? " · muted" : ""),
1671
1731
  className: a
1672
1732
  },
1673
- metrics: [Z(e.bytesSent), `last rtp ${X(t)} ago`],
1733
+ metrics: [Ee(e.bytesSent), `last rtp ${Z(t)} ago`],
1674
1734
  age: Date.now() - e.connectedAt,
1675
1735
  onKill: n ? () => n({
1676
1736
  channel: "rtsp",
@@ -1679,11 +1739,11 @@ function Ce({ clients: e, encodedCount: t, onKill: n }) {
1679
1739
  }, `r-${e.sessionId}`);
1680
1740
  }),
1681
1741
  o.map((e) => {
1682
- let t = e.attribution, n = me[t.kind] ?? "bg-foreground-subtle/10 text-foreground-subtle", r = t.sessionId ? t.sessionId.slice(0, 8) : null, i = [];
1683
- t.label && i.push(t.label), r && i.push(`sess ${r}`), t.userId && i.push(`user ${t.userId.slice(0, 8)}`), t.remoteAddr && i.push(`@${t.remoteAddr}`), t.userAgent && i.push(U(t.userAgent));
1684
- let a = i.length > 0 ? i.join(" · ") : ge(t.kind), o = [];
1742
+ let t = e.attribution, n = _e[t.kind] ?? "bg-foreground-subtle/10 text-foreground-subtle", r = t.sessionId ? t.sessionId.slice(0, 8) : null, i = [];
1743
+ t.label && i.push(t.label), r && i.push(`sess ${r}`), t.userId && i.push(`user ${t.userId.slice(0, 8)}`), t.remoteAddr && i.push(`@${t.remoteAddr}`), t.userAgent && i.push(W(t.userAgent));
1744
+ let a = i.length > 0 ? i.join(" · ") : ye(t.kind), o = [];
1685
1745
  return t.media && o.push({ text: t.media }), t.targetCodec && o.push(t.targetCodec), t.transport && o.push(t.transport), o.push(`${e.packetsDelivered} pkts`), /* @__PURE__ */ _(Q, {
1686
- kind: he(t.kind),
1746
+ kind: ve(t.kind),
1687
1747
  kindClass: n,
1688
1748
  tag: a,
1689
1749
  metrics: o,
@@ -1746,7 +1806,7 @@ function Q({ kind: e, kindClass: t, tag: n, state: r, metrics: i, age: a, onKill
1746
1806
  }, t)),
1747
1807
  /* @__PURE__ */ v("span", {
1748
1808
  className: "text-foreground-subtle/70 whitespace-nowrap",
1749
- children: ["· ", X(a)]
1809
+ children: ["· ", Z(a)]
1750
1810
  })
1751
1811
  ]
1752
1812
  }),
@@ -1757,12 +1817,12 @@ function Q({ kind: e, kindClass: t, tag: n, state: r, metrics: i, age: a, onKill
1757
1817
  ]
1758
1818
  });
1759
1819
  }
1760
- function we({ count: e, clients: t, onKill: n }) {
1820
+ function Oe({ count: e, clients: t, onKill: n }) {
1761
1821
  let r = t?.decoded ?? [], i = t?.audio ?? [], a = t ? t.encodedSubscribers : 0, o = r.length > 0 || i.length > 0 || a > 0, s = /* @__PURE__ */ _("span", {
1762
1822
  className: `text-foreground ${o ? "underline decoration-dotted decoration-foreground-subtle/50 underline-offset-2 cursor-help" : ""}`,
1763
1823
  children: e
1764
1824
  });
1765
- return o ? /* @__PURE__ */ _(Y, {
1825
+ return o ? /* @__PURE__ */ _(X, {
1766
1826
  trigger: s,
1767
1827
  content: /* @__PURE__ */ v(y, { children: [
1768
1828
  r.length > 0 && /* @__PURE__ */ v("div", {
@@ -1790,7 +1850,7 @@ function we({ count: e, clients: t, onKill: n }) {
1790
1850
  ]
1791
1851
  }),
1792
1852
  /* @__PURE__ */ _("span", { children: "·" }),
1793
- /* @__PURE__ */ _("span", { children: X(Date.now() - e.subscribedAt) }),
1853
+ /* @__PURE__ */ _("span", { children: Z(Date.now() - e.subscribedAt) }),
1794
1854
  n && e.tag && /* @__PURE__ */ _($, { onClick: () => n({
1795
1855
  channel: "decoded",
1796
1856
  handle: e.tag
@@ -1814,7 +1874,7 @@ function we({ count: e, clients: t, onKill: n }) {
1814
1874
  children: [
1815
1875
  /* @__PURE__ */ v("span", { children: [e.chunksDelivered, " chunks"] }),
1816
1876
  /* @__PURE__ */ _("span", { children: "·" }),
1817
- /* @__PURE__ */ _("span", { children: X(Date.now() - e.subscribedAt) }),
1877
+ /* @__PURE__ */ _("span", { children: Z(Date.now() - e.subscribedAt) }),
1818
1878
  n && e.tag && /* @__PURE__ */ _($, { onClick: () => n({
1819
1879
  channel: "audio",
1820
1880
  handle: e.tag
@@ -1834,7 +1894,7 @@ function we({ count: e, clients: t, onKill: n }) {
1834
1894
  widthClass: "min-w-[260px] max-w-[360px]"
1835
1895
  }) : s;
1836
1896
  }
1837
- function Te({ enabled: e, onToggle: t, disabled: n }) {
1897
+ function ke({ enabled: e, onToggle: t, disabled: n }) {
1838
1898
  return /* @__PURE__ */ _("button", {
1839
1899
  type: "button",
1840
1900
  role: "switch",
@@ -1854,15 +1914,15 @@ function $({ onClick: e }) {
1854
1914
  t.stopPropagation(), e();
1855
1915
  },
1856
1916
  className: "inline-flex items-center justify-center h-4 w-4 rounded-sm border border-border/60 text-foreground-subtle hover:bg-red-500/10 hover:text-red-400 hover:border-red-500/40 transition-colors",
1857
- children: /* @__PURE__ */ _(te, { className: "h-2.5 w-2.5" })
1917
+ children: /* @__PURE__ */ _(re, { className: "h-2.5 w-2.5" })
1858
1918
  });
1859
1919
  }
1860
- function Ee({ count: e, clients: t, onKill: n }) {
1920
+ function Ae({ count: e, clients: t, onKill: n }) {
1861
1921
  let r = t?.rtsp ?? [], i = r.length > 0, a = /* @__PURE__ */ _("span", {
1862
1922
  className: `text-foreground ${i ? "underline decoration-dotted decoration-foreground-subtle/50 underline-offset-2 cursor-help" : ""}`,
1863
1923
  children: e
1864
1924
  });
1865
- return i ? /* @__PURE__ */ _(Y, {
1925
+ return i ? /* @__PURE__ */ _(X, {
1866
1926
  trigger: a,
1867
1927
  content: /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ _("div", {
1868
1928
  className: "text-foreground-subtle uppercase text-[9px] tracking-wider mb-1",
@@ -1875,7 +1935,7 @@ function Ee({ count: e, clients: t, onKill: n }) {
1875
1935
  className: "flex items-center justify-between gap-2",
1876
1936
  children: [/* @__PURE__ */ _("span", {
1877
1937
  className: "text-foreground font-mono",
1878
- children: e.userAgent ? U(e.userAgent) : e.remoteAddr
1938
+ children: e.userAgent ? W(e.userAgent) : e.remoteAddr
1879
1939
  }), /* @__PURE__ */ v("span", {
1880
1940
  className: "flex items-center gap-1 shrink-0",
1881
1941
  children: [/* @__PURE__ */ v("span", {
@@ -1889,15 +1949,15 @@ function Ee({ count: e, clients: t, onKill: n }) {
1889
1949
  }), /* @__PURE__ */ v("div", {
1890
1950
  className: "flex items-center justify-between gap-2 text-foreground-subtle text-[9px] mt-0.5",
1891
1951
  children: [
1892
- /* @__PURE__ */ v("span", { children: [Z(e.bytesSent), " sent"] }),
1952
+ /* @__PURE__ */ v("span", { children: [Ee(e.bytesSent), " sent"] }),
1893
1953
  /* @__PURE__ */ v("span", { children: [
1894
1954
  "connected ",
1895
- X(Date.now() - e.connectedAt),
1955
+ Z(Date.now() - e.connectedAt),
1896
1956
  " ago"
1897
1957
  ] }),
1898
1958
  /* @__PURE__ */ v("span", { children: [
1899
1959
  "last rtp ",
1900
- X(t),
1960
+ Z(t),
1901
1961
  " ago"
1902
1962
  ] })
1903
1963
  ]
@@ -1909,9 +1969,9 @@ function Ee({ count: e, clients: t, onKill: n }) {
1909
1969
  }
1910
1970
  //#endregion
1911
1971
  //#region src/stream-broker/widgets/index.tsx
1912
- var De = {
1913
- "stream-broker-panel": _e,
1914
- "ffmpeg-params": ue
1972
+ var je = {
1973
+ "stream-broker-panel": be,
1974
+ "ffmpeg-params": pe
1915
1975
  };
1916
1976
  //#endregion
1917
- export { De as default };
1977
+ export { je as default };