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