@kitbag/router 0.7.0 → 0.7.2

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