@kitbag/router 0.10.1 → 0.11.1
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 +41 -23
- package/dist/kitbag-router.js +946 -875
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +5 -4
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);
|
|
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);
|
|
749
|
+
if (!t)
|
|
750
|
+
throw new St();
|
|
751
|
+
return t;
|
|
752
|
+
}
|
|
753
|
+
const Ae = Symbol();
|
|
754
|
+
function jt() {
|
|
755
|
+
const t = it(Ae);
|
|
756
756
|
if (!t)
|
|
757
|
-
throw new
|
|
757
|
+
throw new St();
|
|
758
758
|
return t;
|
|
759
759
|
}
|
|
760
|
-
const
|
|
761
|
-
function
|
|
762
|
-
return typeof t == "object" && t !== null &&
|
|
760
|
+
const xe = Symbol("isRouterRouteSymbol");
|
|
761
|
+
function jn(t) {
|
|
762
|
+
return typeof t == "object" && t !== null && xe in t;
|
|
763
763
|
}
|
|
764
|
-
function
|
|
765
|
-
function n(
|
|
766
|
-
if (typeof
|
|
767
|
-
const
|
|
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,22 @@ 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
|
-
|
|
849
|
-
|
|
846
|
+
function Dn({ mode: t, listener: e }) {
|
|
847
|
+
const n = Tn(t), r = (c, f) => {
|
|
848
|
+
if (f != null && f.replace) {
|
|
849
|
+
n.replace(c, f.state);
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
n.push(c, f == null ? void 0 : f.state);
|
|
850
853
|
}, o = () => {
|
|
851
|
-
const
|
|
852
|
-
|
|
854
|
+
const c = K(n.location);
|
|
855
|
+
n.replace(c);
|
|
853
856
|
};
|
|
854
857
|
let a;
|
|
855
858
|
return {
|
|
@@ -864,154 +867,154 @@ function On({ mode: t, listener: e }) {
|
|
|
864
867
|
}
|
|
865
868
|
};
|
|
866
869
|
}
|
|
867
|
-
function
|
|
870
|
+
function Tn(t = "auto") {
|
|
868
871
|
switch (t) {
|
|
869
872
|
case "auto":
|
|
870
|
-
return
|
|
873
|
+
return ye() ? Yt() : Xt();
|
|
871
874
|
case "browser":
|
|
872
|
-
return
|
|
875
|
+
return Yt();
|
|
873
876
|
case "memory":
|
|
874
|
-
return
|
|
877
|
+
return Xt();
|
|
875
878
|
case "hash":
|
|
876
|
-
return
|
|
879
|
+
return $n();
|
|
877
880
|
default:
|
|
878
881
|
const e = t;
|
|
879
882
|
throw new Error(`Switch is not exhaustive for mode: ${e}`);
|
|
880
883
|
}
|
|
881
884
|
}
|
|
882
|
-
class
|
|
885
|
+
class vt {
|
|
883
886
|
constructor() {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
887
|
+
M(this, "onBeforeRouteEnter", /* @__PURE__ */ new Set());
|
|
888
|
+
M(this, "onBeforeRouteUpdate", /* @__PURE__ */ new Set());
|
|
889
|
+
M(this, "onBeforeRouteLeave", /* @__PURE__ */ new Set());
|
|
890
|
+
M(this, "onAfterRouteEnter", /* @__PURE__ */ new Set());
|
|
891
|
+
M(this, "onAfterRouteUpdate", /* @__PURE__ */ new Set());
|
|
892
|
+
M(this, "onAfterRouteLeave", /* @__PURE__ */ new Set());
|
|
890
893
|
}
|
|
891
894
|
}
|
|
892
|
-
class
|
|
895
|
+
class te extends Error {
|
|
893
896
|
}
|
|
894
897
|
class rt extends Error {
|
|
895
898
|
constructor(n) {
|
|
896
899
|
super("Error occurred during a router push operation.");
|
|
897
|
-
|
|
900
|
+
M(this, "to");
|
|
898
901
|
this.to = n;
|
|
899
902
|
}
|
|
900
903
|
}
|
|
901
|
-
class
|
|
904
|
+
class Lt extends Error {
|
|
902
905
|
constructor(n) {
|
|
903
906
|
super(`Routing action rejected: ${n}`);
|
|
904
|
-
|
|
907
|
+
M(this, "type");
|
|
905
908
|
this.type = n;
|
|
906
909
|
}
|
|
907
910
|
}
|
|
908
|
-
function
|
|
909
|
-
const n = new
|
|
911
|
+
function In(t, e) {
|
|
912
|
+
const n = new vt();
|
|
910
913
|
return t.matches.forEach((r, o) => {
|
|
911
|
-
r.onBeforeRouteEnter &&
|
|
914
|
+
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
915
|
}), e.matches.forEach((r, o) => {
|
|
913
|
-
r.onBeforeRouteLeave &&
|
|
916
|
+
r.onBeforeRouteLeave && _t(t, e, o) && Y(r.onBeforeRouteLeave).forEach((a) => n.onBeforeRouteLeave.add(a));
|
|
914
917
|
}), n;
|
|
915
918
|
}
|
|
916
|
-
function
|
|
917
|
-
const n = new
|
|
919
|
+
function Fn(t, e) {
|
|
920
|
+
const n = new vt();
|
|
918
921
|
return t.matches.forEach((r, o) => {
|
|
919
|
-
r.onAfterRouteEnter &&
|
|
922
|
+
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
923
|
}), e.matches.forEach((r, o) => {
|
|
921
|
-
r.onAfterRouteLeave &&
|
|
924
|
+
r.onAfterRouteLeave && _t(t, e, o) && Y(r.onAfterRouteLeave).forEach((a) => n.onAfterRouteLeave.add(a));
|
|
922
925
|
}), n;
|
|
923
926
|
}
|
|
924
|
-
function
|
|
927
|
+
function W(t) {
|
|
925
928
|
return typeof t != "string" ? !1 : /^(https?:\/\/|\/).*/g.test(t);
|
|
926
929
|
}
|
|
927
|
-
function
|
|
930
|
+
function Jn() {
|
|
928
931
|
const t = (s) => {
|
|
929
|
-
throw new
|
|
932
|
+
throw new Lt(s);
|
|
930
933
|
}, e = (...s) => {
|
|
931
934
|
throw new rt(s);
|
|
932
|
-
}, n = (s,
|
|
933
|
-
if (
|
|
934
|
-
const
|
|
935
|
-
throw new rt([s, { ...
|
|
935
|
+
}, n = (s, u, c) => {
|
|
936
|
+
if (W(s)) {
|
|
937
|
+
const h = u ?? {};
|
|
938
|
+
throw new rt([s, { ...h, replace: !0 }]);
|
|
936
939
|
}
|
|
937
|
-
const
|
|
938
|
-
throw new rt([s,
|
|
940
|
+
const f = u, i = c ?? {};
|
|
941
|
+
throw new rt([s, f, { ...i, replace: !0 }]);
|
|
939
942
|
}, r = () => {
|
|
940
|
-
throw new
|
|
943
|
+
throw new te();
|
|
941
944
|
};
|
|
942
|
-
async function o({ to: s, from:
|
|
943
|
-
const { global:
|
|
944
|
-
...
|
|
945
|
-
...
|
|
946
|
-
...
|
|
947
|
-
...i.onBeforeRouteUpdate,
|
|
945
|
+
async function o({ to: s, from: u, hooks: c }) {
|
|
946
|
+
const { global: f, component: i } = c, h = In(s, u), y = [
|
|
947
|
+
...f.onBeforeRouteEnter,
|
|
948
|
+
...h.onBeforeRouteEnter,
|
|
949
|
+
...f.onBeforeRouteUpdate,
|
|
948
950
|
...h.onBeforeRouteUpdate,
|
|
949
|
-
...
|
|
950
|
-
...
|
|
951
|
-
...h.onBeforeRouteLeave
|
|
951
|
+
...i.onBeforeRouteUpdate,
|
|
952
|
+
...f.onBeforeRouteLeave,
|
|
953
|
+
...h.onBeforeRouteLeave,
|
|
954
|
+
...i.onBeforeRouteLeave
|
|
952
955
|
];
|
|
953
956
|
try {
|
|
954
|
-
const
|
|
955
|
-
from:
|
|
957
|
+
const p = y.map((S) => S(s, {
|
|
958
|
+
from: u,
|
|
956
959
|
reject: t,
|
|
957
960
|
push: e,
|
|
958
961
|
replace: n,
|
|
959
962
|
abort: r
|
|
960
963
|
}));
|
|
961
|
-
await Promise.all(
|
|
962
|
-
} catch (
|
|
963
|
-
if (
|
|
964
|
+
await Promise.all(p);
|
|
965
|
+
} catch (p) {
|
|
966
|
+
if (p instanceof rt)
|
|
964
967
|
return {
|
|
965
968
|
status: "PUSH",
|
|
966
|
-
to:
|
|
969
|
+
to: p.to
|
|
967
970
|
};
|
|
968
|
-
if (
|
|
971
|
+
if (p instanceof Lt)
|
|
969
972
|
return {
|
|
970
973
|
status: "REJECT",
|
|
971
|
-
type:
|
|
974
|
+
type: p.type
|
|
972
975
|
};
|
|
973
|
-
if (
|
|
976
|
+
if (p instanceof te)
|
|
974
977
|
return {
|
|
975
978
|
status: "ABORT"
|
|
976
979
|
};
|
|
977
|
-
throw
|
|
980
|
+
throw p;
|
|
978
981
|
}
|
|
979
982
|
return {
|
|
980
983
|
status: "SUCCESS"
|
|
981
984
|
};
|
|
982
985
|
}
|
|
983
|
-
async function a({ to: s, from:
|
|
984
|
-
const { global:
|
|
985
|
-
...h.onAfterRouteLeave,
|
|
986
|
+
async function a({ to: s, from: u, hooks: c }) {
|
|
987
|
+
const { global: f, component: i } = c, h = Fn(s, u), y = [
|
|
986
988
|
...i.onAfterRouteLeave,
|
|
987
|
-
...
|
|
988
|
-
...
|
|
989
|
+
...h.onAfterRouteLeave,
|
|
990
|
+
...f.onAfterRouteLeave,
|
|
989
991
|
...i.onAfterRouteUpdate,
|
|
990
|
-
...
|
|
991
|
-
...
|
|
992
|
+
...h.onAfterRouteUpdate,
|
|
993
|
+
...f.onAfterRouteUpdate,
|
|
992
994
|
...i.onAfterRouteEnter,
|
|
993
|
-
...
|
|
995
|
+
...h.onAfterRouteEnter,
|
|
996
|
+
...f.onAfterRouteEnter
|
|
994
997
|
];
|
|
995
998
|
try {
|
|
996
|
-
const
|
|
997
|
-
from:
|
|
999
|
+
const p = y.map((S) => S(s, {
|
|
1000
|
+
from: u,
|
|
998
1001
|
reject: t,
|
|
999
1002
|
push: e,
|
|
1000
1003
|
replace: n
|
|
1001
1004
|
}));
|
|
1002
|
-
await Promise.all(
|
|
1003
|
-
} catch (
|
|
1004
|
-
if (
|
|
1005
|
+
await Promise.all(p);
|
|
1006
|
+
} catch (p) {
|
|
1007
|
+
if (p instanceof rt)
|
|
1005
1008
|
return {
|
|
1006
1009
|
status: "PUSH",
|
|
1007
|
-
to:
|
|
1010
|
+
to: p.to
|
|
1008
1011
|
};
|
|
1009
|
-
if (
|
|
1012
|
+
if (p instanceof Lt)
|
|
1010
1013
|
return {
|
|
1011
1014
|
status: "REJECT",
|
|
1012
|
-
type:
|
|
1015
|
+
type: p.type
|
|
1013
1016
|
};
|
|
1014
|
-
throw
|
|
1017
|
+
throw p;
|
|
1015
1018
|
}
|
|
1016
1019
|
return {
|
|
1017
1020
|
status: "SUCCESS"
|
|
@@ -1022,97 +1025,105 @@ function Dn() {
|
|
|
1022
1025
|
runAfterRouteHooks: a
|
|
1023
1026
|
};
|
|
1024
1027
|
}
|
|
1025
|
-
const
|
|
1028
|
+
const Ot = (t, e, n) => {
|
|
1026
1029
|
const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
1027
1030
|
return r.length < n || r[n] !== o[n];
|
|
1028
|
-
},
|
|
1031
|
+
}, _t = (t, e, n) => {
|
|
1029
1032
|
const r = t.matches, o = (e == null ? void 0 : e.matches) ?? [];
|
|
1030
1033
|
return r.length < n || r[n] !== o[n];
|
|
1031
|
-
},
|
|
1032
|
-
function
|
|
1034
|
+
}, qt = (t, e, n) => t.matches[n] === (e == null ? void 0 : e.matches[n]);
|
|
1035
|
+
function ee(t) {
|
|
1033
1036
|
switch (t) {
|
|
1034
1037
|
case "onBeforeRouteEnter":
|
|
1035
1038
|
case "onAfterRouteEnter":
|
|
1036
|
-
return
|
|
1039
|
+
return Ot;
|
|
1037
1040
|
case "onBeforeRouteUpdate":
|
|
1038
1041
|
case "onAfterRouteUpdate":
|
|
1039
|
-
return
|
|
1042
|
+
return qt;
|
|
1040
1043
|
case "onBeforeRouteLeave":
|
|
1041
1044
|
case "onAfterRouteLeave":
|
|
1042
|
-
return
|
|
1045
|
+
return _t;
|
|
1043
1046
|
default:
|
|
1044
1047
|
throw new Error(`Switch is not exhaustive for lifecycle: ${t}`);
|
|
1045
1048
|
}
|
|
1046
1049
|
}
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1054
|
-
if (
|
|
1055
|
-
return
|
|
1050
|
+
function Qn() {
|
|
1051
|
+
const t = {
|
|
1052
|
+
global: new vt(),
|
|
1053
|
+
component: new vt()
|
|
1054
|
+
};
|
|
1055
|
+
function e({ lifecycle: r, timing: o, depth: a, hook: s }) {
|
|
1056
|
+
const u = ee(r), c = t[o][r], f = (i, h) => {
|
|
1057
|
+
if (u(i, h.from, a))
|
|
1058
|
+
return s(i, h);
|
|
1056
1059
|
};
|
|
1057
|
-
return
|
|
1060
|
+
return c.add(f), () => c.delete(f);
|
|
1058
1061
|
}
|
|
1059
|
-
|
|
1060
|
-
const
|
|
1061
|
-
if (
|
|
1062
|
-
return
|
|
1062
|
+
function n({ lifecycle: r, timing: o, depth: a, hook: s }) {
|
|
1063
|
+
const u = ee(r), c = t[o][r], f = (i, h) => {
|
|
1064
|
+
if (u(i, h.from, a))
|
|
1065
|
+
return s(i, h);
|
|
1063
1066
|
};
|
|
1064
|
-
return
|
|
1067
|
+
return c.add(f), () => c.delete(f);
|
|
1065
1068
|
}
|
|
1069
|
+
return { ...t, addBeforeRouteHook: e, addAfterRouteHook: n };
|
|
1066
1070
|
}
|
|
1067
|
-
const
|
|
1068
|
-
function
|
|
1069
|
-
const t =
|
|
1071
|
+
const Be = Symbol();
|
|
1072
|
+
function Gn() {
|
|
1073
|
+
const t = Qn();
|
|
1070
1074
|
return {
|
|
1071
|
-
onBeforeRouteEnter: (
|
|
1072
|
-
onBeforeRouteUpdate: (
|
|
1073
|
-
onBeforeRouteLeave: (
|
|
1074
|
-
onAfterRouteEnter: (
|
|
1075
|
-
onAfterRouteUpdate: (
|
|
1076
|
-
onAfterRouteLeave: (
|
|
1075
|
+
onBeforeRouteEnter: (u) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteEnter", hook: u, timing: "global", depth: 0 }),
|
|
1076
|
+
onBeforeRouteUpdate: (u) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteUpdate", hook: u, timing: "global", depth: 0 }),
|
|
1077
|
+
onBeforeRouteLeave: (u) => t.addBeforeRouteHook({ lifecycle: "onBeforeRouteLeave", hook: u, timing: "global", depth: 0 }),
|
|
1078
|
+
onAfterRouteEnter: (u) => t.addAfterRouteHook({ lifecycle: "onAfterRouteEnter", hook: u, timing: "global", depth: 0 }),
|
|
1079
|
+
onAfterRouteUpdate: (u) => t.addAfterRouteHook({ lifecycle: "onAfterRouteUpdate", hook: u, timing: "global", depth: 0 }),
|
|
1080
|
+
onAfterRouteLeave: (u) => t.addAfterRouteHook({ lifecycle: "onAfterRouteLeave", hook: u, timing: "global", depth: 0 }),
|
|
1077
1081
|
hooks: t
|
|
1078
1082
|
};
|
|
1079
1083
|
}
|
|
1080
|
-
function
|
|
1081
|
-
return
|
|
1084
|
+
function Kn(t) {
|
|
1085
|
+
return ut(() => () => pt("h1", t), {
|
|
1082
1086
|
name: t,
|
|
1083
1087
|
props: []
|
|
1084
1088
|
});
|
|
1085
1089
|
}
|
|
1086
|
-
function
|
|
1090
|
+
function Le(t) {
|
|
1087
1091
|
const e = new URLSearchParams(t);
|
|
1088
1092
|
return {
|
|
1089
1093
|
get: (n) => e.get(n),
|
|
1090
1094
|
getAll: (n) => e.getAll(n)
|
|
1091
1095
|
};
|
|
1092
1096
|
}
|
|
1093
|
-
function
|
|
1097
|
+
function zn() {
|
|
1098
|
+
let t = 0;
|
|
1099
|
+
return () => (++t).toString();
|
|
1100
|
+
}
|
|
1101
|
+
const Mt = zn();
|
|
1102
|
+
function Yn({
|
|
1094
1103
|
rejections: t
|
|
1095
1104
|
}) {
|
|
1096
1105
|
const e = (a) => {
|
|
1097
1106
|
const s = {
|
|
1098
1107
|
...t
|
|
1099
1108
|
};
|
|
1100
|
-
return
|
|
1109
|
+
return dt(s[a] ?? Kn(a));
|
|
1101
1110
|
}, n = (a) => {
|
|
1102
|
-
const s =
|
|
1111
|
+
const s = dt(e(a)), u = {
|
|
1112
|
+
id: Mt(),
|
|
1103
1113
|
name: a,
|
|
1104
1114
|
component: s,
|
|
1105
1115
|
meta: {},
|
|
1106
1116
|
state: {}
|
|
1107
1117
|
};
|
|
1108
1118
|
return {
|
|
1109
|
-
|
|
1110
|
-
|
|
1119
|
+
id: u.id,
|
|
1120
|
+
matched: u,
|
|
1121
|
+
matches: [u],
|
|
1111
1122
|
name: a,
|
|
1112
|
-
query:
|
|
1123
|
+
query: Le(""),
|
|
1113
1124
|
params: {},
|
|
1114
1125
|
state: {},
|
|
1115
|
-
[
|
|
1126
|
+
[ke]: !0
|
|
1116
1127
|
};
|
|
1117
1128
|
}, r = (a) => {
|
|
1118
1129
|
if (!a) {
|
|
@@ -1121,102 +1132,102 @@ function Fn({
|
|
|
1121
1132
|
}
|
|
1122
1133
|
const s = e(a);
|
|
1123
1134
|
o.value = { type: a, component: s };
|
|
1124
|
-
}, o =
|
|
1135
|
+
}, o = ie(null);
|
|
1125
1136
|
return {
|
|
1126
1137
|
setRejection: r,
|
|
1127
1138
|
rejection: o,
|
|
1128
1139
|
getRejectionRoute: n
|
|
1129
1140
|
};
|
|
1130
1141
|
}
|
|
1131
|
-
class
|
|
1142
|
+
class Xn extends Error {
|
|
1132
1143
|
constructor(e) {
|
|
1133
1144
|
super(`Route not found: "${e}"`);
|
|
1134
1145
|
}
|
|
1135
1146
|
}
|
|
1136
|
-
function
|
|
1147
|
+
function Wt(t) {
|
|
1137
1148
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1138
1149
|
}
|
|
1139
|
-
function
|
|
1150
|
+
function Zn(t, e) {
|
|
1140
1151
|
const n = Array.from(t.matchAll(e));
|
|
1141
1152
|
if (n.length === 0)
|
|
1142
1153
|
return [t];
|
|
1143
1154
|
let r = 0;
|
|
1144
|
-
const o = n.reduce((s,
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1147
|
-
const [
|
|
1148
|
-
return s.push(
|
|
1155
|
+
const o = n.reduce((s, u) => {
|
|
1156
|
+
const c = Wt(t.slice(r, u.index));
|
|
1157
|
+
c.length && s.push(c);
|
|
1158
|
+
const [f] = u;
|
|
1159
|
+
return s.push(f), r = u.index + f.length, s;
|
|
1149
1160
|
}, []), a = t.slice(r);
|
|
1150
1161
|
return a && o.push(a), o;
|
|
1151
1162
|
}
|
|
1152
|
-
function
|
|
1153
|
-
const e =
|
|
1163
|
+
function tr(t) {
|
|
1164
|
+
const e = Ne(t.path.toString());
|
|
1154
1165
|
return new RegExp(`^${e}$`, "i");
|
|
1155
1166
|
}
|
|
1156
|
-
function
|
|
1167
|
+
function er(t) {
|
|
1157
1168
|
const e = new URLSearchParams(t.query.toString());
|
|
1158
|
-
return Array.from(e.entries()).filter(([, n]) =>
|
|
1159
|
-
const o =
|
|
1160
|
-
return new RegExp(`${
|
|
1169
|
+
return Array.from(e.entries()).filter(([, n]) => !Ct(n)).map(([n, r]) => {
|
|
1170
|
+
const o = Ne(r);
|
|
1171
|
+
return new RegExp(`${Wt(n)}=${o}(&|$)`, "i");
|
|
1161
1172
|
});
|
|
1162
1173
|
}
|
|
1163
|
-
function
|
|
1164
|
-
return
|
|
1174
|
+
function Ne(t) {
|
|
1175
|
+
return Zn(t, new RegExp(nr, "g")).map((e) => e.startsWith(T) ? Ue(e) : Wt(e)).join("");
|
|
1165
1176
|
}
|
|
1166
|
-
function
|
|
1177
|
+
function Ue(t) {
|
|
1167
1178
|
return [
|
|
1168
|
-
|
|
1169
|
-
|
|
1179
|
+
rr,
|
|
1180
|
+
or
|
|
1170
1181
|
].reduce((e, n) => n(e), t);
|
|
1171
1182
|
}
|
|
1172
|
-
const
|
|
1173
|
-
function
|
|
1174
|
-
return t.replace(new RegExp(
|
|
1183
|
+
const nr = `\\${T}\\??([\\w-_]+)\\${Q}`, Dt = `\\${T}\\?([\\w-_]+)\\${Q}`, Ce = `\\${T}([\\w-_]+)\\${Q}`;
|
|
1184
|
+
function rr(t) {
|
|
1185
|
+
return t.replace(new RegExp(Dt, "g"), ".*");
|
|
1175
1186
|
}
|
|
1176
|
-
function
|
|
1177
|
-
return new RegExp(
|
|
1187
|
+
function Ct(t) {
|
|
1188
|
+
return new RegExp(Dt, "g").test(t);
|
|
1178
1189
|
}
|
|
1179
|
-
function
|
|
1180
|
-
return t.replace(new RegExp(
|
|
1190
|
+
function or(t) {
|
|
1191
|
+
return t.replace(new RegExp(Ce, "g"), ".+");
|
|
1181
1192
|
}
|
|
1182
|
-
function
|
|
1183
|
-
const [e] =
|
|
1193
|
+
function At(t) {
|
|
1194
|
+
const [e] = wt(t, new RegExp(Dt, "g")), [n] = wt(t, new RegExp(Ce, "g"));
|
|
1184
1195
|
return e ?? n;
|
|
1185
1196
|
}
|
|
1186
|
-
function
|
|
1187
|
-
return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) =>
|
|
1197
|
+
function wt(t, e) {
|
|
1198
|
+
return Array.from(t.matchAll(e)).flatMap(([, ...r]) => r.map((o) => lt(o) ? o : ""));
|
|
1188
1199
|
}
|
|
1189
|
-
function
|
|
1190
|
-
const r =
|
|
1200
|
+
function $e(t, e, n) {
|
|
1201
|
+
const r = Ve(e, n), [o] = wt(t, r);
|
|
1191
1202
|
return o;
|
|
1192
1203
|
}
|
|
1193
|
-
function
|
|
1204
|
+
function He(t, e) {
|
|
1194
1205
|
if (!e)
|
|
1195
1206
|
return t;
|
|
1196
|
-
const { name: n, param: r, value: o } = e, a =
|
|
1197
|
-
return
|
|
1207
|
+
const { name: n, param: r, value: o } = e, a = Ve(t, n);
|
|
1208
|
+
return wt(t, a).reduce((u, c) => c === void 0 ? u : u.replace(c, () => st(o, r, n.startsWith("?"))), t);
|
|
1198
1209
|
}
|
|
1199
|
-
function
|
|
1210
|
+
function Ve(t, e) {
|
|
1200
1211
|
const n = [
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1212
|
+
ar,
|
|
1213
|
+
sr,
|
|
1214
|
+
Ue
|
|
1204
1215
|
].reduce((r, o) => o(r, e), t);
|
|
1205
1216
|
return new RegExp(n, "g");
|
|
1206
1217
|
}
|
|
1207
|
-
function
|
|
1218
|
+
function ar(t, e) {
|
|
1208
1219
|
if (!e.startsWith("?"))
|
|
1209
1220
|
return t;
|
|
1210
1221
|
const n = new RegExp(`\\${T}\\${e}\\${Q}`, "g");
|
|
1211
1222
|
return t.replace(n, "(.*)");
|
|
1212
1223
|
}
|
|
1213
|
-
function
|
|
1224
|
+
function sr(t, e) {
|
|
1214
1225
|
if (e.startsWith("?"))
|
|
1215
1226
|
return t;
|
|
1216
1227
|
const n = new RegExp(`\\${T}${e}\\${Q}`, "g");
|
|
1217
1228
|
return t.replace(n, "(.+)");
|
|
1218
1229
|
}
|
|
1219
|
-
function
|
|
1230
|
+
function je(t, ...e) {
|
|
1220
1231
|
return e.reduce((n, r) => {
|
|
1221
1232
|
if (!r)
|
|
1222
1233
|
return n;
|
|
@@ -1224,259 +1235,255 @@ function Ce(t, ...e) {
|
|
|
1224
1235
|
return Object.keys(o).length === 0 ? n : n.includes("?") ? `${n}&${o}` : `${n}?${o}`;
|
|
1225
1236
|
}, t);
|
|
1226
1237
|
}
|
|
1227
|
-
function
|
|
1228
|
-
const { params: n = {}, query: r } = e, o =
|
|
1229
|
-
return `${
|
|
1238
|
+
function cr(t, e = {}) {
|
|
1239
|
+
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();
|
|
1240
|
+
return `${u}${c}`;
|
|
1230
1241
|
}
|
|
1231
|
-
function
|
|
1242
|
+
function ur(t, e) {
|
|
1232
1243
|
const n = t.toString();
|
|
1233
1244
|
return Object.entries(t.params).reduce((r, [o, a]) => {
|
|
1234
|
-
const s =
|
|
1235
|
-
return s ?
|
|
1245
|
+
const s = At(`${T}${o}${Q}`);
|
|
1246
|
+
return s ? He(r, { name: o, param: a, value: e[s] }) : r;
|
|
1236
1247
|
}, n);
|
|
1237
1248
|
}
|
|
1238
|
-
function
|
|
1249
|
+
function ir(t, e) {
|
|
1239
1250
|
const n = t.toString();
|
|
1240
1251
|
return Object.entries(t.params).reduce((r, [o, a]) => {
|
|
1241
|
-
const s =
|
|
1242
|
-
return s ?
|
|
1252
|
+
const s = At(`${T}${o}${Q}`);
|
|
1253
|
+
return s ? He(r, { name: o, param: a, value: e[s] }) : r;
|
|
1243
1254
|
}, n);
|
|
1244
1255
|
}
|
|
1245
|
-
function
|
|
1256
|
+
function fr(t, e) {
|
|
1246
1257
|
const n = t.toString();
|
|
1247
1258
|
if (!n)
|
|
1248
1259
|
return {};
|
|
1249
1260
|
const r = new URLSearchParams(n);
|
|
1250
1261
|
return Array.from(r.entries()).reduce((o, [a, s]) => {
|
|
1251
|
-
const
|
|
1252
|
-
if (!
|
|
1262
|
+
const u = At(s);
|
|
1263
|
+
if (!u)
|
|
1253
1264
|
return { ...o, [a]: s };
|
|
1254
|
-
const
|
|
1255
|
-
return
|
|
1265
|
+
const f = st(e[u], t.params[u], Ct(s)), i = e[u] === void 0 && f === "";
|
|
1266
|
+
return Ct(s) && i ? o : { ...o, [a]: f };
|
|
1256
1267
|
}, {});
|
|
1257
1268
|
}
|
|
1258
|
-
function
|
|
1269
|
+
function lr(t) {
|
|
1259
1270
|
return (e, n, r) => {
|
|
1260
|
-
if (
|
|
1261
|
-
return
|
|
1262
|
-
const o = n ?? {}, a = r ?? {}, s = t.find((
|
|
1271
|
+
if (W(e))
|
|
1272
|
+
return je(e, (n ?? {}).query);
|
|
1273
|
+
const o = n ?? {}, a = r ?? {}, s = t.find((c) => c.name === e);
|
|
1263
1274
|
if (!s)
|
|
1264
|
-
throw new
|
|
1265
|
-
return
|
|
1275
|
+
throw new Xn(String(e));
|
|
1276
|
+
return cr(s, {
|
|
1266
1277
|
params: o,
|
|
1267
1278
|
query: a.query,
|
|
1268
1279
|
hash: a.hash
|
|
1269
1280
|
});
|
|
1270
1281
|
};
|
|
1271
1282
|
}
|
|
1272
|
-
class
|
|
1283
|
+
class hr extends Error {
|
|
1273
1284
|
constructor() {
|
|
1274
1285
|
super("initialUrl must be set if window.location is unavailable");
|
|
1275
1286
|
}
|
|
1276
1287
|
}
|
|
1277
|
-
function
|
|
1288
|
+
function pr(t) {
|
|
1278
1289
|
if (t)
|
|
1279
1290
|
return t;
|
|
1280
|
-
if (
|
|
1291
|
+
if (ye())
|
|
1281
1292
|
return window.location.toString();
|
|
1282
|
-
throw new
|
|
1293
|
+
throw new hr();
|
|
1283
1294
|
}
|
|
1284
|
-
const
|
|
1295
|
+
const dr = (t, e) => {
|
|
1285
1296
|
try {
|
|
1286
|
-
|
|
1297
|
+
Oe(t, e);
|
|
1287
1298
|
} catch {
|
|
1288
1299
|
return !1;
|
|
1289
1300
|
}
|
|
1290
1301
|
return !0;
|
|
1291
|
-
},
|
|
1292
|
-
const { pathname: n, search: r } =
|
|
1302
|
+
}, Oe = (t, e) => {
|
|
1303
|
+
const { pathname: n, search: r } = D(e);
|
|
1293
1304
|
return {
|
|
1294
|
-
...
|
|
1295
|
-
...
|
|
1305
|
+
...mr(t.path, n),
|
|
1306
|
+
...gr(t.query, r)
|
|
1296
1307
|
};
|
|
1297
1308
|
};
|
|
1298
|
-
function
|
|
1309
|
+
function mr(t, e) {
|
|
1299
1310
|
const n = {}, r = decodeURIComponent(e);
|
|
1300
1311
|
for (const [o, a] of Object.entries(t.params)) {
|
|
1301
|
-
const s = o.startsWith("?"),
|
|
1302
|
-
n[
|
|
1312
|
+
const s = o.startsWith("?"), u = s ? o.slice(1) : o, c = $e(r, t.toString(), o), f = at(c, a, s);
|
|
1313
|
+
n[u] = f;
|
|
1303
1314
|
}
|
|
1304
1315
|
return n;
|
|
1305
1316
|
}
|
|
1306
|
-
function
|
|
1317
|
+
function gr(t, e) {
|
|
1307
1318
|
const n = {}, r = new URLSearchParams(e);
|
|
1308
1319
|
for (const [o, a] of Object.entries(t.params)) {
|
|
1309
|
-
const s = o.startsWith("?"),
|
|
1310
|
-
n[
|
|
1320
|
+
const s = o.startsWith("?"), u = s ? o.slice(1) : o, c = r.get(u) ?? void 0, f = at(c, a, s);
|
|
1321
|
+
n[u] = f;
|
|
1311
1322
|
}
|
|
1312
1323
|
return n;
|
|
1313
1324
|
}
|
|
1314
|
-
const
|
|
1315
|
-
const { pathname: n } =
|
|
1316
|
-
return
|
|
1317
|
-
},
|
|
1318
|
-
const { search: n } =
|
|
1319
|
-
return
|
|
1320
|
-
},
|
|
1321
|
-
const { hash: n } =
|
|
1325
|
+
const Rr = (t) => "name" in t.matched && !!t.matched.name, yr = (t, e) => {
|
|
1326
|
+
const { pathname: n } = D(e);
|
|
1327
|
+
return tr(t).test(n);
|
|
1328
|
+
}, vr = (t, e) => {
|
|
1329
|
+
const { search: n } = D(e);
|
|
1330
|
+
return er(t).every((o) => o.test(n));
|
|
1331
|
+
}, wr = (t, e) => {
|
|
1332
|
+
const { hash: n } = D(e), r = t.hash.toString();
|
|
1322
1333
|
return !t.hash.hasValue() || r.toLowerCase() === n.toLowerCase();
|
|
1323
1334
|
};
|
|
1324
|
-
function
|
|
1325
|
-
const { searchParams: e, pathname: n } =
|
|
1335
|
+
function Pr(t) {
|
|
1336
|
+
const { searchParams: e, pathname: n } = D(t), r = -1, o = 1;
|
|
1326
1337
|
return (a, s) => {
|
|
1327
|
-
const
|
|
1338
|
+
const u = re(a, e), c = ne(a, n), f = re(s, e), i = ne(s, n);
|
|
1328
1339
|
if (a.depth > s.depth)
|
|
1329
1340
|
return r;
|
|
1330
1341
|
if (a.depth < s.depth)
|
|
1331
1342
|
return o;
|
|
1332
|
-
if (
|
|
1343
|
+
if (u + c > f + i)
|
|
1333
1344
|
return r;
|
|
1334
|
-
if (
|
|
1345
|
+
if (u + c < f + i)
|
|
1335
1346
|
return o;
|
|
1336
|
-
const { hash:
|
|
1337
|
-
return a.hash.toString() ===
|
|
1347
|
+
const { hash: h } = D(t);
|
|
1348
|
+
return a.hash.toString() === h ? r : s.hash.toString() === h ? o : 0;
|
|
1338
1349
|
};
|
|
1339
1350
|
}
|
|
1340
|
-
function
|
|
1341
|
-
const n = Object.keys(t.path.params).filter((o) => o.startsWith("?")).map((o) => o), r = n.filter((o) =>
|
|
1351
|
+
function ne(t, e) {
|
|
1352
|
+
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
1353
|
return n.length - r.length;
|
|
1343
1354
|
}
|
|
1344
|
-
function
|
|
1355
|
+
function re(t, e) {
|
|
1345
1356
|
const n = new URLSearchParams(t.query.toString()), r = Array.from(n.keys()), o = r.filter((a) => !e.has(a));
|
|
1346
1357
|
return r.length - o.length;
|
|
1347
1358
|
}
|
|
1348
|
-
function
|
|
1359
|
+
function _e(t) {
|
|
1349
1360
|
return !!t && typeof t == "object";
|
|
1350
1361
|
}
|
|
1351
|
-
const
|
|
1352
|
-
function
|
|
1353
|
-
if (
|
|
1362
|
+
const Pt = !0;
|
|
1363
|
+
function Er(t, e, n) {
|
|
1364
|
+
if (_e(t) && e in t) {
|
|
1354
1365
|
const r = t[e];
|
|
1355
1366
|
if (typeof r == "string")
|
|
1356
|
-
return
|
|
1367
|
+
return at(r, n, Pt);
|
|
1357
1368
|
}
|
|
1358
|
-
return
|
|
1369
|
+
return at(void 0, n, Pt);
|
|
1359
1370
|
}
|
|
1360
|
-
function
|
|
1371
|
+
function Sr(t, e) {
|
|
1361
1372
|
const n = {};
|
|
1362
1373
|
for (const [r, o] of Object.entries(t)) {
|
|
1363
|
-
const a =
|
|
1374
|
+
const a = Er(e, r, o);
|
|
1364
1375
|
n[r] = a;
|
|
1365
1376
|
}
|
|
1366
1377
|
return n;
|
|
1367
1378
|
}
|
|
1368
|
-
function
|
|
1369
|
-
if (
|
|
1379
|
+
function br(t, e, n) {
|
|
1380
|
+
if (_e(t) && e in t) {
|
|
1370
1381
|
const r = t[e];
|
|
1371
|
-
return
|
|
1382
|
+
return st(r, n, Pt);
|
|
1372
1383
|
}
|
|
1373
|
-
return
|
|
1384
|
+
return st(void 0, n, Pt);
|
|
1374
1385
|
}
|
|
1375
|
-
const
|
|
1386
|
+
const oe = (t, e) => {
|
|
1376
1387
|
const n = {};
|
|
1377
1388
|
for (const [r, o] of Object.entries(t)) {
|
|
1378
|
-
const a =
|
|
1389
|
+
const a = br(e, r, o);
|
|
1379
1390
|
n[r] = a;
|
|
1380
1391
|
}
|
|
1381
1392
|
return n;
|
|
1382
|
-
},
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1393
|
+
}, Ar = [
|
|
1394
|
+
Rr,
|
|
1395
|
+
yr,
|
|
1396
|
+
vr,
|
|
1397
|
+
wr,
|
|
1398
|
+
dr
|
|
1388
1399
|
];
|
|
1389
|
-
function
|
|
1390
|
-
const r =
|
|
1400
|
+
function Nt(t, e, n) {
|
|
1401
|
+
const r = Pr(e), o = t.filter((c) => Ar.every((f) => f(c, e))).sort(r);
|
|
1391
1402
|
if (o.length === 0)
|
|
1392
1403
|
return;
|
|
1393
|
-
const [a] = o, { search: s, hash:
|
|
1404
|
+
const [a] = o, { search: s, hash: u } = D(e);
|
|
1394
1405
|
return {
|
|
1406
|
+
id: a.id,
|
|
1395
1407
|
matched: a.matched,
|
|
1396
1408
|
matches: a.matches,
|
|
1397
1409
|
name: a.name,
|
|
1398
|
-
query:
|
|
1399
|
-
params:
|
|
1400
|
-
state:
|
|
1401
|
-
hash:
|
|
1410
|
+
query: Le(s),
|
|
1411
|
+
params: Oe(a, e),
|
|
1412
|
+
state: Sr(a.state, n),
|
|
1413
|
+
hash: u
|
|
1402
1414
|
};
|
|
1403
1415
|
}
|
|
1404
|
-
function
|
|
1405
|
-
let t = 0;
|
|
1406
|
-
return () => (++t).toString();
|
|
1407
|
-
}
|
|
1408
|
-
const Ve = wr();
|
|
1409
|
-
function Dt(t, e) {
|
|
1416
|
+
function Tt(t, e) {
|
|
1410
1417
|
const n = new RegExp(`\\${T}(\\??[\\w-_]+)\\${Q}`, "g");
|
|
1411
1418
|
return Array.from(t.matchAll(n)).reduce((o, [a, s]) => {
|
|
1412
|
-
const
|
|
1413
|
-
if (!
|
|
1419
|
+
const u = At(a);
|
|
1420
|
+
if (!u)
|
|
1414
1421
|
return o;
|
|
1415
|
-
const
|
|
1416
|
-
return et([
|
|
1422
|
+
const c = Ln(e, u);
|
|
1423
|
+
return et([u], o), o[s] = c, o;
|
|
1417
1424
|
}, {});
|
|
1418
1425
|
}
|
|
1419
|
-
function
|
|
1426
|
+
function qe(t, e) {
|
|
1420
1427
|
return {
|
|
1421
1428
|
value: t,
|
|
1422
|
-
params:
|
|
1429
|
+
params: Tt(t, e),
|
|
1423
1430
|
toString: () => t
|
|
1424
1431
|
};
|
|
1425
1432
|
}
|
|
1426
|
-
function
|
|
1427
|
-
return
|
|
1433
|
+
function xr(t) {
|
|
1434
|
+
return ft(t) && typeof t.hash == "string";
|
|
1428
1435
|
}
|
|
1429
|
-
function
|
|
1430
|
-
return t === void 0 ?
|
|
1436
|
+
function Me(t) {
|
|
1437
|
+
return t === void 0 ? mt() : xr(t) ? t : mt(t);
|
|
1431
1438
|
}
|
|
1432
|
-
function
|
|
1439
|
+
function It(t) {
|
|
1433
1440
|
return t === void 0 ? "" : t;
|
|
1434
1441
|
}
|
|
1435
|
-
function
|
|
1442
|
+
function ae(t, e) {
|
|
1436
1443
|
return {
|
|
1437
1444
|
value: t,
|
|
1438
|
-
params:
|
|
1445
|
+
params: Tt(t, e),
|
|
1439
1446
|
toString: () => t
|
|
1440
1447
|
};
|
|
1441
1448
|
}
|
|
1442
|
-
function
|
|
1443
|
-
return
|
|
1449
|
+
function kr(t) {
|
|
1450
|
+
return ft(t) && typeof t.value == "string";
|
|
1444
1451
|
}
|
|
1445
|
-
function
|
|
1446
|
-
return t === void 0 ?
|
|
1452
|
+
function We(t) {
|
|
1453
|
+
return t === void 0 ? ae("", {}) : kr(t) ? t : ae(t, {});
|
|
1447
1454
|
}
|
|
1448
|
-
function
|
|
1455
|
+
function se(t, e) {
|
|
1449
1456
|
return {
|
|
1450
1457
|
value: t,
|
|
1451
|
-
params:
|
|
1458
|
+
params: Tt(t, e),
|
|
1452
1459
|
toString: () => t
|
|
1453
1460
|
};
|
|
1454
1461
|
}
|
|
1455
|
-
function
|
|
1456
|
-
return
|
|
1462
|
+
function Br(t) {
|
|
1463
|
+
return ft(t) && typeof t.value == "string";
|
|
1457
1464
|
}
|
|
1458
|
-
function
|
|
1459
|
-
return t === void 0 ?
|
|
1465
|
+
function De(t) {
|
|
1466
|
+
return t === void 0 ? se("", {}) : Br(t) ? t : se(t, {});
|
|
1460
1467
|
}
|
|
1461
1468
|
function J(t) {
|
|
1462
|
-
const e =
|
|
1469
|
+
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
1470
|
id: e,
|
|
1464
|
-
matched:
|
|
1465
|
-
matches: [
|
|
1471
|
+
matched: c,
|
|
1472
|
+
matches: [c],
|
|
1466
1473
|
name: n,
|
|
1467
1474
|
path: r,
|
|
1468
1475
|
query: o,
|
|
1469
1476
|
hash: a,
|
|
1470
1477
|
meta: s,
|
|
1471
|
-
state:
|
|
1478
|
+
state: u,
|
|
1472
1479
|
depth: 1,
|
|
1473
|
-
host:
|
|
1480
|
+
host: qe("", {}),
|
|
1474
1481
|
prefetch: t.prefetch
|
|
1475
|
-
},
|
|
1476
|
-
return et(
|
|
1482
|
+
}, i = ge(t) ? Re(t.parent, f) : f;
|
|
1483
|
+
return et(i.path.params, i.query.params), i;
|
|
1477
1484
|
}
|
|
1478
|
-
function
|
|
1479
|
-
if (!
|
|
1485
|
+
function Lr(t, e) {
|
|
1486
|
+
if (!lt(e))
|
|
1480
1487
|
return t;
|
|
1481
1488
|
const n = J({ path: e });
|
|
1482
1489
|
return t.map((r) => J({
|
|
@@ -1484,7 +1491,7 @@ function br(t, e) {
|
|
|
1484
1491
|
...r
|
|
1485
1492
|
}));
|
|
1486
1493
|
}
|
|
1487
|
-
class
|
|
1494
|
+
class Nr extends Error {
|
|
1488
1495
|
/**
|
|
1489
1496
|
* Constructs a new DuplicateNamesError instance with a message indicating the problematic name.
|
|
1490
1497
|
* @param name - The name of the name that was duplicated.
|
|
@@ -1493,244 +1500,313 @@ class Ar extends Error {
|
|
|
1493
1500
|
super(`Invalid Name "${e}": Router does not support multiple routes with the same name. All name names must be unique.`);
|
|
1494
1501
|
}
|
|
1495
1502
|
}
|
|
1496
|
-
function
|
|
1503
|
+
function Ur(t) {
|
|
1497
1504
|
const e = t.map(({ name: n }) => n);
|
|
1498
1505
|
for (const n of e)
|
|
1499
|
-
if (
|
|
1500
|
-
throw new
|
|
1506
|
+
if (me(e, n) > 1)
|
|
1507
|
+
throw new Nr(n);
|
|
1501
1508
|
}
|
|
1502
|
-
function
|
|
1503
|
-
const n =
|
|
1504
|
-
|
|
1505
|
-
const o =
|
|
1509
|
+
function Kr(t, e) {
|
|
1510
|
+
const n = hn(t) ? t.flat() : t, r = Lr(n, e == null ? void 0 : e.base);
|
|
1511
|
+
Ur(r);
|
|
1512
|
+
const o = Vr(), a = lr(r), s = Dn({
|
|
1506
1513
|
mode: e == null ? void 0 : e.historyMode,
|
|
1507
|
-
listener: ({ location:
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1514
|
+
listener: ({ location: R }) => {
|
|
1515
|
+
const L = K(R);
|
|
1516
|
+
A(L, { state: R.state });
|
|
1510
1517
|
}
|
|
1511
|
-
}), { runBeforeRouteHooks:
|
|
1512
|
-
hooks:
|
|
1513
|
-
onBeforeRouteEnter:
|
|
1518
|
+
}), { runBeforeRouteHooks: u, runAfterRouteHooks: c } = Jn(), {
|
|
1519
|
+
hooks: f,
|
|
1520
|
+
onBeforeRouteEnter: i,
|
|
1514
1521
|
onAfterRouteUpdate: h,
|
|
1515
|
-
onBeforeRouteLeave:
|
|
1516
|
-
onAfterRouteEnter:
|
|
1517
|
-
onBeforeRouteUpdate:
|
|
1518
|
-
onAfterRouteLeave:
|
|
1519
|
-
} =
|
|
1520
|
-
async function
|
|
1521
|
-
if (
|
|
1522
|
-
|
|
1523
|
-
|
|
1522
|
+
onBeforeRouteLeave: y,
|
|
1523
|
+
onAfterRouteEnter: p,
|
|
1524
|
+
onBeforeRouteUpdate: S,
|
|
1525
|
+
onAfterRouteLeave: E
|
|
1526
|
+
} = Gn();
|
|
1527
|
+
async function A(R, L = {}) {
|
|
1528
|
+
if (s.stopListening(), C(R)) {
|
|
1529
|
+
s.update(R, L);
|
|
1530
|
+
return;
|
|
1531
|
+
}
|
|
1532
|
+
const O = Nt(r, R, L.state) ?? m("NotFound"), _ = { ...d }, z = await u({ to: O, from: _, hooks: f });
|
|
1524
1533
|
switch (z.status) {
|
|
1525
1534
|
case "ABORT":
|
|
1526
1535
|
return;
|
|
1527
1536
|
case "PUSH":
|
|
1528
|
-
|
|
1537
|
+
s.update(R, L), await k(...z.to);
|
|
1529
1538
|
return;
|
|
1530
1539
|
case "REJECT":
|
|
1531
|
-
|
|
1540
|
+
s.update(R, L), b(z.type);
|
|
1532
1541
|
break;
|
|
1533
1542
|
case "SUCCESS":
|
|
1534
|
-
|
|
1543
|
+
s.update(R, L), b(null);
|
|
1535
1544
|
break;
|
|
1536
1545
|
default:
|
|
1537
1546
|
throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(z)}`);
|
|
1538
1547
|
}
|
|
1539
|
-
|
|
1548
|
+
o.setProps(O), P(O);
|
|
1549
|
+
const I = await c({ to: O, from: _, hooks: f });
|
|
1540
1550
|
switch (I.status) {
|
|
1541
1551
|
case "PUSH":
|
|
1542
1552
|
await k(...I.to);
|
|
1543
1553
|
break;
|
|
1544
1554
|
case "REJECT":
|
|
1545
|
-
|
|
1555
|
+
b(I.type);
|
|
1546
1556
|
break;
|
|
1547
1557
|
case "SUCCESS":
|
|
1548
1558
|
break;
|
|
1549
1559
|
default:
|
|
1550
|
-
const
|
|
1551
|
-
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(
|
|
1560
|
+
const q = I;
|
|
1561
|
+
throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(q)}`);
|
|
1552
1562
|
}
|
|
1553
|
-
|
|
1563
|
+
s.startListening();
|
|
1554
1564
|
}
|
|
1555
|
-
const k = (
|
|
1556
|
-
if (
|
|
1557
|
-
const nt = { ...
|
|
1558
|
-
return
|
|
1565
|
+
const k = (R, L, O) => {
|
|
1566
|
+
if (W(R)) {
|
|
1567
|
+
const nt = { ...L }, Bt = a(R, nt);
|
|
1568
|
+
return A(Bt, nt);
|
|
1559
1569
|
}
|
|
1560
|
-
const
|
|
1561
|
-
return
|
|
1562
|
-
},
|
|
1563
|
-
if (
|
|
1564
|
-
const nt = { ...
|
|
1565
|
-
return
|
|
1570
|
+
const _ = { ...O }, I = a(R, L ?? {}, _), q = Kt(R), kt = oe((q == null ? void 0 : q.state) ?? {}, _.state);
|
|
1571
|
+
return A(I, { ..._, state: kt });
|
|
1572
|
+
}, j = (R, L, O) => {
|
|
1573
|
+
if (W(R)) {
|
|
1574
|
+
const nt = { ...L, replace: !0 }, Bt = a(R, nt);
|
|
1575
|
+
return A(Bt, nt);
|
|
1566
1576
|
}
|
|
1567
|
-
const
|
|
1568
|
-
return
|
|
1569
|
-
},
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1577
|
+
const _ = { ...O, replace: !0 }, I = a(R, L ?? {}, _), q = Kt(R), kt = oe((q == null ? void 0 : q.state) ?? {}, _.state);
|
|
1578
|
+
return A(I, { ..._, state: kt });
|
|
1579
|
+
}, g = (R) => {
|
|
1580
|
+
b(R);
|
|
1581
|
+
}, v = (R, L = {}) => {
|
|
1582
|
+
if (!W(R)) {
|
|
1583
|
+
const O = a(R, L);
|
|
1584
|
+
return Nt(r, O);
|
|
1573
1585
|
}
|
|
1574
|
-
if (!
|
|
1575
|
-
return
|
|
1576
|
-
}, { setRejection:
|
|
1577
|
-
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1586
|
+
if (!C(R))
|
|
1587
|
+
return Nt(r, R);
|
|
1588
|
+
}, { setRejection: b, rejection: x, getRejectionRoute: m } = Yn(e ?? {}), l = m("NotFound"), { currentRoute: d, routerRoute: w, updateRoute: P } = _n(l, k);
|
|
1589
|
+
s.startListening();
|
|
1590
|
+
const B = pr(e == null ? void 0 : e.initialUrl), N = s.location.state, { host: $ } = D(B), C = Wn($);
|
|
1591
|
+
let xt = !1;
|
|
1592
|
+
async function Gt() {
|
|
1593
|
+
xt || (await A(B, { replace: !0, state: N }), xt = !0);
|
|
1594
|
+
}
|
|
1595
|
+
function Kt(R) {
|
|
1596
|
+
return r.find((L) => L.name === R);
|
|
1597
|
+
}
|
|
1598
|
+
function ze(R) {
|
|
1599
|
+
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();
|
|
1600
|
+
}
|
|
1601
|
+
const zt = {
|
|
1602
|
+
route: w,
|
|
1603
|
+
resolve: a,
|
|
1588
1604
|
push: k,
|
|
1589
|
-
replace:
|
|
1590
|
-
reject:
|
|
1591
|
-
find:
|
|
1592
|
-
refresh:
|
|
1593
|
-
forward:
|
|
1594
|
-
back:
|
|
1595
|
-
go:
|
|
1596
|
-
install:
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
onBeforeRouteEnter: l,
|
|
1605
|
+
replace: j,
|
|
1606
|
+
reject: g,
|
|
1607
|
+
find: v,
|
|
1608
|
+
refresh: s.refresh,
|
|
1609
|
+
forward: s.forward,
|
|
1610
|
+
back: s.back,
|
|
1611
|
+
go: s.go,
|
|
1612
|
+
install: ze,
|
|
1613
|
+
isExternal: C,
|
|
1614
|
+
onBeforeRouteEnter: i,
|
|
1600
1615
|
onAfterRouteUpdate: h,
|
|
1601
|
-
onBeforeRouteLeave:
|
|
1602
|
-
onAfterRouteEnter:
|
|
1603
|
-
onBeforeRouteUpdate:
|
|
1604
|
-
onAfterRouteLeave:
|
|
1605
|
-
prefetch: e == null ? void 0 : e.prefetch
|
|
1616
|
+
onBeforeRouteLeave: y,
|
|
1617
|
+
onAfterRouteEnter: p,
|
|
1618
|
+
onBeforeRouteUpdate: S,
|
|
1619
|
+
onAfterRouteLeave: E,
|
|
1620
|
+
prefetch: e == null ? void 0 : e.prefetch,
|
|
1621
|
+
start: Gt
|
|
1606
1622
|
};
|
|
1607
|
-
return
|
|
1623
|
+
return zt;
|
|
1608
1624
|
}
|
|
1609
|
-
const
|
|
1625
|
+
const Et = { template: "<div>This is component</div>" }, Ft = J({
|
|
1610
1626
|
name: "parentA",
|
|
1611
1627
|
path: "/parentA/[paramA]"
|
|
1612
|
-
}),
|
|
1613
|
-
parent:
|
|
1628
|
+
}), Te = J({
|
|
1629
|
+
parent: Ft,
|
|
1614
1630
|
name: "parentA.childA",
|
|
1615
1631
|
path: "/[?paramB]"
|
|
1616
|
-
}),
|
|
1617
|
-
parent:
|
|
1632
|
+
}), Cr = J({
|
|
1633
|
+
parent: Ft,
|
|
1618
1634
|
name: "parentA.childB",
|
|
1619
1635
|
path: "/[paramD]",
|
|
1620
|
-
component:
|
|
1621
|
-
}),
|
|
1622
|
-
parent:
|
|
1636
|
+
component: Et
|
|
1637
|
+
}), $r = J({
|
|
1638
|
+
parent: Te,
|
|
1623
1639
|
name: "parentA.childA.grandChildA",
|
|
1624
1640
|
path: "/[paramC]",
|
|
1625
|
-
component:
|
|
1641
|
+
component: Et
|
|
1626
1642
|
});
|
|
1627
1643
|
J({
|
|
1628
1644
|
name: "parentB",
|
|
1629
1645
|
path: "/parentB",
|
|
1630
|
-
component:
|
|
1646
|
+
component: Et
|
|
1631
1647
|
}), J({
|
|
1632
1648
|
name: "parentC",
|
|
1633
1649
|
path: "/",
|
|
1634
|
-
component:
|
|
1650
|
+
component: Et
|
|
1635
1651
|
});
|
|
1636
|
-
const
|
|
1637
|
-
components: !0
|
|
1652
|
+
const Hr = {
|
|
1653
|
+
components: !0,
|
|
1654
|
+
props: !1
|
|
1638
1655
|
};
|
|
1639
|
-
function
|
|
1640
|
-
return
|
|
1656
|
+
function Ie({ routerPrefetch: t, routePrefetch: e, linkPrefetch: n }, r) {
|
|
1657
|
+
return Ut(n, r) ?? Ut(e, r) ?? Ut(t, r) ?? Hr[r];
|
|
1658
|
+
}
|
|
1659
|
+
function Ut(t, e) {
|
|
1660
|
+
return ft(t) ? t[e] : t;
|
|
1661
|
+
}
|
|
1662
|
+
const Fe = Symbol();
|
|
1663
|
+
function Vr() {
|
|
1664
|
+
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 }) => {
|
|
1665
|
+
const S = a(h, y, c);
|
|
1666
|
+
return i[S] = p == null ? void 0 : p(c.params), i;
|
|
1667
|
+
}, {}), n = (c) => {
|
|
1668
|
+
Object.entries(c).forEach(([f, i]) => {
|
|
1669
|
+
t.set(f, i);
|
|
1670
|
+
});
|
|
1671
|
+
}, r = (c) => {
|
|
1672
|
+
const i = c.matches.flatMap(s).reduce((h, { id: y, name: p, props: S }) => {
|
|
1673
|
+
const E = a(y, p, c);
|
|
1674
|
+
if (!S || t.has(E))
|
|
1675
|
+
return h;
|
|
1676
|
+
const A = S(c.params);
|
|
1677
|
+
return t.set(E, A), h.push(E), h;
|
|
1678
|
+
}, []);
|
|
1679
|
+
u(i);
|
|
1680
|
+
}, o = (c, f, i) => {
|
|
1681
|
+
const h = a(c, f, i);
|
|
1682
|
+
return t.get(h);
|
|
1683
|
+
};
|
|
1684
|
+
function a(c, f, i) {
|
|
1685
|
+
return [c, f, i.id, JSON.stringify(i.params)].join("-");
|
|
1686
|
+
}
|
|
1687
|
+
function s(c) {
|
|
1688
|
+
return Vt(c) ? Object.entries(c.props ?? {}).map(([f, i]) => ({ id: c.id, name: f, props: i })) : Ht(c) ? [
|
|
1689
|
+
{
|
|
1690
|
+
id: c.id,
|
|
1691
|
+
name: "default",
|
|
1692
|
+
props: c.props
|
|
1693
|
+
}
|
|
1694
|
+
] : [];
|
|
1695
|
+
}
|
|
1696
|
+
function u(c) {
|
|
1697
|
+
for (const f in t.keys())
|
|
1698
|
+
c.includes(f) || t.delete(f);
|
|
1699
|
+
}
|
|
1700
|
+
return {
|
|
1701
|
+
getPrefetchProps: e,
|
|
1702
|
+
setPrefetchProps: n,
|
|
1703
|
+
getProps: o,
|
|
1704
|
+
setProps: r
|
|
1705
|
+
};
|
|
1641
1706
|
}
|
|
1642
|
-
function
|
|
1643
|
-
|
|
1707
|
+
function Je() {
|
|
1708
|
+
const t = it(Fe);
|
|
1709
|
+
if (!t)
|
|
1710
|
+
throw new St();
|
|
1711
|
+
return t;
|
|
1644
1712
|
}
|
|
1645
|
-
const
|
|
1646
|
-
t({ default: { template: "" } });
|
|
1713
|
+
const jr = tn(() => new Promise((t) => {
|
|
1714
|
+
t({ default: { template: "foo" } });
|
|
1647
1715
|
}));
|
|
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
|
-
});
|
|
1716
|
+
function ce(t) {
|
|
1717
|
+
return t.name === jr.name && "setup" in t;
|
|
1718
|
+
}
|
|
1719
|
+
function Or(t) {
|
|
1720
|
+
let e = {};
|
|
1721
|
+
const { getPrefetchProps: n, setPrefetchProps: r } = Je();
|
|
1722
|
+
return fe(() => ht(t), ({ route: a, ...s }) => {
|
|
1723
|
+
a && (_r(a, s), e = n(a, s));
|
|
1669
1724
|
}, { 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 })
|
|
1725
|
+
commit: () => {
|
|
1726
|
+
r(e);
|
|
1727
|
+
}
|
|
1676
1728
|
};
|
|
1677
1729
|
}
|
|
1678
|
-
function
|
|
1730
|
+
function _r(t, { routerPrefetch: e, linkPrefetch: n }) {
|
|
1679
1731
|
t.matches.forEach((r) => {
|
|
1680
|
-
|
|
1732
|
+
Ie({
|
|
1681
1733
|
routePrefetch: r.prefetch,
|
|
1682
1734
|
routerPrefetch: e,
|
|
1683
1735
|
linkPrefetch: n
|
|
1684
|
-
}, "components") && (
|
|
1685
|
-
|
|
1736
|
+
}, "components") && (Ht(r) && ce(r.component) && r.component.setup(), Vt(r) && Object.values(r.components).forEach((a) => {
|
|
1737
|
+
ce(a) && a.setup();
|
|
1686
1738
|
}));
|
|
1687
1739
|
});
|
|
1688
1740
|
}
|
|
1689
|
-
function
|
|
1690
|
-
|
|
1741
|
+
function qr(t, e = {}, n = {}) {
|
|
1742
|
+
const r = jt(), o = en(t), a = V(() => W(o.value) ? {} : ht(e)), s = V(() => W(o.value) ? ht(e) : ht(n)), u = V(() => {
|
|
1743
|
+
if (W(o.value))
|
|
1744
|
+
return o.value;
|
|
1745
|
+
try {
|
|
1746
|
+
return r.resolve(o.value, a.value, s.value);
|
|
1747
|
+
} catch (E) {
|
|
1748
|
+
throw E instanceof X && console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`, E), E;
|
|
1749
|
+
}
|
|
1750
|
+
}), 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(() => ({
|
|
1751
|
+
route: c.value,
|
|
1752
|
+
routerPrefetch: r.prefetch,
|
|
1753
|
+
linkPrefetch: s.value.prefetch
|
|
1754
|
+
})), p = (E) => (y(), r.push(u.value, { ...s.value, ...E }));
|
|
1755
|
+
return {
|
|
1756
|
+
route: c,
|
|
1757
|
+
href: u,
|
|
1758
|
+
isMatch: f,
|
|
1759
|
+
isExactMatch: i,
|
|
1760
|
+
isExternal: h,
|
|
1761
|
+
push: p,
|
|
1762
|
+
replace: (E) => p(E)
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
function Mr(t, e, { exact: n } = {}) {
|
|
1766
|
+
if (!jn(t))
|
|
1691
1767
|
return !1;
|
|
1692
1768
|
if (e === void 0)
|
|
1693
1769
|
return !0;
|
|
1694
|
-
const r = t.matches.map((o) =>
|
|
1770
|
+
const r = t.matches.map((o) => It(o.name));
|
|
1695
1771
|
if (n) {
|
|
1696
1772
|
const o = r.at(-1);
|
|
1697
1773
|
return e === o;
|
|
1698
1774
|
}
|
|
1699
1775
|
return r.includes(e);
|
|
1700
1776
|
}
|
|
1701
|
-
function
|
|
1702
|
-
const n =
|
|
1777
|
+
function Wr(t, e) {
|
|
1778
|
+
const n = jt();
|
|
1703
1779
|
function r() {
|
|
1704
1780
|
if (!t)
|
|
1705
1781
|
return;
|
|
1706
|
-
if (!
|
|
1707
|
-
throw new
|
|
1782
|
+
if (!Mr(n.route, t, e))
|
|
1783
|
+
throw new Hn(t, n.route.name);
|
|
1708
1784
|
}
|
|
1709
|
-
return
|
|
1785
|
+
return fe(n.route, r, { immediate: !0, deep: !0 }), n.route;
|
|
1710
1786
|
}
|
|
1711
|
-
const
|
|
1712
|
-
function
|
|
1713
|
-
return
|
|
1787
|
+
const Qe = Symbol();
|
|
1788
|
+
function Jt() {
|
|
1789
|
+
return it(Qe, 0);
|
|
1714
1790
|
}
|
|
1715
|
-
function
|
|
1716
|
-
const t =
|
|
1791
|
+
function Ge() {
|
|
1792
|
+
const t = it(Be);
|
|
1717
1793
|
if (!t)
|
|
1718
|
-
throw new
|
|
1794
|
+
throw new St();
|
|
1719
1795
|
return t;
|
|
1720
1796
|
}
|
|
1721
|
-
function
|
|
1797
|
+
function Ke(t) {
|
|
1722
1798
|
return (e) => {
|
|
1723
|
-
const n =
|
|
1724
|
-
return
|
|
1799
|
+
const n = Jt(), o = Ge().addBeforeRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
1800
|
+
return le(o), o;
|
|
1725
1801
|
};
|
|
1726
1802
|
}
|
|
1727
|
-
function
|
|
1803
|
+
function Qt(t) {
|
|
1728
1804
|
return (e) => {
|
|
1729
|
-
const n =
|
|
1730
|
-
return
|
|
1805
|
+
const n = Jt(), o = Ge().addAfterRouteHook({ lifecycle: t, hook: e, depth: n, timing: "component" });
|
|
1806
|
+
return le(o), o;
|
|
1731
1807
|
};
|
|
1732
1808
|
}
|
|
1733
|
-
const
|
|
1809
|
+
const zr = Ke("onBeforeRouteUpdate"), Yr = Ke("onBeforeRouteLeave"), Xr = Qt("onAfterRouteEnter"), Zr = Qt("onAfterRouteUpdate"), to = Qt("onAfterRouteLeave"), Dr = ["href"], Tr = /* @__PURE__ */ ut({
|
|
1734
1810
|
__name: "routerLink",
|
|
1735
1811
|
props: {
|
|
1736
1812
|
to: {},
|
|
@@ -1741,105 +1817,100 @@ const Ir = Te("onBeforeRouteUpdate"), Fr = Te("onBeforeRouteLeave"), Jr = Ft("on
|
|
|
1741
1817
|
state: {}
|
|
1742
1818
|
},
|
|
1743
1819
|
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
|
-
|
|
1820
|
+
const e = t, n = jt(), r = V(() => W(e.to) ? e.to : e.to(n.resolve)), o = V(() => {
|
|
1821
|
+
const { to: h, ...y } = e;
|
|
1822
|
+
return y;
|
|
1823
|
+
}), { isMatch: a, isExactMatch: s, isExternal: u, push: c } = qr(r, o), f = V(() => ({
|
|
1824
|
+
"router-link--match": a.value,
|
|
1825
|
+
"router-link--exact-match": s.value
|
|
1826
|
+
}));
|
|
1827
|
+
function i(h) {
|
|
1828
|
+
h.preventDefault(), c();
|
|
1753
1829
|
}
|
|
1754
|
-
return (
|
|
1830
|
+
return (h, y) => (he(), nn("a", {
|
|
1755
1831
|
href: r.value,
|
|
1756
|
-
class:
|
|
1757
|
-
onClick:
|
|
1832
|
+
class: rn(["router-link", f.value]),
|
|
1833
|
+
onClick: i
|
|
1758
1834
|
}, [
|
|
1759
|
-
|
|
1760
|
-
], 10,
|
|
1835
|
+
pe(h.$slots, "default", de(on({ resolved: r.value, isMatch: ot(a), isExactMatch: ot(s), isExternal: ot(u) })))
|
|
1836
|
+
], 10, Dr));
|
|
1761
1837
|
}
|
|
1762
|
-
}),
|
|
1838
|
+
}), Ir = /* @__PURE__ */ ut({
|
|
1763
1839
|
__name: "routerView",
|
|
1764
1840
|
props: {
|
|
1765
1841
|
name: {}
|
|
1766
1842
|
},
|
|
1767
1843
|
setup(t) {
|
|
1768
|
-
const { name: e = "default" } = t, n =
|
|
1769
|
-
|
|
1770
|
-
const
|
|
1844
|
+
const { name: e = "default" } = t, n = Wr(), r = Vn(), o = Jt(), { getProps: a } = Je(), s = an("RouterView", !0);
|
|
1845
|
+
sn(Qe, o + 1);
|
|
1846
|
+
const u = V(() => {
|
|
1771
1847
|
if (r.value)
|
|
1772
1848
|
return r.value.component;
|
|
1773
1849
|
const i = n.matches.at(o);
|
|
1774
1850
|
if (!i)
|
|
1775
1851
|
return null;
|
|
1776
|
-
const
|
|
1777
|
-
return
|
|
1852
|
+
const h = c(i), y = a(i.id, e, n);
|
|
1853
|
+
return h ? y ? bn(h, () => y) : h : null;
|
|
1778
1854
|
});
|
|
1779
1855
|
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];
|
|
1856
|
+
return f(i)[e];
|
|
1787
1857
|
}
|
|
1788
|
-
function
|
|
1789
|
-
return
|
|
1858
|
+
function f(i) {
|
|
1859
|
+
return Vt(i) ? i.components : Ht(i) ? { default: i.component } : typeof s == "string" ? {} : { default: s };
|
|
1790
1860
|
}
|
|
1791
|
-
return (i,
|
|
1792
|
-
(
|
|
1793
|
-
]) :
|
|
1861
|
+
return (i, h) => u.value ? pe(i.$slots, "default", de(cn({ key: 0 }, { route: ot(n), component: u.value, rejection: ot(r) })), () => [
|
|
1862
|
+
(he(), un(fn(u.value)))
|
|
1863
|
+
]) : ln("", !0);
|
|
1794
1864
|
}
|
|
1795
1865
|
});
|
|
1796
|
-
function
|
|
1797
|
-
return
|
|
1866
|
+
function Fr(t) {
|
|
1867
|
+
return ft(t) && typeof t.value == "string";
|
|
1798
1868
|
}
|
|
1799
|
-
function
|
|
1800
|
-
return
|
|
1869
|
+
function ue(t) {
|
|
1870
|
+
return Fr(t) ? t : qe(t, {});
|
|
1801
1871
|
}
|
|
1802
|
-
function
|
|
1803
|
-
const e =
|
|
1872
|
+
function eo(t) {
|
|
1873
|
+
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
1874
|
id: e,
|
|
1805
|
-
matched:
|
|
1806
|
-
matches: [
|
|
1875
|
+
matched: c,
|
|
1876
|
+
matches: [c],
|
|
1807
1877
|
name: n,
|
|
1808
|
-
host:
|
|
1878
|
+
host: u,
|
|
1809
1879
|
path: r,
|
|
1810
1880
|
query: o,
|
|
1811
1881
|
hash: a,
|
|
1812
1882
|
meta: s,
|
|
1813
1883
|
depth: 1,
|
|
1814
1884
|
state: {}
|
|
1815
|
-
},
|
|
1816
|
-
return et(
|
|
1885
|
+
}, i = ge(t) ? Re(t.parent, f) : f;
|
|
1886
|
+
return et(i.path.params, i.query.params, i.host.params), i;
|
|
1817
1887
|
}
|
|
1818
1888
|
export {
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1889
|
+
Rn as DuplicateParamsError,
|
|
1890
|
+
Tr as RouterLink,
|
|
1891
|
+
St as RouterNotInstalledError,
|
|
1892
|
+
Ir as RouterView,
|
|
1893
|
+
Hn as UseRouteInvalidError,
|
|
1894
|
+
bn as component,
|
|
1895
|
+
eo as createExternalRoute,
|
|
1896
|
+
Un as createParam,
|
|
1827
1897
|
J as createRoute,
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1898
|
+
Kr as createRouter,
|
|
1899
|
+
Bn as isParamWithDefault,
|
|
1900
|
+
Mr as isRoute,
|
|
1901
|
+
W as isUrl,
|
|
1902
|
+
Xr as onAfterRouteEnter,
|
|
1903
|
+
Zr as onAfterRouteLeave,
|
|
1904
|
+
to as onAfterRouteUpdate,
|
|
1905
|
+
zr as onBeforeRouteLeave,
|
|
1906
|
+
Yr as onBeforeRouteUpdate,
|
|
1907
|
+
ae as path,
|
|
1908
|
+
se as query,
|
|
1909
|
+
Ae as routerInjectionKey,
|
|
1910
|
+
be as routerRejectionKey,
|
|
1911
|
+
qr as useLink,
|
|
1912
|
+
Vn as useRejection,
|
|
1913
|
+
Wr as useRoute,
|
|
1914
|
+
jt as useRouter,
|
|
1915
|
+
Gr as withDefault
|
|
1845
1916
|
};
|