markdown-flow-ui 0.1.115-beta.1 → 0.1.115-beta.2

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.
@@ -3,10 +3,10 @@ import { memo as pn, useRef as p, useMemo as c, useState as m, useCallback as r,
3
3
  import { isSandboxInteractionMessage as hn } from "../../lib/sandboxInteraction.es.js";
4
4
  import { cn as J } from "../../lib/utils.es.js";
5
5
  import vn from "../ui/loading-overlay-card.es.js";
6
- import yn from "../ContentRender/ContentRender.es.js";
6
+ import gn from "../ContentRender/ContentRender.es.js";
7
7
  import wt from "../ContentRender/IframeSandbox.es.js";
8
8
  import "../ui/inputGroup/input-group.es.js";
9
- import { getInteractionDefaultValues as gn, getInteractionDefaultSelectedValues as Sn } from "../../lib/interaction-defaults.es.js";
9
+ import { getInteractionDefaultValues as yn, getInteractionDefaultSelectedValues as Sn } from "../../lib/interaction-defaults.es.js";
10
10
  import { isMobileDevice as bn, isLandscapeViewport as It, subscribeMobileDeviceChange as An } from "../../lib/mobileDevice.es.js";
11
11
  import xn from "./Player.es.js";
12
12
  import wn from "./SubtitleOverlay.es.js";
@@ -25,27 +25,27 @@ const Nn = 2e3, On = 300, jn = 160, Ln = 16, Ve = "waitingForAudio", _t = {
25
25
  waitingForAudio: "Waiting for current slide audio...",
26
26
  loadingAudio: "Loading current slide audio...",
27
27
  waitingForMoreAudio: "Waiting for more current slide audio..."
28
- }, Kn = (x, k) => typeof x == "string" ? x : x[k] ?? x[Ve] ?? _t[k], Et = pn(
28
+ }, Kn = (S, w) => typeof S == "string" ? S : S[w] ?? S[Ve] ?? _t[w], Vn = (S, w) => w ? S !== "loadingAudio" : !1, Et = pn(
29
29
  ({
30
- content: x,
31
- title: k,
32
- defaultButtonText: w,
30
+ content: S,
31
+ title: w,
32
+ defaultButtonText: I,
33
33
  defaultInputText: Q,
34
- defaultSelectedValues: I,
34
+ defaultSelectedValues: _,
35
35
  confirmButtonText: V,
36
36
  copyButtonText: Z,
37
37
  copiedButtonText: Ie,
38
38
  onSend: _e,
39
39
  readonly: D = !1
40
40
  }) => /* @__PURE__ */ n.jsxs("div", { className: "slide-player__interaction-card", children: [
41
- /* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ n.jsx("p", { className: "slide-player__interaction-title", children: k }) }),
41
+ /* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-header", children: /* @__PURE__ */ n.jsx("p", { className: "slide-player__interaction-title", children: w }) }),
42
42
  /* @__PURE__ */ n.jsx("div", { className: "slide-player__interaction-body", children: /* @__PURE__ */ n.jsx(
43
- yn,
43
+ gn,
44
44
  {
45
- content: x,
46
- defaultButtonText: w,
45
+ content: S,
46
+ defaultButtonText: I,
47
47
  defaultInputText: Q,
48
- defaultSelectedValues: I,
48
+ defaultSelectedValues: _,
49
49
  confirmButtonText: V,
50
50
  copyButtonText: Z,
51
51
  copiedButtonText: Ie,
@@ -58,15 +58,15 @@ const Nn = 2e3, On = 300, jn = 160, Ln = 16, Ve = "waitingForAudio", _t = {
58
58
  ] })
59
59
  );
60
60
  Et.displayName = "InteractionOverlayCard";
61
- const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
62
- const I = k[Q];
63
- return w.sequence_number === I?.sequence_number && w.type === I?.type && w.content === I?.content;
64
- }), fr = ({
65
- elementList: x = [],
66
- showPlayer: k = !0,
67
- playerAlwaysVisible: w = !1,
61
+ const Dn = (S, w) => S.length === w.length && S.every((I, Q) => {
62
+ const _ = w[Q];
63
+ return I.sequence_number === _?.sequence_number && I.type === _?.type && I.content === _?.content;
64
+ }), mr = ({
65
+ elementList: S = [],
66
+ showPlayer: w = !0,
67
+ playerAlwaysVisible: I = !1,
68
68
  playerClassName: Q,
69
- fullscreenHeader: I,
69
+ fullscreenHeader: _,
70
70
  playerCustomActions: V,
71
71
  playerCustomActionPauseOnActive: Z = !0,
72
72
  bufferingText: Ie = _t,
@@ -81,7 +81,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
81
81
  onMobileViewModeChange: Ue,
82
82
  onStepChange: ze,
83
83
  enableIframeScaling: Rt = !0,
84
- disableLoadingOverlay: T = !1,
84
+ disableLoadingOverlay: R = !1,
85
85
  className: Ct,
86
86
  onPointerDown: Ge,
87
87
  ...Pt
@@ -97,21 +97,21 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
97
97
  currentIndex: d,
98
98
  audioList: h,
99
99
  currentAudioSequenceIndexes: pe,
100
- currentStepHasSpeakableElement: S,
100
+ currentStepHasSpeakableElement: b,
101
101
  currentInteractionElement: u,
102
102
  canGoPrev: Mt,
103
- canGoNext: A,
103
+ canGoNext: x,
104
104
  handlePrev: Ze,
105
- handleNext: R
106
- } = In(x), oe = c(() => {
105
+ handleNext: C
106
+ } = In(S), oe = c(() => {
107
107
  if (!(d < 0))
108
108
  return N[d];
109
109
  }, [d, N]), Ft = N.filter(
110
110
  (e) => e.is_renderable !== !1
111
- ).length === 1, _ = k && (N.length > 0 || h.length > 0 || !!u), C = c(
111
+ ).length === 1, E = w && (N.length > 0 || h.length > 0 || !!u), P = c(
112
112
  () => pe.map((e) => h[e]?.audioKey).filter((e) => !!e),
113
113
  [h, pe]
114
- ), [et, he] = m(!0), [ve, se] = m(!1), [ie, tt] = m(!0), [v, U] = m(null), [kt, y] = m(!1), [Bt, Ce] = m(Ve), [P, nt] = m(!1), [Nt, Pe] = m(!1), [rt, Ot] = m(!0), [Me, Fe] = m(!1), [o, ke] = m(), [ye, ge] = m(!1), [
114
+ ), [et, he] = m(!0), [ve, se] = m(!1), [ie, tt] = m(!0), [v, U] = m(null), [kt, g] = m(!1), [Bt, Ce] = m(Ve), [M, nt] = m(!1), [Nt, Pe] = m(!1), [rt, Ot] = m(!0), [Me, Fe] = m(!1), [o, ke] = m(), [ge, ye] = m(!1), [
115
115
  jt,
116
116
  le
117
117
  ] = m(0), [ot, Lt] = m(!1), O = c(() => bn(), []), [Se, Be] = m(
@@ -135,7 +135,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
135
135
  Kt,
136
136
  Se
137
137
  ]
138
- ), Dt = p(G), M = _ && (w || et), qt = H && M, Ut = H && M, zt = H || lt, ct = ot && !O, Gt = r(
138
+ ), Dt = p(G), F = E && (I || et), qt = H && F, Ut = H && F, zt = H || lt, ct = ot && !O, Gt = r(
139
139
  (e) => {
140
140
  Ne(!0), Be(e);
141
141
  },
@@ -143,8 +143,8 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
143
143
  ), at = r(() => {
144
144
  Ne(!1), Be(we);
145
145
  }, []), Ht = r(() => {
146
- at(), I?.onBack?.();
147
- }, [I, at]), ut = r((e) => {
146
+ at(), _?.onBack?.();
147
+ }, [_, at]), ut = r((e) => {
148
148
  Fe(e);
149
149
  }, []), dt = r(() => {
150
150
  Fe((e) => !e);
@@ -152,7 +152,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
152
152
  const e = [], t = /* @__PURE__ */ new Map();
153
153
  return Qe.forEach((l, f) => {
154
154
  const i = e.findIndex(
155
- (a) => Vn(
155
+ (a) => Dn(
156
156
  a.elementList,
157
157
  l
158
158
  )
@@ -169,18 +169,18 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
169
169
  mountedStepStates: e,
170
170
  currentMountedStateIndex: d >= 0 ? t.get(d) ?? -1 : -1
171
171
  };
172
- }, [d, Qe]), ft = c(() => String(d), [d]), g = c(() => v ? h.findIndex(
172
+ }, [d, Qe]), ft = c(() => String(d), [d]), y = c(() => v ? h.findIndex(
173
173
  (e) => (e.audioKey ?? "") === v
174
174
  ) : -1, [h, v]), Oe = c(
175
- () => g >= 0 ? h[g] : void 0,
176
- [h, g]
175
+ () => y >= 0 ? h[y] : void 0,
176
+ [h, y]
177
177
  ), Yt = Oe?.element?.subtitle_cues ?? [], be = c(
178
- () => C[0] ?? "none",
179
- [C]
178
+ () => P[0] ?? "none",
179
+ [P]
180
180
  ), je = c(
181
181
  () => ({
182
182
  currentElement: Pn({
183
- currentAudioIndex: g,
183
+ currentAudioIndex: y,
184
184
  currentAudioSequenceIndexes: pe,
185
185
  audioList: h,
186
186
  currentInteractionElement: o,
@@ -195,7 +195,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
195
195
  [
196
196
  o,
197
197
  h,
198
- g,
198
+ y,
199
199
  pe,
200
200
  d,
201
201
  oe,
@@ -217,7 +217,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
217
217
  )
218
218
  }),
219
219
  [Le]
220
- ), mt = C.length > 0, pt = c(() => u ? `${u.sequence_number ?? "none"}:${String(
220
+ ), mt = P.length > 0, pt = c(() => u ? `${u.sequence_number ?? "none"}:${String(
221
221
  u.content ?? ""
222
222
  )}` : "none", [u]), ce = c(
223
223
  () => [ft, pt].join("|"),
@@ -226,91 +226,91 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
226
226
  () => [
227
227
  ce,
228
228
  Oe?.audioKey ?? "none",
229
- String(g)
229
+ String(y)
230
230
  ].join("|"),
231
- [g, Oe?.audioKey, ce]
231
+ [y, Oe?.audioKey, ce]
232
232
  ), ht = !!c(() => !be || be === "none" ? "" : h.find(
233
233
  (t) => t.audioKey === be
234
234
  )?.audioUrl?.trim() ?? "", [h, be]), L = Z && !!V && Me, ae = c(
235
235
  () => kn({
236
- canGoNext: A,
237
- currentAudioIndex: g,
238
- currentStepHasSpeakableElement: S,
236
+ canGoNext: x,
237
+ currentAudioIndex: y,
238
+ currentStepHasSpeakableElement: b,
239
239
  hasInteraction: !!u
240
240
  }),
241
241
  [
242
- A,
243
- g,
242
+ x,
243
+ y,
244
244
  u,
245
- S
245
+ b
246
246
  ]
247
247
  ), K = r(() => {
248
248
  ee.current !== null && (window.clearTimeout(ee.current), ee.current = null);
249
249
  }, []), j = r(() => {
250
250
  ne.current !== null && (window.clearTimeout(ne.current), ne.current = null);
251
- }, []), F = r(() => {
251
+ }, []), k = r(() => {
252
252
  re.current !== null && (window.clearTimeout(re.current), re.current = null);
253
253
  }, []), W = r(() => {
254
254
  te.current !== null && (window.clearTimeout(te.current), te.current = null);
255
255
  }, []), $ = r(() => {
256
- W(), j(), F(), U(null), z.reset(), y(!1), Ce(Ve), nt(!1), Pe(!1), ke(void 0), ge(!1), le(0);
256
+ W(), j(), k(), U(null), z.reset(), g(!1), Ce(Ve), nt(!1), Pe(!1), ke(void 0), ye(!1), le(0);
257
257
  }, [
258
258
  W,
259
259
  j,
260
- F,
260
+ k,
261
261
  z
262
262
  ]), Y = r(() => {
263
- const e = C[0];
263
+ const e = P[0];
264
264
  return e ? (U(e), !0) : !1;
265
- }, [C]), Ae = r(() => {
266
- j(), F(), ge(!1), le(0), !Y() && A && R();
265
+ }, [P]), Ae = r(() => {
266
+ j(), k(), ye(!1), le(0), !Y() && x && C();
267
267
  }, [
268
- A,
268
+ x,
269
269
  j,
270
- F,
271
- R,
270
+ k,
271
+ C,
272
272
  Y
273
273
  ]), vt = r(
274
274
  (e) => {
275
- if (F(), !e)
275
+ if (k(), !e)
276
276
  return;
277
277
  const t = () => {
278
278
  re.current = null, le(
279
279
  jn
280
- ), ge(!0), q.current = null;
280
+ ), ye(!0), q.current = null;
281
281
  };
282
282
  re.current = window.setTimeout(
283
283
  t,
284
284
  On
285
285
  );
286
286
  },
287
- [F]
288
- ), b = r(
287
+ [k]
288
+ ), A = r(
289
289
  (e = ve) => {
290
- _ && (he(!0), K(), !(w || !e || Ee <= 0) && (ee.current = window.setTimeout(() => {
290
+ E && (he(!0), K(), !(I || !e || Ee <= 0) && (ee.current = window.setTimeout(() => {
291
291
  he(!1), ee.current = null;
292
292
  }, Ee)));
293
293
  },
294
294
  [
295
295
  K,
296
296
  ve,
297
- w,
297
+ I,
298
298
  Ee,
299
- _
299
+ E
300
300
  ]
301
301
  ), ue = !!(u?.readonly || u?.user_input?.trim()), X = !!u && !ue;
302
302
  s(() => {
303
303
  tt(!0), Z && Fe(!1);
304
304
  }, [d, Z]), s(() => () => {
305
- W(), K(), j(), F();
305
+ W(), K(), j(), k();
306
306
  }, [
307
307
  W,
308
308
  j,
309
- F,
309
+ k,
310
310
  K
311
- ]), s(() => (Te?.(M), () => {
311
+ ]), s(() => (Te?.(F), () => {
312
312
  Te?.(!1);
313
- }), [Te, M]), s(() => {
313
+ }), [Te, F]), s(() => {
314
314
  O || Se === we || (Ne(!1), Be(we));
315
315
  }, [O, Se]), s(() => {
316
316
  if (!O) {
@@ -334,11 +334,11 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
334
334
  nextMarkerCount: N.length,
335
335
  previousIndex: e.currentIndex,
336
336
  previousCanGoNext: e.canGoNext,
337
- nextCanGoNext: A,
337
+ nextCanGoNext: x,
338
338
  currentAudioKey: v,
339
- hasCompletedCurrentStepAudio: P,
339
+ hasCompletedCurrentStepAudio: M,
340
340
  hasResolvedCurrentInteraction: ue,
341
- currentStepHasSpeakableElement: S,
341
+ currentStepHasSpeakableElement: b,
342
342
  currentInteractionElement: u,
343
343
  isAutoAdvanceEnabled: ie,
344
344
  shouldUseSilentStepAutoAdvanceToggle: ae
@@ -347,57 +347,57 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
347
347
  Je.current = {
348
348
  markerCount: N.length,
349
349
  currentIndex: d,
350
- canGoNext: A
351
- }, t && R();
350
+ canGoNext: x
351
+ }, t && C();
352
352
  }, [
353
- A,
353
+ x,
354
354
  v,
355
355
  d,
356
356
  u,
357
- S,
358
- R,
359
- P,
357
+ b,
358
+ C,
359
+ M,
360
360
  ue,
361
361
  ie,
362
362
  ae,
363
363
  N.length
364
364
  ]), s(() => {
365
- if (!_) {
365
+ if (!E) {
366
366
  K(), he(!1);
367
367
  return;
368
368
  }
369
- if (w) {
369
+ if (I) {
370
370
  K(), he(!0);
371
371
  return;
372
372
  }
373
- ve || b(!0);
373
+ ve || A(!0);
374
374
  }, [
375
375
  K,
376
376
  ve,
377
- w,
378
- _,
379
- b
377
+ I,
378
+ E,
379
+ A
380
380
  ]), s(() => {
381
381
  if (typeof window > "u")
382
382
  return;
383
383
  const e = (t) => {
384
- t.origin === window.location.origin && hn(t.data) && t.data.eventType === "click" && _ && (se(!0), b(!0));
384
+ t.origin === window.location.origin && hn(t.data) && t.data.eventType === "click" && E && (se(!0), A(!0));
385
385
  };
386
386
  return window.addEventListener("message", e), () => {
387
387
  window.removeEventListener("message", e);
388
388
  };
389
- }, [_, b]), _n({
389
+ }, [E, A]), _n({
390
390
  sectionRef: fe,
391
- enabled: _,
391
+ enabled: E,
392
392
  onWake: () => {
393
- se(!0), b(!0);
393
+ se(!0), A(!0);
394
394
  }
395
395
  }), s(() => {
396
396
  const { hasPlaybackContextChanged: e, shouldInitializeAudioSequence: t } = Cn({
397
397
  previousResetKey: Xe.current,
398
398
  nextResetKey: ce,
399
399
  currentAudioKey: v,
400
- hasCompletedCurrentStepAudio: P
400
+ hasCompletedCurrentStepAudio: M
401
401
  });
402
402
  Xe.current = ce;
403
403
  const l = q.current === d && !!u, f = Tn({
@@ -406,94 +406,94 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
406
406
  shouldOpenInteractionOverlayAfterAudio: l,
407
407
  hasPlaybackContextChanged: e,
408
408
  hasResolvedCurrentInteraction: ue,
409
- currentStepHasSpeakableElement: S
409
+ currentStepHasSpeakableElement: b
410
410
  });
411
411
  if (e && $(), !(B.length === 0 && !u) && !L) {
412
412
  if (u && ke(u), f) {
413
413
  vt(u);
414
414
  return;
415
415
  }
416
- if (F(), q.current = null, !!t && !Y()) {
417
- if (S) {
418
- if (T) {
419
- y(!1);
416
+ if (k(), q.current = null, !!t && !Y()) {
417
+ if (b) {
418
+ if (R) {
419
+ g(!1);
420
420
  return;
421
421
  }
422
- y(!0);
422
+ g(!0);
423
423
  return;
424
424
  }
425
- if (A && !(ae && !ie))
425
+ if (x && !(ae && !ie))
426
426
  return te.current = window.setTimeout(() => {
427
- te.current = null, R();
427
+ te.current = null, C();
428
428
  }, De), () => {
429
429
  W();
430
430
  };
431
431
  }
432
432
  }
433
433
  }, [
434
- A,
434
+ x,
435
435
  W,
436
436
  B.length,
437
437
  u,
438
438
  v,
439
439
  ce,
440
- S,
440
+ b,
441
441
  De,
442
+ C,
443
+ M,
442
444
  R,
443
- P,
444
- T,
445
445
  ie,
446
446
  ue,
447
447
  X,
448
- F,
448
+ k,
449
449
  $,
450
450
  vt,
451
451
  Y,
452
452
  L,
453
453
  ae
454
454
  ]), s(() => {
455
- if (T || L || !S || X) {
456
- y(!1);
455
+ if (R || L || !b || X) {
456
+ g(!1);
457
457
  return;
458
458
  }
459
- if (P) {
460
- y(!1);
459
+ if (M) {
460
+ g(!1);
461
461
  return;
462
462
  }
463
463
  if (mt) {
464
- y(!1);
464
+ g(!1);
465
465
  return;
466
466
  }
467
- Ce("waitingForAudio"), y(!0);
467
+ Ce("waitingForAudio"), g(!0);
468
468
  }, [
469
469
  mt,
470
- S,
471
- P,
472
- T,
470
+ b,
471
+ M,
472
+ R,
473
473
  L,
474
474
  X
475
475
  ]), s(() => {
476
- v || C.length === 0 || L || !S || X || P || Y();
476
+ v || P.length === 0 || L || !b || X || M || Y();
477
477
  }, [
478
478
  v,
479
- C,
480
- S,
481
479
  P,
480
+ b,
481
+ M,
482
482
  L,
483
483
  X,
484
484
  Y
485
485
  ]), s(() => {
486
- !v || g >= 0 || U(null);
487
- }, [g, v]), s(() => {
488
- g >= 0 || z.reset();
489
- }, [g, z]), s(() => {
486
+ !v || y >= 0 || U(null);
487
+ }, [y, v]), s(() => {
488
+ y >= 0 || z.reset();
489
+ }, [y, z]), s(() => {
490
490
  Pe(!1);
491
491
  }, [Jt]);
492
- const yt = c(() => {
492
+ const gt = c(() => {
493
493
  if (!o)
494
494
  return {};
495
495
  const e = !!o.user_input?.trim();
496
- return gn(
496
+ return yn(
497
497
  typeof o.content == "string" ? o.content : void 0,
498
498
  o.user_input,
499
499
  e ? void 0 : de
@@ -507,7 +507,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
507
507
  o.user_input,
508
508
  e ? void 0 : de
509
509
  );
510
- }, [o, de]), gt = !!o?.user_input?.trim(), St = !!o?.readonly || gt, bt = St || gt, Ke = !!o && ye, Zt = r(
510
+ }, [o, de]), yt = !!o?.user_input?.trim(), St = !!o?.readonly || yt, bt = St || yt, Ke = !!o && ge, Zt = r(
511
511
  (e) => {
512
512
  const l = [
513
513
  ...e.selectedValues ?? [],
@@ -553,7 +553,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
553
553
  l.disconnect();
554
554
  };
555
555
  }, [Ke]), s(() => {
556
- if (j(), !(!ye || !bt))
556
+ if (j(), !(!ge || !bt))
557
557
  return ne.current = window.setTimeout(() => {
558
558
  ne.current = null, Ae();
559
559
  }, 2e3), () => {
@@ -562,14 +562,14 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
562
562
  }, [
563
563
  j,
564
564
  Ae,
565
- ye,
565
+ ge,
566
566
  bt
567
567
  ]);
568
568
  const en = (e, t = {}) => e ? e.type === "slot" ? /* @__PURE__ */ n.jsx(n.Fragment, { children: e.content }) : e.type === "html" ? /* @__PURE__ */ n.jsx(
569
569
  wt,
570
570
  {
571
571
  className: "content-render-iframe",
572
- disableLoadingOverlay: T,
572
+ disableLoadingOverlay: R,
573
573
  hideFullScreen: !0,
574
574
  mode: "blackboard",
575
575
  replaceRootScreenHeightWithFull: t.replaceRootScreenHeightWithFull,
@@ -581,7 +581,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
581
581
  wt,
582
582
  {
583
583
  className: "content-render-iframe",
584
- disableLoadingOverlay: T,
584
+ disableLoadingOverlay: R,
585
585
  hideFullScreen: !0,
586
586
  mode: "blackboard",
587
587
  type: "markdown",
@@ -593,20 +593,20 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
593
593
  const l = e.filter(
594
594
  (i) => i.is_renderable !== !1
595
595
  ).length, f = e.reduce(
596
- (i, a, E) => a.is_renderable !== !1 ? E : i,
596
+ (i, a, T) => a.is_renderable !== !1 ? T : i,
597
597
  -1
598
598
  );
599
599
  return /* @__PURE__ */ n.jsx("div", { className: "slide-stage__content flex w-full flex-col gap-4", children: e.map((i, a) => {
600
- const E = i.type === "html" && i.is_renderable === !1;
600
+ const T = i.type === "html" && i.is_renderable === !1;
601
601
  return /* @__PURE__ */ n.jsx(
602
602
  "div",
603
603
  {
604
604
  ref: t && a === f ? We : null,
605
- "aria-hidden": E || void 0,
605
+ "aria-hidden": T || void 0,
606
606
  className: J(
607
607
  "w-full shrink-0",
608
608
  l === 1 && i.is_renderable !== !1 && "slide-element--single",
609
- E ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : i.is_renderable === !1 && "hidden"
609
+ T ? "pointer-events-none fixed left-[-200vw] top-0 -z-10 h-[100dvh] w-[100vw] overflow-hidden opacity-0" : i.is_renderable === !1 && "hidden"
610
610
  ),
611
611
  children: en(i, {
612
612
  replaceRootScreenHeightWithFull: l === 1 && i.type === "html" && i.is_renderable !== !1
@@ -633,96 +633,96 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
633
633
  behavior: "smooth"
634
634
  });
635
635
  }, []), rn = r(() => {
636
- me.current = !0, q.current = null, se(!0), y(!1), b(!0), $(), Ze();
637
- }, [Ze, $, b]), on = r(() => {
638
- me.current = !0, q.current = null, se(!0), y(!1), b(!0), $(), R();
639
- }, [R, $, b]), sn = r(
636
+ me.current = !0, q.current = null, se(!0), g(!1), A(!0), $(), Ze();
637
+ }, [Ze, $, A]), on = r(() => {
638
+ me.current = !0, q.current = null, se(!0), g(!1), A(!0), $(), C();
639
+ }, [C, $, A]), sn = r(
640
640
  ({
641
641
  loading: e,
642
642
  reason: t
643
643
  }) => {
644
- if (T) {
645
- y(!1);
644
+ if (R) {
645
+ g(!1);
646
646
  return;
647
647
  }
648
- if (!S || P) {
649
- y(!1);
648
+ if (!b || M) {
649
+ g(!1);
650
650
  return;
651
651
  }
652
- e && t && Ce(t), y(e);
652
+ e && t && Ce(t), g(Vn(t, e));
653
653
  },
654
654
  [
655
- S,
656
- P,
657
- T
655
+ b,
656
+ M,
657
+ R
658
658
  ]
659
659
  );
660
660
  s(() => {
661
- T && y(!1);
662
- }, [T]);
661
+ R && g(!1);
662
+ }, [R]);
663
663
  const ln = r(
664
664
  (e) => {
665
665
  const t = h[e]?.audioKey;
666
666
  if (!t || !v || t !== v)
667
667
  return;
668
- const l = C.findIndex(
668
+ const l = P.findIndex(
669
669
  (a) => a === t
670
670
  );
671
671
  if (l < 0) {
672
672
  U(null);
673
673
  return;
674
674
  }
675
- const f = l + 1, i = C[f];
675
+ const f = l + 1, i = P[f];
676
676
  if (i) {
677
677
  U(i);
678
678
  return;
679
679
  }
680
- if (U(null), nt(!0), y(!1), A) {
681
- const a = d + 1, E = N[a];
682
- ht && E?.type === "interaction" && (q.current = a), R();
680
+ if (U(null), nt(!0), g(!1), x) {
681
+ const a = d + 1, T = N[a];
682
+ ht && T?.type === "interaction" && (q.current = a), C();
683
683
  }
684
684
  },
685
685
  [
686
686
  h,
687
- A,
687
+ x,
688
688
  d,
689
689
  v,
690
+ P,
690
691
  C,
691
- R,
692
692
  ht,
693
693
  N
694
694
  ]
695
695
  ), cn = r(() => {
696
- o && ge((e) => !e);
696
+ o && ye((e) => !e);
697
697
  }, [o]), xt = r(
698
698
  (e) => {
699
- e.stopPropagation(), M && b(!0);
699
+ e.stopPropagation(), F && A(!0);
700
700
  },
701
- [et, b]
701
+ [et, A]
702
702
  ), an = r(
703
703
  (e) => {
704
704
  Ge?.(e);
705
705
  },
706
706
  [Ge]
707
707
  ), un = r(() => {
708
- se(!0), b(!0);
709
- }, [b]), xe = c(
708
+ se(!0), A(!0);
709
+ }, [A]), xe = c(
710
710
  () => B.map(
711
711
  (e, t) => `${e.sequence_number ?? `${e.type}-${t}`}:${String(e.is_new ?? "")}`
712
712
  ),
713
713
  [B]
714
714
  );
715
715
  return s(() => {
716
- const e = Ye.current, f = (e.length > 0 && e.length < xe.length && e.every((a, E) => a === xe[E]) ? B.slice(e.length) : []).some(
716
+ const e = Ye.current, f = (e.length > 0 && e.length < xe.length && e.every((a, T) => a === xe[T]) ? B.slice(e.length) : []).some(
717
717
  (a) => a.is_new === !1
718
718
  );
719
719
  if (Ye.current = xe, !f)
720
720
  return;
721
721
  const i = window.requestAnimationFrame(() => {
722
- const a = Re.current, E = We.current;
723
- if (!a || !E)
722
+ const a = Re.current, T = We.current;
723
+ if (!a || !T)
724
724
  return;
725
- const dn = a.getBoundingClientRect(), fn = E.getBoundingClientRect(), mn = a.scrollTop + (fn.top - dn.top);
725
+ const dn = a.getBoundingClientRect(), fn = T.getBoundingClientRect(), mn = a.scrollTop + (fn.top - dn.top);
726
726
  a.scrollTo({
727
727
  top: Math.max(mn, 0),
728
728
  behavior: "smooth"
@@ -777,7 +777,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
777
777
  /* @__PURE__ */ n.jsx(
778
778
  "button",
779
779
  {
780
- "aria-label": I?.backAriaLabel ?? "Back",
780
+ "aria-label": _?.backAriaLabel ?? "Back",
781
781
  className: "slide-landscape-header__back",
782
782
  onClick: Ht,
783
783
  type: "button",
@@ -790,7 +790,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
790
790
  )
791
791
  }
792
792
  ),
793
- I?.content ? /* @__PURE__ */ n.jsx("div", { className: "min-w-0 flex-1 overflow-hidden", children: I.content }) : null
793
+ _?.content ? /* @__PURE__ */ n.jsx("div", { className: "min-w-0 flex-1 overflow-hidden", children: _.content }) : null
794
794
  ] }) : null,
795
795
  /* @__PURE__ */ n.jsx(
796
796
  "div",
@@ -834,9 +834,9 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
834
834
  wn,
835
835
  {
836
836
  extraBottomOffset: jt,
837
- hasPlayerGap: M,
837
+ hasPlayerGap: F,
838
838
  isEnabled: rt && Nt,
839
- isPlayerHidden: _ && !M,
839
+ isPlayerHidden: E && !F,
840
840
  playbackTimeStore: z,
841
841
  subtitleCues: Yt
842
842
  }
@@ -847,7 +847,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
847
847
  ref: $e,
848
848
  className: J(
849
849
  "slide-interaction-overlay",
850
- M && _ ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
850
+ F && E ? "slide-interaction-overlay--with-player" : "slide-interaction-overlay--standalone"
851
851
  ),
852
852
  onClick: xt,
853
853
  onPointerDown: xt,
@@ -856,8 +856,8 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
856
856
  Et,
857
857
  {
858
858
  content: String(o?.content ?? ""),
859
- defaultButtonText: yt.buttonText ?? "",
860
- defaultInputText: yt.inputText ?? "",
859
+ defaultButtonText: gt.buttonText ?? "",
860
+ defaultInputText: gt.inputText ?? "",
861
861
  defaultSelectedValues: Qt,
862
862
  confirmButtonText: D?.confirmButtonText,
863
863
  copyButtonText: D?.copyButtonText,
@@ -869,7 +869,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
869
869
  )
870
870
  }
871
871
  ) : null,
872
- _ ? /* @__PURE__ */ n.jsx(
872
+ E ? /* @__PURE__ */ n.jsx(
873
873
  xn,
874
874
  {
875
875
  audioList: h,
@@ -877,14 +877,14 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
877
877
  "absolute left-1/2 z-[2] -translate-x-1/2",
878
878
  ct ? "bottom-3" : "-bottom-3",
879
879
  Q,
880
- !M && "pointer-events-none opacity-0"
880
+ !F && "pointer-events-none opacity-0"
881
881
  ),
882
- currentAudioIndex: g,
882
+ currentAudioIndex: y,
883
883
  defaultPlaying: !0,
884
884
  isPlaybackPaused: L,
885
885
  isAutoAdvanceEnabled: ie,
886
886
  hasInteraction: !!o,
887
- isInteractionOpen: ye,
887
+ isInteractionOpen: ge,
888
888
  isSubtitleEnabled: rt,
889
889
  onAutoAdvanceToggle: tt,
890
890
  onLoadingChange: sn,
@@ -895,7 +895,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
895
895
  onSubtitleToggle: () => {
896
896
  Ot((e) => !e);
897
897
  },
898
- nextDisabled: !A,
898
+ nextDisabled: !x,
899
899
  onEnded: ln,
900
900
  onFullscreen: nn,
901
901
  isFullscreen: ot,
@@ -906,7 +906,7 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
906
906
  onNext: on,
907
907
  onPrev: rn,
908
908
  prevDisabled: !Mt,
909
- showControls: M,
909
+ showControls: F,
910
910
  texts: Tt,
911
911
  customActionContext: je,
912
912
  customActions: V,
@@ -921,6 +921,6 @@ const Vn = (x, k) => x.length === k.length && x.every((w, Q) => {
921
921
  );
922
922
  };
923
923
  export {
924
- fr as default
924
+ mr as default
925
925
  };
926
926
  //# sourceMappingURL=Slide.es.js.map