@wyxos/vibe 3.1.21 → 3.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/ListSurface.vue.d.ts +5 -1
- package/lib/components/viewer-core/autoResolveBucketFactory.d.ts +15 -0
- package/lib/components/viewer-core/autoResolveFillUntil.d.ts +46 -0
- package/lib/components/viewer-core/autoResolveHelpers.d.ts +1 -0
- package/lib/components/viewer-core/autoResolveLoading.d.ts +44 -0
- package/lib/components/viewer-core/fillProgress.d.ts +12 -0
- package/lib/components/viewer-core/masonryBoundaryLock.d.ts +5 -0
- package/lib/components/viewer-core/masonryItemMutation.d.ts +35 -0
- package/lib/components/viewer-core/masonryPendingAppend.d.ts +17 -0
- package/lib/components/viewer-core/masonryScrollBehavior.d.ts +37 -0
- package/lib/components/viewer-core/removalState.d.ts +11 -0
- package/lib/components/viewer-core/useAutoResolveSource.d.ts +21 -12
- package/lib/components/viewer-core/useController.d.ts +16 -1
- package/lib/components/viewer-core/useDataSource.d.ts +13 -2
- package/lib/components/viewer-core/useMasonryList.d.ts +2 -0
- package/lib/components/viewer-core/useViewer.d.ts +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1357 -974
- 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,
|
|
872
|
+
removedIds: e.removedIds,
|
|
873
|
+
trailingBoundaryBucket: R
|
|
874
|
+
}), q = $e({
|
|
875
|
+
autoBuckets: n,
|
|
876
|
+
clearActiveResolveController(e) {
|
|
877
|
+
y === e && (y = null);
|
|
878
|
+
},
|
|
879
|
+
clearFillState: Ce,
|
|
880
|
+
createBucket: T,
|
|
881
|
+
errorMessage: s,
|
|
882
|
+
fillCollectedCount: l,
|
|
883
|
+
fillCursor: u,
|
|
884
|
+
fillTargetCount: p,
|
|
885
|
+
finishLoadPhase: $,
|
|
886
|
+
getActiveOccurrenceKey: pe,
|
|
887
|
+
getBoundaryBucket: (e) => e === "leading" ? I.value : R.value,
|
|
888
|
+
getFillDelayMs: (e) => at(e, E.value, O.value),
|
|
889
|
+
getOperationIsCurrent: (e) => e === C,
|
|
890
|
+
getPageSize: () => A.value,
|
|
891
|
+
getResolve: () => e.resolve,
|
|
892
|
+
getSequence: () => w,
|
|
893
|
+
inFlightCursors: v,
|
|
894
|
+
isManualPageLoadingLocked: _,
|
|
895
|
+
nextOperationId: () => ++C,
|
|
896
|
+
operationPhase: c,
|
|
595
897
|
removedIds: e.removedIds,
|
|
596
|
-
|
|
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, $());
|
|
696
1005
|
}
|
|
697
|
-
function
|
|
698
|
-
|
|
1006
|
+
function fe() {
|
|
1007
|
+
C += 1, y?.abort(), y = null, d.clear(!0), v.clear();
|
|
1008
|
+
}
|
|
1009
|
+
function pe() {
|
|
1010
|
+
return Re(N.value, P.value);
|
|
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,37 +3290,107 @@ 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
|
|
3392
|
+
var ii = 250, ai = 1e3;
|
|
3393
|
+
function oi(e) {
|
|
3086
3394
|
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
|
|
3087
3395
|
x(() => {
|
|
3088
3396
|
y();
|
|
@@ -3098,7 +3406,7 @@ function Gr(e) {
|
|
|
3098
3406
|
function u(t) {
|
|
3099
3407
|
if (!b(t) || !e.isAtBoundary()) return;
|
|
3100
3408
|
let n = Date.now();
|
|
3101
|
-
n < s || (s = n +
|
|
3409
|
+
n < s || (s = n + ii, m());
|
|
3102
3410
|
}
|
|
3103
3411
|
function d() {
|
|
3104
3412
|
if (!g()) return;
|
|
@@ -3132,7 +3440,7 @@ function Gr(e) {
|
|
|
3132
3440
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
3133
3441
|
}
|
|
3134
3442
|
function _() {
|
|
3135
|
-
o.value = !1, v(
|
|
3443
|
+
o.value = !1, v(ai);
|
|
3136
3444
|
}
|
|
3137
3445
|
function v(e) {
|
|
3138
3446
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -3154,177 +3462,284 @@ function Gr(e) {
|
|
|
3154
3462
|
};
|
|
3155
3463
|
}
|
|
3156
3464
|
//#endregion
|
|
3465
|
+
//#region src/components/viewer-core/masonryBoundaryLock.ts
|
|
3466
|
+
function si() {
|
|
3467
|
+
let e = D(!1), t = null;
|
|
3468
|
+
x(() => {
|
|
3469
|
+
r();
|
|
3470
|
+
});
|
|
3471
|
+
function n(n) {
|
|
3472
|
+
r(), e.value = !0, t = setTimeout(() => {
|
|
3473
|
+
t = null, e.value = !1;
|
|
3474
|
+
}, Math.max(0, n));
|
|
3475
|
+
}
|
|
3476
|
+
function r() {
|
|
3477
|
+
t && (clearTimeout(t), t = null, e.value = !1);
|
|
3478
|
+
}
|
|
3479
|
+
return {
|
|
3480
|
+
clearBoundaryInteractionReleaseTimer: r,
|
|
3481
|
+
isBoundaryInteractionLocked: e,
|
|
3482
|
+
lockBoundaryInteraction: n
|
|
3483
|
+
};
|
|
3484
|
+
}
|
|
3485
|
+
//#endregion
|
|
3486
|
+
//#region src/components/viewer-core/masonryItemMutation.ts
|
|
3487
|
+
function ci(e) {
|
|
3488
|
+
let t = e.currentItems.map((e) => Q(e)), n = e.previousItems.map((e) => Q(e)), r = ui(e.previousItems, e.layoutIndexById, e.layoutHeights), i = di(e.previousItems, e.layoutIndexById, e.layoutPositions), a = new Set(n), o = new Set(t), s = e.currentItems.filter((e) => !a.has(Q(e))), c = li(e.previousItems, o, r, i), l = t.length > n.length && n.length > 0 && t[0] !== n[0], u = e.scrollTop > e.contentInsetPx + e.gapPx, d = l && u ? e.currentItems[e.activeIndex] : null;
|
|
3489
|
+
return {
|
|
3490
|
+
addedItems: s,
|
|
3491
|
+
anchorId: d ? Q(d) : null,
|
|
3492
|
+
isPrepend: l,
|
|
3493
|
+
oldPositionsById: i,
|
|
3494
|
+
previousIds: n,
|
|
3495
|
+
removedItems: c,
|
|
3496
|
+
shouldLockBoundaryInteractionForRemoval: c.length > 0 && u,
|
|
3497
|
+
shouldResetScrollForEmptyRemoval: e.currentItems.length === 0 && e.previousItems.length > 0 && c.length > 0 && e.scrollTop > 0
|
|
3498
|
+
};
|
|
3499
|
+
}
|
|
3500
|
+
function li(e, t, n, r) {
|
|
3501
|
+
return e.flatMap((e) => {
|
|
3502
|
+
let i = Q(e);
|
|
3503
|
+
if (t.has(i)) return [];
|
|
3504
|
+
let a = r.get(i), o = n.get(i);
|
|
3505
|
+
return a && o != null ? [{
|
|
3506
|
+
height: o,
|
|
3507
|
+
item: e,
|
|
3508
|
+
position: a
|
|
3509
|
+
}] : [];
|
|
3510
|
+
});
|
|
3511
|
+
}
|
|
3512
|
+
function ui(e, t, n) {
|
|
3513
|
+
let r = /* @__PURE__ */ new Map();
|
|
3514
|
+
for (let i of e) {
|
|
3515
|
+
let e = Q(i), a = t.get(e), o = a == null ? void 0 : n[a];
|
|
3516
|
+
o != null && r.set(e, o);
|
|
3517
|
+
}
|
|
3518
|
+
return r;
|
|
3519
|
+
}
|
|
3520
|
+
function di(e, t, n) {
|
|
3521
|
+
let r = /* @__PURE__ */ new Map();
|
|
3522
|
+
for (let i of e) {
|
|
3523
|
+
let e = Q(i), a = t.get(e), o = a == null ? void 0 : n[a];
|
|
3524
|
+
o && r.set(e, o);
|
|
3525
|
+
}
|
|
3526
|
+
return r;
|
|
3527
|
+
}
|
|
3528
|
+
//#endregion
|
|
3529
|
+
//#region src/components/viewer-core/masonryPendingAppend.ts
|
|
3530
|
+
function fi(e) {
|
|
3531
|
+
let t = D(null), n = D(!1), r = null;
|
|
3532
|
+
function i() {
|
|
3533
|
+
o(), e.pendingAppendItems.value.length && (t.value = c([...e.items.value, ...e.pendingAppendItems.value]), s());
|
|
3534
|
+
}
|
|
3535
|
+
function a(i) {
|
|
3536
|
+
!i && !e.pendingAppendItems.value.length && !r && !n.value && (t.value = null);
|
|
3537
|
+
}
|
|
3538
|
+
function o() {
|
|
3539
|
+
r &&= (clearTimeout(r), null);
|
|
3540
|
+
}
|
|
3541
|
+
function s() {
|
|
3542
|
+
let i = e.commitPendingAppend.value;
|
|
3543
|
+
typeof i == "function" && (r = setTimeout(async () => {
|
|
3544
|
+
r = null, n.value = !0;
|
|
3545
|
+
try {
|
|
3546
|
+
e.pendingAppendItems.value.length && (await i(), await _(), await _());
|
|
3547
|
+
} finally {
|
|
3548
|
+
t.value = null, n.value = !1;
|
|
3549
|
+
}
|
|
3550
|
+
}, 300));
|
|
3551
|
+
}
|
|
3552
|
+
function c(t) {
|
|
3553
|
+
return t.length ? kr(t, {
|
|
3554
|
+
bucketPx: e.bucketPx,
|
|
3555
|
+
columnCount: e.columnCount.value,
|
|
3556
|
+
columnWidth: e.columnWidth.value,
|
|
3557
|
+
gapX: e.gapPx,
|
|
3558
|
+
gapY: e.gapPx
|
|
3559
|
+
}).contentHeight + e.contentInsetPx * 2 : 0;
|
|
3560
|
+
}
|
|
3561
|
+
return {
|
|
3562
|
+
clearAppendCommitTimer: o,
|
|
3563
|
+
clearReservedHeightWhenIdle: a,
|
|
3564
|
+
refreshReservedContentHeight: i,
|
|
3565
|
+
reservedContentHeight: t
|
|
3566
|
+
};
|
|
3567
|
+
}
|
|
3568
|
+
//#endregion
|
|
3157
3569
|
//#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 ||
|
|
3570
|
+
var pi = 600, mi = 24, hi = 16, gi = 300, _i = 200, vi = 0, yi = mi + hi, bi = 200, xi = 500, Si = 1e3;
|
|
3571
|
+
function Ci(e) {
|
|
3572
|
+
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || gi), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = si(), p = i(() => Math.max(gi, a.value - mi * 2)), m = i(() => Er(p.value, gi)), h = i(() => Dr(p.value, m.value, gi, hi)), g = i(() => ti(e.bottomLoadBufferPx.value)), v = i(() => wi(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Ar({
|
|
3161
3573
|
itemCount: e.items.value.length,
|
|
3162
3574
|
viewportHeight: r.value,
|
|
3163
3575
|
scrollTop: n.value,
|
|
3164
|
-
overscanPx:
|
|
3165
|
-
bucketPx:
|
|
3576
|
+
overscanPx: _i,
|
|
3577
|
+
bucketPx: pi,
|
|
3166
3578
|
buckets: c.value
|
|
3167
3579
|
})), b = i(() => y.value.map((t) => ({
|
|
3168
3580
|
item: e.items.value[t],
|
|
3169
3581
|
index: t
|
|
3170
3582
|
}))), 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(() =>
|
|
3583
|
+
let e = l.value + mi * 2, t = P.reservedContentHeight.value ?? 0;
|
|
3584
|
+
return Math.max(e, t, r.value) + bi + g.value;
|
|
3585
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => $r({
|
|
3174
3586
|
active: e.active.value,
|
|
3175
|
-
maxScrollTop:
|
|
3587
|
+
maxScrollTop: Y(),
|
|
3176
3588
|
progressDistancePx: n.value,
|
|
3177
|
-
thresholdPx:
|
|
3589
|
+
thresholdPx: vi,
|
|
3178
3590
|
triggerEnabled: w.value
|
|
3179
|
-
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() =>
|
|
3591
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => Qr({
|
|
3180
3592
|
active: e.active.value,
|
|
3181
|
-
maxScrollTop:
|
|
3593
|
+
maxScrollTop: Y(),
|
|
3182
3594
|
progressDistancePx: n.value,
|
|
3183
|
-
thresholdPx:
|
|
3595
|
+
thresholdPx: yi,
|
|
3184
3596
|
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({
|
|
3597
|
+
})), k = ei({
|
|
3598
|
+
containerHeight: C,
|
|
3599
|
+
scrollTop: n,
|
|
3600
|
+
viewportHeight: r
|
|
3601
|
+
}), A = Hr({
|
|
3194
3602
|
items: e.items,
|
|
3195
3603
|
visibleIndices: y,
|
|
3196
3604
|
positions: o,
|
|
3197
3605
|
heights: s,
|
|
3198
3606
|
indexById: u,
|
|
3199
|
-
columnWidth:
|
|
3607
|
+
columnWidth: h,
|
|
3200
3608
|
scrollTop: n,
|
|
3201
3609
|
viewportHeight: r
|
|
3202
|
-
}),
|
|
3610
|
+
}), j = oi({
|
|
3203
3611
|
direction: "top",
|
|
3204
3612
|
getAnimationLockMs(e) {
|
|
3205
|
-
return Math.max(
|
|
3613
|
+
return Math.max(xi, zr(e)) + Si;
|
|
3206
3614
|
},
|
|
3207
3615
|
hasPage: e.hasPreviousPage,
|
|
3208
|
-
interactionLocked:
|
|
3616
|
+
interactionLocked: f.isBoundaryInteractionLocked,
|
|
3209
3617
|
isAtBoundary() {
|
|
3210
|
-
return n.value <=
|
|
3618
|
+
return n.value <= yi;
|
|
3211
3619
|
},
|
|
3212
3620
|
loading: e.loading,
|
|
3213
3621
|
requestPage: e.requestPreviousPage
|
|
3214
|
-
}),
|
|
3622
|
+
}), M = oi({
|
|
3215
3623
|
direction: "bottom",
|
|
3216
3624
|
getAnimationLockMs(e) {
|
|
3217
|
-
return
|
|
3625
|
+
return zr(e) + Si;
|
|
3218
3626
|
},
|
|
3219
3627
|
hasPage: w,
|
|
3220
|
-
interactionLocked:
|
|
3628
|
+
interactionLocked: f.isBoundaryInteractionLocked,
|
|
3221
3629
|
isAtBoundary() {
|
|
3222
|
-
return
|
|
3630
|
+
return J() <= vi;
|
|
3223
3631
|
},
|
|
3224
3632
|
loading: e.loading,
|
|
3225
3633
|
requestPage: e.requestNextPage
|
|
3226
|
-
}),
|
|
3634
|
+
}), N = Zr({
|
|
3635
|
+
active: e.active,
|
|
3636
|
+
getMaxScrollTop: Y,
|
|
3637
|
+
getViewport: () => t.value,
|
|
3638
|
+
onScroll: z
|
|
3639
|
+
}), P = fi({
|
|
3640
|
+
bucketPx: pi,
|
|
3641
|
+
columnCount: m,
|
|
3642
|
+
columnWidth: h,
|
|
3643
|
+
commitPendingAppend: e.commitPendingAppend,
|
|
3644
|
+
contentInsetPx: mi,
|
|
3645
|
+
gapPx: hi,
|
|
3646
|
+
items: e.items,
|
|
3647
|
+
pendingAppendItems: e.pendingAppendItems
|
|
3648
|
+
}), F = null, I = 0;
|
|
3227
3649
|
L([
|
|
3228
3650
|
() => e.items.value,
|
|
3229
|
-
|
|
3230
|
-
|
|
3651
|
+
m,
|
|
3652
|
+
h
|
|
3231
3653
|
], async ([t], [r = []]) => {
|
|
3232
|
-
let i =
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3654
|
+
let i = ci({
|
|
3655
|
+
activeIndex: v.value,
|
|
3656
|
+
contentInsetPx: mi,
|
|
3657
|
+
currentItems: t,
|
|
3658
|
+
gapPx: hi,
|
|
3659
|
+
layoutHeights: s.value,
|
|
3660
|
+
layoutIndexById: u.value,
|
|
3661
|
+
layoutPositions: o.value,
|
|
3662
|
+
previousItems: r ?? [],
|
|
3663
|
+
scrollTop: n.value
|
|
3664
|
+
});
|
|
3665
|
+
i.shouldLockBoundaryInteractionForRemoval && f.lockBoundaryInteraction(Br() + Si), i.shouldResetScrollForEmptyRemoval && H(), R(), i.removedItems.length > 0 && A.markLeave(i.removedItems), i.addedItems.length > 0 && (A.markEnter(i.addedItems, i.isPrepend ? "top" : "bottom"), i.isPrepend ? j.onItemsMutated(i.addedItems.length) : M.onItemsMutated(i.addedItems.length)), A.playFlipMoveAnimation(i.oldPositionsById, new Set(i.addedItems.map((e) => Q(e))), i.isPrepend ? xi : void 0), i.anchorId ? (await _(), V(i.anchorId, i.oldPositionsById)) : e.active.value && i.previousIds.length > 0 && W();
|
|
3243
3666
|
}, { immediate: !0 }), L([
|
|
3244
|
-
() => e.pendingAppendItems.value.map((e) =>
|
|
3667
|
+
() => e.pendingAppendItems.value.map((e) => Q(e)),
|
|
3668
|
+
m,
|
|
3245
3669
|
h,
|
|
3246
|
-
g,
|
|
3247
3670
|
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) => {
|
|
3671
|
+
], () => P.refreshReservedContentHeight(), { immediate: !0 }), L(() => e.active.value, async (e, i) => {
|
|
3251
3672
|
let a = t.value;
|
|
3252
|
-
if (!a) return;
|
|
3253
3673
|
if (!e) {
|
|
3254
|
-
|
|
3674
|
+
a && (d.value = a.scrollTop), N.stop();
|
|
3255
3675
|
return;
|
|
3256
3676
|
}
|
|
3257
|
-
if (i !== !1 ||
|
|
3677
|
+
if (N.start(), !a || i !== !1 || d.value == null) return;
|
|
3258
3678
|
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
|
-
|
|
3679
|
+
let o = Math.max(0, C.value - r.value), s = wi(d.value, 0, o);
|
|
3680
|
+
a.scrollTop = s, n.value = s, j.syncBoundary(), M.syncBoundary();
|
|
3681
|
+
}), L(() => e.loading.value, async (e) => {
|
|
3682
|
+
P.clearReservedHeightWhenIdle(e), j.onLoadingChange(e), M.onLoadingChange(e), await _();
|
|
3263
3683
|
}), S(async () => {
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
}), t.value &&
|
|
3684
|
+
G(), await _(), v.value > 0 ? B(v.value, "center") : U(), j.syncBoundary(), M.syncBoundary(), typeof ResizeObserver < "u" ? (F = new ResizeObserver(() => {
|
|
3685
|
+
G();
|
|
3686
|
+
}), t.value && F.observe(t.value)) : window.addEventListener("resize", G);
|
|
3267
3687
|
}), x(() => {
|
|
3268
|
-
|
|
3688
|
+
F?.disconnect(), F = null, window.removeEventListener("resize", G), P.clearAppendCommitTimer(), f.clearBoundaryInteractionReleaseTimer(), I &&= (cancelAnimationFrame(I), 0), N.stop();
|
|
3269
3689
|
});
|
|
3270
|
-
function
|
|
3271
|
-
let t =
|
|
3272
|
-
columnCount:
|
|
3273
|
-
columnWidth:
|
|
3274
|
-
gapX:
|
|
3275
|
-
gapY:
|
|
3276
|
-
bucketPx:
|
|
3690
|
+
function R() {
|
|
3691
|
+
let t = kr(e.items.value, {
|
|
3692
|
+
columnCount: m.value,
|
|
3693
|
+
columnWidth: h.value,
|
|
3694
|
+
gapX: hi,
|
|
3695
|
+
gapY: hi,
|
|
3696
|
+
bucketPx: pi
|
|
3277
3697
|
});
|
|
3278
3698
|
o.value = t.positions.map((e) => ({
|
|
3279
|
-
x: e.x +
|
|
3280
|
-
y: e.y +
|
|
3699
|
+
x: e.x + mi,
|
|
3700
|
+
y: e.y + mi
|
|
3281
3701
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
3282
3702
|
}
|
|
3283
|
-
function
|
|
3284
|
-
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value =
|
|
3285
|
-
|
|
3703
|
+
function z() {
|
|
3704
|
+
e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = K(), j.syncBoundary(), M.syncBoundary(), ne(), !W() && (I ||= requestAnimationFrame(() => {
|
|
3705
|
+
I = 0, U();
|
|
3286
3706
|
})));
|
|
3287
3707
|
}
|
|
3288
|
-
function
|
|
3289
|
-
e.active.value && (
|
|
3708
|
+
function ee(t) {
|
|
3709
|
+
e.active.value && (j.onWheel(t), M.onWheel(t), ne());
|
|
3290
3710
|
}
|
|
3291
|
-
function
|
|
3292
|
-
let n = e.items.value[t], r = n ?
|
|
3711
|
+
function te(t) {
|
|
3712
|
+
let n = e.items.value[t], r = n ? Q(n) : "";
|
|
3293
3713
|
return {
|
|
3294
|
-
height: `${s.value[t] ??
|
|
3295
|
-
width: `${
|
|
3296
|
-
transition: r ?
|
|
3297
|
-
transitionDelay: r ?
|
|
3298
|
-
transform:
|
|
3714
|
+
height: `${s.value[t] ?? h.value}px`,
|
|
3715
|
+
width: `${h.value}px`,
|
|
3716
|
+
transition: r ? A.getCardTransition(r) : void 0,
|
|
3717
|
+
transitionDelay: r ? A.getCardTransitionDelay(r) : void 0,
|
|
3718
|
+
transform: A.getCardTransform(t)
|
|
3299
3719
|
};
|
|
3300
3720
|
}
|
|
3301
|
-
function
|
|
3721
|
+
function B(e, i) {
|
|
3302
3722
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
3303
3723
|
if (!a || !c || !l) return;
|
|
3304
3724
|
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 -
|
|
3725
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - mi : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + mi), a.scrollTop = wi(u, 0, d), n.value = a.scrollTop, U();
|
|
3306
3726
|
}
|
|
3307
|
-
function
|
|
3727
|
+
function V(e, r) {
|
|
3308
3728
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
3309
3729
|
if (!i || !a || !c) return;
|
|
3310
3730
|
let l = c.y - a.y;
|
|
3311
3731
|
i.scrollTop += l, n.value = i.scrollTop;
|
|
3312
3732
|
}
|
|
3313
|
-
function
|
|
3733
|
+
function H() {
|
|
3314
3734
|
let e = t.value;
|
|
3315
3735
|
if (!e) {
|
|
3316
3736
|
n.value = 0;
|
|
3317
3737
|
return;
|
|
3318
3738
|
}
|
|
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));
|
|
3739
|
+
e.scrollTop = 0, n.value = 0, j.syncBoundary(), M.syncBoundary();
|
|
3325
3740
|
}
|
|
3326
|
-
function
|
|
3327
|
-
if (!y.value.length ||
|
|
3741
|
+
function U() {
|
|
3742
|
+
if (!y.value.length || W()) return;
|
|
3328
3743
|
let t = n.value + r.value / 2, i = v.value, a = Infinity;
|
|
3329
3744
|
for (let e of y.value) {
|
|
3330
3745
|
let n = o.value[e], r = s.value[e];
|
|
@@ -3334,109 +3749,60 @@ function ai(e) {
|
|
|
3334
3749
|
}
|
|
3335
3750
|
e.setActiveIndex(i);
|
|
3336
3751
|
}
|
|
3337
|
-
function
|
|
3338
|
-
let t = n.value <=
|
|
3752
|
+
function W() {
|
|
3753
|
+
let t = n.value <= yi, r = J() <= vi;
|
|
3339
3754
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
3340
3755
|
}
|
|
3341
|
-
function
|
|
3342
|
-
|
|
3756
|
+
function ne() {
|
|
3757
|
+
j.maybeRequestPage(), M.maybeRequestPage();
|
|
3343
3758
|
}
|
|
3344
|
-
function
|
|
3345
|
-
r.value =
|
|
3759
|
+
function G() {
|
|
3760
|
+
r.value = K(), a.value = q();
|
|
3346
3761
|
}
|
|
3347
|
-
function
|
|
3348
|
-
return
|
|
3762
|
+
function K() {
|
|
3763
|
+
return Gr(t.value, r.value);
|
|
3349
3764
|
}
|
|
3350
|
-
function
|
|
3351
|
-
return
|
|
3765
|
+
function q() {
|
|
3766
|
+
return Kr(t.value, a.value, gi);
|
|
3352
3767
|
}
|
|
3353
|
-
function
|
|
3354
|
-
return
|
|
3768
|
+
function J() {
|
|
3769
|
+
return qr(t.value, n.value, r.value, C.value);
|
|
3355
3770
|
}
|
|
3356
|
-
function
|
|
3771
|
+
function Y() {
|
|
3357
3772
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
3358
3773
|
return Math.max(0, e - r.value);
|
|
3359
3774
|
}
|
|
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
3775
|
return {
|
|
3401
|
-
|
|
3776
|
+
autoScroll: N.autoScroll,
|
|
3777
|
+
columnWidth: h,
|
|
3402
3778
|
containerHeight: C,
|
|
3403
|
-
getCardStyle:
|
|
3404
|
-
getLeavingCardStyle:
|
|
3405
|
-
getScrollbarThumbStyle:
|
|
3406
|
-
leavingItems:
|
|
3779
|
+
getCardStyle: te,
|
|
3780
|
+
getLeavingCardStyle: A.getLeavingCardStyle,
|
|
3781
|
+
getScrollbarThumbStyle: k.getScrollbarThumbStyle,
|
|
3782
|
+
leavingItems: A.leavingItems,
|
|
3407
3783
|
nextBoundaryLoadProgress: T,
|
|
3408
|
-
onScroll:
|
|
3409
|
-
onWheel:
|
|
3784
|
+
onScroll: z,
|
|
3785
|
+
onWheel: ee,
|
|
3410
3786
|
paginationLabel: E,
|
|
3411
3787
|
previousBoundaryLoadProgress: O,
|
|
3412
3788
|
renderedItems: b,
|
|
3413
3789
|
resolvedActiveIndex: v,
|
|
3414
|
-
scrollToIndex:
|
|
3415
|
-
showScrollbar:
|
|
3790
|
+
scrollToIndex: B,
|
|
3791
|
+
showScrollbar: k.showScrollbar,
|
|
3416
3792
|
scrollViewportRef: t
|
|
3417
3793
|
};
|
|
3418
3794
|
}
|
|
3419
|
-
function
|
|
3795
|
+
function wi(e, t, n) {
|
|
3420
3796
|
return Math.min(Math.max(e, t), n);
|
|
3421
3797
|
}
|
|
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
3798
|
//#endregion
|
|
3433
3799
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
3434
|
-
function
|
|
3800
|
+
function Ti(e) {
|
|
3435
3801
|
if (e) try {
|
|
3436
3802
|
e.removeAttribute("src"), e.src = "";
|
|
3437
3803
|
} catch {}
|
|
3438
3804
|
}
|
|
3439
|
-
function
|
|
3805
|
+
function Ei(e) {
|
|
3440
3806
|
if (e) {
|
|
3441
3807
|
try {
|
|
3442
3808
|
e.currentTime = 0;
|
|
@@ -3447,12 +3813,12 @@ function ui(e) {
|
|
|
3447
3813
|
} catch {}
|
|
3448
3814
|
}
|
|
3449
3815
|
}
|
|
3450
|
-
function
|
|
3816
|
+
function Di(e, t) {
|
|
3451
3817
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
3452
3818
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
3453
3819
|
return e.bottom > 0 && e.top < n;
|
|
3454
3820
|
}
|
|
3455
|
-
function
|
|
3821
|
+
function Oi(e) {
|
|
3456
3822
|
if (!e) return null;
|
|
3457
3823
|
try {
|
|
3458
3824
|
return new URL(e, window.location.href).href;
|
|
@@ -3462,9 +3828,9 @@ function fi(e) {
|
|
|
3462
3828
|
}
|
|
3463
3829
|
//#endregion
|
|
3464
3830
|
//#region src/components/viewer-core/listPreview.ts
|
|
3465
|
-
var
|
|
3466
|
-
function
|
|
3467
|
-
let t =
|
|
3831
|
+
var ki = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, Ai = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, ji = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3832
|
+
function Mi(e) {
|
|
3833
|
+
let t = Ni(e), n = t?.url, r = Tr(e), i = e.title?.trim() || Ht(e.type);
|
|
3468
3834
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
3469
3835
|
kind: "video",
|
|
3470
3836
|
url: n,
|
|
@@ -3483,13 +3849,13 @@ function gi(e) {
|
|
|
3483
3849
|
width: r.width,
|
|
3484
3850
|
height: r.height,
|
|
3485
3851
|
label: i
|
|
3486
|
-
} : typeof n == "string" &&
|
|
3852
|
+
} : typeof n == "string" && Fi(e, n) ? {
|
|
3487
3853
|
kind: "video",
|
|
3488
3854
|
url: n,
|
|
3489
3855
|
width: r.width,
|
|
3490
3856
|
height: r.height,
|
|
3491
3857
|
label: i
|
|
3492
|
-
} : typeof n == "string" &&
|
|
3858
|
+
} : typeof n == "string" && Pi(e, n) ? {
|
|
3493
3859
|
kind: "image",
|
|
3494
3860
|
url: n,
|
|
3495
3861
|
width: r.width,
|
|
@@ -3503,26 +3869,26 @@ function gi(e) {
|
|
|
3503
3869
|
label: i
|
|
3504
3870
|
};
|
|
3505
3871
|
}
|
|
3506
|
-
function
|
|
3872
|
+
function Ni(e) {
|
|
3507
3873
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3508
3874
|
}
|
|
3509
|
-
function
|
|
3510
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
3875
|
+
function Pi(e, t) {
|
|
3876
|
+
return e.type !== "image" || typeof t != "string" ? !1 : ki.test(t) || Ii(t);
|
|
3511
3877
|
}
|
|
3512
|
-
function
|
|
3513
|
-
return e.type !== "video" || typeof t != "string" ? !1 :
|
|
3878
|
+
function Fi(e, t) {
|
|
3879
|
+
return e.type !== "video" || typeof t != "string" ? !1 : Ai.test(t) || Li(t);
|
|
3514
3880
|
}
|
|
3515
|
-
function
|
|
3881
|
+
function Ii(e) {
|
|
3516
3882
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3517
3883
|
}
|
|
3518
|
-
function
|
|
3519
|
-
return
|
|
3884
|
+
function Li(e) {
|
|
3885
|
+
return ji.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3520
3886
|
}
|
|
3521
3887
|
//#endregion
|
|
3522
3888
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3523
|
-
function
|
|
3889
|
+
function Ri(e) {
|
|
3524
3890
|
let t = D(null), n = i(() => {
|
|
3525
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3891
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? Oi(e.item.value.healthCheck.url) : null;
|
|
3526
3892
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3527
3893
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3528
3894
|
L(n, (e, n) => {
|
|
@@ -3554,7 +3920,7 @@ function Si(e) {
|
|
|
3554
3920
|
r.refresh();
|
|
3555
3921
|
return;
|
|
3556
3922
|
}
|
|
3557
|
-
r =
|
|
3923
|
+
r = Wt.request({
|
|
3558
3924
|
assetType: "probe",
|
|
3559
3925
|
getPriority: e.getPriority,
|
|
3560
3926
|
onGrant() {
|
|
@@ -3564,7 +3930,7 @@ function Si(e) {
|
|
|
3564
3930
|
return;
|
|
3565
3931
|
}
|
|
3566
3932
|
let i = ++a;
|
|
3567
|
-
|
|
3933
|
+
vn(r).then((s) => {
|
|
3568
3934
|
if (!(i !== a || n.value !== r)) {
|
|
3569
3935
|
if (o.set(r, s ?? null), !s) {
|
|
3570
3936
|
t.value = null;
|
|
@@ -3572,7 +3938,7 @@ function Si(e) {
|
|
|
3572
3938
|
}
|
|
3573
3939
|
t.value = s, e.reportAssetError?.({
|
|
3574
3940
|
item: e.item.value,
|
|
3575
|
-
occurrenceKey:
|
|
3941
|
+
occurrenceKey: Q(e.item.value),
|
|
3576
3942
|
url: r,
|
|
3577
3943
|
kind: s,
|
|
3578
3944
|
surface: "grid"
|
|
@@ -3600,14 +3966,14 @@ function Si(e) {
|
|
|
3600
3966
|
}
|
|
3601
3967
|
//#endregion
|
|
3602
3968
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3603
|
-
var
|
|
3969
|
+
var zi = ["aria-label"], Bi = {
|
|
3604
3970
|
key: 0,
|
|
3605
3971
|
"data-testid": "vibe-list-card-spinner",
|
|
3606
3972
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3607
|
-
},
|
|
3973
|
+
}, Vi = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Hi = ["src", "alt"], Ui = ["src"], Wi = ["data-kind"], Gi = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ki = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, qi = {
|
|
3608
3974
|
key: 4,
|
|
3609
3975
|
class: "grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
|
|
3610
|
-
},
|
|
3976
|
+
}, Ji = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Yi = { class: "pointer-events-none absolute inset-0 z-[3]" }, Xi = /* @__PURE__ */ d({
|
|
3611
3977
|
__name: "ListCard",
|
|
3612
3978
|
props: {
|
|
3613
3979
|
active: {
|
|
@@ -3631,7 +3997,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3631
3997
|
},
|
|
3632
3998
|
emits: ["open"],
|
|
3633
3999
|
setup(e, { emit: t }) {
|
|
3634
|
-
let n = e, r = t, l = i(() =>
|
|
4000
|
+
let n = e, r = t, l = i(() => Mi(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = Ri({
|
|
3635
4001
|
attachedAssetUrl: E,
|
|
3636
4002
|
getPriority: ue,
|
|
3637
4003
|
isInView: d,
|
|
@@ -3640,7 +4006,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3640
4006
|
loadErrorKind: g,
|
|
3641
4007
|
reportAssetError: n.reportAssetError,
|
|
3642
4008
|
surfaceActive: i(() => n.surfaceActive)
|
|
3643
|
-
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() =>
|
|
4009
|
+
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => gn(I.value)), ee = i(() => O.value && !g.value && (!T.value || !m.value)), B = null, V = null, H = /* @__PURE__ */ new Set();
|
|
3644
4010
|
L([E, () => l.value.kind], () => {
|
|
3645
4011
|
let e = l.value.kind === "fallback";
|
|
3646
4012
|
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
@@ -3654,66 +4020,66 @@ var Ci = ["aria-label"], wi = {
|
|
|
3654
4020
|
q();
|
|
3655
4021
|
}), L(() => n.surfaceActive, (e) => {
|
|
3656
4022
|
if (!e) {
|
|
3657
|
-
|
|
4023
|
+
Y(), q();
|
|
3658
4024
|
return;
|
|
3659
4025
|
}
|
|
3660
4026
|
requestAnimationFrame(() => {
|
|
3661
|
-
|
|
4027
|
+
re(), K(), q();
|
|
3662
4028
|
});
|
|
3663
4029
|
}), S(() => {
|
|
3664
4030
|
if (!y.value || typeof IntersectionObserver > "u") {
|
|
3665
4031
|
b.value = null, d.value = !0, K();
|
|
3666
4032
|
return;
|
|
3667
4033
|
}
|
|
3668
|
-
b.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"),
|
|
3669
|
-
for (let t of e) t.target === y.value && (n.surfaceActive &&
|
|
4034
|
+
b.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"), B = new IntersectionObserver((e) => {
|
|
4035
|
+
for (let t of e) t.target === y.value && (n.surfaceActive && re(t), K(), q());
|
|
3670
4036
|
}, {
|
|
3671
4037
|
root: b.value,
|
|
3672
4038
|
threshold: [0, 1]
|
|
3673
|
-
}),
|
|
4039
|
+
}), B.observe(y.value);
|
|
3674
4040
|
}), x(() => {
|
|
3675
|
-
|
|
4041
|
+
J(), F.release(), B?.disconnect(), B = null;
|
|
3676
4042
|
});
|
|
3677
4043
|
function U() {
|
|
3678
|
-
X(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url),
|
|
4044
|
+
X(_.value) && (m.value = !0, g.value = null, ie(E.value ?? n.item.url), Y());
|
|
3679
4045
|
}
|
|
3680
4046
|
async function W() {
|
|
3681
4047
|
if (!X(_.value)) return;
|
|
3682
4048
|
let e = E.value ?? n.item.url;
|
|
3683
4049
|
m.value = !1, g.value = "generic";
|
|
3684
|
-
let t = await
|
|
4050
|
+
let t = await _n(e);
|
|
3685
4051
|
g.value = t, n.reportAssetError?.({
|
|
3686
4052
|
item: n.item,
|
|
3687
|
-
occurrenceKey:
|
|
4053
|
+
occurrenceKey: Q(n.item),
|
|
3688
4054
|
url: e,
|
|
3689
4055
|
kind: t,
|
|
3690
4056
|
surface: "grid"
|
|
3691
|
-
}),
|
|
4057
|
+
}), Y();
|
|
3692
4058
|
}
|
|
3693
4059
|
function ne() {
|
|
3694
|
-
X(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url),
|
|
4060
|
+
X(C.value) && (h.value = !0, m.value = !0, g.value = null, ie(E.value ?? n.item.url), Y(), q());
|
|
3695
4061
|
}
|
|
3696
4062
|
function G() {
|
|
3697
4063
|
X(C.value) && (h.value || (m.value = !1));
|
|
3698
4064
|
}
|
|
3699
4065
|
function K() {
|
|
3700
4066
|
if (l.value.kind === "fallback") {
|
|
3701
|
-
|
|
4067
|
+
J(!1);
|
|
3702
4068
|
return;
|
|
3703
4069
|
}
|
|
3704
4070
|
if (!n.surfaceActive) {
|
|
3705
|
-
|
|
4071
|
+
Y();
|
|
3706
4072
|
return;
|
|
3707
4073
|
}
|
|
3708
4074
|
if (!O.value) {
|
|
3709
|
-
|
|
4075
|
+
J();
|
|
3710
4076
|
return;
|
|
3711
4077
|
}
|
|
3712
4078
|
if (T.value || V) {
|
|
3713
4079
|
V?.refresh();
|
|
3714
4080
|
return;
|
|
3715
4081
|
}
|
|
3716
|
-
V =
|
|
4082
|
+
V = Wt.request({
|
|
3717
4083
|
assetType: l.value.kind,
|
|
3718
4084
|
getPriority: ue,
|
|
3719
4085
|
onGrant() {
|
|
@@ -3730,7 +4096,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3730
4096
|
return;
|
|
3731
4097
|
}
|
|
3732
4098
|
if (E.value && d.value && m.value) {
|
|
3733
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
4099
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, xn(e);
|
|
3734
4100
|
return;
|
|
3735
4101
|
}
|
|
3736
4102
|
try {
|
|
@@ -3739,23 +4105,23 @@ var Ci = ["aria-label"], wi = {
|
|
|
3739
4105
|
e.pause();
|
|
3740
4106
|
}
|
|
3741
4107
|
}
|
|
3742
|
-
function
|
|
3743
|
-
T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (se(), ce()),
|
|
4108
|
+
function J(e = !0) {
|
|
4109
|
+
T.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (se(), ce()), Y();
|
|
3744
4110
|
}
|
|
3745
|
-
function
|
|
4111
|
+
function Y() {
|
|
3746
4112
|
V?.release(), V = null;
|
|
3747
4113
|
}
|
|
3748
|
-
function
|
|
4114
|
+
function re(e) {
|
|
3749
4115
|
let t = y.value;
|
|
3750
4116
|
if (!t) {
|
|
3751
4117
|
d.value = !0;
|
|
3752
4118
|
return;
|
|
3753
4119
|
}
|
|
3754
|
-
d.value =
|
|
4120
|
+
d.value = Di(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3755
4121
|
}
|
|
3756
4122
|
function ie(e) {
|
|
3757
4123
|
if (!e) return;
|
|
3758
|
-
let t =
|
|
4124
|
+
let t = Q(n.item), r = `${t}|${e}`;
|
|
3759
4125
|
H.has(r) || (H.add(r), n.reportAssetLoad?.({
|
|
3760
4126
|
item: n.item,
|
|
3761
4127
|
occurrenceKey: t,
|
|
@@ -3765,16 +4131,16 @@ var Ci = ["aria-label"], wi = {
|
|
|
3765
4131
|
}
|
|
3766
4132
|
function ae() {
|
|
3767
4133
|
if (!z.value || F.retry()) return;
|
|
3768
|
-
let e =
|
|
4134
|
+
let e = Q(n.item);
|
|
3769
4135
|
H.forEach((t) => {
|
|
3770
4136
|
t.startsWith(`${e}|`) && H.delete(t);
|
|
3771
|
-
}), g.value = null, m.value = !1, T.value = !1,
|
|
4137
|
+
}), g.value = null, m.value = !1, T.value = !1, Y(), K();
|
|
3772
4138
|
}
|
|
3773
4139
|
function se() {
|
|
3774
|
-
|
|
4140
|
+
Ti(_.value);
|
|
3775
4141
|
}
|
|
3776
4142
|
function ce() {
|
|
3777
|
-
|
|
4143
|
+
Ei(C.value);
|
|
3778
4144
|
}
|
|
3779
4145
|
function ue() {
|
|
3780
4146
|
let e = y.value;
|
|
@@ -3788,8 +4154,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
3788
4154
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3789
4155
|
}
|
|
3790
4156
|
function X(e) {
|
|
3791
|
-
let t =
|
|
3792
|
-
return !e || !t ? !1 :
|
|
4157
|
+
let t = Oi(E.value);
|
|
4158
|
+
return !e || !t ? !1 : Oi("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3793
4159
|
}
|
|
3794
4160
|
function de() {
|
|
3795
4161
|
r("open");
|
|
@@ -3817,8 +4183,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
3817
4183
|
class: "absolute inset-0 z-[1] block h-full w-full cursor-pointer text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
|
|
3818
4184
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3819
4185
|
onClick: de
|
|
3820
|
-
}, null, 8,
|
|
3821
|
-
|
|
4186
|
+
}, null, 8, zi),
|
|
4187
|
+
ee.value ? (w(), s("div", Bi, [c("span", Vi, [u(N(oe), {
|
|
3822
4188
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3823
4189
|
"aria-hidden": "true"
|
|
3824
4190
|
})])])) : o("", !0),
|
|
@@ -3832,7 +4198,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3832
4198
|
class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3833
4199
|
onLoad: U,
|
|
3834
4200
|
onError: W
|
|
3835
|
-
}, null, 42,
|
|
4201
|
+
}, null, 42, Hi)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3836
4202
|
key: 2,
|
|
3837
4203
|
ref_key: "videoRef",
|
|
3838
4204
|
ref: C,
|
|
@@ -3848,31 +4214,31 @@ var Ci = ["aria-label"], wi = {
|
|
|
3848
4214
|
onPlaying: ne,
|
|
3849
4215
|
onStalled: G,
|
|
3850
4216
|
onWaiting: G
|
|
3851
|
-
}, null, 42,
|
|
4217
|
+
}, null, 42, Ui)) : R.value ? (w(), s("div", {
|
|
3852
4218
|
key: 3,
|
|
3853
4219
|
"data-testid": "vibe-list-card-error",
|
|
3854
4220
|
"data-kind": I.value,
|
|
3855
4221
|
class: "pointer-events-none relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
|
|
3856
|
-
}, [c("div",
|
|
4222
|
+
}, [c("div", Gi, [
|
|
3857
4223
|
u(N(le), {
|
|
3858
4224
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3859
4225
|
"aria-hidden": "true"
|
|
3860
4226
|
}),
|
|
3861
|
-
c("span",
|
|
4227
|
+
c("span", Ki, j(N(hn)(I.value)), 1),
|
|
3862
4228
|
z.value ? (w(), s("button", {
|
|
3863
4229
|
key: 0,
|
|
3864
4230
|
type: "button",
|
|
3865
4231
|
class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-3 py-2 text-[0.62rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
|
|
3866
|
-
onClick:
|
|
4232
|
+
onClick: te(ae, ["stop"])
|
|
3867
4233
|
}, " Retry ")) : o("", !0)
|
|
3868
|
-
])], 8,
|
|
3869
|
-
icon: N(
|
|
4234
|
+
])], 8, Wi)) : (w(), s("div", qi, [c("div", Ji, [k(e.$slots, "item-icon", {
|
|
4235
|
+
icon: N(Vt)(n.item.type),
|
|
3870
4236
|
item: n.item
|
|
3871
|
-
}, () => [(w(), a(A(N(
|
|
4237
|
+
}, () => [(w(), a(A(N(Vt)(n.item.type)), {
|
|
3872
4238
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3873
4239
|
"aria-hidden": "true"
|
|
3874
4240
|
}))])])])),
|
|
3875
|
-
c("div",
|
|
4241
|
+
c("div", Yi, [k(e.$slots, "grid-item-overlay", {
|
|
3876
4242
|
active: n.active,
|
|
3877
4243
|
focused: f.value,
|
|
3878
4244
|
hovered: p.value,
|
|
@@ -3882,24 +4248,24 @@ var Ci = ["aria-label"], wi = {
|
|
|
3882
4248
|
})])
|
|
3883
4249
|
], 34));
|
|
3884
4250
|
}
|
|
3885
|
-
}),
|
|
4251
|
+
}), Zi = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, Qi = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, $i = {
|
|
3886
4252
|
"data-testid": "vibe-pagination",
|
|
3887
4253
|
class: "inline-flex shrink-0 items-center gap-2 whitespace-nowrap border border-white/14 bg-black/40 px-3 py-2 text-[0.63rem] font-bold uppercase tracking-[0.12em] text-[#f7f1ea]/72 backdrop-blur-[18px] min-[721px]:gap-3 min-[721px]:px-4 min-[721px]:py-3 min-[721px]:text-[0.74rem] min-[721px]:tracking-[0.2em]"
|
|
3888
|
-
},
|
|
4254
|
+
}, ea = { class: "whitespace-nowrap" }, ta = {
|
|
3889
4255
|
key: 0,
|
|
3890
4256
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3891
|
-
},
|
|
4257
|
+
}, na = [
|
|
3892
4258
|
"data-active",
|
|
3893
4259
|
"data-index",
|
|
3894
4260
|
"data-item-id",
|
|
3895
4261
|
"data-occurrence-key"
|
|
3896
|
-
],
|
|
4262
|
+
], ra = ["data-item-id"], ia = {
|
|
3897
4263
|
key: 0,
|
|
3898
4264
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3899
|
-
},
|
|
4265
|
+
}, aa = {
|
|
3900
4266
|
key: 1,
|
|
3901
4267
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3902
|
-
},
|
|
4268
|
+
}, oa = { class: "mx-auto flex w-full justify-center" }, sa = /* @__PURE__ */ d({
|
|
3903
4269
|
__name: "ListSurface",
|
|
3904
4270
|
props: {
|
|
3905
4271
|
active: {
|
|
@@ -3911,6 +4277,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
3911
4277
|
type: Boolean,
|
|
3912
4278
|
default: !1
|
|
3913
4279
|
},
|
|
4280
|
+
bottomLoadBufferPx: { default: 100 },
|
|
3914
4281
|
commitPendingAppend: {
|
|
3915
4282
|
type: [Function, null],
|
|
3916
4283
|
default: null
|
|
@@ -3959,87 +4326,90 @@ var Ci = ["aria-label"], wi = {
|
|
|
3959
4326
|
"open-fullscreen",
|
|
3960
4327
|
"update:activeIndex"
|
|
3961
4328
|
],
|
|
3962
|
-
setup(e, {
|
|
3963
|
-
let
|
|
3964
|
-
active: M(
|
|
3965
|
-
allowExhaustedNextPageRefresh: M(
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
4329
|
+
setup(e, { expose: n, emit: r }) {
|
|
4330
|
+
let d = e, f = F(), p = r, m = Ci({
|
|
4331
|
+
active: M(d, "active"),
|
|
4332
|
+
allowExhaustedNextPageRefresh: M(d, "allowExhaustedNextPageRefresh"),
|
|
4333
|
+
bottomLoadBufferPx: M(d, "bottomLoadBufferPx"),
|
|
4334
|
+
items: M(d, "items"),
|
|
4335
|
+
activeIndex: M(d, "activeIndex"),
|
|
4336
|
+
loading: M(d, "loading"),
|
|
4337
|
+
hasNextPage: M(d, "hasNextPage"),
|
|
4338
|
+
hasPreviousPage: M(d, "hasPreviousPage"),
|
|
4339
|
+
paginationDetail: M(d, "paginationDetail"),
|
|
4340
|
+
pendingAppendItems: M(d, "pendingAppendItems"),
|
|
4341
|
+
commitPendingAppend: M(d, "commitPendingAppend"),
|
|
4342
|
+
requestNextPage: M(d, "requestNextPage"),
|
|
4343
|
+
requestPreviousPage: M(d, "requestPreviousPage"),
|
|
3976
4344
|
setActiveIndex(e) {
|
|
3977
|
-
|
|
4345
|
+
p("update:activeIndex", e);
|
|
3978
4346
|
}
|
|
3979
|
-
})
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
4347
|
+
});
|
|
4348
|
+
n({ autoScroll: m.autoScroll });
|
|
4349
|
+
let h = i(() => on({
|
|
4350
|
+
itemCount: d.items.length,
|
|
4351
|
+
loading: d.loading,
|
|
4352
|
+
phase: d.phase
|
|
4353
|
+
})), _ = i(() => sn({
|
|
4354
|
+
errorMessage: d.errorMessage,
|
|
4355
|
+
hasItems: d.items.length > 0,
|
|
4356
|
+
hasNextPage: d.hasNextPage,
|
|
4357
|
+
phase: h.value,
|
|
3988
4358
|
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:
|
|
4359
|
+
})), x = i(() => !d.showStatusBadges || !_.value ? null : {
|
|
4360
|
+
activeIndex: m.resolvedActiveIndex.value,
|
|
4361
|
+
kind: _.value.kind,
|
|
4362
|
+
loading: d.loading,
|
|
4363
|
+
message: _.value.message,
|
|
4364
|
+
paginationDetail: d.paginationDetail,
|
|
4365
|
+
total: d.items.length
|
|
4366
|
+
}), S = i(() => !x.value || !f["grid-status"] ? [] : f["grid-status"](x.value)), C = i(() => en(S.value)), T = i(() => d.items.length + m.leavingItems.value.length), { emptyStateProps: E, showBadgeEmptyState: D, showCustomEmptyState: A, showInlineEmptyState: P } = rn({
|
|
4367
|
+
emptyStateMode: M(d, "emptyStateMode"),
|
|
4368
|
+
itemCount: T,
|
|
4369
|
+
loading: M(d, "loading"),
|
|
4370
|
+
renderSlot: f["empty-state"],
|
|
4001
4371
|
surface: "grid"
|
|
4002
4372
|
});
|
|
4003
|
-
return L([
|
|
4004
|
-
|
|
4373
|
+
return L([m.nextBoundaryLoadProgress, m.previousBoundaryLoadProgress], ([e, t]) => {
|
|
4374
|
+
p("boundary-load-progress", {
|
|
4005
4375
|
nextBoundaryLoadProgress: e,
|
|
4006
4376
|
previousBoundaryLoadProgress: t
|
|
4007
4377
|
});
|
|
4008
|
-
}, { immediate: !0 }), (e, n) => (w(), s("div",
|
|
4009
|
-
c("div",
|
|
4378
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", Zi, [
|
|
4379
|
+
c("div", Qi, [c("span", $i, [c("span", ea, j(N(m).paginationLabel.value), 1), d.paginationDetail ? (w(), s("span", ta, j(d.paginationDetail), 1)) : o("", !0)])]),
|
|
4010
4380
|
c("div", {
|
|
4011
|
-
ref: N(
|
|
4381
|
+
ref: N(m).scrollViewportRef,
|
|
4012
4382
|
"data-testid": "vibe-list-scroll",
|
|
4013
4383
|
class: "h-full min-h-0 overflow-y-auto overflow-x-hidden [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
4014
|
-
onScroll: n[0] ||= (...e) => N(
|
|
4015
|
-
onWheel: n[1] ||= (...e) => N(
|
|
4384
|
+
onScroll: n[0] ||= (...e) => N(m).onScroll && N(m).onScroll(...e),
|
|
4385
|
+
onWheel: n[1] ||= (...e) => N(m).onWheel && N(m).onWheel(...e)
|
|
4016
4386
|
}, [c("div", {
|
|
4017
4387
|
"data-testid": "vibe-list-content",
|
|
4018
4388
|
class: "relative",
|
|
4019
|
-
style: b({ height: `${N(
|
|
4389
|
+
style: b({ height: `${N(m).containerHeight.value}px` })
|
|
4020
4390
|
}, [
|
|
4021
|
-
(w(!0), s(t, null, O(N(
|
|
4022
|
-
key: N(
|
|
4391
|
+
(w(!0), s(t, null, O(N(m).renderedItems.value, ({ item: t, index: n }) => (w(), s("article", {
|
|
4392
|
+
key: N(Q)(t),
|
|
4023
4393
|
"data-testid": "vibe-list-card",
|
|
4024
|
-
"data-active": n === N(
|
|
4394
|
+
"data-active": n === N(m).resolvedActiveIndex.value ? "true" : "false",
|
|
4025
4395
|
"data-index": n,
|
|
4026
4396
|
"data-item-id": t.id,
|
|
4027
|
-
"data-occurrence-key": N(
|
|
4397
|
+
"data-occurrence-key": N(Q)(t),
|
|
4028
4398
|
class: "absolute will-change-transform",
|
|
4029
|
-
style: b(N(
|
|
4030
|
-
}, [u(
|
|
4031
|
-
active: n === N(
|
|
4399
|
+
style: b(N(m).getCardStyle(n))
|
|
4400
|
+
}, [u(Xi, {
|
|
4401
|
+
active: n === N(m).resolvedActiveIndex.value,
|
|
4032
4402
|
index: n,
|
|
4033
4403
|
item: t,
|
|
4034
|
-
"report-asset-error":
|
|
4035
|
-
"report-asset-load":
|
|
4036
|
-
"surface-active":
|
|
4037
|
-
onOpen: (e) =>
|
|
4038
|
-
}, l({ _: 2 }, [
|
|
4404
|
+
"report-asset-error": d.reportAssetError,
|
|
4405
|
+
"report-asset-load": d.reportAssetLoad,
|
|
4406
|
+
"surface-active": d.active,
|
|
4407
|
+
onOpen: (e) => p("open-fullscreen", n)
|
|
4408
|
+
}, l({ _: 2 }, [f["grid-item-overlay"] ? {
|
|
4039
4409
|
name: "grid-item-overlay",
|
|
4040
4410
|
fn: z((t) => [k(e.$slots, "grid-item-overlay", g({ ref_for: !0 }, t))]),
|
|
4041
4411
|
key: "0"
|
|
4042
|
-
} : void 0,
|
|
4412
|
+
} : void 0, f["item-icon"] ? {
|
|
4043
4413
|
name: "item-icon",
|
|
4044
4414
|
fn: z((t) => [k(e.$slots, "item-icon", g({ ref_for: !0 }, t))]),
|
|
4045
4415
|
key: "1"
|
|
@@ -4051,21 +4421,21 @@ var Ci = ["aria-label"], wi = {
|
|
|
4051
4421
|
"report-asset-load",
|
|
4052
4422
|
"surface-active",
|
|
4053
4423
|
"onOpen"
|
|
4054
|
-
])], 12,
|
|
4055
|
-
(w(!0), s(t, null, O(N(
|
|
4056
|
-
key: `leaving-${N(
|
|
4424
|
+
])], 12, na))), 128)),
|
|
4425
|
+
(w(!0), s(t, null, O(N(m).leavingItems.value, (t) => (w(), s("article", {
|
|
4426
|
+
key: `leaving-${N(Q)(t.item)}`,
|
|
4057
4427
|
"data-testid": "vibe-list-card-leaving",
|
|
4058
4428
|
"data-item-id": t.item.id,
|
|
4059
4429
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
4060
|
-
style: b(N(
|
|
4061
|
-
}, [u(
|
|
4430
|
+
style: b(N(m).getLeavingCardStyle(t.item))
|
|
4431
|
+
}, [u(Xi, {
|
|
4062
4432
|
active: !1,
|
|
4063
4433
|
index: -1,
|
|
4064
4434
|
item: t.item,
|
|
4065
|
-
"report-asset-error":
|
|
4066
|
-
"report-asset-load":
|
|
4435
|
+
"report-asset-error": d.reportAssetError,
|
|
4436
|
+
"report-asset-load": d.reportAssetLoad,
|
|
4067
4437
|
"surface-active": !1
|
|
4068
|
-
}, l({ _: 2 }, [
|
|
4438
|
+
}, l({ _: 2 }, [f["item-icon"] ? {
|
|
4069
4439
|
name: "item-icon",
|
|
4070
4440
|
fn: z((t) => [k(e.$slots, "item-icon", g({ ref_for: !0 }, t))]),
|
|
4071
4441
|
key: "0"
|
|
@@ -4073,14 +4443,14 @@ var Ci = ["aria-label"], wi = {
|
|
|
4073
4443
|
"item",
|
|
4074
4444
|
"report-asset-error",
|
|
4075
4445
|
"report-asset-load"
|
|
4076
|
-
])], 12,
|
|
4077
|
-
N(
|
|
4446
|
+
])], 12, ra))), 128)),
|
|
4447
|
+
N(P) && N(E) ? (w(), a(Bn, {
|
|
4078
4448
|
key: 0,
|
|
4079
|
-
message: N(
|
|
4080
|
-
mode: N(
|
|
4081
|
-
surface: N(
|
|
4449
|
+
message: N(E).message,
|
|
4450
|
+
mode: N(E).mode,
|
|
4451
|
+
surface: N(E).surface
|
|
4082
4452
|
}, {
|
|
4083
|
-
default: z(() => [N(
|
|
4453
|
+
default: z(() => [N(A) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(E)))) : o("", !0)]),
|
|
4084
4454
|
_: 3
|
|
4085
4455
|
}, 8, [
|
|
4086
4456
|
"message",
|
|
@@ -4088,28 +4458,28 @@ var Ci = ["aria-label"], wi = {
|
|
|
4088
4458
|
"surface"
|
|
4089
4459
|
])) : o("", !0)
|
|
4090
4460
|
], 4)], 544),
|
|
4091
|
-
N(
|
|
4461
|
+
N(m).showScrollbar.value ? (w(), s("div", ia, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
4092
4462
|
"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(
|
|
4463
|
+
class: v(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", d.loading ? "bg-white/52" : "bg-white/34"]),
|
|
4464
|
+
style: b(N(m).getScrollbarThumbStyle())
|
|
4095
4465
|
}, null, 6)])) : o("", !0),
|
|
4096
|
-
|
|
4097
|
-
|
|
4466
|
+
f["grid-footer"] ? (w(), s("div", aa, [c("div", oa, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
4467
|
+
x.value ? (w(), s("div", {
|
|
4098
4468
|
key: 2,
|
|
4099
|
-
class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6",
|
|
4100
|
-
}, [
|
|
4469
|
+
class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", f["grid-footer"] ? "pb-24" : "pb-6"])
|
|
4470
|
+
}, [C.value ? k(e.$slots, "grid-status", y(g({ key: 0 }, x.value))) : (w(), s("span", {
|
|
4101
4471
|
key: 1,
|
|
4102
4472
|
"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(
|
|
4473
|
+
class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", x.value.kind === "end" ? "border-amber-300/35 text-amber-200" : x.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
4474
|
+
}, j(x.value.message), 3))], 2)) : o("", !0),
|
|
4475
|
+
N(D) && N(E) ? (w(), a(Bn, {
|
|
4106
4476
|
key: 3,
|
|
4107
|
-
class: v(["z-[3]",
|
|
4108
|
-
message: N(
|
|
4109
|
-
mode: N(
|
|
4110
|
-
surface: N(
|
|
4477
|
+
class: v(["z-[3]", f["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
4478
|
+
message: N(E).message,
|
|
4479
|
+
mode: N(E).mode,
|
|
4480
|
+
surface: N(E).surface
|
|
4111
4481
|
}, {
|
|
4112
|
-
default: z(() => [N(
|
|
4482
|
+
default: z(() => [N(A) ? k(e.$slots, "empty-state", y(g({ key: 0 }, N(E)))) : o("", !0)]),
|
|
4113
4483
|
_: 3
|
|
4114
4484
|
}, 8, [
|
|
4115
4485
|
"class",
|
|
@@ -4119,16 +4489,17 @@ var Ci = ["aria-label"], wi = {
|
|
|
4119
4489
|
])) : o("", !0)
|
|
4120
4490
|
]));
|
|
4121
4491
|
}
|
|
4122
|
-
}),
|
|
4492
|
+
}), ca = ["data-surface-mode"], la = {
|
|
4123
4493
|
key: 1,
|
|
4124
4494
|
class: "absolute left-5 top-5 z-30 border border-amber-400/45 bg-black/35 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-amber-100 backdrop-blur"
|
|
4125
|
-
},
|
|
4495
|
+
}, ua = ["data-visible", "inert"], da = ["data-visible", "inert"], fa = {
|
|
4126
4496
|
key: 3,
|
|
4127
4497
|
class: "relative z-[1] grid h-full w-full content-center justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
|
|
4128
|
-
},
|
|
4498
|
+
}, pa = /* @__PURE__ */ d({
|
|
4129
4499
|
name: "VibeLayout",
|
|
4130
4500
|
__name: "Layout",
|
|
4131
4501
|
props: {
|
|
4502
|
+
bottomLoadBufferPx: {},
|
|
4132
4503
|
emptyStateMode: {},
|
|
4133
4504
|
fillDelayMs: {},
|
|
4134
4505
|
fillDelayStepMs: {},
|
|
@@ -4151,18 +4522,26 @@ var Ci = ["aria-label"], wi = {
|
|
|
4151
4522
|
"update:surfaceMode"
|
|
4152
4523
|
],
|
|
4153
4524
|
setup(e, { expose: n, emit: i }) {
|
|
4154
|
-
let d = e, f = F(), m = i, h =
|
|
4525
|
+
let d = e, f = F(), m = i, h = dt(d, m), g = D(null), _ = fe((e) => {
|
|
4155
4526
|
m("asset-errors", e);
|
|
4156
|
-
}),
|
|
4527
|
+
}), v = pe((e) => {
|
|
4157
4528
|
m("asset-loads", e);
|
|
4158
4529
|
});
|
|
4159
|
-
|
|
4160
|
-
|
|
4530
|
+
x(() => {
|
|
4531
|
+
_.stop(), v.stop();
|
|
4161
4532
|
}), L(() => h.items.value, (e) => {
|
|
4162
4533
|
m("items-change", [...e]);
|
|
4163
|
-
})
|
|
4534
|
+
});
|
|
4535
|
+
function b(e) {
|
|
4536
|
+
g.value?.autoScroll(e);
|
|
4537
|
+
}
|
|
4538
|
+
return n({
|
|
4539
|
+
autoScroll: b,
|
|
4164
4540
|
cancel: h.cancel,
|
|
4541
|
+
cancelFill: h.cancelFill,
|
|
4165
4542
|
clearRemoved: h.clearRemoved,
|
|
4543
|
+
fillUntil: h.fillUntil,
|
|
4544
|
+
fillUntilEnd: h.fillUntilEnd,
|
|
4166
4545
|
getItemByOccurrenceKey: h.getItemByOccurrenceKey,
|
|
4167
4546
|
getItems: h.getItems,
|
|
4168
4547
|
getRemovedIds: h.getRemovedIds,
|
|
@@ -4184,7 +4563,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
4184
4563
|
type: "button",
|
|
4185
4564
|
class: "absolute left-5 top-5 z-30 inline-flex items-center border border-rose-400/55 bg-rose-500/18 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-white backdrop-blur transition hover:bg-rose-500/28",
|
|
4186
4565
|
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",
|
|
4566
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", la, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
4188
4567
|
appear: "",
|
|
4189
4568
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
4190
4569
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -4193,14 +4572,17 @@ var Ci = ["aria-label"], wi = {
|
|
|
4193
4572
|
"leave-from-class": "translate-y-0 opacity-100",
|
|
4194
4573
|
"leave-to-class": "translate-y-3 opacity-0"
|
|
4195
4574
|
}, {
|
|
4196
|
-
default: z(() => [
|
|
4575
|
+
default: z(() => [ee(c("div", {
|
|
4197
4576
|
"data-testid": "vibe-list-surface",
|
|
4198
4577
|
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
4199
4578
|
inert: N(h).surfaceMode.value !== "list",
|
|
4200
4579
|
class: "absolute inset-0 z-[2]"
|
|
4201
|
-
}, [u(
|
|
4580
|
+
}, [u(sa, {
|
|
4581
|
+
ref_key: "listSurfaceRef",
|
|
4582
|
+
ref: g,
|
|
4202
4583
|
active: N(h).surfaceMode.value === "list",
|
|
4203
4584
|
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
4585
|
+
"bottom-load-buffer-px": d.bottomLoadBufferPx,
|
|
4204
4586
|
items: N(h).items.value,
|
|
4205
4587
|
"active-index": N(h).activeIndex.value,
|
|
4206
4588
|
"error-message": N(h).errorMessage.value,
|
|
@@ -4211,8 +4593,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
4211
4593
|
phase: N(h).phase.value,
|
|
4212
4594
|
"commit-pending-append": N(h).commitPendingAppend,
|
|
4213
4595
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4214
|
-
"report-asset-error": N(
|
|
4215
|
-
"report-asset-load": N(
|
|
4596
|
+
"report-asset-error": N(_).report,
|
|
4597
|
+
"report-asset-load": N(v).report,
|
|
4216
4598
|
"request-next-page": N(h).prefetchNextPage,
|
|
4217
4599
|
"request-previous-page": N(h).prefetchPreviousPage,
|
|
4218
4600
|
"empty-state-mode": d.emptyStateMode,
|
|
@@ -4249,6 +4631,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
4249
4631
|
]), 1032, [
|
|
4250
4632
|
"active",
|
|
4251
4633
|
"allow-exhausted-next-page-refresh",
|
|
4634
|
+
"bottom-load-buffer-px",
|
|
4252
4635
|
"items",
|
|
4253
4636
|
"active-index",
|
|
4254
4637
|
"error-message",
|
|
@@ -4268,7 +4651,7 @@ var Ci = ["aria-label"], wi = {
|
|
|
4268
4651
|
"onBoundaryLoadProgress",
|
|
4269
4652
|
"onOpenFullscreen",
|
|
4270
4653
|
"onUpdate:activeIndex"
|
|
4271
|
-
])], 8,
|
|
4654
|
+
])], 8, ua), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
4272
4655
|
_: 3
|
|
4273
4656
|
}), u(r, {
|
|
4274
4657
|
appear: "",
|
|
@@ -4279,12 +4662,12 @@ var Ci = ["aria-label"], wi = {
|
|
|
4279
4662
|
"leave-from-class": "translate-y-0 opacity-100",
|
|
4280
4663
|
"leave-to-class": "-translate-y-3 opacity-0"
|
|
4281
4664
|
}, {
|
|
4282
|
-
default: z(() => [
|
|
4665
|
+
default: z(() => [ee(c("div", {
|
|
4283
4666
|
"data-testid": "vibe-fullscreen-surface",
|
|
4284
4667
|
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4285
4668
|
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
4286
4669
|
class: "absolute inset-0 z-[3]"
|
|
4287
|
-
}, [u(
|
|
4670
|
+
}, [u(Sr, {
|
|
4288
4671
|
items: N(h).items.value,
|
|
4289
4672
|
active: N(h).surfaceMode.value === "fullscreen",
|
|
4290
4673
|
"active-index": N(h).activeIndex.value,
|
|
@@ -4293,8 +4676,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
4293
4676
|
"has-next-page": N(h).hasNextPage.value,
|
|
4294
4677
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4295
4678
|
phase: N(h).phase.value,
|
|
4296
|
-
"report-asset-error": N(
|
|
4297
|
-
"report-asset-load": N(
|
|
4679
|
+
"report-asset-error": N(_).report,
|
|
4680
|
+
"report-asset-load": N(v).report,
|
|
4298
4681
|
"empty-state-mode": d.emptyStateMode,
|
|
4299
4682
|
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
4300
4683
|
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
@@ -4353,12 +4736,12 @@ var Ci = ["aria-label"], wi = {
|
|
|
4353
4736
|
"show-back-to-list",
|
|
4354
4737
|
"onBackToList",
|
|
4355
4738
|
"onUpdate:activeIndex"
|
|
4356
|
-
])], 8,
|
|
4739
|
+
])], 8, da), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
4357
4740
|
_: 3
|
|
4358
|
-
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div",
|
|
4741
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", fa, [u(N(oe), {
|
|
4359
4742
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
4360
4743
|
"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(
|
|
4744
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(Sr, {
|
|
4362
4745
|
key: 4,
|
|
4363
4746
|
items: N(h).items.value,
|
|
4364
4747
|
active: !0,
|
|
@@ -4368,8 +4751,8 @@ var Ci = ["aria-label"], wi = {
|
|
|
4368
4751
|
"has-next-page": N(h).hasNextPage.value,
|
|
4369
4752
|
"pagination-detail": N(h).paginationDetail.value,
|
|
4370
4753
|
phase: N(h).phase.value,
|
|
4371
|
-
"report-asset-error": N(
|
|
4372
|
-
"report-asset-load": N(
|
|
4754
|
+
"report-asset-error": N(_).report,
|
|
4755
|
+
"report-asset-load": N(v).report,
|
|
4373
4756
|
"empty-state-mode": d.emptyStateMode,
|
|
4374
4757
|
"loop-fullscreen-video": d.loopFullscreenVideo ?? !0,
|
|
4375
4758
|
"show-dominant-image-tone": d.showDominantImageTone ?? !0,
|
|
@@ -4426,10 +4809,10 @@ var Ci = ["aria-label"], wi = {
|
|
|
4426
4809
|
"show-status-badges",
|
|
4427
4810
|
"onBackToList",
|
|
4428
4811
|
"onUpdate:activeIndex"
|
|
4429
|
-
]))], 8,
|
|
4812
|
+
]))], 8, ca));
|
|
4430
4813
|
}
|
|
4431
|
-
}),
|
|
4432
|
-
e.component("VibeLayout",
|
|
4814
|
+
}), ma = { install(e) {
|
|
4815
|
+
e.component("VibeLayout", pa);
|
|
4433
4816
|
} };
|
|
4434
4817
|
//#endregion
|
|
4435
|
-
export {
|
|
4818
|
+
export { pa as VibeLayout, ma as VibePlugin, ma as default };
|