markdown-flow-ui 0.1.109 → 0.1.111

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