markdown-flow-ui 0.1.114 → 0.1.115-beta.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 (55) hide show
  1. package/dist/_virtual/index.cjs10.js +1 -1
  2. package/dist/_virtual/index.cjs7.js +1 -1
  3. package/dist/_virtual/index.cjs8.js +1 -1
  4. package/dist/_virtual/index.cjs9.js +1 -1
  5. package/dist/_virtual/index.es10.js +2 -2
  6. package/dist/_virtual/index.es7.js +2 -3
  7. package/dist/_virtual/index.es7.js.map +1 -1
  8. package/dist/_virtual/index.es8.js +3 -2
  9. package/dist/_virtual/index.es8.js.map +1 -1
  10. package/dist/_virtual/index.es9.js +2 -2
  11. package/dist/assets/markdown-flow-ui.css +1 -1
  12. package/dist/components/Slide/Player.cjs.js +1 -1
  13. package/dist/components/Slide/Player.cjs.js.map +1 -1
  14. package/dist/components/Slide/Player.d.ts +5 -1
  15. package/dist/components/Slide/Player.es.js +230 -217
  16. package/dist/components/Slide/Player.es.js.map +1 -1
  17. package/dist/components/Slide/Slide.cjs.js +1 -1
  18. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  19. package/dist/components/Slide/Slide.d.ts +4 -2
  20. package/dist/components/Slide/Slide.es.js +453 -456
  21. package/dist/components/Slide/Slide.es.js.map +1 -1
  22. package/dist/components/Slide/Slide.stories.d.ts +1 -0
  23. package/dist/components/Slide/constants.cjs.js +1 -1
  24. package/dist/components/Slide/constants.cjs.js.map +1 -1
  25. package/dist/components/Slide/constants.es.js +2 -3
  26. package/dist/components/Slide/constants.es.js.map +1 -1
  27. package/dist/components/Slide/useSlide.cjs.js +1 -1
  28. package/dist/components/Slide/useSlide.cjs.js.map +1 -1
  29. package/dist/components/Slide/useSlide.d.ts +5 -0
  30. package/dist/components/Slide/useSlide.es.js +84 -77
  31. package/dist/components/Slide/useSlide.es.js.map +1 -1
  32. package/dist/components/Slide/useSlide.test.d.ts +1 -0
  33. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  34. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.cjs.js.map +1 -1
  35. package/dist/markdown-flow-ui/node_modules/.pnpm/@braintree_sanitize-url@7.1.1/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  36. package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +1 -1
  37. package/dist/markdown-flow-ui/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +1 -1
  38. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.cjs.js +1 -1
  39. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-YG6GDRKO.es.js +1 -1
  40. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.cjs.js +1 -1
  41. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.es.js +1 -1
  42. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.cjs.js +1 -1
  43. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.es.js +1 -1
  44. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.cjs.js +1 -1
  45. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-LVOFAZNH.es.js +1 -1
  46. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.cjs.js +1 -1
  47. package/dist/markdown-flow-ui/node_modules/.pnpm/mermaid@11.12.1/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.es.js +1 -1
  48. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.cjs.js +1 -1
  49. package/dist/markdown-flow-ui/node_modules/.pnpm/style-to-object@1.0.11/node_modules/style-to-object/cjs/index.es.js +1 -1
  50. package/dist/markdown-flow-ui-lib.css +1 -1
  51. package/package.json +1 -1
  52. package/dist/components/Slide/SlideFullscreenHint.cjs.js +0 -2
  53. package/dist/components/Slide/SlideFullscreenHint.cjs.js.map +0 -1
  54. package/dist/components/Slide/SlideFullscreenHint.es.js +0 -42
  55. package/dist/components/Slide/SlideFullscreenHint.es.js.map +0 -1
@@ -1,26 +1,26 @@
1
1
  import { j as r } from "../../_virtual/jsx-runtime.es.js";
2
- import Je, { memo as Qe, useRef as c, useState as ke, useMemo as O, useEffect as b, useCallback as l } from "react";
3
- import { cn as Ae } from "../../lib/utils.es.js";
4
- import Ie from "./MobilePlayerSettingsSheet.es.js";
5
- import { DEFAULT_SLIDE_PLAYER_TEXTS as er } from "./constants.es.js";
6
- import { DEFAULT_MOBILE_VIEW_MODE as rr } from "./utils/mobileScreenMode.es.js";
7
- import { toPlayerCustomActionList as tr } from "./utils/playerCustomActions.es.js";
2
+ import Ie, { memo as er, useRef as c, useState as je, useMemo as O, useEffect as x, useCallback as u } from "react";
3
+ import { cn as ke } from "../../lib/utils.es.js";
4
+ import rr from "./MobilePlayerSettingsSheet.es.js";
5
+ import { DEFAULT_SLIDE_PLAYER_TEXTS as tr } from "./constants.es.js";
6
+ import { DEFAULT_MOBILE_VIEW_MODE as nr } from "./utils/mobileScreenMode.es.js";
7
+ import { toPlayerCustomActionList as ur } from "./utils/playerCustomActions.es.js";
8
8
  /* empty css */
