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