@wyxos/vibe 3.1.20 → 3.1.23
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/components/ListSurface.vue.d.ts +5 -1
- package/lib/components/viewer-core/autoResolveBucketFactory.d.ts +15 -0
- package/lib/components/viewer-core/autoResolveFillUntil.d.ts +46 -0
- package/lib/components/viewer-core/autoResolveHelpers.d.ts +1 -0
- package/lib/components/viewer-core/autoResolveLoading.d.ts +44 -0
- package/lib/components/viewer-core/emptyVisiblePrefetch.d.ts +18 -0
- package/lib/components/viewer-core/fillProgress.d.ts +12 -0
- package/lib/components/viewer-core/masonryBoundaryLock.d.ts +5 -0
- package/lib/components/viewer-core/masonryItemMutation.d.ts +35 -0
- package/lib/components/viewer-core/masonryPendingAppend.d.ts +17 -0
- package/lib/components/viewer-core/masonryScrollBehavior.d.ts +37 -0
- package/lib/components/viewer-core/removalState.d.ts +11 -0
- package/lib/components/viewer-core/useAutoResolveSource.d.ts +21 -12
- package/lib/components/viewer-core/useController.d.ts +16 -1
- package/lib/components/viewer-core/useDataSource.d.ts +13 -2
- package/lib/components/viewer-core/useMasonryList.d.ts +2 -0
- package/lib/components/viewer-core/useViewer.d.ts +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1433 -997
- package/lib/style.css +1 -1
- package/package.json +2 -3
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, getCurrentScope as f, guardReactiveProps as p, h as m, isVNode as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, onScopeDispose as C, openBlock as w, reactive as T, readonly as E, ref as D, renderList as O, renderSlot as k, resolveDynamicComponent as A, toDisplayString as j, toRef as M, unref as N, useAttrs as P, useSlots as F, vShow as I, watch as L, watchEffect as R, withCtx as z, withDirectives as
|
|
1
|
+
import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, getCurrentScope as f, guardReactiveProps as p, h as m, isVNode as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, onScopeDispose as C, openBlock as w, reactive as T, readonly as E, ref as D, renderList as O, renderSlot as k, resolveDynamicComponent as A, toDisplayString as j, toRef as M, unref as N, useAttrs as P, useSlots as F, vShow as I, watch as L, watchEffect as R, withCtx as z, withDirectives as ee, withModifiers as te } from "vue";
|
|
2
2
|
//#region node_modules/lucide-vue-next/dist/esm/shared/src/utils/hasA11yProp.js
|
|
3
|
-
var
|
|
3
|
+
var B = (e) => {
|
|
4
4
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
5
5
|
return !1;
|
|
6
6
|
}, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), U = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), W = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ne = (e) => {
|
|
@@ -24,19 +24,19 @@ var te = (e) => {
|
|
|
24
24
|
stroke: s,
|
|
25
25
|
"stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a || G["stroke-width"]) * 24 / Number(o) : i || a || G["stroke-width"],
|
|
26
26
|
class: H("lucide", c.class, ...e ? [`lucide-${U(ne(e))}-icon`, `lucide-${U(e)}`] : ["lucide-icon"]),
|
|
27
|
-
...!l.default && !
|
|
27
|
+
...!l.default && !B(c) && { "aria-hidden": "true" }
|
|
28
28
|
}, [...t.map((e) => m(...e)), ...l.default ? [l.default()] : []]), q = (e, t) => (n, { slots: r, attrs: i }) => m(K, {
|
|
29
29
|
...i,
|
|
30
30
|
...n,
|
|
31
31
|
iconNode: t,
|
|
32
32
|
name: e
|
|
33
|
-
}, r),
|
|
33
|
+
}, r), J = q("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
|
-
}]]),
|
|
39
|
+
}]]), Y = q("audio-lines", [
|
|
40
40
|
["path", {
|
|
41
41
|
d: "M2 10v3",
|
|
42
42
|
key: "1fnikh"
|
|
@@ -61,7 +61,7 @@ var te = (e) => {
|
|
|
61
61
|
d: "M22 10v3",
|
|
62
62
|
key: "154ddg"
|
|
63
63
|
}]
|
|
64
|
-
]),
|
|
64
|
+
]), re = q("clapperboard", [
|
|
65
65
|
["path", {
|
|
66
66
|
d: "m12.296 3.464 3.02 3.956",
|
|
67
67
|
key: "qash78"
|
|
@@ -180,12 +180,12 @@ var te = (e) => {
|
|
|
180
180
|
}]
|
|
181
181
|
]);
|
|
182
182
|
function fe(e, t = 150) {
|
|
183
|
-
return
|
|
183
|
+
return me(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
return
|
|
185
|
+
function pe(e, t = 150) {
|
|
186
|
+
return me(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function me(e, t, n) {
|
|
189
189
|
let r = [], i = /* @__PURE__ */ new Set(), a = null;
|
|
190
190
|
function o(e) {
|
|
191
191
|
let o = t(e);
|
|
@@ -209,59 +209,59 @@ function pe(e, t, n) {
|
|
|
209
209
|
}
|
|
210
210
|
//#endregion
|
|
211
211
|
//#region src/components/viewer-core/dom.ts
|
|
212
|
-
function
|
|
212
|
+
function he(e) {
|
|
213
213
|
return e instanceof HTMLElement && [
|
|
214
214
|
"INPUT",
|
|
215
215
|
"TEXTAREA",
|
|
216
216
|
"SELECT"
|
|
217
217
|
].includes(e.tagName);
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function ge(e) {
|
|
220
220
|
return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function _e(e) {
|
|
223
223
|
return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Z(e) {
|
|
226
226
|
return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function ve(e) {
|
|
229
229
|
return e ?? "__vibe_initial_cursor__";
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function ye(e, t, n) {
|
|
232
232
|
return Math.min(Math.max(e, t), n);
|
|
233
233
|
}
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region src/components/viewer-core/itemIdentity.ts
|
|
236
|
-
var
|
|
237
|
-
function
|
|
238
|
-
let t = e[
|
|
236
|
+
var be = "__vibeOccurrenceKey";
|
|
237
|
+
function Q(e) {
|
|
238
|
+
let t = e[be];
|
|
239
239
|
return typeof t == "string" && t.length > 0 ? t : e.id;
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function xe(e, t, n) {
|
|
242
242
|
let r = /* @__PURE__ */ new Map(), i = [], a = n;
|
|
243
243
|
for (let e of t) {
|
|
244
|
-
let t = r.get(e.id), n =
|
|
244
|
+
let t = r.get(e.id), n = Q(e);
|
|
245
245
|
t ? t.push(n) : r.set(e.id, [n]);
|
|
246
246
|
}
|
|
247
247
|
for (let t of e) {
|
|
248
248
|
let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
|
|
249
|
-
i.push(
|
|
249
|
+
i.push(Se(t, e));
|
|
250
250
|
}
|
|
251
251
|
return {
|
|
252
252
|
items: i,
|
|
253
253
|
nextSequence: a
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
return
|
|
256
|
+
function Se(e, t) {
|
|
257
|
+
return Q(e) === t ? e : {
|
|
258
258
|
...e,
|
|
259
|
-
[
|
|
259
|
+
[be]: t
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/components/viewer-core/removalState.ts
|
|
264
|
-
function
|
|
264
|
+
function $() {
|
|
265
265
|
let e = D(/* @__PURE__ */ new Set()), t = D([]);
|
|
266
266
|
function n(n) {
|
|
267
267
|
let r = Ce(n).filter((t) => !e.value.has(t));
|
|
@@ -335,7 +335,7 @@ function ke(e, t, n) {
|
|
|
335
335
|
return i >= 0 && r.splice(i, 1, n), r;
|
|
336
336
|
}
|
|
337
337
|
function Ae(e, t, n) {
|
|
338
|
-
let r =
|
|
338
|
+
let r = xe(e, t, n);
|
|
339
339
|
return {
|
|
340
340
|
items: r.items,
|
|
341
341
|
nextSequence: r.nextSequence
|
|
@@ -350,7 +350,7 @@ function je(e, t, n) {
|
|
|
350
350
|
for (let [e, n] of t.entries()) {
|
|
351
351
|
let t = r.get(n.id), i = {
|
|
352
352
|
index: e,
|
|
353
|
-
occurrenceKey:
|
|
353
|
+
occurrenceKey: Q(n)
|
|
354
354
|
};
|
|
355
355
|
t ? t.push(i) : r.set(n.id, [i]);
|
|
356
356
|
}
|
|
@@ -374,7 +374,7 @@ function je(e, t, n) {
|
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
376
|
function Me(e, t) {
|
|
377
|
-
return
|
|
377
|
+
return Q(e) === t ? e : {
|
|
378
378
|
...e,
|
|
379
379
|
__vibeOccurrenceKey: t
|
|
380
380
|
};
|
|
@@ -435,45 +435,61 @@ function Le(e) {
|
|
|
435
435
|
sequence: e.sequence
|
|
436
436
|
}), n = Te(t.bucket.items, e.removedIds);
|
|
437
437
|
return {
|
|
438
|
-
activeIndex:
|
|
438
|
+
activeIndex: ye(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
|
|
439
439
|
buckets: [t.bucket],
|
|
440
440
|
nextSequence: t.nextSequence
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
443
|
function Re(e, t) {
|
|
444
|
-
let n = e[
|
|
445
|
-
return n ?
|
|
444
|
+
let n = e[ye(t, 0, Math.max(0, e.length - 1))];
|
|
445
|
+
return n ? Q(n) : null;
|
|
446
446
|
}
|
|
447
447
|
function ze(e, t, n = null) {
|
|
448
448
|
if (!e.length) return 0;
|
|
449
|
-
let r = n ? e.findIndex((e) =>
|
|
450
|
-
return r >= 0 ? r :
|
|
449
|
+
let r = n ? e.findIndex((e) => Q(e) === n) : -1;
|
|
450
|
+
return r >= 0 ? r : ye(t, 0, e.length - 1);
|
|
451
451
|
}
|
|
452
452
|
function Be(e, t, n) {
|
|
453
453
|
return e ? De(e, t) < n : !1;
|
|
454
454
|
}
|
|
455
455
|
//#endregion
|
|
456
|
+
//#region src/components/viewer-core/autoResolveBucketFactory.ts
|
|
457
|
+
function Ve(e) {
|
|
458
|
+
return (t) => {
|
|
459
|
+
let n = Pe({
|
|
460
|
+
cursor: t.cursor,
|
|
461
|
+
nextCursor: t.nextCursor,
|
|
462
|
+
nextCursorExhausted: t.nextCursorExhausted ?? !1,
|
|
463
|
+
nextItems: t.nextItems,
|
|
464
|
+
previousCursor: t.previousCursor,
|
|
465
|
+
previousItems: t.previousItems,
|
|
466
|
+
sequence: e.getSequence()
|
|
467
|
+
});
|
|
468
|
+
return e.setSequence(n.nextSequence), n.bucket;
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
//#endregion
|
|
456
472
|
//#region src/components/viewer-core/autoResolveCursors.ts
|
|
457
|
-
function
|
|
473
|
+
function He(e, t) {
|
|
458
474
|
return e.find((e) => De(e, t) > 0) ?? e[0] ?? null;
|
|
459
475
|
}
|
|
460
|
-
function
|
|
476
|
+
function Ue(e, t) {
|
|
461
477
|
for (let n = e.length - 1; n >= 0; --n) {
|
|
462
478
|
let r = e[n];
|
|
463
479
|
if (De(r, t) > 0) return r;
|
|
464
480
|
}
|
|
465
481
|
return e[e.length - 1] ?? null;
|
|
466
482
|
}
|
|
467
|
-
function
|
|
483
|
+
function We(e) {
|
|
468
484
|
return !e?.nextCursor || !e.nextCursorExhausted ? null : e.nextCursor;
|
|
469
485
|
}
|
|
470
|
-
function
|
|
486
|
+
function Ge(e, t, n, r) {
|
|
471
487
|
return t === void 0 || n === null ? e : e.map((e) => e.cursor !== t || e.nextCursor !== n ? e : {
|
|
472
488
|
...e,
|
|
473
489
|
nextCursorExhausted: r
|
|
474
490
|
});
|
|
475
491
|
}
|
|
476
|
-
function
|
|
492
|
+
function Ke(e, t, n) {
|
|
477
493
|
return n || e !== "forward" || t === null ? {
|
|
478
494
|
cursor: n,
|
|
479
495
|
exhausted: !1
|
|
@@ -482,7 +498,7 @@ function Ge(e, t, n) {
|
|
|
482
498
|
exhausted: !0
|
|
483
499
|
};
|
|
484
500
|
}
|
|
485
|
-
function
|
|
501
|
+
function qe(e, t) {
|
|
486
502
|
if (t) return {
|
|
487
503
|
cursor: t,
|
|
488
504
|
exhausted: !1
|
|
@@ -493,7 +509,7 @@ function Ke(e, t) {
|
|
|
493
509
|
exhausted: !!n
|
|
494
510
|
};
|
|
495
511
|
}
|
|
496
|
-
function
|
|
512
|
+
function Je(e, t) {
|
|
497
513
|
let n = e.findIndex((e) => De(e, t) > 0);
|
|
498
514
|
if (n < 0) return e;
|
|
499
515
|
let r = n;
|
|
@@ -504,15 +520,276 @@ function qe(e, t) {
|
|
|
504
520
|
return e.slice(n, r + 1);
|
|
505
521
|
}
|
|
506
522
|
//#endregion
|
|
523
|
+
//#region src/components/viewer-core/autoResolveFillUntil.ts
|
|
524
|
+
function Ye(e) {
|
|
525
|
+
async function t(t) {
|
|
526
|
+
if (typeof t == "number") {
|
|
527
|
+
await i(t);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
await a("cursor", () => e.getHasNextPage() && e.getNextCursor() !== t);
|
|
531
|
+
}
|
|
532
|
+
async function n() {
|
|
533
|
+
await a("end", () => e.getHasNextPage());
|
|
534
|
+
}
|
|
535
|
+
function r() {
|
|
536
|
+
e.isFillUntilActive.value = !1, e.fillMode.value = "idle";
|
|
537
|
+
}
|
|
538
|
+
async function i(t) {
|
|
539
|
+
let n = Xe(t);
|
|
540
|
+
n <= 0 || await a("count", () => e.getHasNextPage() && n > 0, () => {
|
|
541
|
+
--n;
|
|
542
|
+
}, n);
|
|
543
|
+
}
|
|
544
|
+
async function a(t, n, r = () => {}, i = null) {
|
|
545
|
+
if (!e.getResolve() || e.getIsManualPageLoadingLocked() || e.isFillUntilActive.value || e.getIsLoading() || !n()) return;
|
|
546
|
+
e.isFillUntilActive.value = !0, s(t, i), e.clearFillDelay(!0);
|
|
547
|
+
let a = 0;
|
|
548
|
+
try {
|
|
549
|
+
for (; n();) {
|
|
550
|
+
let t = e.getNextCursor();
|
|
551
|
+
if (!t || !e.getHasNextPage() || !await o(t, e.getTrailingBoundaryBucket()?.cursor ?? null) || e.operationPhase.value === "failed" || (r(), e.fillCompletedCalls.value += 1, c(), l(), !n())) break;
|
|
552
|
+
let i = e.getNextCursor();
|
|
553
|
+
if (!i || !e.getHasNextPage() || (a += 1, e.operationPhase.value = "filling", e.fillCollectedCount.value = e.getVisibleItemCount(), e.fillCursor.value = i, e.fillTargetCount.value = null, await e.waitFillDelay(e.getFillDelayMs(a)), !e.isFillUntilActive.value)) break;
|
|
554
|
+
}
|
|
555
|
+
} finally {
|
|
556
|
+
e.isFillUntilActive.value = !1, e.fillCollectedCount.value = null, e.fillCursor.value = null, e.fillTargetCount.value = null, e.fillMode.value = "idle", e.clearFillDelay(!0), e.operationPhase.value !== "failed" && e.finishLoadPhase();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
async function o(t, n) {
|
|
560
|
+
e.setLastLoadAttempt(async () => {
|
|
561
|
+
await o(t, n);
|
|
562
|
+
});
|
|
563
|
+
let r = e.getResolve();
|
|
564
|
+
if (!r) return !1;
|
|
565
|
+
let i = ve(t);
|
|
566
|
+
if (e.inFlightCursors.has(i)) return !1;
|
|
567
|
+
let a = e.nextOperationId(), s = typeof AbortController > "u" ? null : new AbortController();
|
|
568
|
+
e.inFlightCursors.add(i), e.setActiveResolveController(s), e.errorMessage.value = null, e.operationPhase.value = "filling", e.fillCollectedCount.value = e.getVisibleItemCount(), e.fillCursor.value = t, e.fillTargetCount.value = null, e.pendingAppendBuckets.value = [], e.isAwaitingAppendCommit.value = !1;
|
|
569
|
+
try {
|
|
570
|
+
let i = await r({
|
|
571
|
+
cursor: t,
|
|
572
|
+
pageSize: e.getPageSize(),
|
|
573
|
+
signal: s?.signal
|
|
574
|
+
});
|
|
575
|
+
if (!e.getOperationIsCurrent(a)) return e.finishLoadPhase(), !1;
|
|
576
|
+
if (u(i.total), !i.items.length) return e.autoBuckets.value = i.nextPage ? Qe(e.autoBuckets.value, n, t, i.nextPage) : Ge(e.autoBuckets.value, n, t, !0), c(), e.finishLoadPhase(), !0;
|
|
577
|
+
let o = Ke("forward", t, i.nextPage);
|
|
578
|
+
return e.autoBuckets.value = [...e.autoBuckets.value, e.createBucket({
|
|
579
|
+
cursor: t,
|
|
580
|
+
nextCursor: o.cursor,
|
|
581
|
+
nextCursorExhausted: o.exhausted,
|
|
582
|
+
nextItems: i.items,
|
|
583
|
+
previousCursor: i.previousPage ?? null,
|
|
584
|
+
previousItems: []
|
|
585
|
+
})], c(), e.finishLoadPhase(), !0;
|
|
586
|
+
} catch (t) {
|
|
587
|
+
return Ne(t) || !e.getOperationIsCurrent(a) ? (e.finishLoadPhase(), !1) : (e.errorMessage.value = t instanceof Error ? t.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.fillCollectedCount.value = null, e.fillCursor.value = null, e.fillTargetCount.value = null, !1);
|
|
588
|
+
} finally {
|
|
589
|
+
e.clearActiveResolveController(s), e.inFlightCursors.delete(i);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function s(t, n) {
|
|
593
|
+
e.fillMode.value = t, e.fillCompletedCalls.value = 0, e.fillLoadedCount.value = e.getLoadedItemCount(), e.fillProgress.value = n && n > 0 ? 0 : null, e.fillTargetCalls.value = n, e.fillTotalCount.value = null;
|
|
594
|
+
}
|
|
595
|
+
function c() {
|
|
596
|
+
e.fillLoadedCount.value = e.getLoadedItemCount();
|
|
597
|
+
}
|
|
598
|
+
function l() {
|
|
599
|
+
if (e.fillMode.value === "count") {
|
|
600
|
+
let t = e.fillTargetCalls.value;
|
|
601
|
+
e.fillProgress.value = t && t > 0 ? Ze(e.fillCompletedCalls.value / t) : null;
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
if (e.fillMode.value === "end") {
|
|
605
|
+
let t = e.fillTotalCount.value;
|
|
606
|
+
if (t === null) {
|
|
607
|
+
e.fillProgress.value = null;
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
e.fillProgress.value = t <= 0 ? 1 : Ze(e.fillLoadedCount.value / t);
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
e.fillProgress.value = null;
|
|
614
|
+
}
|
|
615
|
+
function u(t) {
|
|
616
|
+
typeof t == "number" && Number.isFinite(t) && t >= 0 && (e.fillTotalCount.value = Math.floor(t));
|
|
617
|
+
}
|
|
618
|
+
return {
|
|
619
|
+
cancel: r,
|
|
620
|
+
fillUntil: t,
|
|
621
|
+
fillUntilEnd: n
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
function Xe(e) {
|
|
625
|
+
return Number.isFinite(e) && e > 0 ? Math.floor(e) : 0;
|
|
626
|
+
}
|
|
627
|
+
function Ze(e) {
|
|
628
|
+
return Math.min(Math.max(e, 0), 1);
|
|
629
|
+
}
|
|
630
|
+
function Qe(e, t, n, r) {
|
|
631
|
+
return t === void 0 ? e : e.map((e) => e.cursor === t && e.nextCursor === n ? {
|
|
632
|
+
...e,
|
|
633
|
+
nextCursor: r,
|
|
634
|
+
nextCursorExhausted: !1
|
|
635
|
+
} : e);
|
|
636
|
+
}
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/components/viewer-core/autoResolveLoading.ts
|
|
639
|
+
function $e(e) {
|
|
640
|
+
async function t(t) {
|
|
641
|
+
let n = e.getResolve(), r = e.getBoundaryBucket(t);
|
|
642
|
+
if (!n || !r) return null;
|
|
643
|
+
let i = ve(r.cursor);
|
|
644
|
+
if (e.inFlightCursors.has(i)) return null;
|
|
645
|
+
e.inFlightCursors.add(i), e.errorMessage.value = null, e.operationPhase.value = "refreshing", e.clearFillState();
|
|
646
|
+
let a = e.nextOperationId(), o = typeof AbortController > "u" ? null : new AbortController();
|
|
647
|
+
e.setActiveResolveController(o);
|
|
648
|
+
try {
|
|
649
|
+
let i = await n({
|
|
650
|
+
cursor: r.cursor,
|
|
651
|
+
pageSize: e.getPageSize(),
|
|
652
|
+
signal: o?.signal
|
|
653
|
+
});
|
|
654
|
+
if (!e.getOperationIsCurrent(a)) return e.finishLoadPhase(), null;
|
|
655
|
+
let s = qe(r, i.nextPage), c = Fe({
|
|
656
|
+
cursor: r.cursor,
|
|
657
|
+
nextCursor: s.cursor,
|
|
658
|
+
nextCursorExhausted: s.exhausted,
|
|
659
|
+
nextItems: i.items,
|
|
660
|
+
previousCursor: i.previousPage ?? null,
|
|
661
|
+
previousItems: r.items,
|
|
662
|
+
sequence: e.getSequence()
|
|
663
|
+
});
|
|
664
|
+
e.setSequence(c.nextSequence);
|
|
665
|
+
let l = e.getActiveOccurrenceKey();
|
|
666
|
+
return e.autoBuckets.value = ke(e.autoBuckets.value, r.cursor, c.bucket), e.syncActiveIndexAfterVisibilityChange(l), e.finishLoadPhase(), {
|
|
667
|
+
followCursor: t === "leading" ? i.previousPage ?? null : i.nextPage,
|
|
668
|
+
itemsInserted: c.insertedCount
|
|
669
|
+
};
|
|
670
|
+
} catch (t) {
|
|
671
|
+
return Ne(t) || !e.getOperationIsCurrent(a) ? (e.finishLoadPhase(), null) : (e.errorMessage.value = t instanceof Error ? t.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.clearFillState(), null);
|
|
672
|
+
} finally {
|
|
673
|
+
e.clearActiveResolveController(o), e.inFlightCursors.delete(i);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
async function n(t) {
|
|
677
|
+
let n = e.getResolve();
|
|
678
|
+
if (!n) return null;
|
|
679
|
+
let r = e.nextOperationId(), i = /* @__PURE__ */ new Set(), a = [], o = t.cursor, s = 0;
|
|
680
|
+
for (e.errorMessage.value = null, e.operationPhase.value = t.phase, e.clearFillState();;) {
|
|
681
|
+
if (!e.getOperationIsCurrent(r)) return Ie(a, t.direction, e.removedIds.value, !0);
|
|
682
|
+
if (a.length > 0 && e.isManualPageLoadingLocked.value) return Ie(a, t.direction, e.removedIds.value, !1);
|
|
683
|
+
let c = ve(o);
|
|
684
|
+
if (i.has(c) || e.inFlightCursors.has(c)) break;
|
|
685
|
+
i.add(c), e.inFlightCursors.add(c);
|
|
686
|
+
let l = typeof AbortController > "u" ? null : new AbortController();
|
|
687
|
+
e.setActiveResolveController(l);
|
|
688
|
+
try {
|
|
689
|
+
let i = await n({
|
|
690
|
+
cursor: o,
|
|
691
|
+
pageSize: e.getPageSize(),
|
|
692
|
+
signal: l?.signal
|
|
693
|
+
});
|
|
694
|
+
if (!e.getOperationIsCurrent(r)) return Ie(a, t.direction, e.removedIds.value, !0);
|
|
695
|
+
let c = Ke(t.direction, o, i.nextPage), u = e.createBucket({
|
|
696
|
+
cursor: o,
|
|
697
|
+
nextCursor: c.cursor,
|
|
698
|
+
nextCursorExhausted: c.exhausted,
|
|
699
|
+
nextItems: i.items,
|
|
700
|
+
previousCursor: i.previousPage ?? null,
|
|
701
|
+
previousItems: []
|
|
702
|
+
});
|
|
703
|
+
a.push(u);
|
|
704
|
+
let d = a.reduce((t, n) => t + De(n, e.removedIds.value), 0), f = t.direction === "forward" ? u.nextCursorExhausted ? null : u.nextCursor : u.previousCursor;
|
|
705
|
+
if (!t.continueUntilFilled || d >= e.getPageSize() || !f) return e.fillCursor.value = null, Ie(a, t.direction, e.removedIds.value, !1);
|
|
706
|
+
if (e.isManualPageLoadingLocked.value) return Ie(a, t.direction, e.removedIds.value, !1);
|
|
707
|
+
if (e.operationPhase.value = "filling", e.fillCollectedCount.value = d, e.fillCursor.value = f, e.fillTargetCount.value = e.getPageSize(), s += 1, await e.waitFillDelay(e.getFillDelayMs(s)), !e.getOperationIsCurrent(r)) return Ie(a, t.direction, e.removedIds.value, !0);
|
|
708
|
+
o = f;
|
|
709
|
+
} catch (n) {
|
|
710
|
+
return Ne(n) || !e.getOperationIsCurrent(r) ? Ie(a, t.direction, e.removedIds.value, !0) : (e.errorMessage.value = n instanceof Error ? n.message : "The viewer could not load items.", e.operationPhase.value = "failed", e.clearFillState(), null);
|
|
711
|
+
} finally {
|
|
712
|
+
e.clearActiveResolveController(l), e.inFlightCursors.delete(c);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
return Ie(a, t.direction, e.removedIds.value, !1);
|
|
716
|
+
}
|
|
717
|
+
return {
|
|
718
|
+
collectBuckets: n,
|
|
719
|
+
reloadBoundaryBucket: t
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region src/components/viewer-core/fillProgress.ts
|
|
724
|
+
function et(e) {
|
|
725
|
+
let t = {
|
|
726
|
+
fillCompletedCalls: D(0),
|
|
727
|
+
fillLoadedCount: D(0),
|
|
728
|
+
fillMode: D("idle"),
|
|
729
|
+
fillProgress: D(null),
|
|
730
|
+
fillTargetCalls: D(null),
|
|
731
|
+
fillTotalCount: D(null)
|
|
732
|
+
};
|
|
733
|
+
function n() {
|
|
734
|
+
t.fillMode.value = "idle", t.fillCompletedCalls.value = 0, t.fillLoadedCount.value = e(), t.fillProgress.value = null, t.fillTargetCalls.value = null, t.fillTotalCount.value = null;
|
|
735
|
+
}
|
|
736
|
+
return {
|
|
737
|
+
refs: t,
|
|
738
|
+
reset: n
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
//#endregion
|
|
742
|
+
//#region src/components/viewer-core/emptyVisiblePrefetch.ts
|
|
743
|
+
function tt(e) {
|
|
744
|
+
let t = null, n = !1, r = !1;
|
|
745
|
+
function i() {
|
|
746
|
+
t = null;
|
|
747
|
+
}
|
|
748
|
+
function a() {
|
|
749
|
+
r || n || (r = !0, _().then(o));
|
|
750
|
+
}
|
|
751
|
+
async function o() {
|
|
752
|
+
if (r = !1, s()) {
|
|
753
|
+
if (!e.hasNextPage.value) {
|
|
754
|
+
let e = c();
|
|
755
|
+
if (t === e) return;
|
|
756
|
+
t = e;
|
|
757
|
+
}
|
|
758
|
+
n = !0;
|
|
759
|
+
try {
|
|
760
|
+
await e.prefetchNextPage();
|
|
761
|
+
} finally {
|
|
762
|
+
n = !1, s() && a();
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
function s() {
|
|
767
|
+
return !e.items.value.length && !e.loading.value && !e.isInitialLoading() && !e.isPageLoadingLocked.value && (e.hasNextPage.value || e.canRefreshTrailingBoundary.value);
|
|
768
|
+
}
|
|
769
|
+
function c() {
|
|
770
|
+
let t = e.trailingBoundaryBucket.value;
|
|
771
|
+
return [
|
|
772
|
+
t?.cursor ?? "",
|
|
773
|
+
t?.nextCursor ?? "",
|
|
774
|
+
t?.items.map((e) => e.id).join("") ?? "",
|
|
775
|
+
e.removedIds.value.size
|
|
776
|
+
].join("");
|
|
777
|
+
}
|
|
778
|
+
return {
|
|
779
|
+
resetRefreshAttempt: i,
|
|
780
|
+
schedule: a
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
//#endregion
|
|
507
784
|
//#region src/components/viewer-core/fillDelay.ts
|
|
508
|
-
var
|
|
509
|
-
function
|
|
785
|
+
var nt = 2e3, rt = 1e3, it = 100;
|
|
786
|
+
function at(e, t = nt, n = rt) {
|
|
510
787
|
return t + Math.max(0, e - 1) * n;
|
|
511
788
|
}
|
|
512
|
-
function
|
|
789
|
+
function ot(e, t) {
|
|
513
790
|
return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
|
|
514
791
|
}
|
|
515
|
-
function
|
|
792
|
+
function st() {
|
|
516
793
|
let e = D(null), t = null, n = null, r = null;
|
|
517
794
|
function i(i = !1) {
|
|
518
795
|
if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
|
|
@@ -530,7 +807,7 @@ function $e() {
|
|
|
530
807
|
let t = Math.max(0, a - (Date.now() - s));
|
|
531
808
|
e.value = t, t <= 0 && l();
|
|
532
809
|
};
|
|
533
|
-
t = setInterval(u,
|
|
810
|
+
t = setInterval(u, it), n = setTimeout(l, a), u();
|
|
534
811
|
}));
|
|
535
812
|
}
|
|
536
813
|
return {
|
|
@@ -541,328 +818,334 @@ function $e() {
|
|
|
541
818
|
}
|
|
542
819
|
//#endregion
|
|
543
820
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
544
|
-
function
|
|
545
|
-
let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d =
|
|
546
|
-
|
|
821
|
+
function ct(e) {
|
|
822
|
+
let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d = st(), f = d.remainingMs, p = D(null), m = D(!1), h = D(!0), g = D(!1), _ = D(!1), v = /* @__PURE__ */ new Set(), y = null, b = null, C = 0, w = 0, T = Ve({
|
|
823
|
+
getSequence: () => w,
|
|
824
|
+
setSequence: (e) => {
|
|
825
|
+
w = e;
|
|
826
|
+
}
|
|
827
|
+
}), E = i(() => ot(e.fillDelayMs, nt)), O = i(() => ot(e.fillDelayStepMs, rt)), k = i(() => typeof e.resolve == "function"), A = i(() => Z(e.pageSize)), j = i(() => we(n.value)), M = et(() => j.value.length), N = i(() => Te(j.value, e.removedIds.value)), P = i(() => r.value), F = i(() => _e(c.value) || m.value), I = i(() => He(n.value, e.removedIds.value)), R = i(() => Ue(n.value, e.removedIds.value)), z = i(() => R.value?.nextCursor ?? null), ee = i(() => o.value ? null : I.value?.previousCursor ?? null), te = i(() => !!z.value && R.value?.nextCursorExhausted !== !0), B = i(() => !!ee.value), V = i(() => _.value || g.value), H = i(() => k.value && !!R.value?.items.length), U = i(() => Te(we(a.value), e.removedIds.value)), W = i(() => Oe(n.value, e.removedIds.value, P.value)), ne = i(() => !N.value.length && !F.value && !!s.value), G = Ye({
|
|
828
|
+
autoBuckets: n,
|
|
829
|
+
clearActiveResolveController(e) {
|
|
830
|
+
y === e && (y = null);
|
|
831
|
+
},
|
|
832
|
+
clearFillDelay: (e) => d.clear(e),
|
|
833
|
+
createBucket: T,
|
|
834
|
+
errorMessage: s,
|
|
835
|
+
fillCollectedCount: l,
|
|
836
|
+
fillCursor: u,
|
|
837
|
+
fillTargetCount: p,
|
|
838
|
+
...M.refs,
|
|
839
|
+
finishLoadPhase: $,
|
|
840
|
+
getFillDelayMs: (e) => at(e, E.value, O.value),
|
|
841
|
+
getHasNextPage: () => te.value,
|
|
842
|
+
getIsLoading: () => F.value,
|
|
843
|
+
getIsManualPageLoadingLocked: () => _.value,
|
|
844
|
+
getLoadedItemCount: () => j.value.length,
|
|
845
|
+
getNextCursor: () => z.value,
|
|
846
|
+
getOperationIsCurrent: (e) => e === C,
|
|
847
|
+
getPageSize: () => A.value,
|
|
848
|
+
getResolve: () => e.resolve,
|
|
849
|
+
getTrailingBoundaryBucket: () => R.value,
|
|
850
|
+
getVisibleItemCount: () => N.value.length,
|
|
851
|
+
inFlightCursors: v,
|
|
852
|
+
isAwaitingAppendCommit: m,
|
|
853
|
+
isFillUntilActive: g,
|
|
854
|
+
nextOperationId: () => ++C,
|
|
855
|
+
operationPhase: c,
|
|
856
|
+
pendingAppendBuckets: a,
|
|
857
|
+
setActiveResolveController: (e) => {
|
|
858
|
+
y = e;
|
|
859
|
+
},
|
|
860
|
+
setLastLoadAttempt: (e) => {
|
|
861
|
+
b = e;
|
|
862
|
+
},
|
|
863
|
+
waitFillDelay: (e) => d.wait(e)
|
|
864
|
+
}), K = tt({
|
|
865
|
+
canRefreshTrailingBoundary: H,
|
|
866
|
+
hasNextPage: te,
|
|
867
|
+
isInitialLoading: De,
|
|
868
|
+
isPageLoadingLocked: V,
|
|
869
|
+
items: N,
|
|
870
|
+
loading: F,
|
|
871
|
+
prefetchNextPage: Y,
|
|
872
|
+
removedIds: e.removedIds,
|
|
873
|
+
trailingBoundaryBucket: R
|
|
874
|
+
}), q = $e({
|
|
875
|
+
autoBuckets: n,
|
|
876
|
+
clearActiveResolveController(e) {
|
|
877
|
+
y === e && (y = null);
|
|
878
|
+
},
|
|
879
|
+
clearFillState: Ce,
|
|
880
|
+
createBucket: T,
|
|
881
|
+
errorMessage: s,
|
|
882
|
+
fillCollectedCount: l,
|
|
883
|
+
fillCursor: u,
|
|
884
|
+
fillTargetCount: p,
|
|
885
|
+
finishLoadPhase: $,
|
|
886
|
+
getActiveOccurrenceKey: pe,
|
|
887
|
+
getBoundaryBucket: (e) => e === "leading" ? I.value : R.value,
|
|
888
|
+
getFillDelayMs: (e) => at(e, E.value, O.value),
|
|
889
|
+
getOperationIsCurrent: (e) => e === C,
|
|
890
|
+
getPageSize: () => A.value,
|
|
891
|
+
getResolve: () => e.resolve,
|
|
892
|
+
getSequence: () => w,
|
|
893
|
+
inFlightCursors: v,
|
|
894
|
+
isManualPageLoadingLocked: _,
|
|
895
|
+
nextOperationId: () => ++C,
|
|
896
|
+
operationPhase: c,
|
|
897
|
+
removedIds: e.removedIds,
|
|
898
|
+
setActiveResolveController: (e) => {
|
|
899
|
+
y = e;
|
|
900
|
+
},
|
|
901
|
+
setSequence: (e) => {
|
|
902
|
+
w = e;
|
|
903
|
+
},
|
|
904
|
+
syncActiveIndexAfterVisibilityChange: me,
|
|
905
|
+
waitFillDelay: (e) => d.wait(e)
|
|
906
|
+
});
|
|
907
|
+
L(() => N.value.length, (e) => {
|
|
547
908
|
if (e === 0) {
|
|
548
|
-
r.value = 0;
|
|
909
|
+
r.value = 0, K.schedule();
|
|
549
910
|
return;
|
|
550
911
|
}
|
|
551
|
-
o.value &&= (
|
|
912
|
+
K.resetRefreshAttempt(), o.value &&= (Ae(), !1), r.value > e - 1 && (r.value = e - 1);
|
|
552
913
|
}), L(() => r.value, () => {
|
|
553
|
-
h.value &&
|
|
554
|
-
}), L(() => F.value, (e) => {
|
|
555
|
-
e && !A.value.length && c.value === "idle" && ce();
|
|
914
|
+
h.value && ge();
|
|
556
915
|
}), S(() => {
|
|
557
|
-
|
|
916
|
+
Ee() || e.resolve && J();
|
|
558
917
|
}), x(() => {
|
|
559
|
-
|
|
918
|
+
y?.abort(), y = null, d.clear(!0);
|
|
560
919
|
});
|
|
561
|
-
async function
|
|
562
|
-
|
|
563
|
-
let t = await
|
|
920
|
+
async function J() {
|
|
921
|
+
b = J;
|
|
922
|
+
let t = await Se({
|
|
564
923
|
continueUntilFilled: !0,
|
|
565
924
|
cursor: e.initialCursor ?? null,
|
|
566
925
|
direction: "forward",
|
|
567
926
|
phase: "initializing"
|
|
568
927
|
});
|
|
569
|
-
t && (n.value = t.buckets, r.value = 0,
|
|
928
|
+
t && (n.value = t.buckets, r.value = 0, $());
|
|
570
929
|
}
|
|
571
|
-
async function
|
|
572
|
-
if (
|
|
573
|
-
let e = !
|
|
930
|
+
async function Y() {
|
|
931
|
+
if (V.value || F.value) return;
|
|
932
|
+
let e = !N.value.length, t = R.value, n = {
|
|
574
933
|
commitImmediately: e,
|
|
575
934
|
originCursor: t?.cursor ?? null
|
|
576
|
-
}, r =
|
|
577
|
-
if (
|
|
578
|
-
if (!
|
|
579
|
-
let e = await
|
|
580
|
-
e?.followCursor && (e.itemsInserted === 0 ||
|
|
935
|
+
}, r = We(t);
|
|
936
|
+
if (ke("trailing")) {
|
|
937
|
+
if (!H.value) return;
|
|
938
|
+
let e = await xe("trailing");
|
|
939
|
+
e?.followCursor && (e.itemsInserted === 0 || ke("trailing")) && await ve(e.followCursor, n);
|
|
581
940
|
return;
|
|
582
941
|
}
|
|
583
942
|
if (r) {
|
|
584
943
|
if (t?.cursor === r) {
|
|
585
|
-
let e = await
|
|
586
|
-
e?.followCursor && e.itemsInserted === 0 && await
|
|
944
|
+
let e = await xe("trailing");
|
|
945
|
+
e?.followCursor && e.itemsInserted === 0 && await ve(e.followCursor, n);
|
|
587
946
|
return;
|
|
588
947
|
}
|
|
589
|
-
await
|
|
948
|
+
await ve(r, n);
|
|
590
949
|
return;
|
|
591
950
|
}
|
|
592
|
-
if (!
|
|
593
|
-
let e =
|
|
594
|
-
e?.followCursor && e.itemsInserted === 0 && await
|
|
951
|
+
if (!te.value) {
|
|
952
|
+
let e = H.value ? await xe("trailing") : null;
|
|
953
|
+
e?.followCursor && e.itemsInserted === 0 && await ve(e.followCursor, n);
|
|
595
954
|
return;
|
|
596
955
|
}
|
|
597
|
-
await
|
|
956
|
+
await ve(z.value, n);
|
|
598
957
|
}
|
|
599
|
-
async function
|
|
600
|
-
if (!(
|
|
601
|
-
if (
|
|
602
|
-
let e = await
|
|
603
|
-
e?.itemsInserted === 0 && e.followCursor && await
|
|
958
|
+
async function re() {
|
|
959
|
+
if (!(V.value || !B.value || F.value)) {
|
|
960
|
+
if (ke("leading")) {
|
|
961
|
+
let e = await xe("leading");
|
|
962
|
+
e?.itemsInserted === 0 && e.followCursor && await be(e.followCursor);
|
|
604
963
|
return;
|
|
605
964
|
}
|
|
606
|
-
await
|
|
965
|
+
await be(ee.value);
|
|
607
966
|
}
|
|
608
967
|
}
|
|
609
|
-
async function
|
|
610
|
-
if (
|
|
611
|
-
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value =
|
|
612
|
-
|
|
968
|
+
async function ie() {
|
|
969
|
+
if (ne.value) {
|
|
970
|
+
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = k.value ? "initializing" : "idle", Ce(), M.reset(), m.value = !1, v.clear(), y?.abort(), y = null, d.clear(!0), Ee()) {
|
|
971
|
+
$();
|
|
613
972
|
return;
|
|
614
973
|
}
|
|
615
|
-
await
|
|
974
|
+
await J();
|
|
616
975
|
}
|
|
617
976
|
}
|
|
618
|
-
async function
|
|
619
|
-
if (
|
|
620
|
-
|
|
977
|
+
async function ae() {
|
|
978
|
+
if (ne.value) return ie();
|
|
979
|
+
V.value || c.value !== "failed" || !b || (s.value = null, await b());
|
|
621
980
|
}
|
|
622
|
-
async function
|
|
623
|
-
if (!a.value.length) return m.value = !1,
|
|
624
|
-
n.value = [...n.value, ...a.value], a.value = [], m.value = !1,
|
|
981
|
+
async function oe() {
|
|
982
|
+
if (!a.value.length) return m.value = !1, $();
|
|
983
|
+
n.value = [...n.value, ...a.value], a.value = [], m.value = !1, $();
|
|
625
984
|
}
|
|
626
|
-
function
|
|
627
|
-
let n =
|
|
985
|
+
function se(t) {
|
|
986
|
+
let n = N.value;
|
|
628
987
|
if (!n.length) return;
|
|
629
|
-
let i =
|
|
988
|
+
let i = ye(t, 0, n.length - 1);
|
|
630
989
|
i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
|
|
631
990
|
}
|
|
632
|
-
function
|
|
633
|
-
h.value = e;
|
|
991
|
+
function ce(e) {
|
|
992
|
+
h.value = e, K.schedule();
|
|
634
993
|
}
|
|
635
|
-
function
|
|
636
|
-
|
|
994
|
+
function le() {
|
|
995
|
+
_.value = !0, d.clear(!0);
|
|
637
996
|
}
|
|
638
|
-
function
|
|
639
|
-
|
|
997
|
+
function ue() {
|
|
998
|
+
_.value = !1, K.schedule();
|
|
640
999
|
}
|
|
641
|
-
function
|
|
642
|
-
|
|
1000
|
+
function X() {
|
|
1001
|
+
fe(), s.value = null, Ce(), G.cancel(), a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), m.value = !1, o.value = !1, $();
|
|
643
1002
|
}
|
|
644
|
-
function
|
|
645
|
-
|
|
1003
|
+
function de() {
|
|
1004
|
+
g.value && (fe(), Ce(), G.cancel(), m.value = !1, $());
|
|
1005
|
+
}
|
|
1006
|
+
function fe() {
|
|
1007
|
+
C += 1, y?.abort(), y = null, d.clear(!0), v.clear();
|
|
1008
|
+
}
|
|
1009
|
+
function pe() {
|
|
1010
|
+
return Re(N.value, P.value);
|
|
646
1011
|
}
|
|
647
|
-
function
|
|
648
|
-
if (
|
|
1012
|
+
function me(e = null, t = {}) {
|
|
1013
|
+
if (N.value.length === 0) {
|
|
649
1014
|
r.value = 0, !t.preserveTrailingPlaceholder && n.value.length > 0 && (o.value = !0);
|
|
650
1015
|
return;
|
|
651
1016
|
}
|
|
652
1017
|
if (e) {
|
|
653
|
-
let t =
|
|
1018
|
+
let t = N.value.findIndex((t) => Q(t) === e);
|
|
654
1019
|
if (t >= 0) {
|
|
655
1020
|
r.value = t;
|
|
656
1021
|
return;
|
|
657
1022
|
}
|
|
658
1023
|
}
|
|
659
|
-
if (t.preserveTrailingPlaceholder && r.value >=
|
|
660
|
-
r.value =
|
|
1024
|
+
if (t.preserveTrailingPlaceholder && r.value >= N.value.length) {
|
|
1025
|
+
r.value = N.value.length;
|
|
661
1026
|
return;
|
|
662
1027
|
}
|
|
663
|
-
r.value = ze(
|
|
1028
|
+
r.value = ze(N.value, P.value, e);
|
|
664
1029
|
}
|
|
665
|
-
function
|
|
666
|
-
a.value.length > 0 && (!
|
|
1030
|
+
function he() {
|
|
1031
|
+
a.value.length > 0 && (!U.value.length || !N.value.length) && oe();
|
|
667
1032
|
}
|
|
668
|
-
async function
|
|
669
|
-
if (!(!h.value ||
|
|
670
|
-
if (!
|
|
671
|
-
(
|
|
1033
|
+
async function ge() {
|
|
1034
|
+
if (!(!h.value || De())) {
|
|
1035
|
+
if (!N.value.length) {
|
|
1036
|
+
(te.value || H.value) && await Y();
|
|
672
1037
|
return;
|
|
673
1038
|
}
|
|
674
|
-
|
|
1039
|
+
B.value && r.value < 3 && await re(), te.value && r.value >= N.value.length - 3 && await Y();
|
|
675
1040
|
}
|
|
676
1041
|
}
|
|
677
|
-
async function
|
|
678
|
-
|
|
679
|
-
await
|
|
1042
|
+
async function ve(e, t = {}) {
|
|
1043
|
+
b = async () => {
|
|
1044
|
+
await ve(e, t);
|
|
680
1045
|
};
|
|
681
|
-
let r = await
|
|
1046
|
+
let r = await Se({
|
|
682
1047
|
continueUntilFilled: !0,
|
|
683
1048
|
cursor: e,
|
|
684
1049
|
direction: "forward",
|
|
685
1050
|
phase: "loading"
|
|
686
1051
|
});
|
|
687
1052
|
if (r) {
|
|
688
|
-
if (!r.visibleCount) return n.value =
|
|
689
|
-
if (r.canceled) return n.value = [...n.value, ...r.buckets], a.value = [], m.value = !1,
|
|
690
|
-
if (a.value = r.buckets, t.commitImmediately || !
|
|
1053
|
+
if (!r.visibleCount) return n.value = Ge(n.value, t.originCursor, e, !0), a.value = [], m.value = !1, $();
|
|
1054
|
+
if (r.canceled) return n.value = [...n.value, ...r.buckets], a.value = [], m.value = !1, $();
|
|
1055
|
+
if (a.value = r.buckets, t.commitImmediately || !N.value.length || !U.value.length) return n.value = [...n.value, ...a.value], a.value = [], m.value = !1, $();
|
|
691
1056
|
m.value = !0;
|
|
692
1057
|
}
|
|
693
1058
|
}
|
|
694
|
-
async function
|
|
695
|
-
|
|
696
|
-
await
|
|
1059
|
+
async function be(e) {
|
|
1060
|
+
b = async () => {
|
|
1061
|
+
await be(e);
|
|
697
1062
|
};
|
|
698
|
-
let t = await
|
|
1063
|
+
let t = await Se({
|
|
699
1064
|
continueUntilFilled: !0,
|
|
700
1065
|
cursor: e,
|
|
701
1066
|
direction: "backward",
|
|
702
1067
|
phase: "loading"
|
|
703
1068
|
});
|
|
704
1069
|
if (!t) return;
|
|
705
|
-
let r =
|
|
706
|
-
n.value = [...t.buckets, ...n.value],
|
|
707
|
-
}
|
|
708
|
-
async function X(t) {
|
|
709
|
-
if (y = async () => {
|
|
710
|
-
await X(t);
|
|
711
|
-
}, !e.resolve) return null;
|
|
712
|
-
let r = t === "leading" ? N.value : P.value;
|
|
713
|
-
if (!r) return null;
|
|
714
|
-
let i = _e(r.cursor);
|
|
715
|
-
if (_.has(i)) return null;
|
|
716
|
-
_.add(i), s.value = null, c.value = "refreshing", l.value = null, u.value = null, p.value = null;
|
|
717
|
-
let a = ++b, o = typeof AbortController > "u" ? null : new AbortController();
|
|
718
|
-
v = o;
|
|
719
|
-
try {
|
|
720
|
-
let i = await e.resolve({
|
|
721
|
-
cursor: r.cursor,
|
|
722
|
-
pageSize: O.value,
|
|
723
|
-
signal: o?.signal
|
|
724
|
-
});
|
|
725
|
-
if (a !== b) return Z(), null;
|
|
726
|
-
let s = Ke(r, i.nextPage), c = Fe({
|
|
727
|
-
cursor: r.cursor,
|
|
728
|
-
nextCursor: s.cursor,
|
|
729
|
-
nextCursorExhausted: s.exhausted,
|
|
730
|
-
nextItems: i.items,
|
|
731
|
-
previousCursor: i.previousPage ?? null,
|
|
732
|
-
previousItems: r.items,
|
|
733
|
-
sequence: C
|
|
734
|
-
});
|
|
735
|
-
C = c.nextSequence;
|
|
736
|
-
let l = ae();
|
|
737
|
-
return n.value = ke(n.value, r.cursor, c.bucket), oe(l), Z(), {
|
|
738
|
-
followCursor: t === "leading" ? i.previousPage ?? null : i.nextPage,
|
|
739
|
-
itemsInserted: c.insertedCount
|
|
740
|
-
};
|
|
741
|
-
} catch (e) {
|
|
742
|
-
return Ne(e) || a !== b ? (Z(), null) : (s.value = e instanceof Error ? e.message : "The viewer could not load items.", c.value = "failed", l.value = null, u.value = null, p.value = null, null);
|
|
743
|
-
} finally {
|
|
744
|
-
v === o && (v = null), _.delete(i);
|
|
745
|
-
}
|
|
1070
|
+
let r = pe();
|
|
1071
|
+
n.value = [...t.buckets, ...n.value], me(r), $();
|
|
746
1072
|
}
|
|
747
|
-
async function
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
752
|
-
if (i.length > 0 && g.value) return Ie(i, t.direction, e.removedIds.value, !1);
|
|
753
|
-
let f = _e(a);
|
|
754
|
-
if (r.has(f) || _.has(f)) break;
|
|
755
|
-
r.add(f), _.add(f);
|
|
756
|
-
let m = typeof AbortController > "u" ? null : new AbortController();
|
|
757
|
-
v = m;
|
|
758
|
-
try {
|
|
759
|
-
let r = await e.resolve({
|
|
760
|
-
cursor: a,
|
|
761
|
-
pageSize: O.value,
|
|
762
|
-
signal: m?.signal
|
|
763
|
-
});
|
|
764
|
-
if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
765
|
-
let s = Ge(t.direction, a, r.nextPage), f = fe({
|
|
766
|
-
cursor: a,
|
|
767
|
-
nextCursor: s.cursor,
|
|
768
|
-
nextCursorExhausted: s.exhausted,
|
|
769
|
-
nextItems: r.items,
|
|
770
|
-
previousCursor: r.previousPage ?? null,
|
|
771
|
-
previousItems: []
|
|
772
|
-
});
|
|
773
|
-
i.push(f);
|
|
774
|
-
let h = i.reduce((t, n) => t + De(n, e.removedIds.value), 0), _ = t.direction === "forward" ? f.nextCursorExhausted ? null : f.nextCursor : f.previousCursor;
|
|
775
|
-
if (!t.continueUntilFilled || h >= O.value || !_) return u.value = null, {
|
|
776
|
-
canceled: !1,
|
|
777
|
-
buckets: t.direction === "backward" ? [...i].reverse() : i,
|
|
778
|
-
visibleCount: h
|
|
779
|
-
};
|
|
780
|
-
if (g.value) return Ie(i, t.direction, e.removedIds.value, !1);
|
|
781
|
-
c.value = "filling", l.value = h, u.value = _, p.value = O.value, o += 1;
|
|
782
|
-
let v = Ze(o, w.value, T.value);
|
|
783
|
-
if (await d.wait(v), n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
784
|
-
a = _;
|
|
785
|
-
} catch (r) {
|
|
786
|
-
return Ne(r) || n !== b ? Ie(i, t.direction, e.removedIds.value, !0) : (s.value = r instanceof Error ? r.message : "The viewer could not load items.", c.value = "failed", l.value = null, u.value = null, p.value = null, null);
|
|
787
|
-
} finally {
|
|
788
|
-
v === m && (v = null), _.delete(f);
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
return Ie(i, t.direction, e.removedIds.value, !1);
|
|
1073
|
+
async function xe(e) {
|
|
1074
|
+
return b = async () => {
|
|
1075
|
+
await xe(e);
|
|
1076
|
+
}, q.reloadBoundaryBucket(e);
|
|
792
1077
|
}
|
|
793
|
-
function
|
|
794
|
-
|
|
795
|
-
cursor: e.cursor,
|
|
796
|
-
nextCursor: e.nextCursor,
|
|
797
|
-
nextCursorExhausted: e.nextCursorExhausted ?? !1,
|
|
798
|
-
nextItems: e.nextItems,
|
|
799
|
-
previousCursor: e.previousCursor,
|
|
800
|
-
previousItems: e.previousItems,
|
|
801
|
-
sequence: C
|
|
802
|
-
});
|
|
803
|
-
return C = t.nextSequence, t.bucket;
|
|
1078
|
+
function Se(e) {
|
|
1079
|
+
return q.collectBuckets(e);
|
|
804
1080
|
}
|
|
805
|
-
function
|
|
806
|
-
c.value = "idle",
|
|
1081
|
+
function $() {
|
|
1082
|
+
c.value = "idle", Ce(), d.clear(), K.schedule();
|
|
807
1083
|
}
|
|
808
|
-
function
|
|
1084
|
+
function Ce() {
|
|
1085
|
+
l.value = null, u.value = null, p.value = null;
|
|
1086
|
+
}
|
|
1087
|
+
function Ee() {
|
|
809
1088
|
if (!e.initialState || !e.initialState.items.length) return !1;
|
|
810
1089
|
let t = Le({
|
|
811
1090
|
initialState: e.initialState,
|
|
812
1091
|
removedIds: e.removedIds.value,
|
|
813
|
-
sequence:
|
|
1092
|
+
sequence: w
|
|
814
1093
|
});
|
|
815
|
-
return n.value = t.buckets, r.value = t.activeIndex,
|
|
1094
|
+
return n.value = t.buckets, r.value = t.activeIndex, w = t.nextSequence, o.value = !1, s.value = null, a.value = [], m.value = !1, !0;
|
|
816
1095
|
}
|
|
817
|
-
function
|
|
1096
|
+
function De() {
|
|
818
1097
|
return c.value === "initializing";
|
|
819
1098
|
}
|
|
820
|
-
function
|
|
821
|
-
return Be(t === "leading" ?
|
|
1099
|
+
function ke(t) {
|
|
1100
|
+
return Be(t === "leading" ? I.value : R.value, e.removedIds.value, A.value);
|
|
822
1101
|
}
|
|
823
|
-
function
|
|
824
|
-
n.value =
|
|
1102
|
+
function Ae() {
|
|
1103
|
+
n.value = Je(n.value, e.removedIds.value);
|
|
825
1104
|
}
|
|
826
1105
|
return {
|
|
827
|
-
activeIndex:
|
|
828
|
-
canRetryInitialLoad:
|
|
829
|
-
cancel:
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
1106
|
+
activeIndex: P,
|
|
1107
|
+
canRetryInitialLoad: ne,
|
|
1108
|
+
cancel: X,
|
|
1109
|
+
cancelFill: de,
|
|
1110
|
+
canRefreshTrailingBoundary: H,
|
|
1111
|
+
commitPendingAppend: oe,
|
|
1112
|
+
currentCursor: W,
|
|
833
1113
|
errorMessage: s,
|
|
834
1114
|
fillCollectedCount: l,
|
|
835
1115
|
fillCursor: u,
|
|
836
1116
|
fillDelayRemainingMs: f,
|
|
837
1117
|
fillTargetCount: p,
|
|
838
|
-
|
|
839
|
-
|
|
1118
|
+
...M.refs,
|
|
1119
|
+
fillUntil: G.fillUntil,
|
|
1120
|
+
fillUntilEnd: G.fillUntilEnd,
|
|
1121
|
+
hasNextPage: te,
|
|
1122
|
+
hasPreviousPage: B,
|
|
840
1123
|
isAutoPrefetchEnabled: h,
|
|
841
|
-
isPageLoadingLocked:
|
|
842
|
-
items:
|
|
843
|
-
lockPageLoading:
|
|
844
|
-
loading:
|
|
845
|
-
maybePrefetchAround:
|
|
846
|
-
nextCursor:
|
|
847
|
-
pendingAppendItems:
|
|
1124
|
+
isPageLoadingLocked: V,
|
|
1125
|
+
items: N,
|
|
1126
|
+
lockPageLoading: le,
|
|
1127
|
+
loading: F,
|
|
1128
|
+
maybePrefetchAround: ge,
|
|
1129
|
+
nextCursor: z,
|
|
1130
|
+
pendingAppendItems: U,
|
|
848
1131
|
phase: c,
|
|
849
|
-
prefetchNextPage:
|
|
850
|
-
prefetchPreviousPage:
|
|
851
|
-
previousCursor:
|
|
852
|
-
retryInitialLoad:
|
|
853
|
-
retry:
|
|
854
|
-
setActiveIndex:
|
|
855
|
-
setAutoPrefetchEnabled:
|
|
856
|
-
syncActiveIndexAfterVisibilityChange:
|
|
857
|
-
unlockPageLoading:
|
|
858
|
-
getActiveOccurrenceKey:
|
|
859
|
-
maybeCommitPendingAppendWhenFilteredOut:
|
|
1132
|
+
prefetchNextPage: Y,
|
|
1133
|
+
prefetchPreviousPage: re,
|
|
1134
|
+
previousCursor: ee,
|
|
1135
|
+
retryInitialLoad: ie,
|
|
1136
|
+
retry: ae,
|
|
1137
|
+
setActiveIndex: se,
|
|
1138
|
+
setAutoPrefetchEnabled: ce,
|
|
1139
|
+
syncActiveIndexAfterVisibilityChange: me,
|
|
1140
|
+
unlockPageLoading: ue,
|
|
1141
|
+
getActiveOccurrenceKey: pe,
|
|
1142
|
+
maybeCommitPendingAppendWhenFilteredOut: he
|
|
860
1143
|
};
|
|
861
1144
|
}
|
|
862
1145
|
//#endregion
|
|
863
1146
|
//#region src/components/viewer-core/useDataSource.ts
|
|
864
|
-
function
|
|
865
|
-
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } =
|
|
1147
|
+
function lt(e, t) {
|
|
1148
|
+
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = $(), l = ct({
|
|
866
1149
|
emit: t,
|
|
867
1150
|
fillDelayMs: e.fillDelayMs,
|
|
868
1151
|
fillDelayStepMs: e.fillDelayStepMs,
|
|
@@ -871,63 +1154,75 @@ function tt(e, t) {
|
|
|
871
1154
|
pageSize: e.pageSize,
|
|
872
1155
|
removedIds: o,
|
|
873
1156
|
resolve: e.resolve
|
|
874
|
-
}), 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),
|
|
875
|
-
function
|
|
1157
|
+
}), 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), v = i(() => !l.hasNextPage.value && l.canRefreshTrailingBoundary.value);
|
|
1158
|
+
function y(e) {
|
|
876
1159
|
let t = u.value;
|
|
877
|
-
t.length && l.setActiveIndex(
|
|
1160
|
+
t.length && l.setActiveIndex(D(e, 0, t.length - 1));
|
|
878
1161
|
}
|
|
879
|
-
function
|
|
1162
|
+
function b(e) {
|
|
880
1163
|
let t = l.getActiveOccurrenceKey(), n = u.value[d.value] ?? null, r = Array.isArray(e) ? e : [e], i = !!(n && r.includes(n.id) && l.isAutoPrefetchEnabled.value && d.value >= u.value.length - 3), o = !!(n && r.includes(n.id) && l.hasNextPage.value && d.value === u.value.length - 1), s = a(e);
|
|
881
|
-
return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }),
|
|
1164
|
+
return s.ids.length ? (l.maybeCommitPendingAppendWhenFilteredOut(), l.syncActiveIndexAfterVisibilityChange(t, { preserveTrailingPlaceholder: o }), i && x(), s) : s;
|
|
882
1165
|
}
|
|
883
|
-
function
|
|
1166
|
+
function x() {
|
|
1167
|
+
_().then(() => l.maybePrefetchAround());
|
|
1168
|
+
}
|
|
1169
|
+
function S(e) {
|
|
884
1170
|
let t = l.getActiveOccurrenceKey(), n = s(e);
|
|
885
1171
|
return n.ids.length && l.syncActiveIndexAfterVisibilityChange(t), n;
|
|
886
1172
|
}
|
|
887
|
-
function
|
|
1173
|
+
function C() {
|
|
888
1174
|
let e = l.getActiveOccurrenceKey(), t = c();
|
|
889
1175
|
return t?.ids.length && l.syncActiveIndexAfterVisibilityChange(e), t;
|
|
890
1176
|
}
|
|
891
|
-
function
|
|
1177
|
+
function w() {
|
|
892
1178
|
let e = l.getActiveOccurrenceKey();
|
|
893
1179
|
n(), l.syncActiveIndexAfterVisibilityChange(e);
|
|
894
1180
|
}
|
|
895
|
-
function
|
|
1181
|
+
function T() {
|
|
896
1182
|
return [...u.value];
|
|
897
1183
|
}
|
|
898
|
-
function
|
|
899
|
-
return u.value.find((t) =>
|
|
1184
|
+
function E(e) {
|
|
1185
|
+
return u.value.find((t) => Q(t) === e) ?? null;
|
|
900
1186
|
}
|
|
901
|
-
function
|
|
1187
|
+
function D(e, t, n) {
|
|
902
1188
|
return Math.min(Math.max(e, t), n);
|
|
903
1189
|
}
|
|
904
|
-
function
|
|
1190
|
+
function O() {
|
|
905
1191
|
l.cancel();
|
|
906
1192
|
}
|
|
907
|
-
async function
|
|
1193
|
+
async function k() {
|
|
908
1194
|
await l.prefetchNextPage();
|
|
909
1195
|
}
|
|
910
|
-
async function
|
|
1196
|
+
async function A() {
|
|
911
1197
|
await l.prefetchPreviousPage();
|
|
912
1198
|
}
|
|
913
|
-
async function
|
|
1199
|
+
async function j() {
|
|
914
1200
|
await l.retry();
|
|
915
1201
|
}
|
|
916
1202
|
return {
|
|
917
1203
|
activeIndex: d,
|
|
918
|
-
canRefreshExhaustedNextPage:
|
|
1204
|
+
canRefreshExhaustedNextPage: v,
|
|
919
1205
|
canRetryInitialLoad: l.canRetryInitialLoad,
|
|
920
|
-
cancel:
|
|
921
|
-
|
|
1206
|
+
cancel: O,
|
|
1207
|
+
cancelFill: l.cancelFill,
|
|
1208
|
+
clearRemoved: w,
|
|
922
1209
|
commitPendingAppend: l.commitPendingAppend,
|
|
923
1210
|
currentCursor: l.currentCursor,
|
|
924
1211
|
errorMessage: l.errorMessage,
|
|
925
1212
|
fillCollectedCount: l.fillCollectedCount,
|
|
1213
|
+
fillCompletedCalls: l.fillCompletedCalls,
|
|
926
1214
|
fillCursor: l.fillCursor,
|
|
927
1215
|
fillDelayRemainingMs: l.fillDelayRemainingMs,
|
|
1216
|
+
fillLoadedCount: l.fillLoadedCount,
|
|
1217
|
+
fillMode: l.fillMode,
|
|
1218
|
+
fillProgress: l.fillProgress,
|
|
1219
|
+
fillTargetCalls: l.fillTargetCalls,
|
|
928
1220
|
fillTargetCount: l.fillTargetCount,
|
|
929
|
-
|
|
930
|
-
|
|
1221
|
+
fillTotalCount: l.fillTotalCount,
|
|
1222
|
+
fillUntil: l.fillUntil,
|
|
1223
|
+
fillUntilEnd: l.fillUntilEnd,
|
|
1224
|
+
getItemByOccurrenceKey: E,
|
|
1225
|
+
getItems: T,
|
|
931
1226
|
getRemovedIds: r,
|
|
932
1227
|
hasNextPage: p,
|
|
933
1228
|
hasPreviousPage: m,
|
|
@@ -935,8 +1230,8 @@ function tt(e, t) {
|
|
|
935
1230
|
items: u,
|
|
936
1231
|
lockPageLoading: l.lockPageLoading,
|
|
937
1232
|
loading: f,
|
|
938
|
-
loadNext:
|
|
939
|
-
loadPrevious:
|
|
1233
|
+
loadNext: k,
|
|
1234
|
+
loadPrevious: A,
|
|
940
1235
|
nextCursor: l.nextCursor,
|
|
941
1236
|
paginationDetail: g,
|
|
942
1237
|
pendingAppendItems: l.pendingAppendItems,
|
|
@@ -945,21 +1240,21 @@ function tt(e, t) {
|
|
|
945
1240
|
prefetchPreviousPage: l.prefetchPreviousPage,
|
|
946
1241
|
previousCursor: l.previousCursor,
|
|
947
1242
|
removedCount: h,
|
|
948
|
-
remove:
|
|
949
|
-
restore:
|
|
950
|
-
retry:
|
|
1243
|
+
remove: b,
|
|
1244
|
+
restore: S,
|
|
1245
|
+
retry: j,
|
|
951
1246
|
retryInitialLoad: l.retryInitialLoad,
|
|
952
|
-
setActiveIndex:
|
|
1247
|
+
setActiveIndex: y,
|
|
953
1248
|
setAutoPrefetchEnabled: l.setAutoPrefetchEnabled,
|
|
954
|
-
undo:
|
|
1249
|
+
undo: C,
|
|
955
1250
|
unlockPageLoading: l.unlockPageLoading
|
|
956
1251
|
};
|
|
957
1252
|
}
|
|
958
1253
|
//#endregion
|
|
959
1254
|
//#region src/components/viewer-core/useController.ts
|
|
960
|
-
var
|
|
961
|
-
function
|
|
962
|
-
let n =
|
|
1255
|
+
var ut = 1024;
|
|
1256
|
+
function dt(e, t) {
|
|
1257
|
+
let n = lt(e, t), r = T({
|
|
963
1258
|
nextBoundaryLoadProgress: 0,
|
|
964
1259
|
previousBoundaryLoadProgress: 0
|
|
965
1260
|
}), a = D(0), o = D("list"), s = T({
|
|
@@ -967,9 +1262,15 @@ function rt(e, t) {
|
|
|
967
1262
|
currentCursor: null,
|
|
968
1263
|
errorMessage: null,
|
|
969
1264
|
fillCollectedCount: null,
|
|
1265
|
+
fillCompletedCalls: 0,
|
|
970
1266
|
fillCursor: null,
|
|
971
1267
|
fillDelayRemainingMs: null,
|
|
1268
|
+
fillLoadedCount: 0,
|
|
1269
|
+
fillMode: "idle",
|
|
1270
|
+
fillProgress: null,
|
|
1271
|
+
fillTargetCalls: null,
|
|
972
1272
|
fillTargetCount: null,
|
|
1273
|
+
fillTotalCount: null,
|
|
973
1274
|
hasNextPage: !1,
|
|
974
1275
|
hasPreviousPage: !1,
|
|
975
1276
|
itemCount: 0,
|
|
@@ -983,7 +1284,7 @@ function rt(e, t) {
|
|
|
983
1284
|
removedCount: 0,
|
|
984
1285
|
removedIds: [],
|
|
985
1286
|
surfaceMode: "list"
|
|
986
|
-
}), c = i(() => a.value >=
|
|
1287
|
+
}), c = i(() => a.value >= ut), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
|
|
987
1288
|
L(c, (e) => {
|
|
988
1289
|
e && h();
|
|
989
1290
|
}), L(() => e.surfaceMode, () => {
|
|
@@ -1000,7 +1301,7 @@ function rt(e, t) {
|
|
|
1000
1301
|
}), L(l, (e) => {
|
|
1001
1302
|
n.setAutoPrefetchEnabled(e === "fullscreen");
|
|
1002
1303
|
}, { immediate: !0 }), R(() => {
|
|
1003
|
-
s.activeIndex = n.activeIndex.value, s.currentCursor = n.currentCursor.value, s.errorMessage = n.errorMessage.value, s.fillCollectedCount = n.fillCollectedCount.value, s.fillCursor = n.fillCursor.value, s.fillDelayRemainingMs = n.fillDelayRemainingMs.value, s.fillTargetCount = n.fillTargetCount.value, s.hasNextPage = n.hasNextPage.value, s.hasPreviousPage = n.hasPreviousPage.value, s.itemCount = n.items.value.length, s.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", s.nextBoundaryLoadProgress = r.nextBoundaryLoadProgress, s.nextCursor = n.nextCursor.value, s.pageLoadingLocked = n.isPageLoadingLocked.value, s.phase = n.phase.value, s.previousBoundaryLoadProgress = r.previousBoundaryLoadProgress, s.previousCursor = n.previousCursor.value, s.removedCount = n.removedCount.value, s.removedIds = n.getRemovedIds(), s.surfaceMode = l.value;
|
|
1304
|
+
s.activeIndex = n.activeIndex.value, s.currentCursor = n.currentCursor.value, s.errorMessage = n.errorMessage.value, s.fillCollectedCount = n.fillCollectedCount.value, s.fillCompletedCalls = n.fillCompletedCalls.value, s.fillCursor = n.fillCursor.value, s.fillDelayRemainingMs = n.fillDelayRemainingMs.value, s.fillLoadedCount = n.fillLoadedCount.value, s.fillMode = n.fillMode.value, s.fillProgress = n.fillProgress.value, s.fillTargetCalls = n.fillTargetCalls.value, s.fillTargetCount = n.fillTargetCount.value, s.fillTotalCount = n.fillTotalCount.value, s.hasNextPage = n.hasNextPage.value, s.hasPreviousPage = n.hasPreviousPage.value, s.itemCount = n.items.value.length, s.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", s.nextBoundaryLoadProgress = r.nextBoundaryLoadProgress, s.nextCursor = n.nextCursor.value, s.pageLoadingLocked = n.isPageLoadingLocked.value, s.phase = n.phase.value, s.previousBoundaryLoadProgress = r.previousBoundaryLoadProgress, s.previousCursor = n.previousCursor.value, s.removedCount = n.removedCount.value, s.removedIds = n.getRemovedIds(), s.surfaceMode = l.value;
|
|
1004
1305
|
}), S(() => {
|
|
1005
1306
|
m(), h(), window.addEventListener("keydown", p), window.addEventListener("resize", m);
|
|
1006
1307
|
}), x(() => {
|
|
@@ -1013,7 +1314,7 @@ function rt(e, t) {
|
|
|
1013
1314
|
!c.value || o.value === "list" || (o.value = "list", t("update:surfaceMode", "list"));
|
|
1014
1315
|
}
|
|
1015
1316
|
function p(e) {
|
|
1016
|
-
e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" ||
|
|
1317
|
+
e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" || he(e.target) || (e.preventDefault(), f());
|
|
1017
1318
|
}
|
|
1018
1319
|
function m() {
|
|
1019
1320
|
a.value = window.innerWidth || 0;
|
|
@@ -1022,7 +1323,7 @@ function rt(e, t) {
|
|
|
1022
1323
|
!c.value || !e.surfaceMode || e.surfaceMode === o.value || (o.value = e.surfaceMode);
|
|
1023
1324
|
}
|
|
1024
1325
|
function g(e) {
|
|
1025
|
-
r.nextBoundaryLoadProgress =
|
|
1326
|
+
r.nextBoundaryLoadProgress = ft(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = ft(e.previousBoundaryLoadProgress);
|
|
1026
1327
|
}
|
|
1027
1328
|
return {
|
|
1028
1329
|
...n,
|
|
@@ -1041,26 +1342,26 @@ function rt(e, t) {
|
|
|
1041
1342
|
unlockPageLoading: n.unlockPageLoading
|
|
1042
1343
|
};
|
|
1043
1344
|
}
|
|
1044
|
-
function
|
|
1345
|
+
function ft(e) {
|
|
1045
1346
|
return Math.min(Math.max(e, 0), 1);
|
|
1046
1347
|
}
|
|
1047
1348
|
//#endregion
|
|
1048
1349
|
//#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
|
|
1049
|
-
var
|
|
1350
|
+
var pt = {
|
|
1050
1351
|
"data-testid": "vibe-media-bar",
|
|
1051
1352
|
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]"
|
|
1052
|
-
},
|
|
1353
|
+
}, mt = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, ht = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, gt = { class: "relative h-4 w-full" }, _t = [
|
|
1053
1354
|
"max",
|
|
1054
1355
|
"value",
|
|
1055
1356
|
"disabled"
|
|
1056
|
-
],
|
|
1357
|
+
], vt = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, yt = ["data-layout"], bt = {
|
|
1057
1358
|
key: 0,
|
|
1058
1359
|
"data-testid": "vibe-media-volume-popover",
|
|
1059
1360
|
class: "absolute bottom-[calc(100%+0.8rem)] right-0 grid justify-items-center gap-3 border border-white/12 bg-black/82 px-3 py-4 shadow-[0_20px_50px_-20px_rgba(0,0,0,0.85)] backdrop-blur-[18px]"
|
|
1060
|
-
},
|
|
1361
|
+
}, xt = { class: "relative flex h-28 w-4 items-center justify-center" }, St = ["value"], Ct = { class: "flex items-center gap-3" }, wt = ["aria-label"], Tt = {
|
|
1061
1362
|
key: 0,
|
|
1062
1363
|
class: "relative h-4 w-24"
|
|
1063
|
-
},
|
|
1364
|
+
}, Et = ["value"], Dt = /* @__PURE__ */ d({
|
|
1064
1365
|
__name: "FullscreenMediaBar",
|
|
1065
1366
|
props: {
|
|
1066
1367
|
currentTime: {},
|
|
@@ -1103,9 +1404,9 @@ var at = {
|
|
|
1103
1404
|
function C(e, t, n) {
|
|
1104
1405
|
return Math.min(Math.max(e, t), n);
|
|
1105
1406
|
}
|
|
1106
|
-
return (e, t) => (w(), s("div",
|
|
1107
|
-
c("span",
|
|
1108
|
-
c("div",
|
|
1407
|
+
return (e, t) => (w(), s("div", pt, [c("div", mt, [
|
|
1408
|
+
c("span", ht, j(n.currentTimeLabel), 1),
|
|
1409
|
+
c("div", gt, [
|
|
1109
1410
|
t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1110
1411
|
c("div", {
|
|
1111
1412
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -1122,16 +1423,16 @@ var at = {
|
|
|
1122
1423
|
disabled: n.duration <= 0,
|
|
1123
1424
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
|
|
1124
1425
|
onInput: t[0] ||= (e) => r("seek-input", e)
|
|
1125
|
-
}, null, 40,
|
|
1426
|
+
}, null, 40, _t)
|
|
1126
1427
|
]),
|
|
1127
|
-
c("span",
|
|
1428
|
+
c("span", vt, j(n.durationLabel), 1),
|
|
1128
1429
|
c("div", {
|
|
1129
1430
|
ref_key: "rootRef",
|
|
1130
1431
|
ref: l,
|
|
1131
1432
|
"data-testid": "vibe-media-volume",
|
|
1132
1433
|
"data-layout": n.volumeControlLayout,
|
|
1133
1434
|
class: "relative flex items-center justify-end"
|
|
1134
|
-
}, [d.value && u.value ? (w(), s("div",
|
|
1435
|
+
}, [d.value && u.value ? (w(), s("div", bt, [c("div", xt, [
|
|
1135
1436
|
t[4] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
|
|
1136
1437
|
c("div", {
|
|
1137
1438
|
class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
|
|
@@ -1148,8 +1449,8 @@ var at = {
|
|
|
1148
1449
|
value: f.value,
|
|
1149
1450
|
class: "vibe-media-slider absolute left-1/2 top-1/2 h-4 w-28 -translate-x-1/2 -translate-y-1/2 -rotate-90 bg-transparent",
|
|
1150
1451
|
onInput: t[1] ||= (e) => r("volume-input", e)
|
|
1151
|
-
}, null, 40,
|
|
1152
|
-
])])) : o("", !0), c("div",
|
|
1452
|
+
}, null, 40, St)
|
|
1453
|
+
])])) : o("", !0), c("div", Ct, [c("button", {
|
|
1153
1454
|
type: "button",
|
|
1154
1455
|
"data-testid": "vibe-media-volume-button",
|
|
1155
1456
|
"aria-label": g.value,
|
|
@@ -1158,7 +1459,7 @@ var at = {
|
|
|
1158
1459
|
}, [(w(), a(A(m.value), {
|
|
1159
1460
|
class: "h-4 w-4 stroke-[1.9]",
|
|
1160
1461
|
"aria-hidden": "true"
|
|
1161
|
-
}))], 8,
|
|
1462
|
+
}))], 8, wt), n.volumeControlLayout === "horizontal" ? (w(), s("div", Tt, [
|
|
1162
1463
|
t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1163
1464
|
c("div", {
|
|
1164
1465
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -1175,24 +1476,24 @@ var at = {
|
|
|
1175
1476
|
value: f.value,
|
|
1176
1477
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
|
|
1177
1478
|
onInput: t[2] ||= (e) => r("volume-input", e)
|
|
1178
|
-
}, null, 40,
|
|
1179
|
-
])) : o("", !0)])], 8,
|
|
1479
|
+
}, null, 40, Et)
|
|
1480
|
+
])) : o("", !0)])], 8, yt)
|
|
1180
1481
|
])]));
|
|
1181
1482
|
}
|
|
1182
|
-
}),
|
|
1483
|
+
}), Ot = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, kt = { class: "grid gap-4" }, At = { class: "flex min-h-11 items-center justify-between gap-4" }, jt = { class: "min-w-0 flex flex-1 items-center gap-3" }, Mt = {
|
|
1183
1484
|
key: 1,
|
|
1184
1485
|
"data-testid": "vibe-title",
|
|
1185
1486
|
class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
|
|
1186
|
-
},
|
|
1487
|
+
}, Nt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, Pt = {
|
|
1187
1488
|
"data-testid": "vibe-pagination",
|
|
1188
1489
|
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]"
|
|
1189
|
-
},
|
|
1490
|
+
}, Ft = { class: "whitespace-nowrap" }, It = {
|
|
1190
1491
|
key: 1,
|
|
1191
1492
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
1192
|
-
},
|
|
1493
|
+
}, Lt = {
|
|
1193
1494
|
key: 0,
|
|
1194
1495
|
class: "grid gap-2 max-[720px]:justify-items-start"
|
|
1195
|
-
},
|
|
1496
|
+
}, Rt = /* @__PURE__ */ d({
|
|
1196
1497
|
__name: "FullscreenHeader",
|
|
1197
1498
|
props: {
|
|
1198
1499
|
currentIndex: {},
|
|
@@ -1206,47 +1507,47 @@ var at = {
|
|
|
1206
1507
|
emits: ["back-to-list"],
|
|
1207
1508
|
setup(e, { emit: t }) {
|
|
1208
1509
|
let n = e, r = t;
|
|
1209
|
-
return (e, t) => (w(), s("div",
|
|
1510
|
+
return (e, t) => (w(), s("div", Ot, [c("div", kt, [c("div", At, [c("div", jt, [n.showBackToList ? (w(), s("button", {
|
|
1210
1511
|
key: 0,
|
|
1211
1512
|
type: "button",
|
|
1212
1513
|
"data-testid": "vibe-back-to-list",
|
|
1213
1514
|
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",
|
|
1214
1515
|
"aria-label": "Back to list",
|
|
1215
1516
|
onClick: t[0] ||= (e) => r("back-to-list")
|
|
1216
|
-
}, [u(N(
|
|
1517
|
+
}, [u(N(J), {
|
|
1217
1518
|
class: "h-4 w-4 stroke-[2.2]",
|
|
1218
1519
|
"aria-hidden": "true"
|
|
1219
|
-
})])) : o("", !0), n.title ? (w(), s("h2",
|
|
1520
|
+
})])) : o("", !0), n.title ? (w(), s("h2", Mt, j(n.title), 1)) : o("", !0)]), c("div", Nt, [c("span", Pt, [
|
|
1220
1521
|
n.loading ? (w(), a(N(oe), {
|
|
1221
1522
|
key: 0,
|
|
1222
1523
|
"data-testid": "vibe-pagination-spinner",
|
|
1223
1524
|
class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
|
|
1224
1525
|
"aria-hidden": "true"
|
|
1225
1526
|
})) : o("", !0),
|
|
1226
|
-
c("span",
|
|
1227
|
-
n.paginationDetail ? (w(), s("span",
|
|
1228
|
-
]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div",
|
|
1527
|
+
c("span", Ft, j(n.currentIndex + 1) + " / " + j(n.total), 1),
|
|
1528
|
+
n.paginationDetail ? (w(), s("span", It, j(n.paginationDetail), 1)) : o("", !0)
|
|
1529
|
+
]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div", Lt, [...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)]));
|
|
1229
1530
|
}
|
|
1230
|
-
}),
|
|
1531
|
+
}), zt = {
|
|
1231
1532
|
image: ae,
|
|
1232
|
-
video:
|
|
1233
|
-
audio:
|
|
1533
|
+
video: re,
|
|
1534
|
+
audio: Y,
|
|
1234
1535
|
other: ie
|
|
1235
|
-
},
|
|
1536
|
+
}, Bt = {
|
|
1236
1537
|
image: "Image",
|
|
1237
1538
|
video: "Video",
|
|
1238
1539
|
audio: "Audio",
|
|
1239
1540
|
other: "File"
|
|
1240
1541
|
};
|
|
1241
|
-
function
|
|
1242
|
-
return
|
|
1542
|
+
function Vt(e) {
|
|
1543
|
+
return zt[e];
|
|
1243
1544
|
}
|
|
1244
|
-
function
|
|
1245
|
-
return
|
|
1545
|
+
function Ht(e) {
|
|
1546
|
+
return Bt[e];
|
|
1246
1547
|
}
|
|
1247
1548
|
//#endregion
|
|
1248
1549
|
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
1249
|
-
function
|
|
1550
|
+
function Ut() {
|
|
1250
1551
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = 0;
|
|
1251
1552
|
function r(r) {
|
|
1252
1553
|
let a = {
|
|
@@ -1269,7 +1570,7 @@ function Ft() {
|
|
|
1269
1570
|
function i() {
|
|
1270
1571
|
if (t.size === 0) return;
|
|
1271
1572
|
let n = [...t.values()].sort((e, t) => {
|
|
1272
|
-
let n =
|
|
1573
|
+
let n = Gt(e) - Gt(t);
|
|
1273
1574
|
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
1274
1575
|
});
|
|
1275
1576
|
for (let r of n) {
|
|
@@ -1283,8 +1584,8 @@ function Ft() {
|
|
|
1283
1584
|
}
|
|
1284
1585
|
return { request: r };
|
|
1285
1586
|
}
|
|
1286
|
-
var
|
|
1287
|
-
function
|
|
1587
|
+
var Wt = Ut();
|
|
1588
|
+
function Gt(e) {
|
|
1288
1589
|
try {
|
|
1289
1590
|
let t = e.getPriority();
|
|
1290
1591
|
return Number.isFinite(t) ? t : Infinity;
|
|
@@ -1294,19 +1595,19 @@ function Lt(e) {
|
|
|
1294
1595
|
}
|
|
1295
1596
|
//#endregion
|
|
1296
1597
|
//#region src/components/viewer-core/useFullscreenPreloadController.ts
|
|
1297
|
-
var
|
|
1598
|
+
var Kt = [
|
|
1298
1599
|
0,
|
|
1299
1600
|
1,
|
|
1300
1601
|
2,
|
|
1301
1602
|
3
|
|
1302
|
-
],
|
|
1603
|
+
], qt = {
|
|
1303
1604
|
0: 0,
|
|
1304
1605
|
1: 1,
|
|
1305
1606
|
2: 2,
|
|
1306
1607
|
3: 3
|
|
1307
1608
|
};
|
|
1308
|
-
function
|
|
1309
|
-
let t = D({}), n =
|
|
1609
|
+
function Jt(e) {
|
|
1610
|
+
let t = D({}), n = Ut(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
1310
1611
|
L([
|
|
1311
1612
|
e.active,
|
|
1312
1613
|
e.items,
|
|
@@ -1327,14 +1628,14 @@ function Bt(e) {
|
|
|
1327
1628
|
}
|
|
1328
1629
|
function l(e, t) {
|
|
1329
1630
|
if (t instanceof HTMLImageElement) {
|
|
1330
|
-
i.set(e, t),
|
|
1631
|
+
i.set(e, t), Xt(t) && d(e);
|
|
1331
1632
|
return;
|
|
1332
1633
|
}
|
|
1333
1634
|
i.delete(e);
|
|
1334
1635
|
}
|
|
1335
1636
|
function u(e, t) {
|
|
1336
1637
|
if (t instanceof HTMLMediaElement) {
|
|
1337
|
-
a.set(e, t),
|
|
1638
|
+
a.set(e, t), Zt(t) && d(e);
|
|
1338
1639
|
return;
|
|
1339
1640
|
}
|
|
1340
1641
|
a.delete(e);
|
|
@@ -1375,7 +1676,7 @@ function Bt(e) {
|
|
|
1375
1676
|
assetType: s.item.type === "image" ? "image" : "video",
|
|
1376
1677
|
getPriority: () => g(o.index),
|
|
1377
1678
|
onGrant: () => {
|
|
1378
|
-
y(s.key, !0), (e.isAssetReady(s.key, s.item) ||
|
|
1679
|
+
y(s.key, !0), (e.isAssetReady(s.key, s.item) || Yt(s.key, i, a)) && d(s.key);
|
|
1379
1680
|
},
|
|
1380
1681
|
url: s.item.url
|
|
1381
1682
|
})
|
|
@@ -1386,14 +1687,14 @@ function Bt(e) {
|
|
|
1386
1687
|
}
|
|
1387
1688
|
function h() {
|
|
1388
1689
|
let t = e.resolvedActiveIndex.value;
|
|
1389
|
-
return
|
|
1690
|
+
return Kt.map((e) => _(t + e)).filter((e) => !!e);
|
|
1390
1691
|
}
|
|
1391
1692
|
function g(t) {
|
|
1392
|
-
return e.active.value ?
|
|
1693
|
+
return e.active.value ? qt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1393
1694
|
}
|
|
1394
1695
|
function _(t) {
|
|
1395
1696
|
let n = e.items.value[t];
|
|
1396
|
-
return !n || !
|
|
1697
|
+
return !n || !Qt(n) ? null : {
|
|
1397
1698
|
index: t,
|
|
1398
1699
|
item: n,
|
|
1399
1700
|
key: e.getItemKey(n)
|
|
@@ -1442,26 +1743,26 @@ function Bt(e) {
|
|
|
1442
1743
|
shouldAttachSlideAsset: s
|
|
1443
1744
|
};
|
|
1444
1745
|
}
|
|
1445
|
-
function
|
|
1746
|
+
function Yt(e, t, n) {
|
|
1446
1747
|
let r = t.get(e);
|
|
1447
|
-
if (r) return
|
|
1748
|
+
if (r) return Xt(r);
|
|
1448
1749
|
let i = n.get(e);
|
|
1449
|
-
return i ?
|
|
1750
|
+
return i ? Zt(i) : !1;
|
|
1450
1751
|
}
|
|
1451
|
-
function
|
|
1752
|
+
function Xt(e) {
|
|
1452
1753
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1453
1754
|
}
|
|
1454
|
-
function
|
|
1755
|
+
function Zt(e) {
|
|
1455
1756
|
let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
1456
1757
|
return e.readyState >= t;
|
|
1457
1758
|
}
|
|
1458
|
-
function
|
|
1759
|
+
function Qt(e) {
|
|
1459
1760
|
return e.type === "image" || e.type === "video" || e.type === "audio";
|
|
1460
1761
|
}
|
|
1461
1762
|
//#endregion
|
|
1462
1763
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
1463
|
-
function
|
|
1464
|
-
let t =
|
|
1764
|
+
function $t(e) {
|
|
1765
|
+
let t = Jt({
|
|
1465
1766
|
active: e.active,
|
|
1466
1767
|
getItemKey: r,
|
|
1467
1768
|
isAssetReady: m,
|
|
@@ -1471,10 +1772,10 @@ function Gt(e) {
|
|
|
1471
1772
|
});
|
|
1472
1773
|
function n(e, t) {
|
|
1473
1774
|
let n = t.title?.trim();
|
|
1474
|
-
return n ? `${e} ${n}` : `${e} ${
|
|
1775
|
+
return n ? `${e} ${n}` : `${e} ${Ht(t.type).toLowerCase()}`;
|
|
1475
1776
|
}
|
|
1476
1777
|
function r(e) {
|
|
1477
|
-
return
|
|
1778
|
+
return Q(e);
|
|
1478
1779
|
}
|
|
1479
1780
|
function i(e) {
|
|
1480
1781
|
return t.shouldAttachSlideAsset(e);
|
|
@@ -1534,11 +1835,11 @@ function Gt(e) {
|
|
|
1534
1835
|
}
|
|
1535
1836
|
//#endregion
|
|
1536
1837
|
//#region src/components/viewer-core/slotContent.ts
|
|
1537
|
-
function
|
|
1838
|
+
function en(e) {
|
|
1538
1839
|
if (!Array.isArray(e)) return !1;
|
|
1539
1840
|
for (let t of e) {
|
|
1540
1841
|
if (Array.isArray(t)) {
|
|
1541
|
-
if (
|
|
1842
|
+
if (en(t)) return !0;
|
|
1542
1843
|
continue;
|
|
1543
1844
|
}
|
|
1544
1845
|
if (!h(t)) {
|
|
@@ -1549,20 +1850,20 @@ function Kt(e) {
|
|
|
1549
1850
|
if (t != null && t !== !1) return !0;
|
|
1550
1851
|
continue;
|
|
1551
1852
|
}
|
|
1552
|
-
if (!
|
|
1853
|
+
if (!tn(t)) return !0;
|
|
1553
1854
|
}
|
|
1554
1855
|
return !1;
|
|
1555
1856
|
}
|
|
1556
|
-
function
|
|
1557
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1857
|
+
function tn(r) {
|
|
1858
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !en(r.children) : !1;
|
|
1558
1859
|
}
|
|
1559
1860
|
//#endregion
|
|
1560
1861
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1561
|
-
var
|
|
1562
|
-
function
|
|
1862
|
+
var nn = "no items available";
|
|
1863
|
+
function rn(e) {
|
|
1563
1864
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1564
1865
|
loading: !!e.loading.value,
|
|
1565
|
-
message:
|
|
1866
|
+
message: nn,
|
|
1566
1867
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1567
1868
|
surface: e.surface,
|
|
1568
1869
|
total: e.itemCount.value
|
|
@@ -1570,23 +1871,23 @@ function Yt(e) {
|
|
|
1570
1871
|
return {
|
|
1571
1872
|
emptyStateProps: t,
|
|
1572
1873
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1573
|
-
showCustomEmptyState: i(() =>
|
|
1874
|
+
showCustomEmptyState: i(() => en(n.value)),
|
|
1574
1875
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1575
1876
|
};
|
|
1576
1877
|
}
|
|
1577
1878
|
//#endregion
|
|
1578
1879
|
//#region src/components/viewer-core/format.ts
|
|
1579
|
-
function
|
|
1880
|
+
function an(e) {
|
|
1580
1881
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1581
1882
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1582
1883
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1583
1884
|
}
|
|
1584
1885
|
//#endregion
|
|
1585
1886
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1586
|
-
function
|
|
1887
|
+
function on(e) {
|
|
1587
1888
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1588
1889
|
}
|
|
1589
|
-
function
|
|
1890
|
+
function sn(e) {
|
|
1590
1891
|
return e.phase === "failed" ? {
|
|
1591
1892
|
kind: "failed",
|
|
1592
1893
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1609,7 +1910,7 @@ function Qt(e) {
|
|
|
1609
1910
|
}
|
|
1610
1911
|
//#endregion
|
|
1611
1912
|
//#region src/components/viewer-core/useActivation.ts
|
|
1612
|
-
function
|
|
1913
|
+
function cn(e) {
|
|
1613
1914
|
let t = !1;
|
|
1614
1915
|
L(e.enabled, async (t) => {
|
|
1615
1916
|
if (n(t), t) {
|
|
@@ -1632,7 +1933,7 @@ function $t(e) {
|
|
|
1632
1933
|
}
|
|
1633
1934
|
//#endregion
|
|
1634
1935
|
//#region src/components/viewer-core/assetState.ts
|
|
1635
|
-
var
|
|
1936
|
+
var ln = {
|
|
1636
1937
|
currentTime: 0,
|
|
1637
1938
|
duration: 0,
|
|
1638
1939
|
errorKind: null,
|
|
@@ -1641,38 +1942,38 @@ var en = {
|
|
|
1641
1942
|
ready: !1,
|
|
1642
1943
|
volume: 1
|
|
1643
1944
|
};
|
|
1644
|
-
function
|
|
1645
|
-
return { ...
|
|
1945
|
+
function un() {
|
|
1946
|
+
return { ...ln };
|
|
1646
1947
|
}
|
|
1647
|
-
function
|
|
1948
|
+
function dn(e) {
|
|
1648
1949
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1649
1950
|
}
|
|
1650
|
-
function
|
|
1651
|
-
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready =
|
|
1951
|
+
function fn(e, t, n) {
|
|
1952
|
+
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = pn(t, n);
|
|
1652
1953
|
}
|
|
1653
|
-
function
|
|
1954
|
+
function pn(e, t) {
|
|
1654
1955
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1655
1956
|
}
|
|
1656
1957
|
//#endregion
|
|
1657
1958
|
//#region src/components/viewer-core/loadError.ts
|
|
1658
|
-
var
|
|
1659
|
-
function
|
|
1959
|
+
var mn = /* @__PURE__ */ new Map();
|
|
1960
|
+
function hn(e) {
|
|
1660
1961
|
return e === "not-found" ? "404" : "Load error";
|
|
1661
1962
|
}
|
|
1662
|
-
function
|
|
1963
|
+
function gn(e) {
|
|
1663
1964
|
return e === "generic";
|
|
1664
1965
|
}
|
|
1665
|
-
function
|
|
1666
|
-
return
|
|
1966
|
+
function _n(e) {
|
|
1967
|
+
return vn(e).then((e) => e ?? "generic");
|
|
1667
1968
|
}
|
|
1668
|
-
function
|
|
1669
|
-
let t =
|
|
1969
|
+
function vn(e) {
|
|
1970
|
+
let t = mn.get(e);
|
|
1670
1971
|
if (t) return t;
|
|
1671
|
-
let n =
|
|
1672
|
-
return
|
|
1972
|
+
let n = yn(e);
|
|
1973
|
+
return mn.set(e, n), n;
|
|
1673
1974
|
}
|
|
1674
|
-
async function
|
|
1675
|
-
if (!
|
|
1975
|
+
async function yn(e) {
|
|
1976
|
+
if (!bn(e)) return null;
|
|
1676
1977
|
try {
|
|
1677
1978
|
let t = await fetch(e, { method: "HEAD" });
|
|
1678
1979
|
return t.ok ? null : t.status === 404 ? "not-found" : "generic";
|
|
@@ -1680,12 +1981,12 @@ async function dn(e) {
|
|
|
1680
1981
|
return "generic";
|
|
1681
1982
|
}
|
|
1682
1983
|
}
|
|
1683
|
-
function
|
|
1984
|
+
function bn(e) {
|
|
1684
1985
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1685
1986
|
}
|
|
1686
1987
|
//#endregion
|
|
1687
1988
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1688
|
-
function
|
|
1989
|
+
function xn(e) {
|
|
1689
1990
|
try {
|
|
1690
1991
|
let t = e.play();
|
|
1691
1992
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1693,12 +1994,12 @@ function pn(e) {
|
|
|
1693
1994
|
}
|
|
1694
1995
|
//#endregion
|
|
1695
1996
|
//#region src/components/viewer-core/useMedia.ts
|
|
1696
|
-
function
|
|
1697
|
-
let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ?
|
|
1997
|
+
function Sn(e) {
|
|
1998
|
+
let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ? Q(e.activeItem.value) : null), d = i(() => e.activeMediaItem.value ? Q(e.activeMediaItem.value) : null), f = i(() => {
|
|
1698
1999
|
let t = /* @__PURE__ */ new Map();
|
|
1699
|
-
for (let n of e.items.value) t.set(
|
|
2000
|
+
for (let n of e.items.value) t.set(Q(n), n);
|
|
1700
2001
|
return t;
|
|
1701
|
-
}), p = i(() => d.value ? r.value[d.value] ??
|
|
2002
|
+
}), p = i(() => d.value ? r.value[d.value] ?? ln : ln), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : Cn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
|
|
1702
2003
|
L(() => u.value, async () => {
|
|
1703
2004
|
await C();
|
|
1704
2005
|
}), L(() => e.itemCount.value, async () => {
|
|
@@ -1721,7 +2022,7 @@ function mn(e) {
|
|
|
1721
2022
|
c.delete(e);
|
|
1722
2023
|
}
|
|
1723
2024
|
function b(e, r) {
|
|
1724
|
-
r instanceof HTMLImageElement &&
|
|
2025
|
+
r instanceof HTMLImageElement && dn(r) && (t.value[e] = !0, n.value[e] = null, Y(e, r.currentSrc || r.src || ie(e)));
|
|
1725
2026
|
}
|
|
1726
2027
|
function x() {
|
|
1727
2028
|
H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
@@ -1743,14 +2044,14 @@ function mn(e) {
|
|
|
1743
2044
|
V(i, n);
|
|
1744
2045
|
continue;
|
|
1745
2046
|
}
|
|
1746
|
-
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0,
|
|
2047
|
+
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, xn(i), W(n, i);
|
|
1747
2048
|
}
|
|
1748
2049
|
for (let [e, n] of c.entries()) {
|
|
1749
2050
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1750
2051
|
V(n, e);
|
|
1751
2052
|
continue;
|
|
1752
2053
|
}
|
|
1753
|
-
|
|
2054
|
+
xn(n), W(e, n);
|
|
1754
2055
|
}
|
|
1755
2056
|
}
|
|
1756
2057
|
function w(e, t) {
|
|
@@ -1759,16 +2060,16 @@ function mn(e) {
|
|
|
1759
2060
|
let i = r.value[e]?.ready ?? !1;
|
|
1760
2061
|
W(e, n, t.type);
|
|
1761
2062
|
let a = r.value[e]?.ready ?? !1;
|
|
1762
|
-
!i && a &&
|
|
2063
|
+
!i && a && Y(e, n.currentSrc || n.src || ie(e));
|
|
1763
2064
|
}
|
|
1764
2065
|
}
|
|
1765
2066
|
function T(e, r) {
|
|
1766
|
-
t.value[e] = !0, n.value[e] = null,
|
|
2067
|
+
t.value[e] = !0, n.value[e] = null, Y(e, r);
|
|
1767
2068
|
}
|
|
1768
2069
|
async function E(r, i) {
|
|
1769
|
-
let a =
|
|
2070
|
+
let a = re(r) ?? e.activeItem.value;
|
|
1770
2071
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1771
|
-
let o = await
|
|
2072
|
+
let o = await _n(i);
|
|
1772
2073
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1773
2074
|
item: a,
|
|
1774
2075
|
occurrenceKey: r,
|
|
@@ -1778,7 +2079,7 @@ function mn(e) {
|
|
|
1778
2079
|
});
|
|
1779
2080
|
}
|
|
1780
2081
|
async function O(t, n) {
|
|
1781
|
-
let r = K(t), i = U(t), a =
|
|
2082
|
+
let r = K(t), i = U(t), a = re(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1782
2083
|
if (r) {
|
|
1783
2084
|
r.pause();
|
|
1784
2085
|
try {
|
|
@@ -1786,7 +2087,7 @@ function mn(e) {
|
|
|
1786
2087
|
} catch {}
|
|
1787
2088
|
}
|
|
1788
2089
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1789
|
-
let o = await
|
|
2090
|
+
let o = await _n(n);
|
|
1790
2091
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1791
2092
|
item: a,
|
|
1792
2093
|
occurrenceKey: t,
|
|
@@ -1796,23 +2097,23 @@ function mn(e) {
|
|
|
1796
2097
|
});
|
|
1797
2098
|
}
|
|
1798
2099
|
function k(e, t, n) {
|
|
1799
|
-
e.button !== 0 || Date.now() < n ||
|
|
2100
|
+
e.button !== 0 || Date.now() < n || J(s.get(t) ?? null);
|
|
1800
2101
|
}
|
|
1801
2102
|
function A(e, t, n) {
|
|
1802
|
-
e.button !== 0 || Date.now() < n ||
|
|
2103
|
+
e.button !== 0 || Date.now() < n || J(K(t));
|
|
1803
2104
|
}
|
|
1804
2105
|
function j(e) {
|
|
1805
2106
|
let t = q(), n = d.value;
|
|
1806
2107
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1807
2108
|
let r = Number.parseFloat(e.target.value);
|
|
1808
2109
|
if (!Number.isFinite(r)) return;
|
|
1809
|
-
let i =
|
|
2110
|
+
let i = Cn(r, 0, m.value || 0);
|
|
1810
2111
|
ne(n, i, t), t.currentTime = i;
|
|
1811
2112
|
}
|
|
1812
2113
|
function M(e) {
|
|
1813
2114
|
let t = q(), n = d.value;
|
|
1814
2115
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1815
|
-
let r =
|
|
2116
|
+
let r = Cn(Number.parseFloat(e.target.value), 0, 1);
|
|
1816
2117
|
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
|
|
1817
2118
|
}
|
|
1818
2119
|
function N() {
|
|
@@ -1833,16 +2134,16 @@ function mn(e) {
|
|
|
1833
2134
|
}
|
|
1834
2135
|
function z(e) {
|
|
1835
2136
|
let t = R(e);
|
|
1836
|
-
return t ?
|
|
1837
|
-
}
|
|
1838
|
-
function B(e) {
|
|
1839
|
-
return cn(R(e));
|
|
2137
|
+
return t ? hn(t) : null;
|
|
1840
2138
|
}
|
|
1841
2139
|
function ee(e) {
|
|
2140
|
+
return gn(R(e));
|
|
2141
|
+
}
|
|
2142
|
+
function te(e) {
|
|
1842
2143
|
return `${e}:${a.value[e] ?? 0}`;
|
|
1843
2144
|
}
|
|
1844
|
-
async function
|
|
1845
|
-
if (!
|
|
2145
|
+
async function B(e) {
|
|
2146
|
+
if (!ee(e)) return;
|
|
1846
2147
|
t.value[e] = !1, n.value[e] = null;
|
|
1847
2148
|
let r = U(e);
|
|
1848
2149
|
r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
|
|
@@ -1863,17 +2164,17 @@ function mn(e) {
|
|
|
1863
2164
|
for (let [e, t] of c.entries()) V(t, e);
|
|
1864
2165
|
}
|
|
1865
2166
|
function U(e) {
|
|
1866
|
-
return r.value[e] || (r.value[e] =
|
|
2167
|
+
return r.value[e] || (r.value[e] = un()), r.value[e];
|
|
1867
2168
|
}
|
|
1868
2169
|
function W(e, t, n) {
|
|
1869
|
-
|
|
2170
|
+
fn(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1870
2171
|
}
|
|
1871
2172
|
function ne(e, t, n) {
|
|
1872
2173
|
let r = U(e);
|
|
1873
2174
|
r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.muted = n.muted, r.paused = n.paused, r.volume = Number.isFinite(n.volume) ? n.volume : r.volume;
|
|
1874
2175
|
}
|
|
1875
2176
|
function G(e) {
|
|
1876
|
-
return
|
|
2177
|
+
return Cn(o.value[e] ?? 1, 0, 1);
|
|
1877
2178
|
}
|
|
1878
2179
|
function K(e) {
|
|
1879
2180
|
return s.get(e) ?? c.get(e) ?? null;
|
|
@@ -1881,17 +2182,17 @@ function mn(e) {
|
|
|
1881
2182
|
function q() {
|
|
1882
2183
|
return d.value ? K(d.value) : null;
|
|
1883
2184
|
}
|
|
1884
|
-
function
|
|
2185
|
+
function J(e) {
|
|
1885
2186
|
if (e) {
|
|
1886
2187
|
if (e.paused) {
|
|
1887
|
-
|
|
2188
|
+
xn(e);
|
|
1888
2189
|
return;
|
|
1889
2190
|
}
|
|
1890
2191
|
e.pause();
|
|
1891
2192
|
}
|
|
1892
2193
|
}
|
|
1893
|
-
function
|
|
1894
|
-
let r =
|
|
2194
|
+
function Y(t, n) {
|
|
2195
|
+
let r = re(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1895
2196
|
if (!r || !n) return;
|
|
1896
2197
|
let i = `${t}|${n}`;
|
|
1897
2198
|
l.has(i) || (l.add(i), e.onAssetLoad?.({
|
|
@@ -1901,11 +2202,11 @@ function mn(e) {
|
|
|
1901
2202
|
url: n
|
|
1902
2203
|
}));
|
|
1903
2204
|
}
|
|
1904
|
-
function
|
|
2205
|
+
function re(e) {
|
|
1905
2206
|
return f.value.get(e) ?? null;
|
|
1906
2207
|
}
|
|
1907
2208
|
function ie(e) {
|
|
1908
|
-
return
|
|
2209
|
+
return re(e)?.url ?? null;
|
|
1909
2210
|
}
|
|
1910
2211
|
return {
|
|
1911
2212
|
activeAssetErrorKind: g,
|
|
@@ -1914,11 +2215,11 @@ function mn(e) {
|
|
|
1914
2215
|
activeMediaState: p,
|
|
1915
2216
|
getAssetErrorKind: R,
|
|
1916
2217
|
getAssetErrorLabel: z,
|
|
1917
|
-
getAssetRenderKey:
|
|
2218
|
+
getAssetRenderKey: te,
|
|
1918
2219
|
getImageSource: I,
|
|
1919
2220
|
isImageReady: P,
|
|
1920
2221
|
isMediaReady: F,
|
|
1921
|
-
canRetryAsset:
|
|
2222
|
+
canRetryAsset: ee,
|
|
1922
2223
|
mediaStates: r,
|
|
1923
2224
|
onAudioCoverClick: A,
|
|
1924
2225
|
onImageError: E,
|
|
@@ -1934,20 +2235,20 @@ function mn(e) {
|
|
|
1934
2235
|
registerVideoElement: v,
|
|
1935
2236
|
resetAssetState: S,
|
|
1936
2237
|
resetMediaState: x,
|
|
1937
|
-
retryAsset:
|
|
2238
|
+
retryAsset: B,
|
|
1938
2239
|
syncMediaPlayback: C
|
|
1939
2240
|
};
|
|
1940
2241
|
}
|
|
1941
|
-
function
|
|
2242
|
+
function Cn(e, t, n) {
|
|
1942
2243
|
return Math.min(Math.max(e, t), n);
|
|
1943
2244
|
}
|
|
1944
2245
|
//#endregion
|
|
1945
2246
|
//#region src/components/viewer-core/virtualization.ts
|
|
1946
|
-
var
|
|
2247
|
+
var wn = {
|
|
1947
2248
|
backward: 1,
|
|
1948
2249
|
forward: 3
|
|
1949
2250
|
};
|
|
1950
|
-
function
|
|
2251
|
+
function Tn(e, t, n = wn) {
|
|
1951
2252
|
return t <= 0 ? {
|
|
1952
2253
|
start: 0,
|
|
1953
2254
|
end: -1
|
|
@@ -1956,14 +2257,14 @@ function _n(e, t, n = gn) {
|
|
|
1956
2257
|
end: Math.min(t - 1, e + n.forward)
|
|
1957
2258
|
};
|
|
1958
2259
|
}
|
|
1959
|
-
function
|
|
1960
|
-
let r =
|
|
2260
|
+
function En(e, t, n = wn) {
|
|
2261
|
+
let r = Tn(t, e.length, n);
|
|
1961
2262
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1962
2263
|
item: e,
|
|
1963
2264
|
index: r.start + t
|
|
1964
2265
|
}));
|
|
1965
2266
|
}
|
|
1966
|
-
function
|
|
2267
|
+
function Dn(e, t, n, r, i) {
|
|
1967
2268
|
return {
|
|
1968
2269
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1969
2270
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1971,12 +2272,12 @@ function yn(e, t, n, r, i) {
|
|
|
1971
2272
|
}
|
|
1972
2273
|
//#endregion
|
|
1973
2274
|
//#region src/components/viewer-core/useViewer.ts
|
|
1974
|
-
function
|
|
1975
|
-
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() =>
|
|
2275
|
+
function On(e, t, n = {}) {
|
|
2276
|
+
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => on({
|
|
1976
2277
|
itemCount: r.value.length,
|
|
1977
2278
|
loading: s.value,
|
|
1978
2279
|
phase: e.phase
|
|
1979
|
-
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T =
|
|
2280
|
+
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = Sn({
|
|
1980
2281
|
items: r,
|
|
1981
2282
|
activeItem: C,
|
|
1982
2283
|
activeMediaItem: w,
|
|
@@ -1985,14 +2286,14 @@ function bn(e, t, n = {}) {
|
|
|
1985
2286
|
loopFullscreenVideo: l,
|
|
1986
2287
|
onAssetError: n.onAssetError,
|
|
1987
2288
|
onAssetLoad: n.onAssetLoad
|
|
1988
|
-
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() =>
|
|
2289
|
+
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => sn({
|
|
1989
2290
|
errorMessage: o.value,
|
|
1990
2291
|
hasItems: r.value.length > 0,
|
|
1991
2292
|
hasNextPage: c.value,
|
|
1992
2293
|
phase: d.value,
|
|
1993
2294
|
surface: "fullscreen"
|
|
1994
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
1995
|
-
|
|
2295
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => Tn(S.value, r.value.length)), N = i(() => En(r.value, S.value));
|
|
2296
|
+
cn({
|
|
1996
2297
|
enabled: _,
|
|
1997
2298
|
onDisable() {
|
|
1998
2299
|
H(), T.resetMediaState();
|
|
@@ -2022,15 +2323,15 @@ function bn(e, t, n = {}) {
|
|
|
2022
2323
|
return t && !I(-1) || n && !I(1) ? e * .24 : e;
|
|
2023
2324
|
}
|
|
2024
2325
|
function z(e) {
|
|
2025
|
-
!_.value || r.value.length === 0 || e.pointerType === "mouse" ||
|
|
2326
|
+
!_.value || r.value.length === 0 || e.pointerType === "mouse" || ge(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
|
|
2026
2327
|
}
|
|
2027
|
-
function
|
|
2328
|
+
function ee(e) {
|
|
2028
2329
|
!_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
|
|
2029
2330
|
}
|
|
2030
|
-
function
|
|
2331
|
+
function te(e) {
|
|
2031
2332
|
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), V());
|
|
2032
2333
|
}
|
|
2033
|
-
function
|
|
2334
|
+
function B(e) {
|
|
2034
2335
|
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), H());
|
|
2035
2336
|
}
|
|
2036
2337
|
function V() {
|
|
@@ -2040,13 +2341,13 @@ function bn(e, t, n = {}) {
|
|
|
2040
2341
|
m.value = 0, h.value = !1, v = null;
|
|
2041
2342
|
}
|
|
2042
2343
|
function U(e) {
|
|
2043
|
-
if (!_.value || r.value.length === 0 || h.value ||
|
|
2344
|
+
if (!_.value || r.value.length === 0 || h.value || ge(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
|
|
2044
2345
|
e.preventDefault();
|
|
2045
2346
|
let t = Date.now();
|
|
2046
2347
|
t < b || (b = t + 400, L(e.deltaY > 0 ? 1 : -1));
|
|
2047
2348
|
}
|
|
2048
2349
|
function W(e) {
|
|
2049
|
-
!_.value || r.value.length === 0 ||
|
|
2350
|
+
!_.value || r.value.length === 0 || he(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), L(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), L(-1)));
|
|
2050
2351
|
}
|
|
2051
2352
|
function ne(e, t) {
|
|
2052
2353
|
T.onVideoClick(e, t, x);
|
|
@@ -2060,17 +2361,17 @@ function bn(e, t, n = {}) {
|
|
|
2060
2361
|
function q(e) {
|
|
2061
2362
|
T.onMediaVolumeInput(e);
|
|
2062
2363
|
}
|
|
2063
|
-
function
|
|
2364
|
+
function J() {
|
|
2064
2365
|
T.onMediaVolumeToggle();
|
|
2065
2366
|
}
|
|
2066
|
-
function
|
|
2367
|
+
function Y(e) {
|
|
2067
2368
|
return e.type === "image" || e.type === "video";
|
|
2068
2369
|
}
|
|
2069
|
-
function
|
|
2370
|
+
function re(e) {
|
|
2070
2371
|
return e.type === "audio";
|
|
2071
2372
|
}
|
|
2072
2373
|
function ie(e) {
|
|
2073
|
-
return
|
|
2374
|
+
return Dn(e, S.value, g.value, m.value, h.value);
|
|
2074
2375
|
}
|
|
2075
2376
|
return {
|
|
2076
2377
|
activeItem: C,
|
|
@@ -2085,13 +2386,13 @@ function bn(e, t, n = {}) {
|
|
|
2085
2386
|
getAssetErrorKind: T.getAssetErrorKind,
|
|
2086
2387
|
getAssetErrorLabel: T.getAssetErrorLabel,
|
|
2087
2388
|
getAssetRenderKey: T.getAssetRenderKey,
|
|
2088
|
-
formatPlaybackTime:
|
|
2389
|
+
formatPlaybackTime: an,
|
|
2089
2390
|
getImageSource: T.getImageSource,
|
|
2090
2391
|
getSlideStyle: ie,
|
|
2091
2392
|
hasNextPage: c,
|
|
2092
2393
|
isAtEnd: E,
|
|
2093
|
-
isAudio:
|
|
2094
|
-
isVisual:
|
|
2394
|
+
isAudio: re,
|
|
2395
|
+
isVisual: Y,
|
|
2095
2396
|
items: r,
|
|
2096
2397
|
loading: s,
|
|
2097
2398
|
mediaStates: T.mediaStates,
|
|
@@ -2104,11 +2405,11 @@ function bn(e, t, n = {}) {
|
|
|
2104
2405
|
onMediaError: T.onMediaError,
|
|
2105
2406
|
onMediaSeekInput: K,
|
|
2106
2407
|
onMediaVolumeInput: q,
|
|
2107
|
-
onMediaVolumeToggle:
|
|
2108
|
-
onPointerCancel:
|
|
2408
|
+
onMediaVolumeToggle: J,
|
|
2409
|
+
onPointerCancel: B,
|
|
2109
2410
|
onPointerDown: z,
|
|
2110
|
-
onPointerMove:
|
|
2111
|
-
onPointerUp:
|
|
2411
|
+
onPointerMove: ee,
|
|
2412
|
+
onPointerUp: te,
|
|
2112
2413
|
onVideoClick: ne,
|
|
2113
2414
|
onWheel: U,
|
|
2114
2415
|
registerAudioElement: T.registerAudioElement,
|
|
@@ -2129,21 +2430,21 @@ function bn(e, t, n = {}) {
|
|
|
2129
2430
|
}
|
|
2130
2431
|
//#endregion
|
|
2131
2432
|
//#region src/components/viewer-core/theme.ts
|
|
2132
|
-
var
|
|
2433
|
+
var kn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", An = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", jn = {
|
|
2133
2434
|
image: !0,
|
|
2134
2435
|
video: !0,
|
|
2135
2436
|
audio: !0,
|
|
2136
2437
|
other: !0
|
|
2137
2438
|
};
|
|
2138
|
-
function
|
|
2139
|
-
return
|
|
2439
|
+
function Mn(e) {
|
|
2440
|
+
return jn[e], kn;
|
|
2140
2441
|
}
|
|
2141
|
-
function
|
|
2142
|
-
return
|
|
2442
|
+
function Nn(e) {
|
|
2443
|
+
return jn[e], An;
|
|
2143
2444
|
}
|
|
2144
2445
|
//#endregion
|
|
2145
2446
|
//#region src/components/viewer-core/useFullscreenAssetEvents.ts
|
|
2146
|
-
function
|
|
2447
|
+
function Pn(e) {
|
|
2147
2448
|
function t(t, n) {
|
|
2148
2449
|
return e.fullscreenMedia.shouldHandleSlideAssetEvent(t, n) ? e.fullscreenMedia.getItemKey(n) : null;
|
|
2149
2450
|
}
|
|
@@ -2176,7 +2477,7 @@ function En(e) {
|
|
|
2176
2477
|
}
|
|
2177
2478
|
//#endregion
|
|
2178
2479
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
2179
|
-
function
|
|
2480
|
+
function Fn(e) {
|
|
2180
2481
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
2181
2482
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
2182
2483
|
if (!n) return null;
|
|
@@ -2191,20 +2492,20 @@ function Dn(e) {
|
|
|
2191
2492
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
2192
2493
|
}
|
|
2193
2494
|
return r <= 0 ? null : {
|
|
2194
|
-
r:
|
|
2195
|
-
g:
|
|
2196
|
-
b:
|
|
2495
|
+
r: In(Math.round(i / r)),
|
|
2496
|
+
g: In(Math.round(a / r)),
|
|
2497
|
+
b: In(Math.round(o / r))
|
|
2197
2498
|
};
|
|
2198
2499
|
} catch {
|
|
2199
2500
|
return null;
|
|
2200
2501
|
}
|
|
2201
2502
|
}
|
|
2202
|
-
function
|
|
2503
|
+
function In(e) {
|
|
2203
2504
|
return Math.min(235, Math.max(26, e));
|
|
2204
2505
|
}
|
|
2205
2506
|
//#endregion
|
|
2206
2507
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
2207
|
-
function
|
|
2508
|
+
function Ln(e) {
|
|
2208
2509
|
let t = D({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
|
|
2209
2510
|
if (!r.value) return;
|
|
2210
2511
|
let { r: e, g: t, b: n } = r.value;
|
|
@@ -2219,7 +2520,7 @@ function kn(e) {
|
|
|
2219
2520
|
});
|
|
2220
2521
|
function s(n, r) {
|
|
2221
2522
|
if (!e.showDominantImageTone.value) return;
|
|
2222
|
-
let i =
|
|
2523
|
+
let i = Fn(r);
|
|
2223
2524
|
i && (t.value[n] = i);
|
|
2224
2525
|
}
|
|
2225
2526
|
return {
|
|
@@ -2230,7 +2531,7 @@ function kn(e) {
|
|
|
2230
2531
|
}
|
|
2231
2532
|
//#endregion
|
|
2232
2533
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
2233
|
-
var
|
|
2534
|
+
var Rn = ["data-surface"], zn = ["data-surface"], Bn = /* @__PURE__ */ d({
|
|
2234
2535
|
inheritAttrs: !1,
|
|
2235
2536
|
__name: "SurfaceEmptyState",
|
|
2236
2537
|
props: {
|
|
@@ -2244,31 +2545,31 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2244
2545
|
"data-testid": "vibe-empty-state-inline",
|
|
2245
2546
|
"data-surface": e.surface,
|
|
2246
2547
|
class: ["pointer-events-none absolute z-[4] text-center", e.surface === "grid" ? "inset-x-0 top-[clamp(6rem,22vh,11rem)] flex justify-center px-6" : "inset-0 grid place-items-center px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)]"]
|
|
2247
|
-
}), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16,
|
|
2548
|
+
}), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, Rn)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
|
|
2248
2549
|
"data-testid": "vibe-empty-state-badge",
|
|
2249
2550
|
"data-surface": e.surface,
|
|
2250
2551
|
class: v(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
|
|
2251
|
-
}, j(e.message), 11,
|
|
2552
|
+
}, j(e.message), 11, zn)])], 16));
|
|
2252
2553
|
}
|
|
2253
|
-
}),
|
|
2554
|
+
}), Vn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Hn = {
|
|
2254
2555
|
key: 0,
|
|
2255
2556
|
class: "relative h-full min-h-0"
|
|
2256
|
-
},
|
|
2557
|
+
}, Un = [
|
|
2257
2558
|
"data-item-id",
|
|
2258
2559
|
"data-occurrence-key",
|
|
2259
2560
|
"data-index",
|
|
2260
2561
|
"data-active",
|
|
2261
2562
|
"aria-hidden"
|
|
2262
|
-
],
|
|
2563
|
+
], Wn = {
|
|
2263
2564
|
key: 0,
|
|
2264
2565
|
"data-testid": "vibe-asset-spinner",
|
|
2265
2566
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
2266
|
-
},
|
|
2567
|
+
}, Gn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Kn = ["data-kind"], qn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Jn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Yn = ["onClick"], Xn = [
|
|
2267
2568
|
"src",
|
|
2268
2569
|
"alt",
|
|
2269
2570
|
"onLoad",
|
|
2270
2571
|
"onError"
|
|
2271
|
-
],
|
|
2572
|
+
], Zn = [
|
|
2272
2573
|
"loop",
|
|
2273
2574
|
"src",
|
|
2274
2575
|
"preload",
|
|
@@ -2287,15 +2588,15 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2287
2588
|
"onStalled",
|
|
2288
2589
|
"onTimeupdate",
|
|
2289
2590
|
"onWaiting"
|
|
2290
|
-
],
|
|
2591
|
+
], Qn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, $n = [
|
|
2291
2592
|
"aria-label",
|
|
2292
2593
|
"disabled",
|
|
2293
2594
|
"onClick"
|
|
2294
|
-
],
|
|
2595
|
+
], er = { 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]" }, tr = { 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]" }, nr = {
|
|
2295
2596
|
key: 0,
|
|
2296
2597
|
"data-testid": "vibe-asset-spinner",
|
|
2297
2598
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
2298
|
-
},
|
|
2599
|
+
}, rr = { 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]" }, ir = ["data-kind"], ar = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, or = ["onClick"], sr = [
|
|
2299
2600
|
"src",
|
|
2300
2601
|
"preload",
|
|
2301
2602
|
"onCanplay",
|
|
@@ -2311,26 +2612,26 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2311
2612
|
"onStalled",
|
|
2312
2613
|
"onTimeupdate",
|
|
2313
2614
|
"onWaiting"
|
|
2314
|
-
],
|
|
2615
|
+
], cr = {
|
|
2315
2616
|
key: 2,
|
|
2316
2617
|
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"
|
|
2317
|
-
},
|
|
2618
|
+
}, lr = { 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]" }, ur = {
|
|
2318
2619
|
key: 0,
|
|
2319
2620
|
"data-testid": "vibe-fullscreen-overlay",
|
|
2320
2621
|
class: "pointer-events-none absolute inset-0 z-[6]"
|
|
2321
|
-
},
|
|
2622
|
+
}, dr = { class: "h-full w-full" }, fr = {
|
|
2322
2623
|
key: 1,
|
|
2323
2624
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
2324
2625
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
2325
|
-
},
|
|
2626
|
+
}, pr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, mr = { 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)]" }, hr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, gr = {
|
|
2326
2627
|
key: 0,
|
|
2327
2628
|
"data-testid": "vibe-fullscreen-aside",
|
|
2328
2629
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
2329
|
-
},
|
|
2630
|
+
}, _r = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, vr = {
|
|
2330
2631
|
key: 0,
|
|
2331
2632
|
"data-testid": "vibe-fullscreen-aside",
|
|
2332
2633
|
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]"
|
|
2333
|
-
},
|
|
2634
|
+
}, yr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, br = 1280, xr = 768, Sr = /* @__PURE__ */ d({
|
|
2334
2635
|
__name: "FullscreenSurface",
|
|
2335
2636
|
props: {
|
|
2336
2637
|
active: {
|
|
@@ -2382,27 +2683,27 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2382
2683
|
},
|
|
2383
2684
|
emits: ["back-to-list", "update:activeIndex"],
|
|
2384
2685
|
setup(e, { emit: n }) {
|
|
2385
|
-
let d = e, f = F(), m = n, h =
|
|
2686
|
+
let d = e, f = F(), m = n, h = On(d, (e, t) => {
|
|
2386
2687
|
m("update:activeIndex", t);
|
|
2387
2688
|
}, {
|
|
2388
2689
|
enabled: M(d, "active"),
|
|
2389
2690
|
onAssetError: d.reportAssetError ?? void 0,
|
|
2390
2691
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
2391
|
-
}), _ = D(typeof window > "u" ?
|
|
2692
|
+
}), _ = D(typeof window > "u" ? br : window.innerWidth || br), C = $t({
|
|
2392
2693
|
active: M(d, "active"),
|
|
2393
2694
|
items: h.items,
|
|
2394
2695
|
resolvedActiveIndex: h.resolvedActiveIndex,
|
|
2395
2696
|
viewer: h
|
|
2396
|
-
}), T = i(() =>
|
|
2697
|
+
}), T = i(() => Mn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = Ln({
|
|
2397
2698
|
activeItem: h.activeItem,
|
|
2398
2699
|
getItemKey: C.getItemKey,
|
|
2399
2700
|
isImageReady: h.isImageReady,
|
|
2400
2701
|
showDominantImageTone: M(d, "showDominantImageTone")
|
|
2401
|
-
}), L =
|
|
2702
|
+
}), L = Pn({
|
|
2402
2703
|
fullscreenMedia: C,
|
|
2403
|
-
updateDominantToneFromImageElement:
|
|
2704
|
+
updateDominantToneFromImageElement: ve,
|
|
2404
2705
|
viewer: h
|
|
2405
|
-
}), R = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"),
|
|
2706
|
+
}), R = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), ee = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value < xr ? "vertical" : "horizontal"), V = i(() => ee.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), H = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), U = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), W = i(() => {
|
|
2406
2707
|
let e = h.activeItem.value;
|
|
2407
2708
|
return e ? {
|
|
2408
2709
|
hasNextPage: d.hasNextPage,
|
|
@@ -2416,10 +2717,10 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2416
2717
|
...W.value,
|
|
2417
2718
|
kind: h.statusKind.value,
|
|
2418
2719
|
message: h.statusMessage.value
|
|
2419
|
-
}), q = i(() => !K.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](K.value)),
|
|
2720
|
+
}), q = i(() => !K.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](K.value)), J = i(() => ({
|
|
2420
2721
|
gridTemplateColumns: ie.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
2421
2722
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
2422
|
-
})),
|
|
2723
|
+
})), Y = i(() => en(ne.value)), re = i(() => en(G.value)), ie = i(() => re.value && _.value >= br), ae = i(() => re.value && !ie.value), ue = i(() => en(q.value)), { emptyStateProps: X, showBadgeEmptyState: de, showCustomEmptyState: fe, showInlineEmptyState: pe } = rn({
|
|
2423
2724
|
emptyStateMode: M(d, "emptyStateMode"),
|
|
2424
2725
|
itemCount: i(() => d.items.length),
|
|
2425
2726
|
loading: M(d, "loading"),
|
|
@@ -2427,30 +2728,30 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2427
2728
|
surface: "fullscreen"
|
|
2428
2729
|
});
|
|
2429
2730
|
S(() => {
|
|
2430
|
-
window.addEventListener("resize",
|
|
2731
|
+
window.addEventListener("resize", me);
|
|
2431
2732
|
}), x(() => {
|
|
2432
|
-
window.removeEventListener("resize",
|
|
2733
|
+
window.removeEventListener("resize", me);
|
|
2433
2734
|
});
|
|
2434
|
-
function
|
|
2435
|
-
_.value = window.innerWidth ||
|
|
2436
|
-
}
|
|
2437
|
-
function me(e, t) {
|
|
2438
|
-
C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && _e(e, t);
|
|
2735
|
+
function me() {
|
|
2736
|
+
_.value = window.innerWidth || br;
|
|
2439
2737
|
}
|
|
2440
2738
|
function he(e, t) {
|
|
2441
|
-
C.
|
|
2739
|
+
C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && ve(e, t);
|
|
2442
2740
|
}
|
|
2443
2741
|
function ge(e, t) {
|
|
2742
|
+
C.registerMediaElement(e, t), h.registerVideoElement(e, t);
|
|
2743
|
+
}
|
|
2744
|
+
function _e(e, t) {
|
|
2444
2745
|
C.registerMediaElement(e, t), h.registerAudioElement(e, t);
|
|
2445
2746
|
}
|
|
2446
|
-
function
|
|
2747
|
+
function Z(e, t, n) {
|
|
2447
2748
|
let r = L.onFullscreenMediaEvent(e, t, n), i = n.currentTarget, a = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
2448
2749
|
r && i instanceof HTMLMediaElement && i.readyState >= a && C.settleAssetPreload(r);
|
|
2449
2750
|
}
|
|
2450
|
-
function
|
|
2751
|
+
function ve(e, t) {
|
|
2451
2752
|
I(e, t);
|
|
2452
2753
|
}
|
|
2453
|
-
function
|
|
2754
|
+
function ye(e, t, n) {
|
|
2454
2755
|
let r = L.getHandledItemKey(t, n);
|
|
2455
2756
|
if (!r || (h.onMediaEvent(r, e), !d.loopFullscreenVideo)) return;
|
|
2456
2757
|
let i = e.currentTarget;
|
|
@@ -2461,14 +2762,14 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2461
2762
|
let a = i.play();
|
|
2462
2763
|
a && typeof a.catch == "function" && a.catch(() => {});
|
|
2463
2764
|
}
|
|
2464
|
-
return (e, n) => (w(), s("div",
|
|
2765
|
+
return (e, n) => (w(), s("div", Vn, [
|
|
2465
2766
|
c("div", {
|
|
2466
2767
|
class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
|
|
2467
2768
|
style: b(N(P))
|
|
2468
2769
|
}, null, 6),
|
|
2469
2770
|
c("div", {
|
|
2470
2771
|
class: "relative z-[1] grid h-full min-h-0",
|
|
2471
|
-
style: b(
|
|
2772
|
+
style: b(J.value)
|
|
2472
2773
|
}, [c("div", {
|
|
2473
2774
|
ref: "viewer.stageRef",
|
|
2474
2775
|
"data-testid": "vibe-stage",
|
|
@@ -2478,7 +2779,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2478
2779
|
onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
|
|
2479
2780
|
onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
|
|
2480
2781
|
onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
|
|
2481
|
-
}, [N(h).activeItem.value ? (w(), s("div",
|
|
2782
|
+
}, [N(h).activeItem.value ? (w(), s("div", Hn, [
|
|
2482
2783
|
(w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
|
|
2483
2784
|
key: N(C).getItemKey(r),
|
|
2484
2785
|
"data-testid": "vibe-slide",
|
|
@@ -2490,12 +2791,12 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2490
2791
|
class: v(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === N(h).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
|
|
2491
2792
|
style: b(N(h).getSlideStyle(i))
|
|
2492
2793
|
}, [c("div", {
|
|
2493
|
-
class: v(["absolute inset-0 opacity-85", N(
|
|
2794
|
+
class: v(["absolute inset-0 opacity-85", N(Nn)(r.type)]),
|
|
2494
2795
|
style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
|
|
2495
2796
|
}, null, 6), N(h).isVisual(r) ? (w(), s("div", {
|
|
2496
2797
|
key: 0,
|
|
2497
2798
|
class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? V.value : ""])
|
|
2498
|
-
}, [N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2799
|
+
}, [N(C).isAssetLoading(i, r) ? (w(), s("div", Wn, [c("span", Gn, [u(N(oe), {
|
|
2499
2800
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2500
2801
|
"aria-hidden": "true"
|
|
2501
2802
|
})])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
|
|
@@ -2503,19 +2804,19 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2503
2804
|
"data-testid": "vibe-asset-error",
|
|
2504
2805
|
"data-kind": N(C).getAssetErrorKind(r),
|
|
2505
2806
|
class: "grid h-full w-full place-items-center"
|
|
2506
|
-
}, [c("div",
|
|
2807
|
+
}, [c("div", qn, [
|
|
2507
2808
|
u(N(le), {
|
|
2508
2809
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2509
2810
|
"aria-hidden": "true"
|
|
2510
2811
|
}),
|
|
2511
|
-
c("p",
|
|
2812
|
+
c("p", Jn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2512
2813
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2513
2814
|
key: 0,
|
|
2514
2815
|
type: "button",
|
|
2515
2816
|
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",
|
|
2516
|
-
onClick:
|
|
2517
|
-
}, " Retry ", 8,
|
|
2518
|
-
])], 8,
|
|
2817
|
+
onClick: te((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2818
|
+
}, " Retry ", 8, Yn)) : o("", !0)
|
|
2819
|
+
])], 8, Kn)) : r.type === "image" ? (w(), s("img", {
|
|
2519
2820
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2520
2821
|
src: N(C).getFullscreenImageSource(i, r),
|
|
2521
2822
|
alt: r.title ?? "",
|
|
@@ -2523,10 +2824,10 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2523
2824
|
draggable: "false",
|
|
2524
2825
|
class: v(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isImageReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
2525
2826
|
ref_for: !0,
|
|
2526
|
-
ref: (e) =>
|
|
2827
|
+
ref: (e) => he(N(C).getItemKey(r), e),
|
|
2527
2828
|
onLoad: (e) => N(L).onFullscreenImageLoad(e, i, r),
|
|
2528
2829
|
onError: (e) => N(L).onFullscreenImageError(i, r)
|
|
2529
|
-
}, null, 42,
|
|
2830
|
+
}, null, 42, Xn)) : (w(), s("video", {
|
|
2530
2831
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2531
2832
|
class: v(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isMediaReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
2532
2833
|
playsinline: "",
|
|
@@ -2534,26 +2835,26 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2534
2835
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
2535
2836
|
preload: N(C).getFullscreenMediaPreload(i),
|
|
2536
2837
|
ref_for: !0,
|
|
2537
|
-
ref: (e) =>
|
|
2538
|
-
onClick:
|
|
2539
|
-
onCanplay: (e) =>
|
|
2540
|
-
onDurationchange: (e) =>
|
|
2541
|
-
onEnded: (e) =>
|
|
2838
|
+
ref: (e) => ge(N(C).getItemKey(r), e),
|
|
2839
|
+
onClick: te((e) => N(h).onVideoClick(e, N(C).getItemKey(r)), ["stop"]),
|
|
2840
|
+
onCanplay: (e) => Z(i, r, e),
|
|
2841
|
+
onDurationchange: (e) => Z(i, r, e),
|
|
2842
|
+
onEnded: (e) => ye(e, i, r),
|
|
2542
2843
|
onError: (e) => N(L).onFullscreenMediaError(i, r),
|
|
2543
|
-
onLoadstart: (e) =>
|
|
2544
|
-
onLoadedmetadata: (e) =>
|
|
2545
|
-
onPause: (e) =>
|
|
2546
|
-
onPlay: (e) =>
|
|
2547
|
-
onPlaying: (e) =>
|
|
2548
|
-
onSeeking: (e) =>
|
|
2549
|
-
onSeeked: (e) =>
|
|
2550
|
-
onStalled: (e) =>
|
|
2551
|
-
onTimeupdate: (e) =>
|
|
2552
|
-
onWaiting: (e) =>
|
|
2553
|
-
}, null, 42,
|
|
2844
|
+
onLoadstart: (e) => Z(i, r, e),
|
|
2845
|
+
onLoadedmetadata: (e) => Z(i, r, e),
|
|
2846
|
+
onPause: (e) => Z(i, r, e),
|
|
2847
|
+
onPlay: (e) => Z(i, r, e),
|
|
2848
|
+
onPlaying: (e) => Z(i, r, e),
|
|
2849
|
+
onSeeking: (e) => Z(i, r, e),
|
|
2850
|
+
onSeeked: (e) => Z(i, r, e),
|
|
2851
|
+
onStalled: (e) => Z(i, r, e),
|
|
2852
|
+
onTimeupdate: (e) => Z(i, r, e),
|
|
2853
|
+
onWaiting: (e) => Z(i, r, e)
|
|
2854
|
+
}, null, 42, Zn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
|
|
2554
2855
|
key: 1,
|
|
2555
2856
|
class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? V.value : ""])
|
|
2556
|
-
}, [c("div",
|
|
2857
|
+
}, [c("div", Qn, [
|
|
2557
2858
|
c("button", {
|
|
2558
2859
|
type: "button",
|
|
2559
2860
|
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]",
|
|
@@ -2563,19 +2864,19 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2563
2864
|
}, [
|
|
2564
2865
|
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),
|
|
2565
2866
|
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),
|
|
2566
|
-
c("span",
|
|
2567
|
-
icon: N(
|
|
2867
|
+
c("span", er, [k(e.$slots, "item-icon", {
|
|
2868
|
+
icon: N(Vt)(r.type),
|
|
2568
2869
|
item: r
|
|
2569
|
-
}, () => [(w(), a(A(N(
|
|
2870
|
+
}, () => [(w(), a(A(N(Vt)(r.type)), {
|
|
2570
2871
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2571
2872
|
"aria-hidden": "true"
|
|
2572
2873
|
}))])]),
|
|
2573
|
-
c("span",
|
|
2874
|
+
c("span", tr, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
|
|
2574
2875
|
class: "h-4 w-4 stroke-2",
|
|
2575
2876
|
"aria-hidden": "true"
|
|
2576
2877
|
}))])
|
|
2577
|
-
], 8,
|
|
2578
|
-
N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2878
|
+
], 8, $n),
|
|
2879
|
+
N(C).isAssetLoading(i, r) ? (w(), s("div", nr, [c("span", rr, [u(N(oe), {
|
|
2579
2880
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2580
2881
|
"aria-hidden": "true"
|
|
2581
2882
|
})])])) : o("", !0),
|
|
@@ -2588,43 +2889,43 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2588
2889
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2589
2890
|
"aria-hidden": "true"
|
|
2590
2891
|
}),
|
|
2591
|
-
c("p",
|
|
2892
|
+
c("p", ar, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2592
2893
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2593
2894
|
key: 0,
|
|
2594
2895
|
type: "button",
|
|
2595
2896
|
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",
|
|
2596
|
-
onClick:
|
|
2597
|
-
}, " Retry ", 8,
|
|
2598
|
-
], 8,
|
|
2897
|
+
onClick: te((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2898
|
+
}, " Retry ", 8, or)) : o("", !0)
|
|
2899
|
+
], 8, ir)], 64)) : o("", !0)
|
|
2599
2900
|
]), (w(), s("audio", {
|
|
2600
2901
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2601
2902
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
2602
2903
|
preload: N(C).getFullscreenMediaPreload(i),
|
|
2603
2904
|
class: "pointer-events-none absolute h-px w-px opacity-0",
|
|
2604
2905
|
ref_for: !0,
|
|
2605
|
-
ref: (e) =>
|
|
2606
|
-
onCanplay: (e) =>
|
|
2607
|
-
onDurationchange: (e) =>
|
|
2906
|
+
ref: (e) => _e(N(C).getItemKey(r), e),
|
|
2907
|
+
onCanplay: (e) => Z(i, r, e),
|
|
2908
|
+
onDurationchange: (e) => Z(i, r, e),
|
|
2608
2909
|
onError: (e) => N(L).onFullscreenMediaError(i, r),
|
|
2609
|
-
onLoadstart: (e) =>
|
|
2610
|
-
onLoadedmetadata: (e) =>
|
|
2611
|
-
onPause: (e) =>
|
|
2612
|
-
onPlay: (e) =>
|
|
2613
|
-
onPlaying: (e) =>
|
|
2614
|
-
onSeeking: (e) =>
|
|
2615
|
-
onSeeked: (e) =>
|
|
2616
|
-
onStalled: (e) =>
|
|
2617
|
-
onTimeupdate: (e) =>
|
|
2618
|
-
onWaiting: (e) =>
|
|
2619
|
-
}, null, 40,
|
|
2620
|
-
icon: N(
|
|
2910
|
+
onLoadstart: (e) => Z(i, r, e),
|
|
2911
|
+
onLoadedmetadata: (e) => Z(i, r, e),
|
|
2912
|
+
onPause: (e) => Z(i, r, e),
|
|
2913
|
+
onPlay: (e) => Z(i, r, e),
|
|
2914
|
+
onPlaying: (e) => Z(i, r, e),
|
|
2915
|
+
onSeeking: (e) => Z(i, r, e),
|
|
2916
|
+
onSeeked: (e) => Z(i, r, e),
|
|
2917
|
+
onStalled: (e) => Z(i, r, e),
|
|
2918
|
+
onTimeupdate: (e) => Z(i, r, e),
|
|
2919
|
+
onWaiting: (e) => Z(i, r, e)
|
|
2920
|
+
}, null, 40, sr))], 2)) : (w(), s("div", cr, [c("div", lr, [k(e.$slots, "item-icon", {
|
|
2921
|
+
icon: N(Vt)(r.type),
|
|
2621
2922
|
item: r
|
|
2622
|
-
}, () => [(w(), a(A(N(
|
|
2923
|
+
}, () => [(w(), a(A(N(Vt)(r.type)), {
|
|
2623
2924
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2624
2925
|
"aria-hidden": "true"
|
|
2625
|
-
}))])])]))], 14,
|
|
2626
|
-
W.value && f["fullscreen-overlay"] ? (w(), s("div",
|
|
2627
|
-
N(h).activeItem.value ? (w(), a(
|
|
2926
|
+
}))])])]))], 14, Un))), 128)),
|
|
2927
|
+
W.value && f["fullscreen-overlay"] ? (w(), s("div", ur, [c("div", dr, [k(e.$slots, "fullscreen-overlay", y(p(W.value)))])])) : o("", !0),
|
|
2928
|
+
N(h).activeItem.value ? (w(), a(Rt, {
|
|
2628
2929
|
key: 1,
|
|
2629
2930
|
"current-index": N(h).resolvedActiveIndex.value,
|
|
2630
2931
|
loading: d.loading,
|
|
@@ -2634,7 +2935,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2634
2935
|
title: N(h).activeItem.value.title ?? null,
|
|
2635
2936
|
total: N(h).items.value.length,
|
|
2636
2937
|
onBackToList: n[0] ||= (e) => m("back-to-list")
|
|
2637
|
-
}, l({ _: 2 }, [
|
|
2938
|
+
}, l({ _: 2 }, [Y.value && W.value ? {
|
|
2638
2939
|
name: "actions",
|
|
2639
2940
|
fn: z(() => [k(e.$slots, "fullscreen-header-actions", y(p(W.value)))]),
|
|
2640
2941
|
key: "0"
|
|
@@ -2647,7 +2948,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2647
2948
|
"title",
|
|
2648
2949
|
"total"
|
|
2649
2950
|
])) : o("", !0),
|
|
2650
|
-
|
|
2951
|
+
ee.value ? (w(), a(Dt, {
|
|
2651
2952
|
key: 2,
|
|
2652
2953
|
"current-time": N(h).activeMediaState.value.currentTime,
|
|
2653
2954
|
"current-time-label": N(h).formatPlaybackTime(N(h).activeMediaState.value.currentTime),
|
|
@@ -2656,7 +2957,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2656
2957
|
muted: N(h).activeMediaState.value.muted,
|
|
2657
2958
|
progress: N(h).activeMediaProgress.value,
|
|
2658
2959
|
volume: N(h).activeMediaState.value.volume,
|
|
2659
|
-
"volume-control-layout":
|
|
2960
|
+
"volume-control-layout": B.value,
|
|
2660
2961
|
onSeekInput: N(h).onMediaSeekInput,
|
|
2661
2962
|
onVolumeInput: N(h).onMediaVolumeInput,
|
|
2662
2963
|
onVolumeToggle: N(h).onMediaVolumeToggle
|
|
@@ -2681,10 +2982,10 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2681
2982
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2682
2983
|
class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", K.value.kind === "end" ? "border-amber-300/35 text-amber-200" : K.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
2683
2984
|
}, j(K.value.message), 3))], 2)) : o("", !0)
|
|
2684
|
-
])) : H.value ? (w(), s("div",
|
|
2985
|
+
])) : H.value ? (w(), s("div", fr, [c("div", pr, [c("span", mr, [u(N(oe), {
|
|
2685
2986
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2686
2987
|
"aria-hidden": "true"
|
|
2687
|
-
})]), c("p",
|
|
2988
|
+
})]), c("p", hr, j(U.value), 1)])])) : N(pe) && N(X) ? (w(), a(Bn, {
|
|
2688
2989
|
key: 2,
|
|
2689
2990
|
message: N(X).message,
|
|
2690
2991
|
mode: N(X).mode,
|
|
@@ -2696,7 +2997,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2696
2997
|
"message",
|
|
2697
2998
|
"mode",
|
|
2698
2999
|
"surface"
|
|
2699
|
-
])) : o("", !0), N(de) && N(X) ? (w(), a(
|
|
3000
|
+
])) : o("", !0), N(de) && N(X) ? (w(), a(Bn, {
|
|
2700
3001
|
key: 3,
|
|
2701
3002
|
message: N(X).message,
|
|
2702
3003
|
mode: N(X).mode,
|
|
@@ -2716,7 +3017,7 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2716
3017
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2717
3018
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2718
3019
|
}, {
|
|
2719
|
-
default: z(() => [ie.value && W.value ? (w(), s("aside",
|
|
3020
|
+
default: z(() => [ie.value && W.value ? (w(), s("aside", gr, [c("div", _r, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
|
|
2720
3021
|
_: 3
|
|
2721
3022
|
})], 4),
|
|
2722
3023
|
u(r, {
|
|
@@ -2727,29 +3028,29 @@ var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
|
2727
3028
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2728
3029
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2729
3030
|
}, {
|
|
2730
|
-
default: z(() => [ae.value && W.value ? (w(), s("aside",
|
|
3031
|
+
default: z(() => [ae.value && W.value ? (w(), s("aside", vr, [c("div", yr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
|
|
2731
3032
|
_: 3
|
|
2732
3033
|
})
|
|
2733
3034
|
]));
|
|
2734
3035
|
}
|
|
2735
|
-
}),
|
|
2736
|
-
function
|
|
3036
|
+
}), Cr = 1, wr = .5;
|
|
3037
|
+
function Tr(e) {
|
|
2737
3038
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2738
|
-
width:
|
|
2739
|
-
height:
|
|
3039
|
+
width: Cr,
|
|
3040
|
+
height: Cr,
|
|
2740
3041
|
source: "fallback"
|
|
2741
3042
|
};
|
|
2742
3043
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2743
|
-
if (
|
|
2744
|
-
let r =
|
|
3044
|
+
if (jr(t) && jr(n)) {
|
|
3045
|
+
let r = Mr(e, t, n);
|
|
2745
3046
|
return {
|
|
2746
3047
|
width: r.width,
|
|
2747
3048
|
height: r.height,
|
|
2748
3049
|
source: "preview"
|
|
2749
3050
|
};
|
|
2750
3051
|
}
|
|
2751
|
-
if (
|
|
2752
|
-
let t =
|
|
3052
|
+
if (jr(e.width) && jr(e.height)) {
|
|
3053
|
+
let t = Mr(e, e.width, e.height);
|
|
2753
3054
|
return {
|
|
2754
3055
|
width: t.width,
|
|
2755
3056
|
height: t.height,
|
|
@@ -2757,31 +3058,31 @@ function _r(e) {
|
|
|
2757
3058
|
};
|
|
2758
3059
|
}
|
|
2759
3060
|
return {
|
|
2760
|
-
width:
|
|
2761
|
-
height:
|
|
3061
|
+
width: Cr,
|
|
3062
|
+
height: Cr,
|
|
2762
3063
|
source: "fallback"
|
|
2763
3064
|
};
|
|
2764
3065
|
}
|
|
2765
|
-
function
|
|
3066
|
+
function Er(e, t) {
|
|
2766
3067
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2767
3068
|
}
|
|
2768
|
-
function
|
|
3069
|
+
function Dr(e, t, n, r = 0) {
|
|
2769
3070
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2770
3071
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2771
3072
|
return !a || a <= 0 ? n : a / t;
|
|
2772
3073
|
}
|
|
2773
|
-
function
|
|
2774
|
-
let n =
|
|
3074
|
+
function Or(e, t) {
|
|
3075
|
+
let n = Tr(e);
|
|
2775
3076
|
return n.height / n.width * t;
|
|
2776
3077
|
}
|
|
2777
|
-
function
|
|
3078
|
+
function kr(e, t) {
|
|
2778
3079
|
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;
|
|
2779
3080
|
for (let c = 0; c < e.length; c += 1) {
|
|
2780
3081
|
let l = e[c];
|
|
2781
|
-
o.set(
|
|
3082
|
+
o.set(Q(l), c);
|
|
2782
3083
|
let u = 0;
|
|
2783
3084
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2784
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
3085
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = Or(l, t.columnWidth);
|
|
2785
3086
|
r[c] = {
|
|
2786
3087
|
x: d,
|
|
2787
3088
|
y: f
|
|
@@ -2800,7 +3101,7 @@ function xr(e, t) {
|
|
|
2800
3101
|
indexById: o
|
|
2801
3102
|
};
|
|
2802
3103
|
}
|
|
2803
|
-
function
|
|
3104
|
+
function Ar(e) {
|
|
2804
3105
|
if (e.itemCount <= 0) return [];
|
|
2805
3106
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2806
3107
|
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();
|
|
@@ -2810,21 +3111,11 @@ function Sr(e) {
|
|
|
2810
3111
|
}
|
|
2811
3112
|
return Array.from(a).sort((e, t) => e - t);
|
|
2812
3113
|
}
|
|
2813
|
-
function
|
|
2814
|
-
let r = /* @__PURE__ */ new Map();
|
|
2815
|
-
for (let i of e) {
|
|
2816
|
-
let e = t.get($(i));
|
|
2817
|
-
if (e == null) continue;
|
|
2818
|
-
let a = n[e];
|
|
2819
|
-
a && r.set($(i), a);
|
|
2820
|
-
}
|
|
2821
|
-
return r;
|
|
2822
|
-
}
|
|
2823
|
-
function wr(e) {
|
|
3114
|
+
function jr(e) {
|
|
2824
3115
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2825
3116
|
}
|
|
2826
|
-
function
|
|
2827
|
-
return e.type !== "image" || n / t >=
|
|
3117
|
+
function Mr(e, t, n) {
|
|
3118
|
+
return e.type !== "image" || n / t >= wr ? {
|
|
2828
3119
|
width: t,
|
|
2829
3120
|
height: n
|
|
2830
3121
|
} : {
|
|
@@ -2834,46 +3125,46 @@ function Tr(e, t, n) {
|
|
|
2834
3125
|
}
|
|
2835
3126
|
//#endregion
|
|
2836
3127
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2837
|
-
var
|
|
2838
|
-
function
|
|
3128
|
+
var Nr = 300, Pr = 600, Fr = 40, Ir = 300, Lr = 400;
|
|
3129
|
+
function Rr(e, t) {
|
|
2839
3130
|
return t === "top" ? [...e].reverse() : e;
|
|
2840
3131
|
}
|
|
2841
|
-
function
|
|
2842
|
-
return e <= 0 ?
|
|
3132
|
+
function zr(e) {
|
|
3133
|
+
return e <= 0 ? Pr : Pr + Math.min((e - 1) * Fr, Lr);
|
|
2843
3134
|
}
|
|
2844
|
-
function
|
|
2845
|
-
return
|
|
3135
|
+
function Br() {
|
|
3136
|
+
return Ir;
|
|
2846
3137
|
}
|
|
2847
|
-
function
|
|
3138
|
+
function Vr(e) {
|
|
2848
3139
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2849
3140
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2850
3141
|
}
|
|
2851
|
-
function
|
|
3142
|
+
function Hr(e) {
|
|
2852
3143
|
let t = D(/* @__PURE__ */ new Set()), n = D(/* @__PURE__ */ new Set()), r = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), o = D(/* @__PURE__ */ new Map()), s = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Map()), u = D(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
|
|
2853
3144
|
L(e.visibleIndices, (i) => {
|
|
2854
3145
|
if (!i.length) return;
|
|
2855
3146
|
let o = [];
|
|
2856
3147
|
for (let n of i) {
|
|
2857
|
-
let r = e.items.value[n] ?
|
|
3148
|
+
let r = e.items.value[n] ? Q(e.items.value[n]) : null;
|
|
2858
3149
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2859
3150
|
}
|
|
2860
3151
|
if (!o.length) return;
|
|
2861
|
-
let s =
|
|
2862
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2863
|
-
r.value = c,
|
|
3152
|
+
let s = Rr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
3153
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Fr, Lr));
|
|
3154
|
+
r.value = c, Ur(() => {
|
|
2864
3155
|
let e = new Set(n.value);
|
|
2865
3156
|
for (let t of o) e.add(t);
|
|
2866
3157
|
n.value = e;
|
|
2867
|
-
}),
|
|
3158
|
+
}), Wr(() => {
|
|
2868
3159
|
let e = new Set(t.value);
|
|
2869
3160
|
for (let t of o) e.delete(t);
|
|
2870
3161
|
t.value = e, S(() => {
|
|
2871
3162
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2872
3163
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2873
3164
|
n.value = e, r.value = t, a.value = i;
|
|
2874
|
-
},
|
|
3165
|
+
}, zr(o.length));
|
|
2875
3166
|
});
|
|
2876
|
-
}, { flush: "post" }), L(() => e.items.value.map((e) =>
|
|
3167
|
+
}, { flush: "post" }), L(() => e.items.value.map((e) => Q(e)), (e) => {
|
|
2877
3168
|
if (!e.length || !o.value.size) return;
|
|
2878
3169
|
let t = new Set(e), n = null, r = null;
|
|
2879
3170
|
for (let e of o.value.keys()) t.has(e) && (n ||= new Map(o.value), r ||= new Set(s.value), n.delete(e), r.delete(e));
|
|
@@ -2886,7 +3177,7 @@ function Fr(e) {
|
|
|
2886
3177
|
if (!e.length) return;
|
|
2887
3178
|
let r = new Set(t.value), i = new Map(a.value);
|
|
2888
3179
|
for (let t of e) {
|
|
2889
|
-
let e =
|
|
3180
|
+
let e = Q(t);
|
|
2890
3181
|
r.add(e), i.set(e, n);
|
|
2891
3182
|
}
|
|
2892
3183
|
t.value = r, a.value = i;
|
|
@@ -2895,10 +3186,10 @@ function Fr(e) {
|
|
|
2895
3186
|
if (!e.length) return;
|
|
2896
3187
|
let i = new Map(o.value), c = new Set(t.value), l = new Set(n.value), u = new Map(r.value), f = new Map(a.value), p = [];
|
|
2897
3188
|
for (let t of e) {
|
|
2898
|
-
let e =
|
|
3189
|
+
let e = Q(t.item);
|
|
2899
3190
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2900
3191
|
}
|
|
2901
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
3192
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Ur(() => {
|
|
2902
3193
|
let e = new Set(s.value);
|
|
2903
3194
|
for (let t of p) e.add(t);
|
|
2904
3195
|
s.value = e;
|
|
@@ -2906,9 +3197,9 @@ function Fr(e) {
|
|
|
2906
3197
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2907
3198
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2908
3199
|
o.value = e, s.value = t;
|
|
2909
|
-
},
|
|
3200
|
+
}, Ir);
|
|
2910
3201
|
}
|
|
2911
|
-
function g(t, n, r =
|
|
3202
|
+
function g(t, n, r = Nr) {
|
|
2912
3203
|
if (!t.size) return;
|
|
2913
3204
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2914
3205
|
for (let [r, o] of t.entries()) {
|
|
@@ -2927,8 +3218,8 @@ function Fr(e) {
|
|
|
2927
3218
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2928
3219
|
let o = new Map(l.value);
|
|
2929
3220
|
for (let e of a) o.set(e, r);
|
|
2930
|
-
l.value = o,
|
|
2931
|
-
u.value = new Set(a),
|
|
3221
|
+
l.value = o, Ur(() => {
|
|
3222
|
+
u.value = new Set(a), Ur(() => {
|
|
2932
3223
|
c.value = /* @__PURE__ */ new Map();
|
|
2933
3224
|
});
|
|
2934
3225
|
}), S(() => {
|
|
@@ -2939,8 +3230,8 @@ function Fr(e) {
|
|
|
2939
3230
|
}, r);
|
|
2940
3231
|
}
|
|
2941
3232
|
function _(e) {
|
|
2942
|
-
if (n.value.has(e)) return `transform ${
|
|
2943
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
3233
|
+
if (n.value.has(e)) return `transform ${Pr}ms ease-out`;
|
|
3234
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? Nr}ms ease-out`;
|
|
2944
3235
|
}
|
|
2945
3236
|
function v(e) {
|
|
2946
3237
|
if (!n.value.has(e)) return;
|
|
@@ -2951,13 +3242,13 @@ function Fr(e) {
|
|
|
2951
3242
|
let r = e.items.value[n], i = e.positions.value[n] ?? {
|
|
2952
3243
|
x: 0,
|
|
2953
3244
|
y: 0
|
|
2954
|
-
}, o = e.heights.value[n] ?? e.columnWidth.value, s = r ?
|
|
3245
|
+
}, o = e.heights.value[n] ?? e.columnWidth.value, s = r ? Q(r) : null, l = s ? c.value.get(s) ?? {
|
|
2955
3246
|
dx: 0,
|
|
2956
3247
|
dy: 0
|
|
2957
3248
|
} : {
|
|
2958
3249
|
dx: 0,
|
|
2959
3250
|
dy: 0
|
|
2960
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
3251
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Vr({
|
|
2961
3252
|
columnWidth: e.columnWidth.value,
|
|
2962
3253
|
direction: u,
|
|
2963
3254
|
itemHeight: o,
|
|
@@ -2967,18 +3258,18 @@ function Fr(e) {
|
|
|
2967
3258
|
return `translate3d(${i.x + l.dx}px, ${d + l.dy}px, 0)`;
|
|
2968
3259
|
}
|
|
2969
3260
|
function b(t) {
|
|
2970
|
-
let n =
|
|
3261
|
+
let n = Q(t), r = o.value.get(n);
|
|
2971
3262
|
if (!r) return {
|
|
2972
3263
|
opacity: "0",
|
|
2973
3264
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2974
|
-
transition: `opacity ${
|
|
3265
|
+
transition: `opacity ${Ir}ms ease-out, transform ${Ir}ms ease-out`
|
|
2975
3266
|
};
|
|
2976
3267
|
let i = s.value.has(n);
|
|
2977
3268
|
return {
|
|
2978
3269
|
height: `${r.height}px`,
|
|
2979
3270
|
opacity: i ? "0" : "1",
|
|
2980
3271
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2981
|
-
transition: `opacity ${
|
|
3272
|
+
transition: `opacity ${Ir}ms ease-out, transform ${Ir}ms ease-out`,
|
|
2982
3273
|
width: `${e.columnWidth.value}px`
|
|
2983
3274
|
};
|
|
2984
3275
|
}
|
|
@@ -2999,37 +3290,107 @@ function Fr(e) {
|
|
|
2999
3290
|
playFlipMoveAnimation: g
|
|
3000
3291
|
};
|
|
3001
3292
|
}
|
|
3002
|
-
function
|
|
3293
|
+
function Ur(e) {
|
|
3003
3294
|
if (typeof requestAnimationFrame == "function") {
|
|
3004
3295
|
requestAnimationFrame(() => e());
|
|
3005
3296
|
return;
|
|
3006
3297
|
}
|
|
3007
3298
|
setTimeout(e, 0);
|
|
3008
3299
|
}
|
|
3009
|
-
function
|
|
3010
|
-
|
|
3300
|
+
function Wr(e) {
|
|
3301
|
+
Ur(() => Ur(e));
|
|
3011
3302
|
}
|
|
3012
3303
|
//#endregion
|
|
3013
3304
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
3014
|
-
function
|
|
3305
|
+
function Gr(e, t) {
|
|
3015
3306
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
3016
3307
|
}
|
|
3017
|
-
function
|
|
3308
|
+
function Kr(e, t, n) {
|
|
3018
3309
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
3019
3310
|
}
|
|
3020
|
-
function
|
|
3021
|
-
return (e?.scrollHeight ?? r) - (t + n);
|
|
3311
|
+
function qr(e, t, n, r) {
|
|
3312
|
+
return Math.max(e?.scrollHeight ?? 0, r) - (t + n);
|
|
3022
3313
|
}
|
|
3023
|
-
function
|
|
3314
|
+
function Jr(e, t) {
|
|
3024
3315
|
return {
|
|
3025
3316
|
height: `${e}px`,
|
|
3026
3317
|
transform: `translate3d(0, ${t}px, 0)`
|
|
3027
3318
|
};
|
|
3028
3319
|
}
|
|
3029
3320
|
//#endregion
|
|
3321
|
+
//#region src/components/viewer-core/masonryScrollBehavior.ts
|
|
3322
|
+
var Yr = 24, Xr = 48;
|
|
3323
|
+
function Zr(e) {
|
|
3324
|
+
let t = D(0), n = 0, r = 0;
|
|
3325
|
+
function i(e) {
|
|
3326
|
+
if (t.value = ni(e), t.value <= 0) {
|
|
3327
|
+
o();
|
|
3328
|
+
return;
|
|
3329
|
+
}
|
|
3330
|
+
a();
|
|
3331
|
+
}
|
|
3332
|
+
function a() {
|
|
3333
|
+
n || t.value <= 0 || !e.active.value || typeof requestAnimationFrame > "u" || (n = requestAnimationFrame(s));
|
|
3334
|
+
}
|
|
3335
|
+
function o() {
|
|
3336
|
+
n && typeof cancelAnimationFrame < "u" && cancelAnimationFrame(n), n = 0, r = 0;
|
|
3337
|
+
}
|
|
3338
|
+
function s(i) {
|
|
3339
|
+
if (n = 0, !e.active.value || t.value <= 0) {
|
|
3340
|
+
o();
|
|
3341
|
+
return;
|
|
3342
|
+
}
|
|
3343
|
+
let s = e.getViewport();
|
|
3344
|
+
if (s && r > 0) {
|
|
3345
|
+
let n = Math.min(Math.max(0, i - r), 250), a = t.value * n / 1e3;
|
|
3346
|
+
s.scrollTop = ri(s.scrollTop + a, 0, e.getMaxScrollTop()), e.onScroll();
|
|
3347
|
+
}
|
|
3348
|
+
r = i, a();
|
|
3349
|
+
}
|
|
3350
|
+
return {
|
|
3351
|
+
autoScroll: i,
|
|
3352
|
+
start: a,
|
|
3353
|
+
stop: o
|
|
3354
|
+
};
|
|
3355
|
+
}
|
|
3356
|
+
function Qr(e) {
|
|
3357
|
+
if (!e.active || !e.triggerEnabled) return 0;
|
|
3358
|
+
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3359
|
+
return t <= 0 ? 1 : ri(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
3360
|
+
}
|
|
3361
|
+
function $r(e) {
|
|
3362
|
+
if (!e.active || !e.triggerEnabled) return 0;
|
|
3363
|
+
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3364
|
+
return t <= 0 ? 1 : ri(e.progressDistancePx / t, 0, 1);
|
|
3365
|
+
}
|
|
3366
|
+
function ei(e) {
|
|
3367
|
+
let t = i(() => Math.max(0, e.viewportHeight.value - Yr * 2)), n = i(() => e.containerHeight.value > e.viewportHeight.value + 1 && t.value > 0), r = i(() => {
|
|
3368
|
+
if (!n.value) return 0;
|
|
3369
|
+
let r = e.viewportHeight.value / e.containerHeight.value * t.value;
|
|
3370
|
+
return Math.min(t.value, Math.max(Xr, r));
|
|
3371
|
+
}), a = i(() => {
|
|
3372
|
+
if (!n.value) return Yr;
|
|
3373
|
+
let i = Math.max(0, e.containerHeight.value - e.viewportHeight.value);
|
|
3374
|
+
return Yr + Math.max(0, t.value - r.value) * (i > 0 ? ri(e.scrollTop.value / i, 0, 1) : 0);
|
|
3375
|
+
});
|
|
3376
|
+
return {
|
|
3377
|
+
getScrollbarThumbStyle: () => Jr(r.value, a.value),
|
|
3378
|
+
showScrollbar: n
|
|
3379
|
+
};
|
|
3380
|
+
}
|
|
3381
|
+
function ti(e) {
|
|
3382
|
+
return typeof e == "number" && Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
3383
|
+
}
|
|
3384
|
+
function ni(e) {
|
|
3385
|
+
return Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
3386
|
+
}
|
|
3387
|
+
function ri(e, t, n) {
|
|
3388
|
+
return Math.min(Math.max(e, t), n);
|
|
3389
|
+
}
|
|
3390
|
+
//#endregion
|
|
3030
3391
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
3031
|
-
var
|
|
3032
|
-
function
|
|
3392
|
+
var ii = 250, ai = 1e3;
|
|
3393
|
+
function oi(e) {
|
|
3033
3394
|
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
|
|
3034
3395
|
x(() => {
|
|
3035
3396
|
y();
|
|
@@ -3045,7 +3406,7 @@ function Wr(e) {
|
|
|
3045
3406
|
function u(t) {
|
|
3046
3407
|
if (!b(t) || !e.isAtBoundary()) return;
|
|
3047
3408
|
let n = Date.now();
|
|
3048
|
-
n < s || (s = n +
|
|
3409
|
+
n < s || (s = n + ii, m());
|
|
3049
3410
|
}
|
|
3050
3411
|
function d() {
|
|
3051
3412
|
if (!g()) return;
|
|
@@ -3079,7 +3440,7 @@ function Wr(e) {
|
|
|
3079
3440
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
3080
3441
|
}
|
|
3081
3442
|
function _() {
|
|
3082
|
-
o.value = !1, v(
|
|
3443
|
+
o.value = !1, v(ai);
|
|
3083
3444
|
}
|
|
3084
3445
|
function v(e) {
|
|
3085
3446
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -3101,177 +3462,284 @@ function Wr(e) {
|
|
|
3101
3462
|
};
|
|
3102
3463
|
}
|
|
3103
3464
|
//#endregion
|
|
3465
|
+
//#region src/components/viewer-core/masonryBoundaryLock.ts
|
|
3466
|
+
function si() {
|
|
3467
|
+
let e = D(!1), t = null;
|
|
3468
|
+
x(() => {
|
|
3469
|
+
r();
|
|
3470
|
+
});
|
|
3471
|
+
function n(n) {
|
|
3472
|
+
r(), e.value = !0, t = setTimeout(() => {
|
|
3473
|
+
t = null, e.value = !1;
|
|
3474
|
+
}, Math.max(0, n));
|
|
3475
|
+
}
|
|
3476
|
+
function r() {
|
|
3477
|
+
t && (clearTimeout(t), t = null, e.value = !1);
|
|
3478
|
+
}
|
|
3479
|
+
return {
|
|
3480
|
+
clearBoundaryInteractionReleaseTimer: r,
|
|
3481
|
+
isBoundaryInteractionLocked: e,
|
|
3482
|
+
lockBoundaryInteraction: n
|
|
3483
|
+
};
|
|
3484
|
+
}
|
|
3485
|
+
//#endregion
|
|
3486
|
+
//#region src/components/viewer-core/masonryItemMutation.ts
|
|
3487
|
+
function ci(e) {
|
|
3488
|
+
let t = e.currentItems.map((e) => Q(e)), n = e.previousItems.map((e) => Q(e)), r = ui(e.previousItems, e.layoutIndexById, e.layoutHeights), i = di(e.previousItems, e.layoutIndexById, e.layoutPositions), a = new Set(n), o = new Set(t), s = e.currentItems.filter((e) => !a.has(Q(e))), c = li(e.previousItems, o, r, i), l = t.length > n.length && n.length > 0 && t[0] !== n[0], u = e.scrollTop > e.contentInsetPx + e.gapPx, d = l && u ? e.currentItems[e.activeIndex] : null;
|
|
3489
|
+
return {
|
|
3490
|
+
addedItems: s,
|
|
3491
|
+
anchorId: d ? Q(d) : null,
|
|
3492
|
+
isPrepend: l,
|
|
3493
|
+
oldPositionsById: i,
|
|
3494
|
+
previousIds: n,
|
|
3495
|
+
removedItems: c,
|
|
3496
|
+
shouldLockBoundaryInteractionForRemoval: c.length > 0 && u,
|
|
3497
|
+
shouldResetScrollForEmptyRemoval: e.currentItems.length === 0 && e.previousItems.length > 0 && c.length > 0 && e.scrollTop > 0
|
|
3498
|
+
};
|
|
3499
|
+
}
|
|
3500
|
+
function li(e, t, n, r) {
|
|
3501
|
+
return e.flatMap((e) => {
|
|
3502
|
+
let i = Q(e);
|
|
3503
|
+
if (t.has(i)) return [];
|
|
3504
|
+
let a = r.get(i), o = n.get(i);
|
|
3505
|
+
return a && o != null ? [{
|
|
3506
|
+
height: o,
|
|
3507
|
+
item: e,
|
|
3508
|
+
position: a
|
|
3509
|
+
}] : [];
|
|
3510
|
+
});
|
|
3511
|
+
}
|
|
3512
|
+
function ui(e, t, n) {
|
|
3513
|
+
let r = /* @__PURE__ */ new Map();
|
|
3514
|
+
for (let i of e) {
|
|
3515
|
+
let e = Q(i), a = t.get(e), o = a == null ? void 0 : n[a];
|
|
3516
|
+
o != null && r.set(e, o);
|
|
3517
|
+
}
|
|
3518
|
+
return r;
|
|
3519
|
+
}
|
|
3520
|
+
function di(e, t, n) {
|
|
3521
|
+
let r = /* @__PURE__ */ new Map();
|
|
3522
|
+
for (let i of e) {
|
|
3523
|
+
let e = Q(i), a = t.get(e), o = a == null ? void 0 : n[a];
|
|
3524
|
+
o && r.set(e, o);
|
|
3525
|
+
}
|
|
3526
|
+
return r;
|
|
3527
|
+
}
|
|
3528
|
+
//#endregion
|
|
3529
|
+
//#region src/components/viewer-core/masonryPendingAppend.ts
|
|
3530
|
+
function fi(e) {
|
|
3531
|
+
let t = D(null), n = D(!1), r = null;
|
|
3532
|
+
function i() {
|
|
3533
|
+
o(), e.pendingAppendItems.value.length && (t.value = c([...e.items.value, ...e.pendingAppendItems.value]), s());
|
|
3534
|
+
}
|
|
3535
|
+
function a(i) {
|
|
3536
|
+
!i && !e.pendingAppendItems.value.length && !r && !n.value && (t.value = null);
|
|
3537
|
+
}
|
|
3538
|
+
function o() {
|
|
3539
|
+
r &&= (clearTimeout(r), null);
|
|
3540
|
+
}
|
|
3541
|
+
function s() {
|
|
3542
|
+
let i = e.commitPendingAppend.value;
|
|
3543
|
+
typeof i == "function" && (r = setTimeout(async () => {
|
|
3544
|
+
r = null, n.value = !0;
|
|
3545
|
+
try {
|
|
3546
|
+
e.pendingAppendItems.value.length && (await i(), await _(), await _());
|
|
3547
|
+
} finally {
|
|
3548
|
+
t.value = null, n.value = !1;
|
|
3549
|
+
}
|
|
3550
|
+
}, 300));
|
|
3551
|
+
}
|
|
3552
|
+
function c(t) {
|
|
3553
|
+
return t.length ? kr(t, {
|
|
3554
|
+
bucketPx: e.bucketPx,
|
|
3555
|
+
columnCount: e.columnCount.value,
|
|
3556
|
+
columnWidth: e.columnWidth.value,
|
|
3557
|
+
gapX: e.gapPx,
|
|
3558
|
+
gapY: e.gapPx
|
|
3559
|
+
}).contentHeight + e.contentInsetPx * 2 : 0;
|
|
3560
|
+
}
|
|
3561
|
+
return {
|
|
3562
|
+
clearAppendCommitTimer: o,
|
|
3563
|
+
clearReservedHeightWhenIdle: a,
|
|
3564
|
+
refreshReservedContentHeight: i,
|
|
3565
|
+
reservedContentHeight: t
|
|
3566
|
+
};
|
|
3567
|
+
}
|
|
3568
|
+
//#endregion
|
|
3104
3569
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
3105
|
-
var
|
|
3106
|
-
function
|
|
3107
|
-
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth ||
|
|
3570
|
+
var pi = 600, mi = 24, hi = 16, gi = 300, _i = 200, vi = 0, yi = mi + hi, bi = 200, xi = 500, Si = 1e3;
|
|
3571
|
+
function Ci(e) {
|
|
3572
|
+
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || gi), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = si(), p = i(() => Math.max(gi, a.value - mi * 2)), m = i(() => Er(p.value, gi)), h = i(() => Dr(p.value, m.value, gi, hi)), g = i(() => ti(e.bottomLoadBufferPx.value)), v = i(() => wi(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Ar({
|
|
3108
3573
|
itemCount: e.items.value.length,
|
|
3109
3574
|
viewportHeight: r.value,
|
|
3110
3575
|
scrollTop: n.value,
|
|
3111
|
-
overscanPx:
|
|
3112
|
-
bucketPx:
|
|
3576
|
+
overscanPx: _i,
|
|
3577
|
+
bucketPx: pi,
|
|
3113
3578
|
buckets: c.value
|
|
3114
3579
|
})), b = i(() => y.value.map((t) => ({
|
|
3115
3580
|
item: e.items.value[t],
|
|
3116
3581
|
index: t
|
|
3117
3582
|
}))), C = i(() => {
|
|
3118
|
-
let e = l.value +
|
|
3119
|
-
return Math.max(e, t, r.value) +
|
|
3120
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() =>
|
|
3583
|
+
let e = l.value + mi * 2, t = P.reservedContentHeight.value ?? 0;
|
|
3584
|
+
return Math.max(e, t, r.value) + bi + g.value;
|
|
3585
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => $r({
|
|
3121
3586
|
active: e.active.value,
|
|
3122
|
-
maxScrollTop:
|
|
3587
|
+
maxScrollTop: Y(),
|
|
3123
3588
|
progressDistancePx: n.value,
|
|
3124
|
-
thresholdPx:
|
|
3589
|
+
thresholdPx: vi,
|
|
3125
3590
|
triggerEnabled: w.value
|
|
3126
|
-
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() =>
|
|
3591
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => Qr({
|
|
3127
3592
|
active: e.active.value,
|
|
3128
|
-
maxScrollTop:
|
|
3593
|
+
maxScrollTop: Y(),
|
|
3129
3594
|
progressDistancePx: n.value,
|
|
3130
|
-
thresholdPx:
|
|
3595
|
+
thresholdPx: yi,
|
|
3131
3596
|
triggerEnabled: e.hasPreviousPage.value
|
|
3132
|
-
})), k =
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
}),
|
|
3137
|
-
if (!A.value) return ei;
|
|
3138
|
-
let e = Math.max(0, C.value - r.value);
|
|
3139
|
-
return ei + Math.max(0, k.value - j.value) * (e > 0 ? ai(n.value / e, 0, 1) : 0);
|
|
3140
|
-
}), N = Fr({
|
|
3597
|
+
})), k = ei({
|
|
3598
|
+
containerHeight: C,
|
|
3599
|
+
scrollTop: n,
|
|
3600
|
+
viewportHeight: r
|
|
3601
|
+
}), A = Hr({
|
|
3141
3602
|
items: e.items,
|
|
3142
3603
|
visibleIndices: y,
|
|
3143
3604
|
positions: o,
|
|
3144
3605
|
heights: s,
|
|
3145
3606
|
indexById: u,
|
|
3146
|
-
columnWidth:
|
|
3607
|
+
columnWidth: h,
|
|
3147
3608
|
scrollTop: n,
|
|
3148
3609
|
viewportHeight: r
|
|
3149
|
-
}),
|
|
3610
|
+
}), j = oi({
|
|
3150
3611
|
direction: "top",
|
|
3151
3612
|
getAnimationLockMs(e) {
|
|
3152
|
-
return Math.max(
|
|
3613
|
+
return Math.max(xi, zr(e)) + Si;
|
|
3153
3614
|
},
|
|
3154
3615
|
hasPage: e.hasPreviousPage,
|
|
3155
|
-
interactionLocked:
|
|
3616
|
+
interactionLocked: f.isBoundaryInteractionLocked,
|
|
3156
3617
|
isAtBoundary() {
|
|
3157
|
-
return n.value <=
|
|
3618
|
+
return n.value <= yi;
|
|
3158
3619
|
},
|
|
3159
3620
|
loading: e.loading,
|
|
3160
3621
|
requestPage: e.requestPreviousPage
|
|
3161
|
-
}),
|
|
3622
|
+
}), M = oi({
|
|
3162
3623
|
direction: "bottom",
|
|
3163
3624
|
getAnimationLockMs(e) {
|
|
3164
|
-
return
|
|
3625
|
+
return zr(e) + Si;
|
|
3165
3626
|
},
|
|
3166
3627
|
hasPage: w,
|
|
3167
|
-
interactionLocked:
|
|
3628
|
+
interactionLocked: f.isBoundaryInteractionLocked,
|
|
3168
3629
|
isAtBoundary() {
|
|
3169
|
-
return
|
|
3630
|
+
return J() <= vi;
|
|
3170
3631
|
},
|
|
3171
3632
|
loading: e.loading,
|
|
3172
3633
|
requestPage: e.requestNextPage
|
|
3173
|
-
}),
|
|
3634
|
+
}), N = Zr({
|
|
3635
|
+
active: e.active,
|
|
3636
|
+
getMaxScrollTop: Y,
|
|
3637
|
+
getViewport: () => t.value,
|
|
3638
|
+
onScroll: z
|
|
3639
|
+
}), P = fi({
|
|
3640
|
+
bucketPx: pi,
|
|
3641
|
+
columnCount: m,
|
|
3642
|
+
columnWidth: h,
|
|
3643
|
+
commitPendingAppend: e.commitPendingAppend,
|
|
3644
|
+
contentInsetPx: mi,
|
|
3645
|
+
gapPx: hi,
|
|
3646
|
+
items: e.items,
|
|
3647
|
+
pendingAppendItems: e.pendingAppendItems
|
|
3648
|
+
}), F = null, I = 0;
|
|
3174
3649
|
L([
|
|
3175
3650
|
() => e.items.value,
|
|
3176
|
-
|
|
3177
|
-
|
|
3651
|
+
m,
|
|
3652
|
+
h
|
|
3178
3653
|
], async ([t], [r = []]) => {
|
|
3179
|
-
let i =
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3654
|
+
let i = ci({
|
|
3655
|
+
activeIndex: v.value,
|
|
3656
|
+
contentInsetPx: mi,
|
|
3657
|
+
currentItems: t,
|
|
3658
|
+
gapPx: hi,
|
|
3659
|
+
layoutHeights: s.value,
|
|
3660
|
+
layoutIndexById: u.value,
|
|
3661
|
+
layoutPositions: o.value,
|
|
3662
|
+
previousItems: r ?? [],
|
|
3663
|
+
scrollTop: n.value
|
|
3664
|
+
});
|
|
3665
|
+
i.shouldLockBoundaryInteractionForRemoval && f.lockBoundaryInteraction(Br() + Si), i.shouldResetScrollForEmptyRemoval && H(), R(), i.removedItems.length > 0 && A.markLeave(i.removedItems), i.addedItems.length > 0 && (A.markEnter(i.addedItems, i.isPrepend ? "top" : "bottom"), i.isPrepend ? j.onItemsMutated(i.addedItems.length) : M.onItemsMutated(i.addedItems.length)), A.playFlipMoveAnimation(i.oldPositionsById, new Set(i.addedItems.map((e) => Q(e))), i.isPrepend ? xi : void 0), i.anchorId ? (await _(), V(i.anchorId, i.oldPositionsById)) : e.active.value && i.previousIds.length > 0 && W();
|
|
3190
3666
|
}, { immediate: !0 }), L([
|
|
3191
|
-
() => e.pendingAppendItems.value.map((e) =>
|
|
3667
|
+
() => e.pendingAppendItems.value.map((e) => Q(e)),
|
|
3668
|
+
m,
|
|
3192
3669
|
h,
|
|
3193
|
-
g,
|
|
3194
3670
|
r
|
|
3195
|
-
], (
|
|
3196
|
-
de(), t.length && (d.value = le([...e.items.value, ...e.pendingAppendItems.value]), X());
|
|
3197
|
-
}, { immediate: !0 }), L(() => e.active.value, async (e, i) => {
|
|
3671
|
+
], () => P.refreshReservedContentHeight(), { immediate: !0 }), L(() => e.active.value, async (e, i) => {
|
|
3198
3672
|
let a = t.value;
|
|
3199
|
-
if (!a) return;
|
|
3200
3673
|
if (!e) {
|
|
3201
|
-
|
|
3674
|
+
a && (d.value = a.scrollTop), N.stop();
|
|
3202
3675
|
return;
|
|
3203
3676
|
}
|
|
3204
|
-
if (i !== !1 ||
|
|
3677
|
+
if (N.start(), !a || i !== !1 || d.value == null) return;
|
|
3205
3678
|
await _();
|
|
3206
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
3207
|
-
a.scrollTop = s, n.value = s,
|
|
3208
|
-
}), L(() => e.loading.value, async (
|
|
3209
|
-
|
|
3679
|
+
let o = Math.max(0, C.value - r.value), s = wi(d.value, 0, o);
|
|
3680
|
+
a.scrollTop = s, n.value = s, j.syncBoundary(), M.syncBoundary();
|
|
3681
|
+
}), L(() => e.loading.value, async (e) => {
|
|
3682
|
+
P.clearReservedHeightWhenIdle(e), j.onLoadingChange(e), M.onLoadingChange(e), await _();
|
|
3210
3683
|
}), S(async () => {
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
}), t.value &&
|
|
3684
|
+
G(), await _(), v.value > 0 ? B(v.value, "center") : U(), j.syncBoundary(), M.syncBoundary(), typeof ResizeObserver < "u" ? (F = new ResizeObserver(() => {
|
|
3685
|
+
G();
|
|
3686
|
+
}), t.value && F.observe(t.value)) : window.addEventListener("resize", G);
|
|
3214
3687
|
}), x(() => {
|
|
3215
|
-
|
|
3688
|
+
F?.disconnect(), F = null, window.removeEventListener("resize", G), P.clearAppendCommitTimer(), f.clearBoundaryInteractionReleaseTimer(), I &&= (cancelAnimationFrame(I), 0), N.stop();
|
|
3216
3689
|
});
|
|
3217
|
-
function
|
|
3218
|
-
let t =
|
|
3219
|
-
columnCount:
|
|
3220
|
-
columnWidth:
|
|
3221
|
-
gapX:
|
|
3222
|
-
gapY:
|
|
3223
|
-
bucketPx:
|
|
3690
|
+
function R() {
|
|
3691
|
+
let t = kr(e.items.value, {
|
|
3692
|
+
columnCount: m.value,
|
|
3693
|
+
columnWidth: h.value,
|
|
3694
|
+
gapX: hi,
|
|
3695
|
+
gapY: hi,
|
|
3696
|
+
bucketPx: pi
|
|
3224
3697
|
});
|
|
3225
3698
|
o.value = t.positions.map((e) => ({
|
|
3226
|
-
x: e.x +
|
|
3227
|
-
y: e.y +
|
|
3699
|
+
x: e.x + mi,
|
|
3700
|
+
y: e.y + mi
|
|
3228
3701
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
3229
3702
|
}
|
|
3230
|
-
function
|
|
3231
|
-
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value =
|
|
3232
|
-
|
|
3703
|
+
function z() {
|
|
3704
|
+
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = K(), j.syncBoundary(), M.syncBoundary(), ne(), !W() && (I ||= requestAnimationFrame(() => {
|
|
3705
|
+
I = 0, U();
|
|
3233
3706
|
})));
|
|
3234
3707
|
}
|
|
3235
|
-
function
|
|
3236
|
-
e.active.value && (
|
|
3708
|
+
function ee(t) {
|
|
3709
|
+
e.active.value && (j.onWheel(t), M.onWheel(t), ne());
|
|
3237
3710
|
}
|
|
3238
|
-
function
|
|
3239
|
-
let n = e.items.value[t], r = n ?
|
|
3711
|
+
function te(t) {
|
|
3712
|
+
let n = e.items.value[t], r = n ? Q(n) : "";
|
|
3240
3713
|
return {
|
|
3241
|
-
height: `${s.value[t] ??
|
|
3242
|
-
width: `${
|
|
3243
|
-
transition: r ?
|
|
3244
|
-
transitionDelay: r ?
|
|
3245
|
-
transform:
|
|
3714
|
+
height: `${s.value[t] ?? h.value}px`,
|
|
3715
|
+
width: `${h.value}px`,
|
|
3716
|
+
transition: r ? A.getCardTransition(r) : void 0,
|
|
3717
|
+
transitionDelay: r ? A.getCardTransitionDelay(r) : void 0,
|
|
3718
|
+
transform: A.getCardTransform(t)
|
|
3246
3719
|
};
|
|
3247
3720
|
}
|
|
3248
|
-
function
|
|
3721
|
+
function B(e, i) {
|
|
3249
3722
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
3250
3723
|
if (!a || !c || !l) return;
|
|
3251
3724
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
3252
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
3725
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - mi : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + mi), a.scrollTop = wi(u, 0, d), n.value = a.scrollTop, U();
|
|
3253
3726
|
}
|
|
3254
|
-
function
|
|
3727
|
+
function V(e, r) {
|
|
3255
3728
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
3256
3729
|
if (!i || !a || !c) return;
|
|
3257
3730
|
let l = c.y - a.y;
|
|
3258
3731
|
i.scrollTop += l, n.value = i.scrollTop;
|
|
3259
3732
|
}
|
|
3260
|
-
function
|
|
3733
|
+
function H() {
|
|
3261
3734
|
let e = t.value;
|
|
3262
3735
|
if (!e) {
|
|
3263
3736
|
n.value = 0;
|
|
3264
3737
|
return;
|
|
3265
3738
|
}
|
|
3266
|
-
e.scrollTop = 0, n.value = 0,
|
|
3267
|
-
}
|
|
3268
|
-
function K(e) {
|
|
3269
|
-
fe(), p.value = !0, B = setTimeout(() => {
|
|
3270
|
-
B = null, p.value = !1;
|
|
3271
|
-
}, Math.max(0, e));
|
|
3739
|
+
e.scrollTop = 0, n.value = 0, j.syncBoundary(), M.syncBoundary();
|
|
3272
3740
|
}
|
|
3273
|
-
function
|
|
3274
|
-
if (!y.value.length ||
|
|
3741
|
+
function U() {
|
|
3742
|
+
if (!y.value.length || W()) return;
|
|
3275
3743
|
let t = n.value + r.value / 2, i = v.value, a = Infinity;
|
|
3276
3744
|
for (let e of y.value) {
|
|
3277
3745
|
let n = o.value[e], r = s.value[e];
|
|
@@ -3281,109 +3749,60 @@ function ii(e) {
|
|
|
3281
3749
|
}
|
|
3282
3750
|
e.setActiveIndex(i);
|
|
3283
3751
|
}
|
|
3284
|
-
function
|
|
3285
|
-
let t = n.value <=
|
|
3752
|
+
function W() {
|
|
3753
|
+
let t = n.value <= yi, r = J() <= vi;
|
|
3286
3754
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
3287
3755
|
}
|
|
3288
|
-
function
|
|
3289
|
-
|
|
3756
|
+
function ne() {
|
|
3757
|
+
j.maybeRequestPage(), M.maybeRequestPage();
|
|
3290
3758
|
}
|
|
3291
|
-
function
|
|
3292
|
-
r.value =
|
|
3759
|
+
function G() {
|
|
3760
|
+
r.value = K(), a.value = q();
|
|
3293
3761
|
}
|
|
3294
|
-
function
|
|
3295
|
-
return
|
|
3762
|
+
function K() {
|
|
3763
|
+
return Gr(t.value, r.value);
|
|
3296
3764
|
}
|
|
3297
|
-
function
|
|
3298
|
-
return
|
|
3765
|
+
function q() {
|
|
3766
|
+
return Kr(t.value, a.value, gi);
|
|
3299
3767
|
}
|
|
3300
|
-
function
|
|
3301
|
-
return
|
|
3768
|
+
function J() {
|
|
3769
|
+
return qr(t.value, n.value, r.value, C.value);
|
|
3302
3770
|
}
|
|
3303
|
-
function
|
|
3771
|
+
function Y() {
|
|
3304
3772
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
3305
3773
|
return Math.max(0, e - r.value);
|
|
3306
3774
|
}
|
|
3307
|
-
function ce() {
|
|
3308
|
-
return Vr(j.value, M.value);
|
|
3309
|
-
}
|
|
3310
|
-
function le(e) {
|
|
3311
|
-
return e.length ? xr(e, {
|
|
3312
|
-
columnCount: h.value,
|
|
3313
|
-
columnWidth: g.value,
|
|
3314
|
-
gapX: qr,
|
|
3315
|
-
gapY: qr,
|
|
3316
|
-
bucketPx: Gr
|
|
3317
|
-
}).contentHeight + Kr * 2 : 0;
|
|
3318
|
-
}
|
|
3319
|
-
function ue(e) {
|
|
3320
|
-
let t = /* @__PURE__ */ new Map();
|
|
3321
|
-
for (let n of e) {
|
|
3322
|
-
let e = $(n), r = u.value.get(e);
|
|
3323
|
-
if (r == null) continue;
|
|
3324
|
-
let i = s.value[r];
|
|
3325
|
-
i != null && t.set(e, i);
|
|
3326
|
-
}
|
|
3327
|
-
return t;
|
|
3328
|
-
}
|
|
3329
|
-
function X() {
|
|
3330
|
-
let t = e.commitPendingAppend.value;
|
|
3331
|
-
typeof t == "function" && (z = setTimeout(async () => {
|
|
3332
|
-
z = null, ee = !0;
|
|
3333
|
-
try {
|
|
3334
|
-
if (!e.pendingAppendItems.value.length) return;
|
|
3335
|
-
await t(), await _(), await _();
|
|
3336
|
-
} finally {
|
|
3337
|
-
d.value = null, ee = !1;
|
|
3338
|
-
}
|
|
3339
|
-
}, $r));
|
|
3340
|
-
}
|
|
3341
|
-
function de() {
|
|
3342
|
-
z &&= (clearTimeout(z), null);
|
|
3343
|
-
}
|
|
3344
|
-
function fe() {
|
|
3345
|
-
B && (clearTimeout(B), B = null, p.value = !1);
|
|
3346
|
-
}
|
|
3347
3775
|
return {
|
|
3348
|
-
|
|
3776
|
+
autoScroll: N.autoScroll,
|
|
3777
|
+
columnWidth: h,
|
|
3349
3778
|
containerHeight: C,
|
|
3350
|
-
getCardStyle:
|
|
3351
|
-
getLeavingCardStyle:
|
|
3352
|
-
getScrollbarThumbStyle:
|
|
3353
|
-
leavingItems:
|
|
3779
|
+
getCardStyle: te,
|
|
3780
|
+
getLeavingCardStyle: A.getLeavingCardStyle,
|
|
3781
|
+
getScrollbarThumbStyle: k.getScrollbarThumbStyle,
|
|
3782
|
+
leavingItems: A.leavingItems,
|
|
3354
3783
|
nextBoundaryLoadProgress: T,
|
|
3355
|
-
onScroll:
|
|
3356
|
-
onWheel:
|
|
3784
|
+
onScroll: z,
|
|
3785
|
+
onWheel: ee,
|
|
3357
3786
|
paginationLabel: E,
|
|
3358
3787
|
previousBoundaryLoadProgress: O,
|
|
3359
3788
|
renderedItems: b,
|
|
3360
3789
|
resolvedActiveIndex: v,
|
|
3361
|
-
scrollToIndex:
|
|
3362
|
-
showScrollbar:
|
|
3790
|
+
scrollToIndex: B,
|
|
3791
|
+
showScrollbar: k.showScrollbar,
|
|
3363
3792
|
scrollViewportRef: t
|
|
3364
3793
|
};
|
|
3365
3794
|
}
|
|
3366
|
-
function
|
|
3795
|
+
function wi(e, t, n) {
|
|
3367
3796
|
return Math.min(Math.max(e, t), n);
|
|
3368
3797
|
}
|
|
3369
|
-
function oi(e) {
|
|
3370
|
-
if (!e.active || !e.triggerEnabled) return 0;
|
|
3371
|
-
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3372
|
-
return t <= 0 ? 1 : ai(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
3373
|
-
}
|
|
3374
|
-
function si(e) {
|
|
3375
|
-
if (!e.active || !e.triggerEnabled) return 0;
|
|
3376
|
-
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3377
|
-
return t <= 0 ? 1 : ai(e.progressDistancePx / t, 0, 1);
|
|
3378
|
-
}
|
|
3379
3798
|
//#endregion
|
|
3380
3799
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
3381
|
-
function
|
|
3800
|
+
function Ti(e) {
|
|
3382
3801
|
if (e) try {
|
|
3383
3802
|
e.removeAttribute("src"), e.src = "";
|
|
3384
3803
|
} catch {}
|
|
3385
3804
|
}
|
|
3386
|
-
function
|
|
3805
|
+
function Ei(e) {
|
|
3387
3806
|
if (e) {
|
|
3388
3807
|
try {
|
|
3389
3808
|
e.currentTime = 0;
|
|
@@ -3394,12 +3813,12 @@ function li(e) {
|
|
|
3394
3813
|
} catch {}
|
|
3395
3814
|
}
|
|
3396
3815
|
}
|
|
3397
|
-
function
|
|
3816
|
+
function Di(e, t) {
|
|
3398
3817
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
3399
3818
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
3400
3819
|
return e.bottom > 0 && e.top < n;
|
|
3401
3820
|
}
|
|
3402
|
-
function
|
|
3821
|
+
function Oi(e) {
|
|
3403
3822
|
if (!e) return null;
|
|
3404
3823
|
try {
|
|
3405
3824
|
return new URL(e, window.location.href).href;
|
|
@@ -3409,9 +3828,9 @@ function di(e) {
|
|
|
3409
3828
|
}
|
|
3410
3829
|
//#endregion
|
|
3411
3830
|
//#region src/components/viewer-core/listPreview.ts
|
|
3412
|
-
var
|
|
3413
|
-
function
|
|
3414
|
-
let t =
|
|
3831
|
+
var ki = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, Ai = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, ji = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3832
|
+
function Mi(e) {
|
|
3833
|
+
let t = Ni(e), n = t?.url, r = Tr(e), i = e.title?.trim() || Ht(e.type);
|
|
3415
3834
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
3416
3835
|
kind: "video",
|
|
3417
3836
|
url: n,
|
|
@@ -3430,13 +3849,13 @@ function hi(e) {
|
|
|
3430
3849
|
width: r.width,
|
|
3431
3850
|
height: r.height,
|
|
3432
3851
|
label: i
|
|
3433
|
-
} : typeof n == "string" &&
|
|
3852
|
+
} : typeof n == "string" && Fi(e, n) ? {
|
|
3434
3853
|
kind: "video",
|
|
3435
3854
|
url: n,
|
|
3436
3855
|
width: r.width,
|
|
3437
3856
|
height: r.height,
|
|
3438
3857
|
label: i
|
|
3439
|
-
} : typeof n == "string" &&
|
|
3858
|
+
} : typeof n == "string" && Pi(e, n) ? {
|
|
3440
3859
|
kind: "image",
|
|
3441
3860
|
url: n,
|
|
3442
3861
|
width: r.width,
|
|
@@ -3450,26 +3869,26 @@ function hi(e) {
|
|
|
3450
3869
|
label: i
|
|
3451
3870
|
};
|
|
3452
3871
|
}
|
|
3453
|
-
function
|
|
3872
|
+
function Ni(e) {
|
|
3454
3873
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3455
3874
|
}
|
|
3456
|
-
function
|
|
3457
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
3875
|
+
function Pi(e, t) {
|
|
3876
|
+
return e.type !== "image" || typeof t != "string" ? !1 : ki.test(t) || Ii(t);
|
|
3458
3877
|
}
|
|
3459
|
-
function
|
|
3460
|
-
return e.type !== "video" || typeof t != "string" ? !1 :
|
|
3878
|
+
function Fi(e, t) {
|
|
3879
|
+
return e.type !== "video" || typeof t != "string" ? !1 : Ai.test(t) || Li(t);
|
|
3461
3880
|
}
|
|
3462
|
-
function
|
|
3881
|
+
function Ii(e) {
|
|
3463
3882
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3464
3883
|
}
|
|
3465
|
-
function
|
|
3466
|
-
return
|
|
3884
|
+
function Li(e) {
|
|
3885
|
+
return ji.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3467
3886
|
}
|
|
3468
3887
|
//#endregion
|
|
3469
3888
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3470
|
-
function
|
|
3889
|
+
function Ri(e) {
|
|
3471
3890
|
let t = D(null), n = i(() => {
|
|
3472
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3891
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? Oi(e.item.value.healthCheck.url) : null;
|
|
3473
3892
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3474
3893
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3475
3894
|
L(n, (e, n) => {
|
|
@@ -3501,7 +3920,7 @@ function xi(e) {
|
|
|
3501
3920
|
r.refresh();
|
|
3502
3921
|
return;
|
|
3503
3922
|
}
|
|
3504
|
-
r =
|
|
3923
|
+
r = Wt.request({
|
|
3505
3924
|
assetType: "probe",
|
|
3506
3925
|
getPriority: e.getPriority,
|
|
3507
3926
|
onGrant() {
|
|
@@ -3511,7 +3930,7 @@ function xi(e) {
|
|
|
3511
3930
|
return;
|
|
3512
3931
|
}
|
|
3513
3932
|
let i = ++a;
|
|
3514
|
-
|
|
3933
|
+
vn(r).then((s) => {
|
|
3515
3934
|
if (!(i !== a || n.value !== r)) {
|
|
3516
3935
|
if (o.set(r, s ?? null), !s) {
|
|
3517
3936
|
t.value = null;
|
|
@@ -3519,7 +3938,7 @@ function xi(e) {
|
|
|
3519
3938
|
}
|
|
3520
3939
|
t.value = s, e.reportAssetError?.({
|
|
3521
3940
|
item: e.item.value,
|
|
3522
|
-
occurrenceKey:
|
|
3941
|
+
occurrenceKey: Q(e.item.value),
|
|
3523
3942
|
url: r,
|
|
3524
3943
|
kind: s,
|
|
3525
3944
|
surface: "grid"
|
|
@@ -3547,14 +3966,14 @@ function xi(e) {
|
|
|
3547
3966
|
}
|
|
3548
3967
|
//#endregion
|
|
3549
3968
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3550
|
-
var
|
|
3969
|
+
var zi = ["aria-label"], Bi = {
|
|
3551
3970
|
key: 0,
|
|
3552
3971
|
"data-testid": "vibe-list-card-spinner",
|
|
3553
3972
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3554
|
-
},
|
|
3973
|
+
}, Vi = { 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]" }, Hi = ["src", "alt"], Ui = ["src"], Wi = ["data-kind"], Gi = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ki = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, qi = {
|
|
3555
3974
|
key: 4,
|
|
3556
3975
|
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))]"
|
|
3557
|
-
},
|
|
3976
|
+
}, Ji = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Yi = { class: "pointer-events-none absolute inset-0 z-[3]" }, Xi = /* @__PURE__ */ d({
|
|
3558
3977
|
__name: "ListCard",
|
|
3559
3978
|
props: {
|
|
3560
3979
|
active: {
|
|
@@ -3578,7 +3997,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3578
3997
|
},
|
|
3579
3998
|
emits: ["open"],
|
|
3580
3999
|
setup(e, { emit: t }) {
|
|
3581
|
-
let n = e, r = t, l = i(() =>
|
|
4000
|
+
let n = e, r = t, l = i(() => Mi(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = Ri({
|
|
3582
4001
|
attachedAssetUrl: E,
|
|
3583
4002
|
getPriority: ue,
|
|
3584
4003
|
isInView: d,
|
|
@@ -3587,7 +4006,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3587
4006
|
loadErrorKind: g,
|
|
3588
4007
|
reportAssetError: n.reportAssetError,
|
|
3589
4008
|
surfaceActive: i(() => n.surfaceActive)
|
|
3590
|
-
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() =>
|
|
4009
|
+
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => gn(I.value)), ee = i(() => O.value && !g.value && (!T.value || !m.value)), B = null, V = null, H = /* @__PURE__ */ new Set();
|
|
3591
4010
|
L([E, () => l.value.kind], () => {
|
|
3592
4011
|
let e = l.value.kind === "fallback";
|
|
3593
4012
|
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
@@ -3601,66 +4020,66 @@ var Si = ["aria-label"], Ci = {
|
|
|
3601
4020
|
q();
|
|
3602
4021
|
}), L(() => n.surfaceActive, (e) => {
|
|
3603
4022
|
if (!e) {
|
|
3604
|
-
|
|
4023
|
+
Y(), q();
|
|
3605
4024
|
return;
|
|
3606
4025
|
}
|
|
3607
4026
|
requestAnimationFrame(() => {
|
|
3608
|
-
|
|
4027
|
+
re(), K(), q();
|
|
3609
4028
|
});
|
|
3610
4029
|
}), S(() => {
|
|
3611
4030
|
if (!y.value || typeof IntersectionObserver > "u") {
|
|
3612
4031
|
b.value = null, d.value = !0, K();
|
|
3613
4032
|
return;
|
|
3614
4033
|
}
|
|
3615
|
-
b.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"),
|
|
3616
|
-
for (let t of e) t.target === y.value && (n.surfaceActive &&
|
|
4034
|
+
b.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"), B = new IntersectionObserver((e) => {
|
|
4035
|
+
for (let t of e) t.target === y.value && (n.surfaceActive && re(t), K(), q());
|
|
3617
4036
|
}, {
|
|
3618
4037
|
root: b.value,
|
|
3619
4038
|
threshold: [0, 1]
|
|
3620
|
-
}),
|
|
4039
|
+
}), B.observe(y.value);
|
|
3621
4040
|
}), x(() => {
|
|
3622
|
-
|
|
4041
|
+
J(), F.release(), B?.disconnect(), B = null;
|
|
3623
4042
|
});
|
|
3624
4043
|
function U() {
|
|
3625
|
-
X(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url),
|
|
4044
|
+
X(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), Y());
|
|
3626
4045
|
}
|
|
3627
4046
|
async function W() {
|
|
3628
4047
|
if (!X(_.value)) return;
|
|
3629
4048
|
let e = E.value ?? n.item.url;
|
|
3630
4049
|
m.value = !1, g.value = "generic";
|
|
3631
|
-
let t = await
|
|
4050
|
+
let t = await _n(e);
|
|
3632
4051
|
g.value = t, n.reportAssetError?.({
|
|
3633
4052
|
item: n.item,
|
|
3634
|
-
occurrenceKey:
|
|
4053
|
+
occurrenceKey: Q(n.item),
|
|
3635
4054
|
url: e,
|
|
3636
4055
|
kind: t,
|
|
3637
4056
|
surface: "grid"
|
|
3638
|
-
}),
|
|
4057
|
+
}), Y();
|
|
3639
4058
|
}
|
|
3640
4059
|
function ne() {
|
|
3641
|
-
X(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url),
|
|
4060
|
+
X(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), Y(), q());
|
|
3642
4061
|
}
|
|
3643
4062
|
function G() {
|
|
3644
4063
|
X(C.value) && (h.value || (m.value = !1));
|
|
3645
4064
|
}
|
|
3646
4065
|
function K() {
|
|
3647
4066
|
if (l.value.kind === "fallback") {
|
|
3648
|
-
|
|
4067
|
+
J(!1);
|
|
3649
4068
|
return;
|
|
3650
4069
|
}
|
|
3651
4070
|
if (!n.surfaceActive) {
|
|
3652
|
-
|
|
4071
|
+
Y();
|
|
3653
4072
|
return;
|
|
3654
4073
|
}
|
|
3655
4074
|
if (!O.value) {
|
|
3656
|
-
|
|
4075
|
+
J();
|
|
3657
4076
|
return;
|
|
3658
4077
|
}
|
|
3659
4078
|
if (T.value || V) {
|
|
3660
4079
|
V?.refresh();
|
|
3661
4080
|
return;
|
|
3662
4081
|
}
|
|
3663
|
-
V =
|
|
4082
|
+
V = Wt.request({
|
|
3664
4083
|
assetType: l.value.kind,
|
|
3665
4084
|
getPriority: ue,
|
|
3666
4085
|
onGrant() {
|
|
@@ -3677,7 +4096,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3677
4096
|
return;
|
|
3678
4097
|
}
|
|
3679
4098
|
if (E.value && d.value && m.value) {
|
|
3680
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
4099
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, xn(e);
|
|
3681
4100
|
return;
|
|
3682
4101
|
}
|
|
3683
4102
|
try {
|
|
@@ -3686,23 +4105,23 @@ var Si = ["aria-label"], Ci = {
|
|
|
3686
4105
|
e.pause();
|
|
3687
4106
|
}
|
|
3688
4107
|
}
|
|
3689
|
-
function
|
|
3690
|
-
T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (se(), ce()),
|
|
4108
|
+
function J(e = !0) {
|
|
4109
|
+
T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (se(), ce()), Y();
|
|
3691
4110
|
}
|
|
3692
|
-
function
|
|
4111
|
+
function Y() {
|
|
3693
4112
|
V?.release(), V = null;
|
|
3694
4113
|
}
|
|
3695
|
-
function
|
|
4114
|
+
function re(e) {
|
|
3696
4115
|
let t = y.value;
|
|
3697
4116
|
if (!t) {
|
|
3698
4117
|
d.value = !0;
|
|
3699
4118
|
return;
|
|
3700
4119
|
}
|
|
3701
|
-
d.value =
|
|
4120
|
+
d.value = Di(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3702
4121
|
}
|
|
3703
4122
|
function ie(e) {
|
|
3704
4123
|
if (!e) return;
|
|
3705
|
-
let t =
|
|
4124
|
+
let t = Q(n.item), r = `${t}|${e}`;
|
|
3706
4125
|
H.has(r) || (H.add(r), n.reportAssetLoad?.({
|
|
3707
4126
|
item: n.item,
|
|
3708
4127
|
occurrenceKey: t,
|
|
@@ -3712,16 +4131,16 @@ var Si = ["aria-label"], Ci = {
|
|
|
3712
4131
|
}
|
|
3713
4132
|
function ae() {
|
|
3714
4133
|
if (!z.value || F.retry()) return;
|
|
3715
|
-
let e =
|
|
4134
|
+
let e = Q(n.item);
|
|
3716
4135
|
H.forEach((t) => {
|
|
3717
4136
|
t.startsWith(`${e}|`) && H.delete(t);
|
|
3718
|
-
}), g.value = null, m.value = !1, T.value = !1,
|
|
4137
|
+
}), g.value = null, m.value = !1, T.value = !1, Y(), K();
|
|
3719
4138
|
}
|
|
3720
4139
|
function se() {
|
|
3721
|
-
|
|
4140
|
+
Ti(_.value);
|
|
3722
4141
|
}
|
|
3723
4142
|
function ce() {
|
|
3724
|
-
|
|
4143
|
+
Ei(C.value);
|
|
3725
4144
|
}
|
|
3726
4145
|
function ue() {
|
|
3727
4146
|
let e = y.value;
|
|
@@ -3735,8 +4154,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
3735
4154
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3736
4155
|
}
|
|
3737
4156
|
function X(e) {
|
|
3738
|
-
let t =
|
|
3739
|
-
return !e || !t ? !1 :
|
|
4157
|
+
let t = Oi(E.value);
|
|
4158
|
+
return !e || !t ? !1 : Oi("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3740
4159
|
}
|
|
3741
4160
|
function de() {
|
|
3742
4161
|
r("open");
|
|
@@ -3744,7 +4163,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3744
4163
|
function fe() {
|
|
3745
4164
|
f.value = !0;
|
|
3746
4165
|
}
|
|
3747
|
-
function
|
|
4166
|
+
function pe(e) {
|
|
3748
4167
|
let t = e.relatedTarget;
|
|
3749
4168
|
y.value && t instanceof Node && y.value.contains(t) || (f.value = !1);
|
|
3750
4169
|
}
|
|
@@ -3754,7 +4173,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3754
4173
|
"data-testid": "vibe-list-card-inner",
|
|
3755
4174
|
class: v(["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"]),
|
|
3756
4175
|
onFocusin: fe,
|
|
3757
|
-
onFocusout:
|
|
4176
|
+
onFocusout: pe,
|
|
3758
4177
|
onPointerenter: t[0] ||= (e) => p.value = !0,
|
|
3759
4178
|
onPointerleave: t[1] ||= (e) => p.value = !1
|
|
3760
4179
|
}, [
|
|
@@ -3764,8 +4183,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
3764
4183
|
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]",
|
|
3765
4184
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3766
4185
|
onClick: de
|
|
3767
|
-
}, null, 8,
|
|
3768
|
-
|
|
4186
|
+
}, null, 8, zi),
|
|
4187
|
+
ee.value ? (w(), s("div", Bi, [c("span", Vi, [u(N(oe), {
|
|
3769
4188
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3770
4189
|
"aria-hidden": "true"
|
|
3771
4190
|
})])])) : o("", !0),
|
|
@@ -3779,7 +4198,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3779
4198
|
class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3780
4199
|
onLoad: U,
|
|
3781
4200
|
onError: W
|
|
3782
|
-
}, null, 42,
|
|
4201
|
+
}, null, 42, Hi)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3783
4202
|
key: 2,
|
|
3784
4203
|
ref_key: "videoRef",
|
|
3785
4204
|
ref: C,
|
|
@@ -3795,31 +4214,31 @@ var Si = ["aria-label"], Ci = {
|
|
|
3795
4214
|
onPlaying: ne,
|
|
3796
4215
|
onStalled: G,
|
|
3797
4216
|
onWaiting: G
|
|
3798
|
-
}, null, 42,
|
|
4217
|
+
}, null, 42, Ui)) : R.value ? (w(), s("div", {
|
|
3799
4218
|
key: 3,
|
|
3800
4219
|
"data-testid": "vibe-list-card-error",
|
|
3801
4220
|
"data-kind": I.value,
|
|
3802
4221
|
class: "pointer-events-none relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
|
|
3803
|
-
}, [c("div",
|
|
4222
|
+
}, [c("div", Gi, [
|
|
3804
4223
|
u(N(le), {
|
|
3805
4224
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3806
4225
|
"aria-hidden": "true"
|
|
3807
4226
|
}),
|
|
3808
|
-
c("span",
|
|
4227
|
+
c("span", Ki, j(N(hn)(I.value)), 1),
|
|
3809
4228
|
z.value ? (w(), s("button", {
|
|
3810
4229
|
key: 0,
|
|
3811
4230
|
type: "button",
|
|
3812
4231
|
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",
|
|
3813
|
-
onClick:
|
|
4232
|
+
onClick: te(ae, ["stop"])
|
|
3814
4233
|
}, " Retry ")) : o("", !0)
|
|
3815
|
-
])], 8,
|
|
3816
|
-
icon: N(
|
|
4234
|
+
])], 8, Wi)) : (w(), s("div", qi, [c("div", Ji, [k(e.$slots, "item-icon", {
|
|
4235
|
+
icon: N(Vt)(n.item.type),
|
|
3817
4236
|
item: n.item
|
|
3818
|
-
}, () => [(w(), a(A(N(
|
|
4237
|
+
}, () => [(w(), a(A(N(Vt)(n.item.type)), {
|
|
3819
4238
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3820
4239
|
"aria-hidden": "true"
|
|
3821
4240
|
}))])])])),
|
|
3822
|
-
c("div",
|
|
4241
|
+
c("div", Yi, [k(e.$slots, "grid-item-overlay", {
|
|
3823
4242
|
active: n.active,
|
|
3824
4243
|
focused: f.value,
|
|
3825
4244
|
hovered: p.value,
|
|
@@ -3829,24 +4248,24 @@ var Si = ["aria-label"], Ci = {
|
|
|
3829
4248
|
})])
|
|
3830
4249
|
], 34));
|
|
3831
4250
|
}
|
|
3832
|
-
}),
|
|
4251
|
+
}), Zi = { 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)]" }, Qi = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, $i = {
|
|
3833
4252
|
"data-testid": "vibe-pagination",
|
|
3834
4253
|
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]"
|
|
3835
|
-
},
|
|
4254
|
+
}, ea = { class: "whitespace-nowrap" }, ta = {
|
|
3836
4255
|
key: 0,
|
|
3837
4256
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3838
|
-
},
|
|
4257
|
+
}, na = [
|
|
3839
4258
|
"data-active",
|
|
3840
4259
|
"data-index",
|
|
3841
4260
|
"data-item-id",
|
|
3842
4261
|
"data-occurrence-key"
|
|
3843
|
-
],
|
|
4262
|
+
], ra = ["data-item-id"], ia = {
|
|
3844
4263
|
key: 0,
|
|
3845
4264
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3846
|
-
},
|
|
4265
|
+
}, aa = {
|
|
3847
4266
|
key: 1,
|
|
3848
4267
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3849
|
-
},
|
|
4268
|
+
}, oa = { class: "mx-auto flex w-full justify-center" }, sa = /* @__PURE__ */ d({
|
|
3850
4269
|
__name: "ListSurface",
|
|
3851
4270
|
props: {
|
|
3852
4271
|
active: {
|
|
@@ -3858,6 +4277,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
3858
4277
|
type: Boolean,
|
|
3859
4278
|
default: !1
|
|
3860
4279
|
},
|
|
4280
|
+
bottomLoadBufferPx: { default: 100 },
|
|
3861
4281
|
commitPendingAppend: {
|
|
3862
4282
|
type: [Function, null],
|
|
3863
4283
|
default: null
|
|
@@ -3906,87 +4326,90 @@ var Si = ["aria-label"], Ci = {
|
|
|
3906
4326
|
"open-fullscreen",
|
|
3907
4327
|
"update:activeIndex"
|
|
3908
4328
|
],
|
|
3909
|
-
setup(e, {
|
|
3910
|
-
let
|
|
3911
|
-
active: M(
|
|
3912
|
-
allowExhaustedNextPageRefresh: M(
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
4329
|
+
setup(e, { expose: n, emit: r }) {
|
|
4330
|
+
let d = e, f = F(), p = r, m = Ci({
|
|
4331
|
+
active: M(d, "active"),
|
|
4332
|
+
allowExhaustedNextPageRefresh: M(d, "allowExhaustedNextPageRefresh"),
|
|
4333
|
+
bottomLoadBufferPx: M(d, "bottomLoadBufferPx"),
|
|
4334
|
+
items: M(d, "items"),
|
|
4335
|
+
activeIndex: M(d, "activeIndex"),
|
|
4336
|
+
loading: M(d, "loading"),
|
|
4337
|
+
hasNextPage: M(d, "hasNextPage"),
|
|
4338
|
+
hasPreviousPage: M(d, "hasPreviousPage"),
|
|
4339
|
+
paginationDetail: M(d, "paginationDetail"),
|
|
4340
|
+
pendingAppendItems: M(d, "pendingAppendItems"),
|
|
4341
|
+
commitPendingAppend: M(d, "commitPendingAppend"),
|
|
4342
|
+
requestNextPage: M(d, "requestNextPage"),
|
|
4343
|
+
requestPreviousPage: M(d, "requestPreviousPage"),
|
|
3923
4344
|
setActiveIndex(e) {
|
|
3924
|
-
|
|
4345
|
+
p("update:activeIndex", e);
|
|
3925
4346
|
}
|
|
3926
|
-
})
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
4347
|
+
});
|
|
4348
|
+
n({ autoScroll: m.autoScroll });
|
|
4349
|
+
let h = i(() => on({
|
|
4350
|
+
itemCount: d.items.length,
|
|
4351
|
+
loading: d.loading,
|
|
4352
|
+
phase: d.phase
|
|
4353
|
+
})), _ = i(() => sn({
|
|
4354
|
+
errorMessage: d.errorMessage,
|
|
4355
|
+
hasItems: d.items.length > 0,
|
|
4356
|
+
hasNextPage: d.hasNextPage,
|
|
4357
|
+
phase: h.value,
|
|
3935
4358
|
surface: "grid"
|
|
3936
|
-
})),
|
|
3937
|
-
activeIndex:
|
|
3938
|
-
kind:
|
|
3939
|
-
loading:
|
|
3940
|
-
message:
|
|
3941
|
-
paginationDetail:
|
|
3942
|
-
total:
|
|
3943
|
-
}),
|
|
3944
|
-
emptyStateMode: M(
|
|
3945
|
-
itemCount:
|
|
3946
|
-
loading: M(
|
|
3947
|
-
renderSlot:
|
|
4359
|
+
})), x = i(() => !d.showStatusBadges || !_.value ? null : {
|
|
4360
|
+
activeIndex: m.resolvedActiveIndex.value,
|
|
4361
|
+
kind: _.value.kind,
|
|
4362
|
+
loading: d.loading,
|
|
4363
|
+
message: _.value.message,
|
|
4364
|
+
paginationDetail: d.paginationDetail,
|
|
4365
|
+
total: d.items.length
|
|
4366
|
+
}), S = i(() => !x.value || !f["grid-status"] ? [] : f["grid-status"](x.value)), C = i(() => en(S.value)), T = i(() => d.items.length + m.leavingItems.value.length), { emptyStateProps: E, showBadgeEmptyState: D, showCustomEmptyState: A, showInlineEmptyState: P } = rn({
|
|
4367
|
+
emptyStateMode: M(d, "emptyStateMode"),
|
|
4368
|
+
itemCount: T,
|
|
4369
|
+
loading: M(d, "loading"),
|
|
4370
|
+
renderSlot: f["empty-state"],
|
|
3948
4371
|
surface: "grid"
|
|
3949
4372
|
});
|
|
3950
|
-
return L([
|
|
3951
|
-
|
|
4373
|
+
return L([m.nextBoundaryLoadProgress, m.previousBoundaryLoadProgress], ([e, t]) => {
|
|
4374
|
+
p("boundary-load-progress", {
|
|
3952
4375
|
nextBoundaryLoadProgress: e,
|
|
3953
4376
|
previousBoundaryLoadProgress: t
|
|
3954
4377
|
});
|
|
3955
|
-
}, { immediate: !0 }), (e, n) => (w(), s("div",
|
|
3956
|
-
c("div",
|
|
4378
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", Zi, [
|
|
4379
|
+
c("div", Qi, [c("span", $i, [c("span", ea, j(N(m).paginationLabel.value), 1), d.paginationDetail ? (w(), s("span", ta, j(d.paginationDetail), 1)) : o("", !0)])]),
|
|
3957
4380
|
c("div", {
|
|
3958
|
-
ref: N(
|
|
4381
|
+
ref: N(m).scrollViewportRef,
|
|
3959
4382
|
"data-testid": "vibe-list-scroll",
|
|
3960
4383
|
class: "h-full min-h-0 overflow-y-auto overflow-x-hidden [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
3961
|
-
onScroll: n[0] ||= (...e) => N(
|
|
3962
|
-
onWheel: n[1] ||= (...e) => N(
|
|
4384
|
+
onScroll: n[0] ||= (...e) => N(m).onScroll && N(m).onScroll(...e),
|
|
4385
|
+
onWheel: n[1] ||= (...e) => N(m).onWheel && N(m).onWheel(...e)
|
|
3963
4386
|
}, [c("div", {
|
|
3964
4387
|
"data-testid": "vibe-list-content",
|
|
3965
4388
|
class: "relative",
|
|
3966
|
-
style: b({ height: `${N(
|
|
4389
|
+
style: b({ height: `${N(m).containerHeight.value}px` })
|
|
3967
4390
|
}, [
|
|
3968
|
-
(w(!0), s(t, null, O(N(
|
|
3969
|
-
key: N(
|
|
4391
|
+
(w(!0), s(t, null, O(N(m).renderedItems.value, ({ item: t, index: n }) => (w(), s("article", {
|
|
4392
|
+
key: N(Q)(t),
|
|
3970
4393
|
"data-testid": "vibe-list-card",
|
|
3971
|
-
"data-active": n === N(
|
|
4394
|
+
"data-active": n === N(m).resolvedActiveIndex.value ? "true" : "false",
|
|
3972
4395
|
"data-index": n,
|
|
3973
4396
|
"data-item-id": t.id,
|
|
3974
|
-
"data-occurrence-key": N(
|
|
4397
|
+
"data-occurrence-key": N(Q)(t),
|
|
3975
4398
|
class: "absolute will-change-transform",
|
|
3976
|
-
style: b(N(
|
|
3977
|
-
}, [u(
|
|
3978
|
-
active: n === N(
|
|
4399
|
+
style: b(N(m).getCardStyle(n))
|
|
4400
|
+
}, [u(Xi, {
|
|
4401
|
+
active: n === N(m).resolvedActiveIndex.value,
|
|
3979
4402
|
index: n,
|
|
3980
4403
|
item: t,
|
|
3981
|
-
"report-asset-error":
|
|
3982
|
-
"report-asset-load":
|
|
3983
|
-
"surface-active":
|
|
3984
|
-
onOpen: (e) =>
|
|
3985
|
-
}, l({ _: 2 }, [
|
|
4404
|
+
"report-asset-error": d.reportAssetError,
|
|
4405
|
+
"report-asset-load": d.reportAssetLoad,
|
|
4406
|
+
"surface-active": d.active,
|
|
4407
|
+
onOpen: (e) => p("open-fullscreen", n)
|
|
4408
|
+
}, l({ _: 2 }, [f["grid-item-overlay"] ? {
|
|
3986
4409
|
name: "grid-item-overlay",
|
|
3987
4410
|
fn: z((t) => [k(e.$slots, "grid-item-overlay", g({ ref_for: !0 }, t))]),
|
|
3988
4411
|
key: "0"
|
|
3989
|
-
} : void 0,
|
|
4412
|
+
} : void 0, f["item-icon"] ? {
|
|
3990
4413
|
name: "item-icon",
|
|
3991
4414
|
fn: z((t) => [k(e.$slots, "item-icon", g({ ref_for: !0 }, t))]),
|
|
3992
4415
|
key: "1"
|
|
@@ -3998,21 +4421,21 @@ var Si = ["aria-label"], Ci = {
|
|
|
3998
4421
|
"report-asset-load",
|
|
3999
4422
|
"surface-active",
|
|
4000
4423
|
"onOpen"
|
|
4001
|
-
])], 12,
|
|
4002
|
-
(w(!0), s(t, null, O(N(
|
|
4003
|
-
key: `leaving-${N(
|
|
4424
|
+
])], 12, na))), 128)),
|
|
4425
|
+
(w(!0), s(t, null, O(N(m).leavingItems.value, (t) => (w(), s("article", {
|
|
4426
|
+
key: `leaving-${N(Q)(t.item)}`,
|
|
4004
4427
|
"data-testid": "vibe-list-card-leaving",
|
|
4005
4428
|
"data-item-id": t.item.id,
|
|
4006
4429
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
4007
|
-
style: b(N(
|
|
4008
|
-
}, [u(
|
|
4430
|
+
style: b(N(m).getLeavingCardStyle(t.item))
|
|
4431
|
+
}, [u(Xi, {
|
|
4009
4432
|
active: !1,
|
|
4010
4433
|
index: -1,
|
|
4011
4434
|
item: t.item,
|
|
4012
|
-
"report-asset-error":
|
|
4013
|
-
"report-asset-load":
|
|
4435
|
+
"report-asset-error": d.reportAssetError,
|
|
4436
|
+
"report-asset-load": d.reportAssetLoad,
|
|
4014
4437
|
"surface-active": !1
|
|
4015
|
-
}, l({ _: 2 }, [
|
|
4438
|
+
}, l({ _: 2 }, [f["item-icon"] ? {
|
|
4016
4439
|
name: "item-icon",
|
|
4017
4440
|
fn: z((t) => [k(e.$slots, "item-icon", g({ ref_for: !0 }, t))]),
|
|
4018
4441
|
key: "0"
|
|
@@ -4020,14 +4443,14 @@ var Si = ["aria-label"], Ci = {
|
|
|
4020
4443
|
"item",
|
|
4021
4444
|
"report-asset-error",
|
|
4022
4445
|
"report-asset-load"
|
|
4023
|
-
])], 12,
|
|
4024
|
-
N(
|
|
4446
|
+
])], 12, ra))), 128)),
|
|
4447
|
+
N(P) && N(E) ? (w(), a(Bn, {
|
|
4025
4448
|
key: 0,
|
|
4026
|
-
message: N(
|
|
4027
|
-
mode: N(
|
|
4028
|
-
surface: N(
|
|
4449
|
+
message: N(E).message,
|
|
4450
|
+
mode: N(E).mode,
|
|
4451
|
+
surface: N(E).surface
|
|
4029
4452
|
}, {
|
|
4030
|
-
default: z(() => [N(
|
|
4453
|
+
default: z(() => [N(A) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(E)))) : o("", !0)]),
|
|
4031
4454
|
_: 3
|
|
4032
4455
|
}, 8, [
|
|
4033
4456
|
"message",
|
|
@@ -4035,28 +4458,28 @@ var Si = ["aria-label"], Ci = {
|
|
|
4035
4458
|
"surface"
|
|
4036
4459
|
])) : o("", !0)
|
|
4037
4460
|
], 4)], 544),
|
|
4038
|
-
N(
|
|
4461
|
+
N(m).showScrollbar.value ? (w(), s("div", ia, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
4039
4462
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
4040
|
-
class: v(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out",
|
|
4041
|
-
style: b(N(
|
|
4463
|
+
class: v(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", d.loading ? "bg-white/52" : "bg-white/34"]),
|
|
4464
|
+
style: b(N(m).getScrollbarThumbStyle())
|
|
4042
4465
|
}, null, 6)])) : o("", !0),
|
|
4043
|
-
|
|
4044
|
-
|
|
4466
|
+
f["grid-footer"] ? (w(), s("div", aa, [c("div", oa, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
4467
|
+
x.value ? (w(), s("div", {
|
|
4045
4468
|
key: 2,
|
|
4046
|
-
class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6",
|
|
4047
|
-
}, [
|
|
4469
|
+
class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", f["grid-footer"] ? "pb-24" : "pb-6"])
|
|
4470
|
+
}, [C.value ? k(e.$slots, "grid-status", y(g({ key: 0 }, x.value))) : (w(), s("span", {
|
|
4048
4471
|
key: 1,
|
|
4049
4472
|
"data-testid": "vibe-grid-status-badge",
|
|
4050
|
-
class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]",
|
|
4051
|
-
}, j(
|
|
4052
|
-
N(
|
|
4473
|
+
class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", x.value.kind === "end" ? "border-amber-300/35 text-amber-200" : x.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
4474
|
+
}, j(x.value.message), 3))], 2)) : o("", !0),
|
|
4475
|
+
N(D) && N(E) ? (w(), a(Bn, {
|
|
4053
4476
|
key: 3,
|
|
4054
|
-
class: v(["z-[3]",
|
|
4055
|
-
message: N(
|
|
4056
|
-
mode: N(
|
|
4057
|
-
surface: N(
|
|
4477
|
+
class: v(["z-[3]", f["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
4478
|
+
message: N(E).message,
|
|
4479
|
+
mode: N(E).mode,
|
|
4480
|
+
surface: N(E).surface
|
|
4058
4481
|
}, {
|
|
4059
|
-
default: z(() => [N(
|
|
4482
|
+
default: z(() => [N(A) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(E)))) : o("", !0)]),
|
|
4060
4483
|
_: 3
|
|
4061
4484
|
}, 8, [
|
|
4062
4485
|
"class",
|
|
@@ -4066,16 +4489,17 @@ var Si = ["aria-label"], Ci = {
|
|
|
4066
4489
|
])) : o("", !0)
|
|
4067
4490
|
]));
|
|
4068
4491
|
}
|
|
4069
|
-
}),
|
|
4492
|
+
}), ca = ["data-surface-mode"], la = {
|
|
4070
4493
|
key: 1,
|
|
4071
4494
|
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"
|
|
4072
|
-
},
|
|
4495
|
+
}, ua = ["data-visible", "inert"], da = ["data-visible", "inert"], fa = {
|
|
4073
4496
|
key: 3,
|
|
4074
4497
|
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"
|
|
4075
|
-
},
|
|
4498
|
+
}, pa = /* @__PURE__ */ d({
|
|
4076
4499
|
name: "VibeLayout",
|
|
4077
4500
|
__name: "Layout",
|
|
4078
4501
|
props: {
|
|
4502
|
+
bottomLoadBufferPx: {},
|
|
4079
4503
|
emptyStateMode: {},
|
|
4080
4504
|
fillDelayMs: {},
|
|
4081
4505
|
fillDelayStepMs: {},
|
|
@@ -4098,18 +4522,26 @@ var Si = ["aria-label"], Ci = {
|
|
|
4098
4522
|
"update:surfaceMode"
|
|
4099
4523
|
],
|
|
4100
4524
|
setup(e, { expose: n, emit: i }) {
|
|
4101
|
-
let d = e, f = F(), m = i, h =
|
|
4525
|
+
let d = e, f = F(), m = i, h = dt(d, m), g = D(null), _ = fe((e) => {
|
|
4102
4526
|
m("asset-errors", e);
|
|
4103
|
-
}),
|
|
4527
|
+
}), v = pe((e) => {
|
|
4104
4528
|
m("asset-loads", e);
|
|
4105
4529
|
});
|
|
4106
|
-
|
|
4107
|
-
|
|
4530
|
+
x(() => {
|
|
4531
|
+
_.stop(), v.stop();
|
|
4108
4532
|
}), L(() => h.items.value, (e) => {
|
|
4109
4533
|
m("items-change", [...e]);
|
|
4110
|
-
})
|
|
4534
|
+
});
|
|
4535
|
+
function b(e) {
|
|
4536
|
+
g.value?.autoScroll(e);
|
|
4537
|
+
}
|
|
4538
|
+
return n({
|
|
4539
|
+
autoScroll: b,
|
|
4111
4540
|
cancel: h.cancel,
|
|
4541
|
+
cancelFill: h.cancelFill,
|
|
4112
4542
|
clearRemoved: h.clearRemoved,
|
|
4543
|
+
fillUntil: h.fillUntil,
|
|
4544
|
+
fillUntilEnd: h.fillUntilEnd,
|
|
4113
4545
|
getItemByOccurrenceKey: h.getItemByOccurrenceKey,
|
|
4114
4546
|
getItems: h.getItems,
|
|
4115
4547
|
getRemovedIds: h.getRemovedIds,
|
|
@@ -4131,7 +4563,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
4131
4563
|
type: "button",
|
|
4132
4564
|
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",
|
|
4133
4565
|
onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
|
|
4134
|
-
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div",
|
|
4566
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", la, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
4135
4567
|
appear: "",
|
|
4136
4568
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
4137
4569
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -4140,14 +4572,17 @@ var Si = ["aria-label"], Ci = {
|
|
|
4140
4572
|
"leave-from-class": "translate-y-0 opacity-100",
|
|
4141
4573
|
"leave-to-class": "translate-y-3 opacity-0"
|
|
4142
4574
|
}, {
|
|
4143
|
-
default: z(() => [
|
|
4575
|
+
default: z(() => [ee(c("div", {
|
|
4144
4576
|
"data-testid": "vibe-list-surface",
|
|
4145
4577
|
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
4146
4578
|
inert: N(h).surfaceMode.value !== "list",
|
|
4147
4579
|
class: "absolute inset-0 z-[2]"
|
|
4148
|
-
}, [u(
|
|
4580
|
+
}, [u(sa, {
|
|
4581
|
+
ref_key: "listSurfaceRef",
|
|
4582
|
+
ref: g,
|
|
4149
4583
|
active: N(h).surfaceMode.value === "list",
|
|
4150
4584
|
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
4585
|
+
"bottom-load-buffer-px": d.bottomLoadBufferPx,
|
|
4151
4586
|
items: N(h).items.value,
|
|
4152
4587
|
"active-index": N(h).activeIndex.value,
|
|
4153
4588
|
"error-message": N(h).errorMessage.value,
|
|
@@ -4158,8 +4593,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
4158
4593
|
phase: N(h).phase.value,
|
|
4159
4594
|
"commit-pending-append": N(h).commitPendingAppend,
|
|
4160
4595
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4161
|
-
"report-asset-error": N(
|
|
4162
|
-
"report-asset-load": N(
|
|
4596
|
+
"report-asset-error": N(_).report,
|
|
4597
|
+
"report-asset-load": N(v).report,
|
|
4163
4598
|
"request-next-page": N(h).prefetchNextPage,
|
|
4164
4599
|
"request-previous-page": N(h).prefetchPreviousPage,
|
|
4165
4600
|
"empty-state-mode": d.emptyStateMode,
|
|
@@ -4196,6 +4631,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
4196
4631
|
]), 1032, [
|
|
4197
4632
|
"active",
|
|
4198
4633
|
"allow-exhausted-next-page-refresh",
|
|
4634
|
+
"bottom-load-buffer-px",
|
|
4199
4635
|
"items",
|
|
4200
4636
|
"active-index",
|
|
4201
4637
|
"error-message",
|
|
@@ -4215,7 +4651,7 @@ var Si = ["aria-label"], Ci = {
|
|
|
4215
4651
|
"onBoundaryLoadProgress",
|
|
4216
4652
|
"onOpenFullscreen",
|
|
4217
4653
|
"onUpdate:activeIndex"
|
|
4218
|
-
])], 8,
|
|
4654
|
+
])], 8, ua), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
4219
4655
|
_: 3
|
|
4220
4656
|
}), u(r, {
|
|
4221
4657
|
appear: "",
|
|
@@ -4226,12 +4662,12 @@ var Si = ["aria-label"], Ci = {
|
|
|
4226
4662
|
"leave-from-class": "translate-y-0 opacity-100",
|
|
4227
4663
|
"leave-to-class": "-translate-y-3 opacity-0"
|
|
4228
4664
|
}, {
|
|
4229
|
-
default: z(() => [
|
|
4665
|
+
default: z(() => [ee(c("div", {
|
|
4230
4666
|
"data-testid": "vibe-fullscreen-surface",
|
|
4231
4667
|
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4232
4668
|
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
4233
4669
|
class: "absolute inset-0 z-[3]"
|
|
4234
|
-
}, [u(
|
|
4670
|
+
}, [u(Sr, {
|
|
4235
4671
|
items: N(h).items.value,
|
|
4236
4672
|
active: N(h).surfaceMode.value === "fullscreen",
|
|
4237
4673
|
"active-index": N(h).activeIndex.value,
|
|
@@ -4240,8 +4676,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
4240
4676
|
"has-next-page": N(h).hasNextPage.value,
|
|
4241
4677
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4242
4678
|
phase: N(h).phase.value,
|
|
4243
|
-
"report-asset-error": N(
|
|
4244
|
-
"report-asset-load": N(
|
|
4679
|
+
"report-asset-error": N(_).report,
|
|
4680
|
+
"report-asset-load": N(v).report,
|
|
4245
4681
|
"empty-state-mode": d.emptyStateMode,
|
|
4246
4682
|
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
4247
4683
|
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
@@ -4300,12 +4736,12 @@ var Si = ["aria-label"], Ci = {
|
|
|
4300
4736
|
"show-back-to-list",
|
|
4301
4737
|
"onBackToList",
|
|
4302
4738
|
"onUpdate:activeIndex"
|
|
4303
|
-
])], 8,
|
|
4739
|
+
])], 8, da), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
4304
4740
|
_: 3
|
|
4305
|
-
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div",
|
|
4741
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", fa, [u(N(oe), {
|
|
4306
4742
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
4307
4743
|
"aria-hidden": "true"
|
|
4308
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(
|
|
4744
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(Sr, {
|
|
4309
4745
|
key: 4,
|
|
4310
4746
|
items: N(h).items.value,
|
|
4311
4747
|
active: !0,
|
|
@@ -4315,8 +4751,8 @@ var Si = ["aria-label"], Ci = {
|
|
|
4315
4751
|
"has-next-page": N(h).hasNextPage.value,
|
|
4316
4752
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4317
4753
|
phase: N(h).phase.value,
|
|
4318
|
-
"report-asset-error": N(
|
|
4319
|
-
"report-asset-load": N(
|
|
4754
|
+
"report-asset-error": N(_).report,
|
|
4755
|
+
"report-asset-load": N(v).report,
|
|
4320
4756
|
"empty-state-mode": d.emptyStateMode,
|
|
4321
4757
|
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
4322
4758
|
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
@@ -4373,10 +4809,10 @@ var Si = ["aria-label"], Ci = {
|
|
|
4373
4809
|
"show-status-badges",
|
|
4374
4810
|
"onBackToList",
|
|
4375
4811
|
"onUpdate:activeIndex"
|
|
4376
|
-
]))], 8,
|
|
4812
|
+
]))], 8, ca));
|
|
4377
4813
|
}
|
|
4378
|
-
}),
|
|
4379
|
-
e.component("VibeLayout",
|
|
4814
|
+
}), ma = { install(e) {
|
|
4815
|
+
e.component("VibeLayout", pa);
|
|
4380
4816
|
} };
|
|
4381
4817
|
//#endregion
|
|
4382
|
-
export {
|
|
4818
|
+
export { pa as VibeLayout, ma as VibePlugin, ma as default };
|