@camstack/addon-benchmark 1.2.130 → 1.2.132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/_stub.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import "./virtualExposes-erbhyesj.mjs";
2
- import { a as e, i as t, o as n, r } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_benchmark_page__remoteEntry_js-gG6O20vq.mjs";
2
+ import { a as e, i as t, o as n, r } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_benchmark_page__remoteEntry_js-CTYIehRs.mjs";
3
3
  import { _ as i, b as a, c as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, p as h, r as g, t as _, u as v, v as y, x as b, y as x } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.js-GeuxDuzQ.mjs";
4
4
  import { a as S, c as C, i as w, n as T, o as E, r as D, s as O } from "./responsive-CT_560tF.mjs";
5
- import { c as k, d as ee, f as te, l as A, s as j, u as M } from "./scene-monitor-copy-BT6N1GH3.mjs";
6
- import { a as N, i as P, n as F, o as I, r as ne } from "./player-overlays-Cpb-b-H9.mjs";
7
- import { n as L, r as R, t as z } from "./square-CTAf6jcB.mjs";
8
- import { t as re } from "./grid-2x2-B15Skho8.mjs";
5
+ import { c as k, d as ee, f as A, l as te, s as ne, u as j } from "./scene-monitor-copy-BT6N1GH3.mjs";
6
+ import { a as re, i as M, n as N, o as P, r as F } from "./player-overlays-Cpb-b-H9.mjs";
7
+ import { n as I, r as L, t as R } from "./square-CTAf6jcB.mjs";
8
+ import { t as z } from "./grid-2x2-B15Skho8.mjs";
9
9
  import { t as ie } from "./trash-2-gzG8wmmP.mjs";
10
10
  import { n as B, t as ae } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-Bh7FS7ML.mjs";
11
11
  import { i as oe, n as V, r as H, t as U } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-SOU_VnTj.mjs";
