markdown-flow-ui 0.1.115-beta.2 → 0.1.115-beta.3

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