markdown-flow-ui 0.1.123 → 0.1.125

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 (62) hide show
  1. package/dist/_virtual/index.cjs8.js +1 -1
  2. package/dist/_virtual/index.cjs9.js +1 -1
  3. package/dist/_virtual/index.es8.js +2 -2
  4. package/dist/_virtual/index.es9.js +2 -2
  5. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js +1 -1
  6. package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.js.map +1 -1
  7. package/dist/components/Slide/MobilePlayerSettingsSheet.d.ts +2 -0
  8. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +7 -6
  9. package/dist/components/Slide/MobilePlayerSettingsSheet.es.js.map +1 -1
  10. package/dist/components/Slide/Player.cjs.js +1 -1
  11. package/dist/components/Slide/Player.cjs.js.map +1 -1
  12. package/dist/components/Slide/Player.d.ts +37 -1
  13. package/dist/components/Slide/Player.es.js +602 -487
  14. package/dist/components/Slide/Player.es.js.map +1 -1
  15. package/dist/components/Slide/Slide.cjs.js +1 -1
  16. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  17. package/dist/components/Slide/Slide.d.ts +13 -0
  18. package/dist/components/Slide/Slide.es.js +528 -501
  19. package/dist/components/Slide/Slide.es.js.map +1 -1
  20. package/dist/components/Slide/constants.cjs.js +1 -1
  21. package/dist/components/Slide/constants.cjs.js.map +1 -1
  22. package/dist/components/Slide/constants.d.ts +13 -0
  23. package/dist/components/Slide/constants.es.js +13 -0
  24. package/dist/components/Slide/constants.es.js.map +1 -1
  25. package/dist/components/Slide/useWakePlayerFromIframe.cjs.js +1 -1
  26. package/dist/components/Slide/useWakePlayerFromIframe.cjs.js.map +1 -1
  27. package/dist/components/Slide/useWakePlayerFromIframe.d.ts +12 -1
  28. package/dist/components/Slide/useWakePlayerFromIframe.es.js +70 -39
  29. package/dist/components/Slide/useWakePlayerFromIframe.es.js.map +1 -1
  30. package/dist/components/Slide/utils/playbackPreference.cjs.js +1 -1
  31. package/dist/components/Slide/utils/playbackPreference.cjs.js.map +1 -1
  32. package/dist/components/Slide/utils/playbackPreference.d.ts +1 -6
  33. package/dist/components/Slide/utils/playbackPreference.es.js +4 -9
  34. package/dist/components/Slide/utils/playbackPreference.es.js.map +1 -1
  35. package/dist/components/Slide/utils/playerKeyboardShortcutContext.cjs.js +2 -0
  36. package/dist/components/Slide/utils/playerKeyboardShortcutContext.cjs.js.map +1 -0
  37. package/dist/components/Slide/utils/playerKeyboardShortcutContext.d.ts +5 -0
  38. package/dist/components/Slide/utils/playerKeyboardShortcutContext.es.js +6 -0
  39. package/dist/components/Slide/utils/playerKeyboardShortcutContext.es.js.map +1 -0
  40. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js +2 -0
  41. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.js.map +1 -0
  42. package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +19 -0
  43. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +58 -0
  44. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -0
  45. package/dist/components/Slide/utils/playerKeyboardShortcuts.test.d.ts +1 -0
  46. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  47. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  48. package/dist/node_modules/classnames/index.cjs.js +1 -1
  49. package/dist/node_modules/classnames/index.es.js +1 -1
  50. package/dist/node_modules/cose-base/cose-base.cjs.js +1 -1
  51. package/dist/node_modules/cose-base/cose-base.cjs.js.map +1 -1
  52. package/dist/node_modules/cose-base/cose-base.es.js +1 -1
  53. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.js +1 -1
  54. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.js.map +1 -1
  55. package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
  56. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.js +1 -1
  57. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.js.map +1 -1
  58. package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
  59. package/dist/node_modules/layout-base/layout-base.cjs.js +1 -1
  60. package/dist/node_modules/layout-base/layout-base.cjs.js.map +1 -1
  61. package/dist/node_modules/layout-base/layout-base.es.js +1 -1
  62. package/package.json +2 -1
@@ -1,29 +1,31 @@
1
- import { j as t } from "../../_virtual/jsx-runtime.es.js";
2
- import sr, { memo as lr, useRef as a, useState as Ce, useMemo as G, useEffect as x, useCallback as u } from "react";
3
- import { cn as ve } from "../../lib/utils.es.js";
4
- import ar from "./MobilePlayerSettingsSheet.es.js";
5
- import { DEFAULT_SLIDE_PLAYER_TEXTS as cr } from "./constants.es.js";
6
- import { DEFAULT_MOBILE_VIEW_MODE as or } from "./utils/mobileScreenMode.es.js";
7
- import { hasReachedAudioEnd as ir } from "./utils/audioCompletion.es.js";
8
- import { resolveAudioPlaybackSourceType as fr } from "./utils/playbackSource.es.js";
9
- import { shouldKeepPlayingAfterNavigation as dr } from "./utils/playbackPreference.es.js";
10
- import { toPlayerCustomActionList as mr } from "./utils/playerCustomActions.es.js";
1
+ import { j as n } from "../../_virtual/jsx-runtime.es.js";
2
+ import jr, { memo as Rr, useId as Er, useContext as Cr, useRef as c, useState as nr, useMemo as G, useCallback as t, useEffect as m } from "react";
3
+ import { cn as ur } from "../../lib/utils.es.js";
4
+ import Nr from "./MobilePlayerSettingsSheet.es.js";
5
+ import { DEFAULT_SLIDE_PLAYER_TEXTS as vr } from "./constants.es.js";
6
+ import { DEFAULT_MOBILE_VIEW_MODE as Tr } from "./utils/mobileScreenMode.es.js";
7
+ import { hasReachedAudioEnd as Kr } from "./utils/audioCompletion.es.js";
8
+ import { PlayerKeyboardShortcutContext as Ur } from "./utils/playerKeyboardShortcutContext.es.js";
9
+ import { activatePlayerKeyboardShortcutOwner as Fr, registerPlayerKeyboardShortcutOwner as Pr, isActivePlayerKeyboardShortcutOwner as Wr, getPlayerKeyboardShortcutAction as Or, shouldIgnorePlayerKeyboardShortcutEvent as Br } from "./utils/playerKeyboardShortcuts.es.js";
10
+ import { resolveAudioPlaybackSourceType as Vr } from "./utils/playbackSource.es.js";
11
+ import { shouldKeepPlayingAfterNavigation as Hr } from "./utils/playbackPreference.es.js";
12
+ import { toPlayerCustomActionList as $r } from "./utils/playerCustomActions.es.js";
11
13
  /* empty css */
