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