markdown-flow-ui 0.1.115-beta.4 → 0.1.115-beta.5
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/components/Slide/Player.cjs.js +1 -1
- package/dist/components/Slide/Player.cjs.js.map +1 -1
- package/dist/components/Slide/Player.es.js +291 -280
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs.js +1 -1
- package/dist/components/Slide/Slide.cjs.js.map +1 -1
- package/dist/components/Slide/Slide.es.js +478 -481
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/utils/audioCompletion.cjs.js +2 -0
- package/dist/components/Slide/utils/audioCompletion.cjs.js.map +1 -0
- package/dist/components/Slide/utils/audioCompletion.d.ts +7 -0
- package/dist/components/Slide/utils/audioCompletion.es.js +9 -0
- package/dist/components/Slide/utils/audioCompletion.es.js.map +1 -0
- package/dist/components/Slide/utils/audioCompletion.test.d.ts +1 -0
- package/dist/components/Slide/utils/playbackSequence.cjs.js +1 -1
- package/dist/components/Slide/utils/playbackSequence.cjs.js.map +1 -1
- package/dist/components/Slide/utils/playbackSequence.d.ts +0 -4
- package/dist/components/Slide/utils/playbackSequence.es.js +7 -20
- package/dist/components/Slide/utils/playbackSequence.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import { j as n } from "../../_virtual/jsx-runtime.es.js";
|
|
2
|
-
import { memo as
|
|
3
|
-
import { isSandboxInteractionMessage as
|
|
4
|
-
import { cn as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { memo as pn, useRef as p, useMemo as c, useState as m, useCallback as r, useEffect as s } from "react";
|
|
3
|
+
import { isSandboxInteractionMessage as hn } from "../../lib/sandboxInteraction.es.js";
|
|
4
|
+
import { cn as J } from "../../lib/utils.es.js";
|
|
5
|
+
import vn from "../ui/loading-overlay-card.es.js";
|
|
6
|
+
import gn from "../ContentRender/ContentRender.es.js";
|
|
7
|
+
import wt from "../ContentRender/IframeSandbox.es.js";
|
|
8
8
|
import "../ui/inputGroup/input-group.es.js";
|
|
9
|
-
import { getInteractionDefaultValues as
|
|
10
|
-
import { isMobileDevice as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { DEFAULT_MOBILE_VIEW_MODE as
|
|
16
|
-
import { shouldPresentInteractionOverlay as
|
|
17
|
-
import { shouldAutoAdvanceIntoAppendedMarker as
|
|
18
|
-
import {
|
|
19
|
-
import { resolvePlayerCustomActionElement as
|
|
20
|
-
import { createPlaybackTimeStore as
|
|
21
|
-
import { shouldUseAutoAdvanceToggle as
|
|
9
|
+
import { getInteractionDefaultValues as yn, getInteractionDefaultSelectedValues as Sn } from "../../lib/interaction-defaults.es.js";
|
|
10
|
+
import { isMobileDevice as bn, isLandscapeViewport as It, subscribeMobileDeviceChange as An } from "../../lib/mobileDevice.es.js";
|
|
11
|
+
import xn from "./Player.es.js";
|
|
12
|
+
import wn from "./SubtitleOverlay.es.js";
|
|
13
|
+
import In from "./useSlide.es.js";
|
|
14
|
+
import _n from "./useWakePlayerFromIframe.es.js";
|
|
15
|
+
import { DEFAULT_MOBILE_VIEW_MODE as we, resolveMobileViewModeState as En } from "./utils/mobileScreenMode.es.js";
|
|
16
|
+
import { shouldPresentInteractionOverlay as Tn } from "./utils/interactionPlayback.es.js";
|
|
17
|
+
import { shouldAutoAdvanceIntoAppendedMarker as Rn } from "./utils/appendedMarkerAdvance.es.js";
|
|
18
|
+
import { getPlaybackSequenceTransition as Cn } from "./utils/playbackSequence.es.js";
|
|
19
|
+
import { resolvePlayerCustomActionElement as Pn, getPlayerCustomActionCount as Mn } from "./utils/playerCustomActions.es.js";
|
|
20
|
+
import { createPlaybackTimeStore as Fn } from "./utils/playbackTimeStore.es.js";
|
|
21
|
+
import { shouldUseAutoAdvanceToggle as kn } from "./utils/playerToggleMode.es.js";
|
|
22
22
|
/* empty css */
|
|
23
|
-
import
|
|
24
|
-
const
|
|
23
|
+
import Bn from "../../markdown-flow-ui/node_modules/.pnpm/lucide-react@0.525.0_react@19.0.1/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
|
|
24
|
+
const Nn = 2e3, On = 300, jn = 160, Ln = 16, Ve = "waitingForAudio", _t = {
|
|
25
25
|
waitingForAudio: "Waiting for current slide audio...",
|
|
26
26
|
loadingAudio: "Loading current slide audio...",
|
|
27
27
|
waitingForMoreAudio: "Waiting for more current slide audio..."
|
|
28
|
-
},
|
|
28
|
+
}, Kn = (S, w) => typeof S == "string" ? S : S[w] ?? S[Ve] ?? _t[w], Vn = (S, w) => w ? S !== "loadingAudio" : !1, Et = pn(
|
|
29
29
|
({
|
|
30
30
|
content: S,
|
|
31
31
|
title: w,
|
|
32
32
|
defaultButtonText: I,
|
|
33
|
-
defaultInputText:
|
|
33
|
+
defaultInputText: Q,
|
|
34
34
|
defaultSelectedValues: _,
|
|
35
|
-
confirmButtonText:
|
|
36
|
-
copyButtonText:
|
|
37
|
-
copiedButtonText:
|
|
38
|
-
onSend:
|
|
35
|
+
confirmButtonText: V,
|
|
36
|
+
copyButtonText: Z,
|
|
37
|
+
copiedButtonText: Ie,
|
|
38
|
+
onSend: _e,
|
|
39
39
|
readonly: D = !1
|
|
40
40
|
}) => /* @__PURE__ */ n.jsxs("div", { className: "slide-player__interaction-card", children: [
|
|
41
41
|
/* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ n.jsx("p", { className: "slide-player__interaction-title", children: w }) }),
|
|
42
42
|
/* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ n.jsx(
|
|
43
|
-
|
|
43
|
+
gn,
|
|
44
44
|
{
|
|
45
45
|
content: S,
|
|
46
46
|
defaultButtonText: I,
|
|
47
|
-
defaultInputText:
|
|
47
|
+
defaultInputText: Q,
|
|
48
48
|
defaultSelectedValues: _,
|
|
49
|
-
confirmButtonText:
|
|
50
|
-
copyButtonText:
|
|
51
|
-
copiedButtonText:
|
|
52
|
-
onSend:
|
|
49
|
+
confirmButtonText: V,
|
|
50
|
+
copyButtonText: Z,
|
|
51
|
+
copiedButtonText: Ie,
|
|
52
|
+
onSend: _e,
|
|
53
53
|
readonly: D,
|
|
54
54
|
enableTypewriter: !1,
|
|
55
55
|
sandboxMode: "content"
|
|
@@ -57,104 +57,104 @@ const Ln = 2e3, Vn = 300, qn = 160, Dn = 16, De = "waitingForAudio", Ct = {
|
|
|
57
57
|
) })
|
|
58
58
|
] })
|
|
59
59
|
);
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
const _ = w[
|
|
60
|
+
Et.displayName = "InteractionOverlayCard";
|
|
61
|
+
const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
|
|
62
|
+
const _ = w[Q];
|
|
63
63
|
return I.sequence_number === _?.sequence_number && I.type === _?.type && I.content === _?.content;
|
|
64
|
-
}),
|
|
64
|
+
}), mr = ({
|
|
65
65
|
elementList: S = [],
|
|
66
66
|
showPlayer: w = !0,
|
|
67
67
|
playerAlwaysVisible: I = !1,
|
|
68
|
-
playerClassName:
|
|
68
|
+
playerClassName: Q,
|
|
69
69
|
fullscreenHeader: _,
|
|
70
|
-
playerCustomActions:
|
|
71
|
-
playerCustomActionPauseOnActive:
|
|
72
|
-
bufferingText:
|
|
73
|
-
interactionTitle:
|
|
70
|
+
playerCustomActions: V,
|
|
71
|
+
playerCustomActionPauseOnActive: Z = !0,
|
|
72
|
+
bufferingText: Ie = _t,
|
|
73
|
+
interactionTitle: _e,
|
|
74
74
|
interactionTexts: D,
|
|
75
|
-
playerTexts:
|
|
76
|
-
playerAutoHideDelay:
|
|
77
|
-
markerAutoAdvanceDelay:
|
|
78
|
-
interactionDefaultValueOptions:
|
|
79
|
-
onSend:
|
|
80
|
-
onPlayerVisibilityChange:
|
|
81
|
-
onMobileViewModeChange:
|
|
82
|
-
onStepChange:
|
|
83
|
-
enableIframeScaling:
|
|
84
|
-
disableLoadingOverlay:
|
|
85
|
-
className:
|
|
86
|
-
onPointerDown:
|
|
87
|
-
...
|
|
75
|
+
playerTexts: Tt,
|
|
76
|
+
playerAutoHideDelay: Ee = 3e3,
|
|
77
|
+
markerAutoAdvanceDelay: De = Nn,
|
|
78
|
+
interactionDefaultValueOptions: de,
|
|
79
|
+
onSend: qe,
|
|
80
|
+
onPlayerVisibilityChange: Te,
|
|
81
|
+
onMobileViewModeChange: Ue,
|
|
82
|
+
onStepChange: ze,
|
|
83
|
+
enableIframeScaling: Rt = !0,
|
|
84
|
+
disableLoadingOverlay: R = !1,
|
|
85
|
+
className: Ct,
|
|
86
|
+
onPointerDown: Ge,
|
|
87
|
+
...Pt
|
|
88
88
|
}) => {
|
|
89
|
-
const
|
|
89
|
+
const fe = p(null), He = p(null), Re = p(null), We = p(null), ee = p(null), te = p(null), ne = p(null), re = p(null), $e = p(null), Ye = p([]), me = p(!1), q = p(null), Xe = p(null), Je = p({
|
|
90
90
|
markerCount: 0,
|
|
91
91
|
currentIndex: -1,
|
|
92
92
|
canGoNext: !1
|
|
93
93
|
}), {
|
|
94
|
-
currentElementList:
|
|
95
|
-
stepElementLists:
|
|
96
|
-
slideElementList:
|
|
94
|
+
currentElementList: B,
|
|
95
|
+
stepElementLists: Qe,
|
|
96
|
+
slideElementList: N,
|
|
97
97
|
currentIndex: d,
|
|
98
98
|
audioList: h,
|
|
99
|
-
currentAudioSequenceIndexes:
|
|
99
|
+
currentAudioSequenceIndexes: pe,
|
|
100
100
|
currentStepHasSpeakableElement: b,
|
|
101
|
-
currentInteractionElement:
|
|
102
|
-
canGoPrev:
|
|
101
|
+
currentInteractionElement: u,
|
|
102
|
+
canGoPrev: Mt,
|
|
103
103
|
canGoNext: x,
|
|
104
|
-
handlePrev:
|
|
105
|
-
handleNext:
|
|
106
|
-
} =
|
|
104
|
+
handlePrev: Ze,
|
|
105
|
+
handleNext: C
|
|
106
|
+
} = In(S), oe = c(() => {
|
|
107
107
|
if (!(d < 0))
|
|
108
|
-
return
|
|
109
|
-
}, [d,
|
|
108
|
+
return N[d];
|
|
109
|
+
}, [d, N]), Ft = N.filter(
|
|
110
110
|
(e) => e.is_renderable !== !1
|
|
111
|
-
).length === 1, E = w && (
|
|
112
|
-
() =>
|
|
113
|
-
[h,
|
|
114
|
-
), [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
] = m(0), [
|
|
118
|
-
|
|
119
|
-
), [
|
|
120
|
-
() =>
|
|
121
|
-
),
|
|
122
|
-
effectiveMobileViewMode:
|
|
123
|
-
isImmersiveMobileFullscreen:
|
|
124
|
-
isNativeMobileFullscreen:
|
|
125
|
-
shouldRotateFullscreenViewport:
|
|
126
|
-
} =
|
|
127
|
-
() =>
|
|
128
|
-
hasManualMobileViewMode:
|
|
129
|
-
isMobileDevice:
|
|
130
|
-
mobileViewMode:
|
|
111
|
+
).length === 1, E = w && (N.length > 0 || h.length > 0 || !!u), P = c(
|
|
112
|
+
() => pe.map((e) => h[e]?.audioKey).filter((e) => !!e),
|
|
113
|
+
[h, pe]
|
|
114
|
+
), [et, he] = m(!0), [ve, se] = m(!1), [ie, tt] = m(!0), [v, U] = m(null), [kt, g] = m(!1), [Bt, Ce] = m(Ve), [M, nt] = m(!1), [Nt, Pe] = m(!1), [rt, Ot] = m(!0), [Me, Fe] = m(!1), [o, ke] = m(), [ge, ye] = m(!1), [
|
|
115
|
+
jt,
|
|
116
|
+
le
|
|
117
|
+
] = m(0), [ot, Lt] = m(!1), O = c(() => bn(), []), [Se, Be] = m(
|
|
118
|
+
we
|
|
119
|
+
), [st, Ne] = m(!1), [Kt, it] = m(
|
|
120
|
+
() => O ? It() : !1
|
|
121
|
+
), z = c(() => Fn(), []), {
|
|
122
|
+
effectiveMobileViewMode: G,
|
|
123
|
+
isImmersiveMobileFullscreen: H,
|
|
124
|
+
isNativeMobileFullscreen: lt,
|
|
125
|
+
shouldRotateFullscreenViewport: Vt
|
|
126
|
+
} = c(
|
|
127
|
+
() => En({
|
|
128
|
+
hasManualMobileViewMode: st,
|
|
129
|
+
isMobileDevice: O,
|
|
130
|
+
mobileViewMode: Se
|
|
131
131
|
}),
|
|
132
132
|
[
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
st,
|
|
134
|
+
O,
|
|
135
|
+
Kt,
|
|
136
|
+
Se
|
|
137
137
|
]
|
|
138
|
-
),
|
|
138
|
+
), Dt = p(G), F = E && (I || et), qt = H && F, Ut = H && F, zt = H || lt, ct = ot && !O, Gt = r(
|
|
139
139
|
(e) => {
|
|
140
|
-
|
|
140
|
+
Ne(!0), Be(e);
|
|
141
141
|
},
|
|
142
142
|
[]
|
|
143
|
-
),
|
|
144
|
-
|
|
145
|
-
}, []),
|
|
146
|
-
|
|
147
|
-
}, [_,
|
|
148
|
-
|
|
149
|
-
}, []),
|
|
150
|
-
|
|
151
|
-
}, []), { mountedStepStates:
|
|
143
|
+
), at = r(() => {
|
|
144
|
+
Ne(!1), Be(we);
|
|
145
|
+
}, []), Ht = r(() => {
|
|
146
|
+
at(), _?.onBack?.();
|
|
147
|
+
}, [_, at]), ut = r((e) => {
|
|
148
|
+
Fe(e);
|
|
149
|
+
}, []), dt = r(() => {
|
|
150
|
+
Fe((e) => !e);
|
|
151
|
+
}, []), { mountedStepStates: Wt, currentMountedStateIndex: $t } = c(() => {
|
|
152
152
|
const e = [], t = /* @__PURE__ */ new Map();
|
|
153
|
-
return
|
|
153
|
+
return Qe.forEach((l, f) => {
|
|
154
154
|
const i = e.findIndex(
|
|
155
|
-
(
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
(a) => Dn(
|
|
156
|
+
a.elementList,
|
|
157
|
+
l
|
|
158
158
|
)
|
|
159
159
|
);
|
|
160
160
|
if (i >= 0) {
|
|
@@ -162,221 +162,218 @@ const Gn = (S, w) => S.length === w.length && S.every((I, Z) => {
|
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
e.push({
|
|
165
|
-
elementList:
|
|
165
|
+
elementList: l,
|
|
166
166
|
sourceStepIndexes: [f]
|
|
167
167
|
}), t.set(f, e.length - 1);
|
|
168
168
|
}), {
|
|
169
169
|
mountedStepStates: e,
|
|
170
170
|
currentMountedStateIndex: d >= 0 ? t.get(d) ?? -1 : -1
|
|
171
171
|
};
|
|
172
|
-
}, [d,
|
|
172
|
+
}, [d, Qe]), ft = c(() => String(d), [d]), y = c(() => v ? h.findIndex(
|
|
173
173
|
(e) => (e.audioKey ?? "") === v
|
|
174
|
-
) : -1, [h, v]),
|
|
175
|
-
() =>
|
|
176
|
-
[h,
|
|
177
|
-
),
|
|
178
|
-
() =>
|
|
179
|
-
[
|
|
180
|
-
),
|
|
181
|
-
() => Fn({
|
|
182
|
-
audioSequenceKeys: O,
|
|
183
|
-
lastCompletedAudioKey: ot
|
|
184
|
-
}),
|
|
185
|
-
[O, ot]
|
|
186
|
-
), Le = l(
|
|
174
|
+
) : -1, [h, v]), Oe = c(
|
|
175
|
+
() => y >= 0 ? h[y] : void 0,
|
|
176
|
+
[h, y]
|
|
177
|
+
), Yt = Oe?.element?.subtitle_cues ?? [], be = c(
|
|
178
|
+
() => P[0] ?? "none",
|
|
179
|
+
[P]
|
|
180
|
+
), je = c(
|
|
187
181
|
() => ({
|
|
188
|
-
currentElement:
|
|
189
|
-
currentAudioIndex:
|
|
190
|
-
currentAudioSequenceIndexes:
|
|
182
|
+
currentElement: Pn({
|
|
183
|
+
currentAudioIndex: y,
|
|
184
|
+
currentAudioSequenceIndexes: pe,
|
|
191
185
|
audioList: h,
|
|
192
186
|
currentInteractionElement: o,
|
|
193
|
-
currentStepElement:
|
|
187
|
+
currentStepElement: oe
|
|
194
188
|
}),
|
|
195
189
|
currentIndex: d,
|
|
196
|
-
currentStepElement:
|
|
197
|
-
isActive:
|
|
198
|
-
setActive:
|
|
199
|
-
toggleActive:
|
|
190
|
+
currentStepElement: oe,
|
|
191
|
+
isActive: Me,
|
|
192
|
+
setActive: ut,
|
|
193
|
+
toggleActive: dt
|
|
200
194
|
}),
|
|
201
195
|
[
|
|
202
196
|
o,
|
|
203
197
|
h,
|
|
204
|
-
|
|
205
|
-
|
|
198
|
+
y,
|
|
199
|
+
pe,
|
|
206
200
|
d,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
201
|
+
oe,
|
|
202
|
+
Me,
|
|
203
|
+
ut,
|
|
204
|
+
dt
|
|
211
205
|
]
|
|
212
|
-
),
|
|
213
|
-
() =>
|
|
214
|
-
|
|
215
|
-
|
|
206
|
+
), Le = c(
|
|
207
|
+
() => Mn(
|
|
208
|
+
V,
|
|
209
|
+
je
|
|
216
210
|
),
|
|
217
|
-
[
|
|
218
|
-
),
|
|
211
|
+
[je, V]
|
|
212
|
+
), Xt = c(
|
|
219
213
|
() => ({
|
|
220
|
-
"--slide-player-custom-action-count": String(
|
|
214
|
+
"--slide-player-custom-action-count": String(Le),
|
|
221
215
|
"--slide-player-mobile-control-count": String(
|
|
222
|
-
|
|
216
|
+
Le + 4
|
|
223
217
|
)
|
|
224
218
|
}),
|
|
225
|
-
[
|
|
226
|
-
),
|
|
227
|
-
|
|
228
|
-
)}` : "none", [
|
|
229
|
-
() => [
|
|
230
|
-
[
|
|
231
|
-
),
|
|
219
|
+
[Le]
|
|
220
|
+
), mt = P.length > 0, pt = c(() => u ? `${u.sequence_number ?? "none"}:${String(
|
|
221
|
+
u.content ?? ""
|
|
222
|
+
)}` : "none", [u]), ce = c(
|
|
223
|
+
() => [ft, pt].join("|"),
|
|
224
|
+
[pt, ft]
|
|
225
|
+
), Jt = c(
|
|
232
226
|
() => [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
String(
|
|
227
|
+
ce,
|
|
228
|
+
Oe?.audioKey ?? "none",
|
|
229
|
+
String(y)
|
|
236
230
|
].join("|"),
|
|
237
|
-
[
|
|
238
|
-
),
|
|
239
|
-
(t) => t.audioKey ===
|
|
240
|
-
)?.audioUrl?.trim() ?? "", [h,
|
|
241
|
-
() =>
|
|
231
|
+
[y, Oe?.audioKey, ce]
|
|
232
|
+
), ht = !!c(() => !be || be === "none" ? "" : h.find(
|
|
233
|
+
(t) => t.audioKey === be
|
|
234
|
+
)?.audioUrl?.trim() ?? "", [h, be]), L = Z && !!V && Me, ae = c(
|
|
235
|
+
() => kn({
|
|
242
236
|
canGoNext: x,
|
|
243
|
-
currentAudioIndex:
|
|
237
|
+
currentAudioIndex: y,
|
|
244
238
|
currentStepHasSpeakableElement: b,
|
|
245
|
-
hasInteraction: !!
|
|
239
|
+
hasInteraction: !!u
|
|
246
240
|
}),
|
|
247
241
|
[
|
|
248
242
|
x,
|
|
249
|
-
|
|
250
|
-
|
|
243
|
+
y,
|
|
244
|
+
u,
|
|
251
245
|
b
|
|
252
246
|
]
|
|
253
|
-
),
|
|
254
|
-
|
|
255
|
-
}, []),
|
|
247
|
+
), K = r(() => {
|
|
248
|
+
ee.current !== null && (window.clearTimeout(ee.current), ee.current = null);
|
|
249
|
+
}, []), j = r(() => {
|
|
250
|
+
ne.current !== null && (window.clearTimeout(ne.current), ne.current = null);
|
|
251
|
+
}, []), k = r(() => {
|
|
256
252
|
re.current !== null && (window.clearTimeout(re.current), re.current = null);
|
|
257
|
-
}, []),
|
|
258
|
-
|
|
253
|
+
}, []), W = r(() => {
|
|
254
|
+
te.current !== null && (window.clearTimeout(te.current), te.current = null);
|
|
259
255
|
}, []), $ = r(() => {
|
|
260
|
-
|
|
261
|
-
}, []), Y = r(() => {
|
|
262
|
-
$(), N(), M(), z(null), G.reset(), y(!1), Re(De), Me(!1), st(null), Fe(!1), Ne(void 0), Se(!1), ce(0);
|
|
256
|
+
W(), j(), k(), U(null), z.reset(), g(!1), Ce(Ve), nt(!1), Pe(!1), ke(void 0), ye(!1), le(0);
|
|
263
257
|
}, [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
]),
|
|
269
|
-
|
|
258
|
+
W,
|
|
259
|
+
j,
|
|
260
|
+
k,
|
|
261
|
+
z
|
|
262
|
+
]), Y = r(() => {
|
|
263
|
+
const e = P[0];
|
|
264
|
+
return e ? (U(e), !0) : !1;
|
|
265
|
+
}, [P]), Ae = r(() => {
|
|
266
|
+
j(), k(), ye(!1), le(0), !Y() && x && C();
|
|
270
267
|
}, [
|
|
271
268
|
x,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
]),
|
|
269
|
+
j,
|
|
270
|
+
k,
|
|
271
|
+
C,
|
|
272
|
+
Y
|
|
273
|
+
]), vt = r(
|
|
277
274
|
(e) => {
|
|
278
|
-
if (
|
|
275
|
+
if (k(), !e)
|
|
279
276
|
return;
|
|
280
277
|
const t = () => {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
),
|
|
278
|
+
re.current = null, le(
|
|
279
|
+
jn
|
|
280
|
+
), ye(!0), q.current = null;
|
|
284
281
|
};
|
|
285
|
-
|
|
282
|
+
re.current = window.setTimeout(
|
|
286
283
|
t,
|
|
287
|
-
|
|
284
|
+
On
|
|
288
285
|
);
|
|
289
286
|
},
|
|
290
|
-
[
|
|
287
|
+
[k]
|
|
291
288
|
), A = r(
|
|
292
|
-
(e =
|
|
293
|
-
E && (
|
|
294
|
-
|
|
295
|
-
},
|
|
289
|
+
(e = ve) => {
|
|
290
|
+
E && (he(!0), K(), !(I || !e || Ee <= 0) && (ee.current = window.setTimeout(() => {
|
|
291
|
+
he(!1), ee.current = null;
|
|
292
|
+
}, Ee)));
|
|
296
293
|
},
|
|
297
294
|
[
|
|
298
|
-
|
|
299
|
-
|
|
295
|
+
K,
|
|
296
|
+
ve,
|
|
300
297
|
I,
|
|
301
|
-
|
|
298
|
+
Ee,
|
|
302
299
|
E
|
|
303
300
|
]
|
|
304
|
-
),
|
|
301
|
+
), ue = !!(u?.readonly || u?.user_input?.trim()), X = !!u && !ue;
|
|
305
302
|
s(() => {
|
|
306
|
-
|
|
307
|
-
}, [d,
|
|
308
|
-
|
|
303
|
+
tt(!0), Z && Fe(!1);
|
|
304
|
+
}, [d, Z]), s(() => () => {
|
|
305
|
+
W(), K(), j(), k();
|
|
309
306
|
}, [
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
]), s(() => (
|
|
315
|
-
|
|
316
|
-
}), [
|
|
317
|
-
|
|
318
|
-
}, [
|
|
319
|
-
if (!
|
|
320
|
-
|
|
307
|
+
W,
|
|
308
|
+
j,
|
|
309
|
+
k,
|
|
310
|
+
K
|
|
311
|
+
]), s(() => (Te?.(F), () => {
|
|
312
|
+
Te?.(!1);
|
|
313
|
+
}), [Te, F]), s(() => {
|
|
314
|
+
O || Se === we || (Ne(!1), Be(we));
|
|
315
|
+
}, [O, Se]), s(() => {
|
|
316
|
+
if (!O) {
|
|
317
|
+
it(!1);
|
|
321
318
|
return;
|
|
322
319
|
}
|
|
323
320
|
const e = () => {
|
|
324
|
-
|
|
321
|
+
it(It());
|
|
325
322
|
};
|
|
326
|
-
return e(),
|
|
327
|
-
}, [
|
|
328
|
-
|
|
329
|
-
}, [
|
|
330
|
-
|
|
331
|
-
}, [
|
|
332
|
-
|
|
333
|
-
}, [d,
|
|
334
|
-
const e =
|
|
323
|
+
return e(), An(e);
|
|
324
|
+
}, [O]), s(() => {
|
|
325
|
+
Ue?.(G);
|
|
326
|
+
}, [G, Ue]), s(() => {
|
|
327
|
+
Dt.current = G;
|
|
328
|
+
}, [G]), s(() => {
|
|
329
|
+
ze?.(oe, d);
|
|
330
|
+
}, [d, oe, ze]), s(() => {
|
|
331
|
+
const e = Je.current, t = Rn(
|
|
335
332
|
{
|
|
336
333
|
previousMarkerCount: e.markerCount,
|
|
337
|
-
nextMarkerCount:
|
|
334
|
+
nextMarkerCount: N.length,
|
|
338
335
|
previousIndex: e.currentIndex,
|
|
339
336
|
previousCanGoNext: e.canGoNext,
|
|
340
337
|
nextCanGoNext: x,
|
|
341
338
|
currentAudioKey: v,
|
|
342
|
-
hasCompletedCurrentStepAudio:
|
|
343
|
-
hasResolvedCurrentInteraction:
|
|
339
|
+
hasCompletedCurrentStepAudio: M,
|
|
340
|
+
hasResolvedCurrentInteraction: ue,
|
|
344
341
|
currentStepHasSpeakableElement: b,
|
|
345
|
-
currentInteractionElement:
|
|
346
|
-
isAutoAdvanceEnabled:
|
|
342
|
+
currentInteractionElement: u,
|
|
343
|
+
isAutoAdvanceEnabled: ie,
|
|
347
344
|
shouldUseSilentStepAutoAdvanceToggle: ae
|
|
348
345
|
}
|
|
349
346
|
);
|
|
350
|
-
|
|
351
|
-
markerCount:
|
|
347
|
+
Je.current = {
|
|
348
|
+
markerCount: N.length,
|
|
352
349
|
currentIndex: d,
|
|
353
350
|
canGoNext: x
|
|
354
|
-
}, t &&
|
|
351
|
+
}, t && C();
|
|
355
352
|
}, [
|
|
356
353
|
x,
|
|
357
354
|
v,
|
|
358
355
|
d,
|
|
359
|
-
|
|
356
|
+
u,
|
|
360
357
|
b,
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
358
|
+
C,
|
|
359
|
+
M,
|
|
360
|
+
ue,
|
|
361
|
+
ie,
|
|
365
362
|
ae,
|
|
366
|
-
|
|
363
|
+
N.length
|
|
367
364
|
]), s(() => {
|
|
368
365
|
if (!E) {
|
|
369
|
-
|
|
366
|
+
K(), he(!1);
|
|
370
367
|
return;
|
|
371
368
|
}
|
|
372
369
|
if (I) {
|
|
373
|
-
|
|
370
|
+
K(), he(!0);
|
|
374
371
|
return;
|
|
375
372
|
}
|
|
376
|
-
|
|
373
|
+
ve || A(!0);
|
|
377
374
|
}, [
|
|
378
|
-
|
|
379
|
-
|
|
375
|
+
K,
|
|
376
|
+
ve,
|
|
380
377
|
I,
|
|
381
378
|
E,
|
|
382
379
|
A
|
|
@@ -384,242 +381,242 @@ const Gn = (S, w) => S.length === w.length && S.every((I, Z) => {
|
|
|
384
381
|
if (typeof window > "u")
|
|
385
382
|
return;
|
|
386
383
|
const e = (t) => {
|
|
387
|
-
t.origin === window.location.origin &&
|
|
384
|
+
t.origin === window.location.origin && hn(t.data) && t.data.eventType === "click" && E && (se(!0), A(!0));
|
|
388
385
|
};
|
|
389
386
|
return window.addEventListener("message", e), () => {
|
|
390
387
|
window.removeEventListener("message", e);
|
|
391
388
|
};
|
|
392
|
-
}, [E, A]),
|
|
393
|
-
sectionRef:
|
|
389
|
+
}, [E, A]), _n({
|
|
390
|
+
sectionRef: fe,
|
|
394
391
|
enabled: E,
|
|
395
392
|
onWake: () => {
|
|
396
|
-
|
|
393
|
+
se(!0), A(!0);
|
|
397
394
|
}
|
|
398
395
|
}), s(() => {
|
|
399
|
-
const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } =
|
|
400
|
-
previousResetKey:
|
|
401
|
-
nextResetKey:
|
|
396
|
+
const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = Cn({
|
|
397
|
+
previousResetKey: Xe.current,
|
|
398
|
+
nextResetKey: ce,
|
|
402
399
|
currentAudioKey: v,
|
|
403
|
-
hasCompletedCurrentStepAudio:
|
|
400
|
+
hasCompletedCurrentStepAudio: M
|
|
404
401
|
});
|
|
405
|
-
|
|
406
|
-
const
|
|
407
|
-
hasInteraction: !!
|
|
408
|
-
shouldBlockPlaybackForInteraction:
|
|
409
|
-
shouldOpenInteractionOverlayAfterAudio:
|
|
402
|
+
Xe.current = ce;
|
|
403
|
+
const l = q.current === d && !!u, f = Tn({
|
|
404
|
+
hasInteraction: !!u,
|
|
405
|
+
shouldBlockPlaybackForInteraction: X,
|
|
406
|
+
shouldOpenInteractionOverlayAfterAudio: l,
|
|
410
407
|
hasPlaybackContextChanged: e,
|
|
411
|
-
hasResolvedCurrentInteraction:
|
|
408
|
+
hasResolvedCurrentInteraction: ue,
|
|
412
409
|
currentStepHasSpeakableElement: b
|
|
413
410
|
});
|
|
414
|
-
if (e &&
|
|
415
|
-
if (
|
|
416
|
-
|
|
411
|
+
if (e && $(), !(B.length === 0 && !u) && !L) {
|
|
412
|
+
if (u && ke(u), f) {
|
|
413
|
+
vt(u);
|
|
417
414
|
return;
|
|
418
415
|
}
|
|
419
|
-
if (
|
|
416
|
+
if (k(), q.current = null, !!t && !Y()) {
|
|
420
417
|
if (b) {
|
|
421
|
-
if (
|
|
422
|
-
|
|
418
|
+
if (R) {
|
|
419
|
+
g(!1);
|
|
423
420
|
return;
|
|
424
421
|
}
|
|
425
|
-
|
|
422
|
+
g(!0);
|
|
426
423
|
return;
|
|
427
424
|
}
|
|
428
|
-
if (x && !(ae && !
|
|
429
|
-
return
|
|
430
|
-
|
|
431
|
-
},
|
|
432
|
-
|
|
425
|
+
if (x && !(ae && !ie))
|
|
426
|
+
return te.current = window.setTimeout(() => {
|
|
427
|
+
te.current = null, C();
|
|
428
|
+
}, De), () => {
|
|
429
|
+
W();
|
|
433
430
|
};
|
|
434
431
|
}
|
|
435
432
|
}
|
|
436
433
|
}, [
|
|
437
434
|
x,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
435
|
+
W,
|
|
436
|
+
B.length,
|
|
437
|
+
u,
|
|
441
438
|
v,
|
|
442
|
-
|
|
439
|
+
ce,
|
|
443
440
|
b,
|
|
444
|
-
|
|
445
|
-
P,
|
|
446
|
-
j,
|
|
441
|
+
De,
|
|
447
442
|
C,
|
|
448
|
-
le,
|
|
449
|
-
de,
|
|
450
|
-
J,
|
|
451
443
|
M,
|
|
452
|
-
|
|
453
|
-
|
|
444
|
+
R,
|
|
445
|
+
ie,
|
|
446
|
+
ue,
|
|
454
447
|
X,
|
|
448
|
+
k,
|
|
449
|
+
$,
|
|
450
|
+
vt,
|
|
451
|
+
Y,
|
|
455
452
|
L,
|
|
456
453
|
ae
|
|
457
454
|
]), s(() => {
|
|
458
|
-
if (
|
|
459
|
-
|
|
455
|
+
if (R || L || !b || X) {
|
|
456
|
+
g(!1);
|
|
460
457
|
return;
|
|
461
458
|
}
|
|
462
|
-
if (
|
|
463
|
-
|
|
459
|
+
if (M) {
|
|
460
|
+
g(!1);
|
|
464
461
|
return;
|
|
465
462
|
}
|
|
466
|
-
if (
|
|
467
|
-
|
|
463
|
+
if (mt) {
|
|
464
|
+
g(!1);
|
|
468
465
|
return;
|
|
469
466
|
}
|
|
470
|
-
|
|
467
|
+
Ce("waitingForAudio"), g(!0);
|
|
471
468
|
}, [
|
|
472
|
-
|
|
469
|
+
mt,
|
|
473
470
|
b,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
C,
|
|
471
|
+
M,
|
|
472
|
+
R,
|
|
477
473
|
L,
|
|
478
|
-
|
|
474
|
+
X
|
|
479
475
|
]), s(() => {
|
|
480
|
-
v ||
|
|
476
|
+
v || P.length === 0 || L || !b || X || M || Y();
|
|
481
477
|
}, [
|
|
482
478
|
v,
|
|
483
|
-
|
|
479
|
+
P,
|
|
484
480
|
b,
|
|
481
|
+
M,
|
|
485
482
|
L,
|
|
486
|
-
|
|
487
|
-
|
|
483
|
+
X,
|
|
484
|
+
Y
|
|
488
485
|
]), s(() => {
|
|
489
|
-
!v ||
|
|
490
|
-
}, [
|
|
491
|
-
|
|
492
|
-
}, [
|
|
493
|
-
|
|
494
|
-
}, [
|
|
495
|
-
const
|
|
486
|
+
!v || y >= 0 || U(null);
|
|
487
|
+
}, [y, v]), s(() => {
|
|
488
|
+
y >= 0 || z.reset();
|
|
489
|
+
}, [y, z]), s(() => {
|
|
490
|
+
Pe(!1);
|
|
491
|
+
}, [Jt]);
|
|
492
|
+
const gt = c(() => {
|
|
496
493
|
if (!o)
|
|
497
494
|
return {};
|
|
498
495
|
const e = !!o.user_input?.trim();
|
|
499
|
-
return
|
|
496
|
+
return yn(
|
|
500
497
|
typeof o.content == "string" ? o.content : void 0,
|
|
501
498
|
o.user_input,
|
|
502
|
-
e ? void 0 :
|
|
499
|
+
e ? void 0 : de
|
|
503
500
|
);
|
|
504
|
-
}, [o,
|
|
501
|
+
}, [o, de]), Qt = c(() => {
|
|
505
502
|
if (!o)
|
|
506
503
|
return;
|
|
507
504
|
const e = !!o.user_input?.trim();
|
|
508
|
-
return
|
|
505
|
+
return Sn(
|
|
509
506
|
typeof o.content == "string" ? o.content : void 0,
|
|
510
507
|
o.user_input,
|
|
511
|
-
e ? void 0 :
|
|
508
|
+
e ? void 0 : de
|
|
512
509
|
);
|
|
513
|
-
}, [o,
|
|
510
|
+
}, [o, de]), yt = !!o?.user_input?.trim(), St = !!o?.readonly || yt, bt = St || yt, Ke = !!o && ge, Zt = r(
|
|
514
511
|
(e) => {
|
|
515
|
-
const
|
|
512
|
+
const l = [
|
|
516
513
|
...e.selectedValues ?? [],
|
|
517
514
|
e.inputText?.trim() ?? "",
|
|
518
515
|
e.buttonText?.trim() ?? ""
|
|
519
516
|
].filter(Boolean).join(", ");
|
|
520
|
-
|
|
517
|
+
ke((f) => !f || !l ? f : {
|
|
521
518
|
...f,
|
|
522
|
-
user_input:
|
|
523
|
-
}),
|
|
519
|
+
user_input: l
|
|
520
|
+
}), qe?.(e, o), Ae();
|
|
524
521
|
},
|
|
525
|
-
[o,
|
|
522
|
+
[o, Ae, qe]
|
|
526
523
|
);
|
|
527
524
|
s(() => {
|
|
528
525
|
const e = () => {
|
|
529
|
-
|
|
526
|
+
Lt(document.fullscreenElement === fe.current);
|
|
530
527
|
};
|
|
531
528
|
return e(), document.addEventListener("fullscreenchange", e), () => {
|
|
532
529
|
document.removeEventListener("fullscreenchange", e);
|
|
533
530
|
};
|
|
534
531
|
}, []), s(() => {
|
|
535
|
-
if (!
|
|
536
|
-
|
|
532
|
+
if (!Ke) {
|
|
533
|
+
le(0);
|
|
537
534
|
return;
|
|
538
535
|
}
|
|
539
|
-
const e =
|
|
536
|
+
const e = $e.current;
|
|
540
537
|
if (!e)
|
|
541
538
|
return;
|
|
542
539
|
const t = () => {
|
|
543
540
|
const f = Math.ceil(
|
|
544
541
|
e.getBoundingClientRect().height
|
|
545
542
|
);
|
|
546
|
-
|
|
547
|
-
f +
|
|
543
|
+
le(
|
|
544
|
+
f + Ln
|
|
548
545
|
);
|
|
549
546
|
};
|
|
550
547
|
if (t(), typeof ResizeObserver > "u")
|
|
551
548
|
return;
|
|
552
|
-
const
|
|
549
|
+
const l = new ResizeObserver(() => {
|
|
553
550
|
t();
|
|
554
551
|
});
|
|
555
|
-
return
|
|
556
|
-
|
|
552
|
+
return l.observe(e), () => {
|
|
553
|
+
l.disconnect();
|
|
557
554
|
};
|
|
558
|
-
}, [
|
|
559
|
-
if (
|
|
560
|
-
return
|
|
561
|
-
|
|
555
|
+
}, [Ke]), s(() => {
|
|
556
|
+
if (j(), !(!ge || !bt))
|
|
557
|
+
return ne.current = window.setTimeout(() => {
|
|
558
|
+
ne.current = null, Ae();
|
|
562
559
|
}, 2e3), () => {
|
|
563
|
-
|
|
560
|
+
j();
|
|
564
561
|
};
|
|
565
562
|
}, [
|
|
566
|
-
|
|
567
|
-
|
|
563
|
+
j,
|
|
564
|
+
Ae,
|
|
568
565
|
ge,
|
|
569
|
-
|
|
566
|
+
bt
|
|
570
567
|
]);
|
|
571
|
-
const
|
|
572
|
-
|
|
568
|
+
const en = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ n.jsx(n.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ n.jsx(
|
|
569
|
+
wt,
|
|
573
570
|
{
|
|
574
571
|
className: "content-render-iframe",
|
|
575
|
-
disableLoadingOverlay:
|
|
572
|
+
disableLoadingOverlay: R,
|
|
576
573
|
hideFullScreen: !0,
|
|
577
574
|
mode: "blackboard",
|
|
578
575
|
replaceRootScreenHeightWithFull: t.replaceRootScreenHeightWithFull,
|
|
579
576
|
type: "sandbox",
|
|
580
577
|
content: e.content,
|
|
581
|
-
enableScaling:
|
|
578
|
+
enableScaling: Rt
|
|
582
579
|
}
|
|
583
580
|
) : /* @__PURE__ */ n.jsx(
|
|
584
|
-
|
|
581
|
+
wt,
|
|
585
582
|
{
|
|
586
583
|
className: "content-render-iframe",
|
|
587
|
-
disableLoadingOverlay:
|
|
584
|
+
disableLoadingOverlay: R,
|
|
588
585
|
hideFullScreen: !0,
|
|
589
586
|
mode: "blackboard",
|
|
590
587
|
type: "markdown",
|
|
591
588
|
content: e.content
|
|
592
589
|
}
|
|
593
|
-
) : null,
|
|
590
|
+
) : null, tn = (e = [], t = !1) => {
|
|
594
591
|
if (e.length === 0)
|
|
595
592
|
return null;
|
|
596
|
-
const
|
|
593
|
+
const l = e.filter(
|
|
597
594
|
(i) => i.is_renderable !== !1
|
|
598
595
|
).length, f = e.reduce(
|
|
599
|
-
(i,
|
|
596
|
+
(i, a, T) => a.is_renderable !== !1 ? T : i,
|
|
600
597
|
-1
|
|
601
598
|
);
|
|
602
|
-
return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((i,
|
|
599
|
+
return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((i, a) => {
|
|
603
600
|
const T = i.type === "html" && i.is_renderable === !1;
|
|
604
601
|
return /* @__PURE__ */ n.jsx(
|
|
605
602
|
"div",
|
|
606
603
|
{
|
|
607
|
-
ref: t &&
|
|
604
|
+
ref: t && a === f ? We : null,
|
|
608
605
|
"aria-hidden": T || void 0,
|
|
609
|
-
className:
|
|
606
|
+
className: J(
|
|
610
607
|
"w-full shrink-0",
|
|
611
|
-
|
|
608
|
+
l === 1 && i.is_renderable !== !1 && "slide-element--single",
|
|
612
609
|
T ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : i.is_renderable === !1 && "hidden"
|
|
613
610
|
),
|
|
614
|
-
children:
|
|
615
|
-
replaceRootScreenHeightWithFull:
|
|
611
|
+
children: en(i, {
|
|
612
|
+
replaceRootScreenHeightWithFull: l === 1 && i.type === "html" && i.is_renderable !== !1
|
|
616
613
|
})
|
|
617
614
|
},
|
|
618
|
-
i.sequence_number ?? `${i.type}-${
|
|
615
|
+
i.sequence_number ?? `${i.type}-${a}`
|
|
619
616
|
);
|
|
620
617
|
}) });
|
|
621
|
-
},
|
|
622
|
-
const e =
|
|
618
|
+
}, nn = r(() => {
|
|
619
|
+
const e = fe.current;
|
|
623
620
|
if (e) {
|
|
624
621
|
if (document.fullscreenElement === e) {
|
|
625
622
|
document.exitFullscreen().catch(() => {
|
|
@@ -629,60 +626,60 @@ const Gn = (S, w) => S.length === w.length && S.every((I, Z) => {
|
|
|
629
626
|
e.requestFullscreen?.().catch(() => {
|
|
630
627
|
});
|
|
631
628
|
}
|
|
632
|
-
}, []),
|
|
633
|
-
const e =
|
|
629
|
+
}, []), At = r(() => {
|
|
630
|
+
const e = Re.current;
|
|
634
631
|
e && e.scrollTo({
|
|
635
632
|
top: e.scrollHeight,
|
|
636
633
|
behavior: "smooth"
|
|
637
634
|
});
|
|
638
|
-
}, []),
|
|
639
|
-
|
|
640
|
-
}, [
|
|
641
|
-
|
|
642
|
-
}, [
|
|
635
|
+
}, []), rn = r(() => {
|
|
636
|
+
me.current = !0, q.current = null, se(!0), g(!1), A(!0), $(), Ze();
|
|
637
|
+
}, [Ze, $, A]), on = r(() => {
|
|
638
|
+
me.current = !0, q.current = null, se(!0), g(!1), A(!0), $(), C();
|
|
639
|
+
}, [C, $, A]), sn = r(
|
|
643
640
|
({
|
|
644
641
|
loading: e,
|
|
645
642
|
reason: t
|
|
646
643
|
}) => {
|
|
647
|
-
if (
|
|
648
|
-
|
|
644
|
+
if (R) {
|
|
645
|
+
g(!1);
|
|
649
646
|
return;
|
|
650
647
|
}
|
|
651
|
-
if (!b ||
|
|
652
|
-
|
|
648
|
+
if (!b || M) {
|
|
649
|
+
g(!1);
|
|
653
650
|
return;
|
|
654
651
|
}
|
|
655
|
-
e && t &&
|
|
652
|
+
e && t && Ce(t), g(Vn(t, e));
|
|
656
653
|
},
|
|
657
654
|
[
|
|
658
655
|
b,
|
|
659
|
-
|
|
660
|
-
|
|
656
|
+
M,
|
|
657
|
+
R
|
|
661
658
|
]
|
|
662
659
|
);
|
|
663
660
|
s(() => {
|
|
664
|
-
|
|
665
|
-
}, [
|
|
666
|
-
const
|
|
661
|
+
R && g(!1);
|
|
662
|
+
}, [R]);
|
|
663
|
+
const ln = r(
|
|
667
664
|
(e) => {
|
|
668
665
|
const t = h[e]?.audioKey;
|
|
669
666
|
if (!t || !v || t !== v)
|
|
670
667
|
return;
|
|
671
|
-
const
|
|
672
|
-
(
|
|
668
|
+
const l = P.findIndex(
|
|
669
|
+
(a) => a === t
|
|
673
670
|
);
|
|
674
|
-
if (
|
|
675
|
-
|
|
671
|
+
if (l < 0) {
|
|
672
|
+
U(null);
|
|
676
673
|
return;
|
|
677
674
|
}
|
|
678
|
-
const f =
|
|
675
|
+
const f = l + 1, i = P[f];
|
|
679
676
|
if (i) {
|
|
680
|
-
|
|
677
|
+
U(i);
|
|
681
678
|
return;
|
|
682
679
|
}
|
|
683
|
-
if (
|
|
684
|
-
const
|
|
685
|
-
|
|
680
|
+
if (U(null), nt(!0), g(!1), x) {
|
|
681
|
+
const a = d + 1, T = N[a];
|
|
682
|
+
ht && T?.type === "interaction" && (q.current = a), C();
|
|
686
683
|
return;
|
|
687
684
|
}
|
|
688
685
|
},
|
|
@@ -691,76 +688,76 @@ const Gn = (S, w) => S.length === w.length && S.every((I, Z) => {
|
|
|
691
688
|
x,
|
|
692
689
|
d,
|
|
693
690
|
v,
|
|
694
|
-
O,
|
|
695
691
|
P,
|
|
696
|
-
|
|
697
|
-
|
|
692
|
+
C,
|
|
693
|
+
ht,
|
|
694
|
+
N
|
|
698
695
|
]
|
|
699
|
-
),
|
|
700
|
-
o &&
|
|
701
|
-
}, [o]),
|
|
696
|
+
), cn = r(() => {
|
|
697
|
+
o && ye((e) => !e);
|
|
698
|
+
}, [o]), xt = r(
|
|
702
699
|
(e) => {
|
|
703
|
-
e.stopPropagation(),
|
|
700
|
+
e.stopPropagation(), F && A(!0);
|
|
704
701
|
},
|
|
705
|
-
[
|
|
706
|
-
),
|
|
702
|
+
[et, A]
|
|
703
|
+
), an = r(
|
|
707
704
|
(e) => {
|
|
708
|
-
|
|
705
|
+
Ge?.(e);
|
|
709
706
|
},
|
|
710
|
-
[
|
|
711
|
-
),
|
|
712
|
-
|
|
713
|
-
}, [A]),
|
|
714
|
-
() =>
|
|
707
|
+
[Ge]
|
|
708
|
+
), un = r(() => {
|
|
709
|
+
se(!0), A(!0);
|
|
710
|
+
}, [A]), xe = c(
|
|
711
|
+
() => B.map(
|
|
715
712
|
(e, t) => `${e.sequence_number ?? `${e.type}-${t}`}:${String(e.is_new ?? "")}`
|
|
716
713
|
),
|
|
717
|
-
[
|
|
714
|
+
[B]
|
|
718
715
|
);
|
|
719
716
|
return s(() => {
|
|
720
|
-
const e =
|
|
721
|
-
(
|
|
717
|
+
const e = Ye.current, f = (e.length > 0 && e.length < xe.length && e.every((a, T) => a === xe[T]) ? B.slice(e.length) : []).some(
|
|
718
|
+
(a) => a.is_new === !1
|
|
722
719
|
);
|
|
723
|
-
if (
|
|
720
|
+
if (Ye.current = xe, !f)
|
|
724
721
|
return;
|
|
725
722
|
const i = window.requestAnimationFrame(() => {
|
|
726
|
-
const
|
|
727
|
-
if (!
|
|
723
|
+
const a = Re.current, T = We.current;
|
|
724
|
+
if (!a || !T)
|
|
728
725
|
return;
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
top: Math.max(
|
|
726
|
+
const dn = a.getBoundingClientRect(), fn = T.getBoundingClientRect(), mn = a.scrollTop + (fn.top - dn.top);
|
|
727
|
+
a.scrollTo({
|
|
728
|
+
top: Math.max(mn, 0),
|
|
732
729
|
behavior: "smooth"
|
|
733
730
|
});
|
|
734
731
|
});
|
|
735
732
|
return () => {
|
|
736
733
|
window.cancelAnimationFrame(i);
|
|
737
734
|
};
|
|
738
|
-
}, [
|
|
739
|
-
if (!
|
|
735
|
+
}, [B, xe]), s(() => {
|
|
736
|
+
if (!me.current || (me.current = !1, B.length === 0))
|
|
740
737
|
return;
|
|
741
738
|
const e = window.requestAnimationFrame(() => {
|
|
742
|
-
|
|
739
|
+
At();
|
|
743
740
|
});
|
|
744
741
|
return () => {
|
|
745
742
|
window.cancelAnimationFrame(e);
|
|
746
743
|
};
|
|
747
|
-
}, [
|
|
744
|
+
}, [B, At]), /* @__PURE__ */ n.jsxs(
|
|
748
745
|
"section",
|
|
749
746
|
{
|
|
750
|
-
ref:
|
|
751
|
-
className:
|
|
747
|
+
ref: fe,
|
|
748
|
+
className: J(
|
|
752
749
|
"relative h-full w-full",
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
750
|
+
O && "slide--mobile-device",
|
|
751
|
+
ct && "slide--browser-fullscreen",
|
|
752
|
+
H && "slide--mobile-landscape",
|
|
753
|
+
lt && "slide--mobile-landscape-native",
|
|
754
|
+
Ct
|
|
758
755
|
),
|
|
759
|
-
onClick:
|
|
760
|
-
onPointerDown:
|
|
761
|
-
...
|
|
756
|
+
onClick: un,
|
|
757
|
+
onPointerDown: an,
|
|
758
|
+
...Pt,
|
|
762
759
|
children: [
|
|
763
|
-
|
|
760
|
+
zt ? /* @__PURE__ */ n.jsx(
|
|
764
761
|
"div",
|
|
765
762
|
{
|
|
766
763
|
"aria-hidden": "true",
|
|
@@ -770,23 +767,23 @@ const Gn = (S, w) => S.length === w.length && S.every((I, Z) => {
|
|
|
770
767
|
/* @__PURE__ */ n.jsxs(
|
|
771
768
|
"div",
|
|
772
769
|
{
|
|
773
|
-
ref:
|
|
774
|
-
className:
|
|
770
|
+
ref: He,
|
|
771
|
+
className: J(
|
|
775
772
|
"slide__viewport relative h-full min-h-0 w-full",
|
|
776
|
-
|
|
777
|
-
|
|
773
|
+
H && "slide__viewport--mobile-landscape",
|
|
774
|
+
H && !Vt && "slide__viewport--mobile-landscape-native"
|
|
778
775
|
),
|
|
779
776
|
children: [
|
|
780
|
-
|
|
777
|
+
qt ? /* @__PURE__ */ n.jsxs("div", { className: "slide-landscape-header", children: [
|
|
781
778
|
/* @__PURE__ */ n.jsx(
|
|
782
779
|
"button",
|
|
783
780
|
{
|
|
784
781
|
"aria-label": _?.backAriaLabel ?? "Back",
|
|
785
782
|
className: "slide-landscape-header__back",
|
|
786
|
-
onClick:
|
|
783
|
+
onClick: Ht,
|
|
787
784
|
type: "button",
|
|
788
785
|
children: /* @__PURE__ */ n.jsx(
|
|
789
|
-
|
|
786
|
+
Bn,
|
|
790
787
|
{
|
|
791
788
|
className: "slide-landscape-header__icon h-6 w-6",
|
|
792
789
|
strokeWidth: 2.25
|
|
@@ -799,23 +796,23 @@ const Gn = (S, w) => S.length === w.length && S.every((I, Z) => {
|
|
|
799
796
|
/* @__PURE__ */ n.jsx(
|
|
800
797
|
"div",
|
|
801
798
|
{
|
|
802
|
-
className:
|
|
799
|
+
className: J(
|
|
803
800
|
"h-full min-h-0 w-full",
|
|
804
|
-
|
|
805
|
-
|
|
801
|
+
Ut && "slide__viewport-content--with-header",
|
|
802
|
+
Ft ? "slide-content--single" : "grid gap-4"
|
|
806
803
|
),
|
|
807
|
-
children:
|
|
804
|
+
children: B.length > 0 ? /* @__PURE__ */ n.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ n.jsx("div", { ref: Re, className: "slide-stage__layer w-full", children: Wt.map(
|
|
808
805
|
(e, t) => {
|
|
809
|
-
const
|
|
806
|
+
const l = t === $t;
|
|
810
807
|
return /* @__PURE__ */ n.jsx(
|
|
811
808
|
"div",
|
|
812
809
|
{
|
|
813
|
-
"aria-hidden": !
|
|
810
|
+
"aria-hidden": !l || void 0,
|
|
814
811
|
className: "w-full h-full",
|
|
815
|
-
style: { display:
|
|
816
|
-
children:
|
|
812
|
+
style: { display: l ? void 0 : "none" },
|
|
813
|
+
children: tn(
|
|
817
814
|
e.elementList,
|
|
818
|
-
|
|
815
|
+
l
|
|
819
816
|
)
|
|
820
817
|
},
|
|
821
818
|
e.sourceStepIndexes[0] ?? t
|
|
@@ -824,96 +821,96 @@ const Gn = (S, w) => S.length === w.length && S.every((I, Z) => {
|
|
|
824
821
|
) }) }) : null
|
|
825
822
|
}
|
|
826
823
|
),
|
|
827
|
-
|
|
828
|
-
|
|
824
|
+
kt ? /* @__PURE__ */ n.jsx(
|
|
825
|
+
vn,
|
|
829
826
|
{
|
|
830
|
-
message:
|
|
831
|
-
|
|
832
|
-
|
|
827
|
+
message: Kn(
|
|
828
|
+
Ie,
|
|
829
|
+
Bt
|
|
833
830
|
),
|
|
834
831
|
className: "absolute left-1/2 top-1/2 z-[3] -translate-x-1/2 -translate-y-1/2"
|
|
835
832
|
}
|
|
836
833
|
) : null,
|
|
837
834
|
/* @__PURE__ */ n.jsx(
|
|
838
|
-
|
|
835
|
+
wn,
|
|
839
836
|
{
|
|
840
|
-
extraBottomOffset:
|
|
841
|
-
hasPlayerGap:
|
|
842
|
-
isEnabled:
|
|
843
|
-
isPlayerHidden: E && !
|
|
844
|
-
playbackTimeStore:
|
|
845
|
-
subtitleCues:
|
|
837
|
+
extraBottomOffset: jt,
|
|
838
|
+
hasPlayerGap: F,
|
|
839
|
+
isEnabled: rt && Nt,
|
|
840
|
+
isPlayerHidden: E && !F,
|
|
841
|
+
playbackTimeStore: z,
|
|
842
|
+
subtitleCues: Yt
|
|
846
843
|
}
|
|
847
844
|
),
|
|
848
|
-
|
|
845
|
+
Ke ? /* @__PURE__ */ n.jsx(
|
|
849
846
|
"div",
|
|
850
847
|
{
|
|
851
|
-
ref:
|
|
852
|
-
className:
|
|
848
|
+
ref: $e,
|
|
849
|
+
className: J(
|
|
853
850
|
"slide-interaction-overlay",
|
|
854
|
-
|
|
851
|
+
F && E ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
|
|
855
852
|
),
|
|
856
|
-
onClick:
|
|
857
|
-
onPointerDown:
|
|
858
|
-
style:
|
|
853
|
+
onClick: xt,
|
|
854
|
+
onPointerDown: xt,
|
|
855
|
+
style: Xt,
|
|
859
856
|
children: /* @__PURE__ */ n.jsx(
|
|
860
|
-
|
|
857
|
+
Et,
|
|
861
858
|
{
|
|
862
859
|
content: String(o?.content ?? ""),
|
|
863
|
-
defaultButtonText:
|
|
864
|
-
defaultInputText:
|
|
865
|
-
defaultSelectedValues:
|
|
860
|
+
defaultButtonText: gt.buttonText ?? "",
|
|
861
|
+
defaultInputText: gt.inputText ?? "",
|
|
862
|
+
defaultSelectedValues: Qt,
|
|
866
863
|
confirmButtonText: D?.confirmButtonText,
|
|
867
864
|
copyButtonText: D?.copyButtonText,
|
|
868
865
|
copiedButtonText: D?.copiedButtonText,
|
|
869
|
-
onSend:
|
|
870
|
-
readonly:
|
|
871
|
-
title: D?.title ??
|
|
866
|
+
onSend: Zt,
|
|
867
|
+
readonly: St,
|
|
868
|
+
title: D?.title ?? _e ?? "Submit the content below to continue."
|
|
872
869
|
}
|
|
873
870
|
)
|
|
874
871
|
}
|
|
875
872
|
) : null,
|
|
876
873
|
E ? /* @__PURE__ */ n.jsx(
|
|
877
|
-
|
|
874
|
+
xn,
|
|
878
875
|
{
|
|
879
876
|
audioList: h,
|
|
880
|
-
className:
|
|
877
|
+
className: J(
|
|
881
878
|
"absolute left-1/2 z-[2] -translate-x-1/2",
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
!
|
|
879
|
+
ct ? "bottom-3" : "-bottom-3",
|
|
880
|
+
Q,
|
|
881
|
+
!F && "pointer-events-none opacity-0"
|
|
885
882
|
),
|
|
886
|
-
currentAudioIndex:
|
|
883
|
+
currentAudioIndex: y,
|
|
887
884
|
defaultPlaying: !0,
|
|
888
885
|
isPlaybackPaused: L,
|
|
889
|
-
isAutoAdvanceEnabled:
|
|
886
|
+
isAutoAdvanceEnabled: ie,
|
|
890
887
|
hasInteraction: !!o,
|
|
891
888
|
isInteractionOpen: ge,
|
|
892
|
-
isSubtitleEnabled:
|
|
893
|
-
onAutoAdvanceToggle:
|
|
894
|
-
onLoadingChange:
|
|
889
|
+
isSubtitleEnabled: rt,
|
|
890
|
+
onAutoAdvanceToggle: tt,
|
|
891
|
+
onLoadingChange: sn,
|
|
895
892
|
onPlaybackStarted: () => {
|
|
896
|
-
|
|
893
|
+
Pe(!0);
|
|
897
894
|
},
|
|
898
|
-
onPlaybackTimeChange:
|
|
895
|
+
onPlaybackTimeChange: z.setTime,
|
|
899
896
|
onSubtitleToggle: () => {
|
|
900
|
-
|
|
897
|
+
Ot((e) => !e);
|
|
901
898
|
},
|
|
902
899
|
nextDisabled: !x,
|
|
903
|
-
onEnded:
|
|
904
|
-
onFullscreen:
|
|
905
|
-
isFullscreen:
|
|
906
|
-
mobileViewMode:
|
|
907
|
-
settingsPortalContainer:
|
|
908
|
-
onMobileViewModeChange:
|
|
909
|
-
onInteractionToggle:
|
|
910
|
-
onNext:
|
|
911
|
-
onPrev:
|
|
912
|
-
prevDisabled: !
|
|
913
|
-
showControls:
|
|
914
|
-
texts:
|
|
915
|
-
customActionContext:
|
|
916
|
-
customActions:
|
|
900
|
+
onEnded: ln,
|
|
901
|
+
onFullscreen: nn,
|
|
902
|
+
isFullscreen: ot,
|
|
903
|
+
mobileViewMode: G,
|
|
904
|
+
settingsPortalContainer: He.current,
|
|
905
|
+
onMobileViewModeChange: Gt,
|
|
906
|
+
onInteractionToggle: cn,
|
|
907
|
+
onNext: on,
|
|
908
|
+
onPrev: rn,
|
|
909
|
+
prevDisabled: !Mt,
|
|
910
|
+
showControls: F,
|
|
911
|
+
texts: Tt,
|
|
912
|
+
customActionContext: je,
|
|
913
|
+
customActions: V,
|
|
917
914
|
useAutoAdvanceToggle: ae
|
|
918
915
|
}
|
|
919
916
|
) : null
|
|
@@ -925,6 +922,6 @@ const Gn = (S, w) => S.length === w.length && S.every((I, Z) => {
|
|
|
925
922
|
);
|
|
926
923
|
};
|
|
927
924
|
export {
|
|
928
|
-
|
|
925
|
+
mr as default
|
|
929
926
|
};
|
|
930
927
|
//# sourceMappingURL=Slide.es.js.map
|