markdown-flow-ui 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) 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/assets/markdown-flow-ui.css +1 -1
  6. package/dist/components/Slide/Slide.cjs.js +1 -1
  7. package/dist/components/Slide/Slide.cjs.js.map +1 -1
  8. package/dist/components/Slide/Slide.es.js +833 -728
  9. package/dist/components/Slide/Slide.es.js.map +1 -1
  10. package/dist/components/Slide/Slide.stories.d.ts +2 -0
  11. package/dist/components/Slide/utils/interactionPlayback.cjs.js +1 -1
  12. package/dist/components/Slide/utils/interactionPlayback.cjs.js.map +1 -1
  13. package/dist/components/Slide/utils/interactionPlayback.d.ts +12 -5
  14. package/dist/components/Slide/utils/interactionPlayback.es.js +16 -16
  15. package/dist/components/Slide/utils/interactionPlayback.es.js.map +1 -1
  16. package/dist/markdown-flow-ui-lib.css +1 -1
  17. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs.js +1 -1
  18. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  19. package/dist/node_modules/classnames/index.cjs.js +1 -1
  20. package/dist/node_modules/classnames/index.es.js +1 -1
  21. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.js +7 -0
  22. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.js.map +1 -0
  23. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js +20 -0
  24. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js.map +1 -0
  25. package/package.json +1 -1
@@ -1,845 +1,866 @@
1
- import { j as i } from "../../_virtual/jsx-runtime.es.js";
2
- import { memo as fr, useMemo as c, useId as mr, useRef as p, useCallback as n, useState as f, useEffect as s } from "react";
3
- import { isSandboxInteractionMessage as pr } from "../../lib/sandboxInteraction.es.js";
4
- import { cn as pe } from "../../lib/utils.es.js";
5
- import hr from "../ui/loading-overlay-card.es.js";
6
- import yr from "../ContentRender/ContentRender.es.js";
7
- import an from "../ContentRender/IframeSandbox.es.js";
1
+ import { j as s } from "../../_virtual/jsx-runtime.es.js";
2
+ import { memo as br, useMemo as u, useId as xr, useRef as f, useCallback as r, useState as d, useEffect as c, useLayoutEffect as Ar } from "react";
3
+ import { isSandboxInteractionMessage as wr } from "../../lib/sandboxInteraction.es.js";
4
+ import { cn as ye } from "../../lib/utils.es.js";
5
+ import Tr from "../ui/loading-overlay-card.es.js";
6
+ import Er from "../ContentRender/ContentRender.es.js";
7
+ import yn from "../ContentRender/IframeSandbox.es.js";
8
8
  import "../ui/inputGroup/input-group.es.js";
9
9
  import "../ContentRender/contentRenderI18n.es.js";
10
- import { isMobileDevice as Sr, isLandscapeViewport as un, subscribeMobileDeviceChange as vr } from "../../lib/mobileDevice.es.js";
11
- import br from "./Player.es.js";
12
- import Ir from "./MarkdownSlideScaling.es.js";
13
- import gr from "./SubtitleOverlay.es.js";
14
- import Ar from "./useSlide.es.js";
15
- import xr from "./useWakePlayerFromIframe.es.js";
16
- import { PlayerKeyboardShortcutContext as wr } from "./utils/playerKeyboardShortcutContext.es.js";
17
- import { activatePlayerKeyboardShortcutOwner as Tr } from "./utils/playerKeyboardShortcuts.es.js";
18
- import { DEFAULT_MOBILE_VIEW_MODE as $e, resolveMobileViewModeState as Er } from "./utils/mobileScreenMode.es.js";
19
- import { shouldRenderInteractionOverlay as Cr, shouldPresentInteractionOverlay as Rr } from "./utils/interactionPlayback.es.js";
20
- import { resolveMarkdownScalingMode as Pr } from "./utils/markdownScaling.es.js";
21
- import { shouldWakePlayerControlsAfterNavigation as yt } from "./utils/playerNavigationContext.es.js";
22
- import { shouldAutoAdvanceIntoAppendedMarker as _r } from "./utils/appendedMarkerAdvance.es.js";
23
- import { getPlaybackSequenceTransition as kr, shouldStartDefaultAudioSequence as Mr } from "./utils/playbackSequence.es.js";
24
- import { hasResolvedInteractionElement as Fr, canReachSubtitleJumpTarget as cn } from "./utils/subtitleJumpNavigation.es.js";
25
- import { resolvePlayerCustomActionElement as Or, getPlayerCustomActionCount as Br } from "./utils/playerCustomActions.es.js";
26
- import { createPlaybackTimeStore as Nr } from "./utils/playbackTimeStore.es.js";
27
- import { resolveSlideInteractionState as Lr } from "./utils/interactionResolution.es.js";
28
- import { shouldUseAutoAdvanceToggle as Vr } from "./utils/playerToggleMode.es.js";
29
- import { DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS as jr, areImageOnlyStepIframeVisualsReady as Dr } from "./utils/imageOnlyStepVisualReady.es.js";
30
- import { resolveSilentStepAutoAdvanceBehavior as qr } from "./utils/silentStepAutoAdvance.es.js";
31
- import { resolveSlidePlayerVisibility as Kr } from "./utils/playerVisibility.es.js";
32
- import { getSlideLocaleTexts as Ur, DEFAULT_SLIDE_BUFFERING_TEXTS as Hr } from "./slideI18n.es.js";
10
+ import { isMobileDevice as Cr, isLandscapeViewport as hn, subscribeMobileDeviceChange as Pr } from "../../lib/mobileDevice.es.js";
11
+ import Rr from "./Player.es.js";
12
+ import _r from "./MarkdownSlideScaling.es.js";
13
+ import Or from "./SubtitleOverlay.es.js";
14
+ import Mr from "./useSlide.es.js";
15
+ import kr from "./useWakePlayerFromIframe.es.js";
16
+ import { PlayerKeyboardShortcutContext as Fr } from "./utils/playerKeyboardShortcutContext.es.js";
17
+ import { activatePlayerKeyboardShortcutOwner as Br } from "./utils/playerKeyboardShortcuts.es.js";
18
+ import { DEFAULT_MOBILE_VIEW_MODE as tt, resolveMobileViewModeState as Nr } from "./utils/mobileScreenMode.es.js";
19
+ import { shouldRenderInteractionOverlay as Dr, clampInteractionOverlayDragOffset as gn, shouldPresentInteractionOverlay as Lr } from "./utils/interactionPlayback.es.js";
20
+ import { resolveMarkdownScalingMode as Vr } from "./utils/markdownScaling.es.js";
21
+ import { shouldWakePlayerControlsAfterNavigation as Et } from "./utils/playerNavigationContext.es.js";
22
+ import { shouldAutoAdvanceIntoAppendedMarker as jr } from "./utils/appendedMarkerAdvance.es.js";
23
+ import { getPlaybackSequenceTransition as qr, shouldStartDefaultAudioSequence as Kr } from "./utils/playbackSequence.es.js";
24
+ import { hasResolvedInteractionElement as Ur, canReachSubtitleJumpTarget as vn } from "./utils/subtitleJumpNavigation.es.js";
25
+ import { resolvePlayerCustomActionElement as Hr, getPlayerCustomActionCount as Yr } from "./utils/playerCustomActions.es.js";
26
+ import { createPlaybackTimeStore as Gr } from "./utils/playbackTimeStore.es.js";
27
+ import { resolveSlideInteractionState as $r } from "./utils/interactionResolution.es.js";
28
+ import { shouldUseAutoAdvanceToggle as zr } from "./utils/playerToggleMode.es.js";
29
+ import { DEFAULT_IMAGE_ONLY_VISUAL_READY_TIMEOUT_MS as Jr, areImageOnlyStepIframeVisualsReady as Wr } from "./utils/imageOnlyStepVisualReady.es.js";
30
+ import { resolveSilentStepAutoAdvanceBehavior as Xr } from "./utils/silentStepAutoAdvance.es.js";
31
+ import { resolveSlidePlayerVisibility as Qr } from "./utils/playerVisibility.es.js";
32
+ import { getSlideLocaleTexts as Zr, DEFAULT_SLIDE_BUFFERING_TEXTS as eo } from "./slideI18n.es.js";
33
33
  /* empty css */
34
- import Gr from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
35
- const $r = 2e3, zr = 300, Jr = 160, Wr = 16, dn = 3e3, Yr = [
34
+ import to from "../../node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js";
35
+ import no from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.es.js";
36
+ const ro = 2e3, oo = 300, io = 160, lo = 16, Sn = 3e3, In = {
37
+ x: 0,
38
+ y: 0
39
+ }, so = typeof window > "u" ? c : Ar, ao = [
36
40
  "button",
37
41
  "input",
38
42
  "textarea",
39
43
  '[contenteditable=""]',
40
44
  '[contenteditable="true"]',
41
45
  '[contenteditable="plaintext-only"]'
42
- ].join(", "), vt = "waitingForAudio", Xr = (d, h) => typeof d == "string" ? d : d[h] ?? d[vt] ?? Hr[h], Qr = (d, h) => typeof d == "string" ? d : {
46
+ ].join(", "), Pt = "waitingForAudio", co = (m, h) => typeof m == "string" ? m : m[h] ?? m[Pt] ?? eo[h], uo = (m, h) => typeof m == "string" ? m : {
43
47
  ...h,
44
- ...d
45
- }, Zr = (d, h) => h ? d !== "loadingAudio" : !1, mn = fr(
48
+ ...m
49
+ }, fo = (m, h) => h ? m !== "loadingAudio" : !1, bn = br(
46
50
  ({
47
- content: d,
51
+ content: m,
48
52
  title: h,
49
- locale: U,
53
+ locale: H,
50
54
  defaultButtonText: he,
51
- defaultInputText: H,
55
+ defaultInputText: Y,
52
56
  defaultSelectedValues: G,
53
57
  confirmButtonText: Z,
54
58
  copyButtonText: ee,
55
- copiedButtonText: ke,
56
- onSend: ze,
57
- readonly: te = !1
58
- }) => /* @__PURE__ */ i.jsxs("div", { className: "slide-player__interaction-card", children: [
59
- /* @__PURE__ */ i.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ i.jsx("p", { className: "slide-player__interaction-title", children: h }) }),
60
- /* @__PURE__ */ i.jsx("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ i.jsx(
61
- yr,
59
+ copiedButtonText: De,
60
+ onSend: nt,
61
+ onDragHandlePointerCancel: te,
62
+ onDragHandlePointerDown: rt,
63
+ onDragHandlePointerMove: ge,
64
+ onDragHandlePointerUp: Le,
65
+ readonly: Ve = !1
66
+ }) => /* @__PURE__ */ s.jsxs("div", { className: "slide-player__interaction-card", children: [
67
+ /* @__PURE__ */ s.jsx(
68
+ "button",
62
69
  {
63
- content: d,
64
- locale: U,
70
+ type: "button",
71
+ className: "slide-player__interaction-drag-handle",
72
+ "aria-label": "Move interaction",
73
+ onPointerCancel: te,
74
+ onPointerDown: rt,
75
+ onPointerMove: ge,
76
+ onPointerUp: Le,
77
+ children: /* @__PURE__ */ s.jsx("span", { className: "slide-player__interaction-drag-handle-icon", children: /* @__PURE__ */ s.jsx(to, { "aria-hidden": "true" }) })
78
+ }
79
+ ),
80
+ /* @__PURE__ */ s.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ s.jsx("p", { className: "slide-player__interaction-title", children: h }) }),
81
+ /* @__PURE__ */ s.jsx("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ s.jsx(
82
+ Er,
83
+ {
84
+ content: m,
85
+ locale: H,
65
86
  defaultButtonText: he,
66
- defaultInputText: H,
87
+ defaultInputText: Y,
67
88
  defaultSelectedValues: G,
68
89
  confirmButtonText: Z,
69
90
  copyButtonText: ee,
70
- copiedButtonText: ke,
71
- onSend: ze,
72
- readonly: te,
91
+ copiedButtonText: De,
92
+ onSend: nt,
93
+ readonly: Ve,
73
94
  sandboxMode: "content"
74
95
  }
75
96
  ) })
76
97
  ] })
