markdown-flow-ui 0.1.111 → 0.1.112-beta.0

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