@kitbag/router 0.5.1 → 0.5.3

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