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