@wyxos/vibe 3.1.19 → 3.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/viewer-core/useAssetLoadQueue.d.ts +1 -6
- package/lib/index.cjs +1 -1
- package/lib/index.js +347 -371
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1246,58 +1246,45 @@ function Pt(e) {
|
|
|
1246
1246
|
}
|
|
1247
1247
|
//#endregion
|
|
1248
1248
|
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
function i(e) {
|
|
1257
|
-
let i = {
|
|
1258
|
-
...e,
|
|
1259
|
-
domain: zt(e.url),
|
|
1260
|
-
enqueuedAt: r,
|
|
1261
|
-
id: `vibe-asset-load-${r += 1}`
|
|
1249
|
+
function Ft() {
|
|
1250
|
+
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = 0;
|
|
1251
|
+
function r(r) {
|
|
1252
|
+
let a = {
|
|
1253
|
+
...r,
|
|
1254
|
+
enqueuedAt: n,
|
|
1255
|
+
id: `vibe-asset-load-${n += 1}`
|
|
1262
1256
|
};
|
|
1263
|
-
return
|
|
1257
|
+
return t.set(a.id, a), i(), {
|
|
1264
1258
|
cancel() {
|
|
1265
|
-
(
|
|
1259
|
+
(t.delete(a.id) || e.delete(a.id)) && i();
|
|
1266
1260
|
},
|
|
1267
1261
|
refresh() {
|
|
1268
|
-
|
|
1262
|
+
i();
|
|
1269
1263
|
},
|
|
1270
1264
|
release() {
|
|
1271
|
-
(
|
|
1265
|
+
(e.delete(a.id) || t.delete(a.id)) && i();
|
|
1272
1266
|
}
|
|
1273
1267
|
};
|
|
1274
1268
|
}
|
|
1275
|
-
function
|
|
1276
|
-
if (
|
|
1277
|
-
let
|
|
1278
|
-
let n =
|
|
1269
|
+
function i() {
|
|
1270
|
+
if (t.size === 0) return;
|
|
1271
|
+
let n = [...t.values()].sort((e, t) => {
|
|
1272
|
+
let n = Lt(e) - Lt(t);
|
|
1279
1273
|
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
1280
1274
|
});
|
|
1281
|
-
for (let
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
} catch {
|
|
1288
|
-
t.delete(i.id);
|
|
1289
|
-
}
|
|
1275
|
+
for (let r of n) {
|
|
1276
|
+
t.delete(r.id), e.set(r.id, r);
|
|
1277
|
+
try {
|
|
1278
|
+
r.onGrant();
|
|
1279
|
+
} catch {
|
|
1280
|
+
e.delete(r.id);
|
|
1290
1281
|
}
|
|
1291
1282
|
}
|
|
1292
1283
|
}
|
|
1293
|
-
|
|
1294
|
-
let r = [...t.values()].filter((e) => e.domain === n.domain);
|
|
1295
|
-
return !(r.length >= e.maxPerDomain || n.assetType === "video" && r.filter((e) => e.assetType === "video").length >= e.maxVideoPerDomain);
|
|
1296
|
-
}
|
|
1297
|
-
return { request: i };
|
|
1284
|
+
return { request: r };
|
|
1298
1285
|
}
|
|
1299
|
-
var
|
|
1300
|
-
function
|
|
1286
|
+
var It = Ft();
|
|
1287
|
+
function Lt(e) {
|
|
1301
1288
|
try {
|
|
1302
1289
|
let t = e.getPriority();
|
|
1303
1290
|
return Number.isFinite(t) ? t : Infinity;
|
|
@@ -1305,32 +1292,21 @@ function Rt(e) {
|
|
|
1305
1292
|
return Infinity;
|
|
1306
1293
|
}
|
|
1307
1294
|
}
|
|
1308
|
-
function zt(e) {
|
|
1309
|
-
try {
|
|
1310
|
-
return new URL(e).hostname || "local";
|
|
1311
|
-
} catch {
|
|
1312
|
-
return "local";
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
1295
|
//#endregion
|
|
1316
1296
|
//#region src/components/viewer-core/useFullscreenPreloadController.ts
|
|
1317
|
-
var
|
|
1297
|
+
var Rt = [
|
|
1318
1298
|
0,
|
|
1319
1299
|
1,
|
|
1320
1300
|
2,
|
|
1321
1301
|
3
|
|
1322
|
-
],
|
|
1302
|
+
], zt = {
|
|
1323
1303
|
0: 0,
|
|
1324
1304
|
1: 1,
|
|
1325
1305
|
2: 2,
|
|
1326
1306
|
3: 3
|
|
1327
1307
|
};
|
|
1328
|
-
function
|
|
1329
|
-
let t = D({}), n =
|
|
1330
|
-
maxGlobal: 3,
|
|
1331
|
-
maxPerDomain: 3,
|
|
1332
|
-
maxVideoPerDomain: 3
|
|
1333
|
-
}), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
1308
|
+
function Bt(e) {
|
|
1309
|
+
let t = D({}), n = Ft(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
1334
1310
|
L([
|
|
1335
1311
|
e.active,
|
|
1336
1312
|
e.items,
|
|
@@ -1351,14 +1327,14 @@ function Ht(e) {
|
|
|
1351
1327
|
}
|
|
1352
1328
|
function l(e, t) {
|
|
1353
1329
|
if (t instanceof HTMLImageElement) {
|
|
1354
|
-
i.set(e, t),
|
|
1330
|
+
i.set(e, t), Ht(t) && d(e);
|
|
1355
1331
|
return;
|
|
1356
1332
|
}
|
|
1357
1333
|
i.delete(e);
|
|
1358
1334
|
}
|
|
1359
1335
|
function u(e, t) {
|
|
1360
1336
|
if (t instanceof HTMLMediaElement) {
|
|
1361
|
-
a.set(e, t),
|
|
1337
|
+
a.set(e, t), Ut(t) && d(e);
|
|
1362
1338
|
return;
|
|
1363
1339
|
}
|
|
1364
1340
|
a.delete(e);
|
|
@@ -1399,7 +1375,7 @@ function Ht(e) {
|
|
|
1399
1375
|
assetType: s.item.type === "image" ? "image" : "video",
|
|
1400
1376
|
getPriority: () => g(o.index),
|
|
1401
1377
|
onGrant: () => {
|
|
1402
|
-
y(s.key, !0), (e.isAssetReady(s.key, s.item) ||
|
|
1378
|
+
y(s.key, !0), (e.isAssetReady(s.key, s.item) || Vt(s.key, i, a)) && d(s.key);
|
|
1403
1379
|
},
|
|
1404
1380
|
url: s.item.url
|
|
1405
1381
|
})
|
|
@@ -1410,14 +1386,14 @@ function Ht(e) {
|
|
|
1410
1386
|
}
|
|
1411
1387
|
function h() {
|
|
1412
1388
|
let t = e.resolvedActiveIndex.value;
|
|
1413
|
-
return
|
|
1389
|
+
return Rt.map((e) => _(t + e)).filter((e) => !!e);
|
|
1414
1390
|
}
|
|
1415
1391
|
function g(t) {
|
|
1416
|
-
return e.active.value ?
|
|
1392
|
+
return e.active.value ? zt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1417
1393
|
}
|
|
1418
1394
|
function _(t) {
|
|
1419
1395
|
let n = e.items.value[t];
|
|
1420
|
-
return !n || !
|
|
1396
|
+
return !n || !Wt(n) ? null : {
|
|
1421
1397
|
index: t,
|
|
1422
1398
|
item: n,
|
|
1423
1399
|
key: e.getItemKey(n)
|
|
@@ -1466,26 +1442,26 @@ function Ht(e) {
|
|
|
1466
1442
|
shouldAttachSlideAsset: s
|
|
1467
1443
|
};
|
|
1468
1444
|
}
|
|
1469
|
-
function
|
|
1445
|
+
function Vt(e, t, n) {
|
|
1470
1446
|
let r = t.get(e);
|
|
1471
|
-
if (r) return
|
|
1447
|
+
if (r) return Ht(r);
|
|
1472
1448
|
let i = n.get(e);
|
|
1473
|
-
return i ?
|
|
1449
|
+
return i ? Ut(i) : !1;
|
|
1474
1450
|
}
|
|
1475
|
-
function
|
|
1451
|
+
function Ht(e) {
|
|
1476
1452
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1477
1453
|
}
|
|
1478
|
-
function
|
|
1454
|
+
function Ut(e) {
|
|
1479
1455
|
let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
1480
1456
|
return e.readyState >= t;
|
|
1481
1457
|
}
|
|
1482
|
-
function
|
|
1458
|
+
function Wt(e) {
|
|
1483
1459
|
return e.type === "image" || e.type === "video" || e.type === "audio";
|
|
1484
1460
|
}
|
|
1485
1461
|
//#endregion
|
|
1486
1462
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
1487
|
-
function
|
|
1488
|
-
let t =
|
|
1463
|
+
function Gt(e) {
|
|
1464
|
+
let t = Bt({
|
|
1489
1465
|
active: e.active,
|
|
1490
1466
|
getItemKey: r,
|
|
1491
1467
|
isAssetReady: m,
|
|
@@ -1558,11 +1534,11 @@ function qt(e) {
|
|
|
1558
1534
|
}
|
|
1559
1535
|
//#endregion
|
|
1560
1536
|
//#region src/components/viewer-core/slotContent.ts
|
|
1561
|
-
function
|
|
1537
|
+
function Kt(e) {
|
|
1562
1538
|
if (!Array.isArray(e)) return !1;
|
|
1563
1539
|
for (let t of e) {
|
|
1564
1540
|
if (Array.isArray(t)) {
|
|
1565
|
-
if (
|
|
1541
|
+
if (Kt(t)) return !0;
|
|
1566
1542
|
continue;
|
|
1567
1543
|
}
|
|
1568
1544
|
if (!h(t)) {
|
|
@@ -1573,20 +1549,20 @@ function Jt(e) {
|
|
|
1573
1549
|
if (t != null && t !== !1) return !0;
|
|
1574
1550
|
continue;
|
|
1575
1551
|
}
|
|
1576
|
-
if (!
|
|
1552
|
+
if (!qt(t)) return !0;
|
|
1577
1553
|
}
|
|
1578
1554
|
return !1;
|
|
1579
1555
|
}
|
|
1580
|
-
function
|
|
1581
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1556
|
+
function qt(r) {
|
|
1557
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Kt(r.children) : !1;
|
|
1582
1558
|
}
|
|
1583
1559
|
//#endregion
|
|
1584
1560
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1585
|
-
var
|
|
1586
|
-
function
|
|
1561
|
+
var Jt = "no items available";
|
|
1562
|
+
function Yt(e) {
|
|
1587
1563
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1588
1564
|
loading: !!e.loading.value,
|
|
1589
|
-
message:
|
|
1565
|
+
message: Jt,
|
|
1590
1566
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1591
1567
|
surface: e.surface,
|
|
1592
1568
|
total: e.itemCount.value
|
|
@@ -1594,23 +1570,23 @@ function Zt(e) {
|
|
|
1594
1570
|
return {
|
|
1595
1571
|
emptyStateProps: t,
|
|
1596
1572
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1597
|
-
showCustomEmptyState: i(() =>
|
|
1573
|
+
showCustomEmptyState: i(() => Kt(n.value)),
|
|
1598
1574
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1599
1575
|
};
|
|
1600
1576
|
}
|
|
1601
1577
|
//#endregion
|
|
1602
1578
|
//#region src/components/viewer-core/format.ts
|
|
1603
|
-
function
|
|
1579
|
+
function Xt(e) {
|
|
1604
1580
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1605
1581
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1606
1582
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1607
1583
|
}
|
|
1608
1584
|
//#endregion
|
|
1609
1585
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1610
|
-
function
|
|
1586
|
+
function Zt(e) {
|
|
1611
1587
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1612
1588
|
}
|
|
1613
|
-
function
|
|
1589
|
+
function Qt(e) {
|
|
1614
1590
|
return e.phase === "failed" ? {
|
|
1615
1591
|
kind: "failed",
|
|
1616
1592
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1633,7 +1609,7 @@ function en(e) {
|
|
|
1633
1609
|
}
|
|
1634
1610
|
//#endregion
|
|
1635
1611
|
//#region src/components/viewer-core/useActivation.ts
|
|
1636
|
-
function
|
|
1612
|
+
function $t(e) {
|
|
1637
1613
|
let t = !1;
|
|
1638
1614
|
L(e.enabled, async (t) => {
|
|
1639
1615
|
if (n(t), t) {
|
|
@@ -1656,7 +1632,7 @@ function tn(e) {
|
|
|
1656
1632
|
}
|
|
1657
1633
|
//#endregion
|
|
1658
1634
|
//#region src/components/viewer-core/assetState.ts
|
|
1659
|
-
var
|
|
1635
|
+
var en = {
|
|
1660
1636
|
currentTime: 0,
|
|
1661
1637
|
duration: 0,
|
|
1662
1638
|
errorKind: null,
|
|
@@ -1665,38 +1641,38 @@ var nn = {
|
|
|
1665
1641
|
ready: !1,
|
|
1666
1642
|
volume: 1
|
|
1667
1643
|
};
|
|
1668
|
-
function
|
|
1669
|
-
return { ...
|
|
1644
|
+
function tn() {
|
|
1645
|
+
return { ...en };
|
|
1670
1646
|
}
|
|
1671
|
-
function
|
|
1647
|
+
function nn(e) {
|
|
1672
1648
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1673
1649
|
}
|
|
1674
|
-
function
|
|
1675
|
-
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 =
|
|
1650
|
+
function rn(e, t, n) {
|
|
1651
|
+
e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = an(t, n);
|
|
1676
1652
|
}
|
|
1677
|
-
function
|
|
1653
|
+
function an(e, t) {
|
|
1678
1654
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1679
1655
|
}
|
|
1680
1656
|
//#endregion
|
|
1681
1657
|
//#region src/components/viewer-core/loadError.ts
|
|
1682
|
-
var
|
|
1683
|
-
function
|
|
1658
|
+
var on = /* @__PURE__ */ new Map();
|
|
1659
|
+
function sn(e) {
|
|
1684
1660
|
return e === "not-found" ? "404" : "Load error";
|
|
1685
1661
|
}
|
|
1686
|
-
function
|
|
1662
|
+
function cn(e) {
|
|
1687
1663
|
return e === "generic";
|
|
1688
1664
|
}
|
|
1689
|
-
function
|
|
1690
|
-
return
|
|
1665
|
+
function ln(e) {
|
|
1666
|
+
return un(e).then((e) => e ?? "generic");
|
|
1691
1667
|
}
|
|
1692
|
-
function
|
|
1693
|
-
let t =
|
|
1668
|
+
function un(e) {
|
|
1669
|
+
let t = on.get(e);
|
|
1694
1670
|
if (t) return t;
|
|
1695
|
-
let n =
|
|
1696
|
-
return
|
|
1671
|
+
let n = dn(e);
|
|
1672
|
+
return on.set(e, n), n;
|
|
1697
1673
|
}
|
|
1698
|
-
async function
|
|
1699
|
-
if (!
|
|
1674
|
+
async function dn(e) {
|
|
1675
|
+
if (!fn(e)) return null;
|
|
1700
1676
|
try {
|
|
1701
1677
|
let t = await fetch(e, { method: "HEAD" });
|
|
1702
1678
|
return t.ok ? null : t.status === 404 ? "not-found" : "generic";
|
|
@@ -1704,12 +1680,12 @@ async function pn(e) {
|
|
|
1704
1680
|
return "generic";
|
|
1705
1681
|
}
|
|
1706
1682
|
}
|
|
1707
|
-
function
|
|
1683
|
+
function fn(e) {
|
|
1708
1684
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1709
1685
|
}
|
|
1710
1686
|
//#endregion
|
|
1711
1687
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1712
|
-
function
|
|
1688
|
+
function pn(e) {
|
|
1713
1689
|
try {
|
|
1714
1690
|
let t = e.play();
|
|
1715
1691
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1717,12 +1693,12 @@ function hn(e) {
|
|
|
1717
1693
|
}
|
|
1718
1694
|
//#endregion
|
|
1719
1695
|
//#region src/components/viewer-core/useMedia.ts
|
|
1720
|
-
function
|
|
1696
|
+
function mn(e) {
|
|
1721
1697
|
let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ? $(e.activeItem.value) : null), d = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), f = i(() => {
|
|
1722
1698
|
let t = /* @__PURE__ */ new Map();
|
|
1723
1699
|
for (let n of e.items.value) t.set($(n), n);
|
|
1724
1700
|
return t;
|
|
1725
|
-
}), p = i(() => d.value ? r.value[d.value] ??
|
|
1701
|
+
}), p = i(() => d.value ? r.value[d.value] ?? en : en), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : hn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
|
|
1726
1702
|
L(() => u.value, async () => {
|
|
1727
1703
|
await C();
|
|
1728
1704
|
}), L(() => e.itemCount.value, async () => {
|
|
@@ -1745,7 +1721,7 @@ function gn(e) {
|
|
|
1745
1721
|
c.delete(e);
|
|
1746
1722
|
}
|
|
1747
1723
|
function b(e, r) {
|
|
1748
|
-
r instanceof HTMLImageElement &&
|
|
1724
|
+
r instanceof HTMLImageElement && nn(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
|
|
1749
1725
|
}
|
|
1750
1726
|
function x() {
|
|
1751
1727
|
H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
@@ -1767,14 +1743,14 @@ function gn(e) {
|
|
|
1767
1743
|
V(i, n);
|
|
1768
1744
|
continue;
|
|
1769
1745
|
}
|
|
1770
|
-
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0,
|
|
1746
|
+
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, pn(i), W(n, i);
|
|
1771
1747
|
}
|
|
1772
1748
|
for (let [e, n] of c.entries()) {
|
|
1773
1749
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1774
1750
|
V(n, e);
|
|
1775
1751
|
continue;
|
|
1776
1752
|
}
|
|
1777
|
-
|
|
1753
|
+
pn(n), W(e, n);
|
|
1778
1754
|
}
|
|
1779
1755
|
}
|
|
1780
1756
|
function w(e, t) {
|
|
@@ -1792,7 +1768,7 @@ function gn(e) {
|
|
|
1792
1768
|
async function E(r, i) {
|
|
1793
1769
|
let a = Y(r) ?? e.activeItem.value;
|
|
1794
1770
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1795
|
-
let o = await
|
|
1771
|
+
let o = await ln(i);
|
|
1796
1772
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1797
1773
|
item: a,
|
|
1798
1774
|
occurrenceKey: r,
|
|
@@ -1810,7 +1786,7 @@ function gn(e) {
|
|
|
1810
1786
|
} catch {}
|
|
1811
1787
|
}
|
|
1812
1788
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1813
|
-
let o = await
|
|
1789
|
+
let o = await ln(n);
|
|
1814
1790
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1815
1791
|
item: a,
|
|
1816
1792
|
occurrenceKey: t,
|
|
@@ -1830,13 +1806,13 @@ function gn(e) {
|
|
|
1830
1806
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1831
1807
|
let r = Number.parseFloat(e.target.value);
|
|
1832
1808
|
if (!Number.isFinite(r)) return;
|
|
1833
|
-
let i =
|
|
1809
|
+
let i = hn(r, 0, m.value || 0);
|
|
1834
1810
|
ne(n, i, t), t.currentTime = i;
|
|
1835
1811
|
}
|
|
1836
1812
|
function M(e) {
|
|
1837
1813
|
let t = q(), n = d.value;
|
|
1838
1814
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1839
|
-
let r =
|
|
1815
|
+
let r = hn(Number.parseFloat(e.target.value), 0, 1);
|
|
1840
1816
|
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
|
|
1841
1817
|
}
|
|
1842
1818
|
function N() {
|
|
@@ -1857,10 +1833,10 @@ function gn(e) {
|
|
|
1857
1833
|
}
|
|
1858
1834
|
function z(e) {
|
|
1859
1835
|
let t = R(e);
|
|
1860
|
-
return t ?
|
|
1836
|
+
return t ? sn(t) : null;
|
|
1861
1837
|
}
|
|
1862
1838
|
function B(e) {
|
|
1863
|
-
return
|
|
1839
|
+
return cn(R(e));
|
|
1864
1840
|
}
|
|
1865
1841
|
function ee(e) {
|
|
1866
1842
|
return `${e}:${a.value[e] ?? 0}`;
|
|
@@ -1887,17 +1863,17 @@ function gn(e) {
|
|
|
1887
1863
|
for (let [e, t] of c.entries()) V(t, e);
|
|
1888
1864
|
}
|
|
1889
1865
|
function U(e) {
|
|
1890
|
-
return r.value[e] || (r.value[e] =
|
|
1866
|
+
return r.value[e] || (r.value[e] = tn()), r.value[e];
|
|
1891
1867
|
}
|
|
1892
1868
|
function W(e, t, n) {
|
|
1893
|
-
|
|
1869
|
+
rn(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1894
1870
|
}
|
|
1895
1871
|
function ne(e, t, n) {
|
|
1896
1872
|
let r = U(e);
|
|
1897
1873
|
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;
|
|
1898
1874
|
}
|
|
1899
1875
|
function G(e) {
|
|
1900
|
-
return
|
|
1876
|
+
return hn(o.value[e] ?? 1, 0, 1);
|
|
1901
1877
|
}
|
|
1902
1878
|
function K(e) {
|
|
1903
1879
|
return s.get(e) ?? c.get(e) ?? null;
|
|
@@ -1908,7 +1884,7 @@ function gn(e) {
|
|
|
1908
1884
|
function re(e) {
|
|
1909
1885
|
if (e) {
|
|
1910
1886
|
if (e.paused) {
|
|
1911
|
-
|
|
1887
|
+
pn(e);
|
|
1912
1888
|
return;
|
|
1913
1889
|
}
|
|
1914
1890
|
e.pause();
|
|
@@ -1962,16 +1938,16 @@ function gn(e) {
|
|
|
1962
1938
|
syncMediaPlayback: C
|
|
1963
1939
|
};
|
|
1964
1940
|
}
|
|
1965
|
-
function
|
|
1941
|
+
function hn(e, t, n) {
|
|
1966
1942
|
return Math.min(Math.max(e, t), n);
|
|
1967
1943
|
}
|
|
1968
1944
|
//#endregion
|
|
1969
1945
|
//#region src/components/viewer-core/virtualization.ts
|
|
1970
|
-
var
|
|
1946
|
+
var gn = {
|
|
1971
1947
|
backward: 1,
|
|
1972
1948
|
forward: 3
|
|
1973
1949
|
};
|
|
1974
|
-
function
|
|
1950
|
+
function _n(e, t, n = gn) {
|
|
1975
1951
|
return t <= 0 ? {
|
|
1976
1952
|
start: 0,
|
|
1977
1953
|
end: -1
|
|
@@ -1980,14 +1956,14 @@ function yn(e, t, n = vn) {
|
|
|
1980
1956
|
end: Math.min(t - 1, e + n.forward)
|
|
1981
1957
|
};
|
|
1982
1958
|
}
|
|
1983
|
-
function
|
|
1984
|
-
let r =
|
|
1959
|
+
function vn(e, t, n = gn) {
|
|
1960
|
+
let r = _n(t, e.length, n);
|
|
1985
1961
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1986
1962
|
item: e,
|
|
1987
1963
|
index: r.start + t
|
|
1988
1964
|
}));
|
|
1989
1965
|
}
|
|
1990
|
-
function
|
|
1966
|
+
function yn(e, t, n, r, i) {
|
|
1991
1967
|
return {
|
|
1992
1968
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1993
1969
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1995,12 +1971,12 @@ function xn(e, t, n, r, i) {
|
|
|
1995
1971
|
}
|
|
1996
1972
|
//#endregion
|
|
1997
1973
|
//#region src/components/viewer-core/useViewer.ts
|
|
1998
|
-
function
|
|
1999
|
-
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(() =>
|
|
1974
|
+
function bn(e, t, n = {}) {
|
|
1975
|
+
let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => Zt({
|
|
2000
1976
|
itemCount: r.value.length,
|
|
2001
1977
|
loading: s.value,
|
|
2002
1978
|
phase: e.phase
|
|
2003
|
-
})), 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 =
|
|
1979
|
+
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), T = mn({
|
|
2004
1980
|
items: r,
|
|
2005
1981
|
activeItem: C,
|
|
2006
1982
|
activeMediaItem: w,
|
|
@@ -2009,14 +1985,14 @@ function Sn(e, t, n = {}) {
|
|
|
2009
1985
|
loopFullscreenVideo: l,
|
|
2010
1986
|
onAssetError: n.onAssetError,
|
|
2011
1987
|
onAssetLoad: n.onAssetLoad
|
|
2012
|
-
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() =>
|
|
1988
|
+
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Qt({
|
|
2013
1989
|
errorMessage: o.value,
|
|
2014
1990
|
hasItems: r.value.length > 0,
|
|
2015
1991
|
hasNextPage: c.value,
|
|
2016
1992
|
phase: d.value,
|
|
2017
1993
|
surface: "fullscreen"
|
|
2018
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
2019
|
-
|
|
1994
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => _n(S.value, r.value.length)), N = i(() => vn(r.value, S.value));
|
|
1995
|
+
$t({
|
|
2020
1996
|
enabled: _,
|
|
2021
1997
|
onDisable() {
|
|
2022
1998
|
H(), T.resetMediaState();
|
|
@@ -2094,7 +2070,7 @@ function Sn(e, t, n = {}) {
|
|
|
2094
2070
|
return e.type === "audio";
|
|
2095
2071
|
}
|
|
2096
2072
|
function ie(e) {
|
|
2097
|
-
return
|
|
2073
|
+
return yn(e, S.value, g.value, m.value, h.value);
|
|
2098
2074
|
}
|
|
2099
2075
|
return {
|
|
2100
2076
|
activeItem: C,
|
|
@@ -2109,7 +2085,7 @@ function Sn(e, t, n = {}) {
|
|
|
2109
2085
|
getAssetErrorKind: T.getAssetErrorKind,
|
|
2110
2086
|
getAssetErrorLabel: T.getAssetErrorLabel,
|
|
2111
2087
|
getAssetRenderKey: T.getAssetRenderKey,
|
|
2112
|
-
formatPlaybackTime:
|
|
2088
|
+
formatPlaybackTime: Xt,
|
|
2113
2089
|
getImageSource: T.getImageSource,
|
|
2114
2090
|
getSlideStyle: ie,
|
|
2115
2091
|
hasNextPage: c,
|
|
@@ -2153,21 +2129,21 @@ function Sn(e, t, n = {}) {
|
|
|
2153
2129
|
}
|
|
2154
2130
|
//#endregion
|
|
2155
2131
|
//#region src/components/viewer-core/theme.ts
|
|
2156
|
-
var
|
|
2132
|
+
var xn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", Sn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", Cn = {
|
|
2157
2133
|
image: !0,
|
|
2158
2134
|
video: !0,
|
|
2159
2135
|
audio: !0,
|
|
2160
2136
|
other: !0
|
|
2161
2137
|
};
|
|
2162
|
-
function
|
|
2163
|
-
return
|
|
2138
|
+
function wn(e) {
|
|
2139
|
+
return Cn[e], xn;
|
|
2164
2140
|
}
|
|
2165
|
-
function
|
|
2166
|
-
return
|
|
2141
|
+
function Tn(e) {
|
|
2142
|
+
return Cn[e], Sn;
|
|
2167
2143
|
}
|
|
2168
2144
|
//#endregion
|
|
2169
2145
|
//#region src/components/viewer-core/useFullscreenAssetEvents.ts
|
|
2170
|
-
function
|
|
2146
|
+
function En(e) {
|
|
2171
2147
|
function t(t, n) {
|
|
2172
2148
|
return e.fullscreenMedia.shouldHandleSlideAssetEvent(t, n) ? e.fullscreenMedia.getItemKey(n) : null;
|
|
2173
2149
|
}
|
|
@@ -2200,7 +2176,7 @@ function On(e) {
|
|
|
2200
2176
|
}
|
|
2201
2177
|
//#endregion
|
|
2202
2178
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
2203
|
-
function
|
|
2179
|
+
function Dn(e) {
|
|
2204
2180
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
2205
2181
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
2206
2182
|
if (!n) return null;
|
|
@@ -2215,20 +2191,20 @@ function kn(e) {
|
|
|
2215
2191
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
2216
2192
|
}
|
|
2217
2193
|
return r <= 0 ? null : {
|
|
2218
|
-
r:
|
|
2219
|
-
g:
|
|
2220
|
-
b:
|
|
2194
|
+
r: On(Math.round(i / r)),
|
|
2195
|
+
g: On(Math.round(a / r)),
|
|
2196
|
+
b: On(Math.round(o / r))
|
|
2221
2197
|
};
|
|
2222
2198
|
} catch {
|
|
2223
2199
|
return null;
|
|
2224
2200
|
}
|
|
2225
2201
|
}
|
|
2226
|
-
function
|
|
2202
|
+
function On(e) {
|
|
2227
2203
|
return Math.min(235, Math.max(26, e));
|
|
2228
2204
|
}
|
|
2229
2205
|
//#endregion
|
|
2230
2206
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
2231
|
-
function
|
|
2207
|
+
function kn(e) {
|
|
2232
2208
|
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(() => {
|
|
2233
2209
|
if (!r.value) return;
|
|
2234
2210
|
let { r: e, g: t, b: n } = r.value;
|
|
@@ -2243,7 +2219,7 @@ function jn(e) {
|
|
|
2243
2219
|
});
|
|
2244
2220
|
function s(n, r) {
|
|
2245
2221
|
if (!e.showDominantImageTone.value) return;
|
|
2246
|
-
let i =
|
|
2222
|
+
let i = Dn(r);
|
|
2247
2223
|
i && (t.value[n] = i);
|
|
2248
2224
|
}
|
|
2249
2225
|
return {
|
|
@@ -2254,7 +2230,7 @@ function jn(e) {
|
|
|
2254
2230
|
}
|
|
2255
2231
|
//#endregion
|
|
2256
2232
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
2257
|
-
var
|
|
2233
|
+
var An = ["data-surface"], jn = ["data-surface"], Mn = /* @__PURE__ */ d({
|
|
2258
2234
|
inheritAttrs: !1,
|
|
2259
2235
|
__name: "SurfaceEmptyState",
|
|
2260
2236
|
props: {
|
|
@@ -2268,31 +2244,31 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2268
2244
|
"data-testid": "vibe-empty-state-inline",
|
|
2269
2245
|
"data-surface": e.surface,
|
|
2270
2246
|
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)]"]
|
|
2271
|
-
}), [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,
|
|
2247
|
+
}), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, An)) : (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", {
|
|
2272
2248
|
"data-testid": "vibe-empty-state-badge",
|
|
2273
2249
|
"data-surface": e.surface,
|
|
2274
2250
|
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"])
|
|
2275
|
-
}, j(e.message), 11,
|
|
2251
|
+
}, j(e.message), 11, jn)])], 16));
|
|
2276
2252
|
}
|
|
2277
|
-
}),
|
|
2253
|
+
}), Nn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Pn = {
|
|
2278
2254
|
key: 0,
|
|
2279
2255
|
class: "relative h-full min-h-0"
|
|
2280
|
-
},
|
|
2256
|
+
}, Fn = [
|
|
2281
2257
|
"data-item-id",
|
|
2282
2258
|
"data-occurrence-key",
|
|
2283
2259
|
"data-index",
|
|
2284
2260
|
"data-active",
|
|
2285
2261
|
"aria-hidden"
|
|
2286
|
-
],
|
|
2262
|
+
], In = {
|
|
2287
2263
|
key: 0,
|
|
2288
2264
|
"data-testid": "vibe-asset-spinner",
|
|
2289
2265
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
2290
|
-
},
|
|
2266
|
+
}, Ln = { 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]" }, Rn = ["data-kind"], zn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Bn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Vn = ["onClick"], Hn = [
|
|
2291
2267
|
"src",
|
|
2292
2268
|
"alt",
|
|
2293
2269
|
"onLoad",
|
|
2294
2270
|
"onError"
|
|
2295
|
-
],
|
|
2271
|
+
], Un = [
|
|
2296
2272
|
"loop",
|
|
2297
2273
|
"src",
|
|
2298
2274
|
"preload",
|
|
@@ -2311,15 +2287,15 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2311
2287
|
"onStalled",
|
|
2312
2288
|
"onTimeupdate",
|
|
2313
2289
|
"onWaiting"
|
|
2314
|
-
],
|
|
2290
|
+
], Wn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Gn = [
|
|
2315
2291
|
"aria-label",
|
|
2316
2292
|
"disabled",
|
|
2317
2293
|
"onClick"
|
|
2318
|
-
],
|
|
2294
|
+
], Kn = { 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]" }, qn = { 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]" }, Jn = {
|
|
2319
2295
|
key: 0,
|
|
2320
2296
|
"data-testid": "vibe-asset-spinner",
|
|
2321
2297
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
2322
|
-
},
|
|
2298
|
+
}, Yn = { 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]" }, Xn = ["data-kind"], Zn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Qn = ["onClick"], $n = [
|
|
2323
2299
|
"src",
|
|
2324
2300
|
"preload",
|
|
2325
2301
|
"onCanplay",
|
|
@@ -2335,26 +2311,26 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2335
2311
|
"onStalled",
|
|
2336
2312
|
"onTimeupdate",
|
|
2337
2313
|
"onWaiting"
|
|
2338
|
-
],
|
|
2314
|
+
], er = {
|
|
2339
2315
|
key: 2,
|
|
2340
2316
|
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"
|
|
2341
|
-
},
|
|
2317
|
+
}, tr = { 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]" }, nr = {
|
|
2342
2318
|
key: 0,
|
|
2343
2319
|
"data-testid": "vibe-fullscreen-overlay",
|
|
2344
2320
|
class: "pointer-events-none absolute inset-0 z-[6]"
|
|
2345
|
-
},
|
|
2321
|
+
}, rr = { class: "h-full w-full" }, ir = {
|
|
2346
2322
|
key: 1,
|
|
2347
2323
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
2348
2324
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
2349
|
-
},
|
|
2325
|
+
}, ar = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, or = { 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)]" }, sr = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, cr = {
|
|
2350
2326
|
key: 0,
|
|
2351
2327
|
"data-testid": "vibe-fullscreen-aside",
|
|
2352
2328
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
2353
|
-
},
|
|
2329
|
+
}, lr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, ur = {
|
|
2354
2330
|
key: 0,
|
|
2355
2331
|
"data-testid": "vibe-fullscreen-aside",
|
|
2356
2332
|
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]"
|
|
2357
|
-
},
|
|
2333
|
+
}, dr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, fr = 1280, pr = 768, mr = /* @__PURE__ */ d({
|
|
2358
2334
|
__name: "FullscreenSurface",
|
|
2359
2335
|
props: {
|
|
2360
2336
|
active: {
|
|
@@ -2406,27 +2382,27 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2406
2382
|
},
|
|
2407
2383
|
emits: ["back-to-list", "update:activeIndex"],
|
|
2408
2384
|
setup(e, { emit: n }) {
|
|
2409
|
-
let d = e, f = F(), m = n, h =
|
|
2385
|
+
let d = e, f = F(), m = n, h = bn(d, (e, t) => {
|
|
2410
2386
|
m("update:activeIndex", t);
|
|
2411
2387
|
}, {
|
|
2412
2388
|
enabled: M(d, "active"),
|
|
2413
2389
|
onAssetError: d.reportAssetError ?? void 0,
|
|
2414
2390
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
2415
|
-
}), _ = D(typeof window > "u" ?
|
|
2391
|
+
}), _ = D(typeof window > "u" ? fr : window.innerWidth || fr), C = Gt({
|
|
2416
2392
|
active: M(d, "active"),
|
|
2417
2393
|
items: h.items,
|
|
2418
2394
|
resolvedActiveIndex: h.resolvedActiveIndex,
|
|
2419
2395
|
viewer: h
|
|
2420
|
-
}), T = i(() =>
|
|
2396
|
+
}), T = i(() => wn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = kn({
|
|
2421
2397
|
activeItem: h.activeItem,
|
|
2422
2398
|
getItemKey: C.getItemKey,
|
|
2423
2399
|
isImageReady: h.isImageReady,
|
|
2424
2400
|
showDominantImageTone: M(d, "showDominantImageTone")
|
|
2425
|
-
}), L =
|
|
2401
|
+
}), L = En({
|
|
2426
2402
|
fullscreenMedia: C,
|
|
2427
2403
|
updateDominantToneFromImageElement: _e,
|
|
2428
2404
|
viewer: h
|
|
2429
|
-
}), R = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), B = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), te = i(() => _.value <
|
|
2405
|
+
}), R = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), B = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), te = i(() => _.value < pr ? "vertical" : "horizontal"), V = i(() => B.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), H = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), U = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), W = i(() => {
|
|
2430
2406
|
let e = h.activeItem.value;
|
|
2431
2407
|
return e ? {
|
|
2432
2408
|
hasNextPage: d.hasNextPage,
|
|
@@ -2443,7 +2419,7 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2443
2419
|
}), q = i(() => !K.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](K.value)), re = i(() => ({
|
|
2444
2420
|
gridTemplateColumns: ie.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
2445
2421
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
2446
|
-
})), J = i(() =>
|
|
2422
|
+
})), J = i(() => Kt(ne.value)), Y = i(() => Kt(G.value)), ie = i(() => Y.value && _.value >= fr), ae = i(() => Y.value && !ie.value), ue = i(() => Kt(q.value)), { emptyStateProps: X, showBadgeEmptyState: de, showCustomEmptyState: fe, showInlineEmptyState: Z } = Yt({
|
|
2447
2423
|
emptyStateMode: M(d, "emptyStateMode"),
|
|
2448
2424
|
itemCount: i(() => d.items.length),
|
|
2449
2425
|
loading: M(d, "loading"),
|
|
@@ -2456,7 +2432,7 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2456
2432
|
window.removeEventListener("resize", pe);
|
|
2457
2433
|
});
|
|
2458
2434
|
function pe() {
|
|
2459
|
-
_.value = window.innerWidth ||
|
|
2435
|
+
_.value = window.innerWidth || fr;
|
|
2460
2436
|
}
|
|
2461
2437
|
function me(e, t) {
|
|
2462
2438
|
C.registerImageElement(e, t), h.registerImageElement(e, t), t instanceof HTMLImageElement && _e(e, t);
|
|
@@ -2485,7 +2461,7 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2485
2461
|
let a = i.play();
|
|
2486
2462
|
a && typeof a.catch == "function" && a.catch(() => {});
|
|
2487
2463
|
}
|
|
2488
|
-
return (e, n) => (w(), s("div",
|
|
2464
|
+
return (e, n) => (w(), s("div", Nn, [
|
|
2489
2465
|
c("div", {
|
|
2490
2466
|
class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
|
|
2491
2467
|
style: b(N(P))
|
|
@@ -2502,7 +2478,7 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2502
2478
|
onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
|
|
2503
2479
|
onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
|
|
2504
2480
|
onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
|
|
2505
|
-
}, [N(h).activeItem.value ? (w(), s("div",
|
|
2481
|
+
}, [N(h).activeItem.value ? (w(), s("div", Pn, [
|
|
2506
2482
|
(w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
|
|
2507
2483
|
key: N(C).getItemKey(r),
|
|
2508
2484
|
"data-testid": "vibe-slide",
|
|
@@ -2514,12 +2490,12 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2514
2490
|
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"]),
|
|
2515
2491
|
style: b(N(h).getSlideStyle(i))
|
|
2516
2492
|
}, [c("div", {
|
|
2517
|
-
class: v(["absolute inset-0 opacity-85", N(
|
|
2493
|
+
class: v(["absolute inset-0 opacity-85", N(Tn)(r.type)]),
|
|
2518
2494
|
style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
|
|
2519
2495
|
}, null, 6), N(h).isVisual(r) ? (w(), s("div", {
|
|
2520
2496
|
key: 0,
|
|
2521
2497
|
class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? V.value : ""])
|
|
2522
|
-
}, [N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2498
|
+
}, [N(C).isAssetLoading(i, r) ? (w(), s("div", In, [c("span", Ln, [u(N(oe), {
|
|
2523
2499
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2524
2500
|
"aria-hidden": "true"
|
|
2525
2501
|
})])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
|
|
@@ -2527,19 +2503,19 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2527
2503
|
"data-testid": "vibe-asset-error",
|
|
2528
2504
|
"data-kind": N(C).getAssetErrorKind(r),
|
|
2529
2505
|
class: "grid h-full w-full place-items-center"
|
|
2530
|
-
}, [c("div",
|
|
2506
|
+
}, [c("div", zn, [
|
|
2531
2507
|
u(N(le), {
|
|
2532
2508
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2533
2509
|
"aria-hidden": "true"
|
|
2534
2510
|
}),
|
|
2535
|
-
c("p",
|
|
2511
|
+
c("p", Bn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2536
2512
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2537
2513
|
key: 0,
|
|
2538
2514
|
type: "button",
|
|
2539
2515
|
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",
|
|
2540
2516
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2541
|
-
}, " Retry ", 8,
|
|
2542
|
-
])], 8,
|
|
2517
|
+
}, " Retry ", 8, Vn)) : o("", !0)
|
|
2518
|
+
])], 8, Rn)) : r.type === "image" ? (w(), s("img", {
|
|
2543
2519
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2544
2520
|
src: N(C).getFullscreenImageSource(i, r),
|
|
2545
2521
|
alt: r.title ?? "",
|
|
@@ -2550,7 +2526,7 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2550
2526
|
ref: (e) => me(N(C).getItemKey(r), e),
|
|
2551
2527
|
onLoad: (e) => N(L).onFullscreenImageLoad(e, i, r),
|
|
2552
2528
|
onError: (e) => N(L).onFullscreenImageError(i, r)
|
|
2553
|
-
}, null, 42,
|
|
2529
|
+
}, null, 42, Hn)) : (w(), s("video", {
|
|
2554
2530
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2555
2531
|
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"]),
|
|
2556
2532
|
playsinline: "",
|
|
@@ -2574,10 +2550,10 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2574
2550
|
onStalled: (e) => Q(i, r, e),
|
|
2575
2551
|
onTimeupdate: (e) => Q(i, r, e),
|
|
2576
2552
|
onWaiting: (e) => Q(i, r, e)
|
|
2577
|
-
}, null, 42,
|
|
2553
|
+
}, null, 42, Un))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
|
|
2578
2554
|
key: 1,
|
|
2579
2555
|
class: v(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === N(h).resolvedActiveIndex.value ? V.value : ""])
|
|
2580
|
-
}, [c("div",
|
|
2556
|
+
}, [c("div", Wn, [
|
|
2581
2557
|
c("button", {
|
|
2582
2558
|
type: "button",
|
|
2583
2559
|
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]",
|
|
@@ -2587,19 +2563,19 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2587
2563
|
}, [
|
|
2588
2564
|
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),
|
|
2589
2565
|
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),
|
|
2590
|
-
c("span",
|
|
2566
|
+
c("span", Kn, [k(e.$slots, "item-icon", {
|
|
2591
2567
|
icon: N(Nt)(r.type),
|
|
2592
2568
|
item: r
|
|
2593
2569
|
}, () => [(w(), a(A(N(Nt)(r.type)), {
|
|
2594
2570
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2595
2571
|
"aria-hidden": "true"
|
|
2596
2572
|
}))])]),
|
|
2597
|
-
c("span",
|
|
2573
|
+
c("span", qn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
|
|
2598
2574
|
class: "h-4 w-4 stroke-2",
|
|
2599
2575
|
"aria-hidden": "true"
|
|
2600
2576
|
}))])
|
|
2601
|
-
], 8,
|
|
2602
|
-
N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2577
|
+
], 8, Gn),
|
|
2578
|
+
N(C).isAssetLoading(i, r) ? (w(), s("div", Jn, [c("span", Yn, [u(N(oe), {
|
|
2603
2579
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2604
2580
|
"aria-hidden": "true"
|
|
2605
2581
|
})])])) : o("", !0),
|
|
@@ -2612,14 +2588,14 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2612
2588
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2613
2589
|
"aria-hidden": "true"
|
|
2614
2590
|
}),
|
|
2615
|
-
c("p",
|
|
2591
|
+
c("p", Zn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2616
2592
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2617
2593
|
key: 0,
|
|
2618
2594
|
type: "button",
|
|
2619
2595
|
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",
|
|
2620
2596
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2621
|
-
}, " Retry ", 8,
|
|
2622
|
-
], 8,
|
|
2597
|
+
}, " Retry ", 8, Qn)) : o("", !0)
|
|
2598
|
+
], 8, Xn)], 64)) : o("", !0)
|
|
2623
2599
|
]), (w(), s("audio", {
|
|
2624
2600
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2625
2601
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
@@ -2640,14 +2616,14 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2640
2616
|
onStalled: (e) => Q(i, r, e),
|
|
2641
2617
|
onTimeupdate: (e) => Q(i, r, e),
|
|
2642
2618
|
onWaiting: (e) => Q(i, r, e)
|
|
2643
|
-
}, null, 40,
|
|
2619
|
+
}, null, 40, $n))], 2)) : (w(), s("div", er, [c("div", tr, [k(e.$slots, "item-icon", {
|
|
2644
2620
|
icon: N(Nt)(r.type),
|
|
2645
2621
|
item: r
|
|
2646
2622
|
}, () => [(w(), a(A(N(Nt)(r.type)), {
|
|
2647
2623
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2648
2624
|
"aria-hidden": "true"
|
|
2649
|
-
}))])])]))], 14,
|
|
2650
|
-
W.value && f["fullscreen-overlay"] ? (w(), s("div",
|
|
2625
|
+
}))])])]))], 14, Fn))), 128)),
|
|
2626
|
+
W.value && f["fullscreen-overlay"] ? (w(), s("div", nr, [c("div", rr, [k(e.$slots, "fullscreen-overlay", y(p(W.value)))])])) : o("", !0),
|
|
2651
2627
|
N(h).activeItem.value ? (w(), a(At, {
|
|
2652
2628
|
key: 1,
|
|
2653
2629
|
"current-index": N(h).resolvedActiveIndex.value,
|
|
@@ -2705,10 +2681,10 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2705
2681
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2706
2682
|
class: v(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", K.value.kind === "end" ? "border-amber-300/35 text-amber-200" : K.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
2707
2683
|
}, j(K.value.message), 3))], 2)) : o("", !0)
|
|
2708
|
-
])) : H.value ? (w(), s("div",
|
|
2684
|
+
])) : H.value ? (w(), s("div", ir, [c("div", ar, [c("span", or, [u(N(oe), {
|
|
2709
2685
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2710
2686
|
"aria-hidden": "true"
|
|
2711
|
-
})]), c("p",
|
|
2687
|
+
})]), c("p", sr, j(U.value), 1)])])) : N(Z) && N(X) ? (w(), a(Mn, {
|
|
2712
2688
|
key: 2,
|
|
2713
2689
|
message: N(X).message,
|
|
2714
2690
|
mode: N(X).mode,
|
|
@@ -2720,7 +2696,7 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2720
2696
|
"message",
|
|
2721
2697
|
"mode",
|
|
2722
2698
|
"surface"
|
|
2723
|
-
])) : o("", !0), N(de) && N(X) ? (w(), a(
|
|
2699
|
+
])) : o("", !0), N(de) && N(X) ? (w(), a(Mn, {
|
|
2724
2700
|
key: 3,
|
|
2725
2701
|
message: N(X).message,
|
|
2726
2702
|
mode: N(X).mode,
|
|
@@ -2740,7 +2716,7 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2740
2716
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2741
2717
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2742
2718
|
}, {
|
|
2743
|
-
default: z(() => [ie.value && W.value ? (w(), s("aside",
|
|
2719
|
+
default: z(() => [ie.value && W.value ? (w(), s("aside", cr, [c("div", lr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
|
|
2744
2720
|
_: 3
|
|
2745
2721
|
})], 4),
|
|
2746
2722
|
u(r, {
|
|
@@ -2751,29 +2727,29 @@ var Mn = ["data-surface"], Nn = ["data-surface"], Pn = /* @__PURE__ */ d({
|
|
|
2751
2727
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2752
2728
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2753
2729
|
}, {
|
|
2754
|
-
default: z(() => [ae.value && W.value ? (w(), s("aside",
|
|
2730
|
+
default: z(() => [ae.value && W.value ? (w(), s("aside", ur, [c("div", dr, [k(e.$slots, "fullscreen-aside", y(p(W.value)))])])) : o("", !0)]),
|
|
2755
2731
|
_: 3
|
|
2756
2732
|
})
|
|
2757
2733
|
]));
|
|
2758
2734
|
}
|
|
2759
|
-
}),
|
|
2760
|
-
function
|
|
2735
|
+
}), hr = 1, gr = .5;
|
|
2736
|
+
function _r(e) {
|
|
2761
2737
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2762
|
-
width:
|
|
2763
|
-
height:
|
|
2738
|
+
width: hr,
|
|
2739
|
+
height: hr,
|
|
2764
2740
|
source: "fallback"
|
|
2765
2741
|
};
|
|
2766
2742
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2767
|
-
if (
|
|
2768
|
-
let r =
|
|
2743
|
+
if (wr(t) && wr(n)) {
|
|
2744
|
+
let r = Tr(e, t, n);
|
|
2769
2745
|
return {
|
|
2770
2746
|
width: r.width,
|
|
2771
2747
|
height: r.height,
|
|
2772
2748
|
source: "preview"
|
|
2773
2749
|
};
|
|
2774
2750
|
}
|
|
2775
|
-
if (
|
|
2776
|
-
let t =
|
|
2751
|
+
if (wr(e.width) && wr(e.height)) {
|
|
2752
|
+
let t = Tr(e, e.width, e.height);
|
|
2777
2753
|
return {
|
|
2778
2754
|
width: t.width,
|
|
2779
2755
|
height: t.height,
|
|
@@ -2781,31 +2757,31 @@ function yr(e) {
|
|
|
2781
2757
|
};
|
|
2782
2758
|
}
|
|
2783
2759
|
return {
|
|
2784
|
-
width:
|
|
2785
|
-
height:
|
|
2760
|
+
width: hr,
|
|
2761
|
+
height: hr,
|
|
2786
2762
|
source: "fallback"
|
|
2787
2763
|
};
|
|
2788
2764
|
}
|
|
2789
|
-
function
|
|
2765
|
+
function vr(e, t) {
|
|
2790
2766
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2791
2767
|
}
|
|
2792
|
-
function
|
|
2768
|
+
function yr(e, t, n, r = 0) {
|
|
2793
2769
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2794
2770
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2795
2771
|
return !a || a <= 0 ? n : a / t;
|
|
2796
2772
|
}
|
|
2797
|
-
function
|
|
2798
|
-
let n =
|
|
2773
|
+
function br(e, t) {
|
|
2774
|
+
let n = _r(e);
|
|
2799
2775
|
return n.height / n.width * t;
|
|
2800
2776
|
}
|
|
2801
|
-
function
|
|
2777
|
+
function xr(e, t) {
|
|
2802
2778
|
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;
|
|
2803
2779
|
for (let c = 0; c < e.length; c += 1) {
|
|
2804
2780
|
let l = e[c];
|
|
2805
2781
|
o.set($(l), c);
|
|
2806
2782
|
let u = 0;
|
|
2807
2783
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2808
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2784
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = br(l, t.columnWidth);
|
|
2809
2785
|
r[c] = {
|
|
2810
2786
|
x: d,
|
|
2811
2787
|
y: f
|
|
@@ -2824,7 +2800,7 @@ function Cr(e, t) {
|
|
|
2824
2800
|
indexById: o
|
|
2825
2801
|
};
|
|
2826
2802
|
}
|
|
2827
|
-
function
|
|
2803
|
+
function Sr(e) {
|
|
2828
2804
|
if (e.itemCount <= 0) return [];
|
|
2829
2805
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2830
2806
|
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();
|
|
@@ -2834,7 +2810,7 @@ function wr(e) {
|
|
|
2834
2810
|
}
|
|
2835
2811
|
return Array.from(a).sort((e, t) => e - t);
|
|
2836
2812
|
}
|
|
2837
|
-
function
|
|
2813
|
+
function Cr(e, t, n) {
|
|
2838
2814
|
let r = /* @__PURE__ */ new Map();
|
|
2839
2815
|
for (let i of e) {
|
|
2840
2816
|
let e = t.get($(i));
|
|
@@ -2844,11 +2820,11 @@ function Tr(e, t, n) {
|
|
|
2844
2820
|
}
|
|
2845
2821
|
return r;
|
|
2846
2822
|
}
|
|
2847
|
-
function
|
|
2823
|
+
function wr(e) {
|
|
2848
2824
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2849
2825
|
}
|
|
2850
|
-
function
|
|
2851
|
-
return e.type !== "image" || n / t >=
|
|
2826
|
+
function Tr(e, t, n) {
|
|
2827
|
+
return e.type !== "image" || n / t >= gr ? {
|
|
2852
2828
|
width: t,
|
|
2853
2829
|
height: n
|
|
2854
2830
|
} : {
|
|
@@ -2858,21 +2834,21 @@ function Dr(e, t, n) {
|
|
|
2858
2834
|
}
|
|
2859
2835
|
//#endregion
|
|
2860
2836
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2861
|
-
var
|
|
2862
|
-
function
|
|
2837
|
+
var Er = 300, Dr = 600, Or = 40, kr = 300, Ar = 400;
|
|
2838
|
+
function jr(e, t) {
|
|
2863
2839
|
return t === "top" ? [...e].reverse() : e;
|
|
2864
2840
|
}
|
|
2865
|
-
function
|
|
2866
|
-
return e <= 0 ?
|
|
2841
|
+
function Mr(e) {
|
|
2842
|
+
return e <= 0 ? Dr : Dr + Math.min((e - 1) * Or, Ar);
|
|
2867
2843
|
}
|
|
2868
|
-
function
|
|
2869
|
-
return
|
|
2844
|
+
function Nr() {
|
|
2845
|
+
return kr;
|
|
2870
2846
|
}
|
|
2871
|
-
function
|
|
2847
|
+
function Pr(e) {
|
|
2872
2848
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2873
2849
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2874
2850
|
}
|
|
2875
|
-
function
|
|
2851
|
+
function Fr(e) {
|
|
2876
2852
|
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()));
|
|
2877
2853
|
L(e.visibleIndices, (i) => {
|
|
2878
2854
|
if (!i.length) return;
|
|
@@ -2882,20 +2858,20 @@ function Lr(e) {
|
|
|
2882
2858
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2883
2859
|
}
|
|
2884
2860
|
if (!o.length) return;
|
|
2885
|
-
let s =
|
|
2886
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2887
|
-
r.value = c,
|
|
2861
|
+
let s = jr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2862
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Or, Ar));
|
|
2863
|
+
r.value = c, Ir(() => {
|
|
2888
2864
|
let e = new Set(n.value);
|
|
2889
2865
|
for (let t of o) e.add(t);
|
|
2890
2866
|
n.value = e;
|
|
2891
|
-
}),
|
|
2867
|
+
}), Lr(() => {
|
|
2892
2868
|
let e = new Set(t.value);
|
|
2893
2869
|
for (let t of o) e.delete(t);
|
|
2894
2870
|
t.value = e, S(() => {
|
|
2895
2871
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2896
2872
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2897
2873
|
n.value = e, r.value = t, a.value = i;
|
|
2898
|
-
},
|
|
2874
|
+
}, Mr(o.length));
|
|
2899
2875
|
});
|
|
2900
2876
|
}, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
|
|
2901
2877
|
if (!e.length || !o.value.size) return;
|
|
@@ -2922,7 +2898,7 @@ function Lr(e) {
|
|
|
2922
2898
|
let e = $(t.item);
|
|
2923
2899
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2924
2900
|
}
|
|
2925
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2901
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Ir(() => {
|
|
2926
2902
|
let e = new Set(s.value);
|
|
2927
2903
|
for (let t of p) e.add(t);
|
|
2928
2904
|
s.value = e;
|
|
@@ -2930,9 +2906,9 @@ function Lr(e) {
|
|
|
2930
2906
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2931
2907
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2932
2908
|
o.value = e, s.value = t;
|
|
2933
|
-
},
|
|
2909
|
+
}, kr);
|
|
2934
2910
|
}
|
|
2935
|
-
function g(t, n, r =
|
|
2911
|
+
function g(t, n, r = Er) {
|
|
2936
2912
|
if (!t.size) return;
|
|
2937
2913
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2938
2914
|
for (let [r, o] of t.entries()) {
|
|
@@ -2951,8 +2927,8 @@ function Lr(e) {
|
|
|
2951
2927
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2952
2928
|
let o = new Map(l.value);
|
|
2953
2929
|
for (let e of a) o.set(e, r);
|
|
2954
|
-
l.value = o,
|
|
2955
|
-
u.value = new Set(a),
|
|
2930
|
+
l.value = o, Ir(() => {
|
|
2931
|
+
u.value = new Set(a), Ir(() => {
|
|
2956
2932
|
c.value = /* @__PURE__ */ new Map();
|
|
2957
2933
|
});
|
|
2958
2934
|
}), S(() => {
|
|
@@ -2963,8 +2939,8 @@ function Lr(e) {
|
|
|
2963
2939
|
}, r);
|
|
2964
2940
|
}
|
|
2965
2941
|
function _(e) {
|
|
2966
|
-
if (n.value.has(e)) return `transform ${
|
|
2967
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2942
|
+
if (n.value.has(e)) return `transform ${Dr}ms ease-out`;
|
|
2943
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? Er}ms ease-out`;
|
|
2968
2944
|
}
|
|
2969
2945
|
function v(e) {
|
|
2970
2946
|
if (!n.value.has(e)) return;
|
|
@@ -2981,7 +2957,7 @@ function Lr(e) {
|
|
|
2981
2957
|
} : {
|
|
2982
2958
|
dx: 0,
|
|
2983
2959
|
dy: 0
|
|
2984
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
2960
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Pr({
|
|
2985
2961
|
columnWidth: e.columnWidth.value,
|
|
2986
2962
|
direction: u,
|
|
2987
2963
|
itemHeight: o,
|
|
@@ -2995,14 +2971,14 @@ function Lr(e) {
|
|
|
2995
2971
|
if (!r) return {
|
|
2996
2972
|
opacity: "0",
|
|
2997
2973
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2998
|
-
transition: `opacity ${
|
|
2974
|
+
transition: `opacity ${kr}ms ease-out, transform ${kr}ms ease-out`
|
|
2999
2975
|
};
|
|
3000
2976
|
let i = s.value.has(n);
|
|
3001
2977
|
return {
|
|
3002
2978
|
height: `${r.height}px`,
|
|
3003
2979
|
opacity: i ? "0" : "1",
|
|
3004
2980
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
3005
|
-
transition: `opacity ${
|
|
2981
|
+
transition: `opacity ${kr}ms ease-out, transform ${kr}ms ease-out`,
|
|
3006
2982
|
width: `${e.columnWidth.value}px`
|
|
3007
2983
|
};
|
|
3008
2984
|
}
|
|
@@ -3023,28 +2999,28 @@ function Lr(e) {
|
|
|
3023
2999
|
playFlipMoveAnimation: g
|
|
3024
3000
|
};
|
|
3025
3001
|
}
|
|
3026
|
-
function
|
|
3002
|
+
function Ir(e) {
|
|
3027
3003
|
if (typeof requestAnimationFrame == "function") {
|
|
3028
3004
|
requestAnimationFrame(() => e());
|
|
3029
3005
|
return;
|
|
3030
3006
|
}
|
|
3031
3007
|
setTimeout(e, 0);
|
|
3032
3008
|
}
|
|
3033
|
-
function
|
|
3034
|
-
|
|
3009
|
+
function Lr(e) {
|
|
3010
|
+
Ir(() => Ir(e));
|
|
3035
3011
|
}
|
|
3036
3012
|
//#endregion
|
|
3037
3013
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
3038
|
-
function
|
|
3014
|
+
function Rr(e, t) {
|
|
3039
3015
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
3040
3016
|
}
|
|
3041
|
-
function
|
|
3017
|
+
function zr(e, t, n) {
|
|
3042
3018
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
3043
3019
|
}
|
|
3044
|
-
function
|
|
3020
|
+
function Br(e, t, n, r) {
|
|
3045
3021
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
3046
3022
|
}
|
|
3047
|
-
function
|
|
3023
|
+
function Vr(e, t) {
|
|
3048
3024
|
return {
|
|
3049
3025
|
height: `${e}px`,
|
|
3050
3026
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -3052,8 +3028,8 @@ function Ur(e, t) {
|
|
|
3052
3028
|
}
|
|
3053
3029
|
//#endregion
|
|
3054
3030
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
3055
|
-
var
|
|
3056
|
-
function
|
|
3031
|
+
var Hr = 250, Ur = 1e3;
|
|
3032
|
+
function Wr(e) {
|
|
3057
3033
|
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
|
|
3058
3034
|
x(() => {
|
|
3059
3035
|
y();
|
|
@@ -3069,7 +3045,7 @@ function Kr(e) {
|
|
|
3069
3045
|
function u(t) {
|
|
3070
3046
|
if (!b(t) || !e.isAtBoundary()) return;
|
|
3071
3047
|
let n = Date.now();
|
|
3072
|
-
n < s || (s = n +
|
|
3048
|
+
n < s || (s = n + Hr, m());
|
|
3073
3049
|
}
|
|
3074
3050
|
function d() {
|
|
3075
3051
|
if (!g()) return;
|
|
@@ -3103,7 +3079,7 @@ function Kr(e) {
|
|
|
3103
3079
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
3104
3080
|
}
|
|
3105
3081
|
function _() {
|
|
3106
|
-
o.value = !1, v(
|
|
3082
|
+
o.value = !1, v(Ur);
|
|
3107
3083
|
}
|
|
3108
3084
|
function v(e) {
|
|
3109
3085
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -3126,42 +3102,42 @@ function Kr(e) {
|
|
|
3126
3102
|
}
|
|
3127
3103
|
//#endregion
|
|
3128
3104
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
3129
|
-
var
|
|
3130
|
-
function
|
|
3131
|
-
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth ||
|
|
3105
|
+
var Gr = 600, Kr = 24, qr = 16, Jr = 300, Yr = 200, Xr = 200, Zr = Kr + qr, Qr = 200, $r = 300, ei = 24, ti = 48, ni = 500, ri = 1e3;
|
|
3106
|
+
function ii(e) {
|
|
3107
|
+
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Jr), 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(Jr, a.value - Kr * 2)), h = i(() => vr(m.value, Jr)), g = i(() => yr(m.value, h.value, Jr, qr)), v = i(() => ai(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Sr({
|
|
3132
3108
|
itemCount: e.items.value.length,
|
|
3133
3109
|
viewportHeight: r.value,
|
|
3134
3110
|
scrollTop: n.value,
|
|
3135
|
-
overscanPx:
|
|
3136
|
-
bucketPx:
|
|
3111
|
+
overscanPx: Yr,
|
|
3112
|
+
bucketPx: Gr,
|
|
3137
3113
|
buckets: c.value
|
|
3138
3114
|
})), b = i(() => y.value.map((t) => ({
|
|
3139
3115
|
item: e.items.value[t],
|
|
3140
3116
|
index: t
|
|
3141
3117
|
}))), C = i(() => {
|
|
3142
|
-
let e = l.value +
|
|
3143
|
-
return Math.max(e, t, r.value) +
|
|
3144
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() =>
|
|
3118
|
+
let e = l.value + Kr * 2, t = d.value ?? 0;
|
|
3119
|
+
return Math.max(e, t, r.value) + Qr;
|
|
3120
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => si({
|
|
3145
3121
|
active: e.active.value,
|
|
3146
3122
|
maxScrollTop: se(),
|
|
3147
3123
|
progressDistancePx: n.value,
|
|
3148
|
-
thresholdPx:
|
|
3124
|
+
thresholdPx: Xr,
|
|
3149
3125
|
triggerEnabled: w.value
|
|
3150
|
-
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() =>
|
|
3126
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => oi({
|
|
3151
3127
|
active: e.active.value,
|
|
3152
3128
|
maxScrollTop: se(),
|
|
3153
3129
|
progressDistancePx: n.value,
|
|
3154
|
-
thresholdPx:
|
|
3130
|
+
thresholdPx: Zr,
|
|
3155
3131
|
triggerEnabled: e.hasPreviousPage.value
|
|
3156
|
-
})), k = i(() => Math.max(0, r.value -
|
|
3132
|
+
})), k = i(() => Math.max(0, r.value - ei * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
|
|
3157
3133
|
if (!A.value) return 0;
|
|
3158
3134
|
let e = r.value / C.value * k.value;
|
|
3159
|
-
return Math.min(k.value, Math.max(
|
|
3135
|
+
return Math.min(k.value, Math.max(ti, e));
|
|
3160
3136
|
}), M = i(() => {
|
|
3161
|
-
if (!A.value) return
|
|
3137
|
+
if (!A.value) return ei;
|
|
3162
3138
|
let e = Math.max(0, C.value - r.value);
|
|
3163
|
-
return
|
|
3164
|
-
}), N =
|
|
3139
|
+
return ei + Math.max(0, k.value - j.value) * (e > 0 ? ai(n.value / e, 0, 1) : 0);
|
|
3140
|
+
}), N = Fr({
|
|
3165
3141
|
items: e.items,
|
|
3166
3142
|
visibleIndices: y,
|
|
3167
3143
|
positions: o,
|
|
@@ -3170,27 +3146,27 @@ function oi(e) {
|
|
|
3170
3146
|
columnWidth: g,
|
|
3171
3147
|
scrollTop: n,
|
|
3172
3148
|
viewportHeight: r
|
|
3173
|
-
}), P =
|
|
3149
|
+
}), P = Wr({
|
|
3174
3150
|
direction: "top",
|
|
3175
3151
|
getAnimationLockMs(e) {
|
|
3176
|
-
return Math.max(
|
|
3152
|
+
return Math.max(ni, Mr(e)) + ri;
|
|
3177
3153
|
},
|
|
3178
3154
|
hasPage: e.hasPreviousPage,
|
|
3179
3155
|
interactionLocked: p,
|
|
3180
3156
|
isAtBoundary() {
|
|
3181
|
-
return n.value <=
|
|
3157
|
+
return n.value <= Zr;
|
|
3182
3158
|
},
|
|
3183
3159
|
loading: e.loading,
|
|
3184
3160
|
requestPage: e.requestPreviousPage
|
|
3185
|
-
}), F =
|
|
3161
|
+
}), F = Wr({
|
|
3186
3162
|
direction: "bottom",
|
|
3187
3163
|
getAnimationLockMs(e) {
|
|
3188
|
-
return
|
|
3164
|
+
return Mr(e) + ri;
|
|
3189
3165
|
},
|
|
3190
3166
|
hasPage: w,
|
|
3191
3167
|
interactionLocked: p,
|
|
3192
3168
|
isAtBoundary() {
|
|
3193
|
-
return oe() <=
|
|
3169
|
+
return oe() <= Xr;
|
|
3194
3170
|
},
|
|
3195
3171
|
loading: e.loading,
|
|
3196
3172
|
requestPage: e.requestNextPage
|
|
@@ -3200,7 +3176,7 @@ function oi(e) {
|
|
|
3200
3176
|
h,
|
|
3201
3177
|
g
|
|
3202
3178
|
], async ([t], [r = []]) => {
|
|
3203
|
-
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c =
|
|
3179
|
+
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = Cr(a, u.value, o.value), l = ue(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
|
|
3204
3180
|
let t = $(e);
|
|
3205
3181
|
if (f.has(t)) return [];
|
|
3206
3182
|
let n = c.get(t), r = l.get(t);
|
|
@@ -3209,8 +3185,8 @@ function oi(e) {
|
|
|
3209
3185
|
item: e,
|
|
3210
3186
|
position: n
|
|
3211
3187
|
}];
|
|
3212
|
-
}), 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 >
|
|
3213
|
-
y && K(
|
|
3188
|
+
}), 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 > Kr + qr, b = h && n.value > Kr + qr ? t[v.value] : null, x = b ? $(b) : null;
|
|
3189
|
+
y && K(Nr() + ri), 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 ? ni : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
|
|
3214
3190
|
}, { immediate: !0 }), L([
|
|
3215
3191
|
() => e.pendingAppendItems.value.map((e) => $(e)),
|
|
3216
3192
|
h,
|
|
@@ -3227,7 +3203,7 @@ function oi(e) {
|
|
|
3227
3203
|
}
|
|
3228
3204
|
if (i !== !1 || f.value == null) return;
|
|
3229
3205
|
await _();
|
|
3230
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
3206
|
+
let o = Math.max(0, C.value - r.value), s = ai(f.value, 0, o);
|
|
3231
3207
|
a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
|
|
3232
3208
|
}), L(() => e.loading.value, async (t) => {
|
|
3233
3209
|
!t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
|
|
@@ -3239,16 +3215,16 @@ function oi(e) {
|
|
|
3239
3215
|
I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
|
|
3240
3216
|
});
|
|
3241
3217
|
function te() {
|
|
3242
|
-
let t =
|
|
3218
|
+
let t = xr(e.items.value, {
|
|
3243
3219
|
columnCount: h.value,
|
|
3244
3220
|
columnWidth: g.value,
|
|
3245
|
-
gapX:
|
|
3246
|
-
gapY:
|
|
3247
|
-
bucketPx:
|
|
3221
|
+
gapX: qr,
|
|
3222
|
+
gapY: qr,
|
|
3223
|
+
bucketPx: Gr
|
|
3248
3224
|
});
|
|
3249
3225
|
o.value = t.positions.map((e) => ({
|
|
3250
|
-
x: e.x +
|
|
3251
|
-
y: e.y +
|
|
3226
|
+
x: e.x + Kr,
|
|
3227
|
+
y: e.y + Kr
|
|
3252
3228
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
3253
3229
|
}
|
|
3254
3230
|
function V() {
|
|
@@ -3273,7 +3249,7 @@ function oi(e) {
|
|
|
3273
3249
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
3274
3250
|
if (!a || !c || !l) return;
|
|
3275
3251
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
3276
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
3252
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Kr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Kr), a.scrollTop = ai(u, 0, d), n.value = a.scrollTop, q();
|
|
3277
3253
|
}
|
|
3278
3254
|
function ne(e, r) {
|
|
3279
3255
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
@@ -3306,7 +3282,7 @@ function oi(e) {
|
|
|
3306
3282
|
e.setActiveIndex(i);
|
|
3307
3283
|
}
|
|
3308
3284
|
function re() {
|
|
3309
|
-
let t = n.value <=
|
|
3285
|
+
let t = n.value <= Zr, r = oe() <= Xr;
|
|
3310
3286
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
3311
3287
|
}
|
|
3312
3288
|
function J() {
|
|
@@ -3316,29 +3292,29 @@ function oi(e) {
|
|
|
3316
3292
|
r.value = ie(), a.value = ae();
|
|
3317
3293
|
}
|
|
3318
3294
|
function ie() {
|
|
3319
|
-
return
|
|
3295
|
+
return Rr(t.value, r.value);
|
|
3320
3296
|
}
|
|
3321
3297
|
function ae() {
|
|
3322
|
-
return
|
|
3298
|
+
return zr(t.value, a.value, Jr);
|
|
3323
3299
|
}
|
|
3324
3300
|
function oe() {
|
|
3325
|
-
return
|
|
3301
|
+
return Br(t.value, n.value, r.value, C.value);
|
|
3326
3302
|
}
|
|
3327
3303
|
function se() {
|
|
3328
3304
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
3329
3305
|
return Math.max(0, e - r.value);
|
|
3330
3306
|
}
|
|
3331
3307
|
function ce() {
|
|
3332
|
-
return
|
|
3308
|
+
return Vr(j.value, M.value);
|
|
3333
3309
|
}
|
|
3334
3310
|
function le(e) {
|
|
3335
|
-
return e.length ?
|
|
3311
|
+
return e.length ? xr(e, {
|
|
3336
3312
|
columnCount: h.value,
|
|
3337
3313
|
columnWidth: g.value,
|
|
3338
|
-
gapX:
|
|
3339
|
-
gapY:
|
|
3340
|
-
bucketPx:
|
|
3341
|
-
}).contentHeight +
|
|
3314
|
+
gapX: qr,
|
|
3315
|
+
gapY: qr,
|
|
3316
|
+
bucketPx: Gr
|
|
3317
|
+
}).contentHeight + Kr * 2 : 0;
|
|
3342
3318
|
}
|
|
3343
3319
|
function ue(e) {
|
|
3344
3320
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3360,7 +3336,7 @@ function oi(e) {
|
|
|
3360
3336
|
} finally {
|
|
3361
3337
|
d.value = null, ee = !1;
|
|
3362
3338
|
}
|
|
3363
|
-
},
|
|
3339
|
+
}, $r));
|
|
3364
3340
|
}
|
|
3365
3341
|
function de() {
|
|
3366
3342
|
z &&= (clearTimeout(z), null);
|
|
@@ -3387,27 +3363,27 @@ function oi(e) {
|
|
|
3387
3363
|
scrollViewportRef: t
|
|
3388
3364
|
};
|
|
3389
3365
|
}
|
|
3390
|
-
function
|
|
3366
|
+
function ai(e, t, n) {
|
|
3391
3367
|
return Math.min(Math.max(e, t), n);
|
|
3392
3368
|
}
|
|
3393
|
-
function
|
|
3369
|
+
function oi(e) {
|
|
3394
3370
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3395
3371
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3396
|
-
return t <= 0 ? 1 :
|
|
3372
|
+
return t <= 0 ? 1 : ai(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
3397
3373
|
}
|
|
3398
|
-
function
|
|
3374
|
+
function si(e) {
|
|
3399
3375
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3400
3376
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3401
|
-
return t <= 0 ? 1 :
|
|
3377
|
+
return t <= 0 ? 1 : ai(e.progressDistancePx / t, 0, 1);
|
|
3402
3378
|
}
|
|
3403
3379
|
//#endregion
|
|
3404
3380
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
3405
|
-
function
|
|
3381
|
+
function ci(e) {
|
|
3406
3382
|
if (e) try {
|
|
3407
3383
|
e.removeAttribute("src"), e.src = "";
|
|
3408
3384
|
} catch {}
|
|
3409
3385
|
}
|
|
3410
|
-
function
|
|
3386
|
+
function li(e) {
|
|
3411
3387
|
if (e) {
|
|
3412
3388
|
try {
|
|
3413
3389
|
e.currentTime = 0;
|
|
@@ -3418,12 +3394,12 @@ function di(e) {
|
|
|
3418
3394
|
} catch {}
|
|
3419
3395
|
}
|
|
3420
3396
|
}
|
|
3421
|
-
function
|
|
3397
|
+
function ui(e, t) {
|
|
3422
3398
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
3423
3399
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
3424
3400
|
return e.bottom > 0 && e.top < n;
|
|
3425
3401
|
}
|
|
3426
|
-
function
|
|
3402
|
+
function di(e) {
|
|
3427
3403
|
if (!e) return null;
|
|
3428
3404
|
try {
|
|
3429
3405
|
return new URL(e, window.location.href).href;
|
|
@@ -3433,9 +3409,9 @@ function pi(e) {
|
|
|
3433
3409
|
}
|
|
3434
3410
|
//#endregion
|
|
3435
3411
|
//#region src/components/viewer-core/listPreview.ts
|
|
3436
|
-
var
|
|
3437
|
-
function
|
|
3438
|
-
let t =
|
|
3412
|
+
var fi = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, pi = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, mi = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3413
|
+
function hi(e) {
|
|
3414
|
+
let t = gi(e), n = t?.url, r = _r(e), i = e.title?.trim() || Pt(e.type);
|
|
3439
3415
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
3440
3416
|
kind: "video",
|
|
3441
3417
|
url: n,
|
|
@@ -3454,13 +3430,13 @@ function _i(e) {
|
|
|
3454
3430
|
width: r.width,
|
|
3455
3431
|
height: r.height,
|
|
3456
3432
|
label: i
|
|
3457
|
-
} : typeof n == "string" &&
|
|
3433
|
+
} : typeof n == "string" && vi(e, n) ? {
|
|
3458
3434
|
kind: "video",
|
|
3459
3435
|
url: n,
|
|
3460
3436
|
width: r.width,
|
|
3461
3437
|
height: r.height,
|
|
3462
3438
|
label: i
|
|
3463
|
-
} : typeof n == "string" &&
|
|
3439
|
+
} : typeof n == "string" && _i(e, n) ? {
|
|
3464
3440
|
kind: "image",
|
|
3465
3441
|
url: n,
|
|
3466
3442
|
width: r.width,
|
|
@@ -3474,26 +3450,26 @@ function _i(e) {
|
|
|
3474
3450
|
label: i
|
|
3475
3451
|
};
|
|
3476
3452
|
}
|
|
3477
|
-
function
|
|
3453
|
+
function gi(e) {
|
|
3478
3454
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3479
3455
|
}
|
|
3480
|
-
function
|
|
3481
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
3456
|
+
function _i(e, t) {
|
|
3457
|
+
return e.type !== "image" || typeof t != "string" ? !1 : fi.test(t) || yi(t);
|
|
3482
3458
|
}
|
|
3483
|
-
function
|
|
3484
|
-
return e.type !== "video" || typeof t != "string" ? !1 :
|
|
3459
|
+
function vi(e, t) {
|
|
3460
|
+
return e.type !== "video" || typeof t != "string" ? !1 : pi.test(t) || bi(t);
|
|
3485
3461
|
}
|
|
3486
|
-
function
|
|
3462
|
+
function yi(e) {
|
|
3487
3463
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3488
3464
|
}
|
|
3489
|
-
function
|
|
3490
|
-
return
|
|
3465
|
+
function bi(e) {
|
|
3466
|
+
return mi.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3491
3467
|
}
|
|
3492
3468
|
//#endregion
|
|
3493
3469
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3494
|
-
function
|
|
3470
|
+
function xi(e) {
|
|
3495
3471
|
let t = D(null), n = i(() => {
|
|
3496
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3472
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? di(e.item.value.healthCheck.url) : null;
|
|
3497
3473
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3498
3474
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3499
3475
|
L(n, (e, n) => {
|
|
@@ -3525,7 +3501,7 @@ function Ci(e) {
|
|
|
3525
3501
|
r.refresh();
|
|
3526
3502
|
return;
|
|
3527
3503
|
}
|
|
3528
|
-
r =
|
|
3504
|
+
r = It.request({
|
|
3529
3505
|
assetType: "probe",
|
|
3530
3506
|
getPriority: e.getPriority,
|
|
3531
3507
|
onGrant() {
|
|
@@ -3535,7 +3511,7 @@ function Ci(e) {
|
|
|
3535
3511
|
return;
|
|
3536
3512
|
}
|
|
3537
3513
|
let i = ++a;
|
|
3538
|
-
|
|
3514
|
+
un(r).then((s) => {
|
|
3539
3515
|
if (!(i !== a || n.value !== r)) {
|
|
3540
3516
|
if (o.set(r, s ?? null), !s) {
|
|
3541
3517
|
t.value = null;
|
|
@@ -3571,14 +3547,14 @@ function Ci(e) {
|
|
|
3571
3547
|
}
|
|
3572
3548
|
//#endregion
|
|
3573
3549
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3574
|
-
var
|
|
3550
|
+
var Si = ["aria-label"], Ci = {
|
|
3575
3551
|
key: 0,
|
|
3576
3552
|
"data-testid": "vibe-list-card-spinner",
|
|
3577
3553
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3578
|
-
},
|
|
3554
|
+
}, wi = { 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]" }, Ti = ["src", "alt"], Ei = ["src"], Di = ["data-kind"], Oi = { class: "grid justify-items-center gap-3 px-4 text-center" }, ki = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Ai = {
|
|
3579
3555
|
key: 4,
|
|
3580
3556
|
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))]"
|
|
3581
|
-
},
|
|
3557
|
+
}, ji = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Mi = { class: "pointer-events-none absolute inset-0 z-[3]" }, Ni = /* @__PURE__ */ d({
|
|
3582
3558
|
__name: "ListCard",
|
|
3583
3559
|
props: {
|
|
3584
3560
|
active: {
|
|
@@ -3602,7 +3578,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3602
3578
|
},
|
|
3603
3579
|
emits: ["open"],
|
|
3604
3580
|
setup(e, { emit: t }) {
|
|
3605
|
-
let n = e, r = t, l = i(() =>
|
|
3581
|
+
let n = e, r = t, l = i(() => hi(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 = xi({
|
|
3606
3582
|
attachedAssetUrl: E,
|
|
3607
3583
|
getPriority: ue,
|
|
3608
3584
|
isInView: d,
|
|
@@ -3611,7 +3587,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3611
3587
|
loadErrorKind: g,
|
|
3612
3588
|
reportAssetError: n.reportAssetError,
|
|
3613
3589
|
surfaceActive: i(() => n.surfaceActive)
|
|
3614
|
-
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() =>
|
|
3590
|
+
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => cn(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
|
|
3615
3591
|
L([E, () => l.value.kind], () => {
|
|
3616
3592
|
let e = l.value.kind === "fallback";
|
|
3617
3593
|
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
@@ -3652,7 +3628,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3652
3628
|
if (!X(_.value)) return;
|
|
3653
3629
|
let e = E.value ?? n.item.url;
|
|
3654
3630
|
m.value = !1, g.value = "generic";
|
|
3655
|
-
let t = await
|
|
3631
|
+
let t = await ln(e);
|
|
3656
3632
|
g.value = t, n.reportAssetError?.({
|
|
3657
3633
|
item: n.item,
|
|
3658
3634
|
occurrenceKey: $(n.item),
|
|
@@ -3684,7 +3660,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3684
3660
|
V?.refresh();
|
|
3685
3661
|
return;
|
|
3686
3662
|
}
|
|
3687
|
-
V =
|
|
3663
|
+
V = It.request({
|
|
3688
3664
|
assetType: l.value.kind,
|
|
3689
3665
|
getPriority: ue,
|
|
3690
3666
|
onGrant() {
|
|
@@ -3701,7 +3677,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3701
3677
|
return;
|
|
3702
3678
|
}
|
|
3703
3679
|
if (E.value && d.value && m.value) {
|
|
3704
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
3680
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, pn(e);
|
|
3705
3681
|
return;
|
|
3706
3682
|
}
|
|
3707
3683
|
try {
|
|
@@ -3722,7 +3698,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3722
3698
|
d.value = !0;
|
|
3723
3699
|
return;
|
|
3724
3700
|
}
|
|
3725
|
-
d.value =
|
|
3701
|
+
d.value = ui(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3726
3702
|
}
|
|
3727
3703
|
function ie(e) {
|
|
3728
3704
|
if (!e) return;
|
|
@@ -3742,10 +3718,10 @@ var wi = ["aria-label"], Ti = {
|
|
|
3742
3718
|
}), g.value = null, m.value = !1, T.value = !1, J(), K();
|
|
3743
3719
|
}
|
|
3744
3720
|
function se() {
|
|
3745
|
-
|
|
3721
|
+
ci(_.value);
|
|
3746
3722
|
}
|
|
3747
3723
|
function ce() {
|
|
3748
|
-
|
|
3724
|
+
li(C.value);
|
|
3749
3725
|
}
|
|
3750
3726
|
function ue() {
|
|
3751
3727
|
let e = y.value;
|
|
@@ -3759,8 +3735,8 @@ var wi = ["aria-label"], Ti = {
|
|
|
3759
3735
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3760
3736
|
}
|
|
3761
3737
|
function X(e) {
|
|
3762
|
-
let t =
|
|
3763
|
-
return !e || !t ? !1 :
|
|
3738
|
+
let t = di(E.value);
|
|
3739
|
+
return !e || !t ? !1 : di("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3764
3740
|
}
|
|
3765
3741
|
function de() {
|
|
3766
3742
|
r("open");
|
|
@@ -3788,8 +3764,8 @@ var wi = ["aria-label"], Ti = {
|
|
|
3788
3764
|
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]",
|
|
3789
3765
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3790
3766
|
onClick: de
|
|
3791
|
-
}, null, 8,
|
|
3792
|
-
B.value ? (w(), s("div",
|
|
3767
|
+
}, null, 8, Si),
|
|
3768
|
+
B.value ? (w(), s("div", Ci, [c("span", wi, [u(N(oe), {
|
|
3793
3769
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3794
3770
|
"aria-hidden": "true"
|
|
3795
3771
|
})])])) : o("", !0),
|
|
@@ -3803,7 +3779,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3803
3779
|
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"]),
|
|
3804
3780
|
onLoad: U,
|
|
3805
3781
|
onError: W
|
|
3806
|
-
}, null, 42,
|
|
3782
|
+
}, null, 42, Ti)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3807
3783
|
key: 2,
|
|
3808
3784
|
ref_key: "videoRef",
|
|
3809
3785
|
ref: C,
|
|
@@ -3819,31 +3795,31 @@ var wi = ["aria-label"], Ti = {
|
|
|
3819
3795
|
onPlaying: ne,
|
|
3820
3796
|
onStalled: G,
|
|
3821
3797
|
onWaiting: G
|
|
3822
|
-
}, null, 42,
|
|
3798
|
+
}, null, 42, Ei)) : R.value ? (w(), s("div", {
|
|
3823
3799
|
key: 3,
|
|
3824
3800
|
"data-testid": "vibe-list-card-error",
|
|
3825
3801
|
"data-kind": I.value,
|
|
3826
3802
|
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))]"
|
|
3827
|
-
}, [c("div",
|
|
3803
|
+
}, [c("div", Oi, [
|
|
3828
3804
|
u(N(le), {
|
|
3829
3805
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3830
3806
|
"aria-hidden": "true"
|
|
3831
3807
|
}),
|
|
3832
|
-
c("span",
|
|
3808
|
+
c("span", ki, j(N(sn)(I.value)), 1),
|
|
3833
3809
|
z.value ? (w(), s("button", {
|
|
3834
3810
|
key: 0,
|
|
3835
3811
|
type: "button",
|
|
3836
3812
|
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",
|
|
3837
3813
|
onClick: ee(ae, ["stop"])
|
|
3838
3814
|
}, " Retry ")) : o("", !0)
|
|
3839
|
-
])], 8,
|
|
3815
|
+
])], 8, Di)) : (w(), s("div", Ai, [c("div", ji, [k(e.$slots, "item-icon", {
|
|
3840
3816
|
icon: N(Nt)(n.item.type),
|
|
3841
3817
|
item: n.item
|
|
3842
3818
|
}, () => [(w(), a(A(N(Nt)(n.item.type)), {
|
|
3843
3819
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3844
3820
|
"aria-hidden": "true"
|
|
3845
3821
|
}))])])])),
|
|
3846
|
-
c("div",
|
|
3822
|
+
c("div", Mi, [k(e.$slots, "grid-item-overlay", {
|
|
3847
3823
|
active: n.active,
|
|
3848
3824
|
focused: f.value,
|
|
3849
3825
|
hovered: p.value,
|
|
@@ -3853,24 +3829,24 @@ var wi = ["aria-label"], Ti = {
|
|
|
3853
3829
|
})])
|
|
3854
3830
|
], 34));
|
|
3855
3831
|
}
|
|
3856
|
-
}),
|
|
3832
|
+
}), Pi = { 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)]" }, Fi = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Ii = {
|
|
3857
3833
|
"data-testid": "vibe-pagination",
|
|
3858
3834
|
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]"
|
|
3859
|
-
},
|
|
3835
|
+
}, Li = { class: "whitespace-nowrap" }, Ri = {
|
|
3860
3836
|
key: 0,
|
|
3861
3837
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3862
|
-
},
|
|
3838
|
+
}, zi = [
|
|
3863
3839
|
"data-active",
|
|
3864
3840
|
"data-index",
|
|
3865
3841
|
"data-item-id",
|
|
3866
3842
|
"data-occurrence-key"
|
|
3867
|
-
],
|
|
3843
|
+
], Bi = ["data-item-id"], Vi = {
|
|
3868
3844
|
key: 0,
|
|
3869
3845
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3870
|
-
},
|
|
3846
|
+
}, Hi = {
|
|
3871
3847
|
key: 1,
|
|
3872
3848
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3873
|
-
},
|
|
3849
|
+
}, Ui = { class: "mx-auto flex w-full justify-center" }, Wi = /* @__PURE__ */ d({
|
|
3874
3850
|
__name: "ListSurface",
|
|
3875
3851
|
props: {
|
|
3876
3852
|
active: {
|
|
@@ -3931,7 +3907,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3931
3907
|
"update:activeIndex"
|
|
3932
3908
|
],
|
|
3933
3909
|
setup(e, { emit: n }) {
|
|
3934
|
-
let r = e, d = F(), f = n, p =
|
|
3910
|
+
let r = e, d = F(), f = n, p = ii({
|
|
3935
3911
|
active: M(r, "active"),
|
|
3936
3912
|
allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
|
|
3937
3913
|
items: M(r, "items"),
|
|
@@ -3947,11 +3923,11 @@ var wi = ["aria-label"], Ti = {
|
|
|
3947
3923
|
setActiveIndex(e) {
|
|
3948
3924
|
f("update:activeIndex", e);
|
|
3949
3925
|
}
|
|
3950
|
-
}), m = i(() =>
|
|
3926
|
+
}), m = i(() => Zt({
|
|
3951
3927
|
itemCount: r.items.length,
|
|
3952
3928
|
loading: r.loading,
|
|
3953
3929
|
phase: r.phase
|
|
3954
|
-
})), h = i(() =>
|
|
3930
|
+
})), h = i(() => Qt({
|
|
3955
3931
|
errorMessage: r.errorMessage,
|
|
3956
3932
|
hasItems: r.items.length > 0,
|
|
3957
3933
|
hasNextPage: r.hasNextPage,
|
|
@@ -3964,7 +3940,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3964
3940
|
message: h.value.message,
|
|
3965
3941
|
paginationDetail: r.paginationDetail,
|
|
3966
3942
|
total: r.items.length
|
|
3967
|
-
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() =>
|
|
3943
|
+
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => Kt(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Yt({
|
|
3968
3944
|
emptyStateMode: M(r, "emptyStateMode"),
|
|
3969
3945
|
itemCount: C,
|
|
3970
3946
|
loading: M(r, "loading"),
|
|
@@ -3976,8 +3952,8 @@ var wi = ["aria-label"], Ti = {
|
|
|
3976
3952
|
nextBoundaryLoadProgress: e,
|
|
3977
3953
|
previousBoundaryLoadProgress: t
|
|
3978
3954
|
});
|
|
3979
|
-
}, { immediate: !0 }), (e, n) => (w(), s("div",
|
|
3980
|
-
c("div",
|
|
3955
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", Pi, [
|
|
3956
|
+
c("div", Fi, [c("span", Ii, [c("span", Li, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Ri, j(r.paginationDetail), 1)) : o("", !0)])]),
|
|
3981
3957
|
c("div", {
|
|
3982
3958
|
ref: N(p).scrollViewportRef,
|
|
3983
3959
|
"data-testid": "vibe-list-scroll",
|
|
@@ -3998,7 +3974,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
3998
3974
|
"data-occurrence-key": N($)(t),
|
|
3999
3975
|
class: "absolute will-change-transform",
|
|
4000
3976
|
style: b(N(p).getCardStyle(n))
|
|
4001
|
-
}, [u(
|
|
3977
|
+
}, [u(Ni, {
|
|
4002
3978
|
active: n === N(p).resolvedActiveIndex.value,
|
|
4003
3979
|
index: n,
|
|
4004
3980
|
item: t,
|
|
@@ -4022,14 +3998,14 @@ var wi = ["aria-label"], Ti = {
|
|
|
4022
3998
|
"report-asset-load",
|
|
4023
3999
|
"surface-active",
|
|
4024
4000
|
"onOpen"
|
|
4025
|
-
])], 12,
|
|
4001
|
+
])], 12, zi))), 128)),
|
|
4026
4002
|
(w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
|
|
4027
4003
|
key: `leaving-${N($)(t.item)}`,
|
|
4028
4004
|
"data-testid": "vibe-list-card-leaving",
|
|
4029
4005
|
"data-item-id": t.item.id,
|
|
4030
4006
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
4031
4007
|
style: b(N(p).getLeavingCardStyle(t.item))
|
|
4032
|
-
}, [u(
|
|
4008
|
+
}, [u(Ni, {
|
|
4033
4009
|
active: !1,
|
|
4034
4010
|
index: -1,
|
|
4035
4011
|
item: t.item,
|
|
@@ -4044,8 +4020,8 @@ var wi = ["aria-label"], Ti = {
|
|
|
4044
4020
|
"item",
|
|
4045
4021
|
"report-asset-error",
|
|
4046
4022
|
"report-asset-load"
|
|
4047
|
-
])], 12,
|
|
4048
|
-
N(A) && N(T) ? (w(), a(
|
|
4023
|
+
])], 12, Bi))), 128)),
|
|
4024
|
+
N(A) && N(T) ? (w(), a(Mn, {
|
|
4049
4025
|
key: 0,
|
|
4050
4026
|
message: N(T).message,
|
|
4051
4027
|
mode: N(T).mode,
|
|
@@ -4059,12 +4035,12 @@ var wi = ["aria-label"], Ti = {
|
|
|
4059
4035
|
"surface"
|
|
4060
4036
|
])) : o("", !0)
|
|
4061
4037
|
], 4)], 544),
|
|
4062
|
-
N(p).showScrollbar.value ? (w(), s("div",
|
|
4038
|
+
N(p).showScrollbar.value ? (w(), s("div", Vi, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
4063
4039
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
4064
4040
|
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"]),
|
|
4065
4041
|
style: b(N(p).getScrollbarThumbStyle())
|
|
4066
4042
|
}, null, 6)])) : o("", !0),
|
|
4067
|
-
d["grid-footer"] ? (w(), s("div",
|
|
4043
|
+
d["grid-footer"] ? (w(), s("div", Hi, [c("div", Ui, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
4068
4044
|
_.value ? (w(), s("div", {
|
|
4069
4045
|
key: 2,
|
|
4070
4046
|
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"])
|
|
@@ -4073,7 +4049,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
4073
4049
|
"data-testid": "vibe-grid-status-badge",
|
|
4074
4050
|
class: v(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", _.value.kind === "end" ? "border-amber-300/35 text-amber-200" : _.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
4075
4051
|
}, j(_.value.message), 3))], 2)) : o("", !0),
|
|
4076
|
-
N(E) && N(T) ? (w(), a(
|
|
4052
|
+
N(E) && N(T) ? (w(), a(Mn, {
|
|
4077
4053
|
key: 3,
|
|
4078
4054
|
class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
4079
4055
|
message: N(T).message,
|
|
@@ -4090,13 +4066,13 @@ var wi = ["aria-label"], Ti = {
|
|
|
4090
4066
|
])) : o("", !0)
|
|
4091
4067
|
]));
|
|
4092
4068
|
}
|
|
4093
|
-
}),
|
|
4069
|
+
}), Gi = ["data-surface-mode"], Ki = {
|
|
4094
4070
|
key: 1,
|
|
4095
4071
|
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"
|
|
4096
|
-
},
|
|
4072
|
+
}, qi = ["data-visible", "inert"], Ji = ["data-visible", "inert"], Yi = {
|
|
4097
4073
|
key: 3,
|
|
4098
4074
|
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"
|
|
4099
|
-
},
|
|
4075
|
+
}, Xi = /* @__PURE__ */ d({
|
|
4100
4076
|
name: "VibeLayout",
|
|
4101
4077
|
__name: "Layout",
|
|
4102
4078
|
props: {
|
|
@@ -4155,7 +4131,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
4155
4131
|
type: "button",
|
|
4156
4132
|
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",
|
|
4157
4133
|
onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
|
|
4158
|
-
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div",
|
|
4134
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Ki, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
4159
4135
|
appear: "",
|
|
4160
4136
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
4161
4137
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -4169,7 +4145,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
4169
4145
|
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
4170
4146
|
inert: N(h).surfaceMode.value !== "list",
|
|
4171
4147
|
class: "absolute inset-0 z-[2]"
|
|
4172
|
-
}, [u(
|
|
4148
|
+
}, [u(Wi, {
|
|
4173
4149
|
active: N(h).surfaceMode.value === "list",
|
|
4174
4150
|
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
4175
4151
|
items: N(h).items.value,
|
|
@@ -4239,7 +4215,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
4239
4215
|
"onBoundaryLoadProgress",
|
|
4240
4216
|
"onOpenFullscreen",
|
|
4241
4217
|
"onUpdate:activeIndex"
|
|
4242
|
-
])], 8,
|
|
4218
|
+
])], 8, qi), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
4243
4219
|
_: 3
|
|
4244
4220
|
}), u(r, {
|
|
4245
4221
|
appear: "",
|
|
@@ -4255,7 +4231,7 @@ var wi = ["aria-label"], Ti = {
|
|
|
4255
4231
|
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4256
4232
|
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
4257
4233
|
class: "absolute inset-0 z-[3]"
|
|
4258
|
-
}, [u(
|
|
4234
|
+
}, [u(mr, {
|
|
4259
4235
|
items: N(h).items.value,
|
|
4260
4236
|
active: N(h).surfaceMode.value === "fullscreen",
|
|
4261
4237
|
"active-index": N(h).activeIndex.value,
|
|
@@ -4324,12 +4300,12 @@ var wi = ["aria-label"], Ti = {
|
|
|
4324
4300
|
"show-back-to-list",
|
|
4325
4301
|
"onBackToList",
|
|
4326
4302
|
"onUpdate:activeIndex"
|
|
4327
|
-
])], 8,
|
|
4303
|
+
])], 8, Ji), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
4328
4304
|
_: 3
|
|
4329
|
-
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div",
|
|
4305
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Yi, [u(N(oe), {
|
|
4330
4306
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
4331
4307
|
"aria-hidden": "true"
|
|
4332
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(
|
|
4308
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(mr, {
|
|
4333
4309
|
key: 4,
|
|
4334
4310
|
items: N(h).items.value,
|
|
4335
4311
|
active: !0,
|
|
@@ -4397,10 +4373,10 @@ var wi = ["aria-label"], Ti = {
|
|
|
4397
4373
|
"show-status-badges",
|
|
4398
4374
|
"onBackToList",
|
|
4399
4375
|
"onUpdate:activeIndex"
|
|
4400
|
-
]))], 8,
|
|
4376
|
+
]))], 8, Gi));
|
|
4401
4377
|
}
|
|
4402
|
-
}),
|
|
4403
|
-
e.component("VibeLayout",
|
|
4378
|
+
}), Zi = { install(e) {
|
|
4379
|
+
e.component("VibeLayout", Xi);
|
|
4404
4380
|
} };
|
|
4405
4381
|
//#endregion
|
|
4406
|
-
export {
|
|
4382
|
+
export { Xi as VibeLayout, Zi as VibePlugin, Zi as default };
|