markdown-flow-ui 0.2.26-dev.2 → 0.2.26-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/Slide/Player.cjs +1 -1
- package/dist/components/Slide/Player.cjs.map +1 -1
- package/dist/components/Slide/Player.d.ts +2 -1
- package/dist/components/Slide/Player.es.js +192 -195
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs +1 -1
- package/dist/components/Slide/Slide.cjs.map +1 -1
- package/dist/components/Slide/Slide.d.ts +3 -1
- package/dist/components/Slide/Slide.es.js +685 -671
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/markdown-flow-ui.css +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs.map +1 -1
- package/dist/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs.map +1 -1
- package/dist/node_modules/layout-base/layout-base.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as re, jsx as s, Fragment as Jt } from "react/jsx-runtime";
|
|
2
2
|
import _r, { memo as Mr, useId as wr, useContext as Tr, useRef as i, useState as Ge, useMemo as ce, useCallback as u, useEffect as d } from "react";
|
|
3
|
-
import { getMarkdownFlowDirection as
|
|
3
|
+
import { getMarkdownFlowDirection as kr, getMarkdownFlowLanguage as vr } from "../../lib/locale.es.js";
|
|
4
4
|
import { useDetachedLanguage as Lr } from "../../lib/useDetachedLanguage.es.js";
|
|
5
5
|
import { useResolvedDirection as Ar } from "../../lib/useResolvedDirection.es.js";
|
|
6
6
|
import { cn as Cr } from "../../lib/utils.es.js";
|
|
7
7
|
import xr from "./MobilePlayerSettingsSheet.es.js";
|
|
8
|
-
import { getSlidePlayerTexts as
|
|
9
|
-
import { DEFAULT_MOBILE_VIEW_MODE as
|
|
8
|
+
import { getSlidePlayerTexts as Nr } from "./slideI18n.es.js";
|
|
9
|
+
import { DEFAULT_MOBILE_VIEW_MODE as Er } from "./utils/mobileScreenMode.es.js";
|
|
10
10
|
import { hasReachedAudioEnd as Kr } from "./utils/audioCompletion.es.js";
|
|
11
11
|
import { PlayerKeyboardShortcutContext as Fr } from "./utils/playerKeyboardShortcutContext.es.js";
|
|
12
12
|
import { activatePlayerKeyboardShortcutOwner as Ur, registerPlayerKeyboardShortcutOwner as Br, isActivePlayerKeyboardShortcutOwner as Wr, getPlayerKeyboardShortcutAction as Or, shouldIgnorePlayerKeyboardShortcutEvent as Rr } from "./utils/playerKeyboardShortcuts.es.js";
|
|
@@ -16,9 +16,9 @@ import { toPlayerCustomActionList as Pr } from "./utils/playerCustomActions.es.j
|
|
|
16
16
|
import { suppressPlayerControlsWakeAfterNavigation as Qe } from "./utils/playerNavigationContext.es.js";
|
|
17
17
|
import { isPlaybackTimeCoveredBySegments as Xe, resolveSegmentSeekTarget as Zt } from "./utils/segmentSeek.es.js";
|
|
18
18
|
import { getSortedAudioSegments as jt } from "./utils/audioSegments.es.js";
|
|
19
|
-
import { getSubtitleCueJumpTarget as
|
|
19
|
+
import { getSubtitleCueJumpTarget as $r, shouldClearSubtitleCueJumpTarget as Hr } from "./utils/subtitleCue.es.js";
|
|
20
20
|
/* empty css */
|
|
21
|
-
import
|
|
21
|
+
import Dr from "../../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js";
|
|
22
22
|
import Jr from "../../node_modules/lucide-react/dist/esm/icons/volume-2.es.js";
|
|
23
23
|
import Zr from "../../node_modules/lucide-react/dist/esm/icons/skip-back.es.js";
|
|
24
24
|
import jr from "../../node_modules/lucide-react/dist/esm/icons/skip-forward.es.js";
|
|
@@ -33,21 +33,21 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
33
33
|
return;
|
|
34
34
|
const p = window.document.createElement("audio");
|
|
35
35
|
p.preload = "auto", p.setAttribute("playsinline", "true"), p.src = m, p.load(), zt.set(m, p);
|
|
36
|
-
}, en = (m, p) => p !== null && p.audioList === m && p.subtitleCueLists.length === m.length && m.every((
|
|
37
|
-
const T =
|
|
36
|
+
}, en = (m, p) => p !== null && p.audioList === m && p.subtitleCueLists.length === m.length && m.every((a, w) => {
|
|
37
|
+
const T = a.element?.subtitle_cues;
|
|
38
38
|
return p.subtitleCueLists[w] === T && p.subtitleCueLengths[w] === (T?.length ?? 0);
|
|
39
39
|
}), tn = (m) => {
|
|
40
40
|
const p = m.map(
|
|
41
|
-
(
|
|
41
|
+
(a) => a.element?.subtitle_cues
|
|
42
42
|
);
|
|
43
43
|
return {
|
|
44
44
|
audioList: m,
|
|
45
45
|
subtitleCueLists: p,
|
|
46
46
|
subtitleCueLengths: p.map(
|
|
47
|
-
(
|
|
47
|
+
(a) => a?.length ?? 0
|
|
48
48
|
),
|
|
49
|
-
tracks: p.map((
|
|
50
|
-
subtitleCues:
|
|
49
|
+
tracks: p.map((a) => ({
|
|
50
|
+
subtitleCues: a ?? []
|
|
51
51
|
}))
|
|
52
52
|
};
|
|
53
53
|
}, rn = () => /* @__PURE__ */ re(
|
|
@@ -95,10 +95,10 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
95
95
|
previous: "←",
|
|
96
96
|
previousSubtitle: "Shift+←",
|
|
97
97
|
subtitle: "C"
|
|
98
|
-
}, un = 250,
|
|
98
|
+
}, un = 250, ln = 15e3, an = (m, p) => m ? `${m} (${p})` : p, sn = ({
|
|
99
99
|
audioList: m = [],
|
|
100
100
|
className: p,
|
|
101
|
-
currentAudioIndex:
|
|
101
|
+
currentAudioIndex: a = -1,
|
|
102
102
|
defaultPlaying: w = !0,
|
|
103
103
|
isPlaybackPaused: T = !1,
|
|
104
104
|
isAutoAdvanceEnabled: j = !0,
|
|
@@ -117,11 +117,11 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
117
117
|
canJumpToSubtitleTarget: Be,
|
|
118
118
|
onFullscreen: me,
|
|
119
119
|
isFullscreen: rt = !1,
|
|
120
|
-
mobileViewMode: Gt =
|
|
120
|
+
mobileViewMode: Gt = Er,
|
|
121
121
|
settingsPortalContainer: Qt,
|
|
122
122
|
onMobileViewModeChange: nt,
|
|
123
123
|
onEnded: ut,
|
|
124
|
-
onAutoAdvanceToggle:
|
|
124
|
+
onAutoAdvanceToggle: lt,
|
|
125
125
|
onInteractionToggle: on,
|
|
126
126
|
hasInteraction: fn,
|
|
127
127
|
isInteractionOpen: Te = !1,
|
|
@@ -133,56 +133,56 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
133
133
|
onControlsPointerLeave: qt,
|
|
134
134
|
slideProgress: O = null,
|
|
135
135
|
enableKeyboardShortcuts: er = !0,
|
|
136
|
-
subtitleSeekRequest:
|
|
137
|
-
customActions:
|
|
136
|
+
subtitleSeekRequest: $ = null,
|
|
137
|
+
customActions: at,
|
|
138
138
|
customActionContext: it,
|
|
139
|
-
locale:
|
|
139
|
+
locale: ke,
|
|
140
140
|
texts: st,
|
|
141
141
|
onFocusCapture: ct,
|
|
142
142
|
onPointerDown: ot,
|
|
143
143
|
...Ie
|
|
144
144
|
}) => {
|
|
145
|
-
const Pe = Ie.dir ??
|
|
145
|
+
const Pe = Ie.dir ?? kr(ke), ft = Ie.lang ?? vr(ke), tr = wr(), mt = Tr(Fr), g = i(null), { resolvedDirection: dt, readDirection: pt } = Ar(g, Pe), ve = dt === "rtl", rr = Lr(g, ft), ht = i(Te), R = i(null), Le = i(null), K = i(0), h = i(null), de = i(void 0), k = i([]), pe = i(
|
|
146
146
|
W ? j : w
|
|
147
|
-
), he = i(!1), gt = i(!1),
|
|
148
|
-
}), Ce = i(null), ge = i(null), yt = i(null), G = i(null), bt = i(0),
|
|
147
|
+
), he = i(!1), gt = i(!1), v = i(!1), B = i(null), z = i(null), N = i(!1), c = i(!1), x = i(null), F = i(!1), Y = i(null), Ae = i(0), St = i(() => {
|
|
148
|
+
}), Ce = i(null), ge = i(null), yt = i(null), G = i(null), bt = i(0), $e = i(!1), He = i(!1), _t = i(ne), Mt = i(() => 0), wt = i(null), V = i("unknown"), [xe, S] = Ge(w), [Tt, ue] = Ge(!1), [le, nr] = Ge({
|
|
149
149
|
next: !1,
|
|
150
150
|
previous: !1
|
|
151
|
-
}), Q = mt?.ownerId ?? tr, I = er && (mt?.enabled ?? !0), f =
|
|
151
|
+
}), Q = mt?.ownerId ?? tr, I = er && (mt?.enabled ?? !0), f = a >= 0 ? m[a] : void 0, A = f?.audioUrl, kt = f?.audioSegments, ur = kt?.length ?? 0, U = ce(
|
|
152
152
|
() => jt(f),
|
|
153
|
-
[f, ur,
|
|
153
|
+
[f, ur, kt]
|
|
154
154
|
);
|
|
155
|
-
let
|
|
156
|
-
en(m,
|
|
157
|
-
const
|
|
158
|
-
() => Pr(
|
|
159
|
-
[it,
|
|
160
|
-
), Lt =
|
|
155
|
+
let Ne = wt.current;
|
|
156
|
+
en(m, Ne) || (Ne = tn(m), wt.current = Ne);
|
|
157
|
+
const vt = Ne.tracks, De = ce(
|
|
158
|
+
() => Pr(at, it),
|
|
159
|
+
[it, at]
|
|
160
|
+
), Lt = De.length + 6, lr = ce(
|
|
161
161
|
() => ({
|
|
162
162
|
"--slide-player-mobile-control-count": String(Lt)
|
|
163
163
|
}),
|
|
164
164
|
[Lt]
|
|
165
165
|
), o = ce(
|
|
166
166
|
() => ({
|
|
167
|
-
...
|
|
167
|
+
...Nr(ke),
|
|
168
168
|
...st
|
|
169
169
|
}),
|
|
170
|
-
[
|
|
171
|
-
), Je = ce(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]),
|
|
170
|
+
[ke, st]
|
|
171
|
+
), Je = ce(() => f ? f.audioKey ?? `${String(f.sequenceNumber ?? "none")}:${String(f.audioUrl ?? "")}` : "none", [f]), ar = W ? j : xe, At = W ? j ? o.pauseAutoplayLabel : o.playAutoplayLabel : xe ? o.pauseLabel : o.playLabel, Ct = rt ? o.exitFullscreenLabel : o.enterFullscreenLabel, X = u(
|
|
172
172
|
(e, t, r) => ({
|
|
173
173
|
ariaKeyShortcuts: I ? r : void 0,
|
|
174
|
-
title: I ?
|
|
174
|
+
title: I ? an(e, t) : e
|
|
175
175
|
}),
|
|
176
176
|
[I]
|
|
177
177
|
), xt = X(
|
|
178
178
|
o.subtitleToggleAriaLabel,
|
|
179
179
|
Z.subtitle,
|
|
180
180
|
"c"
|
|
181
|
-
), Et = X(
|
|
182
|
-
o.previousLabel,
|
|
183
|
-
ke ? Z.next : Z.previous,
|
|
184
|
-
ke ? "ArrowRight" : "ArrowLeft"
|
|
185
181
|
), Nt = X(
|
|
182
|
+
o.previousLabel,
|
|
183
|
+
ve ? Z.next : Z.previous,
|
|
184
|
+
ve ? "ArrowRight" : "ArrowLeft"
|
|
185
|
+
), Et = X(
|
|
186
186
|
o.previousSubtitleLabel,
|
|
187
187
|
Z.previousSubtitle,
|
|
188
188
|
"Shift+ArrowLeft"
|
|
@@ -192,8 +192,8 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
192
192
|
"Space"
|
|
193
193
|
), Ft = X(
|
|
194
194
|
o.nextLabel,
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
ve ? Z.previous : Z.next,
|
|
196
|
+
ve ? "ArrowLeft" : "ArrowRight"
|
|
197
197
|
), Ut = X(
|
|
198
198
|
o.nextSubtitleLabel,
|
|
199
199
|
Z.nextSubtitle,
|
|
@@ -202,18 +202,18 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
202
202
|
Ct,
|
|
203
203
|
Z.fullscreen,
|
|
204
204
|
"f"
|
|
205
|
-
),
|
|
205
|
+
), Ee = u(() => {
|
|
206
206
|
I && Ur(Q);
|
|
207
207
|
}, [Q, I]), ir = u(
|
|
208
208
|
(e) => {
|
|
209
|
-
|
|
209
|
+
Ee(), ot?.(e);
|
|
210
210
|
},
|
|
211
|
-
[
|
|
211
|
+
[Ee, ot]
|
|
212
212
|
), sr = u(
|
|
213
213
|
(e) => {
|
|
214
|
-
|
|
214
|
+
Ee(), ct?.(e);
|
|
215
215
|
},
|
|
216
|
-
[
|
|
216
|
+
[Ee, ct]
|
|
217
217
|
);
|
|
218
218
|
d(() => {
|
|
219
219
|
de.current = f;
|
|
@@ -224,12 +224,12 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
224
224
|
}, [Ve]), d(() => {
|
|
225
225
|
!ht.current && Te && ue(!1), ht.current = Te;
|
|
226
226
|
}, [Te]), d(() => {
|
|
227
|
-
|
|
227
|
+
k.current = U;
|
|
228
228
|
}, [U]), d(() => {
|
|
229
|
-
const e = f?.audioUrl, t =
|
|
229
|
+
const e = f?.audioUrl, t = a >= 0 ? m[a + 1]?.audioUrl : void 0;
|
|
230
230
|
Yt(e), Yt(t);
|
|
231
|
-
}, [m, f?.audioUrl,
|
|
232
|
-
const
|
|
231
|
+
}, [m, f?.audioUrl, a]);
|
|
232
|
+
const l = u(
|
|
233
233
|
(e, t = null) => {
|
|
234
234
|
gt.current === e && (!e || t === null) || (gt.current = e, qe?.({
|
|
235
235
|
loading: e,
|
|
@@ -247,15 +247,15 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
247
247
|
} : {
|
|
248
248
|
shouldContinuePlayback: Ir({
|
|
249
249
|
defaultPlaying: pe.current,
|
|
250
|
-
isPausedByUser:
|
|
250
|
+
isPausedByUser: v.current
|
|
251
251
|
})
|
|
252
|
-
}, [W]), Wt = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []),
|
|
252
|
+
}, [W]), Wt = u((e) => e instanceof DOMException ? e.name === "NotAllowedError" || e.name === "SecurityError" : !1, []), H = u(() => w && !T && !v.current && V.current !== "blocked", [w, T]), Ot = u((e) => e ? e.startsWith("data:") ? e : `data:audio/mpeg;base64,${e}` : "", []), Rt = u(() => {
|
|
253
253
|
const e = h.current;
|
|
254
|
-
return e == null || e <= 0 ? 0 :
|
|
254
|
+
return e == null || e <= 0 ? 0 : k.current.slice(0, e).reduce(
|
|
255
255
|
(t, r) => t + Math.max(Number(r.duration_ms ?? 0), 0),
|
|
256
256
|
0
|
|
257
257
|
) / 1e3;
|
|
258
|
-
}, []), ee = u((e) => e <= 0 ? 0 :
|
|
258
|
+
}, []), ee = u((e) => e <= 0 ? 0 : k.current.slice(0, e).reduce(
|
|
259
259
|
(t, r) => t + Math.max(Number(r.duration_ms ?? 0), 0),
|
|
260
260
|
0
|
|
261
261
|
), []), Ke = u(
|
|
@@ -266,25 +266,25 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
266
266
|
[T]
|
|
267
267
|
), Se = u(
|
|
268
268
|
(e, t, r = {}) => {
|
|
269
|
-
const n =
|
|
270
|
-
currentAudioIndex:
|
|
269
|
+
const n = $r({
|
|
270
|
+
currentAudioIndex: a,
|
|
271
271
|
currentTimeMs: t,
|
|
272
272
|
direction: e,
|
|
273
273
|
excludeTarget: r.excludeTarget,
|
|
274
|
-
tracks:
|
|
274
|
+
tracks: vt
|
|
275
275
|
});
|
|
276
276
|
return !n || !Ke(
|
|
277
277
|
m[n.audioIndex],
|
|
278
278
|
n.timeMs
|
|
279
|
-
) || n.audioIndex !==
|
|
279
|
+
) || n.audioIndex !== a && (!we || Be && !Be(n)) ? null : n;
|
|
280
280
|
},
|
|
281
281
|
[
|
|
282
282
|
m,
|
|
283
283
|
Be,
|
|
284
284
|
Ke,
|
|
285
|
-
|
|
285
|
+
a,
|
|
286
286
|
we,
|
|
287
|
-
|
|
287
|
+
vt
|
|
288
288
|
]
|
|
289
289
|
), Ze = u(
|
|
290
290
|
(e, t = !1) => {
|
|
@@ -305,44 +305,44 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
305
305
|
d(() => {
|
|
306
306
|
St.current = Ze, Ze(Ae.current, !0);
|
|
307
307
|
}, [Ze]);
|
|
308
|
-
const
|
|
308
|
+
const D = u(() => {
|
|
309
309
|
const e = g.current;
|
|
310
310
|
return e ? B.current === "segment" ? ee(K.current) + Math.max(e.currentTime, 0) * 1e3 : x.current !== null && e.readyState === 0 ? x.current * 1e3 : Math.max(e.currentTime, 0) * 1e3 : h.current != null ? ee(h.current) : 0;
|
|
311
311
|
}, [ee]);
|
|
312
312
|
d(() => {
|
|
313
313
|
_t.current = ne;
|
|
314
314
|
}, [ne]), d(() => {
|
|
315
|
-
Mt.current =
|
|
316
|
-
}, [
|
|
317
|
-
const
|
|
315
|
+
Mt.current = D;
|
|
316
|
+
}, [D]);
|
|
317
|
+
const E = u(
|
|
318
318
|
(e) => {
|
|
319
319
|
const t = Math.max(e, 0);
|
|
320
|
-
Ae.current !== t && (Ae.current = t,
|
|
321
|
-
currentAudioIndex:
|
|
320
|
+
Ae.current !== t && (Ae.current = t, Hr({
|
|
321
|
+
currentAudioIndex: a,
|
|
322
322
|
currentTimeMs: t,
|
|
323
323
|
target: ge.current
|
|
324
324
|
}) && (ge.current = null), be?.(t), St.current(t));
|
|
325
325
|
},
|
|
326
|
-
[
|
|
326
|
+
[a, be]
|
|
327
327
|
), y = u(() => {
|
|
328
|
-
|
|
329
|
-
}, [
|
|
328
|
+
E(D());
|
|
329
|
+
}, [D, E]), J = u(
|
|
330
330
|
(e = !1, t = !1) => {
|
|
331
331
|
const r = Le.current;
|
|
332
332
|
if (!ne || !r)
|
|
333
333
|
return;
|
|
334
334
|
const n = Date.now();
|
|
335
|
-
!e && n - bt.current < 5e3 || (bt.current = n,
|
|
335
|
+
!e && n - bt.current < 5e3 || (bt.current = n, $e.current = t, ne({
|
|
336
336
|
audioKey: r,
|
|
337
337
|
isComplete: t,
|
|
338
|
-
timeMs:
|
|
338
|
+
timeMs: D()
|
|
339
339
|
}));
|
|
340
340
|
},
|
|
341
|
-
[
|
|
341
|
+
[D, ne]
|
|
342
342
|
);
|
|
343
343
|
d(
|
|
344
344
|
() => () => {
|
|
345
|
-
|
|
345
|
+
$e.current || _t.current?.({
|
|
346
346
|
audioKey: Le.current ?? "none",
|
|
347
347
|
isComplete: !1,
|
|
348
348
|
timeMs: Mt.current()
|
|
@@ -350,8 +350,8 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
350
350
|
},
|
|
351
351
|
[]
|
|
352
352
|
), d(() => {
|
|
353
|
-
|
|
354
|
-
}, [
|
|
353
|
+
$e.current = !1;
|
|
354
|
+
}, [a]);
|
|
355
355
|
const M = u(() => {
|
|
356
356
|
typeof window > "u" || Y.current === null || (window.cancelAnimationFrame(Y.current), Y.current = null);
|
|
357
357
|
}, []), Vt = u(() => {
|
|
@@ -367,10 +367,10 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
367
367
|
Y.current = window.requestAnimationFrame(e);
|
|
368
368
|
};
|
|
369
369
|
Y.current = window.requestAnimationFrame(e);
|
|
370
|
-
}, [y]),
|
|
370
|
+
}, [y]), ae = u(() => {
|
|
371
371
|
const e = g.current;
|
|
372
|
-
e && (M(), c.current = !1,
|
|
373
|
-
}, [
|
|
372
|
+
e && (M(), c.current = !1, v.current = !1, he.current = !1, B.current = null, x.current = null, N.current = !1, F.current = !1, z.current = null, e.pause(), e.removeAttribute("src"), e.load(), R.current = null, K.current = 0, h.current = null, E(0), S(!1), l(!1));
|
|
373
|
+
}, [E, M, l]), L = u(
|
|
374
374
|
(e) => {
|
|
375
375
|
const t = g.current;
|
|
376
376
|
if (!t)
|
|
@@ -379,34 +379,34 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
379
379
|
return r && typeof r.then == "function" && r.then(() => {
|
|
380
380
|
V.current === "unknown" && (V.current = "auto"), c.current = !1, F.current = !1;
|
|
381
381
|
}).catch((n) => {
|
|
382
|
-
V.current === "unknown" && Wt(n) && (V.current = "blocked", c.current = !1,
|
|
382
|
+
V.current === "unknown" && Wt(n) && (V.current = "blocked", c.current = !1, l(!1)), F.current = !1, S(!1);
|
|
383
383
|
}), !0;
|
|
384
384
|
},
|
|
385
|
-
[Wt,
|
|
385
|
+
[Wt, l]
|
|
386
386
|
), C = u(
|
|
387
387
|
(e, t, r = {}) => {
|
|
388
|
-
const n = g.current, b =
|
|
388
|
+
const n = g.current, b = k.current[e];
|
|
389
389
|
if (!n || !b)
|
|
390
390
|
return !1;
|
|
391
391
|
const te = Ot(b.audio_data), Ye = Math.max(
|
|
392
392
|
Number(r.seekTimeSeconds ?? 0),
|
|
393
393
|
0
|
|
394
394
|
);
|
|
395
|
-
K.current = e, h.current = null,
|
|
395
|
+
K.current = e, h.current = null, N.current = !1, F.current = !0, z.current = "segment", E(
|
|
396
396
|
ee(e) + Ye * 1e3
|
|
397
397
|
);
|
|
398
|
-
const
|
|
399
|
-
c.current =
|
|
398
|
+
const Dt = r.shouldResume ?? H();
|
|
399
|
+
c.current = Dt, l(!1);
|
|
400
400
|
const br = R.current !== te;
|
|
401
|
-
return B.current = "segment", br && (n.pause(), n.removeAttribute("src"), n.load(), R.current = te, n.src = te, n.load()), x.current = Ye, n.readyState > 0 && (n.currentTime = Ye, x.current = null),
|
|
401
|
+
return B.current = "segment", br && (n.pause(), n.removeAttribute("src"), n.load(), R.current = te, n.src = te, n.load()), x.current = Ye, n.readyState > 0 && (n.currentTime = Ye, x.current = null), Dt ? L(`start-segment:${t}`) : (c.current = !1, F.current = !1, n.pause(), S(!1), !0);
|
|
402
402
|
},
|
|
403
403
|
[
|
|
404
|
-
|
|
404
|
+
H,
|
|
405
405
|
Ot,
|
|
406
406
|
ee,
|
|
407
|
-
|
|
407
|
+
E,
|
|
408
408
|
L,
|
|
409
|
-
|
|
409
|
+
l
|
|
410
410
|
]
|
|
411
411
|
), ie = u(
|
|
412
412
|
(e, t) => {
|
|
@@ -414,22 +414,22 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
414
414
|
if (!r)
|
|
415
415
|
return !1;
|
|
416
416
|
const n = Math.max(Number(t), 0) / 1e3;
|
|
417
|
-
return R.current !== e && (r.pause(), r.removeAttribute("src"), r.load(), R.current = e, B.current = "url", z.current = "url", r.src = e, r.load()), x.current = n,
|
|
417
|
+
return R.current !== e && (r.pause(), r.removeAttribute("src"), r.load(), R.current = e, B.current = "url", z.current = "url", r.src = e, r.load()), x.current = n, E(n * 1e3), r.readyState > 0 && (r.currentTime = n, x.current = null), !0;
|
|
418
418
|
},
|
|
419
|
-
[
|
|
419
|
+
[E]
|
|
420
420
|
), Fe = u(
|
|
421
421
|
(e) => {
|
|
422
422
|
const t = g.current;
|
|
423
423
|
if (!t || !f || T)
|
|
424
424
|
return !1;
|
|
425
|
-
const r = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || F.current || h.current !== null && pe.current && !
|
|
426
|
-
|
|
425
|
+
const r = Math.max(Number(e), 0), n = !t.paused && !t.ended || c.current || F.current || h.current !== null && pe.current && !v.current, b = Xe(
|
|
426
|
+
k.current,
|
|
427
427
|
r
|
|
428
428
|
) ? Zt(
|
|
429
|
-
|
|
429
|
+
k.current,
|
|
430
430
|
r
|
|
431
431
|
) : null;
|
|
432
|
-
return Ce.current = null, M(), c.current = n,
|
|
432
|
+
return Ce.current = null, M(), c.current = n, l(!1), n && (V.current = "manual", v.current = !1, P(!0)), b && (B.current === "segment" || !A) ? C(
|
|
433
433
|
b.segmentIndex,
|
|
434
434
|
"subtitle-seek-segment",
|
|
435
435
|
{
|
|
@@ -446,7 +446,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
446
446
|
C,
|
|
447
447
|
M,
|
|
448
448
|
L,
|
|
449
|
-
|
|
449
|
+
l,
|
|
450
450
|
P
|
|
451
451
|
]
|
|
452
452
|
), It = u(
|
|
@@ -454,13 +454,13 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
454
454
|
if (!g.current || !f)
|
|
455
455
|
return !1;
|
|
456
456
|
const r = Math.max(Number(e), 0), n = Xe(
|
|
457
|
-
|
|
457
|
+
k.current,
|
|
458
458
|
r
|
|
459
459
|
) ? Zt(
|
|
460
|
-
|
|
460
|
+
k.current,
|
|
461
461
|
r
|
|
462
462
|
) : null;
|
|
463
|
-
return c.current = !0,
|
|
463
|
+
return c.current = !0, l(!1), n && (B.current === "segment" || !A) ? C(n.segmentIndex, "restore", {
|
|
464
464
|
seekTimeSeconds: n.segmentTimeSeconds,
|
|
465
465
|
shouldResume: !0
|
|
466
466
|
}) : !A || !ie(A, r) ? !1 : (L("restore"), !0);
|
|
@@ -471,20 +471,20 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
471
471
|
ie,
|
|
472
472
|
C,
|
|
473
473
|
L,
|
|
474
|
-
|
|
474
|
+
l
|
|
475
475
|
]
|
|
476
476
|
), ye = u(
|
|
477
477
|
(e) => {
|
|
478
478
|
const t = Se(
|
|
479
479
|
e,
|
|
480
|
-
|
|
480
|
+
D(),
|
|
481
481
|
{
|
|
482
482
|
excludeTarget: e === "previous" ? ge.current : null
|
|
483
483
|
}
|
|
484
484
|
);
|
|
485
485
|
if (t === null)
|
|
486
486
|
return !1;
|
|
487
|
-
if (t.audioIndex ===
|
|
487
|
+
if (t.audioIndex === a) {
|
|
488
488
|
const n = Fe(t.timeMs);
|
|
489
489
|
return n && (ge.current = t), n;
|
|
490
490
|
}
|
|
@@ -495,8 +495,8 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
495
495
|
return r && (ge.current = t), r;
|
|
496
496
|
},
|
|
497
497
|
[
|
|
498
|
-
|
|
499
|
-
|
|
498
|
+
a,
|
|
499
|
+
D,
|
|
500
500
|
q,
|
|
501
501
|
Se,
|
|
502
502
|
we,
|
|
@@ -504,14 +504,14 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
504
504
|
]
|
|
505
505
|
), se = u(
|
|
506
506
|
(e) => {
|
|
507
|
-
M(), c.current = !1,
|
|
507
|
+
M(), c.current = !1, N.current = !1, F.current = !1, y(), S(!1), l(!1), a >= 0 && ut?.(a);
|
|
508
508
|
},
|
|
509
509
|
[
|
|
510
|
-
|
|
510
|
+
a,
|
|
511
511
|
ut,
|
|
512
512
|
M,
|
|
513
513
|
y,
|
|
514
|
-
|
|
514
|
+
l
|
|
515
515
|
]
|
|
516
516
|
), Ue = u(
|
|
517
517
|
(e) => {
|
|
@@ -523,13 +523,13 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
523
523
|
},
|
|
524
524
|
[se]
|
|
525
525
|
), Pt = u(() => {
|
|
526
|
-
const e = K.current + 1, t =
|
|
526
|
+
const e = K.current + 1, t = k.current, r = t[e], n = de.current, b = t.some((te) => te.is_final);
|
|
527
527
|
if (r) {
|
|
528
528
|
C(e, "ended");
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
531
|
if (n?.isAudioStreaming || !b) {
|
|
532
|
-
K.current = e, h.current = e,
|
|
532
|
+
K.current = e, h.current = e, N.current = !0, c.current = w, E(ee(e)), S(!1), l(!0, "waitingForMoreAudio");
|
|
533
533
|
return;
|
|
534
534
|
}
|
|
535
535
|
se("segments-completed");
|
|
@@ -537,46 +537,46 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
537
537
|
w,
|
|
538
538
|
se,
|
|
539
539
|
ee,
|
|
540
|
-
|
|
540
|
+
E,
|
|
541
541
|
C,
|
|
542
|
-
|
|
542
|
+
l
|
|
543
543
|
]);
|
|
544
544
|
d(() => {
|
|
545
545
|
if (Le.current === Je)
|
|
546
546
|
return;
|
|
547
|
-
J(!0), Le.current = Je, K.current = 0, h.current = null,
|
|
547
|
+
J(!0), Le.current = Je, K.current = 0, h.current = null, N.current = !1, v.current = !1, he.current = !1, c.current = !1, F.current = !1, B.current = null, z.current = null, R.current = null, M(), E(0), l(!1);
|
|
548
548
|
const e = g.current;
|
|
549
|
-
e && (
|
|
549
|
+
e && (He.current = !0, e.pause(), e.removeAttribute("src"), e.load(), He.current = !1, S(!1));
|
|
550
550
|
}, [
|
|
551
|
-
|
|
551
|
+
a,
|
|
552
552
|
Je,
|
|
553
553
|
U.length,
|
|
554
554
|
A,
|
|
555
555
|
J,
|
|
556
|
-
|
|
556
|
+
E,
|
|
557
557
|
M,
|
|
558
|
-
|
|
558
|
+
l
|
|
559
559
|
]), d(() => {
|
|
560
560
|
const e = g.current;
|
|
561
561
|
if (e) {
|
|
562
562
|
if (T) {
|
|
563
|
-
he.current = !!(de.current && !
|
|
563
|
+
he.current = !!(de.current && !v.current && (!e.paused || c.current || h.current !== null)), c.current = !1, l(!1), e.pause(), S(!1);
|
|
564
564
|
return;
|
|
565
565
|
}
|
|
566
|
-
if (!(!he.current || !de.current ||
|
|
566
|
+
if (!(!he.current || !de.current || v.current)) {
|
|
567
567
|
if (he.current = !1, h.current !== null) {
|
|
568
|
-
if (h.current <
|
|
568
|
+
if (h.current < k.current.length) {
|
|
569
569
|
C(h.current, "external-resume");
|
|
570
570
|
return;
|
|
571
571
|
}
|
|
572
|
-
c.current = !0,
|
|
572
|
+
c.current = !0, l(!0, "waitingForMoreAudio");
|
|
573
573
|
return;
|
|
574
574
|
}
|
|
575
|
-
if (!R.current &&
|
|
575
|
+
if (!R.current && k.current.length > 0) {
|
|
576
576
|
C(
|
|
577
577
|
Math.min(
|
|
578
578
|
K.current,
|
|
579
|
-
|
|
579
|
+
k.current.length - 1
|
|
580
580
|
),
|
|
581
581
|
"external-resume-init"
|
|
582
582
|
);
|
|
@@ -589,19 +589,19 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
589
589
|
T,
|
|
590
590
|
C,
|
|
591
591
|
L,
|
|
592
|
-
|
|
592
|
+
l
|
|
593
593
|
]), d(() => {
|
|
594
594
|
const e = g.current;
|
|
595
595
|
if (!e)
|
|
596
596
|
return;
|
|
597
597
|
if (!f) {
|
|
598
|
-
|
|
598
|
+
ae();
|
|
599
599
|
return;
|
|
600
600
|
}
|
|
601
601
|
if (_ && _.id !== G.current)
|
|
602
602
|
return;
|
|
603
603
|
if (T) {
|
|
604
|
-
c.current = !1,
|
|
604
|
+
c.current = !1, l(!1), e.pause(), S(!1);
|
|
605
605
|
return;
|
|
606
606
|
}
|
|
607
607
|
const t = Vr({
|
|
@@ -612,12 +612,12 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
612
612
|
waitingSegmentIndex: h.current
|
|
613
613
|
});
|
|
614
614
|
if (t && z.current !== t && (z.current = t), t === "url" && A) {
|
|
615
|
-
const r = R.current !== A, n =
|
|
615
|
+
const r = R.current !== A, n = H();
|
|
616
616
|
if (r) {
|
|
617
617
|
const b = h.current !== null ? Rt() : 0;
|
|
618
618
|
ie(A, b * 1e3);
|
|
619
619
|
}
|
|
620
|
-
if (c.current = n,
|
|
620
|
+
if (c.current = n, N.current = !1, F.current = !1, l(!1), !n) {
|
|
621
621
|
c.current = !1, e.pause(), S(!1);
|
|
622
622
|
return;
|
|
623
623
|
}
|
|
@@ -626,22 +626,22 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
626
626
|
}
|
|
627
627
|
if (t === "segment" && h.current !== null) {
|
|
628
628
|
if (h.current < U.length) {
|
|
629
|
-
if (
|
|
630
|
-
S(!1),
|
|
629
|
+
if (v.current) {
|
|
630
|
+
S(!1), l(!1);
|
|
631
631
|
return;
|
|
632
632
|
}
|
|
633
633
|
C(h.current, "wait-resume");
|
|
634
634
|
return;
|
|
635
635
|
}
|
|
636
|
-
|
|
636
|
+
N.current = !0, c.current = H(), S(!1), l(H());
|
|
637
637
|
return;
|
|
638
638
|
}
|
|
639
639
|
if (t === "segment" && !U.length) {
|
|
640
640
|
if (f.isAudioStreaming) {
|
|
641
|
-
h.current = K.current,
|
|
641
|
+
h.current = K.current, N.current = !0, c.current = H(), S(!1), l(H());
|
|
642
642
|
return;
|
|
643
643
|
}
|
|
644
|
-
|
|
644
|
+
ae();
|
|
645
645
|
return;
|
|
646
646
|
}
|
|
647
647
|
if (t === "segment" && !R.current) {
|
|
@@ -655,42 +655,42 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
655
655
|
return;
|
|
656
656
|
}
|
|
657
657
|
if (t !== "segment") {
|
|
658
|
-
|
|
658
|
+
ae();
|
|
659
659
|
return;
|
|
660
660
|
}
|
|
661
|
-
if (!w ||
|
|
661
|
+
if (!w || v.current) {
|
|
662
662
|
c.current = !1, e.pause(), S(!1);
|
|
663
663
|
return;
|
|
664
664
|
}
|
|
665
665
|
e.paused && (c.current = !0, L("sync-paused-retry"));
|
|
666
666
|
}, [
|
|
667
667
|
f,
|
|
668
|
-
|
|
668
|
+
a,
|
|
669
669
|
U,
|
|
670
670
|
A,
|
|
671
671
|
w,
|
|
672
672
|
T,
|
|
673
673
|
_,
|
|
674
|
-
|
|
675
|
-
|
|
674
|
+
H,
|
|
675
|
+
ae,
|
|
676
676
|
ie,
|
|
677
677
|
C,
|
|
678
678
|
L,
|
|
679
679
|
Rt,
|
|
680
|
-
|
|
680
|
+
l
|
|
681
681
|
]), d(() => {
|
|
682
|
-
if (
|
|
682
|
+
if (!$ || $.id === yt.current || $.audioIndex !== a)
|
|
683
683
|
return;
|
|
684
|
-
const e = m[
|
|
685
|
-
Ke(e,
|
|
684
|
+
const e = m[$.audioIndex];
|
|
685
|
+
Ke(e, $.timeMs) && (yt.current = $.id, Fe($.timeMs));
|
|
686
686
|
}, [
|
|
687
687
|
m,
|
|
688
688
|
Ke,
|
|
689
|
-
|
|
689
|
+
a,
|
|
690
690
|
Fe,
|
|
691
|
-
|
|
691
|
+
$
|
|
692
692
|
]), d(() => {
|
|
693
|
-
if (!(!_ || _.id === G.current ||
|
|
693
|
+
if (!(!_ || _.id === G.current || a < 0)) {
|
|
694
694
|
if (It(_.timeMs)) {
|
|
695
695
|
G.current = _.id, oe?.(_.id);
|
|
696
696
|
return;
|
|
@@ -699,39 +699,39 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
699
699
|
}
|
|
700
700
|
}, [
|
|
701
701
|
f?.isAudioStreaming,
|
|
702
|
-
|
|
702
|
+
a,
|
|
703
703
|
oe,
|
|
704
704
|
_,
|
|
705
705
|
It
|
|
706
706
|
]), d(() => {
|
|
707
|
-
if (!_ || _.id === G.current ||
|
|
707
|
+
if (!_ || _.id === G.current || a < 0 || !f?.isAudioStreaming)
|
|
708
708
|
return;
|
|
709
709
|
const e = window.setTimeout(() => {
|
|
710
710
|
_.id !== G.current && (G.current = _.id, oe?.(_.id));
|
|
711
|
-
},
|
|
711
|
+
}, ln);
|
|
712
712
|
return () => {
|
|
713
713
|
window.clearTimeout(e);
|
|
714
714
|
};
|
|
715
715
|
}, [
|
|
716
716
|
f?.isAudioStreaming,
|
|
717
|
-
|
|
717
|
+
a,
|
|
718
718
|
oe,
|
|
719
719
|
_
|
|
720
|
-
]), d(() =>
|
|
720
|
+
]), d(() => ae, [ae]), d(() => M, [M]);
|
|
721
721
|
const cr = u(() => {
|
|
722
|
-
y(), Vt(), S(!0),
|
|
722
|
+
y(), Vt(), S(!0), l(!1), tt?.();
|
|
723
723
|
}, [
|
|
724
724
|
tt,
|
|
725
725
|
Vt,
|
|
726
726
|
y,
|
|
727
|
-
|
|
727
|
+
l
|
|
728
728
|
]), or = u(() => {
|
|
729
|
-
|
|
729
|
+
He.current || N.current || F.current || (M(), y(), J(!0), S(!1));
|
|
730
730
|
}, [J, M, y]), fr = u(() => {
|
|
731
731
|
const e = g.current;
|
|
732
732
|
e && x.current !== null && (e.currentTime = x.current, x.current = null), y(), !Ue("canplay-seek-finished") && (!c.current || !w || L("canplay"));
|
|
733
733
|
}, [
|
|
734
|
-
|
|
734
|
+
a,
|
|
735
735
|
w,
|
|
736
736
|
Ue,
|
|
737
737
|
y,
|
|
@@ -739,20 +739,20 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
739
739
|
]), mr = u(() => {
|
|
740
740
|
const e = g.current;
|
|
741
741
|
e && x.current !== null && (e.currentTime = x.current, x.current = null), y(), Ue("metadata-seek-finished");
|
|
742
|
-
}, [
|
|
742
|
+
}, [a, Ue, y]), dr = u(() => {
|
|
743
743
|
y(), J();
|
|
744
744
|
}, [J, y]), pr = u(() => {
|
|
745
|
-
|
|
746
|
-
}, [
|
|
747
|
-
if (
|
|
748
|
-
|
|
745
|
+
N.current || l(!0, "loadingAudio");
|
|
746
|
+
}, [l]), hr = u(() => {
|
|
747
|
+
if (N.current) {
|
|
748
|
+
l(!0, "waitingForMoreAudio");
|
|
749
749
|
return;
|
|
750
750
|
}
|
|
751
|
-
|
|
752
|
-
}, [
|
|
751
|
+
l(!0, "loadingAudio");
|
|
752
|
+
}, [l]), $t = u(() => {
|
|
753
753
|
y();
|
|
754
754
|
}, [y]), gr = u(() => {
|
|
755
|
-
const e = de.current, t = B.current === "url" ||
|
|
755
|
+
const e = de.current, t = B.current === "url" || k.current.length === 0, r = !!k.current[K.current + 1], n = k.current.some(
|
|
756
756
|
(te) => te.is_final
|
|
757
757
|
), b = !!e?.isAudioStreaming;
|
|
758
758
|
if (J(
|
|
@@ -769,8 +769,8 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
769
769
|
Pt,
|
|
770
770
|
M
|
|
771
771
|
]), Sr = u(() => {
|
|
772
|
-
M(), y(), S(!1),
|
|
773
|
-
}, [M, y,
|
|
772
|
+
M(), y(), S(!1), l(!1);
|
|
773
|
+
}, [M, y, l]), yr = u(
|
|
774
774
|
(e) => {
|
|
775
775
|
nt?.(e), ue(!1);
|
|
776
776
|
},
|
|
@@ -778,26 +778,26 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
778
778
|
), je = u(() => {
|
|
779
779
|
if (W) {
|
|
780
780
|
const t = !j;
|
|
781
|
-
return P(t),
|
|
781
|
+
return P(t), lt?.(t), !0;
|
|
782
782
|
}
|
|
783
783
|
const e = g.current;
|
|
784
|
-
return T || !e || !f ? !1 : h.current !== null ? xe ? (P(!1), c.current = !1,
|
|
784
|
+
return T || !e || !f ? !1 : h.current !== null ? xe ? (P(!1), c.current = !1, v.current = !0, h.current = null, N.current = !1, S(!1), l(!1), e.pause(), !0) : (P(!0), V.current = "manual", v.current = !1, c.current = !0, l(!0, "waitingForMoreAudio"), !0) : !e.src && U.length > 0 ? (P(!0), V.current = "manual", v.current = !1, C(
|
|
785
785
|
Math.min(
|
|
786
786
|
K.current,
|
|
787
787
|
U.length - 1
|
|
788
788
|
),
|
|
789
789
|
"toggle"
|
|
790
|
-
), !0) : e.paused ? (P(!0), V.current = "manual",
|
|
790
|
+
), !0) : e.paused ? (P(!0), V.current = "manual", v.current = !1, c.current = !0, L("toggle-resume"), !0) : (P(!1), c.current = !1, v.current = !0, e.pause(), !0);
|
|
791
791
|
}, [
|
|
792
792
|
f,
|
|
793
793
|
U.length,
|
|
794
794
|
j,
|
|
795
795
|
T,
|
|
796
796
|
xe,
|
|
797
|
-
|
|
797
|
+
lt,
|
|
798
798
|
C,
|
|
799
799
|
L,
|
|
800
|
-
|
|
800
|
+
l,
|
|
801
801
|
P,
|
|
802
802
|
W
|
|
803
803
|
]);
|
|
@@ -811,11 +811,11 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
811
811
|
next: () => Me ? (Re || Me(
|
|
812
812
|
Qe(q())
|
|
813
813
|
), !0) : !1,
|
|
814
|
-
nextSubtitle: () =>
|
|
814
|
+
nextSubtitle: () => le.next ? ye("next") : !0,
|
|
815
815
|
previous: () => _e ? (Oe || _e(
|
|
816
816
|
Qe(q())
|
|
817
817
|
), !0) : !1,
|
|
818
|
-
previousSubtitle: () =>
|
|
818
|
+
previousSubtitle: () => le.previous ? ye("previous") : !0,
|
|
819
819
|
subtitle: () => fe ? (fe(), !0) : !1,
|
|
820
820
|
togglePlayback: () => (je(), !0)
|
|
821
821
|
}),
|
|
@@ -828,13 +828,13 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
828
828
|
_e,
|
|
829
829
|
fe,
|
|
830
830
|
Oe,
|
|
831
|
-
|
|
832
|
-
|
|
831
|
+
le.next,
|
|
832
|
+
le.previous,
|
|
833
833
|
je
|
|
834
834
|
]
|
|
835
|
-
),
|
|
835
|
+
), Ht = i(ze);
|
|
836
836
|
return d(() => {
|
|
837
|
-
|
|
837
|
+
Ht.current = ze;
|
|
838
838
|
}, [ze]), d(() => {
|
|
839
839
|
if (!I || typeof document > "u")
|
|
840
840
|
return;
|
|
@@ -845,7 +845,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
845
845
|
if (!r || Rr(t, r))
|
|
846
846
|
return;
|
|
847
847
|
let n = !1;
|
|
848
|
-
const b =
|
|
848
|
+
const b = Ht.current[r];
|
|
849
849
|
n = b(), n && t.preventDefault();
|
|
850
850
|
};
|
|
851
851
|
return document.addEventListener("keydown", e), () => {
|
|
@@ -876,8 +876,8 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
876
876
|
onPlay: cr,
|
|
877
877
|
onPause: or,
|
|
878
878
|
onWaiting: hr,
|
|
879
|
-
onSeeking:
|
|
880
|
-
onSeeked:
|
|
879
|
+
onSeeking: $t,
|
|
880
|
+
onSeeked: $t,
|
|
881
881
|
onTimeUpdate: dr,
|
|
882
882
|
onEnded: gr,
|
|
883
883
|
onError: Sr
|
|
@@ -916,7 +916,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
916
916
|
className: "slide-player__controls",
|
|
917
917
|
onPointerEnter: Xt,
|
|
918
918
|
onPointerLeave: qt,
|
|
919
|
-
style:
|
|
919
|
+
style: lr,
|
|
920
920
|
children: [
|
|
921
921
|
/* @__PURE__ */ re("div", { className: "slide-player__group", children: [
|
|
922
922
|
/* @__PURE__ */ s(
|
|
@@ -931,7 +931,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
931
931
|
},
|
|
932
932
|
type: "button",
|
|
933
933
|
children: /* @__PURE__ */ s(
|
|
934
|
-
|
|
934
|
+
Dr,
|
|
935
935
|
{
|
|
936
936
|
className: "slide-player__icon",
|
|
937
937
|
strokeWidth: 2.25
|
|
@@ -959,20 +959,20 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
959
959
|
},
|
|
960
960
|
title: Kt.title,
|
|
961
961
|
type: "button",
|
|
962
|
-
children:
|
|
962
|
+
children: ar ? /* @__PURE__ */ s(rn, {}) : /* @__PURE__ */ s(nn, {})
|
|
963
963
|
}
|
|
964
964
|
),
|
|
965
965
|
/* @__PURE__ */ s(
|
|
966
966
|
"button",
|
|
967
967
|
{
|
|
968
|
-
"aria-keyshortcuts":
|
|
968
|
+
"aria-keyshortcuts": Nt.ariaKeyShortcuts,
|
|
969
969
|
"aria-label": o.previousLabel,
|
|
970
970
|
className: "slide-player__action slide-player__action--prev",
|
|
971
971
|
disabled: Oe,
|
|
972
972
|
onClick: () => {
|
|
973
973
|
_e?.(q());
|
|
974
974
|
},
|
|
975
|
-
title:
|
|
975
|
+
title: Nt.title,
|
|
976
976
|
type: "button",
|
|
977
977
|
children: /* @__PURE__ */ s(Zr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
978
978
|
}
|
|
@@ -1001,14 +1001,14 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
1001
1001
|
/* @__PURE__ */ s(
|
|
1002
1002
|
"button",
|
|
1003
1003
|
{
|
|
1004
|
-
"aria-keyshortcuts":
|
|
1004
|
+
"aria-keyshortcuts": Et.ariaKeyShortcuts,
|
|
1005
1005
|
"aria-label": o.previousSubtitleLabel,
|
|
1006
1006
|
className: "slide-player__action slide-player__action--prev-subtitle",
|
|
1007
|
-
disabled: !
|
|
1007
|
+
disabled: !le.previous,
|
|
1008
1008
|
onClick: () => {
|
|
1009
1009
|
ye("previous");
|
|
1010
1010
|
},
|
|
1011
|
-
title:
|
|
1011
|
+
title: Et.title,
|
|
1012
1012
|
type: "button",
|
|
1013
1013
|
children: /* @__PURE__ */ s(zr, { className: "slide-player__icon", strokeWidth: 2.25 })
|
|
1014
1014
|
}
|
|
@@ -1019,7 +1019,7 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
1019
1019
|
"aria-keyshortcuts": Ut.ariaKeyShortcuts,
|
|
1020
1020
|
"aria-label": o.nextSubtitleLabel,
|
|
1021
1021
|
className: "slide-player__action slide-player__action--next-subtitle",
|
|
1022
|
-
disabled: !
|
|
1022
|
+
disabled: !le.next,
|
|
1023
1023
|
onClick: () => {
|
|
1024
1024
|
ye("next");
|
|
1025
1025
|
},
|
|
@@ -1078,9 +1078,9 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
) : null
|
|
1080
1080
|
] }),
|
|
1081
|
-
|
|
1081
|
+
De.length > 0 ? /* @__PURE__ */ re(Jt, { children: [
|
|
1082
1082
|
/* @__PURE__ */ s("div", { className: "slide-player__separator" }),
|
|
1083
|
-
/* @__PURE__ */ s("div", { className: "slide-player__group slide-player__group--custom-actions", children:
|
|
1083
|
+
/* @__PURE__ */ s("div", { className: "slide-player__group slide-player__group--custom-actions", children: De.map((e, t) => /* @__PURE__ */ s(_r.Fragment, { children: e }, `custom-action-${t}`)) })
|
|
1084
1084
|
] }) : null
|
|
1085
1085
|
]
|
|
1086
1086
|
}
|
|
@@ -1089,20 +1089,17 @@ const zt = /* @__PURE__ */ new Map(), Yt = (m) => {
|
|
|
1089
1089
|
"div",
|
|
1090
1090
|
{
|
|
1091
1091
|
"aria-label": O.ariaLabel,
|
|
1092
|
-
"aria-valuemax": O.totalSteps,
|
|
1093
|
-
"aria-valuemin": 1,
|
|
1094
|
-
"aria-valuenow": Math.min(
|
|
1095
|
-
Math.max(O.currentIndex + 1, 1),
|
|
1096
|
-
O.totalSteps
|
|
1097
|
-
),
|
|
1098
1092
|
className: "slide-player__slide-progress",
|
|
1099
|
-
role: "
|
|
1093
|
+
role: "navigation",
|
|
1100
1094
|
children: Array.from({ length: O.totalSteps }, (e, t) => /* @__PURE__ */ s(
|
|
1101
|
-
"
|
|
1095
|
+
"button",
|
|
1102
1096
|
{
|
|
1103
|
-
"aria-
|
|
1097
|
+
"aria-current": t === O.currentIndex ? "step" : void 0,
|
|
1098
|
+
"aria-label": `${O.ariaLabel} ${t + 1}`,
|
|
1104
1099
|
className: "slide-player__slide-progress-segment",
|
|
1105
|
-
"data-state": t < O.currentIndex ? "completed" : t === O.currentIndex ? "current" : "upcoming"
|
|
1100
|
+
"data-state": t < O.currentIndex ? "completed" : t === O.currentIndex ? "current" : "upcoming",
|
|
1101
|
+
onClick: () => O.onNavigate?.(t),
|
|
1102
|
+
type: "button"
|
|
1106
1103
|
},
|
|
1107
1104
|
t
|
|
1108
1105
|
))
|