@react-motion-router/core 2.0.0-beta.sha-4819f7b → 2.0.0-beta.sha-112968d

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.
Files changed (35) hide show
  1. package/build/Anchor.d.ts +29 -0
  2. package/build/MetaData.d.ts +5 -5
  3. package/build/NavigationBase.d.ts +31 -13
  4. package/build/RouterBase.d.ts +8 -8
  5. package/build/RouterContext.d.ts +1 -1
  6. package/build/ScreenBase.d.ts +7 -7
  7. package/build/ScreenTransitionLayer.d.ts +2 -5
  8. package/build/ScreenTransitionProvider.d.ts +2 -2
  9. package/build/SharedElement.d.ts +4 -6
  10. package/build/SharedElementTransitionLayer.d.ts +2 -2
  11. package/build/__tests__/Anchor/index.test.d.ts +1 -0
  12. package/build/__tests__/Anchor/push.test.d.ts +1 -0
  13. package/build/__tests__/Anchor/reload.test.d.ts +1 -0
  14. package/build/__tests__/Anchor/replace.test.d.ts +1 -0
  15. package/build/__tests__/Anchor/traverse.test.d.ts +1 -0
  16. package/build/__tests__/RouterBase/get-router-by-id.test.d.ts +1 -0
  17. package/build/__tests__/RouterBase/index.test.d.ts +1 -0
  18. package/build/__tests__/RouterBase/preload-screen.test.d.ts +1 -0
  19. package/build/__tests__/RouterBase/screen-child-from-pathname.test.d.ts +1 -0
  20. package/build/__tests__/common/utils.d.ts +33 -0
  21. package/build/__tests__/lazy.test.d.ts +1 -0
  22. package/build/__tests__/load-event.test.d.ts +1 -0
  23. package/build/__tests__/meta-data.test.d.ts +1 -0
  24. package/build/__tests__/screen.test.d.ts +1 -0
  25. package/build/__tests__/use-motion.test.d.ts +1 -0
  26. package/build/common/constants.d.ts +4 -0
  27. package/build/common/events.d.ts +0 -4
  28. package/build/common/test-utils.d.ts +12 -0
  29. package/build/common/types.d.ts +3 -5
  30. package/build/common/utils.d.ts +3 -3
  31. package/build/index.d.ts +2 -1
  32. package/build/index.js +945 -595
  33. package/build/index.js.map +1 -1
  34. package/package.json +7 -6
  35. package/build/MotionContext.d.ts +0 -1
