@wyxos/vibe 3.0.4 → 3.0.6

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
@@ -1,12 +1,12 @@
1
- import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, isVNode as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, reactive as C, readonly as w, ref as T, renderList as E, renderSlot as D, resolveDynamicComponent as O, toDisplayString as k, toRef as A, unref as j, useSlots as M, vShow as N, watch as P, watchEffect as F, withCtx as I, withDirectives as L, withModifiers as ee } from "vue";
1
+ import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, isVNode as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, reactive as C, readonly as w, ref as T, renderList as E, renderSlot as D, resolveDynamicComponent as O, toDisplayString as k, toRef as A, unref as j, useAttrs as M, useSlots as N, vShow as P, watch as F, watchEffect as I, withCtx as L, withDirectives as R, withModifiers as z } from "vue";
2
2
  //#region node_modules/lucide-vue-next/dist/esm/shared/src/utils/hasA11yProp.js
3
- var R = (e) => {
3
+ var B = (e) => {
4
4
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
5
5
  return !1;
6
- }, z = (e) => e === "", B = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), V = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), H = (e) => {
7
- let t = te(e);
6
+ }, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), U = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), W = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), G = (e) => {
7
+ let t = W(e);
8
8
  return t.charAt(0).toUpperCase() + t.slice(1);
9
- }, U = {
9
+ }, K = {
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
11
  width: 24,
12
12
  height: 24,
@@ -16,27 +16,27 @@ var R = (e) => {
16
16
  "stroke-width": 2,
17
17
  "stroke-linecap": "round",
18
18
  "stroke-linejoin": "round"
19
- }, W = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = U.width, color: s = U.stroke, ...c }, { slots: l }) => p("svg", {
20
- ...U,
19
+ }, q = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = K.width, color: s = K.stroke, ...c }, { slots: l }) => p("svg", {
20
+ ...K,
21
21
  ...c,
22
22
  width: o,
23
23
  height: o,
24
24
  stroke: s,
25
- "stroke-width": z(n) || z(r) || n === !0 || r === !0 ? Number(i || a || U["stroke-width"]) * 24 / Number(o) : i || a || U["stroke-width"],
26
- class: B("lucide", c.class, ...e ? [`lucide-${V(H(e))}-icon`, `lucide-${V(e)}`] : ["lucide-icon"]),
27
- ...!l.default && !R(c) && { "aria-hidden": "true" }
28
- }, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), G = (e, t) => (n, { slots: r, attrs: i }) => p(W, {
25
+ "stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a || K["stroke-width"]) * 24 / Number(o) : i || a || K["stroke-width"],
26
+ class: H("lucide", c.class, ...e ? [`lucide-${U(G(e))}-icon`, `lucide-${U(e)}`] : ["lucide-icon"]),
27
+ ...!l.default && !B(c) && { "aria-hidden": "true" }
28
+ }, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), J = (e, t) => (n, { slots: r, attrs: i }) => p(q, {
29
29
  ...i,
30
30
  ...n,
31
31
  iconNode: t,
32
32
  name: e
33
- }, r), K = G("arrow-left", [["path", {
33
+ }, r), Y = J("arrow-left", [["path", {
34
34
  d: "m12 19-7-7 7-7",
35
35
  key: "1l729n"
36
36
  }], ["path", {
37
37
  d: "M19 12H5",
38
38
  key: "x3x0zl"
39
- }]]), q = G("audio-lines", [
39
+ }]]), X = J("audio-lines", [
40
40
  ["path", {
41
41
  d: "M2 10v3",
42
42
  key: "1fnikh"
@@ -61,7 +61,7 @@ var R = (e) => {
61
61
  d: "M22 10v3",
62
62
  key: "154ddg"
63
63
  }]
64
- ]), J = G("clapperboard", [
64
+ ]), ee = J("clapperboard", [
65
65
  ["path", {
66
66
  d: "m12.296 3.464 3.02 3.956",
67
67
  key: "qash78"
@@ -78,13 +78,13 @@ var R = (e) => {
78
78
  d: "m6.18 5.276 3.1 3.899",
79
79
  key: "zjj9t3"
80
80
  }]
81
- ]), Y = G("file", [["path", {
81
+ ]), te = J("file", [["path", {
82
82
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
83
83
  key: "1oefj6"
84
84
  }], ["path", {
85
85
  d: "M14 2v5a1 1 0 0 0 1 1h5",
86
86
  key: "wfsgrz"
87
- }]]), ne = G("image-plus", [
87
+ }]]), ne = J("image-plus", [
88
88
  ["path", {
89
89
  d: "M16 5h6",
90
90
  key: "1vod17"
@@ -107,10 +107,10 @@ var R = (e) => {
107
107
  r: "2",
108
108
  key: "af1f0g"
109
109
  }]
110
- ]), re = G("loader-circle", [["path", {
110
+ ]), re = J("loader-circle", [["path", {
111
111
  d: "M21 12a9 9 0 1 1-6.219-8.56",
112
112
  key: "13zald"
113
- }]]), ie = G("pause", [["rect", {
113
+ }]]), ie = J("pause", [["rect", {
114
114
  x: "14",
115
115
  y: "3",
116
116
  width: "5",
@@ -124,10 +124,10 @@ var R = (e) => {
124
124
  height: "18",
125
125
  rx: "1",
126
126
  key: "1wsw3u"
127
- }]]), ae = G("play", [["path", {
127
+ }]]), ae = J("play", [["path", {
128
128
  d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
129
129
  key: "10ikf1"
130
- }]]), oe = G("triangle-alert", [
130
+ }]]), oe = J("triangle-alert", [
131
131
  ["path", {
132
132
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
133
133
  key: "wmoenq"
@@ -141,10 +141,10 @@ var R = (e) => {
141
141
  key: "p32p05"
142
142
  }]
143
143
  ]);
144
- function se(e, t = 150) {
144
+ function Z(e, t = 150) {
145
145
  return ce(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
146
146
  }
147
- function X(e, t = 150) {
147
+ function se(e, t = 150) {
148
148
  return ce(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
149
149
  }
150
150
  function ce(e, t, n) {
@@ -171,57 +171,29 @@ function ce(e, t, n) {
171
171
  }
172
172
  //#endregion
173
173
  //#region src/components/viewer-core/dom.ts
174
- function le(e) {
174
+ function Q(e) {
175
175
  return e instanceof HTMLElement && [
176
176
  "INPUT",
177
177
  "TEXTAREA",
178
178
  "SELECT"
179
179
  ].includes(e.tagName);
180
180
  }
181
- function Z(e) {
181
+ function le(e) {
182
182
  return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
183
183
  }
184
184
  //#endregion
185
- //#region src/components/viewer-core/itemIdentity.ts
186
- var ue = "__vibeOccurrenceKey";
187
- function Q(e) {
188
- let t = e[ue];
189
- return typeof t == "string" && t.length > 0 ? t : e.id;
190
- }
191
- function de(e, t, n) {
192
- let r = /* @__PURE__ */ new Map(), i = [], a = n;
193
- for (let e of t) {
194
- let t = r.get(e.id), n = Q(e);
195
- t ? t.push(n) : r.set(e.id, [n]);
196
- }
197
- for (let t of e) {
198
- let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
199
- i.push(fe(t, e));
200
- }
201
- return {
202
- items: i,
203
- nextSequence: a
204
- };
205
- }
206
- function fe(e, t) {
207
- return Q(e) === t ? e : {
208
- ...e,
209
- [ue]: t
210
- };
211
- }
212
- //#endregion
213
185
  //#region src/components/viewer-core/removalState.ts
214
- function pe() {
186
+ function ue() {
215
187
  let e = T(/* @__PURE__ */ new Set()), t = T([]);
216
188
  function n(n) {
217
- let r = me(n).filter((t) => !e.value.has(t));
189
+ let r = de(n).filter((t) => !e.value.has(t));
218
190
  if (!r.length) return { ids: [] };
219
191
  let i = new Set(e.value);
220
192
  for (let e of r) i.add(e);
221
193
  return e.value = i, t.value = [...t.value, r], { ids: r };
222
194
  }
223
195
  function r(t) {
224
- let n = me(t).filter((t) => e.value.has(t));
196
+ let n = de(t).filter((t) => e.value.has(t));
225
197
  if (!n.length) return { ids: [] };
226
198
  let r = new Set(e.value);
227
199
  for (let e of n) r.delete(e);
@@ -252,11 +224,39 @@ function pe() {
252
224
  undo: i
253
225
  };
254
226
  }
255
- function me(e) {
227
+ function de(e) {
256
228
  let t = Array.isArray(e) ? e : [e];
257
229
  return Array.from(new Set(t.filter((e) => typeof e == "string" && e.length > 0)));
258
230
  }
259
231
  //#endregion
232
+ //#region src/components/viewer-core/itemIdentity.ts
233
+ var fe = "__vibeOccurrenceKey";
234
+ function $(e) {
235
+ let t = e[fe];
236
+ return typeof t == "string" && t.length > 0 ? t : e.id;
237
+ }
238
+ function pe(e, t, n) {
239
+ let r = /* @__PURE__ */ new Map(), i = [], a = n;
240
+ for (let e of t) {
241
+ let t = r.get(e.id), n = $(e);
242
+ t ? t.push(n) : r.set(e.id, [n]);
243
+ }
244
+ for (let t of e) {
245
+ let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
246
+ i.push(me(t, e));
247
+ }
248
+ return {
249
+ items: i,
250
+ nextSequence: a
251
+ };
252
+ }
253
+ function me(e, t) {
254
+ return $(e) === t ? e : {
255
+ ...e,
256
+ [fe]: t
257
+ };
258
+ }
259
+ //#endregion
260
260
  //#region src/components/viewer-core/autoBuckets.ts
261
261
  function he(e) {
262
262
  return e.flatMap((e) => e.items);
@@ -285,14 +285,14 @@ function be(e, t, n) {
285
285
  return i >= 0 && r.splice(i, 1, n), r;
286
286
  }
287
287
  function xe(e, t, n) {
288
- let r = de(e, t, n);
288
+ let r = pe(e, t, n);
289
289
  return {
290
290
  items: r.items,
291
291
  nextSequence: r.nextSequence
292
292
  };
293
293
  }
294
294
  function Se(e) {
295
- return e === "filling" || e === "loading" || e === "reloading";
295
+ return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
296
296
  }
297
297
  function Ce(e) {
298
298
  return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
@@ -350,11 +350,11 @@ function ke(e) {
350
350
  }
351
351
  function Ae(e, t) {
352
352
  let n = e[Te(t, 0, Math.max(0, e.length - 1))];
353
- return n ? Q(n) : null;
353
+ return n ? $(n) : null;
354
354
  }
355
355
  function je(e, t, n = null) {
356
356
  if (!e.length) return 0;
357
- let r = n ? e.findIndex((e) => Q(e) === n) : -1;
357
+ let r = n ? e.findIndex((e) => $(e) === n) : -1;
358
358
  return r >= 0 ? r : Te(t, 0, e.length - 1);
359
359
  }
360
360
  function Me(e, t, n) {
@@ -399,386 +399,368 @@ function Re() {
399
399
  //#endregion
400
400
  //#region src/components/viewer-core/useAutoResolveSource.ts
401
401
  function ze(e) {
402
- let t = T([]), n = T(0), r = T([]), a = T(null), o = T("idle"), s = T(null), c = Re(), l = c.remainingMs, u = T(null), d = T(!1), f = T(!0), p = /* @__PURE__ */ new Set(), m = null, h = null, g = 0, _ = 0, v = i(() => Le(e.fillDelayMs, Ne)), y = i(() => Le(e.fillDelayStepMs, Pe)), S = i(() => e.mode ?? "dynamic"), C = i(() => Ce(e.pageSize)), w = i(() => he(t.value)), E = i(() => ge(w.value, e.removedIds.value)), D = i(() => n.value), O = i(() => Se(o.value) || d.value), k = i(() => t.value[0] ?? null), A = i(() => t.value[t.value.length - 1] ?? null), j = i(() => A.value?.nextCursor ?? null), M = i(() => k.value?.previousCursor ?? null), N = i(() => !!j.value), F = i(() => !!M.value), I = i(() => t.value.length > 0), L = i(() => ge(he(r.value), e.removedIds.value)), ee = i(() => ye(t.value, e.removedIds.value, D.value)), R = i(() => !E.value.length && !O.value && !!a.value);
403
- P(() => E.value.length, (e) => {
402
+ let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u = Re(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = /* @__PURE__ */ new Set(), g = null, _ = null, v = 0, y = 0, S = i(() => Le(e.fillDelayMs, Ne)), C = i(() => Le(e.fillDelayStepMs, Pe)), w = i(() => typeof e.resolve == "function"), E = i(() => e.mode ?? "dynamic"), D = i(() => Ce(e.pageSize)), O = i(() => he(n.value)), k = i(() => ge(O.value, e.removedIds.value)), A = i(() => r.value), j = i(() => Se(c.value) || p.value), M = i(() => Be(n.value, e.removedIds.value)), N = i(() => Ve(n.value, e.removedIds.value)), P = i(() => N.value?.nextCursor ?? null), I = i(() => o.value ? null : M.value?.previousCursor ?? null), L = i(() => !!P.value), R = i(() => !!I.value), z = i(() => w.value && n.value.length > 0), B = i(() => ge(he(a.value), e.removedIds.value)), V = i(() => ye(n.value, e.removedIds.value, A.value)), H = i(() => !k.value.length && !j.value && !!s.value);
403
+ F(() => k.value.length, (e) => {
404
404
  if (e === 0) {
405
- n.value = 0;
405
+ r.value = 0;
406
406
  return;
407
407
  }
408
- n.value > e - 1 && (n.value = e - 1);
409
- }), P(() => n.value, () => {
410
- f.value && ne();
408
+ o.value &&= (fe(), !1), r.value > e - 1 && (r.value = e - 1);
409
+ }), F(() => r.value, () => {
410
+ m.value && ie();
411
411
  }), x(() => {
412
- e.resolve && (ce() || z());
412
+ le() || e.resolve && U();
413
413
  }), b(() => {
414
- m?.abort(), m = null, c.clear(!0);
414
+ g?.abort(), g = null, u.clear(!0);
415
415
  });
416
- async function z() {
417
- h = z;
418
- let r = await oe({
419
- continueUntilFilled: S.value === "dynamic",
416
+ async function U() {
417
+ _ = U;
418
+ let t = await se({
419
+ continueUntilFilled: E.value === "dynamic",
420
420
  cursor: e.initialCursor ?? null,
421
421
  direction: "forward",
422
- phase: "loading"
422
+ phase: "initializing"
423
423
  });
424
- r && (t.value = r.buckets, n.value = 0, X());
424
+ t && (n.value = t.buckets, r.value = 0, Q());
425
425
  }
426
- async function B() {
427
- if (!O.value) {
428
- if (!N.value) return I.value ? ae("trailing") : void 0;
429
- if (S.value === "static" && Z("trailing")) return ae("trailing");
430
- await re(j.value);
426
+ async function W() {
427
+ if (!j.value) {
428
+ if (!L.value) return z.value ? Z("trailing") : void 0;
429
+ if (E.value === "static" && de("trailing")) return Z("trailing");
430
+ await ae(P.value);
431
431
  }
432
432
  }
433
- async function V() {
434
- if (!(!F.value || O.value)) {
435
- if (S.value === "static" && Z("leading")) return ae("leading");
436
- await ie(M.value);
433
+ async function G() {
434
+ if (!(!R.value || j.value)) {
435
+ if (E.value === "static" && de("leading")) return Z("leading");
436
+ await oe(I.value);
437
437
  }
438
438
  }
439
- async function te() {
440
- if (R.value) {
441
- if (t.value = [], n.value = 0, r.value = [], a.value = null, o.value = "idle", s.value = null, u.value = null, d.value = !1, p.clear(), m?.abort(), m = null, c.clear(!0), ce()) {
442
- X();
439
+ async function K() {
440
+ if (H.value) {
441
+ if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = w.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, h.clear(), g?.abort(), g = null, u.clear(!0), le()) {
442
+ Q();
443
443
  return;
444
444
  }
445
- await z();
445
+ await U();
446
446
  }
447
447
  }
448
- async function H() {
449
- if (R.value) return te();
450
- o.value !== "failed" || !h || (a.value = null, await h());
448
+ async function q() {
449
+ if (H.value) return K();
450
+ c.value !== "failed" || !_ || (s.value = null, await _());
451
451
  }
452
- async function U() {
453
- if (!r.value.length) return d.value = !1, X();
454
- t.value = [...t.value, ...r.value], r.value = [], d.value = !1, X();
452
+ async function J() {
453
+ if (!a.value.length) return p.value = !1, Q();
454
+ n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
455
455
  }
456
- function W(t) {
457
- let r = E.value;
458
- if (!r.length) return;
459
- let i = Te(t, 0, r.length - 1);
460
- i !== n.value && (n.value = i, e.emit("update:activeIndex", i));
456
+ function Y(t) {
457
+ let n = k.value;
458
+ if (!n.length) return;
459
+ let i = Te(t, 0, n.length - 1);
460
+ i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
461
461
  }
462
- function G(e) {
463
- f.value = e;
462
+ function X(e) {
463
+ m.value = e;
464
464
  }
465
- function K() {
466
- g += 1, m?.abort(), m = null, c.clear(!0), p.clear(), a.value = null, s.value = null, u.value = null, r.value.length > 0 && (t.value = [...t.value, ...r.value], r.value = []), d.value = !1, X();
465
+ function ee() {
466
+ v += 1, g?.abort(), g = null, u.clear(!0), h.clear(), s.value = null, l.value = null, f.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), p.value = !1, o.value = !1, Q();
467
467
  }
468
- function q() {
469
- return Ae(E.value, D.value);
468
+ function te() {
469
+ return Ae(k.value, A.value);
470
470
  }
471
- function J(e = null) {
472
- n.value = je(E.value, D.value, e);
471
+ function ne(e = null) {
472
+ if (k.value.length === 0) {
473
+ r.value = 0, n.value.length > 0 && (o.value = !0);
474
+ return;
475
+ }
476
+ r.value = je(k.value, A.value, e);
473
477
  }
474
- function Y() {
475
- r.value.length > 0 && !L.value.length && U();
478
+ function re() {
479
+ a.value.length > 0 && !B.value.length && J();
476
480
  }
477
- async function ne() {
478
- !E.value.length || le() || (F.value && n.value < 3 && await V(), N.value && n.value >= E.value.length - 3 && await B());
481
+ async function ie() {
482
+ !k.value.length || ue() || (R.value && r.value < 3 && await G(), L.value && r.value >= k.value.length - 3 && await W());
479
483
  }
480
- async function re(e) {
481
- h = async () => {
482
- await re(e);
484
+ async function ae(e) {
485
+ _ = async () => {
486
+ await ae(e);
483
487
  };
484
- let n = await oe({
485
- continueUntilFilled: S.value === "dynamic",
488
+ let t = await se({
489
+ continueUntilFilled: E.value === "dynamic",
486
490
  cursor: e,
487
491
  direction: "forward",
488
492
  phase: "loading"
489
493
  });
490
- if (n) {
491
- if (n.canceled) return t.value = [...t.value, ...n.buckets], r.value = [], d.value = !1, X();
492
- if (r.value = n.buckets, !L.value.length) return t.value = [...t.value, ...r.value], r.value = [], d.value = !1, X();
493
- d.value = !0;
494
+ if (t) {
495
+ if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1, Q();
496
+ if (a.value = t.buckets, !B.value.length) return n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
497
+ p.value = !0;
494
498
  }
495
499
  }
496
- async function ie(e) {
497
- h = async () => {
498
- await ie(e);
500
+ async function oe(e) {
501
+ _ = async () => {
502
+ await oe(e);
499
503
  };
500
- let n = await oe({
501
- continueUntilFilled: S.value === "dynamic",
504
+ let t = await se({
505
+ continueUntilFilled: E.value === "dynamic",
502
506
  cursor: e,
503
507
  direction: "backward",
504
508
  phase: "loading"
505
509
  });
506
- if (!n) return;
507
- let r = q();
508
- t.value = [...n.buckets, ...t.value], J(r), X();
510
+ if (!t) return;
511
+ let r = te();
512
+ n.value = [...t.buckets, ...n.value], ne(r), Q();
509
513
  }
510
- async function ae(n) {
511
- if (h = async () => {
512
- await ae(n);
514
+ async function Z(t) {
515
+ if (_ = async () => {
516
+ await Z(t);
513
517
  }, !e.resolve) return;
514
- let r = n === "leading" ? k.value : A.value;
518
+ let r = t === "leading" ? M.value : N.value;
515
519
  if (!r) return;
516
520
  let i = we(r.cursor);
517
- if (p.has(i)) return;
518
- p.add(i), a.value = null, o.value = "reloading", s.value = null, u.value = null;
519
- let c = ++g, l = typeof AbortController > "u" ? null : new AbortController();
520
- m = l;
521
+ if (h.has(i)) return;
522
+ h.add(i), s.value = null, c.value = "refreshing", l.value = null, f.value = null;
523
+ let a = ++v, o = typeof AbortController > "u" ? null : new AbortController();
524
+ g = o;
521
525
  try {
522
- let n = await e.resolve({
526
+ let t = await e.resolve({
523
527
  cursor: r.cursor,
524
- pageSize: C.value,
525
- signal: l?.signal
528
+ pageSize: D.value,
529
+ signal: o?.signal
526
530
  });
527
- if (c !== g) return X();
528
- let i = se({
531
+ if (a !== v) return Q();
532
+ let i = ce({
529
533
  cursor: r.cursor,
530
- nextCursor: n.nextPage,
531
- nextItems: n.items,
532
- previousCursor: n.previousPage ?? null,
534
+ nextCursor: t.nextPage,
535
+ nextItems: t.items,
536
+ previousCursor: t.previousPage ?? null,
533
537
  previousItems: r.items
534
- }), a = q();
535
- t.value = be(t.value, r.cursor, i), J(a), X();
538
+ }), s = te();
539
+ n.value = be(n.value, r.cursor, i), ne(s), Q();
536
540
  } catch (e) {
537
- if (Ee(e) || c !== g) {
538
- X();
541
+ if (Ee(e) || a !== v) {
542
+ Q();
539
543
  return;
540
544
  }
541
- a.value = e instanceof Error ? e.message : "The viewer could not load items.", o.value = "failed", s.value = null, u.value = null;
545
+ s.value = e instanceof Error ? e.message : "The viewer could not load items.", c.value = "failed", l.value = null, f.value = null;
542
546
  } finally {
543
- m === l && (m = null), p.delete(i);
547
+ g === o && (g = null), h.delete(i);
544
548
  }
545
549
  }
546
- async function oe(t) {
550
+ async function se(t) {
547
551
  if (!e.resolve) return null;
548
- let n = ++g, r = /* @__PURE__ */ new Set(), i = [], l = t.cursor, d = 0;
549
- for (a.value = null, o.value = t.phase, s.value = null, u.value = null;;) {
550
- if (n !== g) return Oe(i, t.direction, e.removedIds.value, !0);
551
- let f = we(l);
552
- if (r.has(f) || p.has(f)) break;
553
- r.add(f), p.add(f);
554
- let h = typeof AbortController > "u" ? null : new AbortController();
555
- m = h;
552
+ let n = ++v, r = /* @__PURE__ */ new Set(), i = [], a = t.cursor, o = 0;
553
+ for (s.value = null, c.value = t.phase, l.value = null, f.value = null;;) {
554
+ if (n !== v) return Oe(i, t.direction, e.removedIds.value, !0);
555
+ let d = we(a);
556
+ if (r.has(d) || h.has(d)) break;
557
+ r.add(d), h.add(d);
558
+ let p = typeof AbortController > "u" ? null : new AbortController();
559
+ g = p;
556
560
  try {
557
561
  let r = await e.resolve({
558
- cursor: l,
559
- pageSize: C.value,
560
- signal: h?.signal
562
+ cursor: a,
563
+ pageSize: D.value,
564
+ signal: p?.signal
561
565
  });
562
- if (n !== g) return Oe(i, t.direction, e.removedIds.value, !0);
563
- let a = se({
564
- cursor: l,
566
+ if (n !== v) return Oe(i, t.direction, e.removedIds.value, !0);
567
+ let s = ce({
568
+ cursor: a,
565
569
  nextCursor: r.nextPage,
566
570
  nextItems: r.items,
567
571
  previousCursor: r.previousPage ?? null,
568
572
  previousItems: []
569
573
  });
570
- i.push(a);
571
- let f = i.reduce((t, n) => t + ve(n, e.removedIds.value), 0), p = t.direction === "forward" ? a.nextCursor : a.previousCursor;
572
- if (!t.continueUntilFilled || f >= C.value || !p) return {
574
+ i.push(s);
575
+ let d = i.reduce((t, n) => t + ve(n, e.removedIds.value), 0), m = t.direction === "forward" ? s.nextCursor : s.previousCursor;
576
+ if (!t.continueUntilFilled || d >= D.value || !m) return {
573
577
  canceled: !1,
574
578
  buckets: t.direction === "backward" ? [...i].reverse() : i,
575
- visibleCount: f
579
+ visibleCount: d
576
580
  };
577
- o.value = "filling", s.value = f, u.value = C.value, d += 1;
578
- let m = Ie(d, v.value, y.value);
579
- if (await c.wait(m), n !== g) return Oe(i, t.direction, e.removedIds.value, !0);
580
- l = p;
581
+ c.value = "filling", l.value = d, f.value = D.value, o += 1;
582
+ let h = Ie(o, S.value, C.value);
583
+ if (await u.wait(h), n !== v) return Oe(i, t.direction, e.removedIds.value, !0);
584
+ a = m;
581
585
  } catch (r) {
582
- return Ee(r) || n !== g ? Oe(i, t.direction, e.removedIds.value, !0) : (a.value = r instanceof Error ? r.message : "The viewer could not load items.", o.value = "failed", s.value = null, u.value = null, null);
586
+ return Ee(r) || n !== v ? Oe(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, f.value = null, null);
583
587
  } finally {
584
- m === h && (m = null), p.delete(f);
588
+ g === p && (g = null), h.delete(d);
585
589
  }
586
590
  }
587
591
  return Oe(i, t.direction, e.removedIds.value, !1);
588
592
  }
589
- function se(e) {
593
+ function ce(e) {
590
594
  let t = De({
591
595
  cursor: e.cursor,
592
596
  nextCursor: e.nextCursor,
593
597
  nextItems: e.nextItems,
594
598
  previousCursor: e.previousCursor,
595
599
  previousItems: e.previousItems,
596
- sequence: _
600
+ sequence: y
597
601
  });
598
- return _ = t.nextSequence, t.bucket;
602
+ return y = t.nextSequence, t.bucket;
599
603
  }
600
- function X() {
601
- o.value = "idle", s.value = null, u.value = null, c.clear();
604
+ function Q() {
605
+ c.value = "idle", l.value = null, f.value = null, u.clear();
602
606
  }
603
- function ce() {
607
+ function le() {
604
608
  if (!e.initialState || !e.initialState.items.length) return !1;
605
- let i = ke({
609
+ let t = ke({
606
610
  initialState: e.initialState,
607
611
  removedIds: e.removedIds.value,
608
- sequence: _
612
+ sequence: y
609
613
  });
610
- return t.value = i.buckets, n.value = i.activeIndex, _ = i.nextSequence, a.value = null, r.value = [], d.value = !1, !0;
614
+ return n.value = t.buckets, r.value = t.activeIndex, y = t.nextSequence, o.value = !1, s.value = null, a.value = [], p.value = !1, !0;
611
615
  }
612
- function le() {
613
- return o.value === "loading" && t.value.length === 0 && r.value.length === 0;
616
+ function ue() {
617
+ return c.value === "initializing";
614
618
  }
615
- function Z(t) {
616
- return Me(t === "leading" ? k.value : A.value, e.removedIds.value, C.value);
619
+ function de(t) {
620
+ return Me(t === "leading" ? M.value : N.value, e.removedIds.value, D.value);
621
+ }
622
+ function fe() {
623
+ let t = n.value.findIndex((t) => ve(t, e.removedIds.value) > 0);
624
+ if (t < 0) return;
625
+ let r = t;
626
+ for (let i = n.value.length - 1; i >= t; --i) if (ve(n.value[i], e.removedIds.value) > 0) {
627
+ r = i;
628
+ break;
629
+ }
630
+ n.value = n.value.slice(t, r + 1);
617
631
  }
618
632
  return {
619
- activeIndex: D,
620
- canRetryInitialLoad: R,
621
- cancel: K,
622
- canRefreshTrailingBoundary: I,
623
- commitPendingAppend: U,
624
- currentCursor: ee,
625
- errorMessage: a,
626
- fillCollectedCount: s,
627
- fillDelayRemainingMs: l,
628
- fillTargetCount: u,
629
- hasNextPage: N,
630
- hasPreviousPage: F,
631
- items: E,
632
- loading: O,
633
- mode: S,
634
- nextCursor: j,
635
- pendingAppendItems: L,
636
- phase: o,
637
- prefetchNextPage: B,
638
- prefetchPreviousPage: V,
639
- previousCursor: M,
640
- retryInitialLoad: te,
641
- retry: H,
642
- setActiveIndex: W,
643
- setAutoPrefetchEnabled: G,
644
- syncActiveIndexAfterVisibilityChange: J,
645
- getActiveOccurrenceKey: q,
646
- maybeCommitPendingAppendWhenFilteredOut: Y
633
+ activeIndex: A,
634
+ canRetryInitialLoad: H,
635
+ cancel: ee,
636
+ canRefreshTrailingBoundary: z,
637
+ commitPendingAppend: J,
638
+ currentCursor: V,
639
+ errorMessage: s,
640
+ fillCollectedCount: l,
641
+ fillDelayRemainingMs: d,
642
+ fillTargetCount: f,
643
+ hasNextPage: L,
644
+ hasPreviousPage: R,
645
+ items: k,
646
+ loading: j,
647
+ mode: E,
648
+ nextCursor: P,
649
+ pendingAppendItems: B,
650
+ phase: c,
651
+ prefetchNextPage: W,
652
+ prefetchPreviousPage: G,
653
+ previousCursor: I,
654
+ retryInitialLoad: K,
655
+ retry: q,
656
+ setActiveIndex: Y,
657
+ setAutoPrefetchEnabled: X,
658
+ syncActiveIndexAfterVisibilityChange: ne,
659
+ getActiveOccurrenceKey: te,
660
+ maybeCommitPendingAppendWhenFilteredOut: re
647
661
  };
648
662
  }
663
+ function Be(e, t) {
664
+ return e.find((e) => ve(e, t) > 0) ?? e[0] ?? null;
665
+ }
666
+ function Ve(e, t) {
667
+ for (let n = e.length - 1; n >= 0; --n) {
668
+ let r = e[n];
669
+ if (ve(r, t) > 0) return r;
670
+ }
671
+ return e[e.length - 1] ?? null;
672
+ }
649
673
  //#endregion
650
674
  //#region src/components/viewer-core/useDataSource.ts
651
- function Be(e, t) {
652
- let n = e, r = e, { clearRemoved: a, getRemovedIds: o, remove: s, removedIds: c, restore: l, undo: u } = pe(), d = ze({
675
+ function He(e, t) {
676
+ let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = ue(), l = ze({
653
677
  emit: t,
654
- fillDelayMs: r.fillDelayMs,
655
- fillDelayStepMs: r.fillDelayStepMs,
656
- initialCursor: r.initialCursor,
657
- initialState: r.initialState,
658
- mode: r.mode,
659
- pageSize: r.pageSize,
660
- removedIds: c,
661
- resolve: r.resolve
662
- }), f = !1, p = 0, m = T([]), h = i(() => typeof r.resolve == "function"), g = i(() => c.value.size ? m.value.filter((e) => !c.value.has(e.id)) : m.value), _ = i(() => h.value ? d.items.value : g.value), v = i(() => h.value ? d.activeIndex.value : n.activeIndex ?? 0), y = i(() => h.value ? d.loading.value : n.loading ?? !1), b = i(() => h.value ? d.hasNextPage.value : n.hasNextPage ?? !1), x = i(() => h.value ? d.hasPreviousPage.value : n.hasPreviousPage ?? !1), S = i(() => c.value.size), C = i(() => n.paginationDetail ?? null), w = i(() => h.value ? !d.hasNextPage.value && d.canRefreshTrailingBoundary.value : !1);
663
- P([() => n.items, () => r.resolve], ([e, t]) => {
664
- !Array.isArray(e) || typeof t != "function" || f || (f = !0, console.warn("[Vibe] `resolve` and `items` were both provided. `resolve` mode will be used."));
665
- }, { immediate: !0 }), P(() => n.items ?? [], (e) => {
666
- if (h.value) return;
667
- let t = de(e, m.value, p);
668
- m.value = t.items, p = t.nextSequence;
669
- }, {
670
- deep: !0,
671
- immediate: !0
672
- });
673
- function E(e) {
674
- let r = _.value;
675
- if (!r.length) return;
676
- let i = N(e, 0, r.length - 1);
677
- if (h.value) {
678
- d.setActiveIndex(i);
679
- return;
680
- }
681
- i !== (n.activeIndex ?? 0) && t("update:activeIndex", i);
678
+ fillDelayMs: e.fillDelayMs,
679
+ fillDelayStepMs: e.fillDelayStepMs,
680
+ initialCursor: e.initialCursor,
681
+ initialState: e.initialState,
682
+ mode: e.mode,
683
+ pageSize: e.pageSize,
684
+ removedIds: o,
685
+ resolve: e.resolve
686
+ }), u = l.items, d = l.activeIndex, f = l.loading, p = l.hasNextPage, m = l.hasPreviousPage, h = i(() => o.value.size), g = i(() => e.paginationDetail ?? null), _ = i(() => !l.hasNextPage.value && l.canRefreshTrailingBoundary.value);
687
+ function v(e) {
688
+ let t = u.value;
689
+ t.length && l.setActiveIndex(C(e, 0, t.length - 1));
682
690
  }
683
- function D(e) {
684
- let t = j(), n = s(e);
685
- return n.ids.length ? h.value ? (d.maybeCommitPendingAppendWhenFilteredOut(), d.syncActiveIndexAfterVisibilityChange(t), n) : (M(t), n) : n;
691
+ function y(e) {
692
+ let t = l.getActiveOccurrenceKey(), n = a(e);
693
+ return n.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t), n) : n;
686
694
  }
687
- function O(e) {
688
- let t = j(), n = l(e);
689
- return n.ids.length ? h.value ? (d.syncActiveIndexAfterVisibilityChange(t), n) : (M(t), n) : n;
695
+ function b(e) {
696
+ let t = l.getActiveOccurrenceKey(), n = s(e);
697
+ return n.ids.length && l.syncActiveIndexAfterVisibilityChange(t), n;
690
698
  }
691
- function k() {
692
- let e = j(), t = u();
693
- return t?.ids.length ? h.value ? (d.syncActiveIndexAfterVisibilityChange(e), t) : (M(e), t) : t;
699
+ function x() {
700
+ let e = l.getActiveOccurrenceKey(), t = c();
701
+ return t?.ids.length && l.syncActiveIndexAfterVisibilityChange(e), t;
694
702
  }
695
- function A() {
696
- let e = j();
697
- if (a(), h.value) {
698
- d.syncActiveIndexAfterVisibilityChange(e);
699
- return;
700
- }
701
- M(e);
703
+ function S() {
704
+ let e = l.getActiveOccurrenceKey();
705
+ n(), l.syncActiveIndexAfterVisibilityChange(e);
702
706
  }
703
- function j() {
704
- let e = _.value[N(v.value, 0, Math.max(0, _.value.length - 1))];
705
- return e ? Q(e) : null;
706
- }
707
- function M(e = null) {
708
- if (!_.value.length) return;
709
- let r = e ? _.value.findIndex((t) => Q(t) === e) : -1, i = r >= 0 ? r : N(v.value, 0, _.value.length - 1);
710
- i !== (n.activeIndex ?? 0) && t("update:activeIndex", i);
711
- }
712
- function N(e, t, n) {
707
+ function C(e, t, n) {
713
708
  return Math.min(Math.max(e, t), n);
714
709
  }
715
- function F() {
716
- h.value && d.cancel();
710
+ function w() {
711
+ l.cancel();
717
712
  }
718
- async function I() {
719
- if (h.value) {
720
- await d.prefetchNextPage();
721
- return;
722
- }
723
- y.value || typeof n.requestNextPage != "function" || await n.requestNextPage();
713
+ async function T() {
714
+ await l.prefetchNextPage();
724
715
  }
725
- async function L() {
726
- if (h.value) {
727
- await d.prefetchPreviousPage();
728
- return;
729
- }
730
- y.value || typeof n.requestPreviousPage != "function" || await n.requestPreviousPage();
716
+ async function E() {
717
+ await l.prefetchPreviousPage();
731
718
  }
732
- async function ee() {
733
- h.value && await d.retry();
719
+ async function D() {
720
+ await l.retry();
734
721
  }
735
722
  return {
736
- activeIndex: v,
737
- canRefreshExhaustedNextPage: w,
738
- canRetryInitialLoad: i(() => h.value ? d.canRetryInitialLoad.value : !1),
739
- cancel: F,
740
- clearRemoved: A,
741
- commitPendingAppend: d.commitPendingAppend,
742
- currentCursor: i(() => h.value ? d.currentCursor.value : null),
743
- errorMessage: i(() => h.value ? d.errorMessage.value : null),
744
- fillCollectedCount: i(() => h.value ? d.fillCollectedCount.value : null),
745
- fillDelayRemainingMs: i(() => h.value ? d.fillDelayRemainingMs.value : null),
746
- fillTargetCount: i(() => h.value ? d.fillTargetCount.value : null),
747
- getRemovedIds: o,
748
- hasNextPage: b,
749
- hasPreviousPage: x,
750
- isAutoMode: h,
751
- items: _,
752
- loading: y,
753
- loadNext: I,
754
- loadPrevious: L,
755
- mode: i(() => h.value ? d.mode.value : null),
756
- nextCursor: i(() => h.value ? d.nextCursor.value : null),
757
- paginationDetail: C,
758
- pendingAppendItems: d.pendingAppendItems,
759
- phase: i(() => h.value ? d.phase.value : y.value ? "loading" : "idle"),
760
- prefetchNextPage: h.value ? d.prefetchNextPage : async () => {
761
- y.value || typeof n.requestNextPage != "function" || await n.requestNextPage();
762
- },
763
- prefetchPreviousPage: h.value ? d.prefetchPreviousPage : async () => {
764
- y.value || typeof n.requestPreviousPage != "function" || await n.requestPreviousPage();
765
- },
766
- previousCursor: i(() => h.value ? d.previousCursor.value : null),
767
- removedCount: S,
768
- remove: D,
769
- restore: O,
770
- retry: ee,
771
- retryInitialLoad: d.retryInitialLoad,
772
- setActiveIndex: E,
773
- setAutoPrefetchEnabled: d.setAutoPrefetchEnabled,
774
- undo: k
723
+ activeIndex: d,
724
+ canRefreshExhaustedNextPage: _,
725
+ canRetryInitialLoad: l.canRetryInitialLoad,
726
+ cancel: w,
727
+ clearRemoved: S,
728
+ commitPendingAppend: l.commitPendingAppend,
729
+ currentCursor: l.currentCursor,
730
+ errorMessage: l.errorMessage,
731
+ fillCollectedCount: l.fillCollectedCount,
732
+ fillDelayRemainingMs: l.fillDelayRemainingMs,
733
+ fillTargetCount: l.fillTargetCount,
734
+ getRemovedIds: r,
735
+ hasNextPage: p,
736
+ hasPreviousPage: m,
737
+ items: u,
738
+ loading: f,
739
+ loadNext: T,
740
+ loadPrevious: E,
741
+ mode: l.mode,
742
+ nextCursor: l.nextCursor,
743
+ paginationDetail: g,
744
+ pendingAppendItems: l.pendingAppendItems,
745
+ phase: l.phase,
746
+ prefetchNextPage: l.prefetchNextPage,
747
+ prefetchPreviousPage: l.prefetchPreviousPage,
748
+ previousCursor: l.previousCursor,
749
+ removedCount: h,
750
+ remove: y,
751
+ restore: b,
752
+ retry: D,
753
+ retryInitialLoad: l.retryInitialLoad,
754
+ setActiveIndex: v,
755
+ setAutoPrefetchEnabled: l.setAutoPrefetchEnabled,
756
+ undo: x
775
757
  };
776
758
  }
777
759
  //#endregion
778
760
  //#region src/components/viewer-core/useController.ts
779
- var Ve = 1024;
780
- function He(e, t) {
781
- let n = Be(e, t), r = T(0), a = T("list"), o = T(0), s = C({
761
+ var Ue = 1024;
762
+ function We(e, t) {
763
+ let n = He(e, t), r = T(0), a = T("list"), o = C({
782
764
  activeIndex: 0,
783
765
  currentCursor: null,
784
766
  errorMessage: null,
@@ -787,66 +769,72 @@ function He(e, t) {
787
769
  fillTargetCount: null,
788
770
  hasNextPage: !1,
789
771
  hasPreviousPage: !1,
790
- isAutoMode: !1,
791
772
  itemCount: 0,
792
773
  loadState: "loaded",
793
- mode: null,
774
+ mode: "dynamic",
794
775
  nextCursor: null,
795
776
  phase: "idle",
796
777
  previousCursor: null,
797
778
  removedCount: 0,
779
+ removedIds: [],
798
780
  surfaceMode: "list"
799
- }), c = i(() => r.value >= Ve), l = i(() => c.value ? a.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
800
- P(c, (e, t) => {
801
- e && !t && a.value === "list" && (o.value += 1);
802
- }), P([l, () => n.pendingAppendItems.value.length], ([e, t]) => {
781
+ }), s = i(() => r.value >= Ue), c = i(() => s.value ? a.value : "fullscreen"), l = i(() => s.value && c.value === "fullscreen");
782
+ F(s, (e) => {
783
+ e && m();
784
+ }), F(() => e.surfaceMode, () => {
785
+ m();
786
+ }), F([c, () => n.pendingAppendItems.value.length], ([e, t]) => {
803
787
  e === "list" || t <= 0 || n.commitPendingAppend();
804
- }), P(l, (e) => {
788
+ }), F(() => n.items.value.length, (e) => {
789
+ !s.value || e > 0 || a.value === "list" || (a.value = "list", t("update:surfaceMode", "list"));
790
+ }), F(c, (e) => {
805
791
  n.setAutoPrefetchEnabled(e === "fullscreen");
806
- }, { immediate: !0 }), F(() => {
807
- s.activeIndex = n.activeIndex.value, s.currentCursor = n.currentCursor.value, s.errorMessage = n.errorMessage.value, s.fillCollectedCount = n.fillCollectedCount.value, s.fillDelayRemainingMs = n.fillDelayRemainingMs.value, s.fillTargetCount = n.fillTargetCount.value, s.hasNextPage = n.hasNextPage.value, s.hasPreviousPage = n.hasPreviousPage.value, s.isAutoMode = n.isAutoMode.value, s.itemCount = n.items.value.length, s.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", s.mode = n.mode.value, s.nextCursor = n.nextCursor.value, s.phase = n.phase.value, s.previousCursor = n.previousCursor.value, s.removedCount = n.removedCount.value, s.surfaceMode = l.value;
792
+ }, { immediate: !0 }), I(() => {
793
+ o.activeIndex = n.activeIndex.value, o.currentCursor = n.currentCursor.value, o.errorMessage = n.errorMessage.value, o.fillCollectedCount = n.fillCollectedCount.value, o.fillDelayRemainingMs = n.fillDelayRemainingMs.value, o.fillTargetCount = n.fillTargetCount.value, o.hasNextPage = n.hasNextPage.value, o.hasPreviousPage = n.hasPreviousPage.value, o.itemCount = n.items.value.length, o.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", o.mode = n.mode.value, o.nextCursor = n.nextCursor.value, o.phase = n.phase.value, o.previousCursor = n.previousCursor.value, o.removedCount = n.removedCount.value, o.removedIds = n.getRemovedIds(), o.surfaceMode = c.value;
808
794
  }), x(() => {
809
- m(), window.addEventListener("keydown", p), window.addEventListener("resize", m);
795
+ p(), m(), window.addEventListener("keydown", f), window.addEventListener("resize", p);
810
796
  }), b(() => {
811
- window.removeEventListener("keydown", p), window.removeEventListener("resize", m);
797
+ window.removeEventListener("keydown", f), window.removeEventListener("resize", p);
812
798
  });
813
- function d(e) {
814
- n.setActiveIndex(e), c.value && (a.value = "fullscreen");
799
+ function u(e) {
800
+ n.setActiveIndex(e), s.value && a.value !== "fullscreen" && (a.value = "fullscreen", t("update:surfaceMode", "fullscreen"));
815
801
  }
816
- function f() {
817
- c.value && (a.value = "list", o.value += 1);
802
+ function d() {
803
+ !s.value || a.value === "list" || (a.value = "list", t("update:surfaceMode", "list"));
818
804
  }
819
- function p(e) {
820
- e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" || le(e.target) || (e.preventDefault(), f());
805
+ function f(e) {
806
+ e.defaultPrevented || e.key !== "Escape" || !s.value || c.value !== "fullscreen" || Q(e.target) || (e.preventDefault(), d());
821
807
  }
822
- function m() {
808
+ function p() {
823
809
  r.value = window.innerWidth || 0;
824
810
  }
811
+ function m() {
812
+ !s.value || !e.surfaceMode || e.surfaceMode === a.value || (a.value = e.surfaceMode);
813
+ }
825
814
  return {
826
815
  ...n,
827
816
  cancel: n.cancel,
828
- isDesktop: c,
829
- listRestoreToken: o,
817
+ isDesktop: s,
830
818
  loadNext: n.loadNext,
831
819
  loadPrevious: n.loadPrevious,
832
- openFullscreen: d,
833
- returnToList: f,
820
+ openFullscreen: u,
821
+ returnToList: d,
834
822
  retry: n.retry,
835
- showBackToList: u,
836
- status: w(s),
837
- surfaceMode: l
823
+ showBackToList: l,
824
+ status: w(o),
825
+ surfaceMode: c
838
826
  };
839
827
  }
840
828
  //#endregion
841
829
  //#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
842
- var Ue = {
830
+ var Ge = {
843
831
  "data-testid": "vibe-media-bar",
844
832
  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]"
845
- }, We = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, Ge = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ke = { class: "relative h-4 w-full" }, qe = [
833
+ }, Ke = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, qe = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Je = { class: "relative h-4 w-full" }, Ye = [
846
834
  "max",
847
835
  "value",
848
836
  "disabled"
849
- ], Je = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ye = /* @__PURE__ */ d({
837
+ ], Xe = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ze = /* @__PURE__ */ d({
850
838
  __name: "FullscreenMediaBar",
851
839
  props: {
852
840
  currentTime: {},
@@ -858,9 +846,9 @@ var Ue = {
858
846
  emits: ["seek-input"],
859
847
  setup(e, { emit: t }) {
860
848
  let n = e, r = t;
861
- return (e, t) => (S(), s("div", Ue, [c("div", We, [
862
- c("span", Ge, k(n.currentTimeLabel), 1),
863
- c("div", Ke, [
849
+ return (e, t) => (S(), s("div", Ge, [c("div", Ke, [
850
+ c("span", qe, k(n.currentTimeLabel), 1),
851
+ c("div", Je, [
864
852
  t[1] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
865
853
  c("div", {
866
854
  class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
@@ -877,25 +865,25 @@ var Ue = {
877
865
  disabled: n.duration <= 0,
878
866
  class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
879
867
  onInput: t[0] ||= (e) => r("seek-input", e)
880
- }, null, 40, qe)
868
+ }, null, 40, Ye)
881
869
  ]),
882
- c("span", Je, k(n.durationLabel), 1)
870
+ c("span", Xe, k(n.durationLabel), 1)
883
871
  ])]));
884
872
  }
885
- }), Xe = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, Ze = { class: "grid gap-4" }, Qe = { class: "flex min-h-11 items-center justify-between gap-4" }, $e = { class: "min-w-0 flex flex-1 items-center gap-3" }, et = {
873
+ }), Qe = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, $e = { class: "grid gap-4" }, et = { class: "flex min-h-11 items-center justify-between gap-4" }, tt = { class: "min-w-0 flex flex-1 items-center gap-3" }, nt = {
886
874
  key: 1,
887
875
  "data-testid": "vibe-title",
888
876
  class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
889
- }, tt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, nt = {
877
+ }, rt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, it = {
890
878
  "data-testid": "vibe-pagination",
891
879
  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]"
892
- }, rt = { class: "whitespace-nowrap" }, it = {
880
+ }, at = { class: "whitespace-nowrap" }, ot = {
893
881
  key: 0,
894
882
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
895
- }, at = {
883
+ }, st = {
896
884
  key: 0,
897
885
  class: "grid gap-2 max-[720px]:justify-items-start"
898
- }, ot = /* @__PURE__ */ d({
886
+ }, ct = /* @__PURE__ */ d({
899
887
  __name: "FullscreenHeader",
900
888
  props: {
901
889
  currentIndex: {},
@@ -908,31 +896,161 @@ var Ue = {
908
896
  emits: ["back-to-list"],
909
897
  setup(e, { emit: t }) {
910
898
  let n = e, r = t;
911
- return (e, t) => (S(), s("div", Xe, [c("div", Ze, [c("div", Qe, [c("div", $e, [n.showBackToList ? (S(), s("button", {
899
+ return (e, t) => (S(), s("div", Qe, [c("div", $e, [c("div", et, [c("div", tt, [n.showBackToList ? (S(), s("button", {
912
900
  key: 0,
913
901
  type: "button",
914
902
  "data-testid": "vibe-back-to-list",
915
903
  class: "pointer-events-auto inline-flex h-11 w-11 shrink-0 items-center justify-center border border-white/14 bg-black/40 text-[#f7f1ea]/78 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/55",
916
904
  "aria-label": "Back to list",
917
905
  onClick: t[0] ||= (e) => r("back-to-list")
918
- }, [u(j(K), {
906
+ }, [u(j(Y), {
919
907
  class: "h-4 w-4 stroke-[2.2]",
920
908
  "aria-hidden": "true"
921
- })])) : o("", !0), n.title ? (S(), s("h2", et, k(n.title), 1)) : o("", !0)]), c("div", tt, [c("span", nt, [c("span", rt, k(n.currentIndex + 1) + " / " + k(n.total), 1), n.paginationDetail ? (S(), s("span", it, k(n.paginationDetail), 1)) : o("", !0)]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", at, [...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)]));
909
+ })])) : o("", !0), n.title ? (S(), s("h2", nt, k(n.title), 1)) : o("", !0)]), c("div", rt, [c("span", it, [c("span", at, k(n.currentIndex + 1) + " / " + k(n.total), 1), n.paginationDetail ? (S(), s("span", ot, k(n.paginationDetail), 1)) : o("", !0)]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", st, [...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)]));
910
+ }
911
+ }), lt = {
912
+ image: ne,
913
+ video: ee,
914
+ audio: X,
915
+ other: te
916
+ }, ut = {
917
+ image: "Image",
918
+ video: "Video",
919
+ audio: "Audio",
920
+ other: "File"
921
+ };
922
+ function dt(e) {
923
+ return lt[e];
924
+ }
925
+ function ft(e) {
926
+ return ut[e];
927
+ }
928
+ //#endregion
929
+ //#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
930
+ var pt = 2;
931
+ function mt(e) {
932
+ function t(e, t) {
933
+ let n = t.title?.trim();
934
+ return n ? `${e} ${n}` : `${e} ${ft(t.type).toLowerCase()}`;
935
+ }
936
+ function n(e) {
937
+ return $(e);
938
+ }
939
+ function r(t) {
940
+ let n = e.resolvedActiveIndex.value;
941
+ return !!e.active.value && t >= n && t <= n + pt;
942
+ }
943
+ function i(t, i) {
944
+ let a = n(i);
945
+ return !r(t) || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(a) ? !1 : i.type === "image" ? !e.viewer.isImageReady(a) : i.type === "video" || i.type === "audio" ? !e.viewer.isMediaReady(a) : !1;
946
+ }
947
+ function a(t) {
948
+ return e.viewer.getAssetErrorKind(n(t));
922
949
  }
923
- });
950
+ function o(t) {
951
+ return e.viewer.getAssetErrorLabel(n(t)) ?? "Load error";
952
+ }
953
+ function s(t, n) {
954
+ return r(t) && t === e.resolvedActiveIndex.value && !!a(n);
955
+ }
956
+ function c(t, n) {
957
+ return r(t) ? e.viewer.getImageSource(n) : void 0;
958
+ }
959
+ function l(e, t) {
960
+ return r(e) ? t.url : void 0;
961
+ }
962
+ return {
963
+ getAssetErrorKind: a,
964
+ getAssetErrorLabel: o,
965
+ getFullscreenImageSource: c,
966
+ getFullscreenMediaSource: l,
967
+ getItemKey: n,
968
+ getMediaActionLabel: t,
969
+ isAssetErrored: s,
970
+ isAssetLoading: i,
971
+ shouldPreloadSlideAsset: r
972
+ };
973
+ }
974
+ //#endregion
975
+ //#region src/components/viewer-core/slotContent.ts
976
+ function ht(e) {
977
+ if (!Array.isArray(e)) return !1;
978
+ for (let t of e) {
979
+ if (Array.isArray(t)) {
980
+ if (ht(t)) return !0;
981
+ continue;
982
+ }
983
+ if (!m(t)) {
984
+ if (typeof t == "string") {
985
+ if (t.trim().length > 0) return !0;
986
+ continue;
987
+ }
988
+ if (t != null && t !== !1) return !0;
989
+ continue;
990
+ }
991
+ if (!gt(t)) return !0;
992
+ }
993
+ return !1;
994
+ }
995
+ function gt(r) {
996
+ return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !ht(r.children) : !1;
997
+ }
998
+ //#endregion
999
+ //#region src/components/viewer-core/useSurfaceEmptyState.ts
1000
+ var _t = "no items available";
1001
+ function vt(e) {
1002
+ let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
1003
+ loading: !!e.loading.value,
1004
+ message: _t,
1005
+ mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
1006
+ surface: e.surface,
1007
+ total: e.itemCount.value
1008
+ }), n = i(() => !t.value || !e.renderSlot ? [] : e.renderSlot(t.value));
1009
+ return {
1010
+ emptyStateProps: t,
1011
+ showBadgeEmptyState: i(() => t.value?.mode === "badge"),
1012
+ showCustomEmptyState: i(() => ht(n.value)),
1013
+ showInlineEmptyState: i(() => t.value?.mode === "inline")
1014
+ };
1015
+ }
924
1016
  //#endregion
925
1017
  //#region src/components/viewer-core/format.ts
926
- function st(e) {
1018
+ function yt(e) {
927
1019
  if (!Number.isFinite(e) || e <= 0) return "0:00";
928
1020
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
929
1021
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
930
1022
  }
931
1023
  //#endregion
1024
+ //#region src/components/viewer-core/surfaceStatus.ts
1025
+ function bt(e) {
1026
+ return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
1027
+ }
1028
+ function xt(e) {
1029
+ return e.phase === "failed" ? {
1030
+ kind: "failed",
1031
+ message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
1032
+ } : e.phase === "initializing" ? {
1033
+ kind: "initializing",
1034
+ message: "Loading the first page"
1035
+ } : e.phase === "loading" ? {
1036
+ kind: "loading-more",
1037
+ message: e.hasItems ? "Loading more items" : "Loading the first page"
1038
+ } : e.phase === "filling" ? {
1039
+ kind: "filling",
1040
+ message: "Filling the view"
1041
+ } : e.phase === "refreshing" ? {
1042
+ kind: "refreshing",
1043
+ message: !e.hasNextPage && e.hasItems ? e.surface === "grid" ? "Refreshing the end of the list" : "Refreshing the end of the feed" : "Refreshing visible items"
1044
+ } : !e.hasItems || e.hasNextPage ? null : {
1045
+ kind: "end",
1046
+ message: e.surface === "grid" ? "End of list" : "End of feed"
1047
+ };
1048
+ }
1049
+ //#endregion
932
1050
  //#region src/components/viewer-core/useActivation.ts
933
- function ct(e) {
1051
+ function St(e) {
934
1052
  let t = !1;
935
- P(e.enabled, async (t) => {
1053
+ F(e.enabled, async (t) => {
936
1054
  if (n(t), t) {
937
1055
  e.onResize(), await e.onEnable();
938
1056
  return;
@@ -953,42 +1071,42 @@ function ct(e) {
953
1071
  }
954
1072
  //#endregion
955
1073
  //#region src/components/viewer-core/assetState.ts
956
- var lt = {
1074
+ var Ct = {
957
1075
  currentTime: 0,
958
1076
  duration: 0,
959
1077
  errorKind: null,
960
1078
  paused: !0,
961
1079
  ready: !1
962
1080
  };
963
- function ut() {
964
- return { ...lt };
1081
+ function wt() {
1082
+ return { ...Ct };
965
1083
  }
966
- function dt(e) {
1084
+ function Tt(e) {
967
1085
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
968
1086
  }
969
- function ft(e, t, n) {
970
- e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.paused = t.paused, n && n !== "error" && (e.errorKind = null), e.ready = pt(t, n);
1087
+ function Et(e, t, n) {
1088
+ e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.paused = t.paused, n && n !== "error" && (e.errorKind = null), e.ready = Dt(t, n);
971
1089
  }
972
- function pt(e, t) {
1090
+ function Dt(e, t) {
973
1091
  return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
974
1092
  }
975
1093
  //#endregion
976
1094
  //#region src/components/viewer-core/loadError.ts
977
- var mt = /* @__PURE__ */ new Map();
978
- function ht(e) {
1095
+ var Ot = /* @__PURE__ */ new Map();
1096
+ function kt(e) {
979
1097
  return e === "not-found" ? "404" : "Load error";
980
1098
  }
981
- function gt(e) {
1099
+ function At(e) {
982
1100
  return e === "generic";
983
1101
  }
984
- function _t(e) {
985
- let t = mt.get(e);
1102
+ function jt(e) {
1103
+ let t = Ot.get(e);
986
1104
  if (t) return t;
987
- let n = vt(e);
988
- return mt.set(e, n), n;
1105
+ let n = Mt(e);
1106
+ return Ot.set(e, n), n;
989
1107
  }
990
- async function vt(e) {
991
- if (!yt(e)) return "generic";
1108
+ async function Mt(e) {
1109
+ if (!Nt(e)) return "generic";
992
1110
  try {
993
1111
  let t = await fetch(e, { method: "HEAD" });
994
1112
  if (!t.ok && t.status === 404) return "not-found";
@@ -997,12 +1115,12 @@ async function vt(e) {
997
1115
  }
998
1116
  return "generic";
999
1117
  }
1000
- function yt(e) {
1118
+ function Nt(e) {
1001
1119
  return /^(https?:\/\/|\/)/i.test(e);
1002
1120
  }
1003
1121
  //#endregion
1004
1122
  //#region src/components/viewer-core/mediaPlayback.ts
1005
- function bt(e) {
1123
+ function Pt(e) {
1006
1124
  try {
1007
1125
  let t = e.play();
1008
1126
  t && typeof t.catch == "function" && t.catch(() => {});
@@ -1010,75 +1128,75 @@ function bt(e) {
1010
1128
  }
1011
1129
  //#endregion
1012
1130
  //#region src/components/viewer-core/useMedia.ts
1013
- function xt(e) {
1014
- let t = T({}), n = T({}), r = T({}), a = T({}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), l = i(() => e.activeItem.value ? Q(e.activeItem.value) : null), u = i(() => e.activeMediaItem.value ? Q(e.activeMediaItem.value) : null), d = i(() => {
1131
+ function Ft(e) {
1132
+ let t = T({}), n = T({}), r = T({}), a = T({}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), l = i(() => e.activeItem.value ? $(e.activeItem.value) : null), u = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), d = i(() => {
1015
1133
  let t = /* @__PURE__ */ new Map();
1016
- for (let n of e.items.value) t.set(Q(n), n);
1134
+ for (let n of e.items.value) t.set($(n), n);
1017
1135
  return t;
1018
- }), f = i(() => u.value ? r.value[u.value] ?? lt : lt), p = i(() => u.value ? f.value.duration : 0), m = i(() => p.value <= 0 ? 0 : St(f.value.currentTime / p.value * 100, 0, 100)), h = i(() => l.value ? N(l.value) : null);
1019
- P(() => l.value, async () => {
1136
+ }), f = i(() => u.value ? r.value[u.value] ?? Ct : Ct), p = i(() => u.value ? f.value.duration : 0), m = i(() => p.value <= 0 ? 0 : It(f.value.currentTime / p.value * 100, 0, 100)), h = i(() => l.value ? N(l.value) : null);
1137
+ F(() => l.value, async () => {
1020
1138
  await x();
1021
- }), P(() => e.itemCount.value, async () => {
1139
+ }), F(() => e.itemCount.value, async () => {
1022
1140
  await x();
1023
1141
  });
1024
1142
  function _(e, t) {
1025
1143
  if (t instanceof HTMLVideoElement) {
1026
- o.set(e, t), V(e, t);
1144
+ o.set(e, t), H(e, t);
1027
1145
  return;
1028
1146
  }
1029
1147
  o.delete(e);
1030
1148
  }
1031
1149
  function v(e, t) {
1032
1150
  if (t instanceof HTMLAudioElement) {
1033
- s.set(e, t), V(e, t);
1151
+ s.set(e, t), H(e, t);
1034
1152
  return;
1035
1153
  }
1036
1154
  s.delete(e);
1037
1155
  }
1038
1156
  function y(e, r) {
1039
- r instanceof HTMLImageElement && dt(r) && (t.value[e] = !0, n.value[e] = null, G(e, r.currentSrc || r.src || q(e)));
1157
+ r instanceof HTMLImageElement && Tt(r) && (t.value[e] = !0, n.value[e] = null, q(e, r.currentSrc || r.src || Y(e)));
1040
1158
  }
1041
1159
  function b() {
1042
- z(), a.value = {}, n.value = {}, t.value = {}, r.value = {}, c.clear();
1160
+ B(), a.value = {}, n.value = {}, t.value = {}, r.value = {}, c.clear();
1043
1161
  }
1044
1162
  async function x() {
1045
1163
  if (!e.isEnabled.value) {
1046
- z();
1164
+ B();
1047
1165
  return;
1048
1166
  }
1049
1167
  await g();
1050
1168
  let t = l.value;
1051
1169
  for (let [e, n] of o.entries()) {
1052
1170
  if (e !== t || r.value[e]?.errorKind) {
1053
- R(n, e);
1171
+ z(n, e);
1054
1172
  continue;
1055
1173
  }
1056
- n.muted = !0, n.loop = !1, n.playsInline = !0, bt(n), V(e, n);
1174
+ n.muted = !0, n.loop = !1, n.playsInline = !0, Pt(n), H(e, n);
1057
1175
  }
1058
1176
  for (let [e, n] of s.entries()) {
1059
1177
  if (e !== t || r.value[e]?.errorKind) {
1060
- R(n, e);
1178
+ z(n, e);
1061
1179
  continue;
1062
1180
  }
1063
- bt(n), V(e, n);
1181
+ Pt(n), H(e, n);
1064
1182
  }
1065
1183
  }
1066
1184
  function S(e, t) {
1067
1185
  let n = t.currentTarget instanceof HTMLMediaElement ? t.currentTarget : t.target instanceof HTMLMediaElement ? t.target : null;
1068
1186
  if (n) {
1069
1187
  let i = r.value[e]?.ready ?? !1;
1070
- V(e, n, t.type);
1188
+ H(e, n, t.type);
1071
1189
  let a = r.value[e]?.ready ?? !1;
1072
- !i && a && G(e, n.currentSrc || n.src || q(e));
1190
+ !i && a && q(e, n.currentSrc || n.src || Y(e));
1073
1191
  }
1074
1192
  }
1075
1193
  function C(e, r) {
1076
- t.value[e] = !0, n.value[e] = null, G(e, r);
1194
+ t.value[e] = !0, n.value[e] = null, q(e, r);
1077
1195
  }
1078
1196
  async function w(r, i) {
1079
- let a = K(r) ?? e.activeItem.value;
1197
+ let a = J(r) ?? e.activeItem.value;
1080
1198
  t.value[r] = !1, n.value[r] = "generic";
1081
- let o = await _t(i);
1199
+ let o = await jt(i);
1082
1200
  n.value[r] = o, a && e.onAssetError?.({
1083
1201
  item: a,
1084
1202
  occurrenceKey: r,
@@ -1088,7 +1206,7 @@ function xt(e) {
1088
1206
  });
1089
1207
  }
1090
1208
  async function E(t, n) {
1091
- let r = H(t), i = B(t), a = K(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1209
+ let r = W(t), i = V(t), a = J(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1092
1210
  if (r) {
1093
1211
  r.pause();
1094
1212
  try {
@@ -1096,7 +1214,7 @@ function xt(e) {
1096
1214
  } catch {}
1097
1215
  }
1098
1216
  i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
1099
- let o = await _t(n);
1217
+ let o = await jt(n);
1100
1218
  i.errorKind = o, a && e.onAssetError?.({
1101
1219
  item: a,
1102
1220
  occurrenceKey: t,
@@ -1106,18 +1224,18 @@ function xt(e) {
1106
1224
  });
1107
1225
  }
1108
1226
  function D(e, t, n) {
1109
- e.button !== 0 || Date.now() < n || W(o.get(t) ?? null);
1227
+ e.button !== 0 || Date.now() < n || K(o.get(t) ?? null);
1110
1228
  }
1111
1229
  function O(e, t, n) {
1112
- e.button !== 0 || Date.now() < n || W(H(t));
1230
+ e.button !== 0 || Date.now() < n || K(W(t));
1113
1231
  }
1114
1232
  function k(e) {
1115
- let t = U(), n = u.value;
1233
+ let t = G(), n = u.value;
1116
1234
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1117
1235
  let r = Number.parseFloat(e.target.value);
1118
1236
  if (!Number.isFinite(r)) return;
1119
- let i = St(r, 0, p.value || 0);
1120
- te(n, i, t), t.currentTime = i;
1237
+ let i = It(r, 0, p.value || 0);
1238
+ U(n, i, t), t.currentTime = i;
1121
1239
  }
1122
1240
  function A(e) {
1123
1241
  return !!t.value[e] && !n.value[e];
@@ -1131,64 +1249,64 @@ function xt(e) {
1131
1249
  function N(e) {
1132
1250
  return n.value[e] ?? r.value[e]?.errorKind ?? null;
1133
1251
  }
1134
- function F(e) {
1252
+ function P(e) {
1135
1253
  let t = N(e);
1136
- return t ? ht(t) : null;
1254
+ return t ? kt(t) : null;
1137
1255
  }
1138
1256
  function I(e) {
1139
- return gt(N(e));
1257
+ return At(N(e));
1140
1258
  }
1141
1259
  function L(e) {
1142
1260
  return `${e}:${a.value[e] ?? 0}`;
1143
1261
  }
1144
- async function ee(e) {
1262
+ async function R(e) {
1145
1263
  if (!I(e)) return;
1146
1264
  t.value[e] = !1, n.value[e] = null;
1147
- let r = B(e);
1265
+ let r = V(e);
1148
1266
  r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
1149
- let i = H(e);
1150
- i && R(i, e), c.forEach((t) => {
1267
+ let i = W(e);
1268
+ i && z(i, e), c.forEach((t) => {
1151
1269
  t.startsWith(`${e}|`) && c.delete(t);
1152
1270
  }), a.value[e] = (a.value[e] ?? 0) + 1, await g(), await x();
1153
1271
  }
1154
- function R(e, t) {
1272
+ function z(e, t) {
1155
1273
  e.pause();
1156
1274
  try {
1157
1275
  e.currentTime = 0;
1158
1276
  } catch {}
1159
- V(t, e);
1277
+ H(t, e);
1160
1278
  }
1161
- function z() {
1162
- for (let [e, t] of o.entries()) R(t, e);
1163
- for (let [e, t] of s.entries()) R(t, e);
1279
+ function B() {
1280
+ for (let [e, t] of o.entries()) z(t, e);
1281
+ for (let [e, t] of s.entries()) z(t, e);
1164
1282
  }
1165
- function B(e) {
1166
- return r.value[e] || (r.value[e] = ut()), r.value[e];
1283
+ function V(e) {
1284
+ return r.value[e] || (r.value[e] = wt()), r.value[e];
1167
1285
  }
1168
- function V(e, t, n) {
1169
- ft(B(e), t, n);
1286
+ function H(e, t, n) {
1287
+ Et(V(e), t, n);
1170
1288
  }
1171
- function te(e, t, n) {
1172
- let r = B(e);
1289
+ function U(e, t, n) {
1290
+ let r = V(e);
1173
1291
  r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.paused = n.paused;
1174
1292
  }
1175
- function H(e) {
1293
+ function W(e) {
1176
1294
  return o.get(e) ?? s.get(e) ?? null;
1177
1295
  }
1178
- function U() {
1179
- return u.value ? H(u.value) : null;
1296
+ function G() {
1297
+ return u.value ? W(u.value) : null;
1180
1298
  }
1181
- function W(e) {
1299
+ function K(e) {
1182
1300
  if (e) {
1183
1301
  if (e.paused) {
1184
- bt(e);
1302
+ Pt(e);
1185
1303
  return;
1186
1304
  }
1187
1305
  e.pause();
1188
1306
  }
1189
1307
  }
1190
- function G(t, n) {
1191
- let r = K(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1308
+ function q(t, n) {
1309
+ let r = J(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1192
1310
  if (!r || !n) return;
1193
1311
  let i = `${t}|${n}`;
1194
1312
  c.has(i) || (c.add(i), e.onAssetLoad?.({
@@ -1198,11 +1316,11 @@ function xt(e) {
1198
1316
  url: n
1199
1317
  }));
1200
1318
  }
1201
- function K(e) {
1319
+ function J(e) {
1202
1320
  return d.value.get(e) ?? null;
1203
1321
  }
1204
- function q(e) {
1205
- return K(e)?.url ?? null;
1322
+ function Y(e) {
1323
+ return J(e)?.url ?? null;
1206
1324
  }
1207
1325
  return {
1208
1326
  activeAssetErrorKind: h,
@@ -1210,7 +1328,7 @@ function xt(e) {
1210
1328
  activeMediaProgress: m,
1211
1329
  activeMediaState: f,
1212
1330
  getAssetErrorKind: N,
1213
- getAssetErrorLabel: F,
1331
+ getAssetErrorLabel: P,
1214
1332
  getAssetRenderKey: L,
1215
1333
  getImageSource: M,
1216
1334
  isImageReady: A,
@@ -1228,14 +1346,14 @@ function xt(e) {
1228
1346
  registerImageElement: y,
1229
1347
  registerVideoElement: _,
1230
1348
  resetMediaState: b,
1231
- retryAsset: ee,
1349
+ retryAsset: R,
1232
1350
  syncMediaPlayback: x
1233
1351
  };
1234
1352
  }
1235
- function St(e, t, n) {
1353
+ function It(e, t, n) {
1236
1354
  return Math.min(Math.max(e, t), n);
1237
1355
  }
1238
- function Ct(e, t, n = 2) {
1356
+ function Lt(e, t, n = 2) {
1239
1357
  return t <= 0 ? {
1240
1358
  start: 0,
1241
1359
  end: -1
@@ -1244,14 +1362,14 @@ function Ct(e, t, n = 2) {
1244
1362
  end: Math.min(t - 1, e + n)
1245
1363
  };
1246
1364
  }
1247
- function wt(e, t, n = 2) {
1248
- let r = Ct(t, e.length, n);
1365
+ function Rt(e, t, n = 2) {
1366
+ let r = Lt(t, e.length, n);
1249
1367
  return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
1250
1368
  item: e,
1251
1369
  index: r.start + t
1252
1370
  }));
1253
1371
  }
1254
- function Tt(e, t, n, r, i) {
1372
+ function zt(e, t, n, r, i) {
1255
1373
  return {
1256
1374
  transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
1257
1375
  transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
@@ -1259,223 +1377,212 @@ function Tt(e, t, n, r, i) {
1259
1377
  }
1260
1378
  //#endregion
1261
1379
  //#region src/components/viewer-core/useViewer.ts
1262
- function Et(e, t, n = {}) {
1263
- let { activeIndex: r, canRetryInitialLoad: a, errorMessage: o, hasNextPage: s, items: c, loading: l, paginationDetail: u, retryInitialLoad: d, setActiveIndex: f } = Be(e, t), p = T(null), m = T(0), h = T(!1), g = T(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => c.value.length === 0 ? 0 : M(r.value, 0, c.value.length - 1)), C = i(() => c.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), E = xt({
1264
- items: c,
1265
- activeItem: C,
1266
- activeMediaItem: w,
1267
- isEnabled: _,
1268
- itemCount: i(() => c.value.length),
1380
+ function Bt(e, t, n = {}) {
1381
+ 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.paginationDetail ?? null), u = i(() => bt({
1382
+ itemCount: r.value.length,
1383
+ loading: s.value,
1384
+ phase: e.phase
1385
+ })), d = i(() => !1), f = T(null), p = T(0), m = T(!1), h = T(1), g = n.enabled ?? i(() => !0), _ = null, v = 0, y = 0, b = 0, x = i(() => r.value.length === 0 ? 0 : N(a.value, 0, r.value.length - 1)), S = i(() => r.value[x.value] ?? null), C = i(() => S.value?.type === "audio" || S.value?.type === "video" ? S.value : null), w = Ft({
1386
+ items: r,
1387
+ activeItem: S,
1388
+ activeMediaItem: C,
1389
+ isEnabled: g,
1390
+ itemCount: i(() => r.value.length),
1269
1391
  onAssetError: n.onAssetError,
1270
1392
  onAssetLoad: n.onAssetLoad
1271
- }), D = i(() => c.value.length > 0 && S.value === c.value.length - 1), O = i(() => c.value.length === 0 && l.value ? "Loading the first page" : l.value && s.value ? "Loading more items" : D.value && !s.value && !l.value ? "End of feed" : null), k = i(() => Math.min(96, g.value * .15 || 96)), A = i(() => Ct(S.value, c.value.length)), j = i(() => wt(c.value, S.value));
1272
- ct({
1273
- enabled: _,
1393
+ }), E = i(() => r.value.length > 0 && x.value === r.value.length - 1), D = i(() => xt({
1394
+ errorMessage: o.value,
1395
+ hasItems: r.value.length > 0,
1396
+ hasNextPage: c.value,
1397
+ phase: u.value,
1398
+ surface: "fullscreen"
1399
+ })), O = i(() => D.value?.kind ?? null), k = i(() => D.value?.message ?? null), A = i(() => Math.min(96, h.value * .15 || 96)), j = i(() => Lt(x.value, r.value.length)), M = i(() => Rt(r.value, x.value));
1400
+ St({
1401
+ enabled: g,
1274
1402
  onDisable() {
1275
- V(), E.resetMediaState();
1403
+ U(), w.resetMediaState();
1276
1404
  },
1277
1405
  onEnable() {
1278
- return E.syncMediaPlayback();
1406
+ return w.syncMediaPlayback();
1279
1407
  },
1280
- onKeydown: H,
1281
- onResize: N
1408
+ onKeydown: G,
1409
+ onResize: P
1282
1410
  });
1283
- function M(e, t, n) {
1411
+ function N(e, t, n) {
1284
1412
  return Math.min(Math.max(e, t), n);
1285
1413
  }
1286
- function N() {
1287
- g.value = p.value?.clientHeight || window.innerHeight || 1;
1288
- }
1289
- function P(e) {
1290
- return c.value.length === 0 ? !1 : M(S.value + e, 0, c.value.length - 1) !== S.value;
1414
+ function P() {
1415
+ h.value = f.value?.clientHeight || window.innerHeight || 1;
1291
1416
  }
1292
1417
  function F(e) {
1293
- if (c.value.length === 0) return;
1294
- let t = M(S.value + e, 0, c.value.length - 1);
1295
- t !== S.value && f(t);
1418
+ return r.value.length === 0 ? !1 : N(x.value + e, 0, r.value.length - 1) !== x.value;
1296
1419
  }
1297
1420
  function I(e) {
1298
- let t = e > 0, n = e < 0;
1299
- return t && !P(-1) || n && !P(1) ? e * .24 : e;
1421
+ if (r.value.length === 0) return;
1422
+ let n = N(x.value + e, 0, r.value.length - 1);
1423
+ n !== x.value && t("update:activeIndex", n);
1300
1424
  }
1301
1425
  function L(e) {
1302
- !_.value || c.value.length === 0 || e.pointerType === "mouse" || Z(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
1303
- }
1304
- function ee(e) {
1305
- !_.value || !h.value || v !== e.pointerId || (m.value = I(e.clientY - y));
1426
+ let t = e > 0, n = e < 0;
1427
+ return t && !F(-1) || n && !F(1) ? e * .24 : e;
1306
1428
  }
1307
1429
  function R(e) {
1308
- !_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), B());
1430
+ !g.value || r.value.length === 0 || e.pointerType === "mouse" || le(e.target) || (_ = e.pointerId, v = e.clientY, p.value = 0, m.value = !0, f.value?.setPointerCapture?.(e.pointerId));
1309
1431
  }
1310
1432
  function z(e) {
1311
- !_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), V());
1433
+ !g.value || !m.value || _ !== e.pointerId || (p.value = L(e.clientY - v));
1312
1434
  }
1313
- function B() {
1314
- Math.abs(m.value) >= k.value && (x = Date.now() + 250, F(m.value < 0 ? 1 : -1)), V();
1435
+ function B(e) {
1436
+ !g.value || _ !== e.pointerId || (f.value?.releasePointerCapture?.(e.pointerId), H());
1315
1437
  }
1316
- function V() {
1317
- m.value = 0, h.value = !1, v = null;
1438
+ function V(e) {
1439
+ !g.value || _ !== e.pointerId || (f.value?.releasePointerCapture?.(e.pointerId), U());
1440
+ }
1441
+ function H() {
1442
+ Math.abs(p.value) >= A.value && (b = Date.now() + 250, I(p.value < 0 ? 1 : -1)), U();
1318
1443
  }
1319
- function te(e) {
1320
- if (!_.value || c.value.length === 0 || h.value || Z(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
1444
+ function U() {
1445
+ p.value = 0, m.value = !1, _ = null;
1446
+ }
1447
+ function W(e) {
1448
+ if (!g.value || r.value.length === 0 || m.value || le(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
1321
1449
  e.preventDefault();
1322
1450
  let t = Date.now();
1323
- t < b || (b = t + 400, F(e.deltaY > 0 ? 1 : -1));
1451
+ t < y || (y = t + 400, I(e.deltaY > 0 ? 1 : -1));
1324
1452
  }
1325
- function H(e) {
1326
- !_.value || c.value.length === 0 || le(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), F(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), F(-1)));
1453
+ function G(e) {
1454
+ !g.value || r.value.length === 0 || Q(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), I(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), I(-1)));
1327
1455
  }
1328
- function U(e, t) {
1329
- E.onVideoClick(e, t, x);
1456
+ function K(e, t) {
1457
+ w.onVideoClick(e, t, b);
1330
1458
  }
1331
- function W(e, t) {
1332
- E.onAudioCoverClick(e, t, x);
1459
+ function q(e, t) {
1460
+ w.onAudioCoverClick(e, t, b);
1333
1461
  }
1334
- function G(e) {
1335
- E.onMediaSeekInput(e);
1462
+ function J(e) {
1463
+ w.onMediaSeekInput(e);
1336
1464
  }
1337
- function K(e) {
1465
+ function Y(e) {
1338
1466
  return e.type === "image" || e.type === "video";
1339
1467
  }
1340
- function q(e) {
1468
+ function X(e) {
1341
1469
  return e.type === "audio";
1342
1470
  }
1343
- function J(e) {
1344
- return Tt(e, S.value, g.value, m.value, h.value);
1471
+ function ee(e) {
1472
+ return zt(e, x.value, h.value, p.value, m.value);
1345
1473
  }
1346
1474
  return {
1347
- activeItem: C,
1348
- activeAssetErrorKind: E.activeAssetErrorKind,
1349
- activeMediaDuration: E.activeMediaDuration,
1350
- activeMediaItem: w,
1351
- activeMediaProgress: E.activeMediaProgress,
1352
- activeMediaState: E.activeMediaState,
1353
- canRetryAsset: E.canRetryAsset,
1354
- canRetryInitialLoad: a,
1475
+ activeItem: S,
1476
+ activeAssetErrorKind: w.activeAssetErrorKind,
1477
+ activeMediaDuration: w.activeMediaDuration,
1478
+ activeMediaItem: C,
1479
+ activeMediaProgress: w.activeMediaProgress,
1480
+ activeMediaState: w.activeMediaState,
1481
+ canRetryAsset: w.canRetryAsset,
1482
+ canRetryInitialLoad: d,
1355
1483
  errorMessage: o,
1356
- getAssetErrorKind: E.getAssetErrorKind,
1357
- getAssetErrorLabel: E.getAssetErrorLabel,
1358
- getAssetRenderKey: E.getAssetRenderKey,
1359
- formatPlaybackTime: st,
1360
- getImageSource: E.getImageSource,
1361
- getSlideStyle: J,
1362
- hasNextPage: s,
1363
- isAtEnd: D,
1364
- isAudio: q,
1365
- isVisual: K,
1366
- items: c,
1367
- loading: l,
1368
- mediaStates: E.mediaStates,
1369
- isImageReady: E.isImageReady,
1370
- isMediaReady: E.isMediaReady,
1371
- onAudioCoverClick: W,
1372
- onImageError: E.onImageError,
1373
- onImageLoad: E.onImageLoad,
1374
- onMediaEvent: E.onMediaEvent,
1375
- onMediaError: E.onMediaError,
1376
- onMediaSeekInput: G,
1377
- onPointerCancel: z,
1378
- onPointerDown: L,
1379
- onPointerMove: ee,
1380
- onPointerUp: R,
1381
- onVideoClick: U,
1382
- onWheel: te,
1383
- registerAudioElement: E.registerAudioElement,
1384
- registerImageElement: E.registerImageElement,
1385
- registerVideoElement: E.registerVideoElement,
1386
- renderedItems: j,
1387
- renderedRange: A,
1388
- resolvedActiveIndex: S,
1389
- retryInitialLoad: d,
1390
- retryAsset: E.retryAsset,
1391
- stageRef: p,
1392
- statusMessage: O,
1393
- paginationDetail: u
1484
+ getAssetErrorKind: w.getAssetErrorKind,
1485
+ getAssetErrorLabel: w.getAssetErrorLabel,
1486
+ getAssetRenderKey: w.getAssetRenderKey,
1487
+ formatPlaybackTime: yt,
1488
+ getImageSource: w.getImageSource,
1489
+ getSlideStyle: ee,
1490
+ hasNextPage: c,
1491
+ isAtEnd: E,
1492
+ isAudio: X,
1493
+ isVisual: Y,
1494
+ items: r,
1495
+ loading: s,
1496
+ mediaStates: w.mediaStates,
1497
+ isImageReady: w.isImageReady,
1498
+ isMediaReady: w.isMediaReady,
1499
+ onAudioCoverClick: q,
1500
+ onImageError: w.onImageError,
1501
+ onImageLoad: w.onImageLoad,
1502
+ onMediaEvent: w.onMediaEvent,
1503
+ onMediaError: w.onMediaError,
1504
+ onMediaSeekInput: J,
1505
+ onPointerCancel: V,
1506
+ onPointerDown: R,
1507
+ onPointerMove: z,
1508
+ onPointerUp: B,
1509
+ onVideoClick: K,
1510
+ onWheel: W,
1511
+ registerAudioElement: w.registerAudioElement,
1512
+ registerImageElement: w.registerImageElement,
1513
+ registerVideoElement: w.registerVideoElement,
1514
+ renderedItems: M,
1515
+ renderedRange: j,
1516
+ resolvedActiveIndex: x,
1517
+ retryInitialLoad: async () => {},
1518
+ retryAsset: w.retryAsset,
1519
+ stageRef: f,
1520
+ statusKind: O,
1521
+ statusMessage: k,
1522
+ paginationDetail: l,
1523
+ phase: u
1394
1524
  };
1395
1525
  }
1396
1526
  //#endregion
1397
- //#region src/components/viewer-core/media.ts
1398
- var Dt = {
1399
- image: ne,
1400
- video: J,
1401
- audio: q,
1402
- other: Y
1403
- }, Ot = {
1404
- image: "Image",
1405
- video: "Video",
1406
- audio: "Audio",
1407
- other: "File"
1408
- };
1409
- function kt(e) {
1410
- return Dt[e];
1411
- }
1412
- function At(e) {
1413
- return Ot[e];
1414
- }
1415
- //#endregion
1416
- //#region src/components/viewer-core/slotContent.ts
1417
- function jt(e) {
1418
- if (!Array.isArray(e)) return !1;
1419
- for (let t of e) {
1420
- if (Array.isArray(t)) {
1421
- if (jt(t)) return !0;
1422
- continue;
1423
- }
1424
- if (!m(t)) {
1425
- if (typeof t == "string") {
1426
- if (t.trim().length > 0) return !0;
1427
- continue;
1428
- }
1429
- if (t != null && t !== !1) return !0;
1430
- continue;
1431
- }
1432
- if (!Mt(t)) return !0;
1433
- }
1434
- return !1;
1435
- }
1436
- function Mt(r) {
1437
- 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;
1438
- }
1439
- //#endregion
1440
1527
  //#region src/components/viewer-core/theme.ts
1441
- var Nt = {
1528
+ var Vt = {
1442
1529
  image: "bg-[radial-gradient(circle_at_top_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
1443
1530
  video: "bg-[radial-gradient(circle_at_top_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
1444
1531
  audio: "bg-[radial-gradient(circle_at_top_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
1445
1532
  other: "bg-[radial-gradient(circle_at_top_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
1446
- }, Pt = {
1533
+ }, Ht = {
1447
1534
  image: "bg-[radial-gradient(circle_at_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
1448
1535
  video: "bg-[radial-gradient(circle_at_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
1449
1536
  audio: "bg-[radial-gradient(circle_at_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
1450
1537
  other: "bg-[radial-gradient(circle_at_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
1451
1538
  };
1452
- function Ft(e) {
1453
- return Nt[e];
1539
+ function Ut(e) {
1540
+ return Vt[e];
1454
1541
  }
1455
- function It(e) {
1456
- return Pt[e];
1542
+ function Wt(e) {
1543
+ return Ht[e];
1457
1544
  }
1458
1545
  //#endregion
1459
- //#region src/components/FullscreenSurface.vue?vue&type=script&setup=true&lang.ts
1460
- var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Rt = {
1546
+ //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
1547
+ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
1548
+ inheritAttrs: !1,
1549
+ __name: "SurfaceEmptyState",
1550
+ props: {
1551
+ message: {},
1552
+ mode: {},
1553
+ surface: {}
1554
+ },
1555
+ setup(e) {
1556
+ let t = M();
1557
+ return (n, r) => e.mode === "inline" ? (S(), s("div", h({ key: 0 }, j(t), {
1558
+ "data-testid": "vibe-empty-state-inline",
1559
+ "data-surface": e.surface,
1560
+ 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)]"]
1561
+ }), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16, Gt)) : (S(), s("div", h({ key: 1 }, j(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]"] }), [D(n.$slots, "default", {}, () => [c("span", {
1562
+ "data-testid": "vibe-empty-state-badge",
1563
+ "data-surface": e.surface,
1564
+ class: _(["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"])
1565
+ }, k(e.message), 11, Kt)])], 16));
1566
+ }
1567
+ }), Jt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Yt = {
1461
1568
  key: 0,
1462
1569
  class: "relative h-full min-h-0"
1463
- }, zt = [
1570
+ }, Xt = [
1464
1571
  "data-item-id",
1465
1572
  "data-occurrence-key",
1466
1573
  "data-index",
1467
1574
  "data-active",
1468
1575
  "aria-hidden"
1469
- ], Bt = {
1576
+ ], Zt = {
1470
1577
  key: 0,
1471
1578
  "data-testid": "vibe-asset-spinner",
1472
1579
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
1473
- }, Vt = { 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]" }, Ht = ["data-kind"], Ut = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Wt = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Gt = ["onClick"], Kt = [
1580
+ }, Qt = { 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]" }, $t = ["data-kind"], en = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, tn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, nn = ["onClick"], rn = [
1474
1581
  "src",
1475
1582
  "alt",
1476
1583
  "onLoad",
1477
1584
  "onError"
1478
- ], qt = [
1585
+ ], an = [
1479
1586
  "src",
1480
1587
  "preload",
1481
1588
  "onClick",
@@ -1492,15 +1599,15 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1492
1599
  "onStalled",
1493
1600
  "onTimeupdate",
1494
1601
  "onWaiting"
1495
- ], Jt = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Yt = [
1602
+ ], on = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, sn = [
1496
1603
  "aria-label",
1497
1604
  "disabled",
1498
1605
  "onClick"
1499
- ], Xt = { 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]" }, Zt = { 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]" }, Qt = {
1606
+ ], cn = { 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]" }, ln = { 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]" }, un = {
1500
1607
  key: 0,
1501
1608
  "data-testid": "vibe-asset-spinner",
1502
1609
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
1503
- }, $t = { 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]" }, en = ["data-kind"], tn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, nn = ["onClick"], rn = [
1610
+ }, dn = { 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]" }, fn = ["data-kind"], pn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, mn = ["onClick"], hn = [
1504
1611
  "src",
1505
1612
  "preload",
1506
1613
  "onCanplay",
@@ -1516,56 +1623,41 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1516
1623
  "onStalled",
1517
1624
  "onTimeupdate",
1518
1625
  "onWaiting"
1519
- ], an = {
1626
+ ], gn = {
1520
1627
  key: 2,
1521
1628
  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"
1522
- }, on = { 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]" }, sn = {
1629
+ }, _n = { 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]" }, vn = {
1523
1630
  key: 0,
1524
1631
  class: "pointer-events-none absolute inset-0 z-[4]"
1525
- }, cn = { class: "h-full w-full" }, ln = {
1632
+ }, yn = { class: "h-full w-full" }, bn = {
1526
1633
  key: 0,
1527
1634
  "data-testid": "vibe-fullscreen-aside",
1528
1635
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
1529
- }, un = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, dn = {
1636
+ }, xn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Sn = {
1530
1637
  key: 0,
1531
1638
  "data-testid": "vibe-fullscreen-aside",
1532
1639
  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]"
1533
- }, fn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, pn = 1280, mn = 2, hn = /* @__PURE__ */ d({
1640
+ }, Cn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, wn = 1280, Tn = /* @__PURE__ */ d({
1534
1641
  __name: "FullscreenSurface",
1535
1642
  props: {
1536
- items: {},
1537
- activeIndex: { default: 0 },
1538
- fillDelayMs: {},
1539
- fillDelayStepMs: {},
1540
- initialState: {},
1541
- loading: {
1643
+ active: {
1542
1644
  type: Boolean,
1543
- default: !1
1645
+ default: !0
1544
1646
  },
1647
+ activeIndex: { default: 0 },
1648
+ emptyStateMode: { default: "inline" },
1649
+ errorMessage: { default: null },
1545
1650
  hasNextPage: {
1546
1651
  type: Boolean,
1547
1652
  default: !1
1548
1653
  },
1549
- mode: {},
1550
- resolve: {},
1551
- initialCursor: {},
1552
- pageSize: {},
1553
- hasPreviousPage: { type: Boolean },
1554
- paginationDetail: { default: null },
1555
- requestNextPage: {},
1556
- requestPreviousPage: {},
1557
- showEndBadge: {
1558
- type: Boolean,
1559
- default: !0
1560
- },
1561
- showStatusBadges: {
1562
- type: Boolean,
1563
- default: !0
1564
- },
1565
- active: {
1654
+ items: {},
1655
+ loading: {
1566
1656
  type: Boolean,
1567
- default: !0
1657
+ default: !1
1568
1658
  },
1659
+ paginationDetail: { default: null },
1660
+ phase: { default: null },
1569
1661
  reportAssetError: {
1570
1662
  type: [Function, null],
1571
1663
  default: null
@@ -1577,17 +1669,29 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1577
1669
  showBackToList: {
1578
1670
  type: Boolean,
1579
1671
  default: !1
1672
+ },
1673
+ showEndBadge: {
1674
+ type: Boolean,
1675
+ default: !0
1676
+ },
1677
+ showStatusBadges: {
1678
+ type: Boolean,
1679
+ default: !0
1580
1680
  }
1581
1681
  },
1582
1682
  emits: ["back-to-list", "update:activeIndex"],
1583
1683
  setup(e, { emit: n }) {
1584
- let d = e, p = M(), m = n, g = Et(d, (e, t) => {
1684
+ let d = e, p = N(), m = n, g = Bt(d, (e, t) => {
1585
1685
  m("update:activeIndex", t);
1586
1686
  }, {
1587
1687
  enabled: A(d, "active"),
1588
1688
  onAssetError: d.reportAssetError ?? void 0,
1589
1689
  onAssetLoad: d.reportAssetLoad ?? void 0
1590
- }), C = T(typeof window > "u" ? pn : window.innerWidth || pn), w = i(() => Ft(g.activeItem.value?.type ?? "image")), N = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), P = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), F = i(() => P.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), L = i(() => {
1690
+ }), C = T(typeof window > "u" ? wn : window.innerWidth || wn), w = mt({
1691
+ active: A(d, "active"),
1692
+ resolvedActiveIndex: g.resolvedActiveIndex,
1693
+ viewer: g
1694
+ }), M = i(() => Ut(g.activeItem.value?.type ?? "image")), P = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), F = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), I = i(() => F.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), R = i(() => {
1591
1695
  let e = g.activeItem.value;
1592
1696
  return e ? {
1593
1697
  hasNextPage: d.hasNextPage,
@@ -1597,57 +1701,33 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1597
1701
  paginationDetail: d.paginationDetail,
1598
1702
  total: d.items.length
1599
1703
  } : null;
1600
- }), R = i(() => !L.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](L.value)), z = i(() => !L.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](L.value)), B = i(() => !d.showStatusBadges || !L.value || !g.statusMessage.value ? null : {
1601
- ...L.value,
1602
- kind: g.isAtEnd.value && !g.hasNextPage.value && !g.loading.value ? "end" : "loading-more",
1704
+ }), B = i(() => !R.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](R.value)), V = i(() => !R.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](R.value)), H = i(() => !d.showStatusBadges || !R.value || !g.statusKind.value || !g.statusMessage.value ? null : {
1705
+ ...R.value,
1706
+ kind: g.statusKind.value,
1603
1707
  message: g.statusMessage.value
1604
- }), V = i(() => !B.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](B.value)), te = i(() => ({
1605
- gridTemplateColumns: W.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
1708
+ }), U = i(() => !H.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](H.value)), W = i(() => ({
1709
+ gridTemplateColumns: q.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
1606
1710
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
1607
- })), H = i(() => jt(R.value)), U = i(() => jt(z.value)), W = i(() => U.value && C.value >= pn), G = i(() => U.value && !W.value), K = i(() => jt(V.value));
1711
+ })), G = i(() => ht(B.value)), K = i(() => ht(V.value)), q = i(() => K.value && C.value >= wn), J = i(() => K.value && !q.value), Y = i(() => ht(U.value)), { emptyStateProps: X, showBadgeEmptyState: ee, showCustomEmptyState: te, showInlineEmptyState: ne } = vt({
1712
+ emptyStateMode: A(d, "emptyStateMode"),
1713
+ itemCount: i(() => d.items.length),
1714
+ loading: A(d, "loading"),
1715
+ renderSlot: p["empty-state"],
1716
+ surface: "fullscreen"
1717
+ });
1608
1718
  x(() => {
1609
- window.addEventListener("resize", ue);
1719
+ window.addEventListener("resize", Z);
1610
1720
  }), b(() => {
1611
- window.removeEventListener("resize", ue);
1721
+ window.removeEventListener("resize", Z);
1612
1722
  });
1613
- function q(e, t) {
1614
- let n = t.title?.trim();
1615
- return n ? `${e} ${n}` : `${e} ${At(t.type).toLowerCase()}`;
1616
- }
1617
- function J(e, t) {
1618
- let n = Z(t);
1619
- return !X(e) || e !== g.resolvedActiveIndex.value || g.getAssetErrorKind(n) ? !1 : t.type === "image" ? !g.isImageReady(n) : t.type === "video" || t.type === "audio" ? !g.isMediaReady(n) : !1;
1620
- }
1621
- function Y(e) {
1622
- return g.getAssetErrorKind(Z(e));
1623
- }
1624
- function ne(e) {
1625
- return g.getAssetErrorLabel(Z(e)) ?? "Load error";
1626
- }
1627
- function se(e, t) {
1628
- return X(e) && e === g.resolvedActiveIndex.value && !!Y(t);
1629
- }
1630
- function X(e) {
1631
- let t = g.resolvedActiveIndex.value;
1632
- return d.active && e >= t && e <= t + mn;
1633
- }
1634
- function ce(e, t) {
1635
- return X(e) ? g.getImageSource(t) : void 0;
1723
+ function Z() {
1724
+ C.value = window.innerWidth || wn;
1636
1725
  }
1637
- function le(e, t) {
1638
- return X(e) ? t.url : void 0;
1639
- }
1640
- function Z(e) {
1641
- return Q(e);
1642
- }
1643
- function ue() {
1644
- C.value = window.innerWidth || pn;
1645
- }
1646
- return (e, n) => (S(), s("div", Lt, [
1647
- c("div", { class: _(["absolute inset-0 transition-[background] duration-200", w.value]) }, null, 2),
1726
+ return (e, n) => (S(), s("div", Jt, [
1727
+ c("div", { class: _(["absolute inset-0 transition-[background] duration-200", M.value]) }, null, 2),
1648
1728
  c("div", {
1649
1729
  class: "relative z-[1] grid h-full min-h-0",
1650
- style: y(te.value)
1730
+ style: y(W.value)
1651
1731
  }, [c("div", {
1652
1732
  ref: "viewer.stageRef",
1653
1733
  "data-testid": "vibe-stage",
@@ -1657,148 +1737,148 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1657
1737
  onPointerup: n[3] ||= (...e) => j(g).onPointerUp && j(g).onPointerUp(...e),
1658
1738
  onPointercancel: n[4] ||= (...e) => j(g).onPointerCancel && j(g).onPointerCancel(...e),
1659
1739
  onWheel: n[5] ||= (...e) => j(g).onWheel && j(g).onWheel(...e)
1660
- }, [j(g).items.value.length > 0 ? (S(), s("div", Rt, [
1740
+ }, [j(g).items.value.length > 0 ? (S(), s("div", Yt, [
1661
1741
  (S(!0), s(t, null, E(j(g).renderedItems.value, ({ item: r, index: i }) => (S(), s("article", {
1662
- key: Z(r),
1742
+ key: j(w).getItemKey(r),
1663
1743
  "data-testid": "vibe-slide",
1664
1744
  "data-item-id": r.id,
1665
- "data-occurrence-key": Z(r),
1745
+ "data-occurrence-key": j(w).getItemKey(r),
1666
1746
  "data-index": i,
1667
1747
  "data-active": i === j(g).resolvedActiveIndex.value,
1668
1748
  "aria-hidden": i === j(g).resolvedActiveIndex.value ? "false" : "true",
1669
1749
  class: _(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === j(g).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
1670
1750
  style: y(j(g).getSlideStyle(i))
1671
- }, [c("div", { class: _(["absolute inset-0 opacity-85", j(It)(r.type)]) }, null, 2), j(g).isVisual(r) ? (S(), s("div", {
1751
+ }, [c("div", { class: _(["absolute inset-0 opacity-85", j(Wt)(r.type)]) }, null, 2), j(g).isVisual(r) ? (S(), s("div", {
1672
1752
  key: 0,
1673
- class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? F.value : ""])
1674
- }, [J(i, r) ? (S(), s("div", Bt, [c("span", Vt, [u(j(re), {
1753
+ class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? I.value : ""])
1754
+ }, [j(w).isAssetLoading(i, r) ? (S(), s("div", Zt, [c("span", Qt, [u(j(re), {
1675
1755
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
1676
1756
  "aria-hidden": "true"
1677
- })])])) : o("", !0), se(i, r) ? (S(), s("div", {
1757
+ })])])) : o("", !0), j(w).isAssetErrored(i, r) ? (S(), s("div", {
1678
1758
  key: 1,
1679
1759
  "data-testid": "vibe-asset-error",
1680
- "data-kind": Y(r),
1760
+ "data-kind": j(w).getAssetErrorKind(r),
1681
1761
  class: "grid h-full w-full place-items-center"
1682
- }, [c("div", Ut, [
1762
+ }, [c("div", en, [
1683
1763
  u(j(oe), {
1684
1764
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
1685
1765
  "aria-hidden": "true"
1686
1766
  }),
1687
- c("p", Wt, k(ne(r)), 1),
1688
- j(g).canRetryAsset(Z(r)) ? (S(), s("button", {
1767
+ c("p", tn, k(j(w).getAssetErrorLabel(r)), 1),
1768
+ j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
1689
1769
  key: 0,
1690
1770
  type: "button",
1691
1771
  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",
1692
- onClick: ee((e) => j(g).retryAsset(Z(r)), ["stop"])
1693
- }, " Retry ", 8, Gt)) : o("", !0)
1694
- ])], 8, Ht)) : r.type === "image" ? (S(), s("img", {
1695
- key: j(g).getAssetRenderKey(Z(r)),
1696
- src: ce(i, r),
1772
+ onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
1773
+ }, " Retry ", 8, nn)) : o("", !0)
1774
+ ])], 8, $t)) : r.type === "image" ? (S(), s("img", {
1775
+ key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1776
+ src: j(w).getFullscreenImageSource(i, r),
1697
1777
  alt: r.title ?? "",
1698
1778
  draggable: "false",
1699
- class: _(["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", j(g).isImageReady(Z(r)) ? "opacity-100" : "opacity-0"]),
1779
+ class: _(["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", j(g).isImageReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
1700
1780
  ref_for: !0,
1701
- ref: (e) => j(g).registerImageElement(Z(r), e),
1702
- onLoad: (e) => j(g).onImageLoad(Z(r), r.url),
1703
- onError: (e) => j(g).onImageError(Z(r), r.url)
1704
- }, null, 42, Kt)) : (S(), s("video", {
1705
- key: j(g).getAssetRenderKey(Z(r)),
1706
- class: _(["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", j(g).isMediaReady(Z(r)) ? "opacity-100" : "opacity-0"]),
1781
+ ref: (e) => j(g).registerImageElement(j(w).getItemKey(r), e),
1782
+ onLoad: (e) => j(g).onImageLoad(j(w).getItemKey(r), r.url),
1783
+ onError: (e) => j(g).onImageError(j(w).getItemKey(r), r.url)
1784
+ }, null, 42, rn)) : (S(), s("video", {
1785
+ key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1786
+ class: _(["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", j(g).isMediaReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
1707
1787
  playsinline: "",
1708
1788
  muted: "",
1709
- src: le(i, r),
1710
- preload: X(i) ? "metadata" : "none",
1789
+ src: j(w).getFullscreenMediaSource(i, r),
1790
+ preload: j(w).shouldPreloadSlideAsset(i) ? "metadata" : "none",
1711
1791
  ref_for: !0,
1712
- ref: (e) => j(g).registerVideoElement(Z(r), e),
1713
- onClick: ee((e) => j(g).onVideoClick(e, Z(r)), ["stop"]),
1714
- onCanplay: (e) => j(g).onMediaEvent(Z(r), e),
1715
- onDurationchange: (e) => j(g).onMediaEvent(Z(r), e),
1716
- onError: (e) => j(g).onMediaError(Z(r), r.url),
1717
- onLoadstart: (e) => j(g).onMediaEvent(Z(r), e),
1718
- onLoadedmetadata: (e) => j(g).onMediaEvent(Z(r), e),
1719
- onPause: (e) => j(g).onMediaEvent(Z(r), e),
1720
- onPlay: (e) => j(g).onMediaEvent(Z(r), e),
1721
- onPlaying: (e) => j(g).onMediaEvent(Z(r), e),
1722
- onSeeking: (e) => j(g).onMediaEvent(Z(r), e),
1723
- onSeeked: (e) => j(g).onMediaEvent(Z(r), e),
1724
- onStalled: (e) => j(g).onMediaEvent(Z(r), e),
1725
- onTimeupdate: (e) => j(g).onMediaEvent(Z(r), e),
1726
- onWaiting: (e) => j(g).onMediaEvent(Z(r), e)
1727
- }, null, 42, qt))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
1792
+ ref: (e) => j(g).registerVideoElement(j(w).getItemKey(r), e),
1793
+ onClick: z((e) => j(g).onVideoClick(e, j(w).getItemKey(r)), ["stop"]),
1794
+ onCanplay: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1795
+ onDurationchange: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1796
+ onError: (e) => j(g).onMediaError(j(w).getItemKey(r), r.url),
1797
+ onLoadstart: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1798
+ onLoadedmetadata: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1799
+ onPause: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1800
+ onPlay: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1801
+ onPlaying: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1802
+ onSeeking: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1803
+ onSeeked: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1804
+ onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1805
+ onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1806
+ onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
1807
+ }, null, 42, an))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
1728
1808
  key: 1,
1729
- 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", i === j(g).resolvedActiveIndex.value ? F.value : ""])
1730
- }, [c("div", Jt, [
1809
+ 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", i === j(g).resolvedActiveIndex.value ? I.value : ""])
1810
+ }, [c("div", on, [
1731
1811
  c("button", {
1732
1812
  type: "button",
1733
1813
  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]",
1734
- "aria-label": j(g).mediaStates.value[Z(r)]?.paused ?? !0 ? q("Play", r) : q("Pause", r),
1735
- disabled: !!Y(r),
1736
- onClick: (e) => j(g).onAudioCoverClick(e, Z(r))
1814
+ "aria-label": j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(w).getMediaActionLabel("Play", r) : j(w).getMediaActionLabel("Pause", r),
1815
+ disabled: !!j(w).getAssetErrorKind(r),
1816
+ onClick: (e) => j(g).onAudioCoverClick(e, j(w).getItemKey(r))
1737
1817
  }, [
1738
1818
  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),
1739
1819
  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),
1740
- c("span", Xt, [D(e.$slots, "item-icon", {
1741
- icon: j(kt)(r.type),
1820
+ c("span", cn, [D(e.$slots, "item-icon", {
1821
+ icon: j(dt)(r.type),
1742
1822
  item: r
1743
- }, () => [(S(), a(O(j(kt)(r.type)), {
1823
+ }, () => [(S(), a(O(j(dt)(r.type)), {
1744
1824
  class: "h-6 w-6 stroke-[1.9]",
1745
1825
  "aria-hidden": "true"
1746
1826
  }))])]),
1747
- c("span", Zt, [(S(), a(O(j(g).mediaStates.value[Z(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
1827
+ c("span", ln, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
1748
1828
  class: "h-4 w-4 stroke-2",
1749
1829
  "aria-hidden": "true"
1750
1830
  }))])
1751
- ], 8, Yt),
1752
- J(i, r) ? (S(), s("div", Qt, [c("span", $t, [u(j(re), {
1831
+ ], 8, sn),
1832
+ j(w).isAssetLoading(i, r) ? (S(), s("div", un, [c("span", dn, [u(j(re), {
1753
1833
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
1754
1834
  "aria-hidden": "true"
1755
1835
  })])])) : o("", !0),
1756
- Y(r) ? (S(), s(t, { key: 1 }, [n[8] ||= c("div", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(239,68,68,0.12),transparent_66%)]" }, null, -1), c("div", {
1836
+ j(w).getAssetErrorKind(r) ? (S(), s(t, { key: 1 }, [n[8] ||= c("div", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(239,68,68,0.12),transparent_66%)]" }, null, -1), c("div", {
1757
1837
  "data-testid": "vibe-asset-error",
1758
- "data-kind": Y(r),
1838
+ "data-kind": j(w).getAssetErrorKind(r),
1759
1839
  class: "relative z-[1] grid justify-items-center gap-4"
1760
1840
  }, [
1761
1841
  u(j(oe), {
1762
1842
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
1763
1843
  "aria-hidden": "true"
1764
1844
  }),
1765
- c("p", tn, k(ne(r)), 1),
1766
- j(g).canRetryAsset(Z(r)) ? (S(), s("button", {
1845
+ c("p", pn, k(j(w).getAssetErrorLabel(r)), 1),
1846
+ j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
1767
1847
  key: 0,
1768
1848
  type: "button",
1769
1849
  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",
1770
- onClick: ee((e) => j(g).retryAsset(Z(r)), ["stop"])
1771
- }, " Retry ", 8, nn)) : o("", !0)
1772
- ], 8, en)], 64)) : o("", !0)
1850
+ onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
1851
+ }, " Retry ", 8, mn)) : o("", !0)
1852
+ ], 8, fn)], 64)) : o("", !0)
1773
1853
  ]), (S(), s("audio", {
1774
- key: j(g).getAssetRenderKey(Z(r)),
1775
- src: le(i, r),
1776
- preload: X(i) ? "metadata" : "none",
1854
+ key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1855
+ src: j(w).getFullscreenMediaSource(i, r),
1856
+ preload: j(w).shouldPreloadSlideAsset(i) ? "metadata" : "none",
1777
1857
  class: "pointer-events-none absolute h-px w-px opacity-0",
1778
1858
  ref_for: !0,
1779
- ref: (e) => j(g).registerAudioElement(Z(r), e),
1780
- onCanplay: (e) => j(g).onMediaEvent(Z(r), e),
1781
- onDurationchange: (e) => j(g).onMediaEvent(Z(r), e),
1782
- onError: (e) => j(g).onMediaError(Z(r), r.url),
1783
- onLoadstart: (e) => j(g).onMediaEvent(Z(r), e),
1784
- onLoadedmetadata: (e) => j(g).onMediaEvent(Z(r), e),
1785
- onPause: (e) => j(g).onMediaEvent(Z(r), e),
1786
- onPlay: (e) => j(g).onMediaEvent(Z(r), e),
1787
- onPlaying: (e) => j(g).onMediaEvent(Z(r), e),
1788
- onSeeking: (e) => j(g).onMediaEvent(Z(r), e),
1789
- onSeeked: (e) => j(g).onMediaEvent(Z(r), e),
1790
- onStalled: (e) => j(g).onMediaEvent(Z(r), e),
1791
- onTimeupdate: (e) => j(g).onMediaEvent(Z(r), e),
1792
- onWaiting: (e) => j(g).onMediaEvent(Z(r), e)
1793
- }, null, 40, rn))], 2)) : (S(), s("div", an, [c("div", on, [D(e.$slots, "item-icon", {
1794
- icon: j(kt)(r.type),
1859
+ ref: (e) => j(g).registerAudioElement(j(w).getItemKey(r), e),
1860
+ onCanplay: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1861
+ onDurationchange: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1862
+ onError: (e) => j(g).onMediaError(j(w).getItemKey(r), r.url),
1863
+ onLoadstart: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1864
+ onLoadedmetadata: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1865
+ onPause: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1866
+ onPlay: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1867
+ onPlaying: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1868
+ onSeeking: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1869
+ onSeeked: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1870
+ onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1871
+ onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1872
+ onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
1873
+ }, null, 40, hn))], 2)) : (S(), s("div", gn, [c("div", _n, [D(e.$slots, "item-icon", {
1874
+ icon: j(dt)(r.type),
1795
1875
  item: r
1796
- }, () => [(S(), a(O(j(kt)(r.type)), {
1876
+ }, () => [(S(), a(O(j(dt)(r.type)), {
1797
1877
  class: "h-6 w-6 stroke-[1.9]",
1798
1878
  "aria-hidden": "true"
1799
- }))])])]))], 14, zt))), 128)),
1800
- L.value && p["fullscreen-overlay"] ? (S(), s("div", sn, [c("div", cn, [D(e.$slots, "fullscreen-overlay", v(f(L.value)))])])) : o("", !0),
1801
- j(g).activeItem.value ? (S(), a(ot, {
1879
+ }))])])]))], 14, Xt))), 128)),
1880
+ R.value && p["fullscreen-overlay"] ? (S(), s("div", vn, [c("div", yn, [D(e.$slots, "fullscreen-overlay", v(f(R.value)))])])) : o("", !0),
1881
+ j(g).activeItem.value ? (S(), a(ct, {
1802
1882
  key: 1,
1803
1883
  "current-index": j(g).resolvedActiveIndex.value,
1804
1884
  "pagination-detail": j(g).paginationDetail.value,
@@ -1807,9 +1887,9 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1807
1887
  title: j(g).activeItem.value.title ?? null,
1808
1888
  total: j(g).items.value.length,
1809
1889
  onBackToList: n[0] ||= (e) => m("back-to-list")
1810
- }, l({ _: 2 }, [H.value && L.value ? {
1890
+ }, l({ _: 2 }, [G.value && R.value ? {
1811
1891
  name: "actions",
1812
- fn: I(() => [D(e.$slots, "fullscreen-header-actions", v(f(L.value)))]),
1892
+ fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(R.value)))]),
1813
1893
  key: "0"
1814
1894
  } : void 0]), 1032, [
1815
1895
  "current-index",
@@ -1819,7 +1899,7 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1819
1899
  "title",
1820
1900
  "total"
1821
1901
  ])) : o("", !0),
1822
- P.value ? (S(), a(Ye, {
1902
+ F.value ? (S(), a(Ze, {
1823
1903
  key: 2,
1824
1904
  "current-time": j(g).activeMediaState.value.currentTime,
1825
1905
  "current-time-label": j(g).formatPlaybackTime(j(g).activeMediaState.value.currentTime),
@@ -1835,13 +1915,38 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1835
1915
  "progress",
1836
1916
  "onSeekInput"
1837
1917
  ])) : o("", !0),
1838
- B.value ? (S(), s("div", {
1918
+ H.value ? (S(), s("div", {
1839
1919
  key: 3,
1840
- class: _(["absolute left-1/2 z-[4] -translate-x-1/2", N.value])
1841
- }, [K.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, B.value))) : (S(), s("div", {
1920
+ class: _(["absolute left-1/2 z-[4] -translate-x-1/2", P.value])
1921
+ }, [Y.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, H.value))) : (S(), s("div", {
1842
1922
  key: 1,
1843
- class: _(["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", B.value.kind === "end" ? "border-amber-300/35 text-amber-200" : ""])
1844
- }, k(B.value.message), 3))], 2)) : o("", !0)
1923
+ "data-testid": "vibe-fullscreen-status-badge",
1924
+ class: _(["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", H.value.kind === "end" ? "border-amber-300/35 text-amber-200" : H.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
1925
+ }, k(H.value.message), 3))], 2)) : o("", !0)
1926
+ ])) : j(ne) && j(X) ? (S(), a(qt, {
1927
+ key: 1,
1928
+ message: j(X).message,
1929
+ mode: j(X).mode,
1930
+ surface: j(X).surface
1931
+ }, {
1932
+ default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(X)))) : o("", !0)]),
1933
+ _: 3
1934
+ }, 8, [
1935
+ "message",
1936
+ "mode",
1937
+ "surface"
1938
+ ])) : o("", !0), j(ee) && j(X) ? (S(), a(qt, {
1939
+ key: 2,
1940
+ message: j(X).message,
1941
+ mode: j(X).mode,
1942
+ surface: j(X).surface
1943
+ }, {
1944
+ default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(X)))) : o("", !0)]),
1945
+ _: 3
1946
+ }, 8, [
1947
+ "message",
1948
+ "mode",
1949
+ "surface"
1845
1950
  ])) : o("", !0)], 544), u(r, {
1846
1951
  "enter-active-class": "transform-gpu transition-all duration-320 ease-out",
1847
1952
  "enter-from-class": "translate-x-full opacity-0",
@@ -1850,7 +1955,7 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1850
1955
  "leave-from-class": "translate-x-0 opacity-100",
1851
1956
  "leave-to-class": "translate-x-full opacity-0"
1852
1957
  }, {
1853
- default: I(() => [W.value && L.value ? (S(), s("aside", ln, [c("div", un, [D(e.$slots, "fullscreen-aside", v(f(L.value)))])])) : o("", !0)]),
1958
+ default: L(() => [q.value && R.value ? (S(), s("aside", bn, [c("div", xn, [D(e.$slots, "fullscreen-aside", v(f(R.value)))])])) : o("", !0)]),
1854
1959
  _: 3
1855
1960
  })], 4),
1856
1961
  u(r, {
@@ -1861,29 +1966,29 @@ var Lt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1861
1966
  "leave-from-class": "translate-x-0 opacity-100",
1862
1967
  "leave-to-class": "translate-x-full opacity-0"
1863
1968
  }, {
1864
- default: I(() => [G.value && L.value ? (S(), s("aside", dn, [c("div", fn, [D(e.$slots, "fullscreen-aside", v(f(L.value)))])])) : o("", !0)]),
1969
+ default: L(() => [J.value && R.value ? (S(), s("aside", Sn, [c("div", Cn, [D(e.$slots, "fullscreen-aside", v(f(R.value)))])])) : o("", !0)]),
1865
1970
  _: 3
1866
1971
  })
1867
1972
  ]));
1868
1973
  }
1869
- }), gn = 1, _n = .5;
1870
- function vn(e) {
1974
+ }), En = 1, Dn = .5;
1975
+ function On(e) {
1871
1976
  if (e.type !== "image" && e.type !== "video") return {
1872
- width: gn,
1873
- height: gn,
1977
+ width: En,
1978
+ height: En,
1874
1979
  source: "fallback"
1875
1980
  };
1876
1981
  let t = e.preview?.width, n = e.preview?.height;
1877
- if (Tn(t) && Tn(n)) {
1878
- let r = En(e, t, n);
1982
+ if (Fn(t) && Fn(n)) {
1983
+ let r = In(e, t, n);
1879
1984
  return {
1880
1985
  width: r.width,
1881
1986
  height: r.height,
1882
1987
  source: "preview"
1883
1988
  };
1884
1989
  }
1885
- if (Tn(e.width) && Tn(e.height)) {
1886
- let t = En(e, e.width, e.height);
1990
+ if (Fn(e.width) && Fn(e.height)) {
1991
+ let t = In(e, e.width, e.height);
1887
1992
  return {
1888
1993
  width: t.width,
1889
1994
  height: t.height,
@@ -1891,31 +1996,31 @@ function vn(e) {
1891
1996
  };
1892
1997
  }
1893
1998
  return {
1894
- width: gn,
1895
- height: gn,
1999
+ width: En,
2000
+ height: En,
1896
2001
  source: "fallback"
1897
2002
  };
1898
2003
  }
1899
- function yn(e, t) {
2004
+ function kn(e, t) {
1900
2005
  return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
1901
2006
  }
1902
- function bn(e, t, n, r = 0) {
2007
+ function An(e, t, n, r = 0) {
1903
2008
  if (!e || e <= 0 || !t || t <= 0) return n;
1904
2009
  let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
1905
2010
  return !a || a <= 0 ? n : a / t;
1906
2011
  }
1907
- function xn(e, t) {
1908
- let n = vn(e);
2012
+ function jn(e, t) {
2013
+ let n = On(e);
1909
2014
  return n.height / n.width * t;
1910
2015
  }
1911
- function Sn(e, t) {
2016
+ function Mn(e, t) {
1912
2017
  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;
1913
2018
  for (let c = 0; c < e.length; c += 1) {
1914
2019
  let l = e[c];
1915
- o.set(Q(l), c);
2020
+ o.set($(l), c);
1916
2021
  let u = 0;
1917
2022
  for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
1918
- let d = u * (t.columnWidth + t.gapX), f = n[u], p = xn(l, t.columnWidth);
2023
+ let d = u * (t.columnWidth + t.gapX), f = n[u], p = jn(l, t.columnWidth);
1919
2024
  r[c] = {
1920
2025
  x: d,
1921
2026
  y: f
@@ -1934,7 +2039,7 @@ function Sn(e, t) {
1934
2039
  indexById: o
1935
2040
  };
1936
2041
  }
1937
- function Cn(e) {
2042
+ function Nn(e) {
1938
2043
  if (e.itemCount <= 0) return [];
1939
2044
  if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
1940
2045
  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();
@@ -1944,21 +2049,21 @@ function Cn(e) {
1944
2049
  }
1945
2050
  return Array.from(a).sort((e, t) => e - t);
1946
2051
  }
1947
- function wn(e, t, n) {
2052
+ function Pn(e, t, n) {
1948
2053
  let r = /* @__PURE__ */ new Map();
1949
2054
  for (let i of e) {
1950
- let e = t.get(Q(i));
2055
+ let e = t.get($(i));
1951
2056
  if (e == null) continue;
1952
2057
  let a = n[e];
1953
- a && r.set(Q(i), a);
2058
+ a && r.set($(i), a);
1954
2059
  }
1955
2060
  return r;
1956
2061
  }
1957
- function Tn(e) {
2062
+ function Fn(e) {
1958
2063
  return typeof e == "number" && Number.isFinite(e) && e > 0;
1959
2064
  }
1960
- function En(e, t, n) {
1961
- return e.type !== "image" || n / t >= _n ? {
2065
+ function In(e, t, n) {
2066
+ return e.type !== "image" || n / t >= Dn ? {
1962
2067
  width: t,
1963
2068
  height: n
1964
2069
  } : {
@@ -1968,149 +2073,193 @@ function En(e, t, n) {
1968
2073
  }
1969
2074
  //#endregion
1970
2075
  //#region src/components/viewer-core/useMasonryMotion.ts
1971
- var Dn = 300, On = 600, kn = 40, An = 400;
1972
- function jn(e, t) {
2076
+ var Ln = 300, Rn = 600, zn = 40, Bn = 300, Vn = 400;
2077
+ function Hn(e, t) {
1973
2078
  return t === "top" ? [...e].reverse() : e;
1974
2079
  }
1975
- function Mn(e) {
1976
- return e <= 0 ? On : On + Math.min((e - 1) * kn, An);
2080
+ function Un(e) {
2081
+ return e <= 0 ? Rn : Rn + Math.min((e - 1) * zn, Vn);
1977
2082
  }
1978
- function Nn(e) {
2083
+ function Wn() {
2084
+ return Bn;
2085
+ }
2086
+ function Gn(e) {
1979
2087
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
1980
2088
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
1981
2089
  }
1982
- function Pn(e) {
1983
- let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), i = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
1984
- P(e.visibleIndices, (a) => {
1985
- if (!a.length) return;
2090
+ function Kn(e) {
2091
+ let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Map()), u = T(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
2092
+ F(e.visibleIndices, (i) => {
2093
+ if (!i.length) return;
1986
2094
  let o = [];
1987
- for (let n of a) {
1988
- let r = e.items.value[n] ? Q(e.items.value[n]) : null;
1989
- !r || !t.value.has(r) || c.has(r) || (c.add(r), o.push(r));
2095
+ for (let n of i) {
2096
+ let r = e.items.value[n] ? $(e.items.value[n]) : null;
2097
+ !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
1990
2098
  }
1991
2099
  if (!o.length) return;
1992
- let s = jn(o, i.value.get(o[0]) ?? "bottom"), l = new Map(r.value);
1993
- for (let e = 0; e < s.length; e += 1) l.set(s[e], Math.min(e * kn, An));
1994
- r.value = l, Fn(() => {
2100
+ let s = Hn(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2101
+ for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * zn, Vn));
2102
+ r.value = c, qn(() => {
1995
2103
  let e = new Set(n.value);
1996
2104
  for (let t of o) e.add(t);
1997
2105
  n.value = e;
1998
- }), In(() => {
2106
+ }), Jn(() => {
1999
2107
  let e = new Set(t.value);
2000
2108
  for (let t of o) e.delete(t);
2001
- t.value = e, h(() => {
2002
- let e = new Set(n.value), t = new Map(r.value), a = new Map(i.value);
2003
- for (let n of o) e.delete(n), t.delete(n), a.delete(n), c.delete(n);
2004
- n.value = e, r.value = t, i.value = a;
2005
- }, Mn(o.length));
2109
+ t.value = e, S(() => {
2110
+ let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
2111
+ for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
2112
+ n.value = e, r.value = t, a.value = i;
2113
+ }, Un(o.length));
2006
2114
  });
2007
- }, { flush: "post" }), b(() => {
2008
- for (let e of l) clearTimeout(e);
2009
- l.clear();
2115
+ }, { flush: "post" }), F(() => e.items.value.map((e) => $(e)), (e) => {
2116
+ if (!e.length || !o.value.size) return;
2117
+ let t = new Set(e), n = null, r = null;
2118
+ for (let e of o.value.keys()) t.has(e) && (n ||= new Map(o.value), r ||= new Set(s.value), n.delete(e), r.delete(e));
2119
+ n && (o.value = n), r && (s.value = r);
2120
+ }), b(() => {
2121
+ for (let e of f) clearTimeout(e);
2122
+ f.clear();
2010
2123
  });
2011
- function u(e, n = "bottom") {
2124
+ function m(e, n = "bottom") {
2012
2125
  if (!e.length) return;
2013
- let r = new Set(t.value), a = new Map(i.value);
2126
+ let r = new Set(t.value), i = new Map(a.value);
2014
2127
  for (let t of e) {
2015
- let e = Q(t);
2016
- r.add(e), a.set(e, n);
2128
+ let e = $(t);
2129
+ r.add(e), i.set(e, n);
2017
2130
  }
2018
- t.value = r, i.value = a;
2131
+ t.value = r, a.value = i;
2019
2132
  }
2020
- function d(t, n, r = Dn) {
2133
+ function h(e) {
2134
+ if (!e.length) return;
2135
+ let i = new Map(o.value), c = new Set(t.value), l = new Set(n.value), u = new Map(r.value), f = new Map(a.value), p = [];
2136
+ for (let t of e) {
2137
+ let e = $(t.item);
2138
+ p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
2139
+ }
2140
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, qn(() => {
2141
+ let e = new Set(s.value);
2142
+ for (let t of p) e.add(t);
2143
+ s.value = e;
2144
+ }), S(() => {
2145
+ let e = new Map(o.value), t = new Set(s.value);
2146
+ for (let n of p) e.delete(n), t.delete(n);
2147
+ o.value = e, s.value = t;
2148
+ }, Bn);
2149
+ }
2150
+ function g(t, n, r = Ln) {
2021
2151
  if (!t.size) return;
2022
- let i = /* @__PURE__ */ new Map(), c = [];
2023
- for (let [r, a] of t.entries()) {
2152
+ let i = /* @__PURE__ */ new Map(), a = [];
2153
+ for (let [r, o] of t.entries()) {
2024
2154
  if (n?.has(r)) continue;
2025
2155
  let t = e.indexById.value.get(r);
2026
2156
  if (t == null) continue;
2027
- let o = e.positions.value[t];
2028
- if (!o) continue;
2029
- let s = a.x - o.x, l = a.y - o.y;
2030
- !s && !l || (i.set(r, {
2031
- dx: s,
2157
+ let s = e.positions.value[t];
2158
+ if (!s) continue;
2159
+ let c = o.x - s.x, l = o.y - s.y;
2160
+ !c && !l || (i.set(r, {
2161
+ dx: c,
2032
2162
  dy: l
2033
- }), c.push(r));
2163
+ }), a.push(r));
2034
2164
  }
2035
2165
  if (!i.size) return;
2036
- a.value = i, s.value = /* @__PURE__ */ new Set();
2037
- let l = new Map(o.value);
2038
- for (let e of c) l.set(e, r);
2039
- o.value = l, Fn(() => {
2040
- s.value = new Set(c), Fn(() => {
2041
- a.value = /* @__PURE__ */ new Map();
2166
+ c.value = i, u.value = /* @__PURE__ */ new Set();
2167
+ let o = new Map(l.value);
2168
+ for (let e of a) o.set(e, r);
2169
+ l.value = o, qn(() => {
2170
+ u.value = new Set(a), qn(() => {
2171
+ c.value = /* @__PURE__ */ new Map();
2042
2172
  });
2043
- }), h(() => {
2044
- s.value = /* @__PURE__ */ new Set();
2045
- let e = new Map(o.value);
2046
- for (let t of c) e.delete(t);
2047
- o.value = e;
2173
+ }), S(() => {
2174
+ u.value = /* @__PURE__ */ new Set();
2175
+ let e = new Map(l.value);
2176
+ for (let t of a) e.delete(t);
2177
+ l.value = e;
2048
2178
  }, r);
2049
2179
  }
2050
- function f(e) {
2051
- if (n.value.has(e)) return `transform ${On}ms ease-out`;
2052
- if (s.value.has(e)) return `transform ${o.value.get(e) ?? Dn}ms ease-out`;
2180
+ function _(e) {
2181
+ if (n.value.has(e)) return `transform ${Rn}ms ease-out`;
2182
+ if (u.value.has(e)) return `transform ${l.value.get(e) ?? Ln}ms ease-out`;
2053
2183
  }
2054
- function p(e) {
2184
+ function v(e) {
2055
2185
  if (!n.value.has(e)) return;
2056
2186
  let t = r.value.get(e) ?? 0;
2057
2187
  return t > 0 ? `${t}ms` : void 0;
2058
2188
  }
2059
- function m(n) {
2060
- let r = e.items.value[n], o = e.positions.value[n] ?? {
2189
+ function y(n) {
2190
+ let r = e.items.value[n], i = e.positions.value[n] ?? {
2061
2191
  x: 0,
2062
2192
  y: 0
2063
- }, s = e.heights.value[n] ?? e.columnWidth.value, c = r ? Q(r) : null, l = c ? a.value.get(c) ?? {
2193
+ }, o = e.heights.value[n] ?? e.columnWidth.value, s = r ? $(r) : null, l = s ? c.value.get(s) ?? {
2064
2194
  dx: 0,
2065
2195
  dy: 0
2066
2196
  } : {
2067
2197
  dx: 0,
2068
2198
  dy: 0
2069
- }, u = c ? i.value.get(c) ?? "bottom" : "bottom", d = c && t.value.has(c) ? Nn({
2199
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Gn({
2070
2200
  columnWidth: e.columnWidth.value,
2071
2201
  direction: u,
2072
- itemHeight: s,
2202
+ itemHeight: o,
2073
2203
  scrollTop: e.scrollTop.value,
2074
2204
  viewportHeight: e.viewportHeight.value
2075
- }) : o.y;
2076
- return `translate3d(${o.x + l.dx}px, ${d + l.dy}px, 0)`;
2205
+ }) : i.y;
2206
+ return `translate3d(${i.x + l.dx}px, ${d + l.dy}px, 0)`;
2077
2207
  }
2078
- function h(e, t) {
2208
+ function x(t) {
2209
+ let n = $(t), r = o.value.get(n);
2210
+ if (!r) return {
2211
+ opacity: "0",
2212
+ transform: "translate3d(0, 0, 0) scale(0.96)",
2213
+ transition: `opacity ${Bn}ms ease-out, transform ${Bn}ms ease-out`
2214
+ };
2215
+ let i = s.value.has(n);
2216
+ return {
2217
+ height: `${r.height}px`,
2218
+ opacity: i ? "0" : "1",
2219
+ transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
2220
+ transition: `opacity ${Bn}ms ease-out, transform ${Bn}ms ease-out`,
2221
+ width: `${e.columnWidth.value}px`
2222
+ };
2223
+ }
2224
+ function S(e, t) {
2079
2225
  let n = setTimeout(() => {
2080
- l.delete(n), e();
2226
+ f.delete(n), e();
2081
2227
  }, t);
2082
- l.add(n);
2228
+ f.add(n);
2083
2229
  }
2084
2230
  return {
2085
- getCardTransform: m,
2086
- getCardTransition: f,
2087
- getCardTransitionDelay: p,
2088
- markEnter: u,
2089
- playFlipMoveAnimation: d
2231
+ getCardTransform: y,
2232
+ getCardTransition: _,
2233
+ getCardTransitionDelay: v,
2234
+ getLeavingCardStyle: x,
2235
+ leavingItems: p,
2236
+ markEnter: m,
2237
+ markLeave: h,
2238
+ playFlipMoveAnimation: g
2090
2239
  };
2091
2240
  }
2092
- function Fn(e) {
2241
+ function qn(e) {
2093
2242
  if (typeof requestAnimationFrame == "function") {
2094
2243
  requestAnimationFrame(() => e());
2095
2244
  return;
2096
2245
  }
2097
2246
  setTimeout(e, 0);
2098
2247
  }
2099
- function In(e) {
2100
- Fn(() => Fn(e));
2248
+ function Jn(e) {
2249
+ qn(() => qn(e));
2101
2250
  }
2102
2251
  //#endregion
2103
2252
  //#region src/components/viewer-core/masonryViewport.ts
2104
- function Ln(e, t) {
2105
- return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || window.innerHeight || t || 1;
2253
+ function Yn(e, t) {
2254
+ return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
2106
2255
  }
2107
- function Rn(e, t, n) {
2108
- return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || window.innerWidth || t || n;
2256
+ function Xn(e, t, n) {
2257
+ return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
2109
2258
  }
2110
- function zn(e, t, n, r) {
2259
+ function Zn(e, t, n, r) {
2111
2260
  return (e?.scrollHeight ?? r) - (t + n);
2112
2261
  }
2113
- function Bn(e, t) {
2262
+ function Qn(e, t) {
2114
2263
  return {
2115
2264
  height: `${e}px`,
2116
2265
  transform: `translate3d(0, ${t}px, 0)`
@@ -2118,8 +2267,8 @@ function Bn(e, t) {
2118
2267
  }
2119
2268
  //#endregion
2120
2269
  //#region src/components/viewer-core/useEdgeBoundary.ts
2121
- var Vn = 250, Hn = 1e3;
2122
- function Un(e) {
2270
+ var $n = 250, er = 1e3;
2271
+ function tr(e) {
2123
2272
  let t = T(!1), n = T(!1), r = T(0), i = T(0), a = T(!1), o = T(!1), s = 0, c = null;
2124
2273
  b(() => {
2125
2274
  y();
@@ -2135,7 +2284,7 @@ function Un(e) {
2135
2284
  function u(t) {
2136
2285
  if (!x(t) || !e.isAtBoundary()) return;
2137
2286
  let n = Date.now();
2138
- n < s || (s = n + Vn, m());
2287
+ n < s || (s = n + $n, m());
2139
2288
  }
2140
2289
  function d() {
2141
2290
  if (!g()) return;
@@ -2163,13 +2312,13 @@ function Un(e) {
2163
2312
  h() && (r.value += 1);
2164
2313
  }
2165
2314
  function h() {
2166
- return e.hasPage.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2315
+ return e.hasPage.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2167
2316
  }
2168
2317
  function g() {
2169
- return e.hasPage.value && t.value && r.value > i.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2318
+ return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2170
2319
  }
2171
2320
  function _() {
2172
- o.value = !1, v(Hn);
2321
+ o.value = !1, v(er);
2173
2322
  }
2174
2323
  function v(e) {
2175
2324
  y(), a.value = !0, c = setTimeout(() => {
@@ -2192,133 +2341,166 @@ function Un(e) {
2192
2341
  }
2193
2342
  //#endregion
2194
2343
  //#region src/components/viewer-core/useMasonryList.ts
2195
- var Wn = 600, $ = 24, Gn = 16, Kn = 300, qn = 200, Jn = 200, Yn = 200, Xn = 300, Zn = 24, Qn = 48, $n = 500, er = 1e3;
2196
- function tr(e) {
2197
- let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || Kn), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = i(() => Math.max(Kn, a.value - $ * 2)), p = i(() => yn(f.value, Kn)), m = i(() => bn(f.value, p.value, Kn, Gn)), h = i(() => nr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), _ = i(() => Cn({
2344
+ var nr = 600, rr = 24, ir = 16, ar = 300, or = 200, sr = 200, cr = 200, lr = 300, ur = 24, dr = 48, fr = 500, pr = 1e3;
2345
+ function mr(e) {
2346
+ let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || ar), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = T(!1), m = i(() => Math.max(ar, a.value - rr * 2)), h = i(() => kn(m.value, ar)), _ = i(() => An(m.value, h.value, ar, ir)), v = i(() => hr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Nn({
2198
2347
  itemCount: e.items.value.length,
2199
2348
  viewportHeight: r.value,
2200
2349
  scrollTop: n.value,
2201
- overscanPx: qn,
2202
- bucketPx: Wn,
2350
+ overscanPx: or,
2351
+ bucketPx: nr,
2203
2352
  buckets: c.value
2204
- })), v = i(() => _.value.map((t) => ({
2353
+ })), S = i(() => y.value.map((t) => ({
2205
2354
  item: e.items.value[t],
2206
2355
  index: t
2207
- }))), y = i(() => {
2208
- let e = l.value + $ * 2, t = d.value ?? 0;
2209
- return Math.max(e, t, r.value) + Yn;
2210
- }), S = i(() => e.loading.value ? e.items.value.length > 0 ? "Loading more items" : "Loading the first page" : !e.hasNextPage.value && e.items.value.length > 0 ? "End of list" : null), C = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), w = i(() => `${h.value + 1} / ${e.items.value.length}`), E = i(() => Math.max(0, r.value - Zn * 2)), D = i(() => y.value > r.value + 1 && E.value > 0), O = i(() => {
2211
- if (!D.value) return 0;
2212
- let e = r.value / y.value * E.value;
2213
- return Math.min(E.value, Math.max(Qn, e));
2214
- }), k = i(() => {
2215
- if (!D.value) return Zn;
2216
- let e = Math.max(0, y.value - r.value);
2217
- return Zn + Math.max(0, E.value - O.value) * (e > 0 ? nr(n.value / e, 0, 1) : 0);
2218
- }), A = Pn({
2356
+ }))), C = i(() => {
2357
+ let e = l.value + rr * 2, t = d.value ?? 0;
2358
+ return Math.max(e, t, r.value) + cr;
2359
+ }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value - ur * 2)), O = i(() => C.value > r.value + 1 && D.value > 0), k = i(() => {
2360
+ if (!O.value) return 0;
2361
+ let e = r.value / C.value * D.value;
2362
+ return Math.min(D.value, Math.max(dr, e));
2363
+ }), A = i(() => {
2364
+ if (!O.value) return ur;
2365
+ let e = Math.max(0, C.value - r.value);
2366
+ return ur + Math.max(0, D.value - k.value) * (e > 0 ? hr(n.value / e, 0, 1) : 0);
2367
+ }), j = Kn({
2219
2368
  items: e.items,
2220
- visibleIndices: _,
2369
+ visibleIndices: y,
2221
2370
  positions: o,
2222
2371
  heights: s,
2223
2372
  indexById: u,
2224
- columnWidth: m,
2373
+ columnWidth: _,
2225
2374
  scrollTop: n,
2226
2375
  viewportHeight: r
2227
- }), j = Un({
2376
+ }), M = tr({
2228
2377
  direction: "top",
2229
2378
  getAnimationLockMs(e) {
2230
- return Math.max($n, Mn(e)) + er;
2379
+ return Math.max(fr, Un(e)) + pr;
2231
2380
  },
2232
2381
  hasPage: e.hasPreviousPage,
2382
+ interactionLocked: p,
2233
2383
  isAtBoundary() {
2234
- return n.value <= $ + Gn;
2384
+ return n.value <= rr + ir;
2235
2385
  },
2236
2386
  loading: e.loading,
2237
2387
  requestPage: e.requestPreviousPage
2238
- }), M = Un({
2388
+ }), N = tr({
2239
2389
  direction: "bottom",
2240
2390
  getAnimationLockMs(e) {
2241
- return Mn(e) + er;
2391
+ return Un(e) + pr;
2242
2392
  },
2243
- hasPage: C,
2393
+ hasPage: w,
2394
+ interactionLocked: p,
2244
2395
  isAtBoundary() {
2245
- return J() <= Jn;
2396
+ return re() <= sr;
2246
2397
  },
2247
2398
  loading: e.loading,
2248
2399
  requestPage: e.requestNextPage
2249
- }), N = null, F = 0, I = null, L = !1;
2250
- P([
2251
- () => e.items.value.map((e) => Q(e)),
2252
- p,
2253
- m
2400
+ }), P = null, I = 0, L = null, R = null, z = !1;
2401
+ F([
2402
+ () => e.items.value,
2403
+ h,
2404
+ _
2254
2405
  ], async ([t], [r = []]) => {
2255
- let i = wn(e.items.value, u.value, o.value), a = new Set(r), s = e.items.value.filter((e) => !a.has(Q(e))), c = t.length > r.length && r.length > 0 && t[0] !== r[0], l = c && n.value > $ + Gn ? e.items.value[h.value] : null, d = l ? Q(l) : null;
2256
- ee(), s.length > 0 && (A.markEnter(s, c ? "top" : "bottom"), c ? j.onItemsMutated(s.length) : M.onItemsMutated(s.length)), A.playFlipMoveAnimation(i, new Set(s.map((e) => Q(e))), c ? $n : void 0), d ? (await g(), te(d, i)) : e.active.value && r.length > 0 && U();
2257
- }, { immediate: !0 }), P([
2258
- () => e.pendingAppendItems.value.map((e) => Q(e)),
2259
- p,
2260
- m,
2406
+ let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = Pn(a, u.value, o.value), l = oe(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
2407
+ let t = $(e);
2408
+ if (f.has(t)) return [];
2409
+ let n = c.get(t), r = l.get(t);
2410
+ return !n || r == null ? [] : [{
2411
+ height: r,
2412
+ item: e,
2413
+ position: n
2414
+ }];
2415
+ }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = h && n.value > rr + ir ? t[v.value] : null, b = y ? $(y) : null;
2416
+ _ && (q(Wn()), K()), B(), m.length > 0 && j.markLeave(m), p.length > 0 && (j.markEnter(p, h ? "top" : "bottom"), h ? M.onItemsMutated(p.length) : N.onItemsMutated(p.length)), j.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? fr : void 0), b ? (await g(), G(b, c)) : e.active.value && s.length > 0 && Y();
2417
+ }, { immediate: !0 }), F([
2418
+ () => e.pendingAppendItems.value.map((e) => $(e)),
2419
+ h,
2420
+ _,
2261
2421
  r
2262
2422
  ], ([t]) => {
2263
- ie(), t.length && (d.value = ne([...e.items.value, ...e.pendingAppendItems.value]), re());
2264
- }, { immediate: !0 }), P(() => e.restoreToken.value, async () => {
2265
- await g(), V(h.value, "center");
2266
- }), P(() => e.loading.value, async (t) => {
2267
- !t && !e.pendingAppendItems.value.length && !I && !L && (d.value = null), j.onLoadingChange(t), M.onLoadingChange(t), await g();
2423
+ se(), t.length && (d.value = ae([...e.items.value, ...e.pendingAppendItems.value]), Z());
2424
+ }, { immediate: !0 }), F(() => e.active.value, async (e, i) => {
2425
+ let a = t.value;
2426
+ if (!a) return;
2427
+ if (!e) {
2428
+ f.value = a.scrollTop;
2429
+ return;
2430
+ }
2431
+ if (i !== !1 || f.value == null) return;
2432
+ await g();
2433
+ let o = Math.max(0, C.value - r.value), s = hr(f.value, 0, o);
2434
+ a.scrollTop = s, n.value = s, M.syncBoundary(), N.syncBoundary();
2435
+ }), F(() => e.loading.value, async (t) => {
2436
+ !t && !e.pendingAppendItems.value.length && !L && !z && (d.value = null), M.onLoadingChange(t), N.onLoadingChange(t), await g();
2268
2437
  }), x(async () => {
2269
- G(), await g(), h.value > 0 ? V(h.value, "center") : H(), j.syncBoundary(), M.syncBoundary(), typeof ResizeObserver < "u" ? (N = new ResizeObserver(() => {
2270
- G();
2271
- }), t.value && N.observe(t.value)) : window.addEventListener("resize", G);
2438
+ ee(), await g(), v.value > 0 ? W(v.value, "center") : J(), M.syncBoundary(), N.syncBoundary(), typeof ResizeObserver < "u" ? (P = new ResizeObserver(() => {
2439
+ ee();
2440
+ }), t.value && P.observe(t.value)) : window.addEventListener("resize", ee);
2272
2441
  }), b(() => {
2273
- N?.disconnect(), N = null, window.removeEventListener("resize", G), ie(), F &&= (cancelAnimationFrame(F), 0);
2442
+ P?.disconnect(), P = null, window.removeEventListener("resize", ee), se(), ce(), I &&= (cancelAnimationFrame(I), 0);
2274
2443
  });
2275
- function ee() {
2276
- let t = Sn(e.items.value, {
2277
- columnCount: p.value,
2278
- columnWidth: m.value,
2279
- gapX: Gn,
2280
- gapY: Gn,
2281
- bucketPx: Wn
2444
+ function B() {
2445
+ let t = Mn(e.items.value, {
2446
+ columnCount: h.value,
2447
+ columnWidth: _.value,
2448
+ gapX: ir,
2449
+ gapY: ir,
2450
+ bucketPx: nr
2282
2451
  });
2283
2452
  o.value = t.positions.map((e) => ({
2284
- x: e.x + $,
2285
- y: e.y + $
2453
+ x: e.x + rr,
2454
+ y: e.y + rr
2286
2455
  })), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
2287
2456
  }
2288
- function R() {
2289
- e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = K(), j.syncBoundary(), M.syncBoundary(), W(), !U() && (F ||= requestAnimationFrame(() => {
2290
- F = 0, H();
2457
+ function V() {
2458
+ e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = te(), M.syncBoundary(), N.syncBoundary(), X(), !Y() && (I ||= requestAnimationFrame(() => {
2459
+ I = 0, J();
2291
2460
  })));
2292
2461
  }
2293
- function z(t) {
2294
- e.active.value && (j.onWheel(t), M.onWheel(t), W());
2462
+ function H(t) {
2463
+ e.active.value && (M.onWheel(t), N.onWheel(t), X());
2295
2464
  }
2296
- function B(t) {
2297
- let n = e.items.value[t], r = n ? Q(n) : "";
2465
+ function U(t) {
2466
+ let n = e.items.value[t], r = n ? $(n) : "";
2298
2467
  return {
2299
- height: `${s.value[t] ?? m.value}px`,
2300
- width: `${m.value}px`,
2301
- transition: r ? A.getCardTransition(r) : void 0,
2302
- transitionDelay: r ? A.getCardTransitionDelay(r) : void 0,
2303
- transform: A.getCardTransform(t)
2468
+ height: `${s.value[t] ?? _.value}px`,
2469
+ width: `${_.value}px`,
2470
+ transition: r ? j.getCardTransition(r) : void 0,
2471
+ transitionDelay: r ? j.getCardTransitionDelay(r) : void 0,
2472
+ transform: j.getCardTransform(t)
2304
2473
  };
2305
2474
  }
2306
- function V(e, i) {
2475
+ function W(e, i) {
2307
2476
  let a = t.value, c = o.value[e], l = s.value[e];
2308
2477
  if (!a || !c || !l) return;
2309
- let u = a.scrollTop, d = Math.max(0, y.value - r.value);
2310
- i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - $ : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + $), a.scrollTop = nr(u, 0, d), n.value = a.scrollTop, H();
2478
+ let u = a.scrollTop, d = Math.max(0, C.value - r.value);
2479
+ i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - rr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + rr), a.scrollTop = hr(u, 0, d), n.value = a.scrollTop, J();
2311
2480
  }
2312
- function te(e, r) {
2481
+ function G(e, r) {
2313
2482
  let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
2314
2483
  if (!i || !a || !c) return;
2315
2484
  let l = c.y - a.y;
2316
2485
  i.scrollTop += l, n.value = i.scrollTop;
2317
2486
  }
2318
- function H() {
2319
- if (!_.value.length || U()) return;
2320
- let t = n.value + r.value / 2, i = h.value, a = Infinity;
2321
- for (let e of _.value) {
2487
+ function K() {
2488
+ let e = t.value;
2489
+ if (!e) {
2490
+ n.value = 0;
2491
+ return;
2492
+ }
2493
+ e.scrollTop = 0, n.value = 0, M.syncBoundary(), N.syncBoundary();
2494
+ }
2495
+ function q(e) {
2496
+ ce(), p.value = !0, R = setTimeout(() => {
2497
+ R = null, p.value = !1;
2498
+ }, Math.max(0, e));
2499
+ }
2500
+ function J() {
2501
+ if (!y.value.length || Y()) return;
2502
+ let t = n.value + r.value / 2, i = v.value, a = Infinity;
2503
+ for (let e of y.value) {
2322
2504
  let n = o.value[e], r = s.value[e];
2323
2505
  if (!n || !r) continue;
2324
2506
  let c = n.y + r / 2, l = Math.abs(c - t);
@@ -2326,79 +2508,93 @@ function tr(e) {
2326
2508
  }
2327
2509
  e.setActiveIndex(i);
2328
2510
  }
2329
- function U() {
2330
- let t = n.value <= $ + Gn, r = J() <= Jn;
2511
+ function Y() {
2512
+ let t = n.value <= rr + ir, r = re() <= sr;
2331
2513
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
2332
2514
  }
2333
- function W() {
2334
- j.maybeRequestPage(), M.maybeRequestPage();
2335
- }
2336
- function G() {
2337
- r.value = K(), a.value = q();
2515
+ function X() {
2516
+ M.maybeRequestPage(), N.maybeRequestPage();
2338
2517
  }
2339
- function K() {
2340
- return Ln(t.value, r.value);
2518
+ function ee() {
2519
+ r.value = te(), a.value = ne();
2341
2520
  }
2342
- function q() {
2343
- return Rn(t.value, a.value, Kn);
2521
+ function te() {
2522
+ return Yn(t.value, r.value);
2344
2523
  }
2345
- function J() {
2346
- return zn(t.value, n.value, r.value, y.value);
2524
+ function ne() {
2525
+ return Xn(t.value, a.value, ar);
2347
2526
  }
2348
- function Y() {
2349
- return Bn(O.value, k.value);
2527
+ function re() {
2528
+ return Zn(t.value, n.value, r.value, C.value);
2350
2529
  }
2351
- function ne(e) {
2352
- return e.length ? Sn(e, {
2353
- columnCount: p.value,
2354
- columnWidth: m.value,
2355
- gapX: Gn,
2356
- gapY: Gn,
2357
- bucketPx: Wn
2358
- }).contentHeight + $ * 2 : 0;
2530
+ function ie() {
2531
+ return Qn(k.value, A.value);
2532
+ }
2533
+ function ae(e) {
2534
+ return e.length ? Mn(e, {
2535
+ columnCount: h.value,
2536
+ columnWidth: _.value,
2537
+ gapX: ir,
2538
+ gapY: ir,
2539
+ bucketPx: nr
2540
+ }).contentHeight + rr * 2 : 0;
2541
+ }
2542
+ function oe(e) {
2543
+ let t = /* @__PURE__ */ new Map();
2544
+ for (let n of e) {
2545
+ let e = $(n), r = u.value.get(e);
2546
+ if (r == null) continue;
2547
+ let i = s.value[r];
2548
+ i != null && t.set(e, i);
2549
+ }
2550
+ return t;
2359
2551
  }
2360
- function re() {
2552
+ function Z() {
2361
2553
  let t = e.commitPendingAppend.value;
2362
- typeof t == "function" && (I = setTimeout(async () => {
2363
- I = null, L = !0;
2554
+ typeof t == "function" && (L = setTimeout(async () => {
2555
+ L = null, z = !0;
2364
2556
  try {
2365
2557
  if (!e.pendingAppendItems.value.length) return;
2366
2558
  await t(), await g(), await g();
2367
2559
  } finally {
2368
- d.value = null, L = !1;
2560
+ d.value = null, z = !1;
2369
2561
  }
2370
- }, Xn));
2562
+ }, lr));
2371
2563
  }
2372
- function ie() {
2373
- I &&= (clearTimeout(I), null);
2564
+ function se() {
2565
+ L &&= (clearTimeout(L), null);
2566
+ }
2567
+ function ce() {
2568
+ R && (clearTimeout(R), R = null, p.value = !1);
2374
2569
  }
2375
2570
  return {
2376
- columnWidth: m,
2377
- containerHeight: y,
2378
- footerStatusMessage: S,
2379
- getCardStyle: B,
2380
- getScrollbarThumbStyle: Y,
2381
- onScroll: R,
2382
- onWheel: z,
2383
- paginationLabel: w,
2384
- renderedItems: v,
2385
- resolvedActiveIndex: h,
2386
- scrollToIndex: V,
2387
- showScrollbar: D,
2571
+ columnWidth: _,
2572
+ containerHeight: C,
2573
+ getCardStyle: U,
2574
+ getLeavingCardStyle: j.getLeavingCardStyle,
2575
+ getScrollbarThumbStyle: ie,
2576
+ leavingItems: j.leavingItems,
2577
+ onScroll: V,
2578
+ onWheel: H,
2579
+ paginationLabel: E,
2580
+ renderedItems: S,
2581
+ resolvedActiveIndex: v,
2582
+ scrollToIndex: W,
2583
+ showScrollbar: O,
2388
2584
  scrollViewportRef: t
2389
2585
  };
2390
2586
  }
2391
- function nr(e, t, n) {
2587
+ function hr(e, t, n) {
2392
2588
  return Math.min(Math.max(e, t), n);
2393
2589
  }
2394
2590
  //#endregion
2395
2591
  //#region src/components/viewer-core/listCardAsset.ts
2396
- function rr(e) {
2592
+ function gr(e) {
2397
2593
  if (e) try {
2398
2594
  e.removeAttribute("src"), e.src = "";
2399
2595
  } catch {}
2400
2596
  }
2401
- function ir(e) {
2597
+ function _r(e) {
2402
2598
  if (e) {
2403
2599
  try {
2404
2600
  e.currentTime = 0;
@@ -2409,12 +2605,12 @@ function ir(e) {
2409
2605
  } catch {}
2410
2606
  }
2411
2607
  }
2412
- function ar(e, t) {
2608
+ function vr(e, t) {
2413
2609
  if (t) return e.bottom > t.top && e.top < t.bottom;
2414
2610
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
2415
2611
  return e.bottom > 0 && e.top < n;
2416
2612
  }
2417
- function or(e) {
2613
+ function yr(e) {
2418
2614
  if (!e) return null;
2419
2615
  try {
2420
2616
  return new URL(e, window.location.href).href;
@@ -2424,22 +2620,22 @@ function or(e) {
2424
2620
  }
2425
2621
  //#endregion
2426
2622
  //#region src/components/viewer-core/listPreview.ts
2427
- var sr = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, cr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
2428
- function lr(e) {
2429
- let t = e.preview?.url ?? e.url, n = vn(e), r = e.title?.trim() || At(e.type);
2623
+ var br = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, xr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
2624
+ function Sr(e) {
2625
+ let t = e.preview?.url ?? e.url, n = On(e), r = e.title?.trim() || ft(e.type);
2430
2626
  return e.type !== "image" && e.type !== "video" ? {
2431
2627
  kind: "fallback",
2432
2628
  url: null,
2433
2629
  width: n.width,
2434
2630
  height: n.height,
2435
2631
  label: r
2436
- } : dr(e, t) ? {
2632
+ } : wr(e, t) ? {
2437
2633
  kind: "video",
2438
2634
  url: t,
2439
2635
  width: n.width,
2440
2636
  height: n.height,
2441
2637
  label: r
2442
- } : ur(e, t) ? {
2638
+ } : Cr(e, t) ? {
2443
2639
  kind: "image",
2444
2640
  url: t,
2445
2641
  width: n.width,
@@ -2453,28 +2649,28 @@ function lr(e) {
2453
2649
  label: r
2454
2650
  };
2455
2651
  }
2456
- function ur(e, t) {
2457
- return e.type !== "image" || typeof t != "string" ? !1 : sr.test(t) || fr(t);
2652
+ function Cr(e, t) {
2653
+ return e.type !== "image" || typeof t != "string" ? !1 : br.test(t) || Tr(t);
2458
2654
  }
2459
- function dr(e, t) {
2460
- return e.type === "video" && typeof t == "string" && cr.test(t);
2655
+ function wr(e, t) {
2656
+ return e.type === "video" && typeof t == "string" && xr.test(t);
2461
2657
  }
2462
- function fr(e) {
2658
+ function Tr(e) {
2463
2659
  return /^https?:\/\//i.test(e);
2464
2660
  }
2465
2661
  //#endregion
2466
2662
  //#region src/components/viewer-core/useAssetLoadQueue.ts
2467
- var pr = {
2663
+ var Er = {
2468
2664
  maxGlobal: 10,
2469
2665
  maxPerDomain: 4,
2470
2666
  maxVideoPerDomain: 2
2471
2667
  };
2472
- function mr(e = pr) {
2668
+ function Dr(e = Er) {
2473
2669
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
2474
2670
  function i(e) {
2475
2671
  let i = {
2476
2672
  ...e,
2477
- domain: _r(e.url),
2673
+ domain: Ar(e.url),
2478
2674
  enqueuedAt: r,
2479
2675
  id: `vibe-asset-load-${r += 1}`
2480
2676
  };
@@ -2493,7 +2689,7 @@ function mr(e = pr) {
2493
2689
  function a() {
2494
2690
  if (n.size === 0) return;
2495
2691
  let r = [...n.values()].sort((e, t) => {
2496
- let n = gr(e) - gr(t);
2692
+ let n = kr(e) - kr(t);
2497
2693
  return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
2498
2694
  });
2499
2695
  for (let i of r) {
@@ -2514,8 +2710,8 @@ function mr(e = pr) {
2514
2710
  }
2515
2711
  return { request: i };
2516
2712
  }
2517
- var hr = mr();
2518
- function gr(e) {
2713
+ var Or = Dr();
2714
+ function kr(e) {
2519
2715
  try {
2520
2716
  let t = e.getPriority();
2521
2717
  return Number.isFinite(t) ? t : Infinity;
@@ -2523,7 +2719,7 @@ function gr(e) {
2523
2719
  return Infinity;
2524
2720
  }
2525
2721
  }
2526
- function _r(e) {
2722
+ function Ar(e) {
2527
2723
  try {
2528
2724
  return new URL(e).hostname || "local";
2529
2725
  } catch {
@@ -2532,14 +2728,14 @@ function _r(e) {
2532
2728
  }
2533
2729
  //#endregion
2534
2730
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
2535
- var vr = ["aria-label"], yr = {
2731
+ var jr = ["aria-label"], Mr = {
2536
2732
  key: 0,
2537
2733
  "data-testid": "vibe-list-card-spinner",
2538
2734
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
2539
- }, br = { 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]" }, xr = ["src", "alt"], Sr = ["src"], Cr = ["data-kind"], wr = { class: "grid justify-items-center gap-3 px-4 text-center" }, Tr = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Er = {
2735
+ }, 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)] backdrop-blur-[18px]" }, Pr = ["src", "alt"], Fr = ["src"], Ir = ["data-kind"], Lr = { class: "grid justify-items-center gap-3 px-4 text-center" }, Rr = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, zr = {
2540
2736
  key: 4,
2541
2737
  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))]"
2542
- }, Dr = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Or = { class: "pointer-events-none absolute inset-0 z-[3]" }, kr = /* @__PURE__ */ d({
2738
+ }, Br = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Vr = { class: "pointer-events-none absolute inset-0 z-[3]" }, Hr = /* @__PURE__ */ d({
2543
2739
  __name: "ListCard",
2544
2740
  props: {
2545
2741
  active: {
@@ -2563,89 +2759,89 @@ var vr = ["aria-label"], yr = {
2563
2759
  },
2564
2760
  emits: ["open"],
2565
2761
  setup(e, { emit: t }) {
2566
- let n = e, r = t, l = i(() => lr(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), F = i(() => !!h.value), I = i(() => gt(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, z = null, B = /* @__PURE__ */ new Set();
2567
- P([E, () => l.value.kind], () => {
2762
+ let n = e, r = t, l = i(() => Sr(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = i(() => !!h.value), I = i(() => At(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, B = null, V = /* @__PURE__ */ new Set();
2763
+ F([E, () => l.value.kind], () => {
2568
2764
  let e = l.value.kind === "fallback";
2569
2765
  m.value = e, h.value = null, e && (w.value = !0);
2570
- }), P(A, () => {
2571
- W();
2572
- }), P([
2766
+ }), F(A, () => {
2767
+ K();
2768
+ }), F([
2573
2769
  d,
2574
2770
  m,
2575
2771
  E
2576
2772
  ], () => {
2577
- G();
2578
- }), P(() => n.surfaceActive, (e) => {
2773
+ q();
2774
+ }), F(() => n.surfaceActive, (e) => {
2579
2775
  if (!e) {
2580
- q(), G();
2776
+ Y(), q();
2581
2777
  return;
2582
2778
  }
2583
2779
  requestAnimationFrame(() => {
2584
- J(), W(), G();
2780
+ X(), K(), q();
2585
2781
  });
2586
2782
  }), x(() => {
2587
2783
  if (!v.value || typeof IntersectionObserver > "u") {
2588
- y.value = null, d.value = !0, W();
2784
+ y.value = null, d.value = !0, K();
2589
2785
  return;
2590
2786
  }
2591
2787
  y.value = v.value.closest("[data-testid=\"vibe-list-scroll\"]"), R = new IntersectionObserver((e) => {
2592
- for (let t of e) t.target === v.value && (n.surfaceActive && J(t), W(), G());
2788
+ for (let t of e) t.target === v.value && (n.surfaceActive && X(t), K(), q());
2593
2789
  }, {
2594
2790
  root: y.value,
2595
2791
  threshold: [0, 1]
2596
2792
  }), R.observe(v.value);
2597
2793
  }), b(() => {
2598
- K(), R?.disconnect(), R = null;
2794
+ J(), R?.disconnect(), R = null;
2599
2795
  });
2600
- function V() {
2601
- X(g.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), q());
2796
+ function H() {
2797
+ Z(g.value) && (m.value = !0, h.value = null, ee(E.value ?? n.item.url), Y());
2602
2798
  }
2603
- async function te() {
2604
- if (!X(g.value)) return;
2799
+ async function U() {
2800
+ if (!Z(g.value)) return;
2605
2801
  let e = E.value ?? n.item.url;
2606
2802
  m.value = !1, h.value = "generic";
2607
- let t = await _t(e);
2803
+ let t = await jt(e);
2608
2804
  h.value = t, n.reportAssetError?.({
2609
2805
  item: n.item,
2610
- occurrenceKey: Q(n.item),
2806
+ occurrenceKey: $(n.item),
2611
2807
  url: e,
2612
2808
  kind: t,
2613
2809
  surface: "grid"
2614
- }), q();
2810
+ }), Y();
2615
2811
  }
2616
- function H() {
2617
- X(C.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), q(), G());
2812
+ function W() {
2813
+ Z(C.value) && (m.value = !0, h.value = null, ee(E.value ?? n.item.url), Y(), q());
2618
2814
  }
2619
- function U() {
2620
- X(C.value) && (m.value = !1);
2815
+ function G() {
2816
+ Z(C.value) && (m.value = !1);
2621
2817
  }
2622
- function W() {
2818
+ function K() {
2623
2819
  if (l.value.kind === "fallback") {
2624
- K(!1);
2820
+ J(!1);
2625
2821
  return;
2626
2822
  }
2627
2823
  if (!n.surfaceActive) {
2628
- q();
2824
+ Y();
2629
2825
  return;
2630
2826
  }
2631
2827
  if (!A.value) {
2632
- K();
2828
+ J();
2633
2829
  return;
2634
2830
  }
2635
- if (w.value || z) {
2636
- z?.refresh();
2831
+ if (w.value || B) {
2832
+ B?.refresh();
2637
2833
  return;
2638
2834
  }
2639
- z = hr.request({
2835
+ B = Or.request({
2640
2836
  assetType: l.value.kind,
2641
- getPriority: se,
2837
+ getPriority: ae,
2642
2838
  onGrant() {
2643
2839
  w.value = !0, m.value = !1, h.value = null;
2644
2840
  },
2645
2841
  url: l.value.url ?? n.item.url
2646
2842
  });
2647
2843
  }
2648
- function G() {
2844
+ function q() {
2649
2845
  let e = C.value;
2650
2846
  if (!(!e || l.value.kind !== "video")) {
2651
2847
  if (h.value) {
@@ -2653,7 +2849,7 @@ var vr = ["aria-label"], yr = {
2653
2849
  return;
2654
2850
  }
2655
2851
  if (E.value && d.value && m.value) {
2656
- e.muted = !0, e.loop = !0, e.playsInline = !0, bt(e);
2852
+ e.muted = !0, e.loop = !0, e.playsInline = !0, Pt(e);
2657
2853
  return;
2658
2854
  }
2659
2855
  try {
@@ -2662,44 +2858,44 @@ var vr = ["aria-label"], yr = {
2662
2858
  e.pause();
2663
2859
  }
2664
2860
  }
2665
- function K(e = !0) {
2666
- w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (ie(), ae()), q();
2861
+ function J(e = !0) {
2862
+ w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (ne(), ie()), Y();
2667
2863
  }
2668
- function q() {
2669
- z?.release(), z = null;
2864
+ function Y() {
2865
+ B?.release(), B = null;
2670
2866
  }
2671
- function J(e) {
2867
+ function X(e) {
2672
2868
  let t = v.value;
2673
2869
  if (!t) {
2674
2870
  d.value = !0;
2675
2871
  return;
2676
2872
  }
2677
- d.value = ar(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
2873
+ d.value = vr(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
2678
2874
  }
2679
- function Y(e) {
2875
+ function ee(e) {
2680
2876
  if (!e) return;
2681
- let t = Q(n.item), r = `${t}|${e}`;
2682
- B.has(r) || (B.add(r), n.reportAssetLoad?.({
2877
+ let t = $(n.item), r = `${t}|${e}`;
2878
+ V.has(r) || (V.add(r), n.reportAssetLoad?.({
2683
2879
  item: n.item,
2684
2880
  occurrenceKey: t,
2685
2881
  surface: "grid",
2686
2882
  url: e
2687
2883
  }));
2688
2884
  }
2689
- function ne() {
2885
+ function te() {
2690
2886
  if (!I.value) return;
2691
- let e = Q(n.item);
2692
- B.forEach((t) => {
2693
- t.startsWith(`${e}|`) && B.delete(t);
2694
- }), h.value = null, m.value = !1, w.value = !1, q(), W();
2887
+ let e = $(n.item);
2888
+ V.forEach((t) => {
2889
+ t.startsWith(`${e}|`) && V.delete(t);
2890
+ }), h.value = null, m.value = !1, w.value = !1, Y(), K();
2891
+ }
2892
+ function ne() {
2893
+ gr(g.value);
2695
2894
  }
2696
2895
  function ie() {
2697
- rr(g.value);
2896
+ _r(C.value);
2698
2897
  }
2699
2898
  function ae() {
2700
- ir(C.value);
2701
- }
2702
- function se() {
2703
2899
  let e = v.value;
2704
2900
  if (!e) return Infinity;
2705
2901
  let t = e.getBoundingClientRect();
@@ -2710,17 +2906,17 @@ var vr = ["aria-label"], yr = {
2710
2906
  let n = window.innerHeight / 2;
2711
2907
  return Math.abs((t.top + t.bottom) / 2 - n);
2712
2908
  }
2713
- function X(e) {
2714
- let t = or(E.value);
2715
- return !e || !t ? !1 : or("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
2909
+ function Z(e) {
2910
+ let t = yr(E.value);
2911
+ return !e || !t ? !1 : yr("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
2716
2912
  }
2717
- function ce() {
2913
+ function se() {
2718
2914
  r("open");
2719
2915
  }
2720
- function le() {
2916
+ function ce() {
2721
2917
  f.value = !0;
2722
2918
  }
2723
- function Z(e) {
2919
+ function Q(e) {
2724
2920
  let t = e.relatedTarget;
2725
2921
  v.value && t instanceof Node && v.value.contains(t) || (f.value = !1);
2726
2922
  }
@@ -2729,8 +2925,8 @@ var vr = ["aria-label"], yr = {
2729
2925
  ref: v,
2730
2926
  "data-testid": "vibe-list-card-inner",
2731
2927
  class: _(["group relative h-full w-full overflow-hidden border bg-[#0a0b0f] text-[#f7f1ea] transition-[border-color,transform] duration-300", n.active ? "border-white/28" : "border-white/12 hover:border-white/24"]),
2732
- onFocusin: le,
2733
- onFocusout: Z,
2928
+ onFocusin: ce,
2929
+ onFocusout: Q,
2734
2930
  onPointerenter: t[0] ||= (e) => p.value = !0,
2735
2931
  onPointerleave: t[1] ||= (e) => p.value = !1
2736
2932
  }, [
@@ -2739,13 +2935,13 @@ var vr = ["aria-label"], yr = {
2739
2935
  "data-testid": "vibe-list-card-open",
2740
2936
  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]",
2741
2937
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
2742
- onClick: ce
2743
- }, null, 8, vr),
2744
- L.value ? (S(), s("div", yr, [c("span", br, [u(j(re), {
2938
+ onClick: se
2939
+ }, null, 8, jr),
2940
+ L.value ? (S(), s("div", Mr, [c("span", Nr, [u(j(re), {
2745
2941
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2746
2942
  "aria-hidden": "true"
2747
2943
  })])])) : o("", !0),
2748
- M.value && E.value && !F.value ? (S(), s("img", {
2944
+ M.value && E.value && !P.value ? (S(), s("img", {
2749
2945
  key: 1,
2750
2946
  ref_key: "imageRef",
2751
2947
  ref: g,
@@ -2753,9 +2949,9 @@ var vr = ["aria-label"], yr = {
2753
2949
  alt: l.value.label,
2754
2950
  draggable: "false",
2755
2951
  class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
2756
- onLoad: V,
2757
- onError: te
2758
- }, null, 42, xr)) : N.value && E.value && !F.value ? (S(), s("video", {
2952
+ onLoad: H,
2953
+ onError: U
2954
+ }, null, 42, Pr)) : N.value && E.value && !P.value ? (S(), s("video", {
2759
2955
  key: 2,
2760
2956
  ref_key: "videoRef",
2761
2957
  ref: C,
@@ -2765,67 +2961,64 @@ var vr = ["aria-label"], yr = {
2765
2961
  playsinline: "",
2766
2962
  preload: "metadata",
2767
2963
  class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
2768
- onCanplay: H,
2769
- onError: te,
2770
- onLoadstart: U,
2771
- onPlaying: H,
2772
- onStalled: U,
2773
- onWaiting: U
2774
- }, null, 42, Sr)) : F.value ? (S(), s("div", {
2964
+ onCanplay: W,
2965
+ onError: U,
2966
+ onLoadstart: G,
2967
+ onPlaying: W,
2968
+ onStalled: G,
2969
+ onWaiting: G
2970
+ }, null, 42, Fr)) : P.value ? (S(), s("div", {
2775
2971
  key: 3,
2776
2972
  "data-testid": "vibe-list-card-error",
2777
2973
  "data-kind": h.value,
2778
2974
  class: "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))]"
2779
- }, [c("div", wr, [
2975
+ }, [c("div", Lr, [
2780
2976
  u(j(oe), {
2781
2977
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
2782
2978
  "aria-hidden": "true"
2783
2979
  }),
2784
- c("span", Tr, k(j(ht)(h.value)), 1),
2980
+ c("span", Rr, k(j(kt)(h.value)), 1),
2785
2981
  I.value ? (S(), s("button", {
2786
2982
  key: 0,
2787
2983
  type: "button",
2788
2984
  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",
2789
- onClick: ee(ne, ["stop"])
2985
+ onClick: z(te, ["stop"])
2790
2986
  }, " Retry ")) : o("", !0)
2791
- ])], 8, Cr)) : (S(), s("div", Er, [c("div", Dr, [D(e.$slots, "item-icon", {
2792
- icon: j(kt)(n.item.type),
2987
+ ])], 8, Ir)) : (S(), s("div", zr, [c("div", Br, [D(e.$slots, "item-icon", {
2988
+ icon: j(dt)(n.item.type),
2793
2989
  item: n.item
2794
- }, () => [(S(), a(O(j(kt)(n.item.type)), {
2990
+ }, () => [(S(), a(O(j(dt)(n.item.type)), {
2795
2991
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
2796
2992
  "aria-hidden": "true"
2797
2993
  }))])])])),
2798
- c("div", Or, [D(e.$slots, "grid-item-overlay", {
2994
+ c("div", Vr, [D(e.$slots, "grid-item-overlay", {
2799
2995
  active: n.active,
2800
2996
  focused: f.value,
2801
2997
  hovered: p.value,
2802
2998
  index: n.index,
2803
2999
  item: n.item,
2804
- openFullscreen: ce
3000
+ openFullscreen: se
2805
3001
  })])
2806
3002
  ], 34));
2807
3003
  }
2808
- }), Ar = { 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)]" }, jr = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Mr = {
3004
+ }), Ur = { 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)]" }, Wr = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Gr = {
2809
3005
  "data-testid": "vibe-pagination",
2810
3006
  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]"
2811
- }, Nr = { class: "whitespace-nowrap" }, Pr = {
3007
+ }, Kr = { class: "whitespace-nowrap" }, qr = {
2812
3008
  key: 0,
2813
3009
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
2814
- }, Fr = [
3010
+ }, Jr = [
2815
3011
  "data-active",
2816
3012
  "data-index",
2817
3013
  "data-item-id",
2818
3014
  "data-occurrence-key"
2819
- ], Ir = {
3015
+ ], Yr = ["data-item-id"], Xr = {
2820
3016
  key: 0,
2821
3017
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
2822
- }, Lr = {
3018
+ }, Zr = {
2823
3019
  key: 1,
2824
3020
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
2825
- }, Rr = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, zr = {
2826
- key: 1,
2827
- class: "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]"
2828
- }, Br = /* @__PURE__ */ d({
3021
+ }, Qr = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, $r = /* @__PURE__ */ d({
2829
3022
  __name: "ListSurface",
2830
3023
  props: {
2831
3024
  active: {
@@ -2841,6 +3034,8 @@ var vr = ["aria-label"], yr = {
2841
3034
  type: [Function, null],
2842
3035
  default: null
2843
3036
  },
3037
+ emptyStateMode: { default: "inline" },
3038
+ errorMessage: { default: null },
2844
3039
  hasNextPage: {
2845
3040
  type: Boolean,
2846
3041
  default: !1
@@ -2856,6 +3051,7 @@ var vr = ["aria-label"], yr = {
2856
3051
  },
2857
3052
  pendingAppendItems: { default: () => [] },
2858
3053
  paginationDetail: { default: null },
3054
+ phase: { default: null },
2859
3055
  reportAssetError: {
2860
3056
  type: [Function, null],
2861
3057
  default: null
@@ -2872,7 +3068,6 @@ var vr = ["aria-label"], yr = {
2872
3068
  type: [Function, null],
2873
3069
  default: null
2874
3070
  },
2875
- restoreToken: {},
2876
3071
  showStatusBadges: {
2877
3072
  type: Boolean,
2878
3073
  default: !0
@@ -2880,7 +3075,7 @@ var vr = ["aria-label"], yr = {
2880
3075
  },
2881
3076
  emits: ["open-fullscreen", "update:activeIndex"],
2882
3077
  setup(e, { emit: n }) {
2883
- let r = e, a = M(), d = n, f = tr({
3078
+ let r = e, d = N(), f = n, p = mr({
2884
3079
  active: A(r, "active"),
2885
3080
  allowExhaustedNextPageRefresh: A(r, "allowExhaustedNextPageRefresh"),
2886
3081
  items: A(r, "items"),
@@ -2893,113 +3088,180 @@ var vr = ["aria-label"], yr = {
2893
3088
  commitPendingAppend: A(r, "commitPendingAppend"),
2894
3089
  requestNextPage: A(r, "requestNextPage"),
2895
3090
  requestPreviousPage: A(r, "requestPreviousPage"),
2896
- restoreToken: A(r, "restoreToken"),
2897
3091
  setActiveIndex(e) {
2898
- d("update:activeIndex", e);
3092
+ f("update:activeIndex", e);
2899
3093
  }
2900
- }), p = i(() => !r.showStatusBadges || !f.footerStatusMessage.value ? null : {
2901
- activeIndex: f.resolvedActiveIndex.value,
2902
- kind: r.loading ? "loading-more" : "end",
3094
+ }), m = i(() => bt({
3095
+ itemCount: r.items.length,
2903
3096
  loading: r.loading,
2904
- message: f.footerStatusMessage.value,
3097
+ phase: r.phase
3098
+ })), g = i(() => xt({
3099
+ errorMessage: r.errorMessage,
3100
+ hasItems: r.items.length > 0,
3101
+ hasNextPage: r.hasNextPage,
3102
+ phase: m.value,
3103
+ surface: "grid"
3104
+ })), b = i(() => !r.showStatusBadges || !g.value ? null : {
3105
+ activeIndex: p.resolvedActiveIndex.value,
3106
+ kind: g.value.kind,
3107
+ loading: r.loading,
3108
+ message: g.value.message,
2905
3109
  paginationDetail: r.paginationDetail,
2906
3110
  total: r.items.length
2907
- }), m = i(() => !p.value || !a["grid-status"] ? [] : a["grid-status"](p.value)), g = i(() => jt(m.value));
2908
- return (e, n) => (S(), s("div", Ar, [
2909
- c("div", jr, [c("span", Mr, [c("span", Nr, k(j(f).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", Pr, k(r.paginationDetail), 1)) : o("", !0)])]),
3111
+ }), x = i(() => !b.value || !d["grid-status"] ? [] : d["grid-status"](b.value)), C = i(() => ht(x.value)), w = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: O, showCustomEmptyState: M, showInlineEmptyState: P } = vt({
3112
+ emptyStateMode: A(r, "emptyStateMode"),
3113
+ itemCount: w,
3114
+ loading: A(r, "loading"),
3115
+ renderSlot: d["empty-state"],
3116
+ surface: "grid"
3117
+ });
3118
+ return (e, n) => (S(), s("div", Ur, [
3119
+ c("div", Wr, [c("span", Gr, [c("span", Kr, k(j(p).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", qr, k(r.paginationDetail), 1)) : o("", !0)])]),
2910
3120
  c("div", {
2911
- ref: j(f).scrollViewportRef,
3121
+ ref: j(p).scrollViewportRef,
2912
3122
  "data-testid": "vibe-list-scroll",
2913
3123
  class: "h-full min-h-0 overflow-y-auto overflow-x-hidden [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
2914
- onScroll: n[0] ||= (...e) => j(f).onScroll && j(f).onScroll(...e),
2915
- onWheel: n[1] ||= (...e) => j(f).onWheel && j(f).onWheel(...e)
3124
+ onScroll: n[0] ||= (...e) => j(p).onScroll && j(p).onScroll(...e),
3125
+ onWheel: n[1] ||= (...e) => j(p).onWheel && j(p).onWheel(...e)
2916
3126
  }, [c("div", {
2917
3127
  "data-testid": "vibe-list-content",
2918
3128
  class: "relative",
2919
- style: y({ height: `${j(f).containerHeight.value}px` })
2920
- }, [(S(!0), s(t, null, E(j(f).renderedItems.value, ({ item: t, index: n }) => (S(), s("article", {
2921
- key: j(Q)(t),
2922
- "data-testid": "vibe-list-card",
2923
- "data-active": n === j(f).resolvedActiveIndex.value ? "true" : "false",
2924
- "data-index": n,
2925
- "data-item-id": t.id,
2926
- "data-occurrence-key": j(Q)(t),
2927
- class: "absolute will-change-transform",
2928
- style: y(j(f).getCardStyle(n))
2929
- }, [u(kr, {
2930
- active: n === j(f).resolvedActiveIndex.value,
2931
- index: n,
2932
- item: t,
2933
- "report-asset-error": r.reportAssetError,
2934
- "report-asset-load": r.reportAssetLoad,
2935
- "surface-active": r.active,
2936
- onOpen: (e) => d("open-fullscreen", n)
2937
- }, l({ _: 2 }, [a["grid-item-overlay"] ? {
2938
- name: "grid-item-overlay",
2939
- fn: I((t) => [D(e.$slots, "grid-item-overlay", h({ ref_for: !0 }, t))]),
2940
- key: "0"
2941
- } : void 0, a["item-icon"] ? {
2942
- name: "item-icon",
2943
- fn: I((t) => [D(e.$slots, "item-icon", h({ ref_for: !0 }, t))]),
2944
- key: "1"
2945
- } : void 0]), 1032, [
2946
- "active",
2947
- "index",
2948
- "item",
2949
- "report-asset-error",
2950
- "report-asset-load",
2951
- "surface-active",
2952
- "onOpen"
2953
- ])], 12, Fr))), 128))], 4)], 544),
2954
- j(f).showScrollbar.value ? (S(), s("div", Ir, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3129
+ style: y({ height: `${j(p).containerHeight.value}px` })
3130
+ }, [
3131
+ (S(!0), s(t, null, E(j(p).renderedItems.value, ({ item: t, index: n }) => (S(), s("article", {
3132
+ key: j($)(t),
3133
+ "data-testid": "vibe-list-card",
3134
+ "data-active": n === j(p).resolvedActiveIndex.value ? "true" : "false",
3135
+ "data-index": n,
3136
+ "data-item-id": t.id,
3137
+ "data-occurrence-key": j($)(t),
3138
+ class: "absolute will-change-transform",
3139
+ style: y(j(p).getCardStyle(n))
3140
+ }, [u(Hr, {
3141
+ active: n === j(p).resolvedActiveIndex.value,
3142
+ index: n,
3143
+ item: t,
3144
+ "report-asset-error": r.reportAssetError,
3145
+ "report-asset-load": r.reportAssetLoad,
3146
+ "surface-active": r.active,
3147
+ onOpen: (e) => f("open-fullscreen", n)
3148
+ }, l({ _: 2 }, [d["grid-item-overlay"] ? {
3149
+ name: "grid-item-overlay",
3150
+ fn: L((t) => [D(e.$slots, "grid-item-overlay", h({ ref_for: !0 }, t))]),
3151
+ key: "0"
3152
+ } : void 0, d["item-icon"] ? {
3153
+ name: "item-icon",
3154
+ fn: L((t) => [D(e.$slots, "item-icon", h({ ref_for: !0 }, t))]),
3155
+ key: "1"
3156
+ } : void 0]), 1032, [
3157
+ "active",
3158
+ "index",
3159
+ "item",
3160
+ "report-asset-error",
3161
+ "report-asset-load",
3162
+ "surface-active",
3163
+ "onOpen"
3164
+ ])], 12, Jr))), 128)),
3165
+ (S(!0), s(t, null, E(j(p).leavingItems.value, (t) => (S(), s("article", {
3166
+ key: `leaving-${j($)(t.item)}`,
3167
+ "data-testid": "vibe-list-card-leaving",
3168
+ "data-item-id": t.item.id,
3169
+ class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
3170
+ style: y(j(p).getLeavingCardStyle(t.item))
3171
+ }, [u(Hr, {
3172
+ active: !1,
3173
+ index: -1,
3174
+ item: t.item,
3175
+ "report-asset-error": r.reportAssetError,
3176
+ "report-asset-load": r.reportAssetLoad,
3177
+ "surface-active": !1
3178
+ }, l({ _: 2 }, [d["item-icon"] ? {
3179
+ name: "item-icon",
3180
+ fn: L((t) => [D(e.$slots, "item-icon", h({ ref_for: !0 }, t))]),
3181
+ key: "0"
3182
+ } : void 0]), 1032, [
3183
+ "item",
3184
+ "report-asset-error",
3185
+ "report-asset-load"
3186
+ ])], 12, Yr))), 128)),
3187
+ j(P) && j(T) ? (S(), a(qt, {
3188
+ key: 0,
3189
+ message: j(T).message,
3190
+ mode: j(T).mode,
3191
+ surface: j(T).surface
3192
+ }, {
3193
+ default: L(() => [j(M) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(T)))) : o("", !0)]),
3194
+ _: 3
3195
+ }, 8, [
3196
+ "message",
3197
+ "mode",
3198
+ "surface"
3199
+ ])) : o("", !0)
3200
+ ], 4)], 544),
3201
+ j(p).showScrollbar.value ? (S(), s("div", Xr, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
2955
3202
  "data-testid": "vibe-list-scrollbar-thumb",
2956
3203
  class: _(["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"]),
2957
- style: y(j(f).getScrollbarThumbStyle())
3204
+ style: y(j(p).getScrollbarThumbStyle())
2958
3205
  }, null, 6)])) : o("", !0),
2959
- a["grid-footer"] ? (S(), s("div", Lr, [c("div", Rr, [D(e.$slots, "grid-footer")])])) : o("", !0),
2960
- p.value ? (S(), s("div", {
3206
+ d["grid-footer"] ? (S(), s("div", Zr, [c("div", Qr, [D(e.$slots, "grid-footer")])])) : o("", !0),
3207
+ b.value ? (S(), s("div", {
2961
3208
  key: 2,
2962
- class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", a["grid-footer"] ? "pb-24" : "pb-6"])
2963
- }, [g.value ? D(e.$slots, "grid-status", v(h({ key: 0 }, p.value))) : (S(), s("span", zr, k(p.value.message), 1))], 2)) : o("", !0)
3209
+ class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
3210
+ }, [C.value ? D(e.$slots, "grid-status", v(h({ key: 0 }, b.value))) : (S(), s("span", {
3211
+ key: 1,
3212
+ "data-testid": "vibe-grid-status-badge",
3213
+ class: _(["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]", b.value.kind === "end" ? "border-amber-300/35 text-amber-200" : b.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
3214
+ }, k(b.value.message), 3))], 2)) : o("", !0),
3215
+ j(O) && j(T) ? (S(), a(qt, {
3216
+ key: 3,
3217
+ class: _(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
3218
+ message: j(T).message,
3219
+ mode: j(T).mode,
3220
+ surface: j(T).surface
3221
+ }, {
3222
+ default: L(() => [j(M) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(T)))) : o("", !0)]),
3223
+ _: 3
3224
+ }, 8, [
3225
+ "class",
3226
+ "message",
3227
+ "mode",
3228
+ "surface"
3229
+ ])) : o("", !0)
2964
3230
  ]));
2965
3231
  }
2966
- }), Vr = ["data-surface-mode"], Hr = {
3232
+ }), ei = ["data-surface-mode"], ti = {
2967
3233
  key: 1,
2968
3234
  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"
2969
- }, Ur = {
2970
- key: 2,
3235
+ }, ni = ["data-visible", "inert"], ri = ["data-visible", "inert"], ii = {
3236
+ key: 3,
2971
3237
  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"
2972
- }, Wr = ["data-visible", "inert"], Gr = ["data-visible", "inert"], Kr = /* @__PURE__ */ d({
3238
+ }, ai = /* @__PURE__ */ d({
2973
3239
  name: "VibeLayout",
2974
3240
  __name: "Layout",
2975
3241
  props: {
2976
- items: {},
2977
- activeIndex: {},
3242
+ emptyStateMode: {},
2978
3243
  fillDelayMs: {},
2979
3244
  fillDelayStepMs: {},
3245
+ initialCursor: {},
2980
3246
  initialState: {},
2981
- loading: { type: Boolean },
2982
- hasNextPage: { type: Boolean },
2983
3247
  mode: {},
2984
- resolve: { type: Function },
2985
- initialCursor: {},
2986
3248
  pageSize: {},
2987
- hasPreviousPage: { type: Boolean },
2988
3249
  paginationDetail: {},
2989
- requestNextPage: { type: [Function, null] },
2990
- requestPreviousPage: { type: [Function, null] },
3250
+ resolve: { type: Function },
2991
3251
  showEndBadge: { type: Boolean },
2992
- showStatusBadges: { type: Boolean }
3252
+ showStatusBadges: { type: Boolean },
3253
+ surfaceMode: {}
2993
3254
  },
2994
3255
  emits: [
2995
3256
  "asset-errors",
2996
3257
  "asset-loads",
2997
- "update:activeIndex"
3258
+ "update:activeIndex",
3259
+ "update:surfaceMode"
2998
3260
  ],
2999
3261
  setup(e, { expose: n, emit: i }) {
3000
- let d = e, p = M(), m = i, h = He(d, m), g = se((e) => {
3262
+ let d = e, p = N(), m = i, h = We(d, m), g = Z((e) => {
3001
3263
  m("asset-errors", e);
3002
- }), _ = X((e) => {
3264
+ }), _ = se((e) => {
3003
3265
  m("asset-loads", e);
3004
3266
  });
3005
3267
  return b(() => {
@@ -3024,14 +3286,7 @@ var vr = ["aria-label"], yr = {
3024
3286
  type: "button",
3025
3287
  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",
3026
3288
  onClick: n[0] ||= (...e) => j(h).retryInitialLoad && j(h).retryInitialLoad(...e)
3027
- }, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", Hr, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).items.value.length === 0 ? (S(), s("div", Ur, [j(h).loading.value ? (S(), s(t, { key: 0 }, [u(j(re), {
3028
- class: "size-10 animate-spin text-[#f7f1ea]/82",
3029
- "aria-hidden": "true"
3030
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)], 64)) : (S(), s(t, { key: 1 }, [
3031
- n[2] ||= c("p", { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/68" }, " Viewer ready ", -1),
3032
- n[3] ||= c("h2", { class: "m-0 text-[clamp(2rem,4.4vw,3.6rem)] leading-[0.95] tracking-[-0.05em]" }, " No items available ", -1),
3033
- n[4] ||= c("p", { class: "m-0 text-[clamp(0.98rem,1.3vw,1.12rem)] leading-[1.8] text-[#f7f1ea]/70" }, " Attach items to VibeLayout to turn this screen into the viewer. ", -1)
3034
- ], 64))])) : j(h).isDesktop.value ? (S(), s(t, { key: 3 }, [u(r, {
3289
+ }, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", ti, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).isDesktop.value ? (S(), s(t, { key: 2 }, [u(r, {
3035
3290
  appear: "",
3036
3291
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
3037
3292
  "enter-from-class": "translate-y-3 opacity-0",
@@ -3040,71 +3295,80 @@ var vr = ["aria-label"], yr = {
3040
3295
  "leave-from-class": "translate-y-0 opacity-100",
3041
3296
  "leave-to-class": "translate-y-3 opacity-0"
3042
3297
  }, {
3043
- default: I(() => [L(c("div", {
3298
+ default: L(() => [R(c("div", {
3044
3299
  "data-testid": "vibe-list-surface",
3045
3300
  "data-visible": j(h).surfaceMode.value === "list" ? "true" : "false",
3046
3301
  inert: j(h).surfaceMode.value !== "list",
3047
3302
  class: "absolute inset-0 z-[2]"
3048
- }, [u(Br, {
3303
+ }, [u($r, {
3049
3304
  active: j(h).surfaceMode.value === "list",
3050
3305
  "allow-exhausted-next-page-refresh": j(h).canRefreshExhaustedNextPage.value,
3051
3306
  items: j(h).items.value,
3052
3307
  "active-index": j(h).activeIndex.value,
3308
+ "error-message": j(h).errorMessage.value,
3053
3309
  loading: j(h).loading.value,
3054
3310
  "has-next-page": j(h).hasNextPage.value,
3055
3311
  "has-previous-page": j(h).hasPreviousPage.value,
3056
3312
  "pending-append-items": j(h).pendingAppendItems.value,
3313
+ phase: j(h).phase.value,
3057
3314
  "commit-pending-append": j(h).commitPendingAppend,
3058
3315
  "pagination-detail": j(h).paginationDetail.value,
3059
3316
  "report-asset-error": j(g).report,
3060
3317
  "report-asset-load": j(_).report,
3061
3318
  "request-next-page": j(h).prefetchNextPage,
3062
3319
  "request-previous-page": j(h).prefetchPreviousPage,
3063
- "restore-token": j(h).listRestoreToken.value,
3320
+ "empty-state-mode": d.emptyStateMode,
3064
3321
  "show-status-badges": d.showStatusBadges ?? !0,
3065
3322
  onOpenFullscreen: j(h).openFullscreen,
3066
3323
  "onUpdate:activeIndex": j(h).setActiveIndex
3067
3324
  }, l({ _: 2 }, [
3325
+ p["empty-state"] ? {
3326
+ name: "empty-state",
3327
+ fn: L((t) => [D(e.$slots, "empty-state", v(f(t)))]),
3328
+ key: "0"
3329
+ } : void 0,
3068
3330
  p["grid-footer"] ? {
3069
3331
  name: "grid-footer",
3070
- fn: I(() => [D(e.$slots, "grid-footer")]),
3071
- key: "0"
3332
+ fn: L(() => [D(e.$slots, "grid-footer")]),
3333
+ key: "1"
3072
3334
  } : void 0,
3073
3335
  p["grid-item-overlay"] ? {
3074
3336
  name: "grid-item-overlay",
3075
- fn: I((t) => [D(e.$slots, "grid-item-overlay", v(f(t)))]),
3076
- key: "1"
3337
+ fn: L((t) => [D(e.$slots, "grid-item-overlay", v(f(t)))]),
3338
+ key: "2"
3077
3339
  } : void 0,
3078
3340
  p["grid-status"] ? {
3079
3341
  name: "grid-status",
3080
- fn: I((t) => [D(e.$slots, "grid-status", v(f(t)))]),
3081
- key: "2"
3342
+ fn: L((t) => [D(e.$slots, "grid-status", v(f(t)))]),
3343
+ key: "3"
3082
3344
  } : void 0,
3083
3345
  p["item-icon"] ? {
3084
3346
  name: "item-icon",
3085
- fn: I((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3086
- key: "3"
3347
+ fn: L((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3348
+ key: "4"
3087
3349
  } : void 0
3088
3350
  ]), 1032, [
3089
3351
  "active",
3090
3352
  "allow-exhausted-next-page-refresh",
3091
3353
  "items",
3092
3354
  "active-index",
3355
+ "error-message",
3093
3356
  "loading",
3094
3357
  "has-next-page",
3095
3358
  "has-previous-page",
3096
3359
  "pending-append-items",
3360
+ "phase",
3097
3361
  "commit-pending-append",
3098
3362
  "pagination-detail",
3099
3363
  "report-asset-error",
3100
3364
  "report-asset-load",
3101
3365
  "request-next-page",
3102
3366
  "request-previous-page",
3103
- "restore-token",
3367
+ "empty-state-mode",
3104
3368
  "show-status-badges",
3105
3369
  "onOpenFullscreen",
3106
3370
  "onUpdate:activeIndex"
3107
- ])], 8, Wr), [[N, j(h).surfaceMode.value === "list"]])]),
3371
+ ])], 8, ni), [[P, j(h).surfaceMode.value === "list"]])]),
3108
3372
  _: 3
3109
3373
  }), u(r, {
3110
3374
  appear: "",
@@ -3115,124 +3379,149 @@ var vr = ["aria-label"], yr = {
3115
3379
  "leave-from-class": "translate-y-0 opacity-100",
3116
3380
  "leave-to-class": "-translate-y-3 opacity-0"
3117
3381
  }, {
3118
- default: I(() => [L(c("div", {
3382
+ default: L(() => [R(c("div", {
3119
3383
  "data-testid": "vibe-fullscreen-surface",
3120
3384
  "data-visible": j(h).surfaceMode.value === "fullscreen" ? "true" : "false",
3121
3385
  inert: j(h).surfaceMode.value !== "fullscreen",
3122
3386
  class: "absolute inset-0 z-[3]"
3123
- }, [u(hn, {
3387
+ }, [u(Tn, {
3124
3388
  items: j(h).items.value,
3125
3389
  active: j(h).surfaceMode.value === "fullscreen",
3126
3390
  "active-index": j(h).activeIndex.value,
3391
+ "error-message": j(h).errorMessage.value,
3127
3392
  loading: j(h).loading.value,
3128
3393
  "has-next-page": j(h).hasNextPage.value,
3129
3394
  "pagination-detail": j(h).paginationDetail.value,
3395
+ phase: j(h).phase.value,
3130
3396
  "report-asset-error": j(g).report,
3131
3397
  "report-asset-load": j(_).report,
3398
+ "empty-state-mode": d.emptyStateMode,
3132
3399
  "show-end-badge": d.showEndBadge ?? !0,
3133
3400
  "show-status-badges": d.showStatusBadges ?? !0,
3134
3401
  "show-back-to-list": j(h).showBackToList.value,
3135
3402
  onBackToList: j(h).returnToList,
3136
3403
  "onUpdate:activeIndex": j(h).setActiveIndex
3137
3404
  }, l({ _: 2 }, [
3405
+ p["empty-state"] ? {
3406
+ name: "empty-state",
3407
+ fn: L((t) => [D(e.$slots, "empty-state", v(f(t)))]),
3408
+ key: "0"
3409
+ } : void 0,
3138
3410
  p["fullscreen-overlay"] ? {
3139
3411
  name: "fullscreen-overlay",
3140
- fn: I((t) => [D(e.$slots, "fullscreen-overlay", v(f(t)))]),
3141
- key: "0"
3412
+ fn: L((t) => [D(e.$slots, "fullscreen-overlay", v(f(t)))]),
3413
+ key: "1"
3142
3414
  } : void 0,
3143
3415
  p["fullscreen-aside"] ? {
3144
3416
  name: "fullscreen-aside",
3145
- fn: I((t) => [D(e.$slots, "fullscreen-aside", v(f(t)))]),
3146
- key: "1"
3417
+ fn: L((t) => [D(e.$slots, "fullscreen-aside", v(f(t)))]),
3418
+ key: "2"
3147
3419
  } : void 0,
3148
3420
  p["fullscreen-header-actions"] ? {
3149
3421
  name: "fullscreen-header-actions",
3150
- fn: I((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
3151
- key: "2"
3422
+ fn: L((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
3423
+ key: "3"
3152
3424
  } : void 0,
3153
3425
  p["fullscreen-status"] ? {
3154
3426
  name: "fullscreen-status",
3155
- fn: I((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
3156
- key: "3"
3427
+ fn: L((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
3428
+ key: "4"
3157
3429
  } : void 0,
3158
3430
  p["item-icon"] ? {
3159
3431
  name: "item-icon",
3160
- fn: I((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3161
- key: "4"
3432
+ fn: L((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3433
+ key: "5"
3162
3434
  } : void 0
3163
3435
  ]), 1032, [
3164
3436
  "items",
3165
3437
  "active",
3166
3438
  "active-index",
3439
+ "error-message",
3167
3440
  "loading",
3168
3441
  "has-next-page",
3169
3442
  "pagination-detail",
3443
+ "phase",
3170
3444
  "report-asset-error",
3171
3445
  "report-asset-load",
3446
+ "empty-state-mode",
3172
3447
  "show-end-badge",
3173
3448
  "show-status-badges",
3174
3449
  "show-back-to-list",
3175
3450
  "onBackToList",
3176
3451
  "onUpdate:activeIndex"
3177
- ])], 8, Gr), [[N, j(h).surfaceMode.value === "fullscreen"]])]),
3452
+ ])], 8, ri), [[P, j(h).surfaceMode.value === "fullscreen"]])]),
3178
3453
  _: 3
3179
- })], 64)) : (S(), a(hn, {
3454
+ })], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", ii, [u(j(re), {
3455
+ class: "size-10 animate-spin text-[#f7f1ea]/82",
3456
+ "aria-hidden": "true"
3457
+ }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(Tn, {
3180
3458
  key: 4,
3181
3459
  items: j(h).items.value,
3182
3460
  active: !0,
3183
3461
  "active-index": j(h).activeIndex.value,
3462
+ "error-message": j(h).errorMessage.value,
3184
3463
  loading: j(h).loading.value,
3185
3464
  "has-next-page": j(h).hasNextPage.value,
3186
3465
  "pagination-detail": j(h).paginationDetail.value,
3466
+ phase: j(h).phase.value,
3187
3467
  "report-asset-error": j(g).report,
3188
3468
  "report-asset-load": j(_).report,
3469
+ "empty-state-mode": d.emptyStateMode,
3189
3470
  "show-end-badge": d.showEndBadge ?? !0,
3190
3471
  "show-status-badges": d.showStatusBadges ?? !0,
3191
3472
  "show-back-to-list": !1,
3192
3473
  onBackToList: j(h).returnToList,
3193
3474
  "onUpdate:activeIndex": j(h).setActiveIndex
3194
3475
  }, l({ _: 2 }, [
3476
+ p["empty-state"] ? {
3477
+ name: "empty-state",
3478
+ fn: L((t) => [D(e.$slots, "empty-state", v(f(t)))]),
3479
+ key: "0"
3480
+ } : void 0,
3195
3481
  p["fullscreen-overlay"] ? {
3196
3482
  name: "fullscreen-overlay",
3197
- fn: I((t) => [D(e.$slots, "fullscreen-overlay", v(f(t)))]),
3198
- key: "0"
3483
+ fn: L((t) => [D(e.$slots, "fullscreen-overlay", v(f(t)))]),
3484
+ key: "1"
3199
3485
  } : void 0,
3200
3486
  p["fullscreen-aside"] ? {
3201
3487
  name: "fullscreen-aside",
3202
- fn: I((t) => [D(e.$slots, "fullscreen-aside", v(f(t)))]),
3203
- key: "1"
3488
+ fn: L((t) => [D(e.$slots, "fullscreen-aside", v(f(t)))]),
3489
+ key: "2"
3204
3490
  } : void 0,
3205
3491
  p["fullscreen-header-actions"] ? {
3206
3492
  name: "fullscreen-header-actions",
3207
- fn: I((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
3208
- key: "2"
3493
+ fn: L((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
3494
+ key: "3"
3209
3495
  } : void 0,
3210
3496
  p["fullscreen-status"] ? {
3211
3497
  name: "fullscreen-status",
3212
- fn: I((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
3213
- key: "3"
3498
+ fn: L((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
3499
+ key: "4"
3214
3500
  } : void 0,
3215
3501
  p["item-icon"] ? {
3216
3502
  name: "item-icon",
3217
- fn: I((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3218
- key: "4"
3503
+ fn: L((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3504
+ key: "5"
3219
3505
  } : void 0
3220
3506
  ]), 1032, [
3221
3507
  "items",
3222
3508
  "active-index",
3509
+ "error-message",
3223
3510
  "loading",
3224
3511
  "has-next-page",
3225
3512
  "pagination-detail",
3513
+ "phase",
3226
3514
  "report-asset-error",
3227
3515
  "report-asset-load",
3516
+ "empty-state-mode",
3228
3517
  "show-end-badge",
3229
3518
  "show-status-badges",
3230
3519
  "onBackToList",
3231
3520
  "onUpdate:activeIndex"
3232
- ]))], 8, Vr));
3521
+ ]))], 8, ei));
3233
3522
  }
3234
- }), qr = { install(e) {
3235
- e.component("VibeLayout", Kr);
3523
+ }), oi = { install(e) {
3524
+ e.component("VibeLayout", ai);
3236
3525
  } };
3237
3526
  //#endregion
3238
- export { Kr as VibeLayout, qr as VibePlugin, qr as default };
3527
+ export { ai as VibeLayout, oi as VibePlugin, oi as default };