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