@wyxos/vibe 3.0.4 → 3.0.5

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