@wyxos/vibe 3.1.12 → 3.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -1195,7 +1195,7 @@ function jt(e = At) {
|
|
|
1195
1195
|
function i(e) {
|
|
1196
1196
|
let i = {
|
|
1197
1197
|
...e,
|
|
1198
|
-
domain:
|
|
1198
|
+
domain: Pt(e.url),
|
|
1199
1199
|
enqueuedAt: r,
|
|
1200
1200
|
id: `vibe-asset-load-${r += 1}`
|
|
1201
1201
|
};
|
|
@@ -1230,7 +1230,6 @@ function jt(e = At) {
|
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
1232
1232
|
function o(n) {
|
|
1233
|
-
if (!Pt(n)) return !1;
|
|
1234
1233
|
let r = [...t.values()].filter((e) => e.domain === n.domain);
|
|
1235
1234
|
return !(r.length >= e.maxPerDomain || n.assetType === "video" && r.filter((e) => e.assetType === "video").length >= e.maxVideoPerDomain);
|
|
1236
1235
|
}
|
|
@@ -1246,13 +1245,6 @@ function Nt(e) {
|
|
|
1246
1245
|
}
|
|
1247
1246
|
}
|
|
1248
1247
|
function Pt(e) {
|
|
1249
|
-
try {
|
|
1250
|
-
return e.canGrant?.() ?? !0;
|
|
1251
|
-
} catch {
|
|
1252
|
-
return !1;
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
function Ft(e) {
|
|
1256
1248
|
try {
|
|
1257
1249
|
return new URL(e).hostname || "local";
|
|
1258
1250
|
} catch {
|
|
@@ -1261,81 +1253,76 @@ function Ft(e) {
|
|
|
1261
1253
|
}
|
|
1262
1254
|
//#endregion
|
|
1263
1255
|
//#region src/components/viewer-core/useFullscreenPreloadController.ts
|
|
1264
|
-
var
|
|
1265
|
-
-1,
|
|
1256
|
+
var Ft = [
|
|
1266
1257
|
1,
|
|
1267
|
-
2
|
|
1268
|
-
|
|
1269
|
-
|
|
1258
|
+
2,
|
|
1259
|
+
3
|
|
1260
|
+
], It = {
|
|
1270
1261
|
1: 0,
|
|
1271
|
-
2: 1
|
|
1262
|
+
2: 1,
|
|
1263
|
+
3: 2
|
|
1272
1264
|
};
|
|
1273
|
-
function
|
|
1265
|
+
function Lt(e) {
|
|
1274
1266
|
let t = D({}), n = jt({
|
|
1275
1267
|
maxGlobal: 2,
|
|
1276
1268
|
maxPerDomain: 2,
|
|
1277
1269
|
maxVideoPerDomain: 2
|
|
1278
|
-
}), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set()
|
|
1270
|
+
}), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
1279
1271
|
L([
|
|
1280
1272
|
e.active,
|
|
1281
1273
|
e.items,
|
|
1282
1274
|
e.resolvedActiveIndex
|
|
1283
1275
|
], () => {
|
|
1284
|
-
m();
|
|
1285
|
-
}, { immediate: !0 }), f() && C(() => {
|
|
1286
1276
|
p();
|
|
1277
|
+
}, { immediate: !0 }), f() && C(() => {
|
|
1278
|
+
d();
|
|
1287
1279
|
});
|
|
1288
|
-
function
|
|
1280
|
+
function s(n) {
|
|
1289
1281
|
if (!e.active.value) return !1;
|
|
1290
1282
|
let r = e.items.value[n];
|
|
1291
|
-
if (!r || !
|
|
1283
|
+
if (!r || !Vt(r)) return !1;
|
|
1292
1284
|
let i = e.getItemKey(r);
|
|
1293
|
-
return i ===
|
|
1285
|
+
return i === h() || !!t.value[i];
|
|
1294
1286
|
}
|
|
1295
|
-
function
|
|
1287
|
+
function c(e, t) {
|
|
1296
1288
|
if (t instanceof HTMLImageElement) {
|
|
1297
|
-
i.set(e, t),
|
|
1289
|
+
i.set(e, t), zt(t) && u(e);
|
|
1298
1290
|
return;
|
|
1299
1291
|
}
|
|
1300
1292
|
i.delete(e);
|
|
1301
1293
|
}
|
|
1302
|
-
function
|
|
1294
|
+
function l(e, t) {
|
|
1303
1295
|
if (t instanceof HTMLMediaElement) {
|
|
1304
|
-
a.set(e, t),
|
|
1296
|
+
a.set(e, t), Bt(t) && u(e);
|
|
1305
1297
|
return;
|
|
1306
1298
|
}
|
|
1307
1299
|
a.delete(e);
|
|
1308
1300
|
}
|
|
1309
|
-
function
|
|
1310
|
-
o.add(e);
|
|
1301
|
+
function u(e) {
|
|
1311
1302
|
let t = r.get(e);
|
|
1312
|
-
|
|
1313
|
-
x();
|
|
1314
|
-
return;
|
|
1315
|
-
}
|
|
1316
|
-
t.lease.release(), r.delete(e);
|
|
1303
|
+
t && (t.lease.release(), r.delete(e));
|
|
1317
1304
|
}
|
|
1318
|
-
function
|
|
1305
|
+
function d() {
|
|
1319
1306
|
for (let e of r.values()) e.lease.release();
|
|
1320
|
-
r.clear(), t.value = {},
|
|
1307
|
+
r.clear(), t.value = {}, v();
|
|
1321
1308
|
}
|
|
1322
|
-
function
|
|
1309
|
+
function p() {
|
|
1323
1310
|
if (!e.active.value) {
|
|
1324
|
-
|
|
1311
|
+
d();
|
|
1325
1312
|
return;
|
|
1326
1313
|
}
|
|
1327
|
-
let
|
|
1328
|
-
for (let e of
|
|
1329
|
-
for (let e of Object.keys(t.value)) c.has(e) ||
|
|
1314
|
+
let s = m(), c = new Set(s.map((e) => e.key)), l = h();
|
|
1315
|
+
for (let e of o) e !== l && c.has(e) && y(e, !0);
|
|
1316
|
+
for (let e of Object.keys(t.value)) c.has(e) || y(e, !1);
|
|
1330
1317
|
for (let [e, t] of r.entries()) {
|
|
1331
1318
|
if (!c.has(e)) {
|
|
1332
1319
|
t.lease.release(), r.delete(e);
|
|
1333
1320
|
continue;
|
|
1334
1321
|
}
|
|
1335
|
-
let n =
|
|
1322
|
+
let n = s.find((t) => t.key === e);
|
|
1336
1323
|
n && (t.index = n.index);
|
|
1337
1324
|
}
|
|
1338
|
-
for (let e of
|
|
1325
|
+
for (let e of s) {
|
|
1339
1326
|
if (r.has(e.key) || t.value[e.key]) continue;
|
|
1340
1327
|
let o;
|
|
1341
1328
|
o = {
|
|
@@ -1343,57 +1330,44 @@ function zt(e) {
|
|
|
1343
1330
|
key: e.key,
|
|
1344
1331
|
lease: n.request({
|
|
1345
1332
|
assetType: e.item.type === "image" ? "image" : "video",
|
|
1346
|
-
|
|
1347
|
-
getPriority: () => _(o.index),
|
|
1333
|
+
getPriority: () => g(o.index),
|
|
1348
1334
|
onGrant: () => {
|
|
1349
|
-
|
|
1335
|
+
y(e.key, !0), Rt(e.key, i, a) && u(e.key);
|
|
1350
1336
|
},
|
|
1351
1337
|
url: e.item.url
|
|
1352
1338
|
})
|
|
1353
1339
|
}, r.set(e.key, o);
|
|
1354
1340
|
}
|
|
1355
1341
|
for (let e of r.values()) e.lease.refresh();
|
|
1356
|
-
|
|
1342
|
+
v();
|
|
1357
1343
|
}
|
|
1358
|
-
function
|
|
1344
|
+
function m() {
|
|
1359
1345
|
let t = e.resolvedActiveIndex.value;
|
|
1360
|
-
return
|
|
1346
|
+
return Ft.map((e) => _(t + e)).filter((e) => !!e);
|
|
1361
1347
|
}
|
|
1362
|
-
function
|
|
1348
|
+
function h() {
|
|
1363
1349
|
let t = e.items.value[e.resolvedActiveIndex.value];
|
|
1364
|
-
return !e.active.value || !t || !
|
|
1365
|
-
}
|
|
1366
|
-
function _(t) {
|
|
1367
|
-
return e.active.value ? Rt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1350
|
+
return !e.active.value || !t || !Vt(t) ? null : e.getItemKey(t);
|
|
1368
1351
|
}
|
|
1369
|
-
function
|
|
1370
|
-
return t - e.resolvedActiveIndex.value
|
|
1371
|
-
let n = y(e.resolvedActiveIndex.value + t);
|
|
1372
|
-
return n ? o.has(n.key) : !0;
|
|
1373
|
-
}) : !0;
|
|
1352
|
+
function g(t) {
|
|
1353
|
+
return e.active.value ? It[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1374
1354
|
}
|
|
1375
|
-
function
|
|
1355
|
+
function _(t) {
|
|
1376
1356
|
let n = e.items.value[t];
|
|
1377
|
-
return !n || !
|
|
1357
|
+
return !n || !Vt(n) ? null : {
|
|
1378
1358
|
index: t,
|
|
1379
1359
|
item: n,
|
|
1380
1360
|
key: e.getItemKey(n)
|
|
1381
1361
|
};
|
|
1382
1362
|
}
|
|
1383
|
-
function
|
|
1384
|
-
|
|
1385
|
-
}
|
|
1386
|
-
function x() {
|
|
1387
|
-
for (let e of r.values()) e.lease.refresh();
|
|
1388
|
-
}
|
|
1389
|
-
function S() {
|
|
1390
|
-
let n = /* @__PURE__ */ new Set(), r = g();
|
|
1363
|
+
function v() {
|
|
1364
|
+
let n = /* @__PURE__ */ new Set(), r = h();
|
|
1391
1365
|
r && n.add(r);
|
|
1392
1366
|
for (let e of Object.keys(t.value)) n.add(e);
|
|
1393
|
-
for (let t of
|
|
1394
|
-
|
|
1367
|
+
for (let t of o) n.has(t) || (b(t), e.onResetAssetState(t));
|
|
1368
|
+
o = n;
|
|
1395
1369
|
}
|
|
1396
|
-
function
|
|
1370
|
+
function y(e, n) {
|
|
1397
1371
|
if (n) {
|
|
1398
1372
|
if (t.value[e]) return;
|
|
1399
1373
|
t.value = {
|
|
@@ -1406,7 +1380,7 @@ function zt(e) {
|
|
|
1406
1380
|
let r = { ...t.value };
|
|
1407
1381
|
delete r[e], t.value = r;
|
|
1408
1382
|
}
|
|
1409
|
-
function
|
|
1383
|
+
function b(e) {
|
|
1410
1384
|
let t = i.get(e);
|
|
1411
1385
|
if (t) try {
|
|
1412
1386
|
t.removeAttribute("src"), t.src = "";
|
|
@@ -1423,33 +1397,33 @@ function zt(e) {
|
|
|
1423
1397
|
}
|
|
1424
1398
|
}
|
|
1425
1399
|
return {
|
|
1426
|
-
clearBackgroundPreloads:
|
|
1427
|
-
registerImageElement:
|
|
1428
|
-
registerMediaElement:
|
|
1429
|
-
settleBackgroundPreload:
|
|
1430
|
-
shouldAttachSlideAsset:
|
|
1400
|
+
clearBackgroundPreloads: d,
|
|
1401
|
+
registerImageElement: c,
|
|
1402
|
+
registerMediaElement: l,
|
|
1403
|
+
settleBackgroundPreload: u,
|
|
1404
|
+
shouldAttachSlideAsset: s
|
|
1431
1405
|
};
|
|
1432
1406
|
}
|
|
1433
|
-
function
|
|
1407
|
+
function Rt(e, t, n) {
|
|
1434
1408
|
let r = t.get(e);
|
|
1435
|
-
if (r) return
|
|
1409
|
+
if (r) return zt(r);
|
|
1436
1410
|
let i = n.get(e);
|
|
1437
|
-
return i ?
|
|
1411
|
+
return i ? Bt(i) : !1;
|
|
1438
1412
|
}
|
|
1439
|
-
function
|
|
1413
|
+
function zt(e) {
|
|
1440
1414
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1441
1415
|
}
|
|
1442
|
-
function
|
|
1416
|
+
function Bt(e) {
|
|
1443
1417
|
let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
1444
1418
|
return e.readyState >= t;
|
|
1445
1419
|
}
|
|
1446
|
-
function
|
|
1420
|
+
function Vt(e) {
|
|
1447
1421
|
return e.type === "image" || e.type === "video" || e.type === "audio";
|
|
1448
1422
|
}
|
|
1449
1423
|
//#endregion
|
|
1450
1424
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
1451
|
-
function
|
|
1452
|
-
let t =
|
|
1425
|
+
function Ht(e) {
|
|
1426
|
+
let t = Lt({
|
|
1453
1427
|
active: e.active,
|
|
1454
1428
|
getItemKey: r,
|
|
1455
1429
|
items: e.items,
|
|
@@ -1506,11 +1480,11 @@ function Wt(e) {
|
|
|
1506
1480
|
}
|
|
1507
1481
|
//#endregion
|
|
1508
1482
|
//#region src/components/viewer-core/slotContent.ts
|
|
1509
|
-
function
|
|
1483
|
+
function Ut(e) {
|
|
1510
1484
|
if (!Array.isArray(e)) return !1;
|
|
1511
1485
|
for (let t of e) {
|
|
1512
1486
|
if (Array.isArray(t)) {
|
|
1513
|
-
if (
|
|
1487
|
+
if (Ut(t)) return !0;
|
|
1514
1488
|
continue;
|
|
1515
1489
|
}
|
|
1516
1490
|
if (!h(t)) {
|
|
@@ -1521,20 +1495,20 @@ function Gt(e) {
|
|
|
1521
1495
|
if (t != null && t !== !1) return !0;
|
|
1522
1496
|
continue;
|
|
1523
1497
|
}
|
|
1524
|
-
if (!
|
|
1498
|
+
if (!Wt(t)) return !0;
|
|
1525
1499
|
}
|
|
1526
1500
|
return !1;
|
|
1527
1501
|
}
|
|
1528
|
-
function
|
|
1529
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1502
|
+
function Wt(r) {
|
|
1503
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Ut(r.children) : !1;
|
|
1530
1504
|
}
|
|
1531
1505
|
//#endregion
|
|
1532
1506
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1533
|
-
var
|
|
1534
|
-
function
|
|
1507
|
+
var Gt = "no items available";
|
|
1508
|
+
function Kt(e) {
|
|
1535
1509
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1536
1510
|
loading: !!e.loading.value,
|
|
1537
|
-
message:
|
|
1511
|
+
message: Gt,
|
|
1538
1512
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1539
1513
|
surface: e.surface,
|
|
1540
1514
|
total: e.itemCount.value
|
|
@@ -1542,23 +1516,23 @@ function Jt(e) {
|
|
|
1542
1516
|
return {
|
|
1543
1517
|
emptyStateProps: t,
|
|
1544
1518
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1545
|
-
showCustomEmptyState: i(() =>
|
|
1519
|
+
showCustomEmptyState: i(() => Ut(n.value)),
|
|
1546
1520
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1547
1521
|
};
|
|
1548
1522
|
}
|
|
1549
1523
|
//#endregion
|
|
1550
1524
|
//#region src/components/viewer-core/format.ts
|
|
1551
|
-
function
|
|
1525
|
+
function qt(e) {
|
|
1552
1526
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1553
1527
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1554
1528
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1555
1529
|
}
|
|
1556
1530
|
//#endregion
|
|
1557
1531
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1558
|
-
function
|
|
1532
|
+
function Jt(e) {
|
|
1559
1533
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1560
1534
|
}
|
|
1561
|
-
function
|
|
1535
|
+
function Yt(e) {
|
|
1562
1536
|
return e.phase === "failed" ? {
|
|
1563
1537
|
kind: "failed",
|
|
1564
1538
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1581,7 +1555,7 @@ function Zt(e) {
|
|
|
1581
1555
|
}
|
|
1582
1556
|
//#endregion
|
|
1583
1557
|
//#region src/components/viewer-core/useActivation.ts
|
|
1584
|
-
function
|
|
1558
|
+
function Xt(e) {
|
|
1585
1559
|
let t = !1;
|
|
1586
1560
|
L(e.enabled, async (t) => {
|
|
1587
1561
|
if (n(t), t) {
|
|
@@ -1604,7 +1578,7 @@ function Qt(e) {
|
|
|
1604
1578
|
}
|
|
1605
1579
|
//#endregion
|
|
1606
1580
|
//#region src/components/viewer-core/assetState.ts
|
|
1607
|
-
var
|
|
1581
|
+
var Zt = {
|
|
1608
1582
|
currentTime: 0,
|
|
1609
1583
|
duration: 0,
|
|
1610
1584
|
errorKind: null,
|
|
@@ -1613,38 +1587,38 @@ var $t = {
|
|
|
1613
1587
|
ready: !1,
|
|
1614
1588
|
volume: 1
|
|
1615
1589
|
};
|
|
1616
|
-
function
|
|
1617
|
-
return {
|
|
1590
|
+
function Qt() {
|
|
1591
|
+
return { ...Zt };
|
|
1618
1592
|
}
|
|
1619
|
-
function
|
|
1593
|
+
function $t(e) {
|
|
1620
1594
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1621
1595
|
}
|
|
1622
|
-
function
|
|
1623
|
-
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready =
|
|
1596
|
+
function en(e, t, n) {
|
|
1597
|
+
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = tn(t, n);
|
|
1624
1598
|
}
|
|
1625
|
-
function
|
|
1599
|
+
function tn(e, t) {
|
|
1626
1600
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1627
1601
|
}
|
|
1628
1602
|
//#endregion
|
|
1629
1603
|
//#region src/components/viewer-core/loadError.ts
|
|
1630
|
-
var
|
|
1631
|
-
function
|
|
1604
|
+
var nn = /* @__PURE__ */ new Map();
|
|
1605
|
+
function rn(e) {
|
|
1632
1606
|
return e === "not-found" ? "404" : "Load error";
|
|
1633
1607
|
}
|
|
1634
|
-
function
|
|
1608
|
+
function an(e) {
|
|
1635
1609
|
return e === "generic";
|
|
1636
1610
|
}
|
|
1637
|
-
function
|
|
1638
|
-
return
|
|
1611
|
+
function on(e) {
|
|
1612
|
+
return sn(e).then((e) => e ?? "generic");
|
|
1639
1613
|
}
|
|
1640
|
-
function
|
|
1641
|
-
let t =
|
|
1614
|
+
function sn(e) {
|
|
1615
|
+
let t = nn.get(e);
|
|
1642
1616
|
if (t) return t;
|
|
1643
|
-
let n =
|
|
1644
|
-
return
|
|
1617
|
+
let n = cn(e);
|
|
1618
|
+
return nn.set(e, n), n;
|
|
1645
1619
|
}
|
|
1646
|
-
async function
|
|
1647
|
-
if (!
|
|
1620
|
+
async function cn(e) {
|
|
1621
|
+
if (!ln(e)) return null;
|
|
1648
1622
|
try {
|
|
1649
1623
|
let t = await fetch(e, { method: "HEAD" });
|
|
1650
1624
|
return t.ok ? null : t.status === 404 ? "not-found" : "generic";
|
|
@@ -1652,12 +1626,12 @@ async function un(e) {
|
|
|
1652
1626
|
return "generic";
|
|
1653
1627
|
}
|
|
1654
1628
|
}
|
|
1655
|
-
function
|
|
1629
|
+
function ln(e) {
|
|
1656
1630
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1657
1631
|
}
|
|
1658
1632
|
//#endregion
|
|
1659
1633
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1660
|
-
function
|
|
1634
|
+
function un(e) {
|
|
1661
1635
|
try {
|
|
1662
1636
|
let t = e.play();
|
|
1663
1637
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1665,12 +1639,12 @@ function fn(e) {
|
|
|
1665
1639
|
}
|
|
1666
1640
|
//#endregion
|
|
1667
1641
|
//#region src/components/viewer-core/useMedia.ts
|
|
1668
|
-
function
|
|
1642
|
+
function dn(e) {
|
|
1669
1643
|
let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ? $(e.activeItem.value) : null), d = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), f = i(() => {
|
|
1670
1644
|
let t = /* @__PURE__ */ new Map();
|
|
1671
1645
|
for (let n of e.items.value) t.set($(n), n);
|
|
1672
1646
|
return t;
|
|
1673
|
-
}), p = i(() => d.value ? r.value[d.value] ??
|
|
1647
|
+
}), p = i(() => d.value ? r.value[d.value] ?? Zt : Zt), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : fn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
|
|
1674
1648
|
L(() => u.value, async () => {
|
|
1675
1649
|
await C();
|
|
1676
1650
|
}), L(() => e.itemCount.value, async () => {
|
|
@@ -1693,7 +1667,7 @@ function pn(e) {
|
|
|
1693
1667
|
c.delete(e);
|
|
1694
1668
|
}
|
|
1695
1669
|
function b(e, r) {
|
|
1696
|
-
r instanceof HTMLImageElement &&
|
|
1670
|
+
r instanceof HTMLImageElement && $t(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
|
|
1697
1671
|
}
|
|
1698
1672
|
function x() {
|
|
1699
1673
|
H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
@@ -1715,14 +1689,14 @@ function pn(e) {
|
|
|
1715
1689
|
V(i, n);
|
|
1716
1690
|
continue;
|
|
1717
1691
|
}
|
|
1718
|
-
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0,
|
|
1692
|
+
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, un(i), W(n, i);
|
|
1719
1693
|
}
|
|
1720
1694
|
for (let [e, n] of c.entries()) {
|
|
1721
1695
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1722
1696
|
V(n, e);
|
|
1723
1697
|
continue;
|
|
1724
1698
|
}
|
|
1725
|
-
|
|
1699
|
+
un(n), W(e, n);
|
|
1726
1700
|
}
|
|
1727
1701
|
}
|
|
1728
1702
|
function w(e, t) {
|
|
@@ -1740,7 +1714,7 @@ function pn(e) {
|
|
|
1740
1714
|
async function E(r, i) {
|
|
1741
1715
|
let a = Y(r) ?? e.activeItem.value;
|
|
1742
1716
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1743
|
-
let o = await
|
|
1717
|
+
let o = await on(i);
|
|
1744
1718
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1745
1719
|
item: a,
|
|
1746
1720
|
occurrenceKey: r,
|
|
@@ -1758,7 +1732,7 @@ function pn(e) {
|
|
|
1758
1732
|
} catch {}
|
|
1759
1733
|
}
|
|
1760
1734
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1761
|
-
let o = await
|
|
1735
|
+
let o = await on(n);
|
|
1762
1736
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1763
1737
|
item: a,
|
|
1764
1738
|
occurrenceKey: t,
|
|
@@ -1778,13 +1752,13 @@ function pn(e) {
|
|
|
1778
1752
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1779
1753
|
let r = Number.parseFloat(e.target.value);
|
|
1780
1754
|
if (!Number.isFinite(r)) return;
|
|
1781
|
-
let i =
|
|
1755
|
+
let i = fn(r, 0, m.value || 0);
|
|
1782
1756
|
ne(n, i, t), t.currentTime = i;
|
|
1783
1757
|
}
|
|
1784
1758
|
function M(e) {
|
|
1785
1759
|
let t = q(), n = d.value;
|
|
1786
1760
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1787
|
-
let r =
|
|
1761
|
+
let r = fn(Number.parseFloat(e.target.value), 0, 1);
|
|
1788
1762
|
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
|
|
1789
1763
|
}
|
|
1790
1764
|
function N() {
|
|
@@ -1805,10 +1779,10 @@ function pn(e) {
|
|
|
1805
1779
|
}
|
|
1806
1780
|
function z(e) {
|
|
1807
1781
|
let t = R(e);
|
|
1808
|
-
return t ?
|
|
1782
|
+
return t ? rn(t) : null;
|
|
1809
1783
|
}
|
|
1810
1784
|
function B(e) {
|
|
1811
|
-
return
|
|
1785
|
+
return an(R(e));
|
|
1812
1786
|
}
|
|
1813
1787
|
function ee(e) {
|
|
1814
1788
|
return `${e}:${a.value[e] ?? 0}`;
|
|
@@ -1835,17 +1809,17 @@ function pn(e) {
|
|
|
1835
1809
|
for (let [e, t] of c.entries()) V(t, e);
|
|
1836
1810
|
}
|
|
1837
1811
|
function U(e) {
|
|
1838
|
-
return r.value[e] || (r.value[e] =
|
|
1812
|
+
return r.value[e] || (r.value[e] = Qt()), r.value[e];
|
|
1839
1813
|
}
|
|
1840
1814
|
function W(e, t, n) {
|
|
1841
|
-
|
|
1815
|
+
en(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1842
1816
|
}
|
|
1843
1817
|
function ne(e, t, n) {
|
|
1844
1818
|
let r = U(e);
|
|
1845
1819
|
r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.muted = n.muted, r.paused = n.paused, r.volume = Number.isFinite(n.volume) ? n.volume : r.volume;
|
|
1846
1820
|
}
|
|
1847
1821
|
function G(e) {
|
|
1848
|
-
return
|
|
1822
|
+
return fn(o.value[e] ?? 1, 0, 1);
|
|
1849
1823
|
}
|
|
1850
1824
|
function K(e) {
|
|
1851
1825
|
return s.get(e) ?? c.get(e) ?? null;
|
|
@@ -1856,7 +1830,7 @@ function pn(e) {
|
|
|
1856
1830
|
function re(e) {
|
|
1857
1831
|
if (e) {
|
|
1858
1832
|
if (e.paused) {
|
|
1859
|
-
|
|
1833
|
+
un(e);
|
|
1860
1834
|
return;
|
|
1861
1835
|
}
|
|
1862
1836
|
e.pause();
|
|
@@ -1910,26 +1884,32 @@ function pn(e) {
|
|
|
1910
1884
|
syncMediaPlayback: C
|
|
1911
1885
|
};
|
|
1912
1886
|
}
|
|
1913
|
-
function
|
|
1887
|
+
function fn(e, t, n) {
|
|
1914
1888
|
return Math.min(Math.max(e, t), n);
|
|
1915
1889
|
}
|
|
1916
|
-
|
|
1890
|
+
//#endregion
|
|
1891
|
+
//#region src/components/viewer-core/virtualization.ts
|
|
1892
|
+
var pn = {
|
|
1893
|
+
backward: 1,
|
|
1894
|
+
forward: 3
|
|
1895
|
+
};
|
|
1896
|
+
function mn(e, t, n = pn) {
|
|
1917
1897
|
return t <= 0 ? {
|
|
1918
1898
|
start: 0,
|
|
1919
1899
|
end: -1
|
|
1920
1900
|
} : {
|
|
1921
|
-
start: Math.max(0, e - n),
|
|
1922
|
-
end: Math.min(t - 1, e + n)
|
|
1901
|
+
start: Math.max(0, e - n.backward),
|
|
1902
|
+
end: Math.min(t - 1, e + n.forward)
|
|
1923
1903
|
};
|
|
1924
1904
|
}
|
|
1925
|
-
function
|
|
1926
|
-
let r =
|
|
1905
|
+
function hn(e, t, n = pn) {
|
|
1906
|
+
let r = mn(t, e.length, n);
|
|
1927
1907
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1928
1908
|
item: e,
|
|
1929
1909
|
index: r.start + t
|
|
1930
1910
|
}));
|
|
1931
1911
|
}
|
|
1932
|
-
function
|
|
1912
|
+
function gn(e, t, n, r, i) {
|
|
1933
1913
|
return {
|
|
1934
1914
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1935
1915
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1937,12 +1917,12 @@ function _n(e, t, n, r, i) {
|
|
|
1937
1917
|
}
|
|
1938
1918
|
//#endregion
|
|
1939
1919
|
//#region src/components/viewer-core/useViewer.ts
|
|
1940
|
-
function
|
|
1941
|
-
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() =>
|
|
1920
|
+
function _n(e, t, n = {}) {
|
|
1921
|
+
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => Jt({
|
|
1942
1922
|
itemCount: r.value.length,
|
|
1943
1923
|
loading: s.value,
|
|
1944
1924
|
phase: e.phase
|
|
1945
|
-
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T =
|
|
1925
|
+
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = dn({
|
|
1946
1926
|
items: r,
|
|
1947
1927
|
activeItem: C,
|
|
1948
1928
|
activeMediaItem: w,
|
|
@@ -1951,14 +1931,14 @@ function vn(e, t, n = {}) {
|
|
|
1951
1931
|
loopFullscreenVideo: l,
|
|
1952
1932
|
onAssetError: n.onAssetError,
|
|
1953
1933
|
onAssetLoad: n.onAssetLoad
|
|
1954
|
-
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() =>
|
|
1934
|
+
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Yt({
|
|
1955
1935
|
errorMessage: o.value,
|
|
1956
1936
|
hasItems: r.value.length > 0,
|
|
1957
1937
|
hasNextPage: c.value,
|
|
1958
1938
|
phase: d.value,
|
|
1959
1939
|
surface: "fullscreen"
|
|
1960
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
1961
|
-
|
|
1940
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => mn(S.value, r.value.length)), N = i(() => hn(r.value, S.value));
|
|
1941
|
+
Xt({
|
|
1962
1942
|
enabled: _,
|
|
1963
1943
|
onDisable() {
|
|
1964
1944
|
H(), T.resetMediaState();
|
|
@@ -2036,7 +2016,7 @@ function vn(e, t, n = {}) {
|
|
|
2036
2016
|
return e.type === "audio";
|
|
2037
2017
|
}
|
|
2038
2018
|
function ie(e) {
|
|
2039
|
-
return
|
|
2019
|
+
return gn(e, S.value, g.value, m.value, h.value);
|
|
2040
2020
|
}
|
|
2041
2021
|
return {
|
|
2042
2022
|
activeItem: C,
|
|
@@ -2051,7 +2031,7 @@ function vn(e, t, n = {}) {
|
|
|
2051
2031
|
getAssetErrorKind: T.getAssetErrorKind,
|
|
2052
2032
|
getAssetErrorLabel: T.getAssetErrorLabel,
|
|
2053
2033
|
getAssetRenderKey: T.getAssetRenderKey,
|
|
2054
|
-
formatPlaybackTime:
|
|
2034
|
+
formatPlaybackTime: qt,
|
|
2055
2035
|
getImageSource: T.getImageSource,
|
|
2056
2036
|
getSlideStyle: ie,
|
|
2057
2037
|
hasNextPage: c,
|
|
@@ -2095,21 +2075,21 @@ function vn(e, t, n = {}) {
|
|
|
2095
2075
|
}
|
|
2096
2076
|
//#endregion
|
|
2097
2077
|
//#region src/components/viewer-core/theme.ts
|
|
2098
|
-
var
|
|
2078
|
+
var vn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", yn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", bn = {
|
|
2099
2079
|
image: !0,
|
|
2100
2080
|
video: !0,
|
|
2101
2081
|
audio: !0,
|
|
2102
2082
|
other: !0
|
|
2103
2083
|
};
|
|
2104
|
-
function
|
|
2105
|
-
return
|
|
2084
|
+
function xn(e) {
|
|
2085
|
+
return bn[e], vn;
|
|
2106
2086
|
}
|
|
2107
|
-
function
|
|
2108
|
-
return
|
|
2087
|
+
function Sn(e) {
|
|
2088
|
+
return bn[e], yn;
|
|
2109
2089
|
}
|
|
2110
2090
|
//#endregion
|
|
2111
2091
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
2112
|
-
function
|
|
2092
|
+
function Cn(e) {
|
|
2113
2093
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
2114
2094
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
2115
2095
|
if (!n) return null;
|
|
@@ -2124,20 +2104,20 @@ function wn(e) {
|
|
|
2124
2104
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
2125
2105
|
}
|
|
2126
2106
|
return r <= 0 ? null : {
|
|
2127
|
-
r:
|
|
2128
|
-
g:
|
|
2129
|
-
b:
|
|
2107
|
+
r: wn(Math.round(i / r)),
|
|
2108
|
+
g: wn(Math.round(a / r)),
|
|
2109
|
+
b: wn(Math.round(o / r))
|
|
2130
2110
|
};
|
|
2131
2111
|
} catch {
|
|
2132
2112
|
return null;
|
|
2133
2113
|
}
|
|
2134
2114
|
}
|
|
2135
|
-
function
|
|
2115
|
+
function wn(e) {
|
|
2136
2116
|
return Math.min(235, Math.max(26, e));
|
|
2137
2117
|
}
|
|
2138
2118
|
//#endregion
|
|
2139
2119
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
2140
|
-
function
|
|
2120
|
+
function Tn(e) {
|
|
2141
2121
|
let t = D({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
|
|
2142
2122
|
if (!r.value) return;
|
|
2143
2123
|
let { r: e, g: t, b: n } = r.value;
|
|
@@ -2152,7 +2132,7 @@ function En(e) {
|
|
|
2152
2132
|
});
|
|
2153
2133
|
function s(n, r) {
|
|
2154
2134
|
if (!e.showDominantImageTone.value) return;
|
|
2155
|
-
let i =
|
|
2135
|
+
let i = Cn(r);
|
|
2156
2136
|
i && (t.value[n] = i);
|
|
2157
2137
|
}
|
|
2158
2138
|
return {
|
|
@@ -2163,7 +2143,7 @@ function En(e) {
|
|
|
2163
2143
|
}
|
|
2164
2144
|
//#endregion
|
|
2165
2145
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
2166
|
-
var
|
|
2146
|
+
var En = ["data-surface"], Dn = ["data-surface"], On = /* @__PURE__ */ d({
|
|
2167
2147
|
inheritAttrs: !1,
|
|
2168
2148
|
__name: "SurfaceEmptyState",
|
|
2169
2149
|
props: {
|
|
@@ -2177,31 +2157,31 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2177
2157
|
"data-testid": "vibe-empty-state-inline",
|
|
2178
2158
|
"data-surface": e.surface,
|
|
2179
2159
|
class: ["pointer-events-none absolute z-[4] text-center", e.surface === "grid" ? "inset-x-0 top-[clamp(6rem,22vh,11rem)] flex justify-center px-6" : "inset-0 grid place-items-center px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)]"]
|
|
2180
|
-
}), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16,
|
|
2160
|
+
}), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, En)) : (w(), s("div", g({ key: 1 }, N(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [k(n.$slots, "default", {}, () => [c("span", {
|
|
2181
2161
|
"data-testid": "vibe-empty-state-badge",
|
|
2182
2162
|
"data-surface": e.surface,
|
|
2183
2163
|
class: v(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
|
|
2184
|
-
}, j(e.message), 11,
|
|
2164
|
+
}, j(e.message), 11, Dn)])], 16));
|
|
2185
2165
|
}
|
|
2186
|
-
}),
|
|
2166
|
+
}), kn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, An = {
|
|
2187
2167
|
key: 0,
|
|
2188
2168
|
class: "relative h-full min-h-0"
|
|
2189
|
-
},
|
|
2169
|
+
}, jn = [
|
|
2190
2170
|
"data-item-id",
|
|
2191
2171
|
"data-occurrence-key",
|
|
2192
2172
|
"data-index",
|
|
2193
2173
|
"data-active",
|
|
2194
2174
|
"aria-hidden"
|
|
2195
|
-
],
|
|
2175
|
+
], Mn = {
|
|
2196
2176
|
key: 0,
|
|
2197
2177
|
"data-testid": "vibe-asset-spinner",
|
|
2198
2178
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
2199
|
-
},
|
|
2179
|
+
}, Nn = { 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]" }, Pn = ["data-kind"], Fn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, In = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Ln = ["onClick"], Rn = [
|
|
2200
2180
|
"src",
|
|
2201
2181
|
"alt",
|
|
2202
2182
|
"onLoad",
|
|
2203
2183
|
"onError"
|
|
2204
|
-
],
|
|
2184
|
+
], zn = [
|
|
2205
2185
|
"loop",
|
|
2206
2186
|
"src",
|
|
2207
2187
|
"preload",
|
|
@@ -2220,15 +2200,15 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2220
2200
|
"onStalled",
|
|
2221
2201
|
"onTimeupdate",
|
|
2222
2202
|
"onWaiting"
|
|
2223
|
-
],
|
|
2203
|
+
], Bn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Vn = [
|
|
2224
2204
|
"aria-label",
|
|
2225
2205
|
"disabled",
|
|
2226
2206
|
"onClick"
|
|
2227
|
-
],
|
|
2207
|
+
], Hn = { 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]" }, Un = { 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]" }, Wn = {
|
|
2228
2208
|
key: 0,
|
|
2229
2209
|
"data-testid": "vibe-asset-spinner",
|
|
2230
2210
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
2231
|
-
},
|
|
2211
|
+
}, Gn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Kn = ["data-kind"], qn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Jn = ["onClick"], Yn = [
|
|
2232
2212
|
"src",
|
|
2233
2213
|
"preload",
|
|
2234
2214
|
"onCanplay",
|
|
@@ -2244,26 +2224,26 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2244
2224
|
"onStalled",
|
|
2245
2225
|
"onTimeupdate",
|
|
2246
2226
|
"onWaiting"
|
|
2247
|
-
],
|
|
2227
|
+
], Xn = {
|
|
2248
2228
|
key: 2,
|
|
2249
2229
|
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"
|
|
2250
|
-
},
|
|
2230
|
+
}, Zn = { 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]" }, Qn = {
|
|
2251
2231
|
key: 0,
|
|
2252
2232
|
"data-testid": "vibe-fullscreen-overlay",
|
|
2253
2233
|
class: "pointer-events-none absolute inset-0 z-[6]"
|
|
2254
|
-
},
|
|
2234
|
+
}, $n = { class: "h-full w-full" }, er = {
|
|
2255
2235
|
key: 1,
|
|
2256
2236
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
2257
2237
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
2258
|
-
},
|
|
2238
|
+
}, tr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, nr = { 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)]" }, rr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ir = {
|
|
2259
2239
|
key: 0,
|
|
2260
2240
|
"data-testid": "vibe-fullscreen-aside",
|
|
2261
2241
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
2262
|
-
},
|
|
2242
|
+
}, ar = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, or = {
|
|
2263
2243
|
key: 0,
|
|
2264
2244
|
"data-testid": "vibe-fullscreen-aside",
|
|
2265
2245
|
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]"
|
|
2266
|
-
},
|
|
2246
|
+
}, sr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, cr = 1280, lr = 768, ur = /* @__PURE__ */ d({
|
|
2267
2247
|
__name: "FullscreenSurface",
|
|
2268
2248
|
props: {
|
|
2269
2249
|
active: {
|
|
@@ -2315,23 +2295,23 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2315
2295
|
},
|
|
2316
2296
|
emits: ["back-to-list", "update:activeIndex"],
|
|
2317
2297
|
setup(e, { emit: n }) {
|
|
2318
|
-
let d = e, f = F(), m = n, h =
|
|
2298
|
+
let d = e, f = F(), m = n, h = _n(d, (e, t) => {
|
|
2319
2299
|
m("update:activeIndex", t);
|
|
2320
2300
|
}, {
|
|
2321
2301
|
enabled: M(d, "active"),
|
|
2322
2302
|
onAssetError: d.reportAssetError ?? void 0,
|
|
2323
2303
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
2324
|
-
}), _ = D(typeof window > "u" ?
|
|
2304
|
+
}), _ = D(typeof window > "u" ? cr : window.innerWidth || cr), C = Ht({
|
|
2325
2305
|
active: M(d, "active"),
|
|
2326
2306
|
items: h.items,
|
|
2327
2307
|
resolvedActiveIndex: h.resolvedActiveIndex,
|
|
2328
2308
|
viewer: h
|
|
2329
|
-
}), T = i(() =>
|
|
2309
|
+
}), T = i(() => xn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = Tn({
|
|
2330
2310
|
activeItem: h.activeItem,
|
|
2331
2311
|
getItemKey: C.getItemKey,
|
|
2332
2312
|
isImageReady: h.isImageReady,
|
|
2333
2313
|
showDominantImageTone: M(d, "showDominantImageTone")
|
|
2334
|
-
}), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value <
|
|
2314
|
+
}), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value < lr ? "vertical" : "horizontal"), te = i(() => R.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), V = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), U = i(() => {
|
|
2335
2315
|
let e = h.activeItem.value;
|
|
2336
2316
|
return e ? {
|
|
2337
2317
|
hasNextPage: d.hasNextPage,
|
|
@@ -2348,7 +2328,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2348
2328
|
}), K = i(() => !G.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](G.value)), q = i(() => ({
|
|
2349
2329
|
gridTemplateColumns: Y.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
2350
2330
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
2351
|
-
})), re = i(() =>
|
|
2331
|
+
})), re = i(() => Ut(W.value)), J = i(() => Ut(ne.value)), Y = i(() => J.value && _.value >= cr), ie = i(() => J.value && !Y.value), ae = i(() => Ut(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Kt({
|
|
2352
2332
|
emptyStateMode: M(d, "emptyStateMode"),
|
|
2353
2333
|
itemCount: i(() => d.items.length),
|
|
2354
2334
|
loading: M(d, "loading"),
|
|
@@ -2361,7 +2341,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2361
2341
|
window.removeEventListener("resize", Z);
|
|
2362
2342
|
});
|
|
2363
2343
|
function Z() {
|
|
2364
|
-
_.value = window.innerWidth ||
|
|
2344
|
+
_.value = window.innerWidth || cr;
|
|
2365
2345
|
}
|
|
2366
2346
|
function pe(e, t, n) {
|
|
2367
2347
|
C.settleBackgroundPreload(t), h.onImageLoad(t, n);
|
|
@@ -2401,7 +2381,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2401
2381
|
let r = n.play();
|
|
2402
2382
|
r && typeof r.catch == "function" && r.catch(() => {});
|
|
2403
2383
|
}
|
|
2404
|
-
return (e, n) => (w(), s("div",
|
|
2384
|
+
return (e, n) => (w(), s("div", kn, [
|
|
2405
2385
|
c("div", {
|
|
2406
2386
|
class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
|
|
2407
2387
|
style: b(N(P))
|
|
@@ -2418,7 +2398,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2418
2398
|
onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
|
|
2419
2399
|
onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
|
|
2420
2400
|
onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
|
|
2421
|
-
}, [N(h).activeItem.value ? (w(), s("div",
|
|
2401
|
+
}, [N(h).activeItem.value ? (w(), s("div", An, [
|
|
2422
2402
|
(w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
|
|
2423
2403
|
key: N(C).getItemKey(r),
|
|
2424
2404
|
"data-testid": "vibe-slide",
|
|
@@ -2430,12 +2410,12 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2430
2410
|
class: v(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === N(h).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
|
|
2431
2411
|
style: b(N(h).getSlideStyle(i))
|
|
2432
2412
|
}, [c("div", {
|
|
2433
|
-
class: v(["absolute inset-0 opacity-85", N(
|
|
2413
|
+
class: v(["absolute inset-0 opacity-85", N(Sn)(r.type)]),
|
|
2434
2414
|
style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
|
|
2435
2415
|
}, null, 6), N(h).isVisual(r) ? (w(), s("div", {
|
|
2436
2416
|
key: 0,
|
|
2437
2417
|
class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? te.value : ""])
|
|
2438
|
-
}, [N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2418
|
+
}, [N(C).isAssetLoading(i, r) ? (w(), s("div", Mn, [c("span", Nn, [u(N(oe), {
|
|
2439
2419
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2440
2420
|
"aria-hidden": "true"
|
|
2441
2421
|
})])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
|
|
@@ -2443,19 +2423,19 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2443
2423
|
"data-testid": "vibe-asset-error",
|
|
2444
2424
|
"data-kind": N(C).getAssetErrorKind(r),
|
|
2445
2425
|
class: "grid h-full w-full place-items-center"
|
|
2446
|
-
}, [c("div",
|
|
2426
|
+
}, [c("div", Fn, [
|
|
2447
2427
|
u(N(le), {
|
|
2448
2428
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2449
2429
|
"aria-hidden": "true"
|
|
2450
2430
|
}),
|
|
2451
|
-
c("p",
|
|
2431
|
+
c("p", In, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2452
2432
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2453
2433
|
key: 0,
|
|
2454
2434
|
type: "button",
|
|
2455
2435
|
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",
|
|
2456
2436
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2457
|
-
}, " Retry ", 8,
|
|
2458
|
-
])], 8,
|
|
2437
|
+
}, " Retry ", 8, Ln)) : o("", !0)
|
|
2438
|
+
])], 8, Pn)) : r.type === "image" ? (w(), s("img", {
|
|
2459
2439
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2460
2440
|
src: N(C).getFullscreenImageSource(i, r),
|
|
2461
2441
|
alt: r.title ?? "",
|
|
@@ -2466,7 +2446,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2466
2446
|
ref: (e) => he(N(C).getItemKey(r), e),
|
|
2467
2447
|
onLoad: (e) => pe(e, N(C).getItemKey(r), r.url),
|
|
2468
2448
|
onError: (e) => me(N(C).getItemKey(r), r.url)
|
|
2469
|
-
}, null, 42,
|
|
2449
|
+
}, null, 42, Rn)) : (w(), s("video", {
|
|
2470
2450
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2471
2451
|
class: v(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", N(h).isMediaReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
2472
2452
|
playsinline: "",
|
|
@@ -2490,10 +2470,10 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2490
2470
|
onStalled: (e) => Q(N(C).getItemKey(r), e),
|
|
2491
2471
|
onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
|
|
2492
2472
|
onWaiting: (e) => Q(N(C).getItemKey(r), e)
|
|
2493
|
-
}, null, 42,
|
|
2473
|
+
}, null, 42, zn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
|
|
2494
2474
|
key: 1,
|
|
2495
2475
|
class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? te.value : ""])
|
|
2496
|
-
}, [c("div",
|
|
2476
|
+
}, [c("div", Bn, [
|
|
2497
2477
|
c("button", {
|
|
2498
2478
|
type: "button",
|
|
2499
2479
|
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]",
|
|
@@ -2503,19 +2483,19 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2503
2483
|
}, [
|
|
2504
2484
|
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),
|
|
2505
2485
|
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),
|
|
2506
|
-
c("span",
|
|
2486
|
+
c("span", Hn, [k(e.$slots, "item-icon", {
|
|
2507
2487
|
icon: N(Ot)(r.type),
|
|
2508
2488
|
item: r
|
|
2509
2489
|
}, () => [(w(), a(A(N(Ot)(r.type)), {
|
|
2510
2490
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2511
2491
|
"aria-hidden": "true"
|
|
2512
2492
|
}))])]),
|
|
2513
|
-
c("span",
|
|
2493
|
+
c("span", Un, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
|
|
2514
2494
|
class: "h-4 w-4 stroke-2",
|
|
2515
2495
|
"aria-hidden": "true"
|
|
2516
2496
|
}))])
|
|
2517
|
-
], 8,
|
|
2518
|
-
N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2497
|
+
], 8, Vn),
|
|
2498
|
+
N(C).isAssetLoading(i, r) ? (w(), s("div", Wn, [c("span", Gn, [u(N(oe), {
|
|
2519
2499
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2520
2500
|
"aria-hidden": "true"
|
|
2521
2501
|
})])])) : o("", !0),
|
|
@@ -2528,14 +2508,14 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2528
2508
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2529
2509
|
"aria-hidden": "true"
|
|
2530
2510
|
}),
|
|
2531
|
-
c("p",
|
|
2511
|
+
c("p", qn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2532
2512
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2533
2513
|
key: 0,
|
|
2534
2514
|
type: "button",
|
|
2535
2515
|
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",
|
|
2536
2516
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2537
|
-
}, " Retry ", 8,
|
|
2538
|
-
], 8,
|
|
2517
|
+
}, " Retry ", 8, Jn)) : o("", !0)
|
|
2518
|
+
], 8, Kn)], 64)) : o("", !0)
|
|
2539
2519
|
]), (w(), s("audio", {
|
|
2540
2520
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2541
2521
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
@@ -2556,14 +2536,14 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2556
2536
|
onStalled: (e) => Q(N(C).getItemKey(r), e),
|
|
2557
2537
|
onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
|
|
2558
2538
|
onWaiting: (e) => Q(N(C).getItemKey(r), e)
|
|
2559
|
-
}, null, 40,
|
|
2539
|
+
}, null, 40, Yn))], 2)) : (w(), s("div", Xn, [c("div", Zn, [k(e.$slots, "item-icon", {
|
|
2560
2540
|
icon: N(Ot)(r.type),
|
|
2561
2541
|
item: r
|
|
2562
2542
|
}, () => [(w(), a(A(N(Ot)(r.type)), {
|
|
2563
2543
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2564
2544
|
"aria-hidden": "true"
|
|
2565
|
-
}))])])]))], 14,
|
|
2566
|
-
U.value && f["fullscreen-overlay"] ? (w(), s("div",
|
|
2545
|
+
}))])])]))], 14, jn))), 128)),
|
|
2546
|
+
U.value && f["fullscreen-overlay"] ? (w(), s("div", Qn, [c("div", $n, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
|
|
2567
2547
|
N(h).activeItem.value ? (w(), a(Tt, {
|
|
2568
2548
|
key: 1,
|
|
2569
2549
|
"current-index": N(h).resolvedActiveIndex.value,
|
|
@@ -2621,10 +2601,10 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2621
2601
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2622
2602
|
class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", G.value.kind === "end" ? "border-amber-300/35 text-amber-200" : G.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
2623
2603
|
}, j(G.value.message), 3))], 2)) : o("", !0)
|
|
2624
|
-
])) : V.value ? (w(), s("div",
|
|
2604
|
+
])) : V.value ? (w(), s("div", er, [c("div", tr, [c("span", nr, [u(N(oe), {
|
|
2625
2605
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2626
2606
|
"aria-hidden": "true"
|
|
2627
|
-
})]), c("p",
|
|
2607
|
+
})]), c("p", rr, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(On, {
|
|
2628
2608
|
key: 2,
|
|
2629
2609
|
message: N(X).message,
|
|
2630
2610
|
mode: N(X).mode,
|
|
@@ -2636,7 +2616,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2636
2616
|
"message",
|
|
2637
2617
|
"mode",
|
|
2638
2618
|
"surface"
|
|
2639
|
-
])) : o("", !0), N(ue) && N(X) ? (w(), a(
|
|
2619
|
+
])) : o("", !0), N(ue) && N(X) ? (w(), a(On, {
|
|
2640
2620
|
key: 3,
|
|
2641
2621
|
message: N(X).message,
|
|
2642
2622
|
mode: N(X).mode,
|
|
@@ -2656,7 +2636,7 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2656
2636
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2657
2637
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2658
2638
|
}, {
|
|
2659
|
-
default: z(() => [Y.value && U.value ? (w(), s("aside",
|
|
2639
|
+
default: z(() => [Y.value && U.value ? (w(), s("aside", ir, [c("div", ar, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
|
|
2660
2640
|
_: 3
|
|
2661
2641
|
})], 4),
|
|
2662
2642
|
u(r, {
|
|
@@ -2667,29 +2647,29 @@ var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
|
2667
2647
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2668
2648
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2669
2649
|
}, {
|
|
2670
|
-
default: z(() => [ie.value && U.value ? (w(), s("aside",
|
|
2650
|
+
default: z(() => [ie.value && U.value ? (w(), s("aside", or, [c("div", sr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
|
|
2671
2651
|
_: 3
|
|
2672
2652
|
})
|
|
2673
2653
|
]));
|
|
2674
2654
|
}
|
|
2675
|
-
}),
|
|
2676
|
-
function
|
|
2655
|
+
}), dr = 1, fr = .5;
|
|
2656
|
+
function pr(e) {
|
|
2677
2657
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2678
|
-
width:
|
|
2679
|
-
height:
|
|
2658
|
+
width: dr,
|
|
2659
|
+
height: dr,
|
|
2680
2660
|
source: "fallback"
|
|
2681
2661
|
};
|
|
2682
2662
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2683
|
-
if (
|
|
2684
|
-
let r =
|
|
2663
|
+
if (br(t) && br(n)) {
|
|
2664
|
+
let r = xr(e, t, n);
|
|
2685
2665
|
return {
|
|
2686
2666
|
width: r.width,
|
|
2687
2667
|
height: r.height,
|
|
2688
2668
|
source: "preview"
|
|
2689
2669
|
};
|
|
2690
2670
|
}
|
|
2691
|
-
if (
|
|
2692
|
-
let t =
|
|
2671
|
+
if (br(e.width) && br(e.height)) {
|
|
2672
|
+
let t = xr(e, e.width, e.height);
|
|
2693
2673
|
return {
|
|
2694
2674
|
width: t.width,
|
|
2695
2675
|
height: t.height,
|
|
@@ -2697,31 +2677,31 @@ function mr(e) {
|
|
|
2697
2677
|
};
|
|
2698
2678
|
}
|
|
2699
2679
|
return {
|
|
2700
|
-
width:
|
|
2701
|
-
height:
|
|
2680
|
+
width: dr,
|
|
2681
|
+
height: dr,
|
|
2702
2682
|
source: "fallback"
|
|
2703
2683
|
};
|
|
2704
2684
|
}
|
|
2705
|
-
function
|
|
2685
|
+
function mr(e, t) {
|
|
2706
2686
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2707
2687
|
}
|
|
2708
|
-
function
|
|
2688
|
+
function hr(e, t, n, r = 0) {
|
|
2709
2689
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2710
2690
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2711
2691
|
return !a || a <= 0 ? n : a / t;
|
|
2712
2692
|
}
|
|
2713
|
-
function
|
|
2714
|
-
let n =
|
|
2693
|
+
function gr(e, t) {
|
|
2694
|
+
let n = pr(e);
|
|
2715
2695
|
return n.height / n.width * t;
|
|
2716
2696
|
}
|
|
2717
|
-
function
|
|
2697
|
+
function _r(e, t) {
|
|
2718
2698
|
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;
|
|
2719
2699
|
for (let c = 0; c < e.length; c += 1) {
|
|
2720
2700
|
let l = e[c];
|
|
2721
2701
|
o.set($(l), c);
|
|
2722
2702
|
let u = 0;
|
|
2723
2703
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2724
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2704
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = gr(l, t.columnWidth);
|
|
2725
2705
|
r[c] = {
|
|
2726
2706
|
x: d,
|
|
2727
2707
|
y: f
|
|
@@ -2740,7 +2720,7 @@ function vr(e, t) {
|
|
|
2740
2720
|
indexById: o
|
|
2741
2721
|
};
|
|
2742
2722
|
}
|
|
2743
|
-
function
|
|
2723
|
+
function vr(e) {
|
|
2744
2724
|
if (e.itemCount <= 0) return [];
|
|
2745
2725
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2746
2726
|
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();
|
|
@@ -2750,7 +2730,7 @@ function yr(e) {
|
|
|
2750
2730
|
}
|
|
2751
2731
|
return Array.from(a).sort((e, t) => e - t);
|
|
2752
2732
|
}
|
|
2753
|
-
function
|
|
2733
|
+
function yr(e, t, n) {
|
|
2754
2734
|
let r = /* @__PURE__ */ new Map();
|
|
2755
2735
|
for (let i of e) {
|
|
2756
2736
|
let e = t.get($(i));
|
|
@@ -2760,11 +2740,11 @@ function br(e, t, n) {
|
|
|
2760
2740
|
}
|
|
2761
2741
|
return r;
|
|
2762
2742
|
}
|
|
2763
|
-
function
|
|
2743
|
+
function br(e) {
|
|
2764
2744
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2765
2745
|
}
|
|
2766
|
-
function
|
|
2767
|
-
return e.type !== "image" || n / t >=
|
|
2746
|
+
function xr(e, t, n) {
|
|
2747
|
+
return e.type !== "image" || n / t >= fr ? {
|
|
2768
2748
|
width: t,
|
|
2769
2749
|
height: n
|
|
2770
2750
|
} : {
|
|
@@ -2774,21 +2754,21 @@ function Sr(e, t, n) {
|
|
|
2774
2754
|
}
|
|
2775
2755
|
//#endregion
|
|
2776
2756
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2777
|
-
var
|
|
2778
|
-
function
|
|
2757
|
+
var Sr = 300, Cr = 600, wr = 40, Tr = 300, Er = 400;
|
|
2758
|
+
function Dr(e, t) {
|
|
2779
2759
|
return t === "top" ? [...e].reverse() : e;
|
|
2780
2760
|
}
|
|
2781
|
-
function
|
|
2782
|
-
return e <= 0 ?
|
|
2761
|
+
function Or(e) {
|
|
2762
|
+
return e <= 0 ? Cr : Cr + Math.min((e - 1) * wr, Er);
|
|
2783
2763
|
}
|
|
2784
|
-
function
|
|
2785
|
-
return
|
|
2764
|
+
function kr() {
|
|
2765
|
+
return Tr;
|
|
2786
2766
|
}
|
|
2787
|
-
function
|
|
2767
|
+
function Ar(e) {
|
|
2788
2768
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2789
2769
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2790
2770
|
}
|
|
2791
|
-
function
|
|
2771
|
+
function jr(e) {
|
|
2792
2772
|
let t = D(/* @__PURE__ */ new Set()), n = D(/* @__PURE__ */ new Set()), r = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), o = D(/* @__PURE__ */ new Map()), s = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Map()), u = D(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
|
|
2793
2773
|
L(e.visibleIndices, (i) => {
|
|
2794
2774
|
if (!i.length) return;
|
|
@@ -2798,20 +2778,20 @@ function Mr(e) {
|
|
|
2798
2778
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2799
2779
|
}
|
|
2800
2780
|
if (!o.length) return;
|
|
2801
|
-
let s =
|
|
2802
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2803
|
-
r.value = c,
|
|
2781
|
+
let s = Dr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2782
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * wr, Er));
|
|
2783
|
+
r.value = c, Mr(() => {
|
|
2804
2784
|
let e = new Set(n.value);
|
|
2805
2785
|
for (let t of o) e.add(t);
|
|
2806
2786
|
n.value = e;
|
|
2807
|
-
}),
|
|
2787
|
+
}), Nr(() => {
|
|
2808
2788
|
let e = new Set(t.value);
|
|
2809
2789
|
for (let t of o) e.delete(t);
|
|
2810
2790
|
t.value = e, S(() => {
|
|
2811
2791
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2812
2792
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2813
2793
|
n.value = e, r.value = t, a.value = i;
|
|
2814
|
-
},
|
|
2794
|
+
}, Or(o.length));
|
|
2815
2795
|
});
|
|
2816
2796
|
}, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
|
|
2817
2797
|
if (!e.length || !o.value.size) return;
|
|
@@ -2838,7 +2818,7 @@ function Mr(e) {
|
|
|
2838
2818
|
let e = $(t.item);
|
|
2839
2819
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2840
2820
|
}
|
|
2841
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2821
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Mr(() => {
|
|
2842
2822
|
let e = new Set(s.value);
|
|
2843
2823
|
for (let t of p) e.add(t);
|
|
2844
2824
|
s.value = e;
|
|
@@ -2846,9 +2826,9 @@ function Mr(e) {
|
|
|
2846
2826
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2847
2827
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2848
2828
|
o.value = e, s.value = t;
|
|
2849
|
-
},
|
|
2829
|
+
}, Tr);
|
|
2850
2830
|
}
|
|
2851
|
-
function g(t, n, r =
|
|
2831
|
+
function g(t, n, r = Sr) {
|
|
2852
2832
|
if (!t.size) return;
|
|
2853
2833
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2854
2834
|
for (let [r, o] of t.entries()) {
|
|
@@ -2867,8 +2847,8 @@ function Mr(e) {
|
|
|
2867
2847
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2868
2848
|
let o = new Map(l.value);
|
|
2869
2849
|
for (let e of a) o.set(e, r);
|
|
2870
|
-
l.value = o,
|
|
2871
|
-
u.value = new Set(a),
|
|
2850
|
+
l.value = o, Mr(() => {
|
|
2851
|
+
u.value = new Set(a), Mr(() => {
|
|
2872
2852
|
c.value = /* @__PURE__ */ new Map();
|
|
2873
2853
|
});
|
|
2874
2854
|
}), S(() => {
|
|
@@ -2879,8 +2859,8 @@ function Mr(e) {
|
|
|
2879
2859
|
}, r);
|
|
2880
2860
|
}
|
|
2881
2861
|
function _(e) {
|
|
2882
|
-
if (n.value.has(e)) return `transform ${
|
|
2883
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2862
|
+
if (n.value.has(e)) return `transform ${Cr}ms ease-out`;
|
|
2863
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? Sr}ms ease-out`;
|
|
2884
2864
|
}
|
|
2885
2865
|
function v(e) {
|
|
2886
2866
|
if (!n.value.has(e)) return;
|
|
@@ -2897,7 +2877,7 @@ function Mr(e) {
|
|
|
2897
2877
|
} : {
|
|
2898
2878
|
dx: 0,
|
|
2899
2879
|
dy: 0
|
|
2900
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
2880
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Ar({
|
|
2901
2881
|
columnWidth: e.columnWidth.value,
|
|
2902
2882
|
direction: u,
|
|
2903
2883
|
itemHeight: o,
|
|
@@ -2911,14 +2891,14 @@ function Mr(e) {
|
|
|
2911
2891
|
if (!r) return {
|
|
2912
2892
|
opacity: "0",
|
|
2913
2893
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2914
|
-
transition: `opacity ${
|
|
2894
|
+
transition: `opacity ${Tr}ms ease-out, transform ${Tr}ms ease-out`
|
|
2915
2895
|
};
|
|
2916
2896
|
let i = s.value.has(n);
|
|
2917
2897
|
return {
|
|
2918
2898
|
height: `${r.height}px`,
|
|
2919
2899
|
opacity: i ? "0" : "1",
|
|
2920
2900
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2921
|
-
transition: `opacity ${
|
|
2901
|
+
transition: `opacity ${Tr}ms ease-out, transform ${Tr}ms ease-out`,
|
|
2922
2902
|
width: `${e.columnWidth.value}px`
|
|
2923
2903
|
};
|
|
2924
2904
|
}
|
|
@@ -2939,28 +2919,28 @@ function Mr(e) {
|
|
|
2939
2919
|
playFlipMoveAnimation: g
|
|
2940
2920
|
};
|
|
2941
2921
|
}
|
|
2942
|
-
function
|
|
2922
|
+
function Mr(e) {
|
|
2943
2923
|
if (typeof requestAnimationFrame == "function") {
|
|
2944
2924
|
requestAnimationFrame(() => e());
|
|
2945
2925
|
return;
|
|
2946
2926
|
}
|
|
2947
2927
|
setTimeout(e, 0);
|
|
2948
2928
|
}
|
|
2949
|
-
function
|
|
2950
|
-
|
|
2929
|
+
function Nr(e) {
|
|
2930
|
+
Mr(() => Mr(e));
|
|
2951
2931
|
}
|
|
2952
2932
|
//#endregion
|
|
2953
2933
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
2954
|
-
function
|
|
2934
|
+
function Pr(e, t) {
|
|
2955
2935
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
2956
2936
|
}
|
|
2957
|
-
function
|
|
2937
|
+
function Fr(e, t, n) {
|
|
2958
2938
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
2959
2939
|
}
|
|
2960
|
-
function
|
|
2940
|
+
function Ir(e, t, n, r) {
|
|
2961
2941
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
2962
2942
|
}
|
|
2963
|
-
function
|
|
2943
|
+
function Lr(e, t) {
|
|
2964
2944
|
return {
|
|
2965
2945
|
height: `${e}px`,
|
|
2966
2946
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -2968,8 +2948,8 @@ function Rr(e, t) {
|
|
|
2968
2948
|
}
|
|
2969
2949
|
//#endregion
|
|
2970
2950
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
2971
|
-
var
|
|
2972
|
-
function
|
|
2951
|
+
var Rr = 250, zr = 1e3;
|
|
2952
|
+
function Br(e) {
|
|
2973
2953
|
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
|
|
2974
2954
|
x(() => {
|
|
2975
2955
|
y();
|
|
@@ -2985,7 +2965,7 @@ function Vr(e) {
|
|
|
2985
2965
|
function u(t) {
|
|
2986
2966
|
if (!b(t) || !e.isAtBoundary()) return;
|
|
2987
2967
|
let n = Date.now();
|
|
2988
|
-
n < s || (s = n +
|
|
2968
|
+
n < s || (s = n + Rr, m());
|
|
2989
2969
|
}
|
|
2990
2970
|
function d() {
|
|
2991
2971
|
if (!g()) return;
|
|
@@ -3019,7 +2999,7 @@ function Vr(e) {
|
|
|
3019
2999
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
3020
3000
|
}
|
|
3021
3001
|
function _() {
|
|
3022
|
-
o.value = !1, v(
|
|
3002
|
+
o.value = !1, v(zr);
|
|
3023
3003
|
}
|
|
3024
3004
|
function v(e) {
|
|
3025
3005
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -3042,42 +3022,42 @@ function Vr(e) {
|
|
|
3042
3022
|
}
|
|
3043
3023
|
//#endregion
|
|
3044
3024
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
3045
|
-
var
|
|
3046
|
-
function
|
|
3047
|
-
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth ||
|
|
3025
|
+
var Vr = 600, Hr = 24, Ur = 16, Wr = 300, Gr = 200, Kr = 200, qr = Hr + Ur, Jr = 200, Yr = 300, Xr = 24, Zr = 48, Qr = 500, $r = 1e3;
|
|
3026
|
+
function ei(e) {
|
|
3027
|
+
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Wr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(Wr, a.value - Hr * 2)), h = i(() => mr(m.value, Wr)), g = i(() => hr(m.value, h.value, Wr, Ur)), v = i(() => ti(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => vr({
|
|
3048
3028
|
itemCount: e.items.value.length,
|
|
3049
3029
|
viewportHeight: r.value,
|
|
3050
3030
|
scrollTop: n.value,
|
|
3051
|
-
overscanPx:
|
|
3052
|
-
bucketPx:
|
|
3031
|
+
overscanPx: Gr,
|
|
3032
|
+
bucketPx: Vr,
|
|
3053
3033
|
buckets: c.value
|
|
3054
3034
|
})), b = i(() => y.value.map((t) => ({
|
|
3055
3035
|
item: e.items.value[t],
|
|
3056
3036
|
index: t
|
|
3057
3037
|
}))), C = i(() => {
|
|
3058
|
-
let e = l.value +
|
|
3059
|
-
return Math.max(e, t, r.value) +
|
|
3060
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() =>
|
|
3038
|
+
let e = l.value + Hr * 2, t = d.value ?? 0;
|
|
3039
|
+
return Math.max(e, t, r.value) + Jr;
|
|
3040
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ri({
|
|
3061
3041
|
active: e.active.value,
|
|
3062
3042
|
maxScrollTop: se(),
|
|
3063
3043
|
progressDistancePx: n.value,
|
|
3064
|
-
thresholdPx:
|
|
3044
|
+
thresholdPx: Kr,
|
|
3065
3045
|
triggerEnabled: w.value
|
|
3066
|
-
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() =>
|
|
3046
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ni({
|
|
3067
3047
|
active: e.active.value,
|
|
3068
3048
|
maxScrollTop: se(),
|
|
3069
3049
|
progressDistancePx: n.value,
|
|
3070
|
-
thresholdPx:
|
|
3050
|
+
thresholdPx: qr,
|
|
3071
3051
|
triggerEnabled: e.hasPreviousPage.value
|
|
3072
|
-
})), k = i(() => Math.max(0, r.value -
|
|
3052
|
+
})), k = i(() => Math.max(0, r.value - Xr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
|
|
3073
3053
|
if (!A.value) return 0;
|
|
3074
3054
|
let e = r.value / C.value * k.value;
|
|
3075
|
-
return Math.min(k.value, Math.max(
|
|
3055
|
+
return Math.min(k.value, Math.max(Zr, e));
|
|
3076
3056
|
}), M = i(() => {
|
|
3077
|
-
if (!A.value) return
|
|
3057
|
+
if (!A.value) return Xr;
|
|
3078
3058
|
let e = Math.max(0, C.value - r.value);
|
|
3079
|
-
return
|
|
3080
|
-
}), N =
|
|
3059
|
+
return Xr + Math.max(0, k.value - j.value) * (e > 0 ? ti(n.value / e, 0, 1) : 0);
|
|
3060
|
+
}), N = jr({
|
|
3081
3061
|
items: e.items,
|
|
3082
3062
|
visibleIndices: y,
|
|
3083
3063
|
positions: o,
|
|
@@ -3086,27 +3066,27 @@ function ti(e) {
|
|
|
3086
3066
|
columnWidth: g,
|
|
3087
3067
|
scrollTop: n,
|
|
3088
3068
|
viewportHeight: r
|
|
3089
|
-
}), P =
|
|
3069
|
+
}), P = Br({
|
|
3090
3070
|
direction: "top",
|
|
3091
3071
|
getAnimationLockMs(e) {
|
|
3092
|
-
return Math.max(
|
|
3072
|
+
return Math.max(Qr, Or(e)) + $r;
|
|
3093
3073
|
},
|
|
3094
3074
|
hasPage: e.hasPreviousPage,
|
|
3095
3075
|
interactionLocked: p,
|
|
3096
3076
|
isAtBoundary() {
|
|
3097
|
-
return n.value <=
|
|
3077
|
+
return n.value <= qr;
|
|
3098
3078
|
},
|
|
3099
3079
|
loading: e.loading,
|
|
3100
3080
|
requestPage: e.requestPreviousPage
|
|
3101
|
-
}), F =
|
|
3081
|
+
}), F = Br({
|
|
3102
3082
|
direction: "bottom",
|
|
3103
3083
|
getAnimationLockMs(e) {
|
|
3104
|
-
return
|
|
3084
|
+
return Or(e) + $r;
|
|
3105
3085
|
},
|
|
3106
3086
|
hasPage: w,
|
|
3107
3087
|
interactionLocked: p,
|
|
3108
3088
|
isAtBoundary() {
|
|
3109
|
-
return oe() <=
|
|
3089
|
+
return oe() <= Kr;
|
|
3110
3090
|
},
|
|
3111
3091
|
loading: e.loading,
|
|
3112
3092
|
requestPage: e.requestNextPage
|
|
@@ -3116,7 +3096,7 @@ function ti(e) {
|
|
|
3116
3096
|
h,
|
|
3117
3097
|
g
|
|
3118
3098
|
], async ([t], [r = []]) => {
|
|
3119
|
-
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c =
|
|
3099
|
+
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = yr(a, u.value, o.value), l = X(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
|
|
3120
3100
|
let t = $(e);
|
|
3121
3101
|
if (f.has(t)) return [];
|
|
3122
3102
|
let n = c.get(t), r = l.get(t);
|
|
@@ -3125,8 +3105,8 @@ function ti(e) {
|
|
|
3125
3105
|
item: e,
|
|
3126
3106
|
position: n
|
|
3127
3107
|
}];
|
|
3128
|
-
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value >
|
|
3129
|
-
y && K(
|
|
3108
|
+
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Hr + Ur, b = h && n.value > Hr + Ur ? t[v.value] : null, x = b ? $(b) : null;
|
|
3109
|
+
y && K(kr() + $r), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? Qr : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
|
|
3130
3110
|
}, { immediate: !0 }), L([
|
|
3131
3111
|
() => e.pendingAppendItems.value.map((e) => $(e)),
|
|
3132
3112
|
h,
|
|
@@ -3143,7 +3123,7 @@ function ti(e) {
|
|
|
3143
3123
|
}
|
|
3144
3124
|
if (i !== !1 || f.value == null) return;
|
|
3145
3125
|
await _();
|
|
3146
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
3126
|
+
let o = Math.max(0, C.value - r.value), s = ti(f.value, 0, o);
|
|
3147
3127
|
a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
|
|
3148
3128
|
}), L(() => e.loading.value, async (t) => {
|
|
3149
3129
|
!t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
|
|
@@ -3155,16 +3135,16 @@ function ti(e) {
|
|
|
3155
3135
|
I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
|
|
3156
3136
|
});
|
|
3157
3137
|
function te() {
|
|
3158
|
-
let t =
|
|
3138
|
+
let t = _r(e.items.value, {
|
|
3159
3139
|
columnCount: h.value,
|
|
3160
3140
|
columnWidth: g.value,
|
|
3161
|
-
gapX:
|
|
3162
|
-
gapY:
|
|
3163
|
-
bucketPx:
|
|
3141
|
+
gapX: Ur,
|
|
3142
|
+
gapY: Ur,
|
|
3143
|
+
bucketPx: Vr
|
|
3164
3144
|
});
|
|
3165
3145
|
o.value = t.positions.map((e) => ({
|
|
3166
|
-
x: e.x +
|
|
3167
|
-
y: e.y +
|
|
3146
|
+
x: e.x + Hr,
|
|
3147
|
+
y: e.y + Hr
|
|
3168
3148
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
3169
3149
|
}
|
|
3170
3150
|
function V() {
|
|
@@ -3189,7 +3169,7 @@ function ti(e) {
|
|
|
3189
3169
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
3190
3170
|
if (!a || !c || !l) return;
|
|
3191
3171
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
3192
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
3172
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Hr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Hr), a.scrollTop = ti(u, 0, d), n.value = a.scrollTop, q();
|
|
3193
3173
|
}
|
|
3194
3174
|
function ne(e, r) {
|
|
3195
3175
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
@@ -3222,7 +3202,7 @@ function ti(e) {
|
|
|
3222
3202
|
e.setActiveIndex(i);
|
|
3223
3203
|
}
|
|
3224
3204
|
function re() {
|
|
3225
|
-
let t = n.value <=
|
|
3205
|
+
let t = n.value <= qr, r = oe() <= Kr;
|
|
3226
3206
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
3227
3207
|
}
|
|
3228
3208
|
function J() {
|
|
@@ -3232,29 +3212,29 @@ function ti(e) {
|
|
|
3232
3212
|
r.value = ie(), a.value = ae();
|
|
3233
3213
|
}
|
|
3234
3214
|
function ie() {
|
|
3235
|
-
return
|
|
3215
|
+
return Pr(t.value, r.value);
|
|
3236
3216
|
}
|
|
3237
3217
|
function ae() {
|
|
3238
|
-
return
|
|
3218
|
+
return Fr(t.value, a.value, Wr);
|
|
3239
3219
|
}
|
|
3240
3220
|
function oe() {
|
|
3241
|
-
return
|
|
3221
|
+
return Ir(t.value, n.value, r.value, C.value);
|
|
3242
3222
|
}
|
|
3243
3223
|
function se() {
|
|
3244
3224
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
3245
3225
|
return Math.max(0, e - r.value);
|
|
3246
3226
|
}
|
|
3247
3227
|
function ce() {
|
|
3248
|
-
return
|
|
3228
|
+
return Lr(j.value, M.value);
|
|
3249
3229
|
}
|
|
3250
3230
|
function le(e) {
|
|
3251
|
-
return e.length ?
|
|
3231
|
+
return e.length ? _r(e, {
|
|
3252
3232
|
columnCount: h.value,
|
|
3253
3233
|
columnWidth: g.value,
|
|
3254
|
-
gapX:
|
|
3255
|
-
gapY:
|
|
3256
|
-
bucketPx:
|
|
3257
|
-
}).contentHeight +
|
|
3234
|
+
gapX: Ur,
|
|
3235
|
+
gapY: Ur,
|
|
3236
|
+
bucketPx: Vr
|
|
3237
|
+
}).contentHeight + Hr * 2 : 0;
|
|
3258
3238
|
}
|
|
3259
3239
|
function X(e) {
|
|
3260
3240
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3276,7 +3256,7 @@ function ti(e) {
|
|
|
3276
3256
|
} finally {
|
|
3277
3257
|
d.value = null, ee = !1;
|
|
3278
3258
|
}
|
|
3279
|
-
},
|
|
3259
|
+
}, Yr));
|
|
3280
3260
|
}
|
|
3281
3261
|
function de() {
|
|
3282
3262
|
z &&= (clearTimeout(z), null);
|
|
@@ -3303,27 +3283,27 @@ function ti(e) {
|
|
|
3303
3283
|
scrollViewportRef: t
|
|
3304
3284
|
};
|
|
3305
3285
|
}
|
|
3306
|
-
function
|
|
3286
|
+
function ti(e, t, n) {
|
|
3307
3287
|
return Math.min(Math.max(e, t), n);
|
|
3308
3288
|
}
|
|
3309
|
-
function
|
|
3289
|
+
function ni(e) {
|
|
3310
3290
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3311
3291
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3312
|
-
return t <= 0 ? 1 :
|
|
3292
|
+
return t <= 0 ? 1 : ti(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
3313
3293
|
}
|
|
3314
|
-
function
|
|
3294
|
+
function ri(e) {
|
|
3315
3295
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3316
3296
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3317
|
-
return t <= 0 ? 1 :
|
|
3297
|
+
return t <= 0 ? 1 : ti(e.progressDistancePx / t, 0, 1);
|
|
3318
3298
|
}
|
|
3319
3299
|
//#endregion
|
|
3320
3300
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
3321
|
-
function
|
|
3301
|
+
function ii(e) {
|
|
3322
3302
|
if (e) try {
|
|
3323
3303
|
e.removeAttribute("src"), e.src = "";
|
|
3324
3304
|
} catch {}
|
|
3325
3305
|
}
|
|
3326
|
-
function
|
|
3306
|
+
function ai(e) {
|
|
3327
3307
|
if (e) {
|
|
3328
3308
|
try {
|
|
3329
3309
|
e.currentTime = 0;
|
|
@@ -3334,12 +3314,12 @@ function oi(e) {
|
|
|
3334
3314
|
} catch {}
|
|
3335
3315
|
}
|
|
3336
3316
|
}
|
|
3337
|
-
function
|
|
3317
|
+
function oi(e, t) {
|
|
3338
3318
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
3339
3319
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
3340
3320
|
return e.bottom > 0 && e.top < n;
|
|
3341
3321
|
}
|
|
3342
|
-
function
|
|
3322
|
+
function si(e) {
|
|
3343
3323
|
if (!e) return null;
|
|
3344
3324
|
try {
|
|
3345
3325
|
return new URL(e, window.location.href).href;
|
|
@@ -3349,9 +3329,9 @@ function ci(e) {
|
|
|
3349
3329
|
}
|
|
3350
3330
|
//#endregion
|
|
3351
3331
|
//#region src/components/viewer-core/listPreview.ts
|
|
3352
|
-
var
|
|
3353
|
-
function
|
|
3354
|
-
let t =
|
|
3332
|
+
var ci = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, li = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, ui = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3333
|
+
function di(e) {
|
|
3334
|
+
let t = fi(e), n = t?.url, r = pr(e), i = e.title?.trim() || kt(e.type);
|
|
3355
3335
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
3356
3336
|
kind: "video",
|
|
3357
3337
|
url: n,
|
|
@@ -3370,13 +3350,13 @@ function fi(e) {
|
|
|
3370
3350
|
width: r.width,
|
|
3371
3351
|
height: r.height,
|
|
3372
3352
|
label: i
|
|
3373
|
-
} : typeof n == "string" &&
|
|
3353
|
+
} : typeof n == "string" && mi(e, n) ? {
|
|
3374
3354
|
kind: "video",
|
|
3375
3355
|
url: n,
|
|
3376
3356
|
width: r.width,
|
|
3377
3357
|
height: r.height,
|
|
3378
3358
|
label: i
|
|
3379
|
-
} : typeof n == "string" &&
|
|
3359
|
+
} : typeof n == "string" && pi(e, n) ? {
|
|
3380
3360
|
kind: "image",
|
|
3381
3361
|
url: n,
|
|
3382
3362
|
width: r.width,
|
|
@@ -3390,26 +3370,26 @@ function fi(e) {
|
|
|
3390
3370
|
label: i
|
|
3391
3371
|
};
|
|
3392
3372
|
}
|
|
3393
|
-
function
|
|
3373
|
+
function fi(e) {
|
|
3394
3374
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3395
3375
|
}
|
|
3396
|
-
function
|
|
3397
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
3376
|
+
function pi(e, t) {
|
|
3377
|
+
return e.type !== "image" || typeof t != "string" ? !1 : ci.test(t) || hi(t);
|
|
3398
3378
|
}
|
|
3399
|
-
function
|
|
3400
|
-
return e.type !== "video" || typeof t != "string" ? !1 :
|
|
3379
|
+
function mi(e, t) {
|
|
3380
|
+
return e.type !== "video" || typeof t != "string" ? !1 : li.test(t) || gi(t);
|
|
3401
3381
|
}
|
|
3402
|
-
function
|
|
3382
|
+
function hi(e) {
|
|
3403
3383
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3404
3384
|
}
|
|
3405
|
-
function
|
|
3406
|
-
return
|
|
3385
|
+
function gi(e) {
|
|
3386
|
+
return ui.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3407
3387
|
}
|
|
3408
3388
|
//#endregion
|
|
3409
3389
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3410
|
-
function
|
|
3390
|
+
function _i(e) {
|
|
3411
3391
|
let t = D(null), n = i(() => {
|
|
3412
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3392
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? si(e.item.value.healthCheck.url) : null;
|
|
3413
3393
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3414
3394
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3415
3395
|
L(n, (e, n) => {
|
|
@@ -3451,7 +3431,7 @@ function vi(e) {
|
|
|
3451
3431
|
return;
|
|
3452
3432
|
}
|
|
3453
3433
|
let i = ++a;
|
|
3454
|
-
|
|
3434
|
+
sn(r).then((s) => {
|
|
3455
3435
|
if (!(i !== a || n.value !== r)) {
|
|
3456
3436
|
if (o.set(r, s ?? null), !s) {
|
|
3457
3437
|
t.value = null;
|
|
@@ -3487,14 +3467,14 @@ function vi(e) {
|
|
|
3487
3467
|
}
|
|
3488
3468
|
//#endregion
|
|
3489
3469
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3490
|
-
var
|
|
3470
|
+
var vi = ["aria-label"], yi = {
|
|
3491
3471
|
key: 0,
|
|
3492
3472
|
"data-testid": "vibe-list-card-spinner",
|
|
3493
3473
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3494
|
-
},
|
|
3474
|
+
}, bi = { 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]" }, xi = ["src", "alt"], Si = ["src"], Ci = ["data-kind"], wi = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ti = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Ei = {
|
|
3495
3475
|
key: 4,
|
|
3496
3476
|
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))]"
|
|
3497
|
-
},
|
|
3477
|
+
}, Di = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Oi = { class: "pointer-events-none absolute inset-0 z-[3]" }, ki = /* @__PURE__ */ d({
|
|
3498
3478
|
__name: "ListCard",
|
|
3499
3479
|
props: {
|
|
3500
3480
|
active: {
|
|
@@ -3518,7 +3498,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3518
3498
|
},
|
|
3519
3499
|
emits: ["open"],
|
|
3520
3500
|
setup(e, { emit: t }) {
|
|
3521
|
-
let n = e, r = t, l = i(() =>
|
|
3501
|
+
let n = e, r = t, l = i(() => di(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = _i({
|
|
3522
3502
|
attachedAssetUrl: E,
|
|
3523
3503
|
getPriority: X,
|
|
3524
3504
|
isInView: d,
|
|
@@ -3527,7 +3507,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3527
3507
|
loadErrorKind: g,
|
|
3528
3508
|
reportAssetError: n.reportAssetError,
|
|
3529
3509
|
surfaceActive: i(() => n.surfaceActive)
|
|
3530
|
-
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() =>
|
|
3510
|
+
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => an(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
|
|
3531
3511
|
L([E, () => l.value.kind], () => {
|
|
3532
3512
|
let e = l.value.kind === "fallback";
|
|
3533
3513
|
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
@@ -3568,7 +3548,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3568
3548
|
if (!ue(_.value)) return;
|
|
3569
3549
|
let e = E.value ?? n.item.url;
|
|
3570
3550
|
m.value = !1, g.value = "generic";
|
|
3571
|
-
let t = await
|
|
3551
|
+
let t = await on(e);
|
|
3572
3552
|
g.value = t, n.reportAssetError?.({
|
|
3573
3553
|
item: n.item,
|
|
3574
3554
|
occurrenceKey: $(n.item),
|
|
@@ -3617,7 +3597,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3617
3597
|
return;
|
|
3618
3598
|
}
|
|
3619
3599
|
if (E.value && d.value && m.value) {
|
|
3620
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
3600
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, un(e);
|
|
3621
3601
|
return;
|
|
3622
3602
|
}
|
|
3623
3603
|
try {
|
|
@@ -3638,7 +3618,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3638
3618
|
d.value = !0;
|
|
3639
3619
|
return;
|
|
3640
3620
|
}
|
|
3641
|
-
d.value =
|
|
3621
|
+
d.value = oi(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3642
3622
|
}
|
|
3643
3623
|
function ie(e) {
|
|
3644
3624
|
if (!e) return;
|
|
@@ -3658,10 +3638,10 @@ var yi = ["aria-label"], bi = {
|
|
|
3658
3638
|
}), g.value = null, m.value = !1, T.value = !1, J(), K();
|
|
3659
3639
|
}
|
|
3660
3640
|
function se() {
|
|
3661
|
-
|
|
3641
|
+
ii(_.value);
|
|
3662
3642
|
}
|
|
3663
3643
|
function ce() {
|
|
3664
|
-
|
|
3644
|
+
ai(C.value);
|
|
3665
3645
|
}
|
|
3666
3646
|
function X() {
|
|
3667
3647
|
let e = y.value;
|
|
@@ -3675,8 +3655,8 @@ var yi = ["aria-label"], bi = {
|
|
|
3675
3655
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3676
3656
|
}
|
|
3677
3657
|
function ue(e) {
|
|
3678
|
-
let t =
|
|
3679
|
-
return !e || !t ? !1 :
|
|
3658
|
+
let t = si(E.value);
|
|
3659
|
+
return !e || !t ? !1 : si("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3680
3660
|
}
|
|
3681
3661
|
function de() {
|
|
3682
3662
|
r("open");
|
|
@@ -3704,8 +3684,8 @@ var yi = ["aria-label"], bi = {
|
|
|
3704
3684
|
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]",
|
|
3705
3685
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3706
3686
|
onClick: de
|
|
3707
|
-
}, null, 8,
|
|
3708
|
-
B.value ? (w(), s("div",
|
|
3687
|
+
}, null, 8, vi),
|
|
3688
|
+
B.value ? (w(), s("div", yi, [c("span", bi, [u(N(oe), {
|
|
3709
3689
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3710
3690
|
"aria-hidden": "true"
|
|
3711
3691
|
})])])) : o("", !0),
|
|
@@ -3719,7 +3699,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3719
3699
|
class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3720
3700
|
onLoad: U,
|
|
3721
3701
|
onError: W
|
|
3722
|
-
}, null, 42,
|
|
3702
|
+
}, null, 42, xi)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3723
3703
|
key: 2,
|
|
3724
3704
|
ref_key: "videoRef",
|
|
3725
3705
|
ref: C,
|
|
@@ -3735,31 +3715,31 @@ var yi = ["aria-label"], bi = {
|
|
|
3735
3715
|
onPlaying: ne,
|
|
3736
3716
|
onStalled: G,
|
|
3737
3717
|
onWaiting: G
|
|
3738
|
-
}, null, 42,
|
|
3718
|
+
}, null, 42, Si)) : R.value ? (w(), s("div", {
|
|
3739
3719
|
key: 3,
|
|
3740
3720
|
"data-testid": "vibe-list-card-error",
|
|
3741
3721
|
"data-kind": I.value,
|
|
3742
3722
|
class: "pointer-events-none relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
|
|
3743
|
-
}, [c("div",
|
|
3723
|
+
}, [c("div", wi, [
|
|
3744
3724
|
u(N(le), {
|
|
3745
3725
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3746
3726
|
"aria-hidden": "true"
|
|
3747
3727
|
}),
|
|
3748
|
-
c("span",
|
|
3728
|
+
c("span", Ti, j(N(rn)(I.value)), 1),
|
|
3749
3729
|
z.value ? (w(), s("button", {
|
|
3750
3730
|
key: 0,
|
|
3751
3731
|
type: "button",
|
|
3752
3732
|
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",
|
|
3753
3733
|
onClick: ee(ae, ["stop"])
|
|
3754
3734
|
}, " Retry ")) : o("", !0)
|
|
3755
|
-
])], 8,
|
|
3735
|
+
])], 8, Ci)) : (w(), s("div", Ei, [c("div", Di, [k(e.$slots, "item-icon", {
|
|
3756
3736
|
icon: N(Ot)(n.item.type),
|
|
3757
3737
|
item: n.item
|
|
3758
3738
|
}, () => [(w(), a(A(N(Ot)(n.item.type)), {
|
|
3759
3739
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3760
3740
|
"aria-hidden": "true"
|
|
3761
3741
|
}))])])])),
|
|
3762
|
-
c("div",
|
|
3742
|
+
c("div", Oi, [k(e.$slots, "grid-item-overlay", {
|
|
3763
3743
|
active: n.active,
|
|
3764
3744
|
focused: f.value,
|
|
3765
3745
|
hovered: p.value,
|
|
@@ -3769,24 +3749,24 @@ var yi = ["aria-label"], bi = {
|
|
|
3769
3749
|
})])
|
|
3770
3750
|
], 34));
|
|
3771
3751
|
}
|
|
3772
|
-
}),
|
|
3752
|
+
}), Ai = { 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)]" }, ji = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Mi = {
|
|
3773
3753
|
"data-testid": "vibe-pagination",
|
|
3774
3754
|
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]"
|
|
3775
|
-
},
|
|
3755
|
+
}, Ni = { class: "whitespace-nowrap" }, Pi = {
|
|
3776
3756
|
key: 0,
|
|
3777
3757
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3778
|
-
},
|
|
3758
|
+
}, Fi = [
|
|
3779
3759
|
"data-active",
|
|
3780
3760
|
"data-index",
|
|
3781
3761
|
"data-item-id",
|
|
3782
3762
|
"data-occurrence-key"
|
|
3783
|
-
],
|
|
3763
|
+
], Ii = ["data-item-id"], Li = {
|
|
3784
3764
|
key: 0,
|
|
3785
3765
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3786
|
-
},
|
|
3766
|
+
}, Ri = {
|
|
3787
3767
|
key: 1,
|
|
3788
3768
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3789
|
-
},
|
|
3769
|
+
}, zi = { class: "mx-auto flex w-full justify-center" }, Bi = /* @__PURE__ */ d({
|
|
3790
3770
|
__name: "ListSurface",
|
|
3791
3771
|
props: {
|
|
3792
3772
|
active: {
|
|
@@ -3847,7 +3827,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3847
3827
|
"update:activeIndex"
|
|
3848
3828
|
],
|
|
3849
3829
|
setup(e, { emit: n }) {
|
|
3850
|
-
let r = e, d = F(), f = n, p =
|
|
3830
|
+
let r = e, d = F(), f = n, p = ei({
|
|
3851
3831
|
active: M(r, "active"),
|
|
3852
3832
|
allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
|
|
3853
3833
|
items: M(r, "items"),
|
|
@@ -3863,11 +3843,11 @@ var yi = ["aria-label"], bi = {
|
|
|
3863
3843
|
setActiveIndex(e) {
|
|
3864
3844
|
f("update:activeIndex", e);
|
|
3865
3845
|
}
|
|
3866
|
-
}), m = i(() =>
|
|
3846
|
+
}), m = i(() => Jt({
|
|
3867
3847
|
itemCount: r.items.length,
|
|
3868
3848
|
loading: r.loading,
|
|
3869
3849
|
phase: r.phase
|
|
3870
|
-
})), h = i(() =>
|
|
3850
|
+
})), h = i(() => Yt({
|
|
3871
3851
|
errorMessage: r.errorMessage,
|
|
3872
3852
|
hasItems: r.items.length > 0,
|
|
3873
3853
|
hasNextPage: r.hasNextPage,
|
|
@@ -3880,7 +3860,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3880
3860
|
message: h.value.message,
|
|
3881
3861
|
paginationDetail: r.paginationDetail,
|
|
3882
3862
|
total: r.items.length
|
|
3883
|
-
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() =>
|
|
3863
|
+
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => Ut(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Kt({
|
|
3884
3864
|
emptyStateMode: M(r, "emptyStateMode"),
|
|
3885
3865
|
itemCount: C,
|
|
3886
3866
|
loading: M(r, "loading"),
|
|
@@ -3892,8 +3872,8 @@ var yi = ["aria-label"], bi = {
|
|
|
3892
3872
|
nextBoundaryLoadProgress: e,
|
|
3893
3873
|
previousBoundaryLoadProgress: t
|
|
3894
3874
|
});
|
|
3895
|
-
}, { immediate: !0 }), (e, n) => (w(), s("div",
|
|
3896
|
-
c("div",
|
|
3875
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", Ai, [
|
|
3876
|
+
c("div", ji, [c("span", Mi, [c("span", Ni, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Pi, j(r.paginationDetail), 1)) : o("", !0)])]),
|
|
3897
3877
|
c("div", {
|
|
3898
3878
|
ref: N(p).scrollViewportRef,
|
|
3899
3879
|
"data-testid": "vibe-list-scroll",
|
|
@@ -3914,7 +3894,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3914
3894
|
"data-occurrence-key": N($)(t),
|
|
3915
3895
|
class: "absolute will-change-transform",
|
|
3916
3896
|
style: b(N(p).getCardStyle(n))
|
|
3917
|
-
}, [u(
|
|
3897
|
+
}, [u(ki, {
|
|
3918
3898
|
active: n === N(p).resolvedActiveIndex.value,
|
|
3919
3899
|
index: n,
|
|
3920
3900
|
item: t,
|
|
@@ -3938,14 +3918,14 @@ var yi = ["aria-label"], bi = {
|
|
|
3938
3918
|
"report-asset-load",
|
|
3939
3919
|
"surface-active",
|
|
3940
3920
|
"onOpen"
|
|
3941
|
-
])], 12,
|
|
3921
|
+
])], 12, Fi))), 128)),
|
|
3942
3922
|
(w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
|
|
3943
3923
|
key: `leaving-${N($)(t.item)}`,
|
|
3944
3924
|
"data-testid": "vibe-list-card-leaving",
|
|
3945
3925
|
"data-item-id": t.item.id,
|
|
3946
3926
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
3947
3927
|
style: b(N(p).getLeavingCardStyle(t.item))
|
|
3948
|
-
}, [u(
|
|
3928
|
+
}, [u(ki, {
|
|
3949
3929
|
active: !1,
|
|
3950
3930
|
index: -1,
|
|
3951
3931
|
item: t.item,
|
|
@@ -3960,8 +3940,8 @@ var yi = ["aria-label"], bi = {
|
|
|
3960
3940
|
"item",
|
|
3961
3941
|
"report-asset-error",
|
|
3962
3942
|
"report-asset-load"
|
|
3963
|
-
])], 12,
|
|
3964
|
-
N(A) && N(T) ? (w(), a(
|
|
3943
|
+
])], 12, Ii))), 128)),
|
|
3944
|
+
N(A) && N(T) ? (w(), a(On, {
|
|
3965
3945
|
key: 0,
|
|
3966
3946
|
message: N(T).message,
|
|
3967
3947
|
mode: N(T).mode,
|
|
@@ -3975,12 +3955,12 @@ var yi = ["aria-label"], bi = {
|
|
|
3975
3955
|
"surface"
|
|
3976
3956
|
])) : o("", !0)
|
|
3977
3957
|
], 4)], 544),
|
|
3978
|
-
N(p).showScrollbar.value ? (w(), s("div",
|
|
3958
|
+
N(p).showScrollbar.value ? (w(), s("div", Li, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
3979
3959
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
3980
3960
|
class: v(["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"]),
|
|
3981
3961
|
style: b(N(p).getScrollbarThumbStyle())
|
|
3982
3962
|
}, null, 6)])) : o("", !0),
|
|
3983
|
-
d["grid-footer"] ? (w(), s("div",
|
|
3963
|
+
d["grid-footer"] ? (w(), s("div", Ri, [c("div", zi, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
3984
3964
|
_.value ? (w(), s("div", {
|
|
3985
3965
|
key: 2,
|
|
3986
3966
|
class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
|
|
@@ -3989,7 +3969,7 @@ var yi = ["aria-label"], bi = {
|
|
|
3989
3969
|
"data-testid": "vibe-grid-status-badge",
|
|
3990
3970
|
class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", _.value.kind === "end" ? "border-amber-300/35 text-amber-200" : _.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
3991
3971
|
}, j(_.value.message), 3))], 2)) : o("", !0),
|
|
3992
|
-
N(E) && N(T) ? (w(), a(
|
|
3972
|
+
N(E) && N(T) ? (w(), a(On, {
|
|
3993
3973
|
key: 3,
|
|
3994
3974
|
class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
3995
3975
|
message: N(T).message,
|
|
@@ -4006,13 +3986,13 @@ var yi = ["aria-label"], bi = {
|
|
|
4006
3986
|
])) : o("", !0)
|
|
4007
3987
|
]));
|
|
4008
3988
|
}
|
|
4009
|
-
}),
|
|
3989
|
+
}), Vi = ["data-surface-mode"], Hi = {
|
|
4010
3990
|
key: 1,
|
|
4011
3991
|
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"
|
|
4012
|
-
},
|
|
3992
|
+
}, Ui = ["data-visible", "inert"], Wi = ["data-visible", "inert"], Gi = {
|
|
4013
3993
|
key: 3,
|
|
4014
3994
|
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"
|
|
4015
|
-
},
|
|
3995
|
+
}, Ki = /* @__PURE__ */ d({
|
|
4016
3996
|
name: "VibeLayout",
|
|
4017
3997
|
__name: "Layout",
|
|
4018
3998
|
props: {
|
|
@@ -4066,7 +4046,7 @@ var yi = ["aria-label"], bi = {
|
|
|
4066
4046
|
type: "button",
|
|
4067
4047
|
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",
|
|
4068
4048
|
onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
|
|
4069
|
-
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div",
|
|
4049
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Hi, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
4070
4050
|
appear: "",
|
|
4071
4051
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
4072
4052
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -4080,7 +4060,7 @@ var yi = ["aria-label"], bi = {
|
|
|
4080
4060
|
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
4081
4061
|
inert: N(h).surfaceMode.value !== "list",
|
|
4082
4062
|
class: "absolute inset-0 z-[2]"
|
|
4083
|
-
}, [u(
|
|
4063
|
+
}, [u(Bi, {
|
|
4084
4064
|
active: N(h).surfaceMode.value === "list",
|
|
4085
4065
|
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
4086
4066
|
items: N(h).items.value,
|
|
@@ -4150,7 +4130,7 @@ var yi = ["aria-label"], bi = {
|
|
|
4150
4130
|
"onBoundaryLoadProgress",
|
|
4151
4131
|
"onOpenFullscreen",
|
|
4152
4132
|
"onUpdate:activeIndex"
|
|
4153
|
-
])], 8,
|
|
4133
|
+
])], 8, Ui), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
4154
4134
|
_: 3
|
|
4155
4135
|
}), u(r, {
|
|
4156
4136
|
appear: "",
|
|
@@ -4166,7 +4146,7 @@ var yi = ["aria-label"], bi = {
|
|
|
4166
4146
|
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4167
4147
|
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
4168
4148
|
class: "absolute inset-0 z-[3]"
|
|
4169
|
-
}, [u(
|
|
4149
|
+
}, [u(ur, {
|
|
4170
4150
|
items: N(h).items.value,
|
|
4171
4151
|
active: N(h).surfaceMode.value === "fullscreen",
|
|
4172
4152
|
"active-index": N(h).activeIndex.value,
|
|
@@ -4235,12 +4215,12 @@ var yi = ["aria-label"], bi = {
|
|
|
4235
4215
|
"show-back-to-list",
|
|
4236
4216
|
"onBackToList",
|
|
4237
4217
|
"onUpdate:activeIndex"
|
|
4238
|
-
])], 8,
|
|
4218
|
+
])], 8, Wi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
4239
4219
|
_: 3
|
|
4240
|
-
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div",
|
|
4220
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Gi, [u(N(oe), {
|
|
4241
4221
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
4242
4222
|
"aria-hidden": "true"
|
|
4243
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(
|
|
4223
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(ur, {
|
|
4244
4224
|
key: 4,
|
|
4245
4225
|
items: N(h).items.value,
|
|
4246
4226
|
active: !0,
|
|
@@ -4308,10 +4288,10 @@ var yi = ["aria-label"], bi = {
|
|
|
4308
4288
|
"show-status-badges",
|
|
4309
4289
|
"onBackToList",
|
|
4310
4290
|
"onUpdate:activeIndex"
|
|
4311
|
-
]))], 8,
|
|
4291
|
+
]))], 8, Vi));
|
|
4312
4292
|
}
|
|
4313
|
-
}),
|
|
4314
|
-
e.component("VibeLayout",
|
|
4293
|
+
}), qi = { install(e) {
|
|
4294
|
+
e.component("VibeLayout", Ki);
|
|
4315
4295
|
} };
|
|
4316
4296
|
//#endregion
|
|
4317
|
-
export {
|
|
4297
|
+
export { Ki as VibeLayout, qi as VibePlugin, qi as default };
|