77
98
  );
78
- mn.displayName = "InteractionOverlayCard";
79
- const eo = (d, h) => d.length === h.length && d.every((U, he) => {
80
- const H = h[he];
81
- return U.sequence_number === H?.sequence_number && U.type === H?.type && U.content === H?.content;
82
- }), St = (d) => d instanceof HTMLElement && d.matches(Yr), to = [
83
- 'input:not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"])',
84
- "textarea",
85
- '[contenteditable=""]',
86
- '[contenteditable="true"]',
87
- '[contenteditable="plaintext-only"]'
88
- ].join(", "), fn = (d) => d instanceof HTMLElement && d.matches(to), jo = ({
89
- elementList: d = [],
99
+ bn.displayName = "InteractionOverlayCard";
100
+ const mo = (m, h) => m.length === h.length && m.every((H, he) => {
101
+ const Y = h[he];
102
+ return H.sequence_number === Y?.sequence_number && H.type === Y?.type && H.content === Y?.content;
103
+ }), Ct = (m) => m instanceof HTMLElement && !!m.closest(ao), Xo = ({
104
+ elementList: m = [],
90
105
  locale: h,
91
- playerEnabled: U,
106
+ playerEnabled: H,
92
107
  playerControlsVisibility: he,
93
- playerClassName: H,
108
+ playerClassName: Y,
94
109
  fullscreenHeader: G,
95
110
  playerCustomActions: Z,
96
111
  playerCustomActionPauseOnActive: ee = !0,
97
- bufferingText: ke,
98
- interactionTitle: ze,
112
+ bufferingText: De,
113
+ interactionTitle: nt,
99
114
  interactionTexts: te,
100
- playerTexts: pn,
101
- playerAutoHideDelay: Je = 3e3,
102
- markerAutoAdvanceDelay: bt = $r,
103
- interactionDefaultValueOptions: It,
104
- onSend: gt,
105
- onPlayerVisibilityChange: We,
106
- onMobileViewModeChange: At,
107
- onStepChange: xt,
115
+ playerTexts: rt,
116
+ playerAutoHideDelay: ge = 3e3,
117
+ markerAutoAdvanceDelay: Le = ro,
118
+ interactionDefaultValueOptions: Ve,
119
+ onSend: Rt,
120
+ onPlayerVisibilityChange: ot,
121
+ onMobileViewModeChange: _t,
122
+ onStepChange: Ot,
108
123
  enableKeyboardShortcuts: ne = !0,
109
- enableIframeScaling: hn = !0,
110
- enableMarkdownScaling: yn = !0,
111
- disableLoadingOverlay: P = !1,
112
- className: Sn,
113
- onPointerDown: wt,
114
- onFocusCapture: Tt,
115
- ...vn
124
+ enableIframeScaling: xn = !0,
125
+ enableMarkdownScaling: An = !0,
126
+ disableLoadingOverlay: _ = !1,
127
+ className: wn,
128
+ onPointerDown: Mt,
129
+ onFocusCapture: kt,
130
+ ...Tn
116
131
  }) => {
117
- const $ = c(() => Ur(h), [h]), bn = c(
118
- () => Qr(
119
- ke,
132
+ const $ = u(() => Zr(h), [h]), En = u(
133
+ () => uo(
134
+ De,
120
135
  $.bufferingText
121
136
  ),
122
- [ke, $.bufferingText]
137
+ [De, $.bufferingText]
123
138
  ), {
124
- playerEnabled: In,
139
+ playerEnabled: Cn,
125
140
  playerControlsVisibility: j
126
- } = Kr({
127
- playerEnabled: U,
141
+ } = Qr({
142
+ playerEnabled: H,
128
143
  playerControlsVisibility: he
129
- }), Me = mr(), ye = p(null), Et = p(null), Fe = p(null), Ct = p(null), re = p(null), Oe = p(!1), Se = p(null), Be = p(null), z = p(null), ve = p(null), Ye = p(null), Rt = p([]), be = p(!1), J = p(null), Ie = p(null), Pt = p(0), _t = p(null), kt = p({
144
+ }), je = xr(), ve = f(null), it = f(null), qe = f(null), Ft = f(null), re = f(null), Ke = f(!1), Se = f(null), Ue = f(null), z = f(null), Ie = f(null), be = f(null), xe = f(null), Ae = f(null), Bt = f([]), we = f(!1), J = f(null), Te = f(null), Nt = f(0), Dt = f(null), Lt = f({
130
145
  markerCount: 0,
131
146
  currentIndex: -1,
132
147
  canGoNext: !1
133
- }), Xe = p(!1), {
134
- currentElementList: C,
135
- stepElementLists: Mt,
136
- slideElementList: E,
137
- currentIndex: o,
138
- audioList: b,
139
- audioSlideIndexes: Ne,
140
- currentAudioSequenceIndexes: Le,
148
+ }), lt = f(!1), {
149
+ currentElementList: P,
150
+ stepElementLists: Vt,
151
+ slideElementList: C,
152
+ currentIndex: a,
153
+ audioList: S,
154
+ audioSlideIndexes: He,
155
+ currentAudioSequenceIndexes: Ye,
141
156
  currentStepHasSpeakableElement: I,
142
- currentInteractionElement: m,
143
- canGoPrev: gn,
157
+ currentInteractionElement: p,
158
+ canGoPrev: Pn,
144
159
  canGoNext: R,
145
- handlePrev: Ft,
146
- handleNext: _,
147
- handleGoTo: Ot
148
- } = Ar(d), ge = c(() => {
149
- if (!(o < 0))
150
- return E[o];
151
- }, [o, E]), oe = c(
152
- () => C.map(
160
+ handlePrev: jt,
161
+ handleNext: O,
162
+ handleGoTo: qt
163
+ } = Mr(m), Ee = u(() => {
164
+ if (!(a < 0))
165
+ return C[a];
166
+ }, [a, C]), oe = u(
167
+ () => P.map(
153
168
  (e, t) => `${e.sequence_number ?? `${e.type}-${t}`}:${String(e.is_new ?? "")}`
154
169
  ),
155
- [C]
156
- ), An = E.filter(
170
+ [P]
171
+ ), Rn = C.filter(
157
172
  (e) => e.is_renderable !== !1
158
- ).length === 1, y = In && (E.length > 0 || b.length > 0 || !!m), xn = c(
173
+ ).length === 1, g = Cn && (C.length > 0 || S.length > 0 || !!p), _n = u(
159
174
  () => ({
160
175
  enabled: ne,
161
- ownerId: Me
176
+ ownerId: je
162
177
  }),
163
- [ne, Me]
164
- ), D = n(() => {
165
- !ne || !y || Tr(Me);
166
- }, [ne, Me, y]), k = c(
167
- () => Le.map((e) => b[e]?.audioKey).filter((e) => !!e),
168
- [b, Le]
169
- ), [wn, Ae] = f(!0), [Ve, ie] = f(!1), [Qe, Bt] = f(!0), [xe, Nt] = f(!0), [A, q] = f(null), [Tn, Lt] = f(null), [En, g] = f(!1), [Cn, Ze] = f(vt), [M, et] = f(!1), [Rn, je] = f(!1), [Vt, Pn] = f(!0), [tt, nt] = f(!1), [S, rt] = f(), [le, De] = f(!1), [jt, qe] = f(!1), [_n, ot] = f(!1), [
170
- kn,
171
- we
172
- ] = f(0), [Dt, Mn] = f(!1), L = c(() => Sr(), []), [Ke, it] = f(
173
- $e
174
- ), [qt, lt] = f(!1), [Fn, Kt] = f(
175
- () => L ? un() : !1
176
- ), se = c(() => Nr(), []), {
178
+ [ne, je]
179
+ ), q = r(() => {
180
+ !ne || !g || Br(je);
181
+ }, [ne, je, g]), M = u(
182
+ () => Ye.map((e) => S[e]?.audioKey).filter((e) => !!e),
183
+ [S, Ye]
184
+ ), [On, Ce] = d(!0), [Ge, ie] = d(!1), [st, Kt] = d(!0), [Pe, Ut] = d(!0), [A, K] = d(null), [Mn, Ht] = d(null), [kn, b] = d(!1), [Fn, at] = d(Pt), [k, ct] = d(!1), [Bn, $e] = d(!1), [Yt, Nn] = d(!0), [ut, dt] = d(!1), [y, ft] = d(), [le, ze] = d(!1), [Gt, Je] = d(!1), [x, mt] = d(
185
+ In
186
+ ), [pt, yt] = d(!1), [
187
+ Dn,
188
+ Re
189
+ ] = d(0), [$t, Ln] = d(!1), L = u(() => Cr(), []), [We, ht] = d(
190
+ tt
191
+ ), [zt, gt] = d(!1), [Vn, Jt] = d(
192
+ () => L ? hn() : !1
193
+ ), se = u(() => Gr(), []), {
177
194
  effectiveMobileViewMode: ae,
178
- isImmersiveMobileFullscreen: ue,
179
- isNativeMobileFullscreen: Ut,
180
- shouldRotateFullscreenViewport: On
181
- } = c(
182
- () => Er({
183
- hasManualMobileViewMode: qt,
195
+ isImmersiveMobileFullscreen: ce,
196
+ isNativeMobileFullscreen: Wt,
197
+ shouldRotateFullscreenViewport: jn
198
+ } = u(
199
+ () => Nr({
200
+ hasManualMobileViewMode: zt,
184
201
  isMobileDevice: L,
185
- mobileViewMode: Ke
202
+ mobileViewMode: We
186
203
  }),
187
204
  [
188
- qt,
205
+ zt,
189
206
  L,
190
- Fn,
191
- Ke
207
+ Vn,
208
+ We
192
209
  ]
193
- ), Bn = p(ae), x = y && j !== "hidden" && (j === "visible" || wn), Nn = ue && x, Ln = ue && x, Vn = ue || Ut, Ht = Dt && !L, jn = n(
210
+ ), qn = f(ae), w = g && j !== "hidden" && (j === "visible" || On), Kn = ce && w, Un = ce && w, Hn = ce || Wt, Xt = $t && !L, Yn = r(
194
211
  (e) => {
195
- lt(!0), it(e);
212
+ gt(!0), ht(e);
196
213
  },
197
214
  []
198
- ), Gt = n(() => {
199
- lt(!1), it($e);
200
- }, []), Dn = n(() => {
201
- Gt(), G?.onBack?.();
202
- }, [G, Gt]), $t = n((e) => {
203
- nt(e);
204
- }, []), zt = n(() => {
205
- nt((e) => !e);
206
- }, []), { mountedStepStates: qn, currentMountedStateIndex: Kn } = c(() => {
215
+ ), Qt = r(() => {
216
+ gt(!1), ht(tt);
217
+ }, []), Gn = r(() => {
218
+ Qt(), G?.onBack?.();
219
+ }, [G, Qt]), Zt = r((e) => {
220
+ dt(e);
221
+ }, []), en = r(() => {
222
+ dt((e) => !e);
223
+ }, []), { mountedStepStates: $n, currentMountedStateIndex: zn } = u(() => {
207
224
  const e = [], t = /* @__PURE__ */ new Map();
208
- return Mt.forEach((l, a) => {
209
- const u = e.findIndex(
210
- (r) => eo(
211
- r.elementList,
212
- l
225
+ return Vt.forEach((o, i) => {
226
+ const l = e.findIndex(
227
+ (n) => mo(
228
+ n.elementList,
229
+ o
213
230
  )
214
231
  );
215
- if (u >= 0) {
216
- e[u]?.sourceStepIndexes.push(a), t.set(a, u);
232
+ if (l >= 0) {
233
+ e[l]?.sourceStepIndexes.push(i), t.set(i, l);
217
234
  return;
218
235
  }
219
236
  e.push({
220
- elementList: l,
221
- sourceStepIndexes: [a]
222
- }), t.set(a, e.length - 1);
237
+ elementList: o,
238
+ sourceStepIndexes: [i]
239
+ }), t.set(i, e.length - 1);
223
240
  }), {
224
241
  mountedStepStates: e,
225
- currentMountedStateIndex: o >= 0 ? t.get(o) ?? -1 : -1
242
+ currentMountedStateIndex: a >= 0 ? t.get(a) ?? -1 : -1
226
243
  };
227
- }, [o, Mt]), Jt = c(() => String(o), [o]), w = c(() => A ? b.findIndex(
244
+ }, [a, Vt]), tn = u(() => String(a), [a]), T = u(() => A ? S.findIndex(
228
245
  (e) => (e.audioKey ?? "") === A
229
- ) : -1, [b, A]), st = c(
230
- () => w >= 0 ? b[w] : void 0,
231
- [b, w]
232
- ), Un = st?.element?.subtitle_cues ?? [], Ue = c(
233
- () => k[0] ?? "none",
234
- [k]
235
- ), at = c(
246
+ ) : -1, [S, A]), vt = u(
247
+ () => T >= 0 ? S[T] : void 0,
248
+ [S, T]
249
+ ), Jn = vt?.element?.subtitle_cues ?? [], Xe = u(
250
+ () => M[0] ?? "none",
251
+ [M]
252
+ ), St = u(
236
253
  () => ({
237
- currentElement: Or({
238
- currentAudioIndex: w,
239
- currentAudioSequenceIndexes: Le,
240
- audioList: b,
241
- currentInteractionElement: S,
242
- currentStepElement: ge
254
+ currentElement: Hr({
255
+ currentAudioIndex: T,
256
+ currentAudioSequenceIndexes: Ye,
257
+ audioList: S,
258
+ currentInteractionElement: y,
259
+ currentStepElement: Ee
243
260
  }),
244
- currentIndex: o,
245
- currentStepElement: ge,
246
- isActive: tt,
247
- setActive: $t,
248
- toggleActive: zt
261
+ currentIndex: a,
262
+ currentStepElement: Ee,
263
+ isActive: ut,
264
+ setActive: Zt,
265
+ toggleActive: en
249
266
  }),
250
267
  [
268
+ y,
251
269
  S,
252
- b,
253
- w,
254
- Le,
255
- o,
256
- ge,
257
- tt,
258
- $t,
259
- zt
270
+ T,
271
+ Ye,
272
+ a,
273
+ Ee,
274
+ ut,
275
+ Zt,
276
+ en
260
277
  ]
261
- ), ut = c(
262
- () => Br(
278
+ ), It = u(
279
+ () => Yr(
263
280
  Z,
264
- at
281
+ St
265
282
  ),
266
- [at, Z]
267
- ), Hn = c(
283
+ [St, Z]
284
+ ), Wn = u(
268
285
  () => ({
269
- "--slide-player-custom-action-count": String(ut),
286
+ "--slide-player-custom-action-count": String(It),
270
287
  "--slide-player-mobile-control-count": String(
271
- ut + 4
272
- )
288
+ It + 4
289
+ ),
290
+ "--slide-interaction-drag-x": `${x.x}px`,
291
+ "--slide-interaction-drag-y": `${x.y}px`
273
292
  }),
274
- [ut]
275
- ), Wt = k.length > 0, Yt = c(() => m ? `${m.sequence_number ?? "none"}:${String(
276
- m.content ?? ""
277
- )}` : "none", [m]), Te = c(
278
- () => [Jt, Yt].join("|"),
279
- [Yt, Jt]
280
- ), Gn = c(
293
+ [
294
+ x.x,
295
+ x.y,
296
+ It
297
+ ]
298
+ ), nn = M.length > 0, rn = u(() => p ? `${p.sequence_number ?? "none"}:${String(
299
+ p.content ?? ""
300
+ )}` : "none", [p]), _e = u(
301
+ () => [tn, rn].join("|"),
302
+ [rn, tn]
303
+ ), Xn = u(
281
304
  () => [
282
- Te,
283
- st?.audioKey ?? "none",
284
- String(w)
305
+ _e,
306
+ vt?.audioKey ?? "none",
307
+ String(T)
285
308
  ].join("|"),
286
- [w, st?.audioKey, Te]
287
- ), Xt = !!c(() => !Ue || Ue === "none" ? "" : b.find(
288
- (t) => t.audioKey === Ue
289
- )?.audioUrl?.trim() ?? "", [b, Ue]), W = ee && !!Z && tt, Ee = c(
290
- () => Vr({
309
+ [T, vt?.audioKey, _e]
310
+ ), on = !!u(() => !Xe || Xe === "none" ? "" : S.find(
311
+ (t) => t.audioKey === Xe
312
+ )?.audioUrl?.trim() ?? "", [S, Xe]), W = ee && !!Z && ut, Oe = u(
313
+ () => zr({
291
314
  canGoNext: R,
292
- currentAudioIndex: w,
315
+ currentAudioIndex: T,
293
316
  currentStepHasSpeakableElement: I,
294
- hasInteraction: !!m
317
+ hasInteraction: !!p
295
318
  }),
296
319
  [
297
320
  R,
298
- w,
299
- m,
321
+ T,
322
+ p,
300
323
  I
301
324
  ]
302
- ), Qt = c(
303
- () => qr({
304
- currentElementList: C,
325
+ ), ln = u(
326
+ () => Xr({
327
+ currentElementList: P,
305
328
  currentStepHasSpeakableElement: I,
306
- currentInteractionElement: m,
307
- markerAutoAdvanceDelay: bt
329
+ currentInteractionElement: p,
330
+ markerAutoAdvanceDelay: Le
308
331
  }),
309
332
  [
310
- C,
311
- m,
333
+ P,
334
+ p,
312
335
  I,
313
- bt
336
+ Le
314
337
  ]
315
- ), Zt = Qt.delayMs, Ce = Qt.usesImageOnlyDelay, ct = c(
316
- () => `${o}:${oe.join("|")}`,
317
- [o, oe]
318
- ), [$n, zn] = f(null), en = !Ce || $n === ct, V = n(() => {
338
+ ), sn = ln.delayMs, Me = ln.usesImageOnlyDelay, bt = u(
339
+ () => `${a}:${oe.join("|")}`,
340
+ [a, oe]
341
+ ), [Qn, Zn] = d(null), an = !Me || Qn === bt, V = r(() => {
319
342
  re.current !== null && (window.clearTimeout(re.current), re.current = null);
320
- }, []), F = n(() => {
343
+ }, []), F = r(() => {
321
344
  z.current !== null && (window.clearTimeout(z.current), z.current = null);
322
- }, []), O = n(() => {
323
- ve.current !== null && (window.clearTimeout(ve.current), ve.current = null);
324
- }, []), ce = n(() => {
345
+ }, []), B = r(() => {
346
+ Ie.current !== null && (window.clearTimeout(Ie.current), Ie.current = null);
347
+ }, []), ue = r(() => {
325
348
  Se.current !== null && (window.clearTimeout(Se.current), Se.current = null);
326
- }, []), K = n(() => {
327
- Be.current !== null && (window.clearTimeout(Be.current), Be.current = null);
328
- }, []), B = n(
349
+ }, []), U = r(() => {
350
+ Ue.current !== null && (window.clearTimeout(Ue.current), Ue.current = null);
351
+ }, []), N = r(
329
352
  (e = {}) => {
330
- ce(), F(), O(), K(), q(null), se.reset(), g(!1), Ze(vt), et(!1), je(!1), Lt(null), e.preservePendingSubtitleJump || (Ie.current = null), rt(void 0), De(!1), we(0);
353
+ ue(), F(), B(), U(), K(null), se.reset(), b(!1), at(Pt), ct(!1), $e(!1), Ht(null), e.preservePendingSubtitleJump || (Te.current = null), ft(void 0), ze(!1), Re(0);
331
354
  },
332
355
  [
333
- ce,
334
- K,
356
+ ue,
357
+ U,
335
358
  F,
336
- O,
359
+ B,
337
360
  se
338
361
  ]
339
- ), He = n(
362
+ ), Qe = r(
340
363
  (e) => {
341
- Pt.current += 1, Lt({
364
+ Nt.current += 1, Ht({
342
365
  ...e,
343
- id: Pt.current
366
+ id: Nt.current
344
367
  });
345
368
  },
346
369
  []
347
- ), de = n(() => {
348
- const e = k[0];
349
- return e ? (q(e), !0) : !1;
350
- }, [k]), Re = n(() => {
351
- F(), O(), De(!1), we(0), !de() && R && _();
370
+ ), de = r(() => {
371
+ const e = M[0];
372
+ return e ? (K(e), !0) : !1;
373
+ }, [M]), ke = r(() => {
374
+ F(), B(), ze(!1), Re(0), !de() && R && O();
352
375
  }, [
353
376
  R,
354
377
  F,
378
+ B,
355
379
  O,
356
- _,
357
380
  de
358
- ]), tn = n(
381
+ ]), cn = r(
359
382
  (e) => {
360
- if (O(), !e)
383
+ if (B(), !e)
361
384
  return;
362
385
  const t = () => {
363
- ve.current = null, we(
364
- Jr
365
- ), De(!0), J.current = null;
386
+ Ie.current = null, Re(
387
+ io
388
+ ), ze(!0), J.current = null;
366
389
  };
367
- ve.current = window.setTimeout(
390
+ Ie.current = window.setTimeout(
368
391
  t,
369
- zr
392
+ oo
370
393
  );
371
394
  },
372
- [O]
373
- ), dt = n(
374
- () => Oe.current || !!ye.current?.querySelector(".slide-player__controls:hover"),
395
+ [B]
396
+ ), xt = r(
397
+ () => Ke.current || !!ve.current?.querySelector(".slide-player__controls:hover"),
375
398
  []
376
- ), v = n(
377
- (e = Ve) => {
378
- !y || j === "hidden" || (Ae(!0), V(), !(j === "visible" || !e || Je <= 0 || dt()) && (re.current = window.setTimeout(() => {
379
- if (dt()) {
399
+ ), v = r(
400
+ (e = Ge) => {
401
+ !g || j === "hidden" || (Ce(!0), V(), !(j === "visible" || !e || ge <= 0 || xt()) && (re.current = window.setTimeout(() => {
402
+ if (xt()) {
380
403
  re.current = null;
381
404
  return;
382
405
  }
383
- Ae(!1), re.current = null;
384
- }, Je)));
406
+ Ce(!1), re.current = null;
407
+ }, ge)));
385
408
  },
386
409
  [
387
410
  V,
388
- Ve,
389
- dt,
390
- Je,
411
+ Ge,
412
+ xt,
413
+ ge,
391
414
  j,
392
- y
415
+ g
393
416
  ]
394
- ), Pe = !!Fr(m), Y = !!m && !Pe, Jn = n((e) => {
395
- Bt(e);
396
- }, []), fe = n(
417
+ ), Fe = !!Ur(p), fe = !!p && !Fe, er = r((e) => {
418
+ Kt(e);
419
+ }, []), me = r(
397
420
  (e) => {
398
- e && Bt(e.shouldContinuePlayback);
421
+ e && Kt(e.shouldContinuePlayback);
399
422
  },
400
423
  []
401
424
  );
402
- s(() => {
403
- Nt(Qe);
404
- }, [o, Qe, ee]), s(() => {
405
- ee && nt(!1);
406
- }, [o, ee]), s(() => () => {
407
- ce(), K(), V(), F(), O();
425
+ c(() => {
426
+ Ut(st);
427
+ }, [a, st, ee]), c(() => {
428
+ ee && dt(!1);
429
+ }, [a, ee]), c(() => () => {
430
+ ue(), U(), V(), F(), B();
408
431
  }, [
409
- ce,
410
- K,
432
+ ue,
433
+ U,
411
434
  F,
412
- O,
435
+ B,
413
436
  V
414
- ]), s(() => {
415
- if (!Ce) {
416
- K();
437
+ ]), c(() => {
438
+ if (!Me) {
439
+ U();
417
440
  return;
418
441
  }
419
- let e = !1, t = null, l = null;
420
- const a = () => {
421
- l?.(), l = null;
422
- }, u = () => {
423
- e || (a(), K(), zn(ct));
424
- }, r = () => {
442
+ let e = !1, t = null, o = null;
443
+ const i = () => {
444
+ o?.(), o = null;
445
+ }, l = () => {
446
+ e || (i(), U(), Zn(bt));
447
+ }, n = () => {
425
448
  if (e)
426
449
  return;
427
- a();
428
- const T = Fe.current?.querySelector(
450
+ i();
451
+ const E = qe.current?.querySelector(
429
452
  '[data-active-step="true"]'
430
453
  );
431
- if (!T)
454
+ if (!E)
432
455
  return;
433
- const N = Array.from(
434
- T.querySelectorAll("iframe")
456
+ const D = Array.from(
457
+ E.querySelectorAll("iframe")
435
458
  );
436
- if (N.length === 0 || Dr(N)) {
437
- u();
459
+ if (D.length === 0 || Wr(D)) {
460
+ l();
438
461
  return;
439
462
  }
440
- const Ge = [], _e = () => {
463
+ const et = [], Ne = () => {
441
464
  e || (t !== null && window.cancelAnimationFrame(t), t = window.requestAnimationFrame(() => {
442
- t = null, r();
465
+ t = null, n();
443
466
  }));
444
- }, ht = (X, me, Q) => {
445
- X.addEventListener(me, Q, { once: !0 }), Ge.push(
446
- () => X.removeEventListener(me, Q)
467
+ }, Tt = (X, pe, Q) => {
468
+ X.addEventListener(pe, Q, { once: !0 }), et.push(
469
+ () => X.removeEventListener(pe, Q)
447
470
  );
448
471
  };
449
- N.forEach((X) => {
450
- const me = X.contentDocument;
451
- if (!me || me.readyState !== "complete") {
452
- ht(X, "load", _e);
472
+ D.forEach((X) => {
473
+ const pe = X.contentDocument;
474
+ if (!pe || pe.readyState !== "complete") {
475
+ Tt(X, "load", Ne);
453
476
  return;
454
477
  }
455
- Array.from(me.images).filter((Q) => !Q.complete).forEach((Q) => {
456
- ht(Q, "load", _e), ht(Q, "error", _e);
478
+ Array.from(pe.images).filter((Q) => !Q.complete).forEach((Q) => {
479
+ Tt(Q, "load", Ne), Tt(Q, "error", Ne);
457
480
  });
458
- }), l = () => {
459
- Ge.forEach((X) => X());
481
+ }), o = () => {
482
+ et.forEach((X) => X());
460
483
  };
461
484
  };
462
485
  return t = window.requestAnimationFrame(() => {
463
- t = null, r();
464
- }), Be.current = window.setTimeout(() => {
465
- u();
466
- }, jr), () => {
467
- e = !0, a(), K(), t !== null && window.cancelAnimationFrame(t);
486
+ t = null, n();
487
+ }), Ue.current = window.setTimeout(() => {
488
+ l();
489
+ }, Jr), () => {
490
+ e = !0, i(), U(), t !== null && window.cancelAnimationFrame(t);
468
491
  };
469
492
  }, [
470
- K,
471
- C,
472
- o,
473
- ct,
474
- Ce
475
- ]), s(() => (We?.(x), () => {
476
- We?.(!1);
477
- }), [We, x]), s(() => {
478
- x || (Oe.current = !1);
479
- }, [x]), s(() => {
480
- L || Ke === $e || (lt(!1), it($e));
481
- }, [L, Ke]), s(() => {
493
+ U,
494
+ P,
495
+ a,
496
+ bt,
497
+ Me
498
+ ]), c(() => (ot?.(w), () => {
499
+ ot?.(!1);
500
+ }), [ot, w]), c(() => {
501
+ w || (Ke.current = !1);
502
+ }, [w]), c(() => {
503
+ L || We === tt || (gt(!1), ht(tt));
504
+ }, [L, We]), c(() => {
482
505
  if (!L) {
483
- Kt(!1);
506
+ Jt(!1);
484
507
  return;
485
508
  }
486
509
  const e = () => {
487
- Kt(un());
510
+ Jt(hn());
488
511
  };
489
- return e(), vr(e);
490
- }, [L]), s(() => {
491
- At?.(ae);
492
- }, [ae, At]), s(() => {
493
- Bn.current = ae;
494
- }, [ae]), s(() => {
495
- xt?.(ge, o);
496
- }, [o, ge, xt]), s(() => {
497
- const e = kt.current, t = _r(
512
+ return e(), Pr(e);
513
+ }, [L]), c(() => {
514
+ _t?.(ae);
515
+ }, [ae, _t]), c(() => {
516
+ qn.current = ae;
517
+ }, [ae]), c(() => {
518
+ Ot?.(Ee, a);
519
+ }, [a, Ee, Ot]), c(() => {
520
+ const e = Lt.current, t = jr(
498
521
  {
499
522
  previousMarkerCount: e.markerCount,
500
- nextMarkerCount: E.length,
523
+ nextMarkerCount: C.length,
501
524
  previousIndex: e.currentIndex,
502
525
  previousCanGoNext: e.canGoNext,
503
526
  nextCanGoNext: R,
504
527
  currentAudioKey: A,
505
- hasCompletedCurrentStepAudio: M,
506
- hasResolvedCurrentInteraction: Pe,
528
+ hasCompletedCurrentStepAudio: k,
529
+ hasResolvedCurrentInteraction: Fe,
507
530
  currentStepHasSpeakableElement: I,
508
- currentInteractionElement: m,
509
- isAutoAdvanceEnabled: xe,
510
- shouldUseSilentStepAutoAdvanceToggle: Ee
531
+ currentInteractionElement: p,
532
+ isAutoAdvanceEnabled: Pe,
533
+ shouldUseSilentStepAutoAdvanceToggle: Oe
511
534
  }
512
535
  );
513
- kt.current = {
514
- markerCount: E.length,
515
- currentIndex: o,
536
+ Lt.current = {
537
+ markerCount: C.length,
538
+ currentIndex: a,
516
539
  canGoNext: R
517
- }, t && _();
540
+ }, t && O();
518
541
  }, [
519
542
  R,
520
543
  A,
521
- o,
522
- m,
544
+ a,
545
+ p,
523
546
  I,
524
- _,
525
- M,
547
+ O,
548
+ k,
549
+ Fe,
526
550
  Pe,
527
- xe,
528
- Ee,
529
- E.length
530
- ]), s(() => {
531
- if (!y || j === "hidden") {
532
- V(), Ae(!1);
551
+ Oe,
552
+ C.length
553
+ ]), c(() => {
554
+ if (!g || j === "hidden") {
555
+ V(), Ce(!1);
533
556
  return;
534
557
  }
535
558
  if (j === "visible") {
536
- V(), Ae(!0);
559
+ V(), Ce(!0);
537
560
  return;
538
561
  }
539
- Ve || v(!0);
562
+ Ge || v(!0);
540
563
  }, [
541
564
  V,
542
- Ve,
565
+ Ge,
543
566
  j,
544
- y,
567
+ g,
545
568
  v
546
- ]), s(() => {
569
+ ]), c(() => {
547
570
  if (typeof window > "u")
548
571
  return;
549
572
  const e = (t) => {
550
- t.origin === window.location.origin && pr(t.data) && t.data.eventType === "click" && y && (D(), ie(!0), v(!0));
573
+ t.origin === window.location.origin && wr(t.data) && t.data.eventType === "click" && g && (q(), ie(!0), v(!0));
551
574
  };
552
575
  return window.addEventListener("message", e), () => {
553
576
  window.removeEventListener("message", e);
554
577
  };
555
- }, [D, y, v]), xr({
556
- sectionRef: ye,
557
- enabled: y,
578
+ }, [q, g, v]), kr({
579
+ sectionRef: ve,
580
+ enabled: g,
558
581
  keyboardShortcutsEnabled: ne,
559
- onKeyboardShortcut: D,
582
+ onKeyboardShortcut: q,
560
583
  onWake: () => {
561
- D(), ie(!0), v(!0);
584
+ q(), ie(!0), v(!0);
562
585
  }
563
- }), s(() => {
564
- if (!y) {
565
- B();
586
+ }), c(() => {
587
+ if (!g) {
588
+ N();
566
589
  return;
567
590
  }
568
- const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = kr({
569
- previousResetKey: _t.current,
570
- nextResetKey: Te,
591
+ const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = qr({
592
+ previousResetKey: Dt.current,
593
+ nextResetKey: _e,
571
594
  currentAudioKey: A,
572
- hasCompletedCurrentStepAudio: M
595
+ hasCompletedCurrentStepAudio: k
573
596
  });
574
- _t.current = Te;
575
- const l = J.current === o && !!m, a = Rr({
576
- hasInteraction: !!m,
577
- shouldBlockPlaybackForInteraction: Y,
578
- shouldOpenInteractionOverlayAfterAudio: l,
597
+ Dt.current = _e;
598
+ const o = J.current === a && !!p, i = Lr({
599
+ hasInteraction: !!p,
600
+ shouldBlockPlaybackForInteraction: fe,
601
+ shouldOpenInteractionOverlayAfterAudio: o,
579
602
  hasPlaybackContextChanged: e,
580
- hasResolvedCurrentInteraction: Pe,
603
+ hasResolvedCurrentInteraction: Fe,
581
604
  currentStepHasSpeakableElement: I
582
- }), u = Ie.current, r = u?.slideIndex === o;
583
- if (e && B({
584
- preservePendingSubtitleJump: r
585
- }), !(C.length === 0 && !m) && !W) {
586
- if (u?.slideIndex === o && cn({
587
- currentIndex: o,
588
- resolvedCurrentInteractionElement: S,
589
- slideElementList: E,
590
- targetSlideIndex: u.slideIndex
605
+ }), l = Te.current, n = l?.slideIndex === a;
606
+ if (e && N({
607
+ preservePendingSubtitleJump: n
608
+ }), !(P.length === 0 && !p) && !W) {
609
+ if (l?.slideIndex === a && vn({
610
+ currentIndex: a,
611
+ resolvedCurrentInteractionElement: y,
612
+ slideElementList: C,
613
+ targetSlideIndex: l.slideIndex
591
614
  })) {
592
- Ie.current = null, Xe.current = !0, q(u.audioKey), He({
593
- audioIndex: u.audioIndex,
594
- timeMs: u.timeMs
615
+ Te.current = null, lt.current = !0, K(l.audioKey), Qe({
616
+ audioIndex: l.audioIndex,
617
+ timeMs: l.timeMs
595
618
  });
596
619
  return;
597
620
  }
598
- if (m && rt(m), a) {
599
- tn(m);
621
+ if (p && ft(p), i) {
622
+ cn(p);
600
623
  return;
601
624
  }
602
- if (O(), J.current = null, !!t && !de()) {
625
+ if (B(), J.current = null, !!t && !de()) {
603
626
  if (I) {
604
- if (P) {
605
- g(!1);
627
+ if (_) {
628
+ b(!1);
606
629
  return;
607
630
  }
608
- g(!0);
631
+ b(!0);
609
632
  return;
610
633
  }
611
- if (R && !(Ee && !xe) && !(Ce && !en))
634
+ if (R && !(Oe && !Pe) && !(Me && !an))
612
635
  return Se.current = window.setTimeout(() => {
613
- Se.current = null, _();
614
- }, Zt), () => {
615
- ce();
636
+ Se.current = null, O();
637
+ }, sn), () => {
638
+ ue();
616
639
  };
617
640
  }
618
641
  }
619
642
  }, [
620
- S,
643
+ y,
621
644
  R,
622
- ce,
623
- C.length,
624
- o,
625
- m,
645
+ ue,
646
+ P.length,
647
+ a,
648
+ p,
626
649
  A,
627
- Te,
650
+ _e,
628
651
  I,
629
- Ce,
630
- en,
631
- Zt,
652
+ Me,
653
+ an,
654
+ sn,
655
+ O,
656
+ k,
632
657
  _,
633
- M,
634
- P,
635
- xe,
636
658
  Pe,
637
- Y,
638
- O,
659
+ Fe,
660
+ fe,
639
661
  B,
640
- He,
641
- tn,
642
- y,
643
- E,
662
+ N,
663
+ Qe,
664
+ cn,
665
+ g,
666
+ C,
644
667
  de,
645
668
  W,
646
- Ee
647
- ]), s(() => {
648
- if (P || W || !I || Y) {
649
- g(!1);
669
+ Oe
670
+ ]), c(() => {
671
+ if (_ || W || !I || fe) {
672
+ b(!1);
650
673
  return;
651
674
  }
652
- if (M) {
653
- g(!1);
675
+ if (k) {
676
+ b(!1);
654
677
  return;
655
678
  }
656
- if (Wt) {
657
- g(!1);
679
+ if (nn) {
680
+ b(!1);
658
681
  return;
659
682
  }
660
- Ze("waitingForAudio"), g(!0);
683
+ at("waitingForAudio"), b(!0);
661
684
  }, [
662
- Wt,
685
+ nn,
663
686
  I,
664
- M,
665
- P,
687
+ k,
688
+ _,
666
689
  W,
667
- Y
668
- ]), s(() => {
669
- const e = Xe.current;
670
- Xe.current = !1, Mr({
690
+ fe
691
+ ]), c(() => {
692
+ const e = lt.current;
693
+ lt.current = !1, Kr({
671
694
  currentAudioKey: A,
672
- currentAudioSequenceLength: k.length,
695
+ currentAudioSequenceLength: M.length,
673
696
  currentStepHasSpeakableElement: I,
674
- hasCompletedCurrentStepAudio: M,
675
- shouldBlockPlaybackForInteraction: Y,
697
+ hasCompletedCurrentStepAudio: k,
698
+ shouldBlockPlaybackForInteraction: fe,
676
699
  shouldPausePlaybackForCustomAction: W,
677
700
  shouldSkipDefaultAudioStart: e
678
701
  }) && de();
679
702
  }, [
680
703
  A,
681
- k,
682
- I,
683
704
  M,
705
+ I,
706
+ k,
684
707
  W,
685
- Y,
708
+ fe,
686
709
  de
687
- ]), s(() => {
688
- !A || w >= 0 || q(null);
689
- }, [w, A]), s(() => {
690
- w >= 0 || se.reset();
691
- }, [w, se]), s(() => {
692
- je(!1);
693
- }, [Gn]);
710
+ ]), c(() => {
711
+ !A || T >= 0 || K(null);
712
+ }, [T, A]), c(() => {
713
+ T >= 0 || se.reset();
714
+ }, [T, se]), c(() => {
715
+ $e(!1);
716
+ }, [Xn]);
694
717
  const {
695
- interactionDefaults: nn,
696
- interactionDefaultSelectedValues: Wn,
697
- hasResolvedInteractionInput: ft,
698
- isInteractionReadonly: Yn,
699
- shouldAutoContinueInteraction: rn
700
- } = c(
701
- () => Lr(S, {
702
- interactionDefaultValueOptions: It
718
+ interactionDefaults: un,
719
+ interactionDefaultSelectedValues: tr,
720
+ hasResolvedInteractionInput: dn,
721
+ isInteractionReadonly: nr,
722
+ shouldAutoContinueInteraction: fn
723
+ } = u(
724
+ () => $r(y, {
725
+ interactionDefaultValueOptions: Ve
703
726
  }),
704
- [S, It]
705
- ), on = !!S?.readonly || Yn, mt = Cr({
706
- hasActiveInteraction: !!S,
707
- isInteractionOverlayOpen: le,
708
- shouldBlockPlaybackForInteraction: Y && !on && !ft,
709
- playerControlsVisible: x,
710
- shouldMountPlayer: y,
711
- hasFocusedTextInput: _n
712
- }), Xn = n(
727
+ [y, Ve]
728
+ ), rr = !!y?.readonly || nr, Be = Dr({
729
+ hasActiveInteraction: !!y,
730
+ isInteractionOverlayOpen: le
731
+ }), or = r(
713
732
  (e) => {
714
- const l = [
733
+ const o = [
715
734
  ...e.selectedValues ?? [],
716
735
  e.inputText?.trim() ?? "",
717
736
  e.buttonText?.trim() ?? ""
718
737
  ].filter(Boolean).join(", ");
719
- rt((a) => !a || !l ? a : {
720
- ...a,
721
- user_input: l
722
- }), gt?.(e, S), Re();
738
+ ft((i) => !i || !o ? i : {
739
+ ...i,
740
+ user_input: o
741
+ }), Rt?.(e, y), ke();
723
742
  },
724
- [S, Re, gt]
743
+ [y, ke, Rt]
725
744
  );
726
- s(() => {
745
+ c(() => {
727
746
  const e = () => {
728
- Mn(document.fullscreenElement === ye.current);
747
+ Ln(document.fullscreenElement === ve.current);
729
748
  };
730
749
  return e(), document.addEventListener("fullscreenchange", e), () => {
731
750
  document.removeEventListener("fullscreenchange", e);
732
751
  };
733
- }, []), s(() => {
734
- S && le || (qe(!1), ot(!1));
735
- }, [S, le]), s(() => {
736
- if (!mt) {
737
- we(0);
752
+ }, []), c(() => {
753
+ y && le || Je(!1);
754
+ }, [y, le]), c(() => {
755
+ mt(In), yt(!1), Ae.current = null, xe.current = null;
756
+ }, [y]), c(() => {
757
+ if (!Be) {
758
+ Re(0);
738
759
  return;
739
760
  }
740
- const e = Ye.current;
761
+ const e = be.current;
741
762
  if (!e)
742
763
  return;
743
764
  const t = () => {
744
- const a = Math.ceil(
765
+ const i = Math.ceil(
745
766
  e.getBoundingClientRect().height
746
767
  );
747
- we(
748
- a + Wr
768
+ Re(
769
+ i + lo
749
770
  );
750
771
  };
751
772
  if (t(), typeof ResizeObserver > "u")
752
773
  return;
753
- const l = new ResizeObserver(() => {
774
+ const o = new ResizeObserver(() => {
754
775
  t();
755
776
  });
756
- return l.observe(e), () => {
757
- l.disconnect();
777
+ return o.observe(e), () => {
778
+ o.disconnect();
758
779
  };
759
- }, [mt]), s(() => {
780
+ }, [Be]), c(() => {
760
781
  if (F(), !!le) {
761
- if (rn)
782
+ if (fn)
762
783
  return z.current = window.setTimeout(() => {
763
- z.current = null, Re();
764
- }, dn), () => {
784
+ z.current = null, ke();
785
+ }, Sn), () => {
765
786
  F();
766
787
  };
767
- if (!(jt || !ft))
788
+ if (!(Gt || !dn))
768
789
  return z.current = window.setTimeout(() => {
769
- z.current = null, Re();
770
- }, dn), () => {
790
+ z.current = null, ke();
791
+ }, Sn), () => {
771
792
  F();
772
793
  };
773
794
  }
774
795
  }, [
775
796
  F,
776
- Re,
777
- jt,
778
- ft,
797
+ ke,
798
+ Gt,
799
+ dn,
779
800
  le,
780
- rn
801
+ fn
781
802
  ]);
782
- const Qn = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ i.jsx(i.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ i.jsx(
783
- an,
803
+ const ir = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ s.jsx(s.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ s.jsx(
804
+ yn,
784
805
  {
785
806
  className: "content-render-iframe",
786
- disableLoadingOverlay: P,
807
+ disableLoadingOverlay: _,
787
808
  hideFullScreen: !0,
788
809
  locale: h,
789
810
  mode: "blackboard",
790
811
  replaceRootScreenHeightWithFull: t.replaceRootScreenHeightWithFull,
791
812
  type: "sandbox",
792
813
  content: e.content,
793
- enableScaling: hn
814
+ enableScaling: xn
794
815
  }
795
- ) : /* @__PURE__ */ i.jsx(
796
- an,
816
+ ) : /* @__PURE__ */ s.jsx(
817
+ yn,
797
818
  {
798
819
  className: "content-render-iframe",
799
- disableLoadingOverlay: P,
820
+ disableLoadingOverlay: _,
800
821
  hideFullScreen: !0,
801
822
  locale: h,
802
823
  mode: "blackboard",
803
824
  type: "markdown",
804
825
  content: e.content
805
826
  }
806
- ) : null, Zn = (e = [], t = !1) => {
827
+ ) : null, lr = (e = [], t = !1) => {
807
828
  if (e.length === 0)
808
829
  return null;
809
- const l = e.filter(
810
- (r) => r.is_renderable !== !1
811
- ).length, a = t && yn ? Pr(e) : "disabled", u = e.reduce(
812
- (r, T, N) => T.is_renderable !== !1 ? N : r,
830
+ const o = e.filter(
831
+ (n) => n.is_renderable !== !1
832
+ ).length, i = t && An ? Vr(e) : "disabled", l = e.reduce(
833
+ (n, E, D) => E.is_renderable !== !1 ? D : n,
813
834
  -1
814
835
  );
815
- return /* @__PURE__ */ i.jsx(
816
- Ir,
836
+ return /* @__PURE__ */ s.jsx(
837
+ _r,
817
838
  {
818
839
  className: "slide-stage__content flex w-full flex-col gap-4",
819
- mode: a,
820
- children: e.map((r, T) => {
821
- const N = r.type === "html" && r.is_renderable === !1;
822
- return /* @__PURE__ */ i.jsx(
840
+ mode: i,
841
+ children: e.map((n, E) => {
842
+ const D = n.type === "html" && n.is_renderable === !1;
843
+ return /* @__PURE__ */ s.jsx(
823
844
  "div",
824
845
  {
825
- ref: t && T === u ? Ct : null,
826
- "aria-hidden": N || void 0,
827
- className: pe(
846
+ ref: t && E === l ? Ft : null,
847
+ "aria-hidden": D || void 0,
848
+ className: ye(
828
849
  "w-full shrink-0",
829
- l === 1 && r.is_renderable !== !1 && "slide-element--single",
830
- N ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : r.is_renderable === !1 && "hidden"
850
+ o === 1 && n.is_renderable !== !1 && "slide-element--single",
851
+ D ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : n.is_renderable === !1 && "hidden"
831
852
  ),
832
- children: Qn(r, {
833
- replaceRootScreenHeightWithFull: l === 1 && r.type === "html" && r.is_renderable !== !1
853
+ children: ir(n, {
854
+ replaceRootScreenHeightWithFull: o === 1 && n.type === "html" && n.is_renderable !== !1
834
855
  })
835
856
  },
836
- r.sequence_number ?? `${r.type}-${T}`
857
+ n.sequence_number ?? `${n.type}-${E}`
837
858
  );
838
859
  })
839
860
  }
840
861
  );
841
- }, er = n(() => {
842
- const e = ye.current;
862
+ }, sr = r(() => {
863
+ const e = ve.current;
843
864
  if (e) {
844
865
  if (document.fullscreenElement === e) {
845
866
  document.exitFullscreen().catch(() => {
@@ -849,219 +870,305 @@ const eo = (d, h) => d.length === h.length && d.every((U, he) => {
849
870
  e.requestFullscreen?.().catch(() => {
850
871
  });
851
872
  }
852
- }, []), ln = n(() => {
853
- const e = Fe.current;
873
+ }, []), mn = r(() => {
874
+ const e = qe.current;
854
875
  e && e.scrollTo({
855
876
  top: e.scrollHeight,
856
877
  behavior: "smooth"
857
878
  });
858
- }, []), pt = n(
859
- (e) => cn({
860
- currentIndex: o,
861
- resolvedCurrentInteractionElement: S,
862
- slideElementList: E,
863
- targetSlideIndex: Ne[e.audioIndex]
879
+ }, []), At = r(
880
+ (e) => vn({
881
+ currentIndex: a,
882
+ resolvedCurrentInteractionElement: y,
883
+ slideElementList: C,
884
+ targetSlideIndex: He[e.audioIndex]
864
885
  }),
865
886
  [
866
- S,
867
- Ne,
868
- o,
869
- E
887
+ y,
888
+ He,
889
+ a,
890
+ C
870
891
  ]
871
- ), tr = n(
892
+ ), ar = r(
872
893
  (e, t) => {
873
- const a = b[e.audioIndex]?.audioKey, u = Ne[e.audioIndex];
874
- return !a || u == null || !pt(e) ? !1 : (fe(t), J.current = null, g(!1), et(!1), je(!1), yt(t) && (ie(!0), v(!0)), u === o ? (Ie.current = null, B(), q(a), He(e), !0) : (be.current = !0, B(), Ie.current = {
894
+ const i = S[e.audioIndex]?.audioKey, l = He[e.audioIndex];
895
+ return !i || l == null || !At(e) ? !1 : (me(t), J.current = null, b(!1), ct(!1), $e(!1), Et(t) && (ie(!0), v(!0)), l === a ? (Te.current = null, N(), K(i), Qe(e), !0) : (we.current = !0, N(), Te.current = {
875
896
  audioIndex: e.audioIndex,
876
- audioKey: a,
877
- slideIndex: u,
897
+ audioKey: i,
898
+ slideIndex: l,
878
899
  timeMs: e.timeMs
879
- }, Ot(u), !0));
900
+ }, qt(l), !0));
880
901
  },
881
902
  [
882
- b,
883
- Ne,
884
- pt,
885
- o,
886
- Ot,
903
+ S,
887
904
  He,
888
- B,
905
+ At,
906
+ a,
907
+ qt,
908
+ Qe,
909
+ N,
889
910
  v,
890
- fe
911
+ me
891
912
  ]
892
- ), nr = n(
913
+ ), cr = r(
893
914
  (e) => {
894
- fe(e), be.current = !0, J.current = null, g(!1), yt(e) && (ie(!0), v(!0)), B(), Ft();
915
+ me(e), we.current = !0, J.current = null, b(!1), Et(e) && (ie(!0), v(!0)), N(), jt();
895
916
  },
896
917
  [
897
- Ft,
898
- B,
918
+ jt,
919
+ N,
899
920
  v,
900
- fe
921
+ me
901
922
  ]
902
- ), rr = n(
923
+ ), ur = r(
903
924
  (e) => {
904
- fe(e), be.current = !0, J.current = null, g(!1), yt(e) && (ie(!0), v(!0)), B(), _();
925
+ me(e), we.current = !0, J.current = null, b(!1), Et(e) && (ie(!0), v(!0)), N(), O();
905
926
  },
906
927
  [
907
- _,
908
- B,
928
+ O,
929
+ N,
909
930
  v,
910
- fe
931
+ me
911
932
  ]
912
- ), or = n(
933
+ ), dr = r(
913
934
  ({
914
935
  loading: e,
915
936
  reason: t
916
937
  }) => {
917
- if (P) {
918
- g(!1);
938
+ if (_) {
939
+ b(!1);
919
940
  return;
920
941
  }
921
- if (!I || M) {
922
- g(!1);
942
+ if (!I || k) {
943
+ b(!1);
923
944
  return;
924
945
  }
925
- e && t && Ze(t), g(Zr(t, e));
946
+ e && t && at(t), b(fo(t, e));
926
947
  },
927
948
  [
928
949
  I,
929
- M,
930
- P
950
+ k,
951
+ _
931
952
  ]
932
953
  );
933
- s(() => {
934
- P && g(!1);
935
- }, [P]);
936
- const ir = n(
954
+ c(() => {
955
+ _ && b(!1);
956
+ }, [_]);
957
+ const fr = r(
937
958
  (e) => {
938
- const t = b[e]?.audioKey;
959
+ const t = S[e]?.audioKey;
939
960
  if (!t || !A || t !== A)
940
961
  return;
941
- const l = k.findIndex(
942
- (r) => r === t
962
+ const o = M.findIndex(
963
+ (n) => n === t
943
964
  );
944
- if (l < 0) {
945
- q(null);
965
+ if (o < 0) {
966
+ K(null);
946
967
  return;
947
968
  }
948
- const a = l + 1, u = k[a];
949
- if (u) {
950
- q(u);
969
+ const i = o + 1, l = M[i];
970
+ if (l) {
971
+ K(l);
951
972
  return;
952
973
  }
953
- if (q(null), et(!0), g(!1), R) {
954
- const r = o + 1, T = E[r];
955
- Xt && T?.type === "interaction" && (J.current = r), _();
974
+ if (K(null), ct(!0), b(!1), R) {
975
+ const n = a + 1, E = C[n];
976
+ on && E?.type === "interaction" && (J.current = n), O();
956
977
  return;
957
978
  }
958
979
  },
959
980
  [
960
- b,
981
+ S,
961
982
  R,
962
- o,
983
+ a,
963
984
  A,
964
- k,
965
- _,
966
- Xt,
967
- E
985
+ M,
986
+ O,
987
+ on,
988
+ C
968
989
  ]
969
- ), lr = n(() => {
970
- S && De((e) => !e);
971
- }, [S]), sr = n(() => {
972
- Oe.current = !0, V(), y && Ae(!0);
973
- }, [V, y]), ar = n(() => {
974
- Oe.current = !1, v(!0);
975
- }, [v]), sn = n(
990
+ ), mr = r(() => {
991
+ y && ze((e) => !e);
992
+ }, [y]), pr = r(() => {
993
+ Ke.current = !0, V(), g && Ce(!0);
994
+ }, [V, g]), yr = r(() => {
995
+ Ke.current = !1, v(!0);
996
+ }, [v]), wt = r(
976
997
  (e) => {
977
- e.stopPropagation(), x && v(!0);
998
+ e.stopPropagation(), w && v(!0);
978
999
  },
979
- [x, v]
980
- ), ur = n(
1000
+ [w, v]
1001
+ ), Ze = r(
1002
+ (e, t) => {
1003
+ const o = it.current;
1004
+ if (!o)
1005
+ return null;
1006
+ const i = e.getBoundingClientRect(), l = o.getBoundingClientRect();
1007
+ return {
1008
+ minX: t.x + l.left - i.left,
1009
+ maxX: t.x + l.right - i.right,
1010
+ minY: t.y + l.top - i.top,
1011
+ maxY: t.y + l.bottom - i.bottom
1012
+ };
1013
+ },
1014
+ []
1015
+ );
1016
+ so(() => {
1017
+ const e = be.current;
1018
+ if (!Be || !e) {
1019
+ xe.current = null;
1020
+ return;
1021
+ }
1022
+ const t = xe.current, o = e.getBoundingClientRect();
1023
+ if (!t || pt) {
1024
+ xe.current = o;
1025
+ return;
1026
+ }
1027
+ const i = {
1028
+ x: x.x + t.left - o.left,
1029
+ y: x.y + t.top - o.top
1030
+ }, l = Ze(
1031
+ e,
1032
+ x
1033
+ ), n = l ? gn(i, l) : i;
1034
+ xe.current = {
1035
+ left: o.left + n.x - x.x,
1036
+ top: o.top + n.y - x.y
1037
+ }, (n.x !== x.x || n.y !== x.y) && mt(n);
1038
+ }, [
1039
+ Ze,
1040
+ x,
1041
+ pt,
1042
+ w,
1043
+ g,
1044
+ Be
1045
+ ]);
1046
+ const hr = r(
981
1047
  (e) => {
982
- D(), wt?.(e);
1048
+ if (wt(e), e.button !== 0 || !e.currentTarget.isConnected || !be.current)
1049
+ return;
1050
+ const t = Ze(
1051
+ be.current,
1052
+ x
1053
+ );
1054
+ t && (e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), Ae.current = {
1055
+ pointerId: e.pointerId,
1056
+ startClientX: e.clientX,
1057
+ startClientY: e.clientY,
1058
+ startOffset: x,
1059
+ bounds: t
1060
+ }, yt(!0));
983
1061
  },
984
- [D, wt]
985
- ), cr = n(
1062
+ [
1063
+ Ze,
1064
+ x,
1065
+ wt
1066
+ ]
1067
+ ), gr = r(
986
1068
  (e) => {
987
- D(), Tt?.(e);
1069
+ const t = Ae.current;
1070
+ !t || t.pointerId !== e.pointerId || (e.preventDefault(), e.stopPropagation(), mt(
1071
+ gn(
1072
+ {
1073
+ x: t.startOffset.x + e.clientX - t.startClientX,
1074
+ y: t.startOffset.y + e.clientY - t.startClientY
1075
+ },
1076
+ t.bounds
1077
+ )
1078
+ ));
988
1079
  },
989
- [D, Tt]
990
- ), dr = n(() => {
1080
+ []
1081
+ ), pn = r(
1082
+ (e) => {
1083
+ const t = Ae.current;
1084
+ !t || t.pointerId !== e.pointerId || (e.stopPropagation(), e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), Ae.current = null, yt(!1));
1085
+ },
1086
+ []
1087
+ ), vr = r(
1088
+ (e) => {
1089
+ q(), Mt?.(e);
1090
+ },
1091
+ [q, Mt]
1092
+ ), Sr = r(
1093
+ (e) => {
1094
+ q(), kt?.(e);
1095
+ },
1096
+ [q, kt]
1097
+ ), Ir = r(() => {
991
1098
  ie(!0), v(!0);
992
1099
  }, [v]);
993
- return s(() => {
994
- const e = Rt.current, a = (e.length > 0 && e.length < oe.length && e.every((r, T) => r === oe[T]) ? C.slice(e.length) : []).some(
995
- (r) => r.is_new === !1
1100
+ return c(() => {
1101
+ const e = Bt.current, i = (e.length > 0 && e.length < oe.length && e.every((n, E) => n === oe[E]) ? P.slice(e.length) : []).some(
1102
+ (n) => n.is_new === !1
996
1103
  );
997
- if (Rt.current = oe, !a)
1104
+ if (Bt.current = oe, !i)
998
1105
  return;
999
- const u = window.requestAnimationFrame(() => {
1000
- const r = Fe.current, T = Ct.current;
1001
- if (!r || !T)
1106
+ const l = window.requestAnimationFrame(() => {
1107
+ const n = qe.current, E = Ft.current;
1108
+ if (!n || !E)
1002
1109
  return;
1003
- const N = r.getBoundingClientRect(), Ge = T.getBoundingClientRect(), _e = r.scrollTop + (Ge.top - N.top);
1004
- r.scrollTo({
1005
- top: Math.max(_e, 0),
1110
+ const D = n.getBoundingClientRect(), et = E.getBoundingClientRect(), Ne = n.scrollTop + (et.top - D.top);
1111
+ n.scrollTo({
1112
+ top: Math.max(Ne, 0),
1006
1113
  behavior: "smooth"
1007
1114
  });
1008
1115
  });
1009
1116
  return () => {
1010
- window.cancelAnimationFrame(u);
1117
+ window.cancelAnimationFrame(l);
1011
1118
  };
1012
- }, [C, oe]), s(() => {
1013
- if (!be.current || (be.current = !1, C.length === 0))
1119
+ }, [P, oe]), c(() => {
1120
+ if (!we.current || (we.current = !1, P.length === 0))
1014
1121
  return;
1015
1122
  const e = window.requestAnimationFrame(() => {
1016
- ln();
1123
+ mn();
1017
1124
  });
1018
1125
  return () => {
1019
1126
  window.cancelAnimationFrame(e);
1020
1127
  };
1021
- }, [C, ln]), /* @__PURE__ */ i.jsxs(
1128
+ }, [P, mn]), /* @__PURE__ */ s.jsxs(
1022
1129
  "section",
1023
1130
  {
1024
- ref: ye,
1025
- className: pe(
1131
+ ref: ve,
1132
+ className: ye(
1026
1133
  "relative h-full w-full",
1027
1134
  L && "slide--mobile-device",
1028
- Ht && "slide--browser-fullscreen",
1029
- ue && "slide--mobile-landscape",
1030
- Ut && "slide--mobile-landscape-native",
1031
- Sn
1135
+ Xt && "slide--browser-fullscreen",
1136
+ ce && "slide--mobile-landscape",
1137
+ Wt && "slide--mobile-landscape-native",
1138
+ wn
1032
1139
  ),
1033
- onClick: dr,
1034
- onFocusCapture: cr,
1035
- onPointerDown: ur,
1036
- ...vn,
1140
+ onClick: Ir,
1141
+ onFocusCapture: Sr,
1142
+ onPointerDown: vr,
1143
+ ...Tn,
1037
1144
  children: [
1038
- Vn ? /* @__PURE__ */ i.jsx(
1145
+ Hn ? /* @__PURE__ */ s.jsx(
1039
1146
  "div",
1040
1147
  {
1041
1148
  "aria-hidden": "true",
1042
1149
  className: "pointer-events-none fixed left-0 top-0 z-[9999] h-[100vh] max-h-[100vh] w-[100vw]"
1043
1150
  }
1044
1151
  ) : null,
1045
- /* @__PURE__ */ i.jsxs(
1152
+ /* @__PURE__ */ s.jsxs(
1046
1153
  "div",
1047
1154
  {
1048
- ref: Et,
1049
- className: pe(
1155
+ ref: it,
1156
+ className: ye(
1050
1157
  "slide__viewport relative h-full min-h-0 w-full",
1051
- ue && "slide__viewport--mobile-landscape",
1052
- ue && !On && "slide__viewport--mobile-landscape-native"
1158
+ ce && "slide__viewport--mobile-landscape",
1159
+ ce && !jn && "slide__viewport--mobile-landscape-native"
1053
1160
  ),
1054
1161
  children: [
1055
- Nn ? /* @__PURE__ */ i.jsxs("div", { className: "slide-landscape-header", children: [
1056
- /* @__PURE__ */ i.jsx(
1162
+ Kn ? /* @__PURE__ */ s.jsxs("div", { className: "slide-landscape-header", children: [
1163
+ /* @__PURE__ */ s.jsx(
1057
1164
  "button",
1058
1165
  {
1059
1166
  "aria-label": G?.backAriaLabel ?? $.fullscreenBackAriaLabel,
1060
1167
  className: "slide-landscape-header__back",
1061
- onClick: Dn,
1168
+ onClick: Gn,
1062
1169
  type: "button",
1063
- children: /* @__PURE__ */ i.jsx(
1064
- Gr,
1170
+ children: /* @__PURE__ */ s.jsx(
1171
+ no,
1065
1172
  {
1066
1173
  className: "slide-landscape-header__icon h-6 w-6",
1067
1174
  strokeWidth: 2.25
@@ -1069,29 +1176,29 @@ const eo = (d, h) => d.length === h.length && d.every((U, he) => {
1069
1176
  )
1070
1177
  }
1071
1178
  ),
1072
- G?.content ? /* @__PURE__ */ i.jsx("div", { className: "min-w-0 flex-1 overflow-hidden", children: G.content }) : null
1179
+ G?.content ? /* @__PURE__ */ s.jsx("div", { className: "min-w-0 flex-1 overflow-hidden", children: G.content }) : null
1073
1180
  ] }) : null,
1074
- /* @__PURE__ */ i.jsx(
1181
+ /* @__PURE__ */ s.jsx(
1075
1182
  "div",
1076
1183
  {
1077
- className: pe(
1184
+ className: ye(
1078
1185
  "h-full min-h-0 w-full",
1079
- Ln && "slide__viewport-content--with-header",
1080
- An ? "slide-content--single" : "grid gap-4"
1186
+ Un && "slide__viewport-content--with-header",
1187
+ Rn ? "slide-content--single" : "grid gap-4"
1081
1188
  ),
1082
- children: C.length > 0 ? /* @__PURE__ */ i.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ i.jsx("div", { ref: Fe, className: "slide-stage__layer w-full", children: qn.map(
1189
+ children: P.length > 0 ? /* @__PURE__ */ s.jsx("div", { className: "slide-stage", children: /* @__PURE__ */ s.jsx("div", { ref: qe, className: "slide-stage__layer w-full", children: $n.map(
1083
1190
  (e, t) => {
1084
- const l = t === Kn;
1085
- return /* @__PURE__ */ i.jsx(
1191
+ const o = t === zn;
1192
+ return /* @__PURE__ */ s.jsx(
1086
1193
  "div",
1087
1194
  {
1088
- "data-active-step": l ? "true" : void 0,
1089
- "aria-hidden": !l || void 0,
1195
+ "data-active-step": o ? "true" : void 0,
1196
+ "aria-hidden": !o || void 0,
1090
1197
  className: "w-full h-full",
1091
- style: { display: l ? void 0 : "none" },
1092
- children: Zn(
1198
+ style: { display: o ? void 0 : "none" },
1199
+ children: lr(
1093
1200
  e.elementList,
1094
- l
1201
+ o
1095
1202
  )
1096
1203
  },
1097
1204
  e.sourceStepIndexes[0] ?? t
@@ -1100,126 +1207,124 @@ const eo = (d, h) => d.length === h.length && d.every((U, he) => {
1100
1207
  ) }) }) : null
1101
1208
  }
1102
1209
  ),
1103
- En ? /* @__PURE__ */ i.jsx(
1104
- hr,
1210
+ kn ? /* @__PURE__ */ s.jsx(
1211
+ Tr,
1105
1212
  {
1106
- message: Xr(
1107
- bn,
1108
- Cn
1213
+ message: co(
1214
+ En,
1215
+ Fn
1109
1216
  ),
1110
1217
  className: "absolute left-1/2 top-1/2 z-[3] -translate-x-1/2 -translate-y-1/2"
1111
1218
  }
1112
1219
  ) : null,
1113
- /* @__PURE__ */ i.jsx(
1114
- gr,
1220
+ /* @__PURE__ */ s.jsx(
1221
+ Or,
1115
1222
  {
1116
- extraBottomOffset: kn,
1117
- hasPlayerGap: x,
1118
- isEnabled: Vt && Rn,
1119
- isPlayerHidden: y && !x,
1223
+ extraBottomOffset: Dn,
1224
+ hasPlayerGap: w,
1225
+ isEnabled: Yt && Bn,
1226
+ isPlayerHidden: g && !w,
1120
1227
  playbackTimeStore: se,
1121
- subtitleCues: Un
1228
+ subtitleCues: Jn
1122
1229
  }
1123
1230
  ),
1124
- mt ? /* @__PURE__ */ i.jsx(
1231
+ Be ? /* @__PURE__ */ s.jsx(
1125
1232
  "div",
1126
1233
  {
1127
- ref: Ye,
1234
+ ref: be,
1128
1235
  "data-player-keyboard-shortcuts-ignore": "true",
1129
- className: pe(
1236
+ className: ye(
1130
1237
  "slide-interaction-overlay",
1131
- x && y ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
1238
+ w && g ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone",
1239
+ pt && "slide-interaction-overlay--dragging"
1132
1240
  ),
1133
- onClick: sn,
1134
- onPointerDown: sn,
1241
+ onClick: wt,
1135
1242
  onPointerDownCapture: (e) => {
1136
- St(e.target) && qe(!0);
1243
+ Ct(e.target) && Je(!0);
1137
1244
  },
1138
1245
  onFocusCapture: (e) => {
1139
- fn(e.target) && ot(!0), St(e.target) && qe(!0);
1140
- },
1141
- onBlurCapture: (e) => {
1142
- if (!fn(e.target))
1143
- return;
1144
- const t = e.relatedTarget;
1145
- t instanceof HTMLElement && Ye.current?.contains(t) || ot(!1);
1246
+ Ct(e.target) && Je(!0);
1146
1247
  },
1147
1248
  onInputCapture: (e) => {
1148
- St(e.target) && qe(!0);
1249
+ Ct(e.target) && Je(!0);
1149
1250
  },
1150
- style: Hn,
1151
- children: /* @__PURE__ */ i.jsx(
1152
- mn,
1251
+ style: Wn,
1252
+ children: /* @__PURE__ */ s.jsx(
1253
+ bn,
1153
1254
  {
1154
- content: String(S?.content ?? ""),
1255
+ content: String(y?.content ?? ""),
1155
1256
  locale: h,
1156
- defaultButtonText: nn.buttonText ?? "",
1157
- defaultInputText: nn.inputText ?? "",
1158
- defaultSelectedValues: Wn,
1257
+ defaultButtonText: un.buttonText ?? "",
1258
+ defaultInputText: un.inputText ?? "",
1259
+ defaultSelectedValues: tr,
1159
1260
  confirmButtonText: te?.confirmButtonText ?? $.interactionTexts.confirmButtonText,
1160
1261
  copyButtonText: te?.copyButtonText ?? $.interactionTexts.copyButtonText,
1161
1262
  copiedButtonText: te?.copiedButtonText ?? $.interactionTexts.copiedButtonText,
1162
- onSend: Xn,
1163
- readonly: on,
1164
- title: te?.title ?? ze ?? $.interactionTexts.title
1263
+ onSend: or,
1264
+ onDragHandlePointerCancel: pn,
1265
+ onDragHandlePointerDown: hr,
1266
+ onDragHandlePointerMove: gr,
1267
+ onDragHandlePointerUp: pn,
1268
+ readonly: rr,
1269
+ title: te?.title ?? nt ?? $.interactionTexts.title
1165
1270
  }
1166
1271
  )
1167
1272
  }
1168
1273
  ) : null,
1169
- y ? /* @__PURE__ */ i.jsx(
1170
- wr.Provider,
1274
+ g ? /* @__PURE__ */ s.jsx(
1275
+ Fr.Provider,
1171
1276
  {
1172
- value: xn,
1173
- children: /* @__PURE__ */ i.jsx(
1174
- br,
1277
+ value: _n,
1278
+ children: /* @__PURE__ */ s.jsx(
1279
+ Rr,
1175
1280
  {
1176
- audioList: b,
1177
- className: pe(
1281
+ audioList: S,
1282
+ className: ye(
1178
1283
  "absolute left-1/2 z-[2] -translate-x-1/2",
1179
- Ht ? "bottom-3" : "-bottom-3",
1180
- H,
1181
- !x && "pointer-events-none opacity-0"
1284
+ Xt ? "bottom-3" : "-bottom-3",
1285
+ Y,
1286
+ !w && "pointer-events-none opacity-0"
1182
1287
  ),
1183
- currentAudioIndex: w,
1184
- defaultPlaying: Qe,
1288
+ currentAudioIndex: T,
1289
+ defaultPlaying: st,
1185
1290
  enableKeyboardShortcuts: ne,
1186
1291
  isPlaybackPaused: W,
1187
- isAutoAdvanceEnabled: xe,
1292
+ isAutoAdvanceEnabled: Pe,
1188
1293
  locale: h,
1189
- hasInteraction: !!S,
1294
+ hasInteraction: !!y,
1190
1295
  isInteractionOpen: le,
1191
- isSubtitleEnabled: Vt,
1192
- onAutoAdvanceToggle: Nt,
1193
- onLoadingChange: or,
1296
+ isSubtitleEnabled: Yt,
1297
+ onAutoAdvanceToggle: Ut,
1298
+ onLoadingChange: dr,
1194
1299
  onPlaybackStarted: () => {
1195
- je(!0);
1300
+ $e(!0);
1196
1301
  },
1197
- onPlaybackPreferenceChange: Jn,
1302
+ onPlaybackPreferenceChange: er,
1198
1303
  onPlaybackTimeChange: se.setTime,
1199
1304
  onSubtitleToggle: () => {
1200
- Pn((e) => !e);
1305
+ Nn((e) => !e);
1201
1306
  },
1202
1307
  nextDisabled: !R,
1203
- onEnded: ir,
1204
- onFullscreen: er,
1205
- isFullscreen: Dt,
1308
+ onEnded: fr,
1309
+ onFullscreen: sr,
1310
+ isFullscreen: $t,
1206
1311
  mobileViewMode: ae,
1207
- settingsPortalContainer: Et.current,
1208
- onMobileViewModeChange: jn,
1209
- onControlsPointerEnter: sr,
1210
- onControlsPointerLeave: ar,
1211
- onInteractionToggle: lr,
1212
- onNext: rr,
1213
- onPrev: nr,
1214
- onSubtitleJump: tr,
1215
- canJumpToSubtitleTarget: pt,
1216
- prevDisabled: !gn,
1217
- showControls: x,
1218
- subtitleSeekRequest: Tn,
1219
- texts: pn,
1220
- customActionContext: at,
1312
+ settingsPortalContainer: it.current,
1313
+ onMobileViewModeChange: Yn,
1314
+ onControlsPointerEnter: pr,
1315
+ onControlsPointerLeave: yr,
1316
+ onInteractionToggle: mr,
1317
+ onNext: ur,
1318
+ onPrev: cr,
1319
+ onSubtitleJump: ar,
1320
+ canJumpToSubtitleTarget: At,
1321
+ prevDisabled: !Pn,
1322
+ showControls: w,
1323
+ subtitleSeekRequest: Mn,
1324
+ texts: rt,
1325
+ customActionContext: St,
1221
1326
  customActions: Z,
1222
- useAutoAdvanceToggle: Ee
1327
+ useAutoAdvanceToggle: Oe
1223
1328
  }
1224
1329
  )
1225
1330
  }
@@ -1232,6 +1337,6 @@ const eo = (d, h) => d.length === h.length && d.every((U, he) => {
1232
1337
  );
1233
1338
  };
1234
1339
  export {
1235
- jo as default
1340
+ Xo as default
1236
1341
  };
1237
1342
  //# sourceMappingURL=Slide.es.js.map