@nivaro/react 0.3.57 → 0.3.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +5 -1
  4. package/dist/shared/components/CollectionBrowserView.js +2633 -2590
  5. package/dist/shared/components/DataTable.js +247 -236
  6. package/dist/shared/components/ItemEditForm.js +1693 -1668
  7. package/dist/shared/components/ProfileView.js +716 -715
  8. package/dist/shared/components/RecordReadView.js +367 -364
  9. package/dist/shared/components/ReportView.js +64 -39
  10. package/dist/shared/components/alerts/AlertManagerView.js +284 -271
  11. package/dist/shared/components/cbv/row-focus.js +19 -0
  12. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  13. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  14. package/dist/shared/components/integrations/console/tone.js +52 -30
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  16. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  17. package/dist/shared/components/item-edit/InlineTableField.js +407 -402
  18. package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
  19. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  20. package/dist/shared/components/item-edit/PlanGrid.js +826 -803
  21. package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
  22. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  23. package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
  24. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
  25. package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
  26. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  27. package/dist/shared/components/item-edit/related-missing.js +45 -0
  28. package/dist/shared/components/item-edit/save-outcome.js +5 -5
  29. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  30. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  31. package/dist/shared/components/panels/ItemLockBanner.js +2 -3
  32. package/dist/shared/components/panels/PipelinePanel.js +1027 -978
  33. package/dist/shared/components/panels/RevisionsPanel.js +4 -1
  34. package/dist/shared/components/panels/TaskPanel.js +265 -249
  35. package/dist/shared/components/panels/landing-state.js +27 -0
  36. package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
  37. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  38. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  39. package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
  40. package/dist/shared/components/queue/QueueWorklist.js +357 -358
  41. package/dist/shared/components/queue/group-sums.js +27 -0
  42. package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
  43. package/dist/shared/lib/back-closes.js +25 -0
  44. package/dist/shared/lib/form-usage-beacon.js +7 -7
  45. package/dist/shared/lib/list-page-memory.js +41 -0
  46. package/dist/shared/lib/live.js +44 -44
  47. package/dist/shared/lib/own-writes.js +76 -28
  48. package/dist/shared/lib/request-gate.js +110 -109
  49. package/dist/shared/lib/validation-rules.js +34 -19
  50. package/package.json +1 -1
@@ -1,20 +1,20 @@
1
- import { jsx as i, jsxs as T } from "react/jsx-runtime";
2
- import { useQueryClient as or } from "@tanstack/react-query";
3
- import { Play as Rt, Hourglass as lr, RotateCw as cr, VideoOff as Lt, Pause as ur, Captions as dr, Maximize as fr } from "lucide-react";
4
- import { useState as g, useRef as f, useEffect as C, useCallback as H, useMemo as Ft } from "react";
5
- import { useNivaroClient as hr, useApiFetchConfig as pr } from "../../context.js";
6
- import { useLiveEvent as mr } from "../../lib/live.js";
7
- import { useCardBrand as gr, fetchHelpVideo as Ht, helpVideoKeys as qe, helpVideoApi as br } from "./api.js";
8
- import { CardLayer as yr } from "./CardLayer.js";
9
- import { CursorLayer as vr } from "./CursorLayer.js";
10
- import { captionLookOf as wr, introMs as rt, outroMs as be, editedDuration as kr, sourceToEdited as Ae, heldAtMoment as xr, bodyDuration as _r, editedToSource as qt, cardPhaseAt as At, holdAtEdited as Nr } from "./edits.js";
11
- import { useLiveMusic as Mr } from "./musicMix.js";
1
+ import { jsx as i, jsxs as $, Fragment as lr } from "react/jsx-runtime";
2
+ import { useQueryClient as cr } from "@tanstack/react-query";
3
+ import { Play as Rt, Hourglass as ur, RotateCw as dr, VideoOff as Ft, Pause as fr, Captions as hr, Maximize as pr } from "lucide-react";
4
+ import { useState as g, useRef as f, useEffect as M, useCallback as H, useMemo as Lt } from "react";
5
+ import { useNivaroClient as mr, useApiFetchConfig as gr } from "../../context.js";
6
+ import { useLiveEvent as br } from "../../lib/live.js";
7
+ import { useCardBrand as yr, fetchHelpVideo as Ht, helpVideoKeys as qe, helpVideoApi as vr } from "./api.js";
8
+ import { CardLayer as wr } from "./CardLayer.js";
9
+ import { CursorLayer as kr } from "./CursorLayer.js";
10
+ import { captionLookOf as xr, introMs as rt, outroMs as be, editedDuration as _r, sourceToEdited as Ae, heldAtMoment as Nr, bodyDuration as Cr, editedToSource as qt, cardPhaseAt as At, holdAtEdited as Mr } from "./edits.js";
11
+ import { useLiveMusic as $r } from "./musicMix.js";
12
12
  import { OverlayLayer as Ot } from "./OverlayLayer.js";
