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