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