@wyxos/vibe 3.0.1 → 3.0.2

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