package/build/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as b, jsxs as Gt, Fragment as oe } from "react/jsx-runtime";
2
- import { createContext as it, Component as st, createRef as K, lazy as le, cloneElement as Ht, Suspense as bt, isValidElement as Xt, Children as jt, useContext as vt, useDebugValue as ce, useRef as he, useEffect as ue, useCallback as de } from "react";
3
- const Zt = it(null);
4
- class ze extends st {
5
- ref = K();
6
- static contextType = Zt;
1
+ import { jsx as T, jsxs as te, Fragment as ge } from "react/jsx-runtime";
2
+ import Ht, { createContext as gt, Component as at, createRef as q, lazy as ve, cloneElement as ee, Suspense as xt, isValidElement as ne, Children as Gt, useContext as ft, useDebugValue as ye, useSyncExternalStore as ie, useRef as se, useEffect as re, useCallback as we } from "react";
3
+ const ae = gt(null);
4
+ class Qe extends at {
5
+ ref = q();
6
+ static contextType = ae;
7
7
  componentDidMount() {
8
8
  this.scene.addNode(this);
9
9
  }
@@ -44,7 +44,7 @@ class ze extends st {
44
44
  this.ref.current && (this.ref.current.style.visibility = "visible");
45
45
  }
46
46
  render() {
47
- return /* @__PURE__ */ b(
47
+ return /* @__PURE__ */ T(
48
48
  "div",
49
49
  {
50
50
  ref: this.ref,
@@ -55,57 +55,55 @@ class ze extends st {
55
55
  );
56
56
  }
57
57
  }
58
- function Tt(s, t) {
58
+ const tn = 2147483647, en = 100, nn = 0, sn = 0, rn = 1, Ee = -1, O = 0, J = 1, an = 0;
59
+ function Lt(s, t) {
59
60
  s.endsWith("*") || (s += "**");
60
61
  const e = window.location.origin, n = new URLPattern(s, e).exec(t, e);
61
62
  if (!n)
62
63
  return null;
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
- return new URL(t.replace(a, ""), window.location.origin);
64
+ const a = Object.keys(n.pathname.groups).filter((o) => !isNaN(Number(o))).map((o) => n.pathname.groups[o]).filter((o) => o !== void 0).at(Ee) ?? "";
65
+ return new URL(
66
+ t.replace(a, ""),
67
+ window.location.origin
68
+ );
65
69
  }
66
- function Yt(s, t, e = `${window.location.origin}/`, n = !0) {
70
+ function Xt(s, t, e = `${window.location.origin}/`, n = !0) {
67
71
  n || (s = s.toLowerCase(), t = t.toLowerCase());
68
- const r = Tt(e, t)?.href;
69
- if (!r)
72
+ const i = Lt(e, t)?.href;
73
+ if (!i)
70
74
  return null;
71
- const a = new URLPattern({ baseURL: r, pathname: s }).exec({ pathname: t, baseURL: r }), o = a?.pathname.groups ?? {};
75
+ const a = new URLPattern({
76
+ baseURL: i,
77
+ pathname: s
78
+ }).exec({ pathname: t, baseURL: i }), o = a?.pathname.groups ?? {};
72
79
  return a ? {
73
80
  params: o,
74
81
  caseSensitive: n
75
82
  } : null;
76
83
  }
77
- function Ge(s, t, e = window.location.origin) {
78
- return s.some(({ pattern: n, caseSensitive: r }) => Yt(n, t, e, r));
79
- }
80
- function pe(s, t = window) {
84
+ function be(s, t = window) {
81
85
  return new Promise((e) => {
82
86
  queueMicrotask(() => e(
83
87
  t.dispatchEvent(s)
84
88
  ));
85
89
  });
86
90
  }
87
- function He(s) {
88
- const t = le(s);
91
+ function on(s) {
92
+ const t = ve(s);
89
93
  return t.load = async () => (t.module ??= await s(), t.module), t;
90
94
  }
91
- function Xe() {
95
+ function ln() {
92
96
  return !!window.navigation;
93
97
  }
94
- function Ze() {
98
+ function cn() {
95
99
  return !!globalThis.URLPattern;
96
100
  }
97
- async function Ye() {
98
- const { URLPattern: s } = await import(
99
- /*webpackIgnore: true*/
100
- "urlpattern-polyfill"
101
- );
101
+ async function hn() {
102
+ const { URLPattern: s } = await import("urlpattern-polyfill");
102
103
  globalThis.URLPattern = s;
103
104
  }
104
- async function _e() {
105
- const { applyPolyfill: s } = await import(
106
- /*webpackIgnore: true*/
107
- "@virtualstate/navigation"
108
- );
105
+ async function un() {
106
+ const { applyPolyfill: s } = await import("@virtualstate/navigation");
109
107
  s({
110
108
  history: !0,
111
109
  interceptEvents: !0,
@@ -114,50 +112,50 @@ async function _e() {
114
112
  persistState: !0
115
113
  });
116
114
  }
117
- async function fe(s) {
115
+ async function Te(s) {
118
116
  const t = [];
119
117
  for (const e of s)
120
118
  t.push(await e);
121
119
  return t;
122
120
  }
123
- function me(s) {
121
+ function Se(s) {
124
122
  return s.replace(/-([a-z])/g, (t) => t[1].toUpperCase());
125
123
  }
126
- function Je(s, t) {
127
- return Ht(s, t);
124
+ function dn(s, t) {
125
+ return ee(s, t);
126
+ }
127
+ function Re(s, t) {
128
+ const e = { ...s };
129
+ for (const n of t)
130
+ delete e[n];
131
+ return e;
128
132
  }
129
- class ge extends Event {
133
+ class ke extends Event {
130
134
  constructor() {
131
135
  super("transition-start");
132
136
  }
133
137
  }
134
- class ye extends Event {
138
+ class xe extends Event {
135
139
  constructor() {
136
140
  super("transition-cancel");
137
141
  }
138
142
  }
139
- class ve extends Event {
143
+ class Ce extends Event {
140
144
  constructor() {
141
145
  super("transition-end");
142
146
  }
143
147
  }
144
- class Qe extends Event {
148
+ class fn extends Event {
145
149
  constructor() {
146
150
  super("motion-progress-start");
147
151
  }
148
152
  }
149
- class we extends Event {
150
- progress;
151
- constructor(t) {
152
- super("motion-progress"), this.progress = t;
153
- }
154
- }
155
- class tn extends Event {
153
+ class pn extends Event {
156
154
  constructor() {
157
155
  super("motion-progress-end");
158
156
  }
159
157
  }
160
- class Ee extends Event {
158
+ class Le extends Event {
161
159
  #t = "load";
162
160
  #e = !1;
163
161
  #c = !0;
@@ -185,7 +183,11 @@ class Ee extends Event {
185
183
  index: t.index,
186
184
  id: t.id,
187
185
  sameDocument: !0
188
- }, this.#i = this.#o.signal, window.navigation.addEventListener("navigate", this.#r, { signal: this.#i });
186
+ }, this.#i = this.#o.signal, window.navigation.addEventListener(
187
+ "navigate",
188
+ this.#r,
189
+ { signal: this.#i }
190
+ );
189
191
  }
190
192
  #r = (t) => {
191
193
  t !== this ? this.#o.abort() : this.#n.length || window.navigation.removeEventListener("navigate", this.#r);
@@ -195,12 +197,12 @@ class Ee extends Event {
195
197
  throw new DOMException("Failed to execute 'intercept' on 'NavigateEvent': intercept() may only be called while the navigate event is being dispatched.");
196
198
  let e = null;
197
199
  this.#s || (this.#s = {
198
- finished: new Promise((r) => e = r),
200
+ finished: new Promise((i) => e = i),
199
201
  from: window.navigation.currentEntry,
200
202
  navigationType: "load"
201
203
  });
202
204
  const n = t?.handler?.();
203
- n && this.#n.push(n), this.#n.length === 1 && fe(this.#n).then(() => {
205
+ n && this.#n.push(n), this.#n.length === J && Te(this.#n).then(() => {
204
206
  this.#l = !0, window.removeEventListener("navigate", this.#r), e?.();
205
207
  });
206
208
  }
@@ -235,11 +237,11 @@ class Ee extends Event {
235
237
  return this.#i;
236
238
  }
237
239
  }
238
- const _t = it(null);
239
- class be extends st {
240
- ref = K();
241
- static contextType = _t;
242
- index = 0;
240
+ const Ft = gt(null);
241
+ class Me extends at {
242
+ ref = q();
243
+ static contextType = Ft;
244
+ index = O;
243
245
  exiting = !1;
244
246
  state = {
245
247
  zIndex: "unset"
@@ -257,16 +259,16 @@ class be extends st {
257
259
  this.props.navigation.removeEventListener("transition-start", this.onAnimationStart), this.props.navigation.removeEventListener("transition-end", this.onAnimationEnd), this.props.navigation.removeEventListener("transition-cancel", this.onAnimationEnd);
258
260
  }
259
261
  get animationEffect() {
260
- const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: r } = this.context, { timeline: a, playbackRate: o } = e, { index: l, exiting: m, ref: p } = this, w = this.context.screens.map((R) => R.current?.name);
262
+ const t = this.props.animation, { animation: e, direction: n, hasUAVisualTransition: i } = this.context, { timeline: a, playbackRate: o } = e, { index: l, exiting: f, ref: d } = this, m = this.context.screens.map((S) => S.current?.name);
261
263
  return t?.({
262
- ref: p.current,
264
+ ref: d.current,
263
265
  index: l,
264
- screens: w,
265
- exiting: m,
266
+ screens: m,
267
+ exiting: f,
266
268
  timeline: a,
267
269
  direction: n,
268
270
  playbackRate: o,
269
- hasUAVisualTransition: r
271
+ hasUAVisualTransition: i
270
272
  }) ?? null;
271
273
  }
272
274
  setZIndex(t) {
@@ -274,7 +276,7 @@ class be extends st {
274
276
  }
275
277
  render() {
276
278
  const t = this.props.renderAs, e = this.props.focused ? void 0 : "";
277
- return /* @__PURE__ */ b(
279
+ return /* @__PURE__ */ T(
278
280
  t,
279
281
  {
280
282
  id: this.props.id,
@@ -293,8 +295,8 @@ class be extends st {
293
295
  );
294
296
  }
295
297
  }
296
- const Jt = it(null), wt = it(null), Qt = it(null);
297
- class Te {
298
+ const oe = gt(null), vt = gt(null), le = gt(null);
299
+ class Pe {
298
300
  id;
299
301
  nodes = /* @__PURE__ */ new Map();
300
302
  getScreenRect = () => new DOMRect();
@@ -329,12 +331,12 @@ class Te {
329
331
  return !this.nodes.size;
330
332
  }
331
333
  }
332
- class Se extends st {
334
+ class De extends at {
333
335
  sharedElementScene;
334
- #t = K();
335
- ref = K();
336
+ #t = q();
337
+ ref = q();
336
338
  nestedRouterData;
337
- static contextType = wt;
339
+ static contextType = vt;
338
340
  state = {
339
341
  focused: !1,
340
342
  config: {},
@@ -342,7 +344,12 @@ class Se extends st {
342
344
  elementType: "div"
343
345
  };
344
346
  constructor(t, e) {
345
- super(t), this.sharedElementScene = new Te(`${this.name}-shared-element-scene`), this.sharedElementScene.getScreenRect = () => this.ref.current?.getBoundingClientRect() || new DOMRect(), this.nestedRouterData = { parentScreen: this, parentRouter: e };
347
+ super(t), this.sharedElementScene = new Pe(
348
+ `${this.name}-shared-element-scene`
349
+ ), this.sharedElementScene.getScreenRect = () => this.ref.current?.getBoundingClientRect() || new DOMRect(), this.nestedRouterData = {
350
+ parentScreen: this,
351
+ parentRouter: e
352
+ };
346
353
  }
347
354
  setParams(t) {
348
355
  this.setState(({ params: e }) => ({ params: { ...e, ...t } }));
@@ -354,20 +361,24 @@ class Se extends st {
354
361
  return this.state.focused;
355
362
  }
356
363
  get name() {
357
- 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();
364
+ return this.props.name ? this.props.name.toLowerCase().replace(/[^\w-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "") : j(this.props.component) ? this.props.component.module?.default.name.toLowerCase() : this.props.component.name.toLowerCase();
358
365
  }
359
366
  blur() {
360
- return new Promise((t) => this.setState({ focused: !1 }, t));
367
+ return new Promise((t) => {
368
+ this.setState({ focused: !1 }, t);
369
+ });
361
370
  }
362
371
  focus() {
363
- return new Promise((t) => this.setState({ focused: !0 }, t));
372
+ return new Promise((t) => {
373
+ this.setState({ focused: !0 }, t);
374
+ });
364
375
  }
365
376
  async load(t) {
366
- const e = this.props.component, n = this.props.config?.header?.component, r = this.props.config?.footer?.component;
377
+ const e = this.props.component, n = this.props.config?.header?.component, i = this.props.config?.footer?.component;
367
378
  let a;
368
- F(e) ? a = await e.load() : a = { default: e }, F(n) && await n.load(), F(r) && await r.load();
369
- const o = this.context.navigation, l = this.routeProp, m = !1;
370
- return await this.props.config?.onLoad?.({ navigation: o, route: l, signal: t, preloading: m }), a;
379
+ j(e) ? a = await e.load() : a = { default: e }, j(n) && await n.load(), j(i) && await i.load();
380
+ const o = this.context.navigation, l = this.routeProp, f = !1;
381
+ return await this.props.config?.onLoad?.({ navigation: o, route: l, signal: t, preloading: f }), a;
371
382
  }
372
383
  async onExited(t) {
373
384
  await this.routeProp.config.onExited?.({
@@ -408,9 +419,9 @@ class Se extends st {
408
419
  return this.#t;
409
420
  }
410
421
  render() {
411
- const t = this.context.navigation, e = this.routeProp, n = this.props.component, r = e.config.header?.component, a = e.config.footer?.component;
412
- return /* @__PURE__ */ b(
413
- be,
422
+ const t = this.context.navigation, e = this.routeProp, n = this.props.component, i = e.config.header?.component, a = e.config.footer?.component;
423
+ return /* @__PURE__ */ T(
424
+ Me,
414
425
  {
415
426
  ref: this.#t,
416
427
  renderAs: this.state.elementType,
@@ -418,7 +429,7 @@ class Se extends st {
418
429
  animation: e.config.animation,
419
430
  navigation: t,
420
431
  focused: this.state.focused,
421
- children: /* @__PURE__ */ b(
432
+ children: /* @__PURE__ */ T(
422
433
  "div",
423
434
  {
424
435
  id: `${this.context.id}-${this.name}`,
@@ -431,10 +442,58 @@ class Se extends st {
431
442
  flexDirection: "column",
432
443
  pointerEvents: "inherit"
433
444
  },
434
- children: /* @__PURE__ */ b(Zt.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ b(Qt.Provider, { value: e, children: /* @__PURE__ */ Gt(Jt.Provider, { value: this.nestedRouterData, children: [
435
- /* @__PURE__ */ b(bt, { fallback: /* @__PURE__ */ b(Z, { component: e.config.header?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: r, route: e, navigation: t }) }),
436
- /* @__PURE__ */ b(bt, { fallback: /* @__PURE__ */ b(Z, { component: this.props.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: n, route: e, navigation: t }) }),
437
- /* @__PURE__ */ b(bt, { fallback: /* @__PURE__ */ b(Z, { component: e.config.footer?.fallback, route: e, navigation: t }), children: /* @__PURE__ */ b(Z, { component: a, route: e, navigation: t }) })
445
+ children: /* @__PURE__ */ T(ae.Provider, { value: this.sharedElementScene, children: /* @__PURE__ */ T(le.Provider, { value: e, children: /* @__PURE__ */ te(oe.Provider, { value: this.nestedRouterData, children: [
446
+ /* @__PURE__ */ T(xt, { fallback: /* @__PURE__ */ T(
447
+ _,
448
+ {
449
+ component: e.config.header?.fallback,
450
+ route: e,
451
+ navigation: t
452
+ }
453
+ ), children: /* @__PURE__ */ T(
454
+ _,
455
+ {
456
+ component: i,
457
+ route: e,
458
+ navigation: t
459
+ }
460
+ ) }),
461
+ /* @__PURE__ */ T(xt, { fallback: /* @__PURE__ */ T(
462
+ _,
463
+ {
464
+ component: this.props.fallback,
465
+ route: e,
466
+ navigation: t
467
+ }
468
+ ), children: /* @__PURE__ */ T(
469
+ _,
470
+ {
471
+ component: n,
472
+ route: e,
473
+ navigation: t
474
+ }
475
+ ) }),
476
+ /* @__PURE__ */ T(
477
+ xt,
478
+ {
479
+ fallback: /* @__PURE__ */ T(
480
+ _,
481
+ {
482
+ component: e.config.footer?.fallback,
483
+ route: e,
484
+ navigation: t
485
+ }
486
+ ),
487
+ children: /* @__PURE__ */ T(
488
+ _,
489
+ {
490
+ component: a,
491
+ route: e,
492
+ navigation: t
493
+ }
494
+ )
495
+ }
496
+ )
438
497
  ] }) }) })
439
498
  }
440
499
  )
@@ -442,41 +501,41 @@ class Se extends st {
442
501
  );
443
502
  }
444
503
  }
445
- function Z({ component: s, route: t, navigation: e }) {
446
- F(s) && s.module?.default && (s = s.module.default);
504
+ function _({ component: s, route: t, navigation: e }) {
505
+ j(s) && s.module?.default && (s = s.module.default);
447
506
  const n = s ?? null;
448
- return typeof n == "function" || te(n) ? /* @__PURE__ */ b(
507
+ return typeof n == "function" || ce(n) ? /* @__PURE__ */ T(
449
508
  n,
450
509
  {
451
510
  navigation: e,
452
511
  route: t
453
512
  }
454
- ) : Xt(n) ? Ht(n, {
513
+ ) : ne(n) ? ee(n, {
455
514
  navigation: e,
456
515
  route: t
457
- }) : /* @__PURE__ */ b(oe, { children: n });
516
+ }) : /* @__PURE__ */ T(ge, { children: n });
458
517
  }
459
- function Re(s) {
460
- return Xt(s) ? Object.getPrototypeOf(s.type) === Se : !1;
518
+ function Ne(s) {
519
+ return ne(s) ? Object.getPrototypeOf(s.type) === De : !1;
461
520
  }
462
- function te(s) {
521
+ function ce(s) {
463
522
  return typeof s == "object" && s !== null && s.$$typeof === Symbol.for("react.lazy");
464
523
  }
465
- function F(s) {
466
- return te(s) && "load" in s;
524
+ function j(s) {
525
+ return ce(s) && "load" in s;
467
526
  }
468
- function ke(s) {
527
+ function Ae(s) {
469
528
  return "style" in s && s.style instanceof CSSStyleDeclaration;
470
529
  }
471
- var xe = Object.defineProperty, Ce = (s, t, e) => t in s ? xe(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, j = (s, t, e) => (Ce(s, typeof t != "symbol" ? t + "" : t, e), e), Wt = (s, t, e) => {
530
+ var Ue = Object.defineProperty, Ie = (s, t, e) => t in s ? Ue(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, K = (s, t, e) => (Ie(s, typeof t != "symbol" ? t + "" : t, e), e), Kt = (s, t, e) => {
472
531
  if (!t.has(s))
473
532
  throw TypeError("Cannot " + e);
474
- }, i = (s, t, e) => (Wt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), g = (s, t, e) => {
533
+ }, r = (s, t, e) => (Kt(s, t, "read from private field"), e ? e.call(s) : t.get(s)), v = (s, t, e) => {
475
534
  if (t.has(s))
476
535
  throw TypeError("Cannot add the same private member more than once");
477
536
  t instanceof WeakSet ? t.add(s) : t.set(s, e);
478
- }, c = (s, t, e, n) => (Wt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), f = (s, t, e) => (Wt(s, t, "access private method"), e);
479
- const ut = {
537
+ }, c = (s, t, e, n) => (Kt(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e), g = (s, t, e) => (Kt(s, t, "access private method"), e);
538
+ const pt = {
480
539
  delay: 0,
481
540
  direction: "normal",
482
541
  duration: "auto",
@@ -485,19 +544,19 @@ const ut = {
485
544
  fill: "auto",
486
545
  iterationStart: 0,
487
546
  iterations: 1
488
- }, It = 1e3, Me = window.Animation, dt = window.KeyframeEffect;
489
- function Ft(s) {
547
+ }, jt = 1e3, We = window.Animation, yt = window.KeyframeEffect;
548
+ function Yt(s) {
490
549
  return Array.isArray(s);
491
550
  }
492
- function H(s) {
551
+ function Y(s) {
493
552
  return typeof s == "object" && s === null;
494
553
  }
495
554
  function h(s, t) {
496
- return H(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
555
+ return Y(s) || typeof s == "number" ? s : (t || ([t] = Object.keys(s.type())), s.to(t).value);
497
556
  }
498
- function Le(s, t = ut) {
499
- let { duration: e = "auto", iterations: n = 1, playbackRate: r = 1 } = t;
500
- if (H(s))
557
+ function $e(s, t = pt) {
558
+ let { duration: e = "auto", iterations: n = 1, playbackRate: i = 1 } = t;
559
+ if (Y(s))
501
560
  return s;
502
561
  if (typeof s == "number" || s.type().percent === void 0)
503
562
  throw new DOMException(
@@ -505,20 +564,20 @@ function Le(s, t = ut) {
505
564
  "NotSupportedError"
506
565
  );
507
566
  if (e === "auto")
508
- e = It;
567
+ e = jt;
509
568
  else if (e instanceof CSSNumericValue)
510
569
  e = e.to("ms").value;
511
570
  else if (typeof e == "string")
512
571
  throw new TypeError("Unknown effect duration keyword.");
513
- const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(r), m = a + l + o;
514
- return rt(
572
+ const { delay: a = 0, endDelay: o = 0 } = t, l = e / n * n / Math.abs(i), f = a + l + o;
573
+ return ot(
515
574
  s.to("percent").value,
516
575
  [0, 100],
517
- [0, m]
576
+ [0, f]
518
577
  );
519
578
  }
520
- function Et(s) {
521
- if (H(s) || typeof s == "number")
579
+ function kt(s) {
580
+ if (Y(s) || typeof s == "number")
522
581
  return s;
523
582
  if (s.type().time !== void 0)
524
583
  throw new DOMException(
@@ -527,78 +586,78 @@ function Et(s) {
527
586
  );
528
587
  return s.to("ms").value;
529
588
  }
530
- function Bt(s, t) {
531
- const e = t.length - 1, n = Math.floor(s * e), r = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
532
- return r + o * (a - r);
589
+ function Zt(s, t) {
590
+ const e = t.length - 1, n = Math.floor(s * e), i = t[n], a = t[Math.min(n + 1, e)], o = s * e - n;
591
+ return i + o * (a - i);
533
592
  }
534
- function Pe(s, t, e) {
535
- let n = 0, r = 0;
593
+ function Oe(s, t, e) {
594
+ let n = 0, i = 0;
536
595
  for (const [a, o] of Object.entries(s)) {
537
- const { min: l, max: m } = t, p = e[a] ?? 1, w = (o - l[a]) / (m[a] - l[a]) * p;
538
- n += w, r += p;
596
+ const { min: l, max: f } = t, d = e[a] ?? 1, m = (o - l[a]) / (f[a] - l[a]) * d;
597
+ n += m, i += d;
539
598
  }
540
- return n / r;
599
+ return n / i;
541
600
  }
542
- function rt(s, t, e, n = {}) {
543
- let r;
544
- if (typeof s == "number" && Ft(t)) {
601
+ function ot(s, t, e, n = {}) {
602
+ let i;
603
+ if (typeof s == "number" && Yt(t)) {
545
604
  const o = { x: t[0] }, l = { x: t[1] };
546
605
  t = { min: o, max: l }, s = { x: s };
547
606
  } else
548
607
  throw new TypeError("Input and input range must have the same dimensions.");
549
- if (r = Pe(s, t, n), r = De(r, 0, 1), Ft(e))
550
- return Bt(r, e);
608
+ if (i = Oe(s, t, n), i = Ve(i, 0, 1), Yt(e))
609
+ return Zt(i, e);
551
610
  const a = {};
552
611
  for (const o of Object.keys(e.min)) {
553
- const l = e.min[o], m = e.max[o], p = [l, m];
554
- a[o] = Bt(r, p);
612
+ const l = e.min[o], f = e.max[o], d = [l, f];
613
+ a[o] = Zt(i, d);
555
614
  }
556
615
  return a;
557
616
  }
558
- function De(s, t, e) {
617
+ function Ve(s, t, e) {
559
618
  return s < t ? t : e && s > e ? e : s;
560
619
  }
561
- function $t(s) {
620
+ function Bt(s) {
562
621
  let {
563
622
  duration: t = "auto",
564
623
  iterations: e = 1,
565
624
  playbackRate: n = 1,
566
- delay: r = 0,
625
+ delay: i = 0,
567
626
  endDelay: a = 0,
568
627
  localTime: o = null,
569
628
  progress: l = null
570
629
  } = s;
571
- const m = new CSSUnitValue(100, "percent");
630
+ const f = new CSSUnitValue(100, "percent");
572
631
  if (t === "auto")
573
- t = It, r = 0, a = 0;
632
+ t = jt, i = 0, a = 0;
574
633
  else if (t instanceof CSSNumericValue)
575
634
  t = t.to("ms").value;
576
635
  else if (typeof t == "string")
577
636
  throw TypeError("Unknown effect duration keyword.");
578
- const p = t / e, w = p * e / Math.abs(n), R = r + w + a;
579
- t = new CSSUnitValue(p / R * 100, "percent");
580
- const T = CSS.percent(t.to("percent").value * e / Math.abs(n));
581
- return o !== null && (l = h(o, "percent") / m.value), {
637
+ const d = t / e, m = d * e / Math.abs(n), S = i + m + a;
638
+ t = new CSSUnitValue(d / S * 100, "percent");
639
+ const E = CSS.percent(t.to("percent").value * e / Math.abs(n));
640
+ return o !== null && (l = h(o, "percent") / f.value), {
582
641
  ...s,
583
642
  progress: l,
584
- activeDuration: T,
643
+ activeDuration: E,
585
644
  duration: t,
586
645
  iterations: e,
587
- delay: r,
646
+ delay: i,
588
647
  endDelay: a,
589
- endTime: m
648
+ endTime: f
590
649
  };
591
650
  }
592
- function ee(s, t) {
593
- let { activeDuration: e = 0, localTime: n = null, endTime: r = 1 / 0, delay: a = 0 } = s;
594
- if (r = h(r), e = h(e), n = h(n), n == null || n === void 0)
651
+ function he(s, t) {
652
+ let { activeDuration: e = 0, localTime: n = null, endTime: i = 1 / 0, delay: a = 0 } = s;
653
+ if (i = h(i), e = h(e), n = h(n), n == null || n === void 0)
595
654
  return "idle";
596
- const o = Math.max(Math.min(a, r), 0), l = Math.max(Math.min(a + e, r), 0);
655
+ const o = Math.max(Math.min(a, i), 0), l = Math.max(Math.min(a + e, i), 0);
597
656
  return n < o || t === "backwards" && n === o ? "before" : n > l || t === "forwards" && n === l ? "after" : "active";
598
657
  }
599
- function Ae(s, t) {
600
- let { localTime: e = null, delay: n = 0, activeDuration: r = 0, fill: a } = s;
601
- if (r = h(r), e = h(e), e == null || e === void 0)
658
+ function Fe(s, t) {
659
+ let { localTime: e = null, delay: n = 0, activeDuration: i = 0, fill: a } = s;
660
+ if (i = h(i), e = h(e), e == null || e === void 0)
602
661
  return null;
603
662
  switch (t) {
604
663
  case "before":
@@ -606,65 +665,65 @@ function Ae(s, t) {
606
665
  case "active":
607
666
  return e - n;
608
667
  case "after":
609
- return a === "forwards" || a === "both" ? Math.max(Math.min(e - n, r), 0) : null;
668
+ return a === "forwards" || a === "both" ? Math.max(Math.min(e - n, i), 0) : null;
610
669
  default:
611
670
  return null;
612
671
  }
613
672
  }
614
- function Ne(s, t, e) {
615
- const { duration: n = 0, iterations: r = 1, iterationStart: a = 0 } = s;
673
+ function Ke(s, t, e) {
674
+ const { duration: n = 0, iterations: i = 1, iterationStart: a = 0 } = s;
616
675
  if (typeof n != "number")
617
676
  throw new TypeError("Duration cannot be unresolved");
618
677
  let o = 0;
619
- return n === 0 ? t === "before" ? o = 0 : o = r : o = e / Et(n), o + a;
678
+ return n === 0 ? t === "before" ? o = 0 : o = i : o = e / kt(n), o + a;
620
679
  }
621
- function Ue(s, t, e, n) {
622
- const { iterations: r = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
623
- if (H(e))
680
+ function je(s, t, e, n) {
681
+ const { iterations: i = 1, iterationStart: a = 0, activeDuration: o = 0 } = s;
682
+ if (Y(e))
624
683
  return null;
625
684
  let l = 0;
626
- return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n && r !== 0 && (l = 1), l;
685
+ return e === 1 / 0 && (l = a % 1), l === 0 && (t === "active" || t === "after") && o === n && i !== 0 && (l = 1), l;
627
686
  }
628
- function ne(s, t) {
629
- const { iterations: e = 1 } = s, n = Ae(s, t);
630
- if (H(n))
687
+ function ue(s, t) {
688
+ const { iterations: e = 1 } = s, n = Fe(s, t);
689
+ if (Y(n))
631
690
  return null;
632
691
  if (t === "after" && e === 1 / 0)
633
692
  return 1 / 0;
634
- const r = Ne(s, t, n);
635
- return Ue(s, t, r, n) === 1 ? Math.floor(r) - 1 : Math.floor(r);
693
+ const i = Ke(s, t, n);
694
+ return je(s, t, i, n) === 1 ? Math.floor(i) - 1 : Math.floor(i);
636
695
  }
637
- class We extends Event {
696
+ class Be extends Event {
638
697
  constructor(t) {
639
- super("update", { bubbles: !1, cancelable: !1, composed: !1 }), j(this, "currentTime"), this.currentTime = t;
698
+ super("update", { bubbles: !1, cancelable: !1, composed: !1 }), K(this, "currentTime"), this.currentTime = t;
640
699
  }
641
700
  }
642
- var N, Y;
643
- class E extends EventTarget {
701
+ var A, Q;
702
+ class b extends EventTarget {
644
703
  constructor(t = { type: "swipe", axis: "x", rangeStart: 0, rangeEnd: window.screen.availWidth, source: document.body }) {
645
- super(), g(this, N, void 0), g(this, Y, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), c(this, Y, CSS.percent(0)), c(this, N, t);
704
+ super(), v(this, A, void 0), v(this, Q, void 0), t.source.addEventListener(t.type, this.onGesture.bind(this)), c(this, Q, CSS.percent(0)), c(this, A, t);
646
705
  }
647
706
  onGesture(t) {
648
- const e = i(this, N).source.getBoundingClientRect();
707
+ const e = r(this, A).source.getBoundingClientRect();
649
708
  let n = 0;
650
- const r = {
709
+ const i = {
651
710
  x: t.x - e.left,
652
711
  y: t.y - e.top
653
712
  };
654
- switch (i(this, N).type) {
713
+ switch (r(this, A).type) {
655
714
  case "swipe": {
656
- const { rangeStart: a, rangeEnd: o } = i(this, N), l = i(this, N).axis;
657
- n = rt(
658
- r[l],
715
+ const { rangeStart: a, rangeEnd: o } = r(this, A), l = r(this, A).axis;
716
+ n = ot(
717
+ i[l],
659
718
  [h(a, "px"), h(o, "px")],
660
719
  [0, 100]
661
720
  );
662
721
  break;
663
722
  }
664
723
  case "pan": {
665
- const { rangeStart: a, rangeEnd: o } = i(this, N), { x: l, y: m } = r;
666
- n = rt(
667
- { x: l, y: m },
724
+ const { rangeStart: a, rangeEnd: o } = r(this, A), { x: l, y: f } = i;
725
+ n = ot(
726
+ { x: l, y: f },
668
727
  {
669
728
  min: { x: h(a.x, "px"), y: h(a.y, "px") },
670
729
  max: { x: h(o.x, "px"), y: h(o.y, "px") }
@@ -675,8 +734,8 @@ class E extends EventTarget {
675
734
  break;
676
735
  }
677
736
  case "pinch": {
678
- const { rangeStart: a, rangeEnd: o } = i(this, N), { scale: l } = t;
679
- n = rt(
737
+ const { rangeStart: a, rangeEnd: o } = r(this, A), { scale: l } = t;
738
+ n = ot(
680
739
  l,
681
740
  [h(a, ""), h(o, "")],
682
741
  // figure out which unit
@@ -685,15 +744,15 @@ class E extends EventTarget {
685
744
  break;
686
745
  }
687
746
  case "rotate": {
688
- const { rangeStart: a, rangeEnd: o } = i(this, N), { rotation: l } = t;
689
- n = rt(
747
+ const { rangeStart: a, rangeEnd: o } = r(this, A), { rotation: l } = t;
748
+ n = ot(
690
749
  l,
691
750
  [h(a, "deg"), h(o, "deg")],
692
751
  [0, 100]
693
752
  );
694
753
  }
695
754
  }
696
- c(this, Y, CSS.percent(n)), this.dispatchEvent(new We(i(this, Y)));
755
+ c(this, Q, CSS.percent(n)), this.dispatchEvent(new Be(r(this, Q)));
697
756
  }
698
757
  addEventListener(t, e, n) {
699
758
  super.addEventListener(t, e, n);
@@ -702,26 +761,26 @@ class E extends EventTarget {
702
761
  super.removeEventListener(t, e, n);
703
762
  }
704
763
  get currentTime() {
705
- return i(this, Y);
764
+ return r(this, Q);
706
765
  }
707
766
  get phase() {
708
767
  return "active";
709
768
  }
710
769
  }
711
- N = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
712
- const A = /* @__PURE__ */ new WeakMap();
713
- var at;
714
- class pt extends dt {
770
+ A = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap();
771
+ const N = /* @__PURE__ */ new WeakMap();
772
+ var lt;
773
+ class wt extends yt {
715
774
  constructor(t, e = null) {
716
- super(t), g(this, at, null), c(this, at, e);
775
+ super(t), v(this, lt, null), c(this, lt, e);
717
776
  }
718
777
  get parent() {
719
- return i(this, at);
778
+ return r(this, lt);
720
779
  }
721
780
  getTiming() {
722
781
  var t;
723
782
  const e = super.getTiming();
724
- if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof E) {
783
+ if (((t = N.get(this)) == null ? void 0 : t.timeline) instanceof b) {
725
784
  if (e.duration === 1 / 0)
726
785
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
727
786
  if (e.iterations === 1 / 0)
@@ -732,12 +791,12 @@ class pt extends dt {
732
791
  getComputedTiming() {
733
792
  var t;
734
793
  const e = super.getComputedTiming();
735
- if (((t = A.get(this)) == null ? void 0 : t.timeline) instanceof E) {
794
+ if (((t = N.get(this)) == null ? void 0 : t.timeline) instanceof b) {
736
795
  if (e.duration === 1 / 0)
737
796
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
738
797
  if (e.iterations === 1 / 0)
739
798
  throw TypeError("Effect iterations cannot be Infinity for non-monotonic timelines.");
740
- return $t(e);
799
+ return Bt(e);
741
800
  }
742
801
  return e;
743
802
  }
@@ -749,12 +808,12 @@ class pt extends dt {
749
808
  duration: n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration,
750
809
  ...t
751
810
  };
752
- let r = i(this, at);
753
- for (; r; ) {
754
- const a = r.getTiming();
755
- 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;
811
+ let i = r(this, lt);
812
+ for (; i; ) {
813
+ const a = i.getTiming();
814
+ 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")), i = i.parent;
756
815
  }
757
- if (((e = A.get(this)) == null ? void 0 : e.timeline) instanceof E) {
816
+ if (((e = N.get(this)) == null ? void 0 : e.timeline) instanceof b) {
758
817
  if (t?.duration === 1 / 0)
759
818
  throw TypeError("Effect duration cannot be Infinity for non-monotonic timelines.");
760
819
  if (t != null && t.iterations)
@@ -763,17 +822,17 @@ class pt extends dt {
763
822
  return super.updateTiming(t);
764
823
  }
765
824
  }
766
- at = /* @__PURE__ */ new WeakMap();
767
- var U, _;
768
- const Ie = class ft {
825
+ lt = /* @__PURE__ */ new WeakMap();
826
+ var U, tt;
827
+ const qe = class Et {
769
828
  constructor(t) {
770
- g(this, U, []), g(this, _, null), c(this, U, t.map((e) => (e instanceof ft ? c(e, _, this) : e instanceof dt && (e = new pt(e, this)), e)));
829
+ v(this, U, []), v(this, tt, null), c(this, U, t.map((e) => (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), e)));
771
830
  }
772
831
  get parent() {
773
- return i(this, _);
832
+ return r(this, tt);
774
833
  }
775
834
  get children() {
776
- const t = i(this, U);
835
+ const t = r(this, U);
777
836
  return {
778
837
  length: t.length,
779
838
  item(e) {
@@ -782,30 +841,30 @@ const Ie = class ft {
782
841
  };
783
842
  }
784
843
  get firstChild() {
785
- return i(this, U).at(0) ?? null;
844
+ return r(this, U).at(0) ?? null;
786
845
  }
787
846
  get lastChild() {
788
- return i(this, U).at(-1) ?? null;
847
+ return r(this, U).at(-1) ?? null;
789
848
  }
790
849
  clone() {
791
850
  return structuredClone(this);
792
851
  }
793
852
  append(...t) {
794
853
  t.forEach((e) => {
795
- i(this, U).includes(e) || (e instanceof ft ? c(e, _, this) : e instanceof dt && (e = new pt(e, this)), i(this, U).push(e));
854
+ r(this, U).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), r(this, U).push(e));
796
855
  });
797
856
  }
798
857
  prepend(...t) {
799
858
  t.forEach((e) => {
800
- i(this, U).includes(e) || (e instanceof ft ? c(e, _, this) : e instanceof dt && (e = new pt(e, this)), i(this, U).unshift(e));
859
+ r(this, U).includes(e) || (e instanceof Et ? c(e, tt, this) : e instanceof yt && (e = new wt(e, this)), r(this, U).unshift(e));
801
860
  });
802
861
  }
803
862
  };
804
- U = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap();
805
- let Ot = Ie;
806
- class nt {
863
+ U = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap();
864
+ let qt = qe;
865
+ class rt {
807
866
  constructor() {
808
- 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) => {
867
+ K(this, "promise"), K(this, "state"), K(this, "nativeResolve"), K(this, "nativeReject"), this.state = "pending", this.nativeResolve = this.nativeReject = null, this.promise = new Promise((t, e) => {
809
868
  this.nativeResolve = t, this.nativeReject = e;
810
869
  });
811
870
  }
@@ -819,11 +878,11 @@ class nt {
819
878
  }), (e = this.nativeReject) == null || e.call(this, t);
820
879
  }
821
880
  }
822
- var J, St, ie;
823
- class $e extends Ot {
824
- constructor(t, e = ut) {
825
- super(t), g(this, St), g(this, J, void 0), c(this, J, {
826
- ...ut,
881
+ var et, Mt, de;
882
+ class ze extends qt {
883
+ constructor(t, e = pt) {
884
+ super(t), v(this, Mt), v(this, et, void 0), c(this, et, {
885
+ ...pt,
827
886
  ...e
828
887
  });
829
888
  }
@@ -834,31 +893,31 @@ class $e extends Ot {
834
893
  super.append(...t), t.forEach((e) => e.updateTiming());
835
894
  }
836
895
  getTiming() {
837
- return i(this, J);
896
+ return r(this, et);
838
897
  }
839
898
  getComputedTiming() {
840
899
  var t, e;
841
- const n = this.getTiming(), r = { ...n }, { delay: a = 0 } = ((t = this.children.item(0)) == null ? void 0 : t.getComputedTiming()) ?? {}, { endDelay: o = 0, endTime: l = 0 } = ((e = this.children.item(this.children.length - 1)) == null ? void 0 : e.getComputedTiming()) ?? {};
842
- n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, r.endTime = l;
900
+ const n = this.getTiming(), i = { ...n }, { delay: a = 0 } = ((t = this.children.item(0)) == null ? void 0 : t.getComputedTiming()) ?? {}, { endDelay: o = 0, endTime: l = 0 } = ((e = this.children.item(this.children.length - 1)) == null ? void 0 : e.getComputedTiming()) ?? {};
901
+ n.delay = n.delay ? n.delay + a : a, n.endDelay = n.endDelay ? n.endDelay + o : o, i.endTime = l;
843
902
  for (let C = 0; C < this.children.length; C++) {
844
- const M = this.children.item(C);
845
- if (!M)
903
+ const L = this.children.item(C);
904
+ if (!L)
846
905
  continue;
847
906
  let {
848
- duration: L = "auto",
849
- activeDuration: Vt = 0
850
- } = M.getComputedTiming();
851
- 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));
907
+ duration: M = "auto",
908
+ activeDuration: zt = 0
909
+ } = L.getComputedTiming();
910
+ i.activeDuration = i.activeDuration ? h(i.activeDuration, "ms") + h(zt, "ms") : zt, n.duration = n.duration instanceof CSSNumericValue ? n.duration.to("ms").value : n.duration, M = M instanceof CSSNumericValue ? M.to("ms").value : M, typeof M != "string" && (n.duration === "auto" ? n.duration = h(M, "ms") : typeof n.duration != "string" && (n.duration = n.duration ? n.duration + M : M));
852
911
  }
853
- const { timeline: m, startTime: p, currentTime: w } = A.get(this) ?? {}, R = m instanceof E ? "percent" : "ms";
854
- let { duration: T = 0, iterations: X = 1 } = r;
855
- if (T === "auto" && (T = 0), typeof T == "string")
912
+ const { timeline: f, startTime: d, currentTime: m } = N.get(this) ?? {}, S = f instanceof b ? "percent" : "ms";
913
+ let { duration: E = 0, iterations: Z = 1 } = i;
914
+ if (E === "auto" && (E = 0), typeof E == "string")
856
915
  throw new TypeError("Unknown effect duration keyword.");
857
- return r.duration = T, r.activeDuration = Et(T) * X, r.startTime = p ?? void 0, r.localTime = w, r.currentIteration = ne(r, ee(r, i(this, St, ie))), m instanceof E ? $t(r) : (m instanceof DocumentTimeline && (r.progress = w && h(w, R) / h(l, R)), r);
916
+ return i.duration = E, i.activeDuration = kt(E) * Z, i.startTime = d ?? void 0, i.localTime = m, i.currentIteration = ue(i, he(i, r(this, Mt, de))), f instanceof b ? Bt(i) : (f instanceof DocumentTimeline && (i.progress = m && h(m, S) / h(l, S)), i);
858
917
  }
859
918
  updateTiming(t) {
860
- c(this, J, {
861
- ...i(this, J),
919
+ c(this, et, {
920
+ ...r(this, et),
862
921
  ...t
863
922
  });
864
923
  for (let e = 0; e < this.children.length; e++) {
@@ -867,28 +926,28 @@ class $e extends Ot {
867
926
  }
868
927
  }
869
928
  }
870
- J = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), ie = function() {
871
- const { playbackRate: s = 1 } = A.get(this) ?? {};
929
+ et = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakSet(), de = function() {
930
+ const { playbackRate: s = 1 } = N.get(this) ?? {};
872
931
  return s < 0 ? "backwards" : "forwards";
873
932
  };
874
- var d, x, ht, v, S, P, u, y, k, 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;
875
- const se = class extends EventTarget {
933
+ var p, x, dt, w, R, P, u, y, k, G, V, ct, I, bt, Pt, nt, ht, z, it, Dt, _t, Nt, Jt, At, Qt, B, X, ut, Tt, Ut, W, F, D, $, St, It, Wt;
934
+ const fe = class extends EventTarget {
876
935
  constructor(t, e) {
877
- super(), g(this, mt), g(this, Q), g(this, q), g(this, kt), g(this, xt), g(this, Ct), g(this, B), g(this, gt), g(this, I), g(this, D), j(this, "id", ""), j(this, "oncancel", null), j(this, "onfinish", null), j(this, "onremove", null), g(this, d, void 0), g(this, x, void 0), g(this, ht, "active"), g(this, v, {
936
+ super(), v(this, bt), v(this, nt), v(this, z), v(this, Dt), v(this, Nt), v(this, At), v(this, B), v(this, Tt), v(this, W), v(this, D), K(this, "id", ""), K(this, "oncancel", null), K(this, "onfinish", null), K(this, "onremove", null), v(this, p, void 0), v(this, x, void 0), v(this, dt, "active"), v(this, w, {
878
937
  task: null,
879
938
  playbackRate: null
880
- }), g(this, S, new nt()), g(this, P, new nt()), g(this, u, null), g(this, y, null), g(this, k, []), g(this, z, null), g(this, O, !1), g(this, ot, 0), g(this, W, 1), g(this, ct, () => {
881
- f(this, B, G).call(this);
882
- }), g(this, yt, () => {
939
+ }), v(this, R, new rt()), v(this, P, new rt()), v(this, u, null), v(this, y, null), v(this, k, []), v(this, G, null), v(this, V, !1), v(this, ct, 0), v(this, I, 1), v(this, ut, () => {
940
+ g(this, B, X).call(this);
941
+ }), v(this, St, () => {
883
942
  var n;
884
- if (i(this, P).state !== "pending" || this.playState !== "finished")
943
+ if (r(this, P).state !== "pending" || this.playState !== "finished")
885
944
  return;
886
- i(this, P).resolve(this);
887
- const r = this.currentTime, a = (n = this.timeline) == null ? void 0 : n.currentTime, o = new AnimationPlaybackEvent(
945
+ r(this, P).resolve(this);
946
+ const i = this.currentTime, a = (n = this.timeline) == null ? void 0 : n.currentTime, o = new AnimationPlaybackEvent(
888
947
  "finish",
889
948
  {
890
949
  get currentTime() {
891
- return r;
950
+ return i;
892
951
  },
893
952
  get timelineTime() {
894
953
  return a;
@@ -899,8 +958,8 @@ const se = class extends EventTarget {
899
958
  var l;
900
959
  this.dispatchEvent(o), (l = this.onfinish) == null || l.call(this, o);
901
960
  });
902
- }), g(this, Lt, () => {
903
- var n, r;
961
+ }), v(this, It, () => {
962
+ var n, i;
904
963
  const a = this.currentTime, o = (n = this.timeline) == null ? void 0 : n.currentTime, l = new AnimationPlaybackEvent(
905
964
  "cancel",
906
965
  {
@@ -912,21 +971,21 @@ const se = class extends EventTarget {
912
971
  }
913
972
  }
914
973
  );
915
- this.dispatchEvent(l), (r = this.oncancel) == null || r.call(this, l);
916
- }), g(this, Pt, () => {
974
+ this.dispatchEvent(l), (i = this.oncancel) == null || i.call(this, l);
975
+ }), v(this, Wt, () => {
917
976
  var n;
918
- const r = new Event("remove");
919
- this.dispatchEvent(r), (n = this.onremove) == null || n.call(this, r);
920
- }), i(this, S).resolve(this), c(this, x, t ?? null), c(this, d, e ?? document.timeline), i(this, x) && A.set(i(this, x), this), f(this, gt, Mt).call(this), e instanceof E && e.addEventListener("update", i(this, ct));
977
+ const i = new Event("remove");
978
+ this.dispatchEvent(i), (n = this.onremove) == null || n.call(this, i);
979
+ }), r(this, R).resolve(this), c(this, x, t ?? null), c(this, p, e ?? document.timeline), r(this, x) && N.set(r(this, x), this), g(this, Tt, Ut).call(this), e instanceof b && e.addEventListener("update", r(this, ut));
921
980
  }
922
981
  reverse() {
923
982
  var t;
924
- const { endTime: e = 0 } = ((t = i(this, x)) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W), r = h(this.currentTime), a = e === 1 / 0, o = n !== 0 && (n < 0 || r && r > 0 || !a);
925
- if (!i(this, d) || !o) {
926
- o && (i(this, v).playbackRate = -n);
983
+ const { endTime: e = 0 } = ((t = r(this, x)) == null ? void 0 : t.getComputedTiming()) ?? {}, n = r(this, w).playbackRate ?? r(this, I), i = h(this.currentTime), a = e === 1 / 0, o = n !== 0 && (n < 0 || i && i > 0 || !a);
984
+ if (!r(this, p) || !o) {
985
+ o && (r(this, w).playbackRate = -n);
927
986
  return;
928
987
  }
929
- if (i(this, d).currentTime === null)
988
+ if (r(this, p).currentTime === null)
930
989
  throw new DOMException(
931
990
  "Cannot reverse an animation with no active timeline",
932
991
  "InvalidStateError"
@@ -934,58 +993,57 @@ const se = class extends EventTarget {
934
993
  this.updatePlaybackRate(-n), this.play();
935
994
  }
936
995
  play() {
937
- const t = this.playState === "paused" && this.pending;
938
- let e = this.currentTime;
939
- (i(this, v).playbackRate ?? this.playbackRate) === 0 && e === null && c(this, y, 0), e === null && c(this, O, !0), (this.playState === "finished" || t) && (c(this, u, null), c(this, y, null), c(this, O, !0)), i(this, y) && c(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) && (f(this, B, G).call(this), f(this, Q, lt).call(this), i(this, v).task = "play", f(this, I, V).call(this, !1));
996
+ const t = this.playState === "paused" && this.pending, e = this.currentTime;
997
+ (r(this, w).playbackRate ?? this.playbackRate) === 0 && e === null && c(this, y, 0), e === null && c(this, V, !0), (this.playState === "finished" || t) && (c(this, u, null), c(this, y, null), c(this, V, !0)), r(this, y) && c(this, u, null), r(this, w).task && (r(this, w).task = null), !(r(this, u) !== null && r(this, y) === null && !t && r(this, w).playbackRate === null) && (g(this, B, X).call(this), g(this, nt, ht).call(this), r(this, w).task = "play", g(this, W, F).call(this, !1));
940
998
  }
941
999
  pause() {
942
- this.playState !== "paused" && (this.currentTime === null && c(this, O, !0), i(this, v).task && (i(this, v).task = null), f(this, Q, lt).call(this), i(this, v).task = "pause");
1000
+ this.playState !== "paused" && (this.currentTime === null && c(this, V, !0), r(this, w).task && (r(this, w).task = null), g(this, nt, ht).call(this), r(this, w).task = "pause");
943
1001
  }
944
1002
  persist() {
945
- i(this, k).forEach((t) => t.persist()), c(this, ht, "persisted");
1003
+ r(this, k).forEach((t) => t.persist()), c(this, dt, "persisted");
946
1004
  }
947
1005
  finish() {
948
1006
  var t;
949
- const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = i(this, v).playbackRate ?? i(this, W);
1007
+ const { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {}, n = r(this, w).playbackRate ?? r(this, I);
950
1008
  if (n === 0 || n > 0 && e === 1 / 0)
951
1009
  throw new DOMException("InvalidStateError");
952
- f(this, D, $).call(this);
953
- let r;
954
- if (n > 0 ? r = e : r = 0, f(this, mt, Rt).call(this, r), this.startTime === null && i(this, d) !== null && i(this, d).currentTime !== null && r !== null) {
955
- const a = i(this, d) instanceof E ? "percent" : "ms";
956
- r = h(r, a);
957
- const o = h(i(this, d).currentTime, a);
958
- c(this, u, o - r / n);
1010
+ g(this, D, $).call(this);
1011
+ let i;
1012
+ if (n > 0 ? i = e : i = 0, g(this, bt, Pt).call(this, i), this.startTime === null && r(this, p) !== null && r(this, p).currentTime !== null && i !== null) {
1013
+ const a = r(this, p) instanceof b ? "percent" : "ms";
1014
+ i = h(i, a);
1015
+ const o = h(r(this, p).currentTime, a);
1016
+ c(this, u, o - i / n);
959
1017
  }
960
- i(this, v).task === "pause" && i(this, u) !== null && (c(this, y, null), f(this, q, tt).call(this), i(this, S).resolve(this)), i(this, v).task === "play" && i(this, u) !== null && (f(this, q, tt).call(this), i(this, S).resolve(this)), f(this, I, V).call(this, !0), i(this, k).forEach((a) => a.finish());
1018
+ r(this, w).task === "pause" && r(this, u) !== null && (c(this, y, null), g(this, z, it).call(this), r(this, R).resolve(this)), r(this, w).task === "play" && r(this, u) !== null && (g(this, z, it).call(this), r(this, R).resolve(this)), g(this, W, F).call(this, !0), r(this, k).forEach((a) => a.finish());
961
1019
  }
962
1020
  commitStyles() {
963
- i(this, k).forEach((t) => {
964
- t.effect instanceof pt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
1021
+ r(this, k).forEach((t) => {
1022
+ t.effect instanceof wt && (t.effect.target === null || t.effect.pseudoElement !== null) || t.commitStyles();
965
1023
  });
966
1024
  }
967
1025
  cancel() {
968
- this.playState !== "idle" && (f(this, D, $).call(this), i(this, S).reject(new DOMException("The user aborted a request", "AbortError")), f(this, q, tt).call(this), c(this, S, new nt()), i(this, P).state === "pending" && i(this, P).reject(new DOMException("The user aborted a request", "AbortError")), c(this, P, new nt()), i(this, k).forEach((t) => t.cancel())), c(this, u, null), c(this, y, null);
1026
+ this.playState !== "idle" && (g(this, D, $).call(this), r(this, R).reject(new DOMException("The user aborted a request", "AbortError")), g(this, z, it).call(this), c(this, R, new rt()), r(this, P).state === "pending" && r(this, P).reject(new DOMException("The user aborted a request", "AbortError")), c(this, P, new rt()), r(this, k).forEach((t) => t.cancel())), c(this, u, null), c(this, y, null);
969
1027
  }
970
1028
  updatePlaybackRate(t) {
971
1029
  var e;
972
- i(this, v).playbackRate = t;
1030
+ r(this, w).playbackRate = t;
973
1031
  const n = this.playState;
974
- if (i(this, S).state !== "pending")
1032
+ if (r(this, R).state !== "pending")
975
1033
  switch (n) {
976
1034
  case "idle":
977
1035
  case "paused":
978
- f(this, D, $).call(this);
1036
+ g(this, D, $).call(this);
979
1037
  break;
980
1038
  case "finished": {
981
- const r = i(this, d) instanceof E ? "percent" : "ms", a = ((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null;
1039
+ const i = r(this, p) instanceof b ? "percent" : "ms", a = ((e = r(this, p)) == null ? void 0 : e.currentTime) ?? null;
982
1040
  if (t === 0)
983
- c(this, u, h(a, r));
1041
+ c(this, u, h(a, i));
984
1042
  else if (a !== null) {
985
1043
  let o = null;
986
- o = (h(a, r) - (i(this, u) ?? 0)) * this.playbackRate, i(this, u) !== null && o !== null && c(this, u, (h(a, r) - o) / t);
1044
+ o = (h(a, i) - (r(this, u) ?? 0)) * this.playbackRate, r(this, u) !== null && o !== null && c(this, u, (h(a, i) - o) / t);
987
1045
  }
988
- f(this, D, $).call(this), f(this, I, V).call(this, !1), f(this, B, G).call(this);
1046
+ g(this, D, $).call(this), g(this, W, F).call(this, !1), g(this, B, X).call(this);
989
1047
  break;
990
1048
  }
991
1049
  default:
@@ -999,212 +1057,210 @@ const se = class extends EventTarget {
999
1057
  super.removeEventListener(t, e, n);
1000
1058
  }
1001
1059
  set playbackRate(t) {
1002
- c(this, W, t), i(this, k).forEach((e) => {
1060
+ c(this, I, t), r(this, k).forEach((e) => {
1003
1061
  e.playbackRate *= t;
1004
1062
  });
1005
1063
  }
1006
1064
  set startTime(t) {
1007
- c(this, u, h(t)), i(this, k).forEach((e) => e.startTime = t);
1065
+ c(this, u, h(t)), r(this, k).forEach((e) => e.startTime = t);
1008
1066
  }
1009
1067
  set currentTime(t) {
1010
1068
  var e;
1011
- const n = i(this, d) instanceof E ? "percent" : "ms", r = h(((e = i(this, d)) == null ? void 0 : e.currentTime) ?? null, n);
1012
- if (H(t) && !H(r))
1069
+ const n = r(this, p) instanceof b ? "percent" : "ms", i = h(((e = r(this, p)) == null ? void 0 : e.currentTime) ?? null, n);
1070
+ if (Y(t) && !Y(i))
1013
1071
  throw new TypeError("currentTime may not be changed from resolved to unresolved.");
1014
- c(this, O, !1), i(this, y) !== null || i(this, u) === null || r === null || this.playbackRate === 0 ? c(this, y, h(t, n)) : c(this, u, r - h(t, n) / this.playbackRate), (i(this, d) === null || r === null) && c(this, u, null), c(this, z, null), f(this, mt, Rt).call(this, t), i(this, v).task === "pause" && (c(this, y, h(t, n)), f(this, D, $).call(this), c(this, u, null), f(this, q, tt).call(this), i(this, S).resolve(this)), f(this, I, V).call(this, !0);
1072
+ c(this, V, !1), r(this, y) !== null || r(this, u) === null || i === null || this.playbackRate === 0 ? c(this, y, h(t, n)) : c(this, u, i - h(t, n) / this.playbackRate), (r(this, p) === null || i === null) && c(this, u, null), c(this, G, null), g(this, bt, Pt).call(this, t), r(this, w).task === "pause" && (c(this, y, h(t, n)), g(this, D, $).call(this), c(this, u, null), g(this, z, it).call(this), r(this, R).resolve(this)), g(this, W, F).call(this, !0);
1015
1073
  }
1016
1074
  set timeline(t) {
1017
1075
  var e, n;
1018
- const r = this.timeline;
1019
- if (r === t)
1076
+ const i = this.timeline;
1077
+ if (i === t)
1020
1078
  return;
1021
- i(this, d) instanceof E && i(this, d).removeEventListener("update", i(this, ct));
1022
- const a = this.playState, o = r instanceof E ? "percent" : "ms", l = h(this.currentTime, o), { progress: m = null, endTime: p = 0 } = ((e = i(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, w = h(p, o), R = r instanceof E, T = t instanceof E, X = t instanceof DocumentTimeline, C = this.pending;
1023
- if (T)
1024
- c(this, d, t), t.addEventListener("update", i(this, ct)), f(this, D, $).call(this), c(this, O, !0), c(this, u, null), c(this, y, null), (a === "running" || a === "finished") && ((!i(this, S) || i(this, S).state === "resolved") && f(this, Q, lt).call(this), i(this, v).task = "play", i(this, k).forEach((M) => M.pause())), a === "paused" && m !== null && c(this, y, m * w), C && ((!i(this, S) || i(this, S).state === "resolved") && f(this, Q, lt).call(this), a === "paused" ? i(this, v).task = "pause" : i(this, v).task = "play"), i(this, u) !== null && c(this, y, null), f(this, I, V).call(this, !1);
1025
- else if (X) {
1026
- if (c(this, d, t), R) {
1027
- if (l !== null && m !== null) {
1028
- const { endTime: M = 0 } = ((n = i(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, L = h(M, "ms");
1029
- this.currentTime = m * L;
1079
+ r(this, p) instanceof b && r(this, p).removeEventListener("update", r(this, ut));
1080
+ const a = this.playState, o = i instanceof b ? "percent" : "ms", l = h(this.currentTime, o), { progress: f = null, endTime: d = 0 } = ((e = r(this, x)) == null ? void 0 : e.getComputedTiming()) ?? {}, m = h(d, o), S = i instanceof b, E = t instanceof b, Z = t instanceof DocumentTimeline, C = this.pending;
1081
+ if (E)
1082
+ c(this, p, t), t.addEventListener("update", r(this, ut)), g(this, D, $).call(this), c(this, V, !0), c(this, u, null), c(this, y, null), (a === "running" || a === "finished") && ((!r(this, R) || r(this, R).state === "resolved") && g(this, nt, ht).call(this), r(this, w).task = "play", r(this, k).forEach((L) => L.pause())), a === "paused" && f !== null && c(this, y, f * m), C && ((!r(this, R) || r(this, R).state === "resolved") && g(this, nt, ht).call(this), a === "paused" ? r(this, w).task = "pause" : r(this, w).task = "play"), r(this, u) !== null && c(this, y, null), g(this, W, F).call(this, !1);
1083
+ else if (Z) {
1084
+ if (c(this, p, t), S) {
1085
+ if (l !== null && f !== null) {
1086
+ const { endTime: L = 0 } = ((n = r(this, x)) == null ? void 0 : n.getComputedTiming()) ?? {}, M = h(L, "ms");
1087
+ this.currentTime = f * M;
1030
1088
  }
1031
1089
  switch (a) {
1032
1090
  case "paused":
1033
- i(this, k).forEach((M) => M.pause());
1091
+ r(this, k).forEach((L) => L.pause());
1034
1092
  break;
1035
1093
  case "running":
1036
1094
  case "finished":
1037
- i(this, k).forEach((M) => M.play());
1095
+ r(this, k).forEach((L) => L.play());
1038
1096
  }
1039
1097
  }
1040
1098
  } else
1041
1099
  throw TypeError("Unsupported timeline: " + t);
1042
1100
  }
1043
1101
  set effect(t) {
1044
- if (t !== i(this, x)) {
1045
- if (this.pending && f(this, q, tt).call(this), i(this, x) && A.delete(i(this, x)), t) {
1046
- const e = A.get(t);
1047
- e && (e.effect = null), A.set(t, this);
1102
+ if (t !== r(this, x)) {
1103
+ if (this.pending && g(this, z, it).call(this), r(this, x) && N.delete(r(this, x)), t) {
1104
+ const e = N.get(t);
1105
+ e && (e.effect = null), N.set(t, this);
1048
1106
  }
1049
- c(this, x, t), f(this, gt, Mt).call(this), f(this, I, V).call(this, !1);
1107
+ c(this, x, t), g(this, Tt, Ut).call(this), g(this, W, F).call(this, !1);
1050
1108
  }
1051
1109
  }
1052
1110
  get ready() {
1053
- return i(this, S).promise;
1111
+ return r(this, R).promise;
1054
1112
  }
1055
1113
  get finished() {
1056
- return i(this, P).promise;
1114
+ return r(this, P).promise;
1057
1115
  }
1058
1116
  get playState() {
1059
1117
  var t;
1060
1118
  let { endTime: e = 0 } = ((t = this.effect) == null ? void 0 : t.getComputedTiming()) ?? {};
1061
- const n = i(this, d) instanceof E ? "percent" : "ms", r = h(this.startTime, n), a = h(this.currentTime, n);
1062
- 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";
1119
+ const n = r(this, p) instanceof b ? "percent" : "ms", i = h(this.startTime, n), a = h(this.currentTime, n);
1120
+ return e = h(e, n), a === null && i === null && r(this, w).task === null ? "idle" : r(this, w).task === "pause" || i === null && r(this, w).task !== "play" ? "paused" : a !== null && (r(this, I) > 0 && a >= e || r(this, I) < 0 && a <= 0) ? "finished" : "running";
1063
1121
  }
1064
1122
  get playbackRate() {
1065
- return i(this, W);
1123
+ return r(this, I);
1066
1124
  }
1067
1125
  get replaceState() {
1068
- return i(this, ht);
1126
+ return r(this, dt);
1069
1127
  }
1070
1128
  get pending() {
1071
- return i(this, S).state === "pending";
1129
+ return r(this, R).state === "pending";
1072
1130
  }
1073
1131
  get currentTime() {
1074
1132
  var t;
1075
1133
  const e = ((t = this.timeline) == null ? void 0 : t.currentTime) ?? null;
1076
- if (i(this, y)) {
1134
+ if (r(this, y)) {
1077
1135
  if (typeof e == "number")
1078
- return i(this, y);
1079
- const a = i(this, d) instanceof E ? "percent" : "ms";
1080
- return new CSSUnitValue(i(this, y), a);
1136
+ return r(this, y);
1137
+ const a = r(this, p) instanceof b ? "percent" : "ms";
1138
+ return new CSSUnitValue(r(this, y), a);
1081
1139
  }
1082
- if (e === null || i(this, u) === null)
1140
+ if (e === null || r(this, u) === null)
1083
1141
  return null;
1084
- const n = i(this, d) instanceof E ? "percent" : "ms";
1085
- let r = (h(e, n) - i(this, u)) * this.playbackRate;
1086
- return r === -0 && (r = 0), typeof e == "number" ? r : new CSSUnitValue(r, n);
1142
+ const n = r(this, p) instanceof b ? "percent" : "ms";
1143
+ let i = (h(e, n) - r(this, u)) * this.playbackRate;
1144
+ return i === -0 && (i = 0), typeof e == "number" ? i : new CSSUnitValue(i, n);
1087
1145
  }
1088
1146
  get startTime() {
1089
1147
  var t;
1090
- if (i(this, u) === null)
1148
+ if (r(this, u) === null)
1091
1149
  return null;
1092
1150
  if (typeof (((t = this.timeline) == null ? void 0 : t.currentTime) ?? null) == "number")
1093
- return i(this, u);
1094
- const e = i(this, d) instanceof E ? "percent" : "ms";
1095
- return new CSSUnitValue(i(this, u), e);
1151
+ return r(this, u);
1152
+ const e = r(this, p) instanceof b ? "percent" : "ms";
1153
+ return new CSSUnitValue(r(this, u), e);
1096
1154
  }
1097
1155
  get timeline() {
1098
- return i(this, d);
1156
+ return r(this, p);
1099
1157
  }
1100
1158
  get effect() {
1101
- return i(this, x);
1159
+ return r(this, x);
1102
1160
  }
1103
1161
  };
1104
- 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(), k = /* @__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) {
1162
+ p = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakSet(), Pt = function(s) {
1105
1163
  var t;
1106
- const e = h(((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null);
1164
+ const e = h(((t = r(this, p)) == null ? void 0 : t.currentTime) ?? null);
1107
1165
  if (s === null && e !== null)
1108
1166
  throw new TypeError();
1109
- s === null || e === null || (s = h(s), c(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 ? c(this, y, s) : c(this, u, e - s / i(this, W)), i(this, d) instanceof E && i(this, d).phase === "inactive" && c(this, u, null), c(this, z, null));
1110
- }, Q = /* @__PURE__ */ new WeakSet(), lt = function() {
1111
- i(this, S).state !== "pending" && c(this, S, new nt()), cancelAnimationFrame(i(this, ot)), c(this, ot, requestAnimationFrame(() => {
1167
+ s === null || e === null || (s = h(s), c(this, V, !1), r(this, y) !== null || r(this, u) === null || r(this, p) instanceof b && r(this, p).phase === "inactive" || r(this, I) === 0 ? c(this, y, s) : c(this, u, e - s / r(this, I)), r(this, p) instanceof b && r(this, p).phase === "inactive" && c(this, u, null), c(this, G, null));
1168
+ }, nt = /* @__PURE__ */ new WeakSet(), ht = function() {
1169
+ r(this, R).state !== "pending" && c(this, R, new rt()), cancelAnimationFrame(r(this, ct)), c(this, ct, requestAnimationFrame(() => {
1112
1170
  var s;
1113
- (((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null) !== null && (f(this, Ct, zt).call(this), i(this, v).task === "play" && (i(this, u) !== null || i(this, y) !== null) ? f(this, kt, Kt).call(this) : i(this, v).task === "pause" && f(this, xt, qt).call(this), Promise.all(i(this, k).map((t) => t.finished)).then(i(this, yt)), Promise.all(i(this, k).map((t) => new Promise((e) => t.onremove = e))).then(i(this, Pt)), Promise.all(i(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(i(this, Lt)).then(() => c(this, ht, "removed")));
1171
+ (((s = r(this, p)) == null ? void 0 : s.currentTime) ?? null) !== null && (g(this, At, Qt).call(this), r(this, w).task === "play" && (r(this, u) !== null || r(this, y) !== null) ? g(this, Dt, _t).call(this) : r(this, w).task === "pause" && g(this, Nt, Jt).call(this), Promise.all(r(this, k).map((t) => t.finished)).then(r(this, St)), Promise.all(r(this, k).map((t) => new Promise((e) => t.onremove = e))).then(r(this, Wt)), Promise.all(r(this, k).map((t) => new Promise((e) => t.oncancel = e))).then(r(this, It)).then(() => c(this, dt, "removed")));
1114
1172
  }));
1115
- }, q = /* @__PURE__ */ new WeakSet(), tt = function() {
1116
- cancelAnimationFrame(i(this, ot)), i(this, v).task = null;
1117
- }, kt = /* @__PURE__ */ new WeakSet(), Kt = function() {
1173
+ }, z = /* @__PURE__ */ new WeakSet(), it = function() {
1174
+ cancelAnimationFrame(r(this, ct)), r(this, w).task = null;
1175
+ }, Dt = /* @__PURE__ */ new WeakSet(), _t = function() {
1118
1176
  var s;
1119
1177
  const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1120
1178
  if (t === null)
1121
1179
  return;
1122
- const e = i(this, d) instanceof E ? "percent" : "ms";
1123
- if (i(this, y) !== null)
1124
- f(this, D, $).call(this), this.playbackRate === 0 ? c(this, u, h(t, e)) : (c(this, u, h(t, e) - i(this, y) / this.playbackRate), c(this, y, null));
1125
- else if (i(this, u) !== null && i(this, v).playbackRate !== null) {
1126
- const n = (h(t, e) - i(this, u)) * this.playbackRate;
1127
- f(this, D, $).call(this);
1128
- const r = this.playbackRate;
1129
- r === 0 ? (c(this, y, null), c(this, u, h(t, e))) : c(this, u, h(t, e) - n / r);
1130
- }
1131
- i(this, S).state === "pending" && i(this, S).resolve(this), f(this, I, V).call(this, !1), f(this, B, G).call(this), i(this, v).task = null, this.timeline instanceof DocumentTimeline && i(this, k).forEach((n) => n.play());
1132
- }, xt = /* @__PURE__ */ new WeakSet(), qt = function() {
1180
+ const e = r(this, p) instanceof b ? "percent" : "ms";
1181
+ if (r(this, y) !== null)
1182
+ g(this, D, $).call(this), this.playbackRate === 0 ? c(this, u, h(t, e)) : (c(this, u, h(t, e) - r(this, y) / this.playbackRate), c(this, y, null));
1183
+ else if (r(this, u) !== null && r(this, w).playbackRate !== null) {
1184
+ const n = (h(t, e) - r(this, u)) * this.playbackRate;
1185
+ g(this, D, $).call(this);
1186
+ const i = this.playbackRate;
1187
+ i === 0 ? (c(this, y, null), c(this, u, h(t, e))) : c(this, u, h(t, e) - n / i);
1188
+ }
1189
+ r(this, R).state === "pending" && r(this, R).resolve(this), g(this, W, F).call(this, !1), g(this, B, X).call(this), r(this, w).task = null, this.timeline instanceof DocumentTimeline && r(this, k).forEach((n) => n.play());
1190
+ }, Nt = /* @__PURE__ */ new WeakSet(), Jt = function() {
1133
1191
  var s;
1134
1192
  const t = ((s = this.timeline) == null ? void 0 : s.currentTime) ?? null;
1135
1193
  if (t === null)
1136
1194
  return;
1137
- const e = i(this, d) instanceof E ? "percent" : "ms", n = t;
1138
- i(this, u) !== null && i(this, y) === null && c(this, y, (h(n, e) - i(this, u)) * this.playbackRate), f(this, D, $).call(this), c(this, u, null), i(this, S).resolve(this), f(this, I, V).call(this, !1), f(this, B, G).call(this), i(this, v).task = null, i(this, k).forEach((r) => r.pause());
1139
- }, Ct = /* @__PURE__ */ new WeakSet(), zt = function() {
1140
- if (i(this, O) && !(!i(this, d) || !i(this, d).currentTime) && !(this.playState === "idle" || this.playState === "paused" && i(this, y) !== null)) {
1141
- if (i(this, d) instanceof E) {
1142
- const s = i(this, v).playbackRate ?? this.playbackRate;
1195
+ const e = r(this, p) instanceof b ? "percent" : "ms", n = t;
1196
+ r(this, u) !== null && r(this, y) === null && c(this, y, (h(n, e) - r(this, u)) * this.playbackRate), g(this, D, $).call(this), c(this, u, null), r(this, R).resolve(this), g(this, W, F).call(this, !1), g(this, B, X).call(this), r(this, w).task = null, r(this, k).forEach((i) => i.pause());
1197
+ }, At = /* @__PURE__ */ new WeakSet(), Qt = function() {
1198
+ if (r(this, V) && !(!r(this, p) || !r(this, p).currentTime) && !(this.playState === "idle" || this.playState === "paused" && r(this, y) !== null)) {
1199
+ if (r(this, p) instanceof b) {
1200
+ const s = r(this, w).playbackRate ?? this.playbackRate;
1143
1201
  c(this, u, s >= 0 ? 0 : 100);
1144
1202
  } else
1145
- c(this, u, h(i(this, d).currentTime, "ms"));
1203
+ c(this, u, h(r(this, p).currentTime, "ms"));
1146
1204
  c(this, y, null);
1147
1205
  }
1148
- }, B = /* @__PURE__ */ new WeakSet(), G = function() {
1206
+ }, B = /* @__PURE__ */ new WeakSet(), X = function() {
1149
1207
  var s;
1150
- const t = ((s = i(this, d)) == null ? void 0 : s.currentTime) ?? null;
1208
+ const t = ((s = r(this, p)) == null ? void 0 : s.currentTime) ?? null;
1151
1209
  if (t === null)
1152
1210
  return;
1153
- const e = i(this, x), n = i(this, d) instanceof E ? Le(t, e?.getTiming()) : Et(t);
1154
- let r = null;
1155
- if (i(this, u) !== null) {
1211
+ const e = r(this, x), n = r(this, p) instanceof b ? $e(t, e?.getTiming()) : kt(t);
1212
+ let i = null;
1213
+ if (r(this, u) !== null) {
1156
1214
  const a = h(t, "percent") === (this.playbackRate < 0 ? 0 : 100) ? this.playbackRate < 0 ? 1e-3 : -1e-3 : 0;
1157
- r = (n - i(this, u)) * this.playbackRate, r += a;
1158
- } else if (i(this, y) !== null)
1159
- r = i(this, y);
1215
+ i = (n - r(this, u)) * this.playbackRate, i += a;
1216
+ } else if (r(this, y) !== null)
1217
+ i = r(this, y);
1160
1218
  else
1161
1219
  return;
1162
- i(this, k).forEach((a) => a.currentTime = r);
1163
- }, ct = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakSet(), Mt = function() {
1220
+ r(this, k).forEach((a) => a.currentTime = i);
1221
+ }, ut = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakSet(), Ut = function() {
1164
1222
  var s;
1165
- let t = i(this, x);
1166
- const e = [];
1167
- if (t instanceof Ot)
1223
+ const t = r(this, x), e = [];
1224
+ if (t instanceof qt)
1168
1225
  for (let n = 0; n < t.children.length; n++) {
1169
- const r = new se(t.children.item(n));
1170
- if (t instanceof $e && n > 0) {
1226
+ const i = new fe(t.children.item(n));
1227
+ if (t instanceof ze && n > 0) {
1171
1228
  const { endTime: a = null } = ((s = e[n - 1].effect) == null ? void 0 : s.getComputedTiming()) ?? {};
1172
- r.startTime = h(a, "ms");
1229
+ i.startTime = h(a, "ms");
1173
1230
  }
1174
- e.push(r);
1231
+ e.push(i);
1175
1232
  }
1176
1233
  else {
1177
- const n = i(this, d) instanceof E ? document.timeline : i(this, d);
1178
- e.push(new Me(t, n));
1234
+ const n = r(this, p) instanceof b ? document.timeline : r(this, p);
1235
+ e.push(new We(t, n));
1179
1236
  }
1180
1237
  c(this, k, e);
1181
- }, I = /* @__PURE__ */ new WeakSet(), V = function(s) {
1238
+ }, W = /* @__PURE__ */ new WeakSet(), F = function(s) {
1182
1239
  var t, e;
1183
- const n = ((t = i(this, d)) == null ? void 0 : t.currentTime) ?? null, r = i(this, d) instanceof E ? "percent" : "ms";
1184
- let a = h(this.currentTime, r);
1185
- if (a && i(this, u) !== null && !this.pending) {
1186
- let { delay: o = 0, endDelay: l = 0, iterations: m = 1, duration: p = "auto" } = ((e = i(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1187
- const w = i(this, v).playbackRate ?? this.playbackRate;
1188
- if (p === "auto")
1189
- p = i(this, d) instanceof E ? It : 0;
1190
- else if (p instanceof CSSNumericValue)
1191
- p = p.to("ms").value;
1192
- else if (typeof p == "string")
1240
+ const n = ((t = r(this, p)) == null ? void 0 : t.currentTime) ?? null, i = r(this, p) instanceof b ? "percent" : "ms", a = h(this.currentTime, i);
1241
+ if (a && r(this, u) !== null && !this.pending) {
1242
+ let { delay: o = 0, endDelay: l = 0, iterations: f = 1, duration: d = "auto" } = ((e = r(this, x)) == null ? void 0 : e.getTiming()) ?? {};
1243
+ const m = r(this, w).playbackRate ?? this.playbackRate;
1244
+ if (d === "auto")
1245
+ d = r(this, p) instanceof b ? jt : 0;
1246
+ else if (d instanceof CSSNumericValue)
1247
+ d = d.to("ms").value;
1248
+ else if (typeof d == "string")
1193
1249
  throw new TypeError("Unknown effect duration keyword.");
1194
- const R = o + p * m + l;
1195
- let T = h(i(this, z), r);
1196
- w > 0 && a >= R && i(this, z) !== null ? ((T === null || T < R) && (T = R), c(this, y, s ? a : T)) : w < 0 && a <= 0 ? ((T === null || T > 0) && (T = 0), c(this, y, s ? a : T)) : w !== 0 && (s && i(this, y) !== null && (n !== null ? c(this, u, h(n, r) - i(this, y) / w) : c(this, u, null)), c(this, y, null));
1250
+ const S = o + d * f + l;
1251
+ let E = h(r(this, G), i);
1252
+ m > 0 && a >= S && r(this, G) !== null ? ((E === null || E < S) && (E = S), c(this, y, s ? a : E)) : m < 0 && a <= 0 ? ((E === null || E > 0) && (E = 0), c(this, y, s ? a : E)) : m !== 0 && (s && r(this, y) !== null && (n !== null ? c(this, u, h(n, i) - r(this, y) / m) : c(this, u, null)), c(this, y, null));
1197
1253
  }
1198
- f(this, B, G).call(this), c(this, z, this.currentTime), this.playState === "finished" ? i(this, P).state === "pending" && i(this, yt).call(this) : i(this, P).state === "resolved" && c(this, P, new nt());
1254
+ g(this, B, X).call(this), c(this, G, this.currentTime), this.playState === "finished" ? r(this, P).state === "pending" && r(this, St).call(this) : r(this, P).state === "resolved" && c(this, P, new rt());
1199
1255
  }, D = /* @__PURE__ */ new WeakSet(), $ = function() {
1200
- i(this, v).playbackRate && (this.playbackRate = i(this, v).playbackRate), i(this, v).playbackRate = null;
1201
- }, yt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap();
1202
- let Oe = se;
1203
- var et, Dt, re;
1204
- class At extends Ot {
1205
- constructor(t, e = ut) {
1206
- super(t), g(this, Dt), g(this, et, void 0), c(this, et, {
1207
- ...ut,
1256
+ r(this, w).playbackRate && (this.playbackRate = r(this, w).playbackRate), r(this, w).playbackRate = null;
1257
+ }, St = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap();
1258
+ let He = fe;
1259
+ var st, $t, pe;
1260
+ class Ot extends qt {
1261
+ constructor(t, e = pt) {
1262
+ super(t), v(this, $t), v(this, st, void 0), c(this, st, {
1263
+ ...pt,
1208
1264
  ...e
1209
1265
  }), t.forEach((n) => n.updateTiming());
1210
1266
  }
@@ -1215,32 +1271,32 @@ class At extends Ot {
1215
1271
  super.append(...t), t.forEach((e) => e.updateTiming());
1216
1272
  }
1217
1273
  getTiming() {
1218
- return i(this, et);
1274
+ return r(this, st);
1219
1275
  }
1220
1276
  getComputedTiming() {
1221
1277
  const t = this.getTiming(), e = { ...t };
1222
- for (let w = 0; w < this.children.length; w++) {
1223
- const R = this.children.item(w);
1224
- if (!R)
1278
+ for (let m = 0; m < this.children.length; m++) {
1279
+ const S = this.children.item(m);
1280
+ if (!S)
1225
1281
  continue;
1226
1282
  let {
1227
- delay: T = 0,
1228
- endDelay: X = 0,
1283
+ delay: E = 0,
1284
+ endDelay: Z = 0,
1229
1285
  duration: C = "auto",
1230
- activeDuration: M = 0,
1231
- endTime: L = 0
1232
- } = R.getComputedTiming();
1233
- t.delay = t.delay ? Math.min(t.delay, T) : T, 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));
1286
+ activeDuration: L = 0,
1287
+ endTime: M = 0
1288
+ } = S.getComputedTiming();
1289
+ t.delay = t.delay ? Math.min(t.delay, E) : E, t.endDelay = t.endDelay ? Math.max(t.endDelay, Z) : Z, e.endTime = e.endTime ? Math.max(h(e.endTime, "ms"), h(M, "ms")) : M, e.activeDuration = e.activeDuration ? Math.max(h(e.activeDuration, "ms"), h(L, "ms")) : L, 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));
1234
1290
  }
1235
- const { timeline: n, startTime: r, currentTime: a } = A.get(this) ?? {}, o = n instanceof E ? "percent" : "ms";
1236
- let { duration: l = 0, iterations: m = 1, endTime: p = 0 } = e;
1291
+ const { timeline: n, startTime: i, currentTime: a } = N.get(this) ?? {}, o = n instanceof b ? "percent" : "ms";
1292
+ let { duration: l = 0, iterations: f = 1, endTime: d = 0 } = e;
1237
1293
  if (l === "auto" && (l = 0), typeof l == "string")
1238
1294
  throw new TypeError("Unknown effect duration keyword.");
1239
- return e.duration = l, e.activeDuration = Et(l) * m, 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(p, o)), e);
1295
+ return e.duration = l, e.activeDuration = kt(l) * f, e.startTime = i ?? void 0, e.localTime = a, e.currentIteration = ue(e, he(e, r(this, $t, pe))), n instanceof b ? Bt(e) : (n instanceof DocumentTimeline && (e.progress = a && h(a, o) / h(d, o)), e);
1240
1296
  }
1241
1297
  updateTiming(t) {
1242
- c(this, et, {
1243
- ...i(this, et),
1298
+ c(this, st, {
1299
+ ...r(this, st),
1244
1300
  ...t
1245
1301
  });
1246
1302
  for (let e = 0; e < this.children.length; e++) {
@@ -1249,12 +1305,12 @@ class At extends Ot {
1249
1305
  }
1250
1306
  }
1251
1307
  }
1252
- et = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakSet(), re = function() {
1253
- const { playbackRate: s = 1 } = A.get(this) ?? {};
1308
+ st = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakSet(), pe = function() {
1309
+ const { playbackRate: s = 1 } = N.get(this) ?? {};
1254
1310
  return s < 0 ? "backwards" : "forwards";
1255
1311
  };
1256
- class Ve extends st {
1257
- ref = K();
1312
+ class Ge extends at {
1313
+ ref = q();
1258
1314
  #t = null;
1259
1315
  #e = null;
1260
1316
  state = {
@@ -1273,24 +1329,24 @@ class Ve extends st {
1273
1329
  return this.#e;
1274
1330
  }
1275
1331
  getKeyframeProperties(t, e) {
1276
- const n = {}, r = window.getComputedStyle(t);
1332
+ const n = {}, i = window.getComputedStyle(t);
1277
1333
  for (const a of e) {
1278
1334
  let o;
1279
- a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = me(a), n[o] = r.getPropertyValue(a);
1335
+ a === "offset" ? o = "cssOffset" : a === "float" ? o = "cssFloat" : o = Se(a), n[o] = i.getPropertyValue(a);
1280
1336
  }
1281
1337
  return n;
1282
1338
  }
1283
1339
  copyStyles(t, e, n) {
1284
- if (!ke(t))
1340
+ if (!Ae(t))
1285
1341
  return;
1286
- const r = window.getComputedStyle(t);
1342
+ const i = window.getComputedStyle(t);
1287
1343
  for (const a of n) {
1288
- const o = r.getPropertyValue(a), l = r.getPropertyPriority(a);
1344
+ const o = i.getPropertyValue(a), l = i.getPropertyPriority(a);
1289
1345
  e.style.setProperty(a, o, l);
1290
1346
  }
1291
1347
  }
1292
1348
  getAnimationEffect(t, e) {
1293
- const n = new Array(), r = {
1349
+ const n = new Array(), i = {
1294
1350
  fill: "both",
1295
1351
  duration: "auto",
1296
1352
  easing: "ease"
@@ -1304,7 +1360,7 @@ class Ve extends st {
1304
1360
  { transform: o, opacity: 1 },
1305
1361
  { transform: l, opacity: 0 }
1306
1362
  ],
1307
- r
1363
+ i
1308
1364
  )
1309
1365
  ), n.push(
1310
1366
  new KeyframeEffect(
@@ -1313,7 +1369,7 @@ class Ve extends st {
1313
1369
  { transform: o },
1314
1370
  { transform: l }
1315
1371
  ],
1316
- r
1372
+ i
1317
1373
  )
1318
1374
  );
1319
1375
  break;
@@ -1326,7 +1382,7 @@ class Ve extends st {
1326
1382
  { opacity: 0, offset: 0.5 },
1327
1383
  { transform: l, opacity: 0 }
1328
1384
  ],
1329
- r
1385
+ i
1330
1386
  )
1331
1387
  ), n.push(
1332
1388
  new KeyframeEffect(
@@ -1336,7 +1392,7 @@ class Ve extends st {
1336
1392
  { opacity: 0, offset: 0.5 },
1337
1393
  { transform: l, opacity: 1 }
1338
1394
  ],
1339
- r
1395
+ i
1340
1396
  )
1341
1397
  );
1342
1398
  break;
@@ -1348,7 +1404,7 @@ class Ve extends st {
1348
1404
  { transform: o, opacity: 1 },
1349
1405
  { transform: l, opacity: 0 }
1350
1406
  ],
1351
- r
1407
+ i
1352
1408
  )
1353
1409
  ), n.push(
1354
1410
  new KeyframeEffect(
@@ -1357,12 +1413,12 @@ class Ve extends st {
1357
1413
  { transform: o },
1358
1414
  { transform: l }
1359
1415
  ],
1360
- r
1416
+ i
1361
1417
  )
1362
1418
  );
1363
1419
  break;
1364
1420
  case "morph": {
1365
- const m = Array.from(/* @__PURE__ */ new Set([...t.instance.styles, ...e.instance.styles]));
1421
+ const f = Array.from(/* @__PURE__ */ new Set([...t.instance.styles, ...e.instance.styles]));
1366
1422
  n.push(
1367
1423
  new KeyframeEffect(
1368
1424
  e.clone,
@@ -1375,19 +1431,19 @@ class Ve extends st {
1375
1431
  },
1376
1432
  {
1377
1433
  ...Object.fromEntries((e.instance.ref.current?.firstElementChild).attributeStyleMap),
1378
- ...this.getKeyframeProperties(e.instance.ref.current?.firstElementChild, m),
1434
+ ...this.getKeyframeProperties(e.instance.ref.current?.firstElementChild, f),
1379
1435
  transform: l,
1380
1436
  width: `${e.rect.width}px`,
1381
1437
  height: `${e.rect.height}px`
1382
1438
  }
1383
1439
  ],
1384
- r
1440
+ i
1385
1441
  )
1386
1442
  );
1387
1443
  break;
1388
1444
  }
1389
1445
  }
1390
- return new At(n);
1446
+ return new Ot(n);
1391
1447
  }
1392
1448
  get animationEffect() {
1393
1449
  const t = this.outgoingScreen?.current?.sharedElementScene, e = this.incomingScreen?.current?.sharedElementScene;
@@ -1395,27 +1451,27 @@ class Ve extends st {
1395
1451
  return null;
1396
1452
  t.previousScene = null, e.previousScene = t;
1397
1453
  const n = new Array();
1398
- for (const [r, a] of Array.from(e.nodes.entries())) {
1399
- const o = a.getBoundingClientRect(), l = t.nodes.get(r);
1454
+ for (const [i, a] of Array.from(e.nodes.entries())) {
1455
+ const o = a.getBoundingClientRect(), l = t.nodes.get(i);
1400
1456
  if (!l?.canTransition || !a.canTransition)
1401
1457
  continue;
1402
- const m = l.getBoundingClientRect(), p = a.clone(), w = l.clone();
1403
- if (!w || !p)
1458
+ const f = l.getBoundingClientRect(), d = a.clone(), m = l.clone();
1459
+ if (!m || !d)
1404
1460
  continue;
1405
- const R = Array.from(/* @__PURE__ */ new Set([...l.styles, ...a.styles]));
1406
- a.transitionType !== "morph" ? (w.id = `${r}-start`, w.style.position = "absolute", w.style.gridArea = "1 / 1", w.style.margin = "0", this.copyStyles(l.ref.current?.firstElementChild, w, R), this.copyStyles(a.ref.current?.firstElementChild, p, R), w.style.width = `${m.width}px`, w.style.height = `${m.height}px`, p.style.width = `${o.width}px`, p.style.height = `${o.height}px`, this.ref.current?.prepend(w)) : (this.copyStyles(l.ref.current?.firstElementChild, p, R), p.style.width = `${m.width}px`, p.style.height = `${m.height}px`), p.id = `${r}${a.transitionType === "morph" ? "" : "-end"}`, p.style.position = "absolute", p.style.gridArea = "1 / 1", p.style.margin = "0", this.ref.current?.prepend(p), l.hide(), a.hide();
1407
- const T = async () => {
1408
- this.props.direction === "forwards" ? a.unhide() : l.unhide(), p.remove(), w.remove();
1461
+ const S = Array.from(/* @__PURE__ */ new Set([...l.styles, ...a.styles]));
1462
+ a.transitionType !== "morph" ? (m.id = `${i}-start`, m.style.position = "absolute", m.style.gridArea = "1 / 1", m.style.margin = "0", this.copyStyles(l.ref.current?.firstElementChild, m, S), this.copyStyles(a.ref.current?.firstElementChild, d, S), m.style.width = `${f.width}px`, m.style.height = `${f.height}px`, d.style.width = `${o.width}px`, d.style.height = `${o.height}px`, this.ref.current?.prepend(m)) : (this.copyStyles(l.ref.current?.firstElementChild, d, S), d.style.width = `${f.width}px`, d.style.height = `${f.height}px`), d.id = `${i}${a.transitionType === "morph" ? "" : "-end"}`, d.style.position = "absolute", d.style.gridArea = "1 / 1", d.style.margin = "0", this.ref.current?.prepend(d), l.hide(), a.hide();
1463
+ const E = async () => {
1464
+ this.props.direction === "forwards" ? a.unhide() : l.unhide(), d.remove(), m.remove();
1409
1465
  };
1410
- this.props.navigation.addEventListener("transition-end", T, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", T, { once: !0 }), n.push(this.getAnimationEffect(
1411
- { instance: l, clone: w, rect: m },
1412
- { instance: a, clone: p, rect: o }
1466
+ this.props.navigation.addEventListener("transition-end", E, { once: !0 }), this.props.navigation.addEventListener("transition-cancel", E, { once: !0 }), n.push(this.getAnimationEffect(
1467
+ { instance: l, clone: m, rect: f },
1468
+ { instance: a, clone: d, rect: o }
1413
1469
  ));
1414
1470
  }
1415
- return new At(n);
1471
+ return new Ot(n);
1416
1472
  }
1417
1473
  render() {
1418
- return /* @__PURE__ */ b("dialog", { className: "shared-element-layer", ref: this.ref, style: {
1474
+ return /* @__PURE__ */ T("dialog", { className: "shared-element-layer", ref: this.ref, style: {
1419
1475
  maxWidth: "unset",
1420
1476
  maxHeight: "unset",
1421
1477
  width: "100vw",
@@ -1425,37 +1481,28 @@ class Ve extends st {
1425
1481
  border: "none",
1426
1482
  backgroundColor: "transparent",
1427
1483
  isolation: "isolate"
1428
- }, children: /* @__PURE__ */ b("style", { children: `
1429
- .shared-element-layer::backdrop {display: none}
1430
- .shared-element-layer[open] {display:grid}
1431
- ` }) });
1484
+ }, children: /* @__PURE__ */ T("style", { children: `
1485
+ .shared-element-layer::backdrop {display: none}
1486
+ .shared-element-layer[open] {display:grid}
1487
+ ` }) });
1432
1488
  }
1433
1489
  }
1434
- const ae = it(0);
1435
- class je extends st {
1436
- sharedElementTransitionLayer = K();
1437
- animation = new Oe();
1490
+ class Xe extends at {
1491
+ sharedElementTransitionLayer = q();
1492
+ animation = new He();
1438
1493
  #t = "normal";
1439
1494
  #e = [];
1440
1495
  state = {
1441
- gestureNavigating: !1,
1442
- progress: 1
1496
+ gestureNavigating: !1
1443
1497
  };
1444
- onAnimationFrame() {
1445
- const t = this.animation.effect?.getComputedTiming().progress;
1446
- t && this.onProgress(t), this.animation.playState === "running" && requestAnimationFrame(this.onAnimationFrame.bind(this));
1447
- }
1448
1498
  onTransitionCancel() {
1449
- this.props.navigation.dispatchEvent(new ye());
1499
+ this.props.navigation.dispatchEvent(new xe());
1450
1500
  }
1451
1501
  onTransitionStart() {
1452
- this.props.navigation.dispatchEvent(new ge()), this.onAnimationFrame();
1502
+ this.props.navigation.dispatchEvent(new ke());
1453
1503
  }
1454
1504
  onTransitionEnd() {
1455
- this.props.navigation.dispatchEvent(new ve());
1456
- }
1457
- onProgress(t) {
1458
- this.setState({ progress: t }), this.props.navigation.dispatchEvent(new we(t));
1505
+ this.props.navigation.dispatchEvent(new Ce());
1459
1506
  }
1460
1507
  get screens() {
1461
1508
  return this.#e;
@@ -1473,8 +1520,8 @@ class je extends st {
1473
1520
  return this.props.hasUAVisualTransition;
1474
1521
  }
1475
1522
  transition() {
1476
- const t = new At(
1477
- this.screens.map((r) => r.current?.transitionProvider?.current?.animationEffect ?? null).filter((r) => r !== null)
1523
+ const t = new Ot(
1524
+ this.screens.map((i) => i.current?.transitionProvider?.current?.animationEffect ?? null).filter((i) => i !== null)
1478
1525
  ), e = this.sharedElementTransitionLayer.current?.animationEffect, n = t.getComputedTiming().duration;
1479
1526
  return e && (e.updateTiming({
1480
1527
  duration: n instanceof CSSNumericValue ? n.to("ms").value : n
@@ -1482,19 +1529,20 @@ class je extends st {
1482
1529
  this.sharedElementTransitionLayer.current?.ref.current?.close(), this.onTransitionCancel(), this.animation.effect = null;
1483
1530
  }, this.animation.finished.then(() => {
1484
1531
  this.animation.commitStyles(), this.onTransitionEnd(), this.sharedElementTransitionLayer.current?.ref.current?.close(), this.animation.effect = null;
1532
+ }).catch(() => {
1485
1533
  }), this.animation;
1486
1534
  }
1487
1535
  render() {
1488
- return /* @__PURE__ */ Gt(_t.Provider, { value: this, children: [
1489
- /* @__PURE__ */ b(
1490
- Ve,
1536
+ return /* @__PURE__ */ te(Ft.Provider, { value: this, children: [
1537
+ /* @__PURE__ */ T(
1538
+ Ge,
1491
1539
  {
1492
1540
  ref: this.sharedElementTransitionLayer,
1493
1541
  navigation: this.props.navigation,
1494
1542
  direction: this.animation.playbackRate > 0 ? "forwards" : "backwards"
1495
1543
  }
1496
1544
  ),
1497
- /* @__PURE__ */ b(
1545
+ /* @__PURE__ */ T(
1498
1546
  "div",
1499
1547
  {
1500
1548
  className: this.props.id,
@@ -1503,62 +1551,78 @@ class je extends st {
1503
1551
  height: "100%",
1504
1552
  display: "grid",
1505
1553
  contain: "layout",
1506
- isolation: "isolate",
1507
- "--motion-progress": this.state.progress
1554
+ isolation: "isolate"
1508
1555
  },
1509
- children: /* @__PURE__ */ b(ae.Provider, { value: this.state.progress, children: this.props.children })
1556
+ children: this.props.children
1510
1557
  }
1511
1558
  )
1512
1559
  ] });
1513
1560
  }
1514
1561
  }
1515
- class Nt extends st {
1516
- ref = K();
1517
- screenTransitionLayer = K();
1562
+ class Rt extends at {
1563
+ ref = q();
1564
+ screenTransitionLayer = q();
1518
1565
  parent = null;
1519
1566
  #t = null;
1520
1567
  loadDispatched = !1;
1521
1568
  hasUAVisualTransition = !1;
1522
1569
  parentScreen = null;
1523
1570
  static rootRouterRef = null;
1524
- static contextType = Jt;
1571
+ static contextType = oe;
1525
1572
  constructor(t, e) {
1526
- 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));
1573
+ super(t), this.parentScreen = e?.parentScreen ?? null, this.parent = e?.parentRouter ?? null;
1527
1574
  }
1528
1575
  componentDidMount() {
1529
- this.isRoot && window.navigation.addEventListener("navigate", this.handleNavigationDispatch), this.loadDispatched || (window.navigation.dispatchEvent(new Ee()), this.loadDispatched = !0);
1576
+ if (this.parent)
1577
+ this.parent.child = this;
1578
+ else {
1579
+ const t = Rt.rootRouterRef?.deref();
1580
+ if (this !== t && t?.mounted)
1581
+ throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");
1582
+ Rt.rootRouterRef = new WeakRef(this), window.navigation.addEventListener(
1583
+ "navigate",
1584
+ this.handleNavigationDispatch
1585
+ );
1586
+ }
1587
+ this.loadDispatched || (window.navigation.dispatchEvent(new Le()), this.loadDispatched = !0);
1530
1588
  }
1531
1589
  componentWillUnmount() {
1532
- this.isRoot && window.navigation.removeEventListener("navigate", this.handleNavigationDispatch);
1590
+ this.isRoot && window.navigation.removeEventListener(
1591
+ "navigate",
1592
+ this.handleNavigationDispatch
1593
+ );
1533
1594
  }
1534
1595
  handleNavigationDispatch = (t) => {
1535
- const n = [...this.#e()].findLast((r) => r.canIntercept(t));
1596
+ const n = [...this.#e()].findLast(
1597
+ (i) => i.canIntercept(t)
1598
+ );
1536
1599
  n && (n.intercept(t), this.hasUAVisualTransition = t.hasUAVisualTransition);
1537
1600
  };
1538
- *#e() {
1539
- let t = this;
1540
- for (; t; )
1541
- yield t, t = t.child;
1601
+ *#e(t = Rt.rootRouterRef?.deref() ?? null) {
1602
+ let e = t;
1603
+ for (; e; )
1604
+ yield e, e = e.child;
1542
1605
  }
1543
1606
  getRouterById(t, e) {
1544
- const n = e ?? Nt.rootRouterRef?.deref();
1545
- return n.id === t ? n ?? null : n?.child ? this.getRouterById(t, n.child) : null;
1607
+ return [...this.#e(e)].find((i) => i.id === t) ?? null;
1546
1608
  }
1547
1609
  dispatchEvent(t) {
1548
1610
  const e = this.ref.current ?? void 0;
1549
- return pe(t, e);
1611
+ return be(t, e);
1550
1612
  }
1551
1613
  addEventListener(t, e, n) {
1552
- return this.ref.current?.addEventListener(t, e, n);
1614
+ const i = this.ref.current;
1615
+ return i ? (i.addEventListener(t, e, n), () => i.removeEventListener(t, e, n)) : () => {
1616
+ };
1553
1617
  }
1554
1618
  removeEventListener(t, e, n) {
1555
1619
  return this.ref.current?.removeEventListener(t, e, n);
1556
1620
  }
1557
1621
  screenChildFromPathname(t) {
1558
- for (const e of jt.toArray(this.props.children)) {
1559
- if (!Re(e))
1622
+ for (const e of Gt.toArray(this.props.children)) {
1623
+ if (!Ne(e))
1560
1624
  continue;
1561
- const n = Yt(
1625
+ const n = Xt(
1562
1626
  e.props.path,
1563
1627
  t,
1564
1628
  this.baseURLPattern.pathname,
@@ -1574,9 +1638,12 @@ class Nt extends st {
1574
1638
  }
1575
1639
  preloadScreen(t) {
1576
1640
  const e = t.props.config, n = [];
1577
- 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(() => {
1641
+ return j(t.props.component) && n.push(t.props.component.load()), j(e?.header?.component) && n.push(e?.header?.component.load()), j(e?.footer?.component) && n.push(e?.footer?.component.load()), Promise.all(n).then(() => {
1578
1642
  });
1579
1643
  }
1644
+ includesRoute(t, e = window.location.origin) {
1645
+ return this.pathPatterns.some(({ pattern: n, caseSensitive: i }) => Xt(n, t, e, i));
1646
+ }
1580
1647
  get id() {
1581
1648
  if (this.props.id)
1582
1649
  return this.props.id;
@@ -1587,14 +1654,20 @@ class Nt extends st {
1587
1654
  return !this.parent;
1588
1655
  }
1589
1656
  get baseURL() {
1590
- const t = this.isRoot ? window.location.pathname : this.parentScreen?.resolvedPathname, e = this.baseURLPattern.pathname;
1591
- return Tt(e, t);
1657
+ const t = this.isRoot ? window.location.pathname : this.parentScreen.resolvedPathname, e = this.baseURLPattern.pathname;
1658
+ return Lt(e, t);
1592
1659
  }
1593
1660
  get baseURLPattern() {
1594
1661
  let t = window.location.origin + "/", e = this.props.config?.basePath;
1595
1662
  if (e || (this.isRoot ? e = "/" : e = "."), this.parent && this.parentScreen) {
1596
- const { resolvedPathname: n = window.location.pathname, path: r } = this.parentScreen, a = this.parent.baseURL?.href, o = new URLPattern({ baseURL: a, pathname: r });
1597
- t = Tt(
1663
+ const {
1664
+ resolvedPathname: n = window.location.pathname,
1665
+ path: i
1666
+ } = this.parentScreen, a = this.parent.baseURL?.href, o = new URLPattern({
1667
+ baseURL: a,
1668
+ pathname: i
1669
+ });
1670
+ t = Lt(
1598
1671
  o.pathname,
1599
1672
  n
1600
1673
  ).href;
@@ -1602,7 +1675,10 @@ class Nt extends st {
1602
1675
  return new URLPattern({ baseURL: t, pathname: e });
1603
1676
  }
1604
1677
  get pathPatterns() {
1605
- return jt.map(this.props.children, (t) => ({ pattern: t.props.path, caseSensitive: !!t.props.caseSensitive }));
1678
+ return Gt.map(this.props.children, (t) => ({
1679
+ pattern: t.props.path,
1680
+ caseSensitive: !!t.props.caseSensitive
1681
+ }));
1606
1682
  }
1607
1683
  get mounted() {
1608
1684
  return !!this.ref.current;
@@ -1612,21 +1688,21 @@ class Nt extends st {
1612
1688
  }
1613
1689
  set child(t) {
1614
1690
  const e = this.#t?.deref();
1615
- if (e && t?.id !== e.id && t?.parentScreen?.id === e.parentScreen?.id && e.mounted)
1691
+ if (e && t !== e && t?.parentScreen?.id === e.parentScreen?.id && e.mounted)
1616
1692
  throw new Error("It looks like you have two navigators at the same level. Try simplifying your navigation structure by using a nested router instead.");
1617
1693
  t ? this.#t = new WeakRef(t) : this.#t = null;
1618
1694
  }
1619
1695
  render() {
1620
1696
  if (this.navigation)
1621
- return /* @__PURE__ */ b(
1697
+ return /* @__PURE__ */ T(
1622
1698
  "div",
1623
1699
  {
1624
1700
  id: this.id,
1625
1701
  className: "react-motion-router",
1626
1702
  style: { width: "100%", height: "100%" },
1627
1703
  ref: this.ref,
1628
- children: /* @__PURE__ */ b(wt.Provider, { value: this, children: /* @__PURE__ */ b(
1629
- je,
1704
+ children: /* @__PURE__ */ T(vt.Provider, { value: this, children: /* @__PURE__ */ T(
1705
+ Xe,
1630
1706
  {
1631
1707
  id: `${this.id}-transition-layer`,
1632
1708
  ref: this.screenTransitionLayer,
@@ -1639,11 +1715,13 @@ class Nt extends st {
1639
1715
  );
1640
1716
  }
1641
1717
  }
1642
- class Fe {
1718
+ class Ye {
1643
1719
  #t = /* @__PURE__ */ new Map();
1644
1720
  mutationObserver;
1645
1721
  constructor() {
1646
- this.mutationObserver = new MutationObserver(this.observeMutations.bind(this));
1722
+ this.mutationObserver = new MutationObserver(
1723
+ this.observeMutations.bind(this)
1724
+ );
1647
1725
  const { head: t } = document;
1648
1726
  this.mutationObserver.observe(t, {
1649
1727
  childList: !0
@@ -1651,25 +1729,29 @@ class Fe {
1651
1729
  this.mutationObserver.observe(e, {
1652
1730
  attributes: !0
1653
1731
  });
1654
- }), Array.from(t.querySelectorAll("meta")).forEach(this.metaDataFromNode.bind(this));
1732
+ }), Array.from(
1733
+ t.querySelectorAll("meta")
1734
+ ).forEach(
1735
+ this.metaDataFromNode.bind(this)
1736
+ );
1655
1737
  }
1656
1738
  get(t) {
1657
- const e = this.getMetaKey(t), n = this.#t.get(e);
1739
+ const e = this.formatMetaKey(t), n = this.#t.get(e);
1658
1740
  if (!n)
1659
1741
  return;
1660
- let r;
1661
- return n.includes(",") && n.includes("=") ? r = n.split(/,\s*/).map((a) => a.split("=")) : r = n, r;
1742
+ let i;
1743
+ return n.includes(",") && n.includes("=") ? i = n.split(/,\s*/).map((a) => a.split("=")) : i = n, i;
1662
1744
  }
1663
1745
  set(t, e) {
1664
- const n = this.getMetaKey(t), r = this.getMetaContent(e);
1665
- this.#t.set(n, r), this.updateMetaElement(n, r);
1746
+ const n = this.formatMetaKey(t), i = this.formatMetaContent(e);
1747
+ this.#t.set(n, i), typeof t == "string" && (t = ["name", t]), this.updateMetaElement(t, i);
1666
1748
  }
1667
1749
  has(t) {
1668
- const e = this.getMetaKey(t);
1750
+ const e = this.formatMetaKey(t);
1669
1751
  return this.#t.has(e);
1670
1752
  }
1671
1753
  delete(t) {
1672
- const e = this.getMetaKey(t);
1754
+ const e = this.formatMetaKey(t);
1673
1755
  this.#t.delete(e), document.head.querySelector(`meta[${e}]`)?.remove();
1674
1756
  }
1675
1757
  clear() {
@@ -1694,7 +1776,10 @@ class Fe {
1694
1776
  return;
1695
1777
  e.removedNodes.forEach((n) => {
1696
1778
  if (n.nodeName === "META") {
1697
- const [r] = Array.from(n.attributes).filter((l) => l.nodeName !== "content"), o = [r.nodeName, r.value].join("=");
1779
+ const i = Array.from(n.attributes).find((l) => l.nodeName !== "content");
1780
+ if (!i || !i.value)
1781
+ return;
1782
+ const a = [i.nodeName, i.value], o = this.formatMetaKey(a);
1698
1783
  this.#t.has(o) && this.#t.delete(o);
1699
1784
  }
1700
1785
  }), e.addedNodes.forEach((n) => {
@@ -1703,129 +1788,394 @@ class Fe {
1703
1788
  }
1704
1789
  }
1705
1790
  metaDataFromNode(t) {
1706
- const [e] = Array.from(t.attributes).filter((o) => o.nodeName !== "content"), [n] = Array.from(t.attributes).filter((o) => o.nodeName === "content"), a = [e.nodeName, e.value].join("=");
1791
+ const e = Array.from(t.attributes).find((o) => o.nodeName !== "content"), n = Array.from(t.attributes).find((o) => o.nodeName === "content");
1792
+ if (!e || !e.value)
1793
+ return;
1794
+ const i = [e.nodeName, e.value], a = this.formatMetaKey(i);
1707
1795
  this.#t.set(a, n?.value);
1708
1796
  }
1709
- getMetaKey(t) {
1797
+ formatMetaKey(t) {
1710
1798
  let e;
1711
- return typeof t == "string" ? e = `name=${t}` : e = t.join("="), e;
1799
+ if (typeof t == "string")
1800
+ e = `name="${t}"`;
1801
+ else {
1802
+ const [n, i] = t;
1803
+ e = `${n}="${i}"`;
1804
+ }
1805
+ return e;
1712
1806
  }
1713
- getMetaContent(t) {
1807
+ formatMetaContent(t) {
1714
1808
  if (!t)
1715
1809
  return;
1716
1810
  let e;
1717
1811
  return typeof t == "string" ? e = t : e = t.map((n) => n.join("=")).join(", "), e;
1718
1812
  }
1719
1813
  updateMetaElement(t, e) {
1720
- const n = document.querySelector(`meta[${t}]`) || document.createElement("meta"), r = t.split("=");
1721
- n.setAttribute(...r), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
1814
+ const n = document.querySelector(`meta[${this.formatMetaKey(t)}]`) || document.createElement("meta"), [i, a] = t;
1815
+ n.setAttribute(i, a), e ? n.setAttribute("content", e) : n.removeAttribute("content"), n.parentElement || document.head.appendChild(n);
1722
1816
  }
1723
1817
  }
1724
- class Ut {
1818
+ class Vt {
1725
1819
  static rootNavigatorRef = null;
1726
- metaData = new Fe();
1727
- constructor() {
1728
- const t = Ut.rootNavigatorRef?.deref();
1729
- (!t || !t.isInDocument) && (Ut.rootNavigatorRef = new WeakRef(this));
1730
- }
1731
- addEventListener(t, e, n) {
1732
- return this.router.addEventListener(t, e, n), () => this.router.removeEventListener(t, e, n);
1733
- }
1734
- removeEventListener(t, e, n) {
1735
- return this.router.removeEventListener(t, e, n);
1736
- }
1737
- dispatchEvent(t) {
1738
- return this.router.dispatchEvent?.(t);
1739
- }
1740
- get parent() {
1741
- return this.router.parent?.navigation ?? null;
1742
- }
1743
- get routerId() {
1744
- return this.router.id;
1745
- }
1746
- get baseURL() {
1747
- return this.router.baseURL;
1748
- }
1749
- get baseURLPattern() {
1750
- return this.router.baseURLPattern;
1751
- }
1752
- getNavigatorById(t) {
1753
- return this.router.getRouterById(t)?.navigation ?? null;
1820
+ metaData = new Ye();
1821
+ addEventListener;
1822
+ removeEventListener;
1823
+ dispatchEvent;
1824
+ parent;
1825
+ routerId;
1826
+ baseURL;
1827
+ baseURLPattern;
1828
+ getNavigatorById;
1829
+ constructor(t) {
1830
+ const e = Vt.rootNavigatorRef?.deref();
1831
+ (!e || !e.isInDocument) && (Vt.rootNavigatorRef = new WeakRef(this)), this.addEventListener = t.addEventListener, this.removeEventListener = t.removeEventListener, this.dispatchEvent = t.dispatchEvent, this.parent = t.parent, this.routerId = t.routerId, this.baseURL = t.baseURL, this.baseURLPattern = t.baseURLPattern, this.getNavigatorById = t.getNavigatorById;
1754
1832
  }
1755
1833
  get isInDocument() {
1756
1834
  return !!document.getElementById(`${this.routerId}`);
1757
1835
  }
1758
1836
  }
1759
- function nn() {
1760
- const s = vt(wt);
1837
+ function gn() {
1838
+ const s = ft(vt);
1761
1839
  if (s)
1762
1840
  return s.navigation;
1763
1841
  throw new Error("Router is null. You may be trying to call useNavigation outside a Router.");
1764
1842
  }
1765
- function sn() {
1766
- return vt(wt);
1843
+ function vn() {
1844
+ return ft(vt);
1767
1845
  }
1768
- function rn() {
1769
- return ce("Motion"), vt(ae);
1846
+ function yn() {
1847
+ ye("Motion");
1848
+ const s = ft(vt), e = ft(Ft).animation, n = 1;
1849
+ return ie(
1850
+ (i) => {
1851
+ const a = async () => {
1852
+ do
1853
+ await new Promise((o) => {
1854
+ requestAnimationFrame(o);
1855
+ }), i();
1856
+ while (e.playState === "running");
1857
+ };
1858
+ return s.addEventListener("transition-start", a), () => {
1859
+ s.removeEventListener("transition-start", a);
1860
+ };
1861
+ },
1862
+ () => {
1863
+ const { progress: i } = e?.effect?.getComputedTiming() ?? {};
1864
+ return i ?? n;
1865
+ }
1866
+ );
1770
1867
  }
1771
- function Be() {
1772
- const s = vt(Qt);
1868
+ function Ze() {
1869
+ const s = ft(le);
1773
1870
  if (s)
1774
1871
  return s;
1775
1872
  throw new Error("Router is null. You may be trying to call useRoute outside a Router.");
1776
1873
  }
1777
- function an(s, t) {
1778
- const e = Be(), n = t instanceof Function ? t() : t, r = he(e);
1779
- ue(() => {
1780
- r.current = e;
1874
+ function wn(s, t) {
1875
+ const e = Ze(), n = t instanceof Function ? t() : t, i = se(e);
1876
+ re(() => {
1877
+ i.current = e;
1781
1878
  }, [e]);
1782
- const a = de((l) => {
1783
- const { params: m, setParams: p } = r.current;
1784
- l instanceof Function && (l = l(m[s] ?? n)), p({ [s]: l });
1879
+ const a = we((l) => {
1880
+ const { params: f, setParams: d } = i.current;
1881
+ l instanceof Function && (l = l(f[s] ?? n)), d({ [s]: l });
1785
1882
  }, [n, s]);
1786
1883
  return [e.params[s] ?? n, a];
1787
1884
  }
1788
- const on = 2147483647, ln = 100, cn = 0, hn = 0, un = 1;
1885
+ const mt = "--rerender";
1886
+ function En() {
1887
+ return ie(
1888
+ (s) => (globalThis.addEventListener(
1889
+ mt,
1890
+ s,
1891
+ { once: !0 }
1892
+ ), () => {
1893
+ globalThis.removeEventListener(mt, s);
1894
+ }),
1895
+ () => document.timeline.currentTime
1896
+ );
1897
+ }
1898
+ function bn(s) {
1899
+ const t = se(s);
1900
+ t.current = s, re(() => {
1901
+ const e = t.current;
1902
+ return globalThis.addEventListener(mt, e), () => {
1903
+ globalThis.removeEventListener(mt, e);
1904
+ };
1905
+ });
1906
+ }
1907
+ function Tn() {
1908
+ globalThis.dispatchEvent(new Event(mt));
1909
+ }
1910
+ function Sn(s, t) {
1911
+ return Object.create(EventTarget.prototype, {
1912
+ id: {
1913
+ value: crypto.randomUUID(),
1914
+ writable: !1,
1915
+ enumerable: !0,
1916
+ configurable: !1
1917
+ },
1918
+ key: {
1919
+ value: crypto.randomUUID(),
1920
+ writable: !1,
1921
+ enumerable: !0,
1922
+ configurable: !1
1923
+ },
1924
+ index: {
1925
+ value: t,
1926
+ writable: !1,
1927
+ enumerable: !0,
1928
+ configurable: !1
1929
+ },
1930
+ url: {
1931
+ value: s,
1932
+ writable: !1,
1933
+ enumerable: !0,
1934
+ configurable: !1
1935
+ },
1936
+ sameDocument: {
1937
+ value: !0,
1938
+ writable: !1,
1939
+ enumerable: !0,
1940
+ configurable: !1
1941
+ },
1942
+ ondispose: {
1943
+ value: null,
1944
+ writable: !0,
1945
+ enumerable: !0,
1946
+ configurable: !0
1947
+ },
1948
+ getState: {
1949
+ value() {
1950
+ },
1951
+ writable: !1,
1952
+ enumerable: !0,
1953
+ configurable: !1
1954
+ }
1955
+ });
1956
+ }
1957
+ function Rn() {
1958
+ if (!window.navigation)
1959
+ throw new Error("window.navigation is not available in this environment");
1960
+ }
1961
+ async function kn() {
1962
+ await new Promise((s) => {
1963
+ window.navigation.addEventListener(
1964
+ "navigatesuccess",
1965
+ s,
1966
+ { once: !0 }
1967
+ );
1968
+ });
1969
+ }
1970
+ async function Ct(s) {
1971
+ await window.navigation.navigate(s).finished;
1972
+ }
1973
+ async function xn(s) {
1974
+ await window.navigation.traverseTo(s).finished;
1975
+ }
1976
+ async function Cn() {
1977
+ const s = window.navigation.entries()[0];
1978
+ await window.navigation.traverseTo(s.key).finished;
1979
+ }
1980
+ async function Ln() {
1981
+ await Ct("/one"), await Ct("/two"), await Ct("/three");
1982
+ }
1983
+ const me = (s) => {
1984
+ s.intercept({
1985
+ handler() {
1986
+ return Promise.resolve();
1987
+ }
1988
+ });
1989
+ };
1990
+ async function Mn() {
1991
+ window.navigation.addEventListener("navigate", me);
1992
+ }
1993
+ async function Pn() {
1994
+ window.navigation.removeEventListener("navigate", me);
1995
+ }
1996
+ class H extends Ht.Component {
1997
+ constructor(t) {
1998
+ super(t), this.state = {
1999
+ href: this.href
2000
+ };
2001
+ }
2002
+ anchorRef = Ht.createRef();
2003
+ static directionFromRel(t) {
2004
+ return t?.split(" ").findLast((e) => e === "next" || e === "prev") ?? "prev";
2005
+ }
2006
+ static findClosestEntryByHref(t, e, n, i) {
2007
+ if (!Array.isArray(n) || i < O || i >= n.length || n.length === J)
2008
+ return;
2009
+ let a = i - J, o = i + J;
2010
+ const l = H.directionFromRel(e);
2011
+ for (l === "next" && (a = O), l === "prev" && (o = n.length); a >= O || o < n.length; ) {
2012
+ if (a >= O && n[a]?.url === t)
2013
+ return n[a];
2014
+ if (o < n.length && n[o]?.url === t)
2015
+ return n[o];
2016
+ a--, o++;
2017
+ }
2018
+ }
2019
+ static findClosestEntry(t, e, n) {
2020
+ switch (H.directionFromRel(t)) {
2021
+ case "prev":
2022
+ return e[n - J];
2023
+ case "next":
2024
+ return e[n + J];
2025
+ }
2026
+ }
2027
+ componentDidMount() {
2028
+ window.navigation?.addEventListener("navigatesuccess", this.onNavigate);
2029
+ }
2030
+ componentWillUnmount() {
2031
+ window.navigation?.removeEventListener("navigatesuccess", this.onNavigate);
2032
+ }
2033
+ onNavigate = () => {
2034
+ const { href: t } = this;
2035
+ this.setState({ href: t });
2036
+ };
2037
+ get href() {
2038
+ const { href: t, traverse: e, reload: n, historyEntryKey: i, rel: a } = this.props;
2039
+ if (t === void 0 && e) {
2040
+ let o;
2041
+ return i ? o = window.navigation?.entries().find((l) => l.key === i) : a && (t ? o = H.findClosestEntryByHref(
2042
+ t,
2043
+ a,
2044
+ window.navigation.entries(),
2045
+ window.navigation.currentEntry?.index ?? O
2046
+ ) : o = H.findClosestEntry(
2047
+ a,
2048
+ window.navigation.entries(),
2049
+ window.navigation.currentEntry?.index ?? O
2050
+ )), o?.url;
2051
+ } else if (n)
2052
+ return ".";
2053
+ return t;
2054
+ }
2055
+ handleClick = (t) => {
2056
+ if (this.props.onClick?.(t), t.defaultPrevented)
2057
+ return;
2058
+ t.preventDefault();
2059
+ const e = window.navigation, {
2060
+ rel: n,
2061
+ historyEntryKey: i,
2062
+ reload: a,
2063
+ replace: o,
2064
+ traverse: l,
2065
+ navigateInfo: f,
2066
+ navigateState: d
2067
+ } = this.props, m = this.anchorRef.current?.href;
2068
+ if (i) {
2069
+ e.traverseTo(i, { info: f });
2070
+ return;
2071
+ }
2072
+ if (l) {
2073
+ const S = e.entries();
2074
+ let E;
2075
+ if (m ? E = H.findClosestEntryByHref(
2076
+ m,
2077
+ n,
2078
+ S,
2079
+ e.currentEntry?.index ?? O
2080
+ ) : E = H.findClosestEntry(
2081
+ n,
2082
+ S,
2083
+ e.currentEntry?.index ?? O
2084
+ ), E) {
2085
+ e.traverseTo(E.key, { info: f });
2086
+ return;
2087
+ }
2088
+ }
2089
+ if (o && m) {
2090
+ e.navigate(m, { info: f, state: d, history: "replace" });
2091
+ return;
2092
+ }
2093
+ if (a) {
2094
+ e.reload({ info: f, state: d });
2095
+ return;
2096
+ }
2097
+ m && e.navigate(m, { info: f, state: d });
2098
+ };
2099
+ render() {
2100
+ const {
2101
+ rel: t,
2102
+ children: e
2103
+ } = this.props, { href: n } = this.state, i = Re(this.props, [
2104
+ "historyEntryKey",
2105
+ "navigateInfo",
2106
+ "navigateState",
2107
+ "reload",
2108
+ "replace",
2109
+ "traverse"
2110
+ ]);
2111
+ return /* @__PURE__ */ T(
2112
+ "a",
2113
+ {
2114
+ ...i,
2115
+ ref: this.anchorRef,
2116
+ href: n ?? void 0,
2117
+ rel: t,
2118
+ onClick: this.handleClick,
2119
+ children: e
2120
+ }
2121
+ );
2122
+ }
2123
+ }
1789
2124
  export {
1790
- Ee as LoadEvent,
1791
- un as MAX_NORM_PROGRESS,
1792
- ln as MAX_PROGRESS,
1793
- on as MAX_Z_INDEX,
1794
- hn as MIN_NORM_PROGRESS,
1795
- cn as MIN_PROGRESS,
1796
- ae as MotionContext,
1797
- tn as MotionProgressEndEvent,
1798
- we as MotionProgressEvent,
1799
- Qe as MotionProgressStartEvent,
1800
- Ut as NavigationBase,
1801
- Jt as NestedRouterContext,
1802
- fe as PromiseAllDynamic,
1803
- Nt as RouterBase,
1804
- wt as RouterContext,
1805
- Se as ScreenBase,
1806
- ze as SharedElement,
1807
- ye as TransitionCancelEvent,
1808
- ve as TransitionEndEvent,
1809
- ge as TransitionStartEvent,
1810
- Je as cloneAndInject,
1811
- pe as dispatchEvent,
1812
- Ge as includesRoute,
1813
- F as isLazyExoticComponent,
1814
- te as isNativeLazyExoticComponent,
1815
- Xe as isNavigationSupported,
1816
- ke as isStylableElement,
1817
- Ze as isURLPatternSupported,
1818
- Re as isValidScreenChild,
1819
- He as lazy,
1820
- Yt as matchRoute,
1821
- _e as polyfillNavigation,
1822
- Ye as polyfillURLPattern,
1823
- Tt as resolveBaseURLFromPattern,
1824
- me as toCamelCase,
1825
- rn as useMotion,
1826
- nn as useNavigationBase,
1827
- an as useParamsBase,
1828
- Be as useRouteBase,
1829
- sn as useRouterBase
2125
+ H as Anchor,
2126
+ an as EMPTY_COLLECTION_LENGTH,
2127
+ O as FIRST_INDEX,
2128
+ Ee as LAST_INDEX,
2129
+ Le as LoadEvent,
2130
+ rn as MAX_NORM_PROGRESS,
2131
+ en as MAX_PROGRESS,
2132
+ tn as MAX_Z_INDEX,
2133
+ sn as MIN_NORM_PROGRESS,
2134
+ nn as MIN_PROGRESS,
2135
+ pn as MotionProgressEndEvent,
2136
+ fn as MotionProgressStartEvent,
2137
+ Vt as NavigationBase,
2138
+ oe as NestedRouterContext,
2139
+ Te as PromiseAllSequential,
2140
+ Rt as RouterBase,
2141
+ vt as RouterContext,
2142
+ J as SINGLE_ELEMENT_LENGTH,
2143
+ De as ScreenBase,
2144
+ Qe as SharedElement,
2145
+ xe as TransitionCancelEvent,
2146
+ Ce as TransitionEndEvent,
2147
+ ke as TransitionStartEvent,
2148
+ Rn as assertNavigationAvailable,
2149
+ dn as cloneAndInject,
2150
+ Sn as createHistoryEntry,
2151
+ be as dispatchEvent,
2152
+ Mn as installInterceptor,
2153
+ j as isLazyExoticComponent,
2154
+ ce as isNativeLazyExoticComponent,
2155
+ ln as isNavigationSupported,
2156
+ Ae as isStylableElement,
2157
+ cn as isURLPatternSupported,
2158
+ Ne as isValidScreenChild,
2159
+ on as lazy,
2160
+ Xt as matchRoute,
2161
+ Ct as navTo,
2162
+ Re as omit,
2163
+ un as polyfillNavigation,
2164
+ hn as polyfillURLPattern,
2165
+ Lt as resolveBaseURLFromPattern,
2166
+ Ln as seedHistory,
2167
+ Se as toCamelCase,
2168
+ xn as traverseTo,
2169
+ Cn as traverseToStart,
2170
+ Tn as triggerRerender,
2171
+ Pn as uninstallInterceptor,
2172
+ yn as useMotion,
2173
+ gn as useNavigationBase,
2174
+ wn as useParamsBase,
2175
+ En as useRerender,
2176
+ bn as useRerenderCallback,
2177
+ Ze as useRouteBase,
2178
+ vn as useRouterBase,
2179
+ kn as waitForNavigateSuccess
1830
2180
  };
1831
2181
  //# sourceMappingURL=index.js.map