@wyxos/vibe 3.1.21 → 3.1.24
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/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/useEdgeBoundary.d.ts +2 -1
- 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 +1410 -1006
- 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
185
|
function pe(e, t = 150) {
|
|
186
|
-
return
|
|
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 Z(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,8 +520,227 @@ 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
|
|
507
742
|
//#region src/components/viewer-core/emptyVisiblePrefetch.ts
|
|
508
|
-
function
|
|
743
|
+
function tt(e) {
|
|
509
744
|
let t = null, n = !1, r = !1;
|
|
510
745
|
function i() {
|
|
511
746
|
t = null;
|
|
@@ -547,14 +782,14 @@ function Je(e) {
|
|
|
547
782
|
}
|
|
548
783
|
//#endregion
|
|
549
784
|
//#region src/components/viewer-core/fillDelay.ts
|
|
550
|
-
var
|
|
551
|
-
function
|
|
785
|
+
var nt = 2e3, rt = 1e3, it = 100;
|
|
786
|
+
function at(e, t = nt, n = rt) {
|
|
552
787
|
return t + Math.max(0, e - 1) * n;
|
|
553
788
|
}
|
|
554
|
-
function
|
|
789
|
+
function ot(e, t) {
|
|
555
790
|
return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
|
|
556
791
|
}
|
|
557
|
-
function
|
|
792
|
+
function st() {
|
|
558
793
|
let e = D(null), t = null, n = null, r = null;
|
|
559
794
|
function i(i = !1) {
|
|
560
795
|
if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
|
|
@@ -572,7 +807,7 @@ function et() {
|
|
|
572
807
|
let t = Math.max(0, a - (Date.now() - s));
|
|
573
808
|
e.value = t, t <= 0 && l();
|
|
574
809
|
};
|
|
575
|
-
t = setInterval(u,
|
|
810
|
+
t = setInterval(u, it), n = setTimeout(l, a), u();
|
|
576
811
|
}));
|
|
577
812
|
}
|
|
578
813
|
return {
|
|
@@ -583,336 +818,334 @@ function et() {
|
|
|
583
818
|
}
|
|
584
819
|
//#endregion
|
|
585
820
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
586
|
-
function
|
|
587
|
-
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 =
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
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,
|
|
595
872
|
removedIds: e.removedIds,
|
|
596
|
-
trailingBoundaryBucket:
|
|
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)
|
|
597
906
|
});
|
|
598
|
-
L(() =>
|
|
907
|
+
L(() => N.value.length, (e) => {
|
|
599
908
|
if (e === 0) {
|
|
600
|
-
r.value = 0,
|
|
909
|
+
r.value = 0, K.schedule();
|
|
601
910
|
return;
|
|
602
911
|
}
|
|
603
|
-
|
|
912
|
+
K.resetRefreshAttempt(), o.value &&= (Ae(), !1), r.value > e - 1 && (r.value = e - 1);
|
|
604
913
|
}), L(() => r.value, () => {
|
|
605
|
-
h.value &&
|
|
914
|
+
h.value && ge();
|
|
606
915
|
}), S(() => {
|
|
607
|
-
|
|
916
|
+
Ee() || e.resolve && J();
|
|
608
917
|
}), x(() => {
|
|
609
|
-
|
|
918
|
+
y?.abort(), y = null, d.clear(!0);
|
|
610
919
|
});
|
|
611
|
-
async function
|
|
612
|
-
|
|
613
|
-
let t = await
|
|
920
|
+
async function J() {
|
|
921
|
+
b = J;
|
|
922
|
+
let t = await Se({
|
|
614
923
|
continueUntilFilled: !0,
|
|
615
924
|
cursor: e.initialCursor ?? null,
|
|
616
925
|
direction: "forward",
|
|
617
926
|
phase: "initializing"
|
|
618
927
|
});
|
|
619
|
-
t && (n.value = t.buckets, r.value = 0,
|
|
928
|
+
t && (n.value = t.buckets, r.value = 0, $());
|
|
620
929
|
}
|
|
621
|
-
async function
|
|
622
|
-
if (
|
|
623
|
-
let e = !
|
|
930
|
+
async function Y() {
|
|
931
|
+
if (V.value || F.value) return;
|
|
932
|
+
let e = !N.value.length, t = R.value, n = {
|
|
624
933
|
commitImmediately: e,
|
|
625
934
|
originCursor: t?.cursor ?? null
|
|
626
|
-
}, r =
|
|
627
|
-
if (
|
|
628
|
-
if (!
|
|
629
|
-
let e = await
|
|
630
|
-
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);
|
|
631
940
|
return;
|
|
632
941
|
}
|
|
633
942
|
if (r) {
|
|
634
943
|
if (t?.cursor === r) {
|
|
635
|
-
let e = await
|
|
636
|
-
e?.followCursor && e.itemsInserted === 0 && await
|
|
944
|
+
let e = await xe("trailing");
|
|
945
|
+
e?.followCursor && e.itemsInserted === 0 && await ve(e.followCursor, n);
|
|
637
946
|
return;
|
|
638
947
|
}
|
|
639
|
-
await
|
|
948
|
+
await ve(r, n);
|
|
640
949
|
return;
|
|
641
950
|
}
|
|
642
|
-
if (!
|
|
643
|
-
let e =
|
|
644
|
-
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);
|
|
645
954
|
return;
|
|
646
955
|
}
|
|
647
|
-
await
|
|
956
|
+
await ve(z.value, n);
|
|
648
957
|
}
|
|
649
|
-
async function
|
|
650
|
-
if (!(
|
|
651
|
-
if (
|
|
652
|
-
let e = await
|
|
653
|
-
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);
|
|
654
963
|
return;
|
|
655
964
|
}
|
|
656
|
-
await
|
|
965
|
+
await be(ee.value);
|
|
657
966
|
}
|
|
658
967
|
}
|
|
659
|
-
async function
|
|
660
|
-
if (
|
|
661
|
-
if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value =
|
|
662
|
-
|
|
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
|
+
$();
|
|
663
972
|
return;
|
|
664
973
|
}
|
|
665
|
-
await
|
|
974
|
+
await J();
|
|
666
975
|
}
|
|
667
976
|
}
|
|
668
|
-
async function
|
|
669
|
-
if (
|
|
670
|
-
|
|
977
|
+
async function ae() {
|
|
978
|
+
if (ne.value) return ie();
|
|
979
|
+
V.value || c.value !== "failed" || !b || (s.value = null, await b());
|
|
671
980
|
}
|
|
672
|
-
async function
|
|
673
|
-
if (!a.value.length) return m.value = !1,
|
|
674
|
-
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, $();
|
|
675
984
|
}
|
|
676
|
-
function
|
|
677
|
-
let n =
|
|
985
|
+
function se(t) {
|
|
986
|
+
let n = N.value;
|
|
678
987
|
if (!n.length) return;
|
|
679
|
-
let i =
|
|
988
|
+
let i = ye(t, 0, n.length - 1);
|
|
680
989
|
i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
|
|
681
990
|
}
|
|
682
|
-
function
|
|
683
|
-
h.value = e,
|
|
991
|
+
function ce(e) {
|
|
992
|
+
h.value = e, K.schedule();
|
|
684
993
|
}
|
|
685
|
-
function
|
|
686
|
-
|
|
994
|
+
function le() {
|
|
995
|
+
_.value = !0, d.clear(!0);
|
|
687
996
|
}
|
|
688
|
-
function
|
|
689
|
-
|
|
997
|
+
function ue() {
|
|
998
|
+
_.value = !1, K.schedule();
|
|
690
999
|
}
|
|
691
|
-
function
|
|
692
|
-
|
|
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, $();
|
|
693
1002
|
}
|
|
694
|
-
function
|
|
695
|
-
|
|
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();
|
|
696
1008
|
}
|
|
697
|
-
function
|
|
698
|
-
|
|
1009
|
+
function pe() {
|
|
1010
|
+
return Re(N.value, P.value);
|
|
1011
|
+
}
|
|
1012
|
+
function me(e = null, t = {}) {
|
|
1013
|
+
if (N.value.length === 0) {
|
|
699
1014
|
r.value = 0, !t.preserveTrailingPlaceholder && n.value.length > 0 && (o.value = !0);
|
|
700
1015
|
return;
|
|
701
1016
|
}
|
|
702
1017
|
if (e) {
|
|
703
|
-
let t =
|
|
1018
|
+
let t = N.value.findIndex((t) => Q(t) === e);
|
|
704
1019
|
if (t >= 0) {
|
|
705
1020
|
r.value = t;
|
|
706
1021
|
return;
|
|
707
1022
|
}
|
|
708
1023
|
}
|
|
709
|
-
if (t.preserveTrailingPlaceholder && r.value >=
|
|
710
|
-
r.value =
|
|
1024
|
+
if (t.preserveTrailingPlaceholder && r.value >= N.value.length) {
|
|
1025
|
+
r.value = N.value.length;
|
|
711
1026
|
return;
|
|
712
1027
|
}
|
|
713
|
-
r.value = ze(
|
|
1028
|
+
r.value = ze(N.value, P.value, e);
|
|
714
1029
|
}
|
|
715
|
-
function
|
|
716
|
-
a.value.length > 0 && (!
|
|
1030
|
+
function he() {
|
|
1031
|
+
a.value.length > 0 && (!U.value.length || !N.value.length) && oe();
|
|
717
1032
|
}
|
|
718
|
-
async function
|
|
719
|
-
if (!(!h.value ||
|
|
720
|
-
if (!
|
|
721
|
-
(
|
|
1033
|
+
async function ge() {
|
|
1034
|
+
if (!(!h.value || De())) {
|
|
1035
|
+
if (!N.value.length) {
|
|
1036
|
+
(te.value || H.value) && await Y();
|
|
722
1037
|
return;
|
|
723
1038
|
}
|
|
724
|
-
|
|
1039
|
+
B.value && r.value < 3 && await re(), te.value && r.value >= N.value.length - 3 && await Y();
|
|
725
1040
|
}
|
|
726
1041
|
}
|
|
727
|
-
async function
|
|
728
|
-
|
|
729
|
-
await
|
|
1042
|
+
async function ve(e, t = {}) {
|
|
1043
|
+
b = async () => {
|
|
1044
|
+
await ve(e, t);
|
|
730
1045
|
};
|
|
731
|
-
let r = await
|
|
1046
|
+
let r = await Se({
|
|
732
1047
|
continueUntilFilled: !0,
|
|
733
1048
|
cursor: e,
|
|
734
1049
|
direction: "forward",
|
|
735
1050
|
phase: "loading"
|
|
736
1051
|
});
|
|
737
1052
|
if (r) {
|
|
738
|
-
if (!r.visibleCount) return n.value =
|
|
739
|
-
if (r.canceled) return n.value = [...n.value, ...r.buckets], a.value = [], m.value = !1,
|
|
740
|
-
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, $();
|
|
741
1056
|
m.value = !0;
|
|
742
1057
|
}
|
|
743
1058
|
}
|
|
744
|
-
async function
|
|
745
|
-
|
|
746
|
-
await
|
|
1059
|
+
async function be(e) {
|
|
1060
|
+
b = async () => {
|
|
1061
|
+
await be(e);
|
|
747
1062
|
};
|
|
748
|
-
let t = await
|
|
1063
|
+
let t = await Se({
|
|
749
1064
|
continueUntilFilled: !0,
|
|
750
1065
|
cursor: e,
|
|
751
1066
|
direction: "backward",
|
|
752
1067
|
phase: "loading"
|
|
753
1068
|
});
|
|
754
1069
|
if (!t) return;
|
|
755
|
-
let r =
|
|
756
|
-
n.value = [...t.buckets, ...n.value],
|
|
757
|
-
}
|
|
758
|
-
async function de(t) {
|
|
759
|
-
if (y = async () => {
|
|
760
|
-
await de(t);
|
|
761
|
-
}, !e.resolve) return null;
|
|
762
|
-
let r = t === "leading" ? N.value : P.value;
|
|
763
|
-
if (!r) return null;
|
|
764
|
-
let i = _e(r.cursor);
|
|
765
|
-
if (_.has(i)) return null;
|
|
766
|
-
_.add(i), s.value = null, c.value = "refreshing", l.value = null, u.value = null, p.value = null;
|
|
767
|
-
let a = ++b, o = typeof AbortController > "u" ? null : new AbortController();
|
|
768
|
-
v = o;
|
|
769
|
-
try {
|
|
770
|
-
let i = await e.resolve({
|
|
771
|
-
cursor: r.cursor,
|
|
772
|
-
pageSize: O.value,
|
|
773
|
-
signal: o?.signal
|
|
774
|
-
});
|
|
775
|
-
if (a !== b) return Z(), null;
|
|
776
|
-
let s = Ke(r, i.nextPage), c = Fe({
|
|
777
|
-
cursor: r.cursor,
|
|
778
|
-
nextCursor: s.cursor,
|
|
779
|
-
nextCursorExhausted: s.exhausted,
|
|
780
|
-
nextItems: i.items,
|
|
781
|
-
previousCursor: i.previousPage ?? null,
|
|
782
|
-
previousItems: r.items,
|
|
783
|
-
sequence: C
|
|
784
|
-
});
|
|
785
|
-
C = c.nextSequence;
|
|
786
|
-
let l = oe();
|
|
787
|
-
return n.value = ke(n.value, r.cursor, c.bucket), se(l), Z(), {
|
|
788
|
-
followCursor: t === "leading" ? i.previousPage ?? null : i.nextPage,
|
|
789
|
-
itemsInserted: c.insertedCount
|
|
790
|
-
};
|
|
791
|
-
} catch (e) {
|
|
792
|
-
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);
|
|
793
|
-
} finally {
|
|
794
|
-
v === o && (v = null), _.delete(i);
|
|
795
|
-
}
|
|
1070
|
+
let r = pe();
|
|
1071
|
+
n.value = [...t.buckets, ...n.value], me(r), $();
|
|
796
1072
|
}
|
|
797
|
-
async function
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
802
|
-
if (i.length > 0 && g.value) return Ie(i, t.direction, e.removedIds.value, !1);
|
|
803
|
-
let f = _e(a);
|
|
804
|
-
if (r.has(f) || _.has(f)) break;
|
|
805
|
-
r.add(f), _.add(f);
|
|
806
|
-
let m = typeof AbortController > "u" ? null : new AbortController();
|
|
807
|
-
v = m;
|
|
808
|
-
try {
|
|
809
|
-
let r = await e.resolve({
|
|
810
|
-
cursor: a,
|
|
811
|
-
pageSize: O.value,
|
|
812
|
-
signal: m?.signal
|
|
813
|
-
});
|
|
814
|
-
if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
815
|
-
let s = Ge(t.direction, a, r.nextPage), f = pe({
|
|
816
|
-
cursor: a,
|
|
817
|
-
nextCursor: s.cursor,
|
|
818
|
-
nextCursorExhausted: s.exhausted,
|
|
819
|
-
nextItems: r.items,
|
|
820
|
-
previousCursor: r.previousPage ?? null,
|
|
821
|
-
previousItems: []
|
|
822
|
-
});
|
|
823
|
-
i.push(f);
|
|
824
|
-
let h = i.reduce((t, n) => t + De(n, e.removedIds.value), 0), _ = t.direction === "forward" ? f.nextCursorExhausted ? null : f.nextCursor : f.previousCursor;
|
|
825
|
-
if (!t.continueUntilFilled || h >= O.value || !_) return u.value = null, {
|
|
826
|
-
canceled: !1,
|
|
827
|
-
buckets: t.direction === "backward" ? [...i].reverse() : i,
|
|
828
|
-
visibleCount: h
|
|
829
|
-
};
|
|
830
|
-
if (g.value) return Ie(i, t.direction, e.removedIds.value, !1);
|
|
831
|
-
c.value = "filling", l.value = h, u.value = _, p.value = O.value, o += 1;
|
|
832
|
-
let v = Qe(o, w.value, T.value);
|
|
833
|
-
if (await d.wait(v), n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
834
|
-
a = _;
|
|
835
|
-
} catch (r) {
|
|
836
|
-
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);
|
|
837
|
-
} finally {
|
|
838
|
-
v === m && (v = null), _.delete(f);
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
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);
|
|
842
1077
|
}
|
|
843
|
-
function
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
nextItems: e.nextItems,
|
|
849
|
-
previousCursor: e.previousCursor,
|
|
850
|
-
previousItems: e.previousItems,
|
|
851
|
-
sequence: C
|
|
852
|
-
});
|
|
853
|
-
return C = t.nextSequence, t.bucket;
|
|
1078
|
+
function Se(e) {
|
|
1079
|
+
return q.collectBuckets(e);
|
|
1080
|
+
}
|
|
1081
|
+
function $() {
|
|
1082
|
+
c.value = "idle", Ce(), d.clear(), K.schedule();
|
|
854
1083
|
}
|
|
855
|
-
function
|
|
856
|
-
|
|
1084
|
+
function Ce() {
|
|
1085
|
+
l.value = null, u.value = null, p.value = null;
|
|
857
1086
|
}
|
|
858
|
-
function
|
|
1087
|
+
function Ee() {
|
|
859
1088
|
if (!e.initialState || !e.initialState.items.length) return !1;
|
|
860
1089
|
let t = Le({
|
|
861
1090
|
initialState: e.initialState,
|
|
862
1091
|
removedIds: e.removedIds.value,
|
|
863
|
-
sequence:
|
|
1092
|
+
sequence: w
|
|
864
1093
|
});
|
|
865
|
-
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;
|
|
866
1095
|
}
|
|
867
|
-
function
|
|
1096
|
+
function De() {
|
|
868
1097
|
return c.value === "initializing";
|
|
869
1098
|
}
|
|
870
|
-
function
|
|
871
|
-
return Be(t === "leading" ?
|
|
1099
|
+
function ke(t) {
|
|
1100
|
+
return Be(t === "leading" ? I.value : R.value, e.removedIds.value, A.value);
|
|
872
1101
|
}
|
|
873
|
-
function
|
|
874
|
-
n.value =
|
|
1102
|
+
function Ae() {
|
|
1103
|
+
n.value = Je(n.value, e.removedIds.value);
|
|
875
1104
|
}
|
|
876
1105
|
return {
|
|
877
|
-
activeIndex:
|
|
878
|
-
canRetryInitialLoad:
|
|
879
|
-
cancel:
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1106
|
+
activeIndex: P,
|
|
1107
|
+
canRetryInitialLoad: ne,
|
|
1108
|
+
cancel: X,
|
|
1109
|
+
cancelFill: de,
|
|
1110
|
+
canRefreshTrailingBoundary: H,
|
|
1111
|
+
commitPendingAppend: oe,
|
|
1112
|
+
currentCursor: W,
|
|
883
1113
|
errorMessage: s,
|
|
884
1114
|
fillCollectedCount: l,
|
|
885
1115
|
fillCursor: u,
|
|
886
1116
|
fillDelayRemainingMs: f,
|
|
887
1117
|
fillTargetCount: p,
|
|
888
|
-
|
|
889
|
-
|
|
1118
|
+
...M.refs,
|
|
1119
|
+
fillUntil: G.fillUntil,
|
|
1120
|
+
fillUntilEnd: G.fillUntilEnd,
|
|
1121
|
+
hasNextPage: te,
|
|
1122
|
+
hasPreviousPage: B,
|
|
890
1123
|
isAutoPrefetchEnabled: h,
|
|
891
|
-
isPageLoadingLocked:
|
|
892
|
-
items:
|
|
893
|
-
lockPageLoading:
|
|
894
|
-
loading:
|
|
895
|
-
maybePrefetchAround:
|
|
896
|
-
nextCursor:
|
|
897
|
-
pendingAppendItems:
|
|
1124
|
+
isPageLoadingLocked: V,
|
|
1125
|
+
items: N,
|
|
1126
|
+
lockPageLoading: le,
|
|
1127
|
+
loading: F,
|
|
1128
|
+
maybePrefetchAround: ge,
|
|
1129
|
+
nextCursor: z,
|
|
1130
|
+
pendingAppendItems: U,
|
|
898
1131
|
phase: c,
|
|
899
|
-
prefetchNextPage:
|
|
900
|
-
prefetchPreviousPage:
|
|
901
|
-
previousCursor:
|
|
902
|
-
retryInitialLoad:
|
|
903
|
-
retry:
|
|
904
|
-
setActiveIndex:
|
|
905
|
-
setAutoPrefetchEnabled:
|
|
906
|
-
syncActiveIndexAfterVisibilityChange:
|
|
907
|
-
unlockPageLoading:
|
|
908
|
-
getActiveOccurrenceKey:
|
|
909
|
-
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
|
|
910
1143
|
};
|
|
911
1144
|
}
|
|
912
1145
|
//#endregion
|
|
913
1146
|
//#region src/components/viewer-core/useDataSource.ts
|
|
914
|
-
function
|
|
915
|
-
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({
|
|
916
1149
|
emit: t,
|
|
917
1150
|
fillDelayMs: e.fillDelayMs,
|
|
918
1151
|
fillDelayStepMs: e.fillDelayStepMs,
|
|
@@ -949,7 +1182,7 @@ function nt(e, t) {
|
|
|
949
1182
|
return [...u.value];
|
|
950
1183
|
}
|
|
951
1184
|
function E(e) {
|
|
952
|
-
return u.value.find((t) =>
|
|
1185
|
+
return u.value.find((t) => Q(t) === e) ?? null;
|
|
953
1186
|
}
|
|
954
1187
|
function D(e, t, n) {
|
|
955
1188
|
return Math.min(Math.max(e, t), n);
|
|
@@ -971,14 +1204,23 @@ function nt(e, t) {
|
|
|
971
1204
|
canRefreshExhaustedNextPage: v,
|
|
972
1205
|
canRetryInitialLoad: l.canRetryInitialLoad,
|
|
973
1206
|
cancel: O,
|
|
1207
|
+
cancelFill: l.cancelFill,
|
|
974
1208
|
clearRemoved: w,
|
|
975
1209
|
commitPendingAppend: l.commitPendingAppend,
|
|
976
1210
|
currentCursor: l.currentCursor,
|
|
977
1211
|
errorMessage: l.errorMessage,
|
|
978
1212
|
fillCollectedCount: l.fillCollectedCount,
|
|
1213
|
+
fillCompletedCalls: l.fillCompletedCalls,
|
|
979
1214
|
fillCursor: l.fillCursor,
|
|
980
1215
|
fillDelayRemainingMs: l.fillDelayRemainingMs,
|
|
1216
|
+
fillLoadedCount: l.fillLoadedCount,
|
|
1217
|
+
fillMode: l.fillMode,
|
|
1218
|
+
fillProgress: l.fillProgress,
|
|
1219
|
+
fillTargetCalls: l.fillTargetCalls,
|
|
981
1220
|
fillTargetCount: l.fillTargetCount,
|
|
1221
|
+
fillTotalCount: l.fillTotalCount,
|
|
1222
|
+
fillUntil: l.fillUntil,
|
|
1223
|
+
fillUntilEnd: l.fillUntilEnd,
|
|
982
1224
|
getItemByOccurrenceKey: E,
|
|
983
1225
|
getItems: T,
|
|
984
1226
|
getRemovedIds: r,
|
|
@@ -1010,9 +1252,9 @@ function nt(e, t) {
|
|
|
1010
1252
|
}
|
|
1011
1253
|
//#endregion
|
|
1012
1254
|
//#region src/components/viewer-core/useController.ts
|
|
1013
|
-
var
|
|
1014
|
-
function
|
|
1015
|
-
let n =
|
|
1255
|
+
var ut = 1024;
|
|
1256
|
+
function dt(e, t) {
|
|
1257
|
+
let n = lt(e, t), r = T({
|
|
1016
1258
|
nextBoundaryLoadProgress: 0,
|
|
1017
1259
|
previousBoundaryLoadProgress: 0
|
|
1018
1260
|
}), a = D(0), o = D("list"), s = T({
|
|
@@ -1020,9 +1262,15 @@ function it(e, t) {
|
|
|
1020
1262
|
currentCursor: null,
|
|
1021
1263
|
errorMessage: null,
|
|
1022
1264
|
fillCollectedCount: null,
|
|
1265
|
+
fillCompletedCalls: 0,
|
|
1023
1266
|
fillCursor: null,
|
|
1024
1267
|
fillDelayRemainingMs: null,
|
|
1268
|
+
fillLoadedCount: 0,
|
|
1269
|
+
fillMode: "idle",
|
|
1270
|
+
fillProgress: null,
|
|
1271
|
+
fillTargetCalls: null,
|
|
1025
1272
|
fillTargetCount: null,
|
|
1273
|
+
fillTotalCount: null,
|
|
1026
1274
|
hasNextPage: !1,
|
|
1027
1275
|
hasPreviousPage: !1,
|
|
1028
1276
|
itemCount: 0,
|
|
@@ -1036,7 +1284,7 @@ function it(e, t) {
|
|
|
1036
1284
|
removedCount: 0,
|
|
1037
1285
|
removedIds: [],
|
|
1038
1286
|
surfaceMode: "list"
|
|
1039
|
-
}), c = i(() => a.value >=
|
|
1287
|
+
}), c = i(() => a.value >= ut), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
|
|
1040
1288
|
L(c, (e) => {
|
|
1041
1289
|
e && h();
|
|
1042
1290
|
}), L(() => e.surfaceMode, () => {
|
|
@@ -1053,7 +1301,7 @@ function it(e, t) {
|
|
|
1053
1301
|
}), L(l, (e) => {
|
|
1054
1302
|
n.setAutoPrefetchEnabled(e === "fullscreen");
|
|
1055
1303
|
}, { immediate: !0 }), R(() => {
|
|
1056
|
-
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;
|
|
1057
1305
|
}), S(() => {
|
|
1058
1306
|
m(), h(), window.addEventListener("keydown", p), window.addEventListener("resize", m);
|
|
1059
1307
|
}), x(() => {
|
|
@@ -1066,7 +1314,7 @@ function it(e, t) {
|
|
|
1066
1314
|
!c.value || o.value === "list" || (o.value = "list", t("update:surfaceMode", "list"));
|
|
1067
1315
|
}
|
|
1068
1316
|
function p(e) {
|
|
1069
|
-
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());
|
|
1070
1318
|
}
|
|
1071
1319
|
function m() {
|
|
1072
1320
|
a.value = window.innerWidth || 0;
|
|
@@ -1075,7 +1323,7 @@ function it(e, t) {
|
|
|
1075
1323
|
!c.value || !e.surfaceMode || e.surfaceMode === o.value || (o.value = e.surfaceMode);
|
|
1076
1324
|
}
|
|
1077
1325
|
function g(e) {
|
|
1078
|
-
r.nextBoundaryLoadProgress =
|
|
1326
|
+
r.nextBoundaryLoadProgress = ft(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = ft(e.previousBoundaryLoadProgress);
|
|
1079
1327
|
}
|
|
1080
1328
|
return {
|
|
1081
1329
|
...n,
|
|
@@ -1094,26 +1342,26 @@ function it(e, t) {
|
|
|
1094
1342
|
unlockPageLoading: n.unlockPageLoading
|
|
1095
1343
|
};
|
|
1096
1344
|
}
|
|
1097
|
-
function
|
|
1345
|
+
function ft(e) {
|
|
1098
1346
|
return Math.min(Math.max(e, 0), 1);
|
|
1099
1347
|
}
|
|
1100
1348
|
//#endregion
|
|
1101
1349
|
//#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
|
|
1102
|
-
var
|
|
1350
|
+
var pt = {
|
|
1103
1351
|
"data-testid": "vibe-media-bar",
|
|
1104
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]"
|
|
1105
|
-
},
|
|
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 = [
|
|
1106
1354
|
"max",
|
|
1107
1355
|
"value",
|
|
1108
1356
|
"disabled"
|
|
1109
|
-
],
|
|
1357
|
+
], vt = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, yt = ["data-layout"], bt = {
|
|
1110
1358
|
key: 0,
|
|
1111
1359
|
"data-testid": "vibe-media-volume-popover",
|
|
1112
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]"
|
|
1113
|
-
},
|
|
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 = {
|
|
1114
1362
|
key: 0,
|
|
1115
1363
|
class: "relative h-4 w-24"
|
|
1116
|
-
},
|
|
1364
|
+
}, Et = ["value"], Dt = /* @__PURE__ */ d({
|
|
1117
1365
|
__name: "FullscreenMediaBar",
|
|
1118
1366
|
props: {
|
|
1119
1367
|
currentTime: {},
|
|
@@ -1156,9 +1404,9 @@ var ot = {
|
|
|
1156
1404
|
function C(e, t, n) {
|
|
1157
1405
|
return Math.min(Math.max(e, t), n);
|
|
1158
1406
|
}
|
|
1159
|
-
return (e, t) => (w(), s("div",
|
|
1160
|
-
c("span",
|
|
1161
|
-
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, [
|
|
1162
1410
|
t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1163
1411
|
c("div", {
|
|
1164
1412
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -1175,16 +1423,16 @@ var ot = {
|
|
|
1175
1423
|
disabled: n.duration <= 0,
|
|
1176
1424
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
|
|
1177
1425
|
onInput: t[0] ||= (e) => r("seek-input", e)
|
|
1178
|
-
}, null, 40,
|
|
1426
|
+
}, null, 40, _t)
|
|
1179
1427
|
]),
|
|
1180
|
-
c("span",
|
|
1428
|
+
c("span", vt, j(n.durationLabel), 1),
|
|
1181
1429
|
c("div", {
|
|
1182
1430
|
ref_key: "rootRef",
|
|
1183
1431
|
ref: l,
|
|
1184
1432
|
"data-testid": "vibe-media-volume",
|
|
1185
1433
|
"data-layout": n.volumeControlLayout,
|
|
1186
1434
|
class: "relative flex items-center justify-end"
|
|
1187
|
-
}, [d.value && u.value ? (w(), s("div",
|
|
1435
|
+
}, [d.value && u.value ? (w(), s("div", bt, [c("div", xt, [
|
|
1188
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),
|
|
1189
1437
|
c("div", {
|
|
1190
1438
|
class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
|
|
@@ -1201,8 +1449,8 @@ var ot = {
|
|
|
1201
1449
|
value: f.value,
|
|
1202
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",
|
|
1203
1451
|
onInput: t[1] ||= (e) => r("volume-input", e)
|
|
1204
|
-
}, null, 40,
|
|
1205
|
-
])])) : o("", !0), c("div",
|
|
1452
|
+
}, null, 40, St)
|
|
1453
|
+
])])) : o("", !0), c("div", Ct, [c("button", {
|
|
1206
1454
|
type: "button",
|
|
1207
1455
|
"data-testid": "vibe-media-volume-button",
|
|
1208
1456
|
"aria-label": g.value,
|
|
@@ -1211,7 +1459,7 @@ var ot = {
|
|
|
1211
1459
|
}, [(w(), a(A(m.value), {
|
|
1212
1460
|
class: "h-4 w-4 stroke-[1.9]",
|
|
1213
1461
|
"aria-hidden": "true"
|
|
1214
|
-
}))], 8,
|
|
1462
|
+
}))], 8, wt), n.volumeControlLayout === "horizontal" ? (w(), s("div", Tt, [
|
|
1215
1463
|
t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1216
1464
|
c("div", {
|
|
1217
1465
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -1228,24 +1476,24 @@ var ot = {
|
|
|
1228
1476
|
value: f.value,
|
|
1229
1477
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
|
|
1230
1478
|
onInput: t[2] ||= (e) => r("volume-input", e)
|
|
1231
|
-
}, null, 40,
|
|
1232
|
-
])) : o("", !0)])], 8,
|
|
1479
|
+
}, null, 40, Et)
|
|
1480
|
+
])) : o("", !0)])], 8, yt)
|
|
1233
1481
|
])]));
|
|
1234
1482
|
}
|
|
1235
|
-
}),
|
|
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 = {
|
|
1236
1484
|
key: 1,
|
|
1237
1485
|
"data-testid": "vibe-title",
|
|
1238
1486
|
class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
|
|
1239
|
-
},
|
|
1487
|
+
}, Nt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, Pt = {
|
|
1240
1488
|
"data-testid": "vibe-pagination",
|
|
1241
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]"
|
|
1242
|
-
},
|
|
1490
|
+
}, Ft = { class: "whitespace-nowrap" }, It = {
|
|
1243
1491
|
key: 1,
|
|
1244
1492
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
1245
|
-
},
|
|
1493
|
+
}, Lt = {
|
|
1246
1494
|
key: 0,
|
|
1247
1495
|
class: "grid gap-2 max-[720px]:justify-items-start"
|
|
1248
|
-
},
|
|
1496
|
+
}, Rt = /* @__PURE__ */ d({
|
|
1249
1497
|
__name: "FullscreenHeader",
|
|
1250
1498
|
props: {
|
|
1251
1499
|
currentIndex: {},
|
|
@@ -1259,47 +1507,47 @@ var ot = {
|
|
|
1259
1507
|
emits: ["back-to-list"],
|
|
1260
1508
|
setup(e, { emit: t }) {
|
|
1261
1509
|
let n = e, r = t;
|
|
1262
|
-
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", {
|
|
1263
1511
|
key: 0,
|
|
1264
1512
|
type: "button",
|
|
1265
1513
|
"data-testid": "vibe-back-to-list",
|
|
1266
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",
|
|
1267
1515
|
"aria-label": "Back to list",
|
|
1268
1516
|
onClick: t[0] ||= (e) => r("back-to-list")
|
|
1269
|
-
}, [u(N(
|
|
1517
|
+
}, [u(N(J), {
|
|
1270
1518
|
class: "h-4 w-4 stroke-[2.2]",
|
|
1271
1519
|
"aria-hidden": "true"
|
|
1272
|
-
})])) : 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, [
|
|
1273
1521
|
n.loading ? (w(), a(N(oe), {
|
|
1274
1522
|
key: 0,
|
|
1275
1523
|
"data-testid": "vibe-pagination-spinner",
|
|
1276
1524
|
class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
|
|
1277
1525
|
"aria-hidden": "true"
|
|
1278
1526
|
})) : o("", !0),
|
|
1279
|
-
c("span",
|
|
1280
|
-
n.paginationDetail ? (w(), s("span",
|
|
1281
|
-
]), 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)]));
|
|
1282
1530
|
}
|
|
1283
|
-
}),
|
|
1531
|
+
}), zt = {
|
|
1284
1532
|
image: ae,
|
|
1285
|
-
video:
|
|
1286
|
-
audio:
|
|
1533
|
+
video: re,
|
|
1534
|
+
audio: Y,
|
|
1287
1535
|
other: ie
|
|
1288
|
-
},
|
|
1536
|
+
}, Bt = {
|
|
1289
1537
|
image: "Image",
|
|
1290
1538
|
video: "Video",
|
|
1291
1539
|
audio: "Audio",
|
|
1292
1540
|
other: "File"
|
|
1293
1541
|
};
|
|
1294
|
-
function
|
|
1295
|
-
return
|
|
1542
|
+
function Vt(e) {
|
|
1543
|
+
return zt[e];
|
|
1296
1544
|
}
|
|
1297
|
-
function
|
|
1298
|
-
return
|
|
1545
|
+
function Ht(e) {
|
|
1546
|
+
return Bt[e];
|
|
1299
1547
|
}
|
|
1300
1548
|
//#endregion
|
|
1301
1549
|
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
1302
|
-
function
|
|
1550
|
+
function Ut() {
|
|
1303
1551
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = 0;
|
|
1304
1552
|
function r(r) {
|
|
1305
1553
|
let a = {
|
|
@@ -1322,7 +1570,7 @@ function It() {
|
|
|
1322
1570
|
function i() {
|
|
1323
1571
|
if (t.size === 0) return;
|
|
1324
1572
|
let n = [...t.values()].sort((e, t) => {
|
|
1325
|
-
let n =
|
|
1573
|
+
let n = Gt(e) - Gt(t);
|
|
1326
1574
|
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
1327
1575
|
});
|
|
1328
1576
|
for (let r of n) {
|
|
@@ -1336,8 +1584,8 @@ function It() {
|
|
|
1336
1584
|
}
|
|
1337
1585
|
return { request: r };
|
|
1338
1586
|
}
|
|
1339
|
-
var
|
|
1340
|
-
function
|
|
1587
|
+
var Wt = Ut();
|
|
1588
|
+
function Gt(e) {
|
|
1341
1589
|
try {
|
|
1342
1590
|
let t = e.getPriority();
|
|
1343
1591
|
return Number.isFinite(t) ? t : Infinity;
|
|
@@ -1347,19 +1595,19 @@ function Rt(e) {
|
|
|
1347
1595
|
}
|
|
1348
1596
|
//#endregion
|
|
1349
1597
|
//#region src/components/viewer-core/useFullscreenPreloadController.ts
|
|
1350
|
-
var
|
|
1598
|
+
var Kt = [
|
|
1351
1599
|
0,
|
|
1352
1600
|
1,
|
|
1353
1601
|
2,
|
|
1354
1602
|
3
|
|
1355
|
-
],
|
|
1603
|
+
], qt = {
|
|
1356
1604
|
0: 0,
|
|
1357
1605
|
1: 1,
|
|
1358
1606
|
2: 2,
|
|
1359
1607
|
3: 3
|
|
1360
1608
|
};
|
|
1361
|
-
function
|
|
1362
|
-
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();
|
|
1363
1611
|
L([
|
|
1364
1612
|
e.active,
|
|
1365
1613
|
e.items,
|
|
@@ -1380,14 +1628,14 @@ function Vt(e) {
|
|
|
1380
1628
|
}
|
|
1381
1629
|
function l(e, t) {
|
|
1382
1630
|
if (t instanceof HTMLImageElement) {
|
|
1383
|
-
i.set(e, t),
|
|
1631
|
+
i.set(e, t), Xt(t) && d(e);
|
|
1384
1632
|
return;
|
|
1385
1633
|
}
|
|
1386
1634
|
i.delete(e);
|
|
1387
1635
|
}
|
|
1388
1636
|
function u(e, t) {
|
|
1389
1637
|
if (t instanceof HTMLMediaElement) {
|
|
1390
|
-
a.set(e, t),
|
|
1638
|
+
a.set(e, t), Zt(t) && d(e);
|
|
1391
1639
|
return;
|
|
1392
1640
|
}
|
|
1393
1641
|
a.delete(e);
|
|
@@ -1428,7 +1676,7 @@ function Vt(e) {
|
|
|
1428
1676
|
assetType: s.item.type === "image" ? "image" : "video",
|
|
1429
1677
|
getPriority: () => g(o.index),
|
|
1430
1678
|
onGrant: () => {
|
|
1431
|
-
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);
|
|
1432
1680
|
},
|
|
1433
1681
|
url: s.item.url
|
|
1434
1682
|
})
|
|
@@ -1439,14 +1687,14 @@ function Vt(e) {
|
|
|
1439
1687
|
}
|
|
1440
1688
|
function h() {
|
|
1441
1689
|
let t = e.resolvedActiveIndex.value;
|
|
1442
|
-
return
|
|
1690
|
+
return Kt.map((e) => _(t + e)).filter((e) => !!e);
|
|
1443
1691
|
}
|
|
1444
1692
|
function g(t) {
|
|
1445
|
-
return e.active.value ?
|
|
1693
|
+
return e.active.value ? qt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1446
1694
|
}
|
|
1447
1695
|
function _(t) {
|
|
1448
1696
|
let n = e.items.value[t];
|
|
1449
|
-
return !n || !
|
|
1697
|
+
return !n || !Qt(n) ? null : {
|
|
1450
1698
|
index: t,
|
|
1451
1699
|
item: n,
|
|
1452
1700
|
key: e.getItemKey(n)
|
|
@@ -1495,26 +1743,26 @@ function Vt(e) {
|
|
|
1495
1743
|
shouldAttachSlideAsset: s
|
|
1496
1744
|
};
|
|
1497
1745
|
}
|
|
1498
|
-
function
|
|
1746
|
+
function Yt(e, t, n) {
|
|
1499
1747
|
let r = t.get(e);
|
|
1500
|
-
if (r) return
|
|
1748
|
+
if (r) return Xt(r);
|
|
1501
1749
|
let i = n.get(e);
|
|
1502
|
-
return i ?
|
|
1750
|
+
return i ? Zt(i) : !1;
|
|
1503
1751
|
}
|
|
1504
|
-
function
|
|
1752
|
+
function Xt(e) {
|
|
1505
1753
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1506
1754
|
}
|
|
1507
|
-
function
|
|
1755
|
+
function Zt(e) {
|
|
1508
1756
|
let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
1509
1757
|
return e.readyState >= t;
|
|
1510
1758
|
}
|
|
1511
|
-
function
|
|
1759
|
+
function Qt(e) {
|
|
1512
1760
|
return e.type === "image" || e.type === "video" || e.type === "audio";
|
|
1513
1761
|
}
|
|
1514
1762
|
//#endregion
|
|
1515
1763
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
1516
|
-
function
|
|
1517
|
-
let t =
|
|
1764
|
+
function $t(e) {
|
|
1765
|
+
let t = Jt({
|
|
1518
1766
|
active: e.active,
|
|
1519
1767
|
getItemKey: r,
|
|
1520
1768
|
isAssetReady: m,
|
|
@@ -1524,10 +1772,10 @@ function Kt(e) {
|
|
|
1524
1772
|
});
|
|
1525
1773
|
function n(e, t) {
|
|
1526
1774
|
let n = t.title?.trim();
|
|
1527
|
-
return n ? `${e} ${n}` : `${e} ${
|
|
1775
|
+
return n ? `${e} ${n}` : `${e} ${Ht(t.type).toLowerCase()}`;
|
|
1528
1776
|
}
|
|
1529
1777
|
function r(e) {
|
|
1530
|
-
return
|
|
1778
|
+
return Q(e);
|
|
1531
1779
|
}
|
|
1532
1780
|
function i(e) {
|
|
1533
1781
|
return t.shouldAttachSlideAsset(e);
|
|
@@ -1587,11 +1835,11 @@ function Kt(e) {
|
|
|
1587
1835
|
}
|
|
1588
1836
|
//#endregion
|
|
1589
1837
|
//#region src/components/viewer-core/slotContent.ts
|
|
1590
|
-
function
|
|
1838
|
+
function en(e) {
|
|
1591
1839
|
if (!Array.isArray(e)) return !1;
|
|
1592
1840
|
for (let t of e) {
|
|
1593
1841
|
if (Array.isArray(t)) {
|
|
1594
|
-
if (
|
|
1842
|
+
if (en(t)) return !0;
|
|
1595
1843
|
continue;
|
|
1596
1844
|
}
|
|
1597
1845
|
if (!h(t)) {
|
|
@@ -1602,20 +1850,20 @@ function qt(e) {
|
|
|
1602
1850
|
if (t != null && t !== !1) return !0;
|
|
1603
1851
|
continue;
|
|
1604
1852
|
}
|
|
1605
|
-
if (!
|
|
1853
|
+
if (!tn(t)) return !0;
|
|
1606
1854
|
}
|
|
1607
1855
|
return !1;
|
|
1608
1856
|
}
|
|
1609
|
-
function
|
|
1610
|
-
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;
|
|
1611
1859
|
}
|
|
1612
1860
|
//#endregion
|
|
1613
1861
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1614
|
-
var
|
|
1615
|
-
function
|
|
1862
|
+
var nn = "no items available";
|
|
1863
|
+
function rn(e) {
|
|
1616
1864
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1617
1865
|
loading: !!e.loading.value,
|
|
1618
|
-
message:
|
|
1866
|
+
message: nn,
|
|
1619
1867
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1620
1868
|
surface: e.surface,
|
|
1621
1869
|
total: e.itemCount.value
|
|
@@ -1623,23 +1871,23 @@ function Xt(e) {
|
|
|
1623
1871
|
return {
|
|
1624
1872
|
emptyStateProps: t,
|
|
1625
1873
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1626
|
-
showCustomEmptyState: i(() =>
|
|
1874
|
+
showCustomEmptyState: i(() => en(n.value)),
|
|
1627
1875
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1628
1876
|
};
|
|
1629
1877
|
}
|
|
1630
1878
|
//#endregion
|
|
1631
1879
|
//#region src/components/viewer-core/format.ts
|
|
1632
|
-
function
|
|
1880
|
+
function an(e) {
|
|
1633
1881
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1634
1882
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1635
1883
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1636
1884
|
}
|
|
1637
1885
|
//#endregion
|
|
1638
1886
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1639
|
-
function
|
|
1887
|
+
function on(e) {
|
|
1640
1888
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1641
1889
|
}
|
|
1642
|
-
function
|
|
1890
|
+
function sn(e) {
|
|
1643
1891
|
return e.phase === "failed" ? {
|
|
1644
1892
|
kind: "failed",
|
|
1645
1893
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1662,7 +1910,7 @@ function $t(e) {
|
|
|
1662
1910
|
}
|
|
1663
1911
|
//#endregion
|
|
1664
1912
|
//#region src/components/viewer-core/useActivation.ts
|
|
1665
|
-
function
|
|
1913
|
+
function cn(e) {
|
|
1666
1914
|
let t = !1;
|
|
1667
1915
|
L(e.enabled, async (t) => {
|
|
1668
1916
|
if (n(t), t) {
|
|
@@ -1685,7 +1933,7 @@ function en(e) {
|
|
|
1685
1933
|
}
|
|
1686
1934
|
//#endregion
|
|
1687
1935
|
//#region src/components/viewer-core/assetState.ts
|
|
1688
|
-
var
|
|
1936
|
+
var ln = {
|
|
1689
1937
|
currentTime: 0,
|
|
1690
1938
|
duration: 0,
|
|
1691
1939
|
errorKind: null,
|
|
@@ -1694,38 +1942,38 @@ var tn = {
|
|
|
1694
1942
|
ready: !1,
|
|
1695
1943
|
volume: 1
|
|
1696
1944
|
};
|
|
1697
|
-
function
|
|
1698
|
-
return { ...
|
|
1945
|
+
function un() {
|
|
1946
|
+
return { ...ln };
|
|
1699
1947
|
}
|
|
1700
|
-
function
|
|
1948
|
+
function dn(e) {
|
|
1701
1949
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1702
1950
|
}
|
|
1703
|
-
function
|
|
1704
|
-
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);
|
|
1705
1953
|
}
|
|
1706
|
-
function
|
|
1954
|
+
function pn(e, t) {
|
|
1707
1955
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1708
1956
|
}
|
|
1709
1957
|
//#endregion
|
|
1710
1958
|
//#region src/components/viewer-core/loadError.ts
|
|
1711
|
-
var
|
|
1712
|
-
function
|
|
1959
|
+
var mn = /* @__PURE__ */ new Map();
|
|
1960
|
+
function hn(e) {
|
|
1713
1961
|
return e === "not-found" ? "404" : "Load error";
|
|
1714
1962
|
}
|
|
1715
|
-
function
|
|
1963
|
+
function gn(e) {
|
|
1716
1964
|
return e === "generic";
|
|
1717
1965
|
}
|
|
1718
|
-
function
|
|
1719
|
-
return
|
|
1966
|
+
function _n(e) {
|
|
1967
|
+
return vn(e).then((e) => e ?? "generic");
|
|
1720
1968
|
}
|
|
1721
|
-
function
|
|
1722
|
-
let t =
|
|
1969
|
+
function vn(e) {
|
|
1970
|
+
let t = mn.get(e);
|
|
1723
1971
|
if (t) return t;
|
|
1724
|
-
let n =
|
|
1725
|
-
return
|
|
1972
|
+
let n = yn(e);
|
|
1973
|
+
return mn.set(e, n), n;
|
|
1726
1974
|
}
|
|
1727
|
-
async function
|
|
1728
|
-
if (!
|
|
1975
|
+
async function yn(e) {
|
|
1976
|
+
if (!bn(e)) return null;
|
|
1729
1977
|
try {
|
|
1730
1978
|
let t = await fetch(e, { method: "HEAD" });
|
|
1731
1979
|
return t.ok ? null : t.status === 404 ? "not-found" : "generic";
|
|
@@ -1733,12 +1981,12 @@ async function fn(e) {
|
|
|
1733
1981
|
return "generic";
|
|
1734
1982
|
}
|
|
1735
1983
|
}
|
|
1736
|
-
function
|
|
1984
|
+
function bn(e) {
|
|
1737
1985
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1738
1986
|
}
|
|
1739
1987
|
//#endregion
|
|
1740
1988
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1741
|
-
function
|
|
1989
|
+
function xn(e) {
|
|
1742
1990
|
try {
|
|
1743
1991
|
let t = e.play();
|
|
1744
1992
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1746,12 +1994,12 @@ function mn(e) {
|
|
|
1746
1994
|
}
|
|
1747
1995
|
//#endregion
|
|
1748
1996
|
//#region src/components/viewer-core/useMedia.ts
|
|
1749
|
-
function
|
|
1750
|
-
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(() => {
|
|
1751
1999
|
let t = /* @__PURE__ */ new Map();
|
|
1752
|
-
for (let n of e.items.value) t.set(
|
|
2000
|
+
for (let n of e.items.value) t.set(Q(n), n);
|
|
1753
2001
|
return t;
|
|
1754
|
-
}), 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);
|
|
1755
2003
|
L(() => u.value, async () => {
|
|
1756
2004
|
await C();
|
|
1757
2005
|
}), L(() => e.itemCount.value, async () => {
|
|
@@ -1774,7 +2022,7 @@ function hn(e) {
|
|
|
1774
2022
|
c.delete(e);
|
|
1775
2023
|
}
|
|
1776
2024
|
function b(e, r) {
|
|
1777
|
-
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)));
|
|
1778
2026
|
}
|
|
1779
2027
|
function x() {
|
|
1780
2028
|
H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
@@ -1796,14 +2044,14 @@ function hn(e) {
|
|
|
1796
2044
|
V(i, n);
|
|
1797
2045
|
continue;
|
|
1798
2046
|
}
|
|
1799
|
-
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);
|
|
1800
2048
|
}
|
|
1801
2049
|
for (let [e, n] of c.entries()) {
|
|
1802
2050
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1803
2051
|
V(n, e);
|
|
1804
2052
|
continue;
|
|
1805
2053
|
}
|
|
1806
|
-
|
|
2054
|
+
xn(n), W(e, n);
|
|
1807
2055
|
}
|
|
1808
2056
|
}
|
|
1809
2057
|
function w(e, t) {
|
|
@@ -1812,16 +2060,16 @@ function hn(e) {
|
|
|
1812
2060
|
let i = r.value[e]?.ready ?? !1;
|
|
1813
2061
|
W(e, n, t.type);
|
|
1814
2062
|
let a = r.value[e]?.ready ?? !1;
|
|
1815
|
-
!i && a &&
|
|
2063
|
+
!i && a && Y(e, n.currentSrc || n.src || ie(e));
|
|
1816
2064
|
}
|
|
1817
2065
|
}
|
|
1818
2066
|
function T(e, r) {
|
|
1819
|
-
t.value[e] = !0, n.value[e] = null,
|
|
2067
|
+
t.value[e] = !0, n.value[e] = null, Y(e, r);
|
|
1820
2068
|
}
|
|
1821
2069
|
async function E(r, i) {
|
|
1822
|
-
let a =
|
|
2070
|
+
let a = re(r) ?? e.activeItem.value;
|
|
1823
2071
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1824
|
-
let o = await
|
|
2072
|
+
let o = await _n(i);
|
|
1825
2073
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1826
2074
|
item: a,
|
|
1827
2075
|
occurrenceKey: r,
|
|
@@ -1831,7 +2079,7 @@ function hn(e) {
|
|
|
1831
2079
|
});
|
|
1832
2080
|
}
|
|
1833
2081
|
async function O(t, n) {
|
|
1834
|
-
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;
|
|
1835
2083
|
if (r) {
|
|
1836
2084
|
r.pause();
|
|
1837
2085
|
try {
|
|
@@ -1839,7 +2087,7 @@ function hn(e) {
|
|
|
1839
2087
|
} catch {}
|
|
1840
2088
|
}
|
|
1841
2089
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1842
|
-
let o = await
|
|
2090
|
+
let o = await _n(n);
|
|
1843
2091
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1844
2092
|
item: a,
|
|
1845
2093
|
occurrenceKey: t,
|
|
@@ -1849,23 +2097,23 @@ function hn(e) {
|
|
|
1849
2097
|
});
|
|
1850
2098
|
}
|
|
1851
2099
|
function k(e, t, n) {
|
|
1852
|
-
e.button !== 0 || Date.now() < n ||
|
|
2100
|
+
e.button !== 0 || Date.now() < n || J(s.get(t) ?? null);
|
|
1853
2101
|
}
|
|
1854
2102
|
function A(e, t, n) {
|
|
1855
|
-
e.button !== 0 || Date.now() < n ||
|
|
2103
|
+
e.button !== 0 || Date.now() < n || J(K(t));
|
|
1856
2104
|
}
|
|
1857
2105
|
function j(e) {
|
|
1858
2106
|
let t = q(), n = d.value;
|
|
1859
2107
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1860
2108
|
let r = Number.parseFloat(e.target.value);
|
|
1861
2109
|
if (!Number.isFinite(r)) return;
|
|
1862
|
-
let i =
|
|
2110
|
+
let i = Cn(r, 0, m.value || 0);
|
|
1863
2111
|
ne(n, i, t), t.currentTime = i;
|
|
1864
2112
|
}
|
|
1865
2113
|
function M(e) {
|
|
1866
2114
|
let t = q(), n = d.value;
|
|
1867
2115
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1868
|
-
let r =
|
|
2116
|
+
let r = Cn(Number.parseFloat(e.target.value), 0, 1);
|
|
1869
2117
|
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
|
|
1870
2118
|
}
|
|
1871
2119
|
function N() {
|
|
@@ -1886,16 +2134,16 @@ function hn(e) {
|
|
|
1886
2134
|
}
|
|
1887
2135
|
function z(e) {
|
|
1888
2136
|
let t = R(e);
|
|
1889
|
-
return t ?
|
|
1890
|
-
}
|
|
1891
|
-
function B(e) {
|
|
1892
|
-
return ln(R(e));
|
|
2137
|
+
return t ? hn(t) : null;
|
|
1893
2138
|
}
|
|
1894
2139
|
function ee(e) {
|
|
2140
|
+
return gn(R(e));
|
|
2141
|
+
}
|
|
2142
|
+
function te(e) {
|
|
1895
2143
|
return `${e}:${a.value[e] ?? 0}`;
|
|
1896
2144
|
}
|
|
1897
|
-
async function
|
|
1898
|
-
if (!
|
|
2145
|
+
async function B(e) {
|
|
2146
|
+
if (!ee(e)) return;
|
|
1899
2147
|
t.value[e] = !1, n.value[e] = null;
|
|
1900
2148
|
let r = U(e);
|
|
1901
2149
|
r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
|
|
@@ -1916,17 +2164,17 @@ function hn(e) {
|
|
|
1916
2164
|
for (let [e, t] of c.entries()) V(t, e);
|
|
1917
2165
|
}
|
|
1918
2166
|
function U(e) {
|
|
1919
|
-
return r.value[e] || (r.value[e] =
|
|
2167
|
+
return r.value[e] || (r.value[e] = un()), r.value[e];
|
|
1920
2168
|
}
|
|
1921
2169
|
function W(e, t, n) {
|
|
1922
|
-
|
|
2170
|
+
fn(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1923
2171
|
}
|
|
1924
2172
|
function ne(e, t, n) {
|
|
1925
2173
|
let r = U(e);
|
|
1926
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;
|
|
1927
2175
|
}
|
|
1928
2176
|
function G(e) {
|
|
1929
|
-
return
|
|
2177
|
+
return Cn(o.value[e] ?? 1, 0, 1);
|
|
1930
2178
|
}
|
|
1931
2179
|
function K(e) {
|
|
1932
2180
|
return s.get(e) ?? c.get(e) ?? null;
|
|
@@ -1934,17 +2182,17 @@ function hn(e) {
|
|
|
1934
2182
|
function q() {
|
|
1935
2183
|
return d.value ? K(d.value) : null;
|
|
1936
2184
|
}
|
|
1937
|
-
function
|
|
2185
|
+
function J(e) {
|
|
1938
2186
|
if (e) {
|
|
1939
2187
|
if (e.paused) {
|
|
1940
|
-
|
|
2188
|
+
xn(e);
|
|
1941
2189
|
return;
|
|
1942
2190
|
}
|
|
1943
2191
|
e.pause();
|
|
1944
2192
|
}
|
|
1945
2193
|
}
|
|
1946
|
-
function
|
|
1947
|
-
let r =
|
|
2194
|
+
function Y(t, n) {
|
|
2195
|
+
let r = re(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
|
|
1948
2196
|
if (!r || !n) return;
|
|
1949
2197
|
let i = `${t}|${n}`;
|
|
1950
2198
|
l.has(i) || (l.add(i), e.onAssetLoad?.({
|
|
@@ -1954,11 +2202,11 @@ function hn(e) {
|
|
|
1954
2202
|
url: n
|
|
1955
2203
|
}));
|
|
1956
2204
|
}
|
|
1957
|
-
function
|
|
2205
|
+
function re(e) {
|
|
1958
2206
|
return f.value.get(e) ?? null;
|
|
1959
2207
|
}
|
|
1960
2208
|
function ie(e) {
|
|
1961
|
-
return
|
|
2209
|
+
return re(e)?.url ?? null;
|
|
1962
2210
|
}
|
|
1963
2211
|
return {
|
|
1964
2212
|
activeAssetErrorKind: g,
|
|
@@ -1967,11 +2215,11 @@ function hn(e) {
|
|
|
1967
2215
|
activeMediaState: p,
|
|
1968
2216
|
getAssetErrorKind: R,
|
|
1969
2217
|
getAssetErrorLabel: z,
|
|
1970
|
-
getAssetRenderKey:
|
|
2218
|
+
getAssetRenderKey: te,
|
|
1971
2219
|
getImageSource: I,
|
|
1972
2220
|
isImageReady: P,
|
|
1973
2221
|
isMediaReady: F,
|
|
1974
|
-
canRetryAsset:
|
|
2222
|
+
canRetryAsset: ee,
|
|
1975
2223
|
mediaStates: r,
|
|
1976
2224
|
onAudioCoverClick: A,
|
|
1977
2225
|
onImageError: E,
|
|
@@ -1987,20 +2235,20 @@ function hn(e) {
|
|
|
1987
2235
|
registerVideoElement: v,
|
|
1988
2236
|
resetAssetState: S,
|
|
1989
2237
|
resetMediaState: x,
|
|
1990
|
-
retryAsset:
|
|
2238
|
+
retryAsset: B,
|
|
1991
2239
|
syncMediaPlayback: C
|
|
1992
2240
|
};
|
|
1993
2241
|
}
|
|
1994
|
-
function
|
|
2242
|
+
function Cn(e, t, n) {
|
|
1995
2243
|
return Math.min(Math.max(e, t), n);
|
|
1996
2244
|
}
|
|
1997
2245
|
//#endregion
|
|
1998
2246
|
//#region src/components/viewer-core/virtualization.ts
|
|
1999
|
-
var
|
|
2247
|
+
var wn = {
|
|
2000
2248
|
backward: 1,
|
|
2001
2249
|
forward: 3
|
|
2002
2250
|
};
|
|
2003
|
-
function
|
|
2251
|
+
function Tn(e, t, n = wn) {
|
|
2004
2252
|
return t <= 0 ? {
|
|
2005
2253
|
start: 0,
|
|
2006
2254
|
end: -1
|
|
@@ -2009,14 +2257,14 @@ function vn(e, t, n = _n) {
|
|
|
2009
2257
|
end: Math.min(t - 1, e + n.forward)
|
|
2010
2258
|
};
|
|
2011
2259
|
}
|
|
2012
|
-
function
|
|
2013
|
-
let r =
|
|
2260
|
+
function En(e, t, n = wn) {
|
|
2261
|
+
let r = Tn(t, e.length, n);
|
|
2014
2262
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
2015
2263
|
item: e,
|
|
2016
2264
|
index: r.start + t
|
|
2017
2265
|
}));
|
|
2018
2266
|
}
|
|
2019
|
-
function
|
|
2267
|
+
function Dn(e, t, n, r, i) {
|
|
2020
2268
|
return {
|
|
2021
2269
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
2022
2270
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -2024,12 +2272,12 @@ function bn(e, t, n, r, i) {
|
|
|
2024
2272
|
}
|
|
2025
2273
|
//#endregion
|
|
2026
2274
|
//#region src/components/viewer-core/useViewer.ts
|
|
2027
|
-
function
|
|
2028
|
-
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({
|
|
2029
2277
|
itemCount: r.value.length,
|
|
2030
2278
|
loading: s.value,
|
|
2031
2279
|
phase: e.phase
|
|
2032
|
-
})), 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({
|
|
2033
2281
|
items: r,
|
|
2034
2282
|
activeItem: C,
|
|
2035
2283
|
activeMediaItem: w,
|
|
@@ -2038,14 +2286,14 @@ function xn(e, t, n = {}) {
|
|
|
2038
2286
|
loopFullscreenVideo: l,
|
|
2039
2287
|
onAssetError: n.onAssetError,
|
|
2040
2288
|
onAssetLoad: n.onAssetLoad
|
|
2041
|
-
}), 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({
|
|
2042
2290
|
errorMessage: o.value,
|
|
2043
2291
|
hasItems: r.value.length > 0,
|
|
2044
2292
|
hasNextPage: c.value,
|
|
2045
2293
|
phase: d.value,
|
|
2046
2294
|
surface: "fullscreen"
|
|
2047
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
2048
|
-
|
|
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({
|
|
2049
2297
|
enabled: _,
|
|
2050
2298
|
onDisable() {
|
|
2051
2299
|
H(), T.resetMediaState();
|
|
@@ -2075,15 +2323,15 @@ function xn(e, t, n = {}) {
|
|
|
2075
2323
|
return t && !I(-1) || n && !I(1) ? e * .24 : e;
|
|
2076
2324
|
}
|
|
2077
2325
|
function z(e) {
|
|
2078
|
-
!_.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));
|
|
2079
2327
|
}
|
|
2080
|
-
function
|
|
2328
|
+
function ee(e) {
|
|
2081
2329
|
!_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
|
|
2082
2330
|
}
|
|
2083
|
-
function
|
|
2331
|
+
function te(e) {
|
|
2084
2332
|
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), V());
|
|
2085
2333
|
}
|
|
2086
|
-
function
|
|
2334
|
+
function B(e) {
|
|
2087
2335
|
!_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), H());
|
|
2088
2336
|
}
|
|
2089
2337
|
function V() {
|
|
@@ -2093,13 +2341,13 @@ function xn(e, t, n = {}) {
|
|
|
2093
2341
|
m.value = 0, h.value = !1, v = null;
|
|
2094
2342
|
}
|
|
2095
2343
|
function U(e) {
|
|
2096
|
-
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;
|
|
2097
2345
|
e.preventDefault();
|
|
2098
2346
|
let t = Date.now();
|
|
2099
2347
|
t < b || (b = t + 400, L(e.deltaY > 0 ? 1 : -1));
|
|
2100
2348
|
}
|
|
2101
2349
|
function W(e) {
|
|
2102
|
-
!_.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)));
|
|
2103
2351
|
}
|
|
2104
2352
|
function ne(e, t) {
|
|
2105
2353
|
T.onVideoClick(e, t, x);
|
|
@@ -2113,17 +2361,17 @@ function xn(e, t, n = {}) {
|
|
|
2113
2361
|
function q(e) {
|
|
2114
2362
|
T.onMediaVolumeInput(e);
|
|
2115
2363
|
}
|
|
2116
|
-
function
|
|
2364
|
+
function J() {
|
|
2117
2365
|
T.onMediaVolumeToggle();
|
|
2118
2366
|
}
|
|
2119
|
-
function
|
|
2367
|
+
function Y(e) {
|
|
2120
2368
|
return e.type === "image" || e.type === "video";
|
|
2121
2369
|
}
|
|
2122
|
-
function
|
|
2370
|
+
function re(e) {
|
|
2123
2371
|
return e.type === "audio";
|
|
2124
2372
|
}
|
|
2125
2373
|
function ie(e) {
|
|
2126
|
-
return
|
|
2374
|
+
return Dn(e, S.value, g.value, m.value, h.value);
|
|
2127
2375
|
}
|
|
2128
2376
|
return {
|
|
2129
2377
|
activeItem: C,
|
|
@@ -2138,13 +2386,13 @@ function xn(e, t, n = {}) {
|
|
|
2138
2386
|
getAssetErrorKind: T.getAssetErrorKind,
|
|
2139
2387
|
getAssetErrorLabel: T.getAssetErrorLabel,
|
|
2140
2388
|
getAssetRenderKey: T.getAssetRenderKey,
|
|
2141
|
-
formatPlaybackTime:
|
|
2389
|
+
formatPlaybackTime: an,
|
|
2142
2390
|
getImageSource: T.getImageSource,
|
|
2143
2391
|
getSlideStyle: ie,
|
|
2144
2392
|
hasNextPage: c,
|
|
2145
2393
|
isAtEnd: E,
|
|
2146
|
-
isAudio:
|
|
2147
|
-
isVisual:
|
|
2394
|
+
isAudio: re,
|
|
2395
|
+
isVisual: Y,
|
|
2148
2396
|
items: r,
|
|
2149
2397
|
loading: s,
|
|
2150
2398
|
mediaStates: T.mediaStates,
|
|
@@ -2157,11 +2405,11 @@ function xn(e, t, n = {}) {
|
|
|
2157
2405
|
onMediaError: T.onMediaError,
|
|
2158
2406
|
onMediaSeekInput: K,
|
|
2159
2407
|
onMediaVolumeInput: q,
|
|
2160
|
-
onMediaVolumeToggle:
|
|
2161
|
-
onPointerCancel:
|
|
2408
|
+
onMediaVolumeToggle: J,
|
|
2409
|
+
onPointerCancel: B,
|
|
2162
2410
|
onPointerDown: z,
|
|
2163
|
-
onPointerMove:
|
|
2164
|
-
onPointerUp:
|
|
2411
|
+
onPointerMove: ee,
|
|
2412
|
+
onPointerUp: te,
|
|
2165
2413
|
onVideoClick: ne,
|
|
2166
2414
|
onWheel: U,
|
|
2167
2415
|
registerAudioElement: T.registerAudioElement,
|
|
@@ -2182,21 +2430,21 @@ function xn(e, t, n = {}) {
|
|
|
2182
2430
|
}
|
|
2183
2431
|
//#endregion
|
|
2184
2432
|
//#region src/components/viewer-core/theme.ts
|
|
2185
|
-
var
|
|
2433
|
+
var kn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", An = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", jn = {
|
|
2186
2434
|
image: !0,
|
|
2187
2435
|
video: !0,
|
|
2188
2436
|
audio: !0,
|
|
2189
2437
|
other: !0
|
|
2190
2438
|
};
|
|
2191
|
-
function
|
|
2192
|
-
return
|
|
2439
|
+
function Mn(e) {
|
|
2440
|
+
return jn[e], kn;
|
|
2193
2441
|
}
|
|
2194
|
-
function
|
|
2195
|
-
return
|
|
2442
|
+
function Nn(e) {
|
|
2443
|
+
return jn[e], An;
|
|
2196
2444
|
}
|
|
2197
2445
|
//#endregion
|
|
2198
2446
|
//#region src/components/viewer-core/useFullscreenAssetEvents.ts
|
|
2199
|
-
function
|
|
2447
|
+
function Pn(e) {
|
|
2200
2448
|
function t(t, n) {
|
|
2201
2449
|
return e.fullscreenMedia.shouldHandleSlideAssetEvent(t, n) ? e.fullscreenMedia.getItemKey(n) : null;
|
|
2202
2450
|
}
|
|
@@ -2229,7 +2477,7 @@ function Dn(e) {
|
|
|
2229
2477
|
}
|
|
2230
2478
|
//#endregion
|
|
2231
2479
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
2232
|
-
function
|
|
2480
|
+
function Fn(e) {
|
|
2233
2481
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
2234
2482
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
2235
2483
|
if (!n) return null;
|
|
@@ -2244,20 +2492,20 @@ function On(e) {
|
|
|
2244
2492
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
2245
2493
|
}
|
|
2246
2494
|
return r <= 0 ? null : {
|
|
2247
|
-
r:
|
|
2248
|
-
g:
|
|
2249
|
-
b:
|
|
2495
|
+
r: In(Math.round(i / r)),
|
|
2496
|
+
g: In(Math.round(a / r)),
|
|
2497
|
+
b: In(Math.round(o / r))
|
|
2250
2498
|
};
|
|
2251
2499
|
} catch {
|
|
2252
2500
|
return null;
|
|
2253
2501
|
}
|
|
2254
2502
|
}
|
|
2255
|
-
function
|
|
2503
|
+
function In(e) {
|
|
2256
2504
|
return Math.min(235, Math.max(26, e));
|
|
2257
2505
|
}
|
|
2258
2506
|
//#endregion
|
|
2259
2507
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
2260
|
-
function
|
|
2508
|
+
function Ln(e) {
|
|
2261
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(() => {
|
|
2262
2510
|
if (!r.value) return;
|
|
2263
2511
|
let { r: e, g: t, b: n } = r.value;
|
|
@@ -2272,7 +2520,7 @@ function An(e) {
|
|
|
2272
2520
|
});
|
|
2273
2521
|
function s(n, r) {
|
|
2274
2522
|
if (!e.showDominantImageTone.value) return;
|
|
2275
|
-
let i =
|
|
2523
|
+
let i = Fn(r);
|
|
2276
2524
|
i && (t.value[n] = i);
|
|
2277
2525
|
}
|
|
2278
2526
|
return {
|
|
@@ -2283,7 +2531,7 @@ function An(e) {
|
|
|
2283
2531
|
}
|
|
2284
2532
|
//#endregion
|
|
2285
2533
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
2286
|
-
var
|
|
2534
|
+
var Rn = ["data-surface"], zn = ["data-surface"], Bn = /* @__PURE__ */ d({
|
|
2287
2535
|
inheritAttrs: !1,
|
|
2288
2536
|
__name: "SurfaceEmptyState",
|
|
2289
2537
|
props: {
|
|
@@ -2297,31 +2545,31 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2297
2545
|
"data-testid": "vibe-empty-state-inline",
|
|
2298
2546
|
"data-surface": e.surface,
|
|
2299
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)]"]
|
|
2300
|
-
}), [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", {
|
|
2301
2549
|
"data-testid": "vibe-empty-state-badge",
|
|
2302
2550
|
"data-surface": e.surface,
|
|
2303
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"])
|
|
2304
|
-
}, j(e.message), 11,
|
|
2552
|
+
}, j(e.message), 11, zn)])], 16));
|
|
2305
2553
|
}
|
|
2306
|
-
}),
|
|
2554
|
+
}), Vn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Hn = {
|
|
2307
2555
|
key: 0,
|
|
2308
2556
|
class: "relative h-full min-h-0"
|
|
2309
|
-
},
|
|
2557
|
+
}, Un = [
|
|
2310
2558
|
"data-item-id",
|
|
2311
2559
|
"data-occurrence-key",
|
|
2312
2560
|
"data-index",
|
|
2313
2561
|
"data-active",
|
|
2314
2562
|
"aria-hidden"
|
|
2315
|
-
],
|
|
2563
|
+
], Wn = {
|
|
2316
2564
|
key: 0,
|
|
2317
2565
|
"data-testid": "vibe-asset-spinner",
|
|
2318
2566
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
2319
|
-
},
|
|
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 = [
|
|
2320
2568
|
"src",
|
|
2321
2569
|
"alt",
|
|
2322
2570
|
"onLoad",
|
|
2323
2571
|
"onError"
|
|
2324
|
-
],
|
|
2572
|
+
], Zn = [
|
|
2325
2573
|
"loop",
|
|
2326
2574
|
"src",
|
|
2327
2575
|
"preload",
|
|
@@ -2340,15 +2588,15 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2340
2588
|
"onStalled",
|
|
2341
2589
|
"onTimeupdate",
|
|
2342
2590
|
"onWaiting"
|
|
2343
|
-
],
|
|
2591
|
+
], Qn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, $n = [
|
|
2344
2592
|
"aria-label",
|
|
2345
2593
|
"disabled",
|
|
2346
2594
|
"onClick"
|
|
2347
|
-
],
|
|
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 = {
|
|
2348
2596
|
key: 0,
|
|
2349
2597
|
"data-testid": "vibe-asset-spinner",
|
|
2350
2598
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
2351
|
-
},
|
|
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 = [
|
|
2352
2600
|
"src",
|
|
2353
2601
|
"preload",
|
|
2354
2602
|
"onCanplay",
|
|
@@ -2364,26 +2612,26 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2364
2612
|
"onStalled",
|
|
2365
2613
|
"onTimeupdate",
|
|
2366
2614
|
"onWaiting"
|
|
2367
|
-
],
|
|
2615
|
+
], cr = {
|
|
2368
2616
|
key: 2,
|
|
2369
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"
|
|
2370
|
-
},
|
|
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 = {
|
|
2371
2619
|
key: 0,
|
|
2372
2620
|
"data-testid": "vibe-fullscreen-overlay",
|
|
2373
2621
|
class: "pointer-events-none absolute inset-0 z-[6]"
|
|
2374
|
-
},
|
|
2622
|
+
}, dr = { class: "h-full w-full" }, fr = {
|
|
2375
2623
|
key: 1,
|
|
2376
2624
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
2377
2625
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
2378
|
-
},
|
|
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 = {
|
|
2379
2627
|
key: 0,
|
|
2380
2628
|
"data-testid": "vibe-fullscreen-aside",
|
|
2381
2629
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
2382
|
-
},
|
|
2630
|
+
}, _r = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, vr = {
|
|
2383
2631
|
key: 0,
|
|
2384
2632
|
"data-testid": "vibe-fullscreen-aside",
|
|
2385
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]"
|
|
2386
|
-
},
|
|
2634
|
+
}, yr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, br = 1280, xr = 768, Sr = /* @__PURE__ */ d({
|
|
2387
2635
|
__name: "FullscreenSurface",
|
|
2388
2636
|
props: {
|
|
2389
2637
|
active: {
|
|
@@ -2435,27 +2683,27 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2435
2683
|
},
|
|
2436
2684
|
emits: ["back-to-list", "update:activeIndex"],
|
|
2437
2685
|
setup(e, { emit: n }) {
|
|
2438
|
-
let d = e, f = F(), m = n, h =
|
|
2686
|
+
let d = e, f = F(), m = n, h = On(d, (e, t) => {
|
|
2439
2687
|
m("update:activeIndex", t);
|
|
2440
2688
|
}, {
|
|
2441
2689
|
enabled: M(d, "active"),
|
|
2442
2690
|
onAssetError: d.reportAssetError ?? void 0,
|
|
2443
2691
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
2444
|
-
}), _ = D(typeof window > "u" ?
|
|
2692
|
+
}), _ = D(typeof window > "u" ? br : window.innerWidth || br), C = $t({
|
|
2445
2693
|
active: M(d, "active"),
|
|
2446
2694
|
items: h.items,
|
|
2447
2695
|
resolvedActiveIndex: h.resolvedActiveIndex,
|
|
2448
2696
|
viewer: h
|
|
2449
|
-
}), T = i(() =>
|
|
2697
|
+
}), T = i(() => Mn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = Ln({
|
|
2450
2698
|
activeItem: h.activeItem,
|
|
2451
2699
|
getItemKey: C.getItemKey,
|
|
2452
2700
|
isImageReady: h.isImageReady,
|
|
2453
2701
|
showDominantImageTone: M(d, "showDominantImageTone")
|
|
2454
|
-
}), L =
|
|
2702
|
+
}), L = Pn({
|
|
2455
2703
|
fullscreenMedia: C,
|
|
2456
|
-
updateDominantToneFromImageElement:
|
|
2704
|
+
updateDominantToneFromImageElement: ve,
|
|
2457
2705
|
viewer: h
|
|
2458
|
-
}), 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(() => {
|
|
2459
2707
|
let e = h.activeItem.value;
|
|
2460
2708
|
return e ? {
|
|
2461
2709
|
hasNextPage: d.hasNextPage,
|
|
@@ -2469,10 +2717,10 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2469
2717
|
...W.value,
|
|
2470
2718
|
kind: h.statusKind.value,
|
|
2471
2719
|
message: h.statusMessage.value
|
|
2472
|
-
}), 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(() => ({
|
|
2473
2721
|
gridTemplateColumns: ie.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
2474
2722
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
2475
|
-
})),
|
|
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({
|
|
2476
2724
|
emptyStateMode: M(d, "emptyStateMode"),
|
|
2477
2725
|
itemCount: i(() => d.items.length),
|
|
2478
2726
|
loading: M(d, "loading"),
|
|
@@ -2480,30 +2728,30 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2480
2728
|
surface: "fullscreen"
|
|
2481
2729
|
});
|
|
2482
2730
|
S(() => {
|
|
2483
|
-
window.addEventListener("resize",
|
|
2731
|
+
window.addEventListener("resize", me);
|
|
2484
2732
|
}), x(() => {
|
|
2485
|
-
window.removeEventListener("resize",
|
|
2733
|
+
window.removeEventListener("resize", me);
|
|
2486
2734
|
});
|
|
2487
|
-
function
|
|
2488
|
-
_.value = window.innerWidth ||
|
|
2489
|
-
}
|
|
2490
|
-
function me(e, t) {
|
|
2491
|
-
C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && _e(e, t);
|
|
2735
|
+
function me() {
|
|
2736
|
+
_.value = window.innerWidth || br;
|
|
2492
2737
|
}
|
|
2493
2738
|
function he(e, t) {
|
|
2494
|
-
C.
|
|
2739
|
+
C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && ve(e, t);
|
|
2495
2740
|
}
|
|
2496
2741
|
function ge(e, t) {
|
|
2742
|
+
C.registerMediaElement(e, t), h.registerVideoElement(e, t);
|
|
2743
|
+
}
|
|
2744
|
+
function _e(e, t) {
|
|
2497
2745
|
C.registerMediaElement(e, t), h.registerAudioElement(e, t);
|
|
2498
2746
|
}
|
|
2499
|
-
function
|
|
2747
|
+
function Z(e, t, n) {
|
|
2500
2748
|
let r = L.onFullscreenMediaEvent(e, t, n), i = n.currentTarget, a = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
2501
2749
|
r && i instanceof HTMLMediaElement && i.readyState >= a && C.settleAssetPreload(r);
|
|
2502
2750
|
}
|
|
2503
|
-
function
|
|
2751
|
+
function ve(e, t) {
|
|
2504
2752
|
I(e, t);
|
|
2505
2753
|
}
|
|
2506
|
-
function
|
|
2754
|
+
function ye(e, t, n) {
|
|
2507
2755
|
let r = L.getHandledItemKey(t, n);
|
|
2508
2756
|
if (!r || (h.onMediaEvent(r, e), !d.loopFullscreenVideo)) return;
|
|
2509
2757
|
let i = e.currentTarget;
|
|
@@ -2514,14 +2762,14 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2514
2762
|
let a = i.play();
|
|
2515
2763
|
a && typeof a.catch == "function" && a.catch(() => {});
|
|
2516
2764
|
}
|
|
2517
|
-
return (e, n) => (w(), s("div",
|
|
2765
|
+
return (e, n) => (w(), s("div", Vn, [
|
|
2518
2766
|
c("div", {
|
|
2519
2767
|
class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
|
|
2520
2768
|
style: b(N(P))
|
|
2521
2769
|
}, null, 6),
|
|
2522
2770
|
c("div", {
|
|
2523
2771
|
class: "relative z-[1] grid h-full min-h-0",
|
|
2524
|
-
style: b(
|
|
2772
|
+
style: b(J.value)
|
|
2525
2773
|
}, [c("div", {
|
|
2526
2774
|
ref: "viewer.stageRef",
|
|
2527
2775
|
"data-testid": "vibe-stage",
|
|
@@ -2531,7 +2779,7 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2531
2779
|
onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
|
|
2532
2780
|
onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
|
|
2533
2781
|
onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
|
|
2534
|
-
}, [N(h).activeItem.value ? (w(), s("div",
|
|
2782
|
+
}, [N(h).activeItem.value ? (w(), s("div", Hn, [
|
|
2535
2783
|
(w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
|
|
2536
2784
|
key: N(C).getItemKey(r),
|
|
2537
2785
|
"data-testid": "vibe-slide",
|
|
@@ -2543,12 +2791,12 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2543
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"]),
|
|
2544
2792
|
style: b(N(h).getSlideStyle(i))
|
|
2545
2793
|
}, [c("div", {
|
|
2546
|
-
class: v(["absolute inset-0 opacity-85", N(
|
|
2794
|
+
class: v(["absolute inset-0 opacity-85", N(Nn)(r.type)]),
|
|
2547
2795
|
style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
|
|
2548
2796
|
}, null, 6), N(h).isVisual(r) ? (w(), s("div", {
|
|
2549
2797
|
key: 0,
|
|
2550
2798
|
class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? V.value : ""])
|
|
2551
|
-
}, [N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2799
|
+
}, [N(C).isAssetLoading(i, r) ? (w(), s("div", Wn, [c("span", Gn, [u(N(oe), {
|
|
2552
2800
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2553
2801
|
"aria-hidden": "true"
|
|
2554
2802
|
})])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
|
|
@@ -2556,19 +2804,19 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2556
2804
|
"data-testid": "vibe-asset-error",
|
|
2557
2805
|
"data-kind": N(C).getAssetErrorKind(r),
|
|
2558
2806
|
class: "grid h-full w-full place-items-center"
|
|
2559
|
-
}, [c("div",
|
|
2807
|
+
}, [c("div", qn, [
|
|
2560
2808
|
u(N(le), {
|
|
2561
2809
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2562
2810
|
"aria-hidden": "true"
|
|
2563
2811
|
}),
|
|
2564
|
-
c("p",
|
|
2812
|
+
c("p", Jn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2565
2813
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2566
2814
|
key: 0,
|
|
2567
2815
|
type: "button",
|
|
2568
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",
|
|
2569
|
-
onClick:
|
|
2570
|
-
}, " Retry ", 8,
|
|
2571
|
-
])], 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", {
|
|
2572
2820
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2573
2821
|
src: N(C).getFullscreenImageSource(i, r),
|
|
2574
2822
|
alt: r.title ?? "",
|
|
@@ -2576,10 +2824,10 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2576
2824
|
draggable: "false",
|
|
2577
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"]),
|
|
2578
2826
|
ref_for: !0,
|
|
2579
|
-
ref: (e) =>
|
|
2827
|
+
ref: (e) => he(N(C).getItemKey(r), e),
|
|
2580
2828
|
onLoad: (e) => N(L).onFullscreenImageLoad(e, i, r),
|
|
2581
2829
|
onError: (e) => N(L).onFullscreenImageError(i, r)
|
|
2582
|
-
}, null, 42,
|
|
2830
|
+
}, null, 42, Xn)) : (w(), s("video", {
|
|
2583
2831
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2584
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"]),
|
|
2585
2833
|
playsinline: "",
|
|
@@ -2587,26 +2835,26 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2587
2835
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
2588
2836
|
preload: N(C).getFullscreenMediaPreload(i),
|
|
2589
2837
|
ref_for: !0,
|
|
2590
|
-
ref: (e) =>
|
|
2591
|
-
onClick:
|
|
2592
|
-
onCanplay: (e) =>
|
|
2593
|
-
onDurationchange: (e) =>
|
|
2594
|
-
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),
|
|
2595
2843
|
onError: (e) => N(L).onFullscreenMediaError(i, r),
|
|
2596
|
-
onLoadstart: (e) =>
|
|
2597
|
-
onLoadedmetadata: (e) =>
|
|
2598
|
-
onPause: (e) =>
|
|
2599
|
-
onPlay: (e) =>
|
|
2600
|
-
onPlaying: (e) =>
|
|
2601
|
-
onSeeking: (e) =>
|
|
2602
|
-
onSeeked: (e) =>
|
|
2603
|
-
onStalled: (e) =>
|
|
2604
|
-
onTimeupdate: (e) =>
|
|
2605
|
-
onWaiting: (e) =>
|
|
2606
|
-
}, 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", {
|
|
2607
2855
|
key: 1,
|
|
2608
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 : ""])
|
|
2609
|
-
}, [c("div",
|
|
2857
|
+
}, [c("div", Qn, [
|
|
2610
2858
|
c("button", {
|
|
2611
2859
|
type: "button",
|
|
2612
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]",
|
|
@@ -2616,19 +2864,19 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2616
2864
|
}, [
|
|
2617
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),
|
|
2618
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),
|
|
2619
|
-
c("span",
|
|
2620
|
-
icon: N(
|
|
2867
|
+
c("span", er, [k(e.$slots, "item-icon", {
|
|
2868
|
+
icon: N(Vt)(r.type),
|
|
2621
2869
|
item: r
|
|
2622
|
-
}, () => [(w(), a(A(N(
|
|
2870
|
+
}, () => [(w(), a(A(N(Vt)(r.type)), {
|
|
2623
2871
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2624
2872
|
"aria-hidden": "true"
|
|
2625
2873
|
}))])]),
|
|
2626
|
-
c("span",
|
|
2874
|
+
c("span", tr, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
|
|
2627
2875
|
class: "h-4 w-4 stroke-2",
|
|
2628
2876
|
"aria-hidden": "true"
|
|
2629
2877
|
}))])
|
|
2630
|
-
], 8,
|
|
2631
|
-
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), {
|
|
2632
2880
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2633
2881
|
"aria-hidden": "true"
|
|
2634
2882
|
})])])) : o("", !0),
|
|
@@ -2641,43 +2889,43 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2641
2889
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2642
2890
|
"aria-hidden": "true"
|
|
2643
2891
|
}),
|
|
2644
|
-
c("p",
|
|
2892
|
+
c("p", ar, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2645
2893
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2646
2894
|
key: 0,
|
|
2647
2895
|
type: "button",
|
|
2648
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",
|
|
2649
|
-
onClick:
|
|
2650
|
-
}, " Retry ", 8,
|
|
2651
|
-
], 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)
|
|
2652
2900
|
]), (w(), s("audio", {
|
|
2653
2901
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2654
2902
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
2655
2903
|
preload: N(C).getFullscreenMediaPreload(i),
|
|
2656
2904
|
class: "pointer-events-none absolute h-px w-px opacity-0",
|
|
2657
2905
|
ref_for: !0,
|
|
2658
|
-
ref: (e) =>
|
|
2659
|
-
onCanplay: (e) =>
|
|
2660
|
-
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),
|
|
2661
2909
|
onError: (e) => N(L).onFullscreenMediaError(i, r),
|
|
2662
|
-
onLoadstart: (e) =>
|
|
2663
|
-
onLoadedmetadata: (e) =>
|
|
2664
|
-
onPause: (e) =>
|
|
2665
|
-
onPlay: (e) =>
|
|
2666
|
-
onPlaying: (e) =>
|
|
2667
|
-
onSeeking: (e) =>
|
|
2668
|
-
onSeeked: (e) =>
|
|
2669
|
-
onStalled: (e) =>
|
|
2670
|
-
onTimeupdate: (e) =>
|
|
2671
|
-
onWaiting: (e) =>
|
|
2672
|
-
}, null, 40,
|
|
2673
|
-
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),
|
|
2674
2922
|
item: r
|
|
2675
|
-
}, () => [(w(), a(A(N(
|
|
2923
|
+
}, () => [(w(), a(A(N(Vt)(r.type)), {
|
|
2676
2924
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2677
2925
|
"aria-hidden": "true"
|
|
2678
|
-
}))])])]))], 14,
|
|
2679
|
-
W.value && f["fullscreen-overlay"] ? (w(), s("div",
|
|
2680
|
-
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, {
|
|
2681
2929
|
key: 1,
|
|
2682
2930
|
"current-index": N(h).resolvedActiveIndex.value,
|
|
2683
2931
|
loading: d.loading,
|
|
@@ -2687,7 +2935,7 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2687
2935
|
title: N(h).activeItem.value.title ?? null,
|
|
2688
2936
|
total: N(h).items.value.length,
|
|
2689
2937
|
onBackToList: n[0] ||= (e) => m("back-to-list")
|
|
2690
|
-
}, l({ _: 2 }, [
|
|
2938
|
+
}, l({ _: 2 }, [Y.value && W.value ? {
|
|
2691
2939
|
name: "actions",
|
|
2692
2940
|
fn: z(() => [k(e.$slots, "fullscreen-header-actions", y(p(W.value)))]),
|
|
2693
2941
|
key: "0"
|
|
@@ -2700,7 +2948,7 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2700
2948
|
"title",
|
|
2701
2949
|
"total"
|
|
2702
2950
|
])) : o("", !0),
|
|
2703
|
-
|
|
2951
|
+
ee.value ? (w(), a(Dt, {
|
|
2704
2952
|
key: 2,
|
|
2705
2953
|
"current-time": N(h).activeMediaState.value.currentTime,
|
|
2706
2954
|
"current-time-label": N(h).formatPlaybackTime(N(h).activeMediaState.value.currentTime),
|
|
@@ -2709,7 +2957,7 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2709
2957
|
muted: N(h).activeMediaState.value.muted,
|
|
2710
2958
|
progress: N(h).activeMediaProgress.value,
|
|
2711
2959
|
volume: N(h).activeMediaState.value.volume,
|
|
2712
|
-
"volume-control-layout":
|
|
2960
|
+
"volume-control-layout": B.value,
|
|
2713
2961
|
onSeekInput: N(h).onMediaSeekInput,
|
|
2714
2962
|
onVolumeInput: N(h).onMediaVolumeInput,
|
|
2715
2963
|
onVolumeToggle: N(h).onMediaVolumeToggle
|
|
@@ -2734,10 +2982,10 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2734
2982
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2735
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" : ""])
|
|
2736
2984
|
}, j(K.value.message), 3))], 2)) : o("", !0)
|
|
2737
|
-
])) : H.value ? (w(), s("div",
|
|
2985
|
+
])) : H.value ? (w(), s("div", fr, [c("div", pr, [c("span", mr, [u(N(oe), {
|
|
2738
2986
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2739
2987
|
"aria-hidden": "true"
|
|
2740
|
-
})]), c("p",
|
|
2988
|
+
})]), c("p", hr, j(U.value), 1)])])) : N(pe) && N(X) ? (w(), a(Bn, {
|
|
2741
2989
|
key: 2,
|
|
2742
2990
|
message: N(X).message,
|
|
2743
2991
|
mode: N(X).mode,
|
|
@@ -2749,7 +2997,7 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2749
2997
|
"message",
|
|
2750
2998
|
"mode",
|
|
2751
2999
|
"surface"
|
|
2752
|
-
])) : o("", !0), N(de) && N(X) ? (w(), a(
|
|
3000
|
+
])) : o("", !0), N(de) && N(X) ? (w(), a(Bn, {
|
|
2753
3001
|
key: 3,
|
|
2754
3002
|
message: N(X).message,
|
|
2755
3003
|
mode: N(X).mode,
|
|
@@ -2769,7 +3017,7 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2769
3017
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2770
3018
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2771
3019
|
}, {
|
|
2772
|
-
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)]),
|
|
2773
3021
|
_: 3
|
|
2774
3022
|
})], 4),
|
|
2775
3023
|
u(r, {
|
|
@@ -2780,29 +3028,29 @@ var jn = ["data-surface"], Mn = ["data-surface"], Nn = /* @__PURE__ */ d({
|
|
|
2780
3028
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2781
3029
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2782
3030
|
}, {
|
|
2783
|
-
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)]),
|
|
2784
3032
|
_: 3
|
|
2785
3033
|
})
|
|
2786
3034
|
]));
|
|
2787
3035
|
}
|
|
2788
|
-
}),
|
|
2789
|
-
function
|
|
3036
|
+
}), Cr = 1, wr = .5;
|
|
3037
|
+
function Tr(e) {
|
|
2790
3038
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2791
|
-
width:
|
|
2792
|
-
height:
|
|
3039
|
+
width: Cr,
|
|
3040
|
+
height: Cr,
|
|
2793
3041
|
source: "fallback"
|
|
2794
3042
|
};
|
|
2795
3043
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2796
|
-
if (
|
|
2797
|
-
let r =
|
|
3044
|
+
if (jr(t) && jr(n)) {
|
|
3045
|
+
let r = Mr(e, t, n);
|
|
2798
3046
|
return {
|
|
2799
3047
|
width: r.width,
|
|
2800
3048
|
height: r.height,
|
|
2801
3049
|
source: "preview"
|
|
2802
3050
|
};
|
|
2803
3051
|
}
|
|
2804
|
-
if (
|
|
2805
|
-
let t =
|
|
3052
|
+
if (jr(e.width) && jr(e.height)) {
|
|
3053
|
+
let t = Mr(e, e.width, e.height);
|
|
2806
3054
|
return {
|
|
2807
3055
|
width: t.width,
|
|
2808
3056
|
height: t.height,
|
|
@@ -2810,31 +3058,31 @@ function vr(e) {
|
|
|
2810
3058
|
};
|
|
2811
3059
|
}
|
|
2812
3060
|
return {
|
|
2813
|
-
width:
|
|
2814
|
-
height:
|
|
3061
|
+
width: Cr,
|
|
3062
|
+
height: Cr,
|
|
2815
3063
|
source: "fallback"
|
|
2816
3064
|
};
|
|
2817
3065
|
}
|
|
2818
|
-
function
|
|
3066
|
+
function Er(e, t) {
|
|
2819
3067
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2820
3068
|
}
|
|
2821
|
-
function
|
|
3069
|
+
function Dr(e, t, n, r = 0) {
|
|
2822
3070
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2823
3071
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2824
3072
|
return !a || a <= 0 ? n : a / t;
|
|
2825
3073
|
}
|
|
2826
|
-
function
|
|
2827
|
-
let n =
|
|
3074
|
+
function Or(e, t) {
|
|
3075
|
+
let n = Tr(e);
|
|
2828
3076
|
return n.height / n.width * t;
|
|
2829
3077
|
}
|
|
2830
|
-
function
|
|
3078
|
+
function kr(e, t) {
|
|
2831
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;
|
|
2832
3080
|
for (let c = 0; c < e.length; c += 1) {
|
|
2833
3081
|
let l = e[c];
|
|
2834
|
-
o.set(
|
|
3082
|
+
o.set(Q(l), c);
|
|
2835
3083
|
let u = 0;
|
|
2836
3084
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2837
|
-
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);
|
|
2838
3086
|
r[c] = {
|
|
2839
3087
|
x: d,
|
|
2840
3088
|
y: f
|
|
@@ -2853,7 +3101,7 @@ function Sr(e, t) {
|
|
|
2853
3101
|
indexById: o
|
|
2854
3102
|
};
|
|
2855
3103
|
}
|
|
2856
|
-
function
|
|
3104
|
+
function Ar(e) {
|
|
2857
3105
|
if (e.itemCount <= 0) return [];
|
|
2858
3106
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2859
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();
|
|
@@ -2863,21 +3111,11 @@ function Cr(e) {
|
|
|
2863
3111
|
}
|
|
2864
3112
|
return Array.from(a).sort((e, t) => e - t);
|
|
2865
3113
|
}
|
|
2866
|
-
function
|
|
2867
|
-
let r = /* @__PURE__ */ new Map();
|
|
2868
|
-
for (let i of e) {
|
|
2869
|
-
let e = t.get($(i));
|
|
2870
|
-
if (e == null) continue;
|
|
2871
|
-
let a = n[e];
|
|
2872
|
-
a && r.set($(i), a);
|
|
2873
|
-
}
|
|
2874
|
-
return r;
|
|
2875
|
-
}
|
|
2876
|
-
function Tr(e) {
|
|
3114
|
+
function jr(e) {
|
|
2877
3115
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2878
3116
|
}
|
|
2879
|
-
function
|
|
2880
|
-
return e.type !== "image" || n / t >=
|
|
3117
|
+
function Mr(e, t, n) {
|
|
3118
|
+
return e.type !== "image" || n / t >= wr ? {
|
|
2881
3119
|
width: t,
|
|
2882
3120
|
height: n
|
|
2883
3121
|
} : {
|
|
@@ -2887,46 +3125,46 @@ function Er(e, t, n) {
|
|
|
2887
3125
|
}
|
|
2888
3126
|
//#endregion
|
|
2889
3127
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2890
|
-
var
|
|
2891
|
-
function
|
|
3128
|
+
var Nr = 300, Pr = 600, Fr = 40, Ir = 300, Lr = 400;
|
|
3129
|
+
function Rr(e, t) {
|
|
2892
3130
|
return t === "top" ? [...e].reverse() : e;
|
|
2893
3131
|
}
|
|
2894
|
-
function
|
|
2895
|
-
return e <= 0 ?
|
|
3132
|
+
function zr(e) {
|
|
3133
|
+
return e <= 0 ? Pr : Pr + Math.min((e - 1) * Fr, Lr);
|
|
2896
3134
|
}
|
|
2897
|
-
function
|
|
2898
|
-
return
|
|
3135
|
+
function Br() {
|
|
3136
|
+
return Ir;
|
|
2899
3137
|
}
|
|
2900
|
-
function
|
|
3138
|
+
function Vr(e) {
|
|
2901
3139
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2902
3140
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2903
3141
|
}
|
|
2904
|
-
function
|
|
3142
|
+
function Hr(e) {
|
|
2905
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()));
|
|
2906
3144
|
L(e.visibleIndices, (i) => {
|
|
2907
3145
|
if (!i.length) return;
|
|
2908
3146
|
let o = [];
|
|
2909
3147
|
for (let n of i) {
|
|
2910
|
-
let r = e.items.value[n] ?
|
|
3148
|
+
let r = e.items.value[n] ? Q(e.items.value[n]) : null;
|
|
2911
3149
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2912
3150
|
}
|
|
2913
3151
|
if (!o.length) return;
|
|
2914
|
-
let s =
|
|
2915
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2916
|
-
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(() => {
|
|
2917
3155
|
let e = new Set(n.value);
|
|
2918
3156
|
for (let t of o) e.add(t);
|
|
2919
3157
|
n.value = e;
|
|
2920
|
-
}),
|
|
3158
|
+
}), Wr(() => {
|
|
2921
3159
|
let e = new Set(t.value);
|
|
2922
3160
|
for (let t of o) e.delete(t);
|
|
2923
3161
|
t.value = e, S(() => {
|
|
2924
3162
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2925
3163
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2926
3164
|
n.value = e, r.value = t, a.value = i;
|
|
2927
|
-
},
|
|
3165
|
+
}, zr(o.length));
|
|
2928
3166
|
});
|
|
2929
|
-
}, { flush: "post" }), L(() => e.items.value.map((e) =>
|
|
3167
|
+
}, { flush: "post" }), L(() => e.items.value.map((e) => Q(e)), (e) => {
|
|
2930
3168
|
if (!e.length || !o.value.size) return;
|
|
2931
3169
|
let t = new Set(e), n = null, r = null;
|
|
2932
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));
|
|
@@ -2939,7 +3177,7 @@ function Ir(e) {
|
|
|
2939
3177
|
if (!e.length) return;
|
|
2940
3178
|
let r = new Set(t.value), i = new Map(a.value);
|
|
2941
3179
|
for (let t of e) {
|
|
2942
|
-
let e =
|
|
3180
|
+
let e = Q(t);
|
|
2943
3181
|
r.add(e), i.set(e, n);
|
|
2944
3182
|
}
|
|
2945
3183
|
t.value = r, a.value = i;
|
|
@@ -2948,10 +3186,10 @@ function Ir(e) {
|
|
|
2948
3186
|
if (!e.length) return;
|
|
2949
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 = [];
|
|
2950
3188
|
for (let t of e) {
|
|
2951
|
-
let e =
|
|
3189
|
+
let e = Q(t.item);
|
|
2952
3190
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2953
3191
|
}
|
|
2954
|
-
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(() => {
|
|
2955
3193
|
let e = new Set(s.value);
|
|
2956
3194
|
for (let t of p) e.add(t);
|
|
2957
3195
|
s.value = e;
|
|
@@ -2959,9 +3197,9 @@ function Ir(e) {
|
|
|
2959
3197
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2960
3198
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2961
3199
|
o.value = e, s.value = t;
|
|
2962
|
-
},
|
|
3200
|
+
}, Ir);
|
|
2963
3201
|
}
|
|
2964
|
-
function g(t, n, r =
|
|
3202
|
+
function g(t, n, r = Nr) {
|
|
2965
3203
|
if (!t.size) return;
|
|
2966
3204
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2967
3205
|
for (let [r, o] of t.entries()) {
|
|
@@ -2980,8 +3218,8 @@ function Ir(e) {
|
|
|
2980
3218
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2981
3219
|
let o = new Map(l.value);
|
|
2982
3220
|
for (let e of a) o.set(e, r);
|
|
2983
|
-
l.value = o,
|
|
2984
|
-
u.value = new Set(a),
|
|
3221
|
+
l.value = o, Ur(() => {
|
|
3222
|
+
u.value = new Set(a), Ur(() => {
|
|
2985
3223
|
c.value = /* @__PURE__ */ new Map();
|
|
2986
3224
|
});
|
|
2987
3225
|
}), S(() => {
|
|
@@ -2992,8 +3230,8 @@ function Ir(e) {
|
|
|
2992
3230
|
}, r);
|
|
2993
3231
|
}
|
|
2994
3232
|
function _(e) {
|
|
2995
|
-
if (n.value.has(e)) return `transform ${
|
|
2996
|
-
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`;
|
|
2997
3235
|
}
|
|
2998
3236
|
function v(e) {
|
|
2999
3237
|
if (!n.value.has(e)) return;
|
|
@@ -3004,13 +3242,13 @@ function Ir(e) {
|
|
|
3004
3242
|
let r = e.items.value[n], i = e.positions.value[n] ?? {
|
|
3005
3243
|
x: 0,
|
|
3006
3244
|
y: 0
|
|
3007
|
-
}, 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) ?? {
|
|
3008
3246
|
dx: 0,
|
|
3009
3247
|
dy: 0
|
|
3010
3248
|
} : {
|
|
3011
3249
|
dx: 0,
|
|
3012
3250
|
dy: 0
|
|
3013
|
-
}, 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({
|
|
3014
3252
|
columnWidth: e.columnWidth.value,
|
|
3015
3253
|
direction: u,
|
|
3016
3254
|
itemHeight: o,
|
|
@@ -3020,18 +3258,18 @@ function Ir(e) {
|
|
|
3020
3258
|
return `translate3d(${i.x + l.dx}px, ${d + l.dy}px, 0)`;
|
|
3021
3259
|
}
|
|
3022
3260
|
function b(t) {
|
|
3023
|
-
let n =
|
|
3261
|
+
let n = Q(t), r = o.value.get(n);
|
|
3024
3262
|
if (!r) return {
|
|
3025
3263
|
opacity: "0",
|
|
3026
3264
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
3027
|
-
transition: `opacity ${
|
|
3265
|
+
transition: `opacity ${Ir}ms ease-out, transform ${Ir}ms ease-out`
|
|
3028
3266
|
};
|
|
3029
3267
|
let i = s.value.has(n);
|
|
3030
3268
|
return {
|
|
3031
3269
|
height: `${r.height}px`,
|
|
3032
3270
|
opacity: i ? "0" : "1",
|
|
3033
3271
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
3034
|
-
transition: `opacity ${
|
|
3272
|
+
transition: `opacity ${Ir}ms ease-out, transform ${Ir}ms ease-out`,
|
|
3035
3273
|
width: `${e.columnWidth.value}px`
|
|
3036
3274
|
};
|
|
3037
3275
|
}
|
|
@@ -3052,56 +3290,138 @@ function Ir(e) {
|
|
|
3052
3290
|
playFlipMoveAnimation: g
|
|
3053
3291
|
};
|
|
3054
3292
|
}
|
|
3055
|
-
function
|
|
3293
|
+
function Ur(e) {
|
|
3056
3294
|
if (typeof requestAnimationFrame == "function") {
|
|
3057
3295
|
requestAnimationFrame(() => e());
|
|
3058
3296
|
return;
|
|
3059
3297
|
}
|
|
3060
3298
|
setTimeout(e, 0);
|
|
3061
3299
|
}
|
|
3062
|
-
function
|
|
3063
|
-
|
|
3300
|
+
function Wr(e) {
|
|
3301
|
+
Ur(() => Ur(e));
|
|
3064
3302
|
}
|
|
3065
3303
|
//#endregion
|
|
3066
3304
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
3067
|
-
function
|
|
3305
|
+
function Gr(e, t) {
|
|
3068
3306
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
3069
3307
|
}
|
|
3070
|
-
function
|
|
3308
|
+
function Kr(e, t, n) {
|
|
3071
3309
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
3072
3310
|
}
|
|
3073
|
-
function
|
|
3074
|
-
return (e?.scrollHeight ?? r) - (t + n);
|
|
3311
|
+
function qr(e, t, n, r) {
|
|
3312
|
+
return Math.max(e?.scrollHeight ?? 0, r) - (t + n);
|
|
3075
3313
|
}
|
|
3076
|
-
function
|
|
3314
|
+
function Jr(e, t) {
|
|
3077
3315
|
return {
|
|
3078
3316
|
height: `${e}px`,
|
|
3079
3317
|
transform: `translate3d(0, ${t}px, 0)`
|
|
3080
3318
|
};
|
|
3081
3319
|
}
|
|
3082
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
|
|
3083
3391
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
3084
|
-
var
|
|
3085
|
-
function
|
|
3086
|
-
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s =
|
|
3392
|
+
var ii = 250, ai = 1e3;
|
|
3393
|
+
function oi(e) {
|
|
3394
|
+
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = D(!1), c = 0, l = null;
|
|
3087
3395
|
x(() => {
|
|
3088
|
-
|
|
3396
|
+
S();
|
|
3089
3397
|
});
|
|
3090
|
-
function
|
|
3091
|
-
let
|
|
3398
|
+
function u(r = "layout") {
|
|
3399
|
+
let i = t.value;
|
|
3092
3400
|
if (t.value = e.isAtBoundary(), !t.value) {
|
|
3093
|
-
!a.value && !o.value && (n.value = !0);
|
|
3401
|
+
(!a.value && !o.value || r === "scroll") && (n.value = !0);
|
|
3094
3402
|
return;
|
|
3095
3403
|
}
|
|
3096
|
-
!
|
|
3404
|
+
if (!i && n.value) {
|
|
3405
|
+
if (r === "scroll" && a.value) {
|
|
3406
|
+
s.value = !0;
|
|
3407
|
+
return;
|
|
3408
|
+
}
|
|
3409
|
+
h();
|
|
3410
|
+
}
|
|
3097
3411
|
}
|
|
3098
|
-
function
|
|
3099
|
-
if (!
|
|
3412
|
+
function d(t) {
|
|
3413
|
+
if (!C(t) || !e.isAtBoundary()) return;
|
|
3100
3414
|
let n = Date.now();
|
|
3101
|
-
|
|
3415
|
+
if (!(n < c)) {
|
|
3416
|
+
if (c = n + ii, a.value) {
|
|
3417
|
+
s.value = !0;
|
|
3418
|
+
return;
|
|
3419
|
+
}
|
|
3420
|
+
h();
|
|
3421
|
+
}
|
|
3102
3422
|
}
|
|
3103
|
-
function
|
|
3104
|
-
if (!
|
|
3423
|
+
function f() {
|
|
3424
|
+
if (!_()) return;
|
|
3105
3425
|
let t = e.requestPage.value;
|
|
3106
3426
|
if (typeof t != "function") return;
|
|
3107
3427
|
i.value = r.value, n.value = !1, a.value = !0, o.value = !0;
|
|
@@ -3109,222 +3429,338 @@ function Gr(e) {
|
|
|
3109
3429
|
try {
|
|
3110
3430
|
s = t();
|
|
3111
3431
|
} catch {
|
|
3112
|
-
|
|
3432
|
+
v();
|
|
3113
3433
|
return;
|
|
3114
3434
|
}
|
|
3115
3435
|
Promise.resolve(s).catch(() => {}).finally(() => {
|
|
3116
|
-
!e.loading.value && o.value &&
|
|
3436
|
+
!e.loading.value && o.value && v();
|
|
3117
3437
|
});
|
|
3118
3438
|
}
|
|
3119
|
-
function
|
|
3120
|
-
!e && o.value &&
|
|
3439
|
+
function p(e) {
|
|
3440
|
+
!e && o.value && v();
|
|
3121
3441
|
}
|
|
3122
|
-
function
|
|
3123
|
-
!o.value || t <= 0 || (o.value = !1,
|
|
3124
|
-
}
|
|
3125
|
-
function m() {
|
|
3126
|
-
h() && (r.value += 1);
|
|
3442
|
+
function m(t) {
|
|
3443
|
+
!o.value || t <= 0 || (o.value = !1, y(e.getAnimationLockMs(t)));
|
|
3127
3444
|
}
|
|
3128
3445
|
function h() {
|
|
3129
|
-
|
|
3446
|
+
g() && (r.value += 1);
|
|
3130
3447
|
}
|
|
3131
3448
|
function g() {
|
|
3132
|
-
return e.hasPage.value &&
|
|
3449
|
+
return e.hasPage.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
3133
3450
|
}
|
|
3134
3451
|
function _() {
|
|
3135
|
-
|
|
3452
|
+
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
3136
3453
|
}
|
|
3137
|
-
function v(
|
|
3138
|
-
|
|
3139
|
-
|
|
3454
|
+
function v() {
|
|
3455
|
+
o.value = !1, y(ai);
|
|
3456
|
+
}
|
|
3457
|
+
function y(e) {
|
|
3458
|
+
S(), a.value = !0, l = setTimeout(() => {
|
|
3459
|
+
l = null, a.value = !1, b();
|
|
3140
3460
|
}, Math.max(0, e));
|
|
3141
3461
|
}
|
|
3142
|
-
function
|
|
3143
|
-
|
|
3462
|
+
function b() {
|
|
3463
|
+
if (s.value) {
|
|
3464
|
+
if (s.value = !1, !e.isAtBoundary()) {
|
|
3465
|
+
o.value || (n.value = !0);
|
|
3466
|
+
return;
|
|
3467
|
+
}
|
|
3468
|
+
t.value = !0, h(), f();
|
|
3469
|
+
}
|
|
3144
3470
|
}
|
|
3145
|
-
function
|
|
3471
|
+
function S() {
|
|
3472
|
+
l &&= (clearTimeout(l), null);
|
|
3473
|
+
}
|
|
3474
|
+
function C(t) {
|
|
3146
3475
|
return e.direction === "top" ? t.deltaY < 0 : t.deltaY > 0;
|
|
3147
3476
|
}
|
|
3148
3477
|
return {
|
|
3149
|
-
maybeRequestPage:
|
|
3150
|
-
onItemsMutated:
|
|
3151
|
-
onLoadingChange:
|
|
3152
|
-
onWheel:
|
|
3153
|
-
syncBoundary:
|
|
3478
|
+
maybeRequestPage: f,
|
|
3479
|
+
onItemsMutated: m,
|
|
3480
|
+
onLoadingChange: p,
|
|
3481
|
+
onWheel: d,
|
|
3482
|
+
syncBoundary: u
|
|
3483
|
+
};
|
|
3484
|
+
}
|
|
3485
|
+
//#endregion
|
|
3486
|
+
//#region src/components/viewer-core/masonryBoundaryLock.ts
|
|
3487
|
+
function si() {
|
|
3488
|
+
let e = D(!1), t = null;
|
|
3489
|
+
x(() => {
|
|
3490
|
+
r();
|
|
3491
|
+
});
|
|
3492
|
+
function n(n) {
|
|
3493
|
+
r(), e.value = !0, t = setTimeout(() => {
|
|
3494
|
+
t = null, e.value = !1;
|
|
3495
|
+
}, Math.max(0, n));
|
|
3496
|
+
}
|
|
3497
|
+
function r() {
|
|
3498
|
+
t && (clearTimeout(t), t = null, e.value = !1);
|
|
3499
|
+
}
|
|
3500
|
+
return {
|
|
3501
|
+
clearBoundaryInteractionReleaseTimer: r,
|
|
3502
|
+
isBoundaryInteractionLocked: e,
|
|
3503
|
+
lockBoundaryInteraction: n
|
|
3504
|
+
};
|
|
3505
|
+
}
|
|
3506
|
+
//#endregion
|
|
3507
|
+
//#region src/components/viewer-core/masonryItemMutation.ts
|
|
3508
|
+
function ci(e) {
|
|
3509
|
+
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;
|
|
3510
|
+
return {
|
|
3511
|
+
addedItems: s,
|
|
3512
|
+
anchorId: d ? Q(d) : null,
|
|
3513
|
+
isPrepend: l,
|
|
3514
|
+
oldPositionsById: i,
|
|
3515
|
+
previousIds: n,
|
|
3516
|
+
removedItems: c,
|
|
3517
|
+
shouldLockBoundaryInteractionForRemoval: c.length > 0 && u,
|
|
3518
|
+
shouldResetScrollForEmptyRemoval: e.currentItems.length === 0 && e.previousItems.length > 0 && c.length > 0 && e.scrollTop > 0
|
|
3519
|
+
};
|
|
3520
|
+
}
|
|
3521
|
+
function li(e, t, n, r) {
|
|
3522
|
+
return e.flatMap((e) => {
|
|
3523
|
+
let i = Q(e);
|
|
3524
|
+
if (t.has(i)) return [];
|
|
3525
|
+
let a = r.get(i), o = n.get(i);
|
|
3526
|
+
return a && o != null ? [{
|
|
3527
|
+
height: o,
|
|
3528
|
+
item: e,
|
|
3529
|
+
position: a
|
|
3530
|
+
}] : [];
|
|
3531
|
+
});
|
|
3532
|
+
}
|
|
3533
|
+
function ui(e, t, n) {
|
|
3534
|
+
let r = /* @__PURE__ */ new Map();
|
|
3535
|
+
for (let i of e) {
|
|
3536
|
+
let e = Q(i), a = t.get(e), o = a == null ? void 0 : n[a];
|
|
3537
|
+
o != null && r.set(e, o);
|
|
3538
|
+
}
|
|
3539
|
+
return r;
|
|
3540
|
+
}
|
|
3541
|
+
function di(e, t, n) {
|
|
3542
|
+
let r = /* @__PURE__ */ new Map();
|
|
3543
|
+
for (let i of e) {
|
|
3544
|
+
let e = Q(i), a = t.get(e), o = a == null ? void 0 : n[a];
|
|
3545
|
+
o && r.set(e, o);
|
|
3546
|
+
}
|
|
3547
|
+
return r;
|
|
3548
|
+
}
|
|
3549
|
+
//#endregion
|
|
3550
|
+
//#region src/components/viewer-core/masonryPendingAppend.ts
|
|
3551
|
+
function fi(e) {
|
|
3552
|
+
let t = D(null), n = D(!1), r = null;
|
|
3553
|
+
function i() {
|
|
3554
|
+
o(), e.pendingAppendItems.value.length && (t.value = c([...e.items.value, ...e.pendingAppendItems.value]), s());
|
|
3555
|
+
}
|
|
3556
|
+
function a(i) {
|
|
3557
|
+
!i && !e.pendingAppendItems.value.length && !r && !n.value && (t.value = null);
|
|
3558
|
+
}
|
|
3559
|
+
function o() {
|
|
3560
|
+
r &&= (clearTimeout(r), null);
|
|
3561
|
+
}
|
|
3562
|
+
function s() {
|
|
3563
|
+
let i = e.commitPendingAppend.value;
|
|
3564
|
+
typeof i == "function" && (r = setTimeout(async () => {
|
|
3565
|
+
r = null, n.value = !0;
|
|
3566
|
+
try {
|
|
3567
|
+
e.pendingAppendItems.value.length && (await i(), await _(), await _());
|
|
3568
|
+
} finally {
|
|
3569
|
+
t.value = null, n.value = !1;
|
|
3570
|
+
}
|
|
3571
|
+
}, 300));
|
|
3572
|
+
}
|
|
3573
|
+
function c(t) {
|
|
3574
|
+
return t.length ? kr(t, {
|
|
3575
|
+
bucketPx: e.bucketPx,
|
|
3576
|
+
columnCount: e.columnCount.value,
|
|
3577
|
+
columnWidth: e.columnWidth.value,
|
|
3578
|
+
gapX: e.gapPx,
|
|
3579
|
+
gapY: e.gapPx
|
|
3580
|
+
}).contentHeight + e.contentInsetPx * 2 : 0;
|
|
3581
|
+
}
|
|
3582
|
+
return {
|
|
3583
|
+
clearAppendCommitTimer: o,
|
|
3584
|
+
clearReservedHeightWhenIdle: a,
|
|
3585
|
+
refreshReservedContentHeight: i,
|
|
3586
|
+
reservedContentHeight: t
|
|
3154
3587
|
};
|
|
3155
3588
|
}
|
|
3156
3589
|
//#endregion
|
|
3157
3590
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
3158
|
-
var
|
|
3159
|
-
function
|
|
3160
|
-
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth ||
|
|
3591
|
+
var pi = 600, mi = 24, hi = 16, gi = 300, _i = 200, vi = 0, yi = 1, bi = mi + hi, xi = 200, Si = 500, Ci = 1e3;
|
|
3592
|
+
function wi(e) {
|
|
3593
|
+
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(() => Ti(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Ar({
|
|
3161
3594
|
itemCount: e.items.value.length,
|
|
3162
3595
|
viewportHeight: r.value,
|
|
3163
3596
|
scrollTop: n.value,
|
|
3164
|
-
overscanPx:
|
|
3165
|
-
bucketPx:
|
|
3597
|
+
overscanPx: _i,
|
|
3598
|
+
bucketPx: pi,
|
|
3166
3599
|
buckets: c.value
|
|
3167
3600
|
})), b = i(() => y.value.map((t) => ({
|
|
3168
3601
|
item: e.items.value[t],
|
|
3169
3602
|
index: t
|
|
3170
3603
|
}))), C = i(() => {
|
|
3171
|
-
let e = l.value +
|
|
3172
|
-
return Math.max(e, t, r.value) +
|
|
3173
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() =>
|
|
3604
|
+
let e = l.value + mi * 2, t = P.reservedContentHeight.value ?? 0;
|
|
3605
|
+
return Math.max(e, t, r.value) + xi + g.value;
|
|
3606
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => $r({
|
|
3174
3607
|
active: e.active.value,
|
|
3175
|
-
maxScrollTop:
|
|
3608
|
+
maxScrollTop: Y(),
|
|
3176
3609
|
progressDistancePx: n.value,
|
|
3177
|
-
thresholdPx:
|
|
3610
|
+
thresholdPx: vi,
|
|
3178
3611
|
triggerEnabled: w.value
|
|
3179
|
-
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() =>
|
|
3612
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => Qr({
|
|
3180
3613
|
active: e.active.value,
|
|
3181
|
-
maxScrollTop:
|
|
3614
|
+
maxScrollTop: Y(),
|
|
3182
3615
|
progressDistancePx: n.value,
|
|
3183
|
-
thresholdPx:
|
|
3616
|
+
thresholdPx: bi,
|
|
3184
3617
|
triggerEnabled: e.hasPreviousPage.value
|
|
3185
|
-
})), k =
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
}),
|
|
3190
|
-
if (!A.value) return ti;
|
|
3191
|
-
let e = Math.max(0, C.value - r.value);
|
|
3192
|
-
return ti + Math.max(0, k.value - j.value) * (e > 0 ? oi(n.value / e, 0, 1) : 0);
|
|
3193
|
-
}), N = Ir({
|
|
3618
|
+
})), k = ei({
|
|
3619
|
+
containerHeight: C,
|
|
3620
|
+
scrollTop: n,
|
|
3621
|
+
viewportHeight: r
|
|
3622
|
+
}), A = Hr({
|
|
3194
3623
|
items: e.items,
|
|
3195
3624
|
visibleIndices: y,
|
|
3196
3625
|
positions: o,
|
|
3197
3626
|
heights: s,
|
|
3198
3627
|
indexById: u,
|
|
3199
|
-
columnWidth:
|
|
3628
|
+
columnWidth: h,
|
|
3200
3629
|
scrollTop: n,
|
|
3201
3630
|
viewportHeight: r
|
|
3202
|
-
}),
|
|
3631
|
+
}), j = oi({
|
|
3203
3632
|
direction: "top",
|
|
3204
3633
|
getAnimationLockMs(e) {
|
|
3205
|
-
return Math.max(
|
|
3634
|
+
return Math.max(Si, zr(e)) + Ci;
|
|
3206
3635
|
},
|
|
3207
3636
|
hasPage: e.hasPreviousPage,
|
|
3208
|
-
interactionLocked:
|
|
3637
|
+
interactionLocked: f.isBoundaryInteractionLocked,
|
|
3209
3638
|
isAtBoundary() {
|
|
3210
|
-
return n.value <=
|
|
3639
|
+
return n.value <= bi;
|
|
3211
3640
|
},
|
|
3212
3641
|
loading: e.loading,
|
|
3213
3642
|
requestPage: e.requestPreviousPage
|
|
3214
|
-
}),
|
|
3643
|
+
}), M = oi({
|
|
3215
3644
|
direction: "bottom",
|
|
3216
3645
|
getAnimationLockMs(e) {
|
|
3217
|
-
return
|
|
3646
|
+
return zr(e) + Ci;
|
|
3218
3647
|
},
|
|
3219
3648
|
hasPage: w,
|
|
3220
|
-
interactionLocked:
|
|
3649
|
+
interactionLocked: f.isBoundaryInteractionLocked,
|
|
3221
3650
|
isAtBoundary() {
|
|
3222
|
-
return
|
|
3651
|
+
return J() <= yi;
|
|
3223
3652
|
},
|
|
3224
3653
|
loading: e.loading,
|
|
3225
3654
|
requestPage: e.requestNextPage
|
|
3226
|
-
}),
|
|
3655
|
+
}), N = Zr({
|
|
3656
|
+
active: e.active,
|
|
3657
|
+
getMaxScrollTop: Y,
|
|
3658
|
+
getViewport: () => t.value,
|
|
3659
|
+
onScroll: z
|
|
3660
|
+
}), P = fi({
|
|
3661
|
+
bucketPx: pi,
|
|
3662
|
+
columnCount: m,
|
|
3663
|
+
columnWidth: h,
|
|
3664
|
+
commitPendingAppend: e.commitPendingAppend,
|
|
3665
|
+
contentInsetPx: mi,
|
|
3666
|
+
gapPx: hi,
|
|
3667
|
+
items: e.items,
|
|
3668
|
+
pendingAppendItems: e.pendingAppendItems
|
|
3669
|
+
}), F = null, I = 0;
|
|
3227
3670
|
L([
|
|
3228
3671
|
() => e.items.value,
|
|
3229
|
-
|
|
3230
|
-
|
|
3672
|
+
m,
|
|
3673
|
+
h
|
|
3231
3674
|
], async ([t], [r = []]) => {
|
|
3232
|
-
let i =
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3675
|
+
let i = ci({
|
|
3676
|
+
activeIndex: v.value,
|
|
3677
|
+
contentInsetPx: mi,
|
|
3678
|
+
currentItems: t,
|
|
3679
|
+
gapPx: hi,
|
|
3680
|
+
layoutHeights: s.value,
|
|
3681
|
+
layoutIndexById: u.value,
|
|
3682
|
+
layoutPositions: o.value,
|
|
3683
|
+
previousItems: r ?? [],
|
|
3684
|
+
scrollTop: n.value
|
|
3685
|
+
});
|
|
3686
|
+
i.shouldLockBoundaryInteractionForRemoval && f.lockBoundaryInteraction(Br() + Ci), 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 ? Si : void 0), i.anchorId ? (await _(), V(i.anchorId, i.oldPositionsById)) : e.active.value && i.previousIds.length > 0 && W();
|
|
3243
3687
|
}, { immediate: !0 }), L([
|
|
3244
|
-
() => e.pendingAppendItems.value.map((e) =>
|
|
3688
|
+
() => e.pendingAppendItems.value.map((e) => Q(e)),
|
|
3689
|
+
m,
|
|
3245
3690
|
h,
|
|
3246
|
-
g,
|
|
3247
3691
|
r
|
|
3248
|
-
], (
|
|
3249
|
-
de(), t.length && (d.value = le([...e.items.value, ...e.pendingAppendItems.value]), X());
|
|
3250
|
-
}, { immediate: !0 }), L(() => e.active.value, async (e, i) => {
|
|
3692
|
+
], () => P.refreshReservedContentHeight(), { immediate: !0 }), L(() => e.active.value, async (e, i) => {
|
|
3251
3693
|
let a = t.value;
|
|
3252
|
-
if (!a) return;
|
|
3253
3694
|
if (!e) {
|
|
3254
|
-
|
|
3695
|
+
a && (d.value = a.scrollTop), N.stop();
|
|
3255
3696
|
return;
|
|
3256
3697
|
}
|
|
3257
|
-
if (i !== !1 ||
|
|
3698
|
+
if (N.start(), !a || i !== !1 || d.value == null) return;
|
|
3258
3699
|
await _();
|
|
3259
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
3260
|
-
a.scrollTop = s, n.value = s,
|
|
3261
|
-
}), L(() => e.loading.value, async (
|
|
3262
|
-
|
|
3700
|
+
let o = Math.max(0, C.value - r.value), s = Ti(d.value, 0, o);
|
|
3701
|
+
a.scrollTop = s, n.value = s, j.syncBoundary(), M.syncBoundary();
|
|
3702
|
+
}), L(() => e.loading.value, async (e) => {
|
|
3703
|
+
P.clearReservedHeightWhenIdle(e), j.onLoadingChange(e), M.onLoadingChange(e), await _();
|
|
3263
3704
|
}), S(async () => {
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
}), t.value &&
|
|
3705
|
+
G(), await _(), v.value > 0 ? B(v.value, "center") : U(), j.syncBoundary(), M.syncBoundary(), typeof ResizeObserver < "u" ? (F = new ResizeObserver(() => {
|
|
3706
|
+
G();
|
|
3707
|
+
}), t.value && F.observe(t.value)) : window.addEventListener("resize", G);
|
|
3267
3708
|
}), x(() => {
|
|
3268
|
-
|
|
3709
|
+
F?.disconnect(), F = null, window.removeEventListener("resize", G), P.clearAppendCommitTimer(), f.clearBoundaryInteractionReleaseTimer(), I &&= (cancelAnimationFrame(I), 0), N.stop();
|
|
3269
3710
|
});
|
|
3270
|
-
function
|
|
3271
|
-
let t =
|
|
3272
|
-
columnCount:
|
|
3273
|
-
columnWidth:
|
|
3274
|
-
gapX:
|
|
3275
|
-
gapY:
|
|
3276
|
-
bucketPx:
|
|
3711
|
+
function R() {
|
|
3712
|
+
let t = kr(e.items.value, {
|
|
3713
|
+
columnCount: m.value,
|
|
3714
|
+
columnWidth: h.value,
|
|
3715
|
+
gapX: hi,
|
|
3716
|
+
gapY: hi,
|
|
3717
|
+
bucketPx: pi
|
|
3277
3718
|
});
|
|
3278
3719
|
o.value = t.positions.map((e) => ({
|
|
3279
|
-
x: e.x +
|
|
3280
|
-
y: e.y +
|
|
3720
|
+
x: e.x + mi,
|
|
3721
|
+
y: e.y + mi
|
|
3281
3722
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
3282
3723
|
}
|
|
3283
|
-
function
|
|
3284
|
-
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value =
|
|
3285
|
-
|
|
3724
|
+
function z() {
|
|
3725
|
+
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = K(), j.syncBoundary("scroll"), M.syncBoundary("scroll"), ne(), !W() && (I ||= requestAnimationFrame(() => {
|
|
3726
|
+
I = 0, U();
|
|
3286
3727
|
})));
|
|
3287
3728
|
}
|
|
3288
|
-
function
|
|
3289
|
-
e.active.value && (
|
|
3729
|
+
function ee(t) {
|
|
3730
|
+
e.active.value && (j.onWheel(t), M.onWheel(t), ne());
|
|
3290
3731
|
}
|
|
3291
|
-
function
|
|
3292
|
-
let n = e.items.value[t], r = n ?
|
|
3732
|
+
function te(t) {
|
|
3733
|
+
let n = e.items.value[t], r = n ? Q(n) : "";
|
|
3293
3734
|
return {
|
|
3294
|
-
height: `${s.value[t] ??
|
|
3295
|
-
width: `${
|
|
3296
|
-
transition: r ?
|
|
3297
|
-
transitionDelay: r ?
|
|
3298
|
-
transform:
|
|
3735
|
+
height: `${s.value[t] ?? h.value}px`,
|
|
3736
|
+
width: `${h.value}px`,
|
|
3737
|
+
transition: r ? A.getCardTransition(r) : void 0,
|
|
3738
|
+
transitionDelay: r ? A.getCardTransitionDelay(r) : void 0,
|
|
3739
|
+
transform: A.getCardTransform(t)
|
|
3299
3740
|
};
|
|
3300
3741
|
}
|
|
3301
|
-
function
|
|
3742
|
+
function B(e, i) {
|
|
3302
3743
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
3303
3744
|
if (!a || !c || !l) return;
|
|
3304
3745
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
3305
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
3746
|
+
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 = Ti(u, 0, d), n.value = a.scrollTop, U();
|
|
3306
3747
|
}
|
|
3307
|
-
function
|
|
3748
|
+
function V(e, r) {
|
|
3308
3749
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
3309
3750
|
if (!i || !a || !c) return;
|
|
3310
3751
|
let l = c.y - a.y;
|
|
3311
3752
|
i.scrollTop += l, n.value = i.scrollTop;
|
|
3312
3753
|
}
|
|
3313
|
-
function
|
|
3754
|
+
function H() {
|
|
3314
3755
|
let e = t.value;
|
|
3315
3756
|
if (!e) {
|
|
3316
3757
|
n.value = 0;
|
|
3317
3758
|
return;
|
|
3318
3759
|
}
|
|
3319
|
-
e.scrollTop = 0, n.value = 0,
|
|
3320
|
-
}
|
|
3321
|
-
function K(e) {
|
|
3322
|
-
fe(), p.value = !0, B = setTimeout(() => {
|
|
3323
|
-
B = null, p.value = !1;
|
|
3324
|
-
}, Math.max(0, e));
|
|
3760
|
+
e.scrollTop = 0, n.value = 0, j.syncBoundary(), M.syncBoundary();
|
|
3325
3761
|
}
|
|
3326
|
-
function
|
|
3327
|
-
if (!y.value.length ||
|
|
3762
|
+
function U() {
|
|
3763
|
+
if (!y.value.length || W()) return;
|
|
3328
3764
|
let t = n.value + r.value / 2, i = v.value, a = Infinity;
|
|
3329
3765
|
for (let e of y.value) {
|
|
3330
3766
|
let n = o.value[e], r = s.value[e];
|
|
@@ -3334,109 +3770,60 @@ function ai(e) {
|
|
|
3334
3770
|
}
|
|
3335
3771
|
e.setActiveIndex(i);
|
|
3336
3772
|
}
|
|
3337
|
-
function
|
|
3338
|
-
let t = n.value <=
|
|
3773
|
+
function W() {
|
|
3774
|
+
let t = n.value <= bi, r = J() <= yi;
|
|
3339
3775
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
3340
3776
|
}
|
|
3341
|
-
function
|
|
3342
|
-
|
|
3777
|
+
function ne() {
|
|
3778
|
+
j.maybeRequestPage(), M.maybeRequestPage();
|
|
3343
3779
|
}
|
|
3344
|
-
function
|
|
3345
|
-
r.value =
|
|
3780
|
+
function G() {
|
|
3781
|
+
r.value = K(), a.value = q();
|
|
3346
3782
|
}
|
|
3347
|
-
function
|
|
3348
|
-
return
|
|
3783
|
+
function K() {
|
|
3784
|
+
return Gr(t.value, r.value);
|
|
3349
3785
|
}
|
|
3350
|
-
function
|
|
3351
|
-
return
|
|
3786
|
+
function q() {
|
|
3787
|
+
return Kr(t.value, a.value, gi);
|
|
3352
3788
|
}
|
|
3353
|
-
function
|
|
3354
|
-
return
|
|
3789
|
+
function J() {
|
|
3790
|
+
return qr(t.value, n.value, r.value, C.value);
|
|
3355
3791
|
}
|
|
3356
|
-
function
|
|
3792
|
+
function Y() {
|
|
3357
3793
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
3358
3794
|
return Math.max(0, e - r.value);
|
|
3359
3795
|
}
|
|
3360
|
-
function ce() {
|
|
3361
|
-
return Hr(j.value, M.value);
|
|
3362
|
-
}
|
|
3363
|
-
function le(e) {
|
|
3364
|
-
return e.length ? Sr(e, {
|
|
3365
|
-
columnCount: h.value,
|
|
3366
|
-
columnWidth: g.value,
|
|
3367
|
-
gapX: Jr,
|
|
3368
|
-
gapY: Jr,
|
|
3369
|
-
bucketPx: Kr
|
|
3370
|
-
}).contentHeight + qr * 2 : 0;
|
|
3371
|
-
}
|
|
3372
|
-
function ue(e) {
|
|
3373
|
-
let t = /* @__PURE__ */ new Map();
|
|
3374
|
-
for (let n of e) {
|
|
3375
|
-
let e = $(n), r = u.value.get(e);
|
|
3376
|
-
if (r == null) continue;
|
|
3377
|
-
let i = s.value[r];
|
|
3378
|
-
i != null && t.set(e, i);
|
|
3379
|
-
}
|
|
3380
|
-
return t;
|
|
3381
|
-
}
|
|
3382
|
-
function X() {
|
|
3383
|
-
let t = e.commitPendingAppend.value;
|
|
3384
|
-
typeof t == "function" && (z = setTimeout(async () => {
|
|
3385
|
-
z = null, ee = !0;
|
|
3386
|
-
try {
|
|
3387
|
-
if (!e.pendingAppendItems.value.length) return;
|
|
3388
|
-
await t(), await _(), await _();
|
|
3389
|
-
} finally {
|
|
3390
|
-
d.value = null, ee = !1;
|
|
3391
|
-
}
|
|
3392
|
-
}, ei));
|
|
3393
|
-
}
|
|
3394
|
-
function de() {
|
|
3395
|
-
z &&= (clearTimeout(z), null);
|
|
3396
|
-
}
|
|
3397
|
-
function fe() {
|
|
3398
|
-
B && (clearTimeout(B), B = null, p.value = !1);
|
|
3399
|
-
}
|
|
3400
3796
|
return {
|
|
3401
|
-
|
|
3797
|
+
autoScroll: N.autoScroll,
|
|
3798
|
+
columnWidth: h,
|
|
3402
3799
|
containerHeight: C,
|
|
3403
|
-
getCardStyle:
|
|
3404
|
-
getLeavingCardStyle:
|
|
3405
|
-
getScrollbarThumbStyle:
|
|
3406
|
-
leavingItems:
|
|
3800
|
+
getCardStyle: te,
|
|
3801
|
+
getLeavingCardStyle: A.getLeavingCardStyle,
|
|
3802
|
+
getScrollbarThumbStyle: k.getScrollbarThumbStyle,
|
|
3803
|
+
leavingItems: A.leavingItems,
|
|
3407
3804
|
nextBoundaryLoadProgress: T,
|
|
3408
|
-
onScroll:
|
|
3409
|
-
onWheel:
|
|
3805
|
+
onScroll: z,
|
|
3806
|
+
onWheel: ee,
|
|
3410
3807
|
paginationLabel: E,
|
|
3411
3808
|
previousBoundaryLoadProgress: O,
|
|
3412
3809
|
renderedItems: b,
|
|
3413
3810
|
resolvedActiveIndex: v,
|
|
3414
|
-
scrollToIndex:
|
|
3415
|
-
showScrollbar:
|
|
3811
|
+
scrollToIndex: B,
|
|
3812
|
+
showScrollbar: k.showScrollbar,
|
|
3416
3813
|
scrollViewportRef: t
|
|
3417
3814
|
};
|
|
3418
3815
|
}
|
|
3419
|
-
function
|
|
3816
|
+
function Ti(e, t, n) {
|
|
3420
3817
|
return Math.min(Math.max(e, t), n);
|
|
3421
3818
|
}
|
|
3422
|
-
function si(e) {
|
|
3423
|
-
if (!e.active || !e.triggerEnabled) return 0;
|
|
3424
|
-
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3425
|
-
return t <= 0 ? 1 : oi(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
3426
|
-
}
|
|
3427
|
-
function ci(e) {
|
|
3428
|
-
if (!e.active || !e.triggerEnabled) return 0;
|
|
3429
|
-
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3430
|
-
return t <= 0 ? 1 : oi(e.progressDistancePx / t, 0, 1);
|
|
3431
|
-
}
|
|
3432
3819
|
//#endregion
|
|
3433
3820
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
3434
|
-
function
|
|
3821
|
+
function Ei(e) {
|
|
3435
3822
|
if (e) try {
|
|
3436
3823
|
e.removeAttribute("src"), e.src = "";
|
|
3437
3824
|
} catch {}
|
|
3438
3825
|
}
|
|
3439
|
-
function
|
|
3826
|
+
function Di(e) {
|
|
3440
3827
|
if (e) {
|
|
3441
3828
|
try {
|
|
3442
3829
|
e.currentTime = 0;
|
|
@@ -3447,12 +3834,12 @@ function ui(e) {
|
|
|
3447
3834
|
} catch {}
|
|
3448
3835
|
}
|
|
3449
3836
|
}
|
|
3450
|
-
function
|
|
3837
|
+
function Oi(e, t) {
|
|
3451
3838
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
3452
3839
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
3453
3840
|
return e.bottom > 0 && e.top < n;
|
|
3454
3841
|
}
|
|
3455
|
-
function
|
|
3842
|
+
function ki(e) {
|
|
3456
3843
|
if (!e) return null;
|
|
3457
3844
|
try {
|
|
3458
3845
|
return new URL(e, window.location.href).href;
|
|
@@ -3462,9 +3849,9 @@ function fi(e) {
|
|
|
3462
3849
|
}
|
|
3463
3850
|
//#endregion
|
|
3464
3851
|
//#region src/components/viewer-core/listPreview.ts
|
|
3465
|
-
var
|
|
3466
|
-
function
|
|
3467
|
-
let t =
|
|
3852
|
+
var Ai = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ji = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, Mi = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3853
|
+
function Ni(e) {
|
|
3854
|
+
let t = Pi(e), n = t?.url, r = Tr(e), i = e.title?.trim() || Ht(e.type);
|
|
3468
3855
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
3469
3856
|
kind: "video",
|
|
3470
3857
|
url: n,
|
|
@@ -3483,13 +3870,13 @@ function gi(e) {
|
|
|
3483
3870
|
width: r.width,
|
|
3484
3871
|
height: r.height,
|
|
3485
3872
|
label: i
|
|
3486
|
-
} : typeof n == "string" &&
|
|
3873
|
+
} : typeof n == "string" && Ii(e, n) ? {
|
|
3487
3874
|
kind: "video",
|
|
3488
3875
|
url: n,
|
|
3489
3876
|
width: r.width,
|
|
3490
3877
|
height: r.height,
|
|
3491
3878
|
label: i
|
|
3492
|
-
} : typeof n == "string" &&
|
|
3879
|
+
} : typeof n == "string" && Fi(e, n) ? {
|
|
3493
3880
|
kind: "image",
|
|
3494
3881
|
url: n,
|
|
3495
3882
|
width: r.width,
|
|
@@ -3503,26 +3890,26 @@ function gi(e) {
|
|
|
3503
3890
|
label: i
|
|
3504
3891
|
};
|
|
3505
3892
|
}
|
|
3506
|
-
function
|
|
3893
|
+
function Pi(e) {
|
|
3507
3894
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3508
3895
|
}
|
|
3509
|
-
function
|
|
3510
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
3896
|
+
function Fi(e, t) {
|
|
3897
|
+
return e.type !== "image" || typeof t != "string" ? !1 : Ai.test(t) || Li(t);
|
|
3511
3898
|
}
|
|
3512
|
-
function
|
|
3513
|
-
return e.type !== "video" || typeof t != "string" ? !1 :
|
|
3899
|
+
function Ii(e, t) {
|
|
3900
|
+
return e.type !== "video" || typeof t != "string" ? !1 : ji.test(t) || Ri(t);
|
|
3514
3901
|
}
|
|
3515
|
-
function
|
|
3902
|
+
function Li(e) {
|
|
3516
3903
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3517
3904
|
}
|
|
3518
|
-
function
|
|
3519
|
-
return
|
|
3905
|
+
function Ri(e) {
|
|
3906
|
+
return Mi.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3520
3907
|
}
|
|
3521
3908
|
//#endregion
|
|
3522
3909
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3523
|
-
function
|
|
3910
|
+
function zi(e) {
|
|
3524
3911
|
let t = D(null), n = i(() => {
|
|
3525
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3912
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? ki(e.item.value.healthCheck.url) : null;
|
|
3526
3913
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3527
3914
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3528
3915
|
L(n, (e, n) => {
|
|
@@ -3554,7 +3941,7 @@ function Si(e) {
|
|
|
3554
3941
|
r.refresh();
|
|
3555
3942
|
return;
|
|
3556
3943
|
}
|
|
3557
|
-
r =
|
|
3944
|
+
r = Wt.request({
|
|
3558
3945
|
assetType: "probe",
|
|
3559
3946
|
getPriority: e.getPriority,
|
|
3560
3947
|
onGrant() {
|
|
@@ -3564,7 +3951,7 @@ function Si(e) {
|
|
|
3564
3951
|
return;
|
|
3565
3952
|
}
|
|
3566
3953
|
let i = ++a;
|
|
3567
|
-
|
|
3954
|
+
vn(r).then((s) => {
|
|
3568
3955
|
if (!(i !== a || n.value !== r)) {
|
|
3569
3956
|
if (o.set(r, s ?? null), !s) {
|
|
3570
3957
|
t.value = null;
|
|
@@ -3572,7 +3959,7 @@ function Si(e) {
|
|
|
3572
3959
|
}
|
|
3573
3960
|
t.value = s, e.reportAssetError?.({
|
|
3574
3961
|
item: e.item.value,
|
|
3575
|
-
occurrenceKey:
|
|
3962
|
+
occurrenceKey: Q(e.item.value),
|
|
3576
3963
|
url: r,
|
|
3577
3964
|
kind: s,
|
|
3578
3965
|
surface: "grid"
|
|
@@ -3600,14 +3987,14 @@ function Si(e) {
|
|
|
3600
3987
|
}
|
|
3601
3988
|
//#endregion
|
|
3602
3989
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3603
|
-
var
|
|
3990
|
+
var Bi = ["aria-label"], Vi = {
|
|
3604
3991
|
key: 0,
|
|
3605
3992
|
"data-testid": "vibe-list-card-spinner",
|
|
3606
3993
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3607
|
-
},
|
|
3994
|
+
}, Hi = { 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]" }, Ui = ["src", "alt"], Wi = ["src"], Gi = ["data-kind"], Ki = { class: "grid justify-items-center gap-3 px-4 text-center" }, qi = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Ji = {
|
|
3608
3995
|
key: 4,
|
|
3609
3996
|
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))]"
|
|
3610
|
-
},
|
|
3997
|
+
}, Yi = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Xi = { class: "pointer-events-none absolute inset-0 z-[3]" }, Zi = /* @__PURE__ */ d({
|
|
3611
3998
|
__name: "ListCard",
|
|
3612
3999
|
props: {
|
|
3613
4000
|
active: {
|
|
@@ -3631,7 +4018,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3631
4018
|
},
|
|
3632
4019
|
emits: ["open"],
|
|
3633
4020
|
setup(e, { emit: t }) {
|
|
3634
|
-
let n = e, r = t, l = i(() =>
|
|
4021
|
+
let n = e, r = t, l = i(() => Ni(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 = zi({
|
|
3635
4022
|
attachedAssetUrl: E,
|
|
3636
4023
|
getPriority: ue,
|
|
3637
4024
|
isInView: d,
|
|
@@ -3640,7 +4027,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3640
4027
|
loadErrorKind: g,
|
|
3641
4028
|
reportAssetError: n.reportAssetError,
|
|
3642
4029
|
surfaceActive: i(() => n.surfaceActive)
|
|
3643
|
-
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() =>
|
|
4030
|
+
}), 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();
|
|
3644
4031
|
L([E, () => l.value.kind], () => {
|
|
3645
4032
|
let e = l.value.kind === "fallback";
|
|
3646
4033
|
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
@@ -3654,66 +4041,66 @@ var Ci = ["aria-label"], wi = {
|
|
|
3654
4041
|
q();
|
|
3655
4042
|
}), L(() => n.surfaceActive, (e) => {
|
|
3656
4043
|
if (!e) {
|
|
3657
|
-
|
|
4044
|
+
Y(), q();
|
|
3658
4045
|
return;
|
|
3659
4046
|
}
|
|
3660
4047
|
requestAnimationFrame(() => {
|
|
3661
|
-
|
|
4048
|
+
re(), K(), q();
|
|
3662
4049
|
});
|
|
3663
4050
|
}), S(() => {
|
|
3664
4051
|
if (!y.value || typeof IntersectionObserver > "u") {
|
|
3665
4052
|
b.value = null, d.value = !0, K();
|
|
3666
4053
|
return;
|
|
3667
4054
|
}
|
|
3668
|
-
b.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"),
|
|
3669
|
-
for (let t of e) t.target === y.value && (n.surfaceActive &&
|
|
4055
|
+
b.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"), B = new IntersectionObserver((e) => {
|
|
4056
|
+
for (let t of e) t.target === y.value && (n.surfaceActive && re(t), K(), q());
|
|
3670
4057
|
}, {
|
|
3671
4058
|
root: b.value,
|
|
3672
4059
|
threshold: [0, 1]
|
|
3673
|
-
}),
|
|
4060
|
+
}), B.observe(y.value);
|
|
3674
4061
|
}), x(() => {
|
|
3675
|
-
|
|
4062
|
+
J(), F.release(), B?.disconnect(), B = null;
|
|
3676
4063
|
});
|
|
3677
4064
|
function U() {
|
|
3678
|
-
X(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url),
|
|
4065
|
+
X(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), Y());
|
|
3679
4066
|
}
|
|
3680
4067
|
async function W() {
|
|
3681
4068
|
if (!X(_.value)) return;
|
|
3682
4069
|
let e = E.value ?? n.item.url;
|
|
3683
4070
|
m.value = !1, g.value = "generic";
|
|
3684
|
-
let t = await
|
|
4071
|
+
let t = await _n(e);
|
|
3685
4072
|
g.value = t, n.reportAssetError?.({
|
|
3686
4073
|
item: n.item,
|
|
3687
|
-
occurrenceKey:
|
|
4074
|
+
occurrenceKey: Q(n.item),
|
|
3688
4075
|
url: e,
|
|
3689
4076
|
kind: t,
|
|
3690
4077
|
surface: "grid"
|
|
3691
|
-
}),
|
|
4078
|
+
}), Y();
|
|
3692
4079
|
}
|
|
3693
4080
|
function ne() {
|
|
3694
|
-
X(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url),
|
|
4081
|
+
X(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), Y(), q());
|
|
3695
4082
|
}
|
|
3696
4083
|
function G() {
|
|
3697
4084
|
X(C.value) && (h.value || (m.value = !1));
|
|
3698
4085
|
}
|
|
3699
4086
|
function K() {
|
|
3700
4087
|
if (l.value.kind === "fallback") {
|
|
3701
|
-
|
|
4088
|
+
J(!1);
|
|
3702
4089
|
return;
|
|
3703
4090
|
}
|
|
3704
4091
|
if (!n.surfaceActive) {
|
|
3705
|
-
|
|
4092
|
+
Y();
|
|
3706
4093
|
return;
|
|
3707
4094
|
}
|
|
3708
4095
|
if (!O.value) {
|
|
3709
|
-
|
|
4096
|
+
J();
|
|
3710
4097
|
return;
|
|
3711
4098
|
}
|
|
3712
4099
|
if (T.value || V) {
|
|
3713
4100
|
V?.refresh();
|
|
3714
4101
|
return;
|
|
3715
4102
|
}
|
|
3716
|
-
V =
|
|
4103
|
+
V = Wt.request({
|
|
3717
4104
|
assetType: l.value.kind,
|
|
3718
4105
|
getPriority: ue,
|
|
3719
4106
|
onGrant() {
|
|
@@ -3730,7 +4117,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3730
4117
|
return;
|
|
3731
4118
|
}
|
|
3732
4119
|
if (E.value && d.value && m.value) {
|
|
3733
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
4120
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, xn(e);
|
|
3734
4121
|
return;
|
|
3735
4122
|
}
|
|
3736
4123
|
try {
|
|
@@ -3739,23 +4126,23 @@ var Ci = ["aria-label"], wi = {
|
|
|
3739
4126
|
e.pause();
|
|
3740
4127
|
}
|
|
3741
4128
|
}
|
|
3742
|
-
function
|
|
3743
|
-
T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (se(), ce()),
|
|
4129
|
+
function J(e = !0) {
|
|
4130
|
+
T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (se(), ce()), Y();
|
|
3744
4131
|
}
|
|
3745
|
-
function
|
|
4132
|
+
function Y() {
|
|
3746
4133
|
V?.release(), V = null;
|
|
3747
4134
|
}
|
|
3748
|
-
function
|
|
4135
|
+
function re(e) {
|
|
3749
4136
|
let t = y.value;
|
|
3750
4137
|
if (!t) {
|
|
3751
4138
|
d.value = !0;
|
|
3752
4139
|
return;
|
|
3753
4140
|
}
|
|
3754
|
-
d.value =
|
|
4141
|
+
d.value = Oi(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3755
4142
|
}
|
|
3756
4143
|
function ie(e) {
|
|
3757
4144
|
if (!e) return;
|
|
3758
|
-
let t =
|
|
4145
|
+
let t = Q(n.item), r = `${t}|${e}`;
|
|
3759
4146
|
H.has(r) || (H.add(r), n.reportAssetLoad?.({
|
|
3760
4147
|
item: n.item,
|
|
3761
4148
|
occurrenceKey: t,
|
|
@@ -3765,16 +4152,16 @@ var Ci = ["aria-label"], wi = {
|
|
|
3765
4152
|
}
|
|
3766
4153
|
function ae() {
|
|
3767
4154
|
if (!z.value || F.retry()) return;
|
|
3768
|
-
let e =
|
|
4155
|
+
let e = Q(n.item);
|
|
3769
4156
|
H.forEach((t) => {
|
|
3770
4157
|
t.startsWith(`${e}|`) && H.delete(t);
|
|
3771
|
-
}), g.value = null, m.value = !1, T.value = !1,
|
|
4158
|
+
}), g.value = null, m.value = !1, T.value = !1, Y(), K();
|
|
3772
4159
|
}
|
|
3773
4160
|
function se() {
|
|
3774
|
-
|
|
4161
|
+
Ei(_.value);
|
|
3775
4162
|
}
|
|
3776
4163
|
function ce() {
|
|
3777
|
-
|
|
4164
|
+
Di(C.value);
|
|
3778
4165
|
}
|
|
3779
4166
|
function ue() {
|
|
3780
4167
|
let e = y.value;
|
|
@@ -3788,8 +4175,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
3788
4175
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3789
4176
|
}
|
|
3790
4177
|
function X(e) {
|
|
3791
|
-
let t =
|
|
3792
|
-
return !e || !t ? !1 :
|
|
4178
|
+
let t = ki(E.value);
|
|
4179
|
+
return !e || !t ? !1 : ki("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3793
4180
|
}
|
|
3794
4181
|
function de() {
|
|
3795
4182
|
r("open");
|
|
@@ -3817,8 +4204,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
3817
4204
|
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]",
|
|
3818
4205
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3819
4206
|
onClick: de
|
|
3820
|
-
}, null, 8,
|
|
3821
|
-
|
|
4207
|
+
}, null, 8, Bi),
|
|
4208
|
+
ee.value ? (w(), s("div", Vi, [c("span", Hi, [u(N(oe), {
|
|
3822
4209
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3823
4210
|
"aria-hidden": "true"
|
|
3824
4211
|
})])])) : o("", !0),
|
|
@@ -3832,7 +4219,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3832
4219
|
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"]),
|
|
3833
4220
|
onLoad: U,
|
|
3834
4221
|
onError: W
|
|
3835
|
-
}, null, 42,
|
|
4222
|
+
}, null, 42, Ui)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3836
4223
|
key: 2,
|
|
3837
4224
|
ref_key: "videoRef",
|
|
3838
4225
|
ref: C,
|
|
@@ -3848,31 +4235,31 @@ var Ci = ["aria-label"], wi = {
|
|
|
3848
4235
|
onPlaying: ne,
|
|
3849
4236
|
onStalled: G,
|
|
3850
4237
|
onWaiting: G
|
|
3851
|
-
}, null, 42,
|
|
4238
|
+
}, null, 42, Wi)) : R.value ? (w(), s("div", {
|
|
3852
4239
|
key: 3,
|
|
3853
4240
|
"data-testid": "vibe-list-card-error",
|
|
3854
4241
|
"data-kind": I.value,
|
|
3855
4242
|
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))]"
|
|
3856
|
-
}, [c("div",
|
|
4243
|
+
}, [c("div", Ki, [
|
|
3857
4244
|
u(N(le), {
|
|
3858
4245
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3859
4246
|
"aria-hidden": "true"
|
|
3860
4247
|
}),
|
|
3861
|
-
c("span",
|
|
4248
|
+
c("span", qi, j(N(hn)(I.value)), 1),
|
|
3862
4249
|
z.value ? (w(), s("button", {
|
|
3863
4250
|
key: 0,
|
|
3864
4251
|
type: "button",
|
|
3865
4252
|
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",
|
|
3866
|
-
onClick:
|
|
4253
|
+
onClick: te(ae, ["stop"])
|
|
3867
4254
|
}, " Retry ")) : o("", !0)
|
|
3868
|
-
])], 8,
|
|
3869
|
-
icon: N(
|
|
4255
|
+
])], 8, Gi)) : (w(), s("div", Ji, [c("div", Yi, [k(e.$slots, "item-icon", {
|
|
4256
|
+
icon: N(Vt)(n.item.type),
|
|
3870
4257
|
item: n.item
|
|
3871
|
-
}, () => [(w(), a(A(N(
|
|
4258
|
+
}, () => [(w(), a(A(N(Vt)(n.item.type)), {
|
|
3872
4259
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3873
4260
|
"aria-hidden": "true"
|
|
3874
4261
|
}))])])])),
|
|
3875
|
-
c("div",
|
|
4262
|
+
c("div", Xi, [k(e.$slots, "grid-item-overlay", {
|
|
3876
4263
|
active: n.active,
|
|
3877
4264
|
focused: f.value,
|
|
3878
4265
|
hovered: p.value,
|
|
@@ -3882,24 +4269,24 @@ var Ci = ["aria-label"], wi = {
|
|
|
3882
4269
|
})])
|
|
3883
4270
|
], 34));
|
|
3884
4271
|
}
|
|
3885
|
-
}),
|
|
4272
|
+
}), Qi = { 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)]" }, $i = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, ea = {
|
|
3886
4273
|
"data-testid": "vibe-pagination",
|
|
3887
4274
|
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]"
|
|
3888
|
-
},
|
|
4275
|
+
}, ta = { class: "whitespace-nowrap" }, na = {
|
|
3889
4276
|
key: 0,
|
|
3890
4277
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3891
|
-
},
|
|
4278
|
+
}, ra = [
|
|
3892
4279
|
"data-active",
|
|
3893
4280
|
"data-index",
|
|
3894
4281
|
"data-item-id",
|
|
3895
4282
|
"data-occurrence-key"
|
|
3896
|
-
],
|
|
4283
|
+
], ia = ["data-item-id"], aa = {
|
|
3897
4284
|
key: 0,
|
|
3898
4285
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3899
|
-
},
|
|
4286
|
+
}, oa = {
|
|
3900
4287
|
key: 1,
|
|
3901
4288
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3902
|
-
},
|
|
4289
|
+
}, sa = { class: "mx-auto flex w-full justify-center" }, ca = /* @__PURE__ */ d({
|
|
3903
4290
|
__name: "ListSurface",
|
|
3904
4291
|
props: {
|
|
3905
4292
|
active: {
|
|
@@ -3911,6 +4298,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3911
4298
|
type: Boolean,
|
|
3912
4299
|
default: !1
|
|
3913
4300
|
},
|
|
4301
|
+
bottomLoadBufferPx: { default: 100 },
|
|
3914
4302
|
commitPendingAppend: {
|
|
3915
4303
|
type: [Function, null],
|
|
3916
4304
|
default: null
|
|
@@ -3959,87 +4347,90 @@ var Ci = ["aria-label"], wi = {
|
|
|
3959
4347
|
"open-fullscreen",
|
|
3960
4348
|
"update:activeIndex"
|
|
3961
4349
|
],
|
|
3962
|
-
setup(e, {
|
|
3963
|
-
let
|
|
3964
|
-
active: M(
|
|
3965
|
-
allowExhaustedNextPageRefresh: M(
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
4350
|
+
setup(e, { expose: n, emit: r }) {
|
|
4351
|
+
let d = e, f = F(), p = r, m = wi({
|
|
4352
|
+
active: M(d, "active"),
|
|
4353
|
+
allowExhaustedNextPageRefresh: M(d, "allowExhaustedNextPageRefresh"),
|
|
4354
|
+
bottomLoadBufferPx: M(d, "bottomLoadBufferPx"),
|
|
4355
|
+
items: M(d, "items"),
|
|
4356
|
+
activeIndex: M(d, "activeIndex"),
|
|
4357
|
+
loading: M(d, "loading"),
|
|
4358
|
+
hasNextPage: M(d, "hasNextPage"),
|
|
4359
|
+
hasPreviousPage: M(d, "hasPreviousPage"),
|
|
4360
|
+
paginationDetail: M(d, "paginationDetail"),
|
|
4361
|
+
pendingAppendItems: M(d, "pendingAppendItems"),
|
|
4362
|
+
commitPendingAppend: M(d, "commitPendingAppend"),
|
|
4363
|
+
requestNextPage: M(d, "requestNextPage"),
|
|
4364
|
+
requestPreviousPage: M(d, "requestPreviousPage"),
|
|
3976
4365
|
setActiveIndex(e) {
|
|
3977
|
-
|
|
4366
|
+
p("update:activeIndex", e);
|
|
3978
4367
|
}
|
|
3979
|
-
})
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
4368
|
+
});
|
|
4369
|
+
n({ autoScroll: m.autoScroll });
|
|
4370
|
+
let h = i(() => on({
|
|
4371
|
+
itemCount: d.items.length,
|
|
4372
|
+
loading: d.loading,
|
|
4373
|
+
phase: d.phase
|
|
4374
|
+
})), _ = i(() => sn({
|
|
4375
|
+
errorMessage: d.errorMessage,
|
|
4376
|
+
hasItems: d.items.length > 0,
|
|
4377
|
+
hasNextPage: d.hasNextPage,
|
|
4378
|
+
phase: h.value,
|
|
3988
4379
|
surface: "grid"
|
|
3989
|
-
})),
|
|
3990
|
-
activeIndex:
|
|
3991
|
-
kind:
|
|
3992
|
-
loading:
|
|
3993
|
-
message:
|
|
3994
|
-
paginationDetail:
|
|
3995
|
-
total:
|
|
3996
|
-
}),
|
|
3997
|
-
emptyStateMode: M(
|
|
3998
|
-
itemCount:
|
|
3999
|
-
loading: M(
|
|
4000
|
-
renderSlot:
|
|
4380
|
+
})), x = i(() => !d.showStatusBadges || !_.value ? null : {
|
|
4381
|
+
activeIndex: m.resolvedActiveIndex.value,
|
|
4382
|
+
kind: _.value.kind,
|
|
4383
|
+
loading: d.loading,
|
|
4384
|
+
message: _.value.message,
|
|
4385
|
+
paginationDetail: d.paginationDetail,
|
|
4386
|
+
total: d.items.length
|
|
4387
|
+
}), 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({
|
|
4388
|
+
emptyStateMode: M(d, "emptyStateMode"),
|
|
4389
|
+
itemCount: T,
|
|
4390
|
+
loading: M(d, "loading"),
|
|
4391
|
+
renderSlot: f["empty-state"],
|
|
4001
4392
|
surface: "grid"
|
|
4002
4393
|
});
|
|
4003
|
-
return L([
|
|
4004
|
-
|
|
4394
|
+
return L([m.nextBoundaryLoadProgress, m.previousBoundaryLoadProgress], ([e, t]) => {
|
|
4395
|
+
p("boundary-load-progress", {
|
|
4005
4396
|
nextBoundaryLoadProgress: e,
|
|
4006
4397
|
previousBoundaryLoadProgress: t
|
|
4007
4398
|
});
|
|
4008
|
-
}, { immediate: !0 }), (e, n) => (w(), s("div",
|
|
4009
|
-
c("div",
|
|
4399
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", Qi, [
|
|
4400
|
+
c("div", $i, [c("span", ea, [c("span", ta, j(N(m).paginationLabel.value), 1), d.paginationDetail ? (w(), s("span", na, j(d.paginationDetail), 1)) : o("", !0)])]),
|
|
4010
4401
|
c("div", {
|
|
4011
|
-
ref: N(
|
|
4402
|
+
ref: N(m).scrollViewportRef,
|
|
4012
4403
|
"data-testid": "vibe-list-scroll",
|
|
4013
4404
|
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",
|
|
4014
|
-
onScroll: n[0] ||= (...e) => N(
|
|
4015
|
-
onWheel: n[1] ||= (...e) => N(
|
|
4405
|
+
onScroll: n[0] ||= (...e) => N(m).onScroll && N(m).onScroll(...e),
|
|
4406
|
+
onWheel: n[1] ||= (...e) => N(m).onWheel && N(m).onWheel(...e)
|
|
4016
4407
|
}, [c("div", {
|
|
4017
4408
|
"data-testid": "vibe-list-content",
|
|
4018
4409
|
class: "relative",
|
|
4019
|
-
style: b({ height: `${N(
|
|
4410
|
+
style: b({ height: `${N(m).containerHeight.value}px` })
|
|
4020
4411
|
}, [
|
|
4021
|
-
(w(!0), s(t, null, O(N(
|
|
4022
|
-
key: N(
|
|
4412
|
+
(w(!0), s(t, null, O(N(m).renderedItems.value, ({ item: t, index: n }) => (w(), s("article", {
|
|
4413
|
+
key: N(Q)(t),
|
|
4023
4414
|
"data-testid": "vibe-list-card",
|
|
4024
|
-
"data-active": n === N(
|
|
4415
|
+
"data-active": n === N(m).resolvedActiveIndex.value ? "true" : "false",
|
|
4025
4416
|
"data-index": n,
|
|
4026
4417
|
"data-item-id": t.id,
|
|
4027
|
-
"data-occurrence-key": N(
|
|
4418
|
+
"data-occurrence-key": N(Q)(t),
|
|
4028
4419
|
class: "absolute will-change-transform",
|
|
4029
|
-
style: b(N(
|
|
4030
|
-
}, [u(
|
|
4031
|
-
active: n === N(
|
|
4420
|
+
style: b(N(m).getCardStyle(n))
|
|
4421
|
+
}, [u(Zi, {
|
|
4422
|
+
active: n === N(m).resolvedActiveIndex.value,
|
|
4032
4423
|
index: n,
|
|
4033
4424
|
item: t,
|
|
4034
|
-
"report-asset-error":
|
|
4035
|
-
"report-asset-load":
|
|
4036
|
-
"surface-active":
|
|
4037
|
-
onOpen: (e) =>
|
|
4038
|
-
}, l({ _: 2 }, [
|
|
4425
|
+
"report-asset-error": d.reportAssetError,
|
|
4426
|
+
"report-asset-load": d.reportAssetLoad,
|
|
4427
|
+
"surface-active": d.active,
|
|
4428
|
+
onOpen: (e) => p("open-fullscreen", n)
|
|
4429
|
+
}, l({ _: 2 }, [f["grid-item-overlay"] ? {
|
|
4039
4430
|
name: "grid-item-overlay",
|
|
4040
4431
|
fn: z((t) => [k(e.$slots, "grid-item-overlay", g({ ref_for: !0 }, t))]),
|
|
4041
4432
|
key: "0"
|
|
4042
|
-
} : void 0,
|
|
4433
|
+
} : void 0, f["item-icon"] ? {
|
|
4043
4434
|
name: "item-icon",
|
|
4044
4435
|
fn: z((t) => [k(e.$slots, "item-icon", g({ ref_for: !0 }, t))]),
|
|
4045
4436
|
key: "1"
|
|
@@ -4051,21 +4442,21 @@ var Ci = ["aria-label"], wi = {
|
|
|
4051
4442
|
"report-asset-load",
|
|
4052
4443
|
"surface-active",
|
|
4053
4444
|
"onOpen"
|
|
4054
|
-
])], 12,
|
|
4055
|
-
(w(!0), s(t, null, O(N(
|
|
4056
|
-
key: `leaving-${N(
|
|
4445
|
+
])], 12, ra))), 128)),
|
|
4446
|
+
(w(!0), s(t, null, O(N(m).leavingItems.value, (t) => (w(), s("article", {
|
|
4447
|
+
key: `leaving-${N(Q)(t.item)}`,
|
|
4057
4448
|
"data-testid": "vibe-list-card-leaving",
|
|
4058
4449
|
"data-item-id": t.item.id,
|
|
4059
4450
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
4060
|
-
style: b(N(
|
|
4061
|
-
}, [u(
|
|
4451
|
+
style: b(N(m).getLeavingCardStyle(t.item))
|
|
4452
|
+
}, [u(Zi, {
|
|
4062
4453
|
active: !1,
|
|
4063
4454
|
index: -1,
|
|
4064
4455
|
item: t.item,
|
|
4065
|
-
"report-asset-error":
|
|
4066
|
-
"report-asset-load":
|
|
4456
|
+
"report-asset-error": d.reportAssetError,
|
|
4457
|
+
"report-asset-load": d.reportAssetLoad,
|
|
4067
4458
|
"surface-active": !1
|
|
4068
|
-
}, l({ _: 2 }, [
|
|
4459
|
+
}, l({ _: 2 }, [f["item-icon"] ? {
|
|
4069
4460
|
name: "item-icon",
|
|
4070
4461
|
fn: z((t) => [k(e.$slots, "item-icon", g({ ref_for: !0 }, t))]),
|
|
4071
4462
|
key: "0"
|
|
@@ -4073,14 +4464,14 @@ var Ci = ["aria-label"], wi = {
|
|
|
4073
4464
|
"item",
|
|
4074
4465
|
"report-asset-error",
|
|
4075
4466
|
"report-asset-load"
|
|
4076
|
-
])], 12,
|
|
4077
|
-
N(
|
|
4467
|
+
])], 12, ia))), 128)),
|
|
4468
|
+
N(P) && N(E) ? (w(), a(Bn, {
|
|
4078
4469
|
key: 0,
|
|
4079
|
-
message: N(
|
|
4080
|
-
mode: N(
|
|
4081
|
-
surface: N(
|
|
4470
|
+
message: N(E).message,
|
|
4471
|
+
mode: N(E).mode,
|
|
4472
|
+
surface: N(E).surface
|
|
4082
4473
|
}, {
|
|
4083
|
-
default: z(() => [N(
|
|
4474
|
+
default: z(() => [N(A) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(E)))) : o("", !0)]),
|
|
4084
4475
|
_: 3
|
|
4085
4476
|
}, 8, [
|
|
4086
4477
|
"message",
|
|
@@ -4088,28 +4479,28 @@ var Ci = ["aria-label"], wi = {
|
|
|
4088
4479
|
"surface"
|
|
4089
4480
|
])) : o("", !0)
|
|
4090
4481
|
], 4)], 544),
|
|
4091
|
-
N(
|
|
4482
|
+
N(m).showScrollbar.value ? (w(), s("div", aa, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
4092
4483
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
4093
|
-
class: v(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out",
|
|
4094
|
-
style: b(N(
|
|
4484
|
+
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"]),
|
|
4485
|
+
style: b(N(m).getScrollbarThumbStyle())
|
|
4095
4486
|
}, null, 6)])) : o("", !0),
|
|
4096
|
-
|
|
4097
|
-
|
|
4487
|
+
f["grid-footer"] ? (w(), s("div", oa, [c("div", sa, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
4488
|
+
x.value ? (w(), s("div", {
|
|
4098
4489
|
key: 2,
|
|
4099
|
-
class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6",
|
|
4100
|
-
}, [
|
|
4490
|
+
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"])
|
|
4491
|
+
}, [C.value ? k(e.$slots, "grid-status", y(g({ key: 0 }, x.value))) : (w(), s("span", {
|
|
4101
4492
|
key: 1,
|
|
4102
4493
|
"data-testid": "vibe-grid-status-badge",
|
|
4103
|
-
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]",
|
|
4104
|
-
}, j(
|
|
4105
|
-
N(
|
|
4494
|
+
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" : ""])
|
|
4495
|
+
}, j(x.value.message), 3))], 2)) : o("", !0),
|
|
4496
|
+
N(D) && N(E) ? (w(), a(Bn, {
|
|
4106
4497
|
key: 3,
|
|
4107
|
-
class: v(["z-[3]",
|
|
4108
|
-
message: N(
|
|
4109
|
-
mode: N(
|
|
4110
|
-
surface: N(
|
|
4498
|
+
class: v(["z-[3]", f["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
4499
|
+
message: N(E).message,
|
|
4500
|
+
mode: N(E).mode,
|
|
4501
|
+
surface: N(E).surface
|
|
4111
4502
|
}, {
|
|
4112
|
-
default: z(() => [N(
|
|
4503
|
+
default: z(() => [N(A) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(E)))) : o("", !0)]),
|
|
4113
4504
|
_: 3
|
|
4114
4505
|
}, 8, [
|
|
4115
4506
|
"class",
|
|
@@ -4119,16 +4510,17 @@ var Ci = ["aria-label"], wi = {
|
|
|
4119
4510
|
])) : o("", !0)
|
|
4120
4511
|
]));
|
|
4121
4512
|
}
|
|
4122
|
-
}),
|
|
4513
|
+
}), la = ["data-surface-mode"], ua = {
|
|
4123
4514
|
key: 1,
|
|
4124
4515
|
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"
|
|
4125
|
-
},
|
|
4516
|
+
}, da = ["data-visible", "inert"], fa = ["data-visible", "inert"], pa = {
|
|
4126
4517
|
key: 3,
|
|
4127
4518
|
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"
|
|
4128
|
-
},
|
|
4519
|
+
}, ma = /* @__PURE__ */ d({
|
|
4129
4520
|
name: "VibeLayout",
|
|
4130
4521
|
__name: "Layout",
|
|
4131
4522
|
props: {
|
|
4523
|
+
bottomLoadBufferPx: {},
|
|
4132
4524
|
emptyStateMode: {},
|
|
4133
4525
|
fillDelayMs: {},
|
|
4134
4526
|
fillDelayStepMs: {},
|
|
@@ -4151,18 +4543,26 @@ var Ci = ["aria-label"], wi = {
|
|
|
4151
4543
|
"update:surfaceMode"
|
|
4152
4544
|
],
|
|
4153
4545
|
setup(e, { expose: n, emit: i }) {
|
|
4154
|
-
let d = e, f = F(), m = i, h =
|
|
4546
|
+
let d = e, f = F(), m = i, h = dt(d, m), g = D(null), _ = fe((e) => {
|
|
4155
4547
|
m("asset-errors", e);
|
|
4156
|
-
}),
|
|
4548
|
+
}), v = pe((e) => {
|
|
4157
4549
|
m("asset-loads", e);
|
|
4158
4550
|
});
|
|
4159
|
-
|
|
4160
|
-
|
|
4551
|
+
x(() => {
|
|
4552
|
+
_.stop(), v.stop();
|
|
4161
4553
|
}), L(() => h.items.value, (e) => {
|
|
4162
4554
|
m("items-change", [...e]);
|
|
4163
|
-
})
|
|
4555
|
+
});
|
|
4556
|
+
function b(e) {
|
|
4557
|
+
g.value?.autoScroll(e);
|
|
4558
|
+
}
|
|
4559
|
+
return n({
|
|
4560
|
+
autoScroll: b,
|
|
4164
4561
|
cancel: h.cancel,
|
|
4562
|
+
cancelFill: h.cancelFill,
|
|
4165
4563
|
clearRemoved: h.clearRemoved,
|
|
4564
|
+
fillUntil: h.fillUntil,
|
|
4565
|
+
fillUntilEnd: h.fillUntilEnd,
|
|
4166
4566
|
getItemByOccurrenceKey: h.getItemByOccurrenceKey,
|
|
4167
4567
|
getItems: h.getItems,
|
|
4168
4568
|
getRemovedIds: h.getRemovedIds,
|
|
@@ -4184,7 +4584,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
4184
4584
|
type: "button",
|
|
4185
4585
|
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",
|
|
4186
4586
|
onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
|
|
4187
|
-
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div",
|
|
4587
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", ua, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
4188
4588
|
appear: "",
|
|
4189
4589
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
4190
4590
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -4193,14 +4593,17 @@ var Ci = ["aria-label"], wi = {
|
|
|
4193
4593
|
"leave-from-class": "translate-y-0 opacity-100",
|
|
4194
4594
|
"leave-to-class": "translate-y-3 opacity-0"
|
|
4195
4595
|
}, {
|
|
4196
|
-
default: z(() => [
|
|
4596
|
+
default: z(() => [ee(c("div", {
|
|
4197
4597
|
"data-testid": "vibe-list-surface",
|
|
4198
4598
|
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
4199
4599
|
inert: N(h).surfaceMode.value !== "list",
|
|
4200
4600
|
class: "absolute inset-0 z-[2]"
|
|
4201
|
-
}, [u(
|
|
4601
|
+
}, [u(ca, {
|
|
4602
|
+
ref_key: "listSurfaceRef",
|
|
4603
|
+
ref: g,
|
|
4202
4604
|
active: N(h).surfaceMode.value === "list",
|
|
4203
4605
|
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
4606
|
+
"bottom-load-buffer-px": d.bottomLoadBufferPx,
|
|
4204
4607
|
items: N(h).items.value,
|
|
4205
4608
|
"active-index": N(h).activeIndex.value,
|
|
4206
4609
|
"error-message": N(h).errorMessage.value,
|
|
@@ -4211,8 +4614,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
4211
4614
|
phase: N(h).phase.value,
|
|
4212
4615
|
"commit-pending-append": N(h).commitPendingAppend,
|
|
4213
4616
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4214
|
-
"report-asset-error": N(
|
|
4215
|
-
"report-asset-load": N(
|
|
4617
|
+
"report-asset-error": N(_).report,
|
|
4618
|
+
"report-asset-load": N(v).report,
|
|
4216
4619
|
"request-next-page": N(h).prefetchNextPage,
|
|
4217
4620
|
"request-previous-page": N(h).prefetchPreviousPage,
|
|
4218
4621
|
"empty-state-mode": d.emptyStateMode,
|
|
@@ -4249,6 +4652,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
4249
4652
|
]), 1032, [
|
|
4250
4653
|
"active",
|
|
4251
4654
|
"allow-exhausted-next-page-refresh",
|
|
4655
|
+
"bottom-load-buffer-px",
|
|
4252
4656
|
"items",
|
|
4253
4657
|
"active-index",
|
|
4254
4658
|
"error-message",
|
|
@@ -4268,7 +4672,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
4268
4672
|
"onBoundaryLoadProgress",
|
|
4269
4673
|
"onOpenFullscreen",
|
|
4270
4674
|
"onUpdate:activeIndex"
|
|
4271
|
-
])], 8,
|
|
4675
|
+
])], 8, da), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
4272
4676
|
_: 3
|
|
4273
4677
|
}), u(r, {
|
|
4274
4678
|
appear: "",
|
|
@@ -4279,12 +4683,12 @@ var Ci = ["aria-label"], wi = {
|
|
|
4279
4683
|
"leave-from-class": "translate-y-0 opacity-100",
|
|
4280
4684
|
"leave-to-class": "-translate-y-3 opacity-0"
|
|
4281
4685
|
}, {
|
|
4282
|
-
default: z(() => [
|
|
4686
|
+
default: z(() => [ee(c("div", {
|
|
4283
4687
|
"data-testid": "vibe-fullscreen-surface",
|
|
4284
4688
|
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4285
4689
|
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
4286
4690
|
class: "absolute inset-0 z-[3]"
|
|
4287
|
-
}, [u(
|
|
4691
|
+
}, [u(Sr, {
|
|
4288
4692
|
items: N(h).items.value,
|
|
4289
4693
|
active: N(h).surfaceMode.value === "fullscreen",
|
|
4290
4694
|
"active-index": N(h).activeIndex.value,
|
|
@@ -4293,8 +4697,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
4293
4697
|
"has-next-page": N(h).hasNextPage.value,
|
|
4294
4698
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4295
4699
|
phase: N(h).phase.value,
|
|
4296
|
-
"report-asset-error": N(
|
|
4297
|
-
"report-asset-load": N(
|
|
4700
|
+
"report-asset-error": N(_).report,
|
|
4701
|
+
"report-asset-load": N(v).report,
|
|
4298
4702
|
"empty-state-mode": d.emptyStateMode,
|
|
4299
4703
|
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
4300
4704
|
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
@@ -4353,12 +4757,12 @@ var Ci = ["aria-label"], wi = {
|
|
|
4353
4757
|
"show-back-to-list",
|
|
4354
4758
|
"onBackToList",
|
|
4355
4759
|
"onUpdate:activeIndex"
|
|
4356
|
-
])], 8,
|
|
4760
|
+
])], 8, fa), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
4357
4761
|
_: 3
|
|
4358
|
-
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div",
|
|
4762
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", pa, [u(N(oe), {
|
|
4359
4763
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
4360
4764
|
"aria-hidden": "true"
|
|
4361
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(
|
|
4765
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(Sr, {
|
|
4362
4766
|
key: 4,
|
|
4363
4767
|
items: N(h).items.value,
|
|
4364
4768
|
active: !0,
|
|
@@ -4368,8 +4772,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
4368
4772
|
"has-next-page": N(h).hasNextPage.value,
|
|
4369
4773
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4370
4774
|
phase: N(h).phase.value,
|
|
4371
|
-
"report-asset-error": N(
|
|
4372
|
-
"report-asset-load": N(
|
|
4775
|
+
"report-asset-error": N(_).report,
|
|
4776
|
+
"report-asset-load": N(v).report,
|
|
4373
4777
|
"empty-state-mode": d.emptyStateMode,
|
|
4374
4778
|
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
4375
4779
|
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
@@ -4426,10 +4830,10 @@ var Ci = ["aria-label"], wi = {
|
|
|
4426
4830
|
"show-status-badges",
|
|
4427
4831
|
"onBackToList",
|
|
4428
4832
|
"onUpdate:activeIndex"
|
|
4429
|
-
]))], 8,
|
|
4833
|
+
]))], 8, la));
|
|
4430
4834
|
}
|
|
4431
|
-
}),
|
|
4432
|
-
e.component("VibeLayout",
|
|
4835
|
+
}), ha = { install(e) {
|
|
4836
|
+
e.component("VibeLayout", ma);
|
|
4433
4837
|
} };
|
|
4434
4838
|
//#endregion
|
|
4435
|
-
export {
|
|
4839
|
+
export { ma as VibeLayout, ha as VibePlugin, ha as default };
|