9
- import nr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
9
+ import lr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
10
10
  import sr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
11
- import lr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.es.js";
12
- import ur from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
13
- import ar from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
14
- import cr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
15
- import ir from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
16
- import or from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js";
17
- import fr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
11
+ import ar from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions.es.js";
12
+ import cr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/captions-off.es.js";
13
+ import ir from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-ccw.es.js";
14
+ import or from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.es.js";
15
+ import fr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/scan-line.es.js";
16
+ import dr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/maximize.es.js";
17
+ import mr from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/file-pen-line.es.js";
18
18
  const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
19
19
  if (typeof window > "u" || !R || Ee.has(R))
20
20
  return;
21
- const v = window.document.createElement("audio");
22
- v.preload = "auto", v.setAttribute("playsinline", "true"), v.src = R, v.load(), Ee.set(R, v);
23
- }, dr = () => /* @__PURE__ */ r.jsxs(
21
+ const L = window.document.createElement("audio");
22
+ L.preload = "auto", L.setAttribute("playsinline", "true"), L.src = R, L.load(), Ee.set(R, L);
23
+ }, pr = () => /* @__PURE__ */ r.jsxs(
24
24
  "svg",
25
25
  {
26
26
  xmlns: "http://www.w3.org/2000/svg",
@@ -39,7 +39,7 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
39
39
  /* @__PURE__ */ r.jsx("path", { d: "M12 10H16V24H12V10ZM18 10H22V24H18V10Z", fill: "white" })
40
40
  ]
41
41
  }
42
- ), mr = () => /* @__PURE__ */ r.jsxs(
42
+ ), hr = () => /* @__PURE__ */ r.jsxs(
43
43
  "svg",
44
44
  {
45
45
  xmlns: "http://www.w3.org/2000/svg",
@@ -58,272 +58,275 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
58
58
  /* @__PURE__ */ r.jsx("path", { d: "M13.3333 10L23.3333 16.6667L13.3333 23.3333V10Z", fill: "white" })
59
59
  ]
60
60
  }
