@wyxos/vibe 3.1.15 → 3.1.17

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.
package/lib/index.js CHANGED
@@ -140,13 +140,13 @@ var te = (e) => {
140
140
  d: "M12 17h.01",
141
141
  key: "p32p05"
142
142
  }]
143
- ]), X = q("volume-1", [["path", {
143
+ ]), ue = q("volume-1", [["path", {
144
144
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
145
145
  key: "uqj9uw"
146
146
  }], ["path", {
147
147
  d: "M16 9a5 5 0 0 1 0 6",
148
148
  key: "1q6k2b"
149
- }]]), ue = q("volume-2", [
149
+ }]]), X = q("volume-2", [
150
150
  ["path", {
151
151
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
152
152
  key: "uqj9uw"
@@ -222,13 +222,13 @@ function he(e) {
222
222
  function ge(e) {
223
223
  return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
224
224
  }
225
- function _e(e) {
225
+ function Q(e) {
226
226
  return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
227
227
  }
228
- function ve(e) {
228
+ function _e(e) {
229
229
  return e ?? "__vibe_initial_cursor__";
230
230
  }
231
- function Q(e, t, n) {
231
+ function ve(e, t, n) {
232
232
  return Math.min(Math.max(e, t), n);
233
233
  }
234
234
  //#endregion
@@ -398,6 +398,7 @@ function Pe(e) {
398
398
  cursor: e.cursor,
399
399
  items: t.items,
400
400
  nextCursor: e.nextCursor,
401
+ nextCursorExhausted: e.nextCursorExhausted ?? !1,
401
402
  previousCursor: e.previousCursor
402
403
  },
403
404
  nextSequence: t.nextSequence
@@ -410,6 +411,7 @@ function Fe(e) {
410
411
  cursor: e.cursor,
411
412
  items: t.items,
412
413
  nextCursor: e.nextCursor,
414
+ nextCursorExhausted: e.nextCursorExhausted ?? !1,
413
415
  previousCursor: e.previousCursor
414
416
  },
415
417
  nextSequence: t.nextSequence
@@ -432,39 +434,91 @@ function Le(e) {
432
434
  let t = Pe({
433
435
  cursor: e.initialState.cursor,
434
436
  nextCursor: e.initialState.nextCursor ?? null,
437
+ nextCursorExhausted: !1,
435
438
  nextItems: e.initialState.items,
436
439
  previousCursor: e.initialState.previousCursor ?? null,
437
440
  previousItems: [],
438
441
  sequence: e.sequence
439
442
  }), n = Te(t.bucket.items, e.removedIds);
440
443
  return {
441
- activeIndex: Q(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
444
+ activeIndex: ve(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
442
445
  buckets: [t.bucket],
443
446
  nextSequence: t.nextSequence
444
447
  };
445
448
  }
446
449
  function Re(e, t) {
447
- let n = e[Q(t, 0, Math.max(0, e.length - 1))];
450
+ let n = e[ve(t, 0, Math.max(0, e.length - 1))];
448
451
  return n ? $(n) : null;
449
452
  }
450
453
  function ze(e, t, n = null) {
451
454
  if (!e.length) return 0;
452
455
  let r = n ? e.findIndex((e) => $(e) === n) : -1;
453
- return r >= 0 ? r : Q(t, 0, e.length - 1);
456
+ return r >= 0 ? r : ve(t, 0, e.length - 1);
454
457
  }
455
458
  function Be(e, t, n) {
456
459
  return e ? De(e, t) < n : !1;
457
460
  }
458
461
  //#endregion
462
+ //#region src/components/viewer-core/autoResolveCursors.ts
463
+ function Ve(e, t) {
464
+ return e.find((e) => De(e, t) > 0) ?? e[0] ?? null;
465
+ }
466
+ function He(e, t) {
467
+ for (let n = e.length - 1; n >= 0; --n) {
468
+ let r = e[n];
469
+ if (De(r, t) > 0) return r;
470
+ }
471
+ return e[e.length - 1] ?? null;
472
+ }
473
+ function Ue(e) {
474
+ return !e?.nextCursor || !e.nextCursorExhausted ? null : e.nextCursor;
475
+ }
476
+ function We(e, t, n, r) {
477
+ return t === void 0 || n === null ? e : e.map((e) => e.cursor !== t || e.nextCursor !== n ? e : {
478
+ ...e,
479
+ nextCursorExhausted: r
480
+ });
481
+ }
482
+ function Ge(e, t, n) {
483
+ return n || e !== "forward" || t === null ? {
484
+ cursor: n,
485
+ exhausted: !1
486
+ } : {
487
+ cursor: t,
488
+ exhausted: !0
489
+ };
490
+ }
491
+ function Ke(e, t) {
492
+ if (t) return {
493
+ cursor: t,
494
+ exhausted: !1
495
+ };
496
+ let n = e.nextCursor ?? e.cursor;
497
+ return {
498
+ cursor: n,
499
+ exhausted: !!n
500
+ };
501
+ }
502
+ function qe(e, t) {
503
+ let n = e.findIndex((e) => De(e, t) > 0);
504
+ if (n < 0) return e;
505
+ let r = n;
506
+ for (let i = e.length - 1; i >= n; --i) if (De(e[i], t) > 0) {
507
+ r = i;
508
+ break;
509
+ }
510
+ return e.slice(n, r + 1);
511
+ }
512
+ //#endregion
459
513
  //#region src/components/viewer-core/fillDelay.ts
460
- var Ve = 2e3, He = 1e3, Ue = 100;
461
- function We(e, t = Ve, n = He) {
514
+ var Je = 2e3, Ye = 1e3, Xe = 100;
515
+ function Ze(e, t = Je, n = Ye) {
462
516
  return t + Math.max(0, e - 1) * n;
463
517
  }
464
- function Ge(e, t) {
518
+ function Qe(e, t) {
465
519
  return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
466
520
  }
467
- function Ke() {
521
+ function $e() {
468
522
  let e = D(null), t = null, n = null, r = null;
469
523
  function i(i = !1) {
470
524
  if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
@@ -482,7 +536,7 @@ function Ke() {
482
536
  let t = Math.max(0, a - (Date.now() - s));
483
537
  e.value = t, t <= 0 && l();
484
538
  };
485
- t = setInterval(u, Ue), n = setTimeout(l, a), u();
539
+ t = setInterval(u, Xe), n = setTimeout(l, a), u();
486
540
  }));
487
541
  }
488
542
  return {
@@ -493,8 +547,8 @@ function Ke() {
493
547
  }
494
548
  //#endregion
495
549
  //#region src/components/viewer-core/useAutoResolveSource.ts
496
- function qe(e) {
497
- let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d = Ke(), f = d.remainingMs, p = D(null), m = D(!1), h = D(!0), g = D(!1), _ = /* @__PURE__ */ new Set(), v = null, y = null, b = 0, C = 0, w = i(() => Ge(e.fillDelayMs, Ve)), T = i(() => Ge(e.fillDelayStepMs, He)), E = i(() => typeof e.resolve == "function"), O = i(() => _e(e.pageSize)), k = i(() => we(n.value)), A = i(() => Te(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => ge(c.value) || m.value), N = i(() => Je(n.value, e.removedIds.value)), P = i(() => Ye(n.value, e.removedIds.value)), F = i(() => P.value?.nextCursor ?? null), I = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!F.value), z = i(() => !!I.value), B = i(() => E.value && n.value.length > 0), ee = i(() => Te(we(a.value), e.removedIds.value)), te = i(() => Oe(n.value, e.removedIds.value, j.value)), V = i(() => !A.value.length && !M.value && !!s.value);
550
+ function et(e) {
551
+ let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d = $e(), f = d.remainingMs, p = D(null), m = D(!1), h = D(!0), g = D(!1), _ = /* @__PURE__ */ new Set(), v = null, y = null, b = 0, C = 0, w = i(() => Qe(e.fillDelayMs, Je)), T = i(() => Qe(e.fillDelayStepMs, Ye)), E = i(() => typeof e.resolve == "function"), O = i(() => Q(e.pageSize)), k = i(() => we(n.value)), A = i(() => Te(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => ge(c.value) || m.value), N = i(() => Ve(n.value, e.removedIds.value)), P = i(() => He(n.value, e.removedIds.value)), F = i(() => P.value?.nextCursor ?? null), I = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!F.value && P.value?.nextCursorExhausted !== !0), z = i(() => !!I.value), B = i(() => E.value && n.value.length > 0), ee = i(() => Te(we(a.value), e.removedIds.value)), te = i(() => Oe(n.value, e.removedIds.value, j.value)), V = i(() => !A.value.length && !M.value && !!s.value);
498
552
  L(() => A.value.length, (e) => {
499
553
  if (e === 0) {
500
554
  r.value = 0;
@@ -503,6 +557,8 @@ function qe(e) {
503
557
  o.value &&= (ye(), !1), r.value > e - 1 && (r.value = e - 1);
504
558
  }), L(() => r.value, () => {
505
559
  h.value && ce();
560
+ }), L(() => F.value, (e) => {
561
+ e && !A.value.length && c.value === "idle" && ce();
506
562
  }), S(() => {
507
563
  pe() || e.resolve && H();
508
564
  }), x(() => {
@@ -519,24 +575,39 @@ function qe(e) {
519
575
  t && (n.value = t.buckets, r.value = 0, Z());
520
576
  }
521
577
  async function U() {
522
- if (!(g.value || M.value)) {
523
- if (he("trailing") || !R.value) {
524
- if (!B.value) return;
525
- let e = await ue("trailing");
526
- e?.followCursor && he("trailing") && await le(e.followCursor);
578
+ if (g.value || M.value) return;
579
+ let e = !A.value.length, t = P.value, n = {
580
+ commitImmediately: e,
581
+ originCursor: t?.cursor ?? null
582
+ }, r = Ue(t);
583
+ if (he("trailing")) {
584
+ if (!B.value) return;
585
+ let e = await X("trailing");
586
+ e?.followCursor && he("trailing") && await le(e.followCursor, n);
587
+ return;
588
+ }
589
+ if (r) {
590
+ if (t?.cursor === r) {
591
+ await X("trailing");
527
592
  return;
528
593
  }
529
- await le(F.value);
594
+ await le(r, n);
595
+ return;
596
+ }
597
+ if (!R.value) {
598
+ B.value && await X("trailing");
599
+ return;
530
600
  }
601
+ await le(F.value, n);
531
602
  }
532
603
  async function W() {
533
604
  if (!(g.value || !z.value || M.value)) {
534
605
  if (he("leading")) {
535
- let e = await ue("leading");
536
- e?.itemsLoaded === 0 && e.followCursor && await X(e.followCursor);
606
+ let e = await X("leading");
607
+ e?.itemsLoaded === 0 && e.followCursor && await ue(e.followCursor);
537
608
  return;
538
609
  }
539
- await X(I.value);
610
+ await ue(I.value);
540
611
  }
541
612
  }
542
613
  async function ne() {
@@ -559,7 +630,7 @@ function qe(e) {
559
630
  function q(t) {
560
631
  let n = A.value;
561
632
  if (!n.length) return;
562
- let i = Q(t, 0, n.length - 1);
633
+ let i = ve(t, 0, n.length - 1);
563
634
  i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
564
635
  }
565
636
  function re(e) {
@@ -596,36 +667,37 @@ function qe(e) {
596
667
  r.value = ze(A.value, j.value, e);
597
668
  }
598
669
  function se() {
599
- a.value.length > 0 && !ee.value.length && K();
670
+ a.value.length > 0 && (!ee.value.length || !A.value.length) && K();
600
671
  }
601
672
  async function ce() {
602
673
  if (!(!h.value || me())) {
603
674
  if (!A.value.length) {
604
- R.value && await U();
675
+ (R.value || B.value) && await U();
605
676
  return;
606
677
  }
607
678
  z.value && r.value < 3 && await W(), R.value && r.value >= A.value.length - 3 && await U();
608
679
  }
609
680
  }
610
- async function le(e) {
681
+ async function le(e, t = {}) {
611
682
  y = async () => {
612
- await le(e);
683
+ await le(e, t);
613
684
  };
614
- let t = await de({
685
+ let r = await de({
615
686
  continueUntilFilled: !0,
616
687
  cursor: e,
617
688
  direction: "forward",
618
689
  phase: "loading"
619
690
  });
620
- if (t) {
621
- if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], m.value = !1, Z();
622
- if (a.value = t.buckets, !ee.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Z();
691
+ if (r) {
692
+ if (!r.visibleCount) return n.value = We(n.value, t.originCursor, e, !0), a.value = [], m.value = !1, Z();
693
+ if (r.canceled) return n.value = [...n.value, ...r.buckets], a.value = [], m.value = !1, Z();
694
+ if (a.value = r.buckets, t.commitImmediately || !ee.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, Z();
623
695
  m.value = !0;
624
696
  }
625
697
  }
626
- async function X(e) {
698
+ async function ue(e) {
627
699
  y = async () => {
628
- await X(e);
700
+ await ue(e);
629
701
  };
630
702
  let t = await de({
631
703
  continueUntilFilled: !0,
@@ -637,13 +709,13 @@ function qe(e) {
637
709
  let r = ae();
638
710
  n.value = [...t.buckets, ...n.value], oe(r), Z();
639
711
  }
640
- async function ue(t) {
712
+ async function X(t) {
641
713
  if (y = async () => {
642
- await ue(t);
714
+ await X(t);
643
715
  }, !e.resolve) return null;
644
716
  let r = t === "leading" ? N.value : P.value;
645
717
  if (!r) return null;
646
- let i = ve(r.cursor);
718
+ let i = _e(r.cursor);
647
719
  if (_.has(i)) return null;
648
720
  _.add(i), s.value = null, c.value = "refreshing", l.value = null, u.value = null, p.value = null;
649
721
  let a = ++b, o = typeof AbortController > "u" ? null : new AbortController();
@@ -655,18 +727,19 @@ function qe(e) {
655
727
  signal: o?.signal
656
728
  });
657
729
  if (a !== b) return Z(), null;
658
- let s = Fe({
730
+ let s = Ke(r, i.nextPage), c = Fe({
659
731
  cursor: r.cursor,
660
732
  edge: t,
661
- nextCursor: i.nextPage,
733
+ nextCursor: s.cursor,
734
+ nextCursorExhausted: s.exhausted,
662
735
  nextItems: i.items,
663
736
  previousCursor: i.previousPage ?? null,
664
737
  previousItems: r.items,
665
738
  sequence: C
666
739
  });
667
- C = s.nextSequence;
668
- let c = ae();
669
- return n.value = ke(n.value, r.cursor, s.bucket), oe(c), Z(), {
740
+ C = c.nextSequence;
741
+ let l = ae();
742
+ return n.value = ke(n.value, r.cursor, c.bucket), oe(l), Z(), {
670
743
  followCursor: t === "leading" ? i.previousPage ?? null : i.nextPage,
671
744
  itemsLoaded: i.items.length
672
745
  };
@@ -682,7 +755,7 @@ function qe(e) {
682
755
  for (s.value = null, c.value = t.phase, l.value = null, u.value = null, p.value = null;;) {
683
756
  if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
684
757
  if (i.length > 0 && g.value) return Ie(i, t.direction, e.removedIds.value, !1);
685
- let f = ve(a);
758
+ let f = _e(a);
686
759
  if (r.has(f) || _.has(f)) break;
687
760
  r.add(f), _.add(f);
688
761
  let m = typeof AbortController > "u" ? null : new AbortController();
@@ -694,25 +767,26 @@ function qe(e) {
694
767
  signal: m?.signal
695
768
  });
696
769
  if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
697
- let s = fe({
770
+ let s = Ge(t.direction, a, r.nextPage), f = fe({
698
771
  cursor: a,
699
- nextCursor: r.nextPage,
772
+ nextCursor: s.cursor,
773
+ nextCursorExhausted: s.exhausted,
700
774
  nextItems: r.items,
701
775
  previousCursor: r.previousPage ?? null,
702
776
  previousItems: []
703
777
  });
704
- i.push(s);
705
- let f = i.reduce((t, n) => t + De(n, e.removedIds.value), 0), h = t.direction === "forward" ? s.nextCursor : s.previousCursor;
706
- if (!t.continueUntilFilled || f >= O.value || !h) return u.value = null, {
778
+ i.push(f);
779
+ let h = i.reduce((t, n) => t + De(n, e.removedIds.value), 0), _ = t.direction === "forward" ? f.nextCursorExhausted ? null : f.nextCursor : f.previousCursor;
780
+ if (!t.continueUntilFilled || h >= O.value || !_) return u.value = null, {
707
781
  canceled: !1,
708
782
  buckets: t.direction === "backward" ? [...i].reverse() : i,
709
- visibleCount: f
783
+ visibleCount: h
710
784
  };
711
785
  if (g.value) return Ie(i, t.direction, e.removedIds.value, !1);
712
- c.value = "filling", l.value = f, u.value = h, p.value = O.value, o += 1;
713
- let _ = We(o, w.value, T.value);
714
- if (await d.wait(_), n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
715
- a = h;
786
+ c.value = "filling", l.value = h, u.value = _, p.value = O.value, o += 1;
787
+ let v = Ze(o, w.value, T.value);
788
+ if (await d.wait(v), n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
789
+ a = _;
716
790
  } catch (r) {
717
791
  return Ne(r) || n !== b ? Ie(i, t.direction, e.removedIds.value, !0) : (s.value = r instanceof Error ? r.message : "The viewer could not load items.", c.value = "failed", l.value = null, u.value = null, p.value = null, null);
718
792
  } finally {
@@ -725,6 +799,7 @@ function qe(e) {
725
799
  let t = Pe({
726
800
  cursor: e.cursor,
727
801
  nextCursor: e.nextCursor,
802
+ nextCursorExhausted: e.nextCursorExhausted ?? !1,
728
803
  nextItems: e.nextItems,
729
804
  previousCursor: e.previousCursor,
730
805
  previousItems: e.previousItems,
@@ -751,14 +826,7 @@ function qe(e) {
751
826
  return Be(t === "leading" ? N.value : P.value, e.removedIds.value, O.value);
752
827
  }
753
828
  function ye() {
754
- let t = n.value.findIndex((t) => De(t, e.removedIds.value) > 0);
755
- if (t < 0) return;
756
- let r = t;
757
- for (let i = n.value.length - 1; i >= t; --i) if (De(n.value[i], e.removedIds.value) > 0) {
758
- r = i;
759
- break;
760
- }
761
- n.value = n.value.slice(t, r + 1);
829
+ n.value = qe(n.value, e.removedIds.value);
762
830
  }
763
831
  return {
764
832
  activeIndex: j,
@@ -796,20 +864,10 @@ function qe(e) {
796
864
  maybeCommitPendingAppendWhenFilteredOut: se
797
865
  };
798
866
  }
799
- function Je(e, t) {
800
- return e.find((e) => De(e, t) > 0) ?? e[0] ?? null;
801
- }
802
- function Ye(e, t) {
803
- for (let n = e.length - 1; n >= 0; --n) {
804
- let r = e[n];
805
- if (De(r, t) > 0) return r;
806
- }
807
- return e[e.length - 1] ?? null;
808
- }
809
867
  //#endregion
810
868
  //#region src/components/viewer-core/useDataSource.ts
811
- function Xe(e, t) {
812
- let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = Se(), l = qe({
869
+ function tt(e, t) {
870
+ let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = Se(), l = et({
813
871
  emit: t,
814
872
  fillDelayMs: e.fillDelayMs,
815
873
  fillDelayStepMs: e.fillDelayStepMs,
@@ -825,7 +883,7 @@ function Xe(e, t) {
825
883
  }
826
884
  function y(e) {
827
885
  let t = l.getActiveOccurrenceKey(), n = u.value[d.value] ?? null, r = Array.isArray(e) ? e : [e], i = !!(n && r.includes(n.id) && l.isAutoPrefetchEnabled.value && d.value >= u.value.length - 3), o = !!(n && r.includes(n.id) && l.hasNextPage.value && d.value === u.value.length - 1), s = a(e);
828
- return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }), i && l.maybePrefetchAround(), s) : s;
886
+ return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }), (i || !u.value.length) && l.maybePrefetchAround(), s) : s;
829
887
  }
830
888
  function b(e) {
831
889
  let t = l.getActiveOccurrenceKey(), n = s(e);
@@ -904,9 +962,9 @@ function Xe(e, t) {
904
962
  }
905
963
  //#endregion
906
964
  //#region src/components/viewer-core/useController.ts
907
- var Ze = 1024;
908
- function Qe(e, t) {
909
- let n = Xe(e, t), r = T({
965
+ var nt = 1024;
966
+ function rt(e, t) {
967
+ let n = tt(e, t), r = T({
910
968
  nextBoundaryLoadProgress: 0,
911
969
  previousBoundaryLoadProgress: 0
912
970
  }), a = D(0), o = D("list"), s = T({
@@ -930,7 +988,7 @@ function Qe(e, t) {
930
988
  removedCount: 0,
931
989
  removedIds: [],
932
990
  surfaceMode: "list"
933
- }), c = i(() => a.value >= Ze), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
991
+ }), c = i(() => a.value >= nt), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
934
992
  L(c, (e) => {
935
993
  e && h();
936
994
  }), L(() => e.surfaceMode, () => {
@@ -969,7 +1027,7 @@ function Qe(e, t) {
969
1027
  !c.value || !e.surfaceMode || e.surfaceMode === o.value || (o.value = e.surfaceMode);
970
1028
  }
971
1029
  function g(e) {
972
- r.nextBoundaryLoadProgress = $e(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = $e(e.previousBoundaryLoadProgress);
1030
+ r.nextBoundaryLoadProgress = it(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = it(e.previousBoundaryLoadProgress);
973
1031
  }
974
1032
  return {
975
1033
  ...n,
@@ -988,26 +1046,26 @@ function Qe(e, t) {
988
1046
  unlockPageLoading: n.unlockPageLoading
989
1047
  };
990
1048
  }
991
- function $e(e) {
1049
+ function it(e) {
992
1050
  return Math.min(Math.max(e, 0), 1);
993
1051
  }
994
1052
  //#endregion
995
1053
  //#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
996
- var et = {
1054
+ var at = {
997
1055
  "data-testid": "vibe-media-bar",
998
1056
  class: "absolute inset-x-0 bottom-0 z-[5] bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.42)_24%,rgba(0,0,0,0.78))] px-[clamp(1rem,2.6vw,2.25rem)] pt-4 pb-[1.15rem]"
999
- }, tt = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, nt = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, rt = { class: "relative h-4 w-full" }, it = [
1057
+ }, ot = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, st = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, ct = { class: "relative h-4 w-full" }, lt = [
1000
1058
  "max",
1001
1059
  "value",
1002
1060
  "disabled"
1003
- ], at = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, ot = ["data-layout"], st = {
1061
+ ], ut = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, dt = ["data-layout"], ft = {
1004
1062
  key: 0,
1005
1063
  "data-testid": "vibe-media-volume-popover",
1006
1064
  class: "absolute bottom-[calc(100%+0.8rem)] right-0 grid justify-items-center gap-3 border border-white/12 bg-black/82 px-3 py-4 shadow-[0_20px_50px_-20px_rgba(0,0,0,0.85)] backdrop-blur-[18px]"
1007
- }, ct = { class: "relative flex h-28 w-4 items-center justify-center" }, lt = ["value"], ut = { class: "flex items-center gap-3" }, dt = ["aria-label"], ft = {
1065
+ }, pt = { class: "relative flex h-28 w-4 items-center justify-center" }, mt = ["value"], ht = { class: "flex items-center gap-3" }, gt = ["aria-label"], _t = {
1008
1066
  key: 0,
1009
1067
  class: "relative h-4 w-24"
1010
- }, pt = ["value"], mt = /* @__PURE__ */ d({
1068
+ }, vt = ["value"], yt = /* @__PURE__ */ d({
1011
1069
  __name: "FullscreenMediaBar",
1012
1070
  props: {
1013
1071
  currentTime: {},
@@ -1025,7 +1083,7 @@ var et = {
1025
1083
  "volume-toggle"
1026
1084
  ],
1027
1085
  setup(e, { emit: t }) {
1028
- let n = e, r = t, l = D(null), u = D(!1), d = i(() => n.volumeControlLayout === "vertical"), f = i(() => C(n.volume, 0, 1)), p = i(() => Math.round(f.value * 100)), m = i(() => n.muted || f.value <= 0 ? de : f.value < .5 ? X : ue), h = i(() => n.muted || f.value <= 0 ? "Unmute active media" : "Mute active media"), g = i(() => d.value && !u.value ? "Show volume controls" : h.value), _ = i(() => n.volumeControlLayout === "vertical" ? { height: `${p.value}%` } : { width: `${p.value}%` });
1086
+ let n = e, r = t, l = D(null), u = D(!1), d = i(() => n.volumeControlLayout === "vertical"), f = i(() => C(n.volume, 0, 1)), p = i(() => Math.round(f.value * 100)), m = i(() => n.muted || f.value <= 0 ? de : f.value < .5 ? ue : X), h = i(() => n.muted || f.value <= 0 ? "Unmute active media" : "Mute active media"), g = i(() => d.value && !u.value ? "Show volume controls" : h.value), _ = i(() => n.volumeControlLayout === "vertical" ? { height: `${p.value}%` } : { width: `${p.value}%` });
1029
1087
  L(d, (e) => {
1030
1088
  e || (u.value = !1);
1031
1089
  }), S(() => {
@@ -1050,9 +1108,9 @@ var et = {
1050
1108
  function C(e, t, n) {
1051
1109
  return Math.min(Math.max(e, t), n);
1052
1110
  }
1053
- return (e, t) => (w(), s("div", et, [c("div", tt, [
1054
- c("span", nt, j(n.currentTimeLabel), 1),
1055
- c("div", rt, [
1111
+ return (e, t) => (w(), s("div", at, [c("div", ot, [
1112
+ c("span", st, j(n.currentTimeLabel), 1),
1113
+ c("div", ct, [
1056
1114
  t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
1057
1115
  c("div", {
1058
1116
  class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
@@ -1069,16 +1127,16 @@ var et = {
1069
1127
  disabled: n.duration <= 0,
1070
1128
  class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
1071
1129
  onInput: t[0] ||= (e) => r("seek-input", e)
1072
- }, null, 40, it)
1130
+ }, null, 40, lt)
1073
1131
  ]),
1074
- c("span", at, j(n.durationLabel), 1),
1132
+ c("span", ut, j(n.durationLabel), 1),
1075
1133
  c("div", {
1076
1134
  ref_key: "rootRef",
1077
1135
  ref: l,
1078
1136
  "data-testid": "vibe-media-volume",
1079
1137
  "data-layout": n.volumeControlLayout,
1080
1138
  class: "relative flex items-center justify-end"
1081
- }, [d.value && u.value ? (w(), s("div", st, [c("div", ct, [
1139
+ }, [d.value && u.value ? (w(), s("div", ft, [c("div", pt, [
1082
1140
  t[4] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
1083
1141
  c("div", {
1084
1142
  class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
@@ -1095,8 +1153,8 @@ var et = {
1095
1153
  value: f.value,
1096
1154
  class: "vibe-media-slider absolute left-1/2 top-1/2 h-4 w-28 -translate-x-1/2 -translate-y-1/2 -rotate-90 bg-transparent",
1097
1155
  onInput: t[1] ||= (e) => r("volume-input", e)
1098
- }, null, 40, lt)
1099
- ])])) : o("", !0), c("div", ut, [c("button", {
1156
+ }, null, 40, mt)
1157
+ ])])) : o("", !0), c("div", ht, [c("button", {
1100
1158
  type: "button",
1101
1159
  "data-testid": "vibe-media-volume-button",
1102
1160
  "aria-label": g.value,
@@ -1105,7 +1163,7 @@ var et = {
1105
1163
  }, [(w(), a(A(m.value), {
1106
1164
  class: "h-4 w-4 stroke-[1.9]",
1107
1165
  "aria-hidden": "true"
1108
- }))], 8, dt), n.volumeControlLayout === "horizontal" ? (w(), s("div", ft, [
1166
+ }))], 8, gt), n.volumeControlLayout === "horizontal" ? (w(), s("div", _t, [
1109
1167
  t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
1110
1168
  c("div", {
1111
1169
  class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
@@ -1122,24 +1180,24 @@ var et = {
1122
1180
  value: f.value,
1123
1181
  class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
1124
1182
  onInput: t[2] ||= (e) => r("volume-input", e)
1125
- }, null, 40, pt)
1126
- ])) : o("", !0)])], 8, ot)
1183
+ }, null, 40, vt)
1184
+ ])) : o("", !0)])], 8, dt)
1127
1185
  ])]));
1128
1186
  }
1129
- }), ht = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, gt = { class: "grid gap-4" }, _t = { class: "flex min-h-11 items-center justify-between gap-4" }, vt = { class: "min-w-0 flex flex-1 items-center gap-3" }, yt = {
1187
+ }), bt = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, xt = { class: "grid gap-4" }, St = { class: "flex min-h-11 items-center justify-between gap-4" }, Ct = { class: "min-w-0 flex flex-1 items-center gap-3" }, wt = {
1130
1188
  key: 1,
1131
1189
  "data-testid": "vibe-title",
1132
1190
  class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
1133
- }, bt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, xt = {
1191
+ }, Tt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, Et = {
1134
1192
  "data-testid": "vibe-pagination",
1135
1193
  class: "inline-flex shrink-0 items-center gap-2 whitespace-nowrap border border-white/14 bg-black/40 px-3 py-2 text-[0.63rem] font-bold uppercase tracking-[0.12em] text-[#f7f1ea]/72 backdrop-blur-[18px] min-[721px]:gap-3 min-[721px]:px-4 min-[721px]:py-3 min-[721px]:text-[0.74rem] min-[721px]:tracking-[0.2em]"
1136
- }, St = { class: "whitespace-nowrap" }, Ct = {
1194
+ }, Dt = { class: "whitespace-nowrap" }, Ot = {
1137
1195
  key: 1,
1138
1196
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
1139
- }, wt = {
1197
+ }, kt = {
1140
1198
  key: 0,
1141
1199
  class: "grid gap-2 max-[720px]:justify-items-start"
1142
- }, Tt = /* @__PURE__ */ d({
1200
+ }, At = /* @__PURE__ */ d({
1143
1201
  __name: "FullscreenHeader",
1144
1202
  props: {
1145
1203
  currentIndex: {},
@@ -1153,7 +1211,7 @@ var et = {
1153
1211
  emits: ["back-to-list"],
1154
1212
  setup(e, { emit: t }) {
1155
1213
  let n = e, r = t;
1156
- return (e, t) => (w(), s("div", ht, [c("div", gt, [c("div", _t, [c("div", vt, [n.showBackToList ? (w(), s("button", {
1214
+ return (e, t) => (w(), s("div", bt, [c("div", xt, [c("div", St, [c("div", Ct, [n.showBackToList ? (w(), s("button", {
1157
1215
  key: 0,
1158
1216
  type: "button",
1159
1217
  "data-testid": "vibe-back-to-list",
@@ -1163,47 +1221,47 @@ var et = {
1163
1221
  }, [u(N(re), {
1164
1222
  class: "h-4 w-4 stroke-[2.2]",
1165
1223
  "aria-hidden": "true"
1166
- })])) : o("", !0), n.title ? (w(), s("h2", yt, j(n.title), 1)) : o("", !0)]), c("div", bt, [c("span", xt, [
1224
+ })])) : o("", !0), n.title ? (w(), s("h2", wt, j(n.title), 1)) : o("", !0)]), c("div", Tt, [c("span", Et, [
1167
1225
  n.loading ? (w(), a(N(oe), {
1168
1226
  key: 0,
1169
1227
  "data-testid": "vibe-pagination-spinner",
1170
1228
  class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
1171
1229
  "aria-hidden": "true"
1172
1230
  })) : o("", !0),
1173
- c("span", St, j(n.currentIndex + 1) + " / " + j(n.total), 1),
1174
- n.paginationDetail ? (w(), s("span", Ct, j(n.paginationDetail), 1)) : o("", !0)
1175
- ]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div", wt, [...t[1] ||= [c("span", { class: "inline-flex items-center border border-amber-300/35 bg-black/40 px-4 py-3 text-[0.74rem] font-bold uppercase tracking-[0.2em] text-amber-200 backdrop-blur-[18px]" }, " End reached ", -1)]])) : o("", !0)]));
1231
+ c("span", Dt, j(n.currentIndex + 1) + " / " + j(n.total), 1),
1232
+ n.paginationDetail ? (w(), s("span", Ot, j(n.paginationDetail), 1)) : o("", !0)
1233
+ ]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div", kt, [...t[1] ||= [c("span", { class: "inline-flex items-center border border-amber-300/35 bg-black/40 px-4 py-3 text-[0.74rem] font-bold uppercase tracking-[0.2em] text-amber-200 backdrop-blur-[18px]" }, " End reached ", -1)]])) : o("", !0)]));
1176
1234
  }
1177
- }), Et = {
1235
+ }), jt = {
1178
1236
  image: ae,
1179
1237
  video: Y,
1180
1238
  audio: J,
1181
1239
  other: ie
1182
- }, Dt = {
1240
+ }, Mt = {
1183
1241
  image: "Image",
1184
1242
  video: "Video",
1185
1243
  audio: "Audio",
1186
1244
  other: "File"
1187
1245
  };
1188
- function Ot(e) {
1189
- return Et[e];
1246
+ function Nt(e) {
1247
+ return jt[e];
1190
1248
  }
1191
- function kt(e) {
1192
- return Dt[e];
1249
+ function Pt(e) {
1250
+ return Mt[e];
1193
1251
  }
1194
1252
  //#endregion
1195
1253
  //#region src/components/viewer-core/useAssetLoadQueue.ts
1196
- var At = {
1254
+ var Ft = {
1197
1255
  maxGlobal: 10,
1198
1256
  maxPerDomain: 4,
1199
1257
  maxVideoPerDomain: 2
1200
1258
  };
1201
- function jt(e = At) {
1259
+ function It(e = Ft) {
1202
1260
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
1203
1261
  function i(e) {
1204
1262
  let i = {
1205
1263
  ...e,
1206
- domain: Pt(e.url),
1264
+ domain: zt(e.url),
1207
1265
  enqueuedAt: r,
1208
1266
  id: `vibe-asset-load-${r += 1}`
1209
1267
  };
@@ -1222,7 +1280,7 @@ function jt(e = At) {
1222
1280
  function a() {
1223
1281
  if (n.size === 0) return;
1224
1282
  let r = [...n.values()].sort((e, t) => {
1225
- let n = Nt(e) - Nt(t);
1283
+ let n = Rt(e) - Rt(t);
1226
1284
  return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
1227
1285
  });
1228
1286
  for (let i of r) {
@@ -1243,8 +1301,8 @@ function jt(e = At) {
1243
1301
  }
1244
1302
  return { request: i };
1245
1303
  }
1246
- var Mt = jt();
1247
- function Nt(e) {
1304
+ var Lt = It();
1305
+ function Rt(e) {
1248
1306
  try {
1249
1307
  let t = e.getPriority();
1250
1308
  return Number.isFinite(t) ? t : Infinity;
@@ -1252,7 +1310,7 @@ function Nt(e) {
1252
1310
  return Infinity;
1253
1311
  }
1254
1312
  }
1255
- function Pt(e) {
1313
+ function zt(e) {
1256
1314
  try {
1257
1315
  return new URL(e).hostname || "local";
1258
1316
  } catch {
@@ -1261,19 +1319,19 @@ function Pt(e) {
1261
1319
  }
1262
1320
  //#endregion
1263
1321
  //#region src/components/viewer-core/useFullscreenPreloadController.ts
1264
- var Ft = [
1322
+ var Bt = [
1265
1323
  0,
1266
1324
  1,
1267
1325
  2,
1268
1326
  3
1269
- ], It = {
1327
+ ], Vt = {
1270
1328
  0: 0,
1271
1329
  1: 1,
1272
1330
  2: 2,
1273
1331
  3: 3
1274
1332
  };
1275
- function Lt(e) {
1276
- let t = D({}), n = jt({
1333
+ function Ht(e) {
1334
+ let t = D({}), n = It({
1277
1335
  maxGlobal: 3,
1278
1336
  maxPerDomain: 3,
1279
1337
  maxVideoPerDomain: 3
@@ -1298,14 +1356,14 @@ function Lt(e) {
1298
1356
  }
1299
1357
  function l(e, t) {
1300
1358
  if (t instanceof HTMLImageElement) {
1301
- i.set(e, t), zt(t) && d(e);
1359
+ i.set(e, t), Wt(t) && d(e);
1302
1360
  return;
1303
1361
  }
1304
1362
  i.delete(e);
1305
1363
  }
1306
1364
  function u(e, t) {
1307
1365
  if (t instanceof HTMLMediaElement) {
1308
- a.set(e, t), Bt(t) && d(e);
1366
+ a.set(e, t), Gt(t) && d(e);
1309
1367
  return;
1310
1368
  }
1311
1369
  a.delete(e);
@@ -1346,7 +1404,7 @@ function Lt(e) {
1346
1404
  assetType: s.item.type === "image" ? "image" : "video",
1347
1405
  getPriority: () => g(o.index),
1348
1406
  onGrant: () => {
1349
- y(s.key, !0), (e.isAssetReady(s.key, s.item) || Rt(s.key, i, a)) && d(s.key);
1407
+ y(s.key, !0), (e.isAssetReady(s.key, s.item) || Ut(s.key, i, a)) && d(s.key);
1350
1408
  },
1351
1409
  url: s.item.url
1352
1410
  })
@@ -1357,14 +1415,14 @@ function Lt(e) {
1357
1415
  }
1358
1416
  function h() {
1359
1417
  let t = e.resolvedActiveIndex.value;
1360
- return Ft.map((e) => _(t + e)).filter((e) => !!e);
1418
+ return Bt.map((e) => _(t + e)).filter((e) => !!e);
1361
1419
  }
1362
1420
  function g(t) {
1363
- return e.active.value ? It[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
1421
+ return e.active.value ? Vt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
1364
1422
  }
1365
1423
  function _(t) {
1366
1424
  let n = e.items.value[t];
1367
- return !n || !Vt(n) ? null : {
1425
+ return !n || !Kt(n) ? null : {
1368
1426
  index: t,
1369
1427
  item: n,
1370
1428
  key: e.getItemKey(n)
@@ -1413,36 +1471,36 @@ function Lt(e) {
1413
1471
  shouldAttachSlideAsset: s
1414
1472
  };
1415
1473
  }
1416
- function Rt(e, t, n) {
1474
+ function Ut(e, t, n) {
1417
1475
  let r = t.get(e);
1418
- if (r) return zt(r);
1476
+ if (r) return Wt(r);
1419
1477
  let i = n.get(e);
1420
- return i ? Bt(i) : !1;
1478
+ return i ? Gt(i) : !1;
1421
1479
  }
1422
- function zt(e) {
1480
+ function Wt(e) {
1423
1481
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1424
1482
  }
1425
- function Bt(e) {
1483
+ function Gt(e) {
1426
1484
  let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
1427
1485
  return e.readyState >= t;
1428
1486
  }
1429
- function Vt(e) {
1487
+ function Kt(e) {
1430
1488
  return e.type === "image" || e.type === "video" || e.type === "audio";
1431
1489
  }
1432
1490
  //#endregion
1433
1491
  //#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
1434
- function Ht(e) {
1435
- let t = Lt({
1492
+ function qt(e) {
1493
+ let t = Ht({
1436
1494
  active: e.active,
1437
1495
  getItemKey: r,
1438
- isAssetReady: p,
1496
+ isAssetReady: m,
1439
1497
  items: e.items,
1440
1498
  onResetAssetState: e.viewer.resetAssetState,
1441
1499
  resolvedActiveIndex: e.resolvedActiveIndex
1442
1500
  });
1443
1501
  function n(e, t) {
1444
1502
  let n = t.title?.trim();
1445
- return n ? `${e} ${n}` : `${e} ${kt(t.type).toLowerCase()}`;
1503
+ return n ? `${e} ${n}` : `${e} ${Pt(t.type).toLowerCase()}`;
1446
1504
  }
1447
1505
  function r(e) {
1448
1506
  return $(e);
@@ -1450,58 +1508,66 @@ function Ht(e) {
1450
1508
  function i(e) {
1451
1509
  return t.shouldAttachSlideAsset(e);
1452
1510
  }
1453
- function a(e) {
1511
+ function a(e, t) {
1512
+ return h(e, t) && i(e);
1513
+ }
1514
+ function o(e) {
1454
1515
  return t.getSlidePreloadState(e);
1455
1516
  }
1456
- function o(t, n) {
1457
- let i = r(n), o = a(t);
1458
- return o === "idle" || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(i) ? !1 : o !== "ready";
1517
+ function s(t, n) {
1518
+ let i = r(n), a = o(t);
1519
+ return a === "idle" || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(i) ? !1 : a !== "ready";
1459
1520
  }
1460
- function s(t) {
1521
+ function c(t) {
1461
1522
  return e.viewer.getAssetErrorKind(r(t));
1462
1523
  }
1463
- function c(t) {
1524
+ function l(t) {
1464
1525
  return e.viewer.getAssetErrorLabel(r(t)) ?? "Load error";
1465
1526
  }
1466
- function l(t, n) {
1467
- return a(t) !== "idle" && t === e.resolvedActiveIndex.value && !!s(n);
1468
- }
1469
1527
  function u(t, n) {
1528
+ return o(t) !== "idle" && t === e.resolvedActiveIndex.value && !!c(n);
1529
+ }
1530
+ function d(t, n) {
1470
1531
  return i(t) ? e.viewer.getImageSource(n) : void 0;
1471
1532
  }
1472
- function d(e) {
1533
+ function f(e) {
1473
1534
  return i(e) ? "metadata" : "none";
1474
1535
  }
1475
- function f(e, t) {
1536
+ function p(e, t) {
1476
1537
  return i(e) ? t.url : void 0;
1477
1538
  }
1478
- function p(t, n) {
1539
+ function m(t, n) {
1479
1540
  return n.type === "image" ? e.viewer.isImageReady(t) : n.type === "video" || n.type === "audio" ? e.viewer.isMediaReady(t) : !1;
1480
1541
  }
1542
+ function h(t, n) {
1543
+ let i = e.items.value[t];
1544
+ return !!i && r(i) === r(n);
1545
+ }
1481
1546
  return {
1482
- getAssetErrorKind: s,
1483
- getAssetErrorLabel: c,
1484
- getFullscreenImageSource: u,
1485
- getFullscreenMediaPreload: d,
1486
- getFullscreenMediaSource: f,
1547
+ getAssetErrorKind: c,
1548
+ getAssetErrorLabel: l,
1549
+ getFullscreenImageSource: d,
1550
+ getFullscreenMediaPreload: f,
1551
+ getFullscreenMediaSource: p,
1487
1552
  getItemKey: r,
1488
1553
  getMediaActionLabel: n,
1489
- getSlidePreloadState: a,
1490
- isAssetErrored: l,
1491
- isAssetLoading: o,
1554
+ getSlidePreloadState: o,
1555
+ isAssetErrored: u,
1556
+ isAssetLoading: s,
1492
1557
  registerImageElement: t.registerImageElement,
1493
1558
  registerMediaElement: t.registerMediaElement,
1494
1559
  settleAssetPreload: t.settleAssetPreload,
1560
+ shouldHandleSlideAssetEvent: a,
1495
1561
  shouldPreloadSlideAsset: i
1496
1562
  };
1497
1563
  }
1498
1564
  //#endregion
1499
1565
  //#region src/components/viewer-core/slotContent.ts
1500
- function Ut(e) {
1566
+ function Jt(e) {
1501
1567
  if (!Array.isArray(e)) return !1;
1502
1568
  for (let t of e) {
1503
1569
  if (Array.isArray(t)) {
1504
- if (Ut(t)) return !0;
1570
+ if (Jt(t)) return !0;
1505
1571
  continue;
1506
1572
  }
1507
1573
  if (!h(t)) {
@@ -1512,20 +1578,20 @@ function Ut(e) {
1512
1578
  if (t != null && t !== !1) return !0;
1513
1579
  continue;
1514
1580
  }
1515
- if (!Wt(t)) return !0;
1581
+ if (!Yt(t)) return !0;
1516
1582
  }
1517
1583
  return !1;
1518
1584
  }
1519
- function Wt(r) {
1520
- return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Ut(r.children) : !1;
1585
+ function Yt(r) {
1586
+ return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Jt(r.children) : !1;
1521
1587
  }
1522
1588
  //#endregion
1523
1589
  //#region src/components/viewer-core/useSurfaceEmptyState.ts
1524
- var Gt = "no items available";
1525
- function Kt(e) {
1590
+ var Xt = "no items available";
1591
+ function Zt(e) {
1526
1592
  let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
1527
1593
  loading: !!e.loading.value,
1528
- message: Gt,
1594
+ message: Xt,
1529
1595
  mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
1530
1596
  surface: e.surface,
1531
1597
  total: e.itemCount.value
@@ -1533,23 +1599,23 @@ function Kt(e) {
1533
1599
  return {
1534
1600
  emptyStateProps: t,
1535
1601
  showBadgeEmptyState: i(() => t.value?.mode === "badge"),
1536
- showCustomEmptyState: i(() => Ut(n.value)),
1602
+ showCustomEmptyState: i(() => Jt(n.value)),
1537
1603
  showInlineEmptyState: i(() => t.value?.mode === "inline")
1538
1604
  };
1539
1605
  }
1540
1606
  //#endregion
1541
1607
  //#region src/components/viewer-core/format.ts
1542
- function qt(e) {
1608
+ function Qt(e) {
1543
1609
  if (!Number.isFinite(e) || e <= 0) return "0:00";
1544
1610
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
1545
1611
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
1546
1612
  }
1547
1613
  //#endregion
1548
1614
  //#region src/components/viewer-core/surfaceStatus.ts
1549
- function Jt(e) {
1615
+ function $t(e) {
1550
1616
  return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
1551
1617
  }
1552
- function Yt(e) {
1618
+ function en(e) {
1553
1619
  return e.phase === "failed" ? {
1554
1620
  kind: "failed",
1555
1621
  message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
@@ -1572,7 +1638,7 @@ function Yt(e) {
1572
1638
  }
1573
1639
  //#endregion
1574
1640
  //#region src/components/viewer-core/useActivation.ts
1575
- function Xt(e) {
1641
+ function tn(e) {
1576
1642
  let t = !1;
1577
1643
  L(e.enabled, async (t) => {
1578
1644
  if (n(t), t) {
@@ -1595,7 +1661,7 @@ function Xt(e) {
1595
1661
  }
1596
1662
  //#endregion
1597
1663
  //#region src/components/viewer-core/assetState.ts
1598
- var Zt = {
1664
+ var nn = {
1599
1665
  currentTime: 0,
1600
1666
  duration: 0,
1601
1667
  errorKind: null,
@@ -1604,38 +1670,38 @@ var Zt = {
1604
1670
  ready: !1,
1605
1671
  volume: 1
1606
1672
  };
1607
- function Qt() {
1608
- return { ...Zt };
1673
+ function rn() {
1674
+ return { ...nn };
1609
1675
  }
1610
- function $t(e) {
1676
+ function an(e) {
1611
1677
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1612
1678
  }
1613
- function en(e, t, n) {
1614
- e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = tn(t, n);
1679
+ function on(e, t, n) {
1680
+ e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = sn(t, n);
1615
1681
  }
1616
- function tn(e, t) {
1682
+ function sn(e, t) {
1617
1683
  return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
1618
1684
  }
1619
1685
  //#endregion
1620
1686
  //#region src/components/viewer-core/loadError.ts
1621
- var nn = /* @__PURE__ */ new Map();
1622
- function rn(e) {
1687
+ var cn = /* @__PURE__ */ new Map();
1688
+ function ln(e) {
1623
1689
  return e === "not-found" ? "404" : "Load error";
1624
1690
  }
1625
- function an(e) {
1691
+ function un(e) {
1626
1692
  return e === "generic";
1627
1693
  }
1628
- function on(e) {
1629
- return sn(e).then((e) => e ?? "generic");
1694
+ function dn(e) {
1695
+ return fn(e).then((e) => e ?? "generic");
1630
1696
  }
1631
- function sn(e) {
1632
- let t = nn.get(e);
1697
+ function fn(e) {
1698
+ let t = cn.get(e);
1633
1699
  if (t) return t;
1634
- let n = cn(e);
1635
- return nn.set(e, n), n;
1700
+ let n = pn(e);
1701
+ return cn.set(e, n), n;
1636
1702
  }
1637
- async function cn(e) {
1638
- if (!ln(e)) return null;
1703
+ async function pn(e) {
1704
+ if (!mn(e)) return null;
1639
1705
  try {
1640
1706
  let t = await fetch(e, { method: "HEAD" });
1641
1707
  return t.ok ? null : t.status === 404 ? "not-found" : "generic";
@@ -1643,12 +1709,12 @@ async function cn(e) {
1643
1709
  return "generic";
1644
1710
  }
1645
1711
  }
1646
- function ln(e) {
1712
+ function mn(e) {
1647
1713
  return /^(https?:\/\/|\/)/i.test(e);
1648
1714
  }
1649
1715
  //#endregion
1650
1716
  //#region src/components/viewer-core/mediaPlayback.ts
1651
- function un(e) {
1717
+ function hn(e) {
1652
1718
  try {
1653
1719
  let t = e.play();
1654
1720
  t && typeof t.catch == "function" && t.catch(() => {});
@@ -1656,12 +1722,12 @@ function un(e) {
1656
1722
  }
1657
1723
  //#endregion
1658
1724
  //#region src/components/viewer-core/useMedia.ts
1659
- function dn(e) {
1725
+ function gn(e) {
1660
1726
  let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ? $(e.activeItem.value) : null), d = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), f = i(() => {
1661
1727
  let t = /* @__PURE__ */ new Map();
1662
1728
  for (let n of e.items.value) t.set($(n), n);
1663
1729
  return t;
1664
- }), p = i(() => d.value ? r.value[d.value] ?? Zt : Zt), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : fn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
1730
+ }), p = i(() => d.value ? r.value[d.value] ?? nn : nn), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : _n(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
1665
1731
  L(() => u.value, async () => {
1666
1732
  await C();
1667
1733
  }), L(() => e.itemCount.value, async () => {
@@ -1684,7 +1750,7 @@ function dn(e) {
1684
1750
  c.delete(e);
1685
1751
  }
1686
1752
  function b(e, r) {
1687
- r instanceof HTMLImageElement && $t(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
1753
+ r instanceof HTMLImageElement && an(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
1688
1754
  }
1689
1755
  function x() {
1690
1756
  H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
@@ -1706,14 +1772,14 @@ function dn(e) {
1706
1772
  V(i, n);
1707
1773
  continue;
1708
1774
  }
1709
- i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, un(i), W(n, i);
1775
+ i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, hn(i), W(n, i);
1710
1776
  }
1711
1777
  for (let [e, n] of c.entries()) {
1712
1778
  if (e !== t || r.value[e]?.errorKind) {
1713
1779
  V(n, e);
1714
1780
  continue;
1715
1781
  }
1716
- un(n), W(e, n);
1782
+ hn(n), W(e, n);
1717
1783
  }
1718
1784
  }
1719
1785
  function w(e, t) {
@@ -1731,7 +1797,7 @@ function dn(e) {
1731
1797
  async function E(r, i) {
1732
1798
  let a = Y(r) ?? e.activeItem.value;
1733
1799
  t.value[r] = !1, n.value[r] = "generic";
1734
- let o = await on(i);
1800
+ let o = await dn(i);
1735
1801
  n.value[r] = o, a && e.onAssetError?.({
1736
1802
  item: a,
1737
1803
  occurrenceKey: r,
@@ -1749,7 +1815,7 @@ function dn(e) {
1749
1815
  } catch {}
1750
1816
  }
1751
1817
  i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
1752
- let o = await on(n);
1818
+ let o = await dn(n);
1753
1819
  i.errorKind = o, a && e.onAssetError?.({
1754
1820
  item: a,
1755
1821
  occurrenceKey: t,
@@ -1769,13 +1835,13 @@ function dn(e) {
1769
1835
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1770
1836
  let r = Number.parseFloat(e.target.value);
1771
1837
  if (!Number.isFinite(r)) return;
1772
- let i = fn(r, 0, m.value || 0);
1838
+ let i = _n(r, 0, m.value || 0);
1773
1839
  ne(n, i, t), t.currentTime = i;
1774
1840
  }
1775
1841
  function M(e) {
1776
1842
  let t = q(), n = d.value;
1777
1843
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1778
- let r = fn(Number.parseFloat(e.target.value), 0, 1);
1844
+ let r = _n(Number.parseFloat(e.target.value), 0, 1);
1779
1845
  t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
1780
1846
  }
1781
1847
  function N() {
@@ -1796,10 +1862,10 @@ function dn(e) {
1796
1862
  }
1797
1863
  function z(e) {
1798
1864
  let t = R(e);
1799
- return t ? rn(t) : null;
1865
+ return t ? ln(t) : null;
1800
1866
  }
1801
1867
  function B(e) {
1802
- return an(R(e));
1868
+ return un(R(e));
1803
1869
  }
1804
1870
  function ee(e) {
1805
1871
  return `${e}:${a.value[e] ?? 0}`;
@@ -1826,17 +1892,17 @@ function dn(e) {
1826
1892
  for (let [e, t] of c.entries()) V(t, e);
1827
1893
  }
1828
1894
  function U(e) {
1829
- return r.value[e] || (r.value[e] = Qt()), r.value[e];
1895
+ return r.value[e] || (r.value[e] = rn()), r.value[e];
1830
1896
  }
1831
1897
  function W(e, t, n) {
1832
- en(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
1898
+ on(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
1833
1899
  }
1834
1900
  function ne(e, t, n) {
1835
1901
  let r = U(e);
1836
1902
  r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.muted = n.muted, r.paused = n.paused, r.volume = Number.isFinite(n.volume) ? n.volume : r.volume;
1837
1903
  }
1838
1904
  function G(e) {
1839
- return fn(o.value[e] ?? 1, 0, 1);
1905
+ return _n(o.value[e] ?? 1, 0, 1);
1840
1906
  }
1841
1907
  function K(e) {
1842
1908
  return s.get(e) ?? c.get(e) ?? null;
@@ -1847,7 +1913,7 @@ function dn(e) {
1847
1913
  function re(e) {
1848
1914
  if (e) {
1849
1915
  if (e.paused) {
1850
- un(e);
1916
+ hn(e);
1851
1917
  return;
1852
1918
  }
1853
1919
  e.pause();
@@ -1901,16 +1967,16 @@ function dn(e) {
1901
1967
  syncMediaPlayback: C
1902
1968
  };
1903
1969
  }
1904
- function fn(e, t, n) {
1970
+ function _n(e, t, n) {
1905
1971
  return Math.min(Math.max(e, t), n);
1906
1972
  }
1907
1973
  //#endregion
1908
1974
  //#region src/components/viewer-core/virtualization.ts
1909
- var pn = {
1975
+ var vn = {
1910
1976
  backward: 1,
1911
1977
  forward: 3
1912
1978
  };
1913
- function mn(e, t, n = pn) {
1979
+ function yn(e, t, n = vn) {
1914
1980
  return t <= 0 ? {
1915
1981
  start: 0,
1916
1982
  end: -1
@@ -1919,14 +1985,14 @@ function mn(e, t, n = pn) {
1919
1985
  end: Math.min(t - 1, e + n.forward)
1920
1986
  };
1921
1987
  }
1922
- function hn(e, t, n = pn) {
1923
- let r = mn(t, e.length, n);
1988
+ function bn(e, t, n = vn) {
1989
+ let r = yn(t, e.length, n);
1924
1990
  return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
1925
1991
  item: e,
1926
1992
  index: r.start + t
1927
1993
  }));
1928
1994
  }
1929
- function gn(e, t, n, r, i) {
1995
+ function xn(e, t, n, r, i) {
1930
1996
  return {
1931
1997
  transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
1932
1998
  transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
@@ -1934,12 +2000,12 @@ function gn(e, t, n, r, i) {
1934
2000
  }
1935
2001
  //#endregion
1936
2002
  //#region src/components/viewer-core/useViewer.ts
1937
- function _n(e, t, n = {}) {
1938
- let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => Jt({
2003
+ function Sn(e, t, n = {}) {
2004
+ let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => $t({
1939
2005
  itemCount: r.value.length,
1940
2006
  loading: s.value,
1941
2007
  phase: e.phase
1942
- })), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = dn({
2008
+ })), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = gn({
1943
2009
  items: r,
1944
2010
  activeItem: C,
1945
2011
  activeMediaItem: w,
@@ -1948,14 +2014,14 @@ function _n(e, t, n = {}) {
1948
2014
  loopFullscreenVideo: l,
1949
2015
  onAssetError: n.onAssetError,
1950
2016
  onAssetLoad: n.onAssetLoad
1951
- }), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Yt({
2017
+ }), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => en({
1952
2018
  errorMessage: o.value,
1953
2019
  hasItems: r.value.length > 0,
1954
2020
  hasNextPage: c.value,
1955
2021
  phase: d.value,
1956
2022
  surface: "fullscreen"
1957
- })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => mn(S.value, r.value.length)), N = i(() => hn(r.value, S.value));
1958
- Xt({
2023
+ })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => yn(S.value, r.value.length)), N = i(() => bn(r.value, S.value));
2024
+ tn({
1959
2025
  enabled: _,
1960
2026
  onDisable() {
1961
2027
  H(), T.resetMediaState();
@@ -2033,7 +2099,7 @@ function _n(e, t, n = {}) {
2033
2099
  return e.type === "audio";
2034
2100
  }
2035
2101
  function ie(e) {
2036
- return gn(e, S.value, g.value, m.value, h.value);
2102
+ return xn(e, S.value, g.value, m.value, h.value);
2037
2103
  }
2038
2104
  return {
2039
2105
  activeItem: C,
@@ -2048,7 +2114,7 @@ function _n(e, t, n = {}) {
2048
2114
  getAssetErrorKind: T.getAssetErrorKind,
2049
2115
  getAssetErrorLabel: T.getAssetErrorLabel,
2050
2116
  getAssetRenderKey: T.getAssetRenderKey,
2051
- formatPlaybackTime: qt,
2117
+ formatPlaybackTime: Qt,
2052
2118
  getImageSource: T.getImageSource,
2053
2119
  getSlideStyle: ie,
2054
2120
  hasNextPage: c,
@@ -2092,21 +2158,54 @@ function _n(e, t, n = {}) {
2092
2158
  }
2093
2159
  //#endregion
2094
2160
  //#region src/components/viewer-core/theme.ts
2095
- var vn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", yn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", bn = {
2161
+ var Cn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", wn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", Tn = {
2096
2162
  image: !0,
2097
2163
  video: !0,
2098
2164
  audio: !0,
2099
2165
  other: !0
2100
2166
  };
2101
- function xn(e) {
2102
- return bn[e], vn;
2167
+ function En(e) {
2168
+ return Tn[e], Cn;
2169
+ }
2170
+ function Dn(e) {
2171
+ return Tn[e], wn;
2103
2172
  }
2104
- function Sn(e) {
2105
- return bn[e], yn;
2173
+ //#endregion
2174
+ //#region src/components/viewer-core/useFullscreenAssetEvents.ts
2175
+ function On(e) {
2176
+ function t(t, n) {
2177
+ return e.fullscreenMedia.shouldHandleSlideAssetEvent(t, n) ? e.fullscreenMedia.getItemKey(n) : null;
2178
+ }
2179
+ function n(n, r, i) {
2180
+ let a = t(r, i);
2181
+ if (!a) return;
2182
+ e.fullscreenMedia.settleAssetPreload(a), e.viewer.onImageLoad(a, i.url);
2183
+ let o = n.currentTarget;
2184
+ o instanceof HTMLImageElement && e.updateDominantToneFromImageElement(a, o);
2185
+ }
2186
+ async function r(n, r) {
2187
+ let i = t(n, r);
2188
+ i && (e.fullscreenMedia.settleAssetPreload(i), await e.viewer.onImageError(i, r.url));
2189
+ }
2190
+ function i(n, r, i) {
2191
+ let a = t(n, r);
2192
+ return a ? (e.viewer.onMediaEvent(a, i), a) : null;
2193
+ }
2194
+ async function a(n, r) {
2195
+ let i = t(n, r);
2196
+ i && (e.fullscreenMedia.settleAssetPreload(i), await e.viewer.onMediaError(i, r.url));
2197
+ }
2198
+ return {
2199
+ getHandledItemKey: t,
2200
+ onFullscreenImageError: r,
2201
+ onFullscreenImageLoad: n,
2202
+ onFullscreenMediaError: a,
2203
+ onFullscreenMediaEvent: i
2204
+ };
2106
2205
  }
2107
2206
  //#endregion
2108
2207
  //#region src/components/viewer-core/dominantImageTone.ts
2109
- function Cn(e) {
2208
+ function kn(e) {
2110
2209
  if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
2111
2210
  let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
2112
2211
  if (!n) return null;
@@ -2121,20 +2220,20 @@ function Cn(e) {
2121
2220
  r += d, i += s * d, a += c * d, o += l * d;
2122
2221
  }
2123
2222
  return r <= 0 ? null : {
2124
- r: wn(Math.round(i / r)),
2125
- g: wn(Math.round(a / r)),
2126
- b: wn(Math.round(o / r))
2223
+ r: An(Math.round(i / r)),
2224
+ g: An(Math.round(a / r)),
2225
+ b: An(Math.round(o / r))
2127
2226
  };
2128
2227
  } catch {
2129
2228
  return null;
2130
2229
  }
2131
2230
  }
2132
- function wn(e) {
2231
+ function An(e) {
2133
2232
  return Math.min(235, Math.max(26, e));
2134
2233
  }
2135
2234
  //#endregion
2136
2235
  //#region src/components/viewer-core/useFullscreenDominantTone.ts
2137
- function Tn(e) {
2236
+ function jn(e) {
2138
2237
  let t = D({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
2139
2238
  if (!r.value) return;
2140
2239
  let { r: e, g: t, b: n } = r.value;
@@ -2149,7 +2248,7 @@ function Tn(e) {
2149
2248
  });
2150
2249
  function s(n, r) {
2151
2250
  if (!e.showDominantImageTone.value) return;
2152
- let i = Cn(r);
2251
+ let i = kn(r);
2153
2252
  i && (t.value[n] = i);
2154
2253
  }
2155
2254
  return {
@@ -2160,7 +2259,7 @@ function Tn(e) {
2160
2259
  }
2161
2260
  //#endregion
2162
2261
  //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
2163
- var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2262
+ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
2164
2263
  inheritAttrs: !1,
2165
2264
  __name: "SurfaceEmptyState",
2166
2265
  props: {
@@ -2174,31 +2273,31 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2174
2273
  "data-testid": "vibe-empty-state-inline",
2175
2274
  "data-surface": e.surface,
2176
2275
  class: ["pointer-events-none absolute z-[4] text-center", e.surface === "grid" ? "inset-x-0 top-[clamp(6rem,22vh,11rem)] flex justify-center px-6" : "inset-0 grid place-items-center px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)]"]
2177
- }), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, En)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
2276
+ }), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, Mn)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
2178
2277
  "data-testid": "vibe-empty-state-badge",
2179
2278
  "data-surface": e.surface,
2180
2279
  class: v(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
2181
- }, j(e.message), 11, Dn)])], 16));
2280
+ }, j(e.message), 11, Nn)])], 16));
2182
2281
  }
2183
- }), kn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, An = {
2282
+ }), Fn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, In = {
2184
2283
  key: 0,
2185
2284
  class: "relative h-full min-h-0"
2186
- }, jn = [
2285
+ }, Ln = [
2187
2286
  "data-item-id",
2188
2287
  "data-occurrence-key",
2189
2288
  "data-index",
2190
2289
  "data-active",
2191
2290
  "aria-hidden"
2192
- ], Mn = {
2291
+ ], Rn = {
2193
2292
  key: 0,
2194
2293
  "data-testid": "vibe-asset-spinner",
2195
2294
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
2196
- }, Nn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Pn = ["data-kind"], Fn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, In = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Ln = ["onClick"], Rn = [
2295
+ }, zn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Bn = ["data-kind"], Vn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Hn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Un = ["onClick"], Wn = [
2197
2296
  "src",
2198
2297
  "alt",
2199
2298
  "onLoad",
2200
2299
  "onError"
2201
- ], zn = [
2300
+ ], Gn = [
2202
2301
  "loop",
2203
2302
  "src",
2204
2303
  "preload",
@@ -2217,15 +2316,15 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2217
2316
  "onStalled",
2218
2317
  "onTimeupdate",
2219
2318
  "onWaiting"
2220
- ], Bn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Vn = [
2319
+ ], Kn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, qn = [
2221
2320
  "aria-label",
2222
2321
  "disabled",
2223
2322
  "onClick"
2224
- ], Hn = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, Un = { class: "pointer-events-none absolute bottom-4 right-4 inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 backdrop-blur-[18px]" }, Wn = {
2323
+ ], Jn = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, Yn = { class: "pointer-events-none absolute bottom-4 right-4 inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 backdrop-blur-[18px]" }, Xn = {
2225
2324
  key: 0,
2226
2325
  "data-testid": "vibe-asset-spinner",
2227
2326
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
2228
- }, Gn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Kn = ["data-kind"], qn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Jn = ["onClick"], Yn = [
2327
+ }, Zn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Qn = ["data-kind"], $n = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, er = ["onClick"], tr = [
2229
2328
  "src",
2230
2329
  "preload",
2231
2330
  "onCanplay",
@@ -2241,26 +2340,26 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2241
2340
  "onStalled",
2242
2341
  "onTimeupdate",
2243
2342
  "onWaiting"
2244
- ], Xn = {
2343
+ ], nr = {
2245
2344
  key: 2,
2246
2345
  class: "relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
2247
- }, Zn = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, Qn = {
2346
+ }, rr = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, ir = {
2248
2347
  key: 0,
2249
2348
  "data-testid": "vibe-fullscreen-overlay",
2250
2349
  class: "pointer-events-none absolute inset-0 z-[6]"
2251
- }, $n = { class: "h-full w-full" }, er = {
2350
+ }, ar = { class: "h-full w-full" }, or = {
2252
2351
  key: 1,
2253
2352
  "data-testid": "vibe-forward-fill-placeholder",
2254
2353
  class: "grid h-full min-h-0 place-items-center px-6 text-center"
2255
- }, tr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, nr = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)]" }, rr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ir = {
2354
+ }, sr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, cr = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)]" }, lr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ur = {
2256
2355
  key: 0,
2257
2356
  "data-testid": "vibe-fullscreen-aside",
2258
2357
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
2259
- }, ar = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, or = {
2358
+ }, dr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, fr = {
2260
2359
  key: 0,
2261
2360
  "data-testid": "vibe-fullscreen-aside",
2262
2361
  class: "absolute inset-y-0 right-0 z-[6] w-full max-w-[22rem] overflow-hidden border-l border-white/10 bg-black/82 backdrop-blur-[18px]"
2263
- }, sr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, cr = 1280, lr = 768, ur = /* @__PURE__ */ d({
2362
+ }, pr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, mr = 1280, hr = 768, gr = /* @__PURE__ */ d({
2264
2363
  __name: "FullscreenSurface",
2265
2364
  props: {
2266
2365
  active: {
@@ -2312,23 +2411,27 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2312
2411
  },
2313
2412
  emits: ["back-to-list", "update:activeIndex"],
2314
2413
  setup(e, { emit: n }) {
2315
- let d = e, f = F(), m = n, h = _n(d, (e, t) => {
2414
+ let d = e, f = F(), m = n, h = Sn(d, (e, t) => {
2316
2415
  m("update:activeIndex", t);
2317
2416
  }, {
2318
2417
  enabled: M(d, "active"),
2319
2418
  onAssetError: d.reportAssetError ?? void 0,
2320
2419
  onAssetLoad: d.reportAssetLoad ?? void 0
2321
- }), _ = D(typeof window > "u" ? cr : window.innerWidth || cr), C = Ht({
2420
+ }), _ = D(typeof window > "u" ? mr : window.innerWidth || mr), C = qt({
2322
2421
  active: M(d, "active"),
2323
2422
  items: h.items,
2324
2423
  resolvedActiveIndex: h.resolvedActiveIndex,
2325
2424
  viewer: h
2326
- }), T = i(() => xn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = Tn({
2425
+ }), T = i(() => En(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = jn({
2327
2426
  activeItem: h.activeItem,
2328
2427
  getItemKey: C.getItemKey,
2329
2428
  isImageReady: h.isImageReady,
2330
2429
  showDominantImageTone: M(d, "showDominantImageTone")
2331
- }), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value < lr ? "vertical" : "horizontal"), te = i(() => R.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), V = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), U = i(() => {
2430
+ }), L = On({
2431
+ fullscreenMedia: C,
2432
+ updateDominantToneFromImageElement: _e,
2433
+ viewer: h
2434
+ }), R = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), B = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), te = i(() => _.value < hr ? "vertical" : "horizontal"), V = i(() => B.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), H = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), U = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), W = i(() => {
2332
2435
  let e = h.activeItem.value;
2333
2436
  return e ? {
2334
2437
  hasNextPage: d.hasNextPage,
@@ -2338,14 +2441,14 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2338
2441
  paginationDetail: d.paginationDetail,
2339
2442
  total: d.items.length
2340
2443
  } : null;
2341
- }), W = i(() => !U.value || !f["fullscreen-header-actions"] ? [] : f["fullscreen-header-actions"](U.value)), ne = i(() => !U.value || !f["fullscreen-aside"] ? [] : f["fullscreen-aside"](U.value)), G = i(() => !d.showStatusBadges || !U.value || !h.statusKind.value || !h.statusMessage.value ? null : {
2342
- ...U.value,
2444
+ }), ne = i(() => !W.value || !f["fullscreen-header-actions"] ? [] : f["fullscreen-header-actions"](W.value)), G = i(() => !W.value || !f["fullscreen-aside"] ? [] : f["fullscreen-aside"](W.value)), K = i(() => !d.showStatusBadges || !W.value || !h.statusKind.value || !h.statusMessage.value ? null : {
2445
+ ...W.value,
2343
2446
  kind: h.statusKind.value,
2344
2447
  message: h.statusMessage.value
2345
- }), K = i(() => !G.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](G.value)), q = i(() => ({
2346
- gridTemplateColumns: Y.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
2448
+ }), q = i(() => !K.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](K.value)), re = i(() => ({
2449
+ gridTemplateColumns: ie.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
2347
2450
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
2348
- })), re = i(() => Ut(W.value)), J = i(() => Ut(ne.value)), Y = i(() => J.value && _.value >= cr), ie = i(() => J.value && !Y.value), ae = i(() => Ut(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Kt({
2451
+ })), J = i(() => Jt(ne.value)), Y = i(() => Jt(G.value)), ie = i(() => Y.value && _.value >= mr), ae = i(() => Y.value && !ie.value), ue = i(() => Jt(q.value)), { emptyStateProps: X, showBadgeEmptyState: de, showCustomEmptyState: fe, showInlineEmptyState: Z } = Zt({
2349
2452
  emptyStateMode: M(d, "emptyStateMode"),
2350
2453
  itemCount: i(() => d.items.length),
2351
2454
  loading: M(d, "loading"),
@@ -2353,59 +2456,48 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2353
2456
  surface: "fullscreen"
2354
2457
  });
2355
2458
  S(() => {
2356
- window.addEventListener("resize", Z);
2459
+ window.addEventListener("resize", pe);
2357
2460
  }), x(() => {
2358
- window.removeEventListener("resize", Z);
2461
+ window.removeEventListener("resize", pe);
2359
2462
  });
2360
- function Z() {
2361
- _.value = window.innerWidth || cr;
2463
+ function pe() {
2464
+ _.value = window.innerWidth || mr;
2362
2465
  }
2363
- function pe(e, t, n) {
2364
- C.settleAssetPreload(t), h.onImageLoad(t, n);
2365
- let r = e.currentTarget;
2366
- r instanceof HTMLImageElement && ye(t, r);
2367
- }
2368
- async function me(e, t) {
2369
- C.settleAssetPreload(e), await h.onImageError(e, t);
2466
+ function me(e, t) {
2467
+ C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && _e(e, t);
2370
2468
  }
2371
2469
  function he(e, t) {
2372
- C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && ye(e, t);
2373
- }
2374
- function ge(e, t) {
2375
2470
  C.registerMediaElement(e, t), h.registerVideoElement(e, t);
2376
2471
  }
2377
- function _e(e, t) {
2472
+ function ge(e, t) {
2378
2473
  C.registerMediaElement(e, t), h.registerAudioElement(e, t);
2379
2474
  }
2380
- async function ve(e, t) {
2381
- C.settleAssetPreload(e), await h.onMediaError(e, t);
2475
+ function Q(e, t, n) {
2476
+ let r = L.onFullscreenMediaEvent(e, t, n), i = n.currentTarget, a = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
2477
+ r && i instanceof HTMLMediaElement && i.readyState >= a && C.settleAssetPreload(r);
2382
2478
  }
2383
- function Q(e, t) {
2384
- h.onMediaEvent(e, t);
2385
- let n = t.currentTarget, r = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
2386
- n instanceof HTMLMediaElement && n.readyState >= r && C.settleAssetPreload(e);
2387
- }
2388
- function ye(e, t) {
2479
+ function _e(e, t) {
2389
2480
  I(e, t);
2390
2481
  }
2391
- function $(e, t) {
2392
- if (Q(t, e), !d.loopFullscreenVideo) return;
2393
- let n = e.currentTarget;
2394
- if (!(n instanceof HTMLVideoElement)) return;
2482
+ function ve(e, t, n) {
2483
+ let r = L.getHandledItemKey(t, n);
2484
+ if (!r || (h.onMediaEvent(r, e), !d.loopFullscreenVideo)) return;
2485
+ let i = e.currentTarget;
2486
+ if (!(i instanceof HTMLVideoElement)) return;
2395
2487
  try {
2396
- n.currentTime = 0;
2488
+ i.currentTime = 0;
2397
2489
  } catch {}
2398
- let r = n.play();
2399
- r && typeof r.catch == "function" && r.catch(() => {});
2490
+ let a = i.play();
2491
+ a && typeof a.catch == "function" && a.catch(() => {});
2400
2492
  }
2401
- return (e, n) => (w(), s("div", kn, [
2493
+ return (e, n) => (w(), s("div", Fn, [
2402
2494
  c("div", {
2403
2495
  class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
2404
2496
  style: b(N(P))
2405
2497
  }, null, 6),
2406
2498
  c("div", {
2407
2499
  class: "relative z-[1] grid h-full min-h-0",
2408
- style: b(q.value)
2500
+ style: b(re.value)
2409
2501
  }, [c("div", {
2410
2502
  ref: "viewer.stageRef",
2411
2503
  "data-testid": "vibe-stage",
@@ -2415,7 +2507,7 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2415
2507
  onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
2416
2508
  onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
2417
2509
  onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
2418
- }, [N(h).activeItem.value ? (w(), s("div", An, [
2510
+ }, [N(h).activeItem.value ? (w(), s("div", In, [
2419
2511
  (w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
2420
2512
  key: N(C).getItemKey(r),
2421
2513
  "data-testid": "vibe-slide",
@@ -2427,12 +2519,12 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2427
2519
  class: v(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === N(h).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
2428
2520
  style: b(N(h).getSlideStyle(i))
2429
2521
  }, [c("div", {
2430
- class: v(["absolute inset-0 opacity-85", N(Sn)(r.type)]),
2522
+ class: v(["absolute inset-0 opacity-85", N(Dn)(r.type)]),
2431
2523
  style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
2432
2524
  }, null, 6), N(h).isVisual(r) ? (w(), s("div", {
2433
2525
  key: 0,
2434
- class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? te.value : ""])
2435
- }, [N(C).isAssetLoading(i, r) ? (w(), s("div", Mn, [c("span", Nn, [u(N(oe), {
2526
+ class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? V.value : ""])
2527
+ }, [N(C).isAssetLoading(i, r) ? (w(), s("div", Rn, [c("span", zn, [u(N(oe), {
2436
2528
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2437
2529
  "aria-hidden": "true"
2438
2530
  })])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
@@ -2440,19 +2532,19 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2440
2532
  "data-testid": "vibe-asset-error",
2441
2533
  "data-kind": N(C).getAssetErrorKind(r),
2442
2534
  class: "grid h-full w-full place-items-center"
2443
- }, [c("div", Fn, [
2535
+ }, [c("div", Vn, [
2444
2536
  u(N(le), {
2445
2537
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2446
2538
  "aria-hidden": "true"
2447
2539
  }),
2448
- c("p", In, j(N(C).getAssetErrorLabel(r)), 1),
2540
+ c("p", Hn, j(N(C).getAssetErrorLabel(r)), 1),
2449
2541
  N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
2450
2542
  key: 0,
2451
2543
  type: "button",
2452
2544
  class: "inline-flex items-center justify-center border border-white/14 bg-black/35 px-4 py-2 text-[0.64rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
2453
2545
  onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
2454
- }, " Retry ", 8, Ln)) : o("", !0)
2455
- ])], 8, Pn)) : r.type === "image" ? (w(), s("img", {
2546
+ }, " Retry ", 8, Un)) : o("", !0)
2547
+ ])], 8, Bn)) : r.type === "image" ? (w(), s("img", {
2456
2548
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2457
2549
  src: N(C).getFullscreenImageSource(i, r),
2458
2550
  alt: r.title ?? "",
@@ -2460,10 +2552,10 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2460
2552
  draggable: "false",
2461
2553
  class: v(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isImageReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
2462
2554
  ref_for: !0,
2463
- ref: (e) => he(N(C).getItemKey(r), e),
2464
- onLoad: (e) => pe(e, N(C).getItemKey(r), r.url),
2465
- onError: (e) => me(N(C).getItemKey(r), r.url)
2466
- }, null, 42, Rn)) : (w(), s("video", {
2555
+ ref: (e) => me(N(C).getItemKey(r), e),
2556
+ onLoad: (e) => N(L).onFullscreenImageLoad(e, i, r),
2557
+ onError: (e) => N(L).onFullscreenImageError(i, r)
2558
+ }, null, 42, Wn)) : (w(), s("video", {
2467
2559
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2468
2560
  class: v(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isMediaReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
2469
2561
  playsinline: "",
@@ -2471,26 +2563,26 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2471
2563
  src: N(C).getFullscreenMediaSource(i, r),
2472
2564
  preload: N(C).getFullscreenMediaPreload(i),
2473
2565
  ref_for: !0,
2474
- ref: (e) => ge(N(C).getItemKey(r), e),
2566
+ ref: (e) => he(N(C).getItemKey(r), e),
2475
2567
  onClick: ee((e) => N(h).onVideoClick(e, N(C).getItemKey(r)), ["stop"]),
2476
- onCanplay: (e) => Q(N(C).getItemKey(r), e),
2477
- onDurationchange: (e) => Q(N(C).getItemKey(r), e),
2478
- onEnded: (e) => $(e, N(C).getItemKey(r)),
2479
- onError: (e) => ve(N(C).getItemKey(r), r.url),
2480
- onLoadstart: (e) => Q(N(C).getItemKey(r), e),
2481
- onLoadedmetadata: (e) => Q(N(C).getItemKey(r), e),
2482
- onPause: (e) => Q(N(C).getItemKey(r), e),
2483
- onPlay: (e) => Q(N(C).getItemKey(r), e),
2484
- onPlaying: (e) => Q(N(C).getItemKey(r), e),
2485
- onSeeking: (e) => Q(N(C).getItemKey(r), e),
2486
- onSeeked: (e) => Q(N(C).getItemKey(r), e),
2487
- onStalled: (e) => Q(N(C).getItemKey(r), e),
2488
- onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
2489
- onWaiting: (e) => Q(N(C).getItemKey(r), e)
2490
- }, null, 42, zn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
2568
+ onCanplay: (e) => Q(i, r, e),
2569
+ onDurationchange: (e) => Q(i, r, e),
2570
+ onEnded: (e) => ve(e, i, r),
2571
+ onError: (e) => N(L).onFullscreenMediaError(i, r),
2572
+ onLoadstart: (e) => Q(i, r, e),
2573
+ onLoadedmetadata: (e) => Q(i, r, e),
2574
+ onPause: (e) => Q(i, r, e),
2575
+ onPlay: (e) => Q(i, r, e),
2576
+ onPlaying: (e) => Q(i, r, e),
2577
+ onSeeking: (e) => Q(i, r, e),
2578
+ onSeeked: (e) => Q(i, r, e),
2579
+ onStalled: (e) => Q(i, r, e),
2580
+ onTimeupdate: (e) => Q(i, r, e),
2581
+ onWaiting: (e) => Q(i, r, e)
2582
+ }, null, 42, Gn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
2491
2583
  key: 1,
2492
- class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? te.value : ""])
2493
- }, [c("div", Bn, [
2584
+ class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? V.value : ""])
2585
+ }, [c("div", Kn, [
2494
2586
  c("button", {
2495
2587
  type: "button",
2496
2588
  class: "relative grid h-full w-full place-items-center border border-white/12 bg-[linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02)),radial-gradient(circle_at_center,rgba(16,185,129,0.14),transparent_58%)] text-[#f7f1ea] transition-[border-color,background] duration-200 hover:border-white/30 hover:bg-[linear-gradient(180deg,rgba(255,255,255,0.07),rgba(255,255,255,0.03)),radial-gradient(circle_at_center,rgba(16,185,129,0.18),transparent_58%)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
@@ -2500,19 +2592,19 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2500
2592
  }, [
2501
2593
  n[6] ||= c("span", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(16,185,129,0.16),transparent_66%)]" }, null, -1),
2502
2594
  n[7] ||= c("span", { class: "pointer-events-none absolute h-[clamp(220px,30vw,360px)] w-[clamp(220px,30vw,360px)] border border-white/8 bg-[radial-gradient(circle,rgba(255,255,255,0.08),transparent_62%)]" }, null, -1),
2503
- c("span", Hn, [k(e.$slots, "item-icon", {
2504
- icon: N(Ot)(r.type),
2595
+ c("span", Jn, [k(e.$slots, "item-icon", {
2596
+ icon: N(Nt)(r.type),
2505
2597
  item: r
2506
- }, () => [(w(), a(A(N(Ot)(r.type)), {
2598
+ }, () => [(w(), a(A(N(Nt)(r.type)), {
2507
2599
  class: "h-6 w-6 stroke-[1.9]",
2508
2600
  "aria-hidden": "true"
2509
2601
  }))])]),
2510
- c("span", Un, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
2602
+ c("span", Yn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
2511
2603
  class: "h-4 w-4 stroke-2",
2512
2604
  "aria-hidden": "true"
2513
2605
  }))])
2514
- ], 8, Vn),
2515
- N(C).isAssetLoading(i, r) ? (w(), s("div", Wn, [c("span", Gn, [u(N(oe), {
2606
+ ], 8, qn),
2607
+ N(C).isAssetLoading(i, r) ? (w(), s("div", Xn, [c("span", Zn, [u(N(oe), {
2516
2608
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2517
2609
  "aria-hidden": "true"
2518
2610
  })])])) : o("", !0),
@@ -2525,43 +2617,43 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2525
2617
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2526
2618
  "aria-hidden": "true"
2527
2619
  }),
2528
- c("p", qn, j(N(C).getAssetErrorLabel(r)), 1),
2620
+ c("p", $n, j(N(C).getAssetErrorLabel(r)), 1),
2529
2621
  N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
2530
2622
  key: 0,
2531
2623
  type: "button",
2532
2624
  class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-4 py-2 text-[0.64rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
2533
2625
  onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
2534
- }, " Retry ", 8, Jn)) : o("", !0)
2535
- ], 8, Kn)], 64)) : o("", !0)
2626
+ }, " Retry ", 8, er)) : o("", !0)
2627
+ ], 8, Qn)], 64)) : o("", !0)
2536
2628
  ]), (w(), s("audio", {
2537
2629
  key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
2538
2630
  src: N(C).getFullscreenMediaSource(i, r),
2539
2631
  preload: N(C).getFullscreenMediaPreload(i),
2540
2632
  class: "pointer-events-none absolute h-px w-px opacity-0",
2541
2633
  ref_for: !0,
2542
- ref: (e) => _e(N(C).getItemKey(r), e),
2543
- onCanplay: (e) => Q(N(C).getItemKey(r), e),
2544
- onDurationchange: (e) => Q(N(C).getItemKey(r), e),
2545
- onError: (e) => ve(N(C).getItemKey(r), r.url),
2546
- onLoadstart: (e) => Q(N(C).getItemKey(r), e),
2547
- onLoadedmetadata: (e) => Q(N(C).getItemKey(r), e),
2548
- onPause: (e) => Q(N(C).getItemKey(r), e),
2549
- onPlay: (e) => Q(N(C).getItemKey(r), e),
2550
- onPlaying: (e) => Q(N(C).getItemKey(r), e),
2551
- onSeeking: (e) => Q(N(C).getItemKey(r), e),
2552
- onSeeked: (e) => Q(N(C).getItemKey(r), e),
2553
- onStalled: (e) => Q(N(C).getItemKey(r), e),
2554
- onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
2555
- onWaiting: (e) => Q(N(C).getItemKey(r), e)
2556
- }, null, 40, Yn))], 2)) : (w(), s("div", Xn, [c("div", Zn, [k(e.$slots, "item-icon", {
2557
- icon: N(Ot)(r.type),
2634
+ ref: (e) => ge(N(C).getItemKey(r), e),
2635
+ onCanplay: (e) => Q(i, r, e),
2636
+ onDurationchange: (e) => Q(i, r, e),
2637
+ onError: (e) => N(L).onFullscreenMediaError(i, r),
2638
+ onLoadstart: (e) => Q(i, r, e),
2639
+ onLoadedmetadata: (e) => Q(i, r, e),
2640
+ onPause: (e) => Q(i, r, e),
2641
+ onPlay: (e) => Q(i, r, e),
2642
+ onPlaying: (e) => Q(i, r, e),
2643
+ onSeeking: (e) => Q(i, r, e),
2644
+ onSeeked: (e) => Q(i, r, e),
2645
+ onStalled: (e) => Q(i, r, e),
2646
+ onTimeupdate: (e) => Q(i, r, e),
2647
+ onWaiting: (e) => Q(i, r, e)
2648
+ }, null, 40, tr))], 2)) : (w(), s("div", nr, [c("div", rr, [k(e.$slots, "item-icon", {
2649
+ icon: N(Nt)(r.type),
2558
2650
  item: r
2559
- }, () => [(w(), a(A(N(Ot)(r.type)), {
2651
+ }, () => [(w(), a(A(N(Nt)(r.type)), {
2560
2652
  class: "h-6 w-6 stroke-[1.9]",
2561
2653
  "aria-hidden": "true"
2562
- }))])])]))], 14, jn))), 128)),
2563
- U.value && f["fullscreen-overlay"] ? (w(), s("div", Qn, [c("div", $n, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
2564
- N(h).activeItem.value ? (w(), a(Tt, {
2654
+ }))])])]))], 14, Ln))), 128)),
2655
+ W.value && f["fullscreen-overlay"] ? (w(), s("div", ir, [c("div", ar, [k(e.$slots, "fullscreen-overlay", y(p(W.value)))])])) : o("", !0),
2656
+ N(h).activeItem.value ? (w(), a(At, {
2565
2657
  key: 1,
2566
2658
  "current-index": N(h).resolvedActiveIndex.value,
2567
2659
  loading: d.loading,
@@ -2571,9 +2663,9 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2571
2663
  title: N(h).activeItem.value.title ?? null,
2572
2664
  total: N(h).items.value.length,
2573
2665
  onBackToList: n[0] ||= (e) => m("back-to-list")
2574
- }, l({ _: 2 }, [re.value && U.value ? {
2666
+ }, l({ _: 2 }, [J.value && W.value ? {
2575
2667
  name: "actions",
2576
- fn: z(() => [k(e.$slots, "fullscreen-header-actions", y(p(U.value)))]),
2668
+ fn: z(() => [k(e.$slots, "fullscreen-header-actions", y(p(W.value)))]),
2577
2669
  key: "0"
2578
2670
  } : void 0]), 1032, [
2579
2671
  "current-index",
@@ -2584,7 +2676,7 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2584
2676
  "title",
2585
2677
  "total"
2586
2678
  ])) : o("", !0),
2587
- R.value ? (w(), a(mt, {
2679
+ B.value ? (w(), a(yt, {
2588
2680
  key: 2,
2589
2681
  "current-time": N(h).activeMediaState.value.currentTime,
2590
2682
  "current-time-label": N(h).formatPlaybackTime(N(h).activeMediaState.value.currentTime),
@@ -2593,7 +2685,7 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2593
2685
  muted: N(h).activeMediaState.value.muted,
2594
2686
  progress: N(h).activeMediaProgress.value,
2595
2687
  volume: N(h).activeMediaState.value.volume,
2596
- "volume-control-layout": B.value,
2688
+ "volume-control-layout": te.value,
2597
2689
  onSeekInput: N(h).onMediaSeekInput,
2598
2690
  onVolumeInput: N(h).onMediaVolumeInput,
2599
2691
  onVolumeToggle: N(h).onMediaVolumeToggle
@@ -2610,36 +2702,36 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2610
2702
  "onVolumeInput",
2611
2703
  "onVolumeToggle"
2612
2704
  ])) : o("", !0),
2613
- G.value ? (w(), s("div", {
2705
+ K.value ? (w(), s("div", {
2614
2706
  key: 3,
2615
- class: v(["absolute left-1/2 z-[4] -translate-x-1/2", L.value])
2616
- }, [ae.value ? k(e.$slots, "fullscreen-status", y(g({ key: 0 }, G.value))) : (w(), s("div", {
2707
+ class: v(["absolute left-1/2 z-[4] -translate-x-1/2", R.value])
2708
+ }, [ue.value ? k(e.$slots, "fullscreen-status", y(g({ key: 0 }, K.value))) : (w(), s("div", {
2617
2709
  key: 1,
2618
2710
  "data-testid": "vibe-fullscreen-status-badge",
2619
- class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", G.value.kind === "end" ? "border-amber-300/35 text-amber-200" : G.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2620
- }, j(G.value.message), 3))], 2)) : o("", !0)
2621
- ])) : V.value ? (w(), s("div", er, [c("div", tr, [c("span", nr, [u(N(oe), {
2711
+ class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", K.value.kind === "end" ? "border-amber-300/35 text-amber-200" : K.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2712
+ }, j(K.value.message), 3))], 2)) : o("", !0)
2713
+ ])) : H.value ? (w(), s("div", or, [c("div", sr, [c("span", cr, [u(N(oe), {
2622
2714
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2623
2715
  "aria-hidden": "true"
2624
- })]), c("p", rr, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(On, {
2716
+ })]), c("p", lr, j(U.value), 1)])])) : N(Z) && N(X) ? (w(), a(Pn, {
2625
2717
  key: 2,
2626
2718
  message: N(X).message,
2627
2719
  mode: N(X).mode,
2628
2720
  surface: N(X).surface
2629
2721
  }, {
2630
- default: z(() => [N(de) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
2722
+ default: z(() => [N(fe) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
2631
2723
  _: 3
2632
2724
  }, 8, [
2633
2725
  "message",
2634
2726
  "mode",
2635
2727
  "surface"
2636
- ])) : o("", !0), N(ue) && N(X) ? (w(), a(On, {
2728
+ ])) : o("", !0), N(de) && N(X) ? (w(), a(Pn, {
2637
2729
  key: 3,
2638
2730
  message: N(X).message,
2639
2731
  mode: N(X).mode,
2640
2732
  surface: N(X).surface
2641
2733
  }, {
2642
- default: z(() => [N(de) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
2734
+ default: z(() => [N(fe) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(X)))) : o("", !0)]),
2643
2735
  _: 3
2644
2736
  }, 8, [
2645
2737
  "message",
@@ -2653,7 +2745,7 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2653
2745
  "leave-from-class": "translate-x-0 opacity-100",
2654
2746
  "leave-to-class": "translate-x-full opacity-0"
2655
2747
  }, {
2656
- default: z(() => [Y.value && U.value ? (w(), s("aside", ir, [c("div", ar, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
2748
+ default: z(() => [ie.value && W.value ? (w(), s("aside", ur, [c("div", dr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
2657
2749
  _: 3
2658
2750
  })], 4),
2659
2751
  u(r, {
@@ -2664,29 +2756,29 @@ var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
2664
2756
  "leave-from-class": "translate-x-0 opacity-100",
2665
2757
  "leave-to-class": "translate-x-full opacity-0"
2666
2758
  }, {
2667
- default: z(() => [ie.value && U.value ? (w(), s("aside", or, [c("div", sr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
2759
+ default: z(() => [ae.value && W.value ? (w(), s("aside", fr, [c("div", pr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
2668
2760
  _: 3
2669
2761
  })
2670
2762
  ]));
2671
2763
  }
2672
- }), dr = 1, fr = .5;
2673
- function pr(e) {
2764
+ }), _r = 1, vr = .5;
2765
+ function yr(e) {
2674
2766
  if (e.type !== "image" && e.type !== "video") return {
2675
- width: dr,
2676
- height: dr,
2767
+ width: _r,
2768
+ height: _r,
2677
2769
  source: "fallback"
2678
2770
  };
2679
2771
  let t = e.preview?.width, n = e.preview?.height;
2680
- if (br(t) && br(n)) {
2681
- let r = xr(e, t, n);
2772
+ if (Er(t) && Er(n)) {
2773
+ let r = Dr(e, t, n);
2682
2774
  return {
2683
2775
  width: r.width,
2684
2776
  height: r.height,
2685
2777
  source: "preview"
2686
2778
  };
2687
2779
  }
2688
- if (br(e.width) && br(e.height)) {
2689
- let t = xr(e, e.width, e.height);
2780
+ if (Er(e.width) && Er(e.height)) {
2781
+ let t = Dr(e, e.width, e.height);
2690
2782
  return {
2691
2783
  width: t.width,
2692
2784
  height: t.height,
@@ -2694,31 +2786,31 @@ function pr(e) {
2694
2786
  };
2695
2787
  }
2696
2788
  return {
2697
- width: dr,
2698
- height: dr,
2789
+ width: _r,
2790
+ height: _r,
2699
2791
  source: "fallback"
2700
2792
  };
2701
2793
  }
2702
- function mr(e, t) {
2794
+ function br(e, t) {
2703
2795
  return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
2704
2796
  }
2705
- function hr(e, t, n, r = 0) {
2797
+ function xr(e, t, n, r = 0) {
2706
2798
  if (!e || e <= 0 || !t || t <= 0) return n;
2707
2799
  let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
2708
2800
  return !a || a <= 0 ? n : a / t;
2709
2801
  }
2710
- function gr(e, t) {
2711
- let n = pr(e);
2802
+ function Sr(e, t) {
2803
+ let n = yr(e);
2712
2804
  return n.height / n.width * t;
2713
2805
  }
2714
- function _r(e, t) {
2806
+ function Cr(e, t) {
2715
2807
  let n = Array.from({ length: t.columnCount }, () => 0), r = Array(e.length), i = Array(e.length), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = 0;
2716
2808
  for (let c = 0; c < e.length; c += 1) {
2717
2809
  let l = e[c];
2718
2810
  o.set($(l), c);
2719
2811
  let u = 0;
2720
2812
  for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
2721
- let d = u * (t.columnWidth + t.gapX), f = n[u], p = gr(l, t.columnWidth);
2813
+ let d = u * (t.columnWidth + t.gapX), f = n[u], p = Sr(l, t.columnWidth);
2722
2814
  r[c] = {
2723
2815
  x: d,
2724
2816
  y: f
@@ -2737,7 +2829,7 @@ function _r(e, t) {
2737
2829
  indexById: o
2738
2830
  };
2739
2831
  }
2740
- function vr(e) {
2832
+ function wr(e) {
2741
2833
  if (e.itemCount <= 0) return [];
2742
2834
  if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
2743
2835
  let t = Math.max(0, e.scrollTop - e.overscanPx), n = e.scrollTop + e.viewportHeight + e.overscanPx, r = Math.floor(t / e.bucketPx), i = Math.floor(n / e.bucketPx), a = /* @__PURE__ */ new Set();
@@ -2747,7 +2839,7 @@ function vr(e) {
2747
2839
  }
2748
2840
  return Array.from(a).sort((e, t) => e - t);
2749
2841
  }
2750
- function yr(e, t, n) {
2842
+ function Tr(e, t, n) {
2751
2843
  let r = /* @__PURE__ */ new Map();
2752
2844
  for (let i of e) {
2753
2845
  let e = t.get($(i));
@@ -2757,11 +2849,11 @@ function yr(e, t, n) {
2757
2849
  }
2758
2850
  return r;
2759
2851
  }
2760
- function br(e) {
2852
+ function Er(e) {
2761
2853
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2762
2854
  }
2763
- function xr(e, t, n) {
2764
- return e.type !== "image" || n / t >= fr ? {
2855
+ function Dr(e, t, n) {
2856
+ return e.type !== "image" || n / t >= vr ? {
2765
2857
  width: t,
2766
2858
  height: n
2767
2859
  } : {
@@ -2771,21 +2863,21 @@ function xr(e, t, n) {
2771
2863
  }
2772
2864
  //#endregion
2773
2865
  //#region src/components/viewer-core/useMasonryMotion.ts
2774
- var Sr = 300, Cr = 600, wr = 40, Tr = 300, Er = 400;
2775
- function Dr(e, t) {
2866
+ var Or = 300, kr = 600, Ar = 40, jr = 300, Mr = 400;
2867
+ function Nr(e, t) {
2776
2868
  return t === "top" ? [...e].reverse() : e;
2777
2869
  }
2778
- function Or(e) {
2779
- return e <= 0 ? Cr : Cr + Math.min((e - 1) * wr, Er);
2870
+ function Pr(e) {
2871
+ return e <= 0 ? kr : kr + Math.min((e - 1) * Ar, Mr);
2780
2872
  }
2781
- function kr() {
2782
- return Tr;
2873
+ function Fr() {
2874
+ return jr;
2783
2875
  }
2784
- function Ar(e) {
2876
+ function Ir(e) {
2785
2877
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
2786
2878
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
2787
2879
  }
2788
- function jr(e) {
2880
+ function Lr(e) {
2789
2881
  let t = D(/* @__PURE__ */ new Set()), n = D(/* @__PURE__ */ new Set()), r = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), o = D(/* @__PURE__ */ new Map()), s = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Map()), u = D(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
2790
2882
  L(e.visibleIndices, (i) => {
2791
2883
  if (!i.length) return;
@@ -2795,20 +2887,20 @@ function jr(e) {
2795
2887
  !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
2796
2888
  }
2797
2889
  if (!o.length) return;
2798
- let s = Dr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2799
- for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * wr, Er));
2800
- r.value = c, Mr(() => {
2890
+ let s = Nr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2891
+ for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Ar, Mr));
2892
+ r.value = c, Rr(() => {
2801
2893
  let e = new Set(n.value);
2802
2894
  for (let t of o) e.add(t);
2803
2895
  n.value = e;
2804
- }), Nr(() => {
2896
+ }), zr(() => {
2805
2897
  let e = new Set(t.value);
2806
2898
  for (let t of o) e.delete(t);
2807
2899
  t.value = e, S(() => {
2808
2900
  let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
2809
2901
  for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
2810
2902
  n.value = e, r.value = t, a.value = i;
2811
- }, Or(o.length));
2903
+ }, Pr(o.length));
2812
2904
  });
2813
2905
  }, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
2814
2906
  if (!e.length || !o.value.size) return;
@@ -2835,7 +2927,7 @@ function jr(e) {
2835
2927
  let e = $(t.item);
2836
2928
  p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
2837
2929
  }
2838
- o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Mr(() => {
2930
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Rr(() => {
2839
2931
  let e = new Set(s.value);
2840
2932
  for (let t of p) e.add(t);
2841
2933
  s.value = e;
@@ -2843,9 +2935,9 @@ function jr(e) {
2843
2935
  let e = new Map(o.value), t = new Set(s.value);
2844
2936
  for (let n of p) e.delete(n), t.delete(n);
2845
2937
  o.value = e, s.value = t;
2846
- }, Tr);
2938
+ }, jr);
2847
2939
  }
2848
- function g(t, n, r = Sr) {
2940
+ function g(t, n, r = Or) {
2849
2941
  if (!t.size) return;
2850
2942
  let i = /* @__PURE__ */ new Map(), a = [];
2851
2943
  for (let [r, o] of t.entries()) {
@@ -2864,8 +2956,8 @@ function jr(e) {
2864
2956
  c.value = i, u.value = /* @__PURE__ */ new Set();
2865
2957
  let o = new Map(l.value);
2866
2958
  for (let e of a) o.set(e, r);
2867
- l.value = o, Mr(() => {
2868
- u.value = new Set(a), Mr(() => {
2959
+ l.value = o, Rr(() => {
2960
+ u.value = new Set(a), Rr(() => {
2869
2961
  c.value = /* @__PURE__ */ new Map();
2870
2962
  });
2871
2963
  }), S(() => {
@@ -2876,8 +2968,8 @@ function jr(e) {
2876
2968
  }, r);
2877
2969
  }
2878
2970
  function _(e) {
2879
- if (n.value.has(e)) return `transform ${Cr}ms ease-out`;
2880
- if (u.value.has(e)) return `transform ${l.value.get(e) ?? Sr}ms ease-out`;
2971
+ if (n.value.has(e)) return `transform ${kr}ms ease-out`;
2972
+ if (u.value.has(e)) return `transform ${l.value.get(e) ?? Or}ms ease-out`;
2881
2973
  }
2882
2974
  function v(e) {
2883
2975
  if (!n.value.has(e)) return;
@@ -2894,7 +2986,7 @@ function jr(e) {
2894
2986
  } : {
2895
2987
  dx: 0,
2896
2988
  dy: 0
2897
- }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Ar({
2989
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Ir({
2898
2990
  columnWidth: e.columnWidth.value,
2899
2991
  direction: u,
2900
2992
  itemHeight: o,
@@ -2908,14 +3000,14 @@ function jr(e) {
2908
3000
  if (!r) return {
2909
3001
  opacity: "0",
2910
3002
  transform: "translate3d(0, 0, 0) scale(0.96)",
2911
- transition: `opacity ${Tr}ms ease-out, transform ${Tr}ms ease-out`
3003
+ transition: `opacity ${jr}ms ease-out, transform ${jr}ms ease-out`
2912
3004
  };
2913
3005
  let i = s.value.has(n);
2914
3006
  return {
2915
3007
  height: `${r.height}px`,
2916
3008
  opacity: i ? "0" : "1",
2917
3009
  transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
2918
- transition: `opacity ${Tr}ms ease-out, transform ${Tr}ms ease-out`,
3010
+ transition: `opacity ${jr}ms ease-out, transform ${jr}ms ease-out`,
2919
3011
  width: `${e.columnWidth.value}px`
2920
3012
  };
2921
3013
  }
@@ -2936,28 +3028,28 @@ function jr(e) {
2936
3028
  playFlipMoveAnimation: g
2937
3029
  };
2938
3030
  }
2939
- function Mr(e) {
3031
+ function Rr(e) {
2940
3032
  if (typeof requestAnimationFrame == "function") {
2941
3033
  requestAnimationFrame(() => e());
2942
3034
  return;
2943
3035
  }
2944
3036
  setTimeout(e, 0);
2945
3037
  }
2946
- function Nr(e) {
2947
- Mr(() => Mr(e));
3038
+ function zr(e) {
3039
+ Rr(() => Rr(e));
2948
3040
  }
2949
3041
  //#endregion
2950
3042
  //#region src/components/viewer-core/masonryViewport.ts
2951
- function Pr(e, t) {
3043
+ function Br(e, t) {
2952
3044
  return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
2953
3045
  }
2954
- function Fr(e, t, n) {
3046
+ function Vr(e, t, n) {
2955
3047
  return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
2956
3048
  }
2957
- function Ir(e, t, n, r) {
3049
+ function Hr(e, t, n, r) {
2958
3050
  return (e?.scrollHeight ?? r) - (t + n);
2959
3051
  }
2960
- function Lr(e, t) {
3052
+ function Ur(e, t) {
2961
3053
  return {
2962
3054
  height: `${e}px`,
2963
3055
  transform: `translate3d(0, ${t}px, 0)`
@@ -2965,8 +3057,8 @@ function Lr(e, t) {
2965
3057
  }
2966
3058
  //#endregion
2967
3059
  //#region src/components/viewer-core/useEdgeBoundary.ts
2968
- var Rr = 250, zr = 1e3;
2969
- function Br(e) {
3060
+ var Wr = 250, Gr = 1e3;
3061
+ function Kr(e) {
2970
3062
  let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
2971
3063
  x(() => {
2972
3064
  y();
@@ -2982,7 +3074,7 @@ function Br(e) {
2982
3074
  function u(t) {
2983
3075
  if (!b(t) || !e.isAtBoundary()) return;
2984
3076
  let n = Date.now();
2985
- n < s || (s = n + Rr, m());
3077
+ n < s || (s = n + Wr, m());
2986
3078
  }
2987
3079
  function d() {
2988
3080
  if (!g()) return;
@@ -3016,7 +3108,7 @@ function Br(e) {
3016
3108
  return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
3017
3109
  }
3018
3110
  function _() {
3019
- o.value = !1, v(zr);
3111
+ o.value = !1, v(Gr);
3020
3112
  }
3021
3113
  function v(e) {
3022
3114
  y(), a.value = !0, c = setTimeout(() => {
@@ -3039,42 +3131,42 @@ function Br(e) {
3039
3131
  }
3040
3132
  //#endregion
3041
3133
  //#region src/components/viewer-core/useMasonryList.ts
3042
- var Vr = 600, Hr = 24, Ur = 16, Wr = 300, Gr = 200, Kr = 200, qr = Hr + Ur, Jr = 200, Yr = 300, Xr = 24, Zr = 48, Qr = 500, $r = 1e3;
3043
- function ei(e) {
3044
- let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Wr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(Wr, a.value - Hr * 2)), h = i(() => mr(m.value, Wr)), g = i(() => hr(m.value, h.value, Wr, Ur)), v = i(() => ti(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => vr({
3134
+ var qr = 600, Jr = 24, Yr = 16, Xr = 300, Zr = 200, Qr = 200, $r = Jr + Yr, ei = 200, ti = 300, ni = 24, ri = 48, ii = 500, ai = 1e3;
3135
+ function oi(e) {
3136
+ let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Xr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(Xr, a.value - Jr * 2)), h = i(() => br(m.value, Xr)), g = i(() => xr(m.value, h.value, Xr, Yr)), v = i(() => si(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => wr({
3045
3137
  itemCount: e.items.value.length,
3046
3138
  viewportHeight: r.value,
3047
3139
  scrollTop: n.value,
3048
- overscanPx: Gr,
3049
- bucketPx: Vr,
3140
+ overscanPx: Zr,
3141
+ bucketPx: qr,
3050
3142
  buckets: c.value
3051
3143
  })), b = i(() => y.value.map((t) => ({
3052
3144
  item: e.items.value[t],
3053
3145
  index: t
3054
3146
  }))), C = i(() => {
3055
- let e = l.value + Hr * 2, t = d.value ?? 0;
3056
- return Math.max(e, t, r.value) + Jr;
3057
- }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ri({
3147
+ let e = l.value + Jr * 2, t = d.value ?? 0;
3148
+ return Math.max(e, t, r.value) + ei;
3149
+ }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => li({
3058
3150
  active: e.active.value,
3059
3151
  maxScrollTop: se(),
3060
3152
  progressDistancePx: n.value,
3061
- thresholdPx: Kr,
3153
+ thresholdPx: Qr,
3062
3154
  triggerEnabled: w.value
3063
- })), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ni({
3155
+ })), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ci({
3064
3156
  active: e.active.value,
3065
3157
  maxScrollTop: se(),
3066
3158
  progressDistancePx: n.value,
3067
- thresholdPx: qr,
3159
+ thresholdPx: $r,
3068
3160
  triggerEnabled: e.hasPreviousPage.value
3069
- })), k = i(() => Math.max(0, r.value - Xr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
3161
+ })), k = i(() => Math.max(0, r.value - ni * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
3070
3162
  if (!A.value) return 0;
3071
3163
  let e = r.value / C.value * k.value;
3072
- return Math.min(k.value, Math.max(Zr, e));
3164
+ return Math.min(k.value, Math.max(ri, e));
3073
3165
  }), M = i(() => {
3074
- if (!A.value) return Xr;
3166
+ if (!A.value) return ni;
3075
3167
  let e = Math.max(0, C.value - r.value);
3076
- return Xr + Math.max(0, k.value - j.value) * (e > 0 ? ti(n.value / e, 0, 1) : 0);
3077
- }), N = jr({
3168
+ return ni + Math.max(0, k.value - j.value) * (e > 0 ? si(n.value / e, 0, 1) : 0);
3169
+ }), N = Lr({
3078
3170
  items: e.items,
3079
3171
  visibleIndices: y,
3080
3172
  positions: o,
@@ -3083,27 +3175,27 @@ function ei(e) {
3083
3175
  columnWidth: g,
3084
3176
  scrollTop: n,
3085
3177
  viewportHeight: r
3086
- }), P = Br({
3178
+ }), P = Kr({
3087
3179
  direction: "top",
3088
3180
  getAnimationLockMs(e) {
3089
- return Math.max(Qr, Or(e)) + $r;
3181
+ return Math.max(ii, Pr(e)) + ai;
3090
3182
  },
3091
3183
  hasPage: e.hasPreviousPage,
3092
3184
  interactionLocked: p,
3093
3185
  isAtBoundary() {
3094
- return n.value <= qr;
3186
+ return n.value <= $r;
3095
3187
  },
3096
3188
  loading: e.loading,
3097
3189
  requestPage: e.requestPreviousPage
3098
- }), F = Br({
3190
+ }), F = Kr({
3099
3191
  direction: "bottom",
3100
3192
  getAnimationLockMs(e) {
3101
- return Or(e) + $r;
3193
+ return Pr(e) + ai;
3102
3194
  },
3103
3195
  hasPage: w,
3104
3196
  interactionLocked: p,
3105
3197
  isAtBoundary() {
3106
- return oe() <= Kr;
3198
+ return oe() <= Qr;
3107
3199
  },
3108
3200
  loading: e.loading,
3109
3201
  requestPage: e.requestNextPage
@@ -3113,7 +3205,7 @@ function ei(e) {
3113
3205
  h,
3114
3206
  g
3115
3207
  ], async ([t], [r = []]) => {
3116
- let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = yr(a, u.value, o.value), l = X(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
3208
+ let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = Tr(a, u.value, o.value), l = ue(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
3117
3209
  let t = $(e);
3118
3210
  if (f.has(t)) return [];
3119
3211
  let n = c.get(t), r = l.get(t);
@@ -3122,15 +3214,15 @@ function ei(e) {
3122
3214
  item: e,
3123
3215
  position: n
3124
3216
  }];
3125
- }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Hr + Ur, b = h && n.value > Hr + Ur ? t[v.value] : null, x = b ? $(b) : null;
3126
- y && K(kr() + $r), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? Qr : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
3217
+ }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Jr + Yr, b = h && n.value > Jr + Yr ? t[v.value] : null, x = b ? $(b) : null;
3218
+ y && K(Fr() + ai), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? ii : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
3127
3219
  }, { immediate: !0 }), L([
3128
3220
  () => e.pendingAppendItems.value.map((e) => $(e)),
3129
3221
  h,
3130
3222
  g,
3131
3223
  r
3132
3224
  ], ([t]) => {
3133
- de(), t.length && (d.value = le([...e.items.value, ...e.pendingAppendItems.value]), ue());
3225
+ de(), t.length && (d.value = le([...e.items.value, ...e.pendingAppendItems.value]), X());
3134
3226
  }, { immediate: !0 }), L(() => e.active.value, async (e, i) => {
3135
3227
  let a = t.value;
3136
3228
  if (!a) return;
@@ -3140,7 +3232,7 @@ function ei(e) {
3140
3232
  }
3141
3233
  if (i !== !1 || f.value == null) return;
3142
3234
  await _();
3143
- let o = Math.max(0, C.value - r.value), s = ti(f.value, 0, o);
3235
+ let o = Math.max(0, C.value - r.value), s = si(f.value, 0, o);
3144
3236
  a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
3145
3237
  }), L(() => e.loading.value, async (t) => {
3146
3238
  !t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
@@ -3152,16 +3244,16 @@ function ei(e) {
3152
3244
  I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
3153
3245
  });
3154
3246
  function te() {
3155
- let t = _r(e.items.value, {
3247
+ let t = Cr(e.items.value, {
3156
3248
  columnCount: h.value,
3157
3249
  columnWidth: g.value,
3158
- gapX: Ur,
3159
- gapY: Ur,
3160
- bucketPx: Vr
3250
+ gapX: Yr,
3251
+ gapY: Yr,
3252
+ bucketPx: qr
3161
3253
  });
3162
3254
  o.value = t.positions.map((e) => ({
3163
- x: e.x + Hr,
3164
- y: e.y + Hr
3255
+ x: e.x + Jr,
3256
+ y: e.y + Jr
3165
3257
  })), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
3166
3258
  }
3167
3259
  function V() {
@@ -3186,7 +3278,7 @@ function ei(e) {
3186
3278
  let a = t.value, c = o.value[e], l = s.value[e];
3187
3279
  if (!a || !c || !l) return;
3188
3280
  let u = a.scrollTop, d = Math.max(0, C.value - r.value);
3189
- i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Hr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Hr), a.scrollTop = ti(u, 0, d), n.value = a.scrollTop, q();
3281
+ i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Jr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Jr), a.scrollTop = si(u, 0, d), n.value = a.scrollTop, q();
3190
3282
  }
3191
3283
  function ne(e, r) {
3192
3284
  let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
@@ -3219,7 +3311,7 @@ function ei(e) {
3219
3311
  e.setActiveIndex(i);
3220
3312
  }
3221
3313
  function re() {
3222
- let t = n.value <= qr, r = oe() <= Kr;
3314
+ let t = n.value <= $r, r = oe() <= Qr;
3223
3315
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
3224
3316
  }
3225
3317
  function J() {
@@ -3229,31 +3321,31 @@ function ei(e) {
3229
3321
  r.value = ie(), a.value = ae();
3230
3322
  }
3231
3323
  function ie() {
3232
- return Pr(t.value, r.value);
3324
+ return Br(t.value, r.value);
3233
3325
  }
3234
3326
  function ae() {
3235
- return Fr(t.value, a.value, Wr);
3327
+ return Vr(t.value, a.value, Xr);
3236
3328
  }
3237
3329
  function oe() {
3238
- return Ir(t.value, n.value, r.value, C.value);
3330
+ return Hr(t.value, n.value, r.value, C.value);
3239
3331
  }
3240
3332
  function se() {
3241
3333
  let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
3242
3334
  return Math.max(0, e - r.value);
3243
3335
  }
3244
3336
  function ce() {
3245
- return Lr(j.value, M.value);
3337
+ return Ur(j.value, M.value);
3246
3338
  }
3247
3339
  function le(e) {
3248
- return e.length ? _r(e, {
3340
+ return e.length ? Cr(e, {
3249
3341
  columnCount: h.value,
3250
3342
  columnWidth: g.value,
3251
- gapX: Ur,
3252
- gapY: Ur,
3253
- bucketPx: Vr
3254
- }).contentHeight + Hr * 2 : 0;
3343
+ gapX: Yr,
3344
+ gapY: Yr,
3345
+ bucketPx: qr
3346
+ }).contentHeight + Jr * 2 : 0;
3255
3347
  }
3256
- function X(e) {
3348
+ function ue(e) {
3257
3349
  let t = /* @__PURE__ */ new Map();
3258
3350
  for (let n of e) {
3259
3351
  let e = $(n), r = u.value.get(e);
@@ -3263,7 +3355,7 @@ function ei(e) {
3263
3355
  }
3264
3356
  return t;
3265
3357
  }
3266
- function ue() {
3358
+ function X() {
3267
3359
  let t = e.commitPendingAppend.value;
3268
3360
  typeof t == "function" && (z = setTimeout(async () => {
3269
3361
  z = null, ee = !0;
@@ -3273,7 +3365,7 @@ function ei(e) {
3273
3365
  } finally {
3274
3366
  d.value = null, ee = !1;
3275
3367
  }
3276
- }, Yr));
3368
+ }, ti));
3277
3369
  }
3278
3370
  function de() {
3279
3371
  z &&= (clearTimeout(z), null);
@@ -3300,27 +3392,27 @@ function ei(e) {
3300
3392
  scrollViewportRef: t
3301
3393
  };
3302
3394
  }
3303
- function ti(e, t, n) {
3395
+ function si(e, t, n) {
3304
3396
  return Math.min(Math.max(e, t), n);
3305
3397
  }
3306
- function ni(e) {
3398
+ function ci(e) {
3307
3399
  if (!e.active || !e.triggerEnabled) return 0;
3308
3400
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3309
- return t <= 0 ? 1 : ti(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3401
+ return t <= 0 ? 1 : si(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
3310
3402
  }
3311
- function ri(e) {
3403
+ function li(e) {
3312
3404
  if (!e.active || !e.triggerEnabled) return 0;
3313
3405
  let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
3314
- return t <= 0 ? 1 : ti(e.progressDistancePx / t, 0, 1);
3406
+ return t <= 0 ? 1 : si(e.progressDistancePx / t, 0, 1);
3315
3407
  }
3316
3408
  //#endregion
3317
3409
  //#region src/components/viewer-core/listCardAsset.ts
3318
- function ii(e) {
3410
+ function ui(e) {
3319
3411
  if (e) try {
3320
3412
  e.removeAttribute("src"), e.src = "";
3321
3413
  } catch {}
3322
3414
  }
3323
- function ai(e) {
3415
+ function di(e) {
3324
3416
  if (e) {
3325
3417
  try {
3326
3418
  e.currentTime = 0;
@@ -3331,12 +3423,12 @@ function ai(e) {
3331
3423
  } catch {}
3332
3424
  }
3333
3425
  }
3334
- function oi(e, t) {
3426
+ function fi(e, t) {
3335
3427
  if (t) return e.bottom > t.top && e.top < t.bottom;
3336
3428
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
3337
3429
  return e.bottom > 0 && e.top < n;
3338
3430
  }
3339
- function si(e) {
3431
+ function pi(e) {
3340
3432
  if (!e) return null;
3341
3433
  try {
3342
3434
  return new URL(e, window.location.href).href;
@@ -3346,9 +3438,9 @@ function si(e) {
3346
3438
  }
3347
3439
  //#endregion
3348
3440
  //#region src/components/viewer-core/listPreview.ts
3349
- var ci = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, li = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, ui = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
3350
- function di(e) {
3351
- let t = fi(e), n = t?.url, r = pr(e), i = e.title?.trim() || kt(e.type);
3441
+ var mi = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, hi = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, gi = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
3442
+ function _i(e) {
3443
+ let t = vi(e), n = t?.url, r = yr(e), i = e.title?.trim() || Pt(e.type);
3352
3444
  return t?.mediaType === "video" && typeof n == "string" ? {
3353
3445
  kind: "video",
3354
3446
  url: n,
@@ -3367,13 +3459,13 @@ function di(e) {
3367
3459
  width: r.width,
3368
3460
  height: r.height,
3369
3461
  label: i
3370
- } : typeof n == "string" && mi(e, n) ? {
3462
+ } : typeof n == "string" && bi(e, n) ? {
3371
3463
  kind: "video",
3372
3464
  url: n,
3373
3465
  width: r.width,
3374
3466
  height: r.height,
3375
3467
  label: i
3376
- } : typeof n == "string" && pi(e, n) ? {
3468
+ } : typeof n == "string" && yi(e, n) ? {
3377
3469
  kind: "image",
3378
3470
  url: n,
3379
3471
  width: r.width,
@@ -3387,26 +3479,26 @@ function di(e) {
3387
3479
  label: i
3388
3480
  };
3389
3481
  }
3390
- function fi(e) {
3482
+ function vi(e) {
3391
3483
  return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
3392
3484
  }
3393
- function pi(e, t) {
3394
- return e.type !== "image" || typeof t != "string" ? !1 : ci.test(t) || hi(t);
3485
+ function yi(e, t) {
3486
+ return e.type !== "image" || typeof t != "string" ? !1 : mi.test(t) || xi(t);
3395
3487
  }
3396
- function mi(e, t) {
3397
- return e.type !== "video" || typeof t != "string" ? !1 : li.test(t) || gi(t);
3488
+ function bi(e, t) {
3489
+ return e.type !== "video" || typeof t != "string" ? !1 : hi.test(t) || Si(t);
3398
3490
  }
3399
- function hi(e) {
3491
+ function xi(e) {
3400
3492
  return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
3401
3493
  }
3402
- function gi(e) {
3403
- return ui.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3494
+ function Si(e) {
3495
+ return gi.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3404
3496
  }
3405
3497
  //#endregion
3406
3498
  //#region src/components/viewer-core/useListCardHealthCheck.ts
3407
- function _i(e) {
3499
+ function Ci(e) {
3408
3500
  let t = D(null), n = i(() => {
3409
- let t = typeof e.item.value.healthCheck?.url == "string" ? si(e.item.value.healthCheck.url) : null;
3501
+ let t = typeof e.item.value.healthCheck?.url == "string" ? pi(e.item.value.healthCheck.url) : null;
3410
3502
  return !t || t === e.attachedAssetUrl.value ? null : t;
3411
3503
  }), r = null, a = 0, o = /* @__PURE__ */ new Map();
3412
3504
  L(n, (e, n) => {
@@ -3438,7 +3530,7 @@ function _i(e) {
3438
3530
  r.refresh();
3439
3531
  return;
3440
3532
  }
3441
- r = Mt.request({
3533
+ r = Lt.request({
3442
3534
  assetType: "probe",
3443
3535
  getPriority: e.getPriority,
3444
3536
  onGrant() {
@@ -3448,7 +3540,7 @@ function _i(e) {
3448
3540
  return;
3449
3541
  }
3450
3542
  let i = ++a;
3451
- sn(r).then((s) => {
3543
+ fn(r).then((s) => {
3452
3544
  if (!(i !== a || n.value !== r)) {
3453
3545
  if (o.set(r, s ?? null), !s) {
3454
3546
  t.value = null;
@@ -3484,14 +3576,14 @@ function _i(e) {
3484
3576
  }
3485
3577
  //#endregion
3486
3578
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
3487
- var vi = ["aria-label"], yi = {
3579
+ var wi = ["aria-label"], Ti = {
3488
3580
  key: 0,
3489
3581
  "data-testid": "vibe-list-card-spinner",
3490
3582
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
3491
- }, bi = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, xi = ["src", "alt"], Si = ["src"], Ci = ["data-kind"], wi = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ti = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Ei = {
3583
+ }, Ei = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Di = ["src", "alt"], Oi = ["src"], ki = ["data-kind"], Ai = { class: "grid justify-items-center gap-3 px-4 text-center" }, ji = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Mi = {
3492
3584
  key: 4,
3493
3585
  class: "grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
3494
- }, Di = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Oi = { class: "pointer-events-none absolute inset-0 z-[3]" }, ki = /* @__PURE__ */ d({
3586
+ }, Ni = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Pi = { class: "pointer-events-none absolute inset-0 z-[3]" }, Fi = /* @__PURE__ */ d({
3495
3587
  __name: "ListCard",
3496
3588
  props: {
3497
3589
  active: {
@@ -3515,16 +3607,16 @@ var vi = ["aria-label"], yi = {
3515
3607
  },
3516
3608
  emits: ["open"],
3517
3609
  setup(e, { emit: t }) {
3518
- let n = e, r = t, l = i(() => di(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = _i({
3610
+ let n = e, r = t, l = i(() => _i(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = Ci({
3519
3611
  attachedAssetUrl: E,
3520
- getPriority: X,
3612
+ getPriority: ue,
3521
3613
  isInView: d,
3522
3614
  isReady: m,
3523
3615
  item: i(() => n.item),
3524
3616
  loadErrorKind: g,
3525
3617
  reportAssetError: n.reportAssetError,
3526
3618
  surfaceActive: i(() => n.surfaceActive)
3527
- }), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => an(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
3619
+ }), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => un(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
3528
3620
  L([E, () => l.value.kind], () => {
3529
3621
  let e = l.value.kind === "fallback";
3530
3622
  m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
@@ -3559,13 +3651,13 @@ var vi = ["aria-label"], yi = {
3559
3651
  re(), F.release(), te?.disconnect(), te = null;
3560
3652
  });
3561
3653
  function U() {
3562
- ue(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), J());
3654
+ X(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), J());
3563
3655
  }
3564
3656
  async function W() {
3565
- if (!ue(_.value)) return;
3657
+ if (!X(_.value)) return;
3566
3658
  let e = E.value ?? n.item.url;
3567
3659
  m.value = !1, g.value = "generic";
3568
- let t = await on(e);
3660
+ let t = await dn(e);
3569
3661
  g.value = t, n.reportAssetError?.({
3570
3662
  item: n.item,
3571
3663
  occurrenceKey: $(n.item),
@@ -3575,10 +3667,10 @@ var vi = ["aria-label"], yi = {
3575
3667
  }), J();
3576
3668
  }
3577
3669
  function ne() {
3578
- ue(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), J(), q());
3670
+ X(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), J(), q());
3579
3671
  }
3580
3672
  function G() {
3581
- ue(C.value) && (h.value || (m.value = !1));
3673
+ X(C.value) && (h.value || (m.value = !1));
3582
3674
  }
3583
3675
  function K() {
3584
3676
  if (l.value.kind === "fallback") {
@@ -3597,9 +3689,9 @@ var vi = ["aria-label"], yi = {
3597
3689
  V?.refresh();
3598
3690
  return;
3599
3691
  }
3600
- V = Mt.request({
3692
+ V = Lt.request({
3601
3693
  assetType: l.value.kind,
3602
- getPriority: X,
3694
+ getPriority: ue,
3603
3695
  onGrant() {
3604
3696
  T.value = !0, m.value = !1, g.value = null;
3605
3697
  },
@@ -3614,7 +3706,7 @@ var vi = ["aria-label"], yi = {
3614
3706
  return;
3615
3707
  }
3616
3708
  if (E.value && d.value && m.value) {
3617
- e.muted = !0, e.loop = !0, e.playsInline = !0, un(e);
3709
+ e.muted = !0, e.loop = !0, e.playsInline = !0, hn(e);
3618
3710
  return;
3619
3711
  }
3620
3712
  try {
@@ -3635,7 +3727,7 @@ var vi = ["aria-label"], yi = {
3635
3727
  d.value = !0;
3636
3728
  return;
3637
3729
  }
3638
- d.value = oi(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
3730
+ d.value = fi(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
3639
3731
  }
3640
3732
  function ie(e) {
3641
3733
  if (!e) return;
@@ -3655,12 +3747,12 @@ var vi = ["aria-label"], yi = {
3655
3747
  }), g.value = null, m.value = !1, T.value = !1, J(), K();
3656
3748
  }
3657
3749
  function se() {
3658
- ii(_.value);
3750
+ ui(_.value);
3659
3751
  }
3660
3752
  function ce() {
3661
- ai(C.value);
3753
+ di(C.value);
3662
3754
  }
3663
- function X() {
3755
+ function ue() {
3664
3756
  let e = y.value;
3665
3757
  if (!e) return Infinity;
3666
3758
  let t = e.getBoundingClientRect();
@@ -3671,9 +3763,9 @@ var vi = ["aria-label"], yi = {
3671
3763
  let n = window.innerHeight / 2;
3672
3764
  return Math.abs((t.top + t.bottom) / 2 - n);
3673
3765
  }
3674
- function ue(e) {
3675
- let t = si(E.value);
3676
- return !e || !t ? !1 : si("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3766
+ function X(e) {
3767
+ let t = pi(E.value);
3768
+ return !e || !t ? !1 : pi("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3677
3769
  }
3678
3770
  function de() {
3679
3771
  r("open");
@@ -3701,8 +3793,8 @@ var vi = ["aria-label"], yi = {
3701
3793
  class: "absolute inset-0 z-[1] block h-full w-full cursor-pointer text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
3702
3794
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
3703
3795
  onClick: de
3704
- }, null, 8, vi),
3705
- B.value ? (w(), s("div", yi, [c("span", bi, [u(N(oe), {
3796
+ }, null, 8, wi),
3797
+ B.value ? (w(), s("div", Ti, [c("span", Ei, [u(N(oe), {
3706
3798
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
3707
3799
  "aria-hidden": "true"
3708
3800
  })])])) : o("", !0),
@@ -3716,7 +3808,7 @@ var vi = ["aria-label"], yi = {
3716
3808
  class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
3717
3809
  onLoad: U,
3718
3810
  onError: W
3719
- }, null, 42, xi)) : P.value && E.value && !R.value ? (w(), s("video", {
3811
+ }, null, 42, Di)) : P.value && E.value && !R.value ? (w(), s("video", {
3720
3812
  key: 2,
3721
3813
  ref_key: "videoRef",
3722
3814
  ref: C,
@@ -3732,31 +3824,31 @@ var vi = ["aria-label"], yi = {
3732
3824
  onPlaying: ne,
3733
3825
  onStalled: G,
3734
3826
  onWaiting: G
3735
- }, null, 42, Si)) : R.value ? (w(), s("div", {
3827
+ }, null, 42, Oi)) : R.value ? (w(), s("div", {
3736
3828
  key: 3,
3737
3829
  "data-testid": "vibe-list-card-error",
3738
3830
  "data-kind": I.value,
3739
3831
  class: "pointer-events-none relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
3740
- }, [c("div", wi, [
3832
+ }, [c("div", Ai, [
3741
3833
  u(N(le), {
3742
3834
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3743
3835
  "aria-hidden": "true"
3744
3836
  }),
3745
- c("span", Ti, j(N(rn)(I.value)), 1),
3837
+ c("span", ji, j(N(ln)(I.value)), 1),
3746
3838
  z.value ? (w(), s("button", {
3747
3839
  key: 0,
3748
3840
  type: "button",
3749
3841
  class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-3 py-2 text-[0.62rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
3750
3842
  onClick: ee(ae, ["stop"])
3751
3843
  }, " Retry ")) : o("", !0)
3752
- ])], 8, Ci)) : (w(), s("div", Ei, [c("div", Di, [k(e.$slots, "item-icon", {
3753
- icon: N(Ot)(n.item.type),
3844
+ ])], 8, ki)) : (w(), s("div", Mi, [c("div", Ni, [k(e.$slots, "item-icon", {
3845
+ icon: N(Nt)(n.item.type),
3754
3846
  item: n.item
3755
- }, () => [(w(), a(A(N(Ot)(n.item.type)), {
3847
+ }, () => [(w(), a(A(N(Nt)(n.item.type)), {
3756
3848
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3757
3849
  "aria-hidden": "true"
3758
3850
  }))])])])),
3759
- c("div", Oi, [k(e.$slots, "grid-item-overlay", {
3851
+ c("div", Pi, [k(e.$slots, "grid-item-overlay", {
3760
3852
  active: n.active,
3761
3853
  focused: f.value,
3762
3854
  hovered: p.value,
@@ -3766,24 +3858,24 @@ var vi = ["aria-label"], yi = {
3766
3858
  })])
3767
3859
  ], 34));
3768
3860
  }
3769
- }), Ai = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, ji = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Mi = {
3861
+ }), Ii = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, Li = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Ri = {
3770
3862
  "data-testid": "vibe-pagination",
3771
3863
  class: "inline-flex shrink-0 items-center gap-2 whitespace-nowrap border border-white/14 bg-black/40 px-3 py-2 text-[0.63rem] font-bold uppercase tracking-[0.12em] text-[#f7f1ea]/72 backdrop-blur-[18px] min-[721px]:gap-3 min-[721px]:px-4 min-[721px]:py-3 min-[721px]:text-[0.74rem] min-[721px]:tracking-[0.2em]"
3772
- }, Ni = { class: "whitespace-nowrap" }, Pi = {
3864
+ }, zi = { class: "whitespace-nowrap" }, Bi = {
3773
3865
  key: 0,
3774
3866
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
3775
- }, Fi = [
3867
+ }, Vi = [
3776
3868
  "data-active",
3777
3869
  "data-index",
3778
3870
  "data-item-id",
3779
3871
  "data-occurrence-key"
3780
- ], Ii = ["data-item-id"], Li = {
3872
+ ], Hi = ["data-item-id"], Ui = {
3781
3873
  key: 0,
3782
3874
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
3783
- }, Ri = {
3875
+ }, Wi = {
3784
3876
  key: 1,
3785
3877
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
3786
- }, zi = { class: "mx-auto flex w-full justify-center" }, Bi = /* @__PURE__ */ d({
3878
+ }, Gi = { class: "mx-auto flex w-full justify-center" }, Ki = /* @__PURE__ */ d({
3787
3879
  __name: "ListSurface",
3788
3880
  props: {
3789
3881
  active: {
@@ -3844,7 +3936,7 @@ var vi = ["aria-label"], yi = {
3844
3936
  "update:activeIndex"
3845
3937
  ],
3846
3938
  setup(e, { emit: n }) {
3847
- let r = e, d = F(), f = n, p = ei({
3939
+ let r = e, d = F(), f = n, p = oi({
3848
3940
  active: M(r, "active"),
3849
3941
  allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
3850
3942
  items: M(r, "items"),
@@ -3860,11 +3952,11 @@ var vi = ["aria-label"], yi = {
3860
3952
  setActiveIndex(e) {
3861
3953
  f("update:activeIndex", e);
3862
3954
  }
3863
- }), m = i(() => Jt({
3955
+ }), m = i(() => $t({
3864
3956
  itemCount: r.items.length,
3865
3957
  loading: r.loading,
3866
3958
  phase: r.phase
3867
- })), h = i(() => Yt({
3959
+ })), h = i(() => en({
3868
3960
  errorMessage: r.errorMessage,
3869
3961
  hasItems: r.items.length > 0,
3870
3962
  hasNextPage: r.hasNextPage,
@@ -3877,7 +3969,7 @@ var vi = ["aria-label"], yi = {
3877
3969
  message: h.value.message,
3878
3970
  paginationDetail: r.paginationDetail,
3879
3971
  total: r.items.length
3880
- }), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => Ut(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Kt({
3972
+ }), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => Jt(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Zt({
3881
3973
  emptyStateMode: M(r, "emptyStateMode"),
3882
3974
  itemCount: C,
3883
3975
  loading: M(r, "loading"),
@@ -3889,8 +3981,8 @@ var vi = ["aria-label"], yi = {
3889
3981
  nextBoundaryLoadProgress: e,
3890
3982
  previousBoundaryLoadProgress: t
3891
3983
  });
3892
- }, { immediate: !0 }), (e, n) => (w(), s("div", Ai, [
3893
- c("div", ji, [c("span", Mi, [c("span", Ni, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Pi, j(r.paginationDetail), 1)) : o("", !0)])]),
3984
+ }, { immediate: !0 }), (e, n) => (w(), s("div", Ii, [
3985
+ c("div", Li, [c("span", Ri, [c("span", zi, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Bi, j(r.paginationDetail), 1)) : o("", !0)])]),
3894
3986
  c("div", {
3895
3987
  ref: N(p).scrollViewportRef,
3896
3988
  "data-testid": "vibe-list-scroll",
@@ -3911,7 +4003,7 @@ var vi = ["aria-label"], yi = {
3911
4003
  "data-occurrence-key": N($)(t),
3912
4004
  class: "absolute will-change-transform",
3913
4005
  style: b(N(p).getCardStyle(n))
3914
- }, [u(ki, {
4006
+ }, [u(Fi, {
3915
4007
  active: n === N(p).resolvedActiveIndex.value,
3916
4008
  index: n,
3917
4009
  item: t,
@@ -3935,14 +4027,14 @@ var vi = ["aria-label"], yi = {
3935
4027
  "report-asset-load",
3936
4028
  "surface-active",
3937
4029
  "onOpen"
3938
- ])], 12, Fi))), 128)),
4030
+ ])], 12, Vi))), 128)),
3939
4031
  (w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
3940
4032
  key: `leaving-${N($)(t.item)}`,
3941
4033
  "data-testid": "vibe-list-card-leaving",
3942
4034
  "data-item-id": t.item.id,
3943
4035
  class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
3944
4036
  style: b(N(p).getLeavingCardStyle(t.item))
3945
- }, [u(ki, {
4037
+ }, [u(Fi, {
3946
4038
  active: !1,
3947
4039
  index: -1,
3948
4040
  item: t.item,
@@ -3957,8 +4049,8 @@ var vi = ["aria-label"], yi = {
3957
4049
  "item",
3958
4050
  "report-asset-error",
3959
4051
  "report-asset-load"
3960
- ])], 12, Ii))), 128)),
3961
- N(A) && N(T) ? (w(), a(On, {
4052
+ ])], 12, Hi))), 128)),
4053
+ N(A) && N(T) ? (w(), a(Pn, {
3962
4054
  key: 0,
3963
4055
  message: N(T).message,
3964
4056
  mode: N(T).mode,
@@ -3972,12 +4064,12 @@ var vi = ["aria-label"], yi = {
3972
4064
  "surface"
3973
4065
  ])) : o("", !0)
3974
4066
  ], 4)], 544),
3975
- N(p).showScrollbar.value ? (w(), s("div", Li, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
4067
+ N(p).showScrollbar.value ? (w(), s("div", Ui, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3976
4068
  "data-testid": "vibe-list-scrollbar-thumb",
3977
4069
  class: v(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", r.loading ? "bg-white/52" : "bg-white/34"]),
3978
4070
  style: b(N(p).getScrollbarThumbStyle())
3979
4071
  }, null, 6)])) : o("", !0),
3980
- d["grid-footer"] ? (w(), s("div", Ri, [c("div", zi, [k(e.$slots, "grid-footer")])])) : o("", !0),
4072
+ d["grid-footer"] ? (w(), s("div", Wi, [c("div", Gi, [k(e.$slots, "grid-footer")])])) : o("", !0),
3981
4073
  _.value ? (w(), s("div", {
3982
4074
  key: 2,
3983
4075
  class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
@@ -3986,7 +4078,7 @@ var vi = ["aria-label"], yi = {
3986
4078
  "data-testid": "vibe-grid-status-badge",
3987
4079
  class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", _.value.kind === "end" ? "border-amber-300/35 text-amber-200" : _.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
3988
4080
  }, j(_.value.message), 3))], 2)) : o("", !0),
3989
- N(E) && N(T) ? (w(), a(On, {
4081
+ N(E) && N(T) ? (w(), a(Pn, {
3990
4082
  key: 3,
3991
4083
  class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
3992
4084
  message: N(T).message,
@@ -4003,13 +4095,13 @@ var vi = ["aria-label"], yi = {
4003
4095
  ])) : o("", !0)
4004
4096
  ]));
4005
4097
  }
4006
- }), Vi = ["data-surface-mode"], Hi = {
4098
+ }), qi = ["data-surface-mode"], Ji = {
4007
4099
  key: 1,
4008
4100
  class: "absolute left-5 top-5 z-30 border border-amber-400/45 bg-black/35 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-amber-100 backdrop-blur"
4009
- }, Ui = ["data-visible", "inert"], Wi = ["data-visible", "inert"], Gi = {
4101
+ }, Yi = ["data-visible", "inert"], Xi = ["data-visible", "inert"], Zi = {
4010
4102
  key: 3,
4011
4103
  class: "relative z-[1] grid h-full w-full content-center justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
4012
- }, Ki = /* @__PURE__ */ d({
4104
+ }, Qi = /* @__PURE__ */ d({
4013
4105
  name: "VibeLayout",
4014
4106
  __name: "Layout",
4015
4107
  props: {
@@ -4034,7 +4126,7 @@ var vi = ["aria-label"], yi = {
4034
4126
  "update:surfaceMode"
4035
4127
  ],
4036
4128
  setup(e, { expose: n, emit: i }) {
4037
- let d = e, f = F(), m = i, h = Qe(d, m), g = fe((e) => {
4129
+ let d = e, f = F(), m = i, h = rt(d, m), g = fe((e) => {
4038
4130
  m("asset-errors", e);
4039
4131
  }), _ = Z((e) => {
4040
4132
  m("asset-loads", e);
@@ -4065,7 +4157,7 @@ var vi = ["aria-label"], yi = {
4065
4157
  type: "button",
4066
4158
  class: "absolute left-5 top-5 z-30 inline-flex items-center border border-rose-400/55 bg-rose-500/18 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-white backdrop-blur transition hover:bg-rose-500/28",
4067
4159
  onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
4068
- }, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Hi, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
4160
+ }, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Ji, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
4069
4161
  appear: "",
4070
4162
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
4071
4163
  "enter-from-class": "translate-y-3 opacity-0",
@@ -4079,7 +4171,7 @@ var vi = ["aria-label"], yi = {
4079
4171
  "data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
4080
4172
  inert: N(h).surfaceMode.value !== "list",
4081
4173
  class: "absolute inset-0 z-[2]"
4082
- }, [u(Bi, {
4174
+ }, [u(Ki, {
4083
4175
  active: N(h).surfaceMode.value === "list",
4084
4176
  "allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
4085
4177
  items: N(h).items.value,
@@ -4149,7 +4241,7 @@ var vi = ["aria-label"], yi = {
4149
4241
  "onBoundaryLoadProgress",
4150
4242
  "onOpenFullscreen",
4151
4243
  "onUpdate:activeIndex"
4152
- ])], 8, Ui), [[I, N(h).surfaceMode.value === "list"]])]),
4244
+ ])], 8, Yi), [[I, N(h).surfaceMode.value === "list"]])]),
4153
4245
  _: 3
4154
4246
  }), u(r, {
4155
4247
  appear: "",
@@ -4165,7 +4257,7 @@ var vi = ["aria-label"], yi = {
4165
4257
  "data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
4166
4258
  inert: N(h).surfaceMode.value !== "fullscreen",
4167
4259
  class: "absolute inset-0 z-[3]"
4168
- }, [u(ur, {
4260
+ }, [u(gr, {
4169
4261
  items: N(h).items.value,
4170
4262
  active: N(h).surfaceMode.value === "fullscreen",
4171
4263
  "active-index": N(h).activeIndex.value,
@@ -4234,12 +4326,12 @@ var vi = ["aria-label"], yi = {
4234
4326
  "show-back-to-list",
4235
4327
  "onBackToList",
4236
4328
  "onUpdate:activeIndex"
4237
- ])], 8, Wi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
4329
+ ])], 8, Xi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
4238
4330
  _: 3
4239
- })], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Gi, [u(N(oe), {
4331
+ })], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Zi, [u(N(oe), {
4240
4332
  class: "size-10 animate-spin text-[#f7f1ea]/82",
4241
4333
  "aria-hidden": "true"
4242
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(ur, {
4334
+ }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(gr, {
4243
4335
  key: 4,
4244
4336
  items: N(h).items.value,
4245
4337
  active: !0,
@@ -4307,10 +4399,10 @@ var vi = ["aria-label"], yi = {
4307
4399
  "show-status-badges",
4308
4400
  "onBackToList",
4309
4401
  "onUpdate:activeIndex"
4310
- ]))], 8, Vi));
4402
+ ]))], 8, qi));
4311
4403
  }
4312
- }), qi = { install(e) {
4313
- e.component("VibeLayout", Ki);
4404
+ }), $i = { install(e) {
4405
+ e.component("VibeLayout", Qi);
4314
4406
  } };
4315
4407
  //#endregion
4316
- export { Ki as VibeLayout, qi as VibePlugin, qi as default };
4408
+ export { Qi as VibeLayout, $i as VibePlugin, $i as default };