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