@flemo/core 1.21.0 → 1.21.1
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/index.mjs +215 -175
- 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 k() {
|
|
566
566
|
return e((e) => ({
|
|
567
567
|
status: "IDLE",
|
|
568
568
|
transitionTaskId: null,
|
|
@@ -572,11 +572,11 @@ function re() {
|
|
|
572
572
|
}
|
|
573
573
|
//#endregion
|
|
574
574
|
//#region src/navigate/createNavigationController.ts
|
|
575
|
-
var
|
|
575
|
+
var A = (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
|
+
}, j = (e, t) => typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.trunc(e)) : t, M = 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 k = (e, t, n) => {
|
|
|
584
584
|
let s = await Promise.race([a, o]);
|
|
585
585
|
i(), s && r();
|
|
586
586
|
};
|
|
587
|
-
function
|
|
587
|
+
function re(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 ie(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 = A(u.until, d, f);
|
|
614
614
|
return e < 0 ? 0 : e;
|
|
615
615
|
}
|
|
616
|
-
return Math.min(
|
|
616
|
+
return Math.min(j(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 ie(e) {
|
|
|
640
640
|
return g({
|
|
641
641
|
...C,
|
|
642
642
|
frameIndex: T + 1
|
|
643
|
-
}), await
|
|
643
|
+
}), await M(r, i, v, () => {
|
|
644
644
|
o(), r.pushState({
|
|
645
645
|
id: h,
|
|
646
646
|
index: T + 1,
|
|
@@ -679,10 +679,10 @@ function ie(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 = A(u.until, d, f);
|
|
683
683
|
return e < 0 ? 0 : e + 1;
|
|
684
684
|
}
|
|
685
|
-
return Math.min(
|
|
685
|
+
return Math.min(j(u?.skip, 0) + 1, d + 1);
|
|
686
686
|
})();
|
|
687
687
|
if (y <= 0) {
|
|
688
688
|
a.abort();
|
|
@@ -714,7 +714,7 @@ function ie(e) {
|
|
|
714
714
|
return v(y - 1), g({
|
|
715
715
|
...w,
|
|
716
716
|
frameIndex: E
|
|
717
|
-
}), y <= d ? await
|
|
717
|
+
}), y <= d ? await M(r, i, y, () => {
|
|
718
718
|
o(), r.pushState({
|
|
719
719
|
id: h,
|
|
720
720
|
index: E,
|
|
@@ -723,7 +723,7 @@ function ie(e) {
|
|
|
723
723
|
transitionName: p,
|
|
724
724
|
layoutId: m
|
|
725
725
|
}, S);
|
|
726
|
-
}) : await
|
|
726
|
+
}) : await M(r, i, d, () => {
|
|
727
727
|
o(), r.replaceState({
|
|
728
728
|
id: h,
|
|
729
729
|
index: E,
|
|
@@ -779,10 +779,10 @@ function ie(e) {
|
|
|
779
779
|
pop: async (e) => {
|
|
780
780
|
await d((t, n) => {
|
|
781
781
|
if (e?.until != null) {
|
|
782
|
-
let r =
|
|
782
|
+
let r = A(e.until, t, n);
|
|
783
783
|
return r < 0 ? 0 : r;
|
|
784
784
|
}
|
|
785
|
-
let r =
|
|
785
|
+
let r = j(e?.skip, 1);
|
|
786
786
|
return r <= 0 ? 0 : Math.min(r, t);
|
|
787
787
|
}, e?.transitionName);
|
|
788
788
|
}
|
|
@@ -790,14 +790,14 @@ function ie(e) {
|
|
|
790
790
|
}
|
|
791
791
|
//#endregion
|
|
792
792
|
//#region src/navigate/createStepController.ts
|
|
793
|
-
var
|
|
793
|
+
var ie = (e) => {
|
|
794
794
|
let t = e;
|
|
795
795
|
return t?.step ? t.params ?? {} : null;
|
|
796
|
-
},
|
|
796
|
+
}, ae = (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 oe(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 se(e) {
|
|
|
855
855
|
}
|
|
856
856
|
};
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function se(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 ce(e, t) {
|
|
|
865
865
|
}
|
|
866
866
|
//#endregion
|
|
867
867
|
//#region src/transition/store.ts
|
|
868
|
-
function
|
|
868
|
+
function ce(t = "cupertino") {
|
|
869
869
|
return e((e) => ({
|
|
870
870
|
defaultTransitionName: t,
|
|
871
871
|
setDefaultTransitionName: (t) => e({ defaultTransitionName: t })
|
|
@@ -948,8 +948,8 @@ function fe(e) {
|
|
|
948
948
|
url: p.pathname
|
|
949
949
|
}) : o, h = a ? de : _(), g = {
|
|
950
950
|
history: c([p], 0),
|
|
951
|
-
navigate:
|
|
952
|
-
transition:
|
|
951
|
+
navigate: k(),
|
|
952
|
+
transition: ce(i),
|
|
953
953
|
screen: ue(),
|
|
954
954
|
driver: m,
|
|
955
955
|
markSelfInduced: h.mark,
|
|
@@ -1004,7 +1004,7 @@ function P({ name: e, initial: t, idle: n, enter: r, enterBack: i, exit: a, exit
|
|
|
1004
1004
|
}
|
|
1005
1005
|
//#endregion
|
|
1006
1006
|
//#region src/transition/createRawTransition.ts
|
|
1007
|
-
function
|
|
1007
|
+
function he({ 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
1008
|
return {
|
|
1009
1009
|
name: e,
|
|
1010
1010
|
initial: t,
|
|
@@ -1025,10 +1025,10 @@ function F({ name: e, initial: t, idle: n, pushOnEnter: r, pushOnExit: i, replac
|
|
|
1025
1025
|
}
|
|
1026
1026
|
//#endregion
|
|
1027
1027
|
//#region src/transition/cupertino.ts
|
|
1028
|
-
var
|
|
1028
|
+
var ge = (e, t, n) => {
|
|
1029
1029
|
let [r, i] = t, [a, o] = n;
|
|
1030
1030
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1031
|
-
},
|
|
1031
|
+
}, _e = P({
|
|
1032
1032
|
name: "cupertino",
|
|
1033
1033
|
initial: { x: "100%" },
|
|
1034
1034
|
idle: {
|
|
@@ -1088,7 +1088,7 @@ var he = (e, t, n) => {
|
|
|
1088
1088
|
swipeDirection: "x",
|
|
1089
1089
|
onSwipeStart: async () => !0,
|
|
1090
1090
|
onSwipe: (e, t, { animate: n, currentScreen: r, prevScreen: i, onProgress: a }) => {
|
|
1091
|
-
let { offset: o } = t, s = o.x, c =
|
|
1091
|
+
let { offset: o } = t, s = o.x, c = ge(s, [0, window.innerWidth], [0, 100]);
|
|
1092
1092
|
return a?.(!0, c), n(r, { x: Math.max(0, s) }, { duration: 0 }), n(i, { x: `${-35 + c * .35}%` }, { duration: 0 }), c;
|
|
1093
1093
|
},
|
|
1094
1094
|
onSwipeEnd: async (e, t, { animate: n, currentScreen: r, prevScreen: i, onStart: a }) => {
|
|
@@ -1112,10 +1112,10 @@ var he = (e, t, n) => {
|
|
|
1112
1112
|
})]), c;
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
|
-
}),
|
|
1115
|
+
}), ve = (e, t, n) => {
|
|
1116
1116
|
let [r, i] = t, [a, o] = n;
|
|
1117
1117
|
return i === r ? a : a + (e - r) / (i - r) * (o - a);
|
|
1118
|
-
},
|
|
1118
|
+
}, F = P({
|
|
1119
1119
|
name: "layout",
|
|
1120
1120
|
initial: { opacity: .97 },
|
|
1121
1121
|
idle: {
|
|
@@ -1143,7 +1143,7 @@ var he = (e, t, n) => {
|
|
|
1143
1143
|
swipeDirection: "y",
|
|
1144
1144
|
onSwipeStart: async () => !0,
|
|
1145
1145
|
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 =
|
|
1146
|
+
let { offset: a } = t, o = a.y, s = Math.max(0, Math.min(56, o)), c = ve(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
1147
|
return i?.(!0, 100), n(r, {
|
|
1148
1148
|
y: f,
|
|
1149
1149
|
opacity: c
|
|
@@ -1160,7 +1160,7 @@ var he = (e, t, n) => {
|
|
|
1160
1160
|
}, { duration: .3 })]), c;
|
|
1161
1161
|
}
|
|
1162
1162
|
}
|
|
1163
|
-
}),
|
|
1163
|
+
}), ye = P({
|
|
1164
1164
|
name: "material",
|
|
1165
1165
|
initial: { y: "100%" },
|
|
1166
1166
|
idle: {
|
|
@@ -1268,7 +1268,7 @@ var he = (e, t, n) => {
|
|
|
1268
1268
|
})]), c;
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
|
-
}),
|
|
1271
|
+
}), I = P({
|
|
1272
1272
|
name: "none",
|
|
1273
1273
|
initial: {},
|
|
1274
1274
|
idle: {
|
|
@@ -1292,10 +1292,10 @@ var he = (e, t, n) => {
|
|
|
1292
1292
|
options: { duration: 0 }
|
|
1293
1293
|
}
|
|
1294
1294
|
}), L = /* @__PURE__ */ new Map([
|
|
1295
|
-
["none",
|
|
1296
|
-
["cupertino",
|
|
1297
|
-
["material",
|
|
1298
|
-
["layout",
|
|
1295
|
+
["none", I],
|
|
1296
|
+
["cupertino", _e],
|
|
1297
|
+
["material", ye],
|
|
1298
|
+
["layout", F]
|
|
1299
1299
|
]);
|
|
1300
1300
|
//#endregion
|
|
1301
1301
|
//#region src/transition/resolveTransition.ts
|
|
@@ -2309,23 +2309,23 @@ mn.onFrameGap = (e) => {
|
|
|
2309
2309
|
};
|
|
2310
2310
|
//#endregion
|
|
2311
2311
|
//#region src/core/engine/types.ts
|
|
2312
|
-
var hn = "data-flemo-skip-animation", Z = () => {}, gn = 400, _n = "data-flemo-part-name",
|
|
2312
|
+
var hn = "data-flemo-skip-animation", Z = () => {}, gn = 400, _n = 100, vn = "data-flemo-part-name", yn = (e) => {
|
|
2313
2313
|
let t = e.parentElement ?? e;
|
|
2314
|
-
return Array.from(t.querySelectorAll(`[${
|
|
2314
|
+
return Array.from(t.querySelectorAll(`[${vn}]`)).filter((n) => {
|
|
2315
2315
|
let r = n.closest("[data-flemo-screen]");
|
|
2316
2316
|
return !r || r === e || !t.contains(r);
|
|
2317
2317
|
});
|
|
2318
|
-
},
|
|
2318
|
+
}, bn = (e, t) => {
|
|
2319
2319
|
let [n, r] = t.split("-");
|
|
2320
|
-
return
|
|
2321
|
-
},
|
|
2320
|
+
return yn(e).filter((e) => e.getAttribute("data-flemo-status") === n && e.getAttribute("data-flemo-active") === r);
|
|
2321
|
+
}, xn = 4, Sn = (e) => `${Math.round(e * 1e3) / 1e3}s`, Cn = (e) => {
|
|
2322
2322
|
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 =
|
|
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 = Sn(e.seconds)), a = !1;
|
|
2324
2324
|
}, s = (e) => {
|
|
2325
2325
|
a || e.target !== t || e.animationName !== n || i === null && (i = performance.now());
|
|
2326
2326
|
}, c = (s) => {
|
|
2327
2327
|
if (a || s.target !== t || s.animationName !== n) return;
|
|
2328
|
-
if (!e.isLive() || e.budgetUsed() >=
|
|
2328
|
+
if (!e.isLive() || e.budgetUsed() >= xn) {
|
|
2329
2329
|
e.onTerminal();
|
|
2330
2330
|
return;
|
|
2331
2331
|
}
|
|
@@ -2355,7 +2355,7 @@ var hn = "data-flemo-skip-animation", Z = () => {}, gn = 400, _n = "data-flemo-p
|
|
|
2355
2355
|
}
|
|
2356
2356
|
};
|
|
2357
2357
|
};
|
|
2358
|
-
function
|
|
2358
|
+
function wn(e) {
|
|
2359
2359
|
let t = /* @__PURE__ */ new Map(), n = null, r = null, i = null, a = null, o = () => {
|
|
2360
2360
|
if (!a) return;
|
|
2361
2361
|
let { land: e, cancel: t } = a;
|
|
@@ -2426,8 +2426,8 @@ function Cn(e) {
|
|
|
2426
2426
|
e && p.push(e);
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
2429
|
-
for (let e of
|
|
2430
|
-
let n = z.get(e.getAttribute(
|
|
2429
|
+
for (let e of bn(a, t)) {
|
|
2430
|
+
let n = z.get(e.getAttribute(vn)), r = n ? V(n, t) : null;
|
|
2431
2431
|
if (!r) continue;
|
|
2432
2432
|
let a = mn.join(i, {
|
|
2433
2433
|
element: e,
|
|
@@ -2439,7 +2439,7 @@ function Cn(e) {
|
|
|
2439
2439
|
return () => p.forEach((e) => e());
|
|
2440
2440
|
}, v = (e, t) => {
|
|
2441
2441
|
let n = [], { decorator: r, bars: i } = l(), a = be(u), o = (e, t, r) => {
|
|
2442
|
-
let i = 0, a =
|
|
2442
|
+
let i = 0, a = Cn({
|
|
2443
2443
|
element: e,
|
|
2444
2444
|
expectedName: t,
|
|
2445
2445
|
motion: r,
|
|
@@ -2457,8 +2457,8 @@ function Cn(e) {
|
|
|
2457
2457
|
let e = R.get(a.decoratorName), n = e ? V(e, t) : null;
|
|
2458
2458
|
n && o(r, W("decorator", a.decoratorName, t), n);
|
|
2459
2459
|
}
|
|
2460
|
-
for (let n of
|
|
2461
|
-
let e = n.getAttribute(
|
|
2460
|
+
for (let n of bn(e, t)) {
|
|
2461
|
+
let e = n.getAttribute(vn), r = z.get(e), i = r ? V(r, t) : null;
|
|
2462
2462
|
i && o(n, W("part", e, t), i);
|
|
2463
2463
|
}
|
|
2464
2464
|
return n;
|
|
@@ -2468,7 +2468,7 @@ function Cn(e) {
|
|
|
2468
2468
|
let { scope: e, decorator: t, bars: n } = l();
|
|
2469
2469
|
if (e) {
|
|
2470
2470
|
q(e);
|
|
2471
|
-
for (let t of
|
|
2471
|
+
for (let t of yn(e)) q(t);
|
|
2472
2472
|
}
|
|
2473
2473
|
t && q(t);
|
|
2474
2474
|
for (let e of n ?? []) e && q(e);
|
|
@@ -2481,7 +2481,7 @@ function Cn(e) {
|
|
|
2481
2481
|
if (n) {
|
|
2482
2482
|
let t = be(u), r = [];
|
|
2483
2483
|
if (G(t, e)) {
|
|
2484
|
-
let i = V(t, e), a = 0, o =
|
|
2484
|
+
let i = V(t, e), a = 0, o = Cn({
|
|
2485
2485
|
element: n,
|
|
2486
2486
|
expectedName: W("screen", u, e),
|
|
2487
2487
|
motion: i,
|
|
@@ -2504,7 +2504,7 @@ function Cn(e) {
|
|
|
2504
2504
|
let { scope: t, decorator: n, bars: r } = l();
|
|
2505
2505
|
if (t) {
|
|
2506
2506
|
q(t), t.removeAttribute(hn);
|
|
2507
|
-
for (let e of
|
|
2507
|
+
for (let e of yn(t)) q(e);
|
|
2508
2508
|
}
|
|
2509
2509
|
n && (q(n), n.removeAttribute(hn));
|
|
2510
2510
|
for (let e of r ?? []) e && (q(e), e.style.removeProperty("will-change"));
|
|
@@ -2532,55 +2532,71 @@ function Cn(e) {
|
|
|
2532
2532
|
b && (m ? s.anchorGate(b) : s.markGateHeld(b));
|
|
2533
2533
|
let T = V(S, C), E = !w && !!T, ee = W("screen", u, C), D, O = () => {
|
|
2534
2534
|
D !== void 0 && (clearTimeout(D), D = void 0);
|
|
2535
|
-
}, te = 0, ne,
|
|
2536
|
-
|
|
2535
|
+
}, te = 0, ne, k = [], A, j = () => {
|
|
2536
|
+
k.forEach((e) => cancelAnimationFrame(e)), k = [], A !== void 0 && clearTimeout(A), A = void 0;
|
|
2537
|
+
}, M = () => {
|
|
2538
|
+
/* v8 ignore next 4 -- every runtime under test has rAF; the guard
|
|
2539
|
+
shields exotic embedders. */
|
|
2540
|
+
if (typeof requestAnimationFrame != "function") {
|
|
2537
2541
|
x();
|
|
2538
2542
|
return;
|
|
2539
2543
|
}
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2544
|
+
A = setTimeout(() => {
|
|
2545
|
+
j(), x();
|
|
2546
|
+
}, _n), k.push(requestAnimationFrame(() => {
|
|
2547
|
+
k.push(requestAnimationFrame(() => {
|
|
2548
|
+
j(), x();
|
|
2549
|
+
}));
|
|
2550
|
+
}));
|
|
2551
|
+
}, re = () => {
|
|
2552
|
+
if (te <= 0) {
|
|
2553
|
+
M();
|
|
2554
|
+
return;
|
|
2555
|
+
}
|
|
2556
|
+
ne = setTimeout(M, te);
|
|
2557
|
+
}, ie = Z, ae = Z, oe = (e) => {
|
|
2558
|
+
e.target === y && e.animationName === ee && (y.removeEventListener("animationend", oe), O(), ie(), re());
|
|
2543
2559
|
};
|
|
2544
|
-
y.addEventListener("animationend",
|
|
2545
|
-
let
|
|
2546
|
-
for (let e of Array.from(y.ownerDocument.querySelectorAll(`[${
|
|
2547
|
-
let t = z.get(e.getAttribute(
|
|
2548
|
-
r &&
|
|
2560
|
+
y.addEventListener("animationend", oe);
|
|
2561
|
+
let se = E && m ? _(C, "active", M) : null, ce = (T.delay + T.duration) * 1e3, le = ce + 1500, ue = b ? setTimeout(() => void s.resolveTask(b), le) : void 0, de = `${f}-false`, N = G(S, de) ? V(S, de) : null, fe = [];
|
|
2562
|
+
for (let e of Array.from(y.ownerDocument.querySelectorAll(`[${vn}][data-flemo-status="${f}"]`))) {
|
|
2563
|
+
let t = z.get(e.getAttribute(vn)), n = `${f}-${e.getAttribute("data-flemo-active")}`, r = t && G(t, n) ? V(t, n) : null;
|
|
2564
|
+
r && fe.push({
|
|
2549
2565
|
element: e,
|
|
2550
2566
|
motion: r
|
|
2551
2567
|
});
|
|
2552
2568
|
}
|
|
2553
|
-
let
|
|
2554
|
-
for (let { motion: e } of
|
|
2555
|
-
te = Math.max(0, Math.min(1e3,
|
|
2556
|
-
let
|
|
2569
|
+
let pe = N ? (N.delay + N.duration) * 1e3 : 0;
|
|
2570
|
+
for (let { motion: e } of fe) pe = Math.max(pe, (e.delay + e.duration) * 1e3);
|
|
2571
|
+
te = Math.max(0, Math.min(1e3, pe - ce));
|
|
2572
|
+
let me = ce + 250, P = () => b !== null && e.getTransitionTaskId() === b && y.isConnected && y.getAttribute("data-flemo-skip-animation") !== "true" && G(S, C), he = Cn({
|
|
2557
2573
|
element: y,
|
|
2558
2574
|
expectedName: ee,
|
|
2559
2575
|
motion: T,
|
|
2560
|
-
isLive:
|
|
2576
|
+
isLive: P,
|
|
2561
2577
|
budgetUsed: () => t.get(b) ?? 0,
|
|
2562
2578
|
spendBudget: () => {
|
|
2563
|
-
|
|
2579
|
+
ae(), t.set(b, (t.get(b) ?? 0) + 1);
|
|
2564
2580
|
},
|
|
2565
2581
|
onTerminal: x
|
|
2566
2582
|
});
|
|
2567
|
-
|
|
2568
|
-
let
|
|
2569
|
-
O(), D = setTimeout(
|
|
2570
|
-
},
|
|
2571
|
-
if (O(),
|
|
2572
|
-
|
|
2583
|
+
ie = he.detach;
|
|
2584
|
+
let ge = !1, _e = () => {
|
|
2585
|
+
O(), D = setTimeout(ve, me);
|
|
2586
|
+
}, ve = () => {
|
|
2587
|
+
if (O(), P() && !ge) {
|
|
2588
|
+
ge = !0, ae(), he.fullRestart(), _e();
|
|
2573
2589
|
return;
|
|
2574
2590
|
}
|
|
2575
2591
|
x();
|
|
2576
|
-
}, F = !
|
|
2577
|
-
F && (
|
|
2578
|
-
let I,
|
|
2592
|
+
}, F = !se && m, ye = F ? v(y, C) : [];
|
|
2593
|
+
F && (he.attach(), b && _e());
|
|
2594
|
+
let I, L = () => {
|
|
2579
2595
|
I !== void 0 && (clearTimeout(I), I = void 0);
|
|
2580
2596
|
};
|
|
2581
|
-
if (
|
|
2582
|
-
let e = typeof window < "u" && window.devicePixelRatio || 1, t = qt(T, y, e), n =
|
|
2583
|
-
for (let { element: t, motion: n } of
|
|
2597
|
+
if (ae = L, F && b) {
|
|
2598
|
+
let e = typeof window < "u" && window.devicePixelRatio || 1, t = qt(T, y, e), n = N ? qt(N, y, e) : 0, r = 0;
|
|
2599
|
+
for (let { element: t, motion: n } of fe) {
|
|
2584
2600
|
let i = qt(n, t, e);
|
|
2585
2601
|
if (i === null) {
|
|
2586
2602
|
r = null;
|
|
@@ -2589,16 +2605,16 @@ function Cn(e) {
|
|
|
2589
2605
|
r = Math.max(r, i);
|
|
2590
2606
|
}
|
|
2591
2607
|
let i = t !== null && n !== null && r !== null ? Math.max(t, n, r) : null;
|
|
2592
|
-
i !== null && i + 17 <
|
|
2593
|
-
I = void 0,
|
|
2608
|
+
i !== null && i + 17 < ce + te && (I = setTimeout(() => {
|
|
2609
|
+
I = void 0, P() && (y.removeEventListener("animationend", oe), O(), ie(), M());
|
|
2594
2610
|
}, i + 17));
|
|
2595
2611
|
}
|
|
2596
2612
|
return () => {
|
|
2597
|
-
if (
|
|
2598
|
-
|
|
2599
|
-
for (let e of
|
|
2613
|
+
if (ue !== void 0 && clearTimeout(ue), ne !== void 0 && clearTimeout(ne), j(), L(), y.removeEventListener("animationend", oe), F) {
|
|
2614
|
+
he.detach();
|
|
2615
|
+
for (let e of ye) e();
|
|
2600
2616
|
}
|
|
2601
|
-
O(),
|
|
2617
|
+
O(), se?.(), b && e.getTransitionTaskId() !== b && t.delete(b);
|
|
2602
2618
|
};
|
|
2603
2619
|
},
|
|
2604
2620
|
activeResumeEntryCount: () => t.size
|
|
@@ -2606,20 +2622,20 @@ function Cn(e) {
|
|
|
2606
2622
|
}
|
|
2607
2623
|
//#endregion
|
|
2608
2624
|
//#region src/utils/findScrollable.ts
|
|
2609
|
-
function
|
|
2610
|
-
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o =
|
|
2625
|
+
function Tn(e, t) {
|
|
2626
|
+
let { direction: n = "x", markerSelector: r = "[data-swipe-at-edge]", depthLimit: i = 24, verifyByScroll: a = !1 } = t ?? {}, o = En(e);
|
|
2611
2627
|
if (!o) return {
|
|
2612
2628
|
element: null,
|
|
2613
2629
|
hasMarker: !1
|
|
2614
2630
|
};
|
|
2615
2631
|
let s = o.closest?.(r);
|
|
2616
|
-
if (s instanceof HTMLElement &&
|
|
2632
|
+
if (s instanceof HTMLElement && Dn(s, n) && (!a || On(s, n))) return {
|
|
2617
2633
|
element: s,
|
|
2618
2634
|
hasMarker: !0
|
|
2619
2635
|
};
|
|
2620
2636
|
let c = o, l = 0;
|
|
2621
2637
|
for (; c && l < i;) {
|
|
2622
|
-
if (
|
|
2638
|
+
if (Dn(c, n) && (!a || On(c, n))) return {
|
|
2623
2639
|
element: c,
|
|
2624
2640
|
hasMarker: !1
|
|
2625
2641
|
};
|
|
@@ -2630,7 +2646,7 @@ function wn(e, t) {
|
|
|
2630
2646
|
hasMarker: !1
|
|
2631
2647
|
};
|
|
2632
2648
|
}
|
|
2633
|
-
function
|
|
2649
|
+
function En(e) {
|
|
2634
2650
|
if (!e) return null;
|
|
2635
2651
|
let t = e, n = typeof t.composedPath == "function" ? t.composedPath() : void 0;
|
|
2636
2652
|
if (n && n.length) {
|
|
@@ -2638,18 +2654,18 @@ function Tn(e) {
|
|
|
2638
2654
|
}
|
|
2639
2655
|
return e instanceof HTMLElement ? e : null;
|
|
2640
2656
|
}
|
|
2641
|
-
function
|
|
2657
|
+
function Dn(e, t) {
|
|
2642
2658
|
return t === "y" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
2643
2659
|
}
|
|
2644
|
-
function
|
|
2645
|
-
if (!
|
|
2660
|
+
function On(e, t) {
|
|
2661
|
+
if (!Dn(e, t) || typeof window > "u") return !1;
|
|
2646
2662
|
let n = window.getComputedStyle(e), r = t === "y" ? n.overflowY : n.overflowX;
|
|
2647
2663
|
return r === "auto" || r === "scroll" || r === "overlay";
|
|
2648
2664
|
}
|
|
2649
2665
|
//#endregion
|
|
2650
2666
|
//#region src/core/engine/createSwipeController.ts
|
|
2651
|
-
var
|
|
2652
|
-
function
|
|
2667
|
+
var kn = "data-flemo-skip-animation";
|
|
2668
|
+
function An(e) {
|
|
2653
2669
|
let t = null, n = null, r = {
|
|
2654
2670
|
current: [],
|
|
2655
2671
|
prev: []
|
|
@@ -2812,7 +2828,7 @@ function kn(e) {
|
|
|
2812
2828
|
}), S("end", e, 0);
|
|
2813
2829
|
}
|
|
2814
2830
|
})) {
|
|
2815
|
-
c?.setAttribute(
|
|
2831
|
+
c?.setAttribute(kn, "true"), l?.setAttribute(kn, "true");
|
|
2816
2832
|
for (let e of r.current) e.style.removeProperty("will-change");
|
|
2817
2833
|
for (let e of r.prev) q(e), e.style.removeProperty("will-change");
|
|
2818
2834
|
r = {
|
|
@@ -2826,10 +2842,10 @@ function kn(e) {
|
|
|
2826
2842
|
};
|
|
2827
2843
|
return {
|
|
2828
2844
|
pointerDown: (t) => {
|
|
2829
|
-
e.isReadyForDrag() && (f =
|
|
2845
|
+
e.isReadyForDrag() && (f = Tn(t.target, {
|
|
2830
2846
|
direction: "x",
|
|
2831
2847
|
verifyByScroll: !0
|
|
2832
|
-
}), p =
|
|
2848
|
+
}), p = Tn(t.target, {
|
|
2833
2849
|
direction: "y",
|
|
2834
2850
|
verifyByScroll: !0
|
|
2835
2851
|
}), m = t.clientX, h = t.clientY, (!f.element && !p.element || f.element || p.element) && (a = !0));
|
|
@@ -2858,7 +2874,7 @@ function kn(e) {
|
|
|
2858
2874
|
}
|
|
2859
2875
|
//#endregion
|
|
2860
2876
|
//#region src/screen/computeBarRiding.ts
|
|
2861
|
-
function
|
|
2877
|
+
function jn(e) {
|
|
2862
2878
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? {
|
|
2863
2879
|
app: !1,
|
|
2864
2880
|
nav: !1
|
|
@@ -2869,31 +2885,31 @@ function An(e) {
|
|
|
2869
2885
|
}
|
|
2870
2886
|
//#endregion
|
|
2871
2887
|
//#region src/screen/pendingNetwork.ts
|
|
2872
|
-
var
|
|
2873
|
-
|
|
2874
|
-
},
|
|
2875
|
-
if (!(
|
|
2876
|
-
if (
|
|
2888
|
+
var Mn = 0, Nn = !1, Pn = () => {
|
|
2889
|
+
Mn = Math.max(0, Mn - 1);
|
|
2890
|
+
}, Fn = () => {
|
|
2891
|
+
if (!(Nn || typeof window > "u")) {
|
|
2892
|
+
if (Nn = !0, typeof window.fetch == "function") {
|
|
2877
2893
|
let e = window.fetch.bind(window);
|
|
2878
2894
|
window.fetch = (...t) => {
|
|
2879
|
-
|
|
2895
|
+
Mn += 1;
|
|
2880
2896
|
let n;
|
|
2881
2897
|
try {
|
|
2882
2898
|
n = e(...t);
|
|
2883
2899
|
} catch (e) {
|
|
2884
|
-
throw
|
|
2900
|
+
throw Pn(), e;
|
|
2885
2901
|
}
|
|
2886
|
-
return n.then((e) => (
|
|
2887
|
-
throw
|
|
2902
|
+
return n.then((e) => (Pn(), e), (e) => {
|
|
2903
|
+
throw Pn(), e;
|
|
2888
2904
|
});
|
|
2889
2905
|
};
|
|
2890
2906
|
}
|
|
2891
2907
|
if (typeof XMLHttpRequest == "function") {
|
|
2892
2908
|
let e = XMLHttpRequest.prototype.send;
|
|
2893
2909
|
XMLHttpRequest.prototype.send = function(...t) {
|
|
2894
|
-
|
|
2910
|
+
Mn += 1;
|
|
2895
2911
|
let n = !1, r = () => {
|
|
2896
|
-
n || (n = !0,
|
|
2912
|
+
n || (n = !0, Pn());
|
|
2897
2913
|
};
|
|
2898
2914
|
this.addEventListener("loadend", r);
|
|
2899
2915
|
try {
|
|
@@ -2904,26 +2920,41 @@ var jn = 0, Mn = !1, Nn = () => {
|
|
|
2904
2920
|
};
|
|
2905
2921
|
}
|
|
2906
2922
|
}
|
|
2907
|
-
},
|
|
2923
|
+
}, In = () => (Fn(), Mn > 0);
|
|
2908
2924
|
//#endregion
|
|
2909
2925
|
//#region src/screen/animStartAnchor.ts
|
|
2910
|
-
function
|
|
2926
|
+
function Ln(e) {
|
|
2911
2927
|
return !(e.status === "PUSHING" || e.status === "POPPING" || e.status === "REPLACING") || !e.isTopOrTopPrev ? null : `${e.status}:${e.transitionName}`;
|
|
2912
2928
|
}
|
|
2913
|
-
var
|
|
2914
|
-
function zn(e) {
|
|
2915
|
-
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, Rn);
|
|
2916
|
-
}
|
|
2929
|
+
var Rn = 300, zn = 20;
|
|
2917
2930
|
function Bn(e) {
|
|
2918
|
-
|
|
2931
|
+
return Array.from(e.querySelectorAll("img")).filter((e) => e.complete && typeof e.decode == "function").slice(0, zn);
|
|
2919
2932
|
}
|
|
2920
|
-
|
|
2933
|
+
function Vn(e) {
|
|
2934
|
+
if (!(!e || typeof e.querySelectorAll != "function")) for (let t of Bn(e)) t.decode().catch(() => {});
|
|
2935
|
+
}
|
|
2936
|
+
var Hn = 3, Un = 40, Wn = 24, Gn = (e) => {
|
|
2921
2937
|
if (typeof e.querySelectorAll != "function") return !1;
|
|
2922
2938
|
let t = e.querySelectorAll("*").length;
|
|
2923
2939
|
/* v8 ignore stop */
|
|
2924
|
-
return t <
|
|
2940
|
+
return t < Wn ? !1 : ((e.textContent ?? "").trim().length + e.querySelectorAll("img").length * Un) / t < Hn;
|
|
2941
|
+
}, Kn = (e) => typeof e.getAnimations == "function" && e.getAnimations({ subtree: !0 }).some((e) => {
|
|
2942
|
+
let t = e.animationName;
|
|
2943
|
+
return typeof t != "string" || !t.startsWith("flemo-");
|
|
2944
|
+
}), qn = (e) => {
|
|
2945
|
+
/* v8 ignore next -- the settle gate only runs a scope past looksLikeShell,
|
|
2946
|
+
which already requires querySelectorAll. */
|
|
2947
|
+
if (typeof e.querySelectorAll != "function") return !1;
|
|
2948
|
+
/* v8 ignore next 2 -- every DOM element implements getBoundingClientRect;
|
|
2949
|
+
the guard shields exotic embedders. */
|
|
2950
|
+
let t = typeof e.getBoundingClientRect == "function" ? e.getBoundingClientRect() : null, n = t && t.height > 0 ? t : null, r = 0;
|
|
2951
|
+
for (let t of Array.from(e.querySelectorAll("img"))) {
|
|
2952
|
+
if (r >= zn) break;
|
|
2953
|
+
if (!(t.loading === "lazy" && !t.currentSrc) && !(n && t.getBoundingClientRect().top - n.top >= n.height) && (r += 1, !t.complete)) return !0;
|
|
2954
|
+
}
|
|
2955
|
+
return !1;
|
|
2925
2956
|
};
|
|
2926
|
-
function
|
|
2957
|
+
function Jn(e, t = {}) {
|
|
2927
2958
|
let n = !1, r = 0, i = [], a = [], o = () => {
|
|
2928
2959
|
if (n) return;
|
|
2929
2960
|
let r = t.scope;
|
|
@@ -2931,7 +2962,7 @@ function Gn(e, t = {}) {
|
|
|
2931
2962
|
e();
|
|
2932
2963
|
return;
|
|
2933
2964
|
}
|
|
2934
|
-
let i =
|
|
2965
|
+
let i = Bn(r);
|
|
2935
2966
|
if (i.length === 0) {
|
|
2936
2967
|
e();
|
|
2937
2968
|
return;
|
|
@@ -2948,29 +2979,29 @@ function Gn(e, t = {}) {
|
|
|
2948
2979
|
e();
|
|
2949
2980
|
return;
|
|
2950
2981
|
}
|
|
2951
|
-
if (!
|
|
2982
|
+
if (!Gn(r)) {
|
|
2952
2983
|
e();
|
|
2953
2984
|
return;
|
|
2954
2985
|
}
|
|
2955
2986
|
/* v8 ignore start -- performance exists in every runtime under test;
|
|
2956
2987
|
the fallback only shields exotic embedders. */
|
|
2957
|
-
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () => {
|
|
2958
|
-
l || (l = !0,
|
|
2959
|
-
}, d = () => {
|
|
2988
|
+
let i = typeof performance < "u" ? performance.now() : 0, o = () => (typeof performance < "u" ? performance.now() : 0) - i, s = [], c = !1, l = !1, u = () => Gn(r) && Kn(r), d = () => In() || qn(r), f = () => {
|
|
2989
|
+
l || (l = !0, h.disconnect(), clearTimeout(g), clearTimeout(_), clearTimeout(v), s.forEach((e) => cancelAnimationFrame(e)), s = [], e());
|
|
2990
|
+
}, p = () => !Gn(r) && !d() ? 2 : 6, m = () => {
|
|
2960
2991
|
s.forEach((e) => cancelAnimationFrame(e)), s = [];
|
|
2961
2992
|
let e = (t) => {
|
|
2962
2993
|
if (t <= 0) {
|
|
2963
|
-
if (
|
|
2964
|
-
s.push(requestAnimationFrame(() => e(
|
|
2994
|
+
if ((d() || u()) && o() < n.capMs) {
|
|
2995
|
+
s.push(requestAnimationFrame(() => e(p())));
|
|
2965
2996
|
return;
|
|
2966
2997
|
}
|
|
2967
|
-
|
|
2998
|
+
f();
|
|
2968
2999
|
return;
|
|
2969
3000
|
}
|
|
2970
3001
|
s.push(requestAnimationFrame(() => e(t - 1)));
|
|
2971
3002
|
};
|
|
2972
|
-
e(
|
|
2973
|
-
},
|
|
3003
|
+
e(p());
|
|
3004
|
+
}, h = new MutationObserver((e) => {
|
|
2974
3005
|
let t = 0;
|
|
2975
3006
|
for (let n of e) if (n.type === "childList") for (let e of Array.from(n.addedNodes)) t += e instanceof Element ? 1 + e.querySelectorAll("*").length : 1;
|
|
2976
3007
|
if (!(t < n.minNodes)) {
|
|
@@ -2978,29 +3009,29 @@ function Gn(e, t = {}) {
|
|
|
2978
3009
|
capMs, so a delivery can never observe elapsed past the cap first;
|
|
2979
3010
|
kept so a delivery racing the timer can only ever finish early. */
|
|
2980
3011
|
if (c = !0, o() >= n.capMs) {
|
|
2981
|
-
|
|
3012
|
+
f();
|
|
2982
3013
|
return;
|
|
2983
3014
|
}
|
|
2984
3015
|
/* v8 ignore stop */
|
|
2985
|
-
|
|
3016
|
+
m();
|
|
2986
3017
|
}
|
|
2987
3018
|
});
|
|
2988
|
-
|
|
3019
|
+
h.observe(r, {
|
|
2989
3020
|
childList: !0,
|
|
2990
3021
|
subtree: !0
|
|
2991
3022
|
});
|
|
2992
|
-
let
|
|
2993
|
-
!c && !
|
|
2994
|
-
}, n.graceMs),
|
|
3023
|
+
let g = setTimeout(() => {
|
|
3024
|
+
!c && !d() && !u() && f();
|
|
3025
|
+
}, n.graceMs), _ = setTimeout(function e() {
|
|
2995
3026
|
if (!c) {
|
|
2996
|
-
if (
|
|
3027
|
+
if ((d() || u()) && o() < n.capMs) {
|
|
2997
3028
|
setTimeout(e, 100);
|
|
2998
3029
|
return;
|
|
2999
3030
|
}
|
|
3000
|
-
|
|
3031
|
+
f();
|
|
3001
3032
|
}
|
|
3002
|
-
}, n.firstWaitMs),
|
|
3003
|
-
a.push(
|
|
3033
|
+
}, n.firstWaitMs), v = setTimeout(f, n.capMs);
|
|
3034
|
+
a.push(f);
|
|
3004
3035
|
}, c = (e) => {
|
|
3005
3036
|
if (e <= 0) {
|
|
3006
3037
|
s(o);
|
|
@@ -3014,13 +3045,14 @@ function Gn(e, t = {}) {
|
|
|
3014
3045
|
n = !0, cancelAnimationFrame(l), r && cancelAnimationFrame(r), i.forEach((e) => cancelAnimationFrame(e)), a.forEach((e) => e());
|
|
3015
3046
|
};
|
|
3016
3047
|
}
|
|
3017
|
-
function
|
|
3018
|
-
let n =
|
|
3048
|
+
function Yn(e, t = {}) {
|
|
3049
|
+
let n = Jn(e, t), r = t.contentSettle?.capMs ?? 0, i = setTimeout(e, 300 + r);
|
|
3019
3050
|
return () => {
|
|
3020
|
-
n(), clearTimeout(
|
|
3051
|
+
n(), clearTimeout(i);
|
|
3021
3052
|
};
|
|
3022
3053
|
}
|
|
3023
|
-
|
|
3054
|
+
var Xn = (e) => 300 + (e?.contentSettle?.capMs ?? 0);
|
|
3055
|
+
function Zn() {
|
|
3024
3056
|
let e = /* @__PURE__ */ new Map(), t = (t, n) => {
|
|
3025
3057
|
clearTimeout(n.backstop), e.delete(t);
|
|
3026
3058
|
let r = [...n.members];
|
|
@@ -3029,17 +3061,25 @@ function qn() {
|
|
|
3029
3061
|
}, n = (e) => [...e.members].every((e) => e.ready);
|
|
3030
3062
|
return { join: (r, i, a) => {
|
|
3031
3063
|
let o = e.get(r);
|
|
3032
|
-
if (
|
|
3033
|
-
let
|
|
3064
|
+
if (o) {
|
|
3065
|
+
let e = Xn(a);
|
|
3066
|
+
if (e > o.backstopMs) {
|
|
3067
|
+
clearTimeout(o.backstop);
|
|
3068
|
+
let n = o;
|
|
3069
|
+
n.backstopMs = e, n.backstop = setTimeout(() => t(r, n), e);
|
|
3070
|
+
}
|
|
3071
|
+
} else {
|
|
3072
|
+
let n = Xn(a), i = {
|
|
3034
3073
|
members: /* @__PURE__ */ new Set(),
|
|
3035
|
-
backstop: setTimeout(() => t(r,
|
|
3074
|
+
backstop: setTimeout(() => t(r, i), n),
|
|
3075
|
+
backstopMs: n
|
|
3036
3076
|
};
|
|
3037
|
-
e.set(r,
|
|
3077
|
+
e.set(r, i), o = i;
|
|
3038
3078
|
}
|
|
3039
3079
|
let s = o, c = {
|
|
3040
3080
|
release: i,
|
|
3041
3081
|
ready: !1,
|
|
3042
|
-
cancelReadiness:
|
|
3082
|
+
cancelReadiness: Jn(() => {
|
|
3043
3083
|
c.ready = !0, n(s) && t(r, s);
|
|
3044
3084
|
}, a)
|
|
3045
3085
|
};
|
|
@@ -3056,7 +3096,7 @@ function qn() {
|
|
|
3056
3096
|
}
|
|
3057
3097
|
//#endregion
|
|
3058
3098
|
//#region src/screen/observeBarHeight.ts
|
|
3059
|
-
function
|
|
3099
|
+
function Qn(e, t) {
|
|
3060
3100
|
e.offsetHeight > 0 && t(e.offsetHeight);
|
|
3061
3101
|
let n = new ResizeObserver(([e]) => {
|
|
3062
3102
|
e.contentRect.height > 0 && t(e.contentRect.height);
|
|
@@ -3067,14 +3107,14 @@ function Jn(e, t) {
|
|
|
3067
3107
|
}
|
|
3068
3108
|
//#endregion
|
|
3069
3109
|
//#region src/screen/observeViewportScrollHeight.ts
|
|
3070
|
-
var
|
|
3071
|
-
function
|
|
3110
|
+
var $n = 0;
|
|
3111
|
+
function er(e) {
|
|
3072
3112
|
let t = 0, n = () => {
|
|
3073
3113
|
cancelAnimationFrame(t), t = requestAnimationFrame(() => {
|
|
3074
3114
|
let t = document.documentElement.scrollHeight - (window.visualViewport?.height || 0);
|
|
3075
3115
|
t = t < 0 ? 0 : t;
|
|
3076
|
-
let n = t -
|
|
3077
|
-
n = n < 0 ? 0 : n,
|
|
3116
|
+
let n = t - $n;
|
|
3117
|
+
n = n < 0 ? 0 : n, $n ||= t, e(t, n);
|
|
3078
3118
|
});
|
|
3079
3119
|
};
|
|
3080
3120
|
return window.visualViewport?.addEventListener("resize", n), window.visualViewport?.addEventListener("scroll", n), () => {
|
|
@@ -3083,30 +3123,30 @@ function Xn(e) {
|
|
|
3083
3123
|
}
|
|
3084
3124
|
//#endregion
|
|
3085
3125
|
//#region src/core/engine/imageDecodeOffloader.ts
|
|
3086
|
-
var
|
|
3126
|
+
var tr = 8, nr = 2, Q = 96, rr = 15e3, ir = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", ar = "data-flemo-image-src", or = "flemo-image-scale-v1", sr = (e) => {
|
|
3087
3127
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0 || e.boxWidth <= 0 || e.boxHeight <= 0) return !1;
|
|
3088
3128
|
let t = e.boxWidth * e.boxHeight * e.devicePixelRatio * e.devicePixelRatio;
|
|
3089
3129
|
return e.naturalWidth * e.naturalHeight > t * 8;
|
|
3090
|
-
},
|
|
3130
|
+
}, cr = "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};", lr = () => typeof Worker < "u" && typeof OffscreenCanvas < "u" && typeof createImageBitmap == "function" && typeof MutationObserver < "u" && typeof URL < "u" && typeof URL.createObjectURL == "function", ur = async (e, t) => {
|
|
3091
3131
|
try {
|
|
3092
3132
|
if (typeof caches > "u") return;
|
|
3093
|
-
await (await caches.open(
|
|
3133
|
+
await (await caches.open(or)).put(e, new Response(t, { headers: { "content-type": t.type } }));
|
|
3094
3134
|
} catch {}
|
|
3095
|
-
},
|
|
3135
|
+
}, dr = async (e) => {
|
|
3096
3136
|
try {
|
|
3097
3137
|
if (typeof caches > "u") return null;
|
|
3098
|
-
let t = await (await caches.open(
|
|
3138
|
+
let t = await (await caches.open(or)).match(e);
|
|
3099
3139
|
return t ? await t.blob() : null;
|
|
3100
3140
|
} catch {
|
|
3101
3141
|
return null;
|
|
3102
3142
|
}
|
|
3103
3143
|
};
|
|
3104
|
-
function
|
|
3105
|
-
if (!
|
|
3144
|
+
function fr(e) {
|
|
3145
|
+
if (!lr()) return () => {};
|
|
3106
3146
|
let t = null, n = !1, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakSet(), s = /* @__PURE__ */ new Set(), c = () => typeof devicePixelRatio == "number" ? devicePixelRatio : 1, l = () => {
|
|
3107
3147
|
if (t) return t;
|
|
3108
3148
|
try {
|
|
3109
|
-
t = new Worker(URL.createObjectURL(new Blob([
|
|
3149
|
+
t = new Worker(URL.createObjectURL(new Blob([cr])));
|
|
3110
3150
|
} catch {
|
|
3111
3151
|
return null;
|
|
3112
3152
|
}
|
|
@@ -3117,7 +3157,7 @@ function cr(e) {
|
|
|
3117
3157
|
return;
|
|
3118
3158
|
}
|
|
3119
3159
|
let o = URL.createObjectURL(n);
|
|
3120
|
-
s.add(o),
|
|
3160
|
+
s.add(o), ur(t, n), u(t, o);
|
|
3121
3161
|
}, t;
|
|
3122
3162
|
}, u = (e, t) => {
|
|
3123
3163
|
r.has(e) || r.set(e, t);
|
|
@@ -3127,12 +3167,12 @@ function cr(e) {
|
|
|
3127
3167
|
if (n) {
|
|
3128
3168
|
if (a.delete(e), clearTimeout(n.timeout), n.detachListeners?.(), n.responsive) {
|
|
3129
3169
|
if (t && t !== "skip") {
|
|
3130
|
-
e.setAttribute(
|
|
3170
|
+
e.setAttribute(ar, n.url), e.removeAttribute("srcset"), e.removeAttribute("sizes");
|
|
3131
3171
|
let r = e.closest("picture");
|
|
3132
3172
|
if (r) for (let e of Array.from(r.querySelectorAll("source"))) e.removeAttribute("srcset");
|
|
3133
3173
|
e.src = t;
|
|
3134
3174
|
}
|
|
3135
|
-
} else e.getAttribute("src") ===
|
|
3175
|
+
} else e.getAttribute("src") === ir && (t && t !== "skip" ? e.src = t : (e.removeAttribute(ar), e.src = n.url));
|
|
3136
3176
|
n.previousVisibility ? e.style.visibility = n.previousVisibility : e.style.removeProperty("visibility");
|
|
3137
3177
|
}
|
|
3138
3178
|
}, f = (e, t, n) => {
|
|
@@ -3140,7 +3180,7 @@ function cr(e) {
|
|
|
3140
3180
|
let a = l();
|
|
3141
3181
|
if (!a) return;
|
|
3142
3182
|
i.add(e);
|
|
3143
|
-
let o = Math.round(Math.max(Q, t * c()) *
|
|
3183
|
+
let o = Math.round(Math.max(Q, t * c()) * nr), s = Math.max(t * n, Q * Q) * c() ** 2;
|
|
3144
3184
|
a.postMessage({
|
|
3145
3185
|
url: e,
|
|
3146
3186
|
targetWidth: o,
|
|
@@ -3152,13 +3192,13 @@ function cr(e) {
|
|
|
3152
3192
|
let t = {
|
|
3153
3193
|
url: "",
|
|
3154
3194
|
previousVisibility: e.style.visibility,
|
|
3155
|
-
timeout: setTimeout(() => d(e, null),
|
|
3195
|
+
timeout: setTimeout(() => d(e, null), rr),
|
|
3156
3196
|
responsive: !0
|
|
3157
3197
|
}, i = () => {
|
|
3158
3198
|
/* v8 ignore next -- consider() only routes elements with an https src
|
|
3159
3199
|
here, so the final fallback arm is unreachable. */
|
|
3160
3200
|
let i = e.currentSrc || e.getAttribute("src") || "", o = e.getBoundingClientRect();
|
|
3161
|
-
if (!(/^https?:/.test(i) &&
|
|
3201
|
+
if (!(/^https?:/.test(i) && sr({
|
|
3162
3202
|
naturalWidth: e.naturalWidth,
|
|
3163
3203
|
naturalHeight: e.naturalHeight,
|
|
3164
3204
|
boxWidth: o.width || Q,
|
|
@@ -3174,7 +3214,7 @@ function cr(e) {
|
|
|
3174
3214
|
d(e, l);
|
|
3175
3215
|
return;
|
|
3176
3216
|
}
|
|
3177
|
-
|
|
3217
|
+
dr(i).then((t) => {
|
|
3178
3218
|
if (!(n || !a.has(e))) {
|
|
3179
3219
|
/* v8 ignore start -- a verdict can only appear via settle(), which
|
|
3180
3220
|
releases every held element of the url first, so a still-held
|
|
@@ -3213,14 +3253,14 @@ function cr(e) {
|
|
|
3213
3253
|
let i = r.get(t);
|
|
3214
3254
|
if (i !== "skip") {
|
|
3215
3255
|
if (i) {
|
|
3216
|
-
e.setAttribute(
|
|
3256
|
+
e.setAttribute(ar, t), e.src = i;
|
|
3217
3257
|
return;
|
|
3218
3258
|
}
|
|
3219
3259
|
a.set(e, {
|
|
3220
3260
|
url: t,
|
|
3221
3261
|
previousVisibility: e.style.visibility,
|
|
3222
|
-
timeout: setTimeout(() => d(e, null),
|
|
3223
|
-
}), e.style.visibility = "hidden", e.setAttribute(
|
|
3262
|
+
timeout: setTimeout(() => d(e, null), rr)
|
|
3263
|
+
}), e.style.visibility = "hidden", e.setAttribute(ar, t), e.src = ir, dr(t).then((i) => {
|
|
3224
3264
|
if (n || r.has(t)) return;
|
|
3225
3265
|
if (i) {
|
|
3226
3266
|
let e = URL.createObjectURL(i);
|
|
@@ -3252,9 +3292,9 @@ function cr(e) {
|
|
|
3252
3292
|
};
|
|
3253
3293
|
}
|
|
3254
3294
|
var $ = null;
|
|
3255
|
-
function
|
|
3295
|
+
function pr() {
|
|
3256
3296
|
return typeof document > "u" || !document.body ? () => {} : ($ ? $.count += 1 : $ = {
|
|
3257
|
-
dispose:
|
|
3297
|
+
dispose: fr(document.body),
|
|
3258
3298
|
count: 1
|
|
3259
3299
|
}, () => {
|
|
3260
3300
|
$ && (--$.count, $.count <= 0 && ($.dispose(), $ = null));
|
|
@@ -3262,7 +3302,7 @@ function lr() {
|
|
|
3262
3302
|
}
|
|
3263
3303
|
//#endregion
|
|
3264
3304
|
//#region src/utils/isOpaqueColor.ts
|
|
3265
|
-
function
|
|
3305
|
+
function mr(e) {
|
|
3266
3306
|
let t = e.trim().toLowerCase();
|
|
3267
3307
|
if (t === "transparent" || t === "") return !1;
|
|
3268
3308
|
if (t.match(/^rgb\(\s*\d+[\s,]+\d+[\s,]+\d+\s*\)$/)) return !0;
|
|
@@ -3273,7 +3313,7 @@ function ur(e) {
|
|
|
3273
3313
|
}
|
|
3274
3314
|
//#endregion
|
|
3275
3315
|
//#region src/utils/buildRoutePath.ts
|
|
3276
|
-
function
|
|
3316
|
+
function hr(e, n) {
|
|
3277
3317
|
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();
|
|
3278
3318
|
return {
|
|
3279
3319
|
pathname: `${a}${c ? `?${c}` : ""}`,
|
|
@@ -3281,4 +3321,4 @@ function dr(e, n) {
|
|
|
3281
3321
|
};
|
|
3282
3322
|
}
|
|
3283
3323
|
//#endregion
|
|
3284
|
-
export {
|
|
3324
|
+
export { Rn as ANIM_HOLD_RELEASE_BACKSTOP_MS, ar as OFFLOADED_SRC_ATTR, tr as OVERSIZE_AREA_RATIO, hn as SKIP_ANIMATION_ATTR, s as TaskManger, Ln as animHoldKey, J as animateInline, W as animationName, ae as appendParamsQuery, rt as applyTransitionStyles, hr as buildRoutePath, On as canProgrammaticallyScroll, q as clearInlineAnimation, We as collectAnimatedProperties, $e as compileTransitionStyles, jn as computeBarRiding, me as computeScreenFreeze, b as consumeSelfInducedPop, Zn as createAnimHoldCoordinator, g as createBrowserHistoryDriver, xe as createDecorator, c as createHistoryStore, x as createHistorySync, fr as createImageDecodeOffloader, ne as createMemoryHistoryDriver, k as createNavigateStore, re as createNavigationController, Te as createPartTransition, Se as createRawDecorator, Ee as createRawPartTransition, he as createRawTransition, fe as createRouterScope, pe as createScreenSelector, ue as createScreenStore, _ as createSelfPopGuard, oe as createStepController, An as createSwipeController, P as createTransition, wn as createTransitionEngine, ce as createTransitionStore, _e as cupertino, R as decoratorMap, Vn as eagerlyDecodeImages, Ge as easingToCss, pr as ensureImageDecodeOffloader, O as ensureScopeHistorySync, p as ensureWindowHistoryState, ut as enteringInitialStyle, Tn as findScrollable, l as getMatchedPathPattern, u as getParams, It as holdCompositorWarm, mr as isOpaqueColor, f as isServer, F as layout, y as markSelfInducedPop, le as matchesPathname, ye as material, I as none, Qn as observeBarHeight, er as observeViewportScrollHeight, Dn as overflowsAxis, we as overlay, z as partTransitionMap, ie as readStepParams, lt as registerTransitionDefinitions, te as releaseScopeHistorySync, be as resolveTransition, Yn as scheduleAnimHoldRelease, d as seedInitialHistory, m as seedRouterEntry, sr as shouldOffloadImage, se as subscribeStepParamsRestore, H as targetToDecls, L as transitionMap, G as variantHasAnimation };
|
package/package.json
CHANGED