61
- ), pr = ({
61
+ ), gr = ({
62
62
  audioList: R = [],
63
- className: v,
63
+ className: L,
64
64
  currentAudioIndex: m = -1,
65
- defaultPlaying: j = !0,
66
- isPlaybackPaused: L = !1,
65
+ defaultPlaying: A = !0,
66
+ isPlaybackPaused: v = !1,
67
67
  isAutoAdvanceEnabled: Y = !0,
68
68
  useAutoAdvanceToggle: G = !1,
69
69
  onLoadingChange: te,
70
70
  onPlaybackStarted: ne,
71
71
  onPlaybackTimeChange: q,
72
- onSubtitleToggle: se,
72
+ onSubtitleToggle: ue,
73
73
  onPrev: Re,
74
74
  onNext: Te,
75
75
  onFullscreen: le,
76
- isFullscreen: ue = !1,
77
- mobileViewMode: Ce = rr,
78
- settingsPortalContainer: ve,
76
+ isFullscreen: se = !1,
77
+ mobileViewMode: Ce = nr,
78
+ settingsPortalContainer: Le,
79
79
  onMobileViewModeChange: ae,
80
80
  onEnded: ce,
81
- onAutoAdvanceToggle: Le,
82
- onInteractionToggle: Ue,
83
- hasInteraction: Fe = !1,
81
+ onAutoAdvanceToggle: ve,
82
+ onInteractionToggle: Fe,
83
+ hasInteraction: Ue = !1,
84
84
  isInteractionOpen: Z = !1,
85
85
  isSubtitleEnabled: J = !0,
86
- prevDisabled: Pe = !1,
87
- nextDisabled: We = !1,
86
+ prevDisabled: We = !1,
87
+ nextDisabled: Pe = !1,
88
88
  showControls: Q = !0,
89
89
  customActions: ie,
90
90
  customActionContext: oe,
91
91
  texts: fe,
92
92
  ...Ve
93
93
  }) => {
94
- const h = c(null), de = c(Z), M = c(null), me = c(null), x = c(0), a = c(null), z = c(void 0), k = c([]), $ = c(!1), pe = c(!1), y = c(!1), U = c(null), S = c(!1), s = c(!1), p = c(null), w = c(!1), F = c(null), I = c(0), T = c("unknown"), [ee, i] = ke(j), [he, B] = ke(!1), f = m >= 0 ? R[m] : void 0, K = f?.audioUrl, A = O(
94
+ const h = c(null), de = c(Z), M = c(null), me = c(null), S = c(0), a = c(null), z = c(void 0), j = c([]), $ = c(!1), pe = c(!1), g = c(!1), F = c(null), y = c(!1), l = c(!1), p = c(null), w = c(!1), U = c(null), I = c(0), T = c("unknown"), [ee, i] = je(A), [he, B] = je(!1), f = m >= 0 ? R[m] : void 0, K = f?.audioUrl, k = O(
95
95
  () => [...f?.audioSegments ?? []].sort(
96
- (e, t) => e.segment_index - t.segment_index
96
+ (e, n) => e.segment_index - n.segment_index
97
97
  ),
98
98
  [f?.audioSegments]
99
- ), ye = O(
100
- () => tr(ie, oe),
99
+ ), ge = O(
100
+ () => ur(ie, oe),
101
101
  [oe, ie]
102
- ), ge = ye.length + 5, Be = O(
102
+ ), ye = ge.length + 5, Be = O(
103
103
  () => ({
104
- "--slide-player-mobile-control-count": String(ge)
104
+ "--slide-player-mobile-control-count": String(ye)
105
105
  }),
106
- [ge]
107
- ), P = O(
106
+ [ye]
107
+ ), W = O(
108
108
  () => ({
109
- ...er,
109
+ ...tr,
110
110
  ...fe
111
111
  }),
112
112
  [fe]
113
113
  ), re = O(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), Ke = G ? Y : ee, Ze = G ? Y ? "Pause autoplay" : "Play autoplay" : ee ? "Pause" : "Play";
114
- b(() => {
114
+ x(() => {
115
115
  z.current = f;
116
- }, [f]), b(() => {
116
+ }, [f]), x(() => {
117
117
  Q || B(!1);
118
- }, [Q]), b(() => {
118
+ }, [Q]), x(() => {
119
119
  !de.current && Z && B(!1), de.current = Z;
120
- }, [Z]), b(() => {
121
- k.current = A;
122
- }, [A]), b(() => {
123
- const e = f?.audioUrl, t = m >= 0 ? R[m + 1]?.audioUrl : void 0;
124
- Ne(e), Ne(t);
120
+ }, [Z]), x(() => {
121
+ j.current = k;
122
+ }, [k]), x(() => {
123
+ const e = f?.audioUrl, n = m >= 0 ? R[m + 1]?.audioUrl : void 0;
124
+ Ne(e), Ne(n);
125
125
  }, [R, f?.audioUrl, m]);
126
- const n = l(
127
- (e) => {
128
- pe.current !== e && (pe.current = e, te?.(e));
126
+ const t = u(
127
+ (e, n = null) => {
128
+ pe.current === e && (!e || n === null) || (pe.current = e, te?.({
129
+ loading: e,
130
+ reason: e ? n : null
131
+ }));
129
132
  },
130
133
  [te]
131
- ), _e = l((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), C = l(() => j && !L && !y.current && T.current !== "blocked", [j, L]), be = l((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), xe = l(() => {
134
+ ), _e = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), C = u(() => A && !v && !g.current && T.current !== "blocked", [A, v]), be = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), xe = u(() => {
132
135
  const e = a.current;
133
- return e == null || e <= 0 ? 0 : k.current.slice(0, e).reduce(
134
- (t, u) => t + Math.max(Number(u.duration_ms ?? 0), 0),
136
+ return e == null || e <= 0 ? 0 : j.current.slice(0, e).reduce(
137
+ (n, s) => n + Math.max(Number(s.duration_ms ?? 0), 0),
135
138
  0
136
139
  ) / 1e3;
137
- }, []), W = l((e) => e <= 0 ? 0 : k.current.slice(0, e).reduce(
138
- (t, u) => t + Math.max(Number(u.duration_ms ?? 0), 0),
140
+ }, []), P = u((e) => e <= 0 ? 0 : j.current.slice(0, e).reduce(
141
+ (n, s) => n + Math.max(Number(s.duration_ms ?? 0), 0),
139
142
  0
140
- ), []), Se = l(() => {
143
+ ), []), Se = u(() => {
141
144
  const e = h.current;
142
- return e ? U.current === "segment" ? W(x.current) + Math.max(e.currentTime, 0) * 1e3 : p.current !== null && e.readyState === 0 ? p.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : a.current != null ? W(a.current) : 0;
143
- }, [W]), g = l(
145
+ return e ? F.current === "segment" ? P(S.current) + Math.max(e.currentTime, 0) * 1e3 : p.current !== null && e.readyState === 0 ? p.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : a.current != null ? P(a.current) : 0;
146
+ }, [P]), _ = u(
144
147
  (e) => {
145
- const t = Math.max(e, 0);
146
- I.current !== t && (I.current = t, q?.(t));
148
+ const n = Math.max(e, 0);
149
+ I.current !== n && (I.current = n, q?.(n));
147
150
  },
148
151
  [q]
149
- ), o = l(() => {
150
- g(Se());
151
- }, [Se, g]), d = l(() => {
152
- typeof window > "u" || F.current === null || (window.cancelAnimationFrame(F.current), F.current = null);
153
- }, []), we = l(() => {
154
- if (typeof window > "u" || F.current !== null)
152
+ ), o = u(() => {
153
+ _(Se());
154
+ }, [Se, _]), d = u(() => {
155
+ typeof window > "u" || U.current === null || (window.cancelAnimationFrame(U.current), U.current = null);
156
+ }, []), we = u(() => {
157
+ if (typeof window > "u" || U.current !== null)
155
158
  return;
156
159
  const e = () => {
157
160
  o();
158
- const t = h.current;
159
- if (!t || t.paused || t.ended) {
160
- F.current = null;
161
+ const n = h.current;
162
+ if (!n || n.paused || n.ended) {
163
+ U.current = null;
161
164
  return;
162
165
  }
163
- F.current = window.requestAnimationFrame(e);
166
+ U.current = window.requestAnimationFrame(e);
164
167
  };
165
- F.current = window.requestAnimationFrame(e);
166
- }, [o]), H = l(() => {
168
+ U.current = window.requestAnimationFrame(e);
169
+ }, [o]), H = u(() => {
167
170
  const e = h.current;
168
- e && (d(), s.current = !1, y.current = !1, $.current = !1, U.current = null, p.current = null, S.current = !1, w.current = !1, e.pause(), e.removeAttribute("src"), e.load(), M.current = null, x.current = 0, a.current = null, g(0), i(!1), n(!1));
169
- }, [g, d, n]), _ = l(
171
+ e && (d(), l.current = !1, g.current = !1, $.current = !1, F.current = null, p.current = null, y.current = !1, w.current = !1, e.pause(), e.removeAttribute("src"), e.load(), M.current = null, S.current = 0, a.current = null, _(0), i(!1), t(!1));
172
+ }, [_, d, t]), b = u(
170
173
  (e) => {
171
- const t = h.current;
172
- if (!t)
174
+ const n = h.current;
175
+ if (!n)
173
176
  return !1;
174
- const u = t.play();
175
- return u && typeof u.then == "function" && u.then(() => {
176
- T.current === "unknown" && (T.current = "auto"), s.current = !1, w.current = !1;
177
+ const s = n.play();
178
+ return s && typeof s.then == "function" && s.then(() => {
179
+ T.current === "unknown" && (T.current = "auto"), l.current = !1, w.current = !1;
177
180
  }).catch((V) => {
178
- T.current === "unknown" && _e(V) && (T.current = "blocked", s.current = !1, n(!1)), w.current = !1, i(!1);
181
+ T.current === "unknown" && _e(V) && (T.current = "blocked", l.current = !1, t(!1)), w.current = !1, i(!1);
179
182
  }), !0;
180
183
  },
181
- [_e, n]
182
- ), E = l(
183
- (e, t) => {
184
- const u = h.current, V = k.current[e];
185
- if (!u || !V)
184
+ [_e, t]
185
+ ), E = u(
186
+ (e, n) => {
187
+ const s = h.current, V = j.current[e];
188
+ if (!s || !V)
186
189
  return !1;
187
190
  const N = be(V.audio_data);
188
- x.current = e, a.current = null, S.current = !1, w.current = !0, g(W(e));
191
+ S.current = e, a.current = null, y.current = !1, w.current = !0, _(P(e));
189
192
  const X = C();
190
- s.current = X, n(!1);
191
- const Ge = M.current !== N;
192
- return U.current = "segment", Ge && (u.pause(), u.removeAttribute("src"), u.load(), M.current = N, u.src = N, u.load()), p.current = 0, u.readyState > 0 && (u.currentTime = 0, p.current = null), X ? _(`start-segment:${t}`) : (s.current = !1, w.current = !1, u.pause(), i(!1), !0);
193
+ l.current = X, t(!1);
194
+ const Qe = M.current !== N;
195
+ return F.current = "segment", Qe && (s.pause(), s.removeAttribute("src"), s.load(), M.current = N, s.src = N, s.load()), p.current = 0, s.readyState > 0 && (s.currentTime = 0, p.current = null), X ? b(`start-segment:${n}`) : (l.current = !1, w.current = !1, s.pause(), i(!1), !0);
193
196
  },
194
197
  [
195
198
  C,
196
199
  be,
197
- W,
198
- g,
200
+ P,
199
201
  _,
200
- n
202
+ b,
203
+ t
201
204
  ]
202
- ), D = l(
205
+ ), D = u(
203
206
  (e) => {
204
- d(), s.current = !1, S.current = !1, w.current = !1, o(), i(!1), n(!1), m >= 0 && ce?.(m);
207
+ d(), l.current = !1, y.current = !1, w.current = !1, o(), i(!1), t(!1), m >= 0 && ce?.(m);
205
208
  },
206
209
  [
207
210
  m,
208
211
  ce,
209
212
  d,
210
213
  o,
211
- n
214
+ t
212
215
  ]
213
- ), je = l(() => {
214
- const e = x.current + 1, t = k.current, u = t[e], V = z.current, N = t.some((X) => X.is_final);
215
- if (u) {
216
+ ), Ae = u(() => {
217
+ const e = S.current + 1, n = j.current, s = n[e], V = z.current, N = n.some((X) => X.is_final);
218
+ if (s) {
216
219
  E(e, "ended");
217
220
  return;
218
221
  }
219
222
  if (V?.isAudioStreaming || !N) {
220
- x.current = e, a.current = e, S.current = !0, s.current = j, g(W(e)), i(!1), n(!0);
223
+ S.current = e, a.current = e, y.current = !0, l.current = A, _(P(e)), i(!1), t(!0, "waitingForMoreAudio");
221
224
  return;
222
225
  }
223
226
  D("segments-completed");
224
227
  }, [
225
- j,
228
+ A,
226
229
  D,
227
- W,
228
- g,
230
+ P,
231
+ _,
229
232
  E,
230
- n
233
+ t
231
234
  ]);
232
- b(() => {
235
+ x(() => {
233
236
  if (me.current === re)
234
237
  return;
235
- me.current = re, x.current = 0, a.current = null, S.current = !1, y.current = !1, $.current = !1, s.current = !1, w.current = !1, U.current = null, M.current = null, d(), g(0), n(!1);
238
+ me.current = re, S.current = 0, a.current = null, y.current = !1, g.current = !1, $.current = !1, l.current = !1, w.current = !1, F.current = null, M.current = null, d(), _(0), t(!1);
236
239
  const e = h.current;
237
240
  e && (e.pause(), e.removeAttribute("src"), e.load(), i(!1));
238
241
  }, [
239
242
  m,
240
243
  re,
241
- A.length,
244
+ k.length,
242
245
  K,
243
- g,
246
+ _,
244
247
  d,
245
- n
246
- ]), b(() => {
248
+ t
249
+ ]), x(() => {
247
250
  const e = h.current;
248
251
  if (e) {
249
- if (L) {
250
- $.current = !!(z.current && !y.current && (!e.paused || s.current || a.current !== null)), s.current = !1, n(!1), e.pause(), i(!1);
252
+ if (v) {
253
+ $.current = !!(z.current && !g.current && (!e.paused || l.current || a.current !== null)), l.current = !1, t(!1), e.pause(), i(!1);
251
254
  return;
252
255
  }
253
- if (!(!$.current || !z.current || y.current)) {
256
+ if (!(!$.current || !z.current || g.current)) {
254
257
  if ($.current = !1, a.current !== null) {
255
- if (a.current < k.current.length) {
258
+ if (a.current < j.current.length) {
256
259
  E(a.current, "external-resume");
257
260
  return;
258
261
  }
259
- s.current = !0, n(!0);
262
+ l.current = !0, t(!0, "waitingForMoreAudio");
260
263
  return;
261
264
  }
262
- if (!M.current && k.current.length > 0) {
265
+ if (!M.current && j.current.length > 0) {
263
266
  E(
264
267
  Math.min(
265
- x.current,
266
- k.current.length - 1
268
+ S.current,
269
+ j.current.length - 1
267
270
  ),
268
271
  "external-resume-init"
269
272
  );
270
273
  return;
271
274
  }
272
- e.paused && (s.current = !0, _("external-resume"));
275
+ e.paused && (l.current = !0, b("external-resume"));
273
276
  }
274
277
  }
275
278
  }, [
276
- L,
279
+ v,
277
280
  E,
278
- _,
279
- n
280
- ]), b(() => {
281
+ b,
282
+ t
283
+ ]), x(() => {
281
284
  const e = h.current;
282
285
  if (e) {
283
286
  if (!f) {
284
287
  H();
285
288
  return;
286
289
  }
287
- if (L) {
288
- s.current = !1, n(!1), e.pause(), i(!1);
290
+ if (v) {
291
+ l.current = !1, t(!1), e.pause(), i(!1);
289
292
  return;
290
293
  }
291
294
  if (K) {
292
- const t = M.current !== K, u = C();
293
- if (U.current === "segment" && !!M.current && a.current === null) {
294
- if (!u) {
295
- s.current = !1, e.pause(), i(!1);
295
+ const n = M.current !== K, s = C();
296
+ if (F.current === "segment" && !!M.current && a.current === null) {
297
+ if (!s) {
298
+ l.current = !1, e.pause(), i(!1);
296
299
  return;
297
300
  }
298
- e.paused && (s.current = !0, _("keep-segment-source"));
301
+ e.paused && (l.current = !0, b("keep-segment-source"));
299
302
  return;
300
303
  }
301
- if (t) {
304
+ if (n) {
302
305
  const N = a.current !== null ? xe() : 0;
303
- e.pause(), e.removeAttribute("src"), e.load(), M.current = K, U.current = "url", e.src = K, e.load(), p.current = N, g(N * 1e3), e.readyState > 0 && (e.currentTime = N, p.current = null);
306
+ e.pause(), e.removeAttribute("src"), e.load(), M.current = K, F.current = "url", e.src = K, e.load(), p.current = N, _(N * 1e3), e.readyState > 0 && (e.currentTime = N, p.current = null);
304
307
  }
305
- if (s.current = u, S.current = !1, w.current = !1, n(!1), !u) {
306
- s.current = !1, e.pause(), i(!1);
308
+ if (l.current = s, y.current = !1, w.current = !1, t(!1), !s) {
309
+ l.current = !1, e.pause(), i(!1);
307
310
  return;
308
311
  }
309
- _(t ? "sync-url-init" : "sync-url");
312
+ b(n ? "sync-url-init" : "sync-url");
310
313
  return;
311
314
  }
312
315
  if (a.current !== null) {
313
- if (a.current < A.length) {
314
- if (y.current) {
315
- i(!1), n(!1);
316
+ if (a.current < k.length) {
317
+ if (g.current) {
318
+ i(!1), t(!1);
316
319
  return;
317
320
  }
318
321
  E(a.current, "wait-resume");
319
322
  return;
320
323
  }
321
- S.current = !0, s.current = C(), i(!1), n(C());
324
+ y.current = !0, l.current = C(), i(!1), t(C());
322
325
  return;
323
326
  }
324
- if (!A.length) {
327
+ if (!k.length) {
325
328
  if (f.isAudioStreaming) {
326
- a.current = x.current, S.current = !0, s.current = C(), i(!1), n(C());
329
+ a.current = S.current, y.current = !0, l.current = C(), i(!1), t(C());
327
330
  return;
328
331
  }
329
332
  H();
@@ -332,112 +335,122 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
332
335
  if (!M.current) {
333
336
  E(
334
337
  Math.min(
335
- x.current,
336
- A.length - 1
338
+ S.current,
339
+ k.length - 1
337
340
  ),
338
341
  "effect-init"
339
342
  );
340
343
  return;
341
344
  }
342
- if (!j || y.current) {
343
- s.current = !1, e.pause(), i(!1);
345
+ if (!A || g.current) {
346
+ l.current = !1, e.pause(), i(!1);
344
347
  return;
345
348
  }
346
- e.paused && (s.current = !0, _("sync-paused-retry"));
349
+ e.paused && (l.current = !0, b("sync-paused-retry"));
347
350
  }
348
351
  }, [
349
352
  f,
350
353
  m,
351
- A,
354
+ k,
352
355
  K,
353
- j,
354
- L,
356
+ A,
357
+ v,
355
358
  C,
356
- g,
359
+ _,
357
360
  H,
358
361
  E,
359
- _,
362
+ b,
360
363
  xe,
361
- n
362
- ]), b(() => H, [H]), b(() => d, [d]);
363
- const $e = l(() => {
364
- o(), we(), i(!0), n(!1), ne?.();
364
+ t
365
+ ]), x(() => H, [H]), x(() => d, [d]);
366
+ const $e = u(() => {
367
+ o(), we(), i(!0), t(!1), ne?.();
365
368
  }, [
366
369
  ne,
367
370
  we,
368
371
  o,
369
- n
370
- ]), He = l(() => {
371
- S.current || w.current || (d(), o(), i(!1));
372
- }, [m, d, o]), Oe = l(() => {
372
+ t
373
+ ]), He = u(() => {
374
+ y.current || w.current || (d(), o(), i(!1));
375
+ }, [m, d, o]), Oe = u(() => {
373
376
  const e = h.current;
374
- e && p.current !== null && (e.currentTime = p.current, p.current = null), o(), !(!s.current || !j) && _("canplay");
377
+ e && p.current !== null && (e.currentTime = p.current, p.current = null), o(), !(!l.current || !A) && b("canplay");
375
378
  }, [
376
379
  m,
377
- j,
380
+ A,
378
381
  o,
379
- _
380
- ]), qe = l(() => {
382
+ b
383
+ ]), qe = u(() => {
381
384
  const e = h.current;
382
385
  e && p.current !== null && (e.currentTime = p.current, p.current = null), o();
383
- }, [m, o]), ze = l(() => {
386
+ }, [m, o]), ze = u(() => {
384
387
  o();
385
- }, [o]), Me = l(() => {
388
+ }, [o]), De = u(() => {
389
+ y.current || t(!0, "loadingAudio");
390
+ }, [t]), Xe = u(() => {
391
+ if (y.current) {
392
+ t(!0, "waitingForMoreAudio");
393
+ return;
394
+ }
395
+ t(!0, "loadingAudio");
396
+ }, [t]), Me = u(() => {
386
397
  o();
387
- }, [o]), De = l(() => {
388
- const e = U.current === "url" || k.current.length === 0;
398
+ }, [o]), Ye = u(() => {
399
+ const e = F.current === "url" || j.current.length === 0;
389
400
  if (d(), w.current = !1, e) {
390
401
  D("url-ended");
391
402
  return;
392
403
  }
393
- je();
394
- }, [D, je, d]), Xe = l(() => {
395
- d(), o(), i(!1), n(!1);
396
- }, [d, o, n]), Ye = l(
404
+ Ae();
405
+ }, [D, Ae, d]), Ge = u(() => {
406
+ d(), o(), i(!1), t(!1);
407
+ }, [d, o, t]), Je = u(
397
408
  (e) => {
398
409
  ae?.(e), B(!1);
399
410
  },
400
411
  [ae]
401
412
  );
402
- return b(() => {
413
+ return x(() => {
403
414
  q?.(I.current);
404
- }, [q]), /* @__PURE__ */ r.jsxs("div", { className: Ae("slide-player", v), ...Ve, children: [
415
+ }, [q]), /* @__PURE__ */ r.jsxs("div", { className: ke("slide-player", L), ...Ve, children: [
405
416
  /* @__PURE__ */ r.jsx(
406
417
  "audio",
407
418
  {
408
419
  ref: h,
409
420
  preload: "auto",
410
421
  playsInline: !0,
422
+ onLoadStart: De,
411
423
  onLoadedMetadata: qe,
412
424
  onCanPlay: Oe,
413
425
  onPlay: $e,
414
426
  onPause: He,
427
+ onWaiting: Xe,
415
428
  onSeeking: Me,
416
429
  onSeeked: Me,
417
430
  onTimeUpdate: ze,
418
- onEnded: De,
419
- onError: Xe
431
+ onEnded: Ye,
432
+ onError: Ge
420
433
  }
421
434
  ),
422
435
  Q ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
423
436
  /* @__PURE__ */ r.jsx(
424
- Ie,
437
+ rr,
425
438
  {
426
- container: ve,
439
+ container: Le,
427
440
  labels: {
428
- fullscreen: P.fullscreenLabel,
429
- nonFullscreen: P.nonFullscreenLabel,
430
- screen: P.screenLabel,
431
- subtitle: P.subtitleLabel,
432
- subtitleToggle: P.subtitleToggleAriaLabel,
433
- title: P.settingsTitle
441
+ fullscreen: W.fullscreenLabel,
442
+ nonFullscreen: W.nonFullscreenLabel,
443
+ screen: W.screenLabel,
444
+ subtitle: W.subtitleLabel,
445
+ subtitleToggle: W.subtitleToggleAriaLabel,
446
+ title: W.settingsTitle
434
447
  },
435
448
  isSubtitleEnabled: J,
436
449
  onClose: () => B(!1),
437
450
  onOpenChange: B,
438
- onSubtitleToggle: se ?? (() => {
451
+ onSubtitleToggle: ue ?? (() => {
439
452
  }),
440
- onViewModeChange: Ye,
453
+ onViewModeChange: Je,
441
454
  open: he,
442
455
  viewMode: Ce
443
456
  }
@@ -456,7 +469,7 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
456
469
  },
457
470
  type: "button",
458
471
  children: /* @__PURE__ */ r.jsx(
459
- nr,
472
+ lr,
460
473
  {
461
474
  className: "slide-player__icon",
462
475
  strokeWidth: 2.25
@@ -468,13 +481,13 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
468
481
  /* @__PURE__ */ r.jsx(
469
482
  "button",
470
483
  {
471
- "aria-label": P.subtitleToggleAriaLabel,
484
+ "aria-label": W.subtitleToggleAriaLabel,
472
485
  "aria-pressed": J,
473
486
  className: "slide-player__action slide-player__action--subtitle",
474
- onClick: se,
487
+ onClick: ue,
475
488
  type: "button",
476
- children: J ? /* @__PURE__ */ r.jsx(lr, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ r.jsx(
477
- ur,
489
+ children: J ? /* @__PURE__ */ r.jsx(ar, { className: "slide-player__icon", strokeWidth: 2.25 }) : /* @__PURE__ */ r.jsx(
490
+ cr,
478
491
  {
479
492
  className: "slide-player__icon",
480
493
  strokeWidth: 2.25
@@ -487,10 +500,10 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
487
500
  {
488
501
  "aria-label": "Rewind",
489
502
  className: "slide-player__action slide-player__action--prev",
490
- disabled: Pe,
503
+ disabled: We,
491
504
  onClick: Re,
492
505
  type: "button",
493
- children: /* @__PURE__ */ r.jsx(ar, { className: "slide-player__icon", strokeWidth: 2.25 })
506
+ children: /* @__PURE__ */ r.jsx(ir, { className: "slide-player__icon", strokeWidth: 2.25 })
494
507
  }
495
508
  ),
496
509
  /* @__PURE__ */ r.jsx(
@@ -500,38 +513,38 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
500
513
  className: "slide-player__toggle slide-player__toggle--playback",
501
514
  onClick: () => {
502
515
  if (G) {
503
- Le?.(!Y);
516
+ ve?.(!Y);
504
517
  return;
505
518
  }
506
519
  const e = h.current;
507
- if (!(L || !e || !f)) {
520
+ if (!(v || !e || !f)) {
508
521
  if (a.current !== null) {
509
522
  if (ee) {
510
- s.current = !1, y.current = !0, a.current = null, S.current = !1, i(!1), n(!1), e.pause();
523
+ l.current = !1, g.current = !0, a.current = null, y.current = !1, i(!1), t(!1), e.pause();
511
524
  return;
512
525
  }
513
- T.current = "manual", y.current = !1, s.current = !0, n(!0);
526
+ T.current = "manual", g.current = !1, l.current = !0, t(!0, "waitingForMoreAudio");
514
527
  return;
515
528
  }
516
- if (!e.src && A.length > 0) {
517
- T.current = "manual", y.current = !1, E(
529
+ if (!e.src && k.length > 0) {
530
+ T.current = "manual", g.current = !1, E(
518
531
  Math.min(
519
- x.current,
520
- A.length - 1
532
+ S.current,
533
+ k.length - 1
521
534
  ),
522
535
  "toggle"
523
536
  );
524
537
  return;
525
538
  }
526
539
  if (e.paused) {
527
- T.current = "manual", y.current = !1, s.current = !0, _("toggle-resume");
540
+ T.current = "manual", g.current = !1, l.current = !0, b("toggle-resume");
528
541
  return;
529
542
  }
530
- s.current = !1, y.current = !0, e.pause();
543
+ l.current = !1, g.current = !0, e.pause();
531
544
  }
532
545
  },
533
546
  type: "button",
534
- children: Ke ? /* @__PURE__ */ r.jsx(dr, {}) : /* @__PURE__ */ r.jsx(mr, {})
547
+ children: Ke ? /* @__PURE__ */ r.jsx(pr, {}) : /* @__PURE__ */ r.jsx(hr, {})
535
548
  }
536
549
  ),
537
550
  /* @__PURE__ */ r.jsx(
@@ -539,27 +552,27 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
539
552
  {
540
553
  "aria-label": "Forward",
541
554
  className: "slide-player__action slide-player__action--next",
542
- disabled: We,
555
+ disabled: Pe,
543
556
  onClick: Te,
544
557
  type: "button",
545
- children: /* @__PURE__ */ r.jsx(cr, { className: "slide-player__icon", strokeWidth: 2.25 })
558
+ children: /* @__PURE__ */ r.jsx(or, { className: "slide-player__icon", strokeWidth: 2.25 })
546
559
  }
547
560
  ),
548
561
  le ? /* @__PURE__ */ r.jsx(
549
562
  "button",
550
563
  {
551
- "aria-label": ue ? "Exit fullscreen" : "Enter fullscreen",
564
+ "aria-label": se ? "Exit fullscreen" : "Enter fullscreen",
552
565
  className: "slide-player__action slide-player__action--fullscreen",
553
566
  onClick: le,
554
567
  type: "button",
555
- children: ue ? /* @__PURE__ */ r.jsx(
556
- ir,
568
+ children: se ? /* @__PURE__ */ r.jsx(
569
+ fr,
557
570
  {
558
571
  className: "slide-player__icon",
559
572
  strokeWidth: 2.25
560
573
  }
561
574
  ) : /* @__PURE__ */ r.jsx(
562
- or,
575
+ dr,
563
576
  {
564
577
  className: "slide-player__icon",
565
578
  strokeWidth: 2.25
@@ -570,20 +583,20 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
570
583
  ] }),
571
584
  /* @__PURE__ */ r.jsx("div", { className: "slide-player__separator" }),
572
585
  /* @__PURE__ */ r.jsxs("div", { className: "slide-player__group", children: [
573
- ye.map((e, t) => /* @__PURE__ */ r.jsx(Je.Fragment, { children: e }, `custom-action-${t}`)),
586
+ ge.map((e, n) => /* @__PURE__ */ r.jsx(Ie.Fragment, { children: e }, `custom-action-${n}`)),
574
587
  /* @__PURE__ */ r.jsx(
575
588
  "button",
576
589
  {
577
590
  "aria-label": "Notes",
578
- className: Ae(
591
+ className: ke(
579
592
  "slide-player__action slide-player__action--notes",
580
593
  Z && "slide-player__action--active"
581
594
  ),
582
- disabled: !Fe,
583
- onClick: Ue,
595
+ disabled: !Ue,
596
+ onClick: Fe,
584
597
  type: "button",
585
598
  children: /* @__PURE__ */ r.jsx(
586
- fr,
599
+ mr,
587
600
  {
588
601
  className: "slide-player__icon",
589
602
  strokeWidth: 2.25
@@ -595,9 +608,9 @@ const Ee = /* @__PURE__ */ new Map(), Ne = (R) => {
595
608
  ] })
596
609
  ] }) : null
597
610
  ] });
598
- }, hr = Qe(pr);
599
- hr.displayName = "Player";
611
+ }, yr = er(gr);
612
+ yr.displayName = "Player";
600
613
  export {
601
- hr as default
614
+ yr as default
602
615
  };
603
616
  //# sourceMappingURL=Player.es.js.map