13
- import { fileMsForSource as Cr, viewAt as $r, NO_VIEW as Tr, resolveDurationMs as Sr, fitFrame as Pr, holdReached as Rr, liveStep as Lr } from "./playerMath.js";
14
- import { createProgressBeats as Fr } from "./progressBeats.js";
15
- import { rippleTickTimes as Hr, ticksBetween as qr, playRippleTick as Ar } from "./rippleSound.js";
16
- import { useCaptionStyle as Or, CaptionSettingsButton as Vr } from "./viewer/CaptionSettings.js";
17
- import { DownloadMenu as jr } from "./viewer/DownloadMenu.js";
13
+ import { fileMsForSource as Tr, viewAt as Sr, NO_VIEW as Pr, resolveDurationMs as Rr, fitFrame as Fr, holdReached as Lr, liveStep as Hr } from "./playerMath.js";
14
+ import { createProgressBeats as qr } from "./progressBeats.js";
15
+ import { rippleTickTimes as Ar, ticksBetween as Or, playRippleTick as Vr } from "./rippleSound.js";
16
+ import { useCaptionStyle as jr, CaptionSettingsButton as Dr } from "./viewer/CaptionSettings.js";
17
+ import { DownloadMenu as Er } from "./viewer/DownloadMenu.js";
18
18
  const nt = [0.75, 1, 1.25, 1.5, 2], Oe = (a) => {
19
19
  const S = Math.max(0, Math.floor(a / 1e3));
20
20
  return `${Math.floor(S / 60)}:${String(S % 60).padStart(2, "0")}`;
@@ -22,10 +22,10 @@ const nt = [0.75, 1, 1.25, 1.5, 2], Oe = (a) => {
22
22
  var S;
23
23
  return !at(a) && ((S = a.published) == null ? void 0 : S.playable) === !1;
24
24
  }, it = (a) => a.trackProgress && !a.useDraft, ve = "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md transition-colors duration-150 hover:bg-slate-100 hover:text-slate-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan motion-reduce:transition-none dark:hover:bg-white/5 dark:hover:text-foreground", Ve = "text-slate-600 dark:text-muted-foreground", Vt = "text-slate-900 dark:text-foreground";
25
- function an(a) {
26
- return /* @__PURE__ */ i(Dr, { ...a }, a.video.id);
25
+ function ln(a) {
26
+ return /* @__PURE__ */ i(Wr, { ...a }, a.video.id);
27
27
  }
28
- function Dr({
28
+ function Wr({
29
29
  video: a,
30
30
  mode: S,
31
31
  edits: je,
@@ -40,12 +40,12 @@ function Dr({
40
40
  children: We
41
41
  }) {
42
42
  var $t, Tt, St;
43
- const ae = hr(), oe = or(), { apiBase: Be, authHeaders: lt, credentials: we } = pr(), Ie = Be.replace(/\/api$/, ""), [Ke, ke] = g(null), [xe, D] = g(null), le = f(!1), [ze, Qe] = g(a), ct = f(ze);
43
+ const ae = mr(), oe = cr(), { apiBase: Be, authHeaders: lt, credentials: we } = gr(), Ie = Be.replace(/\/api$/, ""), [Ke, ke] = g(null), [xe, D] = g(null), le = f(!1), [ze, Qe] = g(a), ct = f(ze);
44
44
  ct.current = ze;
45
45
  const [ut, ce] = g(null), _e = f(!1), ue = f(xe);
46
46
  ue.current = xe;
47
47
  const [dt, Ge] = g(!1), [Dt, Et] = g(0), Ne = f(null);
48
- C(() => {
48
+ M(() => {
49
49
  var e, r;
50
50
  if (_e.current && !at(a)) {
51
51
  const n = (e = ct.current.published) == null ? void 0 : e.id, s = (r = a.published) == null ? void 0 : r.id;
@@ -64,41 +64,44 @@ function Dr({
64
64
  }, [a]);
65
65
  const c = Ke && Ke.id === a.id ? Ke : ze, Je = at(c), ee = j || S === "live" && Je, o = j ? c.draft : c.published, t = je ?? (o == null ? void 0 : o.edits), p = !ee && !!(o != null && o.rendered_current), Wt = (e) => `${e}${e.includes("?") ? "&" : "?"}source=1`, ft = ee ? c.draft_stream_url ?? (Je && c.stream_url ? Wt(c.stream_url) : null) : c.stream_url, de = ft ? `${Ie}${ft}` : null, Bt = !ee && c.poster_url ? `${Ie}${c.poster_url}` : void 0, ht = f(null), pt = f(null), [l, It] = g(null), N = f(null);
66
66
  N.current = l;
67
- const [h, Kt] = g(null), [$, zt] = g(0), [Me, Ue] = g(!1), [te, Ce] = g(!1);
67
+ const [h, Kt] = g(null), [T, zt] = g(0), [Ce, Ue] = g(!1), [te, Me] = g(!1);
68
68
  _e.current = te;
69
- const [q, Qt] = g(1), [$e, mt] = g(!0), [gt, Gt] = Or(t ? wr(t) : void 0), [Jt, Ut] = g(0), [E, Te] = g(!1), Se = f(null), fe = f(null), F = f(se);
70
- F.current = se;
71
- const v = !p && !!t, P = v ? t == null ? void 0 : t.crop : void 0, Xe = P ? `${P.x},${P.y},${P.w},${P.h}` : "", A = t ? rt(t) : 0, Pe = t ? be(t) : 0, bt = !!t && (A > 0 || Pe > 0 || t.chapter_banners === !0), Xt = gr(bt && !p, Ie), [M, Yt] = g(
69
+ const [q, Qt] = g(1), [$e, mt] = g(!0), Gt = ((t == null ? void 0 : t.captions) ?? []).some((e) => {
70
+ var r;
71
+ return !!((r = e == null ? void 0 : e.text) != null && r.trim());
72
+ }), [gt, Jt] = jr(t ? xr(t) : void 0), [Ut, Xt] = g(0), [E, Te] = g(!1), Se = f(null), fe = f(null), L = f(se);
73
+ L.current = se;
74
+ const v = !p && !!t, P = v ? t == null ? void 0 : t.crop : void 0, Xe = P ? `${P.x},${P.y},${P.w},${P.h}` : "", A = t ? rt(t) : 0, Pe = t ? be(t) : 0, bt = !!t && (A > 0 || Pe > 0 || t.chapter_banners === !0), Yt = yr(bt && !p, Ie), [C, Zt] = g(
72
75
  () => v && A > 0 ? { kind: "intro", at: 0, playing: !1 } : null
73
- ), R = f(M), u = H((e) => {
74
- R.current = e, Yt(e);
75
- }, []), [re, Zt] = g(null), W = f(re), w = H((e) => {
76
- W.current = e, Zt(e);
77
- }, []), ne = f(0), B = f(null), he = !ee && ye(c) || xe === "processing" ? "processing" : xe === "error" ? "error" : de ? "ok" : "unavailable", b = p ? Jt : t ? kr(t) : 0, er = p ? $ : t ? re ? (Ae(t, re.at_ms) ?? A) + re.elapsed : (Ae(t, $) ?? A) + // Just released from a hold: the clock is past it, not back at
76
+ ), R = f(C), u = H((e) => {
77
+ R.current = e, Zt(e);
78
+ }, []), [re, er] = g(null), W = f(re), w = H((e) => {
79
+ W.current = e, er(e);
80
+ }, []), ne = f(0), B = f(null), he = !ee && ye(c) || xe === "processing" ? "processing" : xe === "error" ? "error" : de ? "ok" : "unavailable", b = p ? Ut : t ? _r(t) : 0, tr = p ? T : t ? re ? (Ae(t, re.at_ms) ?? A) + re.elapsed : (Ae(t, T) ?? A) + // Just released from a hold: the clock is past it, not back at
78
81
  // its start, until the picture moves on from the held moment.
79
- ((($t = B.current) == null ? void 0 : $t.at_ms) === Math.round($) ? xr(t, $) : 0) : $, y = M && t ? M.kind === "intro" ? M.at : A + _r(t) + M.at : er, U = p && t ? qt(t, $) : $, Ye = Ft(
80
- () => v && t ? Hr(t) : [],
82
+ ((($t = B.current) == null ? void 0 : $t.at_ms) === Math.round(T) ? Nr(t, T) : 0) : T, y = C && t ? C.kind === "intro" ? C.at : A + Cr(t) + C.at : tr, U = p && t ? qt(t, T) : T, Ye = Lt(
83
+ () => v && t ? Ar(t) : [],
81
84
  [v, t]
82
- ), yt = f($);
83
- C(() => {
85
+ ), yt = f(T);
86
+ M(() => {
84
87
  const e = yt.current;
85
- yt.current = $;
88
+ yt.current = T;
86
89
  const r = N.current;
87
- !Ye.length || !Me || M || !r || r.muted || qr(Ye, e, $, 1e3 * 4 * Math.max(1, r.playbackRate)) && Ar(r.volume);
88
- }, [$, Ye, Me, M]);
89
- const Re = t ? At(t, y).phase : "body", O = M ? M.playing : re ? re.playing : Me;
90
- Mr({
90
+ !Ye.length || !Ce || C || !r || r.muted || Or(Ye, e, T, 1e3 * 4 * Math.max(1, r.playbackRate)) && Vr(r.volume);
91
+ }, [T, Ye, Ce, C]);
92
+ const Re = t ? At(t, y).phase : "body", O = C ? C.playing : re ? re.playing : Ce;
93
+ $r({
91
94
  enabled: v && !!(t != null && t.music),
92
95
  videoId: c.id,
93
96
  edits: t,
94
97
  levels: (o == null ? void 0 : o.levels) ?? null,
95
98
  editedMs: y,
96
- srcMs: $,
99
+ srcMs: T,
97
100
  phase: Re,
98
101
  playing: O,
99
102
  video: l,
100
103
  rate: q
101
- }), C(() => {
104
+ }), M(() => {
102
105
  var r;
103
106
  const e = R.current;
104
107
  if (!v) {
@@ -106,23 +109,23 @@ function Dr({
106
109
  return;
107
110
  }
108
111
  (e == null ? void 0 : e.kind) === "intro" && A <= 0 || (e == null ? void 0 : e.kind) === "outro" && Pe <= 0 ? u(null) : !e && A > 0 && !te && (((r = N.current) == null ? void 0 : r.paused) ?? !0) && u({ kind: "intro", at: 0, playing: !1 });
109
- }, [v, A, Pe, te, u]), C(() => {
112
+ }, [v, A, Pe, te, u]), M(() => {
110
113
  var n, s;
111
114
  const e = W.current;
112
115
  !e || v && ((n = t == null ? void 0 : t.holds) != null && n.some((d) => d.id === e.id && d.at_ms === e.at_ms)) || (w(null), B.current = { id: e.id, at_ms: e.at_ms }, e.playing && v && ((s = N.current) == null || s.play().catch(() => null)));
113
- }, [v, t, w]), C(() => {
116
+ }, [v, t, w]), M(() => {
114
117
  const e = pt.current;
115
118
  if (!e) return;
116
119
  const [, , r, n] = Xe ? Xe.split(",").map(Number) : [0, 0, 1, 1], s = () => {
117
120
  const x = (l == null ? void 0 : l.videoWidth) || (o == null ? void 0 : o.width) || 16, m = (l == null ? void 0 : l.videoHeight) || (o == null ? void 0 : o.height) || 9;
118
- Kt(Pr(e.clientWidth, e.clientHeight, x * r, m * n));
121
+ Kt(Fr(e.clientWidth, e.clientHeight, x * r, m * n));
119
122
  };
120
123
  fe.current = s;
121
124
  const d = new ResizeObserver(s);
122
125
  return d.observe(e), l == null || l.addEventListener("loadedmetadata", s), s(), () => {
123
126
  d.disconnect(), l == null || l.removeEventListener("loadedmetadata", s), fe.current = null;
124
127
  };
125
- }, [l, o == null ? void 0 : o.width, o == null ? void 0 : o.height, Xe]), C(() => {
128
+ }, [l, o == null ? void 0 : o.width, o == null ? void 0 : o.height, Xe]), M(() => {
126
129
  const e = l;
127
130
  if (!e) return;
128
131
  let r = 0, n = performance.now();
@@ -132,30 +135,30 @@ function Dr({
132
135
  n = d;
133
136
  const m = R.current;
134
137
  if (!p && t && (m != null && m.playing)) {
135
- const L = m.kind === "intro" ? rt(t) : be(t), Q = m.at + x * q;
136
- Q < L ? u({ ...m, at: Q }) : m.kind === "intro" ? (u(null), e.currentTime = (((_ = t.segments[0]) == null ? void 0 : _.start_ms) ?? 0) / 1e3, e.play().catch(() => null)) : (u({ ...m, at: L, playing: !1 }), rr.current());
138
+ const F = m.kind === "intro" ? rt(t) : be(t), Q = m.at + x * q;
139
+ Q < F ? u({ ...m, at: Q }) : m.kind === "intro" ? (u(null), e.currentTime = (((_ = t.segments[0]) == null ? void 0 : _.start_ms) ?? 0) / 1e3, e.play().catch(() => null)) : (u({ ...m, at: F, playing: !1 }), nr.current());
137
140
  }
138
141
  const k = W.current;
139
142
  if (!p && t && (k != null && k.playing)) {
140
- const L = k.elapsed + x * q;
141
- L < k.hold_ms ? w({ ...k, elapsed: L }) : (w(null), B.current = { id: k.id, at_ms: k.at_ms }, ne.current = k.at_ms, e.play().catch(() => null));
143
+ const F = k.elapsed + x * q;
144
+ F < k.hold_ms ? w({ ...k, elapsed: F }) : (w(null), B.current = { id: k.id, at_ms: k.at_ms }, ne.current = k.at_ms, e.play().catch(() => null));
142
145
  }
143
146
  const K = e.currentTime * 1e3, z = B.current;
144
147
  if (z && Math.abs(K - z.at_ms) > 1e3 && (B.current = null), !p && t && !e.paused) {
145
- const L = Rr(t, ne.current, K, ((ge = B.current) == null ? void 0 : ge.id) ?? null);
146
- if (L)
147
- e.pause(), e.currentTime = L.at_ms / 1e3, w({ id: L.id, at_ms: L.at_ms, hold_ms: L.hold_ms, elapsed: 0, playing: !0 });
148
+ const F = Lr(t, ne.current, K, ((ge = B.current) == null ? void 0 : ge.id) ?? null);
149
+ if (F)
150
+ e.pause(), e.currentTime = F.at_ms / 1e3, w({ id: F.id, at_ms: F.at_ms, hold_ms: F.hold_ms, elapsed: 0, playing: !0 });
148
151
  else {
149
- const Q = Lr(t, K);
150
- Q.action === "end" ? (e.pause(), be(t) > 0 && !R.current ? u({ kind: "outro", at: 0, playing: !0 }) : be(t) <= 0 && ((Pt = F.current) == null || Pt.call(F))) : (e.playbackRate !== Q.rate * q && (e.playbackRate = Q.rate * q), Q.action === "seek" && (e.currentTime = Q.toMs / 1e3));
152
+ const Q = Hr(t, K);
153
+ Q.action === "end" ? (e.pause(), be(t) > 0 && !R.current ? u({ kind: "outro", at: 0, playing: !0 }) : be(t) <= 0 && ((Pt = L.current) == null || Pt.call(L))) : (e.playbackRate !== Q.rate * q && (e.playbackRate = Q.rate * q), Q.action === "seek" && (e.currentTime = Q.toMs / 1e3));
151
154
  }
152
155
  }
153
156
  ne.current = e.currentTime * 1e3, zt(e.currentTime * 1e3), r = requestAnimationFrame(s);
154
157
  };
155
158
  return r = requestAnimationFrame(s), () => cancelAnimationFrame(r);
156
- }, [l, p, t, q, u, w]), C(() => {
159
+ }, [l, p, t, q, u, w]), M(() => {
157
160
  p && l && (l.playbackRate = q);
158
- }, [l, p, q]), C(() => {
161
+ }, [l, p, q]), M(() => {
159
162
  G == null || G(U, y);
160
163
  }, [U, y, G]);
161
164
  const X = H(
@@ -170,7 +173,7 @@ function Dr({
170
173
  const n = R.current, s = W.current, d = n ? n.playing : s ? s.playing : !r.paused, x = At(t, e);
171
174
  if (x.phase === "body") {
172
175
  n && u(null), B.current = null;
173
- const _ = Nr(t, e);
176
+ const _ = Mr(t, e);
174
177
  if (_) {
175
178
  r.paused || r.pause(), r.currentTime = _.hold.at_ms / 1e3, ne.current = _.hold.at_ms, w({
176
179
  id: _.hold.id,
@@ -188,13 +191,13 @@ function Dr({
188
191
  r.paused || r.pause(), s && w(null), r.currentTime = (k ?? 0) / 1e3, u({ kind: x.phase, at: x.at, playing: d });
189
192
  },
190
193
  [p, t, u, w]
191
- ), tr = H(
194
+ ), rr = H(
192
195
  (e) => {
193
196
  R.current && u(null);
194
197
  const r = W.current;
195
198
  r && w(null), B.current = null;
196
199
  const n = N.current;
197
- n && (n.currentTime = Cr(t, p, e) / 1e3, ne.current = n.currentTime * 1e3, r != null && r.playing && n.paused && n.play().catch(() => null));
200
+ n && (n.currentTime = Tr(t, p, e) / 1e3, ne.current = n.currentTime * 1e3, r != null && r.playing && n.paused && n.play().catch(() => null));
198
201
  },
199
202
  [u, w, t, p]
200
203
  ), ie = H(() => {
@@ -203,7 +206,7 @@ function Dr({
203
206
  if (!e) return;
204
207
  const r = W.current;
205
208
  if (r && t && !p) {
206
- w({ ...r, playing: !r.playing }), r.playing ? Z.current() : (Ce(!0), tt.current());
209
+ w({ ...r, playing: !r.playing }), r.playing ? Z.current() : (Me(!0), tt.current());
207
210
  return;
208
211
  }
209
212
  const n = R.current;
@@ -212,7 +215,7 @@ function Dr({
212
215
  rt(t) > 0 ? u({ kind: "intro", at: 0, playing: !0 }) : (u(null), e.currentTime = (((s = t.segments[0]) == null ? void 0 : s.start_ms) ?? 0) / 1e3, e.play().catch(() => null));
213
216
  return;
214
217
  }
215
- u({ ...n, playing: !n.playing }), n.playing ? Z.current() : (Ce(!0), tt.current());
218
+ u({ ...n, playing: !n.playing }), n.playing ? Z.current() : (Me(!0), tt.current());
216
219
  return;
217
220
  }
218
221
  e.paused ? e.play().catch(() => null) : e.pause();
@@ -222,7 +225,7 @@ function Dr({
222
225
  };
223
226
  ot && (ot.current = {
224
227
  seekEdited: X,
225
- seekSource: tr,
228
+ seekSource: rr,
226
229
  play: () => {
227
230
  var r;
228
231
  const e = R.current ?? W.current;
@@ -247,7 +250,7 @@ function Dr({
247
250
  }
248
251
  });
249
252
  const Ze = f(!1);
250
- C(() => {
253
+ M(() => {
251
254
  const e = l;
252
255
  if (!e || Ze.current || j) return;
253
256
  const r = Ne.current ?? Ee ?? (c.my_progress && !c.my_progress.completed ? c.my_progress.position_ms : 0), n = () => {
@@ -258,15 +261,15 @@ function Dr({
258
261
  return e.addEventListener("loadedmetadata", n, { once: !0 }), () => e.removeEventListener("loadedmetadata", n);
259
262
  }, [l, c.my_progress, j, p, t, X, Ee]);
260
263
  const wt = f(!1);
261
- C(() => {
262
- !De || wt.current || !M || M.kind !== "intro" || te || (wt.current = !0, u({ ...M, playing: !0 }), Ce(!0));
263
- }, [De, M, te, u]);
264
+ M(() => {
265
+ !De || wt.current || !C || C.kind !== "intro" || te || (wt.current = !0, u({ ...C, playing: !0 }), Me(!0));
266
+ }, [De, C, te, u]);
264
267
  const Y = f({ trackProgress: J, useDraft: j, totalMs: b, editedMs: y, dto: c });
265
268
  Y.current = { trackProgress: J, useDraft: j, totalMs: b, editedMs: y, dto: c };
266
269
  const kt = f({ apiBase: Be, authHeaders: lt, credentials: we, client: ae, qc: oe });
267
270
  kt.current = { apiBase: Be, authHeaders: lt, credentials: we, client: ae, qc: oe };
268
271
  const [V] = g(
269
- () => Fr((e, r) => {
272
+ () => qr((e, r) => {
270
273
  var z;
271
274
  const { apiBase: n, authHeaders: s, credentials: d, client: x, qc: m } = kt.current, k = Y.current.dto.id;
272
275
  if (r)
@@ -278,13 +281,13 @@ function Dr({
278
281
  body: JSON.stringify(e)
279
282
  });
280
283
  const K = !!((z = Y.current.dto.my_progress) != null && z.completed);
281
- return br(x).progress(k, e).then((_) => {
284
+ return vr(x).progress(k, e).then((_) => {
282
285
  var ge;
283
286
  (ge = _ == null ? void 0 : _.data) != null && ge.completed && !K && (m.invalidateQueries({ queryKey: qe.required }), m.invalidateQueries({ queryKey: qe.one(k) }));
284
287
  });
285
288
  })
286
289
  );
287
- C(() => {
290
+ M(() => {
288
291
  var e;
289
292
  if (!O || !b) {
290
293
  V.idle();
@@ -292,7 +295,7 @@ function Dr({
292
295
  }
293
296
  !V.opened && it(Y.current) && V.tryOpen(y, (e = Y.current.dto.published) == null ? void 0 : e.id, b), V.see(y, b, performance.now());
294
297
  }, [V, O, y, b]);
295
- const Le = H(
298
+ const Fe = H(
296
299
  (e = !1) => {
297
300
  var n;
298
301
  const r = Y.current;
@@ -305,23 +308,23 @@ function Dr({
305
308
  !it(e) || V.opened || V.play(e.editedMs, (r = e.dto.published) == null ? void 0 : r.id, e.totalMs);
306
309
  }, tt = f(et);
307
310
  tt.current = et;
308
- const Z = f(Le);
309
- Z.current = Le;
310
- const rr = f(() => {
311
+ const Z = f(Fe);
312
+ Z.current = Fe;
313
+ const nr = f(() => {
311
314
  var e;
312
- Z.current(), (e = F.current) == null || e.call(F);
315
+ Z.current(), (e = L.current) == null || e.call(L);
313
316
  });
314
- C(() => {
317
+ M(() => {
315
318
  if (!O) return;
316
319
  const e = setInterval(() => Z.current(), 1e4);
317
320
  return () => clearInterval(e);
318
- }, [O]), C(() => {
321
+ }, [O]), M(() => {
319
322
  const e = () => Z.current(!0);
320
323
  return window.addEventListener("pagehide", e), () => {
321
324
  window.removeEventListener("pagehide", e), Z.current(!0);
322
325
  };
323
326
  }, []);
324
- const Fe = H(async () => {
327
+ const Le = H(async () => {
325
328
  const e = await oe.fetchQuery({
326
329
  queryKey: qe.one(a.id),
327
330
  queryFn: () => Ht(ae, a.id),
@@ -337,7 +340,7 @@ function Dr({
337
340
  var r;
338
341
  return (r = N.current) == null ? void 0 : r.load();
339
342
  });
340
- }, []), nr = H(async () => {
343
+ }, []), ir = H(async () => {
341
344
  var e, r;
342
345
  if (!(E || !de)) {
343
346
  Se.current = (((e = N.current) == null ? void 0 : e.currentTime) ?? 0) * 1e3, Te(!0);
@@ -357,24 +360,24 @@ function Dr({
357
360
  D("error");
358
361
  return;
359
362
  }
360
- le.current = !0, pe(await Fe());
363
+ le.current = !0, pe(await Le());
361
364
  } catch {
362
365
  D("error");
363
366
  } finally {
364
367
  Te(!1);
365
368
  }
366
369
  }
367
- }, [E, de, we, Fe, pe]), xt = H(async () => {
370
+ }, [E, de, we, Le, pe]), xt = H(async () => {
368
371
  Te(!0), le.current = !0;
369
372
  try {
370
- pe(await Fe());
373
+ pe(await Le());
371
374
  } catch {
372
375
  D((e) => e ?? "error");
373
376
  } finally {
374
377
  Te(!1);
375
378
  }
376
- }, [Fe, pe]), _t = f(c);
377
- _t.current = c, mr(
379
+ }, [Le, pe]), _t = f(c);
380
+ _t.current = c, br(
378
381
  "help-video:changed",
379
382
  async () => {
380
383
  var x, m;
@@ -403,31 +406,31 @@ function Dr({
403
406
  match: (e) => String((e == null ? void 0 : e.video_id) ?? "").toLowerCase() === a.id.toLowerCase()
404
407
  }
405
408
  );
406
- const ir = () => {
409
+ const sr = () => {
407
410
  var s;
408
411
  const e = ut;
409
412
  if (!e) return;
410
413
  const r = (s = e.published) == null ? void 0 : s.edits, n = r ? Ae(r, U) : null;
411
414
  Ne.current = n ?? 0, Ze.current = !1, le.current = !1, O && Ge(!0), u(null), w(null), Qe(e), ke(null), D(null), ce(null), Et((d) => d + 1);
412
- }, Nt = l != null && l.videoWidth && l.videoHeight ? { width: l.videoWidth, height: l.videoHeight } : o != null && o.width && o.height ? { width: o.width, height: o.height } : null, He = v && t ? $r(t, U) : Tr, Mt = v && ((Tt = t == null ? void 0 : t.cursor) != null && Tt.show) ? (o == null ? void 0 : o.pointer) ?? null : null, me = h ? {
415
+ }, Nt = l != null && l.videoWidth && l.videoHeight ? { width: l.videoWidth, height: l.videoHeight } : o != null && o.width && o.height ? { width: o.width, height: o.height } : null, He = v && t ? Sr(t, U) : Pr, Ct = v && ((Tt = t == null ? void 0 : t.cursor) != null && Tt.show) ? (o == null ? void 0 : o.pointer) ?? null : null, me = h ? {
413
416
  width: h.width / ((P == null ? void 0 : P.w) ?? 1),
414
417
  height: h.height / ((P == null ? void 0 : P.h) ?? 1)
415
- } : null, sr = Ft(
418
+ } : null, ar = Lt(
416
419
  () => ((t == null ? void 0 : t.chapters) ?? []).map((e) => ({ ...e, edited: t ? Ae(t, e.at_ms) : null })).filter((e) => e.edited !== null && e.edited > 0),
417
420
  [t]
418
- ), ar = (e) => {
421
+ ), or = (e) => {
419
422
  if (he !== "ok" || !N.current) return;
420
423
  const r = e.key.toLowerCase();
421
424
  r === " " || r === "k" ? (e.preventDefault(), ie()) : r === "arrowleft" || r === "j" ? (e.preventDefault(), X(Math.max(0, y - 5e3))) : r === "arrowright" || r === "l" ? (e.preventDefault(), X(Math.min(b, y + 5e3))) : r === "c" ? mt((n) => !n) : r === "f" && vt();
422
- }, Ct = b ? Math.min(100, Math.min(y, b) / b * 100) : 0, I = he === "ok";
423
- return /* @__PURE__ */ T(
425
+ }, Mt = b ? Math.min(100, Math.min(y, b) / b * 100) : 0, I = he === "ok";
426
+ return /* @__PURE__ */ $(
424
427
  "div",
425
428
  {
426
429
  ref: ht,
427
430
  className: `flex flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card ${jt ?? ""}`,
428
431
  "data-hv-player": a.id,
429
432
  children: [
430
- ut && /* @__PURE__ */ T(
433
+ ut && /* @__PURE__ */ $(
431
434
  "div",
432
435
  {
433
436
  role: "status",
@@ -439,7 +442,7 @@ function Dr({
439
442
  "button",
440
443
  {
441
444
  type: "button",
442
- onClick: ir,
445
+ onClick: sr,
443
446
  className: "inline-flex h-7 items-center rounded-md bg-nvr-cyan px-2.5 text-[12px] font-semibold text-nvr-navy transition-colors duration-150 hover:bg-nvr-cyan-dark focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan focus-visible:ring-offset-1 motion-reduce:transition-none",
444
447
  "data-hv-switch-version": !0,
445
448
  children: "Switch to it"
@@ -457,23 +460,23 @@ function Dr({
457
460
  ]
458
461
  }
459
462
  ),
460
- /* @__PURE__ */ T(
463
+ /* @__PURE__ */ $(
461
464
  "div",
462
465
  {
463
466
  ref: pt,
464
467
  role: I ? "application" : void 0,
465
468
  "aria-label": I ? `Video player: ${c.title}` : void 0,
466
469
  tabIndex: I ? 0 : void 0,
467
- onKeyDown: I ? ar : void 0,
470
+ onKeyDown: I ? or : void 0,
468
471
  className: `relative aspect-video min-h-0 flex-1 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan ${I ? "bg-[#0b0f17]" : "bg-slate-50 dark:bg-background"}`,
469
472
  children: [
470
- I && /* @__PURE__ */ T(
473
+ I && /* @__PURE__ */ $(
471
474
  "div",
472
475
  {
473
476
  className: "absolute overflow-hidden",
474
477
  style: h ? { left: h.left, top: h.top, width: h.width, height: h.height } : { inset: 0 },
475
478
  children: [
476
- /* @__PURE__ */ T(
479
+ /* @__PURE__ */ $(
477
480
  "div",
478
481
  {
479
482
  className: "absolute left-0 top-0 origin-top-left transition-transform duration-75 motion-reduce:transition-none",
@@ -496,14 +499,14 @@ function Dr({
496
499
  crossOrigin: "use-credentials",
497
500
  className: "absolute inset-0 h-full w-full",
498
501
  onPlay: () => {
499
- Ue(!0), Ce(!0), et();
502
+ Ue(!0), Me(!0), et();
500
503
  },
501
504
  onPause: (e) => {
502
- Ue(!1), e.currentTarget.ended || Le();
505
+ Ue(!1), e.currentTarget.ended || Fe();
503
506
  },
504
507
  onEnded: () => {
505
508
  var e;
506
- Ue(!1), v && Pe > 0 && !R.current ? u({ kind: "outro", at: 0, playing: !0 }) : (Le(), (e = F.current) == null || e.call(F));
509
+ Ue(!1), v && Pe > 0 && !R.current ? u({ kind: "outro", at: 0, playing: !0 }) : (Fe(), (e = L.current) == null || e.call(L));
507
510
  },
508
511
  onLoadedMetadata: (e) => {
509
512
  Se.current !== null && (R.current && u(null), e.currentTarget.currentTime = Se.current / 1e3, Se.current = null);
@@ -511,9 +514,9 @@ function Dr({
511
514
  onLoadedData: () => {
512
515
  le.current = !1, dt && Ge(!1);
513
516
  },
514
- onError: () => void nr(),
515
- onDurationChange: (e) => Ut(
516
- Sr(e.currentTarget.duration, (o == null ? void 0 : o.source_duration_ms) ?? null)
517
+ onError: () => void ir(),
518
+ onDurationChange: (e) => Xt(
519
+ Rr(e.currentTarget.duration, (o == null ? void 0 : o.source_duration_ms) ?? null)
517
520
  ),
518
521
  onClick: ie
519
522
  },
@@ -527,16 +530,16 @@ function Dr({
527
530
  srcMs: U,
528
531
  source: Nt,
529
532
  showCaptions: !1,
530
- fade: Me
533
+ fade: Ce
531
534
  }
532
535
  )
533
536
  ]
534
537
  }
535
538
  ),
536
- h && t && Mt && Re === "body" && /* @__PURE__ */ i(
537
- vr,
539
+ h && t && Ct && Re === "body" && /* @__PURE__ */ i(
540
+ kr,
538
541
  {
539
- pointer: Mt,
542
+ pointer: Ct,
540
543
  edits: t,
541
544
  frame: h,
542
545
  srcMs: U,
@@ -544,14 +547,14 @@ function Dr({
544
547
  }
545
548
  ),
546
549
  h && t && v && bt && /* @__PURE__ */ i(
547
- yr,
550
+ wr,
548
551
  {
549
552
  edits: t,
550
553
  editedMs: y,
551
554
  frame: h,
552
555
  source: Nt,
553
556
  video: c,
554
- brand: Xt
557
+ brand: Yt
555
558
  }
556
559
  ),
557
560
  h && t && $e && Re === "body" && /* @__PURE__ */ i(
@@ -583,7 +586,7 @@ function Dr({
583
586
  st,
584
587
  {
585
588
  role: "status",
586
- icon: /* @__PURE__ */ i(lr, { className: "h-5 w-5" }),
589
+ icon: /* @__PURE__ */ i(ur, { className: "h-5 w-5" }),
587
590
  tint: "bg-slate-200/70 text-slate-600 dark:bg-white/10 dark:text-muted-foreground",
588
591
  title: "This video is still being prepared.",
589
592
  body: "Try again in a few minutes.",
@@ -605,12 +608,12 @@ function Dr({
605
608
  st,
606
609
  {
607
610
  role: "alert",
608
- icon: /* @__PURE__ */ i(Lt, { className: "h-5 w-5" }),
611
+ icon: /* @__PURE__ */ i(Ft, { className: "h-5 w-5" }),
609
612
  tint: "bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-400",
610
613
  title: "This video didn’t load.",
611
614
  body: "The connection may have dropped, or its link expired. Retrying usually fixes it.",
612
615
  data: "error",
613
- action: /* @__PURE__ */ T(
616
+ action: /* @__PURE__ */ $(
614
617
  "button",
615
618
  {
616
619
  type: "button",
@@ -620,7 +623,7 @@ function Dr({
620
623
  "data-hv-retry": !0,
621
624
  children: [
622
625
  /* @__PURE__ */ i(
623
- cr,
626
+ dr,
624
627
  {
625
628
  className: `h-3.5 w-3.5 ${E ? "animate-spin motion-reduce:animate-none" : ""}`
626
629
  }
@@ -635,7 +638,7 @@ function Dr({
635
638
  st,
636
639
  {
637
640
  role: "status",
638
- icon: /* @__PURE__ */ i(Lt, { className: "h-5 w-5" }),
641
+ icon: /* @__PURE__ */ i(Ft, { className: "h-5 w-5" }),
639
642
  tint: "bg-slate-200/70 text-slate-600 dark:bg-white/10 dark:text-muted-foreground",
640
643
  title: "This recording is not available yet.",
641
644
  data: "unavailable"
@@ -644,8 +647,8 @@ function Dr({
644
647
  ]
645
648
  }
646
649
  ),
647
- I && /* @__PURE__ */ T("div", { className: "flex shrink-0 flex-col gap-0.5 border-t border-slate-200 px-2 pb-1.5 pt-1 dark:border-border", children: [
648
- /* @__PURE__ */ T("div", { className: "group relative flex h-5 items-center", children: [
650
+ I && /* @__PURE__ */ $("div", { className: "flex shrink-0 flex-col gap-0.5 border-t border-slate-200 px-2 pb-1.5 pt-1 dark:border-border", children: [
651
+ /* @__PURE__ */ $("div", { className: "group relative flex h-5 items-center", children: [
649
652
  /* @__PURE__ */ i(
650
653
  "input",
651
654
  {
@@ -665,17 +668,17 @@ function Dr({
665
668
  "div",
666
669
  {
667
670
  className: "absolute inset-y-0 left-0 bg-nvr-cyan-dark dark:bg-nvr-cyan",
668
- style: { width: `${Ct}%` }
671
+ style: { width: `${Mt}%` }
669
672
  }
670
673
  ) }),
671
674
  /* @__PURE__ */ i(
672
675
  "div",
673
676
  {
674
677
  className: "pointer-events-none absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full bg-nvr-cyan-dark ring-2 ring-slate-700 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-nvr-cyan-dark dark:bg-nvr-cyan dark:ring-card dark:peer-focus-visible:outline-nvr-cyan",
675
- style: { left: `${Ct}%` }
678
+ style: { left: `${Mt}%` }
676
679
  }
677
680
  ),
678
- sr.map((e) => /* @__PURE__ */ i(
681
+ ar.map((e) => /* @__PURE__ */ i(
679
682
  "button",
680
683
  {
681
684
  type: "button",
@@ -690,7 +693,7 @@ function Dr({
690
693
  e.id
691
694
  ))
692
695
  ] }),
693
- /* @__PURE__ */ T("div", { className: "flex items-center gap-1", children: [
696
+ /* @__PURE__ */ $("div", { className: "flex items-center gap-1", children: [
694
697
  /* @__PURE__ */ i(
695
698
  "button",
696
699
  {
@@ -699,38 +702,40 @@ function Dr({
699
702
  className: `${ve} ${Vt}`,
700
703
  onClick: ie,
701
704
  "data-hv-play": !0,
702
- children: O ? /* @__PURE__ */ i(ur, { className: "h-4 w-4 fill-current" }) : /* @__PURE__ */ i(Rt, { className: "h-4 w-4 fill-current" })
705
+ children: O ? /* @__PURE__ */ i(fr, { className: "h-4 w-4 fill-current" }) : /* @__PURE__ */ i(Rt, { className: "h-4 w-4 fill-current" })
703
706
  }
704
707
  ),
705
- /* @__PURE__ */ T("span", { className: "px-1 text-[12px] tabular-nums text-slate-600 dark:text-muted-foreground", children: [
708
+ /* @__PURE__ */ $("span", { className: "px-1 text-[12px] tabular-nums text-slate-600 dark:text-muted-foreground", children: [
706
709
  Oe(y),
707
710
  " / ",
708
711
  Oe(b)
709
712
  ] }),
710
713
  /* @__PURE__ */ i("span", { className: "flex-1" }),
711
- /* @__PURE__ */ i(Er, { value: q, onChange: Qt }),
712
- /* @__PURE__ */ i(
713
- "button",
714
- {
715
- type: "button",
716
- "aria-pressed": $e,
717
- "aria-label": "Captions",
718
- "data-tip": $e ? "Hide captions (C)" : "Show captions (C)",
719
- onClick: () => mt((e) => !e),
720
- className: `${ve} ${$e ? `bg-slate-100 dark:bg-white/10 ${Vt}` : Ve}`,
721
- children: /* @__PURE__ */ i(dr, { className: "h-4 w-4" })
722
- }
723
- ),
724
- /* @__PURE__ */ i(
725
- Vr,
726
- {
727
- style: gt,
728
- onChange: Gt,
729
- className: `${ve} ${Ve}`
730
- }
731
- ),
714
+ /* @__PURE__ */ i(Br, { value: q, onChange: Qt }),
715
+ Gt && /* @__PURE__ */ $(lr, { children: [
716
+ /* @__PURE__ */ i(
717
+ "button",
718
+ {
719
+ type: "button",
720
+ "aria-pressed": $e,
721
+ "aria-label": "Captions",
722
+ "data-tip": $e ? "Hide captions (C)" : "Show captions (C)",
723
+ onClick: () => mt((e) => !e),
724
+ className: `${ve} ${$e ? `bg-slate-100 dark:bg-white/10 ${Vt}` : Ve}`,
725
+ children: /* @__PURE__ */ i(hr, { className: "h-4 w-4" })
726
+ }
727
+ ),
728
+ /* @__PURE__ */ i(
729
+ Dr,
730
+ {
731
+ style: gt,
732
+ onChange: Jt,
733
+ className: `${ve} ${Ve}`
734
+ }
735
+ )
736
+ ] }),
732
737
  !ee && (c.download_urls || c.transcript_url) && /* @__PURE__ */ i(
733
- jr,
738
+ Er,
734
739
  {
735
740
  urls: c.download_urls,
736
741
  transcript: c.transcript_url,
@@ -748,7 +753,7 @@ function Dr({
748
753
  "data-tip": "Full screen (F)",
749
754
  onClick: vt,
750
755
  className: `${ve} ${Ve}`,
751
- children: /* @__PURE__ */ i(fr, { className: "h-4 w-4" })
756
+ children: /* @__PURE__ */ i(pr, { className: "h-4 w-4" })
752
757
  }
753
758
  )
754
759
  ] })
@@ -766,7 +771,7 @@ function st({
766
771
  action: se,
767
772
  data: J
768
773
  }) {
769
- return /* @__PURE__ */ T(
774
+ return /* @__PURE__ */ $(
770
775
  "div",
771
776
  {
772
777
  role: a,
@@ -784,8 +789,8 @@ function st({
784
789
  }
785
790
  );
786
791
  }
787
- function Er({ value: a, onChange: S }) {
788
- return /* @__PURE__ */ T(
792
+ function Br({ value: a, onChange: S }) {
793
+ return /* @__PURE__ */ $(
789
794
  "button",
790
795
  {
791
796
  type: "button",
@@ -802,5 +807,5 @@ function Er({ value: a, onChange: S }) {
802
807
  );
803
808
  }
804
809
  export {
805
- an as HelpVideoPlayer
810
+ ln as HelpVideoPlayer
806
811
  };