@react-motion-router/core 2.0.0-beta.sha-0daf7c7 → 2.0.0-beta.sha-4fafa70
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/build/NavigationBase.d.ts +0 -1
- package/build/RouterBase.d.ts +7 -1
- package/build/ScreenBase.d.ts +8 -2
- package/build/__tests__/match-route.test.d.ts +1 -0
- package/build/common/types.d.ts +2 -1
- package/build/index.js +293 -293
- package/build/index.js.map +1 -1
- package/package.json +8 -4
package/build/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as T, jsxs as Gt, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
const
|
|
4
|
-
class
|
|
2
|
+
import { createContext as it, Component as st, createRef as K, lazy as le, cloneElement as Ht, Suspense as Tt, isValidElement as Xt, Children as jt, useContext as vt, useDebugValue as ce } from "react";
|
|
3
|
+
const Zt = it(null);
|
|
4
|
+
class Be extends st {
|
|
5
5
|
ref = K();
|
|
6
|
-
static contextType =
|
|
6
|
+
static contextType = Zt;
|
|
7
7
|
componentDidMount() {
|
|
8
8
|
this.scene.addNode(this);
|
|
9
9
|
}
|
|
@@ -63,18 +63,19 @@ function bt(s, t) {
|
|
|
63
63
|
const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(-1) ?? "";
|
|
64
64
|
return new URL(t.replace(a, ""), window.location.origin);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Yt(s, t, e = `${window.location.origin}/`, n = !0) {
|
|
67
67
|
n || (s = s.toLowerCase(), t = t.toLowerCase());
|
|
68
68
|
const r = bt(e, t)?.href;
|
|
69
69
|
if (!r)
|
|
70
70
|
return null;
|
|
71
71
|
const a = new URLPattern({ baseURL: r, pathname: s }).exec({ pathname: t, baseURL: r }), o = a?.pathname.groups ?? {};
|
|
72
72
|
return a ? {
|
|
73
|
-
params: o
|
|
73
|
+
params: o,
|
|
74
|
+
caseSensitive: n
|
|
74
75
|
} : null;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
-
return s.some(({ pattern: n, caseSensitive: r }) =>
|
|
77
|
+
function Ke(s, t, e = window.location.origin) {
|
|
78
|
+
return s.some(({ pattern: n, caseSensitive: r }) => Yt(n, t, e, r));
|
|
78
79
|
}
|
|
79
80
|
function he(s, t = window) {
|
|
80
81
|
return new Promise((e) => {
|
|
@@ -83,17 +84,17 @@ function he(s, t = window) {
|
|
|
83
84
|
));
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function qe(s) {
|
|
87
88
|
const t = le(s);
|
|
88
89
|
return t.load = async () => (t.module ??= await s(), t.module), t;
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function ze() {
|
|
91
92
|
return !!window.navigation;
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
+
function Ge() {
|
|
94
95
|
return !!globalThis.URLPattern;
|
|
95
96
|
}
|
|
96
|
-
async function
|
|
97
|
+
async function He() {
|
|
97
98
|
const { URLPattern: s } = await import(
|
|
98
99
|
/*webpackIgnore: true*/
|
|
99
100
|
"urlpattern-polyfill"
|
|
@@ -122,8 +123,8 @@ async function ue(s) {
|
|
|
122
123
|
function de(s) {
|
|
123
124
|
return s.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
-
return
|
|
126
|
+
function Ze(s, t) {
|
|
127
|
+
return Ht(s, t);
|
|
127
128
|
}
|
|
128
129
|
class pe extends Event {
|
|
129
130
|
constructor() {
|
|
@@ -140,7 +141,7 @@ class me extends Event {
|
|
|
140
141
|
super("transition-end");
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
class
|
|
144
|
+
class Ye extends Event {
|
|
144
145
|
constructor() {
|
|
145
146
|
super("motion-progress-start");
|
|
146
147
|
}
|
|
@@ -151,7 +152,7 @@ class ge extends Event {
|
|
|
151
152
|
super("motion-progress"), this.progress = t;
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
|
-
class
|
|
155
|
+
class _e extends Event {
|
|
155
156
|
constructor() {
|
|
156
157
|
super("motion-progress-end");
|
|
157
158
|
}
|
|
@@ -234,10 +235,10 @@ class ye extends Event {
|
|
|
234
235
|
return this.#i;
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
|
-
const
|
|
238
|
-
class ve extends
|
|
238
|
+
const _t = it(null);
|
|
239
|
+
class ve extends st {
|
|
239
240
|
ref = K();
|
|
240
|
-
static contextType =
|
|
241
|
+
static contextType = _t;
|
|
241
242
|
index = 0;
|
|
242
243
|
exiting = !1;
|
|
243
244
|
state = {
|
|
@@ -256,9 +257,9 @@ class ve extends it {
|
|
|
256
257
|
this.props.navigation.removeEventListener("transition-start", this.onAnimationStart), this.props.navigation.removeEventListener("transition-end", this.onAnimationEnd), this.props.navigation.removeEventListener("transition-cancel", this.onAnimationEnd);
|
|
257
258
|
}
|
|
258
259
|
get animationEffect() {
|
|
259
|
-
const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index: c, exiting: g, ref:
|
|
260
|
+
const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index: c, exiting: g, ref: f } = this;
|
|
260
261
|
return t?.({
|
|
261
|
-
ref:
|
|
262
|
+
ref: f.current,
|
|
262
263
|
index: c,
|
|
263
264
|
exiting: g,
|
|
264
265
|
timeline: a,
|
|
@@ -291,7 +292,7 @@ class ve extends it {
|
|
|
291
292
|
);
|
|
292
293
|
}
|
|
293
294
|
}
|
|
294
|
-
const
|
|
295
|
+
const Jt = it(null), wt = it(null), Qt = it(null);
|
|
295
296
|
class we {
|
|
296
297
|
id;
|
|
297
298
|
nodes = /* @__PURE__ */ new Map();
|
|
@@ -327,12 +328,12 @@ class we {
|
|
|
327
328
|
return !this.nodes.size;
|
|
328
329
|
}
|
|
329
330
|
}
|
|
330
|
-
class Ee extends
|
|
331
|
+
class Ee extends st {
|
|
331
332
|
sharedElementScene;
|
|
332
333
|
#t = K();
|
|
333
334
|
ref = K();
|
|
334
335
|
nestedRouterData;
|
|
335
|
-
static contextType =
|
|
336
|
+
static contextType = wt;
|
|
336
337
|
state = {
|
|
337
338
|
focused: !1,
|
|
338
339
|
config: {},
|
|
@@ -352,7 +353,7 @@ class Ee extends it {
|
|
|
352
353
|
return this.state.focused;
|
|
353
354
|
}
|
|
354
355
|
get name() {
|
|
355
|
-
return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") :
|
|
356
|
+
return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : F(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
|
|
356
357
|
}
|
|
357
358
|
blur() {
|
|
358
359
|
return new Promise((t) => this.setState({ focused: !1 }, t));
|
|
@@ -361,15 +362,16 @@ class Ee extends it {
|
|
|
361
362
|
return new Promise((t) => this.setState({ focused: !0 }, t));
|
|
362
363
|
}
|
|
363
364
|
async load(t) {
|
|
364
|
-
let e = this.props.component, n;
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
return await this.props.config?.onLoad?.({ navigation:
|
|
365
|
+
let e = this.props.component, n = this.props.config?.header?.component, r = this.props.config?.footer?.component, a;
|
|
366
|
+
F(e) ? a = await e.load() : a = { default: e }, F(n) && await n.load(), F(r) && await r.load();
|
|
367
|
+
const o = this.context.navigation, c = this.routeProp, g = !1;
|
|
368
|
+
return await this.props.config?.onLoad?.({ navigation: o, route: c, signal: t, preloading: g }), a;
|
|
368
369
|
}
|
|
369
370
|
async onExited(t) {
|
|
370
371
|
await this.routeProp.config.onExited?.({
|
|
371
372
|
route: this.routeProp,
|
|
372
373
|
navigation: this.context.navigation,
|
|
374
|
+
preloading: !1,
|
|
373
375
|
signal: t
|
|
374
376
|
});
|
|
375
377
|
}
|
|
@@ -377,6 +379,7 @@ class Ee extends it {
|
|
|
377
379
|
await this.routeProp.config.onExit?.({
|
|
378
380
|
route: this.routeProp,
|
|
379
381
|
navigation: this.context.navigation,
|
|
382
|
+
preloading: !1,
|
|
380
383
|
signal: t
|
|
381
384
|
});
|
|
382
385
|
}
|
|
@@ -384,6 +387,7 @@ class Ee extends it {
|
|
|
384
387
|
await this.routeProp.config.onEnter?.({
|
|
385
388
|
route: this.routeProp,
|
|
386
389
|
navigation: this.context.navigation,
|
|
390
|
+
preloading: !1,
|
|
387
391
|
signal: t
|
|
388
392
|
});
|
|
389
393
|
}
|
|
@@ -391,6 +395,7 @@ class Ee extends it {
|
|
|
391
395
|
await this.routeProp.config.onEntered?.({
|
|
392
396
|
route: this.routeProp,
|
|
393
397
|
navigation: this.context.navigation,
|
|
398
|
+
preloading: !1,
|
|
394
399
|
signal: t
|
|
395
400
|
});
|
|
396
401
|
}
|
|
@@ -424,10 +429,10 @@ class Ee extends it {
|
|
|
424
429
|
flexDirection: "column",
|
|
425
430
|
pointerEvents: "inherit"
|
|
426
431
|
},
|
|
427
|
-
children: /* @__PURE__ */ T(
|
|
428
|
-
/* @__PURE__ */ T(
|
|
429
|
-
/* @__PURE__ */ T(
|
|
430
|
-
/* @__PURE__ */ T(
|
|
432
|
+
children: /* @__PURE__ */ T(Zt.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ T(Qt.Provider, { value: e, children: /* @__PURE__ */ Gt(Jt.Provider, { value: this.nestedRouterData, children: [
|
|
433
|
+
/* @__PURE__ */ T(Tt, { fallback: /* @__PURE__ */ T(Z, { component: e.config.header?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(Z, { component: r, route: e, navigation: t }) }),
|
|
434
|
+
/* @__PURE__ */ T(Tt, { fallback: /* @__PURE__ */ T(Z, { component: this.props.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(Z, { component: n, route: e, navigation: t }) }),
|
|
435
|
+
/* @__PURE__ */ T(Tt, { fallback: /* @__PURE__ */ T(Z, { component: e.config.footer?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ T(Z, { component: a, route: e, navigation: t }) })
|
|
431
436
|
] }) }) })
|
|
432
437
|
}
|
|
433
438
|
)
|
|
@@ -435,41 +440,41 @@ class Ee extends it {
|
|
|
435
440
|
);
|
|
436
441
|
}
|
|
437
442
|
}
|
|
438
|
-
function
|
|
439
|
-
|
|
443
|
+
function Z({ component: s, route: t, navigation: e }) {
|
|
444
|
+
F(s) && s.module?.default && (s = s.module.default);
|
|
440
445
|
const n = s ?? null;
|
|
441
|
-
return typeof n == "function" ||
|
|
446
|
+
return typeof n == "function" || te(n) ? /* @__PURE__ */ T(
|
|
442
447
|
n,
|
|
443
448
|
{
|
|
444
449
|
navigation: e,
|
|
445
450
|
route: t
|
|
446
451
|
}
|
|
447
|
-
) :
|
|
452
|
+
) : Xt(n) ? Ht(n, {
|
|
448
453
|
navigation: e,
|
|
449
454
|
route: t
|
|
450
455
|
}) : /* @__PURE__ */ T(oe, { children: n });
|
|
451
456
|
}
|
|
452
|
-
function
|
|
453
|
-
return
|
|
457
|
+
function Te(s) {
|
|
458
|
+
return Xt(s) ? Object.getPrototypeOf(s.type) === Ee : !1;
|
|
454
459
|
}
|
|
455
|
-
function
|
|
460
|
+
function te(s) {
|
|
456
461
|
return typeof s == "object" && s !== null && s.$$typeof === Symbol.for("react.lazy");
|
|
457
462
|
}
|
|
458
|
-
function
|
|
459
|
-
return
|
|
463
|
+
function F(s) {
|
|
464
|
+
return te(s) && "load" in s;
|
|
460
465
|
}
|
|
461
466
|
function be(s) {
|
|
462
467
|
return "style" in s && s.style instanceof CSSStyleDeclaration;
|
|
463
468
|
}
|
|
464
|
-
var
|
|
469
|
+
var Se = Object.defineProperty, Re = (s, t, e) => t in s ? Se(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, j = (s, t, e) => (Re(s, typeof t != "symbol" ? t + "" : t, e), e), Wt = (s, t, e) => {
|
|
465
470
|
if (!t.has(s))
|
|
466
471
|
throw TypeError("Cannot " + e);
|
|
467
472
|
}, i = (s, t, e) => (Wt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), m = (s, t, e) => {
|
|
468
473
|
if (t.has(s))
|
|
469
474
|
throw TypeError("Cannot add the same private member more than once");
|
|
470
475
|
t instanceof WeakSet ? t.add(s) : t.set(s, e);
|
|
471
|
-
}, l = (s, t, e, n) => (Wt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e),
|
|
472
|
-
const
|
|
476
|
+
}, l = (s, t, e, n) => (Wt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), p = (s, t, e) => (Wt(s, t, "access private method"), e);
|
|
477
|
+
const ut = {
|
|
473
478
|
delay: 0,
|
|
474
479
|
direction: "normal",
|
|
475
480
|
duration: "auto",
|
|
@@ -478,19 +483,19 @@ const ht = {
|
|
|
478
483
|
fill: "auto",
|
|
479
484
|
iterationStart: 0,
|
|
480
485
|
iterations: 1
|
|
481
|
-
}, It = 1e3,
|
|
486
|
+
}, It = 1e3, ke = window.Animation, dt = window.KeyframeEffect;
|
|
482
487
|
function Ft(s) {
|
|
483
488
|
return Array.isArray(s);
|
|
484
489
|
}
|
|
485
|
-
function
|
|
490
|
+
function H(s) {
|
|
486
491
|
return typeof s == "object" && s === null;
|
|
487
492
|
}
|
|
488
493
|
function h(s, t) {
|
|
489
|
-
return
|
|
494
|
+
return H(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
|
|
490
495
|
}
|
|
491
|
-
function
|
|
496
|
+
function xe(s, t = ut) {
|
|
492
497
|
let { duration: e = "auto", iterations: n = 1, playbackRate: r = 1 } = t;
|
|
493
|
-
if (
|
|
498
|
+
if (H(s))
|
|
494
499
|
return s;
|
|
495
500
|
if (typeof s == "number" || s.type().percent === void 0)
|
|
496
501
|
throw new DOMException(
|
|
@@ -504,14 +509,14 @@ function ke(s, t = ht) {
|
|
|
504
509
|
else if (typeof e == "string")
|
|
505
510
|
throw new TypeError("Unknown effect duration keyword.");
|
|
506
511
|
const { delay: a = 0, endDelay: o = 0 } = t, c = e / n * n / Math.abs(r), g = a + c + o;
|
|
507
|
-
return
|
|
512
|
+
return rt(
|
|
508
513
|
s.to("percent").value,
|
|
509
514
|
[0, 100],
|
|
510
515
|
[0, g]
|
|
511
516
|
);
|
|
512
517
|
}
|
|
513
|
-
function
|
|
514
|
-
if (
|
|
518
|
+
function Et(s) {
|
|
519
|
+
if (H(s) || typeof s == "number")
|
|
515
520
|
return s;
|
|
516
521
|
if (s.type().time !== void 0)
|
|
517
522
|
throw new DOMException(
|
|
@@ -524,31 +529,31 @@ function Bt(s, t) {
|
|
|
524
529
|
const e = t.length - 1, n = Math.floor(s * e), r = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
|
|
525
530
|
return r + o * (a - r);
|
|
526
531
|
}
|
|
527
|
-
function
|
|
532
|
+
function Ce(s, t, e) {
|
|
528
533
|
let n = 0, r = 0;
|
|
529
534
|
for (const [a, o] of Object.entries(s)) {
|
|
530
|
-
const { min: c, max: g } = t,
|
|
531
|
-
n += w, r +=
|
|
535
|
+
const { min: c, max: g } = t, f = e[a] ?? 1, w = (o - c[a]) / (g[a] - c[a]) * f;
|
|
536
|
+
n += w, r += f;
|
|
532
537
|
}
|
|
533
538
|
return n / r;
|
|
534
539
|
}
|
|
535
|
-
function
|
|
540
|
+
function rt(s, t, e, n = {}) {
|
|
536
541
|
let r;
|
|
537
542
|
if (typeof s == "number" && Ft(t)) {
|
|
538
543
|
const o = { x: t[0] }, c = { x: t[1] };
|
|
539
544
|
t = { min: o, max: c }, s = { x: s };
|
|
540
545
|
} else
|
|
541
546
|
throw new TypeError("Input and input range must have the same dimensions.");
|
|
542
|
-
if (r =
|
|
547
|
+
if (r = Ce(s, t, n), r = Me(r, 0, 1), Ft(e))
|
|
543
548
|
return Bt(r, e);
|
|
544
549
|
const a = {};
|
|
545
550
|
for (const o of Object.keys(e.min)) {
|
|
546
|
-
const c = e.min[o], g = e.max[o],
|
|
547
|
-
a[o] = Bt(r,
|
|
551
|
+
const c = e.min[o], g = e.max[o], f = [c, g];
|
|
552
|
+
a[o] = Bt(r, f);
|
|
548
553
|
}
|
|
549
554
|
return a;
|
|
550
555
|
}
|
|
551
|
-
function
|
|
556
|
+
function Me(s, t, e) {
|
|
552
557
|
return s < t ? t : e && s > e ? e : s;
|
|
553
558
|
}
|
|
554
559
|
function $t(s) {
|
|
@@ -568,13 +573,13 @@ function $t(s) {
|
|
|
568
573
|
t = t.to("ms").value;
|
|
569
574
|
else if (typeof t == "string")
|
|
570
575
|
throw TypeError("Unknown effect duration keyword.");
|
|
571
|
-
const
|
|
572
|
-
t = new CSSUnitValue(
|
|
573
|
-
const
|
|
576
|
+
const f = t / e, w = f * e / Math.abs(n), k = r + w + a;
|
|
577
|
+
t = new CSSUnitValue(f / k * 100, "percent");
|
|
578
|
+
const b = CSS.percent(t.to("percent").value * e / Math.abs(n));
|
|
574
579
|
return o !== null && (c = h(o, "percent") / g.value), {
|
|
575
580
|
...s,
|
|
576
581
|
progress: c,
|
|
577
|
-
activeDuration:
|
|
582
|
+
activeDuration: b,
|
|
578
583
|
duration: t,
|
|
579
584
|
iterations: e,
|
|
580
585
|
delay: r,
|
|
@@ -589,7 +594,7 @@ function ee(s, t) {
|
|
|
589
594
|
const o = Math.max(Math.min(a, r), 0), c = Math.max(Math.min(a + e, r), 0);
|
|
590
595
|
return n < o || t === "backwards" && n === o ? "before" : n > c || t === "forwards" && n === c ? "after" : "active";
|
|
591
596
|
}
|
|
592
|
-
function
|
|
597
|
+
function Le(s, t) {
|
|
593
598
|
let { localTime: e = null, delay: n = 0, activeDuration: r = 0, fill: a } = s;
|
|
594
599
|
if (r = h(r), e = h(e), e == null || e === void 0)
|
|
595
600
|
return null;
|
|
@@ -604,38 +609,38 @@ function Me(s, t) {
|
|
|
604
609
|
return null;
|
|
605
610
|
}
|
|
606
611
|
}
|
|
607
|
-
function
|
|
612
|
+
function Pe(s, t, e) {
|
|
608
613
|
const { duration: n = 0, iterations: r = 1, iterationStart: a = 0 } = s;
|
|
609
614
|
if (typeof n != "number")
|
|
610
615
|
throw new TypeError("Duration cannot be unresolved");
|
|
611
616
|
let o = 0;
|
|
612
|
-
return n === 0 ? t === "before" ? o = 0 : o = r : o = e /
|
|
617
|
+
return n === 0 ? t === "before" ? o = 0 : o = r : o = e / Et(n), o + a;
|
|
613
618
|
}
|
|
614
|
-
function
|
|
619
|
+
function De(s, t, e, n) {
|
|
615
620
|
const { iterations: r = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
|
|
616
|
-
if (
|
|
621
|
+
if (H(e))
|
|
617
622
|
return null;
|
|
618
623
|
let c = 0;
|
|
619
624
|
return e === 1 / 0 && (c = a % 1), c === 0 && (t === "active" || t === "after") && o === n && r !== 0 && (c = 1), c;
|
|
620
625
|
}
|
|
621
626
|
function ne(s, t) {
|
|
622
|
-
const { iterations: e = 1 } = s, n =
|
|
623
|
-
if (
|
|
627
|
+
const { iterations: e = 1 } = s, n = Le(s, t);
|
|
628
|
+
if (H(n))
|
|
624
629
|
return null;
|
|
625
630
|
if (t === "after" && e === 1 / 0)
|
|
626
631
|
return 1 / 0;
|
|
627
|
-
const r =
|
|
628
|
-
return
|
|
632
|
+
const r = Pe(s, t, n);
|
|
633
|
+
return De(s, t, r, n) === 1 ? Math.floor(r) - 1 : Math.floor(r);
|
|
629
634
|
}
|
|
630
|
-
class
|
|
635
|
+
class Ae extends Event {
|
|
631
636
|
constructor(t) {
|
|
632
637
|
super("update", { bubbles: !1, cancelable: !1, composed: !1 }), j(this, "currentTime"), this.currentTime = t;
|
|
633
638
|
}
|
|
634
639
|
}
|
|
635
|
-
var N,
|
|
636
|
-
class
|
|
640
|
+
var N, Y;
|
|
641
|
+
class E extends EventTarget {
|
|
637
642
|
constructor(t = { type: "swipe", axis: "x", rangeStart: 0, rangeEnd: window.screen.availWidth, source: document.body }) {
|
|
638
|
-
super(), m(this, N, void 0), m(this,
|
|
643
|
+
super(), m(this, N, void 0), m(this, Y, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), l(this, Y, CSS.percent(0)), l(this, N, t);
|
|
639
644
|
}
|
|
640
645
|
onGesture(t) {
|
|
641
646
|
const e = i(this, N).source.getBoundingClientRect();
|
|
@@ -647,7 +652,7 @@ class b extends EventTarget {
|
|
|
647
652
|
switch (i(this, N).type) {
|
|
648
653
|
case "swipe": {
|
|
649
654
|
const { rangeStart: a, rangeEnd: o } = i(this, N), c = i(this, N).axis;
|
|
650
|
-
n =
|
|
655
|
+
n = rt(
|
|
651
656
|
r[c],
|
|
652
657
|
[h(a, "px"), h(o, "px")],
|
|
653
658
|
[0, 100]
|
|
@@ -656,7 +661,7 @@ class b extends EventTarget {
|
|
|
656
661
|
}
|
|
657
662
|
case "pan": {
|
|
658
663
|
const { rangeStart: a, rangeEnd: o } = i(this, N), { x: c, y: g } = r;
|
|
659
|
-
n =
|
|
664
|
+
n = rt(
|
|
660
665
|
{ x: c, y: g },
|
|
661
666
|
{
|
|
662
667
|
min: { x: h(a.x, "px"), y: h(a.y, "px") },
|
|
@@ -669,7 +674,7 @@ class b extends EventTarget {
|
|
|
669
674
|
}
|
|
670
675
|
case "pinch": {
|
|
671
676
|
const { rangeStart: a, rangeEnd: o } = i(this, N), { scale: c } = t;
|
|
672
|
-
n =
|
|
677
|
+
n = rt(
|
|
673
678
|
c,
|
|
674
679
|
[h(a, ""), h(o, "")],
|
|
675
680
|
// figure out which unit
|
|
@@ -679,14 +684,14 @@ class b extends EventTarget {
|
|
|
679
684
|
}
|
|
680
685
|
case "rotate": {
|
|
681
686
|
const { rangeStart: a, rangeEnd: o } = i(this, N), { rotation: c } = t;
|
|
682
|
-
n =
|
|
687
|
+
n = rt(
|
|
683
688
|
c,
|
|
684
689
|
[h(a, "deg"), h(o, "deg")],
|
|
685
690
|
[0, 100]
|
|
686
691
|
);
|
|
687
692
|
}
|
|
688
693
|
}
|
|
689
|
-
l(this,
|
|
694
|
+
l(this, Y, CSS.percent(n)), this.dispatchEvent(new Ae(i(this, Y)));
|
|
690
695
|
}
|
|
691
696
|
addEventListener(t, e, n) {
|
|
692
697
|
super.addEventListener(t, e, n);
|
|
@@ -695,26 +700,26 @@ class b extends EventTarget {
|
|
|
695
700
|
super.removeEventListener(t, e, n);
|
|
696
701
|
}
|
|
697
702
|
get currentTime() {
|
|
698
|
-
return i(this,
|
|
703
|
+
return i(this, Y);
|
|
699
704
|
}
|
|
700
705
|
get phase() {
|
|
701
706
|
return "active";
|
|
702
707
|
}
|
|
703
708
|
}
|
|
704
|
-
N = /* @__PURE__ */ new WeakMap(),
|
|
709
|
+
N = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
|
|
705
710
|
const A = /* @__PURE__ */ new WeakMap();
|
|
706
|
-
var
|
|
707
|
-
class
|
|
711
|
+
var at;
|
|
712
|
+
class pt extends dt {
|
|
708
713
|
constructor(t, e = null) {
|
|
709
|
-
super(t), m(this,
|
|
714
|
+
super(t), m(this, at, null), l(this, at, e);
|
|
710
715
|
}
|
|
711
716
|
get parent() {
|
|
712
|
-
return i(this,
|
|
717
|
+
return i(this, at);
|
|
713
718
|
}
|
|
714
719
|
getTiming() {
|
|
715
720
|
var t;
|
|
716
721
|
const e = super.getTiming();
|
|
717
|
-
if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof
|
|
722
|
+
if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof E) {
|
|
718
723
|
if (e.duration === 1 / 0)
|
|
719
724
|
throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
|
|
720
725
|
if (e.iterations === 1 / 0)
|
|
@@ -725,7 +730,7 @@ class dt extends ut {
|
|
|
725
730
|
getComputedTiming() {
|
|
726
731
|
var t;
|
|
727
732
|
const e = super.getComputedTiming();
|
|
728
|
-
if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof
|
|
733
|
+
if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof E) {
|
|
729
734
|
if (e.duration === 1 / 0)
|
|
730
735
|
throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
|
|
731
736
|
if (e.iterations === 1 / 0)
|
|
@@ -742,12 +747,12 @@ class dt extends ut {
|
|
|
742
747
|
duration: n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration,
|
|
743
748
|
...t
|
|
744
749
|
};
|
|
745
|
-
let r = i(this,
|
|
750
|
+
let r = i(this, at);
|
|
746
751
|
for (; r; ) {
|
|
747
752
|
const a = r.getTiming();
|
|
748
753
|
t != null && t.delay && (t.delay += a.delay ?? 0), t != null && t.endDelay && (t.endDelay += a.endDelay ?? 0), t != null && t.iterationStart && (t.iterationStart += a.iterationStart ?? 0), t != null && t.iterations && (t.iterations *= a.iterations ?? 1), t != null && t.playbackRate && (t.playbackRate *= a.playbackRate ?? 1), a.duration && typeof a.duration != "string" && t?.duration === "auto" && (t.duration = h(a.duration, "ms")), r = r.parent;
|
|
749
754
|
}
|
|
750
|
-
if (((e = A.get(this)) == null ? void 0 : e.timeline) instanceof
|
|
755
|
+
if (((e = A.get(this)) == null ? void 0 : e.timeline) instanceof E) {
|
|
751
756
|
if (t?.duration === 1 / 0)
|
|
752
757
|
throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
|
|
753
758
|
if (t != null && t.iterations)
|
|
@@ -756,14 +761,14 @@ class dt extends ut {
|
|
|
756
761
|
return super.updateTiming(t);
|
|
757
762
|
}
|
|
758
763
|
}
|
|
759
|
-
|
|
760
|
-
var U,
|
|
761
|
-
const
|
|
764
|
+
at = /* @__PURE__ */ new WeakMap();
|
|
765
|
+
var U, _;
|
|
766
|
+
const Ne = class ft {
|
|
762
767
|
constructor(t) {
|
|
763
|
-
m(this, U, []), m(this,
|
|
768
|
+
m(this, U, []), m(this, _, null), l(this, U, t.map((e) => (e instanceof ft ? l(e, _, this) : e instanceof dt && (e = new pt(e, this)), e)));
|
|
764
769
|
}
|
|
765
770
|
get parent() {
|
|
766
|
-
return i(this,
|
|
771
|
+
return i(this, _);
|
|
767
772
|
}
|
|
768
773
|
get children() {
|
|
769
774
|
const t = i(this, U);
|
|
@@ -785,18 +790,18 @@ const Ae = class pt {
|
|
|
785
790
|
}
|
|
786
791
|
append(...t) {
|
|
787
792
|
t.forEach((e) => {
|
|
788
|
-
i(this, U).includes(e) || (e instanceof
|
|
793
|
+
i(this, U).includes(e) || (e instanceof ft ? l(e, _, this) : e instanceof dt && (e = new pt(e, this)), i(this, U).push(e));
|
|
789
794
|
});
|
|
790
795
|
}
|
|
791
796
|
prepend(...t) {
|
|
792
797
|
t.forEach((e) => {
|
|
793
|
-
i(this, U).includes(e) || (e instanceof
|
|
798
|
+
i(this, U).includes(e) || (e instanceof ft ? l(e, _, this) : e instanceof dt && (e = new pt(e, this)), i(this, U).unshift(e));
|
|
794
799
|
});
|
|
795
800
|
}
|
|
796
801
|
};
|
|
797
|
-
U = /* @__PURE__ */ new WeakMap(),
|
|
798
|
-
let Ot =
|
|
799
|
-
class
|
|
802
|
+
U = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap();
|
|
803
|
+
let Ot = Ne;
|
|
804
|
+
class nt {
|
|
800
805
|
constructor() {
|
|
801
806
|
j(this, "promise"), j(this, "state"), j(this, "nativeResolve"), j(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
|
|
802
807
|
this.nativeResolve = t, this.nativeReject = e;
|
|
@@ -812,11 +817,11 @@ class et {
|
|
|
812
817
|
}), (e = this.nativeReject) == null || e.call(this, t);
|
|
813
818
|
}
|
|
814
819
|
}
|
|
815
|
-
var
|
|
816
|
-
class
|
|
817
|
-
constructor(t, e =
|
|
818
|
-
super(t), m(this,
|
|
819
|
-
...
|
|
820
|
+
var J, St, ie;
|
|
821
|
+
class Ue extends Ot {
|
|
822
|
+
constructor(t, e = ut) {
|
|
823
|
+
super(t), m(this, St), m(this, J, void 0), l(this, J, {
|
|
824
|
+
...ut,
|
|
820
825
|
...e
|
|
821
826
|
});
|
|
822
827
|
}
|
|
@@ -827,7 +832,7 @@ class Ne extends Ot {
|
|
|
827
832
|
super.append(...t), t.forEach((e) => e.updateTiming());
|
|
828
833
|
}
|
|
829
834
|
getTiming() {
|
|
830
|
-
return i(this,
|
|
835
|
+
return i(this, J);
|
|
831
836
|
}
|
|
832
837
|
getComputedTiming() {
|
|
833
838
|
var t, e;
|
|
@@ -843,15 +848,15 @@ class Ne extends Ot {
|
|
|
843
848
|
} = M.getComputedTiming();
|
|
844
849
|
r.activeDuration = r.activeDuration ? h(r.activeDuration, "ms") + h(Vt, "ms") : Vt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, L = L instanceof CSSNumericValue ? L.to("ms").value : L, typeof L != "string" && (n.duration === "auto" ? n.duration = h(L, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + L : L));
|
|
845
850
|
}
|
|
846
|
-
const { timeline: g, startTime:
|
|
847
|
-
let { duration:
|
|
848
|
-
if (
|
|
851
|
+
const { timeline: g, startTime: f, currentTime: w } = A.get(this) ?? {}, k = g instanceof E ? "percent" : "ms";
|
|
852
|
+
let { duration: b = 0, iterations: X = 1 } = r;
|
|
853
|
+
if (b === "auto" && (b = 0), typeof b == "string")
|
|
849
854
|
throw new TypeError("Unknown effect duration keyword.");
|
|
850
|
-
return r.duration =
|
|
855
|
+
return r.duration = b, r.activeDuration = Et(b) * X, r.startTime = f ?? void 0, r.localTime = w, r.currentIteration = ne(r, ee(r, i(this, St, ie))), g instanceof E ? $t(r) : (g instanceof DocumentTimeline && (r.progress = w && h(w, k) / h(c, k)), r);
|
|
851
856
|
}
|
|
852
857
|
updateTiming(t) {
|
|
853
|
-
l(this,
|
|
854
|
-
...i(this,
|
|
858
|
+
l(this, J, {
|
|
859
|
+
...i(this, J),
|
|
855
860
|
...t
|
|
856
861
|
});
|
|
857
862
|
for (let e = 0; e < this.children.length; e++) {
|
|
@@ -860,19 +865,19 @@ class Ne extends Ot {
|
|
|
860
865
|
}
|
|
861
866
|
}
|
|
862
867
|
}
|
|
863
|
-
|
|
868
|
+
J = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), ie = function() {
|
|
864
869
|
const { playbackRate: s = 1 } = A.get(this) ?? {};
|
|
865
870
|
return s < 0 ? "backwards" : "forwards";
|
|
866
871
|
};
|
|
867
|
-
var d, x,
|
|
872
|
+
var d, x, ht, v, S, P, u, y, R, z, O, ot, W, mt, Rt, Q, lt, q, tt, kt, Kt, xt, qt, Ct, zt, B, G, ct, gt, Mt, I, V, D, $, yt, Lt, Pt;
|
|
868
873
|
const se = class extends EventTarget {
|
|
869
874
|
constructor(t, e) {
|
|
870
|
-
super(), m(this,
|
|
875
|
+
super(), m(this, mt), m(this, Q), m(this, q), m(this, kt), m(this, xt), m(this, Ct), m(this, B), m(this, gt), m(this, I), m(this, D), j(this, "id", ""), j(this, "oncancel", null), j(this, "onfinish", null), j(this, "onremove", null), m(this, d, void 0), m(this, x, void 0), m(this, ht, "active"), m(this, v, {
|
|
871
876
|
task: null,
|
|
872
877
|
playbackRate: null
|
|
873
|
-
}), m(this,
|
|
874
|
-
|
|
875
|
-
}), m(this,
|
|
878
|
+
}), m(this, S, new nt()), m(this, P, new nt()), m(this, u, null), m(this, y, null), m(this, R, []), m(this, z, null), m(this, O, !1), m(this, ot, 0), m(this, W, 1), m(this, ct, () => {
|
|
879
|
+
p(this, B, G).call(this);
|
|
880
|
+
}), m(this, yt, () => {
|
|
876
881
|
var n;
|
|
877
882
|
if (i(this, P).state !== "pending" || this.playState !== "finished")
|
|
878
883
|
return;
|
|
@@ -892,7 +897,7 @@ const se = class extends EventTarget {
|
|
|
892
897
|
var c;
|
|
893
898
|
this.dispatchEvent(o), (c = this.onfinish) == null || c.call(this, o);
|
|
894
899
|
});
|
|
895
|
-
}), m(this,
|
|
900
|
+
}), m(this, Lt, () => {
|
|
896
901
|
var n, r;
|
|
897
902
|
const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime, c = new AnimationPlaybackEvent(
|
|
898
903
|
"cancel",
|
|
@@ -906,11 +911,11 @@ const se = class extends EventTarget {
|
|
|
906
911
|
}
|
|
907
912
|
);
|
|
908
913
|
this.dispatchEvent(c), (r = this.oncancel) == null || r.call(this, c);
|
|
909
|
-
}), m(this,
|
|
914
|
+
}), m(this, Pt, () => {
|
|
910
915
|
var n;
|
|
911
916
|
const r = new Event("remove");
|
|
912
917
|
this.dispatchEvent(r), (n = this.onremove) == null || n.call(this, r);
|
|
913
|
-
}), i(this,
|
|
918
|
+
}), i(this, S).resolve(this), l(this, x, t ?? null), l(this, d, e ?? document.timeline), i(this, x) && A.set(i(this, x), this), p(this, gt, Mt).call(this), e instanceof E && e.addEventListener("update", i(this, ct));
|
|
914
919
|
}
|
|
915
920
|
reverse() {
|
|
916
921
|
var t;
|
|
@@ -929,56 +934,56 @@ const se = class extends EventTarget {
|
|
|
929
934
|
play() {
|
|
930
935
|
const t = this.playState === "paused" && this.pending;
|
|
931
936
|
let e = this.currentTime;
|
|
932
|
-
(i(this, v).playbackRate ?? this.playbackRate) === 0 && e === null && l(this, y, 0), e === null && l(this, O, !0), (this.playState === "finished" || t) && (l(this, u, null), l(this, y, null), l(this, O, !0)), i(this, y) && l(this, u, null), i(this, v).task && (i(this, v).task = null), !(i(this, u) !== null && i(this, y) === null && !t && i(this, v).playbackRate === null) && (
|
|
937
|
+
(i(this, v).playbackRate ?? this.playbackRate) === 0 && e === null && l(this, y, 0), e === null && l(this, O, !0), (this.playState === "finished" || t) && (l(this, u, null), l(this, y, null), l(this, O, !0)), i(this, y) && l(this, u, null), i(this, v).task && (i(this, v).task = null), !(i(this, u) !== null && i(this, y) === null && !t && i(this, v).playbackRate === null) && (p(this, B, G).call(this), p(this, Q, lt).call(this), i(this, v).task = "play", p(this, I, V).call(this, !1));
|
|
933
938
|
}
|
|
934
939
|
pause() {
|
|
935
|
-
this.playState !== "paused" && (this.currentTime === null && l(this, O, !0), i(this, v).task && (i(this, v).task = null),
|
|
940
|
+
this.playState !== "paused" && (this.currentTime === null && l(this, O, !0), i(this, v).task && (i(this, v).task = null), p(this, Q, lt).call(this), i(this, v).task = "pause");
|
|
936
941
|
}
|
|
937
942
|
persist() {
|
|
938
|
-
i(this,
|
|
943
|
+
i(this, R).forEach((t) => t.persist()), l(this, ht, "persisted");
|
|
939
944
|
}
|
|
940
945
|
finish() {
|
|
941
946
|
var t;
|
|
942
947
|
const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W);
|
|
943
948
|
if (n === 0 || n > 0 && e === 1 / 0)
|
|
944
949
|
throw new DOMException("InvalidStateError");
|
|
945
|
-
|
|
950
|
+
p(this, D, $).call(this);
|
|
946
951
|
let r;
|
|
947
|
-
if (n > 0 ? r = e : r = 0,
|
|
948
|
-
const a = i(this, d) instanceof
|
|
952
|
+
if (n > 0 ? r = e : r = 0, p(this, mt, Rt).call(this, r), this.startTime === null && i(this, d) !== null && i(this, d).currentTime !== null && r !== null) {
|
|
953
|
+
const a = i(this, d) instanceof E ? "percent" : "ms";
|
|
949
954
|
r = h(r, a);
|
|
950
955
|
const o = h(i(this, d).currentTime, a);
|
|
951
956
|
l(this, u, o - r / n);
|
|
952
957
|
}
|
|
953
|
-
i(this, v).task === "pause" && i(this, u) !== null && (l(this, y, null),
|
|
958
|
+
i(this, v).task === "pause" && i(this, u) !== null && (l(this, y, null), p(this, q, tt).call(this), i(this, S).resolve(this)), i(this, v).task === "play" && i(this, u) !== null && (p(this, q, tt).call(this), i(this, S).resolve(this)), p(this, I, V).call(this, !0), i(this, R).forEach((a) => a.finish());
|
|
954
959
|
}
|
|
955
960
|
commitStyles() {
|
|
956
|
-
i(this,
|
|
957
|
-
t.effect instanceof
|
|
961
|
+
i(this, R).forEach((t) => {
|
|
962
|
+
t.effect instanceof pt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
|
|
958
963
|
});
|
|
959
964
|
}
|
|
960
965
|
cancel() {
|
|
961
|
-
this.playState !== "idle" && (
|
|
966
|
+
this.playState !== "idle" && (p(this, D, $).call(this), i(this, S).reject(new DOMException("The user aborted a request", "AbortError")), p(this, q, tt).call(this), l(this, S, new nt()), i(this, P).state === "pending" && i(this, P).reject(new DOMException("The user aborted a request", "AbortError")), l(this, P, new nt()), i(this, R).forEach((t) => t.cancel())), l(this, u, null), l(this, y, null);
|
|
962
967
|
}
|
|
963
968
|
updatePlaybackRate(t) {
|
|
964
969
|
var e;
|
|
965
970
|
i(this, v).playbackRate = t;
|
|
966
971
|
const n = this.playState;
|
|
967
|
-
if (i(this,
|
|
972
|
+
if (i(this, S).state !== "pending")
|
|
968
973
|
switch (n) {
|
|
969
974
|
case "idle":
|
|
970
975
|
case "paused":
|
|
971
|
-
|
|
976
|
+
p(this, D, $).call(this);
|
|
972
977
|
break;
|
|
973
978
|
case "finished": {
|
|
974
|
-
const r = i(this, d) instanceof
|
|
979
|
+
const r = i(this, d) instanceof E ? "percent" : "ms", a = ((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null;
|
|
975
980
|
if (t === 0)
|
|
976
981
|
l(this, u, h(a, r));
|
|
977
982
|
else if (a !== null) {
|
|
978
983
|
let o = null;
|
|
979
984
|
o = (h(a, r) - (i(this, u) ?? 0)) * this.playbackRate, i(this, u) !== null && o !== null && l(this, u, (h(a, r) - o) / t);
|
|
980
985
|
}
|
|
981
|
-
|
|
986
|
+
p(this, D, $).call(this), p(this, I, V).call(this, !1), p(this, B, G).call(this);
|
|
982
987
|
break;
|
|
983
988
|
}
|
|
984
989
|
default:
|
|
@@ -992,42 +997,42 @@ const se = class extends EventTarget {
|
|
|
992
997
|
super.removeEventListener(t, e, n);
|
|
993
998
|
}
|
|
994
999
|
set playbackRate(t) {
|
|
995
|
-
l(this, W, t), i(this,
|
|
1000
|
+
l(this, W, t), i(this, R).forEach((e) => {
|
|
996
1001
|
e.playbackRate *= t;
|
|
997
1002
|
});
|
|
998
1003
|
}
|
|
999
1004
|
set startTime(t) {
|
|
1000
|
-
l(this, u, h(t)), i(this,
|
|
1005
|
+
l(this, u, h(t)), i(this, R).forEach((e) => e.startTime = t);
|
|
1001
1006
|
}
|
|
1002
1007
|
set currentTime(t) {
|
|
1003
1008
|
var e;
|
|
1004
|
-
const n = i(this, d) instanceof
|
|
1005
|
-
if (
|
|
1009
|
+
const n = i(this, d) instanceof E ? "percent" : "ms", r = h(((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null, n);
|
|
1010
|
+
if (H(t) && !H(r))
|
|
1006
1011
|
throw new TypeError("currentTime may not be changed from resolved to unresolved.");
|
|
1007
|
-
l(this, O, !1), i(this, y) !== null || i(this, u) === null || r === null || this.playbackRate === 0 ? l(this, y, h(t, n)) : l(this, u, r - h(t, n) / this.playbackRate), (i(this, d) === null || r === null) && l(this, u, null), l(this, z, null),
|
|
1012
|
+
l(this, O, !1), i(this, y) !== null || i(this, u) === null || r === null || this.playbackRate === 0 ? l(this, y, h(t, n)) : l(this, u, r - h(t, n) / this.playbackRate), (i(this, d) === null || r === null) && l(this, u, null), l(this, z, null), p(this, mt, Rt).call(this, t), i(this, v).task === "pause" && (l(this, y, h(t, n)), p(this, D, $).call(this), l(this, u, null), p(this, q, tt).call(this), i(this, S).resolve(this)), p(this, I, V).call(this, !0);
|
|
1008
1013
|
}
|
|
1009
1014
|
set timeline(t) {
|
|
1010
1015
|
var e, n;
|
|
1011
1016
|
const r = this.timeline;
|
|
1012
1017
|
if (r === t)
|
|
1013
1018
|
return;
|
|
1014
|
-
i(this, d) instanceof
|
|
1015
|
-
const a = this.playState, o = r instanceof
|
|
1016
|
-
if (
|
|
1017
|
-
l(this, d, t), t.addEventListener("update", i(this,
|
|
1018
|
-
else if (
|
|
1019
|
-
if (l(this, d, t),
|
|
1019
|
+
i(this, d) instanceof E && i(this, d).removeEventListener("update", i(this, ct));
|
|
1020
|
+
const a = this.playState, o = r instanceof E ? "percent" : "ms", c = h(this.currentTime, o), { progress: g = null, endTime: f = 0 } = ((e = i(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, w = h(f, o), k = r instanceof E, b = t instanceof E, X = t instanceof DocumentTimeline, C = this.pending;
|
|
1021
|
+
if (b)
|
|
1022
|
+
l(this, d, t), t.addEventListener("update", i(this, ct)), p(this, D, $).call(this), l(this, O, !0), l(this, u, null), l(this, y, null), (a === "running" || a === "finished") && ((!i(this, S) || i(this, S).state === "resolved") && p(this, Q, lt).call(this), i(this, v).task = "play", i(this, R).forEach((M) => M.pause())), a === "paused" && g !== null && l(this, y, g * w), C && ((!i(this, S) || i(this, S).state === "resolved") && p(this, Q, lt).call(this), a === "paused" ? i(this, v).task = "pause" : i(this, v).task = "play"), i(this, u) !== null && l(this, y, null), p(this, I, V).call(this, !1);
|
|
1023
|
+
else if (X) {
|
|
1024
|
+
if (l(this, d, t), k) {
|
|
1020
1025
|
if (c !== null && g !== null) {
|
|
1021
1026
|
const { endTime: M = 0 } = ((n = i(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, L = h(M, "ms");
|
|
1022
1027
|
this.currentTime = g * L;
|
|
1023
1028
|
}
|
|
1024
1029
|
switch (a) {
|
|
1025
1030
|
case "paused":
|
|
1026
|
-
i(this,
|
|
1031
|
+
i(this, R).forEach((M) => M.pause());
|
|
1027
1032
|
break;
|
|
1028
1033
|
case "running":
|
|
1029
1034
|
case "finished":
|
|
1030
|
-
i(this,
|
|
1035
|
+
i(this, R).forEach((M) => M.play());
|
|
1031
1036
|
}
|
|
1032
1037
|
}
|
|
1033
1038
|
} else
|
|
@@ -1035,15 +1040,15 @@ const se = class extends EventTarget {
|
|
|
1035
1040
|
}
|
|
1036
1041
|
set effect(t) {
|
|
1037
1042
|
if (t !== i(this, x)) {
|
|
1038
|
-
if (this.pending &&
|
|
1043
|
+
if (this.pending && p(this, q, tt).call(this), i(this, x) && A.delete(i(this, x)), t) {
|
|
1039
1044
|
const e = A.get(t);
|
|
1040
1045
|
e && (e.effect = null), A.set(t, this);
|
|
1041
1046
|
}
|
|
1042
|
-
l(this, x, t),
|
|
1047
|
+
l(this, x, t), p(this, gt, Mt).call(this), p(this, I, V).call(this, !1);
|
|
1043
1048
|
}
|
|
1044
1049
|
}
|
|
1045
1050
|
get ready() {
|
|
1046
|
-
return i(this,
|
|
1051
|
+
return i(this, S).promise;
|
|
1047
1052
|
}
|
|
1048
1053
|
get finished() {
|
|
1049
1054
|
return i(this, P).promise;
|
|
@@ -1051,17 +1056,17 @@ const se = class extends EventTarget {
|
|
|
1051
1056
|
get playState() {
|
|
1052
1057
|
var t;
|
|
1053
1058
|
let { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {};
|
|
1054
|
-
const n = i(this, d) instanceof
|
|
1059
|
+
const n = i(this, d) instanceof E ? "percent" : "ms", r = h(this.startTime, n), a = h(this.currentTime, n);
|
|
1055
1060
|
return e = h(e, n), a === null && r === null && i(this, v).task === null ? "idle" : i(this, v).task === "pause" || r === null && i(this, v).task !== "play" ? "paused" : a !== null && (i(this, W) > 0 && a >= e || i(this, W) < 0 && a <= 0) ? "finished" : "running";
|
|
1056
1061
|
}
|
|
1057
1062
|
get playbackRate() {
|
|
1058
1063
|
return i(this, W);
|
|
1059
1064
|
}
|
|
1060
1065
|
get replaceState() {
|
|
1061
|
-
return i(this,
|
|
1066
|
+
return i(this, ht);
|
|
1062
1067
|
}
|
|
1063
1068
|
get pending() {
|
|
1064
|
-
return i(this,
|
|
1069
|
+
return i(this, S).state === "pending";
|
|
1065
1070
|
}
|
|
1066
1071
|
get currentTime() {
|
|
1067
1072
|
var t;
|
|
@@ -1069,12 +1074,12 @@ const se = class extends EventTarget {
|
|
|
1069
1074
|
if (i(this, y)) {
|
|
1070
1075
|
if (typeof e == "number")
|
|
1071
1076
|
return i(this, y);
|
|
1072
|
-
const a = i(this, d) instanceof
|
|
1077
|
+
const a = i(this, d) instanceof E ? "percent" : "ms";
|
|
1073
1078
|
return new CSSUnitValue(i(this, y), a);
|
|
1074
1079
|
}
|
|
1075
1080
|
if (e === null || i(this, u) === null)
|
|
1076
1081
|
return null;
|
|
1077
|
-
const n = i(this, d) instanceof
|
|
1082
|
+
const n = i(this, d) instanceof E ? "percent" : "ms";
|
|
1078
1083
|
let r = (h(e, n) - i(this, u)) * this.playbackRate;
|
|
1079
1084
|
return r === -0 && (r = 0), typeof e == "number" ? r : new CSSUnitValue(r, n);
|
|
1080
1085
|
}
|
|
@@ -1084,7 +1089,7 @@ const se = class extends EventTarget {
|
|
|
1084
1089
|
return null;
|
|
1085
1090
|
if (typeof (((t = this.timeline) == null ? void 0 : t.currentTime) ?? null) == "number")
|
|
1086
1091
|
return i(this, u);
|
|
1087
|
-
const e = i(this, d) instanceof
|
|
1092
|
+
const e = i(this, d) instanceof E ? "percent" : "ms";
|
|
1088
1093
|
return new CSSUnitValue(i(this, u), e);
|
|
1089
1094
|
}
|
|
1090
1095
|
get timeline() {
|
|
@@ -1094,44 +1099,44 @@ const se = class extends EventTarget {
|
|
|
1094
1099
|
return i(this, x);
|
|
1095
1100
|
}
|
|
1096
1101
|
};
|
|
1097
|
-
d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(),
|
|
1102
|
+
d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakSet(), Rt = function(s) {
|
|
1098
1103
|
var t;
|
|
1099
1104
|
const e = h(((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null);
|
|
1100
1105
|
if (s === null && e !== null)
|
|
1101
1106
|
throw new TypeError();
|
|
1102
|
-
s === null || e === null || (s = h(s), l(this, O, !1), i(this, y) !== null || i(this, u) === null || i(this, d) instanceof
|
|
1103
|
-
},
|
|
1104
|
-
i(this,
|
|
1107
|
+
s === null || e === null || (s = h(s), l(this, O, !1), i(this, y) !== null || i(this, u) === null || i(this, d) instanceof E && i(this, d).phase === "inactive" || i(this, W) === 0 ? l(this, y, s) : l(this, u, e - s / i(this, W)), i(this, d) instanceof E && i(this, d).phase === "inactive" && l(this, u, null), l(this, z, null));
|
|
1108
|
+
}, Q = /* @__PURE__ */ new WeakSet(), lt = function() {
|
|
1109
|
+
i(this, S).state !== "pending" && l(this, S, new nt()), cancelAnimationFrame(i(this, ot)), l(this, ot, requestAnimationFrame(() => {
|
|
1105
1110
|
var s;
|
|
1106
|
-
(((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (
|
|
1111
|
+
(((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (p(this, Ct, zt).call(this), i(this, v).task === "play" && (i(this, u) !== null || i(this, y) !== null) ? p(this, kt, Kt).call(this) : i(this, v).task === "pause" && p(this, xt, qt).call(this), Promise.all(i(this, R).map((t) => t.finished)).then(i(this, yt)), Promise.all(i(this, R).map((t) => new Promise((e) => t.onremove = e))).then(i(this, Pt)), Promise.all(i(this, R).map((t) => new Promise((e) => t.oncancel = e))).then(i(this, Lt)).then(() => l(this, ht, "removed")));
|
|
1107
1112
|
}));
|
|
1108
|
-
}, q = /* @__PURE__ */ new WeakSet(),
|
|
1109
|
-
cancelAnimationFrame(i(this,
|
|
1110
|
-
},
|
|
1113
|
+
}, q = /* @__PURE__ */ new WeakSet(), tt = function() {
|
|
1114
|
+
cancelAnimationFrame(i(this, ot)), i(this, v).task = null;
|
|
1115
|
+
}, kt = /* @__PURE__ */ new WeakSet(), Kt = function() {
|
|
1111
1116
|
var s;
|
|
1112
1117
|
const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
|
|
1113
1118
|
if (t === null)
|
|
1114
1119
|
return;
|
|
1115
|
-
const e = i(this, d) instanceof
|
|
1120
|
+
const e = i(this, d) instanceof E ? "percent" : "ms";
|
|
1116
1121
|
if (i(this, y) !== null)
|
|
1117
|
-
|
|
1122
|
+
p(this, D, $).call(this), this.playbackRate === 0 ? l(this, u, h(t, e)) : (l(this, u, h(t, e) - i(this, y) / this.playbackRate), l(this, y, null));
|
|
1118
1123
|
else if (i(this, u) !== null && i(this, v).playbackRate !== null) {
|
|
1119
1124
|
const n = (h(t, e) - i(this, u)) * this.playbackRate;
|
|
1120
|
-
|
|
1125
|
+
p(this, D, $).call(this);
|
|
1121
1126
|
const r = this.playbackRate;
|
|
1122
1127
|
r === 0 ? (l(this, y, null), l(this, u, h(t, e))) : l(this, u, h(t, e) - n / r);
|
|
1123
1128
|
}
|
|
1124
|
-
i(this,
|
|
1125
|
-
},
|
|
1129
|
+
i(this, S).state === "pending" && i(this, S).resolve(this), p(this, I, V).call(this, !1), p(this, B, G).call(this), i(this, v).task = null, this.timeline instanceof DocumentTimeline && i(this, R).forEach((n) => n.play());
|
|
1130
|
+
}, xt = /* @__PURE__ */ new WeakSet(), qt = function() {
|
|
1126
1131
|
var s;
|
|
1127
1132
|
const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
|
|
1128
1133
|
if (t === null)
|
|
1129
1134
|
return;
|
|
1130
|
-
const e = i(this, d) instanceof
|
|
1131
|
-
i(this, u) !== null && i(this, y) === null && l(this, y, (h(n, e) - i(this, u)) * this.playbackRate),
|
|
1132
|
-
},
|
|
1135
|
+
const e = i(this, d) instanceof E ? "percent" : "ms", n = t;
|
|
1136
|
+
i(this, u) !== null && i(this, y) === null && l(this, y, (h(n, e) - i(this, u)) * this.playbackRate), p(this, D, $).call(this), l(this, u, null), i(this, S).resolve(this), p(this, I, V).call(this, !1), p(this, B, G).call(this), i(this, v).task = null, i(this, R).forEach((r) => r.pause());
|
|
1137
|
+
}, Ct = /* @__PURE__ */ new WeakSet(), zt = function() {
|
|
1133
1138
|
if (i(this, O) && !(!i(this, d) || !i(this, d).currentTime) && !(this.playState === "idle" || this.playState === "paused" && i(this, y) !== null)) {
|
|
1134
|
-
if (i(this, d) instanceof
|
|
1139
|
+
if (i(this, d) instanceof E) {
|
|
1135
1140
|
const s = i(this, v).playbackRate ?? this.playbackRate;
|
|
1136
1141
|
l(this, u, s >= 0 ? 0 : 100);
|
|
1137
1142
|
} else
|
|
@@ -1143,7 +1148,7 @@ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ct = /* @_
|
|
|
1143
1148
|
const t = ((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null;
|
|
1144
1149
|
if (t === null)
|
|
1145
1150
|
return;
|
|
1146
|
-
const e = i(this, x), n = i(this, d) instanceof
|
|
1151
|
+
const e = i(this, x), n = i(this, d) instanceof E ? xe(t, e?.getTiming()) : Et(t);
|
|
1147
1152
|
let r = null;
|
|
1148
1153
|
if (i(this, u) !== null) {
|
|
1149
1154
|
const a = h(t, "percent") === (this.playbackRate < 0 ? 0 : 100) ? this.playbackRate < 0 ? 1e-3 : -1e-3 : 0;
|
|
@@ -1152,52 +1157,52 @@ d = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), ct = /* @_
|
|
|
1152
1157
|
r = i(this, y);
|
|
1153
1158
|
else
|
|
1154
1159
|
return;
|
|
1155
|
-
i(this,
|
|
1156
|
-
},
|
|
1160
|
+
i(this, R).forEach((a) => a.currentTime = r);
|
|
1161
|
+
}, ct = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakSet(), Mt = function() {
|
|
1157
1162
|
var s;
|
|
1158
1163
|
let t = i(this, x);
|
|
1159
1164
|
const e = [];
|
|
1160
1165
|
if (t instanceof Ot)
|
|
1161
1166
|
for (let n = 0; n < t.children.length; n++) {
|
|
1162
1167
|
const r = new se(t.children.item(n));
|
|
1163
|
-
if (t instanceof
|
|
1168
|
+
if (t instanceof Ue && n > 0) {
|
|
1164
1169
|
const { endTime: a = null } = ((s = e[n - 1].effect) == null ? void 0 : s.getComputedTiming()) ?? {};
|
|
1165
1170
|
r.startTime = h(a, "ms");
|
|
1166
1171
|
}
|
|
1167
1172
|
e.push(r);
|
|
1168
1173
|
}
|
|
1169
1174
|
else {
|
|
1170
|
-
const n = i(this, d) instanceof
|
|
1171
|
-
e.push(new
|
|
1175
|
+
const n = i(this, d) instanceof E ? document.timeline : i(this, d);
|
|
1176
|
+
e.push(new ke(t, n));
|
|
1172
1177
|
}
|
|
1173
|
-
l(this,
|
|
1178
|
+
l(this, R, e);
|
|
1174
1179
|
}, I = /* @__PURE__ */ new WeakSet(), V = function(s) {
|
|
1175
1180
|
var t, e;
|
|
1176
|
-
const n = ((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null, r = i(this, d) instanceof
|
|
1181
|
+
const n = ((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null, r = i(this, d) instanceof E ? "percent" : "ms";
|
|
1177
1182
|
let a = h(this.currentTime, r);
|
|
1178
1183
|
if (a && i(this, u) !== null && !this.pending) {
|
|
1179
|
-
let { delay: o = 0, endDelay: c = 0, iterations: g = 1, duration:
|
|
1184
|
+
let { delay: o = 0, endDelay: c = 0, iterations: g = 1, duration: f = "auto" } = ((e = i(this, x)) == null ? void 0 : e.getTiming()) ?? {};
|
|
1180
1185
|
const w = i(this, v).playbackRate ?? this.playbackRate;
|
|
1181
|
-
if (
|
|
1182
|
-
|
|
1183
|
-
else if (
|
|
1184
|
-
|
|
1185
|
-
else if (typeof
|
|
1186
|
+
if (f === "auto")
|
|
1187
|
+
f = i(this, d) instanceof E ? It : 0;
|
|
1188
|
+
else if (f instanceof CSSNumericValue)
|
|
1189
|
+
f = f.to("ms").value;
|
|
1190
|
+
else if (typeof f == "string")
|
|
1186
1191
|
throw new TypeError("Unknown effect duration keyword.");
|
|
1187
|
-
const
|
|
1188
|
-
let
|
|
1189
|
-
w > 0 && a >=
|
|
1192
|
+
const k = o + f * g + c;
|
|
1193
|
+
let b = h(i(this, z), r);
|
|
1194
|
+
w > 0 && a >= k && i(this, z) !== null ? ((b === null || b < k) && (b = k), l(this, y, s ? a : b)) : w < 0 && a <= 0 ? ((b === null || b > 0) && (b = 0), l(this, y, s ? a : b)) : w !== 0 && (s && i(this, y) !== null && (n !== null ? l(this, u, h(n, r) - i(this, y) / w) : l(this, u, null)), l(this, y, null));
|
|
1190
1195
|
}
|
|
1191
|
-
|
|
1196
|
+
p(this, B, G).call(this), l(this, z, this.currentTime), this.playState === "finished" ? i(this, P).state === "pending" && i(this, yt).call(this) : i(this, P).state === "resolved" && l(this, P, new nt());
|
|
1192
1197
|
}, D = /* @__PURE__ */ new WeakSet(), $ = function() {
|
|
1193
1198
|
i(this, v).playbackRate && (this.playbackRate = i(this, v).playbackRate), i(this, v).playbackRate = null;
|
|
1194
|
-
},
|
|
1195
|
-
let
|
|
1196
|
-
var
|
|
1197
|
-
class
|
|
1198
|
-
constructor(t, e =
|
|
1199
|
-
super(t), m(this,
|
|
1200
|
-
...
|
|
1199
|
+
}, yt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap();
|
|
1200
|
+
let We = se;
|
|
1201
|
+
var et, Dt, re;
|
|
1202
|
+
class At extends Ot {
|
|
1203
|
+
constructor(t, e = ut) {
|
|
1204
|
+
super(t), m(this, Dt), m(this, et, void 0), l(this, et, {
|
|
1205
|
+
...ut,
|
|
1201
1206
|
...e
|
|
1202
1207
|
}), t.forEach((n) => n.updateTiming());
|
|
1203
1208
|
}
|
|
@@ -1208,32 +1213,32 @@ class Dt extends Ot {
|
|
|
1208
1213
|
super.append(...t), t.forEach((e) => e.updateTiming());
|
|
1209
1214
|
}
|
|
1210
1215
|
getTiming() {
|
|
1211
|
-
return i(this,
|
|
1216
|
+
return i(this, et);
|
|
1212
1217
|
}
|
|
1213
1218
|
getComputedTiming() {
|
|
1214
1219
|
const t = this.getTiming(), e = { ...t };
|
|
1215
1220
|
for (let w = 0; w < this.children.length; w++) {
|
|
1216
|
-
const
|
|
1217
|
-
if (!
|
|
1221
|
+
const k = this.children.item(w);
|
|
1222
|
+
if (!k)
|
|
1218
1223
|
continue;
|
|
1219
1224
|
let {
|
|
1220
|
-
delay:
|
|
1221
|
-
endDelay:
|
|
1225
|
+
delay: b = 0,
|
|
1226
|
+
endDelay: X = 0,
|
|
1222
1227
|
duration: C = "auto",
|
|
1223
1228
|
activeDuration: M = 0,
|
|
1224
1229
|
endTime: L = 0
|
|
1225
|
-
} =
|
|
1226
|
-
t.delay = t.delay ? Math.min(t.delay,
|
|
1230
|
+
} = k.getComputedTiming();
|
|
1231
|
+
t.delay = t.delay ? Math.min(t.delay, b) : b, t.endDelay = t.endDelay ? Math.max(t.endDelay, X) : X, e.endTime = e.endTime ? Math.max(h(e.endTime, "ms"), h(L, "ms")) : L, e.activeDuration = e.activeDuration ? Math.max(h(e.activeDuration, "ms"), h(M, "ms")) : M, t.duration = t.duration instanceof CSSNumericValue ? t.duration.to("ms").value : t.duration, C = C instanceof CSSNumericValue ? C.to("ms").value : C, typeof C != "string" && (t.duration === "auto" ? t.duration = h(C, "ms") : typeof t.duration != "string" && (t.duration = t.duration ? Math.max(t.duration, C) : C));
|
|
1227
1232
|
}
|
|
1228
|
-
const { timeline: n, startTime: r, currentTime: a } = A.get(this) ?? {}, o = n instanceof
|
|
1229
|
-
let { duration: c = 0, iterations: g = 1, endTime:
|
|
1233
|
+
const { timeline: n, startTime: r, currentTime: a } = A.get(this) ?? {}, o = n instanceof E ? "percent" : "ms";
|
|
1234
|
+
let { duration: c = 0, iterations: g = 1, endTime: f = 0 } = e;
|
|
1230
1235
|
if (c === "auto" && (c = 0), typeof c == "string")
|
|
1231
1236
|
throw new TypeError("Unknown effect duration keyword.");
|
|
1232
|
-
return e.duration = c, e.activeDuration =
|
|
1237
|
+
return e.duration = c, e.activeDuration = Et(c) * g, e.startTime = r ?? void 0, e.localTime = a, e.currentIteration = ne(e, ee(e, i(this, Dt, re))), n instanceof E ? $t(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(f, o)), e);
|
|
1233
1238
|
}
|
|
1234
1239
|
updateTiming(t) {
|
|
1235
|
-
l(this,
|
|
1236
|
-
...i(this,
|
|
1240
|
+
l(this, et, {
|
|
1241
|
+
...i(this, et),
|
|
1237
1242
|
...t
|
|
1238
1243
|
});
|
|
1239
1244
|
for (let e = 0; e < this.children.length; e++) {
|
|
@@ -1242,11 +1247,11 @@ class Dt extends Ot {
|
|
|
1242
1247
|
}
|
|
1243
1248
|
}
|
|
1244
1249
|
}
|
|
1245
|
-
|
|
1250
|
+
et = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakSet(), re = function() {
|
|
1246
1251
|
const { playbackRate: s = 1 } = A.get(this) ?? {};
|
|
1247
1252
|
return s < 0 ? "backwards" : "forwards";
|
|
1248
1253
|
};
|
|
1249
|
-
class
|
|
1254
|
+
class Ie extends st {
|
|
1250
1255
|
ref = K();
|
|
1251
1256
|
#t = null;
|
|
1252
1257
|
#e = null;
|
|
@@ -1380,7 +1385,7 @@ class We extends it {
|
|
|
1380
1385
|
break;
|
|
1381
1386
|
}
|
|
1382
1387
|
}
|
|
1383
|
-
return new
|
|
1388
|
+
return new At(n);
|
|
1384
1389
|
}
|
|
1385
1390
|
get animationEffect() {
|
|
1386
1391
|
const t = this.outgoingScreen?.current?.sharedElementScene, e = this.incomingScreen?.current?.sharedElementScene;
|
|
@@ -1392,20 +1397,20 @@ class We extends it {
|
|
|
1392
1397
|
const o = a.getBoundingClientRect(), c = t.nodes.get(r);
|
|
1393
1398
|
if (!c?.canTransition || !a.canTransition)
|
|
1394
1399
|
continue;
|
|
1395
|
-
const g = c.getBoundingClientRect(),
|
|
1396
|
-
if (!w || !
|
|
1400
|
+
const g = c.getBoundingClientRect(), f = a.clone(), w = c.clone();
|
|
1401
|
+
if (!w || !f)
|
|
1397
1402
|
continue;
|
|
1398
|
-
const
|
|
1399
|
-
a.transitionType !== "morph" ? (w.id = `${r}-start`, w.style.position = "absolute", w.style.gridArea = "1 / 1", w.style.margin = "0", this.copyStyles(c.ref.current?.firstElementChild, w,
|
|
1400
|
-
const
|
|
1401
|
-
this.props.direction === "forwards" ? a.unhide() : c.unhide(),
|
|
1403
|
+
const k = Array.from(/* @__PURE__ */ new Set([...c.styles, ...a.styles]));
|
|
1404
|
+
a.transitionType !== "morph" ? (w.id = `${r}-start`, w.style.position = "absolute", w.style.gridArea = "1 / 1", w.style.margin = "0", this.copyStyles(c.ref.current?.firstElementChild, w, k), this.copyStyles(a.ref.current?.firstElementChild, f, k), w.style.width = `${g.width}px`, w.style.height = `${g.height}px`, f.style.width = `${o.width}px`, f.style.height = `${o.height}px`, this.ref.current?.prepend(w)) : (this.copyStyles(c.ref.current?.firstElementChild, f, k), f.style.width = `${g.width}px`, f.style.height = `${g.height}px`), f.id = `${r}${a.transitionType === "morph" ? "" : "-end"}`, f.style.position = "absolute", f.style.gridArea = "1 / 1", f.style.margin = "0", this.ref.current?.prepend(f), c.hide(), a.hide();
|
|
1405
|
+
const b = async () => {
|
|
1406
|
+
this.props.direction === "forwards" ? a.unhide() : c.unhide(), f.remove(), w.remove();
|
|
1402
1407
|
};
|
|
1403
|
-
this.props.navigation.addEventListener("transition-end",
|
|
1408
|
+
this.props.navigation.addEventListener("transition-end", b, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", b, { once: !0 }), n.push(this.getAnimationEffect(
|
|
1404
1409
|
{ instance: c, clone: w, rect: g },
|
|
1405
|
-
{ instance: a, clone:
|
|
1410
|
+
{ instance: a, clone: f, rect: o }
|
|
1406
1411
|
));
|
|
1407
1412
|
}
|
|
1408
|
-
return new
|
|
1413
|
+
return new At(n);
|
|
1409
1414
|
}
|
|
1410
1415
|
render() {
|
|
1411
1416
|
return /* @__PURE__ */ T("dialog", { className: "shared-element-layer", ref: this.ref, style: {
|
|
@@ -1424,10 +1429,10 @@ class We extends it {
|
|
|
1424
1429
|
` }) });
|
|
1425
1430
|
}
|
|
1426
1431
|
}
|
|
1427
|
-
const ae =
|
|
1428
|
-
class
|
|
1432
|
+
const ae = it(0);
|
|
1433
|
+
class $e extends st {
|
|
1429
1434
|
sharedElementTransitionLayer = K();
|
|
1430
|
-
animation = new
|
|
1435
|
+
animation = new We();
|
|
1431
1436
|
#t = "normal";
|
|
1432
1437
|
#e = new Array();
|
|
1433
1438
|
state = {
|
|
@@ -1466,7 +1471,7 @@ class Ie extends it {
|
|
|
1466
1471
|
return this.props.hasUAVisualTransition;
|
|
1467
1472
|
}
|
|
1468
1473
|
transition() {
|
|
1469
|
-
const t = new
|
|
1474
|
+
const t = new At(
|
|
1470
1475
|
this.screens.map((r) => r.current?.transitionProvider?.current?.animationEffect ?? null).filter((r) => r !== null)
|
|
1471
1476
|
), e = this.sharedElementTransitionLayer.current?.animationEffect, n = t.getComputedTiming().duration;
|
|
1472
1477
|
return e && (e.updateTiming({
|
|
@@ -1478,9 +1483,9 @@ class Ie extends it {
|
|
|
1478
1483
|
}), this.animation;
|
|
1479
1484
|
}
|
|
1480
1485
|
render() {
|
|
1481
|
-
return /* @__PURE__ */ Gt(
|
|
1486
|
+
return /* @__PURE__ */ Gt(_t.Provider, { value: this, children: [
|
|
1482
1487
|
/* @__PURE__ */ T(
|
|
1483
|
-
|
|
1488
|
+
Ie,
|
|
1484
1489
|
{
|
|
1485
1490
|
ref: this.sharedElementTransitionLayer,
|
|
1486
1491
|
navigation: this.props.navigation,
|
|
@@ -1505,7 +1510,7 @@ class Ie extends it {
|
|
|
1505
1510
|
] });
|
|
1506
1511
|
}
|
|
1507
1512
|
}
|
|
1508
|
-
class
|
|
1513
|
+
class Nt extends st {
|
|
1509
1514
|
ref = K();
|
|
1510
1515
|
screenTransitionLayer = K();
|
|
1511
1516
|
parent = null;
|
|
@@ -1514,9 +1519,9 @@ class At extends it {
|
|
|
1514
1519
|
hasUAVisualTransition = !1;
|
|
1515
1520
|
parentScreen = null;
|
|
1516
1521
|
static rootRouterRef = null;
|
|
1517
|
-
static contextType =
|
|
1522
|
+
static contextType = Jt;
|
|
1518
1523
|
constructor(t, e) {
|
|
1519
|
-
super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null, this.parent && (this.parent.child = this), this.isRoot && (
|
|
1524
|
+
super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null, this.parent && (this.parent.child = this), this.isRoot && (Nt.rootRouterRef = new WeakRef(this));
|
|
1520
1525
|
}
|
|
1521
1526
|
componentDidMount() {
|
|
1522
1527
|
this.isRoot && window.navigation.addEventListener("navigate", this.handleNavigationDispatch), this.loadDispatched || (window.navigation.dispatchEvent(new ye()), this.loadDispatched = !0);
|
|
@@ -1534,7 +1539,7 @@ class At extends it {
|
|
|
1534
1539
|
yield t, t = t.child;
|
|
1535
1540
|
}
|
|
1536
1541
|
getRouterById(t, e) {
|
|
1537
|
-
const n = e ??
|
|
1542
|
+
const n = e ?? Nt.rootRouterRef?.deref();
|
|
1538
1543
|
return n.id === t ? n ?? null : n?.child ? this.getRouterById(t, n.child) : null;
|
|
1539
1544
|
}
|
|
1540
1545
|
dispatchEvent(t) {
|
|
@@ -1547,28 +1552,27 @@ class At extends it {
|
|
|
1547
1552
|
removeEventListener(t, e, n) {
|
|
1548
1553
|
return this.ref.current?.removeEventListener(t, e, n);
|
|
1549
1554
|
}
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
}), r || e(!1);
|
|
1555
|
+
screenChildFromPathname(t) {
|
|
1556
|
+
for (const e of jt.toArray(this.props.children)) {
|
|
1557
|
+
if (!Te(e))
|
|
1558
|
+
continue;
|
|
1559
|
+
const n = Yt(
|
|
1560
|
+
e.props.path,
|
|
1561
|
+
t,
|
|
1562
|
+
this.baseURLPattern.pathname,
|
|
1563
|
+
e.props.caseSensitive
|
|
1564
|
+
);
|
|
1565
|
+
if (n)
|
|
1566
|
+
return {
|
|
1567
|
+
child: e,
|
|
1568
|
+
matchInfo: n
|
|
1569
|
+
};
|
|
1570
|
+
}
|
|
1571
|
+
return null;
|
|
1572
|
+
}
|
|
1573
|
+
preloadScreen(t) {
|
|
1574
|
+
const e = t.props.config, n = [];
|
|
1575
|
+
return F(t.props.component) && n.push(t.props.component.load()), F(e?.header?.component) && n.push(e?.header?.component.load()), F(e?.footer?.component) && n.push(e?.footer?.component.load()), Promise.all(n).then(() => {
|
|
1572
1576
|
});
|
|
1573
1577
|
}
|
|
1574
1578
|
get id() {
|
|
@@ -1619,8 +1623,8 @@ class At extends it {
|
|
|
1619
1623
|
className: "react-motion-router",
|
|
1620
1624
|
style: { width: "100%", height: "100%" },
|
|
1621
1625
|
ref: this.ref,
|
|
1622
|
-
children: /* @__PURE__ */ T(
|
|
1623
|
-
|
|
1626
|
+
children: /* @__PURE__ */ T(wt.Provider, { value: this, children: /* @__PURE__ */ T(
|
|
1627
|
+
$e,
|
|
1624
1628
|
{
|
|
1625
1629
|
ref: this.screenTransitionLayer,
|
|
1626
1630
|
navigation: this.navigation,
|
|
@@ -1632,7 +1636,7 @@ class At extends it {
|
|
|
1632
1636
|
);
|
|
1633
1637
|
}
|
|
1634
1638
|
}
|
|
1635
|
-
class
|
|
1639
|
+
class Oe {
|
|
1636
1640
|
#t = /* @__PURE__ */ new Map();
|
|
1637
1641
|
mutationObserver;
|
|
1638
1642
|
constructor() {
|
|
@@ -1714,12 +1718,12 @@ class $e {
|
|
|
1714
1718
|
n.setAttribute(...r), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
|
|
1715
1719
|
}
|
|
1716
1720
|
}
|
|
1717
|
-
class
|
|
1721
|
+
class Ut {
|
|
1718
1722
|
static rootNavigatorRef = null;
|
|
1719
|
-
metaData = new
|
|
1723
|
+
metaData = new Oe();
|
|
1720
1724
|
constructor() {
|
|
1721
|
-
const t =
|
|
1722
|
-
(!t || !t.isInDocument) && (
|
|
1725
|
+
const t = Ut.rootNavigatorRef?.deref();
|
|
1726
|
+
(!t || !t.isInDocument) && (Ut.rootNavigatorRef = new WeakRef(this));
|
|
1723
1727
|
}
|
|
1724
1728
|
addEventListener(t, e, n) {
|
|
1725
1729
|
return this.router.addEventListener(t, e, n), () => this.router.removeEventListener(t, e, n);
|
|
@@ -1745,34 +1749,30 @@ class Nt {
|
|
|
1745
1749
|
getNavigatorById(t) {
|
|
1746
1750
|
return this.router.getRouterById(t)?.navigation ?? null;
|
|
1747
1751
|
}
|
|
1748
|
-
preloadRoute(t) {
|
|
1749
|
-
const { pathname: e } = new URL(t, this.baseURL);
|
|
1750
|
-
return this.router.preloadRoute(e);
|
|
1751
|
-
}
|
|
1752
1752
|
get isInDocument() {
|
|
1753
1753
|
return !!document.getElementById(`${this.routerId}`);
|
|
1754
1754
|
}
|
|
1755
1755
|
}
|
|
1756
1756
|
function Qe() {
|
|
1757
|
-
const s =
|
|
1757
|
+
const s = vt(wt);
|
|
1758
1758
|
if (s)
|
|
1759
1759
|
return s.navigation;
|
|
1760
1760
|
throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
|
|
1761
1761
|
}
|
|
1762
1762
|
function tn() {
|
|
1763
|
-
return
|
|
1763
|
+
return vt(wt);
|
|
1764
1764
|
}
|
|
1765
1765
|
function en() {
|
|
1766
|
-
return ce("Motion"),
|
|
1766
|
+
return ce("Motion"), vt(ae);
|
|
1767
1767
|
}
|
|
1768
|
-
function
|
|
1769
|
-
const s =
|
|
1768
|
+
function Ve() {
|
|
1769
|
+
const s = vt(Qt);
|
|
1770
1770
|
if (s)
|
|
1771
1771
|
return s;
|
|
1772
1772
|
throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
|
|
1773
1773
|
}
|
|
1774
1774
|
function nn(s, t) {
|
|
1775
|
-
const e =
|
|
1775
|
+
const e = Ve();
|
|
1776
1776
|
t = t instanceof Function ? t() : t;
|
|
1777
1777
|
const n = (r) => {
|
|
1778
1778
|
r instanceof Function && (r = r(e.params[s] ?? t)), e.setParams({ [s]: r });
|
|
@@ -1788,38 +1788,38 @@ export {
|
|
|
1788
1788
|
on as MIN_NORM_PROGRESS,
|
|
1789
1789
|
an as MIN_PROGRESS,
|
|
1790
1790
|
ae as MotionContext,
|
|
1791
|
-
|
|
1791
|
+
_e as MotionProgressEndEvent,
|
|
1792
1792
|
ge as MotionProgressEvent,
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1793
|
+
Ye as MotionProgressStartEvent,
|
|
1794
|
+
Ut as NavigationBase,
|
|
1795
|
+
Jt as NestedRouterContext,
|
|
1796
1796
|
ue as PromiseAllDynamic,
|
|
1797
|
-
|
|
1798
|
-
|
|
1797
|
+
Nt as RouterBase,
|
|
1798
|
+
wt as RouterContext,
|
|
1799
1799
|
Ee as ScreenBase,
|
|
1800
|
-
|
|
1800
|
+
Be as SharedElement,
|
|
1801
1801
|
fe as TransitionCancelEvent,
|
|
1802
1802
|
me as TransitionEndEvent,
|
|
1803
1803
|
pe as TransitionStartEvent,
|
|
1804
|
-
|
|
1804
|
+
Ze as cloneAndInject,
|
|
1805
1805
|
he as dispatchEvent,
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1806
|
+
Ke as includesRoute,
|
|
1807
|
+
F as isLazyExoticComponent,
|
|
1808
|
+
te as isNativeLazyExoticComponent,
|
|
1809
|
+
ze as isNavigationSupported,
|
|
1810
1810
|
be as isStylableElement,
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1811
|
+
Ge as isURLPatternSupported,
|
|
1812
|
+
Te as isValidScreenChild,
|
|
1813
|
+
qe as lazy,
|
|
1814
|
+
Yt as matchRoute,
|
|
1815
1815
|
Xe as polyfillNavigation,
|
|
1816
|
-
|
|
1816
|
+
He as polyfillURLPattern,
|
|
1817
1817
|
bt as resolveBaseURLFromPattern,
|
|
1818
1818
|
de as toCamelCase,
|
|
1819
1819
|
en as useMotion,
|
|
1820
1820
|
Qe as useNavigationBase,
|
|
1821
1821
|
nn as useParamsBase,
|
|
1822
|
-
|
|
1822
|
+
Ve as useRouteBase,
|
|
1823
1823
|
tn as useRouterBase
|
|
1824
1824
|
};
|
|
1825
1825
|
//# sourceMappingURL=index.js.map
|