@@ -3088,14 +3088,14 @@ var gi = (e, t) => {
3088
3088
  "baseline",
3089
3089
  "center-safe",
3090
3090
  "end-safe"
3091
- ], te = () => [
3091
+ ], A = () => [
3092
3092
  "start",
3093
3093
  "end",
3094
3094
  "center",
3095
3095
  "stretch",
3096
3096
  "center-safe",
3097
3097
  "end-safe"
3098
- ], A = () => ["auto", ...w()], j = () => [
3098
+ ], te = () => ["auto", ...w()], ne = () => [
3099
3099
  ia,
3100
3100
  "auto",
3101
3101
  "full",
@@ -3109,7 +3109,7 @@ var gi = (e, t) => {
3109
3109
  "max",
3110
3110
  "fit",
3111
3111
  ...w()
3112
- ], M = () => [
3112
+ ], j = () => [
3113
3113
  ia,
3114
3114
  "screen",
3115
3115
  "full",
@@ -3120,7 +3120,7 @@ var gi = (e, t) => {
3120
3120
  "max",
3121
3121
  "fit",
3122
3122
  ...w()
3123
- ], N = () => [
3123
+ ], re = () => [
3124
3124
  ia,
3125
3125
  "screen",
3126
3126
  "full",
@@ -3132,45 +3132,45 @@ var gi = (e, t) => {
3132
3132
  "max",
3133
3133
  "fit",
3134
3134
  ...w()
3135
- ], P = () => [
3135
+ ], M = () => [
3136
3136
  e,
3137
3137
  X,
3138
3138
  Y
3139
- ], F = () => [
3139
+ ], N = () => [
3140
3140
  ...b(),
3141
3141
  Ea,
3142
3142
  xa,
3143
3143
  { position: [X, Y] }
3144
- ], I = () => ["no-repeat", { repeat: [
3144
+ ], P = () => ["no-repeat", { repeat: [
3145
3145
  "",
3146
3146
  "x",
3147
3147
  "y",
3148
3148
  "space",
3149
3149
  "round"
3150
- ] }], ne = () => [
3150
+ ] }], F = () => [
3151
3151
  "auto",
3152
3152
  "cover",
3153
3153
  "contain",
3154
3154
  Da,
3155
3155
  ga,
3156
3156
  { size: [X, Y] }
3157
- ], L = () => [
3157
+ ], I = () => [
3158
3158
  sa,
3159
3159
  wa,
3160
3160
  _a
3161
- ], R = () => [
3161
+ ], L = () => [
3162
3162
  "",
3163
3163
  "none",
3164
3164
  "full",
3165
3165
  l,
3166
3166
  X,
3167
3167
  Y
3168
- ], z = () => [
3168
+ ], R = () => [
3169
3169
  "",
3170
3170
  aa,
3171
3171
  wa,
3172
3172
  _a
3173
- ], re = () => [
3173
+ ], z = () => [
3174
3174
  "solid",
3175
3175
  "dashed",
3176
3176
  "dotted",
@@ -3475,18 +3475,18 @@ var gi = (e, t) => {
3475
3475
  "gap-x": [{ "gap-x": w() }],
3476
3476
  "gap-y": [{ "gap-y": w() }],
3477
3477
  "justify-content": [{ justify: [...ee(), "normal"] }],
3478
- "justify-items": [{ "justify-items": [...te(), "normal"] }],
3479
- "justify-self": [{ "justify-self": ["auto", ...te()] }],
3478
+ "justify-items": [{ "justify-items": [...A(), "normal"] }],
3479
+ "justify-self": [{ "justify-self": ["auto", ...A()] }],
3480
3480
  "align-content": [{ content: ["normal", ...ee()] }],
3481
- "align-items": [{ items: [...te(), { baseline: ["", "last"] }] }],
3481
+ "align-items": [{ items: [...A(), { baseline: ["", "last"] }] }],
3482
3482
  "align-self": [{ self: [
3483
3483
  "auto",
3484
- ...te(),
3484
+ ...A(),
3485
3485
  { baseline: ["", "last"] }
3486
3486
  ] }],
3487
3487
  "place-content": [{ "place-content": ee() }],
3488
- "place-items": [{ "place-items": [...te(), "baseline"] }],
3489
- "place-self": [{ "place-self": ["auto", ...te()] }],
3488
+ "place-items": [{ "place-items": [...A(), "baseline"] }],
3489
+ "place-self": [{ "place-self": ["auto", ...A()] }],
3490
3490
  p: [{ p: w() }],
3491
3491
  px: [{ px: w() }],
3492
3492
  py: [{ py: w() }],
@@ -3498,38 +3498,38 @@ var gi = (e, t) => {
3498
3498
  pr: [{ pr: w() }],
3499
3499
  pb: [{ pb: w() }],
3500
3500
  pl: [{ pl: w() }],
3501
- m: [{ m: A() }],
3502
- mx: [{ mx: A() }],
3503
- my: [{ my: A() }],
3504
- ms: [{ ms: A() }],
3505
- me: [{ me: A() }],
3506
- mbs: [{ mbs: A() }],
3507
- mbe: [{ mbe: A() }],
3508
- mt: [{ mt: A() }],
3509
- mr: [{ mr: A() }],
3510
- mb: [{ mb: A() }],
3511
- ml: [{ ml: A() }],
3501
+ m: [{ m: te() }],
3502
+ mx: [{ mx: te() }],
3503
+ my: [{ my: te() }],
3504
+ ms: [{ ms: te() }],
3505
+ me: [{ me: te() }],
3506
+ mbs: [{ mbs: te() }],
3507
+ mbe: [{ mbe: te() }],
3508
+ mt: [{ mt: te() }],
3509
+ mr: [{ mr: te() }],
3510
+ mb: [{ mb: te() }],
3511
+ ml: [{ ml: te() }],
3512
3512
  "space-x": [{ "space-x": w() }],
3513
3513
  "space-x-reverse": ["space-x-reverse"],
3514
3514
  "space-y": [{ "space-y": w() }],
3515
3515
  "space-y-reverse": ["space-y-reverse"],
3516
- size: [{ size: j() }],
3517
- "inline-size": [{ inline: ["auto", ...M()] }],
3518
- "min-inline-size": [{ "min-inline": ["auto", ...M()] }],
3519
- "max-inline-size": [{ "max-inline": ["none", ...M()] }],
3520
- "block-size": [{ block: ["auto", ...N()] }],
3521
- "min-block-size": [{ "min-block": ["auto", ...N()] }],
3522
- "max-block-size": [{ "max-block": ["none", ...N()] }],
3516
+ size: [{ size: ne() }],
3517
+ "inline-size": [{ inline: ["auto", ...j()] }],
3518
+ "min-inline-size": [{ "min-inline": ["auto", ...j()] }],
3519
+ "max-inline-size": [{ "max-inline": ["none", ...j()] }],
3520
+ "block-size": [{ block: ["auto", ...re()] }],
3521
+ "min-block-size": [{ "min-block": ["auto", ...re()] }],
3522
+ "max-block-size": [{ "max-block": ["none", ...re()] }],
3523
3523
  w: [{ w: [
3524
3524
  s,
3525
3525
  "screen",
3526
- ...j()
3526
+ ...ne()
3527
3527
  ] }],
3528
3528
  "min-w": [{ "min-w": [
3529
3529
  s,
3530
3530
  "screen",
3531
3531
  "none",
3532
- ...j()
3532
+ ...ne()
3533
3533
  ] }],
3534
3534
  "max-w": [{ "max-w": [
3535
3535
  s,
@@ -3537,23 +3537,23 @@ var gi = (e, t) => {
3537
3537
  "none",
3538
3538
  "prose",
3539
3539
  { screen: [o] },
3540
- ...j()
3540
+ ...ne()
3541
3541
  ] }],
3542
3542
  h: [{ h: [
3543
3543
  "screen",
3544
3544
  "lh",
3545
- ...j()
3545
+ ...ne()
3546
3546
  ] }],
3547
3547
  "min-h": [{ "min-h": [
3548
3548
  "screen",
3549
3549
  "lh",
3550
3550
  "none",
3551
- ...j()
3551
+ ...ne()
3552
3552
  ] }],
3553
3553
  "max-h": [{ "max-h": [
3554
3554
  "screen",
3555
3555
  "lh",
3556
- ...j()
3556
+ ...ne()
3557
3557
  ] }],
3558
3558
  "font-size": [{ text: [
3559
3559
  "base",
@@ -3626,15 +3626,15 @@ var gi = (e, t) => {
3626
3626
  "start",
3627
3627
  "end"
3628
3628
  ] }],
3629
- "placeholder-color": [{ placeholder: P() }],
3630
- "text-color": [{ text: P() }],
3629
+ "placeholder-color": [{ placeholder: M() }],
3630
+ "text-color": [{ text: M() }],
3631
3631
  "text-decoration": [
3632
3632
  "underline",
3633
3633
  "overline",
3634
3634
  "line-through",
3635
3635
  "no-underline"
3636
3636
  ],
3637
- "text-decoration-style": [{ decoration: [...re(), "wavy"] }],
3637
+ "text-decoration-style": [{ decoration: [...z(), "wavy"] }],
3638
3638
  "text-decoration-thickness": [{ decoration: [
3639
3639
  aa,
3640
3640
  "from-font",
@@ -3642,7 +3642,7 @@ var gi = (e, t) => {
3642
3642
  X,
3643
3643
  _a
3644
3644
  ] }],
3645
- "text-decoration-color": [{ decoration: P() }],
3645
+ "text-decoration-color": [{ decoration: M() }],
3646
3646
  "underline-offset": [{ "underline-offset": [
3647
3647
  aa,
3648
3648
  "auto",
@@ -3729,9 +3729,9 @@ var gi = (e, t) => {
3729
3729
  "padding",
3730
3730
  "content"
3731
3731
  ] }],
3732
- "bg-position": [{ bg: F() }],
3733
- "bg-repeat": [{ bg: I() }],
3734
- "bg-size": [{ bg: ne() }],
3732
+ "bg-position": [{ bg: N() }],
3733
+ "bg-repeat": [{ bg: P() }],
3734
+ "bg-size": [{ bg: F() }],
3735
3735
  "bg-image": [{ bg: [
3736
3736
  "none",
3737
3737
  {
@@ -3764,67 +3764,67 @@ var gi = (e, t) => {
3764
3764
  Oa,
3765
3765
  Sa
3766
3766
  ] }],
3767
- "bg-color": [{ bg: P() }],
3768
- "gradient-from-pos": [{ from: L() }],
3769
- "gradient-via-pos": [{ via: L() }],
3770
- "gradient-to-pos": [{ to: L() }],
3771
- "gradient-from": [{ from: P() }],
3772
- "gradient-via": [{ via: P() }],
3773
- "gradient-to": [{ to: P() }],
3774
- rounded: [{ rounded: R() }],
3775
- "rounded-s": [{ "rounded-s": R() }],
3776
- "rounded-e": [{ "rounded-e": R() }],
3777
- "rounded-t": [{ "rounded-t": R() }],
3778
- "rounded-r": [{ "rounded-r": R() }],
3779
- "rounded-b": [{ "rounded-b": R() }],
3780
- "rounded-l": [{ "rounded-l": R() }],
3781
- "rounded-ss": [{ "rounded-ss": R() }],
3782
- "rounded-se": [{ "rounded-se": R() }],
3783
- "rounded-ee": [{ "rounded-ee": R() }],
3784
- "rounded-es": [{ "rounded-es": R() }],
3785
- "rounded-tl": [{ "rounded-tl": R() }],
3786
- "rounded-tr": [{ "rounded-tr": R() }],
3787
- "rounded-br": [{ "rounded-br": R() }],
3788
- "rounded-bl": [{ "rounded-bl": R() }],
3789
- "border-w": [{ border: z() }],
3790
- "border-w-x": [{ "border-x": z() }],
3791
- "border-w-y": [{ "border-y": z() }],
3792
- "border-w-s": [{ "border-s": z() }],
3793
- "border-w-e": [{ "border-e": z() }],
3794
- "border-w-bs": [{ "border-bs": z() }],
3795
- "border-w-be": [{ "border-be": z() }],
3796
- "border-w-t": [{ "border-t": z() }],
3797
- "border-w-r": [{ "border-r": z() }],
3798
- "border-w-b": [{ "border-b": z() }],
3799
- "border-w-l": [{ "border-l": z() }],
3800
- "divide-x": [{ "divide-x": z() }],
3767
+ "bg-color": [{ bg: M() }],
3768
+ "gradient-from-pos": [{ from: I() }],
3769
+ "gradient-via-pos": [{ via: I() }],
3770
+ "gradient-to-pos": [{ to: I() }],
3771
+ "gradient-from": [{ from: M() }],
3772
+ "gradient-via": [{ via: M() }],
3773
+ "gradient-to": [{ to: M() }],
3774
+ rounded: [{ rounded: L() }],
3775
+ "rounded-s": [{ "rounded-s": L() }],
3776
+ "rounded-e": [{ "rounded-e": L() }],
3777
+ "rounded-t": [{ "rounded-t": L() }],
3778
+ "rounded-r": [{ "rounded-r": L() }],
3779
+ "rounded-b": [{ "rounded-b": L() }],
3780
+ "rounded-l": [{ "rounded-l": L() }],
3781
+ "rounded-ss": [{ "rounded-ss": L() }],
3782
+ "rounded-se": [{ "rounded-se": L() }],
3783
+ "rounded-ee": [{ "rounded-ee": L() }],
3784
+ "rounded-es": [{ "rounded-es": L() }],
3785
+ "rounded-tl": [{ "rounded-tl": L() }],
3786
+ "rounded-tr": [{ "rounded-tr": L() }],
3787
+ "rounded-br": [{ "rounded-br": L() }],
3788
+ "rounded-bl": [{ "rounded-bl": L() }],
3789
+ "border-w": [{ border: R() }],
3790
+ "border-w-x": [{ "border-x": R() }],
3791
+ "border-w-y": [{ "border-y": R() }],
3792
+ "border-w-s": [{ "border-s": R() }],
3793
+ "border-w-e": [{ "border-e": R() }],
3794
+ "border-w-bs": [{ "border-bs": R() }],
3795
+ "border-w-be": [{ "border-be": R() }],
3796
+ "border-w-t": [{ "border-t": R() }],
3797
+ "border-w-r": [{ "border-r": R() }],
3798
+ "border-w-b": [{ "border-b": R() }],
3799
+ "border-w-l": [{ "border-l": R() }],
3800
+ "divide-x": [{ "divide-x": R() }],
3801
3801
  "divide-x-reverse": ["divide-x-reverse"],
3802
- "divide-y": [{ "divide-y": z() }],
3802
+ "divide-y": [{ "divide-y": R() }],
3803
3803
  "divide-y-reverse": ["divide-y-reverse"],
3804
3804
  "border-style": [{ border: [
3805
- ...re(),
3805
+ ...z(),
3806
3806
  "hidden",
3807
3807
  "none"
3808
3808
  ] }],
3809
3809
  "divide-style": [{ divide: [
3810
- ...re(),
3810
+ ...z(),
3811
3811
  "hidden",
3812
3812
  "none"
3813
3813
  ] }],
3814
- "border-color": [{ border: P() }],
3815
- "border-color-x": [{ "border-x": P() }],
3816
- "border-color-y": [{ "border-y": P() }],
3817
- "border-color-s": [{ "border-s": P() }],
3818
- "border-color-e": [{ "border-e": P() }],
3819
- "border-color-bs": [{ "border-bs": P() }],
3820
- "border-color-be": [{ "border-be": P() }],
3821
- "border-color-t": [{ "border-t": P() }],
3822
- "border-color-r": [{ "border-r": P() }],
3823
- "border-color-b": [{ "border-b": P() }],
3824
- "border-color-l": [{ "border-l": P() }],
3825
- "divide-color": [{ divide: P() }],
3814
+ "border-color": [{ border: M() }],
3815
+ "border-color-x": [{ "border-x": M() }],
3816
+ "border-color-y": [{ "border-y": M() }],
3817
+ "border-color-s": [{ "border-s": M() }],
3818
+ "border-color-e": [{ "border-e": M() }],
3819
+ "border-color-bs": [{ "border-bs": M() }],
3820
+ "border-color-be": [{ "border-be": M() }],
3821
+ "border-color-t": [{ "border-t": M() }],
3822
+ "border-color-r": [{ "border-r": M() }],
3823
+ "border-color-b": [{ "border-b": M() }],
3824
+ "border-color-l": [{ "border-l": M() }],
3825
+ "divide-color": [{ divide: M() }],
3826
3826
  "outline-style": [{ outline: [
3827
- ...re(),
3827
+ ...z(),
3828
3828
  "none",
3829
3829
  "hidden"
3830
3830
  ] }],
@@ -3839,7 +3839,7 @@ var gi = (e, t) => {
3839
3839
  wa,
3840
3840
  _a
3841
3841
  ] }],
3842
- "outline-color": [{ outline: P() }],
3842
+ "outline-color": [{ outline: M() }],
3843
3843
  shadow: [{ shadow: [
3844
3844
  "",
3845
3845
  "none",
@@ -3847,28 +3847,28 @@ var gi = (e, t) => {
3847
3847
  ka,
3848
3848
  Ca
3849
3849
  ] }],
3850
- "shadow-color": [{ shadow: P() }],
3850
+ "shadow-color": [{ shadow: M() }],
3851
3851
  "inset-shadow": [{ "inset-shadow": [
3852
3852
  "none",
3853
3853
  d,
3854
3854
  ka,
3855
3855
  Ca
3856
3856
  ] }],
3857
- "inset-shadow-color": [{ "inset-shadow": P() }],
3858
- "ring-w": [{ ring: z() }],
3857
+ "inset-shadow-color": [{ "inset-shadow": M() }],
3858
+ "ring-w": [{ ring: R() }],
3859
3859
  "ring-w-inset": ["ring-inset"],
3860
- "ring-color": [{ ring: P() }],
3860
+ "ring-color": [{ ring: M() }],
3861
3861
  "ring-offset-w": [{ "ring-offset": [aa, _a] }],
3862
- "ring-offset-color": [{ "ring-offset": P() }],
3863
- "inset-ring-w": [{ "inset-ring": z() }],
3864
- "inset-ring-color": [{ "inset-ring": P() }],
3862
+ "ring-offset-color": [{ "ring-offset": M() }],
3863
+ "inset-ring-w": [{ "inset-ring": R() }],
3864
+ "inset-ring-color": [{ "inset-ring": M() }],
3865
3865
  "text-shadow": [{ "text-shadow": [
3866
3866
  "none",
3867
3867
  f,
3868
3868
  ka,
3869
3869
  Ca
3870
3870
  ] }],
3871
- "text-shadow-color": [{ "text-shadow": P() }],
3871
+ "text-shadow-color": [{ "text-shadow": M() }],
3872
3872
  opacity: [{ opacity: [
3873
3873
  aa,
3874
3874
  X,
@@ -3897,37 +3897,37 @@ var gi = (e, t) => {
3897
3897
  "mask-image-linear-pos": [{ "mask-linear": [aa] }],
3898
3898
  "mask-image-linear-from-pos": [{ "mask-linear-from": B() }],
3899
3899
  "mask-image-linear-to-pos": [{ "mask-linear-to": B() }],
3900
- "mask-image-linear-from-color": [{ "mask-linear-from": P() }],
3901
- "mask-image-linear-to-color": [{ "mask-linear-to": P() }],
3900
+ "mask-image-linear-from-color": [{ "mask-linear-from": M() }],
3901
+ "mask-image-linear-to-color": [{ "mask-linear-to": M() }],
3902
3902
  "mask-image-t-from-pos": [{ "mask-t-from": B() }],
3903
3903
  "mask-image-t-to-pos": [{ "mask-t-to": B() }],
3904
- "mask-image-t-from-color": [{ "mask-t-from": P() }],
3905
- "mask-image-t-to-color": [{ "mask-t-to": P() }],
3904
+ "mask-image-t-from-color": [{ "mask-t-from": M() }],
3905
+ "mask-image-t-to-color": [{ "mask-t-to": M() }],
3906
3906
  "mask-image-r-from-pos": [{ "mask-r-from": B() }],
3907
3907
  "mask-image-r-to-pos": [{ "mask-r-to": B() }],
3908
- "mask-image-r-from-color": [{ "mask-r-from": P() }],
3909
- "mask-image-r-to-color": [{ "mask-r-to": P() }],
3908
+ "mask-image-r-from-color": [{ "mask-r-from": M() }],
3909
+ "mask-image-r-to-color": [{ "mask-r-to": M() }],
3910
3910
  "mask-image-b-from-pos": [{ "mask-b-from": B() }],
3911
3911
  "mask-image-b-to-pos": [{ "mask-b-to": B() }],
3912
- "mask-image-b-from-color": [{ "mask-b-from": P() }],
3913
- "mask-image-b-to-color": [{ "mask-b-to": P() }],
3912
+ "mask-image-b-from-color": [{ "mask-b-from": M() }],
3913
+ "mask-image-b-to-color": [{ "mask-b-to": M() }],
3914
3914
  "mask-image-l-from-pos": [{ "mask-l-from": B() }],
3915
3915
  "mask-image-l-to-pos": [{ "mask-l-to": B() }],
3916
- "mask-image-l-from-color": [{ "mask-l-from": P() }],
3917
- "mask-image-l-to-color": [{ "mask-l-to": P() }],
3916
+ "mask-image-l-from-color": [{ "mask-l-from": M() }],
3917
+ "mask-image-l-to-color": [{ "mask-l-to": M() }],
3918
3918
  "mask-image-x-from-pos": [{ "mask-x-from": B() }],
3919
3919
  "mask-image-x-to-pos": [{ "mask-x-to": B() }],
3920
- "mask-image-x-from-color": [{ "mask-x-from": P() }],
3921
- "mask-image-x-to-color": [{ "mask-x-to": P() }],
3920
+ "mask-image-x-from-color": [{ "mask-x-from": M() }],
3921
+ "mask-image-x-to-color": [{ "mask-x-to": M() }],
3922
3922
  "mask-image-y-from-pos": [{ "mask-y-from": B() }],
3923
3923
  "mask-image-y-to-pos": [{ "mask-y-to": B() }],
3924
- "mask-image-y-from-color": [{ "mask-y-from": P() }],
3925
- "mask-image-y-to-color": [{ "mask-y-to": P() }],
3924
+ "mask-image-y-from-color": [{ "mask-y-from": M() }],
3925
+ "mask-image-y-to-color": [{ "mask-y-to": M() }],
3926
3926
  "mask-image-radial": [{ "mask-radial": [X, Y] }],
3927
3927
  "mask-image-radial-from-pos": [{ "mask-radial-from": B() }],
3928
3928
  "mask-image-radial-to-pos": [{ "mask-radial-to": B() }],
3929
- "mask-image-radial-from-color": [{ "mask-radial-from": P() }],
3930
- "mask-image-radial-to-color": [{ "mask-radial-to": P() }],
3929
+ "mask-image-radial-from-color": [{ "mask-radial-from": M() }],
3930
+ "mask-image-radial-to-color": [{ "mask-radial-to": M() }],
3931
3931
  "mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }],
3932
3932
  "mask-image-radial-size": [{ "mask-radial": [{
3933
3933
  closest: ["side", "corner"],
@@ -3937,8 +3937,8 @@ var gi = (e, t) => {
3937
3937
  "mask-image-conic-pos": [{ "mask-conic": [aa] }],
3938
3938
  "mask-image-conic-from-pos": [{ "mask-conic-from": B() }],
3939
3939
  "mask-image-conic-to-pos": [{ "mask-conic-to": B() }],
3940
- "mask-image-conic-from-color": [{ "mask-conic-from": P() }],
3941
- "mask-image-conic-to-color": [{ "mask-conic-to": P() }],
3940
+ "mask-image-conic-from-color": [{ "mask-conic-from": M() }],
3941
+ "mask-image-conic-to-color": [{ "mask-conic-to": M() }],
3942
3942
  "mask-mode": [{ mask: [
3943
3943
  "alpha",
3944
3944
  "luminance",
@@ -3952,9 +3952,9 @@ var gi = (e, t) => {
3952
3952
  "stroke",
3953
3953
  "view"
3954
3954
  ] }],
3955
- "mask-position": [{ mask: F() }],
3956
- "mask-repeat": [{ mask: I() }],
3957
- "mask-size": [{ mask: ne() }],
3955
+ "mask-position": [{ mask: N() }],
3956
+ "mask-repeat": [{ mask: P() }],
3957
+ "mask-size": [{ mask: F() }],
3958
3958
  "mask-type": [{ "mask-type": ["alpha", "luminance"] }],
3959
3959
  "mask-image": [{ mask: [
3960
3960
  "none",
@@ -3985,7 +3985,7 @@ var gi = (e, t) => {
3985
3985
  ka,
3986
3986
  Ca
3987
3987
  ] }],
3988
- "drop-shadow-color": [{ "drop-shadow": P() }],
3988
+ "drop-shadow-color": [{ "drop-shadow": M() }],
3989
3989
  grayscale: [{ grayscale: [
3990
3990
  "",
3991
3991
  aa,
@@ -4145,9 +4145,9 @@ var gi = (e, t) => {
4145
4145
  X,
4146
4146
  Y
4147
4147
  ] }],
4148
- accent: [{ accent: P() }],
4148
+ accent: [{ accent: M() }],
4149
4149
  appearance: [{ appearance: ["none", "auto"] }],
4150
- "caret-color": [{ caret: P() }],
4150
+ "caret-color": [{ caret: M() }],
4151
4151
  "color-scheme": [{ scheme: [
4152
4152
  "normal",
4153
4153
  "dark",
@@ -4205,8 +4205,8 @@ var gi = (e, t) => {
4205
4205
  "x"
4206
4206
  ] }],
4207
4207
  "scroll-behavior": [{ scroll: ["auto", "smooth"] }],
4208
- "scrollbar-thumb-color": [{ "scrollbar-thumb": P() }],
4209
- "scrollbar-track-color": [{ "scrollbar-track": P() }],
4208
+ "scrollbar-thumb-color": [{ "scrollbar-thumb": M() }],
4209
+ "scrollbar-track-color": [{ "scrollbar-track": M() }],
4210
4210
  "scrollbar-gutter": [{ "scrollbar-gutter": [
4211
4211
  "auto",
4212
4212
  "stable",
@@ -4283,14 +4283,14 @@ var gi = (e, t) => {
4283
4283
  X,
4284
4284
  Y
4285
4285
  ] }],
4286
- fill: [{ fill: ["none", ...P()] }],
4286
+ fill: [{ fill: ["none", ...M()] }],
4287
4287
  "stroke-w": [{ stroke: [
4288
4288
  aa,
4289
4289
  wa,
4290
4290
  _a,
4291
4291
  va
4292
4292
  ] }],
4293
- stroke: [{ stroke: ["none", ...P()] }],
4293
+ stroke: [{ stroke: ["none", ...M()] }],
4294
4294
  "forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
4295
4295
  },
4296
4296
  conflictingClassGroups: {
@@ -4692,7 +4692,7 @@ function po({ label: e, values: t, chosen: n, onChange: r }) {
4692
4692
  className: "truncate",
4693
4693
  children: i
4694
4694
  }),
4695
- /* @__PURE__ */ V(I, { className: "h-3 w-3 shrink-0 text-foreground-subtle" })
4695
+ /* @__PURE__ */ V(P, { className: "h-3 w-3 shrink-0 text-foreground-subtle" })
4696
4696
  ]
4697
4697
  }), /* @__PURE__ */ H(Ka, {
4698
4698
  className: "max-h-56 overflow-y-auto",
@@ -4773,27 +4773,27 @@ function go({ field: e, value: t, onChange: n, disabled: r, translationFn: i })
4773
4773
  O,
4774
4774
  o,
4775
4775
  e.suggestLocation
4776
- ]), ee = h(() => [...k.suggested, ...k.others], [k]), te = (t) => {
4776
+ ]), ee = h(() => [...k.suggested, ...k.others], [k]), A = (t) => {
4777
4777
  if (!_) if (g.includes(t)) n(g.filter((e) => e !== t));
4778
4778
  else {
4779
4779
  if (e.maxItems !== void 0 && g.length >= e.maxItems) return;
4780
4780
  n([...g, t]);
4781
4781
  }
4782
- }, A = (e) => {
4782
+ }, te = (e) => {
4783
4783
  if (e.key === "ArrowDown") e.preventDefault(), S(!0), w((e) => ee.length === 0 ? 0 : (e + 1) % ee.length);
4784
4784
  else if (e.key === "ArrowUp") e.preventDefault(), S(!0), w((e) => ee.length === 0 ? 0 : (e - 1 + ee.length) % ee.length);
4785
4785
  else if (e.key === "Enter") {
4786
4786
  e.preventDefault();
4787
4787
  let t = ee[C];
4788
- t && te(t.value);
4788
+ t && A(t.value);
4789
4789
  } else e.key === "Escape" ? S(!1) : e.key === "Backspace" && y === "" && g.length > 0 && n(g.slice(0, -1));
4790
- }, j = Bu(e.label, i), M = Bu(e.description, i);
4790
+ }, ne = Bu(e.label, i), j = Bu(e.description, i);
4791
4791
  return /* @__PURE__ */ H("div", {
4792
4792
  className: "min-w-0",
4793
4793
  children: [
4794
- j !== void 0 && j !== "" && /* @__PURE__ */ V("label", {
4794
+ ne !== void 0 && ne !== "" && /* @__PURE__ */ V("label", {
4795
4795
  className: oo,
4796
- children: j
4796
+ children: ne
4797
4797
  }),
4798
4798
  D.length > 0 && /* @__PURE__ */ V("div", {
4799
4799
  className: "flex flex-wrap gap-1 mb-1.5",
@@ -4806,7 +4806,7 @@ function go({ field: e, value: t, onChange: n, disabled: r, translationFn: i })
4806
4806
  type: "button",
4807
4807
  className: "shrink-0 hover:text-danger",
4808
4808
  "aria-label": `Remove ${e.label}`,
4809
- onClick: () => te(e.value),
4809
+ onClick: () => A(e.value),
4810
4810
  children: /* @__PURE__ */ V(Vr, { className: "h-2.5 w-2.5" })
4811
4811
  })]
4812
4812
  }, e.value))
@@ -4853,9 +4853,9 @@ function go({ field: e, value: t, onChange: n, disabled: r, translationFn: i })
4853
4853
  onBlur: () => {
4854
4854
  E.current = setTimeout(() => S(!1), 120);
4855
4855
  },
4856
- onKeyDown: A
4856
+ onKeyDown: te
4857
4857
  }),
4858
- /* @__PURE__ */ V(I, {
4858
+ /* @__PURE__ */ V(P, {
4859
4859
  className: "h-3.5 w-3.5 shrink-0 cursor-pointer text-foreground-subtle",
4860
4860
  onMouseDown: (e) => {
4861
4861
  e.preventDefault(), E.current && clearTimeout(E.current), S((e) => !e), T.current?.focus();
@@ -4889,7 +4889,7 @@ function go({ field: e, value: t, onChange: n, disabled: r, translationFn: i })
4889
4889
  i ? "opacity-40 cursor-not-allowed" : "cursor-pointer"
4890
4890
  ].join(" "),
4891
4891
  onMouseEnter: () => w(n),
4892
- onClick: () => te(t.value),
4892
+ onClick: () => A(t.value),
4893
4893
  children: [/* @__PURE__ */ V("span", {
4894
4894
  className: ["flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border", r ? "border-primary bg-primary text-white" : "border-border"].join(" "),
4895
4895
  children: r && /* @__PURE__ */ V(mt, { className: "h-2.5 w-2.5" })
@@ -4906,9 +4906,9 @@ function go({ field: e, value: t, onChange: n, disabled: r, translationFn: i })
4906
4906
  })] }, t.value);
4907
4907
  })
4908
4908
  }),
4909
- M && /* @__PURE__ */ V("p", {
4909
+ j && /* @__PURE__ */ V("p", {
4910
4910
  className: so,
4911
- children: M
4911
+ children: j
4912
4912
  })
4913
4913
  ]
4914
4914
  });
@@ -5113,7 +5113,7 @@ async function Uo(t, r, i) {
5113
5113
  if (s) return s;
5114
5114
  zo.has(t) || (Fo(), n([{
5115
5115
  name: t,
5116
- entry: A(i),
5116
+ entry: te(i),
5117
5117
  type: "module"
5118
5118
  }], { force: !1 }), zo.add(t));
5119
5119
  let c = e(`${t}/${r.startsWith("./") ? r.slice(2) : r}`).then((e) => {
@@ -5233,14 +5233,14 @@ function Zo({ deviceId: e }) {
5233
5233
  });
5234
5234
  }, [t, u]);
5235
5235
  let f = /* @__PURE__ */ V(It, { className: "h-3.5 w-3.5 text-foreground-subtle" });
5236
- return n && !t ? /* @__PURE__ */ V(P, {
5236
+ return n && !t ? /* @__PURE__ */ V(M, {
5237
5237
  title: "Autotrack",
5238
5238
  icon: f,
5239
5239
  children: /* @__PURE__ */ H("div", {
5240
5240
  className: "flex items-center gap-2 text-[10.5px] text-foreground-subtle",
5241
5241
  children: [/* @__PURE__ */ V(gn, { className: "h-3 w-3 animate-spin" }), "Loading autotrack…"]
5242
5242
  })
5243
- }) : /* @__PURE__ */ H(P, {
5243
+ }) : /* @__PURE__ */ H(M, {
5244
5244
  title: "Autotrack",
5245
5245
  icon: f,
5246
5246
  headerRight: /* @__PURE__ */ H("button", {
@@ -5569,25 +5569,25 @@ function vs({ deviceId: e }) {
5569
5569
  }
5570
5570
  return 16 / 9;
5571
5571
  }, [r]);
5572
- if (r === void 0) return /* @__PURE__ */ V(P, {
5572
+ if (r === void 0) return /* @__PURE__ */ V(M, {
5573
5573
  title: "Grid layout",
5574
- icon: /* @__PURE__ */ V(re, { className: "h-3.5 w-3.5" }),
5574
+ icon: /* @__PURE__ */ V(z, { className: "h-3.5 w-3.5" }),
5575
5575
  children: /* @__PURE__ */ H("div", {
5576
5576
  className: "flex items-center gap-2 text-[10.5px] text-foreground-subtle",
5577
5577
  children: [/* @__PURE__ */ V(gn, { className: "h-3 w-3 animate-spin" }), " Loading the layout…"]
5578
5578
  })
5579
5579
  });
5580
- if (r === "unreadable") return /* @__PURE__ */ V(P, {
5580
+ if (r === "unreadable") return /* @__PURE__ */ V(M, {
5581
5581
  title: "Grid layout",
5582
- icon: /* @__PURE__ */ V(re, { className: "h-3.5 w-3.5" }),
5582
+ icon: /* @__PURE__ */ V(z, { className: "h-3.5 w-3.5" }),
5583
5583
  children: /* @__PURE__ */ H("div", {
5584
5584
  className: "flex items-center gap-2 text-[10.5px] text-danger",
5585
5585
  children: [/* @__PURE__ */ V(yt, { className: "h-3 w-3" }), "The Camera Grids addon did not answer, so this layout is unknown — not empty."]
5586
5586
  })
5587
5587
  });
5588
- if (r === null || a === null) return /* @__PURE__ */ V(P, {
5588
+ if (r === null || a === null) return /* @__PURE__ */ V(M, {
5589
5589
  title: "Grid layout",
5590
- icon: /* @__PURE__ */ V(re, { className: "h-3.5 w-3.5" }),
5590
+ icon: /* @__PURE__ */ V(z, { className: "h-3.5 w-3.5" }),
5591
5591
  children: /* @__PURE__ */ V("div", {
5592
5592
  className: "text-[10.5px] text-foreground-subtle",
5593
5593
  children: "This camera is not a grid."
@@ -5600,9 +5600,9 @@ function vs({ deviceId: e }) {
5600
5600
  let n = (e.clientX - g.startX) / t.width, r = (e.clientY - g.startY) / t.height;
5601
5601
  S(g.index, { cell: _s(g, n, r) });
5602
5602
  };
5603
- return /* @__PURE__ */ V(P, {
5603
+ return /* @__PURE__ */ V(M, {
5604
5604
  title: "Grid layout",
5605
- icon: /* @__PURE__ */ V(re, { className: "h-3.5 w-3.5" }),
5605
+ icon: /* @__PURE__ */ V(z, { className: "h-3.5 w-3.5" }),
5606
5606
  headerRight: /* @__PURE__ */ H("div", {
5607
5607
  className: "flex items-center gap-1",
5608
5608
  children: [/* @__PURE__ */ H("button", {
@@ -5775,7 +5775,7 @@ function ys({ offers: e, cameras: t, onToggle: n }) {
5775
5775
  });
5776
5776
  }
5777
5777
  function bs({ cell: e, selected: t, onSelect: n, onDragStart: r }) {
5778
- let { src: i } = j(e.deviceId, { width: 640 }), a = `${String(100 / e.source.width)}% ${String(100 / e.source.height)}%`, o = e.source.width >= 1 && e.source.height >= 1 ? "center" : `${String(e.source.x / Math.max(1e-6, 1 - e.source.width) * 100)}% ${String(e.source.y / Math.max(1e-6, 1 - e.source.height) * 100)}%`;
5778
+ let { src: i } = ne(e.deviceId, { width: 640 }), a = `${String(100 / e.source.width)}% ${String(100 / e.source.height)}%`, o = e.source.width >= 1 && e.source.height >= 1 ? "center" : `${String(e.source.x / Math.max(1e-6, 1 - e.source.width) * 100)}% ${String(e.source.y / Math.max(1e-6, 1 - e.source.height) * 100)}%`;
5779
5779
  return /* @__PURE__ */ V("div", {
5780
5780
  role: "presentation",
5781
5781
  onPointerDown: (e) => {
@@ -5866,7 +5866,7 @@ function xs({ cell: e, index: t, cameras: n, onChange: r, onRemove: i }) {
5866
5866
  });
5867
5867
  }
5868
5868
  function Ss({ deviceId: e, source: t, onChange: n }) {
5869
- let { src: r } = j(e, { width: 640 }), [i, a] = l(null), [o, s] = l(null), c = (e) => {
5869
+ let { src: r } = ne(e, { width: 640 }), [i, a] = l(null), [o, s] = l(null), c = (e) => {
5870
5870
  if (i === null) return;
5871
5871
  let t = e.currentTarget.getBoundingClientRect();
5872
5872
  t.width === 0 || t.height === 0 || n(_s({
@@ -6102,7 +6102,7 @@ function As({ deviceId: e }) {
6102
6102
  }
6103
6103
  }
6104
6104
  }, [r]), d = i?.items ?? [];
6105
- return /* @__PURE__ */ V(P, {
6105
+ return /* @__PURE__ */ V(M, {
6106
6106
  title: "Consumables",
6107
6107
  icon: /* @__PURE__ */ V(en, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
6108
6108
  bodyClassName: "p-3 overflow-y-auto",
@@ -6201,7 +6201,7 @@ function Ps(e, t, n) {
6201
6201
  let E = o((e) => x(async () => i?.runAction({ actionId: e })), [i, x]), O = o((e) => x(async () => i?.playSound({ soundId: e })), [i, x]), k = o((e) => x(async () => i?.setLightOn({ on: e })), [i, x]), ee = o((e, t) => x(async () => i?.setLightMode(t === void 0 ? { mode: e } : {
6202
6202
  mode: e,
6203
6203
  level: t
6204
- })), [i, x]), te = o((e) => x(async () => i?.setLightLevel({ level: e })), [i, x]);
6204
+ })), [i, x]), A = o((e) => x(async () => i?.setLightLevel({ level: e })), [i, x]);
6205
6205
  return {
6206
6206
  features: s,
6207
6207
  actions: d,
@@ -6212,7 +6212,7 @@ function Ps(e, t, n) {
6212
6212
  playSound: O,
6213
6213
  setLightOn: k,
6214
6214
  setLightMode: ee,
6215
- setLightLevel: te,
6215
+ setLightLevel: A,
6216
6216
  busy: p,
6217
6217
  error: h,
6218
6218
  driving: _
@@ -6244,7 +6244,7 @@ var Ls = [
6244
6244
  {
6245
6245
  direction: "left",
6246
6246
  label: "Turn left",
6247
- Icon: M
6247
+ Icon: j
6248
6248
  },
6249
6249
  {
6250
6250
  direction: "forward",
@@ -6291,7 +6291,7 @@ function Vs({ deviceId: e }) {
6291
6291
  }
6292
6292
  r.runAction(e.id);
6293
6293
  };
6294
- return /* @__PURE__ */ H(P, {
6294
+ return /* @__PURE__ */ H(M, {
6295
6295
  title: "Navigation",
6296
6296
  icon: /* @__PURE__ */ V(Nn, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
6297
6297
  bodyClassName: "p-3 flex flex-col gap-3 overflow-y-auto",
@@ -6767,22 +6767,22 @@ function Ks({ direction: e, icon: t, disabled: n, className: r, variant: i, onMo
6767
6767
  });
6768
6768
  }
6769
6769
  function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0, showHome: i = !0, className: a }) {
6770
- let { move: s, startContinuous: d, stopContinuous: f, zoom: p, goHome: m, homePreset: h, goToPreset: g, savePreset: _, updatePreset: y, deletePreset: b, presets: x, options: S, busy: C, error: w } = e, T = wo(), [E, D] = l(!1), [O, k] = l(""), ee = u(null), te = u(null), [A, j] = l(null), M = t === "panel", N = r && (S?.hasZoom ?? !0), P = S?.supportsPresets ?? x.length > 0, F = (n ?? P) && P, ne = M && (S?.supportsPresets ?? !1), L = S?.maxPresets !== void 0 && x.length >= S.maxPresets, R = o(async () => {
6770
+ let { move: s, startContinuous: d, stopContinuous: f, zoom: p, goHome: m, homePreset: h, goToPreset: g, savePreset: _, updatePreset: y, deletePreset: b, presets: x, options: S, busy: C, error: w } = e, T = wo(), [E, D] = l(!1), [O, k] = l(""), ee = u(null), A = u(null), [te, ne] = l(null), j = t === "panel", re = r && (S?.hasZoom ?? !0), M = S?.supportsPresets ?? x.length > 0, N = (n ?? M) && M, F = j && (S?.supportsPresets ?? !1), I = S?.maxPresets !== void 0 && x.length >= S.maxPresets, L = o(async () => {
6771
6771
  let e = O.trim();
6772
- !e || C || L || await _(e) !== void 0 && k("");
6772
+ !e || C || I || await _(e) !== void 0 && k("");
6773
6773
  }, [
6774
6774
  O,
6775
6775
  C,
6776
- L,
6776
+ I,
6777
6777
  _
6778
- ]), z = o(async (e, t) => {
6778
+ ]), R = o(async (e, t) => {
6779
6779
  await T({
6780
6780
  title: "Delete preset",
6781
6781
  message: `Delete PTZ preset "${t}"? This removes it from the camera.`,
6782
6782
  confirmLabel: "Delete",
6783
6783
  variant: "danger"
6784
6784
  }) && await b(e);
6785
- }, [T, b]), re = o(async (e, t) => {
6785
+ }, [T, b]), z = o(async (e, t) => {
6786
6786
  await T({
6787
6787
  title: "Update preset",
6788
6788
  message: `Overwrite preset "${t}" with the camera's current position?`,
@@ -6791,12 +6791,12 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6791
6791
  }, [T, y]);
6792
6792
  c(() => {
6793
6793
  if (!E) {
6794
- j(null);
6794
+ ne(null);
6795
6795
  return;
6796
6796
  }
6797
6797
  let e = () => {
6798
6798
  let e = ee.current?.getBoundingClientRect();
6799
- e && j({
6799
+ e && ne({
6800
6800
  top: e.bottom + 4,
6801
6801
  right: window.innerWidth - e.right
6802
6802
  });
@@ -6808,7 +6808,7 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6808
6808
  if (!E) return;
6809
6809
  let e = (e) => {
6810
6810
  let t = e.target;
6811
- te.current?.contains(t) || ee.current?.contains(t) || D(!1);
6811
+ A.current?.contains(t) || ee.current?.contains(t) || D(!1);
6812
6812
  }, t = (e) => {
6813
6813
  e.key === "Escape" && D(!1);
6814
6814
  };
@@ -6816,21 +6816,21 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6816
6816
  document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
6817
6817
  };
6818
6818
  }, [E]);
6819
- let ie = M ? "flex flex-col items-stretch gap-2 w-full h-full p-3" : "pointer-events-auto absolute top-3 right-3 z-10 flex flex-col items-end gap-2", B = Z(M ? "flex items-center gap-3 rounded-lg p-2" : "flex items-center gap-2 rounded-lg border border-white/30 bg-zinc-900/90 backdrop-blur-md p-2 shadow-lg shadow-black/40", C && "ring-1 ring-primary/40"), ae = M ? "h-9 w-9" : "h-7 w-7", oe = M ? "h-4 w-4" : "h-3.5 w-3.5", se = M ? "text-foreground hover:bg-surface-hover" : "text-white hover:bg-white/15", le = M ? "h-12 w-px bg-border mx-1" : "h-12 w-px bg-white/15 mx-1";
6819
+ let ie = j ? "flex flex-col items-stretch gap-2 w-full h-full p-3" : "pointer-events-auto absolute top-3 right-3 z-10 flex flex-col items-end gap-2", B = Z(j ? "flex items-center gap-3 rounded-lg p-2" : "flex items-center gap-2 rounded-lg border border-white/30 bg-zinc-900/90 backdrop-blur-md p-2 shadow-lg shadow-black/40", C && "ring-1 ring-primary/40"), ae = j ? "h-9 w-9" : "h-7 w-7", oe = j ? "h-4 w-4" : "h-3.5 w-3.5", se = j ? "text-foreground hover:bg-surface-hover" : "text-white hover:bg-white/15", le = j ? "h-12 w-px bg-border mx-1" : "h-12 w-px bg-white/15 mx-1";
6820
6820
  return /* @__PURE__ */ H("div", {
6821
6821
  className: Z(ie, a),
6822
6822
  children: [w && /* @__PURE__ */ H("div", {
6823
6823
  className: "rounded bg-danger/90 px-2 py-1 text-[10px] font-medium text-white shadow-lg max-w-[200px] self-center",
6824
6824
  children: ["PTZ: ", w]
6825
6825
  }), /* @__PURE__ */ H("div", {
6826
- className: Z(B, M && "justify-center"),
6826
+ className: Z(B, j && "justify-center"),
6827
6827
  children: [
6828
6828
  /* @__PURE__ */ H("div", {
6829
6829
  className: "grid grid-cols-3 gap-0.5",
6830
6830
  children: [
6831
6831
  /* @__PURE__ */ V("span", {
6832
6832
  "aria-hidden": !0,
6833
- className: M ? "h-9 w-9" : "h-7 w-7"
6833
+ className: j ? "h-9 w-9" : "h-7 w-7"
6834
6834
  }),
6835
6835
  /* @__PURE__ */ V(Ks, {
6836
6836
  direction: "up",
@@ -6842,7 +6842,7 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6842
6842
  }),
6843
6843
  /* @__PURE__ */ V("span", {
6844
6844
  "aria-hidden": !0,
6845
- className: M ? "h-9 w-9" : "h-7 w-7"
6845
+ className: j ? "h-9 w-9" : "h-7 w-7"
6846
6846
  }),
6847
6847
  /* @__PURE__ */ V(Ks, {
6848
6848
  direction: "left",
@@ -6854,7 +6854,7 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6854
6854
  }),
6855
6855
  /* @__PURE__ */ V("span", {
6856
6856
  "aria-hidden": !0,
6857
- className: M ? "h-9 w-9" : "h-7 w-7"
6857
+ className: j ? "h-9 w-9" : "h-7 w-7"
6858
6858
  }),
6859
6859
  /* @__PURE__ */ V(Ks, {
6860
6860
  direction: "right",
@@ -6866,7 +6866,7 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6866
6866
  }),
6867
6867
  /* @__PURE__ */ V("span", {
6868
6868
  "aria-hidden": !0,
6869
- className: M ? "h-9 w-9" : "h-7 w-7"
6869
+ className: j ? "h-9 w-9" : "h-7 w-7"
6870
6870
  }),
6871
6871
  /* @__PURE__ */ V(Ks, {
6872
6872
  direction: "down",
@@ -6878,14 +6878,14 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6878
6878
  }),
6879
6879
  /* @__PURE__ */ V("span", {
6880
6880
  "aria-hidden": !0,
6881
- className: M ? "h-9 w-9" : "h-7 w-7"
6881
+ className: j ? "h-9 w-9" : "h-7 w-7"
6882
6882
  })
6883
6883
  ]
6884
6884
  }),
6885
- (N || i) && /* @__PURE__ */ V("div", { className: le }),
6885
+ (re || i) && /* @__PURE__ */ V("div", { className: le }),
6886
6886
  /* @__PURE__ */ H("div", {
6887
6887
  className: "flex flex-col gap-0.5",
6888
- children: [N && /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ V("button", {
6888
+ children: [re && /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ V("button", {
6889
6889
  type: "button",
6890
6890
  onClick: () => p("in"),
6891
6891
  disabled: C,
@@ -6908,58 +6908,58 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6908
6908
  children: /* @__PURE__ */ V(sn, { className: oe })
6909
6909
  })]
6910
6910
  }),
6911
- F && /* @__PURE__ */ H("div", {
6911
+ N && /* @__PURE__ */ H("div", {
6912
6912
  className: "relative",
6913
6913
  children: [/* @__PURE__ */ H("button", {
6914
6914
  ref: ee,
6915
6915
  type: "button",
6916
6916
  onClick: () => D((e) => !e),
6917
6917
  disabled: C,
6918
- className: Z("flex items-center gap-1 rounded px-2 text-[10px] disabled:opacity-40", M ? "h-9 text-foreground hover:bg-surface-hover" : "h-7 text-white hover:bg-white/15"),
6918
+ className: Z("flex items-center gap-1 rounded px-2 text-[10px] disabled:opacity-40", j ? "h-9 text-foreground hover:bg-surface-hover" : "h-7 text-white hover:bg-white/15"),
6919
6919
  title: "Presets",
6920
- children: ["Presets", /* @__PURE__ */ V(I, { className: Z("h-3 w-3 transition-transform", E && "rotate-180") })]
6921
- }), E && A && ce(/* @__PURE__ */ H("div", {
6922
- ref: te,
6920
+ children: ["Presets", /* @__PURE__ */ V(P, { className: Z("h-3 w-3 transition-transform", E && "rotate-180") })]
6921
+ }), E && te && ce(/* @__PURE__ */ H("div", {
6922
+ ref: A,
6923
6923
  style: {
6924
6924
  position: "fixed",
6925
- top: A.top,
6926
- right: A.right,
6925
+ top: te.top,
6926
+ right: te.right,
6927
6927
  zIndex: 60
6928
6928
  },
6929
- className: Z("rounded-lg shadow-xl py-1", ne ? "min-w-[220px]" : "min-w-[140px]", M ? "bg-surface border border-border" : "border border-white/30 bg-zinc-900/95 backdrop-blur-md"),
6929
+ className: Z("rounded-lg shadow-xl py-1", F ? "min-w-[220px]" : "min-w-[140px]", j ? "bg-surface border border-border" : "border border-white/30 bg-zinc-900/95 backdrop-blur-md"),
6930
6930
  children: [
6931
6931
  x.length === 0 && /* @__PURE__ */ V("div", {
6932
- className: Z("px-3 py-1.5 text-[10px]", M ? "text-foreground-subtle" : "text-white/60"),
6932
+ className: Z("px-3 py-1.5 text-[10px]", j ? "text-foreground-subtle" : "text-white/60"),
6933
6933
  children: "No presets yet"
6934
6934
  }),
6935
6935
  x.map((e) => /* @__PURE__ */ H("div", {
6936
- className: Z("group flex items-center", M ? "hover:bg-surface-hover" : "hover:bg-white/15"),
6936
+ className: Z("group flex items-center", j ? "hover:bg-surface-hover" : "hover:bg-white/15"),
6937
6937
  children: [/* @__PURE__ */ V("button", {
6938
6938
  type: "button",
6939
6939
  onClick: () => {
6940
6940
  g(e.id), D(!1);
6941
6941
  },
6942
6942
  disabled: C,
6943
- className: Z("flex-1 px-3 py-1.5 text-left text-[10px] disabled:opacity-40", M ? "text-foreground" : "text-white"),
6943
+ className: Z("flex-1 px-3 py-1.5 text-left text-[10px] disabled:opacity-40", j ? "text-foreground" : "text-white"),
6944
6944
  children: e.name || e.id
6945
- }), ne && e.writable && /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ V("button", {
6945
+ }), F && e.writable && /* @__PURE__ */ H(U, { children: [/* @__PURE__ */ V("button", {
6946
6946
  type: "button",
6947
- onClick: () => void re(e.id, e.name || e.id),
6947
+ onClick: () => void z(e.id, e.name || e.id),
6948
6948
  disabled: C,
6949
6949
  title: `Overwrite "${e.name || e.id}" with current position`,
6950
6950
  className: Z("flex h-5 w-5 shrink-0 items-center justify-center rounded", "text-foreground-subtle hover:bg-primary/15 hover:text-primary disabled:opacity-40"),
6951
6951
  children: /* @__PURE__ */ V(It, { className: "h-3 w-3" })
6952
6952
  }), /* @__PURE__ */ V("button", {
6953
6953
  type: "button",
6954
- onClick: () => void z(e.id, e.name || e.id),
6954
+ onClick: () => void R(e.id, e.name || e.id),
6955
6955
  disabled: C,
6956
6956
  title: `Delete preset ${e.name || e.id}`,
6957
6957
  className: Z("mr-1 flex h-5 w-5 shrink-0 items-center justify-center rounded", "text-foreground-subtle hover:bg-danger/15 hover:text-danger disabled:opacity-40"),
6958
6958
  children: /* @__PURE__ */ V(Vr, { className: "h-3 w-3" })
6959
6959
  })] })]
6960
6960
  }, e.id)),
6961
- ne && /* @__PURE__ */ H(U, { children: [
6962
- x.length > 0 && /* @__PURE__ */ V("div", { className: Z("my-1 h-px", M ? "bg-border" : "bg-white/15") }),
6961
+ F && /* @__PURE__ */ H(U, { children: [
6962
+ x.length > 0 && /* @__PURE__ */ V("div", { className: Z("my-1 h-px", j ? "bg-border" : "bg-white/15") }),
6963
6963
  /* @__PURE__ */ H("div", {
6964
6964
  className: "flex items-center gap-1 px-2 py-1",
6965
6965
  children: [/* @__PURE__ */ V("input", {
@@ -6967,23 +6967,23 @@ function qs({ controls: e, mode: t = "overlay", showPresets: n, showZoom: r = !0
6967
6967
  value: O,
6968
6968
  onChange: (e) => k(e.target.value),
6969
6969
  onKeyDown: (e) => {
6970
- e.key === "Enter" && R();
6970
+ e.key === "Enter" && L();
6971
6971
  },
6972
- disabled: C || L,
6972
+ disabled: C || I,
6973
6973
  placeholder: "New preset name",
6974
6974
  maxLength: 64,
6975
- className: Z("min-w-0 flex-1 rounded border px-2 py-1 text-[11px]", "focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-40", M ? "border-border bg-surface text-foreground placeholder:text-foreground-subtle" : "border-white/30 bg-zinc-800 text-white placeholder:text-white/40")
6975
+ className: Z("min-w-0 flex-1 rounded border px-2 py-1 text-[11px]", "focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-40", j ? "border-border bg-surface text-foreground placeholder:text-foreground-subtle" : "border-white/30 bg-zinc-800 text-white placeholder:text-white/40")
6976
6976
  }), /* @__PURE__ */ V("button", {
6977
6977
  type: "button",
6978
- onClick: () => void R(),
6979
- disabled: C || L || O.trim().length === 0,
6980
- title: L ? `Camera preset limit reached (${S?.maxPresets})` : "Save current position as a new preset",
6978
+ onClick: () => void L(),
6979
+ disabled: C || I || O.trim().length === 0,
6980
+ title: I ? `Camera preset limit reached (${S?.maxPresets})` : "Save current position as a new preset",
6981
6981
  className: Z("flex h-7 w-7 shrink-0 items-center justify-center rounded", "bg-primary/15 text-primary hover:bg-primary/25 disabled:opacity-40"),
6982
6982
  children: /* @__PURE__ */ V(Hn, { className: "h-3.5 w-3.5" })
6983
6983
  })]
6984
6984
  }),
6985
- L && /* @__PURE__ */ H("span", {
6986
- className: Z("block px-2 pb-1 text-[10px]", M ? "text-foreground-subtle" : "text-white/60"),
6985
+ I && /* @__PURE__ */ H("span", {
6986
+ className: Z("block px-2 pb-1 text-[10px]", j ? "text-foreground-subtle" : "text-white/60"),
6987
6987
  children: [
6988
6988
  "Preset limit reached (",
6989
6989
  S?.maxPresets,
@@ -7055,7 +7055,7 @@ function Ys({ deviceId: e }) {
7055
7055
  ]
7056
7056
  });
7057
7057
  let i = r.options?.hasAutofocus === !0;
7058
- return /* @__PURE__ */ H(P, {
7058
+ return /* @__PURE__ */ H(M, {
7059
7059
  title: "PTZ",
7060
7060
  icon: /* @__PURE__ */ V(jn, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
7061
7061
  bodyClassName: "p-3 flex flex-col overflow-y-auto",
@@ -8184,7 +8184,7 @@ function Zc({ day: e, onDayChange: t, view: n, dayBounds: r, onViewChange: i })
8184
8184
  title: "Later (pan forward)",
8185
8185
  "aria-label": "Pan later",
8186
8186
  className: "rounded p-1 text-foreground-subtle transition-colors hover:bg-background/60 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40",
8187
- children: /* @__PURE__ */ V(N, { size: 14 })
8187
+ children: /* @__PURE__ */ V(re, { size: 14 })
8188
8188
  }),
8189
8189
  /* @__PURE__ */ V("span", {
8190
8190
  className: "mx-0.5 h-3 w-px bg-border",
@@ -8260,36 +8260,36 @@ function ol({ deviceId: e }) {
8260
8260
  }
8261
8261
  }), [g]), T = u(_);
8262
8262
  T.current = _;
8263
- let { state: D, beginScrub: O, updateScrub: k, endScrub: ee, seek: te, setPlayhead: A, reset: j } = Cc(w, o(() => T.current === "live", []));
8263
+ let { state: D, beginScrub: O, updateScrub: k, endScrub: ee, seek: A, setPlayhead: te, reset: ne } = Cc(w, o(() => T.current === "live", []));
8264
8264
  v(() => {
8265
- y !== null && A(y);
8266
- }, [y, A]), v(() => {
8267
- (!m.channelOpen || _ === "live") && j();
8265
+ y !== null && te(y);
8266
+ }, [y, te]), v(() => {
8267
+ (!m.channelOpen || _ === "live") && ne();
8268
8268
  }, [
8269
8269
  m.channelOpen,
8270
8270
  _,
8271
- j
8271
+ ne
8272
8272
  ]);
8273
- let M = o(() => {
8274
- g({ t: "goLive" }), j();
8275
- }, [g, j]), N = o(() => {
8273
+ let j = o(() => {
8274
+ g({ t: "goLive" }), ne();
8275
+ }, [g, ne]), re = o(() => {
8276
8276
  g({
8277
8277
  t: "setRate",
8278
8278
  rate: +(T.current === "paused")
8279
8279
  });
8280
- }, [g]), [P, F] = l(() => new Set($c)), I = o((e) => {
8281
- F((t) => {
8280
+ }, [g]), [M, N] = l(() => new Set($c)), P = o((e) => {
8281
+ N((t) => {
8282
8282
  let n = new Set(t);
8283
8283
  return n.has(e) ? n.delete(e) : n.add(e), n;
8284
8284
  });
8285
- }, []), [ne, L] = l(el), R = o(() => {
8286
- L((e) => e + el);
8285
+ }, []), [F, I] = l(el), L = o(() => {
8286
+ I((e) => e + el);
8287
8287
  }, []);
8288
8288
  v(() => {
8289
- L(el);
8289
+ I(el);
8290
8290
  }, [r]);
8291
- let [z, re] = l(() => /* @__PURE__ */ new Date()), [ie, B] = l(() => Pc(/* @__PURE__ */ new Date(), Date.now())), ae = h(() => Pc(z, Date.now()), [z]), oe = o((e) => {
8292
- re(e), B(Pc(e, Date.now())), i(null);
8291
+ let [R, z] = l(() => /* @__PURE__ */ new Date()), [ie, B] = l(() => Pc(/* @__PURE__ */ new Date(), Date.now())), ae = h(() => Pc(R, Date.now()), [R]), oe = o((e) => {
8292
+ z(e), B(Pc(e, Date.now())), i(null);
8293
8293
  }, []), U = o((e) => {
8294
8294
  B(e), i(null);
8295
8295
  }, []), se = u(null), ce = o((e) => {
@@ -8315,38 +8315,38 @@ function ol({ deviceId: e }) {
8315
8315
  deviceId: e,
8316
8316
  since: ge,
8317
8317
  until: _e,
8318
- limit: ne,
8318
+ limit: F,
8319
8319
  projection: "slim"
8320
- }, { enabled: he && P.has("object") }), ye = ti({
8320
+ }, { enabled: he && M.has("object") }), ye = ti({
8321
8321
  deviceId: e,
8322
8322
  since: ge,
8323
8323
  until: _e,
8324
- limit: ne,
8324
+ limit: F,
8325
8325
  projection: "slim"
8326
- }, { enabled: he && P.has("motion") }), G = ri({
8326
+ }, { enabled: he && M.has("motion") }), G = ri({
8327
8327
  deviceId: e,
8328
8328
  since: ge,
8329
8329
  until: _e,
8330
- limit: ne,
8330
+ limit: F,
8331
8331
  projection: "slim"
8332
- }, { enabled: he && P.has("audio") }), be = h(() => {
8332
+ }, { enabled: he && M.has("audio") }), be = h(() => {
8333
8333
  if (!W) return [];
8334
8334
  let e = [];
8335
- if (P.has("object")) for (let t of ve.data ?? []) e.push({
8335
+ if (M.has("object")) for (let t of ve.data ?? []) e.push({
8336
8336
  id: String(t.id),
8337
8337
  timestamp: t.timestamp,
8338
8338
  kind: "object",
8339
8339
  label: t.label ?? t.className,
8340
8340
  mediaUrl: t.mediaUrl
8341
8341
  });
8342
- if (P.has("motion")) for (let t of ye.data ?? []) e.push({
8342
+ if (M.has("motion")) for (let t of ye.data ?? []) e.push({
8343
8343
  id: String(t.id),
8344
8344
  timestamp: t.timestamp,
8345
8345
  kind: "motion",
8346
8346
  label: `Motion (${t.regionCount})`,
8347
8347
  mediaUrl: t.mediaUrl
8348
8348
  });
8349
- if (P.has("audio")) for (let t of G.data ?? []) e.push({
8349
+ if (M.has("audio")) for (let t of G.data ?? []) e.push({
8350
8350
  id: String(t.id),
8351
8351
  timestamp: t.timestamp,
8352
8352
  kind: "audio",
@@ -8356,16 +8356,16 @@ function ol({ deviceId: e }) {
8356
8356
  return e.toSorted((e, t) => t.timestamp - e.timestamp);
8357
8357
  }, [
8358
8358
  W,
8359
- P,
8359
+ M,
8360
8360
  ve.data,
8361
8361
  ye.data,
8362
8362
  G.data
8363
- ]), xe = h(() => !!(P.has("object") && (ve.data?.length ?? 0) === ne || P.has("motion") && (ye.data?.length ?? 0) === ne || P.has("audio") && (G.data?.length ?? 0) === ne), [
8364
- P,
8363
+ ]), xe = h(() => !!(M.has("object") && (ve.data?.length ?? 0) === F || M.has("motion") && (ye.data?.length ?? 0) === F || M.has("audio") && (G.data?.length ?? 0) === F), [
8364
+ M,
8365
8365
  ve.data,
8366
8366
  ye.data,
8367
8367
  G.data,
8368
- ne
8368
+ F
8369
8369
  ]), Se = o(async (r, i, a, o, c) => {
8370
8370
  d(r), p(null);
8371
8371
  try {
@@ -8391,7 +8391,7 @@ function ol({ deviceId: e }) {
8391
8391
  let t = Mc(e, pe);
8392
8392
  if (!t) return;
8393
8393
  if (C.current) {
8394
- te(t.fromMs, "timeline");
8394
+ A(t.fromMs, "timeline");
8395
8395
  return;
8396
8396
  }
8397
8397
  let n = `Recording · ${new Date(t.fromMs).toLocaleString(void 0, {
@@ -8404,7 +8404,7 @@ function ol({ deviceId: e }) {
8404
8404
  }, [
8405
8405
  pe,
8406
8406
  Se,
8407
- te
8407
+ A
8408
8408
  ]), we = o(() => {
8409
8409
  O("timeline");
8410
8410
  }, [O]), Te = o((e) => {
@@ -8413,7 +8413,7 @@ function ol({ deviceId: e }) {
8413
8413
  ee(Mc(e, pe)?.fromMs ?? e, "timeline");
8414
8414
  }, [pe, ee]), De = o((e) => {
8415
8415
  if (C.current) {
8416
- te(e.timestamp - nl, "timeline");
8416
+ A(e.timestamp - nl, "timeline");
8417
8417
  return;
8418
8418
  }
8419
8419
  let t = `${e.label} · ${new Date(e.timestamp).toLocaleTimeString(void 0, {
@@ -8421,7 +8421,7 @@ function ol({ deviceId: e }) {
8421
8421
  minute: "2-digit"
8422
8422
  })}`;
8423
8423
  Se(`${e.kind}:${e.id}`, e.timestamp - nl, e.timestamp + rl, t, e.timestamp);
8424
- }, [Se, te]), Oe = o((e) => {
8424
+ }, [Se, A]), Oe = o((e) => {
8425
8425
  i((t) => t === e ? null : e);
8426
8426
  }, []), ke = ue.isLoading, Ae = de.isLoading, je = (ve.isLoading || ye.isLoading || G.isLoading) && he, Me = h(() => Bc(ie.fromMs, ie.toMs, 5), [ie.fromMs, ie.toMs]), Ne = S ? D.scrubbing ? D.scrubEpoch : D.playheadEpoch : a, Pe = S && (_ === "playing" || _ === "paused");
8427
8427
  return /* @__PURE__ */ H("div", {
@@ -8436,7 +8436,7 @@ function ol({ deviceId: e }) {
8436
8436
  message: f
8437
8437
  }) : null,
8438
8438
  /* @__PURE__ */ V(Zc, {
8439
- day: z,
8439
+ day: R,
8440
8440
  onDayChange: oe,
8441
8441
  view: ie,
8442
8442
  dayBounds: ae,
@@ -8458,7 +8458,7 @@ function ol({ deviceId: e }) {
8458
8458
  Pe ? /* @__PURE__ */ H("button", {
8459
8459
  type: "button",
8460
8460
  "data-testid": "frame-push-rate-toggle",
8461
- onClick: N,
8461
+ onClick: re,
8462
8462
  className: "inline-flex items-center gap-1 rounded px-1.5 py-0.5 font-medium text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground",
8463
8463
  title: _ === "paused" ? "Resume playback" : "Pause playback",
8464
8464
  children: [V(_ === "paused" ? Vn : In, { className: "h-3 w-3" }), _ === "paused" ? "Resume" : "Pause"]
@@ -8466,7 +8466,7 @@ function ol({ deviceId: e }) {
8466
8466
  S && _ !== "live" ? /* @__PURE__ */ H("button", {
8467
8467
  type: "button",
8468
8468
  "data-testid": "frame-push-go-live",
8469
- onClick: M,
8469
+ onClick: j,
8470
8470
  className: "inline-flex items-center gap-1 rounded bg-danger/10 px-1.5 py-0.5 font-medium text-danger transition-colors hover:bg-danger/20",
8471
8471
  title: "Return to the live stream",
8472
8472
  children: [/* @__PURE__ */ V(Gn, { className: "h-3 w-3" }), "Go live"]
@@ -8535,10 +8535,10 @@ function ol({ deviceId: e }) {
8535
8535
  loading: je,
8536
8536
  busyKey: c,
8537
8537
  onPlay: De,
8538
- enabledKinds: P,
8539
- onToggleKind: I,
8538
+ enabledKinds: M,
8539
+ onToggleKind: P,
8540
8540
  hasMore: xe,
8541
- onLoadMore: R
8541
+ onLoadMore: L
8542
8542
  }) : /* @__PURE__ */ V("p", {
8543
8543
  className: "text-[11px] text-foreground-subtle",
8544
8544
  children: S ? "Click or drag the coverage bar to play from any point (frames play in the main player above), or click a density bar to browse that window’s events." : "Click the coverage bar to play from any point, or a density bar to browse that window’s events."
@@ -8577,7 +8577,7 @@ function ll({ deviceId: e }) {
8577
8577
  }), _ = n.data ? _e.safeParse(n.data) : null, v = _?.success ? _.data : null, y = r.data ? ge.safeParse(r.data) : null, b = y?.success ? y.data : null, x = g.data?.ranges ?? [], S = x.reduce((e, t) => e + Math.max(0, t.endMs - t.startMs), 0), C = v?.enabled === !0 && v.activeMode === "continuous";
8578
8578
  return /* @__PURE__ */ H("div", {
8579
8579
  className: "space-y-3",
8580
- children: [/* @__PURE__ */ V(P, {
8580
+ children: [/* @__PURE__ */ V(M, {
8581
8581
  title: "Settings",
8582
8582
  icon: /* @__PURE__ */ V(er, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
8583
8583
  children: b ? /* @__PURE__ */ V(fc, {
@@ -8594,7 +8594,7 @@ function ll({ deviceId: e }) {
8594
8594
  className: "px-1 py-2 text-xs text-foreground-subtle",
8595
8595
  children: "Loading settings…"
8596
8596
  })
8597
- }), /* @__PURE__ */ V(P, {
8597
+ }), /* @__PURE__ */ V(M, {
8598
8598
  title: "Recording",
8599
8599
  icon: /* @__PURE__ */ V(qt, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
8600
8600
  headerRight: /* @__PURE__ */ H("span", {
@@ -8617,18 +8617,18 @@ function ll({ deviceId: e }) {
8617
8617
  /* @__PURE__ */ H("div", {
8618
8618
  className: "grid grid-cols-1 gap-2 sm:grid-cols-3",
8619
8619
  children: [
8620
- /* @__PURE__ */ V(ne, {
8620
+ /* @__PURE__ */ V(F, {
8621
8621
  label: "Status",
8622
8622
  icon: /* @__PURE__ */ V(St, { className: `h-3.5 w-3.5 ${C ? "text-emerald-500" : ""}` }),
8623
8623
  footer: v?.nodeId ? `node: ${v.nodeId}` : void 0,
8624
8624
  children: n.isLoading ? "…" : C ? "Recording (continuous)" : "Idle"
8625
8625
  }),
8626
- /* @__PURE__ */ V(ne, {
8626
+ /* @__PURE__ */ V(F, {
8627
8627
  label: "Storage",
8628
8628
  icon: /* @__PURE__ */ V(an, { className: "h-3.5 w-3.5" }),
8629
8629
  children: v ? Oc(v.storageBytes) : "—"
8630
8630
  }),
8631
- /* @__PURE__ */ V(ne, {
8631
+ /* @__PURE__ */ V(F, {
8632
8632
  label: "Recorded (24h)",
8633
8633
  icon: /* @__PURE__ */ V(Tt, { className: "h-3.5 w-3.5" }),
8634
8634
  footer: `${x.length} segment range${x.length === 1 ? "" : "s"}`,
@@ -9982,7 +9982,7 @@ function iu({ field: e, value: t, onChange: n, disabled: r, translationFn: i })
9982
9982
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",
9983
9983
  tabIndex: -1,
9984
9984
  onClick: () => o((e) => !e),
9985
- children: V(a ? R : Wt, { className: "h-3.5 w-3.5" })
9985
+ children: V(a ? L : Wt, { className: "h-3.5 w-3.5" })
9986
9986
  })]
9987
9987
  })
9988
9988
  });
@@ -11409,7 +11409,7 @@ function Ku({ trpc: e, addonId: t, nodeId: n, title: r, disabled: i, onAfterChan
11409
11409
  f,
11410
11410
  JSON.stringify(T)
11411
11411
  ]);
11412
- let k = h(() => Wu(p), [p]), ee = h(() => p ? Gu(p) : null, [p]), te = async (r) => {
11412
+ let k = h(() => Wu(p), [p]), ee = h(() => p ? Gu(p) : null, [p]), A = async (r) => {
11413
11413
  if (f === "override") {
11414
11414
  let e = D ?? k, t = {};
11415
11415
  for (let n of Object.keys(r)) r[n] !== e[n] && (t[n] = r[n]);
@@ -11467,16 +11467,16 @@ function Ku({ trpc: e, addonId: t, nodeId: n, title: r, disabled: i, onAfterChan
11467
11467
  "."
11468
11468
  ]
11469
11469
  });
11470
- let A = f === "override" ? {
11470
+ let te = f === "override" ? {
11471
11471
  ...k,
11472
11472
  ...T
11473
- } : k, j = /* @__PURE__ */ H(U, { children: [f === "override" ? /* @__PURE__ */ V("div", {
11473
+ } : k, ne = /* @__PURE__ */ H(U, { children: [f === "override" ? /* @__PURE__ */ V("div", {
11474
11474
  className: "mb-2 text-[11px] text-foreground-subtle",
11475
11475
  children: "Benchmark override — applies to this run only. The addon's saved settings are not changed."
11476
11476
  }) : null, /* @__PURE__ */ V(Hu, {
11477
11477
  schema: ee,
11478
- values: A,
11479
- onChange: te,
11478
+ values: te,
11479
+ onChange: A,
11480
11480
  disabled: i === !0 || x
11481
11481
  })] });
11482
11482
  return s === !0 ? /* @__PURE__ */ H("section", {
@@ -11499,7 +11499,7 @@ function Ku({ trpc: e, addonId: t, nodeId: n, title: r, disabled: i, onAfterChan
11499
11499
  ]
11500
11500
  }), C ? /* @__PURE__ */ V("div", {
11501
11501
  className: "border-t border-border px-4 py-3",
11502
- children: j
11502
+ children: ne
11503
11503
  }) : null]
11504
11504
  }) : r ? /* @__PURE__ */ H("section", {
11505
11505
  className: "rounded-lg border border-border bg-surface overflow-hidden",
@@ -11511,9 +11511,9 @@ function Ku({ trpc: e, addonId: t, nodeId: n, title: r, disabled: i, onAfterChan
11511
11511
  })
11512
11512
  }), /* @__PURE__ */ V("div", {
11513
11513
  className: "px-4 py-3",
11514
- children: j
11514
+ children: ne
11515
11515
  })]
11516
- }) : /* @__PURE__ */ V("div", { children: j });
11516
+ }) : /* @__PURE__ */ V("div", { children: ne });
11517
11517
  }
11518
11518
  //#endregion
11519
11519
  //#region ../ui-library/src/primitives/collapsible-card.tsx
@@ -11530,7 +11530,7 @@ function qu({ expanded: e, onExpandedChange: t, header: n, children: r, dimmed:
11530
11530
  },
11531
11531
  children: [!a && /* @__PURE__ */ V("span", {
11532
11532
  className: "text-foreground-subtle shrink-0",
11533
- children: V(e ? I : N, { className: "h-4 w-4" })
11533
+ children: V(e ? P : re, { className: "h-4 w-4" })
11534
11534
  }), n]
11535
11535
  }), e && r && /* @__PURE__ */ V("div", {
11536
11536
  className: "border-t border-border px-3 py-3",
@@ -12285,7 +12285,7 @@ var wd = g(({ className: e, options: t, disabled: n, ...r }, i) => /* @__PURE__
12285
12285
  }, e.value))
12286
12286
  }), /* @__PURE__ */ V("div", {
12287
12287
  className: Z("absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted", n === !0 ? "opacity-50" : ""),
12288
- children: /* @__PURE__ */ V(I, { className: "h-3.5 w-3.5" })
12288
+ children: /* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" })
12289
12289
  })]
12290
12290
  }));
12291
12291
  //#endregion
@@ -13387,90 +13387,90 @@ function Vf(e, t, n, r) {
13387
13387
  return r ? Zd(i) : i;
13388
13388
  }
13389
13389
  var Hf = 8e3;
13390
- function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i = !0, showControls: a = !0, showStats: s = !1, onPlaybackStats: c, onClientNetworkSample: d, onConnectTiming: f, className: p = "", onStateChange: m, onError: h, onReconnectAttempt: g, overlay: _, createSession: y, sendAnswer: b, handleOffer: x, getIceServers: S, addIceCandidate: C, getIceCandidates: w, closeSession: T, getSessionState: E, getSessionDebug: D, reoffer: O, posterUrl: k, hintsOverride: ee, onAdaptiveHints: te, reconnectSignal: A, onControlChannel: j, onVideoElement: M }) {
13391
- let N = u(null), P = u(null), F = u(null), I = u(/* @__PURE__ */ new Set()), ne = u(null), L = u(null), R = u(0), z = u(!0), re = u(j);
13392
- re.current = j;
13393
- let ie = u(M);
13394
- ie.current = M, v(() => (ie.current?.(N.current), () => ie.current?.(null)), []);
13395
- let B = u(te);
13396
- B.current = te;
13397
- let ae = u(null), oe = o((e, t, n) => {
13398
- let r = B.current;
13390
+ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i = !0, showControls: a = !0, showStats: s = !1, onDebugStats: c, onPlaybackStats: d, onClientNetworkSample: f, onConnectTiming: p, className: m = "", onStateChange: h, onError: g, onReconnectAttempt: _, overlay: y, createSession: b, sendAnswer: x, handleOffer: S, getIceServers: C, addIceCandidate: w, getIceCandidates: T, closeSession: E, getSessionState: D, getSessionDebug: O, reoffer: k, posterUrl: ee, hintsOverride: A, onAdaptiveHints: te, reconnectSignal: ne, onControlChannel: j, onVideoElement: re }) {
13391
+ let M = u(null), N = u(null), P = u(null), F = u(/* @__PURE__ */ new Set()), I = u(null), L = u(null), R = u(0), z = u(!0), ie = u(j);
13392
+ ie.current = j;
13393
+ let B = u(re);
13394
+ B.current = re, v(() => (B.current?.(M.current), () => B.current?.(null)), []);
13395
+ let ae = u(te);
13396
+ ae.current = te;
13397
+ let oe = u(null), U = o((e, t, n) => {
13398
+ let r = ae.current;
13399
13399
  if (!r) return;
13400
13400
  let i = {
13401
13401
  phase: e,
13402
13402
  probeOrigin: n,
13403
13403
  ...t
13404
13404
  }, a = tf(i);
13405
- a !== ae.current && (ae.current = a, r(i));
13406
- }, []), U = u(null), se = u(null), ce = u(0), le = u(!1), ue = u(!1), de = u(async () => {}), [fe, pe] = l("idle"), [me, W] = l(""), [he, ge] = l(i), _e = u(he);
13407
- _e.current = he;
13408
- let [ve, ye] = l(!1), [G, be] = l(!1), xe = Pf(), [Se, Ce] = l(!0), we = u(null), Te = u(!1);
13409
- (b || y) && (Te.current = !0);
13410
- let Ee = Te.current, De = u(!1);
13411
- x && (De.current = !0);
13412
- let Oe = De.current, [ke, Ae] = l(!1), je = u(null), [Me, Ne] = l(null), [Pe, Fe] = l(!1), Ie = o(() => {
13413
- let e = N.current;
13405
+ a !== oe.current && (oe.current = a, r(i));
13406
+ }, []), se = u(null), ce = u(null), le = u(0), ue = u(!1), de = u(!1), fe = u(async () => {}), [pe, me] = l("idle"), [W, he] = l(""), [ge, _e] = l(i), ve = u(ge);
13407
+ ve.current = ge;
13408
+ let [ye, G] = l(!1), [be, xe] = l(!1), Se = Pf(), [Ce, we] = l(!0), Te = u(null), Ee = u(!1);
13409
+ (x || b) && (Ee.current = !0);
13410
+ let De = Ee.current, Oe = u(!1);
13411
+ S && (Oe.current = !0);
13412
+ let ke = Oe.current, [Ae, je] = l(!1), Me = u(null), [Ne, Pe] = l(null), [Fe, Ie] = l(!1), Le = o(() => {
13413
+ let e = M.current;
13414
13414
  if (!(!e || e.readyState < 2 || !e.videoWidth || !e.videoHeight)) try {
13415
13415
  let t = document.createElement("canvas");
13416
13416
  t.width = e.videoWidth, t.height = e.videoHeight;
13417
13417
  let n = t.getContext("2d");
13418
13418
  if (!n || (n.drawImage(e, 0, 0), Ff(n, t.width, t.height))) return;
13419
- je.current = t.toDataURL("image/jpeg", .6);
13419
+ Me.current = t.toDataURL("image/jpeg", .6);
13420
13420
  } catch {}
13421
- }, []), Le = o((e) => {
13422
- pe(e), e === "playing" && Ae(!0), m?.(e);
13423
- }, [m]), Re = o(() => {
13424
- if (ne.current?.abort(), ne.current = null, L.current &&= (clearTimeout(L.current), null), se.current &&= (clearTimeout(se.current), null), U.current = null, ue.current = !1, ce.current = 0, F.current &&= (F.current.close(), null), T && I.current.size > 0) {
13425
- for (let e of I.current) T(e).catch(() => {});
13426
- I.current.clear();
13421
+ }, []), Re = o((e) => {
13422
+ me(e), e === "playing" && je(!0), h?.(e);
13423
+ }, [h]), ze = o(() => {
13424
+ if (I.current?.abort(), I.current = null, L.current &&= (clearTimeout(L.current), null), ce.current &&= (clearTimeout(ce.current), null), se.current = null, de.current = !1, le.current = 0, P.current &&= (P.current.close(), null), E && F.current.size > 0) {
13425
+ for (let e of F.current) E(e).catch(() => {});
13426
+ F.current.clear();
13427
13427
  }
13428
- }, [T]), ze = o(() => {
13429
- ne.current?.abort(), ne.current = null, L.current &&= (clearTimeout(L.current), null), se.current &&= (clearTimeout(se.current), null), U.current = null, ue.current = !1, ce.current = 0;
13430
- }, []), K = 1e3, Be = o((e) => {
13431
- if (!E || !O) return;
13432
- se.current &&= (clearTimeout(se.current), null);
13428
+ }, [E]), K = o(() => {
13429
+ I.current?.abort(), I.current = null, L.current &&= (clearTimeout(L.current), null), ce.current &&= (clearTimeout(ce.current), null), se.current = null, de.current = !1, le.current = 0;
13430
+ }, []), Be = 1e3, Ve = o((e) => {
13431
+ if (!D || !k) return;
13432
+ ce.current &&= (clearTimeout(ce.current), null);
13433
13433
  let t = async () => {
13434
- if (z.current && U.current === e) {
13435
- if (!ue.current) try {
13436
- let { pendingRenegotiation: t } = await E(e);
13437
- if (z.current && U.current === e && t && t.epoch > ce.current && !ue.current) {
13438
- ce.current = t.epoch, await de.current(e, t.target);
13434
+ if (z.current && se.current === e) {
13435
+ if (!de.current) try {
13436
+ let { pendingRenegotiation: t } = await D(e);
13437
+ if (z.current && se.current === e && t && t.epoch > le.current && !de.current) {
13438
+ le.current = t.epoch, await fe.current(e, t.target);
13439
13439
  return;
13440
13440
  }
13441
13441
  } catch {}
13442
- !z.current || U.current !== e || (se.current = setTimeout(() => {
13442
+ !z.current || se.current !== e || (ce.current = setTimeout(() => {
13443
13443
  t();
13444
- }, K));
13444
+ }, Be));
13445
13445
  }
13446
13446
  };
13447
- se.current = setTimeout(() => {
13447
+ ce.current = setTimeout(() => {
13448
13448
  t();
13449
- }, K);
13450
- }, [E, O]), Ve = o(async (t = !1, n = t) => {
13451
- if (!z.current || !y || !b) return;
13452
- let r = t ? F.current : null, i = t ? new Set(I.current) : null;
13453
- t ? ze() : Re(), Le("connecting");
13449
+ }, Be);
13450
+ }, [D, k]), q = o(async (t = !1, n = t) => {
13451
+ if (!z.current || !b || !x) return;
13452
+ let r = t ? P.current : null, i = t ? new Set(F.current) : null;
13453
+ t ? K() : ze(), Re("connecting");
13454
13454
  let a = new AbortController();
13455
- ne.current = a;
13455
+ I.current = a;
13456
13456
  try {
13457
- let o = n ? void 0 : Bf(e), s = Vf(If(P.current), ee, n ? await Bf(e) : void 0, !n);
13458
- oe(n ? "probe-climb" : "cold-start", s, zf(e));
13459
- let { sessionId: c, sdpOffer: l, iceServers: u } = await y(s);
13460
- if (I.current.add(c), o !== void 0 && o.then((e) => {
13461
- e === void 0 || !Qd(e) || !z.current || a.signal.aborted || le.current || (le.current = !0, Ve(!0, !0));
13457
+ let o = n ? void 0 : Bf(e), s = Vf(If(N.current), A, n ? await Bf(e) : void 0, !n);
13458
+ U(n ? "probe-climb" : "cold-start", s, zf(e));
13459
+ let { sessionId: c, sdpOffer: l, iceServers: u } = await b(s);
13460
+ if (F.current.add(c), o !== void 0 && o.then((e) => {
13461
+ e === void 0 || !Qd(e) || !z.current || a.signal.aborted || ue.current || (ue.current = !0, q(!0, !0));
13462
13462
  }), !z.current || a.signal.aborted) {
13463
- T?.(c).catch(() => {}), I.current.delete(c);
13463
+ E?.(c).catch(() => {}), F.current.delete(c);
13464
13464
  return;
13465
13465
  }
13466
13466
  let d = new RTCPeerConnection({ iceServers: [...u ?? [], { urls: "stun:stun.l.google.com:19302" }] });
13467
- t || (F.current = d);
13467
+ t || (P.current = d);
13468
13468
  let f = new MediaStream(), p = !1, m = () => {
13469
13469
  if (!(p || !z.current)) {
13470
- if (p = !0, F.current = d, N.current && (N.current.srcObject = f, Nf(N.current, _e.current), N.current.play().catch(() => {})), r && r !== d) try {
13470
+ if (p = !0, P.current = d, M.current && (M.current.srcObject = f, Nf(M.current, ve.current), M.current.play().catch(() => {})), r && r !== d) try {
13471
13471
  r.close();
13472
13472
  } catch {}
13473
- if (i) for (let e of i) I.current.delete(e), T?.(e).catch(() => {});
13473
+ if (i) for (let e of i) F.current.delete(e), E?.(e).catch(() => {});
13474
13474
  }
13475
13475
  };
13476
13476
  d.ontrack = (e) => {
@@ -13478,16 +13478,16 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13478
13478
  m();
13479
13479
  return;
13480
13480
  }
13481
- N.current && (N.current.srcObject = f, Nf(N.current, _e.current), N.current.play().catch(() => {}));
13481
+ M.current && (M.current.srcObject = f, Nf(M.current, ve.current), M.current.play().catch(() => {}));
13482
13482
  }, d.oniceconnectionstatechange = () => {
13483
13483
  if (!z.current) return;
13484
13484
  let e = d.iceConnectionState;
13485
- if (console.debug("[WebRTC] ICE state:", e), e === "connected" || e === "completed") R.current = 0, t && m(), Le("playing"), N.current?.paused && (console.debug("[WebRTC] video was paused at ICE connected — calling play()"), N.current.play().catch(() => {}));
13485
+ if (console.debug("[WebRTC] ICE state:", e), e === "connected" || e === "completed") R.current = 0, t && m(), Re("playing"), M.current?.paused && (console.debug("[WebRTC] video was paused at ICE connected — calling play()"), M.current.play().catch(() => {}));
13486
13486
  else if (e === "failed" || e === "disconnected" || e === "closed") {
13487
13487
  if (t && !p) try {
13488
13488
  d.close();
13489
13489
  } catch {}
13490
- Le("disconnected"), qe();
13490
+ Re("disconnected"), Je();
13491
13491
  }
13492
13492
  }, d.onicecandidateerror = (e) => {
13493
13493
  console.debug("[WebRTC] ICE candidate error:", e);
@@ -13501,44 +13501,44 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13501
13501
  console.debug("[WebRTC] Sending answer to server", {
13502
13502
  localCandidates: g,
13503
13503
  sessionId: c.slice(0, 8)
13504
- }), await b(c, d.localDescription?.sdp ?? ""), console.debug("[WebRTC] Answer sent successfully");
13504
+ }), await x(c, d.localDescription?.sdp ?? ""), console.debug("[WebRTC] Answer sent successfully");
13505
13505
  let _ = d, v = () => {
13506
13506
  let e = _.connectionState;
13507
13507
  if (e === "closed" || e === "failed") return;
13508
- let t = N.current;
13508
+ let t = M.current;
13509
13509
  t && t.readyState === 0 && console.log(`[WebRTC] no video data yet (ice=${_.iceConnectionState})`);
13510
13510
  };
13511
13511
  setTimeout(v, 3e3), setTimeout(v, 8e3);
13512
13512
  } catch (e) {
13513
13513
  if (!z.current) return;
13514
13514
  let t = e instanceof Error ? e.message : String(e);
13515
- W(t), Le("error"), h?.(t), qe();
13515
+ he(t), Re("error"), g?.(t), Je();
13516
13516
  }
13517
13517
  }, [
13518
13518
  e,
13519
13519
  t,
13520
- y,
13521
13520
  b,
13522
- Re,
13521
+ x,
13523
13522
  ze,
13524
- T,
13525
- Le,
13526
- h,
13527
- ee,
13528
- oe
13529
- ]), q = o(async () => {
13523
+ K,
13524
+ E,
13525
+ Re,
13526
+ g,
13527
+ A,
13528
+ U
13529
+ ]), He = o(async () => {
13530
13530
  if (z.current) {
13531
- Re(), Le("connecting");
13531
+ ze(), Re("connecting");
13532
13532
  try {
13533
13533
  let n = new RTCPeerConnection({ iceServers: [{ urls: "stun:stun.l.google.com:19302" }] });
13534
- F.current = n, n.addTransceiver("video", { direction: "recvonly" }), n.addTransceiver("audio", { direction: "recvonly" });
13534
+ P.current = n, n.addTransceiver("video", { direction: "recvonly" }), n.addTransceiver("audio", { direction: "recvonly" });
13535
13535
  let r = new MediaStream();
13536
13536
  n.ontrack = (e) => {
13537
- r.addTrack(e.track), N.current && (N.current.srcObject = r, Nf(N.current, _e.current), N.current.play().catch(() => {}));
13537
+ r.addTrack(e.track), M.current && (M.current.srcObject = r, Nf(M.current, ve.current), M.current.play().catch(() => {}));
13538
13538
  }, n.oniceconnectionstatechange = () => {
13539
13539
  if (!z.current) return;
13540
13540
  let e = n.iceConnectionState;
13541
- e === "connected" || e === "completed" ? (R.current = 0, Le("playing"), N.current?.paused && N.current.play().catch(() => {})) : (e === "failed" || e === "disconnected" || e === "closed") && (Le("disconnected"), qe());
13541
+ e === "connected" || e === "completed" ? (R.current = 0, Re("playing"), M.current?.paused && M.current.play().catch(() => {})) : (e === "failed" || e === "disconnected" || e === "closed") && (Re("disconnected"), Je());
13542
13542
  };
13543
13543
  let i = await n.createOffer();
13544
13544
  if (await n.setLocalDescription(i), await Gf(n), !z.current) return;
@@ -13556,41 +13556,41 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13556
13556
  } catch (e) {
13557
13557
  if (!z.current) return;
13558
13558
  let t = e instanceof Error ? e.message : String(e);
13559
- W(t), Le("error"), h?.(t), qe();
13559
+ he(t), Re("error"), g?.(t), Je();
13560
13560
  }
13561
13561
  }
13562
13562
  }, [
13563
13563
  e,
13564
13564
  t,
13565
+ ze,
13565
13566
  Re,
13566
- Le,
13567
- h
13568
- ]), He = o(async (n = !1, r = n) => {
13569
- if (!z.current || !x) return;
13570
- let i = n ? F.current : null, a = n ? new Set(I.current) : null;
13571
- n ? ze() : Re(), Le("connecting");
13567
+ g
13568
+ ]), Ue = o(async (n = !1, r = n) => {
13569
+ if (!z.current || !S) return;
13570
+ let i = n ? P.current : null, a = n ? new Set(F.current) : null;
13571
+ n ? K() : ze(), Re("connecting");
13572
13572
  let o = new AbortController();
13573
- ne.current = o;
13573
+ I.current = o;
13574
13574
  let s = performance.now(), c = () => Math.round(performance.now() - s), l = {};
13575
13575
  try {
13576
- let s = r ? void 0 : Bf(e), u = await S?.();
13576
+ let s = r ? void 0 : Bf(e), u = await C?.();
13577
13577
  if (l.iceServersMs = c(), !z.current || o.signal.aborted) return;
13578
13578
  let d = new RTCPeerConnection({ iceServers: [...u ?? [], { urls: "stun:stun.l.google.com:19302" }] });
13579
- n || (F.current = d);
13580
- let p = new MediaStream(), m = !1, h = () => {
13579
+ n || (P.current = d);
13580
+ let f = new MediaStream(), m = !1, h = () => {
13581
13581
  if (!(m || !z.current)) {
13582
- if (m = !0, F.current = d, N.current && (N.current.srcObject = p, Nf(N.current, _e.current), N.current.play().catch(() => {})), i && i !== d) try {
13582
+ if (m = !0, P.current = d, M.current && (M.current.srcObject = f, Nf(M.current, ve.current), M.current.play().catch(() => {})), i && i !== d) try {
13583
13583
  i.close();
13584
13584
  } catch {}
13585
- if (a) for (let e of a) I.current.delete(e), T?.(e).catch(() => {});
13585
+ if (a) for (let e of a) F.current.delete(e), E?.(e).catch(() => {});
13586
13586
  }
13587
13587
  };
13588
13588
  d.ontrack = (e) => {
13589
- if (l.firstTrackMs === void 0 && (l.firstTrackMs = c()), console.debug("[WebRTC] ontrack (client-offer)", e.track.kind, e.track.readyState), p.addTrack(e.track), n) {
13589
+ if (l.firstTrackMs === void 0 && (l.firstTrackMs = c()), console.debug("[WebRTC] ontrack (client-offer)", e.track.kind, e.track.readyState), f.addTrack(e.track), n) {
13590
13590
  h();
13591
13591
  return;
13592
13592
  }
13593
- N.current && (N.current.srcObject = p, Nf(N.current, _e.current), N.current.play().catch(() => {}));
13593
+ M.current && (M.current.srcObject = f, Nf(M.current, ve.current), M.current.play().catch(() => {}));
13594
13594
  };
13595
13595
  let g = !1;
13596
13596
  d.oniceconnectionstatechange = () => {
@@ -13601,59 +13601,59 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13601
13601
  g = !0, l.iceConnectedMs = c(), console.info("[WebRTC timing] client-offer connected", {
13602
13602
  streamKey: t,
13603
13603
  ...l
13604
- }), f?.({ ...l });
13605
- let e = N.current;
13604
+ }), p?.({ ...l });
13605
+ let e = M.current;
13606
13606
  e && "requestVideoFrameCallback" in e && (e.requestVideoFrameCallback(() => {
13607
13607
  l.firstFrameMs = c(), console.info("[WebRTC timing] first decoded frame", {
13608
13608
  streamKey: t,
13609
13609
  firstFrameMs: l.firstFrameMs
13610
- }), f?.({ ...l });
13610
+ }), p?.({ ...l });
13611
13611
  }), setTimeout(() => {
13612
13612
  z.current && l.firstFrameMs === void 0 && (console.warn("[WebRTC timing] NO decoded frame (stalled)", {
13613
13613
  streamKey: t,
13614
13614
  sinceIceConnectedMs: c() - (l.iceConnectedMs ?? 0),
13615
13615
  iceConnectedMs: l.iceConnectedMs,
13616
13616
  firstTrackMs: l.firstTrackMs
13617
- }), Ke.current("no decoded frame after connect"), qe());
13617
+ }), qe.current("no decoded frame after connect"), Je());
13618
13618
  }, Hf));
13619
13619
  }
13620
- R.current = 0, n && h(), Le("playing"), N.current?.paused && N.current.play().catch(() => {});
13620
+ R.current = 0, n && h(), Re("playing"), M.current?.paused && M.current.play().catch(() => {});
13621
13621
  } else if (e === "failed" || e === "disconnected" || e === "closed") {
13622
13622
  if (n && !m) try {
13623
13623
  d.close();
13624
13624
  } catch {}
13625
- Le("disconnected"), qe();
13625
+ Re("disconnected"), Je();
13626
13626
  }
13627
13627
  };
13628
13628
  let _ = null, v = [];
13629
13629
  if (d.onicecandidate = (e) => {
13630
13630
  if (!e.candidate) return;
13631
13631
  let t = e.candidate.toJSON();
13632
- _ && C ? C(_, t).catch(() => {}) : v.push(t);
13633
- }, d.addTransceiver("video", { direction: "recvonly" }), d.addTransceiver("audio", { direction: "recvonly" }), re.current) {
13632
+ _ && w ? w(_, t).catch(() => {}) : v.push(t);
13633
+ }, d.addTransceiver("video", { direction: "recvonly" }), d.addTransceiver("audio", { direction: "recvonly" }), ie.current) {
13634
13634
  let e = d.createDataChannel("camstack-control");
13635
- re.current(e);
13635
+ ie.current(e);
13636
13636
  }
13637
13637
  let y = await d.createOffer();
13638
13638
  if (l.offerCreatedMs = c(), await d.setLocalDescription(y), l.localSetMs = c(), !z.current || o.signal.aborted) return;
13639
- let b = r ? await Bf(e) : void 0, E = Vf(If(P.current), ee, b, !r);
13640
- oe(r ? "probe-climb" : "cold-start", E, zf(e));
13641
- let D = c(), { sessionId: O, sdpAnswer: k } = await x(d.localDescription?.sdp ?? y.sdp ?? "", void 0, E);
13642
- if (l.signalingRttMs = c() - D, _ = O, I.current.add(O), s !== void 0 && s.then((e) => {
13643
- e === void 0 || !Qd(e) || !z.current || o.signal.aborted || le.current || (le.current = !0, He(!0, !0));
13644
- }), U.current = O, !z.current || o.signal.aborted) {
13645
- T?.(O).catch(() => {}), I.current.delete(O);
13639
+ let b = r ? await Bf(e) : void 0, x = Vf(If(N.current), A, b, !r);
13640
+ U(r ? "probe-climb" : "cold-start", x, zf(e));
13641
+ let D = c(), { sessionId: O, sdpAnswer: k } = await S(d.localDescription?.sdp ?? y.sdp ?? "", void 0, x);
13642
+ if (l.signalingRttMs = c() - D, _ = O, F.current.add(O), s !== void 0 && s.then((e) => {
13643
+ e === void 0 || !Qd(e) || !z.current || o.signal.aborted || ue.current || (ue.current = !0, Ue(!0, !0));
13644
+ }), se.current = O, !z.current || o.signal.aborted) {
13645
+ E?.(O).catch(() => {}), F.current.delete(O);
13646
13646
  return;
13647
13647
  }
13648
- if (C) for (let e of v) C(O, e).catch(() => {});
13648
+ if (w) for (let e of v) w(O, e).catch(() => {});
13649
13649
  if (v.length = 0, await d.setRemoteDescription({
13650
13650
  type: "answer",
13651
13651
  sdp: k
13652
- }), l.answerSetMs = c(), console.debug("[WebRTC] Client-offer answer set (trickle)", { sessionId: O.slice(0, 8) }), w) {
13652
+ }), l.answerSetMs = c(), console.debug("[WebRTC] Client-offer answer set (trickle)", { sessionId: O.slice(0, 8) }), T) {
13653
13653
  let e = /* @__PURE__ */ new Set(), t = Date.now(), n = async () => {
13654
13654
  if (!(!z.current || o.signal.aborted) && !(d.connectionState === "closed" || d.signalingState === "closed")) {
13655
13655
  try {
13656
- let { candidates: n, done: r } = await w(O);
13656
+ let { candidates: n, done: r } = await T(O);
13657
13657
  for (let t of n) {
13658
13658
  let n = t.candidate ?? "";
13659
13659
  n && !e.has(n) && (e.add(n), d.addIceCandidate(new RTCIceCandidate(t)).catch(() => {}));
@@ -13668,34 +13668,34 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13668
13668
  };
13669
13669
  n();
13670
13670
  }
13671
- Be(O);
13671
+ Ve(O);
13672
13672
  } catch (e) {
13673
13673
  if (!z.current) return;
13674
13674
  let t = e instanceof Error ? e.message : String(e);
13675
- W(t), Le("error"), h?.(t), qe();
13675
+ he(t), Re("error"), g?.(t), Je();
13676
13676
  }
13677
13677
  }, [
13678
13678
  e,
13679
- x,
13680
13679
  S,
13681
13680
  C,
13682
13681
  w,
13683
13682
  T,
13684
- Re,
13683
+ E,
13685
13684
  ze,
13686
- Le,
13687
- h,
13688
- Be,
13689
- ee,
13690
- oe
13685
+ K,
13686
+ Re,
13687
+ g,
13688
+ Ve,
13689
+ A,
13690
+ U
13691
13691
  ]);
13692
- de.current = o(async (t, n) => {
13693
- let r = O;
13692
+ fe.current = o(async (t, n) => {
13693
+ let r = k;
13694
13694
  if (!z.current || !r) return;
13695
- let i = F.current;
13696
- ue.current = !0;
13695
+ let i = P.current;
13696
+ de.current = !0;
13697
13697
  try {
13698
- let a = await S?.();
13698
+ let a = await C?.();
13699
13699
  if (!z.current) return;
13700
13700
  let o = new RTCPeerConnection({ iceServers: [...a ?? [], { urls: "stun:stun.l.google.com:19302" }] }), s = new MediaStream(), c = !1, l = !1, u = null, d, f, p = () => {
13701
13701
  f !== void 0 && (clearTimeout(f), f = void 0);
@@ -13713,7 +13713,7 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13713
13713
  p();
13714
13714
  return;
13715
13715
  }
13716
- c = !0, F.current = o, N.current && (N.current.srcObject = s, N.current.play().catch(() => {})), i && i !== o && i.close(), p();
13716
+ c = !0, P.current = o, M.current && (M.current.srcObject = s, M.current.play().catch(() => {})), i && i !== o && i.close(), p();
13717
13717
  }
13718
13718
  let h = () => {
13719
13719
  if (l || c || !z.current) return;
@@ -13722,23 +13722,23 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13722
13722
  return;
13723
13723
  }
13724
13724
  let e = document.createElement("video");
13725
- e.muted = !0, e.playsInline = !0, e.autoplay = !0, e.style.cssText = "position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;", e.srcObject = s, u = e, (P.current ?? document.body).appendChild(e), e.play().catch(() => {}), typeof e.requestVideoFrameCallback == "function" && (d = e.requestVideoFrameCallback(() => m())), e.addEventListener("loadeddata", m, { once: !0 }), f = setTimeout(() => m(), 1800);
13725
+ e.muted = !0, e.playsInline = !0, e.autoplay = !0, e.style.cssText = "position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;", e.srcObject = s, u = e, (N.current ?? document.body).appendChild(e), e.play().catch(() => {}), typeof e.requestVideoFrameCallback == "function" && (d = e.requestVideoFrameCallback(() => m())), e.addEventListener("loadeddata", m, { once: !0 }), f = setTimeout(() => m(), 1800);
13726
13726
  };
13727
13727
  o.ontrack = (e) => {
13728
13728
  console.debug("[WebRTC] ontrack (reoffer)", e.track.kind, e.track.readyState), s.addTrack(e.track), h();
13729
13729
  }, o.oniceconnectionstatechange = () => {
13730
13730
  if (!z.current) return;
13731
13731
  let e = o.iceConnectionState;
13732
- console.debug("[WebRTC] ICE state (reoffer):", e), e === "connected" || e === "completed" ? (R.current = 0, h(), Le("playing"), N.current?.paused && N.current.play().catch(() => {})) : (e === "failed" || e === "closed") && (p(), !c && e === "failed" && o.close(), Le("disconnected"), qe());
13732
+ console.debug("[WebRTC] ICE state (reoffer):", e), e === "connected" || e === "completed" ? (R.current = 0, h(), Re("playing"), M.current?.paused && M.current.play().catch(() => {})) : (e === "failed" || e === "closed") && (p(), !c && e === "failed" && o.close(), Re("disconnected"), Je());
13733
13733
  };
13734
13734
  let g = null, _ = [];
13735
13735
  if (o.onicecandidate = (e) => {
13736
13736
  if (!e.candidate) return;
13737
13737
  let t = e.candidate.toJSON();
13738
- g && C ? C(g, t).catch(() => {}) : _.push(t);
13739
- }, o.addTransceiver("video", { direction: "recvonly" }), o.addTransceiver("audio", { direction: "recvonly" }), re.current) {
13738
+ g && w ? w(g, t).catch(() => {}) : _.push(t);
13739
+ }, o.addTransceiver("video", { direction: "recvonly" }), o.addTransceiver("audio", { direction: "recvonly" }), ie.current) {
13740
13740
  let e = o.createDataChannel("camstack-control");
13741
- re.current(e);
13741
+ ie.current(e);
13742
13742
  }
13743
13743
  let v = await o.createOffer();
13744
13744
  if (await o.setLocalDescription(v), !z.current) {
@@ -13746,25 +13746,25 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13746
13746
  return;
13747
13747
  }
13748
13748
  let y = await Bf(e), b = {
13749
- ...If(P.current),
13749
+ ...If(N.current),
13750
13750
  ...y === void 0 ? {} : { downlinkMbps: y },
13751
- ...ee
13751
+ ...A
13752
13752
  };
13753
- oe("renegotiate", b, zf(e));
13754
- let { sessionId: x, sdpAnswer: T } = await r(t, o.localDescription?.sdp ?? v.sdp ?? "", n, b);
13753
+ U("renegotiate", b, zf(e));
13754
+ let { sessionId: x, sdpAnswer: S } = await r(t, o.localDescription?.sdp ?? v.sdp ?? "", n, b);
13755
13755
  if (!z.current) {
13756
13756
  o.close();
13757
13757
  return;
13758
13758
  }
13759
- if (g = x, I.current.add(x), U.current = x, C) for (let e of _) C(x, e).catch(() => {});
13759
+ if (g = x, F.current.add(x), se.current = x, w) for (let e of _) w(x, e).catch(() => {});
13760
13760
  if (_.length = 0, await o.setRemoteDescription({
13761
13761
  type: "answer",
13762
- sdp: T
13763
- }), w) {
13762
+ sdp: S
13763
+ }), T) {
13764
13764
  let e = /* @__PURE__ */ new Set(), t = Date.now(), n = async () => {
13765
13765
  if (z.current && !(o.connectionState === "closed" || o.signalingState === "closed")) {
13766
13766
  try {
13767
- let { candidates: n, done: r } = await w(x);
13767
+ let { candidates: n, done: r } = await T(x);
13768
13768
  for (let t of n) {
13769
13769
  let n = t.candidate ?? "";
13770
13770
  n && !e.has(n) && (e.add(n), o.addIceCandidate(new RTCIceCandidate(t)).catch(() => {}));
@@ -13779,114 +13779,114 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13779
13779
  };
13780
13780
  n();
13781
13781
  }
13782
- Be(x);
13782
+ Ve(x);
13783
13783
  } catch (e) {
13784
- console.debug("[WebRTC] reoffer failed; keeping last frame, re-arming poll", e instanceof Error ? e.message : String(e)), Be(t);
13784
+ console.debug("[WebRTC] reoffer failed; keeping last frame, re-arming poll", e instanceof Error ? e.message : String(e)), Ve(t);
13785
13785
  } finally {
13786
- ue.current = !1;
13786
+ de.current = !1;
13787
13787
  }
13788
13788
  }, [
13789
13789
  e,
13790
- O,
13791
- S,
13790
+ k,
13792
13791
  C,
13793
13792
  w,
13794
- Le,
13795
- Be,
13796
- ee,
13797
- oe
13793
+ T,
13794
+ Re,
13795
+ Ve,
13796
+ A,
13797
+ U
13798
13798
  ]);
13799
- let Ue = Oe ? He : Ee ? Ve : q, We = u(() => {}), Ge = u(g);
13800
- Ge.current = g;
13801
- let Ke = u(() => {});
13802
- Ke.current = (e) => {
13799
+ let We = ke ? Ue : De ? q : He, Ge = u(() => {}), Ke = u(_);
13800
+ Ke.current = _;
13801
+ let qe = u(() => {});
13802
+ qe.current = (e) => {
13803
13803
  console.warn("[WebRTC] hard error", {
13804
13804
  streamKey: t,
13805
13805
  msg: e
13806
- }), W(e), h?.(e), Le("error");
13807
- }, We.current = Ue;
13808
- let qe = o(() => {
13806
+ }), he(e), g?.(e), Re("error");
13807
+ }, Ge.current = We;
13808
+ let Je = o(() => {
13809
13809
  if (!z.current) return;
13810
13810
  let e = R.current, t = qd(e);
13811
- if (Ge.current?.(t), t.kind === "exhausted") {
13812
- Ke.current(`reconnect attempts exhausted (${t.attempts})`);
13811
+ if (Ke.current?.(t), t.kind === "exhausted") {
13812
+ qe.current(`reconnect attempts exhausted (${t.attempts})`);
13813
13813
  return;
13814
13814
  }
13815
13815
  R.current += 1, L.current = setTimeout(() => {
13816
- z.current && We.current();
13816
+ z.current && Ge.current();
13817
13817
  }, t.delayMs);
13818
13818
  }, []);
13819
- v(() => (z.current = !0, R.current = 0, r && Ue(), () => {
13820
- z.current = !1, Re();
13819
+ v(() => (z.current = !0, R.current = 0, r && We(), () => {
13820
+ z.current = !1, ze();
13821
13821
  }), []);
13822
- let Je = u(!1);
13822
+ let Ye = u(!1);
13823
13823
  v(() => {
13824
13824
  if (r) {
13825
- if (Oe) {
13826
- if (!x) return;
13827
- } else if (Ee) {
13828
- if (!y || !b) return;
13825
+ if (ke) {
13826
+ if (!S) return;
13827
+ } else if (De) {
13828
+ if (!b || !x) return;
13829
13829
  } else return;
13830
- Je.current || F.current || (Je.current = !0, Ue());
13830
+ Ye.current || P.current || (Ye.current = !0, We());
13831
13831
  }
13832
13832
  }, [
13833
13833
  r,
13834
- Oe,
13835
- Ee,
13836
- x,
13837
- y,
13834
+ ke,
13835
+ De,
13836
+ S,
13838
13837
  b,
13839
- Ue
13838
+ x,
13839
+ We
13840
13840
  ]);
13841
- let Ye = () => {
13842
- R.current = 0, Ue();
13843
- }, Xe = () => {
13844
- if (R.current = 0, F.current && Oe) {
13845
- He(!0);
13841
+ let Xe = () => {
13842
+ R.current = 0, We();
13843
+ }, Ze = () => {
13844
+ if (R.current = 0, P.current && ke) {
13845
+ Ue(!0);
13846
13846
  return;
13847
13847
  }
13848
- if (F.current && Ee) {
13849
- Ve(!0);
13848
+ if (P.current && De) {
13849
+ q(!0);
13850
13850
  return;
13851
13851
  }
13852
- Ue();
13853
- }, Ze = u(e), Qe = u(t);
13852
+ We();
13853
+ }, Qe = u(e), $e = u(t);
13854
13854
  v(() => {
13855
- let n = Ze.current !== e, r = Qe.current !== t;
13856
- if (Ze.current = e, Qe.current = t, !(!n && !r) && z.current) {
13857
- if (R.current = 0, le.current = !1, n) {
13858
- Re(), Ue();
13855
+ let n = Qe.current !== e, r = $e.current !== t;
13856
+ if (Qe.current = e, $e.current = t, !(!n && !r) && z.current) {
13857
+ if (R.current = 0, ue.current = !1, n) {
13858
+ ze(), We();
13859
13859
  return;
13860
13860
  }
13861
- Xe();
13861
+ Ze();
13862
13862
  }
13863
13863
  }, [e, t]);
13864
- let $e = u(A);
13864
+ let et = u(ne);
13865
13865
  v(() => {
13866
- $e.current !== A && ($e.current = A, z.current && Xe());
13867
- }, [A]);
13868
- let et = () => {
13869
- if (N.current) {
13870
- let e = !N.current.muted;
13871
- Nf(N.current, e), ge(e);
13866
+ et.current !== ne && (et.current = ne, z.current && Ze());
13867
+ }, [ne]);
13868
+ let tt = () => {
13869
+ if (M.current) {
13870
+ let e = !M.current.muted;
13871
+ Nf(M.current, e), _e(e);
13872
13872
  }
13873
- }, tt = async () => {
13874
- if (P.current) try {
13873
+ }, nt = async () => {
13874
+ if (N.current) try {
13875
13875
  if (document.fullscreenElement) {
13876
13876
  await document.exitFullscreen();
13877
13877
  return;
13878
13878
  }
13879
- if (P.current.requestFullscreen) {
13880
- await P.current.requestFullscreen();
13879
+ if (N.current.requestFullscreen) {
13880
+ await N.current.requestFullscreen();
13881
13881
  return;
13882
13882
  }
13883
- let e = N.current;
13883
+ let e = M.current;
13884
13884
  e?.webkitEnterFullscreen && e.webkitEnterFullscreen();
13885
13885
  } catch (e) {
13886
13886
  console.warn(`Fullscreen toggle failed: ${e instanceof Error ? e.message : e}`);
13887
13887
  }
13888
- }, nt = async () => {
13889
- let e = N.current;
13888
+ }, rt = async () => {
13889
+ let e = M.current;
13890
13890
  if (e) try {
13891
13891
  if (typeof e.webkitSetPresentationMode == "function") {
13892
13892
  e.webkitSetPresentationMode(e.webkitPresentationMode === "picture-in-picture" ? "inline" : "picture-in-picture");
@@ -13896,39 +13896,39 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13896
13896
  } catch (e) {
13897
13897
  console.warn(`PiP toggle failed: ${e instanceof Error ? e.message : String(e)}`);
13898
13898
  }
13899
- }, rt = () => {
13900
- if (!N.current) return;
13899
+ }, it = () => {
13900
+ if (!M.current) return;
13901
13901
  let e = document.createElement("canvas");
13902
- e.width = N.current.videoWidth || 1280, e.height = N.current.videoHeight || 720;
13902
+ e.width = M.current.videoWidth || 1280, e.height = M.current.videoHeight || 720;
13903
13903
  let n = e.getContext("2d");
13904
13904
  if (!n) return;
13905
- n.drawImage(N.current, 0, 0);
13905
+ n.drawImage(M.current, 0, 0);
13906
13906
  let r = document.createElement("a");
13907
13907
  r.download = `${t.replace(/[/:]/g, "-")}-${Date.now()}.jpg`, r.href = e.toDataURL("image/jpeg", .92), r.click();
13908
13908
  };
13909
13909
  v(() => {
13910
- let e = () => ye(!!document.fullscreenElement);
13910
+ let e = () => G(!!document.fullscreenElement);
13911
13911
  document.addEventListener("fullscreenchange", e);
13912
- let t = N.current;
13912
+ let t = M.current;
13913
13913
  return t?.addEventListener("webkitbeginfullscreen", e), t?.addEventListener("webkitendfullscreen", e), () => {
13914
13914
  document.removeEventListener("fullscreenchange", e), t?.removeEventListener("webkitbeginfullscreen", e), t?.removeEventListener("webkitendfullscreen", e);
13915
13915
  };
13916
13916
  }, []), v(() => {
13917
- let e = N.current, t = typeof document < "u" && document.pictureInPictureEnabled === !0, n = e !== null && typeof e.webkitSetPresentationMode == "function";
13918
- be(t || n);
13917
+ let e = M.current, t = typeof document < "u" && document.pictureInPictureEnabled === !0, n = e !== null && typeof e.webkitSetPresentationMode == "function";
13918
+ xe(t || n);
13919
13919
  }, []);
13920
- let [it, at] = l(null), [ot, st] = l(null), [ct, lt] = l(null), [ut, dt] = l(() => Date.now());
13920
+ let [at, ot] = l(null), [st, ct] = l(null), [lt, ut] = l(null), [dt, ft] = l(() => Date.now()), pt = s || c !== void 0;
13921
13921
  v(() => {
13922
13922
  if (!s) return;
13923
- let e = setInterval(() => dt(Date.now()), 500);
13923
+ let e = setInterval(() => ft(Date.now()), 500);
13924
13924
  return () => clearInterval(e);
13925
13925
  }, [s]), v(() => {
13926
- if (!s) {
13927
- at(null);
13926
+ if (!pt) {
13927
+ ot(null);
13928
13928
  return;
13929
13929
  }
13930
13930
  let e = { current: null }, t = !1, n = async () => {
13931
- let n = F.current;
13931
+ let n = P.current;
13932
13932
  if (n) try {
13933
13933
  let r = await n.getStats();
13934
13934
  if (t) return;
@@ -13939,7 +13939,7 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13939
13939
  iceConnectionState: n.iceConnectionState,
13940
13940
  dtlsState: n.connectionState
13941
13941
  });
13942
- e.current = i, at(i);
13942
+ e.current = i, ot(i);
13943
13943
  } catch {}
13944
13944
  };
13945
13945
  n();
@@ -13949,24 +13949,24 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13949
13949
  return () => {
13950
13950
  t = !0, clearInterval(r);
13951
13951
  };
13952
- }, [s]), v(() => {
13953
- if (!s || !D) {
13954
- st(null), lt(null);
13952
+ }, [pt]), v(() => {
13953
+ if (!pt || !O) {
13954
+ ct(null), ut(null);
13955
13955
  return;
13956
13956
  }
13957
13957
  let e = !1, t = async () => {
13958
- let t = U.current;
13958
+ let t = se.current;
13959
13959
  if (t === null) {
13960
- lt("no session id on this player yet — nothing to ask the server about");
13960
+ ut("no session id on this player yet — nothing to ask the server about");
13961
13961
  return;
13962
13962
  }
13963
13963
  try {
13964
- let n = await D(t);
13964
+ let n = await O(t);
13965
13965
  if (e) return;
13966
- st(n), lt(null);
13966
+ ct(n), ut(null);
13967
13967
  } catch (t) {
13968
13968
  if (e) return;
13969
- lt(t instanceof Error ? t.message : String(t));
13969
+ ut(t instanceof Error ? t.message : String(t));
13970
13970
  }
13971
13971
  };
13972
13972
  t();
@@ -13976,68 +13976,92 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
13976
13976
  return () => {
13977
13977
  e = !0, clearInterval(n);
13978
13978
  };
13979
- }, [s, D]);
13980
- let ft = u(null);
13979
+ }, [pt, O]);
13980
+ let mt = u(c);
13981
+ mt.current = c, v(() => {
13982
+ if (c === void 0) return;
13983
+ let e = () => {
13984
+ mt.current?.({
13985
+ at: Date.now(),
13986
+ verdict: bf(ht.current).kind,
13987
+ sessionId: se.current,
13988
+ stats: ht.current,
13989
+ server: gt.current,
13990
+ serverError: _t.current,
13991
+ serverWired: O !== void 0
13992
+ });
13993
+ };
13994
+ e();
13995
+ let t = setInterval(e, 1e3);
13996
+ return () => clearInterval(t);
13997
+ }, [c === void 0, O]);
13998
+ let ht = u(null);
13999
+ ht.current = at;
14000
+ let gt = u(null);
14001
+ gt.current = st;
14002
+ let _t = u(null);
14003
+ _t.current = lt;
14004
+ let vt = u(null);
13981
14005
  v(() => {
13982
- if (!d) {
13983
- ft.current = null;
14006
+ if (!f) {
14007
+ vt.current = null;
13984
14008
  return;
13985
14009
  }
13986
14010
  let e = async () => {
13987
- let e = F.current;
14011
+ let e = P.current;
13988
14012
  if (e) try {
13989
14013
  let t = await e.getStats(), n = 0, r = 0, i = 0, a = 0, o = 0, s = 0;
13990
14014
  t.forEach((e) => {
13991
14015
  let t = e;
13992
14016
  t.type === "inbound-rtp" && (t.kind ?? t.mediaType) === "video" ? (n = t.packetsLost ?? 0, r = t.packetsReceived ?? 0, i = t.bytesReceived ?? 0, a = t.timestamp, o = t.jitter ?? 0) : t.type === "candidate-pair" && t.nominated && typeof t.currentRoundTripTime == "number" && (s = t.currentRoundTripTime);
13993
14017
  });
13994
- let c = ft.current;
13995
- if (ft.current = {
14018
+ let c = vt.current;
14019
+ if (vt.current = {
13996
14020
  lost: n,
13997
14021
  recv: r,
13998
14022
  bytes: i,
13999
14023
  ts: a
14000
14024
  }, !c || a <= c.ts) return;
14001
- let l = Math.max(0, n - c.lost), u = l + Math.max(0, r - c.recv), f = u > 0 ? Math.min(100, l / u * 100) : 0, p = Math.max(0, Math.round((i - c.bytes) * 8 / (a - c.ts)));
14002
- d({
14025
+ let l = Math.max(0, n - c.lost), u = l + Math.max(0, r - c.recv), d = u > 0 ? Math.min(100, l / u * 100) : 0, p = Math.max(0, Math.round((i - c.bytes) * 8 / (a - c.ts)));
14026
+ f({
14003
14027
  rttMs: Math.round(s * 1e3),
14004
14028
  jitterMs: Math.round(o * 1e3),
14005
14029
  estimatedBandwidthKbps: p,
14006
- packetLossPercent: f
14030
+ packetLossPercent: d
14007
14031
  });
14008
14032
  } catch {}
14009
14033
  }, t = setInterval(() => {
14010
14034
  e();
14011
14035
  }, 2e3);
14012
14036
  return () => clearInterval(t);
14013
- }, [d]);
14014
- let pt = u(null);
14037
+ }, [f]);
14038
+ let yt = u(null);
14015
14039
  v(() => {
14016
- if (!c) {
14017
- pt.current = null;
14040
+ if (!d) {
14041
+ yt.current = null;
14018
14042
  return;
14019
14043
  }
14020
14044
  let e = async () => {
14021
- let e = F.current, t = N.current;
14045
+ let e = P.current, t = M.current;
14022
14046
  if (e) try {
14023
- let n = await e.getStats(), r = 0, i = 0, a = 0, o = 0, s = 0, l = 0, u = 0, d = 0;
14047
+ let n = await e.getStats(), r = 0, i = 0, a = 0, o = 0, s = 0, c = 0, l = 0, u = 0;
14024
14048
  n.forEach((e) => {
14025
14049
  let t = e;
14026
- t.type === "inbound-rtp" && (t.kind ?? t.mediaType) === "video" && (r = t.framesReceived ?? 0, i = t.framesDecoded ?? 0, a = t.framesDropped ?? 0, o = t.framesPerSecond ?? 0, s = t.freezeCount ?? 0, l = t.totalFreezesDuration ?? 0, u = t.jitterBufferDelay ?? 0, d = t.jitterBufferEmittedCount ?? 0);
14050
+ t.type === "inbound-rtp" && (t.kind ?? t.mediaType) === "video" && (r = t.framesReceived ?? 0, i = t.framesDecoded ?? 0, a = t.framesDropped ?? 0, o = t.framesPerSecond ?? 0, s = t.freezeCount ?? 0, c = t.totalFreezesDuration ?? 0, l = t.jitterBufferDelay ?? 0, u = t.jitterBufferEmittedCount ?? 0);
14027
14051
  });
14028
- let f = t?.currentTime ?? 0, p = Date.now(), m = pt.current, h = d > 0 ? Math.round(u / d * 1e3) : 0;
14029
- m && c({
14052
+ let f = t?.currentTime ?? 0, p = Date.now(), m = yt.current, h = u > 0 ? Math.round(l / u * 1e3) : 0;
14053
+ m && d({
14030
14054
  dRecv: r - m.recv,
14031
14055
  dDec: i - m.dec,
14032
14056
  dDrop: a - m.drop,
14033
14057
  fps: Math.round(o),
14034
14058
  dFreeze: s - m.freeze,
14035
- freezeTotalMs: Math.round(l * 1e3),
14059
+ freezeTotalMs: Math.round(c * 1e3),
14036
14060
  avgJitterMs: h,
14037
14061
  dCtMs: Math.round((f - m.ct) * 1e3),
14038
14062
  dtMs: p - m.ts,
14039
14063
  readyState: t?.readyState ?? -1
14040
- }), pt.current = {
14064
+ }), yt.current = {
14041
14065
  recv: r,
14042
14066
  dec: i,
14043
14067
  drop: a,
@@ -14052,77 +14076,77 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
14052
14076
  e();
14053
14077
  }, 5e3);
14054
14078
  return () => clearInterval(t);
14055
- }, [c]), v(() => {
14056
- ge(i);
14057
- let e = N.current;
14079
+ }, [d]), v(() => {
14080
+ _e(i);
14081
+ let e = M.current;
14058
14082
  e && (Nf(e, i), i || e.play().catch(() => {}));
14059
14083
  }, [i]);
14060
- let mt = () => {
14061
- xe || (Ce(!0), we.current && clearTimeout(we.current), we.current = setTimeout(() => Ce(!1), 3e3));
14062
- }, ht = () => {
14063
- Ce((e) => !e), we.current && clearTimeout(we.current);
14084
+ let bt = () => {
14085
+ Se || (we(!0), Te.current && clearTimeout(Te.current), Te.current = setTimeout(() => we(!1), 3e3));
14086
+ }, xt = () => {
14087
+ we((e) => !e), Te.current && clearTimeout(Te.current);
14064
14088
  };
14065
14089
  v(() => {
14066
- if (fe === "playing") {
14067
- Ie();
14068
- let e = setInterval(Ie, 2e3);
14090
+ if (pe === "playing") {
14091
+ Le();
14092
+ let e = setInterval(Le, 2e3);
14069
14093
  return () => clearInterval(e);
14070
14094
  }
14071
- ke && je.current && Ne(je.current);
14095
+ Ae && Me.current && Pe(Me.current);
14072
14096
  }, [
14073
- fe,
14074
- ke,
14075
- Ie
14097
+ pe,
14098
+ Ae,
14099
+ Le
14076
14100
  ]), v(() => {
14077
- if (fe !== "playing") {
14078
- Fe(!1);
14101
+ if (pe !== "playing") {
14102
+ Ie(!1);
14079
14103
  return;
14080
14104
  }
14081
- let e = N.current;
14105
+ let e = M.current;
14082
14106
  if (!e) return;
14083
14107
  let t = !1, n = () => {
14084
- t || Fe(!0);
14108
+ t || Ie(!0);
14085
14109
  }, r;
14086
14110
  typeof e.requestVideoFrameCallback == "function" && (r = e.requestVideoFrameCallback(() => n())), e.addEventListener("loadeddata", n, { once: !0 });
14087
14111
  let i = setTimeout(n, 12e3);
14088
14112
  return () => {
14089
14113
  t = !0, clearTimeout(i), r !== void 0 && typeof e.cancelVideoFrameCallback == "function" && e.cancelVideoFrameCallback(r), e.removeEventListener("loadeddata", n);
14090
14114
  };
14091
- }, [fe]);
14092
- let gt = ke && Me ? Me : k ?? null, _t = !Pe && gt !== null;
14115
+ }, [pe]);
14116
+ let St = Ae && Ne ? Ne : ee ?? null, Ct = !Fe && St !== null;
14093
14117
  return /* @__PURE__ */ H("div", {
14094
- ref: P,
14095
- className: `relative isolate bg-black overflow-hidden group ${p}`,
14096
- onMouseMove: mt,
14097
- onMouseEnter: mt,
14098
- onTouchStart: ht,
14118
+ ref: N,
14119
+ className: `relative isolate bg-black overflow-hidden group ${m}`,
14120
+ onMouseMove: bt,
14121
+ onMouseEnter: bt,
14122
+ onTouchStart: xt,
14099
14123
  children: [
14100
14124
  /* @__PURE__ */ V("video", {
14101
- ref: N,
14125
+ ref: M,
14102
14126
  autoPlay: r,
14103
- muted: he,
14127
+ muted: ge,
14104
14128
  playsInline: !0,
14105
14129
  className: "w-full h-full object-contain relative z-0"
14106
14130
  }),
14107
- _t && gt && /* @__PURE__ */ V("img", {
14108
- src: gt,
14131
+ Ct && St && /* @__PURE__ */ V("img", {
14132
+ src: St,
14109
14133
  alt: "",
14110
14134
  className: "absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none"
14111
14135
  }),
14112
- n && fe === "playing" && /* @__PURE__ */ V("div", {
14136
+ n && pe === "playing" && /* @__PURE__ */ V("div", {
14113
14137
  className: "absolute top-2 left-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-medium",
14114
14138
  children: n
14115
14139
  }),
14116
14140
  s && /* @__PURE__ */ V(Mf, {
14117
- stats: it,
14118
- server: ot,
14119
- serverError: ct,
14120
- serverWired: D !== void 0,
14121
- now: ut,
14122
- sessionId: U.current
14141
+ stats: at,
14142
+ server: st,
14143
+ serverError: lt,
14144
+ serverWired: O !== void 0,
14145
+ now: dt,
14146
+ sessionId: se.current
14123
14147
  }),
14124
- _,
14125
- a && !gt && fe === "connecting" && /* @__PURE__ */ H("div", {
14148
+ y,
14149
+ a && !St && pe === "connecting" && /* @__PURE__ */ H("div", {
14126
14150
  className: "absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",
14127
14151
  children: [/* @__PURE__ */ V("svg", {
14128
14152
  className: "h-6 w-6 text-white/60 animate-spin",
@@ -14144,7 +14168,7 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
14144
14168
  children: "Connecting…"
14145
14169
  })]
14146
14170
  }),
14147
- a && !gt && (fe === "error" || fe === "disconnected") && /* @__PURE__ */ H("div", {
14171
+ a && !St && (pe === "error" || pe === "disconnected") && /* @__PURE__ */ H("div", {
14148
14172
  className: "absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",
14149
14173
  children: [
14150
14174
  /* @__PURE__ */ V("svg", {
@@ -14160,16 +14184,16 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
14160
14184
  }),
14161
14185
  /* @__PURE__ */ V("span", {
14162
14186
  className: "text-xs text-red-400 text-center px-4",
14163
- children: fe === "error" ? me || "Connection failed" : "Disconnected"
14187
+ children: pe === "error" ? W || "Connection failed" : "Disconnected"
14164
14188
  }),
14165
14189
  /* @__PURE__ */ V("button", {
14166
- onClick: Ye,
14190
+ onClick: Xe,
14167
14191
  className: "mt-1 inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs bg-white/10 text-white hover:bg-white/20 transition-colors",
14168
14192
  children: "Reconnect"
14169
14193
  })
14170
14194
  ]
14171
14195
  }),
14172
- a && gt && (fe === "connecting" || fe === "disconnected") && /* @__PURE__ */ V("div", {
14196
+ a && St && (pe === "connecting" || pe === "disconnected") && /* @__PURE__ */ V("div", {
14173
14197
  className: "absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55",
14174
14198
  children: /* @__PURE__ */ V("svg", {
14175
14199
  className: "h-3.5 w-3.5 text-white/90 animate-spin",
@@ -14188,9 +14212,9 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
14188
14212
  })
14189
14213
  })
14190
14214
  }),
14191
- a && gt && fe === "error" && /* @__PURE__ */ V("button", {
14192
- onClick: Ye,
14193
- title: me || "Reconnect",
14215
+ a && St && pe === "error" && /* @__PURE__ */ V("button", {
14216
+ onClick: Xe,
14217
+ title: W || "Reconnect",
14194
14218
  className: "absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55 text-white/90 hover:bg-black/75 transition-colors",
14195
14219
  children: /* @__PURE__ */ H("svg", {
14196
14220
  className: "h-3.5 w-3.5",
@@ -14203,14 +14227,14 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
14203
14227
  children: [/* @__PURE__ */ V("path", { d: "M23 4v6h-6M1 20v-6h6" }), /* @__PURE__ */ V("path", { d: "M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15" })]
14204
14228
  })
14205
14229
  }),
14206
- a && fe !== "idle" && fe !== "error" && /* @__PURE__ */ H("div", {
14207
- className: `absolute bottom-0 inset-x-0 z-20 transform-gpu flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${xe || Se ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
14230
+ a && pe !== "idle" && pe !== "error" && /* @__PURE__ */ H("div", {
14231
+ className: `absolute bottom-0 inset-x-0 z-20 transform-gpu flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${Se || Ce ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
14208
14232
  children: [/* @__PURE__ */ V("div", {
14209
14233
  className: "flex items-center gap-1",
14210
14234
  children: /* @__PURE__ */ V(Wf, {
14211
- onClick: et,
14212
- title: he ? "Unmute" : "Mute",
14213
- children: he ? /* @__PURE__ */ H("svg", {
14235
+ onClick: tt,
14236
+ title: ge ? "Unmute" : "Mute",
14237
+ children: ge ? /* @__PURE__ */ H("svg", {
14214
14238
  className: "h-3.5 w-3.5",
14215
14239
  viewBox: "0 0 24 24",
14216
14240
  fill: "none",
@@ -14246,7 +14270,7 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
14246
14270
  className: "flex items-center gap-1",
14247
14271
  children: [
14248
14272
  /* @__PURE__ */ V(Wf, {
14249
- onClick: rt,
14273
+ onClick: it,
14250
14274
  title: "Take snapshot",
14251
14275
  children: /* @__PURE__ */ H("svg", {
14252
14276
  className: "h-3.5 w-3.5",
@@ -14262,8 +14286,8 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
14262
14286
  })]
14263
14287
  })
14264
14288
  }),
14265
- G && /* @__PURE__ */ V(Wf, {
14266
- onClick: nt,
14289
+ be && /* @__PURE__ */ V(Wf, {
14290
+ onClick: rt,
14267
14291
  title: "Picture-in-Picture",
14268
14292
  children: /* @__PURE__ */ H("svg", {
14269
14293
  className: "h-3.5 w-3.5",
@@ -14283,9 +14307,9 @@ function Uf({ serverUrl: e, streamKey: t, label: n, autoPlay: r = !0, muted: i =
14283
14307
  })
14284
14308
  }),
14285
14309
  /* @__PURE__ */ V(Wf, {
14286
- onClick: tt,
14287
- title: ve ? "Exit fullscreen" : "Fullscreen",
14288
- children: ve ? /* @__PURE__ */ V("svg", {
14310
+ onClick: nt,
14311
+ title: ye ? "Exit fullscreen" : "Fullscreen",
14312
+ children: ye ? /* @__PURE__ */ V("svg", {
14289
14313
  className: "h-3.5 w-3.5",
14290
14314
  viewBox: "0 0 24 24",
14291
14315
  fill: "none",
@@ -15476,26 +15500,26 @@ function Nm(e, t) {
15476
15500
  return t ? (Am[e] ?? 0) >= (Am[t] ?? 0) : !0;
15477
15501
  }
15478
15502
  function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integrationId: i, requestId: a, level: s, maxHeight: d = "max-h-96", showScope: f = !1, showDeviceChip: p = !1, showFilters: m = !0, limit: g = 100, liveBuffer: _, onClose: y, className: b }) {
15479
- let [x, S] = l(""), [C, w] = l(""), [T, E] = l(s ?? "info"), D = e, O = t ?? (x || void 0), k = n ?? (C ? Number(C) : void 0), ee = i, te = a, A = h(() => {
15503
+ let [x, S] = l(""), [C, w] = l(""), [T, E] = l(s ?? "info"), D = e, O = t ?? (x || void 0), k = n ?? (C ? Number(C) : void 0), ee = i, A = a, te = h(() => {
15480
15504
  let e = {};
15481
- return D && (e.agentId = D), O && (e.addonId = O), r !== void 0 && Number.isFinite(r) ? e.containerDeviceId = r : k !== void 0 && Number.isFinite(k) && (e.deviceId = k), ee && (e.integrationId = ee), te && (e.requestId = te), Object.keys(e).length > 0 ? e : void 0;
15505
+ return D && (e.agentId = D), O && (e.addonId = O), r !== void 0 && Number.isFinite(r) ? e.containerDeviceId = r : k !== void 0 && Number.isFinite(k) && (e.deviceId = k), ee && (e.integrationId = ee), A && (e.requestId = A), Object.keys(e).length > 0 ? e : void 0;
15482
15506
  }, [
15483
15507
  D,
15484
15508
  O,
15485
15509
  k,
15486
15510
  r,
15487
15511
  ee,
15488
- te
15489
- ]), j = Em(Mm), M = _ ?? j, P = M.entries, [F, ne] = l(0), [L, R] = l(!0), z = u(!1), [re, B] = l(!1), [ae, oe] = l(!1), [U, se] = l(/* @__PURE__ */ new Set()), [ce, le] = l(""), ue = u(null), de = `${D ?? ""}:${O ?? ""}:${String(k ?? "")}:${String(r ?? "")}:${ee ?? ""}:${te ?? ""}`, fe = u(de);
15512
+ A
15513
+ ]), ne = Em(Mm), j = _ ?? ne, M = j.entries, [N, F] = l(0), [I, L] = l(!0), R = u(!1), [z, B] = l(!1), [ae, oe] = l(!1), [U, se] = l(/* @__PURE__ */ new Set()), [ce, le] = l(""), ue = u(null), de = `${D ?? ""}:${O ?? ""}:${String(k ?? "")}:${String(r ?? "")}:${ee ?? ""}:${A ?? ""}`, fe = u(de);
15490
15514
  v(() => {
15491
- fe.current !== de && (fe.current = de, M.reset(), ne(0), se(/* @__PURE__ */ new Set()), B(!1));
15492
- }, [de, M]);
15515
+ fe.current !== de && (fe.current = de, j.reset(), F(0), se(/* @__PURE__ */ new Set()), B(!1));
15516
+ }, [de, j]);
15493
15517
  let { data: pe, isLoading: me } = J.logs.query.useQuery({
15494
- ...A ? { tags: A } : {},
15518
+ ...te ? { tags: te } : {},
15495
15519
  limit: g
15496
15520
  }, { staleTime: 3e4 });
15497
- J.logs.subscribe.useSubscription(A ? { tags: A } : {}, { onData: (e) => {
15498
- M.append(e);
15521
+ J.logs.subscribe.useSubscription(te ? { tags: te } : {}, { onData: (e) => {
15522
+ j.append(e);
15499
15523
  } });
15500
15524
  let W = h(() => {
15501
15525
  let e = (pe ?? []).map((e) => ({
@@ -15507,8 +15531,8 @@ function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integra
15507
15531
  meta: e.meta
15508
15532
  })), t = /* @__PURE__ */ new Map();
15509
15533
  for (let n of e) t.set(`${n.timestamp}|${n.level}|${n.scope ?? ""}|${n.message}`, n);
15510
- for (let e of P) t.set(`${e.timestamp}|${e.level}|${e.scope ?? ""}|${e.message}`, e);
15511
- let n = [...t.values()].toSorted((e, t) => new Date(e.timestamp).getTime() - new Date(t.timestamp).getTime()), r = (F > 0 ? n.filter((e) => new Date(e.timestamp).getTime() > F) : n).filter((e) => Nm(e.level, T)), i = ce.trim().toLowerCase();
15534
+ for (let e of M) t.set(`${e.timestamp}|${e.level}|${e.scope ?? ""}|${e.message}`, e);
15535
+ let n = [...t.values()].toSorted((e, t) => new Date(e.timestamp).getTime() - new Date(t.timestamp).getTime()), r = (N > 0 ? n.filter((e) => new Date(e.timestamp).getTime() > N) : n).filter((e) => Nm(e.level, T)), i = ce.trim().toLowerCase();
15512
15536
  return i ? r.filter((e) => {
15513
15537
  if (e.message.toLowerCase().includes(i) || e.scope && e.scope.toLowerCase().includes(i)) return !0;
15514
15538
  if (e.tags) {
@@ -15521,38 +15545,38 @@ function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integra
15521
15545
  }) : r;
15522
15546
  }, [
15523
15547
  pe,
15524
- P,
15548
+ M,
15525
15549
  T,
15526
- F,
15550
+ N,
15527
15551
  ce
15528
15552
  ]), he = o((e) => {
15529
15553
  let t = ue.current;
15530
- t && (z.current = !0, t.scrollTo({
15554
+ t && (R.current = !0, t.scrollTo({
15531
15555
  top: t.scrollHeight,
15532
15556
  ...e ? { behavior: e } : {}
15533
15557
  }));
15534
15558
  }, []), [ge, _e] = l(!1), ve = u(W.length);
15535
15559
  c(() => {
15536
15560
  let e = W.length > ve.current;
15537
- ve.current = W.length, e && (L ? he() : _e(!0));
15561
+ ve.current = W.length, e && (I ? he() : _e(!0));
15538
15562
  }, [
15539
15563
  W.length,
15540
- L,
15564
+ I,
15541
15565
  he
15542
15566
  ]), v(() => {
15543
- L && ge && _e(!1);
15544
- }, [L, ge]);
15567
+ I && ge && _e(!1);
15568
+ }, [I, ge]);
15545
15569
  let ye = o(() => {
15546
- R(!0), he("smooth");
15570
+ L(!0), he("smooth");
15547
15571
  }, [he]), G = o(() => {
15548
- if (z.current) {
15549
- z.current = !1;
15572
+ if (R.current) {
15573
+ R.current = !1;
15550
15574
  return;
15551
15575
  }
15552
15576
  let e = ue.current;
15553
15577
  if (!e) return;
15554
15578
  let t = Dm(e, 40);
15555
- R((e) => e === t ? e : t);
15579
+ L((e) => e === t ? e : t);
15556
15580
  }, []), be = h(() => W.filter((e) => e.tags && Object.keys(e.tags).length > 0 || e.meta && Object.keys(e.meta).length > 0).map((e) => `${e.timestamp}|${e.level}|${e.scope ?? ""}|${e.message}`), [W]), xe = o(() => {
15557
15581
  B((e) => (e && se(/* @__PURE__ */ new Set()), !e));
15558
15582
  }, []), Se = o(() => {
@@ -15564,11 +15588,11 @@ function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integra
15564
15588
  oe(!0), setTimeout(() => oe(!1), 1500);
15565
15589
  });
15566
15590
  }, [W]), Ce = J.logs.clear.useMutation(), we = o(() => {
15567
- ne(Date.now()), M.reset(), Ce.mutate(A ? { tags: A } : {});
15591
+ F(Date.now()), j.reset(), Ce.mutate(te ? { tags: te } : {});
15568
15592
  }, [
15569
- M,
15593
+ j,
15570
15594
  Ce,
15571
- A
15595
+ te
15572
15596
  ]), Te = o((e) => {
15573
15597
  se((t) => {
15574
15598
  let n = new Set(t);
@@ -15616,16 +15640,16 @@ function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integra
15616
15640
  }),
15617
15641
  /* @__PURE__ */ V(Rm, {
15618
15642
  icon: Ge,
15619
- label: L ? "Following" : "Paused",
15620
- active: L,
15643
+ label: I ? "Following" : "Paused",
15644
+ active: I,
15621
15645
  onClick: () => {
15622
- L ? R(!1) : ye();
15646
+ I ? L(!1) : ye();
15623
15647
  }
15624
15648
  }),
15625
15649
  /* @__PURE__ */ V(Rm, {
15626
- icon: re ? _t : vt,
15627
- label: re ? "Collapse" : "Expand",
15628
- active: re,
15650
+ icon: z ? _t : vt,
15651
+ label: z ? "Collapse" : "Expand",
15652
+ active: z,
15629
15653
  onClick: xe,
15630
15654
  disabled: be.length === 0
15631
15655
  }),
@@ -15656,11 +15680,11 @@ function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integra
15656
15680
  children: /* @__PURE__ */ V(Vr, { className: "h-2.5 w-2.5" })
15657
15681
  })]
15658
15682
  }),
15659
- P.length > 0 && /* @__PURE__ */ H("span", {
15683
+ M.length > 0 && /* @__PURE__ */ H("span", {
15660
15684
  className: "text-[9px] text-emerald-400 font-medium",
15661
15685
  children: [
15662
15686
  "+",
15663
- P.length,
15687
+ M.length,
15664
15688
  " live"
15665
15689
  ]
15666
15690
  })
@@ -15703,7 +15727,7 @@ function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integra
15703
15727
  }),
15704
15728
  /* @__PURE__ */ H("div", {
15705
15729
  className: "relative flex-1 min-h-0 flex flex-col",
15706
- children: [!L && ge && /* @__PURE__ */ H("button", {
15730
+ children: [!I && ge && /* @__PURE__ */ H("button", {
15707
15731
  type: "button",
15708
15732
  onClick: ye,
15709
15733
  className: "absolute bottom-2 left-1/2 -translate-x-1/2 z-10 inline-flex items-center gap-1 px-2 py-1 rounded-full border border-primary/40 bg-primary/15 text-primary text-[10px] font-medium shadow-md backdrop-blur-sm hover:bg-primary/25 transition-colors",
@@ -15725,7 +15749,7 @@ function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integra
15725
15749
  W.length > 0 && /* @__PURE__ */ V("table", {
15726
15750
  className: "w-full",
15727
15751
  children: /* @__PURE__ */ V("tbody", { children: W.map((e) => {
15728
- let t = km[e.level] ?? km.info, n = t.icon, r = ke(e), i = re || U.has(r), a = e.tags && Object.keys(e.tags).length > 0, o = e.meta && Object.keys(e.meta).length > 0, s = a || o;
15752
+ let t = km[e.level] ?? km.info, n = t.icon, r = ke(e), i = z || U.has(r), a = e.tags && Object.keys(e.tags).length > 0, o = e.meta && Object.keys(e.meta).length > 0, s = a || o;
15729
15753
  return /* @__PURE__ */ H("tr", {
15730
15754
  className: Z("hover:bg-surface-hover/30 border-b border-border/30", s && "cursor-pointer"),
15731
15755
  onClick: s ? () => Te(r) : void 0,
@@ -15747,7 +15771,7 @@ function Pm({ agentId: e, addonId: t, deviceId: n, containerDeviceId: r, integra
15747
15771
  className: "px-2 py-1 text-foreground break-all",
15748
15772
  children: /* @__PURE__ */ H("div", {
15749
15773
  className: "flex items-start gap-1",
15750
- children: [s && V(i ? I : N, { className: "h-3 w-3 text-foreground-subtle shrink-0 mt-0.5" }), /* @__PURE__ */ H("div", {
15774
+ children: [s && V(i ? P : re, { className: "h-3 w-3 text-foreground-subtle shrink-0 mt-0.5" }), /* @__PURE__ */ H("div", {
15751
15775
  className: "flex-1 min-w-0",
15752
15776
  children: [
15753
15777
  p && e.tags?.deviceId !== void 0 && /* @__PURE__ */ V(Fm, {
@@ -15883,7 +15907,7 @@ var Bm = {
15883
15907
  label: "Updated"
15884
15908
  },
15885
15909
  [G.AddonStopped]: {
15886
- icon: z,
15910
+ icon: R,
15887
15911
  color: "bg-foreground-subtle/10 text-foreground-subtle border-border",
15888
15912
  label: "Stopped"
15889
15913
  },
@@ -15948,7 +15972,7 @@ var Bm = {
15948
15972
  label: "Provider Det"
15949
15973
  },
15950
15974
  [G.PipelineAudioInferenceResult]: {
15951
- icon: L,
15975
+ icon: I,
15952
15976
  color: "bg-pink-500/15 text-pink-400 border-pink-500/30",
15953
15977
  label: "Audio"
15954
15978
  },
@@ -15958,7 +15982,7 @@ var Bm = {
15958
15982
  label: "Agent Online"
15959
15983
  },
15960
15984
  [G.AgentOffline]: {
15961
- icon: z,
15985
+ icon: R,
15962
15986
  color: "bg-red-500/15 text-red-400 border-red-500/30",
15963
15987
  label: "Agent Offline"
15964
15988
  },
@@ -16080,19 +16104,19 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16080
16104
  v(() => {
16081
16105
  S.current !== y && (S.current = y, x(new Set(_)));
16082
16106
  }, [y, _]);
16083
- let C = Em(Jm), w = p ?? C, T = w.entries, [E, D] = l(!0), [O, k] = l(/* @__PURE__ */ new Set()), [ee, te] = l(""), [A, j] = l(!1), [P, F] = l(""), [ne, L] = l(0), R = u(null), z = u(null), re = `${e ?? ""}:${t ?? ""}:${String(n ?? "")}:${a ?? ""}`, B = u(re);
16107
+ let C = Em(Jm), w = p ?? C, T = w.entries, [E, D] = l(!0), [O, k] = l(/* @__PURE__ */ new Set()), [ee, A] = l(""), [te, ne] = l(!1), [M, N] = l(""), [F, I] = l(0), L = u(null), R = u(null), z = `${e ?? ""}:${t ?? ""}:${String(n ?? "")}:${a ?? ""}`, B = u(z);
16084
16108
  v(() => {
16085
- B.current !== re && (B.current = re, w.reset(), k(/* @__PURE__ */ new Set()), L(0));
16086
- }, [re, w]), v(() => {
16087
- if (!A) return;
16109
+ B.current !== z && (B.current = z, w.reset(), k(/* @__PURE__ */ new Set()), I(0));
16110
+ }, [z, w]), v(() => {
16111
+ if (!te) return;
16088
16112
  let e = (e) => {
16089
- let t = z.current;
16090
- t && e.target instanceof Node && !t.contains(e.target) && j(!1);
16113
+ let t = R.current;
16114
+ t && e.target instanceof Node && !t.contains(e.target) && ne(!1);
16091
16115
  };
16092
16116
  return document.addEventListener("mousedown", e), () => {
16093
16117
  document.removeEventListener("mousedown", e);
16094
16118
  };
16095
- }, [A]);
16119
+ }, [te]);
16096
16120
  let ae = h(() => {
16097
16121
  let r = {};
16098
16122
  return e && (r.agentId = e), t && (r.addonId = t), n !== void 0 && (r.deviceId = n), a && (r.category = a), r;
@@ -16123,7 +16147,7 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16123
16147
  } });
16124
16148
  let de = u(T.length);
16125
16149
  v(() => {
16126
- let e = R.current;
16150
+ let e = L.current;
16127
16151
  if (!e) {
16128
16152
  de.current = T.length;
16129
16153
  return;
@@ -16142,7 +16166,7 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16142
16166
  for (let t of se ?? []) e.set(t.id, t);
16143
16167
  for (let t of T) e.set(t.id, t);
16144
16168
  let t = [...e.values()].filter((e) => b.has(e.category)).filter(qm);
16145
- ne > 0 && (t = t.filter((e) => new Date(e.timestamp).getTime() > ne));
16169
+ F > 0 && (t = t.filter((e) => new Date(e.timestamp).getTime() > F));
16146
16170
  let n = ee.trim().toLowerCase();
16147
16171
  return n && (t = t.filter((e) => {
16148
16172
  if (e.category.toLowerCase().includes(n) || Vm(e.category, e.data).label.toLowerCase().includes(n)) return !0;
@@ -16161,7 +16185,7 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16161
16185
  T,
16162
16186
  b,
16163
16187
  ee,
16164
- ne
16188
+ F
16165
16189
  ]), pe = o((e) => {
16166
16190
  k((t) => {
16167
16191
  let n = new Set(t);
@@ -16173,9 +16197,9 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16173
16197
  return n.has(e) ? n.delete(e) : n.add(e), n;
16174
16198
  });
16175
16199
  }, []), W = o(() => {
16176
- x(new Set(_)), te(""), L(0);
16200
+ x(new Set(_)), A(""), I(0);
16177
16201
  }, [_]), he = o(() => {
16178
- L(Date.now()), w.reset();
16202
+ I(Date.now()), w.reset();
16179
16203
  }, [w]), [ge, _e] = l(!1), [ve, ye] = l(null), G = o((e) => {
16180
16204
  let t = new Date(e.timestamp).toISOString(), n = Km(e.category, e.data) ?? "", r = n ? ` ${n}` : "";
16181
16205
  return `${t} [${e.category}]${r} data=${JSON.stringify(e.data)}`;
@@ -16193,9 +16217,9 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16193
16217
  }, []), Ce = o(() => {
16194
16218
  x(/* @__PURE__ */ new Set());
16195
16219
  }, []), we = h(() => {
16196
- let e = P.trim().toLowerCase();
16220
+ let e = M.trim().toLowerCase();
16197
16221
  return e ? Hm.filter((t) => t.toLowerCase().includes(e)) : Hm;
16198
- }, [P]), Te = Hm.length, Ee = b.size, De = Ee === Te, Oe = De ? "All" : `${Ee}/${Te}`;
16222
+ }, [M]), Te = Hm.length, Ee = b.size, De = Ee === Te, Oe = De ? "All" : `${Ee}/${Te}`;
16199
16223
  return /* @__PURE__ */ H("div", {
16200
16224
  className: Z("h-full min-h-0 flex flex-col", g),
16201
16225
  onClick: (e) => e.stopPropagation(),
@@ -16227,7 +16251,7 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16227
16251
  /* @__PURE__ */ H("button", {
16228
16252
  type: "button",
16229
16253
  onClick: () => {
16230
- D((e) => !e), !E && R.current && R.current.scrollTo({
16254
+ D((e) => !e), !E && L.current && L.current.scrollTo({
16231
16255
  top: 0,
16232
16256
  behavior: "smooth"
16233
16257
  });
@@ -16237,10 +16261,10 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16237
16261
  }),
16238
16262
  d && /* @__PURE__ */ H("div", {
16239
16263
  className: "relative",
16240
- ref: z,
16264
+ ref: R,
16241
16265
  children: [/* @__PURE__ */ H("button", {
16242
16266
  type: "button",
16243
- onClick: () => j((e) => !e),
16267
+ onClick: () => ne((e) => !e),
16244
16268
  className: Z("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors", De ? "border-border text-foreground-subtle hover:text-foreground" : "border-violet-500/30 bg-violet-500/10 text-violet-400"),
16245
16269
  title: "Pick events to track",
16246
16270
  children: [
@@ -16249,9 +16273,9 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16249
16273
  Oe,
16250
16274
  ")"
16251
16275
  ]
16252
- }), A && /* @__PURE__ */ V(Xm, {
16253
- search: P,
16254
- onSearchChange: F,
16276
+ }), te && /* @__PURE__ */ V(Xm, {
16277
+ search: M,
16278
+ onSearchChange: N,
16255
16279
  categories: we,
16256
16280
  active: b,
16257
16281
  onToggle: me,
@@ -16265,7 +16289,7 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16265
16289
  onClick: W,
16266
16290
  className: "inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground transition-colors",
16267
16291
  title: "Reset filters to defaults",
16268
- children: [/* @__PURE__ */ V(M, { className: "h-2.5 w-2.5" }), "Reset"]
16292
+ children: [/* @__PURE__ */ V(j, { className: "h-2.5 w-2.5" }), "Reset"]
16269
16293
  }),
16270
16294
  /* @__PURE__ */ H("button", {
16271
16295
  type: "button",
@@ -16287,12 +16311,12 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16287
16311
  children: [/* @__PURE__ */ V("input", {
16288
16312
  type: "text",
16289
16313
  value: ee,
16290
- onChange: (e) => te(e.target.value),
16314
+ onChange: (e) => A(e.target.value),
16291
16315
  placeholder: "Search…",
16292
16316
  className: "w-32 pl-1.5 pr-5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"
16293
16317
  }), ee && /* @__PURE__ */ V("button", {
16294
16318
  type: "button",
16295
- onClick: () => te(""),
16319
+ onClick: () => A(""),
16296
16320
  className: "absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",
16297
16321
  title: "Clear search",
16298
16322
  children: /* @__PURE__ */ V(Vr, { className: "h-2.5 w-2.5" })
@@ -16314,7 +16338,7 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16314
16338
  children: /* @__PURE__ */ V(Vr, { className: "h-3.5 w-3.5" })
16315
16339
  })]
16316
16340
  }), /* @__PURE__ */ H("div", {
16317
- ref: R,
16341
+ ref: L,
16318
16342
  className: Z("flex-1 min-h-0 overflow-auto text-[10px]", s),
16319
16343
  children: [
16320
16344
  ce && /* @__PURE__ */ H("div", {
@@ -16347,7 +16371,7 @@ function Ym({ agentId: e, addonId: t, deviceId: n, defaultCategories: r, categor
16347
16371
  /* @__PURE__ */ H("div", {
16348
16372
  className: "flex items-center gap-1.5",
16349
16373
  children: [
16350
- V(i ? I : N, { className: "h-3 w-3 text-foreground-subtle shrink-0" }),
16374
+ V(i ? P : re, { className: "h-3 w-3 text-foreground-subtle shrink-0" }),
16351
16375
  /* @__PURE__ */ H("span", {
16352
16376
  className: Z("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[9px] font-medium", t.color),
16353
16377
  children: [/* @__PURE__ */ V(n, { className: "h-2.5 w-2.5" }), t.label]
@@ -16837,7 +16861,7 @@ function bh({ trpc: e, deviceId: t, layout: n, optimistic: r, features: i }) {
16837
16861
  m(!1);
16838
16862
  }
16839
16863
  }
16840
- }, O = _ ? "Unlock" : "Lock", k = d === "open" ? "Open door?" : "Unlock device?", ee = d === "open" ? "This will release the latch and open the door." : "This will unlock the device.", te = d === "open" ? "Confirm open" : "Confirm unlock", A = V(d === "open" ? zt : _n, { className: "h-4 w-4 text-amber-400" });
16864
+ }, O = _ ? "Unlock" : "Lock", k = d === "open" ? "Open door?" : "Unlock device?", ee = d === "open" ? "This will release the latch and open the door." : "This will unlock the device.", A = d === "open" ? "Confirm open" : "Confirm unlock", te = V(d === "open" ? zt : _n, { className: "h-4 w-4 text-amber-400" });
16841
16865
  return /* @__PURE__ */ H("div", {
16842
16866
  className: Z("inline-flex items-center", n === "full" ? "gap-2" : "gap-1"),
16843
16867
  children: [
@@ -16874,7 +16898,7 @@ function bh({ trpc: e, deviceId: t, layout: n, optimistic: r, features: i }) {
16874
16898
  children: [
16875
16899
  /* @__PURE__ */ H(Md, { children: [/* @__PURE__ */ H(Pd, {
16876
16900
  className: "flex items-center gap-2",
16877
- children: [A, k]
16901
+ children: [te, k]
16878
16902
  }), /* @__PURE__ */ V(Fd, { children: ee })] }),
16879
16903
  h !== null && /* @__PURE__ */ V("div", {
16880
16904
  className: "mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10 text-xs text-danger",
@@ -16891,12 +16915,12 @@ function bh({ trpc: e, deviceId: t, layout: n, optimistic: r, features: i }) {
16891
16915
  type: "button",
16892
16916
  variant: "danger",
16893
16917
  size: "sm",
16894
- "aria-label": te,
16918
+ "aria-label": A,
16895
16919
  disabled: p,
16896
16920
  onClick: () => {
16897
16921
  D();
16898
16922
  },
16899
- children: [p && /* @__PURE__ */ V(gn, { className: "h-3.5 w-3.5 animate-spin" }), te]
16923
+ children: [p && /* @__PURE__ */ V(gn, { className: "h-3.5 w-3.5 animate-spin" }), A]
16900
16924
  })] })
16901
16925
  ]
16902
16926
  })
@@ -18041,14 +18065,14 @@ function dg({ trpc: e, deviceId: t, optimistic: n }) {
18041
18065
  busy: l,
18042
18066
  variant: c.stop,
18043
18067
  onClick: () => u(r?.stop, { state: "stopped" }),
18044
- children: /* @__PURE__ */ V(z, { className: "h-3 w-3" })
18068
+ children: /* @__PURE__ */ V(R, { className: "h-3 w-3" })
18045
18069
  }),
18046
18070
  /* @__PURE__ */ V(ug, {
18047
18071
  label: "Close",
18048
18072
  busy: l,
18049
18073
  variant: c.down,
18050
18074
  onClick: () => u(r?.close, { state: "closing" }),
18051
- children: /* @__PURE__ */ V(I, { className: "h-3.5 w-3.5" })
18075
+ children: /* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" })
18052
18076
  }),
18053
18077
  o !== void 0 && o.position !== null && /* @__PURE__ */ H("span", {
18054
18078
  className: "tabular-nums text-xs text-foreground-subtle ml-1",
@@ -18231,14 +18255,14 @@ function gg({ trpc: e, deviceId: t, features: n, optimistic: r }) {
18231
18255
  busy: l,
18232
18256
  variant: f.stop,
18233
18257
  onClick: () => g(i?.stop, { state: "stopped" }),
18234
- children: /* @__PURE__ */ V(z, { className: "h-4 w-4" })
18258
+ children: /* @__PURE__ */ V(R, { className: "h-4 w-4" })
18235
18259
  }),
18236
18260
  /* @__PURE__ */ V(fg, {
18237
18261
  label: "Close",
18238
18262
  busy: l,
18239
18263
  variant: f.down,
18240
18264
  onClick: () => g(i?.close, { state: "closing" }),
18241
- children: /* @__PURE__ */ V(I, { className: "h-5 w-5" })
18265
+ children: /* @__PURE__ */ V(P, { className: "h-5 w-5" })
18242
18266
  })
18243
18267
  ]
18244
18268
  })
@@ -19045,7 +19069,7 @@ function Jg({ trpc: e, deviceId: t }) {
19045
19069
  busy: a,
19046
19070
  active: !1,
19047
19071
  onClick: () => l(n.stop),
19048
- children: /* @__PURE__ */ V(z, { className: "h-4 w-4" })
19072
+ children: /* @__PURE__ */ V(R, { className: "h-4 w-4" })
19049
19073
  }),
19050
19074
  /* @__PURE__ */ V(qg, {
19051
19075
  label: "Return to base",
@@ -19600,14 +19624,14 @@ function f_({ trpc: e, deviceId: t, optimistic: n }) {
19600
19624
  busy: c,
19601
19625
  variant: l.stop,
19602
19626
  onClick: () => u(r.stop, { state: "stopped" }),
19603
- children: /* @__PURE__ */ V(z, { className: "h-3 w-3" })
19627
+ children: /* @__PURE__ */ V(R, { className: "h-3 w-3" })
19604
19628
  }),
19605
19629
  /* @__PURE__ */ V(d_, {
19606
19630
  label: "Close",
19607
19631
  busy: c,
19608
19632
  variant: l.down,
19609
19633
  onClick: () => u(r.close, { state: "closing" }),
19610
- children: /* @__PURE__ */ V(I, { className: "h-3.5 w-3.5" })
19634
+ children: /* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" })
19611
19635
  }),
19612
19636
  o !== void 0 && o.position !== null && /* @__PURE__ */ H("span", {
19613
19637
  className: "tabular-nums text-xs text-foreground-subtle ml-1",
@@ -19864,14 +19888,14 @@ function __({ trpc: e, deviceId: t, features: n, optimistic: r }) {
19864
19888
  busy: l,
19865
19889
  variant: d.stop,
19866
19890
  onClick: () => h(i.stop, { state: "stopped" }),
19867
- children: /* @__PURE__ */ V(z, { className: "h-4 w-4" })
19891
+ children: /* @__PURE__ */ V(R, { className: "h-4 w-4" })
19868
19892
  }),
19869
19893
  /* @__PURE__ */ V(g_, {
19870
19894
  label: "Close",
19871
19895
  busy: l,
19872
19896
  variant: d.down,
19873
19897
  onClick: () => h(i.close, { state: "closing" }),
19874
- children: /* @__PURE__ */ V(I, { className: "h-5 w-5" })
19898
+ children: /* @__PURE__ */ V(P, { className: "h-5 w-5" })
19875
19899
  })
19876
19900
  ]
19877
19901
  })
@@ -20992,7 +21016,7 @@ function W_({ url: e, alt: t, open: n, onOpenChange: r }) {
20992
21016
  label: "Reset zoom",
20993
21017
  disabled: i === 1,
20994
21018
  onClick: u,
20995
- children: /* @__PURE__ */ V(M, { className: "h-4 w-4" })
21019
+ children: /* @__PURE__ */ V(j, { className: "h-4 w-4" })
20996
21020
  }),
20997
21021
  /* @__PURE__ */ V(G_, {
20998
21022
  label: "Close",
@@ -21898,7 +21922,7 @@ function Sv({ label: e, icon: t, value: n, options: r, disabled: i, onChange: a
21898
21922
  children: e.label
21899
21923
  }, e.value))
21900
21924
  }),
21901
- /* @__PURE__ */ V(I, { className: "h-3 w-3 shrink-0 text-foreground-subtle" })
21925
+ /* @__PURE__ */ V(P, { className: "h-3 w-3 shrink-0 text-foreground-subtle" })
21902
21926
  ]
21903
21927
  })]
21904
21928
  });
@@ -26499,7 +26523,7 @@ b(), b();
26499
26523
  //#region ../ui-library/src/composites/device-meta.ts
26500
26524
  var TE = {
26501
26525
  [q.Camera]: {
26502
- icon: te,
26526
+ icon: A,
26503
26527
  label: "Camera"
26504
26528
  },
26505
26529
  [q.Hub]: {
@@ -26652,7 +26676,7 @@ var TE = {
26652
26676
  label: "Night vision"
26653
26677
  },
26654
26678
  [K.PrivacyMask]: {
26655
- icon: R,
26679
+ icon: L,
26656
26680
  label: "Privacy mask"
26657
26681
  },
26658
26682
  [K.Doorbell]: {
@@ -27111,15 +27135,15 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27111
27135
  let e = window.prompt("Template name:");
27112
27136
  e?.trim() && o(e.trim(), t);
27113
27137
  }
27114
- function te() {
27138
+ function A() {
27115
27139
  if (!i) return;
27116
27140
  let e = r.find((e) => e.id === i);
27117
27141
  e && window.confirm(`Delete template "${e.name}"?`) && c(i);
27118
27142
  }
27119
- function A(e) {
27120
- n(t.map((t) => t.addonId === e.addonId ? j(e) : t));
27143
+ function te(e) {
27144
+ n(t.map((t) => t.addonId === e.addonId ? ne(e) : t));
27121
27145
  }
27122
- function j(e) {
27146
+ function ne(e) {
27123
27147
  let t = e.children.some((e) => e.enabled || e.children.some((e) => e.enabled));
27124
27148
  return {
27125
27149
  ...e,
@@ -27133,25 +27157,25 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27133
27157
  })
27134
27158
  };
27135
27159
  }
27136
- function M(e, r) {
27160
+ function j(e, r) {
27137
27161
  let i = zE(r);
27138
27162
  n(t.map((t) => t.addonId === e ? {
27139
27163
  ...t,
27140
27164
  children: [...t.children, i]
27141
27165
  } : t));
27142
27166
  }
27143
- function N(e) {
27167
+ function re(e) {
27144
27168
  let t = /* @__PURE__ */ new Set();
27145
27169
  for (let n of e) {
27146
27170
  t.add(n.addonId);
27147
27171
  for (let e of n.children) t.add(e.addonId);
27148
- let e = N(n.children);
27172
+ let e = re(n.children);
27149
27173
  for (let n of e) t.add(n);
27150
27174
  }
27151
27175
  return t;
27152
27176
  }
27153
- let P = N(t);
27154
- function F(t) {
27177
+ let M = re(t);
27178
+ function N(t) {
27155
27179
  let n = w.get(t.addonId);
27156
27180
  if (!n) return [];
27157
27181
  let r = e.slots.find((e) => e.id === n.slot)?.parentSlot == null, i = n.childSlots, a = new Set(t.children.map((e) => e.addonId)), o = [];
@@ -27162,21 +27186,21 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27162
27186
  }
27163
27187
  return o;
27164
27188
  }
27165
- function I(e) {
27189
+ function P(e) {
27166
27190
  let r = p ? {
27167
27191
  ...e,
27168
27192
  children: e.children.filter((e) => e.enabled).map((e) => ({
27169
27193
  ...e,
27170
27194
  children: e.children.filter((e) => e.enabled)
27171
27195
  }))
27172
- } : e, i = p ? [] : F(r);
27196
+ } : e, i = p ? [] : N(r);
27173
27197
  return /* @__PURE__ */ H("div", {
27174
27198
  className: "space-y-1.5",
27175
27199
  children: [/* @__PURE__ */ V(ed, {
27176
27200
  step: r,
27177
27201
  schema: w.get(r.addonId) ?? null,
27178
27202
  allSchemas: w,
27179
- onChange: A,
27203
+ onChange: te,
27180
27204
  onDelete: u ? void 0 : (e) => n(t.filter((t) => t.addonId !== e)),
27181
27205
  readOnly: u,
27182
27206
  ...S(r.addonId)
@@ -27188,7 +27212,7 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27188
27212
  children: "Slot: Cropper / Classifier"
27189
27213
  }),
27190
27214
  r.children.map((e) => {
27191
- let t = F(e);
27215
+ let t = N(e);
27192
27216
  return /* @__PURE__ */ H("div", {
27193
27217
  className: "space-y-1.5",
27194
27218
  children: [/* @__PURE__ */ V(ed, {
@@ -27197,13 +27221,13 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27197
27221
  allSchemas: w,
27198
27222
  depth: 1,
27199
27223
  onChange: (e) => {
27200
- A({
27224
+ te({
27201
27225
  ...r,
27202
27226
  children: r.children.map((t) => t.addonId === e.addonId ? e : t)
27203
27227
  });
27204
27228
  },
27205
27229
  onDelete: u ? void 0 : (e) => {
27206
- A({
27230
+ te({
27207
27231
  ...r,
27208
27232
  children: r.children.filter((t) => t.addonId !== e)
27209
27233
  });
@@ -27223,7 +27247,7 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27223
27247
  allSchemas: w,
27224
27248
  depth: 2,
27225
27249
  onChange: (t) => {
27226
- A({
27250
+ te({
27227
27251
  ...r,
27228
27252
  children: r.children.map((n) => n.addonId === e.addonId ? {
27229
27253
  ...n,
@@ -27232,7 +27256,7 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27232
27256
  });
27233
27257
  },
27234
27258
  onDelete: u ? void 0 : (t) => {
27235
- A({
27259
+ te({
27236
27260
  ...r,
27237
27261
  children: r.children.map((n) => n.addonId === e.addonId ? {
27238
27262
  ...n,
@@ -27247,7 +27271,7 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27247
27271
  addon: t,
27248
27272
  onClick: () => {
27249
27273
  let n = zE(t);
27250
- A({
27274
+ te({
27251
27275
  ...r,
27252
27276
  children: r.children.map((t) => t.addonId === e.addonId ? {
27253
27277
  ...t,
@@ -27262,13 +27286,13 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27262
27286
  }),
27263
27287
  !u && i.map((e) => /* @__PURE__ */ V(BE, {
27264
27288
  addon: e,
27265
- onClick: () => M(r.addonId, e)
27289
+ onClick: () => j(r.addonId, e)
27266
27290
  }, e.id))
27267
27291
  ]
27268
27292
  })]
27269
27293
  }, r.addonId);
27270
27294
  }
27271
- let ne = e.slots.filter((e) => e.parentSlot === null).toSorted((e, t) => e.priority - t.priority);
27295
+ let F = e.slots.filter((e) => e.parentSlot === null).toSorted((e, t) => e.priority - t.priority);
27272
27296
  return /* @__PURE__ */ H("div", {
27273
27297
  className: "space-y-4",
27274
27298
  children: [
@@ -27308,7 +27332,7 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27308
27332
  children: /* @__PURE__ */ V(Nt, { className: "h-4 w-4" })
27309
27333
  }),
27310
27334
  /* @__PURE__ */ V("button", {
27311
- onClick: te,
27335
+ onClick: A,
27312
27336
  disabled: !i || u,
27313
27337
  title: "Delete",
27314
27338
  className: Z("p-2 rounded-lg border border-border transition-colors", i && !u ? "text-foreground-subtle hover:text-danger" : "text-foreground-subtle/30 cursor-not-allowed"),
@@ -27331,8 +27355,8 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27331
27355
  })]
27332
27356
  }), T.map((e, t) => /* @__PURE__ */ H("div", { children: ["• ", e] }, t))]
27333
27357
  }),
27334
- ne.map((e) => {
27335
- let r = t.filter((t) => t.slot === e.id && !C.has(t.addonId)), i = p ? r.filter((e) => e.enabled) : r, a = p ? [] : e.addons.filter((e) => !P.has(e.id) && !C.has(e.id)), o = /* @__PURE__ */ new Map(), s = [];
27358
+ F.map((e) => {
27359
+ let r = t.filter((t) => t.slot === e.id && !C.has(t.addonId)), i = p ? r.filter((e) => e.enabled) : r, a = p ? [] : e.addons.filter((e) => !M.has(e.id) && !C.has(e.id)), o = /* @__PURE__ */ new Map(), s = [];
27336
27360
  for (let e of i) e.group ? (o.has(e.group) || o.set(e.group, []), o.get(e.group).push(e)) : s.push(e);
27337
27361
  return /* @__PURE__ */ H("div", {
27338
27362
  className: "space-y-2",
@@ -27341,13 +27365,13 @@ function VE({ schema: e, steps: t, onChange: n, templates: r, selectedTemplateId
27341
27365
  className: "text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50",
27342
27366
  children: ["Slot: ", e.label]
27343
27367
  }),
27344
- s.map((e) => I(e)),
27368
+ s.map((e) => P(e)),
27345
27369
  [...o.entries()].map(([e, t]) => /* @__PURE__ */ H("div", {
27346
27370
  className: "space-y-2 rounded-lg border border-border/40 p-2",
27347
27371
  children: [/* @__PURE__ */ V("span", {
27348
27372
  className: "text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50 px-1",
27349
27373
  children: e
27350
- }), t.map((e) => I(e))]
27374
+ }), t.map((e) => P(e))]
27351
27375
  }, e)),
27352
27376
  !u && a.map((e) => /* @__PURE__ */ V(BE, {
27353
27377
  addon: e,
@@ -27592,8 +27616,8 @@ function $E({ className: e }) {
27592
27616
  ]
27593
27617
  });
27594
27618
  }
27595
- function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, getIceServers: i, addIceCandidate: a, getIceCandidates: s, closeSession: c, getSessionState: d, getSessionDebug: f, playbackUrl: p, playbackAuthToken: m, onExitPlayback: g, posterUrl: _, streams: y, activeStreamId: b, onStreamChange: x, deviceName: S, phase: C, pipelineMetrics: w, detections: T, stationaryObjects: E, defaultShowDetections: D = !0, defaultShowMotion: O = !1, streamStats: k, autoPlay: ee = !1, showPlayStop: te = !1, snapshotSrc: A, snapshotLoading: j = !1, onRefreshSnapshot: M, showStreamStats: N = !1, children: P, extraOverlay: I, ptzAvailable: ne = !1, ptzShown: L = !1, ptzOverlay: R, onPtzToggle: z, intercomAvailable: re = !1, intercomShown: ie = !1, onIntercomToggle: B, chromeless: ae = !1, className: oe }) {
27596
- let se = F(), ce = gc(), [le, ue] = l(ee), [de, fe] = l(D), [pe, me] = l(!0), [W, he] = l(!0), [ge, _e] = l(O), [ve, ye] = l(null), [G, be] = l([]), [xe, Se] = l(-1), [Ce, we] = l(!1), Te = u(null);
27619
+ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, getIceServers: i, addIceCandidate: a, getIceCandidates: s, closeSession: c, getSessionState: d, getSessionDebug: f, playbackUrl: p, playbackAuthToken: m, onExitPlayback: g, posterUrl: _, streams: y, activeStreamId: b, onStreamChange: x, deviceName: S, phase: C, pipelineMetrics: w, detections: T, stationaryObjects: E, defaultShowDetections: D = !0, defaultShowMotion: O = !1, streamStats: k, autoPlay: ee = !1, showPlayStop: A = !1, snapshotSrc: te, snapshotLoading: ne = !1, onRefreshSnapshot: j, showStreamStats: re = !1, children: M, extraOverlay: P, ptzAvailable: F = !1, ptzShown: I = !1, ptzOverlay: L, onPtzToggle: R, intercomAvailable: z = !1, intercomShown: ie = !1, onIntercomToggle: B, chromeless: ae = !1, className: oe }) {
27620
+ let se = N(), ce = gc(), [le, ue] = l(ee), [de, fe] = l(D), [pe, me] = l(!0), [W, he] = l(!0), [ge, _e] = l(O), [ve, ye] = l(null), [G, be] = l([]), [xe, Se] = l(-1), [Ce, we] = l(!1), Te = u(null);
27597
27621
  v(() => {
27598
27622
  if (!Ce) return;
27599
27623
  function e(e) {
@@ -27610,7 +27634,7 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27610
27634
  inputFps: Oe.inputFps,
27611
27635
  bitrateKbps: Oe.bitrateKbps ?? 0
27612
27636
  }, Ae = (e) => {
27613
- ye(e), x?.(e), le && te && (ue(!1), setTimeout(() => ue(!0), 50));
27637
+ ye(e), x?.(e), le && A && (ue(!1), setTimeout(() => ue(!0), 50));
27614
27638
  }, je = h(() => {
27615
27639
  let e = Oe?.target;
27616
27640
  if (!(!e || !t)) return (n) => t(e, n);
@@ -27619,7 +27643,7 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27619
27643
  if (!(!e || !r)) return (t, n) => r(e, t, n);
27620
27644
  }, [r, Oe]), Ne = h(() => {
27621
27645
  if (r) return (e, t, n) => r(n, t, e);
27622
- }, [r]), Pe = y, Fe = () => ue(!0), Ie = () => ue(!1), Le = w?.phase ?? C, Re = Le === "active", ze = !!T, K = ze && (de || ge), Be = ne && L && !!R, Ve = !!p, q = Ve || (te ? le : !0);
27646
+ }, [r]), Pe = y, Fe = () => ue(!0), Ie = () => ue(!1), Le = w?.phase ?? C, Re = Le === "active", ze = !!T, K = ze && (de || ge), Be = F && I && !!L, Ve = !!p, q = Ve || (A ? le : !0);
27623
27647
  return /* @__PURE__ */ H("div", {
27624
27648
  className: `overflow-hidden ${ae ? "" : "rounded-xl border border-border bg-surface"} ${oe ?? ""}`,
27625
27649
  children: [
@@ -27687,7 +27711,7 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27687
27711
  }), /* @__PURE__ */ H("div", {
27688
27712
  className: "flex items-center gap-1.5 shrink-0 ml-auto",
27689
27713
  children: [
27690
- re && !Ve && /* @__PURE__ */ H("button", {
27714
+ z && !Ve && /* @__PURE__ */ H("button", {
27691
27715
  "data-testid": "stream-intercom-toggle",
27692
27716
  "data-intercom-shown": ie ? "true" : "false",
27693
27717
  onClick: B,
@@ -27714,7 +27738,7 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27714
27738
  })]
27715
27739
  }, e.id);
27716
27740
  }),
27717
- te && /* @__PURE__ */ H("button", {
27741
+ A && /* @__PURE__ */ H("button", {
27718
27742
  "data-testid": "stream-play-toggle",
27719
27743
  "data-stream-playing": q ? "true" : "false",
27720
27744
  "data-vod": Ve ? "true" : "false",
@@ -27726,18 +27750,18 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27726
27750
  children: Ve ? "Live" : q ? "Stop" : "Play"
27727
27751
  })]
27728
27752
  }),
27729
- M && !Ve && /* @__PURE__ */ H("button", {
27753
+ j && !Ve && /* @__PURE__ */ H("button", {
27730
27754
  "data-testid": "stream-snapshot-refresh",
27731
- onClick: M,
27732
- disabled: j,
27755
+ onClick: j,
27756
+ disabled: ne,
27733
27757
  className: "inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",
27734
27758
  title: "Force snapshot refresh",
27735
- children: [/* @__PURE__ */ V(QE, { className: `h-3 w-3 ${j ? "animate-spin" : ""}` }), /* @__PURE__ */ V("span", {
27759
+ children: [/* @__PURE__ */ V(QE, { className: `h-3 w-3 ${ne ? "animate-spin" : ""}` }), /* @__PURE__ */ V("span", {
27736
27760
  className: "hidden xl:inline",
27737
27761
  children: "Snapshot"
27738
27762
  })]
27739
27763
  }),
27740
- (ze || ne || w || Le || k || ke && ke.inputFps > 0) && /* @__PURE__ */ H("div", {
27764
+ (ze || F || w || Le || k || ke && ke.inputFps > 0) && /* @__PURE__ */ H("div", {
27741
27765
  ref: Te,
27742
27766
  className: "relative",
27743
27767
  children: [/* @__PURE__ */ V("button", {
@@ -27748,7 +27772,7 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27748
27772
  }), Ce && /* @__PURE__ */ H("div", {
27749
27773
  className: "absolute right-0 top-full mt-1 z-30 min-w-[200px] rounded-lg border border-border bg-surface shadow-xl py-1.5",
27750
27774
  children: [
27751
- N && k && /* @__PURE__ */ H("div", {
27775
+ re && k && /* @__PURE__ */ H("div", {
27752
27776
  className: "px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",
27753
27777
  children: [
27754
27778
  /* @__PURE__ */ H("div", {
@@ -27774,7 +27798,7 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27774
27798
  })
27775
27799
  ]
27776
27800
  }),
27777
- !N && ke && ke.inputFps > 0 && /* @__PURE__ */ H("div", {
27801
+ !re && ke && ke.inputFps > 0 && /* @__PURE__ */ H("div", {
27778
27802
  className: "px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",
27779
27803
  children: [/* @__PURE__ */ H("div", {
27780
27804
  className: "flex justify-between gap-3",
@@ -27837,11 +27861,11 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27837
27861
  onClick: () => _e((e) => !e)
27838
27862
  })
27839
27863
  ] }),
27840
- ne && /* @__PURE__ */ V(XE, {
27864
+ F && /* @__PURE__ */ V(XE, {
27841
27865
  label: "PTZ controls",
27842
- active: L,
27866
+ active: I,
27843
27867
  onClick: () => {
27844
- z?.(), we(!1);
27868
+ R?.(), we(!1);
27845
27869
  }
27846
27870
  })
27847
27871
  ]
@@ -27858,7 +27882,7 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27858
27882
  onQualityOptions: Ee,
27859
27883
  selectedLevel: xe,
27860
27884
  ..._ ? { posterUrl: _ } : {}
27861
- }), I || Be ? /* @__PURE__ */ H(U, { children: [I, Be && R] }) : null]
27885
+ }), P || Be ? /* @__PURE__ */ H(U, { children: [P, Be && L] }) : null]
27862
27886
  }) : q && e ? /* @__PURE__ */ V("div", {
27863
27887
  className: "aspect-video relative",
27864
27888
  children: /* @__PURE__ */ V(Uf, {
@@ -27878,7 +27902,7 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27878
27902
  closeSession: c,
27879
27903
  ...ce.bindControlChannel ? { onControlChannel: ce.bindControlChannel } : {},
27880
27904
  ..._ ? { posterUrl: _ } : {},
27881
- overlay: K || I || Be ? /* @__PURE__ */ H(U, { children: [
27905
+ overlay: K || P || Be ? /* @__PURE__ */ H(U, { children: [
27882
27906
  K && /* @__PURE__ */ V(ap, {
27883
27907
  detections: T,
27884
27908
  showPhaseIndicator: !1,
@@ -27889,19 +27913,19 @@ function eD({ serverUrl: e, createSession: t, sendAnswer: n, handleOffer: r, get
27889
27913
  showStationary: W,
27890
27914
  ...E === void 0 ? {} : { stationaryObjects: E }
27891
27915
  }),
27892
- I,
27893
- Be && R
27916
+ P,
27917
+ Be && L
27894
27918
  ] }) : void 0
27895
27919
  })
27896
27920
  }) : /* @__PURE__ */ V(tD, {
27897
- src: A ?? null,
27898
- isLoading: j,
27921
+ src: te ?? null,
27922
+ isLoading: ne,
27899
27923
  onPlay: Fe,
27900
- onRetry: M,
27901
- extraOverlay: I || Be ? /* @__PURE__ */ H(U, { children: [I, Be && R] }) : null,
27902
- suppressPlayHover: !!I || Be
27924
+ onRetry: j,
27925
+ extraOverlay: P || Be ? /* @__PURE__ */ H(U, { children: [P, Be && L] }) : null,
27926
+ suppressPlayHover: !!P || Be
27903
27927
  }),
27904
- P
27928
+ M
27905
27929
  ]
27906
27930
  });
27907
27931
  }
@@ -28406,11 +28430,11 @@ function bD({ trpc: e, nodeId: t }) {
28406
28430
  } catch (e) {
28407
28431
  console.warn("[benchmark:audio] Failed to load audio:", e), c(null);
28408
28432
  }
28409
- }, [e, t]), te = async (e) => {
28433
+ }, [e, t]), A = async (e) => {
28410
28434
  a(e), g(null), p(""), await ee(e);
28411
- }, A = (e, t) => {
28435
+ }, te = (e, t) => {
28412
28436
  p(`Upload is not supported for audio: runAudioTest has no payload field for an uploaded file, so "${t}" cannot be classified. Pick a reference WAV above.`), c(yD(e));
28413
- }, j = async () => {
28437
+ }, ne = async () => {
28414
28438
  d(!0), p(""), g(null);
28415
28439
  try {
28416
28440
  let n = await e.pipelineExecutor.runAudioTest.mutate({ ..._D({
@@ -28426,13 +28450,13 @@ function bD({ trpc: e, nodeId: t }) {
28426
28450
  d(!1);
28427
28451
  }
28428
28452
  };
28429
- function M(e, t) {
28453
+ function j(e, t) {
28430
28454
  T((n) => ({
28431
28455
  ...n,
28432
28456
  [e]: t
28433
28457
  }));
28434
28458
  }
28435
- function N(e) {
28459
+ function re(e) {
28436
28460
  if (e.type === "slider") {
28437
28461
  let t = w[e.key], n = typeof e.default == "number" ? e.default : e.min, r = typeof t == "number" ? t : n;
28438
28462
  return /* @__PURE__ */ H("div", { children: [
@@ -28453,7 +28477,7 @@ function bD({ trpc: e, nodeId: t }) {
28453
28477
  max: e.max,
28454
28478
  step: e.step ?? .05,
28455
28479
  value: r,
28456
- onChange: (t) => M(e.key, Number(t.target.value)),
28480
+ onChange: (t) => j(e.key, Number(t.target.value)),
28457
28481
  className: "w-full"
28458
28482
  })
28459
28483
  ] }, e.key);
@@ -28478,7 +28502,7 @@ function bD({ trpc: e, nodeId: t }) {
28478
28502
  max: a,
28479
28503
  step: o,
28480
28504
  value: r,
28481
- onChange: (t) => M(e.key, Number(t.target.value)),
28505
+ onChange: (t) => j(e.key, Number(t.target.value)),
28482
28506
  className: "w-full"
28483
28507
  })
28484
28508
  ] }, e.key);
@@ -28486,7 +28510,7 @@ function bD({ trpc: e, nodeId: t }) {
28486
28510
  if (e.type === "multiselect") {
28487
28511
  let t = w[e.key], n = Array.isArray(t) ? t : Array.isArray(e.default) ? e.default : [], r = (t) => {
28488
28512
  let r = n.includes(t) ? n.filter((e) => e !== t) : [...n, t];
28489
- M(e.key, r);
28513
+ j(e.key, r);
28490
28514
  };
28491
28515
  return /* @__PURE__ */ H("div", { children: [
28492
28516
  /* @__PURE__ */ V("label", {
@@ -28515,7 +28539,7 @@ function bD({ trpc: e, nodeId: t }) {
28515
28539
  children: e.label
28516
28540
  }), /* @__PURE__ */ V("select", {
28517
28541
  value: n,
28518
- onChange: (t) => M(e.key, t.target.value),
28542
+ onChange: (t) => j(e.key, t.target.value),
28519
28543
  className: "w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50",
28520
28544
  children: e.options.map((e) => /* @__PURE__ */ V("option", {
28521
28545
  value: e.value,
@@ -28529,7 +28553,7 @@ function bD({ trpc: e, nodeId: t }) {
28529
28553
  className: "text-sm text-foreground-subtle animate-pulse py-8 text-center",
28530
28554
  children: "Loading audio pipeline..."
28531
28555
  });
28532
- let P = m?.frame, F = P?.detections ?? [], { alternateTopN: I, inferenceMs: ne, totalMs: L } = vD(P);
28556
+ let M = m?.frame, N = M?.detections ?? [], { alternateTopN: P, inferenceMs: F, totalMs: I } = vD(M);
28533
28557
  return /* @__PURE__ */ H("div", {
28534
28558
  className: "space-y-4",
28535
28559
  children: [
@@ -28540,9 +28564,9 @@ function bD({ trpc: e, nodeId: t }) {
28540
28564
  })),
28541
28565
  selectedFilename: i,
28542
28566
  onSelect: (e) => {
28543
- te(e);
28567
+ A(e);
28544
28568
  },
28545
- onUpload: (e, t) => A(e, t),
28569
+ onUpload: (e, t) => te(e, t),
28546
28570
  accept: ".wav,audio/wav",
28547
28571
  uploadLabel: "Upload WAV (preview only)"
28548
28572
  }),
@@ -28573,12 +28597,12 @@ function bD({ trpc: e, nodeId: t }) {
28573
28597
  children: [/* @__PURE__ */ V("h3", {
28574
28598
  className: "text-xs font-medium text-foreground",
28575
28599
  children: "Waveform"
28576
- }), F.length > 0 && /* @__PURE__ */ H("span", {
28600
+ }), N.length > 0 && /* @__PURE__ */ H("span", {
28577
28601
  className: "text-[10px] text-foreground-subtle",
28578
28602
  children: [
28579
- F.length,
28603
+ N.length,
28580
28604
  " detection",
28581
- F.length === 1 ? "" : "s"
28605
+ N.length === 1 ? "" : "s"
28582
28606
  ]
28583
28607
  })]
28584
28608
  }), /* @__PURE__ */ V("div", {
@@ -28593,8 +28617,8 @@ function bD({ trpc: e, nodeId: t }) {
28593
28617
  })
28594
28618
  })]
28595
28619
  }),
28596
- m?.success && F.length > 0 && (() => {
28597
- let e = F[0], t = e.debug?.originalClass;
28620
+ m?.success && N.length > 0 && (() => {
28621
+ let e = N[0], t = e.debug?.originalClass;
28598
28622
  return /* @__PURE__ */ H("div", {
28599
28623
  className: "rounded-xl border border-primary/30 bg-primary/5 px-3 py-2 flex items-center justify-between",
28600
28624
  children: [/* @__PURE__ */ H("div", {
@@ -28621,13 +28645,13 @@ function bD({ trpc: e, nodeId: t }) {
28621
28645
  children: [(e.score * 100).toFixed(1), "%"]
28622
28646
  })
28623
28647
  ]
28624
- }), ne != null && /* @__PURE__ */ H("span", {
28648
+ }), F != null && /* @__PURE__ */ H("span", {
28625
28649
  className: "text-[10px] font-mono text-foreground-subtle",
28626
- children: [ne.toFixed(1), "ms"]
28650
+ children: [F.toFixed(1), "ms"]
28627
28651
  })]
28628
28652
  });
28629
28653
  })(),
28630
- m?.success && L != null && /* @__PURE__ */ H("div", {
28654
+ m?.success && I != null && /* @__PURE__ */ H("div", {
28631
28655
  className: "rounded-xl border border-border bg-surface overflow-hidden",
28632
28656
  children: [/* @__PURE__ */ V("div", {
28633
28657
  className: "px-3 py-2 border-b border-border",
@@ -28638,7 +28662,7 @@ function bD({ trpc: e, nodeId: t }) {
28638
28662
  }), /* @__PURE__ */ H("div", {
28639
28663
  className: "px-3 py-2 space-y-1.5",
28640
28664
  children: [
28641
- ne != null && /* @__PURE__ */ H("div", {
28665
+ F != null && /* @__PURE__ */ H("div", {
28642
28666
  className: "flex items-center justify-between text-xs",
28643
28667
  children: [/* @__PURE__ */ H("span", {
28644
28668
  className: "text-foreground-subtle",
@@ -28649,7 +28673,7 @@ function bD({ trpc: e, nodeId: t }) {
28649
28673
  ]
28650
28674
  }), /* @__PURE__ */ H("span", {
28651
28675
  className: "font-mono text-foreground",
28652
- children: [ne.toFixed(1), "ms"]
28676
+ children: [F.toFixed(1), "ms"]
28653
28677
  })]
28654
28678
  }),
28655
28679
  /* @__PURE__ */ H("div", {
@@ -28659,17 +28683,17 @@ function bD({ trpc: e, nodeId: t }) {
28659
28683
  children: "Total (load + inference)"
28660
28684
  }), /* @__PURE__ */ H("span", {
28661
28685
  className: "font-mono text-foreground",
28662
- children: [L, "ms"]
28686
+ children: [I, "ms"]
28663
28687
  })]
28664
28688
  }),
28665
- ne != null && L > 0 && /* @__PURE__ */ H("div", {
28689
+ F != null && I > 0 && /* @__PURE__ */ H("div", {
28666
28690
  className: "flex items-center justify-between text-xs",
28667
28691
  children: [/* @__PURE__ */ V("span", {
28668
28692
  className: "text-foreground-subtle",
28669
28693
  children: "Overhead"
28670
28694
  }), /* @__PURE__ */ H("span", {
28671
28695
  className: "font-mono text-foreground",
28672
- children: [(L - ne).toFixed(1), "ms"]
28696
+ children: [(I - F).toFixed(1), "ms"]
28673
28697
  })]
28674
28698
  })
28675
28699
  ]
@@ -28685,9 +28709,9 @@ function bD({ trpc: e, nodeId: t }) {
28685
28709
  }), /* @__PURE__ */ H("span", {
28686
28710
  className: "text-[10px] text-foreground-subtle",
28687
28711
  children: [
28688
- I.length,
28712
+ P.length,
28689
28713
  " label",
28690
- I.length === 1 ? "" : "s"
28714
+ P.length === 1 ? "" : "s"
28691
28715
  ]
28692
28716
  })]
28693
28717
  }), /* @__PURE__ */ V("div", {
@@ -28695,10 +28719,10 @@ function bD({ trpc: e, nodeId: t }) {
28695
28719
  children: u ? /* @__PURE__ */ V("div", {
28696
28720
  className: "text-[10px] text-foreground-subtle animate-pulse py-2 text-center",
28697
28721
  children: "Classifying..."
28698
- }) : I.length > 0 ? /* @__PURE__ */ V("div", {
28722
+ }) : P.length > 0 ? /* @__PURE__ */ V("div", {
28699
28723
  className: "space-y-1",
28700
- children: I.slice(0, 50).map((e, t) => {
28701
- let n = F.some((t) => t.macroClass === e.label);
28724
+ children: P.slice(0, 50).map((e, t) => {
28725
+ let n = N.some((t) => t.macroClass === e.label);
28702
28726
  return /* @__PURE__ */ H("div", {
28703
28727
  className: "flex items-center justify-between text-[11px]",
28704
28728
  children: [/* @__PURE__ */ H("div", {
@@ -28765,7 +28789,7 @@ function bD({ trpc: e, nodeId: t }) {
28765
28789
  })
28766
28790
  }), /* @__PURE__ */ V("div", {
28767
28791
  className: "p-3 space-y-3",
28768
- children: k.map(N)
28792
+ children: k.map(re)
28769
28793
  })]
28770
28794
  }),
28771
28795
  b && /* @__PURE__ */ H("div", {
@@ -28813,7 +28837,7 @@ function bD({ trpc: e, nodeId: t }) {
28813
28837
  })]
28814
28838
  }),
28815
28839
  /* @__PURE__ */ V("button", {
28816
- onClick: j,
28840
+ onClick: ne,
28817
28841
  disabled: u || !i,
28818
28842
  className: `w-full px-4 py-2.5 text-sm font-medium rounded-lg transition-colors sticky bottom-4 ${u ? "bg-primary text-primary-foreground animate-pulse" : "bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"}`,
28819
28843
  children: u ? "Classifying..." : "Classify Audio"
@@ -29654,7 +29678,7 @@ function lO({ label: e, hint: t, value: n, min: r, max: i, step: a, disabled: o,
29654
29678
  });
29655
29679
  }
29656
29680
  function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29657
- let [r, i] = l([]), [a, s] = l(""), [c, d] = l(null), [f, p] = l(null), [m, g] = l(null), [_, y] = l(null), [b, x] = l(wD), [S, C] = l(null), [w, T] = l(null), [E, D] = l(null), [O, k] = l(!1), [ee, te] = l(!1), [A, j] = l(""), [M, N] = l([]), [P, F] = l([]), I = u(null), ne = u(null), L = o((e) => {
29681
+ let [r, i] = l([]), [a, s] = l(""), [c, d] = l(null), [f, p] = l(null), [m, g] = l(null), [_, y] = l(null), [b, x] = l(wD), [S, C] = l(null), [w, T] = l(null), [E, D] = l(null), [O, k] = l(!1), [ee, A] = l(!1), [te, ne] = l(""), [j, re] = l([]), [M, N] = l([]), P = u(null), F = u(null), I = o((e) => {
29658
29682
  x((t) => ({
29659
29683
  ...t,
29660
29684
  ...e
@@ -29664,16 +29688,16 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29664
29688
  e.pipelineExecutor.listReferenceImages.query().then((e) => {
29665
29689
  i(e), e.length > 0 && e[0] && s(e[0].filename);
29666
29690
  }).catch((e) => {
29667
- j(e instanceof Error ? e.message : String(e));
29691
+ ne(e instanceof Error ? e.message : String(e));
29668
29692
  });
29669
29693
  }, [e]), v(() => {
29670
29694
  a && e.pipelineExecutor.getReferenceImage.query({ filename: a }).then((e) => {
29671
29695
  e && d(e.base64);
29672
29696
  }).catch((e) => {
29673
- j(e instanceof Error ? e.message : String(e));
29697
+ ne(e instanceof Error ? e.message : String(e));
29674
29698
  });
29675
29699
  }, [e, a]);
29676
- let R = o(async () => {
29700
+ let L = o(async () => {
29677
29701
  try {
29678
29702
  let t = GD(await e.addons.custom.mutate({
29679
29703
  addonId: cO,
@@ -29682,18 +29706,18 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29682
29706
  }));
29683
29707
  return t && C(t), t;
29684
29708
  } catch (e) {
29685
- return j(e instanceof Error ? e.message : String(e)), null;
29709
+ return ne(e instanceof Error ? e.message : String(e)), null;
29686
29710
  }
29687
29711
  }, [e]);
29688
29712
  v(() => {
29689
29713
  (async () => {
29690
- let e = await R(), t = e?.runs.find((e) => e.state === "running");
29691
- t && (I.current = t.sessionId, T(t.sessionId), D(t), F((n) => [...n, `adopted in-flight ramp ${t.sessionId} on ${e?.nodeId ?? "this node"}`]));
29714
+ let e = await L(), t = e?.runs.find((e) => e.state === "running");
29715
+ t && (P.current = t.sessionId, T(t.sessionId), D(t), N((n) => [...n, `adopted in-flight ramp ${t.sessionId} on ${e?.nodeId ?? "this node"}`]));
29692
29716
  })();
29693
- }, [R]);
29694
- let z = o(() => {
29695
- let t = ne.current;
29696
- t && (ne.current = null, e.addons.custom.mutate({
29717
+ }, [L]);
29718
+ let R = o(() => {
29719
+ let t = F.current;
29720
+ t && (F.current = null, e.addons.custom.mutate({
29697
29721
  addonId: cO,
29698
29722
  action: "releaseBenchFrame",
29699
29723
  input: { frameId: t }
@@ -29710,9 +29734,9 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29710
29734
  });
29711
29735
  if (t) return;
29712
29736
  let r = WD(n);
29713
- r && D(r), r && r.state !== "running" && (I.current = null, z(), R());
29737
+ r && D(r), r && r.state !== "running" && (P.current = null, R(), L());
29714
29738
  } catch (e) {
29715
- t || j(e instanceof Error ? e.message : String(e));
29739
+ t || ne(e instanceof Error ? e.message : String(e));
29716
29740
  }
29717
29741
  };
29718
29742
  n();
@@ -29723,8 +29747,8 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29723
29747
  }, [
29724
29748
  e,
29725
29749
  w,
29726
- R,
29727
- z
29750
+ L,
29751
+ R
29728
29752
  ]), v(() => {
29729
29753
  let t = null;
29730
29754
  try {
@@ -29732,10 +29756,10 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29732
29756
  onData: (e) => {
29733
29757
  let t = { ...typeof e.data == "object" && e.data !== null ? e.data : e };
29734
29758
  if (t.step !== "capacity-ramp") return;
29735
- let n = I.current;
29759
+ let n = P.current;
29736
29760
  if (!n || t.sessionId !== n) return;
29737
29761
  let r = t.message;
29738
- typeof r == "string" && F((e) => [...e, r]);
29762
+ typeof r == "string" && N((e) => [...e, r]);
29739
29763
  },
29740
29764
  onError: (e) => {
29741
29765
  console.warn("[benchmark:capacity] progress subscription error:", e);
@@ -29749,22 +29773,22 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29749
29773
  t?.();
29750
29774
  };
29751
29775
  }, [e]);
29752
- let re = S?.nodeId ?? null, ie = re !== null && re !== t, B = E?.state === "running", ae = h(() => OD(b.rampText), [b.rampText]), oe = h(() => _ ? AD(SD(_.steps)) : null, [_]), se = oe?.steps ?? [], ce = E?.result ?? null, le = ce ? QD(ce) : null, ue = ce ? KD(ce) : [], de = $D(E), fe = ae.ramp.length > 0 ? Math.round(ae.ramp.length * (b.settleSec + b.measureSec) / 60) : 0, pe = async () => {
29753
- if (j(""), N([]), F([]), D(null), !c) {
29754
- N(["No reference image loaded — the ramp needs a frame to pin."]);
29776
+ let z = S?.nodeId ?? null, ie = z !== null && z !== t, B = E?.state === "running", ae = h(() => OD(b.rampText), [b.rampText]), oe = h(() => _ ? AD(SD(_.steps)) : null, [_]), se = oe?.steps ?? [], ce = E?.result ?? null, le = ce ? QD(ce) : null, ue = ce ? KD(ce) : [], de = $D(E), fe = ae.ramp.length > 0 ? Math.round(ae.ramp.length * (b.settleSec + b.measureSec) / 60) : 0, pe = async () => {
29777
+ if (ne(""), re([]), N([]), D(null), !c) {
29778
+ re(["No reference image loaded — the ramp needs a frame to pin."]);
29755
29779
  return;
29756
29780
  }
29757
29781
  if (!_) {
29758
- N(["Pick a camera. The ramp runs the tree that camera really runs; there is no free-form mode here on purpose."]);
29782
+ re(["Pick a camera. The ramp runs the tree that camera really runs; there is no free-form mode here on purpose."]);
29759
29783
  return;
29760
29784
  }
29761
- let n = await R() ?? S;
29785
+ let n = await L() ?? S;
29762
29786
  if (!n) {
29763
- N(["Could not read the runner — cannot confirm which node would be measured."]);
29787
+ re(["Could not read the runner — cannot confirm which node would be measured."]);
29764
29788
  return;
29765
29789
  }
29766
29790
  if (oe && oe.missingModelFor.length > 0) {
29767
- N([`resolvePipeline left the model to the node for: ${oe.missingModelFor.join(", ")}. The ramp needs an explicit model per root step and this page will not invent one — pin the model on that (node, device) first.`]);
29791
+ re([`resolvePipeline left the model to the node for: ${oe.missingModelFor.join(", ")}. The ramp needs an explicit model per root step and this page will not invent one — pin the model on that (node, device) first.`]);
29768
29792
  return;
29769
29793
  }
29770
29794
  let r = `cap-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`, i = jD({
@@ -29777,7 +29801,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29777
29801
  form: b
29778
29802
  });
29779
29803
  if (!i.ok) {
29780
- N(i.issues);
29804
+ re(i.issues);
29781
29805
  return;
29782
29806
  }
29783
29807
  k(!0);
@@ -29791,7 +29815,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29791
29815
  }
29792
29816
  }), a = { ...typeof i == "object" && i ? i : {} }, o = typeof a.frameId == "string" ? a.frameId : "";
29793
29817
  if (!o) throw Error("cacheBenchFrame returned no frameId");
29794
- ne.current = o;
29818
+ F.current = o;
29795
29819
  let s = jD({
29796
29820
  frameId: o,
29797
29821
  sessionId: r,
@@ -29802,35 +29826,35 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29802
29826
  form: b
29803
29827
  });
29804
29828
  if (!s.ok) {
29805
- N(s.issues), z();
29829
+ re(s.issues), R();
29806
29830
  return;
29807
29831
  }
29808
29832
  await e.addons.custom.mutate({
29809
29833
  addonId: cO,
29810
29834
  action: "runCapacityRamp",
29811
29835
  input: { ...s.input }
29812
- }), I.current = r, T(r), D({
29836
+ }), P.current = r, T(r), D({
29813
29837
  sessionId: r,
29814
29838
  state: "running"
29815
29839
  });
29816
29840
  } catch (e) {
29817
- j(e instanceof Error ? e.message : String(e)), z();
29841
+ ne(e instanceof Error ? e.message : String(e)), R();
29818
29842
  } finally {
29819
29843
  k(!1);
29820
29844
  }
29821
29845
  }, me = async () => {
29822
29846
  if (w) {
29823
- te(!0);
29847
+ A(!0);
29824
29848
  try {
29825
29849
  await e.addons.custom.mutate({
29826
29850
  addonId: cO,
29827
29851
  action: "abortCapacityRamp",
29828
29852
  input: { sessionId: w }
29829
- }), F((e) => [...e, "abort requested — the current step drains, then stops"]);
29853
+ }), N((e) => [...e, "abort requested — the current step drains, then stops"]);
29830
29854
  } catch (e) {
29831
- j(e instanceof Error ? e.message : String(e));
29855
+ ne(e instanceof Error ? e.message : String(e));
29832
29856
  } finally {
29833
- te(!1);
29857
+ A(!1);
29834
29858
  }
29835
29859
  }
29836
29860
  }, W = O || B;
@@ -29852,7 +29876,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29852
29876
  " ",
29853
29877
  /* @__PURE__ */ V("span", {
29854
29878
  className: "font-mono text-primary",
29855
- children: re ?? "unknown"
29879
+ children: z ?? "unknown"
29856
29880
  }),
29857
29881
  " — the ramp driver is node-local and ",
29858
29882
  /* @__PURE__ */ V("code", { children: "addons.custom" }),
@@ -29899,7 +29923,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29899
29923
  " but this action reaches the runner on ",
29900
29924
  /* @__PURE__ */ V("span", {
29901
29925
  className: "font-mono",
29902
- children: re
29926
+ children: z
29903
29927
  }),
29904
29928
  ". The run is refused — switch the node selector back, or start the ramp on that node’s runner."
29905
29929
  ]
@@ -29979,7 +30003,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29979
30003
  type: "text",
29980
30004
  value: b.rampText,
29981
30005
  disabled: W,
29982
- onChange: (e) => L({ rampText: e.target.value }),
30006
+ onChange: (e) => I({ rampText: e.target.value }),
29983
30007
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm font-mono bg-background border border-border rounded"
29984
30008
  }),
29985
30009
  ae.issues.length > 0 && /* @__PURE__ */ V("span", {
@@ -29998,7 +30022,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
29998
30022
  min: 1,
29999
30023
  max: 30,
30000
30024
  disabled: W,
30001
- onChange: (e) => L({ fpsPerCamera: e })
30025
+ onChange: (e) => I({ fpsPerCamera: e })
30002
30026
  }),
30003
30027
  /* @__PURE__ */ V(lO, {
30004
30028
  label: "frame size (px)",
@@ -30008,7 +30032,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30008
30032
  max: 2048,
30009
30033
  step: 32,
30010
30034
  disabled: W,
30011
- onChange: (e) => L({ targetSize: e })
30035
+ onChange: (e) => I({ targetSize: e })
30012
30036
  }),
30013
30037
  /* @__PURE__ */ V(lO, {
30014
30038
  label: "settle (s)",
@@ -30017,7 +30041,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30017
30041
  min: 0,
30018
30042
  max: 300,
30019
30043
  disabled: W,
30020
- onChange: (e) => L({ settleSec: e })
30044
+ onChange: (e) => I({ settleSec: e })
30021
30045
  }),
30022
30046
  /* @__PURE__ */ V(lO, {
30023
30047
  label: "measure (s)",
@@ -30026,7 +30050,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30026
30050
  min: 5,
30027
30051
  max: 600,
30028
30052
  disabled: W,
30029
- onChange: (e) => L({ measureSec: e })
30053
+ onChange: (e) => I({ measureSec: e })
30030
30054
  }),
30031
30055
  /* @__PURE__ */ V(lO, {
30032
30056
  label: "warmup calls",
@@ -30035,7 +30059,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30035
30059
  min: 0,
30036
30060
  max: 50,
30037
30061
  disabled: W,
30038
- onChange: (e) => L({ warmupCalls: e })
30062
+ onChange: (e) => I({ warmupCalls: e })
30039
30063
  }),
30040
30064
  /* @__PURE__ */ V(lO, {
30041
30065
  label: "drop SLO (%)",
@@ -30044,7 +30068,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30044
30068
  max: 100,
30045
30069
  step: .1,
30046
30070
  disabled: W,
30047
- onChange: (e) => L({ dropRatioMaxPct: e })
30071
+ onChange: (e) => I({ dropRatioMaxPct: e })
30048
30072
  }),
30049
30073
  /* @__PURE__ */ V(lO, {
30050
30074
  label: "e2e p95 SLO (ms)",
@@ -30052,7 +30076,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30052
30076
  min: 1,
30053
30077
  max: 1e4,
30054
30078
  disabled: W,
30055
- onChange: (e) => L({ e2eP95MsMax: e })
30079
+ onChange: (e) => I({ e2eP95MsMax: e })
30056
30080
  }),
30057
30081
  /* @__PURE__ */ V(lO, {
30058
30082
  label: "stalls SLO",
@@ -30061,7 +30085,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30061
30085
  min: 0,
30062
30086
  max: 1e3,
30063
30087
  disabled: W,
30064
- onChange: (e) => L({ stallsMax: e })
30088
+ onChange: (e) => I({ stallsMax: e })
30065
30089
  })
30066
30090
  ]
30067
30091
  }),
@@ -30073,7 +30097,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30073
30097
  type: "checkbox",
30074
30098
  checked: b.stopOnFirstFail,
30075
30099
  disabled: W,
30076
- onChange: (e) => L({ stopOnFirstFail: e.target.checked })
30100
+ onChange: (e) => I({ stopOnFirstFail: e.target.checked })
30077
30101
  }), /* @__PURE__ */ V("span", {
30078
30102
  className: "text-foreground-subtle",
30079
30103
  children: "stop at the first failing step"
@@ -30084,7 +30108,7 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30084
30108
  type: "checkbox",
30085
30109
  checked: b.allowActiveCameras,
30086
30110
  disabled: W,
30087
- onChange: (e) => L({ allowActiveCameras: e.target.checked })
30111
+ onChange: (e) => I({ allowActiveCameras: e.target.checked })
30088
30112
  }), /* @__PURE__ */ V("span", {
30089
30113
  className: "text-foreground-subtle",
30090
30114
  children: "allow active cameras (result is contaminated and says so)"
@@ -30120,21 +30144,21 @@ function uO({ trpc: e, nodeId: t, onNodeChange: n }) {
30120
30144
  })
30121
30145
  ]
30122
30146
  }),
30123
- M.length > 0 && /* @__PURE__ */ V("div", {
30147
+ j.length > 0 && /* @__PURE__ */ V("div", {
30124
30148
  className: "rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger space-y-1",
30125
- children: M.map((e) => /* @__PURE__ */ V("div", { children: e }, e))
30149
+ children: j.map((e) => /* @__PURE__ */ V("div", { children: e }, e))
30126
30150
  }),
30127
- A && /* @__PURE__ */ V("div", {
30151
+ te && /* @__PURE__ */ V("div", {
30128
30152
  className: "rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",
30129
- children: A
30153
+ children: te
30130
30154
  }),
30131
30155
  E?.state === "failed" && E.error && /* @__PURE__ */ H("div", {
30132
30156
  className: "rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",
30133
30157
  children: ["ramp failed: ", E.error]
30134
30158
  }),
30135
- P.length > 0 && /* @__PURE__ */ V("div", {
30159
+ M.length > 0 && /* @__PURE__ */ V("div", {
30136
30160
  className: "rounded-md border border-border bg-background p-2 space-y-0.5",
30137
- children: P.map((e, t) => /* @__PURE__ */ V("div", {
30161
+ children: M.map((e, t) => /* @__PURE__ */ V("div", {
30138
30162
  className: "text-[11px] font-mono text-foreground-subtle",
30139
30163
  children: e
30140
30164
  }, `${e}-${t}`))
@@ -30299,7 +30323,7 @@ function dO(e, t) {
30299
30323
  }
30300
30324
  }
30301
30325
  function fO({ trpc: e, nodeId: t }) {
30302
- let [n, r] = l([]), [i, a] = l(""), [o, s] = l(3), [c, d] = l(25), [f, p] = l("jpeg"), [m, h] = l("duration"), [g, _] = l(60), [y, b] = l(1e3), [x, S] = l(15), [C, w] = l(2e3), [T, E] = l(5), [D, O] = l(20), [k] = l("decoder-nodeav"), [ee, te] = l(""), [A, j] = l(""), [M] = l(0), [N, P] = l(null), [F, I] = l(!1), [ne, L] = l(""), [R, z] = l(null), [re, ie] = l("idle"), [B, ae] = l(null), [oe, U] = l(!0), se = u(null);
30326
+ let [n, r] = l([]), [i, a] = l(""), [o, s] = l(3), [c, d] = l(25), [f, p] = l("jpeg"), [m, h] = l("duration"), [g, _] = l(60), [y, b] = l(1e3), [x, S] = l(15), [C, w] = l(2e3), [T, E] = l(5), [D, O] = l(20), [k] = l("decoder-nodeav"), [ee, A] = l(""), [te, ne] = l(""), [j] = l(0), [re, M] = l(null), [N, P] = l(!1), [F, I] = l(""), [L, R] = l(null), [z, ie] = l("idle"), [B, ae] = l(null), [oe, U] = l(!0), se = u(null);
30303
30327
  return v(() => {
30304
30328
  e.addons.custom.mutate({
30305
30329
  addonId: "benchmark",
@@ -30317,15 +30341,15 @@ function fO({ trpc: e, nodeId: t }) {
30317
30341
  nodeId: t
30318
30342
  }).then((e) => {
30319
30343
  let t = e;
30320
- te(String(dO(t, "hwaccel") ?? "")), j(String(dO(t, "probedBestHwaccel") ?? ""));
30344
+ A(String(dO(t, "hwaccel") ?? "")), ne(String(dO(t, "probedBestHwaccel") ?? ""));
30321
30345
  }).catch((e) => {
30322
- console.warn("[benchmark:decoder] addon-settings fetch failed:", e), te(""), j("");
30346
+ console.warn("[benchmark:decoder] addon-settings fetch failed:", e), A(""), ne("");
30323
30347
  });
30324
30348
  }, [
30325
30349
  e,
30326
30350
  t,
30327
30351
  k,
30328
- M
30352
+ j
30329
30353
  ]), v(() => {
30330
30354
  let t = null;
30331
30355
  try {
@@ -30337,7 +30361,7 @@ function fO({ trpc: e, nodeId: t }) {
30337
30361
  if (!n || t.sessionId !== n) return;
30338
30362
  typeof t.phase == "string" && ie(t.phase);
30339
30363
  let r = t.sample;
30340
- r && typeof r == "object" && z(r);
30364
+ r && typeof r == "object" && R(r);
30341
30365
  },
30342
30366
  onError: (e) => {
30343
30367
  console.warn("[benchmark:decoder] progress subscription error:", e);
@@ -30355,9 +30379,9 @@ function fO({ trpc: e, nodeId: t }) {
30355
30379
  children: "Loading fixtures..."
30356
30380
  }) : /* @__PURE__ */ H("div", {
30357
30381
  className: "space-y-4",
30358
- children: [ne && /* @__PURE__ */ V("div", {
30382
+ children: [F && /* @__PURE__ */ V("div", {
30359
30383
  className: "rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",
30360
- children: ne
30384
+ children: F
30361
30385
  }), /* @__PURE__ */ H("div", {
30362
30386
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
30363
30387
  children: [/* @__PURE__ */ H("div", {
@@ -30368,13 +30392,13 @@ function fO({ trpc: e, nodeId: t }) {
30368
30392
  addonId: k,
30369
30393
  nodeId: t,
30370
30394
  title: `Decoder addon · ${k}`,
30371
- disabled: F,
30372
- refreshToken: M,
30395
+ disabled: N,
30396
+ refreshToken: j,
30373
30397
  collapsible: !0,
30374
30398
  mode: "override",
30375
30399
  onOverrideChange: (e) => {
30376
30400
  let t = e.hwaccel;
30377
- P(typeof t == "string" && t.length > 0 ? t : null);
30401
+ M(typeof t == "string" && t.length > 0 ? t : null);
30378
30402
  }
30379
30403
  }),
30380
30404
  /* @__PURE__ */ H("div", {
@@ -30384,7 +30408,7 @@ function fO({ trpc: e, nodeId: t }) {
30384
30408
  " ",
30385
30409
  /* @__PURE__ */ V("span", {
30386
30410
  className: "font-mono text-foreground",
30387
- children: N || ee || A || "none"
30411
+ children: re || ee || te || "none"
30388
30412
  }),
30389
30413
  " ",
30390
30414
  "for this run."
@@ -30406,7 +30430,7 @@ function fO({ trpc: e, nodeId: t }) {
30406
30430
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30407
30431
  value: i,
30408
30432
  onChange: (e) => a(e.target.value),
30409
- disabled: F,
30433
+ disabled: N,
30410
30434
  children: n.map((e) => /* @__PURE__ */ H("option", {
30411
30435
  value: e.filename,
30412
30436
  children: [
@@ -30437,7 +30461,7 @@ function fO({ trpc: e, nodeId: t }) {
30437
30461
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30438
30462
  value: o,
30439
30463
  onChange: (e) => s(Number(e.target.value)),
30440
- disabled: F
30464
+ disabled: N
30441
30465
  })]
30442
30466
  }),
30443
30467
  /* @__PURE__ */ H("label", {
@@ -30452,7 +30476,7 @@ function fO({ trpc: e, nodeId: t }) {
30452
30476
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30453
30477
  value: c,
30454
30478
  onChange: (e) => d(Number(e.target.value)),
30455
- disabled: F
30479
+ disabled: N
30456
30480
  })]
30457
30481
  }),
30458
30482
  /* @__PURE__ */ H("label", {
@@ -30464,7 +30488,7 @@ function fO({ trpc: e, nodeId: t }) {
30464
30488
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30465
30489
  value: f,
30466
30490
  onChange: (e) => p(e.target.value),
30467
- disabled: F,
30491
+ disabled: N,
30468
30492
  children: [/* @__PURE__ */ V("option", {
30469
30493
  value: "jpeg",
30470
30494
  children: "jpeg"
@@ -30483,7 +30507,7 @@ function fO({ trpc: e, nodeId: t }) {
30483
30507
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30484
30508
  value: m,
30485
30509
  onChange: (e) => h(e.target.value),
30486
- disabled: F,
30510
+ disabled: N,
30487
30511
  children: [/* @__PURE__ */ V("option", {
30488
30512
  value: "duration",
30489
30513
  children: "duration"
@@ -30505,7 +30529,7 @@ function fO({ trpc: e, nodeId: t }) {
30505
30529
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30506
30530
  value: g,
30507
30531
  onChange: (e) => _(Number(e.target.value)),
30508
- disabled: F
30532
+ disabled: N
30509
30533
  })]
30510
30534
  }) : /* @__PURE__ */ H("label", {
30511
30535
  className: "block text-xs",
@@ -30519,7 +30543,7 @@ function fO({ trpc: e, nodeId: t }) {
30519
30543
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30520
30544
  value: y,
30521
30545
  onChange: (e) => b(Number(e.target.value)),
30522
- disabled: F
30546
+ disabled: N
30523
30547
  })]
30524
30548
  }),
30525
30549
  /* @__PURE__ */ H("label", {
@@ -30533,7 +30557,7 @@ function fO({ trpc: e, nodeId: t }) {
30533
30557
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30534
30558
  value: x,
30535
30559
  onChange: (e) => S(Number(e.target.value)),
30536
- disabled: F
30560
+ disabled: N
30537
30561
  })]
30538
30562
  }),
30539
30563
  /* @__PURE__ */ H("label", {
@@ -30547,7 +30571,7 @@ function fO({ trpc: e, nodeId: t }) {
30547
30571
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30548
30572
  value: C,
30549
30573
  onChange: (e) => w(Number(e.target.value)),
30550
- disabled: F
30574
+ disabled: N
30551
30575
  })]
30552
30576
  }),
30553
30577
  /* @__PURE__ */ H("label", {
@@ -30562,7 +30586,7 @@ function fO({ trpc: e, nodeId: t }) {
30562
30586
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30563
30587
  value: T,
30564
30588
  onChange: (e) => E(Number(e.target.value)),
30565
- disabled: F
30589
+ disabled: N
30566
30590
  })]
30567
30591
  }),
30568
30592
  /* @__PURE__ */ H("label", {
@@ -30577,7 +30601,7 @@ function fO({ trpc: e, nodeId: t }) {
30577
30601
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
30578
30602
  value: D,
30579
30603
  onChange: (e) => O(Number(e.target.value)),
30580
- disabled: F
30604
+ disabled: N
30581
30605
  })]
30582
30606
  })
30583
30607
  ]
@@ -30587,10 +30611,10 @@ function fO({ trpc: e, nodeId: t }) {
30587
30611
  children: [/* @__PURE__ */ V("button", {
30588
30612
  type: "button",
30589
30613
  onClick: async () => {
30590
- L(""), ae(null), z(null), ie("init");
30614
+ I(""), ae(null), R(null), ie("init");
30591
30615
  let r = `decoder-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
30592
- se.current = r, I(!0);
30593
- let a = N || ee || A || "none", s = {
30616
+ se.current = r, P(!0);
30617
+ let a = re || ee || te || "none", s = {
30594
30618
  sessionId: r,
30595
30619
  nodeId: t,
30596
30620
  cameras: o,
@@ -30647,15 +30671,15 @@ function fO({ trpc: e, nodeId: t }) {
30647
30671
  });
30648
30672
  }
30649
30673
  } catch (e) {
30650
- L(e instanceof Error ? e.message : String(e));
30674
+ I(e instanceof Error ? e.message : String(e));
30651
30675
  } finally {
30652
- se.current = null, I(!1);
30676
+ se.current = null, P(!1);
30653
30677
  }
30654
30678
  },
30655
- disabled: F || !i,
30679
+ disabled: N || !i,
30656
30680
  className: "flex-1 px-3 py-2.5 sm:py-1.5 text-sm bg-primary text-primary-foreground rounded disabled:opacity-50",
30657
- children: F ? "Running…" : "Run Test"
30658
- }), F && /* @__PURE__ */ V("button", {
30681
+ children: N ? "Running…" : "Run Test"
30682
+ }), N && /* @__PURE__ */ V("button", {
30659
30683
  type: "button",
30660
30684
  onClick: async () => {
30661
30685
  let t = se.current;
@@ -30689,36 +30713,36 @@ function fO({ trpc: e, nodeId: t }) {
30689
30713
  className: "text-xs text-foreground-subtle",
30690
30714
  children: ["Phase: ", /* @__PURE__ */ V("span", {
30691
30715
  className: "font-mono",
30692
- children: re
30716
+ children: z
30693
30717
  })]
30694
30718
  }),
30695
- R ? /* @__PURE__ */ H("div", {
30719
+ L ? /* @__PURE__ */ H("div", {
30696
30720
  className: "grid grid-cols-2 gap-x-3 gap-y-1 text-xs font-mono",
30697
30721
  children: [
30698
30722
  /* @__PURE__ */ H("div", { children: [
30699
30723
  "t: ",
30700
- R.tSec.toFixed(1),
30724
+ L.tSec.toFixed(1),
30701
30725
  "s"
30702
30726
  ] }),
30703
- /* @__PURE__ */ H("div", { children: ["frames: ", R.framesTotal] }),
30727
+ /* @__PURE__ */ H("div", { children: ["frames: ", L.framesTotal] }),
30704
30728
  /* @__PURE__ */ H("div", { children: [
30705
30729
  "rss: ",
30706
- R.rssMB.toFixed(1),
30730
+ L.rssMB.toFixed(1),
30707
30731
  " MB"
30708
30732
  ] }),
30709
30733
  /* @__PURE__ */ H("div", { children: [
30710
30734
  "heap: ",
30711
- R.heapMB.toFixed(1),
30735
+ L.heapMB.toFixed(1),
30712
30736
  " MB"
30713
30737
  ] }),
30714
30738
  /* @__PURE__ */ H("div", { children: [
30715
30739
  "external: ",
30716
- R.externalMB.toFixed(1),
30740
+ L.externalMB.toFixed(1),
30717
30741
  " MB"
30718
30742
  ] }),
30719
30743
  /* @__PURE__ */ H("div", { children: [
30720
30744
  "cpu: ",
30721
- R.cpuPct.toFixed(0),
30745
+ L.cpuPct.toFixed(0),
30722
30746
  "%"
30723
30747
  ] })
30724
30748
  ]
@@ -31354,14 +31378,14 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31354
31378
  let [r, i] = l(null), [a, s] = l([]), [c, d] = l(null), [f, p] = l([]), [m, h] = l(""), [g, _] = l(null), [y, b] = l(""), [x, S] = l(null), [C, w] = l({
31355
31379
  w: 640,
31356
31380
  h: 480
31357
- }), [T, E] = l([]), [D, O] = l(null), [k, ee] = l(null), [te, A] = l(null), [j, M] = l(!1), [N, P] = l(""), [F, I] = l(null), [ne, L] = l(!0), [R, z] = l([]), [re, ie] = l(200), [B, ae] = l(4), [oe, U] = l(1), [se, ce] = l(!1), [le, ue] = l(null), [de, fe] = l(null), [pe, me] = l(null), [W, he] = l(null), ge = u(null), [_e, ve] = l(/* @__PURE__ */ new Set()), ye = o((e, t) => {
31381
+ }), [T, E] = l([]), [D, O] = l(null), [k, ee] = l(null), [A, te] = l(null), [ne, j] = l(!1), [re, M] = l(""), [N, P] = l(null), [F, I] = l(!0), [L, R] = l([]), [z, ie] = l(200), [B, ae] = l(4), [oe, U] = l(1), [se, ce] = l(!1), [le, ue] = l(null), [de, fe] = l(null), [pe, me] = l(null), [W, he] = l(null), ge = u(null), [_e, ve] = l(/* @__PURE__ */ new Set()), ye = o((e, t) => {
31358
31382
  ve((n) => {
31359
31383
  let r = new Set(n);
31360
31384
  return t ? r.delete(e) : r.add(e), r;
31361
31385
  });
31362
31386
  }, []);
31363
31387
  v(() => {
31364
- I(null), P(""), z([]);
31388
+ P(null), M(""), R([]);
31365
31389
  }, [t]), v(() => {
31366
31390
  let t = null;
31367
31391
  try {
@@ -31375,9 +31399,9 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31375
31399
  } else if (r !== n) return;
31376
31400
  if (t.message) {
31377
31401
  let e = String(t.message);
31378
- z((t) => [...t, e]), i && t.benchProgress && (ue(e), he({
31402
+ R((t) => [...t, e]), i && t.benchProgress && (ue(e), he({
31379
31403
  iter: Math.ceil(t.runs / Math.max(1, B)),
31380
- total: re,
31404
+ total: z,
31381
31405
  runs: t.runs,
31382
31406
  meanMs: t.meanMs,
31383
31407
  inferMeanMs: t.inferMeanMs,
@@ -31422,9 +31446,9 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31422
31446
  });
31423
31447
  }, [e]), v(() => {
31424
31448
  Promise.all([e.pipelineExecutor.getSchema.query({ nodeId: t }), e.pipelineOrchestrator.listTemplates.query()]).then(([e, t]) => {
31425
- i(e), s(t.map((t) => DO(t, e))), E(TO(e)), L(!1);
31449
+ i(e), s(t.map((t) => DO(t, e))), E(TO(e)), I(!1);
31426
31450
  }).catch((e) => {
31427
- console.error("[benchmark:image] Failed to load pipeline data:", e), L(!1);
31451
+ console.error("[benchmark:image] Failed to load pipeline data:", e), I(!1);
31428
31452
  });
31429
31453
  }, [e, t]);
31430
31454
  let G = (e) => {
@@ -31435,20 +31459,20 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31435
31459
  h: t.naturalHeight
31436
31460
  })), t.src = e;
31437
31461
  }, be = async (t) => {
31438
- h(t), I(null);
31462
+ h(t), P(null);
31439
31463
  try {
31440
31464
  let n = await e.pipelineExecutor.getReferenceImage.query({ filename: t });
31441
31465
  n && (_(n.base64), G(`data:image/jpeg;base64,${n.base64}`));
31442
31466
  } catch (e) {
31443
31467
  console.warn("[benchmark:image] Failed to load image:", e);
31444
31468
  }
31445
- }, xe = te ? SD(te.steps) : T.map((e) => OO(e)), Se = async () => {
31446
- M(!0), P(""), I(null), z([]);
31469
+ }, xe = A ? SD(A.steps) : T.map((e) => OO(e)), Se = async () => {
31470
+ j(!0), M(""), P(null), R([]);
31447
31471
  let n = `ui-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
31448
31472
  ge.current = n;
31449
31473
  try {
31450
31474
  if (!g) {
31451
- P("No image loaded");
31475
+ M("No image loaded");
31452
31476
  return;
31453
31477
  }
31454
31478
  let r = await e.addons.custom.mutate({
@@ -31462,18 +31486,18 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31462
31486
  ...k ? { deviceKey: k } : {}
31463
31487
  }) }
31464
31488
  });
31465
- console.log("[benchmark] runPipelineTest OUTPUT:", JSON.stringify(r, null, 2)), I(r);
31489
+ console.log("[benchmark] runPipelineTest OUTPUT:", JSON.stringify(r, null, 2)), P(r);
31466
31490
  } catch (e) {
31467
- console.error("[benchmark] runPipelineTest ERROR:", e), P(e instanceof Error ? e.message : String(e));
31491
+ console.error("[benchmark] runPipelineTest ERROR:", e), M(e instanceof Error ? e.message : String(e));
31468
31492
  } finally {
31469
- ge.current = null, M(!1);
31493
+ ge.current = null, j(!1);
31470
31494
  }
31471
31495
  }, Ce = async (n) => {
31472
31496
  if (!g) {
31473
- P("No image loaded");
31497
+ M("No image loaded");
31474
31498
  return;
31475
31499
  }
31476
- P(""), ce(!0), fe(n), ue("caching frame…"), he(null), me(null);
31500
+ M(""), ce(!0), fe(n), ue("caching frame…"), he(null), me(null);
31477
31501
  let r = `synth-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
31478
31502
  ge.current = r;
31479
31503
  let i = null;
@@ -31485,7 +31509,7 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31485
31509
  imageBase64: g,
31486
31510
  ttlSeconds: 600
31487
31511
  }
31488
- })).frameId, ue(`running synthetic bench — ${B} workers × ${re} iters`);
31512
+ })).frameId, ue(`running synthetic bench — ${B} workers × ${z} iters`);
31489
31513
  let a = performance.now(), o = await e.addons.custom.mutate({
31490
31514
  addonId: "pipeline-runner",
31491
31515
  action: "runSyntheticBench",
@@ -31493,7 +31517,7 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31493
31517
  frameId: i,
31494
31518
  steps: xe,
31495
31519
  parallel: B,
31496
- iterations: re,
31520
+ iterations: z,
31497
31521
  warmup: oe,
31498
31522
  sessionId: r,
31499
31523
  nodeId: t,
@@ -31505,8 +31529,8 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31505
31529
  ...o,
31506
31530
  clientWallMs: s.toFixed(0)
31507
31531
  }), he({
31508
- iter: re,
31509
- total: re,
31532
+ iter: z,
31533
+ total: z,
31510
31534
  runs: o.runs,
31511
31535
  meanMs: o.callMs.mean,
31512
31536
  inferMeanMs: o.inferMs,
@@ -31522,14 +31546,14 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31522
31546
  avgDetections: o.avgDetections
31523
31547
  }), ue(`synthetic — ${o.fps.toFixed(1)} fps · ${o.detectionsPerSec.toFixed(1)} det/s · call ${o.callMs.mean.toFixed(1)}ms p95 ${o.callMs.p95.toFixed(1)}ms · batch ${o.batchSizeMean.toFixed(2)}`), me(await wO((t) => e.addons.custom.mutate({ ...t }), {
31524
31548
  steps: xe,
31525
- iterations: re,
31549
+ iterations: z,
31526
31550
  warmup: oe,
31527
31551
  parallel: B,
31528
31552
  ...m ? { referenceImage: m } : {},
31529
31553
  result: o
31530
31554
  }));
31531
31555
  } catch (e) {
31532
- P(e instanceof Error ? e.message : String(e)), ue(null);
31556
+ M(e instanceof Error ? e.message : String(e)), ue(null);
31533
31557
  } finally {
31534
31558
  ce(!1), i && e.addons.custom.mutate({
31535
31559
  addonId: "pipeline-runner",
@@ -31538,13 +31562,13 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31538
31562
  }).catch(() => void 0);
31539
31563
  }
31540
31564
  };
31541
- if (ne) return /* @__PURE__ */ V("div", {
31565
+ if (F) return /* @__PURE__ */ V("div", {
31542
31566
  className: "text-sm text-foreground-subtle animate-pulse py-8 text-center",
31543
31567
  children: "Loading..."
31544
31568
  });
31545
- let we = C.w, Te = C.h, Ee = F?.detections ? [...F.detections] : [], De = /* @__PURE__ */ new Set();
31569
+ let we = C.w, Te = C.h, Ee = N?.detections ? [...N.detections] : [], De = /* @__PURE__ */ new Set();
31546
31570
  for (let e of Ee) e.kind === "first-level" && _e.has(e.id) && De.add(e.id);
31547
- let Oe = Ee.filter((e) => !(_e.has(e.id) || e.kind === "detail" && e.parentId && De.has(e.parentId))), ke = {}, Ae = F?.debug?.stepTimings ?? [];
31571
+ let Oe = Ee.filter((e) => !(_e.has(e.id) || e.kind === "detail" && e.parentId && De.has(e.parentId))), ke = {}, Ae = N?.debug?.stepTimings ?? [];
31548
31572
  for (let e of Ae) ke[`${e.source}${e.modelId ? ` (${e.modelId})` : ""}`] = e.ms;
31549
31573
  return /* @__PURE__ */ H("div", {
31550
31574
  className: "space-y-4",
@@ -31557,8 +31581,8 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31557
31581
  onDeviceKeyChange: ee,
31558
31582
  selectedDeviceId: D,
31559
31583
  onSelectCamera: O,
31560
- onResolved: A,
31561
- disabled: j || se
31584
+ onResolved: te,
31585
+ disabled: ne || se
31562
31586
  }),
31563
31587
  /* @__PURE__ */ V(FE, {
31564
31588
  images: f,
@@ -31566,12 +31590,12 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31566
31590
  uploadedName: y,
31567
31591
  onSelect: be,
31568
31592
  onUpload: (e, t, n) => {
31569
- _(e), b(t), h(""), G(n), I(null);
31593
+ _(e), b(t), h(""), G(n), P(null);
31570
31594
  }
31571
31595
  }),
31572
- N && /* @__PURE__ */ V("div", {
31596
+ re && /* @__PURE__ */ V("div", {
31573
31597
  className: "rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",
31574
- children: N
31598
+ children: re
31575
31599
  }),
31576
31600
  /* @__PURE__ */ H("div", {
31577
31601
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
@@ -31580,9 +31604,9 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31580
31604
  children: [
31581
31605
  /* @__PURE__ */ V("button", {
31582
31606
  onClick: Se,
31583
- disabled: !j && !m && !g,
31584
- className: `w-full px-4 py-2.5 text-sm font-medium rounded-lg transition-colors ${j ? "bg-primary text-primary-foreground animate-pulse" : "bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"}`,
31585
- children: j ? R.length > 0 ? R[R.length - 1] : "Processing..." : "Run Pipeline"
31607
+ disabled: !ne && !m && !g,
31608
+ className: `w-full px-4 py-2.5 text-sm font-medium rounded-lg transition-colors ${ne ? "bg-primary text-primary-foreground animate-pulse" : "bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"}`,
31609
+ children: ne ? L.length > 0 ? L[L.length - 1] : "Processing..." : "Run Pipeline"
31586
31610
  }),
31587
31611
  /* @__PURE__ */ H("div", {
31588
31612
  className: "rounded-md border border-border bg-surface p-2 space-y-2",
@@ -31604,7 +31628,7 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31604
31628
  min: 1,
31605
31629
  max: 1e3,
31606
31630
  className: "mt-1 w-full px-2 py-2 sm:py-1 text-sm bg-background border border-border rounded",
31607
- value: re,
31631
+ value: z,
31608
31632
  onChange: (e) => ie(Number(e.target.value)),
31609
31633
  disabled: se
31610
31634
  })]
@@ -31685,7 +31709,7 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31685
31709
  t,
31686
31710
  " · ",
31687
31711
  k ?? "node default pool",
31688
- te ? ` · camera #${te.deviceId} (resolved tree)` : " · custom tree"
31712
+ A ? ` · camera #${A.deviceId} (resolved tree)` : " · custom tree"
31689
31713
  ]
31690
31714
  })
31691
31715
  ]
@@ -31808,7 +31832,7 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31808
31832
  detections: Oe,
31809
31833
  placeholder: "Select an image above"
31810
31834
  }),
31811
- F && Oe.length > 0 && /* @__PURE__ */ H("div", {
31835
+ N && Oe.length > 0 && /* @__PURE__ */ H("div", {
31812
31836
  className: "text-xs text-foreground-subtle",
31813
31837
  children: [
31814
31838
  Oe.length,
@@ -31820,24 +31844,24 @@ function kO({ trpc: e, nodeId: t, onNodeChange: n }) {
31820
31844
  Te
31821
31845
  ]
31822
31846
  }),
31823
- R.length > 0 && /* @__PURE__ */ V("div", {
31847
+ L.length > 0 && /* @__PURE__ */ V("div", {
31824
31848
  className: "rounded-md border border-border bg-surface p-3 space-y-1 text-xs text-foreground-subtle",
31825
- children: R.map((e, t) => /* @__PURE__ */ H("div", {
31849
+ children: L.map((e, t) => /* @__PURE__ */ H("div", {
31826
31850
  className: "flex items-center gap-2",
31827
- children: [/* @__PURE__ */ V("span", { className: `h-1.5 w-1.5 rounded-full shrink-0 ${t === R.length - 1 ? "bg-primary animate-pulse" : "bg-foreground-subtle/30"}` }), e]
31851
+ children: [/* @__PURE__ */ V("span", { className: `h-1.5 w-1.5 rounded-full shrink-0 ${t === L.length - 1 ? "bg-primary animate-pulse" : "bg-foreground-subtle/30"}` }), e]
31828
31852
  }, t))
31829
31853
  }),
31830
31854
  Object.keys(ke).length > 0 && /* @__PURE__ */ V(UE, {
31831
31855
  timings: ke,
31832
- totalMs: F?.debug?.totalInferenceMs
31856
+ totalMs: N?.debug?.totalInferenceMs
31833
31857
  }),
31834
- F && /* @__PURE__ */ V(dp, {
31858
+ N && /* @__PURE__ */ V(dp, {
31835
31859
  detections: Ee,
31836
31860
  hiddenKeys: _e,
31837
31861
  onToggleVisibility: ye
31838
31862
  }),
31839
31863
  /* @__PURE__ */ V(HE, {
31840
- data: F,
31864
+ data: N,
31841
31865
  label: "Pipeline Response"
31842
31866
  })
31843
31867
  ]
@@ -33095,7 +33119,7 @@ function ZO(e) {
33095
33119
  return t;
33096
33120
  }
33097
33121
  function QO({ trpc: e }) {
33098
- let [t, n] = l([]), [r, i] = l(""), [a, s] = l(null), [c, u] = l(""), [d, f] = l([]), [p, m] = l(/* @__PURE__ */ new Set()), [g, _] = l({}), [y, b] = l({}), [x, S] = l({}), [C, w] = l({}), [T, E] = l({}), [D, O] = l(15), [k, ee] = l(4), [te, A] = l(2), [j, M] = l(640), [N, P] = l(!1), [F, I] = l(null), [ne, L] = l(null), [R, z] = l(""), [re, ie] = l(null);
33122
+ let [t, n] = l([]), [r, i] = l(""), [a, s] = l(null), [c, u] = l(""), [d, f] = l([]), [p, m] = l(/* @__PURE__ */ new Set()), [g, _] = l({}), [y, b] = l({}), [x, S] = l({}), [C, w] = l({}), [T, E] = l({}), [D, O] = l(15), [k, ee] = l(4), [A, te] = l(2), [ne, j] = l(640), [re, M] = l(!1), [N, P] = l(null), [F, I] = l(null), [L, R] = l(""), [z, ie] = l(null);
33099
33123
  v(() => {
33100
33124
  e.pipelineExecutor.listReferenceImages.query().then((e) => {
33101
33125
  n(e), e.length > 0 && e[0] && (i(e[0].filename), u(e[0].filename));
@@ -33165,30 +33189,30 @@ function QO({ trpc: e }) {
33165
33189
  r >= 0 && (s(e.slice(r + 1)), i(""), u(`upload: ${t.name}`));
33166
33190
  }, n.readAsDataURL(t);
33167
33191
  }, []), U = h(() => d.filter((e) => p.has(e.id)), [d, p]), se = o(async () => {
33168
- if (F) {
33169
- L("stopping…");
33192
+ if (N) {
33193
+ I("stopping…");
33170
33194
  try {
33171
33195
  await e.addons.custom.mutate({
33172
33196
  addonId: "benchmark",
33173
33197
  action: "abortSustainedThroughput",
33174
- input: { sessionId: F }
33198
+ input: { sessionId: N }
33175
33199
  });
33176
33200
  } catch (e) {
33177
33201
  console.warn("[benchmark:sustained] abort failed", e);
33178
33202
  }
33179
33203
  }
33180
- }, [e, F]), ce = o(async () => {
33204
+ }, [e, N]), ce = o(async () => {
33181
33205
  if (!a) {
33182
- z("No frame loaded");
33206
+ R("No frame loaded");
33183
33207
  return;
33184
33208
  }
33185
33209
  if (U.length === 0) {
33186
- z("Select at least one node");
33210
+ R("Select at least one node");
33187
33211
  return;
33188
33212
  }
33189
- z(""), ie(null), P(!0);
33213
+ R(""), ie(null), M(!0);
33190
33214
  let t = `sustain-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
33191
- I(t), L("pinning frame…");
33215
+ P(t), I("pinning frame…");
33192
33216
  let n = null;
33193
33217
  try {
33194
33218
  n = (await e.addons.custom.mutate({
@@ -33228,23 +33252,23 @@ function QO({ trpc: e }) {
33228
33252
  };
33229
33253
  });
33230
33254
  });
33231
- L(`running ${D}s · batch ${k} · concurrency ${te} · ${r.length} node(s)`), ie(await e.addons.custom.mutate({
33255
+ I(`running ${D}s · batch ${k} · concurrency ${A} · ${r.length} node(s)`), ie(await e.addons.custom.mutate({
33232
33256
  addonId: "benchmark",
33233
33257
  action: "runSustainedThroughput",
33234
33258
  input: {
33235
33259
  frameId: n,
33236
33260
  durationSec: D,
33237
33261
  batchSize: k,
33238
- concurrency: te,
33239
- targetSize: j,
33262
+ concurrency: A,
33263
+ targetSize: ne,
33240
33264
  sessionId: t,
33241
33265
  nodes: r
33242
33266
  }
33243
- })), L(null);
33267
+ })), I(null);
33244
33268
  } catch (e) {
33245
- z(e instanceof Error ? e.message : String(e)), L(null);
33269
+ R(e instanceof Error ? e.message : String(e)), I(null);
33246
33270
  } finally {
33247
- P(!1), I(null), n && e.addons.custom.mutate({
33271
+ M(!1), P(null), n && e.addons.custom.mutate({
33248
33272
  addonId: "benchmark",
33249
33273
  action: "releaseBenchFrame",
33250
33274
  input: { frameId: n }
@@ -33261,8 +33285,8 @@ function QO({ trpc: e }) {
33261
33285
  C,
33262
33286
  D,
33263
33287
  k,
33264
- te,
33265
- j
33288
+ A,
33289
+ ne
33266
33290
  ]), le = "w-24 px-2 py-1.5 text-sm rounded-md border border-border bg-surface text-foreground", ue = "rounded-lg border border-border bg-surface p-4 space-y-3";
33267
33291
  return /* @__PURE__ */ H("div", {
33268
33292
  className: "space-y-4",
@@ -33357,8 +33381,8 @@ function QO({ trpc: e }) {
33357
33381
  type: "number",
33358
33382
  min: 1,
33359
33383
  max: 64,
33360
- value: te,
33361
- onChange: (e) => A(Math.max(1, Number(e.target.value) || 1)),
33384
+ value: A,
33385
+ onChange: (e) => te(Math.max(1, Number(e.target.value) || 1)),
33362
33386
  className: le
33363
33387
  })]
33364
33388
  }),
@@ -33372,8 +33396,8 @@ function QO({ trpc: e }) {
33372
33396
  min: 64,
33373
33397
  max: 2048,
33374
33398
  step: 32,
33375
- value: j,
33376
- onChange: (e) => M(Math.max(64, Number(e.target.value) || 640)),
33399
+ value: ne,
33400
+ onChange: (e) => j(Math.max(64, Number(e.target.value) || 640)),
33377
33401
  className: le
33378
33402
  })]
33379
33403
  })
@@ -33463,38 +33487,38 @@ function QO({ trpc: e }) {
33463
33487
  children: [
33464
33488
  /* @__PURE__ */ V("button", {
33465
33489
  onClick: ce,
33466
- disabled: N,
33490
+ disabled: re,
33467
33491
  className: "px-4 py-2 text-sm rounded-md bg-primary text-white disabled:opacity-50",
33468
- children: N ? "Running…" : "Start"
33492
+ children: re ? "Running…" : "Start"
33469
33493
  }),
33470
33494
  /* @__PURE__ */ V("button", {
33471
33495
  onClick: se,
33472
- disabled: !N,
33496
+ disabled: !re,
33473
33497
  className: "px-4 py-2 text-sm rounded-md border border-border text-foreground disabled:opacity-50",
33474
33498
  children: "Stop"
33475
33499
  }),
33476
- ne && /* @__PURE__ */ V("span", {
33500
+ F && /* @__PURE__ */ V("span", {
33477
33501
  className: "text-xs text-foreground-subtle",
33478
- children: ne
33502
+ children: F
33479
33503
  }),
33480
- R && /* @__PURE__ */ V("span", {
33504
+ L && /* @__PURE__ */ V("span", {
33481
33505
  className: "text-xs text-red-500",
33482
- children: R
33506
+ children: L
33483
33507
  })
33484
33508
  ]
33485
33509
  }),
33486
- re && /* @__PURE__ */ H("div", {
33510
+ z && /* @__PURE__ */ H("div", {
33487
33511
  className: ue,
33488
33512
  children: [/* @__PURE__ */ H("h3", {
33489
33513
  className: "text-sm font-semibold text-foreground",
33490
33514
  children: [
33491
33515
  "Results — ",
33492
- re.durationSec,
33516
+ z.durationSec,
33493
33517
  "s · batch ",
33494
- re.batchSize,
33518
+ z.batchSize,
33495
33519
  " · concurrency",
33496
33520
  " ",
33497
- re.concurrency
33521
+ z.concurrency
33498
33522
  ]
33499
33523
  }), /* @__PURE__ */ V("div", {
33500
33524
  className: "overflow-x-auto",
@@ -33540,7 +33564,7 @@ function QO({ trpc: e }) {
33540
33564
  children: "errors"
33541
33565
  })
33542
33566
  ]
33543
- }) }), /* @__PURE__ */ V("tbody", { children: re.perNode.map((e, t) => /* @__PURE__ */ H("tr", {
33567
+ }) }), /* @__PURE__ */ V("tbody", { children: z.perNode.map((e, t) => /* @__PURE__ */ H("tr", {
33544
33568
  className: "border-b border-border/50",
33545
33569
  children: [
33546
33570
  /* @__PURE__ */ H("td", {
@@ -33793,7 +33817,7 @@ function ck({ trpc: e }) {
33793
33817
  } finally {
33794
33818
  m(!1);
33795
33819
  }
33796
- }, [E, a]), te = o(async () => {
33820
+ }, [E, a]), A = o(async () => {
33797
33821
  m(!0), x([]);
33798
33822
  let e = [];
33799
33823
  for (let t of T) {
@@ -33942,7 +33966,7 @@ function ck({ trpc: e }) {
33942
33966
  }),
33943
33967
  /* @__PURE__ */ V(uk, {
33944
33968
  label: "Test each endpoint",
33945
- onClick: () => void te(),
33969
+ onClick: () => void A(),
33946
33970
  disabled: p || T.length === 0,
33947
33971
  running: p
33948
33972
  })