@kitbag/router 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kitbag-router.d.ts +21 -16
- package/dist/kitbag-router.js +687 -670
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +6 -6
package/dist/kitbag-router.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { inject as ae, toRefs as
|
|
5
|
-
function
|
|
1
|
+
var dr = Object.defineProperty;
|
|
2
|
+
var mr = (e, t, r) => t in e ? dr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var O = (e, t, r) => mr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { inject as ae, toRefs as yr, computed as N, reactive as xe, defineComponent as se, h as Z, ref as _e, markRaw as ge, watch as ie, onUnmounted as Le, defineAsyncComponent as gr, toValue as j, openBlock as wt, createElementBlock as vr, normalizeClass as Rr, renderSlot as Pt, normalizeProps as Et, guardReactiveProps as wr, unref as ue, getCurrentInstance as Pr, resolveComponent as Er, provide as br, mergeProps as Sr, createBlock as kr, resolveDynamicComponent as Ar, createCommentVNode as xr } from "vue";
|
|
5
|
+
function T(e) {
|
|
6
6
|
return typeof e != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(e);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function bt(e) {
|
|
9
|
+
return T(e) ? e : `/${e}`;
|
|
10
10
|
}
|
|
11
|
-
class
|
|
11
|
+
class Lr extends Error {
|
|
12
12
|
/**
|
|
13
13
|
* Constructs a new DuplicateParamsError instance with a message indicating the problematic parameter.
|
|
14
14
|
* @param paramName - The name of the parameter that was duplicated.
|
|
@@ -17,17 +17,17 @@ class Sr extends Error {
|
|
|
17
17
|
super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
class
|
|
20
|
+
class Ur extends Error {
|
|
21
21
|
constructor(t) {
|
|
22
22
|
super(`Child property on meta for ${t} conflicts with the parent meta.`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
class
|
|
25
|
+
class de extends Error {
|
|
26
26
|
constructor() {
|
|
27
27
|
super("Router not installed");
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class Cr extends Error {
|
|
31
31
|
/**
|
|
32
32
|
* Constructs a new UseRouteInvalidError instance with a message that specifies both the given and expected route names.
|
|
33
33
|
* This detailed error message aids in quickly identifying and resolving mismatches in route usage.
|
|
@@ -38,17 +38,17 @@ class Ar extends Error {
|
|
|
38
38
|
super(`useRoute called with incorrect route. Given ${t}, expected ${r}`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
const e = ae(
|
|
41
|
+
const St = Symbol();
|
|
42
|
+
function Me() {
|
|
43
|
+
const e = ae(St);
|
|
44
44
|
if (!e)
|
|
45
|
-
throw new
|
|
45
|
+
throw new de();
|
|
46
46
|
return e;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function me(e) {
|
|
49
49
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function Br(e) {
|
|
52
52
|
return e.every((t) => Array.isArray(t));
|
|
53
53
|
}
|
|
54
54
|
function F(e) {
|
|
@@ -59,111 +59,111 @@ function ve(e) {
|
|
|
59
59
|
value: F(e) ? e.replace(/^#*/, "") : void 0
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Nr(e, t) {
|
|
63
63
|
return ve(`${e.value ?? ""}${t.value ?? ""}`);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function Vr(e, t) {
|
|
66
|
+
return Hr(e, t), { ...e, ...t };
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Hr(e, t) {
|
|
69
69
|
const r = Object.keys(e).find((n) => n in t && typeof t[n] != typeof e[n]);
|
|
70
70
|
if (r)
|
|
71
|
-
throw new
|
|
71
|
+
throw new Ur(r);
|
|
72
72
|
}
|
|
73
73
|
function ee(e) {
|
|
74
74
|
return Array.isArray(e) ? e : [e];
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function kt(e, t) {
|
|
77
77
|
return e.filter((r) => t === r).length;
|
|
78
78
|
}
|
|
79
79
|
function ce(...e) {
|
|
80
|
-
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(
|
|
80
|
+
const t = e.flatMap((r) => Array.isArray(r) ? r : Object.keys(r).map(jr));
|
|
81
81
|
for (const r of t)
|
|
82
|
-
if (
|
|
83
|
-
throw new
|
|
82
|
+
if (kt(t, r) > 1)
|
|
83
|
+
throw new Lr(r);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function jr(e) {
|
|
86
86
|
return e.startsWith("?") ? e.slice(1) : e;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function $r(e, t) {
|
|
89
89
|
return ce(e.params, t.params), {
|
|
90
90
|
value: `${e.value}${t.value}`,
|
|
91
91
|
params: { ...e.params, ...t.params }
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function qr(e, t) {
|
|
95
95
|
return ce(e.params, t.params), {
|
|
96
96
|
value: [e.value, t.value].filter(F).join("&"),
|
|
97
97
|
params: { ...e.params, ...t.params }
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function _r(e, t) {
|
|
101
101
|
return ce(e, t), { ...e, ...t };
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Mr(e) {
|
|
104
104
|
return "host" in e && !!e.host;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function At(e) {
|
|
107
107
|
return "parent" in e && !!e.parent;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function We(e) {
|
|
110
110
|
return "component" in e && !!e.component;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function De(e) {
|
|
113
113
|
return "components" in e && !!e.components;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function Wr(e) {
|
|
116
116
|
return "state" in e && !!e.state;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function xt(e, t) {
|
|
119
119
|
return {
|
|
120
120
|
...t,
|
|
121
|
-
path:
|
|
122
|
-
query:
|
|
123
|
-
meta:
|
|
124
|
-
state:
|
|
125
|
-
hash:
|
|
121
|
+
path: $r(e.path, t.path),
|
|
122
|
+
query: qr(e.query, t.query),
|
|
123
|
+
meta: Vr(e.meta, t.meta),
|
|
124
|
+
state: _r(e.state, t.state),
|
|
125
|
+
hash: Nr(e.hash, t.hash),
|
|
126
126
|
matches: [...e.matches, t.matched],
|
|
127
127
|
host: e.host,
|
|
128
128
|
depth: e.depth + 1
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Ie() {
|
|
132
132
|
return typeof window < "u" && typeof window.document < "u";
|
|
133
133
|
}
|
|
134
|
-
class
|
|
134
|
+
class fe extends Error {
|
|
135
135
|
}
|
|
136
136
|
const J = "[", K = "]";
|
|
137
|
-
function
|
|
137
|
+
function Dr(e) {
|
|
138
138
|
return e !== String && e !== Boolean && e !== Number && e !== Date;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return typeof e == "function" &&
|
|
140
|
+
function Ir(e) {
|
|
141
|
+
return typeof e == "function" && Dr(e);
|
|
142
142
|
}
|
|
143
143
|
function Ue(e) {
|
|
144
144
|
return typeof e == "object" && "get" in e && typeof e.get == "function" && "set" in e && typeof e.set == "function";
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Or(e) {
|
|
147
147
|
return Ue(e) && e.defaultValue !== void 0;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
149
|
+
function po(e, t) {
|
|
150
|
+
return Jr(e, t);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Tr(e, t) {
|
|
153
153
|
return e[t] ?? String;
|
|
154
154
|
}
|
|
155
155
|
const q = {
|
|
156
156
|
invalid: (e) => {
|
|
157
|
-
throw new
|
|
157
|
+
throw new fe(e);
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, Fr = {
|
|
160
160
|
get: (e) => e,
|
|
161
161
|
set: (e, { invalid: t }) => {
|
|
162
162
|
if (typeof e != "string")
|
|
163
163
|
throw t();
|
|
164
164
|
return e;
|
|
165
165
|
}
|
|
166
|
-
},
|
|
166
|
+
}, Lt = {
|
|
167
167
|
get: (e, { invalid: t }) => {
|
|
168
168
|
if (e === "true")
|
|
169
169
|
return !0;
|
|
@@ -176,7 +176,7 @@ const q = {
|
|
|
176
176
|
throw t();
|
|
177
177
|
return e.toString();
|
|
178
178
|
}
|
|
179
|
-
},
|
|
179
|
+
}, Ut = {
|
|
180
180
|
get: (e, { invalid: t }) => {
|
|
181
181
|
const r = Number(e);
|
|
182
182
|
if (isNaN(r))
|
|
@@ -188,7 +188,7 @@ const q = {
|
|
|
188
188
|
throw t();
|
|
189
189
|
return e.toString();
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, Ct = {
|
|
192
192
|
get: (e, { invalid: t }) => {
|
|
193
193
|
const r = new Date(e);
|
|
194
194
|
if (isNaN(r.getTime()))
|
|
@@ -200,7 +200,7 @@ const q = {
|
|
|
200
200
|
throw t();
|
|
201
201
|
return e.toISOString();
|
|
202
202
|
}
|
|
203
|
-
},
|
|
203
|
+
}, Bt = {
|
|
204
204
|
get: (e, { invalid: t }) => {
|
|
205
205
|
try {
|
|
206
206
|
return JSON.parse(e);
|
|
@@ -216,61 +216,61 @@ const q = {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
|
-
function
|
|
219
|
+
function le(e, t, r = !1) {
|
|
220
220
|
if (e === void 0 || !F(e)) {
|
|
221
|
-
if (
|
|
221
|
+
if (Or(t))
|
|
222
222
|
return t.defaultValue;
|
|
223
223
|
if (r)
|
|
224
224
|
return;
|
|
225
|
-
throw new
|
|
225
|
+
throw new fe();
|
|
226
226
|
}
|
|
227
227
|
if (t === String)
|
|
228
|
-
return
|
|
228
|
+
return Fr.get(e, q);
|
|
229
229
|
if (t === Boolean)
|
|
230
|
-
return
|
|
230
|
+
return Lt.get(e, q);
|
|
231
231
|
if (t === Number)
|
|
232
|
-
return
|
|
232
|
+
return Ut.get(e, q);
|
|
233
233
|
if (t === Date)
|
|
234
|
-
return
|
|
234
|
+
return Ct.get(e, q);
|
|
235
235
|
if (t === JSON)
|
|
236
|
-
return
|
|
237
|
-
if (
|
|
236
|
+
return Bt.get(e, q);
|
|
237
|
+
if (Ir(t))
|
|
238
238
|
return t(e, q);
|
|
239
239
|
if (Ue(t))
|
|
240
240
|
return t.get(e, q);
|
|
241
241
|
if (t instanceof RegExp) {
|
|
242
242
|
if (t.test(e))
|
|
243
243
|
return e;
|
|
244
|
-
throw new
|
|
244
|
+
throw new fe();
|
|
245
245
|
}
|
|
246
246
|
return e;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function he(e, t, r = !1) {
|
|
249
249
|
if (e === void 0) {
|
|
250
250
|
if (r)
|
|
251
251
|
return "";
|
|
252
|
-
throw new
|
|
252
|
+
throw new fe();
|
|
253
253
|
}
|
|
254
254
|
if (t === Boolean)
|
|
255
|
-
return
|
|
255
|
+
return Lt.set(e, q);
|
|
256
256
|
if (t === Number)
|
|
257
|
-
return
|
|
257
|
+
return Ut.set(e, q);
|
|
258
258
|
if (t === Date)
|
|
259
|
-
return
|
|
259
|
+
return Ct.set(e, q);
|
|
260
260
|
if (t === JSON)
|
|
261
|
-
return
|
|
261
|
+
return Bt.set(e, q);
|
|
262
262
|
if (Ue(t))
|
|
263
263
|
return t.set(e, q);
|
|
264
264
|
try {
|
|
265
265
|
return e.toString();
|
|
266
266
|
} catch {
|
|
267
|
-
throw new
|
|
267
|
+
throw new fe();
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function Jr(e, t) {
|
|
271
271
|
return Ue(e) ? { ...e, defaultValue: t ?? e.defaultValue } : {
|
|
272
|
-
get: (r) =>
|
|
273
|
-
set: (r) =>
|
|
272
|
+
get: (r) => le(r, e),
|
|
273
|
+
set: (r) => he(r, e),
|
|
274
274
|
defaultValue: t
|
|
275
275
|
};
|
|
276
276
|
}
|
|
@@ -278,10 +278,11 @@ function G() {
|
|
|
278
278
|
return G = Object.assign ? Object.assign.bind() : function(e) {
|
|
279
279
|
for (var t = 1; t < arguments.length; t++) {
|
|
280
280
|
var r = arguments[t];
|
|
281
|
-
for (var n in r)
|
|
281
|
+
for (var n in r)
|
|
282
|
+
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
282
283
|
}
|
|
283
284
|
return e;
|
|
284
|
-
}, G.apply(
|
|
285
|
+
}, G.apply(this, arguments);
|
|
285
286
|
}
|
|
286
287
|
var V;
|
|
287
288
|
(function(e) {
|
|
@@ -301,36 +302,36 @@ function Y(e, t) {
|
|
|
301
302
|
}
|
|
302
303
|
}
|
|
303
304
|
}
|
|
304
|
-
var Re = "beforeunload",
|
|
305
|
-
function
|
|
305
|
+
var Re = "beforeunload", Qr = "hashchange", Nt = "popstate";
|
|
306
|
+
function ct(e) {
|
|
306
307
|
e === void 0 && (e = {});
|
|
307
308
|
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
308
309
|
function a() {
|
|
309
|
-
var g = n.location, l = g.pathname, y = g.search, S = g.hash,
|
|
310
|
-
return [
|
|
310
|
+
var g = n.location, l = g.pathname, y = g.search, S = g.hash, A = o.state || {};
|
|
311
|
+
return [A.idx, re({
|
|
311
312
|
pathname: l,
|
|
312
313
|
search: y,
|
|
313
314
|
hash: S,
|
|
314
|
-
state:
|
|
315
|
-
key:
|
|
315
|
+
state: A.usr || null,
|
|
316
|
+
key: A.key || "default"
|
|
316
317
|
})];
|
|
317
318
|
}
|
|
318
319
|
var s = null;
|
|
319
320
|
function c() {
|
|
320
321
|
if (s)
|
|
321
|
-
|
|
322
|
+
d.call(s), s = null;
|
|
322
323
|
else {
|
|
323
324
|
var g = V.Pop, l = a(), y = l[0], S = l[1];
|
|
324
|
-
if (
|
|
325
|
+
if (d.length)
|
|
325
326
|
if (y != null) {
|
|
326
|
-
var
|
|
327
|
-
|
|
327
|
+
var A = f - y;
|
|
328
|
+
A && (s = {
|
|
328
329
|
action: g,
|
|
329
330
|
location: S,
|
|
330
331
|
retry: function() {
|
|
331
|
-
x(
|
|
332
|
+
x(A * -1);
|
|
332
333
|
}
|
|
333
|
-
}, x(
|
|
334
|
+
}, x(A));
|
|
334
335
|
} else
|
|
335
336
|
process.env.NODE_ENV !== "production" && Y(
|
|
336
337
|
!1,
|
|
@@ -340,23 +341,23 @@ function at(e) {
|
|
|
340
341
|
"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
|
|
341
342
|
);
|
|
342
343
|
else
|
|
343
|
-
|
|
344
|
+
k(g);
|
|
344
345
|
}
|
|
345
346
|
}
|
|
346
|
-
n.addEventListener(
|
|
347
|
-
var i = V.Pop, u = a(), f = u[0],
|
|
347
|
+
n.addEventListener(Nt, c);
|
|
348
|
+
var i = V.Pop, u = a(), f = u[0], h = u[1], P = ne(), d = ne();
|
|
348
349
|
f == null && (f = 0, o.replaceState(G({}, o.state, {
|
|
349
350
|
idx: f
|
|
350
351
|
}), ""));
|
|
351
|
-
function
|
|
352
|
+
function p(g) {
|
|
352
353
|
return typeof g == "string" ? g : X(g);
|
|
353
354
|
}
|
|
354
355
|
function v(g, l) {
|
|
355
356
|
return l === void 0 && (l = null), re(G({
|
|
356
|
-
pathname:
|
|
357
|
+
pathname: h.pathname,
|
|
357
358
|
hash: "",
|
|
358
359
|
search: ""
|
|
359
|
-
}, typeof g == "string" ?
|
|
360
|
+
}, typeof g == "string" ? pe(g) : g, {
|
|
360
361
|
state: l,
|
|
361
362
|
key: Pe()
|
|
362
363
|
}));
|
|
@@ -366,59 +367,59 @@ function at(e) {
|
|
|
366
367
|
usr: g.state,
|
|
367
368
|
key: g.key,
|
|
368
369
|
idx: l
|
|
369
|
-
},
|
|
370
|
+
}, p(g)];
|
|
370
371
|
}
|
|
371
372
|
function E(g, l, y) {
|
|
372
|
-
return !
|
|
373
|
+
return !d.length || (d.call({
|
|
373
374
|
action: g,
|
|
374
375
|
location: l,
|
|
375
376
|
retry: y
|
|
376
377
|
}), !1);
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function k(g) {
|
|
379
380
|
i = g;
|
|
380
381
|
var l = a();
|
|
381
|
-
f = l[0],
|
|
382
|
+
f = l[0], h = l[1], P.call({
|
|
382
383
|
action: i,
|
|
383
|
-
location:
|
|
384
|
+
location: h
|
|
384
385
|
});
|
|
385
386
|
}
|
|
386
387
|
function m(g, l) {
|
|
387
388
|
var y = V.Push, S = v(g, l);
|
|
388
|
-
function
|
|
389
|
+
function A() {
|
|
389
390
|
m(g, l);
|
|
390
391
|
}
|
|
391
|
-
if (E(y, S,
|
|
392
|
+
if (E(y, S, A)) {
|
|
392
393
|
var C = R(S, f + 1), B = C[0], H = C[1];
|
|
393
394
|
try {
|
|
394
395
|
o.pushState(B, "", H);
|
|
395
396
|
} catch {
|
|
396
397
|
n.location.assign(H);
|
|
397
398
|
}
|
|
398
|
-
|
|
399
|
+
k(y);
|
|
399
400
|
}
|
|
400
401
|
}
|
|
401
402
|
function w(g, l) {
|
|
402
403
|
var y = V.Replace, S = v(g, l);
|
|
403
|
-
function
|
|
404
|
+
function A() {
|
|
404
405
|
w(g, l);
|
|
405
406
|
}
|
|
406
|
-
if (E(y, S,
|
|
407
|
+
if (E(y, S, A)) {
|
|
407
408
|
var C = R(S, f), B = C[0], H = C[1];
|
|
408
|
-
o.replaceState(B, "", H),
|
|
409
|
+
o.replaceState(B, "", H), k(y);
|
|
409
410
|
}
|
|
410
411
|
}
|
|
411
412
|
function x(g) {
|
|
412
413
|
o.go(g);
|
|
413
414
|
}
|
|
414
|
-
var
|
|
415
|
+
var L = {
|
|
415
416
|
get action() {
|
|
416
417
|
return i;
|
|
417
418
|
},
|
|
418
419
|
get location() {
|
|
419
|
-
return
|
|
420
|
+
return h;
|
|
420
421
|
},
|
|
421
|
-
createHref:
|
|
422
|
+
createHref: p,
|
|
422
423
|
push: m,
|
|
423
424
|
replace: w,
|
|
424
425
|
go: x,
|
|
@@ -432,19 +433,19 @@ function at(e) {
|
|
|
432
433
|
return P.push(l);
|
|
433
434
|
},
|
|
434
435
|
block: function(l) {
|
|
435
|
-
var y =
|
|
436
|
-
return
|
|
437
|
-
y(),
|
|
436
|
+
var y = d.push(l);
|
|
437
|
+
return d.length === 1 && n.addEventListener(Re, we), function() {
|
|
438
|
+
y(), d.length || n.removeEventListener(Re, we);
|
|
438
439
|
};
|
|
439
440
|
}
|
|
440
441
|
};
|
|
441
|
-
return
|
|
442
|
+
return L;
|
|
442
443
|
}
|
|
443
|
-
function
|
|
444
|
+
function zr(e) {
|
|
444
445
|
e === void 0 && (e = {});
|
|
445
446
|
var t = e, r = t.window, n = r === void 0 ? document.defaultView : r, o = n.history;
|
|
446
447
|
function a() {
|
|
447
|
-
var l =
|
|
448
|
+
var l = pe(n.location.hash.substr(1)), y = l.pathname, S = y === void 0 ? "/" : y, A = l.search, C = A === void 0 ? "" : A, B = l.hash, H = B === void 0 ? "" : B, M = o.state || {};
|
|
448
449
|
return [M.idx, re({
|
|
449
450
|
pathname: S,
|
|
450
451
|
search: C,
|
|
@@ -456,19 +457,19 @@ function Or(e) {
|
|
|
456
457
|
var s = null;
|
|
457
458
|
function c() {
|
|
458
459
|
if (s)
|
|
459
|
-
|
|
460
|
+
d.call(s), s = null;
|
|
460
461
|
else {
|
|
461
|
-
var l = V.Pop, y = a(), S = y[0],
|
|
462
|
-
if (
|
|
462
|
+
var l = V.Pop, y = a(), S = y[0], A = y[1];
|
|
463
|
+
if (d.length)
|
|
463
464
|
if (S != null) {
|
|
464
465
|
var C = f - S;
|
|
465
466
|
C && (s = {
|
|
466
467
|
action: l,
|
|
467
|
-
location:
|
|
468
|
+
location: A,
|
|
468
469
|
retry: function() {
|
|
469
|
-
|
|
470
|
+
L(C * -1);
|
|
470
471
|
}
|
|
471
|
-
},
|
|
472
|
+
}, L(C));
|
|
472
473
|
} else
|
|
473
474
|
process.env.NODE_ENV !== "production" && Y(
|
|
474
475
|
!1,
|
|
@@ -481,31 +482,31 @@ function Or(e) {
|
|
|
481
482
|
m(l);
|
|
482
483
|
}
|
|
483
484
|
}
|
|
484
|
-
n.addEventListener(
|
|
485
|
+
n.addEventListener(Nt, c), n.addEventListener(Qr, function() {
|
|
485
486
|
var l = a(), y = l[1];
|
|
486
|
-
X(y) !== X(
|
|
487
|
+
X(y) !== X(h) && c();
|
|
487
488
|
});
|
|
488
|
-
var i = V.Pop, u = a(), f = u[0],
|
|
489
|
+
var i = V.Pop, u = a(), f = u[0], h = u[1], P = ne(), d = ne();
|
|
489
490
|
f == null && (f = 0, o.replaceState(G({}, o.state, {
|
|
490
491
|
idx: f
|
|
491
492
|
}), ""));
|
|
492
|
-
function
|
|
493
|
+
function p() {
|
|
493
494
|
var l = document.querySelector("base"), y = "";
|
|
494
495
|
if (l && l.getAttribute("href")) {
|
|
495
|
-
var S = n.location.href,
|
|
496
|
-
y =
|
|
496
|
+
var S = n.location.href, A = S.indexOf("#");
|
|
497
|
+
y = A === -1 ? S : S.slice(0, A);
|
|
497
498
|
}
|
|
498
499
|
return y;
|
|
499
500
|
}
|
|
500
501
|
function v(l) {
|
|
501
|
-
return
|
|
502
|
+
return p() + "#" + (typeof l == "string" ? l : X(l));
|
|
502
503
|
}
|
|
503
504
|
function R(l, y) {
|
|
504
505
|
return y === void 0 && (y = null), re(G({
|
|
505
|
-
pathname:
|
|
506
|
+
pathname: h.pathname,
|
|
506
507
|
hash: "",
|
|
507
508
|
search: ""
|
|
508
|
-
}, typeof l == "string" ?
|
|
509
|
+
}, typeof l == "string" ? pe(l) : l, {
|
|
509
510
|
state: y,
|
|
510
511
|
key: Pe()
|
|
511
512
|
}));
|
|
@@ -517,8 +518,8 @@ function Or(e) {
|
|
|
517
518
|
idx: y
|
|
518
519
|
}, v(l)];
|
|
519
520
|
}
|
|
520
|
-
function
|
|
521
|
-
return !
|
|
521
|
+
function k(l, y, S) {
|
|
522
|
+
return !d.length || (d.call({
|
|
522
523
|
action: l,
|
|
523
524
|
location: y,
|
|
524
525
|
retry: S
|
|
@@ -527,18 +528,18 @@ function Or(e) {
|
|
|
527
528
|
function m(l) {
|
|
528
529
|
i = l;
|
|
529
530
|
var y = a();
|
|
530
|
-
f = y[0],
|
|
531
|
+
f = y[0], h = y[1], P.call({
|
|
531
532
|
action: i,
|
|
532
|
-
location:
|
|
533
|
+
location: h
|
|
533
534
|
});
|
|
534
535
|
}
|
|
535
536
|
function w(l, y) {
|
|
536
|
-
var S = V.Push,
|
|
537
|
+
var S = V.Push, A = R(l, y);
|
|
537
538
|
function C() {
|
|
538
539
|
w(l, y);
|
|
539
540
|
}
|
|
540
|
-
if (process.env.NODE_ENV !== "production" && Y(
|
|
541
|
-
var B = E(
|
|
541
|
+
if (process.env.NODE_ENV !== "production" && Y(A.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(l) + ")"), k(S, A, C)) {
|
|
542
|
+
var B = E(A, f + 1), H = B[0], M = B[1];
|
|
542
543
|
try {
|
|
543
544
|
o.pushState(H, "", M);
|
|
544
545
|
} catch {
|
|
@@ -548,16 +549,16 @@ function Or(e) {
|
|
|
548
549
|
}
|
|
549
550
|
}
|
|
550
551
|
function x(l, y) {
|
|
551
|
-
var S = V.Replace,
|
|
552
|
+
var S = V.Replace, A = R(l, y);
|
|
552
553
|
function C() {
|
|
553
554
|
x(l, y);
|
|
554
555
|
}
|
|
555
|
-
if (process.env.NODE_ENV !== "production" && Y(
|
|
556
|
-
var B = E(
|
|
556
|
+
if (process.env.NODE_ENV !== "production" && Y(A.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(l) + ")"), k(S, A, C)) {
|
|
557
|
+
var B = E(A, f), H = B[0], M = B[1];
|
|
557
558
|
o.replaceState(H, "", M), m(S);
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
|
-
function
|
|
561
|
+
function L(l) {
|
|
561
562
|
o.go(l);
|
|
562
563
|
}
|
|
563
564
|
var g = {
|
|
@@ -565,31 +566,31 @@ function Or(e) {
|
|
|
565
566
|
return i;
|
|
566
567
|
},
|
|
567
568
|
get location() {
|
|
568
|
-
return
|
|
569
|
+
return h;
|
|
569
570
|
},
|
|
570
571
|
createHref: v,
|
|
571
572
|
push: w,
|
|
572
573
|
replace: x,
|
|
573
|
-
go:
|
|
574
|
+
go: L,
|
|
574
575
|
back: function() {
|
|
575
|
-
|
|
576
|
+
L(-1);
|
|
576
577
|
},
|
|
577
578
|
forward: function() {
|
|
578
|
-
|
|
579
|
+
L(1);
|
|
579
580
|
},
|
|
580
581
|
listen: function(y) {
|
|
581
582
|
return P.push(y);
|
|
582
583
|
},
|
|
583
584
|
block: function(y) {
|
|
584
|
-
var S =
|
|
585
|
-
return
|
|
586
|
-
S(),
|
|
585
|
+
var S = d.push(y);
|
|
586
|
+
return d.length === 1 && n.addEventListener(Re, we), function() {
|
|
587
|
+
S(), d.length || n.removeEventListener(Re, we);
|
|
587
588
|
};
|
|
588
589
|
}
|
|
589
590
|
};
|
|
590
591
|
return g;
|
|
591
592
|
}
|
|
592
|
-
function
|
|
593
|
+
function ut(e) {
|
|
593
594
|
e === void 0 && (e = {});
|
|
594
595
|
var t = e, r = t.initialEntries, n = r === void 0 ? ["/"] : r, o = t.initialIndex, a = n.map(function(m) {
|
|
595
596
|
var w = re(G({
|
|
@@ -598,10 +599,10 @@ function st(e) {
|
|
|
598
599
|
hash: "",
|
|
599
600
|
state: null,
|
|
600
601
|
key: Pe()
|
|
601
|
-
}, typeof m == "string" ?
|
|
602
|
+
}, typeof m == "string" ? pe(m) : m));
|
|
602
603
|
return process.env.NODE_ENV !== "production" && Y(w.pathname.charAt(0) === "/", "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(m) + ")"), w;
|
|
603
|
-
}), s =
|
|
604
|
-
function
|
|
604
|
+
}), s = it(o ?? a.length - 1, 0, a.length - 1), c = V.Pop, i = a[s], u = ne(), f = ne();
|
|
605
|
+
function h(m) {
|
|
605
606
|
return typeof m == "string" ? m : X(m);
|
|
606
607
|
}
|
|
607
608
|
function P(m, w) {
|
|
@@ -609,46 +610,46 @@ function st(e) {
|
|
|
609
610
|
pathname: i.pathname,
|
|
610
611
|
search: "",
|
|
611
612
|
hash: ""
|
|
612
|
-
}, typeof m == "string" ?
|
|
613
|
+
}, typeof m == "string" ? pe(m) : m, {
|
|
613
614
|
state: w,
|
|
614
615
|
key: Pe()
|
|
615
616
|
}));
|
|
616
617
|
}
|
|
617
|
-
function
|
|
618
|
+
function d(m, w, x) {
|
|
618
619
|
return !f.length || (f.call({
|
|
619
620
|
action: m,
|
|
620
621
|
location: w,
|
|
621
622
|
retry: x
|
|
622
623
|
}), !1);
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
+
function p(m, w) {
|
|
625
626
|
c = m, i = w, u.call({
|
|
626
627
|
action: c,
|
|
627
628
|
location: i
|
|
628
629
|
});
|
|
629
630
|
}
|
|
630
631
|
function v(m, w) {
|
|
631
|
-
var x = V.Push,
|
|
632
|
+
var x = V.Push, L = P(m, w);
|
|
632
633
|
function g() {
|
|
633
634
|
v(m, w);
|
|
634
635
|
}
|
|
635
|
-
process.env.NODE_ENV !== "production" && Y(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(m) + ")"),
|
|
636
|
+
process.env.NODE_ENV !== "production" && Y(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.push(" + JSON.stringify(m) + ")"), d(x, L, g) && (s += 1, a.splice(s, a.length, L), p(x, L));
|
|
636
637
|
}
|
|
637
638
|
function R(m, w) {
|
|
638
|
-
var x = V.Replace,
|
|
639
|
+
var x = V.Replace, L = P(m, w);
|
|
639
640
|
function g() {
|
|
640
641
|
R(m, w);
|
|
641
642
|
}
|
|
642
|
-
process.env.NODE_ENV !== "production" && Y(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(m) + ")"),
|
|
643
|
+
process.env.NODE_ENV !== "production" && Y(i.pathname.charAt(0) === "/", "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(m) + ")"), d(x, L, g) && (a[s] = L, p(x, L));
|
|
643
644
|
}
|
|
644
645
|
function E(m) {
|
|
645
|
-
var w =
|
|
646
|
+
var w = it(s + m, 0, a.length - 1), x = V.Pop, L = a[w];
|
|
646
647
|
function g() {
|
|
647
648
|
E(m);
|
|
648
649
|
}
|
|
649
|
-
|
|
650
|
+
d(x, L, g) && (s = w, p(x, L));
|
|
650
651
|
}
|
|
651
|
-
var
|
|
652
|
+
var k = {
|
|
652
653
|
get index() {
|
|
653
654
|
return s;
|
|
654
655
|
},
|
|
@@ -658,7 +659,7 @@ function st(e) {
|
|
|
658
659
|
get location() {
|
|
659
660
|
return i;
|
|
660
661
|
},
|
|
661
|
-
createHref:
|
|
662
|
+
createHref: h,
|
|
662
663
|
push: v,
|
|
663
664
|
replace: R,
|
|
664
665
|
go: E,
|
|
@@ -675,9 +676,9 @@ function st(e) {
|
|
|
675
676
|
return f.push(w);
|
|
676
677
|
}
|
|
677
678
|
};
|
|
678
|
-
return
|
|
679
|
+
return k;
|
|
679
680
|
}
|
|
680
|
-
function
|
|
681
|
+
function it(e, t, r) {
|
|
681
682
|
return Math.min(Math.max(e, t), r);
|
|
682
683
|
}
|
|
683
684
|
function we(e) {
|
|
@@ -710,7 +711,7 @@ function X(e) {
|
|
|
710
711
|
var t = e.pathname, r = t === void 0 ? "/" : t, n = e.search, o = n === void 0 ? "" : n, a = e.hash, s = a === void 0 ? "" : a;
|
|
711
712
|
return o && o !== "?" && (r += o.charAt(0) === "?" ? o : "?" + o), s && s !== "#" && (r += s.charAt(0) === "#" ? s : "#" + s), r;
|
|
712
713
|
}
|
|
713
|
-
function
|
|
714
|
+
function pe(e) {
|
|
714
715
|
var t = {};
|
|
715
716
|
if (e) {
|
|
716
717
|
var r = e.indexOf("#");
|
|
@@ -720,19 +721,19 @@ function he(e) {
|
|
|
720
721
|
}
|
|
721
722
|
return t;
|
|
722
723
|
}
|
|
723
|
-
const
|
|
724
|
-
function
|
|
725
|
-
const e = ae(
|
|
724
|
+
const Vt = Symbol();
|
|
725
|
+
function Gr() {
|
|
726
|
+
const e = ae(Vt);
|
|
726
727
|
if (!e)
|
|
727
|
-
throw new
|
|
728
|
+
throw new de();
|
|
728
729
|
return e;
|
|
729
730
|
}
|
|
730
|
-
const
|
|
731
|
-
function
|
|
732
|
-
return typeof e == "object" && e !== null &&
|
|
731
|
+
const Ht = Symbol("isRouterRouteSymbol");
|
|
732
|
+
function Kr(e) {
|
|
733
|
+
return typeof e == "object" && e !== null && Ht in e;
|
|
733
734
|
}
|
|
734
|
-
function
|
|
735
|
-
function r(R, E,
|
|
735
|
+
function Yr(e, t) {
|
|
736
|
+
function r(R, E, k) {
|
|
736
737
|
if (typeof R == "object") {
|
|
737
738
|
const w = {
|
|
738
739
|
...e.params,
|
|
@@ -744,7 +745,7 @@ function Qr(e, t) {
|
|
|
744
745
|
...e.params,
|
|
745
746
|
[R]: E
|
|
746
747
|
};
|
|
747
|
-
return t(e.name, m,
|
|
748
|
+
return t(e.name, m, k);
|
|
748
749
|
}
|
|
749
750
|
const n = (...R) => {
|
|
750
751
|
const E = new URLSearchParams(e.query);
|
|
@@ -755,21 +756,21 @@ function Qr(e, t) {
|
|
|
755
756
|
}, a = (...R) => {
|
|
756
757
|
const E = new URLSearchParams(e.query);
|
|
757
758
|
E.delete(...R), r({}, { query: E });
|
|
758
|
-
}, { id: s, matched: c, matches: i, name: u, hash: f, href:
|
|
759
|
+
}, { id: s, matched: c, matches: i, name: u, hash: f, href: h } = yr(e), P = N({
|
|
759
760
|
get() {
|
|
760
761
|
return new Proxy(e.params, {
|
|
761
|
-
set(R, E,
|
|
762
|
-
return r(E,
|
|
762
|
+
set(R, E, k) {
|
|
763
|
+
return r(E, k), !0;
|
|
763
764
|
}
|
|
764
765
|
});
|
|
765
766
|
},
|
|
766
767
|
set(R) {
|
|
767
768
|
r(R);
|
|
768
769
|
}
|
|
769
|
-
}),
|
|
770
|
+
}), d = N({
|
|
770
771
|
get() {
|
|
771
772
|
return new Proxy(e.query, {
|
|
772
|
-
get(R, E,
|
|
773
|
+
get(R, E, k) {
|
|
773
774
|
switch (E) {
|
|
774
775
|
case "append":
|
|
775
776
|
return o;
|
|
@@ -778,7 +779,7 @@ function Qr(e, t) {
|
|
|
778
779
|
case "delete":
|
|
779
780
|
return a;
|
|
780
781
|
default:
|
|
781
|
-
return Reflect.get(R, E,
|
|
782
|
+
return Reflect.get(R, E, k);
|
|
782
783
|
}
|
|
783
784
|
}
|
|
784
785
|
});
|
|
@@ -786,11 +787,11 @@ function Qr(e, t) {
|
|
|
786
787
|
set(R) {
|
|
787
788
|
r({}, { query: R });
|
|
788
789
|
}
|
|
789
|
-
}),
|
|
790
|
+
}), p = N({
|
|
790
791
|
get() {
|
|
791
792
|
return new Proxy(e.state, {
|
|
792
|
-
set(R, E,
|
|
793
|
-
return r({}, { state: { ...e.state, [E]:
|
|
793
|
+
set(R, E, k) {
|
|
794
|
+
return r({}, { state: { ...e.state, [E]: k } }), !0;
|
|
794
795
|
}
|
|
795
796
|
});
|
|
796
797
|
},
|
|
@@ -802,24 +803,24 @@ function Qr(e, t) {
|
|
|
802
803
|
id: s,
|
|
803
804
|
matched: c,
|
|
804
805
|
matches: i,
|
|
805
|
-
state:
|
|
806
|
-
query:
|
|
806
|
+
state: p,
|
|
807
|
+
query: d,
|
|
807
808
|
hash: f,
|
|
808
809
|
params: P,
|
|
809
810
|
name: u,
|
|
810
|
-
href:
|
|
811
|
+
href: h,
|
|
811
812
|
update: r,
|
|
812
|
-
[
|
|
813
|
+
[Ht]: !0
|
|
813
814
|
});
|
|
814
815
|
}
|
|
815
|
-
const
|
|
816
|
-
function
|
|
816
|
+
const jt = Symbol();
|
|
817
|
+
function Xr(e, t) {
|
|
817
818
|
const r = xe({ ...e }), n = (s) => {
|
|
818
819
|
Object.assign(r, {
|
|
819
|
-
[
|
|
820
|
+
[jt]: !1,
|
|
820
821
|
...s
|
|
821
822
|
});
|
|
822
|
-
}, o = r, a =
|
|
823
|
+
}, o = r, a = Yr(o, t);
|
|
823
824
|
return {
|
|
824
825
|
currentRoute: o,
|
|
825
826
|
routerRoute: a,
|
|
@@ -827,9 +828,9 @@ function zr(e, t) {
|
|
|
827
828
|
};
|
|
828
829
|
}
|
|
829
830
|
function _(e) {
|
|
830
|
-
return !e.startsWith("http") ?
|
|
831
|
+
return !e.startsWith("http") ? en(e) : Zr(e);
|
|
831
832
|
}
|
|
832
|
-
function
|
|
833
|
+
function Zr(e) {
|
|
833
834
|
const { protocol: t, host: r, pathname: n, search: o, searchParams: a, hash: s } = new URL(e, e);
|
|
834
835
|
return {
|
|
835
836
|
protocol: t,
|
|
@@ -840,7 +841,7 @@ function Gr(e) {
|
|
|
840
841
|
hash: s
|
|
841
842
|
};
|
|
842
843
|
}
|
|
843
|
-
function
|
|
844
|
+
function en(e) {
|
|
844
845
|
const { pathname: t, search: r, searchParams: n, hash: o } = new URL(e, "https://localhost");
|
|
845
846
|
return {
|
|
846
847
|
pathname: t,
|
|
@@ -849,14 +850,14 @@ function Kr(e) {
|
|
|
849
850
|
hash: o
|
|
850
851
|
};
|
|
851
852
|
}
|
|
852
|
-
function
|
|
853
|
+
function tn(e) {
|
|
853
854
|
return (t) => {
|
|
854
855
|
const { host: r } = _(t);
|
|
855
856
|
return !(r === void 0 || r === e);
|
|
856
857
|
};
|
|
857
858
|
}
|
|
858
|
-
function
|
|
859
|
-
const r =
|
|
859
|
+
function rn({ mode: e, listener: t }) {
|
|
860
|
+
const r = nn(e), n = (i, u) => {
|
|
860
861
|
if (u != null && u.replace) {
|
|
861
862
|
r.replace(i, u.state);
|
|
862
863
|
return;
|
|
@@ -879,16 +880,16 @@ function Xr({ mode: e, listener: t }) {
|
|
|
879
880
|
}
|
|
880
881
|
};
|
|
881
882
|
}
|
|
882
|
-
function
|
|
883
|
+
function nn(e = "auto") {
|
|
883
884
|
switch (e) {
|
|
884
885
|
case "auto":
|
|
885
|
-
return
|
|
886
|
+
return Ie() ? ct() : ut();
|
|
886
887
|
case "browser":
|
|
887
|
-
return
|
|
888
|
+
return ct();
|
|
888
889
|
case "memory":
|
|
889
|
-
return
|
|
890
|
+
return ut();
|
|
890
891
|
case "hash":
|
|
891
|
-
return
|
|
892
|
+
return zr();
|
|
892
893
|
default:
|
|
893
894
|
const t = e;
|
|
894
895
|
throw new Error(`Switch is not exhaustive for mode: ${t}`);
|
|
@@ -896,122 +897,122 @@ function Zr(e = "auto") {
|
|
|
896
897
|
}
|
|
897
898
|
class Ee {
|
|
898
899
|
constructor() {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
900
|
+
O(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
901
|
+
O(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
902
|
+
O(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
903
|
+
O(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
904
|
+
O(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
905
|
+
O(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
905
906
|
}
|
|
906
907
|
}
|
|
907
|
-
class
|
|
908
|
+
class $t extends Error {
|
|
908
909
|
constructor() {
|
|
909
910
|
super("Uncaught CallbackContextAbortError");
|
|
910
|
-
|
|
911
|
+
O(this, "response");
|
|
911
912
|
this.response = { status: "ABORT" };
|
|
912
913
|
}
|
|
913
914
|
}
|
|
914
915
|
class te extends Error {
|
|
915
916
|
constructor(r) {
|
|
916
917
|
super("Uncaught CallbackContextPushError");
|
|
917
|
-
|
|
918
|
+
O(this, "response");
|
|
918
919
|
this.response = { status: "PUSH", to: r };
|
|
919
920
|
}
|
|
920
921
|
}
|
|
921
922
|
class be extends Error {
|
|
922
923
|
constructor(r) {
|
|
923
924
|
super("Uncaught CallbackContextRejectionError");
|
|
924
|
-
|
|
925
|
+
O(this, "response");
|
|
925
926
|
this.response = { status: "REJECT", type: r };
|
|
926
927
|
}
|
|
927
928
|
}
|
|
928
|
-
function
|
|
929
|
+
function on(e, t) {
|
|
929
930
|
const r = new Ee();
|
|
930
931
|
return e.matches.forEach((n, o) => {
|
|
931
|
-
n.onBeforeRouteEnter &&
|
|
932
|
+
n.onBeforeRouteEnter && Oe(e, t, o) && ee(n.onBeforeRouteEnter).forEach((a) => r.onBeforeRouteEnter.add(a)), n.onBeforeRouteUpdate && Fe(e, t, o) && ee(n.onBeforeRouteUpdate).forEach((a) => r.onBeforeRouteUpdate.add(a));
|
|
932
933
|
}), t.matches.forEach((n, o) => {
|
|
933
934
|
n.onBeforeRouteLeave && Te(e, t, o) && ee(n.onBeforeRouteLeave).forEach((a) => r.onBeforeRouteLeave.add(a));
|
|
934
935
|
}), r;
|
|
935
936
|
}
|
|
936
|
-
function
|
|
937
|
+
function an(e, t) {
|
|
937
938
|
const r = new Ee();
|
|
938
939
|
return e.matches.forEach((n, o) => {
|
|
939
|
-
n.onAfterRouteEnter &&
|
|
940
|
+
n.onAfterRouteEnter && Oe(e, t, o) && ee(n.onAfterRouteEnter).forEach((a) => r.onAfterRouteEnter.add(a)), n.onAfterRouteUpdate && Fe(e, t, o) && ee(n.onAfterRouteUpdate).forEach((a) => r.onAfterRouteUpdate.add(a));
|
|
940
941
|
}), t.matches.forEach((n, o) => {
|
|
941
942
|
n.onAfterRouteLeave && Te(e, t, o) && ee(n.onAfterRouteLeave).forEach((a) => r.onAfterRouteLeave.add(a));
|
|
942
943
|
}), r;
|
|
943
944
|
}
|
|
944
|
-
function
|
|
945
|
+
function qt() {
|
|
945
946
|
return { reject: (o) => {
|
|
946
947
|
throw new be(o);
|
|
947
948
|
}, push: (...o) => {
|
|
948
949
|
throw new te(o);
|
|
949
950
|
}, replace: (o, a, s) => {
|
|
950
|
-
if (
|
|
951
|
+
if (T(o)) {
|
|
951
952
|
const u = a ?? {};
|
|
952
953
|
throw new te([o, { ...u, replace: !0 }]);
|
|
953
954
|
}
|
|
954
955
|
const c = a, i = s ?? {};
|
|
955
956
|
throw new te([o, c, { ...i, replace: !0 }]);
|
|
956
957
|
}, abort: () => {
|
|
957
|
-
throw new
|
|
958
|
+
throw new $t();
|
|
958
959
|
} };
|
|
959
960
|
}
|
|
960
|
-
function
|
|
961
|
-
const { reject: e, push: t, replace: r, abort: n } =
|
|
961
|
+
function sn() {
|
|
962
|
+
const { reject: e, push: t, replace: r, abort: n } = qt();
|
|
962
963
|
async function o({ to: s, from: c, hooks: i }) {
|
|
963
|
-
const { global: u, component: f } = i,
|
|
964
|
+
const { global: u, component: f } = i, h = on(s, c), P = [
|
|
964
965
|
...u.onBeforeRouteEnter,
|
|
965
|
-
...
|
|
966
|
+
...h.onBeforeRouteEnter,
|
|
966
967
|
...u.onBeforeRouteUpdate,
|
|
967
|
-
...
|
|
968
|
+
...h.onBeforeRouteUpdate,
|
|
968
969
|
...f.onBeforeRouteUpdate,
|
|
969
970
|
...u.onBeforeRouteLeave,
|
|
970
|
-
...
|
|
971
|
+
...h.onBeforeRouteLeave,
|
|
971
972
|
...f.onBeforeRouteLeave
|
|
972
973
|
];
|
|
973
974
|
try {
|
|
974
|
-
const
|
|
975
|
+
const d = P.map((p) => p(s, {
|
|
975
976
|
from: c,
|
|
976
977
|
reject: e,
|
|
977
978
|
push: t,
|
|
978
979
|
replace: r,
|
|
979
980
|
abort: n
|
|
980
981
|
}));
|
|
981
|
-
await Promise.all(
|
|
982
|
-
} catch (
|
|
983
|
-
if (
|
|
984
|
-
return
|
|
985
|
-
throw
|
|
982
|
+
await Promise.all(d);
|
|
983
|
+
} catch (d) {
|
|
984
|
+
if (d instanceof te || d instanceof be || d instanceof $t)
|
|
985
|
+
return d.response;
|
|
986
|
+
throw d;
|
|
986
987
|
}
|
|
987
988
|
return {
|
|
988
989
|
status: "SUCCESS"
|
|
989
990
|
};
|
|
990
991
|
}
|
|
991
992
|
async function a({ to: s, from: c, hooks: i }) {
|
|
992
|
-
const { global: u, component: f } = i,
|
|
993
|
+
const { global: u, component: f } = i, h = an(s, c), P = [
|
|
993
994
|
...f.onAfterRouteLeave,
|
|
994
|
-
...
|
|
995
|
+
...h.onAfterRouteLeave,
|
|
995
996
|
...u.onAfterRouteLeave,
|
|
996
997
|
...f.onAfterRouteUpdate,
|
|
997
|
-
...
|
|
998
|
+
...h.onAfterRouteUpdate,
|
|
998
999
|
...u.onAfterRouteUpdate,
|
|
999
1000
|
...f.onAfterRouteEnter,
|
|
1000
|
-
...
|
|
1001
|
+
...h.onAfterRouteEnter,
|
|
1001
1002
|
...u.onAfterRouteEnter
|
|
1002
1003
|
];
|
|
1003
1004
|
try {
|
|
1004
|
-
const
|
|
1005
|
+
const d = P.map((p) => p(s, {
|
|
1005
1006
|
from: c,
|
|
1006
1007
|
reject: e,
|
|
1007
1008
|
push: t,
|
|
1008
1009
|
replace: r
|
|
1009
1010
|
}));
|
|
1010
|
-
await Promise.all(
|
|
1011
|
-
} catch (
|
|
1012
|
-
if (
|
|
1013
|
-
return
|
|
1014
|
-
throw
|
|
1011
|
+
await Promise.all(d);
|
|
1012
|
+
} catch (d) {
|
|
1013
|
+
if (d instanceof te || d instanceof be)
|
|
1014
|
+
return d.response;
|
|
1015
|
+
throw d;
|
|
1015
1016
|
}
|
|
1016
1017
|
return {
|
|
1017
1018
|
status: "SUCCESS"
|
|
@@ -1022,7 +1023,7 @@ function rn() {
|
|
|
1022
1023
|
runAfterRouteHooks: a
|
|
1023
1024
|
};
|
|
1024
1025
|
}
|
|
1025
|
-
const
|
|
1026
|
+
const Oe = (e, t, r) => {
|
|
1026
1027
|
var a;
|
|
1027
1028
|
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1028
1029
|
return n.length < r || n[r].id !== ((a = o[r]) == null ? void 0 : a.id);
|
|
@@ -1030,18 +1031,18 @@ const De = (e, t, r) => {
|
|
|
1030
1031
|
var a;
|
|
1031
1032
|
const n = e.matches, o = (t == null ? void 0 : t.matches) ?? [];
|
|
1032
1033
|
return n.length < r || n[r].id !== ((a = o[r]) == null ? void 0 : a.id);
|
|
1033
|
-
},
|
|
1034
|
+
}, Fe = (e, t, r) => {
|
|
1034
1035
|
var n;
|
|
1035
1036
|
return e.matches[r].id === ((n = t == null ? void 0 : t.matches[r]) == null ? void 0 : n.id);
|
|
1036
1037
|
};
|
|
1037
|
-
function
|
|
1038
|
+
function ft(e) {
|
|
1038
1039
|
switch (e) {
|
|
1039
1040
|
case "onBeforeRouteEnter":
|
|
1040
1041
|
case "onAfterRouteEnter":
|
|
1041
|
-
return
|
|
1042
|
+
return Oe;
|
|
1042
1043
|
case "onBeforeRouteUpdate":
|
|
1043
1044
|
case "onAfterRouteUpdate":
|
|
1044
|
-
return
|
|
1045
|
+
return Fe;
|
|
1045
1046
|
case "onBeforeRouteLeave":
|
|
1046
1047
|
case "onAfterRouteLeave":
|
|
1047
1048
|
return Te;
|
|
@@ -1049,30 +1050,30 @@ function ut(e) {
|
|
|
1049
1050
|
throw new Error(`Switch is not exhaustive for lifecycle: ${e}`);
|
|
1050
1051
|
}
|
|
1051
1052
|
}
|
|
1052
|
-
function
|
|
1053
|
+
function cn() {
|
|
1053
1054
|
const e = {
|
|
1054
1055
|
global: new Ee(),
|
|
1055
1056
|
component: new Ee()
|
|
1056
1057
|
};
|
|
1057
1058
|
function t({ lifecycle: n, timing: o, depth: a, hook: s }) {
|
|
1058
|
-
const c =
|
|
1059
|
-
if (c(f,
|
|
1060
|
-
return s(f,
|
|
1059
|
+
const c = ft(n), i = e[o][n], u = (f, h) => {
|
|
1060
|
+
if (c(f, h.from, a))
|
|
1061
|
+
return s(f, h);
|
|
1061
1062
|
};
|
|
1062
1063
|
return i.add(u), () => i.delete(u);
|
|
1063
1064
|
}
|
|
1064
1065
|
function r({ lifecycle: n, timing: o, depth: a, hook: s }) {
|
|
1065
|
-
const c =
|
|
1066
|
-
if (c(f,
|
|
1067
|
-
return s(f,
|
|
1066
|
+
const c = ft(n), i = e[o][n], u = (f, h) => {
|
|
1067
|
+
if (c(f, h.from, a))
|
|
1068
|
+
return s(f, h);
|
|
1068
1069
|
};
|
|
1069
1070
|
return i.add(u), () => i.delete(u);
|
|
1070
1071
|
}
|
|
1071
1072
|
return { ...e, addBeforeRouteHook: t, addAfterRouteHook: r };
|
|
1072
1073
|
}
|
|
1073
|
-
const
|
|
1074
|
-
function
|
|
1075
|
-
const e =
|
|
1074
|
+
const _t = Symbol();
|
|
1075
|
+
function un() {
|
|
1076
|
+
const e = cn();
|
|
1076
1077
|
return {
|
|
1077
1078
|
onBeforeRouteEnter: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: c, timing: "global", depth: 0 }),
|
|
1078
1079
|
onBeforeRouteUpdate: (c) => e.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: c, timing: "global", depth: 0 }),
|
|
@@ -1083,13 +1084,13 @@ function on() {
|
|
|
1083
1084
|
hooks: e
|
|
1084
1085
|
};
|
|
1085
1086
|
}
|
|
1086
|
-
function
|
|
1087
|
+
function fn(e) {
|
|
1087
1088
|
return se(() => () => Z("h1", e), {
|
|
1088
1089
|
name: e,
|
|
1089
1090
|
props: []
|
|
1090
1091
|
});
|
|
1091
1092
|
}
|
|
1092
|
-
function
|
|
1093
|
+
function Je(e) {
|
|
1093
1094
|
const t = new URLSearchParams(e);
|
|
1094
1095
|
return {
|
|
1095
1096
|
get: (...r) => t.get(...r),
|
|
@@ -1118,22 +1119,22 @@ function Oe(e) {
|
|
|
1118
1119
|
[Symbol.iterator]: () => t[Symbol.iterator]()
|
|
1119
1120
|
};
|
|
1120
1121
|
}
|
|
1121
|
-
function
|
|
1122
|
+
function Mt() {
|
|
1122
1123
|
let e = 0;
|
|
1123
1124
|
return () => (++e).toString();
|
|
1124
1125
|
}
|
|
1125
|
-
const
|
|
1126
|
-
function
|
|
1126
|
+
const Qe = Mt();
|
|
1127
|
+
function ln({
|
|
1127
1128
|
rejections: e
|
|
1128
1129
|
}) {
|
|
1129
1130
|
const t = (a) => {
|
|
1130
1131
|
const s = {
|
|
1131
1132
|
...e
|
|
1132
1133
|
};
|
|
1133
|
-
return
|
|
1134
|
+
return ge(s[a] ?? fn(a));
|
|
1134
1135
|
}, r = (a) => {
|
|
1135
|
-
const s =
|
|
1136
|
-
id:
|
|
1136
|
+
const s = ge(t(a)), c = {
|
|
1137
|
+
id: Qe(),
|
|
1137
1138
|
component: s,
|
|
1138
1139
|
meta: {},
|
|
1139
1140
|
state: {}
|
|
@@ -1143,12 +1144,12 @@ function sn({
|
|
|
1143
1144
|
matched: c,
|
|
1144
1145
|
matches: [c],
|
|
1145
1146
|
name: a,
|
|
1146
|
-
query:
|
|
1147
|
+
query: Je(""),
|
|
1147
1148
|
params: {},
|
|
1148
1149
|
state: {},
|
|
1149
1150
|
href: "/",
|
|
1150
1151
|
hash: "",
|
|
1151
|
-
[
|
|
1152
|
+
[jt]: !0
|
|
1152
1153
|
};
|
|
1153
1154
|
}, n = (a) => {
|
|
1154
1155
|
if (!a) {
|
|
@@ -1157,138 +1158,138 @@ function sn({
|
|
|
1157
1158
|
}
|
|
1158
1159
|
const s = t(a);
|
|
1159
1160
|
o.value = { type: a, component: s };
|
|
1160
|
-
}, o =
|
|
1161
|
+
}, o = _e(null);
|
|
1161
1162
|
return {
|
|
1162
1163
|
setRejection: n,
|
|
1163
1164
|
rejection: o,
|
|
1164
1165
|
getRejectionRoute: r
|
|
1165
1166
|
};
|
|
1166
1167
|
}
|
|
1167
|
-
class
|
|
1168
|
+
class hn extends Error {
|
|
1168
1169
|
constructor() {
|
|
1169
1170
|
super("initialUrl must be set if window.location is unavailable");
|
|
1170
1171
|
}
|
|
1171
1172
|
}
|
|
1172
|
-
function
|
|
1173
|
+
function pn(e) {
|
|
1173
1174
|
if (e)
|
|
1174
1175
|
return e;
|
|
1175
|
-
if (
|
|
1176
|
+
if (Ie())
|
|
1176
1177
|
return window.location.toString();
|
|
1177
|
-
throw new
|
|
1178
|
+
throw new hn();
|
|
1178
1179
|
}
|
|
1179
|
-
function
|
|
1180
|
+
function ze(e) {
|
|
1180
1181
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1181
1182
|
}
|
|
1182
|
-
function
|
|
1183
|
+
function dn(e, t) {
|
|
1183
1184
|
const r = Array.from(e.matchAll(t));
|
|
1184
1185
|
if (r.length === 0)
|
|
1185
1186
|
return [e];
|
|
1186
1187
|
let n = 0;
|
|
1187
1188
|
const o = r.reduce((s, c) => {
|
|
1188
|
-
const i =
|
|
1189
|
+
const i = ze(e.slice(n, c.index));
|
|
1189
1190
|
i.length && s.push(i);
|
|
1190
1191
|
const [u] = c;
|
|
1191
1192
|
return s.push(u), n = c.index + u.length, s;
|
|
1192
1193
|
}, []), a = e.slice(n);
|
|
1193
1194
|
return a && o.push(a), o;
|
|
1194
1195
|
}
|
|
1195
|
-
function
|
|
1196
|
-
const t =
|
|
1196
|
+
function mn(e) {
|
|
1197
|
+
const t = Wt(e.path.value);
|
|
1197
1198
|
return new RegExp(`^${t}$`, "i");
|
|
1198
1199
|
}
|
|
1199
|
-
function
|
|
1200
|
+
function yn(e) {
|
|
1200
1201
|
const t = new URLSearchParams(e.query.value);
|
|
1201
|
-
return Array.from(t.entries()).filter(([, r]) => !
|
|
1202
|
-
const o =
|
|
1203
|
-
return new RegExp(`${
|
|
1202
|
+
return Array.from(t.entries()).filter(([, r]) => !je(r)).map(([r, n]) => {
|
|
1203
|
+
const o = Wt(n);
|
|
1204
|
+
return new RegExp(`${ze(r)}=${o}(&|$)`, "i");
|
|
1204
1205
|
});
|
|
1205
1206
|
}
|
|
1206
|
-
function
|
|
1207
|
-
return
|
|
1207
|
+
function Wt(e) {
|
|
1208
|
+
return dn(e, new RegExp(gn, "g")).map((t) => t.startsWith(J) ? Dt(t) : ze(t)).join("");
|
|
1208
1209
|
}
|
|
1209
|
-
function
|
|
1210
|
+
function Dt(e) {
|
|
1210
1211
|
return [
|
|
1211
|
-
|
|
1212
|
-
|
|
1212
|
+
vn,
|
|
1213
|
+
Rn
|
|
1213
1214
|
].reduce((t, r) => r(t), e);
|
|
1214
1215
|
}
|
|
1215
|
-
const
|
|
1216
|
-
function
|
|
1217
|
-
return e.replace(new RegExp(
|
|
1216
|
+
const gn = `\\${J}\\??([\\w-_]+)\\${K}`, Ge = `\\${J}\\?([\\w-_]+)\\${K}`, It = `\\${J}([\\w-_]+)\\${K}`;
|
|
1217
|
+
function vn(e) {
|
|
1218
|
+
return e.replace(new RegExp(Ge, "g"), ".*");
|
|
1218
1219
|
}
|
|
1219
|
-
function
|
|
1220
|
-
return new RegExp(
|
|
1220
|
+
function je(e) {
|
|
1221
|
+
return new RegExp(Ge, "g").test(e);
|
|
1221
1222
|
}
|
|
1222
|
-
function
|
|
1223
|
-
return e.replace(new RegExp(
|
|
1223
|
+
function Rn(e) {
|
|
1224
|
+
return e.replace(new RegExp(It, "g"), ".+");
|
|
1224
1225
|
}
|
|
1225
|
-
function
|
|
1226
|
-
const [t] = Se(e, new RegExp(
|
|
1226
|
+
function Ce(e) {
|
|
1227
|
+
const [t] = Se(e, new RegExp(Ge, "g")), [r] = Se(e, new RegExp(It, "g"));
|
|
1227
1228
|
return t ?? r;
|
|
1228
1229
|
}
|
|
1229
1230
|
function Se(e, t) {
|
|
1230
1231
|
return Array.from(e.matchAll(t)).flatMap(([, ...n]) => n.map((o) => F(o) ? o : ""));
|
|
1231
1232
|
}
|
|
1232
|
-
function
|
|
1233
|
+
function Ke(e, t) {
|
|
1233
1234
|
const r = new RegExp(`\\${J}(\\??[\\w-_]+)\\${K}`, "g");
|
|
1234
1235
|
return Array.from(e.matchAll(r)).reduce((o, [a, s]) => {
|
|
1235
|
-
const c =
|
|
1236
|
+
const c = Ce(a);
|
|
1236
1237
|
if (!c)
|
|
1237
1238
|
return o;
|
|
1238
|
-
const i =
|
|
1239
|
+
const i = Tr(t, c);
|
|
1239
1240
|
return ce([c], o), o[s] = i, o;
|
|
1240
1241
|
}, {});
|
|
1241
1242
|
}
|
|
1242
|
-
function
|
|
1243
|
+
function $e(e, t) {
|
|
1243
1244
|
return {
|
|
1244
1245
|
value: e,
|
|
1245
|
-
params:
|
|
1246
|
+
params: Ke(e, t)
|
|
1246
1247
|
};
|
|
1247
1248
|
}
|
|
1248
|
-
function
|
|
1249
|
+
function wn(e, t) {
|
|
1249
1250
|
return F(t) ? e.map((r) => {
|
|
1250
1251
|
const n = `${t}${r.path.value}`;
|
|
1251
1252
|
return {
|
|
1252
1253
|
...r,
|
|
1253
|
-
path:
|
|
1254
|
+
path: $e(n, r.path.params)
|
|
1254
1255
|
};
|
|
1255
1256
|
}) : e;
|
|
1256
1257
|
}
|
|
1257
|
-
function
|
|
1258
|
+
function Ot(e) {
|
|
1258
1259
|
return !!e && typeof e == "object";
|
|
1259
1260
|
}
|
|
1260
1261
|
const ke = !0;
|
|
1261
|
-
function
|
|
1262
|
-
if (
|
|
1262
|
+
function Pn(e, t, r) {
|
|
1263
|
+
if (Ot(e) && t in e) {
|
|
1263
1264
|
const n = e[t];
|
|
1264
|
-
return typeof n == "string" ?
|
|
1265
|
+
return typeof n == "string" ? le(n, r, ke) : n;
|
|
1265
1266
|
}
|
|
1266
|
-
return
|
|
1267
|
+
return le(void 0, r, ke);
|
|
1267
1268
|
}
|
|
1268
|
-
function
|
|
1269
|
+
function Tt(e, t) {
|
|
1269
1270
|
const r = {};
|
|
1270
1271
|
for (const [n, o] of Object.entries(e)) {
|
|
1271
|
-
const a =
|
|
1272
|
+
const a = Pn(t, n, o);
|
|
1272
1273
|
r[n] = a;
|
|
1273
1274
|
}
|
|
1274
1275
|
return r;
|
|
1275
1276
|
}
|
|
1276
|
-
function
|
|
1277
|
-
if (
|
|
1277
|
+
function En(e, t, r) {
|
|
1278
|
+
if (Ot(e) && t in e) {
|
|
1278
1279
|
const n = e[t];
|
|
1279
|
-
return
|
|
1280
|
+
return he(n, r, ke);
|
|
1280
1281
|
}
|
|
1281
|
-
return
|
|
1282
|
+
return he(void 0, r, ke);
|
|
1282
1283
|
}
|
|
1283
|
-
const
|
|
1284
|
+
const lt = (e, t) => {
|
|
1284
1285
|
const r = {};
|
|
1285
1286
|
for (const [n, o] of Object.entries(e)) {
|
|
1286
|
-
const a =
|
|
1287
|
+
const a = En(t, n, o);
|
|
1287
1288
|
r[n] = a;
|
|
1288
1289
|
}
|
|
1289
1290
|
return r;
|
|
1290
1291
|
};
|
|
1291
|
-
class
|
|
1292
|
+
class bn extends Error {
|
|
1292
1293
|
/**
|
|
1293
1294
|
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
1294
1295
|
* @param name - The name of the name that was duplicated.
|
|
@@ -1297,14 +1298,14 @@ class wn extends Error {
|
|
|
1297
1298
|
super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
1298
1299
|
}
|
|
1299
1300
|
}
|
|
1300
|
-
function
|
|
1301
|
+
function Sn(e) {
|
|
1301
1302
|
const t = e.map(({ name: r }) => r);
|
|
1302
1303
|
for (const r of t)
|
|
1303
|
-
if (
|
|
1304
|
-
throw new
|
|
1304
|
+
if (kt(t, r) > 1)
|
|
1305
|
+
throw new bn(r);
|
|
1305
1306
|
}
|
|
1306
|
-
function
|
|
1307
|
-
const e = xe(/* @__PURE__ */ new Map()), t =
|
|
1307
|
+
function kn() {
|
|
1308
|
+
const e = xe(/* @__PURE__ */ new Map()), t = Ie() ? s() : null, r = (c) => {
|
|
1308
1309
|
e.set(c, !1), t == null || t.observe(c);
|
|
1309
1310
|
}, n = (c) => {
|
|
1310
1311
|
e.delete(c), t == null || t.unobserve(c);
|
|
@@ -1325,59 +1326,61 @@ function En() {
|
|
|
1325
1326
|
isElementVisible: a
|
|
1326
1327
|
};
|
|
1327
1328
|
}
|
|
1328
|
-
const
|
|
1329
|
-
function
|
|
1330
|
-
const t = ae(
|
|
1329
|
+
const Ft = Symbol("visibilityObserver");
|
|
1330
|
+
function An(e) {
|
|
1331
|
+
const t = ae(Ft);
|
|
1331
1332
|
if (!t)
|
|
1332
|
-
throw new
|
|
1333
|
-
return
|
|
1333
|
+
throw new de();
|
|
1334
|
+
return ie(e, (n, o) => {
|
|
1334
1335
|
n && t.observe(n), o && t.unobserve(o);
|
|
1335
|
-
}, { immediate: !0 }), {
|
|
1336
|
+
}, { immediate: !0 }), Le(() => {
|
|
1337
|
+
e.value && t.unobserve(e.value);
|
|
1338
|
+
}), {
|
|
1336
1339
|
isElementVisible: N(() => e.value ? t.isElementVisible(e.value) : !1)
|
|
1337
1340
|
};
|
|
1338
1341
|
}
|
|
1339
|
-
class
|
|
1342
|
+
class xn extends Error {
|
|
1340
1343
|
constructor(t) {
|
|
1341
1344
|
super(`Route not found: "${t}"`);
|
|
1342
1345
|
}
|
|
1343
1346
|
}
|
|
1344
|
-
function
|
|
1345
|
-
const n =
|
|
1347
|
+
function Jt(e, t, r) {
|
|
1348
|
+
const n = zt(t, r), [o] = Se(e, n);
|
|
1346
1349
|
return o;
|
|
1347
1350
|
}
|
|
1348
|
-
function
|
|
1351
|
+
function Qt(e, t) {
|
|
1349
1352
|
if (!t)
|
|
1350
1353
|
return e;
|
|
1351
|
-
const { name: r, param: n, value: o } = t, a =
|
|
1352
|
-
return Se(e, a).reduce((c, i) => i === void 0 ? c : c.replace(i, () =>
|
|
1354
|
+
const { name: r, param: n, value: o } = t, a = zt(e, r);
|
|
1355
|
+
return Se(e, a).reduce((c, i) => i === void 0 ? c : c.replace(i, () => he(o, n, r.startsWith("?"))), e);
|
|
1353
1356
|
}
|
|
1354
|
-
function
|
|
1357
|
+
function zt(e, t) {
|
|
1355
1358
|
const r = [
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
+
Ln,
|
|
1360
|
+
Un,
|
|
1361
|
+
Dt
|
|
1359
1362
|
].reduce((n, o) => o(n, t), e);
|
|
1360
1363
|
return new RegExp(r, "g");
|
|
1361
1364
|
}
|
|
1362
|
-
function
|
|
1365
|
+
function Ln(e, t) {
|
|
1363
1366
|
if (!t.startsWith("?"))
|
|
1364
1367
|
return e;
|
|
1365
1368
|
const r = new RegExp(`\\${J}\\${t}\\${K}`, "g");
|
|
1366
1369
|
return e.replace(r, "(.*)");
|
|
1367
1370
|
}
|
|
1368
|
-
function
|
|
1371
|
+
function Un(e, t) {
|
|
1369
1372
|
if (t.startsWith("?"))
|
|
1370
1373
|
return e;
|
|
1371
1374
|
const r = new RegExp(`\\${J}${t}\\${K}`, "g");
|
|
1372
1375
|
return e.replace(r, "(.+)");
|
|
1373
1376
|
}
|
|
1374
|
-
function
|
|
1377
|
+
function Gt({ protocol: e, host: t, pathname: r, search: n, searchParams: o, hash: a }) {
|
|
1375
1378
|
const s = new URL("https://localhost");
|
|
1376
1379
|
e && (s.protocol = e), t && (s.host = t), r && (s.pathname = r), o ? s.search = new URLSearchParams(o).toString() : n && (s.search = n), a && (s.hash = a);
|
|
1377
1380
|
const c = s.toString().replace(/^https:\/\/localhost\/*/, "/");
|
|
1378
|
-
return
|
|
1381
|
+
return bt(c);
|
|
1379
1382
|
}
|
|
1380
|
-
function
|
|
1383
|
+
function Ye(...e) {
|
|
1381
1384
|
const t = new URLSearchParams();
|
|
1382
1385
|
for (const r of e) {
|
|
1383
1386
|
const n = new URLSearchParams(r);
|
|
@@ -1386,68 +1389,68 @@ function Ge(...e) {
|
|
|
1386
1389
|
}
|
|
1387
1390
|
return t;
|
|
1388
1391
|
}
|
|
1389
|
-
function
|
|
1390
|
-
const { params: r = {}, query: n } = t, o =
|
|
1391
|
-
return
|
|
1392
|
+
function Cn(e, t = {}) {
|
|
1393
|
+
const { params: r = {}, query: n } = t, o = Vn(e.query, r), a = Ye(o, n), s = Nn(e.path, r), c = ve(e.hash.value ?? t.hash).value, i = Bn(e.host, r), { protocol: u, host: f } = _(i);
|
|
1394
|
+
return Gt({ protocol: u, host: f, pathname: s, searchParams: a, hash: c });
|
|
1392
1395
|
}
|
|
1393
|
-
function
|
|
1396
|
+
function Bn(e, t) {
|
|
1394
1397
|
const r = e.value && !e.value.startsWith("http") ? `https://${e.value}` : e.value;
|
|
1395
1398
|
return Object.entries(e.params).reduce((n, [o, a]) => {
|
|
1396
|
-
const s =
|
|
1397
|
-
return s ?
|
|
1399
|
+
const s = Ce(`${J}${o}${K}`);
|
|
1400
|
+
return s ? Qt(n, { name: o, param: a, value: t[s] }) : n;
|
|
1398
1401
|
}, r);
|
|
1399
1402
|
}
|
|
1400
|
-
function
|
|
1403
|
+
function Nn(e, t) {
|
|
1401
1404
|
return Object.entries(e.params).reduce((r, [n, o]) => {
|
|
1402
|
-
const a =
|
|
1403
|
-
return a ?
|
|
1405
|
+
const a = Ce(`${J}${n}${K}`);
|
|
1406
|
+
return a ? Qt(r, { name: n, param: o, value: t[a] }) : r;
|
|
1404
1407
|
}, e.value);
|
|
1405
1408
|
}
|
|
1406
|
-
function
|
|
1409
|
+
function Vn(e, t) {
|
|
1407
1410
|
const r = new URLSearchParams(e.value);
|
|
1408
1411
|
if (!e.value)
|
|
1409
1412
|
return r;
|
|
1410
1413
|
for (const [n, o] of Array.from(r.entries())) {
|
|
1411
|
-
const a =
|
|
1414
|
+
const a = Ce(o);
|
|
1412
1415
|
if (!a)
|
|
1413
1416
|
continue;
|
|
1414
|
-
const c =
|
|
1415
|
-
|
|
1417
|
+
const c = he(t[a], e.params[a], je(o)), i = t[a] === void 0 && c === "";
|
|
1418
|
+
je(o) && i ? r.delete(n, o) : r.set(n, c);
|
|
1416
1419
|
}
|
|
1417
1420
|
return r;
|
|
1418
1421
|
}
|
|
1419
|
-
const
|
|
1422
|
+
const Hn = (e, t) => {
|
|
1420
1423
|
try {
|
|
1421
|
-
|
|
1424
|
+
Xe(e, t);
|
|
1422
1425
|
} catch {
|
|
1423
1426
|
return !1;
|
|
1424
1427
|
}
|
|
1425
1428
|
return !0;
|
|
1426
|
-
},
|
|
1429
|
+
}, Xe = (e, t) => {
|
|
1427
1430
|
const { pathname: r, search: n } = _(t);
|
|
1428
1431
|
return {
|
|
1429
|
-
...
|
|
1430
|
-
|
|
1432
|
+
...jn(e.path, r),
|
|
1433
|
+
...$n(e.query, n)
|
|
1431
1434
|
};
|
|
1432
1435
|
};
|
|
1433
|
-
function
|
|
1436
|
+
function jn(e, t) {
|
|
1434
1437
|
const r = {}, n = decodeURIComponent(t);
|
|
1435
1438
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1436
|
-
const s = o.startsWith("?"), c = s ? o.slice(1) : o, i =
|
|
1439
|
+
const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = Jt(n, e.value, o), u = le(i, a, s);
|
|
1437
1440
|
r[c] = u;
|
|
1438
1441
|
}
|
|
1439
1442
|
return r;
|
|
1440
1443
|
}
|
|
1441
|
-
function
|
|
1444
|
+
function $n(e, t) {
|
|
1442
1445
|
const r = {}, n = new URLSearchParams(t);
|
|
1443
1446
|
for (const [o, a] of Object.entries(e.params)) {
|
|
1444
|
-
const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = n.get(c) ?? void 0, u =
|
|
1447
|
+
const s = o.startsWith("?"), c = s ? o.slice(1) : o, i = n.get(c) ?? void 0, u = le(i, a, s);
|
|
1445
1448
|
r[c] = u;
|
|
1446
1449
|
}
|
|
1447
1450
|
return r;
|
|
1448
1451
|
}
|
|
1449
|
-
function
|
|
1450
|
-
const n =
|
|
1452
|
+
function qn(e, t = {}, r = {}) {
|
|
1453
|
+
const n = Cn(e, {
|
|
1451
1454
|
params: t,
|
|
1452
1455
|
query: r.query,
|
|
1453
1456
|
hash: r.hash
|
|
@@ -1457,51 +1460,51 @@ function Hn(e, t = {}, r = {}) {
|
|
|
1457
1460
|
matched: e.matched,
|
|
1458
1461
|
matches: e.matches,
|
|
1459
1462
|
name: e.name,
|
|
1460
|
-
query:
|
|
1461
|
-
params:
|
|
1462
|
-
state:
|
|
1463
|
+
query: Je(o),
|
|
1464
|
+
params: Xe(e, n),
|
|
1465
|
+
state: Tt(e.state, r.state),
|
|
1463
1466
|
hash: a,
|
|
1464
1467
|
href: n
|
|
1465
1468
|
};
|
|
1466
1469
|
}
|
|
1467
|
-
const
|
|
1470
|
+
const _n = (e) => "name" in e.matched && !!e.matched.name, Mn = (e, t) => {
|
|
1468
1471
|
const { pathname: r } = _(t);
|
|
1469
|
-
return
|
|
1470
|
-
},
|
|
1472
|
+
return mn(e).test(r);
|
|
1473
|
+
}, Wn = (e, t) => {
|
|
1471
1474
|
const { search: r } = _(t);
|
|
1472
|
-
return
|
|
1473
|
-
},
|
|
1475
|
+
return yn(e).every((o) => o.test(r));
|
|
1476
|
+
}, qe = (e, t) => {
|
|
1474
1477
|
const { hash: r } = _(t), { value: n } = e.hash;
|
|
1475
1478
|
return n === void 0 || `#${n.toLowerCase()}` === r.toLowerCase();
|
|
1476
1479
|
};
|
|
1477
|
-
function
|
|
1480
|
+
function Dn(e) {
|
|
1478
1481
|
const { searchParams: t, pathname: r } = _(e), n = -1, o = 1;
|
|
1479
1482
|
return (a, s) => {
|
|
1480
|
-
const c =
|
|
1481
|
-
return a.depth > s.depth ? n : a.depth < s.depth ? o : c + i > u + f ? n : c + i < u + f ? o :
|
|
1483
|
+
const c = pt(a, t), i = ht(a, r), u = pt(s, t), f = ht(s, r);
|
|
1484
|
+
return a.depth > s.depth ? n : a.depth < s.depth ? o : c + i > u + f ? n : c + i < u + f ? o : qe(a, e) ? n : qe(s, e) ? o : 0;
|
|
1482
1485
|
};
|
|
1483
1486
|
}
|
|
1484
|
-
function
|
|
1485
|
-
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) =>
|
|
1487
|
+
function ht(e, t) {
|
|
1488
|
+
const r = Object.keys(e.path.params).filter((o) => o.startsWith("?")).map((o) => o), n = r.filter((o) => Jt(t, e.path.value, o) === void 0);
|
|
1486
1489
|
return r.length - n.length;
|
|
1487
1490
|
}
|
|
1488
|
-
function
|
|
1491
|
+
function pt(e, t) {
|
|
1489
1492
|
const r = new URLSearchParams(t), n = new URLSearchParams(e.query.value), o = Array.from(n.keys()), a = o.filter((s) => !r.has(s));
|
|
1490
1493
|
return o.length - a.length;
|
|
1491
1494
|
}
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1495
|
+
const In = [
|
|
1496
|
+
_n,
|
|
1497
|
+
Mn,
|
|
1498
|
+
Wn,
|
|
1499
|
+
qe,
|
|
1500
|
+
Hn
|
|
1498
1501
|
];
|
|
1499
|
-
function
|
|
1500
|
-
const r =
|
|
1501
|
-
return e.filter((n) =>
|
|
1502
|
+
function On(e, t) {
|
|
1503
|
+
const r = Dn(t);
|
|
1504
|
+
return e.filter((n) => In.every((o) => o(n, t))).sort(r);
|
|
1502
1505
|
}
|
|
1503
|
-
function
|
|
1504
|
-
const n =
|
|
1506
|
+
function Tn(e, t, r) {
|
|
1507
|
+
const n = On(e, t);
|
|
1505
1508
|
if (!n.length)
|
|
1506
1509
|
return;
|
|
1507
1510
|
const [o] = n, { searchParams: a, hash: s } = _(t);
|
|
@@ -1510,207 +1513,210 @@ function Dn(e, t, r) {
|
|
|
1510
1513
|
matched: o.matched,
|
|
1511
1514
|
matches: o.matches,
|
|
1512
1515
|
name: o.name,
|
|
1513
|
-
query:
|
|
1514
|
-
params:
|
|
1515
|
-
state:
|
|
1516
|
+
query: Je(a),
|
|
1517
|
+
params: Xe(o, t),
|
|
1518
|
+
state: Tt(o.state, r),
|
|
1516
1519
|
hash: s,
|
|
1517
|
-
href:
|
|
1520
|
+
href: bt(t)
|
|
1518
1521
|
};
|
|
1519
1522
|
}
|
|
1520
|
-
function
|
|
1523
|
+
function dt(e, t) {
|
|
1521
1524
|
const r = typeof e == "string" ? _(e) : e, n = typeof t == "string" ? _(t) : t, o = r.searchParams ?? new URLSearchParams(r.search), a = n.searchParams ?? new URLSearchParams(n.search);
|
|
1522
|
-
return
|
|
1525
|
+
return Gt({
|
|
1523
1526
|
protocol: F(n.protocol) ? n.protocol : r.protocol,
|
|
1524
1527
|
host: F(n.host) ? n.host : r.host,
|
|
1525
1528
|
pathname: F(n.pathname) ? n.pathname : r.pathname,
|
|
1526
|
-
searchParams:
|
|
1529
|
+
searchParams: Ye(a, o),
|
|
1527
1530
|
hash: F(n.hash) ? n.hash : r.hash
|
|
1528
1531
|
});
|
|
1529
1532
|
}
|
|
1530
|
-
function
|
|
1531
|
-
const r =
|
|
1532
|
-
|
|
1533
|
-
const o =
|
|
1533
|
+
function mo(e, t) {
|
|
1534
|
+
const r = Br(e) ? e.flat() : e, n = wn(r, t == null ? void 0 : t.base);
|
|
1535
|
+
Sn(n);
|
|
1536
|
+
const o = Mt(), a = Xn(), s = kn(), c = rn({
|
|
1534
1537
|
mode: t == null ? void 0 : t.historyMode,
|
|
1535
1538
|
listener: ({ location: b }) => {
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1539
|
+
const U = X(b);
|
|
1540
|
+
k(U, { state: b.state, replace: !0 });
|
|
1538
1541
|
}
|
|
1539
|
-
}), { runBeforeRouteHooks: i, runAfterRouteHooks: u } =
|
|
1542
|
+
}), { runBeforeRouteHooks: i, runAfterRouteHooks: u } = sn(), {
|
|
1540
1543
|
hooks: f,
|
|
1541
|
-
onBeforeRouteEnter:
|
|
1544
|
+
onBeforeRouteEnter: h,
|
|
1542
1545
|
onAfterRouteUpdate: P,
|
|
1543
|
-
onBeforeRouteLeave:
|
|
1544
|
-
onAfterRouteEnter:
|
|
1546
|
+
onBeforeRouteLeave: d,
|
|
1547
|
+
onAfterRouteEnter: p,
|
|
1545
1548
|
onBeforeRouteUpdate: v,
|
|
1546
1549
|
onAfterRouteLeave: R
|
|
1547
|
-
} =
|
|
1548
|
-
function E(b,
|
|
1549
|
-
return
|
|
1550
|
+
} = un();
|
|
1551
|
+
function E(b, U = {}) {
|
|
1552
|
+
return Tn(n, b, U.state);
|
|
1550
1553
|
}
|
|
1551
|
-
async function
|
|
1554
|
+
async function k(b, U = {}) {
|
|
1552
1555
|
const Q = o();
|
|
1553
|
-
if (c.stopListening(),
|
|
1554
|
-
c.update(b,
|
|
1556
|
+
if (c.stopListening(), nt(b)) {
|
|
1557
|
+
c.update(b, U);
|
|
1555
1558
|
return;
|
|
1556
1559
|
}
|
|
1557
|
-
const W = E(b,
|
|
1560
|
+
const W = E(b, U) ?? y("NotFound"), $ = { ...A }, z = await i({ to: W, from: $, hooks: f });
|
|
1558
1561
|
switch (z.status) {
|
|
1559
1562
|
// On abort do nothing
|
|
1560
1563
|
case "ABORT":
|
|
1561
1564
|
return;
|
|
1562
1565
|
// On push update the history, and push new route, and return
|
|
1563
1566
|
case "PUSH":
|
|
1564
|
-
c.update(b,
|
|
1567
|
+
c.update(b, U), await w(...z.to);
|
|
1565
1568
|
return;
|
|
1566
1569
|
// On reject update the history, the route, and set the rejection type
|
|
1567
1570
|
case "REJECT":
|
|
1568
|
-
c.update(b,
|
|
1571
|
+
c.update(b, U), g(z.type);
|
|
1569
1572
|
break;
|
|
1570
1573
|
// On success update history, set the route, and clear the rejection
|
|
1571
1574
|
case "SUCCESS":
|
|
1572
|
-
c.update(b,
|
|
1575
|
+
c.update(b, U), g(null);
|
|
1573
1576
|
break;
|
|
1574
1577
|
default:
|
|
1575
1578
|
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(z)}`);
|
|
1576
1579
|
}
|
|
1577
|
-
const
|
|
1578
|
-
a.setProps(W).then((
|
|
1579
|
-
if (
|
|
1580
|
-
switch (
|
|
1580
|
+
const Be = Q;
|
|
1581
|
+
a.setProps(W).then((D) => {
|
|
1582
|
+
if (Be === Q)
|
|
1583
|
+
switch (D.status) {
|
|
1581
1584
|
case "SUCCESS":
|
|
1582
1585
|
break;
|
|
1583
1586
|
case "PUSH":
|
|
1584
|
-
w(...
|
|
1587
|
+
w(...D.to);
|
|
1585
1588
|
break;
|
|
1586
1589
|
case "REJECT":
|
|
1587
|
-
g(
|
|
1590
|
+
g(D.type);
|
|
1588
1591
|
break;
|
|
1589
1592
|
default:
|
|
1590
|
-
const
|
|
1591
|
-
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(
|
|
1593
|
+
const Ne = D;
|
|
1594
|
+
throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(Ne)}`);
|
|
1592
1595
|
}
|
|
1593
1596
|
}), B(W);
|
|
1594
|
-
const
|
|
1595
|
-
switch (
|
|
1597
|
+
const I = await u({ to: W, from: $, hooks: f });
|
|
1598
|
+
switch (I.status) {
|
|
1596
1599
|
case "PUSH":
|
|
1597
|
-
await w(...
|
|
1600
|
+
await w(...I.to);
|
|
1598
1601
|
break;
|
|
1599
1602
|
case "REJECT":
|
|
1600
|
-
g(
|
|
1603
|
+
g(I.type);
|
|
1601
1604
|
break;
|
|
1602
1605
|
case "SUCCESS":
|
|
1603
1606
|
break;
|
|
1604
1607
|
default:
|
|
1605
|
-
const
|
|
1606
|
-
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(
|
|
1608
|
+
const D = I;
|
|
1609
|
+
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(D)}`);
|
|
1607
1610
|
}
|
|
1608
1611
|
c.startListening();
|
|
1609
1612
|
}
|
|
1610
|
-
const m = (b,
|
|
1611
|
-
const W = n.find((
|
|
1613
|
+
const m = (b, U = {}, Q = {}) => {
|
|
1614
|
+
const W = n.find(($) => $.name === b);
|
|
1612
1615
|
if (!W)
|
|
1613
|
-
throw new
|
|
1614
|
-
return
|
|
1615
|
-
}, w = (b,
|
|
1616
|
-
if (
|
|
1617
|
-
const
|
|
1618
|
-
searchParams:
|
|
1619
|
-
hash:
|
|
1616
|
+
throw new xn(String(b));
|
|
1617
|
+
return qn(W, U, Q);
|
|
1618
|
+
}, w = (b, U, Q) => {
|
|
1619
|
+
if (T(b)) {
|
|
1620
|
+
const I = { ...U }, D = dt(b, {
|
|
1621
|
+
searchParams: I.query,
|
|
1622
|
+
hash: I.hash
|
|
1620
1623
|
});
|
|
1621
|
-
return
|
|
1624
|
+
return k(D, I);
|
|
1622
1625
|
}
|
|
1623
1626
|
if (typeof b == "string") {
|
|
1624
|
-
const D = { ...Q },
|
|
1625
|
-
return
|
|
1627
|
+
const { replace: I, ...D } = { ...Q }, Ne = { ...U }, Ve = m(b, Ne, D), pr = lt({ ...Ve.matched.state }, { ...Ve.state, ...D.state });
|
|
1628
|
+
return k(Ve.href, { replace: I, state: pr });
|
|
1626
1629
|
}
|
|
1627
|
-
const { replace: W,
|
|
1628
|
-
searchParams:
|
|
1629
|
-
hash:
|
|
1630
|
+
const { replace: W, ...$ } = { ...U }, z = lt({ ...b.matched.state }, { ...b.state, ...$.state }), Be = dt(b.href, {
|
|
1631
|
+
searchParams: $.query,
|
|
1632
|
+
hash: $.hash
|
|
1630
1633
|
});
|
|
1631
|
-
return
|
|
1632
|
-
}, x = (b,
|
|
1633
|
-
if (
|
|
1634
|
-
const
|
|
1635
|
-
return w(b,
|
|
1634
|
+
return k(Be, { replace: W, state: z });
|
|
1635
|
+
}, x = (b, U, Q) => {
|
|
1636
|
+
if (T(b)) {
|
|
1637
|
+
const $ = { ...U, replace: !0 };
|
|
1638
|
+
return w(b, $);
|
|
1636
1639
|
}
|
|
1637
1640
|
if (typeof b == "string") {
|
|
1638
|
-
const
|
|
1639
|
-
return w(b, z,
|
|
1641
|
+
const $ = { ...Q, replace: !0 }, z = { ...U };
|
|
1642
|
+
return w(b, z, $);
|
|
1640
1643
|
}
|
|
1641
|
-
const W = { ...
|
|
1644
|
+
const W = { ...U, replace: !0 };
|
|
1642
1645
|
return w(b, W);
|
|
1643
|
-
},
|
|
1646
|
+
}, L = (b) => {
|
|
1644
1647
|
g(b);
|
|
1645
|
-
}, { setRejection: g, rejection: l, getRejectionRoute: y } =
|
|
1648
|
+
}, { setRejection: g, rejection: l, getRejectionRoute: y } = ln(t ?? {}), S = y("NotFound"), { currentRoute: A, routerRoute: C, updateRoute: B } = Xr(S, w);
|
|
1646
1649
|
c.startListening();
|
|
1647
|
-
const H =
|
|
1648
|
-
let
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1650
|
+
const H = pn(t == null ? void 0 : t.initialUrl), M = c.location.state, { host: rt } = _(H), nt = tn(rt);
|
|
1651
|
+
let ot = !1;
|
|
1652
|
+
const { promise: fr, resolve: lr } = Promise.withResolvers();
|
|
1653
|
+
async function at() {
|
|
1654
|
+
if (ot)
|
|
1655
|
+
return fr;
|
|
1656
|
+
ot = !0, await k(H, { replace: !0, state: M }), lr();
|
|
1657
|
+
}
|
|
1658
|
+
function hr(b) {
|
|
1659
|
+
b.component("RouterView", io), b.component("RouterLink", oo), b.provide(Vt, l), b.provide(_t, f), b.provide(or, a), b.provide(Ft, s), b.provide(St, st), at();
|
|
1660
|
+
}
|
|
1661
|
+
const st = {
|
|
1656
1662
|
route: C,
|
|
1657
1663
|
resolve: m,
|
|
1658
1664
|
find: E,
|
|
1659
1665
|
push: w,
|
|
1660
1666
|
replace: x,
|
|
1661
|
-
reject:
|
|
1667
|
+
reject: L,
|
|
1662
1668
|
refresh: c.refresh,
|
|
1663
1669
|
forward: c.forward,
|
|
1664
1670
|
back: c.back,
|
|
1665
1671
|
go: c.go,
|
|
1666
|
-
install:
|
|
1667
|
-
isExternal:
|
|
1668
|
-
onBeforeRouteEnter:
|
|
1672
|
+
install: hr,
|
|
1673
|
+
isExternal: nt,
|
|
1674
|
+
onBeforeRouteEnter: h,
|
|
1669
1675
|
onAfterRouteUpdate: P,
|
|
1670
|
-
onBeforeRouteLeave:
|
|
1671
|
-
onAfterRouteEnter:
|
|
1676
|
+
onBeforeRouteLeave: d,
|
|
1677
|
+
onAfterRouteEnter: p,
|
|
1672
1678
|
onBeforeRouteUpdate: v,
|
|
1673
1679
|
onAfterRouteLeave: R,
|
|
1674
1680
|
prefetch: t == null ? void 0 : t.prefetch,
|
|
1675
|
-
start:
|
|
1681
|
+
start: at
|
|
1676
1682
|
};
|
|
1677
|
-
return
|
|
1683
|
+
return st;
|
|
1678
1684
|
}
|
|
1679
|
-
function
|
|
1685
|
+
function mt(e, t) {
|
|
1680
1686
|
return {
|
|
1681
1687
|
value: e,
|
|
1682
|
-
params:
|
|
1688
|
+
params: Ke(e, t)
|
|
1683
1689
|
};
|
|
1684
1690
|
}
|
|
1685
|
-
function
|
|
1691
|
+
function Kt(e, t) {
|
|
1686
1692
|
return {
|
|
1687
1693
|
value: e,
|
|
1688
|
-
params:
|
|
1694
|
+
params: Ke(e, t)
|
|
1689
1695
|
};
|
|
1690
1696
|
}
|
|
1691
|
-
function
|
|
1692
|
-
return
|
|
1697
|
+
function Fn(e) {
|
|
1698
|
+
return me(e) && typeof e.hash == "string";
|
|
1693
1699
|
}
|
|
1694
|
-
function
|
|
1695
|
-
return e === void 0 ? ve() :
|
|
1700
|
+
function Yt(e) {
|
|
1701
|
+
return e === void 0 ? ve() : Fn(e) ? e : ve(e);
|
|
1696
1702
|
}
|
|
1697
|
-
function
|
|
1703
|
+
function Xt(e) {
|
|
1698
1704
|
return e === void 0 ? "" : e;
|
|
1699
1705
|
}
|
|
1700
|
-
function
|
|
1701
|
-
return
|
|
1706
|
+
function Jn(e) {
|
|
1707
|
+
return me(e) && typeof e.value == "string";
|
|
1702
1708
|
}
|
|
1703
|
-
function
|
|
1704
|
-
return e === void 0 ?
|
|
1709
|
+
function Zt(e) {
|
|
1710
|
+
return e === void 0 ? $e("", {}) : Jn(e) ? e : $e(e, {});
|
|
1705
1711
|
}
|
|
1706
|
-
function
|
|
1707
|
-
return
|
|
1712
|
+
function Qn(e) {
|
|
1713
|
+
return me(e) && typeof e.value == "string";
|
|
1708
1714
|
}
|
|
1709
|
-
function
|
|
1710
|
-
return e === void 0 ?
|
|
1715
|
+
function er(e) {
|
|
1716
|
+
return e === void 0 ? mt("", {}) : Qn(e) ? e : mt(e, {});
|
|
1711
1717
|
}
|
|
1712
1718
|
function oe(e) {
|
|
1713
|
-
const t =
|
|
1719
|
+
const t = Qe(), r = Xt(e.name), n = Zt(e.path), o = er(e.query), a = Yt(e.hash), s = e.meta ?? {}, c = Wr(e) ? e.state : {}, i = ge({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
1714
1720
|
id: t,
|
|
1715
1721
|
matched: i,
|
|
1716
1722
|
matches: [i],
|
|
@@ -1721,25 +1727,25 @@ function oe(e) {
|
|
|
1721
1727
|
meta: s,
|
|
1722
1728
|
state: c,
|
|
1723
1729
|
depth: 1,
|
|
1724
|
-
host:
|
|
1730
|
+
host: Kt("", {}),
|
|
1725
1731
|
prefetch: e.prefetch
|
|
1726
|
-
}, f =
|
|
1732
|
+
}, f = At(e) ? xt(e.parent, u) : u;
|
|
1727
1733
|
return ce(f.path.params, f.query.params), f;
|
|
1728
1734
|
}
|
|
1729
|
-
const Ae = { template: "<div>This is component</div>" },
|
|
1735
|
+
const Ae = { template: "<div>This is component</div>" }, Ze = oe({
|
|
1730
1736
|
name: "parentA",
|
|
1731
1737
|
path: "/parentA/[paramA]"
|
|
1732
|
-
}),
|
|
1733
|
-
parent:
|
|
1738
|
+
}), tr = oe({
|
|
1739
|
+
parent: Ze,
|
|
1734
1740
|
name: "parentA.childA",
|
|
1735
1741
|
path: "/[?paramB]"
|
|
1736
|
-
}),
|
|
1737
|
-
parent:
|
|
1742
|
+
}), zn = oe({
|
|
1743
|
+
parent: Ze,
|
|
1738
1744
|
name: "parentA.childB",
|
|
1739
1745
|
path: "/[paramD]",
|
|
1740
1746
|
component: Ae
|
|
1741
|
-
}),
|
|
1742
|
-
parent:
|
|
1747
|
+
}), Gn = oe({
|
|
1748
|
+
parent: tr,
|
|
1743
1749
|
name: "parentA.childA.grandChildA",
|
|
1744
1750
|
path: "/[paramC]",
|
|
1745
1751
|
component: Ae
|
|
@@ -1753,99 +1759,99 @@ oe({
|
|
|
1753
1759
|
path: "/",
|
|
1754
1760
|
component: Ae
|
|
1755
1761
|
});
|
|
1756
|
-
const
|
|
1762
|
+
const Kn = "lazy", Yn = {
|
|
1757
1763
|
components: !0,
|
|
1758
1764
|
props: !1
|
|
1759
1765
|
};
|
|
1760
|
-
function
|
|
1761
|
-
return ["eager", "lazy"].includes(e);
|
|
1766
|
+
function ye(e) {
|
|
1767
|
+
return ["eager", "lazy", "intent"].includes(e);
|
|
1762
1768
|
}
|
|
1763
|
-
function
|
|
1764
|
-
const o =
|
|
1769
|
+
function rr({ routerPrefetch: e, routePrefetch: t, linkPrefetch: r }, n) {
|
|
1770
|
+
const o = He(r, n), a = He(t, n), s = He(e, n), c = [
|
|
1765
1771
|
o,
|
|
1766
1772
|
a,
|
|
1767
1773
|
s,
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
].reduce((i, u) =>
|
|
1771
|
-
return
|
|
1774
|
+
Yn[n],
|
|
1775
|
+
Kn
|
|
1776
|
+
].reduce((i, u) => ye(i) ? i : i === !0 && ye(u) ? u : i === !0 && !ye(u) ? i : i === void 0 ? u : i, void 0);
|
|
1777
|
+
return ye(c) ? c : !1;
|
|
1772
1778
|
}
|
|
1773
|
-
function
|
|
1774
|
-
return
|
|
1779
|
+
function He(e, t) {
|
|
1780
|
+
return me(e) ? e[t] : e;
|
|
1775
1781
|
}
|
|
1776
|
-
function
|
|
1782
|
+
function nr(e) {
|
|
1777
1783
|
return typeof e == "object" && e !== null && "then" in e;
|
|
1778
1784
|
}
|
|
1779
|
-
function
|
|
1785
|
+
function yt(e) {
|
|
1780
1786
|
try {
|
|
1781
1787
|
const t = e();
|
|
1782
|
-
return
|
|
1788
|
+
return nr(t) ? t.catch((r) => r) : t;
|
|
1783
1789
|
} catch (t) {
|
|
1784
1790
|
return t;
|
|
1785
1791
|
}
|
|
1786
1792
|
}
|
|
1787
|
-
const
|
|
1788
|
-
function
|
|
1789
|
-
const e = xe(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } =
|
|
1793
|
+
const or = Symbol();
|
|
1794
|
+
function Xn() {
|
|
1795
|
+
const e = xe(/* @__PURE__ */ new Map()), { push: t, replace: r, reject: n } = qt(), o = (h, P, d) => P.matches.filter((p) => rr({ ...d, routePrefetch: p.prefetch }, "props") === h).flatMap((p) => u(p)).reduce((p, { id: v, name: R, props: E }) => {
|
|
1790
1796
|
if (!E)
|
|
1791
|
-
return
|
|
1792
|
-
const
|
|
1797
|
+
return p;
|
|
1798
|
+
const k = i(v, R, P), m = yt(() => E(P, {
|
|
1793
1799
|
push: t,
|
|
1794
1800
|
replace: r,
|
|
1795
1801
|
reject: n
|
|
1796
1802
|
}));
|
|
1797
|
-
return
|
|
1798
|
-
}, {}), a = (
|
|
1799
|
-
Object.entries(
|
|
1800
|
-
e.set(P,
|
|
1803
|
+
return p[k] = m, p;
|
|
1804
|
+
}, {}), a = (h) => {
|
|
1805
|
+
Object.entries(h).forEach(([P, d]) => {
|
|
1806
|
+
e.set(P, d);
|
|
1801
1807
|
});
|
|
1802
|
-
}, s = async (
|
|
1803
|
-
const P =
|
|
1808
|
+
}, s = async (h) => {
|
|
1809
|
+
const P = h.matches.flatMap(u), d = [], p = [];
|
|
1804
1810
|
for (const { id: v, name: R, props: E } of P) {
|
|
1805
1811
|
if (!E)
|
|
1806
1812
|
continue;
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1809
|
-
const m =
|
|
1813
|
+
const k = i(v, R, h);
|
|
1814
|
+
if (d.push(k), !e.has(k)) {
|
|
1815
|
+
const m = yt(() => E(h, {
|
|
1810
1816
|
push: t,
|
|
1811
1817
|
replace: r,
|
|
1812
1818
|
reject: n
|
|
1813
1819
|
}));
|
|
1814
|
-
e.set(
|
|
1820
|
+
e.set(k, m);
|
|
1815
1821
|
}
|
|
1816
|
-
|
|
1817
|
-
const m = await e.get(
|
|
1822
|
+
p.push((async () => {
|
|
1823
|
+
const m = await e.get(k);
|
|
1818
1824
|
if (m instanceof Error)
|
|
1819
1825
|
throw m;
|
|
1820
1826
|
})());
|
|
1821
1827
|
}
|
|
1822
|
-
f(
|
|
1828
|
+
f(d);
|
|
1823
1829
|
try {
|
|
1824
|
-
return await Promise.all(
|
|
1830
|
+
return await Promise.all(p), { status: "SUCCESS" };
|
|
1825
1831
|
} catch (v) {
|
|
1826
1832
|
if (v instanceof te || v instanceof be)
|
|
1827
1833
|
return v.response;
|
|
1828
1834
|
throw v;
|
|
1829
1835
|
}
|
|
1830
|
-
}, c = (
|
|
1831
|
-
const
|
|
1832
|
-
return e.get(
|
|
1836
|
+
}, c = (h, P, d) => {
|
|
1837
|
+
const p = i(h, P, d);
|
|
1838
|
+
return e.get(p);
|
|
1833
1839
|
};
|
|
1834
|
-
function i(
|
|
1835
|
-
return [
|
|
1840
|
+
function i(h, P, d) {
|
|
1841
|
+
return [h, P, d.id, JSON.stringify(d.params)].join("-");
|
|
1836
1842
|
}
|
|
1837
|
-
function u(
|
|
1838
|
-
return
|
|
1843
|
+
function u(h) {
|
|
1844
|
+
return De(h) ? Object.entries(h.props ?? {}).map(([P, d]) => ({ id: h.id, name: P, props: d })) : We(h) ? [
|
|
1839
1845
|
{
|
|
1840
|
-
id:
|
|
1846
|
+
id: h.id,
|
|
1841
1847
|
name: "default",
|
|
1842
|
-
props:
|
|
1848
|
+
props: h.props
|
|
1843
1849
|
}
|
|
1844
1850
|
] : [];
|
|
1845
1851
|
}
|
|
1846
|
-
function f(
|
|
1852
|
+
function f(h) {
|
|
1847
1853
|
for (const P in e.keys())
|
|
1848
|
-
|
|
1854
|
+
h.includes(P) || e.delete(P);
|
|
1849
1855
|
}
|
|
1850
1856
|
return {
|
|
1851
1857
|
getPrefetchProps: o,
|
|
@@ -1854,83 +1860,94 @@ function Gn() {
|
|
|
1854
1860
|
setProps: s
|
|
1855
1861
|
};
|
|
1856
1862
|
}
|
|
1857
|
-
function
|
|
1858
|
-
const e = ae(
|
|
1863
|
+
function ar() {
|
|
1864
|
+
const e = ae(or);
|
|
1859
1865
|
if (!e)
|
|
1860
|
-
throw new
|
|
1866
|
+
throw new de();
|
|
1861
1867
|
return e;
|
|
1862
1868
|
}
|
|
1863
|
-
const
|
|
1869
|
+
const Zn = gr(() => new Promise((e) => {
|
|
1864
1870
|
e({ default: { template: "foo" } });
|
|
1865
1871
|
}));
|
|
1866
|
-
function
|
|
1867
|
-
return e.name ===
|
|
1872
|
+
function gt(e) {
|
|
1873
|
+
return e.name === Zn.name && "__asyncLoader" in e;
|
|
1874
|
+
}
|
|
1875
|
+
function vt(e, t, r) {
|
|
1876
|
+
ie(e, (n, o) => {
|
|
1877
|
+
n && n.addEventListener(t, r), o && o.removeEventListener(t, r);
|
|
1878
|
+
}, { immediate: !0 }), Le(() => {
|
|
1879
|
+
e.value && e.value.removeEventListener(t, r);
|
|
1880
|
+
});
|
|
1868
1881
|
}
|
|
1869
|
-
function
|
|
1870
|
-
const t = /* @__PURE__ */ new Map(), r =
|
|
1871
|
-
const
|
|
1872
|
-
o(
|
|
1882
|
+
function eo(e) {
|
|
1883
|
+
const t = /* @__PURE__ */ new Map(), r = _e(), { getPrefetchProps: n, setPrefetchProps: o } = ar(), { isElementVisible: a } = An(r), s = () => {
|
|
1884
|
+
const u = Array.from(t.values()).reduce((f, h) => (Object.assign(f, h), f), {});
|
|
1885
|
+
o(u);
|
|
1873
1886
|
};
|
|
1874
|
-
|
|
1875
|
-
t.clear(),
|
|
1876
|
-
}, { immediate: !0 }),
|
|
1877
|
-
const { route:
|
|
1878
|
-
!
|
|
1879
|
-
}, { immediate: !0 });
|
|
1880
|
-
function c(
|
|
1881
|
-
|
|
1887
|
+
ie(() => j(e), ({ route: u, ...f }) => {
|
|
1888
|
+
t.clear(), u && i("eager", u, f);
|
|
1889
|
+
}, { immediate: !0 }), ie(a, (u) => {
|
|
1890
|
+
const { route: f, ...h } = j(e);
|
|
1891
|
+
!f || !u || i("lazy", f, h);
|
|
1892
|
+
}, { immediate: !0 }), vt(r, "focusin", c), vt(r, "mouseover", c);
|
|
1893
|
+
function c() {
|
|
1894
|
+
const { route: u, ...f } = j(e);
|
|
1895
|
+
u && i("intent", u, f);
|
|
1896
|
+
}
|
|
1897
|
+
function i(u, f, h) {
|
|
1898
|
+
to(u, f, h), t.has(u) || t.set(u, n(u, f, h));
|
|
1882
1899
|
}
|
|
1883
1900
|
return {
|
|
1884
1901
|
element: r,
|
|
1885
1902
|
commit: s
|
|
1886
1903
|
};
|
|
1887
1904
|
}
|
|
1888
|
-
function
|
|
1905
|
+
function to(e, t, r) {
|
|
1889
1906
|
t.matches.forEach((n) => {
|
|
1890
|
-
|
|
1907
|
+
rr({
|
|
1891
1908
|
...r,
|
|
1892
1909
|
routePrefetch: n.prefetch
|
|
1893
|
-
}, "components") === e && (
|
|
1894
|
-
|
|
1910
|
+
}, "components") === e && (We(n) && gt(n.component) && n.component.__asyncLoader(), De(n) && Object.values(n.components).forEach((a) => {
|
|
1911
|
+
gt(a) && a.__asyncLoader();
|
|
1895
1912
|
}));
|
|
1896
1913
|
});
|
|
1897
1914
|
}
|
|
1898
|
-
function
|
|
1899
|
-
return
|
|
1915
|
+
function sr(e, t, { exact: r } = {}) {
|
|
1916
|
+
return Kr(e) ? t === void 0 ? !0 : r ? e.matched.name === t : e.matches.map((n) => n.name).includes(t) : !1;
|
|
1900
1917
|
}
|
|
1901
|
-
function
|
|
1902
|
-
const n =
|
|
1903
|
-
const
|
|
1904
|
-
return typeof
|
|
1918
|
+
function ro(e, t = {}, r = {}) {
|
|
1919
|
+
const n = Me(), o = N(() => {
|
|
1920
|
+
const p = j(e);
|
|
1921
|
+
return typeof p != "string" ? p : T(p) ? n.find(p, j(r)) : n.resolve(p, j(t), j(r));
|
|
1905
1922
|
}), a = N(() => {
|
|
1906
1923
|
if (o.value)
|
|
1907
1924
|
return o.value.href;
|
|
1908
|
-
const
|
|
1909
|
-
if (
|
|
1910
|
-
return
|
|
1925
|
+
const p = j(e);
|
|
1926
|
+
if (T(p))
|
|
1927
|
+
return p;
|
|
1911
1928
|
console.error(new Error("Failed to resolve route in RouterLink."));
|
|
1912
|
-
}), s = N(() =>
|
|
1929
|
+
}), s = N(() => sr(n.route) && n.route.matches.some((p) => {
|
|
1913
1930
|
var v;
|
|
1914
|
-
return
|
|
1931
|
+
return p.id === ((v = o.value) == null ? void 0 : v.id);
|
|
1915
1932
|
})), c = N(() => {
|
|
1916
|
-
var
|
|
1917
|
-
return n.route.id === ((
|
|
1933
|
+
var p;
|
|
1934
|
+
return n.route.id === ((p = o.value) == null ? void 0 : p.id);
|
|
1918
1935
|
}), i = N(() => !!a.value && n.isExternal(a.value)), u = N(() => {
|
|
1919
|
-
const
|
|
1920
|
-
return typeof
|
|
1921
|
-
}), { element: f, commit:
|
|
1936
|
+
const p = j(e);
|
|
1937
|
+
return typeof p != "string" || T(p) ? j(t) : j(r);
|
|
1938
|
+
}), { element: f, commit: h } = eo(() => ({
|
|
1922
1939
|
route: o.value,
|
|
1923
1940
|
routerPrefetch: n.prefetch,
|
|
1924
1941
|
linkPrefetch: u.value.prefetch
|
|
1925
|
-
})), P = (
|
|
1926
|
-
|
|
1942
|
+
})), P = (p) => {
|
|
1943
|
+
h();
|
|
1927
1944
|
const v = {
|
|
1928
|
-
replace: (
|
|
1929
|
-
query:
|
|
1930
|
-
hash: (
|
|
1931
|
-
state: { ...u.value.state, ...
|
|
1932
|
-
}, R =
|
|
1933
|
-
return
|
|
1945
|
+
replace: (p == null ? void 0 : p.replace) ?? u.value.replace,
|
|
1946
|
+
query: Ye(u.value.query, p == null ? void 0 : p.query),
|
|
1947
|
+
hash: (p == null ? void 0 : p.hash) ?? u.value.hash,
|
|
1948
|
+
state: { ...u.value.state, ...p == null ? void 0 : p.state }
|
|
1949
|
+
}, R = j(e);
|
|
1950
|
+
return T(R) || typeof R == "object" ? n.push(R, v) : n.push(R, j(t), v);
|
|
1934
1951
|
};
|
|
1935
1952
|
return {
|
|
1936
1953
|
element: f,
|
|
@@ -1940,10 +1957,10 @@ function Zn(e, t = {}, r = {}) {
|
|
|
1940
1957
|
isExactMatch: c,
|
|
1941
1958
|
isExternal: i,
|
|
1942
1959
|
push: P,
|
|
1943
|
-
replace: (
|
|
1960
|
+
replace: (p) => P({ ...p, replace: !0 })
|
|
1944
1961
|
};
|
|
1945
1962
|
}
|
|
1946
|
-
const
|
|
1963
|
+
const no = ["href"], oo = /* @__PURE__ */ se({
|
|
1947
1964
|
__name: "routerLink",
|
|
1948
1965
|
props: {
|
|
1949
1966
|
to: {},
|
|
@@ -1954,10 +1971,10 @@ const eo = ["href"], to = /* @__PURE__ */ se({
|
|
|
1954
1971
|
state: {}
|
|
1955
1972
|
},
|
|
1956
1973
|
setup(e) {
|
|
1957
|
-
const t = e, r =
|
|
1974
|
+
const t = e, r = Me(), n = N(() => P(t.to)), o = N(() => d(t.to)), a = N(() => {
|
|
1958
1975
|
const { to: v, ...R } = t;
|
|
1959
1976
|
return R;
|
|
1960
|
-
}), { element: s, isMatch: c, isExactMatch: i, isExternal: u, push: f } =
|
|
1977
|
+
}), { element: s, isMatch: c, isExactMatch: i, isExternal: u, push: f } = ro(() => typeof t.to == "function" ? t.to(r.resolve) : t.to, a), h = N(() => ({
|
|
1961
1978
|
"router-link--match": c.value,
|
|
1962
1979
|
"router-link--exact-match": i.value
|
|
1963
1980
|
}));
|
|
@@ -1966,64 +1983,64 @@ const eo = ["href"], to = /* @__PURE__ */ se({
|
|
|
1966
1983
|
const R = v(r.resolve);
|
|
1967
1984
|
return P(R);
|
|
1968
1985
|
}
|
|
1969
|
-
return
|
|
1986
|
+
return T(v) ? r.find(v) : v;
|
|
1970
1987
|
}
|
|
1971
|
-
function
|
|
1988
|
+
function d(v) {
|
|
1972
1989
|
if (typeof v == "function") {
|
|
1973
1990
|
const R = v(r.resolve);
|
|
1974
|
-
return
|
|
1991
|
+
return d(R);
|
|
1975
1992
|
}
|
|
1976
|
-
return
|
|
1993
|
+
return T(v) ? v : v == null ? void 0 : v.href;
|
|
1977
1994
|
}
|
|
1978
|
-
function
|
|
1995
|
+
function p(v) {
|
|
1979
1996
|
v.preventDefault(), f();
|
|
1980
1997
|
}
|
|
1981
|
-
return (v, R) => (
|
|
1998
|
+
return (v, R) => (wt(), vr("a", {
|
|
1982
1999
|
ref_key: "element",
|
|
1983
2000
|
ref: s,
|
|
1984
2001
|
href: o.value,
|
|
1985
|
-
class:
|
|
1986
|
-
onClick:
|
|
2002
|
+
class: Rr(["router-link", h.value]),
|
|
2003
|
+
onClick: p
|
|
1987
2004
|
}, [
|
|
1988
|
-
|
|
1989
|
-
], 10,
|
|
2005
|
+
Pt(v.$slots, "default", Et(wr({ route: n.value, isMatch: ue(c), isExactMatch: ue(i), isExternal: ue(u) })))
|
|
2006
|
+
], 10, no));
|
|
1990
2007
|
}
|
|
1991
2008
|
});
|
|
1992
|
-
function
|
|
1993
|
-
const r =
|
|
2009
|
+
function ao(e, t) {
|
|
2010
|
+
const r = Me();
|
|
1994
2011
|
function n() {
|
|
1995
2012
|
if (!e)
|
|
1996
2013
|
return;
|
|
1997
|
-
if (!
|
|
1998
|
-
throw new
|
|
2014
|
+
if (!sr(r.route, e, t))
|
|
2015
|
+
throw new Cr(e, r.route.name);
|
|
1999
2016
|
}
|
|
2000
|
-
return
|
|
2017
|
+
return ie(r.route, n, { immediate: !0, deep: !0 }), r.route;
|
|
2001
2018
|
}
|
|
2002
|
-
const
|
|
2003
|
-
function
|
|
2004
|
-
return ae(
|
|
2019
|
+
const cr = Symbol();
|
|
2020
|
+
function et() {
|
|
2021
|
+
return ae(cr, 0);
|
|
2005
2022
|
}
|
|
2006
|
-
function
|
|
2023
|
+
function so(e, t) {
|
|
2007
2024
|
return se({
|
|
2008
2025
|
name: "PropsWrapper",
|
|
2009
2026
|
expose: [],
|
|
2010
2027
|
setup() {
|
|
2011
|
-
const r = t(), n =
|
|
2012
|
-
return () => r instanceof Error ? "" :
|
|
2028
|
+
const r = t(), n = Pr();
|
|
2029
|
+
return () => r instanceof Error ? "" : nr(r) ? n != null && n.suspense ? Z(uo(e, r)) : Z(co(e, r)) : Z(e, r);
|
|
2013
2030
|
}
|
|
2014
2031
|
});
|
|
2015
2032
|
}
|
|
2016
|
-
function
|
|
2033
|
+
function co(e, t) {
|
|
2017
2034
|
return se({
|
|
2018
2035
|
name: "AsyncPropsWrapper",
|
|
2019
2036
|
expose: [],
|
|
2020
2037
|
setup() {
|
|
2021
|
-
const r =
|
|
2038
|
+
const r = _e();
|
|
2022
2039
|
return (async () => r.value = await t)(), () => r.value instanceof Error ? "" : r.value ? Z(e, r.value) : "";
|
|
2023
2040
|
}
|
|
2024
2041
|
});
|
|
2025
2042
|
}
|
|
2026
|
-
function
|
|
2043
|
+
function uo(e, t) {
|
|
2027
2044
|
return se({
|
|
2028
2045
|
name: "SuspenseAsyncPropsWrapper",
|
|
2029
2046
|
expose: [],
|
|
@@ -2033,61 +2050,61 @@ function ao(e, t) {
|
|
|
2033
2050
|
}
|
|
2034
2051
|
});
|
|
2035
2052
|
}
|
|
2036
|
-
const
|
|
2053
|
+
const io = /* @__PURE__ */ se({
|
|
2037
2054
|
__name: "routerView",
|
|
2038
2055
|
props: {
|
|
2039
2056
|
name: { default: "default" }
|
|
2040
2057
|
},
|
|
2041
2058
|
setup(e) {
|
|
2042
|
-
const t =
|
|
2043
|
-
|
|
2059
|
+
const t = ao(), r = Gr(), n = et(), { getProps: o } = ar(), a = Er("RouterView", !0);
|
|
2060
|
+
br(cr, n + 1);
|
|
2044
2061
|
const s = N(() => {
|
|
2045
2062
|
if (r.value)
|
|
2046
2063
|
return r.value.component;
|
|
2047
2064
|
const u = t.matches.at(n);
|
|
2048
2065
|
if (!u)
|
|
2049
2066
|
return null;
|
|
2050
|
-
const f = c(u),
|
|
2051
|
-
return f ?
|
|
2067
|
+
const f = c(u), h = o(u.id, e.name, t);
|
|
2068
|
+
return f ? h ? so(f, () => h) : f : null;
|
|
2052
2069
|
});
|
|
2053
2070
|
function c(u) {
|
|
2054
2071
|
return i(u)[e.name];
|
|
2055
2072
|
}
|
|
2056
2073
|
function i(u) {
|
|
2057
|
-
return
|
|
2074
|
+
return De(u) ? u.components : We(u) ? { default: u.component } : typeof a == "string" ? {} : { default: a };
|
|
2058
2075
|
}
|
|
2059
|
-
return (u, f) => s.value ?
|
|
2060
|
-
(
|
|
2061
|
-
]) :
|
|
2076
|
+
return (u, f) => s.value ? Pt(u.$slots, "default", Et(Sr({ key: 0 }, { route: ue(t), component: s.value, rejection: ue(r) })), () => [
|
|
2077
|
+
(wt(), kr(Ar(s.value)))
|
|
2078
|
+
]) : xr("", !0);
|
|
2062
2079
|
}
|
|
2063
2080
|
});
|
|
2064
|
-
function
|
|
2065
|
-
const e = ae(
|
|
2081
|
+
function ur() {
|
|
2082
|
+
const e = ae(_t);
|
|
2066
2083
|
if (!e)
|
|
2067
|
-
throw new
|
|
2084
|
+
throw new de();
|
|
2068
2085
|
return e;
|
|
2069
2086
|
}
|
|
2070
|
-
function
|
|
2087
|
+
function ir(e) {
|
|
2071
2088
|
return (t) => {
|
|
2072
|
-
const r =
|
|
2073
|
-
return
|
|
2089
|
+
const r = et(), o = ur().addBeforeRouteHook({ lifecycle: e, hook: t, depth: r, timing: "component" });
|
|
2090
|
+
return Le(o), o;
|
|
2074
2091
|
};
|
|
2075
2092
|
}
|
|
2076
|
-
function
|
|
2093
|
+
function tt(e) {
|
|
2077
2094
|
return (t) => {
|
|
2078
|
-
const r =
|
|
2079
|
-
return
|
|
2095
|
+
const r = et(), o = ur().addAfterRouteHook({ lifecycle: e, hook: t, depth: r, timing: "component" });
|
|
2096
|
+
return Le(o), o;
|
|
2080
2097
|
};
|
|
2081
2098
|
}
|
|
2082
|
-
const
|
|
2083
|
-
function
|
|
2084
|
-
return
|
|
2099
|
+
const yo = ir("onBeforeRouteUpdate"), go = ir("onBeforeRouteLeave"), vo = tt("onAfterRouteEnter"), Ro = tt("onAfterRouteUpdate"), wo = tt("onAfterRouteLeave");
|
|
2100
|
+
function fo(e) {
|
|
2101
|
+
return me(e) && typeof e.value == "string";
|
|
2085
2102
|
}
|
|
2086
|
-
function
|
|
2087
|
-
return
|
|
2103
|
+
function Rt(e) {
|
|
2104
|
+
return fo(e) ? e : Kt(e, {});
|
|
2088
2105
|
}
|
|
2089
|
-
function
|
|
2090
|
-
const t =
|
|
2106
|
+
function Po(e) {
|
|
2107
|
+
const t = Qe(), r = Xt(e.name), n = Zt(e.path), o = er(e.query), a = Yt(e.hash), s = e.meta ?? {}, c = Mr(e) ? Rt(e.host) : Rt(""), i = ge({ id: t, meta: {}, state: {}, ...e }), u = {
|
|
2091
2108
|
id: t,
|
|
2092
2109
|
matched: i,
|
|
2093
2110
|
matches: [i],
|
|
@@ -2099,32 +2116,32 @@ function vo(e) {
|
|
|
2099
2116
|
meta: s,
|
|
2100
2117
|
depth: 1,
|
|
2101
2118
|
state: {}
|
|
2102
|
-
}, f =
|
|
2119
|
+
}, f = At(e) ? xt(e.parent, u) : u;
|
|
2103
2120
|
return ce(f.path.params, f.query.params, f.host.params), f;
|
|
2104
2121
|
}
|
|
2105
2122
|
export {
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2123
|
+
Lr as DuplicateParamsError,
|
|
2124
|
+
Ur as MetaPropertyConflict,
|
|
2125
|
+
oo as RouterLink,
|
|
2126
|
+
de as RouterNotInstalledError,
|
|
2127
|
+
io as RouterView,
|
|
2128
|
+
Cr as UseRouteInvalidError,
|
|
2129
|
+
bt as asUrl,
|
|
2130
|
+
Po as createExternalRoute,
|
|
2131
|
+
Jr as createParam,
|
|
2115
2132
|
oe as createRoute,
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2133
|
+
mo as createRouter,
|
|
2134
|
+
sr as isRoute,
|
|
2135
|
+
T as isUrl,
|
|
2136
|
+
vo as onAfterRouteEnter,
|
|
2137
|
+
Ro as onAfterRouteLeave,
|
|
2138
|
+
wo as onAfterRouteUpdate,
|
|
2139
|
+
yo as onBeforeRouteLeave,
|
|
2140
|
+
go as onBeforeRouteUpdate,
|
|
2141
|
+
$e as path,
|
|
2142
|
+
mt as query,
|
|
2143
|
+
ro as useLink,
|
|
2144
|
+
ao as useRoute,
|
|
2145
|
+
Me as useRouter,
|
|
2146
|
+
po as withDefault
|
|
2130
2147
|
};
|