@flemo/core 1.21.1 → 1.22.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__/motionDriverKind.test.d.ts +1 -0
- package/dist/core/engine/__tests__/nativeStallAnchor.test.d.ts +1 -0
- package/dist/core/engine/driverPolicy.d.ts +1 -0
- package/dist/core/engine/motionDriverKind.d.ts +7 -0
- package/dist/core/engine/nativeStallAnchor.d.ts +2 -0
- package/dist/core/engine/perceptualSpan.d.ts +2 -1
- package/dist/core/engine/transitionPlayer.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +499 -394
- package/dist/screen/computeScreenFreeze.d.ts +2 -0
- package/dist/transition/typing.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -562,7 +562,7 @@ function ne(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,
|
|
@@ -572,11 +572,11 @@ function k() {
|
|
|
572
572
|
}
|
|
573
573
|
//#endregion
|
|
574
574
|
//#region src/navigate/createNavigationController.ts
|
|
575
|
-
var
|
|
575
|
+
var k = (e, t, n) => {
|
|
576
576
|
let { regexp: r } = i(e);
|
|
577
577
|
for (let e = t - 1; e >= 0; e--) if (r.test(n[e].pathname)) return t - e;
|
|
578
578
|
return -1;
|
|
579
|
-
},
|
|
579
|
+
}, A = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t, j = async (e, t, n, r) => {
|
|
580
580
|
let i, a = new Promise((t) => {
|
|
581
581
|
i = e.subscribe(() => t(!0));
|
|
582
582
|
}), o = new Promise((e) => setTimeout(() => e(!1), 200));
|
|
@@ -584,7 +584,7 @@ var A = (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;
|
|
@@ -610,10 +610,10 @@ function re(e) {
|
|
|
610
610
|
}
|
|
611
611
|
let s = c(), { index: d, histories: f, addHistory: g, popHistories: _ } = t.history.getState(), v = (() => {
|
|
612
612
|
if (u?.until != null) {
|
|
613
|
-
let e =
|
|
613
|
+
let e = k(u.until, d, f);
|
|
614
614
|
return e < 0 ? 0 : e;
|
|
615
615
|
}
|
|
616
|
-
return Math.min(
|
|
616
|
+
return Math.min(A(u?.skip, 0), Math.max(0, d));
|
|
617
617
|
})(), { setStatus: y, setTransitionTaskId: b } = t.navigate.getState();
|
|
618
618
|
y("PUSHING"), b(h);
|
|
619
619
|
let { pathname: x, toPathname: S } = n(e, l ?? {}), C = {
|
|
@@ -640,7 +640,7 @@ function re(e) {
|
|
|
640
640
|
return g({
|
|
641
641
|
...C,
|
|
642
642
|
frameIndex: T + 1
|
|
643
|
-
}), await
|
|
643
|
+
}), await j(r, i, v, () => {
|
|
644
644
|
o(), r.pushState({
|
|
645
645
|
id: h,
|
|
646
646
|
index: T + 1,
|
|
@@ -679,10 +679,10 @@ function re(e) {
|
|
|
679
679
|
}
|
|
680
680
|
let s = c(), { index: d, histories: f, addHistory: g, replaceHistory: _, popHistories: v } = t.history.getState(), y = (() => {
|
|
681
681
|
if (u?.until != null) {
|
|
682
|
-
let e =
|
|
682
|
+
let e = k(u.until, d, f);
|
|
683
683
|
return e < 0 ? 0 : e + 1;
|
|
684
684
|
}
|
|
685
|
-
return Math.min(
|
|
685
|
+
return Math.min(A(u?.skip, 0) + 1, d + 1);
|
|
686
686
|
})();
|
|
687
687
|
if (y <= 0) {
|
|
688
688
|
a.abort();
|
|
@@ -714,7 +714,7 @@ function re(e) {
|
|
|
714
714
|
return v(y - 1), g({
|
|
715
715
|
...w,
|
|
716
716
|
frameIndex: E
|
|
717
|
-
}), y <= d ? await
|
|
717
|
+
}), y <= d ? await j(r, i, y, () => {
|
|
718
718
|
o(), r.pushState({
|
|
719
719
|
id: h,
|
|
720
720
|
index: E,
|
|
@@ -723,7 +723,7 @@ function re(e) {
|
|
|
723
723
|
transitionName: p,
|
|
724
724
|
layoutId: m
|
|
725
725
|
}, S);
|
|
726
|
-
}) : await
|
|
726
|
+
}) : await j(r, i, d, () => {
|
|
727
727
|
o(), r.replaceState({
|
|
728
728
|
id: h,
|
|
729
729
|
index: E,
|
|
@@ -779,10 +779,10 @@ function re(e) {
|
|
|
779
779
|
pop: async (e) => {
|
|
780
780
|
await d((t, n) => {
|
|
781
781
|
if (e?.until != null) {
|
|
782
|
-
let r =
|
|
782
|
+
let r = k(e.until, t, n);
|
|
783
783
|
return r < 0 ? 0 : r;
|
|
784
784
|
}
|
|
785
|
-
let r =
|
|
785
|
+
let r = A(e?.skip, 1);
|
|
786
786
|
return r <= 0 ? 0 : Math.min(r, t);
|
|
787
787
|
}, e?.transitionName);
|
|
788
788
|
}
|
|
@@ -790,14 +790,14 @@ function re(e) {
|
|
|
790
790
|
}
|
|
791
791
|
//#endregion
|
|
792
792
|
//#region src/navigate/createStepController.ts
|
|
793
|
-
var
|
|
793
|
+
var ae = (e) => {
|
|
794
794
|
let t = e;
|
|
795
795
|
return t?.step ? t.params ?? {} : null;
|
|
796
|
-
},
|
|
796
|
+
}, oe = (e, t) => {
|
|
797
797
|
let n = new URLSearchParams(Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)]))).toString();
|
|
798
798
|
return n ? `${e}?${n}` : e;
|
|
799
799
|
};
|
|
800
|
-
function
|
|
800
|
+
function se(e) {
|
|
801
801
|
let { stores: t, driver: n, markSelfInduced: r, buildStepPathname: i, applyParams: o } = e;
|
|
802
802
|
return {
|
|
803
803
|
pushStep: async (e) => {
|
|
@@ -855,7 +855,7 @@ function oe(e) {
|
|
|
855
855
|
}
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function ce(e, t) {
|
|
859
859
|
return e.subscribe((e) => {
|
|
860
860
|
let n = e.state;
|
|
861
861
|
n?.step && s.addTask(async () => {
|
|
@@ -865,7 +865,7 @@ function se(e, t) {
|
|
|
865
865
|
}
|
|
866
866
|
//#endregion
|
|
867
867
|
//#region src/transition/store.ts
|
|
868
|
-
function
|
|
868
|
+
function le(t = "cupertino") {
|
|
869
869
|
return e((e) => ({
|
|
870
870
|
defaultTransitionName: t,
|
|
871
871
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -873,12 +873,12 @@ function ce(t = "cupertino") {
|
|
|
873
873
|
}
|
|
874
874
|
//#endregion
|
|
875
875
|
//#region src/utils/matchesPathname.ts
|
|
876
|
-
function
|
|
876
|
+
function ue(e, t) {
|
|
877
877
|
return i(e).regexp.test(t);
|
|
878
878
|
}
|
|
879
879
|
//#endregion
|
|
880
880
|
//#region src/screen/store.ts
|
|
881
|
-
function
|
|
881
|
+
function de() {
|
|
882
882
|
return e((e) => ({
|
|
883
883
|
dragStatus: "IDLE",
|
|
884
884
|
replaceTransitionStatus: "IDLE",
|
|
@@ -909,14 +909,14 @@ function ue() {
|
|
|
909
909
|
}
|
|
910
910
|
//#endregion
|
|
911
911
|
//#region src/core/createRouterScope.ts
|
|
912
|
-
var
|
|
912
|
+
var fe = {
|
|
913
913
|
mark: () => {},
|
|
914
914
|
consume: () => !1
|
|
915
|
-
},
|
|
916
|
-
function
|
|
915
|
+
}, M = /* @__PURE__ */ new Map();
|
|
916
|
+
function pe(e) {
|
|
917
917
|
let { routePaths: t, pathname: n, search: r, defaultTransitionName: i, memory: a, browserDriver: o } = e, s = f() ? void 0 : e.persistKey;
|
|
918
918
|
if (s) {
|
|
919
|
-
let e =
|
|
919
|
+
let e = M.get(s);
|
|
920
920
|
if (e) {
|
|
921
921
|
e.life.alive = !0, e.navigate.getState().setStatus("IDLE"), e.navigate.getState().setTransitionTaskId(null);
|
|
922
922
|
let t = e.history.getState();
|
|
@@ -946,25 +946,25 @@ function fe(e) {
|
|
|
946
946
|
layoutId: p.layoutId
|
|
947
947
|
},
|
|
948
948
|
url: p.pathname
|
|
949
|
-
}) : o, h = a ?
|
|
949
|
+
}) : o, h = a ? fe : _(), g = {
|
|
950
950
|
history: c([p], 0),
|
|
951
|
-
navigate:
|
|
952
|
-
transition:
|
|
953
|
-
screen:
|
|
951
|
+
navigate: re(),
|
|
952
|
+
transition: le(i),
|
|
953
|
+
screen: de(),
|
|
954
954
|
driver: m,
|
|
955
955
|
markSelfInduced: h.mark,
|
|
956
956
|
consume: h.consume,
|
|
957
957
|
routerKey: e.routerKey,
|
|
958
958
|
zoneEntryId: e.zoneEntryId,
|
|
959
|
-
ownsPathname: (e) =>
|
|
959
|
+
ownsPathname: (e) => ue(t, e),
|
|
960
960
|
persistent: !!s,
|
|
961
961
|
life: { alive: !0 }
|
|
962
962
|
};
|
|
963
|
-
return s &&
|
|
963
|
+
return s && M.set(s, g), g;
|
|
964
964
|
}
|
|
965
965
|
//#endregion
|
|
966
966
|
//#region src/screen/createScreenSelector.ts
|
|
967
|
-
function
|
|
967
|
+
function me(e, t) {
|
|
968
968
|
return e.map((n, r) => ({
|
|
969
969
|
...n,
|
|
970
970
|
isActive: r === t,
|
|
@@ -977,13 +977,17 @@ function pe(e, t) {
|
|
|
977
977
|
}
|
|
978
978
|
//#endregion
|
|
979
979
|
//#region src/screen/computeScreenFreeze.ts
|
|
980
|
-
function
|
|
980
|
+
function he(e) {
|
|
981
|
+
if (e.isPrev && e.index - 2 <= e.zIndex && e.replaceTransitionStatus === "IDLE" || e.isPrev && e.index - 2 > e.zIndex) return "immediate";
|
|
981
982
|
let t = e.status === "COMPLETED" && e.dragStatus === "IDLE";
|
|
982
|
-
return !e.isActive && t
|
|
983
|
+
return !e.isActive && t ? "deferred" : "live";
|
|
984
|
+
}
|
|
985
|
+
function ge(e) {
|
|
986
|
+
return he(e) !== "live";
|
|
983
987
|
}
|
|
984
988
|
//#endregion
|
|
985
989
|
//#region src/transition/createTransition.ts
|
|
986
|
-
function
|
|
990
|
+
function N({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exitBack: o, options: s }) {
|
|
987
991
|
return {
|
|
988
992
|
name: e,
|
|
989
993
|
initial: t,
|
|
@@ -1004,7 +1008,7 @@ function P({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
1004
1008
|
}
|
|
1005
1009
|
//#endregion
|
|
1006
1010
|
//#region src/transition/createRawTransition.ts
|
|
1007
|
-
function
|
|
1011
|
+
function _e({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnExit: l, completedOnEnter: u, options: d }) {
|
|
1008
1012
|
return {
|
|
1009
1013
|
name: e,
|
|
1010
1014
|
initial: t,
|
|
@@ -1025,10 +1029,10 @@ function he({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1025
1029
|
}
|
|
1026
1030
|
//#endregion
|
|
1027
1031
|
//#region src/transition/cupertino.ts
|
|
1028
|
-
var
|
|
1032
|
+
var ve = (e, t, n) => {
|
|
1029
1033
|
let [r, i] = t, [a, o] = n;
|
|
1030
1034
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1031
|
-
},
|
|
1035
|
+
}, ye = N({
|
|
1032
1036
|
name: "cupertino",
|
|
1033
1037
|
initial: { x: "100%" },
|
|
1034
1038
|
idle: {
|
|
@@ -1088,7 +1092,7 @@ var ge = (e, t, n) => {
|
|
|
1088
1092
|
swipeDirection: "x",
|
|
1089
1093
|
onSwipeStart: async () => !0,
|
|
1090
1094
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
1091
|
-
let { offset: o } = t, s = o.x, c =
|
|
1095
|
+
let { offset: o } = t, s = o.x, c = ve(s, [0, window.innerWidth], [0, 100]);
|
|
1092
1096
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-35 + c * .35}%` }, { duration: 0 }), c;
|
|
1093
1097
|
},
|
|
1094
1098
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -1112,10 +1116,10 @@ var ge = (e, t, n) => {
|
|
|
1112
1116
|
})]), c;
|
|
1113
1117
|
}
|
|
1114
1118
|
}
|
|
1115
|
-
}),
|
|
1119
|
+
}), P = (e, t, n) => {
|
|
1116
1120
|
let [r, i] = t, [a, o] = n;
|
|
1117
1121
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1118
|
-
},
|
|
1122
|
+
}, be = N({
|
|
1119
1123
|
name: "layout",
|
|
1120
1124
|
initial: { opacity: .97 },
|
|
1121
1125
|
idle: {
|
|
@@ -1143,7 +1147,7 @@ var ge = (e, t, n) => {
|
|
|
1143
1147
|
swipeDirection: "y",
|
|
1144
1148
|
onSwipeStart: async () => !0,
|
|
1145
1149
|
onSwipe: (e, t, { animate: n, currentScreen: r, onProgress: i }) => {
|
|
1146
|
-
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c =
|
|
1150
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = P(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);
|
|
1147
1151
|
return i?.(!0, 100), n(r, {
|
|
1148
1152
|
y: f,
|
|
1149
1153
|
opacity: c
|
|
@@ -1160,7 +1164,7 @@ var ge = (e, t, n) => {
|
|
|
1160
1164
|
}, { duration: .3 })]), c;
|
|
1161
1165
|
}
|
|
1162
1166
|
}
|
|
1163
|
-
}),
|
|
1167
|
+
}), xe = N({
|
|
1164
1168
|
name: "material",
|
|
1165
1169
|
initial: { y: "100%" },
|
|
1166
1170
|
idle: {
|
|
@@ -1268,7 +1272,7 @@ var ge = (e, t, n) => {
|
|
|
1268
1272
|
})]), c;
|
|
1269
1273
|
}
|
|
1270
1274
|
}
|
|
1271
|
-
}),
|
|
1275
|
+
}), F = N({
|
|
1272
1276
|
name: "none",
|
|
1273
1277
|
initial: {},
|
|
1274
1278
|
idle: {
|
|
@@ -1291,20 +1295,20 @@ var ge = (e, t, n) => {
|
|
|
1291
1295
|
value: {},
|
|
1292
1296
|
options: { duration: 0 }
|
|
1293
1297
|
}
|
|
1294
|
-
}),
|
|
1295
|
-
["none",
|
|
1296
|
-
["cupertino",
|
|
1297
|
-
["material",
|
|
1298
|
-
["layout",
|
|
1298
|
+
}), I = /* @__PURE__ */ new Map([
|
|
1299
|
+
["none", F],
|
|
1300
|
+
["cupertino", ye],
|
|
1301
|
+
["material", xe],
|
|
1302
|
+
["layout", be]
|
|
1299
1303
|
]);
|
|
1300
1304
|
//#endregion
|
|
1301
1305
|
//#region src/transition/resolveTransition.ts
|
|
1302
|
-
function
|
|
1303
|
-
return
|
|
1306
|
+
function Se(e) {
|
|
1307
|
+
return I.get(e) ?? I.get("none");
|
|
1304
1308
|
}
|
|
1305
1309
|
//#endregion
|
|
1306
1310
|
//#region src/transition/decorator/createDecorator.ts
|
|
1307
|
-
function
|
|
1311
|
+
function Ce({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1308
1312
|
return {
|
|
1309
1313
|
name: e,
|
|
1310
1314
|
initial: t,
|
|
@@ -1325,7 +1329,7 @@ function xe({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1325
1329
|
}
|
|
1326
1330
|
//#endregion
|
|
1327
1331
|
//#region src/transition/decorator/createRawDecorator.ts
|
|
1328
|
-
function
|
|
1332
|
+
function we({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1329
1333
|
return {
|
|
1330
1334
|
name: e,
|
|
1331
1335
|
initial: t,
|
|
@@ -1346,30 +1350,30 @@ function Se({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1346
1350
|
}
|
|
1347
1351
|
//#endregion
|
|
1348
1352
|
//#region src/transition/decorator/overlay.ts
|
|
1349
|
-
var
|
|
1353
|
+
var Te = "rgba(0, 0, 0, 0.2)", Ee = Ce({
|
|
1350
1354
|
name: "overlay",
|
|
1351
1355
|
initial: {
|
|
1352
1356
|
opacity: 0,
|
|
1353
|
-
backgroundColor:
|
|
1357
|
+
backgroundColor: Te
|
|
1354
1358
|
},
|
|
1355
1359
|
idle: {
|
|
1356
1360
|
value: {
|
|
1357
1361
|
opacity: 0,
|
|
1358
|
-
backgroundColor:
|
|
1362
|
+
backgroundColor: Te
|
|
1359
1363
|
},
|
|
1360
1364
|
options: { duration: 0 }
|
|
1361
1365
|
},
|
|
1362
1366
|
enter: {
|
|
1363
1367
|
value: {
|
|
1364
1368
|
opacity: 1,
|
|
1365
|
-
backgroundColor:
|
|
1369
|
+
backgroundColor: Te
|
|
1366
1370
|
},
|
|
1367
1371
|
options: { duration: .6 }
|
|
1368
1372
|
},
|
|
1369
1373
|
exit: {
|
|
1370
1374
|
value: {
|
|
1371
1375
|
opacity: 0,
|
|
1372
|
-
backgroundColor:
|
|
1376
|
+
backgroundColor: Te
|
|
1373
1377
|
},
|
|
1374
1378
|
options: { duration: .6 }
|
|
1375
1379
|
},
|
|
@@ -1378,10 +1382,10 @@ var Ce = "rgba(0, 0, 0, 0.2)", we = xe({
|
|
|
1378
1382
|
onSwipe: (e, t, { animate: n, prevDecorator: r }) => n(r, { opacity: Math.max(0, 1 - t / 100) }, { duration: 0 }),
|
|
1379
1383
|
onSwipeEnd: (e, { animate: t, prevDecorator: n }) => t(n, { opacity: +!e }, { duration: .3 })
|
|
1380
1384
|
}
|
|
1381
|
-
}),
|
|
1385
|
+
}), L = /* @__PURE__ */ new Map([["overlay", Ee]]);
|
|
1382
1386
|
//#endregion
|
|
1383
1387
|
//#region src/transition/partTransition/createPartTransition.ts
|
|
1384
|
-
function
|
|
1388
|
+
function De({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
1385
1389
|
return {
|
|
1386
1390
|
name: e,
|
|
1387
1391
|
initial: t,
|
|
@@ -1402,7 +1406,7 @@ function Te({ name: e, initial: t, idle: n, enter: r, exit: i, options: a }) {
|
|
|
1402
1406
|
}
|
|
1403
1407
|
//#endregion
|
|
1404
1408
|
//#region src/transition/partTransition/createRawPartTransition.ts
|
|
1405
|
-
function
|
|
1409
|
+
function Oe({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replaceOnEnter: a, replaceOnExit: o, popOnEnter: s, popOnExit: c, completedOnEnter: l, completedOnExit: u, options: d }) {
|
|
1406
1410
|
return {
|
|
1407
1411
|
name: e,
|
|
1408
1412
|
initial: t,
|
|
@@ -1423,7 +1427,7 @@ function Ee({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, repla
|
|
|
1423
1427
|
}
|
|
1424
1428
|
//#endregion
|
|
1425
1429
|
//#region src/transition/partTransition/partTransition.ts
|
|
1426
|
-
var
|
|
1430
|
+
var R = /* @__PURE__ */ new Map(), z = {
|
|
1427
1431
|
"IDLE-true": "self",
|
|
1428
1432
|
"IDLE-false": "self",
|
|
1429
1433
|
"PUSHING-true": "initial",
|
|
@@ -1434,17 +1438,17 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1434
1438
|
"POPPING-false": "PUSHING-false",
|
|
1435
1439
|
"COMPLETED-true": "self",
|
|
1436
1440
|
"COMPLETED-false": "self"
|
|
1437
|
-
},
|
|
1441
|
+
}, ke = Object.keys(z), Ae = (e) => {
|
|
1438
1442
|
if (!e) return 0;
|
|
1439
1443
|
let t = e.duration;
|
|
1440
1444
|
return typeof t == "number" && t >= 0 ? t : 0;
|
|
1441
|
-
},
|
|
1442
|
-
let n =
|
|
1445
|
+
}, je = (e) => e && typeof e.delay == "number" && e.delay > 0 ? e.delay : 0, Me = (e, t) => {
|
|
1446
|
+
let n = z[t];
|
|
1443
1447
|
return n === "self" ? null : n === "initial" ? e.initial : e.variants[n].value;
|
|
1444
|
-
},
|
|
1445
|
-
let n =
|
|
1448
|
+
}, B = (e, t) => {
|
|
1449
|
+
let n = Me(e, t);
|
|
1446
1450
|
if (n === null) return null;
|
|
1447
|
-
let r = e.variants[t], i =
|
|
1451
|
+
let r = e.variants[t], i = Ae(r.options), a = je(r.options);
|
|
1448
1452
|
return i <= 0 && a <= 0 ? null : {
|
|
1449
1453
|
from: n,
|
|
1450
1454
|
to: r.value,
|
|
@@ -1452,7 +1456,7 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1452
1456
|
delay: a,
|
|
1453
1457
|
ease: r.options?.ease
|
|
1454
1458
|
};
|
|
1455
|
-
},
|
|
1459
|
+
}, Ne = ke, Pe = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_"), Fe = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ie = /* @__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(".")), Le = (e, t) => t.startsWith("--") || Ie.has(t) ? `${e}` : t === "rotate" || t === "rotateX" || t === "rotateY" || t === "rotateZ" ? `${e}deg` : `${e}px`, Re = (e, t) => typeof t == "number" ? Le(t, e) : typeof t == "string" ? t : "", ze = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), Be = /* @__PURE__ */ new Set([
|
|
1456
1460
|
"x",
|
|
1457
1461
|
"y",
|
|
1458
1462
|
"z",
|
|
@@ -1463,7 +1467,7 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1463
1467
|
"rotateX",
|
|
1464
1468
|
"rotateY",
|
|
1465
1469
|
"rotateZ"
|
|
1466
|
-
]),
|
|
1470
|
+
]), Ve = /^-?0(\.0+)?(px|%|em|rem|vh|vw|vmin|vmax)?$/, He = /^-?0(\.0+)?(deg|rad|grad|turn)?$/, Ue = /^1(\.0+)?$/, We = (e, t) => e === "scale" || e === "scaleX" || e === "scaleY" ? t === 1 || typeof t == "string" && Ue.test(t.trim()) : e === "rotate" || e === "rotateX" || e === "rotateY" || e === "rotateZ" ? t === 0 || typeof t == "string" && He.test(t.trim()) : t === 0 || typeof t == "string" && Ve.test(t.trim()), Ge = (e, t) => {
|
|
1467
1471
|
switch (e) {
|
|
1468
1472
|
case "x": return `translate3d(${t}, 0, 0)`;
|
|
1469
1473
|
case "y": return `translate3d(0, ${t}, 0)`;
|
|
@@ -1477,16 +1481,16 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1477
1481
|
case "rotateY": return `rotateY(${t})`;
|
|
1478
1482
|
default: return "";
|
|
1479
1483
|
}
|
|
1480
|
-
},
|
|
1484
|
+
}, Ke = (e) => {
|
|
1481
1485
|
let t = /* @__PURE__ */ new Map(), n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
1482
|
-
if (!
|
|
1486
|
+
if (!Fe(e)) return;
|
|
1483
1487
|
let n = [];
|
|
1484
1488
|
for (let r of Object.keys(e)) {
|
|
1485
|
-
let i = e[r], a =
|
|
1486
|
-
if (a !== "") if (
|
|
1489
|
+
let i = e[r], a = Re(r, i);
|
|
1490
|
+
if (a !== "") if (Be.has(r)) n.push(`${r}:${a}`);
|
|
1487
1491
|
else {
|
|
1488
|
-
let e = t.get(
|
|
1489
|
-
e.add(a), t.set(
|
|
1492
|
+
let e = t.get(ze(r)) ?? /* @__PURE__ */ new Set();
|
|
1493
|
+
e.add(a), t.set(ze(r), e);
|
|
1490
1494
|
}
|
|
1491
1495
|
}
|
|
1492
1496
|
r.add(n.sort().join("|"));
|
|
@@ -1496,13 +1500,13 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1496
1500
|
n = r.size > 1;
|
|
1497
1501
|
let a = Array.from(t.entries()).filter(([, e]) => e.size > 1).map(([e]) => e);
|
|
1498
1502
|
return n && a.push("transform"), a;
|
|
1499
|
-
},
|
|
1500
|
-
if (!
|
|
1503
|
+
}, V = (e) => {
|
|
1504
|
+
if (!Fe(e)) return [];
|
|
1501
1505
|
let t = [], n = !0, r = [];
|
|
1502
1506
|
for (let i of Object.keys(e)) {
|
|
1503
|
-
let a = e[i], o =
|
|
1504
|
-
o !== "" && (
|
|
1505
|
-
property:
|
|
1507
|
+
let a = e[i], o = Re(i, a);
|
|
1508
|
+
o !== "" && (Be.has(i) ? (t.push(Ge(i, o)), We(i, a) || (n = !1)) : r.push({
|
|
1509
|
+
property: ze(i),
|
|
1506
1510
|
value: o
|
|
1507
1511
|
}));
|
|
1508
1512
|
}
|
|
@@ -1510,7 +1514,7 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1510
1514
|
property: "transform",
|
|
1511
1515
|
value: n ? "none" : t.join(" ")
|
|
1512
1516
|
}), r;
|
|
1513
|
-
},
|
|
1517
|
+
}, H = (e) => e.map((e) => ` ${e.property}: ${e.value};`).join("\n"), qe = (e) => Array.isArray(e) ? e.length === 4 && e.every((e) => typeof e == "number") ? `cubic-bezier(${e.join(", ")})` : "linear" : typeof e == "string" ? {
|
|
1514
1518
|
linear: "linear",
|
|
1515
1519
|
easeIn: "ease-in",
|
|
1516
1520
|
easeOut: "ease-out",
|
|
@@ -1520,29 +1524,29 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1520
1524
|
backIn: "cubic-bezier(0.31, 0.01, 0.66, -0.59)",
|
|
1521
1525
|
backOut: "cubic-bezier(0.33, 1.53, 0.69, 0.99)",
|
|
1522
1526
|
anticipate: "cubic-bezier(0.36, 0, 0.66, -0.56)"
|
|
1523
|
-
}[e] ?? "ease" : "ease",
|
|
1527
|
+
}[e] ?? "ease" : "ease", Je = (e, t) => {
|
|
1524
1528
|
let [n, r] = t.split("-");
|
|
1525
1529
|
return `[data-flemo-screen][data-flemo-transition="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1526
|
-
},
|
|
1530
|
+
}, Ye = (e, t) => {
|
|
1527
1531
|
let [n, r] = t.split("-");
|
|
1528
1532
|
return `[data-flemo-decorator][data-flemo-decorator-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1529
|
-
},
|
|
1533
|
+
}, Xe = (e, t) => {
|
|
1530
1534
|
let [n, r] = t.split("-");
|
|
1531
1535
|
return `[data-flemo-bar][data-flemo-bar-transition="${e}"][data-flemo-bar-status="${n}"][data-flemo-bar-active="${r}"][data-flemo-bar-riding="true"]`;
|
|
1532
|
-
},
|
|
1536
|
+
}, Ze = (e, t) => {
|
|
1533
1537
|
let [n, r] = t.split("-");
|
|
1534
1538
|
return `[data-flemo-part-name="${e}"][data-flemo-status="${n}"][data-flemo-active="${r}"]`;
|
|
1535
|
-
},
|
|
1536
|
-
let o =
|
|
1539
|
+
}, U = (e, t, n) => `flemo-${e}-${Pe(t)}-${n}`, Qe = (e, t, n, r, i, a) => {
|
|
1540
|
+
let o = V(r), s = V(i.value), c = Ae(i.options), l = je(i.options), u = qe(i.options?.ease), d = a(t, n), f = e === "screen" ? `${d},\n${Xe(t, n)}` : d;
|
|
1537
1541
|
if (s.length === 0 && o.length === 0) return "";
|
|
1538
|
-
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${
|
|
1539
|
-
let p =
|
|
1542
|
+
if (c <= 0 && l <= 0) return s.length === 0 ? "" : `${f} {\n${H(s)}\n animation: none;\n}`;
|
|
1543
|
+
let p = U(e, t, n), m = [
|
|
1540
1544
|
`@keyframes ${p} {`,
|
|
1541
1545
|
" from {",
|
|
1542
|
-
|
|
1546
|
+
H(o).replace(/^/gm, " "),
|
|
1543
1547
|
" }",
|
|
1544
1548
|
" to {",
|
|
1545
|
-
|
|
1549
|
+
H(s).replace(/^/gm, " "),
|
|
1546
1550
|
" }",
|
|
1547
1551
|
"}"
|
|
1548
1552
|
].join("\n"), h = [
|
|
@@ -1552,59 +1556,59 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1552
1556
|
l > 0 ? `${l}s` : null,
|
|
1553
1557
|
"both"
|
|
1554
1558
|
].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") &&
|
|
1556
|
-
},
|
|
1559
|
+
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") && $e(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park"] {\n animation: none;\n${H(s)}\n}` : ""}${e === "screen" && n.endsWith("-true") && (n.startsWith("PUSHING") || n.startsWith("REPLACING")) && $e(r) && s.length > 0 ? `\n${d}[data-flemo-anim-hold="park-under"] {\n animation: none;\n${H(s)}\n}` : ""}`;
|
|
1560
|
+
}, $e = (e) => {
|
|
1557
1561
|
if (!e) return !1;
|
|
1558
1562
|
if (e.opacity === 0) return !0;
|
|
1559
1563
|
let t = (e) => typeof e == "string" && e.trim().endsWith("%") && Math.abs(parseFloat(e)) >= 100;
|
|
1560
1564
|
return t(e.x) || t(e.y);
|
|
1561
|
-
},
|
|
1562
|
-
let i =
|
|
1563
|
-
return i.length === 0 ? "" : `${e(t, n)} {\n${
|
|
1564
|
-
},
|
|
1565
|
+
}, et = (e, t, n, r) => {
|
|
1566
|
+
let i = V(r.value);
|
|
1567
|
+
return i.length === 0 ? "" : `${e(t, n)} {\n${H(i)}\n}`;
|
|
1568
|
+
}, tt = (e, t, n = []) => {
|
|
1565
1569
|
let r = [];
|
|
1566
1570
|
for (let t of e) {
|
|
1567
1571
|
let e = t.name;
|
|
1568
|
-
for (let n of
|
|
1569
|
-
let i = t.variants[n], a =
|
|
1572
|
+
for (let n of ke) {
|
|
1573
|
+
let i = t.variants[n], a = z[n];
|
|
1570
1574
|
if (a === "self") {
|
|
1571
|
-
r.push(
|
|
1575
|
+
r.push(et(Je, e, n, i));
|
|
1572
1576
|
continue;
|
|
1573
1577
|
}
|
|
1574
1578
|
let o = a === "initial" ? t.initial : t.variants[a].value;
|
|
1575
|
-
r.push(
|
|
1579
|
+
r.push(Qe("screen", e, n, o, i, Je));
|
|
1576
1580
|
}
|
|
1577
1581
|
}
|
|
1578
1582
|
for (let e of t) {
|
|
1579
1583
|
let t = e.name;
|
|
1580
|
-
for (let n of
|
|
1581
|
-
let i = e.variants[n], a =
|
|
1584
|
+
for (let n of Ne) {
|
|
1585
|
+
let i = e.variants[n], a = z[n];
|
|
1582
1586
|
if (a === "self") {
|
|
1583
|
-
r.push(
|
|
1587
|
+
r.push(et(Ye, t, n, i));
|
|
1584
1588
|
continue;
|
|
1585
1589
|
}
|
|
1586
1590
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1587
|
-
r.push(
|
|
1591
|
+
r.push(Qe("decorator", t, n, o, i, Ye));
|
|
1588
1592
|
}
|
|
1589
1593
|
}
|
|
1590
1594
|
for (let e of n) {
|
|
1591
1595
|
let t = e.name;
|
|
1592
|
-
for (let n of
|
|
1593
|
-
let i = e.variants[n], a =
|
|
1596
|
+
for (let n of Ne) {
|
|
1597
|
+
let i = e.variants[n], a = z[n];
|
|
1594
1598
|
if (a === "self") {
|
|
1595
|
-
r.push(
|
|
1599
|
+
r.push(et(Ze, t, n, i));
|
|
1596
1600
|
continue;
|
|
1597
1601
|
}
|
|
1598
1602
|
let o = a === "initial" ? e.initial : e.variants[a].value;
|
|
1599
|
-
r.push(
|
|
1603
|
+
r.push(Qe("part", t, n, o, i, Ze));
|
|
1600
1604
|
}
|
|
1601
1605
|
}
|
|
1602
1606
|
return [
|
|
1603
1607
|
...r.filter((e) => e.length > 0),
|
|
1604
|
-
|
|
1605
|
-
|
|
1608
|
+
nt,
|
|
1609
|
+
rt
|
|
1606
1610
|
].join("\n\n");
|
|
1607
|
-
},
|
|
1611
|
+
}, nt = [
|
|
1608
1612
|
"[data-flemo-anim-hold=\"true\"],",
|
|
1609
1613
|
"[data-flemo-anim-hold=\"park\"],",
|
|
1610
1614
|
"[data-flemo-anim-hold=\"park-under\"],",
|
|
@@ -1613,45 +1617,45 @@ var z = /* @__PURE__ */ new Map(), B = {
|
|
|
1613
1617
|
"[data-flemo-anim-hold=\"park-under\"] [data-flemo-part-name] {",
|
|
1614
1618
|
" animation-play-state: paused !important;",
|
|
1615
1619
|
"}"
|
|
1616
|
-
].join("\n"),
|
|
1620
|
+
].join("\n"), rt = [
|
|
1617
1621
|
"[data-flemo-held-arrival] {",
|
|
1618
1622
|
" display: none !important;",
|
|
1619
1623
|
"}"
|
|
1620
|
-
].join("\n"),
|
|
1621
|
-
let n =
|
|
1624
|
+
].join("\n"), W = (e, t) => {
|
|
1625
|
+
let n = z[t];
|
|
1622
1626
|
if (n === "self") return !1;
|
|
1623
|
-
let r = e.variants[t], i =
|
|
1627
|
+
let r = e.variants[t], i = Ae(r.options), a = je(r.options);
|
|
1624
1628
|
if (i <= 0 && a <= 0) return !1;
|
|
1625
|
-
let o =
|
|
1629
|
+
let o = V(n === "initial" ? e.initial : e.variants[n].value), s = V(r.value);
|
|
1626
1630
|
return o.length > 0 || s.length > 0;
|
|
1627
|
-
},
|
|
1628
|
-
function
|
|
1631
|
+
}, it = "data-flemo";
|
|
1632
|
+
function at() {
|
|
1629
1633
|
if (f()) return;
|
|
1630
|
-
let e =
|
|
1631
|
-
t || (t = document.createElement("style"), t.setAttribute(
|
|
1634
|
+
let e = tt(I.values(), L.values(), R.values()), t = document.head.querySelector(`style[${it}]`);
|
|
1635
|
+
t || (t = document.createElement("style"), t.setAttribute(it, ""), document.head.appendChild(t)), t.textContent !== e && (t.textContent = e);
|
|
1632
1636
|
}
|
|
1633
1637
|
//#endregion
|
|
1634
1638
|
//#region src/transition/registerTransitionDefinitions.ts
|
|
1635
|
-
var
|
|
1639
|
+
var ot = /* @__PURE__ */ new Map(), st = /* @__PURE__ */ new Map(), ct = /* @__PURE__ */ new Map(), lt = (e, t) => {
|
|
1636
1640
|
e.set(t, (e.get(t) ?? 0) + 1);
|
|
1637
|
-
},
|
|
1641
|
+
}, ut = (e, t) => {
|
|
1638
1642
|
let n = (e.get(t) ?? 1) - 1;
|
|
1639
1643
|
return n <= 0 ? (e.delete(t), !0) : (e.set(t, n), !1);
|
|
1640
1644
|
};
|
|
1641
|
-
function
|
|
1642
|
-
for (let t of e)
|
|
1643
|
-
for (let e of t)
|
|
1644
|
-
for (let e of n)
|
|
1645
|
-
return
|
|
1646
|
-
for (let t of e)
|
|
1647
|
-
for (let e of t)
|
|
1648
|
-
for (let e of n) ct
|
|
1649
|
-
|
|
1645
|
+
function dt(e, t, n = []) {
|
|
1646
|
+
for (let t of e) I.set(t.name, t), lt(ot, t.name);
|
|
1647
|
+
for (let e of t) L.set(e.name, e), lt(st, e.name);
|
|
1648
|
+
for (let e of n) R.set(e.name, e), lt(ct, e.name);
|
|
1649
|
+
return at(), () => {
|
|
1650
|
+
for (let t of e) ut(ot, t.name) && I.delete(t.name);
|
|
1651
|
+
for (let e of t) ut(st, e.name) && L.delete(e.name);
|
|
1652
|
+
for (let e of n) ut(ct, e.name) && R.delete(e.name);
|
|
1653
|
+
at();
|
|
1650
1654
|
};
|
|
1651
1655
|
}
|
|
1652
1656
|
//#endregion
|
|
1653
1657
|
//#region src/transition/enteringInitialStyle.ts
|
|
1654
|
-
function
|
|
1658
|
+
function ft(e) {
|
|
1655
1659
|
let { initial: t, isActive: n, status: r } = e;
|
|
1656
1660
|
if (!n || r !== "PUSHING" && r !== "REPLACING") return {};
|
|
1657
1661
|
let i = {};
|
|
@@ -1659,10 +1663,10 @@ function ut(e) {
|
|
|
1659
1663
|
}
|
|
1660
1664
|
//#endregion
|
|
1661
1665
|
//#region src/transition/settleScrub.ts
|
|
1662
|
-
var
|
|
1666
|
+
var pt = () => ({
|
|
1663
1667
|
request: (e) => requestAnimationFrame(e),
|
|
1664
1668
|
cancel: (e) => cancelAnimationFrame(e)
|
|
1665
|
-
}),
|
|
1669
|
+
}), mt = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), ht = ((e = pt()) => {
|
|
1666
1670
|
let t = /* @__PURE__ */ new Map(), n = null, r = () => {
|
|
1667
1671
|
t.size === 0 && n !== null && (e.cancel(n), n = null);
|
|
1668
1672
|
}, i = (e, n) => {
|
|
@@ -1695,7 +1699,7 @@ var dt = () => ({
|
|
|
1695
1699
|
if (typeof r.animate != "function") return null;
|
|
1696
1700
|
i(r, "current");
|
|
1697
1701
|
let l = {};
|
|
1698
|
-
for (let e of o) l[
|
|
1702
|
+
for (let e of o) l[mt(e.property)] = e.value;
|
|
1699
1703
|
let u;
|
|
1700
1704
|
try {
|
|
1701
1705
|
u = r.animate([l], {
|
|
@@ -1725,55 +1729,56 @@ var dt = () => ({
|
|
|
1725
1729
|
takeover: (e) => i(e, "current"),
|
|
1726
1730
|
cancel: (e) => i(e, "drop")
|
|
1727
1731
|
};
|
|
1728
|
-
})(),
|
|
1732
|
+
})(), gt = "flemo:motion-driver", _t = "flemo:motion-driver-force", vt = !1, yt = () => {
|
|
1729
1733
|
try {
|
|
1730
1734
|
try {
|
|
1731
|
-
typeof localStorage < "u" && localStorage.removeItem(
|
|
1735
|
+
typeof localStorage < "u" && localStorage.removeItem(_t);
|
|
1732
1736
|
} catch {}
|
|
1733
1737
|
if (typeof sessionStorage > "u") return null;
|
|
1734
|
-
let e = sessionStorage.getItem(
|
|
1738
|
+
let e = sessionStorage.getItem(_t);
|
|
1735
1739
|
if (e === null) return null;
|
|
1736
1740
|
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 ? (!
|
|
1741
|
+
return (t === "css" || t === "raf") && n !== void 0 && Number.isFinite(r) && Math.abs(Date.now() - r) < 864e5 ? (!vt && typeof console < "u" && (vt = !0, console.warn(`[flemo] motion driver pinned to "${t}" via sessionStorage ${_t}; remove the key to restore automatic selection (pins expire after 24h).`)), t) : (sessionStorage.removeItem(_t), null);
|
|
1738
1742
|
} catch {
|
|
1739
1743
|
return null;
|
|
1740
1744
|
}
|
|
1741
|
-
},
|
|
1745
|
+
}, bt = () => ({
|
|
1742
1746
|
read: () => {
|
|
1743
1747
|
try {
|
|
1744
|
-
return typeof localStorage < "u" ? localStorage.getItem(
|
|
1748
|
+
return typeof localStorage < "u" ? localStorage.getItem(gt) : null;
|
|
1745
1749
|
} catch {
|
|
1746
1750
|
return null;
|
|
1747
1751
|
}
|
|
1748
1752
|
},
|
|
1749
1753
|
write: (e) => {
|
|
1750
1754
|
try {
|
|
1751
|
-
typeof localStorage < "u" && localStorage.setItem(
|
|
1755
|
+
typeof localStorage < "u" && localStorage.setItem(gt, e);
|
|
1752
1756
|
} catch {}
|
|
1753
1757
|
}
|
|
1754
|
-
}),
|
|
1758
|
+
}), xt = 30, St = 2, Ct = 2, wt = () => typeof navigator < "u" && !!navigator.userAgentData, Tt = (e = bt(), t = !1, n = !0) => {
|
|
1755
1759
|
let r = n && e.read() === "css", i = r;
|
|
1756
1760
|
r &&= !1;
|
|
1757
1761
|
let a = 0, o = 0, s = [];
|
|
1758
1762
|
return {
|
|
1759
1763
|
playerAllowed: () => {
|
|
1760
|
-
let e =
|
|
1764
|
+
let e = yt();
|
|
1761
1765
|
return e ? e === "raf" : t && !r;
|
|
1762
1766
|
},
|
|
1767
|
+
pinnedDriver: yt,
|
|
1763
1768
|
beginRun: () => {
|
|
1764
1769
|
o = 0, s = [];
|
|
1765
1770
|
},
|
|
1766
1771
|
reportGap: (e) => {
|
|
1767
|
-
s.push(e), e >=
|
|
1772
|
+
s.push(e), e >= xt && (o += 1);
|
|
1768
1773
|
},
|
|
1769
1774
|
endRun: () => {
|
|
1770
|
-
let t = o >=
|
|
1775
|
+
let t = o >= St;
|
|
1771
1776
|
if (t && (a += 1), n) {
|
|
1772
1777
|
if (i) {
|
|
1773
1778
|
i = !1, t ? r = !0 : e.write("raf");
|
|
1774
1779
|
return;
|
|
1775
1780
|
}
|
|
1776
|
-
t && a >=
|
|
1781
|
+
t && a >= Ct && !r && (r = !0, e.write("css"));
|
|
1777
1782
|
}
|
|
1778
1783
|
},
|
|
1779
1784
|
stats: () => ({
|
|
@@ -1782,16 +1787,16 @@ var dt = () => ({
|
|
|
1782
1787
|
demoted: r
|
|
1783
1788
|
})
|
|
1784
1789
|
};
|
|
1785
|
-
},
|
|
1786
|
-
let n =
|
|
1787
|
-
n || (n = /* @__PURE__ */ new Set(),
|
|
1790
|
+
}, G = wt() ? Tt() : Tt(bt(), !0, !1), Et = (e) => typeof HTMLElement < "u" && e instanceof HTMLElement, Dt = /* @__PURE__ */ new WeakMap(), K = (e, t) => {
|
|
1791
|
+
let n = Dt.get(e);
|
|
1792
|
+
n || (n = /* @__PURE__ */ new Set(), Dt.set(e, n)), n.add(t);
|
|
1788
1793
|
}, q = (e, t) => {
|
|
1789
|
-
if (
|
|
1790
|
-
let n =
|
|
1794
|
+
if (ht.cancel(e), e.style.transition = "", e.style.removeProperty("animation-delay"), t) {
|
|
1795
|
+
let n = Dt.get(e);
|
|
1791
1796
|
for (let r of t) e.style.removeProperty(r), n?.delete(r);
|
|
1792
1797
|
return;
|
|
1793
1798
|
}
|
|
1794
|
-
let n =
|
|
1799
|
+
let n = Dt.get(e);
|
|
1795
1800
|
if (n && n.size > 0) {
|
|
1796
1801
|
for (let t of n) e.style.removeProperty(t);
|
|
1797
1802
|
n.clear();
|
|
@@ -1799,16 +1804,16 @@ var dt = () => ({
|
|
|
1799
1804
|
}
|
|
1800
1805
|
e.style.removeProperty("transform"), e.style.removeProperty("opacity");
|
|
1801
1806
|
}, J = (e, t, n = {}) => {
|
|
1802
|
-
if (!
|
|
1803
|
-
let r = e, i =
|
|
1807
|
+
if (!Et(e)) return Promise.resolve();
|
|
1808
|
+
let r = e, i = V(t);
|
|
1804
1809
|
if (i.length === 0) return Promise.resolve();
|
|
1805
|
-
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s =
|
|
1810
|
+
let a = typeof n.duration == "number" ? n.duration : 0, o = typeof n.delay == "number" && n.delay > 0 ? n.delay : 0, s = qe(n.ease);
|
|
1806
1811
|
if (a <= 0 && o <= 0) {
|
|
1807
|
-
|
|
1812
|
+
ht.takeover(r), r.style.transition = "none";
|
|
1808
1813
|
for (let e of i) r.style.setProperty(e.property, e.value), K(r, e.property);
|
|
1809
1814
|
return Promise.resolve();
|
|
1810
1815
|
}
|
|
1811
|
-
let c =
|
|
1816
|
+
let c = G.playerAllowed() ? ht.settle(r, i, {
|
|
1812
1817
|
durationMs: a * 1e3,
|
|
1813
1818
|
delayMs: o * 1e3,
|
|
1814
1819
|
easing: s
|
|
@@ -1827,12 +1832,12 @@ var dt = () => ({
|
|
|
1827
1832
|
};
|
|
1828
1833
|
r.addEventListener("transitionend", i), setTimeout(n, (a + o) * 1e3 + 60);
|
|
1829
1834
|
});
|
|
1830
|
-
},
|
|
1831
|
-
function
|
|
1835
|
+
}, Ot = "data-flemo-held-arrival";
|
|
1836
|
+
function kt(e) {
|
|
1832
1837
|
if (typeof MutationObserver > "u") return () => {};
|
|
1833
1838
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = (t) => {
|
|
1834
1839
|
let n = t instanceof Element ? t : t.parentElement;
|
|
1835
|
-
return !n || n === e || n.closest(`[data-flemo-part-name], [${
|
|
1840
|
+
return !n || n === e || n.closest(`[data-flemo-part-name], [${Ot}]`) !== null;
|
|
1836
1841
|
}, 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
1842
|
glass: t,
|
|
1838
1843
|
latest: n,
|
|
@@ -1862,12 +1867,12 @@ function Ot(e) {
|
|
|
1862
1867
|
if (i.type === "childList") {
|
|
1863
1868
|
for (let e of Array.from(i.removedNodes)) if (!n.has(e)) {
|
|
1864
1869
|
if (e instanceof Element && t.delete(e)) {
|
|
1865
|
-
e.removeAttribute(
|
|
1870
|
+
e.removeAttribute(Ot);
|
|
1866
1871
|
continue;
|
|
1867
1872
|
}
|
|
1868
1873
|
(e instanceof Element || e.nodeType === Node.TEXT_NODE) && l(i.target).removed.push(e);
|
|
1869
1874
|
}
|
|
1870
|
-
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(
|
|
1875
|
+
for (let e of Array.from(i.addedNodes)) r.delete(e) || e instanceof Element && (e.setAttribute(Ot, ""), t.add(e), l(i.target).added.push(e));
|
|
1871
1876
|
}
|
|
1872
1877
|
}
|
|
1873
1878
|
for (let [e, t] of u) {
|
|
@@ -1902,7 +1907,7 @@ function Ot(e) {
|
|
|
1902
1907
|
c.disconnect();
|
|
1903
1908
|
for (let e of n) e.parentNode?.removeChild(e);
|
|
1904
1909
|
n.clear();
|
|
1905
|
-
for (let e of t) e.removeAttribute(
|
|
1910
|
+
for (let e of t) e.removeAttribute(Ot);
|
|
1906
1911
|
t.clear();
|
|
1907
1912
|
for (let [e, t] of i) e.isConnected && (e.nodeValue = t.latest);
|
|
1908
1913
|
i.clear();
|
|
@@ -1912,34 +1917,34 @@ function Ot(e) {
|
|
|
1912
1917
|
}
|
|
1913
1918
|
//#endregion
|
|
1914
1919
|
//#region src/core/engine/compositorWarmUp.ts
|
|
1915
|
-
var
|
|
1920
|
+
var At = "data-flemo-warm", jt = 3e3, Mt = [{ transform: "translate3d(0, 0, 0)" }, { transform: "translate3d(1px, 0, 0)" }], Nt = {
|
|
1916
1921
|
duration: 500,
|
|
1917
1922
|
iterations: Infinity,
|
|
1918
1923
|
direction: "alternate",
|
|
1919
1924
|
easing: "linear"
|
|
1920
|
-
},
|
|
1921
|
-
X = 0,
|
|
1925
|
+
}, Pt = "position:fixed;top:0;left:0;width:1px;height:1px;pointer-events:none;opacity:0.02;background:#888;will-change:transform;", Y = null, Ft = null, X = 0, It = () => {
|
|
1926
|
+
X = 0, Ft?.cancel(), Ft = null, Y?.remove(), Y = null;
|
|
1922
1927
|
};
|
|
1923
|
-
function
|
|
1928
|
+
function Lt() {
|
|
1924
1929
|
if (typeof document > "u" || !document.body || typeof Element > "u" || typeof Element.prototype.animate != "function") return () => {};
|
|
1925
1930
|
if (X += 1, !Y) {
|
|
1926
|
-
Y = document.createElement("div"), Y.setAttribute(
|
|
1931
|
+
Y = document.createElement("div"), Y.setAttribute(At, ""), Y.setAttribute("aria-hidden", "true"), Y.setAttribute("style", Pt), document.body.appendChild(Y);
|
|
1927
1932
|
try {
|
|
1928
|
-
|
|
1933
|
+
Ft = Y.animate(Mt, Nt);
|
|
1929
1934
|
} catch {
|
|
1930
|
-
|
|
1935
|
+
Ft = null;
|
|
1931
1936
|
}
|
|
1932
1937
|
}
|
|
1933
1938
|
let e = !1, t = setTimeout(() => {
|
|
1934
|
-
e || (e = !0, --X, X <= 0 &&
|
|
1935
|
-
},
|
|
1939
|
+
e || (e = !0, --X, X <= 0 && It());
|
|
1940
|
+
}, jt);
|
|
1936
1941
|
return () => {
|
|
1937
|
-
e || (e = !0, clearTimeout(t), --X, X <= 0 &&
|
|
1942
|
+
e || (e = !0, clearTimeout(t), --X, X <= 0 && It());
|
|
1938
1943
|
};
|
|
1939
1944
|
}
|
|
1940
1945
|
//#endregion
|
|
1941
1946
|
//#region src/transition/cubicBezier.ts
|
|
1942
|
-
var
|
|
1947
|
+
var Rt = (e, t, n, r) => {
|
|
1943
1948
|
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;
|
|
1944
1949
|
return (e) => {
|
|
1945
1950
|
if (e <= 0) return 0;
|
|
@@ -1951,7 +1956,7 @@ var Lt = (e, t, n, r) => {
|
|
|
1951
1956
|
}
|
|
1952
1957
|
return a((t + n) / 2);
|
|
1953
1958
|
};
|
|
1954
|
-
},
|
|
1959
|
+
}, zt = (e) => e, Bt = {
|
|
1955
1960
|
ease: [
|
|
1956
1961
|
.25,
|
|
1957
1962
|
.1,
|
|
@@ -2006,20 +2011,20 @@ var Lt = (e, t, n, r) => {
|
|
|
2006
2011
|
.66,
|
|
2007
2012
|
-.56
|
|
2008
2013
|
]
|
|
2009
|
-
},
|
|
2014
|
+
}, Vt = (e) => {
|
|
2010
2015
|
if (Array.isArray(e)) {
|
|
2011
2016
|
if (e.length === 4 && e.every((e) => typeof e == "number")) {
|
|
2012
2017
|
let [t, n, r, i] = e;
|
|
2013
|
-
return
|
|
2018
|
+
return Rt(t, n, r, i);
|
|
2014
2019
|
}
|
|
2015
|
-
return
|
|
2020
|
+
return zt;
|
|
2016
2021
|
}
|
|
2017
|
-
return typeof e == "string" ? e === "linear" ?
|
|
2018
|
-
},
|
|
2022
|
+
return typeof e == "string" ? e === "linear" ? zt : Rt(...Bt[e] ?? Bt.ease) : Rt(...Bt.ease);
|
|
2023
|
+
}, Ht = 1 / 255, Ut = 400, Wt = 24, Gt = /* @__PURE__ */ new Set([
|
|
2019
2024
|
"x",
|
|
2020
2025
|
"y",
|
|
2021
2026
|
"opacity"
|
|
2022
|
-
]),
|
|
2027
|
+
]), Kt = (e, t, n) => {
|
|
2023
2028
|
if (!e || typeof e != "object") return;
|
|
2024
2029
|
let r = e[t];
|
|
2025
2030
|
if (r === void 0) return;
|
|
@@ -2037,31 +2042,31 @@ var Lt = (e, t, n, r) => {
|
|
|
2037
2042
|
return Number.isNaN(e) ? null : e;
|
|
2038
2043
|
}
|
|
2039
2044
|
return null;
|
|
2040
|
-
},
|
|
2045
|
+
}, qt = (e, t, n) => {
|
|
2041
2046
|
let r = /* @__PURE__ */ new Set();
|
|
2042
2047
|
for (let t of [e.from, e.to]) if (!(!t || typeof t != "object")) for (let e of Object.keys(t)) r.add(e);
|
|
2043
2048
|
if (r.size === 0) return null;
|
|
2044
2049
|
let i = Infinity;
|
|
2045
2050
|
for (let a of r) {
|
|
2046
|
-
if (!
|
|
2047
|
-
let r =
|
|
2051
|
+
if (!Gt.has(a)) return null;
|
|
2052
|
+
let r = Kt(e.from, a, t), o = Kt(e.to, a, t);
|
|
2048
2053
|
if (r === null || o === null || r === void 0 || o === void 0) return null;
|
|
2049
2054
|
let s = Math.abs(o - r);
|
|
2050
2055
|
if (s === 0) continue;
|
|
2051
|
-
let c = a === "opacity" ?
|
|
2056
|
+
let c = a === "opacity" ? Ht : 1 / Math.max(1, n);
|
|
2052
2057
|
i = Math.min(i, c / s);
|
|
2053
2058
|
}
|
|
2054
2059
|
return !Number.isFinite(i) || i <= 0 || i >= 1 ? null : i;
|
|
2055
|
-
},
|
|
2060
|
+
}, Jt = (e, t, n) => {
|
|
2056
2061
|
if (e.duration <= 0) return null;
|
|
2057
|
-
let r =
|
|
2062
|
+
let r = qt(e, t, n);
|
|
2058
2063
|
if (r === null) return null;
|
|
2059
|
-
let i =
|
|
2060
|
-
for (let e =
|
|
2064
|
+
let i = Vt(e.ease), a = Ut;
|
|
2065
|
+
for (let e = Ut; e >= 0 && !(Math.abs(1 - i(e / Ut)) > r); --e) a = e;
|
|
2061
2066
|
if (a === 0) return null;
|
|
2062
|
-
let o = (e.delay + e.duration * (a /
|
|
2063
|
-
return (e.delay + e.duration) * 1e3 - o <
|
|
2064
|
-
},
|
|
2067
|
+
let o = (e.delay + e.duration * (a / Ut)) * 1e3;
|
|
2068
|
+
return (e.delay + e.duration) * 1e3 - o < Wt ? null : o;
|
|
2069
|
+
}, Yt = [
|
|
2065
2070
|
"x",
|
|
2066
2071
|
"y",
|
|
2067
2072
|
"z",
|
|
@@ -2072,7 +2077,7 @@ var Lt = (e, t, n, r) => {
|
|
|
2072
2077
|
"rotateX",
|
|
2073
2078
|
"rotateY",
|
|
2074
2079
|
"rotateZ"
|
|
2075
|
-
],
|
|
2080
|
+
], Xt = new Set(Yt), Zt = {
|
|
2076
2081
|
x: 0,
|
|
2077
2082
|
y: 0,
|
|
2078
2083
|
z: 0,
|
|
@@ -2083,7 +2088,7 @@ var Lt = (e, t, n, r) => {
|
|
|
2083
2088
|
rotateX: 0,
|
|
2084
2089
|
rotateY: 0,
|
|
2085
2090
|
rotateZ: 0
|
|
2086
|
-
},
|
|
2091
|
+
}, Qt = (e, t) => {
|
|
2087
2092
|
if (typeof t == "number") return {
|
|
2088
2093
|
value: t,
|
|
2089
2094
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
@@ -2102,26 +2107,26 @@ var Lt = (e, t, n, r) => {
|
|
|
2102
2107
|
value: i,
|
|
2103
2108
|
unit: a === "" && i === 0 ? "px" : a
|
|
2104
2109
|
};
|
|
2105
|
-
},
|
|
2106
|
-
let n = e.match(
|
|
2107
|
-
if (n.length !== r.length || e.replace(
|
|
2110
|
+
}, $t = /-?\d*\.?\d+/g, en = (e, t) => {
|
|
2111
|
+
let n = e.match($t) ?? [], r = t.match($t) ?? [];
|
|
2112
|
+
if (n.length !== r.length || e.replace($t, " ") !== t.replace($t, " ")) return null;
|
|
2108
2113
|
let i = n.map(Number), a = r.map(Number);
|
|
2109
2114
|
return (t) => {
|
|
2110
2115
|
let n = 0;
|
|
2111
|
-
return e.replace(
|
|
2116
|
+
return e.replace($t, () => {
|
|
2112
2117
|
let e = n++, r = i[e] + (a[e] - i[e]) * t;
|
|
2113
2118
|
return `${Math.round(r * 1e3) / 1e3}`;
|
|
2114
2119
|
});
|
|
2115
2120
|
};
|
|
2116
|
-
},
|
|
2117
|
-
let n = /* @__PURE__ */ new Set([...
|
|
2121
|
+
}, tn = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), nn = (e) => typeof e == "object" && !!e && !Array.isArray(e), rn = (e) => nn(e) ? Object.keys(e) : [], an = (e, t) => nn(e) ? e[t] : void 0, on = (e, t) => {
|
|
2122
|
+
let n = /* @__PURE__ */ new Set([...rn(e.from), ...rn(e.to)]), r = [], i = null, a = [], o = [];
|
|
2118
2123
|
for (let s of n) {
|
|
2119
|
-
let n =
|
|
2120
|
-
if (
|
|
2124
|
+
let n = an(e.from, s), c = an(e.to, s);
|
|
2125
|
+
if (Xt.has(s)) {
|
|
2121
2126
|
let e = s, i = {
|
|
2122
|
-
value:
|
|
2127
|
+
value: Zt[e],
|
|
2123
2128
|
unit: e === "x" || e === "y" || e === "z" ? "px" : ""
|
|
2124
|
-
}, a = n === void 0 ? i :
|
|
2129
|
+
}, a = n === void 0 ? i : Qt(e, n), o = c === void 0 ? i : Qt(e, c);
|
|
2125
2130
|
if (!a || !o || a.unit !== o.unit && a.value !== 0 && o.value !== 0) return null;
|
|
2126
2131
|
let l = a.value === 0 && a.unit !== o.unit ? o.unit : a.unit, u = l === "%", d = 0;
|
|
2127
2132
|
u && t && (d = e === "y" ? t.offsetHeight / 100 : t.offsetWidth / 100), r.push({
|
|
@@ -2152,15 +2157,15 @@ var Lt = (e, t, n, r) => {
|
|
|
2152
2157
|
if (typeof l != "string" || typeof u != "string") return null;
|
|
2153
2158
|
if (l === u) {
|
|
2154
2159
|
o.push({
|
|
2155
|
-
property:
|
|
2160
|
+
property: tn(s),
|
|
2156
2161
|
value: l
|
|
2157
2162
|
});
|
|
2158
2163
|
continue;
|
|
2159
2164
|
}
|
|
2160
|
-
let d =
|
|
2165
|
+
let d = en(l, u);
|
|
2161
2166
|
if (!d) return null;
|
|
2162
2167
|
a.push({
|
|
2163
|
-
property:
|
|
2168
|
+
property: tn(s),
|
|
2164
2169
|
mix: d
|
|
2165
2170
|
});
|
|
2166
2171
|
}
|
|
@@ -2170,46 +2175,64 @@ var Lt = (e, t, n, r) => {
|
|
|
2170
2175
|
strings: a,
|
|
2171
2176
|
constants: o
|
|
2172
2177
|
};
|
|
2173
|
-
},
|
|
2178
|
+
}, sn = 1, cn, ln = () => {
|
|
2179
|
+
if (cn !== void 0) return cn;
|
|
2180
|
+
try {
|
|
2181
|
+
let e = typeof sessionStorage < "u" ? sessionStorage.getItem("flemo:apply") : null;
|
|
2182
|
+
cn = e === "scrub" ? e : null;
|
|
2183
|
+
} catch {
|
|
2184
|
+
cn = null;
|
|
2185
|
+
}
|
|
2186
|
+
return cn;
|
|
2187
|
+
}, un, dn = () => {
|
|
2188
|
+
if (un !== void 0) return un;
|
|
2189
|
+
try {
|
|
2190
|
+
let e = typeof sessionStorage < "u" ? sessionStorage.getItem("flemo:snap") : null;
|
|
2191
|
+
un = e === "always" || e === "off" ? e : null;
|
|
2192
|
+
} catch {
|
|
2193
|
+
un = null;
|
|
2194
|
+
}
|
|
2195
|
+
return un;
|
|
2196
|
+
}, fn = (e, t, n, r) => {
|
|
2174
2197
|
let i = 0, a = 0, o = !1, s = [], c = !0;
|
|
2175
|
-
for (let l of
|
|
2198
|
+
for (let l of Yt) {
|
|
2176
2199
|
let u = e.find((e) => e.prop === l);
|
|
2177
2200
|
if (!u) continue;
|
|
2178
2201
|
let d = u.from.value + (u.to.value - u.from.value) * t;
|
|
2179
2202
|
if (u.from.unit === "%" && (d *= u.percentBase), l === "x" || l === "y") {
|
|
2180
|
-
let e = l === "x" ? r.x : r.y, t = (e === null || Math.abs(d - e) * n >=
|
|
2181
|
-
l === "x" ? (r.x = d, i =
|
|
2203
|
+
let e = l === "x" ? r.x : r.y, t = dn(), s = (t === "always" || t !== "off" && (e === null || Math.abs(d - e) * n >= sn)) && n > 0 ? Math.round(d * n) / n : Math.round(d * 1e3) / 1e3;
|
|
2204
|
+
l === "x" ? (r.x = d, i = s) : (r.y = d, a = s), o = !0, s !== 0 && (c = !1);
|
|
2182
2205
|
continue;
|
|
2183
2206
|
}
|
|
2184
|
-
let f =
|
|
2207
|
+
let f = Zt[l];
|
|
2185
2208
|
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)`);
|
|
2186
2209
|
}
|
|
2187
2210
|
return !o && s.length === 0 ? "" : c ? "none" : [...o ? [`translate3d(${i}px, ${a}px, 0)`] : [], ...s].join(" ");
|
|
2188
|
-
},
|
|
2211
|
+
}, pn = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), mn = (e) => {
|
|
2189
2212
|
let t = {};
|
|
2190
|
-
for (let n of
|
|
2213
|
+
for (let n of V(e)) t[pn(n.property)] = n.value;
|
|
2191
2214
|
return t;
|
|
2192
|
-
},
|
|
2215
|
+
}, hn = (e, t) => {
|
|
2193
2216
|
if (typeof e.animate != "function") return null;
|
|
2194
2217
|
try {
|
|
2195
|
-
let n = e.animate([
|
|
2218
|
+
let n = e.animate([mn(t.from), mn(t.to)], {
|
|
2196
2219
|
duration: Math.max(0, t.duration * 1e3),
|
|
2197
2220
|
delay: Math.max(0, t.delay * 1e3),
|
|
2198
|
-
easing:
|
|
2221
|
+
easing: qe(t.ease),
|
|
2199
2222
|
fill: "both"
|
|
2200
2223
|
});
|
|
2201
2224
|
return n.pause(), n.currentTime = 0, n;
|
|
2202
2225
|
} catch {
|
|
2203
2226
|
return null;
|
|
2204
2227
|
}
|
|
2205
|
-
},
|
|
2228
|
+
}, gn = 1e3 / 60 * 2, _n = () => ({
|
|
2206
2229
|
request: (e) => requestAnimationFrame(e),
|
|
2207
2230
|
cancel: (e) => cancelAnimationFrame(e),
|
|
2208
2231
|
devicePixelRatio: () => typeof window < "u" && window.devicePixelRatio || 1
|
|
2209
|
-
}),
|
|
2232
|
+
}), vn = ((e = _n()) => {
|
|
2210
2233
|
let t = /* @__PURE__ */ new Map(), n = {
|
|
2211
2234
|
join: (n, r) => {
|
|
2212
|
-
let i =
|
|
2235
|
+
let i = ln() === "scrub" ? null : on(r.motion, r.element), s = i ? null : hn(r.element, r.motion);
|
|
2213
2236
|
if (!i && !s) return null;
|
|
2214
2237
|
let c = t.get(n);
|
|
2215
2238
|
c || (c = {
|
|
@@ -2236,7 +2259,7 @@ var Lt = (e, t, n, r) => {
|
|
|
2236
2259
|
for (let e of i.constants) K(l.element, e.property);
|
|
2237
2260
|
a(l, 0);
|
|
2238
2261
|
}
|
|
2239
|
-
return r.role === "active" && !c.started && (c.started = !0,
|
|
2262
|
+
return r.role === "active" && !c.started && (c.started = !0, G.beginRun(), o(n, c)), () => {
|
|
2240
2263
|
l.detached = !0, l.scrub?.cancel(), q(l.element);
|
|
2241
2264
|
let r = t.get(n);
|
|
2242
2265
|
r && (r.tracks = r.tracks.filter((e) => e !== l), r.tracks.length === 0 && (r.frameHandle !== null && e.cancel(r.frameHandle), t.delete(n)));
|
|
@@ -2252,13 +2275,13 @@ var Lt = (e, t, n, r) => {
|
|
|
2252
2275
|
}
|
|
2253
2276
|
}, r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
2254
2277
|
let t = r.get(e);
|
|
2255
|
-
return t || (t =
|
|
2278
|
+
return t || (t = Vt(e.motion.ease), r.set(e, t)), t;
|
|
2256
2279
|
};
|
|
2257
2280
|
function a(t, n) {
|
|
2258
2281
|
let { element: r, parsed: i } = t;
|
|
2259
2282
|
if (!(!i || !r.isConnected)) {
|
|
2260
2283
|
if (i.transforms.length > 0) {
|
|
2261
|
-
let a =
|
|
2284
|
+
let a = fn(i.transforms, n, e.devicePixelRatio(), t.snapMemory);
|
|
2262
2285
|
a !== "" && (r.style.transform = a);
|
|
2263
2286
|
}
|
|
2264
2287
|
if (i.opacity) {
|
|
@@ -2278,7 +2301,7 @@ var Lt = (e, t, n, r) => {
|
|
|
2278
2301
|
let c = r.startTime ?? s;
|
|
2279
2302
|
if (r.lastTime !== null) {
|
|
2280
2303
|
let e = s - r.lastTime;
|
|
2281
|
-
|
|
2304
|
+
G.reportGap(e), n.onFrameGap?.(e), e > gn && (c += e - gn);
|
|
2282
2305
|
}
|
|
2283
2306
|
r.startTime = c, r.lastTime = s;
|
|
2284
2307
|
let l = !0;
|
|
@@ -2294,14 +2317,14 @@ var Lt = (e, t, n, r) => {
|
|
|
2294
2317
|
a(e, i(e)(o)), o >= 1 ? (e.completed = !0, e.onComplete?.()) : l = !1;
|
|
2295
2318
|
}
|
|
2296
2319
|
if (l) {
|
|
2297
|
-
|
|
2320
|
+
G.endRun(), t.delete(e);
|
|
2298
2321
|
return;
|
|
2299
2322
|
}
|
|
2300
2323
|
o(e, r);
|
|
2301
2324
|
}
|
|
2302
2325
|
return n;
|
|
2303
2326
|
})();
|
|
2304
|
-
|
|
2327
|
+
vn.onFrameGap = (e) => {
|
|
2305
2328
|
if (typeof window < "u") {
|
|
2306
2329
|
let t = window.__flemoPlayerGaps ??= [];
|
|
2307
2330
|
t.push(Math.round(e * 10) / 10), t.length > 600 && t.splice(0, t.length - 600);
|
|
@@ -2309,23 +2332,87 @@ mn.onFrameGap = (e) => {
|
|
|
2309
2332
|
};
|
|
2310
2333
|
//#endregion
|
|
2311
2334
|
//#region src/core/engine/types.ts
|
|
2312
|
-
var
|
|
2335
|
+
var yn = "data-flemo-skip-animation", bn = 1e3 / 60, xn = (e, t) => {
|
|
2336
|
+
let n = 0, r = !1;
|
|
2337
|
+
for (let i of ["x", "y"]) {
|
|
2338
|
+
let a = Kt(e.from, i, t), o = Kt(e.to, i, t);
|
|
2339
|
+
if (!(a === void 0 && o === void 0)) {
|
|
2340
|
+
if (a === null || o === null || a === void 0 || o === void 0) return null;
|
|
2341
|
+
r = !0, n = Math.max(n, Math.abs(o - a));
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
if (!r || n === 0) return 0;
|
|
2345
|
+
let i = e.duration * 1e3;
|
|
2346
|
+
/* v8 ignore next 2 -- resolveVariantMotion never yields duration<=0 with a
|
|
2347
|
+
distance; kept so a hand-built motion cannot divide by zero. */
|
|
2348
|
+
if (i <= 0) return 0;
|
|
2349
|
+
let a = i / bn, o = Vt(e.ease), s = Math.max(1, Math.min(240, Math.ceil(a))), c = 0, l = o(0);
|
|
2350
|
+
for (let e = 1; e <= s; e++) {
|
|
2351
|
+
let t = o(e / s);
|
|
2352
|
+
c = Math.max(c, Math.abs(t - l)), l = t;
|
|
2353
|
+
}
|
|
2354
|
+
return n * c * (s / a);
|
|
2355
|
+
}, Sn = (e, t, n) => {
|
|
2356
|
+
let r = e.driver;
|
|
2357
|
+
if (r === "native" || r === "player") return r;
|
|
2358
|
+
let i = 0;
|
|
2359
|
+
for (let r of ["true", "false"]) {
|
|
2360
|
+
let a = B(e, `${t}-${r}`);
|
|
2361
|
+
if (!a) continue;
|
|
2362
|
+
let o = xn(a, n);
|
|
2363
|
+
if (o === null) return "player";
|
|
2364
|
+
i = Math.max(i, o);
|
|
2365
|
+
}
|
|
2366
|
+
return i >= 6 ? "native" : "player";
|
|
2367
|
+
}, Cn = 1e3 / 60 * 2, wn = "flemo-", Tn = (e, t, n) => {
|
|
2368
|
+
if (typeof e.getAnimations == "function") for (let r of e.getAnimations({ subtree: n })) {
|
|
2369
|
+
let e = r.animationName;
|
|
2370
|
+
if (typeof e != "string" || !e.startsWith(wn) || r.playState !== "running") continue;
|
|
2371
|
+
let n = r.startTime;
|
|
2372
|
+
typeof n == "number" && (r.startTime = n + t);
|
|
2373
|
+
}
|
|
2374
|
+
};
|
|
2375
|
+
function En(e, t) {
|
|
2376
|
+
/* v8 ignore next -- every runtime under test has rAF; the guard shields
|
|
2377
|
+
exotic embedders. */
|
|
2378
|
+
if (typeof requestAnimationFrame != "function") return () => {};
|
|
2379
|
+
let n = 0, r = null, i = !1, a = (o) => {
|
|
2380
|
+
if (!i) {
|
|
2381
|
+
if (r !== null) {
|
|
2382
|
+
let n = o - r;
|
|
2383
|
+
if (n > 33.333333333333336) {
|
|
2384
|
+
let r = n - Cn;
|
|
2385
|
+
e().forEach((e, t) => {
|
|
2386
|
+
e && Tn(e, r, t === 0);
|
|
2387
|
+
}), t?.(r);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
r = o, n = requestAnimationFrame(a);
|
|
2391
|
+
}
|
|
2392
|
+
};
|
|
2393
|
+
return n = requestAnimationFrame(a), () => {
|
|
2394
|
+
i = !0, cancelAnimationFrame(n);
|
|
2395
|
+
};
|
|
2396
|
+
}
|
|
2397
|
+
//#endregion
|
|
2398
|
+
//#region src/core/engine/createTransitionEngine.ts
|
|
2399
|
+
var Z = () => {}, Dn = 400, On = 4, kn = 100, An = "data-flemo-part-name", jn = (e) => {
|
|
2313
2400
|
let t = e.parentElement ?? e;
|
|
2314
|
-
return Array.from(t.querySelectorAll(`[${
|
|
2401
|
+
return Array.from(t.querySelectorAll(`[${An}]`)).filter((n) => {
|
|
2315
2402
|
let r = n.closest("[data-flemo-screen]");
|
|
2316
2403
|
return !r || r === e || !t.contains(r);
|
|
2317
2404
|
});
|
|
2318
|
-
},
|
|
2405
|
+
}, Mn = (e, t) => {
|
|
2319
2406
|
let [n, r] = t.split("-");
|
|
2320
|
-
return
|
|
2321
|
-
},
|
|
2407
|
+
return jn(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2408
|
+
}, Nn = 4, Pn = (e) => `${Math.round(e * 1e3) / 1e3}s`, Fn = (e) => {
|
|
2322
2409
|
let { element: t, expectedName: n, motion: r } = e, i = null, a = !1, o = (e) => {
|
|
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 =
|
|
2410
|
+
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 = Pn(e.seconds)), a = !1;
|
|
2324
2411
|
}, s = (e) => {
|
|
2325
2412
|
a || e.target !== t || e.animationName !== n || i === null && (i = performance.now());
|
|
2326
2413
|
}, c = (s) => {
|
|
2327
2414
|
if (a || s.target !== t || s.animationName !== n) return;
|
|
2328
|
-
if (!e.isLive() || e.budgetUsed() >=
|
|
2415
|
+
if (!e.isLive() || e.budgetUsed() >= Nn) {
|
|
2329
2416
|
e.onTerminal();
|
|
2330
2417
|
return;
|
|
2331
2418
|
}
|
|
@@ -2355,7 +2442,7 @@ var hn = "data-flemo-skip-animation", Z = () => {}, gn = 400, _n = 100, vn = "da
|
|
|
2355
2442
|
}
|
|
2356
2443
|
};
|
|
2357
2444
|
};
|
|
2358
|
-
function
|
|
2445
|
+
function In(e) {
|
|
2359
2446
|
let t = /* @__PURE__ */ new Map(), n = null, r = null, i = null, a = null, o = () => {
|
|
2360
2447
|
if (!a) return;
|
|
2361
2448
|
let { land: e, cancel: t } = a;
|
|
@@ -2378,9 +2465,9 @@ function wn(e) {
|
|
|
2378
2465
|
return {
|
|
2379
2466
|
driveScreenLifecycle: (a) => {
|
|
2380
2467
|
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 ||=
|
|
2468
|
+
h && (i &&= (clearTimeout(i), null), r ||= Lt()), !h && r && !i && (typeof setTimeout == "function" ? i = setTimeout(() => {
|
|
2382
2469
|
i = null, r?.(), r = null;
|
|
2383
|
-
},
|
|
2470
|
+
}, Dn) : (r(), r = null));
|
|
2384
2471
|
let g = h && m && (p ? f === "PUSHING" || f === "REPLACING" : f === "POPPING");
|
|
2385
2472
|
if (!g && n) {
|
|
2386
2473
|
let e = n;
|
|
@@ -2389,16 +2476,21 @@ function wn(e) {
|
|
|
2389
2476
|
if (g && !n) {
|
|
2390
2477
|
o();
|
|
2391
2478
|
let { scope: e } = l();
|
|
2392
|
-
e && (n =
|
|
2479
|
+
e && (n = kt(e));
|
|
2393
2480
|
}
|
|
2394
2481
|
let _ = (t, n, r) => {
|
|
2395
2482
|
let i = e.getTransitionTaskId();
|
|
2396
|
-
if (!i || s.pendingTaskIds.some((e) => e !== i) || !
|
|
2483
|
+
if (!i || s.pendingTaskIds.some((e) => e !== i) || !G.playerAllowed()) return null;
|
|
2397
2484
|
let { scope: a, decorator: o, bars: c } = l();
|
|
2398
2485
|
if (!a) return null;
|
|
2399
|
-
let d =
|
|
2486
|
+
let d = Se(u);
|
|
2487
|
+
if (G.pinnedDriver() !== "raf") {
|
|
2488
|
+
let e = t.split("-")[0];
|
|
2489
|
+
if (Sn(d, e, a) === "native") return null;
|
|
2490
|
+
}
|
|
2491
|
+
let f = B(d, t);
|
|
2400
2492
|
if (!f) return null;
|
|
2401
|
-
let p = [], m =
|
|
2493
|
+
let p = [], m = vn.join(i, {
|
|
2402
2494
|
element: a,
|
|
2403
2495
|
motion: f,
|
|
2404
2496
|
role: n,
|
|
@@ -2408,7 +2500,7 @@ function wn(e) {
|
|
|
2408
2500
|
p.push(m);
|
|
2409
2501
|
for (let e of c ?? []) {
|
|
2410
2502
|
if (!e || e.getAttribute("data-flemo-bar-riding") !== "true") continue;
|
|
2411
|
-
let t =
|
|
2503
|
+
let t = vn.join(i, {
|
|
2412
2504
|
element: e,
|
|
2413
2505
|
motion: f,
|
|
2414
2506
|
role: "passive"
|
|
@@ -2416,9 +2508,9 @@ function wn(e) {
|
|
|
2416
2508
|
t && p.push(t);
|
|
2417
2509
|
}
|
|
2418
2510
|
if (o && d.decoratorName) {
|
|
2419
|
-
let e =
|
|
2511
|
+
let e = L.get(d.decoratorName), n = e ? B(e, t) : null;
|
|
2420
2512
|
if (n) {
|
|
2421
|
-
let e =
|
|
2513
|
+
let e = vn.join(i, {
|
|
2422
2514
|
element: o,
|
|
2423
2515
|
motion: n,
|
|
2424
2516
|
role: "passive"
|
|
@@ -2426,10 +2518,10 @@ function wn(e) {
|
|
|
2426
2518
|
e && p.push(e);
|
|
2427
2519
|
}
|
|
2428
2520
|
}
|
|
2429
|
-
for (let e of
|
|
2430
|
-
let n =
|
|
2521
|
+
for (let e of Mn(a, t)) {
|
|
2522
|
+
let n = R.get(e.getAttribute(An)), r = n ? B(n, t) : null;
|
|
2431
2523
|
if (!r) continue;
|
|
2432
|
-
let a =
|
|
2524
|
+
let a = vn.join(i, {
|
|
2433
2525
|
element: e,
|
|
2434
2526
|
motion: r,
|
|
2435
2527
|
role: "passive"
|
|
@@ -2438,8 +2530,8 @@ function wn(e) {
|
|
|
2438
2530
|
}
|
|
2439
2531
|
return () => p.forEach((e) => e());
|
|
2440
2532
|
}, v = (e, t) => {
|
|
2441
|
-
let n = [], { decorator: r, bars: i } = l(), a =
|
|
2442
|
-
let i = 0, a =
|
|
2533
|
+
let n = [], { decorator: r, bars: i } = l(), a = Se(u), o = (e, t, r) => {
|
|
2534
|
+
let i = 0, a = Fn({
|
|
2443
2535
|
element: e,
|
|
2444
2536
|
expectedName: t,
|
|
2445
2537
|
motion: r,
|
|
@@ -2451,15 +2543,15 @@ function wn(e) {
|
|
|
2451
2543
|
onTerminal: Z
|
|
2452
2544
|
});
|
|
2453
2545
|
a.attach(), n.push(a.detach);
|
|
2454
|
-
}, s =
|
|
2546
|
+
}, s = U("screen", u, t), c = B(a, t);
|
|
2455
2547
|
if (c) for (let e of i ?? []) !e || e.getAttribute("data-flemo-bar-riding") !== "true" || o(e, s, c);
|
|
2456
2548
|
if (r && a.decoratorName) {
|
|
2457
|
-
let e =
|
|
2458
|
-
n && o(r,
|
|
2549
|
+
let e = L.get(a.decoratorName), n = e ? B(e, t) : null;
|
|
2550
|
+
n && o(r, U("decorator", a.decoratorName, t), n);
|
|
2459
2551
|
}
|
|
2460
|
-
for (let n of
|
|
2461
|
-
let e = n.getAttribute(
|
|
2462
|
-
i && o(n,
|
|
2552
|
+
for (let n of Mn(e, t)) {
|
|
2553
|
+
let e = n.getAttribute(An), r = R.get(e), i = r ? B(r, t) : null;
|
|
2554
|
+
i && o(n, U("part", e, t), i);
|
|
2463
2555
|
}
|
|
2464
2556
|
return n;
|
|
2465
2557
|
};
|
|
@@ -2468,7 +2560,7 @@ function wn(e) {
|
|
|
2468
2560
|
let { scope: e, decorator: t, bars: n } = l();
|
|
2469
2561
|
if (e) {
|
|
2470
2562
|
q(e);
|
|
2471
|
-
for (let t of
|
|
2563
|
+
for (let t of jn(e)) q(t);
|
|
2472
2564
|
}
|
|
2473
2565
|
t && q(t);
|
|
2474
2566
|
for (let e of n ?? []) e && q(e);
|
|
@@ -2479,11 +2571,11 @@ function wn(e) {
|
|
|
2479
2571
|
if (t) return t;
|
|
2480
2572
|
let { scope: n } = l();
|
|
2481
2573
|
if (n) {
|
|
2482
|
-
let t =
|
|
2483
|
-
if (
|
|
2484
|
-
let i =
|
|
2574
|
+
let t = Se(u), r = [];
|
|
2575
|
+
if (W(t, e)) {
|
|
2576
|
+
let i = B(t, e), a = 0, o = Fn({
|
|
2485
2577
|
element: n,
|
|
2486
|
-
expectedName:
|
|
2578
|
+
expectedName: U("screen", u, e),
|
|
2487
2579
|
motion: i,
|
|
2488
2580
|
isLive: () => n.isConnected && n.getAttribute("data-flemo-skip-animation") !== "true",
|
|
2489
2581
|
budgetUsed: () => a,
|
|
@@ -2503,10 +2595,10 @@ function wn(e) {
|
|
|
2503
2595
|
e.setDragStatus("IDLE"), e.setReplaceTransitionStatus("IDLE");
|
|
2504
2596
|
let { scope: t, decorator: n, bars: r } = l();
|
|
2505
2597
|
if (t) {
|
|
2506
|
-
q(t), t.removeAttribute(
|
|
2507
|
-
for (let e of
|
|
2598
|
+
q(t), t.removeAttribute(yn);
|
|
2599
|
+
for (let e of jn(t)) q(e);
|
|
2508
2600
|
}
|
|
2509
|
-
n && (q(n), n.removeAttribute(
|
|
2601
|
+
n && (q(n), n.removeAttribute(yn));
|
|
2510
2602
|
for (let e of r ?? []) e && (q(e), e.style.removeProperty("will-change"));
|
|
2511
2603
|
return Z;
|
|
2512
2604
|
}
|
|
@@ -2516,88 +2608,101 @@ function wn(e) {
|
|
|
2516
2608
|
let b = e.getTransitionTaskId(), x = () => {
|
|
2517
2609
|
let n = e.getTransitionTaskId();
|
|
2518
2610
|
n && s.resolveTask(n), b && t.delete(b);
|
|
2519
|
-
}, S =
|
|
2520
|
-
if (!(!w &&
|
|
2611
|
+
}, S = Se(u), C = `${f}-true`, w = y.getAttribute(yn) === "true";
|
|
2612
|
+
if (!(!w && W(S, C))) {
|
|
2521
2613
|
if (!w) {
|
|
2522
2614
|
let e = `${f}-false`;
|
|
2523
|
-
if (
|
|
2615
|
+
if (W(S, e)) {
|
|
2524
2616
|
if (!m) return b && s.markGateHeld(b), Z;
|
|
2525
2617
|
b && s.anchorGate(b);
|
|
2526
|
-
let t =
|
|
2618
|
+
let t = B(S, e), n = (t.delay + t.duration) * 1e3 + 50, r = setTimeout(x, n);
|
|
2527
2619
|
return () => clearTimeout(r);
|
|
2528
2620
|
}
|
|
2529
2621
|
}
|
|
2530
2622
|
return queueMicrotask(x), Z;
|
|
2531
2623
|
}
|
|
2532
2624
|
b && (m ? s.anchorGate(b) : s.markGateHeld(b));
|
|
2533
|
-
let T =
|
|
2625
|
+
let T = B(S, C), E = !w && !!T, ee = U("screen", u, C), D, O = () => {
|
|
2534
2626
|
D !== void 0 && (clearTimeout(D), D = void 0);
|
|
2535
|
-
}, te = 0, ne,
|
|
2536
|
-
|
|
2537
|
-
},
|
|
2627
|
+
}, te = 0, ne, re = [], k, A = () => {
|
|
2628
|
+
re.forEach((e) => cancelAnimationFrame(e)), re = [], k !== void 0 && clearTimeout(k), k = void 0;
|
|
2629
|
+
}, j = () => {
|
|
2538
2630
|
/* v8 ignore next 4 -- every runtime under test has rAF; the guard
|
|
2539
2631
|
shields exotic embedders. */
|
|
2540
2632
|
if (typeof requestAnimationFrame != "function") {
|
|
2541
2633
|
x();
|
|
2542
2634
|
return;
|
|
2543
2635
|
}
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
},
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2636
|
+
k = setTimeout(() => {
|
|
2637
|
+
A(), x();
|
|
2638
|
+
}, kn);
|
|
2639
|
+
let e = (t) => {
|
|
2640
|
+
if (t <= 0) {
|
|
2641
|
+
A(), x();
|
|
2642
|
+
return;
|
|
2643
|
+
}
|
|
2644
|
+
re.push(requestAnimationFrame(() => e(t - 1)));
|
|
2645
|
+
};
|
|
2646
|
+
e(On);
|
|
2647
|
+
}, ie = () => {
|
|
2552
2648
|
if (te <= 0) {
|
|
2553
|
-
|
|
2649
|
+
j();
|
|
2554
2650
|
return;
|
|
2555
2651
|
}
|
|
2556
|
-
ne = setTimeout(
|
|
2557
|
-
},
|
|
2558
|
-
e.target === y && e.animationName === ee && (y.removeEventListener("animationend",
|
|
2652
|
+
ne = setTimeout(j, te);
|
|
2653
|
+
}, ae = Z, oe = Z, se = (e) => {
|
|
2654
|
+
e.target === y && e.animationName === ee && (y.removeEventListener("animationend", se), O(), ae(), ie());
|
|
2559
2655
|
};
|
|
2560
|
-
y.addEventListener("animationend",
|
|
2561
|
-
let
|
|
2562
|
-
for (let e of Array.from(y.ownerDocument.querySelectorAll(`[${
|
|
2563
|
-
let t =
|
|
2564
|
-
r &&
|
|
2656
|
+
y.addEventListener("animationend", se);
|
|
2657
|
+
let ce = E && m ? _(C, "active", j) : null, le = (T.delay + T.duration) * 1e3, ue = le + 1500, de = b ? setTimeout(() => void s.resolveTask(b), ue) : void 0, fe = `${f}-false`, M = W(S, fe) ? B(S, fe) : null, pe = [];
|
|
2658
|
+
for (let e of Array.from(y.ownerDocument.querySelectorAll(`[${An}][data-flemo-status="${f}"]`))) {
|
|
2659
|
+
let t = R.get(e.getAttribute(An)), n = `${f}-${e.getAttribute("data-flemo-active")}`, r = t && W(t, n) ? B(t, n) : null;
|
|
2660
|
+
r && pe.push({
|
|
2565
2661
|
element: e,
|
|
2566
2662
|
motion: r
|
|
2567
2663
|
});
|
|
2568
2664
|
}
|
|
2569
|
-
let
|
|
2570
|
-
for (let { motion: e } of
|
|
2571
|
-
te = Math.max(0, Math.min(1e3,
|
|
2572
|
-
let
|
|
2665
|
+
let me = M ? (M.delay + M.duration) * 1e3 : 0;
|
|
2666
|
+
for (let { motion: e } of pe) me = Math.max(me, (e.delay + e.duration) * 1e3);
|
|
2667
|
+
te = Math.max(0, Math.min(1e3, me - le));
|
|
2668
|
+
let he = le + 250, ge = () => b !== null && e.getTransitionTaskId() === b && y.isConnected && y.getAttribute("data-flemo-skip-animation") !== "true" && W(S, C), N = Fn({
|
|
2573
2669
|
element: y,
|
|
2574
2670
|
expectedName: ee,
|
|
2575
2671
|
motion: T,
|
|
2576
|
-
isLive:
|
|
2672
|
+
isLive: ge,
|
|
2577
2673
|
budgetUsed: () => t.get(b) ?? 0,
|
|
2578
2674
|
spendBudget: () => {
|
|
2579
|
-
|
|
2675
|
+
oe(), t.set(b, (t.get(b) ?? 0) + 1);
|
|
2580
2676
|
},
|
|
2581
2677
|
onTerminal: x
|
|
2582
2678
|
});
|
|
2583
|
-
|
|
2584
|
-
let
|
|
2585
|
-
O(), D = setTimeout(
|
|
2586
|
-
},
|
|
2587
|
-
if (O(),
|
|
2588
|
-
|
|
2679
|
+
ae = N.detach;
|
|
2680
|
+
let _e = !1, ve = () => {
|
|
2681
|
+
O(), D = setTimeout(ye, he);
|
|
2682
|
+
}, ye = () => {
|
|
2683
|
+
if (O(), ge() && !_e) {
|
|
2684
|
+
_e = !0, oe(), N.fullRestart(), ve();
|
|
2589
2685
|
return;
|
|
2590
2686
|
}
|
|
2591
2687
|
x();
|
|
2592
|
-
},
|
|
2593
|
-
|
|
2594
|
-
let
|
|
2595
|
-
|
|
2688
|
+
}, P = !ce && m, be = P ? v(y, C) : [];
|
|
2689
|
+
P && (N.attach(), b && ve());
|
|
2690
|
+
let xe = P && !wt() ? En(() => {
|
|
2691
|
+
let { decorator: e, bars: t } = l();
|
|
2692
|
+
return [
|
|
2693
|
+
y,
|
|
2694
|
+
e,
|
|
2695
|
+
...t ?? []
|
|
2696
|
+
];
|
|
2697
|
+
}, () => {
|
|
2698
|
+
oe(), b && D !== void 0 && ve();
|
|
2699
|
+
}) : null, F, I = () => {
|
|
2700
|
+
F !== void 0 && (clearTimeout(F), F = void 0);
|
|
2596
2701
|
};
|
|
2597
|
-
if (
|
|
2598
|
-
let e = typeof window < "u" && window.devicePixelRatio || 1, t =
|
|
2599
|
-
for (let { element: t, motion: n } of
|
|
2600
|
-
let i =
|
|
2702
|
+
if (oe = I, P && b) {
|
|
2703
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1, t = Jt(T, y, e), n = M ? Jt(M, y, e) : 0, r = 0;
|
|
2704
|
+
for (let { element: t, motion: n } of pe) {
|
|
2705
|
+
let i = Jt(n, t, e);
|
|
2601
2706
|
if (i === null) {
|
|
2602
2707
|
r = null;
|
|
2603
2708
|
break;
|
|
@@ -2605,16 +2710,16 @@ function wn(e) {
|
|
|
2605
2710
|
r = Math.max(r, i);
|
|
2606
2711
|
}
|
|
2607
2712
|
let i = t !== null && n !== null && r !== null ? Math.max(t, n, r) : null;
|
|
2608
|
-
i !== null && i + 17 <
|
|
2609
|
-
|
|
2713
|
+
i !== null && i + 17 < le + te && (F = setTimeout(() => {
|
|
2714
|
+
F = void 0, ge() && (y.removeEventListener("animationend", se), O(), ae(), j());
|
|
2610
2715
|
}, i + 17));
|
|
2611
2716
|
}
|
|
2612
2717
|
return () => {
|
|
2613
|
-
if (
|
|
2614
|
-
|
|
2615
|
-
for (let e of
|
|
2718
|
+
if (de !== void 0 && clearTimeout(de), ne !== void 0 && clearTimeout(ne), A(), xe?.(), I(), y.removeEventListener("animationend", se), P) {
|
|
2719
|
+
N.detach();
|
|
2720
|
+
for (let e of be) e();
|
|
2616
2721
|
}
|
|
2617
|
-
O(),
|
|
2722
|
+
O(), ce?.(), b && e.getTransitionTaskId() !== b && t.delete(b);
|
|
2618
2723
|
};
|
|
2619
2724
|
},
|
|
2620
2725
|
activeResumeEntryCount: () => t.size
|
|
@@ -2622,20 +2727,20 @@ function wn(e) {
|
|
|
2622
2727
|
}
|
|
2623
2728
|
//#endregion
|
|
2624
2729
|
//#region src/utils/findScrollable.ts
|
|
2625
|
-
function
|
|
2626
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
2730
|
+
function Ln(e, t) {
|
|
2731
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = Rn(e);
|
|
2627
2732
|
if (!o) return {
|
|
2628
2733
|
element: null,
|
|
2629
2734
|
hasMarker: !1
|
|
2630
2735
|
};
|
|
2631
2736
|
let s = o.closest?.(r);
|
|
2632
|
-
if (s instanceof HTMLElement &&
|
|
2737
|
+
if (s instanceof HTMLElement && zn(s, n) && (!a || Bn(s, n))) return {
|
|
2633
2738
|
element: s,
|
|
2634
2739
|
hasMarker: !0
|
|
2635
2740
|
};
|
|
2636
2741
|
let c = o, l = 0;
|
|
2637
2742
|
for (; c && l < i;) {
|
|
2638
|
-
if (
|
|
2743
|
+
if (zn(c, n) && (!a || Bn(c, n))) return {
|
|
2639
2744
|
element: c,
|
|
2640
2745
|
hasMarker: !1
|
|
2641
2746
|
};
|
|
@@ -2646,7 +2751,7 @@ function Tn(e, t) {
|
|
|
2646
2751
|
hasMarker: !1
|
|
2647
2752
|
};
|
|
2648
2753
|
}
|
|
2649
|
-
function
|
|
2754
|
+
function Rn(e) {
|
|
2650
2755
|
if (!e) return null;
|
|
2651
2756
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
2652
2757
|
if (n && n.length) {
|
|
@@ -2654,18 +2759,18 @@ function En(e) {
|
|
|
2654
2759
|
}
|
|
2655
2760
|
return e instanceof HTMLElement ? e : null;
|
|
2656
2761
|
}
|
|
2657
|
-
function
|
|
2762
|
+
function zn(e, t) {
|
|
2658
2763
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
2659
2764
|
}
|
|
2660
|
-
function
|
|
2661
|
-
if (!
|
|
2765
|
+
function Bn(e, t) {
|
|
2766
|
+
if (!zn(e, t) || typeof window > "u") return !1;
|
|
2662
2767
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
2663
2768
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
2664
2769
|
}
|
|
2665
2770
|
//#endregion
|
|
2666
2771
|
//#region src/core/engine/createSwipeController.ts
|
|
2667
|
-
var
|
|
2668
|
-
function
|
|
2772
|
+
var Vn = "data-flemo-skip-animation";
|
|
2773
|
+
function Hn(e) {
|
|
2669
2774
|
let t = null, n = null, r = {
|
|
2670
2775
|
current: [],
|
|
2671
2776
|
prev: []
|
|
@@ -2727,7 +2832,7 @@ function An(e) {
|
|
|
2727
2832
|
current: i,
|
|
2728
2833
|
prev: s
|
|
2729
2834
|
};
|
|
2730
|
-
let c =
|
|
2835
|
+
let c = Ke(e.getTransition()).join(", ");
|
|
2731
2836
|
for (let e of i) e.style.willChange = c;
|
|
2732
2837
|
for (let e of s) e.style.willChange = c;
|
|
2733
2838
|
}, b = () => {
|
|
@@ -2745,7 +2850,7 @@ function An(e) {
|
|
|
2745
2850
|
};
|
|
2746
2851
|
}, S = (e, t, n) => {
|
|
2747
2852
|
let r = (r, i) => {
|
|
2748
|
-
let a =
|
|
2853
|
+
let a = R.get(r.getAttribute("data-flemo-part-name"));
|
|
2749
2854
|
if (!a) return;
|
|
2750
2855
|
let o = {
|
|
2751
2856
|
animate: J,
|
|
@@ -2828,7 +2933,7 @@ function An(e) {
|
|
|
2828
2933
|
}), S("end", e, 0);
|
|
2829
2934
|
}
|
|
2830
2935
|
})) {
|
|
2831
|
-
c?.setAttribute(
|
|
2936
|
+
c?.setAttribute(Vn, "true"), l?.setAttribute(Vn, "true");
|
|
2832
2937
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
2833
2938
|
for (let e of r.prev) q(e), e.style.removeProperty("will-change");
|
|
2834
2939
|
r = {
|
|
@@ -2842,10 +2947,10 @@ function An(e) {
|
|
|
2842
2947
|
};
|
|
2843
2948
|
return {
|
|
2844
2949
|
pointerDown: (t) => {
|
|
2845
|
-
e.isReadyForDrag() && (f =
|
|
2950
|
+
e.isReadyForDrag() && (f = Ln(t.target, {
|
|
2846
2951
|
direction: "x",
|
|
2847
2952
|
verifyByScroll: !0
|
|
2848
|
-
}), p =
|
|
2953
|
+
}), p = Ln(t.target, {
|
|
2849
2954
|
direction: "y",
|
|
2850
2955
|
verifyByScroll: !0
|
|
2851
2956
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -2874,7 +2979,7 @@ function An(e) {
|
|
|
2874
2979
|
}
|
|
2875
2980
|
//#endregion
|
|
2876
2981
|
//#region src/screen/computeBarRiding.ts
|
|
2877
|
-
function
|
|
2982
|
+
function Un(e) {
|
|
2878
2983
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
2879
2984
|
app: !1,
|
|
2880
2985
|
nav: !1
|
|
@@ -2885,31 +2990,31 @@ function jn(e) {
|
|
|
2885
2990
|
}
|
|
2886
2991
|
//#endregion
|
|
2887
2992
|
//#region src/screen/pendingNetwork.ts
|
|
2888
|
-
var
|
|
2889
|
-
|
|
2890
|
-
},
|
|
2891
|
-
if (!(
|
|
2892
|
-
if (
|
|
2993
|
+
var Wn = 0, Gn = !1, Kn = () => {
|
|
2994
|
+
Wn = Math.max(0, Wn - 1);
|
|
2995
|
+
}, qn = () => {
|
|
2996
|
+
if (!(Gn || typeof window > "u")) {
|
|
2997
|
+
if (Gn = !0, typeof window.fetch == "function") {
|
|
2893
2998
|
let e = window.fetch.bind(window);
|
|
2894
2999
|
window.fetch = (...t) => {
|
|
2895
|
-
|
|
3000
|
+
Wn += 1;
|
|
2896
3001
|
let n;
|
|
2897
3002
|
try {
|
|
2898
3003
|
n = e(...t);
|
|
2899
3004
|
} catch (e) {
|
|
2900
|
-
throw
|
|
3005
|
+
throw Kn(), e;
|
|
2901
3006
|
}
|
|
2902
|
-
return n.then((e) => (
|
|
2903
|
-
throw
|
|
3007
|
+
return n.then((e) => (Kn(), e), (e) => {
|
|
3008
|
+
throw Kn(), e;
|
|
2904
3009
|
});
|
|
2905
3010
|
};
|
|
2906
3011
|
}
|
|
2907
3012
|
if (typeof XMLHttpRequest == "function") {
|
|
2908
3013
|
let e = XMLHttpRequest.prototype.send;
|
|
2909
3014
|
XMLHttpRequest.prototype.send = function(...t) {
|
|
2910
|
-
|
|
3015
|
+
Wn += 1;
|
|
2911
3016
|
let n = !1, r = () => {
|
|
2912
|
-
n || (n = !0,
|
|
3017
|
+
n || (n = !0, Kn());
|
|
2913
3018
|
};
|
|
2914
3019
|
this.addEventListener("loadend", r);
|
|
2915
3020
|
try {
|
|
@@ -2920,28 +3025,28 @@ var Mn = 0, Nn = !1, Pn = () => {
|
|
|
2920
3025
|
};
|
|
2921
3026
|
}
|
|
2922
3027
|
}
|
|
2923
|
-
},
|
|
3028
|
+
}, Jn = () => (qn(), Wn > 0);
|
|
2924
3029
|
//#endregion
|
|
2925
3030
|
//#region src/screen/animStartAnchor.ts
|
|
2926
|
-
function
|
|
3031
|
+
function Yn(e) {
|
|
2927
3032
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
2928
3033
|
}
|
|
2929
|
-
var
|
|
2930
|
-
function
|
|
2931
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0,
|
|
3034
|
+
var Xn = 300, Zn = 20;
|
|
3035
|
+
function Qn(e) {
|
|
3036
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, Zn);
|
|
2932
3037
|
}
|
|
2933
|
-
function
|
|
2934
|
-
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of
|
|
3038
|
+
function $n(e) {
|
|
3039
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of Qn(e)) t.decode().catch(() => {});
|
|
2935
3040
|
}
|
|
2936
|
-
var
|
|
3041
|
+
var er = 3, tr = 40, nr = 24, rr = (e) => {
|
|
2937
3042
|
if (typeof e.querySelectorAll != "function") return !1;
|
|
2938
3043
|
let t = e.querySelectorAll("*").length;
|
|
2939
3044
|
/* v8 ignore stop */
|
|
2940
|
-
return t <
|
|
2941
|
-
},
|
|
3045
|
+
return t < nr ? !1 : ((e.textContent ?? "").trim().length + e.querySelectorAll("img").length * tr) / t < er;
|
|
3046
|
+
}, ir = (e) => typeof e.getAnimations == "function" && e.getAnimations({ subtree: !0 }).some((e) => {
|
|
2942
3047
|
let t = e.animationName;
|
|
2943
3048
|
return typeof t != "string" || !t.startsWith("flemo-");
|
|
2944
|
-
}),
|
|
3049
|
+
}), ar = (e) => {
|
|
2945
3050
|
/* v8 ignore next -- the settle gate only runs a scope past looksLikeShell,
|
|
2946
3051
|
which already requires querySelectorAll. */
|
|
2947
3052
|
if (typeof e.querySelectorAll != "function") return !1;
|
|
@@ -2949,12 +3054,12 @@ var Hn = 3, Un = 40, Wn = 24, Gn = (e) => {
|
|
|
2949
3054
|
the guard shields exotic embedders. */
|
|
2950
3055
|
let t = typeof e.getBoundingClientRect == "function" ? e.getBoundingClientRect() : null, n = t && t.height > 0 ? t : null, r = 0;
|
|
2951
3056
|
for (let t of Array.from(e.querySelectorAll("img"))) {
|
|
2952
|
-
if (r >=
|
|
3057
|
+
if (r >= Zn) break;
|
|
2953
3058
|
if (!(t.loading === "lazy" && !t.currentSrc) && !(n && t.getBoundingClientRect().top - n.top >= n.height) && (r += 1, !t.complete)) return !0;
|
|
2954
3059
|
}
|
|
2955
3060
|
return !1;
|
|
2956
3061
|
};
|
|
2957
|
-
function
|
|
3062
|
+
function or(e, t = {}) {
|
|
2958
3063
|
let n = !1, r = 0, i = [], a = [], o = () => {
|
|
2959
3064
|
if (n) return;
|
|
2960
3065
|
let r = t.scope;
|
|
@@ -2962,7 +3067,7 @@ function Jn(e, t = {}) {
|
|
|
2962
3067
|
e();
|
|
2963
3068
|
return;
|
|
2964
3069
|
}
|
|
2965
|
-
let i =
|
|
3070
|
+
let i = Qn(r);
|
|
2966
3071
|
if (i.length === 0) {
|
|
2967
3072
|
e();
|
|
2968
3073
|
return;
|
|
@@ -2979,15 +3084,15 @@ function Jn(e, t = {}) {
|
|
|
2979
3084
|
e();
|
|
2980
3085
|
return;
|
|
2981
3086
|
}
|
|
2982
|
-
if (!
|
|
3087
|
+
if (!rr(r)) {
|
|
2983
3088
|
e();
|
|
2984
3089
|
return;
|
|
2985
3090
|
}
|
|
2986
3091
|
/* v8 ignore start -- performance exists in every runtime under test;
|
|
2987
3092
|
the fallback only shields exotic embedders. */
|
|
2988
|
-
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () =>
|
|
3093
|
+
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () => rr(r) && ir(r), d = () => Jn() || ar(r), f = () => {
|
|
2989
3094
|
l || (l = !0, h.disconnect(), clearTimeout(g), clearTimeout(_), clearTimeout(v), s.forEach((e) => cancelAnimationFrame(e)), s = [], e());
|
|
2990
|
-
}, p = () => !
|
|
3095
|
+
}, p = () => !rr(r) && !d() ? 2 : 6, m = () => {
|
|
2991
3096
|
s.forEach((e) => cancelAnimationFrame(e)), s = [];
|
|
2992
3097
|
let e = (t) => {
|
|
2993
3098
|
if (t <= 0) {
|
|
@@ -3045,14 +3150,14 @@ function Jn(e, t = {}) {
|
|
|
3045
3150
|
n = !0, cancelAnimationFrame(l), r && cancelAnimationFrame(r), i.forEach((e) => cancelAnimationFrame(e)), a.forEach((e) => e());
|
|
3046
3151
|
};
|
|
3047
3152
|
}
|
|
3048
|
-
function
|
|
3049
|
-
let n =
|
|
3153
|
+
function sr(e, t = {}) {
|
|
3154
|
+
let n = or(e, t), r = t.contentSettle?.capMs ?? 0, i = setTimeout(e, 300 + r);
|
|
3050
3155
|
return () => {
|
|
3051
3156
|
n(), clearTimeout(i);
|
|
3052
3157
|
};
|
|
3053
3158
|
}
|
|
3054
|
-
var
|
|
3055
|
-
function
|
|
3159
|
+
var cr = (e) => 300 + (e?.contentSettle?.capMs ?? 0);
|
|
3160
|
+
function lr() {
|
|
3056
3161
|
let e = /* @__PURE__ */ new Map(), t = (t, n) => {
|
|
3057
3162
|
clearTimeout(n.backstop), e.delete(t);
|
|
3058
3163
|
let r = [...n.members];
|
|
@@ -3062,14 +3167,14 @@ function Zn() {
|
|
|
3062
3167
|
return { join: (r, i, a) => {
|
|
3063
3168
|
let o = e.get(r);
|
|
3064
3169
|
if (o) {
|
|
3065
|
-
let e =
|
|
3170
|
+
let e = cr(a);
|
|
3066
3171
|
if (e > o.backstopMs) {
|
|
3067
3172
|
clearTimeout(o.backstop);
|
|
3068
3173
|
let n = o;
|
|
3069
3174
|
n.backstopMs = e, n.backstop = setTimeout(() => t(r, n), e);
|
|
3070
3175
|
}
|
|
3071
3176
|
} else {
|
|
3072
|
-
let n =
|
|
3177
|
+
let n = cr(a), i = {
|
|
3073
3178
|
members: /* @__PURE__ */ new Set(),
|
|
3074
3179
|
backstop: setTimeout(() => t(r, i), n),
|
|
3075
3180
|
backstopMs: n
|
|
@@ -3079,7 +3184,7 @@ function Zn() {
|
|
|
3079
3184
|
let s = o, c = {
|
|
3080
3185
|
release: i,
|
|
3081
3186
|
ready: !1,
|
|
3082
|
-
cancelReadiness:
|
|
3187
|
+
cancelReadiness: or(() => {
|
|
3083
3188
|
c.ready = !0, n(s) && t(r, s);
|
|
3084
3189
|
}, a)
|
|
3085
3190
|
};
|
|
@@ -3096,7 +3201,7 @@ function Zn() {
|
|
|
3096
3201
|
}
|
|
3097
3202
|
//#endregion
|
|
3098
3203
|
//#region src/screen/observeBarHeight.ts
|
|
3099
|
-
function
|
|
3204
|
+
function ur(e, t) {
|
|
3100
3205
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
3101
3206
|
let n = new ResizeObserver(([e]) => {
|
|
3102
3207
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -3107,14 +3212,14 @@ function Qn(e, t) {
|
|
|
3107
3212
|
}
|
|
3108
3213
|
//#endregion
|
|
3109
3214
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
3110
|
-
var
|
|
3111
|
-
function
|
|
3215
|
+
var dr = 0;
|
|
3216
|
+
function fr(e) {
|
|
3112
3217
|
let t = 0, n = () => {
|
|
3113
3218
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
3114
3219
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
3115
3220
|
t = t < 0 ? 0 : t;
|
|
3116
|
-
let n = t -
|
|
3117
|
-
n = n < 0 ? 0 : n,
|
|
3221
|
+
let n = t - dr;
|
|
3222
|
+
n = n < 0 ? 0 : n, dr ||= t, e(t, n);
|
|
3118
3223
|
});
|
|
3119
3224
|
};
|
|
3120
3225
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -3123,30 +3228,30 @@ function er(e) {
|
|
|
3123
3228
|
}
|
|
3124
3229
|
//#endregion
|
|
3125
3230
|
//#region src/core/engine/imageDecodeOffloader.ts
|
|
3126
|
-
var
|
|
3231
|
+
var pr = 8, mr = 2, Q = 96, hr = 15e3, gr = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", _r = "data-flemo-image-src", vr = "flemo-image-scale-v1", yr = (e) => {
|
|
3127
3232
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0 || e.boxWidth <= 0 || e.boxHeight <= 0) return !1;
|
|
3128
3233
|
let t = e.boxWidth * e.boxHeight * e.devicePixelRatio * e.devicePixelRatio;
|
|
3129
3234
|
return e.naturalWidth * e.naturalHeight > t * 8;
|
|
3130
|
-
},
|
|
3235
|
+
}, br = "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};", xr = () => typeof Worker < "u" && typeof OffscreenCanvas < "u" && typeof createImageBitmap == "function" && typeof MutationObserver < "u" && typeof URL < "u" && typeof URL.createObjectURL == "function", Sr = async (e, t) => {
|
|
3131
3236
|
try {
|
|
3132
3237
|
if (typeof caches > "u") return;
|
|
3133
|
-
await (await caches.open(
|
|
3238
|
+
await (await caches.open(vr)).put(e, new Response(t, { headers: { "content-type": t.type } }));
|
|
3134
3239
|
} catch {}
|
|
3135
|
-
},
|
|
3240
|
+
}, Cr = async (e) => {
|
|
3136
3241
|
try {
|
|
3137
3242
|
if (typeof caches > "u") return null;
|
|
3138
|
-
let t = await (await caches.open(
|
|
3243
|
+
let t = await (await caches.open(vr)).match(e);
|
|
3139
3244
|
return t ? await t.blob() : null;
|
|
3140
3245
|
} catch {
|
|
3141
3246
|
return null;
|
|
3142
3247
|
}
|
|
3143
3248
|
};
|
|
3144
|
-
function
|
|
3145
|
-
if (!
|
|
3249
|
+
function wr(e) {
|
|
3250
|
+
if (!xr()) return () => {};
|
|
3146
3251
|
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 = () => {
|
|
3147
3252
|
if (t) return t;
|
|
3148
3253
|
try {
|
|
3149
|
-
t = new Worker(URL.createObjectURL(new Blob([
|
|
3254
|
+
t = new Worker(URL.createObjectURL(new Blob([br])));
|
|
3150
3255
|
} catch {
|
|
3151
3256
|
return null;
|
|
3152
3257
|
}
|
|
@@ -3157,7 +3262,7 @@ function fr(e) {
|
|
|
3157
3262
|
return;
|
|
3158
3263
|
}
|
|
3159
3264
|
let o = URL.createObjectURL(n);
|
|
3160
|
-
s.add(o),
|
|
3265
|
+
s.add(o), Sr(t, n), u(t, o);
|
|
3161
3266
|
}, t;
|
|
3162
3267
|
}, u = (e, t) => {
|
|
3163
3268
|
r.has(e) || r.set(e, t);
|
|
@@ -3167,12 +3272,12 @@ function fr(e) {
|
|
|
3167
3272
|
if (n) {
|
|
3168
3273
|
if (a.delete(e), clearTimeout(n.timeout), n.detachListeners?.(), n.responsive) {
|
|
3169
3274
|
if (t && t !== "skip") {
|
|
3170
|
-
e.setAttribute(
|
|
3275
|
+
e.setAttribute(_r, n.url), e.removeAttribute("srcset"), e.removeAttribute("sizes");
|
|
3171
3276
|
let r = e.closest("picture");
|
|
3172
3277
|
if (r) for (let e of Array.from(r.querySelectorAll("source"))) e.removeAttribute("srcset");
|
|
3173
3278
|
e.src = t;
|
|
3174
3279
|
}
|
|
3175
|
-
} else e.getAttribute("src") ===
|
|
3280
|
+
} else e.getAttribute("src") === gr && (t && t !== "skip" ? e.src = t : (e.removeAttribute(_r), e.src = n.url));
|
|
3176
3281
|
n.previousVisibility ? e.style.visibility = n.previousVisibility : e.style.removeProperty("visibility");
|
|
3177
3282
|
}
|
|
3178
3283
|
}, f = (e, t, n) => {
|
|
@@ -3180,7 +3285,7 @@ function fr(e) {
|
|
|
3180
3285
|
let a = l();
|
|
3181
3286
|
if (!a) return;
|
|
3182
3287
|
i.add(e);
|
|
3183
|
-
let o = Math.round(Math.max(Q, t * c()) *
|
|
3288
|
+
let o = Math.round(Math.max(Q, t * c()) * mr), s = Math.max(t * n, Q * Q) * c() ** 2;
|
|
3184
3289
|
a.postMessage({
|
|
3185
3290
|
url: e,
|
|
3186
3291
|
targetWidth: o,
|
|
@@ -3192,13 +3297,13 @@ function fr(e) {
|
|
|
3192
3297
|
let t = {
|
|
3193
3298
|
url: "",
|
|
3194
3299
|
previousVisibility: e.style.visibility,
|
|
3195
|
-
timeout: setTimeout(() => d(e, null),
|
|
3300
|
+
timeout: setTimeout(() => d(e, null), hr),
|
|
3196
3301
|
responsive: !0
|
|
3197
3302
|
}, i = () => {
|
|
3198
3303
|
/* v8 ignore next -- consider() only routes elements with an https src
|
|
3199
3304
|
here, so the final fallback arm is unreachable. */
|
|
3200
3305
|
let i = e.currentSrc || e.getAttribute("src") || "", o = e.getBoundingClientRect();
|
|
3201
|
-
if (!(/^https?:/.test(i) &&
|
|
3306
|
+
if (!(/^https?:/.test(i) && yr({
|
|
3202
3307
|
naturalWidth: e.naturalWidth,
|
|
3203
3308
|
naturalHeight: e.naturalHeight,
|
|
3204
3309
|
boxWidth: o.width || Q,
|
|
@@ -3214,7 +3319,7 @@ function fr(e) {
|
|
|
3214
3319
|
d(e, l);
|
|
3215
3320
|
return;
|
|
3216
3321
|
}
|
|
3217
|
-
|
|
3322
|
+
Cr(i).then((t) => {
|
|
3218
3323
|
if (!(n || !a.has(e))) {
|
|
3219
3324
|
/* v8 ignore start -- a verdict can only appear via settle(), which
|
|
3220
3325
|
releases every held element of the url first, so a still-held
|
|
@@ -3253,14 +3358,14 @@ function fr(e) {
|
|
|
3253
3358
|
let i = r.get(t);
|
|
3254
3359
|
if (i !== "skip") {
|
|
3255
3360
|
if (i) {
|
|
3256
|
-
e.setAttribute(
|
|
3361
|
+
e.setAttribute(_r, t), e.src = i;
|
|
3257
3362
|
return;
|
|
3258
3363
|
}
|
|
3259
3364
|
a.set(e, {
|
|
3260
3365
|
url: t,
|
|
3261
3366
|
previousVisibility: e.style.visibility,
|
|
3262
|
-
timeout: setTimeout(() => d(e, null),
|
|
3263
|
-
}), e.style.visibility = "hidden", e.setAttribute(
|
|
3367
|
+
timeout: setTimeout(() => d(e, null), hr)
|
|
3368
|
+
}), e.style.visibility = "hidden", e.setAttribute(_r, t), e.src = gr, Cr(t).then((i) => {
|
|
3264
3369
|
if (n || r.has(t)) return;
|
|
3265
3370
|
if (i) {
|
|
3266
3371
|
let e = URL.createObjectURL(i);
|
|
@@ -3292,9 +3397,9 @@ function fr(e) {
|
|
|
3292
3397
|
};
|
|
3293
3398
|
}
|
|
3294
3399
|
var $ = null;
|
|
3295
|
-
function
|
|
3400
|
+
function Tr() {
|
|
3296
3401
|
return typeof document > "u" || !document.body ? () => {} : ($ ? $.count += 1 : $ = {
|
|
3297
|
-
dispose:
|
|
3402
|
+
dispose: wr(document.body),
|
|
3298
3403
|
count: 1
|
|
3299
3404
|
}, () => {
|
|
3300
3405
|
$ && (--$.count, $.count <= 0 && ($.dispose(), $ = null));
|
|
@@ -3302,7 +3407,7 @@ function pr() {
|
|
|
3302
3407
|
}
|
|
3303
3408
|
//#endregion
|
|
3304
3409
|
//#region src/utils/isOpaqueColor.ts
|
|
3305
|
-
function
|
|
3410
|
+
function Er(e) {
|
|
3306
3411
|
let t = e.trim().toLowerCase();
|
|
3307
3412
|
if (t === "transparent" || t === "") return !1;
|
|
3308
3413
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -3313,7 +3418,7 @@ function mr(e) {
|
|
|
3313
3418
|
}
|
|
3314
3419
|
//#endregion
|
|
3315
3420
|
//#region src/utils/buildRoutePath.ts
|
|
3316
|
-
function
|
|
3421
|
+
function Dr(e, n) {
|
|
3317
3422
|
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();
|
|
3318
3423
|
return {
|
|
3319
3424
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -3321,4 +3426,4 @@ function hr(e, n) {
|
|
|
3321
3426
|
};
|
|
3322
3427
|
}
|
|
3323
3428
|
//#endregion
|
|
3324
|
-
export {
|
|
3429
|
+
export { Xn as ANIM_HOLD_RELEASE_BACKSTOP_MS, _r as OFFLOADED_SRC_ATTR, pr as OVERSIZE_AREA_RATIO, yn as SKIP_ANIMATION_ATTR, s as TaskManger, Yn as animHoldKey, J as animateInline, U as animationName, oe as appendParamsQuery, at as applyTransitionStyles, Dr as buildRoutePath, Bn as canProgrammaticallyScroll, q as clearInlineAnimation, Ke as collectAnimatedProperties, tt as compileTransitionStyles, Un as computeBarRiding, ge as computeScreenFreeze, he as computeScreenFreezeMode, b as consumeSelfInducedPop, lr as createAnimHoldCoordinator, g as createBrowserHistoryDriver, Ce as createDecorator, c as createHistoryStore, x as createHistorySync, wr as createImageDecodeOffloader, ne as createMemoryHistoryDriver, re as createNavigateStore, ie as createNavigationController, De as createPartTransition, we as createRawDecorator, Oe as createRawPartTransition, _e as createRawTransition, pe as createRouterScope, me as createScreenSelector, de as createScreenStore, _ as createSelfPopGuard, se as createStepController, Hn as createSwipeController, N as createTransition, In as createTransitionEngine, le as createTransitionStore, ye as cupertino, L as decoratorMap, $n as eagerlyDecodeImages, qe as easingToCss, Tr as ensureImageDecodeOffloader, O as ensureScopeHistorySync, p as ensureWindowHistoryState, ft as enteringInitialStyle, Ln as findScrollable, l as getMatchedPathPattern, u as getParams, Lt as holdCompositorWarm, Er as isOpaqueColor, f as isServer, be as layout, y as markSelfInducedPop, ue as matchesPathname, xe as material, F as none, ur as observeBarHeight, fr as observeViewportScrollHeight, zn as overflowsAxis, Ee as overlay, R as partTransitionMap, ae as readStepParams, dt as registerTransitionDefinitions, te as releaseScopeHistorySync, Se as resolveTransition, sr as scheduleAnimHoldRelease, d as seedInitialHistory, m as seedRouterEntry, yr as shouldOffloadImage, ce as subscribeStepParamsRestore, V as targetToDecls, I as transitionMap, W as variantHasAnimation };
|