markdown-flow-ui 0.1.124 → 0.1.125

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