12
- import pr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
13
- import hr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
14
- import yr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
15
- import gr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
16
- import _r from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
17
- import br from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
18
- import xr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
19
- import Sr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
20
- import wr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
21
- const Le = /* @__PURE__ */ new Map(), Fe = (T) => {
22
- if (typeof window > "u" || !T || Le.has(T))
14
+ import Zr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
15
+ import qr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
16
+ import zr from "../../node_modules/lucide-react/dist/esm/icons/captions.es.js";
17
+ import Yr from "../../node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
18
+ import Dr from "../../node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
19
+ import Xr from "../../node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
20
+ import Gr from "../../node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
21
+ import Jr from "../../node_modules/lucide-react/dist/esm/icons/maximize.es.js";
22
+ import Qr from "../../node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
23
+ const ar = /* @__PURE__ */ new Map(), sr = (k) => {
24
+ if (typeof window > "u" || !k || ar.has(k))
23
25
  return;
24
- const U = window.document.createElement("audio");
25
- U.preload = "auto", U.setAttribute("playsinline", "true"), U.src = T, U.load(), Le.set(T, U);
26
- }, Ar = () => /* @__PURE__ */ t.jsxs(
26
+ const j = window.document.createElement("audio");
27
+ j.preload = "auto", j.setAttribute("playsinline", "true"), j.src = k, j.load(), ar.set(k, j);
28
+ }, Ir = () => /* @__PURE__ */ n.jsxs(
27
29
  "svg",
28
30
  {
29
31
  xmlns: "http://www.w3.org/2000/svg",
@@ -32,17 +34,17 @@ const Le = /* @__PURE__ */ new Map(), Fe = (T) => {
32
34
  viewBox: "0 0 34 34",
33
35
  fill: "none",
34
36
  children: [
35
- /* @__PURE__ */ t.jsx(
37
+ /* @__PURE__ */ n.jsx(
36
38
  "path",
37
39
  {
38
40
  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",
39
41
  fill: "#0A0A0A"
40
42
  }
41
43
  ),
42
- /* @__PURE__ */ t.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
44
+ /* @__PURE__ */ n.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
43
45
  ]
44
46
  }
45
- ), Mr = () => /* @__PURE__ */ t.jsxs(
47
+ ), et = () => /* @__PURE__ */ n.jsxs(
46
48
  "svg",
47
49
  {
48
50
  xmlns: "http://www.w3.org/2000/svg",
@@ -51,614 +53,727 @@ const Le = /* @__PURE__ */ new Map(), Fe = (T) => {
51
53
  viewBox: "0 0 34 34",
52
54
  fill: "none",
53
55
  children: [
54
- /* @__PURE__ */ t.jsx(
56
+ /* @__PURE__ */ n.jsx(
55
57
  "path",
56
58
  {
57
59
  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",
58
60
  fill: "#0A0A0A"
59
61
  }
60
62
  ),
61
- /* @__PURE__ */ t.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
63
+ /* @__PURE__ */ n.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
62
64
  ]
63
65
  }
64
- ), jr = ({
65
- audioList: T = [],
66
- className: U,
67
- currentAudioIndex: m = -1,
68
- defaultPlaying: p = !0,
69
- isPlaybackPaused: j = !1,
70
- isAutoAdvanceEnabled: q = !0,
71
- useAutoAdvanceToggle: z = !1,
72
- onLoadingChange: le,
73
- onPlaybackPreferenceChange: ae,
74
- onPlaybackStarted: ce,
75
- onPlaybackTimeChange: J,
76
- onSubtitleToggle: oe,
77
- onPrev: Ue,
78
- onNext: We,
79
- onFullscreen: ie,
80
- isFullscreen: fe = !1,
81
- mobileViewMode: Pe = or,
82
- settingsPortalContainer: Ve,
83
- onMobileViewModeChange: de,
84
- onEnded: me,
85
- onAutoAdvanceToggle: Be,
86
- onInteractionToggle: Ze,
87
- hasInteraction: $e = !1,
88
- isInteractionOpen: D = !1,
89
- isSubtitleEnabled: re = !0,
90
- prevDisabled: He = !1,
91
- nextDisabled: Ke = !1,
92
- showControls: te = !0,
93
- customActions: pe,
94
- customActionContext: he,
95
- texts: ye,
96
- ...Oe
66
+ ), J = {
67
+ fullscreen: "F",
68
+ next: "→",
69
+ notes: "N",
70
+ playback: "Space",
71
+ previous: "←",
72
+ subtitle: "C"
73
+ }, rt = (k, j) => k ? `${k} (${j})` : j, tt = ({
74
+ audioList: k = [],
75
+ className: j,
76
+ currentAudioIndex: h = -1,
77
+ defaultPlaying: g = !0,
78
+ isPlaybackPaused: K = !1,
79
+ isAutoAdvanceEnabled: O = !0,
80
+ useAutoAdvanceToggle: N = !1,
81
+ onLoadingChange: xe,
82
+ onPlaybackPreferenceChange: ke,
83
+ onPlaybackStarted: Me,
84
+ onPlaybackTimeChange: ne,
85
+ onSubtitleToggle: Q,
86
+ onPrev: ue,
87
+ onNext: ae,
88
+ onFullscreen: I,
89
+ isFullscreen: Le = !1,
90
+ mobileViewMode: lr = Tr,
91
+ settingsPortalContainer: cr,
92
+ onMobileViewModeChange: Ae,
93
+ onEnded: je,
94
+ onAutoAdvanceToggle: Re,
95
+ onInteractionToggle: se,
96
+ hasInteraction: me = !1,
97
+ isInteractionOpen: ee = !1,
98
+ isSubtitleEnabled: pe = !0,
99
+ prevDisabled: he = !1,
100
+ nextDisabled: ye = !1,
101
+ showControls: be = !0,
102
+ enableKeyboardShortcuts: or = !0,
103
+ customActions: Ee,
104
+ customActionContext: Ce,
105
+ texts: Ne,
106
+ onFocusCapture: ve,
107
+ onPointerDown: Te,
108
+ ...ir
97
109
  }) => {
98
- const h = a(null), ge = a(D), C = a(null), _e = a(null), S = a(0), c = a(null), Q = a(void 0), k = a([]), ne = a(p), X = a(!1), be = a(!1), y = a(!1), v = a(null), Z = a(null), g = a(!1), s = a(!1), _ = a(null), w = a(!1), W = a(null), ue = a(0), L = a("unknown"), [Y, f] = Ce(p), [xe, $] = Ce(!1), o = m >= 0 ? T[m] : void 0, P = o?.audioUrl, A = G(
99
- () => [...o?.audioSegments ?? []].sort(
110
+ const fr = Er(), Ke = Cr(Ur), y = c(null), Ue = c(ee), U = c(null), Fe = c(null), R = c(0), o = c(null), le = c(void 0), v = c([]), ce = c(
111
+ N ? O : g
112
+ ), re = c(!1), Pe = c(!1), b = c(!1), F = c(null), q = c(null), _ = c(!1), s = c(!1), S = c(null), E = c(!1), B = c(null), Se = c(0), P = c("unknown"), [oe, f] = nr(g), [We, z] = nr(!1), V = Ke?.ownerId ?? fr, T = or && (Ke?.enabled ?? !0), d = h >= 0 ? k[h] : void 0, H = d?.audioUrl, M = G(
113
+ () => [...d?.audioSegments ?? []].sort(
100
114
  (e, r) => e.segment_index - r.segment_index
101
115
  ),
102
- [o?.audioSegments]
103
- ), Se = G(
104
- () => mr(pe, he),
105
- [he, pe]
106
- ), we = Se.length + 5, qe = G(
116
+ [d?.audioSegments]
117
+ ), Oe = G(
118
+ () => $r(Ee, Ce),
119
+ [Ce, Ee]
120
+ ), Be = Oe.length + 5, dr = G(
107
121
  () => ({
108
- "--slide-player-mobile-control-count": String(we)
122
+ "--slide-player-mobile-control-count": String(Be)
109
123
  }),
110
- [we]
111
- ), V = G(
124
+ [Be]
125
+ ), l = G(
112
126
  () => ({
113
- ...cr,
114
- ...ye
127
+ ...vr,
128
+ ...Ne
115
129
  }),
116
- [ye]
117
- ), se = G(() => o ? o.audioKey ?? `${String(o.sequenceNumber ?? "none")}:${String(o.audioUrl ?? "")}` : "none", [o]), ze = z ? q : Y, De = z ? q ? "Pause autoplay" : "Play autoplay" : Y ? "Pause" : "Play";
118
- x(() => {
119
- Q.current = o;
120
- }, [o]), x(() => {
121
- ne.current = p;
122
- }, [p]), x(() => {
123
- te || $(!1);
124
- }, [te]), x(() => {
125
- !ge.current && D && $(!1), ge.current = D;
126
- }, [D]), x(() => {
127
- k.current = A;
128
- }, [A]), x(() => {
129
- const e = o?.audioUrl, r = m >= 0 ? T[m + 1]?.audioUrl : void 0;
130
- Fe(e), Fe(r);
131
- }, [T, o?.audioUrl, m]);
132
- const n = u(
130
+ [Ne]
131
+ ), ge = G(() => d ? d.audioKey ?? `${String(d.sequenceNumber ?? "none")}:${String(d.audioUrl ?? "")}` : "none", [d]), mr = N ? O : oe, Ve = N ? O ? l.pauseAutoplayLabel : l.playAutoplayLabel : oe ? l.pauseLabel : l.playLabel, He = Le ? l.exitFullscreenLabel : l.enterFullscreenLabel, Y = t(
132
+ (e, r, a) => ({
133
+ ariaKeyShortcuts: T ? a : void 0,
134
+ title: T ? rt(e, r) : e
135
+ }),
136
+ [T]
137
+ ), $e = Y(
138
+ l.subtitleToggleAriaLabel,
139
+ J.subtitle,
140
+ "c"
141
+ ), Ze = Y(
142
+ l.previousLabel,
143
+ J.previous,
144
+ "ArrowLeft"
145
+ ), qe = Y(
146
+ Ve,
147
+ J.playback,
148
+ "Space"
149
+ ), ze = Y(
150
+ l.nextLabel,
151
+ J.next,
152
+ "ArrowRight"
153
+ ), Ye = Y(
154
+ He,
155
+ J.fullscreen,
156
+ "f"
157
+ ), De = Y(
158
+ l.notesLabel,
159
+ J.notes,
160
+ "n"
161
+ ), ie = t(() => {
162
+ T && Fr(V);
163
+ }, [V, T]), pr = t(
164
+ (e) => {
165
+ ie(), Te?.(e);
166
+ },
167
+ [ie, Te]
168
+ ), hr = t(
169
+ (e) => {
170
+ ie(), ve?.(e);
171
+ },
172
+ [ie, ve]
173
+ );
174
+ m(() => {
175
+ le.current = d;
176
+ }, [d]), m(() => {
177
+ ce.current = N ? O : g;
178
+ }, [g, O, N]), m(() => {
179
+ be || z(!1);
180
+ }, [be]), m(() => {
181
+ !Ue.current && ee && z(!1), Ue.current = ee;
182
+ }, [ee]), m(() => {
183
+ v.current = M;
184
+ }, [M]), m(() => {
185
+ const e = d?.audioUrl, r = h >= 0 ? k[h + 1]?.audioUrl : void 0;
186
+ sr(e), sr(r);
187
+ }, [k, d?.audioUrl, h]);
188
+ const u = t(
133
189
  (e, r = null) => {
134
- be.current === e && (!e || r === null) || (be.current = e, le?.({
190
+ Pe.current === e && (!e || r === null) || (Pe.current = e, xe?.({
135
191
  loading: e,
136
192
  reason: e ? r : null
137
193
  }));
138
194
  },
139
- [le]
140
- ), H = u(
195
+ [xe]
196
+ ), $ = t(
141
197
  (e) => {
142
- ne.current = e, ae?.(e);
198
+ ce.current = e, ke?.(e);
143
199
  },
144
- [ae]
145
- ), Ae = u(() => z ? {
146
- shouldContinuePlayback: q
200
+ [ke]
201
+ ), te = t(() => N ? {
202
+ shouldContinuePlayback: ce.current
147
203
  } : {
148
- shouldContinuePlayback: dr({
149
- defaultPlaying: ne.current,
150
- hasCurrentAudio: !!o,
151
- hasPendingAutoPlay: s.current,
152
- isPausedByUser: y.current,
153
- isPlaybackPaused: j,
154
- isPlaying: Y,
155
- isWaitingForMoreAudio: g.current || c.current !== null
204
+ shouldContinuePlayback: Hr({
205
+ defaultPlaying: ce.current,
206
+ isPausedByUser: b.current
156
207
  })
157
- }, [
158
- o,
159
- p,
160
- q,
161
- j,
162
- Y,
163
- z
164
- ]), Me = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), F = u(() => p && !j && !y.current && L.current !== "blocked", [p, j]), je = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), ke = u(() => {
165
- const e = c.current;
166
- return e == null || e <= 0 ? 0 : k.current.slice(0, e).reduce(
167
- (r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
208
+ }, [N]), Xe = t((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), W = t(() => g && !K && !b.current && P.current !== "blocked", [g, K]), Ge = t((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Je = t(() => {
209
+ const e = o.current;
210
+ return e == null || e <= 0 ? 0 : v.current.slice(0, e).reduce(
211
+ (r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
168
212
  0
169
213
  ) / 1e3;
170
- }, []), B = u((e) => e <= 0 ? 0 : k.current.slice(0, e).reduce(
171
- (r, l) => r + Math.max(Number(l.duration_ms ?? 0), 0),
214
+ }, []), Z = t((e) => e <= 0 ? 0 : v.current.slice(0, e).reduce(
215
+ (r, a) => r + Math.max(Number(a.duration_ms ?? 0), 0),
172
216
  0
173
- ), []), Ee = u(() => {
174
- const e = h.current;
175
- return e ? v.current === "segment" ? B(S.current) + Math.max(e.currentTime, 0) * 1e3 : _.current !== null && e.readyState === 0 ? _.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : c.current != null ? B(c.current) : 0;
176
- }, [B]), b = u(
217
+ ), []), Qe = t(() => {
218
+ const e = y.current;
219
+ return e ? F.current === "segment" ? Z(R.current) + Math.max(e.currentTime, 0) * 1e3 : S.current !== null && e.readyState === 0 ? S.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : o.current != null ? Z(o.current) : 0;
220
+ }, [Z]), w = t(
177
221
  (e) => {
178
222
  const r = Math.max(e, 0);
179
- ue.current !== r && (ue.current = r, J?.(r));
223
+ Se.current !== r && (Se.current = r, ne?.(r));
180
224
  },
181
- [J]
182
- ), i = u(() => {
183
- b(Ee());
184
- }, [Ee, b]), d = u(() => {
185
- typeof window > "u" || W.current === null || (window.cancelAnimationFrame(W.current), W.current = null);
186
- }, []), Ne = u(() => {
187
- if (typeof window > "u" || W.current !== null)
225
+ [ne]
226
+ ), i = t(() => {
227
+ w(Qe());
228
+ }, [Qe, w]), p = t(() => {
229
+ typeof window > "u" || B.current === null || (window.cancelAnimationFrame(B.current), B.current = null);
230
+ }, []), Ie = t(() => {
231
+ if (typeof window > "u" || B.current !== null)
188
232
  return;
189
233
  const e = () => {
190
234
  i();
191
- const r = h.current;
235
+ const r = y.current;
192
236
  if (!r || r.paused || r.ended) {
193
- W.current = null;
237
+ B.current = null;
194
238
  return;
195
239
  }
196
- W.current = window.requestAnimationFrame(e);
240
+ B.current = window.requestAnimationFrame(e);
197
241
  };
198
- W.current = window.requestAnimationFrame(e);
199
- }, [i]), K = u(() => {
200
- const e = h.current;
201
- e && (d(), s.current = !1, y.current = !1, X.current = !1, v.current = null, _.current = null, g.current = !1, w.current = !1, Z.current = null, e.pause(), e.removeAttribute("src"), e.load(), C.current = null, S.current = 0, c.current = null, b(0), f(!1), n(!1));
202
- }, [b, d, n]), M = u(
242
+ B.current = window.requestAnimationFrame(e);
243
+ }, [i]), D = t(() => {
244
+ const e = y.current;
245
+ e && (p(), s.current = !1, b.current = !1, re.current = !1, F.current = null, S.current = null, _.current = !1, E.current = !1, q.current = null, e.pause(), e.removeAttribute("src"), e.load(), U.current = null, R.current = 0, o.current = null, w(0), f(!1), u(!1));
246
+ }, [w, p, u]), L = t(
203
247
  (e) => {
204
- const r = h.current;
248
+ const r = y.current;
205
249
  if (!r)
206
250
  return !1;
207
- const l = r.play();
208
- return l && typeof l.then == "function" && l.then(() => {
209
- L.current === "unknown" && (L.current = "auto"), s.current = !1, w.current = !1;
210
- }).catch((N) => {
211
- L.current === "unknown" && Me(N) && (L.current = "blocked", s.current = !1, n(!1)), w.current = !1, f(!1);
251
+ const a = r.play();
252
+ return a && typeof a.then == "function" && a.then(() => {
253
+ P.current === "unknown" && (P.current = "auto"), s.current = !1, E.current = !1;
254
+ }).catch((x) => {
255
+ P.current === "unknown" && Xe(x) && (P.current = "blocked", s.current = !1, u(!1)), E.current = !1, f(!1);
212
256
  }), !0;
213
257
  },
214
- [Me, n]
215
- ), E = u(
258
+ [Xe, u]
259
+ ), C = t(
216
260
  (e, r) => {
217
- const l = h.current, N = k.current[e];
218
- if (!l || !N)
261
+ const a = y.current, x = v.current[e];
262
+ if (!a || !x)
219
263
  return !1;
220
- const R = je(N.audio_data);
221
- S.current = e, c.current = null, g.current = !1, w.current = !0, Z.current = "segment", b(B(e));
222
- const ee = F();
223
- s.current = ee, n(!1);
224
- const ur = C.current !== R;
225
- return v.current = "segment", ur && (l.pause(), l.removeAttribute("src"), l.load(), C.current = R, l.src = R, l.load()), _.current = 0, l.readyState > 0 && (l.currentTime = 0, _.current = null), ee ? M(`start-segment:${r}`) : (s.current = !1, w.current = !1, l.pause(), f(!1), !0);
264
+ const A = Ge(x.audio_data);
265
+ R.current = e, o.current = null, _.current = !1, E.current = !0, q.current = "segment", w(Z(e));
266
+ const de = W();
267
+ s.current = de, u(!1);
268
+ const Ar = U.current !== A;
269
+ return F.current = "segment", Ar && (a.pause(), a.removeAttribute("src"), a.load(), U.current = A, a.src = A, a.load()), S.current = 0, a.readyState > 0 && (a.currentTime = 0, S.current = null), de ? L(`start-segment:${r}`) : (s.current = !1, E.current = !1, a.pause(), f(!1), !0);
226
270
  },
227
271
  [
228
- F,
229
- je,
230
- B,
231
- b,
232
- M,
233
- n
272
+ W,
273
+ Ge,
274
+ Z,
275
+ w,
276
+ L,
277
+ u
234
278
  ]
235
- ), O = u(
279
+ ), X = t(
236
280
  (e) => {
237
- d(), s.current = !1, g.current = !1, w.current = !1, i(), f(!1), n(!1), m >= 0 && me?.(m);
281
+ p(), s.current = !1, _.current = !1, E.current = !1, i(), f(!1), u(!1), h >= 0 && je?.(h);
238
282
  },
239
283
  [
240
- m,
241
- me,
242
- d,
284
+ h,
285
+ je,
286
+ p,
243
287
  i,
244
- n
288
+ u
245
289
  ]
246
- ), I = u(
290
+ ), fe = t(
247
291
  (e) => {
248
- const r = h.current;
249
- return !r || v.current !== "url" || !ir({
292
+ const r = y.current;
293
+ return !r || F.current !== "url" || !Kr({
250
294
  currentTimeSeconds: Math.max(r.currentTime, 0),
251
295
  durationSeconds: r.duration
252
- }) ? !1 : (s.current = !1, r.pause(), O(e), !0);
296
+ }) ? !1 : (s.current = !1, r.pause(), X(e), !0);
253
297
  },
254
- [O]
255
- ), Re = u(() => {
256
- const e = S.current + 1, r = k.current, l = r[e], N = Q.current, R = r.some((ee) => ee.is_final);
257
- if (l) {
258
- E(e, "ended");
298
+ [X]
299
+ ), er = t(() => {
300
+ const e = R.current + 1, r = v.current, a = r[e], x = le.current, A = r.some((de) => de.is_final);
301
+ if (a) {
302
+ C(e, "ended");
259
303
  return;
260
304
  }
261
- if (N?.isAudioStreaming || !R) {
262
- S.current = e, c.current = e, g.current = !0, s.current = p, b(B(e)), f(!1), n(!0, "waitingForMoreAudio");
305
+ if (x?.isAudioStreaming || !A) {
306
+ R.current = e, o.current = e, _.current = !0, s.current = g, w(Z(e)), f(!1), u(!0, "waitingForMoreAudio");
263
307
  return;
264
308
  }
265
- O("segments-completed");
309
+ X("segments-completed");
266
310
  }, [
267
- p,
268
- O,
269
- B,
270
- b,
271
- E,
272
- n
311
+ g,
312
+ X,
313
+ Z,
314
+ w,
315
+ C,
316
+ u
273
317
  ]);
274
- x(() => {
275
- if (_e.current === se)
318
+ m(() => {
319
+ if (Fe.current === ge)
276
320
  return;
277
- _e.current = se, S.current = 0, c.current = null, g.current = !1, y.current = !1, X.current = !1, s.current = !1, w.current = !1, v.current = null, Z.current = null, C.current = null, d(), b(0), n(!1);
278
- const e = h.current;
321
+ Fe.current = ge, R.current = 0, o.current = null, _.current = !1, b.current = !1, re.current = !1, s.current = !1, E.current = !1, F.current = null, q.current = null, U.current = null, p(), w(0), u(!1);
322
+ const e = y.current;
279
323
  e && (e.pause(), e.removeAttribute("src"), e.load(), f(!1));
280
324
  }, [
281
- m,
282
- se,
283
- A.length,
284
- P,
285
- b,
286
- d,
287
- n
288
- ]), x(() => {
289
- const e = h.current;
325
+ h,
326
+ ge,
327
+ M.length,
328
+ H,
329
+ w,
330
+ p,
331
+ u
332
+ ]), m(() => {
333
+ const e = y.current;
290
334
  if (e) {
291
- if (j) {
292
- X.current = !!(Q.current && !y.current && (!e.paused || s.current || c.current !== null)), s.current = !1, n(!1), e.pause(), f(!1);
335
+ if (K) {
336
+ re.current = !!(le.current && !b.current && (!e.paused || s.current || o.current !== null)), s.current = !1, u(!1), e.pause(), f(!1);
293
337
  return;
294
338
  }
295
- if (!(!X.current || !Q.current || y.current)) {
296
- if (X.current = !1, c.current !== null) {
297
- if (c.current < k.current.length) {
298
- E(c.current, "external-resume");
339
+ if (!(!re.current || !le.current || b.current)) {
340
+ if (re.current = !1, o.current !== null) {
341
+ if (o.current < v.current.length) {
342
+ C(o.current, "external-resume");
299
343
  return;
300
344
  }
301
- s.current = !0, n(!0, "waitingForMoreAudio");
345
+ s.current = !0, u(!0, "waitingForMoreAudio");
302
346
  return;
303
347
  }
304
- if (!C.current && k.current.length > 0) {
305
- E(
348
+ if (!U.current && v.current.length > 0) {
349
+ C(
306
350
  Math.min(
307
- S.current,
308
- k.current.length - 1
351
+ R.current,
352
+ v.current.length - 1
309
353
  ),
310
354
  "external-resume-init"
311
355
  );
312
356
  return;
313
357
  }
314
- e.paused && (s.current = !0, M("external-resume"));
358
+ e.paused && (s.current = !0, L("external-resume"));
315
359
  }
316
360
  }
317
361
  }, [
318
- j,
319
- E,
320
- M,
321
- n
322
- ]), x(() => {
323
- const e = h.current;
362
+ K,
363
+ C,
364
+ L,
365
+ u
366
+ ]), m(() => {
367
+ const e = y.current;
324
368
  if (!e)
325
369
  return;
326
- if (!o) {
327
- K();
370
+ if (!d) {
371
+ D();
328
372
  return;
329
373
  }
330
- if (j) {
331
- s.current = !1, n(!1), e.pause(), f(!1);
374
+ if (K) {
375
+ s.current = !1, u(!1), e.pause(), f(!1);
332
376
  return;
333
377
  }
334
- const r = fr({
335
- activeSourceType: v.current,
336
- hasAudioUrl: !!P,
337
- segmentCount: A.length,
338
- preferredSourceType: Z.current,
339
- waitingSegmentIndex: c.current
378
+ const r = Vr({
379
+ activeSourceType: F.current,
380
+ hasAudioUrl: !!H,
381
+ segmentCount: M.length,
382
+ preferredSourceType: q.current,
383
+ waitingSegmentIndex: o.current
340
384
  });
341
- if (r && Z.current !== r && (Z.current = r), r === "url" && P) {
342
- const l = C.current !== P, N = F();
343
- if (l) {
344
- const R = c.current !== null ? ke() : 0;
345
- e.pause(), e.removeAttribute("src"), e.load(), C.current = P, v.current = "url", e.src = P, e.load(), _.current = R, b(R * 1e3), e.readyState > 0 && (e.currentTime = R, _.current = null);
385
+ if (r && q.current !== r && (q.current = r), r === "url" && H) {
386
+ const a = U.current !== H, x = W();
387
+ if (a) {
388
+ const A = o.current !== null ? Je() : 0;
389
+ e.pause(), e.removeAttribute("src"), e.load(), U.current = H, F.current = "url", e.src = H, e.load(), S.current = A, w(A * 1e3), e.readyState > 0 && (e.currentTime = A, S.current = null);
346
390
  }
347
- if (s.current = N, g.current = !1, w.current = !1, n(!1), !N) {
391
+ if (s.current = x, _.current = !1, E.current = !1, u(!1), !x) {
348
392
  s.current = !1, e.pause(), f(!1);
349
393
  return;
350
394
  }
351
- M(l ? "sync-url-init" : "sync-url");
395
+ L(a ? "sync-url-init" : "sync-url");
352
396
  return;
353
397
  }
354
- if (r === "segment" && c.current !== null) {
355
- if (c.current < A.length) {
356
- if (y.current) {
357
- f(!1), n(!1);
398
+ if (r === "segment" && o.current !== null) {
399
+ if (o.current < M.length) {
400
+ if (b.current) {
401
+ f(!1), u(!1);
358
402
  return;
359
403
  }
360
- E(c.current, "wait-resume");
404
+ C(o.current, "wait-resume");
361
405
  return;
362
406
  }
363
- g.current = !0, s.current = F(), f(!1), n(F());
407
+ _.current = !0, s.current = W(), f(!1), u(W());
364
408
  return;
365
409
  }
366
- if (r === "segment" && !A.length) {
367
- if (o.isAudioStreaming) {
368
- c.current = S.current, g.current = !0, s.current = F(), f(!1), n(F());
410
+ if (r === "segment" && !M.length) {
411
+ if (d.isAudioStreaming) {
412
+ o.current = R.current, _.current = !0, s.current = W(), f(!1), u(W());
369
413
  return;
370
414
  }
371
- K();
415
+ D();
372
416
  return;
373
417
  }
374
- if (r === "segment" && !C.current) {
375
- E(
418
+ if (r === "segment" && !U.current) {
419
+ C(
376
420
  Math.min(
377
- S.current,
378
- A.length - 1
421
+ R.current,
422
+ M.length - 1
379
423
  ),
380
424
  "effect-init"
381
425
  );
382
426
  return;
383
427
  }
384
428
  if (r !== "segment") {
385
- K();
429
+ D();
386
430
  return;
387
431
  }
388
- if (!p || y.current) {
432
+ if (!g || b.current) {
389
433
  s.current = !1, e.pause(), f(!1);
390
434
  return;
391
435
  }
392
- e.paused && (s.current = !0, M("sync-paused-retry"));
436
+ e.paused && (s.current = !0, L("sync-paused-retry"));
393
437
  }, [
394
- o,
395
- m,
396
- A,
397
- P,
398
- p,
399
- j,
400
- F,
401
- b,
402
- K,
403
- E,
438
+ d,
439
+ h,
404
440
  M,
405
- ke,
406
- n
407
- ]), x(() => K, [K]), x(() => d, [d]);
408
- const Xe = u(() => {
409
- i(), Ne(), f(!0), n(!1), ce?.();
441
+ H,
442
+ g,
443
+ K,
444
+ W,
445
+ w,
446
+ D,
447
+ C,
448
+ L,
449
+ Je,
450
+ u
451
+ ]), m(() => D, [D]), m(() => p, [p]);
452
+ const yr = t(() => {
453
+ i(), Ie(), f(!0), u(!1), Me?.();
410
454
  }, [
411
- ce,
412
- Ne,
455
+ Me,
456
+ Ie,
413
457
  i,
414
- n
415
- ]), Ye = u(() => {
416
- g.current || w.current || (d(), i(), f(!1));
417
- }, [m, d, i]), Ge = u(() => {
418
- const e = h.current;
419
- e && _.current !== null && (e.currentTime = _.current, _.current = null), i(), !I("canplay-seek-finished") && (!s.current || !p || M("canplay"));
458
+ u
459
+ ]), br = t(() => {
460
+ _.current || E.current || (p(), i(), f(!1));
461
+ }, [h, p, i]), Sr = t(() => {
462
+ const e = y.current;
463
+ e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), !fe("canplay-seek-finished") && (!s.current || !g || L("canplay"));
420
464
  }, [
421
- m,
422
- p,
423
- I,
465
+ h,
466
+ g,
467
+ fe,
424
468
  i,
425
- M
426
- ]), Je = u(() => {
427
- const e = h.current;
428
- e && _.current !== null && (e.currentTime = _.current, _.current = null), i(), I("metadata-seek-finished");
429
- }, [m, I, i]), Qe = u(() => {
469
+ L
470
+ ]), gr = t(() => {
471
+ const e = y.current;
472
+ e && S.current !== null && (e.currentTime = S.current, S.current = null), i(), fe("metadata-seek-finished");
473
+ }, [h, fe, i]), _r = t(() => {
430
474
  i();
431
- }, [i]), Ie = u(() => {
432
- g.current || n(!0, "loadingAudio");
433
- }, [n]), er = u(() => {
434
- if (g.current) {
435
- n(!0, "waitingForMoreAudio");
475
+ }, [i]), wr = t(() => {
476
+ _.current || u(!0, "loadingAudio");
477
+ }, [u]), xr = t(() => {
478
+ if (_.current) {
479
+ u(!0, "waitingForMoreAudio");
436
480
  return;
437
481
  }
438
- n(!0, "loadingAudio");
439
- }, [n]), Te = u(() => {
482
+ u(!0, "loadingAudio");
483
+ }, [u]), rr = t(() => {
440
484
  i();
441
- }, [i]), rr = u(() => {
442
- const e = v.current === "url" || k.current.length === 0;
443
- if (d(), w.current = !1, e) {
444
- O("url-ended");
485
+ }, [i]), kr = t(() => {
486
+ const e = F.current === "url" || v.current.length === 0;
487
+ if (p(), E.current = !1, e) {
488
+ X("url-ended");
445
489
  return;
446
490
  }
447
- Re();
448
- }, [O, Re, d]), tr = u(() => {
449
- d(), i(), f(!1), n(!1);
450
- }, [d, i, n]), nr = u(
491
+ er();
492
+ }, [X, er, p]), Mr = t(() => {
493
+ p(), i(), f(!1), u(!1);
494
+ }, [p, i, u]), Lr = t(
451
495
  (e) => {
452
- de?.(e), $(!1);
496
+ Ae?.(e), z(!1);
453
497
  },
454
- [de]
455
- );
456
- return x(() => {
457
- J?.(ue.current);
458
- }, [J]), /* @__PURE__ */ t.jsxs("div", { className: ve("slide-player", U), ...Oe, children: [
459
- /* @__PURE__ */ t.jsx(
460
- "audio",
461
- {
462
- ref: h,
463
- preload: "auto",
464
- playsInline: !0,
465
- onLoadStart: Ie,
466
- onLoadedMetadata: Je,
467
- onCanPlay: Ge,
468
- onPlay: Xe,
469
- onPause: Ye,
470
- onWaiting: er,
471
- onSeeking: Te,
472
- onSeeked: Te,
473
- onTimeUpdate: Qe,
474
- onEnded: rr,
475
- onError: tr
476
- }
477
- ),
478
- te ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
479
- /* @__PURE__ */ t.jsx(
480
- ar,
481
- {
482
- container: Ve,
483
- labels: {
484
- fullscreen: V.fullscreenLabel,
485
- nonFullscreen: V.nonFullscreenLabel,
486
- screen: V.screenLabel,
487
- subtitle: V.subtitleLabel,
488
- subtitleToggle: V.subtitleToggleAriaLabel,
489
- title: V.settingsTitle
490
- },
491
- isSubtitleEnabled: re,
492
- onClose: () => $(!1),
493
- onOpenChange: $,
494
- onSubtitleToggle: oe ?? (() => {
495
- }),
496
- onViewModeChange: nr,
497
- open: xe,
498
- viewMode: Pe
499
- }
498
+ [Ae]
499
+ ), _e = t(() => {
500
+ if (N) {
501
+ const r = !O;
502
+ return $(r), Re?.(r), !0;
503
+ }
504
+ const e = y.current;
505
+ return K || !e || !d ? !1 : o.current !== null ? oe ? ($(!1), s.current = !1, b.current = !0, o.current = null, _.current = !1, f(!1), u(!1), e.pause(), !0) : ($(!0), P.current = "manual", b.current = !1, s.current = !0, u(!0, "waitingForMoreAudio"), !0) : !e.src && M.length > 0 ? ($(!0), P.current = "manual", b.current = !1, C(
506
+ Math.min(
507
+ R.current,
508
+ M.length - 1
500
509
  ),
501
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__controls", style: qe, children: [
502
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
503
- /* @__PURE__ */ t.jsx(
504
- "button",
510
+ "toggle"
511
+ ), !0) : e.paused ? ($(!0), P.current = "manual", b.current = !1, s.current = !0, L("toggle-resume"), !0) : ($(!1), s.current = !1, b.current = !0, e.pause(), !0);
512
+ }, [
513
+ d,
514
+ M.length,
515
+ O,
516
+ K,
517
+ oe,
518
+ Re,
519
+ C,
520
+ L,
521
+ u,
522
+ $,
523
+ N
524
+ ]);
525
+ m(() => {
526
+ if (T)
527
+ return Pr(V);
528
+ }, [V, T]);
529
+ const we = G(
530
+ () => ({
531
+ fullscreen: () => I ? (I(), !0) : !1,
532
+ interaction: () => se ? (me && se(), !0) : !1,
533
+ next: () => ae ? (ye || ae(te()), !0) : !1,
534
+ previous: () => ue ? (he || ue(te()), !0) : !1,
535
+ subtitle: () => Q ? (Q(), !0) : !1,
536
+ togglePlayback: () => (_e(), !0)
537
+ }),
538
+ [
539
+ te,
540
+ me,
541
+ ye,
542
+ I,
543
+ se,
544
+ ae,
545
+ ue,
546
+ Q,
547
+ he,
548
+ _e
549
+ ]
550
+ ), tr = c(we);
551
+ return m(() => {
552
+ tr.current = we;
553
+ }, [we]), m(() => {
554
+ if (!T || typeof document > "u")
555
+ return;
556
+ const e = (r) => {
557
+ if (!Wr(V))
558
+ return;
559
+ const a = Or(r);
560
+ if (!a || Br(r, a))
561
+ return;
562
+ let x = !1;
563
+ const A = tr.current[a];
564
+ x = A(), x && r.preventDefault();
565
+ };
566
+ return document.addEventListener("keydown", e), () => {
567
+ document.removeEventListener("keydown", e);
568
+ };
569
+ }, [V, T]), m(() => {
570
+ ne?.(Se.current);
571
+ }, [ne]), /* @__PURE__ */ n.jsxs(
572
+ "div",
573
+ {
574
+ ...ir,
575
+ "data-slide-player-shortcut-owner": V,
576
+ className: ur("slide-player", j),
577
+ onFocusCapture: hr,
578
+ onPointerDown: pr,
579
+ children: [
580
+ /* @__PURE__ */ n.jsx(
581
+ "audio",
582
+ {
583
+ ref: y,
584
+ preload: "auto",
585
+ playsInline: !0,
586
+ onLoadStart: wr,
587
+ onLoadedMetadata: gr,
588
+ onCanPlay: Sr,
589
+ onPlay: yr,
590
+ onPause: br,
591
+ onWaiting: xr,
592
+ onSeeking: rr,
593
+ onSeeked: rr,
594
+ onTimeUpdate: _r,
595
+ onEnded: kr,
596
+ onError: Mr
597
+ }
598
+ ),
599
+ be ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
600
+ /* @__PURE__ */ n.jsx(
601
+ Nr,
505
602
  {
506
- "aria-expanded": xe,
507
- "aria-haspopup": "dialog",
508
- "aria-label": "More options",
509
- className: "slide-player__action slide-player__action--mobile-more",
510
- onClick: () => {
511
- $((e) => !e);
603
+ container: cr,
604
+ labels: {
605
+ closeSettings: l.closeSettingsLabel,
606
+ fullscreen: l.fullscreenLabel,
607
+ nonFullscreen: l.nonFullscreenLabel,
608
+ screen: l.screenLabel,
609
+ screenMode: l.screenModeLabel,
610
+ subtitle: l.subtitleLabel,
611
+ subtitleToggle: l.subtitleToggleAriaLabel,
612
+ title: l.settingsTitle
512
613
  },
513
- type: "button",
514
- children: /* @__PURE__ */ t.jsx(
515
- pr,
516
- {
517
- className: "slide-player__icon",
518
- strokeWidth: 2.25
519
- }
520
- )
614
+ isSubtitleEnabled: pe,
615
+ onClose: () => z(!1),
616
+ onOpenChange: z,
617
+ onSubtitleToggle: Q ?? (() => {
618
+ }),
619
+ onViewModeChange: Lr,
620
+ open: We,
621
+ viewMode: lr
521
622
  }
522
623
  ),
523
- /* @__PURE__ */ t.jsx("button", { "aria-label": "Volume", className: "hidden", type: "button", children: /* @__PURE__ */ t.jsx(hr, { className: "slide-player__icon", strokeWidth: 2.25 }) }),
524
- /* @__PURE__ */ t.jsx(
525
- "button",
526
- {
527
- "aria-label": V.subtitleToggleAriaLabel,
528
- "aria-pressed": re,
529
- className: "slide-player__action slide-player__action--subtitle",
530
- onClick: oe,
531
- type: "button",
532
- children: re ? /* @__PURE__ */ t.jsx(yr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ t.jsx(
533
- gr,
624
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__controls", style: dr, children: [
625
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
626
+ /* @__PURE__ */ n.jsx(
627
+ "button",
534
628
  {
535
- className: "slide-player__icon",
536
- strokeWidth: 2.25
629
+ "aria-expanded": We,
630
+ "aria-haspopup": "dialog",
631
+ "aria-label": l.moreOptionsAriaLabel,
632
+ className: "slide-player__action slide-player__action--mobile-more",
633
+ onClick: () => {
634
+ z((e) => !e);
635
+ },
636
+ type: "button",
637
+ children: /* @__PURE__ */ n.jsx(
638
+ Zr,
639
+ {
640
+ className: "slide-player__icon",
641
+ strokeWidth: 2.25
642
+ }
643
+ )
537
644
  }
538
- )
539
- }
540
- ),
541
- /* @__PURE__ */ t.jsx(
542
- "button",
543
- {
544
- "aria-label": "Rewind",
545
- className: "slide-player__action slide-player__action--prev",
546
- disabled: He,
547
- onClick: () => {
548
- Ue?.(Ae());
549
- },
550
- type: "button",
551
- children: /* @__PURE__ */ t.jsx(_r, { className: "slide-player__icon", strokeWidth: 2.25 })
552
- }
553
- ),
554
- /* @__PURE__ */ t.jsx(
555
- "button",
556
- {
557
- "aria-label": De,
558
- className: "slide-player__toggle slide-player__toggle--playback",
559
- onClick: () => {
560
- if (z) {
561
- const r = !q;
562
- H(r), Be?.(r);
563
- return;
645
+ ),
646
+ /* @__PURE__ */ n.jsx(
647
+ "button",
648
+ {
649
+ "aria-label": l.volumeAriaLabel,
650
+ className: "hidden",
651
+ type: "button",
652
+ children: /* @__PURE__ */ n.jsx(qr, { className: "slide-player__icon", strokeWidth: 2.25 })
564
653
  }
565
- const e = h.current;
566
- if (!(j || !e || !o)) {
567
- if (c.current !== null) {
568
- if (Y) {
569
- H(!1), s.current = !1, y.current = !0, c.current = null, g.current = !1, f(!1), n(!1), e.pause();
570
- return;
654
+ ),
655
+ /* @__PURE__ */ n.jsx(
656
+ "button",
657
+ {
658
+ "aria-label": l.subtitleToggleAriaLabel,
659
+ "aria-keyshortcuts": $e.ariaKeyShortcuts,
660
+ "aria-pressed": pe,
661
+ className: "slide-player__action slide-player__action--subtitle",
662
+ onClick: Q,
663
+ title: $e.title,
664
+ type: "button",
665
+ children: pe ? /* @__PURE__ */ n.jsx(zr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ n.jsx(
666
+ Yr,
667
+ {
668
+ className: "slide-player__icon",
669
+ strokeWidth: 2.25
571
670
  }
572
- H(!0), L.current = "manual", y.current = !1, s.current = !0, n(!0, "waitingForMoreAudio");
573
- return;
574
- }
575
- if (!e.src && A.length > 0) {
576
- H(!0), L.current = "manual", y.current = !1, E(
577
- Math.min(
578
- S.current,
579
- A.length - 1
580
- ),
581
- "toggle"
582
- );
583
- return;
584
- }
585
- if (e.paused) {
586
- H(!0), L.current = "manual", y.current = !1, s.current = !0, M("toggle-resume");
587
- return;
588
- }
589
- H(!1), s.current = !1, y.current = !0, e.pause();
671
+ )
590
672
  }
591
- },
592
- type: "button",
593
- children: ze ? /* @__PURE__ */ t.jsx(Ar, {}) : /* @__PURE__ */ t.jsx(Mr, {})
594
- }
595
- ),
596
- /* @__PURE__ */ t.jsx(
597
- "button",
598
- {
599
- "aria-label": "Forward",
600
- className: "slide-player__action slide-player__action--next",
601
- disabled: Ke,
602
- onClick: () => {
603
- We?.(Ae());
604
- },
605
- type: "button",
606
- children: /* @__PURE__ */ t.jsx(br, { className: "slide-player__icon", strokeWidth: 2.25 })
607
- }
608
- ),
609
- ie ? /* @__PURE__ */ t.jsx(
610
- "button",
611
- {
612
- "aria-label": fe ? "Exit fullscreen" : "Enter fullscreen",
613
- className: "slide-player__action slide-player__action--fullscreen",
614
- onClick: ie,
615
- type: "button",
616
- children: fe ? /* @__PURE__ */ t.jsx(
617
- xr,
673
+ ),
674
+ /* @__PURE__ */ n.jsx(
675
+ "button",
618
676
  {
619
- className: "slide-player__icon",
620
- strokeWidth: 2.25
677
+ "aria-keyshortcuts": Ze.ariaKeyShortcuts,
678
+ "aria-label": l.previousLabel,
679
+ className: "slide-player__action slide-player__action--prev",
680
+ disabled: he,
681
+ onClick: () => {
682
+ ue?.(te());
683
+ },
684
+ title: Ze.title,
685
+ type: "button",
686
+ children: /* @__PURE__ */ n.jsx(Dr, { className: "slide-player__icon", strokeWidth: 2.25 })
621
687
  }
622
- ) : /* @__PURE__ */ t.jsx(
623
- Sr,
688
+ ),
689
+ /* @__PURE__ */ n.jsx(
690
+ "button",
624
691
  {
625
- className: "slide-player__icon",
626
- strokeWidth: 2.25
692
+ "aria-label": Ve,
693
+ "aria-keyshortcuts": qe.ariaKeyShortcuts,
694
+ className: "slide-player__toggle slide-player__toggle--playback",
695
+ onClick: () => {
696
+ _e();
697
+ },
698
+ title: qe.title,
699
+ type: "button",
700
+ children: mr ? /* @__PURE__ */ n.jsx(Ir, {}) : /* @__PURE__ */ n.jsx(et, {})
627
701
  }
628
- )
629
- }
630
- ) : null
631
- ] }),
632
- /* @__PURE__ */ t.jsx("div", { className: "slide-player__separator" }),
633
- /* @__PURE__ */ t.jsxs("div", { className: "slide-player__group", children: [
634
- Se.map((e, r) => /* @__PURE__ */ t.jsx(sr.Fragment, { children: e }, `custom-action-${r}`)),
635
- /* @__PURE__ */ t.jsx(
636
- "button",
637
- {
638
- "aria-label": "Notes",
639
- className: ve(
640
- "slide-player__action slide-player__action--notes",
641
- D && "slide-player__action--active"
642
702
  ),
643
- disabled: !$e,
644
- onClick: Ze,
645
- type: "button",
646
- children: /* @__PURE__ */ t.jsx(
647
- wr,
703
+ /* @__PURE__ */ n.jsx(
704
+ "button",
648
705
  {
649
- className: "slide-player__icon",
650
- strokeWidth: 2.25
706
+ "aria-keyshortcuts": ze.ariaKeyShortcuts,
707
+ "aria-label": l.nextLabel,
708
+ className: "slide-player__action slide-player__action--next",
709
+ disabled: ye,
710
+ onClick: () => {
711
+ ae?.(te());
712
+ },
713
+ title: ze.title,
714
+ type: "button",
715
+ children: /* @__PURE__ */ n.jsx(Xr, { className: "slide-player__icon", strokeWidth: 2.25 })
716
+ }
717
+ ),
718
+ I ? /* @__PURE__ */ n.jsx(
719
+ "button",
720
+ {
721
+ "aria-label": He,
722
+ "aria-keyshortcuts": Ye.ariaKeyShortcuts,
723
+ className: "slide-player__action slide-player__action--fullscreen",
724
+ onClick: I,
725
+ title: Ye.title,
726
+ type: "button",
727
+ children: Le ? /* @__PURE__ */ n.jsx(
728
+ Gr,
729
+ {
730
+ className: "slide-player__icon",
731
+ strokeWidth: 2.25
732
+ }
733
+ ) : /* @__PURE__ */ n.jsx(
734
+ Jr,
735
+ {
736
+ className: "slide-player__icon",
737
+ strokeWidth: 2.25
738
+ }
739
+ )
740
+ }
741
+ ) : null
742
+ ] }),
743
+ /* @__PURE__ */ n.jsx("div", { className: "slide-player__separator" }),
744
+ /* @__PURE__ */ n.jsxs("div", { className: "slide-player__group", children: [
745
+ Oe.map((e, r) => /* @__PURE__ */ n.jsx(jr.Fragment, { children: e }, `custom-action-${r}`)),
746
+ /* @__PURE__ */ n.jsx(
747
+ "button",
748
+ {
749
+ "aria-label": l.notesLabel,
750
+ "aria-keyshortcuts": De.ariaKeyShortcuts,
751
+ className: ur(
752
+ "slide-player__action slide-player__action--notes",
753
+ ee && "slide-player__action--active"
754
+ ),
755
+ disabled: !me,
756
+ onClick: se,
757
+ title: De.title,
758
+ type: "button",
759
+ children: /* @__PURE__ */ n.jsx(
760
+ Qr,
761
+ {
762
+ className: "slide-player__icon",
763
+ strokeWidth: 2.25
764
+ }
765
+ )
651
766
  }
652
767
  )
653
- }
654
- )
655
- ] })
656
- ] })
657
- ] }) : null
658
- ] });
659
- }, kr = lr(jr);
660
- kr.displayName = "Player";
768
+ ] })
769
+ ] })
770
+ ] }) : null
771
+ ]
772
+ }
773
+ );
774
+ }, nt = Rr(tt);
775
+ nt.displayName = "Player";
661
776
  export {
662
- kr as default
777
+ nt as default
663
778
  };
664
779
  //# sourceMappingURL=Player.es.js.map