markdown-flow-ui 0.2.21 → 0.2.22-dev.1

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 (63) hide show
  1. package/dist/_virtual/index.es3.js +5 -4
  2. package/dist/_virtual/index.es3.js.map +1 -1
  3. package/dist/_virtual/index.es4.js +4 -5
  4. package/dist/_virtual/index.es4.js.map +1 -1
  5. package/dist/_virtual/index3.cjs +1 -1
  6. package/dist/_virtual/index4.cjs +1 -1
  7. package/dist/assets/markdown-flow-ui.css +1 -1
  8. package/dist/components/Slide/Player.cjs +1 -1
  9. package/dist/components/Slide/Player.cjs.map +1 -1
  10. package/dist/components/Slide/Player.d.ts +3 -1
  11. package/dist/components/Slide/Player.es.js +457 -488
  12. package/dist/components/Slide/Player.es.js.map +1 -1
  13. package/dist/components/Slide/Slide.cjs +1 -1
  14. package/dist/components/Slide/Slide.cjs.map +1 -1
  15. package/dist/components/Slide/Slide.es.js +593 -584
  16. package/dist/components/Slide/Slide.es.js.map +1 -1
  17. package/dist/components/Slide/slideI18n.cjs.map +1 -1
  18. package/dist/components/Slide/slideI18n.d.ts +1 -0
  19. package/dist/components/Slide/slideI18n.es.js.map +1 -1
  20. package/dist/components/Slide/utils/interactionPlayback.cjs +1 -1
  21. package/dist/components/Slide/utils/interactionPlayback.cjs.map +1 -1
  22. package/dist/components/Slide/utils/interactionPlayback.d.ts +2 -1
  23. package/dist/components/Slide/utils/interactionPlayback.es.js +8 -7
  24. package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -1
  25. package/dist/components/Slide/utils/playerCustomActions.cjs +1 -1
  26. package/dist/components/Slide/utils/playerCustomActions.cjs.map +1 -1
  27. package/dist/components/Slide/utils/playerCustomActions.d.ts +1 -1
  28. package/dist/components/Slide/utils/playerCustomActions.es.js +18 -14
  29. package/dist/components/Slide/utils/playerCustomActions.es.js.map +1 -1
  30. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs +1 -1
  31. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.map +1 -1
  32. package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +1 -1
  33. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +0 -2
  34. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
  35. package/dist/components/ui/inputGroup/textarea.cjs +1 -1
  36. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  37. package/dist/node_modules/cose-base/cose-base.cjs +1 -1
  38. package/dist/node_modules/cose-base/cose-base.cjs.map +1 -1
  39. package/dist/node_modules/cose-base/cose-base.es.js +1 -1
  40. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs +1 -1
  41. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.map +1 -1
  42. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
  43. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs +1 -1
  44. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.map +1 -1
  45. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
  46. package/dist/node_modules/layout-base/layout-base.cjs +1 -1
  47. package/dist/node_modules/layout-base/layout-base.cjs.map +1 -1
  48. package/dist/node_modules/layout-base/layout-base.es.js +1 -1
  49. package/dist/node_modules/rc-input/es/BaseInput.cjs +1 -1
  50. package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
  51. package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
  52. package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  53. package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
  54. package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  55. package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
  56. package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
  57. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
  58. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +1 -1
  59. package/package.json +1 -1
  60. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs +0 -7
  61. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.cjs.map +0 -1
  62. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js +0 -29
  63. package/dist/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js.map +0 -1
@@ -1,57 +1,56 @@
1
- import { jsxs as X, jsx as a, Fragment as cr } from "react/jsx-runtime";
2
- import or, { memo as fr, useId as dr, useContext as mr, useRef as o, useState as He, useMemo as re, useCallback as r, useEffect as S } from "react";
3
- import { getMarkdownFlowDirection as pr, getMarkdownFlowLanguage as hr } from "../../lib/locale.es.js";
4
- import { useDetachedLanguage as yr } from "../../lib/useDetachedLanguage.es.js";
5
- import { useResolvedDirection as br } from "../../lib/useResolvedDirection.es.js";
6
- import { cn as Ft } from "../../lib/utils.es.js";
7
- import Sr from "./MobilePlayerSettingsSheet.es.js";
8
- import { getSlidePlayerTexts as gr } from "./slideI18n.es.js";
9
- import { DEFAULT_MOBILE_VIEW_MODE as _r } from "./utils/mobileScreenMode.es.js";
10
- import { hasReachedAudioEnd as kr } from "./utils/audioCompletion.es.js";
11
- import { PlayerKeyboardShortcutContext as wr } from "./utils/playerKeyboardShortcutContext.es.js";
12
- import { activatePlayerKeyboardShortcutOwner as Mr, registerPlayerKeyboardShortcutOwner as Cr, isActivePlayerKeyboardShortcutOwner as Lr, getPlayerKeyboardShortcutAction as vr, shouldIgnorePlayerKeyboardShortcutEvent as Tr } from "./utils/playerKeyboardShortcuts.es.js";
13
- import { resolveAudioPlaybackSourceType as xr } from "./utils/playbackSource.es.js";
14
- import { shouldKeepPlayingAfterNavigation as Ar } from "./utils/playbackPreference.es.js";
15
- import { toPlayerCustomActionList as Nr } from "./utils/playerCustomActions.es.js";
16
- import { suppressPlayerControlsWakeAfterNavigation as $e } from "./utils/playerNavigationContext.es.js";
17
- import { isPlaybackTimeCoveredBySegments as Ut, resolveSegmentSeekTarget as Rr } from "./utils/segmentSeek.es.js";
18
- import { getSortedAudioSegments as Pt } from "./utils/audioSegments.es.js";
19
- import { getSubtitleCueJumpTarget as Er, shouldClearSubtitleCueJumpTarget as Kr } from "./utils/subtitleCue.es.js";
1
+ import { jsxs as Q, jsx as s, Fragment as Nt } from "react/jsx-runtime";
2
+ import ar, { memo as sr, useId as cr, useContext as ir, useRef as o, useState as Ve, useMemo as re, useCallback as r, useEffect as b } from "react";
3
+ import { getMarkdownFlowDirection as or, getMarkdownFlowLanguage as fr } from "../../lib/locale.es.js";
4
+ import { useDetachedLanguage as dr } from "../../lib/useDetachedLanguage.es.js";
5
+ import { useResolvedDirection as mr } from "../../lib/useResolvedDirection.es.js";
6
+ import { cn as pr } from "../../lib/utils.es.js";
7
+ import hr from "./MobilePlayerSettingsSheet.es.js";
8
+ import { getSlidePlayerTexts as yr } from "./slideI18n.es.js";
9
+ import { DEFAULT_MOBILE_VIEW_MODE as gr } from "./utils/mobileScreenMode.es.js";
10
+ import { hasReachedAudioEnd as br } from "./utils/audioCompletion.es.js";
11
+ import { PlayerKeyboardShortcutContext as Sr } from "./utils/playerKeyboardShortcutContext.es.js";
12
+ import { activatePlayerKeyboardShortcutOwner as _r, registerPlayerKeyboardShortcutOwner as kr, isActivePlayerKeyboardShortcutOwner as wr, getPlayerKeyboardShortcutAction as Mr, shouldIgnorePlayerKeyboardShortcutEvent as Tr } from "./utils/playerKeyboardShortcuts.es.js";
13
+ import { resolveAudioPlaybackSourceType as Cr } from "./utils/playbackSource.es.js";
14
+ import { shouldKeepPlayingAfterNavigation as vr } from "./utils/playbackPreference.es.js";
15
+ import { toPlayerCustomActionList as Lr } from "./utils/playerCustomActions.es.js";
16
+ import { suppressPlayerControlsWakeAfterNavigation as He } from "./utils/playerNavigationContext.es.js";
17
+ import { isPlaybackTimeCoveredBySegments as Et, resolveSegmentSeekTarget as xr } from "./utils/segmentSeek.es.js";
18
+ import { getSortedAudioSegments as Kt } from "./utils/audioSegments.es.js";
19
+ import { getSubtitleCueJumpTarget as Ar, shouldClearSubtitleCueJumpTarget as Rr } from "./utils/subtitleCue.es.js";
20
20
  /* empty css */
