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