markdown-flow-ui 0.2.3-dev.2 → 0.2.3-dev.3

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