@flemo/core 1.19.1 → 1.21.0
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/dist/core/engine/__tests__/arrivalHold.test.d.ts +1 -0
- package/dist/core/engine/__tests__/compositorWarmUp.test.d.ts +1 -0
- package/dist/core/engine/__tests__/imageDecodeOffloader.test.d.ts +1 -0
- package/dist/core/engine/__tests__/perceptualSpan.test.d.ts +1 -0
- package/dist/core/engine/arrivalHold.d.ts +2 -0
- package/dist/core/engine/compositorWarmUp.d.ts +2 -0
- package/dist/core/engine/driverPolicy.d.ts +2 -1
- package/dist/core/engine/imageDecodeOffloader.d.ts +12 -0
- package/dist/core/engine/perceptualSpan.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +892 -348
- package/dist/screen/__tests__/pendingNetwork.test.d.ts +1 -0
- package/dist/screen/animStartAnchor.d.ts +6 -0
- package/dist/screen/pendingNetwork.d.ts +2 -0
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -505,7 +505,7 @@ function ee(e, t) {
|
|
|
505
505
|
return null;
|
|
506
506
|
}
|
|
507
507
|
var D = /* @__PURE__ */ new WeakMap();
|
|
508
|
-
function
|
|
508
|
+
function O(e) {
|
|
509
509
|
D.has(e) || D.set(e, x({
|
|
510
510
|
stores: e,
|
|
511
511
|
driver: e.driver,
|
|
@@ -515,12 +515,12 @@ function te(e) {
|
|
|
515
515
|
ownsPathname: e.ownsPathname
|
|
516
516
|
}));
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function te(e) {
|
|
519
519
|
e.persistent || (D.get(e)?.(), D.delete(e));
|
|
520
520
|
}
|
|
521
521
|
//#endregion
|
|
522
522
|
//#region src/history/memoryHistoryDriver.ts
|
|
523
|
-
function
|
|
523
|
+
function ne(e) {
|
|
524
524
|
let t = [{
|
|
525
525
|
state: e?.state ?? null,
|
|
526
526
|
url: e?.url ?? "/"
|
|
@@ -562,7 +562,7 @@ function re(e) {
|
|
|
562
562
|
}
|
|
563
563
|
//#endregion
|
|
564
564
|
//#region src/navigate/store.ts
|
|
565
|
-
function
|
|
565
|
+
function re() {
|
|
566
566
|
return e((e) => ({
|
|
567
567
|
status: "IDLE",
|
|
568
568
|
transitionTaskId: null,
|
|
@@ -584,7 +584,7 @@ var k = (e, t, n) => {
|
|
|
584
584
|
let s = await Promise.race([a, o]);
|
|
585
585
|
i(), s && r();
|
|
586
586
|
};
|
|
587
|
-
function
|
|
587
|
+
function ie(e) {
|
|
588
588
|
let { stores: t, buildPathname: n, driver: r = g(), markSelfInduced: i = y } = e, o = () => t.history.getState().bumpTruncationEpoch(), c = () => {
|
|
589
589
|
let e = r.readState();
|
|
590
590
|
if (!e?.id) return null;
|
|
@@ -661,7 +661,16 @@ function M(e) {
|
|
|
661
661
|
})).result?.();
|
|
662
662
|
}, u = async (e, l, u) => {
|
|
663
663
|
let { status: d } = t.navigate.getState();
|
|
664
|
-
if (d !== "COMPLETED" && d !== "IDLE")
|
|
664
|
+
if (d !== "COMPLETED" && d !== "IDLE") {
|
|
665
|
+
await s.resolveAllPending();
|
|
666
|
+
for (let e = 0; e < 5; e++) {
|
|
667
|
+
let { status: e } = t.navigate.getState();
|
|
668
|
+
if (e === "COMPLETED" || e === "IDLE") break;
|
|
669
|
+
await new Promise((e) => setTimeout(e, 0));
|
|
670
|
+
}
|
|
671
|
+
let { status: e } = t.navigate.getState();
|
|
672
|
+
if (e !== "COMPLETED" && e !== "IDLE") return;
|
|
673
|
+
}
|
|
665
674
|
let f = t.transition.getState().defaultTransitionName, { transitionName: p = f, layoutId: m = null } = u ?? {}, h = s.generateTaskId();
|
|
666
675
|
(await s.addTask(async (a) => {
|
|
667
676
|
if (t.life && !t.life.alive) {
|
|
@@ -781,14 +790,14 @@ function M(e) {
|
|
|
781
790
|
}
|
|
782
791
|
//#endregion
|
|
783
792
|
//#region src/navigate/createStepController.ts
|
|
784
|
-
var
|
|
793
|
+
var ae = (e) => {
|
|
785
794
|
let t = e;
|
|
786
795
|
return t?.step ? t.params ?? {} : null;
|
|
787
|
-
},
|
|
796
|
+
}, oe = (e, t) => {
|
|
788
797
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
789
798
|
return n ? `${e}?${n}` : e;
|
|
790
799
|
};
|
|
791
|
-
function
|
|
800
|
+
function se(e) {
|
|
792
801
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
|
|
793
802
|
return {
|
|
794
803
|
pushStep: async (e) => {
|
|
@@ -846,7 +855,7 @@ function oe(e) {
|
|
|
846
855
|
}
|
|
847
856
|
};
|
|
848
857
|
}
|
|
849
|
-
function
|
|
858
|
+
function ce(e, t) {
|
|
850
859
|
return e.subscribe((e) => {
|
|
851
860
|
let n = e.state;
|
|
852
861
|
n?.step && s.addTask(async () => {
|
|
@@ -856,7 +865,7 @@ function se(e, t) {
|
|
|
856
865
|
}
|
|
857
866
|
//#endregion
|
|
858
867
|
//#region src/transition/store.ts
|
|
859
|
-
function
|
|
868
|
+
function M(t = "cupertino") {
|
|
860
869
|
return e((e) => ({
|
|
861
870
|
defaultTransitionName: t,
|
|
862
871
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -903,11 +912,11 @@ function ue() {
|
|
|
903
912
|
var de = {
|
|
904
913
|
mark: () => {},
|
|
905
914
|
consume: () => !1
|
|
906
|
-
},
|
|
907
|
-
function
|
|
915
|
+
}, N = /* @__PURE__ */ new Map();
|
|
916
|
+
function fe(e) {
|
|
908
917
|
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: o } = e, s = f() ? void 0 : e.persistKey;
|
|
909
918
|
if (s) {
|
|
910
|
-
let e =
|
|
919
|
+
let e = N.get(s);
|
|
911
920
|
if (e) {
|
|
912
921
|
e.life.alive = !0, e.navigate.getState().setStatus("IDLE"), e.navigate.getState().setTransitionTaskId(null);
|
|
913
922
|
let t = e.history.getState();
|
|
@@ -927,7 +936,7 @@ function pe(e) {
|
|
|
927
936
|
index: 0,
|
|
928
937
|
histories: [p]
|
|
929
938
|
}), e.hostedScope;
|
|
930
|
-
let m = a ?
|
|
939
|
+
let m = a ? ne({
|
|
931
940
|
state: {
|
|
932
941
|
id: p.id,
|
|
933
942
|
index: 0,
|
|
@@ -939,8 +948,8 @@ function pe(e) {
|
|
|
939
948
|
url: p.pathname
|
|
940
949
|
}) : o, h = a ? de : _(), g = {
|
|
941
950
|
history: c([p], 0),
|
|
942
|
-
navigate:
|
|
943
|
-
transition:
|
|
951
|
+
navigate: re(),
|
|
952
|
+
transition: M(i),
|
|
944
953
|
screen: ue(),
|
|
945
954
|
driver: m,
|
|
946
955
|
markSelfInduced: h.mark,
|
|
@@ -951,11 +960,11 @@ function pe(e) {
|
|
|
951
960
|
persistent: !!s,
|
|
952
961
|
life: { alive: !0 }
|
|
953
962
|
};
|
|
954
|
-
return s &&
|
|
963
|
+
return s && N.set(s, g), g;
|
|
955
964
|
}
|
|
956
965
|
//#endregion
|
|
957
966
|
//#region src/screen/createScreenSelector.ts
|
|
958
|
-
function
|
|
967
|
+
function pe(e, t) {
|
|
959
968
|
return e.map((n, r) => ({
|
|
960
969
|
...n,
|
|
961
970
|
isActive: r === t,
|
|
@@ -968,13 +977,13 @@ function me(e, t) {
|
|
|
968
977
|
}
|
|
969
978
|
//#endregion
|
|
970
979
|
//#region src/screen/computeScreenFreeze.ts
|
|
971
|
-
function
|
|
980
|
+
function me(e) {
|
|
972
981
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
973
982
|
return !e.isActive && t || e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex;
|
|
974
983
|
}
|
|
975
984
|
//#endregion
|
|
976
985
|
//#region src/transition/createTransition.ts
|
|
977
|
-
function
|
|
986
|
+
function P({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
978
987
|
return {
|
|
979
988
|
name: e,
|
|
980
989
|
initial: t,
|
|
@@ -995,7 +1004,7 @@ function N({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
995
1004
|
}
|
|
996
1005
|
//#endregion
|
|
997
1006
|
//#region src/transition/createRawTransition.ts
|
|
998
|
-
function
|
|
1007
|
+
function F({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
999
1008
|
return {
|
|
1000
1009
|
name: e,
|
|
1001
1010
|
initial: t,
|
|
@@ -1016,10 +1025,10 @@ function ge({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1016
1025
|
}
|
|
1017
1026
|
//#endregion
|
|
1018
1027
|
//#region src/transition/cupertino.ts
|
|
1019
|
-
var
|
|
1028
|
+
var he = (e, t, n) => {
|
|
1020
1029
|
let [r, i] = t, [a, o] = n;
|
|
1021
1030
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1022
|
-
},
|
|
1031
|
+
}, I = P({
|
|
1023
1032
|
name: "cupertino",
|
|
1024
1033
|
initial: { x: "100%" },
|
|
1025
1034
|
idle: {
|
|
@@ -1079,7 +1088,7 @@ var _e = (e, t, n) => {
|
|
|
1079
1088
|
swipeDirection: "x",
|
|
1080
1089
|
onSwipeStart: async () => !0,
|
|
1081
1090
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
1082
|
-
let { offset: o } = t, s = o.x, c =
|
|
1091
|
+
let { offset: o } = t, s = o.x, c = he(s, [0, window.innerWidth], [0, 100]);
|
|
1083
1092
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-35 + c * .35}%` }, { duration: 0 }), c;
|
|
1084
1093
|
},
|
|
1085
1094
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -1103,10 +1112,10 @@ var _e = (e, t, n) => {
|
|
|
1103
1112
|
})]), c;
|
|
1104
1113
|
}
|
|
1105
1114
|
}
|
|
1106
|
-
}),
|
|
1115
|
+
}), ge = (e, t, n) => {
|
|
1107
1116
|
let [r, i] = t, [a, o] = n;
|
|
1108
1117
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1109
|
-
},
|
|
1118
|
+
}, _e = P({
|
|
1110
1119
|
name: "layout",
|
|
1111
1120
|
initial: { opacity: .97 },
|
|
1112
1121
|
idle: {
|
|
@@ -1134,7 +1143,7 @@ var _e = (e, t, n) => {
|
|
|
1134
1143
|
swipeDirection: "y",
|
|
1135
1144
|
onSwipeStart: async () => !0,
|
|
1136
1145
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
1137
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
1146
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = ge(s, [0, 56], [1, .96]), l = Math.max(0, o - 56), u = Math.min(1, l / 160), d = Math.sqrt(u) * 12, f = Math.max(0, s + d), p = Math.min(56, f);
|
|
1138
1147
|
return i?.(!0, 100), n(r, {
|
|
1139
1148
|
y: f,
|
|
1140
1149
|
opacity: c
|
|
@@ -1151,7 +1160,7 @@ var _e = (e, t, n) => {
|
|
|
1151
1160
|
}, { duration: .3 })]), c;
|
|
1152
1161
|
}
|
|
1153
1162
|
}
|
|
1154
|
-
}),
|
|
1163
|
+
}), ve = P({
|
|
1155
1164
|
name: "material",
|
|
1156
1165
|
initial: { y: "100%" },
|
|
1157
1166
|
idle: {
|
|
@@ -1259,7 +1268,7 @@ var _e = (e, t, n) => {
|
|
|
1259
1268
|
})]), c;
|
|
1260
1269
|
}
|
|
1261
1270
|
}
|
|
1262
|
-
}),
|
|
1271
|
+
}), ye = P({
|
|
1263
1272
|
name: "none",
|
|
1264
1273
|
initial: {},
|
|
1265
1274
|
idle: {
|
|
@@ -1282,20 +1291,20 @@ var _e = (e, t, n) => {
|
|
|
1282
1291
|
value: {},
|
|
1283
1292
|
options: { duration: 0 }
|
|
1284
1293
|
}
|
|
1285
|
-
}),
|
|
1286
|
-
["none",
|
|
1287
|
-
["cupertino",
|
|
1288
|
-
["material",
|
|
1289
|
-
["layout",
|
|
1294
|
+
}), L = /* @__PURE__ */ new Map([
|
|
1295
|
+
["none", ye],
|
|
1296
|
+
["cupertino", I],
|
|
1297
|
+
["material", ve],
|
|
1298
|
+
["layout", _e]
|
|
1290
1299
|
]);
|
|
1291
1300
|
//#endregion
|
|
1292
1301
|
//#region src/transition/resolveTransition.ts
|
|
1293
|
-
function
|
|
1294
|
-
return
|
|
1302
|
+
function be(e) {
|
|
1303
|
+
return L.get(e) ?? L.get("none");
|
|
1295
1304
|
}
|
|
1296
1305
|
//#endregion
|
|
1297
1306
|
//#region src/transition/decorator/createDecorator.ts
|
|
1298
|
-
function
|
|
1307
|
+
function xe({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1299
1308
|
return {
|
|
1300
1309
|
name: e,
|
|
1301
1310
|
initial: t,
|
|
@@ -1316,7 +1325,7 @@ function Ce({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1316
1325
|
}
|
|
1317
1326
|
//#endregion
|
|
1318
1327
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
1319
|
-
function
|
|
1328
|
+
function Se({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1320
1329
|
return {
|
|
1321
1330
|
name: e,
|
|
1322
1331
|
initial: t,
|
|
@@ -1337,30 +1346,30 @@ function we({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1337
1346
|
}
|
|
1338
1347
|
//#endregion
|
|
1339
1348
|
//#region src/transition/decorator/overlay.ts
|
|
1340
|
-
var
|
|
1349
|
+
var Ce = "rgba(0, 0, 0, 0.2)", we = xe({
|
|
1341
1350
|
name: "overlay",
|
|
1342
1351
|
initial: {
|
|
1343
1352
|
opacity: 0,
|
|
1344
|
-
backgroundColor:
|
|
1353
|
+
backgroundColor: Ce
|
|
1345
1354
|
},
|
|
1346
1355
|
idle: {
|
|
1347
1356
|
value: {
|
|
1348
1357
|
opacity: 0,
|
|
1349
|
-
backgroundColor:
|
|
1358
|
+
backgroundColor: Ce
|
|
1350
1359
|
},
|
|
1351
1360
|
options: { duration: 0 }
|
|
1352
1361
|
},
|
|
1353
1362
|
enter: {
|
|
1354
1363
|
value: {
|
|
1355
1364
|
opacity: 1,
|
|
1356
|
-
backgroundColor:
|
|
1365
|
+
backgroundColor: Ce
|
|
1357
1366
|
},
|
|
1358
1367
|
options: { duration: .6 }
|
|
1359
1368
|
},
|
|
1360
1369
|
exit: {
|
|
1361
1370
|
value: {
|
|
1362
1371
|
opacity: 0,
|
|
1363
|
-
backgroundColor:
|
|
1372
|
+
backgroundColor: Ce
|
|
1364
1373
|
},
|
|
1365
1374
|
options: { duration: .6 }
|
|
1366
1375
|
},
|
|
@@ -1369,10 +1378,10 @@ var I = "rgba(0, 0, 0, 0.2)", Te = Ce({
|
|
|
1369
1378
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1370
1379
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1371
1380
|
}
|
|
1372
|
-
}),
|
|
1381
|
+
}), R = /* @__PURE__ */ new Map([["overlay", we]]);
|
|
1373
1382
|
//#endregion
|
|
1374
1383
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1375
|
-
function
|
|
1384
|
+
function Te({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1376
1385
|
return {
|
|
1377
1386
|
name: e,
|
|
1378
1387
|
initial: t,
|
|
@@ -1393,7 +1402,7 @@ function Ee({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1393
1402
|
}
|
|
1394
1403
|
//#endregion
|
|
1395
1404
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1396
|
-
function
|
|
1405
|
+
function Ee({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1397
1406
|
return {
|
|
1398
1407
|
name: e,
|
|
1399
1408
|
initial: t,
|
|
@@ -1414,7 +1423,7 @@ function De({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1414
1423
|
}
|
|
1415
1424
|
//#endregion
|
|
1416
1425
|
//#region src/transition/partTransition/partTransition.ts
|
|
1417
|
-
var
|
|
1426
|
+
var z = /* @__PURE__ */ new Map(), B = {
|
|
1418
1427
|
"IDLE-true": "self",
|
|
1419
1428
|
"IDLE-false": "self",
|
|
1420
1429
|
"PUSHING-true": "initial",
|
|
@@ -1425,17 +1434,17 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1425
1434
|
"POPPING-false": "PUSHING-false",
|
|
1426
1435
|
"COMPLETED-true": "self",
|
|
1427
1436
|
"COMPLETED-false": "self"
|
|
1428
|
-
},
|
|
1437
|
+
}, De = Object.keys(B), Oe = (e) => {
|
|
1429
1438
|
if (!e) return 0;
|
|
1430
1439
|
let t = e.duration;
|
|
1431
1440
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1432
|
-
},
|
|
1433
|
-
let n =
|
|
1441
|
+
}, ke = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Ae = (e, t) => {
|
|
1442
|
+
let n = B[t];
|
|
1434
1443
|
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1435
|
-
},
|
|
1436
|
-
let n =
|
|
1444
|
+
}, V = (e, t) => {
|
|
1445
|
+
let n = Ae(e, t);
|
|
1437
1446
|
if (n === null) return null;
|
|
1438
|
-
let r = e.variants[t], i =
|
|
1447
|
+
let r = e.variants[t], i = Oe(r.options), a = ke(r.options);
|
|
1439
1448
|
return i <= 0 && a <= 0 ? null : {
|
|
1440
1449
|
from: n,
|
|
1441
1450
|
to: r.value,
|
|
@@ -1443,7 +1452,7 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1443
1452
|
delay: a,
|
|
1444
1453
|
ease: r.options?.ease
|
|
1445
1454
|
};
|
|
1446
|
-
},
|
|
1455
|
+
}, je = De, Me = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Ne = (e) => typeof e == "object" && !!e && !Array.isArray(e), Pe = /* @__PURE__ */ new Set(/* @__PURE__ */ "opacity.scale.scaleX.scaleY.scaleZ.aspectRatio.columnCount.columns.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineHeight.lineClamp.order.orphans.tabSize.widows.zIndex.zoom.fillOpacity.floodOpacity.stopOpacity.strokeOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeWidth".split(".")), Fe = (e, t) => t.startsWith("--") || Pe.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Ie = (e, t) => typeof t == "number" ? Fe(t, e) : typeof t == "string" ? t : "", Le = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Re = /* @__PURE__ */ new Set([
|
|
1447
1456
|
"x",
|
|
1448
1457
|
"y",
|
|
1449
1458
|
"z",
|
|
@@ -1454,7 +1463,7 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1454
1463
|
"rotateX",
|
|
1455
1464
|
"rotateY",
|
|
1456
1465
|
"rotateZ"
|
|
1457
|
-
]),
|
|
1466
|
+
]), ze = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, Be = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, Ve = /^1(\.0+)?$/, He = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 || typeof t == "string" && Ve.test(t.trim()) : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 || typeof t == "string" && Be.test(t.trim()) : t === 0 || typeof t == "string" && ze.test(t.trim()), Ue = (e, t) => {
|
|
1458
1467
|
switch (e) {
|
|
1459
1468
|
case "x": return `translate3d(${t}, 0, 0)`;
|
|
1460
1469
|
case "y": return `translate3d(0, ${t}, 0)`;
|
|
@@ -1468,16 +1477,16 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1468
1477
|
case "rotateY": return `rotateY(${t})`;
|
|
1469
1478
|
default: return "";
|
|
1470
1479
|
}
|
|
1471
|
-
},
|
|
1480
|
+
}, We = (e) => {
|
|
1472
1481
|
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1473
|
-
if (!
|
|
1482
|
+
if (!Ne(e)) return;
|
|
1474
1483
|
let n = [];
|
|
1475
1484
|
for (let r of Object.keys(e)) {
|
|
1476
|
-
let i = e[r], a =
|
|
1477
|
-
if (a !== "") if (
|
|
1485
|
+
let i = e[r], a = Ie(r, i);
|
|
1486
|
+
if (a !== "") if (Re.has(r)) n.push(`${r}:${a}`);
|
|
1478
1487
|
else {
|
|
1479
|
-
let e = t.get(
|
|
1480
|
-
e.add(a), t.set(
|
|
1488
|
+
let e = t.get(Le(r)) ?? /* @__PURE__ */ new Set();
|
|
1489
|
+
e.add(a), t.set(Le(r), e);
|
|
1481
1490
|
}
|
|
1482
1491
|
}
|
|
1483
1492
|
r.add(n.sort().join("|"));
|
|
@@ -1487,13 +1496,13 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1487
1496
|
n = r.size > 1;
|
|
1488
1497
|
let a = Array.from(t.entries()).filter(([, e]) => e.size > 1).map(([e]) => e);
|
|
1489
1498
|
return n && a.push("transform"), a;
|
|
1490
|
-
},
|
|
1491
|
-
if (!
|
|
1499
|
+
}, H = (e) => {
|
|
1500
|
+
if (!Ne(e)) return [];
|
|
1492
1501
|
let t = [], n = !0, r = [];
|
|
1493
1502
|
for (let i of Object.keys(e)) {
|
|
1494
|
-
let a = e[i], o =
|
|
1495
|
-
o !== "" && (
|
|
1496
|
-
property:
|
|
1503
|
+
let a = e[i], o = Ie(i, a);
|
|
1504
|
+
o !== "" && (Re.has(i) ? (t.push(Ue(i, o)), He(i, a) || (n = !1)) : r.push({
|
|
1505
|
+
property: Le(i),
|
|
1497
1506
|
value: o
|
|
1498
1507
|
}));
|
|
1499
1508
|
}
|
|
@@ -1501,7 +1510,7 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1501
1510
|
property: "transform",
|
|
1502
1511
|
value: n ? "none" : t.join(" ")
|
|
1503
1512
|
}), r;
|
|
1504
|
-
},
|
|
1513
|
+
}, U = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), Ge = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1505
1514
|
linear: "linear",
|
|
1506
1515
|
easeIn: "ease-in",
|
|
1507
1516
|
easeOut: "ease-out",
|
|
@@ -1523,17 +1532,17 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1523
1532
|
}, Ye = (e, t) => {
|
|
1524
1533
|
let [n, r] = t.split("-");
|
|
1525
1534
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1526
|
-
}, W = (e, t, n) => `flemo-${e}-${
|
|
1527
|
-
let o =
|
|
1535
|
+
}, W = (e, t, n) => `flemo-${e}-${Me(t)}-${n}`, Xe = (e, t, n, r, i, a) => {
|
|
1536
|
+
let o = H(r), s = H(i.value), c = Oe(i.options), l = ke(i.options), u = Ge(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Je(t, n)}` : d;
|
|
1528
1537
|
if (s.length === 0 && o.length === 0) return "";
|
|
1529
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1538
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${U(s)}\n animation: none;\n}`;
|
|
1530
1539
|
let p = W(e, t, n), m = [
|
|
1531
1540
|
`@keyframes ${p} {`,
|
|
1532
1541
|
" from {",
|
|
1533
|
-
|
|
1542
|
+
U(o).replace(/^/gm, " "),
|
|
1534
1543
|
" }",
|
|
1535
1544
|
" to {",
|
|
1536
|
-
|
|
1545
|
+
U(s).replace(/^/gm, " "),
|
|
1537
1546
|
" }",
|
|
1538
1547
|
"}"
|
|
1539
1548
|
].join("\n"), h = [
|
|
@@ -1542,22 +1551,22 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1542
1551
|
u,
|
|
1543
1552
|
l > 0 ? `${l}s` : null,
|
|
1544
1553
|
"both"
|
|
1545
|
-
].filter(Boolean).join(" "), g = new Map(o.map((e) => [e.property, e.value])), _ = new Map(s.map((e) => [e.property, e.value])), v = Array.from(new Set([...g.keys(), ..._.keys()])).filter((e) => g.get(e) !== _.get(e)), y = v.length > 0 ? ` will-change: ${v.join(", ")};\n` : "", b = n.split("-")[0];
|
|
1546
|
-
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Ze(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${
|
|
1554
|
+
].filter(Boolean).join(" "), g = new Map(o.map((e) => [e.property, e.value])), _ = new Map(s.map((e) => [e.property, e.value])), v = Array.from(/* @__PURE__ */ new Set([...g.keys(), ..._.keys()])).filter((e) => g.get(e) !== _.get(e)), y = v.length > 0 ? ` will-change: ${v.join(", ")};\n` : "", b = n.split("-")[0];
|
|
1555
|
+
return `${m}\n${`${f} {\n animation: ${h};\n${y}${b === "PUSHING" || b === "REPLACING" ? " contain: layout;\n pointer-events: none;\n" : ""}}`}${e === "screen" && n.endsWith("-false") && Ze(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${U(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && Ze(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${U(s)}\n}` : ""}`;
|
|
1547
1556
|
}, Ze = (e) => {
|
|
1548
1557
|
if (!e) return !1;
|
|
1549
1558
|
if (e.opacity === 0) return !0;
|
|
1550
1559
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1551
1560
|
return t(e.x) || t(e.y);
|
|
1552
1561
|
}, Qe = (e, t, n, r) => {
|
|
1553
|
-
let i =
|
|
1554
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1562
|
+
let i = H(r.value);
|
|
1563
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${U(i)}\n}`;
|
|
1555
1564
|
}, $e = (e, t, n = []) => {
|
|
1556
1565
|
let r = [];
|
|
1557
1566
|
for (let t of e) {
|
|
1558
1567
|
let e = t.name;
|
|
1559
|
-
for (let n of
|
|
1560
|
-
let i = t.variants[n], a =
|
|
1568
|
+
for (let n of De) {
|
|
1569
|
+
let i = t.variants[n], a = B[n];
|
|
1561
1570
|
if (a === "self") {
|
|
1562
1571
|
r.push(Qe(Ke, e, n, i));
|
|
1563
1572
|
continue;
|
|
@@ -1568,8 +1577,8 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1568
1577
|
}
|
|
1569
1578
|
for (let e of t) {
|
|
1570
1579
|
let t = e.name;
|
|
1571
|
-
for (let n of
|
|
1572
|
-
let i = e.variants[n], a =
|
|
1580
|
+
for (let n of je) {
|
|
1581
|
+
let i = e.variants[n], a = B[n];
|
|
1573
1582
|
if (a === "self") {
|
|
1574
1583
|
r.push(Qe(qe, t, n, i));
|
|
1575
1584
|
continue;
|
|
@@ -1580,8 +1589,8 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1580
1589
|
}
|
|
1581
1590
|
for (let e of n) {
|
|
1582
1591
|
let t = e.name;
|
|
1583
|
-
for (let n of
|
|
1584
|
-
let i = e.variants[n], a =
|
|
1592
|
+
for (let n of je) {
|
|
1593
|
+
let i = e.variants[n], a = B[n];
|
|
1585
1594
|
if (a === "self") {
|
|
1586
1595
|
r.push(Qe(Ye, t, n, i));
|
|
1587
1596
|
continue;
|
|
@@ -1590,7 +1599,11 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1590
1599
|
r.push(Xe("part", t, n, o, i, Ye));
|
|
1591
1600
|
}
|
|
1592
1601
|
}
|
|
1593
|
-
return [
|
|
1602
|
+
return [
|
|
1603
|
+
...r.filter((e) => e.length > 0),
|
|
1604
|
+
et,
|
|
1605
|
+
tt
|
|
1606
|
+
].join("\n\n");
|
|
1594
1607
|
}, et = [
|
|
1595
1608
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1596
1609
|
"[data-flemo-anim-hold=\"park\"],",
|
|
@@ -1600,41 +1613,45 @@ var R = /* @__PURE__ */ new Map(), z = {
|
|
|
1600
1613
|
"[data-flemo-anim-hold=\"park-under\"] [data-flemo-part-name] {",
|
|
1601
1614
|
" animation-play-state: paused !important;",
|
|
1602
1615
|
"}"
|
|
1616
|
+
].join("\n"), tt = [
|
|
1617
|
+
"[data-flemo-held-arrival] {",
|
|
1618
|
+
" display: none !important;",
|
|
1619
|
+
"}"
|
|
1603
1620
|
].join("\n"), G = (e, t) => {
|
|
1604
|
-
let n =
|
|
1621
|
+
let n = B[t];
|
|
1605
1622
|
if (n === "self") return !1;
|
|
1606
|
-
let r = e.variants[t], i =
|
|
1623
|
+
let r = e.variants[t], i = Oe(r.options), a = ke(r.options);
|
|
1607
1624
|
if (i <= 0 && a <= 0) return !1;
|
|
1608
|
-
let o =
|
|
1625
|
+
let o = H(n === "initial" ? e.initial : e.variants[n].value), s = H(r.value);
|
|
1609
1626
|
return o.length > 0 || s.length > 0;
|
|
1610
|
-
},
|
|
1611
|
-
function
|
|
1627
|
+
}, nt = "data-flemo";
|
|
1628
|
+
function rt() {
|
|
1612
1629
|
if (f()) return;
|
|
1613
|
-
let e = $e(
|
|
1614
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1630
|
+
let e = $e(L.values(), R.values(), z.values()), t = document.head.querySelector(`style[${nt}]`);
|
|
1631
|
+
t || (t = document.createElement("style"), t.setAttribute(nt, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1615
1632
|
}
|
|
1616
1633
|
//#endregion
|
|
1617
1634
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1618
|
-
var
|
|
1635
|
+
var it = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map(), ot = /* @__PURE__ */ new Map(), st = (e, t) => {
|
|
1619
1636
|
e.set(t, (e.get(t) ?? 0) + 1);
|
|
1620
|
-
},
|
|
1637
|
+
}, ct = (e, t) => {
|
|
1621
1638
|
let n = (e.get(t) ?? 1) - 1;
|
|
1622
1639
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1623
1640
|
};
|
|
1624
|
-
function
|
|
1625
|
-
for (let t of e)
|
|
1626
|
-
for (let e of t)
|
|
1627
|
-
for (let e of n)
|
|
1628
|
-
return
|
|
1629
|
-
for (let t of e)
|
|
1630
|
-
for (let e of t)
|
|
1631
|
-
for (let e of n)
|
|
1632
|
-
|
|
1641
|
+
function lt(e, t, n = []) {
|
|
1642
|
+
for (let t of e) L.set(t.name, t), st(it, t.name);
|
|
1643
|
+
for (let e of t) R.set(e.name, e), st(at, e.name);
|
|
1644
|
+
for (let e of n) z.set(e.name, e), st(ot, e.name);
|
|
1645
|
+
return rt(), () => {
|
|
1646
|
+
for (let t of e) ct(it, t.name) && L.delete(t.name);
|
|
1647
|
+
for (let e of t) ct(at, e.name) && R.delete(e.name);
|
|
1648
|
+
for (let e of n) ct(ot, e.name) && z.delete(e.name);
|
|
1649
|
+
rt();
|
|
1633
1650
|
};
|
|
1634
1651
|
}
|
|
1635
1652
|
//#endregion
|
|
1636
1653
|
//#region src/transition/enteringInitialStyle.ts
|
|
1637
|
-
function
|
|
1654
|
+
function ut(e) {
|
|
1638
1655
|
let { initial: t, isActive: n, status: r } = e;
|
|
1639
1656
|
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1640
1657
|
let i = {};
|
|
@@ -1642,10 +1659,10 @@ function lt(e) {
|
|
|
1642
1659
|
}
|
|
1643
1660
|
//#endregion
|
|
1644
1661
|
//#region src/transition/settleScrub.ts
|
|
1645
|
-
var
|
|
1662
|
+
var dt = () => ({
|
|
1646
1663
|
request: (e) => requestAnimationFrame(e),
|
|
1647
1664
|
cancel: (e) => cancelAnimationFrame(e)
|
|
1648
|
-
}),
|
|
1665
|
+
}), ft = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), pt = ((e = dt()) => {
|
|
1649
1666
|
let t = /* @__PURE__ */ new Map(), n = null, r = () => {
|
|
1650
1667
|
t.size === 0 && n !== null && (e.cancel(n), n = null);
|
|
1651
1668
|
}, i = (e, n) => {
|
|
@@ -1678,7 +1695,7 @@ var ut = () => ({
|
|
|
1678
1695
|
if (typeof r.animate != "function") return null;
|
|
1679
1696
|
i(r, "current");
|
|
1680
1697
|
let l = {};
|
|
1681
|
-
for (let e of o) l[
|
|
1698
|
+
for (let e of o) l[ft(e.property)] = e.value;
|
|
1682
1699
|
let u;
|
|
1683
1700
|
try {
|
|
1684
1701
|
u = r.animate([l], {
|
|
@@ -1708,93 +1725,100 @@ var ut = () => ({
|
|
|
1708
1725
|
takeover: (e) => i(e, "current"),
|
|
1709
1726
|
cancel: (e) => i(e, "drop")
|
|
1710
1727
|
};
|
|
1711
|
-
})(),
|
|
1728
|
+
})(), mt = "flemo:motion-driver", ht = "flemo:motion-driver-force", gt = !1, _t = () => {
|
|
1712
1729
|
try {
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1730
|
+
try {
|
|
1731
|
+
typeof localStorage < "u" && localStorage.removeItem(ht);
|
|
1732
|
+
} catch {}
|
|
1733
|
+
if (typeof sessionStorage > "u") return null;
|
|
1734
|
+
let e = sessionStorage.getItem(ht);
|
|
1735
|
+
if (e === null) return null;
|
|
1736
|
+
let [t, n] = e.split("@"), r = Number(n);
|
|
1737
|
+
return (t === "css" || t === "raf") && n !== void 0 && Number.isFinite(r) && Math.abs(Date.now() - r) < 864e5 ? (!gt && typeof console < "u" && (gt = !0, console.warn(`[flemo] motion driver pinned to "${t}" via sessionStorage ${ht}; remove the key to restore automatic selection (pins expire after 24h).`)), t) : (sessionStorage.removeItem(ht), null);
|
|
1716
1738
|
} catch {
|
|
1717
1739
|
return null;
|
|
1718
1740
|
}
|
|
1719
|
-
},
|
|
1741
|
+
}, vt = () => ({
|
|
1720
1742
|
read: () => {
|
|
1721
1743
|
try {
|
|
1722
|
-
return typeof localStorage < "u" ? localStorage.getItem(
|
|
1744
|
+
return typeof localStorage < "u" ? localStorage.getItem(mt) : null;
|
|
1723
1745
|
} catch {
|
|
1724
1746
|
return null;
|
|
1725
1747
|
}
|
|
1726
1748
|
},
|
|
1727
1749
|
write: (e) => {
|
|
1728
1750
|
try {
|
|
1729
|
-
typeof localStorage < "u" && localStorage.setItem(
|
|
1751
|
+
typeof localStorage < "u" && localStorage.setItem(mt, e);
|
|
1730
1752
|
} catch {}
|
|
1731
1753
|
}
|
|
1732
|
-
}),
|
|
1733
|
-
let
|
|
1734
|
-
|
|
1735
|
-
let
|
|
1754
|
+
}), yt = 30, bt = 2, xt = 2, St = () => typeof navigator < "u" && !!navigator.userAgentData, Ct = (e = vt(), t = !1, n = !0) => {
|
|
1755
|
+
let r = n && e.read() === "css", i = r;
|
|
1756
|
+
r &&= !1;
|
|
1757
|
+
let a = 0, o = 0, s = [];
|
|
1736
1758
|
return {
|
|
1737
1759
|
playerAllowed: () => {
|
|
1738
|
-
let e =
|
|
1739
|
-
return e ? e === "raf" : t && !
|
|
1760
|
+
let e = _t();
|
|
1761
|
+
return e ? e === "raf" : t && !r;
|
|
1740
1762
|
},
|
|
1741
1763
|
beginRun: () => {
|
|
1742
|
-
|
|
1764
|
+
o = 0, s = [];
|
|
1743
1765
|
},
|
|
1744
1766
|
reportGap: (e) => {
|
|
1745
|
-
|
|
1767
|
+
s.push(e), e >= yt && (o += 1);
|
|
1746
1768
|
},
|
|
1747
1769
|
endRun: () => {
|
|
1748
|
-
let t =
|
|
1749
|
-
if (
|
|
1750
|
-
|
|
1751
|
-
|
|
1770
|
+
let t = o >= bt;
|
|
1771
|
+
if (t && (a += 1), n) {
|
|
1772
|
+
if (i) {
|
|
1773
|
+
i = !1, t ? r = !0 : e.write("raf");
|
|
1774
|
+
return;
|
|
1775
|
+
}
|
|
1776
|
+
t && a >= xt && !r && (r = !0, e.write("css"));
|
|
1752
1777
|
}
|
|
1753
|
-
t && (i += 1, i >= bt && !n && (n = !0, e.write("css")));
|
|
1754
1778
|
},
|
|
1755
1779
|
stats: () => ({
|
|
1756
|
-
runGaps: [...
|
|
1757
|
-
strikes:
|
|
1758
|
-
demoted:
|
|
1780
|
+
runGaps: [...s],
|
|
1781
|
+
strikes: a,
|
|
1782
|
+
demoted: r
|
|
1759
1783
|
})
|
|
1760
1784
|
};
|
|
1761
|
-
})(),
|
|
1762
|
-
let n =
|
|
1763
|
-
n || (n = /* @__PURE__ */ new Set(),
|
|
1764
|
-
},
|
|
1765
|
-
if (
|
|
1766
|
-
let n =
|
|
1785
|
+
}, wt = St() ? Ct() : Ct(vt(), !0, !1), Tt = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, Et = /* @__PURE__ */ new WeakMap(), K = (e, t) => {
|
|
1786
|
+
let n = Et.get(e);
|
|
1787
|
+
n || (n = /* @__PURE__ */ new Set(), Et.set(e, n)), n.add(t);
|
|
1788
|
+
}, q = (e, t) => {
|
|
1789
|
+
if (pt.cancel(e), e.style.transition = "", e.style.removeProperty("animation-delay"), t) {
|
|
1790
|
+
let n = Et.get(e);
|
|
1767
1791
|
for (let r of t) e.style.removeProperty(r), n?.delete(r);
|
|
1768
1792
|
return;
|
|
1769
1793
|
}
|
|
1770
|
-
let n =
|
|
1794
|
+
let n = Et.get(e);
|
|
1771
1795
|
if (n && n.size > 0) {
|
|
1772
1796
|
for (let t of n) e.style.removeProperty(t);
|
|
1773
1797
|
n.clear();
|
|
1774
1798
|
return;
|
|
1775
1799
|
}
|
|
1776
1800
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1777
|
-
},
|
|
1778
|
-
if (!
|
|
1779
|
-
let r = e, i =
|
|
1801
|
+
}, J = (e, t, n = {}) => {
|
|
1802
|
+
if (!Tt(e)) return Promise.resolve();
|
|
1803
|
+
let r = e, i = H(t);
|
|
1780
1804
|
if (i.length === 0) return Promise.resolve();
|
|
1781
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1805
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = Ge(n.ease);
|
|
1782
1806
|
if (a <= 0 && o <= 0) {
|
|
1783
|
-
|
|
1784
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1807
|
+
pt.takeover(r), r.style.transition = "none";
|
|
1808
|
+
for (let e of i) r.style.setProperty(e.property, e.value), K(r, e.property);
|
|
1785
1809
|
return Promise.resolve();
|
|
1786
1810
|
}
|
|
1787
|
-
let c =
|
|
1811
|
+
let c = wt.playerAllowed() ? pt.settle(r, i, {
|
|
1788
1812
|
durationMs: a * 1e3,
|
|
1789
1813
|
delayMs: o * 1e3,
|
|
1790
1814
|
easing: s
|
|
1791
1815
|
}, (e) => {
|
|
1792
|
-
r.style.setProperty(e.property, e.value),
|
|
1816
|
+
r.style.setProperty(e.property, e.value), K(r, e.property);
|
|
1793
1817
|
}) : null;
|
|
1794
1818
|
if (c) return c;
|
|
1795
1819
|
let l = i.map((e) => `${e.property} ${a}s ${s} ${o}s`).join(", ");
|
|
1796
1820
|
r.style.transition = l, r.offsetWidth;
|
|
1797
|
-
for (let e of i) r.style.setProperty(e.property, e.value),
|
|
1821
|
+
for (let e of i) r.style.setProperty(e.property, e.value), K(r, e.property);
|
|
1798
1822
|
return new Promise((e) => {
|
|
1799
1823
|
let t = !1, n = () => {
|
|
1800
1824
|
t || (t = !0, r.removeEventListener("transitionend", i), e());
|
|
@@ -1803,7 +1827,119 @@ var ut = () => ({
|
|
|
1803
1827
|
};
|
|
1804
1828
|
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1805
1829
|
});
|
|
1806
|
-
},
|
|
1830
|
+
}, Dt = "data-flemo-held-arrival";
|
|
1831
|
+
function Ot(e) {
|
|
1832
|
+
if (typeof MutationObserver > "u") return () => {};
|
|
1833
|
+
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = (t) => {
|
|
1834
|
+
let n = t instanceof Element ? t : t.parentElement;
|
|
1835
|
+
return !n || n === e || n.closest(`[data-flemo-part-name], [${Dt}]`) !== null;
|
|
1836
|
+
}, s = (e, t, n, r) => e ? n === e.glass ? (e.pendingEcho ? e.pendingEcho = !1 : e.latest = n, e) : (e.latest = n, r(e.glass), e.pendingEcho = !0, e) : n === t ? null : (r(t), {
|
|
1837
|
+
glass: t,
|
|
1838
|
+
latest: n,
|
|
1839
|
+
pendingEcho: !0
|
|
1840
|
+
}), c = new MutationObserver((e) => {
|
|
1841
|
+
let c = /* @__PURE__ */ new Map(), l = (e) => {
|
|
1842
|
+
let t = c.get(e);
|
|
1843
|
+
return t || c.set(e, t = {
|
|
1844
|
+
removed: [],
|
|
1845
|
+
added: []
|
|
1846
|
+
}), t;
|
|
1847
|
+
}, u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
1848
|
+
for (let i of e) {
|
|
1849
|
+
if (i.type === "characterData") {
|
|
1850
|
+
let e = i.target;
|
|
1851
|
+
if (!e.isConnected || o(e)) continue;
|
|
1852
|
+
u.has(e) || u.set(e, i.oldValue);
|
|
1853
|
+
continue;
|
|
1854
|
+
}
|
|
1855
|
+
if (i.type === "attributes") {
|
|
1856
|
+
let e = i.target, t = i.attributeName;
|
|
1857
|
+
if (t.startsWith("data-flemo") || !e.isConnected || o(e)) continue;
|
|
1858
|
+
let n = d.get(e);
|
|
1859
|
+
n || d.set(e, n = /* @__PURE__ */ new Map()), n.has(t) || n.set(t, i.oldValue);
|
|
1860
|
+
continue;
|
|
1861
|
+
}
|
|
1862
|
+
if (i.type === "childList") {
|
|
1863
|
+
for (let e of Array.from(i.removedNodes)) if (!n.has(e)) {
|
|
1864
|
+
if (e instanceof Element && t.delete(e)) {
|
|
1865
|
+
e.removeAttribute(Dt);
|
|
1866
|
+
continue;
|
|
1867
|
+
}
|
|
1868
|
+
(e instanceof Element || e.nodeType === Node.TEXT_NODE) && l(i.target).removed.push(e);
|
|
1869
|
+
}
|
|
1870
|
+
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(Dt, ""), t.add(e), l(i.target).added.push(e));
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
for (let [e, t] of u) {
|
|
1874
|
+
let n = s(i.get(e), t, e.nodeValue, (t) => {
|
|
1875
|
+
e.nodeValue = t;
|
|
1876
|
+
});
|
|
1877
|
+
n && i.set(e, n);
|
|
1878
|
+
}
|
|
1879
|
+
for (let [e, t] of d) {
|
|
1880
|
+
let n = a.get(e);
|
|
1881
|
+
for (let [r, i] of t) {
|
|
1882
|
+
let t = s(n?.get(r), i, e.getAttribute(r), (t) => {
|
|
1883
|
+
t === null ? e.removeAttribute(r) : e.setAttribute(r, t);
|
|
1884
|
+
});
|
|
1885
|
+
t && (n || a.set(e, n = /* @__PURE__ */ new Map()), n.set(r, t));
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
for (let [e, i] of c) {
|
|
1889
|
+
if (i.removed.length === 0 || !e.isConnected) continue;
|
|
1890
|
+
let a = i.added.find((t) => t.parentNode === e) ?? Array.from(e.childNodes).find((e) => e instanceof Element && t.has(e)) ?? null;
|
|
1891
|
+
if (!(i.added.length === 0 && !a)) for (let t of i.removed) r.add(t), e.insertBefore(t, a), n.add(t);
|
|
1892
|
+
}
|
|
1893
|
+
});
|
|
1894
|
+
return c.observe(e, {
|
|
1895
|
+
childList: !0,
|
|
1896
|
+
subtree: !0,
|
|
1897
|
+
characterData: !0,
|
|
1898
|
+
characterDataOldValue: !0,
|
|
1899
|
+
attributes: !0,
|
|
1900
|
+
attributeOldValue: !0
|
|
1901
|
+
}), () => {
|
|
1902
|
+
c.disconnect();
|
|
1903
|
+
for (let e of n) e.parentNode?.removeChild(e);
|
|
1904
|
+
n.clear();
|
|
1905
|
+
for (let e of t) e.removeAttribute(Dt);
|
|
1906
|
+
t.clear();
|
|
1907
|
+
for (let [e, t] of i) e.isConnected && (e.nodeValue = t.latest);
|
|
1908
|
+
i.clear();
|
|
1909
|
+
for (let [e, t] of a) if (e.isConnected) for (let [n, r] of t) r.latest === null ? e.removeAttribute(n) : e.setAttribute(n, r.latest);
|
|
1910
|
+
a.clear(), r.clear();
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
//#endregion
|
|
1914
|
+
//#region src/core/engine/compositorWarmUp.ts
|
|
1915
|
+
var kt = "data-flemo-warm", At = 3e3, jt = [{ transform: "translate3d(0, 0, 0)" }, { transform: "translate3d(1px, 0, 0)" }], Mt = {
|
|
1916
|
+
duration: 500,
|
|
1917
|
+
iterations: Infinity,
|
|
1918
|
+
direction: "alternate",
|
|
1919
|
+
easing: "linear"
|
|
1920
|
+
}, Nt = "position:fixed;top:0;left:0;width:1px;height:1px;pointer-events:none;opacity:0.02;background:#888;will-change:transform;", Y = null, Pt = null, X = 0, Ft = () => {
|
|
1921
|
+
X = 0, Pt?.cancel(), Pt = null, Y?.remove(), Y = null;
|
|
1922
|
+
};
|
|
1923
|
+
function It() {
|
|
1924
|
+
if (typeof document > "u" || !document.body || typeof Element > "u" || typeof Element.prototype.animate != "function") return () => {};
|
|
1925
|
+
if (X += 1, !Y) {
|
|
1926
|
+
Y = document.createElement("div"), Y.setAttribute(kt, ""), Y.setAttribute("aria-hidden", "true"), Y.setAttribute("style", Nt), document.body.appendChild(Y);
|
|
1927
|
+
try {
|
|
1928
|
+
Pt = Y.animate(jt, Mt);
|
|
1929
|
+
} catch {
|
|
1930
|
+
Pt = null;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
let e = !1, t = setTimeout(() => {
|
|
1934
|
+
e || (e = !0, --X, X <= 0 && Ft());
|
|
1935
|
+
}, At);
|
|
1936
|
+
return () => {
|
|
1937
|
+
e || (e = !0, clearTimeout(t), --X, X <= 0 && Ft());
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1940
|
+
//#endregion
|
|
1941
|
+
//#region src/transition/cubicBezier.ts
|
|
1942
|
+
var Lt = (e, t, n, r) => {
|
|
1807
1943
|
let i = (t) => 3 * (1 - t) * (1 - t) * t * e + 3 * (1 - t) * t * t * n + t ** 3, a = (e) => 3 * (1 - e) * (1 - e) * e * t + 3 * (1 - e) * e * e * r + e ** 3;
|
|
1808
1944
|
return (e) => {
|
|
1809
1945
|
if (e <= 0) return 0;
|
|
@@ -1815,7 +1951,7 @@ var ut = () => ({
|
|
|
1815
1951
|
}
|
|
1816
1952
|
return a((t + n) / 2);
|
|
1817
1953
|
};
|
|
1818
|
-
},
|
|
1954
|
+
}, Rt = (e) => e, zt = {
|
|
1819
1955
|
ease: [
|
|
1820
1956
|
.25,
|
|
1821
1957
|
.1,
|
|
@@ -1870,16 +2006,62 @@ var ut = () => ({
|
|
|
1870
2006
|
.66,
|
|
1871
2007
|
-.56
|
|
1872
2008
|
]
|
|
1873
|
-
},
|
|
2009
|
+
}, Bt = (e) => {
|
|
1874
2010
|
if (Array.isArray(e)) {
|
|
1875
2011
|
if (e.length === 4 && e.every((e) => typeof e == "number")) {
|
|
1876
2012
|
let [t, n, r, i] = e;
|
|
1877
|
-
return
|
|
2013
|
+
return Lt(t, n, r, i);
|
|
1878
2014
|
}
|
|
1879
|
-
return
|
|
2015
|
+
return Rt;
|
|
1880
2016
|
}
|
|
1881
|
-
return typeof e == "string" ? e === "linear" ?
|
|
1882
|
-
},
|
|
2017
|
+
return typeof e == "string" ? e === "linear" ? Rt : Lt(...zt[e] ?? zt.ease) : Lt(...zt.ease);
|
|
2018
|
+
}, Vt = 1 / 255, Ht = 400, Ut = 24, Wt = /* @__PURE__ */ new Set([
|
|
2019
|
+
"x",
|
|
2020
|
+
"y",
|
|
2021
|
+
"opacity"
|
|
2022
|
+
]), Gt = (e, t, n) => {
|
|
2023
|
+
if (!e || typeof e != "object") return;
|
|
2024
|
+
let r = e[t];
|
|
2025
|
+
if (r === void 0) return;
|
|
2026
|
+
if (typeof r == "number") return r;
|
|
2027
|
+
if (typeof r != "string") return null;
|
|
2028
|
+
let i = r.trim();
|
|
2029
|
+
if (i.endsWith("%")) {
|
|
2030
|
+
let e = Number(i.slice(0, -1));
|
|
2031
|
+
if (Number.isNaN(e)) return null;
|
|
2032
|
+
let r = t === "y" ? n.clientHeight : n.clientWidth;
|
|
2033
|
+
return e / 100 * r;
|
|
2034
|
+
}
|
|
2035
|
+
if (i.endsWith("px")) {
|
|
2036
|
+
let e = Number(i.slice(0, -2));
|
|
2037
|
+
return Number.isNaN(e) ? null : e;
|
|
2038
|
+
}
|
|
2039
|
+
return null;
|
|
2040
|
+
}, Kt = (e, t, n) => {
|
|
2041
|
+
let r = /* @__PURE__ */ new Set();
|
|
2042
|
+
for (let t of [e.from, e.to]) if (!(!t || typeof t != "object")) for (let e of Object.keys(t)) r.add(e);
|
|
2043
|
+
if (r.size === 0) return null;
|
|
2044
|
+
let i = Infinity;
|
|
2045
|
+
for (let a of r) {
|
|
2046
|
+
if (!Wt.has(a)) return null;
|
|
2047
|
+
let r = Gt(e.from, a, t), o = Gt(e.to, a, t);
|
|
2048
|
+
if (r === null || o === null || r === void 0 || o === void 0) return null;
|
|
2049
|
+
let s = Math.abs(o - r);
|
|
2050
|
+
if (s === 0) continue;
|
|
2051
|
+
let c = a === "opacity" ? Vt : 1 / Math.max(1, n);
|
|
2052
|
+
i = Math.min(i, c / s);
|
|
2053
|
+
}
|
|
2054
|
+
return !Number.isFinite(i) || i <= 0 || i >= 1 ? null : i;
|
|
2055
|
+
}, qt = (e, t, n) => {
|
|
2056
|
+
if (e.duration <= 0) return null;
|
|
2057
|
+
let r = Kt(e, t, n);
|
|
2058
|
+
if (r === null) return null;
|
|
2059
|
+
let i = Bt(e.ease), a = Ht;
|
|
2060
|
+
for (let e = Ht; e >= 0 && !(Math.abs(1 - i(e / Ht)) > r); --e) a = e;
|
|
2061
|
+
if (a === 0) return null;
|
|
2062
|
+
let o = (e.delay + e.duration * (a / Ht)) * 1e3;
|
|
2063
|
+
return (e.delay + e.duration) * 1e3 - o < Ut ? null : o;
|
|
2064
|
+
}, Jt = [
|
|
1883
2065
|
"x",
|
|
1884
2066
|
"y",
|
|
1885
2067
|
"z",
|
|
@@ -1890,7 +2072,7 @@ var ut = () => ({
|
|
|
1890
2072
|
"rotateX",
|
|
1891
2073
|
"rotateY",
|
|
1892
2074
|
"rotateZ"
|
|
1893
|
-
],
|
|
2075
|
+
], Yt = new Set(Jt), Xt = {
|
|
1894
2076
|
x: 0,
|
|
1895
2077
|
y: 0,
|
|
1896
2078
|
z: 0,
|
|
@@ -1901,7 +2083,7 @@ var ut = () => ({
|
|
|
1901
2083
|
rotateX: 0,
|
|
1902
2084
|
rotateY: 0,
|
|
1903
2085
|
rotateZ: 0
|
|
1904
|
-
},
|
|
2086
|
+
}, Zt = (e, t) => {
|
|
1905
2087
|
if (typeof t == "number") return {
|
|
1906
2088
|
value: t,
|
|
1907
2089
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
@@ -1920,26 +2102,26 @@ var ut = () => ({
|
|
|
1920
2102
|
value: i,
|
|
1921
2103
|
unit: a === "" && i === 0 ? "px" : a
|
|
1922
2104
|
};
|
|
1923
|
-
},
|
|
1924
|
-
let n = e.match(
|
|
1925
|
-
if (n.length !== r.length || e.replace(
|
|
2105
|
+
}, Qt = /-?\d*\.?\d+/g, $t = (e, t) => {
|
|
2106
|
+
let n = e.match(Qt) ?? [], r = t.match(Qt) ?? [];
|
|
2107
|
+
if (n.length !== r.length || e.replace(Qt, " ") !== t.replace(Qt, " ")) return null;
|
|
1926
2108
|
let i = n.map(Number), a = r.map(Number);
|
|
1927
2109
|
return (t) => {
|
|
1928
2110
|
let n = 0;
|
|
1929
|
-
return e.replace(
|
|
2111
|
+
return e.replace(Qt, () => {
|
|
1930
2112
|
let e = n++, r = i[e] + (a[e] - i[e]) * t;
|
|
1931
2113
|
return `${Math.round(r * 1e3) / 1e3}`;
|
|
1932
2114
|
});
|
|
1933
2115
|
};
|
|
1934
|
-
},
|
|
1935
|
-
let n = new Set([...
|
|
2116
|
+
}, en = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), tn = (e) => typeof e == "object" && !!e && !Array.isArray(e), nn = (e) => tn(e) ? Object.keys(e) : [], rn = (e, t) => tn(e) ? e[t] : void 0, an = (e, t) => {
|
|
2117
|
+
let n = /* @__PURE__ */ new Set([...nn(e.from), ...nn(e.to)]), r = [], i = null, a = [], o = [];
|
|
1936
2118
|
for (let s of n) {
|
|
1937
|
-
let n =
|
|
1938
|
-
if (
|
|
2119
|
+
let n = rn(e.from, s), c = rn(e.to, s);
|
|
2120
|
+
if (Yt.has(s)) {
|
|
1939
2121
|
let e = s, i = {
|
|
1940
|
-
value:
|
|
2122
|
+
value: Xt[e],
|
|
1941
2123
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
1942
|
-
}, a = n === void 0 ? i :
|
|
2124
|
+
}, a = n === void 0 ? i : Zt(e, n), o = c === void 0 ? i : Zt(e, c);
|
|
1943
2125
|
if (!a || !o || a.unit !== o.unit && a.value !== 0 && o.value !== 0) return null;
|
|
1944
2126
|
let l = a.value === 0 && a.unit !== o.unit ? o.unit : a.unit, u = l === "%", d = 0;
|
|
1945
2127
|
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100), r.push({
|
|
@@ -1970,15 +2152,15 @@ var ut = () => ({
|
|
|
1970
2152
|
if (typeof l != "string" || typeof u != "string") return null;
|
|
1971
2153
|
if (l === u) {
|
|
1972
2154
|
o.push({
|
|
1973
|
-
property:
|
|
2155
|
+
property: en(s),
|
|
1974
2156
|
value: l
|
|
1975
2157
|
});
|
|
1976
2158
|
continue;
|
|
1977
2159
|
}
|
|
1978
|
-
let d =
|
|
2160
|
+
let d = $t(l, u);
|
|
1979
2161
|
if (!d) return null;
|
|
1980
2162
|
a.push({
|
|
1981
|
-
property:
|
|
2163
|
+
property: en(s),
|
|
1982
2164
|
mix: d
|
|
1983
2165
|
});
|
|
1984
2166
|
}
|
|
@@ -1988,46 +2170,46 @@ var ut = () => ({
|
|
|
1988
2170
|
strings: a,
|
|
1989
2171
|
constants: o
|
|
1990
2172
|
};
|
|
1991
|
-
},
|
|
2173
|
+
}, on = 1, sn = (e, t, n, r) => {
|
|
1992
2174
|
let i = 0, a = 0, o = !1, s = [], c = !0;
|
|
1993
|
-
for (let l of
|
|
2175
|
+
for (let l of Jt) {
|
|
1994
2176
|
let u = e.find((e) => e.prop === l);
|
|
1995
2177
|
if (!u) continue;
|
|
1996
2178
|
let d = u.from.value + (u.to.value - u.from.value) * t;
|
|
1997
2179
|
if (u.from.unit === "%" && (d *= u.percentBase), l === "x" || l === "y") {
|
|
1998
|
-
let e = l === "x" ? r.x : r.y, t = (e === null || Math.abs(d - e) * n >=
|
|
2180
|
+
let e = l === "x" ? r.x : r.y, t = (e === null || Math.abs(d - e) * n >= on) && n > 0 ? Math.round(d * n) / n : Math.round(d * 1e3) / 1e3;
|
|
1999
2181
|
l === "x" ? (r.x = d, i = t) : (r.y = d, a = t), o = !0, t !== 0 && (c = !1);
|
|
2000
2182
|
continue;
|
|
2001
2183
|
}
|
|
2002
|
-
let f =
|
|
2184
|
+
let f = Xt[l];
|
|
2003
2185
|
d !== f && (c = !1), l === "z" ? s.push(`translateZ(${d}px)`) : l === "scale" ? s.push(`scale(${d})`) : l === "scaleX" ? s.push(`scaleX(${d})`) : l === "scaleY" ? s.push(`scaleY(${d})`) : l === "rotate" || l === "rotateZ" ? s.push(`rotate(${d}deg)`) : l === "rotateX" ? s.push(`rotateX(${d}deg)`) : l === "rotateY" && s.push(`rotateY(${d}deg)`);
|
|
2004
2186
|
}
|
|
2005
2187
|
return !o && s.length === 0 ? "" : c ? "none" : [...o ? [`translate3d(${i}px, ${a}px, 0)`] : [], ...s].join(" ");
|
|
2006
|
-
},
|
|
2188
|
+
}, cn = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), ln = (e) => {
|
|
2007
2189
|
let t = {};
|
|
2008
|
-
for (let n of
|
|
2190
|
+
for (let n of H(e)) t[cn(n.property)] = n.value;
|
|
2009
2191
|
return t;
|
|
2010
|
-
},
|
|
2192
|
+
}, un = (e, t) => {
|
|
2011
2193
|
if (typeof e.animate != "function") return null;
|
|
2012
2194
|
try {
|
|
2013
|
-
let n = e.animate([
|
|
2195
|
+
let n = e.animate([ln(t.from), ln(t.to)], {
|
|
2014
2196
|
duration: Math.max(0, t.duration * 1e3),
|
|
2015
2197
|
delay: Math.max(0, t.delay * 1e3),
|
|
2016
|
-
easing:
|
|
2198
|
+
easing: Ge(t.ease),
|
|
2017
2199
|
fill: "both"
|
|
2018
2200
|
});
|
|
2019
2201
|
return n.pause(), n.currentTime = 0, n;
|
|
2020
2202
|
} catch {
|
|
2021
2203
|
return null;
|
|
2022
2204
|
}
|
|
2023
|
-
},
|
|
2205
|
+
}, dn = 1e3 / 60, fn = 100, pn = () => ({
|
|
2024
2206
|
request: (e) => requestAnimationFrame(e),
|
|
2025
2207
|
cancel: (e) => cancelAnimationFrame(e),
|
|
2026
2208
|
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
2027
|
-
}),
|
|
2209
|
+
}), mn = ((e = pn()) => {
|
|
2028
2210
|
let t = /* @__PURE__ */ new Map(), n = {
|
|
2029
2211
|
join: (n, r) => {
|
|
2030
|
-
let i =
|
|
2212
|
+
let i = an(r.motion, r.element), s = i ? null : un(r.element, r.motion);
|
|
2031
2213
|
if (!i && !s) return null;
|
|
2032
2214
|
let c = t.get(n);
|
|
2033
2215
|
c || (c = {
|
|
@@ -2048,14 +2230,14 @@ var ut = () => ({
|
|
|
2048
2230
|
y: null
|
|
2049
2231
|
}
|
|
2050
2232
|
};
|
|
2051
|
-
if (c.tracks.push(l), l.element.style.animation = "none",
|
|
2052
|
-
i.transforms.length > 0 &&
|
|
2053
|
-
for (let e of i.strings)
|
|
2054
|
-
for (let e of i.constants)
|
|
2233
|
+
if (c.tracks.push(l), l.element.style.animation = "none", K(l.element, "animation"), i) {
|
|
2234
|
+
i.transforms.length > 0 && K(l.element, "transform"), i.opacity && K(l.element, "opacity");
|
|
2235
|
+
for (let e of i.strings) K(l.element, e.property);
|
|
2236
|
+
for (let e of i.constants) K(l.element, e.property);
|
|
2055
2237
|
a(l, 0);
|
|
2056
2238
|
}
|
|
2057
|
-
return r.role === "active" && !c.started && (c.started = !0,
|
|
2058
|
-
l.detached = !0, l.scrub?.cancel(),
|
|
2239
|
+
return r.role === "active" && !c.started && (c.started = !0, wt.beginRun(), o(n, c)), () => {
|
|
2240
|
+
l.detached = !0, l.scrub?.cancel(), q(l.element);
|
|
2059
2241
|
let r = t.get(n);
|
|
2060
2242
|
r && (r.tracks = r.tracks.filter((e) => e !== l), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
2061
2243
|
};
|
|
@@ -2070,13 +2252,13 @@ var ut = () => ({
|
|
|
2070
2252
|
}
|
|
2071
2253
|
}, r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
2072
2254
|
let t = r.get(e);
|
|
2073
|
-
return t || (t =
|
|
2255
|
+
return t || (t = Bt(e.motion.ease), r.set(e, t)), t;
|
|
2074
2256
|
};
|
|
2075
2257
|
function a(t, n) {
|
|
2076
2258
|
let { element: r, parsed: i } = t;
|
|
2077
2259
|
if (!(!i || !r.isConnected)) {
|
|
2078
2260
|
if (i.transforms.length > 0) {
|
|
2079
|
-
let a =
|
|
2261
|
+
let a = sn(i.transforms, n, e.devicePixelRatio(), t.snapMemory);
|
|
2080
2262
|
a !== "" && (r.style.transform = a);
|
|
2081
2263
|
}
|
|
2082
2264
|
if (i.opacity) {
|
|
@@ -2096,7 +2278,7 @@ var ut = () => ({
|
|
|
2096
2278
|
let c = r.startTime ?? s;
|
|
2097
2279
|
if (r.lastTime !== null) {
|
|
2098
2280
|
let e = s - r.lastTime;
|
|
2099
|
-
|
|
2281
|
+
wt.reportGap(e), n.onFrameGap?.(e), e >= fn && (c += e - dn);
|
|
2100
2282
|
}
|
|
2101
2283
|
r.startTime = c, r.lastTime = s;
|
|
2102
2284
|
let l = !0;
|
|
@@ -2112,14 +2294,14 @@ var ut = () => ({
|
|
|
2112
2294
|
a(e, i(e)(o)), o >= 1 ? (e.completed = !0, e.onComplete?.()) : l = !1;
|
|
2113
2295
|
}
|
|
2114
2296
|
if (l) {
|
|
2115
|
-
|
|
2297
|
+
wt.endRun(), t.delete(e);
|
|
2116
2298
|
return;
|
|
2117
2299
|
}
|
|
2118
2300
|
o(e, r);
|
|
2119
2301
|
}
|
|
2120
2302
|
return n;
|
|
2121
2303
|
})();
|
|
2122
|
-
|
|
2304
|
+
mn.onFrameGap = (e) => {
|
|
2123
2305
|
if (typeof window < "u") {
|
|
2124
2306
|
let t = window.__flemoPlayerGaps ??= [];
|
|
2125
2307
|
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
@@ -2127,23 +2309,23 @@ Q.onFrameGap = (e) => {
|
|
|
2127
2309
|
};
|
|
2128
2310
|
//#endregion
|
|
2129
2311
|
//#region src/core/engine/types.ts
|
|
2130
|
-
var
|
|
2312
|
+
var hn = "data-flemo-skip-animation", Z = () => {}, gn = 400, _n = "data-flemo-part-name", vn = (e) => {
|
|
2131
2313
|
let t = e.parentElement ?? e;
|
|
2132
|
-
return Array.from(t.querySelectorAll(`[${
|
|
2314
|
+
return Array.from(t.querySelectorAll(`[${_n}]`)).filter((n) => {
|
|
2133
2315
|
let r = n.closest("[data-flemo-screen]");
|
|
2134
2316
|
return !r || r === e || !t.contains(r);
|
|
2135
2317
|
});
|
|
2136
|
-
},
|
|
2318
|
+
}, yn = (e, t) => {
|
|
2137
2319
|
let [n, r] = t.split("-");
|
|
2138
|
-
return
|
|
2139
|
-
},
|
|
2320
|
+
return vn(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2321
|
+
}, bn = 4, xn = (e) => `${Math.round(e * 1e3) / 1e3}s`, Sn = (e) => {
|
|
2140
2322
|
let { element: t, expectedName: n, motion: r } = e, i = null, a = !1, o = (e) => {
|
|
2141
|
-
a = !0, t.style.animation = "none", t.offsetWidth, t.style.removeProperty("animation"), e.mode === "clear" ? t.style.removeProperty("animation-delay") : e.mode === "set" && (t.style.animationDelay =
|
|
2323
|
+
a = !0, t.style.animation = "none", t.offsetWidth, t.style.removeProperty("animation"), e.mode === "clear" ? t.style.removeProperty("animation-delay") : e.mode === "set" && (t.style.animationDelay = xn(e.seconds)), a = !1;
|
|
2142
2324
|
}, s = (e) => {
|
|
2143
2325
|
a || e.target !== t || e.animationName !== n || i === null && (i = performance.now());
|
|
2144
2326
|
}, c = (s) => {
|
|
2145
2327
|
if (a || s.target !== t || s.animationName !== n) return;
|
|
2146
|
-
if (!e.isLive() || e.budgetUsed() >=
|
|
2328
|
+
if (!e.isLive() || e.budgetUsed() >= bn) {
|
|
2147
2329
|
e.onTerminal();
|
|
2148
2330
|
return;
|
|
2149
2331
|
}
|
|
@@ -2173,59 +2355,91 @@ var Gt = "data-flemo-skip-animation", $ = () => {}, Kt = "data-flemo-part-name",
|
|
|
2173
2355
|
}
|
|
2174
2356
|
};
|
|
2175
2357
|
};
|
|
2176
|
-
function
|
|
2177
|
-
let t = /* @__PURE__ */ new Map()
|
|
2358
|
+
function Cn(e) {
|
|
2359
|
+
let t = /* @__PURE__ */ new Map(), n = null, r = null, i = null, a = null, o = () => {
|
|
2360
|
+
if (!a) return;
|
|
2361
|
+
let { land: e, cancel: t } = a;
|
|
2362
|
+
a = null, t(), e();
|
|
2363
|
+
}, c = (e) => {
|
|
2364
|
+
if (typeof requestAnimationFrame != "function") {
|
|
2365
|
+
e();
|
|
2366
|
+
return;
|
|
2367
|
+
}
|
|
2368
|
+
let t = 0;
|
|
2369
|
+
t = requestAnimationFrame(() => {
|
|
2370
|
+
t = requestAnimationFrame(() => {
|
|
2371
|
+
a = null, e();
|
|
2372
|
+
});
|
|
2373
|
+
}), a = {
|
|
2374
|
+
land: e,
|
|
2375
|
+
cancel: () => cancelAnimationFrame(t)
|
|
2376
|
+
};
|
|
2377
|
+
};
|
|
2178
2378
|
return {
|
|
2179
|
-
driveScreenLifecycle: (
|
|
2180
|
-
let { getElements:
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2379
|
+
driveScreenLifecycle: (a) => {
|
|
2380
|
+
let { getElements: l, transitionName: u, prevTransitionName: d, status: f, isActive: p, animHoldReleased: m } = a, h = f === "PUSHING" || f === "POPPING" || f === "REPLACING";
|
|
2381
|
+
h && (i &&= (clearTimeout(i), null), r ||= It()), !h && r && !i && (typeof setTimeout == "function" ? i = setTimeout(() => {
|
|
2382
|
+
i = null, r?.(), r = null;
|
|
2383
|
+
}, gn) : (r(), r = null));
|
|
2384
|
+
let g = h && m && (p ? f === "PUSHING" || f === "REPLACING" : f === "POPPING");
|
|
2385
|
+
if (!g && n) {
|
|
2386
|
+
let e = n;
|
|
2387
|
+
n = null, h ? e() : c(e);
|
|
2388
|
+
}
|
|
2389
|
+
if (g && !n) {
|
|
2390
|
+
o();
|
|
2391
|
+
let { scope: e } = l();
|
|
2392
|
+
e && (n = Ot(e));
|
|
2393
|
+
}
|
|
2394
|
+
let _ = (t, n, r) => {
|
|
2395
|
+
let i = e.getTransitionTaskId();
|
|
2396
|
+
if (!i || s.pendingTaskIds.some((e) => e !== i) || !wt.playerAllowed()) return null;
|
|
2397
|
+
let { scope: a, decorator: o, bars: c } = l();
|
|
2398
|
+
if (!a) return null;
|
|
2399
|
+
let d = be(u), f = V(d, t);
|
|
2186
2400
|
if (!f) return null;
|
|
2187
|
-
let p = [], m =
|
|
2188
|
-
element:
|
|
2401
|
+
let p = [], m = mn.join(i, {
|
|
2402
|
+
element: a,
|
|
2189
2403
|
motion: f,
|
|
2190
2404
|
role: n,
|
|
2191
|
-
onComplete:
|
|
2405
|
+
onComplete: r
|
|
2192
2406
|
});
|
|
2193
2407
|
if (!m) return null;
|
|
2194
2408
|
p.push(m);
|
|
2195
|
-
for (let e of
|
|
2409
|
+
for (let e of c ?? []) {
|
|
2196
2410
|
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
2197
|
-
let t =
|
|
2411
|
+
let t = mn.join(i, {
|
|
2198
2412
|
element: e,
|
|
2199
2413
|
motion: f,
|
|
2200
2414
|
role: "passive"
|
|
2201
2415
|
});
|
|
2202
2416
|
t && p.push(t);
|
|
2203
2417
|
}
|
|
2204
|
-
if (
|
|
2205
|
-
let e =
|
|
2418
|
+
if (o && d.decoratorName) {
|
|
2419
|
+
let e = R.get(d.decoratorName), n = e ? V(e, t) : null;
|
|
2206
2420
|
if (n) {
|
|
2207
|
-
let e =
|
|
2208
|
-
element:
|
|
2421
|
+
let e = mn.join(i, {
|
|
2422
|
+
element: o,
|
|
2209
2423
|
motion: n,
|
|
2210
2424
|
role: "passive"
|
|
2211
2425
|
});
|
|
2212
2426
|
e && p.push(e);
|
|
2213
2427
|
}
|
|
2214
2428
|
}
|
|
2215
|
-
for (let e of
|
|
2216
|
-
let n =
|
|
2429
|
+
for (let e of yn(a, t)) {
|
|
2430
|
+
let n = z.get(e.getAttribute(_n)), r = n ? V(n, t) : null;
|
|
2217
2431
|
if (!r) continue;
|
|
2218
|
-
let
|
|
2432
|
+
let a = mn.join(i, {
|
|
2219
2433
|
element: e,
|
|
2220
2434
|
motion: r,
|
|
2221
2435
|
role: "passive"
|
|
2222
2436
|
});
|
|
2223
|
-
|
|
2437
|
+
a && p.push(a);
|
|
2224
2438
|
}
|
|
2225
2439
|
return () => p.forEach((e) => e());
|
|
2226
|
-
},
|
|
2227
|
-
let n = [], { decorator:
|
|
2228
|
-
let i = 0, a =
|
|
2440
|
+
}, v = (e, t) => {
|
|
2441
|
+
let n = [], { decorator: r, bars: i } = l(), a = be(u), o = (e, t, r) => {
|
|
2442
|
+
let i = 0, a = Sn({
|
|
2229
2443
|
element: e,
|
|
2230
2444
|
expectedName: t,
|
|
2231
2445
|
motion: r,
|
|
@@ -2234,110 +2448,157 @@ function Qt(e) {
|
|
|
2234
2448
|
spendBudget: () => {
|
|
2235
2449
|
i += 1;
|
|
2236
2450
|
},
|
|
2237
|
-
onTerminal:
|
|
2451
|
+
onTerminal: Z
|
|
2238
2452
|
});
|
|
2239
2453
|
a.attach(), n.push(a.detach);
|
|
2240
|
-
},
|
|
2241
|
-
if (
|
|
2242
|
-
if (
|
|
2243
|
-
let e =
|
|
2244
|
-
n &&
|
|
2454
|
+
}, s = W("screen", u, t), c = V(a, t);
|
|
2455
|
+
if (c) for (let e of i ?? []) !e || e.getAttribute("data-flemo-bar-riding") !== "true" || o(e, s, c);
|
|
2456
|
+
if (r && a.decoratorName) {
|
|
2457
|
+
let e = R.get(a.decoratorName), n = e ? V(e, t) : null;
|
|
2458
|
+
n && o(r, W("decorator", a.decoratorName, t), n);
|
|
2245
2459
|
}
|
|
2246
|
-
for (let n of
|
|
2247
|
-
let e = n.getAttribute(
|
|
2248
|
-
i &&
|
|
2460
|
+
for (let n of yn(e, t)) {
|
|
2461
|
+
let e = n.getAttribute(_n), r = z.get(e), i = r ? V(r, t) : null;
|
|
2462
|
+
i && o(n, W("part", e, t), i);
|
|
2249
2463
|
}
|
|
2250
2464
|
return n;
|
|
2251
2465
|
};
|
|
2252
|
-
if (!
|
|
2253
|
-
if (
|
|
2254
|
-
let { scope: e, decorator: t, bars: n } =
|
|
2466
|
+
if (!p) {
|
|
2467
|
+
if (f === "COMPLETED") {
|
|
2468
|
+
let { scope: e, decorator: t, bars: n } = l();
|
|
2255
2469
|
if (e) {
|
|
2256
|
-
|
|
2257
|
-
for (let t of
|
|
2470
|
+
q(e);
|
|
2471
|
+
for (let t of vn(e)) q(t);
|
|
2258
2472
|
}
|
|
2259
|
-
t &&
|
|
2260
|
-
for (let e of n ?? []) e &&
|
|
2261
|
-
return
|
|
2473
|
+
t && q(t);
|
|
2474
|
+
for (let e of n ?? []) e && q(e);
|
|
2475
|
+
return Z;
|
|
2262
2476
|
}
|
|
2263
|
-
if (
|
|
2264
|
-
let e = `${
|
|
2477
|
+
if (f === "REPLACING" && d !== u && e.setReplaceTransitionStatus("PENDING"), h && m) {
|
|
2478
|
+
let e = `${f}-false`, t = _(e, "passive");
|
|
2265
2479
|
if (t) return t;
|
|
2266
|
-
let { scope: n } =
|
|
2480
|
+
let { scope: n } = l();
|
|
2267
2481
|
if (n) {
|
|
2268
|
-
let t =
|
|
2482
|
+
let t = be(u), r = [];
|
|
2269
2483
|
if (G(t, e)) {
|
|
2270
|
-
let
|
|
2484
|
+
let i = V(t, e), a = 0, o = Sn({
|
|
2271
2485
|
element: n,
|
|
2272
|
-
expectedName: W("screen",
|
|
2273
|
-
motion:
|
|
2486
|
+
expectedName: W("screen", u, e),
|
|
2487
|
+
motion: i,
|
|
2274
2488
|
isLive: () => n.isConnected && n.getAttribute("data-flemo-skip-animation") !== "true",
|
|
2275
|
-
budgetUsed: () =>
|
|
2489
|
+
budgetUsed: () => a,
|
|
2276
2490
|
spendBudget: () => {
|
|
2277
|
-
|
|
2491
|
+
a += 1;
|
|
2278
2492
|
},
|
|
2279
|
-
onTerminal:
|
|
2493
|
+
onTerminal: Z
|
|
2280
2494
|
});
|
|
2281
|
-
|
|
2495
|
+
o.attach(), r.push(o.detach);
|
|
2282
2496
|
}
|
|
2283
|
-
if (r.push(...
|
|
2497
|
+
if (r.push(...v(n, e)), r.length > 0) return () => r.forEach((e) => e());
|
|
2284
2498
|
}
|
|
2285
2499
|
}
|
|
2286
|
-
return
|
|
2500
|
+
return Z;
|
|
2287
2501
|
}
|
|
2288
|
-
if (
|
|
2502
|
+
if (f === "COMPLETED") {
|
|
2289
2503
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
2290
|
-
let { scope: t, decorator: n, bars:
|
|
2504
|
+
let { scope: t, decorator: n, bars: r } = l();
|
|
2291
2505
|
if (t) {
|
|
2292
|
-
|
|
2293
|
-
for (let e of
|
|
2506
|
+
q(t), t.removeAttribute(hn);
|
|
2507
|
+
for (let e of vn(t)) q(e);
|
|
2294
2508
|
}
|
|
2295
|
-
n && (
|
|
2296
|
-
for (let e of
|
|
2297
|
-
return
|
|
2509
|
+
n && (q(n), n.removeAttribute(hn));
|
|
2510
|
+
for (let e of r ?? []) e && (q(e), e.style.removeProperty("will-change"));
|
|
2511
|
+
return Z;
|
|
2298
2512
|
}
|
|
2299
|
-
if (
|
|
2300
|
-
let { scope:
|
|
2301
|
-
if (!
|
|
2302
|
-
let
|
|
2513
|
+
if (f === "IDLE") return Z;
|
|
2514
|
+
let { scope: y } = l();
|
|
2515
|
+
if (!y) return Z;
|
|
2516
|
+
let b = e.getTransitionTaskId(), x = () => {
|
|
2303
2517
|
let n = e.getTransitionTaskId();
|
|
2304
|
-
n && s.resolveTask(n),
|
|
2305
|
-
},
|
|
2306
|
-
if (!(!
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2518
|
+
n && s.resolveTask(n), b && t.delete(b);
|
|
2519
|
+
}, S = be(u), C = `${f}-true`, w = y.getAttribute(hn) === "true";
|
|
2520
|
+
if (!(!w && G(S, C))) {
|
|
2521
|
+
if (!w) {
|
|
2522
|
+
let e = `${f}-false`;
|
|
2523
|
+
if (G(S, e)) {
|
|
2524
|
+
if (!m) return b && s.markGateHeld(b), Z;
|
|
2525
|
+
b && s.anchorGate(b);
|
|
2526
|
+
let t = V(S, e), n = (t.delay + t.duration) * 1e3 + 50, r = setTimeout(x, n);
|
|
2527
|
+
return () => clearTimeout(r);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
return queueMicrotask(x), Z;
|
|
2531
|
+
}
|
|
2532
|
+
b && (m ? s.anchorGate(b) : s.markGateHeld(b));
|
|
2533
|
+
let T = V(S, C), E = !w && !!T, ee = W("screen", u, C), D, O = () => {
|
|
2534
|
+
D !== void 0 && (clearTimeout(D), D = void 0);
|
|
2535
|
+
}, te = 0, ne, re = () => {
|
|
2536
|
+
if (te <= 0) {
|
|
2537
|
+
x();
|
|
2538
|
+
return;
|
|
2539
|
+
}
|
|
2540
|
+
ne = setTimeout(x, te);
|
|
2541
|
+
}, k = Z, A = Z, j = (e) => {
|
|
2542
|
+
e.target === y && e.animationName === ee && (y.removeEventListener("animationend", j), O(), k(), re());
|
|
2312
2543
|
};
|
|
2313
|
-
|
|
2314
|
-
let
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2544
|
+
y.addEventListener("animationend", j);
|
|
2545
|
+
let ie = E && m ? _(C, "active", x) : null, ae = (T.delay + T.duration) * 1e3, oe = ae + 1500, se = b ? setTimeout(() => void s.resolveTask(b), oe) : void 0, ce = `${f}-false`, M = G(S, ce) ? V(S, ce) : null, le = [];
|
|
2546
|
+
for (let e of Array.from(y.ownerDocument.querySelectorAll(`[${_n}][data-flemo-status="${f}"]`))) {
|
|
2547
|
+
let t = z.get(e.getAttribute(_n)), n = `${f}-${e.getAttribute("data-flemo-active")}`, r = t && G(t, n) ? V(t, n) : null;
|
|
2548
|
+
r && le.push({
|
|
2549
|
+
element: e,
|
|
2550
|
+
motion: r
|
|
2551
|
+
});
|
|
2552
|
+
}
|
|
2553
|
+
let ue = M ? (M.delay + M.duration) * 1e3 : 0;
|
|
2554
|
+
for (let { motion: e } of le) ue = Math.max(ue, (e.delay + e.duration) * 1e3);
|
|
2555
|
+
te = Math.max(0, Math.min(1e3, ue - ae));
|
|
2556
|
+
let de = ae + 250, N = () => b !== null && e.getTransitionTaskId() === b && y.isConnected && y.getAttribute("data-flemo-skip-animation") !== "true" && G(S, C), fe = Sn({
|
|
2557
|
+
element: y,
|
|
2558
|
+
expectedName: ee,
|
|
2559
|
+
motion: T,
|
|
2560
|
+
isLive: N,
|
|
2561
|
+
budgetUsed: () => t.get(b) ?? 0,
|
|
2320
2562
|
spendBudget: () => {
|
|
2321
|
-
t.set(
|
|
2563
|
+
A(), t.set(b, (t.get(b) ?? 0) + 1);
|
|
2322
2564
|
},
|
|
2323
|
-
onTerminal:
|
|
2565
|
+
onTerminal: x
|
|
2324
2566
|
});
|
|
2325
|
-
|
|
2326
|
-
let
|
|
2327
|
-
|
|
2328
|
-
},
|
|
2329
|
-
if (
|
|
2330
|
-
|
|
2567
|
+
k = fe.detach;
|
|
2568
|
+
let pe = !1, me = () => {
|
|
2569
|
+
O(), D = setTimeout(P, de);
|
|
2570
|
+
}, P = () => {
|
|
2571
|
+
if (O(), N() && !pe) {
|
|
2572
|
+
pe = !0, A(), fe.fullRestart(), me();
|
|
2331
2573
|
return;
|
|
2332
2574
|
}
|
|
2333
|
-
|
|
2334
|
-
},
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2575
|
+
x();
|
|
2576
|
+
}, F = !ie && m, he = F ? v(y, C) : [];
|
|
2577
|
+
F && (fe.attach(), b && me());
|
|
2578
|
+
let I, ge = () => {
|
|
2579
|
+
I !== void 0 && (clearTimeout(I), I = void 0);
|
|
2580
|
+
};
|
|
2581
|
+
if (A = ge, F && b) {
|
|
2582
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1, t = qt(T, y, e), n = M ? qt(M, y, e) : 0, r = 0;
|
|
2583
|
+
for (let { element: t, motion: n } of le) {
|
|
2584
|
+
let i = qt(n, t, e);
|
|
2585
|
+
if (i === null) {
|
|
2586
|
+
r = null;
|
|
2587
|
+
break;
|
|
2588
|
+
}
|
|
2589
|
+
r = Math.max(r, i);
|
|
2590
|
+
}
|
|
2591
|
+
let i = t !== null && n !== null && r !== null ? Math.max(t, n, r) : null;
|
|
2592
|
+
i !== null && i + 17 < ae + te && (I = setTimeout(() => {
|
|
2593
|
+
I = void 0, N() && (y.removeEventListener("animationend", j), O(), k(), x());
|
|
2594
|
+
}, i + 17));
|
|
2595
|
+
}
|
|
2596
|
+
return () => {
|
|
2597
|
+
if (se !== void 0 && clearTimeout(se), ne !== void 0 && clearTimeout(ne), ge(), y.removeEventListener("animationend", j), F) {
|
|
2598
|
+
fe.detach();
|
|
2599
|
+
for (let e of he) e();
|
|
2339
2600
|
}
|
|
2340
|
-
|
|
2601
|
+
O(), ie?.(), b && e.getTransitionTaskId() !== b && t.delete(b);
|
|
2341
2602
|
};
|
|
2342
2603
|
},
|
|
2343
2604
|
activeResumeEntryCount: () => t.size
|
|
@@ -2345,20 +2606,20 @@ function Qt(e) {
|
|
|
2345
2606
|
}
|
|
2346
2607
|
//#endregion
|
|
2347
2608
|
//#region src/utils/findScrollable.ts
|
|
2348
|
-
function
|
|
2349
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
2609
|
+
function wn(e, t) {
|
|
2610
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Tn(e);
|
|
2350
2611
|
if (!o) return {
|
|
2351
2612
|
element: null,
|
|
2352
2613
|
hasMarker: !1
|
|
2353
2614
|
};
|
|
2354
2615
|
let s = o.closest?.(r);
|
|
2355
|
-
if (s instanceof HTMLElement &&
|
|
2616
|
+
if (s instanceof HTMLElement && En(s, n) && (!a || Dn(s, n))) return {
|
|
2356
2617
|
element: s,
|
|
2357
2618
|
hasMarker: !0
|
|
2358
2619
|
};
|
|
2359
2620
|
let c = o, l = 0;
|
|
2360
2621
|
for (; c && l < i;) {
|
|
2361
|
-
if (
|
|
2622
|
+
if (En(c, n) && (!a || Dn(c, n))) return {
|
|
2362
2623
|
element: c,
|
|
2363
2624
|
hasMarker: !1
|
|
2364
2625
|
};
|
|
@@ -2369,7 +2630,7 @@ function $t(e, t) {
|
|
|
2369
2630
|
hasMarker: !1
|
|
2370
2631
|
};
|
|
2371
2632
|
}
|
|
2372
|
-
function
|
|
2633
|
+
function Tn(e) {
|
|
2373
2634
|
if (!e) return null;
|
|
2374
2635
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
2375
2636
|
if (n && n.length) {
|
|
@@ -2377,18 +2638,18 @@ function en(e) {
|
|
|
2377
2638
|
}
|
|
2378
2639
|
return e instanceof HTMLElement ? e : null;
|
|
2379
2640
|
}
|
|
2380
|
-
function
|
|
2641
|
+
function En(e, t) {
|
|
2381
2642
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
2382
2643
|
}
|
|
2383
|
-
function
|
|
2384
|
-
if (!
|
|
2644
|
+
function Dn(e, t) {
|
|
2645
|
+
if (!En(e, t) || typeof window > "u") return !1;
|
|
2385
2646
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
2386
2647
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
2387
2648
|
}
|
|
2388
2649
|
//#endregion
|
|
2389
2650
|
//#region src/core/engine/createSwipeController.ts
|
|
2390
|
-
var
|
|
2391
|
-
function
|
|
2651
|
+
var On = "data-flemo-skip-animation";
|
|
2652
|
+
function kn(e) {
|
|
2392
2653
|
let t = null, n = null, r = {
|
|
2393
2654
|
current: [],
|
|
2394
2655
|
prev: []
|
|
@@ -2434,9 +2695,9 @@ function an(e) {
|
|
|
2434
2695
|
y: e.clientY
|
|
2435
2696
|
}, u = t;
|
|
2436
2697
|
}, v = (n, i, a) => {
|
|
2437
|
-
let o =
|
|
2438
|
-
if (n === e.getElements().scope) for (let e of r.current)
|
|
2439
|
-
else if (n === t) for (let e of r.prev)
|
|
2698
|
+
let o = J(n, i, a);
|
|
2699
|
+
if (n === e.getElements().scope) for (let e of r.current) J(e, i, a);
|
|
2700
|
+
else if (n === t) for (let e of r.prev) J(e, i, a);
|
|
2440
2701
|
return o;
|
|
2441
2702
|
}, y = (t) => {
|
|
2442
2703
|
let n = e.getPartnerBars(), i = [], { sharedTopBar: a, sharedBottomBar: o } = e.getElements();
|
|
@@ -2450,12 +2711,12 @@ function an(e) {
|
|
|
2450
2711
|
current: i,
|
|
2451
2712
|
prev: s
|
|
2452
2713
|
};
|
|
2453
|
-
let c =
|
|
2714
|
+
let c = We(e.getTransition()).join(", ");
|
|
2454
2715
|
for (let e of i) e.style.willChange = c;
|
|
2455
2716
|
for (let e of s) e.style.willChange = c;
|
|
2456
2717
|
}, b = () => {
|
|
2457
|
-
for (let e of r.current)
|
|
2458
|
-
for (let e of r.prev)
|
|
2718
|
+
for (let e of r.current) q(e), e.style.removeProperty("will-change");
|
|
2719
|
+
for (let e of r.prev) q(e), e.style.removeProperty("will-change");
|
|
2459
2720
|
r = {
|
|
2460
2721
|
current: [],
|
|
2461
2722
|
prev: []
|
|
@@ -2468,10 +2729,10 @@ function an(e) {
|
|
|
2468
2729
|
};
|
|
2469
2730
|
}, S = (e, t, n) => {
|
|
2470
2731
|
let r = (r, i) => {
|
|
2471
|
-
let a =
|
|
2732
|
+
let a = z.get(r.getAttribute("data-flemo-part-name"));
|
|
2472
2733
|
if (!a) return;
|
|
2473
2734
|
let o = {
|
|
2474
|
-
animate:
|
|
2735
|
+
animate: J,
|
|
2475
2736
|
element: r,
|
|
2476
2737
|
active: i
|
|
2477
2738
|
};
|
|
@@ -2480,7 +2741,7 @@ function an(e) {
|
|
|
2480
2741
|
for (let e of i.current) r(e, !0);
|
|
2481
2742
|
for (let e of i.prev) r(e, !1);
|
|
2482
2743
|
}, C = () => {
|
|
2483
|
-
for (let e of [...i.current, ...i.prev])
|
|
2744
|
+
for (let e of [...i.current, ...i.prev]) q(e);
|
|
2484
2745
|
i = {
|
|
2485
2746
|
current: [],
|
|
2486
2747
|
prev: []
|
|
@@ -2509,7 +2770,7 @@ function an(e) {
|
|
|
2509
2770
|
prevScreen: t,
|
|
2510
2771
|
onStart: (e) => {
|
|
2511
2772
|
m?.onSwipeStart?.(e, {
|
|
2512
|
-
animate:
|
|
2773
|
+
animate: J,
|
|
2513
2774
|
currentDecorator: f,
|
|
2514
2775
|
prevDecorator: n
|
|
2515
2776
|
}), S("start", e, 0);
|
|
@@ -2526,7 +2787,7 @@ function an(e) {
|
|
|
2526
2787
|
prevScreen: t,
|
|
2527
2788
|
onProgress: (e, t) => {
|
|
2528
2789
|
c?.onSwipe?.(e, t, {
|
|
2529
|
-
animate:
|
|
2790
|
+
animate: J,
|
|
2530
2791
|
currentDecorator: o,
|
|
2531
2792
|
prevDecorator: n
|
|
2532
2793
|
}), S("swipe", e, t);
|
|
@@ -2545,15 +2806,15 @@ function an(e) {
|
|
|
2545
2806
|
prevScreen: t,
|
|
2546
2807
|
onStart: (e) => {
|
|
2547
2808
|
u?.onSwipeEnd?.(e, {
|
|
2548
|
-
animate:
|
|
2809
|
+
animate: J,
|
|
2549
2810
|
currentDecorator: l,
|
|
2550
2811
|
prevDecorator: n
|
|
2551
2812
|
}), S("end", e, 0);
|
|
2552
2813
|
}
|
|
2553
2814
|
})) {
|
|
2554
|
-
c?.setAttribute(
|
|
2815
|
+
c?.setAttribute(On, "true"), l?.setAttribute(On, "true");
|
|
2555
2816
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
2556
|
-
for (let e of r.prev)
|
|
2817
|
+
for (let e of r.prev) q(e), e.style.removeProperty("will-change");
|
|
2557
2818
|
r = {
|
|
2558
2819
|
current: [],
|
|
2559
2820
|
prev: []
|
|
@@ -2561,14 +2822,14 @@ function an(e) {
|
|
|
2561
2822
|
current: [],
|
|
2562
2823
|
prev: []
|
|
2563
2824
|
}, e.back();
|
|
2564
|
-
} else c &&
|
|
2825
|
+
} else c && q(c), t && q(t), l && q(l), n && q(n), b(), C(), e.setDragStatus("IDLE");
|
|
2565
2826
|
};
|
|
2566
2827
|
return {
|
|
2567
2828
|
pointerDown: (t) => {
|
|
2568
|
-
e.isReadyForDrag() && (f =
|
|
2829
|
+
e.isReadyForDrag() && (f = wn(t.target, {
|
|
2569
2830
|
direction: "x",
|
|
2570
2831
|
verifyByScroll: !0
|
|
2571
|
-
}), p =
|
|
2832
|
+
}), p = wn(t.target, {
|
|
2572
2833
|
direction: "y",
|
|
2573
2834
|
verifyByScroll: !0
|
|
2574
2835
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -2597,7 +2858,7 @@ function an(e) {
|
|
|
2597
2858
|
}
|
|
2598
2859
|
//#endregion
|
|
2599
2860
|
//#region src/screen/computeBarRiding.ts
|
|
2600
|
-
function
|
|
2861
|
+
function An(e) {
|
|
2601
2862
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
2602
2863
|
app: !1,
|
|
2603
2864
|
nav: !1
|
|
@@ -2607,25 +2868,70 @@ function on(e) {
|
|
|
2607
2868
|
};
|
|
2608
2869
|
}
|
|
2609
2870
|
//#endregion
|
|
2871
|
+
//#region src/screen/pendingNetwork.ts
|
|
2872
|
+
var jn = 0, Mn = !1, Nn = () => {
|
|
2873
|
+
jn = Math.max(0, jn - 1);
|
|
2874
|
+
}, Pn = () => {
|
|
2875
|
+
if (!(Mn || typeof window > "u")) {
|
|
2876
|
+
if (Mn = !0, typeof window.fetch == "function") {
|
|
2877
|
+
let e = window.fetch.bind(window);
|
|
2878
|
+
window.fetch = (...t) => {
|
|
2879
|
+
jn += 1;
|
|
2880
|
+
let n;
|
|
2881
|
+
try {
|
|
2882
|
+
n = e(...t);
|
|
2883
|
+
} catch (e) {
|
|
2884
|
+
throw Nn(), e;
|
|
2885
|
+
}
|
|
2886
|
+
return n.then((e) => (Nn(), e), (e) => {
|
|
2887
|
+
throw Nn(), e;
|
|
2888
|
+
});
|
|
2889
|
+
};
|
|
2890
|
+
}
|
|
2891
|
+
if (typeof XMLHttpRequest == "function") {
|
|
2892
|
+
let e = XMLHttpRequest.prototype.send;
|
|
2893
|
+
XMLHttpRequest.prototype.send = function(...t) {
|
|
2894
|
+
jn += 1;
|
|
2895
|
+
let n = !1, r = () => {
|
|
2896
|
+
n || (n = !0, Nn());
|
|
2897
|
+
};
|
|
2898
|
+
this.addEventListener("loadend", r);
|
|
2899
|
+
try {
|
|
2900
|
+
return e.apply(this, t);
|
|
2901
|
+
} catch (e) {
|
|
2902
|
+
throw r(), e;
|
|
2903
|
+
}
|
|
2904
|
+
};
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
}, Fn = () => (Pn(), jn > 0);
|
|
2908
|
+
//#endregion
|
|
2610
2909
|
//#region src/screen/animStartAnchor.ts
|
|
2611
|
-
function
|
|
2910
|
+
function In(e) {
|
|
2612
2911
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
2613
2912
|
}
|
|
2614
|
-
var
|
|
2615
|
-
function
|
|
2616
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0,
|
|
2913
|
+
var Ln = 300, Rn = 20;
|
|
2914
|
+
function zn(e) {
|
|
2915
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, Rn);
|
|
2617
2916
|
}
|
|
2618
|
-
function
|
|
2619
|
-
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of
|
|
2917
|
+
function Bn(e) {
|
|
2918
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of zn(e)) t.decode().catch(() => {});
|
|
2620
2919
|
}
|
|
2621
|
-
|
|
2622
|
-
|
|
2920
|
+
var Vn = 3, Hn = 40, Un = 24, Wn = (e) => {
|
|
2921
|
+
if (typeof e.querySelectorAll != "function") return !1;
|
|
2922
|
+
let t = e.querySelectorAll("*").length;
|
|
2923
|
+
/* v8 ignore stop */
|
|
2924
|
+
return t < Un ? !1 : ((e.textContent ?? "").trim().length + e.querySelectorAll("img").length * Hn) / t < Vn;
|
|
2925
|
+
};
|
|
2926
|
+
function Gn(e, t = {}) {
|
|
2927
|
+
let n = !1, r = 0, i = [], a = [], o = () => {
|
|
2928
|
+
if (n) return;
|
|
2623
2929
|
let r = t.scope;
|
|
2624
2930
|
if (t.decodeWait === !1 || !r || typeof r.querySelectorAll != "function") {
|
|
2625
2931
|
e();
|
|
2626
2932
|
return;
|
|
2627
2933
|
}
|
|
2628
|
-
let i =
|
|
2934
|
+
let i = zn(r);
|
|
2629
2935
|
if (i.length === 0) {
|
|
2630
2936
|
e();
|
|
2631
2937
|
return;
|
|
@@ -2636,26 +2942,85 @@ function fn(e, t = {}) {
|
|
|
2636
2942
|
Promise.race([a, o]).then(() => {
|
|
2637
2943
|
n || e();
|
|
2638
2944
|
});
|
|
2639
|
-
},
|
|
2945
|
+
}, s = (e) => {
|
|
2946
|
+
let n = t.contentSettle, r = t.scope;
|
|
2947
|
+
if (!n || !r || typeof MutationObserver > "u") {
|
|
2948
|
+
e();
|
|
2949
|
+
return;
|
|
2950
|
+
}
|
|
2951
|
+
if (!Wn(r)) {
|
|
2952
|
+
e();
|
|
2953
|
+
return;
|
|
2954
|
+
}
|
|
2955
|
+
/* v8 ignore start -- performance exists in every runtime under test;
|
|
2956
|
+
the fallback only shields exotic embedders. */
|
|
2957
|
+
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () => {
|
|
2958
|
+
l || (l = !0, f.disconnect(), clearTimeout(p), clearTimeout(m), clearTimeout(h), s.forEach((e) => cancelAnimationFrame(e)), s = [], e());
|
|
2959
|
+
}, d = () => {
|
|
2960
|
+
s.forEach((e) => cancelAnimationFrame(e)), s = [];
|
|
2961
|
+
let e = (t) => {
|
|
2962
|
+
if (t <= 0) {
|
|
2963
|
+
if (Fn() && o() < n.capMs) {
|
|
2964
|
+
s.push(requestAnimationFrame(() => e(6)));
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
u();
|
|
2968
|
+
return;
|
|
2969
|
+
}
|
|
2970
|
+
s.push(requestAnimationFrame(() => e(t - 1)));
|
|
2971
|
+
};
|
|
2972
|
+
e(6);
|
|
2973
|
+
}, f = new MutationObserver((e) => {
|
|
2974
|
+
let t = 0;
|
|
2975
|
+
for (let n of e) if (n.type === "childList") for (let e of Array.from(n.addedNodes)) t += e instanceof Element ? 1 + e.querySelectorAll("*").length : 1;
|
|
2976
|
+
if (!(t < n.minNodes)) {
|
|
2977
|
+
/* v8 ignore start -- the cap timer fires the moment elapsed reaches
|
|
2978
|
+
capMs, so a delivery can never observe elapsed past the cap first;
|
|
2979
|
+
kept so a delivery racing the timer can only ever finish early. */
|
|
2980
|
+
if (c = !0, o() >= n.capMs) {
|
|
2981
|
+
u();
|
|
2982
|
+
return;
|
|
2983
|
+
}
|
|
2984
|
+
/* v8 ignore stop */
|
|
2985
|
+
d();
|
|
2986
|
+
}
|
|
2987
|
+
});
|
|
2988
|
+
f.observe(r, {
|
|
2989
|
+
childList: !0,
|
|
2990
|
+
subtree: !0
|
|
2991
|
+
});
|
|
2992
|
+
let p = setTimeout(() => {
|
|
2993
|
+
!c && !Fn() && u();
|
|
2994
|
+
}, n.graceMs), m = setTimeout(function e() {
|
|
2995
|
+
if (!c) {
|
|
2996
|
+
if (Fn() && o() < n.capMs) {
|
|
2997
|
+
setTimeout(e, 100);
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
u();
|
|
3001
|
+
}
|
|
3002
|
+
}, n.firstWaitMs), h = setTimeout(u, n.capMs);
|
|
3003
|
+
a.push(u);
|
|
3004
|
+
}, c = (e) => {
|
|
2640
3005
|
if (e <= 0) {
|
|
2641
|
-
|
|
3006
|
+
s(o);
|
|
2642
3007
|
return;
|
|
2643
3008
|
}
|
|
2644
|
-
i.push(requestAnimationFrame(() =>
|
|
2645
|
-
},
|
|
2646
|
-
r = requestAnimationFrame(() =>
|
|
3009
|
+
i.push(requestAnimationFrame(() => c(e - 1)));
|
|
3010
|
+
}, l = requestAnimationFrame(() => {
|
|
3011
|
+
r = requestAnimationFrame(() => c(t.extraFrames ?? 0));
|
|
2647
3012
|
});
|
|
2648
3013
|
return () => {
|
|
2649
|
-
n = !0, cancelAnimationFrame(
|
|
3014
|
+
n = !0, cancelAnimationFrame(l), r && cancelAnimationFrame(r), i.forEach((e) => cancelAnimationFrame(e)), a.forEach((e) => e());
|
|
2650
3015
|
};
|
|
2651
3016
|
}
|
|
2652
|
-
function
|
|
2653
|
-
let n =
|
|
3017
|
+
function Kn(e, t = {}) {
|
|
3018
|
+
let n = Gn(e, t), r = setTimeout(e, 300);
|
|
2654
3019
|
return () => {
|
|
2655
3020
|
n(), clearTimeout(r);
|
|
2656
3021
|
};
|
|
2657
3022
|
}
|
|
2658
|
-
function
|
|
3023
|
+
function qn() {
|
|
2659
3024
|
let e = /* @__PURE__ */ new Map(), t = (t, n) => {
|
|
2660
3025
|
clearTimeout(n.backstop), e.delete(t);
|
|
2661
3026
|
let r = [...n.members];
|
|
@@ -2674,7 +3039,7 @@ function mn() {
|
|
|
2674
3039
|
let s = o, c = {
|
|
2675
3040
|
release: i,
|
|
2676
3041
|
ready: !1,
|
|
2677
|
-
cancelReadiness:
|
|
3042
|
+
cancelReadiness: Gn(() => {
|
|
2678
3043
|
c.ready = !0, n(s) && t(r, s);
|
|
2679
3044
|
}, a)
|
|
2680
3045
|
};
|
|
@@ -2691,7 +3056,7 @@ function mn() {
|
|
|
2691
3056
|
}
|
|
2692
3057
|
//#endregion
|
|
2693
3058
|
//#region src/screen/observeBarHeight.ts
|
|
2694
|
-
function
|
|
3059
|
+
function Jn(e, t) {
|
|
2695
3060
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
2696
3061
|
let n = new ResizeObserver(([e]) => {
|
|
2697
3062
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -2702,14 +3067,14 @@ function hn(e, t) {
|
|
|
2702
3067
|
}
|
|
2703
3068
|
//#endregion
|
|
2704
3069
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
2705
|
-
var
|
|
2706
|
-
function
|
|
3070
|
+
var Yn = 0;
|
|
3071
|
+
function Xn(e) {
|
|
2707
3072
|
let t = 0, n = () => {
|
|
2708
3073
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
2709
3074
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
2710
3075
|
t = t < 0 ? 0 : t;
|
|
2711
|
-
let n = t -
|
|
2712
|
-
n = n < 0 ? 0 : n,
|
|
3076
|
+
let n = t - Yn;
|
|
3077
|
+
n = n < 0 ? 0 : n, Yn ||= t, e(t, n);
|
|
2713
3078
|
});
|
|
2714
3079
|
};
|
|
2715
3080
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -2717,8 +3082,187 @@ function _n(e) {
|
|
|
2717
3082
|
};
|
|
2718
3083
|
}
|
|
2719
3084
|
//#endregion
|
|
3085
|
+
//#region src/core/engine/imageDecodeOffloader.ts
|
|
3086
|
+
var Zn = 8, Qn = 2, Q = 96, $n = 15e3, er = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", tr = "data-flemo-image-src", nr = "flemo-image-scale-v1", rr = (e) => {
|
|
3087
|
+
if (e.naturalWidth <= 0 || e.naturalHeight <= 0 || e.boxWidth <= 0 || e.boxHeight <= 0) return !1;
|
|
3088
|
+
let t = e.boxWidth * e.boxHeight * e.devicePixelRatio * e.devicePixelRatio;
|
|
3089
|
+
return e.naturalWidth * e.naturalHeight > t * 8;
|
|
3090
|
+
}, ir = "onmessage = async (e) => {\n const { url, targetWidth, neededArea, ratio } = e.data;\n try {\n const response = await fetch(url);\n if (!response.ok) throw new Error(\"http \" + response.status);\n const blob = await response.blob();\n const full = await createImageBitmap(blob);\n if (full.width * full.height <= neededArea * ratio) {\n full.close();\n postMessage({ url, skip: true });\n return;\n }\n const scale = targetWidth / full.width;\n const canvas = new OffscreenCanvas(targetWidth, Math.max(1, Math.round(full.height * scale)));\n const context = canvas.getContext(\"2d\");\n context.imageSmoothingQuality = \"high\";\n context.drawImage(full, 0, 0, canvas.width, canvas.height);\n full.close();\n const out = await canvas.convertToBlob({ type: \"image/jpeg\", quality: 0.85 });\n postMessage({ url, blob: out });\n } catch (error) {\n postMessage({ url, error: String(error) });\n }\n};", ar = () => typeof Worker < "u" && typeof OffscreenCanvas < "u" && typeof createImageBitmap == "function" && typeof MutationObserver < "u" && typeof URL < "u" && typeof URL.createObjectURL == "function", or = async (e, t) => {
|
|
3091
|
+
try {
|
|
3092
|
+
if (typeof caches > "u") return;
|
|
3093
|
+
await (await caches.open(nr)).put(e, new Response(t, { headers: { "content-type": t.type } }));
|
|
3094
|
+
} catch {}
|
|
3095
|
+
}, sr = async (e) => {
|
|
3096
|
+
try {
|
|
3097
|
+
if (typeof caches > "u") return null;
|
|
3098
|
+
let t = await (await caches.open(nr)).match(e);
|
|
3099
|
+
return t ? await t.blob() : null;
|
|
3100
|
+
} catch {
|
|
3101
|
+
return null;
|
|
3102
|
+
}
|
|
3103
|
+
};
|
|
3104
|
+
function cr(e) {
|
|
3105
|
+
if (!ar()) return () => {};
|
|
3106
|
+
let t = null, n = !1, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakSet(), s = /* @__PURE__ */ new Set(), c = () => typeof devicePixelRatio == "number" ? devicePixelRatio : 1, l = () => {
|
|
3107
|
+
if (t) return t;
|
|
3108
|
+
try {
|
|
3109
|
+
t = new Worker(URL.createObjectURL(new Blob([ir])));
|
|
3110
|
+
} catch {
|
|
3111
|
+
return null;
|
|
3112
|
+
}
|
|
3113
|
+
return t.onmessage = (e) => {
|
|
3114
|
+
let { url: t, blob: n, error: r, skip: a } = e.data;
|
|
3115
|
+
if (i.delete(t), r || a || !n) {
|
|
3116
|
+
u(t, "skip");
|
|
3117
|
+
return;
|
|
3118
|
+
}
|
|
3119
|
+
let o = URL.createObjectURL(n);
|
|
3120
|
+
s.add(o), or(t, n), u(t, o);
|
|
3121
|
+
}, t;
|
|
3122
|
+
}, u = (e, t) => {
|
|
3123
|
+
r.has(e) || r.set(e, t);
|
|
3124
|
+
for (let [t, n] of [...a]) n.url === e && d(t, r.get(e));
|
|
3125
|
+
}, d = (e, t) => {
|
|
3126
|
+
let n = a.get(e);
|
|
3127
|
+
if (n) {
|
|
3128
|
+
if (a.delete(e), clearTimeout(n.timeout), n.detachListeners?.(), n.responsive) {
|
|
3129
|
+
if (t && t !== "skip") {
|
|
3130
|
+
e.setAttribute(tr, n.url), e.removeAttribute("srcset"), e.removeAttribute("sizes");
|
|
3131
|
+
let r = e.closest("picture");
|
|
3132
|
+
if (r) for (let e of Array.from(r.querySelectorAll("source"))) e.removeAttribute("srcset");
|
|
3133
|
+
e.src = t;
|
|
3134
|
+
}
|
|
3135
|
+
} else e.getAttribute("src") === er && (t && t !== "skip" ? e.src = t : (e.removeAttribute(tr), e.src = n.url));
|
|
3136
|
+
n.previousVisibility ? e.style.visibility = n.previousVisibility : e.style.removeProperty("visibility");
|
|
3137
|
+
}
|
|
3138
|
+
}, f = (e, t, n) => {
|
|
3139
|
+
if (r.has(e) || i.has(e)) return;
|
|
3140
|
+
let a = l();
|
|
3141
|
+
if (!a) return;
|
|
3142
|
+
i.add(e);
|
|
3143
|
+
let o = Math.round(Math.max(Q, t * c()) * Qn), s = Math.max(t * n, Q * Q) * c() ** 2;
|
|
3144
|
+
a.postMessage({
|
|
3145
|
+
url: e,
|
|
3146
|
+
targetWidth: o,
|
|
3147
|
+
neededArea: s,
|
|
3148
|
+
ratio: 8
|
|
3149
|
+
});
|
|
3150
|
+
}, p = (e) => {
|
|
3151
|
+
if (e.complete && e.naturalWidth > 0) return;
|
|
3152
|
+
let t = {
|
|
3153
|
+
url: "",
|
|
3154
|
+
previousVisibility: e.style.visibility,
|
|
3155
|
+
timeout: setTimeout(() => d(e, null), $n),
|
|
3156
|
+
responsive: !0
|
|
3157
|
+
}, i = () => {
|
|
3158
|
+
/* v8 ignore next -- consider() only routes elements with an https src
|
|
3159
|
+
here, so the final fallback arm is unreachable. */
|
|
3160
|
+
let i = e.currentSrc || e.getAttribute("src") || "", o = e.getBoundingClientRect();
|
|
3161
|
+
if (!(/^https?:/.test(i) && rr({
|
|
3162
|
+
naturalWidth: e.naturalWidth,
|
|
3163
|
+
naturalHeight: e.naturalHeight,
|
|
3164
|
+
boxWidth: o.width || Q,
|
|
3165
|
+
boxHeight: o.height || Q,
|
|
3166
|
+
devicePixelRatio: c()
|
|
3167
|
+
}))) {
|
|
3168
|
+
d(e, null);
|
|
3169
|
+
return;
|
|
3170
|
+
}
|
|
3171
|
+
t.url = i;
|
|
3172
|
+
let l = r.get(i);
|
|
3173
|
+
if (l) {
|
|
3174
|
+
d(e, l);
|
|
3175
|
+
return;
|
|
3176
|
+
}
|
|
3177
|
+
sr(i).then((t) => {
|
|
3178
|
+
if (!(n || !a.has(e))) {
|
|
3179
|
+
/* v8 ignore start -- a verdict can only appear via settle(), which
|
|
3180
|
+
releases every held element of the url first, so a still-held
|
|
3181
|
+
element cannot observe an existing verdict here; kept as a guard
|
|
3182
|
+
against future settle() reorderings. */
|
|
3183
|
+
if (r.has(i)) {
|
|
3184
|
+
d(e, r.get(i));
|
|
3185
|
+
return;
|
|
3186
|
+
}
|
|
3187
|
+
/* v8 ignore stop */
|
|
3188
|
+
if (t) {
|
|
3189
|
+
let e = URL.createObjectURL(t);
|
|
3190
|
+
s.add(e), u(i, e);
|
|
3191
|
+
return;
|
|
3192
|
+
}
|
|
3193
|
+
f(i, o.width || Q, o.height || Q);
|
|
3194
|
+
}
|
|
3195
|
+
});
|
|
3196
|
+
}, o = () => d(e, null);
|
|
3197
|
+
t.detachListeners = () => {
|
|
3198
|
+
e.removeEventListener("load", i), e.removeEventListener("error", o);
|
|
3199
|
+
}, e.addEventListener("load", i), e.addEventListener("error", o), a.set(e, t), e.style.visibility = "hidden";
|
|
3200
|
+
}, m = (e) => {
|
|
3201
|
+
if (n || o.has(e) || e.getAttribute("data-flemo-image-src") !== null) return;
|
|
3202
|
+
let t = e.getAttribute("src") ?? "";
|
|
3203
|
+
if (!/^https?:/.test(t)) return;
|
|
3204
|
+
if (e.getAttribute("srcset") !== null || e.closest("picture") !== null) {
|
|
3205
|
+
o.add(e), p(e);
|
|
3206
|
+
return;
|
|
3207
|
+
}
|
|
3208
|
+
if (o.add(e), e.complete && e.naturalWidth > 0) {
|
|
3209
|
+
let n = e.getBoundingClientRect();
|
|
3210
|
+
f(t, n.width || Q, n.height || Q);
|
|
3211
|
+
return;
|
|
3212
|
+
}
|
|
3213
|
+
let i = r.get(t);
|
|
3214
|
+
if (i !== "skip") {
|
|
3215
|
+
if (i) {
|
|
3216
|
+
e.setAttribute(tr, t), e.src = i;
|
|
3217
|
+
return;
|
|
3218
|
+
}
|
|
3219
|
+
a.set(e, {
|
|
3220
|
+
url: t,
|
|
3221
|
+
previousVisibility: e.style.visibility,
|
|
3222
|
+
timeout: setTimeout(() => d(e, null), $n)
|
|
3223
|
+
}), e.style.visibility = "hidden", e.setAttribute(tr, t), e.src = er, sr(t).then((i) => {
|
|
3224
|
+
if (n || r.has(t)) return;
|
|
3225
|
+
if (i) {
|
|
3226
|
+
let e = URL.createObjectURL(i);
|
|
3227
|
+
s.add(e), u(t, e);
|
|
3228
|
+
return;
|
|
3229
|
+
}
|
|
3230
|
+
let a = () => {
|
|
3231
|
+
if (n) return;
|
|
3232
|
+
let r = e.getBoundingClientRect();
|
|
3233
|
+
f(t, r.width || Q, r.height || Q);
|
|
3234
|
+
};
|
|
3235
|
+
typeof requestAnimationFrame == "function" ? requestAnimationFrame(a) : a();
|
|
3236
|
+
});
|
|
3237
|
+
}
|
|
3238
|
+
}, h = (e) => {
|
|
3239
|
+
if (e instanceof HTMLImageElement && m(e), typeof e.querySelectorAll == "function") for (let t of Array.from(e.querySelectorAll("img"))) m(t);
|
|
3240
|
+
}, g = new MutationObserver((e) => {
|
|
3241
|
+
for (let t of e) for (let e of Array.from(t.addedNodes)) e instanceof Element && h(e);
|
|
3242
|
+
});
|
|
3243
|
+
return g.observe(e, {
|
|
3244
|
+
childList: !0,
|
|
3245
|
+
subtree: !0
|
|
3246
|
+
}), h(e), () => {
|
|
3247
|
+
n = !0, g.disconnect(), t?.terminate(), t = null;
|
|
3248
|
+
for (let e of [...a.keys()]) d(e, null);
|
|
3249
|
+
i.clear(), r.clear();
|
|
3250
|
+
for (let e of s) URL.revokeObjectURL(e);
|
|
3251
|
+
s.clear();
|
|
3252
|
+
};
|
|
3253
|
+
}
|
|
3254
|
+
var $ = null;
|
|
3255
|
+
function lr() {
|
|
3256
|
+
return typeof document > "u" || !document.body ? () => {} : ($ ? $.count += 1 : $ = {
|
|
3257
|
+
dispose: cr(document.body),
|
|
3258
|
+
count: 1
|
|
3259
|
+
}, () => {
|
|
3260
|
+
$ && (--$.count, $.count <= 0 && ($.dispose(), $ = null));
|
|
3261
|
+
});
|
|
3262
|
+
}
|
|
3263
|
+
//#endregion
|
|
2720
3264
|
//#region src/utils/isOpaqueColor.ts
|
|
2721
|
-
function
|
|
3265
|
+
function ur(e) {
|
|
2722
3266
|
let t = e.trim().toLowerCase();
|
|
2723
3267
|
if (t === "transparent" || t === "") return !1;
|
|
2724
3268
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -2729,7 +3273,7 @@ function vn(e) {
|
|
|
2729
3273
|
}
|
|
2730
3274
|
//#endregion
|
|
2731
3275
|
//#region src/utils/buildRoutePath.ts
|
|
2732
|
-
function
|
|
3276
|
+
function dr(e, n) {
|
|
2733
3277
|
let i = n ?? {}, a = t(e)(Object.fromEntries(Object.entries(i).map(([e, t]) => [e, String(t)]))), o = (typeof e == "string" ? r(e) : e).tokens.filter((e) => e.type === "param").map((e) => e.name), s = Object.fromEntries(Object.entries(i).filter(([e]) => !o.includes(e))), c = new URLSearchParams(s).toString();
|
|
2734
3278
|
return {
|
|
2735
3279
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -2737,4 +3281,4 @@ function yn(e, n) {
|
|
|
2737
3281
|
};
|
|
2738
3282
|
}
|
|
2739
3283
|
//#endregion
|
|
2740
|
-
export {
|
|
3284
|
+
export { Ln as ANIM_HOLD_RELEASE_BACKSTOP_MS, tr as OFFLOADED_SRC_ATTR, Zn as OVERSIZE_AREA_RATIO, hn as SKIP_ANIMATION_ATTR, s as TaskManger, In as animHoldKey, J as animateInline, W as animationName, oe as appendParamsQuery, rt as applyTransitionStyles, dr as buildRoutePath, Dn as canProgrammaticallyScroll, q as clearInlineAnimation, We as collectAnimatedProperties, $e as compileTransitionStyles, An as computeBarRiding, me as computeScreenFreeze, b as consumeSelfInducedPop, qn as createAnimHoldCoordinator, g as createBrowserHistoryDriver, xe as createDecorator, c as createHistoryStore, x as createHistorySync, cr as createImageDecodeOffloader, ne as createMemoryHistoryDriver, re as createNavigateStore, ie as createNavigationController, Te as createPartTransition, Se as createRawDecorator, Ee as createRawPartTransition, F as createRawTransition, fe as createRouterScope, pe as createScreenSelector, ue as createScreenStore, _ as createSelfPopGuard, se as createStepController, kn as createSwipeController, P as createTransition, Cn as createTransitionEngine, M as createTransitionStore, I as cupertino, R as decoratorMap, Bn as eagerlyDecodeImages, Ge as easingToCss, lr as ensureImageDecodeOffloader, O as ensureScopeHistorySync, p as ensureWindowHistoryState, ut as enteringInitialStyle, wn as findScrollable, l as getMatchedPathPattern, u as getParams, It as holdCompositorWarm, ur as isOpaqueColor, f as isServer, _e as layout, y as markSelfInducedPop, le as matchesPathname, ve as material, ye as none, Jn as observeBarHeight, Xn as observeViewportScrollHeight, En as overflowsAxis, we as overlay, z as partTransitionMap, ae as readStepParams, lt as registerTransitionDefinitions, te as releaseScopeHistorySync, be as resolveTransition, Kn as scheduleAnimHoldRelease, d as seedInitialHistory, m as seedRouterEntry, rr as shouldOffloadImage, ce as subscribeStepParamsRestore, H as targetToDecls, L as transitionMap, G as variantHasAnimation };
|