21
- import Fr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
22
- import Ur from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
23
- import Pr from "../../node_modules/lucide-react/dist/esm/icons/skip-back.es.js";
24
- import Wr from "../../node_modules/lucide-react/dist/esm/icons/skip-forward.es.js";
25
- import Br from "../../node_modules/lucide-react/dist/esm/icons/rewind.es.js";
26
- import Or from "../../node_modules/lucide-react/dist/esm/icons/fast-forward.es.js";
27
- import Vr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
28
- import Hr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
29
- import $r from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
30
- import Dr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
31
- import Jr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
32
- const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
33
- if (typeof window > "u" || !f || Wt.has(f))
21
+ import Nr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
22
+ import Er from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
23
+ import Kr from "../../node_modules/lucide-react/dist/esm/icons/skip-back.es.js";
24
+ import Ur from "../../node_modules/lucide-react/dist/esm/icons/skip-forward.es.js";
25
+ import Fr from "../../node_modules/lucide-react/dist/esm/icons/rewind.es.js";
26
+ import Pr from "../../node_modules/lucide-react/dist/esm/icons/fast-forward.es.js";
27
+ import Wr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
28
+ import Br from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
29
+ import Or from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
30
+ import Vr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
31
+ const Ut = /* @__PURE__ */ new Map(), Ft = (f) => {
32
+ if (typeof window > "u" || !f || Ut.has(f))
34
33
  return;
35
34
  const d = window.document.createElement("audio");
36
- d.preload = "auto", d.setAttribute("playsinline", "true"), d.src = f, d.load(), Wt.set(f, d);
37
- }, Zr = (f, d) => d !== null && d.audioList === f && d.subtitleCueLists.length === f.length && f.every((s, k) => {
38
- const w = s.element?.subtitle_cues;
35
+ d.preload = "auto", d.setAttribute("playsinline", "true"), d.src = f, d.load(), Ut.set(f, d);
36
+ }, Hr = (f, d) => d !== null && d.audioList === f && d.subtitleCueLists.length === f.length && f.every((a, k) => {
37
+ const w = a.element?.subtitle_cues;
39
38
  return d.subtitleCueLists[k] === w && d.subtitleCueLengths[k] === (w?.length ?? 0);
40
- }), jr = (f) => {
39
+ }), Ir = (f) => {
41
40
  const d = f.map(
42
- (s) => s.element?.subtitle_cues
41
+ (a) => a.element?.subtitle_cues
43
42
  );
44
43
  return {
45
44
  audioList: f,
46
45
  subtitleCueLists: d,
47
46
  subtitleCueLengths: d.map(
48
- (s) => s?.length ?? 0
47
+ (a) => a?.length ?? 0
49
48
  ),
50
- tracks: d.map((s) => ({
51
- subtitleCues: s ?? []
49
+ tracks: d.map((a) => ({
50
+ subtitleCues: a ?? []
52
51
  }))
53
52
  };
54
- }, zr = () => /* @__PURE__ */ X(
53
+ }, $r = () => /* @__PURE__ */ Q(
55
54
  "svg",
56
55
  {
57
56
  xmlns: "http://www.w3.org/2000/svg",
@@ -60,17 +59,17 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
60
59
  viewBox: "0 0 34 34",
61
60
  fill: "none",
62
61
  children: [
63
- /* @__PURE__ */ a(
62
+ /* @__PURE__ */ s(
64
63
  "path",
65
64
  {
66
65
  d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
67
66
  fill: "#0A0A0A"
68
67
  }
69
68
  ),
70
- /* @__PURE__ */ a("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
69
+ /* @__PURE__ */ s("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
71
70
  ]
72
71
  }
73
- ), Yr = () => /* @__PURE__ */ X(
72
+ ), Dr = () => /* @__PURE__ */ Q(
74
73
  "svg",
75
74
  {
76
75
  xmlns: "http://www.w3.org/2000/svg",
@@ -79,329 +78,324 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
79
78
  viewBox: "0 0 34 34",
80
79
  fill: "none",
81
80
  children: [
82
- /* @__PURE__ */ a(
81
+ /* @__PURE__ */ s(
83
82
  "path",
84
83
  {
85
84
  d: "M16.6667 33.3333C25.8714 33.3333 33.3333 25.8714 33.3333 16.6667C33.3333 7.46192 25.8714 0 16.6667 0C7.46192 0 0 7.46192 0 16.6667C0 25.8714 7.46192 33.3333 16.6667 33.3333Z",
86
85
  fill: "#0A0A0A"
87
86
  }
88
87
  ),
89
- /* @__PURE__ */ a("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
88
+ /* @__PURE__ */ s("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
90
89
  ]
91
90
  }
92
- ), V = {
91
+ ), $ = {
93
92
  fullscreen: "F",
94
93
  next: "→",
95
94
  nextSubtitle: "Shift+→",
96
- notes: "N",
97
95
  previous: "←",
98
96
  previousSubtitle: "Shift+←",
99
97
  subtitle: "C"
100
- }, Gr = 250, Qr = (f, d) => f ? `${f} (${d})` : d, Xr = ({
98
+ }, Jr = 250, Zr = (f, d) => f ? `${f} (${d})` : d, jr = ({
101
99
  audioList: f = [],
102
100
  className: d,
103
- currentAudioIndex: s = -1,
101
+ currentAudioIndex: a = -1,
104
102
  defaultPlaying: k = !0,
105
103
  isPlaybackPaused: w = !1,
106
- isAutoAdvanceEnabled: Z = !0,
104
+ isAutoAdvanceEnabled: D = !0,
107
105
  useAutoAdvanceToggle: P = !1,
108
- onLoadingChange: De,
109
- onPlaybackPreferenceChange: Je,
110
- onPlaybackStarted: Ze,
111
- onPlaybackTimeChange: fe,
106
+ onLoadingChange: Ie,
107
+ onPlaybackPreferenceChange: $e,
108
+ onPlaybackStarted: De,
109
+ onPlaybackTimeChange: oe,
112
110
  onSubtitleToggle: ne,
113
- onPrev: de,
114
- onNext: me,
115
- onSubtitleJump: pe,
116
- canJumpToSubtitleTarget: Ae,
111
+ onPrev: fe,
112
+ onNext: de,
113
+ onSubtitleJump: me,
114
+ canJumpToSubtitleTarget: xe,
117
115
  onFullscreen: ue,
118
- isFullscreen: je = !1,
119
- mobileViewMode: Ot = _r,
120
- settingsPortalContainer: Vt,
121
- onMobileViewModeChange: ze,
122
- onEnded: Ye,
123
- onAutoAdvanceToggle: Ge,
124
- onInteractionToggle: he,
125
- hasInteraction: Ne = !1,
126
- isInteractionOpen: le = !1,
127
- isSubtitleEnabled: Re = !0,
128
- prevDisabled: Ee = !1,
129
- nextDisabled: Ke = !1,
130
- showControls: Fe = !0,
131
- onControlsPointerEnter: Ht,
132
- onControlsPointerLeave: $t,
133
- enableKeyboardShortcuts: Dt = !0,
134
- subtitleSeekRequest: H = null,
135
- customActions: Qe,
136
- customActionContext: Xe,
137
- locale: ye,
138
- texts: qe,
139
- onFocusCapture: Ie,
140
- onPointerDown: et,
141
- ...Ue
116
+ isFullscreen: Je = !1,
117
+ mobileViewMode: Pt = gr,
118
+ settingsPortalContainer: Wt,
119
+ onMobileViewModeChange: Ze,
120
+ onEnded: je,
121
+ onAutoAdvanceToggle: ze,
122
+ onInteractionToggle: Yr,
123
+ hasInteraction: Gr,
124
+ isInteractionOpen: pe = !1,
125
+ isSubtitleEnabled: Ae = !0,
126
+ prevDisabled: Re = !1,
127
+ nextDisabled: Ne = !1,
128
+ showControls: Ee = !0,
129
+ onControlsPointerEnter: Bt,
130
+ onControlsPointerLeave: Ot,
131
+ enableKeyboardShortcuts: Vt = !0,
132
+ subtitleSeekRequest: V = null,
133
+ customActions: Ye,
134
+ customActionContext: Ge,
135
+ locale: he,
136
+ texts: Qe,
137
+ onFocusCapture: Xe,
138
+ onPointerDown: qe,
139
+ ...Ke
142
140
  }) => {
143
- const Pe = Ue.dir ?? pr(ye), tt = Ue.lang ?? hr(ye), Jt = dr(), rt = mr(wr), g = o(null), { resolvedDirection: nt, readDirection: ut } = br(g, Pe), be = nt === "rtl", Zt = yr(g, tt), lt = o(le), K = o(null), at = o(null), F = o(0), m = o(null), Se = o(void 0), N = o([]), ae = o(
144
- P ? Z : k
145
- ), se = o(!1), st = o(!1), M = o(!1), U = o(null), j = o(null), x = o(!1), c = o(!1), C = o(null), R = o(!1), z = o(null), ge = o(0), it = o(() => {
146
- }), _e = o(null), ie = o(null), ct = o(null), ot = o(null), W = o("unknown"), [ke, h] = He(k), [ft, q] = He(!1), [I, jt] = He({
141
+ const Ue = Ke.dir ?? or(he), et = Ke.lang ?? fr(he), Ht = cr(), tt = ir(Sr), S = o(null), { resolvedDirection: rt, readDirection: nt } = mr(S, Ue), ye = rt === "rtl", It = dr(S, et), ut = o(pe), K = o(null), lt = o(null), U = o(0), m = o(null), ge = o(void 0), R = o([]), le = o(
142
+ P ? D : k
143
+ ), ae = o(!1), at = o(!1), M = o(!1), F = o(null), J = o(null), x = o(!1), c = o(!1), T = o(null), N = o(!1), Z = o(null), be = o(0), st = o(() => {
144
+ }), Se = o(null), se = o(null), ct = o(null), it = o(null), W = o("unknown"), [_e, h] = Ve(k), [ot, X] = Ve(!1), [q, $t] = Ve({
147
145
  next: !1,
148
146
  previous: !1
149
- }), Y = rt?.ownerId ?? Jt, B = Dt && (rt?.enabled ?? !0), p = s >= 0 ? f[s] : void 0, v = p?.audioUrl, dt = p?.audioSegments, zt = dt?.length ?? 0, E = re(
150
- () => Pt(p),
151
- [p, zt, dt]
147
+ }), j = tt?.ownerId ?? Ht, B = Vt && (tt?.enabled ?? !0), p = a >= 0 ? f[a] : void 0, v = p?.audioUrl, ft = p?.audioSegments, Dt = ft?.length ?? 0, E = re(
148
+ () => Kt(p),
149
+ [p, Dt, ft]
152
150
  );
153
- let we = ot.current;
154
- Zr(f, we) || (we = jr(f), ot.current = we);
155
- const mt = we.tracks, pt = re(
156
- () => Nr(Qe, Xe),
157
- [Xe, Qe]
158
- ), ht = pt.length + 7, Yt = re(
151
+ let ke = it.current;
152
+ Hr(f, ke) || (ke = Ir(f), it.current = ke);
153
+ const dt = ke.tracks, Fe = re(
154
+ () => Lr(Ye, Ge),
155
+ [Ge, Ye]
156
+ ), mt = Fe.length + 6, Jt = re(
159
157
  () => ({
160
- "--slide-player-mobile-control-count": String(ht)
158
+ "--slide-player-mobile-control-count": String(mt)
161
159
  }),
162
- [ht]
160
+ [mt]
163
161
  ), i = re(
164
162
  () => ({
165
- ...gr(ye),
166
- ...qe
163
+ ...yr(he),
164
+ ...Qe
167
165
  }),
168
- [ye, qe]
169
- ), We = re(() => p ? p.audioKey ?? `${String(p.sequenceNumber ?? "none")}:${String(p.audioUrl ?? "")}` : "none", [p]), Gt = P ? Z : ke, yt = P ? Z ? i.pauseAutoplayLabel : i.playAutoplayLabel : ke ? i.pauseLabel : i.playLabel, bt = je ? i.exitFullscreenLabel : i.enterFullscreenLabel, $ = r(
166
+ [he, Qe]
167
+ ), Pe = re(() => p ? p.audioKey ?? `${String(p.sequenceNumber ?? "none")}:${String(p.audioUrl ?? "")}` : "none", [p]), Zt = P ? D : _e, pt = P ? D ? i.pauseAutoplayLabel : i.playAutoplayLabel : _e ? i.pauseLabel : i.playLabel, ht = Je ? i.exitFullscreenLabel : i.enterFullscreenLabel, z = r(
170
168
  (e, t, u) => ({
171
169
  ariaKeyShortcuts: B ? u : void 0,
172
- title: B ? Qr(e, t) : e
170
+ title: B ? Zr(e, t) : e
173
171
  }),
174
172
  [B]
175
- ), St = $(
173
+ ), yt = z(
176
174
  i.subtitleToggleAriaLabel,
177
- V.subtitle,
175
+ $.subtitle,
178
176
  "c"
179
- ), gt = $(
177
+ ), gt = z(
180
178
  i.previousLabel,
181
- be ? V.next : V.previous,
182
- be ? "ArrowRight" : "ArrowLeft"
183
- ), _t = $(
179
+ ye ? $.next : $.previous,
180
+ ye ? "ArrowRight" : "ArrowLeft"
181
+ ), bt = z(
184
182
  i.previousSubtitleLabel,
185
- V.previousSubtitle,
183
+ $.previousSubtitle,
186
184
  "Shift+ArrowLeft"
187
- ), kt = $(
188
- yt,
185
+ ), St = z(
186
+ pt,
189
187
  i.playbackShortcutLabel,
190
188
  "Space"
191
- ), wt = $(
189
+ ), _t = z(
192
190
  i.nextLabel,
193
- be ? V.previous : V.next,
194
- be ? "ArrowLeft" : "ArrowRight"
195
- ), Mt = $(
191
+ ye ? $.previous : $.next,
192
+ ye ? "ArrowLeft" : "ArrowRight"
193
+ ), kt = z(
196
194
  i.nextSubtitleLabel,
197
- V.nextSubtitle,
195
+ $.nextSubtitle,
198
196
  "Shift+ArrowRight"
199
- ), Ct = $(
200
- bt,
201
- V.fullscreen,
197
+ ), wt = z(
198
+ ht,
199
+ $.fullscreen,
202
200
  "f"
203
- ), Lt = $(
204
- i.notesLabel,
205
- V.notes,
206
- "n"
207
- ), Me = r(() => {
208
- B && Mr(Y);
209
- }, [Y, B]), Qt = r(
201
+ ), we = r(() => {
202
+ B && _r(j);
203
+ }, [j, B]), jt = r(
210
204
  (e) => {
211
- Me(), et?.(e);
205
+ we(), qe?.(e);
212
206
  },
213
- [Me, et]
214
- ), Xt = r(
207
+ [we, qe]
208
+ ), zt = r(
215
209
  (e) => {
216
- Me(), Ie?.(e);
210
+ we(), Xe?.(e);
217
211
  },
218
- [Me, Ie]
212
+ [we, Xe]
219
213
  );
220
- S(() => {
221
- Se.current = p;
222
- }, [p]), S(() => {
223
- ae.current = P ? Z : k;
224
- }, [k, Z, P]), S(() => {
225
- Fe || q(!1);
226
- }, [Fe]), S(() => {
227
- !lt.current && le && q(!1), lt.current = le;
228
- }, [le]), S(() => {
229
- N.current = E;
230
- }, [E]), S(() => {
231
- const e = p?.audioUrl, t = s >= 0 ? f[s + 1]?.audioUrl : void 0;
232
- Bt(e), Bt(t);
233
- }, [f, p?.audioUrl, s]);
214
+ b(() => {
215
+ ge.current = p;
216
+ }, [p]), b(() => {
217
+ le.current = P ? D : k;
218
+ }, [k, D, P]), b(() => {
219
+ Ee || X(!1);
220
+ }, [Ee]), b(() => {
221
+ !ut.current && pe && X(!1), ut.current = pe;
222
+ }, [pe]), b(() => {
223
+ R.current = E;
224
+ }, [E]), b(() => {
225
+ const e = p?.audioUrl, t = a >= 0 ? f[a + 1]?.audioUrl : void 0;
226
+ Ft(e), Ft(t);
227
+ }, [f, p?.audioUrl, a]);
234
228
  const l = r(
235
229
  (e, t = null) => {
236
- st.current === e && (!e || t === null) || (st.current = e, De?.({
230
+ at.current === e && (!e || t === null) || (at.current = e, Ie?.({
237
231
  loading: e,
238
232
  reason: e ? t : null
239
233
  }));
240
234
  },
241
- [De]
235
+ [Ie]
242
236
  ), O = r(
243
237
  (e) => {
244
- ae.current = e, Je?.(e);
238
+ le.current = e, $e?.(e);
245
239
  },
246
- [Je]
247
- ), G = r(() => P ? {
248
- shouldContinuePlayback: ae.current
240
+ [$e]
241
+ ), Y = r(() => P ? {
242
+ shouldContinuePlayback: le.current
249
243
  } : {
250
- shouldContinuePlayback: Ar({
251
- defaultPlaying: ae.current,
244
+ shouldContinuePlayback: vr({
245
+ defaultPlaying: le.current,
252
246
  isPausedByUser: M.current
253
247
  })
254
- }, [P]), vt = r((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), D = r(() => k && !w && !M.current && W.current !== "blocked", [k, w]), Tt = r((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), xt = r(() => {
248
+ }, [P]), Mt = r((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), H = r(() => k && !w && !M.current && W.current !== "blocked", [k, w]), Tt = r((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Ct = r(() => {
255
249
  const e = m.current;
256
- return e == null || e <= 0 ? 0 : N.current.slice(0, e).reduce(
250
+ return e == null || e <= 0 ? 0 : R.current.slice(0, e).reduce(
257
251
  (t, u) => t + Math.max(Number(u.duration_ms ?? 0), 0),
258
252
  0
259
253
  ) / 1e3;
260
- }, []), Q = r((e) => e <= 0 ? 0 : N.current.slice(0, e).reduce(
254
+ }, []), G = r((e) => e <= 0 ? 0 : R.current.slice(0, e).reduce(
261
255
  (t, u) => t + Math.max(Number(u.duration_ms ?? 0), 0),
262
256
  0
263
- ), []), Ce = r(
264
- (e, t) => !e || w ? !1 : e.audioUrl ? !0 : Ut(
265
- Pt(e),
257
+ ), []), Me = r(
258
+ (e, t) => !e || w ? !1 : e.audioUrl ? !0 : Et(
259
+ Kt(e),
266
260
  t
267
261
  ),
268
262
  [w]
269
263
  ), ce = r(
270
264
  (e, t, u = {}) => {
271
- const n = Er({
272
- currentAudioIndex: s,
265
+ const n = Ar({
266
+ currentAudioIndex: a,
273
267
  currentTimeMs: t,
274
268
  direction: e,
275
269
  excludeTarget: u.excludeTarget,
276
- tracks: mt
270
+ tracks: dt
277
271
  });
278
- return !n || !Ce(
272
+ return !n || !Me(
279
273
  f[n.audioIndex],
280
274
  n.timeMs
281
- ) || n.audioIndex !== s && (!pe || Ae && !Ae(n)) ? null : n;
275
+ ) || n.audioIndex !== a && (!me || xe && !xe(n)) ? null : n;
282
276
  },
283
277
  [
284
278
  f,
285
- Ae,
286
- Ce,
287
- s,
288
- pe,
289
- mt
279
+ xe,
280
+ Me,
281
+ a,
282
+ me,
283
+ dt
290
284
  ]
291
- ), Be = r(
285
+ ), We = r(
292
286
  (e, t = !1) => {
293
287
  const u = Math.max(Number(e), 0);
294
- if (!t && _e.current !== null && Math.abs(
295
- u - _e.current
296
- ) < Gr)
288
+ if (!t && Se.current !== null && Math.abs(
289
+ u - Se.current
290
+ ) < Jr)
297
291
  return;
298
- _e.current = u;
292
+ Se.current = u;
299
293
  const n = {
300
294
  previous: ce("previous", u) !== null,
301
295
  next: ce("next", u) !== null
302
296
  };
303
- jt((b) => b.previous === n.previous && b.next === n.next ? b : n);
297
+ $t((g) => g.previous === n.previous && g.next === n.next ? g : n);
304
298
  },
305
299
  [ce]
306
300
  );
307
- S(() => {
308
- it.current = Be, Be(ge.current, !0);
309
- }, [Be]);
310
- const Le = r(() => {
311
- const e = g.current;
312
- return e ? U.current === "segment" ? Q(F.current) + Math.max(e.currentTime, 0) * 1e3 : C.current !== null && e.readyState === 0 ? C.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : m.current != null ? Q(m.current) : 0;
313
- }, [Q]), L = r(
301
+ b(() => {
302
+ st.current = We, We(be.current, !0);
303
+ }, [We]);
304
+ const Te = r(() => {
305
+ const e = S.current;
306
+ return e ? F.current === "segment" ? G(U.current) + Math.max(e.currentTime, 0) * 1e3 : T.current !== null && e.readyState === 0 ? T.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : m.current != null ? G(m.current) : 0;
307
+ }, [G]), C = r(
314
308
  (e) => {
315
309
  const t = Math.max(e, 0);
316
- ge.current !== t && (ge.current = t, Kr({
317
- currentAudioIndex: s,
310
+ be.current !== t && (be.current = t, Rr({
311
+ currentAudioIndex: a,
318
312
  currentTimeMs: t,
319
- target: ie.current
320
- }) && (ie.current = null), fe?.(t), it.current(t));
313
+ target: se.current
314
+ }) && (se.current = null), oe?.(t), st.current(t));
321
315
  },
322
- [s, fe]
316
+ [a, oe]
323
317
  ), y = r(() => {
324
- L(Le());
325
- }, [Le, L]), _ = r(() => {
326
- typeof window > "u" || z.current === null || (window.cancelAnimationFrame(z.current), z.current = null);
327
- }, []), At = r(() => {
328
- if (typeof window > "u" || z.current !== null)
318
+ C(Te());
319
+ }, [Te, C]), _ = r(() => {
320
+ typeof window > "u" || Z.current === null || (window.cancelAnimationFrame(Z.current), Z.current = null);
321
+ }, []), vt = r(() => {
322
+ if (typeof window > "u" || Z.current !== null)
329
323
  return;
330
324
  const e = () => {
331
325
  y();
332
- const t = g.current;
326
+ const t = S.current;
333
327
  if (!t || t.paused || t.ended) {
334
- z.current = null;
328
+ Z.current = null;
335
329
  return;
336
330
  }
337
- z.current = window.requestAnimationFrame(e);
331
+ Z.current = window.requestAnimationFrame(e);
338
332
  };
339
- z.current = window.requestAnimationFrame(e);
333
+ Z.current = window.requestAnimationFrame(e);
340
334
  }, [y]), ee = r(() => {
341
- const e = g.current;
342
- e && (_(), c.current = !1, M.current = !1, se.current = !1, U.current = null, C.current = null, x.current = !1, R.current = !1, j.current = null, e.pause(), e.removeAttribute("src"), e.load(), K.current = null, F.current = 0, m.current = null, L(0), h(!1), l(!1));
343
- }, [L, _, l]), T = r(
335
+ const e = S.current;
336
+ e && (_(), c.current = !1, M.current = !1, ae.current = !1, F.current = null, T.current = null, x.current = !1, N.current = !1, J.current = null, e.pause(), e.removeAttribute("src"), e.load(), K.current = null, U.current = 0, m.current = null, C(0), h(!1), l(!1));
337
+ }, [C, _, l]), L = r(
344
338
  (e) => {
345
- const t = g.current;
339
+ const t = S.current;
346
340
  if (!t)
347
341
  return !1;
348
342
  const u = t.play();
349
343
  return u && typeof u.then == "function" && u.then(() => {
350
- W.current === "unknown" && (W.current = "auto"), c.current = !1, R.current = !1;
344
+ W.current === "unknown" && (W.current = "auto"), c.current = !1, N.current = !1;
351
345
  }).catch((n) => {
352
- W.current === "unknown" && vt(n) && (W.current = "blocked", c.current = !1, l(!1)), R.current = !1, h(!1);
346
+ W.current === "unknown" && Mt(n) && (W.current = "blocked", c.current = !1, l(!1)), N.current = !1, h(!1);
353
347
  }), !0;
354
348
  },
355
- [vt, l]
349
+ [Mt, l]
356
350
  ), A = r(
357
351
  (e, t, u = {}) => {
358
- const n = g.current, b = N.current[e];
359
- if (!n || !b)
352
+ const n = S.current, g = R.current[e];
353
+ if (!n || !g)
360
354
  return !1;
361
- const J = Tt(b.audio_data), xe = Math.max(
355
+ const I = Tt(g.audio_data), Le = Math.max(
362
356
  Number(u.seekTimeSeconds ?? 0),
363
357
  0
364
358
  );
365
- F.current = e, m.current = null, x.current = !1, R.current = !0, j.current = "segment", L(
366
- Q(e) + xe * 1e3
359
+ U.current = e, m.current = null, x.current = !1, N.current = !0, J.current = "segment", C(
360
+ G(e) + Le * 1e3
367
361
  );
368
- const Kt = u.shouldResume ?? D();
369
- c.current = Kt, l(!1);
370
- const ir = K.current !== J;
371
- return U.current = "segment", ir && (n.pause(), n.removeAttribute("src"), n.load(), K.current = J, n.src = J, n.load()), C.current = xe, n.readyState > 0 && (n.currentTime = xe, C.current = null), Kt ? T(`start-segment:${t}`) : (c.current = !1, R.current = !1, n.pause(), h(!1), !0);
362
+ const Rt = u.shouldResume ?? H();
363
+ c.current = Rt, l(!1);
364
+ const lr = K.current !== I;
365
+ return F.current = "segment", lr && (n.pause(), n.removeAttribute("src"), n.load(), K.current = I, n.src = I, n.load()), T.current = Le, n.readyState > 0 && (n.currentTime = Le, T.current = null), Rt ? L(`start-segment:${t}`) : (c.current = !1, N.current = !1, n.pause(), h(!1), !0);
372
366
  },
373
367
  [
374
- D,
368
+ H,
375
369
  Tt,
376
- Q,
370
+ G,
371
+ C,
377
372
  L,
378
- T,
379
373
  l
380
374
  ]
381
- ), ve = r(
375
+ ), Ce = r(
382
376
  (e) => {
383
- const t = g.current;
377
+ const t = S.current;
384
378
  if (!t || !p || w)
385
379
  return !1;
386
- const u = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || R.current || m.current !== null && ae.current && !M.current, b = Ut(
387
- N.current,
380
+ const u = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || N.current || m.current !== null && le.current && !M.current, g = Et(
381
+ R.current,
388
382
  u
389
- ) ? Rr(
390
- N.current,
383
+ ) ? xr(
384
+ R.current,
391
385
  u
392
386
  ) : null;
393
- if (_e.current = null, _(), c.current = n, l(!1), n && (W.current = "manual", M.current = !1, O(!0)), b && (U.current === "segment" || !v))
387
+ if (Se.current = null, _(), c.current = n, l(!1), n && (W.current = "manual", M.current = !1, O(!0)), g && (F.current === "segment" || !v))
394
388
  return A(
395
- b.segmentIndex,
389
+ g.segmentIndex,
396
390
  "subtitle-seek-segment",
397
391
  {
398
- seekTimeSeconds: b.segmentTimeSeconds,
392
+ seekTimeSeconds: g.segmentTimeSeconds,
399
393
  shouldResume: n
400
394
  }
401
395
  );
402
396
  if (v) {
403
- const J = u / 1e3;
404
- return K.current !== v && (t.pause(), t.removeAttribute("src"), t.load(), K.current = v, U.current = "url", j.current = "url", t.src = v, t.load()), C.current = J, L(u), t.readyState > 0 && (t.currentTime = J, C.current = null), n ? T("subtitle-seek-url") : (c.current = !1, t.pause(), h(!1), !0);
397
+ const I = u / 1e3;
398
+ return K.current !== v && (t.pause(), t.removeAttribute("src"), t.load(), K.current = v, F.current = "url", J.current = "url", t.src = v, t.load()), T.current = I, C(u), t.readyState > 0 && (t.currentTime = I, T.current = null), n ? L("subtitle-seek-url") : (c.current = !1, t.pause(), h(!1), !0);
405
399
  }
406
400
  return !1;
407
401
  },
@@ -409,131 +403,131 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
409
403
  p,
410
404
  v,
411
405
  w,
412
- L,
406
+ C,
413
407
  A,
414
408
  _,
415
- T,
409
+ L,
416
410
  l,
417
411
  O
418
412
  ]
419
- ), oe = r(
413
+ ), ie = r(
420
414
  (e) => {
421
415
  const t = ce(
422
416
  e,
423
- Le(),
417
+ Te(),
424
418
  {
425
- excludeTarget: e === "previous" ? ie.current : null
419
+ excludeTarget: e === "previous" ? se.current : null
426
420
  }
427
421
  );
428
422
  if (t === null)
429
423
  return !1;
430
- if (t.audioIndex === s) {
431
- const n = ve(t.timeMs);
432
- return n && (ie.current = t), n;
424
+ if (t.audioIndex === a) {
425
+ const n = Ce(t.timeMs);
426
+ return n && (se.current = t), n;
433
427
  }
434
- const u = !!pe?.(
428
+ const u = !!me?.(
435
429
  t,
436
- $e(G())
430
+ He(Y())
437
431
  );
438
- return u && (ie.current = t), u;
432
+ return u && (se.current = t), u;
439
433
  },
440
434
  [
441
- s,
442
- Le,
443
- G,
435
+ a,
436
+ Te,
437
+ Y,
444
438
  ce,
445
- pe,
446
- ve
439
+ me,
440
+ Ce
447
441
  ]
448
442
  ), te = r(
449
443
  (e) => {
450
- _(), c.current = !1, x.current = !1, R.current = !1, y(), h(!1), l(!1), s >= 0 && Ye?.(s);
444
+ _(), c.current = !1, x.current = !1, N.current = !1, y(), h(!1), l(!1), a >= 0 && je?.(a);
451
445
  },
452
446
  [
453
- s,
454
- Ye,
447
+ a,
448
+ je,
455
449
  _,
456
450
  y,
457
451
  l
458
452
  ]
459
- ), Te = r(
453
+ ), ve = r(
460
454
  (e) => {
461
- const t = g.current;
462
- return !t || U.current !== "url" || !kr({
455
+ const t = S.current;
456
+ return !t || F.current !== "url" || !br({
463
457
  currentTimeSeconds: Math.max(t.currentTime, 0),
464
458
  durationSeconds: t.duration
465
459
  }) ? !1 : (c.current = !1, t.pause(), te(e), !0);
466
460
  },
467
461
  [te]
468
- ), Nt = r(() => {
469
- const e = F.current + 1, t = N.current, u = t[e], n = Se.current, b = t.some((J) => J.is_final);
462
+ ), Lt = r(() => {
463
+ const e = U.current + 1, t = R.current, u = t[e], n = ge.current, g = t.some((I) => I.is_final);
470
464
  if (u) {
471
465
  A(e, "ended");
472
466
  return;
473
467
  }
474
- if (n?.isAudioStreaming || !b) {
475
- F.current = e, m.current = e, x.current = !0, c.current = k, L(Q(e)), h(!1), l(!0, "waitingForMoreAudio");
468
+ if (n?.isAudioStreaming || !g) {
469
+ U.current = e, m.current = e, x.current = !0, c.current = k, C(G(e)), h(!1), l(!0, "waitingForMoreAudio");
476
470
  return;
477
471
  }
478
472
  te("segments-completed");
479
473
  }, [
480
474
  k,
481
475
  te,
482
- Q,
483
- L,
476
+ G,
477
+ C,
484
478
  A,
485
479
  l
486
480
  ]);
487
- S(() => {
488
- if (at.current === We)
481
+ b(() => {
482
+ if (lt.current === Pe)
489
483
  return;
490
- at.current = We, F.current = 0, m.current = null, x.current = !1, M.current = !1, se.current = !1, c.current = !1, R.current = !1, U.current = null, j.current = null, K.current = null, _(), L(0), l(!1);
491
- const e = g.current;
484
+ lt.current = Pe, U.current = 0, m.current = null, x.current = !1, M.current = !1, ae.current = !1, c.current = !1, N.current = !1, F.current = null, J.current = null, K.current = null, _(), C(0), l(!1);
485
+ const e = S.current;
492
486
  e && (e.pause(), e.removeAttribute("src"), e.load(), h(!1));
493
487
  }, [
494
- s,
495
- We,
488
+ a,
489
+ Pe,
496
490
  E.length,
497
491
  v,
498
- L,
492
+ C,
499
493
  _,
500
494
  l
501
- ]), S(() => {
502
- const e = g.current;
495
+ ]), b(() => {
496
+ const e = S.current;
503
497
  if (e) {
504
498
  if (w) {
505
- se.current = !!(Se.current && !M.current && (!e.paused || c.current || m.current !== null)), c.current = !1, l(!1), e.pause(), h(!1);
499
+ ae.current = !!(ge.current && !M.current && (!e.paused || c.current || m.current !== null)), c.current = !1, l(!1), e.pause(), h(!1);
506
500
  return;
507
501
  }
508
- if (!(!se.current || !Se.current || M.current)) {
509
- if (se.current = !1, m.current !== null) {
510
- if (m.current < N.current.length) {
502
+ if (!(!ae.current || !ge.current || M.current)) {
503
+ if (ae.current = !1, m.current !== null) {
504
+ if (m.current < R.current.length) {
511
505
  A(m.current, "external-resume");
512
506
  return;
513
507
  }
514
508
  c.current = !0, l(!0, "waitingForMoreAudio");
515
509
  return;
516
510
  }
517
- if (!K.current && N.current.length > 0) {
511
+ if (!K.current && R.current.length > 0) {
518
512
  A(
519
513
  Math.min(
520
- F.current,
521
- N.current.length - 1
514
+ U.current,
515
+ R.current.length - 1
522
516
  ),
523
517
  "external-resume-init"
524
518
  );
525
519
  return;
526
520
  }
527
- e.paused && (c.current = !0, T("external-resume"));
521
+ e.paused && (c.current = !0, L("external-resume"));
528
522
  }
529
523
  }
530
524
  }, [
531
525
  w,
532
526
  A,
533
- T,
527
+ L,
534
528
  l
535
- ]), S(() => {
536
- const e = g.current;
529
+ ]), b(() => {
530
+ const e = S.current;
537
531
  if (!e)
538
532
  return;
539
533
  if (!p) {
@@ -544,24 +538,24 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
544
538
  c.current = !1, l(!1), e.pause(), h(!1);
545
539
  return;
546
540
  }
547
- const t = xr({
548
- activeSourceType: U.current,
541
+ const t = Cr({
542
+ activeSourceType: F.current,
549
543
  hasAudioUrl: !!v,
550
544
  segmentCount: E.length,
551
- preferredSourceType: j.current,
545
+ preferredSourceType: J.current,
552
546
  waitingSegmentIndex: m.current
553
547
  });
554
- if (t && j.current !== t && (j.current = t), t === "url" && v) {
555
- const u = K.current !== v, n = D();
548
+ if (t && J.current !== t && (J.current = t), t === "url" && v) {
549
+ const u = K.current !== v, n = H();
556
550
  if (u) {
557
- const b = m.current !== null ? xt() : 0;
558
- e.pause(), e.removeAttribute("src"), e.load(), K.current = v, U.current = "url", e.src = v, e.load(), C.current = b, L(b * 1e3), e.readyState > 0 && (e.currentTime = b, C.current = null);
551
+ const g = m.current !== null ? Ct() : 0;
552
+ e.pause(), e.removeAttribute("src"), e.load(), K.current = v, F.current = "url", e.src = v, e.load(), T.current = g, C(g * 1e3), e.readyState > 0 && (e.currentTime = g, T.current = null);
559
553
  }
560
- if (c.current = n, x.current = !1, R.current = !1, l(!1), !n) {
554
+ if (c.current = n, x.current = !1, N.current = !1, l(!1), !n) {
561
555
  c.current = !1, e.pause(), h(!1);
562
556
  return;
563
557
  }
564
- T(u ? "sync-url-init" : "sync-url");
558
+ L(u ? "sync-url-init" : "sync-url");
565
559
  return;
566
560
  }
567
561
  if (t === "segment" && m.current !== null) {
@@ -573,12 +567,12 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
573
567
  A(m.current, "wait-resume");
574
568
  return;
575
569
  }
576
- x.current = !0, c.current = D(), h(!1), l(D());
570
+ x.current = !0, c.current = H(), h(!1), l(H());
577
571
  return;
578
572
  }
579
573
  if (t === "segment" && !E.length) {
580
574
  if (p.isAudioStreaming) {
581
- m.current = F.current, x.current = !0, c.current = D(), h(!1), l(D());
575
+ m.current = U.current, x.current = !0, c.current = H(), h(!1), l(H());
582
576
  return;
583
577
  }
584
578
  ee();
@@ -587,7 +581,7 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
587
581
  if (t === "segment" && !K.current) {
588
582
  A(
589
583
  Math.min(
590
- F.current,
584
+ U.current,
591
585
  E.length - 1
592
586
  ),
593
587
  "effect-init"
@@ -602,198 +596,195 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
602
596
  c.current = !1, e.pause(), h(!1);
603
597
  return;
604
598
  }
605
- e.paused && (c.current = !0, T("sync-paused-retry"));
599
+ e.paused && (c.current = !0, L("sync-paused-retry"));
606
600
  }, [
607
601
  p,
608
- s,
602
+ a,
609
603
  E,
610
604
  v,
611
605
  k,
612
606
  w,
613
- D,
614
- L,
607
+ H,
608
+ C,
615
609
  ee,
616
610
  A,
617
- T,
618
- xt,
611
+ L,
612
+ Ct,
619
613
  l
620
- ]), S(() => {
621
- if (!H || H.id === ct.current || H.audioIndex !== s)
614
+ ]), b(() => {
615
+ if (!V || V.id === ct.current || V.audioIndex !== a)
622
616
  return;
623
- const e = f[H.audioIndex];
624
- Ce(e, H.timeMs) && (ct.current = H.id, ve(H.timeMs));
617
+ const e = f[V.audioIndex];
618
+ Me(e, V.timeMs) && (ct.current = V.id, Ce(V.timeMs));
625
619
  }, [
626
620
  f,
621
+ Me,
622
+ a,
627
623
  Ce,
628
- s,
629
- ve,
630
- H
631
- ]), S(() => ee, [ee]), S(() => _, [_]);
632
- const qt = r(() => {
633
- y(), At(), h(!0), l(!1), Ze?.();
624
+ V
625
+ ]), b(() => ee, [ee]), b(() => _, [_]);
626
+ const Yt = r(() => {
627
+ y(), vt(), h(!0), l(!1), De?.();
634
628
  }, [
635
- Ze,
636
- At,
629
+ De,
630
+ vt,
637
631
  y,
638
632
  l
639
- ]), It = r(() => {
640
- x.current || R.current || (_(), y(), h(!1));
641
- }, [s, _, y]), er = r(() => {
642
- const e = g.current;
643
- e && C.current !== null && (e.currentTime = C.current, C.current = null), y(), !Te("canplay-seek-finished") && (!c.current || !k || T("canplay"));
633
+ ]), Gt = r(() => {
634
+ x.current || N.current || (_(), y(), h(!1));
635
+ }, [a, _, y]), Qt = r(() => {
636
+ const e = S.current;
637
+ e && T.current !== null && (e.currentTime = T.current, T.current = null), y(), !ve("canplay-seek-finished") && (!c.current || !k || L("canplay"));
644
638
  }, [
645
- s,
639
+ a,
646
640
  k,
647
- Te,
641
+ ve,
648
642
  y,
649
- T
650
- ]), tr = r(() => {
651
- const e = g.current;
652
- e && C.current !== null && (e.currentTime = C.current, C.current = null), y(), Te("metadata-seek-finished");
653
- }, [s, Te, y]), rr = r(() => {
643
+ L
644
+ ]), Xt = r(() => {
645
+ const e = S.current;
646
+ e && T.current !== null && (e.currentTime = T.current, T.current = null), y(), ve("metadata-seek-finished");
647
+ }, [a, ve, y]), qt = r(() => {
654
648
  y();
655
- }, [y]), nr = r(() => {
649
+ }, [y]), er = r(() => {
656
650
  x.current || l(!0, "loadingAudio");
657
- }, [l]), ur = r(() => {
651
+ }, [l]), tr = r(() => {
658
652
  if (x.current) {
659
653
  l(!0, "waitingForMoreAudio");
660
654
  return;
661
655
  }
662
656
  l(!0, "loadingAudio");
663
- }, [l]), Rt = r(() => {
657
+ }, [l]), xt = r(() => {
664
658
  y();
665
- }, [y]), lr = r(() => {
666
- const e = U.current === "url" || N.current.length === 0;
667
- if (_(), R.current = !1, e) {
659
+ }, [y]), rr = r(() => {
660
+ const e = F.current === "url" || R.current.length === 0;
661
+ if (_(), N.current = !1, e) {
668
662
  te("url-ended");
669
663
  return;
670
664
  }
671
- Nt();
672
- }, [te, Nt, _]), ar = r(() => {
665
+ Lt();
666
+ }, [te, Lt, _]), nr = r(() => {
673
667
  _(), y(), h(!1), l(!1);
674
- }, [_, y, l]), sr = r(
668
+ }, [_, y, l]), ur = r(
675
669
  (e) => {
676
- ze?.(e), q(!1);
670
+ Ze?.(e), X(!1);
677
671
  },
678
- [ze]
679
- ), Oe = r(() => {
672
+ [Ze]
673
+ ), Be = r(() => {
680
674
  if (P) {
681
- const t = !Z;
682
- return O(t), Ge?.(t), !0;
675
+ const t = !D;
676
+ return O(t), ze?.(t), !0;
683
677
  }
684
- const e = g.current;
685
- return w || !e || !p ? !1 : m.current !== null ? ke ? (O(!1), c.current = !1, M.current = !0, m.current = null, x.current = !1, h(!1), l(!1), e.pause(), !0) : (O(!0), W.current = "manual", M.current = !1, c.current = !0, l(!0, "waitingForMoreAudio"), !0) : !e.src && E.length > 0 ? (O(!0), W.current = "manual", M.current = !1, A(
678
+ const e = S.current;
679
+ return w || !e || !p ? !1 : m.current !== null ? _e ? (O(!1), c.current = !1, M.current = !0, m.current = null, x.current = !1, h(!1), l(!1), e.pause(), !0) : (O(!0), W.current = "manual", M.current = !1, c.current = !0, l(!0, "waitingForMoreAudio"), !0) : !e.src && E.length > 0 ? (O(!0), W.current = "manual", M.current = !1, A(
686
680
  Math.min(
687
- F.current,
681
+ U.current,
688
682
  E.length - 1
689
683
  ),
690
684
  "toggle"
691
- ), !0) : e.paused ? (O(!0), W.current = "manual", M.current = !1, c.current = !0, T("toggle-resume"), !0) : (O(!1), c.current = !1, M.current = !0, e.pause(), !0);
685
+ ), !0) : e.paused ? (O(!0), W.current = "manual", M.current = !1, c.current = !0, L("toggle-resume"), !0) : (O(!1), c.current = !1, M.current = !0, e.pause(), !0);
692
686
  }, [
693
687
  p,
694
688
  E.length,
695
- Z,
689
+ D,
696
690
  w,
697
- ke,
698
- Ge,
691
+ _e,
692
+ ze,
699
693
  A,
700
- T,
694
+ L,
701
695
  l,
702
696
  O,
703
697
  P
704
698
  ]);
705
- S(() => {
699
+ b(() => {
706
700
  if (B)
707
- return Cr(Y);
708
- }, [Y, B]);
709
- const Ve = re(
701
+ return kr(j);
702
+ }, [j, B]);
703
+ const Oe = re(
710
704
  () => ({
711
705
  fullscreen: () => ue ? (ue(), !0) : !1,
712
- interaction: () => he ? (Ne && he(), !0) : !1,
713
- next: () => me ? (Ke || me(
714
- $e(G())
706
+ next: () => de ? (Ne || de(
707
+ He(Y())
715
708
  ), !0) : !1,
716
- nextSubtitle: () => I.next ? oe("next") : !0,
717
- previous: () => de ? (Ee || de(
718
- $e(G())
709
+ nextSubtitle: () => q.next ? ie("next") : !0,
710
+ previous: () => fe ? (Re || fe(
711
+ He(Y())
719
712
  ), !0) : !1,
720
- previousSubtitle: () => I.previous ? oe("previous") : !0,
713
+ previousSubtitle: () => q.previous ? ie("previous") : !0,
721
714
  subtitle: () => ne ? (ne(), !0) : !1,
722
- togglePlayback: () => (Oe(), !0)
715
+ togglePlayback: () => (Be(), !0)
723
716
  }),
724
717
  [
725
- G,
718
+ Y,
719
+ ie,
726
720
  Ne,
727
- oe,
728
- Ke,
729
721
  ue,
730
- he,
731
- me,
732
722
  de,
723
+ fe,
733
724
  ne,
734
- Ee,
735
- I.next,
736
- I.previous,
737
- Oe
725
+ Re,
726
+ q.next,
727
+ q.previous,
728
+ Be
738
729
  ]
739
- ), Et = o(Ve);
740
- return S(() => {
741
- Et.current = Ve;
742
- }, [Ve]), S(() => {
730
+ ), At = o(Oe);
731
+ return b(() => {
732
+ At.current = Oe;
733
+ }, [Oe]), b(() => {
743
734
  if (!B || typeof document > "u")
744
735
  return;
745
736
  const e = (t) => {
746
- if (!Lr(Y))
737
+ if (!wr(j))
747
738
  return;
748
- const u = vr(t, ut());
739
+ const u = Mr(t, nt());
749
740
  if (!u || Tr(t, u))
750
741
  return;
751
742
  let n = !1;
752
- const b = Et.current[u];
753
- n = b(), n && t.preventDefault();
743
+ const g = At.current[u];
744
+ n = g(), n && t.preventDefault();
754
745
  };
755
746
  return document.addEventListener("keydown", e), () => {
756
747
  document.removeEventListener("keydown", e);
757
748
  };
758
- }, [Y, ut, B]), S(() => {
759
- fe?.(ge.current);
760
- }, [fe]), /* @__PURE__ */ X(
749
+ }, [j, nt, B]), b(() => {
750
+ oe?.(be.current);
751
+ }, [oe]), /* @__PURE__ */ Q(
761
752
  "div",
762
753
  {
763
- ...Ue,
764
- dir: Pe,
765
- lang: tt,
766
- "data-slide-player-shortcut-owner": Y,
767
- className: Ft("slide-player", d),
768
- onFocusCapture: Xt,
769
- onPointerDown: Qt,
754
+ ...Ke,
755
+ dir: Ue,
756
+ lang: et,
757
+ "data-slide-player-shortcut-owner": j,
758
+ className: pr("slide-player", d),
759
+ onFocusCapture: zt,
760
+ onPointerDown: jt,
770
761
  children: [
771
- /* @__PURE__ */ a(
762
+ /* @__PURE__ */ s(
772
763
  "audio",
773
764
  {
774
- ref: g,
765
+ ref: S,
775
766
  preload: "auto",
776
767
  playsInline: !0,
777
- onLoadStart: nr,
778
- onLoadedMetadata: tr,
779
- onCanPlay: er,
780
- onPlay: qt,
781
- onPause: It,
782
- onWaiting: ur,
783
- onSeeking: Rt,
784
- onSeeked: Rt,
785
- onTimeUpdate: rr,
786
- onEnded: lr,
787
- onError: ar
768
+ onLoadStart: er,
769
+ onLoadedMetadata: Xt,
770
+ onCanPlay: Qt,
771
+ onPlay: Yt,
772
+ onPause: Gt,
773
+ onWaiting: tr,
774
+ onSeeking: xt,
775
+ onSeeked: xt,
776
+ onTimeUpdate: qt,
777
+ onEnded: rr,
778
+ onError: nr
788
779
  }
789
780
  ),
790
- Fe ? /* @__PURE__ */ X(cr, { children: [
791
- /* @__PURE__ */ a(
792
- Sr,
781
+ Ee ? /* @__PURE__ */ Q(Nt, { children: [
782
+ /* @__PURE__ */ s(
783
+ hr,
793
784
  {
794
- container: Vt,
795
- dir: Pe ?? nt,
796
- lang: Zt,
785
+ container: Wt,
786
+ dir: Ue ?? rt,
787
+ lang: It,
797
788
  labels: {
798
789
  closeSettings: i.closeSettingsLabel,
799
790
  fullscreen: i.fullscreenLabel,
@@ -804,38 +795,38 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
804
795
  subtitleToggle: i.subtitleToggleAriaLabel,
805
796
  title: i.settingsTitle
806
797
  },
807
- isSubtitleEnabled: Re,
808
- onClose: () => q(!1),
809
- onOpenChange: q,
798
+ isSubtitleEnabled: Ae,
799
+ onClose: () => X(!1),
800
+ onOpenChange: X,
810
801
  onSubtitleToggle: ne ?? (() => {
811
802
  }),
812
- onViewModeChange: sr,
813
- open: ft,
814
- viewMode: Ot
803
+ onViewModeChange: ur,
804
+ open: ot,
805
+ viewMode: Pt
815
806
  }
816
807
  ),
817
- /* @__PURE__ */ X(
808
+ /* @__PURE__ */ Q(
818
809
  "div",
819
810
  {
820
811
  className: "slide-player__controls",
821
- onPointerEnter: Ht,
822
- onPointerLeave: $t,
823
- style: Yt,
812
+ onPointerEnter: Bt,
813
+ onPointerLeave: Ot,
814
+ style: Jt,
824
815
  children: [
825
- /* @__PURE__ */ X("div", { className: "slide-player__group", children: [
826
- /* @__PURE__ */ a(
816
+ /* @__PURE__ */ Q("div", { className: "slide-player__group", children: [
817
+ /* @__PURE__ */ s(
827
818
  "button",
828
819
  {
829
- "aria-expanded": ft,
820
+ "aria-expanded": ot,
830
821
  "aria-haspopup": "dialog",
831
822
  "aria-label": i.moreOptionsAriaLabel,
832
823
  className: "slide-player__action slide-player__action--mobile-more",
833
824
  onClick: () => {
834
- q((e) => !e);
825
+ X((e) => !e);
835
826
  },
836
827
  type: "button",
837
- children: /* @__PURE__ */ a(
838
- Fr,
828
+ children: /* @__PURE__ */ s(
829
+ Nr,
839
830
  {
840
831
  className: "slide-player__icon",
841
832
  strokeWidth: 2.25
@@ -843,58 +834,58 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
843
834
  )
844
835
  }
845
836
  ),
846
- /* @__PURE__ */ a(
837
+ /* @__PURE__ */ s(
847
838
  "button",
848
839
  {
849
840
  "aria-label": i.volumeAriaLabel,
850
841
  className: "hidden",
851
842
  type: "button",
852
- children: /* @__PURE__ */ a(Ur, { className: "slide-player__icon", strokeWidth: 2.25 })
843
+ children: /* @__PURE__ */ s(Er, { className: "slide-player__icon", strokeWidth: 2.25 })
853
844
  }
854
845
  ),
855
- /* @__PURE__ */ a(
846
+ /* @__PURE__ */ s(
856
847
  "button",
857
848
  {
858
- "aria-label": yt,
859
- "aria-keyshortcuts": kt.ariaKeyShortcuts,
849
+ "aria-label": pt,
850
+ "aria-keyshortcuts": St.ariaKeyShortcuts,
860
851
  className: "slide-player__toggle slide-player__toggle--playback",
861
852
  onClick: () => {
862
- Oe();
853
+ Be();
863
854
  },
864
- title: kt.title,
855
+ title: St.title,
865
856
  type: "button",
866
- children: Gt ? /* @__PURE__ */ a(zr, {}) : /* @__PURE__ */ a(Yr, {})
857
+ children: Zt ? /* @__PURE__ */ s($r, {}) : /* @__PURE__ */ s(Dr, {})
867
858
  }
868
859
  ),
869
- /* @__PURE__ */ a(
860
+ /* @__PURE__ */ s(
870
861
  "button",
871
862
  {
872
863
  "aria-keyshortcuts": gt.ariaKeyShortcuts,
873
864
  "aria-label": i.previousLabel,
874
865
  className: "slide-player__action slide-player__action--prev",
875
- disabled: Ee,
866
+ disabled: Re,
876
867
  onClick: () => {
877
- de?.(G());
868
+ fe?.(Y());
878
869
  },
879
870
  title: gt.title,
880
871
  type: "button",
881
- children: /* @__PURE__ */ a(Pr, { className: "slide-player__icon", strokeWidth: 2.25 })
872
+ children: /* @__PURE__ */ s(Kr, { className: "slide-player__icon", strokeWidth: 2.25 })
882
873
  }
883
874
  ),
884
- /* @__PURE__ */ a(
875
+ /* @__PURE__ */ s(
885
876
  "button",
886
877
  {
887
- "aria-keyshortcuts": wt.ariaKeyShortcuts,
878
+ "aria-keyshortcuts": _t.ariaKeyShortcuts,
888
879
  "aria-label": i.nextLabel,
889
880
  className: "slide-player__action slide-player__action--next",
890
- disabled: Ke,
881
+ disabled: Ne,
891
882
  onClick: () => {
892
- me?.(G());
883
+ de?.(Y());
893
884
  },
894
- title: wt.title,
885
+ title: _t.title,
895
886
  type: "button",
896
- children: /* @__PURE__ */ a(
897
- Wr,
887
+ children: /* @__PURE__ */ s(
888
+ Ur,
898
889
  {
899
890
  className: "slide-player__icon",
900
891
  strokeWidth: 2.25
@@ -902,35 +893,35 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
902
893
  )
903
894
  }
904
895
  ),
905
- /* @__PURE__ */ a(
896
+ /* @__PURE__ */ s(
906
897
  "button",
907
898
  {
908
- "aria-keyshortcuts": _t.ariaKeyShortcuts,
899
+ "aria-keyshortcuts": bt.ariaKeyShortcuts,
909
900
  "aria-label": i.previousSubtitleLabel,
910
901
  className: "slide-player__action slide-player__action--prev-subtitle",
911
- disabled: !I.previous,
902
+ disabled: !q.previous,
912
903
  onClick: () => {
913
- oe("previous");
904
+ ie("previous");
914
905
  },
915
- title: _t.title,
906
+ title: bt.title,
916
907
  type: "button",
917
- children: /* @__PURE__ */ a(Br, { className: "slide-player__icon", strokeWidth: 2.25 })
908
+ children: /* @__PURE__ */ s(Fr, { className: "slide-player__icon", strokeWidth: 2.25 })
918
909
  }
919
910
  ),
920
- /* @__PURE__ */ a(
911
+ /* @__PURE__ */ s(
921
912
  "button",
922
913
  {
923
- "aria-keyshortcuts": Mt.ariaKeyShortcuts,
914
+ "aria-keyshortcuts": kt.ariaKeyShortcuts,
924
915
  "aria-label": i.nextSubtitleLabel,
925
916
  className: "slide-player__action slide-player__action--next-subtitle",
926
- disabled: !I.next,
917
+ disabled: !q.next,
927
918
  onClick: () => {
928
- oe("next");
919
+ ie("next");
929
920
  },
930
- title: Mt.title,
921
+ title: kt.title,
931
922
  type: "button",
932
- children: /* @__PURE__ */ a(
933
- Or,
923
+ children: /* @__PURE__ */ s(
924
+ Pr,
934
925
  {
935
926
  className: "slide-player__icon",
936
927
  strokeWidth: 2.25
@@ -938,18 +929,18 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
938
929
  )
939
930
  }
940
931
  ),
941
- /* @__PURE__ */ a(
932
+ /* @__PURE__ */ s(
942
933
  "button",
943
934
  {
944
935
  "aria-label": i.subtitleToggleAriaLabel,
945
- "aria-keyshortcuts": St.ariaKeyShortcuts,
946
- "aria-pressed": Re,
936
+ "aria-keyshortcuts": yt.ariaKeyShortcuts,
937
+ "aria-pressed": Ae,
947
938
  className: "slide-player__action slide-player__action--subtitle",
948
939
  onClick: ne,
949
- title: St.title,
940
+ title: yt.title,
950
941
  type: "button",
951
- children: Re ? /* @__PURE__ */ a(Vr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ a(
952
- Hr,
942
+ children: Ae ? /* @__PURE__ */ s(Wr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ s(
943
+ Br,
953
944
  {
954
945
  className: "slide-player__icon",
955
946
  strokeWidth: 2.25
@@ -957,23 +948,23 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
957
948
  )
958
949
  }
959
950
  ),
960
- ue ? /* @__PURE__ */ a(
951
+ ue ? /* @__PURE__ */ s(
961
952
  "button",
962
953
  {
963
- "aria-label": bt,
964
- "aria-keyshortcuts": Ct.ariaKeyShortcuts,
954
+ "aria-label": ht,
955
+ "aria-keyshortcuts": wt.ariaKeyShortcuts,
965
956
  className: "slide-player__action slide-player__action--fullscreen",
966
957
  onClick: ue,
967
- title: Ct.title,
958
+ title: wt.title,
968
959
  type: "button",
969
- children: je ? /* @__PURE__ */ a(
970
- $r,
960
+ children: Je ? /* @__PURE__ */ s(
961
+ Or,
971
962
  {
972
963
  className: "slide-player__icon",
973
964
  strokeWidth: 2.25
974
965
  }
975
- ) : /* @__PURE__ */ a(
976
- Dr,
966
+ ) : /* @__PURE__ */ s(
967
+ Vr,
977
968
  {
978
969
  className: "slide-player__icon",
979
970
  strokeWidth: 2.25
@@ -982,32 +973,10 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
982
973
  }
983
974
  ) : null
984
975
  ] }),
985
- /* @__PURE__ */ a("div", { className: "slide-player__separator" }),
986
- /* @__PURE__ */ X("div", { className: "slide-player__group", children: [
987
- pt.map((e, t) => /* @__PURE__ */ a(or.Fragment, { children: e }, `custom-action-${t}`)),
988
- /* @__PURE__ */ a(
989
- "button",
990
- {
991
- "aria-label": i.notesLabel,
992
- "aria-keyshortcuts": Lt.ariaKeyShortcuts,
993
- className: Ft(
994
- "slide-player__action slide-player__action--notes",
995
- le && "slide-player__action--active"
996
- ),
997
- disabled: !Ne,
998
- onClick: he,
999
- title: Lt.title,
1000
- type: "button",
1001
- children: /* @__PURE__ */ a(
1002
- Jr,
1003
- {
1004
- className: "slide-player__icon",
1005
- strokeWidth: 2.25
1006
- }
1007
- )
1008
- }
1009
- )
1010
- ] })
976
+ Fe.length > 0 ? /* @__PURE__ */ Q(Nt, { children: [
977
+ /* @__PURE__ */ s("div", { className: "slide-player__separator" }),
978
+ /* @__PURE__ */ s("div", { className: "slide-player__group slide-player__group--custom-actions", children: Fe.map((e, t) => /* @__PURE__ */ s(ar.Fragment, { children: e }, `custom-action-${t}`)) })
979
+ ] }) : null
1011
980
  ]
1012
981
  }
1013
982
  )
@@ -1015,9 +984,9 @@ const Wt = /* @__PURE__ */ new Map(), Bt = (f) => {
1015
984
  ]
1016
985
  }
1017
986
  );
1018
- }, qr = fr(Xr);
1019
- qr.displayName = "Player";
987
+ }, zr = sr(jr);
988
+ zr.displayName = "Player";
1020
989
  export {
1021
- qr as default
990
+ zr as default
1022
991
  };
1023
992
  //# sourceMappingURL=Player.es.js.map